PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` define(["./chunks/_rollupPluginBabelHelpers-d0b0ebba","./chunks/vendor-22992e2c","./chunks/useAppDefaults-a6c3be91","./chunks/visibility-c7f197c2","./chunks/loadPreview-dfef3918","./chunks/base-fbc1ccef","./chunks/useSpacesLoading-b404aeae","./chunks/useGraphClient-6c0c047b","./chunks/useDriveResolver-be2aa3cc","./chunks/AppTopBar-4add792e","./chunks/client-aa4fd000","./web-client-c170d434","./chunks/functions-f74c7f04"],(function(e,i,t,a,s,n,r,o,l,d,c,h,u){"use strict";var v={cs:{},de:{"%{ displayIndex } of %{ availableMediaFiles }":"%{ displayIndex } von %{ availableMediaFiles }","Download currently viewed file":"Aktuell betrachtete Datei herunterladen","Failed to load media file":"Fehler beim Laden der Mediendatei","Loading media file":"Lade Mediendatei","Media file %{ displayIndex } of %{ availableMediaFiles }":"Mediendatei %{ displayIndex } von %{ availableMediaFiles }",msg:"Nachricht",Preview:"Vorschau","Preview for %{currentMediumName}":"Vorschau für %{currentMediumName}","Show next media file in folder":"Nächste Mediendatei im Order anzeigen","Show previous media file in folder":"Vorherige Mediendatei im Order anzeigen"},es:{msg:"msg"},fr:{"%{ displayIndex } of %{ availableMediaFiles }":"%{ displayIndex } de %{ availableMediaFiles }","Download currently viewed file":"Télécharger le fichier affiché","Failed to load media file":"Impossible de charger le fichier média","Loading media file":"Chargement du fichier média","Media file %{ displayIndex } of %{ availableMediaFiles }":"Fichier média %{ displayIndex } de %{ availableMediaFiles }",msg:"msg",Preview:"Prévisualisation","Preview for %{currentMediumName}":"Prévisualisation de %{currentMediumName}","Show next media file in folder":"Afficher le fichier média suivant","Show previous media file in folder":"Afficher le fichier média précédent"},gl:{msg:"msx"},it:{}};const p=i.defineComponent({name:"Preview",components:{AppTopBar:d.__vue_component__},setup(){const e=a.useStore();return{...t.useAppDefaults({applicationId:"preview"}),accessToken:o.useAccessToken({store:e}),isPublicLinkContext:l.usePublicLinkContext({store:e})}},data:()=>({isFileContentLoading:!0,isFileContentError:!1,activeIndex:null,direction:"rtl",cachedFiles:[]}),computed:{...i.mapGetters(["capabilities","user"]),pageTitle(){const e=this.$gettext("Preview for %{currentMediumName}");return this.$gettextInterpolate(e,{currentMediumName:this.activeFilteredFile?.name})},ariaHiddenFileCount(){const e=this.$gettext("%{ displayIndex } of %{ availableMediaFiles }");return this.$gettextInterpolate(e,{displayIndex:this.activeIndex+1,availableMediaFiles:this.filteredFiles.length})},screenreaderFileCount(){const e=this.$gettext("Media file %{ displayIndex } of %{ availableMediaFiles }");return this.$gettextInterpolate(e,{displayIndex:this.activeIndex+1,availableMediaFiles:this.filteredFiles.length})},filteredFiles(){return this.activeFiles?this.activeFiles.filter((e=>w.mimeTypes().includes(e.mimeType?.toLowerCase()))):[]},activeFilteredFile(){return this.filteredFiles[this.activeIndex]},activeMediaFileCached(){const e=this.cachedFiles.find((e=>e.id===this.activeFilteredFile.id));return void 0!==e&&e},thumbDimensions(){switch(!0){case window.innerWidth<=1024:return 1024;case window.innerWidth<=1280:return 1280;case window.innerWidth<=1920:return 1920;case window.innerWidth<=2160:return 2160;default:return 3840}},isActiveFileTypeImage(){return!this.isActiveFileTypeAudio&&!this.isActiveFileTypeVideo},isActiveFileTypeAudio(){return this.activeFilteredFile.mimeType.toLowerCase().startsWith("audio")},isActiveFileTypeVideo(){return this.activeFilteredFile.mimeType.toLowerCase().startsWith("video")}},watch:{activeIndex(e,i){e!==i&&this.loadMedium()}},async mounted(){window.addEventListener("popstate",this.handleLocalHistoryEvent),await this.loadFolderForFileContext(this.currentFileContext),this.setActiveFile(this.currentFileContext.driveAliasAndItem),this.$refs.preview.focus()},beforeDestroy(){window.removeEventListener("popstate",this.handleLocalHistoryEvent),this.cachedFiles.forEach((e=>{this.revokeUrl(e.url)}))},methods:{setActiveFile(e){for(let i=0;i{this.isFileContentLoading=!1}),50):this.loadActiveFileIntoCache()},async loadActiveFileIntoCache(){try{let e;e=!this.isActiveFileTypeImage?await this.getUrlForResource(this.currentFileContext.space,this.activeFilteredFile):await s.loadPreview({resource:this.activeFilteredFile,isPublic:this.isPublicLinkContext,server:a.configurationManager.serverUrl,userId:this.user.id,token:this.accessToken,dimensions:[this.thumbDimensions,this.thumbDimensions]}),this.cachedFiles.push({id:this.activeFilteredFile.id,name:this.activeFilteredFile.name,url:e,ext:this.activeFilteredFile.extension,mimeType:this.activeFilteredFile.mimeType,isVideo:this.isActiveFileTypeVideo,isImage:this.isActiveFileTypeImage,isAudio:this.isActiveFileTypeAudio}),this.isFileContentLoading=!1,this.isFileContentError=!1}catch(e){this.isFileContentLoading=!1,this.isFileContentError=!0,console.error(e)}},triggerActiveFileDownload(){if(!this.isFileContentLoading)return this.downloadFile(this.activeFilteredFile)},next(){if(!this.isFileContentLoading){if(this.isFileContentError=!1,this.direction="rtl",this.activeIndex+1>=this.filteredFiles.length)return this.activeIndex=0,void this.updateLocalHistory();this.activeIndex++,this.updateLocalHistory()}},prev(){if(!this.isFileContentLoading){if(this.isFileContentError=!1,this.direction="ltr",0===this.activeIndex)return this.activeIndex=this.filteredFiles.length-1,void this.updateLocalHistory();this.activeIndex--,this.updateLocalHistory()}}}});var m=function(){var e=this,i=e.$createElement,t=e._self._c||i;return t("main",{ref:"preview",attrs:{id:"preview",tabindex:"-1"},on:{keydown:[function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"left",37,i.key,["Left","ArrowLeft"])||"button"in i&&0!==i.button?null:e.prev.apply(null,arguments)},function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"right",39,i.key,["Right","ArrowRight"])||"button"in i&&2!==i.button?null:e.next.apply(null,arguments)},function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"esc",27,i.key,["Esc","Escape"])?null:e.closeApp.apply(null,arguments)}]}},[t("h1",{staticClass:"oc-invisible-sr",domProps:{textContent:e._s(e.pageTitle)}}),e._v(" "),t("app-top-bar",{attrs:{resource:e.activeFilteredFile},on:{close:e.closeApp},scopedSlots:e._u([{key:"right",fn:function(){return[e.isFileContentError?e._e():t("oc-button",{staticClass:"preview-download",attrs:{size:"small","aria-label":e.$gettext("Download currently viewed file")},on:{click:e.triggerActiveFileDownload}},[t("oc-icon",{attrs:{size:"small",name:"file-download"}})],1)]},proxy:!0}])}),e._v(" "),e.isFolderLoading||e.isFileContentLoading?t("div",{staticClass:"oc-position-center"},[t("oc-spinner",{attrs:{"aria-label":e.$gettext("Loading media file"),size:"xlarge"}})],1):e.isFileContentError?t("oc-icon",{staticClass:"oc-position-center",attrs:{name:"file-damage",variation:"danger",size:"xlarge","accessible-label":e.$gettext("Failed to load media file")}}):[t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeMediaFileCached,expression:"activeMediaFileCached"}],staticClass:"oc-width-1-1 oc-flex oc-flex-center oc-flex-middle oc-p-s oc-box-shadow-medium preview-player"},[e.activeMediaFileCached.isImage?t("img",{key:"media-image-"+e.activeMediaFileCached.id,attrs:{src:e.activeMediaFileCached.url,alt:e.activeMediaFileCached.name,"data-id":e.activeMediaFileCached.id}}):e.activeMediaFileCached.isVideo?t("video",{key:"media-video-"+e.activeMediaFileCached.id,attrs:{controls:"",preload:""}},[t("source",{attrs:{src:e.activeMediaFileCached.url,type:e.activeMediaFileCached.mimeType}})]):e.activeMediaFileCached.isAudio?t("audio",{key:"media-audio-"+e.activeMediaFileCached.id,attrs:{controls:"",preload:""}},[t("source",{attrs:{src:e.activeMediaFileCached.url,type:e.activeMediaFileCached.mimeType}})]):e._e()])],e._v(" "),t("div",{staticClass:"oc-position-medium oc-position-bottom-center preview-details"},[t("div",{staticClass:"oc-background-brand oc-p-s oc-width-large oc-flex oc-flex-middle oc-flex-center oc-flex-around preview-controls-action-bar"},[t("oc-button",{staticClass:"preview-controls-previous",attrs:{appearance:"raw",variation:"inverse","aria-label":e.$gettext("Show previous media file in folder")},on:{click:e.prev}},[t("oc-icon",{attrs:{size:"large",name:"arrow-drop-left"}})],1),e._v(" "),e.isFolderLoading?e._e():t("p",{staticClass:"oc-m-rm preview-controls-action-count"},[t("span",{attrs:{"aria-hidden":"true"},domProps:{textContent:e._s(e.ariaHiddenFileCount)}}),e._v(" "),t("span",{staticClass:"oc-invisible-sr",domProps:{textContent:e._s(e.screenreaderFileCount)}})]),e._v(" "),t("oc-button",{staticClass:"preview-controls-next",attrs:{appearance:"raw",variation:"inverse","aria-label":e.$gettext("Show next media file in folder")},on:{click:e.next}},[t("oc-icon",{attrs:{size:"large",name:"arrow-drop-right"}})],1)],1)])],2)};m._withStripped=!0;var F="preview",f=[{path:"/:driveAliasAndItem*",component:i.normalizeComponent({render:m,staticRenderFns:[]},undefined,p,"data-v-b081534e",false,undefined,!1,void 0,void 0,void 0),name:"media",meta:{authContext:"hybrid",title:"Preview",patchCleanPath:!0}}],g=function(){return["audio/flac","audio/mpeg","audio/ogg","audio/wav","audio/x-flac","audio/x-wav","image/gif","image/jpeg","image/png","video/mp4","video/webm"].concat(e._toConsumableArray(window.Vue.$store.getters.extensionConfigByAppId(F).mimeTypes||[]))},w={appInfo:{name:"Preview",id:F,icon:"eye",extensions:g().map((function(e){return{canBeDefault:!0,mimeType:e,routeName:"preview-media",label:"Preview"}}))},routes:f,translations:v,mimeTypes:g};return w}));