file-viewer3 1.0.8 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +160 -0
- package/README.en.md +390 -0
- package/README.md +306 -89
- package/dist/components/3MFLoader.js +527 -0
- package/dist/components/AMFLoader.js +188 -0
- package/dist/components/ArchiveViewer.js +526 -0
- package/dist/components/AudioViewer.js +66 -0
- package/dist/components/CadViewer.js +9040 -0
- package/dist/components/CodeViewer.js +151 -0
- package/dist/components/ColladaLoader.js +2282 -0
- package/dist/components/DrawingViewer.js +295 -0
- package/dist/components/EdaViewer.js +630 -0
- package/dist/components/EmailViewer.js +276 -0
- package/dist/components/EpubViewer.js +172 -0
- package/dist/components/FBXLoader.js +1574 -0
- package/dist/components/GLTFLoader.js +1383 -0
- package/dist/components/ImageViewer.js +1516 -1895
- package/dist/components/KMZLoader.js +45 -0
- package/dist/components/MarkdownViewer.js +1456 -1557
- package/dist/components/ModelViewer.js +797 -0
- package/dist/components/OBJLoader.js +287 -0
- package/dist/components/OfdViewer.js +133 -0
- package/dist/components/PCDLoader.js +141 -0
- package/dist/components/PLYLoader.js +305 -0
- package/dist/components/PdfView.js +27662 -21655
- package/dist/components/PptxRender.js +11170 -21118
- package/dist/components/STLLoader.js +83 -0
- package/dist/components/TDSLoader.js +228 -0
- package/dist/components/TypstViewer.js +1697 -0
- package/dist/components/USDLoader.js +2526 -0
- package/dist/components/UmdViewer.js +1873 -0
- package/dist/components/VRMLLoader.js +6422 -0
- package/dist/components/VTKLoader.js +337 -0
- package/dist/components/XYZLoader.js +30 -0
- package/dist/components/XlsxTable.js +7871 -69873
- package/dist/components/__vite-browser-external.js +7 -0
- package/dist/components/_plugin-vue_export-helper.js +8 -0
- package/dist/components/ar-SA-G6X2FPQ2.js +523 -0
- package/dist/components/arc.js +79 -0
- package/dist/components/architecture-7EHR7CIX.js +3 -0
- package/dist/components/architectureDiagram-3BPJPVTR.js +4096 -0
- package/dist/components/archive.js +24 -0
- package/dist/components/asyncToGenerator.js +29 -0
- package/dist/components/audio.js +19 -0
- package/dist/components/az-AZ-76LH7QW2.js +523 -0
- package/dist/components/bash.js +169 -0
- package/dist/components/bg-BG-XCXSNQG7.js +523 -0
- package/dist/components/blockDiagram-GPEHLZMM.js +3357 -0
- package/dist/components/bn-BD-2XOGV67Q.js +523 -0
- package/dist/components/c4Diagram-AAUBKEIU.js +2957 -0
- package/dist/components/ca-ES-6MX7JW3Y.js +523 -0
- package/dist/components/cad.js +23 -0
- package/dist/components/cfb.js +1174 -0
- package/dist/components/channel.js +5 -0
- package/dist/components/chunk-2J33WTMH.js +26 -0
- package/dist/components/chunk-3OPIFGDE.js +4167 -0
- package/dist/components/chunk-4BX2VUAB.js +19 -0
- package/dist/components/chunk-55IACEB6.js +9 -0
- package/dist/components/chunk-5ZQYHXKU.js +669 -0
- package/dist/components/chunk-6U3AYISY.js +624 -0
- package/dist/components/chunk-727SXJPM.js +3356 -0
- package/dist/components/chunk-AGHRB4JF.js +324 -0
- package/dist/components/chunk-AQP2D5EJ.js +2055 -0
- package/dist/components/chunk-BSJP7CBP.js +83 -0
- package/dist/components/chunk-CSCIHK7Q.js +3500 -0
- package/dist/components/chunk-EIO257PC.js +1836 -0
- package/dist/components/chunk-FMBD7UC4.js +5 -0
- package/dist/components/chunk-K2UTITRG.js +17627 -0
- package/dist/components/chunk-KSCS5N6A.js +572 -0
- package/dist/components/chunk-L5ZTLDWV.js +40 -0
- package/dist/components/chunk-LZXEDZCA.js +60 -0
- package/dist/components/chunk-ND2GUHAM.js +61 -0
- package/dist/components/chunk-NNHCCRGN.js +20425 -0
- package/dist/components/chunk-NZK2D7GU.js +68 -0
- package/dist/components/chunk-O5CBEL6O.js +1894 -0
- package/dist/components/chunk-QZHKN3VN.js +12 -0
- package/dist/components/chunk-SRAX5OIU.js +22 -0
- package/dist/components/chunk-WU5MYG2G.js +14 -0
- package/dist/components/chunk-XPW4576I.js +1146 -0
- package/dist/components/chunk-Z3N5DIM6.js +59 -0
- package/dist/components/chunk-ZUYEQ4TG.js +22 -0
- package/dist/components/chunk.js +23 -0
- package/dist/components/classDiagram-4FO5ZUOK.js +29 -0
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +29 -0
- package/dist/components/compiler.js +2 -0
- package/dist/components/core.js +845 -0
- package/dist/components/cose-bilkent-S5V4N54A.js +2268 -0
- package/dist/components/cpp.js +225 -0
- package/dist/components/cs-CZ-2BRQDIVT.js +523 -0
- package/dist/components/csharp.js +260 -0
- package/dist/components/css.js +140 -0
- package/dist/components/cytoscape.esm.js +18114 -0
- package/dist/components/da-DK-5WZEPLOC.js +523 -0
- package/dist/components/dagre-BM42HDAG.js +325 -0
- package/dist/components/dagre.js +1936 -0
- package/dist/components/de-DE-XR44H4JA.js +523 -0
- package/dist/components/defaultLocale.js +201 -0
- package/dist/components/defineProperty.js +50 -0
- package/dist/components/diagram-2AECGRRQ.js +229 -0
- package/dist/components/diagram-5GNKFQAL.js +108 -0
- package/dist/components/diagram-KO2AKTUF.js +443 -0
- package/dist/components/diagram-LMA3HP47.js +139 -0
- package/dist/components/diagram-OG6HWLK6.js +541 -0
- package/dist/components/diff.js +39 -0
- package/dist/components/directory-open-01563666.js +26 -0
- package/dist/components/directory-open-4ed118d0.js +83 -0
- package/dist/components/dist.js +50 -0
- package/dist/components/dist2.js +3291 -0
- package/dist/components/dist3.js +1593 -0
- package/dist/components/documentSearch.js +378 -0
- package/dist/components/docx-preview.js +3113 -0
- package/dist/components/drawing.js +19 -0
- package/dist/components/ebook.js +16 -0
- package/dist/components/eda.js +20 -0
- package/dist/components/el-GR-BZB4AONW.js +523 -0
- package/dist/components/email.js +21 -0
- package/dist/components/en-B4ZKOASM.js +3 -0
- package/dist/components/erDiagram-TEJ5UH35.js +1719 -0
- package/dist/components/es-ES-U4NZUMDT.js +523 -0
- package/dist/components/eu-ES-A7QVB2H4.js +523 -0
- package/dist/components/eventmodeling-FCH6USID.js +3 -0
- package/dist/components/fa-IR-HGAKTJCU.js +523 -0
- package/dist/components/fflate.module.js +323 -0
- package/dist/components/fi-FI-Z5N7JZ37.js +523 -0
- package/dist/components/file-open-002ab408.js +38 -0
- package/dist/components/file-open-7c801643.js +24 -0
- package/dist/components/file-save-3189631c.js +40 -0
- package/dist/components/file-save-745eba88.js +36 -0
- package/dist/components/flowDiagram-I6XJVG4X.js +4181 -0
- package/dist/components/fr-FR-RHASNOE6.js +523 -0
- package/dist/components/ganttDiagram-6RSMTGT7.js +2182 -0
- package/dist/components/gitGraph-WXDBUCRP.js +3 -0
- package/dist/components/gitGraphDiagram-PVQCEYII.js +788 -0
- package/dist/components/gl-ES-HMX3MZ6V.js +523 -0
- package/dist/components/global-compiler.js +23 -0
- package/dist/components/global-renderer.js +23 -0
- package/dist/components/go.js +140 -0
- package/dist/components/graphlib.js +1267 -0
- package/dist/components/he-IL-6SHJWFNN.js +523 -0
- package/dist/components/hi-IN-IWLTKZ5I.js +523 -0
- package/dist/components/hu-HU-A5ZG7DT2.js +523 -0
- package/dist/components/id-ID-SAP4L64H.js +523 -0
- package/dist/components/image-GAAHSSAO.js +3 -0
- package/dist/components/image-blob-reduce.esm.js +1429 -0
- package/dist/components/image.js +17 -0
- package/dist/components/info-J43DQDTF.js +3 -0
- package/dist/components/infoDiagram-5YYISTIA.js +26 -0
- package/dist/components/ini.js +88 -0
- package/dist/components/init.js +15 -0
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +718 -0
- package/dist/components/it-IT-JPQ66NNP.js +523 -0
- package/dist/components/ja-JP-DBVTYXUO.js +523 -0
- package/dist/components/java.js +169 -0
- package/dist/components/javascript.js +436 -0
- package/dist/components/journeyDiagram-JHISSGLW.js +885 -0
- package/dist/components/json.js +36 -0
- package/dist/components/jszip.min.js +3033 -0
- package/dist/components/kaa-6HZHGXH3.js +523 -0
- package/dist/components/kab-KAB-ZGHBKWFO.js +523 -0
- package/dist/components/kanban-definition-UN3LZRKU.js +986 -0
- package/dist/components/katex.js +21979 -0
- package/dist/components/kk-KZ-P5N5QNE5.js +523 -0
- package/dist/components/km-KH-HSX4SM5Z.js +523 -0
- package/dist/components/ko-KR-MTYHY66A.js +523 -0
- package/dist/components/ku-TR-6OUDTVRD.js +523 -0
- package/dist/components/lib.js +4877 -0
- package/dist/components/libarchive.js +360 -0
- package/dist/components/linear.js +289 -0
- package/dist/components/lt-LT-XHIRWOB4.js +523 -0
- package/dist/components/lv-LV-5QDEKY6T.js +523 -0
- package/dist/components/markdown.js +181 -0
- package/dist/components/md.js +17 -0
- package/dist/components/mermaid-parser.core.js +328 -0
- package/dist/components/mindmap-definition-RKZ34NQL.js +1016 -0
- package/dist/components/model.js +21 -0
- package/dist/components/mp4.js +12 -0
- package/dist/components/mr-IN-CRQNXWMA.js +523 -0
- package/dist/components/my-MM-5M5IBNSE.js +523 -0
- package/dist/components/nb-NO-T6EIAALU.js +523 -0
- package/dist/components/nestedRender.js +158 -0
- package/dist/components/nl-NL-IS3SIHDZ.js +523 -0
- package/dist/components/nn-NO-6E72VCQL.js +523 -0
- package/dist/components/objectSpread2.js +29 -0
- package/dist/components/objectWithoutProperties.js +28 -0
- package/dist/components/oc-FR-POXYY2M6.js +523 -0
- package/dist/components/ofd.js +5261 -0
- package/dist/components/ofd2.js +16 -0
- package/dist/components/ordinal.js +65 -0
- package/dist/components/pa-IN-N4M65BXN.js +523 -0
- package/dist/components/packet-YPE3B663.js +3 -0
- package/dist/components/pdf.js +24 -0
- package/dist/components/percentages-BXMCSKIN.js +3 -0
- package/dist/components/php.js +294 -0
- package/dist/components/pica.js +1009 -0
- package/dist/components/pie-LRSECV5Y.js +3 -0
- package/dist/components/pie.js +47 -0
- package/dist/components/pieDiagram-4H26LBE5.js +130 -0
- package/dist/components/pl-PL-T2D74RX3.js +523 -0
- package/dist/components/postal-mime.js +3146 -0
- package/dist/components/pptx.js +15 -0
- package/dist/components/printLayout.js +42 -0
- package/dist/components/prod.js +21770 -0
- package/dist/components/pt-BR-5N22H2LF.js +523 -0
- package/dist/components/pt-PT-UZXXM6DQ.js +523 -0
- package/dist/components/python.js +238 -0
- package/dist/components/quadrantDiagram-W4KKPZXB.js +1988 -0
- package/dist/components/radar-GUYGQ44K.js +3 -0
- package/dist/components/renderer.js +2 -0
- package/dist/components/requirementDiagram-4Y6WPE33.js +2230 -0
- package/dist/components/ro-RO-JPDTUUEW.js +523 -0
- package/dist/components/rough.esm.js +1355 -0
- package/dist/components/roundRect.js +90 -0
- package/dist/components/ru-RU-B4JR7IUQ.js +523 -0
- package/dist/components/rust.js +169 -0
- package/dist/components/sankeyDiagram-5OEKKPKP.js +972 -0
- package/dist/components/sequenceDiagram-3UESZ5HK.js +4255 -0
- package/dist/components/shared.js +175 -0
- package/dist/components/shared2.js +4 -0
- package/dist/components/si-LK-N5RQ5JYF.js +523 -0
- package/dist/components/sk-SK-C5VTKIMK.js +523 -0
- package/dist/components/sl-SI-NN7IZMDC.js +523 -0
- package/dist/components/sourceLoading.js +134 -0
- package/dist/components/sql.js +118 -0
- package/dist/components/src.js +2664 -0
- package/dist/components/src2.js +10722 -0
- package/dist/components/stateDiagram-AJRCARHV.js +217 -0
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +27 -0
- package/dist/components/subset-shared.chunk.js +3 -0
- package/dist/components/subset-worker.chunk.js +21 -0
- package/dist/components/sv-SE-XGPEYMSR.js +523 -0
- package/dist/components/ta-IN-2NMHFXQM.js +523 -0
- package/dist/components/text.js +20 -0
- package/dist/components/th-TH-HPSO5L25.js +523 -0
- package/dist/components/three.module.js +13134 -0
- package/dist/components/time.js +910 -0
- package/dist/components/timeline-definition-PNZ67QCA.js +1084 -0
- package/dist/components/tr-TR-DEFEU3FU.js +523 -0
- package/dist/components/treeView-BLDUP644.js +3 -0
- package/dist/components/treemap-LRROVOQU.js +3 -0
- package/dist/components/typescript.js +521 -0
- package/dist/components/typst.js +25 -0
- package/dist/components/uk-UA-QMV73CPH.js +523 -0
- package/dist/components/umd.js +16 -0
- package/dist/components/use.js +422 -0
- package/dist/components/util.js +49 -0
- package/dist/components/vennDiagram-CIIHVFJN.js +1880 -0
- package/dist/components/vi-VN-M7AON7JQ.js +523 -0
- package/dist/components/viewerZoom.js +92 -0
- package/dist/components/wardley-L42UT6IY.js +3 -0
- package/dist/components/wardleyDiagram-YWT4CUSO.js +656 -0
- package/dist/components/wasm-pack-shim.js +1711 -0
- package/dist/components/wasm-pack-shim2.js +934 -0
- package/dist/components/wasm.js +97 -0
- package/dist/components/word.js +3055 -0
- package/dist/components/worker-ref.js +15 -20
- package/dist/components/xlsx.js +21 -0
- package/dist/components/xml.js +166 -0
- package/dist/components/xychartDiagram-2RQKCTM6.js +2015 -0
- package/dist/components/yaml.js +144 -0
- package/dist/components/zh-CN-LNUGB5OW.js +523 -0
- package/dist/components/zh-HK-E62DVLB3.js +523 -0
- package/dist/components/zh-TW-RAJ6MFWO.js +523 -0
- package/dist/file-viewer3.css +2 -0
- package/dist/index.mjs +3292 -5
- package/dist/src/App.vue.d.ts +3 -0
- package/dist/src/compare/CompareApp.vue.d.ts +3 -0
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +7 -0
- package/dist/src/components/HelloWorld.vue.d.ts +3 -0
- package/dist/src/components/utils.d.ts +4 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +27 -0
- package/dist/src/package/common/printLayout.d.ts +16 -0
- package/dist/src/package/common/sourceLoading.d.ts +10 -0
- package/dist/src/package/common/type.d.ts +522 -8
- package/dist/src/package/common/worker-ref.d.ts +1 -1
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +74 -24
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +9 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +29 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +21 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +8 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +34 -0
- package/dist/src/package/components/FileViewer/index.d.ts +1 -1
- package/dist/src/package/components/FileViewer/util.d.ts +2 -1
- package/dist/src/package/index.d.ts +14 -4
- package/dist/src/package/use/documentLocation.d.ts +15 -0
- package/dist/src/package/use/documentSearch.d.ts +234 -0
- package/dist/src/package/use/index.d.ts +4 -0
- package/dist/src/package/use/loading.d.ts +33 -0
- package/dist/src/package/use/viewerZoom.d.ts +42 -0
- package/dist/src/package/use/worker.d.ts +2 -2
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/archive/cache.d.ts +10 -0
- package/dist/src/package/vendors/archive/fallback.d.ts +9 -0
- package/dist/src/package/vendors/archive/index.d.ts +3 -0
- package/dist/src/package/vendors/archive/shared.d.ts +24 -0
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +7 -0
- package/dist/src/package/vendors/audio/index.d.ts +7 -0
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/cad/index.d.ts +8 -0
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/drawing/index.d.ts +7 -0
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ebook/index.d.ts +7 -0
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/eda/index.d.ts +2 -0
- package/dist/src/package/vendors/eda/parser.d.ts +77 -0
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +10 -0
- package/dist/src/package/vendors/email/index.d.ts +2 -0
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/image/index.d.ts +1 -1
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/md/index.d.ts +1 -1
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/model/index.d.ts +3 -0
- package/dist/src/package/vendors/model/shared.d.ts +1 -0
- package/dist/src/package/vendors/nestedRender.d.ts +10 -0
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ofd/index.d.ts +7 -0
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +10 -13
- package/dist/src/package/vendors/pdf/index.d.ts +2 -1
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +9 -81
- package/dist/src/package/vendors/pptx/index.d.ts +1 -1
- package/dist/src/package/vendors/renders.d.ts +1 -1
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +7 -13
- package/dist/src/package/vendors/text/index.d.ts +6 -2
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/typst/index.d.ts +8 -0
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/umd/index.d.ts +7 -0
- package/dist/src/package/vendors/umd/parser.d.ts +30 -0
- package/dist/src/package/vendors/word/doc.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.worker.d.ts +1 -0
- package/dist/src/package/vendors/word/index.d.ts +3 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +80 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +25 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +6 -21
- package/dist/src/package/vendors/xlsx/index.d.ts +3 -2
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -5
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +4 -6
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +73 -0
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +1 -0
- package/dist/style.css +1 -57
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +24 -0
- package/dist/wasm/cad/libredwg-web.js +15 -0
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
- package/package.json +118 -42
- package/.vscode/extensions.json +0 -3
- package/dist/components/_commonjs-dynamic-modules.js +0 -6
- package/dist/components/_commonjsHelpers.js +0 -36
- package/dist/components/docx-preview.min.js +0 -5287
- package/dist/components/index.js +0 -1717
- package/dist/favicon.ico +0 -0
- package/dist/index.umd.js +0 -436
- package/dist/src/package/vendors/docx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/render.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/worker/xls/SheetJsModel.d.ts +0 -36
- package/dist/src/package/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +0 -39
- package/dist/src/package/vendors/xlsx/worker/xlsx/context.d.ts +0 -7
- package/dist/src/package/vendors/xlsx/worker/xlsx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/xlsx/util.d.ts +0 -10
- package/dist/worker/pdf.worker.js +0 -66
- package/dist/worker/pptx.worker.js +0 -21
- package/dist/worker/sheet.worker.js +0 -38
- package/dist/worker/xlsx.worker.js +0 -65
- /package/dist/src/package/vendors/xlsx/worker/{xlsx → sheetjs}/color.d.ts +0 -0
- /package/dist/src/package/vendors/xlsx/worker/{xls → sheetjs}/index.d.ts +0 -0
|
@@ -1,1898 +1,1519 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
function
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
function
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
function
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
function
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
1
|
+
import { o as e, t } from "./chunk.js";
|
|
2
|
+
import { n } from "./asyncToGenerator.js";
|
|
3
|
+
import { n as r, r as i, t as a } from "./viewerZoom.js";
|
|
4
|
+
import { t as o } from "./_plugin-vue_export-helper.js";
|
|
5
|
+
import { Fragment as s, computed as c, createElementBlock as l, createVNode as u, defineComponent as d, nextTick as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, onUnmounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, unref as x, watch as S, withCtx as ee } from "vue";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region node_modules/.pnpm/v-viewer@3.0.23_viewerjs@1.11.7_vue@3.5.35_typescript@6.0.3_/node_modules/v-viewer/dist/index.js
|
|
8
|
+
var te = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
9
|
+
(function(n, r) {
|
|
10
|
+
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self, n.Viewer = r());
|
|
11
|
+
})(e, (function() {
|
|
12
|
+
function e(e, t) {
|
|
13
|
+
if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
|
|
14
|
+
}
|
|
15
|
+
function t(e, t) {
|
|
16
|
+
for (var n = 0; n < t.length; n++) {
|
|
17
|
+
var r = t[n];
|
|
18
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, s(r.key), r);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function n(e, n, r) {
|
|
22
|
+
return n && t(e.prototype, n), r && t(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
23
|
+
}
|
|
24
|
+
function r(e, t, n) {
|
|
25
|
+
return (t = s(t)) in e ? Object.defineProperty(e, t, {
|
|
26
|
+
value: n,
|
|
27
|
+
enumerable: !0,
|
|
28
|
+
configurable: !0,
|
|
29
|
+
writable: !0
|
|
30
|
+
}) : e[t] = n, e;
|
|
31
|
+
}
|
|
32
|
+
function i(e, t) {
|
|
33
|
+
var n = Object.keys(e);
|
|
34
|
+
if (Object.getOwnPropertySymbols) {
|
|
35
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
36
|
+
t && (r = r.filter(function(t) {
|
|
37
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
38
|
+
})), n.push.apply(n, r);
|
|
39
|
+
}
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
function a(e) {
|
|
43
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
44
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
45
|
+
t % 2 ? i(Object(n), !0).forEach(function(t) {
|
|
46
|
+
r(e, t, n[t]);
|
|
47
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : i(Object(n)).forEach(function(t) {
|
|
48
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return e;
|
|
52
|
+
}
|
|
53
|
+
function o(e, t) {
|
|
54
|
+
if (typeof e != "object" || !e) return e;
|
|
55
|
+
var n = e[Symbol.toPrimitive];
|
|
56
|
+
if (n !== void 0) {
|
|
57
|
+
var r = n.call(e, t || "default");
|
|
58
|
+
if (typeof r != "object") return r;
|
|
59
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
60
|
+
}
|
|
61
|
+
return (t === "string" ? String : Number)(e);
|
|
62
|
+
}
|
|
63
|
+
function s(e) {
|
|
64
|
+
var t = o(e, "string");
|
|
65
|
+
return typeof t == "symbol" ? t : t + "";
|
|
66
|
+
}
|
|
67
|
+
function c(e) {
|
|
68
|
+
"@babel/helpers - typeof";
|
|
69
|
+
return c = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
70
|
+
return typeof e;
|
|
71
|
+
} : function(e) {
|
|
72
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
73
|
+
}, c(e);
|
|
74
|
+
}
|
|
75
|
+
var l = {
|
|
76
|
+
backdrop: !0,
|
|
77
|
+
button: !0,
|
|
78
|
+
navbar: !0,
|
|
79
|
+
title: !0,
|
|
80
|
+
toolbar: !0,
|
|
81
|
+
className: "",
|
|
82
|
+
container: "body",
|
|
83
|
+
filter: null,
|
|
84
|
+
fullscreen: !0,
|
|
85
|
+
inheritedAttributes: [
|
|
86
|
+
"crossOrigin",
|
|
87
|
+
"decoding",
|
|
88
|
+
"isMap",
|
|
89
|
+
"loading",
|
|
90
|
+
"referrerPolicy",
|
|
91
|
+
"sizes",
|
|
92
|
+
"srcset",
|
|
93
|
+
"useMap"
|
|
94
|
+
],
|
|
95
|
+
initialCoverage: .9,
|
|
96
|
+
initialViewIndex: 0,
|
|
97
|
+
inline: !1,
|
|
98
|
+
interval: 5e3,
|
|
99
|
+
keyboard: !0,
|
|
100
|
+
focus: !0,
|
|
101
|
+
loading: !0,
|
|
102
|
+
loop: !0,
|
|
103
|
+
minWidth: 200,
|
|
104
|
+
minHeight: 100,
|
|
105
|
+
movable: !0,
|
|
106
|
+
rotatable: !0,
|
|
107
|
+
scalable: !0,
|
|
108
|
+
zoomable: !0,
|
|
109
|
+
zoomOnTouch: !0,
|
|
110
|
+
zoomOnWheel: !0,
|
|
111
|
+
slideOnTouch: !0,
|
|
112
|
+
toggleOnDblclick: !0,
|
|
113
|
+
tooltip: !0,
|
|
114
|
+
transition: !0,
|
|
115
|
+
zIndex: 2015,
|
|
116
|
+
zIndexInline: 0,
|
|
117
|
+
zoomRatio: .1,
|
|
118
|
+
minZoomRatio: .01,
|
|
119
|
+
maxZoomRatio: 100,
|
|
120
|
+
url: "src",
|
|
121
|
+
ready: null,
|
|
122
|
+
show: null,
|
|
123
|
+
shown: null,
|
|
124
|
+
hide: null,
|
|
125
|
+
hidden: null,
|
|
126
|
+
view: null,
|
|
127
|
+
viewed: null,
|
|
128
|
+
move: null,
|
|
129
|
+
moved: null,
|
|
130
|
+
rotate: null,
|
|
131
|
+
rotated: null,
|
|
132
|
+
scale: null,
|
|
133
|
+
scaled: null,
|
|
134
|
+
zoom: null,
|
|
135
|
+
zoomed: null,
|
|
136
|
+
play: null,
|
|
137
|
+
stop: null
|
|
138
|
+
}, u = "<div class=\"viewer-container\" tabindex=\"-1\" touch-action=\"none\"><div class=\"viewer-canvas\"></div><div class=\"viewer-footer\"><div class=\"viewer-title\"></div><div class=\"viewer-toolbar\"></div><div class=\"viewer-navbar\"><ul class=\"viewer-list\" role=\"navigation\"></ul></div></div><div class=\"viewer-tooltip\" role=\"alert\" aria-hidden=\"true\"></div><div class=\"viewer-button\" data-viewer-action=\"mix\" role=\"button\"></div><div class=\"viewer-player\"></div></div>", d = typeof window < "u" && window.document !== void 0, f = d ? window : {}, p = d && f.document.documentElement ? "ontouchstart" in f.document.documentElement : !1, m = d ? "PointerEvent" in f : !1, h = "viewer", g = "move", _ = "switch", v = "zoom", y = `${h}-active`, b = `${h}-close`, x = `${h}-fade`, S = `${h}-fixed`, ee = `${h}-fullscreen`, te = `${h}-fullscreen-exit`, C = `${h}-hide`, ne = `${h}-hide-md-down`, re = `${h}-hide-sm-down`, w = `${h}-hide-xs-down`, T = `${h}-in`, E = `${h}-invisible`, D = `${h}-loading`, O = `${h}-move`, ie = `${h}-open`, k = `${h}-show`, A = `${h}-transition`, j = "click", ae = "dblclick", oe = "dragstart", se = "focusin", ce = "keydown", M = "load", N = "error", le = p ? "touchend touchcancel" : "mouseup", ue = p ? "touchmove" : "mousemove", de = m ? "pointerdown" : p ? "touchstart" : "mousedown", fe = m ? "pointermove" : ue, pe = m ? "pointerup pointercancel" : le, me = "resize", P = "transitionend", he = "wheel", ge = "ready", _e = "show", ve = "shown", ye = "hide", be = "hidden", xe = "view", F = "viewed", Se = "move", Ce = "moved", we = "rotate", Te = "rotated", Ee = "scale", De = "scaled", Oe = "zoom", ke = "zoomed", Ae = "play", je = "stop", Me = `${h}Action`, Ne = /\s\s*/, I = [
|
|
139
|
+
"zoom-in",
|
|
140
|
+
"zoom-out",
|
|
141
|
+
"one-to-one",
|
|
142
|
+
"reset",
|
|
143
|
+
"prev",
|
|
144
|
+
"play",
|
|
145
|
+
"next",
|
|
146
|
+
"rotate-left",
|
|
147
|
+
"rotate-right",
|
|
148
|
+
"flip-horizontal",
|
|
149
|
+
"flip-vertical"
|
|
150
|
+
];
|
|
151
|
+
function L(e) {
|
|
152
|
+
return typeof e == "string";
|
|
153
|
+
}
|
|
154
|
+
var Pe = Number.isNaN || f.isNaN;
|
|
155
|
+
function R(e) {
|
|
156
|
+
return typeof e == "number" && !Pe(e);
|
|
157
|
+
}
|
|
158
|
+
function z(e) {
|
|
159
|
+
return e === void 0;
|
|
160
|
+
}
|
|
161
|
+
function B(e) {
|
|
162
|
+
return c(e) === "object" && e !== null;
|
|
163
|
+
}
|
|
164
|
+
var Fe = Object.prototype.hasOwnProperty;
|
|
165
|
+
function V(e) {
|
|
166
|
+
if (!B(e)) return !1;
|
|
167
|
+
try {
|
|
168
|
+
var t = e.constructor, n = t.prototype;
|
|
169
|
+
return t && n && Fe.call(n, "isPrototypeOf");
|
|
170
|
+
} catch (e) {
|
|
171
|
+
return !1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function H(e) {
|
|
175
|
+
return typeof e == "function";
|
|
176
|
+
}
|
|
177
|
+
function U(e, t) {
|
|
178
|
+
if (e && H(t)) if (Array.isArray(e) || R(e.length)) {
|
|
179
|
+
var n = e.length, r;
|
|
180
|
+
for (r = 0; r < n && t.call(e, e[r], r, e) !== !1; r += 1);
|
|
181
|
+
} else B(e) && Object.keys(e).forEach(function(n) {
|
|
182
|
+
t.call(e, e[n], n, e);
|
|
183
|
+
});
|
|
184
|
+
return e;
|
|
185
|
+
}
|
|
186
|
+
var W = Object.assign || function(e) {
|
|
187
|
+
var t = [...arguments].slice(1);
|
|
188
|
+
return B(e) && t.length > 0 && t.forEach(function(t) {
|
|
189
|
+
B(t) && Object.keys(t).forEach(function(n) {
|
|
190
|
+
e[n] = t[n];
|
|
191
|
+
});
|
|
192
|
+
}), e;
|
|
193
|
+
}, Ie = /^(?:width|height|left|top|marginLeft|marginTop)$/;
|
|
194
|
+
function G(e, t) {
|
|
195
|
+
var n = e.style;
|
|
196
|
+
U(t, function(e, t) {
|
|
197
|
+
Ie.test(t) && R(e) && (e += "px"), n[t] = e;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function Le(e) {
|
|
201
|
+
return L(e) ? e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">") : e;
|
|
202
|
+
}
|
|
203
|
+
function K(e, t) {
|
|
204
|
+
return !e || !t ? !1 : e.classList ? e.classList.contains(t) : e.className.indexOf(t) > -1;
|
|
205
|
+
}
|
|
206
|
+
function q(e, t) {
|
|
207
|
+
if (!(!e || !t)) {
|
|
208
|
+
if (R(e.length)) {
|
|
209
|
+
U(e, function(e) {
|
|
210
|
+
q(e, t);
|
|
211
|
+
});
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (e.classList) {
|
|
215
|
+
e.classList.add(t);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
var n = e.className.trim();
|
|
219
|
+
n ? n.indexOf(t) < 0 && (e.className = `${n} ${t}`) : e.className = t;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function J(e, t) {
|
|
223
|
+
if (!(!e || !t)) {
|
|
224
|
+
if (R(e.length)) {
|
|
225
|
+
U(e, function(e) {
|
|
226
|
+
J(e, t);
|
|
227
|
+
});
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (e.classList) {
|
|
231
|
+
e.classList.remove(t);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
e.className.indexOf(t) >= 0 && (e.className = e.className.replace(t, ""));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function Re(e, t, n) {
|
|
238
|
+
if (t) {
|
|
239
|
+
if (R(e.length)) {
|
|
240
|
+
U(e, function(e) {
|
|
241
|
+
Re(e, t, n);
|
|
242
|
+
});
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
n ? q(e, t) : J(e, t);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
var ze = /([a-z\d])([A-Z])/g;
|
|
249
|
+
function Be(e) {
|
|
250
|
+
return e.replace(ze, "$1-$2").toLowerCase();
|
|
251
|
+
}
|
|
252
|
+
function Y(e, t) {
|
|
253
|
+
return B(e[t]) ? e[t] : e.dataset ? e.dataset[t] : e.getAttribute(`data-${Be(t)}`);
|
|
254
|
+
}
|
|
255
|
+
function Ve(e, t, n) {
|
|
256
|
+
B(n) ? e[t] = n : e.dataset ? e.dataset[t] = n : e.setAttribute(`data-${Be(t)}`, n);
|
|
257
|
+
}
|
|
258
|
+
var He = function() {
|
|
259
|
+
var e = !1;
|
|
260
|
+
if (d) {
|
|
261
|
+
var t = !1, n = function() {}, r = Object.defineProperty({}, "once", {
|
|
262
|
+
get: function() {
|
|
263
|
+
return e = !0, t;
|
|
264
|
+
},
|
|
265
|
+
set: function(e) {
|
|
266
|
+
t = e;
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
f.addEventListener("test", n, r), f.removeEventListener("test", n, r);
|
|
270
|
+
}
|
|
271
|
+
return e;
|
|
272
|
+
}();
|
|
273
|
+
function X(e, t, n) {
|
|
274
|
+
var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, i = n;
|
|
275
|
+
t.trim().split(Ne).forEach(function(t) {
|
|
276
|
+
if (!He) {
|
|
277
|
+
var a = e.listeners;
|
|
278
|
+
a && a[t] && a[t][n] && (i = a[t][n], delete a[t][n], Object.keys(a[t]).length === 0 && delete a[t], Object.keys(a).length === 0 && delete e.listeners);
|
|
279
|
+
}
|
|
280
|
+
e.removeEventListener(t, i, r);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
function Z(e, t, n) {
|
|
284
|
+
var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, i = n;
|
|
285
|
+
t.trim().split(Ne).forEach(function(t) {
|
|
286
|
+
if (r.once && !He) {
|
|
287
|
+
var a = e.listeners, o = a === void 0 ? {} : a;
|
|
288
|
+
i = function() {
|
|
289
|
+
delete o[t][n], e.removeEventListener(t, i, r);
|
|
290
|
+
var a = [...arguments];
|
|
291
|
+
n.apply(e, a);
|
|
292
|
+
}, o[t] || (o[t] = {}), o[t][n] && e.removeEventListener(t, o[t][n], r), o[t][n] = i, e.listeners = o;
|
|
293
|
+
}
|
|
294
|
+
e.addEventListener(t, i, r);
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
function Q(e, t, n, r) {
|
|
298
|
+
var i;
|
|
299
|
+
return H(Event) && H(CustomEvent) ? i = new CustomEvent(t, a({
|
|
300
|
+
bubbles: !0,
|
|
301
|
+
cancelable: !0,
|
|
302
|
+
detail: n
|
|
303
|
+
}, r)) : (i = document.createEvent("CustomEvent"), i.initCustomEvent(t, !0, !0, n)), e.dispatchEvent(i);
|
|
304
|
+
}
|
|
305
|
+
function Ue(e) {
|
|
306
|
+
var t = e.getBoundingClientRect();
|
|
307
|
+
return {
|
|
308
|
+
left: t.left + (window.pageXOffset - document.documentElement.clientLeft),
|
|
309
|
+
top: t.top + (window.pageYOffset - document.documentElement.clientTop)
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function We(e) {
|
|
313
|
+
var t = e.rotate, n = e.scaleX, r = e.scaleY, i = e.translateX, a = e.translateY, o = [];
|
|
314
|
+
R(i) && i !== 0 && o.push(`translateX(${i}px)`), R(a) && a !== 0 && o.push(`translateY(${a}px)`), R(t) && t !== 0 && o.push(`rotate(${t}deg)`), R(n) && n !== 1 && o.push(`scaleX(${n})`), R(r) && r !== 1 && o.push(`scaleY(${r})`);
|
|
315
|
+
var s = o.length ? o.join(" ") : "none";
|
|
316
|
+
return {
|
|
317
|
+
WebkitTransform: s,
|
|
318
|
+
msTransform: s,
|
|
319
|
+
transform: s
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
function Ge(e) {
|
|
323
|
+
return L(e) ? decodeURIComponent(e.replace(/^.*\//, "").replace(/[?&#].*$/, "")) : "";
|
|
324
|
+
}
|
|
325
|
+
var Ke = f.navigator && /Version\/\d+(\.\d+)+?\s+Safari/i.test(f.navigator.userAgent);
|
|
326
|
+
function qe(e, t, n) {
|
|
327
|
+
var r = document.createElement("img");
|
|
328
|
+
if (e.naturalWidth && !Ke) return n(e.naturalWidth, e.naturalHeight), r;
|
|
329
|
+
var i = document.body || document.documentElement;
|
|
330
|
+
return r.onload = function() {
|
|
331
|
+
n(r.width, r.height), Ke || i.removeChild(r);
|
|
332
|
+
}, U(t.inheritedAttributes, function(t) {
|
|
333
|
+
var n = e.getAttribute(t);
|
|
334
|
+
n !== null && r.setAttribute(t, n);
|
|
335
|
+
}), r.src = e.src, Ke || (r.style.cssText = "left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;", i.appendChild(r)), r;
|
|
336
|
+
}
|
|
337
|
+
function Je(e) {
|
|
338
|
+
switch (e) {
|
|
339
|
+
case 2: return w;
|
|
340
|
+
case 3: return re;
|
|
341
|
+
case 4: return ne;
|
|
342
|
+
default: return "";
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
function Ye(e) {
|
|
346
|
+
var t = a({}, e), n = [];
|
|
347
|
+
return U(e, function(e, r) {
|
|
348
|
+
delete t[r], U(t, function(t) {
|
|
349
|
+
var r = Math.abs(e.startX - t.startX), i = Math.abs(e.startY - t.startY), a = Math.abs(e.endX - t.endX), o = Math.abs(e.endY - t.endY), s = Math.sqrt(r * r + i * i), c = (Math.sqrt(a * a + o * o) - s) / s;
|
|
350
|
+
n.push(c);
|
|
351
|
+
});
|
|
352
|
+
}), n.sort(function(e, t) {
|
|
353
|
+
return Math.abs(e) < Math.abs(t);
|
|
354
|
+
}), n[0];
|
|
355
|
+
}
|
|
356
|
+
function Xe(e, t) {
|
|
357
|
+
var n = e.pageX, r = e.pageY, i = {
|
|
358
|
+
endX: n,
|
|
359
|
+
endY: r
|
|
360
|
+
};
|
|
361
|
+
return t ? i : a({
|
|
362
|
+
timeStamp: Date.now(),
|
|
363
|
+
startX: n,
|
|
364
|
+
startY: r
|
|
365
|
+
}, i);
|
|
366
|
+
}
|
|
367
|
+
function Ze(e) {
|
|
368
|
+
var t = 0, n = 0, r = 0;
|
|
369
|
+
return U(e, function(e) {
|
|
370
|
+
var i = e.startX, a = e.startY;
|
|
371
|
+
t += i, n += a, r += 1;
|
|
372
|
+
}), t /= r, n /= r, {
|
|
373
|
+
pageX: t,
|
|
374
|
+
pageY: n
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
var Qe = {
|
|
378
|
+
render: function() {
|
|
379
|
+
this.initContainer(), this.initViewer(), this.initList(), this.renderViewer();
|
|
380
|
+
},
|
|
381
|
+
initBody: function() {
|
|
382
|
+
var e = this.element.ownerDocument, t = e.body || e.documentElement;
|
|
383
|
+
this.body = t, this.scrollbarWidth = window.innerWidth - e.documentElement.clientWidth, this.initialBodyPaddingRight = t.style.paddingRight, this.initialBodyComputedPaddingRight = window.getComputedStyle(t).paddingRight;
|
|
384
|
+
},
|
|
385
|
+
initContainer: function() {
|
|
386
|
+
this.containerData = {
|
|
387
|
+
width: window.innerWidth,
|
|
388
|
+
height: window.innerHeight
|
|
389
|
+
};
|
|
390
|
+
},
|
|
391
|
+
initViewer: function() {
|
|
392
|
+
var e = this.options, t = this.parent, n;
|
|
393
|
+
e.inline && (n = {
|
|
394
|
+
width: Math.max(t.offsetWidth, e.minWidth),
|
|
395
|
+
height: Math.max(t.offsetHeight, e.minHeight)
|
|
396
|
+
}, this.parentData = n), (this.fulled || !n) && (n = this.containerData), this.viewerData = W({}, n);
|
|
397
|
+
},
|
|
398
|
+
renderViewer: function() {
|
|
399
|
+
this.options.inline && !this.fulled && G(this.viewer, this.viewerData);
|
|
400
|
+
},
|
|
401
|
+
initList: function() {
|
|
402
|
+
var e = this, t = this.element, n = this.options, r = this.list, i = [];
|
|
403
|
+
r.innerHTML = "", U(this.images, function(t, a) {
|
|
404
|
+
var o = t.src, s = t.alt || Ge(o), c = e.getImageURL(t);
|
|
405
|
+
if (o || c) {
|
|
406
|
+
var l = document.createElement("li"), u = document.createElement("img");
|
|
407
|
+
U(n.inheritedAttributes, function(e) {
|
|
408
|
+
var n = t.getAttribute(e);
|
|
409
|
+
n !== null && u.setAttribute(e, n);
|
|
410
|
+
}), n.navbar && (u.src = o || c), u.alt = s, u.setAttribute("data-original-url", c || o), l.setAttribute("data-index", a), l.setAttribute("data-viewer-action", "view"), l.setAttribute("role", "button"), n.keyboard && l.setAttribute("tabindex", 0), l.appendChild(u), r.appendChild(l), i.push(l);
|
|
411
|
+
}
|
|
412
|
+
}), this.items = i, U(i, function(t) {
|
|
413
|
+
var r = t.firstElementChild, i, a;
|
|
414
|
+
Ve(r, "filled", !0), n.loading && q(t, D), Z(r, M, i = function(i) {
|
|
415
|
+
X(r, N, a), n.loading && J(t, D), e.loadImage(i);
|
|
416
|
+
}, { once: !0 }), Z(r, N, a = function() {
|
|
417
|
+
X(r, M, i), n.loading && J(t, D);
|
|
418
|
+
}, { once: !0 });
|
|
419
|
+
}), n.transition && Z(t, F, function() {
|
|
420
|
+
q(r, A);
|
|
421
|
+
}, { once: !0 });
|
|
422
|
+
},
|
|
423
|
+
renderList: function() {
|
|
424
|
+
var e = this.index, t = this.items[e];
|
|
425
|
+
if (t) {
|
|
426
|
+
var n = t.nextElementSibling, r = parseInt(window.getComputedStyle(n || t).marginLeft, 10), i = t.offsetWidth, a = i + r;
|
|
427
|
+
G(this.list, W({ width: a * this.length - r }, We({ translateX: (this.viewerData.width - i) / 2 - a * e })));
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
resetList: function() {
|
|
431
|
+
var e = this.list;
|
|
432
|
+
e.innerHTML = "", J(e, A), G(e, We({ translateX: 0 }));
|
|
433
|
+
},
|
|
434
|
+
initImage: function(e) {
|
|
435
|
+
var t = this, n = this.options, r = this.image, i = this.viewerData, a = this.footer.offsetHeight, o = i.width, s = Math.max(i.height - a, a), c = this.imageData || {}, l;
|
|
436
|
+
this.imageInitializing = { abort: function() {
|
|
437
|
+
l.onload = null;
|
|
438
|
+
} }, l = qe(r, n, function(r, i) {
|
|
439
|
+
var a = r / i, l = Math.max(0, Math.min(1, n.initialCoverage)), u = o, d = s;
|
|
440
|
+
t.imageInitializing = !1, s * a > o ? d = o / a : u = s * a, l = R(l) ? l : .9, u = Math.min(u * l, r), d = Math.min(d * l, i);
|
|
441
|
+
var f = (o - u) / 2, p = (s - d) / 2, m = {
|
|
442
|
+
left: f,
|
|
443
|
+
top: p,
|
|
444
|
+
x: f,
|
|
445
|
+
y: p,
|
|
446
|
+
width: u,
|
|
447
|
+
height: d,
|
|
448
|
+
oldRatio: 1,
|
|
449
|
+
ratio: u / r,
|
|
450
|
+
aspectRatio: a,
|
|
451
|
+
naturalWidth: r,
|
|
452
|
+
naturalHeight: i
|
|
453
|
+
}, h = W({}, m);
|
|
454
|
+
n.rotatable && (m.rotate = c.rotate || 0, h.rotate = 0), n.scalable && (m.scaleX = c.scaleX || 1, m.scaleY = c.scaleY || 1, h.scaleX = 1, h.scaleY = 1), t.imageData = m, t.initialImageData = h, e && e();
|
|
455
|
+
});
|
|
456
|
+
},
|
|
457
|
+
renderImage: function(e) {
|
|
458
|
+
var t = this, n = this.image, r = this.imageData;
|
|
459
|
+
if (G(n, W({
|
|
460
|
+
width: r.width,
|
|
461
|
+
height: r.height,
|
|
462
|
+
marginLeft: r.x,
|
|
463
|
+
marginTop: r.y
|
|
464
|
+
}, We(r))), e) if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && K(n, A)) {
|
|
465
|
+
var i = function() {
|
|
466
|
+
t.imageRendering = !1, e();
|
|
467
|
+
};
|
|
468
|
+
this.imageRendering = { abort: function() {
|
|
469
|
+
X(n, P, i);
|
|
470
|
+
} }, Z(n, P, i, { once: !0 });
|
|
471
|
+
} else e();
|
|
472
|
+
},
|
|
473
|
+
resetImage: function() {
|
|
474
|
+
var e = this.image;
|
|
475
|
+
e && (this.viewing && this.viewing.abort(), e.parentNode.removeChild(e), this.image = null, this.title.innerHTML = "");
|
|
476
|
+
}
|
|
477
|
+
}, $e = {
|
|
478
|
+
bind: function() {
|
|
479
|
+
var e = this.options, t = this.viewer, n = this.canvas, r = this.element.ownerDocument;
|
|
480
|
+
Z(t, j, this.onClick = this.click.bind(this)), Z(t, oe, this.onDragStart = this.dragstart.bind(this)), Z(n, de, this.onPointerDown = this.pointerdown.bind(this)), Z(r, fe, this.onPointerMove = this.pointermove.bind(this)), Z(r, pe, this.onPointerUp = this.pointerup.bind(this)), Z(r, ce, this.onKeyDown = this.keydown.bind(this)), Z(window, me, this.onResize = this.resize.bind(this)), e.zoomable && e.zoomOnWheel && Z(t, he, this.onWheel = this.wheel.bind(this), {
|
|
481
|
+
passive: !1,
|
|
482
|
+
capture: !0
|
|
483
|
+
}), e.toggleOnDblclick && Z(n, ae, this.onDblclick = this.dblclick.bind(this));
|
|
484
|
+
},
|
|
485
|
+
unbind: function() {
|
|
486
|
+
var e = this.options, t = this.viewer, n = this.canvas, r = this.element.ownerDocument;
|
|
487
|
+
X(t, j, this.onClick), X(t, oe, this.onDragStart), X(n, de, this.onPointerDown), X(r, fe, this.onPointerMove), X(r, pe, this.onPointerUp), X(r, ce, this.onKeyDown), X(window, me, this.onResize), e.zoomable && e.zoomOnWheel && X(t, he, this.onWheel, {
|
|
488
|
+
passive: !1,
|
|
489
|
+
capture: !0
|
|
490
|
+
}), e.toggleOnDblclick && X(n, ae, this.onDblclick);
|
|
491
|
+
}
|
|
492
|
+
}, et = {
|
|
493
|
+
click: function(e) {
|
|
494
|
+
var t = this.options, n = this.imageData, r = e.target, i = Y(r, Me);
|
|
495
|
+
switch (!i && r.localName === "img" && r.parentElement.localName === "li" && (r = r.parentElement, i = Y(r, Me)), p && e.isTrusted && r === this.canvas && clearTimeout(this.clickCanvasTimeout), i) {
|
|
496
|
+
case "mix":
|
|
497
|
+
this.played ? this.stop() : t.inline ? this.fulled ? this.exit() : this.full() : this.hide();
|
|
498
|
+
break;
|
|
499
|
+
case "hide":
|
|
500
|
+
this.pointerMoved || this.hide();
|
|
501
|
+
break;
|
|
502
|
+
case "view":
|
|
503
|
+
this.view(Y(r, "index"));
|
|
504
|
+
break;
|
|
505
|
+
case "zoom-in":
|
|
506
|
+
this.zoom(.1, !0);
|
|
507
|
+
break;
|
|
508
|
+
case "zoom-out":
|
|
509
|
+
this.zoom(-.1, !0);
|
|
510
|
+
break;
|
|
511
|
+
case "one-to-one":
|
|
512
|
+
this.toggle();
|
|
513
|
+
break;
|
|
514
|
+
case "reset":
|
|
515
|
+
this.reset();
|
|
516
|
+
break;
|
|
517
|
+
case "prev":
|
|
518
|
+
this.prev(t.loop);
|
|
519
|
+
break;
|
|
520
|
+
case "play":
|
|
521
|
+
this.play(t.fullscreen);
|
|
522
|
+
break;
|
|
523
|
+
case "next":
|
|
524
|
+
this.next(t.loop);
|
|
525
|
+
break;
|
|
526
|
+
case "rotate-left":
|
|
527
|
+
this.rotate(-90);
|
|
528
|
+
break;
|
|
529
|
+
case "rotate-right":
|
|
530
|
+
this.rotate(90);
|
|
531
|
+
break;
|
|
532
|
+
case "flip-horizontal":
|
|
533
|
+
this.scaleX(-n.scaleX || -1);
|
|
534
|
+
break;
|
|
535
|
+
case "flip-vertical":
|
|
536
|
+
this.scaleY(-n.scaleY || -1);
|
|
537
|
+
break;
|
|
538
|
+
default: this.played && this.stop();
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
dblclick: function(e) {
|
|
542
|
+
e.preventDefault(), this.viewed && e.target === this.image && (p && e.isTrusted && clearTimeout(this.doubleClickImageTimeout), this.toggle(e.isTrusted ? e : e.detail && e.detail.originalEvent));
|
|
543
|
+
},
|
|
544
|
+
load: function() {
|
|
545
|
+
var e = this;
|
|
546
|
+
this.timeout && (clearTimeout(this.timeout), this.timeout = !1);
|
|
547
|
+
var t = this.element, n = this.options, r = this.image, i = this.index, a = this.viewerData;
|
|
548
|
+
J(r, E), n.loading && J(this.canvas, D), r.style.cssText = `height:0;margin-left:${a.width / 2}px;margin-top:${a.height / 2}px;max-width:none!important;position:relative;width:0;`, this.initImage(function() {
|
|
549
|
+
Re(r, O, n.movable), Re(r, A, n.transition), e.renderImage(function() {
|
|
550
|
+
e.viewed = !0, e.viewing = !1, H(n.viewed) && Z(t, F, n.viewed, { once: !0 }), Q(t, F, {
|
|
551
|
+
originalImage: e.images[i],
|
|
552
|
+
index: i,
|
|
553
|
+
image: r
|
|
554
|
+
}, { cancelable: !1 });
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
},
|
|
558
|
+
loadImage: function(e) {
|
|
559
|
+
var t = e.target, n = t.parentNode, r = n.offsetWidth || 30, i = n.offsetHeight || 50, a = !!Y(t, "filled");
|
|
560
|
+
qe(t, this.options, function(e, n) {
|
|
561
|
+
var o = e / n, s = r, c = i;
|
|
562
|
+
i * o > r ? a ? s = i * o : c = r / o : a ? c = r / o : s = i * o, G(t, W({
|
|
563
|
+
width: s,
|
|
564
|
+
height: c
|
|
565
|
+
}, We({
|
|
566
|
+
translateX: (r - s) / 2,
|
|
567
|
+
translateY: (i - c) / 2
|
|
568
|
+
})));
|
|
569
|
+
});
|
|
570
|
+
},
|
|
571
|
+
keydown: function(e) {
|
|
572
|
+
var t = this.options;
|
|
573
|
+
if (t.keyboard) {
|
|
574
|
+
var n = e.keyCode || e.which || e.charCode;
|
|
575
|
+
switch (n) {
|
|
576
|
+
case 13:
|
|
577
|
+
this.viewer.contains(e.target) && this.click(e);
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
if (this.fulled) switch (n) {
|
|
581
|
+
case 27:
|
|
582
|
+
this.played ? this.stop() : t.inline ? this.fulled && this.exit() : this.hide();
|
|
583
|
+
break;
|
|
584
|
+
case 32:
|
|
585
|
+
this.played && this.stop();
|
|
586
|
+
break;
|
|
587
|
+
case 37:
|
|
588
|
+
this.played && this.playing ? this.playing.prev() : this.prev(t.loop);
|
|
589
|
+
break;
|
|
590
|
+
case 38:
|
|
591
|
+
e.preventDefault(), this.zoom(t.zoomRatio, !0);
|
|
592
|
+
break;
|
|
593
|
+
case 39:
|
|
594
|
+
this.played && this.playing ? this.playing.next() : this.next(t.loop);
|
|
595
|
+
break;
|
|
596
|
+
case 40:
|
|
597
|
+
e.preventDefault(), this.zoom(-t.zoomRatio, !0);
|
|
598
|
+
break;
|
|
599
|
+
case 48:
|
|
600
|
+
case 49:
|
|
601
|
+
e.ctrlKey && (e.preventDefault(), this.toggle());
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
dragstart: function(e) {
|
|
607
|
+
e.target.localName === "img" && e.preventDefault();
|
|
608
|
+
},
|
|
609
|
+
pointerdown: function(e) {
|
|
610
|
+
var t = this.options, n = this.pointers, r = e.buttons, i = e.button;
|
|
611
|
+
if (this.pointerMoved = !1, !(!this.viewed || this.showing || this.viewing || this.hiding || (e.type === "mousedown" || e.type === "pointerdown" && e.pointerType === "mouse") && (R(r) && r !== 1 || R(i) && i !== 0 || e.ctrlKey))) {
|
|
612
|
+
e.preventDefault(), e.changedTouches ? U(e.changedTouches, function(e) {
|
|
613
|
+
n[e.identifier] = Xe(e);
|
|
614
|
+
}) : n[e.pointerId || 0] = Xe(e);
|
|
615
|
+
var a = t.movable ? g : !1;
|
|
616
|
+
t.zoomOnTouch && t.zoomable && Object.keys(n).length > 1 ? a = v : t.slideOnTouch && (e.pointerType === "touch" || e.type === "touchstart") && this.isSwitchable() && (a = _), t.transition && (a === g || a === v) && J(this.image, A), this.action = a;
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
pointermove: function(e) {
|
|
620
|
+
var t = this.pointers, n = this.action;
|
|
621
|
+
!this.viewed || !n || (e.preventDefault(), e.changedTouches ? U(e.changedTouches, function(e) {
|
|
622
|
+
W(t[e.identifier] || {}, Xe(e, !0));
|
|
623
|
+
}) : W(t[e.pointerId || 0] || {}, Xe(e, !0)), this.change(e));
|
|
624
|
+
},
|
|
625
|
+
pointerup: function(e) {
|
|
626
|
+
var t = this, n = this.options, r = this.action, i = this.pointers, a;
|
|
627
|
+
e.changedTouches ? U(e.changedTouches, function(e) {
|
|
628
|
+
a = i[e.identifier], delete i[e.identifier];
|
|
629
|
+
}) : (a = i[e.pointerId || 0], delete i[e.pointerId || 0]), r && (e.preventDefault(), n.transition && (r === g || r === v) && q(this.image, A), this.action = !1, p && r !== v && a && Date.now() - a.timeStamp < 500 && (clearTimeout(this.clickCanvasTimeout), clearTimeout(this.doubleClickImageTimeout), n.toggleOnDblclick && this.viewed && e.target === this.image ? this.imageClicked ? (this.imageClicked = !1, this.doubleClickImageTimeout = setTimeout(function() {
|
|
630
|
+
Q(t.image, ae, { originalEvent: e });
|
|
631
|
+
}, 50)) : (this.imageClicked = !0, this.doubleClickImageTimeout = setTimeout(function() {
|
|
632
|
+
t.imageClicked = !1;
|
|
633
|
+
}, 500)) : (this.imageClicked = !1, n.backdrop && n.backdrop !== "static" && e.target === this.canvas && (this.clickCanvasTimeout = setTimeout(function() {
|
|
634
|
+
Q(t.canvas, j, { originalEvent: e });
|
|
635
|
+
}, 50)))));
|
|
636
|
+
},
|
|
637
|
+
resize: function() {
|
|
638
|
+
var e = this;
|
|
639
|
+
if (!(!this.isShown || this.hiding) && (this.fulled && (this.close(), this.initBody(), this.open()), this.initContainer(), this.initViewer(), this.renderViewer(), this.renderList(), this.viewed && this.initImage(function() {
|
|
640
|
+
e.renderImage();
|
|
641
|
+
}), this.played)) {
|
|
642
|
+
if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
|
|
643
|
+
this.stop();
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
U(this.player.getElementsByTagName("img"), function(t) {
|
|
647
|
+
Z(t, M, e.loadImage.bind(e), { once: !0 }), Q(t, M);
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
wheel: function(e) {
|
|
652
|
+
var t = this;
|
|
653
|
+
if (this.viewed && (e.preventDefault(), !this.wheeling)) {
|
|
654
|
+
this.wheeling = !0, setTimeout(function() {
|
|
655
|
+
t.wheeling = !1;
|
|
656
|
+
}, 50);
|
|
657
|
+
var n = Number(this.options.zoomRatio) || .1, r = 1;
|
|
658
|
+
e.deltaY ? r = e.deltaY > 0 ? 1 : -1 : e.wheelDelta ? r = -e.wheelDelta / 120 : e.detail && (r = e.detail > 0 ? 1 : -1), this.zoom(-r * n, !0, null, e);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}, tt = {
|
|
662
|
+
show: function() {
|
|
663
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.element, n = this.options;
|
|
664
|
+
if (n.inline || this.showing || this.isShown || this.showing) return this;
|
|
665
|
+
if (!this.ready) return this.build(), this.ready && this.show(e), this;
|
|
666
|
+
if (H(n.show) && Z(t, _e, n.show, { once: !0 }), Q(t, _e) === !1 || !this.ready) return this;
|
|
667
|
+
this.hiding && this.transitioning.abort(), this.showing = !0, this.open();
|
|
668
|
+
var r = this.viewer;
|
|
669
|
+
if (J(r, C), r.setAttribute("role", "dialog"), r.setAttribute("aria-labelledby", this.title.id), r.setAttribute("aria-modal", !0), r.removeAttribute("aria-hidden"), n.transition && !e) {
|
|
670
|
+
var i = this.shown.bind(this);
|
|
671
|
+
this.transitioning = { abort: function() {
|
|
672
|
+
X(r, P, i), J(r, T);
|
|
673
|
+
} }, q(r, A), r.initialOffsetWidth = r.offsetWidth, Z(r, P, i, { once: !0 }), q(r, T);
|
|
674
|
+
} else q(r, T), this.shown();
|
|
675
|
+
return this;
|
|
676
|
+
},
|
|
677
|
+
hide: function() {
|
|
678
|
+
var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, n = this.element, r = this.options;
|
|
679
|
+
if (r.inline || this.hiding || !(this.isShown || this.showing) || (H(r.hide) && Z(n, ye, r.hide, { once: !0 }), Q(n, ye) === !1)) return this;
|
|
680
|
+
this.showing && this.transitioning.abort(), this.hiding = !0, this.played ? this.stop() : this.viewing && this.viewing.abort();
|
|
681
|
+
var i = this.viewer, a = this.image, o = function() {
|
|
682
|
+
J(i, T), e.hidden();
|
|
683
|
+
};
|
|
684
|
+
if (r.transition && !t) {
|
|
685
|
+
var s = function(t) {
|
|
686
|
+
t && t.target === i && (X(i, P, s), e.hidden());
|
|
687
|
+
}, c = function() {
|
|
688
|
+
K(i, A) ? (Z(i, P, s), J(i, T)) : o();
|
|
689
|
+
};
|
|
690
|
+
this.transitioning = { abort: function() {
|
|
691
|
+
e.viewed && K(a, A) ? X(a, P, c) : K(i, A) && X(i, P, s);
|
|
692
|
+
} }, this.viewed && K(a, A) ? (Z(a, P, c, { once: !0 }), this.zoomTo(0, !1, null, null, !0)) : c();
|
|
693
|
+
} else o();
|
|
694
|
+
return this;
|
|
695
|
+
},
|
|
696
|
+
view: function() {
|
|
697
|
+
var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.initialViewIndex;
|
|
698
|
+
if (t = Number(t) || 0, this.hiding || this.played || t < 0 || t >= this.length || this.viewed && t === this.index) return this;
|
|
699
|
+
if (!this.isShown) return this.index = t, this.show();
|
|
700
|
+
this.viewing && this.viewing.abort();
|
|
701
|
+
var n = this.element, r = this.options, i = this.title, a = this.canvas, o = this.items[t], s = o.querySelector("img"), c = Y(s, "originalUrl"), l = s.getAttribute("alt"), u = document.createElement("img");
|
|
702
|
+
if (U(r.inheritedAttributes, function(e) {
|
|
703
|
+
var t = s.getAttribute(e);
|
|
704
|
+
t !== null && u.setAttribute(e, t);
|
|
705
|
+
}), u.src = c, u.alt = l, H(r.view) && Z(n, xe, r.view, { once: !0 }), Q(n, xe, {
|
|
706
|
+
originalImage: this.images[t],
|
|
707
|
+
index: t,
|
|
708
|
+
image: u
|
|
709
|
+
}) === !1 || !this.isShown || this.hiding || this.played) return this;
|
|
710
|
+
var d = this.items[this.index];
|
|
711
|
+
d && (J(d, y), d.removeAttribute("aria-selected")), q(o, y), o.setAttribute("aria-selected", !0), r.focus && o.focus(), this.image = u, this.viewed = !1, this.index = t, this.imageData = {}, q(u, E), r.loading && q(a, D), a.innerHTML = "", a.appendChild(u), this.renderList(), i.innerHTML = "";
|
|
712
|
+
var f = function() {
|
|
713
|
+
var t = e.imageData, n = Array.isArray(r.title) ? r.title[1] : r.title;
|
|
714
|
+
i.innerHTML = Le(H(n) ? n.call(e, u, t) : `${l} (${t.naturalWidth} × ${t.naturalHeight})`);
|
|
715
|
+
}, p, m;
|
|
716
|
+
return Z(n, F, f, { once: !0 }), this.viewing = { abort: function() {
|
|
717
|
+
X(n, F, f), u.complete ? e.imageRendering ? e.imageRendering.abort() : e.imageInitializing && e.imageInitializing.abort() : (u.src = "", X(u, M, p), e.timeout && clearTimeout(e.timeout));
|
|
718
|
+
} }, u.complete ? this.load() : (Z(u, M, p = function() {
|
|
719
|
+
X(u, N, m), e.load();
|
|
720
|
+
}, { once: !0 }), Z(u, N, m = function() {
|
|
721
|
+
X(u, M, p), e.timeout && (clearTimeout(e.timeout), e.timeout = !1), J(u, E), r.loading && J(e.canvas, D);
|
|
722
|
+
}, { once: !0 }), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(function() {
|
|
723
|
+
J(u, E), e.timeout = !1;
|
|
724
|
+
}, 1e3)), this;
|
|
725
|
+
},
|
|
726
|
+
prev: function() {
|
|
727
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.index - 1;
|
|
728
|
+
return t < 0 && (t = e ? this.length - 1 : 0), this.view(t), this;
|
|
729
|
+
},
|
|
730
|
+
next: function() {
|
|
731
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, t = this.length - 1, n = this.index + 1;
|
|
732
|
+
return n > t && (n = e ? 0 : t), this.view(n), this;
|
|
733
|
+
},
|
|
734
|
+
move: function(e) {
|
|
735
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, n = this.imageData;
|
|
736
|
+
return this.moveTo(z(e) ? e : n.x + Number(e), z(t) ? t : n.y + Number(t)), this;
|
|
737
|
+
},
|
|
738
|
+
moveTo: function(e) {
|
|
739
|
+
var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, i = this.element, a = this.options, o = this.imageData;
|
|
740
|
+
if (e = Number(e), n = Number(n), this.viewed && !this.played && a.movable) {
|
|
741
|
+
var s = o.x, c = o.y, l = !1;
|
|
742
|
+
if (R(e) ? l = !0 : e = s, R(n) ? l = !0 : n = c, l) {
|
|
743
|
+
if (H(a.move) && Z(i, Se, a.move, { once: !0 }), Q(i, Se, {
|
|
744
|
+
x: e,
|
|
745
|
+
y: n,
|
|
746
|
+
oldX: s,
|
|
747
|
+
oldY: c,
|
|
748
|
+
originalEvent: r
|
|
749
|
+
}) === !1) return this;
|
|
750
|
+
o.x = e, o.y = n, o.left = e, o.top = n, this.moving = !0, this.renderImage(function() {
|
|
751
|
+
t.moving = !1, H(a.moved) && Z(i, Ce, a.moved, { once: !0 }), Q(i, Ce, {
|
|
752
|
+
x: e,
|
|
753
|
+
y: n,
|
|
754
|
+
oldX: s,
|
|
755
|
+
oldY: c,
|
|
756
|
+
originalEvent: r
|
|
757
|
+
}, { cancelable: !1 });
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return this;
|
|
762
|
+
},
|
|
763
|
+
rotate: function(e) {
|
|
764
|
+
return this.rotateTo((this.imageData.rotate || 0) + Number(e)), this;
|
|
765
|
+
},
|
|
766
|
+
rotateTo: function(e) {
|
|
767
|
+
var t = this, n = this.element, r = this.options, i = this.imageData;
|
|
768
|
+
if (e = Number(e), R(e) && this.viewed && !this.played && r.rotatable) {
|
|
769
|
+
var a = i.rotate;
|
|
770
|
+
if (H(r.rotate) && Z(n, we, r.rotate, { once: !0 }), Q(n, we, {
|
|
771
|
+
degree: e,
|
|
772
|
+
oldDegree: a
|
|
773
|
+
}) === !1) return this;
|
|
774
|
+
i.rotate = e, this.rotating = !0, this.renderImage(function() {
|
|
775
|
+
t.rotating = !1, H(r.rotated) && Z(n, Te, r.rotated, { once: !0 }), Q(n, Te, {
|
|
776
|
+
degree: e,
|
|
777
|
+
oldDegree: a
|
|
778
|
+
}, { cancelable: !1 });
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
return this;
|
|
782
|
+
},
|
|
783
|
+
scaleX: function(e) {
|
|
784
|
+
return this.scale(e, this.imageData.scaleY), this;
|
|
785
|
+
},
|
|
786
|
+
scaleY: function(e) {
|
|
787
|
+
return this.scale(this.imageData.scaleX, e), this;
|
|
788
|
+
},
|
|
789
|
+
scale: function(e) {
|
|
790
|
+
var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : e, r = this.element, i = this.options, a = this.imageData;
|
|
791
|
+
if (e = Number(e), n = Number(n), this.viewed && !this.played && i.scalable) {
|
|
792
|
+
var o = a.scaleX, s = a.scaleY, c = !1;
|
|
793
|
+
if (R(e) ? c = !0 : e = o, R(n) ? c = !0 : n = s, c) {
|
|
794
|
+
if (H(i.scale) && Z(r, Ee, i.scale, { once: !0 }), Q(r, Ee, {
|
|
795
|
+
scaleX: e,
|
|
796
|
+
scaleY: n,
|
|
797
|
+
oldScaleX: o,
|
|
798
|
+
oldScaleY: s
|
|
799
|
+
}) === !1) return this;
|
|
800
|
+
a.scaleX = e, a.scaleY = n, this.scaling = !0, this.renderImage(function() {
|
|
801
|
+
t.scaling = !1, H(i.scaled) && Z(r, De, i.scaled, { once: !0 }), Q(r, De, {
|
|
802
|
+
scaleX: e,
|
|
803
|
+
scaleY: n,
|
|
804
|
+
oldScaleX: o,
|
|
805
|
+
oldScaleY: s
|
|
806
|
+
}, { cancelable: !1 });
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
return this;
|
|
811
|
+
},
|
|
812
|
+
zoom: function(e) {
|
|
813
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, i = this.imageData;
|
|
814
|
+
return e = Number(e), e = e < 0 ? 1 / (1 - e) : 1 + e, this.zoomTo(i.width * e / i.naturalWidth, t, n, r), this;
|
|
815
|
+
},
|
|
816
|
+
zoomTo: function(e) {
|
|
817
|
+
var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, o = this.element, s = this.options, c = this.pointers, l = this.imageData, u = l.x, d = l.y, f = l.width, p = l.height, m = l.naturalWidth, h = l.naturalHeight;
|
|
818
|
+
if (e = Math.max(0, e), R(e) && this.viewed && !this.played && (a || s.zoomable)) {
|
|
819
|
+
if (!a) {
|
|
820
|
+
var g = Math.max(.01, s.minZoomRatio), _ = Math.min(100, s.maxZoomRatio);
|
|
821
|
+
e = Math.min(Math.max(e, g), _);
|
|
822
|
+
}
|
|
823
|
+
if (i) switch (i.type) {
|
|
824
|
+
case "wheel":
|
|
825
|
+
s.zoomRatio >= .055 && e > .95 && e < 1.05 && (e = 1);
|
|
826
|
+
break;
|
|
827
|
+
case "pointermove":
|
|
828
|
+
case "touchmove":
|
|
829
|
+
case "mousemove":
|
|
830
|
+
e > .99 && e < 1.01 && (e = 1);
|
|
831
|
+
break;
|
|
832
|
+
}
|
|
833
|
+
var v = m * e, y = h * e, b = v - f, x = y - p, S = l.ratio;
|
|
834
|
+
if (H(s.zoom) && Z(o, Oe, s.zoom, { once: !0 }), Q(o, Oe, {
|
|
835
|
+
ratio: e,
|
|
836
|
+
oldRatio: S,
|
|
837
|
+
originalEvent: i
|
|
838
|
+
}) === !1) return this;
|
|
839
|
+
if (this.zooming = !0, i) {
|
|
840
|
+
var ee = Ue(this.viewer), te = c && Object.keys(c).length > 0 ? Ze(c) : {
|
|
841
|
+
pageX: i.pageX,
|
|
842
|
+
pageY: i.pageY
|
|
843
|
+
};
|
|
844
|
+
l.x -= b * ((te.pageX - ee.left - u) / f), l.y -= x * ((te.pageY - ee.top - d) / p);
|
|
845
|
+
} else V(r) && R(r.x) && R(r.y) ? (l.x -= b * ((r.x - u) / f), l.y -= x * ((r.y - d) / p)) : (l.x -= b / 2, l.y -= x / 2);
|
|
846
|
+
l.left = l.x, l.top = l.y, l.width = v, l.height = y, l.oldRatio = S, l.ratio = e, this.renderImage(function() {
|
|
847
|
+
t.zooming = !1, H(s.zoomed) && Z(o, ke, s.zoomed, { once: !0 }), Q(o, ke, {
|
|
848
|
+
ratio: e,
|
|
849
|
+
oldRatio: S,
|
|
850
|
+
originalEvent: i
|
|
851
|
+
}, { cancelable: !1 });
|
|
852
|
+
}), n && this.tooltip();
|
|
853
|
+
}
|
|
854
|
+
return this;
|
|
855
|
+
},
|
|
856
|
+
play: function() {
|
|
857
|
+
var e = this, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
858
|
+
if (!this.isShown || this.played) return this;
|
|
859
|
+
var n = this.element, r = this.options;
|
|
860
|
+
if (H(r.play) && Z(n, Ae, r.play, { once: !0 }), Q(n, Ae) === !1) return this;
|
|
861
|
+
var i = this.player, a = this.loadImage.bind(this), o = [], s = 0, c = 0;
|
|
862
|
+
if (this.played = !0, this.onLoadWhenPlay = a, t && this.requestFullscreen(t), q(i, k), U(this.items, function(e, t) {
|
|
863
|
+
var n = e.querySelector("img"), l = document.createElement("img");
|
|
864
|
+
l.src = Y(n, "originalUrl"), l.alt = n.getAttribute("alt"), l.referrerPolicy = n.referrerPolicy, s += 1, q(l, x), Re(l, A, r.transition), K(e, y) && (q(l, T), c = t), o.push(l), Z(l, M, a, { once: !0 }), i.appendChild(l);
|
|
865
|
+
}), R(r.interval) && r.interval > 0) {
|
|
866
|
+
var l = function() {
|
|
867
|
+
clearTimeout(e.playing.timeout), J(o[c], T), --c, c = c >= 0 ? c : s - 1, q(o[c], T), e.playing.timeout = setTimeout(l, r.interval);
|
|
868
|
+
}, u = function() {
|
|
869
|
+
clearTimeout(e.playing.timeout), J(o[c], T), c += 1, c = c < s ? c : 0, q(o[c], T), e.playing.timeout = setTimeout(u, r.interval);
|
|
870
|
+
};
|
|
871
|
+
s > 1 && (this.playing = {
|
|
872
|
+
prev: l,
|
|
873
|
+
next: u,
|
|
874
|
+
timeout: setTimeout(u, r.interval)
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
return this;
|
|
878
|
+
},
|
|
879
|
+
stop: function() {
|
|
880
|
+
var e = this;
|
|
881
|
+
if (!this.played) return this;
|
|
882
|
+
var t = this.element, n = this.options;
|
|
883
|
+
if (H(n.stop) && Z(t, je, n.stop, { once: !0 }), Q(t, je) === !1) return this;
|
|
884
|
+
var r = this.player;
|
|
885
|
+
return clearTimeout(this.playing.timeout), this.playing = !1, this.played = !1, U(r.getElementsByTagName("img"), function(t) {
|
|
886
|
+
X(t, M, e.onLoadWhenPlay);
|
|
887
|
+
}), J(r, k), r.innerHTML = "", this.exitFullscreen(), this;
|
|
888
|
+
},
|
|
889
|
+
full: function() {
|
|
890
|
+
var e = this, t = this.options, n = this.viewer, r = this.image, i = this.list;
|
|
891
|
+
return !this.isShown || this.played || this.fulled || !t.inline ? this : (this.fulled = !0, this.open(), q(this.button, te), t.transition && (J(i, A), this.viewed && J(r, A)), q(n, S), n.setAttribute("role", "dialog"), n.setAttribute("aria-labelledby", this.title.id), n.setAttribute("aria-modal", !0), n.removeAttribute("style"), G(n, { zIndex: t.zIndex }), t.focus && this.enforceFocus(), this.initContainer(), this.viewerData = W({}, this.containerData), this.renderList(), this.viewed && this.initImage(function() {
|
|
892
|
+
e.renderImage(function() {
|
|
893
|
+
t.transition && setTimeout(function() {
|
|
894
|
+
q(r, A), q(i, A);
|
|
895
|
+
}, 0);
|
|
896
|
+
});
|
|
897
|
+
}), this);
|
|
898
|
+
},
|
|
899
|
+
exit: function() {
|
|
900
|
+
var e = this, t = this.options, n = this.viewer, r = this.image, i = this.list;
|
|
901
|
+
return !this.isShown || this.played || !this.fulled || !t.inline ? this : (this.fulled = !1, this.close(), J(this.button, te), t.transition && (J(i, A), this.viewed && J(r, A)), t.focus && this.clearEnforceFocus(), n.removeAttribute("role"), n.removeAttribute("aria-labelledby"), n.removeAttribute("aria-modal"), J(n, S), G(n, { zIndex: t.zIndexInline }), this.viewerData = W({}, this.parentData), this.renderViewer(), this.renderList(), this.viewed && this.initImage(function() {
|
|
902
|
+
e.renderImage(function() {
|
|
903
|
+
t.transition && setTimeout(function() {
|
|
904
|
+
q(r, A), q(i, A);
|
|
905
|
+
}, 0);
|
|
906
|
+
});
|
|
907
|
+
}), this);
|
|
908
|
+
},
|
|
909
|
+
tooltip: function() {
|
|
910
|
+
var e = this, t = this.options, n = this.tooltipBox, r = this.imageData;
|
|
911
|
+
return !this.viewed || this.played || !t.tooltip ? this : (n.textContent = `${Math.round(r.ratio * 100)}%`, this.tooltipping ? clearTimeout(this.tooltipping) : t.transition ? (this.fading && Q(n, P), q(n, k), q(n, x), q(n, A), n.removeAttribute("aria-hidden"), n.initialOffsetWidth = n.offsetWidth, q(n, T)) : (q(n, k), n.removeAttribute("aria-hidden")), this.tooltipping = setTimeout(function() {
|
|
912
|
+
t.transition ? (Z(n, P, function() {
|
|
913
|
+
J(n, k), J(n, x), J(n, A), n.setAttribute("aria-hidden", !0), e.fading = !1;
|
|
914
|
+
}, { once: !0 }), J(n, T), e.fading = !0) : (J(n, k), n.setAttribute("aria-hidden", !0)), e.tooltipping = !1;
|
|
915
|
+
}, 1e3), this);
|
|
916
|
+
},
|
|
917
|
+
toggle: function() {
|
|
918
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
919
|
+
return this.imageData.ratio === 1 ? this.zoomTo(this.imageData.oldRatio, !0, null, e) : this.zoomTo(1, !0, null, e), this;
|
|
920
|
+
},
|
|
921
|
+
reset: function() {
|
|
922
|
+
return this.viewed && !this.played && (this.imageData = W({}, this.initialImageData), this.renderImage()), this;
|
|
923
|
+
},
|
|
924
|
+
update: function() {
|
|
925
|
+
var e = this, t = this.element, n = this.options, r = this.isImg;
|
|
926
|
+
if (r && !t.parentNode) return this.destroy();
|
|
927
|
+
var i = [];
|
|
928
|
+
if (U(r ? [t] : t.querySelectorAll("img"), function(t) {
|
|
929
|
+
H(n.filter) ? n.filter.call(e, t) && i.push(t) : e.getImageURL(t) && i.push(t);
|
|
930
|
+
}), !i.length) return this;
|
|
931
|
+
if (this.images = i, this.length = i.length, this.ready) {
|
|
932
|
+
var a = [];
|
|
933
|
+
if (U(this.items, function(e, t) {
|
|
934
|
+
var n = e.querySelector("img"), r = i[t];
|
|
935
|
+
r && n ? (r.src !== n.src || r.alt !== n.alt) && a.push(t) : a.push(t);
|
|
936
|
+
}), G(this.list, { width: "auto" }), this.initList(), this.isShown) if (this.length) {
|
|
937
|
+
if (this.viewed) {
|
|
938
|
+
var o = a.indexOf(this.index);
|
|
939
|
+
if (o >= 0) this.viewed = !1, this.view(Math.max(Math.min(this.index - o, this.length - 1), 0));
|
|
940
|
+
else {
|
|
941
|
+
var s = this.items[this.index];
|
|
942
|
+
q(s, y), s.setAttribute("aria-selected", !0);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
} else this.image = null, this.viewed = !1, this.index = 0, this.imageData = {}, this.canvas.innerHTML = "", this.title.innerHTML = "";
|
|
946
|
+
} else this.build();
|
|
947
|
+
return this;
|
|
948
|
+
},
|
|
949
|
+
destroy: function() {
|
|
950
|
+
var e = this.element, t = this.options;
|
|
951
|
+
return e[h] ? (this.destroyed = !0, this.ready ? (this.played && this.stop(), t.inline ? (this.fulled && this.exit(), this.unbind()) : this.isShown ? (this.viewing && (this.imageRendering ? this.imageRendering.abort() : this.imageInitializing && this.imageInitializing.abort()), this.hiding && this.transitioning.abort(), this.hidden()) : this.showing && (this.transitioning.abort(), this.hidden()), this.ready = !1, this.viewer.parentNode.removeChild(this.viewer)) : t.inline && (this.delaying ? this.delaying.abort() : this.initializing && this.initializing.abort()), t.inline || X(e, j, this.onStart), e[h] = void 0, this) : this;
|
|
952
|
+
}
|
|
953
|
+
}, nt = {
|
|
954
|
+
getImageURL: function(e) {
|
|
955
|
+
var t = this.options.url;
|
|
956
|
+
return t = L(t) ? e.getAttribute(t) : H(t) ? t.call(this, e) : "", t;
|
|
957
|
+
},
|
|
958
|
+
enforceFocus: function() {
|
|
959
|
+
var e = this;
|
|
960
|
+
this.clearEnforceFocus(), Z(document, se, this.onFocusin = function(t) {
|
|
961
|
+
var n = e.viewer, r = t.target;
|
|
962
|
+
if (!(r === document || r === n || n.contains(r))) {
|
|
963
|
+
for (; r;) {
|
|
964
|
+
if (r.getAttribute("tabindex") !== null || r.getAttribute("aria-modal") === "true") return;
|
|
965
|
+
r = r.parentElement;
|
|
966
|
+
}
|
|
967
|
+
n.focus();
|
|
968
|
+
}
|
|
969
|
+
});
|
|
970
|
+
},
|
|
971
|
+
clearEnforceFocus: function() {
|
|
972
|
+
this.onFocusin && (X(document, se, this.onFocusin), this.onFocusin = null);
|
|
973
|
+
},
|
|
974
|
+
open: function() {
|
|
975
|
+
var e = this.body;
|
|
976
|
+
q(e, ie), this.scrollbarWidth > 0 && (e.style.paddingRight = `${this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0)}px`);
|
|
977
|
+
},
|
|
978
|
+
close: function() {
|
|
979
|
+
var e = this.body;
|
|
980
|
+
J(e, ie), this.scrollbarWidth > 0 && (e.style.paddingRight = this.initialBodyPaddingRight);
|
|
981
|
+
},
|
|
982
|
+
shown: function() {
|
|
983
|
+
var e = this.element, t = this.options, n = this.viewer;
|
|
984
|
+
this.fulled = !0, this.isShown = !0, this.render(), this.bind(), this.showing = !1, t.focus && (n.focus(), this.enforceFocus()), H(t.shown) && Z(e, ve, t.shown, { once: !0 }), Q(e, ve) !== !1 && this.ready && this.isShown && !this.hiding && this.view(this.index);
|
|
985
|
+
},
|
|
986
|
+
hidden: function() {
|
|
987
|
+
var e = this.element, t = this.options, n = this.viewer;
|
|
988
|
+
t.fucus && this.clearEnforceFocus(), this.close(), this.unbind(), q(n, C), n.removeAttribute("role"), n.removeAttribute("aria-labelledby"), n.removeAttribute("aria-modal"), n.setAttribute("aria-hidden", !0), this.resetList(), this.resetImage(), this.fulled = !1, this.viewed = !1, this.isShown = !1, this.hiding = !1, this.destroyed || (H(t.hidden) && Z(e, be, t.hidden, { once: !0 }), Q(e, be, null, { cancelable: !1 }));
|
|
989
|
+
},
|
|
990
|
+
requestFullscreen: function(e) {
|
|
991
|
+
var t = this.element.ownerDocument;
|
|
992
|
+
if (this.fulled && !(t.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement)) {
|
|
993
|
+
var n = t.documentElement;
|
|
994
|
+
n.requestFullscreen ? V(e) ? n.requestFullscreen(e) : n.requestFullscreen() : n.webkitRequestFullscreen ? n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : n.mozRequestFullScreen ? n.mozRequestFullScreen() : n.msRequestFullscreen && n.msRequestFullscreen();
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
exitFullscreen: function() {
|
|
998
|
+
var e = this.element.ownerDocument;
|
|
999
|
+
this.fulled && (e.fullscreenElement || e.webkitFullscreenElement || e.mozFullScreenElement || e.msFullscreenElement) && (e.exitFullscreen ? e.exitFullscreen() : e.webkitExitFullscreen ? e.webkitExitFullscreen() : e.mozCancelFullScreen ? e.mozCancelFullScreen() : e.msExitFullscreen && e.msExitFullscreen());
|
|
1000
|
+
},
|
|
1001
|
+
change: function(e) {
|
|
1002
|
+
var t = this.options, n = this.pointers, r = n[Object.keys(n)[0]];
|
|
1003
|
+
if (r) {
|
|
1004
|
+
var i = r.endX - r.startX, a = r.endY - r.startY;
|
|
1005
|
+
switch (this.action) {
|
|
1006
|
+
case g:
|
|
1007
|
+
(i !== 0 || a !== 0) && (this.pointerMoved = !0, this.move(i, a, e));
|
|
1008
|
+
break;
|
|
1009
|
+
case v:
|
|
1010
|
+
this.zoom(Ye(n), !1, null, e);
|
|
1011
|
+
break;
|
|
1012
|
+
case _:
|
|
1013
|
+
this.action = "switched";
|
|
1014
|
+
var o = Math.abs(i);
|
|
1015
|
+
o > 1 && o > Math.abs(a) && (this.pointers = {}, i > 1 ? this.prev(t.loop) : i < -1 && this.next(t.loop));
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
U(n, function(e) {
|
|
1019
|
+
e.startX = e.endX, e.startY = e.endY;
|
|
1020
|
+
});
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
isSwitchable: function() {
|
|
1024
|
+
var e = this.imageData, t = this.viewerData;
|
|
1025
|
+
return this.length > 1 && e.x >= 0 && e.y >= 0 && e.width <= t.width && e.height <= t.height;
|
|
1026
|
+
}
|
|
1027
|
+
}, rt = f.Viewer, it = function(e) {
|
|
1028
|
+
return function() {
|
|
1029
|
+
return e += 1, e;
|
|
1030
|
+
};
|
|
1031
|
+
}(-1), at = /*#__PURE__*/ function() {
|
|
1032
|
+
function t(n) {
|
|
1033
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1034
|
+
if (e(this, t), !n || n.nodeType !== 1) throw Error("The first argument is required and must be an element.");
|
|
1035
|
+
this.element = n, this.options = W({}, l, V(r) && r), this.action = !1, this.fading = !1, this.fulled = !1, this.hiding = !1, this.imageClicked = !1, this.imageData = {}, this.index = this.options.initialViewIndex, this.isImg = !1, this.isShown = !1, this.length = 0, this.moving = !1, this.played = !1, this.playing = !1, this.pointers = {}, this.ready = !1, this.rotating = !1, this.scaling = !1, this.showing = !1, this.timeout = !1, this.tooltipping = !1, this.viewed = !1, this.viewing = !1, this.wheeling = !1, this.zooming = !1, this.pointerMoved = !1, this.id = it(), this.init();
|
|
1036
|
+
}
|
|
1037
|
+
return n(t, [{
|
|
1038
|
+
key: "init",
|
|
1039
|
+
value: function() {
|
|
1040
|
+
var e = this, t = this.element, n = this.options;
|
|
1041
|
+
if (!t[h]) {
|
|
1042
|
+
t[h] = this, n.focus && !n.keyboard && (n.focus = !1);
|
|
1043
|
+
var r = t.localName === "img", i = [];
|
|
1044
|
+
if (U(r ? [t] : t.querySelectorAll("img"), function(t) {
|
|
1045
|
+
H(n.filter) ? n.filter.call(e, t) && i.push(t) : e.getImageURL(t) && i.push(t);
|
|
1046
|
+
}), this.isImg = r, this.length = i.length, this.images = i, this.initBody(), z(document.createElement(h).style.transition) && (n.transition = !1), n.inline) {
|
|
1047
|
+
var a = 0, o = function() {
|
|
1048
|
+
if (a += 1, a === e.length) {
|
|
1049
|
+
var t;
|
|
1050
|
+
e.initializing = !1, e.delaying = { abort: function() {
|
|
1051
|
+
clearTimeout(t);
|
|
1052
|
+
} }, t = setTimeout(function() {
|
|
1053
|
+
e.delaying = !1, e.build();
|
|
1054
|
+
}, 0);
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
this.initializing = { abort: function() {
|
|
1058
|
+
U(i, function(e) {
|
|
1059
|
+
e.complete || (X(e, M, o), X(e, N, o));
|
|
1060
|
+
});
|
|
1061
|
+
} }, U(i, function(e) {
|
|
1062
|
+
if (e.complete) o();
|
|
1063
|
+
else {
|
|
1064
|
+
var t, n;
|
|
1065
|
+
Z(e, M, t = function() {
|
|
1066
|
+
X(e, N, n), o();
|
|
1067
|
+
}, { once: !0 }), Z(e, N, n = function() {
|
|
1068
|
+
X(e, M, t), o();
|
|
1069
|
+
}, { once: !0 });
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
} else Z(t, j, this.onStart = function(t) {
|
|
1073
|
+
var r = t.target;
|
|
1074
|
+
r.localName === "img" && (!H(n.filter) || n.filter.call(e, r)) && e.view(e.images.indexOf(r));
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}, {
|
|
1079
|
+
key: "build",
|
|
1080
|
+
value: function() {
|
|
1081
|
+
if (!this.ready) {
|
|
1082
|
+
var e = this.element, t = this.options, n = e.parentNode, r = document.createElement("div");
|
|
1083
|
+
r.innerHTML = u;
|
|
1084
|
+
var i = r.querySelector(`.${h}-container`), a = i.querySelector(`.${h}-title`), o = i.querySelector(`.${h}-toolbar`), s = i.querySelector(`.${h}-navbar`), c = i.querySelector(`.${h}-button`), l = i.querySelector(`.${h}-canvas`);
|
|
1085
|
+
if (this.parent = n, this.viewer = i, this.title = a, this.toolbar = o, this.navbar = s, this.button = c, this.canvas = l, this.footer = i.querySelector(`.${h}-footer`), this.tooltipBox = i.querySelector(`.${h}-tooltip`), this.player = i.querySelector(`.${h}-player`), this.list = i.querySelector(`.${h}-list`), i.id = `${h}${this.id}`, a.id = `${h}Title${this.id}`, q(a, t.title ? Je(Array.isArray(t.title) ? t.title[0] : t.title) : C), q(s, t.navbar ? Je(t.navbar) : C), Re(c, C, !t.button), t.keyboard && c.setAttribute("tabindex", 0), t.backdrop && (q(i, `${h}-backdrop`), !t.inline && t.backdrop !== "static" && Ve(l, Me, "hide")), L(t.className) && t.className && t.className.split(Ne).forEach(function(e) {
|
|
1086
|
+
q(i, e);
|
|
1087
|
+
}), t.toolbar) {
|
|
1088
|
+
var d = document.createElement("ul"), f = V(t.toolbar), p = I.slice(0, 3), m = I.slice(7, 9), g = I.slice(9);
|
|
1089
|
+
f || q(o, Je(t.toolbar)), U(f ? t.toolbar : I, function(e, n) {
|
|
1090
|
+
var r = f && V(e), i = f ? Be(n) : e, a = r && !z(e.show) ? e.show : e;
|
|
1091
|
+
if (!(!a || !t.zoomable && p.indexOf(i) !== -1 || !t.rotatable && m.indexOf(i) !== -1 || !t.scalable && g.indexOf(i) !== -1)) {
|
|
1092
|
+
var o = r && !z(e.size) ? e.size : e, s = r && !z(e.click) ? e.click : e, c = document.createElement("li");
|
|
1093
|
+
t.keyboard && c.setAttribute("tabindex", 0), c.setAttribute("role", "button"), q(c, `${h}-${i}`), H(s) || Ve(c, Me, i), R(a) && q(c, Je(a)), ["small", "large"].indexOf(o) === -1 ? i === "play" && q(c, `${h}-large`) : q(c, `${h}-${o}`), H(s) && Z(c, j, s), d.appendChild(c);
|
|
1094
|
+
}
|
|
1095
|
+
}), o.appendChild(d);
|
|
1096
|
+
} else q(o, C);
|
|
1097
|
+
if (!t.rotatable) {
|
|
1098
|
+
var _ = o.querySelectorAll("li[class*=\"rotate\"]");
|
|
1099
|
+
q(_, E), U(_, function(e) {
|
|
1100
|
+
o.appendChild(e);
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
if (t.inline) q(c, ee), G(i, { zIndex: t.zIndexInline }), window.getComputedStyle(n).position === "static" && G(n, { position: "relative" }), n.insertBefore(i, e.nextSibling);
|
|
1104
|
+
else {
|
|
1105
|
+
q(c, b), q(i, S), q(i, x), q(i, C), G(i, { zIndex: t.zIndex });
|
|
1106
|
+
var v = t.container;
|
|
1107
|
+
L(v) && (v = e.ownerDocument.querySelector(v)), v || (v = this.body), v.appendChild(i);
|
|
1108
|
+
}
|
|
1109
|
+
if (t.inline && (this.render(), this.bind(), this.isShown = !0), this.ready = !0, H(t.ready) && Z(e, ge, t.ready, { once: !0 }), Q(e, ge) === !1) {
|
|
1110
|
+
this.ready = !1;
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
this.ready && t.inline && this.view(this.index);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}], [{
|
|
1117
|
+
key: "noConflict",
|
|
1118
|
+
value: function() {
|
|
1119
|
+
return window.Viewer = rt, t;
|
|
1120
|
+
}
|
|
1121
|
+
}, {
|
|
1122
|
+
key: "setDefaults",
|
|
1123
|
+
value: function(e) {
|
|
1124
|
+
W(l, V(e) && e);
|
|
1125
|
+
}
|
|
1126
|
+
}]);
|
|
1127
|
+
}();
|
|
1128
|
+
return W(at.prototype, Qe, $e, et, tt, nt), at;
|
|
1129
|
+
}));
|
|
1130
|
+
})))(), 1);
|
|
1131
|
+
n();
|
|
1132
|
+
var C = typeof global == "object" && global && global.Object === Object && global, ne = typeof self == "object" && self && self.Object === Object && self, re = C || ne || Function("return this")(), w = re.Symbol, T = Object.prototype, E = T.hasOwnProperty, D = T.toString, O = w ? w.toStringTag : void 0;
|
|
1133
|
+
function ie(e) {
|
|
1134
|
+
var t = E.call(e, O), n = e[O];
|
|
1135
|
+
try {
|
|
1136
|
+
e[O] = void 0;
|
|
1137
|
+
var r = !0;
|
|
1138
|
+
} catch (e) {}
|
|
1139
|
+
var i = D.call(e);
|
|
1140
|
+
return r && (t ? e[O] = n : delete e[O]), i;
|
|
1141
|
+
}
|
|
1142
|
+
var k = Object.prototype.toString;
|
|
1143
|
+
function A(e) {
|
|
1144
|
+
return k.call(e);
|
|
1145
|
+
}
|
|
1146
|
+
var j = "[object Null]", ae = "[object Undefined]", oe = w ? w.toStringTag : void 0;
|
|
1147
|
+
function se(e) {
|
|
1148
|
+
return e == null ? e === void 0 ? ae : j : oe && oe in Object(e) ? ie(e) : A(e);
|
|
1149
|
+
}
|
|
1150
|
+
function ce(e) {
|
|
1151
|
+
return typeof e == "object" && !!e;
|
|
1152
|
+
}
|
|
1153
|
+
var M = Array.isArray;
|
|
1154
|
+
function N(e) {
|
|
1155
|
+
var t = typeof e;
|
|
1156
|
+
return e != null && (t == "object" || t == "function");
|
|
1157
|
+
}
|
|
1158
|
+
function le(e) {
|
|
1159
|
+
return e;
|
|
1160
|
+
}
|
|
1161
|
+
var ue = "[object AsyncFunction]", de = "[object Function]", fe = "[object GeneratorFunction]", pe = "[object Proxy]";
|
|
1162
|
+
function me(e) {
|
|
1163
|
+
if (!N(e)) return !1;
|
|
1164
|
+
var t = se(e);
|
|
1165
|
+
return t == de || t == fe || t == ue || t == pe;
|
|
1166
|
+
}
|
|
1167
|
+
var P = re["__core-js_shared__"], he = function() {
|
|
1168
|
+
var e = /[^.]+$/.exec(P && P.keys && P.keys.IE_PROTO || "");
|
|
1169
|
+
return e ? "Symbol(src)_1." + e : "";
|
|
417
1170
|
}();
|
|
418
|
-
function
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
var
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}
|
|
563
|
-
}), this.items = a, y(a, function(s) {
|
|
564
|
-
var l = s.firstElementChild, h, o;
|
|
565
|
-
xt(l, "filled", !0), r.loading && f(s, Z), d(l, $, h = function(c) {
|
|
566
|
-
b(l, W, o), r.loading && m(s, Z), t.loadImage(c);
|
|
567
|
-
}, {
|
|
568
|
-
once: !0
|
|
569
|
-
}), d(l, W, o = function() {
|
|
570
|
-
b(l, $, h), r.loading && m(s, Z);
|
|
571
|
-
}, {
|
|
572
|
-
once: !0
|
|
573
|
-
});
|
|
574
|
-
}), r.transition && d(i, nt, function() {
|
|
575
|
-
f(n, O);
|
|
576
|
-
}, {
|
|
577
|
-
once: !0
|
|
578
|
-
});
|
|
579
|
-
},
|
|
580
|
-
renderList: function() {
|
|
581
|
-
var t = this.index, i = this.items[t];
|
|
582
|
-
if (i) {
|
|
583
|
-
var r = i.nextElementSibling, n = parseInt(window.getComputedStyle(r || i).marginLeft, 10), a = i.offsetWidth, s = a + n;
|
|
584
|
-
z(this.list, C({
|
|
585
|
-
width: s * this.length - n
|
|
586
|
-
}, gt({
|
|
587
|
-
translateX: (this.viewerData.width - a) / 2 - s * t
|
|
588
|
-
})));
|
|
589
|
-
}
|
|
590
|
-
},
|
|
591
|
-
resetList: function() {
|
|
592
|
-
var t = this.list;
|
|
593
|
-
t.innerHTML = "", m(t, O), z(t, gt({
|
|
594
|
-
translateX: 0
|
|
595
|
-
}));
|
|
596
|
-
},
|
|
597
|
-
initImage: function(t) {
|
|
598
|
-
var i = this, r = this.options, n = this.image, a = this.viewerData, s = this.footer.offsetHeight, l = a.width, h = Math.max(a.height - s, s), o = this.imageData || {}, u;
|
|
599
|
-
this.imageInitializing = {
|
|
600
|
-
abort: function() {
|
|
601
|
-
u.onload = null;
|
|
602
|
-
}
|
|
603
|
-
}, u = Ie(n, r, function(c, g) {
|
|
604
|
-
var I = c / g, S = Math.max(0, Math.min(1, r.initialCoverage)), E = l, x = h;
|
|
605
|
-
i.imageInitializing = !1, h * I > l ? x = l / I : E = h * I, S = _(S) ? S : 0.9, E = Math.min(E * S, c), x = Math.min(x * S, g);
|
|
606
|
-
var D = (l - E) / 2, N = (h - x) / 2, T = {
|
|
607
|
-
left: D,
|
|
608
|
-
top: N,
|
|
609
|
-
x: D,
|
|
610
|
-
y: N,
|
|
611
|
-
width: E,
|
|
612
|
-
height: x,
|
|
613
|
-
oldRatio: 1,
|
|
614
|
-
ratio: E / c,
|
|
615
|
-
aspectRatio: I,
|
|
616
|
-
naturalWidth: c,
|
|
617
|
-
naturalHeight: g
|
|
618
|
-
}, R = C({}, T);
|
|
619
|
-
r.rotatable && (T.rotate = o.rotate || 0, R.rotate = 0), r.scalable && (T.scaleX = o.scaleX || 1, T.scaleY = o.scaleY || 1, R.scaleX = 1, R.scaleY = 1), i.imageData = T, i.initialImageData = R, t && t();
|
|
620
|
-
});
|
|
621
|
-
},
|
|
622
|
-
renderImage: function(t) {
|
|
623
|
-
var i = this, r = this.image, n = this.imageData;
|
|
624
|
-
if (z(r, C({
|
|
625
|
-
width: n.width,
|
|
626
|
-
height: n.height,
|
|
627
|
-
// XXX: Not to use translateX/Y to avoid image shaking when zooming
|
|
628
|
-
marginLeft: n.x,
|
|
629
|
-
marginTop: n.y
|
|
630
|
-
}, gt(n))), t)
|
|
631
|
-
if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && H(r, O)) {
|
|
632
|
-
var a = function() {
|
|
633
|
-
i.imageRendering = !1, t();
|
|
634
|
-
};
|
|
635
|
-
this.imageRendering = {
|
|
636
|
-
abort: function() {
|
|
637
|
-
b(r, k, a);
|
|
638
|
-
}
|
|
639
|
-
}, d(r, k, a, {
|
|
640
|
-
once: !0
|
|
641
|
-
});
|
|
642
|
-
} else
|
|
643
|
-
t();
|
|
644
|
-
},
|
|
645
|
-
resetImage: function() {
|
|
646
|
-
if (this.viewing || this.viewed) {
|
|
647
|
-
var t = this.image;
|
|
648
|
-
this.viewing && this.viewing.abort(), t.parentNode.removeChild(t), this.image = null;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}, yi = {
|
|
652
|
-
bind: function() {
|
|
653
|
-
var t = this.options, i = this.viewer, r = this.canvas, n = this.element.ownerDocument;
|
|
654
|
-
d(i, J, this.onClick = this.click.bind(this)), d(i, Wt, this.onDragStart = this.dragstart.bind(this)), d(r, Ht, this.onPointerDown = this.pointerdown.bind(this)), d(n, Ut, this.onPointerMove = this.pointermove.bind(this)), d(n, Bt, this.onPointerUp = this.pointerup.bind(this)), d(n, qt, this.onKeyDown = this.keydown.bind(this)), d(window, Kt, this.onResize = this.resize.bind(this)), t.zoomable && t.zoomOnWheel && d(i, Gt, this.onWheel = this.wheel.bind(this), {
|
|
655
|
-
passive: !1,
|
|
656
|
-
capture: !0
|
|
657
|
-
}), t.toggleOnDblclick && d(r, At, this.onDblclick = this.dblclick.bind(this));
|
|
658
|
-
},
|
|
659
|
-
unbind: function() {
|
|
660
|
-
var t = this.options, i = this.viewer, r = this.canvas, n = this.element.ownerDocument;
|
|
661
|
-
b(i, J, this.onClick), b(i, Wt, this.onDragStart), b(r, Ht, this.onPointerDown), b(n, Ut, this.onPointerMove), b(n, Bt, this.onPointerUp), b(n, qt, this.onKeyDown), b(window, Kt, this.onResize), t.zoomable && t.zoomOnWheel && b(i, Gt, this.onWheel, {
|
|
662
|
-
passive: !1,
|
|
663
|
-
capture: !0
|
|
664
|
-
}), t.toggleOnDblclick && b(r, At, this.onDblclick);
|
|
665
|
-
}
|
|
666
|
-
}, wi = {
|
|
667
|
-
click: function(t) {
|
|
668
|
-
var i = this.options, r = this.imageData, n = t.target, a = K(n, mt);
|
|
669
|
-
switch (!a && n.localName === "img" && n.parentElement.localName === "li" && (n = n.parentElement, a = K(n, mt)), G && t.isTrusted && n === this.canvas && clearTimeout(this.clickCanvasTimeout), a) {
|
|
670
|
-
case "mix":
|
|
671
|
-
this.played ? this.stop() : i.inline ? this.fulled ? this.exit() : this.full() : this.hide();
|
|
672
|
-
break;
|
|
673
|
-
case "hide":
|
|
674
|
-
this.pointerMoved || this.hide();
|
|
675
|
-
break;
|
|
676
|
-
case "view":
|
|
677
|
-
this.view(K(n, "index"));
|
|
678
|
-
break;
|
|
679
|
-
case "zoom-in":
|
|
680
|
-
this.zoom(0.1, !0);
|
|
681
|
-
break;
|
|
682
|
-
case "zoom-out":
|
|
683
|
-
this.zoom(-0.1, !0);
|
|
684
|
-
break;
|
|
685
|
-
case "one-to-one":
|
|
686
|
-
this.toggle();
|
|
687
|
-
break;
|
|
688
|
-
case "reset":
|
|
689
|
-
this.reset();
|
|
690
|
-
break;
|
|
691
|
-
case "prev":
|
|
692
|
-
this.prev(i.loop);
|
|
693
|
-
break;
|
|
694
|
-
case "play":
|
|
695
|
-
this.play(i.fullscreen);
|
|
696
|
-
break;
|
|
697
|
-
case "next":
|
|
698
|
-
this.next(i.loop);
|
|
699
|
-
break;
|
|
700
|
-
case "rotate-left":
|
|
701
|
-
this.rotate(-90);
|
|
702
|
-
break;
|
|
703
|
-
case "rotate-right":
|
|
704
|
-
this.rotate(90);
|
|
705
|
-
break;
|
|
706
|
-
case "flip-horizontal":
|
|
707
|
-
this.scaleX(-r.scaleX || -1);
|
|
708
|
-
break;
|
|
709
|
-
case "flip-vertical":
|
|
710
|
-
this.scaleY(-r.scaleY || -1);
|
|
711
|
-
break;
|
|
712
|
-
default:
|
|
713
|
-
this.played && this.stop();
|
|
714
|
-
}
|
|
715
|
-
},
|
|
716
|
-
dblclick: function(t) {
|
|
717
|
-
t.preventDefault(), this.viewed && t.target === this.image && (G && t.isTrusted && clearTimeout(this.doubleClickImageTimeout), this.toggle(t.isTrusted ? t : t.detail && t.detail.originalEvent));
|
|
718
|
-
},
|
|
719
|
-
load: function() {
|
|
720
|
-
var t = this;
|
|
721
|
-
this.timeout && (clearTimeout(this.timeout), this.timeout = !1);
|
|
722
|
-
var i = this.element, r = this.options, n = this.image, a = this.index, s = this.viewerData;
|
|
723
|
-
m(n, rt), r.loading && m(this.canvas, Z), n.style.cssText = "height:0;" + "margin-left:".concat(s.width / 2, "px;") + "margin-top:".concat(s.height / 2, "px;") + "max-width:none!important;position:relative;width:0;", this.initImage(function() {
|
|
724
|
-
st(n, ai, r.movable), st(n, O, r.transition), t.renderImage(function() {
|
|
725
|
-
t.viewed = !0, t.viewing = !1, p(r.viewed) && d(i, nt, r.viewed, {
|
|
726
|
-
once: !0
|
|
727
|
-
}), A(i, nt, {
|
|
728
|
-
originalImage: t.images[a],
|
|
729
|
-
index: a,
|
|
730
|
-
image: n
|
|
731
|
-
}, {
|
|
732
|
-
cancelable: !1
|
|
733
|
-
});
|
|
734
|
-
});
|
|
735
|
-
});
|
|
736
|
-
},
|
|
737
|
-
loadImage: function(t) {
|
|
738
|
-
var i = t.target, r = i.parentNode, n = r.offsetWidth || 30, a = r.offsetHeight || 50, s = !!K(i, "filled");
|
|
739
|
-
Ie(i, this.options, function(l, h) {
|
|
740
|
-
var o = l / h, u = n, c = a;
|
|
741
|
-
a * o > n ? s ? u = a * o : c = n / o : s ? c = n / o : u = a * o, z(i, C({
|
|
742
|
-
width: u,
|
|
743
|
-
height: c
|
|
744
|
-
}, gt({
|
|
745
|
-
translateX: (n - u) / 2,
|
|
746
|
-
translateY: (a - c) / 2
|
|
747
|
-
})));
|
|
748
|
-
});
|
|
749
|
-
},
|
|
750
|
-
keydown: function(t) {
|
|
751
|
-
var i = this.options;
|
|
752
|
-
if (i.keyboard) {
|
|
753
|
-
var r = t.keyCode || t.which || t.charCode;
|
|
754
|
-
switch (r) {
|
|
755
|
-
case 13:
|
|
756
|
-
this.viewer.contains(t.target) && this.click(t);
|
|
757
|
-
break;
|
|
758
|
-
}
|
|
759
|
-
if (this.fulled)
|
|
760
|
-
switch (r) {
|
|
761
|
-
case 27:
|
|
762
|
-
this.played ? this.stop() : i.inline ? this.fulled && this.exit() : this.hide();
|
|
763
|
-
break;
|
|
764
|
-
case 32:
|
|
765
|
-
this.played && this.stop();
|
|
766
|
-
break;
|
|
767
|
-
case 37:
|
|
768
|
-
this.played && this.playing ? this.playing.prev() : this.prev(i.loop);
|
|
769
|
-
break;
|
|
770
|
-
case 38:
|
|
771
|
-
t.preventDefault(), this.zoom(i.zoomRatio, !0);
|
|
772
|
-
break;
|
|
773
|
-
case 39:
|
|
774
|
-
this.played && this.playing ? this.playing.next() : this.next(i.loop);
|
|
775
|
-
break;
|
|
776
|
-
case 40:
|
|
777
|
-
t.preventDefault(), this.zoom(-i.zoomRatio, !0);
|
|
778
|
-
break;
|
|
779
|
-
case 48:
|
|
780
|
-
case 49:
|
|
781
|
-
t.ctrlKey && (t.preventDefault(), this.toggle());
|
|
782
|
-
break;
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
},
|
|
786
|
-
dragstart: function(t) {
|
|
787
|
-
t.target.localName === "img" && t.preventDefault();
|
|
788
|
-
},
|
|
789
|
-
pointerdown: function(t) {
|
|
790
|
-
var i = this.options, r = this.pointers, n = t.buttons, a = t.button;
|
|
791
|
-
if (this.pointerMoved = !1, !(!this.viewed || this.showing || this.viewing || this.hiding || (t.type === "mousedown" || t.type === "pointerdown" && t.pointerType === "mouse") && // No primary button (Usually the left button)
|
|
792
|
-
(_(n) && n !== 1 || _(a) && a !== 0 || t.ctrlKey))) {
|
|
793
|
-
t.preventDefault(), t.changedTouches ? y(t.changedTouches, function(l) {
|
|
794
|
-
r[l.identifier] = ht(l);
|
|
795
|
-
}) : r[t.pointerId || 0] = ht(t);
|
|
796
|
-
var s = i.movable ? dt : !1;
|
|
797
|
-
i.zoomOnTouch && i.zoomable && Object.keys(r).length > 1 ? s = it : i.slideOnTouch && (t.pointerType === "touch" || t.type === "touchstart") && this.isSwitchable() && (s = Se), i.transition && (s === dt || s === it) && m(this.image, O), this.action = s;
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
pointermove: function(t) {
|
|
801
|
-
var i = this.pointers, r = this.action;
|
|
802
|
-
!this.viewed || !r || (t.preventDefault(), t.changedTouches ? y(t.changedTouches, function(n) {
|
|
803
|
-
C(i[n.identifier] || {}, ht(n, !0));
|
|
804
|
-
}) : C(i[t.pointerId || 0] || {}, ht(t, !0)), this.change(t));
|
|
805
|
-
},
|
|
806
|
-
pointerup: function(t) {
|
|
807
|
-
var i = this, r = this.options, n = this.action, a = this.pointers, s;
|
|
808
|
-
t.changedTouches ? y(t.changedTouches, function(l) {
|
|
809
|
-
s = a[l.identifier], delete a[l.identifier];
|
|
810
|
-
}) : (s = a[t.pointerId || 0], delete a[t.pointerId || 0]), n && (t.preventDefault(), r.transition && (n === dt || n === it) && f(this.image, O), this.action = !1, G && n !== it && s && Date.now() - s.timeStamp < 500 && (clearTimeout(this.clickCanvasTimeout), clearTimeout(this.doubleClickImageTimeout), r.toggleOnDblclick && this.viewed && t.target === this.image ? this.imageClicked ? (this.imageClicked = !1, this.doubleClickImageTimeout = setTimeout(function() {
|
|
811
|
-
A(i.image, At, {
|
|
812
|
-
originalEvent: t
|
|
813
|
-
});
|
|
814
|
-
}, 50)) : (this.imageClicked = !0, this.doubleClickImageTimeout = setTimeout(function() {
|
|
815
|
-
i.imageClicked = !1;
|
|
816
|
-
}, 500)) : (this.imageClicked = !1, r.backdrop && r.backdrop !== "static" && t.target === this.canvas && (this.clickCanvasTimeout = setTimeout(function() {
|
|
817
|
-
A(i.canvas, J, {
|
|
818
|
-
originalEvent: t
|
|
819
|
-
});
|
|
820
|
-
}, 50)))));
|
|
821
|
-
},
|
|
822
|
-
resize: function() {
|
|
823
|
-
var t = this;
|
|
824
|
-
if (!(!this.isShown || this.hiding) && (this.fulled && (this.close(), this.initBody(), this.open()), this.initContainer(), this.initViewer(), this.renderViewer(), this.renderList(), this.viewed && this.initImage(function() {
|
|
825
|
-
t.renderImage();
|
|
826
|
-
}), this.played)) {
|
|
827
|
-
if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
|
|
828
|
-
this.stop();
|
|
829
|
-
return;
|
|
830
|
-
}
|
|
831
|
-
y(this.player.getElementsByTagName("img"), function(i) {
|
|
832
|
-
d(i, $, t.loadImage.bind(t), {
|
|
833
|
-
once: !0
|
|
834
|
-
}), A(i, $);
|
|
835
|
-
});
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
wheel: function(t) {
|
|
839
|
-
var i = this;
|
|
840
|
-
if (this.viewed && (t.preventDefault(), !this.wheeling)) {
|
|
841
|
-
this.wheeling = !0, setTimeout(function() {
|
|
842
|
-
i.wheeling = !1;
|
|
843
|
-
}, 50);
|
|
844
|
-
var r = Number(this.options.zoomRatio) || 0.1, n = 1;
|
|
845
|
-
t.deltaY ? n = t.deltaY > 0 ? 1 : -1 : t.wheelDelta ? n = -t.wheelDelta / 120 : t.detail && (n = t.detail > 0 ? 1 : -1), this.zoom(-n * r, !0, null, t);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
}, Ti = {
|
|
849
|
-
/** Show the viewer (only available in modal mode)
|
|
850
|
-
* @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
|
|
851
|
-
* @returns {Viewer} this
|
|
852
|
-
*/
|
|
853
|
-
show: function() {
|
|
854
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.element, r = this.options;
|
|
855
|
-
if (r.inline || this.showing || this.isShown || this.showing)
|
|
856
|
-
return this;
|
|
857
|
-
if (!this.ready)
|
|
858
|
-
return this.build(), this.ready && this.show(t), this;
|
|
859
|
-
if (p(r.show) && d(i, Jt, r.show, {
|
|
860
|
-
once: !0
|
|
861
|
-
}), A(i, Jt) === !1 || !this.ready)
|
|
862
|
-
return this;
|
|
863
|
-
this.hiding && this.transitioning.abort(), this.showing = !0, this.open();
|
|
864
|
-
var n = this.viewer;
|
|
865
|
-
if (m(n, Y), n.setAttribute("role", "dialog"), n.setAttribute("aria-labelledby", this.title.id), n.setAttribute("aria-modal", !0), n.removeAttribute("aria-hidden"), r.transition && !t) {
|
|
866
|
-
var a = this.shown.bind(this);
|
|
867
|
-
this.transitioning = {
|
|
868
|
-
abort: function() {
|
|
869
|
-
b(n, k, a), m(n, L);
|
|
870
|
-
}
|
|
871
|
-
}, f(n, O), n.initialOffsetWidth = n.offsetWidth, d(n, k, a, {
|
|
872
|
-
once: !0
|
|
873
|
-
}), f(n, L);
|
|
874
|
-
} else
|
|
875
|
-
f(n, L), this.shown();
|
|
876
|
-
return this;
|
|
877
|
-
},
|
|
878
|
-
/**
|
|
879
|
-
* Hide the viewer (only available in modal mode)
|
|
880
|
-
* @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.
|
|
881
|
-
* @returns {Viewer} this
|
|
882
|
-
*/
|
|
883
|
-
hide: function() {
|
|
884
|
-
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, r = this.element, n = this.options;
|
|
885
|
-
if (n.inline || this.hiding || !(this.isShown || this.showing))
|
|
886
|
-
return this;
|
|
887
|
-
if (p(n.hide) && d(r, te, n.hide, {
|
|
888
|
-
once: !0
|
|
889
|
-
}), A(r, te) === !1)
|
|
890
|
-
return this;
|
|
891
|
-
this.showing && this.transitioning.abort(), this.hiding = !0, this.played ? this.stop() : this.viewing && this.viewing.abort();
|
|
892
|
-
var a = this.viewer, s = this.image, l = function() {
|
|
893
|
-
m(a, L), t.hidden();
|
|
894
|
-
};
|
|
895
|
-
if (n.transition && !i) {
|
|
896
|
-
var h = function u(c) {
|
|
897
|
-
c && c.target === a && (b(a, k, u), t.hidden());
|
|
898
|
-
}, o = function() {
|
|
899
|
-
H(a, O) ? (d(a, k, h), m(a, L)) : l();
|
|
900
|
-
};
|
|
901
|
-
this.transitioning = {
|
|
902
|
-
abort: function() {
|
|
903
|
-
t.viewed && H(s, O) ? b(s, k, o) : H(a, O) && b(a, k, h);
|
|
904
|
-
}
|
|
905
|
-
}, this.viewed && H(s, O) ? (d(s, k, o, {
|
|
906
|
-
once: !0
|
|
907
|
-
}), this.zoomTo(0, !1, null, null, !0)) : o();
|
|
908
|
-
} else
|
|
909
|
-
l();
|
|
910
|
-
return this;
|
|
911
|
-
},
|
|
912
|
-
/**
|
|
913
|
-
* View one of the images with image's index
|
|
914
|
-
* @param {number} index - The index of the image to view.
|
|
915
|
-
* @returns {Viewer} this
|
|
916
|
-
*/
|
|
917
|
-
view: function() {
|
|
918
|
-
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.initialViewIndex;
|
|
919
|
-
if (i = Number(i) || 0, this.hiding || this.played || i < 0 || i >= this.length || this.viewed && i === this.index)
|
|
920
|
-
return this;
|
|
921
|
-
if (!this.isShown)
|
|
922
|
-
return this.index = i, this.show();
|
|
923
|
-
this.viewing && this.viewing.abort();
|
|
924
|
-
var r = this.element, n = this.options, a = this.title, s = this.canvas, l = this.items[i], h = l.querySelector("img"), o = K(h, "originalUrl"), u = h.getAttribute("alt"), c = document.createElement("img");
|
|
925
|
-
if (y(n.inheritedAttributes, function(x) {
|
|
926
|
-
var D = h.getAttribute(x);
|
|
927
|
-
D !== null && c.setAttribute(x, D);
|
|
928
|
-
}), c.src = o, c.alt = u, p(n.view) && d(r, ie, n.view, {
|
|
929
|
-
once: !0
|
|
930
|
-
}), A(r, ie, {
|
|
931
|
-
originalImage: this.images[i],
|
|
932
|
-
index: i,
|
|
933
|
-
image: c
|
|
934
|
-
}) === !1 || !this.isShown || this.hiding || this.played)
|
|
935
|
-
return this;
|
|
936
|
-
var g = this.items[this.index];
|
|
937
|
-
g && (m(g, ot), g.removeAttribute("aria-selected")), f(l, ot), l.setAttribute("aria-selected", !0), n.focus && l.focus(), this.image = c, this.viewed = !1, this.index = i, this.imageData = {}, f(c, rt), n.loading && f(s, Z), s.innerHTML = "", s.appendChild(c), this.renderList(), a.innerHTML = "";
|
|
938
|
-
var I = function() {
|
|
939
|
-
var D = t.imageData, N = Array.isArray(n.title) ? n.title[1] : n.title;
|
|
940
|
-
a.innerHTML = fi(p(N) ? N.call(t, c, D) : "".concat(u, " (").concat(D.naturalWidth, " × ").concat(D.naturalHeight, ")"));
|
|
941
|
-
}, S, E;
|
|
942
|
-
return d(r, nt, I, {
|
|
943
|
-
once: !0
|
|
944
|
-
}), this.viewing = {
|
|
945
|
-
abort: function() {
|
|
946
|
-
b(r, nt, I), c.complete ? t.imageRendering ? t.imageRendering.abort() : t.imageInitializing && t.imageInitializing.abort() : (c.src = "", b(c, $, S), t.timeout && clearTimeout(t.timeout));
|
|
947
|
-
}
|
|
948
|
-
}, c.complete ? this.load() : (d(c, $, S = function() {
|
|
949
|
-
b(c, W, E), t.load();
|
|
950
|
-
}, {
|
|
951
|
-
once: !0
|
|
952
|
-
}), d(c, W, E = function() {
|
|
953
|
-
b(c, $, S), t.timeout && (clearTimeout(t.timeout), t.timeout = !1), m(c, rt), n.loading && m(t.canvas, Z);
|
|
954
|
-
}, {
|
|
955
|
-
once: !0
|
|
956
|
-
}), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(function() {
|
|
957
|
-
m(c, rt), t.timeout = !1;
|
|
958
|
-
}, 1e3)), this;
|
|
959
|
-
},
|
|
960
|
-
/**
|
|
961
|
-
* View the previous image
|
|
962
|
-
* @param {boolean} [loop=false] - Indicate if view the last one
|
|
963
|
-
* when it is the first one at present.
|
|
964
|
-
* @returns {Viewer} this
|
|
965
|
-
*/
|
|
966
|
-
prev: function() {
|
|
967
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.index - 1;
|
|
968
|
-
return i < 0 && (i = t ? this.length - 1 : 0), this.view(i), this;
|
|
969
|
-
},
|
|
970
|
-
/**
|
|
971
|
-
* View the next image
|
|
972
|
-
* @param {boolean} [loop=false] - Indicate if view the first one
|
|
973
|
-
* when it is the last one at present.
|
|
974
|
-
* @returns {Viewer} this
|
|
975
|
-
*/
|
|
976
|
-
next: function() {
|
|
977
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.length - 1, r = this.index + 1;
|
|
978
|
-
return r > i && (r = t ? 0 : i), this.view(r), this;
|
|
979
|
-
},
|
|
980
|
-
/**
|
|
981
|
-
* Move the image with relative offsets.
|
|
982
|
-
* @param {number} x - The moving distance in the horizontal direction.
|
|
983
|
-
* @param {number} [y=x] The moving distance in the vertical direction.
|
|
984
|
-
* @returns {Viewer} this
|
|
985
|
-
*/
|
|
986
|
-
move: function(t) {
|
|
987
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, r = this.imageData;
|
|
988
|
-
return this.moveTo(U(t) ? t : r.x + Number(t), U(i) ? i : r.y + Number(i)), this;
|
|
989
|
-
},
|
|
990
|
-
/**
|
|
991
|
-
* Move the image to an absolute point.
|
|
992
|
-
* @param {number} x - The new position in the horizontal direction.
|
|
993
|
-
* @param {number} [y=x] - The new position in the vertical direction.
|
|
994
|
-
* @param {Event} [_originalEvent=null] - The original event if any.
|
|
995
|
-
* @returns {Viewer} this
|
|
996
|
-
*/
|
|
997
|
-
moveTo: function(t) {
|
|
998
|
-
var i = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = this.element, s = this.options, l = this.imageData;
|
|
999
|
-
if (t = Number(t), r = Number(r), this.viewed && !this.played && s.movable) {
|
|
1000
|
-
var h = l.x, o = l.y, u = !1;
|
|
1001
|
-
if (_(t) ? u = !0 : t = h, _(r) ? u = !0 : r = o, u) {
|
|
1002
|
-
if (p(s.move) && d(a, re, s.move, {
|
|
1003
|
-
once: !0
|
|
1004
|
-
}), A(a, re, {
|
|
1005
|
-
x: t,
|
|
1006
|
-
y: r,
|
|
1007
|
-
oldX: h,
|
|
1008
|
-
oldY: o,
|
|
1009
|
-
originalEvent: n
|
|
1010
|
-
}) === !1)
|
|
1011
|
-
return this;
|
|
1012
|
-
l.x = t, l.y = r, l.left = t, l.top = r, this.moving = !0, this.renderImage(function() {
|
|
1013
|
-
i.moving = !1, p(s.moved) && d(a, ne, s.moved, {
|
|
1014
|
-
once: !0
|
|
1015
|
-
}), A(a, ne, {
|
|
1016
|
-
x: t,
|
|
1017
|
-
y: r,
|
|
1018
|
-
oldX: h,
|
|
1019
|
-
oldY: o,
|
|
1020
|
-
originalEvent: n
|
|
1021
|
-
}, {
|
|
1022
|
-
cancelable: !1
|
|
1023
|
-
});
|
|
1024
|
-
});
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
return this;
|
|
1028
|
-
},
|
|
1029
|
-
/**
|
|
1030
|
-
* Rotate the image with a relative degree.
|
|
1031
|
-
* @param {number} degree - The rotate degree.
|
|
1032
|
-
* @returns {Viewer} this
|
|
1033
|
-
*/
|
|
1034
|
-
rotate: function(t) {
|
|
1035
|
-
return this.rotateTo((this.imageData.rotate || 0) + Number(t)), this;
|
|
1036
|
-
},
|
|
1037
|
-
/**
|
|
1038
|
-
* Rotate the image to an absolute degree.
|
|
1039
|
-
* @param {number} degree - The rotate degree.
|
|
1040
|
-
* @returns {Viewer} this
|
|
1041
|
-
*/
|
|
1042
|
-
rotateTo: function(t) {
|
|
1043
|
-
var i = this, r = this.element, n = this.options, a = this.imageData;
|
|
1044
|
-
if (t = Number(t), _(t) && this.viewed && !this.played && n.rotatable) {
|
|
1045
|
-
var s = a.rotate;
|
|
1046
|
-
if (p(n.rotate) && d(r, ae, n.rotate, {
|
|
1047
|
-
once: !0
|
|
1048
|
-
}), A(r, ae, {
|
|
1049
|
-
degree: t,
|
|
1050
|
-
oldDegree: s
|
|
1051
|
-
}) === !1)
|
|
1052
|
-
return this;
|
|
1053
|
-
a.rotate = t, this.rotating = !0, this.renderImage(function() {
|
|
1054
|
-
i.rotating = !1, p(n.rotated) && d(r, se, n.rotated, {
|
|
1055
|
-
once: !0
|
|
1056
|
-
}), A(r, se, {
|
|
1057
|
-
degree: t,
|
|
1058
|
-
oldDegree: s
|
|
1059
|
-
}, {
|
|
1060
|
-
cancelable: !1
|
|
1061
|
-
});
|
|
1062
|
-
});
|
|
1063
|
-
}
|
|
1064
|
-
return this;
|
|
1065
|
-
},
|
|
1066
|
-
/**
|
|
1067
|
-
* Scale the image on the x-axis.
|
|
1068
|
-
* @param {number} scaleX - The scale ratio on the x-axis.
|
|
1069
|
-
* @returns {Viewer} this
|
|
1070
|
-
*/
|
|
1071
|
-
scaleX: function(t) {
|
|
1072
|
-
return this.scale(t, this.imageData.scaleY), this;
|
|
1073
|
-
},
|
|
1074
|
-
/**
|
|
1075
|
-
* Scale the image on the y-axis.
|
|
1076
|
-
* @param {number} scaleY - The scale ratio on the y-axis.
|
|
1077
|
-
* @returns {Viewer} this
|
|
1078
|
-
*/
|
|
1079
|
-
scaleY: function(t) {
|
|
1080
|
-
return this.scale(this.imageData.scaleX, t), this;
|
|
1081
|
-
},
|
|
1082
|
-
/**
|
|
1083
|
-
* Scale the image.
|
|
1084
|
-
* @param {number} scaleX - The scale ratio on the x-axis.
|
|
1085
|
-
* @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
|
|
1086
|
-
* @returns {Viewer} this
|
|
1087
|
-
*/
|
|
1088
|
-
scale: function(t) {
|
|
1089
|
-
var i = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, n = this.element, a = this.options, s = this.imageData;
|
|
1090
|
-
if (t = Number(t), r = Number(r), this.viewed && !this.played && a.scalable) {
|
|
1091
|
-
var l = s.scaleX, h = s.scaleY, o = !1;
|
|
1092
|
-
if (_(t) ? o = !0 : t = l, _(r) ? o = !0 : r = h, o) {
|
|
1093
|
-
if (p(a.scale) && d(n, oe, a.scale, {
|
|
1094
|
-
once: !0
|
|
1095
|
-
}), A(n, oe, {
|
|
1096
|
-
scaleX: t,
|
|
1097
|
-
scaleY: r,
|
|
1098
|
-
oldScaleX: l,
|
|
1099
|
-
oldScaleY: h
|
|
1100
|
-
}) === !1)
|
|
1101
|
-
return this;
|
|
1102
|
-
s.scaleX = t, s.scaleY = r, this.scaling = !0, this.renderImage(function() {
|
|
1103
|
-
i.scaling = !1, p(a.scaled) && d(n, le, a.scaled, {
|
|
1104
|
-
once: !0
|
|
1105
|
-
}), A(n, le, {
|
|
1106
|
-
scaleX: t,
|
|
1107
|
-
scaleY: r,
|
|
1108
|
-
oldScaleX: l,
|
|
1109
|
-
oldScaleY: h
|
|
1110
|
-
}, {
|
|
1111
|
-
cancelable: !1
|
|
1112
|
-
});
|
|
1113
|
-
});
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
return this;
|
|
1117
|
-
},
|
|
1118
|
-
/**
|
|
1119
|
-
* Zoom the image with a relative ratio.
|
|
1120
|
-
* @param {number} ratio - The target ratio.
|
|
1121
|
-
* @param {boolean} [showTooltip=false] - Indicates whether to show the tooltip.
|
|
1122
|
-
* @param {Object} [pivot] - The pivot point coordinate for zooming.
|
|
1123
|
-
* @param {Event} [_originalEvent=null] - The original event if any.
|
|
1124
|
-
* @returns {Viewer} this
|
|
1125
|
-
*/
|
|
1126
|
-
zoom: function(t) {
|
|
1127
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, a = this.imageData;
|
|
1128
|
-
return t = Number(t), t < 0 ? t = 1 / (1 - t) : t = 1 + t, this.zoomTo(a.width * t / a.naturalWidth, i, r, n), this;
|
|
1129
|
-
},
|
|
1130
|
-
/**
|
|
1131
|
-
* Zoom the image to an absolute ratio.
|
|
1132
|
-
* @param {number} ratio - The target ratio.
|
|
1133
|
-
* @param {boolean} [showTooltip] - Indicates whether to show the tooltip.
|
|
1134
|
-
* @param {Object} [pivot] - The pivot point coordinate for zooming.
|
|
1135
|
-
* @param {Event} [_originalEvent=null] - The original event if any.
|
|
1136
|
-
* @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not.
|
|
1137
|
-
* @returns {Viewer} this
|
|
1138
|
-
*/
|
|
1139
|
-
zoomTo: function(t) {
|
|
1140
|
-
var i = this, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null, s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, l = this.element, h = this.options, o = this.pointers, u = this.imageData, c = u.x, g = u.y, I = u.width, S = u.height, E = u.naturalWidth, x = u.naturalHeight;
|
|
1141
|
-
if (t = Math.max(0, t), _(t) && this.viewed && !this.played && (s || h.zoomable)) {
|
|
1142
|
-
if (!s) {
|
|
1143
|
-
var D = Math.max(0.01, h.minZoomRatio), N = Math.min(100, h.maxZoomRatio);
|
|
1144
|
-
t = Math.min(Math.max(t, D), N);
|
|
1145
|
-
}
|
|
1146
|
-
if (a)
|
|
1147
|
-
switch (a.type) {
|
|
1148
|
-
case "wheel":
|
|
1149
|
-
h.zoomRatio >= 0.055 && t > 0.95 && t < 1.05 && (t = 1);
|
|
1150
|
-
break;
|
|
1151
|
-
case "pointermove":
|
|
1152
|
-
case "touchmove":
|
|
1153
|
-
case "mousemove":
|
|
1154
|
-
t > 0.99 && t < 1.01 && (t = 1);
|
|
1155
|
-
break;
|
|
1156
|
-
}
|
|
1157
|
-
var T = E * t, R = x * t, F = T - I, P = R - S, M = u.ratio;
|
|
1158
|
-
if (p(h.zoom) && d(l, ue, h.zoom, {
|
|
1159
|
-
once: !0
|
|
1160
|
-
}), A(l, ue, {
|
|
1161
|
-
ratio: t,
|
|
1162
|
-
oldRatio: M,
|
|
1163
|
-
originalEvent: a
|
|
1164
|
-
}) === !1)
|
|
1165
|
-
return this;
|
|
1166
|
-
if (this.zooming = !0, a) {
|
|
1167
|
-
var tt = vi(this.viewer), X = o && Object.keys(o).length > 0 ? pi(o) : {
|
|
1168
|
-
pageX: a.pageX,
|
|
1169
|
-
pageY: a.pageY
|
|
1170
|
-
};
|
|
1171
|
-
u.x -= F * ((X.pageX - tt.left - c) / I), u.y -= P * ((X.pageY - tt.top - g) / S);
|
|
1172
|
-
} else
|
|
1173
|
-
B(n) && _(n.x) && _(n.y) ? (u.x -= F * ((n.x - c) / I), u.y -= P * ((n.y - g) / S)) : (u.x -= F / 2, u.y -= P / 2);
|
|
1174
|
-
u.left = u.x, u.top = u.y, u.width = T, u.height = R, u.oldRatio = M, u.ratio = t, this.renderImage(function() {
|
|
1175
|
-
i.zooming = !1, p(h.zoomed) && d(l, he, h.zoomed, {
|
|
1176
|
-
once: !0
|
|
1177
|
-
}), A(l, he, {
|
|
1178
|
-
ratio: t,
|
|
1179
|
-
oldRatio: M,
|
|
1180
|
-
originalEvent: a
|
|
1181
|
-
}, {
|
|
1182
|
-
cancelable: !1
|
|
1183
|
-
});
|
|
1184
|
-
}), r && this.tooltip();
|
|
1185
|
-
}
|
|
1186
|
-
return this;
|
|
1187
|
-
},
|
|
1188
|
-
/**
|
|
1189
|
-
* Play the images
|
|
1190
|
-
* @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not.
|
|
1191
|
-
* @returns {Viewer} this
|
|
1192
|
-
*/
|
|
1193
|
-
play: function() {
|
|
1194
|
-
var t = this, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
|
|
1195
|
-
if (!this.isShown || this.played)
|
|
1196
|
-
return this;
|
|
1197
|
-
var r = this.element, n = this.options;
|
|
1198
|
-
if (p(n.play) && d(r, ce, n.play, {
|
|
1199
|
-
once: !0
|
|
1200
|
-
}), A(r, ce) === !1)
|
|
1201
|
-
return this;
|
|
1202
|
-
var a = this.player, s = this.loadImage.bind(this), l = [], h = 0, o = 0;
|
|
1203
|
-
if (this.played = !0, this.onLoadWhenPlay = s, i && this.requestFullscreen(i), f(a, q), y(this.items, function(g, I) {
|
|
1204
|
-
var S = g.querySelector("img"), E = document.createElement("img");
|
|
1205
|
-
E.src = K(S, "originalUrl"), E.alt = S.getAttribute("alt"), E.referrerPolicy = S.referrerPolicy, h += 1, f(E, vt), st(E, O, n.transition), H(g, ot) && (f(E, L), o = I), l.push(E), d(E, $, s, {
|
|
1206
|
-
once: !0
|
|
1207
|
-
}), a.appendChild(E);
|
|
1208
|
-
}), _(n.interval) && n.interval > 0) {
|
|
1209
|
-
var u = function g() {
|
|
1210
|
-
clearTimeout(t.playing.timeout), m(l[o], L), o -= 1, o = o >= 0 ? o : h - 1, f(l[o], L), t.playing.timeout = setTimeout(g, n.interval);
|
|
1211
|
-
}, c = function g() {
|
|
1212
|
-
clearTimeout(t.playing.timeout), m(l[o], L), o += 1, o = o < h ? o : 0, f(l[o], L), t.playing.timeout = setTimeout(g, n.interval);
|
|
1213
|
-
};
|
|
1214
|
-
h > 1 && (this.playing = {
|
|
1215
|
-
prev: u,
|
|
1216
|
-
next: c,
|
|
1217
|
-
timeout: setTimeout(c, n.interval)
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
return this;
|
|
1221
|
-
},
|
|
1222
|
-
// Stop play
|
|
1223
|
-
stop: function() {
|
|
1224
|
-
var t = this;
|
|
1225
|
-
if (!this.played)
|
|
1226
|
-
return this;
|
|
1227
|
-
var i = this.element, r = this.options;
|
|
1228
|
-
if (p(r.stop) && d(i, fe, r.stop, {
|
|
1229
|
-
once: !0
|
|
1230
|
-
}), A(i, fe) === !1)
|
|
1231
|
-
return this;
|
|
1232
|
-
var n = this.player;
|
|
1233
|
-
return clearTimeout(this.playing.timeout), this.playing = !1, this.played = !1, y(n.getElementsByTagName("img"), function(a) {
|
|
1234
|
-
b(a, $, t.onLoadWhenPlay);
|
|
1235
|
-
}), m(n, q), n.innerHTML = "", this.exitFullscreen(), this;
|
|
1236
|
-
},
|
|
1237
|
-
// Enter modal mode (only available in inline mode)
|
|
1238
|
-
full: function() {
|
|
1239
|
-
var t = this, i = this.options, r = this.viewer, n = this.image, a = this.list;
|
|
1240
|
-
return !this.isShown || this.played || this.fulled || !i.inline ? this : (this.fulled = !0, this.open(), f(this.button, Mt), i.transition && (m(a, O), this.viewed && m(n, O)), f(r, It), r.setAttribute("role", "dialog"), r.setAttribute("aria-labelledby", this.title.id), r.setAttribute("aria-modal", !0), r.removeAttribute("style"), z(r, {
|
|
1241
|
-
zIndex: i.zIndex
|
|
1242
|
-
}), i.focus && this.enforceFocus(), this.initContainer(), this.viewerData = C({}, this.containerData), this.renderList(), this.viewed && this.initImage(function() {
|
|
1243
|
-
t.renderImage(function() {
|
|
1244
|
-
i.transition && setTimeout(function() {
|
|
1245
|
-
f(n, O), f(a, O);
|
|
1246
|
-
}, 0);
|
|
1247
|
-
});
|
|
1248
|
-
}), this);
|
|
1249
|
-
},
|
|
1250
|
-
// Exit modal mode (only available in inline mode)
|
|
1251
|
-
exit: function() {
|
|
1252
|
-
var t = this, i = this.options, r = this.viewer, n = this.image, a = this.list;
|
|
1253
|
-
return !this.isShown || this.played || !this.fulled || !i.inline ? this : (this.fulled = !1, this.close(), m(this.button, Mt), i.transition && (m(a, O), this.viewed && m(n, O)), i.focus && this.clearEnforceFocus(), r.removeAttribute("role"), r.removeAttribute("aria-labelledby"), r.removeAttribute("aria-modal"), m(r, It), z(r, {
|
|
1254
|
-
zIndex: i.zIndexInline
|
|
1255
|
-
}), this.viewerData = C({}, this.parentData), this.renderViewer(), this.renderList(), this.viewed && this.initImage(function() {
|
|
1256
|
-
t.renderImage(function() {
|
|
1257
|
-
i.transition && setTimeout(function() {
|
|
1258
|
-
f(n, O), f(a, O);
|
|
1259
|
-
}, 0);
|
|
1260
|
-
});
|
|
1261
|
-
}), this);
|
|
1262
|
-
},
|
|
1263
|
-
// Show the current ratio of the image with percentage
|
|
1264
|
-
tooltip: function() {
|
|
1265
|
-
var t = this, i = this.options, r = this.tooltipBox, n = this.imageData;
|
|
1266
|
-
return !this.viewed || this.played || !i.tooltip ? this : (r.textContent = "".concat(Math.round(n.ratio * 100), "%"), this.tooltipping ? clearTimeout(this.tooltipping) : i.transition ? (this.fading && A(r, k), f(r, q), f(r, vt), f(r, O), r.removeAttribute("aria-hidden"), r.initialOffsetWidth = r.offsetWidth, f(r, L)) : (f(r, q), r.removeAttribute("aria-hidden")), this.tooltipping = setTimeout(function() {
|
|
1267
|
-
i.transition ? (d(r, k, function() {
|
|
1268
|
-
m(r, q), m(r, vt), m(r, O), r.setAttribute("aria-hidden", !0), t.fading = !1;
|
|
1269
|
-
}, {
|
|
1270
|
-
once: !0
|
|
1271
|
-
}), m(r, L), t.fading = !0) : (m(r, q), r.setAttribute("aria-hidden", !0)), t.tooltipping = !1;
|
|
1272
|
-
}, 1e3), this);
|
|
1273
|
-
},
|
|
1274
|
-
/**
|
|
1275
|
-
* Toggle the image size between its current size and natural size
|
|
1276
|
-
* @param {Event} [_originalEvent=null] - The original event if any.
|
|
1277
|
-
* @returns {Viewer} this
|
|
1278
|
-
*/
|
|
1279
|
-
toggle: function() {
|
|
1280
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
1281
|
-
return this.imageData.ratio === 1 ? this.zoomTo(this.imageData.oldRatio, !0, null, t) : this.zoomTo(1, !0, null, t), this;
|
|
1282
|
-
},
|
|
1283
|
-
// Reset the image to its initial state
|
|
1284
|
-
reset: function() {
|
|
1285
|
-
return this.viewed && !this.played && (this.imageData = C({}, this.initialImageData), this.renderImage()), this;
|
|
1286
|
-
},
|
|
1287
|
-
// Update viewer when images changed
|
|
1288
|
-
update: function() {
|
|
1289
|
-
var t = this, i = this.element, r = this.options, n = this.isImg;
|
|
1290
|
-
if (n && !i.parentNode)
|
|
1291
|
-
return this.destroy();
|
|
1292
|
-
var a = [];
|
|
1293
|
-
if (y(n ? [i] : i.querySelectorAll("img"), function(o) {
|
|
1294
|
-
p(r.filter) ? r.filter.call(t, o) && a.push(o) : t.getImageURL(o) && a.push(o);
|
|
1295
|
-
}), !a.length)
|
|
1296
|
-
return this;
|
|
1297
|
-
if (this.images = a, this.length = a.length, this.ready) {
|
|
1298
|
-
var s = [];
|
|
1299
|
-
if (y(this.items, function(o, u) {
|
|
1300
|
-
var c = o.querySelector("img"), g = a[u];
|
|
1301
|
-
g && c ? (g.src !== c.src || g.alt !== c.alt) && s.push(u) : s.push(u);
|
|
1302
|
-
}), z(this.list, {
|
|
1303
|
-
width: "auto"
|
|
1304
|
-
}), this.initList(), this.isShown)
|
|
1305
|
-
if (this.length) {
|
|
1306
|
-
if (this.viewed) {
|
|
1307
|
-
var l = s.indexOf(this.index);
|
|
1308
|
-
if (l >= 0)
|
|
1309
|
-
this.viewed = !1, this.view(Math.max(Math.min(this.index - l, this.length - 1), 0));
|
|
1310
|
-
else {
|
|
1311
|
-
var h = this.items[this.index];
|
|
1312
|
-
f(h, ot), h.setAttribute("aria-selected", !0);
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
} else
|
|
1316
|
-
this.image = null, this.viewed = !1, this.index = 0, this.imageData = {}, this.canvas.innerHTML = "", this.title.innerHTML = "";
|
|
1317
|
-
} else
|
|
1318
|
-
this.build();
|
|
1319
|
-
return this;
|
|
1320
|
-
},
|
|
1321
|
-
// Destroy the viewer
|
|
1322
|
-
destroy: function() {
|
|
1323
|
-
var t = this.element, i = this.options;
|
|
1324
|
-
return t[v] ? (this.destroyed = !0, this.ready ? (this.played && this.stop(), i.inline ? (this.fulled && this.exit(), this.unbind()) : this.isShown ? (this.viewing && (this.imageRendering ? this.imageRendering.abort() : this.imageInitializing && this.imageInitializing.abort()), this.hiding && this.transitioning.abort(), this.hidden()) : this.showing && (this.transitioning.abort(), this.hidden()), this.ready = !1, this.viewer.parentNode.removeChild(this.viewer)) : i.inline && (this.delaying ? this.delaying.abort() : this.initializing && this.initializing.abort()), i.inline || b(t, J, this.onStart), t[v] = void 0, this) : this;
|
|
1325
|
-
}
|
|
1326
|
-
}, Ei = {
|
|
1327
|
-
getImageURL: function(t) {
|
|
1328
|
-
var i = this.options.url;
|
|
1329
|
-
return at(i) ? i = t.getAttribute(i) : p(i) ? i = i.call(this, t) : i = "", i;
|
|
1330
|
-
},
|
|
1331
|
-
enforceFocus: function() {
|
|
1332
|
-
var t = this;
|
|
1333
|
-
this.clearEnforceFocus(), d(document, Xt, this.onFocusin = function(i) {
|
|
1334
|
-
var r = t.viewer, n = i.target;
|
|
1335
|
-
if (!(n === document || n === r || r.contains(n))) {
|
|
1336
|
-
for (; n; ) {
|
|
1337
|
-
if (n.getAttribute("tabindex") !== null || n.getAttribute("aria-modal") === "true")
|
|
1338
|
-
return;
|
|
1339
|
-
n = n.parentElement;
|
|
1340
|
-
}
|
|
1341
|
-
r.focus();
|
|
1342
|
-
}
|
|
1343
|
-
});
|
|
1344
|
-
},
|
|
1345
|
-
clearEnforceFocus: function() {
|
|
1346
|
-
this.onFocusin && (b(document, Xt, this.onFocusin), this.onFocusin = null);
|
|
1347
|
-
},
|
|
1348
|
-
open: function() {
|
|
1349
|
-
var t = this.body;
|
|
1350
|
-
f(t, Yt), this.scrollbarWidth > 0 && (t.style.paddingRight = "".concat(this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0), "px"));
|
|
1351
|
-
},
|
|
1352
|
-
close: function() {
|
|
1353
|
-
var t = this.body;
|
|
1354
|
-
m(t, Yt), this.scrollbarWidth > 0 && (t.style.paddingRight = this.initialBodyPaddingRight);
|
|
1355
|
-
},
|
|
1356
|
-
shown: function() {
|
|
1357
|
-
var t = this.element, i = this.options, r = this.viewer;
|
|
1358
|
-
this.fulled = !0, this.isShown = !0, this.render(), this.bind(), this.showing = !1, i.focus && (r.focus(), this.enforceFocus()), p(i.shown) && d(t, Qt, i.shown, {
|
|
1359
|
-
once: !0
|
|
1360
|
-
}), A(t, Qt) !== !1 && this.ready && this.isShown && !this.hiding && this.view(this.index);
|
|
1361
|
-
},
|
|
1362
|
-
hidden: function() {
|
|
1363
|
-
var t = this.element, i = this.options, r = this.viewer;
|
|
1364
|
-
i.fucus && this.clearEnforceFocus(), this.fulled = !1, this.viewed = !1, this.isShown = !1, this.close(), this.unbind(), f(r, Y), r.removeAttribute("role"), r.removeAttribute("aria-labelledby"), r.removeAttribute("aria-modal"), r.setAttribute("aria-hidden", !0), this.resetList(), this.resetImage(), this.hiding = !1, this.destroyed || (p(i.hidden) && d(t, ee, i.hidden, {
|
|
1365
|
-
once: !0
|
|
1366
|
-
}), A(t, ee, null, {
|
|
1367
|
-
cancelable: !1
|
|
1368
|
-
}));
|
|
1369
|
-
},
|
|
1370
|
-
requestFullscreen: function(t) {
|
|
1371
|
-
var i = this.element.ownerDocument;
|
|
1372
|
-
if (this.fulled && !(i.fullscreenElement || i.webkitFullscreenElement || i.mozFullScreenElement || i.msFullscreenElement)) {
|
|
1373
|
-
var r = i.documentElement;
|
|
1374
|
-
r.requestFullscreen ? B(t) ? r.requestFullscreen(t) : r.requestFullscreen() : r.webkitRequestFullscreen ? r.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : r.mozRequestFullScreen ? r.mozRequestFullScreen() : r.msRequestFullscreen && r.msRequestFullscreen();
|
|
1375
|
-
}
|
|
1376
|
-
},
|
|
1377
|
-
exitFullscreen: function() {
|
|
1378
|
-
var t = this.element.ownerDocument;
|
|
1379
|
-
this.fulled && (t.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement) && (t.exitFullscreen ? t.exitFullscreen() : t.webkitExitFullscreen ? t.webkitExitFullscreen() : t.mozCancelFullScreen ? t.mozCancelFullScreen() : t.msExitFullscreen && t.msExitFullscreen());
|
|
1380
|
-
},
|
|
1381
|
-
change: function(t) {
|
|
1382
|
-
var i = this.options, r = this.pointers, n = r[Object.keys(r)[0]];
|
|
1383
|
-
if (n) {
|
|
1384
|
-
var a = n.endX - n.startX, s = n.endY - n.startY;
|
|
1385
|
-
switch (this.action) {
|
|
1386
|
-
case dt:
|
|
1387
|
-
(a !== 0 || s !== 0) && (this.pointerMoved = !0, this.move(a, s, t));
|
|
1388
|
-
break;
|
|
1389
|
-
case it:
|
|
1390
|
-
this.zoom(mi(r), !1, null, t);
|
|
1391
|
-
break;
|
|
1392
|
-
case Se: {
|
|
1393
|
-
this.action = "switched";
|
|
1394
|
-
var l = Math.abs(a);
|
|
1395
|
-
l > 1 && l > Math.abs(s) && (this.pointers = {}, a > 1 ? this.prev(i.loop) : a < -1 && this.next(i.loop));
|
|
1396
|
-
break;
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
y(r, function(h) {
|
|
1400
|
-
h.startX = h.endX, h.startY = h.endY;
|
|
1401
|
-
});
|
|
1402
|
-
}
|
|
1403
|
-
},
|
|
1404
|
-
isSwitchable: function() {
|
|
1405
|
-
var t = this.imageData, i = this.viewerData;
|
|
1406
|
-
return this.length > 1 && t.x >= 0 && t.y >= 0 && t.width <= i.width && t.height <= i.height;
|
|
1407
|
-
}
|
|
1408
|
-
}, _i = V.Viewer, Si = function(e) {
|
|
1409
|
-
return function() {
|
|
1410
|
-
return e += 1, e;
|
|
1411
|
-
};
|
|
1412
|
-
}(-1), Ae = /* @__PURE__ */ function() {
|
|
1413
|
-
function e(t) {
|
|
1414
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1415
|
-
if (Ke(this, e), !t || t.nodeType !== 1)
|
|
1416
|
-
throw new Error("The first argument is required and must be an element.");
|
|
1417
|
-
this.element = t, this.options = C({}, Ft, B(i) && i), this.action = !1, this.fading = !1, this.fulled = !1, this.hiding = !1, this.imageClicked = !1, this.imageData = {}, this.index = this.options.initialViewIndex, this.isImg = !1, this.isShown = !1, this.length = 0, this.moving = !1, this.played = !1, this.playing = !1, this.pointers = {}, this.ready = !1, this.rotating = !1, this.scaling = !1, this.showing = !1, this.timeout = !1, this.tooltipping = !1, this.viewed = !1, this.viewing = !1, this.wheeling = !1, this.zooming = !1, this.pointerMoved = !1, this.id = Si(), this.init();
|
|
1418
|
-
}
|
|
1419
|
-
return Ge(e, [{
|
|
1420
|
-
key: "init",
|
|
1421
|
-
value: function() {
|
|
1422
|
-
var i = this, r = this.element, n = this.options;
|
|
1423
|
-
if (!r[v]) {
|
|
1424
|
-
r[v] = this, n.focus && !n.keyboard && (n.focus = !1);
|
|
1425
|
-
var a = r.localName === "img", s = [];
|
|
1426
|
-
if (y(a ? [r] : r.querySelectorAll("img"), function(o) {
|
|
1427
|
-
p(n.filter) ? n.filter.call(i, o) && s.push(o) : i.getImageURL(o) && s.push(o);
|
|
1428
|
-
}), this.isImg = a, this.length = s.length, this.images = s, this.initBody(), U(document.createElement(v).style.transition) && (n.transition = !1), n.inline) {
|
|
1429
|
-
var l = 0, h = function() {
|
|
1430
|
-
if (l += 1, l === i.length) {
|
|
1431
|
-
var u;
|
|
1432
|
-
i.initializing = !1, i.delaying = {
|
|
1433
|
-
abort: function() {
|
|
1434
|
-
clearTimeout(u);
|
|
1435
|
-
}
|
|
1436
|
-
}, u = setTimeout(function() {
|
|
1437
|
-
i.delaying = !1, i.build();
|
|
1438
|
-
}, 0);
|
|
1439
|
-
}
|
|
1440
|
-
};
|
|
1441
|
-
this.initializing = {
|
|
1442
|
-
abort: function() {
|
|
1443
|
-
y(s, function(u) {
|
|
1444
|
-
u.complete || (b(u, $, h), b(u, W, h));
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
}, y(s, function(o) {
|
|
1448
|
-
if (o.complete)
|
|
1449
|
-
h();
|
|
1450
|
-
else {
|
|
1451
|
-
var u, c;
|
|
1452
|
-
d(o, $, u = function() {
|
|
1453
|
-
b(o, W, c), h();
|
|
1454
|
-
}, {
|
|
1455
|
-
once: !0
|
|
1456
|
-
}), d(o, W, c = function() {
|
|
1457
|
-
b(o, $, u), h();
|
|
1458
|
-
}, {
|
|
1459
|
-
once: !0
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
});
|
|
1463
|
-
} else
|
|
1464
|
-
d(r, J, this.onStart = function(o) {
|
|
1465
|
-
var u = o.target;
|
|
1466
|
-
u.localName === "img" && (!p(n.filter) || n.filter.call(i, u)) && i.view(i.images.indexOf(u));
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
}, {
|
|
1471
|
-
key: "build",
|
|
1472
|
-
value: function() {
|
|
1473
|
-
if (!this.ready) {
|
|
1474
|
-
var i = this.element, r = this.options, n = i.parentNode, a = document.createElement("div");
|
|
1475
|
-
a.innerHTML = Qe;
|
|
1476
|
-
var s = a.querySelector(".".concat(v, "-container")), l = s.querySelector(".".concat(v, "-title")), h = s.querySelector(".".concat(v, "-toolbar")), o = s.querySelector(".".concat(v, "-navbar")), u = s.querySelector(".".concat(v, "-button")), c = s.querySelector(".".concat(v, "-canvas"));
|
|
1477
|
-
if (this.parent = n, this.viewer = s, this.title = l, this.toolbar = h, this.navbar = o, this.button = u, this.canvas = c, this.footer = s.querySelector(".".concat(v, "-footer")), this.tooltipBox = s.querySelector(".".concat(v, "-tooltip")), this.player = s.querySelector(".".concat(v, "-player")), this.list = s.querySelector(".".concat(v, "-list")), s.id = "".concat(v).concat(this.id), l.id = "".concat(v, "Title").concat(this.id), f(l, r.title ? ut(Array.isArray(r.title) ? r.title[0] : r.title) : Y), f(o, r.navbar ? ut(r.navbar) : Y), st(u, Y, !r.button), r.keyboard && u.setAttribute("tabindex", 0), r.backdrop && (f(s, "".concat(v, "-backdrop")), !r.inline && r.backdrop !== "static" && xt(c, mt, "hide")), at(r.className) && r.className && r.className.split($t).forEach(function(T) {
|
|
1478
|
-
f(s, T);
|
|
1479
|
-
}), r.toolbar) {
|
|
1480
|
-
var g = document.createElement("ul"), I = B(r.toolbar), S = lt.slice(0, 3), E = lt.slice(7, 9), x = lt.slice(9);
|
|
1481
|
-
I || f(h, ut(r.toolbar)), y(I ? r.toolbar : lt, function(T, R) {
|
|
1482
|
-
var F = I && B(T), P = I ? kt(R) : T, M = F && !U(T.show) ? T.show : T;
|
|
1483
|
-
if (!(!M || !r.zoomable && S.indexOf(P) !== -1 || !r.rotatable && E.indexOf(P) !== -1 || !r.scalable && x.indexOf(P) !== -1)) {
|
|
1484
|
-
var tt = F && !U(T.size) ? T.size : T, X = F && !U(T.click) ? T.click : T, j = document.createElement("li");
|
|
1485
|
-
r.keyboard && j.setAttribute("tabindex", 0), j.setAttribute("role", "button"), f(j, "".concat(v, "-").concat(P)), p(X) || xt(j, mt, P), _(M) && f(j, ut(M)), ["small", "large"].indexOf(tt) !== -1 ? f(j, "".concat(v, "-").concat(tt)) : P === "play" && f(j, "".concat(v, "-large")), p(X) && d(j, J, X), g.appendChild(j);
|
|
1486
|
-
}
|
|
1487
|
-
}), h.appendChild(g);
|
|
1488
|
-
} else
|
|
1489
|
-
f(h, Y);
|
|
1490
|
-
if (!r.rotatable) {
|
|
1491
|
-
var D = h.querySelectorAll('li[class*="rotate"]');
|
|
1492
|
-
f(D, rt), y(D, function(T) {
|
|
1493
|
-
h.appendChild(T);
|
|
1494
|
-
});
|
|
1495
|
-
}
|
|
1496
|
-
if (r.inline)
|
|
1497
|
-
f(u, ei), z(s, {
|
|
1498
|
-
zIndex: r.zIndexInline
|
|
1499
|
-
}), window.getComputedStyle(n).position === "static" && z(n, {
|
|
1500
|
-
position: "relative"
|
|
1501
|
-
}), n.insertBefore(s, i.nextSibling);
|
|
1502
|
-
else {
|
|
1503
|
-
f(u, ti), f(s, It), f(s, vt), f(s, Y), z(s, {
|
|
1504
|
-
zIndex: r.zIndex
|
|
1505
|
-
});
|
|
1506
|
-
var N = r.container;
|
|
1507
|
-
at(N) && (N = i.ownerDocument.querySelector(N)), N || (N = this.body), N.appendChild(s);
|
|
1508
|
-
}
|
|
1509
|
-
if (r.inline && (this.render(), this.bind(), this.isShown = !0), this.ready = !0, p(r.ready) && d(i, Zt, r.ready, {
|
|
1510
|
-
once: !0
|
|
1511
|
-
}), A(i, Zt) === !1) {
|
|
1512
|
-
this.ready = !1;
|
|
1513
|
-
return;
|
|
1514
|
-
}
|
|
1515
|
-
this.ready && r.inline && this.view(this.index);
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
/**
|
|
1519
|
-
* Get the no conflict viewer class.
|
|
1520
|
-
* @returns {Viewer} The viewer class.
|
|
1521
|
-
*/
|
|
1522
|
-
}], [{
|
|
1523
|
-
key: "noConflict",
|
|
1524
|
-
value: function() {
|
|
1525
|
-
return window.Viewer = _i, e;
|
|
1526
|
-
}
|
|
1527
|
-
/**
|
|
1528
|
-
* Change the default options.
|
|
1529
|
-
* @param {Object} options - The new default options.
|
|
1530
|
-
*/
|
|
1531
|
-
}, {
|
|
1532
|
-
key: "setDefaults",
|
|
1533
|
-
value: function(i) {
|
|
1534
|
-
C(Ft, B(i) && i);
|
|
1535
|
-
}
|
|
1536
|
-
}]), e;
|
|
1537
|
-
}();
|
|
1538
|
-
C(Ae.prototype, bi, yi, wi, Ti, Ei);
|
|
1539
|
-
/*!
|
|
1540
|
-
* v-viewer v3.0.11
|
|
1541
|
-
* https://github.com/mirari/v-viewer#readme
|
|
1542
|
-
*
|
|
1543
|
-
* Copyright 2022 mirari
|
|
1544
|
-
* Released under the MIT license
|
|
1545
|
-
*
|
|
1546
|
-
* Date: 2022-10-25T08:49:33.301Z
|
|
1547
|
-
*/
|
|
1548
|
-
var ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1549
|
-
function Oi(e) {
|
|
1550
|
-
return e;
|
|
1551
|
-
}
|
|
1552
|
-
var xe = Oi;
|
|
1553
|
-
function Ii(e, t, i) {
|
|
1554
|
-
switch (i.length) {
|
|
1555
|
-
case 0:
|
|
1556
|
-
return e.call(t);
|
|
1557
|
-
case 1:
|
|
1558
|
-
return e.call(t, i[0]);
|
|
1559
|
-
case 2:
|
|
1560
|
-
return e.call(t, i[0], i[1]);
|
|
1561
|
-
case 3:
|
|
1562
|
-
return e.call(t, i[0], i[1], i[2]);
|
|
1563
|
-
}
|
|
1564
|
-
return e.apply(t, i);
|
|
1565
|
-
}
|
|
1566
|
-
var Ai = Ii, xi = Ai, de = Math.max;
|
|
1567
|
-
function Di(e, t, i) {
|
|
1568
|
-
return t = de(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1569
|
-
for (var r = arguments, n = -1, a = de(r.length - t, 0), s = Array(a); ++n < a; )
|
|
1570
|
-
s[n] = r[t + n];
|
|
1571
|
-
n = -1;
|
|
1572
|
-
for (var l = Array(t + 1); ++n < t; )
|
|
1573
|
-
l[n] = r[n];
|
|
1574
|
-
return l[t] = i(s), xi(e, this, l);
|
|
1575
|
-
};
|
|
1576
|
-
}
|
|
1577
|
-
var Ni = Di;
|
|
1578
|
-
function Ci(e) {
|
|
1579
|
-
return function() {
|
|
1580
|
-
return e;
|
|
1581
|
-
};
|
|
1582
|
-
}
|
|
1583
|
-
var Li = Ci, $i = typeof ct == "object" && ct && ct.Object === Object && ct, De = $i, ki = De, zi = typeof self == "object" && self && self.Object === Object && self, Pi = ki || zi || Function("return this")(), zt = Pi, Ri = zt, ji = Ri.Symbol, Ne = ji, ve = Ne, Ce = Object.prototype, Vi = Ce.hasOwnProperty, Fi = Ce.toString, et = ve ? ve.toStringTag : void 0;
|
|
1584
|
-
function Mi(e) {
|
|
1585
|
-
var t = Vi.call(e, et), i = e[et];
|
|
1586
|
-
try {
|
|
1587
|
-
e[et] = void 0;
|
|
1588
|
-
var r = !0;
|
|
1589
|
-
} catch {
|
|
1590
|
-
}
|
|
1591
|
-
var n = Fi.call(e);
|
|
1592
|
-
return r && (t ? e[et] = i : delete e[et]), n;
|
|
1593
|
-
}
|
|
1594
|
-
var Yi = Mi, Wi = Object.prototype, Xi = Wi.toString;
|
|
1595
|
-
function qi(e) {
|
|
1596
|
-
return Xi.call(e);
|
|
1597
|
-
}
|
|
1598
|
-
var Hi = qi, ge = Ne, Ui = Yi, Bi = Hi, Ki = "[object Null]", Gi = "[object Undefined]", me = ge ? ge.toStringTag : void 0;
|
|
1599
|
-
function Zi(e) {
|
|
1600
|
-
return e == null ? e === void 0 ? Gi : Ki : me && me in Object(e) ? Ui(e) : Bi(e);
|
|
1601
|
-
}
|
|
1602
|
-
var Pt = Zi;
|
|
1603
|
-
function Ji(e) {
|
|
1604
|
-
var t = typeof e;
|
|
1605
|
-
return e != null && (t == "object" || t == "function");
|
|
1606
|
-
}
|
|
1607
|
-
var bt = Ji, Qi = Pt, tr = bt, er = "[object AsyncFunction]", ir = "[object Function]", rr = "[object GeneratorFunction]", nr = "[object Proxy]";
|
|
1608
|
-
function ar(e) {
|
|
1609
|
-
if (!tr(e))
|
|
1610
|
-
return !1;
|
|
1611
|
-
var t = Qi(e);
|
|
1612
|
-
return t == ir || t == rr || t == er || t == nr;
|
|
1613
|
-
}
|
|
1614
|
-
var Le = ar, sr = zt, or = sr["__core-js_shared__"], lr = or, _t = lr, pe = function() {
|
|
1615
|
-
var e = /[^.]+$/.exec(_t && _t.keys && _t.keys.IE_PROTO || "");
|
|
1616
|
-
return e ? "Symbol(src)_1." + e : "";
|
|
1617
|
-
}();
|
|
1618
|
-
function ur(e) {
|
|
1619
|
-
return !!pe && pe in e;
|
|
1620
|
-
}
|
|
1621
|
-
var hr = ur, cr = Function.prototype, fr = cr.toString;
|
|
1622
|
-
function dr(e) {
|
|
1623
|
-
if (e != null) {
|
|
1624
|
-
try {
|
|
1625
|
-
return fr.call(e);
|
|
1626
|
-
} catch {
|
|
1627
|
-
}
|
|
1628
|
-
try {
|
|
1629
|
-
return e + "";
|
|
1630
|
-
} catch {
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
return "";
|
|
1634
|
-
}
|
|
1635
|
-
var vr = dr, gr = Le, mr = hr, pr = bt, br = vr, yr = /[\\^$.*+?()[\]{}|]/g, wr = /^\[object .+?Constructor\]$/, Tr = Function.prototype, Er = Object.prototype, _r = Tr.toString, Sr = Er.hasOwnProperty, Or = RegExp("^" + _r.call(Sr).replace(yr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
1636
|
-
function Ir(e) {
|
|
1637
|
-
if (!pr(e) || mr(e))
|
|
1638
|
-
return !1;
|
|
1639
|
-
var t = gr(e) ? Or : wr;
|
|
1640
|
-
return t.test(br(e));
|
|
1641
|
-
}
|
|
1642
|
-
var Ar = Ir;
|
|
1643
|
-
function xr(e, t) {
|
|
1644
|
-
return e == null ? void 0 : e[t];
|
|
1645
|
-
}
|
|
1646
|
-
var Dr = xr, Nr = Ar, Cr = Dr;
|
|
1647
|
-
function Lr(e, t) {
|
|
1648
|
-
var i = Cr(e, t);
|
|
1649
|
-
return Nr(i) ? i : void 0;
|
|
1650
|
-
}
|
|
1651
|
-
var $r = Lr, kr = $r, zr = function() {
|
|
1652
|
-
try {
|
|
1653
|
-
var e = kr(Object, "defineProperty");
|
|
1654
|
-
return e({}, "", {}), e;
|
|
1655
|
-
} catch {
|
|
1656
|
-
}
|
|
1657
|
-
}(), Pr = zr, Rr = Li, be = Pr, jr = xe, Vr = be ? function(e, t) {
|
|
1658
|
-
return be(e, "toString", {
|
|
1659
|
-
configurable: !0,
|
|
1660
|
-
enumerable: !1,
|
|
1661
|
-
value: Rr(t),
|
|
1662
|
-
writable: !0
|
|
1663
|
-
});
|
|
1664
|
-
} : jr, Fr = Vr, Mr = 800, Yr = 16, Wr = Date.now;
|
|
1665
|
-
function Xr(e) {
|
|
1666
|
-
var t = 0, i = 0;
|
|
1667
|
-
return function() {
|
|
1668
|
-
var r = Wr(), n = Yr - (r - i);
|
|
1669
|
-
if (i = r, n > 0) {
|
|
1670
|
-
if (++t >= Mr)
|
|
1671
|
-
return arguments[0];
|
|
1672
|
-
} else
|
|
1673
|
-
t = 0;
|
|
1674
|
-
return e.apply(void 0, arguments);
|
|
1675
|
-
};
|
|
1676
|
-
}
|
|
1677
|
-
var qr = Xr, Hr = Fr, Ur = qr, Br = Ur(Hr), Kr = Br, Gr = xe, Zr = Ni, Jr = Kr;
|
|
1678
|
-
function Qr(e, t) {
|
|
1679
|
-
return Jr(Zr(e, t, Gr), e + "");
|
|
1680
|
-
}
|
|
1681
|
-
var tn = Qr;
|
|
1682
|
-
function en(e, t) {
|
|
1683
|
-
return e === t || e !== e && t !== t;
|
|
1684
|
-
}
|
|
1685
|
-
var $e = en, rn = 9007199254740991;
|
|
1686
|
-
function nn(e) {
|
|
1687
|
-
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= rn;
|
|
1688
|
-
}
|
|
1689
|
-
var ke = nn, an = Le, sn = ke;
|
|
1690
|
-
function on(e) {
|
|
1691
|
-
return e != null && sn(e.length) && !an(e);
|
|
1692
|
-
}
|
|
1693
|
-
var ze = on, ln = 9007199254740991, un = /^(?:0|[1-9]\d*)$/;
|
|
1694
|
-
function hn(e, t) {
|
|
1695
|
-
var i = typeof e;
|
|
1696
|
-
return t = t ?? ln, !!t && (i == "number" || i != "symbol" && un.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
1697
|
-
}
|
|
1698
|
-
var Pe = hn, cn = $e, fn = ze, dn = Pe, vn = bt;
|
|
1699
|
-
function gn(e, t, i) {
|
|
1700
|
-
if (!vn(i))
|
|
1701
|
-
return !1;
|
|
1702
|
-
var r = typeof t;
|
|
1703
|
-
return (r == "number" ? fn(i) && dn(t, i.length) : r == "string" && t in i) ? cn(i[t], e) : !1;
|
|
1704
|
-
}
|
|
1705
|
-
var mn = gn;
|
|
1706
|
-
function pn(e, t) {
|
|
1707
|
-
for (var i = -1, r = Array(e); ++i < e; )
|
|
1708
|
-
r[i] = t(i);
|
|
1709
|
-
return r;
|
|
1710
|
-
}
|
|
1711
|
-
var bn = pn;
|
|
1712
|
-
function yn(e) {
|
|
1713
|
-
return e != null && typeof e == "object";
|
|
1714
|
-
}
|
|
1715
|
-
var Rt = yn, wn = Pt, Tn = Rt, En = "[object Arguments]";
|
|
1716
|
-
function _n(e) {
|
|
1717
|
-
return Tn(e) && wn(e) == En;
|
|
1718
|
-
}
|
|
1719
|
-
var Sn = _n, ye = Sn, On = Rt, Re = Object.prototype, In = Re.hasOwnProperty, An = Re.propertyIsEnumerable, xn = ye(function() {
|
|
1720
|
-
return arguments;
|
|
1721
|
-
}()) ? ye : function(e) {
|
|
1722
|
-
return On(e) && In.call(e, "callee") && !An.call(e, "callee");
|
|
1723
|
-
}, Dn = xn, Nn = Array.isArray, Cn = Nn, Dt = { exports: {} };
|
|
1724
|
-
function Ln() {
|
|
1725
|
-
return !1;
|
|
1726
|
-
}
|
|
1727
|
-
var $n = Ln;
|
|
1728
|
-
(function(e, t) {
|
|
1729
|
-
var i = zt, r = $n, n = t && !t.nodeType && t, a = n && !0 && e && !e.nodeType && e, s = a && a.exports === n, l = s ? i.Buffer : void 0, h = l ? l.isBuffer : void 0, o = h || r;
|
|
1730
|
-
e.exports = o;
|
|
1731
|
-
})(Dt, Dt.exports);
|
|
1732
|
-
var kn = Pt, zn = ke, Pn = Rt, Rn = "[object Arguments]", jn = "[object Array]", Vn = "[object Boolean]", Fn = "[object Date]", Mn = "[object Error]", Yn = "[object Function]", Wn = "[object Map]", Xn = "[object Number]", qn = "[object Object]", Hn = "[object RegExp]", Un = "[object Set]", Bn = "[object String]", Kn = "[object WeakMap]", Gn = "[object ArrayBuffer]", Zn = "[object DataView]", Jn = "[object Float32Array]", Qn = "[object Float64Array]", ta = "[object Int8Array]", ea = "[object Int16Array]", ia = "[object Int32Array]", ra = "[object Uint8Array]", na = "[object Uint8ClampedArray]", aa = "[object Uint16Array]", sa = "[object Uint32Array]", w = {};
|
|
1733
|
-
w[Jn] = w[Qn] = w[ta] = w[ea] = w[ia] = w[ra] = w[na] = w[aa] = w[sa] = !0;
|
|
1734
|
-
w[Rn] = w[jn] = w[Gn] = w[Vn] = w[Zn] = w[Fn] = w[Mn] = w[Yn] = w[Wn] = w[Xn] = w[qn] = w[Hn] = w[Un] = w[Bn] = w[Kn] = !1;
|
|
1735
|
-
function oa(e) {
|
|
1736
|
-
return Pn(e) && zn(e.length) && !!w[kn(e)];
|
|
1737
|
-
}
|
|
1738
|
-
var la = oa;
|
|
1739
|
-
function ua(e) {
|
|
1740
|
-
return function(t) {
|
|
1741
|
-
return e(t);
|
|
1742
|
-
};
|
|
1743
|
-
}
|
|
1744
|
-
var ha = ua, Nt = { exports: {} };
|
|
1745
|
-
(function(e, t) {
|
|
1746
|
-
var i = De, r = t && !t.nodeType && t, n = r && !0 && e && !e.nodeType && e, a = n && n.exports === r, s = a && i.process, l = function() {
|
|
1747
|
-
try {
|
|
1748
|
-
var h = n && n.require && n.require("util").types;
|
|
1749
|
-
return h || s && s.binding && s.binding("util");
|
|
1750
|
-
} catch {
|
|
1751
|
-
}
|
|
1752
|
-
}();
|
|
1753
|
-
e.exports = l;
|
|
1754
|
-
})(Nt, Nt.exports);
|
|
1755
|
-
var ca = la, fa = ha, we = Nt.exports, Te = we && we.isTypedArray, da = Te ? fa(Te) : ca, va = da, ga = bn, ma = Dn, pa = Cn, ba = Dt.exports, ya = Pe, wa = va, Ta = Object.prototype, Ea = Ta.hasOwnProperty;
|
|
1756
|
-
function _a(e, t) {
|
|
1757
|
-
var i = pa(e), r = !i && ma(e), n = !i && !r && ba(e), a = !i && !r && !n && wa(e), s = i || r || n || a, l = s ? ga(e.length, String) : [], h = l.length;
|
|
1758
|
-
for (var o in e)
|
|
1759
|
-
(t || Ea.call(e, o)) && !(s && (o == "length" || n && (o == "offset" || o == "parent") || a && (o == "buffer" || o == "byteLength" || o == "byteOffset") || ya(o, h))) && l.push(o);
|
|
1760
|
-
return l;
|
|
1761
|
-
}
|
|
1762
|
-
var Sa = _a, Oa = Object.prototype;
|
|
1763
|
-
function Ia(e) {
|
|
1764
|
-
var t = e && e.constructor, i = typeof t == "function" && t.prototype || Oa;
|
|
1765
|
-
return e === i;
|
|
1766
|
-
}
|
|
1767
|
-
var Aa = Ia;
|
|
1768
|
-
function xa(e) {
|
|
1769
|
-
var t = [];
|
|
1770
|
-
if (e != null)
|
|
1771
|
-
for (var i in Object(e))
|
|
1772
|
-
t.push(i);
|
|
1773
|
-
return t;
|
|
1774
|
-
}
|
|
1775
|
-
var Da = xa, Na = bt, Ca = Aa, La = Da, $a = Object.prototype, ka = $a.hasOwnProperty;
|
|
1776
|
-
function za(e) {
|
|
1777
|
-
if (!Na(e))
|
|
1778
|
-
return La(e);
|
|
1779
|
-
var t = Ca(e), i = [];
|
|
1780
|
-
for (var r in e)
|
|
1781
|
-
r == "constructor" && (t || !ka.call(e, r)) || i.push(r);
|
|
1782
|
-
return i;
|
|
1783
|
-
}
|
|
1784
|
-
var Pa = za, Ra = Sa, ja = Pa, Va = ze;
|
|
1785
|
-
function Fa(e) {
|
|
1786
|
-
return Va(e) ? Ra(e, !0) : ja(e);
|
|
1787
|
-
}
|
|
1788
|
-
var Ma = Fa, Ya = tn, Wa = $e, Xa = mn, qa = Ma, je = Object.prototype, Ha = je.hasOwnProperty;
|
|
1789
|
-
Ya(function(e, t) {
|
|
1790
|
-
e = Object(e);
|
|
1791
|
-
var i = -1, r = t.length, n = r > 2 ? t[2] : void 0;
|
|
1792
|
-
for (n && Xa(t[0], t[1], n) && (r = 1); ++i < r; )
|
|
1793
|
-
for (var a = t[i], s = qa(a), l = -1, h = s.length; ++l < h; ) {
|
|
1794
|
-
var o = s[l], u = e[o];
|
|
1795
|
-
(u === void 0 || Wa(u, je[o]) && !Ha.call(e, o)) && (e[o] = a[o]);
|
|
1796
|
-
}
|
|
1797
|
-
return e;
|
|
1798
|
-
});
|
|
1799
|
-
const Ua = typeof window < "u" && window !== null;
|
|
1800
|
-
Ba();
|
|
1801
|
-
function Ba() {
|
|
1802
|
-
return Ua && "IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype ? ("isIntersecting" in window.IntersectionObserverEntry.prototype || Object.defineProperty(window.IntersectionObserverEntry.prototype, "isIntersecting", {
|
|
1803
|
-
get() {
|
|
1804
|
-
return this.intersectionRatio > 0;
|
|
1805
|
-
}
|
|
1806
|
-
}), !0) : !1;
|
|
1807
|
-
}
|
|
1808
|
-
var Ka = (e, t) => {
|
|
1809
|
-
const i = e.__vccOpts || e;
|
|
1810
|
-
for (const [r, n] of t)
|
|
1811
|
-
i[r] = n;
|
|
1812
|
-
return i;
|
|
1171
|
+
function ge(e) {
|
|
1172
|
+
return !!he && he in e;
|
|
1173
|
+
}
|
|
1174
|
+
var _e = Function.prototype.toString;
|
|
1175
|
+
function ve(e) {
|
|
1176
|
+
if (e != null) {
|
|
1177
|
+
try {
|
|
1178
|
+
return _e.call(e);
|
|
1179
|
+
} catch (e) {}
|
|
1180
|
+
try {
|
|
1181
|
+
return e + "";
|
|
1182
|
+
} catch (e) {}
|
|
1183
|
+
}
|
|
1184
|
+
return "";
|
|
1185
|
+
}
|
|
1186
|
+
var ye = /[\\^$.*+?()[\]{}|]/g, be = /^\[object .+?Constructor\]$/, xe = Function.prototype, F = Object.prototype, Se = xe.toString, Ce = F.hasOwnProperty, we = RegExp("^" + Se.call(Ce).replace(ye, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
1187
|
+
function Te(e) {
|
|
1188
|
+
return !N(e) || ge(e) ? !1 : (me(e) ? we : be).test(ve(e));
|
|
1189
|
+
}
|
|
1190
|
+
function Ee(e, t) {
|
|
1191
|
+
return e == null ? void 0 : e[t];
|
|
1192
|
+
}
|
|
1193
|
+
function De(e, t) {
|
|
1194
|
+
var n = Ee(e, t);
|
|
1195
|
+
return Te(n) ? n : void 0;
|
|
1196
|
+
}
|
|
1197
|
+
function Oe(e, t, n) {
|
|
1198
|
+
switch (n.length) {
|
|
1199
|
+
case 0: return e.call(t);
|
|
1200
|
+
case 1: return e.call(t, n[0]);
|
|
1201
|
+
case 2: return e.call(t, n[0], n[1]);
|
|
1202
|
+
case 3: return e.call(t, n[0], n[1], n[2]);
|
|
1203
|
+
}
|
|
1204
|
+
return e.apply(t, n);
|
|
1205
|
+
}
|
|
1206
|
+
var ke = 800, Ae = 16, je = Date.now;
|
|
1207
|
+
function Me(e) {
|
|
1208
|
+
var t = 0, n = 0;
|
|
1209
|
+
return function() {
|
|
1210
|
+
var r = je(), i = Ae - (r - n);
|
|
1211
|
+
if (n = r, i > 0) {
|
|
1212
|
+
if (++t >= ke) return arguments[0];
|
|
1213
|
+
} else t = 0;
|
|
1214
|
+
return e.apply(void 0, arguments);
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
function Ne(e) {
|
|
1218
|
+
return function() {
|
|
1219
|
+
return e;
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
var I = function() {
|
|
1223
|
+
try {
|
|
1224
|
+
var e = De(Object, "defineProperty");
|
|
1225
|
+
return e({}, "", {}), e;
|
|
1226
|
+
} catch (e) {}
|
|
1227
|
+
}(), L = Me(I ? function(e, t) {
|
|
1228
|
+
return I(e, "toString", {
|
|
1229
|
+
configurable: !0,
|
|
1230
|
+
enumerable: !1,
|
|
1231
|
+
value: Ne(t),
|
|
1232
|
+
writable: !0
|
|
1233
|
+
});
|
|
1234
|
+
} : le), Pe = 9007199254740991, R = /^(?:0|[1-9]\d*)$/;
|
|
1235
|
+
function z(e, t) {
|
|
1236
|
+
var n = typeof e;
|
|
1237
|
+
return t = t == null ? Pe : t, !!t && (n == "number" || n != "symbol" && R.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
1238
|
+
}
|
|
1239
|
+
function B(e, t, n) {
|
|
1240
|
+
t == "__proto__" && I ? I(e, t, {
|
|
1241
|
+
configurable: !0,
|
|
1242
|
+
enumerable: !0,
|
|
1243
|
+
value: n,
|
|
1244
|
+
writable: !0
|
|
1245
|
+
}) : e[t] = n;
|
|
1246
|
+
}
|
|
1247
|
+
function Fe(e, t) {
|
|
1248
|
+
return e === t || e !== e && t !== t;
|
|
1249
|
+
}
|
|
1250
|
+
var V = Object.prototype.hasOwnProperty;
|
|
1251
|
+
function H(e, t, n) {
|
|
1252
|
+
var r = e[t];
|
|
1253
|
+
(!(V.call(e, t) && Fe(r, n)) || n === void 0 && !(t in e)) && B(e, t, n);
|
|
1254
|
+
}
|
|
1255
|
+
function U(e, t, n, r) {
|
|
1256
|
+
var i = !n;
|
|
1257
|
+
n || (n = {});
|
|
1258
|
+
for (var a = -1, o = t.length; ++a < o;) {
|
|
1259
|
+
var s = t[a], c = r ? r(n[s], e[s], s, n, e) : void 0;
|
|
1260
|
+
c === void 0 && (c = e[s]), i ? B(n, s, c) : H(n, s, c);
|
|
1261
|
+
}
|
|
1262
|
+
return n;
|
|
1263
|
+
}
|
|
1264
|
+
var W = Math.max;
|
|
1265
|
+
function Ie(e, t, n) {
|
|
1266
|
+
return t = W(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1267
|
+
for (var r = arguments, i = -1, a = W(r.length - t, 0), o = Array(a); ++i < a;) o[i] = r[t + i];
|
|
1268
|
+
i = -1;
|
|
1269
|
+
for (var s = Array(t + 1); ++i < t;) s[i] = r[i];
|
|
1270
|
+
return s[t] = n(o), Oe(e, this, s);
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
function G(e, t) {
|
|
1274
|
+
return L(Ie(e, t, le), e + "");
|
|
1275
|
+
}
|
|
1276
|
+
var Le = 9007199254740991;
|
|
1277
|
+
function K(e) {
|
|
1278
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Le;
|
|
1279
|
+
}
|
|
1280
|
+
function q(e) {
|
|
1281
|
+
return e != null && K(e.length) && !me(e);
|
|
1282
|
+
}
|
|
1283
|
+
function J(e, t, n) {
|
|
1284
|
+
if (!N(n)) return !1;
|
|
1285
|
+
var r = typeof t;
|
|
1286
|
+
return (r == "number" ? q(n) && z(t, n.length) : r == "string" && t in n) ? Fe(n[t], e) : !1;
|
|
1287
|
+
}
|
|
1288
|
+
function Re(e) {
|
|
1289
|
+
return G(function(t, n) {
|
|
1290
|
+
var r = -1, i = n.length, a = i > 1 ? n[i - 1] : void 0, o = i > 2 ? n[2] : void 0;
|
|
1291
|
+
for (a = e.length > 3 && typeof a == "function" ? (i--, a) : void 0, o && J(n[0], n[1], o) && (a = i < 3 ? void 0 : a, i = 1), t = Object(t); ++r < i;) {
|
|
1292
|
+
var s = n[r];
|
|
1293
|
+
s && e(t, s, r, a);
|
|
1294
|
+
}
|
|
1295
|
+
return t;
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
var ze = Object.prototype;
|
|
1299
|
+
function Be(e) {
|
|
1300
|
+
var t = e && e.constructor;
|
|
1301
|
+
return e === (typeof t == "function" && t.prototype || ze);
|
|
1302
|
+
}
|
|
1303
|
+
function Y(e, t) {
|
|
1304
|
+
for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
|
|
1305
|
+
return r;
|
|
1306
|
+
}
|
|
1307
|
+
var Ve = "[object Arguments]";
|
|
1308
|
+
function He(e) {
|
|
1309
|
+
return ce(e) && se(e) == Ve;
|
|
1310
|
+
}
|
|
1311
|
+
var X = Object.prototype, Z = X.hasOwnProperty, Q = X.propertyIsEnumerable, Ue = He(function() {
|
|
1312
|
+
return arguments;
|
|
1313
|
+
}()) ? He : function(e) {
|
|
1314
|
+
return ce(e) && Z.call(e, "callee") && !Q.call(e, "callee");
|
|
1813
1315
|
};
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
destroyViewer: a
|
|
1860
|
-
};
|
|
1861
|
-
}
|
|
1862
|
-
}), Za = { ref: "root" };
|
|
1863
|
-
function Ja(e, t, i, r, n, a) {
|
|
1864
|
-
return ft(), St("div", Za, [
|
|
1865
|
-
Ye(e.$slots, "default", {
|
|
1866
|
-
images: e.images,
|
|
1867
|
-
options: e.options
|
|
1868
|
-
})
|
|
1869
|
-
], 512);
|
|
1870
|
-
}
|
|
1871
|
-
var Qa = /* @__PURE__ */ Ka(Ga, [["render", Ja]]);
|
|
1872
|
-
const ts = ["src"], es = /* @__PURE__ */ Ee({
|
|
1873
|
-
__name: "ImageViewer",
|
|
1874
|
-
props: {
|
|
1875
|
-
image: null
|
|
1876
|
-
},
|
|
1877
|
-
setup(e) {
|
|
1878
|
-
const t = e, i = We(() => t.image ? [{ src: t.image, index: 0 }] : []);
|
|
1879
|
-
return (r, n) => (ft(), Xe(Tt(Qa), {
|
|
1880
|
-
images: Tt(i),
|
|
1881
|
-
style: { height: "100%" }
|
|
1882
|
-
}, {
|
|
1883
|
-
default: qe(() => [
|
|
1884
|
-
(ft(!0), St(He, null, Ue(Tt(i), (a) => (ft(), St("img", {
|
|
1885
|
-
alt: "图片",
|
|
1886
|
-
src: a.src,
|
|
1887
|
-
key: a.index,
|
|
1888
|
-
class: "image"
|
|
1889
|
-
}, null, 8, ts))), 128))
|
|
1890
|
-
]),
|
|
1891
|
-
_: 1
|
|
1892
|
-
}, 8, ["images"]));
|
|
1893
|
-
}
|
|
1316
|
+
function We() {
|
|
1317
|
+
return !1;
|
|
1318
|
+
}
|
|
1319
|
+
var Ge = typeof exports == "object" && exports && !exports.nodeType && exports, Ke = Ge && typeof module == "object" && module && !module.nodeType && module, qe = Ke && Ke.exports === Ge ? re.Buffer : void 0, Je = (qe ? qe.isBuffer : void 0) || We, Ye = "[object Arguments]", Xe = "[object Array]", Ze = "[object Boolean]", Qe = "[object Date]", $e = "[object Error]", et = "[object Function]", tt = "[object Map]", nt = "[object Number]", rt = "[object Object]", it = "[object RegExp]", at = "[object Set]", ot = "[object String]", st = "[object WeakMap]", ct = "[object ArrayBuffer]", lt = "[object DataView]", ut = "[object Float32Array]", dt = "[object Float64Array]", ft = "[object Int8Array]", pt = "[object Int16Array]", mt = "[object Int32Array]", ht = "[object Uint8Array]", gt = "[object Uint8ClampedArray]", _t = "[object Uint16Array]", vt = "[object Uint32Array]", $ = {};
|
|
1320
|
+
$[ut] = $[dt] = $[ft] = $[pt] = $[mt] = $[ht] = $[gt] = $[_t] = $[vt] = !0, $[Ye] = $[Xe] = $[ct] = $[Ze] = $[lt] = $[Qe] = $[$e] = $[et] = $[tt] = $[nt] = $[rt] = $[it] = $[at] = $[ot] = $[st] = !1;
|
|
1321
|
+
function yt(e) {
|
|
1322
|
+
return ce(e) && K(e.length) && !!$[se(e)];
|
|
1323
|
+
}
|
|
1324
|
+
function bt(e) {
|
|
1325
|
+
return function(t) {
|
|
1326
|
+
return e(t);
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
var xt = typeof exports == "object" && exports && !exports.nodeType && exports, St = xt && typeof module == "object" && module && !module.nodeType && module, Ct = St && St.exports === xt && C.process, wt = function() {
|
|
1330
|
+
try {
|
|
1331
|
+
return St && St.require && St.require("util").types || Ct && Ct.binding && Ct.binding("util");
|
|
1332
|
+
} catch (e) {}
|
|
1333
|
+
}(), Tt = wt && wt.isTypedArray, Et = Tt ? bt(Tt) : yt, Dt = Object.prototype.hasOwnProperty;
|
|
1334
|
+
function Ot(e, t) {
|
|
1335
|
+
var n = M(e), r = !n && Ue(e), i = !n && !r && Je(e), a = !n && !r && !i && Et(e), o = n || r || i || a, s = o ? Y(e.length, String) : [], c = s.length;
|
|
1336
|
+
for (var l in e) (t || Dt.call(e, l)) && !(o && (l == "length" || i && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || z(l, c))) && s.push(l);
|
|
1337
|
+
return s;
|
|
1338
|
+
}
|
|
1339
|
+
function kt(e, t) {
|
|
1340
|
+
return function(n) {
|
|
1341
|
+
return e(t(n));
|
|
1342
|
+
};
|
|
1343
|
+
}
|
|
1344
|
+
var At = kt(Object.keys, Object), jt = Object.prototype.hasOwnProperty;
|
|
1345
|
+
function Mt(e) {
|
|
1346
|
+
if (!Be(e)) return At(e);
|
|
1347
|
+
var t = [];
|
|
1348
|
+
for (var n in Object(e)) jt.call(e, n) && n != "constructor" && t.push(n);
|
|
1349
|
+
return t;
|
|
1350
|
+
}
|
|
1351
|
+
function Nt(e) {
|
|
1352
|
+
return q(e) ? Ot(e) : Mt(e);
|
|
1353
|
+
}
|
|
1354
|
+
var Pt = Object.prototype.hasOwnProperty;
|
|
1355
|
+
Re(function(e, t) {
|
|
1356
|
+
if (Be(t) || q(t)) {
|
|
1357
|
+
U(t, Nt(t), e);
|
|
1358
|
+
return;
|
|
1359
|
+
}
|
|
1360
|
+
for (var n in t) Pt.call(t, n) && H(e, n, t[n]);
|
|
1894
1361
|
});
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1362
|
+
function Ft(e) {
|
|
1363
|
+
var t = [];
|
|
1364
|
+
if (e != null) for (var n in Object(e)) t.push(n);
|
|
1365
|
+
return t;
|
|
1366
|
+
}
|
|
1367
|
+
var It = Object.prototype.hasOwnProperty;
|
|
1368
|
+
function Lt(e) {
|
|
1369
|
+
if (!N(e)) return Ft(e);
|
|
1370
|
+
var t = Be(e), n = [];
|
|
1371
|
+
for (var r in e) r == "constructor" && (t || !It.call(e, r)) || n.push(r);
|
|
1372
|
+
return n;
|
|
1373
|
+
}
|
|
1374
|
+
function Rt(e) {
|
|
1375
|
+
return q(e) ? Ot(e, !0) : Lt(e);
|
|
1376
|
+
}
|
|
1377
|
+
var zt = Object.prototype, Bt = zt.hasOwnProperty;
|
|
1378
|
+
G(function(e, t) {
|
|
1379
|
+
e = Object(e);
|
|
1380
|
+
var n = -1, r = t.length, i = r > 2 ? t[2] : void 0;
|
|
1381
|
+
for (i && J(t[0], t[1], i) && (r = 1); ++n < r;) for (var a = t[n], o = Rt(a), s = -1, c = o.length; ++s < c;) {
|
|
1382
|
+
var l = o[s], u = e[l];
|
|
1383
|
+
(u === void 0 || Fe(u, zt[l]) && !Bt.call(e, l)) && (e[l] = a[l]);
|
|
1384
|
+
}
|
|
1385
|
+
return e;
|
|
1386
|
+
});
|
|
1387
|
+
var Vt = d({
|
|
1388
|
+
name: "Viewer",
|
|
1389
|
+
props: {
|
|
1390
|
+
images: {
|
|
1391
|
+
type: Array,
|
|
1392
|
+
default: () => []
|
|
1393
|
+
},
|
|
1394
|
+
rebuild: {
|
|
1395
|
+
type: Boolean,
|
|
1396
|
+
default: !1
|
|
1397
|
+
},
|
|
1398
|
+
trigger: {
|
|
1399
|
+
type: Object,
|
|
1400
|
+
default: null
|
|
1401
|
+
},
|
|
1402
|
+
options: {
|
|
1403
|
+
type: Object,
|
|
1404
|
+
default: () => null
|
|
1405
|
+
}
|
|
1406
|
+
},
|
|
1407
|
+
emits: ["inited"],
|
|
1408
|
+
setup(e, { emit: t }) {
|
|
1409
|
+
let n, r = v();
|
|
1410
|
+
function i() {
|
|
1411
|
+
n = new te.default(r.value, e.options), t("inited", n);
|
|
1412
|
+
}
|
|
1413
|
+
function a() {
|
|
1414
|
+
n && n.destroy();
|
|
1415
|
+
}
|
|
1416
|
+
function o() {
|
|
1417
|
+
a(), i();
|
|
1418
|
+
}
|
|
1419
|
+
function s() {
|
|
1420
|
+
n ? (n.update(), t("inited", n)) : i();
|
|
1421
|
+
}
|
|
1422
|
+
function c() {
|
|
1423
|
+
e.rebuild ? o() : s();
|
|
1424
|
+
}
|
|
1425
|
+
let l = { deep: !0 };
|
|
1426
|
+
return S(() => e.images, () => {
|
|
1427
|
+
f(() => {
|
|
1428
|
+
c();
|
|
1429
|
+
});
|
|
1430
|
+
}, l), S(() => e.trigger, () => {
|
|
1431
|
+
f(() => {
|
|
1432
|
+
c();
|
|
1433
|
+
});
|
|
1434
|
+
}, l), S(() => e.options, () => {
|
|
1435
|
+
f(() => {
|
|
1436
|
+
o();
|
|
1437
|
+
});
|
|
1438
|
+
}, l), h(() => i()), g(() => a()), {
|
|
1439
|
+
root: r,
|
|
1440
|
+
createViewer: i,
|
|
1441
|
+
rebuildViewer: o,
|
|
1442
|
+
updateViewer: s,
|
|
1443
|
+
destroyViewer: a
|
|
1444
|
+
};
|
|
1445
|
+
}
|
|
1446
|
+
}), Ht = (e, t) => {
|
|
1447
|
+
let n = e.__vccOpts || e;
|
|
1448
|
+
for (let [e, r] of t) n[e] = r;
|
|
1449
|
+
return n;
|
|
1450
|
+
}, Ut = { ref: "root" };
|
|
1451
|
+
function Wt(e, t, n, r, i, a) {
|
|
1452
|
+
return _(), l("div", Ut, [b(e.$slots, "default", {
|
|
1453
|
+
images: e.images,
|
|
1454
|
+
options: e.options
|
|
1455
|
+
})], 512);
|
|
1456
|
+
}
|
|
1457
|
+
var Gt = /* @__PURE__ */ Ht(Vt, [["render", Wt]]), Kt = ["src"], qt = /*#__PURE__*/ o(/* @__PURE__ */ d({
|
|
1458
|
+
__name: "ImageViewer",
|
|
1459
|
+
props: { image: {} },
|
|
1460
|
+
setup(e) {
|
|
1461
|
+
let t = e, n = v(null), o = v(1), d = v(0), f = a(), g = null, b = c(() => t.image ? [{
|
|
1462
|
+
src: t.image,
|
|
1463
|
+
index: 0
|
|
1464
|
+
}] : []), te = c(() => ({ height: d.value ? `${Math.max(1, Math.round(d.value * o.value))}px` : `${o.value * 100}%` })), C = (e) => Math.min(5, Math.max(.1, Number(e.toFixed(2)))), ne = () => {
|
|
1465
|
+
o.value = C(o.value + .15);
|
|
1466
|
+
}, re = () => {
|
|
1467
|
+
o.value = C(o.value - .15);
|
|
1468
|
+
}, w = () => {
|
|
1469
|
+
o.value = 1;
|
|
1470
|
+
}, T = () => ({
|
|
1471
|
+
scale: o.value,
|
|
1472
|
+
label: `${Math.round(o.value * 100)}%`,
|
|
1473
|
+
canZoomIn: o.value < 5,
|
|
1474
|
+
canZoomOut: o.value > .1,
|
|
1475
|
+
canReset: o.value !== 1,
|
|
1476
|
+
minScale: .1,
|
|
1477
|
+
maxScale: 5
|
|
1478
|
+
}), E = () => {
|
|
1479
|
+
let e = n.value;
|
|
1480
|
+
e && r(e, {
|
|
1481
|
+
zoomIn: () => (ne(), T()),
|
|
1482
|
+
zoomOut: () => (re(), T()),
|
|
1483
|
+
resetZoom: () => (w(), T()),
|
|
1484
|
+
setZoom: (e) => (o.value = C(e), T()),
|
|
1485
|
+
getState: T,
|
|
1486
|
+
subscribe: f.subscribe
|
|
1487
|
+
});
|
|
1488
|
+
}, D = () => {
|
|
1489
|
+
var e;
|
|
1490
|
+
d.value = ((e = n.value) == null ? void 0 : e.clientHeight) || 0;
|
|
1491
|
+
};
|
|
1492
|
+
return S([o, d], () => {
|
|
1493
|
+
f.emit();
|
|
1494
|
+
}), h(() => {
|
|
1495
|
+
E(), D(), n.value && (g = new ResizeObserver(D), g.observe(n.value));
|
|
1496
|
+
}), m(() => {
|
|
1497
|
+
g == null || g.disconnect(), g = null, i(n.value);
|
|
1498
|
+
}), (e, t) => (_(), l("div", {
|
|
1499
|
+
ref_key: "root",
|
|
1500
|
+
ref: n,
|
|
1501
|
+
class: "image-viewer",
|
|
1502
|
+
"data-viewer-zoom-provider": "image"
|
|
1503
|
+
}, [u(x(Gt), {
|
|
1504
|
+
images: b.value,
|
|
1505
|
+
class: "image-stage"
|
|
1506
|
+
}, {
|
|
1507
|
+
default: ee(() => [(_(!0), l(s, null, y(b.value, (e) => (_(), l("img", {
|
|
1508
|
+
alt: "图片",
|
|
1509
|
+
src: e.src,
|
|
1510
|
+
key: e.index,
|
|
1511
|
+
class: "image",
|
|
1512
|
+
style: p(te.value)
|
|
1513
|
+
}, null, 12, Kt))), 128))]),
|
|
1514
|
+
_: 1
|
|
1515
|
+
}, 8, ["images"])], 512));
|
|
1516
|
+
}
|
|
1517
|
+
}), [["__scopeId", "data-v-4dc76b9d"]]);
|
|
1518
|
+
//#endregion
|
|
1519
|
+
export { qt as default };
|