@clickview/player 1.42.0-rc.1 → 1.42.0-rc.3
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.
|
@@ -285,7 +285,7 @@ ${Z0(e)}`),r.map&&!r.map.bytes&&(this.logger_("going to request init segment."),
|
|
|
285
285
|
</svg>
|
|
286
286
|
`;class EL extends DLe{constructor(e,r){super(e,r)}createEl(){const e=ALe.prototype.createEl.call(this,"button",{className:this.buildCSSClass()},{type:"button",title:this.controlText_});return e.innerHTML=OLe,this.createControlTextEl(e),e}handleClick(e){var r;e.stopPropagation(),e.preventDefault(),(r=this.options_)!=null&&r.onClick&&this.options_.onClick()}buildCSSClass(){return"cv-remove-video-button"}}it.registerComponent("removeVideoButton",EL),EL.prototype.controlText_="Remove from watch history";class ET{static getKnownProfiles(){return["1080","720","480","360","240"]}static enableProfileOrNextBest(e,r){let n=e.getQualityLevelById(r);if(n||(n=this.getNextBestQuality(e,r)),!n)return null;for(let i=0;i<e.length;i++){const a=e[i];a.enabled=n.id===a.id}return n}static getNextBestQuality(e,r){const n=this.getKnownProfiles(),i=n.indexOf(r);if(i>=0){for(let a=i+1;a<n.length;a++){const s=n[a],o=e.getQualityLevelById(s);if(o)return o}for(let a=i-1;a>0;a--){const s=n[a],o=e.getQualityLevelById(s);if(o)return o}}return null}}var CL=(t=>(t.Default="play",t.Hover="hover",t))(CL||{});const MLe=it.getPlugin("plugin"),ree="cv-preview-mode",nee="cv-force-16-9";class ILe extends MLe{constructor(e,r){super(e),this.hasSeeked=!1,this.buttonAdded=!1,this.mode=null,this.defaultDisplayMode="normal",this.onQualityReady=null,r!=null&&r.defaultDisplayMode&&(this.defaultDisplayMode=r.defaultDisplayMode),r!=null&&r.startTime&&(this.startTime=r.startTime),this.onSeek=this.onSeek.bind(this),this.player.one("seeking",this.onSeek)}onSeek(){this.hasSeeked=!0}dispose(){this.cleanupQualityListener(),this.player.off("seeking",this.onSeek),super.dispose()}getMode(){return this.mode}isHovering(){return this.mode==="hover"}setPlayerMode(e,r,n){this.player.trigger("flushprogress");const i=this.mode;if(this.mode=e,e==="hover"){this.buttonAdded||this.addButtons(r,n),this.player.addClass(ree),this.applyAspectRatioFix(),this.enableSubtitles(),this.mute(),this.setLowQuality(),this.removeActivityTimeout(),this.player.trigger("resize");return}i==="hover"&&(this.applyDefaultModeLayout(),this.player.removeClass(ree),this.player.removeClass(nee),this.disableSubtitles(),this.unmute(),this.cleanupQualityListener(),this.restorePreviousQuality(),this.restoreActivityTimeout(),this.player.trigger("resize"),this.hasSeeked||(this.player.currentTime(this.startTime??0),this.hasSeeked=!1))}applyDefaultModeLayout(){var e,r;this.defaultDisplayMode==="theatre"?((e=this.player.theatreModePlugin())==null||e.toggleTheatreMode(!0),this.player.fill(!0)):((r=this.player.theatreModePlugin())==null||r.toggleTheatreMode(!1),this.player.fluid(!0))}applyAspectRatioFix(){const e=()=>{const r=this.player.videoWidth(),n=this.player.videoHeight();if(r>0&&n>0){const i=r/n;Math.abs(i-16/9)<.01||this.player.addClass(nee)}};this.player.readyState()>=1?e():this.player.one("loadedmetadata",e)}addButtons(e,r){const n=new TL(this.player),i=new tee(this.player,{onClickHandler:e}),a=new EL(this.player,{onClick:r});r&&sc.isFunction(r)&&this.player.addChild(a),this.player.addChild(n),this.player.addChild(i),this.buttonAdded=!0}enableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}setLowQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().disable();const e=this.player.qualityLevels();if(e.length>0){this.switchToLowestQuality(e);return}this.cleanupQualityListener(),this.onQualityReady=()=>{this.onQualityReady=null,this.switchToLowestQuality(e)},e.one("change",this.onQualityReady)})}cleanupQualityListener(){this.onQualityReady&&(this.player.qualityLevels().off("change",this.onQualityReady),this.onQualityReady=null)}switchToLowestQuality(e){const r=this.getLowestAvailableQuality(e);r&&ET.enableProfileOrNextBest(e,r.id)}getLowestAvailableQuality(e){const r=[...ET.getKnownProfiles()].reverse();for(const n of r){const i=e.getQualityLevelById(n);if(i)return i}return null}restorePreviousQuality(){this.player.dataLoaded(()=>{this.player.persistQualitySettingsPlugin().applyUserPreferences(),this.player.persistQualitySettingsPlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}it.registerPlugin("playerModePlugin",ILe);const iee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function aee(t,e,r,n){let i,a,s;const o=e||[0],l=(r=r||0)>>>3,u=n===-1?3:0;for(i=0;i<t.length;i+=1)s=i+l,a=s>>>2,o.length<=a&&o.push(0),o[a]|=t[i]<<8*(u+n*(s%4));return{value:o,binLen:8*t.length+r}}function wL(t,e,r){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":return function(n,i,a){return(function(s,o,l,u){let f,h,p,y;if(s.length%2!=0)throw new Error("String of HEX type must be in byte increments");const v=o||[0],b=(l=l||0)>>>3,S=u===-1?3:0;for(f=0;f<s.length;f+=2){if(h=parseInt(s.substr(f,2),16),isNaN(h))throw new Error("String of HEX type contains invalid characters");for(y=(f>>>1)+b,p=y>>>2;v.length<=p;)v.push(0);v[p]|=h<<8*(S+u*(y%4))}return{value:v,binLen:4*s.length+l}})(n,i,a,r)};case"TEXT":return function(n,i,a){return(function(s,o,l,u,f){let h,p,y,v,b,S,k,M,P=0;const z=l||[0],j=(u=u||0)>>>3;if(o==="UTF8")for(k=f===-1?3:0,y=0;y<s.length;y+=1)for(h=s.charCodeAt(y),p=[],128>h?p.push(h):2048>h?(p.push(192|h>>>6),p.push(128|63&h)):55296>h||57344<=h?p.push(224|h>>>12,128|h>>>6&63,128|63&h):(y+=1,h=65536+((1023&h)<<10|1023&s.charCodeAt(y)),p.push(240|h>>>18,128|h>>>12&63,128|h>>>6&63,128|63&h)),v=0;v<p.length;v+=1){for(S=P+j,b=S>>>2;z.length<=b;)z.push(0);z[b]|=p[v]<<8*(k+f*(S%4)),P+=1}else for(k=f===-1?2:0,M=o==="UTF16LE"&&f!==1||o!=="UTF16LE"&&f===1,y=0;y<s.length;y+=1){for(h=s.charCodeAt(y),M===!0&&(v=255&h,h=v<<8|h>>>8),S=P+j,b=S>>>2;z.length<=b;)z.push(0);z[b]|=h<<8*(k+f*(S%4)),P+=2}return{value:z,binLen:8*P+u}})(n,e,i,a,r)};case"B64":return function(n,i,a){return(function(s,o,l,u){let f,h,p,y,v,b,S,k=0;const M=o||[0],P=(l=l||0)>>>3,z=u===-1?3:0,j=s.indexOf("=");if(s.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(s=s.replace(/=/g,""),j!==-1&&j<s.length)throw new Error("Invalid '=' found in base-64 string");for(h=0;h<s.length;h+=4){for(v=s.substr(h,4),y=0,p=0;p<v.length;p+=1)f=iee.indexOf(v.charAt(p)),y|=f<<18-6*p;for(p=0;p<v.length-1;p+=1){for(S=k+P,b=S>>>2;M.length<=b;)M.push(0);M[b]|=(y>>>16-8*p&255)<<8*(z+u*(S%4)),k+=1}}return{value:M,binLen:8*k+l}})(n,i,a,r)};case"BYTES":return function(n,i,a){return(function(s,o,l,u){let f,h,p,y;const v=o||[0],b=(l=l||0)>>>3,S=u===-1?3:0;for(h=0;h<s.length;h+=1)f=s.charCodeAt(h),y=h+b,p=y>>>2,v.length<=p&&v.push(0),v[p]|=f<<8*(S+u*(y%4));return{value:v,binLen:8*s.length+l}})(n,i,a,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(n,i,a){return(function(s,o,l,u){return aee(new Uint8Array(s),o,l,u)})(n,i,a,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(n,i,a){return aee(n,i,a,r)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function see(t,e,r,n){switch(t){case"HEX":return function(i){return(function(a,s,o,l){let u,f,h="";const p=s/8,y=o===-1?3:0;for(u=0;u<p;u+=1)f=a[u>>>2]>>>8*(y+o*(u%4)),h+="0123456789abcdef".charAt(f>>>4&15)+"0123456789abcdef".charAt(15&f);return l.outputUpper?h.toUpperCase():h})(i,e,r,n)};case"B64":return function(i){return(function(a,s,o,l){let u,f,h,p,y,v="";const b=s/8,S=o===-1?3:0;for(u=0;u<b;u+=3)for(p=u+1<b?a[u+1>>>2]:0,y=u+2<b?a[u+2>>>2]:0,h=(a[u>>>2]>>>8*(S+o*(u%4))&255)<<16|(p>>>8*(S+o*((u+1)%4))&255)<<8|y>>>8*(S+o*((u+2)%4))&255,f=0;f<4;f+=1)v+=8*u+6*f<=s?iee.charAt(h>>>6*(3-f)&63):l.b64Pad;return v})(i,e,r,n)};case"BYTES":return function(i){return(function(a,s,o){let l,u,f="";const h=s/8,p=o===-1?3:0;for(l=0;l<h;l+=1)u=a[l>>>2]>>>8*(p+o*(l%4))&255,f+=String.fromCharCode(u);return f})(i,e,r)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch{throw new Error("ARRAYBUFFER not supported by this environment")}return function(i){return(function(a,s,o){let l;const u=s/8,f=new ArrayBuffer(u),h=new Uint8Array(f),p=o===-1?3:0;for(l=0;l<u;l+=1)h[l]=a[l>>>2]>>>8*(p+o*(l%4))&255;return f})(i,e,r)};case"UINT8ARRAY":try{new Uint8Array(0)}catch{throw new Error("UINT8ARRAY not supported by this environment")}return function(i){return(function(a,s,o){let l;const u=s/8,f=o===-1?3:0,h=new Uint8Array(u);for(l=0;l<u;l+=1)h[l]=a[l>>>2]>>>8*(f+o*(l%4))&255;return h})(i,e,r)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function oee(t){const e={outputUpper:!1,b64Pad:"=",outputLen:-1},r=t||{},n="Output length must be a multiple of 8";if(e.outputUpper=r.outputUpper||!1,r.b64Pad&&(e.b64Pad=r.b64Pad),r.outputLen){if(r.outputLen%8!=0)throw new Error(n);e.outputLen=r.outputLen}else if(r.shakeLen){if(r.shakeLen%8!=0)throw new Error(n);e.outputLen=r.shakeLen}if(typeof e.outputUpper!="boolean")throw new Error("Invalid outputUpper formatting option");if(typeof e.b64Pad!="string")throw new Error("Invalid b64Pad formatting option");return e}function eb(t,e){return t<<e|t>>>32-e}function lee(t,e,r){return t^e^r}function NLe(t,e,r){return t&e^t&r^e&r}function CT(t,e){const r=(65535&t)+(65535&e);return(65535&(t>>>16)+(e>>>16)+(r>>>16))<<16|65535&r}function Ok(t,e,r,n,i){const a=(65535&t)+(65535&e)+(65535&r)+(65535&n)+(65535&i);return(65535&(t>>>16)+(e>>>16)+(r>>>16)+(n>>>16)+(i>>>16)+(a>>>16))<<16|65535&a}function RLe(t){return[1732584193,4023233417,2562383102,271733878,3285377520]}function uee(t,e){let r,n,i,a,s,o,l;const u=[];for(r=e[0],n=e[1],i=e[2],a=e[3],s=e[4],l=0;l<80;l+=1)u[l]=l<16?t[l]:eb(u[l-3]^u[l-8]^u[l-14]^u[l-16],1),o=l<20?Ok(eb(r,5),(f=n)&i^~f&a,s,1518500249,u[l]):l<40?Ok(eb(r,5),lee(n,i,a),s,1859775393,u[l]):l<60?Ok(eb(r,5),NLe(n,i,a),s,2400959708,u[l]):Ok(eb(r,5),lee(n,i,a),s,3395469782,u[l]),s=a,a=i,i=eb(n,30),n=r,r=o;var f;return e[0]=CT(r,e[0]),e[1]=CT(n,e[1]),e[2]=CT(i,e[2]),e[3]=CT(a,e[3]),e[4]=CT(s,e[4]),e}function LLe(t,e,r,n){let i;const a=15+(e+65>>>9<<4),s=e+r;for(;t.length<=a;)t.push(0);for(t[e>>>5]|=128<<24-e%32,t[a]=4294967295&s,t[a-1]=s/4294967296|0,i=0;i<t.length;i+=16)n=uee(t.slice(i,i+16),n);return n}class PLe extends class{constructor(e,r,n){const i=n||{};if(this.t=r,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.s=e,this.o=[],this.h=0,this.u=!1,this.l=0,this.A=!1,this.p=[],this.R=[]}update(e){let r,n=0;const i=this.U>>>5,a=this.T(e,this.o,this.h),s=a.binLen,o=a.value,l=s>>>5;for(r=0;r<l;r+=i)n+this.U<=s&&(this.F=this.m(o.slice(r,r+i),this.F),n+=this.U);this.l+=n,this.o=o.slice(n>>>5),this.h=s%this.U,this.u=!0}getHash(e,r){let n,i,a=this.g;const s=oee(r);if(this.B){if(s.outputLen===-1)throw new Error("Output length must be specified in options");a=s.outputLen}const o=see(e,a,this.v,s);if(this.A&&this.Y)return o(this.Y(s));for(i=this.H(this.o.slice(),this.h,this.l,this.C(this.F),a),n=1;n<this.numRounds;n+=1)this.B&&a%32!=0&&(i[i.length-1]&=16777215>>>24-a%32),i=this.H(i,a,0,this.I(this.s),a);return o(i)}setHMACKey(e,r,n){if(!this.L)throw new Error("Variant does not support HMAC");if(this.u)throw new Error("Cannot set MAC key after calling update");const i=wL(r,(n||{}).encoding||"UTF8",this.v);this.M(i(e))}M(e){const r=this.U>>>3,n=r/4-1;let i;if(this.numRounds!==1)throw new Error("Cannot set numRounds with MAC");if(this.A)throw new Error("MAC key already set");for(r<e.binLen/8&&(e.value=this.H(e.value,e.binLen,0,this.I(this.s),this.g));e.value.length<=n;)e.value.push(0);for(i=0;i<=n;i+=1)this.p[i]=909522486^e.value[i],this.R[i]=1549556828^e.value[i];this.F=this.m(this.p,this.F),this.l=this.U,this.A=!0}getHMAC(e,r){const n=oee(r);return see(e,this.g,this.v,n)(this.N())}N(){let e;if(!this.A)throw new Error("Cannot call getHMAC without first setting MAC key");const r=this.H(this.o.slice(),this.h,this.l,this.C(this.F),this.g);return e=this.m(this.R,this.I(this.s)),e=this.H(r,this.g,this.U,e,this.g),e}}{constructor(e,r,n){if(e!=="SHA-1")throw new Error("Chosen SHA variant is not supported");super(e,r,n);const i=n||{};this.L=!0,this.Y=this.N,this.v=-1,this.T=wL(this.t,this.i,this.v),this.m=uee,this.C=function(a){return a.slice()},this.I=RLe,this.H=LLe,this.F=[1732584193,4023233417,2562383102,271733878,3285377520],this.U=512,this.g=160,this.B=!1,i.hmacKey&&this.M((function(a,s,o,l){const u=a+" must include a value and format";if(!s)throw new Error(u);if(s.value===void 0||!s.format)throw new Error(u);return wL(s.format,s.encoding||"UTF8",o)(s.value)})("hmacKey",i.hmacKey,this.v))}}var rm=(t=>(t.CvApSoutheast1="cv-ap-southeast-1",t.CvApSoutheast2="cv-ap-southeast-2",t.CvEuWest1="cv-eu-west-1",t.CvNaWest1="cv-na-west-1",t))(rm||{});const jLe={systemName:rm.CvApSoutheast1},BLe={systemName:rm.CvApSoutheast2},FLe={systemName:rm.CvEuWest1},ULe={systemName:rm.CvNaWest1},zLe={CvApSoutheast1:jLe,CvApSoutheast2:BLe,CvEuWest1:FLe,CvNaWest1:ULe};var cee=(t=>(t.Staff="Staff",t.Learner="Learner",t.Unknown="Unknown",t.System="System",t))(cee||{});const dee="r",Mk="cv:r",Ik="cv:r:e",Nk="referrer",fee="cv:originalReferrer",xL=28800,hee=["internalReferrer"],kL={getDecodedAttributionData(){const t=nc.cacheGet(Mk);if(t&&Object.keys(t).length>0)return t;const e=pee();return e==null?void 0:e.decoded},getEncodedAttributionData(){const t=nc.cacheGet(Ik);return t!=null&&t.length?t:pee().encoded},getProfileId(){const t=kL.getDecodedAttributionData();return(t==null?void 0:t.profileId)??null},setAttributionData(t){if(!t)return;const e=mee(t);AL(e,t)},decodeRValue(t){if(t)try{const e=atob(t),r=JSON.parse(e);if(!DL(r))throw Error(`Decoded R value is invalid: ${JSON.stringify(r)}`);return r}catch(e){const r=e instanceof Error?e.message:e==null?void 0:e.toString();console.error(r)}}};function pee(){const t=nc.cacheGet(Mk),e=nc.cacheGet(Ik);return DL(t)?{encoded:e,decoded:t}:$Le()}function $Le(){nc.cacheRemove(Mk),nc.cacheRemove(Ik);const t=qLe(),e=kL.decodeRValue(t);if(e)return AL(t,e),{decoded:e,encoded:t};const r={internalReferrer:window.location.origin+window.location.pathname,originalReferrer:HLe()},n=mee(r);return AL(n,r),{decoded:r,encoded:n}}function DL(t){return!t||typeof t!="object"||Object.keys(t).length<hee.length?!1:hee.every(e=>typeof t[e]=="string")}function HLe(){const t=nc.cacheGet(fee);if(t&&typeof t=="string")return t;let e=document.referrer??"";if(window.URLSearchParams){const r=new URLSearchParams(window.location.search),n=r.has(Nk)&&r.get(Nk);r.has(Nk)&&r.get(Nk)&&(e=n)}return e&&nc.cacheSet(fee,e,xL),e}function qLe(){if(!window.URLSearchParams)return;const t=new URLSearchParams(window.location.search);if(t.has(dee))return t.get(dee)}function mee(t){if(DL(t))try{return btoa(JSON.stringify(t))}catch{console.error(`R value could not be encoded: ${JSON.stringify(t)}`)}}function AL(t,e){try{nc.cacheSet(Mk,e,xL),nc.cacheSet(Ik,t,xL)}catch{console.error("Could not store attribution data in session storage")}}const gee=3,VLe=5e3,WLe=6,OL={};class KLe{constructor(e){this.key=e.toString()}getCount(){return OL[this.key]||0}increment(){OL[this.key]=this.getCount()+1}reset(){delete OL[this.key]}shouldBreak(){return this.getCount()>=WLe}}class GLe{constructor(){this.attempt=0}async wait(){await new Promise(e=>setTimeout(e,VLe*Math.pow(2,this.attempt))),this.attempt++}}async function YLe(t,e){const r=new GLe,n=new KLe(t);async function i(){const a=await fetch(t,e);if(a.status>=500&&!n.shouldBreak())throw new Error(`Server error: ${a.status}`);return a.ok&&n.reset(),a}for(let a=1;a<=gee;a++)try{return await i()}catch(s){if(a>=gee||n.shouldBreak())throw s;n.increment(),await r.wait()}}const Fy={isObject(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction(t){return typeof t=="function"}},vee={safeUrlConcat(t,e){if(!t)return;let r=t;return t.endsWith("/")||(r+="/"),e&&(r+=e.startsWith("/")?e.slice(1):e),r}},ss={mobileDevice:/Mobi/i,iphone:/iphone/i,ipad:/ipad/i,android:/android/i,blackberry:/blackberry/i,windowsPhone:/windows phone/i,iosVersion:/OS\s+([\d_.-:]+)\s/i,androidVersion:/android\s+([\d_.-\/]+)[\s;:,\)]/i,blackberryVersion:/(blackberry|version)\s?\d*\/([\d.]+)/i,windowsPhoneVersion:/windows\sphone.*?([\d_.-\/]+)[\s;:,\)]/i,mac:/Mac/i,unix:/X11/i,linux:/Linux/i,windows:/Win/i,win2000:/nt 5.0/i,winXP:/nt 5.1/i,winVista:/nt 6.0/i,win7:/nt 6.1/i,win8:/nt 6.2/i,win81:/nt 6.3/i,win10:/nt 10.0/i,osxVersion:/OS\sX\s([\d_.]+)/i,chrome:/^(?!.*Edge).*Chrome/i,safari:/^(?!.*(?:Chrome|Edge)).*Safari/i,edge:/edge/i,ie:/(msie|trident)/i,opera:/(opr|opera)/i,firefox:/firefox/i,generalVersion:/(chrome|firefox|version)\/(\d+.*?)(\s|$)/i,operaVersion:/(opr|opera)\/(\d+).*?(\s|$)/i,ieVersion:/MSIE\s+(\d+).*?/i,edgeVersion:/(edge)\/(\d+).*?(\s|$)/i},Xm="Unknown";function tb(t,e,r){const n=e.exec(r)||[];let[i]=n;return i||(i=Xm),{name:t,version:i}}function Uy(t,e,r){if(!e)return{name:t,version:Xm};const n=e.exec(r),i=n&&n.length?n[0].trim():Xm;return{name:t,version:i}}function XLe(t,e){const r={name:t,version:null};return ss.win2000.test(e)&&(r.version="2000"),ss.winXP.test(e)&&(r.version="XP"),ss.winVista.test(e)&&(r.version="Vista"),ss.win7.test(e)&&(r.version="7"),ss.win8.test(e)&&(r.version="8"),ss.win81.test(e)&&(r.version="8.1"),ss.win10.test(e)&&(r.version="10"),r.version||(r.version=Xm),r}const yee={getDeviceType(){const t=window.navigator.userAgent;return ss.mobileDevice.test(t)?ss.iphone.test(t)?"iPhone":ss.ipad.test(t)?"iPad":ss.android.test(t)?"Android":ss.blackberry.test(t)?"Blackberry":ss.windowsPhone.test(t)?"Windows Phone":Xm:"Desktop"},getOperatingSystem(){const t=window.navigator.userAgent;return ss.android.test(t)?Uy("Android",ss.androidVersion,t):ss.iphone.test(t)||ss.ipad.test(t)?Uy("iOS",ss.iosVersion,t):ss.linux.test(t)?Uy("Linux",null,t):ss.unix.test(t)?Uy("Unix",null,t):ss.mac.test(t)?Uy("Macintosh",ss.osxVersion,t):ss.windows.test(t)?XLe("Windows",t):ss.blackberry.test(t)?Uy("BlackBerry",ss.blackberryVersion,t):ss.windowsPhone.test(t)?Uy("Windows Phone",ss.windowsPhoneVersion,t):{name:Xm,version:Xm}},getBrowser(){const t=window.navigator.userAgent;return ss.chrome.test(t)?tb("Chrome",ss.generalVersion,t):ss.firefox.test(t)?tb("Firefox",ss.generalVersion,t):ss.safari.test(t)?tb("Safari",ss.generalVersion,t):ss.ie.test(t)?tb("Internet Explorer",ss.ieVersion,t):ss.edge.test(t)?tb("Edge",ss.edgeVersion,t):ss.opera.test(t)?tb("Opera",ss.operaVersion,t):{name:Xm,version:Xm}},isTouchScreen(){return!!("ontouchstart"in window||navigator.maxTouchPoints)}},QLe=28800,_ee="cv:utmparams",ML=[["source","utm_source"],["medium","utm_medium"],["campaign","utm_campaign"],["term","utm_term"],["content","utm_content"]],ZLe=ML.reduce((t,[e])=>({...t,[e]:e}),{}),bee={getUtmParameters(){if(!window.URLSearchParams)return null;const t=new URLSearchParams(window.location.search),e={},r=([n,i])=>{t.has(i)&&(e[n]=t.get(i))};return ML.forEach(r),See(e)},setUtmParameters(t){if(!t)return;const e={},r=n=>{ZLe[n]&&(e[n]=t[n])};return Object.keys(t).forEach(r),See(e)},getURLSearchParams(){if(!window.URLSearchParams)return null;const t=new URLSearchParams,e=bee.getUtmParameters();return e?(ML.forEach(([r,n])=>{e[r]&&t.set(n,e[r])}),t):null}};function See(t){if(Object.keys(t).length)return nc.cacheSet(_ee,t,QLe),t;const e=nc.cacheGet(_ee);return e&&typeof e=="object"&&Object.keys(e).length?e:null}const JLe={version:"2.3.0"},ePe="zXJL9nOHxzDlMUDjiP41",Tee="unknown";class tPe{constructor(e){this.options=e,this.initialize()}initialize(){this.validateOptions(),this.options.logUtmParameters&&(this.utmParameters=bee.getUtmParameters()),this.options.logAttributionData&&(this.attributionData=kL.getDecodedAttributionData())}get name(){return"CollectionApiClient"}async log(e){if(Array.isArray(e))return this.logBulk(e);this.shouldLog(e)&&(this.validateEvent(e),await this.postData(await this.formatData(e)))}async logBulk(e){const r=e.filter(i=>this.shouldLog(i));if(!r.length)return;r.forEach(i=>this.validateEvent(i));const n=await Promise.all(r.map(i=>this.formatData(i)));await this.postData(n)}validateOptions(){if(!Fy.isFunction(this.options.getUser))throw new Error("getUser option is required.")}shouldLog(e){return Fy.isFunction(this.options.shouldLog)?this.options.shouldLog(e):!0}async postData(e){const r=await this.getRegionalUrl(this.options.collectionApiUrls),n=JSON.stringify(e),i={"Content-Type":"application/json",...this.getSignatureHeader(n)};let a=vee.safeUrlConcat(r,"/v1/ingest");Array.isArray(e)&&(a=vee.safeUrlConcat(a,"/bulk"));try{const s=await YLe(a,{method:"POST",mode:"cors",headers:i,body:n});s.ok||this.logError(new Error(`CollectionApiClient failed to log event. Status: ${s.status} ${s.statusText}`),!1,this.getResponseAsObject(s))}catch(s){this.logError(s)}}getResponseAsObject(e){return{headers:e.headers,ok:e.ok,redirected:e.redirected,status:e.status,statusText:e.statusText,type:e.type,url:e.url,body:e.text()}}getSignatureHeader(e){const r=new PLe("SHA-1","TEXT",{hmacKey:{value:ePe,format:"TEXT",encoding:"UTF8"}});return r.update(e),{"cv-analytics-signature":`${this.options.collectionApiClientId}.${r.getHash("B64")}`}}async getRegionalUrl(e){switch((await this.getRegion()).systemName){case rm.CvEuWest1:return e.cvEuWest1;case rm.CvApSoutheast2:return e.cvApSoutheast2;case rm.CvNaWest1:return e.cvNaWest1;case rm.CvApSoutheast1:default:return e.cvApSoutheast1}}validateEvent(e){typeof e.type!="string"&&this.logError(new Error("Event type is required."),!0),Fy.isObject(e.actionContext)||this.logError(new Error("Event actionContext is required."),!0),e.actionContext.entity||this.logError(new Error("Event actionContext entity is required."),!0)}async formatData(e){return{type:e.type,data:await this.getEventData(e),metadata:this.getEventMetadata(e)}}async getEventData(e){const r=e.actionContext,n=this.getPlatformMetadata(),i=await this.getUserData(),a=await this.getSessionData(),s={name:this.options.productName,version:this.options.productVersion};this.options.productVariant&&(s.variant=this.options.productVariant);const o={user:i,action:r,platform:n,product:s,session:a};this.utmParameters&&(o.utm=this.utmParameters);const l=this.extractData(e),u=Object.keys(o).map(h=>h.toLowerCase()),f=Object.keys(l).map(h=>h.toLowerCase());return u.forEach(h=>{f.includes(h)&&this.logError(new Error(`${h} is a reserved key.`),!0)}),{...o,...l}}extractData(e){return Fy.isFunction(this.options.formatData)?this.options.formatData(e):{[e.actionContext.entity]:e.data}}async getUserData(){var r,n,i;let e;try{e=await((n=(r=this.options).getProfileId)==null?void 0:n.call(r))}catch(a){this.logError(a)}try{const a=await this.options.getUser();return a!=null&&a.id?{id:a.id,role:((i=a.role)==null?void 0:i.toLowerCase())||Tee,userGroup:(a.userGroup??cee.Unknown).toLowerCase(),yearGroup:this.normalizeYearGroup(a.yearGroup),profileId:e,customer:{id:a.customerId,name:a.customerName,customerGuid:a.customerGuid,crmId:a.crmId,country:a.countryCode,region:await this.getRegion(),openCustomer:!1,accessPolicy:a.accessPolicy}}:e?{profileId:e}:void 0}catch(a){this.logError(a)}}async getRegion(){let e=this.options.regionName;try{const r=await this.options.getUser();r!=null&&r.instanceRegion&&(e=r.instanceRegion)}catch(r){this.logError(r)}return e||this.logError(new Error("RegionName is not set."),!0),this.getRegionByName(e.toLowerCase())}async getSessionData(){try{const e=await this.options.getUser();return{...Y1.getClientSessionData(e==null?void 0:e.id),authSessionId:e==null?void 0:e.sessionId}}catch(e){return console.error(e),Y1.getClientSessionData(null)}}getPlatformMetadata(){var r,n;const e={url:window.location.href,referrer:document.referrer};return(r=this.attributionData)!=null&&r.internalReferrer&&(e.internalReferrer=this.attributionData.internalReferrer),(n=this.attributionData)!=null&&n.originalReferrer&&(e.originalReferrer=this.attributionData.originalReferrer),{browser:yee.getBrowser(),os:yee.getOperatingSystem(),request:e,screenResolution:`${window.screen.width}x${window.screen.height}`,viewportResolution:`${window.innerWidth}x${window.innerHeight}`}}getEventMetadata(e){return{client:{name:`${this.name}.ts`,version:JLe.version,region:this.getRegionByName(this.options.regionName)},timestamp:new Date().toISOString(),eventVersion:e.eventVersion}}getRegionByName(e){let r;return Object.values(zLe).forEach(n=>{n.systemName===e&&(r=n)}),r}normalizeYearGroup(e){return e?e.toLowerCase().split(" ").join("_"):Tee}logError(e,r,...n){if(this.options.logError&&this.options.logError(e,...n),r)throw e}}var ln=(t=>(t.Stream="cv_product_stream",t.WebPlayerStream="cv_product_webplayer_stream",t.StreamProgress="cv_product_stream_progress",t.PreviewStreamProgress="cv_product_preview_stream_progress",t.Login="cv_product_login",t.LoginSsoRedirect="cv_product_login_sso_redirect",t.LoginFailed="cv_product_login_failed",t.Search="cv_product_search",t.InstantSearch="cv_product_instant_search",t.SearchEmptyResult="cv_product_search_empty_result",t.Filter="cv_product_search_filter",t.SearchLanding="cv_product_search_landing",t.Share="cv_product_share",t.Unshare="cv_product_unshare",t.WorkspaceAdd="cv_product_tv_add",t.Rename="cv_product_rename",t.Move="cv_product_move",t.Sort="cv_product_sort",t.Create="cv_product_create",t.Delete="cv_product_delete",t.Associate="cv_product_associate",t.Dissociate="cv_product_dissociate",t.Edit="cv_product_edit",t.Approve="cv_product_approve",t.Reject="cv_product_reject",t.Disable="cv_product_disable",t.Upload="cv_product_upload",t.Download="cv_product_download",t.Navigate="cv_product_navigate",t.Click="cv_product_click",t.Suggest="cv_product_suggest",t.EditAssoc="cv_product_edit_assoc",t.Play="cv_product_play",t.Favourite="cv_product_favourite",t.Follow="cv_product_follow",t.Prefer="cv_product_prefer",t.Print="cv_product_print",t.Copy="cv_product_copy",t.Activate="cv_product_activate",t.VerifyEmail="cv_product_verify_email",t.ChangePassword="cv_product_change_password",t.ManageGroup="cv_product_manage_group",t.Export="cv_product_export",t.SendEmail="cv_product_send_email",t.Publish="cv_product_publish",t.Submit="cv_product_submit",t.Complete="cv_product_complete",t.Archive="cv_product_archive",t.Promote="cv_product_promote",t.Demote="cv_product_demote",t.BulkAction="cv_product_bulk_action",t.Remove="cv_product_remove",t.Dismiss="cv_product_dismiss",t.Open="cv_product_open",t.Hide="cv_product_hide",t.PageView="cv_product_page_view",t.Select="cv_product_select",t.SwitchCustomer="cv_product_switch_customer",t.Focus="cv_product_focus",t.Blur="cv_product_blur",t.Hover="cv_product_hover",t.Unhover="cv_product_unhover",t.SetAccess="cv_product_set_access",t.AddToLocalCache="cv_product_add_to_lc",t.ResolveWarning="cv_product_resolve_warning",t.DismissWarning="cv_product_dismiss_warning",t))(ln||{}),hs=(t=>(t.Folder="folder",t.Video="video",t.Rating="rating",t.Series="series",t.Library="library",t.Resource="resource",t.Tag="tag",t.Subtitle="subtitle",t.Chapter="chapter",t.Resolution="resolution",t.PlaybackSpeed="playback_speed",t.Device="device",t.Restriction="restriction",t.Interactive="interactive",t.Interaction="interaction",t.PDF="pdf",t.CustomerSetting="customer_setting",t.UserSetting="user_setting",t.LibraryRequest="staff_request",t.Logo="logo",t.Pagination="pagination",t.Thumbnail="thumbnail",t.Banner="banner",t.Link="link",t.Playlist="playlist",t.Playlists="playlists",t.Person="person",t.Company="company",t.Classroom="classroom",t.ClassroomGroup="classroom_group",t.Classification="classification",t.ShareLink="share_link",t.DirectShare="direct_share",t.Upload="upload",t.SearchResults="search_results",t.SearchSuggestion="search_suggestion",t.Audience="audience",t.User="user",t.Clip="clip",t.UserChannel="user_channel",t.Widget="widget",t.Url="url",t.SocialShare="social_share",t.Presentation="presentation",t.BatchJob="batch_job",t.DeepLink="deep_link",t.Feedback="feedback",t.AppLink="app_link",t.SignUp="sign_up",t.FileGeneratorJob="file_generator_job",t.ExportLibraries="export_libraries",t.Product="product",t.Customer="customer",t.SpecialEvent="special_event",t.Region="region",t.ProductTip="product_tip",t.Livestream="livestream",t.DevicesCta="devices_cta",t.Integration="integration",t.Faq="faq",t.MixedMedia="mixed_media",t.TableOfContents="table_of_contents",t.Author="author",t.Glance="glance",t.Filter="filter",t.NotificationSetting="notification_setting",t.Transcript="transcript",t.CurriculumCode="curriculum_code",t.Assign="assign",t.PartnerProfile="partner_profile",t))(hs||{}),Bu=(t=>(t.TopNav="top_nav",t.LeftNav="left_nav",t.Footer="footer",t.Popup="popup",t.Banner="banner",t.VideoList="video_list",t.VideoListItem="video_list_item",t.VideoListHeader="video_header",t.VideoThumbnail="video_thumbnail",t.ExpandableVideoThumbnail="expandable_video_thumbnail",t.VideoItemPreview="video_item_preview",t.InteractiveItemPreview="interactive_item_preview",t.ClipItemPreview="clip_item_preview",t.VideoDetails="video_details",t.InteractiveDetails="interactive_details",t.ClipDetails="clip_details",t.VideoDetailsHeader="video_details_header",t.EditVideoDetails="edit_video_details",t.EditInteractiveVideoDetails="edit_interactive_video_details",t.EditClipDetails="edit_clip_details",t.EditVideoChapters="edit_video_chapters",t.EditVideoResources="edit_video_resources",t.PreviewVideoResources="preview_video_resources",t.VideoUpload="video_upload",t.VideoRequest="video_request",t.Pagination="pagination",t.LibraryHeader="library_header",t.LibraryTiles="library_tiles",t.LibraryRequestDetails="staff_request_details",t.Libraries="libraries",t.SubFolderList="sub_folder_list",t.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",t.AwaitingReviewVideoItem="awaiting_review_video_item",t.PastReleasesHeader="past_releases_header",t.MigrationWarnings="migration_warnings",t.PlaylistListHeader="playlist_list_header",t.PlaylistListItem="playlist_list_item",t.SeriesListItem="series_list_item",t.SeriesWithVideos="series_with_videos",t.PlaylistWithVideos="playlist_with_videos",t.Dropdown="dropdown",t.ViewCurriculumLinks="view_curriculum_links",t.SearchBar="search_bar",t.InstantSearch="instant_search",t.SearchFilters="search_filters",t.FeaturedSeriesSearchResult="featured_series_search_result",t.ExchangeSearchGroupItem="exchange_search_group_item",t.StaffManager="staff_manager",t.StaffManagerListItem="staff_manager_list_item",t.StudentManager="student_manager",t.ViewStudentVideos="view_student_videos",t.StudentManagerListItem="student_manager_list_item",t.EditUser="edit_user",t.UserAuditLog="user_audit_log",t.BulkUserActionsWizard="bulk_user_actions_wizard",t.BulkUserUploadWizard="bulk_user_upload_wizard",t.Classroom="classroom",t.ClassroomsList="classrooms_list",t.ClassroomsListItem="classrooms_list_item",t.ManageClassroomStudents="manage_classroom_students",t.ManageClassroomStudentListItem="manage_classroom_student_list_item",t.ManageClassroomGroups="manage_classroom_groups",t.ManageClassroomGroupListItem="manage_classroom_group_list_item",t.ManageClassroomTeachers="manage_classroom_teachers",t.ManageClassroomTeacherListItem="manage_classroom_teachers_list_item",t.ArchivedClassrooms="archived_classrooms",t.PreviewInteractive="preview_interactive",t.PreviewSharedInteractive="preview_shared_interactive",t.PreviewInteractiveQuestions="preview_interactive_questions",t.EditInteractive="edit_interactive",t.EditInteractiveDetails="edit_interactive_details",t.PlaySharedInteractive="play_shared_interactive",t.PlayInteractive="play_interactive",t.InteractiveListItem="interactive_list_item",t.DeleteInteractive="delete_interactive",t.NewInteractive="new_interactive",t.CopyInteractive="copy_interactive",t.UnpublishInteractive="unpublish_interactive",t.ShareInteractive="share_interactive",t.PlayPage="play_page",t.Player="player",t.FloatingPlayer="floating_player",t.InteractivePlayer="interactive_player",t.EmbeddedPlayer="embedded_player",t.CreateClipPlayer="create_clip_player",t.PlayClip="play_clip",t.PlaySharedClip="play_shared_clip",t.ClipListItem="clip_list_item",t.ContentUpdatesBanner="content_updates_banner",t.ContentUpdatesClassificationBanner="content_updates_classification_banner",t.PreferencesSettings="preferences_settings",t.NotificationSettings="notification_settings",t.TopicsOnboarding="topics_onboarding",t.MyUploads="my_uploads",t.MyVideos="my_videos",t.SlidingList="sliding_list",t.HeroBannerItem="hero_banner_item",t.SlidingListItem="sliding_list_item",t.ClassificationListItem="classification_list_item",t.ClassificationComingSoon="classification_coming_soon",t.ClassificationHero="classification_hero",t.ClassificationFooter="classification_footer",t.Classification="classification",t.PresentationClassifications="presentation_classifications",t.Dashboard="dashboard",t.DiscoverFooter="discover_footer",t.ProductBanner="product_banner",t.UserOptions="user_options",t.MagicTabs="magic_tabs",t.Settings="settings",t.StudentFeed="student_feed",t.MyShares="my_shares",t.SharedByMe="shared_by_me",t.SharedWithMe="shared_with_me",t.Insights="insights",t.Error="error_view",t.UpgradeForm="upgrade_form",t.ClassroomGuide="classroom_guide",t.TeachingResources="teaching_resources",t.ResourcesGuidancePopup="resources_guidance_popup",t.InteractivesGuidancePopup="interactives_guidance_popup",t.CurriculumGuidancePopup="curriculum_guidance_popup",t.TopVideos="top_videos",t.VideoViewsList="video_views_list",t.VideoOverview="video_overview",t.LiteUpgradeFeedbackPopup="lite_upgrade_feedback_popup",t.LiteUpgradeBanner="lite_upgrade_banner",t.LiteUpgradeOnboarding="lite_upgrade_onboarding",t.GiveFeedbackPopup="give_feedback_popup",t.LibraryRequestSettings="library_request_settings",t.OpenInAppPrompt="open_in_app_prompt",t.UseAppButton="use_app_button",t.Launchpad="launchpad",t.EditableSubjectPreferencesWidget="editable_subject_preferences_widget",t.ThumbnailHeroMediaWidget="thumbnail_hero_media_widget",t.ThumbnailFixedListMediaLargeWidget="thumbnail_fixed_list_media_large",t.FilterSlidingPillListSmallWidget="filter_sliding_pill_list_small",t.CircleLogoSlidingListWidget="circle_logo_sliding_list_widget",t.RectangularLogoSlidingListWidget="rectangular_logo_sliding_list_widget",t.HeroBannerSmallWidget="hero_banner_small",t.EventIconSlidingListWidget="event_icon_sliding_list_widget",t.OnboardingStepsWidget="onboarding_steps_widget",t.FaqQuestionWidget="faq_question_widget",t.FaqQuestionAccordionWidget="faq_question_accordion_widget",t.SubjectStatsWidgetItem="subject_stats_widget_item",t.AuthorReviewerWidget="author_reviewer_widget",t.ThumbnailFixedListMediaSmallWidget="thumbnail_fixed_list_media_small_widget",t.ThumbnailFixedListFolderSmallWidget="thumbnail_fixed_list_folder_small_widget",t.ThumbnailVerticalListWidget="thumbnail_vertical_list_widget",t.ThumbnailFixedListSmallWidget="thumbnail_fixed_list_small_widget",t.PosterFixedListLargeWidget="poster_fixed_list_large_widget",t.CurriculumResourcesAccordionWidget="curriculum_resources_accordion_widget",t.SearchCurriculumCodeWidget="search_curriculum_code_widget",t.ExchangeLinksWidget="exchange_links_widget",t.TableOfContents="table_of_contents",t.SignUpPopup="sign_up_popup",t.SignUpPage="sign_up_page",t.TrialBanner="trial_banner",t.InviteColleaguePopup="invite_colleague_popup",t.AuthProspectSelect="auth_prospect_select",t.GatedBanner="gated_banner",t.GatedEmptyState="gated_empty_state",t.GatedPopup="gated_popup",t.WelcomePopup="welcome_popup",t.WatchHistoryLanding="watch_history_landing",t.MyFavouritesLanding="my_favourites_landing",t.MyVideoLanding="my_videos_landing",t.PlaylistsLanding="playlists_landing",t.MySharesLanding="myshares_landing",t.PremiumFeatures="premium_features",t.NotificationsDropdown="notifications_dropdown",t.CalendarNav="calendar_nav",t.CalendarDay="calendar_day",t.CalendarPopup="calendar_popup",t.RegionMap="region_map",t.OnboardingWelcomeVideoScreen="onboarding_welcome_video_screen",t.OnboardingSelectRoleScreen="onboarding_select_role_screen",t.OnboardingUsageIntentionScreen="onboarding_usage_intention_screen",t.OnboardingSchoolLevelScreen="onboarding_school_level_screen",t.OnboardingSelectCurriculumScreen="onboarding_select_curriculum_screen",t.OnboardingSubjectsScreen="onboarding_subjects_screen",t.OnboardingSelectVideosScreen="onboarding_select_videos_screen",t.OnboardingCreatePlaylistScreen="onboarding_create_playlist_screen",t.OnboardingSubjectsSummaryScreen="onboarding_subjects_summary_screen",t.ProductTips="product_tips",t.LivestreamBookingForm="booking_form",t.DateRangeFilter="date_range_selector",t.AudienceFilter="audience_filter",t.AssignFlowView="assign_flow_view",t.Global="global",t))(Bu||{}),sd=(t=>(t.Start="start",t.Complete="complete",t.Save="save",t.Discard="discard",t.Next="next",t.Back="back",t))(sd||{}),zy=(t=>(t.Start="start",t.Finish="finish",t.Terminate="terminate",t.Play="play",t.Pause="pause",t.Playback="playback",t.NextChapter="next_chapter",t.PreviousChapter="previous_chapter",t.FullScreenEnter="full_screen_enter",t.FullScreenExit="full_screen_exit",t.ChangeResolution="change_resolution",t.ChangeSpeed="change_speed",t.ChangeDevice="change_device",t.EnableTheatreMode="enable_theatre_mode",t.DisableTheatreMode="disable_theatre_mode",t.ShowTranscript="show_transcript",t.HideTranscript="hide_transcript",t))(zy||{}),Eee=(t=>(t.Embedded="embedded",t))(Eee||{}),Cee=(t=>(t.TogglePreview="toggle_preview",t.NavigateHome="navigate_home",t.OpenInStaffView="open_in_staff_view",t.Title="title",t.ToggleHideValidListings="toggle_hide_valid_listings",t.LaunchImmersiveReader="launch_immersive_reader",t.CopyEmbedHtml="copy_embed_html",t.CopyRecommendationEmail="copy_recommendation_email",t.OpenRecommendationMailTo="open_recommendation_mail_to",t.Close="close",t.Open="open",t.Button="button",t.Link="link",t.Tile="tile",t.Thumbnail="thumbnail",t.Cover="cover",t.TallPoster="tall_poster",t.Banner="banner",t.Slide="slide",t.ExternalLink="external_link",t.ViewStudentWorkspace="view_student_workspace",t.Card="card",t.SelectAllUsers="select_all_users",t.ClickViewLogo="clickview_logo",t.Clear="clear",t.SeeMore="see_more",t.Settings="settings",t.Expand="expand",t.Collapse="collapse",t.Search="search",t))(Cee||{}),wee=(t=>(t.FeatureUserChannelVideo="feature_user_channel_video",t.RemoveFromUserChannelPlaylist="remove_from_user_channel_playlist",t.ShareClip="share_clip",t.ViewOriginalVideo="view_original_video",t.ShareInteractive="share_interactive",t.DeleteInteractiveVideo="delete_interactive_video",t.CopyInteractiveVideo="copy_interactive_video",t.EditInteractiveVideo="edit_interactive_video",t.PrintAsWorksheet="print_as_worksheet",t.PreviewInteractiveVideo="preview_interactive_video",t.ViewResults="view_results",t.ViewInsights="view_insights",t.ViewUsage="view_usage",t.MoveToAnotherFolder="move_to_another_folder",t.CreateInteractiveVideo="create_interactive_video",t.ShareVideo="share_video",t.EditVideo="edit_video",t.DownloadVideo="download_video",t.AddToExchange="add_to_exchange",t.AddToUserChannel="add_to_user_channel",t.CreateClip="create_clip",t.FlagVideo="flag_video",t.AddToLibrary="add_to_library",t.AddToWorkspace="add_to_workspace",t.AddToPlaylist="add_to_playlist",t.RemoveFromPlaylist="remove_from_playlist",t.AddCurriculumLink="add_curriculum_link",t.ViewCurriculumLinks="view_curriculum_links",t.OpenInCurator="open_in_curator",t.ManageVideoAccess="manage_video_access",t.Approve="approve",t.AddToLocalCache="add_to_local_cache",t.OpenInLibraryEditor="open_in_library_editor",t.OpenInClickView="open_in_clickview",t.PlayClip="play_clip",t.EditClip="edit_clip",t.DeleteClip="delete_clip",t.EditVideoDetails="edit_video_details",t.DeleteVideo="delete_video",t.ManageAccess="manage_access",t.SuggestEdit="suggest_edit",t.RemoveFromWatchHistory="remove_from_watch_history",t.ShowTranscript="show_transcript",t.HideTranscript="hide_transcript",t.TranscriptTimepoint="transcript_timepoint",t))(wee||{}),IL=(t=>(t.FileSelect="file_select",t.DragDrop="drag_drop",t))(IL||{}),NL=(t=>(t.On="on",t.Off="off",t))(NL||{}),RL=(t=>(t.ContinueSession="continue_session",t.NewSession="new_session",t))(RL||{}),wT=(t=>(t.SearchTranscript="search_transcript",t.NextResult="next_result",t.PreviousResult="previous_result",t.ResetResults="reset_results",t))(wT||{}),LL=(t=>(t.FileSelect="file-select",t.DragDrop="drag-drop",t))(LL||{}),tv=(t=>(t.Video="videos",t.Clip="clips",t.Interactive="interactives",t.Folder="categories",t.Series="series",t.Tags="tags",t.Subjects="subjects",t))(tv||{}),Qm=(t=>(t[t.V1=1]="V1",t[t.V2=2]="V2",t[t.V3=3]="V3",t[t.V4=4]="V4",t[t.V5=5]="V5",t))(Qm||{});const hl={passthrough(t){return t}},Hi={allow:()=>!0,restrict:()=>!1},rPe={getShareData(t){var o,l,u,f;const{id:e,search:r,pagePositionIndex:n,shareId:i,shareType:a}=t,s={id:e,search:r,pagePositionIndex:n,shareId:i,shareType:a};return(o=t.video)!=null&&o.id&&(s.video={id:t.video.id}),(l=t.clip)!=null&&l.id&&(s.clip={id:t.clip.id},(u=t.clip.video)!=null&&u.id&&(s.video={id:(f=t.clip.video)==null?void 0:f.id})),t.shareCount!==void 0&&(s.shareCount=t.shareCount),t.embedDetails&&(s.embedDetails=s.embedDetails),s}},rb={getUploadData(t,e){const{entity:r}=e.actionContext;if(r===hs.Video)return rb.formatVideoUpload(t,e);if(r===hs.Resource||r===hs.Subtitle)return rb.formatResourceUpload(t);if(r===hs.Banner||r===hs.Thumbnail||r===hs.MixedMedia)return t;throw new Error("Upload data event not correctly formatted.")},formatVideoUpload(t,e){const{workflowPhase:r}=e.actionContext;if(r===sd.Start)return rb.getStartVideoUploadData(t);if(r===sd.Discard)return rb.getDiscardVideoUploadData(t);if(r===sd.Complete)return rb.getCompleteUploadData(t)},getStartVideoUploadData(t){return!t||!t.length?[]:(t instanceof FileList&&(t=Array.from(t)),t.map(e=>({fileName:e.name,size:e.size,type:e.type,count:t.length})))},getDiscardVideoUploadData(t){const e=r=>{const{type:n,name:i,status:a,cvUpload:s}=r.file,o={fileName:i,count:Array.isArray(t)?t.length:1,type:n,status:a};return r.progress&&(o.progress=r.progress.toFixed(2)),s&&(o.uploadId=s.uploadId),o};return Array.isArray(t)?t.map(r=>e(r)):[e(t)]},getCompleteUploadData(t){return!t||!t.length?[]:t.map(e=>{const{fileName:r,libraryId:n,folderId:i,autoCaption:a}=e;return{fileName:r,libraryId:n,folderId:i,autoCaption:a,count:t.length}})},formatResourceUpload(t){const{id:e,name:r}=t,n={id:e,name:r};return Fy.isObject(t.metadata)&&(n.type=t.metadata.type),n}},nPe={[ln.Navigate]:Hi.restrict,[ln.Click]:Hi.allow,[ln.Search]:Hi.allow,[ln.InstantSearch]:Hi.allow,[ln.Play]:Hi.allow,[ln.Stream]:Hi.allow,[ln.WebPlayerStream]:Hi.allow,[ln.StreamProgress]:Hi.allow,[ln.PreviewStreamProgress]:Hi.allow,[ln.Rename]:Hi.allow,[ln.Move]:Hi.allow,[ln.Create]:Hi.allow,[ln.Delete]:Hi.allow,[ln.Associate]:Hi.allow,[ln.Dissociate]:Hi.allow,[ln.Filter]:Hi.allow,[ln.Sort]:Hi.allow,[ln.Approve]:Hi.allow,[ln.Reject]:Hi.allow,[ln.Disable]:Hi.allow,[ln.Upload]:Hi.allow,[ln.Download]:Hi.allow,[ln.SetAccess]:Hi.allow,[ln.AddToLocalCache]:Hi.restrict,[ln.Share]:Hi.allow,[ln.Unshare]:Hi.allow,[ln.Edit]:Hi.allow,[ln.Suggest]:Hi.allow,[ln.Favourite]:Hi.allow,[ln.WorkspaceAdd]:Hi.allow,[ln.ResolveWarning]:Hi.allow,[ln.DismissWarning]:Hi.allow,[ln.EditAssoc]:Hi.allow,[ln.Follow]:Hi.allow,[ln.Print]:Hi.allow,[ln.Copy]:Hi.allow,[ln.Activate]:Hi.allow,[ln.VerifyEmail]:Hi.allow,[ln.ChangePassword]:Hi.allow,[ln.Export]:Hi.allow,[ln.SendEmail]:Hi.allow,[ln.Publish]:Hi.allow,[ln.Submit]:Hi.allow,[ln.Complete]:Hi.allow,[ln.Archive]:Hi.allow,[ln.Promote]:Hi.allow,[ln.Demote]:Hi.allow,[ln.BulkAction]:Hi.allow,[ln.Remove]:Hi.allow,[ln.Dismiss]:Hi.allow,[ln.Open]:Hi.allow,[ln.Hide]:Hi.allow,[ln.PageView]:Hi.allow,[ln.Select]:Hi.allow,[ln.SwitchCustomer]:Hi.allow,[ln.Focus]:Hi.allow,[ln.Blur]:Hi.allow,[ln.Hover]:Hi.allow,[ln.Unhover]:Hi.allow},iPe={[ln.Search]:hl.passthrough,[ln.InstantSearch]:hl.passthrough,[ln.Play]:hl.passthrough,[ln.Stream]:hl.passthrough,[ln.StreamProgress]:hl.passthrough,[ln.PreviewStreamProgress]:hl.passthrough,[ln.Click]:hl.passthrough,[ln.Filter]:hl.passthrough,[ln.Sort]:hl.passthrough,[ln.SetAccess]:hl.passthrough,[ln.Approve]:hl.passthrough,[ln.Reject]:hl.passthrough,[ln.Create]:hl.passthrough,[ln.Delete]:hl.passthrough,[ln.Rename]:hl.passthrough,[ln.Move]:hl.passthrough,[ln.Edit]:hl.passthrough,[ln.Share]:rPe.getShareData,[ln.Disable]:hl.passthrough,[ln.Suggest]:hl.passthrough,[ln.Upload]:rb.getUploadData,[ln.ResolveWarning]:hl.passthrough,[ln.DismissWarning]:hl.passthrough,[ln.Follow]:hl.passthrough,[ln.Print]:hl.passthrough,[ln.Copy]:hl.passthrough},xee={[ln.Search]:()=>"search",[ln.InstantSearch]:()=>"search",[ln.Filter]:()=>"filter",[ln.Stream]:()=>hs.Video},kee={user:"target_user",product:"target_product"},aPe={[ln.StreamProgress]:!0,[ln.WebPlayerStream]:!0,[ln.PreviewStreamProgress]:!0},Dee={shouldLog(t){return!!nPe[t.type](t)},formatData(t){const e=iPe[t.type],r=Fy.isFunction(e)?e(t.data,t):t.data;if(aPe[t.type])return r;let n=t.actionContext.entity;return Fy.isFunction(xee[t.type])&&(n=xee[t.type](t)),kee[n]&&(n=kee[n]),{[n]:r}}};class sPe{constructor(e){this.options=e,this.initialize()}logStream(){const e=`v:${this.options.videoId}`;nc.cacheExists(e)||(this.collectionApiClient.log({type:ln.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:Qm.V3}),nc&&nc.cacheSet(e,null,300))}logVideoProgress(e){const r=this.getAnalyticsData();this.collectionApiClient.log(e.map(n=>({type:ln.StreamProgress,actionContext:this.getActionContext(),data:{...r,progress:n},eventVersion:Qm.V2})))}logVideoPreviewProgress(e){const r=this.getAnalyticsData();this.collectionApiClient.log(e.map(n=>({type:ln.PreviewStreamProgress,actionContext:this.getActionContext(),data:{...r,progress:n},eventVersion:Qm.V2})))}logUserAction(e,r){const n={...this.getAnalyticsData(),...e},i={...this.getActionContext(),...r};this.collectionApiClient.log({type:r.actionType,data:n,actionContext:i,eventVersion:r.eventVersion||Qm.V2})}getAnalyticsData(){const e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);const r=this.getEntityType();return r===hs.Interactive?e.interactive={id:+this.options.mediaId}:r===hs.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),Y1.lockWindowSession(),this.options.player.one("dispose",()=>Y1.unlockWindowSession())}setupCollectionApiClient(){this.collectionApiClient=new tPe({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:Dee.shouldLog,formatData:Dee.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?Eee.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case"MasterVideo":return hs.Video;case"MasterInteractive":return hs.Interactive;case"MasterClip":return hs.Clip}}getLocationContext(){switch(this.options.playerType){case"player":return Bu.Player;case"interactive-player":return Bu.InteractivePlayer;case"create-clip-player":return Bu.CreateClipPlayer}}}var Rk={exports:{}},Aee;function oPe(){return Aee||(Aee=1,(function(t,e){function r(l){if(l&&typeof l=="object"){var u=l.which||l.keyCode||l.charCode;u&&(l=u)}if(typeof l=="number")return s[l];var f=String(l),h=n[f.toLowerCase()];if(h)return h;var h=i[f.toLowerCase()];if(h)return h;if(f.length===1)return f.charCodeAt(0)}r.isEventKey=function(u,f){if(u&&typeof u=="object"){var h=u.which||u.keyCode||u.charCode;if(h==null)return!1;if(typeof f=="string"){var p=n[f.toLowerCase()];if(p)return p===h;var p=i[f.toLowerCase()];if(p)return p===h}else if(typeof f=="number")return f===h;return!1}},e=t.exports=r;var n=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
|
|
287
287
|
* Programatically add the following
|
|
288
|
-
*/for(a=97;a<123;a++)n[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)n[a-48]=a;for(a=1;a<13;a++)n["f"+a]=a+111;for(a=0;a<10;a++)n["numpad "+a]=a+96;var s=e.names=e.title={};for(a in n)s[n[a]]=a;for(var o in i)n[o]=i[o]})(Rk,Rk.exports)),Rk.exports}var lPe=oPe();const Ba=$a(lPe);function uPe(t){document[t.fsApi_.fullscreenEnabled]&&(t.isFullscreen()?t.exitFullscreen():t.requestFullscreen())}function cPe(t){const e=t.theatreModePlugin().getTheatreMode();t.theatreModePlugin().toggleTheatreMode(!e,{shouldLog:!0})}function dPe(t){const e=t.volume(),r=t.lastVolume_();if(e===0){const n=r<.1?.1:r;t.volume(n),t.muted(!1)}else t.muted(!t.muted())}function Oee(t){t.paused()?t.play():t.pause()}function Lk(t,e){t.currentTime(t.currentTime()+e)}function Mee(t,e){e>0&&t.muted()&&t.muted(!1),t.volume(t.volume()+e)}function fPe(t){const e=t.target,r=["video-js","vjs-tech"];return e.tagName.toLowerCase()==="video"||!!r.find(n=>e.classList.contains(n))}const Iee={f:uPe,m:dPe,k:Oee,space:Oee,t:cPe,left:t=>Lk(t,-5),right:t=>Lk(t,5),j:t=>Lk(t,-10),l:t=>Lk(t,10),up:t=>Mee(t,.05),down:t=>Mee(t,-.05)};function hPe(t,e,r){if(t.ctrlKey||t.metaKey||t.altKey)return;const n=Ba(t),a=["up","down"].includes(n);if(a&&!t.shiftKey||!a&&t.shiftKey||n==="t"&&!r.allowTheatreMode||n==="f"&&!r.allowFullscreen||!Iee[n])return;Iee[n](e,t);const s=fPe(t),o=["space"].includes(n);(s||o)&&(t.preventDefault(),t.stopPropagation())}var Nee=(t=>(t.PhysicallyChapteredVideo="physically-chaptered-video",t))(Nee||{});const pPe={version:"1.42.0-rc.
|
|
288
|
+
*/for(a=97;a<123;a++)n[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)n[a-48]=a;for(a=1;a<13;a++)n["f"+a]=a+111;for(a=0;a<10;a++)n["numpad "+a]=a+96;var s=e.names=e.title={};for(a in n)s[n[a]]=a;for(var o in i)n[o]=i[o]})(Rk,Rk.exports)),Rk.exports}var lPe=oPe();const Ba=$a(lPe);function uPe(t){document[t.fsApi_.fullscreenEnabled]&&(t.isFullscreen()?t.exitFullscreen():t.requestFullscreen())}function cPe(t){const e=t.theatreModePlugin().getTheatreMode();t.theatreModePlugin().toggleTheatreMode(!e,{shouldLog:!0})}function dPe(t){const e=t.volume(),r=t.lastVolume_();if(e===0){const n=r<.1?.1:r;t.volume(n),t.muted(!1)}else t.muted(!t.muted())}function Oee(t){t.paused()?t.play():t.pause()}function Lk(t,e){t.currentTime(t.currentTime()+e)}function Mee(t,e){e>0&&t.muted()&&t.muted(!1),t.volume(t.volume()+e)}function fPe(t){const e=t.target,r=["video-js","vjs-tech"];return e.tagName.toLowerCase()==="video"||!!r.find(n=>e.classList.contains(n))}const Iee={f:uPe,m:dPe,k:Oee,space:Oee,t:cPe,left:t=>Lk(t,-5),right:t=>Lk(t,5),j:t=>Lk(t,-10),l:t=>Lk(t,10),up:t=>Mee(t,.05),down:t=>Mee(t,-.05)};function hPe(t,e,r){if(t.ctrlKey||t.metaKey||t.altKey)return;const n=Ba(t),a=["up","down"].includes(n);if(a&&!t.shiftKey||!a&&t.shiftKey||n==="t"&&!r.allowTheatreMode||n==="f"&&!r.allowFullscreen||!Iee[n])return;Iee[n](e,t);const s=fPe(t),o=["space"].includes(n);(s||o)&&(t.preventDefault(),t.stopPropagation())}var Nee=(t=>(t.PhysicallyChapteredVideo="physically-chaptered-video",t))(Nee||{});const pPe={version:"1.42.0-rc.2"};function Na(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nb(t,e){return nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},nb(t,e)}function Wn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,nb(t,e)}var PL,Ree;function mPe(){if(Ree)return PL;Ree=1,PL=t;function t(e,r){var n,i=null;try{n=JSON.parse(e,r)}catch(a){i=a}return[i,n]}return PL}var gPe=mPe();const vPe=$a(gPe);var Pk={exports:{}},jL,Lee;function yPe(){if(Lee)return jL;Lee=1;var t=b0(),e=function(i,a){return a===void 0&&(a=!1),function(s,o,l){if(s){i(s);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(a)if(t.TextDecoder){var f=r(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(f).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));i({cause:u});return}i(null,l)}};function r(n){return n===void 0&&(n=""),n.toLowerCase().split(";").reduce(function(i,a){var s=a.split("="),o=s[0],l=s[1];return o.trim()==="charset"?l.trim():i},"utf-8")}return jL=e,jL}var Pee;function _Pe(){if(Pee)return Pk.exports;Pee=1;var t=b0(),e=SY(),r=EY();o.httpHandler=yPe();/**
|
|
289
289
|
* @license
|
|
290
290
|
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
|
291
291
|
* Copyright (c) 2014 David Björklund
|