@playkit-js/playkit-js-providers 2.40.1 → 2.40.2-canary.0-45b4098

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/index.d.ts +1624 -0
  2. package/dist/playkit-analytics-service.js +1 -1
  3. package/dist/playkit-analytics-service.js.map +1 -1
  4. package/dist/playkit-bookmark-service.js +1 -1
  5. package/dist/playkit-bookmark-service.js.map +1 -1
  6. package/dist/playkit-ott-provider.js +1 -1
  7. package/dist/playkit-ott-provider.js.map +1 -1
  8. package/dist/playkit-ovp-provider.js +2 -1
  9. package/dist/playkit-ovp-provider.js.LICENSE.txt +1 -0
  10. package/dist/playkit-ovp-provider.js.map +1 -1
  11. package/dist/playkit-stats-service.js +1 -1
  12. package/dist/playkit-stats-service.js.map +1 -1
  13. package/dist/tsdoc-metadata.json +11 -0
  14. package/flow-typed/types/media-config-sources.js +1 -1
  15. package/flow-typed/types/media-sources.js +1 -1
  16. package/package.json +49 -46
  17. package/playkit-analytics-service/package.json +5 -0
  18. package/playkit-bookmark-service/package.json +5 -0
  19. package/playkit-ott-provider/package.json +5 -0
  20. package/playkit-ovp-provider/package.json +5 -0
  21. package/playkit-stats-service/package.json +5 -0
  22. package/src/entities/bumper.ts +21 -0
  23. package/src/entities/drm.ts +47 -0
  24. package/src/entities/entry-list.ts +13 -0
  25. package/src/entities/image-source.ts +36 -0
  26. package/src/entities/media-entry.ts +104 -0
  27. package/src/entities/media-format.ts +47 -0
  28. package/src/entities/media-source.ts +70 -0
  29. package/src/entities/media-sources.ts +79 -0
  30. package/src/entities/playlist.ts +41 -0
  31. package/src/k-provider/common/base-provider-parser.ts +0 -0
  32. package/src/k-provider/common/base-provider.ts +112 -0
  33. package/src/k-provider/common/base-service-result.ts +56 -0
  34. package/src/k-provider/common/data-loader-manager.ts +115 -0
  35. package/src/k-provider/common/multi-request-builder.ts +111 -0
  36. package/src/k-provider/common/response-types/kaltura-access-control-message.ts +21 -0
  37. package/src/k-provider/common/response-types/kaltura-drm-playback-plugin-data.ts +38 -0
  38. package/src/k-provider/ott/config.ts +22 -0
  39. package/src/k-provider/ott/index.ts +14 -0
  40. package/src/k-provider/ott/loaders/asset-list-loader.ts +68 -0
  41. package/src/k-provider/ott/loaders/asset-loader.ts +69 -0
  42. package/src/k-provider/ott/loaders/data-loader-manager.ts +15 -0
  43. package/src/k-provider/ott/loaders/session-loader.ts +62 -0
  44. package/src/k-provider/ott/provider-parser.ts +285 -0
  45. package/src/k-provider/ott/provider.ts +252 -0
  46. package/src/k-provider/ott/response-types/kaltura-asset.ts +105 -0
  47. package/src/k-provider/ott/response-types/kaltura-bumper-playback-plugin-data.ts +27 -0
  48. package/src/k-provider/ott/response-types/kaltura-playback-context.ts +73 -0
  49. package/src/k-provider/ott/response-types/kaltura-playback-source.ts +62 -0
  50. package/src/k-provider/ott/response-types/kaltura-rule-action.ts +25 -0
  51. package/src/k-provider/ott/services/asset-service.ts +50 -0
  52. package/src/k-provider/ott/services/bookmark/bookmark-service.ts +48 -0
  53. package/src/k-provider/ott/services/bookmark/index.ts +11 -0
  54. package/src/k-provider/ott/services/ott-service.ts +33 -0
  55. package/src/k-provider/ott/services/user-service.ts +31 -0
  56. package/src/k-provider/ovp/config.ts +28 -0
  57. package/src/k-provider/ovp/external-captions-builder.ts +37 -0
  58. package/src/k-provider/ovp/index.ts +13 -0
  59. package/src/k-provider/ovp/loaders/data-loader-manager.ts +17 -0
  60. package/src/k-provider/ovp/loaders/entry-list-loader.ts +69 -0
  61. package/src/k-provider/ovp/loaders/media-entry-loader.ts +84 -0
  62. package/src/k-provider/ovp/loaders/playlist-loader.ts +69 -0
  63. package/src/k-provider/ovp/loaders/session-loader.ts +62 -0
  64. package/src/k-provider/ovp/loaders/ui-config-loader.ts +71 -0
  65. package/src/k-provider/ovp/play-source-url-builder.ts +59 -0
  66. package/src/k-provider/ovp/provider-parser.ts +461 -0
  67. package/src/k-provider/ovp/provider.ts +358 -0
  68. package/src/k-provider/ovp/regex-action-handler.ts +149 -0
  69. package/src/k-provider/ovp/request-params/base-entry-response-profile.ts +28 -0
  70. package/src/k-provider/ovp/response-types/index.ts +21 -0
  71. package/src/k-provider/ovp/response-types/kaltura-access-control-modify-request-host-regex-action.ts +35 -0
  72. package/src/k-provider/ovp/response-types/kaltura-base-entry-list-response.ts +30 -0
  73. package/src/k-provider/ovp/response-types/kaltura-bumper.ts +25 -0
  74. package/src/k-provider/ovp/response-types/kaltura-flavor-asset.ts +108 -0
  75. package/src/k-provider/ovp/response-types/kaltura-media-entries.ts +28 -0
  76. package/src/k-provider/ovp/response-types/kaltura-media-entry.ts +189 -0
  77. package/src/k-provider/ovp/response-types/kaltura-metadata-list-response.ts +22 -0
  78. package/src/k-provider/ovp/response-types/kaltura-metadata.ts +50 -0
  79. package/src/k-provider/ovp/response-types/kaltura-playback-context.ts +95 -0
  80. package/src/k-provider/ovp/response-types/kaltura-playback-source.ts +89 -0
  81. package/src/k-provider/ovp/response-types/kaltura-playlist.ts +33 -0
  82. package/src/k-provider/ovp/response-types/kaltura-rule-action.ts +27 -0
  83. package/src/k-provider/ovp/response-types/kaltura-ui-conf-response.ts +89 -0
  84. package/src/k-provider/ovp/response-types/kaltura-user-entry-list-response.ts +30 -0
  85. package/src/k-provider/ovp/response-types/kaltura-user-entry.ts +57 -0
  86. package/src/k-provider/ovp/services/analytics/analytics-service.ts +58 -0
  87. package/src/k-provider/ovp/services/analytics/index.ts +11 -0
  88. package/src/k-provider/ovp/services/base-entry-service.ts +75 -0
  89. package/src/k-provider/ovp/services/meta-data-service.ts +29 -0
  90. package/src/k-provider/ovp/services/ovp-service.ts +32 -0
  91. package/src/k-provider/ovp/services/playlist-service.ts +95 -0
  92. package/src/k-provider/ovp/services/session-service.ts +27 -0
  93. package/src/k-provider/ovp/services/stats/index.ts +11 -0
  94. package/src/k-provider/ovp/services/stats/stats-service.ts +32 -0
  95. package/src/k-provider/ovp/services/ui-conf-service.ts +32 -0
  96. package/src/types/adapter-data-config.ts +1 -0
  97. package/src/types/caption-type.ts +1 -0
  98. package/src/types/drm-data.ts +5 -0
  99. package/src/types/entry-list.ts +6 -0
  100. package/src/types/env-config.ts +7 -0
  101. package/src/types/external-caption-object.ts +7 -0
  102. package/src/types/filter-options.ts +3 -0
  103. package/src/types/index.ts +34 -0
  104. package/src/types/loader.ts +7 -0
  105. package/src/types/media-config-metadata.ts +13 -0
  106. package/src/types/media-config-session.ts +6 -0
  107. package/src/types/media-config-sources.ts +20 -0
  108. package/src/types/media-config.ts +8 -0
  109. package/src/types/media-entry.ts +16 -0
  110. package/src/types/media-format.ts +5 -0
  111. package/src/types/media-info.ts +21 -0
  112. package/src/types/media-source.ts +12 -0
  113. package/src/types/media-sources.ts +11 -0
  114. package/src/types/network-retry-parameters.ts +5 -0
  115. package/src/types/playback-context.ts +10 -0
  116. package/src/types/playlist-info.ts +4 -0
  117. package/src/types/playlist-item.ts +5 -0
  118. package/src/types/playlist-metadata.ts +4 -0
  119. package/src/types/playlist.ts +10 -0
  120. package/src/types/poster.ts +5 -0
  121. package/src/types/provider-options.ts +17 -0
  122. package/src/types/request-loader.ts +6 -0
  123. package/src/util/clone.ts +23 -0
  124. package/src/util/error/category.ts +11 -0
  125. package/src/util/error/code.ts +77 -0
  126. package/src/util/error/error.ts +47 -0
  127. package/src/util/error/severity.ts +21 -0
  128. package/src/util/logger.ts +108 -0
  129. package/src/util/param.ts +45 -0
  130. package/src/util/request-builder.ts +187 -0
  131. package/src/util/xml-parser.ts +39 -0
  132. package/CHANGELOG.md +0 -959
  133. package/samples/ott/bookmark.html +0 -23
  134. package/samples/ott/provider.html +0 -28
  135. package/samples/ovp/provider.html +0 -30
  136. package/samples/ovp/stats.html +0 -17
@@ -1,2 +1,3 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ovp=t():(e.playkit=e.playkit||{},e.playkit.providers=e.playkit.providers||{},e.playkit.providers.ovp=t())}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=18)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(2);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function e(t,r,n,a){void 0===a&&(a={}),this.severity=t,this.category=r,this.code=n,this.data=a,e._logger.error("Category:"+r+" | Code:"+n+" |",a)};a(i,"Severity",{RECOVERABLE:1,CRITICAL:2}),a(i,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),a(i,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),a(i,"_logger",Object(n.b)("Error"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(8);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(){this.metadata=new Map,this.sources=new n.a,this.type=e.Type.UNKNOWN}return e.prototype.toJSON=function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}},e}();a(i,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"}),a(i,"DvrStatus",{ON:1,OFF:0})},function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"d",(function(){return u})),r.d(t,"e",(function(){return i})),r.d(t,"a",(function(){return a}));var n={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},a={};function i(e){e&&"function"==typeof e.getLogger&&(n.get=e.getLogger),e&&e.LogLevel&&(a=e.LogLevel)}function s(e){return n.get(e)}function o(e){return s(e).getLevel()}function u(e,t){s(t).setLevel(e)}t.b=s},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){void 0===e&&(e=new Map),a(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),a(this,"_attemptCounter",1),this.headers=e}var t=e.prototype;return t.getUrl=function(e){return e+"/service/"+this.service+(this.action?"/action/"+this.action:"")},t.doHttpRequest=function(){var e=this,t=new Promise((function(t,r){e._requestPromise={resolve:t,reject:r}}));return this.url||this._requestPromise.reject(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),t},t._createXHR=function(){var e=this,t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status)try{var r=JSON.parse(t.responseText);return e.responseHeaders=e._getResponseHeaders(t),e._requestPromise.resolve(r)}catch(r){e._requestPromise.reject(e._createError(t,n.a.Code.BAD_SERVER_RESPONSE,{text:t.responseText}))}},t.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(t.timeout=this.retryConfig.timeout);var r=performance.now();t.ontimeout=function(){e._handleError(t,n.a.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:t.statusText})},t.onerror=t.onabort=function(){e._handleError(t,n.a.Code.HTTP_ERROR,{text:t.responseText,statusText:t.statusText})},this.headers.forEach((function(e,r){t.setRequestHeader(r,e)})),t.send(this.params)},t._getResponseHeaders=function(e){return e.getAllResponseHeaders().split("\n").filter((function(e){return 0===e.toLowerCase().indexOf("x-")}))},t._handleError=function(e,t,r){var n=this._createError(e,t,r);if(e.onreadystatechange=function(){},e.onerror=function(){},e.ontimeout=function(){},e.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()},t._createError=function(e,t,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(e),attempt:this._attemptCounter}),new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,t,r)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){var t,r,n;n=!1,(r="hasError")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,"KalturaAPIException"===e.objectType?(this.hasError=!0,this.error=new a(e.code,e.message)):e.error&&"KalturaAPIException"===e.error.objectType?(this.hasError=!0,this.error=new a(e.error.code,e.error.message)):this.data=e},a=function(e,t){this.code=e,this.message=t}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i}));var n={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},a=new Map([["mpegdash",n.DASH],["applehttp",n.HLS],["url",n.MP4]]);function i(e){var t=a.get(e);return!!t&&t.name===n.MP4.name}},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,a,i,s=function(e){this.scheme=e.scheme,this.licenseURL=e.licenseURL,this.certificate=e.certificate};i={"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"},(a="Scheme")in(n=s)?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.message=e.message,this.code=e.code}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));r(9);var n=r(5),a=(r(13),function(){function e(){this.progressive=[],this.dash=[],this.hls=[],this.image=[]}var t=e.prototype;return t.map=function(e,t){if(t)switch(t.name){case n.a.MP4.name:this.progressive.push(e);break;case n.a.DASH.name:this.dash.push(e);break;case n.a.HLS.name:this.hls.push(e)}},t.toJSON=function(){var e={progressive:[],dash:[],hls:[],image:[]};return this.progressive.forEach((function(t){return e.progressive.push(t.toJSON())})),this.hls.forEach((function(t){return e.hls.push(t.toJSON())})),this.dash.forEach((function(t){return e.dash.push(t.toJSON())})),e.image=this.image,e},e}())},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(12);var n=function(){function e(){}return e.prototype.toJSON=function(){var e={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(e.bandwidth=this.bandwidth),this.width&&(e.width=this.width),this.height&&(e.height=this.height),this.label&&(e.label=this.label),this.drmData&&this.drmData.length>0&&(e.drmData=[],this.drmData.forEach((function(t){Array.isArray(e.drmData)&&e.drmData.push(t.toJSON())}))),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(11);var n=r(0);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(){function e(e){a(this,"_loadersResponseMap",new Map),a(this,"_loaders",new Map),this._networkRetryConfig=e}var t=e.prototype;return t.add=function(e,t,r){var n=this,a=new e(t);if(a.isValid()){this._loaders.set(e.id,a);var i=this._multiRequest.requests.length,s=a.requests;this._multiRequest.retryConfig=this._networkRetryConfig,s.forEach((function(e){e.params=e.params||{},e.params.ks=e.params.ks||r,n._multiRequest.add(e)}));var o=Array.from(new Array(s.length),(function(e,t){return t+i}));this._loadersResponseMap.set(e.id,o)}},t.fetchData=function(e){var t=this;return new Promise((function(r,a){t._multiRequest.execute(e).then((function(e){t._multiResponse=e.response,t.prepareData(e.response).success?r(t._loaders):a(new n.a(n.a.Severity.CRITICAL,n.a.Category.NETWORK,n.a.Code.API_RESPONSE_MISMATCH,{headers:e.headers}))}),(function(e){a(e)}))}))},t.prepareData=function(e){var t=this;return this._loaders.forEach((function(r,n){var a=t._loadersResponseMap.get(n);try{a&&a.length>0&&(r.response=e.results.slice(a[0],a[a.length-1]+1))}catch(e){return{success:!1,error:e}}})),{success:!0,data:this._loaders}},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3),a=r(2),i=r(4),s=r(0);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return u(o(t=e.call.apply(e,[this].concat(n))||this),"requests",[]),t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.add=function(e){var t;this.requests.push(e);var r={},n={service:e.service,action:e.action};return Object.assign(r,((t={})[this.requests.length]=Object.assign(n,e.params),t)),Object.assign(r,this.params),this.params=r,this},a.execute=function(e){var t=this;return new Promise((function(r,a){try{t.params=JSON.stringify(t.params)}catch(e){n._logger.error(""+e.message),a(new s.a(s.a.Severity.CRITICAL,s.a.Category.PROVIDER,s.a.Code.FAILED_PARSING_REQUEST,{error:e,params:t.params}))}t.doHttpRequest().then((function(n){var i=new l(n,e);i.success?r({headers:t.responseHeaders,response:i}):a(new s.a(s.a.Severity.CRITICAL,s.a.Category.NETWORK,s.a.Code.MULTIREQUEST_API_ERROR,{url:t.url,headers:t.responseHeaders,results:i.results}))}),(function(e){a(e)}))}))},n}(n.a);u(c,"_logger",Object(a.b)("MultiRequestBuilder"));var l=function e(t,r){void 0===r&&(r=!0),u(this,"results",[]);var n=t.result?t.result:t,a=(Array.isArray(n)?n:[n]).map((function(e){return new i.a(e)})),s=a.filter((function(e){return e.hasError}));s.forEach((function(t){e._logger.error("Service returned an error with error code: "+t.error.code+" and message: "+t.error.message+".")})),this.results=a,r&&s.length||s.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(e){return!e.hasError})),this.success=!0)};u(l,"_logger",Object(a.b)("MultiRequestResult"))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(e,t,r){this.licenseUrl=e,this.scheme=t,r&&(this.certificate=r)}return e.prototype.toJSON=function(){var e={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(e.certificate=this.certificate),e},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(){function e(t){this.id=t.id,this.url=e.extractBaseThumbnailUrl(t.dataUrl),this.mimetype=""}return e.extractBaseThumbnailUrl=function(e){return e.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)},e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(2),a=(r(10),r(0));function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var o=function(){function e(e,t){var r,a,i;i={async:!0,timeout:0,maxAttempts:4},(a="_networkRetryConfig")in(r=this)?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,Object(n.e)(e.logger),this._partnerId=e.partnerId,this._widgetId=e.widgetId,this._uiConfId=e.uiConfId,this._isAnonymous=!e.ks,this._ks=e.ks||"",this._playerVersion=t}s(e,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(e){this._ks=e}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}}]);var t=e.prototype;return t.getMediaConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))},t.getPlaylistConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))},t.getEntryListConfig=function(e){return Promise.reject(new a.a(a.a.Severity.CRITICAL,a.a.Category.PROVIDER,a.a.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))},t._verifyHasSources=function(e){if(0===e.hls.concat(e.dash,e.progressive,e.image).length)throw new a.a(a.a.Severity.CRITICAL,a.a.Category.SERVICE,a.a.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: "+e.id})},t.getLogLevel=function(e){return Object(n.c)(e)},t.setLogLevel=function(e,t){Object(n.d)(e,t)},s(e,[{key:"LogLevel",get:function(){return n.a}}]),e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function e(t){var r;return Array.isArray(t)?(r=t.length>0?t.slice(0):[]).forEach((function(t,n){("object"==typeof t&&t!=={}||Array.isArray(t)&&t.length>0)&&(r[n]=e(t))})):"object"==typeof t?(r=Object.assign({},t),Object.keys(r).forEach((function(t){("object"==typeof r[t]&&r[t]!=={}||Array.isArray(r[t])&&r[t].length>0)&&(r[t]=e(r[t]))}))):r=t,r}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(1);var n=function(){this.items=[]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n=function(e){this.url=e.url,this.clickThroughUrl=e.clickThroughUrl}},function(e,t,r){"use strict";r.r(t),r.d(t,"Provider",(function(){return Te})),r.d(t,"ProviderParser",(function(){return K})),r.d(t,"NAME",(function(){return Oe})),r.d(t,"VERSION",(function(){return Ae})),r.d(t,"RequestBuilder",(function(){return W.a})),r.d(t,"ResponseTypes",(function(){return n}));var n={};r.r(n),r.d(n,"KalturaBaseEntryListResponse",(function(){return Z})),r.d(n,"KalturaMediaEntry",(function(){return A})),r.d(n,"KalturaAccessControlModifyRequestHostRegexAction",(function(){return g})),r.d(n,"KalturaBumper",(function(){return v})),r.d(n,"KalturaFlavorAsset",(function(){return m})),r.d(n,"KalturaMediaEntries",(function(){return oe})),r.d(n,"KalturaMetadata",(function(){return R})),r.d(n,"KalturaMetadataListResponse",(function(){return T})),r.d(n,"KalturaPlaybackContext",(function(){return I})),r.d(n,"KalturaPlaybackSource",(function(){return d})),r.d(n,"KalturaPlaylist",(function(){return se})),r.d(n,"KalturaRuleAction",(function(){return y})),r.d(n,"KalturaUIConfResponse",(function(){return ve})),r.d(n,"KalturaDrmPlaybackPluginData",(function(){return l.a})),r.d(n,"KalturaAccessControlMessage",(function(){return c.a})),r.d(n,"BaseServiceResult",(function(){return u.a}));var a=r(2),i=r(15),s={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},o=function(){function e(){}return e.set=function(e){e&&Object.assign(s,e)},e.get=function(){return Object(i.a)(s)},e}(),u=r(4),c=r(7),l=r(6);var d=function(){function e(e){var t,r,n,a=this;n=[],(r="drm")in(t=this)?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,this.format=e.format,this.deliveryProfileId=e.deliveryProfileId,this.url=e.url,this.protocols=e.protocols,this.flavorIds=e.flavorIds,e.drm&&e.drm.map((function(e){return a.drm.push(new l.a(e))}))}var t=e.prototype;return t.hasDrmData=function(){return this.drm&&this.drm.length>0},t.hasFlavorIds=function(){return!!this.flavorIds&&this.flavorIds.length>0},t.getProtocol=function(e){var t="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===e&&(t=r)}));else if("http"===e)return e;return t},e}();var p,f,h,y=function(e){this.type=e.type};h={DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8},(f="Type")in(p=y)?Object.defineProperty(p,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):p[f]=h;var g=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).pattern=t.pattern,r.replacement=t.replacement,r.replacmenServerNodeId=t.replacmenServerNodeId,r.checkAliveTimeoutMs=t.checkAliveTimeoutMs,r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(y);var m=function(e){this.id=e.id,this.flavorParamsId=e.flavorParamsId,this.fileExt=e.fileExt,this.bitrate=e.bitrate,this.width=e.width,this.height=e.height,this.id=e.id,this.frameRate=e.frameRate,this.isOriginal=e.isOriginal,this.isWeb=e.isWeb,this.containerFormat=e.containerFormat,this.videoCodecId=e.videoCodecId,this.status=e.status,this.language=e.language,this.label=e.label};!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(m,"Status",{ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9});var v=function(e){this.entryId=e.entryId,this.clickThroughUrl=e.url,this.sources=e.sources?e.sources.map((function(e){return new d(e)})):[]};function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var I=function(e){var t,r;function n(t){var r;if(E(_(r=e.call(this,t)||this),"sources",[]),E(_(r),"actions",[]),E(_(r),"messages",[]),E(_(r),"flavorAssets",[]),E(_(r),"bumperData",[]),!r.hasError){var n=t.messages;n&&n.map((function(e){return r.messages.push(new c.a(e))}));var a=t.actions;a&&a.map((function(e){e.type===y.Type.REQUEST_HOST_REGEX?r.actions.push(new g(e)):r.actions.push(new y(e))}));var i=t.sources;i&&i.map((function(e){return r.sources.push(new d(e))}));var s=t.flavorAssets;s&&s.map((function(e){return r.flavorAssets.push(new m(e))}));var o=t.bumperData;o&&o.map((function(e){return r.bumperData.push(new v(e))}))}return r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var a=n.prototype;return a.hasBlockAction=function(){return void 0!==this.getBlockAction()},a.getBlockAction=function(){return this.actions.find((function(e){return e.type===y.Type.BLOCK}))},a.getErrorMessages=function(){return this.messages},a.getRequestHostRegexAction=function(){var e=this.actions.find((function(e){return e.type===y.Type.REQUEST_HOST_REGEX}));if(e instanceof g)return e},n}(u.a);function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var R=function(e){this.id=e.id,this.metadataProfileId=e.metadataProfileId,this.metadataProfileVersion=e.metadataProfileVersion,this.metadataProfileId=e.metadataProfileId,this.metadataObjectType=e.metadataObjectType,this.objectId=e.objectId,this.version=e.version,this.created=new Date(0),this.created.setUTCSeconds(e.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(e.updatedAt),this.status=e.status,this.xml=e.xml};b(R,"ObjectType",{AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),b(R,"Status",{VALID:1,INVALID:2,DELETED:3});var T=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.metas=[],t.objects.map((function(e){return r.metas.push(new R(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A=function(e){this.id=e.id,this.referenceId=e.referenceId,this.externalSourceType=e.externalSourceType,this.name=e.name,this.description=e.description,this.dataUrl=e.dataUrl,this.type=e.type,this.entryType=e.mediaType,this.flavorParamsIds=e.flavorParamsIds,this.duration=e.duration,this.poster=e.thumbnailUrl,this.status=e.status,this.dvrStatus=e.dvrStatus,this.tags=e.tags,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt,this.creatorId=e.creatorId,this.endDate=e.endDate,this.plays=e.plays,this.views=e.views,this.downloadUrl=e.downloadUrl};O(A,"EntryType",{AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),O(A,"MediaType",{VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICK_TIME:{value:204}}),O(A,"EntryStatus",{ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),O(A,"EntryModerationStatus",{PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6});var C=function(e){this.playlistLastEntryId=e.playlistLastEntryId,this.entryId=e.entryId,this.id=e.id,this.userId=e.userId,this.partnerId=e.partnerId,this.status=e.status,this.createdAt=e.createdAt,this.updatedAt=e.updatedAt},w=function(){function e(){}return e.build=function(e){var t=o.get(),r=t.serviceUrl.substr(0,t.serviceUrl.lastIndexOf("/")),n=e.partnerId,a=e.entryId,i=e.ks,s=e.uiConfId,u=e.format,c=e.protocol,l=e.extension,d=e.flavorIds;if(!r||isNaN(Number.parseInt(n))||!a||!u||!c)return"";var p=r;return r.endsWith("/")||(p+="/"),p+="p/"+n+"/sp/"+n+"00/playManifest/entryId/"+a+"/protocol/"+c+"/format/"+u,d?p+="/flavorIds/"+d:s&&(p+="/uiConfId/"+s),""!==i&&(p+="/ks/"+i),""!==l&&(p+="/a."+l),s&&""!==d&&(p+="?uiConfId="+s),p},e}(),P=function(){function e(){}return e.xmlToJson=function(e){var t={};if(1===e.nodeType){if(e.attributes.length>0){t["@attributes"]={};for(var r=0;r<e.attributes.length;r++){var n=e.attributes.item(r);t["@attributes"][n.nodeName]=n.nodeValue}}}else 3===e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var a=0;a<e.childNodes.length;a++){var i=e.childNodes.item(a),s=i.nodeName;if(void 0===t[s])t[s]=this.xmlToJson(i);else{if(void 0===t[s].push){var o=t[s];t[s]=[],t[s].push(o)}t[s].push(this.xmlToJson(i))}}return t},e}(),S=r(1),D=r(12),M=r(9),k=r(8),L=r(5),N=function(){this.items=[]},U=r(16),j=r(17),x={SRT:"1",DFXP:"2",WEBVTT:"3",CAP:"4"},V={3:"vtt",1:"srt"},F=function(){function e(){}return e.createConfig=function(e,t){return e.map((function(e){var r=e.url,n=V[e.format];return[x.DFXP,x.CAP].includes(e.format)&&(r=e.webVttUrl,n=V[x.WEBVTT]),r=B(r,t),{default:!!e.isDefault,type:n,language:e.languageCode,label:e.label,url:r}}))},e}(),q=r(13);var H=function(){function e(){}return e.getMediaEntry=function(t,r,n,a){var i=new S.a,s=a.entry,u=a.playBackContextResult,c=a.metadataListResult,l=u.sources;return i.sources=e._getParsedSources(l,t,r,n,s,u),e._fillBaseData(i,s,c),i.type!==S.a.Type.LIVE&&o.get().useApiCaptions&&u.data.playbackCaptions&&(i.sources.captions=F.createConfig(u.data.playbackCaptions,t)),i},e.addKsToUrl=function(e,t){var r;return t?(r=-1!==e.split("?")[0].replace(/^.*[\\/]/,"").indexOf(".")?-1===e.indexOf("?")?"?ks=":"&ks=":"/ks/",e+r+t):e},e.getPlaylist=function(t){var r=new N,n=t.playlistData,a=t.playlistItems.entries,i=t.playlistUserEntries.entries;return r.id=n.id,r.name=n.name,r.description=n.description,r.poster=n.poster,r.playlistLastEntryId=i.map((function(e){return e.playlistLastEntryId}))[0],a.forEach((function(t){var n=new S.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getEntryList=function(t){var r=new U.a;return t.playlistItems.entries.forEach((function(t){var n=new S.a;e._fillBaseData(n,t),r.items.push(n)})),r},e.getBumper=function(t,r,n){var a=t.playBackContextResult,i=a.bumperData[0];if(i){var s=(i&&i.sources).find((function(e){return Object(L.c)(e.format)}));if(s){var o=e._parseProgressiveSources(s,a,r,n,0,i.entryId);if(o[0])return new j.a({url:o[0].url,clickThroughUrl:i.clickThroughUrl})}}},e._fillBaseData=function(t,r,n){return t.poster=r.poster,t.id=r.id,t.duration=r.duration,t.downloadUrl=r.downloadUrl||"",t.metadata=e._parseMetadata(n),t.metadata.description=r.description||"",t.metadata.entryId=r.id||"",t.metadata.name=r.name||"",r.createdAt&&(t.metadata.createdAt=r.createdAt),r.updatedAt&&(t.metadata.updatedAt=r.updatedAt),r.creatorId&&(t.metadata.creatorId=r.creatorId),r.endDate&&(t.metadata.endDate=r.endDate),r.views&&(t.metadata.views=r.views),r.plays&&(t.metadata.plays=r.plays),t.metadata.tags=r.tags||"",t.status=r.status,t.type=e._getEntryType(r.entryType,r.type),t.type===S.a.Type.LIVE&&(t.dvrStatus=r.dvrStatus),t},e._getEntryType=function(e,t){var r=S.a.Type.UNKNOWN;switch(e){case A.MediaType.IMAGE.value:r=S.a.Type.IMAGE;break;case A.MediaType.AUDIO.value:r=S.a.Type.AUDIO;break;default:switch(t){case A.EntryType.MEDIA_CLIP.value:r=S.a.Type.VOD;break;case A.EntryType.LIVE_STREAM.value:case A.EntryType.LIVE_CHANNEL.value:r=S.a.Type.LIVE;break;default:r=S.a.Type.UNKNOWN}}return r},e._getParsedSources=function(t,r,n,a,i,s){var o,u,c=new k.a,l=function(t){var o=e._parseAdaptiveSource(t,s,r,n,a,i.id);if(o){var u=L.b.get(t.format);c.map(o,u)}};return i.type===A.EntryType.EXTERNAL_MEDIA.value?((u=new M.a).mimetype="video/youtube",u.url=i.referenceId,u.id=i.id+"_youtube",c.progressive.push(u)):i.entryType===A.MediaType.IMAGE.value?c.image.push(new q.a(i)):t&&t.length>0&&(t.filter((function(e){return!Object(L.c)(e.format)})).forEach(l),o=t.find((function(t){return Object(L.c)(t.format)&&""!==t.getProtocol(e._getBaseProtocol())})),c.progressive=e._parseProgressiveSources(o,s,r,n,a,i.id)),c},e._parseAdaptiveSource=function(t,r,n,a,i,s){var o=new M.a;if(t){var u="",c=L.b.get(t.format),d=t.getProtocol(e._getBaseProtocol()),p=t.deliveryProfileId,f=t.format,h="";if(c&&(h=c.pathExt,o.mimetype=c.mimeType),t.hasFlavorIds()?(!h&&r.flavorAssets&&r.flavorAssets.length>0&&(h=r.flavorAssets[0].fileExt),u=w.build({entryId:s,flavorIds:t.flavorIds,format:f,ks:n,partnerId:a,uiConfId:i,extension:h,protocol:d})):u=e.addKsToUrl(t.url,n),!u){var y="failed to create play url from source, discarding source: ("+s+"_"+p+"), "+f;return e._logger.warn(y),null}if(o.url=u,o.id=s+"_"+p+","+f,t.hasDrmData()){var g=[];t.drm.forEach((function(e){g.push(new D.a(e.licenseURL,l.a.Scheme[e.scheme],e.certificate))})),o.drmData=g}}return o},e._parseProgressiveSources=function(t,r,n,a,i,s){var o=[],u=[];if(t){var c=t.getProtocol(e._getBaseProtocol()),l=t.format,d=t.deliveryProfileId,p=d+","+l;r.flavorAssets.map((function(t){var r=new M.a;r.id=t.id+p,r.mimetype="mp3"===t.fileExt?"audio/mp3":"video/mp4",r.height=t.height,r.width=t.width,r.bandwidth=1024*t.bitrate,r.label=t.label||t.language;var f=w.build({entryId:s,flavorIds:t.id,format:l,ks:n,partnerId:a,uiConfId:i,extension:t.fileExt,protocol:c});if(""===f)return e._logger.warn("failed to create play url from source, discarding source: ("+s+"_"+d+"), "+l+"."),null;r.url=f,t.height&&t.width?o.push(r):u.push(r)}))}return u.length&&!o.length?u:o},e._parseMetadata=function(e){var t={};return e&&e.metas&&e.metas.length>0&&e.metas.forEach((function(e){if(e.xml){var r,n=new DOMParser;e.xml=e.xml.replace(/\r?\n|\r/g,""),e.xml=e.xml.replace(/>\s*/g,">"),e.xml=e.xml.replace(/>\s*/g,">"),r=n.parseFromString(e.xml,"text/xml");var a=P.xmlToJson(r);Object.keys(a.metadata).forEach((function(e){t[e]=a.metadata[e]["#text"]}))}})),t},e._getBaseProtocol=function(){var e=o.get(),t=/^https?:/.exec(e.cdnUrl),r=t?t[0]:document.location.protocol;return"string"==typeof r?r.slice(0,-1):"https"},e.hasBlockAction=function(e){return e.playBackContextResult.hasBlockAction()},e.getBlockAction=function(e){return e.playBackContextResult.getBlockAction()},e.getErrorMessages=function(e){return e.playBackContextResult.getErrorMessages()},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(H,"_logger",Object(a.b)("OVPProviderParser"));var B=H.addKsToUrl,K=H,W=r(3),G=r(11),Y=function(){function e(){}return e.getMultiRequest=function(e,t,r){var n=o.get(),a=n.serviceParams;Object.assign(a,{ks:t,clientTag:"html5:v"+e}),r&&Object.assign(a,{partnerId:r});var i=new Map;i.set("Content-Type","application/json");var s=new G.a(i);return s.method="POST",s.service="multirequest",s.url=s.getUrl(n.serviceUrl),s.params=a,s},e}();var J=function e(t){void 0===t&&(t={}),this.type=t.type||e.Type.INCLUDE_FIELDS,this.fields=t.fields||"id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"};!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(J,"Type",{INCLUDE_FIELDS:1,EXCLUDE_FIELDS:2});var X=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.getPlaybackContext=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);a.service="baseEntry",a.action="getPlaybackContext",a.method="POST",a.url=a.getUrl(e),a.tag="baseEntry-getPlaybackContext";return a.params={entryId:r,ks:t,contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},a},n.list=function(e,t,r,a,i){var s=new Map;s.set("Content-Type","application/json");var o=new W.a(s);return o.service="baseEntry",o.action="list",o.method="POST",o.url=o.getUrl(e),o.tag="list",o.params=n.getEntryListReqParams(r,t,a,i),o},n.getEntryListReqParams=function(e,t,r,n){var a={};return e?a=r?{redirectFromEntryId:e}:{idEqual:e}:n&&(a={objectType:"KalturaBaseEntryFilter",referenceIdEqual:n}),{ks:t,filter:a,responseProfile:new J}},n}(Y);var Q=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.list=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);a.service="metadata_metadata",a.action="list",a.method="POST",a.url=a.getUrl(e),a.tag="metadata_metadata-list";var i={objectType:"KalturaMetadataFilter",objectIdEqual:r,metadataObjectTypeEqual:"1"};return a.params={filter:i,ks:t},a},n}(Y);var Z=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.entries=[],t.objects.map((function(e){return r.entries.push(new A(e))})))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $(e,t,r){return t&&z(e.prototype,t),r&&z(e,r),e}var ee=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._entryId=e.entryId,this._referenceId=e.referenceId}$(e,null,[{key:"id",get:function(){return"media"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];r.push(X.list(t.serviceUrl,e.ks,e.entryId,e.redirectFromEntryId,e.referenceId));var n="{1:result:ks}"===e.ks?"{2:result:objects:0:id}":"{1:result:objects:0:id}";return r.push(X.getPlaybackContext(t.serviceUrl,e.ks,n)),r.push(Q.list(t.serviceUrl,e.ks,n)),r},t.isValid=function(){return!(!this._entryId&&!this._referenceId)},$(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t=new Z(e[0].data);this._response.entry=t.entries[0],this._response.playBackContextResult=new I(e[1].data),this._response.metadataListResult=new T(e[2].data)},get:function(){return this._response}}]),e}();var te=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.anonymousSession=function(e,t){var r=new Map;r.set("Content-Type","application/json");var n=new W.a(r);return n.service="session",n.action="startWidgetSession",n.method="POST",n.url=n.getUrl(e),n.tag="session-startWidget",n.params={widgetId:t},n},n}(Y);function re(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ne=function(){var e,t,r;function n(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._widgetId=e.widgetId}e=n,r=[{key:"id",get:function(){return"session"}}],(t=[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.ks=e[0].data.ks},get:function(){return this._response.ks}}])&&re(e.prototype,t),r&&re(e,r);var a=n.prototype;return a.buildRequests=function(e){var t=o.get(),r=[];return r.push(te.anonymousSession(t.serviceUrl,e.widgetId)),r},a.isValid=function(){return!!this._widgetId},n}();var ae=function(e){var t,r;function n(t,r,n,a){var i;return void 0===n&&(n=""),(i=e.call(this,a)||this)._multiRequest=Y.getMultiRequest(t,n,r),i}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(r(10).a);var ie=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n.execute=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="playlist",a.action="execute",a.method="POST",a.url=a.getUrl(e),a.tag="playlist-execute",a.params={ks:t,id:r,responseProfile:new J},a},n.get=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="playlist",a.action="get",a.method="POST",a.url=a.getUrl(e),a.tag="playlist-get",a.params={ks:t,id:r,responseProfile:{fields:"id,name,description,thumbnailUrl",type:1}},a},n.getLastEntryId=function(e,t,r){var n=new Map;n.set("Content-Type","application/json");var a=new W.a(n);return a.service="userEntry",a.action="list",a.method="POST",a.url=a.getUrl(e),a.tag="userEntry-list",a.params={ks:t,filter:{objectType:"KalturaViewHistoryUserEntry",entryIdEqual:r,userIdEqualCurrent:1},responseProfile:{fields:"playlistLastEntryId",type:1}},a},n}(Y),se=function(e){this.id=e.id,this.name=e.name,this.description=e.description,this.poster=e.thumbnailUrl};var oe=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.entries=[],t.map((function(e){var t=new A(e);t.type!==A.EntryType.DOCUMENT.value&&r.entries.push(t)}))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);var ue=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.totalCount=t.totalCount,r.entries=[],r.totalCount>0&&t.objects.map((function(e){return r.entries.push(new C(e))}))),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function le(e,t,r){return t&&ce(e.prototype,t),r&&ce(e,r),e}var de=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{}),this.requests=this.buildRequests(e),this._playlistId=e.playlistId}le(e,null,[{key:"id",get:function(){return"playlist"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return r.push(ie.get(t.serviceUrl,e.ks,e.playlistId)),r.push(ie.execute(t.serviceUrl,e.ks,e.playlistId)),r.push(ie.getLastEntryId(t.serviceUrl,e.ks,e.playlistId)),r},t.isValid=function(){return!!this._playlistId},le(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){this._response.playlistData=new se(e[0].data),this._response.playlistItems=new oe(e[1].data),this._response.playlistUserEntries=new ue(e[2].data)},get:function(){return this._response}}]),e}(),pe=r(14);function fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function he(e,t,r){return t&&fe(e.prototype,t),r&&fe(e,r),e}var ye=function(){function e(e){!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(e),this._entries=e.entries}he(e,null,[{key:"id",get:function(){return"entry_list"}}]);var t=e.prototype;return t.buildRequests=function(e){var t=o.get(),r=[];return e.entries.forEach((function(n){r.push(X.list(t.serviceUrl,e.ks,n.entryId||n,e.redirectFromEntryId,n.referenceId))})),r},t.isValid=function(){return!(!this._entries||!this._entries.length)},he(e,[{key:"requests",set:function(e){this._requests=e},get:function(){return this._requests}},{key:"response",set:function(e){var t,r=this;e.forEach((function(e){t=new Z(e.data),r._response.playlistItems.entries.push(t.entries[0])}))},get:function(){return this._response}}]),e}(),ge=r(0);function me(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ve=function(e){var t,r;function n(t){var r;return(r=e.call(this,t)||this).hasError||(r.name=t.name,r.description=t.description,r.objTypeAsString=t.objTypeAsString,r.width=t.width,r.height=t.height,r.htmlParams=t.htmlParams,r.swfUrl=t.swfUrl,r.confFilePath=t.confFilePath,r.confFile=t.confFile,r.confFileFeatures=t.confFileFeatures,r.config=t.config,r.confVars=t.confVars,r.useCdn=t.useCdn,r.tags=t.tags,r.swfUrlVersion=t.swfUrlVersion,r.created=new Date(0),r.created.setUTCSeconds(t.createdAt),r.updated=new Date(0),r.updated.setUTCSeconds(t.updatedAt),r.html5Url=t.description,r.version=t.description,r.partnerTags=t.description,r.objType=t.description,r.creationMode=t.description),r}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,n}(u.a);function _e(e,t,r,n,a,i,s){try{var o=e[i](s),u=o.value}catch(e){return void r(e)}o.done?t(u):Promise.resolve(u).then(n,a)}function Ee(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function s(e){_e(i,n,a,s,o,"next",e)}function o(e){_e(i,n,a,s,o,"throw",e)}s(void 0)}))}}me(ve,"Type",{PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),me(ve,"CreationMode",{WIZARD:2,ADVANCED:3});var Ie=function(){function e(){}return e._applyRegexAction=function(e,t){if(e){var r=new RegExp(e.pattern,"i");if(t.match(r))return t.replace(r,e.replacement+"/")}return t},e._isECDNUrlAlive=function(){var t=Ee(regeneratorRuntime.mark((function t(r,n){var a,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=n+"/api_v3/service/system/action/ping/format/1",(i=new XMLHttpRequest).open("GET",a),i.timeout=r.checkAliveTimeoutMs,i.onreadystatechange=function(){if(4===i.readyState)return 200===i.status},i.ontimeout=function(){return e._logger.warn("Got timeout while pinging the ECDN url. the ping url: "+a),!1},i.send();case 7:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),e.handleRegexAction=function(){var t=Ee(regeneratorRuntime.mark((function t(r,n){var a,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.get().cdnUrl,i=e._extractRegexActionFromData(n),s=e._getRegExp(i),t.t0=a&&i&&s&&a.match(s),!t.t0){t.next=11;break}if(t.t1=i.checkAliveTimeoutMs>0,!t.t1){t.next=10;break}return t.next=9,e._isECDNUrlAlive(i,a.replace(s,i.replacement));case 9:t.t1=!t.sent;case 10:t.t0=!t.t1;case 11:if(!t.t0){t.next=14;break}return e._replaceHostUrls(r,i),t.abrupt("return",r);case 14:return e._logger.debug("exiting handleRegexAction - not applying regex action."),t.abrupt("return",r);case 16:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),e._replaceHostUrls=function(t,r){e._logger.debug("Starting to modify urls...");var n=t.sources,a=n.hls,i=n.dash,s=n.progressive,u=n.image;[].concat(a,i,s,u).forEach((function(t){return t.url=e._applyRegexAction(r,t.url)})),o.get().replaceHostOnlyManifestUrls||(e._logger.debug("replaceHostOnlyManifestUrls flag is off - modifying captions and poster URLs"),n.captions&&n.captions.forEach((function(t){return t.url=e._applyRegexAction(r,t.url)})),"string"==typeof n.poster&&(n.poster=e._applyRegexAction(r,n.poster))),e._logger.debug("Finished modifying urls")},e._extractRegexActionFromData=function(e){var t,r;return null==(t=e.get(ee.id))||null==(r=t.response)?void 0:r.playBackContextResult.getRequestHostRegexAction()},e._getRegExp=function(e){if(e&&e.pattern&&e.replacement)return new RegExp(e.pattern,"i")},e}();!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(Ie,"_logger",Object(a.b)("RegexActionHandler"));var be=Ie;function Re(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Te=function(e){var t,r;function n(t,r){var n;return function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n=e.call(this,t,r)||this),"_filterOptionsConfig",{redirectFromEntryId:!0}),n._logger=Object(a.b)("OVPProvider"),o.set(t.env),n._setFilterOptionsConfig(t.filterOptions),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r;var i,s,u,c=n.prototype;return c.getMediaConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entryId,i=e.referenceId;if(a||i){var s=t.ks;s||(s="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId}));var o=t._getEntryRedirectFilter(e);return t._dataLoader.add(ee,{entryId:a,ks:s,redirectFromEntryId:o,referenceId:i}),t._dataLoader.fetchData().then((function(e){try{var a=t._parseDataFromResponse(e);be.handleRegexAction(a,e).then(r)}catch(e){n(e)}}),(function(e){n(e)}))}n(new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.PROVIDER,ge.a.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))},c.doRequest=function(e,t){var r=this,n=t||this.ks,a=new ae(this.playerVersion,this.partnerId,n,this._networkRetryConfig);return new Promise((function(t,i){return n||a.add(ne,{widgetId:r.widgetId}),e.forEach((function(e){a.add(e.loader,e.params,n||"{1:result:ks}")})),a.fetchData().then((function(e){try{t(e)}catch(e){i(e)}}),(function(e){i(e)}))}))},c._getEntryRedirectFilter=function(e){return"boolean"==typeof e.redirectFromEntryId?e.redirectFromEntryId:"boolean"!=typeof this._filterOptionsConfig.redirectFromEntryId||this._filterOptionsConfig.redirectFromEntryId},c._setFilterOptionsConfig=function(e){e&&"boolean"==typeof e.redirectFromEntryId&&(this._filterOptionsConfig.redirectFromEntryId=e.redirectFromEntryId)},c._parseDataFromResponse=function(e){this._logger.debug("Data parsing started");var t={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(t.session.uiConfId=this.uiConfId),e){if(e.has(ne.id)){var r=e.get(ne.id);r&&r.response&&(t.session.ks=r.response,this.widgetId!==this.defaultWidgetId&&(this.ks=t.session.ks))}else t.session.ks=this.ks;if(e.has(ee.id)){var n=e.get(ee.id);if(n&&n.response){var a=n.response;if(K.hasBlockAction(a))throw new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.SERVICE,ge.a.Code.BLOCK_ACTION,{action:K.getBlockAction(a),messages:K.getErrorMessages(a)});var i=K.getMediaEntry(this.isAnonymous?"":this.ks,this.partnerId,this.uiConfId,a);Object.assign(t.sources,this._getSourcesObject(i)),this._verifyMediaStatus(i),this._verifyHasSources(t.sources);var s=K.getBumper(a,this.isAnonymous?"":this.ks,this.partnerId);s&&Object.assign(t.plugins,{bumper:s})}}}return this._logger.debug("Data parsing finished",t),t},c._verifyMediaStatus=function(e){if([A.EntryStatus.IMPORT,A.EntryStatus.PRECONVERT].includes(e.status))throw new ge.a(ge.a.Severity.CRITICAL,ge.a.Category.SERVICE,ge.a.Code.MEDIA_STATUS_NOT_READY,{messages:"Status of entry id "+e.id+" is "+e.status+" and is still being imported or converted",data:{status:status}})},c.getPlaylistConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.playlistId;if(a){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId})),t._dataLoader.add(de,{playlistId:a,ks:i}),t._dataLoader.fetchData().then((function(e){r(t._parsePlaylistDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parsePlaylistDataFromResponse=function(e){var t=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(e&&e.has(de.id)){var n=e.get(de.id);if(n&&n.response){var a=K.getPlaylist(n.response);r.id=a.id,r.poster=a.poster,r.metadata.name=a.name,r.metadata.description=a.description,r.playlistLastEntryId=a.playlistLastEntryId,a.items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}}return this._logger.debug("Data parsing finished",r),r},c.getEntryListConfig=function(e){var t=this;return e.ks&&(this.ks=e.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new ae(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var a=e.entries;if(a&&a.length){var i=t.ks;i||(i="{1:result:ks}",t._dataLoader.add(ne,{widgetId:t.widgetId}));var s=t._getEntryRedirectFilter(e);t._dataLoader.add(ye,{entries:a,ks:i,redirectFromEntryId:s}),t._dataLoader.fetchData(!1).then((function(e){r(t._parseEntryListDataFromResponse(e))}),(function(e){n(e)}))}else n({success:!1,data:"Missing mandatory parameter"})}))},c._parseEntryListDataFromResponse=function(e){var t=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(e&&e.has(ye.id)){var n=e.get(ye.id);if(n&&n.response)K.getEntryList(n.response).items.forEach((function(e){return r.items.push({sources:t._getSourcesObject(e)})}))}return this._logger.debug("Data parsing finished",r),r},c._getPlaylistObject=function(){return{id:"",metadata:{name:"",description:""},poster:"",playlistLastEntryId:"",items:[]}},c._getDefaultSourcesObject=function(){return{hls:[],dash:[],progressive:[],image:[],id:"",duration:0,type:S.a.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}},c._getSourcesObject=function(e){var t=this._getDefaultSourcesObject(),r=e.sources.toJSON();return t.hls=r.hls,t.dash=r.dash,t.progressive=r.progressive,t.image=r.image,t.id=e.id,t.duration=e.duration,t.type=e.type,t.dvr=!!e.dvrStatus,t.poster=e.poster,t.downloadUrl=e.downloadUrl,e.sources.captions&&(t.captions=e.sources.captions),e.metadata&&"string"==typeof e.metadata.tags&&e.metadata.tags.split(", ").includes("360")&&(t.vr={}),Object.assign(t.metadata,e.metadata),t},i=n,(s=[{key:"env",get:function(){return o.get()}}])&&Re(i.prototype,s),u&&Re(i,u),n}(pe.a),Oe="@playkit-js/playkit-js-providers-ovp",Ae="2.40.1"}])}));
1
+ /*! For license information please see playkit-ovp-provider.js.LICENSE.txt */
2
+ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,(function(){return function(){var t={61:function(t,e,r){var n=r(698).default;function i(){"use strict";t.exports=i=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(e){d=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof _?e:_,a=Object.create(i.prototype),o=new D(n||[]);return s(a,"_invoke",{value:b(t,r,o)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var y="suspendedStart",v="suspendedYield",g="executing",m="completed",E={};function _(){}function I(){}function R(){}var T={};d(T,c,(function(){return this}));var A=Object.getPrototypeOf,w=A&&A(A(x([])));w&&w!==a&&o.call(w,c)&&(T=w);var C=R.prototype=_.prototype=Object.create(T);function O(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(i,a,s,u){var c=p(t[i],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(a,a):a()}})}function b(t,r,n){var i=y;return function(a,o){if(i===g)throw new Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:e,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===E)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var c=p(t,r,n);if("normal"===c.type){if(i=n.done?m:v,c.arg===E)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function P(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),E;var a=p(i,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,E;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,E):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,E)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(o.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(n(t)+" is not iterable")}return I.prototype=R,s(C,"constructor",{value:R,configurable:!0}),s(R,"constructor",{value:I,configurable:!0}),I.displayName=d(R,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===I||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,R):(t.__proto__=R,d(t,f,"GeneratorFunction")),t.prototype=Object.create(C),t},r.awrap=function(t){return{__await:t}},O(k.prototype),d(k.prototype,l,(function(){return this})),r.AsyncIterator=k,r.async=function(t,e,n,i,a){void 0===a&&(a=Promise);var o=new k(h(t,e,n,i),a);return r.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},O(C),d(C,f,"Generator"),d(C,c,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=x,D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,E):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),E},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),E}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),E}},r}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},698:function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:function(t,e,r){var n=r(61)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{NAME:function(){return Lt},Provider:function(){return St},ProviderParser:function(){return it},RequestBuilder:function(){return ot},ResponseTypes:function(){return t},VERSION:function(){return Dt}});var t={};function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t){var e=function(t,e){if("object"!==i(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===i(e)?e:String(e)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function s(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}function f(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return u(t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}function h(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(t),r.d(t,{BaseServiceResult:function(){return I},KalturaAccessControlMessage:function(){return x},KalturaAccessControlModifyRequestHostRegexAction:function(){return C},KalturaBaseEntryListResponse:function(){return A},KalturaBumper:function(){return b},KalturaDrmPlaybackPluginData:function(){return O},KalturaFlavorAsset:function(){return P},KalturaMediaEntries:function(){return S},KalturaMediaEntry:function(){return T},KalturaMetadata:function(){return L},KalturaMetadataListResponse:function(){return D},KalturaPlaybackContext:function(){return M},KalturaPlaybackSource:function(){return k},KalturaPlaylist:function(){return N},KalturaRuleAction:function(){return w},KalturaUIConfResponse:function(){return U},KalturaUserEntry:function(){return j},KalturaUserEntryListResponse:function(){return B}});var p={get:function(){return{VERSION:"",DEBUG:{value:"",name:""},ERROR:{value:"",name:""},INFO:{value:"",name:""},OFF:{value:"",name:""},TIME:{value:"",name:""},TRACE:{value:"",name:""},WARN:{value:"",name:""},createDefaultHandler:function(){},debug:function(){},enabledFor:function(){},error:function(){},get:function(){},getLevel:function(){},info:function(){},log:function(){},setHandler:function(){},setLevel:function(){},time:function(){},timeEnd:function(){},trace:function(){},useDefaults:function(){},warn:function(){}}}},y={};function v(t){return p.get(t)}var g=v,m=function t(e){var r;return Array.isArray(e)?(r=e.length>0?e.slice(0):[]).forEach((function(e,n){("object"===i(e)||Array.isArray(e)&&e.length>0)&&(r[n]=t(e))})):"object"===i(e)?(r=Object.assign({},e),Object.keys(r).forEach((function(e){("object"===i(r[e])||Array.isArray(r[e])&&r[e].length>0)&&(r[e]=t(r[e]))}))):r=e,r},E={serviceUrl:"https://cdnapisec.kaltura.com/api_v3",cdnUrl:"https://cdnapisec.kaltura.com",serviceParams:{apiVersion:"3.3.0",format:1},useApiCaptions:!0,loadThumbnailWithKs:!1,replaceHostOnlyManifestUrls:!1},_=function(){function t(){e(this,t)}return s(t,null,[{key:"set",value:function(t){t&&Object.assign(E,t)}},{key:"get",value:function(){return m(E)}}]),t}(),I=s((function t(r){e(this,t),h(this,"hasError",!1),"KalturaAPIException"===r.objectType?(this.hasError=!0,this.error=new R(r.code,r.message)):r.error&&"KalturaAPIException"===r.error.objectType?(this.hasError=!0,this.error=new R(r.error.code,r.error.message)):this.data=r})),R=s((function t(r,n){e(this,t),this.code=r,this.message=n})),T=s((function t(r){e(this,t),this.id=r.id,this.referenceId=r.referenceId,this.externalSourceType=r.externalSourceType,this.name=r.name,this.description=r.description,this.dataUrl=r.dataUrl,this.type=r.type,this.entryType=r.mediaType,this.flavorParamsIds=r.flavorParamsIds,this.duration=r.duration,this.poster=r.thumbnailUrl,this.status=r.status,this.dvrStatus=r.dvrStatus,this.tags=r.tags,this.createdAt=r.createdAt,this.updatedAt=r.updatedAt,this.creatorId=r.creatorId,this.endDate=r.endDate,this.plays=r.plays,this.views=r.views,this.downloadUrl=r.downloadUrl}));h(T,"EntryType",{AUTOMATIC:{value:-1},EXTERNAL_MEDIA:{value:"externalMedia.externalMedia"},MEDIA_CLIP:{value:1},MIX:{value:2},PLAYLIST:{value:5},DATA:{value:6},LIVE_STREAM:{value:7},LIVE_CHANNEL:{value:8},DOCUMENT:{value:10}}),h(T,"MediaType",{VIDEO:{value:1},IMAGE:{value:2},AUDIO:{value:5},LIVE_STREAM_FLASH:{value:201},LIVE_STREAM_WINDOWS_MEDIA:{value:202},LIVE_STREAM_REAL_MEDIA:{value:203},LIVE_STREAM_QUICK_TIME:{value:204}}),h(T,"EntryStatus",{ERROR_IMPORTING:-2,ERROR_CONVERTING:-1,SCAN_FAILURE:"virusScan.ScanFailure",IMPORT:0,INFECTED:"virusScan.Infected",PRECONVERT:1,READY:2,DELETED:3,PENDING:4,MODERATE:5,BLOCKED:6,NO_CONTENT:7}),h(T,"EntryModerationStatus",{PENDING_MODERATION:1,APPROVED:2,REJECTED:3,FLAGGED_FOR_REVIEW:4,MODERATE:5,AUTO_APPROVED:6});var A=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t){var r;return e(this,a),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.entries=[],t.objects.map((function(t){return r.entries.push(new T(t))})))),r}return s(a)}(I),w=s((function t(r){e(this,t),this.type=r.type}));h(w,"Type",{DRM_POLICY:"drm.DRM_POLICY",BLOCK:1,PREVIEW:2,LIMIT_FLAVORS:3,ADD_TO_STORAGE:4,LIMIT_DELIVERY_PROFILES:5,SERVE_FROM_REMOTE_SERVER:6,REQUEST_HOST_REGEX:7,LIMIT_THUMBNAIL_CAPTURE:8});var C=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t){var r;return e(this,a),(r=i.call(this,t)).pattern=t.pattern,r.replacement=t.replacement,r.replacmenServerNodeId=t.replacmenServerNodeId,r.checkAliveTimeoutMs=t.checkAliveTimeoutMs,r}return s(a)}(w),O=s((function t(r){e(this,t),this.scheme=r.scheme,this.licenseURL=r.licenseURL,this.certificate=r.certificate}));h(O,"Scheme",{"drm.PLAYREADY_CENC":"com.microsoft.playready","drm.WIDEVINE_CENC":"com.widevine.alpha","fairplay.FAIRPLAY":"com.apple.fairplay",WIDEVINE_CENC:"com.widevine.alpha",PLAYREADY_CENC:"com.microsoft.playready",FAIRPLAY:"com.apple.fairplay"});var k=function(){function t(r){var n=this;e(this,t),h(this,"drm",[]),this.format=r.format,this.deliveryProfileId=r.deliveryProfileId,this.url=r.url,this.protocols=r.protocols,this.flavorIds=r.flavorIds,r.drm&&r.drm.map((function(t){return n.drm.push(new O(t))}))}return s(t,[{key:"hasDrmData",value:function(){return this.drm&&this.drm.length>0}},{key:"hasFlavorIds",value:function(){return!!this.flavorIds&&this.flavorIds.length>0}},{key:"getProtocol",value:function(t){var e="";if(this.protocols&&this.protocols.length>0)this.protocols.split(",").forEach((function(r){r===t&&(e=r)}));else if("http"===t)return t;return e}}]),t}(),b=s((function t(r){e(this,t),this.entryId=r.entryId,this.clickThroughUrl=r.url,this.sources=r.sources?r.sources.map((function(t){return new k(t)})):[]})),P=s((function t(r){e(this,t),this.id=r.id,this.flavorParamsId=r.flavorParamsId,this.fileExt=r.fileExt,this.bitrate=r.bitrate,this.width=r.width,this.height=r.height,this.id=r.id,this.frameRate=r.frameRate,this.isOriginal=r.isOriginal,this.isWeb=r.isWeb,this.containerFormat=r.containerFormat,this.videoCodecId=r.videoCodecId,this.status=r.status,this.language=r.language,this.label=r.label}));h(P,"Status",{ERROR:-1,QUEUED:0,CONVERTING:1,READY:2,DELETED:3,NOT_APPLICABLE:4,TEMP:5,WAIT_FOR_CONVERT:6,IMPORTING:7,VALIDATING:8,EXPORTING:9});var S=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t){var r;return e(this,a),(r=i.call(this,t)).hasError||(r.entries=[],t.map((function(t){var e=new T(t);e.type!==T.EntryType.DOCUMENT.value&&r.entries.push(e)}))),r}return s(a)}(I),L=s((function t(r){e(this,t),this.id=r.id,this.metadataProfileId=r.metadataProfileId,this.metadataProfileVersion=r.metadataProfileVersion,this.metadataProfileId=r.metadataProfileId,this.metadataObjectType=r.metadataObjectType,this.objectId=r.objectId,this.version=r.version,this.created=new Date(0),this.created.setUTCSeconds(r.createdAt),this.updated=new Date(0),this.updated.setUTCSeconds(r.updatedAt),this.status=r.status,this.xml=r.xml}));h(L,"ObjectType",{AD_CUE_POINT:"adCuePointMetadata.AdCuePoint",ANNOTATION:"annotationMetadata.Annotation",CODE_CUE_POINT:"codeCuePointMetadata.CodeCuePoint",THUMB_CUE_POINT:"thumbCuePointMetadata.thumbCuePoint",ENTRY:1,CATEGORY:2,USER:3,PARTNER:4,DYNAMIC_OBJECT:5}),h(L,"Status",{VALID:1,INVALID:2,DELETED:3});var D=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t){var r;return e(this,a),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.totalCount>0&&(r.metas=[],t.objects.map((function(t){return r.metas.push(new L(t))})))),r}return s(a)}(I),x=s((function t(r){e(this,t),this.message=r.message,this.code=r.code}));var M=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t){var r;if(e(this,a),h(u(r=i.call(this,t)),"sources",[]),h(u(r),"actions",[]),h(u(r),"messages",[]),h(u(r),"flavorAssets",[]),h(u(r),"bumperData",[]),!r.hasError){var n=t.messages;n&&n.map((function(t){return r.messages.push(new x(t))}));var o=t.actions;o&&o.map((function(t){t.type===w.Type.REQUEST_HOST_REGEX?r.actions.push(new C(t)):r.actions.push(new w(t))}));var s=t.sources;s&&s.map((function(t){return r.sources.push(new k(t))}));var c=t.flavorAssets;c&&c.map((function(t){return r.flavorAssets.push(new P(t))}));var l=t.bumperData;l&&l.map((function(t){return r.bumperData.push(new b(t))}))}return r}return s(a,[{key:"hasBlockAction",value:function(){return void 0!==this.getBlockAction()}},{key:"getBlockAction",value:function(){return this.actions.find((function(t){return t.type===w.Type.BLOCK}))}},{key:"getErrorMessages",value:function(){return this.messages}},{key:"getRequestHostRegexAction",value:function(){var t=this.actions.find((function(t){return t.type===w.Type.REQUEST_HOST_REGEX}));if(t instanceof C)return t}}]),a}(I),N=s((function t(r){e(this,t),this.id=r.id,this.name=r.name,this.description=r.description,this.poster=r.thumbnailUrl}));var U=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t){var r;return e(this,a),(r=i.call(this,t)).hasError||(r.name=t.name,r.description=t.description,r.objTypeAsString=t.objTypeAsString,r.width=t.width,r.height=t.height,r.htmlParams=t.htmlParams,r.swfUrl=t.swfUrl,r.confFilePath=t.confFilePath,r.confFile=t.confFile,r.confFileFeatures=t.confFileFeatures,r.config=t.config,r.confVars=t.confVars,r.useCdn=t.useCdn,r.tags=t.tags,r.swfUrlVersion=t.swfUrlVersion,r.created=new Date(0),r.created.setUTCSeconds(t.createdAt),r.updated=new Date(0),r.updated.setUTCSeconds(t.updatedAt),r.html5Url=t.description,r.version=t.description,r.partnerTags=t.description,r.objType=t.description,r.creationMode=t.description),r}return s(a)}(I);h(U,"Type",{PLAYER:1,CONTRIBUTION_WIZARD:2,SIMPLE_EDITOR:3,ADVANCED_EDITOR:4,PLAYLIST:5,APP_STUDIO:6,KRECORD:7,PLAYER_V3:8,KMC_ACCOUNT:9,KMC_ANALYTICS:10,KMC_CONTENT:11,KMC_DASHBOARD:12,KMC_LOGIN:13,PLAYER_SL:14,CLIENTSIDE_ENCODER:15,KMC_GENERAL:16,KMC_ROLES_AND_PERMISSIONS:17,CLIPPER:18,KSR:19,KUPLOAD:20,WEBCASTING:21}),h(U,"CreationMode",{WIZARD:2,ADVANCED:3});var j=s((function t(r){e(this,t),this.playlistLastEntryId=r.playlistLastEntryId,this.entryId=r.entryId,this.id=r.id,this.userId=r.userId,this.partnerId=r.partnerId,this.status=r.status,this.createdAt=r.createdAt,this.updatedAt=r.updatedAt}));var B=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t){var r;return e(this,a),(r=i.call(this,t)).hasError||(r.totalCount=t.totalCount,r.entries=[],r.totalCount>0&&t.objects.map((function(t){return r.entries.push(new j(t))}))),r}return s(a)}(I),V=function(){function t(){e(this,t)}return s(t,null,[{key:"build",value:function(t){var e=_.get(),r=e.serviceUrl.substr(0,e.serviceUrl.lastIndexOf("/")),n=t.partnerId,i=t.entryId,a=t.ks,o=t.uiConfId,s=t.format,u=t.protocol,c=t.extension,l=t.flavorIds;if(!r||isNaN(Number.parseInt(n))||!i||!s||!u)return"";var f=r;return r.endsWith("/")||(f+="/"),f+="p/"+n+"/sp/"+n+"00/playManifest/entryId/"+i+"/protocol/"+u+"/format/"+s,l?f+="/flavorIds/"+l:o&&(f+="/uiConfId/"+o),""!==a&&(f+="/ks/"+a),""!==c&&(f+="/a."+c),o&&""!==l&&(f+="?uiConfId="+o),f}}]),t}(),F=function(){function t(){e(this,t)}return s(t,null,[{key:"xmlToJson",value:function(t){var e={};if(1===t.nodeType){if(t.attributes.length>0){e["@attributes"]={};for(var r=0;r<t.attributes.length;r++){var n=t.attributes.item(r);e["@attributes"][n.nodeName]=n.nodeValue}}}else 3===t.nodeType&&(e=t.nodeValue);if(t.hasChildNodes())for(var i=0;i<t.childNodes.length;i++){var a=t.childNodes.item(i),o=a.nodeName;if(void 0===e[o])e[o]=this.xmlToJson(a);else{if(void 0===e[o].push){var s=e[o];e[o]=[],e[o].push(s)}e[o].push(this.xmlToJson(a))}}return e}}]),t}(),q={DASH:{name:"dash",mimeType:"application/dash+xml",pathExt:"mpd"},HLS:{name:"hls",mimeType:"application/x-mpegURL",pathExt:"m3u8"},WVM:{name:"wvm",mimeType:"video/wvm",pathExt:"wvm"},MP4:{name:"mp4",mimeType:"video/mp4",pathExt:"mp4"},MP3:{name:"mp3",mimeType:"audio/mpeg",pathExt:"mp3"}},H=new Map([["mpegdash",q.DASH],["applehttp",q.HLS],["url",q.MP4]]);function K(t){var e=H.get(t);return!!e&&e.name===q.MP4.name}var G=function(){function t(){e(this,t),this.progressive=[],this.dash=[],this.hls=[],this.image=[]}return s(t,[{key:"map",value:function(t,e){if(e)switch(e.name){case q.MP4.name:this.progressive.push(t);break;case q.DASH.name:this.dash.push(t);break;case q.HLS.name:this.hls.push(t)}}},{key:"toJSON",value:function(){var t={progressive:[],dash:[],hls:[],image:[]};return this.progressive.forEach((function(e){return t.progressive.push(e.toJSON())})),this.hls.forEach((function(e){return t.hls.push(e.toJSON())})),this.dash.forEach((function(e){return t.dash.push(e.toJSON())})),t.image=this.image,t}}]),t}(),W=function(){function t(){e(this,t),this.metadata=new Map,this.sources=new G,this.type=t.Type.UNKNOWN}return s(t,[{key:"toJSON",value:function(){return{id:this.id,name:this.name,sources:this.sources.toJSON(),duration:this.duration,dvrStatus:this.dvrStatus,status:this.status,metadata:this.metadata,type:this.type,poster:this.poster,assetReferenceType:this.assetReferenceType,downloadUrl:this.downloadUrl}}}]),t}();h(W,"Type",{VOD:"Vod",LIVE:"Live",IMAGE:"Image",AUDIO:"Audio",UNKNOWN:"Unknown"}),h(W,"DvrStatus",{ON:1,OFF:0});var Y=function(){function t(r,n,i){e(this,t),this.licenseUrl=r,this.scheme=n,i&&(this.certificate=i)}return s(t,[{key:"toJSON",value:function(){var t={licenseUrl:this.licenseUrl,scheme:this.scheme};return this.certificate&&(t.certificate=this.certificate),t}}]),t}(),J=function(){function t(){e(this,t)}return s(t,[{key:"toJSON",value:function(){var t={id:this.id,url:this.url,mimetype:this.mimetype};return this.bandwidth&&(t.bandwidth=this.bandwidth),this.width&&(t.width=this.width),this.height&&(t.height=this.height),this.label&&(t.label=this.label),this.drmData&&this.drmData.length>0&&(t.drmData=[],this.drmData.forEach((function(e){Array.isArray(t.drmData)&&t.drmData.push(e.toJSON())}))),t}}]),t}(),X=s((function t(){e(this,t),this.items=[]})),Q=s((function t(){e(this,t),this.items=[]})),Z=s((function t(r){e(this,t),this.url=r.url,this.clickThroughUrl=r.clickThroughUrl})),z={SRT:"1",DFXP:"2",WEBVTT:"3",CAP:"4"},$={3:"vtt",1:"srt"},tt=function(){function t(){e(this,t)}return s(t,null,[{key:"createConfig",value:function(t,e){return t.map((function(t){var r=t.url,n=$[t.format];return[z.DFXP,z.CAP].includes(t.format)&&(r=t.webVttUrl,n=$[z.WEBVTT]),r=nt(r,e),{default:!!t.isDefault,type:n,language:t.languageCode,label:t.label,url:r}}))}}]),t}(),et=function(){function t(r){e(this,t),this.id=r.id,this.url=t.extractBaseThumbnailUrl(r.dataUrl),this.mimetype=""}return s(t,null,[{key:"extractBaseThumbnailUrl",value:function(t){return t.match(".+entry_id/[a-zA-Z0-9_]+/")[0].slice(0,-1)}}]),t}(),rt=function(){function t(){e(this,t)}return s(t,null,[{key:"getMediaEntry",value:function(e,r,n,i){var a=new W,o=i.entry,s=i.playBackContextResult,u=i.metadataListResult,c=s.sources;return a.sources=t._getParsedSources(c,e,r,n,o,s),t._fillBaseData(a,o,u),a.type!==W.Type.LIVE&&_.get().useApiCaptions&&s.data.playbackCaptions&&(a.sources.captions=tt.createConfig(s.data.playbackCaptions,e)),a}},{key:"addKsToUrl",value:function(t,e){var r;return e?(r=-1!==t.split("?")[0].replace(/^.*[\\/]/,"").indexOf(".")?-1===t.indexOf("?")?"?ks=":"&ks=":"/ks/",t+r+e):t}},{key:"getPlaylist",value:function(e){var r=new X,n=e.playlistData,i=e.playlistItems.entries,a=e.playlistUserEntries.entries;return r.id=n.id,r.name=n.name,r.description=n.description,r.poster=n.poster,r.playlistLastEntryId=a.map((function(t){return t.playlistLastEntryId}))[0],i.forEach((function(e){var n=new W;t._fillBaseData(n,e),r.items.push(n)})),r}},{key:"getEntryList",value:function(e){var r=new Q;return e.playlistItems.entries.forEach((function(e){var n=new W;t._fillBaseData(n,e),r.items.push(n)})),r}},{key:"getBumper",value:function(e,r,n){var i=e.playBackContextResult,a=i.bumperData[0];if(a){var o=(a&&a.sources).find((function(t){return K(t.format)}));if(o){var s=t._parseProgressiveSources(o,i,r,n,0,a.entryId);if(s[0])return new Z({url:s[0].url,clickThroughUrl:a.clickThroughUrl})}}}},{key:"_fillBaseData",value:function(e,r,n){return e.poster=r.poster,e.id=r.id,e.duration=r.duration,e.downloadUrl=r.downloadUrl||"",e.metadata=t._parseMetadata(n),e.metadata.description=r.description||"",e.metadata.entryId=r.id||"",e.metadata.name=r.name||"",r.createdAt&&(e.metadata.createdAt=r.createdAt),r.updatedAt&&(e.metadata.updatedAt=r.updatedAt),r.creatorId&&(e.metadata.creatorId=r.creatorId),r.endDate&&(e.metadata.endDate=r.endDate),r.views&&(e.metadata.views=r.views),r.plays&&(e.metadata.plays=r.plays),e.metadata.tags=r.tags||"",e.status=r.status,e.type=t._getEntryType(r.entryType,r.type),e.type===W.Type.LIVE&&(e.dvrStatus=r.dvrStatus),e}},{key:"_getEntryType",value:function(t,e){var r=W.Type.UNKNOWN;switch(t){case T.MediaType.IMAGE.value:r=W.Type.IMAGE;break;case T.MediaType.AUDIO.value:r=W.Type.AUDIO;break;default:switch(e){case T.EntryType.MEDIA_CLIP.value:r=W.Type.VOD;break;case T.EntryType.LIVE_STREAM.value:case T.EntryType.LIVE_CHANNEL.value:r=W.Type.LIVE;break;default:r=W.Type.UNKNOWN}}return r}},{key:"_getParsedSources",value:function(e,r,n,i,a,o){var s,u,c=new G;return a.type===T.EntryType.EXTERNAL_MEDIA.value?((u=new J).mimetype="video/youtube",u.url=a.referenceId,u.id=a.id+"_youtube",c.progressive.push(u)):a.entryType===T.MediaType.IMAGE.value?c.image.push(new et(a)):e&&e.length>0&&(e.filter((function(t){return!K(t.format)})).forEach((function(e){var s=t._parseAdaptiveSource(e,o,r,n,i,a.id);if(s){var u=H.get(e.format);c.map(s,u)}})),s=e.find((function(e){return K(e.format)&&""!==e.getProtocol(t._getBaseProtocol())})),c.progressive=t._parseProgressiveSources(s,o,r,n,i,a.id)),c}},{key:"_parseAdaptiveSource",value:function(e,r,n,i,a,o){var s=new J;if(e){var u="",c=H.get(e.format),l=e.getProtocol(t._getBaseProtocol()),f=e.deliveryProfileId,d=e.format,h="";if(c&&(h=c.pathExt,s.mimetype=c.mimeType),e.hasFlavorIds()?(!h&&r.flavorAssets&&r.flavorAssets.length>0&&(h=r.flavorAssets[0].fileExt),u=V.build({entryId:o,flavorIds:e.flavorIds,format:d,ks:n,partnerId:i,uiConfId:a,extension:h,protocol:l})):u=t.addKsToUrl(e.url,n),!u){var p="failed to create play url from source, discarding source: (".concat(o,"_").concat(f,"), ").concat(d);return t._logger.warn(p),null}if(s.url=u,s.id=o+"_"+f+","+d,e.hasDrmData()){var y=[];e.drm.forEach((function(t){y.push(new Y(t.licenseURL,O.Scheme[t.scheme],t.certificate))})),s.drmData=y}}return s}},{key:"_parseProgressiveSources",value:function(e,r,n,i,a,o){var s=[],u=[];if(e){var c=e.getProtocol(t._getBaseProtocol()),l=e.format,f=e.deliveryProfileId,d=f+","+l;r.flavorAssets.map((function(e){var r=new J;r.id=e.id+d,r.mimetype="mp3"===e.fileExt?"audio/mp3":"video/mp4",r.height=e.height,r.width=e.width,r.bandwidth=1024*e.bitrate,r.label=e.label||e.language;var h=V.build({entryId:o,flavorIds:e.id,format:l,ks:n,partnerId:i,uiConfId:a,extension:e.fileExt,protocol:c});if(""===h)return t._logger.warn("failed to create play url from source, discarding source: (".concat(o,"_").concat(f,"), ").concat(l,".")),null;r.url=h,e.height&&e.width?s.push(r):u.push(r)}))}return u.length&&!s.length?u:s}},{key:"_parseMetadata",value:function(t){var e={};return t&&t.metas&&t.metas.length>0&&t.metas.forEach((function(t){if(t.xml){var r=new DOMParser;t.xml=t.xml.replace(/\r?\n|\r/g,""),t.xml=t.xml.replace(/>\s*/g,">"),t.xml=t.xml.replace(/>\s*/g,">");var n=r.parseFromString(t.xml,"text/xml"),i=F.xmlToJson(n);Object.keys(i.metadata).forEach((function(t){e[t]=i.metadata[t]["#text"]}))}})),e}},{key:"_getBaseProtocol",value:function(){var t=_.get(),e=/^https?:/.exec(t.cdnUrl),r=e?e[0]:document.location.protocol;return"string"==typeof r?r.slice(0,-1):"https"}},{key:"hasBlockAction",value:function(t){return t.playBackContextResult.hasBlockAction()}},{key:"getBlockAction",value:function(t){return t.playBackContextResult.getBlockAction()}},{key:"getErrorMessages",value:function(t){return t.playBackContextResult.getErrorMessages()}}]),t}();h(rt,"_logger",g("OVPProviderParser"));var nt=rt.addKsToUrl,it=rt,at=s((function t(r,n,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e(this,t),this.severity=r,this.category=n,this.code=i,this.data=a,t._logger.error("Category:".concat(n," | Code:").concat(i," |"),a)}));h(at,"Severity",{RECOVERABLE:1,CRITICAL:2}),h(at,"Category",{NETWORK:1,SERVICE:2,PROVIDER:3}),h(at,"Code",{UNSUPPORTED_SCHEME:1e3,BAD_HTTP_STATUS:1001,HTTP_ERROR:1002,TIMEOUT:1003,MALFORMED_DATA_URI:1004,BAD_SERVER_RESPONSE:1005,MULTIREQUEST_API_ERROR:1006,API_RESPONSE_MISMATCH:1007,ERROR:2e3,BLOCK_ACTION:2001,MEDIA_STATUS_NOT_READY:2002,MISSING_MANDATORY_PARAMS:3e3,MISSING_PLAY_SOURCE:3001,METHOD_NOT_IMPLEMENTED:3002}),h(at,"_logger",g("Error"));var ot=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;e(this,t),h(this,"retryConfig",{async:!0,timeout:0,maxAttempts:4}),h(this,"_attemptCounter",1),this.headers=r}return s(t,[{key:"getUrl",value:function(t){return t+"/service/"+this.service+(this.action?"/action/"+this.action:"")}},{key:"doHttpRequest",value:function(){var t=this,e=new Promise((function(e,r){t._requestPromise={resolve:e,reject:r}}));return this.url||this._requestPromise.reject(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.MALFORMED_DATA_URI,{url:this.url})),this._createXHR(),e}},{key:"_createXHR",value:function(){var t=this,e=new XMLHttpRequest;e.onreadystatechange=function(){if(4===e.readyState&&200===e.status)try{var r=JSON.parse(e.responseText);return t.responseHeaders=t._getResponseHeaders(e),t._requestPromise.resolve(r)}catch(r){t._requestPromise.reject(t._createError(e,at.Code.BAD_SERVER_RESPONSE,{text:e.responseText}))}},e.open(this.method,this.url,this.retryConfig.async),this.retryConfig.async&&this.retryConfig.timeout&&(e.timeout=this.retryConfig.timeout);var r=performance.now();e.ontimeout=function(){t._handleError(e,at.Code.TIMEOUT,{timeout:(performance.now()-r)/1e3,statusText:e.statusText})},e.onerror=e.onabort=function(){t._handleError(e,at.Code.HTTP_ERROR,{text:e.responseText,statusText:e.statusText})},this.headers.forEach((function(t,r){e.setRequestHeader(r,t)})),e.send(this.params)}},{key:"_getResponseHeaders",value:function(t){return t.getAllResponseHeaders().split("\n").filter((function(t){return 0===t.toLowerCase().indexOf("x-")}))}},{key:"_handleError",value:function(t,e,r){var n=this._createError(t,e,r);if(t.onreadystatechange=function(){},t.onerror=function(){},t.ontimeout=function(){},t.onabort=function(){},!(this.retryConfig.maxAttempts&&this._attemptCounter<this.retryConfig.maxAttempts))return this._requestPromise.reject(n);this._attemptCounter++,this._createXHR()}},{key:"_createError",value:function(t,e,r){return Object.assign(r,{url:this.url,headers:this._getResponseHeaders(t),attempt:this._attemptCounter}),new at(at.Severity.CRITICAL,at.Category.NETWORK,e,r)}}]),t}();var st=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(){var t;e(this,a);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return h(u(t=i.call.apply(i,[this].concat(n))),"requests",[]),t}return s(a,[{key:"add",value:function(t){this.requests.push(t);var e={},r={service:t.service,action:t.action};return Object.assign(e,h({},this.requests.length,Object.assign(r,t.params))),Object.assign(e,this.params),this.params=e,this}},{key:"execute",value:function(t){var e=this;return new Promise((function(r,n){try{e.params=JSON.stringify(e.params)}catch(t){a._logger.error("".concat(t.message)),n(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.FAILED_PARSING_REQUEST,{error:t,params:e.params}))}e.doHttpRequest().then((function(i){var a=new ut(i,t);a.success?r({headers:e.responseHeaders,response:a}):n(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.MULTIREQUEST_API_ERROR,{url:e.url,headers:e.responseHeaders,results:a.results}))}),(function(t){n(t)}))}))}}]),a}(ot);h(st,"_logger",g("MultiRequestBuilder"));var ut=s((function t(r){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e(this,t),h(this,"results",[]);var i=r.result?r.result:r,a=(Array.isArray(i)?i:[i]).map((function(t){return new I(t)})),o=a.filter((function(t){return t.hasError}));o.forEach((function(e){t._logger.error("Service returned an error with error code: ".concat(e.error.code," and message: ").concat(e.error.message,"."))})),this.results=a,n&&o.length||o.length===this.results.length?this.success=!1:(this.results=this.results.filter((function(t){return!t.hasError})),this.success=!0)}));h(ut,"_logger",g("MultiRequestResult"));var ct=function(){function t(){e(this,t)}return s(t,null,[{key:"getMultiRequest",value:function(t,e,r){var n=_.get(),i=n.serviceParams;Object.assign(i,{ks:e,clientTag:"html5:v"+t}),r&&Object.assign(i,{partnerId:r});var a=new Map;a.set("Content-Type","application/json");var o=new st(a);return o.method="POST",o.service="multirequest",o.url=o.getUrl(n.serviceUrl),o.params=i,o}}]),t}(),lt=s((function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t),this.type=r.type||t.Type.INCLUDE_FIELDS,this.fields=r.fields||"id,referenceId,name,description,thumbnailUrl,dataUrl,duration,msDuration,flavorParamsIds,mediaType,type,tags,dvrStatus,externalSourceType,status,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"}));h(lt,"Type",{INCLUDE_FIELDS:1,EXCLUDE_FIELDS:2});var ft="baseEntry",dt=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(){return e(this,a),i.apply(this,arguments)}return s(a,null,[{key:"getPlaybackContext",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new ot(n);return i.service=ft,i.action="getPlaybackContext",i.method="POST",i.url=i.getUrl(t),i.tag="baseEntry-getPlaybackContext",i.params={entryId:r,ks:e,contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},i}},{key:"list",value:function(t,e,r,n,i){var o=new Map;o.set("Content-Type","application/json");var s=new ot(o);return s.service=ft,s.action="list",s.method="POST",s.url=s.getUrl(t),s.tag="list",s.params=a.getEntryListReqParams(r,e,n,i),s}},{key:"getEntryListReqParams",value:function(t,e,r,n){var i={};return t?i=r?{redirectFromEntryId:t}:{idEqual:t}:n&&(i={objectType:"KalturaBaseEntryFilter",referenceIdEqual:n}),{ks:e,filter:i,responseProfile:new lt}}}]),a}(ct);var ht=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(){return e(this,a),i.apply(this,arguments)}return s(a,null,[{key:"list",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new ot(n);i.service="metadata_metadata",i.action="list",i.method="POST",i.url=i.getUrl(t),i.tag="metadata_metadata-list";var a={objectType:"KalturaMetadataFilter",objectIdEqual:r,metadataObjectTypeEqual:"1"};return i.params={filter:a,ks:e},i}}]),a}(ct),pt=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._entryId=r.entryId,this._referenceId=r.referenceId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){var e=new A(t[0].data);this._response.entry=e.entries[0],this._response.playBackContextResult=new M(t[1].data),this._response.metadataListResult=new D(t[2].data)}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];r.push(dt.list(e.serviceUrl,t.ks,t.entryId,t.redirectFromEntryId,t.referenceId));var n="{1:result:ks}"===t.ks?"{2:result:objects:0:id}":"{1:result:objects:0:id}";return r.push(dt.getPlaybackContext(e.serviceUrl,t.ks,n)),r.push(ht.list(e.serviceUrl,t.ks,n)),r}},{key:"isValid",value:function(){return!(!this._entryId&&!this._referenceId)}}],[{key:"id",get:function(){return"media"}}]),t}();var yt=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(){return e(this,a),i.apply(this,arguments)}return s(a,null,[{key:"anonymousSession",value:function(t,e){var r=new Map;r.set("Content-Type","application/json");var n=new ot(r);return n.service="session",n.action="startWidgetSession",n.method="POST",n.url=n.getUrl(t),n.tag="session-startWidget",n.params={widgetId:e},n}}]),a}(ct),vt=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._widgetId=r.widgetId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response.ks},set:function(t){this._response.ks=t[0].data.ks}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return r.push(yt.anonymousSession(e.serviceUrl,t.widgetId)),r}},{key:"isValid",value:function(){return!!this._widgetId}}],[{key:"id",get:function(){return"session"}}]),t}();var gt=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t,r){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3?arguments[3]:void 0;return e(this,a),(n=i.call(this,s))._multiRequest=ct.getMultiRequest(t,o,r),n}return s(a)}(function(){function t(r){e(this,t),h(this,"_loadersResponseMap",new Map),h(this,"_loaders",new Map),this._networkRetryConfig=r}return s(t,[{key:"add",value:function(t,e,r){var n=this,i=new t(e);if(i.isValid()){this._loaders.set(t.id,i);var a=this._multiRequest.requests.length,o=i.requests;this._multiRequest.retryConfig=this._networkRetryConfig,o.forEach((function(t){t.params=t.params||{},t.params.ks=t.params.ks||r,n._multiRequest.add(t)}));var s=Array.from(new Array(o.length),(function(t,e){return e+a}));this._loadersResponseMap.set(t.id,s)}}},{key:"fetchData",value:function(t){var e=this;return new Promise((function(r,n){e._multiRequest.execute(t).then((function(t){e._multiResponse=t.response,e.prepareData(t.response).success?r(e._loaders):n(new at(at.Severity.CRITICAL,at.Category.NETWORK,at.Code.API_RESPONSE_MISMATCH,{headers:t.headers}))}),(function(t){n(t)}))}))}},{key:"prepareData",value:function(t){var e=this;return this._loaders.forEach((function(r,n){var i=e._loadersResponseMap.get(n);try{i&&i.length>0&&(r.response=t.results.slice(i[0],i[i.length-1]+1))}catch(t){return{success:!1,error:t}}})),{success:!0,data:this._loaders}}}]),t}());var mt="playlist",Et=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(){return e(this,a),i.apply(this,arguments)}return s(a,null,[{key:"execute",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new ot(n);return i.service=mt,i.action="execute",i.method="POST",i.url=i.getUrl(t),i.tag="".concat(mt,"-execute"),i.params={ks:e,id:r,responseProfile:new lt},i}},{key:"get",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new ot(n);return i.service=mt,i.action="get",i.method="POST",i.url=i.getUrl(t),i.tag="".concat(mt,"-get"),i.params={ks:e,id:r,responseProfile:{fields:"id,name,description,thumbnailUrl",type:1}},i}},{key:"getLastEntryId",value:function(t,e,r){var n=new Map;n.set("Content-Type","application/json");var i=new ot(n);return i.service="userEntry",i.action="list",i.method="POST",i.url=i.getUrl(t),i.tag="userEntry-list",i.params={ks:e,filter:{objectType:"KalturaViewHistoryUserEntry",entryIdEqual:r,userIdEqualCurrent:1},responseProfile:{fields:"playlistLastEntryId",type:1}},i}}]),a}(ct),_t=function(){function t(r){e(this,t),h(this,"_response",{}),this.requests=this.buildRequests(r),this._playlistId=r.playlistId}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){this._response.playlistData=new N(t[0].data),this._response.playlistItems=new S(t[1].data),this._response.playlistUserEntries=new B(t[2].data)}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return r.push(Et.get(e.serviceUrl,t.ks,t.playlistId)),r.push(Et.execute(e.serviceUrl,t.ks,t.playlistId)),r.push(Et.getLastEntryId(e.serviceUrl,t.ks,t.playlistId)),r}},{key:"isValid",value:function(){return!!this._playlistId}}],[{key:"id",get:function(){return"playlist"}}]),t}(),It=function(){function t(r,n){e(this,t),h(this,"_networkRetryConfig",{async:!0,timeout:0,maxAttempts:4}),function(t){t&&"function"==typeof t.getLogger&&(p.get=t.getLogger),t&&t.LogLevel&&(y=t.LogLevel)}(r.logger),this._partnerId=r.partnerId,this._widgetId=r.widgetId,this._uiConfId=r.uiConfId,this._isAnonymous=!r.ks,this._ks=r.ks||"",this._playerVersion=n}return s(t,[{key:"partnerId",get:function(){return this._partnerId}},{key:"widgetId",get:function(){return this._widgetId||this.defaultWidgetId}},{key:"defaultWidgetId",get:function(){return"_"+this._partnerId}},{key:"uiConfId",get:function(){return this._uiConfId}},{key:"ks",get:function(){return this._ks},set:function(t){this._ks=t}},{key:"playerVersion",get:function(){return this._playerVersion}},{key:"isAnonymous",get:function(){return this._isAnonymous}},{key:"getMediaConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"getMediaConfig method must be implement by the derived class"}))}},{key:"getPlaylistConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading playlist by id"}))}},{key:"getEntryListConfig",value:function(t){return Promise.reject(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.METHOD_NOT_IMPLEMENTED,{message:"The provider does not support loading entry list"}))}},{key:"_verifyHasSources",value:function(t){if(0===t.hls.concat(t.dash,t.progressive,t.image).length)throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.MISSING_PLAY_SOURCE,{action:"",messages:"No play source for entry id: ".concat(t.id)})}},{key:"LogLevel",get:function(){return y}},{key:"getLogLevel",value:function(t){return function(t){return v(t).getLevel()}(t)}},{key:"setLogLevel",value:function(t,e){!function(t,e){v(e).setLevel(t)}(t,e)}}]),t}(),Rt=function(){function t(r){e(this,t),h(this,"_response",{playlistItems:{entries:[]}}),this.requests=this.buildRequests(r),this._entries=r.entries}return s(t,[{key:"requests",get:function(){return this._requests},set:function(t){this._requests=t}},{key:"response",get:function(){return this._response},set:function(t){var e,r=this;t.forEach((function(t){e=new A(t.data),r._response.playlistItems.entries.push(e.entries[0])}))}},{key:"buildRequests",value:function(t){var e=_.get(),r=[];return t.entries.forEach((function(n){r.push(dt.list(e.serviceUrl,t.ks,n.entryId||n,t.redirectFromEntryId,n.referenceId))})),r}},{key:"isValid",value:function(){return!(!this._entries||!this._entries.length)}}],[{key:"id",get:function(){return"entry_list"}}]),t}();function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function At(t){return function(t){if(Array.isArray(t))return Tt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(t,e,r,n,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Ct(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function o(t){wt(a,n,i,o,s,"next",t)}function s(t){wt(a,n,i,o,s,"throw",t)}o(void 0)}))}}var Ot=r(687),kt=r.n(Ot),bt=function(){function t(){e(this,t)}var r,n;return s(t,null,[{key:"_applyRegexAction",value:function(t,e){if(t){var r=new RegExp(t.pattern,"i");if(e.match(r))return e.replace(r,t.replacement+"/")}return e}},{key:"_isECDNUrlAlive",value:(n=Ct(kt().mark((function e(r,n){var i,a;return kt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n+"/api_v3/service/system/action/ping/format/1",(a=new XMLHttpRequest).open("GET",i),a.timeout=r.checkAliveTimeoutMs,a.onreadystatechange=function(){return 4===a.readyState&&200===a.status},a.ontimeout=function(){return t._logger.warn("Got timeout while pinging the ECDN url. the ping url: ".concat(i)),!1},a.send(),e.abrupt("return",!1);case 8:case"end":return e.stop()}}),e)}))),function(t,e){return n.apply(this,arguments)})},{key:"handleRegexAction",value:(r=Ct(kt().mark((function e(r,n){var i,a,o;return kt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=_.get().cdnUrl,a=t._extractRegexActionFromData(n),o=t._getRegExp(a),e.t0=i&&a&&o&&i.match(o),!e.t0){e.next=11;break}if(e.t1=a.checkAliveTimeoutMs>0,!e.t1){e.next=10;break}return e.next=9,t._isECDNUrlAlive(a,i.replace(o,a.replacement));case 9:e.t1=!e.sent;case 10:e.t0=!e.t1;case 11:if(!e.t0){e.next=14;break}return t._replaceHostUrls(r,a),e.abrupt("return",r);case 14:return t._logger.debug("exiting handleRegexAction - not applying regex action."),e.abrupt("return",r);case 16:case"end":return e.stop()}}),e)}))),function(t,e){return r.apply(this,arguments)})},{key:"_replaceHostUrls",value:function(e,r){t._logger.debug("Starting to modify urls...");var n=e.sources,i=n.hls,a=n.dash,o=n.progressive,s=n.image;[].concat(At(i),At(a),At(o),At(s)).forEach((function(e){return e.url=t._applyRegexAction(r,e.url)})),_.get().replaceHostOnlyManifestUrls||(t._logger.debug("replaceHostOnlyManifestUrls flag is off - modifying captions and poster URLs"),n.captions&&n.captions.forEach((function(e){return e.url=t._applyRegexAction(r,e.url)})),"string"==typeof n.poster&&(n.poster=t._applyRegexAction(r,n.poster))),t._logger.debug("Finished modifying urls")}},{key:"_extractRegexActionFromData",value:function(t){var e;return null===(e=t.get(pt.id))||void 0===e||null===(e=e.response)||void 0===e?void 0:e.playBackContextResult.getRequestHostRegexAction()}},{key:"_getRegExp",value:function(t){if(t&&t.pattern&&t.replacement)return new RegExp(t.pattern,"i")}}]),t}();h(bt,"_logger",g("RegexActionHandler"));var Pt=bt;var St=function(t){l(a,t);var r,n,i=(r=a,n=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(t){return!1}}(),function(){var t,e=d(r);if(n){var i=d(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return f(this,t)});function a(t,r){var n;return e(this,a),h(u(n=i.call(this,t,r)),"_filterOptionsConfig",{redirectFromEntryId:!0}),n._logger=g("OVPProvider"),_.set(t.env),n._setFilterOptionsConfig(t.filterOptions),n._networkRetryConfig=Object.assign(n._networkRetryConfig,t.networkRetryParameters),n}return s(a,[{key:"env",get:function(){return _.get()}},{key:"getMediaConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.entryId,a=t.referenceId;if(i||a){var o=e.ks;o||(o="{1:result:ks}",e._dataLoader.add(vt,{widgetId:e.widgetId}));var s=e._getEntryRedirectFilter(t);return e._dataLoader.add(pt,{entryId:i,ks:o,redirectFromEntryId:s,referenceId:a}),e._dataLoader.fetchData().then((function(t){try{var i=e._parseDataFromResponse(t);Pt.handleRegexAction(i,t).then(r)}catch(t){n(t)}}),(function(t){n(t)}))}n(new at(at.Severity.CRITICAL,at.Category.PROVIDER,at.Code.MISSING_MANDATORY_PARAMS,{message:"missing entry id"}))}))}},{key:"doRequest",value:function(t,e){var r=this,n=e||this.ks,i=new gt(this.playerVersion,this.partnerId,n,this._networkRetryConfig);return new Promise((function(e,a){return n||i.add(vt,{widgetId:r.widgetId}),t.forEach((function(t){i.add(t.loader,t.params,n||"{1:result:ks}")})),i.fetchData().then((function(t){try{e(t)}catch(t){a(t)}}),(function(t){a(t)}))}))}},{key:"_getEntryRedirectFilter",value:function(t){return"boolean"==typeof t.redirectFromEntryId?t.redirectFromEntryId:"boolean"!=typeof this._filterOptionsConfig.redirectFromEntryId||this._filterOptionsConfig.redirectFromEntryId}},{key:"_setFilterOptionsConfig",value:function(t){t&&"boolean"==typeof t.redirectFromEntryId&&(this._filterOptionsConfig.redirectFromEntryId=t.redirectFromEntryId)}},{key:"_parseDataFromResponse",value:function(t){this._logger.debug("Data parsing started");var e={session:{isAnonymous:this._isAnonymous,partnerId:this.partnerId},sources:this._getDefaultSourcesObject(),plugins:{}};if(this.uiConfId&&(e.session.uiConfId=this.uiConfId),t){if(t.has(vt.id)){var r=t.get(vt.id);r&&r.response&&(e.session.ks=r.response,this.widgetId!==this.defaultWidgetId&&(this.ks=e.session.ks))}else e.session.ks=this.ks;if(t.has(pt.id)){var n=t.get(pt.id);if(n&&n.response){var i=n.response;if(it.hasBlockAction(i))throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.BLOCK_ACTION,{action:it.getBlockAction(i),messages:it.getErrorMessages(i)});var a=it.getMediaEntry(this.isAnonymous?"":this.ks,this.partnerId,this.uiConfId,i);Object.assign(e.sources,this._getSourcesObject(a)),this._verifyMediaStatus(a),this._verifyHasSources(e.sources);var o=it.getBumper(i,this.isAnonymous?"":this.ks,this.partnerId);o&&Object.assign(e.plugins,{bumper:o})}}}return this._logger.debug("Data parsing finished",e),e}},{key:"_verifyMediaStatus",value:function(t){if([T.EntryStatus.IMPORT,T.EntryStatus.PRECONVERT].includes(t.status))throw new at(at.Severity.CRITICAL,at.Category.SERVICE,at.Code.MEDIA_STATUS_NOT_READY,{messages:"Status of entry id ".concat(t.id," is ").concat(t.status," and is still being imported or converted"),data:{status:status}})}},{key:"getPlaylistConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.playlistId;if(i){var a=e.ks;a||(a="{1:result:ks}",e._dataLoader.add(vt,{widgetId:e.widgetId})),e._dataLoader.add(_t,{playlistId:i,ks:a}),e._dataLoader.fetchData().then((function(t){r(e._parsePlaylistDataFromResponse(t))}),(function(t){n(t)}))}else n({success:!1,data:"Missing mandatory parameter"})}))}},{key:"_parsePlaylistDataFromResponse",value:function(t){var e=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(t&&t.has(_t.id)){var n=t.get(_t.id);if(n&&n.response){var i=it.getPlaylist(n.response);r.id=i.id,r.poster=i.poster,r.metadata.name=i.name,r.metadata.description=i.description,r.playlistLastEntryId=i.playlistLastEntryId,i.items.forEach((function(t){return r.items.push({sources:e._getSourcesObject(t)})}))}}return this._logger.debug("Data parsing finished",r),r}},{key:"getEntryListConfig",value:function(t){var e=this;return t.ks&&(this.ks=t.ks,this._isAnonymous=!1),this.widgetId!==this.defaultWidgetId&&(this._isAnonymous=!1),this._dataLoader=new gt(this.playerVersion,this.partnerId,this.ks,this._networkRetryConfig),new Promise((function(r,n){var i=t.entries;if(i&&i.length){var a=e.ks;a||(a="{1:result:ks}",e._dataLoader.add(vt,{widgetId:e.widgetId}));var o=e._getEntryRedirectFilter(t);e._dataLoader.add(Rt,{entries:i,ks:a,redirectFromEntryId:o}),e._dataLoader.fetchData(!1).then((function(t){r(e._parseEntryListDataFromResponse(t))}),(function(t){n(t)}))}else n({success:!1,data:"Missing mandatory parameter"})}))}},{key:"_parseEntryListDataFromResponse",value:function(t){var e=this;this._logger.debug("Data parsing started");var r=this._getPlaylistObject();if(t&&t.has(Rt.id)){var n=t.get(Rt.id);n&&n.response&&it.getEntryList(n.response).items.forEach((function(t){return r.items.push({sources:e._getSourcesObject(t)})}))}return this._logger.debug("Data parsing finished",r),r}},{key:"_getPlaylistObject",value:function(){return{id:"",metadata:{name:"",description:""},poster:"",playlistLastEntryId:"",items:[]}}},{key:"_getDefaultSourcesObject",value:function(){return{hls:[],dash:[],progressive:[],image:[],id:"",duration:0,type:W.Type.UNKNOWN,poster:"",dvr:!1,vr:null,metadata:{name:"",description:"",tags:""}}}},{key:"_getSourcesObject",value:function(t){var e=this._getDefaultSourcesObject(),r=t.sources.toJSON();return e.hls=r.hls,e.dash=r.dash,e.progressive=r.progressive,e.image=r.image,e.id=t.id,e.duration=t.duration,e.type=t.type,e.dvr=!!t.dvrStatus,e.poster=t.poster,e.downloadUrl=t.downloadUrl,t.sources.captions&&(e.captions=t.sources.captions),t.metadata&&"string"==typeof t.metadata.tags&&t.metadata.tags.split(", ").includes("360")&&(e.vr={}),Object.assign(e.metadata,t.metadata),e}}]),a}(It),Lt="@playkit-js/playkit-js-providers-ovp",Dt="2.40.2-canary.0-45b4098"}(),n}()}));
2
3
  //# sourceMappingURL=playkit-ovp-provider.js.map
@@ -0,0 +1 @@
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */