1"use strict";(self.webpackChunkwebsite_cms_ui=self.webpackChunkwebsite_cms_ui||[]).push([[794],{2588:(D,b,n)=>{n.d(b,{z:()=>f});var c=n(529);class f{static isHttpResponse(p){return p.type===c.dt.Response}static isHttpProgressEvent(p){return p.type===c.dt.DownloadProgress||p.type===c.dt.UploadProgress}static calculateState(p,g,e){if(f.isHttpProgressEvent(g)){const M=g.total?Math.round(100*g.loaded/g.total):p.progress;return e&&(e.message="Uploading File ("+M+"%)"),{progress:M,state:"IN_PROGRESS"}}return f.isHttpResponse(g)?{progress:100,state:"DONE",response:g.body}:p}}},9967:(D,b,n)=>{n.d(b,{j:()=>k});var c=n(5861),f=n(2588),y=n(7579),p=n(2722),g=n(5026),e=n(4650),M=n(8803),r=n(5412),_=n(9532),d=n(6648),a=n(6895),E=n(1576),C=n(5829),T=n(4841),x=n(4859),A=n(7392),h=n(671),v=n(8255);function F(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",20),e._UZ(2,"mat-icon",21),e.TgZ(3,"span",22),e.NdJ("click",function(){e.CHM(t);const m=e.oxw();return e.KtG(m.itemClick(0))}),e._uU(4,"Root"),e.qZA()(),e.BQk()}2&i&&(e.xp6(2),e.Q6J("svgIcon","heroicons_solid:chevron-right"))}const S=function(i){return{parent:i}};function L(i,o){if(1&i&&(e.ynx(0),e.GkF(1,23),e.BQk()),2&i){const t=e.oxw(),l=e.MAs(11);e.xp6(1),e.Q6J("ngTemplateOutlet",l)("ngTemplateOutletContext",e.VKq(2,S,t.currentFolder.parent))}}function U(i,o){if(1&i&&e.GkF(0,23),2&i){const t=e.oxw().parent;e.oxw();const l=e.MAs(11);e.Q6J("ngTemplateOutlet",l)("ngTemplateOutletContext",e.VKq(2,S,t.parent))}}function R(i,o){if(1&i){const t=e.EpF();e.YNc(0,U,1,4,"ng-container",24),e.TgZ(1,"div",20),e._UZ(2,"mat-icon",21),e.TgZ(3,"span",22),e.NdJ("click",function(){const s=e.CHM(t).parent,u=e.oxw();return e.KtG(u.itemClick(s))}),e._uU(4),e.qZA()()}if(2&i){const t=o.parent;e.Q6J("ngIf",t.parent),e.xp6(2),e.Q6J("svgIcon","heroicons_solid:chevron-right"),e.xp6(2),e.Oqu(t.itemName)}}function Z(i,o){1&i&&(e.TgZ(0,"th",34),e._uU(1," Type. "),e.qZA())}function N(i,o){1&i&&e._UZ(0,"mat-icon",38),2&i&&e.Q6J("svgIcon","heroicons_solid:folder")}function B(i,o){if(1&i&&(e.TgZ(0,"div",39),e._UZ(1,"mat-icon",40),e.TgZ(2,"div",41),e._uU(3),e.qZA()()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("svgIcon","heroicons_solid:document"),e.xp6(2),e.hij(" ",null==t.file||null==t.file.file_format?null:t.file.file_format.formatName.toUpperCase(),"")}}function K(i,o){if(1&i&&(e.TgZ(0,"td",35),e.YNc(1,N,1,1,"mat-icon",36),e.YNc(2,B,4,2,"div",37),e.qZA()),2&i){const t=o.$implicit;e.xp6(1),e.Q6J("ngIf",1==t.isFolder),e.xp6(1),e.Q6J("ngIf",0==t.isFolder)}}function W(i,o){1&i&&(e.TgZ(0,"th",34),e._uU(1," Name "),e.qZA())}function w(i,o){if(1&i&&(e.TgZ(0,"td",35)(1,"span"),e._uU(2),e.qZA()()),2&i){const t=o.$implicit;e.xp6(2),e.Oqu(t.itemName)}}function $(i,o){1&i&&(e.TgZ(0,"th",34),e._uU(1," Create At "),e.qZA())}function H(i,o){if(1&i&&(e.TgZ(0,"td",35),e._uU(1),e.ALo(2,"date"),e.qZA()),2&i){const t=o.$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.createAt,"YYYY-MM-dd HH:mm:ss")," ")}}function Y(i,o){1&i&&(e.TgZ(0,"th",34),e._uU(1," Operations "),e.qZA())}function Q(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){e.CHM(t);const m=e.oxw().$implicit,s=e.oxw(2);return e.KtG(s.selectFile(m))}),e.TgZ(1,"mat-icon"),e._uU(2,"add"),e.qZA()()}}function J(i,o){if(1&i&&(e.TgZ(0,"td",35),e.YNc(1,Q,3,0,"button",42),e.qZA()),2&i){const t=o.$implicit;e.xp6(1),e.Q6J("ngIf",1!=t.isFolder)}}function j(i,o){1&i&&e._UZ(0,"tr",44)}function G(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"tr",45),e.NdJ("click",function(){const s=e.CHM(t).$implicit,u=e.oxw(2);return e.KtG(u.itemClick(s))}),e.qZA()}}function z(i,o){if(1&i&&(e.TgZ(0,"table",25),e.ynx(1,26),e.YNc(2,Z,2,0,"th",27),e.YNc(3,K,3,2,"td",28),e.BQk(),e.ynx(4,29),e.YNc(5,W,2,0,"th",27),e.YNc(6,w,3,1,"td",28),e.BQk(),e.ynx(7,30),e.YNc(8,$,2,0,"th",27),e.YNc(9,H,3,4,"td",28),e.BQk(),e.ynx(10,31),e.YNc(11,Y,2,0,"th",27),e.YNc(12,J,2,1,"td",28),e.BQk(),e.YNc(13,j,1,0,"tr",32),e.YNc(14,G,1,0,"tr",33),e.qZA()),2&i){const t=e.oxw();e.Q6J("dataSource",t.listData),e.xp6(13),e.Q6J("matHeaderRowDef",t.displayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns)}}let k=(()=>{class i{constructor(t,l,m,s){this.layoutService=t,this.dialogRef=l,this.notificationService=m,this.fileSelectService=s,this._unsubscribes=new y.x,this.isLoading=!1,this.currentFolderId=0,this.listData=[],this.displayedColumns=["type","itemName","lastUpdate","o
1perations"],this.initSubscriptions()}initSubscriptions(){this.layoutService.onLayoutConfigChanged.pipe((0,p.R)(this._unsubscribes)).subscribe(t=>this.layoutConfig=t),this.fileSelectService.list$.pipe((0,p.R)(this._unsubscribes)).subscribe(t=>{this.listData=t??[]}),this.fileSelectService.folder$.pipe((0,p.R)(this._unsubscribes)).subscribe(t=>{this.currentFolder=t,this.currentFolderId=t?t.itemId:0})}ngOnInit(){this.fileSelectService.fetchData(this.currentFolderId)}ngOnDestroy(){this._unsubscribes.next(),this._unsubscribes.complete(),this._unsubscribes.unsubscribe()}itemClick(t){0==t?(this.fileSelectService.fetchFolder(0),this.fileSelectService.fetchData(0)):t.isFolder&&(this.fileSelectService.fetchFolder(t.itemId),this.fileSelectService.fetchData(t.itemId))}selectFile(t){var l=this;return(0,c.Z)(function*(){const m=yield l.fileSelectService.fetchItem(t.itemId),s=m.result.shares;let u="";u=0==s.length?(yield l.fileSelectService.createSystemShare(t)).shareCode:s[0].shareCode,l.dialogRef.close({shareCode:u,info:m.result})})()}uploadFile(t){var l=this;const m=t.target.files[0];this.isLoading=!0;try{const s=this.notificationService.uploadProgress("Uploading File "),u={state:"PENDING",progress:0};this.fileSelectService.uploadFile(m).pipe((0,g.R)((O,P)=>f.z.calculateState(O,P,s),u)).subscribe(function(){var O=(0,c.Z)(function*(P){if("DONE"==P.state){const I=P.response.result;yield l.fileSelectService.createLibraryFile({itemType:"file",itemName:I.file.fileName,description:"",fileId:I.file.fileId,folderId:l.currentFolderId,isFolder:0}),l.notificationService.closeNotification(s.notificationId),l.notificationService.success("Successfully uploaded."),l.fileSelectService.fetchData(l.currentFolderId)}});return function(P){return O.apply(this,arguments)}}(),O=>{this.notificationService.closeNotification(s.notificationId)})}catch(s){this.notificationService.error(s.error.message)}finally{this.isLoading=!1}}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(M.P),e.Y36(r.so),e.Y36(_.o),e.Y36(d.H))},i.\u0275cmp=e.Xpm({type:i,selectors:[["app-media-library-file-select"]],decls:31,vars:7,consts:[["id","media-library","fxLayout","column"],[1,"flex","flex-col","sm:flex-row","flex-0","sm:items-center","sm:justify-between","border-b","bg-card","dark:bg-transparent"],[1,"flex-1","min-w-0"],[1,"hidden","sm:flex","flex-wrap","items-center","font-medium"],[1,"whitespace-nowrap"],[4,"ngIf"],["parentNav",""],[1,"mt-2"],[1,"text-3xl","md:text-4xl","font-extrabold","tracking-tight","leading-7","sm:leading-10","truncate"],["fxLayoutGap","1rem",1,"flex","shrink-0","items-center","mt-6","sm:mt-0","sm:ml-4"],["mat-flat-button","",3,"color","matMenuTriggerFor","disabled"],[1,"mr-2"],["type","file","fxHide","",3,"change"],["inputNewFile",""],["addMenu","matMenu"],["mat-menu-item","",3,"click"],[1,"inline-flex","items-center","justify-between","w-full","min-w-30","leading-5"],[1,"font-medium"],["fxLayout","column","fxLayoutAlign","space-between",1,"data-table",3,"perfectScrollbar"],["mat-table","","class","border-t",3,"dataSource",4,"ngIf"],[1,"flex","items-center","ml-1","whitespace-nowrap"],[1,"icon-size-5","text-secondary",3,"svgIcon"],[1,"text-primary-500","cursor-pointer",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],["mat-table","",1,"border-t",3,"dataSource"],["matColumnDef","type"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","itemName"],["matColumnDef","lastUpdate"],["matColumnDef","operations"],["mat-header-row","","class","bg-gray-50",4,"matHeaderRowDef"],["mat-row","",3,"click",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["class","icon-size-6 text-secondary",3,"svgIcon",4,"ngIf"],["class","relative",4,"ngIf"],[1,"icon-size-6","text-secondary",3,"svgIcon"],[1,"relative"],[1,"icon-size-6","text-hint","opacity-50",3,"svgIcon"],[1,"absolute","left-1","bottom-0","rounded","text-xs","font-semibold"],["mat-icon-button","",3,"click",4,"ngIf"],["mat-icon-button","",3,"click"],["mat-header-row","",1,"bg-gray-50"],["mat-row","",3,"click"]],template:function(t,l){if(1&t){const m=e.EpF();e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div")(4,"div",3)(5,"div")(6,"a",4),e._uU(7,"Media Library"),e.qZA()(),e.YNc(8,F,5,1,"ng-container",5),e.YNc(9,L,2,4,"ng-container",5),e.YNc(10,R,5,3,"ng-template",null,6,e.W1O),e.qZA()(),e.TgZ(12,"div",7)(13,"h2",8),e._uU(14),e.qZA()()(),e.TgZ(15,"div",9)(16,"button",10)(17,"mat-icon",11),e._uU(18,"add"),e.qZA(),e.TgZ(19,"span"),e._uU(20,"Add"),e.qZA()(),e.TgZ(21,"input",12,13),e.NdJ("change",function(u){return l.uploadFile(u)}),e.qZA(),e.TgZ(23,"mat-menu",null,14)(25,"button",15),e.NdJ("click",function(){e.CHM(m);const u=e.MAs(22);return e.KtG(u.click())}),e.TgZ(26,"span",16)(27,"span",17),e._uU(28,"File"),e.qZA()()()()()(),e.TgZ(29,"div",18),e.YNc(30,z,15,3,"table",19),e.qZA()()}if(2&t){const m=e.MAs(24);e.xp6(8),e.Q6J("ngIf",l.currentFolderId>0),e.xp6(1),e.Q6J("ngIf",null==l.currentFolder?null:l.currentFolder.parent),e.xp6(5),e.hij(" ",0==l.currentFolderId?"Root Folder":null==l.currentFolder?null:l.currentFolder.itemName," "),e.xp6(2),e.Q6J("color","primary")("matMenuTriggerFor",m)("disabled",l.isLoading),e.xp6(14),e.Q6J("ngIf",l.listData.length>0)}},dependencies:[a.O5,a.tP,E.xw,E.SQ,E.Wh,C.b8,T.$V,x.lW,A.Hw,h.BZ,h.fO,h.as,h.w1,h.Dz,h.nj,h.ge,h.ev,h.XQ,h.Gk,v.VK,v.OP,v.p6,a.uU],styles:["#media-library[_ngcontent-%COMP%]{width:100%;height:100%;background-color:#fff}#media-library[_ngcontent-%COMP%] .data-table[_ngcontent-%COMP%]{width:100%;height:100%}#media-library[_ngcontent-%COMP%] .data-table[_ngcontent-%COMP%] .mat-row[_ngcontent-%COMP%]:hover .mat-cell[_ngcontent-%COMP%]{background-color:#94a3b81f}#media-library[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%]{max-height:100%;overflow:hidden}"]}),i})()},9607:(D,b,n)=>{n.d(b,{H:()=>x});var c=n(9116),f=n(1358),y=n(9478),p=n(9012),g=n(2348),e=n(671),M=n(7974),r=n(6648),_=n(4859),d=n(7392),a=n(3267),E=n(8255),C=n(5412),T=n(4650);let x=(()=>{class A{}return A.\u0275fac=function(v){return new(v||A)},A.\u0275mod=T.oAB({type:A}),A.\u0275inj=T.cJS({providers:[r.H],imports:[c.Bz,f.o,y.Q,p.U,g.B,_.ot,a.SJ,d.Ps,e.p0,M.TU,E.Tx,C.Is]}),A})()},6648:(D,b,n)=>{n.d(b,{H:()=>g});var c=n(2340),f=n(1135),y=n(4650),p=n(529);let g=(()=>{class e{constructor(r){this.http=r,this.list$=new f.X(null),this.folder$=new f.X(null),this.item$=new f.X(null)}resolve(r,_){}fetchData(r=0){return new Promise((_,d)=>{this.http.get(`${c.N.API_HOST}/v1/library-item/folder/${r}`).subscribe(a=>{this.list$.next(a.result),_(a)},a=>d(a))})}fetchFolder(r){return new Promise((_,d)=>{0==r?(this.folder$.next(null),_(null)):this.http.get(`${c.N.API_HOST}/v1/library-item/${r}`).subscribe(a=>{this.folder$.next(a.result),_(a)},a=>d(a))})}fetchItem(r){return new Promise((_,d)=>{if(void 0===r)return this.item$.next(null),void _(null);this.http.get(`${c.N.API_HOST}/v1/library-item/${r}`).subscribe(a=>{this.item$.next(a.result),_(a)},a=>d(a))})}createFolder(r,_){const d={itemName:r,description:"",folderId:_};return new Promise((a,E)=>{this.http.post(`${c.N.API_HOST}/v1/library-item/folder`,d).subscribe(C=>{a(C)},C=>E(C))})}createLibraryFile(r){return new Promise((_,d)=>{this.http.post(`${c.N.API_HOST}/v1/library-item/file`,r).subscribe(a=>{_(a)},d)})}createSystemShare(r){return new Promise((_,d)=>{this.http.post(`${c.N.API_HOST}/v1/library-item/${r.itemId}/share/system`,{}).subscribe(a=>{_(a)},d)})}uploadFile(r){const _=new FormData;return _.append("file",r,r.name),this.http.post(`${c.N.API_HOST}/v1/upload/file`,_,{reportProgress:!0,observe:"events"})}deleteItem(r){return new Promise((_,d)=>{this.http.delete(`${c.N.API_HOST}/v1/library-item/${r}`).subscribe(a=>{_(a)},a=>d(a))})}}return e.\u0275fac=function(r){return new(r||e)(y.LFG(p.eN))},e.\u0275prov=y.Yz7({token:e,factory:e.\u0275fac}),e})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.