@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
2 lines • 162 kB
JavaScript
import{a as $o,h as ii,m as ni,n as qo,p as Pe}from"./chunk-RTNEBRKJ.js";import{c as Wo}from"./chunk-JXZCNFW7.js";import{w as ei}from"./chunk-B6HQYQYG.js";import{a as ti}from"./chunk-GWRAGN3M.js";import{Aa as Xt,Cb as $,Db as Jt,Eb as Uo,Fb as Go,Ga as Do,Ha as Fo,Ia as Io,Mb as Zt,Nb as ne,Ob as Re,Ra as Ro,Ua as ft,Ya as Oo,bb as No,cb as Vo,ib as Ji,lb as Bo,m as ho,s as Kt,t as Yt,tb as Ho,vb as fe,ya as To,za as be}from"./chunk-O3YLAEVE.js";import{Aa as $e,Ac as Xi,B as F,Bb as W,Bc as je,Bf as Ao,C as We,Cb as ot,Cd as lt,Ce as Mo,E as jn,Eb as x,Ed as Me,G as Kn,Gb as M,Gf as Qt,Ha as Xn,Hb as $i,Ia as De,Ib as qi,Ja as Ht,Jb as io,Jd as ct,Kd as ke,Lb as ji,Ma as it,Mb as Ki,Nb as Ut,Oa as p,Ob as Gt,Pb as no,Qa as le,Qb as K,Qc as Ie,Qe as ko,Rb as qe,Tb as L,Te as Lo,Ub as Q,Vb as Yi,Wb as oo,Wc as jt,Xa as xe,Xb as he,Xc as co,Yb as me,Yc as ee,Zb as pe,aa as tt,ab as A,bb as _e,be as mo,c as Un,cb as Jn,cd as rt,da as Yn,db as Ui,dd as fo,ea as Z,ec as Wt,ed as uo,ee as po,f as vt,fa as ze,fe as go,ff as wo,ge as bo,hc as ro,ie as yo,ja as v,jd as st,je as vo,k as Gn,kc as V,lb as R,lc as so,mb as O,mc as Y,me as Co,nb as Zn,nc as ao,ne as So,nf as Eo,oa as E,od as at,oe as xo,of as zo,pa as z,pb as Gi,q as Wn,qb as Wi,qg as ce,rb as y,rc as $t,sa as Qn,sb as h,sc as Fe,t as $n,tb as m,tc as Qi,tf as _o,u as Ge,ub as _,v as et,va as ie,vb as eo,vc as lo,w as qn,wb as to,wc as j,xa as Ct,xb as nt,xc as qt,yc as ge,yf as Po}from"./chunk-D55YR5X7.js";import{e as yr,f as vr,g as Cr,h as Sr}from"./chunk-SDJNZULP.js";import{A as er,Aa as hr,Ba as mr,C as si,Ca as pr,D,Da as Lt,E as xt,Ea as rn,F as tr,Fa as gr,G as en,H as ir,Ha as Je,I as tn,Ia as br,J as nr,K as or,L as rr,M as sr,O as ar,Q as Xe,R as Mt,S as lr,T as cr,U as fr,V as ai,a as Zi,b as Ae,c as jo,d as Ko,da as C,e as Yo,g as Qo,h as Xo,i as k,j as Oe,ja as li,k as Ke,l as Jo,la as dr,m as Le,ma as c,n as St,na as ci,o as X,oa as fi,p as dt,pa as kt,q as te,qa as nn,r as Ye,ra as on,s as Qe,v as oi,w as ri,wa as ur,x as T,y as Zo,z as H}from"./chunk-2YQ4SX3A.js";import{a as Bt,b as Hi,i as B}from"./chunk-KAVP6UXH.js";var w=(function(e){return e.MAKE="make",e.COPY="copy",e.MOVE="move",e.DELETE="delete",e.COMPRESS="compress",e.DECOMPRESS="decompress",e.DOWNLOAD="download",e.UPLOAD="upload",e.TOUCH="touch",e.THUMBNAIL="thumbnail",e.GET_SIZE="getSize",e.LOCK="lock",e.UNLOCK="unlock",e.UNLOCK_REQUEST="unlockRequest",e})(w||{}),we=(function(e){return e.VIEW="view",e.EDIT="edit",e})(we||{}),xr="forceAsFileOwner";var oe={BASE:Jt.BASE,OPERATION:"operation",TASK_OPERATION:"task/operation",TASKS:"tasks",TASKS_DOWNLOAD:"download",RECENTS:"recents",SEARCH:"search"},ut=`${oe.BASE}/${oe.OPERATION}`,r2=`${ut}/${w.THUMBNAIL}`,sn=`${ut}/${w.MAKE}`,an=`${ut}/${w.UPLOAD}`,ln=`${oe.BASE}/${oe.TASK_OPERATION}`,Mr=`${ln}/${w.DOWNLOAD}`,kr=`${ln}/${w.COMPRESS}`,Lr=`${ln}/${w.DECOMPRESS}`,wt=`${oe.BASE}/${oe.TASKS}`,wr=`${oe.BASE}/${oe.TASKS}/${oe.TASKS_DOWNLOAD}`,Er=`${oe.BASE}/${oe.RECENTS}`,zr=`${oe.BASE}/${oe.SEARCH}`;var _r="Collabora";var Pr=new Set(["doc","docx","docm","dot","dotx","dotm","odt","ott","rtf","fodt","sxw","stw","xls","xlsx","xlsm","xlt","xltx","ods","ots","csv","fods","sxc","sdc","ppt","pptx","pptm","pps","ppsx","odp","otp","fodp","sxi","sdd","odg"]);var Ar="OnlyOffice";var Tr=new Map([["doc","word"],["docm","word"],["docx","word"],["dot","word"],["dotm","word"],["dotx","word"],["epub","word"],["fb2","word"],["fodt","word"],["gdoc","word"],["hwp","word"],["hwpx","word"],["mht","word"],["mhtml","word"],["odt","word"],["ott","word"],["pages","word"],["rtf","word"],["stw","word"],["sxw","word"],["wps","word"],["wpt","word"],["csv","cell"],["et","cell"],["ett","cell"],["fods","cell"],["gsheet","cell"],["numbers","cell"],["ods","cell"],["ots","cell"],["sxc","cell"],["xls","cell"],["xlsb","cell"],["xlsm","cell"],["xlsx","cell"],["xlt","cell"],["xltm","cell"],["xltx","cell"],["dps","slide"],["dpt","slide"],["fodp","slide"],["gslide","slide"],["key","slide"],["odg","slide"],["odp","slide"],["otp","slide"],["pot","slide"],["potm","slide"],["potx","slide"],["pps","slide"],["ppsm","slide"],["ppsx","slide"],["ppt","slide"],["pptm","slide"],["pptx","slide"],["sxi","slide"],["djvu","pdf"],["docxf","pdf"],["oform","pdf"],["oxps","pdf"],["pdf","pdf"],["xps","pdf"],["vsdm","diagram"],["vsdx","diagram"],["vssm","diagram"],["vssx","diagram"],["vstm","diagram"],["vstx","diagram"]]);var Dr=(()=>{let i=class i{constructor(){this.inPersonalSpace=!1,this.http=v(ee),this.layout=v($),this.breadCrumbFilesRepo=!1,this.inShareRepo=!1,this.inRootSpace=!1}setEnvironment(t,n){this.breadCrumbFilesRepo=Re.FILES===t,this.inPersonalSpace=n.length&&n[0].path===Re.PERSONAL,this.inShareRepo=t===Re.SHARES,this.inRootSpace=this.inShareRepo?n.length===0:n.length===1,this.browseApi=No(`${Uo}/${t}`,n,!1),this.breadCrumbUrl=`/${Re.SPACES}/${t}${Vo(n)}`,this.breadCrumbIcon=this.inShareRepo?ne.SHARED_WITH_ME:this.breadCrumbFilesRepo?this.inPersonalSpace&&this.breadCrumbFilesRepo?ne.PERSONAL:ne.SPACES:ne.TRASH}loadFiles(){return this.http.get(this.browseApi).pipe(tt(()=>{this.layout.setBreadcrumbIcon(this.breadCrumbIcon),this.layout.setBreadcrumbNav(this.breadcrumbNav())}),Kn(t=>Wn(()=>t)))}breadcrumbNav(){return{url:this.inPersonalSpace&&this.inRootSpace?`${this.breadCrumbUrl}/${Zt.SHORT_PERSONAL_FILES}`:this.inShareRepo&&this.inRootSpace?`${this.breadCrumbUrl}/${Zt.SHARED_WITH_ME}`:this.breadCrumbUrl,translating:this.inRootSpace&&(this.inPersonalSpace||this.inShareRepo),sameLink:this.inRootSpace&&(this.inPersonalSpace||this.inShareRepo),firstLink:this.inPersonalSpace&&this.breadCrumbFilesRepo?null:this.breadCrumbFilesRepo?Re.SPACES:this.inShareRepo?Re.SPACES_SHARES:Re.TRASH,mutateLevel:this.inPersonalSpace&&!this.breadCrumbFilesRepo&&!this.inRootSpace?{0:{setTitle:Zt.PERSONAL_FILES,translateTitle:!0}}:null,splicing:this.inPersonalSpace?!this.breadCrumbFilesRepo&&!this.inRootSpace?2:3:2}}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();function Te(e){let i=`${e.info?`${e.info}`:""}${e.app?` ${e.app}`:""}`;return`${e.owner.fullName} (${e.owner.email})${i?` - ${i}`:""}`}var Fr=(()=>{let i=class i{transform(t){return t?Te(t):"unknown"}};i.\u0275fac=function(n){return new(n||i)},i.\u0275pipe=Ui({name:"fileLockFormatPipe",type:i,pure:!0});let e=i;return e})();function C1(e,i){e&1&&(h(0,"span",6),L(1,"The file is locked by"),m())}function S1(e,i){e&1&&(h(0,"span",6),L(1,"The file is edited by"),m())}function x1(e,i){e&1&&(h(0,"div",8)(1,"small",11),L(2,"As the file owner, you can unlock the file or request the current lock owner to release it."),m()())}function M1(e,i){if(e&1){let r=W();h(0,"button",14),x("click",function(){E(r);let n=M(2);return z(n.onUnlock())}),L(1,"Unlock"),m()}if(e&2){let r=M(2);y("disabled",r.submitted)}}function k1(e,i){if(e&1){let r=W();h(0,"button",15),x("click",function(){E(r);let n=M(2);return z(n.onSendUnLockRequest())}),L(1,"Send an unlock request"),m()}if(e&2){let r=M(2);y("disabled",r.submitted)}}function L1(e,i){if(e&1&&(R(0,M1,2,1,"button",12),R(1,k1,2,1,"button",13)),e&2){let r=M();O(r.isLockOwner||r.isFileOwner?0:-1),p(),O(r.isLockOwner?-1:1)}}var Ir=(()=>{let i=class i{constructor(){this.locale=v(Me),this.layout=v($),this.icons={faLock:Qt,faUnlock:bo},this.submitted=!1,this.store=v(fe),this.userLogin=this.store.user.getValue().login,this.isFileOwner=!1,this.isLockOwner=!1,this.hasExclusiveLock=!0,this.spacesBrowserService=v(Dr),this.filesService=v(ht)}ngOnInit(){this.hasExclusiveLock=this.file.lock.isExclusive,this.isFileOwner=this.spacesBrowserService.inPersonalSpace||this.file.root?.owner?.login===this.userLogin,this.isLockOwner=this.file.lock.owner.login===this.userLogin,this.userAvatarUrl=Ho(this.file.lock.owner.login)}onEnter(){return B(this,null,function*(){this.isLockOwner||this.isFileOwner?yield this.onUnlock():this.onSendUnLockRequest()})}onEsc(){this.layout.closeDialog()}onUnlock(){return B(this,null,function*(){try{this.submitted=!0,yield Ge(this.filesService.unlock(this.file,this.isFileOwner)),this.file.removeLock(),this.layout.closeDialog()}catch(t){this.submitted=!1,this.layout.sendNotification("warning",this.file.name,t.error.message)}})}onSendUnLockRequest(){this.submitted=!0,this.filesService.unlockRequest(this.file).subscribe({next:()=>this.layout.closeDialog(),error:t=>{this.submitted=!1,this.layout.sendNotification("warning",this.file.name,t.error.message)}})}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-lock-dialog"]],hostBindings:function(n,o){n&1&&x("keyup.enter",function(){return o.onEnter()},it)("keyup.escape",function(){return o.onEsc()},it)},inputs:{file:"file"},decls:19,vars:10,consts:[[1,"modal-header"],[1,"modal-title"],[1,"me-1",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"d-flex","flex-column","align-items-center","avatar","my-2"],["l10nTranslate","",1,"mb-2"],["alt","",1,"avatar-img","mb-2",3,"src"],[1,"text-align-center","mt-3","mb-1"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["l10nTranslate",""],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click","disabled"]],template:function(n,o){n&1&&(h(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),h(3,"span"),L(4),m()(),h(5,"button",3),x("click",function(){return o.layout.closeDialog()}),m()(),h(6,"div",4)(7,"div",5),R(8,C1,2,0,"span",6)(9,S1,2,0,"span",6),_(10,"img",7),h(11,"b"),L(12),V(13,"fileLockFormatPipe"),m()(),R(14,x1,3,0,"div",8),m(),h(15,"div",9)(16,"button",10),x("click",function(){return o.layout.closeDialog()}),L(17),m(),R(18,L1,2,2),m()),n&2&&(p(2),y("icon",o.hasExclusiveLock?o.icons.faLock:o.icons.faUnlock),p(2),Q(o.file.name),p(4),O(o.hasExclusiveLock?8:9),p(2),y("src",o.userAvatarUrl,De),p(2),Q(so(13,8,o.file.lock)),p(2),O(o.hasExclusiveLock&&!o.isLockOwner&&o.isFileOwner?14:-1),p(3),Yi(" ",o.hasExclusiveLock?"Cancel":"Close"," "),p(),O(o.hasExclusiveLock?18:-1))},dependencies:[ce,ke,Fr],encapsulation:2});let e=i;return e})();var w1=(e,i)=>({old:e,new:i});function E1(e,i){e&1&&(h(0,"span",3),L(1,"Replace Existing File"),m())}function z1(e,i){e&1&&(h(0,"span",3),L(1,"Overwrite Existing File(s)"),m())}function _1(e,i){if(e&1&&(_(0,"div",6),V(1,"translate")),e&2){let r=M();y("innerHTML",ao(1,1,"RenameFileToExisting",r.locale.language,ro(5,w1,r.files[0].name,r.renamedTo)),Xn)}}function P1(e,i){if(e&1){let r=W();h(0,"div",11)(1,"img",12),x("error",function(){let n=E(r).$implicit;return z(n.fallBackMimeUrl())}),m(),h(2,"div",13)(3,"span"),L(4),m()()()}if(e&2){let r=i.$implicit;p(),y("src",r.mimeUrl,De),p(3),Q(r.name)}}function A1(e,i){if(e&1&&(h(0,"div",10),L(1,"Do you want to replace the existing file(s)?"),m(),Gi(2,P1,5,2,"div",11,Zn)),e&2){let r=M();p(2),Wi(r.files)}}var Rr=(()=>{let i=class i{constructor(){this.files=[],this.overwrite=lo(),this.locale=v(Me),this.layout=v($),this.icons={faFileShield:Lo},this.submitted=!1}onAction(t){this.submitted=t,this.overwrite.emit(t),this.layout.closeDialog()}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-overwrite-dialog"]],inputs:{files:"files",renamedTo:"renamedTo"},outputs:{overwrite:"overwrite"},decls:14,vars:4,consts:[[1,"modal-header"],["l10nTranslate","",1,"modal-title"],[1,"me-1",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[3,"innerHTML"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],["l10nTranslate","",1,"fw-bold","mb-3"],["draggable","true",1,"d-flex","align-items-center","mb-1"],["alt","","height","24","width","24",3,"error","src"],[1,"d-flex","flex-column","text-truncate","ms-1"]],template:function(n,o){n&1&&(h(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),R(3,E1,2,0,"span",3)(4,z1,2,0,"span",3),m(),h(5,"button",4),x("click",function(){return o.layout.closeDialog()}),m()(),h(6,"div",5),R(7,_1,2,8,"div",6)(8,A1,4,0),m(),h(9,"div",7)(10,"button",8),x("click",function(){return o.onAction(!1)}),L(11,"Cancel"),m(),h(12,"button",9),x("click",function(){return o.onAction(!0)}),L(13,"Confirm"),m()()),n&2&&(p(2),y("icon",o.icons.faFileShield),p(),O(o.renamedTo?3:4),p(4),O(o.renamedTo?7:8),p(5),y("disabled",o.submitted))},dependencies:[ce,ke,ct],encapsulation:2});let e=i;return e})();var di={BASE:"/wopi",FILES:"files",CONTENTS:"contents",SETTINGS:"settings"},Or=`${di.BASE}/${di.SETTINGS}`,W2=`${di.BASE}/${di.FILES}`;function T1(e,i){if(e&1&&(eo(0,"div"),nt(1,"iframe",1),to()),e&2){let r=M();K("height",r.currentHeight(),"px"),p(),ot("src",r.documentServerUrl,Ht)}}var Nr=(()=>{let i=class i{constructor(){this.file=j.required(),this.isReadonly=ge.required(),this.currentHeight=j(),this.documentServerUrl=null,this.http=v(ee),this.layout=v($),this.store=v(fe),this.sanitizer=v(rt)}ngOnInit(){this.http.get(`${Or}/${this.file().path}`).subscribe({next:t=>{if(!t){this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document","Settings are missing");return}t.hasLock&&(this.file().lock?this.file().lock.isExclusive||this.layout.sendNotification("info","The file is locked",Te(t.hasLock)):this.file().createLock(t.hasLock)),this.isReadonly.set(t.mode===we.VIEW),!this.isReadonly()&&!this.file().lock&&this.file().createLock({owner:{login:this.store.user.getValue().login,fullName:this.store.user.getValue().fullName,email:this.store.user.getValue().email},app:_r,isExclusive:!1}),this.documentServerUrl=this.sanitizer.bypassSecurityTrustResourceUrl(`${t.documentServerUrl}&lang=${this.layout.getCurrentLanguage()}`)},error:t=>{this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document",t.error.message)}})}ngOnDestroy(){!this.isReadonly()&&this.file().lock&&this.file().lock.owner.login===this.store.user.getValue().login&&this.file().removeLock()}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-viewer-collabora-online"]],inputs:{file:[1,"file"],isReadonly:[1,"isReadonly"],currentHeight:[1,"currentHeight"]},outputs:{isReadonly:"isReadonlyChange"},decls:1,vars:1,consts:[[3,"height"],["allow","clipboard-read *; clipboard-write *; fullscreen",1,"app-viewer-iframe","collabora-scaling",3,"src"]],template:function(n,o){n&1&&R(0,T1,2,3,"div",0),n&2&&O(o.documentServerUrl?0:-1)},styles:[".collabora-scaling[_ngcontent-%COMP%]{transform:scale(.9);transform-origin:0 0;width:111.1111111111%;height:111.1111111111%}"]});let e=i;return e})();var F1=["image"];function I1(e,i){if(e&1){let r=W();h(0,"button",5),V(1,"translate"),x("click",function(){E(r);let n=M();return z(n.startSlideshow())}),_(2,"fa-icon",4),m()}if(e&2){let r=M();y("tooltip",Y(1,2,"Start Slideshow",r.locale.language)),p(2),y("icon",r.icons.faPlay)}}function R1(e,i){if(e&1){let r=W();h(0,"button",5),V(1,"translate"),x("click",function(){E(r);let n=M();return z(n.stopSlideshow())}),_(2,"fa-icon",4),m()}if(e&2){let r=M();y("tooltip",Y(1,2,"Stop slideshow",r.locale.language)),p(2),y("icon",r.icons.faStop)}}var Br=(()=>{let i=class i{constructor(){this.file=ge.required(),this.directoryImages=j.required(),this.currentHeight=j.required(),this.currentHeightWithOffset=Fe(()=>this.currentHeight()-40),this.isInfoboxOpen=ie(!1),this.isSlideshowActive=ie(!1),this.imageCount=Fe(()=>this.directoryImages().length),this.imageIndex=Fe(()=>this.directoryImages().indexOf(this.file())),this.imageResolution=ie(""),this.icons={faAngleLeft:xo,faAngleRight:ko,faExpand:Co,faInfo:zo,faPlay:wo,faStop:So},this.locale=v(Me),this.slideDelay=5e3,this.destroyRef=v(Qn),this.imageRef=qt.required("image")}onImageLoad(){let t=this.imageRef().nativeElement;this.imageResolution.set(`${t.naturalWidth}x${t.naturalHeight}`)}nextImage(){this.file.set(this.directoryImages()[(this.imageIndex()+1)%this.imageCount()])}previousImage(){this.file.set(this.directoryImages()[(this.imageCount()+this.imageIndex()-1)%this.imageCount()])}fullscreen(){this.imageRef().nativeElement.requestFullscreen()}startSlideshow(){this.isSlideshowActive.set(!0),this.slideshowSub=We(this.slideDelay,this.slideDelay).pipe(ho(this.destroyRef)).subscribe(()=>this.nextImage())}stopSlideshow(){this.slideshowSub?.unsubscribe(),this.isSlideshowActive.set(!1)}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-viewer-image"]],viewQuery:function(n,o){n&1&&Ut(o.imageRef,F1,5),n&2&&Gt()},inputs:{file:[1,"file"],directoryImages:[1,"directoryImages"],currentHeight:[1,"currentHeight"]},outputs:{file:"fileChange"},decls:40,vars:47,consts:[["image",""],[1,"app-top-menu","d-flex","justify-content-between"],[1,"d-flex"],["container","body","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"click","tooltip","adaptivePosition"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"click","tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"tooltip"],["btnCheckbox","","container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel","tooltip"],[1,"app-viewer-image"],["alt","",3,"load","src"],[1,"info-box","p-2","m-2","d-flex","flex-column","app-small-card","rounded","opacity-75"],[1,"d-flex","mb-1"],[1,"d-flex","col-sm","fw-bold"]],template:function(n,o){if(n&1){let s=W();h(0,"div",1)(1,"div",2)(2,"button",3),V(3,"translate"),x("click",function(){return E(s),z(o.previousImage())}),_(4,"fa-icon",4),m(),h(5,"button",5),V(6,"translate"),x("click",function(){return E(s),z(o.nextImage())}),_(7,"fa-icon",4),m(),R(8,I1,3,5,"button",6)(9,R1,3,5,"button",6),h(10,"button",5),V(11,"translate"),x("click",function(){return E(s),z(o.fullscreen())}),_(12,"fa-icon",4),m()(),h(13,"div"),L(14),m(),h(15,"button",7),V(16,"translate"),pe("ngModelChange",function(l){return E(s),me(o.isInfoboxOpen,l)||(o.isInfoboxOpen=l),z(l)}),_(17,"fa-icon",4),m()(),h(18,"div",8)(19,"img",9,0),x("load",function(){return E(s),z(o.onImageLoad())}),m(),h(21,"div",10)(22,"div",11)(23,"div",12),L(24),V(25,"translate"),m(),h(26,"div"),L(27),m()(),h(28,"div",11)(29,"div",12),L(30),V(31,"translate"),m(),h(32,"div"),L(33),m()(),h(34,"div",11)(35,"div",12),L(36),V(37,"translate"),m(),h(38,"div"),L(39),m()()()()}n&2&&(p(2),y("tooltip",Y(3,26,"Previous",o.locale.language))("adaptivePosition",!0),p(2),y("icon",o.icons.faAngleLeft),p(),y("tooltip",Y(6,29,"Next",o.locale.language)),p(2),y("icon",o.icons.faAngleRight),p(),O(o.isSlideshowActive()?9:8),p(2),y("tooltip",Y(11,32,"Fullscreen",o.locale.language)),p(2),y("icon",o.icons.faExpand),p(2),oo("",o.imageIndex()+1," of ",o.imageCount()),p(),he("ngModel",o.isInfoboxOpen),y("tooltip",Y(16,35,"Info",o.locale.language)),p(2),y("icon",o.icons.faInfo),p(),K("height",o.currentHeightWithOffset(),"px"),p(),K("max-height",o.currentHeightWithOffset(),"px"),y("src",o.file().dataUrl,De),p(2),qe("d-none",!o.isInfoboxOpen()),p(3),Q(Y(25,38,"Type",o.locale.language)),p(3),Q(o.file().mime),p(3),Q(Y(31,41,"Dimensions",o.locale.language)),p(3),Q(o.imageResolution()),p(3),Q(Y(37,44,"Size",o.locale.language)),p(3),Q(o.file().hSize))},dependencies:[lt,st,at,Yt,Kt,ce,ti,ct],encapsulation:2,changeDetection:0});let e=i;return e})();var O1=["*"],re=(()=>{let i=class i{};i.VG_ENDED="ended",i.VG_PAUSED="paused",i.VG_PLAYING="playing",i.VG_LOADING="waiting",i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),zt=(()=>{let i=class i{constructor(){this.medias={},this.playerReadyEvent=new le(!0),this.isPlayerReady=!1}onPlayerReady(t){this.fsAPI=t,this.isPlayerReady=!0,this.playerReadyEvent.emit(this)}getDefaultMedia(){for(let t in this.medias)if(this.medias[t])return this.medias[t]}getMasterMedia(){let t;for(let n in this.medias)if(this.medias[n].vgMaster==="true"||this.medias[n].vgMaster===!0){t=this.medias[n];break}return t||this.getDefaultMedia()}isMasterDefined(){let t=!1;for(let n in this.medias)if(this.medias[n].vgMaster==="true"||this.medias[n].vgMaster===!0){t=!0;break}return t}getMediaById(t=null){let n=this.medias[t];return(!t||t==="*")&&(n=this),n}play(){for(let t in this.medias)this.medias[t]&&this.medias[t].play()}pause(){for(let t in this.medias)this.medias[t]&&this.medias[t].pause()}get duration(){return this.$$getAllProperties("duration")}set currentTime(t){this.$$setAllProperties("currentTime",t)}get currentTime(){return this.$$getAllProperties("currentTime")}set state(t){this.$$setAllProperties("state",t)}get state(){return this.$$getAllProperties("state")}set volume(t){this.$$setAllProperties("volume",t)}get volume(){return this.$$getAllProperties("volume")}set playbackRate(t){this.$$setAllProperties("playbackRate",t)}get playbackRate(){return this.$$getAllProperties("playbackRate")}get canPlay(){return this.$$getAllProperties("canPlay")}get canPlayThrough(){return this.$$getAllProperties("canPlayThrough")}get isMetadataLoaded(){return this.$$getAllProperties("isMetadataLoaded")}get isWaiting(){return this.$$getAllProperties("isWaiting")}get isCompleted(){return this.$$getAllProperties("isCompleted")}get isLive(){return this.$$getAllProperties("isLive")}get isMaster(){return this.$$getAllProperties("isMaster")}get time(){return this.$$getAllProperties("time")}get buffer(){return this.$$getAllProperties("buffer")}get buffered(){return this.$$getAllProperties("buffered")}get subscriptions(){return this.$$getAllProperties("subscriptions")}get textTracks(){return this.$$getAllProperties("textTracks")}seekTime(t,n=!1){for(let o in this.medias)this.medias[o]&&this.$$seek(this.medias[o],t,n)}$$seek(t,n,o=!1){let s,a=t.duration;o?(this.isMasterDefined()&&(a=this.getMasterMedia().duration),s=n*a/100):s=n,t.currentTime=s}addTextTrack(t,n,o){for(let s in this.medias)this.medias[s]&&this.$$addTextTrack(this.medias[s],t,n,o)}$$addTextTrack(t,n,o,s){t.addTextTrack(n,o,s)}$$getAllProperties(t){let n={},o;for(let a in this.medias)this.medias[a]&&(n[a]=this.medias[a]);switch(Object.keys(n).length){case 0:switch(t){case"state":o=re.VG_PAUSED;break;case"playbackRate":case"volume":o=1;break;case"time":o={current:0,total:0,left:0};break}break;case 1:let a=Object.keys(n)[0];o=n[a][t];break;default:let l=this.getMasterMedia();o=n[l.id][t]}return o}$$setAllProperties(t,n){for(let o in this.medias)this.medias[o]&&(this.medias[o][t]=n)}registerElement(t){this.videogularElement=t}registerMedia(t){this.medias[t.id]=t}unregisterMedia(t){delete this.medias[t.id]}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),cn=(()=>{let i=class i{constructor(){this.isHiddenSubject=new vt,this.isHidden=this.isHiddenSubject.asObservable()}state(t){this.isHiddenSubject.next(t)}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),Et=(()=>{let i=class i{static getZIndex(){let t=1,n,o=document.getElementsByTagName("*");for(let s=0,a=o.length;s<a;s++)n=parseInt(window.getComputedStyle(o[s])["z-index"],10),n>t&&(t=n+1);return t}static isMobileDevice(){return typeof window.orientation<"u"||navigator.userAgent.indexOf("IEMobile")!==-1}static isiOSDevice(){return(navigator.userAgent.match(/ip(hone|ad|od)/i)||i.isIpadOS())&&!navigator.userAgent.match(/(iemobile)[\/\s]?([\w\.]*)/i)}static isIpadOS(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)}static isCordova(){return document.URL.indexOf("http://")===-1&&document.URL.indexOf("https://")===-1}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),fn=(()=>{let i=class i{constructor(){this.nativeFullscreen=!0,this.isFullscreen=!1,this.onChangeFullscreen=new le}init(t,n){this.videogularElement=t,this.medias=n;let o={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",onchange:"fullscreenchange",onerror:"fullscreenerror"},newWebkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",onchange:"webkitfullscreenchange",onerror:"webkitfullscreenerror"},oldWebkit:{enabled:"webkitIsFullScreen",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullScreen",exit:"webkitCancelFullScreen",onchange:"webkitfullscreenchange",onerror:"webkitfullscreenerror"},moz:{enabled:"mozFullScreen",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",onchange:"mozfullscreenchange",onerror:"mozfullscreenerror"},ios:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitEnterFullscreen",exit:"webkitExitFullscreen",onchange:"webkitendfullscreen",onerror:"webkitfullscreenerror"},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",onchange:"MSFullscreenChange",onerror:"MSFullscreenError"}};for(let a in o)if(o[a].enabled in document){this.polyfill=o[a];break}if(Et.isiOSDevice()&&(this.polyfill=o.ios),this.isAvailable=this.polyfill!=null,this.polyfill==null)return;let s;switch(this.polyfill.onchange){case"mozfullscreenchange":s=document;break;case"webkitendfullscreen":s=this.medias.toArray()[0].elem;break;default:s=t}this.fsChangeSubscription=F(s,this.polyfill.onchange).subscribe(()=>{this.onFullscreenChange()})}onFullscreenChange(){this.isFullscreen=!!document[this.polyfill.element],this.onChangeFullscreen.emit(this.isFullscreen)}toggleFullscreen(t=null){return this.isFullscreen?this.exit():this.request(t)}request(t){return t||(t=this.videogularElement),this.isFullscreen=!0,this.onChangeFullscreen.emit(!0),this.isAvailable&&this.nativeFullscreen?Et.isMobileDevice()?((!this.polyfill.enabled&&t===this.videogularElement||Et.isiOSDevice())&&(t=this.medias.toArray()[0].elem),this.enterElementInFullScreen(t)):this.enterElementInFullScreen(this.videogularElement):Promise.resolve()}enterElementInFullScreen(t){return t[this.polyfill.request]()}exit(){return this.isFullscreen=!1,this.onChangeFullscreen.emit(!1),this.isAvailable&&this.nativeFullscreen?document[this.polyfill.exit]():Promise.resolve()}};i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})(),I=(()=>{let i=class i{};i.VG_ABORT="abort",i.VG_CAN_PLAY="canplay",i.VG_CAN_PLAY_THROUGH="canplaythrough",i.VG_DURATION_CHANGE="durationchange",i.VG_EMPTIED="emptied",i.VG_ENCRYPTED="encrypted",i.VG_ENDED="ended",i.VG_ERROR="error",i.VG_LOADED_DATA="loadeddata",i.VG_LOADED_METADATA="loadedmetadata",i.VG_LOAD_START="loadstart",i.VG_PAUSE="pause",i.VG_PLAY="play",i.VG_PLAYING="playing",i.VG_PROGRESS="progress",i.VG_RATE_CHANGE="ratechange",i.VG_SEEK="seek",i.VG_SEEKED="seeked",i.VG_SEEKING="seeking",i.VG_STALLED="stalled",i.VG_SUSPEND="suspend",i.VG_TIME_UPDATE="timeupdate",i.VG_VOLUME_CHANGE="volumechange",i.VG_WAITING="waiting",i.VG_LOAD="load",i.VG_ENTER="enter",i.VG_EXIT="exit",i.VG_START_ADS="startads",i.VG_END_ADS="endads",i.\u0275fac=function(n){return new(n||i)},i.\u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var dn=(()=>{let i=class i{constructor(t,n){this.api=t,this.ref=n,this.state=re.VG_PAUSED,this.time={current:0,total:0,left:0},this.buffer={end:0},this.canPlay=!1,this.canPlayThrough=!1,this.isMetadataLoaded=!1,this.isWaiting=!1,this.isCompleted=!1,this.isLive=!1,this.isBufferDetected=!1,this.checkInterval=200,this.currentPlayPos=0,this.lastPlayPos=0,this.playAtferSync=!1,this.bufferDetected=new vt}ngOnInit(){this.vgMedia.nodeName?this.elem=this.vgMedia:this.elem=this.vgMedia.elem,this.api.registerMedia(this),this.subscriptions={abort:F(this.elem,I.VG_ABORT),canPlay:F(this.elem,I.VG_CAN_PLAY),canPlayThrough:F(this.elem,I.VG_CAN_PLAY_THROUGH),durationChange:F(this.elem,I.VG_DURATION_CHANGE),emptied:F(this.elem,I.VG_EMPTIED),encrypted:F(this.elem,I.VG_ENCRYPTED),ended:F(this.elem,I.VG_ENDED),error:F(this.elem,I.VG_ERROR),loadedData:F(this.elem,I.VG_LOADED_DATA),loadedMetadata:F(this.elem,I.VG_LOADED_METADATA),loadStart:F(this.elem,I.VG_LOAD_START),pause:F(this.elem,I.VG_PAUSE),play:F(this.elem,I.VG_PLAY),playing:F(this.elem,I.VG_PLAYING),progress:F(this.elem,I.VG_PROGRESS),rateChange:F(this.elem,I.VG_RATE_CHANGE),seeked:F(this.elem,I.VG_SEEKED),seeking:F(this.elem,I.VG_SEEKING),stalled:F(this.elem,I.VG_STALLED),suspend:F(this.elem,I.VG_SUSPEND),timeUpdate:F(this.elem,I.VG_TIME_UPDATE),volumeChange:F(this.elem,I.VG_VOLUME_CHANGE),waiting:F(this.elem,I.VG_WAITING),startAds:F(window,I.VG_START_ADS),endAds:F(window,I.VG_END_ADS),mutation:new Un(t=>{let n=new MutationObserver(o=>{t.next(o)});return n.observe(this.elem,{childList:!0,attributes:!0}),()=>{n.disconnect()}}),bufferDetected:this.bufferDetected},this.mutationObs=this.subscriptions.mutation.subscribe(this.onMutation.bind(this)),this.canPlayObs=this.subscriptions.canPlay.subscribe(this.onCanPlay.bind(this)),this.canPlayThroughObs=this.subscriptions.canPlayThrough.subscribe(this.onCanPlayThrough.bind(this)),this.loadedMetadataObs=this.subscriptions.loadedMetadata.subscribe(this.onLoadMetadata.bind(this)),this.waitingObs=this.subscriptions.waiting.subscribe(this.onWait.bind(this)),this.progressObs=this.subscriptions.progress.subscribe(this.onProgress.bind(this)),this.endedObs=this.subscriptions.ended.subscribe(this.onComplete.bind(this)),this.playingObs=this.subscriptions.playing.subscribe(this.onStartPlaying.bind(this)),this.playObs=this.subscriptions.play.subscribe(this.onPlay.bind(this)),this.pauseObs=this.subscriptions.pause.subscribe(this.onPause.bind(this)),this.timeUpdateObs=this.subscriptions.timeUpdate.subscribe(this.onTimeUpdate.bind(this)),this.volumeChangeObs=this.subscriptions.volumeChange.subscribe(this.onVolumeChange.bind(this)),this.errorObs=this.subscriptions.error.subscribe(this.onError.bind(this)),this.vgMaster&&this.api.playerReadyEvent.subscribe(()=>{this.prepareSync()})}prepareSync(){let t=[];for(let n in this.api.medias)this.api.medias[n]&&t.push(this.api.medias[n].subscriptions.canPlay);this.canPlayAllSubscription=qn(t).pipe(et((...n)=>{let o=a=>a?.target?a.target.readyState===4:!1;n.some(o)&&!this.syncSubscription&&(this.startSync(),this.syncSubscription.unsubscribe())})).subscribe()}startSync(){this.syncSubscription=We(0,1e3).subscribe(()=>{for(let t in this.api.medias)if(this.api.medias[t]!==this){let n=this.api.medias[t].currentTime-this.currentTime;n<-.3||n>.3?(this.playAtferSync=this.state===re.VG_PLAYING,this.pause(),this.api.medias[t].pause(),this.api.medias[t].currentTime=this.currentTime):this.playAtferSync&&(this.play(),this.api.medias[t].play(),this.playAtferSync=!1)}})}onMutation(t){for(let n=0,o=t.length;n<o;n++){let s=t[n];if(s.type==="attributes"&&s.attributeName==="src"){if(s.target.src&&s.target.src.length>0&&s.target.src.indexOf("blob:")<0){this.loadMedia();break}}else if(s.type==="childList"&&s.removedNodes.length&&s.removedNodes[0].nodeName.toLowerCase()==="source"){this.loadMedia();break}}}loadMedia(){this.vgMedia.pause(),this.vgMedia.currentTime=0,this.stopBufferCheck(),this.isBufferDetected=!0,this.bufferDetected.next(this.isBufferDetected),setTimeout(()=>this.vgMedia.load(),10)}play(){if(!(this.playPromise||this.state!==re.VG_PAUSED&&this.state!==re.VG_ENDED))return this.playPromise=this.vgMedia.play(),this.playPromise&&this.playPromise.then&&this.playPromise.catch&&this.playPromise.then(()=>{this.playPromise=null}).catch(()=>{this.playPromise=null}),this.playPromise}pause(){this.playPromise?this.playPromise.then(()=>{this.vgMedia.pause()}):this.vgMedia.pause()}get id(){let t;return this.vgMedia&&(t=this.vgMedia.id),t}get duration(){return this.vgMedia.duration===1/0?this.specifiedDuration:this.vgMedia.duration}set currentTime(t){this.vgMedia.currentTime=t}get currentTime(){return this.vgMedia.currentTime}set volume(t){this.vgMedia.volume=t}get volume(){return this.vgMedia.volume}set playbackRate(t){this.vgMedia.playbackRate=t}get playbackRate(){return this.vgMedia.playbackRate}get buffered(){return this.vgMedia.buffered}get textTracks(){return this.vgMedia.textTracks}onCanPlay(t){this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected),this.canPlay=!0,this.ref.detectChanges()}onCanPlayThrough(t){this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected),this.canPlayThrough=!0,this.ref.detectChanges()}onLoadMetadata(t){this.isMetadataLoaded=!0,this.time={current:0,left:0,total:this.duration*1e3},this.state=re.VG_PAUSED;let n=Math.round(this.time.total);this.isLive=n===1/0,this.ref.detectChanges()}onWait(t){this.isWaiting=!0,this.ref.detectChanges()}onComplete(t){this.isCompleted=!0,this.state=re.VG_ENDED,this.ref.detectChanges()}onStartPlaying(t){this.state=re.VG_PLAYING,this.ref.detectChanges()}onPlay(t){this.state=re.VG_PLAYING,this.vgMaster&&(!this.syncSubscription||this.syncSubscription.closed)&&this.startSync(),this.startBufferCheck(),this.ref.detectChanges()}onPause(t){this.state=re.VG_PAUSED,this.vgMaster&&(this.playAtferSync||this.syncSubscription.unsubscribe()),this.stopBufferCheck(),this.ref.detectChanges()}onTimeUpdate(t){let n=this.buffered.length-1;this.time={current:this.currentTime*1e3,total:this.time.total,left:(this.duration-this.currentTime)*1e3},n>=0&&(this.buffer={end:this.buffered.end(n)*1e3}),this.ref.detectChanges()}onProgress(t){let n=this.buffered.length-1;n>=0&&(this.buffer={end:this.buffered.end(n)*1e3}),this.ref.detectChanges()}onVolumeChange(t){this.ref.detectChanges()}onError(t){this.ref.detectChanges()}bufferCheck(){let t=1/this.checkInterval;this.currentPlayPos=this.currentTime,!this.isBufferDetected&&this.currentPlayPos<this.lastPlayPos+t&&(this.isBufferDetected=!0),this.isBufferDetected&&this.currentPlayPos>this.lastPlayPos+t&&(this.isBufferDetected=!1),this.bufferDetected.closed||this.bufferDetected.next(this.isBufferDetected),this.lastPlayPos=this.currentPlayPos}startBufferCheck(){this.checkBufferSubscription=We(0,this.checkInterval).subscribe(()=>{this.bufferCheck()})}stopBufferCheck(){this.checkBufferSubscription&&this.checkBufferSubscription.unsubscribe(),this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected)}seekTime(t,n=!1){let o,s=this.duration;n?o=t*s/100:o=t,this.currentTime=o}addTextTrack(t,n,o,s){let a=this.vgMedia.addTextTrack(t,n,o);return s&&(a.mode=s),a}ngOnDestroy(){this.vgMedia.src="",this.mutationObs?.unsubscribe(),this.canPlayObs?.unsubscribe(),this.canPlayThroughObs?.unsubscribe(),this.loadedMetadataObs?.unsubscribe(),this.waitingObs?.unsubscribe(),this.progressObs?.unsubscribe(),this.endedObs?.unsubscribe(),this.playingObs?.unsubscribe(),this.playObs?.unsubscribe(),this.pauseObs?.unsubscribe(),this.timeUpdateObs?.unsubscribe(),this.volumeChangeObs?.unsubscribe(),this.errorObs?.unsubscribe(),this.checkBufferSubscription?.unsubscribe(),this.syncSubscription?.unsubscribe(),this.bufferDetected?.complete(),this.bufferDetected?.unsubscribe(),this.api.unregisterMedia(this)}};i.\u0275fac=function(n){return new(n||i)(xe(zt),xe(Xi))},i.\u0275dir=Jn({type:i,selectors:[["","vgMedia",""]],inputs:{vgMedia:"vgMedia",vgMaster:"vgMaster"},standalone:!1});let e=i;return e})(),Hr=(()=>{let i=class i{constructor(t,n,o,s){this.api=n,this.fsAPI=o,this.controlsHidden=s,this.isFullscreen=!1,this.isNativeFullscreen=!1,this.areControlsHidden=!1,this.onPlayerReady=new le,this.onMediaReady=new le,this.subscriptions=[],this.elem=t.nativeElement,this.api.registerElement(this.elem)}ngAfterContentInit(){this.medias.toArray().forEach(t=>{this.api.registerMedia(t)}),this.fsAPI.init(this.elem,this.medias),this.subscriptions.push(this.fsAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this))),this.subscriptions.push(this.controlsHidden.isHidden.subscribe(this.onHideControls.bind(this))),this.api.onPlayerReady(this.fsAPI),this.onPlayerReady.emit(this.api)}onChangeFullscreen(t){this.fsAPI.nativeFullscreen?this.isNativeFullscreen=t:(this.isFullscreen=t,this.zIndex=t?Et.getZIndex().toString():"auto")}onHideControls(t){this.areControlsHidden=t}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}};i.\u0275fac=function(n){return new(n||i)(xe($e),xe(zt),xe(fn),xe(cn))},i.\u0275cmp=A({type:i,selectors:[["vg-player"]],contentQueries:function(n,o,s){if(n&1&&io(s,dn,5),n&2){let a;ji(a=Ki())&&(o.medias=a)}},hostVars:8,hostBindings:function(n,o){n&2&&(K("z-index",o.zIndex),qe("fullscreen",o.isFullscreen)("native-fullscreen",o.isNativeFullscreen)("controls-hidden",o.areControlsHidden))},outputs:{onPlayerReady:"onPlayerReady",onMediaReady:"onMediaReady"},standalone:!1,features:[Wt([zt,fn,cn])],ngContentSelectors:O1,decls:1,vars:0,template:function(n,o){n&1&&($i(),qi(0))},styles:[`vg-player{font-family:videogular;position:relative;display:flex;width:100%;height:100%;overflow:hidden;background-color:#000}vg-player.fullscreen{position:fixed;left:0;top:0}vg-player.native-fullscreen.controls-hidden{cursor:none}
`],encapsulation:2});let e=i;return e})(),N1=[zt,cn,fn,Et,I,re];var Ne=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ze({providers:[...N1],imports:[Ie]});let e=i;return e})();var Ur=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ze({imports:[Ie,Ne]});let e=i;return e})();var Gr=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ze({imports:[Ie,Ne]});let e=i;return e})();var Wr=(()=>{let i=class i{};i.\u0275fac=function(n){return new(n||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ze({imports:[Ie,Ne]});let e=i;return e})();var $r=(()=>{let i=class i{constructor(){this.fileUrl=j(),this.currentHeight=j()}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-viewer-media"]],inputs:{fileUrl:[1,"fileUrl"],currentHeight:[1,"currentHeight"]},decls:4,vars:4,consts:[["media",""],["preload","none","autoplay","","controls","",3,"vgMedia"],["type","video/webm",3,"src"]],template:function(n,o){if(n&1&&(h(0,"vg-player")(1,"video",1,0),_(3,"source",2),m()()),n&2){let s=no(2);K("height",o.currentHeight(),"px"),p(),y("vgMedia",s),p(2),y("src",o.fileUrl(),De)}},dependencies:[Ne,dn,Hr,Gr,Wr,Ur],encapsulation:2,changeDetection:0});let e=i;return e})();var _t={BASE:Jt.BASE,ONLY_OFFICE:"onlyoffice",SETTINGS:"settings",DOCUMENT:"document",CALLBACK:"callback"},un=`${_t.BASE}/${_t.ONLY_OFFICE}`,qr=`${un}/${_t.SETTINGS}`,Q0=`${un}/${_t.DOCUMENT}`,X0=`${un}/${_t.CALLBACK}`;var B1=(e,i)=>B(null,null,function*(){return new Promise((r,t)=>{try{if(window.DocsAPI)return r(null);let n=document.getElementById(i);if(n){let o=setInterval(()=>{if(!n.getAttribute("loading")){if(clearInterval(o),window.DocsAPI)return r(null);let a=jr(i,e,r,t);n.remove(),document.body.appendChild(a)}},500)}else{let o=jr(i,e,r,t);document.body.appendChild(o)}}catch(n){console.error(n)}})}),jr=(e,i,r,t)=>{let n=document.createElement("script");return n.id=e,n.type="text/javascript",n.src=i,n.async=!0,n.onload=()=>{n.removeAttribute("loading"),r(null)},n.onerror=o=>{n.removeAttribute("loading"),t(o)},n.setAttribute("loading",""),n},Kr=B1;var Yr=(()=>{let i=class i{constructor(){this.loadError=new le,this.wasSaved=new le,this.isFirstOnChanges=!0,this.onLoad=()=>{try{if(window.DocsAPI||this.onError(-3),window?.DocEditor?.instances[this.id]){console.log("Skip loading, instance already exists",this.id);return}window?.DocEditor?.instances||(window.DocEditor={instances:{}});let t=JSON.parse(JSON.stringify(this.config));t.events={onDocumentStateChange:n=>n.data?this.wasSaved.emit():null},window.DocEditor.instances[this.id]=window.DocsAPI.DocEditor(this.id,t)}catch(t){console.error(t),this.onError(-1)}}}ngOnInit(){let t=this.documentServerUrl;t.endsWith("/")||(t+="/");let n=`${t}web-apps/apps/api/documents/api.js`;Kr(n,"onlyoffice-api-script").then(()=>this.onLoad()).catch(()=>{this.onError(-2)})}ngOnChanges(t){if(this.isFirstOnChanges){this.isFirstOnChanges=!1;return}if("config"in t&&window?.DocEditor?.instances[this.id]){window.DocEditor.instances[this.id].destroyEditor(),window.DocEditor.instances[this.id]=void 0,console.warn("Important props have been changed, reloading ..."),this.onLoad();return}}ngOnDestroy(){window?.DocEditor?.instances[this.id]&&(window.DocEditor.instances[this.id].destroyEditor(),window.DocEditor.instances[this.id]=void 0,delete window.DocEditor.instances[this.id])}onError(t){let n={title:"Unknown OnlyOffice error",message:`Code: ${t}`};switch(t){case-2:n.title="Unable to load OnlyOffice editor",n.message="The document server may be unreachable or the configuration is invalid";break;case-3:n.title="OnlyOffice editor failed to initialize",n.message="DocsAPI not available";break}this.loadError.emit(n)}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-onlyoffice-document"]],inputs:{id:"id",documentServerUrl:"documentServerUrl",config:"config"},outputs:{loadError:"loadError",wasSaved:"wasSaved"},features:[Ct],decls:1,vars:1,consts:[[3,"id"]],template:function(n,o){n&1&&nt(0,"div",0),n&2&&ot("id",o.id)},encapsulation:2});let e=i;return e})();function H1(e,i){if(e&1){let r=W();h(0,"div")(1,"app-files-onlyoffice-document",1),x("loadError",function(n){E(r);let o=M();return z(o.loadError(n))})("wasSaved",function(){E(r);let n=M();return z(n.onSave())}),m()()}if(e&2){let r=M();K("height",r.currentHeight(),"px"),p(),y("id",r.docId)("documentServerUrl",r.documentConfig.documentServerUrl)("config",r.documentConfig.config)}}var Qr=(()=>{let i=class i{constructor(){this.file=j.required(),this.isReadonly=ge.required(),this.currentHeight=j.required(),this.documentConfig=null,this.http=v(ee),this.layout=v($),this.store=v(fe)}ngOnInit(){this.docId=`viewer-doc-${this.file().id}`,this.http.get(`${qr}/${this.file().path}`).subscribe({next:t=>{if(!t){this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document","Settings are missing");return}t.hasLock&&(this.file().lock?this.file().lock.isExclusive||this.layout.sendNotification("info","The file is locked",Te(t.hasLock)):this.file().createLock(t.hasLock)),this.isReadonly.set(t.config.editorConfig.mode===we.VIEW),!this.isReadonly()&&!this.file().lock&&this.file().createLock({owner:{login:this.store.user.getValue().login,fullName:this.store.user.getValue().fullName,email:this.store.user.getValue().email},app:Ar,isExclusive:!1}),t.config.editorConfig.lang=this.layout.getCurrentLanguage(),t.config.editorConfig.region=t.config.editorConfig.lang,this.documentConfig=t},error:t=>{this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document",t.status===404?"Unable to load OnlyOffice editor":t.error.message)}})}loadError(t){this.layout.closeDialog(),this.layout.sendNotification("error",t.title,t.message)}onSave(){this.file().updateHTimeAgo()}ngOnDestroy(){!this.isReadonly()&&this.file().lock&&this.file().lock.owner.login===this.store.user.getValue().login&&this.file().removeLock()}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-viewer-only-office"]],inputs:{file:[1,"file"],isReadonly:[1,"isReadonly"],currentHeight:[1,"currentHeight"]},outputs:{isReadonly:"isReadonlyChange"},decls:1,vars:1,consts:[[3,"height"],[3,"loadError","wasSaved","id","documentServerUrl","config"]],template:function(n,o){n&1&&R(0,H1,2,5,"div",0),n&2&&O(o.documentConfig?0:-1)},dependencies:[Yr],styles:[".doc-placeholder[_ngcontent-%COMP%]{display:none!important}"]});let e=i;return e})();var Xr=(()=>{let i=class i{constructor(){this.fileUrl=j(),this.currentHeight=j(),this.sanitizer=v(rt),this.pdfjsUrl=`${$o}/pdfjs/web/viewer.html?file=`,this.url=Fe(()=>this.fileUrl()?this.sanitizer.bypassSecurityTrustResourceUrl(`${this.pdfjsUrl}${encodeURIComponent(this.fileUrl())}`):null)}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=A({type:i,selectors:[["app-files-viewer-pdf"]],inputs:{fileUrl:[1,"fileUrl"],currentHeight:[1,"currentHeight"]},decls:1,vars:3,consts:[[1,"app-viewer-iframe",3,"src"]],template:function(n,o){n&1&&nt(0,"iframe",0),n&2&&(K("height",o.currentHeight(),"px"),ot("src",o.url(),Ht))},encapsulation:2,changeDetection:0});let e=i;return e})();var U1=e=>{let{state:i}=e,r=i.doc.lineAt(i.selection.main.from),t=vn(e.state,r.from);return t.line?G1(e):t.block?$1(e):!1};function yn(e,i){return({state:r,dispatch:t})=>{if(r.readOnly)return!1;let n=e(i,r);return n?(t(r.update(n)),!0):!1}}var G1=yn(K1,0);var W1=yn(ss,0);var $1=yn((e,i)=>ss(e,i,j1(i)),0);function vn(e,i){let r=e.languageDataAt("commentTokens",i,1);return r.length?r[0]:{}}var Pt=50;function q1(e,{open:i,close:r},t,n){let o=e.sliceDoc(t-Pt,t),s=e.sliceDoc(n,n+Pt),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,f=o.length-a;if(o.slice(f-i.length,f)==i&&s.slice(l,l+r.length)==r)return{open:{pos:t-a,margin:a&&1},close:{pos:n+l,margin:l&&1}};let u,g;n-t<=2*Pt?u=g=e.sliceDoc(t,n):(u=e.sliceDoc(t,t+Pt),g=e.sliceDoc(n-Pt,n));let b=/^\s*/.exec(u)[0].length,S=/\s*$/.exec(g)[0].length,P=g.length-S-r.length;return u.slice(b,b+i.length)==i&&g.slice(P,P+r.length)==r?{open:{pos:t+b+i.length,margin:/\s/.test(u.charAt(b+i.length))?1:0},close:{pos:n-S-r.length,margin:/\s/.test(g.charAt(P-1))?1:0}}:null}function j1(e){let i=[];for(let r of e.selection.ranges){let t=e.doc.lineAt(r.from),n=r.to<=t.to?t:e.doc.lineAt(r.to);n.from>t.from&&n.from==r.to&&(n=r.to==t.to+1?t:e.doc.lineAt(r.to-1));let o=i.length-1;o>=0&&i[o].to>t.from?i[o].to=n.to:i.push({from:t.from+/^\s*/.exec(t.text)[0].length,to:n.to})}return i}function ss(e,i,r=i.selection.ranges){let t=r.map(o=>vn(i,o.from).block);if(!t.every(o=>o))return null;let n=r.map((o,s)=>q1(i,t[s],o.from,o.to));if(e!=2&&!n.every(o=>o))return{changes:i.changes(r.map((o,s)=>n[s]?[]:[{from:o.from,insert:t[s].open+" "},{from:o.to,insert:" "+t[s].close}]))};if(e!=1&&n.some(o=>o)){let o=[];for(let s=0,a;s<n.length;s++)if(a=n[s]){let l=t[s],{open:f,close:u}=a;o.push({from:f.pos-l.open.length,to:f.pos+f.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:o}}return null}function K1(e,i,r=i.selection.ranges){let t=[],n=-1;for(let{from:o,to:s}of r){let a=t.length,l=1e9,f=vn(i,o).line;if(f){for(let u=o;u<=s;){let g=i.doc.lineAt(u);if(g.from>n&&(o==s||s>g.from)){n=g.from;let b=/^\s*/.exec(g.text)[0].length,S=b==g.length,P=g.text.slice(b,b+f.length)==f?b:-1;b<g.text.length&&b<l&&(l=b),t.push({line:g,comment:P,token:f,indent:b,empty:S,single:!1})}u=g.to+1}if(l<1e9)for(let u=a;u<t.length;u++)t[u].indent<t[u].line.text.length&&(t[u].indent=l);t.length==a+1&&(t[a].single=!0)}}if(e!=2&&t.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:f,empty:u,single:g}of t)(g||!u)&&o.push({from:a.from+f,insert:l+" "});let s=i.changes(o);return{changes:s,selection:i.selection.map(s,1)}}else if(e!=1&&t.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of t)if(a>=0){let f=s.from+a,u=f+l.length;s.text[u-s.from]==" "&&u++,o.push({from:f,to:u})}return{changes:o}}return null}var pn=St.define(),Y1=St.define(),Q1=Oe.define(),as=Oe.define({combine(e){return Qe(e,{minDepth:100,newGroupDelay:500,joinToEvent:(i,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(i,r)=>(t,n)=>i(t,n)||r(t,n)})}}),Cn=Ke.define({create(){return mn.empty},update(e,i){let r=i.state.facet(as),t=i.annotation(pn);if(t){let l=ye.fromTransaction(i,t.selection),f=t.side,u=f==0?e.undone:e.done;return l?u=hi(u,u.length,r.minDepth,l):u=us(u,i.startState.selection),new mn(f==0?t.rest:u,f==0?u:t.rest)}let n=i.annotation(Y1);if((n=="full"||n=="before")&&(e=e.isolate()),i.annotation(dt.addToHistory)===!1)return i.changes.empty?e:e.addMapping(i.changes.desc);let o=ye.fromTransaction(i),s=i.annotation(dt.time),a=i.annotation(dt.userEvent);return o?e=e.addChanges(o,s,a,r,i):i.selection&&(e=e.addSelection(i.startState.selection,s,a,r.newGroupDelay)),(n=="full"||n=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(i=>i.toJSON()),undone:e.undone.map(i=>i.toJSON())}},fromJSON(e){return new mn(e.done.map(ye.fromJSON),e.undone.map(ye.fromJSON))}});function Sn(e={}){return[Cn,as.of(e),D.domEventHandlers({beforeinput(i,r){let t=i.inputType=="historyUndo"?pi:i.inputType=="historyRedo"?At:null;return t?(i.preventDefault(),t(r)):!1}})]}function mi(e,i){return function({state:r,dispatch:t}){if(!i&&r.readOnly)return!1;let n=r.field(Cn,!1);if(!n)return!1;let o=n.pop(e,r,i);return o?(t(o),!0):!1}}var pi=mi(0,!1),At=mi(1,!1),X1=mi(0,!0),J1=mi(1,!0);function ls(e){return function(i){let r=i.field(Cn,!1);if(!r)return 0;let t=e==0?r.done:r.undone;return t.length-(t.length&&!t[0].changes?1:0)}}var cs=ls(0),fs=ls(1),ye=class e{constructor(i,r,t,n,o){this.changes=i,this.effects=r,this.mapped=t,this.startSelection=n,this.selectionsAfter=o}setSelAfter(i){return new e(this.changes,this.effects,this.mapped,this.startSelection,i)}toJSON(){var i,r,t;return{changes:(i=this.changes)===null||i===void 0?void 0:i.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(t=this.startSelection)===null||t===void 0?void 0:t.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(i){return new e(i.changes&&Xo.fromJSON(i.changes),[],i.mapped&&Qo.fromJSON(i.mapped),i.startSelection&&k.fromJSON(i.startSelection),i.selectionsAfter.map(k.fromJSON))}static fromTransaction(i,r){let t=de;for(let n of i.startState.facet(Q1)){let o=n(i);o.length&&(t=t.concat(o))}return!t.length&&i.changes.empty?null:new e(i.changes.invert(i.startState.doc),t,void 0,r||i.startState.selection,de)}static selection