file-viewer3 1.0.26 → 2.0.1

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.
Files changed (359) hide show
  1. package/README.en.md +7 -377
  2. package/README.md +8 -352
  3. package/dist/file-viewer3.css +1 -2
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/package.json +27 -129
  7. package/dist/components/3MFLoader.js +0 -527
  8. package/dist/components/AMFLoader.js +0 -188
  9. package/dist/components/ArchiveViewer.js +0 -526
  10. package/dist/components/AudioViewer.js +0 -66
  11. package/dist/components/CadViewer.js +0 -9040
  12. package/dist/components/CodeViewer.js +0 -151
  13. package/dist/components/ColladaLoader.js +0 -2282
  14. package/dist/components/DrawingViewer.js +0 -295
  15. package/dist/components/EdaViewer.js +0 -630
  16. package/dist/components/EmailViewer.js +0 -276
  17. package/dist/components/EpubViewer.js +0 -172
  18. package/dist/components/FBXLoader.js +0 -1574
  19. package/dist/components/GLTFLoader.js +0 -1383
  20. package/dist/components/ImageViewer.js +0 -1519
  21. package/dist/components/KMZLoader.js +0 -45
  22. package/dist/components/MarkdownViewer.js +0 -1476
  23. package/dist/components/ModelViewer.js +0 -797
  24. package/dist/components/OBJLoader.js +0 -287
  25. package/dist/components/OfdViewer.js +0 -133
  26. package/dist/components/PCDLoader.js +0 -141
  27. package/dist/components/PLYLoader.js +0 -305
  28. package/dist/components/PdfView.js +0 -27667
  29. package/dist/components/PptxRender.js +0 -11217
  30. package/dist/components/STLLoader.js +0 -83
  31. package/dist/components/TDSLoader.js +0 -228
  32. package/dist/components/TypstViewer.js +0 -1697
  33. package/dist/components/USDLoader.js +0 -2526
  34. package/dist/components/UmdViewer.js +0 -1873
  35. package/dist/components/VRMLLoader.js +0 -6422
  36. package/dist/components/VTKLoader.js +0 -337
  37. package/dist/components/XYZLoader.js +0 -30
  38. package/dist/components/XlsxTable.js +0 -7879
  39. package/dist/components/__vite-browser-external.js +0 -7
  40. package/dist/components/_plugin-vue_export-helper.js +0 -8
  41. package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
  42. package/dist/components/arc.js +0 -79
  43. package/dist/components/architecture-7EHR7CIX.js +0 -3
  44. package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
  45. package/dist/components/archive.js +0 -24
  46. package/dist/components/asyncToGenerator.js +0 -29
  47. package/dist/components/audio.js +0 -19
  48. package/dist/components/az-AZ-76LH7QW2.js +0 -523
  49. package/dist/components/bash.js +0 -169
  50. package/dist/components/bg-BG-XCXSNQG7.js +0 -523
  51. package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
  52. package/dist/components/bn-BD-2XOGV67Q.js +0 -523
  53. package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
  54. package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
  55. package/dist/components/cad.js +0 -23
  56. package/dist/components/cfb.js +0 -1174
  57. package/dist/components/channel.js +0 -5
  58. package/dist/components/chunk-2J33WTMH.js +0 -26
  59. package/dist/components/chunk-3OPIFGDE.js +0 -4167
  60. package/dist/components/chunk-4BX2VUAB.js +0 -19
  61. package/dist/components/chunk-55IACEB6.js +0 -9
  62. package/dist/components/chunk-5ZQYHXKU.js +0 -669
  63. package/dist/components/chunk-6U3AYISY.js +0 -624
  64. package/dist/components/chunk-727SXJPM.js +0 -3356
  65. package/dist/components/chunk-AGHRB4JF.js +0 -324
  66. package/dist/components/chunk-AQP2D5EJ.js +0 -2055
  67. package/dist/components/chunk-BSJP7CBP.js +0 -83
  68. package/dist/components/chunk-CSCIHK7Q.js +0 -3500
  69. package/dist/components/chunk-EIO257PC.js +0 -1836
  70. package/dist/components/chunk-FMBD7UC4.js +0 -5
  71. package/dist/components/chunk-K2UTITRG.js +0 -17627
  72. package/dist/components/chunk-KSCS5N6A.js +0 -572
  73. package/dist/components/chunk-L5ZTLDWV.js +0 -40
  74. package/dist/components/chunk-LZXEDZCA.js +0 -60
  75. package/dist/components/chunk-ND2GUHAM.js +0 -61
  76. package/dist/components/chunk-NNHCCRGN.js +0 -20425
  77. package/dist/components/chunk-NZK2D7GU.js +0 -68
  78. package/dist/components/chunk-O5CBEL6O.js +0 -1894
  79. package/dist/components/chunk-QZHKN3VN.js +0 -12
  80. package/dist/components/chunk-SRAX5OIU.js +0 -22
  81. package/dist/components/chunk-WU5MYG2G.js +0 -14
  82. package/dist/components/chunk-XPW4576I.js +0 -1146
  83. package/dist/components/chunk-Z3N5DIM6.js +0 -59
  84. package/dist/components/chunk-ZUYEQ4TG.js +0 -22
  85. package/dist/components/chunk.js +0 -23
  86. package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
  87. package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
  88. package/dist/components/compiler.js +0 -2
  89. package/dist/components/core.js +0 -845
  90. package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
  91. package/dist/components/cpp.js +0 -225
  92. package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
  93. package/dist/components/csharp.js +0 -260
  94. package/dist/components/css.js +0 -140
  95. package/dist/components/cytoscape.esm.js +0 -18114
  96. package/dist/components/da-DK-5WZEPLOC.js +0 -523
  97. package/dist/components/dagre-BM42HDAG.js +0 -325
  98. package/dist/components/dagre.js +0 -1936
  99. package/dist/components/de-DE-XR44H4JA.js +0 -523
  100. package/dist/components/defaultLocale.js +0 -201
  101. package/dist/components/defineProperty.js +0 -50
  102. package/dist/components/diagram-2AECGRRQ.js +0 -229
  103. package/dist/components/diagram-5GNKFQAL.js +0 -108
  104. package/dist/components/diagram-KO2AKTUF.js +0 -443
  105. package/dist/components/diagram-LMA3HP47.js +0 -139
  106. package/dist/components/diagram-OG6HWLK6.js +0 -541
  107. package/dist/components/diff.js +0 -39
  108. package/dist/components/directory-open-01563666.js +0 -26
  109. package/dist/components/directory-open-4ed118d0.js +0 -83
  110. package/dist/components/dist.js +0 -50
  111. package/dist/components/dist2.js +0 -3291
  112. package/dist/components/dist3.js +0 -1593
  113. package/dist/components/documentSearch.js +0 -378
  114. package/dist/components/docx-preview.js +0 -3113
  115. package/dist/components/drawing.js +0 -19
  116. package/dist/components/ebook.js +0 -16
  117. package/dist/components/eda.js +0 -20
  118. package/dist/components/el-GR-BZB4AONW.js +0 -523
  119. package/dist/components/email.js +0 -21
  120. package/dist/components/en-B4ZKOASM.js +0 -3
  121. package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
  122. package/dist/components/es-ES-U4NZUMDT.js +0 -523
  123. package/dist/components/eu-ES-A7QVB2H4.js +0 -523
  124. package/dist/components/eventmodeling-FCH6USID.js +0 -3
  125. package/dist/components/fa-IR-HGAKTJCU.js +0 -523
  126. package/dist/components/fflate.module.js +0 -323
  127. package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
  128. package/dist/components/file-open-002ab408.js +0 -38
  129. package/dist/components/file-open-7c801643.js +0 -24
  130. package/dist/components/file-save-3189631c.js +0 -40
  131. package/dist/components/file-save-745eba88.js +0 -36
  132. package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
  133. package/dist/components/fr-FR-RHASNOE6.js +0 -523
  134. package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
  135. package/dist/components/gitGraph-WXDBUCRP.js +0 -3
  136. package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
  137. package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
  138. package/dist/components/global-compiler.js +0 -23
  139. package/dist/components/global-renderer.js +0 -23
  140. package/dist/components/go.js +0 -140
  141. package/dist/components/graphlib.js +0 -1267
  142. package/dist/components/he-IL-6SHJWFNN.js +0 -523
  143. package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
  144. package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
  145. package/dist/components/id-ID-SAP4L64H.js +0 -523
  146. package/dist/components/image-GAAHSSAO.js +0 -3
  147. package/dist/components/image-blob-reduce.esm.js +0 -1429
  148. package/dist/components/image.js +0 -17
  149. package/dist/components/info-J43DQDTF.js +0 -3
  150. package/dist/components/infoDiagram-5YYISTIA.js +0 -26
  151. package/dist/components/ini.js +0 -88
  152. package/dist/components/init.js +0 -15
  153. package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
  154. package/dist/components/it-IT-JPQ66NNP.js +0 -523
  155. package/dist/components/ja-JP-DBVTYXUO.js +0 -523
  156. package/dist/components/java.js +0 -169
  157. package/dist/components/javascript.js +0 -436
  158. package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
  159. package/dist/components/json.js +0 -36
  160. package/dist/components/jszip.min.js +0 -3033
  161. package/dist/components/kaa-6HZHGXH3.js +0 -523
  162. package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
  163. package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
  164. package/dist/components/katex.js +0 -21979
  165. package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
  166. package/dist/components/km-KH-HSX4SM5Z.js +0 -523
  167. package/dist/components/ko-KR-MTYHY66A.js +0 -523
  168. package/dist/components/ku-TR-6OUDTVRD.js +0 -523
  169. package/dist/components/lib.js +0 -4877
  170. package/dist/components/libarchive.js +0 -360
  171. package/dist/components/linear.js +0 -289
  172. package/dist/components/lt-LT-XHIRWOB4.js +0 -523
  173. package/dist/components/lv-LV-5QDEKY6T.js +0 -523
  174. package/dist/components/markdown.js +0 -181
  175. package/dist/components/md.js +0 -17
  176. package/dist/components/mermaid-parser.core.js +0 -328
  177. package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
  178. package/dist/components/model.js +0 -21
  179. package/dist/components/mp4.js +0 -12
  180. package/dist/components/mr-IN-CRQNXWMA.js +0 -523
  181. package/dist/components/my-MM-5M5IBNSE.js +0 -523
  182. package/dist/components/nb-NO-T6EIAALU.js +0 -523
  183. package/dist/components/nestedRender.js +0 -158
  184. package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
  185. package/dist/components/nn-NO-6E72VCQL.js +0 -523
  186. package/dist/components/objectSpread2.js +0 -29
  187. package/dist/components/objectWithoutProperties.js +0 -28
  188. package/dist/components/oc-FR-POXYY2M6.js +0 -523
  189. package/dist/components/ofd.js +0 -5261
  190. package/dist/components/ofd2.js +0 -16
  191. package/dist/components/ordinal.js +0 -65
  192. package/dist/components/pa-IN-N4M65BXN.js +0 -523
  193. package/dist/components/packet-YPE3B663.js +0 -3
  194. package/dist/components/pdf.js +0 -24
  195. package/dist/components/percentages-BXMCSKIN.js +0 -3
  196. package/dist/components/php.js +0 -294
  197. package/dist/components/pica.js +0 -1009
  198. package/dist/components/pie-LRSECV5Y.js +0 -3
  199. package/dist/components/pie.js +0 -47
  200. package/dist/components/pieDiagram-4H26LBE5.js +0 -130
  201. package/dist/components/pl-PL-T2D74RX3.js +0 -523
  202. package/dist/components/postal-mime.js +0 -3146
  203. package/dist/components/pptx.js +0 -15
  204. package/dist/components/printLayout.js +0 -42
  205. package/dist/components/prod.js +0 -21770
  206. package/dist/components/pt-BR-5N22H2LF.js +0 -523
  207. package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
  208. package/dist/components/python.js +0 -238
  209. package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
  210. package/dist/components/radar-GUYGQ44K.js +0 -3
  211. package/dist/components/renderer.js +0 -2
  212. package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
  213. package/dist/components/ro-RO-JPDTUUEW.js +0 -523
  214. package/dist/components/rough.esm.js +0 -1355
  215. package/dist/components/roundRect.js +0 -90
  216. package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
  217. package/dist/components/rust.js +0 -169
  218. package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
  219. package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
  220. package/dist/components/shared.js +0 -175
  221. package/dist/components/shared2.js +0 -4
  222. package/dist/components/si-LK-N5RQ5JYF.js +0 -523
  223. package/dist/components/sk-SK-C5VTKIMK.js +0 -523
  224. package/dist/components/sl-SI-NN7IZMDC.js +0 -523
  225. package/dist/components/sourceLoading.js +0 -134
  226. package/dist/components/sql.js +0 -118
  227. package/dist/components/src.js +0 -2664
  228. package/dist/components/src2.js +0 -10722
  229. package/dist/components/stateDiagram-AJRCARHV.js +0 -217
  230. package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
  231. package/dist/components/subset-shared.chunk.js +0 -3
  232. package/dist/components/subset-worker.chunk.js +0 -21
  233. package/dist/components/sv-SE-XGPEYMSR.js +0 -523
  234. package/dist/components/ta-IN-2NMHFXQM.js +0 -523
  235. package/dist/components/text.js +0 -20
  236. package/dist/components/th-TH-HPSO5L25.js +0 -523
  237. package/dist/components/three.module.js +0 -13134
  238. package/dist/components/time.js +0 -910
  239. package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
  240. package/dist/components/tr-TR-DEFEU3FU.js +0 -523
  241. package/dist/components/treeView-BLDUP644.js +0 -3
  242. package/dist/components/treemap-LRROVOQU.js +0 -3
  243. package/dist/components/typescript.js +0 -521
  244. package/dist/components/typst.js +0 -25
  245. package/dist/components/uk-UA-QMV73CPH.js +0 -523
  246. package/dist/components/umd.js +0 -16
  247. package/dist/components/use.js +0 -422
  248. package/dist/components/util.js +0 -49
  249. package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
  250. package/dist/components/vi-VN-M7AON7JQ.js +0 -523
  251. package/dist/components/viewerZoom.js +0 -92
  252. package/dist/components/wardley-L42UT6IY.js +0 -3
  253. package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
  254. package/dist/components/wasm-pack-shim.js +0 -1711
  255. package/dist/components/wasm-pack-shim2.js +0 -934
  256. package/dist/components/wasm.js +0 -97
  257. package/dist/components/word.js +0 -3055
  258. package/dist/components/worker-ref.js +0 -16
  259. package/dist/components/xlsx.js +0 -21
  260. package/dist/components/xml.js +0 -166
  261. package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
  262. package/dist/components/yaml.js +0 -144
  263. package/dist/components/zh-CN-LNUGB5OW.js +0 -523
  264. package/dist/components/zh-HK-E62DVLB3.js +0 -523
  265. package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
  266. package/dist/index.mjs +0 -3293
  267. package/dist/src/App.vue.d.ts +0 -3
  268. package/dist/src/compare/CompareApp.vue.d.ts +0 -3
  269. package/dist/src/compare/main.d.ts +0 -0
  270. package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
  271. package/dist/src/components/HelloWorld.vue.d.ts +0 -3
  272. package/dist/src/components/utils.d.ts +0 -4
  273. package/dist/src/main.d.ts +0 -0
  274. package/dist/src/package/common/printCapability.d.ts +0 -27
  275. package/dist/src/package/common/printLayout.d.ts +0 -16
  276. package/dist/src/package/common/sourceLoading.d.ts +0 -10
  277. package/dist/src/package/common/type.d.ts +0 -544
  278. package/dist/src/package/common/util.d.ts +0 -5
  279. package/dist/src/package/common/worker-ref.d.ts +0 -12
  280. package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
  281. package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
  282. package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
  283. package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
  284. package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
  285. package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
  286. package/dist/src/package/components/FileViewer/index.d.ts +0 -2
  287. package/dist/src/package/components/FileViewer/util.d.ts +0 -3
  288. package/dist/src/package/index.d.ts +0 -22
  289. package/dist/src/package/use/documentLocation.d.ts +0 -15
  290. package/dist/src/package/use/documentSearch.d.ts +0 -234
  291. package/dist/src/package/use/index.d.ts +0 -5
  292. package/dist/src/package/use/loading.d.ts +0 -33
  293. package/dist/src/package/use/viewerZoom.d.ts +0 -42
  294. package/dist/src/package/use/worker.d.ts +0 -24
  295. package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
  296. package/dist/src/package/vendors/archive/cache.d.ts +0 -10
  297. package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
  298. package/dist/src/package/vendors/archive/index.d.ts +0 -3
  299. package/dist/src/package/vendors/archive/shared.d.ts +0 -24
  300. package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
  301. package/dist/src/package/vendors/audio/index.d.ts +0 -7
  302. package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
  303. package/dist/src/package/vendors/cad/index.d.ts +0 -8
  304. package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
  305. package/dist/src/package/vendors/drawing/index.d.ts +0 -7
  306. package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
  307. package/dist/src/package/vendors/ebook/index.d.ts +0 -7
  308. package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
  309. package/dist/src/package/vendors/eda/index.d.ts +0 -2
  310. package/dist/src/package/vendors/eda/parser.d.ts +0 -77
  311. package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
  312. package/dist/src/package/vendors/email/index.d.ts +0 -2
  313. package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
  314. package/dist/src/package/vendors/image/index.d.ts +0 -4
  315. package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
  316. package/dist/src/package/vendors/md/index.d.ts +0 -4
  317. package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
  318. package/dist/src/package/vendors/model/index.d.ts +0 -3
  319. package/dist/src/package/vendors/model/shared.d.ts +0 -1
  320. package/dist/src/package/vendors/mp4/index.d.ts +0 -4
  321. package/dist/src/package/vendors/nestedRender.d.ts +0 -10
  322. package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
  323. package/dist/src/package/vendors/ofd/index.d.ts +0 -7
  324. package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
  325. package/dist/src/package/vendors/pdf/index.d.ts +0 -2
  326. package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
  327. package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
  328. package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
  329. package/dist/src/package/vendors/pptx/index.d.ts +0 -6
  330. package/dist/src/package/vendors/pptx/options.d.ts +0 -39
  331. package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
  332. package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
  333. package/dist/src/package/vendors/renders.d.ts +0 -3
  334. package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
  335. package/dist/src/package/vendors/text/index.d.ts +0 -10
  336. package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
  337. package/dist/src/package/vendors/typst/index.d.ts +0 -8
  338. package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
  339. package/dist/src/package/vendors/umd/index.d.ts +0 -7
  340. package/dist/src/package/vendors/umd/parser.d.ts +0 -30
  341. package/dist/src/package/vendors/word/doc.d.ts +0 -5
  342. package/dist/src/package/vendors/word/docx.d.ts +0 -5
  343. package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
  344. package/dist/src/package/vendors/word/index.d.ts +0 -3
  345. package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
  346. package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
  347. package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
  348. package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
  349. package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
  350. package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
  351. package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
  352. package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
  353. package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
  354. package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
  355. package/dist/style.css +0 -1
  356. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  357. package/dist/wasm/cad/dwg-worker.js +0 -24
  358. package/dist/wasm/cad/libredwg-web.js +0 -15
  359. package/dist/wasm/cad/libredwg-web.wasm +0 -0
@@ -1,1519 +0,0 @@
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, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;") : 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 : "";
1170
- }();
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");
1315
- };
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]);
1361
- });
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 };