react-image-gallery 1.2.12 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +170 -162
- package/build/image-gallery.es.js +1 -0
- package/build/image-gallery.js +1 -1
- package/build/image-gallery.umd.js +1 -0
- package/package.json +63 -41
- package/styles/css/image-gallery.css +1 -1
- package/styles/scss/image-gallery.scss +81 -20
- package/.babelrc +0 -1
- package/.eslintrc.json +0 -24
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -39
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.notes +0 -2
- package/src/ImageGallery.js +0 -1664
- package/src/Item.js +0 -79
- package/src/SVG.js +0 -65
- package/src/SwipeWrapper.js +0 -45
- package/src/controls/Fullscreen.js +0 -29
- package/src/controls/LeftNav.js +0 -30
- package/src/controls/PlayPause.js +0 -29
- package/src/controls/RightNav.js +0 -30
- package/tests/ImageGallery.test.js +0 -15
- package/tests/__snapshots__/ImageGallery.test.js.snap +0 -3
- package/tests/setupTestFramework.js +0 -4
- package/webpack.build.js +0 -172
- package/webpack.config.js +0 -49
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
React Image Gallery
|
|
2
|
-
===
|
|
1
|
+
# React Image Gallery
|
|
3
2
|
|
|
4
3
|
[](https://badge.fury.io/js/react-image-gallery)
|
|
5
4
|
[](https://www.npmjs.com/package/react-image-gallery)
|
|
6
5
|
[](https://bundlephobia.com/package/react-image-gallery)
|
|
7
6
|
|
|
8
7
|
### Live Demo (try it on mobile for swipe support)
|
|
8
|
+
|
|
9
9
|
[`linxtion.com/demo/react-image-gallery`](http://linxtion.com/demo/react-image-gallery)
|
|
10
10
|
|
|
11
11
|

|
|
@@ -14,13 +14,13 @@ React image gallery is a React component for building image galleries and carous
|
|
|
14
14
|
|
|
15
15
|
## Features
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
- Mobile swipe gestures
|
|
18
|
+
- Thumbnail navigation
|
|
19
|
+
- Fullscreen support
|
|
20
|
+
- Custom rendered slides
|
|
21
|
+
- RTL support
|
|
22
|
+
- Responsive design
|
|
23
|
+
- Tons of customization options (see props below)
|
|
24
24
|
|
|
25
25
|
## Getting started
|
|
26
26
|
|
|
@@ -30,32 +30,40 @@ React Image Gallery requires **React 16.0.0 or later.**
|
|
|
30
30
|
npm install react-image-gallery
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
### Style import
|
|
33
|
+
### Style import options
|
|
34
|
+
|
|
34
35
|
```
|
|
35
|
-
#
|
|
36
|
+
# scss file import
|
|
36
37
|
@import "~react-image-gallery/styles/scss/image-gallery.scss";
|
|
37
38
|
|
|
38
|
-
#
|
|
39
|
+
# css file import
|
|
39
40
|
@import "~react-image-gallery/styles/css/image-gallery.css";
|
|
41
|
+
|
|
42
|
+
# js file import (using webpack)
|
|
43
|
+
import "react-image-gallery/styles/css/image-gallery.css";
|
|
40
44
|
```
|
|
41
45
|
|
|
42
46
|
### Example
|
|
43
|
-
|
|
47
|
+
|
|
48
|
+
Need more example? See [`example/App.jsx`](https://github.com/xiaolin/react-image-gallery/blob/master/example/App.jsx)
|
|
49
|
+
|
|
44
50
|
```js
|
|
45
|
-
import ImageGallery from
|
|
51
|
+
import ImageGallery from "react-image-gallery";
|
|
52
|
+
// import stylesheet if you're not already using CSS @import
|
|
53
|
+
import "react-image-gallery/styles/css/image-gallery.css";
|
|
46
54
|
|
|
47
55
|
const images = [
|
|
48
56
|
{
|
|
49
|
-
original:
|
|
50
|
-
thumbnail:
|
|
57
|
+
original: "https://picsum.photos/id/1018/1000/600/",
|
|
58
|
+
thumbnail: "https://picsum.photos/id/1018/250/150/",
|
|
51
59
|
},
|
|
52
60
|
{
|
|
53
|
-
original:
|
|
54
|
-
thumbnail:
|
|
61
|
+
original: "https://picsum.photos/id/1015/1000/600/",
|
|
62
|
+
thumbnail: "https://picsum.photos/id/1015/250/150/",
|
|
55
63
|
},
|
|
56
64
|
{
|
|
57
|
-
original:
|
|
58
|
-
thumbnail:
|
|
65
|
+
original: "https://picsum.photos/id/1019/1000/600/",
|
|
66
|
+
thumbnail: "https://picsum.photos/id/1019/250/150/",
|
|
59
67
|
},
|
|
60
68
|
];
|
|
61
69
|
|
|
@@ -68,174 +76,174 @@ class MyGallery extends React.Component {
|
|
|
68
76
|
|
|
69
77
|
# Props
|
|
70
78
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
* `swipeThreshold`: Number, default `30`
|
|
134
|
-
* A percentage of how far the offset of the current slide is swiped to trigger a slide event.
|
|
79
|
+
- `items`: (required) Array of objects, see example above,
|
|
80
|
+
- Available Properties
|
|
81
|
+
- `original` - image src url
|
|
82
|
+
- `thumbnail` - image thumbnail src url
|
|
83
|
+
- `fullscreen` - image for fullscreen (defaults to original)
|
|
84
|
+
- `originalHeight` - image height (html5 attribute)
|
|
85
|
+
- `originalWidth` - image width (html5 attribute)
|
|
86
|
+
- `loading` - image loading. Either "lazy" or "eager" (html5 attribute)
|
|
87
|
+
- `thumbnailHeight` - image height (html5 attribute)
|
|
88
|
+
- `thumbnailWidth` - image width (html5 attribute)
|
|
89
|
+
- `thumbnailLoading` - image loading. Either "lazy" or "eager" (html5 attribute)
|
|
90
|
+
- `originalClass` - custom image class
|
|
91
|
+
- `thumbnailClass` - custom thumbnail class
|
|
92
|
+
- `renderItem` - Function for custom rendering a specific slide (see renderItem below)
|
|
93
|
+
- `renderThumbInner` - Function for custom thumbnail renderer (see renderThumbInner below)
|
|
94
|
+
- `originalAlt` - image alt
|
|
95
|
+
- `thumbnailAlt` - thumbnail image alt
|
|
96
|
+
- `originalTitle` - image title
|
|
97
|
+
- `thumbnailTitle` - thumbnail image title
|
|
98
|
+
- `thumbnailLabel` - label for thumbnail
|
|
99
|
+
- `description` - description for image
|
|
100
|
+
- `srcSet` - image srcset (html5 attribute)
|
|
101
|
+
- `sizes` - image sizes (html5 attribute)
|
|
102
|
+
- `bulletClass` - extra class for the bullet of the item
|
|
103
|
+
- `infinite`: Boolean, default `true`
|
|
104
|
+
- infinite sliding
|
|
105
|
+
- `lazyLoad`: Boolean, default `false`
|
|
106
|
+
- `showNav`: Boolean, default `true`
|
|
107
|
+
- `showThumbnails`: Boolean, default `true`
|
|
108
|
+
- `thumbnailPosition`: String, default `bottom`
|
|
109
|
+
- available positions: `top, right, bottom, left`
|
|
110
|
+
- `showFullscreenButton`: Boolean, default `true`
|
|
111
|
+
- `useBrowserFullscreen`: Boolean, default `true`
|
|
112
|
+
- if false, fullscreen will be done via css within the browser
|
|
113
|
+
- `useTranslate3D`: Boolean, default `true`
|
|
114
|
+
- if false, will use `translate` instead of `translate3d` css property to transition slides
|
|
115
|
+
- `showPlayButton`: Boolean, default `true`
|
|
116
|
+
- `isRTL`: Boolean, default `false`
|
|
117
|
+
- if true, gallery's direction will be from right-to-left (to support right-to-left languages)
|
|
118
|
+
- `showBullets`: Boolean, default `false`
|
|
119
|
+
- `showIndex`: Boolean, default `false`
|
|
120
|
+
- `autoPlay`: Boolean, default `false`
|
|
121
|
+
- `disableThumbnailScroll`: Boolean, default `false`
|
|
122
|
+
- disables the thumbnail container from adjusting
|
|
123
|
+
- `disableKeyDown`: Boolean, default `false`
|
|
124
|
+
- disables keydown listener for keyboard shortcuts (left arrow, right arrow, esc key)
|
|
125
|
+
- `disableSwipe`: Boolean, default `false`
|
|
126
|
+
- `disableThumbnailSwipe`: Boolean, default `false`
|
|
127
|
+
- `onErrorImageURL`: String, default `undefined`
|
|
128
|
+
- an image src pointing to your default image if an image fails to load
|
|
129
|
+
- handles both slide image, and thumbnail image
|
|
130
|
+
- `indexSeparator`: String, default `' / '`, ignored if `showIndex` is false
|
|
131
|
+
- `slideDuration`: Number, default `450`
|
|
132
|
+
- transition duration during image slide in milliseconds
|
|
133
|
+
- `swipingTransitionDuration`: Number, default `0`
|
|
134
|
+
- transition duration while swiping in milliseconds
|
|
135
|
+
- `slideInterval`: Number, default `3000`
|
|
136
|
+
- `slideOnThumbnailOver`: Boolean, default `false`
|
|
137
|
+
- `flickThreshold`: Number (float), default `0.4`
|
|
138
|
+
- Determines the max velocity of a swipe before it's considered a flick (lower = more sensitive)
|
|
139
|
+
- `swipeThreshold`: Number, default `30`
|
|
140
|
+
- A percentage of how far the offset of the current slide is swiped to trigger a slide event.
|
|
135
141
|
e.g. If the current slide is swiped less than 30% to the left or right, it will not trigger a slide event.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
142
|
+
- `stopPropagation`: Boolean, default `false`
|
|
143
|
+
- Automatically calls stopPropagation on all 'swipe' events.
|
|
144
|
+
- `startIndex`: Number, default `0`
|
|
145
|
+
- `onImageError`: Function, `callback(event)`
|
|
146
|
+
- overrides onErrorImage
|
|
147
|
+
- `onThumbnailError`: Function, `callback(event)`
|
|
148
|
+
- overrides onErrorImage
|
|
149
|
+
- `onThumbnailClick`: Function, `callback(event, index)`
|
|
150
|
+
- `onBulletClick`: Function, `callback(event, index)`
|
|
151
|
+
- `onImageLoad`: Function, `callback(event)`
|
|
152
|
+
- `onSlide`: Function, `callback(currentIndex)`
|
|
153
|
+
- `onBeforeSlide`: Function, `callback(nextIndex)`
|
|
154
|
+
- `onScreenChange`: Function, `callback(boolean)`
|
|
155
|
+
- When fullscreen is toggled a boolean is passed to the callback
|
|
156
|
+
- `onPause`: Function, `callback(currentIndex)`
|
|
157
|
+
- `onPlay`: Function, `callback(currentIndex)`
|
|
158
|
+
- `onClick`: Function, `callback(event)`
|
|
159
|
+
- `onTouchMove`: Function, `callback(event) on gallery slide`
|
|
160
|
+
- `onTouchEnd`: Function, `callback(event) on gallery slide`
|
|
161
|
+
- `onTouchStart`: Function, `callback(event) on gallery slide`
|
|
162
|
+
- `onMouseOver`: Function, `callback(event) on gallery slide`
|
|
163
|
+
- `onMouseLeave`: Function, `callback(event) on gallery slide`
|
|
164
|
+
- `additionalClass`: String,
|
|
165
|
+
- Additional class that will be added to the root node of the component.
|
|
166
|
+
- `renderCustomControls`: Function, custom controls rendering
|
|
167
|
+
- Use this to render custom controls or other elements on the currently displayed image (like the fullscreen button)
|
|
161
168
|
```javascript
|
|
162
169
|
_renderCustomControls() {
|
|
163
170
|
return <a href='' className='image-gallery-custom-action' onClick={this._customAction.bind(this)}/>
|
|
164
171
|
}
|
|
165
172
|
```
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
173
|
+
- `renderItem`: Function, custom item rendering
|
|
174
|
+
- NOTE: Highly suggest looking into a render cache such as React.memo if you plan to override renderItem
|
|
175
|
+
- On a specific item `[{thumbnail: '...', renderItem: this.myRenderItem}]`
|
|
176
|
+
- As a prop passed into `ImageGallery` to completely override `renderItem`, see source for renderItem implementation
|
|
177
|
+
- `renderThumbInner`: Function, custom thumbnail rendering
|
|
178
|
+
|
|
179
|
+
- On a specific item `[{thumbnail: '...', renderThumbInner: this.myRenderThumbInner}]`
|
|
180
|
+
- As a prop passed into `ImageGallery` to completely override `_renderThumbInner`, see source for reference
|
|
181
|
+
|
|
182
|
+
- `renderLeftNav`: Function, custom left nav component
|
|
183
|
+
- See [`<LeftNav />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/LeftNav.js)
|
|
184
|
+
- Use this to render a custom left nav control
|
|
185
|
+
- Args:
|
|
186
|
+
- `onClick` callback that will slide to the previous item
|
|
187
|
+
- `disabled` boolean for when the nav is disabled
|
|
180
188
|
```javascript
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
renderLeftNav: (onClick, disabled) => (
|
|
190
|
+
<LeftNav onClick={onClick} disabled={disabled} />
|
|
191
|
+
);
|
|
184
192
|
```
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
193
|
+
- `renderRightNav`: Function, custom right nav component
|
|
194
|
+
- See [`<RightNav />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/RightNav.js)
|
|
195
|
+
- Use this to render a custom right nav control
|
|
196
|
+
- Args:
|
|
197
|
+
- `onClick` callback that will slide to the next item
|
|
198
|
+
- `disabled` boolean for when the nav is disabled
|
|
191
199
|
```javascript
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
renderRightNav: (onClick, disabled) => (
|
|
201
|
+
<RightNav onClick={onClick} disabled={disabled} />
|
|
202
|
+
);
|
|
195
203
|
```
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
204
|
+
- `renderPlayPauseButton`: Function, play pause button component
|
|
205
|
+
- See [`<PlayPause />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/PlayPause.js)
|
|
206
|
+
- Use this to render a custom play pause button
|
|
207
|
+
- Args:
|
|
208
|
+
- `onClick` callback that will toggle play/pause
|
|
209
|
+
- `isPlaying` boolean for when gallery is playing
|
|
202
210
|
```javascript
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
211
|
+
renderPlayPauseButton: (onClick, isPlaying) => (
|
|
212
|
+
<PlayPause onClick={onClick} isPlaying={isPlaying} />
|
|
213
|
+
);
|
|
206
214
|
```
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
215
|
+
- `renderFullscreenButton`: Function, custom fullscreen button component
|
|
216
|
+
- See [`<Fullscreen />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/Fullscreen.js)
|
|
217
|
+
- Use this to render a custom fullscreen button
|
|
218
|
+
- Args:
|
|
219
|
+
- `onClick` callback that will toggle fullscreen
|
|
220
|
+
- `isFullscreen` argument for when fullscreen is active
|
|
213
221
|
```javascript
|
|
214
222
|
renderFullscreenButton: (onClick, isFullscreen) => (
|
|
215
223
|
<Fullscreen onClick={onClick} isFullscreen={isFullscreen} />
|
|
216
224
|
),
|
|
217
225
|
```
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
226
|
+
- `useWindowKeyDown`: Boolean, default `true`
|
|
227
|
+
- If `true`, listens to keydown events on window (window.addEventListener)
|
|
228
|
+
- If `false`, listens to keydown events on image gallery element (imageGalleryElement.addEventListener)
|
|
221
229
|
|
|
222
230
|
# Functions
|
|
223
231
|
|
|
224
232
|
The following functions can be accessed using [refs](https://reactjs.org/docs/refs-and-the-dom.html)
|
|
225
233
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
234
|
+
- `play()`: plays the slides
|
|
235
|
+
- `pause()`: pauses the slides
|
|
236
|
+
- `toggleFullScreen()`: toggles full screen
|
|
237
|
+
- `slideToIndex(index)`: slides to a specific index
|
|
238
|
+
- `getCurrentIndex()`: returns the current index
|
|
231
239
|
|
|
232
240
|
# Contributing
|
|
233
241
|
|
|
234
|
-
Each PR should be specific and isolated to the issue you're trying to fix. Please do not stack features
|
|
242
|
+
Each pull request (PR) should be specific and isolated to the issue you're trying to fix. Please do not stack features, chores, refactors, or enhancements in one PR. Describe your feature/implementation in the PR. If you're unsure whether it's useful or if it involves a major change, please open an issue first and seek feedback.
|
|
235
243
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
244
|
+
- Follow eslint provided
|
|
245
|
+
- Comment your code
|
|
246
|
+
- Write [clean](https://github.com/ryanmcdermott/clean-code-javascript) code
|
|
239
247
|
|
|
240
248
|
# Build the example locally (requires node >= 12.13)
|
|
241
249
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";var t={694:(e,t,n)=>{var i=n(925);function r(){}function a(){}a.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:r};return n.PropTypes=n,n}},556:(e,t,n)=>{e.exports=n(694)()},925:e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},115:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,i="function"==typeof Set,r="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){if(e.constructor!==o.constructor)return!1;var s,l,u,c;if(Array.isArray(e)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(!a(e[l],o[l]))return!1;return!0}if(n&&e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!a(l.value[1],o.get(l.value[0])))return!1;return!0}if(i&&e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(o)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(e[l]!==o[l])return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof o.valueOf)return e.valueOf()===o.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof o.toString)return e.toString()===o.toString();if((s=(u=Object.keys(e)).length)!==Object.keys(o).length)return!1;for(l=s;0!=l--;)if(!Object.prototype.hasOwnProperty.call(o,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=s;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!a(e[u[l]],o[u[l]]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return a(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};function a(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=a(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}i.d(r,{A:()=>ut});const o=function(){for(var e,t,n=0,i="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=a(e))&&(i&&(i+=" "),i+=t);return i},s=(l={default:()=>e.default,useMemo:()=>e.useMemo,useRef:()=>e.useRef},u={},i.d(u,l),u);var l,u;const c=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},h="object"==typeof global&&global&&global.Object===Object&&global;var d="object"==typeof self&&self&&self.Object===Object&&self;const f=h||d||Function("return this")(),p=function(){return f.Date.now()};var m=/\s/;var b=/^\s+/;const g=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&m.test(e.charAt(t)););return t}(e)+1).replace(b,""):e},v=f.Symbol;var y=Object.prototype,w=y.hasOwnProperty,S=y.toString,T=v?v.toStringTag:void 0;var O=Object.prototype.toString;var E=v?v.toStringTag:void 0;const k=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?function(e){var t=w.call(e,T),n=e[T];try{e[T]=void 0;var i=!0}catch(e){}var r=S.call(e);return i&&(t?e[T]=n:delete e[T]),r}(e):function(e){return O.call(e)}(e)};var I=/^[-+]0x[0-9a-f]+$/i,x=/^0b[01]+$/i,P=/^0o[0-7]+$/i,j=parseInt;const _=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==k(e)}(e))return NaN;if(c(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=c(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=g(e);var n=x.test(e);return n||P.test(e)?j(e.slice(2),n?2:8):I.test(e)?NaN:+e};var R=Math.max,L=Math.min;const M=function(e,t,n){var i,r,a,o,s,l,u=0,h=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=i,a=r;return i=r=void 0,u=t,o=e.apply(a,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=a}function g(){var e=p();if(b(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?L(n,a-(e-u)):n}(e))}function v(e){return s=void 0,f&&i?m(e):(i=r=void 0,o)}function y(){var e=p(),n=b(e);if(i=arguments,r=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),h?m(e):o}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),m(l)}return void 0===s&&(s=setTimeout(g,t)),o}return t=_(t)||0,c(n)&&(h=!!n.leading,a=(d="maxWait"in n)?R(_(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,i=l=r=s=void 0},y.flush=function(){return void 0===s?o:v(p())},y},D=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return c(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),M(e,t,{leading:i,maxWait:t,trailing:r})};var C=i(115),W=i.n(C),N=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];e.call(t,r[1],r[0])}},t}()}(),F="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,z=void 0!==i.g&&i.g.Math===Math?i.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),B="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(z):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},A=["top","right","bottom","left","width","height","size","weight"],U="undefined"!=typeof MutationObserver,q=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e){var t=!1,n=!1,i=0;function r(){t&&(t=!1,e()),n&&o()}function a(){B(r)}function o(){var e=Date.now();if(t){if(e-i<2)return;n=!0}else t=!0,n=!1,setTimeout(a,20);i=e}return o}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){F&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),U?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){F&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;A.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),G=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},H=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||z},V=J(0,0,0,0);function K(e){return parseFloat(e)||0}function X(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+K(e["border-"+n+"-width"])}),0)}var Y="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof H(e).SVGGraphicsElement}:function(e){return e instanceof H(e).SVGElement&&"function"==typeof e.getBBox};function $(e){return F?Y(e)?function(e){var t=e.getBBox();return J(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return V;var i=H(e).getComputedStyle(e),r=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var r=i[n],a=e["padding-"+r];t[r]=K(a)}return t}(i),a=r.left+r.right,o=r.top+r.bottom,s=K(i.width),l=K(i.height);if("border-box"===i.boxSizing&&(Math.round(s+a)!==t&&(s-=X(i,"left","right")+a),Math.round(l+o)!==n&&(l-=X(i,"top","bottom")+o)),!function(e){return e===H(e).document.documentElement}(e)){var u=Math.round(s+a)-t,c=Math.round(l+o)-n;1!==Math.abs(u)&&(s-=u),1!==Math.abs(c)&&(l-=c)}return J(r.left,r.top,s,l)}(e):V}function J(e,t,n,i){return{x:e,y:t,width:n,height:i}}var Q=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=J(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=$(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),Z=function(e,t){var n=function(e){var t=e.x,n=e.y,i=e.width,r=e.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype);return G(o,{x:t,y:n,width:i,height:r,top:n,right:t+i,bottom:r+n,left:t}),o}(t);G(this,{target:e,contentRect:n})},ee=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new N,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof H(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Q(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof H(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new Z(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),te="undefined"!=typeof WeakMap?new WeakMap:new N,ne=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=q.getInstance(),i=new ee(t,n,this);te.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){ne.prototype[e]=function(){var t;return(t=te.get(this))[e].apply(t,arguments)}}));const ie=void 0!==z.ResizeObserver?z.ResizeObserver:ne,re="Left",ae="Right",oe="Up",se="Down",le={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},ue={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},ce="mousemove",he="mouseup";function de(e,t){if(0===t)return e;const n=Math.PI/180*t;return[e[0]*Math.cos(n)+e[1]*Math.sin(n),e[1]*Math.cos(n)-e[0]*Math.sin(n)]}function fe(e){const{trackMouse:t}=e,n=s.useRef(Object.assign({},ue)),i=s.useRef(Object.assign({},le)),r=s.useRef(Object.assign({},i.current));let a;for(a in r.current=Object.assign({},i.current),i.current=Object.assign(Object.assign({},le),e),le)void 0===i.current[a]&&(i.current[a]=le[a]);const[o,l]=s.useMemo((()=>function(e,t){const n=t=>{const n="touches"in t;n&&t.touches.length>1||e(((e,r)=>{r.trackMouse&&!n&&(document.addEventListener(ce,i),document.addEventListener(he,a));const{clientX:o,clientY:s}=n?t.touches[0]:t,l=de([o,s],r.rotationAngle);return r.onTouchStartOrOnMouseDown&&r.onTouchStartOrOnMouseDown({event:t}),Object.assign(Object.assign(Object.assign({},e),ue),{initial:l.slice(),xy:l,start:t.timeStamp||0})}))},i=t=>{e(((e,n)=>{const i="touches"in t;if(i&&t.touches.length>1)return e;if(t.timeStamp-e.start>n.swipeDuration)return e.swiping?Object.assign(Object.assign({},e),{swiping:!1}):e;const{clientX:r,clientY:a}=i?t.touches[0]:t,[o,s]=de([r,a],n.rotationAngle),l=o-e.xy[0],u=s-e.xy[1],c=Math.abs(l),h=Math.abs(u),d=(t.timeStamp||0)-e.start,f=Math.sqrt(c*c+h*h)/(d||1),p=[l/(d||1),u/(d||1)],m=function(e,t,n,i){return e>t?n>0?ae:re:i>0?se:oe}(c,h,l,u),b="number"==typeof n.delta?n.delta:n.delta[m.toLowerCase()]||le.delta;if(c<b&&h<b&&!e.swiping)return e;const g={absX:c,absY:h,deltaX:l,deltaY:u,dir:m,event:t,first:e.first,initial:e.initial,velocity:f,vxvy:p};g.first&&n.onSwipeStart&&n.onSwipeStart(g),n.onSwiping&&n.onSwiping(g);let v=!1;return(n.onSwiping||n.onSwiped||n[`onSwiped${m}`])&&(v=!0),v&&n.preventScrollOnSwipe&&n.trackTouch&&t.cancelable&&t.preventDefault(),Object.assign(Object.assign({},e),{first:!1,eventData:g,swiping:!0})}))},r=t=>{e(((e,n)=>{let i;if(e.swiping&&e.eventData){if(t.timeStamp-e.start<n.swipeDuration){i=Object.assign(Object.assign({},e.eventData),{event:t}),n.onSwiped&&n.onSwiped(i);const r=n[`onSwiped${i.dir}`];r&&r(i)}}else n.onTap&&n.onTap({event:t});return n.onTouchEndOrOnMouseUp&&n.onTouchEndOrOnMouseUp({event:t}),Object.assign(Object.assign(Object.assign({},e),ue),{eventData:i})}))},a=e=>{document.removeEventListener(ce,i),document.removeEventListener(he,a),r(e)},o=(e,t)=>{let a=()=>{};if(e&&e.addEventListener){const o=Object.assign(Object.assign({},le.touchEventOptions),t.touchEventOptions),s=[["touchstart",n,o],["touchmove",i,Object.assign(Object.assign({},o),t.preventScrollOnSwipe?{passive:!1}:{})],["touchend",r,o]];s.forEach((([t,n,i])=>e.addEventListener(t,n,i))),a=()=>s.forEach((([t,n])=>e.removeEventListener(t,n)))}return a},s={ref:t=>{null!==t&&e(((e,n)=>{if(e.el===t)return e;const i={};return e.el&&e.el!==t&&e.cleanUpTouch&&(e.cleanUpTouch(),i.cleanUpTouch=void 0),n.trackTouch&&t&&(i.cleanUpTouch=o(t,n)),Object.assign(Object.assign(Object.assign({},e),{el:t}),i)}))}};return t.trackMouse&&(s.onMouseDown=n),[s,o]}((e=>n.current=e(n.current,i.current)),{trackMouse:t})),[t]);return n.current=function(e,t,n,i){return t.trackTouch&&e.el?e.cleanUpTouch?t.preventScrollOnSwipe!==n.preventScrollOnSwipe||t.touchEventOptions.passive!==n.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:i(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:i(e.el,t)}):(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0}))}(n.current,i.current,r.current,l),o}var pe=i(556);function me(e){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(e)}function be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?be(Object(n),!0).forEach((function(t){ve(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ve(e,t,n){return(t=function(e){var t=function(e){if("object"!=me(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==me(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ye={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},we=s.default.memo((function(e){var t=ge(ge({},ye),e),n=t.description,i=t.fullscreen,r=t.handleImageLoaded,a=t.isFullscreen,o=t.onImageError,l=t.original,u=t.originalAlt,c=t.originalHeight,h=t.originalWidth,d=t.originalTitle,f=t.sizes,p=t.srcSet,m=t.loading,b=a&&i||l;return s.default.createElement(s.default.Fragment,null,s.default.createElement("img",{className:"image-gallery-image",src:b,alt:u,srcSet:p,height:c,width:h,sizes:f,title:d,onLoad:function(e){return r(e,l)},onError:o,loading:m}),n&&s.default.createElement("span",{className:"image-gallery-description"},n))}));we.displayName="Item",we.propTypes={description:pe.string,fullscreen:pe.string,handleImageLoaded:pe.func.isRequired,isFullscreen:pe.bool,onImageError:pe.func.isRequired,original:pe.string.isRequired,originalAlt:pe.string,originalHeight:pe.string,originalWidth:pe.string,originalTitle:pe.string,sizes:pe.string,srcSet:pe.string,loading:pe.string};const Se=we;function Te(e){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(e)}function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach((function(t){ke(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ke(e,t,n){return(t=function(e){var t=function(e){if("object"!=Te(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Te(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ie={left:s.default.createElement("polyline",{points:"15 18 9 12 15 6"}),right:s.default.createElement("polyline",{points:"9 18 15 12 9 6"}),top:s.default.createElement("polyline",{points:"6 15 12 9 18 15"}),bottom:s.default.createElement("polyline",{points:"6 9 12 15 18 9"}),maximize:s.default.createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:s.default.createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:s.default.createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:s.default.createElement(s.default.Fragment,null,s.default.createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),s.default.createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},xe={strokeWidth:1,viewBox:"0 0 24 24"},Pe=function(e){var t=Ee(Ee({},xe),e),n=t.strokeWidth,i=t.viewBox,r=t.icon;return s.default.createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:i,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"},Ie[r])};Pe.propTypes={strokeWidth:pe.number,viewBox:pe.string,icon:(0,pe.oneOf)(["left","right","top","bottom","maximize","minimize","play","pause"]).isRequired};const je=Pe;var _e=s.default.memo((function(e){var t=e.isFullscreen,n=e.onClick;return s.default.createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:n,"aria-label":"Open Fullscreen"},s.default.createElement(je,{strokeWidth:2,icon:t?"minimize":"maximize"}))}));_e.displayName="Fullscreen",_e.propTypes={isFullscreen:pe.bool.isRequired,onClick:pe.func.isRequired};const Re=_e;var Le=s.default.memo((function(e){var t=e.disabled,n=e.onClick;return s.default.createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:t,onClick:n,"aria-label":"Previous Slide"},s.default.createElement(je,{icon:"left",viewBox:"6 0 12 24"}))}));Le.displayName="LeftNav",Le.propTypes={disabled:pe.bool.isRequired,onClick:pe.func.isRequired};const Me=Le;var De=s.default.memo((function(e){var t=e.disabled,n=e.onClick;return s.default.createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:t,onClick:n,"aria-label":"Next Slide"},s.default.createElement(je,{icon:"right",viewBox:"6 0 12 24"}))}));De.displayName="RightNav",De.propTypes={disabled:pe.bool.isRequired,onClick:pe.func.isRequired};const Ce=De;var We=s.default.memo((function(e){var t=e.isPlaying,n=e.onClick;return s.default.createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:n,"aria-label":"Play or Pause Slideshow"},s.default.createElement(je,{strokeWidth:2,icon:t?"pause":"play"}))}));We.displayName="PlayPause",We.propTypes={isPlaying:pe.bool.isRequired,onClick:pe.func.isRequired};const Ne=We;function Fe(e){return Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fe(e)}function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ze.apply(null,arguments)}function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach((function(t){Ue(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ue(e,t,n){return(t=function(e){var t=function(e){if("object"!=Fe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fe(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qe={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Ge=function(e){var t=Ae(Ae({},qe),e),n=t.children,i=t.className,r=fe({delta:t.delta,onSwiping:t.onSwiping,onSwiped:t.onSwiped});return s.default.createElement("div",ze({},r,{className:i}),n)};Ge.propTypes={children:pe.node.isRequired,className:pe.string,delta:pe.number,onSwiped:pe.func,onSwiping:pe.func};const He=Ge;var Ve=s.default.memo((function(e){var t=e.disabled,n=e.onClick;return s.default.createElement("button",{type:"button",className:"image-gallery-icon image-gallery-top-nav",disabled:t,onClick:n,"aria-label":"Previous Slide"},s.default.createElement(je,{icon:"top",viewBox:"6 0 12 24"}))}));Ve.displayName="TopNav",Ve.propTypes={disabled:pe.bool.isRequired,onClick:pe.func.isRequired};const Ke=Ve;var Xe=s.default.memo((function(e){var t=e.disabled,n=e.onClick;return s.default.createElement("button",{type:"button",className:"image-gallery-icon image-gallery-bottom-nav",disabled:t,onClick:n,"aria-label":"Next Slide"},s.default.createElement(je,{icon:"bottom",viewBox:"6 0 12 24"}))}));Xe.displayName="BottomNav",Xe.propTypes={disabled:pe.bool.isRequired,onClick:pe.func.isRequired};const Ye=Xe;function $e(e){return $e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$e(e)}function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ze(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,rt(i.key),i)}}function et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(et=function(){return!!e})()}function tt(e){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tt(e)}function nt(e,t){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nt(e,t)}function it(e,t,n){return(t=rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rt(e){var t=function(e){if("object"!=$e(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=$e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$e(t)?t:t+""}var at=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],ot=(0,pe.arrayOf)((0,pe.shape)({srcSet:pe.string,media:pe.string}));function st(e){var t=parseInt(e.keyCode||e.which||0,10);return 66===t||62===t}var lt=function(){function e(t){var n,i,r,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),it((i=this,a=[t],r=tt(r=e),n=function(e,t){if(t&&("object"==$e(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(i,et()?Reflect.construct(r,a||[],tt(i).constructor):r.apply(i,a))),"onBulletClick",(function(e,t){var i=n.props,r=i.onBulletClick,a=i.items,o=n.state.currentIndex;e.target.blur(),o!==t&&(2===a.length?n.slideToIndexWithStyleReset(t,e):n.slideToIndex(t,e)),r&&r(e,t)})),n.state={currentIndex:t.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,galleryHeight:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(t.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},n.loadedImages={},n.imageGallery=s.default.createRef(),n.thumbnailsWrapper=s.default.createRef(),n.thumbnails=s.default.createRef(),n.imageGallerySlideWrapper=s.default.createRef(),n.handleImageLoaded=n.handleImageLoaded.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.handleMouseDown=n.handleMouseDown.bind(n),n.handleResize=n.handleResize.bind(n),n.handleOnSwiped=n.handleOnSwiped.bind(n),n.handleScreenChange=n.handleScreenChange.bind(n),n.handleSwiping=n.handleSwiping.bind(n),n.handleThumbnailSwiping=n.handleThumbnailSwiping.bind(n),n.handleOnThumbnailSwiped=n.handleOnThumbnailSwiped.bind(n),n.onThumbnailMouseLeave=n.onThumbnailMouseLeave.bind(n),n.handleImageError=n.handleImageError.bind(n),n.pauseOrPlay=n.pauseOrPlay.bind(n),n.renderThumbInner=n.renderThumbInner.bind(n),n.renderItem=n.renderItem.bind(n),n.slideLeft=n.slideLeft.bind(n),n.slideRight=n.slideRight.bind(n),n.toggleFullScreen=n.toggleFullScreen.bind(n),n.togglePlay=n.togglePlay.bind(n),n.unthrottledSlideToIndex=n.slideToIndex,n.slideToIndex=D(n.unthrottledSlideToIndex,t.slideDuration,{trailing:!1}),t.lazyLoad&&(n.lazyLoaded=[]),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nt(e,t)}(e,s.default.Component),function(e,t){return t&&Ze(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoPlay,n=e.useWindowKeyDown;t&&this.play(),n?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,i=n.items,r=n.lazyLoad,a=n.slideDuration,o=n.slideInterval,s=n.startIndex,l=n.thumbnailPosition,u=n.showThumbnails,c=n.useWindowKeyDown,h=this.state,d=h.currentIndex,f=h.isPlaying,p=e.items.length!==i.length,m=!W()(e.items,i),b=e.startIndex!==s,g=e.thumbnailPosition!==l,v=e.showThumbnails!==u;o===e.slideInterval&&a===e.slideDuration||f&&(this.pause(),this.play()),g&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),v&&u&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),v&&!u&&this.removeThumbnailsResizeObserver(),(p||v)&&this.handleResize(),t.currentIndex!==d&&this.slideThumbnailBar(),e.slideDuration!==a&&(this.slideToIndex=D(this.unthrottledSlideToIndex,a,{trailing:!1})),!r||e.lazyLoad&&!m||(this.lazyLoaded=[]),c!==e.useWindowKeyDown&&(c?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(b||m)&&this.setState({currentIndex:s,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var e=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),e?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var e=this,t=this.state,n=t.currentIndex,i=t.isTransitioning,r=this.props,a=r.onSlide,o=r.slideDuration;this.transitionTimer=window.setTimeout((function(){i&&(e.setState({isTransitioning:!i,isSwipingThumbnail:!1}),a&&a(n))}),o+50)}},{key:"onThumbnailClick",value:function(e,t){var n=this.props,i=n.onThumbnailClick,r=n.items,a=this.state.currentIndex;e.target.parentNode.parentNode.blur(),a!==t&&(2===r.length?this.slideToIndexWithStyleReset(t,e):this.slideToIndex(t,e)),i&&i(e,t)}},{key:"onThumbnailMouseOver",value:function(e,t){var n=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout((function(){n.slideToIndex(t),n.pause()}),300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var e=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,e&&this.play()}}},{key:"setThumbsTranslate",value:function(e){this.setState({thumbsTranslate:e})}},{key:"setModalFullscreen",value:function(e){var t=this.props.onScreenChange;this.setState({modalFullscreen:e}),t&&t(e)}},{key:"getThumbsTranslate",value:function(e){var t,n=this.props,i=n.disableThumbnailScroll,r=n.items,a=this.state,o=a.thumbnailsWrapperWidth,s=a.thumbnailsWrapperHeight,l=this.thumbnails&&this.thumbnails.current;if(i)return 0;if(l){if(this.isThumbnailVertical()){if(l.scrollHeight<=s)return 0;t=l.scrollHeight-s}else{if(l.scrollWidth<=o||o<=0)return 0;t=l.scrollWidth-o}return e*(t/(r.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(e){switch(e){case"left":e=" ".concat("image-gallery-thumbnails-left");break;case"right":e=" ".concat("image-gallery-thumbnails-right");break;case"bottom":e=" ".concat("image-gallery-thumbnails-bottom");break;case"top":e=" ".concat("image-gallery-thumbnails-top")}return e}},{key:"getAlignmentClassName",value:function(e){var t=this.state.currentIndex,n=this.props,i=n.infinite,r=n.items,a="",o="image-gallery-left",s="image-gallery-right";switch(e){case t-1:a=" ".concat(o);break;case t:a=" ".concat("image-gallery-center");break;case t+1:a=" ".concat(s)}return r.length>=3&&i&&(0===e&&t===r.length-1?a=" ".concat(s):e===r.length-1&&0===t&&(a=" ".concat(o))),a}},{key:"getTranslateXForTwoSlide",value:function(e){var t=this.state,n=t.currentIndex,i=t.currentSlideOffset,r=t.previousIndex,a=n!==r,o=0===e&&0===r,s=1===e&&1===r,l=0===e&&1===n,u=1===e&&0===n,c=0===i,h=-100*n+100*e+i;return i>0?this.direction="left":i<0&&(this.direction="right"),u&&i>0&&(h=-100+i),l&&i<0&&(h=100+i),a?o&&c&&"left"===this.direction?h=100:s&&c&&"right"===this.direction&&(h=-100):(u&&c&&"left"===this.direction&&(h=-100),l&&c&&"right"===this.direction&&(h=100)),h}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(e){var t=this.state,n=t.currentIndex,i=t.currentSlideOffset,r=t.slideStyle,a=this.props,o=a.infinite,s=a.items,l=a.useTranslate3D,u=a.isRTL,c=a.slideVertically,h=-100*n,d=s.length-1,f=(h+100*e)*(u?-1:1)+i;o&&s.length>2&&(0===n&&e===d?f=-100*(u?-1:1)+i:n===d&&0===e&&(f=100*(u?-1:1)+i)),o&&2===s.length&&(f=this.getTranslateXForTwoSlide(e));var p=c?"translate(0, ".concat(f,"%)"):"translate(".concat(f,"%, 0)");return l&&(p=c?"translate3d(0, ".concat(f,"%, 0)"):"translate3d(".concat(f,"%, 0, 0)")),Qe({display:this.isSlideVisible(e)?"inherit":"none",WebkitTransform:p,MozTransform:p,msTransform:p,OTransform:p,transform:p},r)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var e,t=this.props,n=t.useTranslate3D,i=t.isRTL,r=this.state,a=r.thumbsTranslate,o=r.thumbsStyle,s=i?-1*a:a;return this.isThumbnailVertical()?(e="translate(0, ".concat(a,"px)"),n&&(e="translate3d(0, ".concat(a,"px, 0)"))):(e="translate(".concat(s,"px, 0)"),n&&(e="translate3d(".concat(s,"px, 0, 0)"))),Qe({WebkitTransform:e,MozTransform:e,msTransform:e,OTransform:e,transform:e},o)}},{key:"getSlideItems",value:function(){var e=this,t=this.state.currentIndex,n=this.props,i=n.items,r=n.slideOnThumbnailOver,a=n.onClick,l=n.lazyLoad,u=n.onTouchMove,c=n.onTouchEnd,h=n.onTouchStart,d=n.onMouseOver,f=n.onMouseLeave,p=n.renderItem,m=n.renderThumbInner,b=n.showThumbnails,g=n.showBullets,v=[],y=[],w=[];return i.forEach((function(n,i){var S=e.getAlignmentClassName(i),T=n.originalClass?" ".concat(n.originalClass):"",O=n.thumbnailClass?" ".concat(n.thumbnailClass):"",E=n.renderItem||p||e.renderItem,k=n.renderThumbInner||m||e.renderThumbInner,I=!l||S||e.lazyLoaded[i];I&&l&&!e.lazyLoaded[i]&&(e.lazyLoaded[i]=!0);var x=e.getSlideStyle(i),P=s.default.createElement("div",{"aria-label":"Go to Slide ".concat(i+1),key:"slide-".concat(i),tabIndex:"-1",className:"image-gallery-slide ".concat(S," ").concat(T),style:x,onClick:a,onKeyUp:e.handleSlideKeyUp,onTouchMove:u,onTouchEnd:c,onTouchStart:h,onMouseOver:d,onFocus:d,onMouseLeave:f,role:"button"},I?E(n):s.default.createElement("div",{style:{height:"100%"}}));if(v.push(P),b&&n.thumbnail){var j=o("image-gallery-thumbnail",O,{active:t===i});y.push(s.default.createElement("button",{key:"thumbnail-".concat(i),type:"button",tabIndex:"0","aria-pressed":t===i?"true":"false","aria-label":"Go to Slide ".concat(i+1),className:j,onMouseLeave:r?e.onThumbnailMouseLeave:null,onMouseOver:function(t){return e.handleThumbnailMouseOver(t,i)},onFocus:function(t){return e.handleThumbnailMouseOver(t,i)},onKeyUp:function(t){return e.handleThumbnailKeyUp(t,i)},onClick:function(t){return e.onThumbnailClick(t,i)}},k(n)))}if(g){var _=o("image-gallery-bullet",n.bulletClass,{active:t===i});w.push(s.default.createElement("button",{type:"button",key:"bullet-".concat(i),className:_,onClick:function(t){return e.onBulletClick(t,i)},"aria-pressed":t===i?"true":"false","aria-label":"Go to Slide ".concat(i+1)}))}})),{slides:v,thumbnails:y,bullets:w}}},{key:"ignoreIsTransitioning",value:function(){var e=this.props.items,t=this.state,n=t.previousIndex,i=t.currentIndex,r=e.length-1;return Math.abs(n-i)>1&&!(0===n&&i===r)&&!(n===r&&0===i)}},{key:"isFirstOrLastSlide",value:function(e){return e===this.props.items.length-1||0===e}},{key:"slideIsTransitioning",value:function(e){var t=this.state,n=t.isTransitioning,i=t.previousIndex,r=t.currentIndex;return n&&!(e===i||e===r)}},{key:"isSlideVisible",value:function(e){return!this.slideIsTransitioning(e)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(e)}},{key:"slideThumbnailBar",value:function(){var e=this.state,t=e.currentIndex,n=e.isSwipingThumbnail,i=-this.getThumbsTranslate(t);n||(0===t?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:i,thumbsSwipedTranslate:i}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){var e=this.props,t=e.infinite,n=e.isRTL;return t||(n?this.canSlideNext():this.canSlidePrevious())}},{key:"canSlideRight",value:function(){var e=this.props,t=e.infinite,n=e.isRTL;return t||(n?this.canSlidePrevious():this.canSlideNext())}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(e){var t=e.event,n=e.absX,i=e.absY,r=e.dir,a=this.props,o=a.disableSwipe,s=a.stopPropagation,l=a.swipingTransitionDuration,u=this.state,c=u.galleryWidth,h=u.galleryHeight,d=u.isTransitioning,f=u.swipingUpDown,p=u.swipingLeftRight,m=this.props.slideVertically;if((r!==oe&&r!==se&&!f||p||(f||this.setState({swipingUpDown:!0}),m))&&(r!==re&&r!==ae||p||this.setState({swipingLeftRight:!0}),!o))if(s&&t.preventDefault(),d)this.setState({currentSlideOffset:0});else{if((r===re||r===ae)&&m)return;if((r===oe||r===se)&&!m)return;var b=it(it(it(it({},re,-1),ae,1),oe,-1),se,1)[r],g=n/c*100;m&&(g=i/h*100),Math.abs(g)>=100&&(g=100);var v={transition:"transform ".concat(l,"ms ease-out")};this.setState({currentSlideOffset:b*g,slideStyle:v})}}},{key:"handleThumbnailSwiping",value:function(e){var t=e.event,n=e.absX,i=e.absY,r=e.dir,a=this.props,o=a.stopPropagation,s=a.swipingThumbnailTransitionDuration,l=this.state,u=l.thumbsSwipedTranslate,c=l.thumbnailsWrapperHeight,h=l.thumbnailsWrapperWidth,d=l.swipingUpDown,f=l.swipingLeftRight;if(this.isThumbnailVertical()){if((r===re||r===ae||f)&&!d)return void(f||this.setState({swipingLeftRight:!0}));r!==oe&&r!==se||d||this.setState({swipingUpDown:!0})}else{if((r===oe||r===se||d)&&!f)return void(d||this.setState({swipingUpDown:!0}));r!==re&&r!==ae||f||this.setState({swipingLeftRight:!0})}var p,m,b,g,v,y=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(p=u+(r===se?i:-i),m=y.scrollHeight-c+20,b=Math.abs(p)>m,g=p>20,v=y.scrollHeight<=c):(p=u+(r===ae?n:-n),m=y.scrollWidth-h+20,b=Math.abs(p)>m,g=p>20,v=y.scrollWidth<=h),!v&&(r!==re&&r!==oe||!b)&&(r!==ae&&r!==se||!g)){o&&t.stopPropagation();var w={transition:"transform ".concat(s,"ms ease-out")};this.setState({thumbsTranslate:p,thumbsStyle:w})}}},{key:"handleOnThumbnailSwiped",value:function(){var e=this.state.thumbsTranslate,t=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:e,thumbsStyle:{transition:"all ".concat(t,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var e=this.state.currentSlideOffset,t=this.props.swipeThreshold;return Math.abs(e)>t}},{key:"resetSwipingDirection",value:function(){var e=this.state,t=e.swipingUpDown,n=e.swipingLeftRight;t&&this.setState({swipingUpDown:!1}),n&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(e){var t=e.event,n=e.dir,i=e.velocity,r=this.props,a=r.disableSwipe,o=r.stopPropagation,s=r.flickThreshold,l=this.props.slideVertically;if(!a){var u=this.props.isRTL;o&&t.stopPropagation(),this.resetSwipingDirection();var c=(n===re?1:-1)*(u?-1:1);l&&(c=n===oe?1:-1);var h=l?i>s&&!(n===re||n===ae):i>s&&!(n===oe||n===se);this.handleOnSwipedTo(c,h)}}},{key:"handleOnSwipedTo",value:function(e,t){var n=this.state,i=n.currentIndex,r=n.isTransitioning,a=i;!this.sufficientSwipe()&&!t||r||(a+=e),(-1===e&&!this.canSlideLeft()||1===e&&!this.canSlideRight())&&(a=i),this.unthrottledSlideToIndex(a)}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(e){var t=this.props,n=t.disableKeyDown,i=t.useBrowserFullscreen,r=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!n)switch(parseInt(e.keyCode||e.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(e);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(e);break;case 27:r&&!i&&this.exitFullScreen()}}},{key:"handleImageError",value:function(e){var t=this.props.onErrorImageURL;t&&-1===e.target.src.indexOf(t)&&(e.target.src=t)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var e=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth,galleryHeight:this.imageGallery.current.offsetHeight}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(e)))}},{key:"initSlideWrapperResizeObserver",value:function(e){var t=this;e&&!e.current||(this.resizeSlideWrapperObserver=new ie(M((function(e){e&&e.forEach((function(e){t.setState({thumbnailsWrapperWidth:e.contentRect.width},t.handleResize)}))}),50)),this.resizeSlideWrapperObserver.observe(e.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(e){var t=this;e&&!e.current||(this.resizeThumbnailWrapperObserver=new ie(M((function(e){e&&e.forEach((function(e){t.setState({thumbnailsWrapperHeight:e.contentRect.height},t.handleResize)}))}),50)),this.resizeThumbnailWrapperObserver.observe(e.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var e=this.props,t=e.onScreenChange,n=e.useBrowserFullscreen,i=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,r=this.imageGallery.current===i;t&&t(r),n&&this.setState({isFullscreen:r})}},{key:"slideToIndex",value:function(e,t){var n=this.state,i=n.currentIndex,r=n.isTransitioning,a=this.props,o=a.items,s=a.slideDuration,l=a.onBeforeSlide;if(!r){t&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var u=o.length-1,c=e;e<0?c=u:e>u&&(c=0),l&&c!==i&&l(c),this.setState({previousIndex:i,currentIndex:c,isTransitioning:c!==i,currentSlideOffset:0,slideStyle:{transition:"all ".concat(s,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(e){var t=this.props.isRTL;this.slideTo(e,t?"right":"left")}},{key:"slideRight",value:function(e){var t=this.props.isRTL;this.slideTo(e,t?"left":"right")}},{key:"slideTo",value:function(e,t){var n=this.state,i=n.currentIndex,r=n.isTransitioning,a=this.props.items,o=i+("left"===t?-1:1);r||(2===a.length?this.slideToIndexWithStyleReset(o,e):this.slideToIndex(o,e))}},{key:"slideToIndexWithStyleReset",value:function(e,t){var n=this,i=this.state,r=i.currentIndex,a=i.currentSlideOffset;this.setState({currentSlideOffset:a+(r>e?.001:-.001),slideStyle:{transition:"none"}},(function(){window.setTimeout((function(){return n.slideToIndex(e,t)}),25)}))}},{key:"handleThumbnailMouseOver",value:function(e,t){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(e,t)}},{key:"handleThumbnailKeyUp",value:function(e,t){st(e)&&this.onThumbnailClick(e,t)}},{key:"handleSlideKeyUp",value:function(e){st(e)&&(0,this.props.onClick)(e)}},{key:"isThumbnailVertical",value:function(){var e=this.props.thumbnailPosition;return"left"===e||"right"===e}},{key:"addScreenChangeEvent",value:function(){var e=this;at.forEach((function(t){document.addEventListener(t,e.handleScreenChange)}))}},{key:"removeScreenChangeEvent",value:function(){var e=this;at.forEach((function(t){document.removeEventListener(t,e.handleScreenChange)}))}},{key:"fullScreen",value:function(){var e=this.props.useBrowserFullscreen,t=this.imageGallery.current;e?t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var e=this.state.isFullscreen,t=this.props.useBrowserFullscreen;e&&(t?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var e=this.props.infinite,t=this.state.currentIndex;e||this.canSlideRight()?this.slideToIndex(t+1):this.pause()}},{key:"play",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.props,n=t.onPlay,i=t.slideInterval,r=t.slideDuration,a=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(i,r)),n&&e&&n(a))}},{key:"pause",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.props.onPause,n=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),t&&e&&t(n))}},{key:"isImageLoaded",value:function(e){return!!this.loadedImages[e.original]||(this.loadedImages[e.original]=!0,!1)}},{key:"handleImageLoaded",value:function(e,t){var n=this.props.onImageLoad;!this.loadedImages[t]&&n&&(this.loadedImages[t]=!0,n(e))}},{key:"renderItem",value:function(e){var t=this.state.isFullscreen,n=this.props.onImageError||this.handleImageError;return s.default.createElement(Se,{description:e.description,fullscreen:e.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:t,onImageError:n,original:e.original,originalAlt:e.originalAlt,originalHeight:e.originalHeight,originalWidth:e.originalWidth,originalTitle:e.originalTitle,sizes:e.sizes,loading:e.loading,srcSet:e.srcSet})}},{key:"renderThumbInner",value:function(e){var t=this.props.onThumbnailError||this.handleImageError;return s.default.createElement("span",{className:"image-gallery-thumbnail-inner"},s.default.createElement("img",{className:"image-gallery-thumbnail-image",src:e.thumbnail,height:e.thumbnailHeight,width:e.thumbnailWidth,alt:e.thumbnailAlt,title:e.thumbnailTitle,loading:e.thumbnailLoading,onError:t}),e.thumbnailLabel&&s.default.createElement("div",{className:"image-gallery-thumbnail-label"},e.thumbnailLabel))}},{key:"render",value:function(){var e=this.state,t=e.currentIndex,n=e.isFullscreen,i=e.modalFullscreen,r=e.isPlaying,a=this.props,l=a.additionalClass,u=a.disableThumbnailSwipe,c=a.indexSeparator,h=a.isRTL,d=a.items,f=a.thumbnailPosition,p=a.renderFullscreenButton,m=a.renderCustomControls,b=a.renderLeftNav,g=a.renderRightNav,v=a.renderTopNav,y=a.renderBottomNav,w=a.showBullets,S=a.showFullscreenButton,T=a.showIndex,O=a.showThumbnails,E=a.showNav,k=a.showPlayButton,I=a.slideVertically,x=a.renderPlayPauseButton,P=this.getThumbnailStyle(),j=this.getSlideItems(),_=j.slides,R=j.thumbnails,L=j.bullets,M=o("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(f),{"image-gallery-rtl":h}),D=o("image-gallery-bullets",{"image-gallery-bullets-vertical":I}),C=s.default.createElement("div",{ref:this.imageGallerySlideWrapper,className:M},m&&m(),this.canSlide()?s.default.createElement(s.default.Fragment,null,E&&s.default.createElement(s.default.Fragment,null,I?v(this.slideLeft,!this.canSlideLeft()):b(this.slideLeft,!this.canSlideLeft()),I?y(this.slideRight,!this.canSlideRight()):g(this.slideRight,!this.canSlideRight())),s.default.createElement(He,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},s.default.createElement("div",{className:"image-gallery-slides"},_))):s.default.createElement("div",{className:"image-gallery-slides"},_),k&&x(this.togglePlay,r),w&&s.default.createElement("div",{className:D},s.default.createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},L)),S&&p(this.toggleFullScreen,n),T&&s.default.createElement("div",{className:"image-gallery-index"},s.default.createElement("span",{className:"image-gallery-index-current"},t+1),s.default.createElement("span",{className:"image-gallery-index-separator"},c),s.default.createElement("span",{className:"image-gallery-index-total"},d.length))),W=o("image-gallery",l,{"fullscreen-modal":i}),N=o("image-gallery-content",this.getThumbnailPositionClassName(f),{fullscreen:n}),F=o("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(f),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&h},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!u},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!u});return s.default.createElement("div",{ref:this.imageGallery,className:W,"aria-live":"polite"},s.default.createElement("div",{className:N},("bottom"===f||"right"===f)&&C,O&&R.length>0?s.default.createElement(He,{className:F,delta:0,onSwiping:!u&&this.handleThumbnailSwiping,onSwiped:!u&&this.handleOnThumbnailSwiped},s.default.createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},s.default.createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:P,"aria-label":"Thumbnail Navigation"},R))):null,("top"===f||"left"===f)&&C))}}])}();lt.propTypes={flickThreshold:pe.number,items:(0,pe.arrayOf)((0,pe.shape)({bulletClass:pe.string,bulletOnClick:pe.func,description:pe.string,original:pe.string,originalHeight:pe.number,originalWidth:pe.number,loading:pe.string,thumbnailHeight:pe.number,thumbnailWidth:pe.number,thumbnailLoading:pe.string,fullscreen:pe.string,originalAlt:pe.string,originalTitle:pe.string,thumbnail:pe.string,thumbnailAlt:pe.string,thumbnailLabel:pe.string,thumbnailTitle:pe.string,originalClass:pe.string,thumbnailClass:pe.string,renderItem:pe.func,renderThumbInner:pe.func,imageSet:ot,srcSet:pe.string,sizes:pe.string})).isRequired,showNav:pe.bool,autoPlay:pe.bool,lazyLoad:pe.bool,infinite:pe.bool,showIndex:pe.bool,showBullets:pe.bool,showThumbnails:pe.bool,showPlayButton:pe.bool,showFullscreenButton:pe.bool,disableThumbnailScroll:pe.bool,disableKeyDown:pe.bool,disableSwipe:pe.bool,disableThumbnailSwipe:pe.bool,useBrowserFullscreen:pe.bool,onErrorImageURL:pe.string,indexSeparator:pe.string,thumbnailPosition:(0,pe.oneOf)(["top","bottom","left","right"]),startIndex:pe.number,slideDuration:pe.number,slideInterval:pe.number,slideOnThumbnailOver:pe.bool,swipeThreshold:pe.number,swipingTransitionDuration:pe.number,swipingThumbnailTransitionDuration:pe.number,onSlide:pe.func,onBeforeSlide:pe.func,onScreenChange:pe.func,onPause:pe.func,onPlay:pe.func,onClick:pe.func,onImageLoad:pe.func,onImageError:pe.func,onTouchMove:pe.func,onTouchEnd:pe.func,onTouchStart:pe.func,onMouseOver:pe.func,onMouseLeave:pe.func,onBulletClick:pe.func,onThumbnailError:pe.func,onThumbnailClick:pe.func,renderCustomControls:pe.func,renderLeftNav:pe.func,renderRightNav:pe.func,renderTopNav:pe.func,renderBottomNav:pe.func,renderPlayPauseButton:pe.func,renderFullscreenButton:pe.func,renderItem:pe.func,renderThumbInner:pe.func,stopPropagation:pe.bool,additionalClass:pe.string,useTranslate3D:pe.bool,isRTL:pe.bool,useWindowKeyDown:pe.bool,slideVertically:pe.bool},lt.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,slideVertically:!1,renderLeftNav:function(e,t){return s.default.createElement(Me,{onClick:e,disabled:t})},renderRightNav:function(e,t){return s.default.createElement(Ce,{onClick:e,disabled:t})},renderTopNav:function(e,t){return s.default.createElement(Ke,{onClick:e,disabled:t})},renderBottomNav:function(e,t){return s.default.createElement(Ye,{onClick:e,disabled:t})},renderPlayPauseButton:function(e,t){return s.default.createElement(Ne,{onClick:e,isPlaying:t})},renderFullscreenButton:function(e,t){return s.default.createElement(Re,{onClick:e,isFullscreen:t})},useWindowKeyDown:!0};const ut=lt;var ct=r.A;export{ct as default};
|