vendor: 75,937 bytes, lines 1-1749
1/*! 2 * PhotoSwipe 5.4.4 - https://photoswipe.com 3 * (c) 2024 Dmytro Semenov 4 */ 5function t(t, i, s) { 6 const h = document.createElement(i); 7 return t && (h.className = t), s && s.appendChild(h), h 8} 9 10function i(t, i) { 11 return t.x = i.x, t.y = i.y, void 0 !== i.id && (t.id = i.id), t 12} 13 14function s(t) { 15 t.x = Math.round(t.x), t.y = Math.round(t.y) 16} 17 18function h(t, i) { 19 const s = Math.abs(t.x - i.x), h = Math.abs(t.y - i.y); 20 return Math.sqrt(s * s + h * h) 21} 22 23function e(t, i) { 24 return t.x === i.x && t.y === i.y 25} 26 27function n(t, i, s) { 28 return Math.min(Math.max(t, i), s) 29} 30 31function o(t, i, s) { 32 let h = `translate3d(${t}px,${i || 0}px,0)`; 33 return void 0 !== s && (h += ` scale3d(${s},${s},1)`), h 34} 35 36function r(t, i, s, h) { 37 t.style.transform = o(i, s, h) 38} 39 40function a(t, i, s, h) { 41 t.style.transition = i ? `${i} ${s}ms ${h || "cubic-bezier(.4,0,.22,1)"}` : "none" 42} 43 44function l(t, i, s) { 45 t.style.width = "number" == typeof i ? `${i}px` : i, t.style.height = "number" == typeof s ? `${s}px` : s 46} 47 48const c = "idle", d = "loading", u = "loaded", p = "error"; 49 50function m() { 51 return !(!navigator.vendor || !navigator.vendor.match(/apple/i)) 52} 53 54let v = !1; 55try { 56 window.addEventListener("test", null, Object.defineProperty({}, "passive", { 57 get: () => { 58 v = !0 59 } 60 })) 61} catch (t) { 62} 63 64class f { 65 constructor() { 66 this.t = [] 67 } 68 69 add(t, i, s, h) { 70 this.i(t, i, s, h) 71 } 72 73 remove(t, i, s, h) { 74 this.i(t, i, s, h, !0) 75 } 76 77 removeAll() { 78 this.t.forEach((t => { 79 this.i(t.target, t.type, t.listener, t.passive, !0, !0) 80 })), this.t = [] 81 } 82 83 i(t, i, s, h, e, n) { 84 if (!t) return; 85 const o = e ? "removeEventListener" : "addEventListener"; 86 i.split(" ").forEach((i => { 87 if (i) { 88 n || (e ? this.t = this.t.filter((h => h.type !== i || h.listener !== s || h.target !== t)) : this.t.push({ 89 target: t, 90 type: i, 91 listener: s, 92 passive: h 93 })); 94 const r = !!v && {passive: h || !1}; 95 t[o](i, s, r) 96 } 97 })) 98 } 99} 100 101function w(t, i) { 102 if (t.getViewportSizeFn) { 103 const s = t.getViewportSizeFn(t, i); 104 if (s) return s 105 } 106 return {x: document.documentElement.clientWidth, y: window.innerHeight} 107} 108 109function g(t, i, s, h, e) { 110 let n = 0; 111 if (i.paddingFn) n = i.paddingFn(s, h, e)[t]; else if (i.padding) n = i.padding[t]; else { 112 const s = "padding" + t[0].toUpperCase() + t.slice(1); 113 i[s] && (n = i[s]) 114 } 115 return Number(n) || 0 116} 117 118function y(t, i, s, h) { 119 return { 120 x: i.x - g("left", t, i, s, h) - g("right", t, i, s, h), 121 y: i.y - g("top", t, i, s, h) - g("bottom", t, i, s, h) 122 } 123} 124 125class _ { 126 constructor(t) { 127 this.slide = t, this.currZoomLevel = 1, this.center = {x: 0, y: 0}, this.max = {x: 0, y: 0}, this.min = { 128 x: 0, 129 y: 0 130 } 131 } 132 133 update(t) { 134 this.currZoomLevel = t, this.slide.width ? (this.o("x"), this.o("y"), this.slide.pswp.dispatch("calcBounds", {slide: this.slide})) : this.reset() 135 } 136 137 o(t) { 138 const {pswp: i} = this.slide, s = this.slide["x" === t ? "width" : "height"] * this.currZoomLevel, 139 h = g("x" === t ? "left" : "top", i.options, i.viewportSize, this.slide.data, this.slide.index), 140 e = this.slide.panAreaSize[t]; 141 this.center[t] = Math.round((e - s) / 2) + h, this.max[t] = s > e ? Math.round(e - s) + h : this.center[t], this.min[t] = s > e ? h : this.center[t] 142 } 143 144 reset() { 145 this.center.x = 0, this.center.y = 0, this.max.x = 0, this.max.y = 0, this.min.x = 0, this.min.y = 0 146 } 147 148 correctPan(t, i) { 149 return n(i, this.max[t], this.min[t]) 150 } 151} 152 153class x { 154 constructor(t, i, s, h) { 155 this.pswp = h, this.options = t, this.itemData = i, this.index = s, this.panAreaSize = null, this.elementSize = null, this.fit = 1, this.fill = 1, this.vFill = 1, this.initial = 1, this.secondary = 1, this.max = 1, this.min = 1 156 } 157 158 update(t, i, s) { 159 const h = {x: t, y: i}; 160 this.elementSize = h, this.panAreaSize = s; 161 const e = s.x / h.x, n = s.y / h.y; 162 this.fit = Math.min(1, e < n ? e : n), this.fill = Math.min(1, e > n ? e : n), this.vFill = Math.min(1, n), this.initial = this.l(), this.secondary = this.u(), this.max = Math.max(this.initial, this.secondary, this.p()), this.min = Math.min(this.fit, this.initial, this.secondary), this.pswp && this.pswp.dispatch("zoomLevelsUpdate", { 163 zoomLevels: this, 164 slideData: this.itemData 165 }) 166 } 167 168 m(t) { 169 const i = t + "ZoomLevel", s = this.options[i]; 170 if (s) return "function" == typeof s ? s(this) : "fill" === s ? this.fill : "fit" === s ? this.fit : Number(s) 171 } 172 173 u() { 174 let t = this.m("secondary"); 175 return t || (t = Math.min(1, 3 * this.fit), this.elementSize && t * this.elementSize.x > 4e3 && (t = 4e3 / this.elementSize.x), t) 176 } 177 178 l() { 179 return this.m("initial") || this.fit 180 } 181 182 p() { 183 return this.m("max") || Math.max(1, 4 * this.fit) 184 } 185} 186 187class b { 188 constructor(i, s, h) { 189 this.data = i, this.index = s, this.pswp = h, this.isActive = s === h.currIndex, this.currentResolution = 0, this.panAreaSize = { 190 x: 0, 191 y: 0 192 }, this.pan = { 193 x: 0, 194 y: 0 195 }, this.isFirstSlide = this.isActive && !h.opener.isOpen, this.zoomLevels = new x(h.options, i, s, h), this.pswp.dispatch("gettingData", { 196 slide: this, 197 data: this.data, 198 index: s 199 }), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = t("pswp__zoom-wrap", "div"), this.holderElement = null, this.currZoomLevel = 1, this.width = this.content.width, this.height = this.content.height, this.heavyAppended = !1, this.bounds = new _(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {slide: this}) 200 } 201 202 setIsActive(t) { 203 t && !this.isActive ? this.activate() : !t && this.isActive && this.deactivate() 204 } 205 206 append(t) { 207 this.holderElement = t, this.container.style.transformOrigin = "0 0", this.data && (this.calculateSize(), this.load(), this.updateContentSize(), this.appendHeavy(), this.holderElement.appendChild(this.container), this.zoomAndPanToInitial(), this.pswp.dispatch("firstZoomPan", {slide: this}), this.applyCurrentZoomPan(), this.pswp.dispatch("afterSetContent", {slide: this}), this.isActive && this.activate()) 208 } 209 210 load() { 211 this.content.load(!1), this.pswp.dispatch("slideLoad", {slide: this}) 212 } 213 214 appendHeavy() { 215 const {pswp: t} = this; 216 !this.heavyAppended && t.opener.isOpen && !t.mainScroll.isShifted() && (this.isActive, 1) && (this.pswp.dispatch("appendHeavy", {slide: this}).defaultPrevented || (this.heavyAppended = !0, this.content.append(), this.pswp.dispatch("appendHeavyContent", {slide: this}))) 217 } 218 219 activate() { 220 this.isActive = !0, this.appendHeavy(), this.content.activate(), this.pswp.dispatch("slideActivate", {slide: this}) 221 } 222 223 deactivate() { 224 this.isActive = !1, this.content.deactivate(), this.currZoomLevel !== this.zoomLevels.initial && this.calculateSize(), this.currentResolution = 0, this.zoomAndPanToInitial(), this.applyCurrentZoomPan(), this.updateContentSize(), this.pswp.dispatch("slideDeactivate", {slide: this}) 225 } 226 227 destroy() { 228 this.content.hasSlide = !1, this.content.remove(), this.container.remove(), this.pswp.dispatch("slideDestroy", {slide: this}) 229 } 230 231 resize() { 232 this.currZoomLevel !== this.zoomLevels.initial && this.isActive ? (this.calculateSize(), this.bounds.update(this.currZoomLevel), this.panTo(this.pan.x, this.pan.y)) : (this.calculateSize(), this.currentResolution = 0, this.zoomAndPanToInitial(), this.applyCurrentZoomPan(), this.updateContentSize()) 233 } 234 235 updateContentSize(t) { 236 const i = this.currentResolution || this.zoomLevels.initial; 237 if (!i) return; 238 const s = Math.round(this.width * i) || this.pswp.viewportSize.x, 239 h = Math.round(this.height * i) || this.pswp.viewportSize.y; 240 (this.sizeChanged(s, h) || t) && this.content.setDisplayedSize(s, h) 241 } 242 243 sizeChanged(t, i) { 244 return (t !== this.prevDisplayedWidth || i !== this.prevDisplayedHeight) && (this.prevDisplayedWidth = t, this.prevDisplayedHeight = i, !0) 245 } 246 247 getPlaceholderElement() { 248 var t; 249 return null === (t = this.content.placeholder) || void 0 === t ? void 0 : t.element 250 } 251 252 zoomTo(t, i, h, e) { 253 const {pswp: o} = this; 254 if (!this.isZoomable() || o.mainScroll.isShifted()) return; 255 o.dispatch("beforeZoomTo", { 256 destZoomLevel: t, 257 centerPoint: i, 258 transitionDuration: h 259 }), o.animations.stopAllPan(); 260 const r = this.currZoomLevel; 261 e || (t = n(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", i, r), this.pan.y = this.calculateZoomToPanOffset("y", i, r), s(this.pan); 262 const a = () => { 263 this.v(t), this.applyCurrentZoomPan() 264 }; 265 h ? o.animations.startTransition({ 266 isPan: !0, 267 name: "zoomTo", 268 target: this.container, 269 transform: this.getCurrentTransform(), 270 onComplete: a, 271 duration: h, 272 easing: o.options.easing 273 }) : a() 274 } 275 276 toggleZoom(t) { 277 this.zoomTo(this.currZoomLevel === this.zoomLevels.initial ? this.zoomLevels.secondary : this.zoomLevels.initial, t, this.pswp.options.zoomAnimationDuration) 278 } 279 280 setZoomLevel(t) { 281 this.currZoomLevel = t, this.bounds.update(this.currZoomLevel) 282 } 283 284 calculateZoomToPanOffset(t, i, s) { 285 if (0 === this.bounds.max[t] - this.bounds.min[t]) return this.bounds.center[t]; 286 i || (i = this.pswp.getViewportCenterPoint()), s || (s = this.zoomLevels.initial); 287 const h = this.currZoomLevel / s; 288 return this.bounds.correctPan(t, (this.pan[t] - i[t]) * h + i[t]) 289 } 290 291 panTo(t, i) { 292 this.pan.x = this.bounds.correctPan("x", t), this.pan.y = this.bounds.correctPan("y", i), this.applyCurrentZoomPan() 293 } 294 295 isPannable() { 296 return Boolean(this.width) && this.currZoomLevel > this.zoomLevels.fit 297 } 298 299 isZoomable() { 300 return Boolean(this.width) && this.content.isZoomable() 301 } 302 303 applyCurrentZoomPan() { 304 this.g(this.pan.x, this.pan.y, this.currZoomLevel), this === this.pswp.currSlide && this.pswp.dispatch("zoomPanUpdate", {slide: this}) 305 } 306 307 zoomAndPanToInitial() { 308 this.currZoomLevel = this.zoomLevels.initial, this.bounds.update(this.currZoomLevel), i(this.pan, this.bounds.center), this.pswp.dispatch("initialZoomPan", {slide: this}) 309 } 310 311 g(t, i, s) { 312 s /= this.currentResolution || this.zoomLevels.initial, r(this.container, t, i, s) 313 } 314 315 calculateSize() { 316 const {pswp: t} = this; 317 i(this.panAreaSize, y(t.options, t.viewportSize, this.data, this.index)), this.zoomLevels.update(this.width, this.height, this.panAreaSize), t.dispatch("calcSlideSize", {slide: this}) 318 } 319 320 getCurrentTransform() { 321 const t = this.currZoomLevel / (this.currentResolution || this.zoomLevels.initial); 322 return o(this.pan.x, this.pan.y, t) 323 } 324 325 v(t) { 326 t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged")) 327 } 328} 329 330class S { 331 constructor(t) { 332 this.gestures = t, this.pswp = t.pswp, this.startPan = {x: 0, y: 0} 333 } 334 335 start() { 336 this.pswp.currSlide && i(this.startPan, this.pswp.currSlide.pan), this.pswp.animations.stopAll() 337 } 338 339 change() { 340 const {p1: t, prevP1: i, dragAxis: h} = this.gestures, {currSlide: e} = this.pswp; 341 if ("y" === h && this.pswp.options.closeOnVerticalDrag && e && e.currZoomLevel <= e.zoomLevels.fit && !this.gestures.isMultitouch) { 342 const s = e.pan.y + (t.y - i.y); 343 if (!this.pswp.dispatch("verticalDrag", {panY: s}).defaultPrevented) { 344 this._("y", s, .6); 345 const t = 1 - Math.abs(this.S(e.pan.y)); 346 this.pswp.applyBgOpacity(t), e.applyCurrentZoomPan() 347 } 348 } else { 349 this.M("x") || (this.M("y"), e && (s(e.pan), e.applyCurrentZoomPan())) 350 } 351 } 352 353 end() { 354 const {velocity: t} = this.gestures, {mainScroll: i, currSlide: s} = this.pswp; 355 let h = 0; 356 if (this.pswp.animations.stopAll(), i.isShifted()) { 357 const s = (i.x - i.getCurrSlideX()) / this.pswp.viewportSize.x; 358 t.x < -.5 && s < 0 || t.x < .1 && s < -.5 ? (h = 1, t.x = Math.min(t.x, 0)) : (t.x > .5 && s > 0 || t.x > -.1 && s > .5) && (h = -1, t.x = Math.max(t.x, 0)), i.moveIndexBy(h, !0, t.x) 359 } 360 s && s.currZoomLevel > s.zoomLevels.max || this.gestures.isMultitouch ? this.gestures.zoomLevels.correctZoomPan(!0) : (this.P("x"), this.P("y")) 361 } 362 363 P(t) { 364 const {velocity: i} = this.gestures, {currSlide: s} = this.pswp; 365 if (!s) return; 366 const {pan: h, bounds: e} = s, o = h[t], r = this.pswp.bgOpacity < 1 && "y" === t, a = o + function (t, i) { 367 return t * i / (1 - i) 368 }(i[t], .995); 369 if (r) { 370 const t = this.S(o), i = this.S(a); 371 if (t < 0 && i < -.4 || t > 0 && i > .4) return void this.pswp.close() 372 } 373 const l = e.correctPan(t, a); 374 if (o === l) return; 375 const c = l === a ? 1 : .82, d = this.pswp.bgOpacity, u = l - o; 376 this.pswp.animations.startSpring({ 377 name: "panGesture" + t, 378 isPan: !0, 379 start: o, 380 end: l, 381 velocity: i[t], 382 dampingRatio: c, 383 onUpdate: i => { 384 if (r && this.pswp.bgOpacity < 1) { 385 const t = 1 - (l - i) / u; 386 this.pswp.applyBgOpacity(n(d + (1 - d) * t, 0, 1)) 387 } 388 h[t] = Math.floor(i), s.applyCurrentZoomPan() 389 } 390 }) 391 } 392 393 M(t) { 394 const {p1: i, dragAxis: s, prevP1: h, isMultitouch: e} = this.gestures, { 395 currSlide: n, 396 mainScroll: o 397 } = this.pswp, r = i[t] - h[t], a = o.x + r; 398 if (!r || !n) return !1; 399 if ("x" === t && !n.isPannable() && !e) return o.moveTo(a, !0), !0; 400 const {bounds: l} = n, c = n.pan[t] + r; 401 if (this.pswp.options.allowPanToNext && "x" === s && "x" === t && !e) { 402 const i = o.getCurrSlideX(), s = o.x - i, h = r > 0, e = !h; 403 if (c > l.min[t] && h) { 404 if (l.min[t] <= this.startPan[t]) return o.moveTo(a, !0), !0; 405 this._(t, c) 406 } else if (c < l.max[t] && e) { 407 if (this.startPan[t] <= l.max[t]) return o.moveTo(a, !0), !0; 408 this._(t, c) 409 } else if (0 !== s) { 410 if (s > 0) return o.moveTo(Math.max(a, i), !0), !0; 411 if (s < 0) return o.moveTo(Math.min(a, i), !0), !0 412 } else this._(t, c) 413 } else "y" === t && (o.isShifted() || l.min.y === l.max.y) || this._(t, c); 414 return !1 415 } 416 417 S(t) { 418 var i, s; 419 return (t - (null !== (i = null === (s = this.pswp.currSlide) || void 0 === s ? void 0 : s.bounds.center.y) && void 0 !== i ? i : 0)) / (this.pswp.viewportSize.y / 3) 420 } 421 422 _(t, i, s) { 423 const {currSlide: h} = this.pswp; 424 if (!h) return; 425 const {pan: e, bounds: n} = h; 426 if (n.correctPan(t, i) !== i || s) { 427 const h = Math.round(i - e[t]); 428 e[t] += h * (s || .35) 429 } else e[t] = i 430 } 431} 432 433function z(t, i, s) { 434 return t.x = (i.x + s.x) / 2, t.y = (i.y + s.y) / 2, t 435} 436 437class M { 438 constructor(t) { 439 this.gestures = t, this.C = {x: 0, y: 0}, this.T = {x: 0, y: 0}, this.A = {x: 0, y: 0}, this.D = !1, this.I = 1 440 } 441 442 start() { 443 const {currSlide: t} = this.gestures.pswp; 444 t && (this.I = t.currZoomLevel, i(this.C, t.pan)), this.gestures.pswp.animations.stopAllPan(), this.D = !1 445 } 446 447 change() { 448 const {p1: t, startP1: i, p2: s, startP2: e, pswp: n} = this.gestures, {currSlide: o} = n; 449 if (!o) return; 450 const r = o.zoomLevels.min, a = o.zoomLevels.max; 451 if (!o.isZoomable() || n.mainScroll.isShifted()) return; 452 z(this.T, i, e), z(this.A, t, s); 453 let l = 1 / h(i, e) * h(t, s) * this.I; 454 if (l > o.zoomLevels.initial + o.zoomLevels.initial / 15 && (this.D = !0), l < r) if (n.options.pinchToClose && !this.D && this.I <= o.zoomLevels.initial) { 455 const t = 1 - (r - l) / (r / 1.2); 456 n.dispatch("pinchClose", {bgOpacity: t}).defaultPrevented || n.applyBgOpacity(t) 457 } else l = r - .15 * (r - l); else l > a && (l = a + .05 * (l - a)); 458 o.pan.x = this.L("x", l), o.pan.y = this.L("y", l), o.setZoomLevel(l), o.applyCurrentZoomPan() 459 } 460 461 end() { 462 const {pswp: t} = this.gestures, {currSlide: i} = t; 463 (!i || i.currZoomLevel < i.zoomLevels.initial) && !this.D && t.options.pinchToClose ? t.close() : this.correctZoomPan() 464 } 465 466 L(t, i) { 467 const s = i / this.I; 468 return this.A[t] - (this.T[t] - this.C[t]) * s 469 } 470 471 correctZoomPan(t) { 472 const {pswp: s} = this.gestures, {currSlide: h} = s; 473 if (null == h || !h.isZoomable()) return; 474 0 === this.A.x && (t = !0); 475 const o = h.currZoomLevel; 476 let r, a = !0; 477 o < h.zoomLevels.initial ? r = h.zoomLevels.initial : o > h.zoomLevels.max ? r = h.zoomLevels.max : (a = !1, r = o); 478 const l = s.bgOpacity, c = s.bgOpacity < 1, d = i({x: 0, y: 0}, h.pan); 479 let u = i({x: 0, y: 0}, d); 480 t && (this.A.x = 0, this.A.y = 0, this.T.x = 0, this.T.y = 0, this.I = o, i(this.C, d)), a && (u = { 481 x: this.L("x", r), 482 y: this.L("y", r) 483 }), h.setZoomLevel(r), u = { 484 x: h.bounds.correctPan("x", u.x), 485 y: h.bounds.correctPan("y", u.y) 486 }, h.setZoomLevel(o); 487 const p = !e(u, d); 488 if (!p && !a && !c) return h.v(r), void h.applyCurrentZoomPan(); 489 s.animations.stopAllPan(), s.animations.startSpring({ 490 isPan: !0, 491 start: 0, 492 end: 1e3, 493 velocity: 0, 494 dampingRatio: 1, 495 naturalFrequency: 40, 496 onUpdate: t => { 497 if (t /= 1e3, p || a) { 498 if (p && (h.pan.x = d.x + (u.x - d.x) * t, h.pan.y = d.y + (u.y - d.y) * t), a) { 499 const i = o + (r - o) * t; 500 h.setZoomLevel(i) 501 } 502 h.applyCurrentZoomPan() 503 } 504 c && s.bgOpacity < 1 && s.applyBgOpacity(n(l + (1 - l) * t, 0, 1)) 505 }, 506 onComplete: () => { 507 h.v(r), h.applyCurrentZoomPan() 508 } 509 }) 510 } 511} 512 513function P(t) { 514 return !!t.target.closest(".pswp__container") 515} 516 517class C { 518 constructor(t) { 519 this.gestures = t 520 } 521 522 click(t, i) { 523 const s = i.target.classList, h = s.contains("pswp__img"), 524 e = s.contains("pswp__item") || s.contains("pswp__zoom-wrap"); 525 h ? this.k("imageClick", t, i) : e && this.k("bgClick", t, i) 526 } 527 528 tap(t, i) { 529 P(i) && this.k("tap", t, i) 530 } 531 532 doubleTap(t, i) { 533 P(i) && this.k("doubleTap", t, i) 534 } 535 536 k(t, i, s) { 537 var h; 538 const {pswp: e} = this.gestures, {currSlide: n} = e, o = t + "Action", r = e.options[o]; 539 if (!e.dispatch(o, {point: i, originalEvent: s}).defaultPrevented) if ("function" != typeof r) switch (r) { 540 case"close": 541 case"next": 542 e[r](); 543 break; 544 case"zoom": 545 null == n || n.toggleZoom(i); 546 break; 547 case"zoom-or-close": 548 null != n && n.isZoomable() && n.zoomLevels.secondary !== n.zoomLevels.initial ? n.toggleZoom(i) : e.options.clickToCloseNonZoomable && e.close(); 549 break; 550 case"toggle-controls": 551 null === (h = this.gestures.pswp.element) || void 0 === h || h.classList.toggle("pswp--ui-visible") 552 } else r.call(e, i, s) 553 } 554} 555 556class T { 557 constructor(t) { 558 this.pswp = t, this.dragAxis = null, this.p1 = {x: 0, y: 0}, this.p2 = {x: 0, y: 0}, this.prevP1 = { 559 x: 0, 560 y: 0 561 }, this.prevP2 = {x: 0, y: 0}, this.startP1 = {x: 0, y: 0}, this.startP2 = {x: 0, y: 0}, this.velocity = { 562 x: 0, 563 y: 0 564 }, this.Z = {x: 0, y: 0}, this.B = { 565 x: 0, 566 y: 0 567 }, this.F = 0, this.O = [], this.R = "ontouchstart" in window, this.N = !!window.PointerEvent, this.supportsTouch = this.R || this.N && navigator.maxTouchPoints > 1, this.F = 0, this.U = 0, this.V = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this.G = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new S(this), this.zoomLevels = new M(this), this.tapHandler = new C(this), t.on("bindEvents", (() => { 568 t.events.add(t.scrollWrap, "click", this.$.bind(this)), this.N ? this.q("pointer", "down", "up", "cancel") : this.R ? (this.q("touch", "start", "end", "cancel"), t.scrollWrap && (t.scrollWrap.ontouchmove = () => { 569 }, t.scrollWrap.ontouchend = () => { 570 })) : this.q("mouse", "down", "up") 571 })) 572 } 573 574 q(t, i, s, h) { 575 const {pswp: e} = this, {events: n} = e, o = h ? t + h : ""; 576 n.add(e.scrollWrap, t + i, this.onPointerDown.bind(this)), n.add(window, t + "move", this.onPointerMove.bind(this)), n.add(window, t + s, this.onPointerUp.bind(this)), o && n.add(e.scrollWrap, o, this.onPointerUp.bind(this)) 577 } 578 579 onPointerDown(t) { 580 const s = "mousedown" === t.type || "mouse" === t.pointerType; 581 if (s && t.button > 0) return; 582 const {pswp: h} = this; 583 h.opener.isOpen ? h.dispatch("pointerDown", {originalEvent: t}).defaultPrevented || (s && (h.mouseDetected(), this.H(t, "down")), h.animations.stopAll(), this.K(t, "down"), 1 === this.F && (this.dragAxis = null, i(this.startP1, this.p1)), this.F > 1 ? (this.W(), this.isMultitouch = !0) : this.isMultitouch = !1) : t.preventDefault() 584 } 585 586 onPointerMove(t) { 587 this.H(t, "move"), this.F && (this.K(t, "move"), this.pswp.dispatch("pointerMove", {originalEvent: t}).defaultPrevented || (1 !== this.F || this.isDragging ? this.F > 1 && !this.isZooming && (this.j(), this.isZooming = !0, this.X(), this.zoomLevels.start(), this.Y(), this.J()) : (this.dragAxis || this.tt(), this.dragAxis && !this.isDragging && (this.isZooming && (this.isZooming = !1, this.zoomLevels.end()), this.isDragging = !0, this.W(), this.X(), this.U = Date.now(), this.V = !1, i(this.B, this.p1), this.velocity.x = 0, this.velocity.y = 0, this.drag.start(), this.Y(), this.J())))) 588 } 589 590 j() { 591 this.isDragging && (this.isDragging = !1, this.V || this.it(!0), this.drag.end(), this.dragAxis = null) 592 } 593 594 onPointerUp(t) { 595 this.F && (this.K(t, "up"), this.pswp.dispatch("pointerUp", {originalEvent: t}).defaultPrevented || (0 === this.F && (this.Y(), this.isDragging ? this.j() : this.isZooming || this.isMultitouch || this.st(t)), this.F < 2 && this.isZooming && (this.isZooming = !1, this.zoomLevels.end(), 1 === this.F && (this.dragAxis = null, this.X())))) 596 } 597 598 J() { 599 (this.isDragging || this.isZooming) && (this.it(), this.isDragging ? e(this.p1, this.prevP1) || this.drag.change() : e(this.p1, this.prevP1) && e(this.p2, this.prevP2) || this.zoomLevels.change(), this.ht(), this.raf = requestAnimationFrame(this.J.bind(this))) 600 } 601 602 it(t) { 603 const s = Date.now(), h = s - this.U; 604 h < 50 && !t || (this.velocity.x = this.et("x", h), this.velocity.y = this.et("y", h), this.U = s, i(this.B, this.p1), this.V = !0) 605 } 606 607 st(t) { 608 const {mainScroll: s} = this.pswp; 609 if (s.isShifted()) return void s.moveIndexBy(0, !0); 610 if (t.type.indexOf("cancel") > 0) return; 611 if ("mouseup" === t.type || "mouse" === t.pointerType) return void this.tapHandler.click(this.startP1, t); 612 const e = this.pswp.options.doubleTapAction ? 300 : 0; 613 this.G ? (this.W(), h(this.Z, this.startP1) < 25 && this.tapHandler.doubleTap(this.startP1, t)) : (i(this.Z, this.startP1), this.G = setTimeout((() => { 614 this.tapHandler.tap(this.startP1, t), this.W() 615 }), e)) 616 } 617 618 W() { 619 this.G && (clearTimeout(this.G), this.G = null) 620 } 621 622 et(t, i) { 623 const s = this.p1[t] - this.B[t]; 624 return Math.abs(s) > 1 && i > 5 ? s / i : 0 625 } 626 627 Y() { 628 this.raf && (cancelAnimationFrame(this.raf), this.raf = null) 629 } 630 631 H(t, i) { 632 this.pswp.applyFilters("preventPointerEvent", !0, t, i) && t.preventDefault() 633 } 634 635 K(t, s) { 636 if (this.N) { 637 const h = t, e = this.O.findIndex((t => t.id === h.pointerId)); 638 "up" === s && e > -1 ? this.O.splice(e, 1) : "down" === s && -1 === e ? this.O.push(this.nt(h, { 639 x: 0, 640 y: 0 641 })) : e > -1 && this.nt(h, this.O[e]), this.F = this.O.length, this.F > 0 && i(this.p1, this.O[0]), this.F > 1 && i(this.p2, this.O[1]) 642 } else { 643 const i = t; 644 this.F = 0, i.type.indexOf("touch") > -1 ? i.touches && i.touches.length > 0 && (this.nt(i.touches[0], this.p1), this.F++, i.touches.length > 1 && (this.nt(i.touches[1], this.p2), this.F++)) : (this.nt(t, this.p1), "up" === s ? this.F = 0 : this.F++) 645 } 646 } 647 648 ht() { 649 i(this.prevP1, this.p1), i(this.prevP2, this.p2) 650 } 651 652 X() { 653 i(this.startP1, this.p1), i(this.startP2, this.p2), this.ht() 654 } 655 656 tt() { 657 if (this.pswp.mainScroll.isShifted()) this.dragAxis = "x"; else { 658 const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y); 659 if (0 !== t) { 660 const i = t > 0 ? "x" : "y"; 661 Math.abs(this.p1[i] - this.startP1[i]) >= 10 && (this.dragAxis = i) 662 } 663 } 664 } 665 666 nt(t, i) { 667 return i.x = t.pageX - this.pswp.offset.x, i.y = t.pageY - this.pswp.offset.y, "pointerId" in t ? i.id = t.pointerId : void 0 !== t.identifier && (i.id = t.identifier), i 668 } 669 670 $(t) { 671 this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation()) 672 } 673} 674 675class A { 676 constructor(t) { 677 this.pswp = t, this.x = 0, this.slideWidth = 0, this.ot = 0, this.rt = 0, this.lt = -1, this.itemHolders = [] 678 } 679 680 resize(t) { 681 const {pswp: i} = this, s = Math.round(i.viewportSize.x + i.viewportSize.x * i.options.spacing), 682 h = s !== this.slideWidth; 683 h && (this.slideWidth = s, this.moveTo(this.getCurrSlideX())), this.itemHolders.forEach(((i, s) => { 684 h && r(i.el, (s + this.lt) * this.slideWidth), t && i.slide && i.slide.resize() 685 })) 686 } 687 688 resetPosition() { 689 this.ot = 0, this.rt = 0, this.slideWidth = 0, this.lt = -1 690 } 691 692 appendHolders() { 693 this.itemHolders = []; 694 for (let i = 0; i < 3; i++) { 695 const s = t("pswp__item", "div", this.pswp.container); 696 s.setAttribute("role", "group"), s.setAttribute("aria-roledescription", "slide"), s.setAttribute("aria-hidden", "true"), s.style.display = 1 === i ? "block" : "none", this.itemHolders.push({el: s}) 697 } 698 } 699 700 canBeSwiped() { 701 return this.pswp.getNumItems() > 1 702 } 703 704 moveIndexBy(t, i, s) { 705 const {pswp: h} = this; 706 let e = h.potentialIndex + t; 707 const n = h.getNumItems(); 708 if (h.canLoop()) { 709 e = h.getLoopedIndex(e); 710 const i = (t + n) % n; 711 t = i <= n / 2 ? i : i - n 712 } else e < 0 ? e = 0 : e >= n && (e = n - 1), t = e - h.potentialIndex; 713 h.potentialIndex = e, this.ot -= t, h.animations.stopMainScroll(); 714 const o = this.getCurrSlideX(); 715 if (i) { 716 h.animations.startSpring({ 717 isMainScroll: !0, 718 start: this.x, 719 end: o, 720 velocity: s || 0, 721 naturalFrequency: 30, 722 dampingRatio: 1, 723 onUpdate: t => { 724 this.moveTo(t) 725 }, 726 onComplete: () => { 727 this.updateCurrItem(), h.appendHeavy() 728 } 729 }); 730 let t = h.potentialIndex - h.currIndex; 731 if (h.canLoop()) { 732 const i = (t + n) % n; 733 t = i <= n / 2 ? i : i - n 734 } 735 Math.abs(t) > 1 && this.updateCurrItem() 736 } else this.moveTo(o), this.updateCurrItem(); 737 return Boolean(t) 738 } 739 740 getCurrSlideX() { 741 return this.slideWidth * this.ot 742 } 743 744 isShifted() { 745 return this.x !== this.getCurrSlideX() 746 } 747 748 updateCurrItem() { 749 var t; 750 const {pswp: i} = this, s = this.rt - this.ot; 751 if (!s) return; 752 this.rt = this.ot, i.currIndex = i.potentialIndex; 753 let h, e = Math.abs(s); 754 e >= 3 && (this.lt += s + (s > 0 ? -3 : 3), e = 3, this.itemHolders.forEach((t => { 755 var i; 756 null === (i = t.slide) || void 0 === i || i.destroy(), t.slide = void 0 757 }))); 758 for (let t = 0; t < e; t++) s > 0 ? (h = this.itemHolders.shift(), h && (this.itemHolders[2] = h, this.lt++, r(h.el, (this.lt + 2) * this.slideWidth), i.setContent(h, i.currIndex - e + t + 2))) : (h = this.itemHolders.pop(), h && (this.itemHolders.unshift(h), this.lt--, r(h.el, this.lt * this.slideWidth), i.setContent(h, i.currIndex + e - t - 2))); 759 Math.abs(this.lt) > 50 && !this.isShifted() && (this.resetPosition(), this.resize()), i.animations.stopAllPan(), this.itemHolders.forEach(((t, i) => { 760 t.slide && t.slide.setIsActive(1 === i) 761 })), i.currSlide = null === (t = this.itemHolders[1]) || void 0 === t ? void 0 : t.slide, i.contentLoader.updateLazy(s), i.currSlide && i.currSlide.applyCurrentZoomPan(), i.dispatch("change") 762 } 763 764 moveTo(t, i) { 765 if (!this.pswp.canLoop() && i) { 766 let i = (this.slideWidth * this.ot - t) / this.slideWidth; 767 i += this.pswp.currIndex; 768 const s = Math.round(t - this.x); 769 (i < 0 && s > 0 || i >= this.pswp.getNumItems() - 1 && s < 0) && (t = this.x + .35 * s) 770 } 771 this.x = t, this.pswp.container && r(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", { 772 x: t, 773 dragging: null != i && i 774 }) 775 } 776} 777 778const D = {Escape: 27, z: 90, ArrowLeft: 37, ArrowUp: 38, ArrowRight: 39, ArrowDown: 40, Tab: 9}, 779 I = (t, i) => i ? t : D[t]; 780 781class E { 782 constructor(t) { 783 this.pswp = t, this.ct = !1, t.on("bindEvents", (() => { 784 t.options.trapFocus && (t.options.initialPointerPos || this.dt(), t.events.add(document, "focusin", this.ut.bind(this))), t.events.add(document, "keydown", this.vt.bind(this)) 785 })); 786 const i = document.activeElement; 787 t.on("destroy", (() => { 788 t.options.returnFocus && i && this.ct && i.focus() 789 })) 790 } 791 792 dt() { 793 !this.ct && this.pswp.element && (this.pswp.element.focus(), this.ct = !0) 794 } 795 796 vt(t) { 797 const {pswp: i} = this; 798 if (i.dispatch("keydown", {originalEvent: t}).defaultPrevented) return; 799 if (function (t) { 800 return "button" in t && 1 === t.button || t.ctrlKey || t.metaKey || t.altKey || t.shiftKey 801 }(t)) return; 802 let s, h, e = !1; 803 const n = "key" in t; 804 switch (n ? t.key : t.keyCode) { 805 case I("Escape", n): 806 i.options.escKey && (s = "close"); 807 break; 808 case I("z", n): 809 s = "toggleZoom"; 810 break; 811 case I("ArrowLeft", n): 812 h = "x"; 813 break; 814 case I("ArrowUp", n): 815 h = "y"; 816 break; 817 case I("ArrowRight", n): 818 h = "x", e = !0; 819 break; 820 case I("ArrowDown", n): 821 e = !0, h = "y"; 822 break; 823 case I("Tab", n): 824 this.dt() 825 } 826 if (h) { 827 t.preventDefault(); 828 const {currSlide: n} = i; 829 i.options.arrowKeys && "x" === h && i.getNumItems() > 1 ? s = e ? "next" : "prev" : n && n.currZoomLevel > n.zoomLevels.fit && (n.pan[h] += e ? -80 : 80, n.panTo(n.pan.x, n.pan.y)) 830 } 831 s && (t.preventDefault(), i[s]()) 832 } 833 834 ut(t) { 835 const {template: i} = this.pswp; 836 i && document !== t.target && i !== t.target && !i.contains(t.target) && i.focus() 837 } 838} 839 840const L = "cubic-bezier(.4,0,.22,1)"; 841 842class k { 843 constructor(t) { 844 var i; 845 this.props = t; 846 const { 847 target: s, onComplete: h, transform: e, onFinish: n = (() => { 848 }), duration: o = 333, easing: r = L 849 } = t; 850 this.onFinish = n; 851 const l = e ? "transform" : "opacity", c = null !== (i = t[l]) && void 0 !== i ? i : ""; 852 this.ft = s, this.wt = h, this.gt = !1, this.yt = this.yt.bind(this), this._t = setTimeout((() => { 853 a(s, l, o, r), this._t = setTimeout((() => { 854 s.addEventListener("transitionend", this.yt, !1), s.addEventListener("transitioncancel", this.yt, !1), this._t = setTimeout((() => { 855 this.xt() 856 }), o + 500), s.style[l] = c 857 }), 30) 858 }), 0) 859 } 860 861 yt(t) { 862 t.target === this.ft && this.xt() 863 } 864 865 xt() { 866 this.gt || (this.gt = !0, this.onFinish(), this.wt && this.wt()) 867 } 868 869 destroy() { 870 this._t && clearTimeout(this._t), a(this.ft), this.ft.removeEventListener("transitionend", this.yt, !1), this.ft.removeEventListener("transitioncancel", this.yt, !1), this.gt || this.xt() 871 } 872} 873 874class Z { 875 constructor(t, i, s) { 876 this.velocity = 1e3 * t, this.bt = i || .75, this.St = s || 12, this.zt = this.St, this.bt < 1 && (this.zt *= Math.sqrt(1 - this.bt * this.bt)) 877 } 878 879 easeFrame(t, i) { 880 let s, h = 0; 881 i /= 1e3; 882 const e = Math.E ** (-this.bt * this.St * i); 883 if (1 === this.bt) s = this.velocity + this.St * t, h = (t + s * i) * e, this.velocity = h * -this.St + s * e; else if (this.bt < 1) { 884 s = 1 / this.zt * (this.bt * this.St * t + this.velocity); 885 const n = Math.cos(this.zt * i), o = Math.sin(this.zt * i); 886 h = e * (t * n + s * o), this.velocity = h * -this.St * this.bt + e * (-this.zt * t * o + this.zt * s * n) 887 } 888 return h 889 } 890} 891 892class B { 893 constructor(t) { 894 this.props = t, this.Mt = 0; 895 const { 896 start: i, end: s, velocity: h, onUpdate: e, onComplete: n, onFinish: o = (() => { 897 }), dampingRatio: r, naturalFrequency: a 898 } = t; 899 this.onFinish = o; 900 const l = new Z(h, r, a); 901 let c = Date.now(), d = i - s; 902 const u = () => { 903 this.Mt && (d = l.easeFrame(d, Date.now() - c), Math.abs(d) < 1 && Math.abs(l.velocity) < 50 ? (e(s), n && n(), this.onFinish()) : (c = Date.now(), e(d + s), this.Mt = requestAnimationFrame(u))) 904 }; 905 this.Mt = requestAnimationFrame(u) 906 } 907 908 destroy() { 909 this.Mt >= 0 && cancelAnimationFrame(this.Mt), this.Mt = 0 910 } 911} 912 913class F { 914 constructor() { 915 this.activeAnimations = [] 916 } 917 918 startSpring(t) { 919 this.Pt(t, !0) 920 } 921 922 startTransition(t) { 923 this.Pt(t) 924 } 925 926 Pt(t, i) { 927 const s = i ? new B(t) : new k(t); 928 return this.activeAnimations.push(s), s.onFinish = () => this.stop(s), s 929 } 930 931 stop(t) { 932 t.destroy(); 933 const i = this.activeAnimations.indexOf(t); 934 i > -1 && this.activeAnimations.splice(i, 1) 935 } 936 937 stopAll() { 938 this.activeAnimations.forEach((t => { 939 t.destroy() 940 })), this.activeAnimations = [] 941 } 942 943 stopAllPan() { 944 this.activeAnimations = this.activeAnimations.filter((t => !t.props.isPan || (t.destroy(), !1))) 945 } 946 947 stopMainScroll() { 948 this.activeAnimations = this.activeAnimations.filter((t => !t.props.isMainScroll || (t.destroy(), !1))) 949 } 950 951 isPanRunning() { 952 return this.activeAnimations.some((t => t.props.isPan)) 953 } 954} 955 956class O { 957 constructor(t) { 958 this.pswp = t, t.events.add(t.element, "wheel", this.Ct.bind(this)) 959 } 960 961 Ct(t) { 962 t.preventDefault(); 963 const {currSlide: i} = this.pswp; 964 let {deltaX: s, deltaY: h} = t; 965 if (i && !this.pswp.dispatch("wheel", {originalEvent: t}).defaultPrevented) if (t.ctrlKey || this.pswp.options.wheelToZoom) { 966 if (i.isZoomable()) { 967 let s = -h; 968 1 === t.deltaMode ? s *= .05 : s *= t.deltaMode ? 1 : .002, s = 2 ** s; 969 const e = i.currZoomLevel * s; 970 i.zoomTo(e, {x: t.clientX, y: t.clientY}) 971 } 972 } else i.isPannable() && (1 === t.deltaMode && (s *= 18, h *= 18), i.panTo(i.pan.x - s, i.pan.y - h)) 973 } 974} 975 976class R { 977 constructor(i, s) { 978 var h; 979 const e = s.name || s.className; 980 let n = s.html; 981 if (!1 === i.options[e]) return; 982 "string" == typeof i.options[e + "SVG"] && (n = i.options[e + "SVG"]), i.dispatch("uiElementCreate", {data: s}); 983 let o = ""; 984 s.isButton ? (o += "pswp__button ", o += s.className || `pswp__button--${s.name}`) : o += s.className || `pswp__${s.name}`; 985 let r = s.isButton ? s.tagName || "button" : s.tagName || "div"; 986 r = r.toLowerCase(); 987 const a = t(o, r); 988 if (s.isButton) { 989 "button" === r && (a.type = "button"); 990 let {title: t} = s; 991 const {ariaLabel: h} = s; 992 "string" == typeof i.options[e + "Title"] && (t = i.options[e + "Title"]), t && (a.title = t); 993 const n = h || t; 994 n && a.setAttribute("aria-label", n) 995 } 996 a.innerHTML = function (t) { 997 if ("string" == typeof t) return t; 998 if (!t || !t.isCustomSVG) return ""; 999 const i = t; 1000 let s = '<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">'; 1001 return s = s.split("%d").join(i.size || 32), i.outlineID && (s += '<use class="pswp__icn-shadow" xlink:href="#' + i.outlineID + '"/>'), s += i.inner, s += "</svg>", s 1002 }(n), s.onInit && s.onInit(a, i), s.onClick && (a.onclick = t => { 1003 "string" == typeof s.onClick ? i[s.onClick]() : "function" == typeof s.onClick && s.onClick(t, a, i) 1004 }); 1005 const l = s.appendTo || "bar"; 1006 let c = i.element; 1007 "bar" === l ? (i.topBar || (i.topBar = t("pswp__top-bar pswp__hide-on-close", "div", i.scrollWrap)), c = i.topBar) : (a.classList.add("pswp__hide-on-close"), "wrapper" === l && (c = i.scrollWrap)), null === (h = c) || void 0 === h || h.appendChild(i.applyFilters("uiElement", a, s)) 1008 } 1009} 1010 1011function N(t, i, s) { 1012 t.classList.add("pswp__button--arrow"), t.setAttribute("aria-controls", "pswp__items"), i.on("change", (() => { 1013 i.options.loop || (t.disabled = s ? !(i.currIndex < i.getNumItems() - 1) : !(i.currIndex > 0)) 1014 })) 1015} 1016 1017const U = { 1018 name: "arrowPrev", 1019 className: "pswp__button--arrow--prev", 1020 title: "Previous", 1021 order: 10, 1022 isButton: !0, 1023 appendTo: "wrapper", 1024 html: { 1025 isCustomSVG: !0, 1026 size: 60, 1027 inner: '<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>', 1028 outlineID: "pswp__icn-arrow" 1029 }, 1030 onClick: "prev", 1031 onInit: N 1032}, V = { 1033 name: "arrowNext", 1034 className: "pswp__button--arrow--next", 1035 title: "Next", 1036 order: 11, 1037 isButton: !0, 1038 appendTo: "wrapper", 1039 html: {isCustomSVG: !0, size: 60, inner: '<use xlink:href="#pswp__icn-arrow"/>', outlineID: "pswp__icn-arrow"}, 1040 onClick: "next", 1041 onInit: (t, i) => { 1042 N(t, i, !0) 1043 } 1044}, G = { 1045 name: "close", 1046 title: "Close", 1047 order: 20, 1048 isButton: !0, 1049 html: { 1050 isCustomSVG: !0, 1051 inner: '<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>', 1052 outlineID: "pswp__icn-close" 1053 }, 1054 onClick: "close" 1055}, $ = { 1056 name: "zoom", 1057 title: "Zoom", 1058 order: 10, 1059 isButton: !0, 1060 html: { 1061 isCustomSVG: !0, 1062 inner: '<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>', 1063 outlineID: "pswp__icn-zoom" 1064 }, 1065 onClick: "toggleZoom" 1066}, q = { 1067 name: "preloader", 1068 appendTo: "bar", 1069 order: 7, 1070 html: { 1071 isCustomSVG: !0, 1072 inner: '<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>', 1073 outlineID: "pswp__icn-loading" 1074 }, 1075 onInit: (t, i) => { 1076 let s, h = null; 1077 const e = i => { 1078 var h, e; 1079 s !== i && (s = i, h = "active", e = i, t.classList.toggle("pswp__preloader--" + h, e)) 1080 }, n = () => { 1081 var t; 1082 if (null === (t = i.currSlide) || void 0 === t || !t.content.isLoading()) return e(!1), void (h && (clearTimeout(h), h = null)); 1083 h || (h = setTimeout((() => { 1084 var t; 1085 e(Boolean(null === (t = i.currSlide) || void 0 === t ? void 0 : t.content.isLoading())), h = null 1086 }), i.options.preloaderDelay)) 1087 }; 1088 i.on("change", n), i.on("loadComplete", (t => { 1089 i.currSlide === t.slide && n() 1090 })), i.ui && (i.ui.updatePreloaderVisibility = n) 1091 } 1092}, H = { 1093 name: "counter", order: 5, onInit: (t, i) => { 1094 i.on("change", (() => { 1095 t.innerText = i.currIndex + 1 + i.options.indexIndicatorSep + i.getNumItems() 1096 })) 1097 } 1098}; 1099 1100function K(t, i) { 1101 t.classList.toggle("pswp--zoomed-in", i) 1102} 1103 1104class W { 1105 constructor(t) { 1106 this.pswp = t, this.isRegistered = !1, this.uiElementsData = [], this.items = [], this.updatePreloaderVisibility = () => { 1107 }, this.Tt = void 0 1108 } 1109 1110 init() { 1111 const {pswp: t} = this; 1112 this.isRegistered = !1, this.uiElementsData = [G, U, V, $, q, H], t.dispatch("uiRegister"), this.uiElementsData.sort(((t, i) => (t.order || 0) - (i.order || 0))), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((t => { 1113 this.registerElement(t) 1114 })), t.on("change", (() => { 1115 var i; 1116 null === (i = t.element) || void 0 === i || i.classList.toggle("pswp--one-slide", 1 === t.getNumItems()) 1117 })), t.on("zoomPanUpdate", (() => this.At())) 1118 } 1119 1120 registerElement(t) { 1121 this.isRegistered ? this.items.push(new R(this.pswp, t)) : this.uiElementsData.push(t) 1122 } 1123 1124 At() { 1125 const {template: t, currSlide: i, options: s} = this.pswp; 1126 if (this.pswp.opener.isClosing || !t || !i) return; 1127 let {currZoomLevel: h} = i; 1128 if (this.pswp.opener.isOpen || (h = i.zoomLevels.initial), h === this.Tt) return; 1129 this.Tt = h; 1130 const e = i.zoomLevels.initial - i.zoomLevels.secondary; 1131 if (Math.abs(e) < .01 || !i.isZoomable()) return K(t, !1), void t.classList.remove("pswp--zoom-allowed"); 1132 t.classList.add("pswp--zoom-allowed"); 1133 K(t, (h === i.zoomLevels.initial ? i.zoomLevels.secondary : i.zoomLevels.initial) <= h), "zoom" !== s.imageClickAction && "zoom-or-close" !== s.imageClickAction || t.classList.add("pswp--click-to-zoom") 1134 } 1135} 1136 1137class j { 1138 constructor(t, i) { 1139 this.type = t, this.defaultPrevented = !1, i && Object.assign(this, i) 1140 } 1141 1142 preventDefault() { 1143 this.defaultPrevented = !0 1144 } 1145} 1146 1147class X { 1148 constructor(i, s) { 1149 if (this.element = t("pswp__img pswp__img--placeholder", i ? "img" : "div", s), i) { 1150 const t = this.element; 1151 t.decoding = "async", t.alt = "", t.src = i, t.setAttribute("role", "presentation") 1152 } 1153 this.element.setAttribute("aria-hidden", "true") 1154 } 1155 1156 setDisplayedSize(t, i) { 1157 this.element && ("IMG" === this.element.tagName ? (l(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = o(0, 0, t / 250)) : l(this.element, t, i)) 1158 } 1159 1160 destroy() { 1161 var t; 1162 null !== (t = this.element) && void 0 !== t && t.parentNode && this.element.remove(), this.element = null 1163 } 1164} 1165 1166class Y { 1167 constructor(t, i, s) { 1168 this.instance = i, this.data = t, this.index = s, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state = c, this.data.type ? this.type = this.data.type : this.data.src ? this.type = "image" : this.type = "html", this.instance.dispatch("contentInit", {content: this}) 1169 } 1170 1171 removePlaceholder() { 1172 this.placeholder && !this.keepPlaceholder() && setTimeout((() => { 1173 this.placeholder && (this.placeholder.destroy(), this.placeholder = void 0) 1174 }), 1e3) 1175 } 1176 1177 load(i, s) { 1178 if (this.slide && this.usePlaceholder()) if (this.placeholder) { 1179 const t = this.placeholder.element; 1180 t && !t.parentElement && this.slide.container.prepend(t) 1181 } else { 1182 const t = this.instance.applyFilters("placeholderSrc", !(!this.data.msrc || !this.slide.isFirstSlide) && this.data.msrc, this); 1183 this.placeholder = new X(t, this.slide.container) 1184 } 1185 this.element && !s || this.instance.dispatch("contentLoad", { 1186 content: this, 1187 isLazy: i 1188 }).defaultPrevented || (this.isImageContent() ? (this.element = t("pswp__img", "img"), this.displayedImageWidth && this.loadImage(i)) : (this.element = t("pswp__content", "div"), this.element.innerHTML = this.data.html || ""), s && this.slide && this.slide.updateContentSize(!0)) 1189 } 1190 1191 loadImage(t) { 1192 var i, s; 1193 if (!this.isImageContent() || !this.element || this.instance.dispatch("contentLoadImage", { 1194 content: this, 1195 isLazy: t 1196 }).defaultPrevented) return; 1197 const h = this.element; 1198 this.updateSrcsetSizes(), this.data.srcset && (h.srcset = this.data.srcset), h.src = null !== (i = this.data.src) && void 0 !== i ? i : "", h.alt = null !== (s = this.data.alt) && void 0 !== s ? s : "", this.state = d, h.complete ? this.onLoaded() : (h.onload = () => { 1199 this.onLoaded() 1200 }, h.onerror = () => { 1201 this.onError() 1202 }) 1203 } 1204 1205 setSlide(t) { 1206 this.slide = t, this.hasSlide = !0, this.instance = t.pswp 1207 } 1208 1209 onLoaded() { 1210 this.state = u, this.slide && this.element && (this.instance.dispatch("loadComplete", { 1211 slide: this.slide, 1212 content: this 1213 }), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), this.state !== u && this.state !== p || this.removePlaceholder()) 1214 } 1215 1216 onError() { 1217 this.state = p, this.slide && (this.displayError(), this.instance.dispatch("loadComplete", { 1218 slide: this.slide, 1219 isError: !0, 1220 content: this 1221 }), this.instance.dispatch("loadError", {slide: this.slide, content: this})) 1222 } 1223 1224 isLoading() { 1225 return this.instance.applyFilters("isContentLoading", this.state === d, this) 1226 } 1227 1228 isError() { 1229 return this.state === p 1230 } 1231 1232 isImageContent() { 1233 return "image" === this.type 1234 } 1235 1236 setDisplayedSize(t, i) { 1237 if (this.element && (this.placeholder && this.placeholder.setDisplayedSize(t, i), !this.instance.dispatch("contentResize", { 1238 content: this, 1239 width: t, 1240 height: i 1241 }).defaultPrevented && (l(this.element, t, i), this.isImageContent() && !this.isError()))) { 1242 const s = !this.displayedImageWidth && t; 1243 this.displayedImageWidth = t, this.displayedImageHeight = i, s ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", { 1244 slide: this.slide, 1245 width: t, 1246 height: i, 1247 content: this 1248 }) 1249 } 1250 } 1251 1252 isZoomable() { 1253 return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !== p, this) 1254 } 1255 1256 updateSrcsetSizes() { 1257 if (!this.isImageContent() || !this.element || !this.data.srcset) return; 1258 const t = this.element, i = this.instance.applyFilters("srcsetSizesWidth", this.displayedImageWidth, this); 1259 (!t.dataset.largestUsedSize || i > parseInt(t.dataset.largestUsedSize, 10)) && (t.sizes = i + "px", t.dataset.largestUsedSize = String(i)) 1260 } 1261 1262 usePlaceholder() { 1263 return this.instance.applyFilters("useContentPlaceholder", this.isImageContent(), this) 1264 } 1265 1266 lazyLoad() { 1267 this.instance.dispatch("contentLazyLoad", {content: this}).defaultPrevented || this.load(!0) 1268 } 1269 1270 keepPlaceholder() { 1271 return this.instance.applyFilters("isKeepingPlaceholder", this.isLoading(), this) 1272 } 1273 1274 destroy() { 1275 this.hasSlide = !1, this.slide = void 0, this.instance.dispatch("contentDestroy", {content: this}).defaultPrevented || (this.remove(), this.placeholder && (this.placeholder.destroy(), this.placeholder = void 0), this.isImageContent() && this.element && (this.element.onload = null, this.element.onerror = null, this.element = void 0)) 1276 } 1277 1278 displayError() { 1279 if (this.slide) { 1280 var i, s; 1281 let h = t("pswp__error-msg", "div"); 1282 h.innerText = null !== (i = null === (s = this.instance.options) || void 0 === s ? void 0 : s.errorMsg) && void 0 !== i ? i : "", h = this.instance.applyFilters("contentErrorElement", h, this), this.element = t("pswp__content pswp__error-msg-container", "div"), this.element.appendChild(h), this.slide.container.innerText = "", this.slide.container.appendChild(this.element), this.slide.updateContentSize(!0), this.removePlaceholder() 1283 } 1284 } 1285 1286 append() { 1287 if (this.isAttached || !this.element) return; 1288 if (this.isAttached = !0, this.state === p) return void this.displayError(); 1289 if (this.instance.dispatch("contentAppend", {content: this}).defaultPrevented) return; 1290 const t = "decode" in this.element; 1291 this.isImageContent() ? t && this.slide && (!this.slide.isActive || m()) ? (this.isDecoding = !0, this.element.decode().catch((() => { 1292 })).finally((() => { 1293 this.isDecoding = !1, this.appendImage() 1294 }))) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element) 1295 } 1296 1297 activate() { 1298 !this.instance.dispatch("contentActivate", {content: this}).defaultPrevented && this.slide && (this.isImageContent() && this.isDecoding && !m() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false")) 1299 } 1300 1301 deactivate() { 1302 this.instance.dispatch("contentDeactivate", {content: this}), this.slide && this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "true") 1303 } 1304 1305 remove() { 1306 this.isAttached = !1, this.instance.dispatch("contentRemove", {content: this}).defaultPrevented || (this.element && this.element.parentNode && this.element.remove(), this.placeholder && this.placeholder.element && this.placeholder.element.remove()) 1307 } 1308 1309 appendImage() { 1310 this.isAttached && (this.instance.dispatch("contentAppendImage", {content: this}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), this.state !== u && this.state !== p || this.removePlaceholder())) 1311 } 1312} 1313 1314function J(t, i, s) { 1315 const h = i.createContentFromData(t, s); 1316 let e; 1317 const {options: n} = i; 1318 if (n) { 1319 let o; 1320 e = new x(n, t, -1), o = i.pswp ? i.pswp.viewportSize : w(n, i); 1321 const r = y(n, o, t, s); 1322 e.update(h.width, h.height, r) 1323 } 1324 return h.lazyLoad(), e && h.setDisplayedSize(Math.ceil(h.width * e.initial), Math.ceil(h.height * e.initial)), h 1325} 1326 1327class Q { 1328 constructor(t) { 1329 this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, 5), this.Dt = [] 1330 } 1331 1332 updateLazy(t) { 1333 const {pswp: i} = this; 1334 if (i.dispatch("lazyLoad").defaultPrevented) return; 1335 const {preload: s} = i.options, h = void 0 === t || t >= 0; 1336 let e; 1337 for (e = 0; e <= s[1]; e++) this.loadSlideByIndex(i.currIndex + (h ? e : -e)); 1338 for (e = 1; e <= s[0]; e++) this.loadSlideByIndex(i.currIndex + (h ? -e : e)) 1339 } 1340 1341 loadSlideByIndex(t) { 1342 const i = this.pswp.getLoopedIndex(t); 1343 let s = this.getContentByIndex(i); 1344 s || (s = function (t, i) { 1345 const s = i.getItemData(t); 1346 if (!i.dispatch("lazyLoadSlide", {index: t, itemData: s}).defaultPrevented) return J(s, i, t) 1347 }(i, this.pswp), s && this.addToCache(s)) 1348 } 1349 1350 getContentBySlide(t) { 1351 let i = this.getContentByIndex(t.index); 1352 return i || (i = this.pswp.createContentFromData(t.data, t.index), this.addToCache(i)), i.setSlide(t), i 1353 } 1354 1355 addToCache(t) { 1356 if (this.removeByIndex(t.index), this.Dt.push(t), this.Dt.length > this.limit) { 1357 const t = this.Dt.findIndex((t => !t.isAttached && !t.hasSlide)); 1358 if (-1 !== t) { 1359 this.Dt.splice(t, 1)[0].destroy() 1360 } 1361 } 1362 } 1363 1364 removeByIndex(t) { 1365 const i = this.Dt.findIndex((i => i.index === t)); 1366 -1 !== i && this.Dt.splice(i, 1) 1367 } 1368 1369 getContentByIndex(t) { 1370 return this.Dt.find((i => i.index === t)) 1371 } 1372 1373 destroy() { 1374 this.Dt.forEach((t => t.destroy())), this.Dt = [] 1375 } 1376} 1377 1378class tt { 1379 constructor(t) { 1380 this.pswp = t, this.isClosed = !0, this.isOpen = !1, this.isClosing = !1, this.isOpening = !1, this.It = void 0, this.Et = !1, this.Lt = !1, this.kt = !1, this.Zt = !1, this.Bt = void 0, this.Ft = void 0, this.Ot = void 0, this.Rt = void 0, this.Nt = void 0, this.Ut = this.Ut.bind(this), t.on("firstZoomPan", this.Ut) 1381 } 1382 1383 open() { 1384 this.Ut(), this.Pt() 1385 } 1386 1387 close() { 1388 if (this.isClosed || this.isClosing || this.isOpening) return; 1389 const t = this.pswp.currSlide; 1390 this.isOpen = !1, this.isOpening = !1, this.isClosing = !0, this.It = this.pswp.options.hideAnimationDuration, t && t.currZoomLevel * t.width >= this.pswp.options.maxWidthToAnimate && (this.It = 0), this.Vt(), setTimeout((() => { 1391 this.Pt() 1392 }), this.Lt ? 30 : 0) 1393 } 1394 1395 Ut() { 1396 if (this.pswp.off("firstZoomPan", this.Ut), !this.isOpening) { 1397 const t = this.pswp.currSlide; 1398 this.isOpening = !0, this.isClosing = !1, this.It = this.pswp.options.showAnimationDuration, t && t.zoomLevels.initial * t.width >= this.pswp.options.maxWidthToAnimate && (this.It = 0), this.Vt() 1399 } 1400 } 1401 1402 Vt() { 1403 const {pswp: t} = this, i = this.pswp.currSlide, {options: s} = t; 1404 var h, e; 1405 ("fade" === s.showHideAnimationType ? (s.showHideOpacity = !0, this.Nt = void 0) : "none" === s.showHideAnimationType ? (s.showHideOpacity = !1, this.It = 0, this.Nt = void 0) : this.isOpening && t.Gt ? this.Nt = t.Gt : this.Nt = this.pswp.getThumbBounds(), this.Bt = null == i ? void 0 : i.getPlaceholderElement(), t.animations.stopAll(), this.Et = Boolean(this.It && this.It > 50), this.$t = Boolean(this.Nt) && (null == i ? void 0 : i.content.usePlaceholder()) && (!this.isClosing || !t.mainScroll.isShifted()), this.$t) ? this.kt = null !== (h = s.showHideOpacity) && void 0 !== h && h : (this.kt = !0, this.isOpening && i && (i.zoomAndPanToInitial(), i.applyCurrentZoomPan())); 1406 if (this.Zt = !this.kt && this.pswp.options.bgOpacity > .003, this.Ft = this.kt ? t.element : t.bg, !this.Et) return this.It = 0, this.$t = !1, this.Zt = !1, this.kt = !0, void (this.isOpening && (t.element && (t.element.style.opacity = String(.003)), t.applyBgOpacity(1))); 1407 this.$t && this.Nt && this.Nt.innerRect ? (this.Lt = !0, this.Ot = this.pswp.container, this.Rt = null === (e = this.pswp.currSlide) || void 0 === e ? void 0 : e.holderElement, t.container && (t.container.style.overflow = "hidden", t.container.style.width = t.viewportSize.x + "px")) : this.Lt = !1; 1408 this.isOpening ? (this.kt ? (t.element && (t.element.style.opacity = String(.003)), t.applyBgOpacity(1)) : (this.Zt && t.bg && (t.bg.style.opacity = String(.003)), t.element && (t.element.style.opacity = "1")), this.$t && (this.qt(), this.Bt && (this.Bt.style.willChange = "transform", this.Bt.style.opacity = String(.003)))) : this.isClosing && (t.mainScroll.itemHolders[0] && (t.mainScroll.itemHolders[0].el.style.display = "none"), t.mainScroll.itemHolders[2] && (t.mainScroll.itemHolders[2].el.style.display = "none"), this.Lt && 0 !== t.mainScroll.x && (t.mainScroll.resetPosition(), t.mainScroll.resize())) 1409 } 1410 1411 Pt() { 1412 this.isOpening && this.Et && this.Bt && "IMG" === this.Bt.tagName ? new Promise((t => { 1413 let i = !1, s = !0; 1414 var h; 1415 (h = this.Bt, "decode" in h ? h.decode().catch((() => { 1416 })) : h.complete ? Promise.resolve(h) : new Promise(((t, i) => { 1417 h.onload = () => t(h), h.onerror = i 1418 }))).finally((() => { 1419 i = !0, s || t(!0) 1420 })), setTimeout((() => { 1421 s = !1, i && t(!0) 1422 }), 50), setTimeout(t, 250) 1423 })).finally((() => this.Ht())) : this.Ht() 1424 } 1425 1426 Ht() { 1427 var t, i; 1428 null === (t = this.pswp.element) || void 0 === t || t.style.setProperty("--pswp-transition-duration", this.It + "ms"), this.pswp.dispatch(this.isOpening ? "openingAnimationStart" : "closingAnimationStart"), this.pswp.dispatch("initialZoom" + (this.isOpening ? "In" : "Out")), null === (i = this.pswp.element) || void 0 === i || i.classList.toggle("pswp--ui-visible", this.isOpening), this.isOpening ? (this.Bt && (this.Bt.style.opacity = "1"), this.Kt()) : this.isClosing && this.Wt(), this.Et || this.jt() 1429 } 1430 1431 jt() { 1432 const {pswp: t} = this; 1433 if (this.isOpen = this.isOpening, this.isClosed = this.isClosing, this.isOpening = !1, this.isClosing = !1, t.dispatch(this.isOpen ? "openingAnimationEnd" : "closingAnimationEnd"), t.dispatch("initialZoom" + (this.isOpen ? "InEnd" : "OutEnd")), this.isClosed) t.destroy(); else if (this.isOpen) { 1434 var i; 1435 this.$t && t.container && (t.container.style.overflow = "visible", t.container.style.width = "100%"), null === (i = t.currSlide) || void 0 === i || i.applyCurrentZoomPan() 1436 } 1437 } 1438 1439 Kt() { 1440 const {pswp: t} = this; 1441 this.$t && (this.Lt && this.Ot && this.Rt && (this.Xt(this.Ot, "transform", "translate3d(0,0,0)"), this.Xt(this.Rt, "transform", "none")), t.currSlide && (t.currSlide.zoomAndPanToInitial(), this.Xt(t.currSlide.container, "transform", t.currSlide.getCurrentTransform()))), this.Zt && t.bg && this.Xt(t.bg, "opacity", String(t.options.bgOpacity)), this.kt && t.element && this.Xt(t.element, "opacity", "1") 1442 } 1443 1444 Wt() { 1445 const {pswp: t} = this; 1446 this.$t && this.qt(!0), this.Zt && t.bgOpacity > .01 && t.bg && this.Xt(t.bg, "opacity", "0"), this.kt && t.element && this.Xt(t.element, "opacity", "0") 1447 } 1448 1449 qt(t) { 1450 if (!this.Nt) return; 1451 const {pswp: s} = this, {innerRect: h} = this.Nt, {currSlide: e, viewportSize: n} = s; 1452 if (this.Lt && h && this.Ot && this.Rt) { 1453 const i = -n.x + (this.Nt.x - h.x) + h.w, s = -n.y + (this.Nt.y - h.y) + h.h, e = n.x - h.w, a = n.y - h.h; 1454 t ? (this.Xt(this.Ot, "transform", o(i, s)), this.Xt(this.Rt, "transform", o(e, a))) : (r(this.Ot, i, s), r(this.Rt, e, a)) 1455 } 1456 e && (i(e.pan, h || this.Nt), e.currZoomLevel = this.Nt.w / e.width, t ? this.Xt(e.container, "transform", e.getCurrentTransform()) : e.applyCurrentZoomPan()) 1457 } 1458 1459 Xt(t, i, s) { 1460 if (!this.It) return void (t.style[i] = s); 1461 const {animations: h} = this.pswp, e = { 1462 duration: this.It, easing: this.pswp.options.easing, onComplete: () => { 1463 h.activeAnimations.length || this.jt() 1464 }, target: t 1465 }; 1466 e[i] = s, h.startTransition(e) 1467 } 1468} 1469 1470const it = { 1471 allowPanToNext: !0, 1472 spacing: .1, 1473 loop: !0, 1474 pinchToClose: !0, 1475 closeOnVerticalDrag: !0, 1476 hideAnimationDuration: 0, 1477 showAnimationDuration: 0, 1478 zoomAnimationDuration: 333, 1479 escKey: !0, 1480 arrowKeys: !0, 1481 trapFocus: !0, 1482 returnFocus: !0, 1483 maxWidthToAnimate: 4e3, 1484 clickToCloseNonZoomable: !0, 1485 imageClickAction: "zoom-or-close", 1486 bgClickAction: "close", 1487 tapAction: "toggle-controls", 1488 doubleTapAction: "zoom", 1489 indexIndicatorSep: " / ", 1490 preloaderDelay: 2e3, 1491 bgOpacity: .8, 1492 index: 0, 1493 errorMsg: "The image cannot be loaded", 1494 preload: [1, 2], 1495 easing: "cubic-bezier(.4,0,.22,1)" 1496}; 1497 1498class st extends class extends class { 1499 constructor() { 1500 this.Yt = {}, this.Jt = {}, this.pswp = void 0, this.options = void 0 1501 } 1502 1503 addFilter(t, i, s = 100) { 1504 var h, e, n; 1505 this.Jt[t] || (this.Jt[t] = []), null === (h = this.Jt[t]) || void 0 === h || h.push({ 1506 fn: i, 1507 priority: s 1508 }), null === (e = this.Jt[t]) || void 0 === e || e.sort(((t, i) => t.priority - i.priority)), null === (n = this.pswp) || void 0 === n || n.addFilter(t, i, s) 1509 } 1510 1511 removeFilter(t, i) { 1512 this.Jt[t] && (this.Jt[t] = this.Jt[t].filter((t => t.fn !== i))), this.pswp && this.pswp.removeFilter(t, i) 1513 } 1514 1515 applyFilters(t, ...i) { 1516 var s; 1517 return null === (s = this.Jt[t]) || void 0 === s || s.forEach((t => { 1518 i[0] = t.fn.apply(this, i) 1519 })), i[0] 1520 } 1521 1522 on(t, i) { 1523 var s, h; 1524 this.Yt[t] || (this.Yt[t] = []), null === (s = this.Yt[t]) || void 0 === s || s.push(i), null === (h = this.pswp) || void 0 === h || h.on(t, i) 1525 } 1526 1527 off(t, i) { 1528 var s; 1529 this.Yt[t] && (this.Yt[t] = this.Yt[t].filter((t => i !== t))), null === (s = this.pswp) || void 0 === s || s.off(t, i) 1530 } 1531 1532 dispatch(t, i) { 1533 var s; 1534 if (this.pswp) return this.pswp.dispatch(t, i); 1535 const h = new j(t, i); 1536 return null === (s = this.Yt[t]) || void 0 === s || s.forEach((t => { 1537 t.call(this, h) 1538 })), h 1539 } 1540} { 1541 getNumItems() { 1542 var t; 1543 let i = 0; 1544 const s = null === (t = this.options) || void 0 === t ? void 0 : t.dataSource; 1545 s && "length" in s ? i = s.length : s && "gallery" in s && (s.items || (s.items = this.Qt(s.gallery)), s.items && (i = s.items.length)); 1546 const h = this.dispatch("numItems", {dataSource: s, numItems: i}); 1547 return this.applyFilters("numItems", h.numItems, s) 1548 } 1549 1550 createContentFromData(t, i) { 1551 return new Y(t, this, i) 1552 } 1553 1554 getItemData(t) { 1555 var i; 1556 const s = null === (i = this.options) || void 0 === i ? void 0 : i.dataSource; 1557 let h = {}; 1558 Array.isArray(s) ? h = s[t] : s && "gallery" in s && (s.items || (s.items = this.Qt(s.gallery)), h = s.items[t]); 1559 let e = h; 1560 e instanceof Element && (e = this.ti(e)); 1561 const n = this.dispatch("itemData", {itemData: e || {}, index: t}); 1562 return this.applyFilters("itemData", n.itemData, t) 1563 } 1564 1565 Qt(t) { 1566 var i, s; 1567 return null !== (i = this.options) && void 0 !== i && i.children || null !== (s = this.options) && void 0 !== s && s.childSelector ? function (t, i, s = document) { 1568 let h = []; 1569 if (t instanceof Element) h = [t]; else if (t instanceof NodeList || Array.isArray(t)) h = Array.from(t); else { 1570 const e = "string" == typeof t ? t : i; 1571 e && (h = Array.from(s.querySelectorAll(e))) 1572 } 1573 return h 1574 }(this.options.children, this.options.childSelector, t) || [] : [t] 1575 } 1576 1577 ti(t) { 1578 const i = {element: t}, s = "A" === t.tagName ? t : t.querySelector("a"); 1579 if (s) { 1580 i.src = s.dataset.pswpSrc || s.href, s.dataset.pswpSrcset && (i.srcset = s.dataset.pswpSrcset), i.width = s.dataset.pswpWidth ? parseInt(s.dataset.pswpWidth, 10) : 0, i.height = s.dataset.pswpHeight ? parseInt(s.dataset.pswpHeight, 10) : 0, i.w = i.width, i.h = i.height, s.dataset.pswpType && (i.type = s.dataset.pswpType); 1581 const e = t.querySelector("img"); 1582 var h; 1583 if (e) i.msrc = e.currentSrc || e.src, i.alt = null !== (h = e.getAttribute("alt")) && void 0 !== h ? h : ""; 1584 (s.dataset.pswpCropped || s.dataset.cropped) && (i.thumbCropped = !0) 1585 } 1586 return this.applyFilters("domItemData", i, t, s) 1587 } 1588 1589 lazyLoadData(t, i) { 1590 return J(t, this, i) 1591 } 1592} { 1593 constructor(t) { 1594 super(), this.options = this.ii(t || {}), this.offset = {x: 0, y: 0}, this.si = { 1595 x: 0, 1596 y: 0 1597 }, this.viewportSize = { 1598 x: 0, 1599 y: 0 1600 }, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this.hi = {}, this.Gt = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new f, this.animations = new F, this.mainScroll = new A(this), this.gestures = new T(this), this.opener = new tt(this), this.keyboard = new E(this), this.contentLoader = new Q(this) 1601 } 1602 1603 init() { 1604 if (this.isOpen || this.isDestroying) return !1; 1605 this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this.ei(); 1606 let t = "pswp--open"; 1607 return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new O(this), (Number.isNaN(this.currIndex) || this.currIndex < 0 || this.currIndex >= this.getNumItems()) && (this.currIndex = 0), this.gestures.supportsTouch || this.mouseDetected(), this.updateSize(), this.offset.y = window.pageYOffset, this.hi = this.getItemData(this.currIndex), this.dispatch("gettingData", { 1608 index: this.currIndex, 1609 data: this.hi, 1610 slide: void 0 1611 }), this.Gt = this.getThumbBounds(), this.dispatch("initialLayout"), this.on("openingAnimationEnd", (() => { 1612 const {itemHolders: t} = this.mainScroll; 1613 t[0] && (t[0].el.style.display = "block", this.setContent(t[0], this.currIndex - 1)), t[2] && (t[2].el.style.display = "block", this.setContent(t[2], this.currIndex + 1)), this.appendHeavy(), this.contentLoader.updateLazy(), this.events.add(window, "resize", this.ni.bind(this)), this.events.add(window, "scroll", this.oi.bind(this)), this.dispatch("bindEvents") 1614 })), this.mainScroll.itemHolders[1] && this.setContent(this.mainScroll.itemHolders[1], this.currIndex), this.dispatch("change"), this.opener.open(), this.dispatch("afterInit"), !0 1615 } 1616 1617 getLoopedIndex(t) { 1618 const i = this.getNumItems(); 1619 return this.options.loop && (t > i - 1 && (t -= i), t < 0 && (t += i)), n(t, 0, i - 1) 1620 } 1621 1622 appendHeavy() { 1623 this.mainScroll.itemHolders.forEach((t => { 1624 var i; 1625 null === (i = t.slide) || void 0 === i || i.appendHeavy() 1626 })) 1627 } 1628 1629 goTo(t) { 1630 this.mainScroll.moveIndexBy(this.getLoopedIndex(t) - this.potentialIndex) 1631 } 1632 1633 next() { 1634 this.goTo(this.potentialIndex + 1) 1635 } 1636 1637 prev() { 1638 this.goTo(this.potentialIndex - 1) 1639 } 1640 1641 zoomTo(...t) { 1642 var i; 1643 null === (i = this.currSlide) || void 0 === i || i.zoomTo(...t) 1644 } 1645 1646 toggleZoom() { 1647 var t; 1648 null === (t = this.currSlide) || void 0 === t || t.toggleZoom() 1649 } 1650 1651 close() { 1652 this.opener.isOpen && !this.isDestroying && (this.isDestroying = !0, this.dispatch("close"), this.events.removeAll(), this.opener.close()) 1653 } 1654 1655 destroy() { 1656 var t; 1657 if (!this.isDestroying) return this.options.showHideAnimationType = "none", void this.close(); 1658 this.dispatch("destroy"), this.Yt = {}, this.scrollWrap && (this.scrollWrap.ontouchmove = null, this.scrollWrap.ontouchend = null), null === (t = this.element) || void 0 === t || t.remove(), this.mainScroll.itemHolders.forEach((t => { 1659 var i; 1660 null === (i = t.slide) || void 0 === i || i.destroy() 1661 })), this.contentLoader.destroy(), this.events.removeAll() 1662 } 1663 1664 refreshSlideContent(t) { 1665 this.contentLoader.removeByIndex(t), this.mainScroll.itemHolders.forEach(((i, s) => { 1666 var h, e; 1667 let n = (null !== (h = null === (e = this.currSlide) || void 0 === e ? void 0 : e.index) && void 0 !== h ? h : 0) - 1 + s; 1668 var o; 1669 (this.canLoop() && (n = this.getLoopedIndex(n)), n === t) && (this.setContent(i, t, !0), 1 === s && (this.currSlide = i.slide, null === (o = i.slide) || void 0 === o || o.setIsActive(!0))) 1670 })), this.dispatch("change") 1671 } 1672 1673 setContent(t, i, s) { 1674 if (this.canLoop() && (i = this.getLoopedIndex(i)), t.slide) { 1675 if (t.slide.index === i && !s) return; 1676 t.slide.destroy(), t.slide = void 0 1677 } 1678 if (!this.canLoop() && (i < 0 || i >= this.getNumItems())) return; 1679 const h = this.getItemData(i); 1680 t.slide = new b(h, i, this), i === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el) 1681 } 1682 1683 getViewportCenterPoint() { 1684 return {x: this.viewportSize.x / 2, y: this.viewportSize.y / 2} 1685 } 1686 1687 updateSize(t) { 1688 if (this.isDestroying) return; 1689 const s = w(this.options, this); 1690 !t && e(s, this.si) || (i(this.si, s), this.dispatch("beforeResize"), i(this.viewportSize, this.si), this.oi(), this.dispatch("viewportSize"), this.mainScroll.resize(this.opener.isOpen), !this.hasMouse && window.matchMedia("(any-hover: hover)").matches && this.mouseDetected(), this.dispatch("resize")) 1691 } 1692 1693 applyBgOpacity(t) { 1694 this.bgOpacity = Math.max(t, 0), this.bg && (this.bg.style.opacity = String(this.bgOpacity * this.options.bgOpacity)) 1695 } 1696 1697 mouseDetected() { 1698 var t; 1699 this.hasMouse || (this.hasMouse = !0, null === (t = this.element) || void 0 === t || t.classList.add("pswp--has_mouse")) 1700 } 1701 1702 ni() { 1703 this.updateSize(), /iPhone|iPad|iPod/i.test(window.navigator.userAgent) && setTimeout((() => { 1704 this.updateSize() 1705 }), 500) 1706 } 1707 1708 oi() { 1709 this.setScrollOffset(0, window.pageYOffset) 1710 } 1711 1712 setScrollOffset(t, i) { 1713 this.offset.x = t, this.offset.y = i, this.dispatch("updateScrollOffset") 1714 } 1715 1716 ei() { 1717 this.element = t("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = t("pswp__bg", "div", this.element), this.scrollWrap = t("pswp__scroll-wrap", "section", this.element), this.container = t("pswp__container", "div", this.scrollWrap), this.scrollWrap.setAttribute("aria-roledescription", "carousel"), this.container.setAttribute("aria-live", "off"), this.container.setAttribute("id", "pswp__items"), this.mainScroll.appendHolders(), this.ui = new W(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element) 1718 } 1719 1720 getThumbBounds() { 1721 return function (t, i, s) { 1722 const h = s.dispatch("thumbBounds", {index: t, itemData: i, instance: s}); 1723 if (h.thumbBounds) return h.thumbBounds; 1724 const {element: e} = i; 1725 let n, o; 1726 if (e && !1 !== s.options.thumbSelector) { 1727 const t = s.options.thumbSelector || "img"; 1728 o = e.matches(t) ? e : e.querySelector(t) 1729 } 1730 return o = s.applyFilters("thumbEl", o, i, t), o && (n = i.thumbCropped ? function (t, i, s) { 1731 const h = t.getBoundingClientRect(), e = h.width / i, n = h.height / s, o = e > n ? e : n, 1732 r = (h.width - i * o) / 2, a = (h.height - s * o) / 2, l = {x: h.left + r, y: h.top + a, w: i * o}; 1733 return l.innerRect = {w: h.width, h: h.height, x: r, y: a}, l 1734 }(o, i.width || i.w || 0, i.height || i.h || 0) : function (t) { 1735 const i = t.getBoundingClientRect(); 1736 return {x: i.left, y: i.top, w: i.width} 1737 }(o)), s.applyFilters("thumbBounds", n, i, t) 1738 }(this.currIndex, this.currSlide ? this.currSlide.data : this.hi, this) 1739 } 1740 1741 canLoop() { 1742 return this.options.loop && this.getNumItems() > 2 1743 } 1744 1745 ii(t) { 1746 return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {...it, ...t} 1747 } 1748} 1749window.PhotoSwipe = window.PhotoSwipe || st;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.