text: (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{"+fqm":function(t,e,n){"use strict";n.d(e,"a",(function(){return Et}));var i=n("fXoL"),a=n("2Vo4"),o=n("oSJP"),s=n("He21"),r=n("7EHt"),c=n("/RwR"),l=n("lJxs"),d=n("nYR2"),u=n("Lm4C"),m=n("QeDF"),b=n("XFMS"),p=n("oJgS"),h=n("/Sbb"),g=n("XSk8"),f=n("3Pt+"),v=n("twBr"),x=n("IAz0"),k=n("i2dy"),C=n("QGXG"),O=n("2zME"),y=n("h586"),_=n("Se92"),I=n("tyNb"),T=n("kmQS"),P=n("OkhP"),w=n("ofXK"),M=n("pCVY"),U=n("bTqV"),B=n("Rd8u"),A=n("I3oe"),F=n("gcYM"),D=n("eNwd"),E=n("bv9b"),$=n("NFeN"),V=n("Qu3c"),j=n("zW5C");function S(t,e){if(1&t&&(i.Ub(0,"div",7),i.Ic(1),i.Ub(2,"span",8),i.Ic(3,"left"),i.Tb(),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Kc(" ",t.progress.eta," ")}}function G(t,e){1&t&&(i.Pb(0,"mat-icon",9),i.gc(1,"trans")),2&t&&i.mc("matTooltip",i.hc(1,1,e.ngIf))}function z(t,e){1&t&&(i.Ub(0,"span",8),i.Ic(1,"Upload complete."),i.Tb())}function L(t,e){1&t&&(i.Ub(0,"span",8),i.Ic(1,"We are processing your track for playback\u2026"),i.Tb())}function R(t,e){if(1&t){const t=i.Vb();i.Ub(0,"span",12),i.bc("click",(function(){return i.xc(t),i.fc(2).upload.cancel()})),i.Ic(1,"Cancel"),i.Tb()}}function Q(t,e){if(1&t&&(i.Gc(0,z,2,0,"span",10),i.Gc(1,L,2,0,"span",10),i.gc(2,"async"),i.Gc(3,R,2,0,"span",11),i.gc(4,"async")),2&t){const t=i.fc();i.mc("ngIf",t.upload.completed),i.Bb(1),i.mc("ngIf",i.hc(2,3,t.upload.processing$)),i.Bb(2),i.mc("ngIf",!i.hc(4,5,t.upload.processing$)&&!t.upload.completed)}}let q=(()=>{class t{constructor(t){this.cd=t}ngOnChanges(){this.subscription&&this.subscription.unsubscribe(),this.subscription=this.upload.progress$.pipe(Object(F.a)(260,D.a,{leading:!0,trailing:!0})).subscribe(t=>{this.progress=t,this.cd.detectChanges()})}ngOnDestroy(){this.subscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(i.h))},t.\u0275cmp=i.Ib({type:t,selectors:[["track-upload-header"]],inputs:{upload:"upload"},features:[i.zb],decls:11,vars:10,consts:[[1,"meta"],[1,"name"],["class","time-left",4,"ngIf"],[1,"actions"],["class","error-icon action-icon","svgIcon","error-outline","matTooltipPosition","left",3,"matTooltip",4,"ngIf","ngIfElse"],["noError",""],["color","accent",3,"mode","value"],[1,"time-left"],["trans",""],["svgIcon","error-outline","matTooltipPosition","left",1,"error-icon","action-icon",3,"matTooltip"],["trans","",4,"ngIf"],["class","cancel-button","trans","",3,"click",4,"ngIf"],["trans","",1,"cancel-button",3,"click"]],template:function(t,e){if(1&t&&(i.Ub(0,"div",0),i.Ub(1,"div",1),i.Ic(2),i.Tb(),i.Gc(3,S,4,1,"div",2),i.Ub(4,"div",3),i.Gc(5,G,2,3,"mat-icon",4),i.gc(6,"async"),i.Gc(7,Q,5,7,"ng-template",null,5,i.Hc),i.Tb(),i.Tb(),i.Pb(9,"mat-progress-bar",6),i.gc(10,"async")),2&t){const t=i.uc(8);i.Bb(2),i.Jc(e.upload.uploadedFile.name),i.Bb(1),i.mc("ngIf",e.progress.percentage&&e.progress.percentage<100&&!e.upload.error$.value),i.Bb(2),i.mc("ngIf",i.hc(6,6,e.upload.error$))("ngIfElse",t),i.Bb(4),i.mc("mode",i.hc(10,8,e.upload.processing$)?"indeterminate":"determinate")("value",e.progress.percentage)}},directives:[w.t,E.a,B.a,$.a,V.a],pipes:[w.b,j.a],styles:["[_nghost-%COMP%]{display:block;color:var(--be-secondary-text);font-size:1.3rem}.meta[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:5px}.name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}.name[_ngcontent-%COMP%], .time-left[_ngcontent-%COMP%]{white-space:nowrap}.actions[_ngcontent-%COMP%], .time-left[_ngcontent-%COMP%]{padding-left:20px}.actions[_ngcontent-%COMP%]{margin-left:auto}.action-icon[_ngcontent-%COMP%]{vertical-align:middle;width:22px;height:22px;margin-bottom:4px}.completed-icon[_ngcontent-%COMP%]{color:#43a047}.error-icon[_ngcontent-%COMP%]{color:#f44336}.cancel-button[_ngcontent-%COMP%]{color:var(--be-link);cursor:pointer;font-size:1.2rem;text-transform:uppercase;line-height:22px}.cancel-button[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0}),t})();var J=n("Kj3r"),N=n("/uUt"),H=n("eIep"),X=n("JIr8"),K=n("LRne"),Y=n("yofV"),W=n("STbY"),Z=n("FBzJ"),tt=n("8HKz");const et=["searchInput"];function nt(t,e){if(1&t&&(i.Sb(0),i.Pb(1,"media-image",22),i.Ub(2,"div",23),i.Ic(3),i.Tb(),i.Rb()),2&t){const t=e.ngIf;i.Bb(1),i.mc("media",t),i.Bb(2),i.Jc(t.name)}}function it(t,e){1&t&&(i.Ub(0,"div",24),i.Ic(1,"None"),i.Tb())}function at(t,e){if(1&t){const t=i.Vb();i.Ub(0,"button",25),i.bc("click",(function(){return i.xc(t),i.fc().clearSearchInput()})),i.Pb(1,"mat-icon",26),i.Tb()}}function ot(t,e){if(1&t){const t=i.Vb();i.Ub(0,"button",16),i.bc("click",(function(){i.xc(t);const n=e.$implicit;return i.fc().selectAlbum(n)})),i.Pb(1,"media-image",22),i.Ub(2,"div",27),i.Ub(3,"div",28),i.Ic(4),i.Tb(),i.Ub(5,"div",29),i.Ic(6),i.Tb(),i.Tb(),i.Tb()}if(2&t){const t=e.$implicit;i.Bb(1),i.mc("media",t),i.Bb(3),i.Jc(t.name),i.Bb(2),i.Jc(null==t||null==t.artist?null:t.artist.name)}}function st(t,e){1&t&&(i.Ub(0,"button",30),i.Ic(1,"No albums found."),i.Tb())}let rt=(()=>{class t{constructor(t){this.search=t,this.searchFormControl=new f.i,this.loading$=new a.a(!1),this.results$=new a.a([]),this.selectedAlbum$=new a.a(null),this.searchedOnce=!1}ngOnInit(){this.bindToSearchControl()}writeValue(t){this.selectedAlbum$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}bindToSearchControl(){this.searchFormControl.valueChanges.pipe(Object(J.a)(150),Object(N.a)(),Object(H.a)(t=>this.searchAlbums(t)),Object(X.a)(()=>Object(K.a)([]))).subscribe(t=>{this.searchedOnce=!0,this.results$.next(t)})}searchAlbums(t){return this.loading$.next(!0),this.search.media(t,{forceLocal:!0,limit:7,modelTypes:[Y.a]}).pipe(Object(d.a)(()=>this.loading$.next(!1)),Object(l.a)(t=>t.results.albums))}onMenuOpened(){this.searchedOnce||this.clearSearchInput()}selectAlbum(t){this.selectedAlbum$.next(t),this.propagateChange(t)}clearSearchInput(){this.searchFormControl.setValue("")}onMenuClosed(){this.loading$.next(!1),this.clearSearchInput()}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(P.a))},t.\u0275cmp=i.Ib({type:t,selectors:[["album-control"]],viewQuery:function(t,e){var n;1&t&&i.Ec(et,!0),2&t&&i.tc(n=i.cc())&&(e.searchInput=n.first)},features:[i.Ab([{provide:f.s,useExisting:t,multi:!0}])],decls:29,vars:16,consts:[[1,"many-inputs"],[1,"input-container"],["trans","",1,"fake-label"],["tabindex","0",1,"fake-input",3,"matMenuTriggerFor","menuOpened","menuClosed"],[4,"ngIf","ngIfElse"],["anyAlbum",""],[1,"arrow-container"],[1,"arrow"],[1,"add-album-control-menu"],["menu","matMenu"],[1,"input-container","search-input-container",3,"click"],[1,"search-input-wrapper"],["type","text","placeholder","Search...","mat-menu-item","","trans-placeholder","",3,"formControl","blur"],["searchInput",""],["class","clear-search-input-button","mat-icon-button","",3,"click",4,"ngIf"],[1,"small",3,"isVisible"],["mat-menu-item","",3,"click"],["default","album"],[1,"info","any-user-info"],["trans","",1,"name"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","","disabled","","trans","",4,"ngIf"],[3,"media"],[1,"title-name"],["trans","",1,"title-name"],["mat-icon-button","",1,"clear-search-input-button",3,"click"],["svgIcon","close"],[1,"user-info"],[1,"name"],[1,"email"],["mat-menu-item","","disabled","","trans",""]],template:function(t,e){if(1&t){const t=i.Vb();i.Ub(0,"div",0),i.Ub(1,"div",1),i.Ub(2,"div",2),i.Ic(3,"Album"),i.Tb(),i.Ub(4,"div",3),i.bc("menuOpened",(function(){return e.onMenuOpened()}))("menuClosed",(function(){return e.onMenuClosed()})),i.Gc(5,nt,4,2,"ng-container",4),i.gc(6,"async"),i.Gc(7,it,2,0,"ng-template",null,5,i.Hc),i.Ub(9,"div",6),i.Pb(10,"div",7),i.Tb(),i.Tb(),i.Tb(),i.Tb(),i.Ub(11,"mat-menu",8,9),i.Ub(13,"div",10),i.bc("click",(function(t){return t.stopPropagation()})),i.Ub(14,"div",11),i.Ub(15,"input",12,13),i.bc("blur",(function(){return i.xc(t),i.uc(16).focus()})),i.Tb(),i.Gc(17,at,2,0,"button",14),i.Pb(18,"loading-indicator",15),i.gc(19,"async"),i.Tb(),i.Tb(),i.Ub(20,"button",16),i.bc("click",(function(){return e.selectAlbum(null)})),i.Pb(21,"media-image",17),i.Ub(22,"div",18),i.Ub(23,"div",19),i.Ic(24,"No Album"),i.Tb(),i.Tb(),i.Tb(),i.Gc(25,ot,7,3,"button",20),i.gc(26,"async"),i.Gc(27,st,2,0,"button",21),i.gc(28,"async"),i.Tb()}if(2&t){const t=i.uc(8),n=i.uc(12);i.Bb(4),i.mc("matMenuTriggerFor",n),i.Bb(1),i.mc("ngIf",i.hc(6,8,e.selectedAlbum$))("ngIfElse",t),i.Bb(10),i.mc("formControl",e.searchFormControl),i.Bb(2),i.mc("ngIf",e.searchFormControl.value),i.Bb(1),i.mc("isVisible",i.hc(19,10,e.loading$)),i.Bb(7),i.mc("ngForOf",i.hc(26,12,e.results$)),i.Bb(2),i.mc("ngIf",e.searchedOnce&&!i.hc(28,14,e.results$).length)}},directives:[B.a,W.c,w.t,W.d,f.d,W.a,f.u,f.j,Z.a,tt.a,w.s,U.b,$.a],pipes:[w.b],styles:["[_nghost-%COMP%]{display:block;min-width:280px;max-width:100%}.fake-input[_ngcontent-%COMP%]{display:flex;align-items:center}.fake-label[_ngcontent-%COMP%]{text-transform:capitalize}.title-name[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}media-image[_ngcontent-%COMP%]{display:inline-block;margin-right:8px;width:35px;height:35px;flex-shrink:0;border-radius:4px;vertical-align:middle}.arrow-container[_ngcontent-%COMP%]{flex-shrink:0;padding-left:8px;margin-left:auto}.arrow[_ngcontent-%COMP%]{border-color:#000 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0}  .add-album-control-menu{width:280px}.mat-menu-item[_ngcontent-%COMP%]:first-of-type{border-top:1px solid var(--be-divider-default)}.search-input-container[_ngcontent-%COMP%]{padding:2px 10px 10px}.search-input-wrapper[_ngcontent-%COMP%]{position:relative}.clear-search-input-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:0;color:var(--be-secondary-text)}.mat-menu-item[_ngcontent-%COMP%]{display:flex;vertical-align:middle}.mat-menu-item.selected[_ngcontent-%COMP%]{background-color:var(--be-accent-emphasis)}.mat-menu-item[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:35px;height:35px;flex-shrink:0}.mat-menu-item[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{text-transform:capitalize;overflow:hidden;text-overflow:ellipsis}.mat-menu-item[_ngcontent-%COMP%]   .email[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem;overflow:hidden;text-overflow:ellipsis}.user-info[_ngcontent-%COMP%]{line-height:normal;overflow:hidden}.any-user-info[_ngcontent-%COMP%]{line-height:35px}loading-indicator[_ngcontent-%COMP%]{position:absolute;top:12px;right:40px}.disabled[_ngcontent-%COMP%]{pointer-events:none;opacity:.7}"],changeDetection:0}),t})();var ct=n("+Bz4"),lt=n("/1cH"),dt=n("A5z7"),ut=n("FKr1");function mt(t,e){if(1&t){const t=i.Vb();i.Ub(0,"mat-chip",9),i.bc("removed",(function(){i.xc(t);const n=e.$implicit;return i.fc().deselectArtist(n)})),i.Pb(1,"img",10),i.Ic(2),i.Pb(3,"mat-icon",11),i.Tb()}if(2&t){const t=e.$implicit;i.mc("removable",!0),i.Bb(1),i.mc("src",t.image,i.Ac)("alt",t.name),i.Bb(1),i.Kc(" ",t.name," ")}}function bt(t,e){if(1&t&&(i.Ub(0,"mat-option",12),i.Pb(1,"img",10),i.Ub(2,"span"),i.Ic(3),i.Tb(),i.Tb()),2&t){const t=e.$implicit;i.mc("value",t),i.Bb(1),i.mc("src",t.image,i.Ac)("alt",t.name+" image"),i.Bb(2),i.Jc(t.name)}}function pt(t,e){if(1&t&&(i.Ub(0,"div",13),i.Ic(1),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Jc(t.error)}}let ht=(()=>{class t{constructor(t){this.search=t,this.searchUsers=!1,this.searchControl=new f.i,this.value$=new a.a([])}ngOnInit(){this.bindSearchControl()}writeValue(t){this.value$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}deselectArtist(t){const e=this.value$.value.filter(e=>e.id!==t.id);this.value$.next(e),this.propagateChange(this.value$.value)}selectArtist(t){this.value$.next([...this.value$.value,t]),this.propagateChange(this.value$.value)}bindSearchControl(){this.searchResults$=this.searchControl.valueChanges.pipe(Object(N.a)(),Object(J.a)(250),Object(H.a)(t=>this.findMatches(t)))}findMatches(t){return t&&"string"==typeof t?this.search.media(t,{limit:7,forceLocal:!0,modelTypes:[ct.a]}).pipe(Object(l.a)(t=>t.results.artists)):Object(K.a)([])}displayFn(t){return null}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(P.a))},t.\u0275cmp=i.Ib({type:t,selectors:[["track-artist-control"]],hostAttrs:[1,"custom-control"],inputs:{error:"error",searchUsers:"searchUsers",id:"id"},features:[i.Ab([y.a,{provide:f.s,useExisting:t,multi:!0}])],decls:12,vars:13,consts:[[1,"input-container"],["trans","",3,"for"],["type","text","placeholder","Search artists and users...","trans-placeholder","",3,"id","formControl","matAutocomplete"],[3,"selectable"],["class","chip-with-image",3,"removable","removed",4,"ngFor","ngForOf"],[1,"media-autocomplete-panel",3,"displayWith","optionSelected"],["artistAuto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["class","error",4,"ngIf"],[1,"chip-with-image",3,"removable","removed"],[3,"src","alt"],["svgIcon","cancel","matChipRemove",""],[3,"value"],[1,"error"]],template:function(t,e){if(1&t&&(i.Ub(0,"div",0),i.Ub(1,"label",1),i.Ic(2,"Artists"),i.Tb(),i.Pb(3,"input",2),i.Ub(4,"mat-chip-list",3),i.Gc(5,mt,4,4,"mat-chip",4),i.gc(6,"async"),i.Tb(),i.Ub(7,"mat-autocomplete",5,6),i.bc("optionSelected",(function(t){return e.selectArtist(t.option.value)})),i.Gc(9,bt,4,4,"mat-option",7),i.gc(10,"async"),i.Tb(),i.Gc(11,pt,2,1,"div",8),i.Tb()),2&t){const t=i.uc(8);i.Bb(1),i.mc("for",e.id),i.Bb(2),i.mc("id",e.id)("formControl",e.searchControl)("matAutocomplete",t),i.Bb(1),i.mc("selectable",!1),i.Bb(1),i.mc("ngForOf",i.hc(6,9,e.value$)),i.Bb(2),i.mc("displayWith",e.displayFn),i.Bb(2),i.mc("ngForOf",i.hc(10,11,e.searchResults$)),i.Bb(2),i.mc("ngIf",e.error)}},directives:[B.a,f.d,lt.c,f.u,f.j,dt.c,w.s,lt.a,w.t,dt.a,$.a,dt.d,ut.l],pipes:[w.b],styles:["[_nghost-%COMP%]{display:block}.mat-chip-list[_ngcontent-%COMP%]{display:block;margin-top:15px}.mat-standard-chip.chip-with-image[_ngcontent-%COMP%]{padding-left:0}.mat-standard-chip.chip-with-image[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:32px;height:32px;-o-object-fit:cover;object-fit:cover;border-radius:16px;margin-right:8px}"],changeDetection:0}),t})();function gt(t,e){if(1&t&&i.Pb(0,"track-upload-header",23),2&t){const t=i.fc(2);i.mc("upload",t.uploadQueueItem)}}function ft(t,e){if(1&t){const t=i.Vb();i.Ub(0,"div",24),i.kc(1),i.Ub(2,"div",14),i.Ub(3,"label",25),i.Ic(4,"Title"),i.Tb(),i.Pb(5,"input",26),i.Tb(),i.Ub(6,"div",27),i.Ub(7,"button",28),i.bc("click",(function(){return i.xc(t),i.fc(2).toggleExpandedState()})),i.Pb(8,"mat-icon",29),i.Tb(),i.Ub(9,"button",28),i.bc("click",(function(){return i.xc(t),i.fc(2).maybeCancel()})),i.Pb(10,"mat-icon",30),i.Tb(),i.Tb(),i.Tb()}if(2&t){const t=i.fc(2);i.mc("formGroup",t.form),i.Bb(3),i.mc("for","track-form-"+t.uniqueId+"-name"),i.Bb(2),i.mc("id","track-form-"+t.uniqueId+"-name"),i.Bb(2),i.Fb("active",t.expanded)}}function vt(t,e){1&t&&(i.Ub(0,"span",31),i.Ic(1,"Replace File"),i.Tb())}function xt(t,e){1&t&&(i.Ub(0,"span",31),i.Ic(1,"Upload Track"),i.Tb())}function kt(t,e){if(1&t&&(i.Ub(0,"div",32),i.Ic(1),i.Tb()),2&t){const t=i.fc(2).ngIf;i.Bb(1),i.Jc(t.name)}}function Ct(t,e){if(1&t&&(i.Ub(0,"div",14),i.Ub(1,"label",15),i.Ic(2,"Title"),i.Tb(),i.Pb(3,"input",26),i.Gc(4,kt,2,1,"div",17),i.Tb()),2&t){const t=i.fc().ngIf,e=i.fc();i.Bb(1),i.mc("for","track-form-"+e.uniqueId+"-name"),i.Bb(2),i.mc("id","track-form-"+e.uniqueId+"-name"),i.Bb(1),i.mc("ngIf",t.name)}}function Ot(t,e){if(1&t&&i.Pb(0,"album-control",33),2&t){const t=i.fc(2);i.mc("id","track-form-"+t.uniqueId+"-album_id")}}function yt(t,e){if(1&t&&i.Pb(0,"track-artist-control",34),2&t){const t=i.fc().ngIf,e=i.fc();i.mc("error",t.artists)("id","track-form-"+e.uniqueId+"-artists")}}function _t(t,e){if(1&t&&(i.Ub(0,"div",32),i.Ic(1),i.Tb()),2&t){const t=i.fc().ngIf;i.Bb(1),i.Jc(t.duration)}}function It(t,e){if(1&t&&(i.Ub(0,"div",32),i.Ic(1),i.Tb()),2&t){const t=i.fc(2).ngIf;i.Bb(1),i.Jc(t.youtube_id)}}function Tt(t,e){if(1&t&&(i.Ub(0,"div",14),i.Ub(1,"label",15),i.Ic(2,"Youtube Video ID"),i.Tb(),i.Pb(3,"input",35),i.Gc(4,It,2,1,"div",17),i.Ub(5,"p"),i.Ic(6,"ID only. https://www.youtube.com/embed?v="),i.Ub(7,"strong"),i.Ic(8,"EPyh41zPg4Z"),i.Tb(),i.Tb(),i.Tb()),2&t){const t=i.fc().ngIf,e=i.fc();i.Bb(1),i.mc("for","track-form-"+e.uniqueId+"-track-youtube-id"),i.Bb(2),i.mc("id","track-form-"+e.uniqueId+"-track-youtube-id"),i.Bb(1),i.mc("ngIf",t.youtube_id)}}function Pt(t,e){if(1&t&&(i.Ub(0,"div",32),i.Ic(1),i.Tb()),2&t){const t=i.fc(2).ngIf;i.Bb(1),i.Jc(t.url)}}function wt(t,e){if(1&t&&(i.Ub(0,"div",14),i.Ub(1,"label",15),i.Ic(2,"Remote Track Url"),i.Tb(),i.Pb(3,"input",36),i.Gc(4,Pt,2,1,"div",17),i.Tb()),2&t){const t=i.fc().ngIf,e=i.fc();i.Bb(1),i.mc("for","track-form-"+e.uniqueId+"-track-url"),i.Bb(2),i.mc("id","track-form-"+e.uniqueId+"-track-url"),i.Bb(1),i.mc("ngIf",t.url)}}function Mt(t,e){if(1&t&&(i.Ub(0,"div",32),i.Ic(1),i.Tb()),2&t){const t=i.fc().ngIf;i.Bb(1),i.Jc(t.genres)}}function Ut(t,e){if(1&t&&(i.Ub(0,"div",32),i.Ic(1),i.Tb()),2&t){const t=i.fc().ngIf;i.Bb(1),i.Jc(t.tags)}}function Bt(t,e){if(1&t&&(i.Ub(0,"button",37),i.gc(1,"async"),i.Ic(2,"Save"),i.Tb()),2&t){const t=i.fc(2);i.mc("disabled",i.hc(1,1,t.loading$)||t.uploadQueueItem&&!t.uploadQueueItem.completed)}}function At(t,e){if(1&t){const t=i.Vb();i.Ub(0,"button",38),i.bc("click",(function(){return i.xc(t),i.fc(2).maybeCancel()})),i.Ic(1,"Cancel"),i.Tb()}}function Ft(t,e){if(1&t){const t=i.Vb();i.Ub(0,"form",1),i.bc("ngSubmit",(function(){return i.xc(t),i.fc().submit()})),i.Gc(1,gt,1,1,"track-upload-header",2),i.Gc(2,ft,11,5,"div",3),i.Ub(3,"div",4),i.Ub(4,"div",5),i.Ub(5,"div",6),i.Pb(6,"upload-image-control",7),i.gc(7,"async"),i.Ub(8,"button",8),i.bc("click",(function(){return i.xc(t),i.fc().openUploadMusicModal()})),i.Gc(9,vt,2,0,"span",9),i.Gc(10,xt,2,0,"span",9),i.Tb(),i.Tb(),i.Ub(11,"div",10),i.Gc(12,Ct,5,3,"div",11),i.Gc(13,Ot,1,1,"album-control",12),i.Gc(14,yt,1,2,"track-artist-control",13),i.Ub(15,"div",14),i.Ub(16,"label",15),i.Ic(17,"Duration (ms)"),i.Tb(),i.Pb(18,"input",16),i.Gc(19,_t,2,1,"div",17),i.Tb(),i.Gc(20,Tt,9,3,"div",11),i.Gc(21,wt,5,3,"div",11),i.Ub(22,"div",14),i.Ub(23,"label",15),i.Ic(24,"Genres"),i.Tb(),i.Pb(25,"chip-input",18),i.Gc(26,Mt,2,1,"div",17),i.Tb(),i.Ub(27,"div",14),i.Ub(28,"label",15),i.Ic(29,"Tags"),i.Tb(),i.Pb(30,"chip-input",19),i.Gc(31,Ut,2,1,"div",17),i.Tb(),i.Ub(32,"div",14),i.Ub(33,"label",15),i.Ic(34,"Description"),i.Tb(),i.Pb(35,"textarea",20),i.Tb(),i.Gc(36,Bt,3,3,"button",21),i.Gc(37,At,2,0,"button",22),i.Tb(),i.Tb(),i.Tb(),i.Tb()}if(2&t){const t=e.ngIf,n=i.fc();i.mc("formGroup",n.form),i.Bb(1),i.mc("ngIf",n.uploadQueueItem),i.Bb(1),i.mc("ngIf",n.albumForm),i.Bb(1),i.mc("@bodyExpansion",n.getExpandedState()),i.Bb(1),i.Fb("inside-album",n.albumForm),i.Bb(2),i.mc("defaultBackground",i.hc(7,29,n.defaultImage$)),i.Bb(3),i.mc("ngIf",n.track),i.Bb(1),i.mc("ngIf",!n.track),i.Bb(2),i.mc("ngIf",!n.albumForm),i.Bb(1),i.mc("ngIf",!n.albumForm&&("artist"===n.settings.get("player.artist_type")||n.insideAdmin())),i.Bb(1),i.mc("ngIf","artist"===n.settings.get("player.artist_type")||n.insideAdmin()),i.Bb(2),i.mc("for","track-form-"+n.uniqueId+"-duration"),i.Bb(2),i.mc("id","track-form-"+n.uniqueId+"-duration"),i.Bb(1),i.mc("ngIf",t.duration),i.Bb(1),i.mc("ngIf",n.insideAdmin()),i.Bb(1),i.mc("ngIf",n.insideAdmin()),i.Bb(2),i.mc("for","track-form-"+n.uniqueId+"-track-genres"),i.Bb(2),i.mc("id","track-form-"+n.uniqueId+"-track-genres")("suggestFn",n.suggestGenreFn),i.Bb(1),i.mc("ngIf",t.genres),i.Bb(2),i.mc("for","track-form-"+n.uniqueId+"-track-tags"),i.Bb(2),i.mc("id","track-form-"+n.uniqueId+"-track-tags")("suggestFn",n.suggestTagFn),i.Bb(1),i.mc("ngIf",t.tags),i.Bb(2),i.mc("for","track-form-"+n.uniqueId+"-track-description"),i.Bb(2),i.mc("id","track-form-"+n.uniqueId+"-track-description"),i.Bb(1),i.mc("ngIf",!n.albumForm),i.Bb(1),i.mc("ngIf",!n.albumForm&&!n.track)}}const Dt=["*"];let Et=(()=>{class t{constructor(t,e,n,s,r,c,d,u,m,b,h,f){this.fb=t,this.currentUser=e,this.tracks=n,this.toast=s,this.modal=r,this.audioValidator=c,this.uploadQueue=d,this.waveGenerator=u,this.router=m,this.settings=b,this.cd=h,this.search=f,this.autoMatch=!1,this.canceled=new i.n,this.saved=new i.n,this.errors$=new a.a({}),this.defaultImage$=new a.a(o.a.album),this.loading$=new a.a(!1),this.uniqueId=Object(p.a)(5),this.form=this.fb.group({id:[null],name:[""],image:[""],description:[""],number:[1],tags:[[]],genres:[[]],duration:[null],url:[""],youtube_id:[""],spotify_popularity:[""],album:[null],artists:[[]],waveData:[null],lyrics:[""]}),this.expanded=!1,this.suggestTagFn=t=>this.search.media(t,{modelTypes:["App\\Tag"],limit:5}).pipe(Object(l.a)(t=>t.results.tags.map(t=>t.name))),this.suggestGenreFn=t=>this.search.media(t,{modelTypes:[g.a],limit:5}).pipe(Object(l.a)(t=>t.results.genres.map(t=>t.name)))}ngOnChanges(t){t.number&&null!=t.number.currentValue&&this.form.patchValue({number:t.number.currentValue})}ngOnInit(){if(this.expanded=!this.albumForm,this.track){const t=Object.assign({},this.track);t.tags=(this.track.tags||[]).map(t=>t.name),t.genres=(this.track.genres||[]).map(t=>t.display_name||t.name),this.form.patchValue(t),this.track.album&&this.defaultImage$.next(this.track.album.image||o.a.album)}this.uploadQueueItem&&this.uploadQueueItem.uploadedResponse$.subscribe(t=>{this.patchFormUsingFileUpload(t)}),this.albumForm&&this.albumForm.get("image").valueChanges.subscribe(t=>{this.defaultImage$.next(t||o.a.album)})}getPayload(){const t=this.uploadQueueItem?this.uploadQueueItem.customData:{},e=Object.assign(Object.assign({},this.form.value),t);return e.artists.length||"user"!==this.settings.get("player.artist_type")||(e.artists=[{id:this.currentUser.get("id"),artist_type:s.a}]),e}isUploading(){return this.uploadQueueItem&&!this.uploadQueueItem.completed}submit(){if(this.albumForm)return;this.loading$.next(!0);const t=this.getPayload();(this.track?this.tracks.update(this.track.id,t):this.tracks.create(t)).pipe(Object(d.a)(()=>this.loading$.next(!1))).subscribe(t=>{this.uploadQueueItem&&this.uploadQueue.remove(this.uploadQueueItem.id),this.toast.open("Track saved."),this.form.markAsPristine(),this.saved.emit(t.track)},t=>{this.errors$.next(t.errors),Object(h.a)(this.errors$.value,"track-form-"+this.uniqueId)})}toggleExpandedState(){this.expanded=!this.expanded}getExpandedState(){return this.expanded?"expanded":"collapsed"}maybeCancel(){this.modal.show(c.a,{title:"Remove Track",body:"Are you sure you want to cancel the upload and remove this track?",ok:"Remove"}).beforeClosed().subscribe(t=>{t&&(this.uploadQueueItem?(this.uploadQueue.remove(this.uploadQueueItem.id),this.canceled.emit(this.uploadQueueItem),this.toast.open("Upload canceled.")):this.track&&this.tracks.delete([this.track.id]).subscribe(()=>{this.canceled.emit(this.track),this.toast.open("Track deleted.")}))})}openUploadMusicModal(){const t={uri:"uploads",validator:this.audioValidator,httpParams:{autoMatch:this.autoMatch,diskPrefix:"track_media",disk:"public"},willProcessFiles:!0};Object(u.a)({types:[m.a.audio,m.a.video]}).then(e=>{e&&(this.uploadQueue.start(this.uploadQueueItem?{[this.uploadQueueItem.id]:e[0]}:e,t).subscribe(t=>{const e=this.uploadQueue.find(t.queueItemId);this.waveGenerator.generate(e.uploadedFile.native).then(t=>{this.form.patchValue({waveData:t}),e.finishProcessing()}),this.patchFormUsingFileUpload(t),this.toast.open("Track uploaded.")},()=>this.toast.open("Could not upload track")),this.uploadQueueItem||(this.uploadQueueItem=this.uploadQueue.uploads$.value[0],this.cd.markForCheck()))})}patchFormUsingFileUpload(t){const e={name:t.metadata.title,duration:t.metadata.duration,url:t.fileEntry.url,genres:t.metadata.genres||[],description:t.metadata.comment,lyrics:t.metadata.lyrics};t.metadata.album&&(e.album=t.metadata.album),t.metadata.artist&&(e.artists=[t.metadata.artist],this.albumForm&&!this.albumForm.value.artist&&this.albumForm.patchValue({artist:t.metadata.artist})),t.metadata.image&&(e.image=t.metadata.image.url,this.albumForm&&!this.albumForm.value.image&&this.albumForm.patchValue({image:t.metadata.image.url})),t.metadata.release_date&&this.albumForm&&!this.albumForm.value.release_date&&this.albumForm.patchValue({release_date:t.metadata.release_date}),this.form.patchValue(e)}insideAdmin(){return this.router.url.indexOf("admin")>-1}shouldShowDurationField(){const t=this.form.get("url").value;return!t||Object(b.a)(t)}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(f.h),i.Ob(v.a),i.Ob(x.a),i.Ob(k.b),i.Ob(C.a),i.Ob(O.a),i.Ob(y.a),i.Ob(_.c),i.Ob(I.e),i.Ob(T.a),i.Ob(i.h),i.Ob(P.a))},t.\u0275cmp=i.Ib({type:t,selectors:[["track-form"]],inputs:{autoMatch:"autoMatch",track:"track",uploadQueueItem:"uploadQueueItem",albumForm:"albumForm",number:"number"},outputs:{canceled:"canceled",saved:"saved"},features:[i.zb],ngContentSelectors:Dt,decls:2,vars:3,consts:[["class","many-inputs",3,"formGroup","ngSubmit",4,"ngIf"],[1,"many-inputs",3,"formGroup","ngSubmit"],[3,"upload",4,"ngIf"],["class","inline-form",3,"formGroup",4,"ngIf"],[1,"full-form"],[1,"full-form-container"],[1,"left-column"],["formControlName","image","uploadType","track_image",3,"defaultBackground"],["mat-flat-button","","color","accent","type","button",1,"left-column-action-button",3,"click"],["trans","",4,"ngIf"],[1,"many-inputs","fields-container"],["class","input-container",4,"ngIf"],["formControlName","album",3,"id",4,"ngIf"],["formControlName","artists",3,"error","id",4,"ngIf"],[1,"input-container"],["trans","",3,"for"],["type","number","formControlName","duration","min","1","required","",3,"id"],["class","error",4,"ngIf"],["placeholder","+Add genre","formControlName","genres",3,"id","suggestFn"],["placeholder","+Add tag","formControlName","tags",3,"id","suggestFn"],["type","text","formControlName","description","minlength","10","maxlength","999","rows","5",3,"id"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled",4,"ngIf"],["type","button","mat-button","","trans","",3,"click",4,"ngIf"],[3,"upload"],[1,"inline-form",3,"formGroup"],["trans","",1,"hidden",3,"for"],["type","text","formControlName","name","required","",3,"id"],[1,"actions"],["type","button","mat-icon-button","",3,"click"],["svgIcon","edit"],["svgIcon","delete"],["trans",""],[1,"error"],["formControlName","album",3,"id"],["formControlName","artists",3,"error","id"],["type","text","formControlName","youtube_id","minlength","1","maxlength","30",3,"id"],["type","url","formControlName","url","minlength","1","maxlength","191",3,"id"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],["type","button","mat-button","","trans","",3,"click"]],template:function(t,e){1&t&&(i.lc(),i.Gc(0,Ft,38,31,"form",0),i.gc(1,"async")),2&t&&i.mc("ngIf",i.hc(1,1,e.errors$))},directives:[w.t,f.K,f.v,f.m,M.a,f.u,f.k,U.b,B.a,f.A,f.d,f.F,A.a,f.q,f.p,q,$.a,rt,ht],pipes:[w.b],styles:["[_nghost-%COMP%]{display:block}.inline-form[_ngcontent-%COMP%]{display:flex}.inline-form[_ngcontent-%COMP%]   .actions[_ngcontent-%COMP%]{flex-shrink:0;color:var(--be-secondary-text);margin-left:20px}.full-form[_ngcontent-%COMP%]{overflow:hidden}.full-form-container[_ngcontent-%COMP%]{display:flex}.full-form-container.inside-album[_ngcontent-%COMP%]{margin:25px 100px 0 60px}.fields-container[_ngcontent-%COMP%]{flex:1 1 auto;margin-left:20px;min-width:0}.cdk-drag-handle[_ngcontent-%COMP%]{flex-shrink:0;color:var(--be-secondary-text);margin-right:20px}.active[_ngcontent-%COMP%]{color:var(--be-accent-default)}track-upload-header[_ngcontent-%COMP%]{margin-bottom:15px}.drag-handle[_ngcontent-%COMP%]{cursor:move}.left-column-action-button[_ngcontent-%COMP%]{margin-top:15px;width:100%;line-height:40px}@media only screen and (max-width:768px){.full-form-container[_ngcontent-%COMP%]{display:block}.left-column[_ngcontent-%COMP%]{max-width:220px;margin:auto auto 25px}.fields-container[_ngcontent-%COMP%]{margin-left:0}}"],data:{animation:[r.g.bodyExpansion]},changeDetection:0}),t})()},"/Sbb":function(t,e,n){"use strict";function i(t,e=""){let n=Object.keys(t)[0];if(n){e&&(n=`${e}-${n}`);const t=document.getElementById(n);t&&t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}}n.d(e,"a",(function(){return i}))},"1jcm":function(t,e,n){"use strict";n.d(e,"a",(function(){return C})),n.d(e,"b",(function(){return y}));var i=n("GU7r"),a=n("fXoL"),o=n("FKr1"),s=n("8LU1"),r=n("3Pt+"),c=n("R1ws"),l=n("u47x");const d=["thumbContainer"],u=["toggleBar"],m=["input"],b=function(){return{enterDuration:150}},p=["*"],h=new a.r("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1})});let g=0;const f={provide:r.s,useExisting:Object(a.V)(()=>C),multi:!0};class v{constructor(t,e){this.source=t,this.checked=e}}class x{constructor(t){this._elementRef=t}}const k=Object(o.z)(Object(o.v)(Object(o.w)(Object(o.x)(x)),"accent"));let C=(()=>{class t extends k{constructor(t,e,n,i,o,s){super(t),this._focusMonitor=e,this._changeDetectorRef=n,this.defaults=o,this._animationMode=s,this._onChange=t=>{},this._onTouched=()=>{},this._uniqueId="mat-slide-toggle-"+ ++g,this._required=!1,this._checked=!1,this.name=null,this.id=this._uniqueId,this.labelPosition="after",this.ariaLabel=null,this.ariaLabelledby=null,this.change=new a.n,this.toggleChange=new a.n,this.tabIndex=parseInt(i)||0}get required(){return this._required}set required(t){this._required=Object(s.c)(t)}get checked(){return this._checked}set checked(t){this._checked=Object(s.c)(t),this._changeDetectorRef.markForCheck()}get inputId(){return(this.id||this._uniqueId)+"-input"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{"keyboard"===t||"program"===t?this._inputElement.nativeElement.focus():t||Promise.resolve().then(()=>this._onTouched())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}_onChangeEvent(t){t.stopPropagation(),this.toggleChange.emit(),this.defaults.disableToggleValue?this._inputElement.nativeElement.checked=this.checked:(this.checked=this._inputElement.nativeElement.checked,this._emitChangeEvent())}_onInputClick(t){t.stopPropagation()}writeValue(t){this.checked=!!t}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck()}focus(t){this._focusMonitor.focusVia(this._inputElement,"keyboard",t)}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(new v(this,this.checked))}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}}return t.\u0275fac=function(e){return new(e||t)(a.Ob(a.l),a.Ob(l.h),a.Ob(a.h),a.Zb("tabindex"),a.Ob(h),a.Ob(c.a,8))},t.\u0275cmp=a.Ib({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(t,e){var n;1&t&&(a.Pc(d,!0),a.Pc(u,!0),a.Pc(m,!0)),2&t&&(a.tc(n=a.cc())&&(e._thumbEl=n.first),a.tc(n=a.cc())&&(e._thumbBarEl=n.first),a.tc(n=a.cc())&&(e._inputElement=n.first))},hostAttrs:[1,"mat-slide-toggle"],hostVars:12,hostBindings:function(t,e){2&t&&(a.Xb("id",e.id),a.Cb("tabindex",e.disabled?null:-1)("aria-label",null)("aria-labelledby",null),a.Fb("mat-checked",e.checked)("mat-disabled",e.disabled)("mat-slide-toggle-label-before","before"==e.labelPosition)("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{disabled:"disabled",disableRipple:"disableRipple",color:"color",tabIndex:"tabIndex",name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:["aria-label","ariaLabel"],ariaLabelledby:["aria-labelledby","ariaLabelledby"],required:"required",checked:"checked"},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[a.Ab([f]),a.yb],ngContentSelectors:p,decls:16,vars:18,consts:[[1,"mat-slide-toggle-label"],["label",""],[1,"mat-slide-toggle-bar"],["toggleBar",""],["type","checkbox","role","switch",1,"mat-slide-toggle-input","cdk-visually-hidden",3,"id","required","tabIndex","checked","disabled","change","click"],["input",""],[1,"mat-slide-toggle-thumb-container"],["thumbContainer",""],[1,"mat-slide-toggle-thumb"],["mat-ripple","",1,"mat-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered","matRippleRadius","matRippleAnimation"],[1,"mat-ripple-element","mat-slide-toggle-persistent-ripple"],[1,"mat-slide-toggle-content",3,"cdkObserveContent"],["labelContent",""],[2,"display","none"]],template:function(t,e){if(1&t&&(a.lc(),a.Ub(0,"label",0,1),a.Ub(2,"div",2,3),a.Ub(4,"input",4,5),a.bc("change",(function(t){return e._onChangeEvent(t)}))("click",(function(t){return e._onInputClick(t)})),a.Tb(),a.Ub(6,"div",6,7),a.Pb(8,"div",8),a.Ub(9,"div",9),a.Pb(10,"div",10),a.Tb(),a.Tb(),a.Tb(),a.Ub(11,"span",11,12),a.bc("cdkObserveContent",(function(){return e._onLabelTextChange()})),a.Ub(13,"span",13),a.Ic(14,"\xa0"),a.Tb(),a.kc(15),a.Tb(),a.Tb()),2&t){const t=a.uc(1),n=a.uc(12);a.Cb("for",e.inputId),a.Bb(2),a.Fb("mat-slide-toggle-bar-no-side-margin",!n.textContent||!n.textContent.trim()),a.Bb(2),a.mc("id",e.inputId)("required",e.required)("tabIndex",e.tabIndex)("checked",e.checked)("disabled",e.disabled),a.Cb("name",e.name)("aria-checked",e.checked.toString())("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledby),a.Bb(5),a.mc("matRippleTrigger",t)("matRippleDisabled",e.disableRipple||e.disabled)("matRippleCentered",!0)("matRippleRadius",20)("matRippleAnimation",a.pc(17,b))}},directives:[o.q,i.a],styles:[".mat-slide-toggle{display:inline-block;height:24px;max-width:100%;line-height:24px;white-space:nowrap;outline:none;-webkit-tap-highlight-color:transparent}.mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(16px, 0, 0)}[dir=rtl] .mat-slide-toggle.mat-checked .mat-slide-toggle-thumb-container{transform:translate3d(-16px, 0, 0)}.mat-slide-toggle.mat-disabled{opacity:.38}.mat-slide-toggle.mat-disabled .mat-slide-toggle-label,.mat-slide-toggle.mat-disabled .mat-slide-toggle-thumb-container{cursor:default}.mat-slide-toggle-label{display:flex;flex:1;flex-direction:row;align-items:center;height:inherit;cursor:pointer}.mat-slide-toggle-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-slide-toggle-label-before .mat-slide-toggle-label{order:1}.mat-slide-toggle-label-before .mat-slide-toggle-bar{order:2}[dir=rtl] .mat-slide-toggle-label-before .mat-slide-toggle-bar,.mat-slide-toggle-bar{margin-right:8px;margin-left:0}[dir=rtl] .mat-slide-toggle-bar,.mat-slide-toggle-label-before .mat-slide-toggle-bar{margin-left:8px;margin-right:0}.mat-slide-toggle-bar-no-side-margin{margin-left:0;margin-right:0}.mat-slide-toggle-thumb-container{position:absolute;z-index:1;width:20px;height:20px;top:-3px;left:0;transform:translate3d(0, 0, 0);transition:all 80ms linear;transition-property:transform}._mat-animation-noopable .mat-slide-toggle-thumb-container{transition:none}[dir=rtl] .mat-slide-toggle-thumb-container{left:auto;right:0}.mat-slide-toggle-thumb{height:20px;width:20px;border-radius:50%}.mat-slide-toggle-bar{position:relative;width:36px;height:14px;flex-shrink:0;border-radius:8px}.mat-slide-toggle-input{bottom:0;left:10px}[dir=rtl] .mat-slide-toggle-input{left:auto;right:10px}.mat-slide-toggle-bar,.mat-slide-toggle-thumb{transition:all 80ms linear;transition-property:background-color;transition-delay:50ms}._mat-animation-noopable .mat-slide-toggle-bar,._mat-animation-noopable .mat-slide-toggle-thumb{transition:none}.mat-slide-toggle .mat-slide-toggle-ripple{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-slide-toggle .mat-slide-toggle-ripple .mat-ripple-element:not(.mat-slide-toggle-persistent-ripple){opacity:.12}.mat-slide-toggle-persistent-ripple{width:100%;height:100%;transform:none}.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:.04}.mat-slide-toggle:not(.mat-disabled).cdk-keyboard-focused .mat-slide-toggle-persistent-ripple{opacity:.12}.mat-slide-toggle-persistent-ripple,.mat-slide-toggle.mat-disabled .mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{opacity:0}@media(hover: none){.mat-slide-toggle-bar:hover .mat-slide-toggle-persistent-ripple{display:none}}.cdk-high-contrast-active .mat-slide-toggle-thumb,.cdk-high-contrast-active .mat-slide-toggle-bar{border:1px solid}.cdk-high-contrast-active .mat-slide-toggle.cdk-keyboard-focused .mat-slide-toggle-bar{outline:2px dotted;outline-offset:5px}\n"],encapsulation:2,changeDetection:0}),t})(),O=(()=>{class t{}return t.\u0275mod=a.Mb({type:t}),t.\u0275inj=a.Lb({factory:function(e){return new(e||t)}}),t})(),y=(()=>{class t{}return t.\u0275mod=a.Mb({type:t}),t.\u0275inj=a.Lb({factory:function(e){return new(e||t)},imports:[[O,o.r,o.i,i.c],O,o.i]}),t})()},"2zME":function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n("sJvS"),a=n("tU2R"),o=n("PCqb"),s=n("JWVf"),r=n("fXoL");let c=(()=>{class t extends i.a{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=50,this.showToast=!0}initValidations(){const t=[new a.a({maxSize:this.getMaxFileSize()},this.i18n),new s.a({types:["audio","video"]},this.i18n)];this.validations.push(...t)}getMaxFileSize(){return this.settings.get("uploads.max_size",Object(o.a)(this.DEFAULT_MAX_SIZE_MB,"MB"))}}return t.\u0275fac=function(e){return l(e||t)},t.\u0275prov=r.Kb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const l=r.Wb(c)},"7EHt":function(t,e,n){"use strict";n.d(e,"a",(function(){return z})),n.d(e,"b",(function(){return L})),n.d(e,"c",(function(){return V})),n.d(e,"d",(function(){return j})),n.d(e,"e",(function(){return S})),n.d(e,"f",(function(){return G})),n.d(e,"g",(function(){return F}));var i=n("fXoL"),a=n("8LU1"),o=n("XNiG"),s=n("quSY"),r=n("0EQZ");let c=0,l=(()=>{class t{constructor(){this._stateChanges=new o.a,this._openCloseAllActions=new o.a,this.id="cdk-accordion-"+c++,this._multi=!1}get multi(){return this._multi}set multi(t){this._multi=Object(a.c)(t)}openAll(){this._openCloseAll(!0)}closeAll(){this._openCloseAll(!1)}ngOnChanges(t){this._stateChanges.next(t)}ngOnDestroy(){this._stateChanges.complete()}_openCloseAll(t){this.multi&&this._openCloseAllActions.next(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=i.Jb({type:t,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:"multi"},exportAs:["cdkAccordion"],features:[i.zb]}),t})(),d=0,u=(()=>{class t{constructor(t,e,n){this.accordion=t,this._changeDetectorRef=e,this._expansionDispatcher=n,this._openCloseAllSubscription=s.a.EMPTY,this.closed=new i.n,this.opened=new i.n,this.destroyed=new i.n,this.expandedChange=new i.n,this.id="cdk-accordion-child-"+d++,this._expanded=!1,this._disabled=!1,this._removeUniqueSelectionListener=()=>{},this._removeUniqueSelectionListener=n.listen((t,e)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===e&&this.id!==t&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}get expanded(){return this._expanded}set expanded(t){t=Object(a.c)(t),this._expanded!==t&&(this._expanded=t,this.expandedChange.emit(t),t?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled}set disabled(t){this._disabled=Object(a.c)(t)}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(t=>{this.disabled||(this.expanded=t)})}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(l,12),i.Ob(i.h),i.Ob(r.c))},t.\u0275dir=i.Jb({type:t,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:"expanded",disabled:"disabled"},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[i.Ab([{provide:l,useValue:void 0}])]}),t})(),m=(()=>{class t{}return t.\u0275mod=i.Mb({type:t}),t.\u0275inj=i.Lb({factory:function(e){return new(e||t)}}),t})();var b=n("+rOU"),p=n("ofXK"),h=n("u47x"),g=n("FtGj"),f=n("/uUt"),v=n("JX91"),x=n("pLZG"),k=n("IzEk"),C=n("R1ws"),O=n("EY2u"),y=n("VRyK"),_=n("R0Ic");const I=["body"];function T(t,e){}const P=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],w=["mat-expansion-panel-header","*","mat-action-row"];function M(t,e){if(1&t&&i.Pb(0,"span",2),2&t){const t=i.fc();i.mc("@indicatorRotate",t._getExpandedState())}}const U=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],B=["mat-panel-title","mat-panel-description","*"],A=new i.r("MAT_ACCORDION"),F={indicatorRotate:Object(_.m)("indicatorRotate",[Object(_.j)("collapsed, void",Object(_.k)({transform:"rotate(0deg)"})),Object(_.j)("expanded",Object(_.k)({transform:"rotate(180deg)"})),Object(_.l)("expanded <=> collapsed, void => collapsed",Object(_.e)("225ms cubic-bezier(0.4,0.0,0.2,1)"))]),bodyExpansion:Object(_.m)("bodyExpansion",[Object(_.j)("collapsed, void",Object(_.k)({height:"0px",visibility:"hidden"})),Object(_.j)("expanded",Object(_.k)({height:"*",visibility:"visible"})),Object(_.l)("expanded <=> collapsed, void => collapsed",Object(_.e)("225ms cubic-bezier(0.4,0.0,0.2,1)"))])};let D=(()=>{class t{constructor(t){this._template=t}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(i.N))},t.\u0275dir=i.Jb({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]}),t})(),E=0;const $=new i.r("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let V=(()=>{class t extends u{constructor(t,e,n,a,s,r,c){super(t,e,n),this._viewContainerRef=a,this._animationMode=r,this._hideToggle=!1,this.afterExpand=new i.n,this.afterCollapse=new i.n,this._inputChanges=new o.a,this._headerId="mat-expansion-panel-header-"+E++,this._bodyAnimationDone=new o.a,this.accordion=t,this._document=s,this._bodyAnimationDone.pipe(Object(f.a)((t,e)=>t.fromState===e.fromState&&t.toState===e.toState)).subscribe(t=>{"void"!==t.fromState&&("expanded"===t.toState?this.afterExpand.emit():"collapsed"===t.toState&&this.afterCollapse.emit())}),c&&(this.hideToggle=c.hideToggle)}get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(t){this._hideToggle=Object(a.c)(t)}get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(t){this._togglePosition=t}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this.opened.pipe(Object(v.a)(null),Object(x.a)(()=>this.expanded&&!this._portal),Object(k.a)(1)).subscribe(()=>{this._portal=new b.i(this._lazyContent._template,this._viewContainerRef)})}ngOnChanges(t){this._inputChanges.next(t)}ngOnDestroy(){super.ngOnDestroy(),this._bodyAnimationDone.complete(),this._inputChanges.complete()}_containsFocus(){if(this._body){const t=this._document.activeElement,e=this._body.nativeElement;return t===e||e.contains(t)}return!1}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(A,12),i.Ob(i.h),i.Ob(r.c),i.Ob(i.R),i.Ob(p.e),i.Ob(C.a,8),i.Ob($,8))},t.\u0275cmp=i.Ib({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(t,e,n){var a;1&t&&i.Hb(n,D,!0),2&t&&i.tc(a=i.cc())&&(e._lazyContent=a.first)},viewQuery:function(t,e){var n;1&t&&i.Pc(I,!0),2&t&&i.tc(n=i.cc())&&(e._body=n.first)},hostAttrs:[1,"mat-expansion-panel"],hostVars:6,hostBindings:function(t,e){2&t&&i.Fb("mat-expanded",e.expanded)("_mat-animation-noopable","NoopAnimations"===e._animationMode)("mat-expansion-panel-spacing",e._hasSpacing())},inputs:{disabled:"disabled",expanded:"expanded",hideToggle:"hideToggle",togglePosition:"togglePosition"},outputs:{opened:"opened",closed:"closed",expandedChange:"expandedChange",afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[i.Ab([{provide:A,useValue:void 0}]),i.yb,i.zb],ngContentSelectors:w,decls:7,vars:4,consts:[["role","region",1,"mat-expansion-panel-content",3,"id"],["body",""],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(t,e){1&t&&(i.lc(P),i.kc(0),i.Ub(1,"div",0,1),i.bc("@bodyExpansion.done",(function(t){return e._bodyAnimationDone.next(t)})),i.Ub(3,"div",2),i.kc(4,1),i.Gc(5,T,0,0,"ng-template",3),i.Tb(),i.kc(6,2),i.Tb()),2&t&&(i.Bb(1),i.mc("@bodyExpansion",e._getExpandedState())("id",e.id),i.Cb("aria-labelledby",e._headerId),i.Bb(4),i.mc("cdkPortalOutlet",e._portal))},directives:[b.c],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;border-radius:4px;overflow:hidden;transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);position:relative}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:4px;border-top-left-radius:4px}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.cdk-high-contrast-active .mat-expansion-panel{outline:solid 1px}.mat-expansion-panel.ng-animate-disabled,.ng-animate-disabled .mat-expansion-panel,.mat-expansion-panel._mat-animation-noopable{transition:none}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px}.mat-action-row button.mat-button-base,.mat-action-row button.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row button.mat-button-base,[dir=rtl] .mat-action-row button.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,data:{animation:[F.bodyExpansion]},changeDetection:0}),t})(),j=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=i.Jb({type:t,selectors:[["mat-action-row"]],hostAttrs:[1,"mat-action-row"]}),t})(),S=(()=>{class t{constructor(t,e,n,i,a,o){this.panel=t,this._element=e,this._focusMonitor=n,this._changeDetectorRef=i,this._animationMode=o,this._parentChangeSubscription=s.a.EMPTY;const r=t.accordion?t.accordion._stateChanges.pipe(Object(x.a)(t=>!(!t.hideToggle&&!t.togglePosition))):O.a;this._parentChangeSubscription=Object(y.a)(t.opened,t.closed,r,t._inputChanges.pipe(Object(x.a)(t=>!!(t.hideToggle||t.disabled||t.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),t.closed.pipe(Object(x.a)(()=>t._containsFocus())).subscribe(()=>n.focusVia(e,"program")),a&&(this.expandedHeight=a.expandedHeight,this.collapsedHeight=a.collapsedHeight)}get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const t=this._isExpanded();return t&&this.expandedHeight?this.expandedHeight:!t&&this.collapsedHeight?this.collapsedHeight:null}_keydown(t){switch(t.keyCode){case g.n:case g.f:Object(g.s)(t)||(t.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(t))}}focus(t="program",e){this._focusMonitor.focusVia(this._element,t,e)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(t=>{t&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(V,1),i.Ob(i.l),i.Ob(h.h),i.Ob(i.h),i.Ob($,8),i.Ob(C.a,8))},t.\u0275cmp=i.Ib({type:t,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:15,hostBindings:function(t,e){1&t&&i.bc("click",(function(){return e._toggle()}))("keydown",(function(t){return e._keydown(t)})),2&t&&(i.Cb("id",e.panel._headerId)("tabindex",e.disabled?-1:0)("aria-controls",e._getPanelId())("aria-expanded",e._isExpanded())("aria-disabled",e.panel.disabled),i.Fc("height",e._getHeaderHeight()),i.Fb("mat-expanded",e._isExpanded())("mat-expansion-toggle-indicator-after","after"===e._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===e._getTogglePosition())("_mat-animation-noopable","NoopAnimations"===e._animationMode))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight"},ngContentSelectors:B,decls:5,vars:1,consts:[[1,"mat-content"],["class","mat-expansion-indicator",4,"ngIf"],[1,"mat-expansion-indicator"]],template:function(t,e){1&t&&(i.lc(U),i.Ub(0,"span",0),i.kc(1),i.kc(2,1),i.kc(3,2),i.Tb(),i.Gc(4,M,1,1,"span",1)),2&t&&(i.Bb(4),i.mc("ngIf",e._showToggle()))},directives:[p.t],styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;margin-right:16px}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header-description{flex-grow:2}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle}\n'],encapsulation:2,data:{animation:[F.indicatorRotate]},changeDetection:0}),t})(),G=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=i.Jb({type:t,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]}),t})(),z=(()=>{class t extends l{constructor(){super(...arguments),this._ownHeaders=new i.E,this._hideToggle=!1,this.displayMode="default",this.togglePosition="after"}get hideToggle(){return this._hideToggle}set hideToggle(t){this._hideToggle=Object(a.c)(t)}ngAfterContentInit(){this._headers.changes.pipe(Object(v.a)(this._headers)).subscribe(t=>{this._ownHeaders.reset(t.filter(t=>t.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new h.g(this._ownHeaders).withWrap()}_handleHeaderKeydown(t){const{keyCode:e}=t,n=this._keyManager;e===g.h?Object(g.s)(t)||(n.setFirstItemActive(),t.preventDefault()):e===g.e?Object(g.s)(t)||(n.setLastItemActive(),t.preventDefault()):this._keyManager.onKeydown(t)}_handleHeaderFocus(t){this._keyManager.updateActiveItem(t)}}t.\u0275fac=function(n){return e(n||t)},t.\u0275dir=i.Jb({type:t,selectors:[["mat-accordion"]],contentQueries:function(t,e,n){var a;1&t&&i.Hb(n,S,!0),2&t&&i.tc(a=i.cc())&&(e._headers=a)},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(t,e){2&t&&i.Fb("mat-accordion-multi",e.multi)},inputs:{multi:"multi",displayMode:"displayMode",togglePosition:"togglePosition",hideToggle:"hideToggle"},exportAs:["matAccordion"],features:[i.Ab([{provide:A,useExisting:t}]),i.yb]});const e=i.Wb(t);return t})(),L=(()=>{class t{}return t.\u0275mod=i.Mb({type:t}),t.\u0275inj=i.Lb({factory:function(e){return new(e||t)},imports:[[p.c,m,b.h]]}),t})()},"8cGs":function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n("sJvS"),a=n("tU2R"),o=n("PCqb"),s=n("JWVf"),r=n("fXoL");let c=(()=>{class t extends i.a{constructor(){super(...arguments),this.DEFAULT_MAX_SIZE_MB=5}initValidations(){const t=[new a.a({maxSize:Object(o.a)(this.DEFAULT_MAX_SIZE_MB,"MB")},this.i18n),new s.a({types:["image"]},this.i18n)];this.validations.push(...t)}}return t.\u0275fac=function(e){return l(e||t)},t.\u0275prov=r.Kb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();const l=r.Wb(c)},BeMW:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n("+fqm"),a=n("fXoL"),o=n("tyNb"),s=n("kmQS"),r=n("twBr");let c=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.settings=n,this.currentUser=i}ngOnInit(){this.route.data.subscribe(t=>{t.api&&(this.track=t.api.track)})}toTracksPage(){this.insideAdmin()?this.router.navigate(["/admin/tracks"]):this.router.navigate(["/user",this.currentUser.get("id"),this.currentUser.get("display_name"),"tracks"])}canDeactivate(){return!this.trackForm.form.dirty}insideAdmin(){return this.router.url.includes("admin")}}return t.\u0275fac=function(e){return new(e||t)(a.Ob(o.a),a.Ob(o.e),a.Ob(s.a),a.Ob(r.a))},t.\u0275cmp=a.Ib({type:t,selectors:[["crupdate-track-page"]],viewQuery:function(t,e){var n;1&t&&a.Ec(i.a,!0),2&t&&a.tc(n=a.cc())&&(e.trackForm=n.first)},decls:1,vars:2,consts:[[1,"material-panel",3,"track","autoMatch","canceled","saved"]],template:function(t,e){1&t&&(a.Ub(0,"track-form",0),a.bc("canceled",(function(){return e.toTracksPage()}))("saved",(function(){return e.toTracksPage()})),a.Tb()),2&t&&a.mc("track",e.track)("autoMatch","artist"===e.settings.get("player.artist_type"))},directives:[i.a],styles:[""],changeDetection:0}),t})()},DzUk:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n("fXoL"),a=n("Lm4C");let o=(()=>{class t{constructor(t){this.el=t,this.config={},this.filesSelected=new i.n}ngOnInit(){this.el.nativeElement.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),Object(a.a)(this.config).then(t=>{t&&t.length&&this.filesSelected.emit(t)})})}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(i.l))},t.\u0275dir=i.Jb({type:t,selectors:[["","uploadButton",""]],inputs:{config:["uploadButton","config"]},outputs:{filesSelected:"filesSelected"}}),t})()},I3oe:function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var i=n("3Pt+"),a=n("2Vo4"),o=n("LRne"),s=n("Kj3r"),r=n("/uUt"),c=n("eIep"),l=n("JIr8"),d=n("fXoL"),u=n("A5z7"),m=n("ofXK"),b=n("/1cH"),p=n("NFeN"),h=n("FKr1"),g=n("zW5C");const f=["auto"],v=["inputEl"],x=["selectModeTemplate"];function k(t,e){if(1&t){const t=d.Vb();d.Ub(0,"mat-chip",8),d.bc("removed",(function(){d.xc(t);const n=e.index;return d.fc().remove(n)})),d.Ic(1),d.Pb(2,"mat-icon",9),d.Tb()}if(2&t){const t=e.$implicit,n=d.fc();d.mc("selectable",!1)("removable",!n.selectMode),d.Bb(1),d.Kc(" ",n.displayChipValue(t)," ")}}const C=function(t){return{elementRef:t}};function O(t,e){if(1&t){const t=d.Vb();d.Ub(0,"input",10,11),d.bc("matChipInputTokenEnd",(function(e){return d.xc(t),d.fc().addFromChipInput(e.value)})),d.gc(2,"trans"),d.Tb()}if(2&t){const t=d.fc(),e=d.uc(1),n=d.uc(6);d.mc("placeholder",d.hc(2,7,t.placeholder))("type",t.type)("matChipInputFor",e)("matChipInputAddOnBlur",!0)("matAutocomplete",n)("matAutocompleteConnectedTo",d.qc(9,C,t.el))("formControl",t.formControl)}}function y(t,e){if(1&t&&(d.Ub(0,"mat-option",12),d.Ic(1),d.Tb()),2&t){const t=e.$implicit,n=d.fc();d.mc("value",t),d.Bb(1),d.Jc(n.displayChipValue(t))}}function _(t,e){if(1&t&&(d.Ub(0,"mat-option",12),d.Ic(1),d.Tb()),2&t){const t=e.$implicit,n=d.fc(2);d.mc("value",t),d.Bb(1),d.Jc(n.displayChipValue(t))}}function I(t,e){1&t&&d.Gc(0,_,2,2,"mat-option",6),2&t&&d.mc("ngForOf",e.suggestions)}let T=(()=>{class t{constructor(t){this.el=t,this.type="text",this.selectMode=!1,this.formControl=new i.i,this.items$=new a.a([]),this.suggestedValues$=new a.a([])}set suggestedValues(t){this.suggestedValues$.next(t)}ngOnInit(){this.suggestFn&&this.bindToSearchControl()}remove(t){const e=[...this.items$.value];e.splice(t,1),this.items$.next(e),this.propagateChange(this.items$.value)}addFromChipInput(t,e=!0){!t||this.matAutocomplete.isOpen||this.selectMode||this.add(t,e)}addFromAutocomplete(t,e=!0){this.add(t,e)}add(t,e=!0){t="string"==typeof t?t.trim():t;const n=this.findValueIndex(t)>-1;t&&!n&&(this.items$.next([...this.items$.value,t]),e&&this.propagateChange(this.items$.value)),this.inputEl&&(this.inputEl.nativeElement.value=""),this.formControl.setValue(null),this.suggestedValues$.next([])}findValueIndex(t){return"string"==typeof t?this.items$.value.indexOf(t):this.items$.value.findIndex(e=>e.id===t.id)}writeValue(t=[]){if(t&&t.length)t.forEach(t=>this.add(t,!1));else if(this.items$.value.length)for(;0!==this.items$.value.length;)this.remove(0)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}bindToSearchControl(){this.formControl.valueChanges.pipe(Object(s.a)(150),Object(r.a)(),Object(c.a)(t=>t?this.suggestFn(t):Object(o.a)([])),Object(l.a)(()=>Object(o.a)([]))).subscribe(t=>{const e=t.filter(t=>-1===this.findValueIndex(t));this.suggestedValues$.next(e)})}displayChipValue(t){return"object"==typeof t?t.name:t}}return t.\u0275fac=function(e){return new(e||t)(d.Ob(d.l))},t.\u0275cmp=d.Ib({type:t,selectors:[["chip-input"]],viewQuery:function(t,e){var n;1&t&&(d.Pc(f,!0),d.Ec(v,!0),d.Pc(x,!0)),2&t&&(d.tc(n=d.cc())&&(e.matAutocomplete=n.first),d.tc(n=d.cc())&&(e.inputEl=n.first),d.tc(n=d.cc())&&(e.selectModeTemplate=n.first))},hostVars:2,hostBindings:function(t,e){2&t&&d.Fb("select-mode",e.selectMode)},inputs:{placeholder:"placeholder",type:"type",suggestFn:"suggestFn",selectMode:"selectMode",suggestedValues:"suggestedValues"},features:[d.Ab([{provide:i.s,useExisting:t,multi:!0}])],decls:11,vars:9,consts:[[3,"selectable"],["chipList",""],[3,"selectable","removable","removed",4,"ngFor","ngForOf"],["class","mat-chip-input mat-input-element",3,"placeholder","type","matChipInputFor","matChipInputAddOnBlur","matAutocomplete","matAutocompleteConnectedTo","formControl","matChipInputTokenEnd",4,"ngIf"],[1,"chip-input-autocomplete-panel",3,"autoActiveFirstOption","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["selectModeTemplate",""],[3,"selectable","removable","removed"],["matChipRemove","","svgIcon","cancel"],[1,"mat-chip-input","mat-input-element",3,"placeholder","type","matChipInputFor","matChipInputAddOnBlur","matAutocomplete","matAutocompleteConnectedTo","formControl","matChipInputTokenEnd"],["inputEl",""],[3,"value"]],template:function(t,e){1&t&&(d.Ub(0,"mat-chip-list",0,1),d.Gc(2,k,3,3,"mat-chip",2),d.gc(3,"async"),d.Gc(4,O,3,11,"input",3),d.Tb(),d.Ub(5,"mat-autocomplete",4,5),d.bc("optionSelected",(function(t){return e.addFromAutocomplete(t.option.value)})),d.Gc(7,y,2,2,"mat-option",6),d.gc(8,"async"),d.Tb(),d.Gc(9,I,1,1,"ng-template",null,7,d.Hc)),2&t&&(d.mc("selectable",!1),d.Bb(2),d.mc("ngForOf",d.hc(3,5,e.items$)),d.Bb(2),d.mc("ngIf",!e.selectMode),d.Bb(1),d.mc("autoActiveFirstOption",!0),d.Bb(2),d.mc("ngForOf",d.hc(8,7,e.suggestedValues$)))},directives:[u.c,m.s,m.t,b.a,u.a,p.a,u.d,u.b,b.c,i.d,i.u,i.j,h.l],pipes:[m.b,g.a],styles:["chip-input{display:block;min-height:46px}chip-input .mat-chip-list-wrapper{width:100%;height:100%;color:inherit;border:1px solid var(--be-divider-default);padding:6px;line-height:normal;font-size:1.4rem;font-family:inherit;background-color:inherit;box-sizing:border-box;border-radius:2px;margin:0}chip-input .mat-chip-input{height:24px;font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:0;max-width:100%;vertical-align:bottom;text-align:inherit}chip-input .mat-chip-input:focus{outline:none;box-shadow:none}.chip-input-select-panel{background-color:var(--be-background);min-width:180px;box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}"],encapsulation:2,changeDetection:0}),t})()},PUkl:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("/RwR"),a=n("fXoL"),o=n("QGXG");let s=(()=>{class t{constructor(t){this.modal=t}canDeactivate(t){return!!t.canDeactivate()||this.modal.show(i.a,{title:"Unsaved Changes",body:"You have unsaved changes. Do you want to discard them?",ok:"Discard"}).beforeClosed()}}return t.\u0275fac=function(e){return new(e||t)(a.Yb(o.a))},t.\u0275prov=a.Kb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})()},TheJ:function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n("h586"),a=n("r48M"),o=n("fXoL"),s=n("tyNb"),r=n("twBr"),c=n("kmQS");let l=(()=>{class t{constructor(t,e,n,i){this.route=t,this.router=e,this.currentUser=n,this.settings=i}ngOnInit(){this.route.data.subscribe(t=>{t.api&&(this.album=t.api.album)})}toAlbumsPage(){this.router.url.includes("admin")?this.router.navigate(["/admin/albums"]):this.router.navigate(["/user",this.currentUser.get("id"),this.currentUser.get("display_name"),"albums"])}canDeactivate(){return!this.albumForm.form.dirty}}return t.\u0275fac=function(e){return new(e||t)(o.Ob(s.a),o.Ob(s.e),o.Ob(r.a),o.Ob(c.a))},t.\u0275cmp=o.Ib({type:t,selectors:[["crupdate-album-page"]],viewQuery:function(t,e){var n;1&t&&o.Ec(a.a,!0),2&t&&o.tc(n=o.cc())&&(e.albumForm=n.first)},features:[o.Ab([i.a])],decls:1,vars:3,consts:[[1,"material-panel",3,"album","autoMatch","confirmCancel","canceled","saved"]],template:function(t,e){1&t&&(o.Ub(0,"album-form",0),o.bc("canceled",(function(){return e.toAlbumsPage()}))("saved",(function(){return e.toAlbumsPage()})),o.Tb()),2&t&&o.mc("album",e.album)("autoMatch","artist"===e.settings.get("player.artist_type"))("confirmCancel",!1)},directives:[a.a],styles:[""],changeDetection:0}),t})()},W5HX:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(t){return t.Image="uploads/images",t}({})},gcYM:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("7o/Q"),a=n("D0XW");n("l7GE"),n("ZUHj");const o={leading:!0,trailing:!1};function s(t,e=a.a,n=o){return i=>i.lift(new r(t,e,n.leading,n.trailing))}class r{constructor(t,e,n,i){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=i}call(t,e){return e.subscribe(new c(t,this.duration,this.scheduler,this.leading,this.trailing))}}class c extends i.a{constructor(t,e,n,i,a){super(t),this.duration=e,this.scheduler=n,this.leading=i,this.trailing=a,this._hasTrailingValue=!1,this._trailingValue=null}_next(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(l,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))}_complete(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()}clearThrottle(){const t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)}}function l(t){const{subscriber:e}=t;e.clearThrottle()}},pCVY:function(t,e,n){"use strict";n.d(e,"a",(function(){return P}));var i=n("fXoL"),a=n("3Pt+"),o=n("2Vo4"),s=n("h586"),r=n("QeDF"),c=n("W5HX"),l=n("Lm4C"),d=n("STbY"),u=n("8cGs"),m=n("oVOl"),b=n("LRXf"),p=n("ofXK"),h=n("rG4v"),g=n("gA0O"),f=n("bTqV"),v=n("NFeN"),x=n("DzUk"),k=n("Rd8u");function C(t,e){1&t&&i.Pb(0,"image-or-icon",4),2&t&&i.mc("src",e.ngIf)}function O(t,e){if(1&t&&i.Pb(0,"image-or-icon",4),2&t){const t=i.fc(2);i.mc("src",t.defaultBackground)}}function y(t,e){if(1&t&&i.Gc(0,O,1,1,"image-or-icon",5),2&t){const t=i.fc();i.mc("ngIf",t.defaultBackground)}}function _(t,e){if(1&t){const t=i.Vb();i.Sb(0),i.Pb(1,"span",6),i.Ub(2,"button",7),i.bc("click",(function(){return i.xc(t),i.fc().openUploadDialog()})),i.Pb(3,"mat-icon",8),i.Tb(),i.Ub(4,"mat-menu",null,9),i.Ub(6,"button",10),i.bc("filesSelected",(function(e){return i.xc(t),i.fc().uploadImage(e)})),i.Ic(7),i.Tb(),i.Ub(8,"button",11),i.bc("click",(function(){return i.xc(t),i.fc().deleteUpload()})),i.Ic(9,"Remove"),i.Tb(),i.Tb(),i.Rb()}if(2&t){const t=i.uc(5),e=i.fc();i.Bb(1),i.mc("matMenuTriggerFor",t),i.Bb(5),i.mc("uploadButton",e.uploadInputConfig),i.Bb(1),i.Jc(e.buttonText)}}function I(t,e){if(1&t){const t=i.Vb();i.Ub(0,"button",14),i.bc("click",(function(){return i.xc(t),i.fc(2).deleteUpload()})),i.Pb(1,"mat-icon",15),i.Tb()}}function T(t,e){if(1&t){const t=i.Vb();i.Sb(0),i.Ub(1,"button",12),i.bc("filesSelected",(function(e){return i.xc(t),i.fc().uploadImage(e)})),i.Ic(2),i.Tb(),i.Gc(3,I,2,0,"button",13),i.gc(4,"async"),i.Rb()}if(2&t){const t=i.fc();i.Bb(1),i.mc("uploadButton",t.uploadInputConfig),i.Bb(1),i.Jc(t.buttonText),i.Bb(1),i.mc("ngIf",i.hc(4,3,t.src$))}}let P=(()=>{class t{constructor(t,e,n,a){this.uploadQueue=t,this.imageValidator=e,this.uploadsApi=n,this.http=a,this.fileDeleted=new i.n,this.buttonText="Upload image",this.compact=!1,this.uploadInputConfig={multiple:!1,types:[r.a.image]},this.src$=new o.a(null)}writeValue(t){this.src$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}uploadImage(t){this.uploadQueue.start(t,this.uploadConfig||this.defaultUploadConfig()).subscribe(t=>{this.src$.next(t.fileEntry.url),this.propagateChange(t.fileEntry.url)})}deleteUpload(){const t={paths:[this.src$.value],deleteForever:!0};(this.uploadConfig&&this.uploadConfig.uri?this.http.delete(this.uploadConfig.uri,t):this.uploadsApi.delete(t)).subscribe(()=>{this.src$.next(null),this.propagateChange(null),this.fileDeleted.emit()})}defaultUploadConfig(){return{httpParams:{diskPrefix:this.diskPrefix||"common_media"},uri:c.a.Image,validator:this.imageValidator}}openUploadDialog(){this.src$.value?this.menuTrigger.toggleMenu():Object(l.a)(this.uploadInputConfig).then(t=>{this.uploadImage(t)})}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(s.a),i.Ob(u.a),i.Ob(m.a),i.Ob(b.a))},t.\u0275cmp=i.Ib({type:t,selectors:[["upload-image-control"]],viewQuery:function(t,e){var n;1&t&&i.Pc(d.c,!0),2&t&&i.tc(n=i.cc())&&(e.menuTrigger=n.first)},hostVars:2,hostBindings:function(t,e){2&t&&i.Fb("compact",e.compact)},inputs:{defaultBackground:"defaultBackground",buttonText:"buttonText",uploadConfig:"uploadConfig",diskPrefix:"diskPrefix",compact:"compact"},outputs:{fileDeleted:"fileDeleted"},features:[i.Ab([s.a,{provide:a.s,useExisting:t,multi:!0}])],decls:8,vars:6,consts:[["class","inherit-size",3,"src",4,"ngIf","ngIfElse"],["defaultBg",""],[1,"action-buttons"],[4,"ngIf"],[1,"inherit-size",3,"src"],["class","inherit-size",3,"src",4,"ngIf"],[3,"matMenuTriggerFor"],["type","button","mat-icon-button","",1,"action-button",3,"click"],["svgIcon","edit"],["menu","matMenu"],["type","button","mat-menu-item","",3,"uploadButton","filesSelected"],["type","button","mat-menu-item","","trans","",3,"click"],["type","button","mat-stroked-button","","color","accent","trans","",1,"action-button",3,"uploadButton","filesSelected"],["type","button","class","action-button delete-button","mat-icon-button","",3,"click",4,"ngIf"],["type","button","mat-icon-button","",1,"action-button","delete-button",3,"click"],["svgIcon","delete"]],template:function(t,e){if(1&t&&(i.Gc(0,C,1,1,"image-or-icon",0),i.gc(1,"async"),i.Gc(2,y,1,1,"ng-template",null,1,i.Hc),i.Ub(4,"div",2),i.Gc(5,_,10,3,"ng-container",3),i.Gc(6,T,5,5,"ng-container",3),i.Tb(),i.Pb(7,"upload-progress-bar")),2&t){const t=i.uc(3);i.mc("ngIf",i.hc(1,4,e.src$))("ngIfElse",t),i.Bb(5),i.mc("ngIf",e.compact),i.Bb(1),i.mc("ngIf",!e.compact)}},directives:[p.t,h.a,g.a,d.c,f.b,v.a,d.d,d.a,x.a,k.a],pipes:[p.b],styles:["[_nghost-%COMP%]{display:block;width:220px;height:220px;flex-shrink:0;border-radius:4px;overflow:hidden;background:linear-gradient(135deg,#70929c,#846170);position:relative}.inherit-size[_nghost-%COMP%], .inherit-size   [_nghost-%COMP%]{width:100%;height:100%}.compact[_nghost-%COMP%]   .action-buttons[_ngcontent-%COMP%], .compact   [_nghost-%COMP%]   .action-buttons[_ngcontent-%COMP%]{bottom:0;top:0}.action-buttons[_ngcontent-%COMP%]{position:absolute;bottom:25px;left:0;right:0;margin:auto;text-align:center;height:34px}.action-button[_ngcontent-%COMP%]{color:rgba(0,0,0,.87);border-color:rgba(0,0,0,.1);background:hsla(0,0%,100%,.8)}.mat-icon-button[_ngcontent-%COMP%]{border-radius:4px;line-height:34px;height:34px;width:34px}.delete-button[_ngcontent-%COMP%]{margin-left:5px}upload-progress-bar[_ngcontent-%COMP%]{width:100%;position:absolute;left:0;bottom:0}"]}),t})()},r48M:function(t,e,n){"use strict";n.d(e,"a",(function(){return nt}));var i=n("fXoL"),a=n("5+WD"),o=n("+fqm"),s=n("2Vo4"),r=n("lJxs"),c=n("nYR2"),l=n("He21"),d=n("/RwR"),u=n("QeDF"),m=n("/Sbb"),b=n("XSk8"),p=n("3Pt+"),h=n("h586"),g=n("/M5e"),f=n("twBr"),v=n("QGXG"),x=n("i2dy"),k=n("2zME"),C=n("kmQS"),O=n("OkhP"),y=n("pCVY"),_=n("bTqV"),I=n("Rd8u"),T=n("DzUk"),P=n("ofXK"),w=n("I3oe"),M=n("LRne"),U=n("Kj3r"),B=n("/uUt"),A=n("eIep"),F=n("JIr8"),D=n("+Bz4"),E=n("STbY"),$=n("FBzJ"),V=n("8HKz"),j=n("NFeN");const S=["searchInput"];function G(t,e){if(1&t&&(i.Ub(0,"span"),i.Pb(1,"media-image",19),i.Ic(2),i.Tb()),2&t){const t=e.ngIf;i.Bb(1),i.mc("media",t),i.Bb(1),i.Kc(" ",t.name," ")}}function z(t,e){1&t&&(i.Ub(0,"span",20),i.Ic(1,"None"),i.Tb())}function L(t,e){if(1&t){const t=i.Vb();i.Ub(0,"button",21),i.bc("click",(function(){return i.xc(t),i.fc().clearSearchInput()})),i.Pb(1,"mat-icon",22),i.Tb()}}function R(t,e){if(1&t){const t=i.Vb();i.Ub(0,"button",13),i.bc("click",(function(){i.xc(t);const n=e.$implicit;return i.fc().selectArtist(n)})),i.Pb(1,"media-image",19),i.Ub(2,"div",23),i.Ub(3,"div",24),i.Ic(4),i.Tb(),i.Ub(5,"div",25),i.Ic(6,"Artist"),i.Tb(),i.Tb(),i.Tb()}if(2&t){const t=e.$implicit;i.Bb(1),i.mc("media",t),i.Bb(3),i.Jc(t.name)}}function Q(t,e){1&t&&(i.Ub(0,"button",26),i.Ic(1,"No artists found."),i.Tb())}let q=(()=>{class t{constructor(t){this.search=t,this.searchFormControl=new p.i,this.loading$=new s.a(!1),this.artists$=new s.a([]),this.selectedArtist$=new s.a(null),this.searchedOnce=!1}ngOnInit(){this.bindToSearchControl()}writeValue(t){this.selectedArtist$.next(t)}registerOnChange(t){this.propagateChange=t}registerOnTouched(){}bindToSearchControl(){this.searchFormControl.valueChanges.pipe(Object(U.a)(150),Object(B.a)(),Object(A.a)(t=>this.searchArtists(t)),Object(F.a)(()=>Object(M.a)([]))).subscribe(t=>{this.searchedOnce=!0,this.artists$.next(t)})}searchArtists(t){return this.loading$.next(!0),this.search.media(t,{limit:7,forceLocal:!0,modelTypes:[D.a]}).pipe(Object(c.a)(()=>this.loading$.next(!1)),Object(r.a)(t=>t.results.artists))}onMenuOpened(){this.searchedOnce||this.clearSearchInput()}selectArtist(t){this.selectedArtist$.next(t),this.propagateChange(t)}clearSearchInput(){this.searchFormControl.setValue("")}onMenuClosed(){this.loading$.next(!1),this.clearSearchInput()}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(O.a))},t.\u0275cmp=i.Ib({type:t,selectors:[["album-artist-control"]],viewQuery:function(t,e){var n;1&t&&i.Ec(S,!0),2&t&&i.tc(n=i.cc())&&(e.searchInput=n.first)},hostAttrs:["tabindex","0"],features:[i.Ab([{provide:p.s,useExisting:t,multi:!0}])],decls:25,vars:16,consts:[[1,"fake-input",3,"matMenuTriggerFor","menuOpened","menuClosed"],[4,"ngIf","ngIfElse"],["anyArtist",""],[1,"arrow-container"],[1,"arrow"],[1,"album-artist-control-menu"],["menu","matMenu"],[1,"input-container","search-input-container",3,"click"],[1,"search-input-wrapper"],["type","text","placeholder","Search...","mat-menu-item","","trans-placeholder","",3,"formControl","blur"],["searchInput",""],["class","clear-search-input-button","mat-icon-button","",3,"click",4,"ngIf"],[1,"small",3,"isVisible"],["mat-menu-item","",3,"click"],["default","artist",1,"result-image"],[1,"info","any-user-info"],["trans","",1,"name"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","","disabled","","trans","",4,"ngIf"],[1,"result-image",3,"media"],["trans",""],["mat-icon-button","",1,"clear-search-input-button",3,"click"],["svgIcon","close"],[1,"user-info"],[1,"name"],["trans","",1,"email"],["mat-menu-item","","disabled","","trans",""]],template:function(t,e){if(1&t){const t=i.Vb();i.Ub(0,"div",0),i.bc("menuOpened",(function(){return e.onMenuOpened()}))("menuClosed",(function(){return e.onMenuClosed()})),i.Gc(1,G,3,2,"span",1),i.gc(2,"async"),i.Gc(3,z,2,0,"ng-template",null,2,i.Hc),i.Ub(5,"div",3),i.Pb(6,"div",4),i.Tb(),i.Tb(),i.Ub(7,"mat-menu",5,6),i.Ub(9,"div",7),i.bc("click",(function(t){return t.stopPropagation()})),i.Ub(10,"div",8),i.Ub(11,"input",9,10),i.bc("blur",(function(){return i.xc(t),i.uc(12).focus()})),i.Tb(),i.Gc(13,L,2,0,"button",11),i.Pb(14,"loading-indicator",12),i.gc(15,"async"),i.Tb(),i.Tb(),i.Ub(16,"button",13),i.bc("click",(function(){return e.selectArtist(null)})),i.Pb(17,"media-image",14),i.Ub(18,"div",15),i.Ub(19,"div",16),i.Ic(20,"No Artist"),i.Tb(),i.Tb(),i.Tb(),i.Gc(21,R,7,2,"button",17),i.gc(22,"async"),i.Gc(23,Q,2,0,"button",18),i.gc(24,"async"),i.Tb()}if(2&t){const t=i.uc(4),n=i.uc(8);i.mc("matMenuTriggerFor",n),i.Bb(1),i.mc("ngIf",i.hc(2,8,e.selectedArtist$))("ngIfElse",t),i.Bb(10),i.mc("formControl",e.searchFormControl),i.Bb(2),i.mc("ngIf",e.searchFormControl.value),i.Bb(1),i.mc("isVisible",i.hc(15,10,e.loading$)),i.Bb(7),i.mc("ngForOf",i.hc(22,12,e.artists$)),i.Bb(2),i.mc("ngIf",e.searchedOnce&&!i.hc(24,14,e.artists$).length)}},directives:[E.c,P.t,E.d,p.d,E.a,I.a,p.u,p.j,$.a,V.a,P.s,_.b,j.a],pipes:[P.b],styles:["[_nghost-%COMP%]{display:block;min-width:280px;max-width:100%}.fake-input[_ngcontent-%COMP%]{position:relative}.result-image[_ngcontent-%COMP%]{display:inline-block;margin-right:5px;width:25px;height:25px;border-radius:4px;vertical-align:middle}.arrow-container[_ngcontent-%COMP%]{height:100%;position:absolute;top:1px;right:1px;width:20px}.arrow[_ngcontent-%COMP%]{position:absolute;border-color:#000 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;width:0;left:50%;top:50%;margin-left:-4px;margin-top:-2px}  .album-artist-control-menu{width:280px}.mat-menu-item[_ngcontent-%COMP%]:first-of-type{border-top:1px solid var(--be-divider-default)}.search-input-container[_ngcontent-%COMP%]{padding:2px 10px 10px}.search-input-wrapper[_ngcontent-%COMP%]{position:relative}.clear-search-input-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:0;color:var(--be-secondary-text)}.mat-menu-item[_ngcontent-%COMP%]{display:flex;vertical-align:middle}.mat-menu-item.selected[_ngcontent-%COMP%]{background-color:var(--be-accent-emphasis)}.mat-menu-item[_ngcontent-%COMP%]   .result-image[_ngcontent-%COMP%]{width:35px;height:35px}.mat-menu-item[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{text-transform:capitalize}.mat-menu-item[_ngcontent-%COMP%]   .email[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.3rem}.user-info[_ngcontent-%COMP%]{line-height:normal}.any-user-info[_ngcontent-%COMP%]{line-height:35px}loading-indicator[_ngcontent-%COMP%]{position:absolute;top:12px;right:40px}"],changeDetection:0}),t})();function J(t,e){if(1&t&&(i.Ub(0,"div",23),i.Ic(1),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Jc(t.errors.name)}}function N(t,e){if(1&t&&(i.Ub(0,"div",23),i.Ic(1),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Jc(t.errors.release_date)}}function H(t,e){if(1&t&&(i.Ub(0,"div",23),i.Ic(1),i.Tb()),2&t){const t=i.fc(2);i.Bb(1),i.Jc(t.errors.artist_id)}}function X(t,e){if(1&t&&(i.Ub(0,"div",6),i.Ub(1,"label",24),i.Ic(2,"Artist"),i.Tb(),i.Pb(3,"album-artist-control",25),i.Gc(4,H,2,1,"div",9),i.Tb()),2&t){const t=i.fc();i.Bb(4),i.mc("ngIf",t.errors.artist_id)}}function K(t,e){if(1&t&&(i.Ub(0,"div",23),i.Ic(1),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Jc(t.errors.description)}}function Y(t,e){if(1&t&&(i.Ub(0,"div",23),i.Ic(1),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Jc(t.errors.genres)}}function W(t,e){if(1&t&&(i.Ub(0,"div",23),i.Ic(1),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Jc(t.errors.tags)}}function Z(t,e){if(1&t){const t=i.Vb();i.Ub(0,"track-form",29),i.bc("canceled",(function(){i.xc(t);const e=i.fc().$implicit;return i.fc().trackRemoved(e)})),i.Ub(1,"button",30),i.Pb(2,"mat-icon",31),i.Tb(),i.Tb()}if(2&t){const t=i.fc(),e=t.$implicit,n=t.index,a=i.fc();i.mc("albumForm",a.form)("track",e)("number",n+1)}}function tt(t,e){if(1&t){const t=i.Vb();i.Ub(0,"track-form",32),i.bc("canceled",(function(){i.xc(t);const e=i.fc().$implicit;return i.fc().trackRemoved(e)})),i.Ub(1,"button",30),i.Pb(2,"mat-icon",31),i.Tb(),i.Tb()}if(2&t){const t=i.fc(),e=t.$implicit,n=t.index,a=i.fc();i.mc("albumForm",a.form)("uploadQueueItem",e)("number",n+1)}}function et(t,e){if(1&t&&(i.Ub(0,"li",26),i.Gc(1,Z,3,3,"track-form",27),i.Gc(2,tt,3,3,"track-form",28),i.Tb()),2&t){const t=e.$implicit;i.Bb(1),i.mc("ngIf",t.model_type),i.Bb(1),i.mc("ngIf",!t.model_type)}}let nt=(()=>{class t{constructor(t,e,n,a,o,c,l,d,m,p){this.fb=t,this.uploadQueue=e,this.albums=n,this.cd=a,this.currentUser=o,this.modal=c,this.toast=l,this.audioValidator=d,this.settings=m,this.search=p,this.uploadButtonConfig={multiple:!0,types:[u.a.audio,u.a.video]},this.hideArtistControl=!1,this.confirmCancel=!0,this.canceled=new i.n,this.autoMatch=!1,this.saved=new i.n,this.errors={},this.loading$=new s.a(!1),this.allTracks$=new s.a([]),this.form=this.fb.group({name:[""],image:[""],artist:[null],release_date:[(new Date).toISOString().slice(0,10)],description:[""],tags:[[]],genres:[[]]}),this.trackByFn=(t,e)=>e.id,this.suggestTagFn=t=>this.search.media(t,{modelTypes:["App\\Tag"],limit:5}).pipe(Object(r.a)(t=>t.results.tags.map(t=>t.name))),this.suggestGenreFn=t=>this.search.media(t,{modelTypes:[b.a],limit:5}).pipe(Object(r.a)(t=>t.results.genres.map(t=>t.name)))}ngOnInit(){if(this.allTracks$=new s.a([...this.album?this.album.tracks:[],...this.onlyValidUploads(this.uploadQueue.uploads$.value)]),this.uploadQueue.uploadsAdded$.subscribe(t=>{this.allTracks$.next([...this.allTracks$.value,...this.onlyValidUploads(t)])}),this.album){const t=Object.assign(Object.assign({},this.album),{tags:this.album.tags.map(t=>t.name),genres:this.album.genres.map(t=>t.display_name||t.name)});this.form.patchValue(t)}}onlyValidUploads(t){return t.filter(t=>!t.error$.value)}reorderTracks(t){const e=this.allTracks$.value;Object(a.f)(e,t.previousIndex,t.currentIndex),this.allTracks$.next(e)}submit(){if(this.loading$.next(!0),this.trackForms.some(t=>t.isUploading()))return void this.toast.open("Some tracks are still uploading.");const t=Object.assign(Object.assign({},this.form.value),{tracks:this.trackForms.map(t=>t.getPayload())});t.artist?(t.artist_id=t.artist.id,t.artist_type=t.artist.artist_type):this.artist?(t.artist_id=this.artist.id,t.artist_type=this.artist.model_type):"user"===this.settings.get("player.artist_type")&&(t.artist_id=this.currentUser.get("id"),t.artist_type=l.a),delete t.artist,(this.album?this.albums.update(this.album.id,t):this.albums.create(t)).pipe(Object(c.a)(()=>this.loading$.next(!1))).subscribe(t=>{this.form.markAsPristine(),this.toast.open("Album saved."),this.uploadQueue.reset(),this.saved.emit(t.album)},t=>{this.errors=t.errors,Object(m.a)(this.errors,"track-form"),this.cd.markForCheck()})}maybeCancel(){this.confirmCancel?this.modal.show(d.a,{title:"Delete Album",body:"Are you sure you want to cancel all uploads and delete this album?",ok:"Delete"}).beforeClosed().subscribe(t=>{t&&(this.form.reset(),this.uploadQueue.reset(),this.canceled.emit())}):this.canceled.emit()}uploadFiles(t){this.uploadQueue.start(t,{uri:"uploads",httpParams:{autoMatch:this.autoMatch,diskPrefix:"track_media",disk:"public"},validator:this.audioValidator}).subscribe(()=>{},()=>this.toast.open("Could not upload tracks."))}trackRemoved(t){const e=this.allTracks$.value.filter(e=>e.id!==t.id);this.allTracks$.next(e)}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(p.h),i.Ob(h.a),i.Ob(g.a),i.Ob(i.h),i.Ob(f.a),i.Ob(v.a),i.Ob(x.b),i.Ob(k.a),i.Ob(C.a),i.Ob(O.a))},t.\u0275cmp=i.Ib({type:t,selectors:[["album-form"]],viewQuery:function(t,e){var n;1&t&&i.Pc(o.a,!0),2&t&&i.tc(n=i.cc())&&(e.trackForms=n)},inputs:{album:"album",artist:"artist",hideArtistControl:"hideArtistControl",confirmCancel:"confirmCancel",autoMatch:"autoMatch"},outputs:{canceled:"canceled",saved:"saved"},decls:41,vars:17,consts:[[3,"formGroup","ngSubmit"],[1,"main-info-fields"],[1,"left-column"],["formControlName","image","uploadType","album"],["mat-flat-button","","color","accent","type","button","trans","",1,"upload-tracks-button",3,"uploadButton","filesSelected"],[1,"text-fields-container","many-inputs"],[1,"input-container"],["for","album-form-name","trans",""],["type","text","id","album-form-name","formControlName","name","required",""],["class","error",4,"ngIf"],["for","album-form-release_date","trans",""],["type","date","placeholder","YYYY-MM-DD","id","album-form-release_date","formControlName","release_date","required",""],["class","input-container",4,"ngIf"],["for","album-form-description","trans",""],["type","text","id","album-form-description","formControlName","description","minlength","10","maxlength","250","rows","5"],["for","album-form-genres","trans",""],["placeholder","+Add genre","id","album-form-genres","formControlName","genres",3,"suggestFn"],["for","album-form-tags","trans",""],["placeholder","+Add tag","id","album-form-tags","formControlName","tags",3,"suggestFn"],["type","submit","mat-raised-button","","color","accent","trans","",3,"disabled"],["type","button","mat-button","","trans","",3,"click"],["cdkDropList","",1,"track-list",3,"cdkDropListDropped"],["class","track-list-item","cdkDrag","",4,"ngFor","ngForOf","ngForTrackBy"],[1,"error"],["for","album-form-artist","trans",""],["id","album-form-artist","formControlName","artist"],["cdkDrag","",1,"track-list-item"],[3,"albumForm","track","number","canceled",4,"ngIf"],[3,"albumForm","uploadQueueItem","number","canceled",4,"ngIf"],[3,"albumForm","track","number","canceled"],["mat-icon-button","","cdkDragHandle","","type","button"],["svgIcon","drag-handle"],[3,"albumForm","uploadQueueItem","number","canceled"]],template:function(t,e){1&t&&(i.Ub(0,"form",0),i.bc("ngSubmit",(function(){return e.submit()})),i.Ub(1,"div",1),i.Ub(2,"div",2),i.Pb(3,"upload-image-control",3),i.Ub(4,"button",4),i.bc("filesSelected",(function(t){return e.uploadFiles(t)})),i.Ic(5,"Upload Tracks"),i.Tb(),i.Tb(),i.Ub(6,"div",5),i.Ub(7,"div",6),i.Ub(8,"label",7),i.Ic(9,"Name"),i.Tb(),i.Pb(10,"input",8),i.Gc(11,J,2,1,"div",9),i.Tb(),i.Ub(12,"div",6),i.Ub(13,"label",10),i.Ic(14,"Release Date"),i.Tb(),i.Pb(15,"input",11),i.Gc(16,N,2,1,"div",9),i.Tb(),i.Gc(17,X,5,1,"div",12),i.Ub(18,"div",6),i.Ub(19,"label",13),i.Ic(20,"Description"),i.Tb(),i.Pb(21,"textarea",14),i.Gc(22,K,2,1,"div",9),i.Tb(),i.Ub(23,"div",6),i.Ub(24,"label",15),i.Ic(25,"Genres"),i.Tb(),i.Pb(26,"chip-input",16),i.Gc(27,Y,2,1,"div",9),i.Tb(),i.Ub(28,"div",6),i.Ub(29,"label",17),i.Ic(30,"Tags"),i.Tb(),i.Pb(31,"chip-input",18),i.Gc(32,W,2,1,"div",9),i.Tb(),i.Ub(33,"button",19),i.gc(34,"async"),i.Ic(35,"Save"),i.Tb(),i.Ub(36,"button",20),i.bc("click",(function(){return e.maybeCancel()})),i.Ic(37,"Cancel"),i.Tb(),i.Tb(),i.Tb(),i.Tb(),i.Ub(38,"ul",21),i.bc("cdkDropListDropped",(function(t){return e.reorderTracks(t)})),i.Gc(39,et,3,2,"li",22),i.gc(40,"async"),i.Tb()),2&t&&(i.mc("formGroup",e.form),i.Bb(4),i.mc("uploadButton",e.uploadButtonConfig),i.Bb(7),i.mc("ngIf",e.errors.name),i.Bb(5),i.mc("ngIf",e.errors.release_date),i.Bb(1),i.mc("ngIf",!e.hideArtistControl||!e.artist&&"artist"===e.settings.get("player.artist_type")),i.Bb(5),i.mc("ngIf",e.errors.description),i.Bb(4),i.mc("suggestFn",e.suggestGenreFn),i.Bb(1),i.mc("ngIf",e.errors.genres),i.Bb(4),i.mc("suggestFn",e.suggestTagFn),i.Bb(1),i.mc("ngIf",e.errors.tags),i.Bb(1),i.mc("disabled",i.hc(34,13,e.loading$)),i.Bb(6),i.mc("ngForOf",i.hc(40,15,e.allTracks$))("ngForTrackBy",e.trackByFn))},directives:[p.K,p.v,p.m,y.a,p.u,p.k,_.b,I.a,T.a,p.d,p.F,P.t,p.q,p.p,w.a,a.c,P.s,q,a.a,o.a,a.b,j.a],pipes:[P.b],styles:["[_nghost-%COMP%]{display:block;padding:25px}.main-info-fields[_ngcontent-%COMP%]{display:flex}.text-fields-container[_ngcontent-%COMP%]{flex:1 1 auto;margin-left:20px}.track-list[_ngcontent-%COMP%]{margin-top:30px;padding:0 15px}.track-list-item[_ngcontent-%COMP%]:not(.cdk-drag-preview){border-bottom:1px solid var(--be-divider-lighter);padding-bottom:15px;margin-bottom:15px}.upload-tracks-button[_ngcontent-%COMP%]{margin-top:15px;width:100%;line-height:40px}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:10px}.track-list[_ngcontent-%COMP%]{padding:0}.main-info-fields[_ngcontent-%COMP%]{display:block}.left-column[_ngcontent-%COMP%]{max-width:220px;margin:auto auto 25px}.text-fields-container[_ngcontent-%COMP%]{margin-left:0}}"],changeDetection:0}),t})()},rG4v:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n("eNwd"),a=n("gcYM"),o=n("fXoL"),s=n("h586"),r=n("bv9b");let c=(()=>{class t{constructor(t,e,n){this.el=t,this.uploadQueue=e,this.cd=n,this.hidden=!0,this.subscription=this.uploadQueue.totalProgress().pipe(Object(a.a)(260,i.a,{leading:!0,trailing:!0})).subscribe(t=>{this.progress=t,this.hidden=100===t||0===this.uploadQueue.count$.value.pending,this.cd.markForCheck()})}ngOnDestroy(){this.subscription.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(o.Ob(o.l),o.Ob(s.a),o.Ob(o.h))},t.\u0275cmp=o.Ib({type:t,selectors:[["upload-progress-bar"]],hostVars:2,hostBindings:function(t,e){2&t&&o.Fb("hidden",e.hidden)},decls:1,vars:1,consts:[["mode","determinate","color","accent",3,"value"]],template:function(t,e){1&t&&o.Pb(0,"mat-progress-bar",0),2&t&&o.mc("value",e.progress)},directives:[r.a],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0}),t})()},tBmH:function(t,e,n){"use strict";n.r(e),n.d(e,"UploadingModule",(function(){return U}));var i=n("ofXK"),a=n("6rvT"),o=n("/1cH"),s=n("bTqV"),r=n("A5z7"),c=n("NFeN"),l=n("STbY"),d=n("bv9b"),u=n("1jcm"),m=n("Qu3c"),b=n("GSRO"),p=n("3Pt+"),h=n("fo0W"),g=n("5+WD"),f=n("X3pI"),v=n("mhcW"),x=n("tyNb"),k=n("vHB1"),C=n("MFV3"),O=n("BeMW"),y=n("TheJ"),_=n("cVP4"),I=n("PUkl"),T=n("fXoL");const P=[{path:"",component:(()=>{class t{constructor(){}ngOnInit(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=T.Ib({type:t,selectors:[["uploading-host"]],decls:1,vars:0,template:function(t,e){1&t&&T.Pb(0,"router-outlet")},directives:[x.j],styles:["[_nghost-%COMP%]{display:block;padding:25px;background-color:var(--be-background-alternative);height:100%;overflow:auto}"],changeDetection:0}),t})(),children:[{path:"",component:k.a,data:{permissions:["tracks.create","albums.create"]}},{path:"tracks/:id/edit",component:O.a,resolve:{api:C.a},canDeactivate:[I.a]},{path:"albums/:id/edit",component:y.a,resolve:{api:_.a},canDeactivate:[I.a],data:{simplified:!0}}]}];let w=(()=>{class t{}return t.\u0275mod=T.Mb({type:t}),t.\u0275inj=T.Lb({factory:function(e){return new(e||t)},imports:[[x.i.forChild(P)],x.i]}),t})();var M=n("0Gur");let U=(()=>{class t{}return t.\u0275mod=T.Mb({type:t}),t.\u0275inj=T.Lb({factory:function(e){return new(e||t)},imports:[[i.c,x.i,v.a,w,c.b,d.b,a.a,b.a,p.E,p.o,s.c,M.a,r.e,u.b,m.b,h.a,g.e,o.b,l.b,f.a]]}),t})()},vHB1:function(t,e,n){"use strict";n.d(e,"a",(function(){return q}));var i=n("fXoL"),a=n("h586"),o=n("2Vo4"),s=n("QeDF"),r=n("+fqm"),c=n("IAz0"),l=n("twBr"),d=n("kmQS"),u=n("i2dy"),m=n("2zME"),b=n("tyNb"),p=n("Se92"),h=n("mrSG"),g=n("Lm4C"),f=n("sgCb");function v(t,e=[]){return Object(h.a)(this,void 0,void 0,(function*(){const n=yield(i=t,new Promise(t=>{i.createReader().readEntries(e=>t(e))}));var i;for(const t in n){const i=n[t];i.isDirectory?yield v(i,e):e.push(yield x(i))}return e}))}function x(t){return new Promise(e=>{t.file(n=>{e(new f.a(n,t.fullPath))})})}let k=(()=>{class t{constructor(t){this.el=t,this.disableDropzoneClick=!1,this.disableDropzone=!1,this.uploadConfig={},this.filesDropped=new i.n}ngOnInit(){const t=this.el.nativeElement;t.addEventListener("dragenter",t=>this.handleDragEnter(t)),t.addEventListener("dragover",t=>this.handleDragOver(t)),t.addEventListener("dragleave",t=>this.handleDragLeave(t)),t.addEventListener("drop",t=>this.handleDrop(t)),this.disableDropzoneClick||(this.clickButton?this.clickButton.nativeElement:t).addEventListener("click",()=>this.handleClick())}ngOnDestroy(){this.removeClassesFromDropzone()}handleClick(){this.disableDropzone||Object(g.a)(this.uploadConfig).then(t=>{this.emitUploadEvent(t)})}handleDragEnter(t){this.dropzoneDisabled(t)||this.el.nativeElement.classList.add("file-over-dropzone")}handleDragOver(t){return t.preventDefault&&t.preventDefault(),t.dataTransfer.dropEffect=this.dropzoneDisabled(t)?"none":"move",!1}handleDragLeave(t){const e=document.elementFromPoint(t.clientX,t.clientY);this.el.nativeElement.contains(e)||this.removeClassesFromDropzone()}handleDrop(t){return Object(h.a)(this,void 0,void 0,(function*(){if(t.stopPropagation(),t.preventDefault(),this.removeClassesFromDropzone(),this.dropzoneDisabled(t)||!t.dataTransfer.items)return;const e=Array.from(t.dataTransfer.items).filter(t=>"file"===t.kind).map(t=>t.webkitGetAsEntry());e.length&&this.emitUploadEvent(yield function(t){return Object(h.a)(this,void 0,void 0,(function*(){let e=[];for(const n in t){const i=t[n];i.isDirectory?e=e.concat(yield v(i)):e.push(yield x(i))}return e}))}(e))}))}emitUploadEvent(t){this.filesDropped.emit(t)}removeClassesFromDropzone(){this.el.nativeElement.classList.remove("file-over-dropzone")}dropzoneDisabled(t){const e=t.dataTransfer.types.find(t=>"files"===t.toLowerCase());return this.disableDropzone||!e}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(i.l))},t.\u0275dir=i.Jb({type:t,selectors:[["","fileDropzone",""]],inputs:{disableDropzoneClick:"disableDropzoneClick",disableDropzone:"disableDropzone",clickButton:"clickButton",uploadConfig:["fileDropzone","uploadConfig"]},outputs:{filesDropped:"filesDropped"}}),t})();var C=n("Rd8u"),O=n("bTqV"),y=n("ofXK"),_=n("1jcm"),I=n("r48M"),T=n("IvAZ"),P=n("EO6T"),w=n("oJCZ"),M=n("8HKz"),U=n("A5z7");const B=["trackLinkInput"];function A(t,e){if(1&t&&(i.Ub(0,"mat-chip",23),i.Ic(1),i.Tb()),2&t){const t=i.fc();i.Bb(1),i.Jc(t.media.genres[0].name)}}let F=(()=>{class t{constructor(t,e){this.settings=t,this.urls=e}ngOnInit(){setTimeout(()=>{this.trackLinkInput.nativeElement.focus(),this.trackLinkInput.nativeElement.select()})}mediaLink(){return this.isTrack(this.media)?this.urls.track(this.media):this.urls.album(this.media)}mediaUrl(){return this.urls.routerLinkToUrl(this.mediaLink())}shareUsing(t){Object(P.a)(t,this.mediaUrl())}isTrack(t){return t.model_type===T.a}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(d.a),i.Ob(w.a))},t.\u0275cmp=i.Ib({type:t,selectors:[["uploaded-media-preview"]],viewQuery:function(t,e){var n;1&t&&i.Ec(B,!0),2&t&&i.tc(n=i.cc())&&(e.trackLinkInput=n.first)},hostAttrs:[1,"material-panel"],inputs:{media:"media"},decls:32,vars:14,consts:[[1,"media-image-container"],[3,"media"],["alt","album border image",1,"album-border-image",3,"src"],[1,"middle-column"],[1,"artist-name"],[1,"track-name"],[1,"genre-row"],["class","track-genre",4,"ngIf"],[1,"message"],["trans",""],["trans","",3,"routerLink"],[1,"right-column"],["trans","",1,"title"],[1,"share-icons"],["mat-icon-button","",3,"click"],["alt","facebook-icon",3,"src"],["alt","twitter-icon",3,"src"],["alt","tumblr-icon",3,"src"],["alt","blogger-icon",3,"src"],[1,"track-link-input","input-container"],["for","media-item-link","trans","",1,"hidden"],["id","media-item-link","type","text","readonly","",3,"value","click"],["trackLinkInput",""],[1,"track-genre"]],template:function(t,e){1&t&&(i.Ub(0,"div",0),i.Pb(1,"media-image",1),i.Pb(2,"img",2),i.Tb(),i.Ub(3,"div",3),i.Ub(4,"div",4),i.Ic(5),i.Tb(),i.Ub(6,"div",5),i.Ic(7),i.Tb(),i.Ub(8,"div",6),i.Gc(9,A,2,1,"mat-chip",7),i.Tb(),i.Ub(10,"div",8),i.Ub(11,"span",9),i.Ic(12,"Upload complete."),i.Tb(),i.Ub(13,"a",10),i.Ic(14," View now."),i.Tb(),i.Tb(),i.Tb(),i.Ub(15,"div",11),i.Ub(16,"div",12),i.Ic(17),i.Tb(),i.Ub(18,"div",13),i.Ub(19,"button",14),i.bc("click",(function(){return e.shareUsing("facebook")})),i.Pb(20,"img",15),i.Tb(),i.Ub(21,"button",14),i.bc("click",(function(){return e.shareUsing("twitter")})),i.Pb(22,"img",16),i.Tb(),i.Ub(23,"button",14),i.bc("click",(function(){return e.shareUsing("tumblr")})),i.Pb(24,"img",17),i.Tb(),i.Ub(25,"button",14),i.bc("click",(function(){return e.shareUsing("blogger")})),i.Pb(26,"img",18),i.Tb(),i.Tb(),i.Ub(27,"div",19),i.Ub(28,"label",20),i.Ic(29,"Media link"),i.Tb(),i.Ub(30,"input",21,22),i.bc("click",(function(t){return t.target.select()})),i.Tb(),i.Tb(),i.Tb()),2&t&&(i.Fb("show-album-border",!e.isTrack(e.media)),i.Bb(1),i.mc("media",e.media),i.Bb(1),i.mc("src",e.settings.getAssetUrl("images/album-border.png"),i.Ac),i.Bb(3),i.Jc(e.isTrack(e.media)?e.media.artists[0].name:e.media.artist.name),i.Bb(2),i.Jc(e.media.name),i.Bb(2),i.mc("ngIf",e.media.genres.length),i.Bb(4),i.mc("routerLink",e.mediaLink()),i.Bb(4),i.Kc("Share your new ",e.isTrack(e.media)?"track":"album",""),i.Bb(3),i.nc("src",e.settings.getAssetUrl("images/social-icons/facebook.png"),i.Ac),i.Bb(2),i.nc("src",e.settings.getAssetUrl("images/social-icons/twitter.png"),i.Ac),i.Bb(2),i.nc("src",e.settings.getAssetUrl("images/social-icons/tumblr.png"),i.Ac),i.Bb(2),i.nc("src",e.settings.getAssetUrl("images/social-icons/bloggr.png"),i.Ac),i.Bb(4),i.mc("value",e.mediaUrl()))},directives:[M.a,y.t,C.a,b.h,O.b,U.a],styles:["[_nghost-%COMP%]{display:flex;align-items:center;min-width:800px;max-width:100%}.media-image-container[_ngcontent-%COMP%]{flex-shrink:0;width:130px;height:130px}.media-image-container.show-album-border[_ngcontent-%COMP%]{position:relative;margin:15px 15px 15px 20px}.media-image-container.show-album-border[_ngcontent-%COMP%]   .album-border-image[_ngcontent-%COMP%]{display:block}media-image[_ngcontent-%COMP%]     img{position:relative;z-index:2}.album-border-image[_ngcontent-%COMP%]{display:none;position:absolute;width:160px;height:160px;top:-15px;left:-15px;z-index:1}.middle-column[_ngcontent-%COMP%], .right-column[_ngcontent-%COMP%]{flex:1 1 auto}.middle-column[_ngcontent-%COMP%]{padding:0 20px}.artist-name[_ngcontent-%COMP%]{color:var(--be-secondary-text)}.track-name[_ngcontent-%COMP%]{font-weight:500}.genre-row[_ngcontent-%COMP%]{margin:10px 0 20px}.right-column[_ngcontent-%COMP%]   .title[_ngcontent-%COMP%]{color:var(--be-secondary-text);margin-bottom:5px}.right-column[_ngcontent-%COMP%]   .share-icons[_ngcontent-%COMP%]{margin-bottom:30px}.right-column[_ngcontent-%COMP%]   .mat-icon-button[_ngcontent-%COMP%]{margin-right:5px;width:32px;height:32px;line-height:32px}.right-column[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%}.input-container[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{height:35px}"],changeDetection:0}),t})();const D=["clickMatButton"];function E(t,e){if(1&t){const t=i.Vb();i.Ub(0,"div",11),i.Ub(1,"mat-slide-toggle",12),i.bc("change",(function(e){return i.xc(t),i.fc().createAlbum$.next(e.checked)})),i.Ic(2,"Create Album"),i.Tb(),i.Ub(3,"p",13),i.Ic(4,"Attach all uploaded files to a new album."),i.Tb(),i.Tb()}}function $(t,e){if(1&t){const t=i.Vb();i.Ub(0,"div",14),i.Ub(1,"mat-slide-toggle",12),i.bc("change",(function(e){return i.xc(t),i.fc().autoCreateArtists=e.checked})),i.Ic(2,"Create Artists"),i.Tb(),i.Ub(3,"p",13),i.Ic(4,"Automatically create artists based on track metadata (unless artist already exists)."),i.Tb(),i.Tb()}}function V(t,e){if(1&t&&(i.Ub(0,"div",15),i.Ub(1,"span",13),i.Ic(2),i.Ub(3,"a",16),i.Ic(4,"Pro accounts"),i.Tb(),i.Ic(5," to get more time and access to advanced features."),i.Tb(),i.Tb()),2&t){const t=e.ngIf;i.Bb(2),i.Kc("You have ",t," minutes left. Try ")}}function j(t,e){if(1&t){const t=i.Vb();i.Ub(0,"album-form",21),i.bc("saved",(function(e){return i.xc(t),i.fc(3).addSavedMedia(e)})),i.Tb()}if(2&t){const t=i.fc(3);i.mc("hideArtistControl",!t.insideAdmin())}}function S(t,e){if(1&t){const t=i.Vb();i.Ub(0,"div",23),i.Ub(1,"track-form",24),i.bc("saved",(function(e){return i.xc(t),i.fc(5).addSavedMedia(e)})),i.Tb(),i.Tb()}if(2&t){const t=e.$implicit;i.Bb(1),i.mc("uploadQueueItem",t)}}function G(t,e){if(1&t&&(i.Sb(0),i.Gc(1,S,2,1,"div",22),i.Rb()),2&t){const t=i.fc(3).ngIf,e=i.fc();i.Bb(1),i.mc("ngForOf",t)("ngForTrackBy",e.trackByFn)}}function z(t,e){if(1&t&&(i.Gc(0,G,2,2,"ng-container",18),i.gc(1,"async")),2&t){const t=i.fc(3);i.mc("ngIf",i.hc(1,1,t.errors$))}}function L(t,e){if(1&t&&(i.Sb(0),i.Gc(1,j,1,1,"album-form",19),i.gc(2,"async"),i.Gc(3,z,2,3,"ng-template",null,20,i.Hc),i.Rb()),2&t){const t=i.uc(4),e=i.fc(2);i.Bb(1),i.mc("ngIf",i.hc(2,2,e.createAlbum$))("ngIfElse",t)}}function R(t,e){if(1&t&&(i.Ub(0,"div",17),i.Gc(1,L,5,4,"ng-container",18),i.Tb()),2&t){const t=e.ngIf;i.Bb(1),i.mc("ngIf",t.length)}}function Q(t,e){1&t&&i.Pb(0,"uploaded-media-preview",25),2&t&&i.mc("media",e.$implicit)}let q=(()=>{class t{constructor(t,e,n,i,a,r,c,l,d){this.track=t,this.currentUser=e,this.uploadQueue=n,this.settings=i,this.tracks=a,this.toast=r,this.audioValidator=c,this.router=l,this.waveGenerator=d,this.errors$=new o.a({}),this.uploadConfig={types:[s.a.video,s.a.audio],multiple:!0},this.savedMedia$=new o.a([]),this.createAlbum$=new o.a(!1),this.autoCreateArtists=!1,this.trackByFn=(t,e)=>e.id}uploadTracks(t){this.uploadQueue.start(t,{uri:"uploads",httpParams:{autoMatch:this.autoCreateArtists,diskPrefix:"track_media",disk:"public"},validator:this.audioValidator,willProcessFiles:!0}).subscribe(t=>{const e=this.uploadQueue.find(t.queueItemId);this.waveGenerator.generate(e.uploadedFile.native).then(t=>{e.customData={waveData:t},e.finishProcessing()})})}addSavedMedia(t){this.savedMedia$.next([...this.savedMedia$.value,t])}insideAdmin(){return this.router.url.indexOf("admin")>-1}}return t.\u0275fac=function(e){return new(e||t)(i.Ob(c.a),i.Ob(l.a),i.Ob(a.a),i.Ob(d.a),i.Ob(c.a),i.Ob(u.b),i.Ob(m.a),i.Ob(b.e),i.Ob(p.c))},t.\u0275cmp=i.Ib({type:t,selectors:[["upload-page"]],viewQuery:function(t,e){var n;1&t&&(i.Ec(D,!0,i.l),i.Pc(r.a,!0)),2&t&&(i.tc(n=i.cc())&&(e.clickButton=n.first),i.tc(n=i.cc())&&(e.trackForms=n))},features:[i.Ab([a.a])],decls:15,vars:11,consts:[[1,"dropzone",3,"fileDropzone","clickButton","filesDropped"],["trans","",1,"title"],[1,"action-button"],["mat-flat-button","","color","accent","type","button","trans","",1,"upload-button"],["clickMatButton",""],["class","setting-toggle-container",4,"ngIf"],["class","setting-toggle-container create-artists-toggle material-panel",4,"ngIf"],["class","minutes-container",4,"ngIf"],["class","track-upload-queue",4,"ngIf"],[1,"saved-tracks"],[3,"media",4,"ngFor","ngForOf"],[1,"setting-toggle-container"],["trans","",3,"change"],["trans",""],[1,"setting-toggle-container","create-artists-toggle","material-panel"],[1,"minutes-container"],["routerLink","/billing/upgrade","target","_blank",1,"hover-underline"],[1,"track-upload-queue"],[4,"ngIf"],["class","material-panel",3,"hideArtistControl","saved",4,"ngIf","ngIfElse"],["createTracks",""],[1,"material-panel",3,"hideArtistControl","saved"],["class","track-panel material-panel",4,"ngFor","ngForOf","ngForTrackBy"],[1,"track-panel","material-panel"],[3,"uploadQueueItem","saved"],[3,"media"]],template:function(t,e){1&t&&(i.Ub(0,"div",0),i.bc("filesDropped",(function(t){return e.uploadTracks(t)})),i.Ub(1,"div",1),i.Ic(2,"Drag and drop your tracks, videos & albums here."),i.Tb(),i.Ub(3,"div",2),i.Ub(4,"button",3,4),i.Ic(6,"or choose files to upload"),i.Tb(),i.Tb(),i.Gc(7,E,5,0,"div",5),i.Tb(),i.Gc(8,$,5,0,"div",6),i.Gc(9,V,6,1,"div",7),i.Gc(10,R,2,1,"div",8),i.gc(11,"async"),i.Ub(12,"div",9),i.Gc(13,Q,1,1,"uploaded-media-preview",10),i.gc(14,"async"),i.Tb()),2&t&&(i.mc("fileDropzone",e.uploadConfig)("clickButton",e.clickButton),i.Bb(7),i.mc("ngIf",e.uploadQueue.isEmpty()),i.Bb(1),i.mc("ngIf",e.insideAdmin()&&e.currentUser.hasPermission("artists.create")),i.Bb(1),i.mc("ngIf",e.currentUser.getRestrictionValue("tracks.create","minutes")),i.Bb(1),i.mc("ngIf",i.hc(11,7,e.uploadQueue.uploads$)),i.Bb(3),i.mc("ngForOf",i.hc(14,9,e.savedMedia$)))},directives:[k,C.a,O.b,y.t,y.s,_.a,b.h,I.a,r.a,F],pipes:[y.b],styles:["admin[_nghost-%COMP%], admin   [_nghost-%COMP%]{min-height:calc(100vh - 120px)}[_nghost-%COMP%]{display:flex;align-items:center;justify-content:center;flex-direction:column;min-height:100%}.dropzone[_ngcontent-%COMP%]{background:var(--be-background);padding:50px;border-radius:4px;text-align:center;border:1px solid var(--be-divider-default);min-width:520px;max-width:90%}.dropzone[_ngcontent-%COMP%]   .action-button[_ngcontent-%COMP%]{margin-top:20px}.dropzone[_ngcontent-%COMP%]   .setting-toggle-container[_ngcontent-%COMP%]{margin-top:20px;padding-top:20px;border-top:1px solid var(--be-divider-lighter)}.dropzone[_ngcontent-%COMP%]   .title[_ngcontent-%COMP%]{font-size:1.8rem}.dropzone[_ngcontent-%COMP%]   .setting-toggle-container[_ngcontent-%COMP%], .dropzone[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin-bottom:0}.dropzone.file-over-dropzone[_ngcontent-%COMP%]{border-color:var(--be-accent-default);background-color:var(--be-accent-emphasis)}.create-artists-toggle[_ngcontent-%COMP%]{margin-top:20px;min-width:520px;text-align:center}.minutes-container[_ngcontent-%COMP%]{color:var(--be-secondary-text);font-size:1.5rem;margin-top:20px}.minutes-container[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:var(--be-accent-default)}.track-upload-queue[_ngcontent-%COMP%]{width:100%;margin-top:40px}.track-panel[_ngcontent-%COMP%]{margin-bottom:20px;padding:20px 25px}uploaded-media-preview[_ngcontent-%COMP%]{margin-bottom:15px}"],changeDetection:0}),t})()}}]);
  //# sourceMappingURL=7-es2015.fc3879846f3f71f72068.js.map