container/doc/Creating containers - Part .../donate_data/radio-player-controller.js

99 lines
152 KiB
JavaScript

// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3.0
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=83)}({2:function(e,t,n){"use strict";function r(e){return(r="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 i(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,c,"next",e)}function c(e){i(o,r,a,s,c,"throw",e)}s(void 0)}))}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e,t,n){return(y=v()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&p(i,n.prototype),i}).apply(null,arguments)}function b(e){var t="function"==typeof Map?new Map:void 0;return(b=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return y(e,arguments,f(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)})(e)}function m(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e){var t=v();return function(){var n,r=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m(this,n)}}function w(e,t,n){return(w="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function k(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function O(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||j(e)||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.")}()}function j(e,t){if(e){if("string"==typeof e)return S(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)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function x(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=j(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return x})),n.d(t,"d",(function(){return O})),n.d(t,"e",(function(){return d})),n.d(t,"f",(function(){return g})),n.d(t,"g",(function(){return w})),n.d(t,"h",(function(){return f})),n.d(t,"i",(function(){return r})),n.d(t,"j",(function(){return b})),n.d(t,"k",(function(){return a})),n.d(t,"l",(function(){return k})),n.d(t,"m",(function(){return h}))},3:function(e,t,n){"use strict";n.d(t,"a",(function(){return ie})),n.d(t,"b",(function(){return ne})),n.d(t,"c",(function(){return K})),n.d(t,"d",(function(){return q})),n.d(t,"e",(function(){return X}));var r=n(2),i="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,a=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t!==n;){var r=t.nextSibling;e.removeChild(t),t=r}},o="{{lit-".concat(String(Math.random()).slice(2),"}}"),s="\x3c!--".concat(o,"--\x3e"),c=new RegExp("".concat(o,"|").concat(s)),u=function e(t,n){Object(r.a)(this,e),this.parts=[],this.element=n;for(var i=[],a=[],s=document.createTreeWalker(n.content,133,null,!1),u=0,h=-1,p=0,v=t.strings,y=t.values.length;p<y;){var b=s.nextNode();if(null!==b){if(h++,1===b.nodeType){if(b.hasAttributes()){for(var m=b.attributes,g=m.length,w=0,k=0;k<g;k++)l(m[k].name,"$lit$")&&w++;for(;w-- >0;){var O=v[p],j=f.exec(O)[2],S=j.toLowerCase()+"$lit$",x=b.getAttribute(S);b.removeAttribute(S);var E=x.split(c);this.parts.push({type:"attribute",index:h,name:j,strings:E}),p+=E.length-1}}"TEMPLATE"===b.tagName&&(a.push(b),s.currentNode=b.content)}else if(3===b.nodeType){var T=b.data;if(T.indexOf(o)>=0){for(var C=b.parentNode,_=T.split(c),P=_.length-1,R=0;R<P;R++){var B=void 0,I=_[R];if(""===I)B=d();else{var A=f.exec(I);null!==A&&l(A[2],"$lit$")&&(I=I.slice(0,A.index)+A[1]+A[2].slice(0,-"$lit$".length)+A[3]),B=document.createTextNode(I)}C.insertBefore(B,b),this.parts.push({type:"node",index:++h})}""===_[P]?(C.insertBefore(d(),b),i.push(b)):b.data=_[P],p+=P}}else if(8===b.nodeType)if(b.data===o){var M=b.parentNode;null!==b.previousSibling&&h!==u||(h++,M.insertBefore(d(),b)),u=h,this.parts.push({type:"node",index:h}),null===b.nextSibling?b.data="":(i.push(b),h--),p++}else for(var N=-1;-1!==(N=b.data.indexOf(o,N+1));)this.parts.push({type:"node",index:-1}),p++}else s.currentNode=a.pop()}for(var F=0,U=i;F<U.length;F++){var q=U[F];q.parentNode.removeChild(q)}},l=function(e,t){var n=e.length-t.length;return n>=0&&e.slice(n)===t},h=function(e){return-1!==e.index},d=function(){return document.createComment("")},f=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/function p(e,t){for(var n=e.element.content,r=e.parts,i=document.createTreeWalker(n,133,null,!1),a=y(r),o=r[a],s=-1,c=0,u=[],l=null;i.nextNode();){s++;var h=i.currentNode;for(h.previousSibling===l&&(l=null),t.has(h)&&(u.push(h),null===l&&(l=h)),null!==l&&c++;void 0!==o&&o.index===s;)o.index=null!==l?-1:o.index-c,o=r[a=y(r,a)]}u.forEach((function(e){return e.parentNode.removeChild(e)}))}var v=function(e){for(var t=11===e.nodeType?0:1,n=document.createTreeWalker(e,133,null,!1);n.nextNode();)t++;return t},y=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=t+1;n<e.length;n++){var r=e[n];if(h(r))return n}return-1};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
var b=new WeakMap,m=function(e){return"function"==typeof e&&b.has(e)},g={},w={},k=function(){function e(t,n,i){Object(r.a)(this,e),this.__parts=[],this.template=t,this.processor=n,this.options=i}return Object(r.b)(e,[{key:"update",value:function(e){var t,n=0,i=Object(r.c)(this.__parts);try{for(i.s();!(t=i.n()).done;){var a=t.value;void 0!==a&&a.setValue(e[n]),n++}}catch(e){i.e(e)}finally{i.f()}var o,s=Object(r.c)(this.__parts);try{for(s.s();!(o=s.n()).done;){var c=o.value;void 0!==c&&c.commit()}}catch(e){s.e(e)}finally{s.f()}}},{key:"_clone",value:function(){for(var e,t=i?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],a=this.template.parts,o=document.createTreeWalker(t,133,null,!1),s=0,c=0,u=o.nextNode();s<a.length;)if(e=a[s],h(e)){for(;c<e.index;)c++,"TEMPLATE"===u.nodeName&&(n.push(u),o.currentNode=u.content),null===(u=o.nextNode())&&(o.currentNode=n.pop(),u=o.nextNode());if("node"===e.type){var l=this.processor.handleTextExpression(this.options);l.insertAfterNode(u.previousSibling),this.__parts.push(l)}else{var d;(d=this.__parts).push.apply(d,Object(r.d)(this.processor.handleAttributeExpressions(u,e.name,e.strings,this.options)))}s++}else this.__parts.push(void 0),s++;return i&&(document.adoptNode(t),customElements.upgrade(t)),t}}]),e}(),O=" ".concat(o," "),j=function(){function e(t,n,i,a){Object(r.a)(this,e),this.strings=t,this.values=n,this.type=i,this.processor=a}return Object(r.b)(e,[{key:"getHTML",value:function(){for(var e=this.strings.length-1,t="",n=!1,r=0;r<e;r++){var i=this.strings[r],a=i.lastIndexOf("\x3c!--");n=(a>-1||n)&&-1===i.indexOf("--\x3e",a+1);var c=f.exec(i);t+=null===c?i+(n?O:s):i.substr(0,c.index)+c[1]+c[2]+"$lit$"+c[3]+o}return t+=this.strings[e]}},{key:"getTemplateElement",value:function(){var e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}]),e}(),S=function(e){return null===e||!("object"===Object(r.i)(e)||"function"==typeof e)},x=function(e){return Array.isArray(e)||!(!e||!e[Symbol.iterator])},E=function(){function e(t,n,i){Object(r.a)(this,e),this.dirty=!0,this.element=t,this.name=n,this.strings=i,this.parts=[];for(var a=0;a<i.length-1;a++)this.parts[a]=this._createPart()}return Object(r.b)(e,[{key:"_createPart",value:function(){return new T(this)}},{key:"_getValue",value:function(){for(var e=this.strings,t=e.length-1,n="",i=0;i<t;i++){n+=e[i];var a=this.parts[i];if(void 0!==a){var o=a.value;if(S(o)||!x(o))n+="string"==typeof o?o:String(o);else{var s,c=Object(r.c)(o);try{for(c.s();!(s=c.n()).done;){var u=s.value;n+="string"==typeof u?u:String(u)}}catch(e){c.e(e)}finally{c.f()}}}}return n+=e[t]}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}]),e}(),T=function(){function e(t){Object(r.a)(this,e),this.value=void 0,this.committer=t}return Object(r.b)(e,[{key:"setValue",value:function(e){e===g||S(e)&&e===this.value||(this.value=e,m(e)||(this.committer.dirty=!0))}},{key:"commit",value:function(){for(;m(this.value);){var e=this.value;this.value=g,e(this)}this.value!==g&&this.committer.commit()}}]),e}(),C=function(){function e(t){Object(r.a)(this,e),this.value=void 0,this.__pendingValue=void 0,this.options=t}return Object(r.b)(e,[{key:"appendInto",value:function(e){this.startNode=e.appendChild(d()),this.endNode=e.appendChild(d())}},{key:"insertAfterNode",value:function(e){this.startNode=e,this.endNode=e.nextSibling}},{key:"appendIntoPart",value:function(e){e.__insert(this.startNode=d()),e.__insert(this.endNode=d())}},{key:"insertAfterPart",value:function(e){e.__insert(this.startNode=d()),this.endNode=e.endNode,e.endNode=this.startNode}},{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){if(null!==this.startNode.parentNode){for(;m(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=g,e(this)}var t=this.__pendingValue;t!==g&&(S(t)?t!==this.value&&this.__commitText(t):t instanceof j?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):x(t)?this.__commitIterable(t):t===w?(this.value=w,this.clear()):this.__commitText(t))}}},{key:"__insert",value:function(e){this.endNode.parentNode.insertBefore(e,this.endNode)}},{key:"__commitNode",value:function(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}},{key:"__commitText",value:function(e){var t=this.startNode.nextSibling,n="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=n:this.__commitNode(document.createTextNode(n)),this.value=e}},{key:"__commitTemplateResult",value:function(e){var t=this.options.templateFactory(e);if(this.value instanceof k&&this.value.template===t)this.value.update(e.values);else{var n=new k(t,e.processor,this.options),r=n._clone();n.update(e.values),this.__commitNode(r),this.value=n}}},{key:"__commitIterable",value:function(t){Array.isArray(this.value)||(this.value=[],this.clear());var n,i,a=this.value,o=0,s=Object(r.c)(t);try{for(s.s();!(i=s.n()).done;){var c=i.value;void 0===(n=a[o])&&(n=new e(this.options),a.push(n),0===o?n.appendIntoPart(this):n.insertAfterPart(a[o-1])),n.setValue(c),n.commit(),o++}}catch(e){s.e(e)}finally{s.f()}o<a.length&&(a.length=o,this.clear(n&&n.endNode))}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.startNode;a(this.startNode.parentNode,e.nextSibling,this.endNode)}}]),e}(),_=function(){function e(t,n,i){if(Object(r.a)(this,e),this.value=void 0,this.__pendingValue=void 0,2!==i.length||""!==i[0]||""!==i[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=n,this.strings=i}return Object(r.b)(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;m(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=g,e(this)}if(this.__pendingValue!==g){var t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=g}}}]),e}(),P=function(e){Object(r.e)(n,e);var t=Object(r.f)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,i,a)).single=2===a.length&&""===a[0]&&""===a[1],o}return Object(r.b)(n,[{key:"_createPart",value:function(){return new R(this)}},{key:"_getValue",value:function(){return this.single?this.parts[0].value:Object(r.g)(Object(r.h)(n.prototype),"_getValue",this).call(this)}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}]),n}(E),R=function(e){Object(r.e)(n,e);var t=Object(r.f)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return n}(T),B=!1;!function(){try{var e={get capture(){return B=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}}();var I=function(){function e(t,n,i){var a=this;Object(r.a)(this,e),this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=n,this.eventContext=i,this.__boundHandleEvent=function(e){return a.handleEvent(e)}}return Object(r.b)(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;m(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=g,e(this)}if(this.__pendingValue!==g){var t=this.__pendingValue,n=this.value,r=null==t||null!=n&&(t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),i=null!=t&&(null==n||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=A(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=g}}},{key:"handleEvent",value:function(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}]),e}(),A=function(e){return e&&(B?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
function M(e){var t=N.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},N.set(e.type,t));var n=t.stringsArray.get(e.strings);if(void 0!==n)return n;var r=e.strings.join(o);return void 0===(n=t.keyString.get(r))&&(n=new u(e,e.getTemplateElement()),t.keyString.set(r,n)),t.stringsArray.set(e.strings,n),n}var N=new Map,F=new WeakMap,U=new(function(){function e(){Object(r.a)(this,e)}return Object(r.b)(e,[{key:"handleAttributeExpressions",value:function(e,t,n,r){var i=t[0];return"."===i?new P(e,t.slice(1),n).parts:"@"===i?[new I(e,t.slice(1),r.eventContext)]:"?"===i?[new _(e,t.slice(1),n)]:new E(e,t,n).parts}},{key:"handleTextExpression",value:function(e){return new C(e)}}]),e}());
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.2.1");var q=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new j(e,n,"html",U)},D=function(e,t){return"".concat(e,"--").concat(t)},L=!0;void 0===window.ShadyCSS?L=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),L=!1);var H=function(e){return function(t){var n=D(t.type,e),r=N.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},N.set(n,r));var i=r.stringsArray.get(t.strings);if(void 0!==i)return i;var a=t.strings.join(o);if(void 0===(i=r.keyString.get(a))){var s=t.getTemplateElement();L&&window.ShadyCSS.prepareTemplateDom(s,e),i=new u(t,s),r.keyString.set(a,i)}return r.stringsArray.set(t.strings,i),i}},V=["html","svg"],z=new Set,W=function(e,t,n){z.add(e);var r=n?n.element:document.createElement("template"),i=t.querySelectorAll("style"),a=i.length;if(0!==a){for(var o=document.createElement("style"),s=0;s<a;s++){var c=i[s];c.parentNode.removeChild(c),o.textContent+=c.textContent}!function(e){V.forEach((function(t){var n=N.get(D(t,e));void 0!==n&&n.keyString.forEach((function(e){var t=e.element.content,n=new Set;Array.from(t.querySelectorAll("style")).forEach((function(e){n.add(e)})),p(e,n)}))}))}(e);var u=r.content;n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.element.content,i=e.parts;if(null!=n)for(var a=document.createTreeWalker(r,133,null,!1),o=y(i),s=0,c=-1;a.nextNode();){c++;var u=a.currentNode;for(u===n&&(s=v(t),n.parentNode.insertBefore(t,n));-1!==o&&i[o].index===c;){if(s>0){for(;-1!==o;)i[o].index+=s,o=y(i,o);return}o=y(i,o)}}else r.appendChild(t)}(n,o,u.firstChild):u.insertBefore(o,u.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);var l=u.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(n){u.insertBefore(o,u.firstChild);var h=new Set;h.add(o),p(n,h)}}else window.ShadyCSS.prepareTemplateStyles(r,e)};window.JSCompiler_renameProperty=function(e,t){return e};var Z={toAttribute:function(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute:function(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},$=function(e,t){return t!==e&&(t==t||e==e)},Q={attribute:!0,type:String,converter:Z,reflect:!1,hasChanged:$},J=function(e){Object(r.e)(i,e);var t,n=Object(r.f)(i);function i(){var e;return Object(r.a)(this,i),(e=n.call(this))._updateState=0,e._instanceProperties=void 0,e._updatePromise=new Promise((function(t){return e._enableUpdatingResolver=t})),e._changedProperties=new Map,e._reflectingProperties=void 0,e.initialize(),e}return Object(r.b)(i,[{key:"initialize",value:function(){this._saveInstanceProperties(),this._requestUpdate()}},{key:"_saveInstanceProperties",value:function(){var e=this;this.constructor._classProperties.forEach((function(t,n){if(e.hasOwnProperty(n)){var r=e[n];delete e[n],e._instanceProperties||(e._instanceProperties=new Map),e._instanceProperties.set(n,r)}}))}},{key:"_applyInstanceProperties",value:function(){var e=this;this._instanceProperties.forEach((function(t,n){return e[n]=t})),this._instanceProperties=void 0}},{key:"connectedCallback",value:function(){this.enableUpdating()}},{key:"enableUpdating",value:function(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&this._attributeToProperty(e,n)}},{key:"_propertyToAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Q,r=this.constructor,i=r._attributeNameForProperty(e,n);if(void 0!==i){var a=r._propertyValueToAttribute(t,n);if(void 0===a)return;this._updateState=8|this._updateState,null==a?this.removeAttribute(i):this.setAttribute(i,a),this._updateState=-9&this._updateState}}},{key:"_attributeToProperty",value:function(e,t){if(!(8&this._updateState)){var n=this.constructor,r=n._attributeToPropertyMap.get(e);if(void 0!==r){var i=n.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(t,i),this._updateState=-17&this._updateState}}}},{key:"_requestUpdate",value:function(e,t){var n=!0;if(void 0!==e){var r=this.constructor,i=r.getPropertyOptions(e);r._valueHasChanged(this[e],t,i.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,i))):n=!1}!this._hasRequestedUpdate&&n&&(this._updatePromise=this._enqueueUpdate())}},{key:"requestUpdate",value:function(e,t){return this._requestUpdate(e,t),this.updateComplete}},{key:"_enqueueUpdate",value:(t=Object(r.k)(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._updateState=4|this._updateState,e.prev=1,e.next=4,this._updatePromise;case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:if(null==(t=this.performUpdate())){e.next=12;break}return e.next=12,t;case 12:return e.abrupt("return",!this._hasRequestedUpdate);case 13:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return t.apply(this,arguments)})},{key:"performUpdate",value:function(){this._instanceProperties&&this._applyInstanceProperties();var e=!1,t=this._changedProperties;try{(e=this.shouldUpdate(t))?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}},{key:"_markUpdated",value:function(){this._changedProperties=new Map,this._updateState=-5&this._updateState}},{key:"_getUpdateComplete",value:function(){return this._updatePromise}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){var t=this;void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((function(e,n){return t._propertyToAttribute(n,t[n],e)})),this._reflectingProperties=void 0),this._markUpdated()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}},{key:"_hasRequestedUpdate",get:function(){return 4&this._updateState}},{key:"hasUpdated",get:function(){return 1&this._updateState}},{key:"updateComplete",get:function(){return this._getUpdateComplete()}}],[{key:"_ensureClassProperties",value:function(){var e=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((function(t,n){return e._classProperties.set(n,t)}))}}},{key:"createProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Q;if(this._ensureClassProperties(),this._classProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){var n="symbol"===Object(r.i)(e)?Symbol():"__".concat(e),i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}},{key:"getPropertyDescriptor",value:function(e,t,n){return{get:function(){return this[t]},set:function(n){var r=this[e];this[t]=n,this._requestUpdate(e,r)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){return this._classProperties&&this._classProperties.get(e)||Q}},{key:"finalize",value:function(){var e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var t,n=this.properties,i=[].concat(Object(r.d)(Object.getOwnPropertyNames(n)),Object(r.d)("function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n):[])),a=Object(r.c)(i);try{for(a.s();!(t=a.n()).done;){var o=t.value;this.createProperty(o,n[o])}}catch(e){a.e(e)}finally{a.f()}}}},{key:"_attributeNameForProperty",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}},{key:"_valueHasChanged",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$;return n(e,t)}},{key:"_propertyValueFromAttribute",value:function(e,t){var n=t.type,r=t.converter||Z,i="function"==typeof r?r:r.fromAttribute;return i?i(e,n):e}},{key:"_propertyValueToAttribute",value:function(e,t){if(void 0!==t.reflect){var n=t.type,r=t.converter;return(r&&r.toAttribute||Z.toAttribute)(e,n)}}},{key:"observedAttributes",get:function(){var e=this;this.finalize();var t=[];return this._classProperties.forEach((function(n,r){var i=e._attributeNameForProperty(r,n);void 0!==i&&(e._attributeToPropertyMap.set(i,r),t.push(i))})),t}}]),i}(Object(r.j)(HTMLElement));J.finalized=!0;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
var K=function(e){return function(t){return"function"==typeof t?function(e,t){return window.customElements.define(e,t),t}(e,t):function(e,t){return{kind:t.kind,elements:t.elements,finisher:function(t){window.customElements.define(e,t)}}}(e,t)}};function X(e){return function(t,n){return void 0!==n?function(e,t,n){t.constructor.createProperty(n,e)}(e,t,n):function(e,t){return"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher:function(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer:function(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher:function(n){n.createProperty(t.key,e)}}}(e,t)}}
/**
@license
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
var G="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=Symbol(),ee=function(){function e(t,n){if(Object(r.a)(this,e),n!==Y)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}return Object(r.b)(e,[{key:"toString",value:function(){return this.cssText}},{key:"styleSheet",get:function(){return void 0===this._styleSheet&&(G?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}}]),e}(),te=function(e){if(e instanceof ee)return e.cssText;if("number"==typeof e)return e;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(e,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},ne=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n.reduce((function(t,n,r){return t+te(n)+e[r+1]}),e[0]);return new ee(i,Y)};(window.litElementVersions||(window.litElementVersions=[])).push("2.3.1");var re={},ie=function(e){Object(r.e)(n,e);var t=Object(r.f)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(r.b)(n,[{key:"initialize",value:function(){Object(r.g)(Object(r.h)(n.prototype),"initialize",this).call(this),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}},{key:"createRenderRoot",value:function(){return this.attachShadow({mode:"open"})}},{key:"adoptStyles",value:function(){var e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?G?this.renderRoot.adoptedStyleSheets=e.map((function(e){return e.styleSheet})):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((function(e){return e.cssText})),this.localName))}},{key:"connectedCallback",value:function(){Object(r.g)(Object(r.h)(n.prototype),"connectedCallback",this).call(this),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}},{key:"update",value:function(e){var t=this,i=this.render();Object(r.g)(Object(r.h)(n.prototype),"update",this).call(this,e),i!==re&&this.constructor.render(i,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((function(e){var n=document.createElement("style");n.textContent=e.cssText,t.renderRoot.appendChild(n)})))}},{key:"render",value:function(){return re}}],[{key:"getStyles",value:function(){return this.styles}},{key:"_getUniqueStyles",value:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var e=this.getStyles();if(void 0===e)this._styles=[];else if(Array.isArray(e)){var t=function e(t,n){return t.reduceRight((function(t,n){return Array.isArray(n)?e(n,t):(t.add(n),t)}),n)}(e,new Set),n=[];t.forEach((function(e){return n.unshift(e)})),this._styles=n}else this._styles=[e]}}}]),n}(J);ie.finalized=!0,ie.render=function(e,t,n){if(!n||"object"!==Object(r.i)(n)||!n.scopeName)throw new Error("The `scopeName` option is required.");var i=n.scopeName,o=F.has(t),s=L&&11===t.nodeType&&!!t.host,c=s&&!z.has(i),u=c?document.createDocumentFragment():t;if(function(e,t,n){var r=F.get(t);void 0===r&&(a(t,t.firstChild),F.set(t,r=new C(Object.assign({templateFactory:M},n))),r.appendInto(t)),r.setValue(e),r.commit()}(e,u,Object.assign({templateFactory:H(i)},n)),c){var l=F.get(u);F.delete(u);var h=l.value instanceof k?l.value.template:void 0;W(i,u,h),a(t,t.firstChild),t.appendChild(u),F.set(t,l)}!o&&s&&window.ShadyCSS.styleElement(t.host)}},33:function(e,t,n){"use strict";var r=n(2),i={};
/*! (c) Andrea Giammarchi - ISC */try{!function(e,t){if("+"!==new e("q=%2B").get("q")||"+"!==new e({q:"+"}).get("q")||"+"!==new e([["q","+"]]).get("q")||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;i.URLSearchParams=e}(URLSearchParams)}catch(e){!function(e,t,n){var r=e.create,a=e.defineProperty,o=/[!'\(\)~]|%20|%00/g,s=/%(?![0-9a-fA-F]{2})/g,c=/\+/g,u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},l={append:function(e,t){p(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,n){this._ungap[e]=[t(n)]},forEach:function(e,n){var r=this;for(var i in r._ungap)r._ungap[i].forEach(a,i);function a(a){e.call(n,a,t(i),r)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var n=y(t),r=0,i=this._ungap[t];r<i.length;r++)e.push(n+"="+y(i[r]));return e.join("&")}};for(var h in l)a(d.prototype,h,{configurable:!0,writable:!0,value:l[h]});function d(e){var t=r(null);switch(a(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var i=e.split("&"),o=0,s=i.length;o<s;o++){var c=(u=i[o]).indexOf("=");-1<c?p(t,v(u.slice(0,c)),v(u.slice(c+1))):u.length&&p(t,v(u),"")}break;case n(e):for(o=0,s=e.length;o<s;o++){var u;p(t,(u=e[o])[0],u[1])}break;case"forEach"in e:e.forEach(f,t);break;default:for(var l in e)p(t,l,e[l])}}function f(e,t){p(this,t,e)}function p(e,t,r){var i=n(r)?r.join(","):r;t in e?e[t].push(i):e[t]=[i]}function v(e){return decodeURIComponent(e.replace(s,"%25").replace(c," "))}function y(e){return encodeURIComponent(e).replace(o,b)}function b(e){return u[e]}i.URLSearchParams=d}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function n(e,n){var r=[];return e.forEach(n,r),t?r[Symbol.iterator]():{next:function(){var e=r.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var n=this,r=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(i){i.length&&!(i in r)&&(r[i]=n.getAll(i)).forEach((function(r){e.call(t,r,i,n)}))}))}),"keys"in e||(e.keys=function(){return n(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return n(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return n(this,(function(e,t){this.push([t,e])}))}),t&&!(Symbol.iterator in e)&&(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,n,r=this.entries(),i=r.next(),a=i.done,o=[],s=Object.create(null);!a;)t=(n=i.value)[0],o.push(t),t in s||(s[t]=[]),s[t].push(n[1]),a=(i=r.next()).done;for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++)t=o[e],this.append(t,s[t].shift())}),function(t){var n=t.defineProperty,i=t.getOwnPropertyDescriptor,a=function(t){var n=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=n},o=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},s=function(r){var s,c,u=r.prototype,l=i(u,"searchParams"),h=i(u,"href"),d=i(u,"search");!l&&d&&d.set&&(c=function(t){function r(n,r){e.append.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function i(n){e.delete.call(this,n),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function a(n,r){e.set.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}return function(e,t){return e.append=r,e.delete=i,e.set=a,n(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),s=function(e,t){return n(e,"_searchParams",{configurable:!0,writable:!0,value:c(t,e)}),t},t.defineProperties(u,{href:{get:function(){return h.get.call(this)},set:function(e){var t=this._searchParams;h.set.call(this,e),t&&a(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&a(t)}},searchParams:{get:function(){return o(this,r),this._searchParams||s(this,new URLSearchParams(this.search.slice(1)))},set:function(e){o(this,r),s(this,e)}}}))};try{s(HTMLAnchorElement),/^function|object$/.test("undefined"==typeof URL?"undefined":t(r.i)(URL))&&URL.prototype&&s(URL)}catch(e){}}(Object)}(i.URLSearchParams.prototype);var a=i.URLSearchParams;t.a=a},36:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r="URLSearchParams"in self,i="Symbol"in self&&"iterator"in Symbol,a="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in self,s="ArrayBuffer"in self;if(s)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function y(e){var t=new FileReader,n=v(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,n,r=p(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=v(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=l(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[l(e)]},f.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},f.prototype.set=function(e,t){this.map[l(e)]=h(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),d(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),d(e)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function w(e,t){var n,r,i=(t=t||{}).body;if(e instanceof w){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function k(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function O(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},m.call(w.prototype),m.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var j=[301,302,303,307,308];O.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})};var S=self.DOMException;try{new S}catch(e){(S=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),S.prototype.constructor=S}function x(e,t){return new Promise((function(n,r){var i=new w(e,t);if(i.signal&&i.signal.aborted)return r(new S("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;n(new O(i,r))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.onabort=function(){r(new S("Aborted","AbortError"))},o.open(i.method,i.url,!0),"include"===i.credentials?o.withCredentials=!0:"omit"===i.credentials&&(o.withCredentials=!1),"responseType"in o&&a&&(o.responseType="blob"),i.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),i.signal&&(i.signal.addEventListener("abort",s),o.onreadystatechange=function(){4===o.readyState&&i.signal.removeEventListener("abort",s)}),o.send(void 0===i._bodyInit?null:i._bodyInit)}))}x.polyfill=!0,self.fetch||(self.fetch=x,self.Headers=f,self.Request=w,self.Response=O)},83:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return tr}));var r=n(3),i=n(36),a=n(33);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;o(this,e),this.callback=t,this.threshhold=n,this.context=r,this.deferTimeout=void 0}var t,n,r;return t=e,(n=[{key:"execute",value:function(){clearTimeout(this.deferTimeout),this.deferTimeout=setTimeout(this.executeCallback.bind(this),this.threshhold)}},{key:"executeCallback",value:function(){this.callback.apply(this.context)}}])&&s(t.prototype,n),r&&s(t,r),e}();function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.analyticsBackend=t||window.archive_analytics}var t,n,r;return t=e,(n=[{key:"sendEvent",value:function(e,t,n,r){this.analyticsBackend.send_event(e,t,n,r)}}])&&u(t.prototype,n),r&&u(t,r),e}(),h=n(2);function d(){var e=Object(h.l)(["\n ","\n "]);return d=function(){return e},e}var f=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},p=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).entry=void 0,e.isActive=!1,e.isSelected=!1,e.isClickable=!1,e.isSearchResult=!1,e.isMusicEntry=!1,e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(d(),this.entry?this.entry.displayText:"")}}]),n}(r.a);function v(){var e=Object(h.l)(["\n ","\n "]);return v=function(){return e},e}f([Object(r.e)({type:Object})],p.prototype,"entry",void 0),f([Object(r.e)({type:Boolean,reflect:!0})],p.prototype,"isActive",void 0),f([Object(r.e)({type:Boolean,reflect:!0})],p.prototype,"isSelected",void 0),f([Object(r.e)({type:Boolean,reflect:!0})],p.prototype,"isClickable",void 0),f([Object(r.e)({type:Boolean,reflect:!0})],p.prototype,"isSearchResult",void 0),f([Object(r.e)({type:Boolean,reflect:!0})],p.prototype,"isMusicEntry",void 0),p=f([Object(r.c)("transcript-entry")],p);var y=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},b=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).seconds=0,e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(v(),this.durationString)}},{key:"durationString",get:function(){return"number"!=typeof this.seconds?"":[Math.floor(this.seconds/3600),Math.floor(this.seconds/60)%60,Math.floor(this.seconds%60)].map((function(e){return e<10?"0".concat(e):e})).filter((function(e,t){return"00"!==e||t>0})).join(":")}}]),n}(r.a);y([Object(r.e)({type:Number})],b.prototype,"seconds",void 0),b=y([Object(r.c)("duration-formatter")],b);var m=function(){function e(t){Object(h.a)(this,e),this.entries=[],this.entries=t}return Object(h.b)(e,[{key:"searchResults",get:function(){return this.entries.filter((function(e){return void 0!==e.searchMatchIndex}))}}]),e}();function g(){var e=Object(h.l)(["\n :host {\n color: ",";\n }\n\n .container {\n position: relative;\n }\n\n .auto-scroll-button.hidden {\n display: none;\n }\n\n .auto-scroll-button {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 1rem;\n margin: auto;\n width: ",";\n border-radius: 1em;\n border: 0;\n display: inline-block;\n color: ",";\n background-color: ",";\n font-size: ",";\n z-index: 10;\n }\n\n .context-overlay {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n z-index: -1;\n }\n\n .context-overlay.top {\n top: 0;\n border-bottom: 1px solid green;\n }\n\n .context-overlay.bottom {\n bottom: 0;\n border-top: 1px solid green;\n }\n\n .time {\n display: ",";\n flex: 0 0 ",";\n color: ",";\n position: relative;\n }\n\n .time-display {\n position: absolute;\n top: 0;\n font-size: ",";\n line-height: ",";\n transition: top 1s;\n }\n\n .scroll-container {\n display: flex;\n overflow-y: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n height: ",";\n }\n\n .scroll-container::-webkit-scrollbar {\n display: none;\n }\n\n transcript-entry {\n cursor: pointer;\n }\n\n transcript-entry:hover {\n color: ",";\n }\n\n transcript-entry[ismusicentry] {\n color: ",";\n display: block;\n font-style: italic;\n }\n\n transcript-entry[ismusicentry]:hover {\n color: ",";\n }\n\n transcript-entry[ismusicentry][isactive] {\n color: ",";\n }\n\n transcript-entry[isactive] {\n color: ",";\n }\n\n transcript-entry[issearchresult] {\n display: inline-block; /* without this, the outline adds an extra space to the right of the text */\n padding: 0 5px;\n position: relative;\n }\n\n transcript-entry[issearchresult]:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n border: 2px solid ",";\n border-radius: 5px;\n }\n\n transcript-entry[issearchresult][isselected]:after {\n border: 2px solid ",";\n }\n "]);return g=function(){return e},e}function w(){var e=Object(h.l)(["var(--transcriptSearchResultActiveBorderColor, green)"]);return w=function(){return e},e}function k(){var e=Object(h.l)(["var(--transcriptSearchResultInactiveBorderColor, gray)"]);return k=function(){return e},e}function O(){var e=Object(h.l)(["var(--transcriptMusicActiveTextColor, silver)"]);return O=function(){return e},e}function j(){var e=Object(h.l)(["var(--transcriptMusicActiveTextColor, white)"]);return j=function(){return e},e}function S(){var e=Object(h.l)(["var(--transcriptMusicNormalTextColor, gray)"]);return S=function(){return e},e}function x(){var e=Object(h.l)(["var(--transcriptHoverTextColor, silver)"]);return x=function(){return e},e}function E(){var e=Object(h.l)(["var(--transcriptActiveTextColor, white)"]);return E=function(){return e},e}function T(){var e=Object(h.l)(["var(--transcriptNormalTextColor, gray)"]);return T=function(){return e},e}function C(){var e=Object(h.l)(["var(--autoScrollButtonFontSize, 1em)"]);return C=function(){return e},e}function _(){var e=Object(h.l)(["var(--autoScrollButtonWidth, 12rem)"]);return _=function(){return e},e}function P(){var e=Object(h.l)(["var(--autoScrollButtonBackgroundColor, white)"]);return P=function(){return e},e}function R(){var e=Object(h.l)(["var(--autoScrollButtonFontColor, black)"]);return R=function(){return e},e}function B(){var e=Object(h.l)(["var(--timeDisplay, block)"]);return B=function(){return e},e}function I(){var e=Object(h.l)(["var(--timeColumnWidth, 3rem)"]);return I=function(){return e},e}function A(){var e=Object(h.l)(["var(--timeColor, white)"]);return A=function(){return e},e}function M(){var e=Object(h.l)(["var(--timeLineHeight, 1em)"]);return M=function(){return e},e}function N(){var e=Object(h.l)(["var(--timeFontSize, 1em)"]);return N=function(){return e},e}function F(){var e=Object(h.l)(["var(--transcriptHeight, 200px)"]);return F=function(){return e},e}function U(){var e=Object(h.l)(['\n <div class="bottom context-overlay" style="height: ','px"></div>\n ']);return U=function(){return e},e}function q(){var e=Object(h.l)(['\n <div class="top context-overlay" style="height: ','px"></div>\n ']);return q=function(){return e},e}function D(){var e=Object(h.l)(["\n "," ","\n "]);return D=function(){return e},e}function L(){var e=Object(h.l)(['\n <div class="time-display" style="top: ','px">\n <duration-formatter .seconds=',"> </duration-formatter>\n </div>\n "]);return L=function(){return e},e}function H(){var e=Object(h.l)(["\n <button\n @click=",'\n class="auto-scroll-button ','"\n >\n Scroll text with audio\n </button>\n ']);return H=function(){return e},e}function V(){var e=Object(h.l)(["\n <transcript-entry\n .entry=","\n ?isSelected=","\n ?isActive=","\n ?isSearchResult=","\n ?isMusicEntry=",'\n isClickable="true"\n data-search-result-index=',"\n data-identifier=","\n @click=","\n >\n </transcript-entry>\n "]);return V=function(){return e},e}function z(){var e=Object(h.l)(['\n <div class="container">\n ','\n\n <div class="scroll-container" id="scroll-container" @wheel='," @touchmove=",'>\n <div class="col time">\n ','\n </div>\n\n <div class="col">\n ',"\n ","\n </div>\n </div>\n </div>\n "]);return z=function(){return e},e}var W=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Z=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).config=void 0,e.currentTime=0,e.topContextHeight=50,e.bottomContextHeight=50,e.autoScroll=!0,e.selectedSearchResultIndex=0,e.showContextZones=!1,e.timeScrollTop=0,e.currentEntries=[],e.scrollTimerDelay=15e3,e.scrollResumeTimerId=-1,e}return Object(h.b)(n,[{key:"render",value:function(){var e=this;return Object(r.d)(z(),this.showContextZones?this.contextZoneDevTemplates:"",this.didScroll,this.didScroll,this.timeDisplayTemplate,this.autoScrollButtonTemplate,this.transcriptEntries.map((function(t){return e.transcriptEntryTemplate(t)})))}},{key:"scrollToSelectedSearchResult",value:function(){var e=this.selectedSearchResult;e&&(this.autoScroll=!1,this.scrollToElement(e))}},{key:"transcriptEntryTemplate",value:function(e){var t=void 0!==this.currentEntries.find((function(t){return t.id===e.id})),n=e.searchMatchIndex===this.selectedSearchResultIndex,i=void 0!==e.searchMatchIndex,a=e.isMusic;return Object(r.d)(V(),e,n,t,i,a,e.searchMatchIndex,e.id,this.transcriptEntrySelected)}},{key:"transcriptEntrySelected",value:function(e){var t=e.target.entry;if(t){var n=new CustomEvent("transcriptEntrySelected",{detail:{entry:t}});this.dispatchEvent(n),void 0!==t.searchMatchIndex&&(this.selectedSearchResultIndex=t.searchMatchIndex),this.autoScroll=!1}}},{key:"handleCurrentTimeChange",value:function(){var e=this,t=this.transcriptEntries;if(0!==t.length){var n=t.filter((function(t){return e.currentTime>=t.start&&e.currentTime<=t.end}));this.entryArraysMatch(n,this.currentEntries)||(this.dispatchEvent(new Event("currentEntriesUpdated")),this.currentEntries=n)}}},{key:"entryArraysMatch",value:function(e,t){if(e.length!==t.length)return!1;var n=e.map((function(e){return e.id})).sort(),r=t.map((function(e){return e.id})).sort(),i=!0;return n.forEach((function(e,t){r[t]!==e&&(i=!1)})),!!i}},{key:"entryIdentifierClosestToTime",value:function(e){if(0===this.transcriptEntries.length)return null;var t=this.transcriptEntries[0],n=Math.abs(e-t.start),r=t.id;return this.transcriptEntries.forEach((function(t){var i=Math.abs(e-t.start);i<n&&(n=i,r=t.id)})),r}},{key:"elementClosestToTime",value:function(e){var t=this.entryIdentifierClosestToTime(e);return t?this.elementForIdentifier(t):null}},{key:"elementForIdentifier",value:function(e){return this.shadowRoot&&this.shadowRoot.querySelector('transcript-entry[data-identifier="'.concat(e,'"]'))}},{key:"didScroll",value:function(){var e=this;this.autoScroll=!1,window.clearTimeout(this.scrollResumeTimerId),this.scrollResumeTimerId=window.setTimeout((function(){e.autoScroll=!0}),this.scrollTimerDelay)}},{key:"enableAutoScroll",value:function(){this.autoScroll=!0,this.scrollToClosestEntry()}},{key:"updated",value:function(e){e.has("currentTime")&&this.handleCurrentTimeChange(),e.has("selectedSearchResultIndex")&&this.scrollToSelectedSearchResult(),e.has("currentEntries")&&(this.scrollToClosestEntry(),this.updateTimePosition()),e.has("autoScroll")&&this.handleAutoScrollChange(),e.has("config")&&(this.selectedSearchResultIndex=0,this.scrollToSelectedSearchResult())}},{key:"handleAutoScrollChange",value:function(){var e=new CustomEvent("autoScrollChanged",{detail:{autoScroll:this.autoScroll}});this.dispatchEvent(e)}},{key:"scrollToClosestEntry",value:function(){if(this.autoScroll){var e=this.closestEntryToCurrentTime;e&&this.scrollToElement(e)}}},{key:"scrollToElement",value:function(e){var t=this.scrollView;if(t){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height,a=this.topContextHeight,o=i-this.bottomContextHeight;if(r.bottom>n.top+o||r.top<n.top){var s=r.top-n.top+t.scrollTop-a;this.scrollToOffsetWithDuration(s,1)}}}},{key:"updateTimePosition",value:function(){var e=this.closestEntryToCurrentTime;if(e){var t=e.parentNode.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;this.timeScrollTop=n}}},{key:"scrollToOffsetWithDuration",value:function(e,t,n){var r=this.scrollView;if(r){var i,a,o=r.scrollTop,s=e-o,c=performance.now();!function e(){var u;r&&(i=performance.now(),a=(i-c)/1e3/t,r.scrollTop=o+s*((u=a)<.5?2*u*u:(4-2*u)*u-1),a<1?window.requestAnimationFrame(e):n&&n())}()}}},{key:"autoScrollButtonTemplate",get:function(){return Object(r.d)(H(),this.enableAutoScroll,this.autoScroll?"hidden":"")}},{key:"timeDisplayTemplate",get:function(){return Object(r.d)(L(),this.timeScrollTop,this.currentTime)}},{key:"contextZoneDevTemplates",get:function(){return Object(r.d)(D(),this.topContextZoneDevTemplate,this.bottomContextZoneDevTemplate)}},{key:"topContextZoneDevTemplate",get:function(){return Object(r.d)(q(),this.topContextHeight)}},{key:"bottomContextZoneDevTemplate",get:function(){return Object(r.d)(U(),this.bottomContextHeight)}},{key:"transcriptEntries",get:function(){return this.config?this.config.entries:[]}},{key:"scrollView",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("scroll-container")}},{key:"activeTranscriptEntry",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector("transcript-entry[isActive]")}},{key:"selectedSearchResult",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector('transcript-entry[data-search-result-index="'.concat(this.selectedSearchResultIndex,'"]'))}},{key:"closestEntryToCurrentTime",get:function(){return this.activeTranscriptEntry||this.elementClosestToTime(this.currentTime)}}],[{key:"styles",get:function(){var e=Object(r.b)(F()),t=Object(r.b)(N()),n=Object(r.b)(M()),i=Object(r.b)(A()),a=Object(r.b)(I()),o=Object(r.b)(B()),s=Object(r.b)(R()),c=Object(r.b)(P()),u=Object(r.b)(_()),l=Object(r.b)(C()),h=Object(r.b)(T()),d=Object(r.b)(E()),f=Object(r.b)(x()),p=Object(r.b)(S()),v=Object(r.b)(j()),y=Object(r.b)(O()),b=Object(r.b)(k()),m=Object(r.b)(w());return Object(r.b)(g(),h,u,s,c,l,o,a,i,t,n,e,f,p,y,v,d,b,m)}}]),n}(r.a);W([Object(r.e)({type:m})],Z.prototype,"config",void 0),W([Object(r.e)({type:Number})],Z.prototype,"currentTime",void 0),W([Object(r.e)({type:Number})],Z.prototype,"topContextHeight",void 0),W([Object(r.e)({type:Number})],Z.prototype,"bottomContextHeight",void 0),W([Object(r.e)({type:Boolean})],Z.prototype,"autoScroll",void 0),W([Object(r.e)({type:Number})],Z.prototype,"selectedSearchResultIndex",void 0),W([Object(r.e)({type:Boolean})],Z.prototype,"showContextZones",void 0),W([Object(r.e)({type:Number})],Z.prototype,"timeScrollTop",void 0),W([Object(r.e)({type:Array})],Z.prototype,"currentEntries",void 0),Z=W([Object(r.c)("transcript-view")],Z);var $=function(){function e(t,n,r,i,a,o){Object(h.a)(this,e),this.id=t,this.start=n,this.end=r,this.rawText=i,this.isMusic=a,this.searchMatchIndex=o}return Object(h.b)(e,[{key:"displayText",get:function(){return this.isMusic?"[Transcript unavailable]":this.rawText}}]),e}();function Q(){var e=Object(h.l)(["\n <source src="," type="," />\n "]);return Q=function(){return e},e}function J(){var e=Object(h.l)(["\n <audio\n @timeupdate=","\n @durationchange=","\n @play=","\n @pause=","\n @canplay=","\n >\n ","\n </audio>\n "]);return J=function(){return e},e}var K=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},X=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).showControls=!1,e.playbackRate=1,e.volume=1,e.sources=[],e}return Object(h.b)(n,[{key:"load",value:function(){this.audioElement&&(this.audioElement.load(),this.audioElement.playbackRate=this.playbackRate)}},{key:"play",value:function(){this.audioElement&&this.audioElement.play()}},{key:"pause",value:function(){this.audioElement&&this.audioElement.pause()}},{key:"seekTo",value:function(e){this.audioElement&&(this.audioElement.currentTime=e)}},{key:"seekBy",value:function(e){this.audioElement&&(this.audioElement.currentTime=this.audioElement.currentTime+e)}},{key:"render",value:function(){return Object(r.d)(J(),this.handleTimeChange,this.handleDurationChange,this.playbackStarted,this.playbackPaused,this.canplay,this.sources.map((function(e){return Object(r.d)(Q(),e.url,e.mimetype)})))}},{key:"updated",value:function(e){this.audioElement&&(e.has("playbackRate")&&(this.audioElement.playbackRate=this.playbackRate),e.has("volume")&&(this.audioElement.volume=this.volume),e.has("showControls")&&(this.showControls?this.audioElement.setAttribute("controls","true"):this.audioElement.removeAttribute("controls")))}},{key:"handleDurationChange",value:function(e){var t=e.target,n=new CustomEvent("durationchange",{detail:{duration:t.duration}});this.dispatchEvent(n)}},{key:"handleTimeChange",value:function(e){var t=e.target,n=new CustomEvent("timeupdate",{detail:{currentTime:t.currentTime}});this.dispatchEvent(n)}},{key:"playbackStarted",value:function(){var e=new Event("playbackStarted");this.dispatchEvent(e)}},{key:"playbackPaused",value:function(){var e=new Event("playbackPaused");this.dispatchEvent(e)}},{key:"canplay",value:function(){var e=new Event("canplay");this.dispatchEvent(e)}},{key:"duration",get:function(){return this.audioElement?this.audioElement.duration:0}},{key:"currentTime",get:function(){return this.audioElement?this.audioElement.currentTime:0}},{key:"audioElement",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector("audio")}}]),n}(r.a);K([Object(r.e)({type:Boolean})],X.prototype,"showControls",void 0),K([Object(r.e)({type:Number})],X.prototype,"playbackRate",void 0),K([Object(r.e)({type:Number})],X.prototype,"volume",void 0),K([Object(r.e)({type:Array})],X.prototype,"sources",void 0),X=K([Object(r.c)("audio-element")],X);var G=function e(t,n){Object(h.a)(this,e),this.url=t,this.mimetype=n};function Y(){var e=Object(h.l)(["\n :host {\n display: inline-block;\n }\n\n #dragcover {\n width: 100%;\n height: 100%;\n position: absolute;\n touch-action: none;\n }\n\n .container {\n display: block;\n position: relative;\n background-color: white;\n height: 100%;\n margin-left: ",";\n margin-right: ",";\n }\n\n .waveform-image {\n width: 100%;\n height: 100%;\n position: absolute;\n }\n\n .zone-of-silence {\n position: absolute;\n top: 0;\n bottom: 0;\n background: linear-gradient(\n #000,\n #000 47%,\n "," 50%,\n #000 53%,\n #000 100%\n );\n }\n\n #fill {\n position: absolute;\n height: 100%;\n background-color: ",";\n }\n "]);return Y=function(){return e},e}function ee(){var e=Object(h.l)(["var(--waveformLeftRightMarginSize, 10px)"]);return ee=function(){return e},e}function te(){var e=Object(h.l)(["var(--zoneOfSilenceColor, #f6e652)"]);return te=function(){return e},e}function ne(){var e=Object(h.l)(["var(--fillColor, #3272b6)"]);return ne=function(){return e},e}function re(){var e=Object(h.l)(['\n <div\n id="dragcover"\n @mousedown=',"\n @mouseup=","\n @mouseleave=","\n @mousemove=","\n @touchstart=","\n @touchend=","\n @touchmove=","\n ></div>\n "]);return re=function(){return e},e}function ie(){var e=Object(h.l)(['\n <div\n class="zone-of-silence"\n style="left: ',"%; width: ",'%"\n ></div>\n ']);return ie=function(){return e},e}function ae(){var e=Object(h.l)(["\n ","\n "]);return ae=function(){return e},e}function oe(){var e=Object(h.l)(['\n <div class="container">\n <div id="fill" style="width: ','%"></div>\n <img class="waveform-image" src="','" />\n '," ","\n </div>\n "]);return oe=function(){return e},e}var se=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},ce=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).percentComplete=0,e.waveformUrl="",e.interactive=!1,e.zonesOfSilence=[],e._percentComplete=0,e._userIsInteracting=!1,e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(oe(),this._percentComplete,this.waveformUrl,this.zonesOfSilenceTemplate,this.interactive?this.interactionCoverTemplate:"")}},{key:"updated",value:function(e){e.has("percentComplete")&&!this._userIsInteracting&&(this._percentComplete=this.percentComplete)}},{key:"drag",value:function(e){this._userIsInteracting&&this.updatePercentComplete(e)}},{key:"dragstart",value:function(e){this._userIsInteracting=!0,this.updatePercentComplete(e)}},{key:"dragend",value:function(){this._userIsInteracting=!1}},{key:"updatePercentComplete",value:function(e){if(this.container){var t=this.container.offsetLeft,n=e.pageX-t;this._percentComplete=this.offsetXToPercent(n),this.dispatchValueChangeEvent()}}},{key:"dispatchValueChangeEvent",value:function(){var e=new CustomEvent("valuechange",{detail:{value:this._percentComplete}});this.dispatchEvent(e)}},{key:"offsetXToPercent",value:function(e){return null===this.dragcover?0:e/this.dragcover.clientWidth*100}},{key:"zonesOfSilenceTemplate",get:function(){return Object(r.d)(ae(),this.zonesOfSilence.map((function(e){return Object(r.d)(ie(),e.startPercent,e.endPercent-e.startPercent)})))}},{key:"interactionCoverTemplate",get:function(){return Object(r.d)(re(),this.dragstart,this.dragend,this.dragend,this.drag,this.dragstart,this.dragend,this.drag)}},{key:"dragcover",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("dragcover")}},{key:"container",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector(".container")}}],[{key:"styles",get:function(){var e=Object(r.b)(ne()),t=Object(r.b)(te()),n=Object(r.b)(ee());return Object(r.b)(Y(),n,n,t,e)}}]),n}(r.a);se([Object(r.e)({type:Number})],ce.prototype,"percentComplete",void 0),se([Object(r.e)({type:String})],ce.prototype,"waveformUrl",void 0),se([Object(r.e)({type:Boolean})],ce.prototype,"interactive",void 0),se([Object(r.e)({type:Array})],ce.prototype,"zonesOfSilence",void 0),se([Object(r.e)({type:Number})],ce.prototype,"_percentComplete",void 0),ce=se([Object(r.c)("waveform-progress")],ce);var ue,le=function e(t,n){Object(h.a)(this,e),this.startPercent=0,this.endPercent=0,this.startPercent=t,this.endPercent=n};function he(){var e=Object(h.l)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 18 20">\n <g fill="none" fill-rule="evenodd" transform="translate(1)">\n <polygon fill="#FFF" points="7 3 16 17 -2 17" transform="rotate(90 7 10)"/>\n <line x1="15" x2="15" y1="20" stroke="#FFF" stroke-width="2"/>\n </g>\n</svg>\n']);return he=function(){return e},e}!function(e){e[e.playing=0]="playing",e[e.paused=1]="paused"}(ue||(ue={}));var de=Object(r.d)(he());function fe(){var e=Object(h.l)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 18 20">\n <g fill="none" fill-rule="evenodd" transform="translate(1 1)">\n <polygon fill="#FFF" points="9 2 18 16 0 16" transform="rotate(-90 9 9)"/>\n <line x1=".5" x2=".5" y1="18" stroke="#FFF" stroke-width="2"/>\n </g>\n</svg>\n']);return fe=function(){return e},e}var pe=Object(r.d)(fe());function ve(){var e=Object(h.l)(['\n<svg width="20" height="20" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>icon/replay</title><desc>Created with Sketch.</desc><g id="icon/replay" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Replay-button"><polyline id="Path" stroke="#FFF" stroke-width="2" points="14.4444444 16.6666667 20 16.6666667 20 3.33333333 5.55555556 3.33333333"/><polygon id="Path-2" fill="#FFF" points="5.55555556 0 5.55555556 6.66666667 1.11111111 3.33333333"/><text id="10" font-family="HelveticaNeue, Helvetica Neue" font-size="10" font-weight="normal" fill="#FFF"><tspan x="0" y="17.333">10</tspan></text></g></g></svg>\n']);return ve=function(){return e},e}var ye=Object(r.d)(ve());function be(){var e=Object(h.l)(['\n<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="matrix(-1 0 0 1 20 0)"><path d="m14.4444444 16.6666667h5.5555556v-13.33333337h-14.44444444" stroke="#fff" stroke-width="2"/><g fill="#fff"><path d="m5.55555556 0v6.66666667l-4.44444445-3.33333334z"/><text font-family="HelveticaNeue, Helvetica Neue" font-size="10" transform="matrix(-1 0 0 1 13.333334 0)"><tspan x="0" y="17.333333">10</tspan></text></g></g></svg>\n']);return be=function(){return e},e}var me=Object(r.d)(be());function ge(){var e=Object(h.l)(['\n<svg height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg"><path d="m34.5 18 12.5 25h-25z" fill="#333" fill-rule="evenodd" transform="matrix(0 1 -1 0 65 -4)"/></svg>\n']);return ge=function(){return e},e}var we=Object(r.d)(ge());function ke(){var e=Object(h.l)(['\n<svg height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg"><path d="m32 18h6v25h-6zm-10 0h6v25h-6z" fill="#333" fill-rule="evenodd"/></svg>\n']);return ke=function(){return e},e}var Oe=Object(r.d)(ke());function je(){var e=Object(h.l)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="23" height="17" viewBox="0 0 23 17">\n <g fill="none" fill-rule="evenodd" stroke="#FFF" transform="translate(1 1)">\n <g stroke-linecap="round" transform="translate(2 2.522)">\n <path d="M8.5,9.97826087 L15.5,2.97826087" transform="rotate(180 12 6.478)"/>\n <path d="M15.5,11.2695652 L15.5,8.26956522" transform="rotate(90 15.5 9.77)"/>\n <path d="M16.1555266,5.77496471 L16.1480288,4.77499282" transform="rotate(-120 16.152 5.275)"/>\n <path d="M12.9236091,2.48093451 L12.9161756,1.48096213" transform="rotate(-150 12.92 1.98)"/>\n <path d="M8.5,3.47826087 L8.5,0.47826087" transform="rotate(180 8.5 1.978)"/>\n <path d="M4.07639089,2.48093451 L4.08382438,1.48096213" transform="rotate(150 4.08 1.98)"/>\n <path d="M0.844473378,5.77496471 L0.851971223,4.77499282" transform="rotate(120 .848 5.275)"/>\n <path d="M1.5,11.2695652 L1.5,8.26956522" transform="rotate(90 1.5 9.77)"/>\n </g>\n <path stroke-width="2" d="M10.5,14.9867607 C22.0227273,14.9867607 20.9752066,15.5091468 20.9752066,9.99117383 C20.9752066,4.47320089 16.2852969,0 10.5,0 C4.71470314,0 0.0247933884,4.47320089 0.0247933884,9.99117383 C0.0247933884,15.5091468 -1.02272727,14.9867607 10.5,14.9867607 Z"/>\n </g>\n</svg>\n']);return je=function(){return e},e}var Se=Object(r.d)(je());function xe(){var e=Object(h.l)(['\n<svg height="22" viewBox="0 0 22 22" width="22" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#fff" stroke-width="2"><path d="m14 3c2 2.05128205 3 4.71794872 3 8 0 3.2820513-1 5.9487179-3 8m4-18c2 2.56410256 3 5.8974359 3 10s-1 7.4358974-3 10" stroke-linecap="round"/><path d="m10 3.5-4 3.81h-5v8.38h5l4 3.81z" fill="#fff" stroke-linejoin="round"/></g></svg>\n']);return xe=function(){return e},e}var Ee=Object(r.d)(xe());function Te(){var e=Object(h.l)(['\n<svg height="22" viewBox="0 0 22 22" width="22" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#fff" stroke-width="2"><path d="m14 3c2 2.05128205 3 4.71794872 3 8 0 3.2820513-1 5.9487179-3 8" stroke-linecap="round"/><path d="m18 1c2 2.56410256 3 5.8974359 3 10s-1 7.4358974-3 10" stroke-linecap="round" stroke-opacity=".1"/><path d="m10 3.5-4 3.81h-5v8.38h5l4 3.81z" fill="#fff" stroke-linejoin="round"/></g></svg>\n']);return Te=function(){return e},e}var Ce=Object(r.d)(Te());function _e(){var e=Object(h.l)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><g fill="none" fill-rule="evenodd"><path stroke="#FFF" stroke-linecap="round" stroke-width="2" d="M16,7 L16,15" transform="rotate(-45 16 11)"/><path stroke="#FFF" stroke-linecap="round" stroke-width="2" d="M16,7 L16,15" transform="rotate(-135 16 11)"/><polygon fill="#FFF" stroke="#FFF" stroke-linejoin="round" stroke-width="2" points="10 3.5 6 7.31 1 7.31 1 15.69 6 15.69 10 19.5"/></g></svg>\n']);return _e=function(){return e},e}var Pe=Object(r.d)(_e());function Re(){var e=Object(h.l)(["\n :host {\n display: flex;\n justify-content: center;\n align-items: center;\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n }\n\n .container {\n display: flex;\n justify-content: space-between;\n color: white;\n width: 100%;\n }\n\n .vertical-button-stack {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n .vertical-button-container {\n text-align: center;\n }\n\n .vertical-button-container button {\n vertical-align: bottom;\n }\n\n .vertical-button-container svg {\n vertical-align: bottom;\n }\n\n .vertical-button-value {\n font-size: 0.7em;\n line-height: 1.4em;\n text-align: center;\n }\n\n #play-pause-btn {\n border-radius: 50%;\n height: ",";\n width: ",";\n border: none;\n background-color: white;\n vertical-align: middle;\n }\n\n #play-pause-btn:active {\n background-color: rgba(255, 255, 255, 0.75);\n }\n\n #play-pause-btn svg {\n width: 100%;\n height: 100%;\n }\n\n .unstyled-button {\n background: none;\n border: none;\n margin: 0;\n padding: 0;\n }\n\n button {\n cursor: pointer;\n }\n\n .jump-btn:active img {\n opacity: 0.75;\n }\n "]);return Re=function(){return e},e}function Be(){var e=Object(h.l)(["var(--playPauseDiameter, 4rem)"]);return Be=function(){return e},e}function Ie(){var e=Object(h.l)(['\n <div class="container">\n <div class="vertical-button-stack playback-speed">\n <div class="vertical-button-container">\n <button id="playback-rate-btn" class="unstyled-button" @click="','">\n ','\n </button>\n </div>\n <div class="vertical-button-value">\n ','x\n </div>\n </div>\n <button id="prev-section-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <button id="back-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <button id="play-pause-btn" @click="','">\n ','\n </button>\n <button id="forward-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <button id="next-section-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <div class="vertical-button-stack volume">\n <div class="vertical-button-container">\n <button id="volume-control-btn" class="unstyled-button" @click="','">\n ','\n </button>\n </div>\n <div class="vertical-button-value">\n ',"%\n </div>\n </div>\n </div>\n "]);return Ie=function(){return e},e}var Ae=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Me=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).playbackMode=ue.paused,e.playbackRate=1,e.volume=1,e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(Ie(),this.handlePlaybackRateChange,Se,this.playbackRate,this.handlePrevSectionButton,pe,this.handleBackButton,ye,this.handlePlayPauseButton,this.playPauseButtonImage,this.handleForwardButton,me,this.handleNextSectionButton,de,this.handleVolumeChange,this.volumeButtonImage,100*this.volume)}},{key:"handlePlaybackRateChange",value:function(){2===this.playbackRate?this.playbackRate=.5:this.playbackRate+=.25;var e=new CustomEvent("playbackRateChange",{detail:{playbackRate:this.playbackRate}});this.dispatchEvent(e)}},{key:"handleVolumeChange",value:function(){1===this.volume?this.volume=0:this.volume+=.25;var e=new CustomEvent("volumeChange",{detail:{volume:this.volume}});this.dispatchEvent(e)}},{key:"handleBackButton",value:function(){var e=new Event("back-button-pressed");this.dispatchEvent(e)}},{key:"handlePrevSectionButton",value:function(){var e=new Event("prev-section-button-pressed");this.dispatchEvent(e)}},{key:"handleNextSectionButton",value:function(){var e=new Event("next-section-button-pressed");this.dispatchEvent(e)}},{key:"handlePlayPauseButton",value:function(){this.playbackMode=this.playbackMode===ue.playing?ue.paused:ue.playing;var e=new Event("play-pause-button-pressed");this.dispatchEvent(e)}},{key:"handleForwardButton",value:function(){var e=new Event("forward-button-pressed");this.dispatchEvent(e)}},{key:"playPauseButtonImage",get:function(){var e=we;switch(this.playbackMode){case ue.playing:e=Oe;break;case ue.paused:e=we}return e}},{key:"volumeButtonImage",get:function(){var e=Ce;return 0===this.volume&&(e=Pe),1===this.volume&&(e=Ee),e}}],[{key:"styles",get:function(){var e=Object(r.b)(Be());return Object(r.b)(Re(),e,e)}}]),n}(r.a);function Ne(){var e=Object(h.l)(['\n<svg height="10" viewBox="0 0 8 10" width="8" xmlns="http://www.w3.org/2000/svg"><path d="m4 1 5 8h-10z" fill="#fff" fill-rule="evenodd" transform="matrix(0 -1 1 0 -1 9)"/></svg>\n']);return Ne=function(){return e},e}Ae([Object(r.e)({type:ue})],Me.prototype,"playbackMode",void 0),Ae([Object(r.e)({type:Number})],Me.prototype,"playbackRate",void 0),Ae([Object(r.e)({type:Number})],Me.prototype,"volume",void 0),Me=Ae([Object(r.c)("playback-controls")],Me);var Fe=Object(r.d)(Ne());function Ue(){var e=Object(h.l)(['\n<svg height="10" viewBox="0 0 8 10" width="8" xmlns="http://www.w3.org/2000/svg"><path d="m4 1 5 8h-10z" fill="#fff" fill-rule="evenodd" transform="matrix(0 1 -1 0 9 1)"/></svg>\n']);return Ue=function(){return e},e}var qe=Object(r.d)(Ue());function De(){var e=Object(h.l)(["\n .container {\n display: flex;\n justify-content: center;\n height: 100%;\n }\n\n .arrow {\n padding-top: 10px;\n opacity: 1;\n transition: opacity "," ease-out, padding-top "," ease-out;\n }\n\n .right-arrow {\n visibility: hidden;\n }\n\n .arrow {\n visibility: hidden;\n }\n\n .container.mode-left .right-arrow {\n opacity: 0;\n }\n\n .container.mode-right .left-arrow {\n opacity: 0;\n }\n\n .container.mode-neither .left-arrow, .container.mode-neither .right-arrow {\n opacity: 0;\n padding-top: 75%;\n }\n\n .container.mode-neither .center-divider {\n height: ",";\n }\n\n .center-divider {\n border-left: 1px solid white;\n width: 1px;\n left: 50%;\n height: ",";\n align-self: flex-end;\n transition: height "," ease-out;\n }\n "]);return De=function(){return e},e}function Le(){var e=Object(h.l)(["var(--markerHeightExpanded, 25px)"]);return Le=function(){return e},e}function He(){var e=Object(h.l)(["var(--markerHeightCollapsed, 10px)"]);return He=function(){return e},e}function Ve(){var e=Object(h.l)(["0.1s"]);return Ve=function(){return e},e}function ze(){var e=Object(h.l)(['\n <div class="container mode-','">\n <div class="left-arrow arrow">','</div>\n <div class="center-divider"></div>\n <div class="right-arrow arrow">',"</div>\n </div>\n "]);return ze=function(){return e},e}var We,Ze=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o};!function(e){e.left="left",e.right="right",e.both="both",e.neither="neither"}(We||(We={}));var $e=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).markerMode=We.neither,e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(ze(),this.markerMode,qe,Fe)}}],[{key:"styles",get:function(){var e=Object(r.b)(Ve()),t=Object(r.b)(He()),n=Object(r.b)(Le());return Object(r.b)(De(),e,e,t,n,e)}}]),n}(r.a);function Qe(){var e=Object(h.l)(["\n .container {\n position: relative;\n height: 20px;\n }\n\n .color-fill {\n height: 10px;\n border-radius: 1em;\n position: absolute;\n bottom: 7px;\n left: 2px;\n right: -2px;\n }\n\n .marker-container {\n position: absolute;\n left: ",";\n right: ",";\n height: 100%;\n }\n\n section-marker {\n position: absolute;\n width: 2rem;\n height: ",";\n bottom: 7px;\n /*\n we set the left side of the marker to the spot where we want it, but the marker line is in\n the center of the marker so we need to shift it to the left by half its width so this transform\n is doing that\n */\n transform: translateX(-50%);\n }\n\n input[type='range'] {\n -webkit-appearance: none;\n height: ",";\n padding: 0;\n width: 100%;\n background: none;\n outline: none;\n position: absolute;\n bottom: 0;\n }\n\n input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n box-sizing: content-box;\n margin-top: ",";\n ","\n }\n\n input[type='range']::-moz-range-thumb {\n ","\n }\n\n input[type='range']::-ms-thumb {\n /* should come after -webkit- */\n ","\n margin-top: 0;\n }\n\n input[type='range']::-webkit-slider-runnable-track {\n ","\n }\n\n input[type='range']::-moz-range-track {\n ","\n }\n\n input[type='range']::-moz-range-progress {\n ",";\n }\n\n input[type='range']::-ms-track {\n /* should come after -webkit- */\n border-color: transparent;\n color: transparent;\n ","\n }\n\n input[type='range']::-ms-fill-lower {\n background-color: ",";\n ",";\n }\n\n input[type='range']::-ms-tooltip {\n display: none;\n }\n "]);return Qe=function(){return e},e}function Je(){var e=Object(h.l)(["\n border: ",";\n ",";\n "]);return Je=function(){return e},e}function Ke(){var e=Object(h.l)(["\n height: ",";\n border-radius: ",";\n "]);return Ke=function(){return e},e}function Xe(){var e=Object(h.l)(["\n background-color: ",";\n height: ",";\n width: ",";\n border-radius: ",";\n border: ",";\n cursor: pointer;\n "]);return Xe=function(){return e},e}function Ge(){var e=Object(h.l)(["var(--webkitThumbTopMargin, -6px)"]);return Ge=function(){return e},e}function Ye(){var e=Object(h.l)(["var(--trackColor, rgba(0, 0, 0, 0.1))"]);return Ye=function(){return e},e}function et(){var e=Object(h.l)(["var(--trackFillColor, #3272b6)"]);return et=function(){return e},e}function tt(){var e=Object(h.l)(["var(--trackBorder, 1px solid white)"]);return tt=function(){return e},e}function nt(){var e=Object(h.l)(["var(--trackBorderRadius, 5px)"]);return nt=function(){return e},e}function rt(){var e=Object(h.l)(["var(--trackHeight, 10px)"]);return rt=function(){return e},e}function it(){var e=Object(h.l)(["var(--thumbColor, white)"]);return it=function(){return e},e}function at(){var e=Object(h.l)(["var(--thumbBorder, 1px solid black)"]);return at=function(){return e},e}function ot(){var e=Object(h.l)(["var(--thumbBorderRadius, 50%)"]);return ot=function(){return e},e}function st(){var e=Object(h.l)(["var(--thumbDiameter, 20px)"]);return st=function(){return e},e}function ct(){var e=Object(h.l)(["var(--scrubberBarHeight, 20px)"]);return ct=function(){return e},e}function ut(){var e=Object(h.l)(["var(--markerInset, 10px)"]);return ut=function(){return e},e}function lt(){var e=Object(h.l)(["\n <section-marker\n data-location=",'\n style="left: ','%">\n </section-marker>\n ']);return lt=function(){return e},e}function ht(){var e=Object(h.l)(['\n <div class="container">\n <div class="color-fill">\n </div>\n\n <div class="marker-container">\n ','\n </div>\n\n <input\n id="slider"\n type="range"\n min=',"\n max=","\n step=","\n value=","\n @mousedown=","\n @mouseup=","\n @touchstart=","\n @touchend=","\n @input=","\n @change=",'\n />\n\n <div id="webkit-range-input-style"></div>\n </div>\n ']);return ht=function(){return e},e}Ze([Object(r.e)({type:We})],$e.prototype,"markerMode",void 0),$e=Ze([Object(r.c)("section-marker")],$e);var dt=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},ft=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).value=0,e.min=0,e.max=100,e.step=.1,e.sectionMarkerPercentages=[],e.expandSectionMarkers=!1,e._userInteracting=!1,e._value=0,e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(ht(),this.sectionMarkerPercentages.map((function(e){return Object(r.d)(lt(),e,e)})),this.min,this.max,this.step,this.value,this.interactionStarted,this.interactionEnded,this.interactionStarted,this.interactionEnded,this.handleSlide,this.handleSlide)}},{key:"updated",value:function(e){!this._userInteracting&&e.has("value")&&(this._value=this.value,this.rangeSlider&&(this.rangeSlider.value="".concat(this.value)),this.updateWebkitSliderStyle(),this.updateMarkerFlags())}},{key:"firstUpdated",value:function(){this.updateWebkitSliderStyle(),this.updateMarkerFlags()}},{key:"handleSlide",value:function(e){var t=e.target.value;this._value=parseFloat(t),this.updateWebkitSliderStyle(),this.updateMarkerFlags(),this.emitChangeEvent()}},{key:"interactionStarted",value:function(){this._userInteracting=!0,this.dispatchEvent(new Event("userInteractionStarted"))}},{key:"interactionEnded",value:function(){this._userInteracting=!1,this.dispatchEvent(new Event("userInteractionEnded"))}},{key:"updateWebkitSliderStyle",value:function(){this.webkitStyle&&(this.webkitStyle.innerHTML="\n <style>\n .color-fill {\n background: linear-gradient(to right,\n var(--trackFillColor, #3272b6) 0%, var(--trackFillColor, #3272b6) ".concat(this.percentage,"%,\n var(--trackColor, rgba(0, 0, 0, 0.1)) ").concat(this.percentage,"%, var(--trackColor, rgba(0, 0, 0, 0.1)) 100%);\n }\n </style>\n "))}},{key:"emitChangeEvent",value:function(){var e=new CustomEvent("valuechange",{detail:{value:this._value}});this.dispatchEvent(e)}},{key:"updateMarkerFlags",value:function(){var e=this;if(this.expandSectionMarkers){var t=this._value,n=this.sortedMarkers.filter((function(e){return e>t})),r=Math.min.apply(Math,Object(h.d)(n)),i=this.sortedMarkers.filter((function(e){return e<=t})),a=Math.max.apply(Math,Object(h.d)(i));this.sectionMarkerPercentages.forEach((function(t){if(e.shadowRoot){var n=e.shadowRoot.querySelector('section-marker[data-location="'.concat(t,'"]'));if(n)switch(t){case r:n.markerMode=We.left;break;case a:n.markerMode=We.right;break;default:n.markerMode=We.neither}}}))}}},{key:"percentage",get:function(){var e=this.max-this.min;return(this._value-this.min)/e*100}},{key:"rangeSlider",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("slider")}},{key:"webkitStyle",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("webkit-range-input-style")}},{key:"sortedMarkers",get:function(){return this.sectionMarkerPercentages.sort()}}],[{key:"styles",get:function(){var e=Object(r.b)(ut()),t=Object(r.b)(ct()),n=Object(r.b)(st()),i=Object(r.b)(ot()),a=Object(r.b)(at()),o=Object(r.b)(it()),s=Object(r.b)(rt()),c=Object(r.b)(nt()),u=Object(r.b)(tt()),l=Object(r.b)(et()),h=(Object(r.b)(Ye()),Object(r.b)(Ge())),d=Object(r.b)(Xe(),o,n,n,i,a),f=Object(r.b)(Ke(),s,c),p=Object(r.b)(Je(),u,f);return Object(r.b)(Qe(),e,e,s,t,h,d,d,d,p,p,f,p,l,f)}}]),n}(r.a);function pt(){var e=Object(h.l)(['\n <svg height="14" viewBox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg">\n <title>Magnifying Glass</title>\n <path\n d="m5.17668106 0c-2.859002 0-5.17668106 2.31767906-5.17668106 5.17668106 0 2.85900201 2.31767906 5.17668104 5.17668106 5.17668104.98756168.0210349 1.96052598-.240917 2.80403558-.75493263l4.09820586 4.20605333 1.7255603-1.7255603-4.20605333-4.09820586c.51401563-.8435096.77596753-1.8164739.75493263-2.80403558 0-2.859002-2.31767903-5.17668106-5.17668104-5.17668106m0 1.72556035c1.90600134 0 3.45112071 1.54511938 3.45112071 3.45112071 0 1.90600134-1.54511937 3.45112071-3.45112071 3.45112071-1.90600133 0-3.45112071-1.54511937-3.45112071-3.45112071 0-1.90600133 1.54511938-3.45112071 3.45112071-3.45112071"\n fill="#fff"\n />\n </svg>\n']);return pt=function(){return e},e}dt([Object(r.e)({type:Number})],ft.prototype,"value",void 0),dt([Object(r.e)({type:Number})],ft.prototype,"min",void 0),dt([Object(r.e)({type:Number})],ft.prototype,"max",void 0),dt([Object(r.e)({type:Number})],ft.prototype,"step",void 0),dt([Object(r.e)({type:Array})],ft.prototype,"sectionMarkerPercentages",void 0),dt([Object(r.e)({type:Boolean})],ft.prototype,"expandSectionMarkers",void 0),ft=dt([Object(r.c)("scrubber-bar")],ft);var vt=Object(r.d)(pt());function yt(){var e=Object(h.l)(['\n <svg height="9" viewBox="0 0 19 9" width="19" xmlns="http://www.w3.org/2000/svg">\n <title>Toggle Quick Search</title>\n <path\n d="m1 1 9 7 8-7"\n fill="none"\n stroke="#fff"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="2"\n />\n </svg>\n']);return yt=function(){return e},e}var bt=Object(r.d)(yt());function mt(){var e=Object(h.l)(['\n <svg height="12" viewBox="0 0 12 12" width="12" xmlns="http://www.w3.org/2000/svg">\n <title>Clear Search Results</title>\n <g fill="none" fill-rule="evenodd">\n <circle cx="6" cy="6" fill="#fff" r="6" />\n <g stroke="#000" stroke-linecap="round">\n <path d="m3.375 3.375 5.18412641 5.18412641" />\n <path d="m3.375 3.375 5.18412641 5.18412641" transform="matrix(-1 0 0 1 12 0)" />\n </g>\n </g>\n </svg>\n']);return mt=function(){return e},e}var gt=Object(r.d)(mt());function wt(){var e=Object(h.l)(["\n ul {\n padding: ",";\n margin: 0;\n list-style: none;\n }\n\n ul li {\n padding: ",";\n margin: 0;\n display: block;\n }\n\n ul li a {\n color: ",";\n text-decoration: ",";\n cursor: pointer;\n }\n "]);return wt=function(){return e},e}function kt(){var e=Object(h.l)(["var(--quickSearchLinkDecoration, none)"]);return kt=function(){return e},e}function Ot(){var e=Object(h.l)(["var(--quickSearchLinkColor, rgb(68, 132, 202))"]);return Ot=function(){return e},e}function jt(){var e=Object(h.l)(["var(--quickSearchListItemPadding, 0.5em 0 0 0)"]);return jt=function(){return e},e}function St(){var e=Object(h.l)(["var(--quickSearchListPadding, 0 0 0.5em 0)"]);return St=function(){return e},e}function xt(){var e=Object(h.l)(["\n <li>\n <a @click="," data-quick-search-index=",">\n ","\n </a>\n </li>\n "]);return xt=function(){return e},e}function Et(){var e=Object(h.l)(["\n <ul>\n ","\n </ul>\n "]);return Et=function(){return e},e}var Tt=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Ct=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).quickSearches=[],e}return Object(h.b)(n,[{key:"render",value:function(){var e=this;return Object(r.d)(Et(),this.quickSearches.map((function(t,n){return Object(r.d)(xt(),e.doQuickSearch,n,t.displayText)})))}},{key:"doQuickSearch",value:function(e){var t=e.target.dataset.quickSearchIndex;if(t){var n=parseInt(t,10),r=this.quickSearches[n],i=new CustomEvent("searchTermSelected",{detail:{searchEntry:r},bubbles:!0,composed:!0});this.dispatchEvent(i)}}}],[{key:"styles",get:function(){var e=Object(r.b)(St()),t=Object(r.b)(jt()),n=Object(r.b)(Ot()),i=Object(r.b)(kt());return Object(r.b)(wt(),e,t,n,i)}}]),n}(r.a);function _t(){var e=Object(h.l)(["\n .container {\n position: relative;\n }\n\n .search-bar {\n display: flex;\n justify-content: flex-start;\n }\n\n .endcap {\n display: flex;\n justify-content: center;\n align-items: center;\n height: calc("," * 2);\n border: ",";\n padding: 0 calc("," / 2);\n }\n\n .endcap svg {\n height: ",";\n width: ",";\n }\n\n .clear-search-container {\n border-left: 0;\n border-radius: 0 calc(",")\n calc(",") 0;\n }\n\n .search-bar.is-searching .clear-search-container {\n padding: 0 calc("," / 2) 0 0;\n }\n\n .search-bar.is-searching .clear-search-container button {\n display: block;\n }\n\n .clear-search-container button {\n display: none;\n }\n\n .magnifier-container {\n border-radius: calc(",") 0 0\n calc(",");\n border-right: 0;\n }\n .container.is-open .magnifier-container {\n border-radius: calc(",") 0 0 0;\n }\n\n .container.shows-disclosure .clear-search-container {\n border-radius: 0 0 0 0;\n }\n .container.shows-disclosure .clear-search-container {\n border-right: 0;\n }\n .disclosure-container {\n border-radius: 0 calc(",")\n calc(",") 0;\n display: none;\n }\n .container.shows-disclosure .disclosure-container {\n display: flex;\n }\n .container.is-open .disclosure-container {\n border-radius: 0 calc(",") 0 0;\n }\n .disclosure-container button {\n border: 0;\n background: none;\n }\n\n #search-input {\n border-top: ",";\n border-bottom: ",";\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n background-color: ",";\n color: ",";\n padding: 0;\n margin: 0;\n font-size: ",";\n flex: 1 1 auto;\n min-width: ",";\n }\n\n #search-input:focus {\n outline: none;\n }\n\n .quick-search {\n border-radius: 0 0 calc(",")\n calc(",");\n display: none;\n position: absolute;\n left: 0;\n right: 0;\n background-color: black;\n z-index: 1;\n max-height: ",";\n overflow-y: scroll;\n scrollbar-width: none;\n padding: 0 calc("," / 2);\n }\n\n .quick-search::-webkit-scrollbar {\n display: none;\n }\n\n .container.is-open.shows-disclosure .quick-search {\n border: ",";\n border-top: 0;\n display: block;\n }\n\n button {\n background: none;\n border: none;\n margin: 0;\n padding: 0;\n }\n "]);return _t=function(){return e},e}function Pt(){var e=Object(h.l)(["var(--expandableSearchBarMaxExpansionHeight, 150px)"]);return Pt=function(){return e},e}function Rt(){var e=Object(h.l)(["var(--expandableSearchBarMinWidth, 5em)"]);return Rt=function(){return e},e}function Bt(){var e=Object(h.l)(["var(--expandableSearchBarBorderColor, 1px solid white)"]);return Bt=function(){return e},e}function It(){var e=Object(h.l)(["var(--expandableSearchBarFontSize, 1em)"]);return It=function(){return e},e}function At(){var e=Object(h.l)(["var(--expandableSearchBarTextColor, white)"]);return At=function(){return e},e}function Mt(){var e=Object(h.l)(["var(--expandableSearchBarBackgroundColor, black)"]);return Mt=function(){return e},e}function Nt(){var e=Object(h.l)(['\n <div\n class="\n container\n ',"\n ",'"\n >\n <div class="search-bar ','">\n <div class="magnifier-container endcap">\n ','\n </div>\n <input\n id="search-input"\n type="text"\n placeholder="Search"\n value=',"\n @keyup=",'\n />\n <div class="clear-search-container endcap">\n <button id="clear-search-button" @click=',">\n ",'\n </button>\n </div>\n <div class="disclosure-container endcap">\n <button id="disclosure-button" @click=',">\n ",'\n </button>\n </div>\n </div>\n <div class="quick-search">\n <quick-search\n .quickSearches=',"\n @searchTermSelected=","\n >\n </quick-search>\n </div>\n </div>\n "]);return Nt=function(){return e},e}Tt([Object(r.e)({type:Array})],Ct.prototype,"quickSearches",void 0),Ct=Tt([Object(r.c)("quick-search")],Ct);var Ft=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Ut=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).isOpen=!1,e.showsDisclosure=!1,e.searchTerm="",e.quickSearches=[],e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(Nt(),this.isOpen?"is-open":"",this.showsDisclosure?"shows-disclosure":"",""===this.searchTerm?"":"is-searching",vt,this.searchTerm,this.inputChanged,this.clearSearch,gt,this.toggleDisclosure,bt,this.quickSearches,this.quickSearchSelected)}},{key:"clearSearch",value:function(){this.searchTerm="",this.searchInput&&(this.searchInput.value="",this.searchInput.focus()),this.emitSearchClearedEvent()}},{key:"inputChanged",value:function(e){this.searchInput&&(this.searchTerm=this.searchInput.value),this.emitInputChangeEvent(),"Enter"===e.key&&this.emitEnterKeyPressedEvent()}},{key:"emitInputChangeEvent",value:function(){var e=new CustomEvent("inputchange",{detail:{value:this.searchTerm}});this.dispatchEvent(e)}},{key:"emitEnterKeyPressedEvent",value:function(){var e=new CustomEvent("enterKeyPressed",{detail:{value:this.searchTerm}});this.dispatchEvent(e)}},{key:"emitSearchClearedEvent",value:function(){var e=new Event("searchCleared");this.dispatchEvent(e)}},{key:"quickSearchSelected",value:function(e){var t=new CustomEvent("quickSearchSelected",{detail:{quickSearchEntry:e.detail.searchEntry}});this.dispatchEvent(t),this.isOpen=!1}},{key:"toggleDisclosure",value:function(){this.isOpen=!this.isOpen}},{key:"searchInput",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("search-input")}}],[{key:"styles",get:function(){var e=Object(r.b)(Mt()),t=Object(r.b)(At()),n=Object(r.b)(It()),i=Object(r.b)(Bt()),a=Object(r.b)(Rt()),o=Object(r.b)(Pt());return Object(r.b)(_t(),n,i,n,n,n,n,n,n,n,n,n,n,n,n,i,i,e,t,n,a,n,n,o,n,i)}}]),n}(r.a);Ft([Object(r.e)({type:Boolean})],Ut.prototype,"isOpen",void 0),Ft([Object(r.e)({type:Boolean})],Ut.prototype,"showsDisclosure",void 0),Ft([Object(r.e)({type:String})],Ut.prototype,"searchTerm",void 0),Ft([Object(r.e)({type:Array})],Ut.prototype,"quickSearches",void 0),Ut=Ft([Object(r.c)("expandable-search-bar")],Ut);var qt=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(h.a)(this,e),this.displayText="",this.data={},this.displayText=t,this.data=n};function Dt(){var e=Object(h.l)(["\n #completed-ring {\n fill: ",";\n }\n\n #check {\n fill: ",";\n }\n\n #activity-ring {\n fill: ",";\n }\n\n #activity-dots {\n fill: ",";\n }\n\n .activity-indicator {\n opacity: 0;\n transition: opacity 0.25s ease-out;\n }\n\n .processing .activity-indicator {\n opacity: 1;\n }\n\n .loaded-indicator {\n opacity: 1;\n transition: opacity 0.25s ease-out;\n }\n\n .processing .loaded-indicator {\n opacity: 0;\n }\n\n .image {\n border: 1px solid red;\n display: inline-block;\n }\n\n .processing #activity-ring {\n animation: rotate 1.3s infinite linear;\n transform-origin: 50px 50px;\n transform-box: fill-box;\n }\n\n .processing #left-dot {\n opacity: 0;\n animation: dot 1.3s infinite;\n animation-delay: 0.2s;\n }\n\n .processing #middle-dot {\n opacity: 0;\n animation: dot 1.3s infinite;\n animation-delay: 0.4s;\n }\n\n .processing #right-dot {\n opacity: 0;\n animation: dot 1.3s infinite;\n animation-delay: 0.6s;\n }\n\n @keyframes rotate {\n 0% {\n transform: rotate(-360deg);\n }\n }\n\n @keyframes dot {\n 0% {\n opacity: 0;\n }\n 25% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n "]);return Dt=function(){return e},e}function Lt(){var e=Object(h.l)(["var(--activityIndicatorLoadingDotColor, #333333)"]);return Lt=function(){return e},e}function Ht(){var e=Object(h.l)(["var(--activityIndicatorLoadingRingColor, #333333)"]);return Ht=function(){return e},e}function Vt(){var e=Object(h.l)(["var(--activityIndicatorCompletedRingColor, #31A481)"]);return Vt=function(){return e},e}function zt(){var e=Object(h.l)(["var(--activityIndicatorCheckmarkColor, #31A481)"]);return zt=function(){return e},e}function Wt(){var e=Object(h.l)(['\n <div class="','">\n <svg\n viewBox="0 0 120 120"\n preserveAspectRatio="none"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n aria-labelledby="indicatorTitle indicatorDescription"\n >\n <title id="indicatorTitle">Activity Indicator</title>\n <desc id="indicatorDescription">\n A rotating activity indicator with three dots in the middle.\n </desc>\n <g\n id="icons/check-ring---squared"\n stroke="none"\n stroke-width="1"\n fill="none"\n fill-rule="evenodd"\n >\n <path\n id="completed-ring"\n class="loaded-indicator"\n d="M60,10 C70.5816709,10 80.3955961,13.2871104 88.4763646,18.8959201 L78.3502633,29.0214223 C72.9767592,25.8315427 66.7022695,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 L95.995,59.46 L108.327675,47.128668 C109.350926,50.9806166 109.925886,55.015198 109.993301,59.1731586 L110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"\n ></path>\n <polygon\n id="check"\n class="loaded-indicator"\n transform="translate(75.000000, 41.500000) rotate(44.000000) translate(-75.000000, -41.500000) "\n points="96 85 54 85 54 65 76 64.999 76 -2 96 -2"\n ></polygon>\n <path\n id="activity-ring"\n class="activity-indicator"\n d="M60,10 C69.8019971,10 78.9452178,12.8205573 86.6623125,17.6943223 L76.4086287,27.9484118 C71.4880919,25.4243078 65.9103784,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 C96,53.3014663 94.1704984,47.0302355 90.9839104,41.6587228 L101.110332,31.5326452 C106.715332,39.6116982 110,49.4222615 110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"\n ></path>\n <g\n id="activity-dots"\n class="activity-indicator"\n transform="translate(40.000000, 55.000000)"\n >\n <circle id="left-dot" cx="5" cy="5" r="5"></circle>\n <circle id="middle-dot" cx="20" cy="5" r="5"></circle>\n <circle id="right-dot" cx="35" cy="5" r="5"></circle>\n </g>\n </g>\n </svg>\n </div>\n ']);return Wt=function(){return e},e}var Zt=Object.freeze({processing:"processing",complete:"complete"}),$t=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.call(this)).mode=Zt.processing,e}return Object(h.b)(n,null,[{key:"properties",get:function(){return{mode:{type:String}}}}]),Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(Wt(),this.mode)}}],[{key:"styles",get:function(){var e=Object(r.b)(zt()),t=Object(r.b)(Vt()),n=Object(r.b)(Ht()),i=Object(r.b)(Lt());return Object(r.b)(Dt(),t,e,n,i)}}]),n}(r.a);function Qt(){var e=Object(h.l)(['\n <svg height="13" viewBox="0 0 8 13" width="8" xmlns="http://www.w3.org/2000/svg">\n <path\n d="m-1.5 8.5 5-5 5 5"\n fill="none"\n stroke="#fff"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="2"\n transform="matrix(0 -1 1 0 -2 9.7)"\n />\n </svg>\n']);return Qt=function(){return e},e}window.customElements.define("ia-activity-indicator",$t);var Jt=Object(r.d)(Qt());function Kt(){var e=Object(h.l)(['\n <svg height="13" viewBox="0 0 8 13" width="8" xmlns="http://www.w3.org/2000/svg">\n <path\n d="m-1.5 8.5 5-5 5 5"\n fill="none"\n stroke="#fff"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="2"\n transform="matrix(0 -1 -1 0 10 9.7)"\n />\n </svg>\n']);return Kt=function(){return e},e}var Xt=Object(r.d)(Kt());function Gt(){var e=Object(h.l)(["\n .container {\n text-align: center;\n }\n\n button {\n background: none;\n border: 0;\n cursor: pointer;\n }\n "]);return Gt=function(){return e},e}function Yt(){var e=Object(h.l)(['\n <div class="container">\n <button @click=',' id="previous-button">\n ','\n </button>\n <span class="results-range">\n <span id="current-result">','</span> /\n <span id="number-of-results">',"</span>\n </span>\n <button @click=",' id="next-button">\n ',"\n </button>\n </div>\n "]);return Yt=function(){return e},e}var en=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},tn=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).numberOfResults=0,e.currentResultIndex=0,e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(Yt(),this.goToPreviousResult,Jt,this.currentResultIndex+1,this.numberOfResults,this.goToNextResult,Xt)}},{key:"updated",value:function(e){e.has("numberOfResults")&&(this.currentResultIndex=0)}},{key:"goToPreviousResult",value:function(){this.currentResultIndex<1?this.currentResultIndex=this.numberOfResults-1:this.currentResultIndex-=1,this.emitSearchResultIndexChangedEvent()}},{key:"goToNextResult",value:function(){this.currentResultIndex===this.numberOfResults-1?this.currentResultIndex=0:this.currentResultIndex+=1,this.emitSearchResultIndexChangedEvent()}},{key:"emitSearchResultIndexChangedEvent",value:function(){var e=new CustomEvent("searchResultIndexChanged",{detail:{searchResultIndex:this.currentResultIndex}});this.dispatchEvent(e)}}],[{key:"styles",get:function(){return Object(r.b)(Gt())}}]),n}(r.a);en([Object(r.e)({type:Number})],tn.prototype,"numberOfResults",void 0),en([Object(r.e)({type:Number})],tn.prototype,"currentResultIndex",void 0),tn=en([Object(r.c)("search-results-switcher")],tn);var nn=function e(t,n){Object(h.a)(this,e),this.start=0,this.end=0,this.start=t,this.end=n};function rn(){var e=Object(h.l)(["\n section[role='main'] {\n display: -ms-grid;\n display: grid;\n grid-gap: 0.5rem;\n }\n\n ia-activity-indicator {\n width: 1.5em;\n height: 1.5em;\n display: block;\n margin: auto;\n --activityIndicatorLoadingRingColor: #999;\n --activityIndicatorLoadingDotColor: #999;\n }\n\n /* mobile view */\n @media (max-width: 770px) {\n section[role='main'] {\n -ms-grid-columns: 25% 0.5rem 1fr;\n -ms-grid-rows: auto 0.5rem auto 0.5rem auto 0.5rem auto 0.5rem auto;\n grid-template-columns: 25% 1fr;\n grid-template-areas:\n 'collection-logo title-date'\n 'waveform-scrubber waveform-scrubber'\n 'playback-controls playback-controls'\n 'search-section search-section'\n 'transcript-container transcript-container';\n }\n .date {\n text-align: left;\n }\n transcript-view {\n --timeDisplay: none;\n }\n playback-controls {\n width: 75%;\n margin: auto;\n grid-row: 5;\n grid-column: 1;\n -ms-grid-row: 5;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n }\n .title-date {\n grid-row: 1;\n grid-column: 3;\n -ms-grid-row: 1;\n -ms-grid-column: 3;\n }\n .transcript-container {\n grid-row: 9;\n grid-column: 1;\n -ms-grid-row: 9;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n }\n .collection-logo {\n grid-row: 1;\n grid-column: 1;\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n .waveform-scrubber-container {\n grid-row: 3;\n grid-column: 1;\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n }\n .search-section {\n grid-row: 7;\n grid-column: 1;\n -ms-grid-row: 7;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n width: 75%;\n margin: auto;\n }\n expandable-search-bar {\n width: 100%;\n }\n }\n\n /* wide view */\n @media (min-width: 770px) {\n section[role='main'] {\n -ms-grid-columns: 192px 0.5rem 0 0.5rem 250px 0.5rem 1fr;\n -ms-grid-rows: auto 0.5rem auto 0.5rem auto;\n grid-template-columns: 192px 0 250px 1fr;\n grid-template-areas:\n 'title-date title-date title-date title-date'\n 'collection-logo 1 playback-controls waveform-scrubber'\n 'search-section transcript-container transcript-container transcript-container';\n }\n .title-date {\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n grid-row: 1;\n grid-column: 1;\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 7;\n }\n transcript-view {\n --timeDisplay: block;\n }\n playback-controls {\n grid-row: 3;\n grid-column: 5;\n -ms-grid-row: 3;\n -ms-grid-column: 5;\n -ms-grid-column-span: 1;\n }\n .transcript-container {\n grid-row: 5;\n grid-column: 3;\n -ms-grid-row: 5;\n -ms-grid-column: 3;\n -ms-grid-column-span: 5;\n }\n .collection-logo {\n grid-row: 3;\n grid-column: 1;\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n .waveform-scrubber-container {\n grid-row: 3;\n grid-column: 7;\n -ms-grid-row: 3;\n -ms-grid-column: 7;\n -ms-grid-column-span: 1;\n }\n .search-section {\n grid-row: 5;\n grid-column: 1;\n -ms-grid-row: 5;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n }\n\n .title-date {\n grid-area: title-date;\n }\n\n .title {\n color: ",";\n font: ",";\n }\n\n .date {\n color: ",";\n font: ",";\n }\n\n waveform-progress {\n width: 100%;\n height: ",";\n }\n\n playback-controls {\n grid-area: playback-controls;\n }\n\n .transcript-container {\n grid-area: transcript-container;\n }\n\n transcript-view {\n max-width: 600px;\n display: block;\n }\n\n .collection-logo {\n width: 100%;\n max-height: ",";\n object-fit: contain;\n grid-area: collection-logo;\n align-self: center;\n }\n\n .waveform-scrubber-container {\n width: 100%;\n height: 100%;\n grid-area: waveform-scrubber;\n }\n\n .search-section {\n grid-area: search-section;\n }\n\n .search-results-info {\n margin-top: 0.5em;\n }\n\n .quick-search-container {\n max-height: 150px;\n overflow-y: scroll;\n scrollbar-width: none;\n margin: 0 0.5em;\n }\n\n .quick-search-container::-webkit-scrollbar {\n display: none;\n }\n\n expandable-search-bar {\n display: block;\n margin: auto;\n }\n\n .no-search-results-message {\n text-align: center;\n }\n\n .hidden {\n display: none;\n }\n "]);return rn=function(){return e},e}function an(){var e=Object(h.l)(["var(--waveformProgressHeight, 5rem)"]);return an=function(){return e},e}function on(){var e=Object(h.l)(["var(--dateFont, 1em sans-serif)"]);return on=function(){return e},e}function sn(){var e=Object(h.l)(["var(--dateColor, white)"]);return sn=function(){return e},e}function cn(){var e=Object(h.l)(["var(--titleFont, 1.5em sans-serif)"]);return cn=function(){return e},e}function un(){var e=Object(h.l)(["var(--titleColor, white)"]);return un=function(){return e},e}function ln(){var e=Object(h.l)(["var(--collectionLogoMaxHeight, 8rem)"]);return ln=function(){return e},e}function hn(){var e=Object(h.l)(['\n <div\n class="\n no-search-results-message\n ','"\n >\n No search results.\n </div>\n ']);return hn=function(){return e},e}function dn(){var e=Object(h.l)(['\n <ia-activity-indicator\n class="','">\n </ia-activity-indicator>\n ']);return dn=function(){return e},e}function fn(){var e=Object(h.l)(['\n <search-results-switcher\n class="','"\n @searchResultIndexChanged=',"\n >\n </search-results-switcher>\n "]);return fn=function(){return e},e}function pn(){var e=Object(h.l)(['\n <div class="search-section">\n <expandable-search-bar\n searchTerm=',"\n .quickSearches=","\n @inputchange=","\n @enterKeyPressed=","\n @searchCleared=",'\n >\n </expandable-search-bar>\n <div class="search-results-info">\n ',"\n ","\n ","\n </div>\n </div>\n "]);return pn=function(){return e},e}function vn(){var e=Object(h.l)(['\n <div class="transcript-container">\n <transcript-view\n .config=',"\n .currentTime=","\n @transcriptEntrySelected=","\n >\n </transcript-view>\n </div>\n "]);return vn=function(){return e},e}function yn(){var e=Object(h.l)(["\n <scrubber-bar\n .sectionMarkerPercentages=","\n .value=","\n @valuechange=","\n >\n </scrubber-bar>\n "]);return yn=function(){return e},e}function bn(){var e=Object(h.l)(["\n <playback-controls\n @back-button-pressed=","\n @play-pause-button-pressed=","\n @forward-button-pressed=","\n @volumeChange=","\n @playbackRateChange=","\n @next-section-button-pressed=","\n @prev-section-button-pressed=","\n >\n </playback-controls>\n "]);return bn=function(){return e},e}function mn(){var e=Object(h.l)(["\n <audio-element\n .sources=","\n .playbackRate=","\n .volume=","\n @timeupdate=","\n @durationchange=","\n @playbackStarted=","\n @playbackPaused=","\n @canplay=","\n >\n </audio-element>\n "]);return mn=function(){return e},e}function gn(){var e=Object(h.l)(['\n <waveform-progress\n interactive="true"\n .waveformUrl=',"\n .percentComplete=","\n @valuechange=","\n >\n </waveform-progress>\n "]);return gn=function(){return e},e}function wn(){var e=Object(h.l)(['\n <img class="collection-logo" src='," />\n "]);return wn=function(){return e},e}function kn(){var e=Object(h.l)(['\n <div class="title-date">\n <div class="title">\n ','\n </div>\n\n <div class="date">\n ',"\n </div>\n </div>\n "]);return kn=function(){return e},e}function On(){var e=Object(h.l)(["\n ",'\n <section role="main">\n '," "," ",'\n <div class="waveform-scrubber-container">\n '," ","\n </div>\n "," ","\n </section>\n "]);return On=function(){return e},e}var jn=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(h.i)(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Sn=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},xn=function(e){Object(h.e)(n,e);var t=Object(h.f)(n);function n(){var e;return Object(h.a)(this,n),(e=t.apply(this,arguments)).config=void 0,e.searchHandler=void 0,e.transcriptConfig=void 0,e.searchResultsTranscript=void 0,e.currentTime=0,e.searchTerm="",e.skipMusicSections=!1,e.percentComplete=0,e.isPlaying=!1,e.duration=0,e.playbackRate=1,e.volume=1,e.shouldShowSearchResultSwitcher=!1,e.shouldShowNoSearchResultMessage=!1,e.isSearching=!1,e.musicZones=[],e}return Object(h.b)(n,[{key:"render",value:function(){return Object(r.d)(On(),this.audioElementTemplate,this.titleDateTemplate,this.collectionLogoTemplate,this.playbackControlsTemplate,this.waveFormProgressTemplate,this.scrubberBarTemplate,this.searchSectionTemplate,this.transcriptViewTemplate)}},{key:"play",value:function(){this.audioElement&&this.audioElement.play()}},{key:"pause",value:function(){this.audioElement&&this.audioElement.pause()}},{key:"seekTo",value:function(e){this.audioElement&&this.audioElement.seekTo(e)}},{key:"updateSearchTerm",value:function(e){var t=e.detail||{};if(t.value){var n=t.value;this.searchTerm=n,this.emitSearchTermChangedEvent(n)}}},{key:"searchCleared",value:function(){this.searchTerm="",this.searchResultsTranscript=void 0,this.emitSearchClearedEvent(),this.emitSearchTermChangedEvent(""),this.transcriptView&&(this.transcriptView.selectedSearchResultIndex=0),this.searchResultsSwitcher&&(this.searchResultsSwitcher.currentResultIndex=0)}},{key:"searchResultIndexChanged",value:function(e){var t=(e.detail||{}).searchResultIndex;if(void 0!==t&&this.transcriptView){this.transcriptView.selectedSearchResultIndex=t,this.transcriptView.scrollToSelectedSearchResult();var n=new CustomEvent("highlightedSearchResultChanged",{detail:{searchResultIndex:t}});this.dispatchEvent(n)}}},{key:"searchEnterKeyPressed",value:function(e){var t=e.detail||{};t.value&&this.executeSearch(t.value)}},{key:"executeSearch",value:function(e){return Sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.searchHandler&&!(e.length<2)){t.next=3;break}return this.searchResultsTranscript=void 0,t.abrupt("return");case 3:return this.searchTerm=e,this.isSearching=!0,n=new Event("searchExecuted"),this.dispatchEvent(n),t.next=9,this.searchHandler.search(e);case 9:this.searchResultsTranscript=t.sent,this.isSearching=!1;case 11:case"end":return t.stop()}}),t,this)})))}},{key:"changePlaybackRate",value:function(e){var t=e.detail||{};if(t.playbackRate){this.playbackRate=t.playbackRate;var n=new CustomEvent("playbackRateChanged",{detail:{playbackRate:this.playbackRate}});this.dispatchEvent(n)}}},{key:"volumeChanged",value:function(e){if(void 0!==(e.detail||{}).volume){this.volume=e.detail.volume;var t=new CustomEvent("volumeChanged",{detail:{volume:this.volume}});this.dispatchEvent(t)}}},{key:"backButtonHandler",value:function(){this.audioElement&&this.audioElement.seekBy(-10);var e=new Event("jumpBackButtonPressed");this.dispatchEvent(e)}},{key:"playPauseButtonHandler",value:function(){if(this.isPlaying=!this.isPlaying,this.audioElement){this.isPlaying?this.audioElement.play():this.audioElement.pause();var e=new CustomEvent("playPauseButtonPressed",{detail:{isPlaying:this.isPlaying}});this.dispatchEvent(e)}}},{key:"forwardButtonHandler",value:function(){this.audioElement&&this.audioElement.seekBy(10);var e=new Event("jumpForwardButtonPressed");this.dispatchEvent(e)}},{key:"nextSectionButtonHandler",value:function(){var e=this;if(this.audioElement){var t=this.scrubberBarMarkerPercentages.filter((function(t){return t>e.percentComplete+.1})),n=Math.min.apply(Math,Object(h.d)(t)),r=this.duration*(n/100)+.1;this.audioElement.seekTo(r);var i=new Event("nextSectionButtonPressed");this.dispatchEvent(i)}}},{key:"prevSectionButtonHandler",value:function(){var e=this;if(this.audioElement){var t=this.scrubberBarMarkerPercentages.filter((function(t){return t<e.percentComplete-.1})),n=Math.max.apply(Math,Object(h.d)(t)),r=this.duration*(n/100)-.1;this.audioElement.seekTo(r);var i=new Event("prevSectionButtonPressed");this.dispatchEvent(i)}}},{key:"handleDurationChange",value:function(e){var t=e.detail||{};t.duration&&(this.duration=t.duration)}},{key:"handleTimeChange",value:function(e){var t=e.detail||{};if(t.currentTime){this.currentTime=t.currentTime;var n=this.currentTime/this.duration;this.percentComplete=100*n}}},{key:"emitCurrentTimeChangedEvent",value:function(){var e=new CustomEvent("currentTimeChanged",{detail:{currentTime:this.currentTime}});this.dispatchEvent(e)}},{key:"emitSearchClearedEvent",value:function(){var e=new Event("searchCleared");this.dispatchEvent(e)}},{key:"emitSearchTermChangedEvent",value:function(e){var t=new CustomEvent("searchTermChanged",{detail:{searchTerm:e}});this.dispatchEvent(t)}},{key:"playbackPaused",value:function(){this.isPlaying=!1,this.playbackControls&&(this.playbackControls.playbackMode=ue.paused);var e=new Event("playbackPaused");this.dispatchEvent(e)}},{key:"playbackStarted",value:function(){this.isPlaying=!0,this.playbackControls&&(this.playbackControls.playbackMode=ue.playing);var e=new Event("playbackStarted");this.dispatchEvent(e)}},{key:"canplay",value:function(){var e=new Event("canplay");this.dispatchEvent(e)}},{key:"valueChangedFromScrub",value:function(e){var t=e.detail||{};if(t.value){var n=t.value,r=this.duration*(n/100);this.currentTime=r,this.audioElement&&this.audioElement.seekTo(r),this.percentComplete=n;var i=new CustomEvent("timeChangedFromScrub",{detail:{newTime:this.currentTime}});this.dispatchEvent(i)}}},{key:"transcriptEntrySelected",value:function(e){var t=(e.detail||{}).entry||{};if(t.start){var n=t.start;this.currentTime=n,this.audioElement&&(this.audioElement.seekTo(n),this.audioElement.play());var r=new CustomEvent("transcriptEntrySelected",{detail:{newTime:this.currentTime}});this.dispatchEvent(r)}}},{key:"updateMusicZones",value:function(){var e=this.transcriptEntries.filter((function(e){return!0===e.isMusic})).map((function(e){return new nn(e.start,e.end)}));this.musicZones=e}},{key:"skipMusicZone",value:function(){var e=this,t=this.musicZones.find((function(t){return e.currentTime>t.start&&e.currentTime<t.end}));t&&this.audioElement&&this.audioElement.seekTo(t.end+.1)}},{key:"updateSearchResultSwitcher",value:function(){if(this.shouldShowNoSearchResultMessage=!1,this.shouldShowSearchResultSwitcher=!1,0!==this.searchTerm.length){var e=this.searchResults.length;0===e?this.shouldShowNoSearchResultMessage=!0:(this.shouldShowSearchResultSwitcher=!0,this.searchResultsSwitcher&&(this.searchResultsSwitcher.numberOfResults=e))}}},{key:"updated",value:function(e){e.has("transcriptConfig")&&this.updateMusicZones(),e.has("searchResultsTranscript")&&this.updateSearchResultSwitcher(),e.has("searchHandler")&&this.searchTerm&&this.executeSearch(this.searchTerm),e.has("currentTime")&&(this.emitCurrentTimeChangedEvent(),this.skipMusicSections&&this.skipMusicZone())}},{key:"titleDateTemplate",get:function(){return Object(r.d)(kn(),this.config?this.config.title:"",this.config?this.config.date:"")}},{key:"collectionLogoTemplate",get:function(){return Object(r.d)(wn(),this.logoUrl)}},{key:"logoUrl",get:function(){return this.config?this.config.logoUrl:""}},{key:"waveFormProgressTemplate",get:function(){return this.waveformUrl?Object(r.d)(gn(),this.waveformUrl,this.percentComplete,this.valueChangedFromScrub):void 0}},{key:"zonesOfSilence",get:function(){var e=this;return 0===this.duration?[]:this.transcriptEntries.filter((function(e){return!0===e.isMusic})).map((function(t){var n=t.start/e.duration*100,r=t.end/e.duration*100;return new le(n,r)}))}},{key:"waveformUrl",get:function(){return this.config?this.config.waveformUrl:""}},{key:"audioElementTemplate",get:function(){return Object(r.d)(mn(),this.audioSources,this.playbackRate,this.volume,this.handleTimeChange,this.handleDurationChange,this.playbackStarted,this.playbackPaused,this.canplay)}},{key:"audioSources",get:function(){return this.config?this.config.audioSources:[]}},{key:"playbackControlsTemplate",get:function(){return Object(r.d)(bn(),this.backButtonHandler,this.playPauseButtonHandler,this.forwardButtonHandler,this.volumeChanged,this.changePlaybackRate,this.nextSectionButtonHandler,this.prevSectionButtonHandler)}},{key:"scrubberBarMarkerPercentages",get:function(){var e=[0];return this.zonesOfSilence.forEach((function(t){e.push(t.startPercent),e.push(t.endPercent)})),e.push(100),e}},{key:"scrubberBarTemplate",get:function(){return Object(r.d)(yn(),this.scrubberBarMarkerPercentages,this.percentComplete,this.valueChangedFromScrub)}},{key:"transcriptViewTemplate",get:function(){return Object(r.d)(vn(),this.currentTranscript,this.currentTime,this.transcriptEntrySelected)}},{key:"currentTranscript",get:function(){return this.searchResultsTranscript||this.transcriptConfig}},{key:"searchSectionTemplate",get:function(){return Object(r.d)(pn(),this.searchTerm,this.quickSearches,this.updateSearchTerm,this.searchEnterKeyPressed,this.searchCleared,this.searchActivityIndicator,this.searchResultsSwitcherTemplate,this.noSearchResultsTemplate)}},{key:"searchResultsSwitcherTemplate",get:function(){return Object(r.d)(fn(),this.shouldShowSearchResultSwitcher&&!this.isSearching?"":"hidden",this.searchResultIndexChanged)}},{key:"searchActivityIndicator",get:function(){return Object(r.d)(dn(),this.isSearching?"":"hidden")}},{key:"noSearchResultsTemplate",get:function(){return Object(r.d)(hn(),this.shouldShowNoSearchResultMessage&&!this.isSearching?"":"hidden")}},{key:"quickSearches",get:function(){return this.config?this.config.quickSearches.map((function(e){return new qt(e)})):[]}},{key:"transcriptEntries",get:function(){return this.currentTranscript?this.currentTranscript.entries:[]}},{key:"transcriptView",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("transcript-view"):null}},{key:"audioElement",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("audio-element"):null}},{key:"playbackControls",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("playback-controls"):null}},{key:"searchResultsSwitcher",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("search-results-switcher"):null}},{key:"searchResults",get:function(){return this.searchResultsTranscript?this.searchResultsTranscript.searchResults:[]}}],[{key:"styles",get:function(){var e=Object(r.b)(ln()),t=Object(r.b)(un()),n=Object(r.b)(cn()),i=Object(r.b)(sn()),a=Object(r.b)(on()),o=Object(r.b)(an());return Object(r.b)(rn(),t,n,i,a,o,e)}}]),n}(r.a);jn([Object(r.e)({type:Object})],xn.prototype,"config",void 0),jn([Object(r.e)({type:Object})],xn.prototype,"searchHandler",void 0),jn([Object(r.e)({type:Object})],xn.prototype,"transcriptConfig",void 0),jn([Object(r.e)({type:Object})],xn.prototype,"searchResultsTranscript",void 0),jn([Object(r.e)({type:Number})],xn.prototype,"currentTime",void 0),jn([Object(r.e)({type:String})],xn.prototype,"searchTerm",void 0),jn([Object(r.e)({type:Boolean})],xn.prototype,"skipMusicSections",void 0),jn([Object(r.e)({type:Number})],xn.prototype,"percentComplete",void 0),jn([Object(r.e)({type:Boolean})],xn.prototype,"isPlaying",void 0),jn([Object(r.e)({type:Number})],xn.prototype,"duration",void 0),jn([Object(r.e)({type:Number})],xn.prototype,"playbackRate",void 0),jn([Object(r.e)({type:Number})],xn.prototype,"volume",void 0),jn([Object(r.e)({type:Boolean})],xn.prototype,"shouldShowSearchResultSwitcher",void 0),jn([Object(r.e)({type:Boolean})],xn.prototype,"shouldShowNoSearchResultMessage",void 0),jn([Object(r.e)({type:Boolean})],xn.prototype,"isSearching",void 0);xn=jn([Object(r.c)("radio-player")],xn);var En=function e(t,n,r,i,a){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];Object(h.a)(this,e),this.quickSearches=[],this.title=t,this.date=n,this.logoUrl=r,this.waveformUrl=i,this.audioSources=a,this.quickSearches=o},Tn=function(){function e(t,n){Object(h.a)(this,e),this.startIndex=t,this.endIndex=n}return Object(h.b)(e,[{key:"length",get:function(){return Math.abs(this.endIndex-this.startIndex)}}]),e}(),Cn=function e(t,n){Object(h.a)(this,e),this.entry=t,this.range=n},_n=function e(t,n,r){Object(h.a)(this,e),this.range=t,this.text=n,this.isSearchMatch=r},Pn=function(){function e(){Object(h.a)(this,e)}return Object(h.b)(e,null,[{key:"getIntersection",value:function(e,t){var n=e.startIndex<t.startIndex?e:t,r=n===e?t:e;if(!(n.endIndex<r.startIndex)){var i=n.endIndex<r.endIndex?n.endIndex:r.endIndex;return new Tn(r.startIndex,i)}}}]),e}(),Rn=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},Bn=function(){function e(t,n){Object(h.a)(this,e),this.searchBackend=t,this.transcriptIndex=n}return Object(h.b)(e,[{key:"search",value:function(e){return Rn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,a,o,s=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getSearchSeparatedTranscript(e);case 2:return n=t.sent,r=[],i=0,a=1,n.forEach((function(e){if(e.isSearchMatch){var t=s.transcriptIndex.getTranscriptEntryAt(e.range.startIndex);if(!t)return;var n=e.range.endIndex,o=s.transcriptIndex.getTranscriptEntryAt(n)||t,c=s.createBlankTranscriptEntryConfig(t.entry);return c.searchMatchIndex=i,i+=1,c.rawText=e.text,c.id=a,a+=1,c.end=o.entry.end,void r.push(c)}s.transcriptIndex.transcriptEntryRanges.forEach((function(t){var n=Pn.getIntersection(e.range,t.range);if(n&&0!==n.length){var i=s.createBlankTranscriptEntryConfig(t.entry),o=s.transcriptIndex.mergedTranscript.substring(n.startIndex,n.endIndex);i.rawText=o.trim(),i.id=a,a+=1,r.push(i)}}))})),o=new m(r),t.abrupt("return",new Promise((function(e){return e(o)})));case 9:case"end":return t.stop()}}),t,this)})))}},{key:"createBlankTranscriptEntryConfig",value:function(e){return new $(e.id,e.start,e.end,"",e.isMusic)}},{key:"getSearchSeparatedTranscript",value:function(e){return Rn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,a,o,s,c,u=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.searchBackend.getSearchRanges(e);case 2:if(n=t.sent,r=this.transcriptIndex.mergedTranscript,0!==n.length){t.next=7;break}return i=new Tn(0,r.length),t.abrupt("return",new Promise((function(e){return e([new _n(i,r,!1)])})));case 7:return n.sort((function(e,t){return e.startIndex-t.startIndex})),a=[],o=0,n.forEach((function(e){var t=new Tn(o,e.startIndex),n=u.getSearchResult(t,!1);a.push(n);var r=u.getSearchResult(e,!0);a.push(r),o=e.endIndex})),s=new Tn(o,r.length),c=this.getSearchResult(s,!1),a.push(c),t.abrupt("return",new Promise((function(e){return e(a)})));case 15:case"end":return t.stop()}}),t,this)})))}},{key:"getSearchResult",value:function(e,t){var n=this.transcriptIndex.mergedTranscript.substring(e.startIndex,e.endIndex);return new _n(e,n,t)}}]),e}(),In=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))},An=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"{{{",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"}}}";Object(h.a)(this,e),this.service=t,this.startTag=n,this.endTag=r}return Object(h.b)(e,[{key:"getSearchRanges",value:function(e){return In(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],t.next=3,this.service.searchRequested(e);case 3:return t.sent.value.docs.forEach((function(e){var t=e.text;e.highlight.cc.forEach((function(e){var i=r.rangesOfResultInTranscript(e,t);n=n.concat(i)}))})),t.abrupt("return",new Promise((function(e){e(n)})));case 6:case"end":return t.stop()}}),t,this)})))}},{key:"rangesOfResultInTranscript",value:function(e,t){for(var n,r=new RegExp("".concat(this.startTag,"(.*?)").concat(this.endTag),"gm"),i=this.getStartIndexOfHighlight(e,t),a=this.startTag.length+this.endTag.length,o=[],s=0;null!==(n=r.exec(e));){var c=n.index,u=n[1].length,l=i+(c-s*a),h=new Tn(l,l+u);o.push(h),s+=1}return o}},{key:"getStartIndexOfHighlight",value:function(e,t){var n=new RegExp(this.startTag,"gm"),r=new RegExp(this.endTag,"gm"),i=e.replace(n,"").replace(r,"");return t.indexOf(i)}}]),e}(),Mn=function(){function e(t){Object(h.a)(this,e),this.mergedTranscriptCache="",this.mergedTranscriptLowercasedCache="",this.transcriptEntryRangesCache=[],this.buildIndex(t)}return Object(h.b)(e,[{key:"getTranscriptEntryAt",value:function(e){return this.transcriptEntryRanges.find((function(t){var n=t.range;return n.endIndex>e&&n.startIndex<=e}))}},{key:"buildIndex",value:function(e){var t=0,n=[],r="";e.entries.forEach((function(e){var i=e.displayText,a=new Tn(t,t+i.length),o=new Cn(e,a);n.push(o),r+="".concat(e.rawText," "),t=r.length})),r=r.trim(),this.mergedTranscriptCache=r,this.mergedTranscriptLowercasedCache=r.toLowerCase(),this.transcriptEntryRangesCache=n}},{key:"mergedTranscript",get:function(){return this.mergedTranscriptCache}},{key:"mergedTranscriptLowercased",get:function(){return this.mergedTranscriptLowercasedCache}},{key:"transcriptEntryRanges",get:function(){return this.transcriptEntryRangesCache}}]),e}(),Nn=function e(t){Object(h.a)(this,e),this.text=t.text},Fn=function e(t){Object(h.a)(this,e),this.facetDates=t.facet_dates,this.facetFields=t.facet_fields},Un=function e(t){Object(h.a)(this,e),this.cc=t.cc},qn=function e(t){Object(h.a)(this,e),this.identifier=t.identifier,this.title=t.title,this.text=t.text,this.times=t.times,this.downloads=t.downloads,this.collection=t.collection,this.highlight=new Un(t.highlight),this.description=t.description,this.mediatype=t.mediatype,this.__href__=t.__href__,this["SE-BYPASS"]=t["SE-BYPASS"]},Dn=function e(t){var n=this;Object(h.a)(this,e),this.highlighting={},this.numFound=t.numFound,this.start=t.start,this.docs=t.docs.map((function(e){return new qn(e)})),Object.keys(t.highlighting).forEach((function(e){var r=t.highlighting[e];n.highlighting[e]=new Nn(r)})),this.facetCounts=new Fn(t.facet_counts)},Ln=function e(t){Object(h.a)(this,e),this.success=t.success,this.value=new Dn(t.value)};function Hn(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Vn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var zn=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.itemId=t,this.baseUrl=n,this.searchServicePath=r}var t,n,r,o,s;return t=e,(n=[{key:"searchRequested",value:(o=regeneratorRuntime.mark((function e(t){var n,r,o,s,c,u,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new a.a(window.location.search),r=n.get("scope"),o="".concat(this.baseUrl).concat(this.searchServicePath),(s=new a.a).set("q",t),s.set("identifier",this.itemId),s.set("number_of_fragments",1e3),r&&s.set("scope",r),c="".concat(o,"?").concat(s.toString()),e.next=11,Object(i.a)(c);case 11:return u=e.sent,e.next=14,u.json();case 14:return l=e.sent,h=new Ln(l),e.abrupt("return",new Promise((function(e){return e(h)})));case 17:case"end":return e.stop()}}),e,this)})),s=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){Hn(i,n,r,a,s,"next",e)}function s(e){Hn(i,n,r,a,s,"throw",e)}a(void 0)}))},function(e){return s.apply(this,arguments)})}])&&Vn(t.prototype,n),r&&Vn(t,r),e}();function Wn(e){return(Wn="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 Zn(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function $n(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n <radio-player\n .config=","\n .transcriptConfig=","\n .searchHandler=","\n @searchTermChanged=","\n @playbackPaused=","\n @currentTimeChanged=","\n @timeChangedFromScrub=","\n @transcriptEntrySelected=","\n @canplay=","\n @playbackRateChanged=","\n @volumeChanged=","\n @jumpBackButtonPressed=","\n @jumpForwardButtonPressed=","\n @playPauseButtonPressed=","\n @nextSectionButtonPressed=","\n @prevSectionButtonPressed=","\n @searchCleared=","\n @searchExecuted=","\n @highlightedSearchResultChanged=","\n >\n </radio-player>\n "]);return $n=function(){return e},e}function Qn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jn(e,t,n){return t&&Qn(e.prototype,t),n&&Qn(e,n),e}function Kn(e,t){return(Kn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=er(e);if(t){var i=er(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Gn(this,n)}}function Gn(e,t){return!t||"object"!==Wn(t)&&"function"!=typeof t?Yn(e):t}function Yn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function er(e){return(er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var tr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kn(e,t)}(s,e);var t,n,o=Xn(s);function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=o.call(this)).itemId="",e.currentTime=0,e.searchTerm="",e.baseUrl="https://archive.org",e.searchServicePath="/services/radio-archive/search/service.php",e.analyticsHandler=new l,e.currentTimeQueryParamDebouncer=new c(e.updateCurrentTimeParam,1e3,Yn(e)),e.searchTermQueryParamDebouncer=new c(e.updateSearchQueryParam,1e3,Yn(e)),e.scrubberAnalyticsDebouncer=new c(e.sendUserDraggedScrubbedAnalyticsEvent,1e3,Yn(e)),e.loadMetadataCacheIfAvailable(),e}return Jn(s,null,[{key:"properties",get:function(){return{itemId:{type:String},radioPlayerConfig:{type:Object},transcriptConfig:{type:Object},searchHandler:{type:Object},analyticsHandler:{type:Object},baseUrl:{type:String}}}},{key:"analyticsCategory",get:function(){return"RadioPlayer"}}]),Jn(s,[{key:"loadMetadataCacheIfAvailable",value:function(){var e,t=document.querySelector(".js-ia-metadata");t&&(e=JSON.parse(t.value)),this.metadataCache=e}},{key:"render",value:function(){return Object(r.d)($n(),this.radioPlayerConfig,this.transcriptConfig,this.searchHandler,this.searchTermChanged,this.playbackPaused,this.currentTimeChanged,this.timeChangedFromScrub,this.transcriptEntrySelected,this.canplay,this.playbackRateChanged,this.volumeChanged,this.jumpBackButtonPressed,this.jumpForwardButtonPressed,this.playPauseButtonPressed,this.nextSectionButtonPressed,this.prevSectionButtonPressed,this.searchCleared,this.searchExecuted,this.highlightedSearchResultChanged)}},{key:"updated",value:function(e){e.has("itemId")&&this.loadItemMetadata(),e.has("transcriptConfig")&&this.setupSearchHandler()}},{key:"firstUpdated",value:function(){var e=new a.a(window.location.search),t=e.get("q"),n=e.get("start");t&&this.radioPlayer&&(this.searchTerm=t,this.radioPlayer.searchTerm=t),n&&(this.currentTime=n,this.startPlaybackAt=parseFloat(n))}},{key:"searchTermChanged",value:function(e){var t=e.detail.searchTerm;this.searchTerm=t,this.searchTermQueryParamDebouncer.execute()}},{key:"setupSearchHandler",value:function(){if(this.transcriptConfig){var e=new Mn(this.transcriptConfig);this.searchService=new zn(this.itemId,this.baseUrl,this.searchServicePath),this.searchBackend=new An(this.searchService),this.searchHandler=new Bn(this.searchBackend,e),this.searchTerm&&(this.radioPlayer.searchTerm=this.searchTerm)}}},{key:"canplay",value:function(){this.startPlaybackAt&&this.radioPlayer&&(this.radioPlayer.seekTo(this.startPlaybackAt),this.startPlaybackAt=void 0)}},{key:"currentTimeChanged",value:function(e){this.currentTime=e.detail.currentTime}},{key:"playbackPaused",value:function(){this.currentTimeQueryParamDebouncer.execute()}},{key:"playbackRateChanged",value:function(){this.logEvent("playbackRateChanged")}},{key:"volumeChanged",value:function(){this.logEvent("volumeChanged")}},{key:"playPauseButtonPressed",value:function(){this.logEvent("playPauseButtonPressed")}},{key:"jumpBackButtonPressed",value:function(){this.logEvent("jumpBackButtonPressed")}},{key:"jumpForwardButtonPressed",value:function(){this.logEvent("jumpForwardButtonPressed")}},{key:"nextSectionButtonPressed",value:function(){this.logEvent("nextSectionButtonPressed")}},{key:"prevSectionButtonPressed",value:function(){this.logEvent("prevSectionButtonPressed")}},{key:"searchCleared",value:function(){this.logEvent("searchCleared")}},{key:"highlightedSearchResultChanged",value:function(){this.logEvent("highlightedSearchResultChanged")}},{key:"searchExecuted",value:function(){this.logEvent("searchExecuted")}},{key:"sendUserDraggedScrubbedAnalyticsEvent",value:function(){this.logEvent("userDraggedScrubberBar")}},{key:"timeChangedFromScrub",value:function(e){this.currentTime=e.detail.newTime,this.currentTimeQueryParamDebouncer.execute(),this.scrubberAnalyticsDebouncer.execute()}},{key:"transcriptEntrySelected",value:function(e){this.currentTime=e.detail.newTime,this.currentTimeQueryParamDebouncer.execute(),this.logEvent("transcriptEntrySelected")}},{key:"loadItemMetadata",value:(t=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="",!this.metadataCache){e.next=5;break}t=this.metadataCache,e.next=12;break;case 5:return n="".concat(this.baseUrl,"/metadata/").concat(this.itemId),e.next=8,Object(i.a)(n);case 8:return r=e.sent,e.next=11,r.json();case 11:t=e.sent;case 12:this.handleMetadataResponse(t);case 13:case"end":return e.stop()}}),e,this)})),n=function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(e){Zn(a,r,i,o,s,"next",e)}function s(e){Zn(a,r,i,o,s,"throw",e)}o(void 0)}))},function(){return n.apply(this,arguments)})},{key:"handleMetadataResponse",value:function(e){var t,n=this,r=e,i=r.files,a=r.metadata.collection[0],o=i.find((function(e){return"advanced audio coding"===e.format.toLowerCase()})),s=[i.find((function(e){return"ogg vorbis"===e.format.toLowerCase()})),o,i.find((function(e){return"vbr mp3"===e.format.toLowerCase()}))].filter((function(e){return void 0!==e})),c=s.map((function(e){var t="".concat(n.baseUrl,"/download/").concat(n.itemId,"/").concat(e.name),r="";switch(e.format.toLowerCase()){case"ogg vorbis":r="audio/ogg";break;case"advanced audio coding":r="audio/aac";break;case"vbr mp3":r="audio/mpeg"}return new G(t,r)})),u=r.files.find((function(e){if("png"!==e.format.toLowerCase())return!1;var t=e.original;return s.find((function(e){return e.name===t}))}));u&&(t="".concat(this.baseUrl,"/download/").concat(this.itemId,"/").concat(u.name)),this.radioPlayerConfig=new En(r.metadata.contributor,r.metadata.start_localtime||r.metadata.start_time,"".concat(this.baseUrl,"/services/img/").concat(a),t,c),this.setupBaseTranscript(r)}},{key:"setupBaseTranscript",value:function(e){var t=e.speech_vs_music_asr;if(t){var n=t.map((function(e){return new $(e.id,e.start,e.end,e.text,e.is_music,e.search_match_index)}));this.transcriptConfig=new m(n)}}},{key:"updateSearchQueryParam",value:function(){var e=new a.a(window.location.search);""===this.searchTerm?e.delete("q"):e.set("q","".concat(this.searchTerm)),window.history.replaceState({},"","?".concat(e.toString()))}},{key:"updateCurrentTimeParam",value:function(){var e=new a.a(window.location.search),t=Math.floor(this.currentTime);e.set("start","".concat(t)),window.history.replaceState({},"","?".concat(e.toString()))}},{key:"logEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.analyticsHandler.sendEvent(s.analyticsCategory,e,window.location.pathname,t)}},{key:"radioPlayer",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("radio-player"):null}}]),s}(r.a);customElements.define("radio-player-controller",tr)}});
//# sourceMappingURL=radio-player-controller.min.js.map
// @license-end