import{bf as Pl,fx as Qwe,aY as S$1,eX as oi,av as E$1,ao as D$1}from'./main-sJAtkqeq.js';var M=(()=>{class e{warnCacheKey;warnCacheResult;errCacheKey;errCacheResult;buildWarn(r){let{videoId:a,state:o}=r,c=`${a}-${o}`;return this.warnCacheKey===c&&this.warnCacheResult?this.warnCacheResult:(this.warnCacheResult=this._buildWarn(r),this.warnCacheKey=c,this.warnCacheResult);}_buildWarn(r){let{videoId:a,state:o}=r,c="Your video file is being processed.",l="This can take a while and some features may not be available until it is complete.",m="Contact your administrator to fix it.",u="Your web browser may not be able to play it.";switch(o){case Pl.PUBLISHED:case Pl.LIVE_ENDED:case Pl.WAITING_FOR_LIVE:return;case Pl.TO_TRANSCODE:return{title:"Transcoding in progress",manageMain:c,manageSecondary:l,watchMain:u,watchSecondary:""};case Pl.TO_IMPORT:return{title:"Import in progress",manageMain:"Your remote video is being imported.",manageSecondary:l,watchMain:"The remote video is being imported, it will be available when the import is complete.",watchSecondary:"",routerLink:{text:"Review your import",link:["/my-library/video-imports"],queryParams:{videoId:a}}};case Pl.TO_IMPORT_FAILED:{let T="The remote video failed to import, it will not be available.";return{title:"Import failed",manageMain:"Your remote video failed to import.",manageSecondary:"",watchMain:T,watchSecondary:"",routerLink:{text:"Review your import",link:["/my-library/video-imports"],queryParams:{videoId:a}}};}case Pl.TO_MOVE_TO_FILE_SYSTEM:return{title:"Moving video files",manageMain:c,manageSecondary:l,watchMain:u,watchSecondary:"The video is being moved to the file system."};case Pl.TO_MOVE_TO_FILE_SYSTEM_FAILED:{let T="Failed to move video files to the platform file system.";return{title:"Failed to move video files",manageMain:T,manageSecondary:m,watchMain:u,watchSecondary:T};}case Pl.TO_MOVE_TO_EXTERNAL_STORAGE:return{title:"Moving video files",manageMain:c,manageSecondary:l,watchMain:u,watchSecondary:"The video is being moved to an external storage."};case Pl.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED:{let T="Failed to move video files to an external storage.";return{title:"Failed to move video files",manageMain:T,manageSecondary:m,watchMain:u,watchSecondary:T};}case Pl.TO_EDIT:return{title:"Studio edition in progress",manageMain:c,manageSecondary:l,watchMain:u,watchSecondary:""};case Pl.TRANSCODING_FAILED:return{title:"Transcoding failed",manageMain:"Failure during transcoding of your video files",manageSecondary:m,watchMain:u,watchSecondary:""};default:return o;}}buildErr(r){let{videoId:a,blacklisted:o,blacklistedReason:c}=r,l=`${a}-${o}-${Qwe(c)}`;return this.errCacheKey===l&&this.errCacheResult?this.errCacheResult:(this.errCacheResult=this._buildErr(r),this.errCacheKey=l,this.errCacheResult);}_buildErr(r){let{blacklisted:a,blacklistedReason:o}=r;if(a)return{title:"Blocked video",main:o||"Your video has been blocked by the platform"};}static ɵfac=function(a){return new(a||e)();};static ɵprov=S$1({token:e,factory:e.ɵfac});}return e;})();var O=e=>typeof e.id=="string"&&typeof e.from=="number"&&typeof e.to=="number"&&typeof e.text=="string",I=e=>!e||/^\s*$/.test(e),E={ID:"ID",TIME_LINE:"TIME_LINE",TEXT:"TEXT",MULTI_LINE_TEXT:"MULTI_LINE_TEXT",FIN_ENTRY:"FIN_ENTRY",FINISH:"FINISH"},h=e=>{let t=e.split(":"),r,a,o;return t.length===2?[a,o]=t:[r,a,o]=t,parseInt(o.replace(",",""),10)+parseInt(a,10)*60*1e3+(r?parseInt(r,10):0)*60*60*1e3;},S=()=>({start(e){let t=E.ID,r={tokens:e.split(/\n/),pos:0,result:[],current:{}};for(;t!==E.FINISH;){let a=this[t](r);r=a.params,t=a.next;}return r.result;},[E.ID](e){let{tokens:t,pos:r,current:a}=e;if(t.length<=r)return{next:E.FINISH,params:e};if(I(t[r]))return{next:E.ID,params:E$1(D$1({},e),{pos:r+1})};let o=t[r].includes("-->");return a.id=o?"":t[r],{next:E.TIME_LINE,params:E$1(D$1({},e),{current:a,tokens:t,pos:o?r:r+1})};},[E.TIME_LINE](e){let{tokens:t,pos:r,current:a}=e,o=t[r],[c,l]=o.split("-->");return a.from=h(c),a.to=h(l),{next:E.TEXT,params:E$1(D$1({},e),{current:a,pos:r+1})};},[E.TEXT](e){let{tokens:t,pos:r,current:a}=e;return t.length<=r?{next:E.FINISH,params:e}:(a.text=t[r],{next:E.MULTI_LINE_TEXT,params:E$1(D$1({},e),{current:a,pos:r+1})});},[E.MULTI_LINE_TEXT](e){let{tokens:t,pos:r,current:a}=e;return t.length<=r||I(t[r])?{next:E.FIN_ENTRY,params:e}:(a.text=`${a.text}
${t[r]}`,{next:E.MULTI_LINE_TEXT,params:E$1(D$1({},e),{current:a,pos:r+1})});},[E.FIN_ENTRY](e){let{pos:t,current:r,result:a}=e;if(O(r))a.push(r);else throw new Error(`Parsing error current not complete ${JSON.stringify(r)}`);return{next:E.ID,params:E$1(D$1({},e),{current:{},pos:t+1})};},[E.FINISH](e){return{next:E.FINISH,params:e};}}),L=e=>({entries:S().start(e)}),n={HEADER:"HEADER",ID:"ID",TIME_LINE:"TIME_LINE",ID_OR_NOTE_OR_STYLE_OR_REGION:"ID_OR_NOTE_OR_STYLE_OR_REGION",STYLE:"STYLE",NOTE:"NOTE",REGION:"REGION",LEGACY_HEADER:"LEGACY_HEADER",TEXT:"TEXT",MULTI_LINE_TEXT:"MULTI_LINE_TEXT",FIN_ENTRY:"FIN_ENTRY",FINISH:"FINISH"},R=e=>{let t=e.split(":"),r,a,o;return t.length===2?[a,o]=t:[r,a,o]=t,parseInt(o.replace(".",""),10)+parseInt(a,10)*60*1e3+(r?parseInt(r,10):0)*60*60*1e3;},g=()=>({start(e){let t=n.HEADER,r={tokens:e.split(/\n/),pos:0,result:[],current:{}};for(;t!==n.FINISH;){let a=this[t](r);r=a.params,t=a.next;}return r.result;},[n.HEADER](e){return{next:n.LEGACY_HEADER,params:E$1(D$1({},e),{pos:e.pos+1})};},[n.LEGACY_HEADER](e){let{tokens:t,pos:r}=e;return t.length<=r?{next:n.FINISH,params:e}:t[r].includes(":")&&!t[r].includes("-->")?{next:n.LEGACY_HEADER,params:E$1(D$1({},e),{pos:r+1})}:{next:n.ID_OR_NOTE_OR_STYLE_OR_REGION,params:e};},[n.ID_OR_NOTE_OR_STYLE_OR_REGION](e){let{tokens:t,pos:r}=e;return t.length<=r?{next:n.FINISH,params:e}:I(t[r])?{next:n.ID_OR_NOTE_OR_STYLE_OR_REGION,params:E$1(D$1({},e),{pos:r+1})}:t[r].toUpperCase().includes("NOTE")?{next:n.NOTE,params:e}:t[r].toUpperCase().includes("STYLE")?{next:n.STYLE,params:e}:t[r].toUpperCase().includes("REGION")?{next:n.REGION,params:e}:{next:n.ID,params:e};},[n.STYLE](e){let{tokens:t,pos:r}=e;return I(t[r])?{next:n.ID_OR_NOTE_OR_STYLE_OR_REGION,params:E$1(D$1({},e),{pos:r+1})}:{next:n.STYLE,params:E$1(D$1({},e),{pos:r+1})};},[n.NOTE](e){let{tokens:t,pos:r}=e;return I(t[r])?{next:n.ID_OR_NOTE_OR_STYLE_OR_REGION,params:E$1(D$1({},e),{pos:r+1})}:{next:n.STYLE,params:E$1(D$1({},e),{pos:r+1})};},[n.REGION](e){let{tokens:t,pos:r}=e;return I(t[r])?{next:n.ID_OR_NOTE_OR_STYLE_OR_REGION,params:E$1(D$1({},e),{pos:r+1})}:{next:n.REGION,params:E$1(D$1({},e),{pos:r+1})};},[n.ID](e){let{tokens:t,pos:r,current:a}=e;if(t.length<=r)return{next:n.FINISH,params:e};if(I(t[r]))return{next:n.ID,params:E$1(D$1({},e),{pos:r+1})};let o=t[r].includes("-->");return a.id=o?"":t[r],{next:n.TIME_LINE,params:E$1(D$1({},e),{current:a,tokens:t,pos:o?r:r+1})};},[n.TIME_LINE](e){let{tokens:t,pos:r,current:a}=e,o=t[r],[c,l]=o.split("-->");return a.from=R(c),a.to=R(l),{next:n.TEXT,params:E$1(D$1({},e),{current:a,pos:r+1})};},[n.TEXT](e){let{tokens:t,pos:r,current:a}=e;return t.length<=r?{next:n.FINISH,params:e}:(a.text=t[r],{next:n.MULTI_LINE_TEXT,params:E$1(D$1({},e),{current:a,pos:r+1})});},[n.MULTI_LINE_TEXT](e){let{tokens:t,pos:r,current:a}=e;return t.length<=r||I(t[r])?{next:n.FIN_ENTRY,params:e}:(a.text=`${a.text}
${t[r]}`,{next:n.MULTI_LINE_TEXT,params:E$1(D$1({},e),{current:a,pos:r+1})});},[n.FIN_ENTRY](e){let{pos:t,current:r,result:a}=e;if(O(r))a.push(r);else throw new Error(`Parsing error current not complete ${JSON.stringify(r)}`);return{next:n.ID_OR_NOTE_OR_STYLE_OR_REGION,params:E$1(D$1({},e),{current:{},pos:t+1})};},[n.FINISH](e){return{next:n.FINISH,params:e};}}),y=e=>({entries:g().start(e)}),D=e=>e.startsWith("WEBVTT")?y(e):L(e);var Y=(()=>{class e{transform(r){let a=Math.floor(r/3600),o=Math.floor(r%3600/60),c=r%60;if(a>0){let l=""+a+"h";return o!==0&&(l+=" "+(""+o+"min")),c!==0&&(l+=" "+(""+c+"sek")),l;}if(o>0){let l=""+o+"min";return c!==0&&(l+=" "+(""+c+"sek")),l;}return""+c+" sek\n        ";}static ɵfac=function(a){return new(a||e)();};static ɵpipe=oi({name:"myTimeDurationFormatter",type:e,pure:true});}return e;})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{D,M,Y};//# sourceMappingURL=chunk-CyPgJ3OZ.js.map