From e12e5a95a4bc29218f911221789a76dafce99d2c Mon Sep 17 00:00:00 2001 From: silver Date: Mon, 5 Oct 2026 18:04:09 +0200 Subject: [PATCH 1/2] fix(viewer): register handlers not yet in the lookup table when opening a file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On single-file public shares, the files app can open the file before DOMContentLoaded, while the component's handler lookup table is still empty. This shows "There is no plugin available to display this file type". Register any missing handlers when a file is opened, as well as on DOMContentLoaded. On this branch the end-to-end test is the Playwright version of the Cypress test. (cherry picked from commit 0d33b35c9633516fc2cd4292b1a78e568d5b2ebc) Signed-off-by: silver Assisted-by:ClaudeCode:claude-opus-5.5 Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com> --- .../e2e/sharing/single-file-share.spec.ts | 24 ++++++++ src/views/Viewer.vue | 57 ++++++++++++------- 2 files changed, 61 insertions(+), 20 deletions(-) diff --git a/playwright/e2e/sharing/single-file-share.spec.ts b/playwright/e2e/sharing/single-file-share.spec.ts index d68cce8fa..8325aecdc 100644 --- a/playwright/e2e/sharing/single-file-share.spec.ts +++ b/playwright/e2e/sharing/single-file-share.spec.ts @@ -50,4 +50,28 @@ test.describe('See shared single file with link share', () => { await expect(getMenuToggle(page)).toBeVisible() await expect(getCloseButton(page)).toBeVisible() }) + + test('Opens the shared image before the page finished loading', async ({ page }) => { + // Deferred scripts run in document order and DOMContentLoaded waits for all of them, + // so a slow last script lets the files app open the shared file before the event fires + await page.route('**/playwright-delay-dom-content-loaded.js', async (route) => { + await new Promise((resolve) => setTimeout(resolve, 3000)) + await route.fulfill({ contentType: 'text/javascript', body: '' }) + }) + await page.route(`**/s/${imageToken}`, async (route) => { + const response = await route.fetch() + const body = await response.text() + const nonce = body.match(/nonce="([^"]+)"/)?.[1] ?? '' + await route.fulfill({ + response, + body: body.replace('', ``), + }) + }) + + await visitPublicShare(page, imageToken) + + await expectViewerLoaded(page) + await expectActiveSource(page, 'img', '/apps/files_sharing/publicpreview/') + await expect(page.getByText('There is no plugin available to display this file type')).toHaveCount(0) + }) }) diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index db3aa4367..8ac47afa6 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -243,6 +243,7 @@ export default defineComponent({ components: {}, mimeGroups: {}, registeredHandlers: {}, + registeredHandlersCount: 0, // Files variables currentIndex: 0, @@ -519,27 +520,9 @@ export default defineComponent({ } // register on load + // (openFileInfo also registers them if a file is opened before DOMContentLoaded) document.addEventListener('DOMContentLoaded', () => { - // load all init handlers - if (window._oca_viewer_handlers) { - window._oca_viewer_handlers.forEach((handler) => { - OCA.Viewer.registerHandler(handler) - }) - } - - // register all primary components mimes - this.handlers.forEach(handler => { - this.registerHandler(handler) - }) - - // then register aliases. We need to have the components - // first so we can bind the alias to them. - this.handlers.forEach(handler => { - this.registerHandlerAlias(handler) - }) - this.isLoaded = true - - logger.info(`${this.handlers.length} viewer handlers registered`, { handlers: this.handlers }) + this.registerNewHandlers() }) window.addEventListener('resize', this.onResize) @@ -713,6 +696,8 @@ export default defineComponent({ return } + this.registerNewHandlers() + // get original mime and alias const mime = fileInfo.mime const alias = mime.split('/')[0] @@ -869,6 +854,38 @@ export default defineComponent({ document.title = `${fileName} - ${OCA.Theming?.name ?? oc_defaults.name}` }, + registerNewHandlers() { + // load all init handlers + if (window._oca_viewer_handlers) { + window._oca_viewer_handlers.forEach((handler) => { + if (!this.handlers.some(h => h.id === handler.id)) { + OCA.Viewer.registerHandler(handler) + } + }) + } + + // handlers are only ever appended to the service + const newHandlers = this.handlers.slice(this.registeredHandlersCount) + if (newHandlers.length === 0) { + return + } + this.registeredHandlersCount = this.handlers.length + + // register all primary components mimes + newHandlers.forEach(handler => { + this.registerHandler(handler) + }) + + // then register aliases. We need to have the components + // first so we can bind the alias to them. + newHandlers.forEach(handler => { + this.registerHandlerAlias(handler) + }) + this.isLoaded = true + + logger.info(`${newHandlers.length} viewer handlers registered`, { handlers: newHandlers }) + }, + /** * Registering possible new handlers * From 5ffcc8f898db3075eb22b0e05435c70908cdc673 Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Tue, 6 Oct 2026 08:34:43 +0000 Subject: [PATCH 2/2] chore(assets): Recompile assets Signed-off-by: nextcloud-command --- css/{main-BQAo6xiu.chunk.css => main-CS-6EKf2.chunk.css} | 2 +- css/viewer-main.css | 2 +- js/viewer-main.mjs | 4 ++-- js/viewer-main.mjs.map | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename css/{main-BQAo6xiu.chunk.css => main-CS-6EKf2.chunk.css} (88%) diff --git a/css/main-BQAo6xiu.chunk.css b/css/main-CS-6EKf2.chunk.css similarity index 88% rename from css/main-BQAo6xiu.chunk.css rename to css/main-CS-6EKf2.chunk.css index 39c7991f5..ff0d444ed 100644 --- a/css/main-BQAo6xiu.chunk.css +++ b/css/main-CS-6EKf2.chunk.css @@ -1,4 +1,4 @@ #emptycontent[data-v-6a8e09db]{margin:0;padding:10% 5%;background-color:var(--color-main-background)}._toastContainer_1biev_1{position:fixed;left:var(--body-container-margin);bottom:var(--body-container-margin);z-index:10100;display:flex;flex-direction:column;gap:calc(var(--default-grid-baseline) * 2);align-items:flex-start;pointer-events:none;padding:calc(var(--default-grid-baseline) * 2);transition:left var(--animation-quick, .1s) ease}._toastContainer_navOpen_1biev_15{left:calc(var(--navigation-width) + var(--body-container-margin))}@keyframes _toast-in_v43ag_1{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}._toast_v43ag_11{min-width:200px;background-color:var(--color-main-background);color:var(--color-main-text);box-shadow:0 0 6px 0 var(--color-box-shadow);padding:0 12px;border-radius:var(--border-radius);display:flex;align-items:center;min-height:var(--clickable-area-large);pointer-events:auto;animation:_toast-in_v43ag_1 var(--animation-slow) ease-out}._toast_clickable_v43ag_25{cursor:pointer}._toast_error_v43ag_29{border-left:3px solid var(--color-element-error, var(--color-error))}._toast_info_v43ag_33{border-left:3px solid var(--color-element-info, var(--color-primary))}._toast_warning_v43ag_37{border-left:3px solid var(--color-element-warning, var(--color-warning))}._toast_success_v43ag_41,._toast_undo_v43ag_45{border-left:3px solid var(--color-element-success, var(--color-success))}._toast_loading_v43ag_49{border-left:3px solid var(--color-element-info, var(--color-primary))}._toastMessage_v43ag_53{flex:1;padding:12px 0}._toastLoader_v43ag_58,._toastClose_v43ag_59,._toastUndoButton_v43ag_60{display:flex;align-items:center;margin-left:12px;flex-shrink:0}.nc-generic-dialog .dialog__actions{justify-content:space-between;min-width:calc(100% - 12px)}._card_ysn65_1{display:flex;align-items:center;height:64px}._cardIcon_ysn65_7,._cardPreview_ysn65_8{height:64px;width:64px;margin:0 var(--secondary-margin);display:block;flex:0 0 64px}._cardIcon_ysn65_7{color:var(--color-text-maxcontrast)}._cardIcon_folder_ysn65_20{color:var(--color-primary-element)}._cardPreview_ysn65_8{overflow:hidden;border-radius:calc(var(--border-radius) * 2);object-fit:cover}._cardDescription_ysn65_30{display:flex;flex-direction:column;min-width:0}._cardDescription_ysn65_30 span,._cardDescription_ysn65_30 :deep(time){white-space:nowrap}._bold_ysn65_40{font-weight:700}._pickerEntry_k9pc8_1{display:grid;align-items:center;grid-template-columns:1fr var(--arrow-column) 1fr}._pickerEntry_k9pc8_1:not(:last-of-type){border-bottom:1px solid var(--color-border)}._pickerEntry_k9pc8_1 legend{grid-column:1/-1;font-weight:700}._pickerEntryArrow_k9pc8_14{justify-self:center;color:var(--color-text-maxcontrast)}._picker_108fg_1{--margin: 36px;--secondary-margin: 18px;--arrow-column: 44px}._picker_108fg_1 .dialog__actions{margin-block-end:calc(var(--default-grid-baseline) * 6)}._pickerActionSeparator_108fg_10{margin-inline-start:auto}._pickerHeader_108fg_14{position:sticky;z-index:10;top:0;padding:0 var(--margin);padding-bottom:var(--secondary-margin);background-color:var(--color-main-background)}._pickerForm_108fg_23{position:relative;overflow:auto;padding:0 var(--margin);margin-top:calc(-1 * var(--secondary-margin))}._pickerActionSubmit_disabled_108fg_30{opacity:.7;filter:saturate(50%)}._pickerSelectAll_108fg_35{display:grid;width:100%;margin-top:calc(var(--secondary-margin) * 1.5);padding-bottom:var(--secondary-margin);grid-template-columns:1fr var(--arrow-column) 1fr;align-items:center}._pickerSelectAll_108fg_35 legend{display:flex;align-items:center;grid-column:1/-1;width:100%;margin-bottom:calc(var(--secondary-margin) / 2)}._pickerSelectAll_108fg_35._conflict-picker__all_108fg_50{position:sticky;top:0;margin:0;padding:var(--secondary-margin) 0;background-image:linear-gradient(to top,transparent,var(--color-main-background-blur) 10%,var(--color-main-background) 15%)}._pickerSelectAll_108fg_35._conflict-picker__all_108fg_50+fieldset{margin-top:0}._pickerSelectAll_108fg_35._conflict-picker__all_108fg_50 :deep(label){font-weight:700}._file-picker__file-icon_1aykw_9{position:relative;width:32px;height:32px;min-width:32px;min-height:32px;background-repeat:no-repeat;background-size:contain;border-radius:var(--border-radius-small);display:flex;justify-content:center}._file-picker__file-icon--primary_1aykw_22{color:var(--color-primary-element)}._file-picker__file-icon-overlay_1aykw_26{color:var(--color-primary-element-text);position:absolute;inset-block-start:10px}tr.file-picker__row[data-v-7857e8bd]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-7857e8bd]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-7857e8bd]{padding:0 2px}tr.file-picker__row td[data-v-7857e8bd]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-7857e8bd]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-7857e8bd]{padding-inline:2px 0}.file-picker__row[data-v-7857e8bd] *{cursor:pointer}.file-picker__row--selected[data-v-7857e8bd]{background-color:var(--color-background-dark)}.file-picker__row--not-navigatable[data-v-7857e8bd]{filter:saturate(.7);opacity:.7}.file-picker__row--not-navigatable[data-v-7857e8bd] *,.file-picker__row--not-pickable[data-v-7857e8bd] *{cursor:default!important}.file-picker__row[data-v-7857e8bd]:hover{background-color:var(--color-background-hover)}.file-picker__name-container[data-v-7857e8bd]{display:flex;justify-content:start;align-items:center;height:100%}.file-picker__file-name[data-v-7857e8bd]{padding-inline-start:6px;min-width:0;overflow:hidden;text-overflow:ellipsis}.file-picker__file-extension[data-v-7857e8bd]{color:var(--color-text-maxcontrast);min-width:fit-content}/*! * SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later -*/tr.file-picker__row[data-v-1f96131b]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-1f96131b]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-1f96131b]{padding:0 2px}tr.file-picker__row td[data-v-1f96131b]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-1f96131b]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-1f96131b]{padding-inline:2px 0}@keyframes gradient-1f96131b{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}.loading-row .row-checkbox[data-v-1f96131b]{text-align:center!important}.loading-row span[data-v-1f96131b]{display:inline-block;height:24px;background:linear-gradient(to right,var(--color-background-darker),var(--color-text-maxcontrast),var(--color-background-darker));background-size:600px 100%;border-radius:var(--border-radius);animation:gradient-1f96131b 12s ease infinite}.loading-row .row-wrapper[data-v-1f96131b]{display:inline-flex;align-items:center}.loading-row .row-checkbox span[data-v-1f96131b]{width:24px}.loading-row .row-name span[data-v-1f96131b]:last-of-type{margin-inline-start:6px;width:130px}.loading-row .row-size span[data-v-1f96131b]{width:80px}.loading-row .row-modified span[data-v-1f96131b]{width:90px}.file-picker__header-preview[data-v-412efd5c]{width:22px;height:32px;flex:0 0 auto}.file-picker__files[data-v-412efd5c]{margin:2px;margin-inline-start:12px;overflow:scroll auto}.file-picker__files table[data-v-412efd5c]{width:100%;max-height:100%;table-layout:fixed}.file-picker__files th[data-v-412efd5c]{position:sticky;z-index:1;top:0;background-color:var(--color-main-background);padding:2px}.file-picker__files th .header-wrapper[data-v-412efd5c]{display:flex}.file-picker__files th.row-checkbox[data-v-412efd5c]{width:44px}.file-picker__files th.row-name[data-v-412efd5c]{width:230px}.file-picker__files th.row-size[data-v-412efd5c]{width:100px}.file-picker__files th.row-modified[data-v-412efd5c]{width:120px}.file-picker__files th[data-v-412efd5c]:not(.row-size) .button-vue__wrapper{justify-content:start;flex-direction:row-reverse}.file-picker__files th[data-v-412efd5c]:not(.row-size) .button-vue{padding-inline:16px 4px}.file-picker__files th.row-size[data-v-412efd5c] .button-vue__wrapper{justify-content:end}.file-picker__files th[data-v-412efd5c] .button-vue__wrapper{color:var(--color-text-maxcontrast)}.file-picker__files th[data-v-412efd5c] .button-vue__wrapper .button-vue__text{font-weight:400}.file-picker__breadcrumbs[data-v-b448b141]{flex-grow:0!important}.file-picker__side[data-v-e1c54e23]{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;min-width:200px;padding:2px;margin-block-start:7px;overflow:auto}.file-picker__side[data-v-e1c54e23] .button-vue__wrapper{justify-content:start}.file-picker__filter-input[data-v-e1c54e23]{margin-block:7px;max-width:260px}@media(max-width:736px){.file-picker__side[data-v-e1c54e23]{flex-direction:row;min-width:unset}}@media(max-width:512px){.file-picker__side[data-v-e1c54e23]{flex-direction:row;min-width:unset}.file-picker__filter-input[data-v-e1c54e23]{max-width:unset}}.file-picker__navigation{padding-inline:8px 2px}.file-picker__navigation,.file-picker__navigation *{box-sizing:border-box}.file-picker__navigation .v-select.select{min-width:220px}@media(min-width:513px)and (max-width:736px){.file-picker__navigation{gap:11px}}@media(max-width:512px){.file-picker__navigation{flex-direction:column-reverse!important}}.file-picker__view[data-v-39182aaf]{height:50px;display:flex;justify-content:start;align-items:center}.file-picker__view h3[data-v-39182aaf]{font-weight:700;height:fit-content;margin:0}.file-picker__main[data-v-39182aaf]{box-sizing:border-box;width:100%;display:flex;flex-direction:column;min-height:0;flex:1;padding-inline:2px}.file-picker__main[data-v-39182aaf] *{box-sizing:border-box}[data-v-39182aaf] .file-picker{height:min(80vh,800px)!important}@media(max-width:512px){[data-v-39182aaf] .file-picker{height:calc(100% - 16px - var(--default-clickable-area))!important}}[data-v-39182aaf] .file-picker__content{display:flex;flex-direction:column;overflow:hidden}.public-auth-prompt__text[data-v-bd4b7f1b]{font-size:1.25em;margin-block:0 calc(3 * var(--default-grid-baseline))}.public-auth-prompt__header[data-v-bd4b7f1b]{margin-block:0 calc(3 * var(--default-grid-baseline))}.public-auth-prompt__header[data-v-bd4b7f1b]:first-child{margin-top:0}.public-auth-prompt__input[data-v-bd4b7f1b]{margin-block:calc(4 * var(--default-grid-baseline)) calc(2 * var(--default-grid-baseline))}.viewer.modal-mask[data-v-3a4e5460]{transition:width ease .1s,background-color .3s ease}.viewer[data-v-3a4e5460] .modal-container,.viewer__content[data-v-3a4e5460]{overflow:visible!important;cursor:pointer}.viewer--split[data-v-3a4e5460]{display:flex}.viewer--split .viewer__file--active[data-v-3a4e5460]{width:50%;left:0;position:relative}.viewer[data-v-3a4e5460] .modal-wrapper .modal-container{top:var(--header-height);bottom:var(--header-height);height:auto;background-color:transparent;box-shadow:none}.viewer__content[data-v-3a4e5460]{width:100%;height:100%}.viewer__file-wrapper[data-v-3a4e5460]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.viewer__file-wrapper--hidden[data-v-3a4e5460]{position:absolute;z-index:-1;left:-10000px}.viewer__file[data-v-3a4e5460]{transition:height .1s ease,width .1s ease}.viewer.theme--dark[data-v-3a4e5460] .button-vue--vue-tertiary:hover{background-color:#ffffff14!important}.viewer.theme--dark[data-v-3a4e5460] .button-vue--vue-tertiary:focus,.viewer.theme--dark[data-v-3a4e5460] .button-vue--vue-tertiary:focus-visible{background-color:#ffffff14!important;outline:2px solid var(--color-primary-element)!important}.viewer.theme--dark[data-v-3a4e5460] .button-vue--vue-tertiary.action-item__menutoggle{background-color:transparent}.viewer.theme--undefined.modal-mask[data-v-3a4e5460]{background-color:transparent!important}.viewer.theme--light.modal-mask[data-v-3a4e5460]{background-color:#ffffffeb!important}.viewer.theme--light[data-v-3a4e5460] .modal-header__name,.viewer.theme--light[data-v-3a4e5460] .modal-header .icons-menu button svg{color:#000!important}.viewer.theme--default.modal-mask[data-v-3a4e5460]{background-color:var(--color-main-background)!important}.viewer.theme--default[data-v-3a4e5460] .modal-header__name,.viewer.theme--default[data-v-3a4e5460] .modal-header .icons-menu{color:var(--color-main-text)!important}.viewer.theme--default[data-v-3a4e5460] .modal-header__name button svg,.viewer.theme--default[data-v-3a4e5460] .modal-header__name a,.viewer.theme--default[data-v-3a4e5460] .modal-header .icons-menu button svg,.viewer.theme--default[data-v-3a4e5460] .modal-header .icons-menu a{color:var(--color-main-text)!important}.viewer.image--fullscreen[data-v-3a4e5460] .modal-header .modal-header__name{opacity:0}.viewer.image--fullscreen[data-v-3a4e5460] .modal-header .icons-menu{background-color:#0003}.viewer.image--fullscreen[data-v-3a4e5460] .modal-wrapper .modal-container{top:0;bottom:0;height:100%}body:has(#viewer) #app-sidebar-vue{position:fixed;width:calc(var(--app-sidebar-width) + var(--body-container-margin))}body:has(#viewer) .app-navigation~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])){flex-basis:calc(100% - 300px - clamp(300px,27vw,500px))}body:has(#viewer) #app-content-vue:first-child:has(~#app-sidebar-vue:not([style*="display: none"])),body:has(#viewer) .app-navigation--close~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])),body:has(#viewer) .app-navigation--closed~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])){flex-basis:calc(100% - clamp(300px,27vw,500px))}body:has(#viewer) #header{visibility:hidden}.component-fade-enter-active,.component-fade-leave-active{transition:opacity .3s ease}.component-fade-enter,.component-fade-leave-to{opacity:0}#viewer.modal-mask--dark .action-item--single.icon-menu-sidebar{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='16'%20version='1.1'%20viewbox='0%200%2016%2016'%3e%3cpath%20d='m2%202c-0.554%200-1%200.446-1%201s0.446%201%201%201h12c0.554%200%201-0.446%201-1s-0.446-1-1-1h-12zm9.717%204.0059c-1.247%200-2.1428%201.0199-2.1428%201.998%200%200.9995%200.0726%201.7127%200.5718%202.4981%200.16%200.207%200.347%200.251%200.5%200.43%200.097%200.357%200.171%200.713%200.071%201.07-0.311%200.109-0.607%200.237-0.9065%200.357-0.364-0.195-0.7863-0.357-1.1503-0.5-0.05-0.2-0.0129-0.347%200.0371-0.535%200.0856-0.089%200.163-0.129%200.2558-0.215%200.2642-0.321%200.2793-0.864%200.2793-1.2496%200-0.5712-0.5135-0.9981-1.0703-0.9981-0.6211%200-1.0723%200.5126-1.0723%200.9981h-0.0136c0%200.4996%200.0353%200.8576%200.2851%201.2496%200.0714%200.107%200.1729%200.126%200.25%200.215%200.0481%200.179%200.0859%200.357%200.0352%200.535-0.4569%200.16-0.8863%200.357-1.2832%200.571-0.2999%200.214-0.1668%200.131-0.3574%200.822-0.0886%200.357%200.928%200.521%201.6562%200.578-0.0357%200.196-0.0857%200.457-0.2285%200.957-0.2285%200.893%203.1074%201.213%204.2834%201.213%201.735%200%204.507-0.325%204.269-1.213-0.371-1.385-0.15-1.221-0.701-1.642-0.778-0.467-1.749-0.834-2.568-1.143-0.107-0.398-0.03-0.692%200.07-1.07%200.168-0.179%200.357-0.259%200.514-0.43%200.492-0.6312%200.556-1.7299%200.556-2.4981%200-1.1323-1.019-1.998-2.14-1.998zm-9.717%200.9941c-0.554%200-1%200.446-1%201s0.446%201%201%201h4.2852c0.0891-0.1855%200.2-0.3648%200.3515-0.5195%200.3721-0.3801%200.9171-0.5988%201.4883-0.6192h0.0098%200.0097c0.1729%200.017%200.3042%200.0597%200.4297%200.1426%200-0.3488%200.0747-0.6853%200.1953-1.0039h-6.7695zm0%205c-0.554%200-1%200.446-1%201s0.446%201%201%201h3.25c-0.0375-0.049-0.0777-0.09-0.1113-0.152-0.1221-0.228-0.1706-0.568-0.1035-0.838l0.0019-0.012%200.0039-0.012c0.0822-0.298%200.0556-0.322%200.1445-0.615%200.0313-0.103%200.1114-0.245%200.1993-0.371h-3.3848z'%20fill='%23fff'/%3e%3c/svg%3e")}#viewer.modal-mask--dark .action-item--single.icon-download{background-image:var(--icon-download-fff)}.ui-autocomplete{z-index:2050!important} +*/tr.file-picker__row[data-v-1f96131b]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-1f96131b]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-1f96131b]{padding:0 2px}tr.file-picker__row td[data-v-1f96131b]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-1f96131b]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-1f96131b]{padding-inline:2px 0}@keyframes gradient-1f96131b{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}.loading-row .row-checkbox[data-v-1f96131b]{text-align:center!important}.loading-row span[data-v-1f96131b]{display:inline-block;height:24px;background:linear-gradient(to right,var(--color-background-darker),var(--color-text-maxcontrast),var(--color-background-darker));background-size:600px 100%;border-radius:var(--border-radius);animation:gradient-1f96131b 12s ease infinite}.loading-row .row-wrapper[data-v-1f96131b]{display:inline-flex;align-items:center}.loading-row .row-checkbox span[data-v-1f96131b]{width:24px}.loading-row .row-name span[data-v-1f96131b]:last-of-type{margin-inline-start:6px;width:130px}.loading-row .row-size span[data-v-1f96131b]{width:80px}.loading-row .row-modified span[data-v-1f96131b]{width:90px}.file-picker__header-preview[data-v-412efd5c]{width:22px;height:32px;flex:0 0 auto}.file-picker__files[data-v-412efd5c]{margin:2px;margin-inline-start:12px;overflow:scroll auto}.file-picker__files table[data-v-412efd5c]{width:100%;max-height:100%;table-layout:fixed}.file-picker__files th[data-v-412efd5c]{position:sticky;z-index:1;top:0;background-color:var(--color-main-background);padding:2px}.file-picker__files th .header-wrapper[data-v-412efd5c]{display:flex}.file-picker__files th.row-checkbox[data-v-412efd5c]{width:44px}.file-picker__files th.row-name[data-v-412efd5c]{width:230px}.file-picker__files th.row-size[data-v-412efd5c]{width:100px}.file-picker__files th.row-modified[data-v-412efd5c]{width:120px}.file-picker__files th[data-v-412efd5c]:not(.row-size) .button-vue__wrapper{justify-content:start;flex-direction:row-reverse}.file-picker__files th[data-v-412efd5c]:not(.row-size) .button-vue{padding-inline:16px 4px}.file-picker__files th.row-size[data-v-412efd5c] .button-vue__wrapper{justify-content:end}.file-picker__files th[data-v-412efd5c] .button-vue__wrapper{color:var(--color-text-maxcontrast)}.file-picker__files th[data-v-412efd5c] .button-vue__wrapper .button-vue__text{font-weight:400}.file-picker__breadcrumbs[data-v-b448b141]{flex-grow:0!important}.file-picker__side[data-v-e1c54e23]{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;min-width:200px;padding:2px;margin-block-start:7px;overflow:auto}.file-picker__side[data-v-e1c54e23] .button-vue__wrapper{justify-content:start}.file-picker__filter-input[data-v-e1c54e23]{margin-block:7px;max-width:260px}@media(max-width:736px){.file-picker__side[data-v-e1c54e23]{flex-direction:row;min-width:unset}}@media(max-width:512px){.file-picker__side[data-v-e1c54e23]{flex-direction:row;min-width:unset}.file-picker__filter-input[data-v-e1c54e23]{max-width:unset}}.file-picker__navigation{padding-inline:8px 2px}.file-picker__navigation,.file-picker__navigation *{box-sizing:border-box}.file-picker__navigation .v-select.select{min-width:220px}@media(min-width:513px)and (max-width:736px){.file-picker__navigation{gap:11px}}@media(max-width:512px){.file-picker__navigation{flex-direction:column-reverse!important}}.file-picker__view[data-v-39182aaf]{height:50px;display:flex;justify-content:start;align-items:center}.file-picker__view h3[data-v-39182aaf]{font-weight:700;height:fit-content;margin:0}.file-picker__main[data-v-39182aaf]{box-sizing:border-box;width:100%;display:flex;flex-direction:column;min-height:0;flex:1;padding-inline:2px}.file-picker__main[data-v-39182aaf] *{box-sizing:border-box}[data-v-39182aaf] .file-picker{height:min(80vh,800px)!important}@media(max-width:512px){[data-v-39182aaf] .file-picker{height:calc(100% - 16px - var(--default-clickable-area))!important}}[data-v-39182aaf] .file-picker__content{display:flex;flex-direction:column;overflow:hidden}.public-auth-prompt__text[data-v-bd4b7f1b]{font-size:1.25em;margin-block:0 calc(3 * var(--default-grid-baseline))}.public-auth-prompt__header[data-v-bd4b7f1b]{margin-block:0 calc(3 * var(--default-grid-baseline))}.public-auth-prompt__header[data-v-bd4b7f1b]:first-child{margin-top:0}.public-auth-prompt__input[data-v-bd4b7f1b]{margin-block:calc(4 * var(--default-grid-baseline)) calc(2 * var(--default-grid-baseline))}.viewer.modal-mask[data-v-b24bef65]{transition:width ease .1s,background-color .3s ease}.viewer[data-v-b24bef65] .modal-container,.viewer__content[data-v-b24bef65]{overflow:visible!important;cursor:pointer}.viewer--split[data-v-b24bef65]{display:flex}.viewer--split .viewer__file--active[data-v-b24bef65]{width:50%;left:0;position:relative}.viewer[data-v-b24bef65] .modal-wrapper .modal-container{top:var(--header-height);bottom:var(--header-height);height:auto;background-color:transparent;box-shadow:none}.viewer__content[data-v-b24bef65]{width:100%;height:100%}.viewer__file-wrapper[data-v-b24bef65]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.viewer__file-wrapper--hidden[data-v-b24bef65]{position:absolute;z-index:-1;left:-10000px}.viewer__file[data-v-b24bef65]{transition:height .1s ease,width .1s ease}.viewer.theme--dark[data-v-b24bef65] .button-vue--vue-tertiary:hover{background-color:#ffffff14!important}.viewer.theme--dark[data-v-b24bef65] .button-vue--vue-tertiary:focus,.viewer.theme--dark[data-v-b24bef65] .button-vue--vue-tertiary:focus-visible{background-color:#ffffff14!important;outline:2px solid var(--color-primary-element)!important}.viewer.theme--dark[data-v-b24bef65] .button-vue--vue-tertiary.action-item__menutoggle{background-color:transparent}.viewer.theme--undefined.modal-mask[data-v-b24bef65]{background-color:transparent!important}.viewer.theme--light.modal-mask[data-v-b24bef65]{background-color:#ffffffeb!important}.viewer.theme--light[data-v-b24bef65] .modal-header__name,.viewer.theme--light[data-v-b24bef65] .modal-header .icons-menu button svg{color:#000!important}.viewer.theme--default.modal-mask[data-v-b24bef65]{background-color:var(--color-main-background)!important}.viewer.theme--default[data-v-b24bef65] .modal-header__name,.viewer.theme--default[data-v-b24bef65] .modal-header .icons-menu{color:var(--color-main-text)!important}.viewer.theme--default[data-v-b24bef65] .modal-header__name button svg,.viewer.theme--default[data-v-b24bef65] .modal-header__name a,.viewer.theme--default[data-v-b24bef65] .modal-header .icons-menu button svg,.viewer.theme--default[data-v-b24bef65] .modal-header .icons-menu a{color:var(--color-main-text)!important}.viewer.image--fullscreen[data-v-b24bef65] .modal-header .modal-header__name{opacity:0}.viewer.image--fullscreen[data-v-b24bef65] .modal-header .icons-menu{background-color:#0003}.viewer.image--fullscreen[data-v-b24bef65] .modal-wrapper .modal-container{top:0;bottom:0;height:100%}body:has(#viewer) #app-sidebar-vue{position:fixed;width:calc(var(--app-sidebar-width) + var(--body-container-margin))}body:has(#viewer) .app-navigation~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])){flex-basis:calc(100% - 300px - clamp(300px,27vw,500px))}body:has(#viewer) #app-content-vue:first-child:has(~#app-sidebar-vue:not([style*="display: none"])),body:has(#viewer) .app-navigation--close~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])),body:has(#viewer) .app-navigation--closed~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])){flex-basis:calc(100% - clamp(300px,27vw,500px))}body:has(#viewer) #header{visibility:hidden}.component-fade-enter-active,.component-fade-leave-active{transition:opacity .3s ease}.component-fade-enter,.component-fade-leave-to{opacity:0}#viewer.modal-mask--dark .action-item--single.icon-menu-sidebar{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='16'%20version='1.1'%20viewbox='0%200%2016%2016'%3e%3cpath%20d='m2%202c-0.554%200-1%200.446-1%201s0.446%201%201%201h12c0.554%200%201-0.446%201-1s-0.446-1-1-1h-12zm9.717%204.0059c-1.247%200-2.1428%201.0199-2.1428%201.998%200%200.9995%200.0726%201.7127%200.5718%202.4981%200.16%200.207%200.347%200.251%200.5%200.43%200.097%200.357%200.171%200.713%200.071%201.07-0.311%200.109-0.607%200.237-0.9065%200.357-0.364-0.195-0.7863-0.357-1.1503-0.5-0.05-0.2-0.0129-0.347%200.0371-0.535%200.0856-0.089%200.163-0.129%200.2558-0.215%200.2642-0.321%200.2793-0.864%200.2793-1.2496%200-0.5712-0.5135-0.9981-1.0703-0.9981-0.6211%200-1.0723%200.5126-1.0723%200.9981h-0.0136c0%200.4996%200.0353%200.8576%200.2851%201.2496%200.0714%200.107%200.1729%200.126%200.25%200.215%200.0481%200.179%200.0859%200.357%200.0352%200.535-0.4569%200.16-0.8863%200.357-1.2832%200.571-0.2999%200.214-0.1668%200.131-0.3574%200.822-0.0886%200.357%200.928%200.521%201.6562%200.578-0.0357%200.196-0.0857%200.457-0.2285%200.957-0.2285%200.893%203.1074%201.213%204.2834%201.213%201.735%200%204.507-0.325%204.269-1.213-0.371-1.385-0.15-1.221-0.701-1.642-0.778-0.467-1.749-0.834-2.568-1.143-0.107-0.398-0.03-0.692%200.07-1.07%200.168-0.179%200.357-0.259%200.514-0.43%200.492-0.6312%200.556-1.7299%200.556-2.4981%200-1.1323-1.019-1.998-2.14-1.998zm-9.717%200.9941c-0.554%200-1%200.446-1%201s0.446%201%201%201h4.2852c0.0891-0.1855%200.2-0.3648%200.3515-0.5195%200.3721-0.3801%200.9171-0.5988%201.4883-0.6192h0.0098%200.0097c0.1729%200.017%200.3042%200.0597%200.4297%200.1426%200-0.3488%200.0747-0.6853%200.1953-1.0039h-6.7695zm0%205c-0.554%200-1%200.446-1%201s0.446%201%201%201h3.25c-0.0375-0.049-0.0777-0.09-0.1113-0.152-0.1221-0.228-0.1706-0.568-0.1035-0.838l0.0019-0.012%200.0039-0.012c0.0822-0.298%200.0556-0.322%200.1445-0.615%200.0313-0.103%200.1114-0.245%200.1993-0.371h-3.3848z'%20fill='%23fff'/%3e%3c/svg%3e")}#viewer.modal-mask--dark .action-item--single.icon-download{background-image:var(--icon-download-fff)}.ui-autocomplete{z-index:2050!important} diff --git a/css/viewer-main.css b/css/viewer-main.css index 3ba295389..5f62d54ec 100644 --- a/css/viewer-main.css +++ b/css/viewer-main.css @@ -1,3 +1,3 @@ /* extracted by css-entry-points-plugin */ -@import './main-BQAo6xiu.chunk.css'; +@import './main-CS-6EKf2.chunk.css'; @import './previewUtils-CU5qdRbf.chunk.css'; \ No newline at end of file diff --git a/js/viewer-main.mjs b/js/viewer-main.mjs index c881d0918..8a88698cf 100644 --- a/js/viewer-main.mjs +++ b/js/viewer-main.mjs @@ -1,9 +1,9 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('viewer', '', 'js/NcModal-DBcDnXsK.chunk.mjs'),window.OC.filePath('viewer', '', 'js/NcIconSvgWrapper-Bui9PhAS-MOPj76Nd.chunk.mjs'),window.OC.filePath('viewer', '', 'js/previewUtils-C22FGbzD.chunk.mjs'),window.OC.filePath('viewer', '', 'css/previewUtils-CU5qdRbf.chunk.css'),window.OC.filePath('viewer', '', 'js/_plugin-vue2_normalizer-DU4iP6Vu-UEw9p-J1.chunk.mjs'),window.OC.filePath('viewer', '', 'css/NcIconSvgWrapper-Bui9PhAS-3xIBDiQU.chunk.css'),window.OC.filePath('viewer', '', 'css/NcModal-8EYmpmQk.chunk.css'),window.OC.filePath('viewer', '', 'js/NcActionLink-DDQUkWaO.chunk.mjs'),window.OC.filePath('viewer', '', 'js/actionText-BMig9Egt-DrBqWVOB.chunk.mjs'),window.OC.filePath('viewer', '', 'css/NcActionLink-DqmJtdZG.chunk.css'),window.OC.filePath('viewer', '', 'js/NcActionButton-CGQjmg5B.chunk.mjs'),window.OC.filePath('viewer', '', 'css/NcActionButton-BjaRp7qa.chunk.css'),window.OC.filePath('viewer', '', 'css/index-CS3F8E0B.chunk.css')])))=>i.map(i=>d[i]); -import{D as B,E as T,F as u,G as N,H as $,I as m,J as q,K as S,L as R,M as G,N as W,O as K,P as j,Q as U,R as I,S as Z,T as J,U as Y,W as Q,C as X,X as s,Y as v,Z as _,_ as y,$ as x,V as g,a0 as E,a1 as ee,a2 as te,a3 as b,a4 as ie,a5 as F,a6 as p,a7 as ne,a8 as se,a9 as re,aa as le}from"./previewUtils-C22FGbzD.chunk.mjs";const ae={computed:{isFullscreen(){return B.value}}},oe={computed:{isMobile(){return T.value}}};function de(e){if(e.hideDownload)return!1;const i=typeof e?.shareAttributes=="string"?JSON.parse(e.shareAttributes||"[]"):e?.shareAttributes;return i&&i.length>0?i.find(({scope:n,key:r})=>n==="permissions"&&r==="download")?.value!==!1:!0}const V=function(e){const i=new AbortController;return{request:async function(n,r){return e(n,{...r,signal:i.signal})},cancel:()=>i.abort()}},ce={name:"Error",props:{name:{type:String,default:""}}};var he=function(){var e=this,i=e._self._c;return i("div",{attrs:{id:"emptycontent"}},[i("div",{staticClass:"icon-error"}),i("h2",[e._t("default",function(){return[e._v(e._s(e.t("viewer","Error loading {name}",{name:e.name})))]})],2)])},ue=[],me=u(ce,he,ue,!1,null,"6a8e09db");const pe=me.exports,fe=async e=>{e.startsWith("/")||(e=`/${e}`);const i=N(),n=$(),r=await i.stat(`${m()}${e}`,{details:!0,data:n});return q(r.data)};function w(e,i,n){const r={mime:i,modal:n,failed:!1,loaded:!1,davPath:S(e),source:e.source??S(e)};return Object.assign({},e,r)}async function we(e,i={}){return(await R.getDirectoryContents(e,Object.assign({data:` +import{D as B,E as N,F as u,G as T,H as $,I as m,J as q,K as S,L as R,M as G,N as W,O as K,P as j,Q as U,R as I,S as Z,T as J,U as Y,W as Q,C as X,X as s,Y as v,Z as _,_ as y,$ as x,V as g,a0 as E,a1 as ee,a2 as te,a3 as b,a4 as ie,a5 as F,a6 as p,a7 as ne,a8 as se,a9 as re,aa as le}from"./previewUtils-C22FGbzD.chunk.mjs";const ae={computed:{isFullscreen(){return B.value}}},oe={computed:{isMobile(){return N.value}}};function de(e){if(e.hideDownload)return!1;const i=typeof e?.shareAttributes=="string"?JSON.parse(e.shareAttributes||"[]"):e?.shareAttributes;return i&&i.length>0?i.find(({scope:n,key:r})=>n==="permissions"&&r==="download")?.value!==!1:!0}const H=function(e){const i=new AbortController;return{request:async function(n,r){return e(n,{...r,signal:i.signal})},cancel:()=>i.abort()}},ce={name:"Error",props:{name:{type:String,default:""}}};var he=function(){var e=this,i=e._self._c;return i("div",{attrs:{id:"emptycontent"}},[i("div",{staticClass:"icon-error"}),i("h2",[e._t("default",function(){return[e._v(e._s(e.t("viewer","Error loading {name}",{name:e.name})))]})],2)])},ue=[],me=u(ce,he,ue,!1,null,"6a8e09db");const pe=me.exports,fe=async e=>{e.startsWith("/")||(e=`/${e}`);const i=T(),n=$(),r=await i.stat(`${m()}${e}`,{details:!0,data:n});return q(r.data)};function w(e,i,n){const r={mime:i,modal:n,failed:!1,loaded:!1,davPath:S(e),source:e.source??S(e)};return Object.assign({},e,r)}async function we(e,i={}){return(await R.getDirectoryContents(e,Object.assign({data:` ${W()} - `,details:!0},i))).data.map(K)}async function ge(){const e=await ve();if(!e)return{key:"basename",asc:!0};const i={mtime:"lastmod"}[e.sorting_mode]||e.sorting_mode||"basename",n=e.sorting_direction==="asc"||!e.sorting_direction;return{key:i,asc:n}}async function ve(){if(j())return null;const e=U("apps/files/api/v1/views");return await I.get(e).then(i=>i.data.data?.files).catch(()=>null)}const ye={computed:{previewPath(){return this.getPreviewIfAny({fileid:this.fileid,filename:this.filename,previewUrl:this.previewUrl,hasPreview:this.hasPreview,davPath:this.davPath,etag:this.$attrs.etag})},davPath(){return S({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return Z(e)}}};var f={exports:{}},k;function Fe(){if(k)return f.exports;k=1;var e=J.platform==="win32",i=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,n={};function r(o){return i.exec(o).slice(1)}n.parse=function(o){if(typeof o!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof o);var a=r(o);if(!a||a.length!==5)throw new TypeError("Invalid path '"+o+"'");return{root:a[1],dir:a[0]===a[1]?a[0]:a[0].slice(0,-1),base:a[2],ext:a[4],name:a[3]}};var l=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,d={};function h(o){return l.exec(o).slice(1)}return d.parse=function(o){if(typeof o!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof o);var a=h(o);if(!a||a.length!==5)throw new TypeError("Invalid path '"+o+"'");return{root:a[1],dir:a[0].slice(0,-1),base:a[2],ext:a[4],name:a[3]}},e?f.exports=n.parse:f.exports=d.parse,f.exports.posix=d.parse,f.exports.win32=n.parse,f.exports}var be=Fe();const H=Y(be),_e={inheritAttrs:!1,mixins:[ye],props:{active:{type:Boolean,default:!1},basename:{type:String,required:!0},filename:{type:String,required:!0},source:{type:String,default:void 0},previewUrl:{type:String,default:void 0},hasPreview:{type:Boolean,default:!1},fileid:{type:[Number,String],required:!1},fileList:{type:Array,default:()=>[]},mime:{type:String,required:!0},canSwipe:{type:Boolean,default:!0},canZoom:{type:Boolean,default:!1},loaded:{type:Boolean,default:!1},isSidebarShown:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},metadataFilesLivePhoto:{type:Number,default:void 0}},data(){return{height:null,width:null,naturalHeight:null,naturalWidth:null,isLoaded:!1}},computed:{name(){return H(this.basename).name},ext(){return H(this.basename).ext},src(){return this.source??this.davPath}},watch:{active(e,i){e===!0&&i===!1&&this.isLoaded&&this.doneLoading()},isSidebarShown(){setTimeout(this.updateHeightWidth,200)}},mounted(){this.$el.addEventListener("error",e=>{console.error("Error loading",this.filename,e),this.$emit("error",e)}),window.addEventListener("resize",Q(()=>{this.updateHeightWidth()},100))},methods:{doneLoading(){this.$emit("update:loaded",!0),this.isLoaded=!0},updateHeightWidth(){const e=this.$parent.$el.querySelector(".modal-wrapper");if(e&&this.naturalHeight>0&&this.naturalWidth>0){const i=e.querySelector(".modal-container"),n=i.clientHeight,r=i.clientWidth,l=n/this.naturalHeight,d=r/this.naturalWidth;ld&&d<1?(this.width=r,this.height=Math.round(this.naturalHeight/this.naturalWidth*r)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}else this.height=this.naturalHeight,this.width=this.naturalWidth},enableSwipe(){this.$emit("update:canSwipe",!0)},disableSwipe(){this.$emit("update:canSwipe",!1)},toggleFullScreen(){this.isFullScreen?document.exitFullscreen():this.$el.requestFullscreen()}}},xe={name:"TrashCanOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ce=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon trash-can-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Se=[],Le=u(xe,Ce,Se,!1,null,null);const Ee=Le.exports,Ve={name:"TrayArrowDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ke=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon tray-arrow-down-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},He=[],Me=u(Ve,ke,He,!1,null,null);const Ie=Me.exports,Ae={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Oe=[],De=u(Ae,ze,Oe,!1,null,null);const Pe=De.exports,Be={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Te=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-exit-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Ne=[],$e=u(Be,Te,Ne,!1,null,null);const qe=$e.exports,Re={name:"PencilOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ge=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},We=[],Ke=u(Re,Ge,We,!1,null,null);const je=Ke.exports,Ue={name:"DockRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon dock-right-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M20 4H4A2 2 0 0 0 2 6V18A2 2 0 0 0 4 20H20A2 2 0 0 0 22 18V6A2 2 0 0 0 20 4M15 18H4V6H15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Je=[],Ye=u(Ue,Ze,Je,!1,null,null);const Qe=Ye.exports,Xe=()=>b(()=>import("./NcModal-DBcDnXsK.chunk.mjs").then(e=>e.as),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),et=()=>b(()=>import("./NcActionLink-DDQUkWaO.chunk.mjs"),__vite__mapDeps([7,8,4,9]),import.meta.url),tt=()=>b(()=>import("./NcActionButton-CGQjmg5B.chunk.mjs"),__vite__mapDeps([10,1,2,3,4,5,8,11]),import.meta.url),it=X({name:"Viewer",components:{Delete:Ee,DockRight:Qe,Download:Ie,Error:pe,Fullscreen:Pe,FullscreenExit:qe,NcActionButton:tt,NcActionLink:et,NcModal:Xe,Pencil:je},mixins:[ae,oe],data(){return{Viewer:OCA.Viewer,handlers:OCA.Viewer.availableHandlers,components:{},mimeGroups:{},registeredHandlers:{},currentIndex:0,previousFile:{},currentFile:{},comparisonFile:null,nextFile:{},fileList:[],sortingConfig:null,isLoaded:!1,initiated:!1,editing:!1,cancelRequestFile:()=>{},cancelRequestFolder:()=>{},sidebarPosition:0,isSidebarShown:!1,isFullscreenMode:!1,canSwipe:!0,isStandalone:!1,theme:null,lightBackdrop:null,root:y,handlerId:"",trapElements:[]}},computed:{downloadPath(){return this.currentFile.source??this.currentFile.davPath},hasPrevious(){return this.fileList.length>1&&(this.canLoop||!this.isStartOfList)},hasNext(){return this.fileList.length>1&&(this.canLoop||!this.isEndOfList)},file(){return this.Viewer.file},fileInfo(){return this.Viewer.fileInfo},comparisonFileInfo(){return this.Viewer.compareFileInfo},files(){return this.Viewer.files},enableSidebar(){return this.Viewer.enableSidebar},el(){return this.Viewer.el},loadMore(){return this.Viewer.loadMore},canLoop(){return this.Viewer.canLoop},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},hasPreviousFile(){return Object.keys(this.previousFile).length>0},hasNextFile(){return Object.keys(this.nextFile).length>0},isImage(){return["image/jpeg","image/png","image/webp"].includes(this.currentFile?.mime)},sidebarOpenFilePath(){try{return this.currentFile?.davPath?.split(se)[1]?.split("/")?.map(decodeURIComponent)?.join("/")}catch{return!1}},canDelete(){return this.currentFile?.permissions?.includes("D")},canDownload(){return this.comparisonFile?!1:this.currentFile&&de(this.currentFile)},canEdit(){return!this.isMobile&&this.canDownload&&this.currentFile?.permissions?.includes("W")&&this.isImage&&!this.comparisonFile&&(ne("core","config",[])["enable_non-accessible_features"]??!0)},modalClass(){return{"icon-loading":!this.currentFile.loaded&&!this.currentFile.failed,"theme--undefined":this.theme===null,"theme--dark":this.theme==="dark","theme--light":this.theme==="light","theme--default":this.theme==="default","image--fullscreen":this.isImage&&this.isFullscreenMode}},showComparison(){return!this.isMobile},contentClass(){return{"viewer--split":this.comparisonFile}},isSameFile(){return(e=null,i=null)=>!!(i&&i===this.currentFile.path&&!this.currentFile.source||i===this.currentFile.filename||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){s.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const n=document.querySelector(e);n?n.appendChild(i):s.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(s.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(s.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(s.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){if(!e||!Array.isArray(e)||e.length===0){s.warn("No files provided, skipping update");return}const i=e.findIndex(n=>n.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,s.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(!(!e||this.el)&&this.loadMore&&typeof this.loadMore=="function"){s.debug("Fetching additional files...");const i=await this.loadMore();Array.isArray(i)&&i.length>0&&this.fileList.push(...i)}}},beforeMount(){this.isStandalone=window.OCP?.Files===void 0,this.isStandalone&&s.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{window._oca_viewer_handlers&&window._oca_viewer_handlers.forEach(e=>{OCA.Viewer.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandlerAlias(e)}),this.isLoaded=!0,s.info(`${this.handlers.length} viewer handlers registered`,{handlers:this.handlers})}),window.addEventListener("resize",this.onResize)},mounted(){p("files:sidebar:opened",this.handleAppSidebarOpen),p("files:sidebar:closed",this.handleAppSidebarClose),p("files:node:updated",this.handleFileUpdated),p("viewer:trapElements:changed",this.handleTrapElementsChange),p("editor:toggle",this.toggleEditor),p("editor:file:created",this.handleNewFile),window.addEventListener("keydown",this.keyboardDeleteFile),window.addEventListener("keydown",this.keyboardDownloadFile),window.addEventListener("keydown",this.keyboardEditFile),this.addFullscreenEventListeners()},beforeDestroy(){window.removeEventListener("resize",this.onResize)},destroyed(){F("files:sidebar:opened",this.handleAppSidebarOpen),F("files:sidebar:closed",this.handleAppSidebarClose),F("viewer:trapElements:changed",this.handleTrapElementsChange),F("editor:toggle",this.toggleEditor),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{uniqueKey(e){return""+e.fileid+e.source},toggleEditor(e){ie(e),this.editing=e},preventContextMenu(e){this.canDownload||e.preventDefault()},async beforeOpen(){this.initiated=!0;const e=document.querySelector("aside.app-sidebar");e&&e.style.display!=="none"?(this.isSidebarShown=!0,this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e]):(this.isSidebarShown=!1,this.trapElements=[]),OCA?.Files?.Sidebar?.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await ge(),window.loadRoboto&&(s.debug("⚠️ Loading roboto font for visual regression tests"),b(()=>Promise.resolve({}),__vite__mapDeps([12]),import.meta.url),delete window.loadRoboto)},async openFile(e,i=null){if(await this.beforeOpen(),this.cancelRequestFile(),this.isSameFile(null,e)){s.debug("Viewer already opened with the same path, ignoring",{path:e});return}const{request:n,cancel:r}=V(re);this.cancelRequestFile=r;const[,l]=E(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const d=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];d&&!d.dataset.old&&l!==""&&(d.dataset.old=document.title,this.updateTitle(l));try{const h=await n(e);console.debug("File info for "+e+" fetched",h),await this.openFileInfo(h,i),!this.isStandalone&&this.canEdit&&window.OCP?.Files?.Router?.query?.editing==="true"&&this.toggleEditor(!0)}catch(h){h?.response?.status===404?(s.error("The file no longer exists, error: ",{error:h}),v(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,h)}},async handleNewFile(e){let i;try{i=te(e),this.openFile(i)}catch(n){s.error("Could not extract file path from source",{source:e,e:n})}try{const n=await fe("/"+i);x("files:node:created",n)}catch(n){s.error("Could not fetch new file",{path:i,e:n})}},async openFileInfo(e,i=null){if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e)){s.debug("Viewer already opened with the same fileInfo, ignoring",{fileInfo:e});return}const n=e.mime,r=n.split("/")[0];let l;if(i!==null&&(l=Object.values(this.registeredHandlers).find(o=>o.id===i)??l),l||(l=this.registeredHandlers[n]??this.registeredHandlers[r]),!l){s.error("The following file could not be displayed",{fileInfo:e}),v(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=l.theme??"dark";const d=window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark")!=="invert(100%)";this.lightBackdrop=l.theme==="light"||l.theme==="default"&&d,this.handlerId=l.id,this.currentFile=new w(e,n,l.component),this.comparisonFile=null,this.updatePreviousNext();const h=this.mimeGroups[n];if(this.files&&this.files.length>0)s.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(o=>o.filename===e.filename);else if(h&&this.el===null){const o=this.mimeGroups[h]?this.mimeGroups[h]:[n],{request:a,cancel:A}=V(we);this.cancelRequestFolder=A;const[z]=E(e.filename);this.currentIndex=0,this.fileList=[e];const L=(await a(z)).filter(c=>c.mime&&o.indexOf(c.mime)!==-1),O=L.map(c=>new _({source:y+m()+c.filename,id:c.fileid,displayname:c.displayname,mime:c.mime,mtime:new Date(c.lastmod),owner:this.currentFile.ownerId,root:m()})),D=ee(O,{sortingMode:this.sortingConfig.key,sortingOrder:this.sortingConfig.asc?"asc":"desc"}),P=new Map(L.map(c=>[c.filename,c]));this.fileList=D.map(c=>P.get(c.path)),this.currentIndex=this.fileList.findIndex(c=>c.filename===e.filename),this.updatePreviousNext()}else this.currentIndex=0,this.fileList=[e];this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new w(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new w(e,e.mime,this.components[e.mime])},changeSidebar(){this.isSidebarShown&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const n=e.mime;this.components[n]&&(this.previousFile=new w(e,n,this.components[n]))}else this.previousFile={};if(i){const n=i.mime;this.components[n]&&(this.nextFile=new w(i,n,this.components[n]))}else this.nextFile={}},updateTitle(e){document.title=`${e} - ${OCA.Theming?.name??oc_defaults.name}`},registerHandler(e){if(e.id&&Object.values(this.registeredHandlers).findIndex(i=>i.id===e.id)>-1){s.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){s.error("The following handler doesn't have a valid id",{handler:e});return}if(!(!(e.mimes&&Array.isArray(e.mimes))&&e.mimesAliases)){if(!(e.mimes&&Array.isArray(e.mimes))&&!e.mimesAliases){s.error("The following handler doesn't have a valid mime array",{handler:e});return}if(!e.component||typeof e.component!="object"&&typeof e.component!="function"){s.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...e?.component?.mixins??[],_e],e.mimes&&e.mimes.forEach(i=>{if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}this.registerGroups({mime:i,group:e.group}),this.components[i]=e.component,g.component(e.component.name,e.component),this.registeredHandlers[i]=e})}},registerHandlerAlias(e){e.mimesAliases&&Object.keys(e.mimesAliases).forEach(i=>{if(e.mimesAliases&&typeof e.mimesAliases!="object"){s.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const n=e.mimesAliases[i];if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[n]){s.error("The requested alias does not exists",{alias:n,mime:i,handler:e});return}this.registerGroups({mime:i,group:this.mimeGroups[n]}),this.components[i]=this.components[n],this.registeredHandlers[i]=e})},registerGroups({mime:e,group:i}){i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},close(){OCA.Viewer.close(),OCA?.Files?.Sidebar&&OCA.Files.Sidebar.setFullScreenMode(!1),this.isFullscreenMode&&this.exitFullscreen()},keyboardDeleteFile(e){this.canDelete&&e.key==="Delete"&&e.ctrlKey===!0&&this.onDelete()},keyboardDownloadFile(e){e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload&&this.onDownload())},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){s.info("Cleaning up viewer"),this.currentFile={},this.comparisonFile=null,this.currentModal=null,this.fileList=[],this.initiated=!1,this.theme=null,this.cancelRequestFile(),this.cancelRequestFolder(),document.body.style.overflow=null,document.documentElement.style.overflow=null,this.Viewer.onClose();const e=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];e&&e.dataset.old&&(document.title=e.dataset.old,delete e.dataset.old)},previous(){this.currentIndex--,this.currentIndex<0&&(this.currentIndex=this.fileList.length-1);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onPrev(e),this.updateTitle(this.currentFile.basename)},next(){this.currentIndex++,this.currentIndex>this.fileList.length-1&&(this.currentIndex=0);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onNext(e),this.updateTitle(this.currentFile.basename)},comparisonFailed(){this.comparisonFile.failed=!0},previousFailed(){this.previousFile.failed=!0},currentFailed(){this.currentFile.failed=!0},nextFailed(){this.nextFile.failed=!0},async showSidebar(){if(this.enableSidebar){const e=new _({source:y+m()+this.currentFile.filename,id:this.currentFile.fileid,displayname:this.currentFile.displayname,mime:this.currentFile.mime,mtime:new Date(this.currentFile.lastmod),owner:this.currentFile.ownerId,root:m()});x("viewer:sidebar:open",e),OCA?.Files?.Sidebar&&await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)}},handleAppSidebarOpen(){this.isSidebarShown=!0;const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e])},handleAppSidebarClose(){this.isSidebarShown=!1,this.trapElements=[]},async handleFileUpdated(e){const i=this.fileList.findIndex(({fileid:n})=>n===e.fileid);e.etag=e.attributes.etag,this.fileList.splice(i,1,e),e.fileid===this.currentFile.fileid&&(this.currentFile.etag=e.attributes.etag)},onResize(){const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left)},async onDelete(){try{const e=this.currentFile.fileid,i=this.currentFile.source??this.currentFile.davPath,n=i.includes("remote.php/dav"),r=new _({source:n?y+m()+this.currentFile.filename:i,id:e,mime:this.currentFile.mime,owner:this.currentFile.ownerId,root:n?m():void 0});await I.delete(i),x("files:node:deleted",r);const l=this.fileList.findIndex(d=>d.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasNext?this.next():this.previous(),this.fileList.splice(l,1)):this.close()}catch(e){console.error(e),v(e)}},onEdit(){this.toggleEditor(!0)},async onDownload(){if(!this.canDownload)return;const e=this.currentFile.mime,i=e?.split("/")[0],n=this.registeredHandlers[e]??this.registeredHandlers[i];if(n?.downloadCallback&&typeof n.downloadCallback=="function")try{s.debug("Calling handler downloadCallback before download"),await n.downloadCallback(this.currentFile)}catch(r){s.error("Failed to execute downloadCallback",{error:r}),v(t("viewer","Failed to save file before download"));return}this.performDownload()},performDownload(){s.debug("Performing download",{file:this.currentFile});const e=document.createElement("a");e.href=this.currentFile.source??this.currentFile.davPath,e.download=this.currentFile.basename,document.body.appendChild(e),e.click(),document.body.removeChild(e)},handleTrapElementsChange(e){this.trapElements.push(e)},toggleFullScreen(){this.isFullscreenMode?this.exitFullscreen():this.requestFullscreen()},requestFullscreen(){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},addFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},removeFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},onFullscreenchange(){document.fullscreenElement===document.documentElement||document.webkitFullscreenElement===document.documentElement?this.isFullscreenMode=!0:this.isFullscreenMode=!1}}});var nt=function(){var e=this,i=e._self._c;return e._self._setupProxy,e.el?i("div",{attrs:{id:"viewer","data-handler":e.handlerId}},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({key:e.uniqueKey(e.currentFile),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1):e.initiated||e.currentFile.modal?i("NcModal",{staticClass:"viewer",class:e.modalClass,style:{width:e.isSidebarShown?`${e.sidebarPosition}px`:null},attrs:{id:"viewer","additional-trap-elements":e.trapElements,"clear-view-delay":-1,"close-button-contained":!1,dark:!0,"light-backdrop":e.lightBackdrop,"data-handler":e.handlerId,"enable-slideshow":e.hasPrevious||e.hasNext,"slideshow-paused":e.editing,"enable-swipe":e.canSwipe&&!e.editing,"has-next":e.hasNext,"has-previous":e.hasPrevious,"inline-actions":e.canEdit?1:0,"spread-navigation":!0,name:e.currentFile.basename,size:"full"},on:{close:e.close,previous:e.previous,next:e.next},scopedSlots:e._u([{key:"actions",fn:function(){return[e.canEdit?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onEdit},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Pencil",{attrs:{size:20}})]},proxy:!0}],null,!1,580569589)},[e._v(" "+e._s(e.t("viewer","Edit"))+" ")]):e._e(),i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.toggleFullScreen},scopedSlots:e._u([{key:"icon",fn:function(){return[e.isFullscreenMode?i("FullscreenExit",{attrs:{size:20}}):i("Fullscreen",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "+e._s(e.isFullscreenMode?e.t("viewer","Exit full screen"):e.t("viewer","Full screen"))+" ")]),e.enableSidebar&&e.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":""},on:{click:e.showSidebar},scopedSlots:e._u([{key:"icon",fn:function(){return[i("DockRight",{attrs:{size:20}})]},proxy:!0}],null,!1,151993963)},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDownload},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:20}})]},proxy:!0}],null,!1,3312959228)},[e._v(" "+e._s(e.t("viewer","Download"))+" ")]):e._e(),e.canDelete?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDelete},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Delete",{attrs:{size:20}})]},proxy:!0}],null,!1,2705356561)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(n){return n.target!==n.currentTarget||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:e.close.apply(null,arguments)},contextmenu:e.preventContextMenu}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e.uniqueKey(e.comparisonFile),ref:"comparison-content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,editing:!1,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.comparisonFile.loaded},on:{"update:loaded":function(n){return e.$set(e.comparisonFile,"loaded",n)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.hasPreviousFile?i("div",{key:e.uniqueKey(e.previousFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.previousFile.failed?i("Error",{attrs:{name:e.previousFile.basename}}):i(e.previousFile.modal,e._b({ref:"previous-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.previousFailed}},"component",e.previousFile,!1))],1):e._e(),i("div",{key:e.uniqueKey(e.currentFile),staticClass:"viewer__file-wrapper"},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":e.canSwipe,"can-zoom":!0,editing:e.editing,"file-list":e.fileList,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.currentFile.loaded},on:{"update:canSwipe":function(n){e.canSwipe=n},"update:can-swipe":function(n){e.canSwipe=n},"update:editing":[function(n){e.editing=n},e.toggleEditor],"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.hasNextFile?i("div",{key:e.uniqueKey(e.nextFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.nextFile.failed?i("Error",{attrs:{name:e.nextFile.basename}}):i(e.nextFile.modal,e._b({ref:"next-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.nextFailed}},"component",e.nextFile,!1))],1):e._e()])]):e._e()},st=[],rt=u(it,nt,st,!1,null,"3a4e5460");const lt=rt.exports;g.mixin({methods:{t:le}}),g.prototype.OC=window.OC,g.prototype.OCA=window.OCA;const M=document.createElement("div");M.id="viewer",document.body.appendChild(M);const C=document.createElement("div");C.innerHTML='',C.style.display="none",document.body.appendChild(C),new g({el:"#viewer",name:"ViewerRoot",render:e=>e(lt)}); + `,details:!0},i))).data.map(K)}async function ge(){const e=await ve();if(!e)return{key:"basename",asc:!0};const i={mtime:"lastmod"}[e.sorting_mode]||e.sorting_mode||"basename",n=e.sorting_direction==="asc"||!e.sorting_direction;return{key:i,asc:n}}async function ve(){if(j())return null;const e=U("apps/files/api/v1/views");return await I.get(e).then(i=>i.data.data?.files).catch(()=>null)}const ye={computed:{previewPath(){return this.getPreviewIfAny({fileid:this.fileid,filename:this.filename,previewUrl:this.previewUrl,hasPreview:this.hasPreview,davPath:this.davPath,etag:this.$attrs.etag})},davPath(){return S({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return Z(e)}}};var f={exports:{}},V;function Fe(){if(V)return f.exports;V=1;var e=J.platform==="win32",i=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,n={};function r(o){return i.exec(o).slice(1)}n.parse=function(o){if(typeof o!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof o);var a=r(o);if(!a||a.length!==5)throw new TypeError("Invalid path '"+o+"'");return{root:a[1],dir:a[0]===a[1]?a[0]:a[0].slice(0,-1),base:a[2],ext:a[4],name:a[3]}};var l=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,d={};function h(o){return l.exec(o).slice(1)}return d.parse=function(o){if(typeof o!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof o);var a=h(o);if(!a||a.length!==5)throw new TypeError("Invalid path '"+o+"'");return{root:a[1],dir:a[0].slice(0,-1),base:a[2],ext:a[4],name:a[3]}},e?f.exports=n.parse:f.exports=d.parse,f.exports.posix=d.parse,f.exports.win32=n.parse,f.exports}var be=Fe();const k=Y(be),_e={inheritAttrs:!1,mixins:[ye],props:{active:{type:Boolean,default:!1},basename:{type:String,required:!0},filename:{type:String,required:!0},source:{type:String,default:void 0},previewUrl:{type:String,default:void 0},hasPreview:{type:Boolean,default:!1},fileid:{type:[Number,String],required:!1},fileList:{type:Array,default:()=>[]},mime:{type:String,required:!0},canSwipe:{type:Boolean,default:!0},canZoom:{type:Boolean,default:!1},loaded:{type:Boolean,default:!1},isSidebarShown:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},metadataFilesLivePhoto:{type:Number,default:void 0}},data(){return{height:null,width:null,naturalHeight:null,naturalWidth:null,isLoaded:!1}},computed:{name(){return k(this.basename).name},ext(){return k(this.basename).ext},src(){return this.source??this.davPath}},watch:{active(e,i){e===!0&&i===!1&&this.isLoaded&&this.doneLoading()},isSidebarShown(){setTimeout(this.updateHeightWidth,200)}},mounted(){this.$el.addEventListener("error",e=>{console.error("Error loading",this.filename,e),this.$emit("error",e)}),window.addEventListener("resize",Q(()=>{this.updateHeightWidth()},100))},methods:{doneLoading(){this.$emit("update:loaded",!0),this.isLoaded=!0},updateHeightWidth(){const e=this.$parent.$el.querySelector(".modal-wrapper");if(e&&this.naturalHeight>0&&this.naturalWidth>0){const i=e.querySelector(".modal-container"),n=i.clientHeight,r=i.clientWidth,l=n/this.naturalHeight,d=r/this.naturalWidth;ld&&d<1?(this.width=r,this.height=Math.round(this.naturalHeight/this.naturalWidth*r)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}else this.height=this.naturalHeight,this.width=this.naturalWidth},enableSwipe(){this.$emit("update:canSwipe",!0)},disableSwipe(){this.$emit("update:canSwipe",!1)},toggleFullScreen(){this.isFullScreen?document.exitFullscreen():this.$el.requestFullscreen()}}},xe={name:"TrashCanOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ce=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon trash-can-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Se=[],Le=u(xe,Ce,Se,!1,null,null);const Ee=Le.exports,He={name:"TrayArrowDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ve=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon tray-arrow-down-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},ke=[],Me=u(He,Ve,ke,!1,null,null);const Ie=Me.exports,Ae={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Oe=[],De=u(Ae,ze,Oe,!1,null,null);const Pe=De.exports,Be={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ne=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-exit-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Te=[],$e=u(Be,Ne,Te,!1,null,null);const qe=$e.exports,Re={name:"PencilOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ge=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},We=[],Ke=u(Re,Ge,We,!1,null,null);const je=Ke.exports,Ue={name:"DockRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon dock-right-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M20 4H4A2 2 0 0 0 2 6V18A2 2 0 0 0 4 20H20A2 2 0 0 0 22 18V6A2 2 0 0 0 20 4M15 18H4V6H15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Je=[],Ye=u(Ue,Ze,Je,!1,null,null);const Qe=Ye.exports,Xe=()=>b(()=>import("./NcModal-DBcDnXsK.chunk.mjs").then(e=>e.as),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),et=()=>b(()=>import("./NcActionLink-DDQUkWaO.chunk.mjs"),__vite__mapDeps([7,8,4,9]),import.meta.url),tt=()=>b(()=>import("./NcActionButton-CGQjmg5B.chunk.mjs"),__vite__mapDeps([10,1,2,3,4,5,8,11]),import.meta.url),it=X({name:"Viewer",components:{Delete:Ee,DockRight:Qe,Download:Ie,Error:pe,Fullscreen:Pe,FullscreenExit:qe,NcActionButton:tt,NcActionLink:et,NcModal:Xe,Pencil:je},mixins:[ae,oe],data(){return{Viewer:OCA.Viewer,handlers:OCA.Viewer.availableHandlers,components:{},mimeGroups:{},registeredHandlers:{},registeredHandlersCount:0,currentIndex:0,previousFile:{},currentFile:{},comparisonFile:null,nextFile:{},fileList:[],sortingConfig:null,isLoaded:!1,initiated:!1,editing:!1,cancelRequestFile:()=>{},cancelRequestFolder:()=>{},sidebarPosition:0,isSidebarShown:!1,isFullscreenMode:!1,canSwipe:!0,isStandalone:!1,theme:null,lightBackdrop:null,root:y,handlerId:"",trapElements:[]}},computed:{downloadPath(){return this.currentFile.source??this.currentFile.davPath},hasPrevious(){return this.fileList.length>1&&(this.canLoop||!this.isStartOfList)},hasNext(){return this.fileList.length>1&&(this.canLoop||!this.isEndOfList)},file(){return this.Viewer.file},fileInfo(){return this.Viewer.fileInfo},comparisonFileInfo(){return this.Viewer.compareFileInfo},files(){return this.Viewer.files},enableSidebar(){return this.Viewer.enableSidebar},el(){return this.Viewer.el},loadMore(){return this.Viewer.loadMore},canLoop(){return this.Viewer.canLoop},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},hasPreviousFile(){return Object.keys(this.previousFile).length>0},hasNextFile(){return Object.keys(this.nextFile).length>0},isImage(){return["image/jpeg","image/png","image/webp"].includes(this.currentFile?.mime)},sidebarOpenFilePath(){try{return this.currentFile?.davPath?.split(se)[1]?.split("/")?.map(decodeURIComponent)?.join("/")}catch{return!1}},canDelete(){return this.currentFile?.permissions?.includes("D")},canDownload(){return this.comparisonFile?!1:this.currentFile&&de(this.currentFile)},canEdit(){return!this.isMobile&&this.canDownload&&this.currentFile?.permissions?.includes("W")&&this.isImage&&!this.comparisonFile&&(ne("core","config",[])["enable_non-accessible_features"]??!0)},modalClass(){return{"icon-loading":!this.currentFile.loaded&&!this.currentFile.failed,"theme--undefined":this.theme===null,"theme--dark":this.theme==="dark","theme--light":this.theme==="light","theme--default":this.theme==="default","image--fullscreen":this.isImage&&this.isFullscreenMode}},showComparison(){return!this.isMobile},contentClass(){return{"viewer--split":this.comparisonFile}},isSameFile(){return(e=null,i=null)=>!!(i&&i===this.currentFile.path&&!this.currentFile.source||i===this.currentFile.filename||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){s.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const n=document.querySelector(e);n?n.appendChild(i):s.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(s.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(s.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(s.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){if(!e||!Array.isArray(e)||e.length===0){s.warn("No files provided, skipping update");return}const i=e.findIndex(n=>n.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,s.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(!(!e||this.el)&&this.loadMore&&typeof this.loadMore=="function"){s.debug("Fetching additional files...");const i=await this.loadMore();Array.isArray(i)&&i.length>0&&this.fileList.push(...i)}}},beforeMount(){this.isStandalone=window.OCP?.Files===void 0,this.isStandalone&&s.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{this.registerNewHandlers()}),window.addEventListener("resize",this.onResize)},mounted(){p("files:sidebar:opened",this.handleAppSidebarOpen),p("files:sidebar:closed",this.handleAppSidebarClose),p("files:node:updated",this.handleFileUpdated),p("viewer:trapElements:changed",this.handleTrapElementsChange),p("editor:toggle",this.toggleEditor),p("editor:file:created",this.handleNewFile),window.addEventListener("keydown",this.keyboardDeleteFile),window.addEventListener("keydown",this.keyboardDownloadFile),window.addEventListener("keydown",this.keyboardEditFile),this.addFullscreenEventListeners()},beforeDestroy(){window.removeEventListener("resize",this.onResize)},destroyed(){F("files:sidebar:opened",this.handleAppSidebarOpen),F("files:sidebar:closed",this.handleAppSidebarClose),F("viewer:trapElements:changed",this.handleTrapElementsChange),F("editor:toggle",this.toggleEditor),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{uniqueKey(e){return""+e.fileid+e.source},toggleEditor(e){ie(e),this.editing=e},preventContextMenu(e){this.canDownload||e.preventDefault()},async beforeOpen(){this.initiated=!0;const e=document.querySelector("aside.app-sidebar");e&&e.style.display!=="none"?(this.isSidebarShown=!0,this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e]):(this.isSidebarShown=!1,this.trapElements=[]),OCA?.Files?.Sidebar?.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await ge(),window.loadRoboto&&(s.debug("⚠️ Loading roboto font for visual regression tests"),b(()=>Promise.resolve({}),__vite__mapDeps([12]),import.meta.url),delete window.loadRoboto)},async openFile(e,i=null){if(await this.beforeOpen(),this.cancelRequestFile(),this.isSameFile(null,e)){s.debug("Viewer already opened with the same path, ignoring",{path:e});return}const{request:n,cancel:r}=H(re);this.cancelRequestFile=r;const[,l]=E(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const d=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];d&&!d.dataset.old&&l!==""&&(d.dataset.old=document.title,this.updateTitle(l));try{const h=await n(e);console.debug("File info for "+e+" fetched",h),await this.openFileInfo(h,i),!this.isStandalone&&this.canEdit&&window.OCP?.Files?.Router?.query?.editing==="true"&&this.toggleEditor(!0)}catch(h){h?.response?.status===404?(s.error("The file no longer exists, error: ",{error:h}),v(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,h)}},async handleNewFile(e){let i;try{i=te(e),this.openFile(i)}catch(n){s.error("Could not extract file path from source",{source:e,e:n})}try{const n=await fe("/"+i);x("files:node:created",n)}catch(n){s.error("Could not fetch new file",{path:i,e:n})}},async openFileInfo(e,i=null){if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e)){s.debug("Viewer already opened with the same fileInfo, ignoring",{fileInfo:e});return}this.registerNewHandlers();const n=e.mime,r=n.split("/")[0];let l;if(i!==null&&(l=Object.values(this.registeredHandlers).find(o=>o.id===i)??l),l||(l=this.registeredHandlers[n]??this.registeredHandlers[r]),!l){s.error("The following file could not be displayed",{fileInfo:e}),v(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=l.theme??"dark";const d=window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark")!=="invert(100%)";this.lightBackdrop=l.theme==="light"||l.theme==="default"&&d,this.handlerId=l.id,this.currentFile=new w(e,n,l.component),this.comparisonFile=null,this.updatePreviousNext();const h=this.mimeGroups[n];if(this.files&&this.files.length>0)s.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(o=>o.filename===e.filename);else if(h&&this.el===null){const o=this.mimeGroups[h]?this.mimeGroups[h]:[n],{request:a,cancel:A}=H(we);this.cancelRequestFolder=A;const[z]=E(e.filename);this.currentIndex=0,this.fileList=[e];const L=(await a(z)).filter(c=>c.mime&&o.indexOf(c.mime)!==-1),O=L.map(c=>new _({source:y+m()+c.filename,id:c.fileid,displayname:c.displayname,mime:c.mime,mtime:new Date(c.lastmod),owner:this.currentFile.ownerId,root:m()})),D=ee(O,{sortingMode:this.sortingConfig.key,sortingOrder:this.sortingConfig.asc?"asc":"desc"}),P=new Map(L.map(c=>[c.filename,c]));this.fileList=D.map(c=>P.get(c.path)),this.currentIndex=this.fileList.findIndex(c=>c.filename===e.filename),this.updatePreviousNext()}else this.currentIndex=0,this.fileList=[e];this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new w(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new w(e,e.mime,this.components[e.mime])},changeSidebar(){this.isSidebarShown&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const n=e.mime;this.components[n]&&(this.previousFile=new w(e,n,this.components[n]))}else this.previousFile={};if(i){const n=i.mime;this.components[n]&&(this.nextFile=new w(i,n,this.components[n]))}else this.nextFile={}},updateTitle(e){document.title=`${e} - ${OCA.Theming?.name??oc_defaults.name}`},registerNewHandlers(){window._oca_viewer_handlers&&window._oca_viewer_handlers.forEach(i=>{this.handlers.some(n=>n.id===i.id)||OCA.Viewer.registerHandler(i)});const e=this.handlers.slice(this.registeredHandlersCount);e.length!==0&&(this.registeredHandlersCount=this.handlers.length,e.forEach(i=>{this.registerHandler(i)}),e.forEach(i=>{this.registerHandlerAlias(i)}),this.isLoaded=!0,s.info(`${e.length} viewer handlers registered`,{handlers:e}))},registerHandler(e){if(e.id&&Object.values(this.registeredHandlers).findIndex(i=>i.id===e.id)>-1){s.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){s.error("The following handler doesn't have a valid id",{handler:e});return}if(!(!(e.mimes&&Array.isArray(e.mimes))&&e.mimesAliases)){if(!(e.mimes&&Array.isArray(e.mimes))&&!e.mimesAliases){s.error("The following handler doesn't have a valid mime array",{handler:e});return}if(!e.component||typeof e.component!="object"&&typeof e.component!="function"){s.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...e?.component?.mixins??[],_e],e.mimes&&e.mimes.forEach(i=>{if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}this.registerGroups({mime:i,group:e.group}),this.components[i]=e.component,g.component(e.component.name,e.component),this.registeredHandlers[i]=e})}},registerHandlerAlias(e){e.mimesAliases&&Object.keys(e.mimesAliases).forEach(i=>{if(e.mimesAliases&&typeof e.mimesAliases!="object"){s.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const n=e.mimesAliases[i];if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[n]){s.error("The requested alias does not exists",{alias:n,mime:i,handler:e});return}this.registerGroups({mime:i,group:this.mimeGroups[n]}),this.components[i]=this.components[n],this.registeredHandlers[i]=e})},registerGroups({mime:e,group:i}){i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},close(){OCA.Viewer.close(),OCA?.Files?.Sidebar&&OCA.Files.Sidebar.setFullScreenMode(!1),this.isFullscreenMode&&this.exitFullscreen()},keyboardDeleteFile(e){this.canDelete&&e.key==="Delete"&&e.ctrlKey===!0&&this.onDelete()},keyboardDownloadFile(e){e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload&&this.onDownload())},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){s.info("Cleaning up viewer"),this.currentFile={},this.comparisonFile=null,this.currentModal=null,this.fileList=[],this.initiated=!1,this.theme=null,this.cancelRequestFile(),this.cancelRequestFolder(),document.body.style.overflow=null,document.documentElement.style.overflow=null,this.Viewer.onClose();const e=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];e&&e.dataset.old&&(document.title=e.dataset.old,delete e.dataset.old)},previous(){this.currentIndex--,this.currentIndex<0&&(this.currentIndex=this.fileList.length-1);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onPrev(e),this.updateTitle(this.currentFile.basename)},next(){this.currentIndex++,this.currentIndex>this.fileList.length-1&&(this.currentIndex=0);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onNext(e),this.updateTitle(this.currentFile.basename)},comparisonFailed(){this.comparisonFile.failed=!0},previousFailed(){this.previousFile.failed=!0},currentFailed(){this.currentFile.failed=!0},nextFailed(){this.nextFile.failed=!0},async showSidebar(){if(this.enableSidebar){const e=new _({source:y+m()+this.currentFile.filename,id:this.currentFile.fileid,displayname:this.currentFile.displayname,mime:this.currentFile.mime,mtime:new Date(this.currentFile.lastmod),owner:this.currentFile.ownerId,root:m()});x("viewer:sidebar:open",e),OCA?.Files?.Sidebar&&await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)}},handleAppSidebarOpen(){this.isSidebarShown=!0;const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e])},handleAppSidebarClose(){this.isSidebarShown=!1,this.trapElements=[]},async handleFileUpdated(e){const i=this.fileList.findIndex(({fileid:n})=>n===e.fileid);e.etag=e.attributes.etag,this.fileList.splice(i,1,e),e.fileid===this.currentFile.fileid&&(this.currentFile.etag=e.attributes.etag)},onResize(){const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left)},async onDelete(){try{const e=this.currentFile.fileid,i=this.currentFile.source??this.currentFile.davPath,n=i.includes("remote.php/dav"),r=new _({source:n?y+m()+this.currentFile.filename:i,id:e,mime:this.currentFile.mime,owner:this.currentFile.ownerId,root:n?m():void 0});await I.delete(i),x("files:node:deleted",r);const l=this.fileList.findIndex(d=>d.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasNext?this.next():this.previous(),this.fileList.splice(l,1)):this.close()}catch(e){console.error(e),v(e)}},onEdit(){this.toggleEditor(!0)},async onDownload(){if(!this.canDownload)return;const e=this.currentFile.mime,i=e?.split("/")[0],n=this.registeredHandlers[e]??this.registeredHandlers[i];if(n?.downloadCallback&&typeof n.downloadCallback=="function")try{s.debug("Calling handler downloadCallback before download"),await n.downloadCallback(this.currentFile)}catch(r){s.error("Failed to execute downloadCallback",{error:r}),v(t("viewer","Failed to save file before download"));return}this.performDownload()},performDownload(){s.debug("Performing download",{file:this.currentFile});const e=document.createElement("a");e.href=this.currentFile.source??this.currentFile.davPath,e.download=this.currentFile.basename,document.body.appendChild(e),e.click(),document.body.removeChild(e)},handleTrapElementsChange(e){this.trapElements.push(e)},toggleFullScreen(){this.isFullscreenMode?this.exitFullscreen():this.requestFullscreen()},requestFullscreen(){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},addFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},removeFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},onFullscreenchange(){document.fullscreenElement===document.documentElement||document.webkitFullscreenElement===document.documentElement?this.isFullscreenMode=!0:this.isFullscreenMode=!1}}});var nt=function(){var e=this,i=e._self._c;return e._self._setupProxy,e.el?i("div",{attrs:{id:"viewer","data-handler":e.handlerId}},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({key:e.uniqueKey(e.currentFile),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1):e.initiated||e.currentFile.modal?i("NcModal",{staticClass:"viewer",class:e.modalClass,style:{width:e.isSidebarShown?`${e.sidebarPosition}px`:null},attrs:{id:"viewer","additional-trap-elements":e.trapElements,"clear-view-delay":-1,"close-button-contained":!1,dark:!0,"light-backdrop":e.lightBackdrop,"data-handler":e.handlerId,"enable-slideshow":e.hasPrevious||e.hasNext,"slideshow-paused":e.editing,"enable-swipe":e.canSwipe&&!e.editing,"has-next":e.hasNext,"has-previous":e.hasPrevious,"inline-actions":e.canEdit?1:0,"spread-navigation":!0,name:e.currentFile.basename,size:"full"},on:{close:e.close,previous:e.previous,next:e.next},scopedSlots:e._u([{key:"actions",fn:function(){return[e.canEdit?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onEdit},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Pencil",{attrs:{size:20}})]},proxy:!0}],null,!1,580569589)},[e._v(" "+e._s(e.t("viewer","Edit"))+" ")]):e._e(),i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.toggleFullScreen},scopedSlots:e._u([{key:"icon",fn:function(){return[e.isFullscreenMode?i("FullscreenExit",{attrs:{size:20}}):i("Fullscreen",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "+e._s(e.isFullscreenMode?e.t("viewer","Exit full screen"):e.t("viewer","Full screen"))+" ")]),e.enableSidebar&&e.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":""},on:{click:e.showSidebar},scopedSlots:e._u([{key:"icon",fn:function(){return[i("DockRight",{attrs:{size:20}})]},proxy:!0}],null,!1,151993963)},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDownload},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:20}})]},proxy:!0}],null,!1,3312959228)},[e._v(" "+e._s(e.t("viewer","Download"))+" ")]):e._e(),e.canDelete?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDelete},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Delete",{attrs:{size:20}})]},proxy:!0}],null,!1,2705356561)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(n){return n.target!==n.currentTarget||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:e.close.apply(null,arguments)},contextmenu:e.preventContextMenu}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e.uniqueKey(e.comparisonFile),ref:"comparison-content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,editing:!1,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.comparisonFile.loaded},on:{"update:loaded":function(n){return e.$set(e.comparisonFile,"loaded",n)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.hasPreviousFile?i("div",{key:e.uniqueKey(e.previousFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.previousFile.failed?i("Error",{attrs:{name:e.previousFile.basename}}):i(e.previousFile.modal,e._b({ref:"previous-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.previousFailed}},"component",e.previousFile,!1))],1):e._e(),i("div",{key:e.uniqueKey(e.currentFile),staticClass:"viewer__file-wrapper"},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":e.canSwipe,"can-zoom":!0,editing:e.editing,"file-list":e.fileList,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.currentFile.loaded},on:{"update:canSwipe":function(n){e.canSwipe=n},"update:can-swipe":function(n){e.canSwipe=n},"update:editing":[function(n){e.editing=n},e.toggleEditor],"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.hasNextFile?i("div",{key:e.uniqueKey(e.nextFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.nextFile.failed?i("Error",{attrs:{name:e.nextFile.basename}}):i(e.nextFile.modal,e._b({ref:"next-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.nextFailed}},"component",e.nextFile,!1))],1):e._e()])]):e._e()},st=[],rt=u(it,nt,st,!1,null,"b24bef65");const lt=rt.exports;g.mixin({methods:{t:le}}),g.prototype.OC=window.OC,g.prototype.OCA=window.OCA;const M=document.createElement("div");M.id="viewer",document.body.appendChild(M);const C=document.createElement("div");C.innerHTML='',C.style.display="none",document.body.appendChild(C),new g({el:"#viewer",name:"ViewerRoot",render:e=>e(lt)}); //# sourceMappingURL=viewer-main.mjs.map diff --git a/js/viewer-main.mjs.map b/js/viewer-main.mjs.map index c337f7f70..dd56f7197 100644 --- a/js/viewer-main.mjs.map +++ b/js/viewer-main.mjs.map @@ -1 +1 @@ -{"version":3,"mappings":";oUACA,MAAMA,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC3B,CACJ,CACA,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KACvB,CACJ,CACA,ECAO,SAASC,GAAYC,EAAoB,CAC/C,GAAIA,EAAS,aACZ,MAAO,GAKR,MAAMC,EAAkB,OAAOD,GAAU,iBAAoB,SAAW,KAAK,MAAMA,EAAS,iBAAmB,IAAI,EAAIA,GAAU,gBAEjI,OAAIC,GAAmBA,EAAgB,OAAS,EACrBA,EAAgB,KAAK,CAAC,CAAE,MAAAC,EAAO,IAAAC,CAAA,IAAUD,IAAU,eAAiBC,IAAQ,UAAU,GAEtF,QAAU,GAG9B,EACR,CChBA,MAAMC,EAAoB,SAASC,EAAS,CAC3C,MAAMC,EAAa,IAAI,gBAcvB,MAAO,CACN,QAPa,eAAeC,EAAKC,EAAS,CAC1C,OAAOH,EACNE,EACA,CAAE,GAAGC,EAAS,OAAQF,EAAW,MAAM,CAC1C,CACC,EAGC,OAAQ,IAAMA,EAAW,MAAK,CAChC,CACA,ECfAG,GAAA,CACA,aAEA,OACA,MACA,YACA,UACA,CACA,CACA,0SCdAC,GAAe,MAAOC,GAAiC,CACjDA,EAAK,WAAW,GAAG,IACvBA,EAAO,IAAIA,CAAI,IAEhB,MAAMC,EAASC,EAAA,EACTC,EAAkBC,EAAA,EAClBC,EAAS,MAAMJ,EAAO,KAAK,GAAGK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ACA,YACA,UACA,CACA,CACA,2nBChBAA,GAAA,CACA,yBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,+pBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,kmBChBAA,GAAA,CACA,yBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8uBChBAA,GAAA,CACA,qBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,imBCiLAqD,GAAA,IAAAC,EAAA,gDAAAC,KAAA,sDACAC,GAAA,IAAAF,EAAA,4FACAG,GAAA,IAAAH,EAAA,wGAEAtD,GAAA0D,EAAA,CACA,cAEA,YACA,OAAAC,GACA,UAAAC,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAP,GACA,aAAAD,GACA,QAAAH,GACA,OAAAY,EACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,sCAGA,cACA,cACA,sBAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,mBACA,KAAAC,EACA,aAEA,eACA,CACA,EAEA,UACA,eACA,wDACA,EACA,cACA,gCACA,kCACA,EACA,UACA,gCACA,gCACA,EACA,OACA,uBACA,EACA,WACA,2BACA,EACA,qBACA,kCACA,EACA,QACA,wBACA,EACA,gBACA,gCACA,EACA,KACA,qBACA,EACA,WACA,2BACA,EACA,UACA,0BACA,EACA,gBACA,4BACA,EACA,cACA,iDACA,EAEA,kBAEA,8CACA,EACA,cAEA,0CACA,E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L,EAAI,UAAU,GAAK,OAAO,GAC1BA,EAAI,UAAU,IAAM,OAAO,IAG3B,MAAMM,EAAa,SAAS,cAAc,KAAK,EAC/CA,EAAW,GAAK,SAChB,SAAS,KAAK,YAAYA,CAAU,EAIpC,MAAMC,EAAgB,SAAS,cAAc,KAAK,EAClDA,EAAc,UAAY,4pLAC1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIP,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQf,GAAKA,EAAEuB,EAAe,CAC/B,CAAC","names":["index","isFullscreenState","isMobileState","canDownload","fileInfo","shareAttributes","scope","key","CancelableRequest","request","controller","url","options","_sfc_main","fetchNode","path","client","getClient","propfindPayload","getDefaultPropfind","result","getRootPath","resultToNode","File","mime","component","data","getDavPath","getFileList","getDavNameSpaces","getDavProperties","genFileInfo","getSortingConfig","viewConfigs","getViewConfigs","asc","isPublicShare","generateUrl","axios","response","PreviewUrl","getPreviewIfAny","isWindows","process","splitWindowsRe","win32","win32SplitPath","filename","pathString","allParts","splitPathRe","posix","posixSplitPath","pathParseModule","Mime","parsePath","val","old","e","debounce","modalWrapper","modalContainer","parentHeight","parentWidth","heightRatio","widthRatio","NcModal","__vitePreload","n","NcActionLink","NcActionButton","defineComponent","Delete","DockRight","Download","Error","Fullscreen","FullscreenExit","Pencil","isFullscreen","isMobile","defaultRemoteURL","defaultRootPath","loadState","element","logger","viewerRoot","el","fileList","currentIndex","file","isEndOfList","list","handler","subscribe","unsubscribe","isOpen","toggleEditor","event","sidebar","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","source","extractFilePathFromSource","node","emit","alias","h","defaultThemeIsLight","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","nodes","NcFile","sortedNodes","sortNodes","filesByPath","prev","next","Vue","currentFileId","fileid","isDavResource","a","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[0,1,10,12,13,14,15,16,17],"sources":["../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.ts","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/services/FetchFile.ts","../src/models/file.js","../src/services/FileList.ts","../src/services/FileSortingConfig.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/TrashCanOutline.vue","../node_modules/vue-material-design-icons/TrayArrowDown.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/PencilOutline.vue","../node_modules/vue-material-design-icons/DockRight.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["import { isFullscreenState } from \"../Composables/useIsFullscreen.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n */\n isFullscreen() {\n return isFullscreenState.value;\n }\n }\n};\nexport {\n index as default\n};\n//# sourceMappingURL=isFullscreen.mjs.map\n","import { isMobileState } from \"../Composables/useIsMobile.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n */\n isMobile() {\n return isMobileState.value;\n }\n }\n};\nexport {\n index as default\n};\n//# sourceMappingURL=isMobile.mjs.map\n","/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileInfo } from './fileUtils'\n\n/**\n * Check if download permissions are granted for a file\n * @param fileInfo The file info to check\n */\nexport function canDownload(fileInfo: FileInfo) {\n\tif (fileInfo.hideDownload) {\n\t\treturn false\n\t}\n\n\t// TODO: This should probably be part of `@nextcloud/sharing`\n\t// check share attributes\n\tconst shareAttributes = typeof fileInfo?.shareAttributes === 'string' ? JSON.parse(fileInfo.shareAttributes || '[]') : fileInfo?.shareAttributes\n\n\tif (shareAttributes && shareAttributes.length > 0) {\n\t\tconst downloadAttribute = shareAttributes.find(({ scope, key }) => scope === 'permissions' && key === 'download')\n\t\t// We only forbid download if the attribute is *explicitly* set to 'false'\n\t\treturn downloadAttribute?.value !== false\n\t}\n\t// otherwise return true (as the file needs read permission otherwise we would not have opened it)\n\treturn true\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Creates a cancelable axios 'request object'.\n *\n * @param {Function} request the axios promise request\n * @return {object}\n */\nconst CancelableRequest = function(request) {\n\tconst controller = new AbortController()\n\n\t/**\n\t * Execute the request\n\t *\n\t * @param {string} url the url to send the request to\n\t * @param {object} [options] optional config for the request\n\t */\n\tconst fetch = async function(url, options) {\n\t\treturn request(\n\t\t\turl,\n\t\t\t{ ...options, signal: controller.signal },\n\t\t)\n\t}\n\treturn {\n\t\trequest: fetch,\n\t\tcancel: () => controller.abort(),\n\t}\n}\n\nexport default CancelableRequest\n","\n\n\n\n\n\n\n","/*\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getClient, getDefaultPropfind, getRootPath, resultToNode } from '@nextcloud/files/dav'\n\nexport default async (path: string): Promise => {\n\tif (!path.startsWith('/')) {\n\t\tpath = `/${path}`\n\t}\n\tconst client = getClient()\n\tconst propfindPayload = getDefaultPropfind()\n\tconst result = await client.stat(`${getRootPath()}${path}`, {\n\t\tdetails: true,\n\t\tdata: propfindPayload,\n\t}) as ResponseDataDetailed\n\treturn resultToNode(result.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getDavPath } from '../utils/fileUtils.ts'\n\n/**\n * @param {object} fileInfo a FileInfo object\n * @param {string} mime the file mime type\n * @param {object} component the component to render\n */\nexport default function(fileInfo, mime, component) {\n\tconst data = {\n\t\tmime,\n\t\tmodal: component,\n\t\tfailed: false,\n\t\tloaded: false,\n\t\tdavPath: getDavPath(fileInfo),\n\t\tsource: fileInfo.source ?? getDavPath(fileInfo),\n\t}\n\n\treturn Object.assign({}, fileInfo, data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files/dav'\nimport { client } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\tconst response = await client.getDirectoryContents(path, Object.assign({\n\t\tdata: `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${getDavProperties()}\n\t\t\t\t\n\t\t\t`,\n\t\tdetails: true,\n\t}, options)) as ResponseDataDetailed\n\n\treturn response.data.map(genFileInfo)\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport { isPublicShare } from '@nextcloud/sharing/public'\n\n/**\n * @return {object}\n */\nexport default async function getSortingConfig() {\n\tconst viewConfigs = await getViewConfigs()\n\n\tif (!viewConfigs) {\n\t\treturn { key: 'basename', asc: true }\n\t}\n\n\tconst keyMap = { mtime: 'lastmod' }\n\tconst key = keyMap[viewConfigs.sorting_mode] || viewConfigs.sorting_mode || 'basename'\n\tconst asc = viewConfigs.sorting_direction === 'asc' || !viewConfigs.sorting_direction\n\n\treturn { key, asc }\n}\n\n/**\n * @return {object}\n */\nasync function getViewConfigs() {\n\tif (isPublicShare()) {\n\t\treturn null\n\t}\n\tconst url = generateUrl('apps/files/api/v1/views')\n\treturn await axios.get(url)\n\t\t.then((response) => {\n\t\t\treturn response.data.data?.files\n\t\t})\n\t\t.catch(() => {\n\t\t\treturn null\n\t\t})\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getPreviewIfAny } from '../utils/previewUtils.ts'\nimport { getDavPath } from '../utils/fileUtils.ts'\n\nexport default {\n\tcomputed: {\n\t\t/**\n\t\t * Link to the preview path if the file have a preview\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tpreviewPath() {\n\t\t\treturn this.getPreviewIfAny({\n\t\t\t\tfileid: this.fileid,\n\t\t\t\tfilename: this.filename,\n\t\t\t\tpreviewUrl: this.previewUrl,\n\t\t\t\thasPreview: this.hasPreview,\n\t\t\t\tdavPath: this.davPath,\n\t\t\t\tetag: this.$attrs.etag,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Absolute dav remote path of the file\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tdavPath() {\n\t\t\treturn getDavPath({\n\t\t\t\tfilename: this.filename,\n\t\t\t\tbasename: this.basename,\n\t\t\t})\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Return the preview url if the file have an existing\n\t\t * preview or the absolute dav remote path if none.\n\t\t *\n\t\t * @param {object} data destructuring object\n\t\t * @param {string} data.fileid the file id\n\t\t * @param {string} [data.previewUrl] URL of the file preview\n\t\t * @param {boolean} data.hasPreview have the file an existing preview ?\n\t\t * @param {string} data.davPath the absolute dav path\n\t\t * @param {string} data.filename the file name\n\t\t * @param {string|null} data.etag the etag of the file\n\t\t * @return {string} the absolute url\n\t\t */\n\t\tgetPreviewIfAny(data) {\n\t\t\treturn getPreviewIfAny(data)\n\t\t},\n\t},\n}\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into into [dir, root, basename, name, ext]\nvar splitWindowsRe =\n /^(((?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?[\\\\\\/]?)(?:[^\\\\\\/]*[\\\\\\/])*)((\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))[\\\\\\/]*$/;\n\nvar win32 = {};\n\nfunction win32SplitPath(filename) {\n return splitWindowsRe.exec(filename).slice(1);\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[1],\n dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3]\n };\n};\n\n\n\n// Split a filename into [dir, root, basename, name, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^((\\/?)(?:[^\\/]*\\/)*)((\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))[\\/]*$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n \n return {\n root: allParts[1],\n dir: allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3],\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport debounce from 'debounce'\nimport PreviewUrl from '../mixins/PreviewUrl.js'\nimport parsePath from 'path-parse'\n\nexport default {\n\tinheritAttrs: false,\n\tmixins: [PreviewUrl],\n\tprops: {\n\t\t// Is the current component shown\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// file name\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file path relative to user folder\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file source to fetch contents from\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// URL the file preview\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// should the standard core preview be used?\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// unique file id\n\t\tfileid: {\n\t\t\ttype: [Number, String],\n\t\t\trequired: false,\n\t\t},\n\t\t// list of all the visible files\n\t\tfileList: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t// file mime (aliased if specified in the model)\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// can the user swipe\n\t\tcanSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tcanZoom: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the content loaded?\n\t\t// synced with parent\n\t\tloaded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the sidebar currently opened ?\n\t\tisSidebarShown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// are we in fullscreen mode ?\n\t\tisFullScreen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// The file id of the peer live photo file\n\t\tmetadataFilesLivePhoto: {\n\t\t\ttype: Number,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\theight: null,\n\t\t\twidth: null,\n\t\t\tnaturalHeight: null,\n\t\t\tnaturalWidth: null,\n\t\t\tisLoaded: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tname() {\n\t\t\treturn parsePath(this.basename).name\n\t\t},\n\t\text() {\n\t\t\treturn parsePath(this.basename).ext\n\t\t},\n\t\tsrc() {\n\t\t\treturn this.source ?? this.davPath\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(val, old) {\n\t\t\t// the item was hidden before and is now the current view\n\t\t\tif (val === true && old === false) {\n\t\t\t\t// just in case the file was preloaded, let's warn the viewer\n\t\t\t\tif (this.isLoaded) {\n\t\t\t\t\tthis.doneLoading()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// update image size on sidebar toggle\n\t\tisSidebarShown() {\n\t\t\t// wait for transition to complete (100ms)\n\t\t\tsetTimeout(this.updateHeightWidth, 200)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// detect error and let the viewer know\n\t\tthis.$el.addEventListener('error', e => {\n\t\t\tconsole.error('Error loading', this.filename, e)\n\t\t\tthis.$emit('error', e)\n\t\t})\n\n\t\t// update image size on window resize\n\t\twindow.addEventListener('resize', debounce(() => {\n\t\t\tthis.updateHeightWidth()\n\t\t}, 100))\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * This is used to make the viewer know this file is complete or ready\n\t\t * ! you NEED to use it to make the viewer aware of the current loading state\n\t\t */\n\t\tdoneLoading() {\n\t\t\t// send the current state\n\t\t\tthis.$emit('update:loaded', true)\n\t\t\t// save the current state\n\t\t\tthis.isLoaded = true\n\t\t},\n\n\t\t/**\n\t\t * Updates the current height and width data\n\t\t * based on the viewer maximum size\n\t\t */\n\t\tupdateHeightWidth() {\n\t\t\tconst modalWrapper = this.$parent.$el.querySelector('.modal-wrapper')\n\t\t\tif (modalWrapper && this.naturalHeight > 0 && this.naturalWidth > 0) {\n\t\t\t\tconst modalContainer = modalWrapper.querySelector('.modal-container')\n\n\t\t\t\tconst parentHeight = modalContainer.clientHeight\n\t\t\t\tconst parentWidth = modalContainer.clientWidth\n\n\t\t\t\tconst heightRatio = parentHeight / this.naturalHeight\n\t\t\t\tconst widthRatio = parentWidth / this.naturalWidth\n\n\t\t\t\t// if the video height is capped by the parent height\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\tif (heightRatio < widthRatio && heightRatio < 1) {\n\t\t\t\t\tthis.height = parentHeight\n\t\t\t\t\tthis.width = Math.round(this.naturalWidth / this.naturalHeight * parentHeight)\n\n\t\t\t\t// if the video width is capped by the parent width\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\t} else if (heightRatio > widthRatio && widthRatio < 1) {\n\t\t\t\t\tthis.width = parentWidth\n\t\t\t\t\tthis.height = Math.round(this.naturalHeight / this.naturalWidth * parentWidth)\n\n\t\t\t\t// RESET\n\t\t\t\t} else {\n\t\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\t\tthis.width = this.naturalWidth\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\tthis.width = this.naturalWidth\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enable the viewer swiping previous/next capability\n\t\t */\n\t\tenableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', true)\n\t\t},\n\n\t\t/**\n\t\t * Disable the viewer swiping previous/next capability\n\t\t */\n\t\tdisableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', false)\n\t\t},\n\n\t\t/**\n\t\t * Toggle the fullscreen on the current visible element\n\t\t */\n\t\ttoggleFullScreen() {\n\t\t\tif (this.isFullScreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else {\n\t\t\t\tthis.$el.requestFullscreen()\n\t\t\t}\n\t\t},\n\t},\n}\n","\n\n","\n\n","\n\n","\n\n","\n\n","\n\n","\n\n\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { translate as t } from '@nextcloud/l10n'\nimport Vue from 'vue'\n\nimport ViewerComponent from './views/Viewer.vue'\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nVue.prototype.OC = window.OC\nVue.prototype.OCA = window.OCA\n\n// Create document root\nconst ViewerRoot = document.createElement('div')\nViewerRoot.id = 'viewer'\ndocument.body.appendChild(ViewerRoot)\n\n// Put controls for video viewer\n// Needed as Firefox CSP blocks the loading of the svg through the normal plyr system\nconst VideoControls = document.createElement('div')\nVideoControls.innerHTML = PLYR_ICONS\nVideoControls.style.display = 'none'\ndocument.body.appendChild(VideoControls)\n\n// Init vue\nexport default new Vue({\n\tel: '#viewer',\n\t// When debugging the page, it's easier to find which app\n\t// is which. Especially when there is multiple apps\n\t// roots mounted o the same page!\n\t// eslint-disable-next-line vue/match-component-file-name\n\tname: 'ViewerRoot',\n\trender: h => h(ViewerComponent),\n})\n"],"file":"viewer-main.mjs"} \ No newline at end of file +{"version":3,"mappings":";oUACA,MAAMA,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC3B,CACJ,CACA,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KACvB,CACJ,CACA,ECAO,SAASC,GAAYC,EAAoB,CAC/C,GAAIA,EAAS,aACZ,MAAO,GAKR,MAAMC,EAAkB,OAAOD,GAAU,iBAAoB,SAAW,KAAK,MAAMA,EAAS,iBAAmB,IAAI,EAAIA,GAAU,gBAEjI,OAAIC,GAAmBA,EAAgB,OAAS,EACrBA,EAAgB,KAAK,CAAC,CAAE,MAAAC,EAAO,IAAAC,CAAA,IAAUD,IAAU,eAAiBC,IAAQ,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E,EAAcC,GAAcA,EAAa,GACnD,KAAK,MAAQF,EACb,KAAK,OAAS,KAAK,MAAM,KAAK,cAAgB,KAAK,aAAeA,CAAW,IAI7E,KAAK,OAAS,KAAK,cACnB,KAAK,MAAQ,KAAK,aAEpB,MACC,KAAK,OAAS,KAAK,cACnB,KAAK,MAAQ,KAAK,YAEpB,EAKA,aAAc,CACb,KAAK,MAAM,kBAAmB,EAAI,CACnC,EAKA,cAAe,CACd,KAAK,MAAM,kBAAmB,EAAK,CACpC,EAKA,kBAAmB,CACd,KAAK,aACR,SAAS,eAAc,EAEvB,KAAK,IAAI,kBAAiB,CAE5B,CACF,CACA,ECrMAlD,GAAA,CACA,2BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,2nBChBAA,GAAA,CACA,yBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,+pBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,kmBChBAA,GAAA,CACA,yBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8uBChBAA,GAAA,CACA,qBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,imBCiLAqD,GAAA,IAAAC,EAAA,gDAAAC,KAAA,sDACAC,GAAA,IAAAF,EAAA,4FACAG,GAAA,IAAAH,EAAA,wGAEAtD,GAAA0D,EAAA,CACA,cAEA,YACA,OAAAC,GACA,UAAAC,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAP,GACA,aAAAD,GACA,QAAAH,GACA,OAAAY,EACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,sCAGA,cACA,cACA,sBACA,0BAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,mBACA,KAAAC,EACA,aAEA,eACA,CACA,EAEA,UACA,eACA,wDACA,EACA,cACA,gCACA,kCACA,EACA,UACA,gCACA,gCACA,EACA,OACA,uBACA,EACA,WACA,2BACA,EACA,qBACA,kCACA,EACA,QACA,wBACA,EACA,gBACA,gCACA,EACA,KACA,qBACA,EACA,WACA,2BACA,EACA,UACA,0BACA,EACA,gBACA,4BACA,EACA,cACA,iDACA,EAEA,kBAEA,8CACA,EACA,cAEA,0CACA,EAEA,UACA,8EACA,EAEA,sBACA,IAEA,OADA,iCAAAC,EAAA,MACA,8CACA,OACA,QACA,CACA,EAOA,YACA,mDACA,EAOA,cAEA,2BACA,GAEA,kBAAA/E,GAAA,iBACA,EAQA,UACA,sBACA,kBACA,8CACA,cACA,uBACAgF,GAAA,0DACA,EAEA,aACA,OACA,kEACA,qCACA,kCACA,oCACA,wCACA,uDACA,CACA,EAEA,iBACA,oBACA,EAEA,eACA,OACA,mCACA,CACA,EAEA,aACA,OAAA/E,EAAA,KAAAW,EAAA,OAEA,GAAAA,OAAA,uBACA,0BAKAA,IAAA,2BAMAX,KAAA,kCACAA,EAAA,OAAAA,EAAA,gCACAA,EAAA,QAAAA,EAAA,iCAOA,CACA,EAEA,OACA,GAAAgF,EAAA,CACAC,EAAA,KAAAD,CAAA,EACA,oBACA,MAAAE,EAAA,kCACA,GAAAF,EAAA,CACA,MAAAG,EAAA,uBAAAH,CAAA,EACAG,EACAA,EAAA,YAAAD,CAAA,EAEAD,EAAA,wCAAAD,CAAA,EAEA,MACA,0BAAAE,CAAA,CAEA,EACA,EAEA,KAAAvE,EAAA,CAEAA,KAAA,aACAsE,EAAA,sCAAAtE,CAAA,GACA,cAAAA,E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AC,GAAA,yBAAAA,EAAA,6BACA,IACA7B,EAAA,0DACA,MAAA6B,EAAA,kCACA,OAAAP,EAAA,CACAtB,EAAA,kDAAAsB,CAAA,GACAC,EAAA,mDACA,MACA,CAGA,sBACA,EAEA,kBACAvB,EAAA,qDACA,MAAAkD,EAAA,4BACAA,EAAA,uDACAA,EAAA,mCACA,0BAAAA,CAAA,EACAA,EAAA,QACA,0BAAAA,CAAA,CACA,EAEA,yBAAAnD,EAAA,CACA,uBAAAA,CAAA,CACA,EAMA,mBACA,sBACA,sBAEA,wBAEA,EAEA,oBACA,MAAAG,EAAA,yBACAA,EAAA,kBACAA,EAAA,oBACAA,EAAA,yBACAA,EAAA,yBAEA,EAEA,iBACA,wBACA,0BACA,+BACA,+BAEA,EAEA,8BACA,sEACA,2EACA,EAEA,iCACA,sEACA,2EACA,EAEA,qBACA,uDACA,4DACA,yBAEA,wBAEA,CAEA,CACA,0iKC7xCA4C,EAAI,MAAM,CACT,QAAS,CACV,EAAEK,EACF,CACA,CAAC,EAEDL,EAAI,UAAU,GAAK,OAAO,GAC1BA,EAAI,UAAU,IAAM,OAAO,IAG3B,MAAMM,EAAa,SAAS,cAAc,KAAK,EAC/CA,EAAW,GAAK,SAChB,SAAS,KAAK,YAAYA,CAAU,EAIpC,MAAMC,EAAgB,SAAS,cAAc,KAAK,EAClDA,EAAc,UAAY,4pLAC1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIP,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQhB,GAAKA,EAAEwB,EAAe,CAC/B,CAAC","names":["index","isFullscreenState","isMobileState","canDownload","fileInfo","shareAttributes","scope","key","CancelableRequest","request","controller","url","options","_sfc_main","fetchNode","path","client","getClient","propfindPayload","getDefaultPropfind","result","getRootPath","resultToNode","File","mime","component","data","getDavPath","getFileList","getDavNameSpaces","getDavProperties","genFileInfo","getSortingConfig","viewConfigs","getViewConfigs","asc","isPublicShare","generateUrl","axios","response","PreviewUrl","getPreviewIfAny","isWindows","process","splitWindowsRe","win32","win32SplitPath","filename","pathString","allParts","splitPathRe","posix","posixSplitPath","pathParseModule","Mime","parsePath","val","old","e","debounce","modalWrapper","modalContainer","parentHeight","parentWidth","heightRatio","widthRatio","NcModal","__vitePreload","n","NcActionLink","NcActionButton","defineComponent","Delete","DockRight","Download","Error","Fullscreen","FullscreenExit","Pencil","isFullscreen","isMobile","defaultRemoteURL","defaultRootPath","loadState","element","logger","viewerRoot","el","fileList","currentIndex","file","isEndOfList","list","subscribe","unsubscribe","isOpen","toggleEditor","event","sidebar","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","source","extractFilePathFromSource","node","emit","alias","handler","h","defaultThemeIsLight","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","nodes","NcFile","sortedNodes","sortNodes","filesByPath","prev","next","newHandlers","Vue","currentFileId","fileid","isDavResource","a","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[0,1,10,12,13,14,15,16,17],"sources":["../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.ts","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/services/FetchFile.ts","../src/models/file.js","../src/services/FileList.ts","../src/services/FileSortingConfig.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/TrashCanOutline.vue","../node_modules/vue-material-design-icons/TrayArrowDown.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/PencilOutline.vue","../node_modules/vue-material-design-icons/DockRight.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["import { isFullscreenState } from \"../Composables/useIsFullscreen.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n */\n isFullscreen() {\n return isFullscreenState.value;\n }\n }\n};\nexport {\n index as default\n};\n//# sourceMappingURL=isFullscreen.mjs.map\n","import { isMobileState } from \"../Composables/useIsMobile.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n */\n isMobile() {\n return isMobileState.value;\n }\n }\n};\nexport {\n index as default\n};\n//# sourceMappingURL=isMobile.mjs.map\n","/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileInfo } from './fileUtils'\n\n/**\n * Check if download permissions are granted for a file\n * @param fileInfo The file info to check\n */\nexport function canDownload(fileInfo: FileInfo) {\n\tif (fileInfo.hideDownload) {\n\t\treturn false\n\t}\n\n\t// TODO: This should probably be part of `@nextcloud/sharing`\n\t// check share attributes\n\tconst shareAttributes = typeof fileInfo?.shareAttributes === 'string' ? JSON.parse(fileInfo.shareAttributes || '[]') : fileInfo?.shareAttributes\n\n\tif (shareAttributes && shareAttributes.length > 0) {\n\t\tconst downloadAttribute = shareAttributes.find(({ scope, key }) => scope === 'permissions' && key === 'download')\n\t\t// We only forbid download if the attribute is *explicitly* set to 'false'\n\t\treturn downloadAttribute?.value !== false\n\t}\n\t// otherwise return true (as the file needs read permission otherwise we would not have opened it)\n\treturn true\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Creates a cancelable axios 'request object'.\n *\n * @param {Function} request the axios promise request\n * @return {object}\n */\nconst CancelableRequest = function(request) {\n\tconst controller = new AbortController()\n\n\t/**\n\t * Execute the request\n\t *\n\t * @param {string} url the url to send the request to\n\t * @param {object} [options] optional config for the request\n\t */\n\tconst fetch = async function(url, options) {\n\t\treturn request(\n\t\t\turl,\n\t\t\t{ ...options, signal: controller.signal },\n\t\t)\n\t}\n\treturn {\n\t\trequest: fetch,\n\t\tcancel: () => controller.abort(),\n\t}\n}\n\nexport default CancelableRequest\n","\n\n\n\n\n\n\n","/*\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getClient, getDefaultPropfind, getRootPath, resultToNode } from '@nextcloud/files/dav'\n\nexport default async (path: string): Promise => {\n\tif (!path.startsWith('/')) {\n\t\tpath = `/${path}`\n\t}\n\tconst client = getClient()\n\tconst propfindPayload = getDefaultPropfind()\n\tconst result = await client.stat(`${getRootPath()}${path}`, {\n\t\tdetails: true,\n\t\tdata: propfindPayload,\n\t}) as ResponseDataDetailed\n\treturn resultToNode(result.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getDavPath } from '../utils/fileUtils.ts'\n\n/**\n * @param {object} fileInfo a FileInfo object\n * @param {string} mime the file mime type\n * @param {object} component the component to render\n */\nexport default function(fileInfo, mime, component) {\n\tconst data = {\n\t\tmime,\n\t\tmodal: component,\n\t\tfailed: false,\n\t\tloaded: false,\n\t\tdavPath: getDavPath(fileInfo),\n\t\tsource: fileInfo.source ?? getDavPath(fileInfo),\n\t}\n\n\treturn Object.assign({}, fileInfo, data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files/dav'\nimport { client } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\tconst response = await client.getDirectoryContents(path, Object.assign({\n\t\tdata: `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${getDavProperties()}\n\t\t\t\t\n\t\t\t`,\n\t\tdetails: true,\n\t}, options)) as ResponseDataDetailed\n\n\treturn response.data.map(genFileInfo)\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport { isPublicShare } from '@nextcloud/sharing/public'\n\n/**\n * @return {object}\n */\nexport default async function getSortingConfig() {\n\tconst viewConfigs = await getViewConfigs()\n\n\tif (!viewConfigs) {\n\t\treturn { key: 'basename', asc: true }\n\t}\n\n\tconst keyMap = { mtime: 'lastmod' }\n\tconst key = keyMap[viewConfigs.sorting_mode] || viewConfigs.sorting_mode || 'basename'\n\tconst asc = viewConfigs.sorting_direction === 'asc' || !viewConfigs.sorting_direction\n\n\treturn { key, asc }\n}\n\n/**\n * @return {object}\n */\nasync function getViewConfigs() {\n\tif (isPublicShare()) {\n\t\treturn null\n\t}\n\tconst url = generateUrl('apps/files/api/v1/views')\n\treturn await axios.get(url)\n\t\t.then((response) => {\n\t\t\treturn response.data.data?.files\n\t\t})\n\t\t.catch(() => {\n\t\t\treturn null\n\t\t})\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getPreviewIfAny } from '../utils/previewUtils.ts'\nimport { getDavPath } from '../utils/fileUtils.ts'\n\nexport default {\n\tcomputed: {\n\t\t/**\n\t\t * Link to the preview path if the file have a preview\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tpreviewPath() {\n\t\t\treturn this.getPreviewIfAny({\n\t\t\t\tfileid: this.fileid,\n\t\t\t\tfilename: this.filename,\n\t\t\t\tpreviewUrl: this.previewUrl,\n\t\t\t\thasPreview: this.hasPreview,\n\t\t\t\tdavPath: this.davPath,\n\t\t\t\tetag: this.$attrs.etag,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Absolute dav remote path of the file\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tdavPath() {\n\t\t\treturn getDavPath({\n\t\t\t\tfilename: this.filename,\n\t\t\t\tbasename: this.basename,\n\t\t\t})\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Return the preview url if the file have an existing\n\t\t * preview or the absolute dav remote path if none.\n\t\t *\n\t\t * @param {object} data destructuring object\n\t\t * @param {string} data.fileid the file id\n\t\t * @param {string} [data.previewUrl] URL of the file preview\n\t\t * @param {boolean} data.hasPreview have the file an existing preview ?\n\t\t * @param {string} data.davPath the absolute dav path\n\t\t * @param {string} data.filename the file name\n\t\t * @param {string|null} data.etag the etag of the file\n\t\t * @return {string} the absolute url\n\t\t */\n\t\tgetPreviewIfAny(data) {\n\t\t\treturn getPreviewIfAny(data)\n\t\t},\n\t},\n}\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into into [dir, root, basename, name, ext]\nvar splitWindowsRe =\n /^(((?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?[\\\\\\/]?)(?:[^\\\\\\/]*[\\\\\\/])*)((\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))[\\\\\\/]*$/;\n\nvar win32 = {};\n\nfunction win32SplitPath(filename) {\n return splitWindowsRe.exec(filename).slice(1);\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[1],\n dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3]\n };\n};\n\n\n\n// Split a filename into [dir, root, basename, name, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^((\\/?)(?:[^\\/]*\\/)*)((\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))[\\/]*$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n \n return {\n root: allParts[1],\n dir: allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3],\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport debounce from 'debounce'\nimport PreviewUrl from '../mixins/PreviewUrl.js'\nimport parsePath from 'path-parse'\n\nexport default {\n\tinheritAttrs: false,\n\tmixins: [PreviewUrl],\n\tprops: {\n\t\t// Is the current component shown\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// file name\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file path relative to user folder\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file source to fetch contents from\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// URL the file preview\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// should the standard core preview be used?\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// unique file id\n\t\tfileid: {\n\t\t\ttype: [Number, String],\n\t\t\trequired: false,\n\t\t},\n\t\t// list of all the visible files\n\t\tfileList: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t// file mime (aliased if specified in the model)\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// can the user swipe\n\t\tcanSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tcanZoom: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the content loaded?\n\t\t// synced with parent\n\t\tloaded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the sidebar currently opened ?\n\t\tisSidebarShown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// are we in fullscreen mode ?\n\t\tisFullScreen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// The file id of the peer live photo file\n\t\tmetadataFilesLivePhoto: {\n\t\t\ttype: Number,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\theight: null,\n\t\t\twidth: null,\n\t\t\tnaturalHeight: null,\n\t\t\tnaturalWidth: null,\n\t\t\tisLoaded: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tname() {\n\t\t\treturn parsePath(this.basename).name\n\t\t},\n\t\text() {\n\t\t\treturn parsePath(this.basename).ext\n\t\t},\n\t\tsrc() {\n\t\t\treturn this.source ?? this.davPath\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(val, old) {\n\t\t\t// the item was hidden before and is now the current view\n\t\t\tif (val === true && old === false) {\n\t\t\t\t// just in case the file was preloaded, let's warn the viewer\n\t\t\t\tif (this.isLoaded) {\n\t\t\t\t\tthis.doneLoading()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// update image size on sidebar toggle\n\t\tisSidebarShown() {\n\t\t\t// wait for transition to complete (100ms)\n\t\t\tsetTimeout(this.updateHeightWidth, 200)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// detect error and let the viewer know\n\t\tthis.$el.addEventListener('error', e => {\n\t\t\tconsole.error('Error loading', this.filename, e)\n\t\t\tthis.$emit('error', e)\n\t\t})\n\n\t\t// update image size on window resize\n\t\twindow.addEventListener('resize', debounce(() => {\n\t\t\tthis.updateHeightWidth()\n\t\t}, 100))\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * This is used to make the viewer know this file is complete or ready\n\t\t * ! you NEED to use it to make the viewer aware of the current loading state\n\t\t */\n\t\tdoneLoading() {\n\t\t\t// send the current state\n\t\t\tthis.$emit('update:loaded', true)\n\t\t\t// save the current state\n\t\t\tthis.isLoaded = true\n\t\t},\n\n\t\t/**\n\t\t * Updates the current height and width data\n\t\t * based on the viewer maximum size\n\t\t */\n\t\tupdateHeightWidth() {\n\t\t\tconst modalWrapper = this.$parent.$el.querySelector('.modal-wrapper')\n\t\t\tif (modalWrapper && this.naturalHeight > 0 && this.naturalWidth > 0) {\n\t\t\t\tconst modalContainer = modalWrapper.querySelector('.modal-container')\n\n\t\t\t\tconst parentHeight = modalContainer.clientHeight\n\t\t\t\tconst parentWidth = modalContainer.clientWidth\n\n\t\t\t\tconst heightRatio = parentHeight / this.naturalHeight\n\t\t\t\tconst widthRatio = parentWidth / this.naturalWidth\n\n\t\t\t\t// if the video height is capped by the parent height\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\tif (heightRatio < widthRatio && heightRatio < 1) {\n\t\t\t\t\tthis.height = parentHeight\n\t\t\t\t\tthis.width = Math.round(this.naturalWidth / this.naturalHeight * parentHeight)\n\n\t\t\t\t// if the video width is capped by the parent width\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\t} else if (heightRatio > widthRatio && widthRatio < 1) {\n\t\t\t\t\tthis.width = parentWidth\n\t\t\t\t\tthis.height = Math.round(this.naturalHeight / this.naturalWidth * parentWidth)\n\n\t\t\t\t// RESET\n\t\t\t\t} else {\n\t\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\t\tthis.width = this.naturalWidth\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\tthis.width = this.naturalWidth\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enable the viewer swiping previous/next capability\n\t\t */\n\t\tenableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', true)\n\t\t},\n\n\t\t/**\n\t\t * Disable the viewer swiping previous/next capability\n\t\t */\n\t\tdisableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', false)\n\t\t},\n\n\t\t/**\n\t\t * Toggle the fullscreen on the current visible element\n\t\t */\n\t\ttoggleFullScreen() {\n\t\t\tif (this.isFullScreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else {\n\t\t\t\tthis.$el.requestFullscreen()\n\t\t\t}\n\t\t},\n\t},\n}\n","\n\n","\n\n","\n\n","\n\n","\n\n","\n\n","\n\n\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { translate as t } from '@nextcloud/l10n'\nimport Vue from 'vue'\n\nimport ViewerComponent from './views/Viewer.vue'\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nVue.prototype.OC = window.OC\nVue.prototype.OCA = window.OCA\n\n// Create document root\nconst ViewerRoot = document.createElement('div')\nViewerRoot.id = 'viewer'\ndocument.body.appendChild(ViewerRoot)\n\n// Put controls for video viewer\n// Needed as Firefox CSP blocks the loading of the svg through the normal plyr system\nconst VideoControls = document.createElement('div')\nVideoControls.innerHTML = PLYR_ICONS\nVideoControls.style.display = 'none'\ndocument.body.appendChild(VideoControls)\n\n// Init vue\nexport default new Vue({\n\tel: '#viewer',\n\t// When debugging the page, it's easier to find which app\n\t// is which. Especially when there is multiple apps\n\t// roots mounted o the same page!\n\t// eslint-disable-next-line vue/match-component-file-name\n\tname: 'ViewerRoot',\n\trender: h => h(ViewerComponent),\n})\n"],"file":"viewer-main.mjs"} \ No newline at end of file