index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
presto-player
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/presto-player/dist/blocks.js
!function(){var e,t,r={4697:function(e,t,r){"use strict";var n=r(8247),o=r(6411),a=r(6686),i=r(7563),l=r(211),s=r(8160),c=r(2190),u=function(e,t,r){for(var n=0,a=0;n=a,a=(0,o.fj)(),38===n&&12===a&&(t[r]=1),!(0,o.r)(a);)(0,o.lp)();return(0,o.tP)(e,o.FK)},p=new WeakMap,d=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||p.get(r))&&!n){p.set(e,!0);for(var i=[],l=function(e,t){return(0,o.cE)(function(e,t){var r=-1,n=44;do{switch((0,o.r)(n)){case 0:38===n&&12===(0,o.fj)()&&(t[r]=1),e[r]+=u(o.FK-1,t,r);break;case 2:e[r]+=(0,o.iF)(n);break;case 4:if(44===n){e[++r]=58===(0,o.fj)()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=(0,a.Dp)(n)}}while(n=(0,o.lp)());return e}((0,o.un)(e),t))}(t,i),s=r.props,c=0,d=0;c<l.length;c++)for(var f=0;f<s.length;f++,d++)e.props[d]=i[c]?l[c].replace(/&\f/g,s[f]):s[f]+" "+l[c]}}},f=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function y(e,t){switch((0,a.vp)(e,t)){case 5103:return i.G$+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return i.G$+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return i.G$+e+i.uj+e+i.MS+e+e;case 6828:case 4268:return i.G$+e+i.MS+e+e;case 6165:return i.G$+e+i.MS+"flex-"+e+e;case 5187:return i.G$+e+(0,a.gx)(e,/(\w+).+(:[^]+)/,i.G$+"box-$1$2"+i.MS+"flex-$1$2")+e;case 5443:return i.G$+e+i.MS+"flex-item-"+(0,a.gx)(e,/flex-|-self/,"")+e;case 4675:return i.G$+e+i.MS+"flex-line-pack"+(0,a.gx)(e,/align-content|flex-|-self/,"")+e;case 5548:return i.G$+e+i.MS+(0,a.gx)(e,"shrink","negative")+e;case 5292:return i.G$+e+i.MS+(0,a.gx)(e,"basis","preferred-size")+e;case 6060:return i.G$+"box-"+(0,a.gx)(e,"-grow","")+i.G$+e+i.MS+(0,a.gx)(e,"grow","positive")+e;case 4554:return i.G$+(0,a.gx)(e,/([^-])(transform)/g,"$1"+i.G$+"$2")+e;case 6187:return(0,a.gx)((0,a.gx)((0,a.gx)(e,/(zoom-|grab)/,i.G$+"$1"),/(image-set)/,i.G$+"$1"),e,"")+e;case 5495:case 3959:return(0,a.gx)(e,/(image-set\([^]*)/,i.G$+"$1$`$1");case 4968:return(0,a.gx)((0,a.gx)(e,/(.+:)(flex-)?(.*)/,i.G$+"box-pack:$3"+i.MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+i.G$+e+e;case 4095:case 3583:case 4068:case 2532:return(0,a.gx)(e,/(.+)-inline(.+)/,i.G$+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if((0,a.to)(e)-1-t>6)switch((0,a.uO)(e,t+1)){case 109:if(45!==(0,a.uO)(e,t+4))break;case 102:return(0,a.gx)(e,/(.+:)(.+)-([^]+)/,"$1"+i.G$+"$2-$3$1"+i.uj+(108==(0,a.uO)(e,t+3)?"$3":"$2-$3"))+e;case 115:return~(0,a.Cw)(e,"stretch")?y((0,a.gx)(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==(0,a.uO)(e,t+1))break;case 6444:switch((0,a.uO)(e,(0,a.to)(e)-3-(~(0,a.Cw)(e,"!important")&&10))){case 107:return(0,a.gx)(e,":",":"+i.G$)+e;case 101:return(0,a.gx)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+i.G$+(45===(0,a.uO)(e,14)?"inline-":"")+"box$3$1"+i.G$+"$2$3$1"+i.MS+"$2box$3")+e}break;case 5936:switch((0,a.uO)(e,t+11)){case 114:return i.G$+e+i.MS+(0,a.gx)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return i.G$+e+i.MS+(0,a.gx)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return i.G$+e+i.MS+(0,a.gx)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return i.G$+e+i.MS+e+e}return e}var v=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case i.h5:e.return=y(e.value,e.length);break;case i.lK:return(0,l.q)([(0,o.JG)(e,{value:(0,a.gx)(e.value,"@","@"+i.G$)})],n);case i.Fr:if(e.length)return(0,a.$e)(e.props,(function(t){switch((0,a.EQ)(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,l.q)([(0,o.JG)(e,{props:[(0,a.gx)(t,/:(read-\w+)/,":"+i.uj+"$1")]})],n);case"::placeholder":return(0,l.q)([(0,o.JG)(e,{props:[(0,a.gx)(t,/:(plac\w+)/,":"+i.G$+"input-$1")]}),(0,o.JG)(e,{props:[(0,a.gx)(t,/:(plac\w+)/,":"+i.uj+"$1")]}),(0,o.JG)(e,{props:[(0,a.gx)(t,/:(plac\w+)/,i.MS+"input-$1")]})],n)}return""}))}}];t.Z=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o,a,i=e.stylisPlugins||v,u={},p=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)u[t[r]]=!0;p.push(e)}));var y,h=[d,f],m=[l.P,(0,s.cD)((function(e){y.insert(e)}))],g=(0,s.qR)(h.concat(i,m));a=function(e,t,r,n){var o;y=r,o=e?e+"{"+t.styles+"}":t.styles,(0,l.q)((0,c.MY)(o),g),n&&(b.inserted[t.name]=!0)};var b={key:t,sheet:new n.m({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:u,registered:{},insert:a};return b.sheet.hydrate(p),b}},8247:function(e,t,r){"use strict";r.d(t,{m:function(){return n}});var n=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}()},7453:function(e,t,r){"use strict";r.d(t,{iv:function(){return l.Z},tZ:function(){return s}});r(4578);var n=r(9196),o=(r(3061),r(1299)),a=r(8087),i=r(6660),l=(r(9664),r(3998)),s=function(e,t){var r=arguments;if(null==t||!o.h.call(t,"css"))return n.createElement.apply(void 0,r);var a=r.length,i=new Array(a);i[0]=o.E,i[1]=(0,o.c)(e,t);for(var l=2;l<a;l++)i[l]=r[l];return n.createElement.apply(null,i)},c=(n.Component,function e(t){for(var r=t.length,n=0,o="";n<r;n++){var a=t[n];if(null!=a){var i=void 0;switch(typeof a){case"boolean":break;case"object":if(Array.isArray(a))i=e(a);else for(var l in i="",a)a[l]&&l&&(i&&(i+=" "),i+=l);break;default:i=a}i&&(o&&(o+=" "),o+=i)}}return o});function u(e,t,r){var n=[],o=(0,a.f)(e,n,r);return n.length<2?r:o+t(n)}var p=function(){return null};(0,o.w)((function(e,t){return(0,n.createElement)(o.T.Consumer,null,(function(r){var o=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=(0,i.O)(r,t.registered);return(0,a.M)(t,o,!1),t.key+"-"+o.name},l={css:o,cx:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return u(t.registered,o,c(r))},theme:r},s=e.children(l),d=(0,n.createElement)(p,null);return(0,n.createElement)(n.Fragment,null,d,s)}))}))},1299:function(e,t,r){"use strict";r.d(t,{E:function(){return v},T:function(){return c},c:function(){return d},h:function(){return l},w:function(){return u}});var n=r(9196),o=r(3061),a=r(8087),i=r(6660),l=Object.prototype.hasOwnProperty,s=(0,n.createContext)("undefined"!=typeof HTMLElement?(0,o.Z)():null),c=(0,n.createContext)({}),u=(s.Provider,function(e){var t=function(t,r){return(0,n.createElement)(s.Consumer,null,(function(n){return e(t,n,r)}))};return(0,n.forwardRef)(t)}),p="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",d=function(e,t){var r={};for(var n in t)l.call(t,n)&&(r[n]=t[n]);return r[p]=e,r},f=function(){return null},y=function(e,t,r,o){var s=null===r?t.css:t.css(r);"string"==typeof s&&void 0!==e.registered[s]&&(s=e.registered[s]);var c=t[p],u=[s],d="";"string"==typeof t.className?d=(0,a.f)(e.registered,u,t.className):null!=t.className&&(d=t.className+" ");var y=(0,i.O)(u);(0,a.M)(e,y,"string"==typeof c),d+=e.key+"-"+y.name;var v={};for(var h in t)l.call(t,h)&&"css"!==h&&h!==p&&(v[h]=t[h]);v.ref=o,v.className=d;var m=(0,n.createElement)(c,v),g=(0,n.createElement)(f,null);return(0,n.createElement)(n.Fragment,null,g,m)},v=u((function(e,t,r){return"function"==typeof e.css?(0,n.createElement)(c.Consumer,null,(function(n){return y(t,e,n,r)})):y(t,e,null,r)}))},3061:function(e,t,r){"use strict";var n=r(9664),o=r(8285),a="/*|*/",i=a+"}";function l(e){e&&s.current.insert(e+"}")}var s={current:null},c=function(e,t,r,n,o,c,u,p,d,f){switch(e){case 1:switch(t.charCodeAt(0)){case 64:return s.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===p)return t+a;break;case 3:switch(p){case 102:case 112:return s.current.insert(r[0]+t),"";default:return t+(0===f?a:"")}case-2:t.split(i).forEach(l)}};t.Z=function(e){void 0===e&&(e={});var t,r=e.key||"css";void 0!==e.prefix&&(t={prefix:e.prefix});var a,i=new o.Z(t),l={};a=e.container||document.head;var u,p=document.querySelectorAll("style[data-emotion-"+r+"]");Array.prototype.forEach.call(p,(function(e){e.getAttribute("data-emotion-"+r).split(" ").forEach((function(e){l[e]=!0})),e.parentNode!==a&&a.appendChild(e)})),i.use(e.stylisPlugins)(c),u=function(e,t,r,n){var o=t.name;s.current=r,i(e,t.styles),n&&(d.inserted[o]=!0)};var d={key:r,sheet:new n.m({key:r,container:a,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:l,registered:{},insert:u};return d}},3998:function(e,t,r){"use strict";var n=r(6660);t.Z=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.O)(t)}},2506:function(e,t){"use strict";t.Z=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}},5042:function(e,t){"use strict";t.Z=function(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}},2443:function(e,t,r){"use strict";r.d(t,{E:function(){return v},T:function(){return p},c:function(){return f},h:function(){return s},w:function(){return u}});var n=r(9196),o=r(4697),a=r(7728),i=r(8202),l=r(7278),s={}.hasOwnProperty,c=(0,n.createContext)("undefined"!=typeof HTMLElement?(0,o.Z)({key:"css"}):null);c.Provider;var u=function(e){return(0,n.forwardRef)((function(t,r){var o=(0,n.useContext)(c);return e(t,o,r)}))},p=(0,n.createContext)({}),d="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",f=function(e,t){var r={};for(var n in t)s.call(t,n)&&(r[n]=t[n]);return r[d]=e,r},y=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,a.hC)(t,r,n),(0,l.L)((function(){return(0,a.My)(t,r,n)})),null},v=u((function(e,t,r){var o=e.css;"string"==typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var l=e[d],c=[o],u="";"string"==typeof e.className?u=(0,a.fp)(t.registered,c,e.className):null!=e.className&&(u=e.className+" ");var f=(0,i.O)(c,void 0,(0,n.useContext)(p));u+=t.key+"-"+f.name;var v={};for(var h in e)s.call(e,h)&&"css"!==h&&h!==d&&(v[h]=e[h]);return v.ref=r,v.className=u,(0,n.createElement)(n.Fragment,null,(0,n.createElement)(y,{cache:t,serialized:f,isStringTag:"string"==typeof l}),(0,n.createElement)(l,v))}))},917:function(e,t,r){"use strict";r.d(t,{tZ:function(){return a}});var n=r(9196),o=(r(4697),r(2443)),a=(r(8679),r(8202),r(7278),function(e,t){var r=arguments;if(null==t||!o.h.call(t,"css"))return n.createElement.apply(void 0,r);var a=r.length,i=new Array(a);i[0]=o.E,i[1]=(0,o.c)(e,t);for(var l=2;l<a;l++)i[l]=r[l];return n.createElement.apply(null,i)})},8491:function(e,t){"use strict";t.Z=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}},8202:function(e,t,r){"use strict";r.d(t,{O:function(){return v}});var n=r(8491),o=r(8687),a=r(5042),i=/[A-Z]|^ms/g,l=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},c=function(e){return null!=e&&"boolean"!=typeof e},u=(0,a.Z)((function(e){return s(e)?e:e.replace(i,"-$&").toLowerCase()})),p=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(l,(function(e,t,r){return f={name:t,styles:r,next:f},t}))}return 1===o.Z[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return f={name:r.name,styles:r.styles,next:f},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)f={name:n.name,styles:n.styles,next:f},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=d(e,t,r[o])+";";else for(var a in r){var i=r[a];if("object"!=typeof i)null!=t&&void 0!==t[i]?n+=a+"{"+t[i]+"}":c(i)&&(n+=u(a)+":"+p(a,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=d(e,t,i);switch(a){case"animation":case"animationName":n+=u(a)+":"+l+";";break;default:n+=a+"{"+l+"}"}}else for(var s=0;s<i.length;s++)c(i[s])&&(n+=u(a)+":"+p(a,i[s])+";")}return n}(e,t,r);case"function":if(void 0!==e){var o=f,a=r(e);return f=o,d(e,t,a)}}if(null==t)return r;var i=t[r];return void 0!==i?i:r}var f,y=/label:\s*([^\s;\n{]+)\s*(;|$)/g,v=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,a="";f=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,a+=d(r,t,i)):a+=i[0];for(var l=1;l<e.length;l++)a+=d(r,t,e[l]),o&&(a+=i[l]);y.lastIndex=0;for(var s,c="";null!==(s=y.exec(a));)c+="-"+s[1];return{name:(0,n.Z)(a)+c,styles:a,next:f}}},8687:function(e,t){"use strict";t.Z={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},7728:function(e,t,r){"use strict";function n(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}r.d(t,{My:function(){return a},fp:function(){return n},hC:function(){return o}});var o=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},a=function(e,t,r){o(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}}},6660:function(e,t,r){"use strict";r.d(t,{O:function(){return v}});var n=r(2506),o=r(351),a=r(7056),i=/[A-Z]|^ms/g,l=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},c=function(e){return null!=e&&"boolean"!=typeof e},u=(0,a.Z)((function(e){return s(e)?e:e.replace(i,"-$&").toLowerCase()})),p=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(l,(function(e,t,r){return f={name:t,styles:r,next:f},t}))}return 1===o.Z[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,r,n){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return f={name:r.name,styles:r.styles,next:f},r.name;if(void 0!==r.styles){var o=r.next;if(void 0!==o)for(;void 0!==o;)f={name:o.name,styles:o.styles,next:f},o=o.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=d(e,t,r[o],!1);else for(var a in r){var i=r[a];if("object"!=typeof i)null!=t&&void 0!==t[i]?n+=a+"{"+t[i]+"}":c(i)&&(n+=u(a)+":"+p(a,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=d(e,t,i,!1);switch(a){case"animation":case"animationName":n+=u(a)+":"+l+";";break;default:n+=a+"{"+l+"}"}}else for(var s=0;s<i.length;s++)c(i[s])&&(n+=u(a)+":"+p(a,i[s])+";")}return n}(e,t,r);case"function":if(void 0!==e){var a=f,i=r(e);return f=a,d(e,t,i,n)}}if(null==t)return r;var l=t[r];return void 0===l||n?r:l}var f,y=/label:\s*([^\s;\n{]+)\s*;/g,v=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=!0,a="";f=void 0;var i=e[0];null==i||void 0===i.raw?(o=!1,a+=d(r,t,i,!1)):a+=i[0];for(var l=1;l<e.length;l++)a+=d(r,t,e[l],46===a.charCodeAt(a.length-1)),o&&(a+=i[l]);y.lastIndex=0;for(var s,c="";null!==(s=y.exec(a));)c+="-"+s[1];return{name:(0,n.Z)(a)+c,styles:a,next:f}}},7056:function(e,t){"use strict";t.Z=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}},9664:function(e,t,r){"use strict";r.d(t,{m:function(){return n}});var n=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t,r=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(r,t),this.tags.push(r)}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{var a=105===e.charCodeAt(1)&&64===e.charCodeAt(0);o.insertRule(e,a?0:o.cssRules.length)}catch(e){}}else n.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}()},6774:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}});var n=r(7462),o=r(9196),a=r(5042),i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,l=(0,a.Z)((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),s=r(2443);function c(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var u=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},p=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},d={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},f=/[A-Z]|^ms/g,y=/_EMO_([^_]+?)_([^]*?)_EMO_/g,v=function(e){return 45===e.charCodeAt(1)},h=function(e){return null!=e&&"boolean"!=typeof e},m=(0,a.Z)((function(e){return v(e)?e:e.replace(f,"-$&").toLowerCase()})),g=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(y,(function(e,t,r){return Z={name:t,styles:r,next:Z},t}))}return 1===d[e]||v(e)||"number"!=typeof t||0===t?t:t+"px"};function b(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return Z={name:r.name,styles:r.styles,next:Z},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)Z={name:n.name,styles:n.styles,next:Z},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=b(e,t,r[o])+";";else for(var a in r){var i=r[a];if("object"!=typeof i)null!=t&&void 0!==t[i]?n+=a+"{"+t[i]+"}":h(i)&&(n+=m(a)+":"+g(a,i)+";");else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=b(e,t,i);switch(a){case"animation":case"animationName":n+=m(a)+":"+l+";";break;default:n+=a+"{"+l+"}"}}else for(var s=0;s<i.length;s++)h(i[s])&&(n+=m(a)+":"+g(a,i[s])+";")}return n}(e,t,r);case"function":if(void 0!==e){var o=Z,a=r(e);return Z=o,b(e,t,a)}}if(null==t)return r;var i=t[r];return void 0!==i?i:r}var Z,w=/label:\s*([^\s;\n{]+)\s*(;|$)/g,_=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";Z=void 0;var a=e[0];null==a||void 0===a.raw?(n=!1,o+=b(r,t,a)):o+=a[0];for(var i=1;i<e.length;i++)o+=b(r,t,e[i]),n&&(o+=a[i]);w.lastIndex=0;for(var l,s="";null!==(l=w.exec(o));)s+="-"+l[1];return{name:p(o)+s,styles:o,next:Z}},k=r(7278),x=l,C=function(e){return"theme"!==e},P=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?x:C},O=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},S=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return u(t,r,n),(0,k.L)((function(){return function(e,t,r){u(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,r,n)})),null},E=function e(t,r){var a,i,l=t.__emotion_real===t,u=l&&t.__emotion_base||t;void 0!==r&&(a=r.label,i=r.target);var p=O(t,r,l),d=p||P(u),f=!d("as");return function(){var y=arguments,v=l&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==a&&v.push("label:"+a+";"),null==y[0]||void 0===y[0].raw)v.push.apply(v,y);else{v.push(y[0][0]);for(var h=y.length,m=1;m<h;m++)v.push(y[m],y[0][m])}var g=(0,s.w)((function(e,t,r){var n=f&&e.as||u,a="",l=[],y=e;if(null==e.theme){for(var h in y={},e)y[h]=e[h];y.theme=(0,o.useContext)(s.T)}"string"==typeof e.className?a=c(t.registered,l,e.className):null!=e.className&&(a=e.className+" ");var m=_(v.concat(l),t.registered,y);a+=t.key+"-"+m.name,void 0!==i&&(a+=" "+i);var g=f&&void 0===p?P(n):d,b={};for(var Z in e)f&&"as"===Z||g(Z)&&(b[Z]=e[Z]);return b.className=a,b.ref=r,(0,o.createElement)(o.Fragment,null,(0,o.createElement)(S,{cache:t,serialized:m,isStringTag:"string"==typeof n}),(0,o.createElement)(n,b))}));return g.displayName=void 0!==a?a:"Styled("+("string"==typeof u?u:u.displayName||u.name||"Component")+")",g.defaultProps=t.defaultProps,g.__emotion_real=g,g.__emotion_base=u,g.__emotion_styles=v,g.__emotion_forwardProp=p,Object.defineProperty(g,"toString",{value:function(){return"."+i}}),g.withComponent=function(t,o){return e(t,(0,n.Z)({},r,o,{shouldForwardProp:O(g,o,!0)})).apply(void 0,v)},g}}},8285:function(e,t){"use strict";t.Z=function(e){function t(e,n,s,c,d){for(var f,y,v,h,Z,_=0,k=0,x=0,C=0,P=0,T=0,j=v=f=0,I=0,L=0,B=0,D=0,M=s.length,F=M-1,V="",U="",z="",G="";I<M;){if(y=s.charCodeAt(I),I===F&&0!==k+C+x+_&&(0!==k&&(y=47===k?10:47),C=x=_=0,M++,F++),0===k+C+x+_){if(I===F&&(0<L&&(V=V.replace(p,"")),0<V.trim().length)){switch(y){case 32:case 9:case 59:case 13:case 10:break;default:V+=s.charAt(I)}y=59}switch(y){case 123:for(f=(V=V.trim()).charCodeAt(0),v=1,D=++I;I<M;){switch(y=s.charCodeAt(I)){case 123:v++;break;case 125:v--;break;case 47:switch(y=s.charCodeAt(I+1)){case 42:case 47:e:{for(j=I+1;j<F;++j)switch(s.charCodeAt(j)){case 47:if(42===y&&42===s.charCodeAt(j-1)&&I+2!==j){I=j+1;break e}break;case 10:if(47===y){I=j+1;break e}}I=j}}break;case 91:y++;case 40:y++;case 34:case 39:for(;I++<F&&s.charCodeAt(I)!==y;);}if(0===v)break;I++}if(v=s.substring(D,I),0===f&&(f=(V=V.replace(u,"").trim()).charCodeAt(0)),64===f){switch(0<L&&(V=V.replace(p,"")),y=V.charCodeAt(1)){case 100:case 109:case 115:case 45:L=n;break;default:L=N}if(D=(v=t(n,L,v,y,d+1)).length,0<A&&(Z=l(3,v,L=r(N,V,B),n,S,O,D,y,d,c),V=L.join(""),void 0!==Z&&0===(D=(v=Z.trim()).length)&&(y=0,v="")),0<D)switch(y){case 115:V=V.replace(w,i);case 100:case 109:case 45:v=V+"{"+v+"}";break;case 107:v=(V=V.replace(m,"$1 $2"))+"{"+v+"}",v=1===$||2===$&&a("@"+v,3)?"@-webkit-"+v+"@"+v:"@"+v;break;default:v=V+v,112===c&&(U+=v,v="")}else v=""}else v=t(n,r(n,V,B),v,c,d+1);z+=v,v=B=L=j=f=0,V="",y=s.charCodeAt(++I);break;case 125:case 59:if(1<(D=(V=(0<L?V.replace(p,""):V).trim()).length))switch(0===j&&(f=V.charCodeAt(0),45===f||96<f&&123>f)&&(D=(V=V.replace(" ",":")).length),0<A&&void 0!==(Z=l(1,V,n,e,S,O,U.length,c,d,c))&&0===(D=(V=Z.trim()).length)&&(V="\0\0"),f=V.charCodeAt(0),y=V.charCodeAt(1),f){case 0:break;case 64:if(105===y||99===y){G+=V+s.charAt(I);break}default:58!==V.charCodeAt(D-1)&&(U+=o(V,f,y,V.charCodeAt(2)))}B=L=j=f=0,V="",y=s.charCodeAt(++I)}}switch(y){case 13:case 10:47===k?k=0:0===1+f&&107!==c&&0<V.length&&(L=1,V+="\0"),0<A*R&&l(0,V,n,e,S,O,U.length,c,d,c),O=1,S++;break;case 59:case 125:if(0===k+C+x+_){O++;break}default:switch(O++,h=s.charAt(I),y){case 9:case 32:if(0===C+_+k)switch(P){case 44:case 58:case 9:case 32:h="";break;default:32!==y&&(h=" ")}break;case 0:h="\\0";break;case 12:h="\\f";break;case 11:h="\\v";break;case 38:0===C+k+_&&(L=B=1,h="\f"+h);break;case 108:if(0===C+k+_+E&&0<j)switch(I-j){case 2:112===P&&58===s.charCodeAt(I-3)&&(E=P);case 8:111===T&&(E=T)}break;case 58:0===C+k+_&&(j=I);break;case 44:0===k+x+C+_&&(L=1,h+="\r");break;case 34:case 39:0===k&&(C=C===y?0:0===C?y:C);break;case 91:0===C+k+x&&_++;break;case 93:0===C+k+x&&_--;break;case 41:0===C+k+_&&x--;break;case 40:0===C+k+_&&(0===f&&(2*P+3*T==533||(f=1)),x++);break;case 64:0===k+x+C+_+j+v&&(v=1);break;case 42:case 47:if(!(0<C+_+x))switch(k){case 0:switch(2*y+3*s.charCodeAt(I+1)){case 235:k=47;break;case 220:D=I,k=42}break;case 42:47===y&&42===P&&D+2!==I&&(33===s.charCodeAt(D+2)&&(U+=s.substring(D,I+1)),h="",k=0)}}0===k&&(V+=h)}T=P,P=y,I++}if(0<(D=U.length)){if(L=n,0<A&&void 0!==(Z=l(2,U,L,e,S,O,D,c,d,c))&&0===(U=Z).length)return G+U+z;if(U=L.join(",")+"{"+U+"}",0!=$*E){switch(2!==$||a(U,2)||(E=0),E){case 111:U=U.replace(b,":-moz-$1")+U;break;case 112:U=U.replace(g,"::-webkit-input-$1")+U.replace(g,"::-moz-$1")+U.replace(g,":-ms-input-$1")+U}E=0}}return G+U+z}function r(e,t,r){var o=t.trim().split(v);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var l=0;for(e=0===i?"":e[0]+" ";l<a;++l)t[l]=n(e,t[l],r).trim();break;default:var s=l=0;for(t=[];l<a;++l)for(var c=0;c<i;++c)t[s++]=n(e[c]+" ",o[l],r).trim()}return t}function n(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(h,"$1"+e.trim());case 58:return e.trim()+t.replace(h,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(h,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function o(e,t,r,n){var i=e+";",l=2*t+3*r+4*n;if(944===l){e=i.indexOf(":",9)+1;var s=i.substring(e,i.length-1).trim();return s=i.substring(0,e).trim()+s+";",1===$||2===$&&a(s,1)?"-webkit-"+s+s:s}if(0===$||2===$&&!a(i,1))return i;switch(l){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(P,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(s=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+s+i;case 1005:return f.test(i)?i.replace(d,":-webkit-")+i.replace(d,":-moz-")+i:i;case 1e3:switch(t=(s=i.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=i.replace(Z,"tb");break;case 232:s=i.replace(Z,"tb-rl");break;case 220:s=i.replace(Z,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+s+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,l=(s=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:i=i.replace(s,"-webkit-"+s)+";"+i;break;case 207:case 102:i=i.replace(s,"-webkit-"+(102<l?"inline-":"")+"box")+";"+i.replace(s,"-webkit-"+s)+";"+i.replace(s,"-ms-"+s+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return s=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+s+"-ms-flex-"+s+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(k,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(k,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===C.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?o(e.replace("stretch","fill-available"),t,r,n).replace(":fill-available",":stretch"):i.replace(s,"-webkit-"+s)+i.replace(s,"-moz-"+s.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===r+n&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(y,"$1-webkit-$2")+i}return i}function a(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),j(2!==t?n:n.replace(x,"$1"),r,t)}function i(e,t){var r=o(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(_," or ($1)").substring(4):"("+t+")"}function l(e,t,r,n,o,a,i,l,s,u){for(var p,d=0,f=t;d<A;++d)switch(p=T[d].call(c,e,f,r,n,o,a,i,l,s,u)){case void 0:case!1:case!0:case null:break;default:f=p}if(f!==t)return f}function s(e){return void 0!==(e=e.prefix)&&(j=null,e?"function"!=typeof e?$=1:($=2,j=e):$=0),s}function c(e,r){var n=e;if(33>n.charCodeAt(0)&&(n=n.trim()),n=[n],0<A){var o=l(-1,r,n,n,S,O,0,0,0,0);void 0!==o&&"string"==typeof o&&(r=o)}var a=t(N,n,r,0,0);return 0<A&&void 0!==(o=l(-2,a,n,n,S,O,a.length,0,0,0))&&(a=o),E=0,O=S=1,a}var u=/^\0+/g,p=/[\0\r\f]/g,d=/: */g,f=/zoo|gra/,y=/([,: ])(transform)/g,v=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,m=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,b=/:(read-only)/g,Z=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,_=/([\s\S]*?);/g,k=/-self|flex-/g,x=/[^]*?(:[rp][el]a[\w-]+)[^]*/,C=/stretch|:\s*\w+\-(?:conte|avail)/,P=/([^-])(image-set\()/,O=1,S=1,E=0,$=1,N=[],T=[],A=0,j=null,R=0;return c.use=function e(t){switch(t){case void 0:case null:A=T.length=0;break;default:if("function"==typeof t)T[A++]=t;else if("object"==typeof t)for(var r=0,n=t.length;r<n;++r)e(t[r]);else R=0|!!t}return e},c.set=s,void 0!==e&&s(e),c}},351:function(e,t){"use strict";t.Z={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},7278:function(e,t,r){"use strict";r.d(t,{L:function(){return a}});var n=r(9196),o=!!n.useInsertionEffect&&n.useInsertionEffect,a=o||function(e){return e()};o||n.useLayoutEffect},8087:function(e,t,r){"use strict";function n(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]):n+=r+" "})),n}r.d(t,{M:function(){return o},f:function(){return n}});var o=function(e,t,r){var n=e.key+"-"+t.name;if(!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var o=t;do{e.insert("."+n,o,e.sheet,!0),o=o.next}while(void 0!==o)}}},1984:function(e,t,r){"use strict";var n=r(9307);t.Z=(0,n.forwardRef)((function({icon:e,size:t=24,...r},o){return(0,n.cloneElement)(e,{width:t,height:t,...r,ref:o})}))},8184:function(e,t,r){"use strict";var n=r(444),o=r(5893);const a=(0,o.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(n.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});t.Z=a},4688:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(444),o=r(5893),a=(0,o.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(n.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})})},6732:function(e,t,r){"use strict";var n=r(444),o=r(5893);const a=(0,o.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(n.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});t.Z=a},376:function(e,t,r){"use strict";var n=r(444),o=r(5893);const a=(0,o.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(n.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})});t.Z=a},4831:function(e,t,r){"use strict";r.d(t,{Gc:function(){return s},T9:function(){return l},UP:function(){return o},Zs:function(){return c},pv:function(){return i},zi:function(){return a}});var n=r(826);(0,r(3625).q4)();var o=(0,n.o)("presto-cta-overlay-ui"),a=(0,n.o)("presto-email-overlay-ui"),i=(0,n.o)("presto-player"),l=(0,n.o)("presto-playlist-item"),s=(0,n.o)("presto-playlist-ui"),c=(0,n.o)("presto-search-bar-ui")},826:function(e,t,r){"use strict";r.d(t,{o:function(){return y}});var n=r(1002),o=r(5671),a=r(3144),i=r(136),l=r(2963),s=r(1120),c=r(9196),u=r.n(c),p=r(2584),d=r(2867),f=r(9905);var y=function(e,t,r,y){void 0!==y&&y();var v=(0,p.o)(e),h=function(t){(0,i.Z)(m,t);var u,y,h=(u=m,y=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(u);if(y){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,l.Z)(this,e)});function m(e){var t;return(0,o.Z)(this,m),(t=h.call(this,e)).setComponentElRef=function(e){t.componentEl=e},t}return(0,a.Z)(m,[{key:"componentDidMount",value:function(){this.componentDidUpdate(this.props)}},{key:"componentDidUpdate",value:function(e){(0,d.D6)(this.componentEl,this.props,e)}},{key:"render",value:function(){var t=this.props,o=t.children,a=t.forwardedRef,i=t.style,l=(t.className,t.ref,function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(t,["children","forwardedRef","style","className","ref"])),s=Object.keys(l).reduce((function(e,t){var r=l[t];if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var o=t.substring(2).toLowerCase();"undefined"!=typeof document&&(0,d.tt)(o)&&(e[t]=r)}else{var a=(0,n.Z)(r);"string"!==a&&"boolean"!==a&&"number"!==a||(e[(0,p.n)(t)]=r)}return e}),{});r&&(s=r(this.props,s));var u=Object.assign(Object.assign({},s),{ref:(0,f.lq)(a,this.setComponentElRef),style:i});return(0,c.createElement)(e,u,o)}}],[{key:"displayName",get:function(){return v}}]),m}(u().Component);return t&&(h.contextType=t),(0,f.rH)(h,v)}},2867:function(e,t,r){"use strict";r.d(t,{D6:function(){return a},tt:function(){return l}});var n=r(1002),o=r(2584),a=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e instanceof Element){var a=i(e.classList,t,r);""!==a&&(e.className=a),Object.keys(t).forEach((function(r){if("children"!==r&&"style"!==r&&"ref"!==r&&"class"!==r&&"className"!==r&&"forwardedRef"!==r)if(0===r.indexOf("on")&&r[2]===r[2].toUpperCase()){var a=r.substring(2),i=a[0].toLowerCase()+a.substring(1);l(i)||s(e,i,t[r])}else e[r]=t[r],"string"===(0,n.Z)(t[r])&&e.setAttribute((0,o.n)(r),t[r])}))}},i=function(e,t,r){var n=t.className||t.class,o=r.className||r.class,a=c(e),i=c(n?n.split(" "):[]),l=c(o?o.split(" "):[]),s=[];return a.forEach((function(e){i.has(e)?(s.push(e),i.delete(e)):l.has(e)||s.push(e)})),i.forEach((function(e){return s.push(e)})),s.join(" ")},l=function(e){if("undefined"==typeof document)return!0;var t="on"+function(e){return"doubleclick"===e?"dblclick":e}(e),r=t in document;if(!r){var n=document.createElement("div");n.setAttribute(t,"return;"),r="function"==typeof n[t]}return r},s=function(e,t,r){var n=e.__events||(e.__events={}),o=n[t];o&&e.removeEventListener(t,o),e.addEventListener(t,n[t]=function(e){r&&r.call(this,e)})},c=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t}},2584:function(e,t,r){"use strict";r.d(t,{n:function(){return o},o:function(){return n}});var n=function(e){return e.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join("")},o=function(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())}))}},9905:function(e,t,r){"use strict";r.d(t,{lq:function(){return i},rH:function(){return l}});var n=r(9196),o=r.n(n),a=function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)},i=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){t.forEach((function(t){a(t,e)}))}},l=function(e,t){var r=function(t,r){return o().createElement(e,Object.assign({},t,{forwardedRef:r}))};return r.displayName=t,o().forwardRef(r)}},2853:function(e,t,r){"use strict";r.d(t,{g:function(){return n}});var n=function(){}},1368:function(e,t,r){"use strict";r.d(t,{H:function(){return R},b:function(){return Ne},c:function(){return F},g:function(){return M},h:function(){return A},r:function(){return Be}});var n=r(5671),o=r(3144),a=r(7326),i=r(136),l=r(2963),s=r(1120),c=r(2407),u=r(5861),p=r(3324),d=r(2982),f=r(1002),y=r(1284),v=r.n(y);function h(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,l.Z)(this,r)}}function m(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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,i=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw a}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b,Z,w,_=!1,k=!1,x=!1,C=!1,P=!1,O="{visibility:hidden}.hydrated{visibility:inherit}",S="slot-fb{display:contents}slot-fb[hidden]{display:none}",E="http://www.w3.org/1999/xlink",$={},N=function(e){return"object"===(e=(0,f.Z)(e))||"function"===e};function T(e){var t,r,n;return null!==(n=null===(r=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===r?void 0:r.getAttribute("content"))&&void 0!==n?n:void 0}var A=function(e,t){for(var r=null,n=null,o=null,a=!1,i=!1,l=[],s=function t(n){for(var o=0;o<n.length;o++)r=n[o],Array.isArray(r)?t(r):null!=r&&"boolean"!=typeof r&&((a="function"!=typeof e&&!N(r))&&(r=String(r)),a&&i?l[l.length-1].$text$+=r:l.push(a?j(null,r):r),i=a)},c=arguments.length,u=new Array(c>2?c-2:0),p=2;p<c;p++)u[p-2]=arguments[p];if(s(u),t){t.key&&(n=t.key),t.name&&(o=t.name);var d=t.className||t.class;d&&(t.class="object"!==(0,f.Z)(d)?d:Object.keys(d).filter((function(e){return d[e]})).join(" "))}if("function"==typeof e)return e(null===t?{}:t,l,L);var y=j(e,null);return y.$attrs$=t,l.length>0&&(y.$children$=l),y.$key$=n,y.$name$=o,y},j=function(e,t){return{$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null}},R={},I=function(e){return e&&e.$tag$===R},L={forEach:function(e,t){return e.map(B).forEach(t)},map:function(e,t){return e.map(B).map(t).map(D)}},B=function(e){return{vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}},D=function(e){if("function"==typeof e.vtag){var t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),A.apply(void 0,[e.vtag,t].concat((0,d.Z)(e.vchildren||[])))}var r=j(e.vtag,e.vtext);return r.$attrs$=e.vattrs,r.$children$=e.vchildren,r.$key$=e.vkey,r.$name$=e.vname,r},M=function(e){return Le(e).$hostElement$},F=function(e,t,r){var n=M(e);return{emit:function(e){return V(n,t,{bubbles:!!(4&r),composed:!!(2&r),cancelable:!!(1&r),detail:e})}}},V=function(e,t,r){var n=We.ce(t,r);return e.dispatchEvent(n),n},U=new WeakMap,z=function(e,t,r){var n=ze.get(e);Ye&&r?"string"==typeof(n=n||new CSSStyleSheet)?n=t:n.replaceSync(t):n=t,ze.set(e,n)},G=function(e){var t=e.$cmpMeta$,r=e.$hostElement$,n=t.$flags$,o=(t.$tagName$,function(){}),a=function(e,t,r){var n,o=H(t),a=ze.get(o);if(e=11===e.nodeType?e:He,a)if("string"==typeof a){e=e.head||e;var i,l=U.get(e);if(l||U.set(e,l=new Set),!l.has(o)){(i=He.createElement("style")).innerHTML=a;var s=null!==(n=We.$nonce$)&&void 0!==n?n:T(He);null!=s&&i.setAttribute("nonce",s),e.insertBefore(i,e.querySelector("link")),4&t.$flags$&&(i.innerHTML+=S),l&&l.add(o)}}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[].concat((0,d.Z)(e.adoptedStyleSheets),[a]));return o}(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);10&n&&(r["s-sc"]=a,r.classList.add(a+"-h")),o()},H=function(e,t){return"sc-"+e.$tagName$},W=function(e,t,r,n,o,a){if(r!==n){var i=Me(e,t),l=t.toLowerCase();if("class"===t){var s=e.classList,c=Y(r),u=Y(n);s.remove.apply(s,(0,d.Z)(c.filter((function(e){return e&&!u.includes(e)})))),s.add.apply(s,(0,d.Z)(u.filter((function(e){return e&&!c.includes(e)}))))}else if("style"===t){for(var p in r)n&&null!=n[p]||(p.includes("-")?e.style.removeProperty(p):e.style[p]="");for(var f in n)r&&n[f]===r[f]||(f.includes("-")?e.style.setProperty(f,n[f]):e.style[f]=n[f])}else if("key"===t);else if("ref"===t)n&&n(e);else if(i||"o"!==t[0]||"n"!==t[1]){var y=N(n);if((i||y&&null!==n)&&!o)try{if(e.tagName.includes("-"))e[t]=n;else{var v=null==n?"":n;"list"===t?i=!1:null!=r&&e[t]==v||(e[t]=v)}}catch(e){}var h=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(t=l,h=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(t)||(h?e.removeAttributeNS(E,t):e.removeAttribute(t)):(!i||4&a||o)&&!y&&(n=!0===n?"":n,h?e.setAttributeNS(E,t,n):e.setAttribute(t,n))}else if(t="-"===t[2]?t.slice(3):Me(Ge,l)?l.slice(2):l[2]+t.slice(3),r||n){var m=t.endsWith(X);t=t.replace(K,""),r&&We.rel(e,t,r,m),n&&We.ael(e,t,n,m)}}},q=/\s/,Y=function(e){return e?e.split(q):[]},X="Capture",K=new RegExp(X+"$"),Q=function(e,t,r,n){var o,a=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||$,l=t.$attrs$||$,s=m(J(Object.keys(i)));try{for(s.s();!(o=s.n()).done;)(n=o.value)in l||W(a,n,i[n],void 0,r,t.$flags$)}catch(e){s.e(e)}finally{s.f()}var c,u=m(J(Object.keys(l)));try{for(u.s();!(c=u.n()).done;)n=c.value,W(a,n,i[n],l[n],r,t.$flags$)}catch(e){u.e(e)}finally{u.f()}};function J(e){return e.includes("ref")?[].concat((0,d.Z)(e.filter((function(e){return"ref"!==e}))),["ref"]):e}var ee=function e(t,r,n,o){var a,i,l,s,c=r.$children$[n],u=0;if(_||(x=!0,"slot"===c.$tag$&&(b&&o.classList.add(b+"-s"),c.$flags$|=c.$children$?2:1)),null!==c.$text$)i=c.$elm$=He.createTextNode(c.$text$);else if(1&c.$flags$)i=c.$elm$=He.createTextNode("");else{if(C||(C="svg"===c.$tag$),i=c.$elm$=He.createElementNS(C?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&c.$flags$?"slot-fb":c.$tag$),C&&"foreignObject"===c.$tag$&&(C=!1),Q(null,c,C),null!=b&&i["s-si"]!==b&&i.classList.add(i["s-si"]=b),c.$children$)for(u=0;u<c.$children$.length;++u)(l=e(t,c,u,i))&&i.appendChild(l);"svg"===c.$tag$?C=!1:"foreignObject"===i.tagName&&(C=!0)}return i["s-hn"]=w,3&c.$flags$&&(i["s-sr"]=!0,i["s-cr"]=Z,i["s-sn"]=c.$name$||"",i["s-rf"]=null===(a=c.$attrs$)||void 0===a?void 0:a.ref,(s=t&&t.$children$&&t.$children$[n])&&s.$tag$===c.$tag$&&t.$elm$&&te(t.$elm$,!1)),i},te=function e(t,r){We.$flags$|=1;var n=Array.from(t.childNodes);t["s-sr"];for(var o=n.length-1;o>=0;o--){var a=n[o];a["s-hn"]!==w&&a["s-ol"]&&(le(a).insertBefore(a,ie(a)),a["s-ol"].remove(),a["s-ol"]=void 0,a["s-sh"]=void 0,x=!0),r&&e(a,r)}We.$flags$&=-2},re=function(e,t,r,n,o,a){var i,l=e["s-cr"]&&e["s-cr"].parentNode||e;for(l.shadowRoot&&l.tagName===w&&(l=l.shadowRoot);o<=a;++o)n[o]&&(i=ee(null,r,o,e))&&(n[o].$elm$=i,l.insertBefore(i,ie(t)))},ne=function(e,t,r){for(var n=t;n<=r;++n){var o=e[n];if(o){var a=o.$elm$;fe(o),a&&(k=!0,a["s-ol"]?a["s-ol"].remove():te(a,!0),a.remove())}}},oe=function(e,t,r,n){for(var o,a,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=0,s=0,c=0,u=0,p=t.length-1,d=t[0],f=t[p],y=n.length-1,v=n[0],h=n[y];l<=p&&s<=y;)if(null==d)d=t[++l];else if(null==f)f=t[--p];else if(null==v)v=n[++s];else if(null==h)h=n[--y];else if(ae(d,v,i))se(d,v,i),d=t[++l],v=n[++s];else if(ae(f,h,i))se(f,h,i),f=t[--p],h=n[--y];else if(ae(d,h,i))"slot"!==d.$tag$&&"slot"!==h.$tag$||te(d.$elm$.parentNode,!1),se(d,h,i),e.insertBefore(d.$elm$,f.$elm$.nextSibling),d=t[++l],h=n[--y];else if(ae(f,v,i))"slot"!==d.$tag$&&"slot"!==h.$tag$||te(f.$elm$.parentNode,!1),se(f,v,i),e.insertBefore(f.$elm$,d.$elm$),f=t[--p],v=n[++s];else{for(c=-1,u=l;u<=p;++u)if(t[u]&&null!==t[u].$key$&&t[u].$key$===v.$key$){c=u;break}c>=0?((a=t[c]).$tag$!==v.$tag$?o=ee(t&&t[s],r,c,e):(se(a,v,i),t[c]=void 0,o=a.$elm$),v=n[++s]):(o=ee(t&&t[s],r,s,e),v=n[++s]),o&&le(d.$elm$).insertBefore(o,ie(d.$elm$))}l>p?re(e,null==n[y+1]?null:n[y+1].$elm$,r,n,s,y):s>y&&ne(t,l,p)},ae=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.$tag$===t.$tag$&&("slot"===e.$tag$?e.$name$===t.$name$:!!r||e.$key$===t.$key$)},ie=function(e){return e&&e["s-ol"]||e},le=function(e){return(e["s-ol"]?e["s-ol"]:e).parentNode},se=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=t.$elm$=e.$elm$,a=e.$children$,i=t.$children$,l=t.$tag$,s=t.$text$;null===s?(C="svg"===l||"foreignObject"!==l&&C,("slot"!==l||_)&&Q(e,t,C),null!==a&&null!==i?oe(o,a,t,i,n):null!==i?(null!==e.$text$&&(o.textContent=""),re(o,null,t,i,0,i.length-1)):null!==a&&ne(a,0,a.length-1),C&&"svg"===l&&(C=!1)):(r=o["s-cr"])?r.parentNode.textContent=s:e.$text$!==s&&(o.data=s)},ce=function e(t){var r,n=t.childNodes,o=m(n);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(1===a.nodeType){if(a["s-sr"]){var i=a["s-sn"];a.hidden=!1;var l,s=m(n);try{for(s.s();!(l=s.n()).done;){var c=l.value;if(c!==a)if(c["s-hn"]!==a["s-hn"]||""!==i){if(1===c.nodeType&&(i===c.getAttribute("slot")||i===c["s-sn"])){a.hidden=!0;break}}else if(1===c.nodeType||3===c.nodeType&&""!==c.textContent.trim()){a.hidden=!0;break}}}catch(e){s.e(e)}finally{s.f()}}e(a)}}}catch(e){o.e(e)}finally{o.f()}},ue=[],pe=function e(t){var r,n,o,a,i=m(t.childNodes);try{for(i.s();!(a=i.n()).done;){var l=a.value;if(l["s-sr"]&&(r=l["s-cr"])&&r.parentNode){n=r.parentNode.childNodes;var s=l["s-sn"],c=function(){if(!(r=n[o])["s-cn"]&&!r["s-nr"]&&r["s-hn"]!==l["s-hn"])if(de(r,s)){var e=ue.find((function(e){return e.$nodeToRelocate$===r}));k=!0,r["s-sn"]=r["s-sn"]||s,e?(e.$nodeToRelocate$["s-sh"]=l["s-hn"],e.$slotRefNode$=l):(r["s-sh"]=l["s-hn"],ue.push({$slotRefNode$:l,$nodeToRelocate$:r})),r["s-sr"]&&ue.map((function(t){de(t.$nodeToRelocate$,r["s-sn"])&&(e=ue.find((function(e){return e.$nodeToRelocate$===r})))&&!t.$slotRefNode$&&(t.$slotRefNode$=e.$slotRefNode$)}))}else ue.some((function(e){return e.$nodeToRelocate$===r}))||ue.push({$nodeToRelocate$:r})};for(o=n.length-1;o>=0;o--)c()}1===l.nodeType&&e(l)}}catch(e){i.e(e)}finally{i.f()}},de=function(e,t){return 1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t},fe=function e(t){t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(e)},ye=function(e,t){t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise((function(t){return e.$onRenderResolve$=t})))},ve=function(e,t){if(e.$flags$|=16,!(4&e.$flags$))return ye(e,e.$ancestorComponent$),rt((function(){return he(e,t)}));e.$flags$|=512},he=function(e,t){var r,n=(e.$cmpMeta$.$tagName$,function(){}),o=e.$lazyInstance$;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map((function(e){var t=(0,p.Z)(e,2),r=t[0],n=t[1];return ke(o,r,n)})),e.$queuedListeners$=void 0),r=ke(o,"componentWillLoad")),n(),me(r,(function(){return be(e,o,t)}))},me=function(e,t){return ge(e)?e.then(t):t()},ge=function(e){return e instanceof Promise||e&&e.then&&"function"==typeof e.then},be=function(){var e=(0,u.Z)(v().mark((function e(t,r,n){var o,a,i,l,s;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=t.$hostElement$,t.$cmpMeta$.$tagName$,function(){},i=a["s-rc"],n&&G(t),t.$cmpMeta$.$tagName$,function(){},Ze(t,r,a,n),i&&(i.map((function(e){return e()})),a["s-rc"]=void 0),l=null!==(o=a["s-p"])&&void 0!==o?o:[],s=function(){return we(t)},0===l.length?s():(Promise.all(l).then(s),t.$flags$|=4,l.length=0);case 12:case"end":return e.stop()}}),e)})));return function(_x,t,r){return e.apply(this,arguments)}}(),Ze=function(e,t,r,n){try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,function(e,t){var r,n,o,a,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=e.$hostElement$,s=e.$cmpMeta$,c=e.$vnode$||j(null,null),u=I(t)?t:A(null,null,t);if(w=l.tagName,s.$attrsToReflect$&&(u.$attrs$=u.$attrs$||{},s.$attrsToReflect$.map((function(e){var t=(0,p.Z)(e,2),r=t[0],n=t[1];return u.$attrs$[n]=l[r]}))),i&&u.$attrs$)for(var d=0,f=Object.keys(u.$attrs$);d<f.length;d++){var y=f[d];l.hasAttribute(y)&&!["key","ref","style","class"].includes(y)&&(u.$attrs$[y]=l[y])}if(u.$tag$=null,u.$flags$|=4,e.$vnode$=u,u.$elm$=c.$elm$=l.shadowRoot||l,b=l["s-sc"],_=0!=(1&s.$flags$),Z=l["s-cr"],k=!1,se(c,u,i),We.$flags$|=1,x){pe(u.$elm$);for(var v=0,h=ue;v<h.length;v++){var m=h[v].$nodeToRelocate$;if(!m["s-ol"]){var g=He.createTextNode("");g["s-nr"]=m,m.parentNode.insertBefore(m["s-ol"]=g,m)}}for(var C=0,P=ue;C<P.length;C++){var O=P[C],S=O.$nodeToRelocate$,E=O.$slotRefNode$;if(E){for(var $=E.parentNode,N=E.nextSibling,T=null===(r=S["s-ol"])||void 0===r?void 0:r.previousSibling;T;){var R=null!==(n=T["s-nr"])&&void 0!==n?n:null;if(R&&R["s-sn"]===S["s-sn"]&&$===R.parentNode){for(R=R.nextSibling;R===S||(null==R?void 0:R["s-sr"]);)R=null==R?void 0:R.nextSibling;if(!R||!R["s-nr"]){N=R;break}}T=T.previousSibling}(!N&&$!==S.parentNode||S.nextSibling!==N)&&S!==N&&(!S["s-hn"]&&S["s-ol"]&&(S["s-hn"]=S["s-ol"].parentNode.nodeName),$.insertBefore(S,N),1===S.nodeType&&(S.hidden=null!==(o=S["s-ih"])&&void 0!==o&&o)),S&&"function"==typeof E["s-rf"]&&E["s-rf"](S)}else 1===S.nodeType&&(i&&(S["s-ih"]=null!==(a=S.hidden)&&void 0!==a&&a),S.hidden=!0)}}k&&ce(u.$elm$),We.$flags$&=-2,ue.length=0,Z=void 0}(e,t,n)}catch(t){Fe(t,e.$hostElement$)}return null},we=function(e){e.$cmpMeta$.$tagName$;var t=e.$hostElement$,r=e.$lazyInstance$,n=e.$ancestorComponent$;ke(r,"componentDidRender"),64&e.$flags$||(e.$flags$|=64,xe(t),ke(r,"componentDidLoad"),e.$onReadyResolve$(t),n||_e()),e.$onInstanceResolve$(t),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&tt((function(){return ve(e,!1)})),e.$flags$&=-517},_e=function(e){xe(He.documentElement),tt((function(){return V(Ge,"appload",{detail:{namespace:"web-components"}})}))},ke=function(e,t,r){if(e&&e[t])try{return e[t](r)}catch(e){Fe(e)}},xe=function(e){return e.classList.add("hydrated")},Ce=function(e,t,r){var n,o=e.prototype;if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);var a=Object.entries(t.$members$);if(a.map((function(e){var n=(0,p.Z)(e,2),a=n[0],i=(0,p.Z)(n[1],1)[0];31&i||2&r&&32&i?Object.defineProperty(o,a,{get:function(){return e=a,Le(this).$instanceValues$.get(e);var e},set:function(e){!function(e,t,r,n){var o,a,i=Le(e),l=i.$hostElement$,s=i.$instanceValues$.get(t),c=i.$flags$,u=i.$lazyInstance$;o=r,a=n.$members$[t][0],r=null==o||N(o)?o:4&a?"false"!==o&&(""===o||!!o):2&a?parseFloat(o):1&a?String(o):o;var p=Number.isNaN(s)&&Number.isNaN(r);if((!(8&c)||void 0===s)&&r!==s&&!p&&(i.$instanceValues$.set(t,r),u)){if(n.$watchers$&&128&c){var d=n.$watchers$[t];d&&d.map((function(e){try{u[e](r,s,t)}catch(e){Fe(e,l)}}))}2==(18&c)&&ve(i,!1)}}(this,a,e,t)},configurable:!0,enumerable:!0}):1&r&&64&i&&Object.defineProperty(o,a,{value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,o=Le(this);return null===(n=null==o?void 0:o.$onInstancePromise$)||void 0===n?void 0:n.then((function(){var e,r;return null===(r=o.$lazyInstance$)||void 0===r?void 0:(e=r)[a].apply(e,t)}))}})})),1&r){var i=new Map;o.attributeChangedCallback=function(e,r,n){var a=this;We.jmp((function(){var l,s=i.get(e);if(a.hasOwnProperty(s))n=a[s],delete a[s];else{if(o.hasOwnProperty(s)&&"number"==typeof a[s]&&a[s]==n)return;if(null==s){var c=Le(a),u=null==c?void 0:c.$flags$;if(u&&!(8&u)&&128&u&&n!==r){var p=c.$lazyInstance$,d=null===(l=t.$watchers$)||void 0===l?void 0:l[e];null==d||d.forEach((function(t){null!=p[t]&&p[t].call(p,n,r,e)}))}return}}a[s]=(null!==n||"boolean"!=typeof a[s])&&n}))},e.observedAttributes=Array.from(new Set([].concat((0,d.Z)(Object.keys(null!==(n=t.$watchers$)&&void 0!==n?n:{})),(0,d.Z)(a.filter((function(e){var t=(0,p.Z)(e,2);return t[0],15&t[1][0]})).map((function(e){var r,n=(0,p.Z)(e,2),o=n[0],a=n[1],l=a[1]||o;return i.set(l,o),512&a[0]&&(null===(r=t.$attrsToReflect$)||void 0===r||r.push([o,l])),l}))))))}}return e},Pe=function(){var e=(0,u.Z)(v().mark((function e(t,r,n,o){var a,i,l,s,c,u;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!=(32&r.$flags$)){e.next=23;break}if(r.$flags$|=32,!n.$lazyBundleId$){e.next=20;break}if(!(a=Ue(n)).then){e.next=11;break}return i=function(){},e.next=9,a;case 9:a=e.sent,i();case 11:a.isProxied||(n.$watchers$=a.watchers,Ce(a,n,2),a.isProxied=!0),n.$tagName$,function(){},r.$flags$|=8;try{new a(r)}catch(e){Fe(e)}r.$flags$&=-9,r.$flags$|=128,e.next=22;break;case 20:a=t.constructor,customElements.whenDefined(n.$tagName$).then((function(){return r.$flags$|=128}));case 22:a.style&&(l=a.style,s=H(n),ze.has(s)||(n.$tagName$,function(){},z(s,l,!!(1&n.$flags$))));case 23:c=r.$ancestorComponent$,u=function(){return ve(r,!0)},c&&c["s-rc"]?c["s-rc"].push(u):u();case 26:case"end":return e.stop()}}),e)})));return function(t,r,n,o){return e.apply(this,arguments)}}(),Oe=function(e){if(0==(1&We.$flags$)){var t=Le(e),r=t.$cmpMeta$,n=(r.$tagName$,function(){});if(1&t.$flags$)Te(e,t,r.$listeners$),(null==t?void 0:t.$lazyInstance$)||(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((function(){}));else{t.$flags$|=1,12&r.$flags$&&Se(e);for(var o=e;o=o.parentNode||o.host;)if(o["s-p"]){ye(t,t.$ancestorComponent$=o);break}r.$members$&&Object.entries(r.$members$).map((function(t){var r=(0,p.Z)(t,2),n=r[0];if(31&(0,p.Z)(r[1],1)[0]&&e.hasOwnProperty(n)){var o=e[n];delete e[n],e[n]=o}})),Pe(e,t,r)}n()}},Se=function(e){var t=e["s-cr"]=He.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},Ee=function(e){ke(e,"disconnectedCallback")},$e=function(){var e=(0,u.Z)(v().mark((function e(t){var r;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==(1&We.$flags$)&&((r=Le(t)).$rmListeners$&&(r.$rmListeners$.map((function(e){return e()})),r.$rmListeners$=void 0),(null==r?void 0:r.$lazyInstance$)?Ee(r.$lazyInstance$):(null==r?void 0:r.$onReadyPromise$)&&r.$onReadyPromise$.then((function(){return Ee(r.$lazyInstance$)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ne=function(e){var t,r,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=function(){},u=[],p=l.exclude||[],d=Ge.customElements,f=He.head,y=f.querySelector("meta[charset]"),v=He.createElement("style"),m=[],g=!0;Object.assign(We,l),We.$resourcesUrl$=new URL(l.resourcesUrl||"./",He.baseURI).href;var b=!1;if(e.map((function(e){e[1].map((function(t){var l,s={$flags$:t[0],$tagName$:t[1],$members$:t[2],$listeners$:t[3]};4&s.$flags$&&(b=!0),s.$members$=t[2],s.$listeners$=t[3],s.$attrsToReflect$=[],s.$watchers$=null!==(l=t[4])&&void 0!==l?l:{};var f=s.$tagName$,y=function(e){(0,i.Z)(l,e);var t=h(l);function l(e){var r;return(0,n.Z)(this,l),r=t.call(this,e),e=(0,a.Z)(r),De(e,s),1&s.$flags$&&e.attachShadow({mode:"open"}),r}return(0,o.Z)(l,[{key:"connectedCallback",value:function(){var e=this;r&&(clearTimeout(r),r=null),g?m.push(this):We.jmp((function(){return Oe(e)}))}},{key:"disconnectedCallback",value:function(){var e=this;We.jmp((function(){return $e(e)}))}},{key:"componentOnReady",value:function(){return Le(this).$onReadyPromise$}}]),l}((0,c.Z)(HTMLElement));s.$lazyBundleId$=e[0],p.includes(f)||d.get(f)||(u.push(f),d.define(f,Ce(y,s,1)))}))})),u.length>0&&(b&&(v.textContent+=S),v.textContent+=u+O,v.innerHTML.length)){v.setAttribute("data-styles","");var Z=null!==(t=We.$nonce$)&&void 0!==t?t:T(He);null!=Z&&v.setAttribute("nonce",Z),f.insertBefore(v,y?y.nextSibling:f.firstChild)}g=!1,m.length?m.map((function(e){return e.connectedCallback()})):We.jmp((function(){return r=setTimeout(_e,30)})),s()},Te=function(e,t,r,n){r&&r.map((function(r){var n=(0,p.Z)(r,3),o=n[0],a=n[1],i=n[2],l=je(e,o),s=Ae(t,i),c=Re(o);We.ael(l,a,s,c),(t.$rmListeners$=t.$rmListeners$||[]).push((function(){return We.rel(l,a,s,c)}))}))},Ae=function(e,t){return function(r){try{256&e.$flags$?e.$lazyInstance$[t](r):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,r])}catch(e){Fe(e)}}},je=function(e,t){return 8&t?Ge:e},Re=function(e){return qe?{passive:0!=(1&e),capture:0!=(2&e)}:0!=(2&e)},Ie=new WeakMap,Le=function(e){return Ie.get(e)},Be=function(e,t){return Ie.set(t.$lazyInstance$=e,t)},De=function(e,t){var r={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return r.$onInstancePromise$=new Promise((function(e){return r.$onInstanceResolve$=e})),r.$onReadyPromise$=new Promise((function(e){return r.$onReadyResolve$=e})),e["s-p"]=[],e["s-rc"]=[],Te(e,r,t.$listeners$),Ie.set(e,r)},Me=function(e,t){return t in e},Fe=function(e,t){return(0,console.error)(e,t)},Ve=new Map,Ue=function(e,t,n){var o=e.$tagName$.replace(/-/g,"_"),a=e.$lazyBundleId$,i=Ve.get(a);return i?i[o]:r(7202)("./".concat(a,".entry.js")).then((function(e){return Ve.set(a,e),e[o]}),Fe)},ze=new Map,Ge="undefined"!=typeof window?window:{},He=Ge.document||{head:{}},We={$flags$:0,$resourcesUrl$:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,t,r,n){return e.addEventListener(t,r,n)},rel:function(e,t,r,n){return e.removeEventListener(t,r,n)},ce:function(e,t){return new CustomEvent(e,t)}},qe=function(){var e=!1;try{He.addEventListener("e",null,Object.defineProperty({},"passive",{get:function(){e=!0}}))}catch(e){}return e}(),Ye=function(){try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1}(),Xe=[],Ke=[],Qe=function(e,t){return function(r){e.push(r),P||(P=!0,t&&4&We.$flags$?tt(et):We.raf(et))}},Je=function(e){for(var t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){Fe(e)}e.length=0},et=function e(){Je(Xe),Je(Ke),(P=Xe.length>0)&&We.raf(e)},tt=function(e){return Promise.resolve(undefined).then(e)},rt=Qe(Ke,!0)},5482:function(e,t,r){"use strict";r.d(t,{q:function(){return s}});var n=r(5861),o=r(1284),a=r.n(o),i=r(1368),l=r(2853),s=function(){var e=(0,n.Z)(a().mark((function e(t,r){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof window){e.next=2;break}return e.abrupt("return",void 0);case 2:return e.next=4,(0,l.g)();case 4:return e.abrupt("return",(0,i.b)([["presto-playlist",[[1,"presto-playlist",{items:[16],heading:[1],listTextSingular:[1,"list-text-singular"],listTextPlural:[1,"list-text-plural"],transitionDuration:[2,"transition-duration"],currentPlaylistItem:[32],currentPlyr:[32],playing:[32]},[[0,"rewatch","rewatch"],[0,"next","next"]],{currentPlyr:["handleCurrentPlay"]}]]],["presto-player-skeleton",[[1,"presto-player-skeleton",{effect:[1]}]]],["presto-timestamp",[[4,"presto-timestamp",{time:[1]}]]],["presto-video-curtain-ui",[[1,"presto-video-curtain-ui",{actionUrl:[1,"action-url"]}]]],["presto-search-bar-ui",[[1,"presto-search-bar-ui",{value:[1025],placeholder:[1],hasNavigation:[4,"has-navigation"],focused:[32],placeholderWidth:[32]},null,{placeholder:["handlePlaceholderSize"],value:["handleValueChange"],focused:["watchPropHandler"]}]]],["presto-player-button",[[1,"presto-player-button",{type:[513],size:[513],full:[516],disabled:[516],submit:[516],name:[1],value:[1],href:[1],target:[513],download:[1],hasFocus:[32],hasLabel:[32],hasPrefix:[32],hasSuffix:[32]}]]],["presto-cta-overlay-ui",[[1,"presto-cta-overlay-ui",{headline:[1],defaultHeadline:[1,"default-headline"],bottomText:[1,"bottom-text"],showButton:[4,"show-button"],buttonText:[1,"button-text"],buttonType:[1,"button-type"],buttonLink:[16],allowRewatch:[4,"allow-rewatch"],allowSkip:[4,"allow-skip"],direction:[1],i18n:[16],provider:[1],type:[1],isAudioProvider:[32]}]]],["presto-video",[[0,"presto-video",{getRef:[1040],autoplay:[4],src:[1],preload:[1],poster:[1],player:[8],tracks:[16],playsinline:[4],provider:[1],videoAttributes:[16]}]]],["presto-action-bar-ui_2",[[1,"presto-action-bar-ui",{open:[4]}],[0,"presto-youtube-subscribe-button",{channel:[1],layout:[1],showCount:[4,"show-count"]}]]],["presto-email-overlay-ui_2",[[1,"presto-email-overlay-ui",{headline:[1],bottomText:[1,"bottom-text"],buttonText:[1,"button-text"],allowSkip:[4,"allow-skip"],borderRadius:[2,"border-radius"],isLoading:[4,"is-loading"],errorMessage:[1,"error-message"],direction:[1],i18n:[16],provider:[1],type:[1],email:[32],isAudioProvider:[32]}],[1,"presto-player-spinner"]]],["presto-action-bar_17",[[1,"presto-action-bar",{player:[8],config:[16],direction:[1],youtube:[16],currentTime:[32],duration:[32],ended:[32]}],[0,"presto-cta-overlay",{player:[8],direction:[1],preset:[16],i18n:[16],provider:[1],currentTime:[32],duration:[32],ended:[32]}],[0,"presto-email-overlay",{player:[8],direction:[1],preset:[16],videoId:[2,"video-id"],i18n:[16],provider:[1],currentTime:[32],duration:[32],ended:[32]}],[0,"presto-bunny",{getRef:[1040],autoplay:[4],src:[1],preload:[1],poster:[1025],player:[8],tracks:[16],playsinline:[4],provider:[1],thumbnail:[1],previewUrl:[1,"preview-url"],videoAttributes:[16]}],[1,"presto-dynamic-overlays",{overlays:[16],player:[8],preset:[16],enabled:[4],currentTime:[32],destroy:[32]}],[0,"presto-search-bar",{value:[1],player:[8],markers:[32],currentMarkerLocation:[32]}],[0,"presto-youtube",{src:[1],poster:[1025],lazyLoad:[1028,"lazy-load"],player:[8],getRef:[1040],reloadPlayer:[32],isWebView:[32]},null,{player:["handlePlayerChange"]}],[0,"presto-audio",{getRef:[1040],autoplay:[4],src:[1],preload:[1],poster:[1],player:[8],preset:[16],tracks:[16],provider:[1],mediaTitle:[1,"media-title"],audioAttributes:[16],width:[32]}],[4,"presto-business-skin"],[4,"presto-modern-skin"],[0,"presto-muted-overlay",{mutedPreview:[4,"muted-preview"],mutedOverlay:[16],preset:[16]}],[4,"presto-stacked-skin"],[0,"presto-vimeo",{src:[1],poster:[1],player:[8],getRef:[1040]}],[1,"presto-action-bar-controller",{ended:[4],config:[16],currentTime:[514,"current-time"],duration:[514],direction:[1],youtube:[16],show:[32],youtubeRenderKey:[32],percentagePassed:[32]},null,{duration:["handleDuration","handlePercentagePassed"],ended:["handleEnded"],currentTime:["handlePercentagePassed","handleTime"],config:["handleButtonCountChange"],show:["handleCtaStateChange"]}],[0,"presto-cta-overlay-controller",{ended:[4],currentTime:[514,"current-time"],duration:[514],direction:[1],cta:[16],i18n:[16],provider:[1],enabled:[32],show:[32],loading:[32],error:[32],skipped:[32],percentagePassed:[32]},null,{ended:["handleEnded"],duration:["handleDuration","handlePercentagePassed"],currentTime:["handlePercentagePassed","handleEnabled","handleTime"],show:["handleCtaStateChange"]}],[0,"presto-email-overlay-controller",{ended:[4],currentTime:[514,"current-time"],duration:[514],direction:[1],emailCollection:[16],i18n:[16],videoId:[2,"video-id"],presetId:[2,"preset-id"],provider:[1],enabled:[32],show:[32],loading:[32],error:[32],percentagePassed:[32]},null,{duration:["handleDuration"],currentTime:["handleTimeCheck","handleShowChange"],show:["handleEmailStateChange"]}],[1,"presto-dynamic-overlay-ui",{href:[1],target:[1],position:[1]}]]],["presto-player_4",[[1,"presto-player",{video_id:[2],iconUrl:[1,"icon-url"],src:[1],bunny:[16],branding:[16],config:[16],preset:[16],chapters:[16],overlays:[16],blockAttributes:[16],tracks:[16],analytics:[4],automations:[4],provider:[513],provider_video_id:[1],actionBar:[16],youtube:[16],type:[1],autoplay:[1540],preload:[1],poster:[1],playsinline:[4],isAdmin:[4,"is-admin"],direction:[1],css:[1],currentTime:[2,"current-time"],mediaTitle:[1,"media-title"],classes:[1],videoAttributes:[16],audioAttributes:[16],search:[16],markers:[8],player:[32],playerEl:[32],shouldLazyLoad:[32],mutedPreview:[32],duration:[32],isSticky:[32],videoHeight:[32],playClass:[32],previouslyPlaying:[32],ctaActive:[32],emailActive:[32],actionBarActive:[32],ready:[32],play:[64],goToAndPlay:[64],restart:[64],pause:[64],stop:[64],fullscreenToggle:[64],on:[64],once:[64],off:[64]},[[8,"currentMediaPlayer","handleScroll"],[0,"restartVideo","handleRestartVideo"],[0,"playVideo","handlePlayVideo"],[0,"pauseVideo","handlePauseVideo"],[8,"visibilitychange","playVideoOnlyInViewport"],[0,"ctaStateChange","handleCtaStateChange"],[0,"emailStateChange","handleEmailStateChange"],[0,"actionBarStateChange","handleActionBarStateChange"]],{currentTime:["handleCurrentTimeChange"],isSticky:["handleStickyChange"],playerEl:["handlePlayerElementChange"],player:["handlePlayerElementChange"],mutedPreview:["handleMutedPreview"],shouldLazyLoad:["handleLazyLoadChange"],overlays:["renderDynamicOverlays"],preset:["renderDynamicOverlays"]}],[1,"presto-playlist-item",{active:[4],playing:[4]}],[1,"presto-playlist-overlay",{nextItemTitle:[1,"next-item-title"],nextItemString:[1,"next-item-string"],transitionDuration:[2,"transition-duration"],isLastItem:[4,"is-last-item"],show:[4],animating:[32]},null,{show:["handleShow"],animating:["handleAnimatingChange"]}],[1,"presto-playlist-ui"]]]],r));case 5:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}()},3625:function(e,t,r){"use strict";r.d(t,{q4:function(){return n.q}});var n=r(5482);!function(){if("undefined"!=typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}()},6496:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return ct},options:function(){return ut}});var n=r(2982),o=r(4942),a=r(9307),i=r(5736),l=r(3324),s=r(4184),c=r.n(s),u=r(2777),p=r(5609),d=r(9818),f=r(2175),y=r(917),v=window.location.href,h=function(e){var t=e.src,r=e.onChange,n=e.onSubmit,o=e.onClose;return(0,y.tZ)(f.URLPopover,{onClose:o},(0,y.tZ)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,y.tZ)("input",{"data-cy":"url-input",className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":(0,i.__)("URL","presto-player"),placeholder:(0,i.__)("Paste an mp3 URL","presto-player"),onChange:r,value:t}),(0,y.tZ)(p.Button,{"data-cy":"url-submit",className:"block-editor-media-placeholder__url-input-submit-button",icon:"editor-break",label:(0,i.__)("Apply","presto-player"),type:"submit"})))},m=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){var t=e.value,r=void 0===t?{}:t,n=e.allowedTypes,o=void 0===n?[]:n,s=e.className,m=e.icon,g=e.url,b=void 0===g||g,Z=e.labels,w=void 0===Z?{}:Z,_=e.mediaPreview,k=e.notices,x=e.isAppender,C=e.isPrivate,P=e.addToGallery,O=e.onSelect,S=e.onCancel,E=e.onSelectURL,$=e.onDoubleClick,N=e.children,T=e.allowURLs,A=(0,d.useSelect)((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),j=(0,a.useState)(""),R=(0,l.Z)(j,2),I=R[0],L=R[1],B=(0,a.useState)(!1),D=(0,l.Z)(B,2),M=D[0],F=D[1];(0,a.useEffect)((function(){var e;L(null!==(e=null==r?void 0:r.src)&&void 0!==e?e:"")}),[r]);var V=function(e){L(e.target.value)},U=function(){F(!0)},z=function(){F(!1)},G=function(e){e.preventDefault(),I&&E&&(E(I),z())},H=function(e,t){var r=w.instructions,n=w.title;A||E||(r=(0,i.__)("To edit this block, you need permission to upload media.","presto-player"));var o=c()("block-editor-media-placeholder",s,{"is-appender":x});return(0,y.tZ)(p.Placeholder,{icon:m,label:n,instructions:r,className:o,notices:k,onClick:t,onDoubleClick:$,preview:_},N,e)},W=function(){return E&&(0,y.tZ)("div",{className:"block-editor-media-placeholder__url-input-container"},b&&!1===C&&(0,y.tZ)(p.Button,{className:"block-editor-media-placeholder__button",onClick:U,isPressed:M,isTertiary:!0},(0,i.__)("Audio URL","presto-player")),M&&(0,y.tZ)(h,{src:I,onChange:V,onSubmit:G,onClose:z}))};return(0,y.tZ)(f.MediaUploadCheck,{fallback:H(W())},function(){var e=(0,y.tZ)(f.MediaUpload,{title:C?(0,i.__)("Select or Upload Private Audio","presto-player"):(0,i.__)("Select or Upload Audio","presto-player"),addToGallery:P,gallery:!1,multiple:!1,onSelect:function(e){u.Z.unsetUrlParams(),O(e)},onClose:function(){u.Z.unsetUrlParams()},allowedTypes:o,value:Array.isArray(r)?r.map((function(e){return e.id})):r.id,render:function(e){var t=e.open;return(0,y.tZ)(p.Button,{isPrimary:!0,onClick:function(e){e.stopPropagation(),u.Z.unsetUrlParams(),C?u.Z.setUrlPrivate(v):u.Z.setUrlPublic(v),t()}},C?(0,i.__)("Add/Select Private Audio","presto-player"):(0,i.__)("Add/Select Audio","presto-player"))}});if(A){var t=(0,y.tZ)(React.Fragment,null,e,!!T&&W(),S&&(0,y.tZ)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,i.__)("Cancel","presto-player"),isLink:!0,onClick:S},(0,i.__)("Cancel","presto-player")));return H(t)}return H(e)}())})),g=r(9807),__=wp.i18n.__,b=wp.components,Z=(b.withNotices,b.BaseControl),w=b.ToggleControl,k=b.Notice,x=["audio"],C=function(e){var t,r,n=e.attributes,a=e.setAttributes,i=e.onSelectURL,l=e.onSelect,s=e.children,c="private"===n.visibility;return(0,y.tZ)(m,(r={icon:c?(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,y.tZ)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,y.tZ)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})):(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"presto-block-icon"},(0,y.tZ)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})),labels:{title:__("Presto Audio","presto-player"),instructions:__("Upload a audio file, or pick one from your media library.","presto-player")},accept:"audio/*",setAttributes:a,allowedTypes:x,switcher:!0,isPrivate:c,allowURLs:!c,onSelectURL:i,onSelect:l,value:n},(0,o.Z)(r,"allowURLs",!0),(0,o.Z)(r,"onError",(function(){return console.log("error")})),r),(0,y.tZ)("div",{style:{width:"100%"}},(0,y.tZ)(Z,{className:"presto-player__placeholder-control"},(0,y.tZ)(w,{label:(0,y.tZ)("div",null,__("Make Private","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&(0,y.tZ)(g.Z,null)),help:__(c?"This audio is only accessible to those who are logged in.":"This audio is currently accessible to everyone.","presto-player"),checked:c,onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?a({visibility:e?"private":"public"}):(0,d.dispatch)("presto-player/player").setProModal(!0)}})),!!s&&(0,y.tZ)("div",{style:{width:"100%"}},s),!!c&&(0,y.tZ)(k,{status:"warning",isDismissible:!1},(0,y.tZ)("div",null,(0,y.tZ)("div",null,(0,y.tZ)("strong",null,__("Note","presto-player"))),__("Private audio uses php to stream your audio. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.","presto-player")))))},P=r(4994),O=r(4333),S=r(7798),E=r(398),$=r(6774),N=r(168),T=r(5861),A=r(1284),j=r.n(A),R=r(7161),I=r(9493),L=r(7453),B=r(4831),D=r(1713);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=function(e){var t,r=e.state,n=e.branding,o=e.menu,s=e.src,c=e.poster,u=e.currentTime,d=e.preload,f=e.mediaTitle,v=e.overlays,h=e.isDisabled,m=void 0===h||h,g=(0,a.useState)(1),b=(0,l.Z)(g,2),Z=b[0],w=b[1],_=r.email_collection,k=r.cta;(0,a.useEffect)((function(){w(Z+1)}),[r.skin,r["play-large"],r.rewind,r.play,r["fast-forward"],r.progress,r["current-time"],r.mute,r.volume,r.speed,r.pip,r.fullscreen,r.captions,r.hide_logo]);var x={email:!(null==_||!_.enabled)&&(0,y.tZ)(B.zi,{className:"email-overlay",slot:"player-end",headline:null==_?void 0:_.headline,style:F(F({"--presto-player-email-border-radiuss":"".concat(null==_?void 0:_.button_radius,"px"),"--plyr-color-main":(null==r?void 0:r.background_color)||(null==n?void 0:n.color)},_.button_color?{"--presto-player-button-color":"".concat(_.button_color)}:{}),_.button_text_color?{"--presto-player-button-text":"".concat(_.button_text_color)}:{}),defaultHeadline:(0,i.__)("Enter your email to play.","presto-player"),bottomText:null==_?void 0:_.bottom_text,allowSkip:null==_?void 0:_.allow_skip,skipText:(0,i.__)("Skip","presto-player"),buttonText:null==_?void 0:_.button_text,placeholder:(0,i.__)("Email address","presto-player"),i18n:window.prestoPlayer.i18n,type:"audio"}),cta:!(null==k||!k.enabled)&&(0,y.tZ)(B.UP,{className:"cta-overlay",style:F(F(F({"--presto-player-button-border-radius":"".concat(k.button_radius,"px")},null!=k&&k.background_opacity?{"--presto-player-cta-background-opacity":"".concat((null==k?void 0:k.background_opacity)/100)}:{}),k.button_color?{"--presto-player-button-color":"".concat(k.button_color)}:{}),k.button_text_color?{"--presto-player-button-text":"".concat(k.button_text_color)}:{}),slot:"player-end",headline:null==k?void 0:k.headline,"bottom-text":null==k?void 0:k.bottom_text,"button-link":null==k?void 0:k.button_link,"allow-skip":100!==(null==k?void 0:k.percentage)&&(null==k?void 0:k.show_skip),borderRadius:null==k?void 0:k.border_radius,"allow-rewatch":100===(null==k?void 0:k.percentage)&&(null==k?void 0:k.show_rewatch),"skip-text":(0,i.__)("Skip","presto-player"),"show-button":null==k?void 0:k.show_button,"button-text":null==k?void 0:k.button_text,i18n:window.prestoPlayer.i18n,type:"audio"})};return(0,y.tZ)(p.Disabled,{isDisabled:m,className:"disable-player"},(0,y.tZ)("div",{className:"presto-player__wrapper"},(0,y.tZ)(D.Z,{src:s||"http://something.mp3",classes:"\n ".concat("cta"===o&&!(null==k||!k.enabled)&&"cta-active"," \n ").concat("email"===o&&!(null==_||!_.enabled)&&"email-active"),preset:r,branding:n,i18n:null===(t=prestoPlayerAdmin)||void 0===t?void 0:t.i18n,preload:d,attributes:{chapters:[],poster:c,title:f},type:"audio",currentTime:u?(0,R.ZD)(u):"",overlays:v,key:Z,adminPreview:(null==x?void 0:x[o])||""})))},U=wp.i18n.__,z=wp.components,G=z.ToggleControl,H=z.BaseControl,W=(z.HorizontalRule,z.__experimentalAlignmentMatrixControl,z.SelectControl);function q(e){var t=e.state,r=e.updateState,n=e.className;return(0,y.tZ)("div",{className:n},(0,y.tZ)(H,null,(0,y.tZ)("h3",null,U("Behavior","presto-player"))),(0,y.tZ)(H,null,(0,y.tZ)(G,{label:U("Save Play Position","presto-player"),help:U("Saves the user's play position so when they come back to the page they can continue the audio from where they left off.","presto-player"),onChange:function(e){r({save_player_position:e})},checked:t.save_player_position})),(0,y.tZ)(H,null,(0,y.tZ)(G,{label:U("Show Time Elapsed","presto-player"),help:U("Show the time elapsed or the time remaining for the audio on the player. By default, the time remaining is shown.","presto-player"),onChange:function(e){r({show_time_elapsed:e})},checked:t.show_time_elapsed})),(0,y.tZ)(H,null,(0,y.tZ)(G,{label:U("Focus Mode","presto-player"),help:U("Play only when tab is visible and audio is in viewport.","presto-player"),onChange:function(e){r({play_video_viewport:e})},checked:t.play_video_viewport})),(0,y.tZ)(H,null,(0,y.tZ)(G,{label:U("Sticky On Scroll","presto-player"),help:U("Stick audios to the side of the screen when the page is scrolled and the audio is playing.","presto-player"),onChange:function(e){r({sticky_scroll:e})},checked:t.sticky_scroll})),(0,y.tZ)(H,null,(0,y.tZ)(W,{label:U("On Audio End","presto-player"),value:t.on_video_end,options:[{value:"select",label:U("Select","presto-player")},{value:"loop",label:U("Loop","presto-player")},{value:"go-to-start",label:U("Go to start","presto-player")}],onChange:function(e){r({on_video_end:e})}})))}var Y=wp.i18n.__,X=wp.components,K=X.ToggleControl,Q=X.BaseControl;function J(e){var t=e.state,r=e.updateState,n=e.className;return(0,y.tZ)("div",{className:n},(0,y.tZ)(Q,null,(0,y.tZ)("h3",null,Y("Controls","presto-player"))),(0,y.tZ)(Q,{className:"presto-player__control--large-play"},(0,y.tZ)(K,{label:Y("Large Play Button","presto-player"),help:Y("Adds a large play button over the top of the player.","presto-player"),onChange:function(e){r({"play-large":e})},checked:t["play-large"]})),(0,y.tZ)(Q,{className:"presto-player__control--rewind"},(0,y.tZ)(K,{label:Y("Rewind","presto-player"),help:Y("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({rewind:e})},checked:t.rewind})),(0,y.tZ)(Q,{className:"presto-player__control--play"},(0,y.tZ)(K,{label:Y("Small Play Button","presto-player"),help:Y("Adds a small play button to the bottom of the player.","presto-player"),onChange:function(e){r({play:e})},checked:t.play})),(0,y.tZ)(Q,{className:"presto-player__control--fast-forward"},(0,y.tZ)(K,{label:Y("Fast Forward","presto-player"),help:Y("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({"fast-forward":e})},checked:t["fast-forward"]})),(0,y.tZ)(Q,{className:"presto-player__control--progress"},(0,y.tZ)(K,{label:Y("Progress Bar","presto-player"),help:Y("Shows a seekable progress bar.","presto-player"),onChange:function(e){r({progress:e})},checked:t.progress})),(0,y.tZ)(Q,{className:"presto-player__control--current-time"},(0,y.tZ)(K,{label:Y("Current Time","presto-player"),help:Y("Shows the audio timestamp.","presto-player"),onChange:function(e){r({"current-time":e})},checked:t["current-time"]})),(0,y.tZ)(Q,{className:"presto-player__control--volume"},(0,y.tZ)(K,{label:Y("Volume","presto-player"),help:Y("Shows a volume bar.","presto-player"),onChange:function(e){r({volume:e,mute:e})},checked:t.volume})),(0,y.tZ)(Q,{className:"presto-player__control--speed"},(0,y.tZ)(K,{label:Y("Speed","presto-player"),help:Y("Shows playback speed controls.","presto-player"),onChange:function(e){r({speed:e})},checked:t.speed})))}var ee,te=r(1145);function re(e){var t=e.state,r=e.updateState,n=e.className;return(0,y.tZ)("div",{className:n},(0,y.tZ)(p.BaseControl,null,(0,y.tZ)("h3",null,(0,i.__)("Style","presto-player"))),(0,y.tZ)(p.BaseControl,null,(0,y.tZ)(p.RangeControl,{label:(0,i.__)("Round Corners","presto-player"),help:(0,i.__)("Player border radius size.","presto-player"),value:(null==t?void 0:t.border_radius)||0,onChange:function(e){return r({border_radius:e})},min:0,max:25,css:(0,L.iv)(ee||(ee=(0,N.Z)(["\n padding-left: 4px;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))})),(0,y.tZ)(p.BaseControl,null,(0,y.tZ)(p.Flex,null,(0,y.tZ)(p.BaseControl.VisualLabel,null,(0,y.tZ)("p",null,(0,i.__)("Background Color","presto-player"))),(0,y.tZ)(te.Z,{color:(null==t?void 0:t.background_color)||"#000000",setColor:function(e){r({background_color:e.hex})}}))),(0,y.tZ)(p.BaseControl,null,(0,y.tZ)(p.Flex,null,(0,y.tZ)(p.BaseControl.VisualLabel,null,(0,y.tZ)("p",null,(0,i.__)("Control Color","presto-player"))),(0,y.tZ)(te.Z,{color:(null==t?void 0:t.control_color)||"#000000",setColor:function(e){r({control_color:e.hex})}}))))}var ne,oe,ae=r(3865),ie=r(7833),le=r(9632);function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ue=wp.i18n.__,pe=wp.components,de=pe.TextControl,fe=pe.BaseControl,ye=pe.Icon,ve=pe.Notice,he=pe.Button,me=pe.Flex,ge=pe.FlexItem,be=pe.SelectControl,Ze=pe.FlexBlock,we=pe.Modal,_e=wp.element,ke=_e.useState,xe=_e.useEffect,Ce=wp.data,Pe=Ce.useSelect,Oe=Ce.dispatch,Se=function(e){var t=e.type,r=void 0===t?"new":t,n=e.closeModal,o=e.addPreset,a=e.onSave,i=e.updatePreset,s=e.name,c=void 0===s?"":s,u=e.attributes,p=e.preset,d=void 0===p?{"play-large":!0,rewind:!0,play:!0,"fast-forward":!0,progress:!0,"current-time":!0,mute:!0,volume:!0,speed:!1,pip:!1,save_player_position:!1,reset_on_end:!1,sticky_scroll:!1,hide_logo:!1,border_radius:0,skin:"default",background_color:"",control_color:"",cta:{},email_collection:{},action_bar:{}}:p,f=ke(!1),y=(0,l.Z)(f,2),v=y[0],h=y[1],m=ke(""),g=(0,l.Z)(m,2),b=g[0],Z=g[1],w=ke(""),_=(0,l.Z)(w,2),k=_[0],x=_[1],C=ke(c),P=(0,l.Z)(C,2),O=P[0],S=P[1],E=ke(d),$=(0,l.Z)(E,2),A=$[0],B=$[1],D=Pe((function(e){return e("presto-player/player").branding()})),M=ke(""),F=(0,l.Z)(M,2),U=F[0],z=F[1],G={message:ue("The preset could not be saved. Please reload the page and try again.","presto-player")},H=Pe((function(e){return e("presto-player/player").youtube()}));xe((function(){z(H.channel_id)}),[null==H?void 0:H.channel_id]);var W=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};B(ce(ce({},A),e))},Y=function(){var e=(0,T.Z)(j().mark((function e(){var t,r,o,l;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,t=ce(ce({},A),{name:O}),e.next=5,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"audio-preset/").concat(d.id),{_method:"PUT"}),data:t});case 5:if(r=e.sent){e.next=8;break}throw G;case 8:i(r),n(),a&&a(r),(0,R.i1)({message:ue("Preset updated!","presto-player")}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),Z(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:G);case 17:return e.prev=17,h(!1),e.finish(17);case 20:return Oe("presto-player/player").updateYoutube({channel_id:U}),o=ce(ce({},H),{channel_id:U}),e.prev=22,e.next=25,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:o}});case 25:null!=(l=e.sent)&&l.presto_player_youtube&&(Oe("presto-player/player").setYoutube(null==l?void 0:l.presto_player_youtube),onClose()),e.next=32;break;case 29:e.prev=29,e.t1=e.catch(22),console.log(e.t1);case 32:case"end":return e.stop()}}),e,null,[[1,14,17,20],[22,29]])})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=(0,T.Z)(j().mark((function e(){var t;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.prev=1,e.next=4,wp.apiFetch({method:"POST",url:prestoPlayer.root+prestoPlayer.prestoVersionString+"audio-preset",data:ce(ce({},{name:O}),A)});case 4:if(t=e.sent){e.next=7;break}throw G;case 7:o(t),n(),a&&a(t),(0,R.i1)({message:ue("Preset created!","presto-player")}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),Z(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:G);case 16:return e.prev=16,h(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),K=[{name:"controls",title:ue("Controls","presto-player"),icon:(0,L.tZ)(ye,{icon:"admin-settings"}),component:(0,L.tZ)(J,{updateState:W,state:A})},{name:"behavior",title:ue("Behavior","presto-player"),icon:(0,L.tZ)(ye,{icon:"admin-generic"}),component:(0,L.tZ)(q,{updateState:W,state:A})},{name:"style",title:ue("Style","presto-player"),icon:(0,L.tZ)(ye,{icon:"admin-customizer"}),component:(0,L.tZ)(re,{updateState:W,state:A})},{name:"email",title:ue("Email Capture","presto-player"),icon:(0,L.tZ)(ye,{icon:"email"}),component:(0,L.tZ)(le.Z,{updateState:W,state:A})},{name:"cta",title:ue("Call To Action","presto-player"),icon:(0,L.tZ)(ye,{icon:"megaphone"}),component:(0,L.tZ)(ie.Z,{updateState:W,state:A})},{name:"action_bar",title:ue("Action Bar","presto-player"),icon:(0,L.tZ)(ye,{icon:"cover-image"}),component:(0,L.tZ)(ae.Z,{updateState:W,state:A,value:U,setValue:z})}];return(0,L.tZ)(we,{title:ue("edit"==r?"Edit A Audio Preset":"Create A New Audio Preset","presto-player"),onRequestClose:n,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay"},(0,L.tZ)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},(0,L.tZ)(de,{value:O,hideLabelFromVision:!0,label:ue("Preset Name","presto-player"),onChange:function(e){return S(e)},placeholder:ue("Enter a preset name...","presto-player"),className:"presto-player__modal--style-name",autoFocus:!0}),(0,L.tZ)(me,{align:"stretch",className:"presto-player__style-preview-area"},(0,L.tZ)(ge,{className:"presto-player__style-sidebar"},(0,L.tZ)("div",null,(0,L.tZ)(I.Z,{items:K,title:ue("Customize","presto-player"),onSelect:x},(function(e){return e.component})))),(0,L.tZ)(Ze,{className:"presto-player__style-preview-panel"},(0,L.tZ)("div",{style:{position:"absolute",top:0,left:0,padding:"20px"}},(0,L.tZ)(be,{label:ue("Skin","presto-player"),labelPosition:"side",value:null==A?void 0:A.skin,hideLabelFromVision:!0,options:[{label:ue("Basic","presto-player"),value:"default"},{label:ue("Stacked","presto-player"),value:"stacked"}],onChange:function(e){W({skin:e})}})),(0,L.tZ)(V,{poster:u.poster,src:u.src,state:A,branding:D,menu:k,mediaTitle:u.title}))),(0,L.tZ)("br",null),b&&(0,L.tZ)(fe,null,(0,L.tZ)(ve,{className:"presto-player__modal--error-notice",status:"error",isDismissible:!1,style:{margin:0}},b.replace(/(<([^>]+)>)/gi,""))),(0,L.tZ)("div",{css:(0,L.iv)(ne||(ne=(0,N.Z)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},(0,L.tZ)("div",{css:(0,L.iv)(oe||(oe=(0,N.Z)(["\n opacity: 0.5;\n font-size: 12px;\n "])))},"Preset ID: ",d.id),(0,L.tZ)("div",null,(0,L.tZ)(he,{isTertiary:!0,onClick:n,style:{margin:"0 6px"}},ue("Cancel","presto-player")),(0,L.tZ)(he,{isPrimary:!0,isBusy:v,disabled:v,onClick:function(){if(O)return"edit"===r?Y():X();Z(ue("You must enter a name for the preset.","presto-player"))},"data-cy":"submit-preset"},ue("edit"==r?"Update Preset":"Create Preset","presto-player"))))))},Ee=wp.i18n.__,$e=wp.components,Ne=$e.Icon,Te=$e.Spinner,Ae=$e.Modal,je=$e.Button,Re=$e.ButtonGroup,Ie=wp.element.useState;function Le(e){var t,r,n=e.preset,o=e.index,a=e.isActive,i=e.remove,s=e.setPreset,c=e.onEdit,u=Ie(!1),p=(0,l.Z)(u,2),d=p[0],f=p[1],v=Ie(!1),h=(0,l.Z)(v,2),m=h[0],g=h[1],b=function(){return g(!1)},Z=function(){var e=(0,T.Z)(j().mark((function e(){return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.id){e.next=3;break}return i(n),e.abrupt("return");case 3:return e.prev=3,f(!0),e.next=7,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"audio-preset/").concat(n.id),{_method:"DELETE"})});case 7:e.sent&&(i(n),wp.data.dispatch("core/notices").createNotice("success",Ee("Preset trashed.","presto-player"),{type:"snackbar",isDismissible:!0})),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0),null!==e.t0&&void 0!==e.t0&&e.t0.message&&wp.data.dispatch("core/notices").createNotice("error",e.t0.message,{type:"snackbar",isDismissible:!0});case 15:return e.prev=15,g(!1),f(!1),e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[3,11,15,19]])})));return function(){return e.apply(this,arguments)}}();return d?(0,y.tZ)("div",{className:"block-editor-block-styles__item",role:"button",tabIndex:o,"aria-label":"Fill",style:{color:a?"var(--wp-admin-theme-color)":"inherit",width:"calc(50% - 4px)",margin:"4px 0","flex-shrink":"0",cursor:"pointer",overflow:"hidden","border-radius":"2px",padding:"6px",display:"flex","flex-direction":"column"}},(0,y.tZ)("div",{className:"block-editor-block-styles__item-preview",style:{border:a?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,outline:"1px solid transparent",padding:"0",display:"flex",overflow:"hidden",background:"#fff","align-items":"center","flex-grow":"1","min-height":"80px","max-height":"160px"}},(0,y.tZ)(Te,null))):(0,y.tZ)("div",{className:"block-editor-block-styles__item presto-preset-".concat(n.slug),onClick:function(){s(n)},role:"button",tabIndex:o,"aria-label":"Fill",style:{color:a?"var(--wp-admin-theme-color)":"inherit",width:"calc(50% - 4px)",margin:"4px 0","flex-shrink":"0",cursor:"pointer",overflow:"hidden","border-radius":"2px",padding:"6px",display:"flex","flex-direction":"column"}},(0,y.tZ)("div",{className:"block-editor-block-styles__item-preview",style:{border:a?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,outline:"1px solid transparent",padding:"0",display:"flex",overflow:"hidden",background:"#fff","align-items":"center","flex-grow":"1","min-height":"80px","max-height":"160px"}},(0,y.tZ)("div",{style:{textAlign:"center",width:"100%",color:a?"var(--wp-admin-theme-color)":"inherit",opacity:a?1:.75}},null!=n&&n.icon?(0,y.tZ)(Ne,{icon:null==n?void 0:n.icon,style:{fontSize:"30px",width:"30px",height:"30px"}}):(0,y.tZ)("h1",{style:{opacity:.75}},(null==n||null===(t=n.name)||void 0===t||null===(r=t.charAt(0))||void 0===r?void 0:r.toUpperCase())||"Untitled"))),(0,y.tZ)("div",{className:"block-editor-block-styles__item-label",style:{fontWeight:"bold",textTransform:"capitalize","text-align":"center",padding:"4px 0"}},(null==n?void 0:n.name)||"Untitled"),!(null!=n&&n.is_locked)&&(0,y.tZ)("div",{className:"block-editor-block-styles__item-edit"},(0,y.tZ)("div",{className:"block-editor-block-styles__item-edit-icon",onClick:c},(0,y.tZ)(Ne,{icon:"edit"})),(0,y.tZ)("div",{className:"block-editor-block-styles__item-edit-icon",onClick:function(){return g(!0)}},(0,y.tZ)(Ne,{icon:"trash"}))),m&&(0,y.tZ)(Ae,{title:Ee("Trash Preset?","presto-player"),onRequestClose:b,style:{maxWidth:"250px"}},(0,y.tZ)("p",null,(0,y.tZ)("strong",null,Ee("Warning!","presto-player")," "),Ee("Any audios assigned to this preset will automatically use the default preset.","presto-player")),(0,y.tZ)(Re,null,(0,y.tZ)(je,{isDestructive:!0,onClick:Z,style:{margin:"0 4px"}},Ee("Trash","presto-player")),(0,y.tZ)(je,{isTertiary:!0,onClick:b,style:{margin:"0 4px",boxShadow:"none"}},Ee("Cancel","presto-player")))))}var Be=wp.i18n.__,De=wp.components,Me=De.withNotices,Fe=De.BaseControl,Ve=De.Spinner,Ue=De.Button,ze=wp.element,Ge=ze.useState,He=(ze.useEffect,wp.data),We=He.useSelect,qe=He.dispatch,Ye=Me((function(e){var t,r=e.attributes,n=e.setAttributes,o=Ge(!1),a=(0,l.Z)(o,2),i=a[0],s=a[1],c=function(){return s(!1)},u=Ge(null),p=(0,l.Z)(u,2),d=p[0],f=p[1],v=Ge(null),h=(0,l.Z)(v,2),m=h[0],b=h[1],Z=We((function(e){return{presets:e("presto-player/player").getAudioPresets(),loading:e("presto-player/player").isResolving("getAudioPresets")}})),w=Z.presets,_=Z.loading,k=function(e){qe("presto-player/player").addAudioPreset(e)},x=function(e){qe("presto-player/player").removeAudioPreset(e)},C=function(e){n({preset:e.id})},P=(0,$.Z)("div",{target:"es6ga4s0"})({name:"1f3egm3",styles:"display:flex;flex-wrap:wrap;justify-content:space-between"});return _?(0,y.tZ)("div",{className:"presto-settings__loading"},(0,y.tZ)(Ve,null)):(0,y.tZ)(React.Fragment,null,w.length?(0,y.tZ)("p",null,Be("Select a audio configuration preset, or add your own.","presto-player")):"",(0,y.tZ)(Fe,null,(0,y.tZ)(P,null,(w||[]).length?w.map((function(e,t){return(0,y.tZ)(Le,{setPreset:C,index:t,isActive:(null==r?void 0:r.preset)===e.id,preset:e,key:e.id,onEdit:function(){b(e.name),f(e),s("edit")},remove:x})})):Be("No style presets. You can create a new style by clicking 'Add New Style'.","presto-plugin"))),(0,y.tZ)(Fe,null,(0,y.tZ)(Ue,{isPrimary:!0,"data-cy":"add-new-preset",onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?s("new"):qe("presto-player/player").setProModal(!0)}},Be("Add New Preset","presto-player")),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&(0,y.tZ)(g.Z,null)),"new"==i&&(0,y.tZ)(Se,{closeModal:c,addPreset:k,type:"new",onSave:C,attributes:r}),"edit"==i&&(0,y.tZ)(Se,{closeModal:c,addPreset:k,updatePreset:function(e){qe("presto-player/player").updateAudioPreset(e)},type:"edit",preset:d,name:m,attributes:r}))})),Xe=["image"],Ke=function e(t){var r,n,o=t.attributes,a=t.setAttributes,l=(0,O.useInstanceId)(e),s="audio-block__poster-image-description-".concat(l),c=(0,d.useSelect)((function(e){return e(S.store).canUser("read","settings")})),u=o.autoplay,v=o.poster,h=o.preload,m=o.title;return(0,y.tZ)(React.Fragment,null,(0,y.tZ)(p.PanelBody,{title:(0,y.tZ)(React.Fragment,null,(0,i.__)("Title","presto-player")," "),initialOpen:!0},(0,y.tZ)(p.FlexBlock,null,(0,y.tZ)(p.TextControl,{className:"presto-player__caption--title",placeholder:(0,i.__)("Title","presto-player"),value:m||"",onChange:function(e){return a({title:e})},autoComplete:"off"}))),(0,y.tZ)(p.PanelBody,{title:(0,y.tZ)(React.Fragment,null,(0,i.__)("Chapters","presto-player")," ",!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&(0,y.tZ)(g.Z,null)),initialOpen:null===(n=prestoPlayer)||void 0===n?void 0:n.isPremium},(0,y.tZ)(E.Z,{setAttributes:a,attributes:o})),(0,y.tZ)(p.PanelBody,{title:(0,y.tZ)(React.Fragment,null,(0,i.__)("Audio Settings","presto-player")," ")},(0,y.tZ)(p.ToggleControl,{label:(0,y.tZ)(React.Fragment,null,(0,i.__)("Autoplay","presto-player")," "),checked:u,onChange:function(e){a({autoplay:e})}}),(0,y.tZ)(p.PanelRow,null,(0,y.tZ)(p.SelectControl,{label:(0,y.tZ)(p.Flex,null,(0,y.tZ)("div",null,(0,i.__)("Performance Preference","presto-player")),(0,y.tZ)("a",{href:"https://prestoplayer.com/docs/performance-preferences-explained",target:"_blank",style:{textDecoration:"none"}},(0,y.tZ)(p.Icon,{icon:"editor-help"}))),className:"presto-setting__preload",value:h,onChange:function(e){return a({preload:e})},options:[{value:"auto",label:(0,i.__)("Audio Playback Speed","presto-player")},{value:"metadata",label:(0,i.__)("Page Load Speed","presto-player")},{value:"none",label:(0,i.__)("Page Load Speed (Extreme)","presto-player")}]})),(0,y.tZ)(p.PanelRow,null,(0,y.tZ)(f.MediaUploadCheck,null,(0,y.tZ)(p.BaseControl,{className:"editor-video-poster-control"},(0,y.tZ)(p.BaseControl.VisualLabel,null,(0,i.__)("Poster image","presto-player")),(0,y.tZ)(f.MediaUpload,{title:(0,i.__)("Select poster image","presto-player"),onSelect:function(e){a({poster:e.url})},allowedTypes:Xe,render:function(e){var t=e.open;return(0,y.tZ)(p.Button,{className:"presto-setting__poster",isPrimary:!0,onClick:t,"aria-describedby":s},v?(0,i.__)("Replace","presto-player"):(0,i.__)("Select","presto-player"))}}),(0,y.tZ)("p",{id:s,hidden:!0},v?sprintf((0,i.__)("The current poster image url is %s","presto-player"),v):(0,i.__)("There is no poster image currently selected","presto-player")),!!v&&(0,y.tZ)(p.Button,{onClick:function(){a({poster:""})},className:"presto-setting__remove-poster",isTertiary:!0},(0,i.__)("Remove","presto-player")))))),(0,y.tZ)(p.PanelBody,{title:(0,i.__)("Audio Preset","presto-player")},(0,y.tZ)(Ye,{setAttributes:a,attributes:o})),!!c&&(0,y.tZ)(p.PanelBody,{title:(0,y.tZ)(React.Fragment,null,(0,i.__)("Global Player Branding","presto-player")),initialOpen:!1},(0,y.tZ)(P.Z,{setAttributes:a,attributes:o,type:"audio"})))},Qe=r(7462),Je=r(9512);function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rt=wp.data.withSelect,nt=r(9641);function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var it,lt,st=(0,O.compose)([rt((function(e){return{branding:e("presto-player/player").branding(),loading:e("presto-player/player").isResolving("getAudioPresets"),presets:e("presto-player/player").getAudioPresets(),defaultPreset:e("presto-player/player").getDefaultAudioPreset()}})),(0,O.createHigherOrderComponent)((function(e){return function(t){var r=t.presets,n=t.attributes,o=t.setAttributes,s=t.defaultPreset,c=t.isSelected,u=t.branding,p=(0,a.useState)({}),f=(0,l.Z)(p,2),v=f[0],h=f[1],m=(0,a.useState)(1),g=(0,l.Z)(m,2),b=g[0],Z=g[1],w=n.poster,k=n.chapters;(0,a.useEffect)((function(){c&&null!=n&&n.selectionOverrideClientId&&(0,d.dispatch)("core/block-editor").selectBlock(null==n?void 0:n.selectionOverrideClientId)}),[c]),(0,a.useEffect)((function(){if(r&&r.length){var e=r.find((function(e){return e.id===(null==n?void 0:n.preset)}));e?h(e):(h(s),o({preset:null==s?void 0:s.id}))}}),[r,null==n?void 0:n.preset]),(0,a.useEffect)((function(){x()}),[w,v,k,u.logo]);var x=function(){Z(b+1)},C=(0,R.D9)(k);(0,a.useEffect)((function(){var e=null==k?void 0:k.map((function(e){return e.time})),t=null==C?void 0:C.map((function(e){return e.time}));_.difference(e,t).length&&x()}),[k]);var P=function(){var e=(0,T.Z)(j().mark((function e(t){var r,n,a,i,l,s,c;return j().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.src,n=t.external_id,a=t.attachment_id,i=t.type,l=t.title,r||n||a){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,(0,Je.Z)({method:"POST",path:"/presto-player/v1/videos",data:tt(tt({attachment_id:a,post_id:wp.data.select("core/editor").getCurrentPostId(),external_id:n},l?{title:l}:{}),{},{src:r,type:i})});case 5:s=e.sent,c=s.id,o({id:c});case 8:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();return null!=n&&n.preset||o({preset:null==s?void 0:s.id}),(0,y.tZ)(e,(0,Qe.Z)({},t,{lockSave:function(){return(0,d.dispatch)("core/editor").lockPostSaving("presto-player")},unlockSave:function(){return(0,d.dispatch)("core/editor").unlockPostSaving("presto-player")},createVideo:P,onUpdate:x,onRemoveSrc:function(){confirm((0,i.__)("Remove this","presto-player"))&&o({src:"",id:void 0})},presetData:v,setPresetData:h,renderKey:b}))}}),"withPlayerEdit")])((0,p.withNotices)((function(e){var t=e.attributes,r=e.setAttributes,n=e.branding,o=e.presetData,a=e.renderKey,l=e.defaultPreset,s=e.lockSave,c=e.unlockSave,u=e.loading,d=e.createVideo,v=e.onRemoveSrc,h=t.poster,m=t.src,g=t.id;return m?u||!g?(0,y.tZ)(p.Placeholder,{className:"presto-player__placeholder is-loading"},(0,y.tZ)(p.Spinner,null)):(0,y.tZ)(React.Fragment,null,(0,y.tZ)(f.BlockControls,null,(0,y.tZ)(p.Toolbar,null,(0,y.tZ)(p.Button,{onClick:function(){return v()}},(0,i.__)("Replace","presto-player"))),(0,y.tZ)(nt.Z,null)),(0,y.tZ)(f.InspectorControls,null,(0,y.tZ)(Ke,{attributes:t,setAttributes:r})),(0,y.tZ)("figure",null,(0,y.tZ)(p.Disabled,null,(0,y.tZ)(D.Z,{poster:h,src:m,id:g,type:"audio",attributes:t,setAttributes:r,preset:o,branding:n,key:a})))):(0,y.tZ)(React.Fragment,null,(0,y.tZ)(C,{attributes:t,setAttributes:r,onSelectURL:function(e){r(at(at({},t),{},{src:e,title:e,preset:null==l?void 0:l.id})),s(),d({src:e,type:"link"}).catch((function(e){r({src:""}),showNotice(e)})).finally(c)},onSelect:function(e){e&&e.url?e.title?(r({src:e.url,preset:null==l?void 0:l.id,title:e.title,attachment_id:e.id}),s(),d({src:e.url,type:"attachment",attachment_id:e.id}).catch((function(e){r({src:""}),showNotice(e)})).finally(c)):r({src:e.url,title:e.url,preset:null==l?void 0:l.id}):r({src:void 0,id:void 0})}}))}))),ct="presto-player/audio",ut={category:"presto",attributes:(it={src:{type:"string"},autoplay:{type:Boolean,default:!1},poster:{type:"string"},chapters:{type:"array",default:[]},preload:{type:"string"},title:{type:"string"},tracks:{type:"array",items:{type:"object"},default:[]},preset:{type:Number},id:{type:Number},attachment_id:{type:Number}},(0,o.Z)(it,"src",{type:String}),(0,o.Z)(it,"visibility",{type:String,default:"public"}),it),title:(0,i.__)("Presto Audio","presto-player"),description:(0,i.__)("A audio player wrapper.","presto-player"),variations:[{name:"public",isDefault:!0,title:(0,i.__)("Presto Audio","presto-player"),description:(0,i.__)("Presto self-hosted audio block.","presto-player"),attributes:{visibility:"public"}}].concat((0,n.Z)(null!==(lt=prestoPlayer)&&void 0!==lt&<.isPremium?[{name:"private",title:(0,i.__)("Presto Private Audio","presto-player"),icon:(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,y.tZ)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,y.tZ)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),description:(0,i.__)("Private self-hosted audio block.","presto-player"),attributes:{visibility:"private"}}]:[])),icon:(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"presto-block-icon"},(0,y.tZ)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})),edit:st}},6183:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n,o=r(4942),a={attributes:(n={visibility:{type:String,default:"public"},color:{type:String,default:"#00b3ff"},blockAlignment:{type:String},mutedPreview:{type:Object,default:{enabled:!1,captions:!1}},mutedOverlay:{type:Object,default:{enabled:!1,src:"",width:200,focalPoint:{x:.5,y:.5}}},mutedPreviewCaptions:{type:Boolean},mutedOverlayType:{type:String,default:"text"},mutedOverlayText:{type:String,default:"Click to play"},mutedOverlaySrc:{type:String},mutedOverlayImageWidth:{type:Number,default:200},mutedOverlayFocalPoint:{type:Object}},(0,o.Z)(n,"mutedOverlay",{type:Object,default:{enabled:!1,type:"text",text:"",src:"",width:200,focalPoint:{x:.5,y:.5}}}),(0,o.Z)(n,"autoplay",{type:Boolean}),(0,o.Z)(n,"preload",{type:String}),(0,o.Z)(n,"playsInline",{type:Boolean,default:!0}),(0,o.Z)(n,"id",{type:Number}),(0,o.Z)(n,"attachment_id",{type:Number}),(0,o.Z)(n,"src",{type:String}),(0,o.Z)(n,"imageID",{type:Number}),(0,o.Z)(n,"poster",{type:String}),(0,o.Z)(n,"content",{type:Boolean}),(0,o.Z)(n,"preset",{type:Number}),(0,o.Z)(n,"chapters",{type:Array,default:[]}),(0,o.Z)(n,"overlays",{type:Array,default:[]}),(0,o.Z)(n,"tracks",{type:"array",items:{type:"object"},default:[]}),n),category:"presto",supports:{align:!0,inserter:!1},save:function(){return null}}},6849:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return po},options:function(){return fo}});var n={};r.r(n),r.d(n,{collections:function(){return ne},currentCollection:function(){return ce},errors:function(){return le},isLoading:function(){return ie},isPrivate:function(){return ae},requestType:function(){return pe},ui:function(){return ue},uploads:function(){return oe},videos:function(){return re},videosFetched:function(){return se}});var o={};r.r(o),r.d(o,{addCollection:function(){return he},addError:function(){return Pe},addUploads:function(){return we},addVideos:function(){return fe},removeError:function(){return Oe},removeUpload:function(){return _e},removeVideo:function(){return ye},setCollectionRequest:function(){return be},setCollections:function(){return ve},setIsPrivate:function(){return me},setLoading:function(){return xe},setSearch:function(){return ge},setUI:function(){return Ce},setUploads:function(){return Ze},setVideos:function(){return de},setVideosFetched:function(){return ke}});var a=r(4942),i=r(9307),l=r(5861),s=r(3324),c=r(1284),u=r.n(c),p=r(5609),d=r(2175),f=r(5736),y=r(4333),v=r(9818),h=function(){var e=(0,l.Z)(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/sign",method:"POST",data:{url:t,id:0}});case 4:return r=e.sent,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),m=r(2485),g=r(8989),b=r(9235);function Z(e){var t=e.file,r=e.path,n=e.onProgress,o=e.onComplete,a=e.onError,i=0,s=!1,c=Math.min(prestoPlayerAdmin.wp_max_upload_size-1e6,159e5),p=Math.max(c,19e5);p=Math.min(p,104857600);var d=function(){var e=(0,l.Z)(u().mark((function e(l){var c,f,y,v,h;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=l+p+1,f=t.slice(l,c),y=Math.ceil(t.size/(p+1)),i++,n(i/y*100),(v=new FormData).append("file",f),v.append("name",t.name),v.append("chunk",i),v.append("chunks",y),e.prev=10,e.next=13,wp.apiFetch({path:r,method:"POST",body:v});case 13:if(h=e.sent,!s){e.next=17;break}return console.log("cancelled"),e.abrupt("return");case 17:c<t.size?(n(void 0),d(c)):o(h),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(10),a(e.t0),console.error(e.t0);case 24:case"end":return e.stop()}}),e,null,[[10,20]])})));return function(_x){return e.apply(this,arguments)}}();return i=0,new FileReader,d(0),{cancel:function(){s=!0}}}var w,_,k=r(168),x=r(917),C=function(e){var t,r=e.item,n=e.onClick,o=e.className,i=function(){return!(null==r||!r.encodeProgress)&&100!==r.encodeProgress};return(0,x.tZ)("div",{className:"presto-player__media-list-item ".concat(o),onClick:n},(0,x.tZ)("div",{className:"presto-player__media-list-item-icon"},(0,x.tZ)("svg",(0,a.Z)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},"strokeLinecap","round"),(0,x.tZ)("polygon",{points:"23 7 16 12 23 17 23 7"}),(0,x.tZ)("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"}))),(0,x.tZ)("div",{className:"presto-player__media-list-item-title"},null==r?void 0:r.title),i()&&(0,x.tZ)("div",{className:"presto-player__media-list-item-size"},"Encoding..."),!i()&&(0,x.tZ)("div",{className:"presto-player__media-list-item-size"},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}(null==r?void 0:r.size)),!i()&&(0,x.tZ)("div",{className:"presto-player__media-list-item-modified"},(t=r.updated_at,new Date(t).toLocaleString())))},P=function(e){var t,r=e.item,n=e.onClick,o=e.className;return(0,x.tZ)("div",{className:"presto-player__media-list-item ".concat(o),onClick:n},(0,x.tZ)("div",{className:"presto-player__media-list-item-icon"},(0,x.tZ)("svg",(0,a.Z)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},"strokeLinecap","round"),(0,x.tZ)("polygon",{points:"23 7 16 12 23 17 23 7"}),(0,x.tZ)("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"}))),(0,x.tZ)("div",{className:"presto-player__media-list-item-title"},null==r?void 0:r.title),(0,x.tZ)("div",{className:"presto-player__media-list-item-size"},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}(null==r?void 0:r.size)),(0,x.tZ)("div",{className:"presto-player__media-list-item-modified"},(t=r.updated_at,new Date(t).toLocaleString())))},O=r(7453),__=wp.i18n.__,S=wp.components,E=S.Modal,$=S.Spinner,N=S.Button,T=S.BaseControl,A=S.Flex,j=S.FlexBlock,R=S.Notice,I=S.Card,L=S.CardBody,B=S.Disabled,D=S.DropZone,M=S.FormFileUpload,F=S.DropZoneProvider,V=wp.element,U=V.useEffect,z=V.useState,G=V.useRef,H=function(e){var t=e.onClose,r=e.title,n=e.header,o=e.onLoad,a=e.items,i=e.folders,l=e.fetching,c=e.progressMessage,u=e.onSelect,p=e.error,d=e.onDelete,f=e.onUpload,y=e.progress,v=z({}),h=(0,s.Z)(v,2),m=h[0],g=h[1],b=z(!1),Z=(0,s.Z)(b,2),x=Z[0],S=Z[1],V=G();U((function(){o&&o()}),[]);var H,W,q,Y,X=function(){return Object.keys(m||{}).length};return(0,O.tZ)(E,{isFullScreen:!0,title:n||__("Add Media","presto-player"),onRequestClose:t,className:"presto-player__media-modal presto-player__full-modal",overlayClassName:"presto-player__modal-overlay"},(0,O.tZ)("div",{className:"presto-player__media-modal-layout","data-cy":"media-modal"},(0,O.tZ)("div",{className:"presto-player__media-modal-header"},(0,O.tZ)("div",{className:"presto-player__media-modal-upload",css:(0,O.iv)(w||(w=(0,k.Z)(["\n display: flex;\n align-items: center;\n "])))},(0,O.tZ)(M,{isPrimary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(f(e.target.files),jQuery(e.target).val(null))}},__("Upload New Video","presto-player")),(0,O.tZ)("div",{css:(0,O.iv)(_||(_=(0,k.Z)(["\n margin-left: 10px;\n "])))},__("Or drag a file here to upload.","presto-player"))),p&&(0,O.tZ)(R,{status:"error",isDismissible:!1},p)),(0,O.tZ)("div",{className:"presto-player__media-modal-content"},(0,O.tZ)(F,null,l?(0,O.tZ)(A,{className:"presto-player__media-loading"},(0,O.tZ)(j,{style:{textAlign:"center"}},y?(0,O.tZ)(React.Fragment,null,(0,O.tZ)("div",null,(0,O.tZ)("strong",null,c||__("Uploading","presto-player"))),(0,O.tZ)("div",null,__("Please don't navigate away from this page.","presto-player")),(0,O.tZ)("progress",{className:"presto-progress",max:"100",value:y,style:{width:"100px"}})):(0,O.tZ)($,null))):null!=a&&a.length?(0,O.tZ)("div",{className:"presto-player__media-list"},(0,O.tZ)("h2",null,r),i&&(0,O.tZ)("div",{className:"presto-player__media-list-folders"},i.map((function(e){return(0,O.tZ)(P,{key:e.id,item:e})}))),(0,O.tZ)("div",{className:"presto-player__media-list-items"},a.map((function(e){return(0,O.tZ)(C,{item:e,key:e.id,onClick:function(){g(m===e?{}:e)},className:m===e?"is-selected":""})})))):(0,O.tZ)(A,{"align-items":"center",className:"presto-player__media-not-found"},(0,O.tZ)("div",null,(0,O.tZ)("h2",null,"Drop video files here to upload"),(0,O.tZ)("p",null,"or browse for a video"),(0,O.tZ)(M,{isSecondary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(f(e.target.files),jQuery(e.target).val(null))}},__("Upload New Video","presto-player")))),(0,O.tZ)(D,{label:"Drop files",onFilesDrop:f}))),(0,O.tZ)("div",{className:"presto-player__media-modal-sidebar"},X()?(0,O.tZ)("div",{className:"presto-player__media-modal-sidebar-content"},(0,O.tZ)(T,null,(0,O.tZ)(B,{key:m.id},null!=m&&m.thumbnail?(0,O.tZ)("img",{src:null==m?void 0:m.thumbnail,style:{maxWidth:"100%"}}):(0,O.tZ)("video",{preload:"metadata"},(0,O.tZ)("source",{src:m.previewUrl})))),(0,O.tZ)(T,null,(0,O.tZ)(T.VisualLabel,null,__("Name","presto-player")),(0,O.tZ)("h3",{style:{marginTop:"5px"}},m.title)),!(null==m||!m.visibility)&&(0,O.tZ)(T,null,(0,O.tZ)(T.VisualLabel,null,__("Visibility","presto-player")),(0,O.tZ)("h3",{style:{marginTop:"5px"}},m.visibility)),(0,O.tZ)(T,null,(0,O.tZ)(T.VisualLabel,null,__("Size","presto-player")),(0,O.tZ)("h3",{style:{marginTop:"5px"}},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}((null==m?void 0:m.size)||0))),(0,O.tZ)(T,null,(0,O.tZ)(T.VisualLabel,null,__("Created","presto-player")),(0,O.tZ)("h3",{style:{marginTop:"5px"}},(H=null==m?void 0:m.created_at,Y=(W=(H=new Date(H)).getHours())>=12?"pm":"am",W=(W%=12)||12,q=(q=H.getMinutes())<10?"0"+q:q,H.getDate()+"-"+(H.getMonth()+1)+"-"+H.getFullYear()+" at "+W+":"+q+Y))),(0,O.tZ)(T,null,x?(0,O.tZ)(I,null,(0,O.tZ)(L,null,(0,O.tZ)("p",null,(0,O.tZ)("strong",null,"Are you sure?")),(0,O.tZ)("p",null,"Are you sure you want to delete this video?"),(0,O.tZ)(N,{isDestructive:!0,onClick:function(){d(m),S(!1)}},"Yes"),(0,O.tZ)(N,{onClick:function(){return S(!1)}},"Cancel"))):(0,O.tZ)(N,{isDestructive:!0,onClick:function(){S(!x)}},__("Delete video","presto-player")))):(0,O.tZ)(React.Fragment,null)),(0,O.tZ)("div",{className:"presto-player__media-modal-footer"},(0,O.tZ)(N,{isPrimary:!0,disabled:!X(),onClick:function(){m&&(u(m),t())},ref:V},__("Choose","presto-player")))))},W=wp.i18n.__,q=wp.element,Y=q.useState,X=q.useEffect,K=function(e){var t=e.closePopup,r=e.noticeOperations,n=e.onSelect,o=e.isPrivate,a=Y([]),i=(0,s.Z)(a,2),c=i[0],p=i[1],d=Y(!1),f=(0,s.Z)(d,2),y=f[0],v=f[1],h=Y(0),m=(0,s.Z)(h,2),g=m[0],b=m[1],w=Y(""),_=(0,s.Z)(w,2),k=_[0],C=_[1],P=Y(""),O=(0,s.Z)(P,2),S=O[0],E=O[1],$=o?"private-videos":"public-videos";X((function(){b(0),E("")}),[]);var N=function(){var e=(0,l.Z)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:E(""),v(!0),C(W("Uploading","presto-player")),Z({file:t[0],path:"presto-player/v1/bunny/upload",onProgress:function(e){b(e-10)},onComplete:T,onError:function(e){E(e.message),b(0),v(!1)}});case 4:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),T=function(){var e=(0,l.Z)(u().mark((function e(t){var r,n,o;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.name,C(W("Storing","presto-player")),e.prev=2,e.next=5,wp.apiFetch({path:"presto-player/v1/bunny/".concat($),method:"POST",data:{path:r,name:n}});case 5:o=e.sent,p(o),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),E(e.t0.message),console.error(e.t0);case 13:return e.prev=13,b(0),v(!1),e.finish(13);case 17:case"end":return e.stop()}}),e,null,[[2,9,13,17]])})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=(0,l.Z)(u().mark((function e(t){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p((c||[]).filter((function(e){return e!==t}))),e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/".concat($),method:"DELETE",data:{name:null==t?void 0:t.title}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),E(e.t0.message);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),j=function(){var e=(0,l.Z)(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,v(!0),e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/".concat($)});case 4:t=e.sent,p(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),E(e.t0.message);case 11:return e.prev=11,v(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])})));return function(){return e.apply(this,arguments)}}();return(0,x.tZ)(H,{onClose:t,progressMessage:k,fetching:y,error:S,onUpload:N,onLoad:j,items:c,progress:g,onDelete:A,onSelect:n,onError:function(e){r.removeAllNotices(),r.createErrorNotice(e)},header:W(o?"Bunny.net Private Video Storage":"Bunny.net Public Video Storage","presto-player"),title:W(o?"Private Video Library":"Public Video Library","presto-player")})},Q=r(2982);function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var te=(0,wp.data.combineReducers)({videosReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_VIDEOS":return t.value;case"ADD_VIDEOS":return[].concat((0,Q.Z)(e),(0,Q.Z)(t.value));case"ADD_VIDEO":return[].concat((0,Q.Z)(e),[t.value]);case"UPDATE_VIDEO":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:ee(ee({},e),t.value)}));case"REMOVE_VIDEO":return e.filter((function(e){return e.guid!==t.value.guid}))}return e},collectionsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_COLLECTIONS":return t.value;case"ADD_COLLECTION":return[].concat((0,Q.Z)(e),[t.value]);case"UPDATE_COLLECTION":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:ee(ee({},e),t.value)}));case"REMOVE_COLLECTION":return e.filter((function(e){return e!==t.value}))}return e},uploadsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_UPLOADS":return t.value;case"ADD_UPLOADS":return[].concat((0,Q.Z)(e),(0,Q.Z)(t.value));case"ADD_UPLOAD":return[].concat((0,Q.Z)(e),[t.value]);case"UPDATE_UPLOAD":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:ee(ee({},e),t.value)}));case"REMOVE_UPLOAD":return e.filter((function(e){return e!==t.value}))}return e},requestReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{private:!1,collection:"",search:""},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRIVATE_REQUEST":return ee(ee({},e),{},{private:t.value});case"SET_SEARCH_REQUEST":return ee(ee({},e),{},{search:t.value});case"SET_COLLECTION_REQUEST":return ee(ee({},e),{},{collection:t.value})}return e},UIReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,videosFetched:!1,createCollection:!1,selectedId:null},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_LOADING":return ee(ee({},e),{},{loading:t.value});case"SET_VIDEOS_FETCHED":return ee(ee({},e),{},{videosFetched:t.value});case"SET_UI_ITEM":return ee(ee({},e),{},(0,a.Z)({},t.item,t.value))}return e},errorReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_ERROR":return[].concat((0,Q.Z)(e),[t.value]);case"REMOVE_ERROR":return e.filter((function(e){return e!==t.value}))}return e}});function re(e){return(null==e?void 0:e.videosReducer)||[]}function ne(e){return(null==e?void 0:e.collectionsReducer)||[]}function oe(e){return(null==e?void 0:e.uploadsReducer)||[]}function ae(e){var t;return!(null==e||null===(t=e.requestReducer)||void 0===t||!t.private)}function ie(e){var t;return(null==e||null===(t=e.UIReducer)||void 0===t?void 0:t.loading)||!1}function le(e){return(null==e?void 0:e.errorReducer)||[]}function se(e){var t;return(null==e||null===(t=e.UIReducer)||void 0===t?void 0:t.videosFetched)||!1}function ce(e){var t;return null==e||null===(t=e.requestReducer)||void 0===t?void 0:t.collection}function ue(e,t){var r;return null==e||null===(r=e.UIReducer)||void 0===r?void 0:r[t]}function pe(e){var t;return null!=e&&null!==(t=e.requestReducer)&&void 0!==t&&t.private?"private":"public"}function de(e){return{type:"SET_VIDEOS",value:e}}function fe(e){return{type:"ADD_VIDEOS",value:e}}function ye(e){return{type:"REMOVE_VIDEO",value:e}}function ve(e){return{type:"SET_COLLECTIONS",value:e}}function he(e){return{type:"ADD_COLLECTION",value:e}}function me(e){return{type:"SET_PRIVATE_REQUEST",value:e}}function ge(e){return{type:"SET_SEARCH",value:e}}function be(e){return{type:"SET_COLLECTION_REQUEST",value:e}}function Ze(e){return{type:"SET_UPLOADS",value:e}}function we(e){return{type:"ADD_UPLOADS",value:e}}function _e(e){return{type:"REMOVE_UPLOAD",value:e}}function ke(e){return{type:"SET_VIDEOS_FETCHED",value:e}}function xe(e){return{type:"SET_LOADING",value:e}}function Ce(e,t){return{type:"SET_UI_ITEM",item:e,value:t}}function Pe(e){return{type:"ADD_ERROR",value:e}}function Oe(e){return{type:"REMOVE_ERROR",value:e}}(0,wp.data.registerStore)("presto-player/bunny-popup",{reducer:te,selectors:n,actions:o});var Se,Ee,$e,Ne,Te,Ae,je,Re,Ie,Le,Be,De,Me,Fe,Ve,Ue,ze,Ge,He,We,qe,Ye=function(e){return 3==(null==e?void 0:e.status)&&(null==e?void 0:e.availableResolutions.length)},Xe=function(e){return Ye(e)||4===(null==e?void 0:e.status)},Ke=function(e){return 0==(null==e?void 0:e.status)?"Processing":1==(null==e?void 0:e.status)?"Uploaded":2==(null==e?void 0:e.status)?"Processing":Ye(e)?"Playable":3==(null==e?void 0:e.status)?"Encoding":4==(null==e?void 0:e.status)?"Live":5==(null==e?void 0:e.status)?"Error":6==(null==e?void 0:e.status)?"Upload Failed":void 0},Qe=function(e){return null==e||null==e?"":new Date(1e3*e).toISOString().substr(11,8)},Je=function(e){if(null==e||0==e)return"Unknown";if(0==e)return"0 b";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)).toString());return(e/Math.pow(1024,t)).toFixed(2)+" "+["b","KB","MB","GB","TB"][t]},et=wp.i18n.__,tt=wp.components,rt=tt.Button,nt=tt.BaseControl,ot=tt.Disabled,at=tt.Card,it=tt.CardBody,lt=wp.element,st=lt.useState,ct=(lt.useContext,lt.useEffect),ut=wp.data,pt=ut.dispatch,dt=ut.useSelect,ft={name:"qhxz92",styles:"max-width:100%"},yt=function(){var e=st(!1),t=(0,s.Z)(e,2),r=t[0],n=t[1],o=st(!1),a=(0,s.Z)(o,2),i=a[0],c=a[1],p=st(null),d=(0,s.Z)(p,2),f=d[0],y=d[1],v=dt((function(e){return e("presto-player/bunny-popup").isPrivate()})),h=dt((function(e){return e("presto-player/bunny-popup").ui("selectedId")})),m=dt((function(e){return e("presto-player/bunny-popup").videos()}));ct((function(){y(h?m.find((function(e){return e.guid===h})):null)}),[m,h]);var g=function(){var e=(0,l.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:"presto-player/v1/bunny/stream/videos/".concat(f.id),method:"DELETE",data:{type:v?"private":"public"}});case 2:pt("presto-player/bunny-popup").removeVideo(f),pt("presto-player/bunny-popup").setUI("selectedId",null),c(!1),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),b=(0,O.iv)(Se||(Se=(0,k.Z)(["\n margin-top: 5px;\n "])));if(!f)return"";var Z,w,_,x,C=function(e){return v?null==e?void 0:e.webPURLSigned:null==e?void 0:e.webPURL};return f&&(0,O.tZ)("div",{className:"presto-player__media-modal-sidebar-content"},(0,O.tZ)(nt,{css:(0,O.iv)(Ee||(Ee=(0,k.Z)(["\n position: relative;\n "])))},(0,O.tZ)(ot,{key:f.id},Xe(f)&&C(f)&&(0,O.tZ)("img",{src:C(f),css:ft})),(0,O.tZ)(rt,{isSmall:!0,isPrimary:!0,isBusy:!Xe(f),css:(0,O.iv)($e||($e=(0,k.Z)(["\n ","\n top: 8px;\n right: 8px;\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n "])),Xe(f)?"position: absolute;":"")},Ke(f))),(0,O.tZ)(nt,null,(0,O.tZ)(nt.VisualLabel,null,et("Name","presto-player")),(0,O.tZ)("h3",{css:b},f.title)),!(null==f||!f.visibility)&&(0,O.tZ)(nt,null,(0,O.tZ)(nt.VisualLabel,null,et("Visibility","presto-player")),(0,O.tZ)("h3",{css:b},f.visibility)),(0,O.tZ)(nt,null,(0,O.tZ)(nt.VisualLabel,null,et("Size","presto-player")),(0,O.tZ)("h3",{css:b},Je((null==f?void 0:f.size)||0))),(0,O.tZ)(nt,null,(0,O.tZ)(nt.VisualLabel,null,et("Length","presto-player")),(0,O.tZ)("h3",{css:b},Qe(null==f?void 0:f.length))),(0,O.tZ)(nt,null,(0,O.tZ)(nt.VisualLabel,null,et("Created","presto-player")),(0,O.tZ)("h3",{css:b},(Z=null==f?void 0:f.created_at,x=(w=(Z=new Date(Z)).getHours())>=12?"pm":"am",w=(w%=12)||12,_=(_=Z.getMinutes())<10?"0"+_:_,Z.getDate()+"-"+(Z.getMonth()+1)+"-"+Z.getFullYear()+" at "+w+":"+_+x))),(0,O.tZ)(nt,null,r?(0,O.tZ)(at,null,(0,O.tZ)(it,null,(0,O.tZ)("p",null,(0,O.tZ)("strong",null,et("Are you sure?","presto-player"))),(0,O.tZ)("p",null,et("Are you sure you want to delete this video?","presto-player")),(0,O.tZ)(rt,{isDestructive:!0,disabled:i,isBusy:i,onClick:function(e){e.preventDefault(),g(),c(!0)}},et("Yes","presto-player")),(0,O.tZ)(rt,{onClick:function(){return n(!1)}},et("Cancel","presto-player")))):(0,O.tZ)(rt,{isDestructive:!0,onClick:function(){n(!r)}},et("Delete video","presto-player"))))},vt=function(e){var t=e.className,r=e.progress;return(0,O.tZ)("div",{className:t},(0,O.tZ)("div",{css:(0,O.iv)(Ne||(Ne=(0,k.Z)(["\n height: 100%;\n background-color: var(--wp-admin-theme-color, #007cba);\n "]))),style:{width:"".concat(r,"%")}}))},ht=function(e){var t=e.progress;return(0,O.tZ)("div",{css:(0,O.iv)(Te||(Te=(0,k.Z)(["\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n background-color: #222;\n color: white;\n text-decoration: none;\n text-align: center;\n box-sizing: border-box;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n "])))},(0,O.tZ)(vt,{progress:t,css:(0,O.iv)(Ae||(Ae=(0,k.Z)(["\n width: 100%;\n border-radius: 0px;\n margin: 0 15px;\n background-color: #e3e3e3;\n height: 3px;\n "])))}))},mt=r(7462),gt=function(e){var t=e.thumbnail,r=e.title,n=e.footer,o=e.badge,a=e.before,i=e.after;return(0,O.tZ)("div",(0,mt.Z)({className:"presto-player__video-thumb",css:(0,O.iv)(je||(je=(0,k.Z)(["\n cursor: pointer;\n user-select: none;\n display: inline-block;\n position: relative;\n margin-right: 20px;\n font-weight: bold;\n margin-bottom: 20px;\n width: 220px;\n flex: 0 0 220px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n overflow: hidden;\n "])))},e),!!a&&a,!!t&&t,(0,O.tZ)("div",{css:(0,O.iv)(Re||(Re=(0,k.Z)(["\n margin: 14px;\n "])))},!!o&&(0,O.tZ)("div",{css:(0,O.iv)(Ie||(Ie=(0,k.Z)(["\n position: absolute;\n top: 8px;\n right: 8px;\n "])))},o),!!r&&(0,O.tZ)("span",{css:(0,O.iv)(Le||(Le=(0,k.Z)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n max-width: 100%;\n display: inline-block;\n margin-bottom: 7px;\n font-size: 13px;\n "])))},r),!!n&&(0,O.tZ)("div",{css:(0,O.iv)(Be||(Be=(0,k.Z)(["\n font-size: 12px;\n opacity: 0.75;\n margin-bottom: 7px;\n "])))},n)),!!i&&i)},bt=wp.components,Zt=bt.Icon,wt=bt.Button,_t=wp.element,kt=_t.useEffect,xt=_t.useState,Ct=wp.data,Pt=Ct.useSelect,Ot=Ct.dispatch,St=function(e){var t=e.video,r=xt(),n=(0,s.Z)(r,2),o=n[0],a=n[1],i=Pt((function(e){return e("presto-player/bunny-popup").isPrivate()})),l=Pt((function(e){return e("presto-player/bunny-popup").ui("selectedId")}));return kt((function(){a(l?l===t.guid:null)}),[l]),(0,O.tZ)(gt,{onClick:function(){Ot("presto-player/bunny-popup").setUI("selectedId",null==t?void 0:t.guid)},css:(0,O.iv)(He||(He=(0,k.Z)(["\n ","\n border: 1px solid\n ",";\n "])),o&&"box-shadow: 0 0 0 0px #fff, 0 0 0 3px var(--wp-admin-theme-color, #007cba);",o?"var(--wp-admin-theme-color, #007cba)":"#e0e0e0"),thumbnail:function(){if(t.status<3)return(0,O.tZ)(ht,{progress:t.encodeProgress});var e=i?null==t?void 0:t.thumbnailURLSigned:null==t?void 0:t.thumbnailURL;return e?(0,O.tZ)("img",{css:(0,O.iv)(Me||(Me=(0,k.Z)(["\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n display: block;\n "]))),src:e}):void 0}(),badge:(0,O.tZ)(wt,{isSmall:!0,isPrimary:!0,isBusy:!Xe(t),css:(0,O.iv)(De||(De=(0,k.Z)(["\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n "])))},Ke(t)),title:t.title,footer:(0,O.tZ)("div",{css:(0,O.iv)(Fe||(Fe=(0,k.Z)(["\n display: flex;\n align-items: center;\n "])))},(0,O.tZ)("span",{css:(0,O.iv)(Ve||(Ve=(0,k.Z)(["\n margin-right: 10px;\n display: flex;\n align-items: center;\n "])))},(0,O.tZ)(Zt,{css:(0,O.iv)(Ue||(Ue=(0,k.Z)(["\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n opacity: 0.5;\n "]))),icon:"clock",size:14}),(0,O.tZ)("span",null,Qe(t.length))),(0,O.tZ)("span",{css:(0,O.iv)(ze||(ze=(0,k.Z)(["\n display: flex;\n align-items: center;\n "])))},(0,O.tZ)(Zt,{css:(0,O.iv)(Ge||(Ge=(0,k.Z)(["\n opacity: 0.5;\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n "]))),icon:"database",size:14}),(0,O.tZ)("span",null,Je(t.storageSize)))),after:3===t.status?(0,O.tZ)(vt,{css:(0,O.iv)(We||(We=(0,k.Z)(["\n width: 100%;\n border-radius: 0px;\n margin: 0;\n background-color: #e3e3e3;\n height: 3px;\n "]))),progress:t.encodeProgress}):""})},Et=wp.components,$t=Et.Flex,Nt=Et.FlexBlock,Tt=Et.Spinner,At={name:"1azakc",styles:"text-align:center"},jt=function(e){var t=e.className;return(0,O.tZ)($t,{className:t},(0,O.tZ)(Nt,{css:At},(0,O.tZ)(Tt,null)))};function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function It(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Lt,Bt,Dt,Mt,Ft,Vt,Ut,zt,Gt,Ht,Wt=wp.i18n.__,qt=wp.element,Yt=qt.useState,Xt=qt.useEffect,Kt=qt.Fragment,Qt=wp.components,Jt=Qt.Flex,er=Qt.FormFileUpload,tr=Qt.Notice,rr=wp.data,nr=rr.dispatch,or=rr.useSelect,ar={name:"s5xdrg",styles:"display:flex;align-items:center"},ir={name:"82a6rk",styles:"flex:1"},lr={name:"82a6rk",styles:"flex:1"},sr=function(){var e=Yt(!1),t=(0,s.Z)(e,2),r=t[0],n=t[1],o=Yt(""),a=(0,s.Z)(o,2),i=a[0],c=a[1],p=or((function(e){return e("presto-player/bunny-popup").videosFetched()})),d=or((function(e){return e("presto-player/bunny-popup").videos()})),f=or((function(e){return e("presto-player/bunny-popup").requestType()})),y=or((function(e){return e("presto-player/bunny-popup").currentCollection()}));Xt((function(){p||v()}),[p]),Xt((function(){var e=setInterval((function(){v({sync:!0})}),3e3);return function(){return clearInterval(e)}}),[p]);var v=function(){var e=(0,l.Z)(u().mark((function e(){var t,r,n,o,a=arguments;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{sync:!1},r=t.sync,e.prev=1,e.next=4,wp.apiFetch({path:wp.url.addQueryArgs("presto-player/v1/bunny/stream/videos",It(It({type:f},null!=y&&y.guid?{collection:null==y?void 0:y.guid}:{}),{},{items_per_page:500}))});case 4:n=e.sent,nr("presto-player/bunny-popup").setVideos(null==n?void 0:n.items),c(""),e.next=15;break;case 9:if(e.prev=9,e.t0=e.catch(1),401!==(null===e.t0||void 0===e.t0||null===(o=e.t0.data)||void 0===o?void 0:o.status)){e.next=14;break}return c(Wt("Please wait. Pullzone cache is clearing. This may take a minute or two...")),e.abrupt("return");case 14:r||nr("presto-player/bunny-popup").addError(e.t0.message);case 15:return e.prev=15,nr("presto-player/bunny-popup").setVideosFetched(!0),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,9,15,18]])})));return function(){return e.apply(this,arguments)}}();return i?(0,O.tZ)(tr,{status:"warning",isDismissible:!1},(0,O.tZ)("div",{css:ar},(0,O.tZ)(jt,{css:ir}),i)):p?(0,O.tZ)(Kt,null,d&&d.length?(0,O.tZ)("div",null,!(null!=y&&y.guid)&&(0,O.tZ)("h2",null,Wt("Videos","presto-player")),d.map((function(e){if((null==e?void 0:e.collectionId)===((null==y?void 0:y.guid)||""))return(0,O.tZ)(St,{key:e.id,video:e,onClick:function(){n(r.guid===e.guid?{}:e)},selected:r.guid===e.guid})}))):(0,O.tZ)(Jt,{align:"center",justify:"center",css:(0,O.iv)(qe||(qe=(0,k.Z)(["\n height: 100%;\n text-align: center;\n "])))},(0,O.tZ)("div",null,(0,O.tZ)("h2",null,Wt("Drop video files here to upload","presto-player")),(0,O.tZ)("p",null,Wt("or browse for a video","presto-player")),(0,O.tZ)(er,{isSecondary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(nr("presto-player/bunny-popup").addUploads(e.target.files),jQuery(e.target).val(null))}},Wt("Upload New Video","presto-player"))))):(0,O.tZ)(jt,{css:lr})},cr=wp.components.Icon,ur=wp.data.dispatch,pr=function(e){var t=e.collection;return(0,O.tZ)(gt,{onClick:function(e){e.preventDefault(),ur("presto-player/bunny-popup").setCollectionRequest(t),ur("presto-player/bunny-popup").setVideosFetched(!1)},title:(0,O.tZ)("div",null,(0,O.tZ)(cr,{icon:"open-folder",css:(0,O.iv)(Lt||(Lt=(0,k.Z)(["\n color: var(--wp-admin-theme-color);\n margin-right: 10px;\n "])))}),t.name),footer:(0,O.tZ)("div",null,t.videoCount," Videos")})},dr=wp.i18n.__,fr=wp.element.useEffect,yr=wp.data,vr=yr.useSelect,hr=yr.dispatch,mr=function(){var e=vr((function(e){return e("presto-player/bunny-popup").collections()})),t=vr((function(e){return e("presto-player/bunny-popup").requestType()})),r=function(){var e=(0,l.Z)(u().mark((function e(){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:wp.url.addQueryArgs("presto-player/v1/bunny/stream/collections",{type:t,items_per_page:500})});case 3:r=e.sent,hr("presto-player/bunny-popup").setCollections(null==r?void 0:r.items),e.next=12;break;case 7:if(e.prev=7,e.t0=e.catch(0),401!==(null===e.t0||void 0===e.t0||null===(n=e.t0.data)||void 0===n?void 0:n.status)){e.next=11;break}return e.abrupt("return");case 11:hr("presto-player/bunny-popup").addError(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();return fr((function(){r()}),[]),!!e.length&&(0,O.tZ)("div",null,(0,O.tZ)("h2",null,dr("Collections","presto-player")),(0,O.tZ)("div",{css:(0,O.iv)(Bt||(Bt=(0,k.Z)(["\n display: flex;\n align-items: stretch;\n overflow: auto;\n "])))},e.map((function(e){return(0,O.tZ)(pr,{collection:e,key:e.guid})}))))},gr=wp.i18n.__,br=wp.components,Zr=br.Button,wr=br.TextControl,_r=br.Modal,kr=br.BaseControl,xr=wp.element,Cr=xr.useState,Pr=xr.Fragment,Or=wp.data,Sr=Or.dispatch,Er=Or.useSelect,$r=function(){var e=Cr(""),t=(0,s.Z)(e,2),r=t[0],n=t[1],o=Cr(!1),a=(0,s.Z)(o,2),i=a[0],c=a[1],p=Er((function(e){return e("presto-player/bunny-popup").requestType()})),d=Er((function(e){return e("presto-player/bunny-popup").ui("createCollection")})),f=function(e){Sr("presto-player/bunny-popup").setUI("createCollection",e)},y=function(){var e=(0,l.Z)(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/stream/collections",method:"POST",data:{type:p,name:r}});case 4:t=e.sent,Sr("presto-player/bunny-popup").addCollection(t),Sr("presto-player/bunny-popup").setCollectionRequest(t),Sr("presto-player/bunny-popup").setVideosFetched(!1),n(""),f(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),console.error(e.t0);case 15:return e.prev=15,c(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return function(){return e.apply(this,arguments)}}();return(0,O.tZ)(Pr,null,(0,O.tZ)(Zr,{isSecondary:!0,onClick:function(){return f(!0)}},gr("Create Collection","presto-player")),d&&(0,O.tZ)(_r,{overlayClassName:"presto-modal",title:"Create New Collection",shouldCloseOnClickOutside:!1,isDismissible:!1},(0,O.tZ)(wr,{css:(0,O.iv)(Dt||(Dt=(0,k.Z)(["\n margin-bottom: 15px;\n "]))),tabIndex:"0",placeholder:gr("Enter a collection name","presto-player"),value:r,onChange:function(e){return n(e)}}),(0,O.tZ)(kr,null,(0,O.tZ)(Zr,{isBusy:i,disabled:i,isPrimary:!0,onClick:function(){y()}},gr("Create","presto-player"))," ",(0,O.tZ)(Zr,{onClick:function(){return f(!1)}},gr("Cancel","presto-player")))))},Nr=wp.i18n.__,Tr=wp.components,Ar=Tr.Flex,jr=Tr.FlexBlock,Rr=Tr.FlexItem,Ir=(Tr.Button,Tr.FormFileUpload),Lr=wp.data.dispatch,Br=function(e){var t=e.afterUpload;return(0,O.tZ)(Ar,null,(0,O.tZ)(jr,null,(0,O.tZ)(Ar,{justify:"flex-start"},(0,O.tZ)(Ir,{multiple:!0,isPrimary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(Lr("presto-player/bunny-popup").addUploads(e.target.files),jQuery(e.target).val(null))}},Nr("Upload Videos","presto-player"))," ",(0,O.tZ)($r,null),!!t&&t)),(0,O.tZ)(Rr,null))},Dr=wp.i18n.__,Mr=wp.components.Button,Fr=wp.element,Vr=Fr.useState,Ur=Fr.useEffect,zr=wp.data.useSelect,Gr=function(e){var t=e.onChoose,r=Vr(null),n=(0,s.Z)(r,2),o=n[0],a=n[1],i=Vr(!1),l=(0,s.Z)(i,2),c=l[0],u=l[1],p=zr((function(e){return e("presto-player/bunny-popup").ui("selectedId")})),d=zr((function(e){return e("presto-player/bunny-popup").videos()}));return Ur((function(){a(p?d.find((function(e){return e.guid===p})):null)}),[d,p]),Ur((function(){3==(null==o?void 0:o.status)&&null!=o&&o.availableResolutions.length?u(!0):u((null==o?void 0:o.status)>3&&(null==o?void 0:o.status)<5)}),[null==o?void 0:o.availableResolutions]),(0,x.tZ)(Mr,{isPrimary:!0,disabled:!c,onClick:function(){return t(o)}},null!=o&&o.id&&!c?Dr("Please wait, video is encoding...","presto-player"):Dr("Choose","presto-player"))},Hr=wp.components.Icon,Wr=function(e){var t=e.children,r=e.onClick;return(0,O.tZ)("span",{onClick:r,css:(0,O.iv)(Mt||(Mt=(0,k.Z)(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n color: var(--wp-admin-theme-color, #007cba);\n padding: 6px 0;\n "])))},(0,O.tZ)(Hr,{css:(0,O.iv)(Ft||(Ft=(0,k.Z)(["\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n "]))),icon:"arrow-left-alt",size:14}),(0,O.tZ)("span",null,t))},qr=wp.i18n.__,Yr=wp.element.useState,Xr=wp.data,Kr=Xr.dispatch,Qr=Xr.useSelect,Jr=wp.components,en=Jr.Button,tn=Jr.Modal,rn=Jr.BaseControl,nn=function(){var e=Yr(!1),t=(0,s.Z)(e,2),r=t[0],n=t[1],o=Yr(!1),a=(0,s.Z)(o,2),i=a[0],c=a[1],p=Yr(""),d=(0,s.Z)(p,2),f=(d[0],d[1],Qr((function(e){return e("presto-player/bunny-popup").currentCollection()}))),y=Qr((function(e){return e("presto-player/bunny-popup").requestType()})),v=function(){var e=(0,l.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/stream/collections/".concat(null==f?void 0:f.guid),method:"DELETE",data:{type:y}});case 4:n(!1),Kr("presto-player/bunny-popup").setCollectionRequest(""),Kr("presto-player/bunny-popup").setVideosFetched(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),n(!1),Kr("presto-player/bunny-popup").addError(e.t0.message);case 13:return e.prev=13,c(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,9,13,16]])})));return function(){return e.apply(this,arguments)}}();return(0,O.tZ)("div",{css:(0,O.iv)(Vt||(Vt=(0,k.Z)(["\n margin-bottom: 2em;\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},(0,O.tZ)("div",null,(0,O.tZ)(Wr,{onClick:function(){Kr("presto-player/bunny-popup").setCollectionRequest(""),Kr("presto-player/bunny-popup").setVideosFetched(!1)}},qr("Back To Main Folder","presto-player")),(0,O.tZ)("h2",null,f.name)),(0,O.tZ)(en,{isDestructive:!0,onClick:function(){return n(!0)}},qr("Delete Collection","presto-player")),r&&(0,O.tZ)(tn,{shouldCloseOnClickOutside:!1,overlayClassName:"presto-modal",title:"Delete Collection",onRequestClose:function(){return n(!1)}},(0,O.tZ)("h2",null,qr("Are you sure you want to delete the collection? ","presto-player")),(0,O.tZ)("p",null,qr("This will also delete all videos inside of the collection.","presto-player")),(0,O.tZ)(rn,null,(0,O.tZ)(en,{isDestructive:!0,disabled:i,isBusy:i,onClick:v},qr("Delete","presto-player"))," ",(0,O.tZ)(en,{onClick:function(){return n(!1)}},qr("Cancel","presto-player")))))};function on(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?on(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):on(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}wp.components.Icon;var ln,sn,cn,un,pn,dn,fn,yn,vn,hn,mn,gn,bn,Zn=wp.element,wn=Zn.useState,kn=Zn.useEffect,xn=(Zn.useContext,wp.data),Cn=xn.useSelect,Pn=(xn.dispatch,wp.i18n.__),On=function(e){var t,r=e.file,n=e.name,o=e.onComplete,a=wn(0),i=(0,s.Z)(a,2),c=i[0],p=i[1],d=wn(Pn("Uploading","presto-player")),f=(0,s.Z)(d,2),y=(f[0],f[1]),v=wn(""),h=(0,s.Z)(v,2),m=h[0],g=h[1],b=wn(!1),w=(0,s.Z)(b,2),_=w[0],x=w[1],C=Cn((function(e){return e("presto-player/bunny-popup").requestType()})),P=Cn((function(e){return e("presto-player/bunny-popup").currentCollection()})),S=function(){var e=(0,l.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y(Pn("Uploading","presto-player")),t=Z({file:null!=r&&r[0]?null==r?void 0:r[0]:r,path:"presto-player/v1/bunny/stream/upload",onProgress:function(e){p(e)},onComplete:E,onError:function(e){g(e.message),y(Pn("Error","presto-player")),p(0)}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=(0,l.Z)(u().mark((function e(t){var r,n,o;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.name,y(Pn("Creating","presto-player")),e.prev=2,e.next=5,wp.apiFetch({path:"presto-player/v1/bunny/stream/videos",method:"POST",data:an({type:C,name:n},null!=P&&P.guid?{collection:P.guid}:{})});case 5:o=e.sent,x(!0),$({path:r,video:o}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),g(e.t0.message);case 13:return e.prev=13,p(0),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])})));return function(_x){return e.apply(this,arguments)}}(),$=function(){var e=(0,l.Z)(u().mark((function e(t){var r,n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.video,e.next=3,wp.apiFetch({path:"presto-player/v1/bunny/stream/store",method:"POST",data:{type:C,path:r,guid:n.guid}});case 3:o();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return kn((function(){return S(),function(){t&&t.cancel()}}),[]),_?"":(0,O.tZ)("div",{css:(0,O.iv)(Ut||(Ut=(0,k.Z)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n animation: components-button__busy-animation 2500ms infinite linear;\n opacity: 1;\n padding: 6px 12px;\n border-radius: 99999px;\n border: 1px solid #dddddd;\n background-size: 100px 100%;\n background-image: linear-gradient(\n -45deg,\n #ffffff 33%,\n #f3f3f3 33%,\n #f3f3f3 70%,\n #ffffff 70%\n );\n "])))},(0,O.tZ)("div",{css:(0,O.iv)(zt||(zt=(0,k.Z)(["\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n max-width: 150px;\n text-overflow: ellipsis;\n font-weight: bold;\n "])))},!!m&&m,!!n&&n," ",r.name,"..."),(0,O.tZ)("div",{css:(0,O.iv)(Gt||(Gt=(0,k.Z)(["\n display: flex;\n align-items: center;\n "])))},(0,O.tZ)(vt,{css:(0,O.iv)(Ht||(Ht=(0,k.Z)(["\n width: 50px;\n height: 3px;\n margin: 0 5px;\n background: #e3e3e3;\n border-radius: 9999px;\n overflow: hidden;\n "]))),progress:c})))},Sn=wp.data.useSelect,En=function(e){var t=e.removeUpload,r=(e.isPrivate,Sn((function(e){return e("presto-player/bunny-popup").uploads()})));return r.length?(0,O.tZ)("div",{css:(0,O.iv)(ln||(ln=(0,k.Z)(["\n overflow: auto;\n display: flex;\n align-items: center;\n position: relative;\n "])))},r.length&&r.map((function(e){return(0,O.tZ)(On,{css:(0,O.iv)(sn||(sn=(0,k.Z)(["\n margin-right: 0px;\n "]))),file:e,onComplete:function(){return t(e)}})}))):""},$n=wp.i18n.__,Nn=wp.components.Modal,Tn=function(e){var t=e.onClose,r=e.title,n=e.header,o=e.error,a=e.mainContent,i=e.sidebar,l=e.footer;return(0,O.tZ)(Nn,{isFullScreen:!0,title:r||$n("Add Media","presto-player"),onRequestClose:t,css:(0,O.iv)(cn||(cn=(0,k.Z)(["\n .components-modal__header {\n border-bottom: 1px solid #ddd;\n }\n .components-modal__content {\n display: flex;\n flex-direction: column;\n padding: 0;\n\n > :not(.components-modal__header) {\n flex: 1;\n }\n }\n "]))),overlayClassName:"presto-player__modal-overlay"},(0,O.tZ)("div",{css:(0,O.iv)(un||(un=(0,k.Z)(['\n @media screen and (min-width: 780px) {\n height: 100%;\n display: grid;\n flex: 1;\n max-height: calc(100vh - 68px);\n grid-template-columns: 1fr 1fr minmax(0px, 267px);\n grid-template-rows: minmax(50px, auto) 1fr 60px;\n grid-template-areas:\n "header header sidebar"\n "main main sidebar"\n "footer footer footer";\n overflow: hidden;\n }\n ']))),"data-cy":"media-modal"},(0,O.tZ)("div",{css:(0,O.iv)(pn||(pn=(0,k.Z)(["\n grid-area: header;\n padding: 24px 24px 12px 24px;\n "])))},(0,O.tZ)("div",{css:(0,O.iv)(dn||(dn=(0,k.Z)(["\n display: flex;\n align-items: center;\n\n > * {\n margin-right: 10px;\n }\n "])))},n),o),(0,O.tZ)("div",{css:(0,O.iv)(fn||(fn=(0,k.Z)(["\n grid-area: main;\n display: grid;\n overflow: hidden;\n\n .components-drop-zone__provider {\n overflow: hidden;\n display: grid;\n }\n\n .components-drop-zone {\n z-index: 99;\n }\n "])))},a),(0,O.tZ)("div",{css:(0,O.iv)(yn||(yn=(0,k.Z)(["\n display: none;\n grid-area: sidebar;\n padding: 0 16px;\n z-index: 75;\n background: #f3f3f3;\n border-left: 1px solid #ddd;\n overflow: auto;\n\n @media screen and (min-width: 780px) {\n display: block;\n }\n\n .sidebar-content {\n padding: 16px 0;\n }\n "])))},i),(0,O.tZ)("div",{css:(0,O.iv)(vn||(vn=(0,k.Z)(["\n grid-area: footer;\n border-top: 1px solid #ddd;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 8px;\n "])))},l)))},An=wp.i18n.__,jn=wp.components,Rn=(jn.Button,jn.DropZone),In=jn.DropZoneProvider,Ln=jn.Notice,Bn=wp.element,Dn=(Bn.useState,Bn.useEffect),Mn=(Bn.Fragment,wp.data),Fn=Mn.dispatch,Vn=Mn.useSelect,Un=function(e){var t=e.onClose,r=e.onChoose,n=Vn((function(e){return e("presto-player/bunny-popup").isPrivate()})),o=Vn((function(e){return e("presto-player/bunny-popup").uploads()})),a=Vn((function(e){return e("presto-player/bunny-popup").currentCollection()})),i=Vn((function(e){return e("presto-player/bunny-popup").errors()}));Dn((function(){Fn("presto-player/bunny-popup").setVideosFetched(!1),Fn("presto-player/bunny-popup").setCollections([]),Fn("presto-player/bunny-popup").setVideos([])}),[]);var l=An(n?"Private Stream Library":"Public Stream Library","presto-player"),s=(0,O.tZ)(Br,{afterUpload:(0,O.tZ)(En,{uploads:o,removeUpload:function(e){Fn("presto-player/bunny-popup").removeUpload(e)},isPrivate:n})}),c=(0,O.tZ)(yt,null),u=(0,O.tZ)(Gr,{onChoose:r});return(0,O.tZ)(Tn,{title:l,header:s,mainContent:(0,O.tZ)(In,{css:(0,O.iv)(hn||(hn=(0,k.Z)(["\n overflow: auto;\n display: flex;\n flex-direction: column;\n "])))},(0,O.tZ)("div",{css:(0,O.iv)(mn||(mn=(0,k.Z)(["\n padding: 12px 24px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n "])))},!!i.length&&i.map((function(e){return(0,O.tZ)(Ln,{css:(0,O.iv)(gn||(gn=(0,k.Z)(["\n margin: 0 0 20px 0;\n "]))),status:"error",onRemove:function(){return Fn("presto-player/bunny-popup").removeError(e)}},e)})),a?(0,O.tZ)(nn,null):(0,O.tZ)(mr,null),(0,O.tZ)("div",{css:(0,O.iv)(bn||(bn=(0,k.Z)(["\n display: flex;\n align-items: stretch;\n "])))},(0,O.tZ)(sr,null)),(0,O.tZ)(Rn,{label:"Drop files",onFilesDrop:function(e){Fn("presto-player/bunny-popup").addUploads(e)}}))),onClose:function(){o.length?confirm("Discard your uploads?")&&(t(),Fn("presto-player/bunny-popup").setUploads([])):t()},footer:u,sidebar:c})},zn=wp.i18n.__,Gn=wp.element.useEffect,Hn=wp.data.dispatch,Wn=function(e){var t=e.closePopup,r=e.onSelect,n=e.isPrivate;return Gn((function(){Hn("presto-player/bunny-popup").setIsPrivate(n)}),[n]),(0,x.tZ)(Un,{onClose:t,onChoose:function(e){e.url=e.playlistURL,e.thumbnail=e.thumbnailURL,e.preview=e.webPURL,r(e)},header:zn(n?"Private Stream Library":"Public Stream Library","presto-player"),title:zn(n?"Private Video Stream":"Public Video Stream","presto-player")})},qn=wp.i18n.__,Yn=wp.element.useState,Xn="".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"bunny/"),Kn=wp.i18n.__,Qn=wp.element.useState,Jn="".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"bunny/stream/"),eo=function(e){var t=e.onRefetch,r=e.type,n=e.autoSubmit,o="stream"===r?function(e){var t=Qn(""),r=(0,s.Z)(t,2),n=r[0],o=r[1],a=Qn(""),i=(0,s.Z)(a,2),c=i[0],p=i[1],d=Qn(!1),f=(0,s.Z)(d,2),y=f[0],v=f[1],h=Qn(0),m=(0,s.Z)(h,2),g=m[0],b=m[1],Z=Qn(""),w=(0,s.Z)(Z,2),_=w[0],k=w[1],x=function(e){return e.includes("Authorization has been denied")?"Your API key is incorrect. Please double-check to make sure you've copied it correctly.":e.includes("localhost")?"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.":e},C=function(){var t=(0,l.Z)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return k(""),t.prev=1,v(!0),b(0),p(Kn("Validating API Key...","presto-player")),t.next=7,wp.apiFetch({url:"".concat(Jn,"api-key"),method:"POST",data:{api_key:n}});case 7:if(t.sent.success){t.next=11;break}throw{message:"Could not save the API key. Please double check it to make sure it's correct."};case 11:t.next=18;break;case 13:return t.prev=13,t.t0=t.catch(1),b(0),k(null!==t.t0&&void 0!==t.t0&&t.t0.message?x(t.t0.message):"Something went wrong. Please try again"),t.abrupt("return");case 18:return t.prev=18,b(1),v(!1),p(""),t.finish(18);case 23:return t.prev=23,v(!0),p(Kn("Setting up public video library. This make take a few moments...","presto-player")),t.next=28,wp.apiFetch({url:"".concat(Jn,"library"),method:"POST",data:{type:"public"}});case 28:t.sent.id,t.next=37;break;case 32:return t.prev=32,t.t1=t.catch(23),b(0),k(null!==t.t1&&void 0!==t.t1&&t.t1.message?x(t.t1.message):"Something went wrong. Please try again"),t.abrupt("return");case 37:return t.prev=37,b(2),v(!1),p(""),t.finish(37);case 42:return t.prev=42,v(!0),p(Kn("Setting up private video library. This make take a few moments...","presto-player")),t.next=47,wp.apiFetch({url:"".concat(Jn,"library"),method:"POST",data:{type:"private"}});case 47:t.next=54;break;case 49:return t.prev=49,t.t2=t.catch(42),b(0),k(null!==t.t2&&void 0!==t.t2&&t.t2.message?x(t.t2.message):"Something went wrong. Please try again"),t.abrupt("return");case 54:return t.prev=54,b(2),v(!1),p(""),t.finish(54);case 59:e();case 60:case"end":return t.stop()}}),t,null,[[1,13,18,23],[23,32,37,42],[42,49,54,59]])})));return function(){return t.apply(this,arguments)}}();return{saveKey:C,setApikey:o,step:g,saveMessage:c,saving:y,error:_,totalSteps:3}}(t):function(e){var t=Yn(""),r=(0,s.Z)(t,2),n=r[0],o=r[1],a=Yn(""),i=(0,s.Z)(a,2),c=i[0],p=i[1],d=Yn(!1),f=(0,s.Z)(d,2),y=f[0],v=f[1],h=Yn(0),m=(0,s.Z)(h,2),g=m[0],b=m[1],Z=Yn(""),w=(0,s.Z)(Z,2),_=w[0],k=w[1],x=function(e){return e.includes("Authorization has been denied")?"Your API key is incorrect. Please double-check to make sure you've copied it correctly.":e.includes("localhost")?"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.":e},C=function(){var t=(0,l.Z)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return k(""),t.prev=1,v(!0),b(0),p(qn("Validating API Key...","presto-player")),t.next=7,wp.apiFetch({url:"".concat(Xn,"api-key"),method:"POST",data:{api_key:n}});case 7:if(t.sent.success){t.next=11;break}throw{message:"Could not save the API key. Please double check it to make sure it's correct."};case 11:t.next=18;break;case 13:return t.prev=13,t.t0=t.catch(1),b(0),k(null!==t.t0&&void 0!==t.t0&&t.t0.message?x(t.t0.message):"Something went wrong. Please try again"),t.abrupt("return");case 18:return t.prev=18,b(1),v(!1),p(""),t.finish(18);case 23:return t.prev=23,v(!0),p(qn("Setting up storage zones. This make take a few minutes...","presto-player")),t.next=28,wp.apiFetch({url:"".concat(Xn,"storage-zones"),method:"POST"});case 28:t.sent.id,t.next=37;break;case 32:return t.prev=32,t.t1=t.catch(23),b(0),k(null!==t.t1&&void 0!==t.t1&&t.t1.message?x(t.t1.message):"Something went wrong. Please try again"),t.abrupt("return");case 37:return t.prev=37,b(2),v(!1),p(""),t.finish(37);case 42:return t.prev=42,v(!0),p(qn("Setting up pull zones. This make take a few minutes...","presto-player")),t.next=47,wp.apiFetch({url:"".concat(Xn,"pull-zones"),method:"POST"});case 47:t.sent.id,t.next=56;break;case 51:return t.prev=51,t.t2=t.catch(42),b(0),k(null!==t.t2&&void 0!==t.t2&&t.t2.message?x(t.t2.message):"Something went wrong. Please try again"),t.abrupt("return");case 56:return t.prev=56,b(3),v(!1),p(""),t.finish(56);case 61:e();case 62:case"end":return t.stop()}}),t,null,[[1,13,18,23],[23,32,37,42],[42,51,56,61]])})));return function(){return t.apply(this,arguments)}}();return{saveKey:C,setApikey:o,step:g,saveMessage:c,saving:y,error:_,totalSteps:3}}(t),a=o.saveKey,c=o.apikey,d=o.setApikey,y=o.saveMessage,v=o.saving,h=o.totalSteps,m=o.step,g=o.error;return(0,i.useEffect)((function(){n&&a()}),[n]),(0,x.tZ)(p.Placeholder,{label:(0,f.__)("Bunny.net Video","presto-player"),instructions:(0,f.__)("Enter your Bunny.net API key, which can be found on your Bunny CDN Account page.","presto-player")},v?(0,x.tZ)(p.Flex,null,(0,x.tZ)(p.FlexItem,null,(0,x.tZ)(p.Spinner,null)),(0,x.tZ)(p.FlexBlock,null,y,(0,x.tZ)("progress",{className:"presto-progress",max:h,value:m,style:{width:"100%"}}))):(0,x.tZ)("form",{onSubmit:function(e){e.preventDefault(),a()}},g&&(0,x.tZ)(p.Flex,{style:{width:"100%"}},(0,x.tZ)(p.FlexBlock,null,(0,x.tZ)(p.Notice,{status:"error",isDismissible:!1},g))),(0,x.tZ)(p.Flex,{style:{width:"100%",maxWidth:"400px"}},(0,x.tZ)(p.FlexBlock,null,(0,x.tZ)(p.TextControl,{value:c,onChange:function(e){return d(e)},className:"presto-link-placeholder-input",type:"password",autoComplete:"off",placeholder:(0,f.__)("Your Bunny.net API Key","presto-player"),required:!0})),(0,x.tZ)(p.FlexItem,null,(0,x.tZ)(p.Button,{isPrimary:!0,style:{marginBottom:"8px"},type:"submit"},(0,f.__)("Next","presto-player")," →")))))},to=r(2818),ro=r(1713),no=r(9641);function oo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ao(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oo(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oo(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var io=(0,y.compose)([(0,g.Z)(),(0,m.Z)()])((0,p.withNotices)((function(e){var t,r,n=e.attributes,o=e.setAttributes,a=e.noticeOperations,c=e.branding,y=(e.isSelected,e.presetData),m=e.createVideo,g=e.lockSave,Z=e.unlockSave,w=e.onRemoveSrc,_=e.renderKey,k=e.defaultPreset,C=n.poster,P=n.src,O=n.id,S=n.tracks,E=n.visibility,$=n.previewSrc,N=n.thumbnail,T=(0,i.useState)(""),A=(0,s.Z)(T,2),j=A[0],R=A[1],I=(0,i.useState)(!1),L=(0,s.Z)(I,2),B=L[0],D=L[1],M=(0,i.useState)(""),F=(0,s.Z)(M,2),V=F[0],U=F[1],z=(0,i.useState)({stream:!1,storage:!1}),G=(0,s.Z)(z,2),H=G[0],W=G[1],q=(0,i.useState)(!1),Y=(0,s.Z)(q,2),X=Y[0],Q=Y[1],J=(0,i.useState)(!1),ee=(0,s.Z)(J,2),te=ee[0],re=ee[1],ne=(0,i.useState)(!1),oe=(0,s.Z)(ne,2),ae=(oe[0],oe[1]),ie=(0,i.useState)(!1),le=(0,s.Z)(ie,2),se=le[0],ce=le[1],ue=wp.data.useSelect((function(e){return e("core").canUser("read","settings")})),pe="private"===E,de=null===(t=prestoPlayerAdmin)||void 0===t||null===(r=t.bunny)||void 0===r?void 0:r.disable_legacy_storage;function fe(e){e.url?(o(ao(ao({src:e.url,preset:null==k?void 0:k.id},null!=e&&e.thumbnail?{thumbnail:e.thumbnail}:{}),null!=e&&e.preview?{preview:e.preview}:{})),D(!0),g(),m(ao({src:e.url,type:"bunny",title:e.title},null!=e&&e.guid?{external_id:e.guid}:{})).catch((function(e){o({src:""}),console.error(e)})).finally((function(){Z(),D(!1)}))):o({src:void 0,id:void 0})}(0,i.useEffect)((function(){(0,v.dispatch)("presto-player/bunny-popup").setIsPrivate("private"===E)}),[E]),(0,i.useEffect)((function(){var e,t,r,n,o,a;W({storage:null===(e=prestoPlayerAdmin)||void 0===e||null===(t=e.isSetup)||void 0===t||null===(r=t.bunny)||void 0===r?void 0:r.storage,stream:null===(n=prestoPlayerAdmin)||void 0===n||null===(o=n.isSetup)||void 0===o||null===(a=o.bunny)||void 0===a?void 0:a.stream})}),[]);var ye=function(){var e=(0,l.Z)(u().mark((function e(){var t,r,n,o,a,i,l,s;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:"wp/v2/settings"});case 3:t=e.sent,r=t.presto_player_bunny_pull_zones,n=t.presto_player_bunny_storage_zones,o=t.presto_player_bunny_stream_private,a=t.presto_player_bunny_stream_public,re(!0),o||Q(!0),l=(i=function(e){return!(null==e||!e.private_id||null==e||!e.public_id)})(r)||i(n),s=(null==o?void 0:o.pull_zone_url)&&(null==a?void 0:a.pull_zone_url),W({storage:l,stream:s}),U(l||s?"":"stream");case 15:return e.prev=15,ae(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,,15,18]])})));return function(){return e.apply(this,arguments)}}();(0,i.useEffect)((function(){ue?ye():re(!0)}),[ue]);var ve=function(){var e=(0,l.Z)(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pe){e.next=7;break}return e.next=3,h(P);case 3:t=e.sent,o({previewSrc:t}),e.next=8;break;case 7:o({previewSrc:P});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,i.useEffect)((function(){ve()}),[P]);var he=function(){var e=(0,l.Z)(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pe){e.next=7;break}return e.next=3,h(N);case 3:(t=e.sent)&&o({previewThumbnail:t}),e.next=8;break;case 7:o({previewThumbnail:N});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,i.useEffect)((function(){he()}),[N]);var me;return B||!te?(0,x.tZ)(p.Placeholder,{className:"presto-player__placeholder is-loading"},(0,x.tZ)(p.Spinner,null)):"stream"===V?(0,x.tZ)(eo,{type:"stream",autoSubmit:se,onRefetch:function(){re(!1),ye()}}):"storage"===V?(0,x.tZ)(eo,{type:"storage",onRefetch:function(){re(!1),ye()}}):O?(0,x.tZ)(React.Fragment,null,(0,x.tZ)(d.BlockControls,null,(0,x.tZ)(b.Z,{tracks:S,onChange:function(e){o({tracks:e})}}),(0,x.tZ)(p.Toolbar,null,(0,x.tZ)(p.Button,{onClick:function(){return w()}},(0,f.__)("Replace","presto-player"))),(0,x.tZ)(no.Z,null)),(0,x.tZ)(d.InspectorControls,null,(0,x.tZ)(to.Z,{setAttributes:o,attributes:n})),(0,x.tZ)("figure",{className:"wp-block-video"},(0,x.tZ)(p.Disabled,null,(0,x.tZ)(ro.Z,{poster:C,src:$,id:O,type:"bunny",attributes:n,setAttributes:o,preset:y,branding:c,key:_})))):(0,x.tZ)("div",null,(0,x.tZ)(p.Placeholder,{label:pe?(0,f.__)("Bunny.net Private Video","presto-player"):(0,f.__)("Bunny.net Video","presto-player"),icon:pe?(0,x.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,x.tZ)("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})):(0,x.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,x.tZ)("polyline",{points:"8 17 12 21 16 17"}),(0,x.tZ)("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),(0,x.tZ)("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"})),instructions:(0,f.__)("Add or select a Bunny.net video","presto-player")},(0,x.tZ)(p.BaseControl,{className:"presto-player__placeholder-control"},(0,x.tZ)(p.ToggleControl,{label:"Private Video",help:pe?"Video is only accessible to those who are logged in.":"Video is accessible to everyone.",checked:pe,onChange:function(e){o({visibility:e?"private":"public"})}})),(0,x.tZ)(i.Fragment,null,H.stream&&(0,x.tZ)(p.Button,{isPrimary:!0,onClick:function(){return R("stream")}},pe?(0,f.__)("Add/Select Private Video Stream","presto-player"):(0,f.__)("Add/Select Video Stream","presto-player")),!de&&H.storage&&(0,x.tZ)(p.Button,{isSecondary:H.stream,isPrimary:!H.stream,onClick:function(){return R("storage")}},pe?(0,f.__)("Add/Select Private Video (Classic)","presto-player"):(0,f.__)("Add/Select Video (Classic)","presto-player")),!H.stream&&!X&&H.storage&&(0,x.tZ)(p.Button,{isSecondary:!0,onClick:function(){ce(!0),U("stream")}},(0,f.__)("Enable Bunny.net Stream!","presto-player")),!!ue&&(me=[],!X&&me.push({title:H.stream?(0,f.__)("Reconnect Stream","presto-player"):(0,f.__)("Connect Stream","presto-player"),onClick:function(){U("stream"),ce(!1)}}),!de&&me.push({title:H.storage?(0,f.__)("Reconnect Storage (Classic)","presto-player"):(0,f.__)("Connect Storage (Classic)","presto-player"),onClick:function(){return U("storage")}}),(0,x.tZ)(p.DropdownMenu,{icon:"ellipsis",label:(0,f.__)("Connection Options","presto-player"),controls:me})))),"storage"===j&&(0,x.tZ)(K,{isPrivate:pe,closePopup:function(){return R("")},noticeOperations:a,onSelect:fe}),"stream"===j&&(0,x.tZ)(Wn,{isPrivate:pe,closePopup:function(){return R("")},noticeOperations:a,onSelect:fe}))}))),lo=r(6183);function so(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function co(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?so(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):so(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var uo=wp.i18n.__,po="presto-player/bunny",fo=co(co({},lo.Z),{},{usesContext:["presto-player/playlist-media-id"],attributes:co(co({},lo.Z.attributes),{thumbnail:{type:String,default:""},preview:{type:String,default:""}}),premium:!0,title:uo("Presto Bunny.net Video","presto-player"),description:uo("Serve video through Bunny.net CDN.","presto-player"),variations:[{name:"public",isDefault:!0,title:uo("Presto Bunny.net Video","presto-player"),description:uo("Serve public video through Bunny.net CDN.","presto-player"),attributes:{visibility:"public"}},{name:"private",title:uo("Presto Bunny.net Private Video","presto-player"),icon:(0,x.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,x.tZ)("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})),description:uo("Serve private, secure video through Bunny.net CDN.","presto-player"),attributes:{visibility:"private"}}],icon:(0,x.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,x.tZ)("polyline",{points:"8 17 12 21 16 17"}),(0,x.tZ)("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),(0,x.tZ)("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"})),edit:io})},8024:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return ye},options:function(){return ve}});var n,o=r(2982),a=r(4942),i=(r(9307),r(3324)),l=r(2175),s=r(6263),c=r(2485),u=r(8989),p=r(4184),d=r.n(p),f=r(2777),y=r(917),v=window.location.href,h=wp.components,m=h.Button,g=(h.Notice,h.Placeholder),b=(h.DropZone,h.withFilters),__=(h.BaseControl,h.ToggleControl,h.FormFileUpload,wp.i18n.__),Z=wp.element,w=Z.useState,_=Z.useEffect,k=wp.data.useSelect,x=(wp.deprecated,wp.editor),C=x.MediaUpload,P=x.MediaUploadCheck,O=x.URLPopover,S=function(e){var t=e.src,r=e.onChange,n=e.onSubmit,o=e.onClose;return(0,y.tZ)(O,{onClose:o},(0,y.tZ)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,y.tZ)("input",{"data-cy":"url-input",className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":__("URL","presto-player"),placeholder:__("Paste or type a Youtube, Vimeo or .mp4 video URL","presto-player"),onChange:r,value:t}),(0,y.tZ)(m,{"data-cy":"url-submit",className:"block-editor-media-placeholder__url-input-submit-button",icon:"editor-break",label:__("Apply","presto-player"),type:"submit"})))},E=b("editor.MediaPlaceholder")((function(e){var t=e.value,r=void 0===t?{}:t,n=e.allowedTypes,o=void 0===n?[]:n,a=e.className,l=e.icon,s=e.url,c=void 0===s||s,u=e.labels,p=void 0===u?{}:u,h=e.mediaPreview,b=e.notices,Z=e.isAppender,x=e.isPrivate,O=e.addToGallery,E=e.onSelect,$=e.onCancel,N=e.onSelectURL,T=e.onDoubleClick,A=e.children,j=e.allowURLs,R=k((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),I=w(""),L=(0,i.Z)(I,2),B=L[0],D=L[1],M=w(!1),F=(0,i.Z)(M,2),V=F[0],U=F[1];_((function(){var e;D(null!==(e=null==r?void 0:r.src)&&void 0!==e?e:"")}),[r]);var z=function(e){D(e.target.value)},G=function(){U(!0)},H=function(){U(!1)},W=function(e){e.preventDefault(),B&&N&&(N(B),H())},q=function(e,t){var r=p.instructions,n=p.title;R||N||(r=__("To edit this block, you need permission to upload media.","presto-player"));var o=d()("block-editor-media-placeholder",a,{"is-appender":Z});return(0,y.tZ)(g,{icon:l,label:n,instructions:r,className:o,notices:b,onClick:t,onDoubleClick:T,preview:h},A,e)},Y=function(){return N&&(0,y.tZ)("div",{className:"block-editor-media-placeholder__url-input-container"},c&&(0,y.tZ)(m,{"data-cy":"video-url",className:"block-editor-media-placeholder__button",onClick:G,isPressed:V,isTertiary:!0},__("Video URL","presto-player")),V&&(0,y.tZ)(S,{src:B,onChange:z,onSubmit:W,onClose:H}))};return(0,y.tZ)(P,{fallback:q(Y())},function(){var e=(0,y.tZ)(C,{title:__(x?"Select or Upload Private Video":"Select or Upload Video","presto-player"),addToGallery:O,gallery:!1,multiple:!1,onSelect:function(e){f.Z.unsetUrlParams(),E(e)},onClose:function(){f.Z.unsetUrlParams()},allowedTypes:o,value:Array.isArray(r)?r.map((function(e){return e.id})):r.id,render:function(e){var t=e.open;return(0,y.tZ)(m,{"data-cy":"add-video",isPrimary:!0,onClick:function(e){e.stopPropagation(),f.Z.unsetUrlParams(),x?f.Z.setUrlPrivate(v):f.Z.setUrlPublic(v),t()}},__(x?"Add/Select Private Video":"Add/Select Video","presto-player"))}});if(R){var t=(0,y.tZ)(React.Fragment,null,e,!!j&&Y(),$&&(0,y.tZ)(m,{className:"block-editor-media-placeholder__cancel-button",title:__("Cancel","presto-player"),isLink:!0,onClick:$},__("Cancel","presto-player")));return q(t)}return q(e)}())})),$=r(9807),N=wp.i18n.__,T=wp.components,A=T.withNotices,j=T.BaseControl,R=T.ToggleControl,I=T.Notice,L=wp.data.dispatch,B=["video"],D=A((function(e){var t,r=e.noticeUI,n=e.onSelect,o=e.children,a=e.onSelectURL,i=e.onUploadError,l=e.setAttributes,s=e.attributes,c="private"===s.visibility;return(0,y.tZ)("div",null,(0,y.tZ)(E,{icon:c?(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,y.tZ)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,y.tZ)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})):(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,y.tZ)("polygon",{points:"23 7 16 12 23 17 23 7"}),(0,y.tZ)("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),labels:{title:N(c?"Presto Private Video":"Presto Video","presto-player"),instructions:N(c?"Upload a video file, or pick one from your media library.":"Upload a video file, pick one from your media library, or add one with a URL.","presto-player")},onSelect:n,onSelectURL:a,switcher:!0,isPrivate:c,allowURLs:!c,accept:"video/*",setAttributes:l,allowedTypes:B,value:s,notices:r,onError:i},(0,y.tZ)("div",{style:{width:"100%"}},(0,y.tZ)(j,{className:"presto-player__placeholder-control"},(0,y.tZ)(R,{label:(0,y.tZ)("div",null,N("Make Private","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&(0,y.tZ)($.Z,null)),help:N(c?"This video is only accessible to those who are logged in.":"This video is currently accessible to everyone.","presto-player"),checked:c,onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?l({visibility:e?"private":"public"}):L("presto-player/player").setProModal(!0)}})),!!o&&(0,y.tZ)("div",{style:{width:"100%"}},o),!!c&&(0,y.tZ)(I,{status:"warning",isDismissible:!1},(0,y.tZ)("div",null,(0,y.tZ)("div",null,(0,y.tZ)("strong",null,N("Note","presto-player"))),N("Private videos use php to stream your video. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.","presto-player"))))))})),M=r(9235),F=r(2818),V=r(1713),U=r(9641),z=wp.i18n.__,G=wp.blob,H=G.getBlobByURL,W=G.isBlobURL,q=wp.components,Y=q.Button,X=q.Disabled,K=q.Toolbar,Q=q.Notice,J=q.withNotices,ee=q.Placeholder,te=q.Spinner,re=wp.compose.compose,ne=wp.element,oe=ne.useEffect,ae=ne.useState,ie=wp.data.dispatch,le=wp.blocks.createBlock,se=["video"],ce=re([(0,u.Z)(),(0,c.Z)()])(J((function(e){var t=e.attributes,r=e.setAttributes,n=e.noticeOperations,o=e.branding,a=e.loading,c=e.presetData,u=e.createVideo,p=e.onRemoveSrc,d=e.renderKey,f=e.lockSave,v=e.unlockSave,h=e.clientId,m=e.defaultPreset,g=t.poster,b=t.src,Z=t.id,w=t.tracks,_=ae(""),k=(0,i.Z)(_,2),x=k[0],C=k[1],P=function(e){n.removeAllNotices(),n.createErrorNotice(null==e?void 0:e.message)};return oe((function(){if(!Z&&W(b)){var e=H(b);e&&mediaUpload({filesList:[e],onFileChange:function(e){var t=(0,i.Z)(e,1)[0].url;r({src:t})},onError:function(e){n.createErrorNotice(e)},allowedTypes:se})}}),[]),b?a||!Z?(0,y.tZ)(ee,{className:"presto-player__placeholder is-loading"},(0,y.tZ)(te,null)):(0,y.tZ)("div",null,(0,y.tZ)(l.BlockControls,null,(0,y.tZ)(M.Z,{tracks:w,onChange:function(e){r({tracks:e})}}),(0,y.tZ)(K,null,(0,y.tZ)(Y,{onClick:function(){return p()}},z("Replace","presto-player"))),(0,y.tZ)(U.Z,null)),(0,y.tZ)(l.InspectorControls,null,(0,y.tZ)(F.Z,{setAttributes:r,attributes:t})),(0,y.tZ)("figure",null,(0,y.tZ)(X,null,(0,y.tZ)(V.Z,{poster:g,src:b,id:Z,type:"hosted",attributes:t,setAttributes:r,preset:c,branding:o,key:d})))):(0,y.tZ)("div",null,(0,y.tZ)(D,{onSelect:function(e){e&&e.url?(r({src:e.url,preset:null==m?void 0:m.id,attachment_id:e.id}),f(),u({src:e.url,type:"attachment",attachment_id:e.id}).catch((function(e){r({src:""}),P(e)})).finally(v)):r({src:void 0,id:void 0})},onSelectURL:function(e){var t;if(r({attachment_id:null}),!e||!(0,s.dA)(e)||null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium){if(e!==b){var n=(0,s.Ln)(e).type;if("youtube"===n){var o=le("presto-player/youtube",{src:e});return void ie("core/editor").replaceBlock(h,o)}if("vimeo"===n){var a=le("presto-player/vimeo",{src:e});return void ie("core/editor").replaceBlock(h,a)}r({src:e,attachmend_id:null}),r({preset:null==m?void 0:m.id}),f(),u({src:e,type:"link"}).catch((function(e){r({src:""}),P(e)})).finally(v)}}else C((0,y.tZ)(Q,{status:"info",onRemove:function(){return C("")}},(0,y.tZ)("div",null,(0,y.tZ)("div",null,(0,y.tZ)("strong",null,z("Get HLS Streaming and more with Presto Player Pro!","presto-player"))),z("Stream HLS links and more with Presto Player Pro.","presto-player"),(0,y.tZ)("div",{style:{marginTop:"1em"}},(0,y.tZ)(Y,{isPrimary:!0},z("Upgrade","presto-player"))))))},setAttributes:r,attributes:t,onError:function(e){n.removeAllNotices(),n.createErrorNotice(e)}},x))}))),ue=r(6183);function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var fe=wp.i18n.__,ye="presto-player/self-hosted",ve=de(de({},ue.Z),{},{usesContext:["presto-player/playlist-media-id"],title:fe("Presto Video","presto-player"),description:fe("Presto Self-hosted video block.","presto-player"),variations:[{name:"public",isDefault:!0,title:fe("Presto Video","presto-player"),description:fe("Presto Self-hosted video block.","presto-player"),attributes:{visibility:"public"}}].concat((0,o.Z)(null!==(n=prestoPlayer)&&void 0!==n&&n.isPremium?[{name:"private",title:fe("Presto Private Video","presto-player"),icon:(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,y.tZ)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,y.tZ)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),description:fe("Private video self-hosted block.","presto-player"),attributes:{visibility:"private"}}]:[])),icon:(0,y.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,y.tZ)("polygon",{points:"23 7 16 12 23 17 23 7"}),(0,y.tZ)("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),edit:ce})},2356:function(e,t,r){"use strict";r.r(t),r.d(t,{metadata:function(){return m},name:function(){return g},options:function(){return b}});var n,o=r(9307),a=r(5736),i=r(168),l=r(3324),s=r(7453),c=r(2175),u=r(9818),p=r(5246),d=r(5609),f=r(6732),y=r(376),v=r(7798),h=r(917),m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"presto-player/media-hub","apiVersion":2,"title":"Presto Player","category":"presto","keywords":["video","audio","media","youtube","vimeo","bunny","presto"],"description":"Allows you to add videos and audio to your site using Presto Player.","textdomain":"presto-player","script":"presto-components"}'),g=m.name,b={usesContext:["presto-player/playlist-media-id"],providesContext:{"presto-player/playlist-media-id":"id"},attributes:{id:{type:"number"}},icon:(0,h.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"presto-block-icon"},(0,h.tZ)("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,h.tZ)("path",{d:"M10 8L16 12L10 16V8Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),edit:function(e){var t=e.clientId,r=(0,u.useDispatch)(c.store).setTemplateValidity,h=(0,u.useSelect)((function(e){return e(c.store).getBlock(t).innerBlocks}));r(!0);var m=(0,c.useBlockProps)(),g=(0,c.useInnerBlocksProps)(m,{templateLock:!1,renderAppender:!1}),b=(0,v.useEntityProp)("root","site","presto_player_media_hub_sync_default"),Z=(0,l.Z)(b,1)[0],w=(0,o.useState)((function(){return Z})),_=(0,l.Z)(w,2),k=_[0],x=_[1];return null!=h&&h.length?(0,s.tZ)("div",g):(0,s.tZ)("div",g,(0,s.tZ)(React.Fragment,null,(0,s.tZ)(c.BlockControls,null,(0,s.tZ)(d.Toolbar,null,(0,s.tZ)(d.Dropdown,{popoverProps:{placement:"bottom-left"},renderToggle:function(e){var t=e.onToggle;return(0,s.tZ)(d.Flex,null,(0,s.tZ)(d.Button,{onClick:t,css:(0,s.iv)(n||(n=(0,i.Z)(["\n background: transparent;\n border: none;\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 4px;\n "]))),icon:k?(0,s.tZ)(d.Icon,{icon:f.Z}):(0,s.tZ)(d.Icon,{icon:y.Z})},k?(0,a.__)("Synced","presto-player"):(0,a.__)("Not synced","presto-player"),(0,s.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"w-4 h-4",width:"16px"},(0,s.tZ)("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))))},renderContent:function(){return(0,s.tZ)(d.MenuGroup,null,(0,s.tZ)(d.MenuItem,{onClick:function(){return x(!0)},icon:(0,s.tZ)(d.Icon,{icon:f.Z}),isSelected:k,iconPosition:"left"},(0,a.__)("Sync to media hub","presto-player")),(0,s.tZ)(d.MenuItem,{onClick:function(){return x(!1)},icon:(0,s.tZ)(d.Icon,{icon:y.Z}),isSelected:!k,iconPosition:"left"},(0,a.__)("Don't sync to media hub","presto-player")))}}))),(0,s.tZ)(p.Z,{clientId:t,shouldInsertBlock:!1,selectExisting:!0,sync:k})))},save:function(){var e=c.useBlockProps.save(),t=c.useInnerBlocksProps.save(e);return(0,h.tZ)("div",t)}}},6055:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return u},options:function(){return p}}),r(9307);var n=r(5736),o=r(4831),a=r(2175),i=r(5609),l=r(7798),s=r(9818),c=r(917),u="presto-player/playlist-list-item",p={attributes:{id:{type:Number,default:0},title:{type:String,default:""},duration:{type:String,default:""}},category:"presto",parent:["presto-player/playlist-list"],title:(0,n.__)("Playlist Item","presto-player"),description:(0,n.__)("Playlist Item","presto-player"),usesContext:["presto-player/playlist-media-id"],edit:function(e){var t=e.attributes,r=e.setAttributes,u=e.context,p=t.id,d=t.title,f=t.duration,y=(0,a.useBlockProps)(),v=(0,s.useSelect)((function(e){var t,r=["postType","pp_video_block",p],n=(t=e(l.store)).getEntityRecord.apply(t,r);return{entityTitle:n?null==n?void 0:n.title:null}}),[p]).entityTitle;return(0,c.tZ)(React.Fragment,null,(0,c.tZ)(a.InspectorControls,null,(0,c.tZ)(i.PanelBody,{title:(0,n.__)("General","presto-player"),initialOpen:!0},(0,c.tZ)(i.TextControl,{label:(0,n.__)("Title","presto-player"),value:d,onChange:function(e){r({title:e})}}),(0,c.tZ)(i.TextControl,{label:(0,n.__)("Duration","presto-player"),value:f,onChange:function(e){r({duration:e})}}))),(0,c.tZ)("div",y,(0,c.tZ)(o.T9,{active:u["presto-player/playlist-media-id"]===p},(0,c.tZ)("div",{className:"item-title",slot:"item-title"},(0,c.tZ)(a.RichText,{tagName:"span",value:d||v,allowedFormats:[],onChange:function(e){return r({title:e})},placeholder:(0,n.__)("Title...","presto-player")})),(0,c.tZ)("div",{className:"item-duration",slot:"item-duration"},(0,c.tZ)(a.RichText,{tagName:"span",value:f,allowedFormats:[],onChange:function(e){return r({duration:e})}})))))},icon:(0,c.tZ)("svg",{width:"19",height:"14",className:"playlist-block-icon",viewBox:"0 0 19 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,c.tZ)("path",{d:"M0 10H7V8H0M15 8V4H13V8H9V10H13V14H15V10H19V8M11 0H0V2H11M11 4H0V6H11V4Z",fill:"currentColor"}))}},9989:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return C},options:function(){return P}});var n,o,a=r(9307),i=r(2175),l=r(5736),s=r(5861),c=r(168),u=r(3324),p=r(1284),d=r.n(p),f=r(7453),y=r(4981),v=r(7798),h=r(9818),m=r(4130),g=r(1984),b=r(444),Z=r(5893),w=(0,Z.jsx)(b.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Z.jsx)(b.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),_=r(5609),k=r(917),x=function(e){var t=e.onCreate,r=e.onRequestClose,n=(0,a.useState)(""),o=(0,u.Z)(n,2),i=o[0],s=o[1];return(0,k.tZ)(_.Modal,{title:(0,l.__)("Add New Playlist Item","presto-player"),onRequestClose:r},(0,k.tZ)(_.Flex,{direction:"column",gap:4},(0,k.tZ)(_.TextControl,{value:i,onChange:function(e){return s(e)},placeholder:(0,l.__)("Title","presto-player"),required:!0,label:(0,l.__)("Title","presto-player"),autoFocus:!0}),(0,k.tZ)(_.Flex,{justify:"start",align:"center"},(0,k.tZ)(_.Button,{style:{margin:0},variant:"primary",onClick:function(){return t(i)}},(0,l.__)("Create","presto-player")),(0,k.tZ)(_.Button,{variant:"tertiary",style:{margin:0},onClick:r},(0,l.__)("Cancel","presto-player")))))},C="presto-player/playlist-list",P={apiVersion:"2",attributes:{lock:{type:Object,default:{remove:!0,move:!1}}},category:"presto",supports:{align:!0},save:function(){return(0,k.tZ)(i.InnerBlocks.Content,null)},parent:["presto-player/playlist-block"],title:(0,l.__)("Playlist List","presto-player"),description:(0,l.__)("Presto Playlist List Block - Holds the Playlist List Items.","presto-player"),edit:function(e){var t=e.clientId,r=e.isSelected,p=(0,h.useDispatch)(i.store),b=p.selectBlock,Z=p.insertBlock,k=(0,h.useDispatch)(v.store).saveEntityRecord,C=(0,i.useBlockProps)({slot:"list"}),P=(0,a.useState)(!1),O=(0,u.Z)(P,2),S=O[0],E=O[1],$=(0,l.__)("Add Media","presto-player"),N=(0,h.useSelect)((function(e){return(e("core/block-editor").getBlocks(t)||[]).map((function(e){return parseInt(e.attributes.id)}))}),[t]),T=(0,i.useInnerBlocksProps)(C,{renderAppender:function(){return(0,f.tZ)(m.Z,{onCreate:function(){return E(!0)},value:N,popoverProps:{placement:"bottom-center"},onSelect:function(e){return Z((0,y.createBlock)("presto-player/playlist-list-item",{id:null==e?void 0:e.id,title:null==e?void 0:e.title}),999999,t)},css:(0,f.iv)(n||(n=(0,c.Z)(["\n width: 100%;\n padding: 5px;\n box-sizing: border-box !important;\n "]))),renderToggle:function(e){var t=e.isOpen,r=e.onToggle;return(0,f.tZ)(_.Button,{className:"block-editor-button-block-appender",onClick:r,"aria-haspopup":!0,"aria-expanded":t,label:$,css:(0,f.iv)(o||(o=(0,c.Z)(["\n box-sizing: border-box !important;\n "])))},(0,f.tZ)(_.VisuallyHidden,{as:"span"},$),(0,f.tZ)(g.Z,{icon:w}))}})},allowedBlocks:["presto-player/reusable-display"],templateLock:!1}),A=function(){var e=(0,s.Z)(d().mark((function e(r){var n,o,a;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k("postType","pp_video_block",{title:r,status:"publish",content:'\x3c!-- wp:presto-player/reusable-edit --\x3e\n <div class="wp-block-presto-player-reusable-edit"></div>\n \x3c!-- /wp:presto-player/reusable-edit --\x3e'},{throwOnError:!0});case 2:n=e.sent,o=n.id,a=n.title.raw,Z((0,y.createBlock)("presto-player/playlist-list-item",{id:o,title:a}),999999,t);case 6:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),j=(0,h.useSelect)((function(e){var r=e("core/block-editor").getBlockHierarchyRootClientId(t),n=e("core/block-editor").getBlockAttributes(r);return{listCount:e("core/block-editor").getBlocks(t).length,heading:null==n?void 0:n.heading,listTextPlural:null==n?void 0:n.listTextPlural,listTextSingular:null==n?void 0:n.listTextSingular,parentClientId:r}}),[t]),R=j.listCount,I=j.heading,L=j.listTextSingular,B=j.listTextPlural,D=j.parentClientId;return(0,a.useEffect)((function(){r&&b(D)}),[r]),(0,f.tZ)(React.Fragment,null,(0,f.tZ)("div",{slot:"title"},I),(0,f.tZ)("div",{slot:"count"},R," ",R>1?B:L),(0,f.tZ)("div",T),S&&(0,f.tZ)(x,{onRequestClose:function(){return E(!1)},onCreate:A}))},icon:(0,k.tZ)("svg",{width:"20",height:"14",className:"playlist-block-icon",viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,k.tZ)("path",{d:"M11 4H0V6H11V4ZM11 0H0V2H11V0ZM0 10H7V8H0V10ZM18.5 5.5L20 7L13 14L8.5 9.5L10 8L13 11L18.5 5.5Z",fill:"currentColor"}))}},503:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return i},options:function(){return l}}),r(9307);var n=r(5736),o=r(2175),a=r(917),i="presto-player/playlist-preview",l={apiVersion:"2",attributes:{lock:{type:Object,default:{remove:!0,move:!0}}},category:"presto",supports:{align:!0},parent:["presto-player/playlist"],title:(0,n.__)("Playlist Preview","presto-player"),description:(0,n.__)("Presto Playlist Preview Block - Shows the preview of the playlist item.","presto-player"),edit:function(){var e=(0,o.useBlockProps)({slot:"preview"}),t=(0,o.useInnerBlocksProps)(e,{renderAppender:o.InnerBlocks.ButtonBlockAppender,templateLock:"all",template:[["presto-player/reusable-display"]],allowedBlocks:["presto-player/reusable-display"]});return(0,a.tZ)("div",t)},icon:(0,a.tZ)("svg",{width:"19",height:"14",className:"playlist-block-icon",viewBox:"0 0 19 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.tZ)("path",{d:"M0 0V2H11V0H0ZM0 4V6H11V4H0ZM17 4.1C16.9 4.1 16.7 4.2 16.6 4.3L15.6 5.3L17.7 7.4L18.7 6.4C18.9 6.2 18.9 5.8 18.7 5.6L17.4 4.3C17.3 4.2 17.2 4.1 17 4.1ZM15.1 5.9L9 11.9V14H11.1L17.2 7.9L15.1 5.9ZM0 8V10H7V8H0Z",fill:"currentColor"}))}},277:function(e,t,r){"use strict";r.r(t),r.d(t,{metadata:function(){return S},name:function(){return E},options:function(){return $}});var n,o,a,i,l=r(9307),s=r(5736),c=r(7462),u=r(168),p=r(7453),d=r(4831),f=r(2175),y=r(4981),v=r(5609),h=r(5861),m=r(3324),g=r(1284),b=r.n(g),Z=r(7798),w=r(9818),_=r(3961),k=r(4130),x=r(917),C=function(e){var t=e.selectedItems,r=e.setAttributes,n=e.className,o=(0,l.useState)("select"),a=(0,m.Z)(o,2),i=a[0],c=a[1],u=(0,l.useState)(!1),p=(0,m.Z)(u,2),d=p[0],f=p[1],y=(0,l.useState)(""),g=(0,m.Z)(y,2),C=g[0],P=g[1],O=(0,w.useDispatch)(Z.store).saveEntityRecord,S=(0,w.useDispatch)(_.store).createErrorNotice,E=function(){var e=(0,h.Z)(b().mark((function e(){var t,n,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C&&!d){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,f(!0),e.next=6,O("postType","pp_video_block",{title:C,status:"publish",content:'\x3c!-- wp:presto-player/reusable-edit --\x3e\n <div class="wp-block-presto-player-reusable-edit"></div>\n \x3c!-- /wp:presto-player/reusable-edit --\x3e'},{throwOnError:!0});case 6:t=e.sent,n=t.id,o=t.title.raw,r({id:n,title:o||C}),f(!1),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(2),console.error(e.t0),S((null===e.t0||void 0===e.t0?void 0:e.t0.message)||(0,s.__)("Something went wrong","presto-player"));case 17:case"end":return e.stop()}}),e,null,[[2,13]])})));return function(){return e.apply(this,arguments)}}();return"create"===i?(0,x.tZ)(v.Flex,{className:n,direction:"column",gap:4},(0,x.tZ)(v.TextControl,{value:C,onChange:function(e){return P(e)},placeholder:(0,s.__)("Title","presto-player"),required:!0,label:(0,s.__)("Title","presto-player"),disabled:d,autoFocus:!0}),(0,x.tZ)(v.Flex,{justify:"start",align:"center"},(0,x.tZ)(v.Button,{style:{margin:0},variant:"primary",isBusy:d,onClick:d?function(){}:E},(0,s.__)("Create","presto-player")," ",d&&(0,x.tZ)(v.Spinner,{style:{marginTop:0}})),(0,x.tZ)(v.Button,{variant:"tertiary",style:{margin:0},isBusy:d,onClick:function(){return c(!1)}},"← ",(0,s.__)("Go Back","presto-player")))):(0,x.tZ)(v.Flex,{className:n,direction:"column",gap:4},(0,x.tZ)(k.Z,{popoverProps:{placement:"bottom-start"},value:t,onSelect:function(e){return r({id:e.id,title:null==e?void 0:e.title})},onCreate:function(){return c("create")}}))},P=r(6269),O=["presto-player/playlist-preview","presto-player/playlist-list"],S=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"presto-player/playlist","apiVersion":2,"title":"Presto Playlist","category":"presto","description":"Create a playlist of videos or audio.","keywords":["playlist","video"],"textdomain":"presto-player","supports":{"align":true,"multiple":false,"color":{"gradients":false,"link":false,"__experimentalDefaultControls":{"background":true,"text":true}},"__experimentalBorder":{"color":true,"radius":true,"style":true,"width":true,"__experimentalSkipSerialization":true,"__experimentalDefaultControls":{"color":true,"radius":true,"style":true,"width":true}}},"attributes":{"heading":{"type":"string","default":"Playlist"},"selectedItem":{"type":"number","default":null},"listTextSingular":{"type":"string","default":"Video"},"listTextPlural":{"type":"string","default":"Videos"},"color":{"type":"string"},"textColor":{"type":"string"},"highlightColor":{"type":"string"},"transitionDuration":{"type":"number","default":5},"matchPlaylistToPlayerColor":{"type":"boolean"}},"providesContext":{"presto-player/playlist-media-id":"selectedItem"},"script":"presto-components"}'),E=S.name,$={icon:(0,x.tZ)("svg",{width:"19",height:"15",className:"playlist-block-icon",viewBox:"0 0 19 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,x.tZ)("path",{d:"M0 4H11V6H0V4ZM0 0H11V2H0V0ZM0 8H7V10H0V8ZM13 7V15L19 11L13 7Z",fill:"currentColor"})),edit:function(e){var t,r,h,m,g,b,Z,_=e.attributes,k=e.setAttributes,x=e.clientId,S=_.heading,E=_.listTextSingular,$=_.listTextPlural,N=_.highlightColor,T=_.transitionDuration,A=_.selectedItem,j=_.matchPlaylistToPlayerColor,R=(0,w.useDispatch)(f.store).replaceInnerBlocks,I=(0,f.useBlockProps)({css:(0,p.iv)(n||(n=(0,u.Z)(["\n wp-block,\n [data-block] {\n margin: 0 !important;\n max-width: none !important;\n }\n "])))}),L=(0,w.useSelect)((function(e){var t=e(f.store).getBlocks(x),r=(t||[]).find((function(e){return"presto-player/playlist-list"===e.name})),n=(t||[]).find((function(e){return"presto-player/playlist-preview"===e.name}));return{selectedBlock:e(f.store).getSelectedBlock(),previewWrapper:n,playlistBlocks:e(f.store).getBlocks(null==r?void 0:r.clientId),previewBlocks:e(f.store).getBlocks(null==n?void 0:n.clientId),playListWrapper:r}}),[x]),B=L.selectedBlock,D=L.playlistBlocks,M=L.playListWrapper;(0,l.useEffect)((function(){var e,t;null!=B&&null!==(e=B.attributes)&&void 0!==e&&e.id&&"presto-player/playlist-list-item"===B.name&&k({selectedItem:parseInt(null==B||null===(t=B.attributes)||void 0===t?void 0:t.id)})}),[D,null==B||null===(t=B.attributes)||void 0===t?void 0:t.id]),(0,l.useEffect)((function(){if(!A){var e,t,r,n,o=parseInt(null==D||null===(e=D[0])||void 0===e||null===(t=e.attributes)||void 0===t?void 0:t.id);isNaN(o)||k({selectedItem:parseInt(null==D||null===(r=D[0])||void 0===r||null===(n=r.attributes)||void 0===n?void 0:n.id)})}}),[D]);var F=(0,f.useInnerBlocksProps)(I,{renderAppender:!1,allowedBlocks:O,template:[["presto-player/playlist-preview"],["presto-player/playlist-list"]],templateLock:"all"}),V=(0,f.__experimentalUseMultipleOriginColorsAndGradients)(),U=(0,f.__experimentalUseBorderProps)(_),z=(0,f.__experimentalUseColorProps)(_);return 0===D.length?(0,p.tZ)("div",I,(0,p.tZ)(v.Placeholder,{icon:(0,p.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"playlist-block-icon",width:"24",height:"24",viewBox:"0 0 24 24"},(0,p.tZ)("path",{fill:"currentColor",d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm13-1v8l6-4z"})),instructions:(0,s.__)("Add a Playlist Item to get started.","presto-player"),label:(0,s.__)("Presto Player Playlist","presto-player"),isColumnLayout:!0},(0,p.tZ)(C,{css:(0,p.iv)(o||(o=(0,u.Z)(["\n max-width: 600px;\n "]))),setAttributes:function(e){var t=e.id,r=e.title;k({selectedItem:t}),R(null==M?void 0:M.clientId,[(0,y.createBlock)("presto-player/playlist-list-item",{id:t,title:r})])}}))):(0,p.tZ)(React.Fragment,null,(0,p.tZ)(f.InspectorControls,{group:"color"},(0,p.tZ)(f.__experimentalColorGradientSettingsDropdown,(0,c.Z)({__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:N,label:(0,s.__)("Highlight Color"),onColorChange:function(e){return k({highlightColor:e})},resetAllFilter:function(){return k({highlightColor:void 0})}}]},V,{panelId:x,gradients:[],disableCustomGradients:!0})),(0,p.tZ)(f.ContrastChecker,{backgroundColor:N,textColor:"#ffffff"}),P(null===(r=prestoPlayer)||void 0===r?void 0:r.proVersion,"2.0.4")>=0&&!!N&&(0,p.tZ)(v.ToggleControl,{label:(0,s.__)("Pass highlight color to player","presto-player"),help:(0,s.__)("Use the playlist highlight color as player color in case your playlist color is different from your brand.","presto-player"),checked:j,onChange:function(e){return k({matchPlaylistToPlayerColor:e})},css:(0,p.iv)(a||(a=(0,u.Z)(["\n min-width: 250px;\n "])))})),(0,p.tZ)(f.InspectorControls,null,(0,p.tZ)(v.PanelBody,{title:(0,s.__)("General","presto-player"),initialOpen:!0},(0,p.tZ)(v.TextControl,{label:(0,s.__)("Playlist Title","presto-player"),value:S,onChange:function(e){return k({heading:e})}}),(0,p.tZ)(v.TextControl,{label:(0,s.__)("Playlist Items Text - Singular","presto-player"),value:E,onChange:function(e){return k({listTextSingular:e})}}),(0,p.tZ)(v.TextControl,{label:(0,s.__)("Playlist Items Text - Plural","presto-player"),value:$,onChange:function(e){return k({listTextPlural:e})}}),(0,p.tZ)(v.__experimentalNumberControl,{label:(0,s.__)("Transition Duration (Seconds)","presto-player"),value:T,onChange:function(e){return k({transitionDuration:e})},max:30,min:.5,step:.1}))),(0,p.tZ)("div",{style:{"--presto-playlist-highlight-color":N,"--presto-player-highlight-color":j?N:"","--presto-playlist-background-color":null==z||null===(h=z.style)||void 0===h?void 0:h.backgroundColor,"--presto-playlist-text-color":null==z||null===(m=z.style)||void 0===m?void 0:m.color,"--presto-playlist-border-color":null==U||null===(g=U.style)||void 0===g?void 0:g.borderColor,"--presto-playlist-border-width":null==U||null===(b=U.style)||void 0===b?void 0:b.borderWidth,"--presto-playlist-border-radius":null==U||null===(Z=U.style)||void 0===Z?void 0:Z.borderRadius,border:"none"},css:(0,p.iv)(i||(i=(0,u.Z)(["\n width: 100%;\n .wp-block-video {\n margin: 0 !important;\n }\n "])))},(0,p.tZ)(d.Gc,F)))},save:function(){var e=f.useBlockProps.save(),t=f.useInnerBlocksProps.save(e);return(0,x.tZ)("div",t)}}},249:function(e,t,r){"use strict";var n=r(9307);t.Z=(0,n.createContext)({isEditing:!1,setIsEditing:function(){}})},7057:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return Z},options:function(){return w}});var n,o,a=r(9307),i=r(5736),l=r(168),s=r(3324),c=r(7453),u=r(2175),p=r(5609),d=r(7798),f=r(9818),y=r(5246),v=r(4688),h=r(1984),m=r(6732),g=r(249),b=r(917),Z="presto-player/reusable-display",w={title:(0,i.__)("Media Hub Item","presto-player"),category:"presto",attributes:{id:Number},supports:{inserter:!1,reusable:!1,html:!1,align:!0},usesContext:["presto-player/playlist-media-id"],providesContext:{"presto-player/playlist-media-id":"id"},icon:(0,b.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"presto-block-icon"},(0,b.tZ)("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,b.tZ)("path",{d:"M10 8L16 12L10 16V8Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),edit:function(e){var t,r,b,Z=e.attributes,w=e.context,_=e.clientId,k=e.isSelected,x=(0,a.useState)(!1),C=(0,s.Z)(x,2),P=C[0],O=C[1],S=(0,f.useDispatch)(u.store).selectBlock,E=Z.id,$=w["presto-player/playlist-media-id"]||E,N=(0,u.useBlockProps)(),T=(0,d.useEntityBlockEditor)("postType","pp_video_block",{id:$}),A=(0,s.Z)(T,3),j=A[0],R=A[1],I=A[2],L=(j||[]).filter((function(e){return"presto-player/reusable-edit"===e.name})),B=((null==L||null===(t=L[0])||void 0===t?void 0:t.innerBlocks)||[]).some((function(e){return e.attributes.src})),D=(0,u.__experimentalUseBlockPreview)({blocks:L}),M=(0,u.useInnerBlocksProps)(N,{value:j,onInput:R,onChange:I,templateLock:"all"}),F=(0,f.useSelect)((function(e){var t,r,n=["postType","pp_video_block",$],o=e(d.store).hasFinishedResolution("getEntityRecord",n),a=(t=e(d.store)).getEntityRecord.apply(t,n);return{media:a,canEdit:(r=e(d.store)).canUserEditEntityRecord.apply(r,n),isMissing:o&&!a&&$,hasResolved:o,isResolving:e(d.store).isResolving("getEntityRecord",n)}}),[$,_]),V=F.media,U=F.canEdit,z=F.isMissing,G=F.hasResolved,H=!!B&&!!U&&!!(null!=V&&null!==(r=V.details)&&void 0!==r&&r.src||null!=V&&null!==(b=V.details)&&void 0!==b&&b.provider_video_id);return(0,a.useEffect)((function(){setTimeout((function(){var e,t,r,n=(0,f.select)(u.store).getBlocks(_),o=null==n||null===(e=n[0])||void 0===e||null===(t=e.innerBlocks)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.clientId;S(o&&P&&H?o:_)}))}),[P]),(0,a.useEffect)((function(){var e,t,r,n=(0,f.select)(u.store).getBlocks(_),o=null==n||null===(e=n[0])||void 0===e||null===(t=e.innerBlocks)||void 0===t||null===(r=t[0])||void 0===r?void 0:r.clientId;o&&S(o)}),[k]),G?$||void 0===w["presto-player/playlist-media-id"]?z?(0,c.tZ)("div",N,(0,i.__)("The selected media item has been deleted or is unavailable.","presto-player")):j.length?!H||P?(0,c.tZ)(g.Z.Provider,{value:{isEditing:P,setIsEditing:O}},(0,c.tZ)("div",M)):(0,c.tZ)(React.Fragment,null,H&&(0,c.tZ)(React.Fragment,null,(0,c.tZ)(u.BlockControls,null,(0,c.tZ)(p.Toolbar,null,(0,c.tZ)(p.Button,{icon:v.Z,onClick:function(){return O(!0)}},(0,i.__)("Edit Original","presto-player")))),(0,c.tZ)(u.InspectorControls,null,(0,c.tZ)(p.PanelBody,null,(0,c.tZ)(p.Flex,{align:"center",justify:"flex-start"},(0,c.tZ)(h.Z,{icon:m.Z}),(0,c.tZ)("h2",{class:"block-editor-block-card__title"},(0,i.__)("Synced","presto-player"))),(0,c.tZ)(p.BaseControl,{help:(0,i.__)("This item is synced with the media hub and can be reused across your site.","presto-player"),css:(0,c.iv)(o||(o=(0,l.Z)(["\n margin-bottom: 10px !important;\n "])))}),(0,c.tZ)(p.Button,{icon:v.Z,onClick:function(){return O(!0)},variant:"secondary"},(0,i.__)("Edit Original","presto-player")))),(0,c.tZ)("div",N,(0,c.tZ)("div",D)))):(0,c.tZ)(y.Z,{clientId:_}):(0,c.tZ)(p.Placeholder,{css:(0,c.iv)(n||(n=(0,l.Z)(["\n &.components-placeholder {\n min-height: 350px;\n }\n "]))),withIllustration:!0}):(0,c.tZ)("div",N,(0,c.tZ)(p.Placeholder,null,(0,c.tZ)(p.Spinner,null)))},save:function(){var e=u.useBlockProps.save(),t=u.useInnerBlocksProps.save(e);return(0,b.tZ)("div",t)},__experimentalLabel:function(e){var t,r=["postType","pp_video_block",e.id],n=(t=(0,f.select)(d.store)).getEditedEntityRecord.apply(t,r);return null==n?void 0:n.title},deprecated:[{attributes:{id:{type:"number"}},save:function(){return null}}]}},2692:function(e,t,r){"use strict";r.r(t),r.d(t,{metadata:function(){return p},name:function(){return d},options:function(){return f}}),r(5736);var n=r(4688),o=r(9307),a=r(7453),i=r(2175),l=r(9818),s=r(5246),c=r(249),u=r(917),p=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"presto-player/reusable-edit","apiVersion":2,"title":"Edit Media","category":"presto","description":"Create a playlist of videos or audio.","textdomain":"presto-player","usesContext":["presto-player/playlist-media-id"],"supports":{"inserter":false,"reusable":false,"html":false},"script":"presto-components"}'),d=p.name,f={icon:n.Z,edit:function(e){var t=e.clientId,r=e.isSelected,n=e.context,u=(0,l.useDispatch)(i.store).selectBlock,p=(0,l.useDispatch)(i.store).setTemplateValidity,d=(0,o.useContext)(c.Z).isEditing,f=(0,l.useSelect)((function(e){return e(i.store).getBlock(t).innerBlocks})),y=(0,i.useBlockProps)(),v=(0,i.useInnerBlocksProps)(y,{templateLock:!!d&&"all",renderAppender:!1});return p(!0),(0,o.useEffect)((function(){if(r&&n["presto-player/playlist-media-id"]){var e=(0,l.select)(i.store).getBlockOrder(t)[0];e&&u(e)}}),[r]),null!=f&&f.length?(0,a.tZ)("div",v):(0,a.tZ)("div",y,(0,a.tZ)(s.Z,{clientId:t}),(0,a.tZ)("div",v))},save:function(){var e=i.useBlockProps.save(),t=i.useInnerBlocksProps.save(e);return(0,u.tZ)("div",t)}}},4048:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return O},options:function(){return S}});var n=r(4942),o=(r(9307),r(2175)),a=r(2485),i=r(8989),l=r(2818),s=r(1713),c=r(2383),u=r(6263),p=r(7161),d=r(9641),f=r(917),y=wp.components,v=y.Button,h=y.Disabled,m=y.Toolbar,g=y.Placeholder,b=y.Spinner,Z=y.withNotices,w=wp.element.useEffect,__=wp.i18n.__,_=(0,wp.compose.compose)([(0,i.Z)(),(0,a.Z)()])(Z((function(e){var t=e.attributes,r=e.setAttributes,n=e.branding,a=e.noticeOperations,i=e.loading,y=e.createVideo,Z=e.lockSave,_=e.unlockSave,k=e.presetData,x=e.onRemoveSrc,C=e.renderKey,P=t.poster,O=t.src,S=t.id,E=(0,p.D9)(O);return w((function(){E&&r({id:0});var e=(0,u.L2)(O);r({video_id:e}),Z(),y({src:O,external_id:e,type:"vimeo"}).catch((function(e){r({src:""}),function(e){a.removeAllNotices(),a.createErrorNotice(null==e?void 0:e.message)}(e)})).finally(_)}),[O]),O?i||!S?(0,f.tZ)(g,{className:"presto-player__placeholder is-loading"},(0,f.tZ)(b,null)):(0,f.tZ)(React.Fragment,null,(0,f.tZ)(o.BlockControls,null,(0,f.tZ)(m,null,(0,f.tZ)(v,{onClick:function(){return x()}},__("Replace","presto-player"))),(0,f.tZ)(d.Z,null)),(0,f.tZ)(o.InspectorControls,null,(0,f.tZ)(l.Z,{setAttributes:r,attributes:t})),(0,f.tZ)("figure",null,(0,f.tZ)(h,null,(0,f.tZ)(s.Z,{poster:P,src:O,type:"vimeo",id:S,attributes:t,setAttributes:r,preset:k,branding:n,key:C})))):(0,f.tZ)("div",null,(0,f.tZ)(c.Z,{icon:(0,f.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,f.tZ)("path",{d:"M22.875 10.063c-2.442 5.217-8.337 12.319-12.063 12.319-3.672 0-4.203-7.831-6.208-13.043-.987-2.565-1.624-1.976-3.474-.681l-1.128-1.455c2.698-2.372 5.398-5.127 7.057-5.28 1.868-.179 3.018 1.098 3.448 3.832.568 3.593 1.362 9.17 2.748 9.17 1.08 0 3.741-4.424 3.878-6.006.243-2.316-1.703-2.386-3.392-1.663 2.673-8.754 13.793-7.142 9.134 2.807z"})),label:__("Presto Vimeo Video","presto-player"),instructions:__("Enter Vimeo Video URL","presto-player"),placeholder:__("Vimeo URL","presto-player"),attributes:t,setAttributes:r,onSelectURL:function(e){e!==O&&r({src:e})}}))}))),k=r(6183);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P=wp.i18n.__,O="presto-player/vimeo",S=C(C({},k.Z),{},{usesContext:["presto-player/playlist-media-id"],attributes:C(C({},k.Z.attributes),{},{video_id:{type:String}}),title:P("Presto Vimeo Video","presto-player"),description:P("A vimeo video wrapped in an awesome player.","presto-player"),icon:(0,f.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,f.tZ)("path",{d:"M22.875 10.063c-2.442 5.217-8.337 12.319-12.063 12.319-3.672 0-4.203-7.831-6.208-13.043-.987-2.565-1.624-1.976-3.474-.681l-1.128-1.455c2.698-2.372 5.398-5.127 7.057-5.28 1.868-.179 3.018 1.098 3.448 3.832.568 3.593 1.362 9.17 2.748 9.17 1.08 0 3.741-4.424 3.878-6.006.243-2.316-1.703-2.386-3.392-1.663 2.673-8.754 13.793-7.142 9.134 2.807z"})),edit:_})},8989:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=wp.data.withSelect;function o(e){return n((function(e){return{branding:e("presto-player/player").branding(),loading:e("presto-player/player").isResolving("getPresets"),presets:e("presto-player/player").getPresets(),defaultPreset:e("presto-player/player").getDefaultPreset()}}))}},2485:function(e,t,r){"use strict";var n=r(7462),o=r(4942),a=r(5861),i=r(3324),l=(r(9307),r(1284)),s=r.n(l),c=r(7161),u=r(9512),p=r(917);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=wp.compose.createHigherOrderComponent,v=wp.element,h=v.useEffect,m=v.useState;t.Z=function(){return y((function(e){return function(t){var r=t.presets,o=t.attributes,l=t.setAttributes,d=t.defaultPreset,y=t.isSelected,v=t.branding,g=m({}),b=(0,i.Z)(g,2),Z=b[0],w=b[1],k=m(1),x=(0,i.Z)(k,2),C=x[0],P=x[1],O=o.poster,S=o.chapters;h((function(){y&&null!=o&&o.selectionOverrideClientId&&wp.data.dispatch("core/block-editor").selectBlock(null==o?void 0:o.selectionOverrideClientId)}),[y]),h((function(){if(r&&r.length){var e=r.find((function(e){return e.id===(null==o?void 0:o.preset)}));e?w(e):(w(d),l({preset:null==d?void 0:d.id}))}}),[r,null==o?void 0:o.preset]),h((function(){E()}),[O,Z,S,v.logo]);var E=function(){P(C+1)},$=(0,c.D9)(S);h((function(){var e=null==S?void 0:S.map((function(e){return e.time})),t=null==$?void 0:$.map((function(e){return e.time}));_.difference(e,t).length&&E()}),[S]);var N=function(){var e=(0,a.Z)(s().mark((function e(t){var r,n,o,a,i,c,p;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.src,n=t.external_id,o=t.attachment_id,a=t.type,i=t.title,r||n||o){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,(0,u.Z)({method:"POST",path:"/presto-player/v1/videos",data:f(f({attachment_id:o,post_id:wp.data.select("core/editor").getCurrentPostId(),external_id:n},i?{title:i}:{}),{},{src:r,type:a})});case 5:c=e.sent,p=c.id,l({id:p});case 8:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();return null!=o&&o.preset||l({preset:null==d?void 0:d.id}),(0,p.tZ)(e,(0,n.Z)({},t,{lockSave:function(){return wp.data.dispatch("core/editor").lockPostSaving("presto-player")},unlockSave:function(){return wp.data.dispatch("core/editor").unlockPostSaving("presto-player")},createVideo:N,onUpdate:E,onRemoveSrc:function(){confirm("Remove this video?")&&l(f(f(f(f({src:"",id:void 0},null!=o&&o.thumbnail?{thumbnail:null}:{}),null!=o&&o.preview?{preview:null}:{}),null!=o&&o.previewSrc?{previewSrc:null}:{}),null!=o&&o.previewThumbnail?{previewThumbnail:null}:{}))},presetData:Z,setPresetData:w,renderKey:C}))}}),"withPlayerEdit")}},2132:function(e,t,r){"use strict";r.r(t),r.d(t,{name:function(){return O},options:function(){return S}});var n=r(4942),o=(r(9307),r(2175)),a=r(2485),i=r(8989),l=r(2818),s=r(1713),c=r(2383),u=r(6263),p=r(7161),d=r(9641),f=r(917),y=wp.components,v=y.Button,h=y.Disabled,m=y.Toolbar,g=y.Placeholder,b=y.Spinner,Z=y.withNotices,w=wp.element.useEffect,__=wp.i18n.__,_=(0,wp.compose.compose)([(0,i.Z)(),(0,a.Z)()])(Z((function(e){var t=e.attributes,r=e.setAttributes,n=e.noticeOperations,a=e.branding,i=e.createVideo,y=e.loading,Z=e.presetData,_=e.onRemoveSrc,k=e.lockSave,x=e.unlockSave,C=e.renderKey,P=t.poster,O=t.src,S=t.id,E=(0,p.D9)(O);return w((function(){E&&r({id:0});var e=(0,u.qS)(O);r({video_id:e}),k(),i({src:O,external_id:e,type:"youtube"}).catch((function(e){r({src:""}),function(e){n.removeAllNotices(),n.createErrorNotice(null==e?void 0:e.message)}(e)})).finally(x)}),[O]),O?y||!S?(0,f.tZ)(g,{className:"presto-player__placeholder is-loading"},(0,f.tZ)(b,null)):(0,f.tZ)(React.Fragment,null,(0,f.tZ)(o.BlockControls,null,(0,f.tZ)(m,null,(0,f.tZ)(v,{onClick:function(){return _()}},__("Replace","presto-player"))),(0,f.tZ)(d.Z,null)),(0,f.tZ)(o.InspectorControls,null,(0,f.tZ)(l.Z,{setAttributes:r,attributes:t})),(0,f.tZ)("figure",null,(0,f.tZ)(h,null,(0,f.tZ)(s.Z,{poster:P,src:O,type:"youtube",id:S,attributes:t,setAttributes:r,preset:Z,branding:a,key:C})))):(0,f.tZ)("div",null,(0,f.tZ)(c.Z,{icon:(0,f.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,f.tZ)("path",{d:"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"}),(0,f.tZ)("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"})),label:__("Presto Youtube Video","presto-player"),instructions:__("Enter Youtube Video URL","presto-player"),placeholder:__("Youtube URL","presto-player"),attributes:t,setAttributes:r,onSelectURL:function(e){e!==O&&r({src:e})}}))}))),k=r(6183);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P=wp.i18n.__,O="presto-player/youtube",S=C(C({},k.Z),{},{usesContext:["presto-player/playlist-media-id"],attributes:C(C({},k.Z.attributes),{},{video_id:{type:String}}),title:P("Presto Youtube Video","presto-player"),description:P("A youtube video wrapped in an awesome player.","presto-player"),icon:(0,f.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},(0,f.tZ)("path",{d:"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"}),(0,f.tZ)("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"})),edit:_})},2818:function(e,t,r){"use strict";r.d(t,{Z:function(){return Br}});var n=r(168),o=r(9307),a=r(7453),i=r(5609),l=r(376),s=r(8184),c=r(5736),u=r(9818),p=r(7798),d=r(4994),f=r(398),y=r(9807),v=r(3324),h=r(2982),m=r(4942),g=r(4831),b=r(7161),Z=r(1713),w=r(917);function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){(0,m.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x,C,P=function(e){var t,r,n,a=e.state,l=e.branding,s=e.menu,u=e.src,p=e.poster,d=e.currentTime,f=e.preload,y=e.overlays,h=e.isDisabled,m=void 0===h||h,_=(0,o.useState)(1),x=(0,v.Z)(_,2),C=x[0],P=x[1],O=a.email_collection,S=a.cta,E=a.search;(0,o.useEffect)((function(){P(C+1)}),[a.skin,a["play-large"],a.rewind,a.play,a["fast-forward"],a.progress,a["current-time"],a.mute,a.volume,a.speed,a.pip,a.fullscreen,a.captions,a.hide_logo]);var $={email:!(null==O||!O.enabled)&&(0,w.tZ)(g.zi,{className:"email-overlay",slot:"player-end",headline:null==O?void 0:O.headline,style:k(k({"--presto-player-email-border-radiuss":"".concat(null==O?void 0:O.button_radius,"px"),"--plyr-color-main":(null==a?void 0:a.background_color)||(null==l?void 0:l.color)},O.button_color?{"--presto-player-button-color":"".concat(O.button_color)}:{}),O.button_text_color?{"--presto-player-button-text":"".concat(O.button_text_color)}:{}),defaultHeadline:(0,c.__)("Enter your email to play.","presto-player"),bottomText:null==O?void 0:O.bottom_text,allowSkip:null==O?void 0:O.allow_skip,skipText:(0,c.__)("Skip","presto-player"),buttonText:null==O?void 0:O.button_text,placeholder:(0,c.__)("Email address","presto-player"),i18n:window.prestoPlayer.i18n}),cta:!(null==S||!S.enabled)&&(0,w.tZ)(g.UP,{className:"cta-overlay",style:k(k(k({"--presto-player-button-border-radius":"".concat(S.button_radius,"px")},null!=S&&S.background_opacity?{"--presto-player-cta-background-opacity":"".concat((null==S?void 0:S.background_opacity)/100)}:{}),S.button_color?{"--presto-player-button-color":"".concat(S.button_color)}:{}),S.button_text_color?{"--presto-player-button-text":"".concat(S.button_text_color)}:{}),slot:"player-end",headline:null==S?void 0:S.headline,"bottom-text":null==S?void 0:S.bottom_text,"button-link":null==S?void 0:S.button_link,"allow-skip":100!==(null==S?void 0:S.percentage)&&(null==S?void 0:S.show_skip),borderRadius:null==S?void 0:S.border_radius,"allow-rewatch":100===(null==S?void 0:S.percentage)&&(null==S?void 0:S.show_rewatch),"skip-text":(0,c.__)("Skip","presto-player"),"show-button":null==S?void 0:S.show_button,"button-text":null==S?void 0:S.button_text,i18n:null===(t=window)||void 0===t||null===(r=t.prestoPlayer)||void 0===r?void 0:r.i18n})};return(0,w.tZ)(i.Disabled,{isDisabled:m,className:"disable-player",style:{width:"100%"}},(0,w.tZ)("div",{className:"presto-player__wrapper"},(0,w.tZ)(Z.Z,{src:u||"",className:"\n ".concat("cta"===s&&!(null==S||!S.enabled)&&"cta-active"," \n ").concat("email"===s&&!(null==O||!O.enabled)&&"email-active","\n ").concat("search"===s&&!(null==E||!E.enabled)&&"search-active"),preset:a,branding:k(k({},l),{},{logo:null!=a&&a.hide_logo?"":l.logo}),i18n:null===(n=prestoPlayerAdmin)||void 0===n?void 0:n.i18n,preload:f,attributes:{chapters:[],poster:p},currentTime:d?(0,b.ZD)(d):"",overlays:y,key:C,adminPreview:(null==$?void 0:$[s])||""})))},O=r(5297),__=wp.i18n.__,S=wp.components.TextareaControl,E=wp.element.useState,$=function(e){var t=e.text,r=e.update,n=e.onFocus,o=E(!1),a=(0,v.Z)(o,2),i=a[0],l=a[1];return(0,w.tZ)("div",{style:{display:"block",width:"100%"}},(0,w.tZ)(S,{label:"Text",help:(0,w.tZ)("span",null,__("This field accepts","presto-player")," ",(0,w.tZ)("a",{href:"#",onClick:function(e){l(!i),e.preventDefault()}},__("Dynamic Data","presto-player")),!!i&&(0,w.tZ)("div",{style:{marginTop:"20px"}},__("This field will also accept dynamic values that we will replace with dynamic content: {user.user_login}, {user.user_nicename}, {user.user_email}, {user.user_url},{user.user_registered}, {user.display_name}, {site.url}, {site.name}, {ip_address}","presto-player"))),className:"presto-player__overlay--text",placeholder:__("Enter some text.","presto-player"),value:t||"",onChange:function(e){return r({text:e})},autoComplete:"off",onFocus:n}))},N=r(1145),T=wp.i18n.__,A=wp.components,j=A.Flex,R=A.FlexItem,I=A.TextControl,L=A.Button,B=A.BaseControl,D=A.RadioControl,M=A.RangeControl,F=(A.withFocusReturn,wp.element),V=F.useRef,U=F.useEffect,z=wp.element.useState,G={name:"1azpx8r",styles:"margin-bottom:20px"},H=function(e){var t=e.overlayIndex,r=e.update,n=e.remove,o=e.className,i=e.startTime,l=e.endTime,s=e.text,c=e.link,u=e.position,p=e.color,d=e.backgroundColor,f=e.opacity,y=e.updateCurrentTime,h=z(i),m=(0,v.Z)(h,2),g=m[0],Z=m[1],w=z(l),_=(0,v.Z)(w,2),k=_[0],x=_[1],C=z(u),P=(0,v.Z)(C,2),S=P[0],E=P[1],A=V();U((function(){if((0,b.ZD)(i)>=(0,b.ZD)(l)){var e=(0,b.as)(i),t=(0,b.ZD)(e)+1;e=(0,b.as)((0,b.nH)(t)),r({endTime:e}),x(e)}}),[i,l]);var F=function(){var e=(0,b.as)(g);r({startTime:e}),Z(e),y(e)};return(0,a.tZ)("div",null,(0,a.tZ)(j,{align:"center",className:o},(0,a.tZ)(R,null,(0,a.tZ)(I,{ref:A,id:"start-time-".concat(t),label:T("Start Time","presto-player"),className:"presto-player__overlay--start-time",value:g,onChange:function(e){return Z(e)},onBlur:F,onFocus:F,autoComplete:"off",placeholder:"0:00"})),(0,a.tZ)(R,null,(0,a.tZ)(I,{label:T("End Time","presto-player"),className:"presto-player__overlay--end-time",value:k,onChange:x,onBlur:function(){var e=(0,b.as)(k);r({endTime:e}),x(e)},autoComplete:"off",placeholder:"0:00"}))),(0,a.tZ)($,{text:s,update:r,onFocus:function(){y((0,b.as)(g))}}),(0,a.tZ)(B,{style:{width:"100%"}},(0,a.tZ)(B.VisualLabel,null,(0,a.tZ)("p",null," ",T("Link","presto-player"))),(0,a.tZ)(O.Z,{onFocus:function(){y((0,b.as)(g))},setSettings:function(e){return r({link:e})},settings:c||{}})),(0,a.tZ)(B,{className:o},(0,a.tZ)(D,{label:T("Position","presto-player"),options:[{label:T("Top Right","presto-player"),value:"top-right"},{label:T("Top Left","presto-player"),value:"top-left"}],selected:S||"right",onFocus:function(){y((0,b.as)(g))},onChange:function(e){r({position:e}),E(e),y((0,b.as)(g))}})),(0,a.tZ)(B,{className:"presto-player__control--overlay-text-color"},(0,a.tZ)(j,null,(0,a.tZ)(B.VisualLabel,null,T("Text Color","presto-player")),(0,a.tZ)(N.Z,{onFocus:function(){y((0,b.as)(g))},color:p,setColor:function(e){r({color:e&&e.hex})}}))),(0,a.tZ)(B,{className:"presto-player__control--overlay-background-color"},(0,a.tZ)(j,null,(0,a.tZ)(B.VisualLabel,null,T("Background Color","presto-player")),(0,a.tZ)(N.Z,{onFocus:function(){y((0,b.as)(g))},color:d,setColor:function(e){r({backgroundColor:e&&e.hex})}}))),(0,a.tZ)(B,null,(0,a.tZ)(M,{label:T("Opacity","presto-player"),help:T("Opacity percentage of the overlay.","presto-player"),value:f,onChange:function(e){return r({opacity:e})},min:0,max:100})),n&&(0,a.tZ)(B,{className:o},(0,a.tZ)(j,{justify:"flex-end"},(0,a.tZ)(L,{isDestructive:!0,isSmall:!0,onClick:n},T("Remove Overlay","presto-player")))),(0,a.tZ)("hr",{css:G}))};function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach((function(t){(0,m.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Y,X=wp.i18n.__,K=wp.components,Q=K.Button,J=K.Flex,ee=K.FlexItem,te=K.FlexBlock,re=K.Modal,ne=wp.element,oe=ne.useState,ae=ne.useEffect,ie=wp.data.useSelect,le={name:"1cwazio",styles:"padding:3px"},se=function(e){var t=e.closeModal,r=e.attributes,o=e.setAttributes,i=e.updateOverlayAttribute,l=oe(!1),s=(0,v.Z)(l,2),c=s[0],u=s[1],p=oe(""),d=(0,v.Z)(p,2),f=d[0],y=d[1],m=r.overlays,g=r.preset,b=r.src,Z=r.poster,w=r.previewSrc,_=ie((function(e){return e("presto-player/player").branding()})),k=ie((function(e){return e("presto-player/player").getPreset(g)}));ae((function(){m.length||O()}),[]);var O=function(){var e={startTime:"0:00",endTime:"0:05",text:X("Here's a link to click!","presto-player"),link:{},position:"top-right",color:"#fff",backgroundColor:"#000",opacity:75};m[m.length-1]&&(e=q({},m[m.length-1])),e.id=((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),""))(10),o({overlays:[].concat((0,h.Z)(m||[]),[e])})};return(0,a.tZ)(re,{title:X("Manage Video Overlays","presto-player"),onRequestClose:t,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay",shouldCloseOnClickOutside:!1},(0,a.tZ)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},(0,a.tZ)(J,{align:"stretch",className:"presto-player__style-preview-area"},(0,a.tZ)(ee,{className:"presto-player__style-sidebar"},(0,a.tZ)("div",{css:le},(m||[]).sort((function(e,t){return parseInt(e.startTime.split(":")[0])-parseInt(t.startTime.split(":")[0])==0?parseInt(e.startTime.split(":")[1])-parseInt(t.startTime.split(":")[1]):parseInt(e.startTime.split(":")[0])-parseInt(t.startTime.split(":")[0])})).map((function(e,t){return(0,a.tZ)(H,{key:"".concat(t,"-").concat(e.startTime),overlayIndex:t,className:"presto-player__overlay",startTime:e.startTime,endTime:e.endTime,text:e.text,link:e.link,position:e.position,color:e.color,backgroundColor:e.backgroundColor,opacity:e.opacity,overlay:e,update:function(t){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=m.indexOf(e),n=m.map((function(e,n){return n!==r?e:q(q({},e),t)}));o({overlays:n})}(e,t)},remove:function(){!function(e){var t=m.indexOf(e);o({overlays:m.filter((function(e,r){return r!==t}))})}(e)},updateCurrentTime:function(e){var t;t=e,y(""),process.nextTick((function(){y(t)}))}})})),(0,a.tZ)(Q,{isPrimary:!0,onClick:O},X("Add An Overlay","presto-player")))),(0,a.tZ)(te,{className:"presto-player__style-preview-panel"},(0,a.tZ)(P,{preload:"auto",currentTime:f,src:w||b,isDisabled:!1,state:q(q({},k),{},{lazy_load_youtube:!1,invert_time:!1}),branding:_,poster:Z,overlays:m}))),(0,a.tZ)("br",null),(0,a.tZ)("div",{css:(0,a.iv)(x||(x=(0,n.Z)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},(0,a.tZ)("div",{css:(0,a.iv)(C||(C=(0,n.Z)(["\n opacity: 0.5;\n font-size: 12px;\n "])))}),(0,a.tZ)("div",null,(0,a.tZ)(Q,{isTertiary:!0,onClick:t,style:{margin:"0 6px"}},X("Cancel","presto-player")),(0,a.tZ)(Q,{isPrimary:!0,isBusy:c,disabled:c,onClick:function(){u(!0),i(m),u(!1),t()},"data-cy":"submit-preset"},X("Save Overlays","presto-player"))))))},ce=wp.i18n.__,ue=wp.element.useState,pe=wp.data,de=(pe.useSelect,pe.dispatch),fe=wp.components,ye=(fe.withNotices,fe.BaseControl),ve=(fe.Spinner,fe.Button),he=function(e){var t,r=e.setAttributes,o=e.attributes,i=o.overlays,l=ue(!1),s=(0,v.Z)(l,2),c=s[0],u=s[1];return(0,a.tZ)(React.Fragment,null,(0,a.tZ)(ye,null,(0,a.tZ)(ve,{isPrimary:!0,onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?u(!0):de("presto-player/player").setProModal(!0)}},i.length?ce("Update Overlays","presto-player"):ce("Add Overlay","presto-player"),!!i.length&&(0,a.tZ)("div",{css:(0,a.iv)(Y||(Y=(0,n.Z)(["\n font-size: 10px;\n background: #fff;\n color: var(--wp-admin-theme-color);\n font-weight: bold;\n display: inline-block;\n line-height: 6px;\n padding: 5px;\n border-radius: 9999px;\n margin-left: 10px;\n "])))},i.length)),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&(0,a.tZ)(y.Z,null)),c&&(0,a.tZ)(se,{closeModal:function(){return u(!1)},attributes:o,setAttributes:r,updateOverlayAttribute:function(e){r({overlays:e})}}))},me=r(6774),ge=r(5861),be=r(1284),Ze=r.n(be),we=r(9493),_e=r(3865),ke=wp.i18n.__,xe=wp.components,Ce=xe.ToggleControl,Pe=xe.BaseControl,Oe=xe.HorizontalRule,Se=xe.__experimentalAlignmentMatrixControl,Ee=xe.SelectControl;function $e(e){var t=e.state,r=e.updateState,n=e.className;return(0,w.tZ)("div",{className:n},(0,w.tZ)(Pe,null,(0,w.tZ)("h3",null,ke("Behavior","presto-player"))),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Auto-Hide Controls","presto-player"),help:ke("Hide video controls automatically after 2 seconds of no mouse movement.","presto-player"),onChange:function(e){r({auto_hide:e})},checked:t.auto_hide})),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Show Time Elapsed","presto-player"),help:ke("Show the time elapsed or the time remaining for the video on the player. By default, the time remaining is shown.","presto-player"),onChange:function(e){r({show_time_elapsed:e})},checked:t.show_time_elapsed})),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Save Play Position","presto-player"),help:ke("Saves the user's play position so when they come back to the page they can continue the video from where they left off.","presto-player"),onChange:function(e){r({save_player_position:e})},checked:t.save_player_position})),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Captions On By Default","presto-player"),help:ke("Toggles if captions should be active by default.","presto-player"),onChange:function(e){r({captions_enabled:e})},checked:t.captions_enabled})),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Focus Mode","presto-player"),help:ke("Play only when tab is visible and video is in viewport.","presto-player"),onChange:function(e){r({play_video_viewport:e})},checked:t.play_video_viewport})),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Sticky On Scroll","presto-player"),help:ke("Stick videos to the side of the screen when the page is scrolled and the video is playing.","presto-player"),onChange:function(e){r({sticky_scroll:e})},checked:t.sticky_scroll})),!!t.sticky_scroll&&(0,w.tZ)(React.Fragment,null,(0,w.tZ)(Pe,{label:ke("Choose a position for your sticky player.","presto-player")},(0,w.tZ)(Se,{value:t.sticky_scroll_position,onChange:function(e){r({sticky_scroll_position:e})}}))),(0,w.tZ)(Pe,null,(0,w.tZ)(Ee,{label:ke("On Video End","presto-player"),value:t.on_video_end,options:[{value:"select",label:ke("Select","presto-player")},{value:"loop",label:ke("Loop","presto-player")},{value:"go-to-start",label:ke("Go to start","presto-player")}],onChange:function(e){r({on_video_end:e})}})),(0,w.tZ)(Oe,null),(0,w.tZ)(Pe,null),(0,w.tZ)(Pe,null,(0,w.tZ)("h3",null,ke("Youtube","presto-player"))),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Hide Youtube UI (Experimental)","presto-player"),help:ke("Hides the Youtube logo and related videos.","presto-player"),onChange:function(e){r({hide_youtube:e})},checked:t.hide_youtube})),(0,w.tZ)(Pe,null,(0,w.tZ)(Ce,{label:ke("Lazy Load Videos","presto-player"),help:ke("Improves page loading performance by only loading the video when clicked.","presto-player"),onChange:function(e){r({lazy_load_youtube:e})},checked:t.lazy_load_youtube})))}var Ne=wp.i18n.__,Te=wp.components,Ae=Te.ToggleControl,je=Te.BaseControl;function Re(e){var t=e.state,r=e.updateState,n=e.className;return(0,w.tZ)("div",{className:n},(0,w.tZ)(je,null,(0,w.tZ)("h3",null,Ne("Controls","presto-player"))),(0,w.tZ)(je,{className:"presto-player__control--large-play"},(0,w.tZ)(Ae,{label:Ne("Large Play Button","presto-player"),help:Ne("Adds a large play button over the top of the player.","presto-player"),onChange:function(e){r({"play-large":e})},checked:t["play-large"]})),(0,w.tZ)(je,{className:"presto-player__control--rewind"},(0,w.tZ)(Ae,{label:Ne("Rewind","presto-player"),help:Ne("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({rewind:e})},checked:t.rewind})),(0,w.tZ)(je,{className:"presto-player__control--play"},(0,w.tZ)(Ae,{label:Ne("Small Play Button","presto-player"),help:Ne("Adds a small play button to the bottom of the player.","presto-player"),onChange:function(e){r({play:e})},checked:t.play})),(0,w.tZ)(je,{className:"presto-player__control--fast-forward"},(0,w.tZ)(Ae,{label:Ne("Fast Forward","presto-player"),help:Ne("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({"fast-forward":e})},checked:t["fast-forward"]})),(0,w.tZ)(je,{className:"presto-player__control--progress"},(0,w.tZ)(Ae,{label:Ne("Progress Bar","presto-player"),help:Ne("Shows a seekable progress bar.","presto-player"),onChange:function(e){r({progress:e})},checked:t.progress})),(0,w.tZ)(je,{className:"presto-player__control--current-time"},(0,w.tZ)(Ae,{label:Ne("Current Time","presto-player"),help:Ne("Shows the video timestamp.","presto-player"),onChange:function(e){r({"current-time":e})},checked:t["current-time"]})),(0,w.tZ)(je,{className:"presto-player__control--volume"},(0,w.tZ)(Ae,{label:Ne("Volume","presto-player"),help:Ne("Shows a volume bar.","presto-player"),onChange:function(e){r({volume:e,mute:e})},checked:t.volume})),(0,w.tZ)(je,{className:"presto-player__control--speed"},(0,w.tZ)(Ae,{label:Ne("Speed","presto-player"),help:Ne("Shows playback speed controls.","presto-player"),onChange:function(e){r({speed:e})},checked:t.speed})),(0,w.tZ)(je,{className:"presto-player__control--pip"},(0,w.tZ)(Ae,{label:Ne("Picture In Picture (HTML5 only)","presto-player"),help:Ne("Allows users to dock the player on their screen and watch when using other app on their computer.","presto-player"),onChange:function(e){r({pip:e})},checked:t.pip})),(0,w.tZ)(je,{className:"presto-player__control--fullscreen"},(0,w.tZ)(Ae,{label:Ne("Fullscreen","presto-player"),help:Ne("Adds a button to allow the player to be fullscreen.","presto-player"),onChange:function(e){r({fullscreen:e})},checked:t.fullscreen})),(0,w.tZ)(je,{className:"presto-player__control--captions"},(0,w.tZ)(Ae,{label:Ne("Captions","presto-player"),help:Ne("Shows a dedicated caption toggle button.","presto-player"),onChange:function(e){r({captions:e})},checked:t.captions})))}function Ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(r),!0).forEach((function(t){(0,m.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Be=wp.i18n.__,De=wp.components,Me=De.ToggleControl,Fe=De.BaseControl,Ve=De.RadioControl,Ue=De.Flex,ze=De.RangeControl,Ge=wp.element.useEffect,He=function(e){var t=e.state,r=e.updateState,n=e.className,o=t.watermark,a={text:Be("Enter your watermark text.","presto-player"),position:"top-right",color:"#fff",backgroundColor:"#333",opacity:80};Ge((function(){Object.keys(a).forEach((function(e){var r;void 0===(null==t||null===(r=t.watermark)||void 0===r?void 0:r[e])&&i((0,m.Z)({},e,a[e]))}))}),[t]);var i=function(e){r(Le(Le({},t),{},{watermark:Le(Le({},o),e)}))};return(0,w.tZ)("div",{className:n},(0,w.tZ)(Fe,null,(0,w.tZ)("h3",null,Be("Dynamic Watermark Text","presto-player"))),(0,w.tZ)(Fe,{className:"presto-player__control--watermark"},(0,w.tZ)(Me,{label:Be("Enable","presto-player"),help:Be("Add a simulated dynamic watermark over your video.","presto-player"),onChange:function(e){i({enabled:e})},checked:null==o?void 0:o.enabled})),(null==o?void 0:o.enabled)&&(0,w.tZ)("div",null,(0,w.tZ)($,{text:null==o?void 0:o.text,update:function(e){var t=e.text;i({text:t})}}),(0,w.tZ)(Fe,{className:n},(0,w.tZ)(Ve,{label:Be("Position","presto-player"),options:[{label:Be("Top Right","presto-player"),value:"top-right"},{label:Be("Top Left","presto-player"),value:"top-left"},{label:Be("Change Every 10 Seconds","presto-player"),value:"randomize"}],selected:(null==o?void 0:o.position)||"top-right",onChange:function(e){return i({position:e})}})),(0,w.tZ)(Fe,{className:"presto-player__control-text-color"},(0,w.tZ)(Ue,null,(0,w.tZ)(Fe.VisualLabel,null,Be("Text Color","presto-player")),(0,w.tZ)(N.Z,{color:(null==o?void 0:o.color)||"#fff",setColor:function(e){return i({color:e&&e.hex})}}))),(0,w.tZ)(Fe,{className:"presto-player__control-text-color"},(0,w.tZ)(Ue,null,(0,w.tZ)(Fe.VisualLabel,null,Be("Background Color","presto-player")),(0,w.tZ)(N.Z,{color:(null==o?void 0:o.backgroundColor)||"#333",setColor:function(e){return i({backgroundColor:e&&e.hex})}}))),(0,w.tZ)(Fe,null,(0,w.tZ)(ze,{label:Be("Opacity","presto-player"),help:Be("Opacity percentage of the watermark.","presto-player"),value:(null==o?void 0:o.opacity)||100,onChange:function(e){return i({opacity:e})},min:0,max:100}))))},We=r(444),qe=r(5893),Ye=(0,qe.jsx)(We.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,qe.jsx)(We.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),Xe=(0,qe.jsx)(We.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,qe.jsx)(We.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})});function Ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(r),!0).forEach((function(t){(0,m.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Je,et,tt,rt=function(e){var t=e.state,r=e.updateState,n=e.className,a=t.search,l=(0,o.useState)(!1),s=(0,v.Z)(l,2),u=s[0],p=s[1],d={enabled:!1,minMatchCharLength:1,threshold:.3,placeholder:"Search"};(0,o.useEffect)((function(){Object.keys(d).forEach((function(e){var r;void 0===(null==t||null===(r=t.search)||void 0===r?void 0:r[e])&&f((0,m.Z)({},e,d[e]))}))}),[t]);var f=function(e){r(Qe(Qe({},t),{},{search:Qe(Qe({},a),e)}))};return(0,w.tZ)("div",{className:n},(0,w.tZ)(i.BaseControl,null,(0,w.tZ)("h3",null,(0,c.__)("Searchable Captions","presto-player"))),(0,w.tZ)(i.BaseControl,{className:"presto-player__control--search"},(0,w.tZ)(i.ToggleControl,{label:(0,c.__)("Enable","presto-player"),help:(0,c.__)("Show a search bar on your player which enables searching within the subtitles of the video.","presto-player"),onChange:function(e){f({enabled:e})},checked:null==a?void 0:a.enabled})),(null==a?void 0:a.enabled)&&(0,w.tZ)("div",null,(0,w.tZ)(i.BaseControl,{className:"presto-player__control--placeholder-text"},(0,w.tZ)(i.TextControl,{label:(0,c.__)("Placeholder Text","presto-player"),help:"",value:null==a?void 0:a.placeholder,onChange:function(e){return f({placeholder:e})}})),(0,w.tZ)(i.BaseControl,null,(0,w.tZ)(i.Button,{onClick:function(){return p(!u)},iconPosition:"right",icon:u?Ye:Xe,variant:"link"},(0,c.__)("Advanced Settings","presto-player"))),!!u&&(0,w.tZ)(React.Fragment,null,(0,w.tZ)(i.BaseControl,null,(0,w.tZ)(i.RangeControl,{label:(0,c.__)("Minimum Matching Character Length","presto-player"),help:(0,c.__)("Only the matches whose length exceeds this value will be returned. (For instance, if you want to ignore single character matches in the result, set it to 2","presto-player"),value:(null==a?void 0:a.minMatchCharLength)||1,onChange:function(e){return f({minMatchCharLength:e})},min:0,max:10})),(0,w.tZ)(i.BaseControl,null,(0,w.tZ)(i.RangeControl,{label:(0,c.__)("Threshold","presto-player"),help:(0,c.__)("At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match (of both letters and location), a threshold of 1.0 would match anything.","presto-player"),value:(null==a?void 0:a.threshold)||1,onChange:function(e){return f({threshold:e})},min:0,max:1,step:.1})))))},nt=r(7833),ot=r(9632),at=wp.i18n.__,it=wp.components,lt=it.ToggleControl,st=it.BaseControl,ct=it.RangeControl,ut=it.SelectControl,pt=it.ColorPicker;function dt(e){var t=e.state,r=e.updateState,o=e.className;return(0,w.tZ)("div",{className:o},(0,w.tZ)(st,null,(0,w.tZ)("h3",null,at("Style","presto-player"))),(0,w.tZ)(st,null,(0,w.tZ)(lt,{label:at("Hide Logo","presto-player"),help:at("Hides the logo on this video.","presto-player"),onChange:function(e){r({hide_logo:e})},checked:t.hide_logo})),(0,w.tZ)(st,null,(0,w.tZ)(ct,{label:at("Round Corners","presto-player"),help:at("Player border radius size.","presto-player"),value:(null==t?void 0:t.border_radius)||0,onChange:function(e){return r({border_radius:e})},min:0,max:25,css:(0,a.iv)(Je||(Je=(0,n.Z)(["\n padding-left: 4px;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))})),(0,w.tZ)(st,null,(0,w.tZ)(ut,{label:at("Caption Style","presto-player"),labelPosition:"top",value:null==t?void 0:t.caption_style,options:[{label:at("Default","presto-player"),value:"default"},{label:at("Full","presto-player"),value:"full"}],onChange:function(e){r({caption_style:e})}})),(0,w.tZ)(st,null,(0,w.tZ)(st.VisualLabel,null,(0,w.tZ)("p",null,at("Caption Background","presto-player"))),(0,w.tZ)(pt,{color:(null==t?void 0:t.caption_background)||"#000000",onChangeComplete:function(e){r({caption_background:e.hex})},disableAlpha:!0})))}function ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(r),!0).forEach((function(t){(0,m.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var vt=wp.i18n.__,ht=wp.components,mt=ht.TextControl,gt=ht.BaseControl,bt=ht.Icon,Zt=ht.Notice,wt=ht.Button,_t=ht.Flex,kt=ht.FlexItem,xt=ht.SelectControl,Ct=ht.FlexBlock,Pt=ht.Modal,Ot=wp.element,St=Ot.useState,Et=Ot.useEffect,$t=wp.data,Nt=$t.useSelect,Tt=$t.dispatch,At=function(e){var t=e.type,r=void 0===t?"new":t,o=e.closeModal,i=e.addPreset,l=e.onSave,s=e.updatePreset,c=e.name,u=void 0===c?"":c,p=e.preset,d=void 0===p?{"play-large":!0,rewind:!0,play:!0,"fast-forward":!0,progress:!0,"current-time":!0,mute:!0,volume:!0,speed:!1,pip:!1,fullscreen:!0,captions:!1,save_player_position:!1,reset_on_end:!1,auto_hide:!0,show_time_elapsed:!1,sticky_scroll:!1,hide_logo:!1,border_radius:0,skin:"modern",caption_style:"default",caption_background:"#000000",hide_youtube:!1,lazy_load_youtube:!1,cta:{},email_collection:{},action_bar:{},enabled:!1,minMatchCharLength:1,threshold:.3,placeholder:"search"}:p,f=St(!1),y=(0,v.Z)(f,2),h=y[0],m=y[1],g=St(""),Z=(0,v.Z)(g,2),w=Z[0],_=Z[1],k=St(""),x=(0,v.Z)(k,2),C=x[0],O=x[1],S=St(u),E=(0,v.Z)(S,2),$=E[0],N=E[1],T=St(d),A=(0,v.Z)(T,2),j=A[0],R=A[1],I=Nt((function(e){return e("presto-player/player").branding()})),L=St(""),B=(0,v.Z)(L,2),D=B[0],M=B[1],F={message:vt("The preset could not be saved. Please reload the page and try again.","presto-player")},V=Nt((function(e){return e("presto-player/player").youtube()}));Et((function(){M(V.channel_id)}),[null==V?void 0:V.channel_id]);var U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(yt(yt({},j),e))},z=function(){var e=(0,ge.Z)(Ze().mark((function e(){var t,r,n,a;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m(!0),e.prev=1,t=yt(yt({},j),{name:$}),e.next=5,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"preset/").concat(d.id),{_method:"PUT"}),data:t});case 5:if(r=e.sent){e.next=8;break}throw F;case 8:s(r),o(),l&&l(r),(0,b.i1)({message:vt("Preset updated!","presto-player")}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),_(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:F);case 17:return e.prev=17,m(!1),e.finish(17);case 20:return Tt("presto-player/player").updateYoutube({channel_id:D}),n=yt(yt({},V),{channel_id:D}),e.prev=22,e.next=25,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:n}});case 25:null!=(a=e.sent)&&a.presto_player_youtube&&(Tt("presto-player/player").setYoutube(null==a?void 0:a.presto_player_youtube),onClose()),e.next=32;break;case 29:e.prev=29,e.t1=e.catch(22),console.log(e.t1);case 32:case"end":return e.stop()}}),e,null,[[1,14,17,20],[22,29]])})));return function(){return e.apply(this,arguments)}}(),G=function(){var e=(0,ge.Z)(Ze().mark((function e(){var t;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m(!0),e.prev=1,e.next=4,wp.apiFetch({method:"POST",url:prestoPlayer.root+prestoPlayer.prestoVersionString+"preset",data:yt(yt({},{name:$}),j)});case 4:if(t=e.sent){e.next=7;break}throw F;case 7:i(t),o(),l&&l(t),(0,b.i1)({message:vt("Preset created!","presto-player")}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),_(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:F);case 16:return e.prev=16,m(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),H=[{name:"controls",title:vt("Controls","presto-player"),icon:(0,a.tZ)(bt,{icon:"admin-settings"}),component:(0,a.tZ)(Re,{updateState:U,state:j})},{name:"behavior",title:vt("Behavior","presto-player"),icon:(0,a.tZ)(bt,{icon:"admin-generic"}),component:(0,a.tZ)($e,{updateState:U,state:j})},{name:"style",title:vt("Style","presto-player"),icon:(0,a.tZ)(bt,{icon:"admin-customizer"}),component:(0,a.tZ)(dt,{updateState:U,state:j})},{name:"email",title:vt("Email Capture","presto-player"),icon:(0,a.tZ)(bt,{icon:"email"}),component:(0,a.tZ)(ot.Z,{updateState:U,state:j})},{name:"cta",title:vt("Call To Action","presto-player"),icon:(0,a.tZ)(bt,{icon:"megaphone"}),component:(0,a.tZ)(nt.Z,{updateState:U,state:j})},{name:"action_bar",title:vt("Action Bar","presto-player"),icon:(0,a.tZ)(bt,{icon:"cover-image"}),component:(0,a.tZ)(_e.Z,{updateState:U,state:j,value:D,setValue:M})},{name:"watermark",title:vt("Dynamic Watermark","presto-player"),icon:(0,a.tZ)(bt,{icon:"lock"}),component:(0,a.tZ)(He,{updateState:U,state:j})},{name:"search",title:vt("Searchable Captions","presto-player"),icon:(0,a.tZ)(bt,{icon:"search"}),component:(0,a.tZ)(rt,{updateState:U,state:j})}];return(0,a.tZ)(Pt,{title:vt("edit"==r?"Edit A Video Preset":"Create A New Video Preset","presto-player"),onRequestClose:o,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay"},(0,a.tZ)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},(0,a.tZ)(mt,{value:$,hideLabelFromVision:!0,label:vt("Preset Name","presto-player"),onChange:function(e){return N(e)},placeholder:vt("Enter a preset name...","presto-player"),className:"presto-player__modal--style-name",autoFocus:!0}),(0,a.tZ)(_t,{align:"stretch",className:"presto-player__style-preview-area"},(0,a.tZ)(kt,{className:"presto-player__style-sidebar"},(0,a.tZ)("div",null,(0,a.tZ)(we.Z,{items:H,title:vt("Customize","presto-player"),onSelect:O},(function(e){return e.component})))),(0,a.tZ)(Ct,{className:"presto-player__style-preview-panel"},(0,a.tZ)("div",{style:{position:"absolute",top:0,left:0,padding:"20px"}},(0,a.tZ)(xt,{label:vt("Skin","presto-player"),labelPosition:"side",value:null==j?void 0:j.skin,options:[{label:vt("Modern","presto-player"),value:"modern"},{label:vt("Business","presto-player"),value:"business"},{label:vt("Stacked","presto-player"),value:"stacked"},{label:vt("Basic","presto-player"),value:"default"}],onChange:function(e){U({skin:e})}})),(0,a.tZ)(P,{poster:"https://source.unsplash.com/daily",state:j,branding:I,menu:C}))),(0,a.tZ)("br",null),w&&(0,a.tZ)(gt,null,(0,a.tZ)(Zt,{className:"presto-player__modal--error-notice",status:"error",isDismissible:!1,style:{margin:0}},w.replace(/(<([^>]+)>)/gi,""))),(0,a.tZ)("div",{css:(0,a.iv)(et||(et=(0,n.Z)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},(0,a.tZ)("div",{css:(0,a.iv)(tt||(tt=(0,n.Z)(["\n opacity: 0.5;\n font-size: 12px;\n "])))},"Preset ID: ",d.id),(0,a.tZ)("div",null,(0,a.tZ)(wt,{isTertiary:!0,onClick:o,style:{margin:"0 6px"}},vt("Cancel","presto-player")),(0,a.tZ)(wt,{isPrimary:!0,isBusy:h,disabled:h,onClick:function(){if($)return"edit"===r?z():G();_(vt("You must enter a name for the preset.","presto-player"))},"data-cy":"submit-preset"},vt("edit"==r?"Update Preset":"Create Preset","presto-player"))))))},jt=wp.i18n.__,Rt=wp.components,It=Rt.Icon,Lt=Rt.Spinner,Bt=Rt.Modal,Dt=Rt.Button,Mt=Rt.ButtonGroup,Ft=wp.element.useState;function Vt(e){var t,r,n=e.preset,o=e.index,a=e.isActive,i=e.remove,l=e.setPreset,s=e.onEdit,c=Ft(!1),u=(0,v.Z)(c,2),p=u[0],d=u[1],f=Ft(!1),y=(0,v.Z)(f,2),h=y[0],m=y[1],g=function(){return m(!1)},b=function(){var e=(0,ge.Z)(Ze().mark((function e(){return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.id){e.next=3;break}return i(n),e.abrupt("return");case 3:return e.prev=3,d(!0),e.next=7,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"preset/").concat(n.id),{_method:"DELETE"})});case 7:e.sent&&(i(n),wp.data.dispatch("core/notices").createNotice("success",jt("Preset trashed.","presto-player"),{type:"snackbar",isDismissible:!0})),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0),null!==e.t0&&void 0!==e.t0&&e.t0.message&&wp.data.dispatch("core/notices").createNotice("error",e.t0.message,{type:"snackbar",isDismissible:!0});case 15:return e.prev=15,m(!1),d(!1),e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[3,11,15,19]])})));return function(){return e.apply(this,arguments)}}();return p?(0,w.tZ)("div",{className:"block-editor-block-styles__item",role:"button",tabIndex:o,"aria-label":"Fill",style:{color:a?"var(--wp-admin-theme-color)":"inherit",width:"calc(50% - 4px)",margin:"4px 0","flex-shrink":"0",cursor:"pointer",overflow:"hidden","border-radius":"2px",padding:"6px",display:"flex","flex-direction":"column"}},(0,w.tZ)("div",{className:"block-editor-block-styles__item-preview",style:{border:a?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,outline:"1px solid transparent",padding:"0",display:"flex",overflow:"hidden",background:"#fff","align-items":"center","flex-grow":"1","min-height":"80px","max-height":"160px"}},(0,w.tZ)(Lt,null))):(0,w.tZ)("div",{className:"block-editor-block-styles__item presto-preset-".concat(n.slug),onClick:function(){l(n)},role:"button",tabIndex:o,"aria-label":"Fill",style:{color:a?"var(--wp-admin-theme-color)":"inherit",width:"calc(50% - 4px)",margin:"4px 0","flex-shrink":"0",cursor:"pointer",overflow:"hidden","border-radius":"2px",padding:"6px",display:"flex","flex-direction":"column"}},(0,w.tZ)("div",{className:"block-editor-block-styles__item-preview",style:{border:a?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,outline:"1px solid transparent",padding:"0",display:"flex",overflow:"hidden",background:"#fff","align-items":"center","flex-grow":"1","min-height":"80px","max-height":"160px"}},(0,w.tZ)("div",{style:{textAlign:"center",width:"100%",color:a?"var(--wp-admin-theme-color)":"inherit",opacity:a?1:.75}},null!=n&&n.icon?(0,w.tZ)(It,{icon:null==n?void 0:n.icon,style:{fontSize:"30px",width:"30px",height:"30px"}}):(0,w.tZ)("h1",{style:{opacity:.75}},(null==n||null===(t=n.name)||void 0===t||null===(r=t.charAt(0))||void 0===r?void 0:r.toUpperCase())||"Untitled"))),(0,w.tZ)("div",{className:"block-editor-block-styles__item-label",style:{fontWeight:"bold",textTransform:"capitalize","text-align":"center",padding:"4px 0"}},(null==n?void 0:n.name)||"Untitled"),!(null!=n&&n.is_locked)&&(0,w.tZ)("div",{className:"block-editor-block-styles__item-edit"},(0,w.tZ)("div",{className:"block-editor-block-styles__item-edit-icon",onClick:s},(0,w.tZ)(It,{icon:"edit"})),(0,w.tZ)("div",{className:"block-editor-block-styles__item-edit-icon",onClick:function(){return m(!0)}},(0,w.tZ)(It,{icon:"trash"}))),h&&(0,w.tZ)(Bt,{title:jt("Trash Preset?","presto-player"),onRequestClose:g,style:{maxWidth:"250px"}},(0,w.tZ)("p",null,(0,w.tZ)("strong",null,jt("Warning!","presto-player")," "),jt("Any videos assigned to this preset will automatically use the default preset.","presto-player")),(0,w.tZ)(Mt,null,(0,w.tZ)(Dt,{isDestructive:!0,onClick:b,style:{margin:"0 4px"}},jt("Trash","presto-player")),(0,w.tZ)(Dt,{isTertiary:!0,onClick:g,style:{margin:"0 4px",boxShadow:"none"}},jt("Cancel","presto-player")))))}var Ut=wp.i18n.__,zt=wp.components,Gt=zt.withNotices,Ht=zt.BaseControl,Wt=zt.Spinner,qt=zt.Button,Yt=wp.element,Xt=Yt.useState,Kt=(Yt.useEffect,wp.data),Qt=Kt.useSelect,Jt=Kt.dispatch,er=Gt((function(e){var t,r=e.attributes,n=e.setAttributes,o=Xt(!1),a=(0,v.Z)(o,2),i=a[0],l=a[1],s=function(){return l(!1)},c=Xt(null),u=(0,v.Z)(c,2),p=u[0],d=u[1],f=Xt(null),h=(0,v.Z)(f,2),m=h[0],g=h[1],b=Qt((function(e){return{presets:e("presto-player/player").getPresets(),loading:e("presto-player/player").isResolving("getPresets")}})),Z=b.presets,_=b.loading,k=function(e){Jt("presto-player/player").addPreset(e)},x=function(e){Jt("presto-player/player").removePreset(e)},C=function(e){n({preset:e.id})},P=(0,me.Z)("div",{target:"e108l63h0"})({name:"1f3egm3",styles:"display:flex;flex-wrap:wrap;justify-content:space-between"});return _?(0,w.tZ)("div",{className:"presto-settings__loading"},(0,w.tZ)(Wt,null)):(0,w.tZ)(React.Fragment,null,Z.length?(0,w.tZ)("p",null,Ut("Select a video configuration preset, or add your own.","presto-player")):"",(0,w.tZ)(Ht,null,(0,w.tZ)(P,null,(Z||[]).length?Z.map((function(e,t){return(0,w.tZ)(Vt,{setPreset:C,index:t,isActive:(null==r?void 0:r.preset)===e.id,preset:e,key:e.id,onEdit:function(){g(e.name),d(e),l("edit")},remove:x})})):Ut("No style presets. You can create a new style by clicking 'Add New Style'.","presto-plugin"))),(0,w.tZ)(Ht,null,(0,w.tZ)(qt,{isPrimary:!0,"data-cy":"add-new-preset",onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?l("new"):Jt("presto-player/player").setProModal(!0)}},Ut("Add New Preset","presto-player")),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&(0,w.tZ)(y.Z,null)),"new"==i&&(0,w.tZ)(At,{closeModal:s,addPreset:k,type:"new",onSave:C}),"edit"==i&&(0,w.tZ)(At,{closeModal:s,addPreset:k,updatePreset:function(e){Jt("presto-player/player").updatePreset(e)},type:"edit",preset:p,name:m}))})),tr=r(6263);function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rr(Object(r),!0).forEach((function(t){(0,m.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var or=wp.i18n.__,ar=wp.components,ir=(ar.PanelRow,ar.TextControl,ar.SelectControl,ar.BaseControl),lr=ar.Button,sr=ar.FocalPointPicker,cr=ar.RangeControl,ur=wp.blockEditor,pr=ur.MediaUpload,dr=ur.MediaUploadCheck,fr=(wp.element.useState,["image"]),yr=function(e){var t=e.attributes,r=e.setAttributes,n=e.instanceId,o=t.mutedOverlay,a="video-block__overlay-image-description-".concat(n);return(0,w.tZ)(React.Fragment,null,(0,w.tZ)(dr,null,(0,w.tZ)(ir,{className:"editor-video-overlay-control"},(0,w.tZ)(ir.VisualLabel,null,(0,w.tZ)("p",null,or("Overlay Image","presto-player"))),(0,w.tZ)(pr,{title:or("Select overlay image","presto-player"),onSelect:function(e){r({mutedOverlay:nr(nr({},o),{src:e.url})})},allowedTypes:fr,render:function(e){var t=e.open;return(0,w.tZ)(lr,{className:"presto-setting__poster",isPrimary:!0,onClick:t},null!=o&&o.src?or("Replace","presto-player"):or("Select","presto-player"))}}),(0,w.tZ)("p",{id:a,hidden:!0},null!=o&&o.src?sprintf(or("The current overlay image url is %s","presto-player"),null==o?void 0:o.src):or("There is no overlay image currently selected","presto-player")),!(null==o||!o.src)&&(0,w.tZ)(lr,{onClick:function(){r({mutedOverlay:nr(nr({},o),{src:""})})},className:"presto-setting__remove-poster",isTertiary:!0},or("Remove","presto-player")))),!(null==o||!o.src)&&(0,w.tZ)(sr,{url:"",dimensions:{width:160,height:90},value:null==o?void 0:o.focalPoint,onChange:function(e){return r({mutedOverlay:nr(nr({},o),{focalPoint:e})})}}),!(null==o||!o.src)&&(0,w.tZ)(cr,{label:or("Max Width (%)","presto-player"),value:null==o?void 0:o.width,onChange:function(e){return r({mutedOverlay:nr(nr({},o),{width:e})})},min:1,max:100}))};function vr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){(0,m.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var mr=wp.i18n.__,gr=wp.components,br=gr.ToggleControl,Zr=gr.SelectControl,wr=gr.BaseControl,_r=gr.Button,kr=gr.PanelRow,xr=gr.Icon,Cr=gr.Flex,Pr=wp.data.dispatch,Or=wp.blockEditor,Sr=Or.MediaUpload,Er=Or.MediaUploadCheck,$r=["image"],Nr=wp.compose.useInstanceId,Tr=function e(t){var r,n,o=t.setAttributes,a=t.attributes,i=a.mutedPreview,l=a.autoplay,s=a.playsInline,c=a.preload,u=a.poster,p=a.mutedOverlay,d=Nr(e),f="video-block__poster-image-description-".concat(d),v=function(e){return function(t){o((0,m.Z)({},e,t))}};return(0,w.tZ)(React.Fragment,null,!l&&(0,w.tZ)(React.Fragment,null,(0,w.tZ)(br,{label:(0,w.tZ)(React.Fragment,null,mr("Muted Autoplay Preview","presto-player")," ",!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&(0,w.tZ)(y.Z,null)),onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?o({mutedPreview:hr(hr({},i),{enabled:e})}):Pr("presto-player/player").setProModal(!0)},checked:null==i?void 0:i.enabled,className:"presto-setting__mutedPreview",help:mr("Shows a muted preview of the video.","presto-player")}),!(null==i||!i.enabled)&&!(null!=a&&a.video_id)&&(0,w.tZ)(kr,null,(0,w.tZ)(br,{label:mr("Muted Preview Captions","presto-player"),onChange:function(e){o({mutedPreview:hr(hr({},i),{captions:e})})},checked:null==i?void 0:i.captions,className:"presto-setting__mutedPreviewCaptions",help:mr("Play captions during muted autoplay","presto-player")})),!!i.enabled&&(0,w.tZ)(kr,null,(0,w.tZ)(br,{label:(0,w.tZ)(React.Fragment,null,mr("Muted Preview Overlay","presto-player")," ",!(null!==(n=prestoPlayer)&&void 0!==n&&n.isPremium)&&(0,w.tZ)(y.Z,null)),onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?o({mutedOverlay:hr(hr({},p),{enabled:e})}):Pr("presto-player/player").setProModal(!0)},checked:null==p?void 0:p.enabled,className:"presto-setting__mutedOverlay",help:mr("Show an image over the top of the video either before or after the video.","presto-player")})),(null==p?void 0:p.enabled)&&(null==i?void 0:i.enabled)&&(0,w.tZ)(yr,{attributes:a,setAttributes:o})),!(null!=i&&i.enabled)&&(0,w.tZ)(br,{label:mr("Autoplay","presto-player"),className:"presto-setting__autoplay",onChange:v("autoplay"),checked:l,help:function(e){return e?mr("Note: Autoplaying videos may cause usability issues for some visitors.","presto-player"):null}}),(0,w.tZ)(kr,null,(0,w.tZ)(br,{label:mr("Play inline","presto-player"),className:"presto-setting__playsInline","data-cy":"playsInline",onChange:v("playsInline"),checked:s,help:mr("On mobile browsers, play the video on the page instead of opening it up fullscreen.","presto-player")})),!(null!=a&&a.video_id)&&(0,w.tZ)(kr,null,(0,w.tZ)(Zr,{label:(0,w.tZ)(Cr,null,(0,w.tZ)("div",null,mr("Performance Preference","presto-player")),(0,w.tZ)("a",{href:"https://prestoplayer.com/docs/performance-preferences-explained",target:"_blank",style:{textDecoration:"none"}},(0,w.tZ)(xr,{icon:"editor-help"}))),className:"presto-setting__preload",value:c,onChange:function(e){return o({preload:e})},help:(!!(null!=a&&a.src&&(0,tr.dA)(null==a?void 0:a.src)&&["metadata","none"].includes(c))||"none"===c&&!u)&&mr("A poster image is recommended for this setting.","presto-player"),options:[{value:"auto",label:mr("Video Playback Speed","presto-player")},{value:"metadata",label:mr("Page Load Speed","presto-player")},{value:"none",label:mr("Page Load Speed (Extreme)","presto-player")}]})),(0,w.tZ)(kr,null,(0,w.tZ)(Er,null,(0,w.tZ)(wr,{className:"editor-video-poster-control"},(0,w.tZ)(wr.VisualLabel,null,mr("Poster image","presto-player")),(0,w.tZ)(Sr,{title:mr("Select poster image","presto-player"),onSelect:function(e){o({poster:e.url})},allowedTypes:$r,render:function(e){var t=e.open;return(0,w.tZ)(_r,{className:"presto-setting__poster",isPrimary:!0,onClick:t,"aria-describedby":f},mr(u?"Replace":"Select","presto-player"))}}),(0,w.tZ)("p",{id:f,hidden:!0},u?sprintf(mr("The current poster image url is %s","presto-player"),u):mr("There is no poster image currently selected","presto-player")),!!u&&(0,w.tZ)(_r,{onClick:function(){o({poster:""})},className:"presto-setting__remove-poster",isTertiary:!0},mr("Remove","presto-player"))))))};function Ar(_x){return jr.apply(this,arguments)}function jr(){return(jr=(0,ge.Z)(Ze().mark((function e(t){var r,n,o,a;return Ze().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=document.getElementById("presto-shortcode-input").value,n=t.currentTarget,o=n.textContent,t.currentTarget.textContent=(0,c.__)("Copied!","presto-player"),setTimeout((function(){n.textContent=o}),1500),!navigator.clipboard||!window.isSecureContext){e.next=9;break}return e.abrupt("return",navigator.clipboard.writeText(r));case 9:return(a=document.createElement("textarea")).value=r,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",document.body.appendChild(a),a.focus(),a.select(),e.abrupt("return",new Promise((function(e,t){document.execCommand("copy")?e():t(),a.remove()})));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Rr,Ir=function(){return(0,w.tZ)(i.PanelBody,{title:(0,c.__)("Timestamp Shortcode","presto-player"),initialOpen:!1},(0,w.tZ)("div",{className:"block-editor-inserter__shortcode-input"},(0,w.tZ)("p",null,(0,c.__)("Add convenient links to skip the player to a specific timestamp.","presto-player")),(0,w.tZ)("input",{id:"presto-shortcode-input",style:{width:"100%",fontSize:"11px",marginBottom:"10px"},type:"text",readOnly:!0,value:'[pptime time="1:00"]Optional Text[/pptime]'}),(0,w.tZ)("button",{type:"button",className:"components-button is-primary",onClick:Ar},(0,c.__)("Copy to clipboard","presto-player"))))},Lr=r(249);function Br(e){var t,r,v,h,m=e.attributes,g=e.setAttributes,b=(0,o.useContext)(Lr.Z),Z=b.isEditing,w=b.setIsEditing,_=(0,u.useSelect)((function(e){return e(p.store).canUser("read","settings")}));return(0,a.tZ)(React.Fragment,null,Z&&(0,a.tZ)(i.PanelBody,null,(0,a.tZ)(i.Flex,{align:"center",justify:"flex-start"},(0,a.tZ)(i.Icon,{icon:l.Z}),(0,a.tZ)("h2",{class:"block-editor-block-card__title"},(0,c.__)("Editing Synced Media","presto-player"))),(0,a.tZ)(i.BaseControl,{help:(0,c.__)("You are currently editing a synced media hub item that may be reused across your site.","presto-player"),css:(0,a.iv)(Rr||(Rr=(0,n.Z)(["\n margin-bottom: 10px !important;\n "])))}),(0,a.tZ)(i.Button,{icon:s.Z,onClick:function(){return w(!1)},variant:"secondary"},(0,c.__)("Done Editing","presto-player"))),(0,a.tZ)(i.PanelBody,{title:(0,a.tZ)(React.Fragment,null,(0,c.__)("Chapters","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&(0,a.tZ)(y.Z,null)),initialOpen:null===(r=prestoPlayer)||void 0===r?void 0:r.isPremium},(0,a.tZ)(f.Z,{setAttributes:g,attributes:m})),(0,a.tZ)(i.PanelBody,{title:(0,a.tZ)(React.Fragment,null,(0,c.__)("Overlays","presto-player")," ",!(null!==(v=prestoPlayer)&&void 0!==v&&v.isPremium)&&(0,a.tZ)(y.Z,null)),initialOpen:null===(h=prestoPlayer)||void 0===h?void 0:h.isPremium},(0,a.tZ)(he,{setAttributes:g,attributes:m})),(0,a.tZ)(i.PanelBody,{title:(0,c.__)("Video settings","presto-player")},(0,a.tZ)(Tr,{setAttributes:g,attributes:m})),(0,a.tZ)(i.PanelBody,{title:(0,c.__)("Video Preset","presto-player")},(0,a.tZ)(er,{setAttributes:g,attributes:m})),(0,a.tZ)(Ir,null),!!_&&(0,a.tZ)(i.PanelBody,{title:(0,c.__)("Global Player Branding","presto-player"),initialOpen:!1},(0,a.tZ)(d.Z,{setAttributes:g,attributes:m})))}},9641:function(e,t,r){"use strict";var n=r(9307),o=r(5609),a=r(8184),i=r(5736),l=r(249),s=r(917);t.Z=function(){var e=(0,n.useContext)(l.Z),t=e.isEditing,r=e.setIsEditing;return t&&(0,s.tZ)(o.Toolbar,null,(0,s.tZ)(o.Button,{icon:a.Z,onClick:function(){return r(!1)}},(0,i.__)("Done Editing","presto-player")))}},2383:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var n=r(3324),o=(r(9307),r(917)),a=wp.components,i=a.Button,l=a.Placeholder,s=a.TextControl,c=a.Flex,u=a.FlexItem,p=a.FlexBlock,d=wp.element.useState,__=wp.i18n.__;function f(e){var t=e.attributes,r=(e.setAttributes,e.icon),a=e.onSelectURL,f=e.label,y=e.instructions,v=e.placeholder,h=t.src,m=d({src:h}),g=(0,n.Z)(m,2),b=g[0],Z=g[1];return(0,o.tZ)(l,{icon:r,label:f||__("Presto Embedded Video","presto-player"),instructions:y||__("Enter video URL","presto-player")},(0,o.tZ)("form",{onSubmit:function(e){e.preventDefault(),a(b.url)}},(0,o.tZ)(c,{style:{width:"100%",maxWidth:"400px"}},(0,o.tZ)(p,null,(0,o.tZ)(s,{type:"url",className:"presto-link-placeholder-input",placeholder:v||__("Youtube URL","presto-player"),value:b.url,onChange:function(e){return Z({url:e})}})),(0,o.tZ)(u,null,(0,o.tZ)(i,{isPrimary:!0,style:{marginBottom:"8px"},type:"submit"},__("Add Video","presto-player"))))))}},1713:function(e,t,r){"use strict";var n=r(4942),o=r(2982),a=r(9307),i=r(4831),l=r(7161),s=r(9818),c=r(6263),u=r(917);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.Z=function(e){var t,r,n,p,f,y=e.src,v=e.classes,h=e.preset,m=e.branding,g=e.attributes,b=e.adminPreview,Z=e.currentTime,w=e.preload,_=void 0===w?"metadata":w,k=e.overlays,x=e.type,C=(0,a.useRef)(),P=g.previewThumbnail,O=g.preview,S=g.chapters,E=g.poster,$=g.mutedOverlay,N=g.mutedPreview,T=g.title,A=(0,s.useSelect)((function(e){var t,r;return{youtube:null===(t=e("presto-player/player"))||void 0===t?void 0:t.youtube(),playerCSS:null===(r=e("presto-player/player"))||void 0===r?void 0:r.playerCSS()}})),j=A.youtube,R=A.playerCSS;return(0,a.useEffect)((function(){C.current.src=y,C.current["data-css"]=R,C.current.classes=v,C.current.currentTime=Z,C.current.overlays=k,C.current.isAdmin=!0,C.current.preload=_,C.current.preset=h,C.current.bunny={thumbnail:P,preview:O},C.current.youtube={channelId:null==j?void 0:j.channel_id},C.current.tracks=(0,o.Z)(null!=h&&h.captions?[{kind:"captions",label:"English",srclang:"en",src:"/path/to/captions.en.vtt",default:!0}]:[]),C.current.branding=m,C.current.chapters=S,C.current.blockAttributes=g,C.current.poster=E,C.current.provider="audio"===x?"audio":(0,l.VH)(y),C.current.mediaTitle=T}),[y,v,h,m,g,b,Z,_,k,x]),(0,u.tZ)("div",{className:"wp-block-video presto-block-video",style:"audio"===x?d(d(d({"--presto-player-border-radius":"".concat(null==h?void 0:h.border_radius,"px")},null!=h&&h.background_color?{"--plyr-audio-controls-background":h.background_color}:{"--plyr-audio-controls-background":null==m?void 0:m.color}),null!=h&&h.control_color?{"--plyr-audio-control-color":h.control_color,"--plyr-range-thumb-background":h.control_color,"--plyr-range-fill-background":h.control_color,"--plyr-audio-progress-buffered-background":(0,c.eR)(h.control_color||(null==m?void 0:m.color)||"#00b3ff",.5)}:{"--plyr-audio-control-color":"#ffffff","--plyr-range-thumb-background":"#ffffff","--plyr-range-fill-background":"#ffffff"}),{},{"--plyr-range-thumb-shadow":"0px"}):d(d(d({"--presto-player-border-radius":"".concat(null==h?void 0:h.border_radius,"px")},null!=h&&h.caption_background?{"--plyr-captions-background":h.caption_background}:{}),null!=m&&m.color?{"--plyr-color-main":"var(--presto-player-highlight-color, ".concat(m.color,")")}:{}),{},{"--presto-player-email-border-radius":"".concat((null==h||null===(t=h.email_collection)||void 0===t?void 0:t.border_radius)||0,"px"),"--presto-player-logo-width":"".concat((null==m?void 0:m.logo_width)||75,"px")})},(0,u.tZ)(i.pv,{ref:C},(0,u.tZ)("div",{slot:"player-end"},!(null===(r=h.search)||void 0===r||!r.enabled)&&(0,u.tZ)(i.Zs,{style:{position:"absolute",top:"15px",right:"23px",zIndex:1},placeholder:null===(n=h.search)||void 0===n?void 0:n.placeholder}),(null==N?void 0:N.enabled)&&(null==$?void 0:$.enabled)&&(0,u.tZ)("div",{className:"presto-player__overlay is-image",style:{position:"absolute",width:"".concat((null==$?void 0:$.width)||100,"%"),left:"".concat(100*((null==$||null===(p=$.focalPoint)||void 0===p?void 0:p.x)||.5),"%"),top:"".concat(100*((null==$||null===(f=$.focalPoint)||void 0===f?void 0:f.y)||.5),"%")}},(0,u.tZ)("img",{src:null==$?void 0:$.src,style:{transform:"translateX(-50%) translateY(-50%)"}})),b)))}},5246:function(e,t,r){"use strict";r.d(t,{Z:function(){return D}});var n,o,a,i,l,s,c,u,p,d,f,y,v,h,m,g=r(168),b=r(5861),Z=r(3324),w=r(9307),_=r(1284),k=r.n(_),x=r(7453),C=r(2175),P=r(4981),O=r(5609),S=r(9818),E=r(5736),$=r(7798),N=r(3961),T=r(9807),A=r(917),j=function(e){var t=e.provider,r=e.icon,l=e.onCreate,s=e.pro;return(0,A.tZ)(O.Flex,{direction:"column",gap:"14px",onClick:l},(0,A.tZ)(O.Flex,{css:(0,x.iv)(n||(n=(0,g.Z)(["\n width: 80px;\n min-width: 80px;\n height: 80px;\n border: 1px solid #dddddd;\n border-radius: 4px;\n position: relative;\n &:hover {\n cursor: pointer;\n border-color: #007cba;\n box-shadow: 0px 5px 9px 0px #00000012;\n }\n "]))),justify:"center",align:"center"},s&&(0,A.tZ)("div",{css:(0,x.iv)(o||(o=(0,g.Z)(["\n position: absolute;\n top: 0;\n right: 0;\n .presto-player__pro-badge {\n margin: 4px;\n }\n "])))},(0,A.tZ)(T.Z,null)),r),(0,A.tZ)(O.Flex,{justify:"center",css:(0,x.iv)(a||(a=(0,g.Z)(["\n height: 20px;\n "])))},(0,A.tZ)("p",{css:(0,x.iv)(i||(i=(0,g.Z)(["\n font-weight: 500;\n font-size: 14px;\n margin: 0px !important;\n "])))},t)))},R={mediaHubBlock:(0,A.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,A.tZ)("path",{d:"M10 8L16 12L10 16V8Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),video:(0,A.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("path",{d:"M23 7L16 12L23 17V7Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,A.tZ)("path",{d:"M14 5H3C1.89543 5 1 5.89543 1 7V17C1 18.1046 1.89543 19 3 19H14C15.1046 19 16 18.1046 16 17V7C16 5.89543 15.1046 5 14 5Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),bunny:(0,A.tZ)("svg",{width:"29",height:"32",viewBox:"0 0 29 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("path",{d:"M15.734 5.13223L23.1293 9.14822L16.2959 0C15.7536 0.727851 15.4155 1.58737 15.3167 2.48967C15.2179 3.39196 15.362 4.30427 15.734 5.13223Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M12.3923 20.0273C12.8394 20.0273 13.2682 20.2049 13.5843 20.5211C13.9004 20.8372 14.078 21.266 14.078 21.7131C14.078 22.1601 13.9004 22.5889 13.5843 22.905C13.2682 23.2212 12.8394 23.3988 12.3923 23.3988C11.9452 23.3988 11.5165 23.2212 11.2003 22.905C10.8842 22.5889 10.7066 22.1601 10.7066 21.7131C10.7066 21.266 10.8842 20.8372 11.2003 20.5211C11.5165 20.2049 11.9452 20.0273 12.3923 20.0273Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M7.24523 1.34112L27.9541 12.5798C28.1234 12.6622 28.2662 12.7905 28.366 12.9502C28.4658 13.1098 28.5188 13.2943 28.5188 13.4826C28.5188 13.6709 28.4658 13.8554 28.366 14.015C28.2662 14.1747 28.1234 14.303 27.9541 14.3854C26.3879 15.3278 24.6726 15.9967 22.8818 16.3633L18.5736 25.2046C18.5736 25.2046 17.2102 28.3065 13.4564 27.1152C15.0298 25.5418 16.9328 24.1181 16.9328 21.6983C16.9328 19.1865 14.8966 17.1505 12.385 17.1505C9.87326 17.1505 7.83728 19.1865 7.83728 21.6983C7.83728 24.86 10.9539 26.1935 12.6848 28.3889C13.0629 28.9242 13.2448 29.5735 13.1997 30.2273C13.1547 30.8811 12.8855 31.4993 12.4375 31.9777C10.287 29.85 6.12878 26.261 4.42049 23.9084C3.48655 22.7223 2.97267 21.2597 2.95944 19.7501C3.04152 18.1438 3.61631 16.6017 4.60566 15.3336C5.595 14.0655 6.95089 13.1328 8.48898 12.6624C9.43233 12.3876 10.4142 12.2686 11.3959 12.3102C12.7648 12.4139 14.0944 12.8153 15.292 13.4865C17.1278 14.5654 18.0193 14.2807 19.2854 13.2169C20.0347 12.6025 20.8512 10.6019 19.5851 10.1374C19.1712 10.0024 18.7481 9.89728 18.319 9.8229C15.9664 9.36574 11.8531 8.93113 10.3395 8.06951C7.93444 6.74335 6.31616 4.0084 7.24523 1.34112Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M16.8955 21.7204C17.8545 16.6781 12.737 11.868 8.81099 12.5871L9.07341 12.5272C8.86348 12.5721 8.66135 12.6248 8.46639 12.6847C6.92835 13.1551 5.5725 14.0878 4.5832 15.356C3.5939 16.6241 3.01914 18.1662 2.93707 19.7724C2.96099 21.2865 3.48823 22.7495 4.43564 23.9307C6.14371 26.2833 10.302 29.8723 12.4525 32C12.9004 31.5217 13.1696 30.9034 13.2147 30.2496C13.2597 29.5958 13.0778 28.9465 12.6997 28.4112C10.9313 26.2235 7.81448 24.8823 7.81448 21.728C7.81448 19.2162 9.85089 17.1802 12.3625 17.1802C14.8742 17.1802 16.9102 19.2162 16.9102 21.728L16.8955 21.7204Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M7.24522 1.34112L22.9791 9.91247L23.4287 10.1597C23.8035 10.4518 24.178 11.0363 23.6911 12.1152C22.9418 13.7261 19.9449 15.2846 16.4908 14.0631C17.5697 14.3778 18.3038 14.0182 19.2481 13.2241C19.9972 12.6097 20.8139 10.6093 19.5476 10.1445C19.1336 10.0095 18.7105 9.90444 18.2815 9.83006C15.9289 9.3729 11.8155 8.93851 10.302 8.07688C7.93443 6.74313 6.31593 4.0084 7.24522 1.34112Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M7.24515 1.34112C8.87102 7.33497 18.7685 7.82965 23.7283 10.3321L7.24515 1.34112Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M12.6623 28.4112C10.9316 26.2234 7.81458 24.8823 7.81458 21.7279C7.82347 19.4402 9.53045 17.5152 11.8006 17.2324C8.18499 17.2448 5.25703 20.1728 5.24467 23.7884C5.24402 24.2313 5.28912 24.6733 5.37956 25.107C6.81068 26.7253 8.87854 28.6359 10.6243 30.2542C11.3062 30.8911 11.9355 31.4903 12.4526 32C12.8827 31.5015 13.1448 30.8802 13.2016 30.2243C13.2426 29.5751 13.0514 28.9325 12.6623 28.4112Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M16.873 22.26C16.8966 22.081 16.9092 21.9008 16.9105 21.7204C17.8545 16.6782 12.737 11.868 8.81105 12.5871C9.64941 12.3846 10.5118 12.2989 11.3736 12.3325C16.5208 12.5422 17.9593 18.0416 16.873 22.26Z",fill:"#007CBA"}),(0,A.tZ)("path",{d:"M1.69332 11.1189C2.14306 11.1209 2.57371 11.3009 2.89105 11.6196C3.2084 11.9383 3.38659 12.3697 3.38664 12.8194V14.5127H1.69332C1.47095 14.5127 1.25076 14.4689 1.04531 14.3838C0.839872 14.2987 0.653201 14.174 0.495962 14.0168C0.338723 13.8595 0.213994 13.6729 0.128896 13.4674C0.043799 13.262 0 13.0418 0 12.8194C-4.22733e-06 12.3696 0.178163 11.9382 0.495512 11.6194C0.812861 11.3007 1.24355 11.1209 1.69332 11.1189Z",fill:"#007CBA"})),youtube:(0,A.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("path",{d:"M22.54 6.42C22.4212 5.94541 22.1793 5.51057 21.8387 5.15941C21.498 4.80824 21.0708 4.55318 20.6 4.42C18.88 4 12 4 12 4C12 4 5.12 4 3.4 4.46C2.92925 4.59318 2.50198 4.84824 2.16135 5.19941C1.82072 5.55057 1.57879 5.98541 1.46 6.46C1.14521 8.20556 0.991235 9.97631 0.999999 11.75C0.988779 13.537 1.14277 15.3213 1.46 17.08C1.59096 17.5398 1.83831 17.9581 2.17814 18.2945C2.51798 18.6308 2.93882 18.8738 3.4 19C5.12 19.46 12 19.46 12 19.46C12 19.46 18.88 19.46 20.6 19C21.0708 18.8668 21.498 18.6118 21.8387 18.2606C22.1793 17.9094 22.4212 17.4746 22.54 17C22.8524 15.2676 23.0063 13.5103 23 11.75C23.0112 9.96295 22.8572 8.1787 22.54 6.42Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,A.tZ)("path",{d:"M9.75 15.02L15.5 11.75L9.75 8.48V15.02Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),vimeo:(0,A.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("g",{clipPath:"url(#clip0_1_30)"},(0,A.tZ)("path",{d:"M22.875 10.063C20.433 15.28 14.538 22.382 10.812 22.382C7.14 22.382 6.609 14.551 4.604 9.339C3.617 6.774 2.98 7.363 1.13 8.658L0.0019989 7.203C2.7 4.831 5.4 2.076 7.059 1.923C8.927 1.744 10.077 3.021 10.507 5.755C11.075 9.348 11.869 14.925 13.255 14.925C14.335 14.925 16.996 10.501 17.133 8.919C17.376 6.603 15.43 6.533 13.741 7.256C16.414 -1.498 27.534 0.113998 22.875 10.063Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,A.tZ)("defs",null,(0,A.tZ)("clipPath",{id:"clip0_1_30"},(0,A.tZ)("rect",{width:"24",height:"24",fill:"white"})))),audio:(0,A.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("path",{d:"M9 18V5L21 3V16",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,A.tZ)("path",{d:"M6 21C7.65685 21 9 19.6569 9 18C9 16.3431 7.65685 15 6 15C4.34315 15 3 16.3431 3 18C3 19.6569 4.34315 21 6 21Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,A.tZ)("path",{d:"M18 19C19.6569 19 21 17.6569 21 16C21 14.3431 19.6569 13 18 13C16.3431 13 15 14.3431 15 16C15 17.6569 16.3431 19 18 19Z",stroke:"#007CBA",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),chevron:(0,A.tZ)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("path",{d:"M4.5 6.75L9 11.25L13.5 6.75",stroke:"#959090",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),line:(0,A.tZ)("svg",{width:"241",height:"1",viewBox:"0 0 241 1",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,A.tZ)("line",{x1:"-4.37114e-08",y1:"0.5",x2:"241",y2:"0.499979",stroke:"#DDDDDD"}))},I=function(e){var t=e.icon;return(0,A.tZ)(O.Flex,{align:"center",css:(0,x.iv)(l||(l=(0,g.Z)(["\n max-width: 100%;\n "])))},(0,A.tZ)("span",{css:(0,x.iv)(s||(s=(0,g.Z)(["\n display: flex;\n max-width: 210px;\n "])))},t),(0,A.tZ)("span",null,(0,E.__)("or","presto-player")),(0,A.tZ)("span",{css:(0,x.iv)(c||(c=(0,g.Z)(["\n display: flex;\n max-width: 210px;\n "])))},t))},L=r(4130),B=r(4290),D=function(e){var t,r,n=e.clientId,o=e.shouldInsertBlock,a=void 0===o||o,i=e.selectExisting,l=void 0!==i&&i,s=e.sync,c=(0,w.useState)(!1),_=(0,Z.Z)(c,2),T=_[0],A=_[1],D=(0,w.useState)(""),M=(0,Z.Z)(D,2),F=M[0],V=M[1],U=(0,S.useDispatch)(N.store).createErrorNotice,z=(0,S.useDispatch)($.store).saveEntityRecord,G=(0,S.useDispatch)(C.store).replaceBlock,H=(0,S.useDispatch)(C.store).insertBlock;(0,w.useEffect)((function(){F&&G(n,(0,P.createBlock)("presto-player/reusable-display",{id:F}))}),[F]);var W=function(){var e=(0,b.Z)(k().mark((function e(t){var r,n;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!T){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,A(!0),e.next=6,z("postType","pp_video_block",{status:"publish",content:'\x3c!-- wp:presto-player/reusable-edit --\x3e\n <div class="wp-block-presto-player-reusable-edit">\x3c!-- wp:presto-player/'.concat(t," /--\x3e</div>\n \x3c!-- /wp:presto-player/reusable-edit --\x3e")},{throwOnError:!0});case 6:r=e.sent,n=r.id,V(n),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),U((null===e.t0||void 0===e.t0?void 0:e.t0.message)||(0,E.__)("Something went wrong","presto-player"));case 14:return e.prev=14,A(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(_x){return e.apply(this,arguments)}}(),q=function(e){if(a)H((0,P.createBlock)("presto-player/".concat(e)),0,n);else if(s)W(e);else{var t=(0,P.createBlock)("presto-player/".concat(e));G(n,t)}};return T?(0,x.tZ)(O.Placeholder,{css:(0,x.iv)(u||(u=(0,g.Z)(["\n &.components-placeholder {\n padding: 16px;\n }\n "])))},(0,x.tZ)(O.Spinner,null)):(0,x.tZ)(O.Placeholder,{css:(0,x.iv)(p||(p=(0,g.Z)(["\n &.components-placeholder {\n padding: 32px;\n }\n "]))),label:(0,x.tZ)(React.Fragment,null,(0,x.tZ)(O.Flex,{direction:"column",css:(0,x.iv)(d||(d=(0,g.Z)(["\n margin-bottom: 4px;\n "]))),gap:"16px"},(0,x.tZ)(O.Flex,{justify:"flex-start"},R.mediaHubBlock,(0,x.tZ)("h1",{css:(0,x.iv)(f||(f=(0,g.Z)(["\n font-size: 24px !important;\n font-weight: 500 !important;\n margin: 0px !important;\n "])))},(0,E.__)("Presto Player","presto-player"))),(0,x.tZ)(O.Flex,null,(0,x.tZ)("p",{css:(0,x.iv)(y||(y=(0,g.Z)(["\n font-size: 14px !important;\n font-weight: 300 !important;\n margin: 0px !important;\n "])))},(0,E.__)("Choose a video type to get started.","presto-player")))))},(0,x.tZ)(O.Flex,{direction:"column",css:(0,x.iv)(v||(v=(0,g.Z)(["\n max-width: 540px;\n width: 100%;\n "]))),gap:"20px"},(0,x.tZ)(O.Flex,{justify:"start",css:(0,x.iv)(h||(h=(0,g.Z)(["\n width: 100%;\n max-width: 100%;\n "]))),wrap:"wrap",gap:"20px"},(0,x.tZ)(O.FlexItem,null,(0,x.tZ)(j,{provider:(0,E.__)("Video","presto-player"),onCreate:function(){return q("self-hosted")},icon:R.video})),!(null===(t=prestoPlayer)||void 0===t||!t.isPremium)&&(0,x.tZ)(O.FlexItem,null,(0,x.tZ)(j,{provider:(0,E.__)("Bunny.net","presto-player"),onCreate:function(){return q("bunny")},icon:R.bunny})),(0,x.tZ)(O.FlexItem,null,(0,x.tZ)(j,{provider:(0,E.__)("YouTube","presto-player"),onCreate:function(){return q("youtube")},icon:R.youtube})),(0,x.tZ)(O.FlexItem,null,(0,x.tZ)(j,{provider:(0,E.__)("Vimeo","presto-player"),onCreate:function(){return q("vimeo")},icon:R.vimeo})),(0,x.tZ)(O.FlexItem,null,(0,x.tZ)(j,{provider:(0,E.__)("Audio","presto-player"),onCreate:function(){return q("audio")},icon:R.audio})),!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&(0,x.tZ)(O.FlexItem,null,(0,x.tZ)(j,{provider:(0,E.__)("Bunny.net","presto-player"),onCreate:function(){(0,S.dispatch)("presto-player/player").setProModal(!0)},icon:R.bunny,pro:!0}))),l&&(0,x.tZ)(React.Fragment,null,(0,x.tZ)(I,{icon:R.line}),(0,x.tZ)(O.Flex,null,(0,x.tZ)(L.Z,{popoverProps:{placement:"bottom-start"},onSelect:function(e){var t=e.id;G(n,(0,P.createBlock)("presto-player/reusable-display",{id:t}))},renderToggle:function(e){var t=e.isOpen,r=e.onToggle;return(0,x.tZ)(O.Button,{variant:"primary",onClick:r,"aria-expanded":t},(0,E.__)("Select media","presto-player"))},renderItem:function(e){var t,r,n,o=e.item,a=e.onSelect,i=o.id,l=o.title,s=o.details||{},c=s.type,u=s.name,p=(null==o||null===(t=o._embedded)||void 0===t||null===(r=t["wp:featuredmedia"])||void 0===r||null===(n=r[0])||void 0===n?void 0:n.source_url)||"";return(0,x.tZ)(O.MenuItem,{icon:(0,x.tZ)(B.Z,{thumbnail:p,type:c}),iconPosition:"left",suffix:c?u:(0,E.__)("Choose media","presto-player"),onClick:function(){return a(o)},key:i,css:(0,x.iv)(m||(m=(0,g.Z)(["\n .components-menu-item__item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n text-align: left;\n }\n "])))},l||(0,E.__)("Untitled","presto-player"))}})))))}},4994:function(e,t,r){"use strict";var n=r(5861),o=r(3324),a=(r(9307),r(1284)),i=r.n(a),l=r(9807),s=r(917),__=wp.i18n.__,c=wp.components,u=c.ColorPicker,p=c.Button,d=c.withNotices,f=c.BaseControl,y=c.RangeControl,v=wp.blockEditor,h=v.MediaUpload,m=v.MediaUploadCheck,g=wp.compose.useInstanceId,b=wp.element.useState,Z=wp.data,w=Z.dispatch,_=Z.useSelect,k=["image"];t.Z=d((function e(t){t.setAttributes,t.attributes;var r,a=t.type,c=g(e),d=b(1),v=(0,o.Z)(d,2),Z=v[0],x=v[1],C=_((function(e){return e("presto-player/player").branding()})),P=function(){var e=(0,n.Z)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w("presto-player/player").saveOptions({branding:C});case 2:wp.data.dispatch("core/notices").createNotice("success","Player branding saved.",{type:"snackbar",isDismissible:!0});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,s.tZ)("div",{className:"presto-player__panel--branding"},"audio"!==a&&(0,s.tZ)("p",null,__("Here you can select the global player branding This will apply to all players on the site.","presto-player")),(0,s.tZ)(m,null,(0,s.tZ)(f,{className:"editor-video-poster-control"},"audio"!==a&&(0,s.tZ)(React.Fragment,null,(0,s.tZ)(f.VisualLabel,null,(0,s.tZ)("p",null,__("Logo Overlay","presto-player")," ",!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&(0,s.tZ)(l.Z,null))),(0,s.tZ)(h,{title:__("Select logo overlay image","presto-player"),onSelect:function(e){w("presto-player/player").updateBranding("logo",e.url)},allowedTypes:k,render:function(e){var t=e.open;return(0,s.tZ)(p,{className:"presto-setting__logo",isSecondary:!0,onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?t():w("presto-player/player").setProModal(!0)},"aria-describedby":"video-block__logo-image-description-".concat(c)},null!=C&&C.logo?__("Replace","presto-player"):__("Select","presto-player"))}})),(0,s.tZ)("p",{id:"video-block__logo-image-description-".concat(c),hidden:!0},null!=C&&C.logo?sprintf(/* translators: %s: poster image URL. */ __("The current logo image url is %s","presto-player"),null==C?void 0:C.logo):__("There is no logo image currently selected","presto-player")),!(null==C||!C.logo)&&(0,s.tZ)(p,{onClick:function(){w("presto-player/player").updateBranding("logo","")},isTertiary:!0},__("Remove","presto-player")))),!(null==C||!C.logo)&&(0,s.tZ)(y,{label:__("Logo Max Width","presto-player"),value:(null==C?void 0:C.logo_width)||150,onChange:function(e){return w("presto-player/player").updateBranding("logo_width",e)},min:1,max:400}),(0,s.tZ)(u,{color:null==C?void 0:C.color,onChangeComplete:function(e){w("presto-player/player").updateBranding("color",e.hex)},key:Z,disableAlpha:!0}),(null==C?void 0:C.color)&&(0,s.tZ)(f,null,(0,s.tZ)(p,{isSecondary:!0,onClick:function(){var e,t;w("presto-player/player").updateBranding("color",(null===(e=prestoPlayer)||void 0===e||null===(t=e.defaults)||void 0===t?void 0:t.color)||"#00b3ff"),x(Z+1)}},__("Reset Color","presto-player"))),(0,s.tZ)(p,{isPrimary:!0,onClick:P},__("Save Branding","presto-player")))}))},398:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(2982),o=r(4942),a=r(3324),i=r(9307),l=r(5736),s=r(5609),c=r(7161),u=r(917),p=function(e){var t=e.update,r=e.add,n=e.remove,o=e.className,p=e.time,d=e.title,f=(0,i.useState)(p),y=(0,a.Z)(f,2),v=y[0],h=y[1];return(0,u.tZ)(s.Flex,{align:"center",className:o},(0,u.tZ)(s.FlexItem,null,(0,u.tZ)(s.TextControl,{className:"presto-player__caption--time",style:{width:"60px"},placeholder:"0:00",value:v,onChange:function(e){return h(e)},onBlur:function(){var e=(0,c.as)(v);t({time:e}),h(e)},autoComplete:"off"})),(0,u.tZ)(s.FlexBlock,null,(0,u.tZ)(s.TextControl,{className:"presto-player__caption--title",placeholder:(0,l.__)("Title","presto-player"),value:d||"",onChange:function(e){return t({title:e})},autoComplete:"off"})),(0,u.tZ)(s.FlexItem,null,n&&(0,u.tZ)(s.Button,{icon:"minus",className:"ph-chapter__remove",style:{marginBottom:"8px"},label:(0,l.__)("Remove Chapter","presto-player"),onClick:n}),r&&(0,u.tZ)(s.Button,{icon:"plus-alt",className:"ph-chapter__add",label:(0,l.__)("Add Chapter","presto-player"),style:{marginBottom:"8px"},onClick:function(){r(),h("")}})))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}wp.i18n.__;var y=wp.element.useState,v=wp.data.dispatch,h=function(e){var t,r=e.setAttributes,o=e.attributes,i=function(){v("presto-player/player").setProModal(!0)};if(null===(t=prestoPlayer)||void 0===t||!t.isPremium)return(0,u.tZ)(p,{disabled:!0,className:"ph-chapter is-new",time:"",title:"",update:function(){},showNotice:i,add:i});var l=o.chapters,s=y({title:"",time:""}),c=(0,a.Z)(s,2),d=c[0],h=c[1];return(0,u.tZ)(React.Fragment,null,(l||[]).sort((function(e,t){return parseInt(e.time.split(":")[0])-parseInt(t.time.split(":")[0])==0?parseInt(e.time.split(":")[1])-parseInt(t.time.split(":")[1]):parseInt(e.time.split(":")[0])-parseInt(t.time.split(":")[0])})).map((function(e,t){return(0,u.tZ)(p,{key:"".concat(t,"-").concat(e.time),className:"ph-chapter",time:e.time,title:e.title,chapter:e,update:function(t){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.indexOf(e),o=l.map((function(e,r){return r!==n?e:f(f({},e),t)}));r({chapters:o})}(e,t)},remove:function(){!function(e){var t=l.indexOf(e);r({chapters:l.filter((function(e,r){return r!==t}))})}(e)}})})),(0,u.tZ)(p,{className:"ph-chapter is-new",time:d.time,title:d.title,update:function(e){h(f(f({},d),e))},add:function(){d.time&&d.title&&(r({chapters:[].concat((0,n.Z)(l||[]),[{time:d.time,title:d.title}])}),h({title:"",time:""}))}}))}},1145:function(e,t,r){"use strict";var n,o=r(168),a=r(3324),i=(r(9307),r(7453)),l=wp.components,s=l.ColorPicker,c=l.ColorIndicator,u=l.Popover,p=l.Button,d=(l.Flex,wp.element),f=d.useState,y=d.useEffect,__=wp.i18n.__,v={name:"dbcz6",styles:"width:25px;height:25px;border-radius:9999px"},h={name:"h3ohiq",styles:"display:flex;align-items:center;justify-content:space-between;padding:10px"},m={name:"1yzqyz8",styles:"margin:0 5px"},g={name:"iml53j",styles:"display:flex;justify-content:flex-end;padding:10px"},b={name:"1yzqyz8",styles:"margin:0 5px"};t.Z=function(e){var t=e.color,r=e.setColor,l=e.onFocus,d=f(!1),Z=(0,a.Z)(d,2),w=Z[0],_=Z[1],k=f(t),x=(0,a.Z)(k,2),C=x[0],P=x[1];return y((function(){w&&t&&P(t)}),[w]),(0,i.tZ)("span",null,(0,i.tZ)(c,{css:v,colorValue:t,onClick:function(){_(!w),l&&l()}}),!!w&&(0,i.tZ)(u,{position:"bottom left",focusOnMount:!0,onFocusOutside:function(e){_(!1)},css:(0,i.iv)(n||(n=(0,o.Z)(["\n .components-color-picker,\n .react-colorful {\n width: 100%;\n }\n "])))},(0,i.tZ)(s,{color:t||"",onChangeComplete:function(e){return(null==e?void 0:e.hex)&&r(e)},disableAlpha:!0}),(0,i.tZ)("div",{css:h},(0,i.tZ)(p,{css:m,isTertiary:!0,onClick:function(){r({hex:null}),_(!1)}},__("Reset","presto-player")),(0,i.tZ)("div",{css:g},(0,i.tZ)(p,{css:b,isTertiary:!0,onClick:function(){r({hex:C}),_(!1)}},__("Cancel","presto-player")),(0,i.tZ)(p,{isPrimary:!0,onClick:function(){return _(!1)}},__("Apply","presto-player"))))))}},9807:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}}),r(9307);var n=r(917),__=wp.i18n.__;function o(){return(0,n.tZ)("div",{className:"presto-player__pro-badge"},__("Pro","presto-player"))}},4130:function(e,t,r){"use strict";r.d(t,{Z:function(){return R}});var n,o,a,i,l,s,c,u=r(7462),p=r(168),d=r(2982),f=r(5861),y=r(3324),v=r(4925),h=r(9307),m=r(1284),g=r.n(m),b=r(5736),Z=window.wp.url,w=r(3961),_=r(7798),k=r(6989),x=r.n(k),C=r(9818),P=r(9496),O=r.n(P),S=r(5609),E=r(7453),$=r(917),N=["options","isLoading","hasMore","search","onSearch","onSelect","onNextPage","onCreate","onOpen","renderItem"],T=function(e){var t=e.options,r=e.isLoading,c=e.hasMore,d=e.search,f=e.onSearch,y=e.onSelect,h=e.onNextPage,m=e.onCreate,g=e.onOpen,Z=e.renderItem,w=void 0===Z?null:Z,_=(0,v.Z)(e,N);return(0,$.tZ)("div",{class:"pp_search_dropdown_container",css:(0,E.iv)(i||(i=(0,p.Z)(["\n width: 100%;\n position: relative;\n "])))},(0,$.tZ)(S.Dropdown,(0,u.Z)({onToggle:function(e){return g(e)},renderContent:function(){return(0,$.tZ)("div",{css:(0,E.iv)(l||(l=(0,p.Z)(["\n width: 500px;\n max-width: 100vw;\n .components-menu-group {\n padding: 8px;\n margin-top: 0;\n margin-bottom: 0;\n margin-left: -8px;\n margin-right: -8px;\n }\n .components-menu-group + .components-menu-group {\n margin-top: 0;\n border-top: 1px solid #ccc;\n padding: 8px;\n }\n .components-menu-group:last-child {\n margin-bottom: -8px;\n }\n .components-menu-group:first-child {\n margin-top: -8px;\n }\n "])))},(0,$.tZ)(S.SearchControl,{placeholder:(0,b.__)("Search...","presto-player"),value:d,onChange:f,css:(0,E.iv)(s||(s=(0,p.Z)(["\n padding: 0.5em 0.5em 0em 0.5em;\n "])))}),r&&!t.length?(0,$.tZ)(S.Spinner,null):t.length?(0,$.tZ)(React.Fragment,null,!!m&&(0,$.tZ)(S.MenuGroup,null,(0,$.tZ)(S.MenuItem,{icon:(0,$.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",css:(0,E.iv)(o||(o=(0,p.Z)(["\n width: 18px;\n "])))},(0,$.tZ)("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"})),iconPosition:"left",onClick:m},(0,b.__)("Add New","presto-player"))),!t.length&&d?(0,$.tZ)(S.Disabled,null,(0,$.tZ)(S.MenuItem,null,(0,b.__)("None found.","presto-player"))):(0,$.tZ)(S.MenuGroup,null,(t||[]).map((function(e){return w?w({item:e,onSelect:y}):(0,$.tZ)(S.MenuItem,(0,u.Z)({icon:null==e?void 0:e.icon,iconPosition:"left",onClick:function(){return y(e)}},e),(null==e?void 0:e.title)||"Untitled")}))),c&&t.length&&(0,$.tZ)("div",{css:(0,E.iv)(a||(a=(0,p.Z)(["\n margin-top: 20px;\n text-align: center;\n display: flex;\n justify-content: center;\n width: 100%;\n "])))},(0,$.tZ)(S.Button,{variant:"secondary",size:"small",onClick:h,isBusy:r},(0,b.__)("Load More","presto-player")))):(0,$.tZ)(React.Fragment,null,(0,$.tZ)("span",{css:(0,E.iv)(n||(n=(0,p.Z)(["\n margin: 8px;\n "])))},(0,b.__)("None found.","presto-player"))))}},_)))},A=r(4290),j=["onSelect","value"],R=function(e){var t=e.onSelect,r=e.value,n=(0,v.Z)(e,j),o=(0,h.useState)(""),a=(0,y.Z)(o,2),i=a[0],l=a[1],s=(0,h.useState)(1),m=(0,y.Z)(s,2),k=m[0],P=m[1],N=(0,h.useState)(!1),R=(0,y.Z)(N,2),I=R[0],L=R[1],B=(0,h.useState)([]),D=(0,y.Z)(B,2),M=D[0],F=D[1],V=(0,h.useState)(0),U=(0,y.Z)(V,2),z=U[0],G=U[1],H=(0,C.useDispatch)(w.store).createErrorNotice,W=(0,C.useDispatch)(_.store).receiveEntityRecords,q=(0,h.useState)(!1),Y=(0,y.Z)(q,2),X=Y[0],K=Y[1],Q=O()((function(){P(1),F(null),ee()}),500,{leading:!0});(0,h.useEffect)((function(){X&&Q(i)}),[i,X]),(0,h.useEffect)((function(){X&&ee()}),[k,X]);var J=k<z,ee=function(){var e=(0,f.Z)(g().mark((function e(){var t,r,n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),t=(0,C.select)(_.store).getEntityConfig("postType","pp_video_block").baseURL,e.next=5,x()({path:(0,Z.addQueryArgs)(t,{search:i,page:k,per_page:5,_embed:1}),parse:!1});case 5:return r=e.sent,e.next=8,r.json();case 8:n=e.sent,G(parseInt(r.headers.get("X-WP-TotalPages"))),W("postType","pp_video_block",n),F(!i&&k>1?[].concat((0,d.Z)(M),(0,d.Z)(n)):n),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),H((null===e.t0||void 0===e.t0?void 0:e.t0.message)||(0,b.__)("Something went wrong","presto-player"),{type:"snackbar"});case 17:return e.prev=17,L(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[0,14,17,20]])})));return function(){return e.apply(this,arguments)}}(),te=Array.isArray(r)?r:[r];return(0,$.tZ)(T,(0,u.Z)({isLoading:I,options:M||[],search:i,onSearch:l,onSelect:function(e){e&&t(e)},hasMore:J&&!i,onNextPage:function(){var e=k+1;P(e=e>z?z:e)},onOpen:K,renderToggle:function(e){var t=e.isOpen,r=e.onToggle;return(0,$.tZ)(S.Button,{variant:"primary",onClick:r,"aria-expanded":t},(0,b.__)("Create or select media","presto-player"))},renderItem:function(e){var t,r,n,o=e.item,a=e.onSelect,i=o.id,l=o.title,s=o.details||{},u=s.type,d=s.name,f=(null==o||null===(t=o._embedded)||void 0===t||null===(r=t["wp:featuredmedia"])||void 0===r||null===(n=r[0])||void 0===n?void 0:n.source_url)||"";return(0,$.tZ)(S.MenuItem,{icon:(0,$.tZ)(A.Z,{thumbnail:f,type:u}),iconPosition:"left",suffix:u?d:(0,b.__)("Choose media","presto-player"),onClick:function(){return a(o)},disabled:(te||[]).includes(i),key:i,css:(0,E.iv)(c||(c=(0,p.Z)(["\n .components-menu-item__item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n text-align: left;\n }\n "])))},l||(0,b.__)("Untitled","presto-player"))}},n))}},5297:function(e,t,r){"use strict";var n,o,a,i,l,s,c,u=r(168),p=r(4942),d=r(3324),f=(r(9307),r(7453));function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){(0,p.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var __=wp.i18n.__,h=wp.components,m=h.Button,g=h.Popover,b=h.Icon,Z=wp.blockEditor.__experimentalLinkControl,w=wp.element.useState,_=wp.url.prependHTTP;t.Z=function(e){var t=e.setSettings,r=e.settings,p=w(!1),y=(0,d.Z)(p,2),h=y[0],k=y[1],x=r.url,C=w(),P=(0,d.Z)(C,2),O=P[0],S=P[1],E=v({url:null==r?void 0:r.url,type:null==r?void 0:r.type,id:null==r?void 0:r.id,opensInNewTab:null==r?void 0:r.opensInNewTab},O),$=function(e){e=v(v({},O),e);var r=E.opensInNewTab!==e.opensInNewTab&&E.url===e.url&&void 0===e.url;if(S(r?e:void 0),!r){var n=_(e.url);t({url:n,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewTab:e.opensInNewTab})}};return(0,f.tZ)("span",null,x?(0,f.tZ)("div",{css:(0,f.iv)(n||(n=(0,u.Z)(["\n display: flex;\n justify-content: space-between;\n "])))},(0,f.tZ)("div",{css:(0,f.iv)(o||(o=(0,u.Z)(["\n max-width: 85%;\n overflow: hidden;\n display: flex;\n align-items: center;\n "])))},(0,f.tZ)("a",{href:"#",css:(0,f.iv)(a||(a=(0,u.Z)(["\n padding: 10px;\n background: #f3f3f3;\n border-radius: 4px;\n width: 100%;\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\n "]))),onClick:function(){return k(!h)}},(0,f.tZ)(b,{icon:"edit",css:(0,f.iv)(i||(i=(0,u.Z)(["\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n font-size: 16px;\n width: 16px;\n height: 16px;\n text-decoration: none;\n "])))}),x),h&&(0,f.tZ)(g,{position:"bottom center",onClose:function(){return k(!1)}},(0,f.tZ)(Z,{value:r,onChange:$}))),(0,f.tZ)("div",{css:(0,f.iv)(l||(l=(0,u.Z)(["\n display: flex;\n align-items: center;\n "])))},(0,f.tZ)(b,{onClick:function(){confirm(__("Are you sure you wish to remove this link?","presto-player"))&&t({})},icon:"trash",className:"presto-icon",css:(0,f.iv)(s||(s=(0,u.Z)(["\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n fontsize: 18px;\n width: 18px;\n height: 18px;\n\n &:hover {\n color: #cc1818;\n }\n "])))}))):(0,f.tZ)("span",null,(0,f.tZ)(m,{isPrimary:!0,isSmall:!0,onClick:function(){return k(!h)}},__("Add Link","presto-player")),h&&(0,f.tZ)(g,{css:(0,f.iv)(c||(c=(0,u.Z)(["margin-top: 10px"]))),position:"bottom right",onClose:function(){return k(!1)}},(0,f.tZ)(Z,{value:r,onChange:$}))))}},4290:function(e,t,r){"use strict";var n,o,a,i=r(168),l=(r(9307),r(5736),r(4981)),s=r(7453),c=r(917);t.Z=function(e){var t,r,u=e.thumbnail,p=e.type;return u?(0,c.tZ)("img",{css:(0,s.iv)(o||(o=(0,i.Z)(["\n width: 24px;\n height: 24px;\n object-fit: cover;\n margin-right: 8px;\n border-radius: 3px;\n "]))),src:u,alt:"Presto video thumbnail"}):(0,c.tZ)("div",{css:(0,s.iv)(a||(a=(0,i.Z)(["\n width: 24px;\n margin-right: 8px;\n line-height: 0;\n "])))},null!=(r=(0,l.getBlockType)("presto-player/".concat(p)))&&null!==(t=r.icon)&&void 0!==t&&t.src?r.icon.src:(0,c.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-6 h-6",css:(0,s.iv)(n||(n=(0,i.Z)(["\n color: var(--wp-admin-theme-color, #007cba);\n "])))},(0,c.tZ)("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm14.024-.983a1.125 1.125 0 0 1 0 1.966l-5.603 3.113A1.125 1.125 0 0 1 9 15.113V8.887c0-.857.921-1.4 1.671-.983l5.603 3.113Z",clipRule:"evenodd"})))}},2777:function(e,t){"use strict";var r={setUrlPrivate:function(){var e=-1===window.location.href.indexOf("?")?"?":"&",t=window.location.href+e+"presto_video_type=private";window.history.pushState({path:t},"",t)},setUrlPublic:function(){var e=-1===window.location.href.indexOf("?")?"?":"&",t=window.location.href+e+"presto_video_type=public";window.history.pushState({path:t},"",t)},unsetUrlParams:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=new URL(e);return t.forEach((function(e){r.searchParams.delete(e)})),r.href}(window.location.href,["presto_video_type"]);window.history.pushState({path:e},"",e)}};t.Z=r},3865:function(e,t,r){"use strict";r.d(t,{Z:function(){return W}});var n,o,a,i=r(168),l=r(4942),s=r(3324),c=(r(9307),r(1145)),u=r(5297),p=r(5861),d=r(1284),f=r.n(d),y=r(7453);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){(0,l.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m,g,__=wp.i18n.__,b=wp.components,Z=b.TextControl,w=b.ExternalLink,_=b.Button,k=(b.Flex,wp.element),x=k.useState,C=k.useEffect,P=wp.data,O=P.useSelect,S=P.dispatch,E=function(e){var t=e.onClose,r=e.value,l=e.setValue,c=x(!1),u=(0,s.Z)(c,2),d=u[0],v=u[1],m=wp.data.useSelect((function(e){return e("core").canUser("read","settings")})),g=O((function(e){return e("presto-player/player").youtube()}));C((function(){l(g.channel_id)}),[null==g?void 0:g.channel_id]);var b=function(){var e=(0,p.Z)(f().mark((function e(n){var o,a;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),v(!0),S("presto-player/player").updateYoutube({channel_id:r}),o=h(h({},g),{channel_id:r}),e.prev=4,e.next=7,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:o}});case 7:null!=(a=e.sent)&&a.presto_player_youtube&&(S("presto-player/player").setYoutube(null==a?void 0:a.presto_player_youtube),t()),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(4);case 13:return e.prev=13,v(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[4,11,13,16]])})));return function(_x){return e.apply(this,arguments)}}();return m?(0,y.tZ)("form",{onSubmit:b},(0,y.tZ)(Z,{css:(0,y.iv)(n||(n=(0,i.Z)(["\n margin-bottom: 0 !important;\n "]))),label:__("Youtube Channel ID","presto-player"),help:(0,y.tZ)("p",null,(0,y.tZ)(w,{href:"https://support.google.com/youtube/answer/3250431?hl=en"},__("Find my channel id","presto-player"))),value:r,onChange:function(e){return l(e)}}),(0,y.tZ)(_,{disabled:d,isBusy:d,css:(0,y.iv)(o||(o=(0,i.Z)(["\n margin-bottom: 1em;\n "]))),isPrimary:!0,type:"submot"},__("Save","presto-player")),(0,y.tZ)(_,{onClick:t,css:(0,y.iv)(a||(a=(0,i.Z)(["\n margin-bottom: 1em;\n "]))),isTertiary:!0},__("Cancel","presto-player"))):""},$=r(917);function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){(0,l.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var A=wp.i18n.__,j=wp.components,R=j.ToggleControl,I=j.Flex,L=j.Button,B=j.BaseControl,D=j.RangeControl,M=j.TextControl,F=j.SelectControl,V=j.TextareaControl,U=wp.element,z=U.useEffect,G=U.useState,H=wp.data.useSelect;function W(e){var t=e.state,r=e.updateState,n=e.className,o=e.value,a=e.setValue,l=t.action_bar,p=G(!1),d=(0,s.Z)(p,2),f=d[0],v=d[1],h=H((function(e){return e("presto-player/player").branding()})),b=H((function(e){return e("presto-player/player").youtube()})),Z=function(e){r(T(T({},t),{},{action_bar:T(T({},l),e)}))};return z((function(){null!=l&&l.text||Z({text:"Like this?"}),null!=l&&l.button_type||Z({button_type:"custom"}),null!=l&&l.button_text||Z({button_text:"Click Here"})}),[t]),(0,$.tZ)("div",{className:n},(0,$.tZ)(B,null,(0,$.tZ)("h3",null,A("Action Bar","presto-player"))),(0,$.tZ)(B,{className:"presto-player__control--large-play"},(0,$.tZ)(R,{label:A("Enable","presto-player"),help:A("Show an action bar below your player while it's playing.","presto-player"),onChange:function(e){Z({enabled:e})},checked:null==l?void 0:l.enabled})),!(null==l||!l.enabled)&&(0,$.tZ)(React.Fragment,null,(0,$.tZ)(B,{className:"presto-player__control--percentage-watched",css:(0,y.iv)(m||(m=(0,i.Z)(["\n padding-left: 8px;\n margin-bottom: 34px !important;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))},(0,$.tZ)(D,{label:A("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){Z({percentage_start:e})},marks:[{value:0,label:A("Start","presto-player")},{value:50,label:A("50% Watched","presto-player")},{value:100,label:A("End","presto-player")}],shiftStep:5,value:(null==l?void 0:l.percentage_start)||0,css:(0,y.iv)(g||(g=(0,i.Z)(["\n .components-range-control__slider {\n position: relative !important;\n }\n "])))})),(0,$.tZ)(B,{className:"presto-player__control--large-play"},(0,$.tZ)(V,{label:A("Text","presto-player"),help:A("Action bar text.","presto-player"),value:null==l?void 0:l.text,onChange:function(e){return Z({text:e})}})),(0,$.tZ)(B,{className:"presto-player__control--large-play"},(0,$.tZ)(I,null,(0,$.tZ)(B.VisualLabel,null,A("Action Bar Background","presto-player")),(0,$.tZ)(c.Z,{color:(null==l?void 0:l.background_color)||"#1d1d1d",setColor:function(e){return Z({background_color:e&&e.hex})}}))),(0,$.tZ)(B,null,(0,$.tZ)("h3",null,A("Button","presto-player"))),(0,$.tZ)(B,{className:"presto-player__control--button-type"},(0,$.tZ)(F,{label:A("Button Type","presto-player"),value:null==l?void 0:l.button_type,options:[{value:"custom",label:A("Custom","presto-player")},{value:"youtube",label:A("YouTube Subscribe","presto-player")},{value:"none",label:A("None","presto-player")}],onChange:function(e){return Z({button_type:e})}})),"youtube"===(null==l?void 0:l.button_type)&&(null==b?void 0:b.channel_id)&&(0,$.tZ)(R,{label:A("Show Count","presto-player"),help:A("Show your follower count.","presto-player"),onChange:function(e){Z({button_count:e})},checked:null==l?void 0:l.button_count}),function(){if("youtube"===(null==l?void 0:l.button_type))return f?(0,$.tZ)(E,{onClose:function(){return v(!1)},value:o,setValue:a}):(0,$.tZ)("div",null,(0,$.tZ)(L,{isSecondary:!0,onClick:function(e){e.preventDefault(),v(!0)}},null!=b&&b.channel_id?A("Update Youtube Channel Id","presto-player"):A("Add Youtube Channel Id","presto-player")),(0,$.tZ)("br",null),(0,$.tZ)("br",null),(0,$.tZ)("br",null))}(),"custom"===(null==l?void 0:l.button_type)&&(0,$.tZ)("div",null,(0,$.tZ)(B,{className:"presto-player__control--button-text"},(0,$.tZ)(M,{label:A("Button Text","presto-player"),help:(0,$.tZ)("p",null,A("Submit button text","presto-player")),value:null==l?void 0:l.button_text,onChange:function(e){return Z({button_text:e})}})),(0,$.tZ)(B,{className:"presto-player__control--button-text"},(0,$.tZ)(B.VisualLabel,null,(0,$.tZ)("p",null," ",A("Button Link","presto-player"))),(0,$.tZ)(u.Z,{setSettings:function(e){Z({button_link:e})},settings:(null==l?void 0:l.button_link)||{}})),(0,$.tZ)(B,{className:"presto-player__control--button-radius"},(0,$.tZ)(D,{label:A("Round Corners","presto-player"),help:A("Border radius of the button","presto-player"),value:(null==l?void 0:l.button_radius)||0,onChange:function(e){return Z({button_radius:e})},min:0,max:25})),(0,$.tZ)(B,{className:"presto-player__control--button-color"},(0,$.tZ)(I,null,(0,$.tZ)(B.VisualLabel,null,A("Button Color","presto-player")),(0,$.tZ)(c.Z,{color:(null==l?void 0:l.button_color)||(null==h?void 0:h.color),setColor:function(e){return Z({button_color:e&&e.hex})}}))),(0,$.tZ)(B,{className:"presto-player__control--button-text-color"},(0,$.tZ)(I,null,(0,$.tZ)(B.VisualLabel,null,A("Button Text Color","presto-player")),(0,$.tZ)(c.Z,{color:(null==l?void 0:l.button_text_color)||"#ffffff",setColor:function(e){return Z({button_text_color:e&&e.hex})}}))))))}},7833:function(e,t,r){"use strict";var n,o,a,i,l,s,c=r(168),u=r(4942),p=r(9307),d=r(5736),f=r(5609),y=r(9818),v=r(5297),h=r(1145),m=r(7453);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){(0,u.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Z(e){var t=e.state,r=e.updateState,g=e.className,Z=t.cta,w=t.email_collection,_=(0,y.useSelect)((function(e){return e("presto-player/player").branding()})),k={percentage:100,show_rewatch:!0,show_skip:!0,headline:(0,d.__)("Want to learn more?","presto-player"),show_button:!0,button_text:(0,d.__)("Click Here","presto-player"),button_link:{opensInNewTab:!0}};(0,p.useEffect)((function(){Object.keys(k).forEach((function(e){var r;void 0===(null==t||null===(r=t.cta)||void 0===r?void 0:r[e])&&x((0,u.Z)({},e,k[e]))}))}),[t]);var x=function(e){r(b(b({},t),{},{cta:b(b({},Z),e)}))};return(0,m.tZ)("div",{className:g},(0,m.tZ)(f.BaseControl,null,(0,m.tZ)("h3",null,(0,d.__)("Call To Action","presto-player"))),(0,m.tZ)(f.BaseControl,{className:"presto-player__control--large-play"},(0,m.tZ)(f.ToggleControl,{label:(0,d.__)("Enable","presto-player"),help:(0,d.__)("Show an email collection form and message over your player.","presto-player"),onChange:function(e){x({enabled:e})},checked:null==Z?void 0:Z.enabled})),!(null==Z||!Z.enabled)&&(0,m.tZ)(React.Fragment,null,(0,m.tZ)(f.BaseControl,{className:"presto-player__control--percentage-watched",css:(0,m.iv)(n||(n=(0,c.Z)(["\n padding-left: 8px;\n margin-bottom: 34px !important;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))},(0,m.tZ)(f.RangeControl,{label:(0,d.__)("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){x({percentage:e})},marks:[{value:0,label:(0,d.__)("Start","presto-player")},{value:50,label:(0,d.__)("50% Watched","presto-player")},{value:100,label:(0,d.__)("End","presto-player")}],shiftStep:5,value:null==Z?void 0:Z.percentage,css:(0,m.iv)(o||(o=(0,c.Z)(["\n .components-range-control__slider {\n position: relative !important;\n }\n "])))})),(null==w?void 0:w.enabled)&&(null==w?void 0:w.percentage)===(null==Z?void 0:Z.percentage)&&(0,m.tZ)(f.Notice,{css:(0,m.iv)(a||(a=(0,c.Z)(["\n margin: 0 0 30px 0 !important;\n "]))),status:"warning",isDismissible:!1},(0,d.__)("You already have an email capture set display at the same time.","presto-player"),(0,m.tZ)(f.Button,{onClick:function(){r(b(b({},t),{},{email_collection:b(b({},w),{enabled:!1})}))},isLink:!0,css:(0,m.iv)(i||(i=(0,c.Z)(["\n margin-top: 10px !important;\n "])))},(0,d.__)("Disable Email Capture","presto-player"))),100===(null==Z?void 0:Z.percentage)?(0,m.tZ)(f.BaseControl,{className:"presto-player__control--show-rewatch"},(0,m.tZ)(f.ToggleControl,{label:(0,d.__)("Show Rewatch Button","presto-player"),help:(0,d.__)("Show a rewatch button at the end of the player.","presto-player"),onChange:function(e){x({show_rewatch:e})},checked:null==Z?void 0:Z.show_rewatch})):(0,m.tZ)(f.BaseControl,{className:"presto-player__control--show-skip"},(0,m.tZ)(f.ToggleControl,{label:(0,d.__)("Allow Skipping","presto-player"),help:(0,d.__)("Let the user continue watching the player.","presto-player"),onChange:function(e){x({show_skip:e})},checked:null==Z?void 0:Z.show_skip})),(0,m.tZ)(f.BaseControl,{className:"presto-player__control--button-link"},(0,m.tZ)(f.BaseControl.VisualLabel,null,(0,m.tZ)("p",null," ",(0,d.__)("Link","presto-player"))),(0,m.tZ)(v.Z,{setSettings:function(e){x({button_link:e})},settings:(null==Z?void 0:Z.button_link)||{}})),(0,m.tZ)(f.BaseControl,{className:"presto-player__control--headline"},(0,m.tZ)(f.TextareaControl,{label:(0,d.__)("Headline","presto-player"),help:(0,d.__)("The headline for your form.","presto-player"),value:null==Z?void 0:Z.headline,onChange:function(e){x({headline:e})}})),(0,m.tZ)(f.BaseControl,{className:"presto-player__control--bottom-text"},(0,m.tZ)(f.TextareaControl,{label:(0,d.__)("Bottom Text","presto-player"),help:(0,d.__)("Text displayed below the form. HTML allowed.","presto-player"),value:null==Z?void 0:Z.bottom_text,onChange:function(e){x({bottom_text:e})}})),(0,m.tZ)(f.BaseControl,{className:"presto-player__control--show-button"},(0,m.tZ)(f.ToggleControl,{label:(0,d.__)("Show Button","presto-player"),help:(0,d.__)("Show a call to action button.","presto-player"),onChange:function(e){x({show_button:e})},checked:null==Z?void 0:Z.show_button})),!(null==Z||!Z.show_button)&&(0,m.tZ)("div",null,(0,m.tZ)(f.BaseControl,{className:"presto-player__control--button-text"},(0,m.tZ)(f.TextControl,{label:(0,d.__)("Button Text","presto-player"),help:(0,m.tZ)("p",null,(0,d.__)("Button text for the Call To Action","presto-player")),value:null==Z?void 0:Z.button_text,onChange:function(e){return x({button_text:e})}})),(0,m.tZ)("h3",null,(0,d.__)("Style","presto-player")),(0,m.tZ)(f.BaseControl,null,(0,m.tZ)(f.RangeControl,{label:(0,d.__)("Round Corners","presto-player"),help:(0,d.__)("Border radius of form elements.","presto-player"),value:(null==Z?void 0:Z.button_radius)||0,onChange:function(e){return x({button_radius:e})},min:0,max:25,css:(0,m.iv)(l||(l=(0,c.Z)(["\n padding-left: 4px;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))})),(0,m.tZ)(f.BaseControl,{className:"presto-player__control--button-color"},(0,m.tZ)(f.Flex,null,(0,m.tZ)(f.BaseControl.VisualLabel,null,(0,d.__)("Button Color","presto-player")),(0,m.tZ)(h.Z,{color:(null==Z?void 0:Z.button_color)||(null==_?void 0:_.color),setColor:function(e){return x({button_color:e&&e.hex})}}))),(0,m.tZ)(f.BaseControl,{className:"presto-player__control--button-text-color"},(0,m.tZ)(f.Flex,null,(0,m.tZ)(f.BaseControl.VisualLabel,null,(0,d.__)("Button Text Color","presto-player")),(0,m.tZ)(h.Z,{color:(null==Z?void 0:Z.button_text_color)||"#ffffff",setColor:function(e){return x({button_text_color:e&&e.hex})}})))),(0,m.tZ)(f.BaseControl,null,(0,m.tZ)(f.RangeControl,{label:(0,d.__)("Background Opacity","presto-player"),help:(0,d.__)("Opacity percentage of the cover background.","presto-player"),value:(null==Z?void 0:Z.background_opacity)||75,onChange:function(e){return x({background_opacity:e})},min:0,max:100,css:(0,m.iv)(s||(s=(0,c.Z)(["\n padding-left: 4px;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))}))))}Z.defaultProps={catName:"Sandy",eyeColor:"deepblue",age:"120"},t.Z=Z},9632:function(e,t,r){"use strict";r.d(t,{Z:function(){return Ze}});var n,o,a,i,l,s=r(168),c=r(4942),u=(r(9307),r(5736)),p=r(5609),d=r(9818),f=r(2982),y=r(5861),v=r(3324),h=r(1284),m=r.n(h),g=r(917),b=function(){return(0,g.tZ)("div",null,(0,g.tZ)("presto-player-skeleton",{style:{width:"30%",marginBottom:"10px"}}),(0,g.tZ)("presto-player-skeleton",{style:{height:"2rem",marginBottom:"20px"}}))},__=wp.i18n.__,Z=wp.components,w=Z.SelectControl,_=Z.TextControl,k=Z.Notice,x=wp.element,C=x.useEffect,P=x.useState,O=function(e){var t=e.options,r=e.updateEmailState,n=P(!1),o=(0,v.Z)(n,2),a=o[0],i=o[1],l=P([{value:null,label:__("Choose an audience","presto-player")}]),s=(0,v.Z)(l,2),c=s[0],u=s[1],p=P(""),d=(0,v.Z)(p,2),h=d[0],Z=d[1],x=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/mailchimp/lists"});case 4:t=e.sent,r=c,(t||[]).forEach((function(e){r=[].concat((0,f.Z)(r),[{value:e.id,label:e.name}])})),u(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&Z(e.t0.message);case 13:return e.prev=13,i(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return C((function(){x()}),[]),a?(0,g.tZ)("div",null,(0,g.tZ)(b,null),(0,g.tZ)(b,null)):h?(0,g.tZ)(k,{className:"presto-notice",status:"error",isDismissible:!1},h):(0,g.tZ)("div",null,(0,g.tZ)(w,{label:__("Choose an audience","presto-player"),value:null==t?void 0:t.provider_list,options:c,onChange:function(e){return r({provider_list:e})}}),(0,g.tZ)(_,{label:__("Tag","presto-player"),help:(0,g.tZ)("p",null,__("Give this contact an optional tag when they are added to the list.","presto-player")),value:null==t?void 0:t.provider_tag,onChange:function(e){return r({provider_tag:e})}}))},S=wp.i18n.__,E=wp.components,$=E.SelectControl,N=E.Notice,T=wp.element,A=T.useEffect,j=T.useState,R=function(e){var t=e.options,r=e.updateEmailState,n=j(!1),o=(0,v.Z)(n,2),a=o[0],i=o[1],l=j([{value:null,label:S("Choose a group","presto-player")}]),s=(0,v.Z)(l,2),c=s[0],u=s[1],p=j(""),d=(0,v.Z)(p,2),h=d[0],Z=d[1],w=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/mailerlite/groups"});case 4:t=e.sent,r=c,(t||[]).forEach((function(e){r=[].concat((0,f.Z)(r),[{value:e.id,label:e.name}])})),u(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&Z(e.t0.message);case 13:return e.prev=13,i(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return A((function(){w()}),[]),a?(0,g.tZ)(b,null):h?(0,g.tZ)(N,{className:"presto-notice",status:"error",isDismissible:!1},h):(0,g.tZ)("div",null,(0,g.tZ)($,{label:S("Choose a group","presto-player"),value:null==t?void 0:t.provider_list,options:c,onChange:function(e){return r({provider_list:e})}}))},I=wp.i18n.__,L=wp.components,B=L.SelectControl,D=L.Notice,M=wp.element,F=M.useEffect,V=M.useState,U=function(e){var t=e.options,r=e.updateEmailState,n=V(!1),o=(0,v.Z)(n,2),a=o[0],i=o[1],l=V(!1),s=(0,v.Z)(l,2),c=s[0],u=s[1],p=V([{value:null,label:I("Choose a list","presto-player")}]),d=(0,v.Z)(p,2),h=d[0],Z=d[1],w=V([{value:null,label:I("Choose a tag","presto-player")}]),_=(0,v.Z)(w,2),k=_[0],x=_[1],C=V(""),P=(0,v.Z)(C,2),O=P[0],S=P[1],E=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/activecampaign/lists"});case 4:t=e.sent,r=h,(t||[]).forEach((function(e){r=[].concat((0,f.Z)(r),[{value:e.id,label:e.name||I("Default list","presto-player")}])})),Z(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&S(e.t0.message);case 13:return e.prev=13,i(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/activecampaign/tags"});case 4:t=e.sent,r=k,(t||[]).forEach((function(e){r=[].concat((0,f.Z)(r),[{value:e.id,label:e.tag}])})),x(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&S(e.t0.message);case 13:return e.prev=13,u(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return F((function(){E(),$()}),[]),O?(0,g.tZ)(D,{className:"presto-notice",status:"error",isDismissible:!1},O):(0,g.tZ)("div",null,a?(0,g.tZ)(b,null):h.length>1&&(0,g.tZ)(B,{label:I("Choose a list","presto-player"),value:null==t?void 0:t.provider_list,options:h,onChange:function(e){return r({provider_list:e})}}),c?(0,g.tZ)(b,null):k.length>1&&(0,g.tZ)(B,{label:I("Choose a tag","presto-player"),value:null==t?void 0:t.provider_tag,options:k,onChange:function(e){return r({provider_tag:e})}}))},z=wp.i18n.__,G=wp.components,H=G.SelectControl,W=G.Notice,q=wp.element,Y=q.useEffect,X=q.useState,K=function(e){var t=e.options,r=e.updateEmailState,n=X(!1),o=(0,v.Z)(n,2),a=o[0],i=o[1],l=X(!1),s=(0,v.Z)(l,2),c=s[0],u=s[1],p=X([{value:null,label:z("Choose a list","presto-player")}]),d=(0,v.Z)(p,2),h=d[0],Z=d[1],w=X([{value:null,label:z("Choose a tag","presto-player")}]),_=(0,v.Z)(w,2),k=_[0],x=_[1],C=X(""),P=(0,v.Z)(C,2),O=P[0],S=P[1],E=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/fluentcrm/lists"});case 4:t=e.sent,r=h,(t||[]).forEach((function(e){r=[].concat((0,f.Z)(r),[{value:e.id,label:e.title||e.slug}])})),Z(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&S(e.t0.message);case 13:return e.prev=13,i(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/fluentcrm/tags"});case 4:t=e.sent,r=k,(t||[]).forEach((function(e){r=[].concat((0,f.Z)(r),[{value:e.id,label:e.title||e.slug}])})),x(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&S(e.t0.message);case 13:return e.prev=13,u(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return Y((function(){E(),$()}),[]),O?(0,g.tZ)(W,{className:"presto-notice",status:"error",isDismissible:!1},O):(0,g.tZ)("div",null,a?(0,g.tZ)(b,null):h.length>1&&(0,g.tZ)(H,{label:z("Choose a list","presto-player"),value:null==t?void 0:t.provider_list,options:h,onChange:function(e){return r({provider_list:e})}}),c?(0,g.tZ)(b,null):k.length>1&&(0,g.tZ)(H,{label:z("Choose a tag","presto-player"),value:null==t?void 0:t.provider_tag,options:k,onChange:function(e){return r({provider_tag:e})}}))},Q=wp.i18n.__,J=wp.components,ee=J.SelectControl,te=J.Notice,re=wp.element,ne=re.useEffect,oe=re.useState,ae=function(e){var t=e.options,r=e.updateEmailState,n=oe(!1),o=(0,v.Z)(n,2),a=o[0],i=o[1],l=oe([{value:null,label:Q("Choose a webhook","presto-player")}]),s=(0,v.Z)(l,2),c=s[0],u=s[1],p=oe(""),d=(0,v.Z)(p,2),h=d[0],Z=d[1],w=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/webhook"});case 4:t=e.sent,r=c,(t||[]).forEach((function(e){r=[].concat((0,f.Z)(r),[{value:e.id,label:e.name}])})),u(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&Z(e.t0.message);case 13:return e.prev=13,i(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return ne((function(){w()}),[]),a?(0,g.tZ)(b,null):h?(0,g.tZ)(te,{className:"presto-notice",status:"error",isDismissible:!1},h):(0,g.tZ)("div",null,(0,g.tZ)(ee,{label:Q("Choose a webhook","presto-player"),value:null==t?void 0:t.provider_list,options:c,onChange:function(e){return r({provider_list:e})}}))},ie=wp.i18n.__,le=wp.components,se=le.SelectControl,ce=le.Button,ue=le.Flex,pe=le.Icon,de=wp.element,fe=de.useEffect,ye=de.useState,ve=function(e){var t=e.options,r=e.updateEmailState,n=ye(!1),o=(0,v.Z)(n,2),a=o[0],i=o[1],l=ye([{value:"none",label:ie("None","presto-player")}]),s=(0,v.Z)(l,2),c=s[0],u=s[1],p=ye(""),d=(0,v.Z)(p,2),h=d[0],Z=d[1],w={presto_player_activecampaign:{label:"ActiveCampaign",value:"activecampaign"},presto_player_mailchimp:{label:"MailChimp",value:"mailchimp"},presto_player_mailerlite:{label:"MailerLite",value:"mailerlite"},presto_player_fluentcrm:{label:"FluentCRM",value:"fluentcrm"}},_=function(){var e=(0,y.Z)(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),Z(""),e.prev=2,e.next=5,wp.apiFetch({path:"wp/v2/settings"});case 5:t=e.sent,r=c,Object.keys(t).forEach((function(e){var n;null!=w&&w[e]&&null!==(n=t[e])&&void 0!==n&&n.connected&&(r=[].concat((0,f.Z)(r),[w[e]]))})),u([].concat((0,f.Z)(r),[{label:ie("Webhooks","presto-player"),value:"webhooks"}])),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),null!==e.t0&&void 0!==e.t0&&e.t0.message&&Z(e.t0.message);case 14:return e.prev=14,i(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(){return e.apply(this,arguments)}}();return fe((function(){_()}),[]),a?(0,g.tZ)(b,null):(0,g.tZ)("div",null,h,c.length>1?(0,g.tZ)("div",null,(0,g.tZ)(se,{label:ie("Choose an email provider","presto-player"),value:null==t?void 0:t.provider,options:c,onChange:function(e){return r({provider:e})}}),function(){var e=c.find((function(e){return e.value===(null==t?void 0:t.provider)}));if(Object.keys(e||{}).length)switch(null==t?void 0:t.provider){case"webhooks":return(0,g.tZ)(ae,{options:t,updateEmailState:r});case"mailchimp":return(0,g.tZ)(O,{options:t,updateEmailState:r});case"mailerlite":return(0,g.tZ)(R,{options:t,updateEmailState:r});case"activecampaign":return(0,g.tZ)(U,{options:t,updateEmailState:r});case"fluentcrm":return(0,g.tZ)(K,{options:t,updateEmailState:r})}}()):(0,g.tZ)(ue,null,(0,g.tZ)(ce,{target:"_blank",href:"/wp-admin/edit.php?post_type=pp_video_block&page=presto-player-settings#/integrations",isSecondary:!0,isSmall:!0},ie("Connect a provider","presto-player")),(0,g.tZ)(ce,{isSmall:!0,onClick:function(e){e.preventDefault(),_()}},(0,g.tZ)(pe,{icon:"update"}))))},he=r(1145),me=r(7453);function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){(0,c.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ze(e){var t=e.state,r=e.updateState,c=e.className,f=t.email_collection,y=t.cta,v=(0,d.useSelect)((function(e){return e("presto-player/player").branding()})),h=function(e){r(be(be({},t),{},{email_collection:be(be({},f),e)}))};return(0,me.tZ)("div",{className:c},(0,me.tZ)(p.BaseControl,null,(0,me.tZ)("h3",null,(0,u.__)("Email Capture","presto-player"))),(0,me.tZ)(p.BaseControl,{className:"presto-player__control--large-play"},(0,me.tZ)(p.ToggleControl,{label:(0,u.__)("Enable","presto-player"),help:(0,u.__)("Show an email collection form and message over your player.","presto-player"),onChange:function(e){h({enabled:e})},checked:null==f?void 0:f.enabled})),!(null==f||!f.enabled)&&(0,me.tZ)(React.Fragment,null,(0,me.tZ)(p.BaseControl,{className:"presto-player__control--percentage-watched",css:(0,me.iv)(n||(n=(0,s.Z)(["\n padding-left: 8px;\n margin-bottom: 34px !important;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))},(0,me.tZ)(p.RangeControl,{label:(0,u.__)("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){h({percentage:e})},marks:[{value:0,label:(0,u.__)("Start","presto-player")},{value:50,label:(0,u.__)("50% Watched","presto-player")},{value:100,label:(0,u.__)("End","presto-player")}],shiftStep:5,value:(null==f?void 0:f.percentage)||0,css:(0,me.iv)(o||(o=(0,s.Z)(["\n .components-range-control__slider {\n position: relative !important;\n }\n "])))})),(null==y?void 0:y.enabled)&&(null==f?void 0:f.percentage)===(null==y?void 0:y.percentage)&&(0,me.tZ)(p.Notice,{css:(0,me.iv)(a||(a=(0,s.Z)(["\n margin: 0 0 30px 0 !important;\n "]))),status:"warning",isDismissible:!1},(0,u.__)("You already have a Call To Action set display at the same time.","presto-player"),(0,me.tZ)(p.Button,{onClick:function(){r(be(be({},t),{},{cta:be(be({},y),{enabled:!1})}))},isLink:!0,css:(0,me.iv)(i||(i=(0,s.Z)(["\n margin-top: 10px !important;\n "])))},(0,u.__)("Disable Call To Action","presto-player"))),(0,me.tZ)(p.BaseControl,{className:"presto-player__control--large-play"},(0,me.tZ)(p.ToggleControl,{label:(0,u.__)("Allow Skipping","presto-player"),help:(0,u.__)("Let the viewer skip","presto-player"),onChange:function(e){h({allow_skip:e})},checked:null==f?void 0:f.allow_skip})),(0,me.tZ)(p.BaseControl,{className:"presto-player__control--large-play"},(0,me.tZ)(p.TextareaControl,{label:(0,u.__)("Headline","presto-player"),help:(0,u.__)("The headline for your form.","presto-player"),value:null==f?void 0:f.headline,onChange:function(e){h({headline:e})}})),(0,me.tZ)(p.BaseControl,{className:"presto-player__control--large-play"},(0,me.tZ)(p.TextareaControl,{label:(0,u.__)("Bottom Text","presto-player"),help:(0,u.__)("Text displayed below the form. HTML allowed.","presto-player"),value:null==f?void 0:f.bottom_text,onChange:function(e){h({bottom_text:e})}})),(0,me.tZ)(p.BaseControl,{className:"presto-player__control--large-play"},(0,me.tZ)(p.TextControl,{label:(0,u.__)("Play Button Text","presto-player"),help:(0,me.tZ)("p",null,(0,u.__)("Submit button text","presto-player")),value:null==f?void 0:f.button_text,onChange:function(e){return h({button_text:e})}})),(0,me.tZ)(p.BaseControl,{className:"presto-player__control--button-color"},(0,me.tZ)(p.Flex,null,(0,me.tZ)(p.BaseControl.VisualLabel,null,(0,u.__)("Button Color","presto-player")),(0,me.tZ)(he.Z,{color:(null==y?void 0:y.button_color)||(null==v?void 0:v.color),setColor:function(e){return h({button_color:e&&e.hex})}}))),(0,me.tZ)(p.BaseControl,{className:"presto-player__control--button-text-color"},(0,me.tZ)(p.Flex,null,(0,me.tZ)(p.BaseControl.VisualLabel,null,(0,u.__)("Button Text Color","presto-player")),(0,me.tZ)(he.Z,{color:(null==y?void 0:y.button_text_color)||"#ffffff",setColor:function(e){return h({button_text_color:e&&e.hex})}}))),(0,me.tZ)("h3",null,(0,u.__)("Integrate","presto-player")),(0,me.tZ)(p.BaseControl,null,(0,me.tZ)(ve,{updateEmailState:h,options:f})),(0,me.tZ)("h3",null,(0,u.__)("Style","presto-player")),(0,me.tZ)(p.BaseControl,null,(0,me.tZ)(p.RangeControl,{label:(0,u.__)("Round Corners","presto-player"),help:(0,u.__)("Border radius of form elements.","presto-player"),value:(null==f?void 0:f.border_radius)||0,onChange:function(e){return h({border_radius:e})},min:0,max:25,css:(0,me.iv)(l||(l=(0,s.Z)(["\n padding-left: 4px;\n .components-range-control__root {\n align-items: flex-start;\n }\n "])))}))))}},9235:function(e,t,r){"use strict";r.d(t,{Z:function(){return $}});var n=r(2982),o=r(3324),a=r(4942),i=(r(9307),r(917));function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,a.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var c=wp.i18n,__=c.__,u=c.sprintf,p=wp.components,d=p.NavigableMenu,f=p.MenuItem,y=p.FormFileUpload,v=p.MenuGroup,h=p.ToolbarGroup,m=p.ToolbarButton,g=p.Dropdown,b=(p.SVG,p.Rect,p.Path,p.Button),Z=p.TextControl,w=(p.SelectControl,wp.blockEditor),_=w.MediaUpload,k=w.MediaUploadCheck,x=wp.data.useSelect,C=wp.element.useState,P=["text/vtt"],O=(0,i.tZ)("svg",{viewBox:"0 0 29 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5014 20.2854H28.6316V0.764648H0.110825V20.2854H11.241L14.3712 24.2854L17.5014 20.2854ZM14.3712 21.0401L16.5269 18.2854H26.6316V2.76465H2.11082V18.2854H12.2155L14.3712 21.0401Z"}),(0,i.tZ)("path",{d:"M10.4503 14.9446C9.56226 14.9446 8.76226 14.7606 8.05026 14.3926C7.33826 14.0166 6.77826 13.4966 6.37026 12.8326C5.97026 12.1606 5.77026 11.4006 5.77026 10.5526C5.77026 9.70464 5.97026 8.94864 6.37026 8.28464C6.77826 7.61264 7.33826 7.09264 8.05026 6.72464C8.76226 6.34864 9.56226 6.16064 10.4503 6.16064C11.2663 6.16064 11.9943 6.30464 12.6343 6.59264C13.2743 6.88064 13.8023 7.29664 14.2183 7.84064L12.4303 9.43664C11.9103 8.78064 11.2983 8.45264 10.5943 8.45264C10.0023 8.45264 9.52626 8.64464 9.16626 9.02864C8.80626 9.40464 8.62626 9.91264 8.62626 10.5526C8.62626 11.1926 8.80626 11.7046 9.16626 12.0886C9.52626 12.4646 10.0023 12.6526 10.5943 12.6526C11.2983 12.6526 11.9103 12.3246 12.4303 11.6686L14.2183 13.2646C13.8023 13.8086 13.2743 14.2246 12.6343 14.5126C11.9943 14.8006 11.2663 14.9446 10.4503 14.9446Z"}),(0,i.tZ)("path",{d:"M19.2042 14.9446C18.3162 14.9446 17.5162 14.7606 16.8042 14.3926C16.0922 14.0166 15.5322 13.4966 15.1242 12.8326C14.7242 12.1606 14.5242 11.4006 14.5242 10.5526C14.5242 9.70464 14.7242 8.94864 15.1242 8.28464C15.5322 7.61264 16.0922 7.09264 16.8042 6.72464C17.5162 6.34864 18.3162 6.16064 19.2042 6.16064C20.0202 6.16064 20.7482 6.30464 21.3882 6.59264C22.0282 6.88064 22.5562 7.29664 22.9722 7.84064L21.1842 9.43664C20.6642 8.78064 20.0522 8.45264 19.3482 8.45264C18.7562 8.45264 18.2802 8.64464 17.9202 9.02864C17.5602 9.40464 17.3802 9.91264 17.3802 10.5526C17.3802 11.1926 17.5602 11.7046 17.9202 12.0886C18.2802 12.4646 18.7562 12.6526 19.3482 12.6526C20.0522 12.6526 20.6642 12.3246 21.1842 11.6686L22.9722 13.2646C22.5562 13.8086 22.0282 14.2246 21.3882 14.5126C20.7482 14.8006 20.0202 14.9446 19.2042 14.9446Z"}));function S(e){var t,r=e.tracks,n=e.onEditPress;return t=0===r.length?(0,i.tZ)("p",{className:"block-library-video-tracks-editor__tracks-informative-message"},__("Captions are .vtt files that help make your content more accesible to a wider range of users.","presto-player")):r.map((function(e,t){return(0,i.tZ)("div",{key:t,className:"block-library-video-tracks-editor__track-list-track"},(0,i.tZ)("span",null,e.label," "),(0,i.tZ)(b,{isTertiary:!0,onClick:function(){return n(t)},"aria-label":u(/* translators: %s: Label of the video text track e.g: "French subtitles" */ __("Edit %s","presto-player"),e.label)},__("Edit","presto-player")))})),(0,i.tZ)(v,{label:__("Captions","presto-player"),className:"block-library-video-tracks-editor__track-list"},t)}function E(e){var t=e.track,r=e.onChange,n=e.onClose,o=e.onRemove,a=t.src,l=void 0===a?"":a,c=t.label,u=void 0===c?"":c,p=t.srcLang,f=void 0===p?"":p,y=(t.kind,l.startsWith("blob:")?"":l.substring(l.lastIndexOf("/")+1));return(0,i.tZ)(d,null,(0,i.tZ)("div",{className:"block-library-video-tracks-editor__single-track-editor"},(0,i.tZ)("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label"},__("Edit caption track","presto-player")),(0,i.tZ)("span",null,__("File","presto-player"),": ",(0,i.tZ)("b",null,y)),(0,i.tZ)("div",{className:"block-library-video-tracks-editor__single-track-editor-label-language"},(0,i.tZ)(Z,{autoFocus:!0,onChange:function(e){return r(s(s({},t),{},{label:e}))},label:__("Label","presto-player"),value:u,help:__("Title of track","presto-player")}),(0,i.tZ)(Z,{onChange:function(e){return r(s(s({},t),{},{srcLang:e}))},label:__("Source language","presto-player"),value:f,help:__("Language tag (en, fr, etc.)","presto-player")})),(0,i.tZ)("div",{className:"block-library-video-tracks-editor__single-track-editor-buttons-container"},(0,i.tZ)(b,{isSecondary:!0,onClick:function(){var e={},o=!1;""===u&&(e.label=__("English","presto-player"),o=!0),""===f&&(e.srcLang="en",o=!0),o&&r(s(s({},t),e)),n()}},__("Close","presto-player")),(0,i.tZ)(b,{isDestructive:!0,isLink:!0,onClick:o},__("Remove track","presto-player")))))}function $(e){var t=e.tracks,r=void 0===t?[]:t,a=e.onChange,l=x((function(e){return e("core/block-editor").getSettings().mediaUpload}),[]),c=C(null),u=(0,o.Z)(c,2),p=u[0],b=u[1];return l?(0,i.tZ)(g,{contentClassName:"block-library-video-tracks-editor",renderToggle:function(e){var t=e.isOpen,r=e.onToggle;return(0,i.tZ)(h,null,(0,i.tZ)(m,{label:__("Captions","presto-player"),showTooltip:!0,"aria-expanded":t,"aria-haspopup":"true",onClick:r,icon:O}))},renderContent:function(e){return function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),null!==p?(0,i.tZ)(E,{track:r[p],onChange:function(e){var t=(0,n.Z)(r);t[p]=e,a(t)},onClose:function(){return b(null)},onRemove:function(){a(r.filter((function(e,t){return t!==p}))),b(null)}}):(0,i.tZ)(React.Fragment,null,(0,i.tZ)(d,null,(0,i.tZ)(S,{tracks:r,onEditPress:b}),(0,i.tZ)(v,{className:"block-library-video-tracks-editor__add-tracks-container",label:__("Add caption languages","presto-player")},(0,i.tZ)(_,{onSelect:function(e){var t=e.url,o=r.length;a([].concat((0,n.Z)(r),[{src:t}])),b(o)},allowedTypes:P,render:function(e){var t=e.open;return(0,i.tZ)(f,{icon:"media",onClick:t},__("Open Media Library","presto-player"))}}),(0,i.tZ)(k,null,(0,i.tZ)(y,{onChange:function(e){var t=e.target.files,i=r.length;l({allowedTypes:P,filesList:t,onFileChange:function(e){var t=(0,o.Z)(e,1)[0].url,l=(0,n.Z)(r);l[i]||(l[i]={}),l[i]=s(s({},r[i]),{},{src:t}),a(l),b(i)}})},accept:".vtt,text/vtt",render:function(e){var t=e.openFileDialog;return(0,i.tZ)(f,{icon:"upload",onClick:function(){t()}},__("Upload","presto-player"))}})))))}}):null}},7161:function(e,t,r){"use strict";r.d(t,{D9:function(){return i},VH:function(){return p},ZD:function(){return s},as:function(){return u},i1:function(){return l},nH:function(){return c}});var n=wp.element,o=n.useRef,a=n.useEffect;function i(e){var t=o();return a((function(){t.current=e})),t.current}function l(e){var t=e.status,r=void 0===t?"success":t,n=e.message;wp.data.dispatch("core/notices").createNotice(r,n,{type:"snackbar"})}function s(e){var t,r=e.split(":");return r.length>1&&(t=60*parseInt(r[0])),parseInt(r[1])+parseInt(t)}function c(e){var t=parseInt(e,10),r=Math.floor(t/60);return t<10&&(t="0"+t),r+":"+t}function u(e){var t=e;if(!(t=t.replace(/[^\d\d:\d\d.-]/g,"")).includes(":"))return"".concat(t,":00");0===t.substr(0,t.indexOf(":")).length&&(t="0".concat(t));var r=t.indexOf(":");return t.substring(0,r+3)}function p(e){if(e){if(e.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return"youtube";if(e.match(/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/))return"vimeo";if(e.indexOf("https://vz-")>-1&&e.indexOf("b-cdn.net")>-1)return"bunny";if(e.indexOf(".mp3")>-1)return"audio"}return"self-hosted"}},9493:function(e,t,r){"use strict";var n=r(4942),o=r(3324),a=r(9307),i=r(4184),l=r.n(i),s=r(5736),c=r(2819),u=r(5609),p=r(917);t.Z=function(e){var t,r=e.className,i=e.children,d=e.items,f=e.title,y=e.orientation,v=void 0===y?"horizontal":y,h=e.activeClass,m=void 0===h?"is-active":h,g=e.onSelect,b=void 0===g?c.noop:g,Z=(0,a.useState)(null),w=(0,o.Z)(Z,2),_=w[0],k=w[1],x=(0,a.useState)("left"),C=(0,o.Z)(x,2),P=(C[0],C[1]),O=function(e){k(e),b&&b(e)},S=function(e,t){t.click()},E=(0,c.find)(d,{name:_}),$="".concat(null!==(t=null==E?void 0:E.name)&&void 0!==t?t:"none");return(0,a.useEffect)((function(){P(_?"right":"left")}),[_]),(0,p.tZ)("div",{className:r},(0,p.tZ)(u.Animate,{type:"slide-in",origin:E?"right":"left"},(function(e){var t=e.className;return E?(0,p.tZ)("div",{key:$,"aria-labelledby":$,role:"itempanel",id:"".concat($,"-view"),className:l()(t,"presto-player__menu-content")},(0,p.tZ)("div",{className:"presto-player__menu-items"},(0,p.tZ)("div",{className:"presto-player__menu-item is-back-button",onClick:function(){return O("")}},(0,p.tZ)("svg",{class:"back-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img","aria-hidden":"true",focusable:"false"},(0,p.tZ)("path",{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),(0,s.__)("Back","presto-player"))),i(E)):(0,p.tZ)("div",{className:l()(t,"is-from-right")},!!f&&(0,p.tZ)("h2",null,f),(0,p.tZ)(u.NavigableMenu,{role:"itemlist",orientation:v,onNavigate:S,className:l()("presto-player__menu-items")},d.map((function(e){return(0,p.tZ)("div",{className:l()("presto-player__menu-item",e.className,(0,n.Z)({},m,e.name===_)),itemId:"".concat(e.name),"aria-controls":"".concat(e.name,"-view"),selected:e.name===_,key:e.name,onClick:(0,c.partial)(O,e.name)},!!e.icon&&(0,p.tZ)("div",{class:"presto-player__menu-icon"},e.icon),e.title,(0,p.tZ)("svg",{className:"submenu-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img",ariaHidden:"true",focusable:"false"},(0,p.tZ)("path",{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})))}))))})))}},9512:function(e,t){"use strict";var r=wp.apiFetch;r.use(r.createNonceMiddleware(prestoPlayer.nonce)),r.use(r.createRootURLMiddleware(prestoPlayer.root+prestoPlayer.prestoVersionString)),t.Z=r},6263:function(e,t,r){"use strict";function n(e){var t,r=(e||"").match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return r&&11===(null==r||null===(t=r[2])||void 0===t?void 0:t.length)?r[2]:null}function o(e){var t=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/.exec(e||"");return(null==t?void 0:t[5])||""}function a(e){var t=o(e);if(t)return{video_id:t,type:"vimeo"};var r=n(e);return r?{video_id:r,type:"youtube"}:{$video_id:0,$type:"none"}}function i(e){return"string"==typeof e&&e.includes(".m3u8")}r.d(t,{L2:function(){return o},Ln:function(){return a},dA:function(){return i},eR:function(){return l},qS:function(){return n}});var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=e.replace("#","");3===r.length&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var n=parseInt(r.substring(0,2),16),o=parseInt(r.substring(2,4),16),a=parseInt(r.substring(4,6),16);return t>1&&t<=100&&(t/=100),"rgba("+n+","+o+","+a+","+t+")"}},4184:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===a){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var l in r)n.call(r,l)&&r[l]&&e.push(l)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},9496:function(e){"use strict";function t(e){return"function"==typeof e?e():e}function r(){var e={};return e.promise=new Promise((function(t,r){e.resolve=t,e.reject=r})),e}e.exports=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=void 0,i=void 0,l=void 0,s=[];return function(){var u=t(n),p=(new Date).getTime(),d=!a||p-a>u;a=p;for(var f=arguments.length,y=Array(f),v=0;v<f;v++)y[v]=arguments[v];if(d&&o.leading)return o.accumulate?Promise.resolve(e.call(this,[y])).then((function(e){return e[0]})):Promise.resolve(e.call.apply(e,[this].concat(y)));if(i?clearTimeout(l):i=r(),s.push(y),l=setTimeout(c.bind(this),u),o.accumulate){var h=s.length-1;return i.promise.then((function(e){return e[h]}))}return i.promise};function c(){var t=i;clearTimeout(l),Promise.resolve(o.accumulate?e.call(this,s):e.apply(this,s[s.length-1])).then(t.resolve,t.reject),s=[],i=null}}},8679:function(e,t,r){"use strict";var n=r(9864),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return n.isMemo(e)?i:l[e.$$typeof]||o}l[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[n.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,y=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(y){var o=f(r);o&&o!==y&&e(t,o,n)}var i=u(r);p&&(i=i.concat(p(r)));for(var l=s(t),v=s(r),h=0;h<i.length;++h){var m=i[h];if(!(a[m]||n&&n[m]||v&&v[m]||l&&l[m])){var g=d(r,m);try{c(t,m,g)}catch(e){}}}}return t}},7418:function(e){"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var i,l,s=o(e),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))r.call(i,u)&&(s[u]=i[u]);if(t){l=t(i);for(var p=0;p<l.length;p++)n.call(i,l[p])&&(s[l[p]]=i[l[p]])}}return s}},9921:function(e,t){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,i=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,y=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,Z=r?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case p:case a:case l:case i:case f:return e;default:switch(e=e&&e.$$typeof){case c:case d:case h:case v:case s:return e;default:return t}}case o:return t}}}function _(e){return w(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=c,t.ContextProvider=s,t.Element=n,t.ForwardRef=d,t.Fragment=a,t.Lazy=h,t.Memo=v,t.Portal=o,t.Profiler=l,t.StrictMode=i,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||w(e)===u},t.isConcurrentMode=_,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===a},t.isLazy=function(e){return w(e)===h},t.isMemo=function(e){return w(e)===v},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===i},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===p||e===l||e===i||e===f||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===v||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===b||e.$$typeof===Z||e.$$typeof===m)},t.typeOf=w},9864:function(e,t,r){"use strict";e.exports=r(9921)},5251:function(e,t,r){"use strict";r(7418);var n=r(9196),o=60103;if("function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),a("react.fragment")}var i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var n,a={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,n)&&!s.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:i.current}}},5893:function(e,t,r){"use strict";e.exports=r(5251)},6376:function(e,t,r){const n=r(4225),{MAX_LENGTH:o,MAX_SAFE_INTEGER:a}=r(3295),{re:i,t:l}=r(5765),s=r(2893),{compareIdentifiers:c}=r(6742);class u{constructor(e,t){if(t=s(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>o)throw new TypeError(`version is longer than ${o} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?i[l.LOOSE]:i[l.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<a)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],o=e.prerelease[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return c(r,o)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],o=e.build[t];if(n("prerelease compare",t,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return c(r,o)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}}e.exports=u},6269:function(e,t,r){const n=r(6376);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},3295:function(e){const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:t,MAX_SAFE_COMPONENT_LENGTH:16}},4225:function(e){const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},6742:function(e){const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),o=t.test(r);return n&&o&&(e=+e,r=+r),e===r?0:n&&!o?-1:o&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2893:function(e){const t=["includePrerelease","loose","rtl"];e.exports=e=>e?"object"!=typeof e?{loose:!0}:t.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{}},5765:function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n}=r(3295),o=r(4225),a=(t=e.exports={}).re=[],i=t.src=[],l=t.t={};let s=0;const c=(e,t,r)=>{const n=s++;o(e,n,t),l[e]=n,i[n]=t,a[n]=new RegExp(t,r?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${i[l.NUMERICIDENTIFIER]})\\.(${i[l.NUMERICIDENTIFIER]})\\.(${i[l.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${i[l.NUMERICIDENTIFIERLOOSE]})\\.(${i[l.NUMERICIDENTIFIERLOOSE]})\\.(${i[l.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${i[l.NUMERICIDENTIFIER]}|${i[l.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${i[l.NUMERICIDENTIFIERLOOSE]}|${i[l.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${i[l.PRERELEASEIDENTIFIER]}(?:\\.${i[l.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${i[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[l.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${i[l.BUILDIDENTIFIER]}(?:\\.${i[l.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${i[l.MAINVERSION]}${i[l.PRERELEASE]}?${i[l.BUILD]}?`),c("FULL",`^${i[l.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${i[l.MAINVERSIONLOOSE]}${i[l.PRERELEASELOOSE]}?${i[l.BUILD]}?`),c("LOOSE",`^${i[l.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${i[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${i[l.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${i[l.XRANGEIDENTIFIER]})(?:\\.(${i[l.XRANGEIDENTIFIER]})(?:\\.(${i[l.XRANGEIDENTIFIER]})(?:${i[l.PRERELEASE]})?${i[l.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${i[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[l.XRANGEIDENTIFIERLOOSE]})(?:${i[l.PRERELEASELOOSE]})?${i[l.BUILD]}?)?)?`),c("XRANGE",`^${i[l.GTLT]}\\s*${i[l.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${i[l.GTLT]}\\s*${i[l.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),c("COERCERTL",i[l.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${i[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${i[l.LONETILDE]}${i[l.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${i[l.LONETILDE]}${i[l.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${i[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${i[l.LONECARET]}${i[l.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${i[l.LONECARET]}${i[l.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${i[l.GTLT]}\\s*(${i[l.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${i[l.GTLT]}\\s*(${i[l.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${i[l.GTLT]}\\s*(${i[l.LOOSEPLAIN]}|${i[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${i[l.XRANGEPLAIN]})\\s+-\\s+(${i[l.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${i[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[l.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7202:function(e,t,r){var n={"./presto-action-bar-ui_2.entry.js":[578,982],"./presto-action-bar_17.entry.js":[2626,982],"./presto-cta-overlay-ui.entry.js":[3285,982],"./presto-email-overlay-ui_2.entry.js":[1871,982],"./presto-player-button.entry.js":[5657,982],"./presto-player-skeleton.entry.js":[4992,982],"./presto-player_4.entry.js":[2361,982],"./presto-playlist.entry.js":[1928,982],"./presto-search-bar-ui.entry.js":[9458,982],"./presto-timestamp.entry.js":[4317,982],"./presto-video-curtain-ui.entry.js":[5704,982],"./presto-video.entry.js":[4178,982]};function o(e){if(!r.o(n,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],o=t[0];return r.e(t[1]).then((function(){return r(o)}))}o.keys=function(){return Object.keys(n)},o.id=7202,e.exports=o},6652:function(e,t,r){var n={"./audio/index.js":6496,"./bunny/index.js":6849,"./hosted/index.js":8024,"./media-hub/index.js":2356,"./playlist-list-item/index.js":6055,"./playlist-list/index.js":9989,"./playlist-preview/index.js":503,"./playlist/index.js":277,"./reusable-display/index.js":7057,"./reusable-edit/index.js":2692,"./vimeo/index.js":4048,"./youtube/index.js":2132};function o(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}o.keys=function(){return Object.keys(n)},o.resolve=a,e.exports=o,o.id=6652},14:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=14,e.exports=t},9196:function(e){"use strict";e.exports=window.React},2819:function(e){"use strict";e.exports=window.lodash},1284:function(e){"use strict";e.exports=window.regeneratorRuntime},6989:function(e){"use strict";e.exports=window.wp.apiFetch},2175:function(e){"use strict";e.exports=window.wp.blockEditor},4981:function(e){"use strict";e.exports=window.wp.blocks},5609:function(e){"use strict";e.exports=window.wp.components},4333:function(e){"use strict";e.exports=window.wp.compose},7798:function(e){"use strict";e.exports=window.wp.coreData},9818:function(e){"use strict";e.exports=window.wp.data},9307:function(e){"use strict";e.exports=window.wp.element},5736:function(e){"use strict";e.exports=window.wp.i18n},3961:function(e){"use strict";e.exports=window.wp.notices},444:function(e){"use strict";e.exports=window.wp.primitives},907:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,{Z:function(){return n}})},3878:function(e,t,r){"use strict";function n(e){if(Array.isArray(e))return e}r.d(t,{Z:function(){return n}})},7326:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},5861:function(e,t,r){"use strict";function n(e,t,r,n,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function l(e){n(i,o,a,l,s,"next",e)}function s(e){n(i,o,a,l,s,"throw",e)}l(void 0)}))}}r.d(t,{Z:function(){return o}})},5671:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{Z:function(){return n}})},3144:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(7343);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(0,n.Z)(o.key),o)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}},4942:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(7343);function o(e,t,r){return(t=(0,n.Z)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},7462:function(e,t,r){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}r.d(t,{Z:function(){return n}})},1120:function(e,t,r){"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:function(){return n}})},136:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(9611);function o(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,n.Z)(e,t)}},4578:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(9611);function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,n.Z)(e,t)}},1902:function(e,t,r){"use strict";function n(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,_x,a,i=[],_n=!0,l=!1;try{if(_x=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;_n=!1}else for(;!(_n=(n=_x.call(r)).done)&&(i.push(n.value),i.length!==t);_n=!0);}catch(e){l=!0,o=e}finally{try{if(!_n&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return i}}r.d(t,{Z:function(){return n}})},5267:function(e,t,r){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(t,{Z:function(){return n}})},4925:function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}r.d(t,{Z:function(){return n}})},2963:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1002),o=r(7326);function a(e,t){if(t&&("object"===(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}},9611:function(e,t,r){"use strict";function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}r.d(t,{Z:function(){return n}})},3324:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(3878),o=r(1902),a=r(181),i=r(5267);function l(e,t){return(0,n.Z)(e)||(0,o.Z)(e,t)||(0,a.Z)(e,t)||(0,i.Z)()}},168:function(e,t,r){"use strict";function n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}r.d(t,{Z:function(){return n}})},2982:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(907),o=r(181);function a(e){return function(e){if(Array.isArray(e))return(0,n.Z)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,o.Z)(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.")}()}},5512:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1002);function o(e,t){if("object"!==(0,n.Z)(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==(0,n.Z)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},7343:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1002),o=r(5512);function a(e){var t=(0,o.Z)(e,"string");return"symbol"===(0,n.Z)(t)?t:String(t)}},1002:function(e,t,r){"use strict";function n(e){return n="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},n(e)}r.d(t,{Z:function(){return n}})},181:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(907);function o(e,t){if(e){if("string"==typeof e)return(0,n.Z)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,n.Z)(e,t):void 0}}},2407:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(1120),o=r(9611);function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function i(e,t,r){return i=a()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&(0,o.Z)(a,r.prototype),a},i.apply(null,arguments)}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;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,a)}function a(){return i(e,arguments,(0,n.Z)(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),(0,o.Z)(a,e)},l(e)}},7563:function(e,t,r){"use strict";r.d(t,{Ab:function(){return i},Fr:function(){return l},G$:function(){return a},K$:function(){return c},MS:function(){return n},h5:function(){return s},lK:function(){return u},uj:function(){return o}});var n="-ms-",o="-moz-",a="-webkit-",i="comm",l="rule",s="decl",c="@import",u="@keyframes"},8160:function(e,t,r){"use strict";r.d(t,{cD:function(){return a},qR:function(){return o}});var n=r(6686);function o(e){var t=(0,n.Ei)(e);return function(r,n,o,a){for(var i="",l=0;l<t;l++)i+=e[l](r,n,o,a)||"";return i}}function a(e){return function(t){t.root||(t=t.return)&&e(t)}}},2190:function(e,t,r){"use strict";r.d(t,{MY:function(){return i}});var n=r(7563),o=r(6686),a=r(6411);function i(e){return(0,a.cE)(l("",null,null,null,[""],e=(0,a.un)(e),0,[0],e))}function l(e,t,r,n,i,p,d,f,y){for(var v=0,h=0,m=d,g=0,b=0,Z=0,w=1,_=1,k=1,x=0,C="",P=i,O=p,S=n,E=C;_;)switch(Z=x,x=(0,a.lp)()){case 40:if(108!=Z&&58==(0,o.uO)(E,m-1)){-1!=(0,o.Cw)(E+=(0,o.gx)((0,a.iF)(x),"&","&\f"),"&\f")&&(k=-1);break}case 34:case 39:case 91:E+=(0,a.iF)(x);break;case 9:case 10:case 13:case 32:E+=(0,a.Qb)(Z);break;case 92:E+=(0,a.kq)((0,a.Ud)()-1,7);continue;case 47:switch((0,a.fj)()){case 42:case 47:(0,o.R3)(c((0,a.q6)((0,a.lp)(),(0,a.Ud)()),t,r),y);break;default:E+="/"}break;case 123*w:f[v++]=(0,o.to)(E)*k;case 125*w:case 59:case 0:switch(x){case 0:case 125:_=0;case 59+h:b>0&&(0,o.to)(E)-m&&(0,o.R3)(b>32?u(E+";",n,r,m-1):u((0,o.gx)(E," ","")+";",n,r,m-2),y);break;case 59:E+=";";default:if((0,o.R3)(S=s(E,t,r,v,h,i,f,C,P=[],O=[],m),p),123===x)if(0===h)l(E,t,S,S,P,p,m,f,O);else switch(99===g&&110===(0,o.uO)(E,3)?100:g){case 100:case 109:case 115:l(e,S,S,n&&(0,o.R3)(s(e,S,S,0,0,i,f,C,i,P=[],m),O),i,O,m,f,n?P:O);break;default:l(E,S,S,S,[""],O,0,f,O)}}v=h=b=0,w=k=1,C=E="",m=d;break;case 58:m=1+(0,o.to)(E),b=Z;default:if(w<1)if(123==x)--w;else if(125==x&&0==w++&&125==(0,a.mp)())continue;switch(E+=(0,o.Dp)(x),x*w){case 38:k=h>0?1:(E+="\f",-1);break;case 44:f[v++]=((0,o.to)(E)-1)*k,k=1;break;case 64:45===(0,a.fj)()&&(E+=(0,a.iF)((0,a.lp)())),g=(0,a.fj)(),h=m=(0,o.to)(C=E+=(0,a.QU)((0,a.Ud)())),x++;break;case 45:45===Z&&2==(0,o.to)(E)&&(w=0)}}return p}function s(e,t,r,i,l,s,c,u,p,d,f){for(var y=l-1,v=0===l?s:[""],h=(0,o.Ei)(v),m=0,g=0,b=0;m<i;++m)for(var Z=0,w=(0,o.tb)(e,y+1,y=(0,o.Wn)(g=c[m])),_=e;Z<h;++Z)(_=(0,o.fy)(g>0?v[Z]+" "+w:(0,o.gx)(w,/&\f/g,v[Z])))&&(p[b++]=_);return(0,a.dH)(e,t,r,0===l?n.Fr:u,p,d,f)}function c(e,t,r){return(0,a.dH)(e,t,r,n.Ab,(0,o.Dp)((0,a.Tb)()),(0,o.tb)(e,2,-2),0)}function u(e,t,r,i){return(0,a.dH)(e,t,r,n.h5,(0,o.tb)(e,0,i),(0,o.tb)(e,i+1,-1),i)}},211:function(e,t,r){"use strict";r.d(t,{P:function(){return i},q:function(){return a}});var n=r(7563),o=r(6686);function a(e,t){for(var r="",n=(0,o.Ei)(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function i(e,t,r,i){switch(e.type){case n.K$:case n.h5:return e.return=e.return||e.value;case n.Ab:return"";case n.lK:return e.return=e.value+"{"+a(e.children,i)+"}";case n.Fr:e.value=e.props.join(",")}return(0,o.to)(r=a(e.children,i))?e.return=e.value+"{"+r+"}":""}},6411:function(e,t,r){"use strict";r.d(t,{FK:function(){return l},JG:function(){return p},QU:function(){return P},Qb:function(){return _},Tb:function(){return d},Ud:function(){return h},cE:function(){return Z},dH:function(){return u},fj:function(){return v},iF:function(){return w},kq:function(){return k},lp:function(){return y},mp:function(){return f},q6:function(){return C},r:function(){return g},tP:function(){return m},un:function(){return b}});var n=r(6686),o=1,a=1,i=0,l=0,s=0,c="";function u(e,t,r,n,i,l,s){return{value:e,root:t,parent:r,type:n,props:i,children:l,line:o,column:a,length:s,return:""}}function p(e,t){return(0,n.f0)(u("",null,null,"",null,null,0),e,{length:-e.length},t)}function d(){return s}function f(){return s=l>0?(0,n.uO)(c,--l):0,a--,10===s&&(a=1,o--),s}function y(){return s=l<i?(0,n.uO)(c,l++):0,a++,10===s&&(a=1,o++),s}function v(){return(0,n.uO)(c,l)}function h(){return l}function m(e,t){return(0,n.tb)(c,e,t)}function g(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function b(e){return o=a=1,i=(0,n.to)(c=e),l=0,[]}function Z(e){return c="",e}function w(e){return(0,n.fy)(m(l-1,x(91===e?e+2:40===e?e+1:e)))}function _(e){for(;(s=v())&&s<33;)y();return g(e)>2||g(s)>3?"":" "}function k(e,t){for(;--t&&y()&&!(s<48||s>102||s>57&&s<65||s>70&&s<97););return m(e,h()+(t<6&&32==v()&&32==y()))}function x(e){for(;y();)switch(s){case e:return l;case 34:case 39:34!==e&&39!==e&&x(s);break;case 40:41===e&&x(e);break;case 92:y()}return l}function C(e,t){for(;y()&&e+s!==57&&(e+s!==84||47!==v()););return"/*"+m(t,l-1)+"*"+(0,n.Dp)(47===e?e:y())}function P(e){for(;!g(v());)y();return m(e,l)}},6686:function(e,t,r){"use strict";r.d(t,{$e:function(){return h},Cw:function(){return u},Dp:function(){return o},EQ:function(){return s},Ei:function(){return y},R3:function(){return v},Wn:function(){return n},f0:function(){return a},fy:function(){return l},gx:function(){return c},tb:function(){return d},to:function(){return f},uO:function(){return p},vp:function(){return i}});var n=Math.abs,o=String.fromCharCode,a=Object.assign;function i(e,t){return 45^p(e,0)?(((t<<2^p(e,0))<<2^p(e,1))<<2^p(e,2))<<2^p(e,3):0}function l(e){return e.trim()}function s(e,t){return(e=t.exec(e))?e[0]:e}function c(e,t,r){return e.replace(t,r)}function u(e,t){return e.indexOf(t)}function p(e,t){return 0|e.charCodeAt(t)}function d(e,t,r){return e.slice(t,r)}function f(e){return e.length}function y(e){return e.length}function v(e,t){return t.push(e),e}function h(e,t){return e.map(t).join("")}}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.m=r,o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce((function(t,r){return o.f[r](e,t),t}),[]))},o.u=function(e){return e+".js"},o.miniCssF=function(e){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="@presto-player/presto-player:",o.l=function(r,n,a,i){if(e[r])e[r].push(n);else{var l,s;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var p=c[u];if(p.getAttribute("src")==r||p.getAttribute("data-webpack")==t+a){l=p;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,o.nc&&l.setAttribute("nonce",o.nc),l.setAttribute("data-webpack",t+a),l.src=r),e[r]=[n];var d=function(t,n){l.onerror=l.onload=null,clearTimeout(f);var o=e[r];if(delete e[r],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((function(e){return e(n)})),t)return t(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),s&&document.head.appendChild(l)}},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.j=346,function(){var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e}(),function(){var e={346:0};o.f.j=function(t,r){var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var a=new Promise((function(r,o){n=e[t]=[r,o]}));r.push(n[2]=a);var i=o.p+o.u(t),l=new Error;o.l(i,(function(r){if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var a=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,n[1](l)}}),"chunk-"+t,t)}};var t=function(t,r){var n,a,i=r[0],l=r[1],s=r[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);s&&s(o)}for(t&&t(r);c<i.length;c++)a=i[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=self.webpackChunk_presto_player_presto_player=self.webpackChunk_presto_player_presto_player||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),function(){"use strict";var e={};o.r(e),o.d(e,{branding:function(){return w},getAudioPresets:function(){return y},getDefaultAudioPreset:function(){return b},getDefaultPreset:function(){return g},getPreset:function(){return v},getPresets:function(){return f},getReusableVideo:function(){return m},getReusableVideos:function(){return h},playerCSS:function(){return _},presetsLoading:function(){return Z},proModal:function(){return x},youtube:function(){return k}});var t={};o.r(t),o.d(t,{addAudioPreset:function(){return B},addPreset:function(){return j},addVideo:function(){return T},appendVideos:function(){return N},fetchFromAPI:function(){return G},fetchFromWPAPI:function(){return H},fetchOptions:function(){return z},removeAudioPreset:function(){return M},removePreset:function(){return I},saveOptions:function(){return U},setAudioPresets:function(){return L},setBranding:function(){return F},setPresetAudioSettings:function(){return X},setPresetLoading:function(){return P},setPresetSettings:function(){return Y},setPresets:function(){return A},setProModal:function(){return S},setVideos:function(){return E},setVideosLoading:function(){return O},setYoutube:function(){return W},updateAudioPreset:function(){return D},updateBranding:function(){return V},updatePreset:function(){return R},updateVideos:function(){return $},updateYoutube:function(){return q}}),o(9307);var r=o(4942),n=o(2982),a=o(9818),i=o(6989),l=o.n(i),s=o(2819);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=function(e,t){return e.find((function(e){return e.id===t.id}))?e:[].concat((0,n.Z)(e),[t])},d=(0,a.combineReducers)({presetReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRESET":return t.value;case"ADD_PRESET":return[].concat((0,n.Z)(e),[t.value]);case"UPDATE_PRESET":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:u(u({},e),t.value)}));case"REMOVE_PRESET":return e.filter((function(e){return e!==t.value}))}return e},audioPresetReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_AUDIO_PRESET":case"SET_AUDIO_PRESET":return t.value;case"ADD_AUDIO_PRESET":return[].concat((0,n.Z)(e),[t.value]);case"UPDATE_AUDIO_PRESET":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:u(u({},e),t.value)}));case"REMOVE_AUDIO_PRESET":return e.filter((function(e){return e!==t.value}))}return e},presetLoadingReducer:function(){var e=arguments.length>1?arguments[1]:void 0;if("SET_PRESET_LOADING"===e.type)return e.value},videosLoadingReducer:function(){var e=arguments.length>1?arguments[1]:void 0;if("SET_VIDEOS_LOADING"===e.type)return e.value},videosReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{total:0,total_pages:0,videos:[],hasResolved:!1,isError:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_VIDEOS":return t.value;case"UPDATE_VIDEOS":return u(u({},e),t.value);case"APPEND_VIDEOS":var r=e;return(t.value||[]).forEach((function(e){r.videos=p(r.videos,e)})),r;case"ADD_VIDEO":return u(u({},e),{},{videos:p(e.videos,t.value)});case"UPDATE_VIDEO":return u(u({},e),{},{videos:e.videos.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:u(u({},e),t.value)}))});case"REMOVE_VIDEO":return u(u({},e),{},{videos:e.videos.filter((function(e){return e!==t.value}))})}return e},proModalReducer:function(){var e=arguments.length>1?arguments[1]:void 0;if("SET_PRO_MODAL"===e.type)return e.value},brandingReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_BRANDING":return t.value;case"UPDATE_BRANDING":return u(u({},e),{},(0,r.Z)({},t.name,t.value))}return e},youtubeReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_YOUTUBE":return t.value;case"UPDATE_YOUTUBE":return u(u({},e),{},(0,r.Z)({},t.name,t.value))}return e},presetSettingsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_PRESET_SETTINGS"===t.type?t.value:e},optionsApi:function(e,t){switch(t.type){case"FETCH_OPTIONS":return l()({path:"/presto-player/v1/settings/"}).then((function(e){(0,a.dispatch)("presto-player/player").setBranding(e.presto_player_branding),(0,a.dispatch)("presto-player/player").setYoutube(e.presto_player_youtube),(0,a.dispatch)("presto-player/player").setPresetSettings(e.presto_player_presets),(0,a.dispatch)("presto-player/player").setPresetAudioSettings(e.presto_player_audio_presets)}));case"SAVE_OPTIONS":var r={presto_player_branding:(0,s.pick)(null==t?void 0:t.branding,["logo","color","logo_width","player_css"])};return Object.keys(r).forEach((function(e){return(null==r[e]||!Object.keys((null==r?void 0:r[e])||{}).length)&&delete r[e]})),l()({path:"/presto-player/v1/settings",method:"POST",data:r}),r}},audioPresetSettingsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_PRESET_AUDIO_SETTINGS"===t.type?t.value:e}});function f(e){return(null==e?void 0:e.presetReducer)||[]}function y(e){return(null==e?void 0:e.audioPresetReducer)||[]}function v(e,t){var r;return null!=e&&null!==(r=e.presetReducer)&&void 0!==r&&r.length?null==e?void 0:e.presetReducer.find((function(e){return e.id===t})):[]}function h(e){return(null==e?void 0:e.videosReducer)||[]}function m(e,t){var r,n;return(null==e||null===(r=e.videosReducer)||void 0===r||null===(n=r.videos)||void 0===n?void 0:n.find((function(e){return(null==e?void 0:e.id)===t})))||[]}function g(e){var t,r=null==e||null===(t=e.presetSettingsReducer)||void 0===t?void 0:t.default_player_preset,n=r&&((null==e?void 0:e.presetReducer)||[]).find((function(e){return e.id&&e.id===r}));return n||(n=((null==e?void 0:e.presetReducer)||[]).find((function(e){return"default"==e.slug}))),n||(n=((null==e?void 0:e.presetReducer)||[])[0]),n}function b(e){var t,r=null==e||null===(t=e.audioPresetSettingsReducer)||void 0===t?void 0:t.default_player_preset,n=r&&((null==e?void 0:e.audioPresetReducer)||[]).find((function(e){return e.id&&e.id===r}));return n||(n=((null==e?void 0:e.audioPresetReducer)||[]).find((function(e){return"default"==e.slug}))),n||(n=((null==e?void 0:e.audioPresetReducer)||[])[0]),n}function Z(e){return!(null==e||!e.presetLoadingReducer)}function w(e){return null==e?void 0:e.brandingReducer}function _(e){var t;return null==e||null===(t=e.brandingReducer)||void 0===t?void 0:t.player_css}function k(e){return null==e?void 0:e.youtubeReducer}function x(e){return null==e?void 0:e.proModalReducer}function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){return{type:"SET_PRESET_LOADING",value:e}}function O(e){return{type:"SET_VIDEOS_LOADING",value:e}}function S(e){return{type:"SET_PRO_MODAL",value:e}}function E(e){return{type:"SET_VIDEOS",value:e}}function $(e){return{type:"UPDATE_VIDEOS",value:e}}function N(e){return{type:"APPEND_VIDEOS",value:e}}function T(e){return{type:"ADD_VIDEO",value:e}}function A(e){return{type:"SET_PRESET",value:e}}function j(e){return{type:"ADD_PRESET",value:e}}function R(e){return{type:"UPDATE_PRESET",value:e}}function I(e){return{type:"REMOVE_PRESET",value:e}}function L(e){return{type:"SET_AUDIO_PRESET",value:e}}function B(e){return{type:"ADD_AUDIO_PRESET",value:e}}function D(e){return{type:"UPDATE_AUDIO_PRESET",value:e}}function M(e){return{type:"REMOVE_AUDIO_PRESET",value:e}}function F(e){return{type:"SET_BRANDING",value:e}}function V(e,t){return{type:"UPDATE_BRANDING",name:e,value:t}}function U(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({type:"SAVE_OPTIONS"},e)}function z(){return{type:"FETCH_OPTIONS"}}function G(e){return{type:"FETCH_FROM_API",path:e}}function H(e,t){return{type:"FETCH_FROM_WP_API",path:e,args:t}}function W(e){return{type:"SET_YOUTUBE",value:e}}function q(e,t){return{type:"UPDATE_YOUTUBE",name:e,value:t}}function Y(e){return{type:"SET_PRESET_SETTINGS",value:e}}function X(e){return{type:"SET_PRESET_AUDIO_SETTINGS",value:e}}var K=o(5861),Q=o(1284),J=o.n(Q);function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var re=wp.apiFetch,ne={FETCH_FROM_API:function(e){return re({url:prestoPlayer.root+prestoPlayer.prestoVersionString+e.path})},FETCH_FROM_WP_API:function(e){return(0,K.Z)(J().mark((function t(){var r,n,o,a,i,l,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.args,n=e.path,o=void 0===n?"":n,t.next=3,re(te(te(te({path:wp.url.addQueryArgs("wp/v2/".concat(o),null==r?void 0:r.query)},null!=r&&r.data?{data:r.data}:{}),null==r?void 0:r.options),{},{parse:!1}));case 3:return a=t.sent,t.next=6,a.json();case 6:return i=t.sent,l=a.headers&&a.headers.get("X-WP-Total"),s=a.headers&&a.headers.get("X-WP-TotalPages"),t.abrupt("return",new Promise((function(e,t){e({data:i,total:l,total_pages:s})})));case 10:case"end":return t.stop()}}),t)})))()}},oe={getPresets:J().mark((function e(){var t;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G("preset");case 2:return t=e.sent,e.abrupt("return",A(t));case 4:case"end":return e.stop()}}),e)})),getAudioPresets:J().mark((function e(){var t;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,G("audio-preset");case 2:return t=e.sent,e.abrupt("return",L(t));case 4:case"end":return e.stop()}}),e)})),getReusableVideo:J().mark((function e(t){var r,n;return J().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="presto-videos/".concat(t),e.next=3,H(r,{});case 3:return n=e.sent,e.abrupt("return",T((null==n?void 0:n.data)||{}));case 5:case"end":return e.stop()}}),e)}))},ae=(0,wp.data.registerStore)("presto-player/player",{reducer:d,selectors:e,actions:t,controls:ne,resolvers:oe}),ie=o(9807),le=o(917),se=wp.components,ce=se.Modal,ue=se.Button,pe=wp.data,de=pe.dispatch,fe=pe.useSelect,ye=wp.blocks,ve=ye.registerBlockType,he=ye.unregisterBlockType,me=wp.plugins,ge=me.registerPlugin,be=me.unregisterPlugin,Ze=wp.data,we=Ze.select,_e=Ze.dispatch,ke=wp.element.render,xe=function(){return null},Ce=function(e){var t=e.getContext,r=e.register,n=e.unregister,o=e.before,a=void 0===o?xe:o,i=e.after,l=void 0===i?xe:i,s={};!function(){a();var e=t(),o=[];e.keys().forEach((function(t){var a=e(t);a!==s[t]&&(s[t]&&n(s[t]),r(a),o.push(a.name),s[t]=a)})),l(o)}()},Pe=null;Ce({getContext:function(){return o(6652)},register:function(e){var t,r=e.name,n=e.options;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?ve(r,n):n.premium||ve(r,n)},unregister:function(e){var t=e.name;return he(t)},before:function(){Pe=we("core/editor").getSelectedBlockClientId(),_e("core/editor").clearSelectedBlock()},after:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];we("core/editor").getBlocks().forEach((function(t){var r=t.name,n=t.clientId;e.includes(r)&&_e("core/editor").selectBlock(n)})),Pe?_e("core/editor").selectBlock(Pe):_e("core/editor").clearSelectedBlock(),Pe=null}}),Ce({getContext:function(){return o(14)},register:function(e){var t=e.name,r=e.options;return ge(t,r)},unregister:function(e){var t=e.name;return be(t)}}),jQuery("body").append('<div id="presto-plugin-app"></div>'),ke((0,le.tZ)((function(){return fe((function(e){return e("presto-player/player").proModal()}))?(0,le.tZ)(ce,{title:"Pro Feature",onRequestClose:function(){de("presto-player/player").setProModal(!1)}},(0,le.tZ)("h2",null,"Unlock Presto Player ",(0,le.tZ)(ie.Z,null)),(0,le.tZ)("p",null,"Get this feature and more with the Pro version of Presto Player!"),(0,le.tZ)(ue,{href:"https://prestoplayer.com",target:"_blank",isPrimary:!0},"Learn More")):""}),null),document.getElementById("presto-plugin-app")),_e("presto-player/player").fetchOptions();var Oe=!1;wp.data.subscribe((function(){var e=wp.data.select("core/editor").isSavingPost(),t=wp.data.select("core/editor").isAutosavingPost(),r=wp.data.select("core/editor").getEditorSettings();if(null!=r&&r.onNavigateToPreviousEntityRecord&&"pp_video_block"===wp.data.select("core/editor").getCurrentPostType()?document.body.classList.add("is-editing-pp-video-block"):document.body.classList.remove("is-editing-pp-video-block"),e&&!t){if(Oe)return;Oe=!0;var n=ae.getState().brandingReducer;_e("presto-player/player").saveOptions({branding:n}).then((function(){Oe=!1}))}}))}()}();