Samsung Galaxy Watch6 (2024)

Galaxy Watch6

BUY NOW

PRE-REGISTER

Pre-order now

Samsung Galaxy Watch6 (1)

The watch that knows you best is back with a more personalized health experience and better yet, upgraded sleep tracking. Start off your day with a good night's sleep with Sleep coaching now available on Galaxy Watch6.

Galaxy Watch6Start your everyday wellness journey

Sleep Tracking
Display
Health
Exercise
Customise

Samsung Galaxy Watch6 (2)

Samsung Galaxy Watch6 (3)

Galaxy Watch6 can be seen displaying Sleep score screen. The progress bar is advancing as the sleep score '82' appears with the text 'Excellent' below. The sleep animal, a lion, appears at the bottom of the screen.

Develop healthy sleeping habits Go to Sleep Tracking

Samsung Galaxy Watch6 (5)

Samsung Galaxy Watch6 (6)

Galaxy Watch6 can be seen rotating and then facing the front. Black margin of the display is being reduced to emphasize the larger display.

Large space to view, tap, swipe and scroll Go to Display

Samsung Galaxy Watch6 (8)

Samsung Galaxy Watch6 (9)

GUI of ECG being measured can be seen, with the measure time changing from 15 to 10 seconds and the bpm changing between 72 and 77. Under the numbers is a moving graph illustrating the heartbeat.

Get detailed insights on your body and wellness Go to Health

Samsung Galaxy Watch6 (11)

Set your own goals and get tips on your fitness journey Go to Exercise

Samsung Galaxy Watch6 (13)

Express your own unique style Go to Customize

Display Sleep Tracking Health Exercise Customise

Close Popup

20% larger
30% slimmer

Get even more info at a glance on up to 20% more display. The up to 30% slimmer black margin makes way for Galaxy Watch's biggest screen yet, and more space for self expression with customizable watch faces.1, 2

More screen.

Thinner bezel

Samsung Galaxy Watch6 (15)

Samsung Galaxy Watch6 (16)

Introducing
a slimmer form

Two Galaxy Watch6 can be seen. The first one is positioned to show its thinness. The second one is zoomed in to emphasize the slim design of Galaxy Watch6.

Samsung Galaxy Watch6 (17)

Samsung Galaxy Watch6 (18)

Style and comfort join forces in this slimmer, sleeker shape. Galaxy Watch6 has been redesigned with a trimmed-down watch form, making it easier to wear. The seamless fit and timeless circular design are an ultra-comfortable, lightweight trick up your sleeve.3

Switching bands is One-Click easy

Press the band release button to detach your watch straps easily. Swap them out to change from workout to go-out styles with just one touch. The band guide makes it easy to align, with a satisfying click once it's reattached.4

Scratches are no
match for Sapphire
Crystal glass

Ready for anything, rain or shine. Ultra-durable Sapphire Crystal glass makes for a resilient and sturdy watch display, while IP68 and 5ATM ratings mean your watch is tough enough to stay with you on your adventures.5, 6

Samsung Galaxy Watch6 (21)

Defy the dangers of dust

Samsung Galaxy Watch6 (22)

Afraid of water? Not on our watch

Samsung Galaxy Watch6 (23)

Samsung Galaxy Watch6 (24)

Galaxy Watch6 can be seen facing upward with the display zoomed in, with waterdrops next to the Watch to indicate that it is waterproof. A gleam of light goes over the display to emphasize the durability of the Sapphire Crystal glass.

18% faster processor

Samsung Galaxy Watch6 (25)

Lasts 40 hours

Samsung Galaxy Watch6 (26)

Charge up
in
record time

With one full charge, the watch lasts up to 40 hours. Fast charge the watch to 45% in just 30 minutes and you're all set to explore the great outdoors or enjoy a well-deserved break in bed.7, 8, 9

Up to 45 %

charged in 30 min

Samsung Galaxy Watch6 (27)

Samsung Galaxy Watch6 (28)

Front view of Galaxy Watch6 can be seen with the charging screen GUI on display. The number on the screen goes up from '50%' to '100%', implying the battery is being fully charged.

Our most powerful watch ever

The upgraded processor makes Galaxy Watch6 18% faster than before, improving app launch speed. So whether you're starting off the day with a run or settling in for the night, it keeps up with every gesture.3

Samsung Galaxy Watch6 (29)

Samsung Galaxy Watch6 (30)

Galaxy Watch6 processor is being assembled with the bezel and display.

Better days
begin with
better nights

Samsung Galaxy Watch6 (31)

Understand your nights to make the most of your days. Wear your Galaxy Watch6 to bed and monitor your nightly sleep stage, sleep score and sleep consistency to improve your sleep. And now you can access Sleep Coaching directly on your watch, so you can check tips right on your wrist.10, 11, 12, 13, 14, 15, 16

Information on the time spent in each sleep stage can be seen: Awake 35m, REM 1h 30m, Light 4h 30m, Deep 55m. The information is also displayed as a graph.

Samsung Galaxy Watch6 (32)

Samsung Galaxy Watch6 (33)

Samsung Galaxy Watch6 (34)

Better together

Fabric Band

Light and comfortable Optimized for sleep

Learn more

Samsung Galaxy Watch6 (37)

Be prepared with Cycle Tracking

Get in tune with your health and body. Cycle Tracking powered by Samsung Galaxy Watch6 (38) uses your nightly skin temperature from your watch, measured while you sleep, to predict the dates of your period and other cycles. Plan ahead and live life to the fullest with Galaxy Watch6.17

A heart monitoring package that watches over you

Lessen your worries with a heart monitoring package that brings you peace of mind, so you can focus on your day. The built-in PPG sensor periodically measures heart rate while you wear your Galaxy Watch6, and will alert you if your heart rate is too high or too low. Use the ECG sensor for more detailed measurements. 18, 19

Samsung Galaxy Watch6 (39)

Samsung Galaxy Watch6 (40)

GUI of ECG being measured can be seen, with the measure time changing from 26 to 31 seconds and the bpm changing between 72 and 77. Under the numbers is a moving graph illustrating the heartbeat.

Add a quick BP check to your wellness routine

Maintain a healthy lifestyle by adding a quick blood pressure check to your daily routine. Measure and track your blood pressure right on your wrist with Galaxy Watch6. No additional equipment required!21, 22, 23, 24

Samsung Galaxy Watch6 (41)

Samsung Galaxy Watch6 (42)

Know your body inside and out with BIA

Skip the clunky machines - collect data on your body any time you like, with the Bioelectrical Impedance Analysis (BIA) sensor on your Galaxy Watch6. These measurements will help you take a data-driven approach to monitor your body and health better and set personalized fitness goals.25, 26, 27

Samsung Galaxy Watch6 (43)

Safety features for your peace of mind

Your watch is on standby in case of an emergency. Should you take a tumble, Fall Detection will catch it and ask if you need help. For other emergencies, simply press the home button five times to send SOS to emergency services. When help arrives, quickly access your Medical info from the lock screen with a single tap. Rest assured, now you're in good hands.27, 28, 29, 30

Samsung Galaxy Watch6 (44)

Samsung Galaxy Watch6 (45)

Samsung Galaxy Watch6 (46)

Daily activity screen can be seen, with the progress bars advancing.

Exercise tracking - Monitor your
fitness journey

Record each of your physical accomplishments, and check all of your progress with Galaxy Watch6. Track your movements for over 90 workouts, including indoor swimming and yoga, or you can even create your own custom workout. Forget to hit start? Your watch will automatically recognize and record select workouts such as running, walking and now, even cycling, so you don't lose precious data.26, 31, 32

Samsung Galaxy Watch6 (47)

Samsung Galaxy Watch6 (48)

Different workout icons can be seen. In the middle is the cycling icon with the person sitting upright. The person begins cycling and slowly bends forward as other workout icons appear from the right.

Set your perfect
intensity with
personalized HR Zone

Samsung Galaxy Watch6 (49)

Samsung Galaxy Watch6 (50)

Set a personalized HR Zone. Or just start running and Galaxy Watch6 will measure your heart rate based on your fitness capacity and optimize an HR Zone that suits you. Once set, you can get notified when you enter your goal HR Zone and make sure you're still in the zone as you move, run and work out to your own beat.34

Start a healthy competition amongst friends and family

Create challenges and let your competitive side shine. Invite your workout buddies, and encourage each other to go the extra mile. Celebrate progress, achievements and personal bests together.

Samsung Galaxy Watch6 (51)

Snap remote
Galaxy Z Flip5 photos from
your watch

Pair your watch with Galaxy Z Flip5 to capture the healthy you up close or from a distance. Galaxy Z Flip5's Flex mode and Camera Controller let you easily switch between photo and video mode, or zoom in and out, all from the comfort of your wrist. Then tap the shutter button on your watch to take a pic.34, 35

Samsung Galaxy Watch6 (52)

Samsung Galaxy Watch6 (53)

On the right is Galaxy Z Flip5 on Flex mode. On the left is Galaxy Watch6 displaying the same screen as Galaxy Z Flip5, illustrating the Camera Controller feature.

More than just a watch

Way more than just a clock. With Galaxy Watch6, you can still text, call, stream music and more, even without your phone. Stay productive and carry on with your day.36, 37

Call Text Stream Music

Call Samsung Galaxy Watch6 (54)

Text Samsung Galaxy Watch6 (55)

Stream Music Samsung Galaxy Watch6 (56)

International Roaming keeps contacts close

Explore the world without getting lost. International Roaming on Galaxy Watch6 allows you to use the map to find your way to landmarks, all from your watch. If you do get into trouble, no need to worry — you'll be able to make calls or send texts to ask for help.38, 39

Samsung Galaxy Watch6 (57)

Samsung Wallet is available on your watch

Don't fumble in your pockets or rummage through your bag looking for cash or cards — you've got Samsung Wallet for that. Now you can pay and ride without taking out your phone, because everything you need is just a swipe or tap away.41

Samsung Galaxy Watch6 (58)

Tap into more apps

Enjoy a variety of popular third-party apps such as Audible, WhatsApp, Spotify and more - all on your Galaxy Watch6 with your smartphone safely in your pocket. 43 41

Samsung Galaxy Watch6 (59)

GPS points you in the right direction

By enabling your watch's built-in GPS on Google Maps, you'll stay on the right path. So even when your adventures take you far, you can find your way home with ease.43, 44

Samsung Galaxy Watch6 (60)

Samsung Galaxy Watch6 (61)

Customise to suit your personality

Make Galaxy Watch6 uniquely your own. Choose from a wide collection of bands in different styles and materials. You can also customize your watch face with your favorite colours, complications, designs or even photos of your pet. The only limit is your imagination.4

Samsung Galaxy Watch6 (62)

Switch and upgrade.
It's so easy

Trade in and save

LEARN MORE

Samsung Galaxy Watch6 (63)

Watch how easy switching is

Smart Switch is the sure and secure way to transfer your data to Galaxy. Take all your apps, watch faces, settings and more, with you when you make the switch.47, 48, 49, 50

LEARN MORE

Samsung Galaxy Watch6 (64)

It's time to find your Watch

  • Galaxy Watch6

    Samsung Galaxy Watch6 (65)

    Samsung Galaxy Watch6 (66)

    Samsung Galaxy Watch6 (67)

    Samsung Galaxy Watch6 (68)

    Buy Now

    Learn More

    • Samsung Galaxy Watch6 (69) Display Sapphire Crystal
    • Samsung Galaxy Watch6 (70) Screen Size 37.3mm | 33.3mm
    • Samsung Galaxy Watch6 (71) Fast Charge8, 9 Samsung Galaxy Watch6 (72)
    • Samsung Galaxy Watch6 (73) Infrared
      Temperature
      Sensor
      Samsung Galaxy Watch6 (74)
    • Material Armor
      Aluminum
    • Battery
      (typical)7
      425mAh |
      300mAh
    • Sleep
      Tracking
      Samsung Galaxy Watch6 (75)
    • Cycle
      Tracking
      Samsung Galaxy Watch6 (76)
    • Body
      Composition
      Samsung Galaxy Watch6 (77)
    • Route
      Workout /
      Track Back
      Samsung Galaxy Watch6 (78)
    • Durability 5ATM+IP68/
      MIL-STD-810H
    • Size 44mm | 40mm
    • Weight 33.3g | 28.7g
  • Galaxy Watch6 Classic

    Samsung Galaxy Watch6 (79)

    Samsung Galaxy Watch6 (80)

    Samsung Galaxy Watch6 (81)

    Samsung Galaxy Watch6 (82)

    Buy Now

    Learn More

    • Samsung Galaxy Watch6 (83) Display Sapphire Crystal
    • Samsung Galaxy Watch6 (84) Screen Size 37.3mm | 33.3mm
    • Samsung Galaxy Watch6 (85) Fast Charge8, 9 Samsung Galaxy Watch6 (86)
    • Samsung Galaxy Watch6 (87) Infrared
      Temperature
      Sensor
      Samsung Galaxy Watch6 (88)
    • Material Stainless Steel
    • Battery
      (typical)7
      425mAh |
      300mAh
    • Sleep
      Tracking
      Samsung Galaxy Watch6 (89)
    • Cycle
      Tracking
      Samsung Galaxy Watch6 (90)
    • Body
      Composition
      Samsung Galaxy Watch6 (91)
    • Route
      Workout /
      Track Back
      Samsung Galaxy Watch6 (92)
    • Durability 5ATM+IP68/
      MIL-STD-810H
    • Size 47mm | 43mm
    • Weight 59.0g | 52.0g
  • Galaxy Watch4

    Samsung Galaxy Watch6 (93)

    Samsung Galaxy Watch6 (94)

    Samsung Galaxy Watch6 (95)

    Samsung Galaxy Watch6 (96)

    Samsung Galaxy Watch6 (97)

    Samsung Galaxy Watch6 (98)

    Buy Now

    Learn More

    • Samsung Galaxy Watch6 (99) Display Corning®
      Gorilla® Glass
      with DX+
    • Samsung Galaxy Watch6 (100) Screen Size 34.6mm | 30.4mm
    • Samsung Galaxy Watch6 (101) Fast Charge50 Samsung Galaxy Watch6 (102)
    • Samsung Galaxy Watch6 (103) Infrared
      Temperature
      Sensor
      Samsung Galaxy Watch6 (104)
    • Material Armor
      Aluminum
    • Battery
      (typical)51
      361mAh |
      247mAh
    • Sleep
      Tracking
      Samsung Galaxy Watch6 (105)
    • Cycle
      Tracking
      Samsung Galaxy Watch6 (106)
    • Body
      Composition
      Samsung Galaxy Watch6 (107)
    • Route
      Workout /
      Track Back
      Samsung Galaxy Watch6 (108)
    • Durability 5ATM+IP68/
      MIL-STD-810G
    • Size 44mm | 40mm
    • Weight 30.3g | 25.9g
  • Galaxy Watch5 Pro

    Samsung Galaxy Watch6 (109)

    Samsung Galaxy Watch6 (110)

    Buy Now

    Learn More

    • Samsung Galaxy Watch6 (111) Display Sapphire Crystal
    • Samsung Galaxy Watch6 (112) Screen Size 34.6mm
    • Samsung Galaxy Watch6 (113) Fast Charge51 Samsung Galaxy Watch6 (114)
    • Samsung Galaxy Watch6 (115) Infrared
      Temperature
      Sensor
      Samsung Galaxy Watch6 (116)
    • Material Titanium
    • Battery
      (typical)52
      590mAh
    • Sleep
      Tracking
      Samsung Galaxy Watch6 (117)
    • Cycle
      Tracking
      Samsung Galaxy Watch6 (118)
    • Body
      Composition
      Samsung Galaxy Watch6 (119)
    • Route
      Workout /
      Track Back
      Samsung Galaxy Watch6 (120)
    • Durability 5ATM+IP68/
      MIL-STD-810H
    • Size 45mm
    • Weight 46.5g

Join the Flip side

GO TO GALAXY Z FLIP5

Samsung Galaxy Watch6 (121)

Unfold your world

GO TO GALAXY Z FOLD5

Samsung Galaxy Watch6 (122)

Galaxy
Tab S9 | S9+ | S9
Ultra

GO TO GALAXY TAB S9

Samsung Galaxy Watch6 (123)

Galaxy Watch6 Classic

GO TO GALAXY WATCH6 CLASSIC

Samsung Galaxy Watch6 (124)

C C

  1. Galaxy Watch6 display size is compared to that of Galaxy Watch5.
  2. The screen size and black margin comparisons are based on Galaxy Watch6 40mm model. Based on Galaxy Watch6 44mm model, the screen size and black margin comparisons are 16.5% and 28%, respectively.
  3. Compared to Galaxy Watch5.
  4. Availability of Watch bands may vary by country or region. Additional Watch bands are sold separately.
  5. Galaxy Watch6 is water resistant to up to 50 meters in depth for 10 minutes under the 5ATM rating. It is not suitable for diving or high-pressure water activities. If the device or your hands are wet, they must be dried thoroughly prior to handling. Galaxy Watch6 provides ingress protection (IP68) against dust and fresh water to a maximum of 1.5 meters for up to 30 minutes. Refer to user manual for further information, including care/use instructions.
  6. Based on Vickers hardness measured with constant load of 200gf.
  7. Actual battery life may vary depending on network environment, usage patterns and other factors.
  8. Testing conducted by Samsung using pre-released version of Galaxy Watch6 (BT & LTE), each paired to a Samsung phone; all devices tested with prerelease software, Galaxy Watch Magnetic Fast Charging USB C Cable (EP-OR900), and Samsung 25W USB C Power Adapter (EP-TA800). Charge time varies with region, settings, usage pattern and environmental factors; actual results may vary.
  9. Samsung 25W USB C Power Adapter (EP-TA800) sold separately.
  10. Requires Samsung Health application version 6.24 or later.
  11. Galaxy Watch6 must be paired with a Samsung Galaxy smartphone with Android 10.0 and minimum 1.5GB Memory.
  12. Sleep tracking features are intended for general wellness and fitness purposes only. Not intended for use in detection, diagnosis, treatment of any medical condition or sleep disorder. The measurements are for your personal reference only. Please consult a medical professional for advice.
  13. Sleep Coaching requires sleep data of at least 7 days, including 2 days off.
  14. Availability of blood oxygen level feature may vary by country or regions.
  15. Invisible LED is enabled when sleep mode is turned on.
  16. Fabric Band is sold separately and compatible with Galaxy Watch4 and later released Galaxy Watch series. Availability of watch bands may vary by country/region or carrier
  17. Cycle Tracking is available for cycle and period prediction which is powered by Natural Cycles. Due to country restrictions in obtaining approval/registration as a Software as a medical device (SaMD), Cycle Tracking based on skin temperature only works on phones and watches purchased in the countries where the service is currently available. NOT INTENDED FOR CONTRACEPTION. If you are currently taking hormonal birth control or undergoing hormonal treatment that inhibits ovulation, this service will not be useful for tracking ovulation. Predictions displayed are for personal reference only. To improve the accuracy of predictions, it is recommended to wear your watch for at least 4 hours during sleep, 5 times a week. Predictions may vary depending on the proper use of your watch, input data, environmental conditions, etc. Intended for users 18 years old and above. Users should not interpret or take clinical action based on the predictions made without consultation of a qualified healthcare professional. Requires latest version of Samsung Health app.
  18. HR alerts is intended for general wellness and fitness purposes only. Not intended for use in detection, diagnosis, treatment, monitoring or management of any medical condition or disease. Any health-related information accessed through the device and application should not be treated as medical advice. Users should seek any medical advice from a physician.
  19. Availability of ECG app may vary by country or region. Due to country restrictions in obtaining approval/registration as a Software as a medical device (SaMD), ECG app only works on watches and smartphones purchased in the countries where service is currently available (however, service may be restricted when users travel to non-service countries). Check out https://www.samsung.com/apps/samsung-health-monitor for more information and latest update on service countries. It is not intended for users by people under 22 years old. Users should not interpret or take clinical action based on the device output without consultation of a qualified healthcare professional.
  20. For accurate blood pressure readings, a calibration is required every 4 weeks by BP monitor & arm cuff. Requires a Galaxy smartphone running Android 10.0 or above.
  21. For accurate blood pressure readings, a calibration is required every 4 weeks by BP monitor & arm cuff. Requires a Galaxy smartphone running Android 9.0 or above.
  22. Users should measure their blood pressure when at rest, as they would do with a traditional cuff, and refrain from measuring when they are working out, smoking, or drinking. Blood pressure app is not intended for any diagnostic purposes regarding hypertension or other heart conditions or users under 22 years old. Users should not interpret or take clinical action based on the device output without consultation of a qualified healthcare professional. Blood pressure app is not intended to replace traditional methods of diagnosis or treatment.
  23. Measured blood pressure history can be reviewed within the Samsung Health Monitor app on a paired smartphone.
  24. Not intended for use in detection, diagnosis, treatment. Intended for general wellness and fitness purposes only.
  25. Body composition is only supported in Samsung Galaxy Watch4 series and later released Galaxy Watch models. Body composition should not be used if you have an implanted pacemaker or other implanted medical devices, or if you are pregnant. Any health-related information accessed through the device and application should not be treated as medical advice. Measurement results may not be accurate if you are under 20 years old. The measurements are for your personal reference only. Please consult a medical professional for advice.
  26. Compatible smartphones and available features may vary by country/region, carrier or device.
  27. Galaxy Watch6 must have the latest Wear OS version installed.
  28. Detect falls feature must be enabled on the Galaxy Wearable app on your Galaxy smartphone to use Fall Detection on the watch.
  29. Emergency call requires network connection or pairing with Galaxy smartphone.
  30. Information gathered from the watch, Samsung Health app or related software is not intended to diagnose, cure, mitigate, treat or prevent disease or other conditions.
  31. Auto detect workouts must be turned on in Settings. Auto detect is not available for all workouts.
  32. Only available on Galaxy Watch6 series and must be paired with a compatible mobile device.
  33. To update the ranges of each HR zone for running based on cardiopulmonary capabilities, it is required to run outdoors more than 10 min with constant speed of 4km/h or faster.
  34. Galaxy Z Flip5 sold separately.
  35. Camera Controller is supported on Galaxy Watch4 and later released Galaxy Watch models when paired with Galaxy S9 series and later. Camera Controller zoom feature is available on Samsung Galaxy Watch4 series and later released Galaxy Watch models that are paired with a Galaxy S series, Galaxy Note series and Galaxy Z series smartphone running One UI 5.1 or above with Camera Controller support.
  36. LTE connection required to use select features on Galaxy Watch6. LTE connectivity only available in LTE models.
  37. Not all apps and services are compatible with Wear OS.
  38. Available on LTE models.
  39. Enabling International Roaming may result in roaming charges depending on your smartphone carrier's plan.
  40. Bluetooth, Wi-Fi or LTE connection is required.
  41. Third-party apps must be downloaded separately.
  42. GPS function requires internet connection. Can be used on LTE models without paired smartphone. Non-LTE models require Bluetooth connection to paired smartphone.
  43. By enabling GPS, your current location information may be gathered and used by Galaxy apps and third-party apps to provide location-based services.
  44. Discount values for broken devices will be considerably lower than those for fully-functional devices, unless there is a separate promotion running that specifically alters the value of broken devices.
  45. Purchase from Samsung.com before DD/MM/YY. £XX value based on any XXX (brand, product) smartwatch. Charges apply if you fail to send us your trade-in device. T&Cs apply.
  46. Bluetooth, Wi-Fi or LTE connection is required.
  47. Third-party apps must be downloaded separately.
  48. Compatible with Galaxy Watch in Wear OS powered by Samsung. Requires pairing with smartphone with latest version of Smart Switch installed.
  49. Data and content available for transfer may vary by OS.
  50. The typical capacity has been tested under third party laboratory conditions. The typical capacity is the estimated average capacity considering the deviation in battery capacity among the battery samples tested under the IEC 61960-3 standard.
  51. Testing conducted by Samsung using pre-released version of Galaxy Watch6 (BT & LTE), each paired to a Samsung phone; all devices tested with prerelease software, Galaxy Watch Magnetic Fast Charging USB C Cable (EP-OR900), and Samsung 25W USB C Power Adapter (EP-TA800). Charge time varies with region, settings, usage pattern and environmental factors; actual results may vary.
  52. The typical capacity has been tested under third party laboratory conditions. The typical capacity is the estimated average capacity considering the deviation in battery capacity among the battery samples tested under the IEC 61960-3 standard. Rated capacity is 295mAh. Actual battery life may vary depending on network environment, usage patterns and other factors.

"); return a.attr("data-swiper-slide-index") || a.attr("data-swiper-slide-index", t), i.cache && (this.virtual.cache[t] = a), a }, appendSlide: function (e) { if ("object" == typeof e && "length" in e) for (var t = 0; t < e.length; t += 1)e[t] && this.virtual.slides.push(e[t]); else this.virtual.slides.push(e); this.virtual.update(!0) }, prependSlide: function (e) { var t = this.activeIndex, i = t + 1, s = 1; if (Array.isArray(e)) { for (var a = 0; a < e.length; a += 1)e[a] && this.virtual.slides.unshift(e[a]); i = t + e.length, s = e.length } else this.virtual.slides.unshift(e); if (this.params.virtual.cache) { var r = this.virtual.cache, n = {}; Object.keys(r).forEach((function (e) { var t = r[e], i = t.attr("data-swiper-slide-index"); i && t.attr("data-swiper-slide-index", parseInt(i, 10) + 1), n[parseInt(e, 10) + s] = t })), this.virtual.cache = n } this.virtual.update(!0), this.slideTo(i, 0) }, removeSlide: function (e) { if (null != e) { var t = this.activeIndex; if (Array.isArray(e)) for (var i = e.length - 1; i >= 0; i -= 1)this.virtual.slides.splice(e[i], 1), this.params.virtual.cache && delete this.virtual.cache[e[i]], e[i] < t && (t -= 1), t = Math.max(t, 0); else this.virtual.slides.splice(e, 1), this.params.virtual.cache && delete this.virtual.cache[e], e < t && (t -= 1), t = Math.max(t, 0); this.virtual.update(!0), this.slideTo(t, 0) } }, removeAllSlides: function () { this.virtual.slides = [], this.params.virtual.cache && (this.virtual.cache = {}), this.virtual.update(!0), this.slideTo(0, 0) } }, J = { name: "virtual", params: { virtual: { enabled: !1, slides: [], cache: !0, renderSlide: null, renderExternal: null, addSlidesBefore: 0, addSlidesAfter: 0 } }, create: function () { n.extend(this, { virtual: { update: Q.update.bind(this), appendSlide: Q.appendSlide.bind(this), prependSlide: Q.prependSlide.bind(this), removeSlide: Q.removeSlide.bind(this), removeAllSlides: Q.removeAllSlides.bind(this), renderSlide: Q.renderSlide.bind(this), slides: this.params.virtual.slides, cache: {} } }) }, on: { beforeInit: function () { if (this.params.virtual.enabled) { this.classNames.push(this.params.containerModifierClass + "virtual"); var e = { watchSlidesProgress: !0 }; n.extend(this.params, e), n.extend(this.originalParams, e), this.params.initialSlide || this.virtual.update() } }, setTranslate: function () { this.params.virtual.enabled && this.virtual.update() } } }, ee = { handle: function (i) { var s = this.rtlTranslate, a = i; a.originalEvent && (a = a.originalEvent); var r = a.keyCode || a.charCode; if (!this.allowSlideNext && (this.isHorizontal() && 39 === r || this.isVertical() && 40 === r || 34 === r)) return !1; if (!this.allowSlidePrev && (this.isHorizontal() && 37 === r || this.isVertical() && 38 === r || 33 === r)) return !1; if (!(a.shiftKey || a.altKey || a.ctrlKey || a.metaKey || e.activeElement && e.activeElement.nodeName && ("input" === e.activeElement.nodeName.toLowerCase() || "textarea" === e.activeElement.nodeName.toLowerCase()))) { if (this.params.keyboard.onlyInViewport && (33 === r || 34 === r || 37 === r || 39 === r || 38 === r || 40 === r)) { var n = !1; if (this.$el.parents("." + this.params.slideClass).length > 0 && 0 === this.$el.parents("." + this.params.slideActiveClass).length) return; var o = t.innerWidth, l = t.innerHeight, d = this.$el.offset(); s && (d.left -= this.$el[0].scrollLeft); for (var h = [[d.left, d.top], [d.left + this.width, d.top], [d.left, d.top + this.height], [d.left + this.width, d.top + this.height]], p = 0; p < h.length; p += 1) { var c = h[p]; c[0] >= 0 && c[0] <= o && c[1] >= 0 && c[1] <= l && (n = !0) } if (!n) return } this.isHorizontal() ? (33 !== r && 34 !== r && 37 !== r && 39 !== r || (a.preventDefault ? a.preventDefault() : a.returnValue = !1), (34 !== r && 39 !== r || s) && (33 !== r && 37 !== r || !s) || this.slideNext(), (33 !== r && 37 !== r || s) && (34 !== r && 39 !== r || !s) || this.slidePrev()) : (33 !== r && 34 !== r && 38 !== r && 40 !== r || (a.preventDefault ? a.preventDefault() : a.returnValue = !1), 34 !== r && 40 !== r || this.slideNext(), 33 !== r && 38 !== r || this.slidePrev()), this.emit("keyPress", r) } }, enable: function () { this.keyboard.enabled || (s(e).on("keydown", this.keyboard.handle), this.keyboard.enabled = !0) }, disable: function () { this.keyboard.enabled && (s(e).off("keydown", this.keyboard.handle), this.keyboard.enabled = !1) } }, te = { name: "keyboard", params: { keyboard: { enabled: !1, onlyInViewport: !0 } }, create: function () { n.extend(this, { keyboard: { enabled: !1, enable: ee.enable.bind(this), disable: ee.disable.bind(this), handle: ee.handle.bind(this) } }) }, on: { init: function () { this.params.keyboard.enabled && this.keyboard.enable() }, destroy: function () { this.keyboard.enabled && this.keyboard.disable() } } }; var ie = { lastScrollTime: n.now(), lastEventBeforeSnap: void 0, recentWheelEvents: [], event: function () { return t.navigator.userAgent.indexOf("firefox") > -1 ? "DOMMouseScroll" : function () { var t = "onwheel" in e; if (!t) { var i = e.createElement("div"); i.setAttribute("onwheel", "return;"), t = "function" == typeof i.onwheel } return !t && e.implementation && e.implementation.hasFeature && !0 !== e.implementation.hasFeature("", "") && (t = e.implementation.hasFeature("Events.wheel", "3.0")), t }() ? "wheel" : "mousewheel" }, normalize: function (e) { var t = 0, i = 0, s = 0, a = 0; return "detail" in e && (i = e.detail), "wheelDelta" in e && (i = -e.wheelDelta / 120), "wheelDeltaY" in e && (i = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (t = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = i, i = 0), s = 10 * t, a = 10 * i, "deltaY" in e && (a = e.deltaY), "deltaX" in e && (s = e.deltaX), e.shiftKey && !s && (s = a, a = 0), (s || a) && e.deltaMode && (1 === e.deltaMode ? (s *= 40, a *= 40) : (s *= 800, a *= 800)), s && !t && (t = s < 1 ? -1 : 1), a && !i && (i = a < 1 ? -1 : 1), { spinX: t, spinY: i, pixelX: s, pixelY: a } }, handleMouseEnter: function () { this.mouseEntered = !0 }, handleMouseLeave: function () { this.mouseEntered = !1 }, handle: function (e) { var t = e, i = this, s = i.params.mousewheel; if (i.params.cssMode && t.preventDefault(), !i.mouseEntered && !s.releaseOnEdges) return !0; t.originalEvent && (t = t.originalEvent); var a = 0, r = i.rtlTranslate ? -1 : 1, o = ie.normalize(t); if (s.forceToAxis) if (i.isHorizontal()) { if (!(Math.abs(o.pixelX) > Math.abs(o.pixelY))) return !0; a = o.pixelX * r } else { if (!(Math.abs(o.pixelY) > Math.abs(o.pixelX))) return !0; a = o.pixelY } else a = Math.abs(o.pixelX) > Math.abs(o.pixelY) ? -o.pixelX * r : -o.pixelY; if (0 === a) return !0; if (s.invert && (a = -a), i.params.freeMode) { var l = { time: n.now(), delta: Math.abs(a), direction: Math.sign(a) }, d = i.mousewheel.lastEventBeforeSnap, h = d && l.time < d.time + 500 && l.delta <= d.delta && l.direction === d.direction; if (!h) { i.mousewheel.lastEventBeforeSnap = void 0, i.params.loop && i.loopFix(); var p = i.getTranslate() + a * s.sensitivity, c = i.isBeginning, u = i.isEnd; if (p >= i.minTranslate() && (p = i.minTranslate()), p <= i.maxTranslate() && (p = i.maxTranslate()), i.setTransition(0), i.setTranslate(p), i.updateProgress(), i.updateActiveIndex(), i.updateSlidesClasses(), (!c && i.isBeginning || !u && i.isEnd) && i.updateSlidesClasses(), i.params.freeModeSticky) { clearTimeout(i.mousewheel.timeout), i.mousewheel.timeout = void 0; var v = i.mousewheel.recentWheelEvents; v.length >= 15 && v.shift(); var f = v.length ? v[v.length - 1] : void 0, m = v[0]; if (v.push(l), f && (l.delta > f.delta || l.direction !== f.direction)) v.splice(0); else if (v.length >= 15 && l.time - m.time < 500 && m.delta - l.delta >= 1 && l.delta <= 6) { var g = a > 0 ? .8 : .2; i.mousewheel.lastEventBeforeSnap = l, v.splice(0), i.mousewheel.timeout = n.nextTick((function () { i.slideToClosest(i.params.speed, !0, void 0, g) }), 0) } i.mousewheel.timeout || (i.mousewheel.timeout = n.nextTick((function () { i.mousewheel.lastEventBeforeSnap = l, v.splice(0), i.slideToClosest(i.params.speed, !0, void 0, .5) }), 500)) } if (h || i.emit("scroll", t), i.params.autoplay && i.params.autoplayDisableOnInteraction && i.autoplay.stop(), p === i.minTranslate() || p === i.maxTranslate()) return !0 } } else { var b = { time: n.now(), delta: Math.abs(a), direction: Math.sign(a), raw: e }, w = i.mousewheel.recentWheelEvents; w.length >= 2 && w.shift(); var y = w.length ? w[w.length - 1] : void 0; if (w.push(b), y ? (b.direction !== y.direction || b.delta > y.delta) && i.mousewheel.animateSlider(b) : i.mousewheel.animateSlider(b), i.mousewheel.releaseScroll(b)) return !0 } return t.preventDefault ? t.preventDefault() : t.returnValue = !1, !1 }, animateSlider: function (e) { return e.delta >= 6 && n.now() - this.mousewheel.lastScrollTime < 60 || (e.direction < 0 ? this.isEnd && !this.params.loop || this.animating || (this.slideNext(), this.emit("scroll", e.raw)) : this.isBeginning && !this.params.loop || this.animating || (this.slidePrev(), this.emit("scroll", e.raw)), this.mousewheel.lastScrollTime = (new t.Date).getTime(), !1) }, releaseScroll: function (e) { var t = this.params.mousewheel; if (e.direction < 0) { if (this.isEnd && !this.params.loop && t.releaseOnEdges) return !0 } else if (this.isBeginning && !this.params.loop && t.releaseOnEdges) return !0; return !1 }, enable: function () { var e = ie.event(); if (this.params.cssMode) return this.wrapperEl.removeEventListener(e, this.mousewheel.handle), !0; if (!e) return !1; if (this.mousewheel.enabled) return !1; var t = this.$el; return "container" !== this.params.mousewheel.eventsTarged && (t = s(this.params.mousewheel.eventsTarged)), t.on("mouseenter", this.mousewheel.handleMouseEnter), t.on("mouseleave", this.mousewheel.handleMouseLeave), t.on(e, this.mousewheel.handle), this.mousewheel.enabled = !0, !0 }, disable: function () { var e = ie.event(); if (this.params.cssMode) return this.wrapperEl.addEventListener(e, this.mousewheel.handle), !0; if (!e) return !1; if (!this.mousewheel.enabled) return !1; var t = this.$el; return "container" !== this.params.mousewheel.eventsTarged && (t = s(this.params.mousewheel.eventsTarged)), t.off(e, this.mousewheel.handle), this.mousewheel.enabled = !1, !0 } }, se = { update: function () { var e = this.params.navigation; if (!this.params.loop) { var t = this.navigation, i = t.$nextEl, s = t.$prevEl; s && s.length > 0 && (this.isBeginning ? s.addClass(e.disabledClass) : s.removeClass(e.disabledClass), s[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](e.lockClass)), i && i.length > 0 && (this.isEnd ? i.addClass(e.disabledClass) : i.removeClass(e.disabledClass), i[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](e.lockClass)) } }, onPrevClick: function (e) { e.preventDefault(), this.isBeginning && !this.params.loop || this.slidePrev() }, onNextClick: function (e) { e.preventDefault(), this.isEnd && !this.params.loop || this.slideNext() }, init: function () { var e, t, i = this.params.navigation; (i.nextEl || i.prevEl) && (i.nextEl && (e = s(i.nextEl), this.params.uniqueNavElements && "string" == typeof i.nextEl && e.length > 1 && 1 === this.$el.find(i.nextEl).length && (e = this.$el.find(i.nextEl))), i.prevEl && (t = s(i.prevEl), this.params.uniqueNavElements && "string" == typeof i.prevEl && t.length > 1 && 1 === this.$el.find(i.prevEl).length && (t = this.$el.find(i.prevEl))), e && e.length > 0 && e.on("click", this.navigation.onNextClick), t && t.length > 0 && t.on("click", this.navigation.onPrevClick), n.extend(this.navigation, { $nextEl: e, nextEl: e && e[0], $prevEl: t, prevEl: t && t[0] })) }, destroy: function () { var e = this.navigation, t = e.$nextEl, i = e.$prevEl; t && t.length && (t.off("click", this.navigation.onNextClick), t.removeClass(this.params.navigation.disabledClass)), i && i.length && (i.off("click", this.navigation.onPrevClick), i.removeClass(this.params.navigation.disabledClass)) } }, ae = { update: function () { var e = this.rtl, t = this.params.pagination; if (t.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length) { var i, a = this.virtual && this.params.virtual.enabled ? this.virtual.slides.length : this.slides.length, r = this.pagination.$el, n = this.params.loop ? Math.ceil((a - 2 * this.loopedSlides) / this.params.slidesPerGroup) : this.snapGrid.length; if (this.params.loop ? ((i = Math.ceil((this.activeIndex - this.loopedSlides) / this.params.slidesPerGroup)) > a - 1 - 2 * this.loopedSlides && (i -= a - 2 * this.loopedSlides), i > n - 1 && (i -= n), i < 0 && "bullets" !== this.params.paginationType && (i = n + i)) : i = void 0 !== this.snapIndex ? this.snapIndex : this.activeIndex || 0, "bullets" === t.type && this.pagination.bullets && this.pagination.bullets.length > 0) { var o, l, d, h = this.pagination.bullets; if (t.dynamicBullets && (this.pagination.bulletSize = h.eq(0)[this.isHorizontal() ? "outerWidth" : "outerHeight"](!0), r.css(this.isHorizontal() ? "width" : "height", this.pagination.bulletSize * (t.dynamicMainBullets + 4) + "px"), t.dynamicMainBullets > 1 && void 0 !== this.previousIndex && (this.pagination.dynamicBulletIndex += i - this.previousIndex, this.pagination.dynamicBulletIndex > t.dynamicMainBullets - 1 ? this.pagination.dynamicBulletIndex = t.dynamicMainBullets - 1 : this.pagination.dynamicBulletIndex < 0 && (this.pagination.dynamicBulletIndex = 0)), o = i - this.pagination.dynamicBulletIndex, d = ((l = o + (Math.min(h.length, t.dynamicMainBullets) - 1)) + o) / 2), h.removeClass(t.bulletActiveClass + " " + t.bulletActiveClass + "-next " + t.bulletActiveClass + "-next-next " + t.bulletActiveClass + "-prev " + t.bulletActiveClass + "-prev-prev " + t.bulletActiveClass + "-main"), r.length > 1) h.each((function (e, a) { var r = s(a), n = r.index(); n === i && r.addClass(t.bulletActiveClass), t.dynamicBullets && (n >= o && n <= l && r.addClass(t.bulletActiveClass + "-main"), n === o && r.prev().addClass(t.bulletActiveClass + "-prev").prev().addClass(t.bulletActiveClass + "-prev-prev"), n === l && r.next().addClass(t.bulletActiveClass + "-next").next().addClass(t.bulletActiveClass + "-next-next")) })); else { var p = h.eq(i), c = p.index(); if (p.addClass(t.bulletActiveClass), t.dynamicBullets) { for (var u = h.eq(o), v = h.eq(l), f = o; f <= l; f += 1)h.eq(f).addClass(t.bulletActiveClass + "-main"); if (this.params.loop) if (c >= h.length - t.dynamicMainBullets) { for (var m = t.dynamicMainBullets; m >= 0; m -= 1)h.eq(h.length - m).addClass(t.bulletActiveClass + "-main"); h.eq(h.length - t.dynamicMainBullets - 1).addClass(t.bulletActiveClass + "-prev") } else u.prev().addClass(t.bulletActiveClass + "-prev").prev().addClass(t.bulletActiveClass + "-prev-prev"), v.next().addClass(t.bulletActiveClass + "-next").next().addClass(t.bulletActiveClass + "-next-next"); else u.prev().addClass(t.bulletActiveClass + "-prev").prev().addClass(t.bulletActiveClass + "-prev-prev"), v.next().addClass(t.bulletActiveClass + "-next").next().addClass(t.bulletActiveClass + "-next-next") } } if (t.dynamicBullets) { var g = Math.min(h.length, t.dynamicMainBullets + 4), b = (this.pagination.bulletSize * g - this.pagination.bulletSize) / 2 - d * this.pagination.bulletSize, w = e ? "right" : "left"; h.css(this.isHorizontal() ? w : "top", b + "px") } } if ("fraction" === t.type && (r.find("." + t.currentClass).text(t.formatFractionCurrent(i + 1)), r.find("." + t.totalClass).text(t.formatFractionTotal(n))), "progressbar" === t.type) { var y; y = t.progressbarOpposite ? this.isHorizontal() ? "vertical" : "horizontal" : this.isHorizontal() ? "horizontal" : "vertical"; var x = (i + 1) / n, T = 1, E = 1; "horizontal" === y ? T = x : E = x, r.find("." + t.progressbarFillClass).transform("translate3d(0,0,0) scaleX(" + T + ") scaleY(" + E + ")").transition(this.params.speed) } "custom" === t.type && t.renderCustom ? (r.html(t.renderCustom(this, i + 1, n)), this.emit("paginationRender", this, r[0])) : this.emit("paginationUpdate", this, r[0]), r[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](t.lockClass) } }, render: function () { var e = this.params.pagination; if (e.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length) { var t = this.virtual && this.params.virtual.enabled ? this.virtual.slides.length : this.slides.length, i = this.pagination.$el, s = ""; if ("bullets" === e.type) { for (var a = this.params.loop ? Math.ceil((t - 2 * this.loopedSlides) / this.params.slidesPerGroup) : this.snapGrid.length, r = 0; r < a; r += 1)e.renderBullet ? s += e.renderBullet.call(this, r, e.bulletClass) : s += "<" + e.bulletElement + ' class="' + e.bulletClass + '">' + e.bulletElement + ">"; i.html(s), this.pagination.bullets = i.find("." + e.bulletClass) } "fraction" === e.type && (s = e.renderFraction ? e.renderFraction.call(this, e.currentClass, e.totalClass) : ' / ', i.html(s)), "progressbar" === e.type && (s = e.renderProgressbar ? e.renderProgressbar.call(this, e.progressbarFillClass) : '', i.html(s)), "custom" !== e.type && this.emit("paginationRender", this.pagination.$el[0]) } }, init: function () { var e = this, t = e.params.pagination; if (t.el) { var i = s(t.el); 0 !== i.length && (e.params.uniqueNavElements && "string" == typeof t.el && i.length > 1 && 1 === e.$el.find(t.el).length && (i = e.$el.find(t.el)), "bullets" === t.type && t.clickable && i.addClass(t.clickableClass), i.addClass(t.modifierClass + t.type), "bullets" === t.type && t.dynamicBullets && (i.addClass("" + t.modifierClass + t.type + "-dynamic"), e.pagination.dynamicBulletIndex = 0, t.dynamicMainBullets < 1 && (t.dynamicMainBullets = 1)), "progressbar" === t.type && t.progressbarOpposite && i.addClass(t.progressbarOppositeClass), t.clickable && i.on("click", "." + t.bulletClass, (function (t) { t.preventDefault(); var i = s(this).index() * e.params.slidesPerGroup; e.params.loop && (i += e.loopedSlides), e.slideTo(i) })), n.extend(e.pagination, { $el: i, el: i[0] })) } }, destroy: function () { var e = this.params.pagination; if (e.el && this.pagination.el && this.pagination.$el && 0 !== this.pagination.$el.length) { var t = this.pagination.$el; t.removeClass(e.hiddenClass), t.removeClass(e.modifierClass + e.type), this.pagination.bullets && this.pagination.bullets.removeClass(e.bulletActiveClass), e.clickable && t.off("click", "." + e.bulletClass) } } }, re = { setTranslate: function () { if (this.params.scrollbar.el && this.scrollbar.el) { var e = this.scrollbar, t = this.rtlTranslate, i = this.progress, s = e.dragSize, a = e.trackSize, r = e.$dragEl, n = e.$el, o = this.params.scrollbar, l = s, d = (a - s) * i; t ? (d = -d) > 0 ? (l = s - d, d = 0) : -d + s > a && (l = a + d) : d < 0 ? (l = s + d, d = 0) : d + s > a && (l = a - d), this.isHorizontal() ? (r.transform("translate3d(" + d + "px, 0, 0)"), r[0].style.width = l + "px") : (r.transform("translate3d(0px, " + d + "px, 0)"), r[0].style.height = l + "px"), o.hide && (clearTimeout(this.scrollbar.timeout), n[0].style.opacity = 1, this.scrollbar.timeout = setTimeout((function () { n[0].style.opacity = 0, n.transition(400) }), 1e3)) } }, setTransition: function (e) { this.params.scrollbar.el && this.scrollbar.el && this.scrollbar.$dragEl.transition(e) }, updateSize: function () { if (this.params.scrollbar.el && this.scrollbar.el) { var e = this.scrollbar, t = e.$dragEl, i = e.$el; t[0].style.width = "", t[0].style.height = ""; var s, a = this.isHorizontal() ? i[0].offsetWidth : i[0].offsetHeight, r = this.size / this.virtualSize, o = r * (a / this.size); s = "auto" === this.params.scrollbar.dragSize ? a * r : parseInt(this.params.scrollbar.dragSize, 10), this.isHorizontal() ? t[0].style.width = s + "px" : t[0].style.height = s + "px", i[0].style.display = r >= 1 ? "none" : "", this.params.scrollbar.hide && (i[0].style.opacity = 0), n.extend(e, { trackSize: a, divider: r, moveDivider: o, dragSize: s }), e.$el[this.params.watchOverflow && this.isLocked ? "addClass" : "removeClass"](this.params.scrollbar.lockClass) } }, getPointerPosition: function (e) { return this.isHorizontal() ? "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientX : e.clientX : "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientY : e.clientY }, setDragPosition: function (e) { var t, i = this.scrollbar, s = this.rtlTranslate, a = i.$el, r = i.dragSize, n = i.trackSize, o = i.dragStartPos; t = (i.getPointerPosition(e) - a.offset()[this.isHorizontal() ? "left" : "top"] - (null !== o ? o : r / 2)) / (n - r), t = Math.max(Math.min(t, 1), 0), s && (t = 1 - t); var l = this.minTranslate() + (this.maxTranslate() - this.minTranslate()) * t; this.updateProgress(l), this.setTranslate(l), this.updateActiveIndex(), this.updateSlidesClasses() }, onDragStart: function (e) { var t = this.params.scrollbar, i = this.scrollbar, s = this.$wrapperEl, a = i.$el, r = i.$dragEl; this.scrollbar.isTouched = !0, this.scrollbar.dragStartPos = e.target === r[0] || e.target === r ? i.getPointerPosition(e) - e.target.getBoundingClientRect()[this.isHorizontal() ? "left" : "top"] : null, e.preventDefault(), e.stopPropagation(), s.transition(100), r.transition(100), i.setDragPosition(e), clearTimeout(this.scrollbar.dragTimeout), a.transition(0), t.hide && a.css("opacity", 1), this.params.cssMode && this.$wrapperEl.css("scroll-snap-type", "none"), this.emit("scrollbarDragStart", e) }, onDragMove: function (e) { var t = this.scrollbar, i = this.$wrapperEl, s = t.$el, a = t.$dragEl; this.scrollbar.isTouched && (e.preventDefault ? e.preventDefault() : e.returnValue = !1, t.setDragPosition(e), i.transition(0), s.transition(0), a.transition(0), this.emit("scrollbarDragMove", e)) }, onDragEnd: function (e) { var t = this.params.scrollbar, i = this.scrollbar, s = this.$wrapperEl, a = i.$el; this.scrollbar.isTouched && (this.scrollbar.isTouched = !1, this.params.cssMode && (this.$wrapperEl.css("scroll-snap-type", ""), s.transition("")), t.hide && (clearTimeout(this.scrollbar.dragTimeout), this.scrollbar.dragTimeout = n.nextTick((function () { a.css("opacity", 0), a.transition(400) }), 1e3)), this.emit("scrollbarDragEnd", e), t.snapOnRelease && this.slideToClosest()) }, enableDraggable: function () { if (this.params.scrollbar.el) { var t = this.scrollbar, i = this.touchEventsTouch, s = this.touchEventsDesktop, a = this.params, r = t.$el[0], n = !(!o.passiveListener || !a.passiveListeners) && { passive: !1, capture: !1 }, l = !(!o.passiveListener || !a.passiveListeners) && { passive: !0, capture: !1 }; o.touch ? (r.addEventListener(i.start, this.scrollbar.onDragStart, n), r.addEventListener(i.move, this.scrollbar.onDragMove, n), r.addEventListener(i.end, this.scrollbar.onDragEnd, l)) : (r.addEventListener(s.start, this.scrollbar.onDragStart, n), e.addEventListener(s.move, this.scrollbar.onDragMove, n), e.addEventListener(s.end, this.scrollbar.onDragEnd, l)) } }, disableDraggable: function () { if (this.params.scrollbar.el) { var t = this.scrollbar, i = this.touchEventsTouch, s = this.touchEventsDesktop, a = this.params, r = t.$el[0], n = !(!o.passiveListener || !a.passiveListeners) && { passive: !1, capture: !1 }, l = !(!o.passiveListener || !a.passiveListeners) && { passive: !0, capture: !1 }; o.touch ? (r.removeEventListener(i.start, this.scrollbar.onDragStart, n), r.removeEventListener(i.move, this.scrollbar.onDragMove, n), r.removeEventListener(i.end, this.scrollbar.onDragEnd, l)) : (r.removeEventListener(s.start, this.scrollbar.onDragStart, n), e.removeEventListener(s.move, this.scrollbar.onDragMove, n), e.removeEventListener(s.end, this.scrollbar.onDragEnd, l)) } }, init: function () { if (this.params.scrollbar.el) { var e = this.scrollbar, t = this.$el, i = this.params.scrollbar, a = s(i.el); this.params.uniqueNavElements && "string" == typeof i.el && a.length > 1 && 1 === t.find(i.el).length && (a = t.find(i.el)); var r = a.find("." + this.params.scrollbar.dragClass); 0 === r.length && (r = s('

'), a.append(r)), n.extend(e, { $el: a, el: a[0], $dragEl: r, dragEl: r[0] }), i.draggable && e.enableDraggable() } }, destroy: function () { this.scrollbar.disableDraggable() } }, ne = { setTransform: function (e, t) { var i = this.rtl, a = s(e), r = i ? -1 : 1, n = a.attr("data-swiper-parallax") || "0", o = a.attr("data-swiper-parallax-x"), l = a.attr("data-swiper-parallax-y"), d = a.attr("data-swiper-parallax-scale"), h = a.attr("data-swiper-parallax-opacity"); if (o || l ? (o = o || "0", l = l || "0") : this.isHorizontal() ? (o = n, l = "0") : (l = n, o = "0"), o = o.indexOf("%") >= 0 ? parseInt(o, 10) * t * r + "%" : o * t * r + "px", l = l.indexOf("%") >= 0 ? parseInt(l, 10) * t + "%" : l * t + "px", null != h) { var p = h - (h - 1) * (1 - Math.abs(t)); a[0].style.opacity = p } if (null == d) a.transform("translate3d(" + o + ", " + l + ", 0px)"); else { var c = d - (d - 1) * (1 - Math.abs(t)); a.transform("translate3d(" + o + ", " + l + ", 0px) scale(" + c + ")") } }, setTranslate: function () { var e = this, t = e.$el, i = e.slides, a = e.progress, r = e.snapGrid; t.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((function (t, i) { e.parallax.setTransform(i, a) })), i.each((function (t, i) { var n = i.progress; e.params.slidesPerGroup > 1 && "auto" !== e.params.slidesPerView && (n += Math.ceil(t / 2) - a * (r.length - 1)), n = Math.min(Math.max(n, -1), 1), s(i).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((function (t, i) { e.parallax.setTransform(i, n) })) })) }, setTransition: function (e) { void 0 === e && (e = this.params.speed); this.$el.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((function (t, i) { var a = s(i), r = parseInt(a.attr("data-swiper-parallax-duration"), 10) || e; 0 === e && (r = 0), a.transition(r) })) } }, oe = { getDistanceBetweenTouches: function (e) { if (e.targetTouches.length < 2) return 1; var t = e.targetTouches[0].pageX, i = e.targetTouches[0].pageY, s = e.targetTouches[1].pageX, a = e.targetTouches[1].pageY; return Math.sqrt(Math.pow(s - t, 2) + Math.pow(a - i, 2)) }, onGestureStart: function (e) { var t = this.params.zoom, i = this.zoom, a = i.gesture; if (i.fakeGestureTouched = !1, i.fakeGestureMoved = !1, !o.gestures) { if ("touchstart" !== e.type || "touchstart" === e.type && e.targetTouches.length < 2) return; i.fakeGestureTouched = !0, a.scaleStart = oe.getDistanceBetweenTouches(e) } a.$slideEl && a.$slideEl.length || (a.$slideEl = s(e.target).closest(".swiper-slide"), 0 === a.$slideEl.length && (a.$slideEl = this.slides.eq(this.activeIndex)), a.$imageEl = a.$slideEl.find("img, svg, canvas"), a.$imageWrapEl = a.$imageEl.parent("." + t.containerClass), a.maxRatio = a.$imageWrapEl.attr("data-swiper-zoom") || t.maxRatio, 0 !== a.$imageWrapEl.length) ? (a.$imageEl.transition(0), this.zoom.isScaling = !0) : a.$imageEl = void 0 }, onGestureChange: function (e) { var t = this.params.zoom, i = this.zoom, s = i.gesture; if (!o.gestures) { if ("touchmove" !== e.type || "touchmove" === e.type && e.targetTouches.length < 2) return; i.fakeGestureMoved = !0, s.scaleMove = oe.getDistanceBetweenTouches(e) } s.$imageEl && 0 !== s.$imageEl.length && (o.gestures ? i.scale = e.scale * i.currentScale : i.scale = s.scaleMove / s.scaleStart * i.currentScale, i.scale > s.maxRatio && (i.scale = s.maxRatio - 1 + Math.pow(i.scale - s.maxRatio + 1, .5)), i.scale < t.minRatio && (i.scale = t.minRatio + 1 - Math.pow(t.minRatio - i.scale + 1, .5)), s.$imageEl.transform("translate3d(0,0,0) scale(" + i.scale + ")")) }, onGestureEnd: function (e) { var t = this.params.zoom, i = this.zoom, s = i.gesture; if (!o.gestures) { if (!i.fakeGestureTouched || !i.fakeGestureMoved) return; if ("touchend" !== e.type || "touchend" === e.type && e.changedTouches.length < 2 && !I.android) return; i.fakeGestureTouched = !1, i.fakeGestureMoved = !1 } s.$imageEl && 0 !== s.$imageEl.length && (i.scale = Math.max(Math.min(i.scale, s.maxRatio), t.minRatio), s.$imageEl.transition(this.params.speed).transform("translate3d(0,0,0) scale(" + i.scale + ")"), i.currentScale = i.scale, i.isScaling = !1, 1 === i.scale && (s.$slideEl = void 0)) }, onTouchStart: function (e) { var t = this.zoom, i = t.gesture, s = t.image; i.$imageEl && 0 !== i.$imageEl.length && (s.isTouched || (I.android && e.preventDefault(), s.isTouched = !0, s.touchesStart.x = "touchstart" === e.type ? e.targetTouches[0].pageX : e.pageX, s.touchesStart.y = "touchstart" === e.type ? e.targetTouches[0].pageY : e.pageY)) }, onTouchMove: function (e) { var t = this.zoom, i = t.gesture, s = t.image, a = t.velocity; if (i.$imageEl && 0 !== i.$imageEl.length && (this.allowClick = !1, s.isTouched && i.$slideEl)) { s.isMoved || (s.width = i.$imageEl[0].offsetWidth, s.height = i.$imageEl[0].offsetHeight, s.startX = n.getTranslate(i.$imageWrapEl[0], "x") || 0, s.startY = n.getTranslate(i.$imageWrapEl[0], "y") || 0, i.slideWidth = i.$slideEl[0].offsetWidth, i.slideHeight = i.$slideEl[0].offsetHeight, i.$imageWrapEl.transition(0), this.rtl && (s.startX = -s.startX, s.startY = -s.startY)); var r = s.width * t.scale, o = s.height * t.scale; if (!(r < i.slideWidth && o < i.slideHeight)) { if (s.minX = Math.min(i.slideWidth / 2 - r / 2, 0), s.maxX = -s.minX, s.minY = Math.min(i.slideHeight / 2 - o / 2, 0), s.maxY = -s.minY, s.touchesCurrent.x = "touchmove" === e.type ? e.targetTouches[0].pageX : e.pageX, s.touchesCurrent.y = "touchmove" === e.type ? e.targetTouches[0].pageY : e.pageY, !s.isMoved && !t.isScaling) { if (this.isHorizontal() && (Math.floor(s.minX) === Math.floor(s.startX) && s.touchesCurrent.x < s.touchesStart.x || Math.floor(s.maxX) === Math.floor(s.startX) && s.touchesCurrent.x > s.touchesStart.x)) return void (s.isTouched = !1); if (!this.isHorizontal() && (Math.floor(s.minY) === Math.floor(s.startY) && s.touchesCurrent.y < s.touchesStart.y || Math.floor(s.maxY) === Math.floor(s.startY) && s.touchesCurrent.y > s.touchesStart.y)) return void (s.isTouched = !1) } e.preventDefault(), e.stopPropagation(), s.isMoved = !0, s.currentX = s.touchesCurrent.x - s.touchesStart.x + s.startX, s.currentY = s.touchesCurrent.y - s.touchesStart.y + s.startY, s.currentX < s.minX && (s.currentX = s.minX + 1 - Math.pow(s.minX - s.currentX + 1, .8)), s.currentX > s.maxX && (s.currentX = s.maxX - 1 + Math.pow(s.currentX - s.maxX + 1, .8)), s.currentY < s.minY && (s.currentY = s.minY + 1 - Math.pow(s.minY - s.currentY + 1, .8)), s.currentY > s.maxY && (s.currentY = s.maxY - 1 + Math.pow(s.currentY - s.maxY + 1, .8)), a.prevPositionX || (a.prevPositionX = s.touchesCurrent.x), a.prevPositionY || (a.prevPositionY = s.touchesCurrent.y), a.prevTime || (a.prevTime = Date.now()), a.x = (s.touchesCurrent.x - a.prevPositionX) / (Date.now() - a.prevTime) / 2, a.y = (s.touchesCurrent.y - a.prevPositionY) / (Date.now() - a.prevTime) / 2, Math.abs(s.touchesCurrent.x - a.prevPositionX) < 2 && (a.x = 0), Math.abs(s.touchesCurrent.y - a.prevPositionY) < 2 && (a.y = 0), a.prevPositionX = s.touchesCurrent.x, a.prevPositionY = s.touchesCurrent.y, a.prevTime = Date.now(), i.$imageWrapEl.transform("translate3d(" + s.currentX + "px, " + s.currentY + "px,0)") } } }, onTouchEnd: function () { var e = this.zoom, t = e.gesture, i = e.image, s = e.velocity; if (t.$imageEl && 0 !== t.$imageEl.length) { if (!i.isTouched || !i.isMoved) return i.isTouched = !1, void (i.isMoved = !1); i.isTouched = !1, i.isMoved = !1; var a = 300, r = 300, n = s.x * a, o = i.currentX + n, l = s.y * r, d = i.currentY + l; 0 !== s.x && (a = Math.abs((o - i.currentX) / s.x)), 0 !== s.y && (r = Math.abs((d - i.currentY) / s.y)); var h = Math.max(a, r); i.currentX = o, i.currentY = d; var p = i.width * e.scale, c = i.height * e.scale; i.minX = Math.min(t.slideWidth / 2 - p / 2, 0), i.maxX = -i.minX, i.minY = Math.min(t.slideHeight / 2 - c / 2, 0), i.maxY = -i.minY, i.currentX = Math.max(Math.min(i.currentX, i.maxX), i.minX), i.currentY = Math.max(Math.min(i.currentY, i.maxY), i.minY), t.$imageWrapEl.transition(h).transform("translate3d(" + i.currentX + "px, " + i.currentY + "px,0)") } }, onTransitionEnd: function () { var e = this.zoom, t = e.gesture; t.$slideEl && this.previousIndex !== this.activeIndex && (t.$imageEl.transform("translate3d(0,0,0) scale(1)"), t.$imageWrapEl.transform("translate3d(0,0,0)"), e.scale = 1, e.currentScale = 1, t.$slideEl = void 0, t.$imageEl = void 0, t.$imageWrapEl = void 0) }, toggle: function (e) { var t = this.zoom; t.scale && 1 !== t.scale ? t.out() : t.in(e) }, in: function (e) { var t, i, a, r, n, o, l, d, h, p, c, u, v, f, m, g, b = this.zoom, w = this.params.zoom, y = b.gesture, x = b.image; (y.$slideEl || (y.$slideEl = this.clickedSlide ? s(this.clickedSlide) : this.slides.eq(this.activeIndex), y.$imageEl = y.$slideEl.find("img, svg, canvas"), y.$imageWrapEl = y.$imageEl.parent("." + w.containerClass)), y.$imageEl && 0 !== y.$imageEl.length) && (y.$slideEl.addClass("" + w.zoomedSlideClass), void 0 === x.touchesStart.x && e ? (t = "touchend" === e.type ? e.changedTouches[0].pageX : e.pageX, i = "touchend" === e.type ? e.changedTouches[0].pageY : e.pageY) : (t = x.touchesStart.x, i = x.touchesStart.y), b.scale = y.$imageWrapEl.attr("data-swiper-zoom") || w.maxRatio, b.currentScale = y.$imageWrapEl.attr("data-swiper-zoom") || w.maxRatio, e ? (m = y.$slideEl[0].offsetWidth, g = y.$slideEl[0].offsetHeight, a = y.$slideEl.offset().left + m / 2 - t, r = y.$slideEl.offset().top + g / 2 - i, l = y.$imageEl[0].offsetWidth, d = y.$imageEl[0].offsetHeight, h = l * b.scale, p = d * b.scale, v = -(c = Math.min(m / 2 - h / 2, 0)), f = -(u = Math.min(g / 2 - p / 2, 0)), (n = a * b.scale) < c && (n = c), n > v && (n = v), (o = r * b.scale) < u && (o = u), o > f && (o = f)) : (n = 0, o = 0), y.$imageWrapEl.transition(300).transform("translate3d(" + n + "px, " + o + "px,0)"), y.$imageEl.transition(300).transform("translate3d(0,0,0) scale(" + b.scale + ")")) }, out: function () { var e = this.zoom, t = this.params.zoom, i = e.gesture; i.$slideEl || (i.$slideEl = this.clickedSlide ? s(this.clickedSlide) : this.slides.eq(this.activeIndex), i.$imageEl = i.$slideEl.find("img, svg, canvas"), i.$imageWrapEl = i.$imageEl.parent("." + t.containerClass)), i.$imageEl && 0 !== i.$imageEl.length && (e.scale = 1, e.currentScale = 1, i.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"), i.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"), i.$slideEl.removeClass("" + t.zoomedSlideClass), i.$slideEl = void 0) }, enable: function () { var e = this.zoom; if (!e.enabled) { e.enabled = !0; var t = !("touchstart" !== this.touchEvents.start || !o.passiveListener || !this.params.passiveListeners) && { passive: !0, capture: !1 }, i = !o.passiveListener || { passive: !1, capture: !0 }; o.gestures ? (this.$wrapperEl.on("gesturestart", ".swiper-slide", e.onGestureStart, t), this.$wrapperEl.on("gesturechange", ".swiper-slide", e.onGestureChange, t), this.$wrapperEl.on("gestureend", ".swiper-slide", e.onGestureEnd, t)) : "touchstart" === this.touchEvents.start && (this.$wrapperEl.on(this.touchEvents.start, ".swiper-slide", e.onGestureStart, t), this.$wrapperEl.on(this.touchEvents.move, ".swiper-slide", e.onGestureChange, i), this.$wrapperEl.on(this.touchEvents.end, ".swiper-slide", e.onGestureEnd, t), this.touchEvents.cancel && this.$wrapperEl.on(this.touchEvents.cancel, ".swiper-slide", e.onGestureEnd, t)), this.$wrapperEl.on(this.touchEvents.move, "." + this.params.zoom.containerClass, e.onTouchMove, i) } }, disable: function () { var e = this.zoom; if (e.enabled) { this.zoom.enabled = !1; var t = !("touchstart" !== this.touchEvents.start || !o.passiveListener || !this.params.passiveListeners) && { passive: !0, capture: !1 }, i = !o.passiveListener || { passive: !1, capture: !0 }; o.gestures ? (this.$wrapperEl.off("gesturestart", ".swiper-slide", e.onGestureStart, t), this.$wrapperEl.off("gesturechange", ".swiper-slide", e.onGestureChange, t), this.$wrapperEl.off("gestureend", ".swiper-slide", e.onGestureEnd, t)) : "touchstart" === this.touchEvents.start && (this.$wrapperEl.off(this.touchEvents.start, ".swiper-slide", e.onGestureStart, t), this.$wrapperEl.off(this.touchEvents.move, ".swiper-slide", e.onGestureChange, i), this.$wrapperEl.off(this.touchEvents.end, ".swiper-slide", e.onGestureEnd, t), this.touchEvents.cancel && this.$wrapperEl.off(this.touchEvents.cancel, ".swiper-slide", e.onGestureEnd, t)), this.$wrapperEl.off(this.touchEvents.move, "." + this.params.zoom.containerClass, e.onTouchMove, i) } } }, le = { loadInSlide: function (e, t) { void 0 === t && (t = !0); var i = this, a = i.params.lazy; if (void 0 !== e && 0 !== i.slides.length) { var r = i.virtual && i.params.virtual.enabled ? i.$wrapperEl.children("." + i.params.slideClass + '[data-swiper-slide-index="' + e + '"]') : i.slides.eq(e), n = r.find("." + a.elementClass + ":not(." + a.loadedClass + "):not(." + a.loadingClass + ")"); !r.hasClass(a.elementClass) || r.hasClass(a.loadedClass) || r.hasClass(a.loadingClass) || (n = n.add(r[0])), 0 !== n.length && n.each((function (e, n) { var o = s(n); o.addClass(a.loadingClass); var l = o.attr("data-background"), d = o.attr("data-src"), h = o.attr("data-srcset"), p = o.attr("data-sizes"); i.loadImage(o[0], d || l, h, p, !1, (function () { if (null != i && i && (!i || i.params) && !i.destroyed) { if (l ? (o.css("background-image", 'url("' + l + '")'), o.removeAttr("data-background")) : (h && (o.attr("srcset", h), o.removeAttr("data-srcset")), p && (o.attr("sizes", p), o.removeAttr("data-sizes")), d && (o.attr("src", d), o.removeAttr("data-src"))), o.addClass(a.loadedClass).removeClass(a.loadingClass), r.find("." + a.preloaderClass).remove(), i.params.loop && t) { var e = r.attr("data-swiper-slide-index"); if (r.hasClass(i.params.slideDuplicateClass)) { var s = i.$wrapperEl.children('[data-swiper-slide-index="' + e + '"]:not(.' + i.params.slideDuplicateClass + ")"); i.lazy.loadInSlide(s.index(), !1) } else { var n = i.$wrapperEl.children("." + i.params.slideDuplicateClass + '[data-swiper-slide-index="' + e + '"]'); i.lazy.loadInSlide(n.index(), !1) } } i.emit("lazyImageReady", r[0], o[0]) } })), i.emit("lazyImageLoad", r[0], o[0]) })) } }, load: function () { var e = this, t = e.$wrapperEl, i = e.params, a = e.slides, r = e.activeIndex, n = e.virtual && i.virtual.enabled, o = i.lazy, l = i.slidesPerView; function d(e) { if (n) { if (t.children("." + i.slideClass + '[data-swiper-slide-index="' + e + '"]').length) return !0 } else if (a[e]) return !0; return !1 } function h(e) { return n ? s(e).attr("data-swiper-slide-index") : s(e).index() } if ("auto" === l && (l = 0), e.lazy.initialImageLoaded || (e.lazy.initialImageLoaded = !0), e.params.watchSlidesVisibility) t.children("." + i.slideVisibleClass).each((function (t, i) { var a = n ? s(i).attr("data-swiper-slide-index") : s(i).index(); e.lazy.loadInSlide(a) })); else if (l > 1) for (var p = r; p < r + l; p += 1)d(p) && e.lazy.loadInSlide(p); else e.lazy.loadInSlide(r); if (o.loadPrevNext) if (l > 1 || o.loadPrevNextAmount && o.loadPrevNextAmount > 1) { for (var c = o.loadPrevNextAmount, u = l, v = Math.min(r + u + Math.max(c, u), a.length), f = Math.max(r - Math.max(u, c), 0), m = r + l; m < v; m += 1)d(m) && e.lazy.loadInSlide(m); for (var g = f; g < r; g += 1)d(g) && e.lazy.loadInSlide(g) } else { var b = t.children("." + i.slideNextClass); b.length > 0 && e.lazy.loadInSlide(h(b)); var w = t.children("." + i.slidePrevClass); w.length > 0 && e.lazy.loadInSlide(h(w)) } } }, de = { LinearSpline: function (e, t) { var i, s, a, r, n, o = function (e, t) { for (s = -1, i = e.length; i - s > 1;)e[a = i + s >> 1] <= t ? s = a : i = a; return i }; return this.x = e, this.y = t, this.lastIndex = e.length - 1, this.interpolate = function (e) { return e ? (n = o(this.x, e), r = n - 1, (e - this.x[r]) * (this.y[n] - this.y[r]) / (this.x[n] - this.x[r]) + this.y[r]) : 0 }, this }, getInterpolateFunction: function (e) { this.controller.spline || (this.controller.spline = this.params.loop ? new de.LinearSpline(this.slidesGrid, e.slidesGrid) : new de.LinearSpline(this.snapGrid, e.snapGrid)) }, setTranslate: function (e, t) { var i, s, a = this, r = a.controller.control; function n(e) { var t = a.rtlTranslate ? -a.translate : a.translate; "slide" === a.params.controller.by && (a.controller.getInterpolateFunction(e), s = -a.controller.spline.interpolate(-t)), s && "container" !== a.params.controller.by || (i = (e.maxTranslate() - e.minTranslate()) / (a.maxTranslate() - a.minTranslate()), s = (t - a.minTranslate()) * i + e.minTranslate()), a.params.controller.inverse && (s = e.maxTranslate() - s), e.updateProgress(s), e.setTranslate(s, a), e.updateActiveIndex(), e.updateSlidesClasses() } if (Array.isArray(r)) for (var o = 0; o < r.length; o += 1)r[o] !== t && r[o] instanceof W && n(r[o]); else r instanceof W && t !== r && n(r) }, setTransition: function (e, t) { var i, s = this, a = s.controller.control; function r(t) { t.setTransition(e, s), 0 !== e && (t.transitionStart(), t.params.autoHeight && n.nextTick((function () { t.updateAutoHeight() })), t.$wrapperEl.transitionEnd((function () { a && (t.params.loop && "slide" === s.params.controller.by && t.loopFix(), t.transitionEnd()) }))) } if (Array.isArray(a)) for (i = 0; i < a.length; i += 1)a[i] !== t && a[i] instanceof W && r(a[i]); else a instanceof W && t !== a && r(a) } }, he = { makeElFocusable: function (e) { return e.attr("tabIndex", "0"), e }, addElRole: function (e, t) { return e.attr("role", t), e }, addElLabel: function (e, t) { return e.attr("aria-label", t), e }, disableEl: function (e) { return e.attr("aria-disabled", !0), e }, enableEl: function (e) { return e.attr("aria-disabled", !1), e }, onEnterKey: function (e) { var t = this.params.a11y; if (13 === e.keyCode) { var i = s(e.target); this.navigation && this.navigation.$nextEl && i.is(this.navigation.$nextEl) && (this.isEnd && !this.params.loop || this.slideNext(), this.isEnd ? this.a11y.notify(t.lastSlideMessage) : this.a11y.notify(t.nextSlideMessage)), this.navigation && this.navigation.$prevEl && i.is(this.navigation.$prevEl) && (this.isBeginning && !this.params.loop || this.slidePrev(), this.isBeginning ? this.a11y.notify(t.firstSlideMessage) : this.a11y.notify(t.prevSlideMessage)), this.pagination && i.is("." + this.params.pagination.bulletClass) && i[0].click() } }, notify: function (e) { var t = this.a11y.liveRegion; 0 !== t.length && (t.html(""), t.html(e)) }, updateNavigation: function () { if (!this.params.loop && this.navigation) { var e = this.navigation, t = e.$nextEl, i = e.$prevEl; i && i.length > 0 && (this.isBeginning ? this.a11y.disableEl(i) : this.a11y.enableEl(i)), t && t.length > 0 && (this.isEnd ? this.a11y.disableEl(t) : this.a11y.enableEl(t)) } }, updatePagination: function () { var e = this, t = e.params.a11y; e.pagination && e.params.pagination.clickable && e.pagination.bullets && e.pagination.bullets.length && e.pagination.bullets.each((function (i, a) { var r = s(a); e.a11y.makeElFocusable(r), e.a11y.addElRole(r, "button"), e.a11y.addElLabel(r, t.paginationBulletMessage.replace(/{{index}}/, r.index() + 1)) })) }, init: function () { this.$el.append(this.a11y.liveRegion); var e, t, i = this.params.a11y; this.navigation && this.navigation.$nextEl && (e = this.navigation.$nextEl), this.navigation && this.navigation.$prevEl && (t = this.navigation.$prevEl), e && (this.a11y.makeElFocusable(e), this.a11y.addElRole(e, "button"), this.a11y.addElLabel(e, i.nextSlideMessage), e.on("keydown", this.a11y.onEnterKey)), t && (this.a11y.makeElFocusable(t), this.a11y.addElRole(t, "button"), this.a11y.addElLabel(t, i.prevSlideMessage), t.on("keydown", this.a11y.onEnterKey)), this.pagination && this.params.pagination.clickable && this.pagination.bullets && this.pagination.bullets.length && this.pagination.$el.on("keydown", "." + this.params.pagination.bulletClass, this.a11y.onEnterKey) }, destroy: function () { var e, t; this.a11y.liveRegion && this.a11y.liveRegion.length > 0 && this.a11y.liveRegion.remove(), this.navigation && this.navigation.$nextEl && (e = this.navigation.$nextEl), this.navigation && this.navigation.$prevEl && (t = this.navigation.$prevEl), e && e.off("keydown", this.a11y.onEnterKey), t && t.off("keydown", this.a11y.onEnterKey), this.pagination && this.params.pagination.clickable && this.pagination.bullets && this.pagination.bullets.length && this.pagination.$el.off("keydown", "." + this.params.pagination.bulletClass, this.a11y.onEnterKey) } }, pe = { init: function () { if (this.params.history) { if (!t.history || !t.history.pushState) return this.params.history.enabled = !1, void (this.params.hashNavigation.enabled = !0); var e = this.history; e.initialized = !0, e.paths = pe.getPathValues(), (e.paths.key || e.paths.value) && (e.scrollToSlide(0, e.paths.value, this.params.runCallbacksOnInit), this.params.history.replaceState || t.addEventListener("popstate", this.history.setHistoryPopState)) } }, destroy: function () { this.params.history.replaceState || t.removeEventListener("popstate", this.history.setHistoryPopState) }, setHistoryPopState: function () { this.history.paths = pe.getPathValues(), this.history.scrollToSlide(this.params.speed, this.history.paths.value, !1) }, getPathValues: function () { var e = t.location.pathname.slice(1).split("/").filter((function (e) { return "" !== e })), i = e.length; return { key: e[i - 2], value: e[i - 1] } }, setHistory: function (e, i) { if (this.history.initialized && this.params.history.enabled) { var s = this.slides.eq(i), a = pe.slugify(s.attr("data-history")); t.location.pathname.includes(e) || (a = e + "/" + a); var r = t.history.state; r && r.value === a || (this.params.history.replaceState ? t.history.replaceState({ value: a }, null, a) : t.history.pushState({ value: a }, null, a)) } }, slugify: function (e) { return e.toString().replace(/\s+/g, "-").replace(/[^\w-]+/g, "").replace(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, "") }, scrollToSlide: function (e, t, i) { if (t) for (var s = 0, a = this.slides.length; s < a; s += 1) { var r = this.slides.eq(s); if (pe.slugify(r.attr("data-history")) === t && !r.hasClass(this.params.slideDuplicateClass)) { var n = r.index(); this.slideTo(n, e, i) } } else this.slideTo(0, e, i) } }, ce = { onHashCange: function () { var t = e.location.hash.replace("#", ""); if (t !== this.slides.eq(this.activeIndex).attr("data-hash")) { var i = this.$wrapperEl.children("." + this.params.slideClass + '[data-hash="' + t + '"]').index(); if (void 0 === i) return; this.slideTo(i) } }, setHash: function () { if (this.hashNavigation.initialized && this.params.hashNavigation.enabled) if (this.params.hashNavigation.replaceState && t.history && t.history.replaceState) t.history.replaceState(null, null, "#" + this.slides.eq(this.activeIndex).attr("data-hash") || ""); else { var i = this.slides.eq(this.activeIndex), s = i.attr("data-hash") || i.attr("data-history"); e.location.hash = s || "" } }, init: function () { if (!(!this.params.hashNavigation.enabled || this.params.history && this.params.history.enabled)) { this.hashNavigation.initialized = !0; var i = e.location.hash.replace("#", ""); if (i) for (var a = 0, r = this.slides.length; a < r; a += 1) { var n = this.slides.eq(a); if ((n.attr("data-hash") || n.attr("data-history")) === i && !n.hasClass(this.params.slideDuplicateClass)) { var o = n.index(); this.slideTo(o, 0, this.params.runCallbacksOnInit, !0) } } this.params.hashNavigation.watchState && s(t).on("hashchange", this.hashNavigation.onHashCange) } }, destroy: function () { this.params.hashNavigation.watchState && s(t).off("hashchange", this.hashNavigation.onHashCange) } }, ue = { run: function () { var e = this, t = e.slides.eq(e.activeIndex), i = e.params.autoplay.delay; t.attr("data-swiper-autoplay") && (i = t.attr("data-swiper-autoplay") || e.params.autoplay.delay), clearTimeout(e.autoplay.timeout), e.autoplay.timeout = n.nextTick((function () { e.params.autoplay.reverseDirection ? e.params.loop ? (e.loopFix(), e.slidePrev(e.params.speed, !0, !0), e.emit("autoplay")) : e.isBeginning ? e.params.autoplay.stopOnLastSlide ? e.autoplay.stop() : (e.slideTo(e.slides.length - 1, e.params.speed, !0, !0), e.emit("autoplay")) : (e.slidePrev(e.params.speed, !0, !0), e.emit("autoplay")) : e.params.loop ? (e.loopFix(), e.slideNext(e.params.speed, !0, !0), e.emit("autoplay")) : e.isEnd ? e.params.autoplay.stopOnLastSlide ? e.autoplay.stop() : (e.slideTo(0, e.params.speed, !0, !0), e.emit("autoplay")) : (e.slideNext(e.params.speed, !0, !0), e.emit("autoplay")), e.params.cssMode && e.autoplay.running && e.autoplay.run() }), i) }, start: function () { return void 0 === this.autoplay.timeout && (!this.autoplay.running && (this.autoplay.running = !0, this.emit("autoplayStart"), this.autoplay.run(), !0)) }, stop: function () { return !!this.autoplay.running && (void 0 !== this.autoplay.timeout && (this.autoplay.timeout && (clearTimeout(this.autoplay.timeout), this.autoplay.timeout = void 0), this.autoplay.running = !1, this.emit("autoplayStop"), !0)) }, pause: function (e) { this.autoplay.running && (this.autoplay.paused || (this.autoplay.timeout && clearTimeout(this.autoplay.timeout), this.autoplay.paused = !0, 0 !== e && this.params.autoplay.waitForTransition ? (this.$wrapperEl[0].addEventListener("transitionend", this.autoplay.onTransitionEnd), this.$wrapperEl[0].addEventListener("webkitTransitionEnd", this.autoplay.onTransitionEnd)) : (this.autoplay.paused = !1, this.autoplay.run()))) } }, ve = { setTranslate: function () { for (var e = this.slides, t = 0; t < e.length; t += 1) { var i = this.slides.eq(t), s = -i[0].swiperSlideOffset; this.params.virtualTranslate || (s -= this.translate); var a = 0; this.isHorizontal() || (a = s, s = 0); var r = this.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(i[0].progress), 0) : 1 + Math.min(Math.max(i[0].progress, -1), 0); i.css({ opacity: r }).transform("translate3d(" + s + "px, " + a + "px, 0px)") } }, setTransition: function (e) { var t = this, i = t.slides, s = t.$wrapperEl; if (i.transition(e), t.params.virtualTranslate && 0 !== e) { var a = !1; i.transitionEnd((function () { if (!a && t && !t.destroyed) { a = !0, t.animating = !1; for (var e = ["webkitTransitionEnd", "transitionend"], i = 0; i < e.length; i += 1)s.trigger(e[i]) } })) } } }, fe = { setTranslate: function () { var e, t = this.$el, i = this.$wrapperEl, a = this.slides, r = this.width, n = this.height, o = this.rtlTranslate, l = this.size, d = this.params.cubeEffect, h = this.isHorizontal(), p = this.virtual && this.params.virtual.enabled, c = 0; d.shadow && (h ? (0 === (e = i.find(".swiper-cube-shadow")).length && (e = s('

'), i.append(e)), e.css({ height: r + "px" })) : 0 === (e = t.find(".swiper-cube-shadow")).length && (e = s('

'), t.append(e))); for (var u = 0; u < a.length; u += 1) { var v = a.eq(u), f = u; p && (f = parseInt(v.attr("data-swiper-slide-index"), 10)); var m = 90 * f, g = Math.floor(m / 360); o && (m = -m, g = Math.floor(-m / 360)); var b = Math.max(Math.min(v[0].progress, 1), -1), w = 0, y = 0, x = 0; f % 4 == 0 ? (w = 4 * -g * l, x = 0) : (f - 1) % 4 == 0 ? (w = 0, x = 4 * -g * l) : (f - 2) % 4 == 0 ? (w = l + 4 * g * l, x = l) : (f - 3) % 4 == 0 && (w = -l, x = 3 * l + 4 * l * g), o && (w = -w), h || (y = w, w = 0); var T = "rotateX(" + (h ? 0 : -m) + "deg) rotateY(" + (h ? m : 0) + "deg) translate3d(" + w + "px, " + y + "px, " + x + "px)"; if (b <= 1 && b > -1 && (c = 90 * f + 90 * b, o && (c = 90 * -f - 90 * b)), v.transform(T), d.slideShadows) { var E = h ? v.find(".swiper-slide-shadow-left") : v.find(".swiper-slide-shadow-top"), S = h ? v.find(".swiper-slide-shadow-right") : v.find(".swiper-slide-shadow-bottom"); 0 === E.length && (E = s('

'), v.append(E)), 0 === S.length && (S = s('

'), v.append(S)), E.length && (E[0].style.opacity = Math.max(-b, 0)), S.length && (S[0].style.opacity = Math.max(b, 0)) } } if (i.css({ "-webkit-transform-origin": "50% 50% -" + l / 2 + "px", "-moz-transform-origin": "50% 50% -" + l / 2 + "px", "-ms-transform-origin": "50% 50% -" + l / 2 + "px", "transform-origin": "50% 50% -" + l / 2 + "px" }), d.shadow) if (h) e.transform("translate3d(0px, " + (r / 2 + d.shadowOffset) + "px, " + -r / 2 + "px) rotateX(90deg) rotateZ(0deg) scale(" + d.shadowScale + ")"); else { var C = Math.abs(c) - 90 * Math.floor(Math.abs(c) / 90), M = 1.5 - (Math.sin(2 * C * Math.PI / 360) / 2 + Math.cos(2 * C * Math.PI / 360) / 2), P = d.shadowScale, z = d.shadowScale / M, k = d.shadowOffset; e.transform("scale3d(" + P + ", 1, " + z + ") translate3d(0px, " + (n / 2 + k) + "px, " + -n / 2 / z + "px) rotateX(-90deg)") } var $ = j.isSafari || j.isUiWebView ? -l / 2 : 0; i.transform("translate3d(0px,0," + $ + "px) rotateX(" + (this.isHorizontal() ? 0 : c) + "deg) rotateY(" + (this.isHorizontal() ? -c : 0) + "deg)") }, setTransition: function (e) { var t = this.$el; this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e), this.params.cubeEffect.shadow && !this.isHorizontal() && t.find(".swiper-cube-shadow").transition(e) } }, me = { setTranslate: function () { for (var e = this.slides, t = this.rtlTranslate, i = 0; i < e.length; i += 1) { var a = e.eq(i), r = a[0].progress; this.params.flipEffect.limitRotation && (r = Math.max(Math.min(a[0].progress, 1), -1)); var n = -180 * r, o = 0, l = -a[0].swiperSlideOffset, d = 0; if (this.isHorizontal() ? t && (n = -n) : (d = l, l = 0, o = -n, n = 0), a[0].style.zIndex = -Math.abs(Math.round(r)) + e.length, this.params.flipEffect.slideShadows) { var h = this.isHorizontal() ? a.find(".swiper-slide-shadow-left") : a.find(".swiper-slide-shadow-top"), p = this.isHorizontal() ? a.find(".swiper-slide-shadow-right") : a.find(".swiper-slide-shadow-bottom"); 0 === h.length && (h = s('

'), a.append(h)), 0 === p.length && (p = s('

'), a.append(p)), h.length && (h[0].style.opacity = Math.max(-r, 0)), p.length && (p[0].style.opacity = Math.max(r, 0)) } a.transform("translate3d(" + l + "px, " + d + "px, 0px) rotateX(" + o + "deg) rotateY(" + n + "deg)") } }, setTransition: function (e) { var t = this, i = t.slides, s = t.activeIndex, a = t.$wrapperEl; if (i.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e), t.params.virtualTranslate && 0 !== e) { var r = !1; i.eq(s).transitionEnd((function () { if (!r && t && !t.destroyed) { r = !0, t.animating = !1; for (var e = ["webkitTransitionEnd", "transitionend"], i = 0; i < e.length; i += 1)a.trigger(e[i]) } })) } } }, ge = { setTranslate: function () { for (var e = this.width, t = this.height, i = this.slides, a = this.$wrapperEl, r = this.slidesSizesGrid, n = this.params.coverflowEffect, l = this.isHorizontal(), d = this.translate, h = l ? e / 2 - d : t / 2 - d, p = l ? n.rotate : -n.rotate, c = n.depth, u = 0, v = i.length; u < v; u += 1) { var f = i.eq(u), m = r[u], g = (h - f[0].swiperSlideOffset - m / 2) / m * n.modifier, b = l ? p * g : 0, w = l ? 0 : p * g, y = -c * Math.abs(g), x = l ? 0 : n.stretch * g, T = l ? n.stretch * g : 0; Math.abs(T) < .001 && (T = 0), Math.abs(x) < .001 && (x = 0), Math.abs(y) < .001 && (y = 0), Math.abs(b) < .001 && (b = 0), Math.abs(w) < .001 && (w = 0); var E = "translate3d(" + T + "px," + x + "px," + y + "px) rotateX(" + w + "deg) rotateY(" + b + "deg)"; if (f.transform(E), f[0].style.zIndex = 1 - Math.abs(Math.round(g)), n.slideShadows) { var S = l ? f.find(".swiper-slide-shadow-left") : f.find(".swiper-slide-shadow-top"), C = l ? f.find(".swiper-slide-shadow-right") : f.find(".swiper-slide-shadow-bottom"); 0 === S.length && (S = s('

'), f.append(S)), 0 === C.length && (C = s('

'), f.append(C)), S.length && (S[0].style.opacity = g > 0 ? g : 0), C.length && (C[0].style.opacity = -g > 0 ? -g : 0) } } (o.pointerEvents || o.prefixedPointerEvents) && (a[0].style.perspectiveOrigin = h + "px 50%") }, setTransition: function (e) { this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e) } }, be = { init: function () { var e = this.params.thumbs, t = this.constructor; e.swiper instanceof t ? (this.thumbs.swiper = e.swiper, n.extend(this.thumbs.swiper.originalParams, { watchSlidesProgress: !0, slideToClickedSlide: !1 }), n.extend(this.thumbs.swiper.params, { watchSlidesProgress: !0, slideToClickedSlide: !1 })) : n.isObject(e.swiper) && (this.thumbs.swiper = new t(n.extend({}, e.swiper, { watchSlidesVisibility: !0, watchSlidesProgress: !0, slideToClickedSlide: !1 })), this.thumbs.swiperCreated = !0), this.thumbs.swiper.$el.addClass(this.params.thumbs.thumbsContainerClass), this.thumbs.swiper.on("tap", this.thumbs.onThumbClick) }, onThumbClick: function () { var e = this.thumbs.swiper; if (e) { var t = e.clickedIndex, i = e.clickedSlide; if (!(i && s(i).hasClass(this.params.thumbs.slideThumbActiveClass) || null == t)) { var a; if (a = e.params.loop ? parseInt(s(e.clickedSlide).attr("data-swiper-slide-index"), 10) : t, this.params.loop) { var r = this.activeIndex; this.slides.eq(r).hasClass(this.params.slideDuplicateClass) && (this.loopFix(), this._clientLeft = this.$wrapperEl[0].clientLeft, r = this.activeIndex); var n = this.slides.eq(r).prevAll('[data-swiper-slide-index="' + a + '"]').eq(0).index(), o = this.slides.eq(r).nextAll('[data-swiper-slide-index="' + a + '"]').eq(0).index(); a = void 0 === n ? o : void 0 === o ? n : o - r < r - n ? o : n } this.slideTo(a) } } }, update: function (e) { var t = this.thumbs.swiper; if (t) { var i = "auto" === t.params.slidesPerView ? t.slidesPerViewDynamic() : t.params.slidesPerView; if (this.realIndex !== t.realIndex) { var s, a = t.activeIndex; if (t.params.loop) { t.slides.eq(a).hasClass(t.params.slideDuplicateClass) && (t.loopFix(), t._clientLeft = t.$wrapperEl[0].clientLeft, a = t.activeIndex); var r = t.slides.eq(a).prevAll('[data-swiper-slide-index="' + this.realIndex + '"]').eq(0).index(), n = t.slides.eq(a).nextAll('[data-swiper-slide-index="' + this.realIndex + '"]').eq(0).index(); s = void 0 === r ? n : void 0 === n ? r : n - a == a - r ? a : n - a < a - r ? n : r } else s = this.realIndex; t.visibleSlidesIndexes && t.visibleSlidesIndexes.indexOf(s) < 0 && (t.params.centeredSlides ? s = s > a ? s - Math.floor(i / 2) + 1 : s + Math.floor(i / 2) - 1 : s > a && (s = s - i + 1), t.slideTo(s, e ? 0 : void 0)) } var o = 1, l = this.params.thumbs.slideThumbActiveClass; if (this.params.slidesPerView > 1 && !this.params.centeredSlides && (o = this.params.slidesPerView), this.params.thumbs.multipleActiveThumbs || (o = 1), o = Math.floor(o), t.slides.removeClass(l), t.params.loop || t.params.virtual && t.params.virtual.enabled) for (var d = 0; d < o; d += 1)t.$wrapperEl.children('[data-swiper-slide-index="' + (this.realIndex + d) + '"]').addClass(l); else for (var h = 0; h < o; h += 1)t.slides.eq(this.realIndex + h).addClass(l) } } }, we = [R, q, K, U, Z, J, te, { name: "mousewheel", params: { mousewheel: { enabled: !1, releaseOnEdges: !1, invert: !1, forceToAxis: !1, sensitivity: 1, eventsTarged: "container" } }, create: function () { n.extend(this, { mousewheel: { enabled: !1, enable: ie.enable.bind(this), disable: ie.disable.bind(this), handle: ie.handle.bind(this), handleMouseEnter: ie.handleMouseEnter.bind(this), handleMouseLeave: ie.handleMouseLeave.bind(this), animateSlider: ie.animateSlider.bind(this), releaseScroll: ie.releaseScroll.bind(this), lastScrollTime: n.now(), lastEventBeforeSnap: void 0, recentWheelEvents: [] } }) }, on: { init: function () { !this.params.mousewheel.enabled && this.params.cssMode && this.mousewheel.disable(), this.params.mousewheel.enabled && this.mousewheel.enable() }, destroy: function () { this.params.cssMode && this.mousewheel.enable(), this.mousewheel.enabled && this.mousewheel.disable() } } }, { name: "navigation", params: { navigation: { nextEl: null, prevEl: null, hideOnClick: !1, disabledClass: "swiper-button-disabled", hiddenClass: "swiper-button-hidden", lockClass: "swiper-button-lock" } }, create: function () { n.extend(this, { navigation: { init: se.init.bind(this), update: se.update.bind(this), destroy: se.destroy.bind(this), onNextClick: se.onNextClick.bind(this), onPrevClick: se.onPrevClick.bind(this) } }) }, on: { init: function () { this.navigation.init(), this.navigation.update() }, toEdge: function () { this.navigation.update() }, fromEdge: function () { this.navigation.update() }, destroy: function () { this.navigation.destroy() }, click: function (e) { var t, i = this.navigation, a = i.$nextEl, r = i.$prevEl; !this.params.navigation.hideOnClick || s(e.target).is(r) || s(e.target).is(a) || (a ? t = a.hasClass(this.params.navigation.hiddenClass) : r && (t = r.hasClass(this.params.navigation.hiddenClass)), !0 === t ? this.emit("navigationShow", this) : this.emit("navigationHide", this), a && a.toggleClass(this.params.navigation.hiddenClass), r && r.toggleClass(this.params.navigation.hiddenClass)) } } }, { name: "pagination", params: { pagination: { el: null, bulletElement: "span", clickable: !1, hideOnClick: !1, renderBullet: null, renderProgressbar: null, renderFraction: null, renderCustom: null, progressbarOpposite: !1, type: "bullets", dynamicBullets: !1, dynamicMainBullets: 1, formatFractionCurrent: function (e) { return e }, formatFractionTotal: function (e) { return e }, bulletClass: "swiper-pagination-bullet", bulletActiveClass: "swiper-pagination-bullet-active", modifierClass: "swiper-pagination-", currentClass: "swiper-pagination-current", totalClass: "swiper-pagination-total", hiddenClass: "swiper-pagination-hidden", progressbarFillClass: "swiper-pagination-progressbar-fill", progressbarOppositeClass: "swiper-pagination-progressbar-opposite", clickableClass: "swiper-pagination-clickable", lockClass: "swiper-pagination-lock" } }, create: function () { n.extend(this, { pagination: { init: ae.init.bind(this), render: ae.render.bind(this), update: ae.update.bind(this), destroy: ae.destroy.bind(this), dynamicBulletIndex: 0 } }) }, on: { init: function () { this.pagination.init(), this.pagination.render(), this.pagination.update() }, activeIndexChange: function () { this.params.loop ? this.pagination.update() : void 0 === this.snapIndex && this.pagination.update() }, snapIndexChange: function () { this.params.loop || this.pagination.update() }, slidesLengthChange: function () { this.params.loop && (this.pagination.render(), this.pagination.update()) }, snapGridLengthChange: function () { this.params.loop || (this.pagination.render(), this.pagination.update()) }, destroy: function () { this.pagination.destroy() }, click: function (e) { this.params.pagination.el && this.params.pagination.hideOnClick && this.pagination.$el.length > 0 && !s(e.target).hasClass(this.params.pagination.bulletClass) && (!0 === this.pagination.$el.hasClass(this.params.pagination.hiddenClass) ? this.emit("paginationShow", this) : this.emit("paginationHide", this), this.pagination.$el.toggleClass(this.params.pagination.hiddenClass)) } } }, { name: "scrollbar", params: { scrollbar: { el: null, dragSize: "auto", hide: !1, draggable: !1, snapOnRelease: !0, lockClass: "swiper-scrollbar-lock", dragClass: "swiper-scrollbar-drag" } }, create: function () { n.extend(this, { scrollbar: { init: re.init.bind(this), destroy: re.destroy.bind(this), updateSize: re.updateSize.bind(this), setTranslate: re.setTranslate.bind(this), setTransition: re.setTransition.bind(this), enableDraggable: re.enableDraggable.bind(this), disableDraggable: re.disableDraggable.bind(this), setDragPosition: re.setDragPosition.bind(this), getPointerPosition: re.getPointerPosition.bind(this), onDragStart: re.onDragStart.bind(this), onDragMove: re.onDragMove.bind(this), onDragEnd: re.onDragEnd.bind(this), isTouched: !1, timeout: null, dragTimeout: null } }) }, on: { init: function () { this.scrollbar.init(), this.scrollbar.updateSize(), this.scrollbar.setTranslate() }, update: function () { this.scrollbar.updateSize() }, resize: function () { this.scrollbar.updateSize() }, observerUpdate: function () { this.scrollbar.updateSize() }, setTranslate: function () { this.scrollbar.setTranslate() }, setTransition: function (e) { this.scrollbar.setTransition(e) }, destroy: function () { this.scrollbar.destroy() } } }, { name: "parallax", params: { parallax: { enabled: !1 } }, create: function () { n.extend(this, { parallax: { setTransform: ne.setTransform.bind(this), setTranslate: ne.setTranslate.bind(this), setTransition: ne.setTransition.bind(this) } }) }, on: { beforeInit: function () { this.params.parallax.enabled && (this.params.watchSlidesProgress = !0, this.originalParams.watchSlidesProgress = !0) }, init: function () { this.params.parallax.enabled && this.parallax.setTranslate() }, setTranslate: function () { this.params.parallax.enabled && this.parallax.setTranslate() }, setTransition: function (e) { this.params.parallax.enabled && this.parallax.setTransition(e) } } }, { name: "zoom", params: { zoom: { enabled: !1, maxRatio: 3, minRatio: 1, toggle: !0, containerClass: "swiper-zoom-container", zoomedSlideClass: "swiper-slide-zoomed" } }, create: function () { var e = this, t = { enabled: !1, scale: 1, currentScale: 1, isScaling: !1, gesture: { $slideEl: void 0, slideWidth: void 0, slideHeight: void 0, $imageEl: void 0, $imageWrapEl: void 0, maxRatio: 3 }, image: { isTouched: void 0, isMoved: void 0, currentX: void 0, currentY: void 0, minX: void 0, minY: void 0, maxX: void 0, maxY: void 0, width: void 0, height: void 0, startX: void 0, startY: void 0, touchesStart: {}, touchesCurrent: {} }, velocity: { x: void 0, y: void 0, prevPositionX: void 0, prevPositionY: void 0, prevTime: void 0 } }; "onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out".split(" ").forEach((function (i) { t[i] = oe[i].bind(e) })), n.extend(e, { zoom: t }); var i = 1; Object.defineProperty(e.zoom, "scale", { get: function () { return i }, set: function (t) { if (i !== t) { var s = e.zoom.gesture.$imageEl ? e.zoom.gesture.$imageEl[0] : void 0, a = e.zoom.gesture.$slideEl ? e.zoom.gesture.$slideEl[0] : void 0; e.emit("zoomChange", t, s, a) } i = t } }) }, on: { init: function () { this.params.zoom.enabled && this.zoom.enable() }, destroy: function () { this.zoom.disable() }, touchStart: function (e) { this.zoom.enabled && this.zoom.onTouchStart(e) }, touchEnd: function (e) { this.zoom.enabled && this.zoom.onTouchEnd(e) }, doubleTap: function (e) { this.params.zoom.enabled && this.zoom.enabled && this.params.zoom.toggle && this.zoom.toggle(e) }, transitionEnd: function () { this.zoom.enabled && this.params.zoom.enabled && this.zoom.onTransitionEnd() }, slideChange: function () { this.zoom.enabled && this.params.zoom.enabled && this.params.cssMode && this.zoom.onTransitionEnd() } } }, { name: "lazy", params: { lazy: { enabled: !1, loadPrevNext: !1, loadPrevNextAmount: 1, loadOnTransitionStart: !1, elementClass: "swiper-lazy", loadingClass: "swiper-lazy-loading", loadedClass: "swiper-lazy-loaded", preloaderClass: "swiper-lazy-preloader" } }, create: function () { n.extend(this, { lazy: { initialImageLoaded: !1, load: le.load.bind(this), loadInSlide: le.loadInSlide.bind(this) } }) }, on: { beforeInit: function () { this.params.lazy.enabled && this.params.preloadImages && (this.params.preloadImages = !1) }, init: function () { this.params.lazy.enabled && !this.params.loop && 0 === this.params.initialSlide && this.lazy.load() }, scroll: function () { this.params.freeMode && !this.params.freeModeSticky && this.lazy.load() }, resize: function () { this.params.lazy.enabled && this.lazy.load() }, scrollbarDragMove: function () { this.params.lazy.enabled && this.lazy.load() }, transitionStart: function () { this.params.lazy.enabled && (this.params.lazy.loadOnTransitionStart || !this.params.lazy.loadOnTransitionStart && !this.lazy.initialImageLoaded) && this.lazy.load() }, transitionEnd: function () { this.params.lazy.enabled && !this.params.lazy.loadOnTransitionStart && this.lazy.load() }, slideChange: function () { this.params.lazy.enabled && this.params.cssMode && this.lazy.load() } } }, { name: "controller", params: { controller: { control: void 0, inverse: !1, by: "slide" } }, create: function () { n.extend(this, { controller: { control: this.params.controller.control, getInterpolateFunction: de.getInterpolateFunction.bind(this), setTranslate: de.setTranslate.bind(this), setTransition: de.setTransition.bind(this) } }) }, on: { update: function () { this.controller.control && this.controller.spline && (this.controller.spline = void 0, delete this.controller.spline) }, resize: function () { this.controller.control && this.controller.spline && (this.controller.spline = void 0, delete this.controller.spline) }, observerUpdate: function () { this.controller.control && this.controller.spline && (this.controller.spline = void 0, delete this.controller.spline) }, setTranslate: function (e, t) { this.controller.control && this.controller.setTranslate(e, t) }, setTransition: function (e, t) { this.controller.control && this.controller.setTransition(e, t) } } }, { name: "a11y", params: { a11y: { enabled: !0, notificationClass: "swiper-notification", prevSlideMessage: "Previous slide", nextSlideMessage: "Next slide", firstSlideMessage: "This is the first slide", lastSlideMessage: "This is the last slide", paginationBulletMessage: "Go to slide {{index}}" } }, create: function () { var e = this; n.extend(e, { a11y: { liveRegion: s('') } }), Object.keys(he).forEach((function (t) { e.a11y[t] = he[t].bind(e) })) }, on: { init: function () { this.params.a11y.enabled && (this.a11y.init(), this.a11y.updateNavigation()) }, toEdge: function () { this.params.a11y.enabled && this.a11y.updateNavigation() }, fromEdge: function () { this.params.a11y.enabled && this.a11y.updateNavigation() }, paginationUpdate: function () { this.params.a11y.enabled && this.a11y.updatePagination() }, destroy: function () { this.params.a11y.enabled && this.a11y.destroy() } } }, { name: "history", params: { history: { enabled: !1, replaceState: !1, key: "slides" } }, create: function () { n.extend(this, { history: { init: pe.init.bind(this), setHistory: pe.setHistory.bind(this), setHistoryPopState: pe.setHistoryPopState.bind(this), scrollToSlide: pe.scrollToSlide.bind(this), destroy: pe.destroy.bind(this) } }) }, on: { init: function () { this.params.history.enabled && this.history.init() }, destroy: function () { this.params.history.enabled && this.history.destroy() }, transitionEnd: function () { this.history.initialized && this.history.setHistory(this.params.history.key, this.activeIndex) }, slideChange: function () { this.history.initialized && this.params.cssMode && this.history.setHistory(this.params.history.key, this.activeIndex) } } }, { name: "hash-navigation", params: { hashNavigation: { enabled: !1, replaceState: !1, watchState: !1 } }, create: function () { n.extend(this, { hashNavigation: { initialized: !1, init: ce.init.bind(this), destroy: ce.destroy.bind(this), setHash: ce.setHash.bind(this), onHashCange: ce.onHashCange.bind(this) } }) }, on: { init: function () { this.params.hashNavigation.enabled && this.hashNavigation.init() }, destroy: function () { this.params.hashNavigation.enabled && this.hashNavigation.destroy() }, transitionEnd: function () { this.hashNavigation.initialized && this.hashNavigation.setHash() }, slideChange: function () { this.hashNavigation.initialized && this.params.cssMode && this.hashNavigation.setHash() } } }, { name: "autoplay", params: { autoplay: { enabled: !1, delay: 3e3, waitForTransition: !0, disableOnInteraction: !0, stopOnLastSlide: !1, reverseDirection: !1 } }, create: function () { var e = this; n.extend(e, { autoplay: { running: !1, paused: !1, run: ue.run.bind(e), start: ue.start.bind(e), stop: ue.stop.bind(e), pause: ue.pause.bind(e), onVisibilityChange: function () { "hidden" === document.visibilityState && e.autoplay.running && e.autoplay.pause(), "visible" === document.visibilityState && e.autoplay.paused && (e.autoplay.run(), e.autoplay.paused = !1) }, onTransitionEnd: function (t) { e && !e.destroyed && e.$wrapperEl && t.target === this && (e.$wrapperEl[0].removeEventListener("transitionend", e.autoplay.onTransitionEnd), e.$wrapperEl[0].removeEventListener("webkitTransitionEnd", e.autoplay.onTransitionEnd), e.autoplay.paused = !1, e.autoplay.running ? e.autoplay.run() : e.autoplay.stop()) } } }) }, on: { init: function () { this.params.autoplay.enabled && (this.autoplay.start(), document.addEventListener("visibilitychange", this.autoplay.onVisibilityChange)) }, beforeTransitionStart: function (e, t) { this.autoplay.running && (t || !this.params.autoplay.disableOnInteraction ? this.autoplay.pause(e) : this.autoplay.stop()) }, sliderFirstMove: function () { this.autoplay.running && (this.params.autoplay.disableOnInteraction ? this.autoplay.stop() : this.autoplay.pause()) }, touchEnd: function () { this.params.cssMode && this.autoplay.paused && !this.params.autoplay.disableOnInteraction && this.autoplay.run() }, destroy: function () { this.autoplay.running && this.autoplay.stop(), document.removeEventListener("visibilitychange", this.autoplay.onVisibilityChange) } } }, { name: "effect-fade", params: { fadeEffect: { crossFade: !1 } }, create: function () { n.extend(this, { fadeEffect: { setTranslate: ve.setTranslate.bind(this), setTransition: ve.setTransition.bind(this) } }) }, on: { beforeInit: function () { if ("fade" === this.params.effect) { this.classNames.push(this.params.containerModifierClass + "fade"); var e = { slidesPerView: 1, slidesPerColumn: 1, slidesPerGroup: 1, watchSlidesProgress: !0, spaceBetween: 0, virtualTranslate: !0 }; n.extend(this.params, e), n.extend(this.originalParams, e) } }, setTranslate: function () { "fade" === this.params.effect && this.fadeEffect.setTranslate() }, setTransition: function (e) { "fade" === this.params.effect && this.fadeEffect.setTransition(e) } } }, { name: "effect-cube", params: { cubeEffect: { slideShadows: !0, shadow: !0, shadowOffset: 20, shadowScale: .94 } }, create: function () { n.extend(this, { cubeEffect: { setTranslate: fe.setTranslate.bind(this), setTransition: fe.setTransition.bind(this) } }) }, on: { beforeInit: function () { if ("cube" === this.params.effect) { this.classNames.push(this.params.containerModifierClass + "cube"), this.classNames.push(this.params.containerModifierClass + "3d"); var e = { slidesPerView: 1, slidesPerColumn: 1, slidesPerGroup: 1, watchSlidesProgress: !0, resistanceRatio: 0, spaceBetween: 0, centeredSlides: !1, virtualTranslate: !0 }; n.extend(this.params, e), n.extend(this.originalParams, e) } }, setTranslate: function () { "cube" === this.params.effect && this.cubeEffect.setTranslate() }, setTransition: function (e) { "cube" === this.params.effect && this.cubeEffect.setTransition(e) } } }, { name: "effect-flip", params: { flipEffect: { slideShadows: !0, limitRotation: !0 } }, create: function () { n.extend(this, { flipEffect: { setTranslate: me.setTranslate.bind(this), setTransition: me.setTransition.bind(this) } }) }, on: { beforeInit: function () { if ("flip" === this.params.effect) { this.classNames.push(this.params.containerModifierClass + "flip"), this.classNames.push(this.params.containerModifierClass + "3d"); var e = { slidesPerView: 1, slidesPerColumn: 1, slidesPerGroup: 1, watchSlidesProgress: !0, spaceBetween: 0, virtualTranslate: !0 }; n.extend(this.params, e), n.extend(this.originalParams, e) } }, setTranslate: function () { "flip" === this.params.effect && this.flipEffect.setTranslate() }, setTransition: function (e) { "flip" === this.params.effect && this.flipEffect.setTransition(e) } } }, { name: "effect-coverflow", params: { coverflowEffect: { rotate: 50, stretch: 0, depth: 100, modifier: 1, slideShadows: !0 } }, create: function () { n.extend(this, { coverflowEffect: { setTranslate: ge.setTranslate.bind(this), setTransition: ge.setTransition.bind(this) } }) }, on: { beforeInit: function () { "coverflow" === this.params.effect && (this.classNames.push(this.params.containerModifierClass + "coverflow"), this.classNames.push(this.params.containerModifierClass + "3d"), this.params.watchSlidesProgress = !0, this.originalParams.watchSlidesProgress = !0) }, setTranslate: function () { "coverflow" === this.params.effect && this.coverflowEffect.setTranslate() }, setTransition: function (e) { "coverflow" === this.params.effect && this.coverflowEffect.setTransition(e) } } }, { name: "thumbs", params: { thumbs: { multipleActiveThumbs: !0, swiper: null, slideThumbActiveClass: "swiper-slide-thumb-active", thumbsContainerClass: "swiper-container-thumbs" } }, create: function () { n.extend(this, { thumbs: { swiper: null, init: be.init.bind(this), update: be.update.bind(this), onThumbClick: be.onThumbClick.bind(this) } }) }, on: { beforeInit: function () { var e = this.params.thumbs; e && e.swiper && (this.thumbs.init(), this.thumbs.update(!0)) }, slideChange: function () { this.thumbs.swiper && this.thumbs.update() }, update: function () { this.thumbs.swiper && this.thumbs.update() }, resize: function () { this.thumbs.swiper && this.thumbs.update() }, observerUpdate: function () { this.thumbs.swiper && this.thumbs.update() }, setTransition: function (e) { var t = this.thumbs.swiper; t && t.setTransition(e) }, beforeDestroy: function () { var e = this.thumbs.swiper; e && this.thumbs.swiperCreated && e && e.destroy() } } }]; return void 0 === W.use && (W.use = W.Class.use, W.installModule = W.Class.installModule), W.use(we), W })); //# sourceMappingURL=swiper.min.js.map /*! * ANI-Util JavaScript Library v1.0 * * Copyright 2021. Yoon jae-ho * Released under the MIT license * * Date: 2021-02-09 */ var ANIUTIL = (function () {var calRange = function (values) { var values = {targetValue: values.targetValue,progress: values.progress,startPoint: !!!values.startPoint ? 0 : values.startPoint,endPoint: !!!values.endPoint ? 100 : values.endPoint }; if (values.startPoint > 0) {values.endPoint = values.endPoint - values.startPoint > 0 ? values.endPoint - values.startPoint : values.endPoint; } var returnValue = (values.targetValue * (values.progress - values.startPoint)) / values.endPoint; if (returnValue > values.targetValue) {returnValue = values.targetValue; } if (returnValue < 0) {returnValue = 0; } return returnValue;}; var percentToPixel = function (opts) { var targetValue = opts.targetValue,progress = opts.progress; return targetValue * (progress / 100);}; var videoObjectFit = function (opts) { var init = function (opts) {this.opts = opts;this.resizeTiming = opts.resizeTiming ? opts.resizeTiming : 100;this.setElement();this.setVideoStyle();this.bindEvent(); }; var fn = init.prototype; fn.setElement = function () {if (this.opts.wrapElement !== undefined) { this.wrapElement = this.opts.wrapElement.jquery ? this.opts.wrapElement[0] : this.opts.wrapElement;} if (this.opts.targetVideo !== undefined) { this.targetVideo = this.opts.targetVideo.jquery ? this.opts.targetVideo[0] : this.opts.targetVideo;} }; fn.setVideoStyle = function () {this.wrapElement.style.overflow = 'hidden';this.targetVideo.style.position = 'absolute';this.targetVideo.style.top = '50%';this.targetVideo.style.left = '50%';this.targetVideo.style.transform = 'translate(-50%, -50%)'; }; fn.bindEvent = function () {var self = this; window.addEventListener('load', function () { self.setVideoSize();}); window.addEventListener('resize', function () { self.setVideoSize();}); }; fn.getVideoInfo = function () {this.wrapWidth = this.wrapElement.clientWidth;this.wrapHeight = this.wrapElement.clientHeight;this.videoWidth = this.targetVideo.clientWidth;this.videoHeight = this.targetVideo.clientHeight;this.wrapRatio = this.wrapHeight / this.wrapWidth;this.videoRatio = this.videoHeight / this.videoWidth; }; fn.setVideoSize = function () {var self = this, timer = null; clearTimeout(timer); timer = setTimeout(function () { self.getVideoInfo(); if (self.wrapRatio < self.videoRatio) {self.targetVideo.style.width = '100%';self.targetVideo.style.height = 'auto'; } else {self.targetVideo.style.width = 'auto';self.targetVideo.style.height = '100%'; }}, this.resizeTiming); }; return new init(opts);}; var addClass = function (opts) { var classLength = opts.classList.length; for (var i = 0; i < classLength; i++) {opts.targetElement.classList.add(opts.classList[i]); }}; var removeClass = function (opts) { var classLength = opts.classList.length; for (var i = 0; i < classLength; i++) {opts.targetElement.classList.remove(opts.classList[i]); }}; var scrollController = function (opt) { var opt = opt ? opt : {},agent = navigator.userAgent.toLowerCase(),targetElement = document.scrollingElement || document.documentElement || document.body.parentNode || document.body,speed = !!!opt.speed ? 120 : opt.speed,duration = opt.duration >= 0 ? opt.duration : 1,scrollSize = targetElement.scrollTop,maxScrollSize,frameElement = targetElement === document.body && document.documentElement ? document.documentElement : targetElement, // safari is the new IEmoveState = false,scrollTiming = null; var init = function () {if (agent.indexOf('chrome') == -1 && agent.indexOf('safari') != -1) return; bindEvent.wheel();bindEvent.scroll(); }; var bindEvent = {wheel: function () { if ((navigator.appName == 'Netscape' && navigator.userAgent.search('Trident') != -1) || agent.indexOf('msie') != -1) {document.addEventListener( 'mousewheel', function (e) {if (document.documentElement.style.overflow == 'hidden') return;eventList.scrollEvent(e); }, {passive: false }); } else {document.addEventListener( 'wheel', function (e) {if (eventList.hasScrollBox(e.target)) return;eventList.scrollEvent(e); }, {passive: false }); }},scroll: function () { window.addEventListener('scroll', function () {if (document.documentElement.style.overflow == 'hidden') return; if (!moveState) { scrollSize = targetElement.scrollTop;} });} }; var eventList = {scrollEvent: function (e) { e.preventDefault(); var fixedMoveSpeed = document.body.getAttribute('data-scroll-speed'); var delta = this.normalizeWheelDelta(e),moveSpeed = opt.currDelta && fixedMoveSpeed ? fixedMoveSpeed : !!!fixedMoveSpeed && !!!speed ? 120 : speed; scrollSize = scrollSize + -delta * moveSpeed; //현재까지 스크롤한 사이즈 maxScrollSize = Math.max(0, Math.min(scrollSize, targetElement.scrollHeight - frameElement.clientHeight)); //최대 스크롤 사이즈 this.update();},normalizeWheelDelta: function (e) { if (e.detail) {if (e.wheelDelta) { return (e.wheelDelta / e.detail / 40) * (e.detail > 0 ? 1 : -1); // Opera} else { return -e.detail / 3; // Firefox} } else {return e.wheelDelta / 120; // IE,Safari,Chrome }},update: function () { var moveRange = maxScrollSize - targetElement.scrollTop,moveSize = 0 >= Math.ceil(targetElement.scrollTop + moveRange) ? 0 : scrollSize > maxScrollSize ? maxScrollSize : Math.ceil(targetElement.scrollTop + moveRange); //한번 스크롤시 이동할 거리 moveState = true; TweenMax.to(targetElement, duration, {ease: 'power1.out',scrollTop: moveSize,onComplete: function () { clearTimeout(scrollTiming); scrollTiming = null; scrollTiming = setTimeout(function () {moveState = false;scrollSize = targetElement.scrollTop; }, 500);} }); if (scrollSize <= 0) {scrollSize = 0; } else if (scrollSize >= maxScrollSize) {scrollSize = maxScrollSize; }},hasScrollBox: function (node) { while (node && node !== document.body && node !== document) {var overflowNode = window.getComputedStyle(node)['overflow'];if (overflowNode && (overflowNode.indexOf('auto') > -1 || overflowNode.indexOf('scroll') > -1)) { return true;}node = node.parentNode; } return false;} }; var requestAnimationFrame = (function () {// requestAnimationFrame cross browserreturn ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (func) {window.setTimeout(func, 1000 / 50); }); })(); return init();}; var resizeScrollOffset = function (opt) { var scrollProgress = null,correctionTiming = null,resizeTiming = !!!opt ? 200 : opt + 200; var scrollElement, scrollElementHeight, winScrollTop, scrollProgress; var init = function () {bindEvent(); }; var getScrollProgerss = function () {if (scrollProgress == null) { scrollElement = document.scrollingElement || document.documentElement || document.body.parentNode || document.body; scrollElementHeight = document.body.clientHeight; winScrollTop = window.pageYOffset + scrollElement.clientHeight; scrollProgress = winScrollTop / scrollElementHeight;} else { scrollElementHeight = document.body.clientHeight;} }; var setCorrScroll = function () {clearTimeout(correctionTiming);correctionTiming = setTimeout(function () { window.scrollTo(0, scrollElementHeight * scrollProgress - window.innerHeight); scrollProgress = null;}, resizeTiming); }; var bindEvent = function () {window.addEventListener('resize', function () { getScrollProgerss(); setCorrScroll();}); }; return init();}; var checkTouchDevice = function () { if (navigator.userAgent.indexOf('Windows') > -1 || navigator.userAgent.indexOf('Macintosh') > -1) {return false; } else if ('ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch)) {return true; }}; var checkFold = function () { var foldState; var screenRatio = screen.width / screen.height; var isFold = checkTouchDevice() && screenRatio > 0.7137 && screenRatio < 0.8 && document.getElementsByName('viewport')[0].content == 'width=768'; var isFoldLatest = checkTouchDevice() && screenRatio > 0.8 && screenRatio < 0.95 && document.getElementsByName('viewport')[0].content == 'width=768'; if (isFold) {foldState = 'isFold'; } else if (isFoldLatest) {foldState = 'isFoldLatest'; } return foldState;}; var deviceConsole = function (value, visible) { var consoleElement, consoleValueElement; if (!document.querySelector('.console-layer')) {consoleElement = document.createElement('div'); consoleElement.classList.add('console-layer');consoleElement.setAttribute('style', 'position: fixed; left: 0; top: 0; padding: 20px; z-index:1000000000; background: #fff;');document.querySelector('body').append(consoleElement); } if (visible == 'multi') {consoleElement = document.querySelector('.console-layer');consoleValueElement = document.createElement('div');consoleValueElement.classList.add('console-value');consoleValueElement.setAttribute('style', 'border: 1px #ddd solid; float: left; padding: 10px;');consoleElement.append(consoleValueElement); } else {if (!document.querySelector('.console-value')) { consoleValueElement = document.createElement('div'); consoleValueElement.classList.add('console-value'); consoleValueElement.setAttribute('style', 'border: 1px #ddd solid; float: left; padding: 10px;'); consoleElement.append(consoleValueElement); consoleValueElement = document.querySelector('.console-value');} else { consoleValueElement = document.querySelector('.console-value');} } consoleValueElement.innerHTML = value;}; var responsiveHandler = function (opts) { window.resolutionStatus = null; var isResolution,oldActiveIndex,isActiveIndex,callbackTiming = null; var windowWidth = window.innerWidth; var opts = {resolution: opts.resolution,statusName: opts.statusName || [],callback: opts.callback || [],activeTiming: !!!opts.activeTiming ? 100 : opts.activeTiming }; var checkResolution = function () {windowWidth = window.innerWidth;for (var i = 0; i < opts.resolution.length; i++) { var currentSize = opts.resolution[i],nextSize = !!!opts.resolution[i + 1] ? 0 : opts.resolution[i + 1]; if ((windowWidth <= currentSize && windowWidth > nextSize && isResolution != opts.statusName[i]) || (windowWidth <= currentSize && windowWidth > nextSize && isActiveIndex != i)) {document.documentElement.classList.remove(isResolution);isResolution = opts.statusName[i] || i;isActiveIndex = i;document.documentElement.classList.add(isResolution); } else if ((windowWidth >= opts.resolution[0] && isResolution != opts.statusName[0]) || (windowWidth >= opts.resolution[0] && !!!isActiveIndex)) {document.documentElement.classList.remove(isResolution);isResolution = opts.statusName[0] || i;isActiveIndex = i;document.documentElement.classList.add(isResolution); }} }; var activeCallbacks = function () {clearTimeout(callbackTiming);console.log(opts.activeTiming);if (oldActiveIndex == isActiveIndex) return;if (!!!opts.callback[isActiveIndex]) return;callbackTiming = setTimeout(function () { opts.callback[isActiveIndex](); callbackTiming = null; oldActiveIndex = isActiveIndex;}, opts.activeTiming); }; var bindEvent = function () {window.addEventListener('DOMContentLoaded', function () { checkResolution(); oldActiveIndex = isActiveIndex;}); window.addEventListener('resize', function () { checkResolution(); activeCallbacks();}); }; var init = function () {bindEvent(); return this; }; return init(opts);}; return { calRange: function (values) {return calRange(values); }, videoObjectFit: function (opts) {videoObjectFit(opts); }, addClass: function (opts) {addClass(opts); }, removeClass: function (opts) {removeClass(opts); }, scrollController: function (opt) {scrollController(opt); }, resizeScrollOffset: function (opt) {resizeScrollOffset(opt); }, checkTouchDevice: checkTouchDevice, checkFold: checkFold, deviceConsole: deviceConsole, percentToPixel: percentToPixel, responsiveHandler: responsiveHandler}; })(); 'use strict'; window.WATCH6 = window.WATCH6 || {}; const UTILS = (function () {return { isIosDevice: (function () {var isIos = /iPad|iPhone|iPod/.test(navigator.userAgent);isIos ? document.documentElement.classList.add('isIosDevice') : document.documentElement.classList.add('isNotIosDevice');return isIos; })(), checkGlobal: (function () {var check = location.pathname.indexOf('/global/galaxy') === 0 || window.IS_CAMPAIGN === true;if (check) document.documentElement.classList.add('global');else document.documentElement.classList.add('dotcom'); })(), checkOS: (function () {var os = navigator.appVersion.match(/(mac|win|linux)/i);os = os ? os[1].toLowerCase() : '';document.documentElement.classList.add(os); })(), isFireFox: (function () {var check = /firefox/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('firefox'); })(), isWebkit: (function () {var check = /applewebkit/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('webkit'); })(), isChrome: (function () {var check = /chrome/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('chrome'); })(), isOpera: (function () {var check = /opera/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('opera'); })(), isIos: (function () {var check = /ip(ad|hone|od)/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('ios'); })(), isCrIos: (function () {var check = /crios/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('crios'); })(), isAndroid: (function () {var check = /android/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('android'); })(), isSafari: (function () {var checkWebkit = /applewebkit/i.test(navigator.userAgent);var checkChrome = /chrome/i.test(navigator.userAgent);if (checkWebkit && !checkChrome) document.documentElement.classList.add('safari'); })(), isHuawei: (function () {var check = /HUAWEICLT/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('huawei'); })(), isUCBrowser: (function () {var check = /UCBrowser/i.test(navigator.userAgent);if (check) document.documentElement.classList.add('ucbrowser'); })(), winSize: (function () {var isWinSafari = (function () { var appNetscape = navigator.appName === 'Netscape',appVersionMac = navigator.appVersion.indexOf('Mac') !== -1,userAgentSafari = navigator.userAgent.indexOf('Safari') !== -1,userAgentChrome = navigator.userAgent.indexOf('Chrome') !== -1; return appNetscape && !appVersionMac && userAgentSafari && !userAgentChrome;})();if (isWinSafari) { return function () {var win_wh = { w: $(win).width(), h: $(win).height()};return win_wh; };} else { return function () {var win_wh = { w: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, h: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight};return win_wh; };} })(), requestAFrame: (function () {return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {return window.setTimeout(callback, 1000 / 60); }); })(), cancelAFrame: (function () {return ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (id) {window.clearTimeout(id); }); })(), isObject: function (o) {return typeof o === 'object' && o !== null && o.constructor && o.constructor === Object; }, def: function () {var args = [], len$1 = arguments.length;while (len$1--) args[len$1] = arguments[len$1];var to = Object(args[0]);for (var i = 1; i < args.length; i += 1) { var nextSource = args[i]; if (nextSource !== undefined && nextSource !== null) {var keysArray = Object.keys(Object(nextSource));for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) { var nextKey = keysArray[nextIndex]; var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); if (desc !== undefined && desc.enumerable) {if (this.isObject(to[nextKey]) && this.isObject(nextSource[nextKey])) { this.def(to[nextKey], nextSource[nextKey]);} else if (!this.isObject(to[nextKey]) && this.isObject(nextSource[nextKey])) { to[nextKey] = {}; this.def(to[nextKey], nextSource[nextKey]);} else { to[nextKey] = nextSource[nextKey];} }} }}return to; }, convertArray: function (nodeList) {return Array.prototype.slice.call(nodeList); }, getOffset: function (element) {var top = element.getBoundingClientRect().top + window.pageYOffset, bottom = element.getBoundingClientRect().bottom + window.pageYOffset;return { top: top, bottom: bottom}; }, getScroll: function () {var top = window.pageYOffset, bottom = top + window.innerHeight;return { top: top, bottom: bottom}; }, getViewPort: function () {var doc = window;var pre = 'inner'; if (!('innerWidth' in window)) { pre = 'client'; doc = document.documentElement || document.body;} return { width: doc[pre + 'Width'], height: doc[pre + 'Height']}; }, getCurrentDevice: function () {var device = 'desktop';var width = UTILS.getViewPort().width;if (width >= 1024) { device = 'desktop';} else if (width < 1024 && width >= 768) { device = 'tablet';} else { device = 'mobile';}return device; }, isInVerticalViewPort: function (el) {var rect = el.getBoundingClientRect();return rect.top - 200 <= UTILS.getViewPort().height && rect.bottom >= 0; }, isInHorizontalViewPort: function (el) {var rect = el.getBoundingClientRect();return rect.left - 200 <= UTILS.getViewPort().width && rect.right + 200 >= 0; }, isVerticalVisible: function (el) {return UTILS.isInVerticalViewPort(el) && !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length); }, isHorizontalVisible: function (el) {return UTILS.isInHorizontalViewPort(el) && !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length); }, setCookie: function (name, value, day) {var date = new Date();date.setTime(date.getTime() + day * 60 * 60 * 24 * 1000);document.cookie = name + '=' + value + '; exprires=' + date.toUTCString() + '; path=/'; }, getCookie: function (name) {var value = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');return value ? value[2] : null; }, triggerEvent: function (el, eventName, detail, bubbles, cancelable) {var _detail = !!detail ? detail : null;var _bubbles = !!bubbles ? bubbles : false;var _cancelable = !!cancelable ? cancelable : true;var event; if (_detail == null) { event = document.createEvent('HTMLEvents'); event.initEvent(eventName, _bubbles, _cancelable);} else { event = document.createEvent('CustomEvent'); event.initCustomEvent(eventName, _bubbles, _cancelable, _detail);}el.dispatchEvent(event); }, visibleScroll: function () {if (document.documentElement.classList.contains('isTouchDevice')) return;if (this.scrollFlag === true) { this.scrollFlag = false; document.body.style.position = ''; document.body.style.width = ''; document.body.style.top = ''; document.body.style.boxSizing = ''; document.body.style.paddingRight = ''; document.documentElement.style.overflow = ''; if (this.popupEl !== null) {this.popupEl.style.paddingRight = '';this.popupEl = null; } window.scrollTo(0, this.currentPos);} }, hiddenScroll: function (popupEl) {if (document.documentElement.classList.contains('isTouchDevice')) return;this.popupEl = !!popupEl ? popupEl : null;this.scrollFlag = true;this.currentPos = window.pageYOffset || document.documentElement.scrollTop; var scrollBarWidth = window.innerWidth - document.documentElement.clientWidth;var fixedPos; if (this.currentPos > 0) { fixedPos = '-' + this.currentPos + 'px';} else { fixedPos = 0;} document.body.style.position = 'fixed';document.body.style.width = '100%';document.body.style.top = fixedPos;document.body.style.boxSizing = 'border-box';document.body.style.paddingRight = scrollBarWidth + 'px';document.documentElement.style.overflow = 'hidden'; if (this.popupEl !== null) { this.popupEl.style.paddingRight = scrollBarWidth + 'px';} }, closest: function (el, selector) {do { if (el == document.documentElement) return null; if (el.matches ? el.matches(selector) : el.msMatchesSelector(selector)) return el; el = el.parentElement || el.parentNode;} while (el !== null || el.nodeType === 1); return null; }, onPopupAccessibility: function (el) {el.setAttribute('aria-hidden', true);el.setAttribute('tabindex', -1); var clickable = el.querySelectorAll('a, button, input, select, iframe');for (var i = 0; i < clickable.length; i++) { var currAria = clickable[i].getAttribute('aria-hidden'); var currTab = clickable[i].getAttribute('tabindex'); if (currAria != null && clickable[i].getAttribute('data-prev-aria-hidden') == null) clickable[i].setAttribute('data-prev-aria-hidden', currAria); if (currTab != null && clickable[i].getAttribute('data-prev-tabindex') == null) clickable[i].setAttribute('data-prev-tabindex', currTab); clickable[i].setAttribute('tabindex', -1); clickable[i].setAttribute('aria-hidden', true);} }, offPopupAccessibility: function (el) {el.removeAttribute('aria-hidden');el.removeAttribute('tabindex'); var clickable = el.querySelectorAll('a, button, input, select, iframe');for (var i = 0; i < clickable.length; i++) { var prevAria = clickable[i].getAttribute('data-prev-aria-hidden'); var prevTab = clickable[i].getAttribute('data-prev-tabindex'); if (prevAria != null) clickable[i].setAttribute('aria-hidden', prevAria); else clickable[i].removeAttribute('aria-hidden'); if (prevTab != null) clickable[i].setAttribute('tabindex', prevTab); else clickable[i].removeAttribute('tabindex'); clickable[i].removeAttribute('data-prev-aria-hidden'); clickable[i].removeAttribute('data-prev-tabindex');} }, onAccessibility: function (el) {if (!document.documentElement.classList.contains('is-layer-popup-opened')) { el.setAttribute('aria-hidden', true); el.setAttribute('tabindex', -1); var clickable = el.querySelectorAll('a, button, input, select, iframe'); for (var i = 0; i < clickable.length; i++) {clickable[i].setAttribute('tabindex', -1);clickable[i].setAttribute('aria-hidden', true); }} }, offAccessibility: function (el) {if (!document.documentElement.classList.contains('is-layer-popup-opened')) { el.removeAttribute('aria-hidden'); el.removeAttribute('tabindex'); var clickable = el.querySelectorAll('a, button, input, select, iframe'); for (var i = 0; i < clickable.length; i++) {clickable[i].removeAttribute('tabindex');clickable[i].removeAttribute('aria-hidden'); }} }, extend: function (de, add) {Object.keys(add).forEach(function (key) { de[key] = add[key];}); return de; }, getHeight: function (target) {if (!!target) { var targetStyle = window.getComputedStyle(target); var targetDisplay = targetStyle.display; var targetMaxHeight = parseInt(targetStyle.maxHeight); var returnHeight = 0; if (targetDisplay != 'none' && targetMaxHeight != 0) {return target.offsetHeight; } target.style.position = 'absolute'; target.style.visibility = 'hidden'; target.style.display = 'block'; returnHeight = target.offsetHeight; target.style.display = ''; target.style.position = ''; target.style.visibility = ''; return returnHeight;} return 0; }, setLastActiveItem: function (target) {if (!!target) { this.lastActiveItem = target;} else { this.lastActiveItem = null;} }, getLastActiveItem: function () {if (this.lastActiveItem != null) { return this.lastActiveItem;} else { return null;} }, isRTL: function () {return document.documentElement.classList.contains('rtl'); }, checkRegion: function () {var metas = document.getElementsByTagName('meta');var region = '';for (var i = 0; i < metas.length; i++) { if (metas[i].getAttribute('name') == 'sitecode') {region = metas[i].getAttribute('content');return region; }}if (region == '') return document.location.pathname.indexOf('global') > -1 ? 'global' : 'jp'; }, isLowNetwork: function () {var cookie = '___GALAXY_SPEED';if (UTILS.getCookie(cookie) == null || UTILS.getCookie(cookie) == undefined) return false;else if (UTILS.getCookie(cookie) == 'L') return true;else if (UTILS.getCookie(cookie) == 'H') return false; }, getQueryString: function (key) {var str = location.href;var index = str.indexOf('?') + 1;var lastIndex = str.indexOf('#') > -1 ? str.indexOf('#') + 1 : str.length; if (index == 0) return ''; str = str.substring(index, lastIndex);str = str.split('&');var result = '';for (var i = 0; i < str.length; i++) { var arr = str[i].split('='); if (arr.length != 2) break; if (arr[0] == key) result = arr[1]; break;}return result; }, customParallax: function (opts) {var mode = opts.mode ? opts.mode : 'center';var delay = opts.delay ? opts.delay : 0;var ease = opts.ease ? opts.ease : 'Power0.easeNone';var transZ = opts.transZ ? opts.transZ : 0;var duration = opts.duration ? opts.duration : 0.3;var distance = opts.distance ? opts.distance : 0;var correction = opts.correction ? opts.correction : 0;var windowCorrection = opts.windowCorrection ? window.innerHeight * opts.windowCorrection : 0;var direction = opts.direction ? opts.direction : 1;var activeElement = opts.activeElement;var targetElement = opts.targetElement ? opts.targetElement : activeElement;var wrapperElement = opts.wrapperElement ? opts.wrapperElement : activeElement;var unit = opts.unit ? opts.unit : 'px'; var winScrollTop = window.pageYOffset;var winScrollBottom = window.pageYOffset + window.innerHeight;var elementRect = activeElement.getBoundingClientRect();var elementOffsetTop = winScrollTop + wrapperElement.getBoundingClientRect().top;var elementOffsetBottom = elementOffsetTop + wrapperElement.getBoundingClientRect().height;var trackHeight = window.innerHeight + elementRect.height + windowCorrection * 2; var elementOffsetY = mode == 'center' ? elementRect.top - (window.innerHeight - elementRect.height) / 2 : elementRect.top - window.innerHeight;if (unit == 'px') distance = (elementRect.height * distance) / 100;var percent = correction + ((elementOffsetY * (mode == 'center' ? distance * 2 : distance)) / trackHeight) * direction; if (elementOffsetTop <= winScrollBottom + windowCorrection && elementOffsetBottom >= winScrollTop - windowCorrection) { TweenMax.to(targetElement, duration, {y: percent + unit,z: transZ,ease: ease,delay: delay });} }, getNavHeight: function () {var navHeight = 0;var navigation = document.querySelector('.pd-g-header-navigation') || document.querySelector('#subnav') || document.querySelector('.sticky-menu') || document.querySelector('.pd-g-floating-nav');if (!!navigation) { if (navigation.classList.contains('pd-g-header-navigation')) {var headerNav = navigation.querySelector('.pd-header-navigation');var menuWrap = headerNav.querySelector('.pd-header-navigation__menu-wrap');navHeight = headerNav.clientHeight + menuWrap.clientHeight; } else {navHeight = navigation.clientHeight; }}return navHeight; }, isBrokenFixed: function () {var winWidth = window.innerWidth;var winHeight = window.innerHeight;var brokenFixed = false; document.documentElement.classList.remove('is-broken-fixed');if (winWidth >= 1440 && winHeight <= 540) { document.documentElement.classList.add('is-broken-fixed'); brokenFixed = true;} else if (winWidth <= 810 && winHeight / winWidth < 0.5277) { document.documentElement.classList.add('is-broken-fixed'); brokenFixed = true;} else if (winWidth / window.outerWidth < 0.4) { document.documentElement.classList.add('is-broken-fixed'); brokenFixed = true;} else if (winHeight < UTILS.MIN_VIEW_HEIGHT) { document.documentElement.classList.add('is-broken-fixed'); brokenFixed = true;} else { document.documentElement.classList.remove('is-broken-fixed');} return brokenFixed; }, isFullAnimationBrokenFixed: () => {const winWidth = window.innerWidth;const winHeight = window.innerHeight;const mobileLandscapeMode = !!UTILS.isTouchDevice && window.matchMedia('(orientation: landscape)').matches;const mobilePortraitMode = !!UTILS.isTouchDevice && !window.matchMedia('(orientation: landscape)').matches;let brokenFixed = false; if (mobilePortraitMode && winHeight / winWidth < 1.5) { document.documentElement.classList.add('is-animation-broken-fixed'); brokenFixed = true;} else if (mobileLandscapeMode) { document.documentElement.classList.add('is-animation-broken-fixed'); brokenFixed = true;} else if (winHeight < 700) { document.documentElement.classList.add('is-animation-broken-fixed'); brokenFixed = true;} else { document.documentElement.classList.remove('is-animation-broken-fixed');} // if (winHeight - winWidth >= 0 && winHeight - winWidth < 300) {// document.documentElement.classList.add('is-animation-broken-fixed');// brokenFixed = true;// } else if (winHeight < UTILS.MIN_VIEW_HEIGHT) {// document.documentElement.classList.add('is-animation-broken-fixed');// brokenFixed = true;// } else {// document.documentElement.classList.remove('is-animation-broken-fixed');// } return brokenFixed }, isTouchDevice: (function () {var checkDevice = 'ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch);checkDevice ? document.documentElement.classList.add('isTouchDevice') : document.documentElement.classList.add('isNotTouchDevice');return checkDevice; })(), isIEorEdge: (function () {var word;var agent = navigator.userAgent.toLowerCase();if (navigator.appName == 'Microsoft Internet Explorer') { word = 'msie ';} else if (agent.search('trident') > -1) { word = 'trident/.*rv:';} else if (agent.search('edge/') > -1) { word = 'edge/';} else { return -1;}var reg = new RegExp(word + '([0-9]{1,})(\\.{0,}[0-9]{0,1})');if (reg.exec(agent) != null) { document.documentElement.classList.add('isIEorEdge'); return parseFloat(RegExp.$1 + RegExp.$2);}return -1; })(), page: {scrollLock: { className: 'is-no-scroll', barWidth: function () {return window.innerWidth - document.documentElement.clientWidth; }, el: (function () {return $('html'); })(), run: function (w) {document.documentElement.style.paddingRight = w + 'px'; }, off: function () {var barWidth = this.barWidth();this.el.removeClass(this.className);// NOTE : standard pd 템플릿 대응this.el.removeClass('hive-layer-scroll-lock');this.run(0); // const bodyEl = document.querySelector('body');// bodyEl.style.position = null;// bodyEl.style.top = null;// bodyEl.style.width = null;// window.scrollTo(0, this.scrollEnd) }, on: function () {var barWidth = this.barWidth();this.el.addClass(this.className);this.run(barWidth); // const bodyEl = document.querySelector('body');// const scrollStart = window.pageYOffset || document.documentElement.scrollTop;// bodyEl.style.position = 'fixed';// bodyEl.style.top = -scrollStart + 'px';// bodyEl.style.width = '100%';// this.scrollEnd = scrollStart <= 0 ? 0 : scrollStart; }} }, MIN_VIEW_HEIGHT: 400, RESPONSIVE: {PC: { NAME: 'pc', WIDTH: 1440},TABLET: { NAME: 'tablet', WIDTH: 1024},MOBILE: { NAME: 'mobile', WIDTH: 767} }}; })(); WATCH6.UTILS = UTILS; /*! * Scrolle JavaScript Library v1.0.4 * * Copyright 2021. Yoon jae-ho * Released under the MIT license * * Date: 2021-02-09 */ 'use strict' var SCROLLER = (function () {var init = function (opts) { this.initialize = true; this.opts = opts; this.correction = !!!opts.correction ? 0 : opts.correction; this.removeCorrection = !!!opts.removeCorrection ? 0 : opts.removeCorrection; this.trackHeight = !!!opts.trackHeight ? 0 : opts.trackHeight; this.activeClass = opts.activeClass; this.activeCallbackClass = !!!opts.activeCallbackClass ? 'callback-active' : opts.activeCallbackClass; this.useStrictMode = opts.useStrictMode == undefined ? true : opts.useStrictMode; this.useFixed = !!!opts.useFixed ? false : opts.useFixed; this.useFixedStyle = opts.useFixedStyle == undefined ? true : opts.useFixedStyle; this.useSticky = !!!opts.useSticky ? false : opts.useSticky; this.useStickyStyle = opts.useStickyStyle == undefined ? true : opts.useStickyStyle; this.useViewportOver = !!!opts.useViewportOver ? true : opts.useViewportOver; this.activeVisibility = !!!opts.activeVisibility ? 'before' : opts.activeVisibility; this.activeType = !!!opts.activeType ? 'reverse' : this.opts.activeType; this.autoHeight = opts.autoHeight == undefined ? true : opts.autoHeight; this.offsetY = !!!opts.offsetY ? 0 : opts.offsetY; this.resize = opts.resize == undefined ? true : opts.resize; this.resizeTiming = opts.resizeTiming == undefined ? false : opts.resizeTiming; this.windowHeight = window.innerHeight; this.oldPregress = 0; this.oldWinScrollTop = 0; this.elementInformation = {}; this.isFixedArea = false; this.checkTouchDevice = false; this.elementEventList.setElement.call(this); this.bindEvent();}; var fn = init.prototype; fn.bindEvent = function () { var self = this; var setTimeing = null; this.elementHandler(); if (this.resize) {this.addEventList = function () { if (!self.resizeTiming) {self.windowHeight = window.innerHeight;self.elementHandler(); } else {clearTimeout(setTimeing);setTimeing = setTimeout(function () { self.windowHeight = window.innerHeight; self.elementHandler();}, self.resizeTiming); }};window.addEventListener('resize', this.addEventList); } if (this.opts.IEScroll) {this.utilList.IEScrollHandler.call(this); }}; fn.elementHandler = function () { this.elementEventList.setTrackStyle.call(this); this.getFixedState(); if (this.trackHeight > 1) {this.elementEventList.setTrackHeigh.call(this); } if (!this.useSticky && this.useFixed && this.useFixedStyle) {this.elementEventList.setFixedStyle.call(this); } if (this.useSticky && !this.useFixed && this.useStickyStyle) {this.elementEventList.setStickyStyle.call(this); } return this;}; fn.utilList = { checkTouchDevice: function () {if (navigator.userAgent.indexOf('Windows') > -1 || navigator.userAgent.indexOf('Macintosh') > -1) { return this.checkTouchDevice = false;} else if ('ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch)) { return this.checkTouchDevice = true;} }, IEScrollHandler: function () {if (navigator.userAgent.match(/Trident\/7\./)) { this.body.addEventListener('mousewheel', function (e) {e.preventDefault();var wheelDelta = e.wheelDelta, currentScrollPosition = window.pageYOffset;window.scrollTo(0, currentScrollPosition - wheelDelta); }); this.body.addEventListener('keydown', function (e) {var currentScrollPosition = window.pageYOffset; switch (e.which) { case 38:e.preventDefault();window.scrollTo(0, currentScrollPosition - 40);break; case 40:e.preventDefault();window.scrollTo(0, currentScrollPosition + 40);break; default:return;} });} }, getScroll: function () {var top = window.pageYOffset, bottom = top + this.windowHeight;return { top: top, bottom: bottom}; }, getOffset: function (element) {var top = element.getBoundingClientRect().top + window.pageYOffset, bottom = element.getBoundingClientRect().bottom + window.pageYOffset;return { top: top, bottom: bottom}; }, getUserAgent: function () {return navigator.userAgent; }}; fn.elementEventList = { setElement: function () {this.body = document.querySelector('body'); if (this.opts.trackElement !== undefined) { this.trackElement = this.opts.trackElement.jquery ? this.opts.trackElement[0] : this.opts.trackElement;} if (this.opts.fixedElement !== undefined) { this.fixedElement = this.opts.fixedElement.jquery ? this.opts.fixedElement[0] : this.opts.fixedElement;} if (this.opts.activeElement !== undefined) { this.activeElement = this.opts.activeElement.jquery ? this.opts.activeElement[0] : this.opts.activeElement;} }, setTrackHeigh: function () {if (this.trackHeight <= 1) return; this.trackElement.style.height = ''; var checkTrackHeight = this.trackElement.clientHeight == 0;var isTrackHeight = this.windowHeight; var calTrackHeight = isTrackHeight * this.trackHeight; if (checkTrackHeight) { this.trackElement.style.height = this.windowHeight + 'px';} this.trackElement.style.height = calTrackHeight + 'px'; }, setTrackStyle: function () {if (!!!this.trackElement) return; if (this.useFixed && window.getComputedStyle(this.trackElement).position == 'static') { this.trackElement.style.position = 'relative';} }, setFixedStyle: function () {if (!this.isFixedArea) { this.fixedElement.style.height = ''; this.fixedElement.style.top = ''; this.fixedElement.style.position = 'absolute';} if (this.fixedElement.clientWidth == 0) { this.fixedElement.style.width = '100%';} if (this.autoHeight) { if (typeof this.offsetY == 'string') {this.fixedElement.style.height = 'calc(' + this.windowHeight + 'px - ' + this.offsetY + ')';this.fixedElement.style.top = this.offsetY; } else {this.fixedElement.style.height = (this.windowHeight - this.offsetY) + 'px';this.fixedElement.style.top = this.offsetY + 'px'; }} }, setStickyStyle: function () {if (!this.isFixedArea) { this.fixedElement.style.position = 'sticky';} if (this.fixedElement.clientWidth == 0) { this.fixedElement.style.width = '100%';} }, setFixedElement: function () {this.diffHeight = this.windowHeight - this.fixedElement.clientHeight;this.trackTopOffset = this.utilList.getOffset.call(this, this.trackElement).top;this.trackBottomOffset = this.utilList.getOffset.call(this, this.trackElement).bottom; if (this.winScrollTop <= this.trackTopOffset) { this.fixedElement.style.position = 'absolute'; if (typeof this.offsetY == 'string') {this.fixedElement.style.top = this.offsetY; } else {this.fixedElement.style.top = this.offsetY + 'px'; } this.fixedElement.style.bottom = '';} else if (this.winScrollBottom >= this.trackBottomOffset) { this.fixedElement.style.position = 'absolute'; this.fixedElement.style.top = this.trackElement.clientHeight - this.fixedElement.clientHeight + 'px';} else { if (!this.isFixedArea) {this.fixedElement.style.position = 'fixed';this.fixedElement.style.top = '0'; }}; },}; fn.getWheelDirection = function () { if (this.winScrollTop >= this.oldWinScrollTop) {this.wheelDirection = 'down'; } else {this.wheelDirection = 'up'; } this.oldWinScrollTop = this.winScrollTop;}; fn.getProgress = function () { var trackTopOffset = this.utilList.getOffset.call(this, this.trackElement).top - (this.windowHeight * this.correction),trackHeight = this.useFixed || this.useSticky ? Math.abs(this.trackElement.clientHeight - this.windowHeight) : this.useViewportOver ? this.trackElement.clientHeight + this.windowHeight : this.trackElement.clientHeight,scrollTop = this.winScrollTop - trackTopOffset,scrollBottom = this.winScrollBottom - trackTopOffset,calProgress = this.useFixed || this.useSticky ? scrollTop / trackHeight * 100 : scrollBottom / trackHeight * 100; if (this.useStrictMode) {this.progress = Math.floor(calProgress) < 0 ? 0 : Math.floor(calProgress) > 100 ? 100 : Math.floor(calProgress); } else {this.progress = calProgress; }; this.getWheelDirection(); return this.progress;}; fn.getFixedState = function () { if (this.progress > 0 && this.progress < 100) {this.isFixedArea = true; } else {this.isFixedArea = false; }}; fn.trackAnimation = function (callback) { if (!this.initialize) return; this.winScrollTop = this.utilList.getScroll.call(this).top - (this.windowHeight * this.correction); this.winScrollBottom = this.utilList.getScroll.call(this).bottom; if (this.useFixed && !this.useSticky) {this.elementEventList.setFixedElement.call(this); }; this.getProgress(); this.getFixedState(); if (callback) {if (this.oldPregress !== this.progress) { callback.call(this);};this.oldPregress = this.progress; };}; fn.activeAnimation = function () { if (!this.initialize) return; this.winScrollTop = this.utilList.getScroll.call(this).top; this.winScrollBottom = this.utilList.getScroll.call(this).bottom; this.trackElementHeight = this.trackElement.clientHeight; this.correctionValue = this.trackElementHeight * this.correction; this.removeCorrectionValue = this.trackElementHeight * this.removeCorrection; this.elementOffsetTop = this.utilList.getOffset.call(this, this.trackElement).top; this.elementOffsetBottom = this.utilList.getOffset.call(this, this.trackElement).bottom; this.downScrollTop = this.winScrollTop - this.correctionValue; this.downScrollBottom = this.winScrollBottom - this.correctionValue; this.upScrollTop = this.winScrollTop + this.correctionValue; this.upScrollBottom = this.winScrollBottom + this.correctionValue; var self = this; var visibleType = this.activeVisibility,removeType = this.activeType,corrHeight = this.windowHeight / 2; var addActiveClass = function () {if (!!!self.activeClass) return; if (typeof self.activeClass == 'object') { var classLength = self.activeClass.length; for (var i = 0; i < classLength; i++) {if (!self.activeElement.classList.contains(self.activeClass[i])) { self.activeElement.classList.add(self.activeClass[i]);} }} else { if (!self.activeElement.classList.contains(self.activeClass)) {self.activeElement.classList.add(self.activeClass); }} }; var removeActiveClass = function () {if (typeof self.activeClass == 'object') { var classLength = self.activeClass.length; for (var i = 0; i < classLength; i++) {if (self.activeElement.classList.contains(self.activeClass[i])) { self.activeElement.classList.remove(self.activeClass[i]);} }} else { if (self.activeElement.classList.contains(self.activeClass)) {self.activeElement.classList.remove(self.activeClass); }} if (self.activeElement.classList.contains(self.activeCallbackClass)) { self.activeElement.classList.remove(self.activeCallbackClass);} }; var activeCallback = function () {if (!self.activeElement.classList.contains(self.activeCallbackClass)) { if (!!!self.opts.activeCallback) return; self.opts.activeCallback.call(self); self.activeElement.classList.add(self.activeCallbackClass);} }; var endCallback = function () {if (self.activeElement.classList.contains(self.activeCallbackClass)) { if (!!!self.opts.endCallback) return; self.opts.endCallback.call(self);} }; var activeHandler = function () {activeCallback();addActiveClass(); }; var removeHandler = function () {endCallback();removeActiveClass(); }; this.getWheelDirection(); switch (visibleType) {case 'before': if (this.wheelDirection == 'down' && this.downScrollBottom >= this.elementOffsetTop && this.downScrollTop <= this.elementOffsetTop ||this.wheelDirection == 'up' && this.upScrollTop <= this.elementOffsetBottom && this.upScrollBottom >= this.elementOffsetBottom ||this.activeType == 'oneWay' && this.downScrollBottom >= this.elementOffsetTop) {activeHandler();this.activeStatus = true; } break; case 'visible': if (this.wheelDirection == 'down' && this.downScrollBottom >= this.elementOffsetTop + corrHeight && this.downScrollTop <= this.elementOffsetTop ||this.wheelDirection == 'up' && this.upScrollTop <= this.elementOffsetBottom - corrHeight && this.upScrollBottom >= this.elementOffsetBottom ||this.activeType == 'oneWay' && this.downScrollBottom >= this.elementOffsetTop + corrHeight) {activeHandler();this.activeStatus = true; } break; } switch (removeType) {case 'reverse': if (visibleType == 'visible') {if (this.activeStatus && this.wheelDirection == 'down' && this.winScrollTop > this.elementOffsetBottom || this.activeStatus && this.wheelDirection == 'up' && this.winScrollBottom < this.elementOffsetTop) { removeHandler(); this.activeStatus = false;} } else {if (this.activeStatus && this.winScrollTop < this.elementOffsetTop && this.winScrollBottom < this.elementOffsetTop || this.activeStatus && this.winScrollTop > this.elementOffsetBottom && this.winScrollBottom > this.elementOffsetBottom) { removeHandler(); this.activeStatus = false;} } break; case 'oneWay': if (visibleType == 'visible') {if (this.activeStatus && this.winScrollBottom < this.elementOffsetTop + corrHeight) { removeHandler(); this.activeStatus = false;} } else {if (this.activeStatus && this.winScrollTop < this.elementOffsetTop && this.winScrollBottom < this.elementOffsetTop) { removeHandler(); this.activeStatus = false;} } break; }};//TO-DO: 네이밍 변경fn.getElementInformation = function () { if (this.trackElement) {this.elementInformation.trackElement = { element: this.trackElement, width: this.trackElement.clientWidth, height: this.trackElement.clientHeight, topOffset: this.utilList.getOffset.call(this, this.trackElement).top, bottomOffset: this.utilList.getOffset.call(this, this.trackElement).bottom} }; if (this.activeElement) {this.elementInformation.activeElement = { element: this.activeElement, width: this.activeElement.clientWidth, height: this.activeElement.clientHeight, topOffset: this.utilList.getOffset.call(this, this.activeElement).top, bottomOffset: this.utilList.getOffset.call(this, this.activeElement).bottom} }; return this.elementInformation;} fn.destroy = function (e) { if (!!this.trackElement) {this.trackElement.style.position = '';this.trackElement.style.height = ''; } if (!!this.fixedElement) {this.fixedElement.style.position = '';this.fixedElement.style.top = '';this.fixedElement.style.height = ''; } this.trackElement = ''; this.fixedElement = ''; this.activeElement = ''; this.correction = ''; this.trackHeight = ''; this.activeCallbackClass = ''; this.useFixed = ''; this.activeVisibility = ''; this.activeType = ''; this.offsetY = ''; this.resize = ''; this.windowHeight = ''; this.elementInformation = ''; window.removeEventListener('load', this.addEventList); window.removeEventListener('resize', this.addEventList); this.initialize = false;}; return function (opts) { return new init(opts);}; })(); (function () {'use strict'; window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS; class ImageLoader { constructor(el = container, args) {const defParams = { el: el, lazyClass: '.js-img-src', lazyCompleteClass: 'load-complete', startLazyClass: args.startLazyClass || '.js-start-img-src', endLazyClass: args.endLazyClass || '.js-end-img-src', responsiveClass: args.responsiveClass || '.js-res-img', loadOption: args.loadOption, visiblePoint: !!!args.visiblePoint ? 0 : args.visiblePoint, useDefaultImg: args.useDefaultImg, resizeStart: null};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {this.initOpts();this.getLazyImage();this.getResponsiveImage();this.bindEvents(); } initOpts() {this.targetAttr = this.opts.loadOption[0].attribute;this.responsiveCheck = this.opts.loadOption;this.dynamicCallCount = 0;this.dynamicLoadedComplate = false; if (this.opts.useDefaultImg) { this.setDefaultImage();} } getLazyImage() {const lazyImageList = Array.from(this.el.querySelectorAll(this.opts.lazyClass));const dynamicLazyImageList = Array.from(this.el.querySelectorAll(this.opts.startLazyClass));const lazyImageAllList = lazyImageList.concat(dynamicLazyImageList); this.lazyImages = lazyImageAllList;this.lazyLength = lazyImageAllList.length; } getResponsiveImage() {const responsiveImageList = this.el.querySelectorAll(this.opts.responsiveClass); this.responsiveImages = responsiveImageList;this.responsiveLength = responsiveImageList.length; } bindEvents() {window.addEventListener('load', this.onLoadHandler.bind(this));window.addEventListener('scroll', this.lazyEvent.bind(this)); if (this.responsiveCheck) { window.addEventListener('resize', this.onResizeHandler.bind(this));} } onLoadHandler() {this.responsiveHandler();this.lazyEvent(); } onResizeHandler() {clearTimeout(this.opts.resizeStart);this.opts.resizeStart = setTimeout(() => { this.responsiveHandler(); this.lazyEvent();}, 80); } lazyEvent() {this.setLazyImage(); if (this.lazyLength === this.lazyCompleteLength) { window.removeEventListener('scroll', this.lazyEvent.bind(this));} } responsiveHandler() {this.windowWidth = window.innerWidth;let resolutionLength = this.opts.loadOption.length; for (let i = 0; i < resolutionLength; i++) { let nextIndex = i + 1,nextPoint = nextIndex == resolutionLength ? 0 : this.opts.loadOption[nextIndex].resolution,checkPoint = false; if (i == 0) {checkPoint = this.windowWidth > nextPoint; } else {checkPoint = this.windowWidth <= this.opts.loadOption[i].resolution && this.windowWidth > nextPoint; } if (checkPoint) {if (this.opts.loadOption[i].attribute !== this.oldAttr) { this.targetAttr = this.opts.loadOption[i].attribute; this.oldAttr = this.targetAttr; this.attrIndex = i; this.dynamicCallCount = 0; this.setResponsiveImage();} }} } setResponsiveImage(imageTarget) {if (imageTarget) { for (let i = 0; i < imageTarget.length; i++) {let targetImage = imageTarget[i];let imgSrc = imageTarget[i].getAttribute(this.targetAttr); if (!!!imgSrc) { imgSrc = this.findImageHandler(targetImage);} if (!imageTarget[i].classList.contains(this.opts.lazyCompleteClass)) { imageTarget[i].setAttribute('src', imgSrc); imageTarget[i].classList.add(this.opts.lazyCompleteClass);} }} else { for (let i = 0; i < this.responsiveLength; i++) {let targetImage = this.responsiveImages[i];let imgSrc = targetImage.getAttribute(this.targetAttr); if (!!!imgSrc) { imgSrc = this.findImageHandler(targetImage);} if (targetImage.classList.contains(this.opts.lazyCompleteClass)) { targetImage.setAttribute('src', imgSrc);} }} } checkCompleteImage() {let lazyCompleteList = this.el.querySelectorAll('.' + this.opts.lazyCompleteClass); this.lazyCompleteLength = lazyCompleteList.length; } setDefaultImage() {for (var i = 0; i < this.lazyLength; i++) { this.lazyImages[i].setAttribute('src', 'data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH/C1hNUCBEYXRhWE1QAz94cAAh+QQFAAAAACwAAAAAAQABAAACAkQBADs=');} } setLazyImage() {this.windowHeight = window.innerHeight; for (let i = 0; i < this.lazyLength; i++) { let targetElement = this.lazyImages[i],corrHeight = this.windowHeight * this.opts.visiblePoint,scrollTop = UTILS.getScroll.call(this).top - corrHeight,scrollBottom = UTILS.getScroll.call(this).bottom + corrHeight,targetOffsetTop = UTILS.getOffset.call(this, targetElement).top,targetOffsetBottom = UTILS.getOffset.call(this, targetElement).bottom,lazyClass = this.opts.lazyClass.split('.'),removeClass = lazyClass[lazyClass.length - 1],startLazyClass = this.opts.startLazyClass.split('.'),startRemoveClass = startLazyClass[startLazyClass.length - 1]; let isOffsetParent; if (window.getComputedStyle(targetElement).display === 'none') {const targetParent = targetElement.parentNode; if (targetParent.offsetParent != null) { isOffsetParent = targetParent.offsetParent; targetOffsetTop = UTILS.getOffset.call(this, targetParent).top; targetOffsetBottom = UTILS.getOffset.call(this, targetParent).bottom;} } else {isOffsetParent = targetElement.offsetParent; } if (((scrollBottom > targetOffsetTop && scrollTop <= targetOffsetTop) || (scrollTop < targetOffsetBottom && scrollBottom > targetOffsetBottom) || (scrollTop < targetOffsetTop && scrollBottom > targetOffsetBottom) || (scrollTop > targetOffsetTop && scrollBottom < targetOffsetBottom)) && isOffsetParent != null ) {let imgSrc = targetElement.getAttribute(this.targetAttr); if (!!!imgSrc) { imgSrc = this.findImageHandler(targetElement);} if (!targetElement.classList.contains(this.opts.lazyCompleteClass)) { targetElement.setAttribute('src', imgSrc); var imageLoadEvent = () => {if (this.opts.startLazyClass.split(' ').length == 1) targetElement.classList.remove(startRemoveClass);if (this.opts.lazyClass.split(' ').length == 1) targetElement.classList.remove(removeClass);// imgElement.classList.add(self.lazyCompleteClass);this.checkCompleteImage();targetElement.removeEventListener('load', imageLoadEvent); }; targetElement.addEventListener('load', imageLoadEvent); targetElement.classList.add(this.opts.lazyCompleteClass);} }} } findRemainingImageAttr(element) {var attrLength = this.opts.loadOption.length; for (var i = 0; i < attrLength; i++) { var getAttr = element.getAttribute(this.opts.loadOption[i].attribute); if (getAttr) {return getAttr;break; }} } findNextImageAttr(element) {const isIndex = this.attrIndex; for (let i = isIndex; i >= 0; i--) { let getAttr = element.getAttribute(this.opts.loadOption[i].attribute); if (getAttr) {return getAttr;break; } if (i == 0 && getAttr == undefined) {return this.findRemainingImageAttr(element); }} } findImageHandler(element) {if (this.attrIndex !== 0) { return this.findNextImageAttr(element);} else { return this.findRemainingImageAttr(element);} }} WATCH6.ImageLoader = ImageLoader; })(); (function () {'use strict'; window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class VideoLoader { constructor(el = container, args) {const defParams = { el: el, lazyClass: args.lazyClass || '.js-video-src', responsiveClass: args.responsiveClass || '.js-res-video', imageLazyCompleteClass: 'load-complete', imageEndLazyClass: args.imageEndLazyClass || '.js-end-img-src', notLoadElement: args.notLoadElement || [], loadOption: args.loadOption, visiblePoint: !!!args.visiblePoint ? 0 : args.visiblePoint, resizeStart: null, classes: {loaded: 'loaded',ended: 'ended' }};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {this.initOpts();this.getLazyVideo();this.getResponsiveVideo();this.bindEvents(); } initOpts() {this.getCurrentDevice();const targetindex = this.currentDevice !== 'mobile' ? 0 : 1;this.prevVideoSrc = '';this.targetAttr = this.opts.loadOption[targetindex].attribute;this.responsiveCheck = this.opts.loadOption;this.videoCallStack = []; } getLazyVideo() {let lazyVideoList = Array.from(this.el.querySelectorAll(this.opts.lazyClass)).filter((lazyVideo) => { lazyVideo.isVideoInit = false; for (let i = 0; i < this.opts.notLoadElement.length; i++) {return !lazyVideo.closest(this.opts.notLoadElement[i]); }}); lazyVideoList = lazyVideoList.filter((lazyVideo) => { if (lazyVideo.querySelector('video')) {return lazyVideo; }}); this.lazyVideos = lazyVideoList;this.lazyLength = lazyVideoList.length; } getResponsiveVideo() {let responsiveVideoList = Array.from(this.el.querySelectorAll(this.opts.responsiveClass)).filter((lazyVideo) => { for (let i = 0; i < this.opts.notLoadElement.length; i++) {return !lazyVideo.closest(this.opts.notLoadElement[i]); }});this.responsiveVideos = responsiveVideoList;this.responsiveLength = responsiveVideoList.length; } bindEvents() {window.addEventListener('load', this.onLoadHandler.bind(this));window.addEventListener('scroll', this.lazyEvent.bind(this)); if (this.responsiveCheck) { window.addEventListener('resize', this.onResizeHandler.bind(this));} } getCurrentDevice() {this.winWidth = UTILS.winSize().w;if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile';this.prevDevice = this.currentDevice; } onLoadHandler() {this.getCurrentDevice();this.responsiveHandler();this.lazyEvent(); } onResizeHandler() {clearTimeout(this.opts.resizeStart);this.opts.resizeStart = setTimeout(() => { this.getCurrentDevice(); this.responsiveHandler(); this.lazyEvent();}, 80); } lazyEvent() {this.setLazyVideo(); if (this.lazyLength === this.lazyCompleteLength) { window.removeEventListener('scroll', this.lazyEvent.bind(this));} } responsiveHandler() {this.windowWidth = window.innerWidth;let resolutionLength = this.opts.loadOption.length; for (let i = 0; i < resolutionLength; i++) { let nextIndex = i + 1,nextPoint = nextIndex == resolutionLength ? 0 : this.opts.loadOption[nextIndex].resolution,checkPoint = false; if (i == 0) {checkPoint = this.windowWidth > nextPoint; } else {checkPoint = this.windowWidth <= this.opts.loadOption[i].resolution && this.windowWidth > nextPoint; } if (checkPoint) {if (this.opts.loadOption[i].attribute !== this.oldAttr) { this.targetAttr = this.opts.loadOption[i].attribute; this.oldAttr = this.targetAttr; this.attrIndex = i; this.setResponsiveVideo();} }} } setResponsiveVideo() {for (let i = 0; i < this.responsiveLength; i++) { const videoElement = this.responsiveVideos[i]; const video = videoElement.querySelector('video'); const videoSrc = videoElement.getAttribute(this.targetAttr); if (videoElement.classList.contains(this.classes.loaded) && videoElement.isVideoInit) {video.querySelectorAll('source').forEach((source) => { const type = source.getAttribute('type'); if (type.indexOf('webm') > -1) source.src = videoSrc + '.webm'; if (type.indexOf('mp4') > -1) source.src = videoSrc + '.mp4'; video.load(); video.addEventListener('canplaythrough', () => {window.setTimeout(() => { videoElement.classList.add(this.classes.loaded);}, 500);this.checkCompleteVideo();this.getEndImage(videoElement); }, { once: true })}); }} } setLazyVideo() {for (let i = 0; i < this.lazyLength; i++) { const winOffsetTop = window.pageYOffset; const winOffsetBottom = winOffsetTop + window.innerHeight; const targetElement = this.lazyVideos[i]; const targetRect = targetElement.getBoundingClientRect(); const targetOffsetTop = winOffsetTop + targetRect.top; const targetOffsetBottom = winOffsetTop + targetRect.bottom; if (winOffsetBottom > targetOffsetTop - (window.innerHeight * (window.pageYOffset != 0 ? this.opts.visiblePoint : 0)) &&winOffsetTop < targetOffsetBottom + (window.innerHeight * (window.pageYOffset != 0 ? this.opts.visiblePoint : 0)) && !targetElement.isVideoInit) {// this.setVideoControl();// if (!UTILS.isLowNetwork()) {if (this.videoCallStack.indexOf(i) < 0) { this.videoCallStack.push(i); this.setVideoSrc();}// } }} } setVideoSrc() {const targetIndex = this.videoCallStack[0];const videoElement = this.lazyVideos[targetIndex];const video = videoElement.querySelector('video');const videoSrc = videoElement.getAttribute(this.targetAttr);const lazyClass = this.opts.lazyClass.split('.');const removeClass = lazyClass[lazyClass.length - 1];const currentVideoSrc = videoSrc; // console.log(this.videoCallStack);// console.log(videoElement, this.videoCallStack.length)if (this.prevVideoSrc !== currentVideoSrc) { // console.log(this.videoCallStack, videoElement, this.targetAttr) video.querySelectorAll('source').forEach((source) => {const type = source.getAttribute('type');if (type.indexOf('webm') > -1) source.src = videoSrc + '.webm';if (type.indexOf('mp4') > -1) source.src = videoSrc + '.mp4'; }); video.load(); video.addEventListener('canplaythrough', () => {window.setTimeout(() => { videoElement.classList.add(this.classes.loaded); // videoElement.classList.remove(this.classes.ended);}, 500);if (this.opts.lazyClass.split(' ').length == 1) videoElement.classList.remove(removeClass);this.checkCompleteVideo();this.getEndImage(videoElement);this.videoCallStack.splice(0, 1);if (this.videoCallStack.length > 0) { this.setVideoSrc();} }, { once: true }); videoElement.isVideoInit = true;}this.prevVideoSrc = currentVideoSrc; } getEndImage(videoElement) {const targetAttr = this.currentDevice === 'desktop' ? 'data-src-pc' : this.currentDevice === 'tablet' ? 'data-src-tablet' : 'data-src-mobile';const endImage = videoElement.querySelector(this.opts.imageEndLazyClass);const lazyClass = this.opts.imageEndLazyClass.split('.');const removeClass = lazyClass[lazyClass.length - 1]; if (endImage && !endImage.classList.contains(this.opts.imageLazyCompleteClass)) { endImage.src = endImage.getAttribute(targetAttr); endImage.addEventListener('load', () => {if (this.opts.imageEndLazyClass.split(' ').length == 1) endImage.classList.remove(removeClass);endImage.classList.add(this.opts.imageLazyCompleteClass); }, { once: true })} } checkCompleteVideo() {let lazyCompleteList = Array.from(this.el.querySelectorAll('.' + this.classes.loaded)).filter((lazyVideo) => { for (let i = 0; i < this.opts.notLoadElement.length; i++) {return !lazyVideo.closest(this.opts.notLoadElement[i]); }});this.lazyCompleteLength = lazyCompleteList.length; }} WATCH6.VideoLoader = VideoLoader; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class VideoPlayer { constructor(el, args) {const defParams = { sectionElement: args.sectionElement, videoParentElement: null, videoElement: el, videoController: '.video__controller', hiddenElement: '.blind', endImage: '.video__end-frame img', videoLazyClass: '.js-video-src', lazyCompleteClass: 'load-complete', imageEndLazyClass: '.js-end-img-src', visiblePoint: args.visiblePoint ? args.visiblePoint : 0, classes: {loaded: 'loaded',ended: 'ended',paused: 'paused',playing: 'playing',isPaused: 'is-paused' }, resizeStart: null, on: {updateController: null,updatePlayState: null }};this.opts = UTILS.def(defParams, args || {});this.classes = defParams.classes;this.init(); } init() {this.setElements();this.initOpts();if (this.video !== null) { if (!this.video.paused) {this.video.pause(); } this.videoElement.playState = false; this.updateController(); this.bindEvents();} } setElements() {this.videoElement = this.opts.videoElement;this.video = this.videoElement.querySelector('video'); if (this.video === null) return; if (this.opts.videoParentElement !== null) { this.videoParentElement = this.video.closest(this.opts.videoParentElement);} else { this.videoParentElement = this.videoElement;} this.videoController = this.videoParentElement.querySelector(this.opts.videoController); // if (this.videoController) {// this.videoControllerText = this.videoController.querySelector(this.opts.hiddenElement);// } } initOpts() {this.getCurrentDevice();this.autoPlay = this.videoElement.dataset.autoPlay ? JSON.parse(this.videoElement.dataset.autoPlay) : false;this.videoElement.playState = false;this.videoElement.autoPlayState = false;this.useController = this.videoController ? true : false;// if (this.useController) {// this.globalText = JSON.parse(this.videoController.dataset.globalText);// } } getCurrentDevice() {this.winWidth = UTILS.winSize().w;if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile';this.prevDevice = this.currentDevice; } getEndImage() {const targetAttr = this.currentDevice === 'desktop' ? 'data-src-pc' : this.currentDevice === 'tablet' ? 'data-src-tablet' : 'data-src-mobile';const endImage = this.videoElement.querySelector(this.opts.imageEndLazyClass);const lazyClass = this.opts.imageEndLazyClass.split('.');const removeClass = lazyClass[lazyClass.length - 1]; if (endImage) { endImage.src = endImage.getAttribute(targetAttr); endImage.addEventListener('load', () => {if (this.opts.imageEndLazyClass.split(' ').length == 1) endImage.classList.remove(removeClass);endImage.classList.add(this.opts.lazyCompleteClass); }, { once: true })} } bindEvents() {window.addEventListener('resize', this.onResizeHandler.bind(this));window.addEventListener('scroll', this.onScrollHandler.bind(this));this.video.addEventListener('canplaythrough', this.onCanplayThrough.bind(this), { once: true });if (this.useController) { this.videoController.addEventListener('click', this.onClickController.bind(this));} } onChange(videoElement) {if (videoElement === this.videoElement) { const targetAttr = this.currentDevice !== 'mobile' ? 'data-media-pc' : 'data-media-mo'; const videoSrc = this.videoElement.getAttribute(targetAttr); const currentVideoSrc = videoSrc; if (this.prevVideoSrc !== currentVideoSrc) {this.videoElement.playState = false;this.video.querySelectorAll('source').forEach((source) => { const type = source.getAttribute('type'); if (type.indexOf('webm') > -1) source.src = videoSrc + '.webm'; if (type.indexOf('mp4') > -1) source.src = videoSrc + '.mp4'; this.video.load();}); this.videoElement.classList.remove(this.classes.playing);this.videoElement.classList.remove(this.classes.paused); this.video.addEventListener( 'canplaythrough', () => {if (!UTILS.isLowNetwork()) { this.onPlay();}this.getEndImage(); }, { once: true }); } this.prevVideoSrc = currentVideoSrc;} } onLoad(videoElement) {if (videoElement === this.videoElement) { const targetAttr = this.currentDevice !== 'mobile' ? 'data-media-pc' : 'data-media-mo'; const videoSrc = this.videoElement.getAttribute(targetAttr); this.videoElement.playState = false; this.video.querySelectorAll('source').forEach((source) => {const type = source.getAttribute('type');if (type.indexOf('webm') > -1) source.src = videoSrc + '.webm';if (type.indexOf('mp4') > -1) source.src = videoSrc + '.mp4';this.video.load(); }); this.video.addEventListener('canplaythrough', () => { if (!UTILS.isLowNetwork()) {this.onPlay(); } this.getEndImage();}, { once: true });} } onPlay(videoElement) {const playFunc = () => { if (this.video.readyState > 0 && !this.videoElement.playState) {if (this.video.currentTime === this.video.duration) { this.video.currentTime = 0;}if (this.autoPlay) this.videoElement.autoPlayState = true;this.videoElement.playState = true; if (this.videoElement.classList.contains(this.classes.paused)) { this.videoElement.classList.add(this.classes.playing);} else { window.setTimeout(() => {this.videoElement.classList.add(this.classes.playing); }, 350);}this.videoElement.classList.remove(this.classes.ended);this.videoElement.classList.remove(this.classes.paused); window.setTimeout(() => { this.video.play(); this.updateController(); this.outCallback('updatePlayState', true);}, 350);this.video.addEventListener('ended', this.updatePlayEnded.bind(this), { once: true }); }} if (videoElement) { if (videoElement === this.videoElement) {playFunc(); }} else { playFunc();} } onPause() {if (!this.video.paused) { this.video.pause();}this.videoElement.playState = false;this.videoElement.classList.remove(this.classes.ended);this.videoElement.classList.remove(this.classes.playing);this.videoElement.classList.add(this.classes.paused);this.updateController(); } onEnded() {if (this.video.readyState > 3) { if (!this.video.ended) {this.video.pause(); } this.video.currentTime = this.video.duration; this.videoElement.playState = false; this.videoElement.classList.add(this.classes.ended); this.videoElement.classList.remove(this.classes.playing); this.videoElement.classList.remove(this.classes.paused); this.updateController();} } onReset(videoElement) {const resetFunc = () => { this.video.pause(); this.video.currentTime = 0; this.videoElement.playState = false; if (this.autoPlay) this.videoElement.autoPlayState = false; this.videoElement.classList.remove(this.classes.ended); this.videoElement.classList.remove(this.classes.playing); this.videoElement.classList.remove(this.classes.paused); this.updateController();} if (videoElement) { if (videoElement === this.videoElement) {resetFunc(); }} else { resetFunc();} } onCanplayThrough() {const videoLazyClass = this.opts.videoLazyClass.split('.');const removeClass = videoLazyClass[videoLazyClass.length - 1]; if (this.useController) { window.setTimeout(() => {this.videoController.style.display = 'block'; }, 500);}this.videoElement.classList.add(this.classes.loaded);// this.videoElement.classList.add(this.classes.paused);if (this.opts.videoLazyClass.split(' ').length == 1) this.videoElement.classList.remove(removeClass);this.isCanplay = true;this.onScrollHandler();this.isCanplay = false; } onClickController(e) {e.preventDefault(); if (!this.videoElement.playState) { this.onPlay();} else { this.onPause();} } updatePlayEnded() {this.onPause(); } updateController() {if (!this.useController) return; if (!this.videoElement.playState) { // this.videoControllerText.innerText = this.globalText.play; this.videoController.classList.remove(this.classes.isPaused);} else { // this.videoControllerText.innerText = this.globalText.stop; this.videoController.classList.add(this.classes.isPaused);} const data = { el: this.videoController, playState: this.videoElement.playState} this.outCallback('updateController', data); } onScrollHandler() {if (this.videoElement.closest('.cm-layer')) return;const scrollY = window.scrollY;const direction = scrollY > this.lastScrollY ? 'down' : 'up';const targetHeight = UTILS.getHeight(this.videoElement);const windowHeight = UTILS.winSize().h;// const visiblePoint = targetHeight > windowHeight ? this.opts.visiblePoint : 0;// const visibleOffset = targetHeight * visiblePoint;const visibleOffset = targetHeight * 0.5;const scrollTop = UTILS.getScroll().top;const scrollBottom = UTILS.getScroll().bottom;const targetOffsetTop = UTILS.getOffset(this.videoElement).top;const targetOffsetBottom = UTILS.getOffset(this.videoElement).bottom - visibleOffset; const playState = this.videoElement.classList.contains(this.classes.playing) && this.videoElement.playState;const pausedState = this.videoElement.classList.contains(this.classes.paused) && !this.videoElement.playState;const endedState = this.videoElement.classList.contains(this.classes.ended) && !this.videoElement.playState; if (scrollTop > targetOffsetBottom + visibleOffset) { if (this.autoPlay) {if (this.videoElement.autoPlayState) { if (playState || pausedState) {this.onEnded(); }} else { // NOTE: video load 되기 전 end 이미지가 먼저 노출되어 보여져야할 경우 대응. this.videoElement.classList.add(this.classes.ended);} } // console.log(this.videoElement, 'overview bottom');} else if (scrollBottom < targetOffsetTop) { if (this.autoPlay && this.videoElement.autoPlayState) {if (playState || pausedState || endedState) { // console.log('reset', playState, pausedState); this.onReset();} } // console.log(this.videoElement, 'overview top');} else if (scrollBottom > targetOffsetBottom && scrollTop < targetOffsetTop) { const playState = this.isCanplay || direction === 'down'; if (playState) {// console.log(!this.videoElement.playState, !this.videoElement.autoPlayState)if (this.autoPlay && !this.videoElement.playState && !this.videoElement.autoPlayState) { // console.log('play', direction); if (!UTILS.isLowNetwork()) {this.onPlay(); }} }} this.lastScrollY = scrollY; } onResponsiveChange() {window.setTimeout(() => { this.isCanplay = true; this.onReset(); this.onScrollHandler(); this.isCanplay = false;}, 20) } onResizeHandler() {if (UTILS.winSize().w === this.winWidth) return;this.winWidth = UTILS.winSize().w;if (this.opts.resizeStart == null) { this.opts.resizeStart = this.winWidth; this.resizeAnimateFunc();}window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.setLayout();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.resizeStart = null;UTILS.cancelAFrame.call(window, this.resizeRequestFrame); } setLayout() {if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; if (this.currentDevice !== this.prevDevice) { this.onResponsiveChange();} this.prevDevice = this.currentDevice; } outCallback(ing, param) {var callbackObj = this.opts.on[ing];if (callbackObj == null) return;callbackObj(param); }} WATCH6.VideoPlayer = VideoPlayer; })(); (function () {'use strict'; const initialize = (function () { var self = {}; var currDevice = false,prevDevice = null,currentSup = null; var init = function () {setVariables();bindEvents();setScrollControl(); }; var setVariables = function () {self.resizeTimeout = null;self.supClicker = document.querySelectorAll('a.click_sup');self.supTopBtn = document.querySelectorAll('button.click_disclaimer');self.contents = document.getElementById('contents') || document.getElementById('content');self.allClickables = self.contents.querySelectorAll('a, button, input, select'); }; var bindEvents = function () {var i = 0;window.addEventListener('load', onLoadHandler);window.addEventListener('resize', onResizeHandler);window.addEventListener('scroll', onScrollHandler);for (i = 0; i < self.allClickables.length; i++) { var clickable = self.allClickables[i]; clickable.isClicked = false; clickable.isVisible = false; clickable.addEventListener('focusin', centeredFocus); clickable.addEventListener('mousedown', checkClick);} for (i = 0; i < self.supClicker.length; i++) { self.supClicker[i].addEventListener('click', onClickSup);}for (i = 0; i < self.supTopBtn.length; i++) { self.supTopBtn[i].addEventListener('click', onClickSupTopBtn);} }; var onLoadHandler = function () {onResizeHandler();onScrollHandler();if (UTILS.isLowNetwork()) { document.documentElement.classList.add('low_network');}document.documentElement.classList.add('load');window.removeEventListener('load', onLoadHandler); }; var onResizeHandler = function () {if (window.innerWidth >= 1024) currDevice = 'desktop';else if (window.innerWidth >= 768 && window.innerWidth < 1024) currDevice = 'tablet';else currDevice = 'mobile'; clearTimeout(self.resizeTimeout);self.resizeTimeout = setTimeout(function () { UTILS.isBrokenFixed();}, 100); if (currDevice != prevDevice) { document.documentElement.classList.add(currDevice); document.documentElement.classList.remove(prevDevice); prevDevice = currDevice;} }; var onScrollHandler = function () {var winOffsetTop = window.pageYOffset;var winOffsetBottom = winOffsetTop + window.innerHeight; for (var i = 0; i < self.allClickables.length; i++) { var clickable = self.allClickables[i]; var clickablePos = winOffsetTop + clickable.getBoundingClientRect().top; var winVisibleTop = winOffsetTop + UTILS.getNavHeight(); if (clickablePos >= winVisibleTop && clickablePos <= winOffsetBottom) {clickable.isVisible = true; } else if (clickablePos < winVisibleTop || clickablePos > winOffsetBottom) {clickable.isVisible = false; }} }; var onClickSup = function (e) {e.preventDefault();e.stopPropagation(); var _this = this;var destIndex = parseFloat(this.innerText);var disclaimerList = document.querySelectorAll('#desc-section ol');disclaimerList.forEach((el) => { if (window.getComputedStyle(el).display === 'block') {disclaimerList = el; }});var disclaimerItems = disclaimerList.querySelectorAll('li');var disclaimerItem = disclaimerList.querySelectorAll('li')[destIndex - 1];var disclaimer = disclaimerItem.querySelector('span');var disclaimerText = disclaimer.innerHTML;var activeBlock = '' + disclaimerText + '';disclaimer.innerHTML = activeBlock;currentSup = e.currentTarget; var focusInEvent = function () { centeredFocus.call(_this); disclaimer.removeEventListener('focusin', focusInEvent);}; var focusOutEvent = function () { disclaimer.innerHTML = disclaimerText; disclaimer.removeAttribute('tabindex'); disclaimer.removeEventListener('focusout', focusOutEvent);}; if (e.currentTarget.closest('.cm-layer')) { const targetLayer = e.currentTarget.closest('.cm-layer'); $(targetLayer).trigger('closeLayer', false);} disclaimer.addEventListener('focusin', focusInEvent);disclaimer.addEventListener('focusout', focusOutEvent);setTimeout(() => { disclaimerItem.querySelector('a').focus();}, 0); disclaimerItems.forEach(el => el.classList.remove('is-active'));disclaimerItem.classList.add('is-active'); }; var onClickSupTopBtn = function (e) {var disclaimer = e.target.closest('li');var supNum = disclaimer.getAttribute('data-sup');var supList = document.querySelectorAll('.click_sup'); for (let i = 0; i < supList.length; i++) { if (supList[i].innerText === supNum) {centeredFocus.call(this);currentSup.focus(); }} const curSupLayer = currentSup.closest('.cm-layer'); if (!!curSupLayer) { const supLayerId = curSupLayer.id; const layerParent = curSupLayer.parentNode; const targetButton = layerParent.querySelector(`[data-layer-target="#${supLayerId}"]`); if (currentSup.innerText === supNum) {targetButton.focus(); };}; disclaimer.classList.remove('is-active'); }; var centeredFocus = function (e) {if (!document.documentElement.classList.contains('ios') && e && e.relatedTarget == null) return;var _this = this;if (!this.isClicked && !this.isVisible && !isSubNav(this)) { setTimeout(function () {var winOffsetTop = window.pageYOffset;var targetRect = _this.getBoundingClientRect();var winHeight = (window.innerHeight - UTILS.getNavHeight()) / 2;var targetOffsetMid = winOffsetTop - UTILS.getNavHeight() + targetRect.top + targetRect.height / 2; window.scrollTo(0, targetOffsetMid - winHeight); }, 10);}this.isClicked = false; }; var isSubNav = function (element) {var parent = element.parentNode;var parentId = parent.getAttribute('id');if (parentId == 'contents' || parent == document.body) { return false;} else { if (parentId == 'subnav' || parent.classList.contains('sc-s22ultra-popup')) {return true; } else {return isSubNav(parent); }} }; var checkClick = function () {this.isClicked = true; }; var setScrollControl = function () {var docClass = document.documentElement.classList;if (UTILS.checkRegion() != 'global' && !docClass.contains('mac') && !docClass.contains('safari')) { ANIUTIL.scrollController({speed: 120,duration: 0.5 });} }; return {init: init };})(); window.initialize = initialize; })(); (function (global, factory) {global = global;global.TrapFocus = factory(); })(window, function () {'use strict';var TrapFocus = (function (isUndefined) { var win = window,doc = win.document,$ = win.jQuery,hasTrap = null,Util = win.WATCH6.UTILS; function TrapFocus(container, args) {if (!(this instanceof TrapFocus)) { return new TrapFocus(container, args);}var defParams = { obj: container, prevStep: null, isDestroy: false, IgnoreUtilFocusChanges: false, ariaAttr: {hidden: 'aria-hidden',disabled: 'aria-disabled',modal: 'aria-modal' }, ariaNotHidden: (() => {return args && args.ariaNotHidden ? args.ariaNotHidden : []; })(), classAttr: {clone: 'trapfocus' }, elAttr: {tabIndex: 'tabindex',role: 'role' }, customEvent: '.TrapFocus' + new Date().getTime() + Math.random()};this.opts = Util.def(defParams, args || {});if (!(this.obj = $(this.opts.obj)).length) return;if (hasTrap != null) { hasTrap.destroy();}hasTrap = this;this.init(); } TrapFocus.prototype = {init: function () { this.initLayout(); this.buildAria(); this.bindEvents(true); this.loadComponent(); this.obj.data('TrapFocus', this);},initLayout: function () { var ariaAttr = this.opts.ariaAttr; var elAttr = this.opts.elAttr; this.obj.attr(ariaAttr.modal, 'true'); this.obj.attr(elAttr.role, 'dialog');},buildAria: function () { var ariaAttr = this.opts.ariaAttr; var elAttr = this.opts.elAttr; var defaultNotHidden = 'head, script, noscript, link, style, meta'; var hiddenParam = this.opts.ariaNotHidden.length > 0 ? `, ${this.opts.ariaNotHidden.join(',')}` : ''; Util.def(this, {aria: { notHidden: Array(defaultNotHidden + hiddenParam), focusType: ['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'], dataAttr: {ariaHidden: 'trapfocusariahidden',ariaDisabled: 'trapfocusariadisabled',tabIndex: 'trapfocustabindex',role: 'trapfocusrole' }, destroy: $.proxy(function () {var dataAttr = this.aria.dataAttr;var hiddenEls = this.aria.hiddenEls;var focusEls = this.aria.focusEls;var tabindexEls = this.aria.tabindexEls; // aria-hiddenfor (var hMin = 0, hMax = hiddenEls.length; hMin < hMax; hMin++) { (function (h_index) {var hiddenEl = hiddenEls.eq(h_index), ariaCondition = hiddenEl.data(dataAttr.ariaHidden), elCondition = hiddenEl.data(dataAttr.role);if (ariaCondition != isUndefined) { hiddenEl.attr(ariaAttr.hidden, ariaCondition); hiddenEl.removeData(dataAttr.ariaHidden);} else { hiddenEl.removeAttr(ariaAttr.hidden);}if (elCondition != isUndefined) { hiddenEl.attr(elAttr.role, elCondition); hiddenEl.removeData(dataAttr.role);} else { hiddenEl.removeAttr(elAttr.role);} })(hMin);} // aria-disabledfor (var fMin = 0, fMax = focusEls.length; fMin < fMax; fMin++) { (function (f_index) {var focusEl = focusEls.eq(f_index), ariaCondition = focusEl.data(dataAttr.ariaDisabled);focusEl.removeAttr(elAttr.tabIndex);if (ariaCondition != isUndefined) { focusEl.attr(ariaAttr.disabled, ariaCondition); focusEl.removeData(dataAttr.ariaDisabled);} else { focusEl.removeAttr(ariaAttr.disabled);} })(fMin);} // tabindexfor (var tMin = 0, tMax = tabindexEls.length; tMin < tMax; tMin++) { (function (t_index) {var tabindexEl = tabindexEls.eq(t_index), ariaCondition = tabindexEl.data(dataAttr.tabIndex);if (ariaCondition != isUndefined) { tabindexEl.attr(elAttr.tabIndex, ariaCondition); tabindexEl.removeData(dataAttr.tabIndex);} else { tabindexEl.removeAttr(elAttr.tabIndex);} })(tMin);} var cookieBtnWrap = document.getElementById('teconsent');if (cookieBtnWrap) { var cookieBtn = cookieBtnWrap.querySelector('a'); if (cookieBtn && cookieBtn.getAttribute('tabindex') === '-1') {cookieBtn.setAttribute('tabindex', '0');cookieBtn.removeAttribute('aria-disabled'); }} }, this), build: $.proxy(function () {var _this = this;var focusTypes = this.aria.focusType;var dataAttr = this.aria.dataAttr;var objParents = this.obj.parents();var hiddenEls = this.obj.siblings().not(_this.aria.notHidden.join(','));var focusEls = $('

');var tabindexEls = $(''); // this.entryFocus(); for (var i = 0, max = objParents.length; i < max; i++) { (function (index) {var _target = objParents.eq(index);hiddenEls = hiddenEls.add(_target.siblings().not(_this.aria.notHidden.join(','))); })(i);}focusEls = focusEls.add(hiddenEls);tabindexEls = tabindexEls.add(hiddenEls);this.obj.removeAttr(ariaAttr.hidden); // aria-hiddenfor (var hMin = 0, hMax = hiddenEls.length; hMin < hMax; hMin++) { (function (h_index) {var hiddenEl = hiddenEls.eq(h_index), ariaCondition = hiddenEl.attr(ariaAttr.hidden), elCondition = hiddenEl.attr(elAttr.role);if (ariaCondition != isUndefined) { hiddenEl.data(dataAttr.ariaHidden, ariaCondition);}if (elCondition != isUndefined) { hiddenEl.data(dataAttr.role, elCondition);}hiddenEl.attr(ariaAttr.hidden, 'true');hiddenEl.attr(elAttr.role, 'none presentation'); })(hMin);} // aria-disabledfocusEls = focusEls.add(hiddenEls.find(focusTypes.join(',').toLowerCase()));for (var fMin = 0, fMax = focusEls.length; fMin < fMax; fMin++) { (function (f_index) {var focusEl = focusEls.eq(f_index), ariaCondition = focusEl.attr(ariaAttr.disabled);if (ariaCondition != isUndefined) { focusEl.data(dataAttr.ariaDisabled, ariaCondition);}focusEl.attr(ariaAttr.disabled, 'true');setTimeout(() => { focusEl.attr(elAttr.tabIndex, -1);}); })(fMin);} // tabindextabindexEls = tabindexEls.add(hiddenEls.find('[' + elAttr.tabIndex + ']'));for (var tMin = 0, tMax = tabindexEls.length; tMin < tMax; tMin++) { (function (t_index) {var tabindexEl = tabindexEls.eq(t_index), ariaCondition = tabindexEl.attr(elAttr.tabIndex);if (ariaCondition != isUndefined) { tabindexEl.data(dataAttr.tabIndex, ariaCondition);}tabindexEl.attr(elAttr.tabIndex, -1); })(tMin);} this.aria.hiddenEls = hiddenEls;this.aria.focusEls = focusEls;this.aria.tabindexEls = tabindexEls; }, this)} });},changeEvents: function (event) { var events = [],eventNames = event.split(' '); for (var key in eventNames) {events.push(eventNames[key] + this.opts.customEvent); } return events.join(' ');},bindEvents: function (type) { if (type) {$(doc).on(this.changeEvents('focusin'), $.proxy(this.trapFocus, this)); } else {$(doc).off(this.changeEvents('focusin')); }},focusFirstDescendant: function (element) { for (var i = 0; i < element.childNodes.length; i++) {var child = element.childNodes[i];if (this.attemptFocus(child) || this.focusFirstDescendant(child)) { return true;} } return false;},focusLastDescendant: function (element) { for (var i = element.childNodes.length - 1; i >= 0; i--) {var child = element.childNodes[i];if (this.attemptFocus(child) || this.focusLastDescendant(child)) { return true;} } return false;},isFocusable: function (element) { if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {return true; } if (element.disabled) {return false; } switch (element.nodeName) {case 'A': return !!element.href && element.rel != 'ignore';case 'INPUT': return element.type != 'hidden' && element.type != 'file';case 'BUTTON':case 'SELECT':case 'TEXTAREA':case 'VIDEO':case 'SOURCE':case 'IFRAME': return true;default: return false; }},attemptFocus: function (element) { if (this.opts.isDestroy) return; if (!this.isFocusable(element)) {return false; } this.opts.IgnoreUtilFocusChanges = true; try {element.focus(); } catch (e) { } this.opts.IgnoreUtilFocusChanges = false; return document.activeElement === element;},trapFocus: function (e) { if (this.opts.isDestroy) return; if (this.opts.IgnoreUtilFocusChanges) {return; } var currentDialog = document; this.dynamicComponentFocus();},loadComponent: function () { this.dynamicComponentFocus(); // 늦게 붙는 경우 추가 대응 setTimeout(() => {this.dynamicComponentFocus(); }, 3000); this.focusFirstDescendant(this.obj[0]); this.lastFocus = document.activeElement; this.aria.build();},// [WAQA]: 다이나믹 컴포넌트 trapfocus 대응 직진 코드임...dynamicComponentFocus: function () { const ariaAttr = this.opts.ariaAttr; const elAttr = this.opts.elAttr; // [WAQA]: 다이나믹 컴포넌트 대응 직진 코드임... // [WAQA]: 국가별로 feedback 컴포넌트 타입이 다름. // - UK만 QSIFeedbackButton-btn 사용하는것으로 보여짐. // 시간차 노출 대응. setTimeout(() => {var feedbackbtn = document.getElementById('QSIFeedbackButton-btn');var feedbackclosebtn = document.getElementById('QSIFeedbackButton-close-btn');var feedbackbtn2 = document.getElementById('nebula_div_btn');var liveChatWrap = document.getElementById('spr-live-chat-app');var cookieBtnWrap = document.getElementById('teconsent'); if (feedbackbtn) { var feedbackbtnWrap = feedbackbtn.parentElement; feedbackbtn.setAttribute(ariaAttr.disabled, 'true'); feedbackbtn.setAttribute(elAttr.tabIndex, '-1'); feedbackbtnWrap.setAttribute(ariaAttr.disabled, 'true'); feedbackbtnWrap.setAttribute(ariaAttr.hidden, 'true'); feedbackbtnWrap.setAttribute(elAttr.tabIndex, '-1'); feedbackbtnWrap.setAttribute(elAttr.role, 'none presentation');}if (feedbackbtn2) { var feedbackbtnWrap2 = feedbackbtn2.parentElement; feedbackbtn2.setAttribute(ariaAttr.disabled, 'true'); feedbackbtn2.setAttribute(elAttr.tabIndex, '0'); feedbackbtnWrap2.setAttribute(ariaAttr.disabled, 'true'); feedbackbtnWrap2.setAttribute(ariaAttr.hidden, 'true'); feedbackbtnWrap2.setAttribute(elAttr.tabIndex, '-1'); feedbackbtnWrap2.setAttribute(elAttr.role, 'none presentation');}if (liveChatWrap) { liveChatWrap.setAttribute(ariaAttr.disabled, 'true'); liveChatWrap.setAttribute(ariaAttr.hidden, 'true'); liveChatWrap.setAttribute(elAttr.tabIndex, '-1'); liveChatWrap.setAttribute(elAttr.role, 'none presentation');} // cookie preferencesif (cookieBtnWrap && cookieBtnWrap.hasAttribute('aria-label')) { setTimeout(() => {var cookieBtn = cookieBtnWrap.querySelector('a');cookieBtn.setAttribute(elAttr.tabIndex, '-1');cookieBtn.setAttribute(ariaAttr.disabled, 'true');cookieBtn.setAttribute(ariaAttr.hidden, 'true'); });} }); // // 늦게 붙는 경우 대응 // setTimeout(() => { // var cookieBtnWrap = document.getElementById('teconsent'); // if (cookieBtnWrap && cookieBtnWrap.hasAttribute('aria-label')) { // setTimeout(() => { // var cookieBtn = cookieBtnWrap.querySelector('a'); // cookieBtn.setAttribute(elAttr.tabIndex, '-1'); // cookieBtn.setAttribute(ariaAttr.disabled, 'true'); // cookieBtn.setAttribute(ariaAttr.hidden, 'true'); // }); // } // }, 2500);},destroy: function () { hasTrap = null; this.opts.isDestroy = true; var ariaAttr = this.opts.ariaAttr; var elAttr = this.opts.elAttr; this.bindEvents(false); this.aria.destroy(); this.obj.removeAttr(ariaAttr.modal);} }; return TrapFocus;})();return TrapFocus; }); (function () {'use strict'; window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE;class HeightMatch { constructor(el = container, args) {const defParams = { container: el || '.heightmatch-wrap', childElement: '>li', notCompareElement: null, pushElement: null, matchElement: '.heightmatch-cont', column: 3, pushObjs: null, useDestroyHeight: true, destroyType: false, resizeStart: null, breakpoints: {}, matchBefore: null, matchAfter: null, loadAfter: null};this.opts = UTILS.def(defParams, args || {});this.classes = defParams.classes;this.obj = $(document.querySelector(el));this.init(); } init() {if (this.obj === null) return;this.setElements();this.setOpts();this.setRows();this.buildHeightControl();this.outCallback('loadAfter');this.bindEvents(); } setElements() {this.objChild = this.obj.find(this.opts.childElement);this.opts.pushObjs = null;if (this.opts.pushElement == null) { this.opts.pushObjs = this.objChild.not(this.opts.notCompareElement);} else { this.opts.pushObjs = this.objChild.not(this.opts.notCompareElement).find(this.opts.pushElement);} } setOpts() {this.currentDevice = false;this.prevDevice = null; var winWidth = UTILS.winSize().w;// breakpointsvar breakpoints = this.opts.breakpoints, breakKeyMins = [], breakKeyMin;for (var key in breakpoints) { if (key >= winWidth) {breakKeyMins.push(key);breakKeyMin = Math.min.apply(null, breakKeyMins); } else {breakKeyMin = null; }}this.breakOpts = UTILS.def({}, this.opts);if (breakKeyMin != null) { this.breakOpts = UTILS.def(this.breakOpts, breakpoints[breakKeyMin]);} } bindEvents() {window.addEventListener('resize', this.onResizeHandler.bind(this)); } onResizeHandler() {if (UTILS.winSize().w === this.winWidth) return;this.winWidth = UTILS.winSize().w;if (this.opts.resizeStart == null) { this.opts.resizeStart = this.winWidth; this.outCallback('matchBefore'); this.resizeAnimateFunc();}window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.setLayout();this.setOpts();this.setRows();this.buildHeightControl();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.resizeStart = null;this.setOpts();this.setRows();this.buildHeightControl();this.outCallback('matchAfter');UTILS.cancelAFrame.call(window, this.resizeRequestFrame); } setLayout() {if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; if (this.currentDevice !== this.prevDevice) { // this.onResponsiveChange();} this.prevDevice = this.currentDevice; } setRows() {this.rowNum = Math.ceil(this.objChild.length / this.breakOpts.column); } buildHeightControl() {// if (UTILS.isSupportTransform) {if (this.breakOpts.column <= 1) { if (this.opts.pushObjs !== null) {this.opts.pushObjs.css('height', ''); }} else { this.buildHeight();}// } else {// this.buildHeight();// } } buildHeight() {this.heightArray = [];for (var i = 0; i < this.rowNum; i++) { this.heightArray[i] = [];}for (var i = 0, max = this.objChild.length; i < max; i++) { var arrayIndex = parseInt(i / this.breakOpts.column, 10),matchElement = this.objChild.eq(i).not(this.opts.notCompareElement).find(this.opts.matchElement),condition = matchElement.is(':visible'),maxHeight = condition ? Math.ceil(matchElement.outerHeight()) : 0; this.heightArray[arrayIndex].push(maxHeight);}for (var i = 0; i < this.rowNum; i++) { this.heightArray[i] = Math.max.apply(null, this.heightArray[i]);}this.setHeightLayout(); } setHeightLayout() {for (var i = 0, max = this.objChild.length; i < max; i++) { var arrayIndex = parseInt(i / this.breakOpts.column, 10); if (this.opts.pushElement == null) {this.objChild.eq(i).not(this.opts.notCompareElement).height(this.heightArray[arrayIndex]); } else {this.objChild.eq(i).not(this.opts.notCompareElement).find(this.opts.pushElement).height(this.heightArray[arrayIndex]); }} } destroy() {if (this.opts.useDestroyHeight) { if (this.opts.pushObjs !== null) {this.opts.pushObjs.css('height', ''); }}this.opts.destroyType = true;this.bindEvents(false); } reInit() {this.setElements();this.setOpts();this.setRows();this.buildHeightControl();this.onResizeHandler();if (this.opts.destroyType) { this.opts.destroyType = false; this.bindEvents(true);} } outCallback(ing) {var callbackObj = this.opts[ing];if (callbackObj == null) return;callbackObj(); }} WATCH6.HeightMatch = HeightMatch; })(); (function (global, factory) {global = global;global.HiveLayer = factory(); })(window, function () {'use strict';var HiveLayer = (function () { var win = window,$ = win.jQuery,doc = win.document,Util = win.WATCH6.UTILS,hasLayer = []; function HiveLayer(container, args) {if (!(this instanceof HiveLayer)) { return new HiveLayer(container, args);}var defParams = { effect: 'fade', // Could be 'default', 'fade', 'slide', 'flip', 'slide2' layerWrapElements: container, layerBody: '.cm-layer__body', layerElements: '.cm-layer__wrapper', openerElements: '.js-layer-opener', closerElements: '.js-layer-closer', dimmedElements: '.cm-layer__dimmed', classAttr: {htmlToggle: 'is-layer-open',isAsync: 'is-async' }, focusOutObj: {CSS: { overflow: 'hidden', position: 'absolute', left: 0, top: 0, 'z-index': -1, width: 1, height: 1, 'font-size': '1px', 'line-height': 0} }, customEvent: '.HiveLayer' + new Date().getTime() + Math.random(), openerTarget: null, useOutside: false, useEscape: true, useCloseFocus: true, useScrollLock: true, useTrapFocus: true, flip: {CLASS: 'hive-layer-flip',direction: 'horizontal', // Could be 'horizontal', 'vertical'rotateStart: 90,rotateEnd: 0 }, customToggle: false, dimmedDuration: 250, fps: 120, easing: 'swing', duration: 250, on: {buildTools: null,layerMove: null,layerOpenBefore: null,layerOpenAfter: null,layerCloseBefore: null,layerCloseAfter: null }, ariaNotHidden: []};if (!(this.layerWrap = defParams.layerWrapElements).length) return;this.layerWrap = $(defParams.layerWrapElements);// this.opts = Util.def(defParams, this.layerWrap.data('hivelayer-opts') || args || {});this.opts = Util.def(defParams, args || {});this.init(); } HiveLayer.prototype = {init: function () { this.initOpts(); this.setElements(); this.initLayout(); this.buildTween(); this.buildTrapFocus(); this.bindEvents(true); this.layerWrap.data('HiveLayer', this);},initOpts: function () { this.layerWrapInstance = '#' + this.layerWrap.attr('id'); if (!this.opts.isSupportTransition && this.opts.effect === 'flip') {this.opts.effect = 'default'; } if (this.opts.effect == 'custom') {this.opts.effect = 'default';this.opts.customToggle = true; }},setElements: function () { this.layerBody = this.layerWrap.find(this.opts.layerBody); this.layerObj = this.layerWrap.find(this.opts.layerElements); this.closerObj = this.layerWrap.find(this.opts.closerElements); this.dimmedObj = this.layerWrap.find(this.opts.dimmedElements);},initLayout: function () { if (this.opts.effect === 'slide') {this.dimmedObj.hide();this.layerObj.hide(); } else if (this.opts.effect === 'flip') {var fDirection = this.opts.flip.direction;if (fDirection !== 'vertical') { this.opts.flip.cssD = 'rotateY';} else { this.opts.flip.cssD = 'rotateX';}this.dimmedObj.hide();this.layerObj.hide();this.layerWrap.addClass(this.opts.flip.CLASS); }},buildTween: function () { Util.def(this, {tweens: { instance: [], kill: $.proxy(function () {for (var i = 0, max = this.tweens.instance.length; i < max; i++) { this.tweens.instance[i].kill();}this.tweens.instance = []; }, this)} });},buildTrapFocus: function () { if (!this.opts.useTrapFocus) return; Util.def(this, {trapfocus: { instance: null, destroy: $.proxy(function () {if (this.trapfocus.instance == null) return;this.trapfocus.instance.destroy();this.trapfocus.instance = null; }, this), build: $.proxy(function () {if (this.trapfocus.instance !== null) return;this.trapfocus.instance = new TrapFocus(this.layerObj, { ariaNotHidden: this.opts.ariaNotHidden }); }, this)} });},bindEvents: function (type) { if (type) {$(doc).on('click clickCustom', this.opts.openerElements + '[data-layer-target="' + this.layerWrapInstance + '"]', $.proxy(this.onLayerOpen, this));this.layerWrap.on('openLayer', $.proxy(this.onLayerOpen, this));this.closerObj.on('mousedown click clickCustom', $.proxy(this.onLayerClose, this));// this.dimmedObj.on(this.changeEvents('mousedown click clickCustom'), $.proxy(this.onLayerClose, this));this.layerWrap.on('layerSetOptions', $.proxy(this.setOptions, this));if (this.opts.useEscape) { this.layerObj.on('keydown', $.proxy(this.onEscapeClose, this));} } else {$(doc).off('click clickCustom');this.layerWrap.off('openLayer');this.closerObj.off('mousedown click clickCustom');// this.dimmedObj.off(this.changeEvents('mousedown click clickCustom'));this.layerWrap.off('layerSetOptions');if (this.opts.useEscape) { this.layerObj.off('keydown');} }},bindOutsideEvents: function (type) { if (!this.opts.useOutside) return; if (type) {this.layerObj.on('clickoutside touchendoutside', $.proxy(this.onLayerOutsideFunc, this)); } else {this.layerObj.off('clickoutside touchendoutside'); }},bindCloseEvents: function (type) { if (type) {this.layerWrap.on('closeLayer', $.proxy(this.closeLayer, this)); } else {this.layerWrap.off('closeLayer'); }},setOptions: function (e, data) { Util.def(this.opts, data || {}); if (data.customToggle) {this.opts.effect = 'default'; }},setScrollLock: function (type) { if (!this.opts.useScrollLock) return; if (type) {Util.page.scrollLock.on(); } else {Util.page.scrollLock.off(); } $('html').toggleClass(this.opts.classAttr.htmlToggle, type);},onLayerOpen: function (e) { e.preventDefault(); // this.beforeScroll = window.pageYOffset; setTimeout(() => {this.dimmedObj.on('mousedown click clickCustom', $.proxy(this.onLayerClose, this)); }, 500); if (e.type === 'click' || e.type === 'clickCustom') {this.opts.openerTarget = $(e.currentTarget); } if (e.type === 'click') {if (this.opts.openerTarget.hasClass(this.opts.classAttr.isAsync)) return; } this.layerViewType = 'open'; hasLayer.push({POPUPWRAP: this.layerWrap }); if (document.querySelector('html.load div#header')) {document.querySelector('html.load div#header').style.opacity = 0;document.querySelector('html.load div#header').style.pointerEvents = 'none'; } // [s] 강제 가상 포커스 영역 추가 // var firstFocus = $('').css(this.opts.focusOutObj.CSS); // this.layerObj.prepend(firstFocus); // firstFocus.on('focusout', function () { // firstFocus.remove(); // }); // [e] 강제 가상 포커스 영역 추가 this.setScrollLock(true); this.bindCloseEvents(true); if (this.opts.effect === 'default') {if (!this.opts.customToggle) { this.layerWrap.css({opacity: 0,display: 'block' }); this.outCallback('layerOpenBefore'); this.outCallback('buildTools'); this.layerWrap.css('opacity', ''); this.openAfterBugFunc();} else { this.outCallback('layerOpenBefore');} } else if (this.opts.effect === 'fade') {this.layerWrap.css({ opacity: 0, display: 'block'});this.outCallback('layerOpenBefore');TweenLite.set(this.layerBody, { opacity: 0, scale: 1, overflow: 'hidden' });this.outCallback('buildTools');var step1 = TweenLite.to(this.layerWrap, this.opts.duration / 1000, { opacity: 1, onComplete: $.proxy(function () {var step2 = TweenLite.to(this.layerBody, 0.25, { ease: Expo.easeOut, opacity: 1, scale: 1, onComplete: $.proxy(function () {this.layerBody.css({ overflow: '', transform: ''});this.openAfterBugFunc(); }, this)});this.tweens.instance.push(step2); }, this)});this.tweens.instance.push(step1); } else if (this.opts.effect === 'slide') {var speed = 1;TweenLite.set(this.dimmedObj, { display: 'block', opacity: 0});TweenLite.set(this.layerWrap, { display: 'block'});TweenLite.set(this.layerBody, { overflow: 'hidden'});TweenLite.set(this.layerObj, { display: '', y: -Util.winSize().h});TweenLite.set(this.layerObj, { display: ''});this.outCallback('layerOpenBefore');var step1 = TweenLite.to(this.dimmedObj, speed, { opacity: 0.9});var step2 = TweenLite.to(this.layerObj, speed, { y: 0, onComplete: $.proxy(function () {this.outCallback('buildTools');this.layerBody.css({ overflow: ''});this.layerObj.css({ transform: ''});this.openAfterBugFunc(); }, this)});this.tweens.instance.push(step1);this.tweens.instance.push(step2); } else if (this.opts.effect === 'slide2') {var speed = 0.6;TweenLite.set(this.dimmedObj, { display: 'block', opacity: 0});TweenLite.set(this.layerWrap, { display: 'block'});TweenLite.set(this.layerObj, { display: '', y: Util.winSize().h});TweenLite.set(this.layerObj, { display: ''});this.outCallback('layerOpenBefore');var step1 = TweenLite.to(this.dimmedObj, speed, { opacity: 0.9});var step2 = TweenLite.to(this.layerObj, speed, { y: 0, onComplete: $.proxy(function () {this.outCallback('buildTools');this.layerBody.css({ overflow: ''});this.layerObj.css({ transform: ''});this.openAfterBugFunc(); }, this)});this.tweens.instance.push(step1);this.tweens.instance.push(step2); } else if (this.opts.effect === 'flip') {var moveDistance = this.opts.flip.rotateEnd - this.opts.flip.rotateStart, moveOneStep = (moveDistance / this.opts.duration) * (1000 / this.opts.fps), currentStep = 0;this.opts.flip.moveData = { startDistance: this.opts.flip.rotateStart, endDistance: this.opts.flip.rotateEnd, moveDistance: moveDistance, moveOneStep: moveOneStep, currentStep: currentStep};this.layerWrap.show();this.dimmedObj.fadeIn( this.opts.dimmedDuration, $.proxy(function () {this.outCallback('layerOpenBefore');this.outCallback('buildTools');this.layerObj.show();this.initStep(this.opts.flip.moveData);this.flipFunc(); }, this));win.setTimeout( $.proxy(function () {this.outCallback('buildTools'); }, this), 30); } this.ariaAccessbility(true, this.layerWrap);},initStep: function (data) { this.opts.stepTimeOld = new Date(); this.direction = data.startDistance > data.moveDistance ? 'toNext' : 'toPrev'; this.condition = this.direction === 'toNext' ? data.currentStep > data.moveDistance : data.currentStep < data.moveDistance;},moveStep: function (data) { this.opts.stepTimeNew = new Date(); this.opts.remaining = Math.max(0, this.opts.stepTimeOld - this.opts.stepTimeNew + this.opts.duration); var temp = this.opts.remaining / this.opts.duration || 0,percent = 1 - temp,eased = $.easing[this.opts.easing](percent, this.opts.duration * percent, 0, 1, this.opts.duration); data.currentStep = (data.endDistance - data.startDistance) * eased;},flipFunc: function () { var data = this.opts.flip.moveData; this.moveStep(data); if (this.condition) {win.clearTimeout(this.stepTimeout);this.stepTimeout = win.setTimeout( $.proxy(function () {this.flipFunc(); }, this), 1000 / this.opts.fps);this.condition = this.direction === 'toNext' ? data.currentStep > data.moveDistance : data.currentStep < data.moveDistance;this.outCallback('layerMove', data.currentStep, data); } else {this.opts.remaining = this.opts.duration;if (this.layerViewType === 'close' || !this.layerViewType) { this.closeAfterBugFunc(); this.dimmedObj.fadeOut(this.opts.dimmedDuration,$.proxy(function () { this.layerWrap.hide(); this.layerObj.hide();}, this) );} else { this.openAfterBugFunc();} } var movePosition = data.startDistance + data.currentStep; this.layerObj.css({transform: this.opts.flip.cssD + '(' + movePosition + 'deg)' });},onLayerOpenAfter: function () { // Util.findFocus(this.layerObj); if (this.trapfocus) {this.trapfocus.build(); } this.bindOutsideEvents(true); this.outCallback('layerOpenAfter');},openAfterBugFunc: function () { win.clearTimeout(this.openAfterTimeout); this.openAfterTimeout = win.setTimeout($.proxy(this.onLayerOpenAfter, this), 30);},onLayerClose: function (e) { var _target = $(e.currentTarget); if (e.type === 'mousedown') {if (!Util.isDevice) { e.stopPropagation(); this.opts.useCloseFocus = false;} } else if (e.type === 'click' || e.type === 'clickCustom') {e.preventDefault();if (e.type === 'click') { if (_target.hasClass(this.opts.classAttr.isAsync)) return;}this.layerWrap.trigger('closeLayer');this.dimmedObj.off('mousedown click clickCustom'); }},closeLayer: function () { this.closeType = arguments[1]; this.layerViewType = 'close'; this.outCallback('layerCloseBefore'); this.popupOpenPropsControl(); // if (!hasLayer.length) { this.setScrollLock(false); // } if (this.trapfocus) {this.trapfocus.destroy(); } if (document.querySelector('html.load div#header')) {document.querySelector('html.load div#header').style.opacity = 1;document.querySelector('html.load div#header').style.pointerEvents = 'unset'; } this.ariaAccessbility(false, this.layerWrap); win.clearTimeout(this.closeBeforeTimeout); this.closeBeforeTimeout = win.setTimeout($.proxy(this.closeBeforeBugFunc, this), 30); this.bindOutsideEvents(false);},onEscapeClose: function (e) { var keyCode = e.which || e.keyCode; if (keyCode !== 27) return; this.layerWrap.trigger('closeLayer');},onLayerOutsideFunc: function () { this.layerWrap.trigger('closeLayer');},closeBeforeBugFunc: function () { if (this.opts.effect === 'default') {if (!this.opts.customToggle) { this.layerWrap.stop(true, true).hide();}this.closeAfterBugFunc(); } else if (this.opts.effect === 'fade') {var step1 = TweenLite.to(this.layerBody, this.opts.duration / 1000, { overflow: 'hidden', opacity: 0, scale: 1, onComplete: $.proxy(function () {this.layerBody.css('overflow', '');var step2 = TweenLite.to(this.layerWrap, this.opts.duration / 1000, { opacity: 0, display: 'none', onComplete: $.proxy(this.closeAfterBugFunc, this)});this.tweens.instance.push(step2); }, this)});this.tweens.instance.push(step1); } else if (this.opts.effect === 'slide') {var speed = 1;TweenLite.set(this.layerBody, { overflow: 'hidden'});var step1 = TweenLite.to(this.dimmedObj, speed, { opacity: 0});var step2 = TweenLite.to(this.layerObj, speed, { y: -Util.winSize().h, onComplete: $.proxy(function () {this.closeAfterBugFunc();this.dimmedObj.hide();this.layerWrap.hide();this.layerBody.css('overflow', '');this.layerObj.hide(); }, this)});this.tweens.instance.push(step1);this.tweens.instance.push(step2); } else if (this.opts.effect === 'slide2') {var speed = 0.5;var step1 = TweenLite.to(this.dimmedObj, speed, { opacity: 0});var step2 = TweenLite.to(this.layerObj, speed, { y: Util.winSize().h, onComplete: $.proxy(function () {this.closeAfterBugFunc();this.dimmedObj.hide();this.layerWrap.hide();this.layerBody.css('overflow', '');this.layerObj.hide(); }, this)});this.tweens.instance.push(step1);this.tweens.instance.push(step2); } else if (this.opts.effect === 'flip') {var moveDistance = -this.opts.flip.rotateStart - this.opts.flip.rotateEnd, moveOneStep = (moveDistance / this.opts.duration) * (1000 / this.opts.fps), currentStep = 0;this.opts.flip.moveData = { startDistance: this.opts.flip.rotateEnd, endDistance: -this.opts.flip.rotateStart, moveDistance: moveDistance, moveOneStep: moveOneStep, currentStep: currentStep};this.initStep(this.opts.flip.moveData);this.flipFunc(); }},closeAfterBugFunc: function () { win.clearTimeout(this.closeAfterTimeout); this.closeAfterTimeout = win.setTimeout($.proxy(this.onLayerCloseAfter, this), 30);},popupOpenPropsControl: function () { var pluginOpenPropDatas = hasLayer; for (var openPropsMin = 0, openPropsMax = pluginOpenPropDatas.length; openPropsMin < openPropsMax; openPropsMin++) {var pluginOpenPropData = pluginOpenPropDatas[openPropsMin], pluginPopupWrap = pluginOpenPropData['POPUPWRAP'][0];if (pluginPopupWrap === this.layerWrap[0]) { pluginOpenPropDatas[openPropsMin] = null;} } for (var delPropsMin = 0, delPropsMax = pluginOpenPropDatas.length; delPropsMin < delPropsMax; delPropsMax--) {var pluginDelPropData = pluginOpenPropDatas[delPropsMax - 1];if (pluginDelPropData === null) { pluginOpenPropDatas.splice(delPropsMax - 1, 1);} }},onLayerCloseAfter: function () { // const curScroll = window.pageYOffset; if (this.opts.openerTarget !== null) {// if (this.beforeScroll == curScroll) {// this.opts.openerTarget.focus();// } if (this.closeType !== false) { // if (this.opts.useCloseFocus) { this.opts.openerTarget.focus(); // }}this.opts.openerTarget = null; } this.opts.useCloseFocus = true; this.bindCloseEvents(false); this.outCallback('layerCloseAfter');},ariaAccessbility: function (type, layerTarget) { // var layerWrap = layerTarget, // layerParents = layerWrap.parents(), // pluginOpenPropDatas = hasLayer; // if (type) { // layerWrap.removeAttr('aria-hidden').siblings().attr('aria-hidden', 'true'); // for (var i = 0, max = layerParents.length; i < max; i++) { // var _target = layerParents.eq(i); // _target.siblings().attr('aria-hidden', 'true'); // } // } else { // layerWrap.siblings().removeAttr('aria-hidden'); // for (var i = 0, max = layerParents.length; i < max; i++) { // var _target = layerParents.eq(i); // _target.siblings().removeAttr('aria-hidden'); // } // if (pluginOpenPropDatas.length) { // var pluginPopupWrap = pluginOpenPropDatas[pluginOpenPropDatas.length - 1]['POPUPWRAP']; // this.ariaAccessbility(true, pluginPopupWrap); // } // }},outCallback: function (ing) { var callbackObj = this.opts.on[ing]; if (ing === 'layerMove') {this.layerWrap.trigger(ing, arguments[1], arguments[2], this); } else {this.layerWrap.trigger(ing, this); } if (callbackObj == null) return; if (ing === 'layerMove') {callbackObj(arguments[1], arguments[2], this); } else {callbackObj(this); }},styleDestroy: function () { this.dimmedObj.attr('style', ''); this.layerWrap.attr('style', ''); this.layerBody.attr('style', ''); this.layerObj.attr('style', '');},destroy: function () { this.tweens.kill(); if (this.trapfocus) {this.trapfocus.destroy(); } this.styleDestroy(); this.bindEvents(false); this.bindOutsideEvents(false); this.bindCloseEvents(false);} }; return HiveLayer;})();return HiveLayer; }); // (function () { // 'use strict'; // window.WATCH6 = window.WATCH6 || {}; // const Util = win.WATCH6.UTILS; // class pageNav { // constructor(el = container, args) { // const defParams = { // el, // subNav: '#subnav', // visSections: '.js-visible', // contentsEl: '#contents', // footerEl: '.footer', // sectionEl: '.feature-section', // pageNav: '.page-nav', // pageNavList: '.page-nav__list', // pageNavItem: '.page-nav__item', // pageNavItemLink: '.page-nav__item-link', // navCurrentButton: '.page-nav__current', // ariaAttr: { // hidden: 'aria-hidden', // expanded: 'aria-expanded', // selected: 'aria-selected' // }, // classes: { // isActive: 'is_active', // isOpened: 'is_opened' // }, // resizeStart: null // }; // this.opts = defParams; // this.classes = defParams.classes; // this.el = document.querySelector(el); // this.init(); // } // init() { // if (this.el === null) return; // this.setElements(); // this.initOpts(); // this.bindEvents(); // this.getSectionPos(); // } // setElements() { // this.subNavEl = this.el.querySelector(this.opts.subNav); // this.contentsEl = this.el.querySelector(this.opts.contentsEl); // this.footerEl = this.el.querySelector(this.opts.footerEl); // this.bodyChild = document.body.children; // this.sectionEl = this.contentsEl.querySelectorAll(this.opts.sectionEl); // this.pageNavEl = this.contentsEl.querySelector(this.opts.pageNav); // this.pageNavList = this.pageNavEl.querySelector(this.opts.pageNavList); // this.pageNavItem = this.pageNavList.querySelectorAll(this.opts.pageNavItem); // this.pageNavItemLink = this.pageNavList.querySelectorAll(this.opts.pageNavItemLink); // this.navCurrentButton = this.pageNavEl.querySelector(this.opts.navCurrentButton); // } // initOpts() { // this.lastScrollY = 0; // this.oldSectionValue; // this.isClickPageNav = false; // } // bindEvents() { // const _this = this; // window.addEventListener('resize', this.resizeFunc.bind(this)); // window.addEventListener('scroll', this.onScrollHandler.bind(this)); // window.addEventListener('wheel', this.activeScrollHandler.bind(this)); // window.addEventListener('touchmove', this.activeScrollHandler.bind(this)); // this.navCurrentButton.addEventListener('click', this.onClickCurrentBtn.bind(this)); // this.pageNavItemLink.forEach(el => { // el.addEventListener('click', this.onClickPageNavItem.bind(_this)); // }); // } // activeScrollHandler() { // if (this.isClickPageNav) { // this.isClickPageNav = false; // } // } // getSectionPos() { // const _this = this; // this.sectionPos = []; // $(this.sectionEl).each(function (index, el) { // var top = el.offsetTop; // var btm = top + el.clientHeight; // if (index == 0) { // top = 0; // btm = _this.subNavEl.clientHeight + el.clientHeight; // } // _this.sectionPos.push({ top, btm }); // }); // } // onClickCurrentBtn() { // const _this = this; // this.pageNavList.classList.toggle(this.classes.isOpened); // if (this.pageNavList.classList.contains(this.classes.isOpened)) { // _this.pageNavList.setAttribute(this.opts.ariaAttr.expanded, 'true'); // } else { // _this.pageNavList.setAttribute(this.opts.ariaAttr.expanded, 'false'); // } // } // onClickPageNavItem(e) { // this.isClickPageNav = true; // var target = e.target; // var targetText = target.innerText; // var targetIdx = $(target).parent().index(); // this.pageNavItemLink.forEach(el => { // el.classList.remove(this.classes.isActive); // el.setAttribute(this.opts.ariaAttr.selected, 'false'); // }); // target.setAttribute(this.opts.ariaAttr.selected, 'true'); // target.classList.add(this.classes.isActive); // this.navCurrentButton.innerText = targetText; // GALAXY.setSmoothScrollTop(this.sectionPos[targetIdx].top, 1500); // } // onScrollHandler() { // const _this = this; // const scrollY = window.scrollY; // const direction = scrollY > this.lastScrollY ? 'down' : 'up'; // this.lastScrollY = scrollY; // if (!this.isClickPageNav) { // if (direction == 'up') { // _this.pageNavEl.classList.add(_this.classes.isActive); // _this.navCurrentButton.setAttribute(this.opts.ariaAttr.hidden, 'false'); // } else { // _this.pageNavEl.classList.remove(_this.classes.isActive); // _this.navCurrentButton.setAttribute(this.opts.ariaAttr.hidden, 'true'); // if (_this.pageNavList.classList.contains(_this.classes.isOpened)) { // _this.pageNavList.classList.remove(_this.classes.isOpened); // _this.pageNavList.setAttribute(this.opts.ariaAttr.expanded, 'false'); // _this.navCurrentButton.setAttribute(this.opts.ariaAttr.expanded, 'false'); // } // } // this.sectionPos.forEach(function (el, index) { // if (scrollY >= _this.sectionPos[index].top && scrollY <= _this.sectionPos[index].btm) { // if (_this.sectionEl[index].getAttribute('data-section') == _this.oldSectionValue) return; // _this.pageNavItem.forEach(el => { // el.querySelector(_this.opts.pageNavItemLink).classList.remove(_this.classes.isActive); // el.querySelector(_this.opts.pageNavItemLink).setAttribute(_this.opts.ariaAttr.selected, 'false'); // }); // _this.pageNavItem[index].querySelector(_this.opts.pageNavItemLink).classList.add(_this.classes.isActive); // _this.pageNavItem[index].querySelector(_this.opts.pageNavItemLink).setAttribute(_this.opts.ariaAttr.selected, 'true'); // _this.oldSectionValue = _this.sectionEl[index].getAttribute('data-section'); // _this.navCurrentButton.innerText = _this.sectionEl[index].getAttribute('data-section'); // } // }); // } // } // resizeFunc() { // this.winWidth = Util.winSize().w; // if (this.opts.resizeStart === null) { // this.opts.resizeStart = this.winWidth; // this.resizeAnimateFunc(); // } // window.clearTimeout(this.resizeEndTime); // this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); // } // resizeEndFunc() { // this.opts.resizeStart = null; // Util.cancelAFrame.call(window, this.resizeRequestFrame); // this.getSectionPos(); // } // resizeAnimateFunc() { // this.setLayout(); // this.resizeRequestFrame = Util.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); // } // setLayout() { // if (this.winWidth > Util.RESPONSIVE.MOBILE.WIDTH) { // if (this.opts.viewType != 'PC') { // this.opts.viewType = 'PC'; // } // } else { // if (this.opts.viewType != 'MO') { // this.opts.viewType = 'MO'; // } // } // } // } // WATCH6.pageNav = pageNav; // })(); (function () {'use strict'; window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE;class SubNav { constructor(el = container, args) {const defParams = { navItems: 'ul li>a', navDests: '[class*="js-nav-"]', visSections: '.js-visible', resizeStart: null, classes: {isOn: 'on' }};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null) return;this.setElements();this.initOpts();this.bindEvents(); } setElements() {this.navItems = UTILS.convertArray(this.el.querySelectorAll(this.opts.navItems));this.navDests = document.querySelectorAll(this.opts.navDests);this.visSections = UTILS.convertArray(document.querySelectorAll(this.opts.visSections)); } initOpts() {this.visCount = -1;this.visSections.forEach(visSection => { visSection.dataset.visIndex = visSection.classList.contains('js-count') ? ++this.visCount : this.visCount;});this.winOffsetTop = window.pageYOffset; } bindEvents() {this.onScrollHandler();window.addEventListener('resize', this.onResizeHandler.bind(this));window.addEventListener('scroll', this.onScrollHandler.bind(this)); const locationHash = window.location.hash;this.navItems.forEach((navItem, index) => { if (navItem.getAttribute('href').indexOf('#') > -1) {navItem.dataset.navIndex = index;navItem.addEventListener('click', this.onNavItemClickEvent.bind(this)); } if (!!locationHash && navItem.getAttribute('href').indexOf(locationHash) > -1) {navItem.parentNode.classList.remove(this.classes.isOn);navItem.click(); }}); } onNavItemClickEvent(e) {e.preventDefault();const currentTarget = e.target;const parent = currentTarget.parentNode; if (!this.el.classList.contains('hold') && !parent.classList.contains(this.classes.isOn)) { this.navItems.forEach(navItem => {navItem.parentNode.classList.remove(this.classes.isOn); }); if (!parent.classList.contains(this.classes.isOn)) parent.classList.add(this.classes.isOn); const navIndex = currentTarget.dataset.navIndex; const navDest = this.navDests[navIndex]; const navDestRect = navDest.getBoundingClientRect(); const paddingTop = parseInt(window.getComputedStyle(navDest).paddingTop); const winOffsetMiddle = (window.innerHeight - (navDestRect.height - paddingTop) + UTILS.getNavHeight()) / 2; let destYPos = 0; if (navDest.classList.contains('js-nav-center')) {const navDestOffsetMiddle = this.winOffsetTop + navDestRect.top + paddingTop;destYPos = navDestOffsetMiddle - winOffsetMiddle; } else {const navDestOffsetTop = this.winOffsetTop + navDestRect.top - UTILS.getNavHeight();destYPos = navDestOffsetTop; } if (destYPos < 150) destYPos = 0; this.el.classList.add('hold'); GALAXY.setSmoothScrollTop(destYPos, 1500, () => {if (this.el.classList.contains('hold')) this.el.classList.remove('hold');if (GALAXY.header) GALAXY.header.resetSubNav(); });} } onScrollHandler() {this.winOffsetTop = window.pageYOffset;var winOffsetMiddle = (window.innerHeight + UTILS.getNavHeight()) / 2; this.visSections.forEach(visSection => { var visibleRect = visSection.getBoundingClientRect(); var visibleTop = this.winOffsetTop + visibleRect.top; var visibleBottom = this.winOffsetTop + visibleRect.bottom; if (this.winOffsetTop + winOffsetMiddle >= visibleTop && this.winOffsetTop + winOffsetMiddle <= visibleBottom) {var visIndex = visSection.dataset.visIndex;this.navItems.forEach((navItem, index) => { if (index != visIndex && navItem.parentNode.classList.contains(this.classes.isOn)) {navItem.parentNode.classList.remove(this.classes.isOn); }});var parent = this.navItems[visIndex].parentNode;if (!parent.classList.contains(this.classes.isOn)) { parent.classList.add(this.classes.isOn); if (!this.el.classList.contains('hold') && parent.classList.contains(this.classes.isOn)) {if (GALAXY.header) GALAXY.header.resetSubNav(); }} }}); } onResizeHandler() {if (UTILS.winSize().w === this.winWidth) return;this.winWidth = UTILS.winSize().w;if (this.opts.resizeStart == null) { this.opts.resizeStart = this.winWidth; this.resizeAnimateFunc();}window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.onScrollHandler();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.resizeStart = null;UTILS.cancelAFrame.call(window, this.resizeRequestFrame); }} WATCH6.SubNav = SubNav; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Band { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Band = Band; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Battery { constructor(el = container, args) {const defParams = { el, popupEl: '.wearable-watch-battery-processor__popup', processorLayerEl: '.wearable-watch-battery-processor__popup.processor-popup', batteryLayerEl: '.wearable-watch-battery-processor__popup.battery-popup', videoElement: '.video__container', featureHide: 'is-feature-hide', resizeStart: null};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer();this.buildLayer();this.bindEvents(); } setElements() {this.processorLayerEl = this.el.querySelector(this.opts.processorLayerEl);this.batteryLayerEl = this.el.querySelector(this.opts.batteryLayerEl);this.videoElement = this.el.querySelectorAll(this.opts.videoElement); this.processorVideoElement = this.processorLayerEl.querySelector(this.opts.videoElement);this.batteryVideoElement = this.batteryLayerEl.querySelector(this.opts.videoElement); } bindEvents() {window.addEventListener('resize', this.onResizeHandler.bind(this)); } onResizeHandler() {if (UTILS.winSize().w === this.winWidth) return;this.winWidth = UTILS.winSize().w;if (this.opts.resizeStart == null) { this.opts.resizeStart = this.winWidth; this.resizeAnimateFunc();}window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.setLayout();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.resizeStart = null;UTILS.cancelAFrame.call(window, this.resizeRequestFrame); } onResponsiveChange() {if (this.processorLayerEl.style.display === 'block') { this.videoPlayer.change(this.processorVideoElement);} if (this.batteryLayerEl.style.display === 'block') { this.videoPlayer.change(this.batteryVideoElement);} } setLayout() {if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; if (this.currentDevice !== this.prevDevice) { this.onResponsiveChange();} this.prevDevice = this.currentDevice; } buildVideoPlayer() {this.videoPlayer = { instance: [], load: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onLoad(videoElement);}) }, reset: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onReset(videoElement);}) }, play: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onPlay(videoElement);}) }, change: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onChange(videoElement);}) }, build: () => {if (this.videoPlayer.instance.length) return;this.videoElement.forEach((videoElement, index) => { this.videoPlayer.instance.push(new WATCH6.VideoPlayer(videoElement, {sectionElement: this.opts.el,videoParentElement: this.opts.popupEl }));}) }};this.videoPlayer.build(); } buildLayer() {this.layer = { instance: [], build: () => {if (this.layer.instance.length) return; this.layer.instance.push(new HiveLayer(this.opts.processorLayerEl, { effect: 'default', on: {layerOpenBefore: () => { if (this.processorVideoElement) {this.videoPlayer.load(this.processorVideoElement); }},layerCloseAfter: () => { this.videoPlayer.reset(this.processorVideoElement);} }}));this.layer.instance.push(new HiveLayer(this.opts.batteryLayerEl, { effect: 'default', on: {layerOpenBefore: () => { if (this.batteryVideoElement) {this.videoPlayer.load(this.batteryVideoElement); }},layerCloseAfter: () => { this.videoPlayer.reset(this.batteryVideoElement);} }})); }};this.layer.build(); }} WATCH6.Battery = Battery; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Compare { constructor(el = container, args) {const defParams = { el, trackElement: '.wearable-watch-compare__track', fixedElement: '.wearable-watch-compare__fixed', compareWrapEl: '.wearable-watch-compare__list-wrap', compareListEl: '.wearable-watch-compare__list', compareItemEl: '.wearable-watch-compare__list-item', compareImgEl: '.wearable-watch-compare__product-img', compareInfo: '.wearable-watch-compare__info', compareInfoItem: '.wearable-watch-compare__info-item', navigationEl: '.wearable-watch-compare__navigation', colorChipEl: '.wearable-watch-compare__color-chip', colorList: '.wearable-watch-compare__color', tabPanel: '.wearable-watch-compare__product', tabPanels: '.wearable-watch-compare__product-item', scrollbarEl: '.swiper-scrollbar', viewMoreCta: '.view-more__cta', featureHide: 'is-feature-hide', viewmore: '.viewmore', collapse: '.collapse', matchElements: ['.wearable-watch-compare__info-item--display','.wearable-watch-compare__info-item--screen','.wearable-watch-compare__info-item--charge','.wearable-watch-compare__info-item--sensor','.wearable-watch-compare__info-item--material','.wearable-watch-compare__info-item--battery','.wearable-watch-compare__info-item--sleep','.wearable-watch-compare__info-item--cycle','.wearable-watch-compare__info-item--composition','.wearable-watch-compare__info-item--route','.wearable-watch-compare__info-item--durability','.wearable-watch-compare__info-item--size','.wearable-watch-compare__info-item--weight','.wearable-watch-compare__cta','.wearable-watch-compare__size','.wearable-watch-compare__color','.wearable-watch-common__sub-headline' ], matchCommonOpts: {childElement: '.wearable-watch-compare__list-item',useDestroyHeight: false,breakpoints: {} }, classes: {isFixed: 'is-fixed',isCollapse: 'is-collapse',isExpanded: 'is-expanded' }, resizeStart: null, on: {updateImageLoader: null }};this.opts = UTILS.def(defParams, args || {});this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.initOpts();this.initLayout();this.bindEvents();this.buildHeightMatch();this.buildSwiper();this.buildCompareItem();this.onResizeHandler(); } initOpts() {this.getCurrentDevice();this.scroller = null;this.prevDevice = null;this.expanded = false;this.scrollMoveState = false;this.firstImageLoad = false;this.viewMoreCtaTagging = this.viewMoreCta.getAttribute('data-omni');this.viewMoreTagging = this.viewMoreCta.querySelector(this.opts.viewmore).getAttribute('data-tagging');this.collapseTagging = this.viewMoreCta.querySelector(this.opts.collapse).getAttribute('data-tagging'); } initLayout() {// const buildSlideLength = this.currentDevice === 'mobile' ? 2 : 3;// if (this.el.querySelectorAll('.swiper-slide').length >= buildSlideLength) {// this.navigationEl.style.display = 'block';// }this.updateViewMoreHeight(); // this.trackElement.style.height = this.compareWrapEl. } setElements() {this.trackElement = this.el.querySelector(this.opts.trackElement);this.fixedElement = this.el.querySelector(this.opts.fixedElement);this.compareWrapEl = this.el.querySelector(this.opts.compareWrapEl);this.compareListEl = this.compareWrapEl.querySelector(this.opts.compareListEl);this.contentsEl = this.el.querySelectorAll(this.opts.colorChipEl);this.compareItemEl = this.compareWrapEl.querySelectorAll(this.opts.compareItemEl);this.compareInfo = this.el.querySelectorAll(this.opts.compareInfo);this.viewMoreCta = this.el.querySelector(this.opts.viewMoreCta);this.navigationEl = this.el.querySelector(this.opts.navigationEl);this.scrollbarEl = this.el.querySelector(this.opts.scrollbarEl); } bindEvents() {window.addEventListener('load', this.onLoadHandler.bind(this));window.addEventListener('resize', this.onResizeHandler.bind(this));window.addEventListener('scroll', this.onScrollHandler.bind(this));this.viewMoreCta.addEventListener('click', this.onClickViewMoreCta.bind(this)); } getCurrentDevice() {this.winWidth = UTILS.winSize().w;if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile';this.prevDevice = this.currentDevice; } updateViewMoreHeight() {if (this.expanded) { this.viewMoreCta.classList.add(this.classes.isCollapse); this.el.classList.add(this.classes.isExpanded); this.viewMoreCta.setAttribute('data-omni', this.viewMoreCtaTagging + this.collapseTagging); this.viewMoreCta.setAttribute('ga-la', this.viewMoreCtaTagging + this.collapseTagging); this.heightMatch.reInit();} else { this.viewMoreCta.classList.remove(this.classes.isCollapse); this.el.classList.remove(this.classes.isExpanded); this.viewMoreCta.setAttribute('data-omni', this.viewMoreCtaTagging + this.viewMoreTagging); this.viewMoreCta.setAttribute('ga-la', this.viewMoreCtaTagging + this.viewMoreTagging);} } updateImageLoader(el) {this.outCallback('updateImageLoader', el);this.firstImageLoad = true; } buildHeightMatch() {this.heightMatch = { instance: [], reInit: () => {if (!this.heightMatch.instance.length) return;this.heightMatch.instance.forEach((instance) => { instance.reInit();}); }, initLayout: () => {for (let i = 0, max = this.opts.matchElements.length; i < max; i++) { const sTarget = this.opts.matchElements[i]; const sJsClass = 'js-' + sTarget.split('.')[1]; for (let j = 0, jmax = this.compareItemEl.length; j < jmax; j++) {const listTarget = this.compareItemEl[j];const usedJsClass = listTarget.querySelector('.' + sJsClass); if (usedJsClass === null) { const tag = document.createElement('div'); const targetHTML = listTarget.querySelector(sTarget); tag.innerHTML = targetHTML.innerHTML; tag.classList.add(sJsClass); targetHTML.innerHTML = ''; targetHTML.appendChild(tag);} }} }, build: () => {this.heightMatch.initLayout(); const callbackFunc = { column: this.compareItemEl.length};UTILS.def(this.opts.matchCommonOpts, callbackFunc); for (let i = 0, max = this.opts.matchElements.length; i < max; i++) { const sTarget = this.opts.matchElements[i]; const personOpts = {pushElement: '.' + sTarget.split('.')[1],childElement: this.opts.compareItemEl,matchElement: '.js-' + sTarget.split('.')[1] }; const matchCommonOpts = JSON.parse(JSON.stringify(this.opts.matchCommonOpts)); UTILS.def(matchCommonOpts, personOpts); this.heightMatch.instance.push(new WATCH6.HeightMatch(this.opts.compareWrapEl, matchCommonOpts));} }};this.heightMatch.build(); } buildCompareItem() {this.compareItem = { instance: [], build: () => {if (this.compareItem.instance.length) return;this.compareItemEl.forEach(compareItemEl => { this.compareItem.instance.push(new WATCH6.CompareItem(compareItemEl, {on: { updateImageLoader: (el) => {// if (el.classList.contains('js-start-img-src')) {// this.outCallback('updateImageLoader', new Array(el));// } }} }));}) }}this.compareItem.build(); } buildSwiper() {this.swiper = { instance: null, options: {freeMode: true,slidesPerView: 'auto',direction: 'horizontal',a11y: false,scrollbar: { el: this.opts.scrollbarEl} }, destroy: () => {if (this.swiper.instance === null) return;this.swiper.instance.destroy();this.swiper.instance = null; }, updateTranslate: (translate) => {if (this.swiper.instance === null) return;this.swiper.instance.setTranslate(-translate); }, updateLayout: () => {if (this.swiper.instance === null) return;this.swiperWidth = this.compareWrapEl.getBoundingClientRect().width;this.swiperListWidth = this.swiper.instance.virtualSize; }, build: () => {if (this.winWidth < 1024) { if (this.currentDevice !== 'mobile') {if (this.compareItemEl.length <= 3) { this.swiper.destroy(); return;} } if (this.swiper.instance !== null) return; this.swiper.instance = new Swiper(this.compareWrapEl, this.swiper.options); this.swiper.updateLayout();} else { this.swiper.destroy();} }};this.swiper.build(); } onClickViewMoreCta(e) {e.preventDefault();this.expanded = !this.expanded;this.updateViewMoreHeight(); } onLoadHandler() {this.heightMatch.reInit();this.onResponsiveChange();this.onScrollHandler();window.removeEventListener('load', this.onLoadHandler.bind(this)); } onScrollHandler() {this.scrollY = window.scrollY;const _this = this;const direction = this.scrollY > this.lastScrollY ? 'down' : 'up';const windowHeight = window.innerHeight;const winScrollTop = UTILS.getScroll().top - windowHeight;const winScrollBottom = UTILS.getScroll().bottom; const compareElOffset = UTILS.getOffset(this.el);const compareWrapWidth = this.swiperWidth;const compareWrapHeight = UTILS.getHeight(this.compareWrapEl);const compareWrapOffset = UTILS.getOffset(this.compareWrapEl);const compareListWidth = this.swiperListWidth;const scrollLeftValue = Math.ceil(compareListWidth - compareWrapWidth);const trackTopOffset = UTILS.getOffset(this.trackElement).top - windowHeight;const trackHeight = Math.abs(this.trackElement.clientHeight);const scrollTop = winScrollTop - trackTopOffset + UTILS.getNavHeight();const scrollBottom = winScrollBottom - trackTopOffset;const calProgress = scrollTop / trackHeight * 100; if ( ((winScrollBottom > compareElOffset.top && winScrollTop <= compareElOffset.top) ||(winScrollTop < compareElOffset.bottom && winScrollBottom > compareElOffset.bottom) ||(winScrollTop < compareElOffset.top && winScrollBottom > compareElOffset.bottom) ||(winScrollTop > compareElOffset.top && winScrollBottom < compareElOffset.bottom))) { if (!this.firstImageLoad) {const el = this.el.querySelectorAll('.js-start-img-src');this.updateImageLoader(el); }} if (UTILS.getScroll().top + UTILS.getNavHeight() >= compareWrapOffset.top && winScrollBottom <= compareWrapOffset.bottom) { if (!this.el.classList.contains(this.classes.isFixed)) {this.el.classList.add(this.classes.isFixed) }} else { if (this.el.classList.contains(this.classes.isFixed)) {this.el.classList.remove(this.classes.isFixed) }} this.lastScrollY = scrollY; } onResizeHandler() {if (UTILS.winSize().w === this.winWidth) return;this.winWidth = UTILS.winSize().w;if (this.opts.resizeStart == null) { this.opts.resizeStart = this.winWidth; this.resizeAnimateFunc();}window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.setLayout();this.updateViewMoreHeight();this.swiper.build();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.resizeStart = null;this.updateViewMoreHeight();this.swiper.build();UTILS.cancelAFrame.call(window, this.resizeRequestFrame); } setLayout() {if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; if (this.currentDevice !== this.prevDevice) { this.onResponsiveChange();} this.prevDevice = this.currentDevice; } onResponsiveChange() { } outCallback(ing, param) {var callbackObj = this.opts.on[ing];if (callbackObj == null) return;callbackObj(param); }} WATCH6.Compare = Compare; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class CompareItem { constructor(el = container, args) {const defParams = { el, productEl: '.wearable-watch-compare__product', productItem: '.wearable-watch-compare__product-item', productImage: '.wearable-watch-compare__product-image', sizeEl: '.wearable-watch-compare__size', sizeCta: '.wearable-watch-compare__size-cta', colorEl: '.wearable-watch-compare__color', colorItem: '.wearable-watch-compare__color-item', colorChip: '.wearable-watch-compare__color-chip', buyNowCta: '.buy__cta', learnMoreCta: '.learn-more__cta', classes: {isActive: 'is-active' }, resizeStart: null};this.opts = defParams;this.classes = defParams.classes;this.el = el;this.init(); } init() {if (this.el === null) return;this.setElements();this.initOpts();this.initLayout();this.bindEvnts(); } initOpts() {this.currentProduct = this.el.dataset.modelName;this.currentSize = this.el.dataset.defaultSize;this.currentColor = {}this.colorItem.forEach((colorItem) => { let activeColorItem = colorItem.querySelector('.' + this.classes.isActive); if (!activeColorItem) {activeColorItem = colorItem.querySelectorAll(this.opts.colorChip)[0];activeColorItem.classList.add(this.classes.isActive); } this.currentColor[activeColorItem.dataset.size] = activeColorItem.dataset.color;});this.colorChip.forEach(colorChip => { colorChip.removeAttribute('aria-selected'); colorChip.removeAttribute('aria-hidden');}); this.DATA = LOCAL_DATA[this.currentProduct]; } initLayout() {this.updateSizeLayout();this.updateColorItemlayout();this.updateColorChip();this.updateProductItemLayout();this.updateProductImage();this.updateLink(); } setElements() {this.productEl = this.el.querySelector(this.opts.productEl);this.productItem = this.productEl.querySelectorAll(this.opts.productItem);this.sizeEl = this.el.querySelector(this.opts.sizeEl);this.sizeCta = this.sizeEl.querySelectorAll(this.opts.sizeCta);this.colorEl = this.el.querySelector(this.opts.colorEl);this.colorItem = this.colorEl.querySelectorAll(this.opts.colorItem);this.colorChip = this.colorEl.querySelectorAll(this.opts.colorChip);this.buyNowCta = this.el.querySelector(this.opts.buyNowCta);this.learnMoreCta = this.el.querySelector(this.opts.learnMoreCta); } bindEvnts() {this.sizeCta.forEach((sizeCta) => { sizeCta.addEventListener('click', this.handlerClickSizeCta.bind(this));}); this.colorChip.forEach((colorChip) => { colorChip.addEventListener('click', this.handlerClickColorChip.bind(this));}); } handlerClickColorChip(e) {const currentTarget = e.currentTarget;this.currentColor[this.currentSize] = currentTarget.dataset.color; this.updateColorChip();this.updateProductImage();this.updateLink(); } handlerClickSizeCta(e) {const currentTarget = e.currentTarget;this.currentSize = currentTarget.dataset.size;this.updateSizeLayout();this.updateColorItemlayout();this.updateProductItemLayout();this.updateProductImage();this.updateLink(); } updateLink() {const size = this.currentSize;const color = this.currentColor[size];const linkData = this.DATA[size][color]; if (this.learnMoreCta) { if (linkData.hasOwnProperty('learnmore')) {this.learnMoreCta.parentElement.style.display = 'block';this.learnMoreCta.setAttribute('href', linkData.learnmore); } else {this.learnMoreCta.parentElement.style.display = 'none'; }} if (this.buyNowCta) { if (linkData.hasOwnProperty('buynow')) {this.buyNowCta.parentElement.style.display = 'block';this.buyNowCta.setAttribute('href', linkData.buynow); } else {this.buyNowCta.parentElement.style.display = 'none'; }} } updateSizeLayout() {this.sizeCta.forEach((sizeCta) => { if (this.currentSize === sizeCta.dataset.size) {sizeCta.classList.add(this.classes.isActive);sizeCta.setAttribute('title', 'selected'); } else {sizeCta.classList.remove(this.classes.isActive);sizeCta.removeAttribute('title'); }}); } updateColorItemlayout() {this.currentColorItem = Array.from(this.colorItem).filter((colorItem) => { if (this.currentSize === colorItem.dataset.size) {colorItem.classList.add(this.classes.isActive); return colorItem; } else {colorItem.classList.remove(this.classes.isActive); }})[0]; } updateColorChip() {const colorChip = this.currentColorItem.querySelectorAll(this.opts.colorChip);colorChip.forEach((colorChip) => { if (this.currentColor[this.currentSize] === colorChip.dataset.color) {colorChip.classList.add(this.classes.isActive);colorChip.setAttribute('title', 'selected'); } else {colorChip.classList.remove(this.classes.isActive);colorChip.removeAttribute('title'); }}); } updateProductItemLayout() {this.currentProductItem = Array.from(this.productItem).filter((productItem) => { if (this.currentSize === productItem.dataset.size) {productItem.classList.add(this.classes.isActive); return productItem; } else {productItem.classList.remove(this.classes.isActive); }})[0]; } updateProductImage() {const productImage = this.currentProductItem.querySelectorAll(this.opts.productImage);productImage.forEach((productImage) => { if (this.currentColor[this.currentSize] === productImage.dataset.color) {productImage.classList.add(this.classes.isActive);productImage.removeAttribute('tabindex');productImage.setAttribute('aria-hidden', false); } else {productImage.classList.remove(this.classes.isActive);productImage.setAttribute('tabindex', -1);productImage.setAttribute('aria-hidden', true); }}); }} WATCH6.CompareItem = CompareItem; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Connectivity { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Connectivity = Connectivity; })(); (function () {'use strict'; window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Contrast { constructor(el = container, args) {const defParams = { el, defaultBtn: '.type-default', contrastBtn: '.type-contrast', cookieName: 'highContrastMode', featureHide: 'is-feature-hide'};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.bindEvents(); } setElements() {this.defaultBtn = this.el.querySelector(this.opts.defaultBtn);this.defaultBtnTitle = this.defaultBtn.getAttribute('title').trim();this.contrastBtn = this.el.querySelector(this.opts.contrastBtn);this.contrastBtnTitle = this.contrastBtn.getAttribute('title').trim();this.cookieName = this.opts.cookieName; } bindEvents() {window.addEventListener('load', this.onLoadHandler.bind(this));if (!!this.defaultBtn) this.defaultBtn.addEventListener('click', this.onClickDefaultBtn.bind(this));if (!!this.contrastBtn) this.contrastBtn.addEventListener('click', this.onClickContrastBtn.bind(this)); } onLoadHandler() {this.activeContrast(); } onClickDefaultBtn(e) {e.preventDefault();UTILS.setCookie(this.cookieName, '0', 1);this.activeContrast(); } onClickContrastBtn(e) {e.preventDefault();UTILS.setCookie(this.cookieName, '1', 1);this.activeContrast(); } activeContrast() {var cookieValue = UTILS.getCookie(this.cookieName);if (cookieValue != null) { if (cookieValue.length && cookieValue == '1') {document.documentElement.classList.add('color_yb');this.contrastBtn.setAttribute('title', this.contrastBtnTitle + ' selected');this.defaultBtn.setAttribute('title', this.defaultBtnTitle); } else {document.documentElement.classList.remove('color_yb');this.contrastBtn.setAttribute('title', this.contrastBtnTitle);this.defaultBtn.setAttribute('title', this.defaultBtnTitle + ' selected'); }} else { document.documentElement.classList.remove('color_yb'); this.contrastBtn.setAttribute('title', this.contrastBtnTitle); this.defaultBtn.setAttribute('title', this.defaultBtnTitle + ' selected');} }}WATCH6.Contrast = Contrast; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Glass { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el, videoParentElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Glass = Glass; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; class KeyVisual { constructor(el = container, args) {const defParams = { el, classes: {isUseBuy: 'is-use-buy',isUseRegist: 'is-use-regist',isUseOrder: 'is-use-order',isUseWhere: 'is-use-where',isUseOff: 'is-use-off' }, featureHide: 'is-feature-hide'};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.initLayout(); } initLayout() {this.el.classList.remove(this.classes.isUseBuy);this.el.classList.remove(this.classes.isUseRegist);this.el.classList.remove(this.classes.isUseOrder);this.el.classList.remove(this.classes.isUseWhere);this.el.classList.remove(this.classes.isUseOff); if (typeof __WATCH_USE_KV_CTA !== 'undefined' && __WATCH_USE_KV_CTA != null && __WATCH_USE_KV_CTA != undefined && __WATCH_USE_KV_CTA != '') { if (__WATCH_USE_KV_CTA == 'buy-now') {this.el.classList.add(this.classes.isUseBuy); } else if (__WATCH_USE_KV_CTA == 'pre-order') {this.el.classList.add(this.classes.isUseOrder); } else if (__WATCH_USE_KV_CTA == 'pre-registration') {this.el.classList.add(this.classes.isUseRegist); } else if (__WATCH_USE_KV_CTA == 'where-to-buy') {this.el.classList.add(this.classes.isUseWhere); } else if (__WATCH_USE_KV_CTA == 'where-to-buy') {this.el.classList.add(this.classes.isUseOff); }} else { this.el.classList.add(this.classes.isUseBuy);} }} WATCH6.KeyVisual = KeyVisual; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Monitoring { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Monitoring = Monitoring; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Overview { constructor(el = container, args) {const defParams = { el, rootEl: '.wearable-watch', layerEl: '.wearable-watch-overview__popup', featureList: '.wearable-watch-overview__list', featureItem: '.wearable-watch-overview__list-item', featureCta: '.wearable-watch-overview__list-cta', featureBtn: '.wearable-watch-overview__list-btn', featureContent: '.wearable-watch-overview__popup-content', featurePlayer: '.wearable-watch-overview__player', storyEl: '.wearable-watch-overview__story', storySlide: '.wearable-watch-overview__story-item', indicatorList: '.wearable-watch-overview__indicator-list', indicatorItem: '.wearable-watch-overview__indicator-item', indicatorText: '.indicator__text', controlHiddenEl: '.blind', navigationPrev: '.navigation__cta-prev', navigationNext: '.navigation__cta-next', storyItemController: '.story-item__btn', storyItem: '.story-item__image', storyItemCta: '.story-item__cta', closeBtn: '.cm-layer__btn-close', videoElement: '.video__container', startImage: '.video__start-frame', endImage: '.video__end-frame', featureHide: 'is-feature-hide', initSlide: 0, infiniteRolling: true, transitionDuration: 400, widthResizeStart: null, heightResizeStart: null, classes: {loaded: 'loaded',ended: 'ended',paused: 'paused',playing: 'playing',isHover: 'is-hover',isActive: 'is-active',isPaused: 'is-paused',isHeight: 'is-height' }, thumbnailTagging: {'sleep-tracking': { play: 'gwatch6:highlights:overview:movi-play:sleep-tracking-video', pause: 'gwatch6:highlights:overview:movi-pause:sleep-tracking-video',},'health': { play: 'gwatch6:highlights:overview:movi-play:health-video', pause: 'gwatch6:highlights:overview:movi-pause:health-video'},'display': { play: 'gwatch6:highlights:overview:movi-play:display-video', pause: 'gwatch6:highlights:overview:movi-pause:display-video'} }, popupTagging: {'sleep-tracking': { play: 'gwatch6:highlights:overview^lypu:movi-play:sleep-tracking-video', pause: 'gwatch6:highlights:overview^lypu:movi-pause:sleep-tracking-video',},'health': { play: 'gwatch6:highlights:overview^lypu:movi-play:health-video', pause: 'gwatch6:highlights:overview^lypu:movi-pause:health-video'},'display': { play: 'gwatch6:highlights:overview^lypu:movi-play:display-video', pause: 'gwatch6:highlights:overview^lypu:movi-pause:display-video'} }};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.initOpts();this.initLayout();this.buildSwiper();this.buildLayer();this.buildVideoPlayer();this.bindEvents(); } initOpts() {this.winWidth = UTILS.winSize().w;this.winHeight = UTILS.winSize().h;this.currentDevice = false;this.prevDevice = null;this.initValues(); } initValues() {this.selectedIndex = -1; } initLayout() {this.storySlide.forEach((storySlide, index) => { storySlide.setAttribute('aria-hidden', 'true'); storySlide.setAttribute('tabindex', '-1'); storySlide.querySelector(this.opts.storyItemCta).setAttribute('aria-hidden', 'true'); storySlide.querySelector(this.opts.storyItemCta).setAttribute('tabindex', '-1'); if (storySlide.querySelector(this.opts.storyItemController)) {storySlide.querySelector(this.opts.storyItemController).setAttribute('aria-hidden', 'true');storySlide.querySelector(this.opts.storyItemController).setAttribute('tabindex', '-1'); } if (this.opts.initSlide === index) {storySlide.setAttribute('aria-hidden', 'false');storySlide.removeAttribute('tabindex');storySlide.querySelector(this.opts.storyItemCta).setAttribute('aria-hidden', 'false');storySlide.querySelector(this.opts.storyItemCta).removeAttribute('tabindex');if (storySlide.querySelector(this.opts.storyItemController)) { storySlide.querySelector(this.opts.storyItemController).setAttribute('aria-hidden', 'false'); storySlide.querySelector(this.opts.storyItemController).removeAttribute('tabindex');} }}); this.indicatorItem.forEach(indicatorItem => { if (this.indicatorList.getAttribute('role') === 'tablist') {indicatorItem.setAttribute('aria-selected', 'false'); }}); if (!this.opts.infiniteRolling) { if (this.opts.initSlide === 0) {this.navigationPrev.style.display = 'none'; } if (this.opts.initSlide === this.storySlide.length - 1) {this.navigationNext.style.display = 'none'; }} } setElements() {this.rootEl = document.querySelector(this.opts.rootEl);this.layerEl = this.el.querySelector(this.opts.layerEl);this.videoElement = this.el.querySelectorAll(this.opts.videoElement);this.featureList = this.el.querySelector(this.opts.featureList);this.featureContent = this.el.querySelector(this.opts.featureContent);this.featureCta = this.featureList.querySelectorAll(this.opts.featureCta);this.featureBtn = this.featureList.querySelectorAll(this.opts.featureBtn);this.featurePlayer = this.featureList.querySelectorAll(this.opts.videoElement);this.storyEl = this.el.querySelector(this.opts.storyEl);this.storyItem = this.el.querySelectorAll(this.opts.storyItem);this.storySlide = this.el.querySelectorAll(this.opts.storySlide);this.storyPlayer = this.storyEl.querySelectorAll(this.opts.videoElement);this.indicatorList = this.el.querySelector(this.opts.indicatorList);this.indicatorItem = this.indicatorList.querySelectorAll(this.opts.indicatorItem);this.navigationPrev = this.el.querySelector(this.opts.navigationPrev);this.navigationNext = this.el.querySelector(this.opts.navigationNext);this.closeBtn = this.el.querySelector(this.opts.closeBtn); this.storyItemController = this.storyEl.querySelectorAll(this.opts.storyItemController); } bindEvents() {window.addEventListener('resize', this.onResizeHandler.bind(this)); this.featureCta.forEach((featureCta, index) => { featureCta.addEventListener('click', this.handleLayerOpen.bind(this, index));}); this.indicatorItem.forEach((indicatorItem, index) => { indicatorItem.addEventListener('click', this.select.bind(this, index));}); this.navigationPrev.addEventListener('click', this.handleNavigationPrev.bind(this));this.navigationNext.addEventListener('click', this.handleNavigationNext.bind(this)); this.storySlide.forEach((storySlide, index) => { if (storySlide.querySelector(this.opts.storyItemCta).getAttribute('href').indexOf('#') > -1) {storySlide.querySelector(this.opts.storyItemCta).addEventListener('click', this.onStoryItemCtaClickEvent.bind(this)); }}); } unBindEvents() {this.indicatorItem.forEach((indicatorItem, index) => { indicatorItem.removeAllEventListeners('click');}); this.featureBtn.forEach(featureBtn => { featureBtn.removeAllEventListeners('click');}); this.storyItemController.forEach(storyItemController => { storyItemController.removeAllEventListeners('click');}); } onStoryItemCtaClickEvent(e) {e.preventDefault(); const currentTarget = e.target;const currentHref = currentTarget.getAttribute('href');// const bodyTop = Math.abs(JSON.parse(document.querySelector('body').style.top.split('px')[0]));const findSection = this.rootEl.querySelector(currentHref);const findSectionPos = findSection.dataset.rectTop ? findSection.dataset.rectTop : UTILS.getOffset(findSection).top - UTILS.getNavHeight(); $(this.layerEl).trigger('closeLayer', false); $('html, body').animate({ scrollTop: findSectionPos}, { duration: 1000}); const targetFocusElement = findSection.querySelector('.wearable-watch-common__headline') ? findSection.querySelector('.wearable-watch-common__headline') : findSection.querySelector('.wearable-watch-common__sub-headline');if (targetFocusElement) { targetFocusElement.setAttribute('tabindex', '0'); targetFocusElement.focus(); targetFocusElement.addEventListener('focusout', () => {targetFocusElement.removeAttribute('tabindex'); });} } handleNavigationPrev() {let realIndex = this.storySwiper.instance.realIndex - 1;if (realIndex < 0) { realIndex = this.storySlide.length - 1;}this.storySwiper.instance.slideToLoop(realIndex); } handleNavigationNext() {let realIndex = this.storySwiper.instance.realIndex + 1;if (realIndex >= this.storySlide.length) { realIndex = 0;}this.storySwiper.instance.slideToLoop(realIndex); } handleLayerOpen(index, e) {e.preventDefault();this.opts.initSlide = index; } updateControlText(target, isPlaying) {const textEl = target.querySelector(this.opts.controlHiddenEl);const isText = isPlaying ? this.globalText.play : this.globalText.stop; textEl.innerHTML = isText; } select(selectingIndex, isDelayInit = false, reiterate = false) {const selectedIndex = this.selectedIndex; if (selectedIndex !== selectingIndex || isDelayInit) { if (this.animReqId) {UTILS.cancelAFrame.call(window, this.animReqId);this.animReqId = null; } if (selectedIndex > -1) {if (this.indicatorItem[selectedIndex].classList.contains(this.classes.isActive)) { this.indicatorItem[selectedIndex].classList.remove(this.classes.isActive); this.indicatorItem[selectedIndex].removeAttribute('title');}if (this.role === 'tablist') { this.indicatorItem[selectedIndex].setAttribute('aria-selected', 'false');} else { this.indicatorItem[selectedIndex].removeAttribute('title');} } if (selectingIndex < 0) {this.selectedIndex = selectingIndex;return; } this.selectedIndex = selectingIndex; if (!this.indicatorItem[this.selectedIndex].classList.contains(this.classes.isActive)) {this.indicatorItem[this.selectedIndex].classList.add(this.classes.isActive); } if (this.indicatorList.getAttribute('role') === 'tablist') {this.indicatorItem[this.selectedIndex].setAttribute('aria-selected', 'true'); } else {this.indicatorItem[this.selectedIndex].setAttribute('title', 'selected'); } this.storySwiper.instance.slideToLoop(this.selectedIndex);} } updateImageLayout() {const width = this.featureContent.clientWidth;const height = this.featureContent.clientHeight; if (width / height <= 0.56) { this.layerEl.classList.add(this.classes.isHeight);} else { this.layerEl.classList.remove(this.classes.isHeight);} } onResizeHandler() {if (UTILS.winSize().w !== this.winWidth || UTILS.winSize().h !== this.winHeight) { this.winWidth = UTILS.winSize().w; this.winHeight = UTILS.winSize().h; if (this.opts.widthResizeStart == null || this.opts.heightResizeStart == null) {this.opts.widthResizeStart = this.winWidth;this.opts.heightResizeStart = this.winHeight; this.resizeAnimateFunc(); }} window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.setWidthLayout();this.setHeightLayout();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.widthResizeStart = null;this.opts.heightResizeStart = null;UTILS.cancelAFrame.call(window, this.resizeRequestFrame); } onResponsiveChange() {this.select(this.selectedIndex, true); this.featurePlayer.forEach((videoElement) => { this.videoPlayer.change(videoElement);}); if (this.layerEl.style.display === 'block') { this.storyPlayer.forEach((videoElement) => {this.videoPlayer.change(videoElement); });} } setWidthLayout() {if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; this.updateImageLayout(); if (this.currentDevice !== this.prevDevice) { this.onResponsiveChange();} this.prevDevice = this.currentDevice; } setHeightLayout() {this.updateImageLayout(); } buildVideoPlayer() {this.videoPlayer = { instance: [], load: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onLoad(videoElement);}) }, reset: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onReset(videoElement);}) }, play: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onPlay(videoElement);}) }, change: (videoElement) => {if (!this.videoPlayer.instance.length) return;this.videoPlayer.instance.forEach((videoPlayer) => { videoPlayer.onChange(videoElement);}) }, build: () => {if (this.videoPlayer.instance.length) return;this.videoElement.forEach((videoElement, index) => { const feature = videoElement.closest(this.opts.featureItem) ? this.opts.featureItem : null; this.videoPlayer.instance.push(new WATCH6.VideoPlayer(videoElement, {sectionElement: this.opts.el,videoParentElement: feature,on: { updateController: (data) => {const controllerEl = data.el;const tagging = controllerEl.dataset.tagging;const playState = data.playState ? 'pause' : 'play';const targetTagging = controllerEl.classList.contains(this.opts.featureBtn.split('.')[1]) ? this.opts.thumbnailTagging : controllerEl.classList.contains(this.opts.storyItemController.split('.')[1]) ? this.opts.popupTagging : ''; controllerEl.setAttribute('data-omni', targetTagging[tagging][playState]);controllerEl.setAttribute('ga-la', targetTagging[tagging][playState]); }} }));}) }};this.videoPlayer.build(); } buildSwiper() {this.storySwiper = { instance: null, options: {a11y: false,loop: this.opts.infiniteRolling,speed: this.opts.transitionDuration,effect: 'fade',touchMoveStopPropagation: true,fadeEffect: { crossFade: true},initialSlide: this.opts.initSlide }, slideChange: () => {const realIndex = this.storySwiper.instance.realIndex;const targetSlide = this.storySlide[realIndex];const targetVideoElement = targetSlide.querySelector(this.opts.videoElement);this.select(realIndex);if (targetVideoElement) { if (!targetVideoElement.classList.contains(this.classes.loaded)) {this.videoPlayer.load(targetVideoElement); } else {if (!UTILS.isLowNetwork()) { this.videoPlayer.play(targetVideoElement);} }} this.storySlide.forEach((storySlide, index) => { if (index !== realIndex) {const targetVideoElement = storySlide.querySelector(this.opts.videoElement);if (targetVideoElement) { this.videoPlayer.reset(targetVideoElement);} }}); }, slideChangeTransitionStart: () => {if (this.storySwiper.instance === null) return;const swiperSlide = Array.from(this.storySwiper.instance.slides);const realIndex = this.storySwiper.instance.realIndex;const targetSlide = this.storySlide[realIndex]; swiperSlide.forEach((storySlide, index) => { storySlide.setAttribute('aria-hidden', 'true'); storySlide.setAttribute('tabindex', '-1'); storySlide.querySelector(this.opts.storyItemCta).setAttribute('aria-hidden', 'true'); storySlide.querySelector(this.opts.storyItemCta).setAttribute('tabindex', '-1'); if (storySlide.querySelector(this.opts.storyItemController)) {storySlide.querySelector(this.opts.storyItemController).setAttribute('aria-hidden', 'true');storySlide.querySelector(this.opts.storyItemController).setAttribute('tabindex', '-1'); } if (storySlide.classList.contains('swiper-slide-active')) {storySlide.setAttribute('aria-hidden', 'false');storySlide.removeAttribute('tabindex');storySlide.querySelector(this.opts.storyItemCta).setAttribute('aria-hidden', 'false');storySlide.querySelector(this.opts.storyItemCta).removeAttribute('tabindex');if (storySlide.querySelector(this.opts.storyItemController)) { storySlide.querySelector(this.opts.storyItemController).setAttribute('aria-hidden', 'false'); storySlide.querySelector(this.opts.storyItemController).removeAttribute('tabindex');} }}); }, destroy: () => {if (this.storySwiper.instance === null) return;this.storySwiper.instance.destroy();this.storySwiper.instance = null; }, build: () => {if (this.storySwiper.instance !== null) return;this.storySwiper.options.on = { slideChange: this.storySwiper.slideChange.bind(this), slideChangeTransitionStart: this.storySwiper.slideChangeTransitionStart.bind(this)};this.storySwiper.options.initialSlide = this.opts.initSlide;this.storySwiper.instance = new Swiper(this.opts.storyEl, this.storySwiper.options); this.storySwiper.slideChangeTransitionStart(); }}; } buildLayer() {this.layer = { instance: null, build: () => {if (this.layer.instance !== null) return;this.layer.instance = new HiveLayer(this.opts.layerEl, { effect: 'default', on: {layerOpenBefore: () => { this.updateImageLayout(); const targetSlide = this.storySlide[this.opts.initSlide]; const targetVideoElement = targetSlide.querySelector(this.opts.videoElement); this.storySwiper.build(); this.select(this.opts.initSlide); if (targetVideoElement) {this.videoPlayer.load(targetVideoElement); } this.featurePlayer.forEach((featurePlayer) => {this.videoPlayer.reset(featurePlayer); });},layerOpenAfter: () => { const targetSlide = this.storySlide[this.opts.initSlide]; const targetController = targetSlide.querySelector(this.opts.storyItemController); const targetCta = targetSlide.querySelector(this.opts.storyItemCta); const targetFocus = !!targetController ? targetController : targetCta; window.setTimeout(() => {targetFocus.focus(); }, 50)},layerCloseBefore: () => { this.featureBtn.forEach(featureBtn => {if (featureBtn.classList.contains(this.classes.isPaused)) { featureBtn.classList.remove(this.classes.isPaused);} });},layerCloseAfter: () => { this.storySwiper.destroy(); this.initValues(); this.indicatorItem.forEach(indicatorItem => {indicatorItem.classList.remove(this.classes.isActive);indicatorItem.removeAttribute('title'); }); this.storySlide.forEach((storySlide) => {const videoElement = storySlide.querySelector(this.opts.videoElement);this.videoPlayer.reset(videoElement); });} }}); }};this.layer.build(); }} WATCH6.Overview = Overview; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Progress { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el, visiblePoint: 0.5, videoParentElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Progress = Progress; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Screen { constructor(el = container, args) {const defParams = { el, trackElement: '.wearable-watch-screen__track', fixedElement: '.wearable-watch-screen__fixed', textElement: '.wearable-watch-screen__text', videoElement: '.video__container', videoController: '.video__controller', featureHide: 'is-feature-hide', classes: {scene01: 'scene01',scene02: 'scene02',brokenFixedAnimation: 'broken-fixed-animation' }, widthResizeStart: null, heightResizeStart: null};this.opts = defParams;this.classes = defParams.classes;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.initOpts();this.bindEvents(); // TODO : 최적화 필요.this.buildVideoPlayer();this.onLoadHandler(); } setElements() {this.trackElement = this.el.querySelector(this.opts.trackElement);this.fixedElement = this.el.querySelector(this.opts.fixedElement);this.textElement = this.el.querySelector(this.opts.textElement);this.videoElement = this.el.querySelector(this.opts.videoElement);this.videoController = this.el.querySelector(this.opts.videoController);this.video = this.videoElement.querySelector('video'); // NOTE : screen webm 소스만 safari에서 load 되지 않는 이슈 대응하기 위한 직진 코드임......this.video.querySelectorAll('source').forEach((source) => { if (document.documentElement.classList.contains('safari')) {if (source.getAttribute('type').indexOf('webm') > -1) { source.remove();} }}) } initOpts() {this.getCurrentDevice();this.winWidth = UTILS.winSize().w;this.winHeight = UTILS.winSize().h;this.currentAnimation = null;this.prevAnimation = null;this.scroller = null;this.brokenScroller = null;this.lastScrollY = 0;this.animationPlay = false; } initStyle() {ANIUTIL.removeClass({ targetElement: this.el, classList: [this.classes.brokenFixedAnimation, this.classes.scene01, this.classes.scene02]}); } bindEvents() {window.addEventListener('load', this.onLoadHandler.bind(this));window.addEventListener('resize', this.onResizeHandler.bind(this));window.addEventListener('scroll', this.onScrollHandler.bind(this));window.addEventListener('orientationchange', this.onOrientationChange.bind(this)); } getCurrentDevice() {this.winWidth = UTILS.winSize().w;if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; } buildVideoPlayer() {this.videoPlayer = { instance: null, play: () => {if (this.videoPlayer.instance === null) return;this.videoPlayer.instance.onPlay(this.videoElement); }, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el, videoParentElement: this.opts.el, on: {updatePlayState: (state) => { // 선 배포된 gro 소스와 글로벌 소스 겹치지 않기 위한 대응 코드. if (!!this.videoController) return; if (this.scroller === null || document.documentElement.classList.contains('is-animation-broken-fixed')) return; if (state) {this.el.classList.add(this.classes.scene02); } // console.log(data)},updateController: (data) => { // 선 배포된 gro 소스와 글로벌 소스 겹치지 않기 위한 대응 코드. if (!!!this.videoController) return; if (data.playState) {if (this.scroller === null || document.documentElement.classList.contains('is-animation-broken-fixed')) return;if (!UTILS.isLowNetwork()) { this.el.classList.add(this.classes.scene02);} else { if (this.el.classList.contains(this.classes.scene02)) {this.el.classList.remove(this.classes.scene02); } window.setTimeout(() => {this.el.classList.add(this.classes.scene02); }, 10);} }} }}) }};this.videoPlayer.build(); } onLoadHandler() {this.setWidthLayout();this.setHeightLayout();this.onScrollHandler();window.removeEventListener('load', this.onLoadHandler.bind(this)); } onScrollHandler() {const _this = this;const scrollY = window.scrollY;const direction = scrollY > this.lastScrollY ? 'down' : 'up'; const scrollBottom = UTILS.getScroll().bottom;const targetOffsetTop = UTILS.getOffset(this.el).top; if (this.scroller !== null) { this.scroller.trackAnimation(function () {if (this.progress <= 0) { _this.el.classList.remove(_this.classes.scene02);} // 선 배포된 gro 소스와 글로벌 소스 겹치지 않기 위한 대응 코드.if (!!!_this.videoController && UTILS.isLowNetwork()) { if (this.progress > 40) {_this.videoPlayer.play(); }} });} if (this.brokenScroller !== null) { this.brokenScroller.activeAnimation();} this.lastScrollY = scrollY; } onResizeHandler() {if (UTILS.winSize().w !== this.winWidth || UTILS.winSize().h !== this.winHeight) { this.winWidth = UTILS.winSize().w; this.winHeight = UTILS.winSize().h; if (this.opts.widthResizeStart == null || this.opts.heightResizeStart == null) {this.opts.widthResizeStart = this.winWidth;this.opts.heightResizeStart = this.winHeight; this.resizeAnimateFunc(); }} window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.setWidthLayout();this.setHeightLayout();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.widthResizeStart = null;this.opts.heightResizeStart = null;UTILS.cancelAFrame.call(window, this.resizeRequestFrame); } onResponsiveChange() {this.destroyScroller();this.destroyBrokenScroller();this.initStyle(); if (!UTILS.isFullAnimationBrokenFixed()) { this.setScroller();} else { this.setBrokenScroller();} } onOrientationChange() {setTimeout(() => { this.destroyScroller(); this.destroyBrokenScroller(); this.initStyle(); if (!UTILS.isFullAnimationBrokenFixed()) {this.setScroller(); } else {this.setBrokenScroller(); }}, 150); } setWidthLayout() {if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; if (this.currentDevice !== this.prevDevice) { this.onResponsiveChange();} this.prevDevice = this.currentDevice; } setHeightLayout() {const winWidth = window.innerWidth;const winHeight = window.innerHeight;const mobileLandscapeMode = !!UTILS.isTouchDevice && window.matchMedia('(orientation: landscape)').matches;const mobilePortraitMode = !!UTILS.isTouchDevice && !window.matchMedia('(orientation: landscape)').matches; if (mobilePortraitMode && winHeight / winWidth < 1.5) { this.currentAnimation = 'broken';} else if (mobileLandscapeMode) { this.currentAnimation = 'broken';} else if (winHeight < 700) { this.currentAnimation = 'broken';} else { this.currentAnimation = 'use';} // web 모드일 경우에만 실행.if (this.currentAnimation !== this.prevAnimation && !!!UTILS.isTouchDevice) { this.onResponsiveChange();} this.prevAnimation = this.currentAnimation; } setScroller() {this.destroyScroller(); if (this.scroller === null) { this.scroller = SCROLLER({trackElement: this.trackElement,useFixed: false });} } setBrokenScroller() {if (this.brokenScroller === null) { this.brokenScroller = SCROLLER({trackElement: this.trackElement,activeElement: this.el,activeClass: this.classes.brokenFixedAnimation });} } destroyScroller() {if (this.scroller !== null) { this.scroller.destroy(true); this.scroller = null;} } destroyBrokenScroller() {if (this.brokenScroller != null) { this.brokenScroller.destroy(true); this.brokenScroller = null;} }} WATCH6.Screen = Screen; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Snap { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Snap = Snap; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Standalone { constructor(el = container, args) {const defParams = { el, tabEl: '.wearable-watch-standalone__tab', tabList: '.wearable-watch-standalone__tab-list', tabButtons: '.wearable-watch-standalone__tab-cta', tabPanel: '.wearable-watch-standalone__tab-panels', tabPanels: '.wearable-watch-standalone__tab-panel', featureHide: 'is-feature-hide'};this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildTab(); } setElements() {this.tabEl = this.el.querySelector(this.opts.tabEl); } buildTab() {this.tab = { instance: null, build: () => {if (this.tab.instance !== null) return;this.tab.instance = new WATCH6.Tab(this.tabEl, { tabEl: this.opts.tabEl, tabList: this.opts.tabList, tabButtons: this.opts.tabButtons, tabPanel: this.opts.tabPanel, tabPanels: this.opts.tabPanels}); }};this.tab.build(); }} WATCH6.Standalone = Standalone; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Tab { constructor(el = container, args) {const defParams = { el, tabEl: '.wearable-watch__tab', tabList: '.wearable-watch__tab-list', tabButtons: '.wearable-watch__tab-cta', tabPanel: '.wearable-watch__tab-panels', tabPanels: '.wearable-watch__tab-panel', classes: {isActive: 'is-active' }, resizeStart: null};this.opts = UTILS.def(defParams, args || {});this.classes = defParams.classes;this.el = el;this.init(); } init() {if (this.el === null) return;this.setElements();this.initOpts();this.bindEvents(); } setElements() {this.tabEl = this.el;this.tabList = this.tabEl.querySelector(this.opts.tabList);this.tabButtons = UTILS.convertArray(this.tabList.querySelectorAll(this.opts.tabButtons));this.tabPanel = this.el.querySelector(this.opts.tabPanel);this.tabPanels = UTILS.convertArray(this.tabPanel.querySelectorAll(this.opts.tabPanels)); } initOpts() {this.currentIndex = 0;this.currentDevice = false;this.prevDevice = null; } initLayout() {this.tabButtons.forEach(function (tabButton, index) { const tabPanel = this.tabPanels[index]; if (this.currentIndex == index) {if (!tabButton.classList.contains(this.classes.isActive)) tabButton.classList.add(this.classes.isActive);if (!tabPanel.classList.contains(this.classes.isActive)) tabPanel.classList.add(this.classes.isActive);tabButton.setAttribute('aria-selected', true);UTILS.offAccessibility(tabPanel); } else {if (tabButton.classList.contains(this.classes.isActive)) tabButton.classList.remove(this.classes.isActive);if (tabPanel.classList.contains(this.classes.isActive)) tabPanel.classList.remove(this.classes.isActive);tabButton.setAttribute('aria-selected', false);UTILS.onAccessibility(tabPanel); }}); } bindEvents() {window.addEventListener('resize', this.onResizeHandler.bind(this)); this.tabButtons.forEach(tabButtons => { tabButtons.addEventListener('click', this.onClickTabButton.bind(this));}); } unBindEvents() { } onClickTabButton(e) {const currentTarget = e.currentTarget;const currentIndex = this.tabButtons.indexOf(currentTarget);if (currentIndex == this.currentIndex) return;this.tabButtons.forEach((tabButton, index) => { const tabPanel = this.tabPanels[index]; if (currentIndex == index) {if (!tabButton.classList.contains(this.classes.isActive)) tabButton.classList.add(this.classes.isActive);if (!tabPanel.classList.contains(this.classes.isActive)) tabPanel.classList.add(this.classes.isActive);tabButton.setAttribute('aria-selected', true);UTILS.offAccessibility(tabPanel); } else {if (tabButton.classList.contains(this.classes.isActive)) tabButton.classList.remove(this.classes.isActive);if (tabPanel.classList.contains(this.classes.isActive)) tabPanel.classList.remove(this.classes.isActive);tabButton.setAttribute('aria-selected', false);UTILS.onAccessibility(tabPanel); }});this.currentIndex = currentIndex; } onResizeHandler() {if (UTILS.winSize().w === this.winWidth) return;this.winWidth = UTILS.winSize().w;if (this.opts.resizeStart == null) { this.opts.resizeStart = this.winWidth; this.resizeAnimateFunc();}window.clearTimeout(this.resizeEndTime);this.resizeEndTime = window.setTimeout(this.resizeEndFunc.bind(this), 150); } resizeAnimateFunc() {this.setLayout();this.resizeRequestFrame = UTILS.requestAFrame.call(window, this.resizeAnimateFunc.bind(this)); } resizeEndFunc() {this.opts.resizeStart = null;UTILS.cancelAFrame.call(window, this.resizeRequestFrame); } onResponsiveChange() {// console.log(this.currentDevice); } setLayout() {if (this.winWidth >= RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'desktop';else if (this.winWidth > RESPONSIVE.MOBILE.WIDTH && this.winWidth < RESPONSIVE.TABLET.WIDTH) this.currentDevice = 'tablet';else this.currentDevice = 'mobile'; if (this.currentDevice !== this.prevDevice) { this.onResponsiveChange();} this.prevDevice = this.currentDevice; }} WATCH6.Tab = Tab; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Train { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el, videoParentElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Train = Train; })(); (function () {'use strict';window.WATCH6 = window.WATCH6 || {}; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE; class Wellness { constructor(el = container, args) {const defParams = { el, videoElement: '.video__container', featureHide: 'is-feature-hide'}this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null || this.el.classList.contains(this.opts.featureHide)) return;this.setElements();this.buildVideoPlayer(); } setElements() {this.videoElement = this.el.querySelector(this.opts.videoElement); } buildVideoPlayer() {this.videoPlayer = { instance: null, build: () => {if (this.videoPlayer.instance !== null) return;this.videoPlayer.instance = new WATCH6.VideoPlayer(this.videoElement, { sectionElement: this.opts.el}) }};this.videoPlayer.build(); }} WATCH6.Wellness = Wellness; })(); (function () {'use strict'; const UTILS = WATCH6.UTILS;const RESPONSIVE = UTILS.RESPONSIVE;class InitComponents { constructor(el = container) {const defParams = { el, wrapEl: '#wrap', keyVisualEl: '.wearable-watch-kv', overviewEl: '.wearable-watch-overview', screenEl: '.wearable-watch-screen', bandEl: '.wearable-watch-band', glassEl: '.wearable-watch-glass', trainEl: '.wearable-watch-train', snapEl: '.wearable-watch-snap-remote', standaloneEl: '.wearable-watch-standalone', monitoringEl: '.wearable-watch-monitoring', wellnessEl: '.wearable-watch-wellness', batteryEl: '.wearable-watch-battery-processor', progressEl: '.wearable-watch-progress', connectivityEl: '.wearable-watch-connectivity', compareEl: '.wearable-watch-compare', contrastEl: '.cp-high-contrast', subNavEl: '#subnav'};this.opts = defParams;this.el = document.querySelector(el);this.init(); } init() {if (this.el === null) return;this.buildComponents();initialize.init(); } buildComponents() {this.imageLoader = new WATCH6.ImageLoader(this.opts.el, { loadOption: [{ resolution: 1920, attribute: 'data-src-pc'},{ resolution: 1080, attribute: 'data-src-tablet'},{ resolution: 767, attribute: 'data-src-mobile'} ]});this.videoLoader = new WATCH6.VideoLoader(this.opts.el, { notLoadElement: ['.cm-layer'], loadOption: [{ resolution: 1920, attribute: 'data-media-pc'},{ resolution: 767, attribute: 'data-media-mo'} ]});this.keyVisual = new WATCH6.KeyVisual(this.opts.keyVisualEl);this.overview = new WATCH6.Overview(this.opts.overviewEl);this.screen = new WATCH6.Screen(this.opts.screenEl);this.standalone = new WATCH6.Standalone(this.opts.standaloneEl);this.monitoring = new WATCH6.Monitoring(this.opts.monitoringEl);this.wellness = new WATCH6.Wellness(this.opts.wellnessEl);this.band = new WATCH6.Band(this.opts.bandEl);this.glass = new WATCH6.Glass(this.opts.glassEl);this.train = new WATCH6.Train(this.opts.trainEl);this.snap = new WATCH6.Snap(this.opts.snapEl);this.compare = new WATCH6.Compare(this.opts.compareEl, { on: {updateImageLoader: (el) => { this.imageLoader.setResponsiveImage(el);} }});this.contrast = new WATCH6.Contrast(this.opts.contrastEl);this.batteryEl = new WATCH6.Battery(this.opts.batteryEl);this.progressEl = new WATCH6.Progress(this.opts.progressEl);this.connectivityEl = new WATCH6.Connectivity(this.opts.connectivityEl);window.addEventListener('load', () => { setTimeout(() => {if (window.GALAXY && window.GALAXY.isGalaxy) { this.subNav = new WATCH6.SubNav(this.opts.subNavEl);} }, 5);}); }} const initComponents = new InitComponents('.wearable-watch'); })(); });
Samsung Galaxy Watch6 (2024)
Top Articles
Latest Posts
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 6686

Rating: 4 / 5 (41 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.