@roomle/embedding-lib 5.12.0 → 5.13.0-alpha.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 (28) hide show
  1. package/docs/md/web/embedding/CHANGELOG.md +22 -149
  2. package/{drag-in-Do47zdKL.mjs → drag-in-C6gLvrDx.mjs} +2 -2
  3. package/{drag-in-CYmR1HFI.mjs → drag-in-w_TrusdP.mjs} +1 -1
  4. package/{from-custom-view-DYkvyOw3.mjs → from-custom-view-BEcgFlAL.mjs} +1 -1
  5. package/{from-custom-view-BVWf7SQ7.mjs → from-custom-view-jmf3K6AT.mjs} +1 -1
  6. package/from-website-Ckh5GB2h.mjs +4 -0
  7. package/{from-website-DDMDPp-F.mjs → from-website-VCMg3teu.mjs} +2 -1
  8. package/package.json +2 -2
  9. package/roomle-embedding-lib.es.js +1 -1
  10. package/roomle-embedding-lib.es.min.js +1 -1
  11. package/roomle-embedding-lib.umd.js +1 -1
  12. package/roomle-embedding-lib.umd.min.js +1 -1
  13. package/src/common/business-logic/event-emitter.d.ts +4 -1
  14. package/src/common/components/overlays/bottom-bar/CloseView.vue.d.ts +105 -60
  15. package/src/common/composables/use-event-emitter-listener.d.ts +7 -1
  16. package/src/configurator/components/Overlays.vue.d.ts +614 -356
  17. package/src/configurator/components/overlays/DeleteWarning.vue.d.ts +102 -59
  18. package/src/configurator/components/overlays/ElementDisabled.vue.d.ts +102 -59
  19. package/src/configurator/components/overlays/GenericError.vue.d.ts +102 -59
  20. package/src/configurator/components/overlays/NoDocking.vue.d.ts +102 -59
  21. package/src/configurator/components/overlays/VariantWarning.vue.d.ts +102 -59
  22. package/src/configurator/components/overlays/ar/OpenAR.vue.d.ts +2 -2
  23. package/src/configurator/components/utils/PopUp.vue.d.ts +42 -72
  24. package/src/configurator/embedding/exposed-api.d.ts +5 -0
  25. package/src/configurator/embedding/exposed-callbacks.d.ts +2 -0
  26. package/src/planner/components/overlays/rooms/SlopingRoofDirectionTooltip.vue.d.ts +2 -0
  27. package/src/planner/components/overlays/rooms/SlopingRoofTooltip.vue.d.ts +2 -0
  28. package/from-website-Dx2SUftr.mjs +0 -4
@@ -1,157 +1,30 @@
1
- ## [5.12.0](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.11.1...embedding-lib-v5.12.0) (2025-03-11)
1
+ ## [5.13.0-alpha.1](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.12.0...embedding-lib-v5.13.0-alpha.1) (2025-03-18)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * 2.87.0-bo-mvp.1 ([02098de](https://github.com/roomle-dev/roomle-ui/commit/02098deb584a74a0896f02316ab99958cb83776e))
7
- * add QR code to the saved plan link ([a4d57ab](https://github.com/roomle-dev/roomle-ui/commit/a4d57ab3fd89eb4e7fa1561dbb0b7b39066443c7))
8
- * add wall attic functionality ([381c211](https://github.com/roomle-dev/roomle-ui/commit/381c211b3ebee5eb87dfee8a0aff665dac8586fd))
9
- * add wall plasterings among options for wall materials ([35fa3c3](https://github.com/roomle-dev/roomle-ui/commit/35fa3c32d3d702c0cca1a41fd477317426445d6e))
10
- * BO - TC-PoC ([88a17e5](https://github.com/roomle-dev/roomle-ui/commit/88a17e5b5de688931fba6b4780fbc47fb5c59a20))
11
- * BO - TC-PoC ([ffb902c](https://github.com/roomle-dev/roomle-ui/commit/ffb902cd97bb582ccf90613400b8da28c0007cfe))
12
- * call postProductManagerExportPoC on add-to-card while prodmanager is enabled ([8f2cdca](https://github.com/roomle-dev/roomle-ui/commit/8f2cdca05d0081f5795ec682ed5e53f1a6956cd9))
13
- * Construction elements adaptions "Switch product" ([5467043](https://github.com/roomle-dev/roomle-ui/commit/5467043bb66b97d6359b1b3bdf000ce9fb9c74f1))
14
- * core api - createPlanXmlWithObjects ([de8d816](https://github.com/roomle-dev/roomle-ui/commit/de8d816b9c2f44cd0d996a7631617bf53210e430))
15
- * create plan xml from external object group ([5df4946](https://github.com/roomle-dev/roomle-ui/commit/5df4946be5f445e3b836242b971c1416d2dd92a1))
16
- * enable autoStart to be false for desktop view only mode ([4db0bb4](https://github.com/roomle-dev/roomle-ui/commit/4db0bb40f4e861347caab0a9767f05fef32e9d00))
17
- * external catalog callback "onExternalUi" ([91865e2](https://github.com/roomle-dev/roomle-ui/commit/91865e2fb9625c229e58167fb4646d51f0e554cb))
18
- * HomagIx export ([51db342](https://github.com/roomle-dev/roomle-ui/commit/51db3423124e2a1e1bacea6fcd8c6c6f0b25d729))
19
- * Override request product if imosix flag is set ([01d6dd7](https://github.com/roomle-dev/roomle-ui/commit/01d6dd7bfc05efa82c0cd92f4286953be054e9a0))
20
- * poc - production manager export ([3c0903c](https://github.com/roomle-dev/roomle-ui/commit/3c0903cb288530afc4303fd7f89ae0e9e8084e76))
21
- * poc - production manager export ([e982b39](https://github.com/roomle-dev/roomle-ui/commit/e982b391d52c732120b50fb468eacba772aac73a))
22
- * remove onExternalUi callback ([02e6cba](https://github.com/roomle-dev/roomle-ui/commit/02e6cba829e17476e86111cf0b81fe8d74236d4e))
23
- * RML-11645 Override request product if imosix flag is set [#1182](https://github.com/roomle-dev/roomle-ui/issues/1182) ([4ef036e](https://github.com/roomle-dev/roomle-ui/commit/4ef036eb3ae377d5f927c53a95f586b79f9883cc))
24
- * **SDK:** upgrade to version 2.59.0-bo-mvp.1 ([7e288b8](https://github.com/roomle-dev/roomle-ui/commit/7e288b8df38094a94a49809de1e2c20fe4656872))
25
- * **SDK:** upgrade to version 2.59.0-bo-mvp.2 ([7de75a1](https://github.com/roomle-dev/roomle-ui/commit/7de75a1d76011b3ee6a910514b0c50cdb88ad8c5))
26
- * **SDK:** upgrade to version 2.59.0-bo-mvp.3 ([4d6ddfe](https://github.com/roomle-dev/roomle-ui/commit/4d6ddfe1f7d8f02870d8ad8c3667789c74c2d2aa))
27
- * **SDK:** upgrade to version 2.60.0-bo-mvp.1 ([be41f7e](https://github.com/roomle-dev/roomle-ui/commit/be41f7ee8be449bd6fda7b83aad3bcf21d198725))
28
- * **SDK:** upgrade to version 2.61.0-bo-mvp.1 ([e631d4f](https://github.com/roomle-dev/roomle-ui/commit/e631d4f28a3ad63b95f8e0772c932a2ccb0d4d60))
29
- * **SDK:** upgrade to version 2.61.0-bo-mvp.2 ([2371db1](https://github.com/roomle-dev/roomle-ui/commit/2371db1fa1591448e08edce0cf77bec327160c65))
30
- * **SDK:** upgrade to version 2.61.0-bo-mvp.3 ([742e515](https://github.com/roomle-dev/roomle-ui/commit/742e5152247d4407daef413c11a509a610716b31))
31
- * **SDK:** upgrade to version 2.82.0-bo-mvp.15 ([e3c4b77](https://github.com/roomle-dev/roomle-ui/commit/e3c4b777059034675db54fc00bab5e1d34337a0f))
32
- * **SDK:** upgrade to version 2.83.0-bo-mvp.1 ([c8bf41c](https://github.com/roomle-dev/roomle-ui/commit/c8bf41c58ec4d5e3104d94cf7feaddfcd9346f19))
33
- * **SDK:** upgrade to version 2.83.0-bo-mvp.2 ([3d63733](https://github.com/roomle-dev/roomle-ui/commit/3d637339af340417116720f9210edb39060138e8))
34
- * **SDK:** upgrade to version 2.83.0-bo-mvp.3 ([8aeece8](https://github.com/roomle-dev/roomle-ui/commit/8aeece8464ccdff39da08db3e34918450b099184))
35
- * **SDK:** upgrade to version 2.83.0-bo-mvp.5 ([724b4d7](https://github.com/roomle-dev/roomle-ui/commit/724b4d7340abff13418cafb6bb0fe9d4cd6203a9))
36
- * **SDK:** upgrade to version 2.83.0-bo-mvp.6 ([bb4d270](https://github.com/roomle-dev/roomle-ui/commit/bb4d270922ec26d23dfe6cafab4bf2182a77674e))
37
- * **SDK:** upgrade to version 2.86.0-bo-mvp.2 ([8f796cf](https://github.com/roomle-dev/roomle-ui/commit/8f796cf7b10e9a7033b274106065dc1fef6c96db))
38
- * **SDK:** upgrade to version 2.86.0-bo-mvp.3 ([dcfc2fd](https://github.com/roomle-dev/roomle-ui/commit/dcfc2fd750be5e3b68c546401aaec3a1e5691384))
39
- * **SDK:** upgrade to version 2.86.0-bo-mvp.3 ([712a869](https://github.com/roomle-dev/roomle-ui/commit/712a869c01c92fe87bfcbf511073432602f26115))
40
- * **SDK:** upgrade to version 2.86.0-bo-mvp.4 ([a2ab256](https://github.com/roomle-dev/roomle-ui/commit/a2ab256416e939111da501e8d24be0946d1a879d))
41
- * **SDK:** upgrade to version 2.86.0-bo-mvp.5 ([3e4294e](https://github.com/roomle-dev/roomle-ui/commit/3e4294ead2aebb4f690ed27e79ab6ace635ca0e1))
42
- * **SDK:** upgrade to version 2.86.0-bo-mvp.6 ([fc65ea0](https://github.com/roomle-dev/roomle-ui/commit/fc65ea08f74bb15cd284e4c2771833dd07836b36))
43
- * **SDK:** upgrade to version 2.86.0-bo-mvp.7 ([109fbf7](https://github.com/roomle-dev/roomle-ui/commit/109fbf7384f1557a7411b69a8c042791d7451da9))
44
- * **SDK:** upgrade to version 2.86.0-bo-mvp.8 ([94c258c](https://github.com/roomle-dev/roomle-ui/commit/94c258c9e17392c15236b9ddf2898e9c83e3d557))
45
- * **SDK:** upgrade to version 2.86.0-bo-mvp.9 ([daf4831](https://github.com/roomle-dev/roomle-ui/commit/daf4831d763794188548502e085a8abe848a906b))
46
- * **SDK:** upgrade to version 2.87.0-bo-mvp.2 ([7b13314](https://github.com/roomle-dev/roomle-ui/commit/7b13314265f271ff07b3af76f61c235ca303e454))
47
- * **SDK:** upgrade to version 2.87.0-bo-mvp.3 ([decd9af](https://github.com/roomle-dev/roomle-ui/commit/decd9aff516ce689e01b44a21ea3158585be1963))
48
- * **SDK:** upgrade to version 2.87.0-bo-mvp.5 ([525dd92](https://github.com/roomle-dev/roomle-ui/commit/525dd92daa30a73b53510e526368d5e80474cad5))
49
- * **SDK:** upgrade to version 2.87.0-bo-mvp.6 ([b9e4af0](https://github.com/roomle-dev/roomle-ui/commit/b9e4af0e3bfe2e8991a688ea651538afbda46a62))
50
- * **SDK:** upgrade to version 2.87.0-bo-mvp.7 ([038df72](https://github.com/roomle-dev/roomle-ui/commit/038df72f446ec97eec22c484f7c2a1a9f6d943d0))
51
- * **SDK:** upgrade to version 2.88.0-bo-mvp.1 ([20bbb5f](https://github.com/roomle-dev/roomle-ui/commit/20bbb5f2048c804f0c633b002ee53fb3e5e6dd00))
52
- * **SDK:** upgrade to version 2.88.0-bo-mvp.2 ([127c089](https://github.com/roomle-dev/roomle-ui/commit/127c089f93183363b517fcf9242ca4b8b7c8e4df))
53
- * **SDK:** upgrade to version 2.88.0-bo-mvp.3 ([5a87903](https://github.com/roomle-dev/roomle-ui/commit/5a8790300475ee472772dacb4547aec5793675a8))
54
- * **SDK:** upgrade to version 2.88.0-bo-mvp.4 ([bc3e0bb](https://github.com/roomle-dev/roomle-ui/commit/bc3e0bba1e78e23b2cf3851c155169a8e05d4154))
55
- * **SDK:** upgrade to version 2.88.0-bo-mvp.5 ([4348dd5](https://github.com/roomle-dev/roomle-ui/commit/4348dd5d9a017a708ebc932fe1460c91ab54991c))
56
- * **SDK:** upgrade to version 2.88.0-bo-mvp.6 ([7f05ab9](https://github.com/roomle-dev/roomle-ui/commit/7f05ab90e1ebe07aa89958cd1e2feced7ce5748f))
57
- * **SDK:** upgrade to version 2.88.0-bo-mvp.7 ([92c82c8](https://github.com/roomle-dev/roomle-ui/commit/92c82c8eadaaa3ad168fd84365d0193f21df97ba))
58
- * **SDK:** upgrade to version 2.89.0-bo-mvp.1 ([50530ee](https://github.com/roomle-dev/roomle-ui/commit/50530ee47c74cbc07066e4ac12407bbdb4a922af))
59
- * **SDK:** upgrade to version 2.89.0-bo-mvp.2 ([fa51364](https://github.com/roomle-dev/roomle-ui/commit/fa51364d8740ac14c8c859c2ef6e5e9ab7836751))
60
- * **SDK:** upgrade to version 2.89.0-bo-mvp.3 ([6a32c28](https://github.com/roomle-dev/roomle-ui/commit/6a32c28ff0c1c7d481a47f1fb596c13a711a2f13))
61
- * **SDK:** upgrade to version 2.89.0-bo-mvp.4 ([efacce6](https://github.com/roomle-dev/roomle-ui/commit/efacce6458ce7a312af0be42f51118d5b5706a0f))
62
- * **SDK:** upgrade to version 2.89.0-bo-mvp.5 ([627aa84](https://github.com/roomle-dev/roomle-ui/commit/627aa846a4fd241e6e1ddadf68ae67fddd5d34f1))
63
- * **SDK:** upgrade to version 2.89.0-bo-mvp.6 ([cb144a0](https://github.com/roomle-dev/roomle-ui/commit/cb144a075c32185e297a70fd481680b1222d8ff2))
64
- * **SDK:** upgrade to version 2.89.0-bo-mvp.7 ([7b72ead](https://github.com/roomle-dev/roomle-ui/commit/7b72ead3da70c4af06509bc86b16c2f87805bdf1))
65
- * **SDK:** upgrade to version 2.89.0-bo-mvp.8 ([76b9d8d](https://github.com/roomle-dev/roomle-ui/commit/76b9d8d77a8f945f36f66899a5778e45528cdbf4))
66
- * **SDK:** upgrade to version 2.89.0-bo-mvp.9 ([8114faf](https://github.com/roomle-dev/roomle-ui/commit/8114faf9ff5a64a213f27f687723b2282500ebad))
67
- * **SDK:** upgrade to version 2.90.0-bo-mvp.1 ([827cccb](https://github.com/roomle-dev/roomle-ui/commit/827cccbe86c264f2ec1f0472c7a0dc23e7ace438))
68
- * **SDK:** upgrade to version 2.90.0-bo-mvp.2 ([1cb3d28](https://github.com/roomle-dev/roomle-ui/commit/1cb3d2859a75c5b8e83ba1814e620cd8bf17da9f))
69
- * **SDK:** upgrade to version 2.90.0-bo-mvp.3 ([c56a919](https://github.com/roomle-dev/roomle-ui/commit/c56a9197f68bf5a2b066ae552cb1fb9e4c9924f6))
70
- * **SDK:** upgrade to version 2.90.0-bo-mvp.4 ([930b971](https://github.com/roomle-dev/roomle-ui/commit/930b9712d7a51963bab232a44706fd6e2329d7f2))
71
- * **SDK:** upgrade to version 2.90.0-bo-mvp.5 ([604f0f2](https://github.com/roomle-dev/roomle-ui/commit/604f0f2518de81a7ae1e7b6c22d0b0f59f187086))
72
- * **SDK:** upgrade to version 2.90.0-bo-mvp.6 ([1d551d5](https://github.com/roomle-dev/roomle-ui/commit/1d551d52bc302ae6e3ce12c44aeb5c06953d975a))
73
- * **SDK:** upgrade to version 2.91.0-bo-mvp.11 ([b2d6d15](https://github.com/roomle-dev/roomle-ui/commit/b2d6d15a18c004693c8f1a09889f5c6fb2a9418a))
74
- * **SDK:** upgrade to version 2.91.0-bo-mvp.12 ([89816b6](https://github.com/roomle-dev/roomle-ui/commit/89816b6cdddebce9366b6e792e6bd352086542d9))
75
- * **SDK:** upgrade to version 2.91.0-bo-mvp.13 ([3ae415c](https://github.com/roomle-dev/roomle-ui/commit/3ae415cc373b39295f01204d97560089ee906b48))
76
- * **SDK:** upgrade to version 2.91.0-bo-mvp.14 ([1b90685](https://github.com/roomle-dev/roomle-ui/commit/1b90685da907c99c247a7fca4b748904e5ea0105))
77
- * **SDK:** upgrade to version 2.91.0-bo-mvp.15 ([dea312a](https://github.com/roomle-dev/roomle-ui/commit/dea312aa822fb95f407b369dea27955041e1c68f))
78
- * **SDK:** upgrade to version 2.91.0-bo-mvp.16 ([385309a](https://github.com/roomle-dev/roomle-ui/commit/385309a365414a1f2cc44225b057dd397f28a8d5))
79
- * **SDK:** upgrade to version 2.91.0-bo-mvp.17 ([69c3dcc](https://github.com/roomle-dev/roomle-ui/commit/69c3dcc8a31251c824b0020e34c3f7dd3579a131))
80
- * **SDK:** upgrade to version 2.91.0-bo-mvp.19 ([01f5a98](https://github.com/roomle-dev/roomle-ui/commit/01f5a9896db99c60f6c016e8efc8050718ee26c5))
81
- * **SDK:** upgrade to version 2.91.0-bo-mvp.1 ([93a9fab](https://github.com/roomle-dev/roomle-ui/commit/93a9fab798b58c5ec3d4e992d433eba66c97a8a5))
82
- * **SDK:** upgrade to version 2.91.0-bo-mvp.20 ([44c0d72](https://github.com/roomle-dev/roomle-ui/commit/44c0d727d5cc8ea8ba32496d345b8be2c97d63a4))
83
- * **SDK:** upgrade to version 2.91.0-bo-mvp.2 ([57976a4](https://github.com/roomle-dev/roomle-ui/commit/57976a4834c78ec8db9b7b999ce6a104e4ffad7e))
84
- * **SDK:** upgrade to version 2.91.0-bo-mvp.3 ([0669d16](https://github.com/roomle-dev/roomle-ui/commit/0669d16d1107dc17d73861bb25ad2569a747f7fc))
85
- * **SDK:** upgrade to version 2.91.0-bo-mvp.4 ([8bf2d6d](https://github.com/roomle-dev/roomle-ui/commit/8bf2d6d00941e6f341c12ec4dfcf0c28087ccd84))
86
- * **SDK:** upgrade to version 2.91.0-bo-mvp.5 ([f703cfb](https://github.com/roomle-dev/roomle-ui/commit/f703cfb093bfda8366573fa6fd335ae1037791ec))
87
- * **SDK:** upgrade to version 2.91.0-bo-mvp.6 ([a89bda9](https://github.com/roomle-dev/roomle-ui/commit/a89bda970ac0fc42d6d1825eba696d083901aa00))
88
- * **SDK:** upgrade to version 2.91.0-bo-mvp.7 ([fad76b5](https://github.com/roomle-dev/roomle-ui/commit/fad76b5d850211e7825adbc437e7c160b3dec2f8))
89
- * **SDK:** upgrade to version 2.91.0-bo-mvp.8 ([98b5188](https://github.com/roomle-dev/roomle-ui/commit/98b5188f964a9f97cc5620666954adc18e6d9e00))
90
- * **SDK:** upgrade to version 2.91.0-bo-mvp.9 ([a634de2](https://github.com/roomle-dev/roomle-ui/commit/a634de25fe4d406866bff73549c81d3e65d85ba1))
91
- * **SDK:** upgrade to version 2.92.0-bo-mvp.1 ([b5da218](https://github.com/roomle-dev/roomle-ui/commit/b5da2189fa8a74622c4c6d12f0d2cd4a70d49c71))
92
- * **SDK:** upgrade to version 2.92.0-bo-mvp.2 ([e6e9bdf](https://github.com/roomle-dev/roomle-ui/commit/e6e9bdff55da55e35c28f38e6fff2383036e6a6c))
93
- * **SDK:** upgrade to version 2.92.0-bo-mvp.3 ([43a59ab](https://github.com/roomle-dev/roomle-ui/commit/43a59ab96c214007aafa47d20ef198738a533495))
94
- * **SDK:** upgrade to version 2.92.0-bo-mvp.4 ([e40d00a](https://github.com/roomle-dev/roomle-ui/commit/e40d00a051d6ea7ee013bbf83cd6a2e41880640d))
95
- * **SDK:** upgrade to version 2.92.0-bo-mvp.5 ([92892a7](https://github.com/roomle-dev/roomle-ui/commit/92892a75b7b22861faba2abee5e3f0d40ebffda2))
96
- * **SDK:** upgrade to version 2.92.0-bo-mvp.6 ([7994d9d](https://github.com/roomle-dev/roomle-ui/commit/7994d9d4b51ecb858fc63390e944430e2adced05))
97
- * **SDK:** upgrade to version 2.92.0-bo-mvp.7 ([837390b](https://github.com/roomle-dev/roomle-ui/commit/837390b679eb9546d0e772c6f10fffc51d684f70))
98
- * **SDK:** upgrade to version 2.93.0 ([#1472](https://github.com/roomle-dev/roomle-ui/issues/1472)) ([ad46ae5](https://github.com/roomle-dev/roomle-ui/commit/ad46ae52627ce259ff69b6787913eeccdcaac75e))
99
- * **SDK:** upgrade to version 2.93.0-bo-mvp.1 ([706e24a](https://github.com/roomle-dev/roomle-ui/commit/706e24ac4c5522993a79bdb9e531510e7dc11551))
100
- * **SDK:** upgrade to version 2.93.0-bo-mvp.2 ([2d7d0fe](https://github.com/roomle-dev/roomle-ui/commit/2d7d0fef2df9142a7fd2b0246a38479b9c10df14))
101
- * **SDK:** upgrade to version 2.93.0-bo-mvp.4 ([31a1f79](https://github.com/roomle-dev/roomle-ui/commit/31a1f79388c467be77229bbfed7cf90636833eb6))
102
- * **SDK:** upgrade to version 2.93.0-bo-mvp.5 ([5c610cf](https://github.com/roomle-dev/roomle-ui/commit/5c610cfc3a10689676ff75505ebb0a8287749a80))
103
- * **SDK:** upgrade to version 2.93.0-bo-mvp.6 ([3a8ebe2](https://github.com/roomle-dev/roomle-ui/commit/3a8ebe297d46f7f501256f02d2bfc3dca06538a3))
104
- * **SDK:** upgrade to version 2.93.0-bo-mvp.7 ([5582367](https://github.com/roomle-dev/roomle-ui/commit/55823672c00c4fdea4ab4769be1cd3dcfb860e8a))
105
- * **SDK:** upgrade to version 2.93.0-bo-mvp.8 ([a38d37e](https://github.com/roomle-dev/roomle-ui/commit/a38d37e2b72f45ac87c3b5e83a96d282518b089d))
106
- * **SDK:** upgrade to version 2.94.0-alpha.1 ([#1478](https://github.com/roomle-dev/roomle-ui/issues/1478)) ([589518e](https://github.com/roomle-dev/roomle-ui/commit/589518efb5197eb6f4b6dc033850b09368cb58db))
107
- * **SDK:** upgrade to version 2.94.0-alpha.10 ([#1496](https://github.com/roomle-dev/roomle-ui/issues/1496)) ([c55b4ac](https://github.com/roomle-dev/roomle-ui/commit/c55b4ac3ba001ae2ef64e7fe145a041b4b2aee1e))
108
- * **SDK:** upgrade to version 2.94.0-alpha.18 ([#1500](https://github.com/roomle-dev/roomle-ui/issues/1500)) ([bb5278a](https://github.com/roomle-dev/roomle-ui/commit/bb5278ac974d9506ef782a665e5dbce7b51ae40c))
109
- * **SDK:** upgrade to version 2.94.0-alpha.19 ([#1502](https://github.com/roomle-dev/roomle-ui/issues/1502)) ([ce201ce](https://github.com/roomle-dev/roomle-ui/commit/ce201cecba991364d140cae68df9150c0124a98c))
110
- * **SDK:** upgrade to version 2.94.0-alpha.2 ([#1481](https://github.com/roomle-dev/roomle-ui/issues/1481)) ([26e115a](https://github.com/roomle-dev/roomle-ui/commit/26e115a0f75015620df66664ad63a5f521486fe1))
111
- * **SDK:** upgrade to version 2.94.0-alpha.20 ([#1505](https://github.com/roomle-dev/roomle-ui/issues/1505)) ([4734384](https://github.com/roomle-dev/roomle-ui/commit/473438416f44cd1d273721f7c01cc77b4135ffdd))
112
- * **SDK:** upgrade to version 2.94.0-alpha.21 ([#1506](https://github.com/roomle-dev/roomle-ui/issues/1506)) ([b6945ad](https://github.com/roomle-dev/roomle-ui/commit/b6945ad5a4d8fe612d20fc8b2c3a767bdb4fa0ab))
113
- * **SDK:** upgrade to version 2.94.0-alpha.22 ([#1507](https://github.com/roomle-dev/roomle-ui/issues/1507)) ([23e6b19](https://github.com/roomle-dev/roomle-ui/commit/23e6b19f8712f4d81786ad91b6a55ddad7312a0a))
114
- * **SDK:** upgrade to version 2.94.0-alpha.23 ([#1510](https://github.com/roomle-dev/roomle-ui/issues/1510)) ([8193f7c](https://github.com/roomle-dev/roomle-ui/commit/8193f7ce11d522796cc10ac0fd07868db4df58a2))
115
- * **SDK:** upgrade to version 2.94.0-alpha.24 ([e0e027c](https://github.com/roomle-dev/roomle-ui/commit/e0e027c8b40ceffa5a80536b9872a05903c0e86e))
116
- * **SDK:** upgrade to version 2.94.0-alpha.25 ([#1512](https://github.com/roomle-dev/roomle-ui/issues/1512)) ([db16c8c](https://github.com/roomle-dev/roomle-ui/commit/db16c8c3f27670d368048fda02c54d025d1b62f3))
117
- * **SDK:** upgrade to version 2.94.0-alpha.26 ([da6691e](https://github.com/roomle-dev/roomle-ui/commit/da6691eda92b3e51ab99854b192298e4295339cf))
118
- * **SDK:** upgrade to version 2.94.0-alpha.3 ([#1485](https://github.com/roomle-dev/roomle-ui/issues/1485)) ([9f7d8d7](https://github.com/roomle-dev/roomle-ui/commit/9f7d8d7670daaa859527f4a5dfeaa88ffe1e53e8))
119
- * **SDK:** upgrade to version 2.94.0-alpha.4 ([#1487](https://github.com/roomle-dev/roomle-ui/issues/1487)) ([e81eaf4](https://github.com/roomle-dev/roomle-ui/commit/e81eaf47d64d75c532398636b3c3e5366721beb3))
120
- * **SDK:** upgrade to version 2.94.0-alpha.5 ([20d7650](https://github.com/roomle-dev/roomle-ui/commit/20d7650f51662d6738bb4e9ccf719b2437fb1e3f))
121
- * **SDK:** upgrade to version 2.94.0-alpha.8 ([#1491](https://github.com/roomle-dev/roomle-ui/issues/1491)) ([df786c7](https://github.com/roomle-dev/roomle-ui/commit/df786c74474422a79e888fc178bc69b95d1baf15))
122
- * **SDK:** upgrade to version 2.94.0-alpha.9 ([#1494](https://github.com/roomle-dev/roomle-ui/issues/1494)) ([d3546e3](https://github.com/roomle-dev/roomle-ui/commit/d3546e3f3bd681142140334e9c9757e0506ae6e7))
6
+ * add explainer icon to sloping roof section ([30a8670](https://github.com/roomle-dev/roomle-ui/commit/30a867078441bc8805735e86937e984e37981434))
7
+ * **SDK:** upgrade to version 2.95.1 ([#1527](https://github.com/roomle-dev/roomle-ui/issues/1527)) ([fc5e226](https://github.com/roomle-dev/roomle-ui/commit/fc5e22685061c6b07a630a368f7f7a51a7ac351e))
8
+ * **SDK:** upgrade to version 2.96.0-alpha.10 ([#1542](https://github.com/roomle-dev/roomle-ui/issues/1542)) ([41076e3](https://github.com/roomle-dev/roomle-ui/commit/41076e3d378d2ccd376422f012257448a0a51ba4))
9
+ * **SDK:** upgrade to version 2.96.0-alpha.2 ([#1526](https://github.com/roomle-dev/roomle-ui/issues/1526)) ([b8a5b26](https://github.com/roomle-dev/roomle-ui/commit/b8a5b26426deed868a8bc85d1dc04a861715387e))
10
+ * **SDK:** upgrade to version 2.96.0-alpha.3 ([#1529](https://github.com/roomle-dev/roomle-ui/issues/1529)) ([89bb09a](https://github.com/roomle-dev/roomle-ui/commit/89bb09a5c2f13e383d7f07ef12e60edc85c12fca))
11
+ * **SDK:** upgrade to version 2.96.0-alpha.4 ([#1531](https://github.com/roomle-dev/roomle-ui/issues/1531)) ([13ef8b3](https://github.com/roomle-dev/roomle-ui/commit/13ef8b3196755091d15c4debad03a95d950f49a4))
12
+ * **SDK:** upgrade to version 2.96.0-alpha.5 ([#1533](https://github.com/roomle-dev/roomle-ui/issues/1533)) ([c19e5d9](https://github.com/roomle-dev/roomle-ui/commit/c19e5d944e8fcb12a0c626752c38ec204487e9fb))
13
+ * **SDK:** upgrade to version 2.96.0-alpha.6 ([#1535](https://github.com/roomle-dev/roomle-ui/issues/1535)) ([eabf798](https://github.com/roomle-dev/roomle-ui/commit/eabf7981515fff4f6dad3709bc31cf435137d238))
14
+ * **SDK:** upgrade to version 2.96.0-alpha.7 ([#1536](https://github.com/roomle-dev/roomle-ui/issues/1536)) ([cf50e3a](https://github.com/roomle-dev/roomle-ui/commit/cf50e3abad14310547a674c579b6953697f7ca0a))
15
+ * **SDK:** upgrade to version 2.96.0-alpha.8 ([#1540](https://github.com/roomle-dev/roomle-ui/issues/1540)) ([98998b6](https://github.com/roomle-dev/roomle-ui/commit/98998b638400ab7af0acaf3faee4f51fbdf3b192))
16
+ * **SDK:** upgrade to version 2.96.0-alpha.9 ([#1541](https://github.com/roomle-dev/roomle-ui/issues/1541)) ([a03765b](https://github.com/roomle-dev/roomle-ui/commit/a03765b8760b507b20c350e0ccf4942b59b70d43))
17
+ * wall side icon and explainer ([9768983](https://github.com/roomle-dev/roomle-ui/commit/9768983a3d79e5d2e856b949f5743db9644f2247))
123
18
 
124
19
 
125
20
  ### Bug Fixes
126
21
 
127
- * add base url as well ([089f854](https://github.com/roomle-dev/roomle-ui/commit/089f85479b86bc300be88b31eebddcc9f57e031e))
128
- * add separate vite plugin to handle translations properly ([175abc6](https://github.com/roomle-dev/roomle-ui/commit/175abc61e86fc381d1884f33067bc5a8966222be))
129
- * Added else-if to not post to production manager export on IMOSiX ([7632fd1](https://github.com/roomle-dev/roomle-ui/commit/7632fd105502b8ef7e267f3b537846e18a1b5288))
130
- * Change to frontal view menu not visible on small mobile screens ([159b1ab](https://github.com/roomle-dev/roomle-ui/commit/159b1ab6cc5204a72d204761b787e1039768dba7))
131
- * copied indicator position ([745e61e](https://github.com/roomle-dev/roomle-ui/commit/745e61e0937d1984c07bdd0e658a358a39b69825))
132
- * failing test ([074e21b](https://github.com/roomle-dev/roomle-ui/commit/074e21bfbaf594b8486b701408b0e991194d1e63))
133
- * failing tests ([17b3d8f](https://github.com/roomle-dev/roomle-ui/commit/17b3d8f9c6a9f89fb29cb8a7442ee28f911ebfd5))
134
- * hack production manger request ([5a4b006](https://github.com/roomle-dev/roomle-ui/commit/5a4b006648a04e6521b0abc4727a14e846eaedf0))
135
- * hide merge product button for all elements but objects ([fb28873](https://github.com/roomle-dev/roomle-ui/commit/fb2887385bee8bf8c27b72261e9a52ceec9d55d4))
136
- * limit the left/right scroll amounts ([b22e679](https://github.com/roomle-dev/roomle-ui/commit/b22e67955356e00551932a250f41d0a4b2614a1c))
137
- * make tests pass ([7d51f5f](https://github.com/roomle-dev/roomle-ui/commit/7d51f5f9e9b349c4acbb99057d883b45698f7abb))
138
- * more CSS tweaks ([a87bcbf](https://github.com/roomle-dev/roomle-ui/commit/a87bcbfc75cd0f2d765f9f0b2b2ddd85aaa3e5f4))
139
- * package lock ([200df68](https://github.com/roomle-dev/roomle-ui/commit/200df68f866203c32a1cfedc439dfe0e709b6c09))
140
- * playwright failing test ([10d1381](https://github.com/roomle-dev/roomle-ui/commit/10d13814e652eea2fdc19ba64810914bc3e66606))
141
- * playwright tests on bo-mvp branch ([948e05a](https://github.com/roomle-dev/roomle-ui/commit/948e05a39081600215baf73d6cf0daeeee525b52))
142
- * property '_actualMeasurementString' is private and only accessible within class 'UnitFormatter'. (temp fix) ([9074d27](https://github.com/roomle-dev/roomle-ui/commit/9074d273be58b9980c9e11152f56384300c78ce4))
143
- * removed "debugger" ([ad1b1ac](https://github.com/roomle-dev/roomle-ui/commit/ad1b1ac53410024c2d5bbf0d1429e39def377488))
144
- * Reset scroll when selecting an item from product-list ([e2fcb5c](https://github.com/roomle-dev/roomle-ui/commit/e2fcb5c898fb1fc9acd6a123e82efee4c3647835))
145
- * rollback bo-mvp ([43cf32c](https://github.com/roomle-dev/roomle-ui/commit/43cf32c957ac20230ccdad3fa2508e01b2f28c49))
146
- * rollback bo-mvp ([a37ddf3](https://github.com/roomle-dev/roomle-ui/commit/a37ddf32f582a246d49b3d58165c67ad83a73235))
147
- * shared loadProduct CSS ([e59cbae](https://github.com/roomle-dev/roomle-ui/commit/e59cbae7a47f2b4eca4e51367a29b87a978893cd))
148
- * show preview image on mobile, rearrange link and qr order ([3fb56b0](https://github.com/roomle-dev/roomle-ui/commit/3fb56b0ad2fe6c94a9926342d3e6c1793dcaeda6))
149
- * Translations files (e.g. de.json) has no fingerprint ([6be02ca](https://github.com/roomle-dev/roomle-ui/commit/6be02caf8221154c4429a0ade4f681f60efefe1d))
150
- * Trash icon is misplaced ([99a171e](https://github.com/roomle-dev/roomle-ui/commit/99a171e15318c3bf436aa06697693dffa2e3f8ad))
151
- * ts errors ([dc02614](https://github.com/roomle-dev/roomle-ui/commit/dc02614088c448979361d5c30664dd637a425089))
152
- * ts errors ([d1434c1](https://github.com/roomle-dev/roomle-ui/commit/d1434c1698b4f4d090af02c353c01f8060dfd8dc))
153
- * use correct package.json ([b5bfc75](https://github.com/roomle-dev/roomle-ui/commit/b5bfc75e8de7627b8a43681ae03f4ca24ccdbf6a))
154
- * use correct path ([307c20d](https://github.com/roomle-dev/roomle-ui/commit/307c20d949adc507a6506c21c1aa73e34a42f80f))
155
- * use correct web-sdk ([1620beb](https://github.com/roomle-dev/roomle-ui/commit/1620bebd52562fa3b8ad24c20bf42a5496228603))
156
- * use sdk alpha version 2.94.0-alpha.13 ([7cb107d](https://github.com/roomle-dev/roomle-ui/commit/7cb107d927551f2cebb77706262ee8b7325d5858))
157
- * When hiding bottom bar there is no stop configuring bottom ([79ef136](https://github.com/roomle-dev/roomle-ui/commit/79ef13661b426e4c0eada48620e478ab69c229e5))
22
+ * **code-review:** apply suggestion from code review, see: ([026b7a1](https://github.com/roomle-dev/roomle-ui/commit/026b7a16f23534af7f0e49f31838cc5b937ef089)), closes [/github.com/roomle-dev/roomle-ui/pull/1518/files#r1984804936](https://github.com/roomle-dev//github.com/roomle-dev/roomle-ui/pull/1518/files/issues/r1984804936)
23
+ * **planner:** call startConfiguring only once ([92c6655](https://github.com/roomle-dev/roomle-ui/commit/92c6655ff4de901ddfd83bea23804034b07b071c))
24
+ * failing tests ([ed1649c](https://github.com/roomle-dev/roomle-ui/commit/ed1649cbb46bc1937caeb182cfd5f30b0feb4091))
25
+ * failing tests ([2e0ff31](https://github.com/roomle-dev/roomle-ui/commit/2e0ff31248f2a4ea32e6e62b232c00132be8acc4))
26
+ * positions tutorial correctly if custom view is active ([e0c249f](https://github.com/roomle-dev/roomle-ui/commit/e0c249fa5bfda6f05223c0baa056aa62bc6725d5))
27
+ * prevent default drag cursor (not-allowed) on windows ([3c33cef](https://github.com/roomle-dev/roomle-ui/commit/3c33cefc8e6c2c674be4e99dd7ab825e651d4992))
28
+ * reverse the order of collectionView icon and text ([deaec0d](https://github.com/roomle-dev/roomle-ui/commit/deaec0dbf3fd6003e0b6326719925a7f8d50db44))
29
+ * tests ([edd4cea](https://github.com/roomle-dev/roomle-ui/commit/edd4cea03e2cd9490223cdaed130f2e23cc66a6f))
30
+ * **code-review:** tried to fix the following problem that came up during code-review: ([79d0c5d](https://github.com/roomle-dev/roomle-ui/commit/79d0c5da9ad112b1894f5da8ccc3c5b0557fb994)), closes [/github.com/roomle-dev/roomle-ui/pull/1518/files#r1984799244](https://github.com/roomle-dev//github.com/roomle-dev/roomle-ui/pull/1518/files/issues/r1984799244)
@@ -45,7 +45,7 @@ class G extends I {
45
45
  async init() {
46
46
  if (await super.init(), this._mode === "website")
47
47
  try {
48
- const { DragInFromWebsiteStrategy: t } = await import("./from-website-DDMDPp-F.mjs");
48
+ const { DragInFromWebsiteStrategy: t } = await import("./from-website-VCMg3teu.mjs");
49
49
  this._strategy = new t(
50
50
  this._instance,
51
51
  this._mainDomElement,
@@ -56,7 +56,7 @@ class G extends I {
56
56
  }
57
57
  else if (this._mode === "custom-view")
58
58
  try {
59
- const { DragInFromCustomViewStrategy: t } = await import("./from-custom-view-DYkvyOw3.mjs");
59
+ const { DragInFromCustomViewStrategy: t } = await import("./from-custom-view-BEcgFlAL.mjs");
60
60
  this._strategy = new t(
61
61
  this._instance,
62
62
  this.options,
@@ -4,4 +4,4 @@ var w=Object.defineProperty,E=(r,t,e)=>t in r?w(r,t,{enumerable:!0,configurable:
4
4
  .${d}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
5
5
  ${D}
6
6
  ${f}
7
- `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+d);e||(e=document.createElement("div"),e.classList.add(d),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await import("./from-website-Dx2SUftr.mjs");this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw console.error('Could not load Dragin strategy "FromWebsite"'),t}else if(this._mode==="custom-view")try{const{DragInFromCustomViewStrategy:t}=await import("./from-custom-view-BVWf7SQ7.mjs");this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw console.error('Could not load Dragin strategy "FromCustomView"'),t}else throw new Error("Unsupported mode")}get isDragging(){return this._strategy.isDragging}dragStart(t,e,a="rml_id"){this._strategy.dragStart(t,e,a)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,a="rml_id"){this._strategy.touchStart(t,e,a)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:a,beforeUpdateGhost:o}){o&&this._strategy.beforeUpdateGhost(o);const i=this._customDragSignal.signal,m=s=>{s.target.getAttribute("data-rml-draggable")==="true"&&t(s)},g=s=>{this._strategy.releaseInput(s),this._strategy.isDragging&&e(s)},c=s=>{a(s)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(s=>{s.draggable=!1}),document.addEventListener("mousedown",m,{signal:i}),document.addEventListener("mouseup",g,{signal:i}),document.addEventListener("mousemove",c,{signal:i}),document.addEventListener("mouseleave",g,{signal:i}),document.addEventListener("touchstart",m,{signal:i}),document.addEventListener("touchend",g,{signal:i}),document.addEventListener("touchmove",c,{signal:i})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const j=Object.freeze(Object.defineProperty({__proto__:null,DragIn:U},Symbol.toStringTag,{value:"Module"}));export{$ as R,l as a,D as b,f as c,I as d,N as e,x as f,L as g,C as h,h as i,y as j,d as k,j as l};
7
+ `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+d);e||(e=document.createElement("div"),e.classList.add(d),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await import("./from-website-Ckh5GB2h.mjs");this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw console.error('Could not load Dragin strategy "FromWebsite"'),t}else if(this._mode==="custom-view")try{const{DragInFromCustomViewStrategy:t}=await import("./from-custom-view-jmf3K6AT.mjs");this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw console.error('Could not load Dragin strategy "FromCustomView"'),t}else throw new Error("Unsupported mode")}get isDragging(){return this._strategy.isDragging}dragStart(t,e,a="rml_id"){this._strategy.dragStart(t,e,a)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,a="rml_id"){this._strategy.touchStart(t,e,a)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:a,beforeUpdateGhost:o}){o&&this._strategy.beforeUpdateGhost(o);const i=this._customDragSignal.signal,m=s=>{s.target.getAttribute("data-rml-draggable")==="true"&&t(s)},g=s=>{this._strategy.releaseInput(s),this._strategy.isDragging&&e(s)},c=s=>{a(s)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(s=>{s.draggable=!1}),document.addEventListener("mousedown",m,{signal:i}),document.addEventListener("mouseup",g,{signal:i}),document.addEventListener("mousemove",c,{signal:i}),document.addEventListener("mouseleave",g,{signal:i}),document.addEventListener("touchstart",m,{signal:i}),document.addEventListener("touchend",g,{signal:i}),document.addEventListener("touchmove",c,{signal:i})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const j=Object.freeze(Object.defineProperty({__proto__:null,DragIn:U},Symbol.toStringTag,{value:"Module"}));export{$ as R,l as a,D as b,f as c,I as d,N as e,x as f,L as g,C as h,h as i,y as j,d as k,j as l};
@@ -2,7 +2,7 @@ var A = Object.defineProperty;
2
2
  var O = (e, t, s) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
3
  var i = (e, t, s) => O(e, typeof t != "symbol" ? t + "" : t, s);
4
4
  import { C as T, e as m, i as b, T as v, b as B, c as I, d as L } from "./touch-drag-DNDPwZ-_.mjs";
5
- import { d as c, e as Y, f as X } from "./drag-in-Do47zdKL.mjs";
5
+ import { d as c, e as Y, f as X } from "./drag-in-C6gLvrDx.mjs";
6
6
  const G = (e) => `[data-rml-custom-view="${e}"]`, l = (e) => {
7
7
  e.preventDefault(), e.stopPropagation();
8
8
  }, w = (e, t, s, r) => {
@@ -1 +1 @@
1
- var w=Object.defineProperty,C=(e,t,s)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,i=(e,t,s)=>C(e,typeof t!="symbol"?t+"":t,s);import{C as b,e as D,i as v,T as B,b as X,c as Y,d as I}from"./touch-drag-C1SsZtt4.mjs";import{d as u,e as M,f as U}from"./drag-in-CYmR1HFI.mjs";const O=e=>`[data-rml-custom-view="${e}"]`,l=e=>{e.preventDefault(),e.stopPropagation()},A=(e,t,s,r)=>{const a=s-e,n=r-t;return Math.sqrt(a*a+n*n)};class x{constructor({onCustomDragStart:t},s={}){i(this,"_startX",0),i(this,"_startY",0),i(this,"_lastX",0),i(this,"_lastY",0),i(this,"_epsilon"),i(this,"_isWaiting",!1),i(this,"_onCustomDragStart"),this._epsilon=typeof s.epsilon=="number"?s.epsilon:b,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&A(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const c="data-rml-old-draggable",K=void 0,y=(e,t)=>{const s=v(e),r={delay:s?X:Y,epsilon:s?I:b};if(!t)return r;if(!s&&!(e instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),r;const{delayKey:a,epsilonKey:n}=s?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof t[a]=="number"&&(r.delay=t.touchDragDelay),typeof t[n]=="number"&&(r.epsilon=t.touchDragEpsilon),r},L=e=>{let t="",s=M,r=U;if(!e)return{url:u,width:s,height:r};const a=e;if(a instanceof HTMLElement){const n=a.getBoundingClientRect(),o=a.getAttribute("data-rml-ghost-url"),h=a.getAttribute("data-rml-ghost-width"),g=a.getAttribute("data-rml-ghost-height");o?t=o:!o&&a instanceof HTMLImageElement&&a.src&&(t=a.src),t?(s=n.width,r=n.height):t=u,s=h?parseInt(h,10):s,r=g?parseInt(g,10):r}return{url:t||u,width:s,height:r}};class W{constructor(t,s,r){i(this,"_options",{}),i(this,"_instance"),i(this,"_viewName"),i(this,"_currentCustomDrag",null),i(this,"_currentBb",null),i(this,"_startTarget",null),i(this,"_onBeforeUpdateDrag",()=>({})),i(this,"isDragging",!1),this._instance=t,this._options=s||{},this._viewName=r}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,s,r="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(c,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",l),this._startTarget.addEventListener("dragstart",l)),this._currentBb=await this._instance.getBoundingClientRect(O(this._viewName));const{clientX:a,clientY:n}=D(s),o=this._currentBb.x+a,h=this._currentBb.y+n;this.isDragging=!0,this._instance.dragInObject(t,o,h,r)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:s,clientY:r}=D(t),{url:a,width:n,height:o}=L(this._startTarget),h=this._currentBb.x+s,g=this._currentBb.y+r,_=this._options||{},d={ghost:{visibleIn:{x:this._currentBb.x-(_.dragInOverlapX||0),y:this._currentBb.y+(_.dragInOverlapY||0),width:this._currentBb.width+(_.dragInOverlapX||0),height:this._currentBb.height+(_.dragInOverlapY||0)},url:a,width:n,height:o},mode:"custom-view"},{x:p,y:m,options:T}=this._onBeforeUpdateDrag(h,g,d),f=typeof p=="number"?p:h,E=typeof m=="number"?m:g,S=T||d;this._instance.updateDrag(f,E,S)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,s,r){this._instance.disableEvents(),this._startTarget=s.target;const a=(n,o)=>{this._dragStart(t,o,r)};this._currentCustomDrag=v(s)?new B(K,{onTouchDragStart:a},y(s,this._options)):new x({onCustomDragStart:n=>this._dragStart(t,n,r)},y(s,this._options)),this._currentCustomDrag.onStart(s)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,s,r="rml_id"){this.dragStart(t,s,r)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(c)==="true",this._startTarget.removeAttribute(c),this._startTarget.removeEventListener("dragstart",l))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}export{W as DragInFromCustomViewStrategy};
1
+ var w=Object.defineProperty,C=(e,t,s)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,i=(e,t,s)=>C(e,typeof t!="symbol"?t+"":t,s);import{C as b,e as D,i as v,T as B,b as X,c as Y,d as I}from"./touch-drag-C1SsZtt4.mjs";import{d as u,e as M,f as U}from"./drag-in-w_TrusdP.mjs";const O=e=>`[data-rml-custom-view="${e}"]`,l=e=>{e.preventDefault(),e.stopPropagation()},A=(e,t,s,r)=>{const a=s-e,n=r-t;return Math.sqrt(a*a+n*n)};class x{constructor({onCustomDragStart:t},s={}){i(this,"_startX",0),i(this,"_startY",0),i(this,"_lastX",0),i(this,"_lastY",0),i(this,"_epsilon"),i(this,"_isWaiting",!1),i(this,"_onCustomDragStart"),this._epsilon=typeof s.epsilon=="number"?s.epsilon:b,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&A(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const c="data-rml-old-draggable",K=void 0,y=(e,t)=>{const s=v(e),r={delay:s?X:Y,epsilon:s?I:b};if(!t)return r;if(!s&&!(e instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),r;const{delayKey:a,epsilonKey:n}=s?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof t[a]=="number"&&(r.delay=t.touchDragDelay),typeof t[n]=="number"&&(r.epsilon=t.touchDragEpsilon),r},L=e=>{let t="",s=M,r=U;if(!e)return{url:u,width:s,height:r};const a=e;if(a instanceof HTMLElement){const n=a.getBoundingClientRect(),o=a.getAttribute("data-rml-ghost-url"),h=a.getAttribute("data-rml-ghost-width"),g=a.getAttribute("data-rml-ghost-height");o?t=o:!o&&a instanceof HTMLImageElement&&a.src&&(t=a.src),t?(s=n.width,r=n.height):t=u,s=h?parseInt(h,10):s,r=g?parseInt(g,10):r}return{url:t||u,width:s,height:r}};class W{constructor(t,s,r){i(this,"_options",{}),i(this,"_instance"),i(this,"_viewName"),i(this,"_currentCustomDrag",null),i(this,"_currentBb",null),i(this,"_startTarget",null),i(this,"_onBeforeUpdateDrag",()=>({})),i(this,"isDragging",!1),this._instance=t,this._options=s||{},this._viewName=r}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,s,r="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(c,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",l),this._startTarget.addEventListener("dragstart",l)),this._currentBb=await this._instance.getBoundingClientRect(O(this._viewName));const{clientX:a,clientY:n}=D(s),o=this._currentBb.x+a,h=this._currentBb.y+n;this.isDragging=!0,this._instance.dragInObject(t,o,h,r)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:s,clientY:r}=D(t),{url:a,width:n,height:o}=L(this._startTarget),h=this._currentBb.x+s,g=this._currentBb.y+r,_=this._options||{},d={ghost:{visibleIn:{x:this._currentBb.x-(_.dragInOverlapX||0),y:this._currentBb.y+(_.dragInOverlapY||0),width:this._currentBb.width+(_.dragInOverlapX||0),height:this._currentBb.height+(_.dragInOverlapY||0)},url:a,width:n,height:o},mode:"custom-view"},{x:p,y:m,options:T}=this._onBeforeUpdateDrag(h,g,d),f=typeof p=="number"?p:h,E=typeof m=="number"?m:g,S=T||d;this._instance.updateDrag(f,E,S)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,s,r){this._instance.disableEvents(),this._startTarget=s.target;const a=(n,o)=>{this._dragStart(t,o,r)};this._currentCustomDrag=v(s)?new B(K,{onTouchDragStart:a},y(s,this._options)):new x({onCustomDragStart:n=>this._dragStart(t,n,r)},y(s,this._options)),this._currentCustomDrag.onStart(s)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,s,r="rml_id"){this.dragStart(t,s,r)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(c)==="true",this._startTarget.removeAttribute(c),this._startTarget.removeEventListener("dragstart",l))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}export{W as DragInFromCustomViewStrategy};
@@ -0,0 +1,4 @@
1
+ var P=Object.defineProperty,R=(r,e,t)=>e in r?P(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,g=(r,e,t)=>R(r,typeof e!="symbol"?e+"":e,t);import{g as B,e as D,a as x,i as C,T as M}from"./touch-drag-C1SsZtt4.mjs";import{R as _,a as I,b as O,c as L,d as N,e as E,f as b,g as F,h as G,i as y,j as A,k as Y}from"./drag-in-w_TrusdP.mjs";const w=(r,e,t=0,i=0)=>{const s=e.x+e.width+t,o=e.x-t,l=e.y+e.height+i,a=e.y-i,{x:h,y:n}=r;return h>=o&&h<=s&&n>=a&&n<=l},T=(r,e,t,i=0,s=0)=>{if(!(!t||!t.hiddenIn&&!t.visibleIn))return t.visibleIn?w({x:r,y:e},t.visibleIn,i,s):t.hiddenIn?!w({x:r,y:e},t.hiddenIn,-i,-s):!1},k=()=>{if(!document.getElementById(I)){const r=document.createElement("style");r.type="text/css",r.id=I,r.innerHTML=`
2
+ ${O}
3
+ ${L}
4
+ `,document.head.appendChild(r)}},U=({x:r,y:e},t)=>{var i,s,o,l,a,h;let n=document.getElementById(_);if(!n){if(n=document.createElement("div"),(i=t.ghost)!=null&&i.element)n.appendChild(t.ghost.element);else{const d=document.createElement("img");d.src=((s=t.ghost)==null?void 0:s.url)||N,d.width=((o=t.ghost)==null?void 0:o.width)||E,d.height=((l=t.ghost)==null?void 0:l.height)||b,n.appendChild(d)}n.id=_,n.style.position="fixed",n.style.top="0",n.style.left="0",n.style.willChange="transform",n.style.transform="translate3d(0, 0, 0)",n.style.zIndex="9999",n.style.opacity="0.5",T(r,e,t.ghost||{},(a=t.settings)==null?void 0:a.dragInOverlapX,(h=t.settings)==null?void 0:h.dragInOverlapY)||(n.style.display="none"),n.style.pointerEvents="none",document.body.appendChild(n)}},X=({x:r,y:e},t)=>{var i,s,o,l;const a=document.getElementById(_);if(!a)return;let h=(i=t.ghost)==null?void 0:i.width,n=(s=t.ghost)==null?void 0:s.height;typeof h>"u"&&(h=a.getBoundingClientRect().width||E),typeof n>"u"&&(n=a.getBoundingClientRect().height||b);const d=r-h/2,c=e-n/2;a.style.transform=`translate3d(${d}px, ${c}px, 0)`,t.ghost&&(T(r,e,t.ghost,(o=t.settings)==null?void 0:o.dragInOverlapX,(l=t.settings)==null?void 0:l.dragInOverlapY)?a.style.animation!=F&&(a.style.animation=F):a.style.animation!=G&&(a.style.animation=G))};class ${constructor(e=null){g(this,"_dragGhostAnimationFrameId",null),g(this,"_dragGhostRemoveAnimationFrameId",null),g(this,"_dragGhostElement",null),this._dragGhostElement=e}updateDragGhost(e,t,i){var s;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((s=i.ghost)!=null&&s.external)&&i.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{k();const o={x:e,y:t};!i.ghost&&this._dragGhostElement&&(i.ghost={}),i.ghost&&!i.ghost.element&&this._dragGhostElement&&(i.ghost.element=this._dragGhostElement),U(o,i),X(o,i),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const e=document.getElementById(_);e&&document.body.removeChild(e),this._dragGhostRemoveAnimationFrameId=null}))}}class q{constructor(e,t,i){g(this,"_options",{}),g(this,"_instance"),g(this,"_mainDomElement"),g(this,"_currentDrag",{}),g(this,"_currentTouch",null),g(this,"_firefoxDragPosition",{x:0,y:0}),g(this,"_onBeforeUpdateDrag",()=>({})),g(this,"isDragging",!1),g(this,"_firefoxFallback",s=>{if(!this._currentDrag.event)return;s.preventDefault();const o=s||window.event;this._firefoxDragPosition.x=o.pageX||0,this._firefoxDragPosition.y=o.pageY||0}),this._instance=e,this._mainDomElement=t,this._options=i||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}dragStart(e,t,i="rml_id"){const s=this._mainDomElement.parentNode;if(B(s).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=s.querySelector("."+y);o||(o=document.createElement("div"),o.classList.add(y),s.appendChild(o)),o.classList.remove(A.DISPLAY_NONE),t.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const l=s.querySelector("."+Y);this._currentDrag.event=t;const a=t.target,h=a.cloneNode(),n=a.getBoundingClientRect();h.style.width=`${n.width}px`,h.style.height=`${n.height}px`,this._currentDrag.ghost=new $(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:d,clientY:c}=D(t,this._firefoxDragPosition);this._currentDrag.offset.x=d-n.left,this._currentDrag.offset.y=c-n.top,t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(l,0,0);const{x:f,y:m}=x(s,this._currentDrag.event||t,this._firefoxDragPosition),p=Math.max(1,f),v=Math.max(1,m);this.isDragging=!0,this._instance.dragInObject(e,p,v,i)}dragUpdate(e){var t;const i=this._mainDomElement.parentNode,{x:s,y:o}=x(i,e,this._firefoxDragPosition);if(s===0&&o===0)return;const l=Math.max(1,s),a=Math.max(1,o);if(l===1&&a===1)return;let h=l,n=a;if(C(e)){const u=((t=this._options.settings)==null?void 0:t.fingerSize)||0;h=Math.max(2,l+u),n=Math.max(2,a-u)}const{x:d,y:c,options:f}=this._onBeforeUpdateDrag(h,n,{}),m=f||{settings:{},ghost:{}};m.ghost||(m.ghost={}),m.ghost.visibleIn&&m.ghost.hiddenIn||(m.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const p=typeof d=="number"?d:h,v=typeof c=="number"?c:n;if(this._currentDrag.ghost){const{clientX:u,clientY:S}=D(e,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(u,S,m)}this._instance.updateDrag(p,v,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const e=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const t=e.querySelector("."+y);t&&t.classList.add(A.DISPLAY_NONE)}touchStart(e,t,i="rml_id"){var s,o,l,a;t.preventDefault();const h=(d,c)=>{this.dragStart(e,c,i)},n={};typeof((o=(s=this._options)==null?void 0:s.settings)==null?void 0:o.touchDragDelay)=="number"&&(n.delay=this._options.settings.touchDragDelay),(a=(l=this._options)==null?void 0:l.settings)!=null&&a.touchDragEpsilon&&(n.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new M(void 0,{onTouchDragStart:h},n),this._currentTouch.onStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(e){}}export{q as DragInFromWebsiteStrategy};
@@ -2,7 +2,7 @@ var F = Object.defineProperty;
2
2
  var M = (r, e, t) => e in r ? F(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var l = (r, e, t) => M(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { g as C, e as G, a as E, i as N, T as O } from "./touch-drag-DNDPwZ-_.mjs";
5
- import { R as u, a as p, b as w, c as B, d as Y, e as L, f as b, g as x, h as S, i as A, j as R, k as H } from "./drag-in-Do47zdKL.mjs";
5
+ import { R as u, a as p, b as w, c as B, d as Y, e as L, f as b, g as x, h as S, i as A, j as R, k as H } from "./drag-in-C6gLvrDx.mjs";
6
6
  const T = (r, e, t = 0, n = 0) => {
7
7
  const s = e.x + e.width + t, i = e.x - t, a = e.y + e.height + n, d = e.y - n, { x: o, y: h } = r;
8
8
  return o >= i && o <= s && h >= d && h <= a;
@@ -96,6 +96,7 @@ class z {
96
96
  l(this, "_firefoxFallback", (e) => {
97
97
  if (!this._currentDrag.event)
98
98
  return;
99
+ e.preventDefault();
99
100
  const t = e || window.event;
100
101
  this._firefoxDragPosition.x = t.pageX || 0, this._firefoxDragPosition.y = t.pageY || 0;
101
102
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "5.12.0",
3
+ "version": "5.13.0-alpha.1",
4
4
  "description": "This is a small library which can be used to communicate with the Roomle Configurator",
5
5
  "type": "module",
6
6
  "main": "./roomle-embedding-lib.umd.js",
@@ -29,7 +29,7 @@
29
29
  "npm": "8.3.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@roomle/web-sdk": "2.94.0-alpha.26"
32
+ "@roomle/web-sdk": "2.96.0-alpha.10"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",
@@ -296,7 +296,7 @@ class y {
296
296
  typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(
297
297
  new Promise((n, a) => {
298
298
  try {
299
- import("./drag-in-Do47zdKL.mjs").then((i) => i.l).then(
299
+ import("./drag-in-C6gLvrDx.mjs").then((i) => i.l).then(
300
300
  ({ DragIn: i }) => {
301
301
  const l = new i(
302
302
  this.ui,
@@ -1,4 +1,4 @@
1
- var H=Object.defineProperty,U=(s,e,t)=>e in s?H(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,c=(s,e,t)=>U(s,typeof e!="symbol"?e+"":e,t);class I{constructor(e,t,r,i){c(this,"_side"),c(this,"_incomingMessageBus",null),c(this,"_outgoingMessageBus",null),c(this,"_execMessage",null),this._side=e,this._incomingMessageBus=t,this._outgoingMessageBus=r,this._execMessage=i,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(e){this._outgoingMessageBus=e}setMessageExecution(e){this._execMessage=e}sendMessage(e,t=[]){return new Promise((r,i)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return r(void 0);const o=new MessageChannel;o.port1.onmessage=n=>{if(!n||!n.data)return o.port1.close(),o.port2.close(),i(new Error(this._side+" received message but response can not be interpreted"));let l;try{l=JSON.parse(n.data)}catch(u){return o.port1.close(),o.port2.close(),this._prepareError(u),i(u)}l.error?i(l.error):l.result!==void 0?r(l.result):r(void 0),o.port1.close(),o.port2.close()};let a="";try{a=JSON.stringify({message:e,args:t})}catch{return i(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return i(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(a,"*",[o.port2])})}_handleMessage(e){const t=e.ports&&Array.isArray(e.ports)&&e.ports.length>0?e.ports[0]:null;if(e.data&&t)try{const r=JSON.parse(e.data);if(!this._execMessage)return t.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const i=this._execMessage(r,e);if(i===void 0)return;i.then((o={})=>{let a,n;typeof o=="object"&&o!==null&&(a=o.error,n=o.result),a?t.postMessage(JSON.stringify({error:a})):n!==void 0?t.postMessage(JSON.stringify({result:n})):t.postMessage(JSON.stringify({result:o}))},o=>{t.postMessage(JSON.stringify({error:this._prepareError(o)}))})}catch(r){t.postMessage(JSON.stringify({error:this._prepareError(r)}))}}_prepareError(e){if(typeof e=="string"){const t=this._side+": "+e;return console.error(t),t}return e.message=this._side+": "+e.message,console.error(e),e.message}}const p=".",f={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},_={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},B=async(s,e)=>{if(typeof s!="string")throw new Error('Configurator ID is not a string type: "'+typeof s+'"');const t=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",r=e.overrideTenant||9,i=t+"/configurators/"+s,o="roomle_portal_v2",a="03-"+window.btoa(new Date().toISOString()+";anonymous;"+o),n=()=>{const d={apiKey:o,currentTenant:r,locale:"en",language:"en",device:1,token:a,platform:"web"};return new Headers(d)},l=new Request(i,{method:"GET",headers:n(),mode:"cors",cache:"default"}),u=await fetch(l),{configurator:h}=await u.json();return h},F=()=>{try{return window.self!==window.top}catch{return!0}},C=["127.0.0.1","localhost","0.0.0.0"],k=()=>{const s=F();let e=window.location.href;if(s){if(!document.referrer)return null;e=document.referrer}const{hostname:t}=new URL(e);return t},x=s=>!!(C.includes(s)||s.endsWith("roomle.com")||s.endsWith("gitlab.io")||s.endsWith("gitlab.com")),y=["language","browserLanguage","userLanguage","systemLanguage"],W=(s=null)=>{const e=window.navigator;if(s)return s.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,r=y.length;t<r;t++){const i=e[y[t]];if(i)return i.substr(0,2)}return"en"},V=(s,e)=>{const t=JSON.parse(JSON.stringify(s));return w(t,e)},w=(s,e)=>{for(const t in e)try{e[t].constructor===Object?s[t]=w(s[t],e[t]):s[t]=e[t]}catch{s[t]=e[t]}return s};var T=(s=>(s.BOTTOM_BAR="bottom_bar",s.PARTLIST_BOUNDS="partlist_bounds",s.INTERACTION_NOTES="interaction_notes",s))(T||{}),G={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const J={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[T.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},$="(idle)",j=s=>(E(s),s!=null&&s.customApiUrl&&(s.customApiUrl=decodeURIComponent(s.customApiUrl)),s.shareUrl&&(s.deeplink=s.shareUrl.replace(Y,Q)),s),E=s=>{if(!s)return;const e=Object.keys(s);for(const t of e){const r=s[t];if(!Array.isArray(r)&&typeof r=="object"&&r!==null&&E(r),Array.isArray(r))for(const i of r)E(i);(r==="true"||r==="false")&&(s[t]=r==="true")}},z=(s,e)=>{e.configuratorId=s.id;const t=s.settings||{};return!e.overrideTenant&&s.tenant&&(e.overrideTenant=s.tenant),V(t,e)},q=()=>{const s={...J};s.locale||(s.locale=W()),s.id===$&&delete s.id;const e=k();return e&&x(e)&&(s.configuratorId="demoConfigurator"),s.customApiUrl=G.VITE_RAPI_URL,s.emails=!1,s},Y="<CONF_ID>",Q="#CONFIGURATIONID#",K=s=>{s.featureFlags||(s.featureFlags={}),typeof s.featureFlags.realPartList!="boolean"&&(s.featureFlags.realPartList=!0),typeof s.featureFlags.globalCallbacks!="boolean"&&(s.featureFlags.globalCallbacks=!0),typeof s.featureFlags.mocAr!="boolean"&&(s.featureFlags.mocAr=!1)},M=()=>/(android)/i.test(navigator.userAgent);class v{constructor(){c(this,"_messageHandler",null),c(this,"isSetupDone",!1),c(this,"viewName","main"),c(this,"plugins",{}),c(this,"pluginsLoaded",[]),c(this,"ui",{callbacks:null}),c(this,"extended",{callbacks:null}),c(this,"configurator",{callbacks:null}),c(this,"analytics",{callbacks:{}}),c(this,"global",{callbacks:{}})}setMessageHandler(e){this._messageHandler=e}handleSetup(e){const{methods:t,callbacks:r}=e;t.forEach(i=>{const o=i.split(p),a=o[0],n=o[1];this[a]||(this[a]={}),this[a][n]=function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(i,[...arguments])}.bind(this)}),r.forEach(i=>{const o=i.split(p),a=o[0],n=o[1],l=o[2];this[a]||(this[a]={}),this[a][n]||(this[a][n]={}),this[a][n][l]=()=>{}}),this.isSetupDone=!0}executeMessage({message:e,args:t}){const r=e.split(p),i=r[0],o=r[1],a=r.length===3?r[2]:null;if(a&&this[i][o][a]){const n=this[i][o][a](...t);return n instanceof Promise?n.then(l=>({result:l})):n!==void 0?Promise.resolve({result:n}):Promise.resolve({result:null})}return Promise.reject('Message "'+e+'" is unkown')}setupPlugins(e,t,r="website"){for(const i of e)typeof i=="string"&&i==="dragIn"?this.pluginsLoaded.push(new Promise((o,a)=>{try{import("./drag-in-CYmR1HFI.mjs").then(n=>n.l).then(({DragIn:n})=>{const l=new n(this.ui,t,r,this.viewName);l.init().then(()=>{this.plugins.dragIn=l,o()},a)})}catch(n){a(n)}})):i.name&&i.loader&&this.pluginsLoaded.push(new Promise((o,a)=>{try{i.loader().then(n=>{const l=new n(this.ui,t,r,this.viewName);l.init().then(()=>{this.plugins[i.name]=l,o()},a)})}catch(n){a(n)}}))}}const S=()=>{let s,e;return{promise:new Promise((t,r)=>{s=t,e=r}),resolve:s,reject:e}},N=(s,e,t)=>{let r=null;Object.defineProperty(s,e,{get(){return r||t},set(i){i!=null&&i.mute?r=i.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),r=i)}})},R=()=>window.innerHeight*.01+"px",D=s=>{s&&setTimeout(()=>s.style.setProperty(O,R()),0)},L="rml-styles",X=450,O="--rml-full-height",g={CONTAINER:"rml-container",FILL:"rml-fill",POSITION:"rml-pos",TRANSITION:"rml-transition",ANDROID_HEIGHT:"rml-android-height",OVERFLOW_HIDDEN:"rml-overflow-hidden"},b=new Map;class Z extends v{constructor(e,t,r,i,o){if(super(),c(this,"_waitForIframe"),c(this,"_container"),c(this,"_configuratorSettings"),c(this,"_initData",{}),c(this,"_iframe"),!e||typeof e.id!="string")throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(b.has(t))throw new Error("There is already an instance on this DOM element");if(!document.getElementById(L)){const l=r.zIndex||9999999,u=document.createElement("style");u.type="text/css",u.id=L;const h="transition:all ease-in-out "+X+"ms;",d=["-webkit-","-o-"].reduce((P,A)=>P+=A+h,"")+h,m=R();u.innerHTML=`
1
+ var H=Object.defineProperty,U=(s,e,t)=>e in s?H(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,c=(s,e,t)=>U(s,typeof e!="symbol"?e+"":e,t);class I{constructor(e,t,r,i){c(this,"_side"),c(this,"_incomingMessageBus",null),c(this,"_outgoingMessageBus",null),c(this,"_execMessage",null),this._side=e,this._incomingMessageBus=t,this._outgoingMessageBus=r,this._execMessage=i,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(e){this._outgoingMessageBus=e}setMessageExecution(e){this._execMessage=e}sendMessage(e,t=[]){return new Promise((r,i)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return r(void 0);const o=new MessageChannel;o.port1.onmessage=n=>{if(!n||!n.data)return o.port1.close(),o.port2.close(),i(new Error(this._side+" received message but response can not be interpreted"));let l;try{l=JSON.parse(n.data)}catch(u){return o.port1.close(),o.port2.close(),this._prepareError(u),i(u)}l.error?i(l.error):l.result!==void 0?r(l.result):r(void 0),o.port1.close(),o.port2.close()};let a="";try{a=JSON.stringify({message:e,args:t})}catch{return i(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return i(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(a,"*",[o.port2])})}_handleMessage(e){const t=e.ports&&Array.isArray(e.ports)&&e.ports.length>0?e.ports[0]:null;if(e.data&&t)try{const r=JSON.parse(e.data);if(!this._execMessage)return t.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const i=this._execMessage(r,e);if(i===void 0)return;i.then((o={})=>{let a,n;typeof o=="object"&&o!==null&&(a=o.error,n=o.result),a?t.postMessage(JSON.stringify({error:a})):n!==void 0?t.postMessage(JSON.stringify({result:n})):t.postMessage(JSON.stringify({result:o}))},o=>{t.postMessage(JSON.stringify({error:this._prepareError(o)}))})}catch(r){t.postMessage(JSON.stringify({error:this._prepareError(r)}))}}_prepareError(e){if(typeof e=="string"){const t=this._side+": "+e;return console.error(t),t}return e.message=this._side+": "+e.message,console.error(e),e.message}}const p=".",f={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},_={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},B=async(s,e)=>{if(typeof s!="string")throw new Error('Configurator ID is not a string type: "'+typeof s+'"');const t=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",r=e.overrideTenant||9,i=t+"/configurators/"+s,o="roomle_portal_v2",a="03-"+window.btoa(new Date().toISOString()+";anonymous;"+o),n=()=>{const d={apiKey:o,currentTenant:r,locale:"en",language:"en",device:1,token:a,platform:"web"};return new Headers(d)},l=new Request(i,{method:"GET",headers:n(),mode:"cors",cache:"default"}),u=await fetch(l),{configurator:h}=await u.json();return h},F=()=>{try{return window.self!==window.top}catch{return!0}},C=["127.0.0.1","localhost","0.0.0.0"],k=()=>{const s=F();let e=window.location.href;if(s){if(!document.referrer)return null;e=document.referrer}const{hostname:t}=new URL(e);return t},x=s=>!!(C.includes(s)||s.endsWith("roomle.com")||s.endsWith("gitlab.io")||s.endsWith("gitlab.com")),y=["language","browserLanguage","userLanguage","systemLanguage"],W=(s=null)=>{const e=window.navigator;if(s)return s.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,r=y.length;t<r;t++){const i=e[y[t]];if(i)return i.substr(0,2)}return"en"},V=(s,e)=>{const t=JSON.parse(JSON.stringify(s));return w(t,e)},w=(s,e)=>{for(const t in e)try{e[t].constructor===Object?s[t]=w(s[t],e[t]):s[t]=e[t]}catch{s[t]=e[t]}return s};var T=(s=>(s.BOTTOM_BAR="bottom_bar",s.PARTLIST_BOUNDS="partlist_bounds",s.INTERACTION_NOTES="interaction_notes",s))(T||{}),G={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const J={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[T.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},$="(idle)",j=s=>(E(s),s!=null&&s.customApiUrl&&(s.customApiUrl=decodeURIComponent(s.customApiUrl)),s.shareUrl&&(s.deeplink=s.shareUrl.replace(Y,Q)),s),E=s=>{if(!s)return;const e=Object.keys(s);for(const t of e){const r=s[t];if(!Array.isArray(r)&&typeof r=="object"&&r!==null&&E(r),Array.isArray(r))for(const i of r)E(i);(r==="true"||r==="false")&&(s[t]=r==="true")}},z=(s,e)=>{e.configuratorId=s.id;const t=s.settings||{};return!e.overrideTenant&&s.tenant&&(e.overrideTenant=s.tenant),V(t,e)},q=()=>{const s={...J};s.locale||(s.locale=W()),s.id===$&&delete s.id;const e=k();return e&&x(e)&&(s.configuratorId="demoConfigurator"),s.customApiUrl=G.VITE_RAPI_URL,s.emails=!1,s},Y="<CONF_ID>",Q="#CONFIGURATIONID#",K=s=>{s.featureFlags||(s.featureFlags={}),typeof s.featureFlags.realPartList!="boolean"&&(s.featureFlags.realPartList=!0),typeof s.featureFlags.globalCallbacks!="boolean"&&(s.featureFlags.globalCallbacks=!0),typeof s.featureFlags.mocAr!="boolean"&&(s.featureFlags.mocAr=!1)},M=()=>/(android)/i.test(navigator.userAgent);class v{constructor(){c(this,"_messageHandler",null),c(this,"isSetupDone",!1),c(this,"viewName","main"),c(this,"plugins",{}),c(this,"pluginsLoaded",[]),c(this,"ui",{callbacks:null}),c(this,"extended",{callbacks:null}),c(this,"configurator",{callbacks:null}),c(this,"analytics",{callbacks:{}}),c(this,"global",{callbacks:{}})}setMessageHandler(e){this._messageHandler=e}handleSetup(e){const{methods:t,callbacks:r}=e;t.forEach(i=>{const o=i.split(p),a=o[0],n=o[1];this[a]||(this[a]={}),this[a][n]=function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(i,[...arguments])}.bind(this)}),r.forEach(i=>{const o=i.split(p),a=o[0],n=o[1],l=o[2];this[a]||(this[a]={}),this[a][n]||(this[a][n]={}),this[a][n][l]=()=>{}}),this.isSetupDone=!0}executeMessage({message:e,args:t}){const r=e.split(p),i=r[0],o=r[1],a=r.length===3?r[2]:null;if(a&&this[i][o][a]){const n=this[i][o][a](...t);return n instanceof Promise?n.then(l=>({result:l})):n!==void 0?Promise.resolve({result:n}):Promise.resolve({result:null})}return Promise.reject('Message "'+e+'" is unkown')}setupPlugins(e,t,r="website"){for(const i of e)typeof i=="string"&&i==="dragIn"?this.pluginsLoaded.push(new Promise((o,a)=>{try{import("./drag-in-w_TrusdP.mjs").then(n=>n.l).then(({DragIn:n})=>{const l=new n(this.ui,t,r,this.viewName);l.init().then(()=>{this.plugins.dragIn=l,o()},a)})}catch(n){a(n)}})):i.name&&i.loader&&this.pluginsLoaded.push(new Promise((o,a)=>{try{i.loader().then(n=>{const l=new n(this.ui,t,r,this.viewName);l.init().then(()=>{this.plugins[i.name]=l,o()},a)})}catch(n){a(n)}}))}}const S=()=>{let s,e;return{promise:new Promise((t,r)=>{s=t,e=r}),resolve:s,reject:e}},N=(s,e,t)=>{let r=null;Object.defineProperty(s,e,{get(){return r||t},set(i){i!=null&&i.mute?r=i.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),r=i)}})},R=()=>window.innerHeight*.01+"px",D=s=>{s&&setTimeout(()=>s.style.setProperty(O,R()),0)},L="rml-styles",X=450,O="--rml-full-height",g={CONTAINER:"rml-container",FILL:"rml-fill",POSITION:"rml-pos",TRANSITION:"rml-transition",ANDROID_HEIGHT:"rml-android-height",OVERFLOW_HIDDEN:"rml-overflow-hidden"},b=new Map;class Z extends v{constructor(e,t,r,i,o){if(super(),c(this,"_waitForIframe"),c(this,"_container"),c(this,"_configuratorSettings"),c(this,"_initData",{}),c(this,"_iframe"),!e||typeof e.id!="string")throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(b.has(t))throw new Error("There is already an instance on this DOM element");if(!document.getElementById(L)){const l=r.zIndex||9999999,u=document.createElement("style");u.type="text/css",u.id=L;const h="transition:all ease-in-out "+X+"ms;",d=["-webkit-","-o-"].reduce((P,A)=>P+=A+h,"")+h,m=R();u.innerHTML=`
2
2
  .${g.CONTAINER}{${O}:${m};}
3
3
  .${g.POSITION}{position:fixed;top:0;left:0;z-index:${l};opacity:0}
4
4
  .${g.TRANSITION}{${d}}
@@ -14,4 +14,4 @@
14
14
  `,document.head.appendChild(s)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let s=t.querySelector("."+v);s||(s=document.createElement("div"),s.classList.add(v),s.innerText=" ",t.appendChild(s))}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then(()=>zt);this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw console.error('Could not load Dragin strategy "FromWebsite"'),t}else if(this._mode==="custom-view")try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then(()=>Zt);this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw console.error('Could not load Dragin strategy "FromCustomView"'),t}else throw new Error("Unsupported mode")}get isDragging(){return this._strategy.isDragging}dragStart(t,s,n="rml_id"){this._strategy.dragStart(t,s,n)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,s,n="rml_id"){this._strategy.touchStart(t,s,n)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:s,customDragUpdate:n,beforeUpdateGhost:i}){i&&this._strategy.beforeUpdateGhost(i);const o=this._customDragSignal.signal,a=h=>{h.target.getAttribute("data-rml-draggable")==="true"&&t(h)},l=h=>{this._strategy.releaseInput(h),this._strategy.isDragging&&s(h)},d=h=>{n(h)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(h=>{h.draggable=!1}),document.addEventListener("mousedown",a,{signal:o}),document.addEventListener("mouseup",l,{signal:o}),document.addEventListener("mousemove",d,{signal:o}),document.addEventListener("mouseleave",l,{signal:o}),document.addEventListener("touchstart",a,{signal:o}),document.addEventListener("touchend",l,{signal:o}),document.addEventListener("touchmove",d,{signal:o})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const Pt=Object.freeze(Object.defineProperty({__proto__:null,DragIn:Ft},Symbol.toStringTag,{value:"Module"}));class Ht{constructor(e=16){c(this,"_computedStyleCache",new Map);c(this,"_maxLifetime",16);c(this,"_cacheCleanInterval",null);this._maxLifetime=e}get(e){const t=this._computedStyleCache.get(e),s=Date.now();if(t&&s-t.updated<this._maxLifetime)return t.style;const n=getComputedStyle(e);return this._computedStyleCache.set(e,{style:n,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(this._maxLifetime*1e3,5e3))),n}_cleanUpCache(){const e=Date.now();for(const[t,{updated:s}]of this._computedStyleCache.entries())e-s>=this._maxLifetime&&this._computedStyleCache.delete(t);this._computedStyleCache.size===0&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const T=r=>window.TouchEvent&&r instanceof window.TouchEvent;let H;const M=r=>(H||(H=new Ht),H.get(r)),lt=(r,e,t)=>{const s=parseFloat(r),n=window.devicePixelRatio||1;if(e==="px")return s;if(e==="%"){const o=t===document.documentElement?window.innerWidth:t.offsetWidth;return s/100*o}if(e==="rem"){const o=parseFloat(M(document.documentElement).fontSize);return s*o}if(e==="em"){const o=parseFloat(M(t).fontSize);return s*o}if(e==="vh"||e==="vw"||e==="vmin"||e==="vmax"){const o={vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)};return s/100*o[e]}const i={cm:37.7952755906,mm:3.77952755906,in:96};return e in i?s*i[e]*n:(console.warn("Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"),0)},ht=(r,e,t={x:0,y:0})=>{const s=r.getBoundingClientRect(),i=M(r).transform;let o=0,a=0;if(i!=="none"){const g=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,f=i.match(g);f&&(o=lt(f[1],f[2],r),a=lt(f[3],f[4],r))}const{clientX:l,clientY:d}=I(e,t),h=l-s.left-o+r.scrollLeft,u=d-s.top-a+r.scrollTop;return{x:h,y:u}},I=(r,e=null)=>{const{clientX:t,clientY:s}=T(r)?Ut(r):r,n=t>0?t:e?e.x:t,i=s>0?s:e?e.y:s;return{clientX:n,clientY:i}},Ut=r=>{if(r.touches.length){let{clientX:t,clientY:s}=r.touches[0];if(r.touches.length>1){const n=r.touches[1],i=n.clientX,o=n.clientY;t=(t+i)/2,s=(s+o)/2}return{clientX:t,clientY:s}}const e=r.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},U=500,B=10,Bt=100,dt=15,Y=(r,e=0)=>T(r)?{clientX:r.touches[e].clientX,clientY:r.touches[e].clientY}:{clientX:r.clientX,clientY:r.clientY},ut=r=>r&&T(r)?r.touches.length>0:!0;class gt{constructor(e,{onTouchDragStart:t},s={}){c(this,"_touchDragTimeOut");c(this,"_onTouchDragStart");c(this,"_payload",null);c(this,"_delay",U);c(this,"_firstTouch",null);c(this,"_lastTouch",null);c(this,"_epsilon",B);this._payload=e,this._onTouchDragStart=t,this._delay=typeof s.delay=="number"?s.delay:U,this._epsilon=typeof s.epsilon=="number"?s.epsilon:B}onStart(e){ut(e)&&(this._touchDragTimeOut||(this._firstTouch=Y(e,T(e)?e.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=Y(e)),this._checkXDistance(e)()},this._delay)))}onEnd(){this._resetTouches()}onMove(e){ut(e)&&(this._lastTouch=Y(e))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(e){return()=>{if(!this._firstTouch||!this._lastTouch)return;let t=!1;t=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,t&&(this._onTouchDragStart(this._payload,e),this._resetTouches())}}}const _t=(r,e,t=0,s=0)=>{const n=e.x+e.width+t,i=e.x-t,o=e.y+e.height+s,a=e.y-s,{x:l,y:d}=r;return l>=i&&l<=n&&d>=a&&d<=o},mt=(r,e,t,s=0,n=0)=>{if(!(!t||!t.hiddenIn&&!t.visibleIn))return t.visibleIn?_t({x:r,y:e},t.visibleIn,s,n):t.hiddenIn?!_t({x:r,y:e},t.hiddenIn,-s,-n):!1},Yt=()=>{if(!!!document.getElementById(A)){const e=document.createElement("style");e.type="text/css",e.id=A,e.innerHTML=`
15
15
  ${it}
16
16
  ${ot}
17
- `,document.head.appendChild(e)}},Xt=({x:r,y:e},t)=>{var n,i,o,a,l,d;let s=document.getElementById(b);if(!s){if(s=document.createElement("div"),(n=t.ghost)!=null&&n.element)s.appendChild(t.ghost.element);else{const h=document.createElement("img");h.src=((i=t.ghost)==null?void 0:i.url)||R,h.width=((o=t.ghost)==null?void 0:o.width)||F,h.height=((a=t.ghost)==null?void 0:a.height)||P,s.appendChild(h)}s.id=b,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.willChange="transform",s.style.transform="translate3d(0, 0, 0)",s.style.zIndex="9999",s.style.opacity="0.5",mt(r,e,t.ghost||{},(l=t.settings)==null?void 0:l.dragInOverlapX,(d=t.settings)==null?void 0:d.dragInOverlapY)||(s.style.display="none"),s.style.pointerEvents="none",document.body.appendChild(s)}},Wt=({x:r,y:e},t)=>{var l,d,h,u;const s=document.getElementById(b);if(!s)return;let n=(l=t.ghost)==null?void 0:l.width,i=(d=t.ghost)==null?void 0:d.height;typeof n>"u"&&(n=s.getBoundingClientRect().width||F),typeof i>"u"&&(i=s.getBoundingClientRect().height||P);const o=r-n/2,a=e-i/2;s.style.transform=`translate3d(${o}px, ${a}px, 0)`,t.ghost&&(mt(r,e,t.ghost,(h=t.settings)==null?void 0:h.dragInOverlapX,(u=t.settings)==null?void 0:u.dragInOverlapY)?s.style.animation!=at&&(s.style.animation=at):s.style.animation!=ct&&(s.style.animation=ct))};class $t{constructor(e=null){c(this,"_dragGhostAnimationFrameId",null);c(this,"_dragGhostRemoveAnimationFrameId",null);c(this,"_dragGhostElement",null);this._dragGhostElement=e}updateDragGhost(e,t,s){var n;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((n=s.ghost)!=null&&n.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Yt();const i={x:e,y:t};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),Xt(i,s),Wt(i,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const e=document.getElementById(b);e&&document.body.removeChild(e),this._dragGhostRemoveAnimationFrameId=null}))}}class kt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_mainDomElement");c(this,"_currentDrag",{});c(this,"_currentTouch",null);c(this,"_firefoxDragPosition",{x:0,y:0});c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);c(this,"_firefoxFallback",e=>{if(!this._currentDrag.event)return;const t=e||window.event;this._firefoxDragPosition.x=t.pageX||0,this._firefoxDragPosition.y=t.pageY||0});this._instance=e,this._mainDomElement=t,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}dragStart(e,t,s="rml_id"){const n=this._mainDomElement.parentNode;if(M(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=n.querySelector("."+O);o||(o=document.createElement("div"),o.classList.add(O),n.appendChild(o)),o.classList.remove(G.DISPLAY_NONE),t.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const l=n.querySelector("."+v);this._currentDrag.event=t;const d=t.target,h=d.cloneNode(),u=d.getBoundingClientRect();h.style.width=`${u.width}px`,h.style.height=`${u.height}px`,this._currentDrag.ghost=new $t(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:g,clientY:f}=I(t,this._firefoxDragPosition);this._currentDrag.offset.x=g-u.left,this._currentDrag.offset.y=f-u.top,t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(l,0,0);const{x:S,y:D}=ht(n,this._currentDrag.event||t,this._firefoxDragPosition),y=Math.max(1,S),$=Math.max(1,D);this.isDragging=!0,this._instance.dragInObject(e,y,$,s)}dragUpdate(e){var D;const t=this._mainDomElement.parentNode,{x:s,y:n}=ht(t,e,this._firefoxDragPosition);if(s===0&&n===0)return;const i=Math.max(1,s),o=Math.max(1,n);if(i===1&&o===1)return;let a=i,l=o;if(T(e)){const y=((D=this._options.settings)==null?void 0:D.fingerSize)||0;a=Math.max(2,i+y),l=Math.max(2,o-y)}const{x:d,y:h,options:u}=this._onBeforeUpdateDrag(a,l,{}),g=u||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const f=typeof d=="number"?d:a,S=typeof h=="number"?h:l;if(this._currentDrag.ghost){const{clientX:y,clientY:$}=I(e,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(y,$,g)}this._instance.updateDrag(f,S,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const e=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const t=e.querySelector("."+O);t&&t.classList.add(G.DISPLAY_NONE)}touchStart(e,t,s="rml_id"){var o,a,l,d;t.preventDefault();const n=(h,u)=>{this.dragStart(e,u,s)},i={};typeof((a=(o=this._options)==null?void 0:o.settings)==null?void 0:a.touchDragDelay)=="number"&&(i.delay=this._options.settings.touchDragDelay),(d=(l=this._options)==null?void 0:l.settings)!=null&&d.touchDragEpsilon&&(i.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new gt(void 0,{onTouchDragStart:n},i),this._currentTouch.onStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(e){}}const zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:kt},Symbol.toStringTag,{value:"Module"})),Vt=r=>`[data-rml-custom-view="${r}"]`,X=r=>{r.preventDefault(),r.stopPropagation()},qt=(r,e,t,s)=>{const n=t-r,i=s-e;return Math.sqrt(n*n+i*i)};class Kt{constructor({onCustomDragStart:e},t={}){c(this,"_startX",0);c(this,"_startY",0);c(this,"_lastX",0);c(this,"_lastY",0);c(this,"_epsilon");c(this,"_isWaiting",!1);c(this,"_onCustomDragStart");this._epsilon=typeof t.epsilon=="number"?t.epsilon:dt,this._onCustomDragStart=e}onMove(e){this._lastX=e.clientX,this._lastY=e.clientY,this._isWaiting&&qt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(e),this._isWaiting=!1)}onStart(e){this._startX=e.clientX,this._startY=e.clientY,this.onMove(e),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const W="data-rml-old-draggable",Jt=void 0,ft=(r,e)=>{const t=T(r),s={delay:t?U:Bt,epsilon:t?B:dt};if(!e)return s;if(!t&&!(r instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:i}=t?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof e[n]=="number"&&(s.delay=e.touchDragDelay),typeof e[i]=="number"&&(s.epsilon=e.touchDragEpsilon),s},jt=r=>{let e="",t=F,s=P;if(!r)return{url:R,width:t,height:s};const n=r;if(n instanceof HTMLElement){const i=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),l=n.getAttribute("data-rml-ghost-height");o?e=o:!o&&n instanceof HTMLImageElement&&n.src&&(e=n.src),e?(t=i.width,s=i.height):e=R,t=a?parseInt(a,10):t,s=l?parseInt(l,10):s}return{url:e||R,width:t,height:s}};class Qt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_viewName");c(this,"_currentCustomDrag",null);c(this,"_currentBb",null);c(this,"_startTarget",null);c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);this._instance=e,this._options=t||{},this._viewName=s}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}async _dragStart(e,t,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(W,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",X),this._startTarget.addEventListener("dragstart",X)),this._currentBb=await this._instance.getBoundingClientRect(Vt(this._viewName));const{clientX:n,clientY:i}=I(t),o=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(e,o,a,s)}_dragUpdate(e){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(e),!this._currentBb||!this.isDragging)return;const{clientX:t,clientY:s}=I(e),{url:n,width:i,height:o}=jt(this._startTarget),a=this._currentBb.x+t,l=this._currentBb.y+s,d=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(d.dragInOverlapX||0),y:this._currentBb.y+(d.dragInOverlapY||0),width:this._currentBb.width+(d.dragInOverlapX||0),height:this._currentBb.height+(d.dragInOverlapY||0)},url:n,width:i,height:o},mode:"custom-view"},{x:u,y:g,options:f}=this._onBeforeUpdateDrag(a,l,h),S=typeof u=="number"?u:a,D=typeof g=="number"?g:l,y=f||h;this._instance.updateDrag(S,D,y)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(e,t,s){this._instance.disableEvents(),this._startTarget=t.target;const n=(i,o)=>{this._dragStart(e,o,s)};this._currentCustomDrag=T(t)?new gt(Jt,{onTouchDragStart:n},ft(t,this._options)):new Kt({onCustomDragStart:i=>this._dragStart(e,i,s)},ft(t,this._options)),this._currentCustomDrag.onStart(t)}dragEnd(){this._dragEnd()}dragUpdate(e){this._dragUpdate(e)}touchStart(e,t,s="rml_id"){this.dragStart(e,t,s)}touchMove(e){this.dragUpdate(e)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(W)==="true",this._startTarget.removeAttribute(W),this._startTarget.removeEventListener("dragstart",X))}releaseInput(e){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const Zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Qt},Symbol.toStringTag,{value:"Module"}));return xt});
17
+ `,document.head.appendChild(e)}},Xt=({x:r,y:e},t)=>{var n,i,o,a,l,d;let s=document.getElementById(b);if(!s){if(s=document.createElement("div"),(n=t.ghost)!=null&&n.element)s.appendChild(t.ghost.element);else{const h=document.createElement("img");h.src=((i=t.ghost)==null?void 0:i.url)||R,h.width=((o=t.ghost)==null?void 0:o.width)||F,h.height=((a=t.ghost)==null?void 0:a.height)||P,s.appendChild(h)}s.id=b,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.willChange="transform",s.style.transform="translate3d(0, 0, 0)",s.style.zIndex="9999",s.style.opacity="0.5",mt(r,e,t.ghost||{},(l=t.settings)==null?void 0:l.dragInOverlapX,(d=t.settings)==null?void 0:d.dragInOverlapY)||(s.style.display="none"),s.style.pointerEvents="none",document.body.appendChild(s)}},Wt=({x:r,y:e},t)=>{var l,d,h,u;const s=document.getElementById(b);if(!s)return;let n=(l=t.ghost)==null?void 0:l.width,i=(d=t.ghost)==null?void 0:d.height;typeof n>"u"&&(n=s.getBoundingClientRect().width||F),typeof i>"u"&&(i=s.getBoundingClientRect().height||P);const o=r-n/2,a=e-i/2;s.style.transform=`translate3d(${o}px, ${a}px, 0)`,t.ghost&&(mt(r,e,t.ghost,(h=t.settings)==null?void 0:h.dragInOverlapX,(u=t.settings)==null?void 0:u.dragInOverlapY)?s.style.animation!=at&&(s.style.animation=at):s.style.animation!=ct&&(s.style.animation=ct))};class $t{constructor(e=null){c(this,"_dragGhostAnimationFrameId",null);c(this,"_dragGhostRemoveAnimationFrameId",null);c(this,"_dragGhostElement",null);this._dragGhostElement=e}updateDragGhost(e,t,s){var n;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((n=s.ghost)!=null&&n.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Yt();const i={x:e,y:t};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),Xt(i,s),Wt(i,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const e=document.getElementById(b);e&&document.body.removeChild(e),this._dragGhostRemoveAnimationFrameId=null}))}}class kt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_mainDomElement");c(this,"_currentDrag",{});c(this,"_currentTouch",null);c(this,"_firefoxDragPosition",{x:0,y:0});c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);c(this,"_firefoxFallback",e=>{if(!this._currentDrag.event)return;e.preventDefault();const t=e||window.event;this._firefoxDragPosition.x=t.pageX||0,this._firefoxDragPosition.y=t.pageY||0});this._instance=e,this._mainDomElement=t,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}dragStart(e,t,s="rml_id"){const n=this._mainDomElement.parentNode;if(M(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=n.querySelector("."+O);o||(o=document.createElement("div"),o.classList.add(O),n.appendChild(o)),o.classList.remove(G.DISPLAY_NONE),t.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const l=n.querySelector("."+v);this._currentDrag.event=t;const d=t.target,h=d.cloneNode(),u=d.getBoundingClientRect();h.style.width=`${u.width}px`,h.style.height=`${u.height}px`,this._currentDrag.ghost=new $t(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:g,clientY:f}=I(t,this._firefoxDragPosition);this._currentDrag.offset.x=g-u.left,this._currentDrag.offset.y=f-u.top,t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(l,0,0);const{x:S,y:D}=ht(n,this._currentDrag.event||t,this._firefoxDragPosition),y=Math.max(1,S),$=Math.max(1,D);this.isDragging=!0,this._instance.dragInObject(e,y,$,s)}dragUpdate(e){var D;const t=this._mainDomElement.parentNode,{x:s,y:n}=ht(t,e,this._firefoxDragPosition);if(s===0&&n===0)return;const i=Math.max(1,s),o=Math.max(1,n);if(i===1&&o===1)return;let a=i,l=o;if(T(e)){const y=((D=this._options.settings)==null?void 0:D.fingerSize)||0;a=Math.max(2,i+y),l=Math.max(2,o-y)}const{x:d,y:h,options:u}=this._onBeforeUpdateDrag(a,l,{}),g=u||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const f=typeof d=="number"?d:a,S=typeof h=="number"?h:l;if(this._currentDrag.ghost){const{clientX:y,clientY:$}=I(e,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(y,$,g)}this._instance.updateDrag(f,S,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const e=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const t=e.querySelector("."+O);t&&t.classList.add(G.DISPLAY_NONE)}touchStart(e,t,s="rml_id"){var o,a,l,d;t.preventDefault();const n=(h,u)=>{this.dragStart(e,u,s)},i={};typeof((a=(o=this._options)==null?void 0:o.settings)==null?void 0:a.touchDragDelay)=="number"&&(i.delay=this._options.settings.touchDragDelay),(d=(l=this._options)==null?void 0:l.settings)!=null&&d.touchDragEpsilon&&(i.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new gt(void 0,{onTouchDragStart:n},i),this._currentTouch.onStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(e){}}const zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:kt},Symbol.toStringTag,{value:"Module"})),Vt=r=>`[data-rml-custom-view="${r}"]`,X=r=>{r.preventDefault(),r.stopPropagation()},qt=(r,e,t,s)=>{const n=t-r,i=s-e;return Math.sqrt(n*n+i*i)};class Kt{constructor({onCustomDragStart:e},t={}){c(this,"_startX",0);c(this,"_startY",0);c(this,"_lastX",0);c(this,"_lastY",0);c(this,"_epsilon");c(this,"_isWaiting",!1);c(this,"_onCustomDragStart");this._epsilon=typeof t.epsilon=="number"?t.epsilon:dt,this._onCustomDragStart=e}onMove(e){this._lastX=e.clientX,this._lastY=e.clientY,this._isWaiting&&qt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(e),this._isWaiting=!1)}onStart(e){this._startX=e.clientX,this._startY=e.clientY,this.onMove(e),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const W="data-rml-old-draggable",Jt=void 0,ft=(r,e)=>{const t=T(r),s={delay:t?U:Bt,epsilon:t?B:dt};if(!e)return s;if(!t&&!(r instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:i}=t?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof e[n]=="number"&&(s.delay=e.touchDragDelay),typeof e[i]=="number"&&(s.epsilon=e.touchDragEpsilon),s},jt=r=>{let e="",t=F,s=P;if(!r)return{url:R,width:t,height:s};const n=r;if(n instanceof HTMLElement){const i=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),l=n.getAttribute("data-rml-ghost-height");o?e=o:!o&&n instanceof HTMLImageElement&&n.src&&(e=n.src),e?(t=i.width,s=i.height):e=R,t=a?parseInt(a,10):t,s=l?parseInt(l,10):s}return{url:e||R,width:t,height:s}};class Qt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_viewName");c(this,"_currentCustomDrag",null);c(this,"_currentBb",null);c(this,"_startTarget",null);c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);this._instance=e,this._options=t||{},this._viewName=s}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}async _dragStart(e,t,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(W,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",X),this._startTarget.addEventListener("dragstart",X)),this._currentBb=await this._instance.getBoundingClientRect(Vt(this._viewName));const{clientX:n,clientY:i}=I(t),o=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(e,o,a,s)}_dragUpdate(e){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(e),!this._currentBb||!this.isDragging)return;const{clientX:t,clientY:s}=I(e),{url:n,width:i,height:o}=jt(this._startTarget),a=this._currentBb.x+t,l=this._currentBb.y+s,d=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(d.dragInOverlapX||0),y:this._currentBb.y+(d.dragInOverlapY||0),width:this._currentBb.width+(d.dragInOverlapX||0),height:this._currentBb.height+(d.dragInOverlapY||0)},url:n,width:i,height:o},mode:"custom-view"},{x:u,y:g,options:f}=this._onBeforeUpdateDrag(a,l,h),S=typeof u=="number"?u:a,D=typeof g=="number"?g:l,y=f||h;this._instance.updateDrag(S,D,y)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(e,t,s){this._instance.disableEvents(),this._startTarget=t.target;const n=(i,o)=>{this._dragStart(e,o,s)};this._currentCustomDrag=T(t)?new gt(Jt,{onTouchDragStart:n},ft(t,this._options)):new Kt({onCustomDragStart:i=>this._dragStart(e,i,s)},ft(t,this._options)),this._currentCustomDrag.onStart(t)}dragEnd(){this._dragEnd()}dragUpdate(e){this._dragUpdate(e)}touchStart(e,t,s="rml_id"){this.dragStart(e,t,s)}touchMove(e){this.dragUpdate(e)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(W)==="true",this._startTarget.removeAttribute(W),this._startTarget.removeEventListener("dragstart",X))}releaseInput(e){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const Zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Qt},Symbol.toStringTag,{value:"Module"}));return xt});
@@ -14,4 +14,4 @@
14
14
  `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+O);e||(e=document.createElement("div"),e.classList.add(O),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then(()=>zt);this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw console.error('Could not load Dragin strategy "FromWebsite"'),t}else if(this._mode==="custom-view")try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then(()=>te);this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw console.error('Could not load Dragin strategy "FromCustomView"'),t}else throw new Error("Unsupported mode")}get isDragging(){return this._strategy.isDragging}dragStart(t,e,s="rml_id"){this._strategy.dragStart(t,e,s)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,s="rml_id"){this._strategy.touchStart(t,e,s)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:s,beforeUpdateGhost:n}){n&&this._strategy.beforeUpdateGhost(n);const r=this._customDragSignal.signal,o=l=>{l.target.getAttribute("data-rml-draggable")==="true"&&t(l)},a=l=>{this._strategy.releaseInput(l),this._strategy.isDragging&&e(l)},c=l=>{s(l)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(l=>{l.draggable=!1}),document.addEventListener("mousedown",o,{signal:r}),document.addEventListener("mouseup",a,{signal:r}),document.addEventListener("mousemove",c,{signal:r}),document.addEventListener("mouseleave",a,{signal:r}),document.addEventListener("touchstart",o,{signal:r}),document.addEventListener("touchend",a,{signal:r}),document.addEventListener("touchmove",c,{signal:r})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const Ut=Object.freeze(Object.defineProperty({__proto__:null,DragIn:Bt},Symbol.toStringTag,{value:"Module"}));class Ht{constructor(t=16){h(this,"_computedStyleCache",new Map),h(this,"_maxLifetime",16),h(this,"_cacheCleanInterval",null),this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),s=Date.now();if(e&&s-e.updated<this._maxLifetime)return e.style;const n=getComputedStyle(t);return this._computedStyleCache.set(t,{style:n,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(this._maxLifetime*1e3,5e3))),n}_cleanUpCache(){const t=Date.now();for(const[e,{updated:s}]of this._computedStyleCache.entries())t-s>=this._maxLifetime&&this._computedStyleCache.delete(e);this._computedStyleCache.size===0&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const f=i=>window.TouchEvent&&i instanceof window.TouchEvent;let H;const M=i=>(H||(H=new Ht),H.get(i)),ct=(i,t,e)=>{const s=parseFloat(i),n=window.devicePixelRatio||1;if(t==="px")return s;if(t==="%"){const o=e===document.documentElement?window.innerWidth:e.offsetWidth;return s/100*o}if(t==="rem"){const o=parseFloat(M(document.documentElement).fontSize);return s*o}if(t==="em"){const o=parseFloat(M(e).fontSize);return s*o}if(t==="vh"||t==="vw"||t==="vmin"||t==="vmax"){const o={vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)};return s/100*o[t]}const r={cm:37.7952755906,mm:3.77952755906,in:96};return t in r?s*r[t]*n:(console.warn("Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"),0)},dt=(i,t,e={x:0,y:0})=>{const s=i.getBoundingClientRect(),n=M(i).transform;let r=0,o=0;if(n!=="none"){const u=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,g=n.match(u);g&&(r=ct(g[1],g[2],i),o=ct(g[3],g[4],i))}const{clientX:a,clientY:c}=b(t,e),l=a-s.left-r+i.scrollLeft,d=c-s.top-o+i.scrollTop;return{x:l,y:d}},b=(i,t=null)=>{const{clientX:e,clientY:s}=f(i)?Gt(i):i,n=e>0?e:t?t.x:e,r=s>0?s:t?t.y:s;return{clientX:n,clientY:r}},Gt=i=>{if(i.touches.length){let{clientX:e,clientY:s}=i.touches[0];if(i.touches.length>1){const n=i.touches[1],r=n.clientX,o=n.clientY;e=(e+r)/2,s=(s+o)/2}return{clientX:e,clientY:s}}const t=i.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}},G=500,Y=10,Yt=100,ut=15,X=(i,t=0)=>f(i)?{clientX:i.touches[t].clientX,clientY:i.touches[t].clientY}:{clientX:i.clientX,clientY:i.clientY},gt=i=>i&&f(i)?i.touches.length>0:!0;class mt{constructor(t,{onTouchDragStart:e},s={}){h(this,"_touchDragTimeOut"),h(this,"_onTouchDragStart"),h(this,"_payload",null),h(this,"_delay",G),h(this,"_firstTouch",null),h(this,"_lastTouch",null),h(this,"_epsilon",Y),this._payload=t,this._onTouchDragStart=e,this._delay=typeof s.delay=="number"?s.delay:G,this._epsilon=typeof s.epsilon=="number"?s.epsilon:Y}onStart(t){gt(t)&&(this._touchDragTimeOut||(this._firstTouch=X(t,f(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=X(t)),this._checkXDistance(t)()},this._delay)))}onEnd(){this._resetTouches()}onMove(t){gt(t)&&(this._lastTouch=X(t))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const _t=(i,t,e=0,s=0)=>{const n=t.x+t.width+e,r=t.x-e,o=t.y+t.height+s,a=t.y-s,{x:c,y:l}=i;return c>=r&&c<=n&&l>=a&&l<=o},pt=(i,t,e,s=0,n=0)=>{if(!(!e||!e.hiddenIn&&!e.visibleIn))return e.visibleIn?_t({x:i,y:t},e.visibleIn,s,n):e.hiddenIn?!_t({x:i,y:t},e.hiddenIn,-s,-n):!1},Xt=()=>{if(!document.getElementById(T)){const i=document.createElement("style");i.type="text/css",i.id=T,i.innerHTML=`
15
15
  ${ot}
16
16
  ${at}
17
- `,document.head.appendChild(i)}},kt=({x:i,y:t},e)=>{var s,n,r,o,a,c;let l=document.getElementById(I);if(!l){if(l=document.createElement("div"),(s=e.ghost)!=null&&s.element)l.appendChild(e.ghost.element);else{const d=document.createElement("img");d.src=((n=e.ghost)==null?void 0:n.url)||x,d.width=((r=e.ghost)==null?void 0:r.width)||B,d.height=((o=e.ghost)==null?void 0:o.height)||U,l.appendChild(d)}l.id=I,l.style.position="fixed",l.style.top="0",l.style.left="0",l.style.willChange="transform",l.style.transform="translate3d(0, 0, 0)",l.style.zIndex="9999",l.style.opacity="0.5",pt(i,t,e.ghost||{},(a=e.settings)==null?void 0:a.dragInOverlapX,(c=e.settings)==null?void 0:c.dragInOverlapY)||(l.style.display="none"),l.style.pointerEvents="none",document.body.appendChild(l)}},Wt=({x:i,y:t},e)=>{var s,n,r,o;const a=document.getElementById(I);if(!a)return;let c=(s=e.ghost)==null?void 0:s.width,l=(n=e.ghost)==null?void 0:n.height;typeof c>"u"&&(c=a.getBoundingClientRect().width||B),typeof l>"u"&&(l=a.getBoundingClientRect().height||U);const d=i-c/2,u=t-l/2;a.style.transform=`translate3d(${d}px, ${u}px, 0)`,e.ghost&&(pt(i,t,e.ghost,(r=e.settings)==null?void 0:r.dragInOverlapX,(o=e.settings)==null?void 0:o.dragInOverlapY)?a.style.animation!=lt&&(a.style.animation=lt):a.style.animation!=ht&&(a.style.animation=ht))};class $t{constructor(t=null){h(this,"_dragGhostAnimationFrameId",null),h(this,"_dragGhostRemoveAnimationFrameId",null),h(this,"_dragGhostElement",null),this._dragGhostElement=t}updateDragGhost(t,e,s){var n;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((n=s.ghost)!=null&&n.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Xt();const r={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),kt(r,s),Wt(r,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(I);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}class jt{constructor(t,e,s){h(this,"_options",{}),h(this,"_instance"),h(this,"_mainDomElement"),h(this,"_currentDrag",{}),h(this,"_currentTouch",null),h(this,"_firefoxDragPosition",{x:0,y:0}),h(this,"_onBeforeUpdateDrag",()=>({})),h(this,"isDragging",!1),h(this,"_firefoxFallback",n=>{if(!this._currentDrag.event)return;const r=n||window.event;this._firefoxDragPosition.x=r.pageX||0,this._firefoxDragPosition.y=r.pageY||0}),this._instance=t,this._mainDomElement=e,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const n=this._mainDomElement.parentNode;if(M(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let r=n.querySelector("."+S);r||(r=document.createElement("div"),r.classList.add(S),n.appendChild(r)),r.classList.remove(F.DISPLAY_NONE),e.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const o=n.querySelector("."+O);this._currentDrag.event=e;const a=e.target,c=a.cloneNode(),l=a.getBoundingClientRect();c.style.width=`${l.width}px`,c.style.height=`${l.height}px`,this._currentDrag.ghost=new $t(c),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:d,clientY:u}=b(e,this._firefoxDragPosition);this._currentDrag.offset.x=d-l.left,this._currentDrag.offset.y=u-l.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(o,0,0);const{x:g,y:_}=dt(n,this._currentDrag.event||e,this._firefoxDragPosition),y=Math.max(1,g),w=Math.max(1,_);this.isDragging=!0,this._instance.dragInObject(t,y,w,s)}dragUpdate(t){var e;const s=this._mainDomElement.parentNode,{x:n,y:r}=dt(s,t,this._firefoxDragPosition);if(n===0&&r===0)return;const o=Math.max(1,n),a=Math.max(1,r);if(o===1&&a===1)return;let c=o,l=a;if(f(t)){const v=((e=this._options.settings)==null?void 0:e.fingerSize)||0;c=Math.max(2,o+v),l=Math.max(2,a-v)}const{x:d,y:u,options:g}=this._onBeforeUpdateDrag(c,l,{}),_=g||{settings:{},ghost:{}};_.ghost||(_.ghost={}),_.ghost.visibleIn&&_.ghost.hiddenIn||(_.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const y=typeof d=="number"?d:c,w=typeof u=="number"?u:l;if(this._currentDrag.ghost){const{clientX:v,clientY:ee}=b(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(v,ee,_)}this._instance.updateDrag(y,w,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+S);e&&e.classList.add(F.DISPLAY_NONE)}touchStart(t,e,s="rml_id"){var n,r,o,a;e.preventDefault();const c=(d,u)=>{this.dragStart(t,u,s)},l={};typeof((r=(n=this._options)==null?void 0:n.settings)==null?void 0:r.touchDragDelay)=="number"&&(l.delay=this._options.settings.touchDragDelay),(a=(o=this._options)==null?void 0:o.settings)!=null&&a.touchDragEpsilon&&(l.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new mt(void 0,{onTouchDragStart:c},l),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}const zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:jt},Symbol.toStringTag,{value:"Module"})),Vt=i=>`[data-rml-custom-view="${i}"]`,k=i=>{i.preventDefault(),i.stopPropagation()},qt=(i,t,e,s)=>{const n=e-i,r=s-t;return Math.sqrt(n*n+r*r)};class Jt{constructor({onCustomDragStart:t},e={}){h(this,"_startX",0),h(this,"_startY",0),h(this,"_lastX",0),h(this,"_lastY",0),h(this,"_epsilon"),h(this,"_isWaiting",!1),h(this,"_onCustomDragStart"),this._epsilon=typeof e.epsilon=="number"?e.epsilon:ut,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&qt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const W="data-rml-old-draggable",Kt=void 0,ft=(i,t)=>{const e=f(i),s={delay:e?G:Yt,epsilon:e?Y:ut};if(!t)return s;if(!e&&!(i instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:r}=e?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof t[n]=="number"&&(s.delay=t.touchDragDelay),typeof t[r]=="number"&&(s.epsilon=t.touchDragEpsilon),s},Qt=i=>{let t="",e=B,s=U;if(!i)return{url:x,width:e,height:s};const n=i;if(n instanceof HTMLElement){const r=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),c=n.getAttribute("data-rml-ghost-height");o?t=o:!o&&n instanceof HTMLImageElement&&n.src&&(t=n.src),t?(e=r.width,s=r.height):t=x,e=a?parseInt(a,10):e,s=c?parseInt(c,10):s}return{url:t||x,width:e,height:s}};class Zt{constructor(t,e,s){h(this,"_options",{}),h(this,"_instance"),h(this,"_viewName"),h(this,"_currentCustomDrag",null),h(this,"_currentBb",null),h(this,"_startTarget",null),h(this,"_onBeforeUpdateDrag",()=>({})),h(this,"isDragging",!1),this._instance=t,this._options=e||{},this._viewName=s}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(W,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",k),this._startTarget.addEventListener("dragstart",k)),this._currentBb=await this._instance.getBoundingClientRect(Vt(this._viewName));const{clientX:n,clientY:r}=b(e),o=this._currentBb.x+n,a=this._currentBb.y+r;this.isDragging=!0,this._instance.dragInObject(t,o,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=b(t),{url:n,width:r,height:o}=Qt(this._startTarget),a=this._currentBb.x+e,c=this._currentBb.y+s,l=this._options||{},d={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:n,width:r,height:o},mode:"custom-view"},{x:u,y:g,options:_}=this._onBeforeUpdateDrag(a,c,d),y=typeof u=="number"?u:a,w=typeof g=="number"?g:c,v=_||d;this._instance.updateDrag(y,w,v)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,e,s){this._instance.disableEvents(),this._startTarget=e.target;const n=(r,o)=>{this._dragStart(t,o,s)};this._currentCustomDrag=f(e)?new mt(Kt,{onTouchDragStart:n},ft(e,this._options)):new Jt({onCustomDragStart:r=>this._dragStart(t,r,s)},ft(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(W)==="true",this._startTarget.removeAttribute(W),this._startTarget.removeEventListener("dragstart",k))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const te=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Zt},Symbol.toStringTag,{value:"Module"}));return Pt});
17
+ `,document.head.appendChild(i)}},kt=({x:i,y:t},e)=>{var s,n,r,o,a,c;let l=document.getElementById(I);if(!l){if(l=document.createElement("div"),(s=e.ghost)!=null&&s.element)l.appendChild(e.ghost.element);else{const d=document.createElement("img");d.src=((n=e.ghost)==null?void 0:n.url)||x,d.width=((r=e.ghost)==null?void 0:r.width)||B,d.height=((o=e.ghost)==null?void 0:o.height)||U,l.appendChild(d)}l.id=I,l.style.position="fixed",l.style.top="0",l.style.left="0",l.style.willChange="transform",l.style.transform="translate3d(0, 0, 0)",l.style.zIndex="9999",l.style.opacity="0.5",pt(i,t,e.ghost||{},(a=e.settings)==null?void 0:a.dragInOverlapX,(c=e.settings)==null?void 0:c.dragInOverlapY)||(l.style.display="none"),l.style.pointerEvents="none",document.body.appendChild(l)}},Wt=({x:i,y:t},e)=>{var s,n,r,o;const a=document.getElementById(I);if(!a)return;let c=(s=e.ghost)==null?void 0:s.width,l=(n=e.ghost)==null?void 0:n.height;typeof c>"u"&&(c=a.getBoundingClientRect().width||B),typeof l>"u"&&(l=a.getBoundingClientRect().height||U);const d=i-c/2,u=t-l/2;a.style.transform=`translate3d(${d}px, ${u}px, 0)`,e.ghost&&(pt(i,t,e.ghost,(r=e.settings)==null?void 0:r.dragInOverlapX,(o=e.settings)==null?void 0:o.dragInOverlapY)?a.style.animation!=lt&&(a.style.animation=lt):a.style.animation!=ht&&(a.style.animation=ht))};class $t{constructor(t=null){h(this,"_dragGhostAnimationFrameId",null),h(this,"_dragGhostRemoveAnimationFrameId",null),h(this,"_dragGhostElement",null),this._dragGhostElement=t}updateDragGhost(t,e,s){var n;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((n=s.ghost)!=null&&n.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Xt();const r={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),kt(r,s),Wt(r,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(I);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}class jt{constructor(t,e,s){h(this,"_options",{}),h(this,"_instance"),h(this,"_mainDomElement"),h(this,"_currentDrag",{}),h(this,"_currentTouch",null),h(this,"_firefoxDragPosition",{x:0,y:0}),h(this,"_onBeforeUpdateDrag",()=>({})),h(this,"isDragging",!1),h(this,"_firefoxFallback",n=>{if(!this._currentDrag.event)return;n.preventDefault();const r=n||window.event;this._firefoxDragPosition.x=r.pageX||0,this._firefoxDragPosition.y=r.pageY||0}),this._instance=t,this._mainDomElement=e,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const n=this._mainDomElement.parentNode;if(M(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let r=n.querySelector("."+S);r||(r=document.createElement("div"),r.classList.add(S),n.appendChild(r)),r.classList.remove(F.DISPLAY_NONE),e.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const o=n.querySelector("."+O);this._currentDrag.event=e;const a=e.target,c=a.cloneNode(),l=a.getBoundingClientRect();c.style.width=`${l.width}px`,c.style.height=`${l.height}px`,this._currentDrag.ghost=new $t(c),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:d,clientY:u}=b(e,this._firefoxDragPosition);this._currentDrag.offset.x=d-l.left,this._currentDrag.offset.y=u-l.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(o,0,0);const{x:g,y:_}=dt(n,this._currentDrag.event||e,this._firefoxDragPosition),y=Math.max(1,g),w=Math.max(1,_);this.isDragging=!0,this._instance.dragInObject(t,y,w,s)}dragUpdate(t){var e;const s=this._mainDomElement.parentNode,{x:n,y:r}=dt(s,t,this._firefoxDragPosition);if(n===0&&r===0)return;const o=Math.max(1,n),a=Math.max(1,r);if(o===1&&a===1)return;let c=o,l=a;if(f(t)){const v=((e=this._options.settings)==null?void 0:e.fingerSize)||0;c=Math.max(2,o+v),l=Math.max(2,a-v)}const{x:d,y:u,options:g}=this._onBeforeUpdateDrag(c,l,{}),_=g||{settings:{},ghost:{}};_.ghost||(_.ghost={}),_.ghost.visibleIn&&_.ghost.hiddenIn||(_.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const y=typeof d=="number"?d:c,w=typeof u=="number"?u:l;if(this._currentDrag.ghost){const{clientX:v,clientY:ee}=b(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(v,ee,_)}this._instance.updateDrag(y,w,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+S);e&&e.classList.add(F.DISPLAY_NONE)}touchStart(t,e,s="rml_id"){var n,r,o,a;e.preventDefault();const c=(d,u)=>{this.dragStart(t,u,s)},l={};typeof((r=(n=this._options)==null?void 0:n.settings)==null?void 0:r.touchDragDelay)=="number"&&(l.delay=this._options.settings.touchDragDelay),(a=(o=this._options)==null?void 0:o.settings)!=null&&a.touchDragEpsilon&&(l.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new mt(void 0,{onTouchDragStart:c},l),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}const zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:jt},Symbol.toStringTag,{value:"Module"})),Vt=i=>`[data-rml-custom-view="${i}"]`,k=i=>{i.preventDefault(),i.stopPropagation()},qt=(i,t,e,s)=>{const n=e-i,r=s-t;return Math.sqrt(n*n+r*r)};class Jt{constructor({onCustomDragStart:t},e={}){h(this,"_startX",0),h(this,"_startY",0),h(this,"_lastX",0),h(this,"_lastY",0),h(this,"_epsilon"),h(this,"_isWaiting",!1),h(this,"_onCustomDragStart"),this._epsilon=typeof e.epsilon=="number"?e.epsilon:ut,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&qt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const W="data-rml-old-draggable",Kt=void 0,ft=(i,t)=>{const e=f(i),s={delay:e?G:Yt,epsilon:e?Y:ut};if(!t)return s;if(!e&&!(i instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:r}=e?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof t[n]=="number"&&(s.delay=t.touchDragDelay),typeof t[r]=="number"&&(s.epsilon=t.touchDragEpsilon),s},Qt=i=>{let t="",e=B,s=U;if(!i)return{url:x,width:e,height:s};const n=i;if(n instanceof HTMLElement){const r=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),c=n.getAttribute("data-rml-ghost-height");o?t=o:!o&&n instanceof HTMLImageElement&&n.src&&(t=n.src),t?(e=r.width,s=r.height):t=x,e=a?parseInt(a,10):e,s=c?parseInt(c,10):s}return{url:t||x,width:e,height:s}};class Zt{constructor(t,e,s){h(this,"_options",{}),h(this,"_instance"),h(this,"_viewName"),h(this,"_currentCustomDrag",null),h(this,"_currentBb",null),h(this,"_startTarget",null),h(this,"_onBeforeUpdateDrag",()=>({})),h(this,"isDragging",!1),this._instance=t,this._options=e||{},this._viewName=s}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(W,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",k),this._startTarget.addEventListener("dragstart",k)),this._currentBb=await this._instance.getBoundingClientRect(Vt(this._viewName));const{clientX:n,clientY:r}=b(e),o=this._currentBb.x+n,a=this._currentBb.y+r;this.isDragging=!0,this._instance.dragInObject(t,o,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=b(t),{url:n,width:r,height:o}=Qt(this._startTarget),a=this._currentBb.x+e,c=this._currentBb.y+s,l=this._options||{},d={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:n,width:r,height:o},mode:"custom-view"},{x:u,y:g,options:_}=this._onBeforeUpdateDrag(a,c,d),y=typeof u=="number"?u:a,w=typeof g=="number"?g:c,v=_||d;this._instance.updateDrag(y,w,v)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,e,s){this._instance.disableEvents(),this._startTarget=e.target;const n=(r,o)=>{this._dragStart(t,o,s)};this._currentCustomDrag=f(e)?new mt(Kt,{onTouchDragStart:n},ft(e,this._options)):new Jt({onCustomDragStart:r=>this._dragStart(t,r,s)},ft(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(W)==="true",this._startTarget.removeAttribute(W),this._startTarget.removeEventListener("dragstart",k))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const te=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Zt},Symbol.toStringTag,{value:"Module"}));return Pt});
@@ -6,6 +6,9 @@ export default class EventEmitter {
6
6
  emit<T>(event: string, data?: T): void;
7
7
  on<T>(event: string, callback: EventCallback<T>): void;
8
8
  off<T>(event: string, callback: EventCallback<T>): void;
9
- getEventsDataMap(): EventsDataMap<any>;
9
+ getEventsDataMap(): EventsDataMap<{
10
+ data: any;
11
+ timestamp: number;
12
+ }>;
10
13
  }
11
14
  export {};