@jaaq/jaaq-sdk-js 1.1.1 → 1.2.0-dev-ec79f7e-20260605

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +18 -7
  2. package/dist/embed/embed-collection.html +17 -4
  3. package/dist/embed/embed.html +15 -3
  4. package/dist/index.cjs +57 -11
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.ts +100 -24
  7. package/dist/index.mjs +56 -12
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/jaaq-sdk.min.js +1 -1
  10. package/dist/jaaq-sdk.min.js.map +1 -1
  11. package/dist/ui/index.cjs +102 -17
  12. package/dist/ui/index.cjs.map +1 -1
  13. package/dist/ui/index.d.ts +89 -10
  14. package/dist/ui/index.mjs +102 -17
  15. package/dist/ui/index.mjs.map +1 -1
  16. package/dist/ui/jaaq-ui-bundled.min.js +2 -2
  17. package/dist/ui/jaaq-ui-bundled.min.js.map +1 -1
  18. package/dist/ui/jaaq-ui.min.js +2 -2
  19. package/dist/ui/jaaq-ui.min.js.map +1 -1
  20. package/dist/ui/react/index.cjs +78 -18
  21. package/dist/ui/react/index.cjs.map +1 -1
  22. package/dist/ui/react/index.d.ts +84 -7
  23. package/dist/ui/react/index.mjs +78 -18
  24. package/dist/ui/react/index.mjs.map +1 -1
  25. package/dist/ui/react/jaaq-ui-react.min.js +2 -2
  26. package/dist/ui/react/jaaq-ui-react.min.js.map +1 -1
  27. package/dist/ui/vanilla/index.cjs +102 -17
  28. package/dist/ui/vanilla/index.cjs.map +1 -1
  29. package/dist/ui/vanilla/index.d.ts +89 -10
  30. package/dist/ui/vanilla/index.mjs +102 -17
  31. package/dist/ui/vanilla/index.mjs.map +1 -1
  32. package/dist/ui/vanilla/jaaq-vanilla-bundled.min.js +2 -2
  33. package/dist/ui/vanilla/jaaq-vanilla-bundled.min.js.map +1 -1
  34. package/dist/ui/vanilla/jaaq-vanilla.min.js +2 -2
  35. package/dist/ui/vanilla/jaaq-vanilla.min.js.map +1 -1
  36. package/dist/ui/webcomponents/index.cjs +74 -14
  37. package/dist/ui/webcomponents/index.cjs.map +1 -1
  38. package/dist/ui/webcomponents/index.d.ts +86 -9
  39. package/dist/ui/webcomponents/index.mjs +74 -14
  40. package/dist/ui/webcomponents/index.mjs.map +1 -1
  41. package/dist/ui/webcomponents/jaaq-webcomponents-bundled.min.js +2 -2
  42. package/dist/ui/webcomponents/jaaq-webcomponents-bundled.min.js.map +1 -1
  43. package/dist/ui/webcomponents/jaaq-webcomponents.min.js +2 -2
  44. package/dist/ui/webcomponents/jaaq-webcomponents.min.js.map +1 -1
  45. package/package.json +38 -35
@@ -1,8 +1,8 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("hls.js")):"function"==typeof define&&define.amd?define(["exports","hls.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JaaqVanilla={},e.Hls)}(this,function(e,t){"use strict";function n(e){const{baseUrl:t,apiKey:n,clientId:i,fetch:o}=e,s=o??globalThis.fetch;if(!s)throw new Error("No fetch implementation found. Provide one in SDKConfig.fetch for Node or custom environments.");const a={"Content-Type":"application/json","x-api-key":n},r=e=>function(e,t,n){if(/^https?:\/\//i.test(n))return n;const i=e.replace(/\/+$/,""),o=n.replace(/^\/+/,"");return`${i}/b2b/v1/subscription/${encodeURIComponent(t)}${o.startsWith("/")?o:`/${o}`}`}(t,i,e),l=async(e,t,n,i)=>{const o={method:e,headers:{...a,...n?.headers},...n};void 0!==i&&(o.body=JSON.stringify(i));return async function(e){if(!e.ok){const t=await e.text().catch(()=>"");throw new Error(`HTTP ${e.status}: ${t||e.statusText}`)}if(204!==e.status)return e.json()}(await s(r(t),o))};return{get:(e,t)=>l("GET",e,t),post:(e,t,n)=>l("POST",e,n,t),put:(e,t,n)=>l("PUT",e,n,t),patch:(e,t,n)=>l("PATCH",e,n,t),delete:(e,t)=>l("DELETE",e,t)}}const i="https://api.jaaq.app";class o{constructor(e){this.videos=function(e){return{async getById(t){const n=`/videos/${encodeURIComponent(t)}`;return(await e.get(n)).video}}}(e),this.collections=function(e){return{list:async()=>(await e.get("/collections")).collections,async getById(t){const n=`/collections/${encodeURIComponent(t)}`;return(await e.get(n)).collection}}}(e)}static fromHttp(e){return new o(e)}static init(e){return a(e)}}function s(e){return a(e)}function a(e){const{baseUrl:t=i,apiKey:s,clientId:a,fetch:r}=e,l=n({baseUrl:t,apiKey:s,clientId:a,fetch:r??globalThis.fetch});return o.fromHttp(l)}function r(e,t,n){return Math.max(t,Math.min(n,e))}!function(){if("undefined"!=typeof document){const e="jaaq-styles-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".jaaq-video-player {\n position: relative;\n width: 100%;\n max-width: none;\n margin: 0;\n background: #000;\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n aspect-ratio: 9 / 16;\n}\n\n.jaaq-video-player video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: block;\n background: #000;\n object-fit: cover;\n}\n\n.jaaq-video-player.fullscreen {\n max-width: 100%;\n border-radius: 0;\n aspect-ratio: auto;\n}\n\n.jaaq-controls {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\n padding: 40px 16px 16px;\n opacity: 1;\n z-index: 5;\n}\n\n.jaaq-progress-bar {\n width: 100%;\n flex: 1 1 0;\n min-width: 80px;\n height: 4px;\n background: rgba(255, 255, 255, 0.3);\n border-radius: 2px;\n cursor: pointer;\n position: relative;\n}\n\n.jaaq-progress-filled {\n height: 100%;\n background: #007bff;\n border-radius: 2px;\n width: 0%;\n transition: width 0.1s linear;\n}\n\n.jaaq-progress-bar:hover .jaaq-progress-filled {\n background: #0056b3;\n}\n\n.jaaq-controls-bottom {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n color: white;\n}\n\n.jaaq-control-btn {\n background: transparent;\n border: none;\n color: white;\n cursor: pointer;\n padding: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n font-size: 20px;\n line-height: 1;\n}\n\n.jaaq-control-btn:hover {\n transform: scale(1.1);\n}\n\n.jaaq-control-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.jaaq-loading {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 50px;\n height: 50px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-spin 1s linear infinite;\n}\n\n@keyframes jaaq-spin {\n to {\n transform: translate(-50%, -50%) rotate(360deg);\n }\n}\n\n.jaaq-error {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n max-width: 80%;\n text-align: center;\n font-size: 14px;\n}\n\n.jaaq-video-info {\n padding: 16px;\n background: #f8f9fa;\n border-radius: 0 0 12px 12px;\n margin-top: -12px;\n}\n\n.jaaq-video-info h3 {\n margin: 0 0 8px 0;\n color: #333;\n font-size: 18px;\n font-weight: 600;\n}\n\n.jaaq-video-info p {\n margin: 4px 0;\n color: #666;\n font-size: 14px;\n}\n\n.jaaq-video-info strong {\n color: #333;\n}\n\n.jaaq-logo {\n position: absolute;\n top: 20px;\n left: 22px;\n color: white;\n font-size: 16px;\n font-weight: 600;\n z-index: 10;\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n letter-spacing: 0.5px;\n pointer-events: none;\n}\n\n.jaaq-center-play-btn {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 84px;\n height: 84px;\n background: transparent;\n border: none;\n cursor: pointer;\n z-index: 15;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n padding: 0;\n}\n\n.jaaq-center-play-btn:hover {\n transform: translate(-50%, -50%) scale(1.1);\n}\n\n.jaaq-center-play-btn svg {\n width: 100%;\n height: 100%;\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));\n}\n\n.jaaq-video-player.is-playing .jaaq-center-play-btn {\n display: none;\n}\n\n.jaaq-gradient-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(180deg, transparent 0%, #0f0f0f 100%);\n padding: 80px 22px 85px;\n pointer-events: none;\n z-index: 5;\n}\n\n.jaaq-caption-display {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: white;\n background: rgba(0, 0, 0, 0.8);\n padding: 8px 16px;\n margin-bottom: 12px;\n border-radius: 4px;\n text-align: center;\n max-width: 90%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.jaaq-video-title {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 600;\n font-size: 18.695px;\n line-height: 21.5px;\n color: white;\n margin-bottom: 8px;\n letter-spacing: 0.37px;\n}\n\n.jaaq-video-author {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 500;\n font-size: 14.021px;\n line-height: 16.825px;\n color: white;\n opacity: 0.7;\n margin-bottom: 8px;\n letter-spacing: -0.14px;\n}\n\n.jaaq-video-description {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 11px;\n line-height: 16px;\n color: #aaa8aa;\n letter-spacing: -0.11px;\n}\n\n.jaaq-description-text {\n color: #aaa8aa;\n}\n\n.jaaq-read-more {\n color: white;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.jaaq-read-more:hover {\n text-decoration: underline;\n}\n\n.jaaq-progress-bar {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.jaaq-progress-filled {\n background: white;\n}\n\n.jaaq-captions-btn {\n font-size: 14px;\n font-weight: 600;\n border: 1.5px solid white;\n border-radius: 3px;\n padding: 4px 6px;\n line-height: 1;\n}\n\n.jaaq-captions-btn.active {\n background: white;\n color: #000;\n}\n",document.head.appendChild(t)}}}();var l=".jaaq-video-player {\n position: relative;\n width: 100%;\n max-width: none;\n margin: 0;\n background: #000;\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n aspect-ratio: 9 / 16;\n}\n\n.jaaq-video-player video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: block;\n background: #000;\n object-fit: cover;\n}\n\n.jaaq-video-player.fullscreen {\n max-width: 100%;\n border-radius: 0;\n aspect-ratio: auto;\n}\n\n.jaaq-controls {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\n padding: 40px 16px 16px;\n opacity: 1;\n z-index: 5;\n}\n\n.jaaq-progress-bar {\n width: 100%;\n flex: 1 1 0;\n min-width: 80px;\n height: 4px;\n background: rgba(255, 255, 255, 0.3);\n border-radius: 2px;\n cursor: pointer;\n position: relative;\n}\n\n.jaaq-progress-filled {\n height: 100%;\n background: #007bff;\n border-radius: 2px;\n width: 0%;\n transition: width 0.1s linear;\n}\n\n.jaaq-progress-bar:hover .jaaq-progress-filled {\n background: #0056b3;\n}\n\n.jaaq-controls-bottom {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n color: white;\n}\n\n.jaaq-control-btn {\n background: transparent;\n border: none;\n color: white;\n cursor: pointer;\n padding: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n font-size: 20px;\n line-height: 1;\n}\n\n.jaaq-control-btn:hover {\n transform: scale(1.1);\n}\n\n.jaaq-control-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.jaaq-loading {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 50px;\n height: 50px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-spin 1s linear infinite;\n}\n\n@keyframes jaaq-spin {\n to {\n transform: translate(-50%, -50%) rotate(360deg);\n }\n}\n\n.jaaq-error {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n max-width: 80%;\n text-align: center;\n font-size: 14px;\n}\n\n.jaaq-video-info {\n padding: 16px;\n background: #f8f9fa;\n border-radius: 0 0 12px 12px;\n margin-top: -12px;\n}\n\n.jaaq-video-info h3 {\n margin: 0 0 8px 0;\n color: #333;\n font-size: 18px;\n font-weight: 600;\n}\n\n.jaaq-video-info p {\n margin: 4px 0;\n color: #666;\n font-size: 14px;\n}\n\n.jaaq-video-info strong {\n color: #333;\n}\n\n.jaaq-logo {\n position: absolute;\n top: 20px;\n left: 22px;\n color: white;\n font-size: 16px;\n font-weight: 600;\n z-index: 10;\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n letter-spacing: 0.5px;\n pointer-events: none;\n}\n\n.jaaq-center-play-btn {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 84px;\n height: 84px;\n background: transparent;\n border: none;\n cursor: pointer;\n z-index: 15;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n padding: 0;\n}\n\n.jaaq-center-play-btn:hover {\n transform: translate(-50%, -50%) scale(1.1);\n}\n\n.jaaq-center-play-btn svg {\n width: 100%;\n height: 100%;\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));\n}\n\n.jaaq-video-player.is-playing .jaaq-center-play-btn {\n display: none;\n}\n\n.jaaq-gradient-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(180deg, transparent 0%, #0f0f0f 100%);\n padding: 80px 22px 85px;\n pointer-events: none;\n z-index: 5;\n}\n\n.jaaq-caption-display {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: white;\n background: rgba(0, 0, 0, 0.8);\n padding: 8px 16px;\n margin-bottom: 12px;\n border-radius: 4px;\n text-align: center;\n max-width: 90%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.jaaq-video-title {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 600;\n font-size: 18.695px;\n line-height: 21.5px;\n color: white;\n margin-bottom: 8px;\n letter-spacing: 0.37px;\n}\n\n.jaaq-video-author {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 500;\n font-size: 14.021px;\n line-height: 16.825px;\n color: white;\n opacity: 0.7;\n margin-bottom: 8px;\n letter-spacing: -0.14px;\n}\n\n.jaaq-video-description {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 11px;\n line-height: 16px;\n color: #aaa8aa;\n letter-spacing: -0.11px;\n}\n\n.jaaq-description-text {\n color: #aaa8aa;\n}\n\n.jaaq-read-more {\n color: white;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.jaaq-read-more:hover {\n text-decoration: underline;\n}\n\n.jaaq-progress-bar {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.jaaq-progress-filled {\n background: white;\n}\n\n.jaaq-captions-btn {\n font-size: 14px;\n font-weight: 600;\n border: 1.5px solid white;\n border-radius: 3px;\n padding: 4px 6px;\n line-height: 1;\n}\n\n.jaaq-captions-btn.active {\n background: white;\n color: #000;\n}\n";!function(){if("undefined"!=typeof document){const e="jaaq-styles-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".jaaq-vanilla-player {\n user-select: none;\n}\n\n.jaaq-vanilla-player video {\n outline: none;\n}\n\n.jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: #007bff;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n",document.head.appendChild(t)}}}();class d{constructor(e,t){if(this.client=null,this.hls=null,this.videoElement=null,this.listeners=new Map,this.captionCues=[],this.elements={},this.container="string"==typeof e?document.querySelector(e):e,!this.container)throw new Error("Container element not found");if(this.config=t,this.state={isPlaying:!1,currentTime:0,duration:0,volume:1,isMuted:!0===t.startMuted,isFullscreen:!1,isLoading:!0,error:null,videoData:null,captionsEnabled:!1},t.client)this.client=t.client;else{if(!t.apiKey||!t.clientId)throw new Error("Please provide either a client instance or apiKey and clientId");this.client=s({apiKey:t.apiKey,clientId:t.clientId,baseUrl:t.baseUrl})}this.init()}async init(){this.createDOM(),await this.loadVideo(),this.attachEventListeners(),!0===this.config.startMuted&&this.updateVolumeUI()}createDOM(){this.container.innerHTML="";const e=document.createElement("div");e.style.width=this.config.width||"100%",e.style.height=this.config.height||"auto";const t=document.createElement("div");t.className=`jaaq-video-player jaaq-vanilla-player ${this.config.className||""}`,this.elements.player=t;const n=document.createElement("video");this.videoElement=n,!0===this.config.startMuted&&(n.muted=!0,n.setAttribute("muted","")),t.appendChild(n);const i=document.createElement("div");i.className="jaaq-logo",i.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="50" height="15" viewBox="0 0 50 15" fill="none">\n <path d="M48.0329 10.7826C48.7578 9.6622 49.1402 8.37108 49.1402 7.02322C49.1402 3.19784 46.0283 0.0859375 42.2029 0.0859375C38.3775 0.0859375 35.2656 3.19784 35.2656 7.02322C35.2656 10.8486 38.3753 13.9578 42.1985 13.9605C42.1991 13.9605 42.2002 13.9605 42.2007 13.9605H42.2029C43.8475 13.9605 45.4305 13.3687 46.6698 12.3285L49.9971 14.56V12.0999L48.0334 10.7826H48.0329ZM37.309 7.02322C37.309 4.32479 39.5045 2.12927 42.2035 2.12927C44.9024 2.12927 47.0974 4.32479 47.0974 7.02322C47.0974 7.96252 46.8345 8.862 46.3359 9.64475L43.9817 8.06561C43.4531 7.71378 42.8373 7.52778 42.2002 7.52778C40.4394 7.52778 39.0054 8.95036 38.9846 10.7062C37.9586 9.80839 37.3084 8.49053 37.3084 7.02322H37.309ZM42.2035 11.9172C42.2035 11.9172 42.2002 11.9172 42.1985 11.9172C41.5527 11.9161 41.0274 11.3903 41.0274 10.7439C41.0274 10.0975 41.5538 9.57056 42.2007 9.57056C42.4331 9.57056 42.6578 9.6382 42.8493 9.76584L44.8714 11.1224C44.0853 11.633 43.1586 11.9172 42.2029 11.9172H42.2035Z" fill="white"/>\n <path d="M31.0751 0.686201C30.9856 0.579834 30.8858 0.483286 30.7767 0.39983C30.4374 0.138004 30.0283 0 29.5946 0C29.161 0 28.7524 0.138549 28.4126 0.39983C28.2304 0.540561 28.0755 0.711838 27.9533 0.909844C27.8835 1.02276 27.8257 1.14003 27.7815 1.25785L23.1172 13.7317H25.4551L29.5946 2.66135L33.7342 13.7317H36.0721L31.4078 1.25785C31.3303 1.05003 31.218 0.858024 31.0745 0.686746L31.0751 0.686201Z" fill="white"/>\n <path d="M17.4969 0.686201C17.4075 0.579834 17.3076 0.483286 17.1986 0.39983C16.8593 0.138004 16.4502 0 16.0165 0C15.5829 0 15.1743 0.138549 14.8345 0.39983C14.6523 0.540561 14.4974 0.711838 14.3752 0.909844C14.3054 1.02276 14.2476 1.14003 14.2034 1.25785L9.53906 13.7317H11.8769L16.0165 2.66135L20.1561 13.7317H22.494L17.8302 1.25731C17.7527 1.04948 17.6404 0.857478 17.4969 0.686201Z" fill="white"/>\n <path d="M9.86046 0.511825V0.371094H7.82204V9.02333C7.82204 10.6248 6.51891 11.928 4.91741 11.928C3.47028 11.928 2.23261 10.849 2.03897 9.41771L2.01988 9.27807L1.88024 9.29716L0.13964 9.5328L0 9.5519L0.0190914 9.69154C0.348555 12.1292 2.45462 13.9669 4.91741 13.9669C7.64313 13.9669 9.86046 11.7496 9.86046 9.02388V0.511825Z" fill="white"/>\n </svg>\n ',this.elements.logo=i,t.appendChild(i);const o=document.createElement("button");o.className="jaaq-center-play-btn",o.innerHTML='\n <svg viewBox="0 0 84 84" fill="none">\n <circle cx="42" cy="42" r="42" fill="white" fill-opacity="0.9"/>\n <path d="M33 28L56 42L33 56V28Z" fill="#000"/>\n </svg>\n ',o.setAttribute("aria-label","Play video"),this.elements.centerPlayBtn=o,t.appendChild(o);const s=document.createElement("div");s.className="jaaq-gradient-overlay",this.elements.gradientOverlay=s;const a=document.createElement("div");a.className="jaaq-caption-display",a.style.display="none",this.elements.captionDisplay=a,s.appendChild(a);const r=document.createElement("div");r.className="jaaq-video-title",this.elements.videoTitle=r,s.appendChild(r);const l=document.createElement("div");l.className="jaaq-video-author",this.elements.videoAuthor=l,s.appendChild(l);const d=document.createElement("div");d.className="jaaq-video-description",this.elements.videoDescription=d,s.appendChild(d),t.appendChild(s);const c=document.createElement("div");c.className="jaaq-loading",this.elements.loading=c,t.appendChild(c);const u=document.createElement("div");u.className="jaaq-error",u.style.display="none",this.elements.error=u,t.appendChild(u);const p=document.createElement("div");p.className="jaaq-controls",this.elements.controls=p;const h=document.createElement("div");h.className="jaaq-controls-bottom";const f=document.createElement("button");f.className="jaaq-control-btn",f.textContent="▶",f.setAttribute("aria-label","Play"),this.elements.playPauseBtn=f,h.appendChild(f);const m=document.createElement("button");m.className="jaaq-control-btn",m.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287ZM14.0215 0.150391C16.2405 0.150468 18.1409 1.39074 19.4385 3.17676C20.7365 4.9634 21.499 7.36811 21.499 9.96484C21.499 12.5613 20.7363 14.9654 19.4385 16.752C18.1409 18.538 16.2405 19.7792 14.0215 19.7793V17.1025C15.2032 17.1025 16.3824 16.4464 17.3135 15.165C18.2442 13.8839 18.8593 12.0493 18.8594 9.96484C18.8594 7.88034 18.2442 6.04581 17.3135 4.76465C16.3824 3.4832 15.2033 2.82723 14.0215 2.82715V0.150391ZM14.0215 5.75879C15.5701 5.75896 16.8252 7.64189 16.8252 9.96484C16.8251 12.2877 15.57 14.1707 14.0215 14.1709V5.75879Z" fill="white"/>\n </svg>\n ',m.setAttribute("aria-label","Mute"),this.elements.volumeBtn=m,h.appendChild(m);const g=document.createElement("div");g.className="jaaq-progress-bar",this.elements.progressBar=g;const v=document.createElement("div");v.className="jaaq-progress-filled",this.elements.progressFilled=v,g.appendChild(v),h.appendChild(g);const y=document.createElement("button");y.className="jaaq-control-btn jaaq-captions-btn",y.innerHTML="CC",y.setAttribute("aria-label","Captions"),this.elements.captionsBtn=y,h.appendChild(y);const b=document.createElement("button");b.className="jaaq-control-btn",b.textContent="⛶",b.setAttribute("aria-label","Fullscreen"),this.elements.fullscreenBtn=b,h.appendChild(b),p.appendChild(h),t.appendChild(p),e.appendChild(t),this.container.appendChild(e),this.updateControlsVisibility()}updateControlsVisibility(){const e=!1!==this.config.controls;this.elements.controls&&(this.elements.controls.style.display=e?"":"none")}async loadVideo(){if(this.client&&this.videoElement)try{this.setState({isLoading:!0,error:null});const e=await this.client.videos.getById(this.config.videoId);this.setState({videoData:e}),e.subtitle&&(this.captionCues=this.parseWebVTT(e.subtitle)),this.updateOverlayContent(e),this.emit("loaded",e);const n=e.videoUrl;if(n.includes(".m3u8"))if(t.isSupported()){this.hls&&this.hls.destroy();const e=new t({enableWorker:!0,lowLatencyMode:!0});!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted","")),e.loadSource(n),e.attachMedia(this.videoElement),!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted","")),e.on(t.Events.MANIFEST_PARSED,()=>{this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.config.autoplay&&(!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.play())}),e.on(t.Events.ERROR,(e,t)=>{if(t.fatal){const e=`HLS Error: ${t.type} - ${t.details}`;this.showError(e),this.emit("error",new Error(e))}}),this.hls=e}else{if(!this.videoElement.canPlayType("application/vnd.apple.mpegurl"))throw new Error("HLS is not supported in this browser");this.videoElement.src=n,!0===this.config.startMuted&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),this.config.autoplay&&(!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.play())}else this.videoElement.src=n,!0===this.config.startMuted&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),this.config.autoplay&&(!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.play())}catch(e){const t=e instanceof Error?e.message:"Failed to load video";this.showError(t),this.setState({isLoading:!1}),this.emit("error",e instanceof Error?e:new Error(t))}}parseWebVTT(e){const t=[],n=e.split("\n");let i=0;for(;i<n.length;){const e=n[i].trim();if(e.includes("--\x3e")){const[o,s]=e.split("--\x3e").map(e=>e.trim()),a=e=>{const t=e.split(":");if(3===t.length){return 3600*parseFloat(t[0])+60*parseFloat(t[1])+parseFloat(t[2])}if(2===t.length){return 60*parseFloat(t[0])+parseFloat(t[1])}return 0},r=a(o),l=a(s);i++;const d=[];for(;i<n.length&&""!==n[i].trim();)d.push(n[i].trim()),i++;d.length>0&&t.push({start:r,end:l,text:d.join(" ")})}i++}return t}updateOverlayContent(e){const t=!1!==this.config.showLogo,n=!1!==this.config.showTitle,i=!1!==this.config.showAuthor,o=!1!==this.config.showDescription,s=!1!==this.config.showCaptions;if(this.elements.logo&&(this.elements.logo.style.display=t?"block":"none"),this.elements.videoTitle){const t=e.question||"",i=e.creator||"",o=i?`${t} - ${i}`:t;this.elements.videoTitle.textContent=o,this.elements.videoTitle.style.display=n&&t?"block":"none"}if(this.elements.videoAuthor){const t=e.author||e.creator||e.userName||"";this.elements.videoAuthor.textContent=t,this.elements.videoAuthor.style.display=i&&t?"block":"none"}if(this.elements.videoDescription){const t=e.creatorBiography||e.description||"";if(t){const e=150,n=t.length>e?t.substring(0,e)+"...":t;this.elements.videoDescription.innerHTML=`\n <span class="jaaq-description-text">${n}</span>\n ${t.length>e?'<span class="jaaq-read-more"> Read more</span>':""}\n `}this.elements.videoDescription.style.display=o&&t?"block":"none"}this.elements.captionsBtn&&(this.elements.captionsBtn.style.display=s?"flex":"none")}attachEventListeners(){this.videoElement&&(this.videoElement.addEventListener("play",()=>{this.setState({isPlaying:!0}),this.updatePlayPauseButton(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="none"),this.emit("play",void 0)}),this.videoElement.addEventListener("pause",()=>{this.setState({isPlaying:!1}),this.updatePlayPauseButton(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="flex"),this.emit("pause",void 0)}),this.videoElement.addEventListener("timeupdate",()=>{this.setState({currentTime:this.videoElement.currentTime}),this.updateProgress(),this.updateCaptions(),this.emit("timeupdate",this.videoElement.currentTime)}),this.videoElement.addEventListener("durationchange",()=>{this.setState({duration:this.videoElement.duration})}),this.videoElement.addEventListener("volumechange",()=>{this.setState({volume:this.videoElement.volume,isMuted:this.videoElement.muted}),this.updateVolumeUI(),this.emit("volumechange",this.videoElement.volume)}),this.videoElement.addEventListener("ended",()=>{this.emit("ended",void 0)}),this.elements.playPauseBtn?.addEventListener("click",()=>{this.togglePlayPause()}),this.elements.centerPlayBtn?.addEventListener("click",()=>{this.play(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="none")}),this.elements.progressBar?.addEventListener("click",e=>{this.handleSeek(e)}),this.elements.volumeBtn?.addEventListener("click",()=>{this.toggleMute()}),this.elements.captionsBtn?.addEventListener("click",()=>{this.toggleCaptions()}),this.elements.fullscreenBtn?.addEventListener("click",()=>{this.toggleFullscreen()}),document.addEventListener("fullscreenchange",()=>{const e=!!document.fullscreenElement;this.setState({isFullscreen:e}),this.elements.player?.classList.toggle("fullscreen",e),this.emit("fullscreenchange",e)}),this.elements.player?.addEventListener("mousemove",()=>{this.elements.player?.classList.remove("is-paused")}),this.videoElement.addEventListener("pause",()=>{this.elements.player?.classList.add("is-paused")}),this.videoElement.addEventListener("play",()=>{this.elements.player?.classList.remove("is-paused")}))}setState(e){this.state={...this.state,...e}}updatePlayPauseButton(){this.elements.playPauseBtn&&(this.elements.playPauseBtn.textContent=this.state.isPlaying?"⏸":"▶",this.elements.playPauseBtn.setAttribute("aria-label",this.state.isPlaying?"Pause":"Play"))}updateProgress(){if(this.elements.progressFilled&&this.state.duration>0){const e=this.state.currentTime/this.state.duration*100;this.elements.progressFilled.style.width=`${e}%`}}updateVolumeUI(){if(this.elements.volumeBtn){const{isMuted:e,volume:t}=this.state;this.elements.volumeBtn.innerHTML=e||0===t?'\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287Z" fill="white"/>\n </svg>\n ':'\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287ZM14.0215 0.150391C16.2405 0.150468 18.1409 1.39074 19.4385 3.17676C20.7365 4.9634 21.499 7.36811 21.499 9.96484C21.499 12.5613 20.7363 14.9654 19.4385 16.752C18.1409 18.538 16.2405 19.7792 14.0215 19.7793V17.1025C15.2032 17.1025 16.3824 16.4464 17.3135 15.165C18.2442 13.8839 18.8593 12.0493 18.8594 9.96484C18.8594 7.88034 18.2442 6.04581 17.3135 4.76465C16.3824 3.4832 15.2033 2.82723 14.0215 2.82715V0.150391ZM14.0215 5.75879C15.5701 5.75896 16.8252 7.64189 16.8252 9.96484C16.8251 12.2877 15.57 14.1707 14.0215 14.1709V5.75879Z" fill="white"/>\n </svg>\n '}}updateCaptions(){if(!this.elements.captionDisplay||!this.state.captionsEnabled)return void(this.elements.captionDisplay&&(this.elements.captionDisplay.style.display="none"));const e=this.state.currentTime,t=this.captionCues.find(t=>e>=t.start&&e<=t.end);t?(this.elements.captionDisplay.textContent=t.text,this.elements.captionDisplay.style.display="block"):this.elements.captionDisplay.style.display="none"}handleSeek(e){if(!this.videoElement||!this.state.duration||!this.elements.progressBar)return;const t=this.elements.progressBar.getBoundingClientRect(),n=(e.clientX-t.left)/t.width;this.videoElement.currentTime=this.state.duration*r(n,0,1)}showError(e){this.setState({error:e,isLoading:!1}),this.elements.error&&(this.elements.error.textContent=e,this.elements.error.style.display="block"),this.elements.loading&&(this.elements.loading.style.display="none")}togglePlayPause(){this.state.isPlaying?this.pause():this.play()}toggleCaptions(){this.setState({captionsEnabled:!this.state.captionsEnabled}),this.updateCaptionsButton(),this.updateCaptions()}updateCaptionsButton(){this.elements.captionsBtn&&(this.state.captionsEnabled?this.elements.captionsBtn.classList.add("active"):this.elements.captionsBtn.classList.remove("active"))}toggleFullscreen(){var e;this.elements.player&&(e=this.elements.player,document.fullscreenElement?document.exitFullscreen():e.requestFullscreen())}play(){this.videoElement&&(!0!==this.config.startMuted||this.videoElement.muted||(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0})),this.videoElement.play())}pause(){this.videoElement?.pause()}setVolume(e){this.videoElement&&(this.videoElement.volume=r(e,0,1),this.videoElement.muted=0===e)}toggleMute(){this.videoElement&&(this.videoElement.muted=!this.videoElement.muted)}seek(e){this.videoElement&&(this.videoElement.currentTime=r(e,0,this.state.duration))}setFeatures(e){this.config={...this.config,...e},void 0!==e.controls&&this.updateControlsVisibility(),void 0!==e.startMuted&&this.videoElement&&(this.videoElement.muted=!0===e.startMuted,!0===e.startMuted?this.videoElement.setAttribute("muted",""):this.videoElement.removeAttribute("muted"),this.setState({isMuted:!0===e.startMuted}),this.updateVolumeUI()),this.state.videoData?this.updateOverlayContent(this.state.videoData):(void 0!==e.showLogo&&this.elements.logo&&(this.elements.logo.style.display=e.showLogo?"block":"none"),void 0!==e.showCaptions&&this.elements.captionsBtn&&(this.elements.captionsBtn.style.display=e.showCaptions?"flex":"none"))}getState(){return{...this.state}}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const n=this.listeners.get(e);n&&n.delete(t)}emit(e,t){const n=this.listeners.get(e);n&&n.forEach(e=>e(t))}destroy(){this.hls&&(this.hls.destroy(),this.hls=null),this.videoElement&&(this.videoElement.pause(),this.videoElement.src="",this.videoElement=null),this.listeners.clear(),this.container.innerHTML=""}}function c(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("hls.js")):"function"==typeof define&&define.amd?define(["exports","hls.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JaaqVanilla={},e.Hls)}(this,function(e,t){"use strict";function n(e){const{baseUrl:t,apiKey:n,clientId:i,fetch:o,apiVersion:s}=e,a=o??globalThis.fetch;if(!a)throw new Error("No fetch implementation found. Provide one in SDKConfig.fetch for Node or custom environments.");const r={"Content-Type":"application/json","x-api-key":n},l=e=>function(e,t,n,i){if(/^https?:\/\//i.test(i))return i;const o=e.replace(/\/+$/,""),s=i.replace(/^\/+/,"");return`${o}/b2b/${t}/subscription/${encodeURIComponent(n)}${s.startsWith("/")?s:`/${s}`}`}(t,function(e){const t=e.toLowerCase();return"v1"===t||"v2"===t?t:"v1"}(s),i,e),d=async(e,t,n,i)=>{const o={method:e,headers:{...r,...n?.headers},...n};void 0!==i&&(o.body=JSON.stringify(i));return async function(e){if(!e.ok){const t=await e.text().catch(()=>"");throw new Error(`HTTP ${e.status}: ${t||e.statusText}`)}if(204!==e.status)return e.json()}(await a(l(t),o))};return{get:(e,t)=>d("GET",e,t),post:(e,t,n)=>d("POST",e,n,t),put:(e,t,n)=>d("PUT",e,n,t),patch:(e,t,n)=>d("PATCH",e,n,t),delete:(e,t)=>d("DELETE",e,t)}}const i="https://api.jaaq.app";class o{constructor(e,t){"v2"===t?(this.videos=function(e){return{async getById(t){const n=`/videos/${encodeURIComponent(t)}`;return(await e.get(n)).video}}}(e),this.collections=function(e){return{list:async()=>(await e.get("/collections")).collections,async getById(t){const n=`/collections/${encodeURIComponent(t)}`;return(await e.get(n)).collection}}}(e)):(this.videos=function(e){return{async getById(t){const n=`/videos/${encodeURIComponent(t)}`;return(await e.get(n)).video}}}(e),this.collections=function(e){return{list:async()=>(await e.get("/collections")).collections,async getById(t){const n=`/collections/${encodeURIComponent(t)}`;return(await e.get(n)).collection}}}(e))}static fromHttp(e,t){return new o(e,t)}static init(e){return a(e)}}function s(e){return a(e)}function a(e){const{baseUrl:t=i,apiKey:s,clientId:a,fetch:r,apiVersion:l="v1"}=e,d=n({baseUrl:t,apiKey:s,clientId:a,fetch:r??globalThis.fetch,apiVersion:l});return o.fromHttp(d,l)}function r(e,t,n){return Math.max(t,Math.min(n,e))}!function(){if("undefined"!=typeof document){const e="jaaq-styles-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".jaaq-video-player {\n position: relative;\n width: 100%;\n max-width: none;\n margin: 0;\n background: #000;\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n aspect-ratio: 9 / 16;\n}\n\n.jaaq-video-player video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: block;\n background: #000;\n object-fit: cover;\n}\n\n.jaaq-video-player.fullscreen {\n max-width: 100%;\n border-radius: 0;\n aspect-ratio: auto;\n}\n\n.jaaq-controls {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\n padding: 40px 16px 16px;\n opacity: 1;\n z-index: 5;\n}\n\n.jaaq-progress-bar {\n width: 100%;\n flex: 1 1 0;\n min-width: 80px;\n height: 4px;\n background: rgba(255, 255, 255, 0.3);\n border-radius: 2px;\n cursor: pointer;\n position: relative;\n}\n\n.jaaq-progress-filled {\n height: 100%;\n background: #007bff;\n border-radius: 2px;\n width: 0%;\n transition: width 0.1s linear;\n}\n\n.jaaq-progress-bar:hover .jaaq-progress-filled {\n background: #0056b3;\n}\n\n.jaaq-controls-bottom {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n color: white;\n}\n\n.jaaq-control-btn {\n background: transparent;\n border: none;\n color: white;\n cursor: pointer;\n padding: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n font-size: 20px;\n line-height: 1;\n}\n\n.jaaq-control-btn:hover {\n transform: scale(1.1);\n}\n\n.jaaq-control-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.jaaq-loading {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 50px;\n height: 50px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-spin 1s linear infinite;\n}\n\n@keyframes jaaq-spin {\n to {\n transform: translate(-50%, -50%) rotate(360deg);\n }\n}\n\n.jaaq-error {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n max-width: 80%;\n text-align: center;\n font-size: 14px;\n}\n\n.jaaq-video-info {\n padding: 16px;\n background: #f8f9fa;\n border-radius: 0 0 12px 12px;\n margin-top: -12px;\n}\n\n.jaaq-video-info h3 {\n margin: 0 0 8px 0;\n color: #333;\n font-size: 18px;\n font-weight: 600;\n}\n\n.jaaq-video-info p {\n margin: 4px 0;\n color: #666;\n font-size: 14px;\n}\n\n.jaaq-video-info strong {\n color: #333;\n}\n\n.jaaq-logo {\n position: absolute;\n top: 20px;\n left: 22px;\n color: white;\n font-size: 16px;\n font-weight: 600;\n z-index: 10;\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n letter-spacing: 0.5px;\n pointer-events: none;\n}\n\n.jaaq-center-play-btn {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 84px;\n height: 84px;\n background: transparent;\n border: none;\n cursor: pointer;\n z-index: 15;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n padding: 0;\n}\n\n.jaaq-center-play-btn:hover {\n transform: translate(-50%, -50%) scale(1.1);\n}\n\n.jaaq-center-play-btn svg {\n width: 100%;\n height: 100%;\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));\n}\n\n.jaaq-video-player.is-playing .jaaq-center-play-btn {\n display: none;\n}\n\n.jaaq-gradient-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(180deg, transparent 0%, #0f0f0f 100%);\n padding: 80px 22px 85px;\n pointer-events: none;\n z-index: 5;\n}\n\n.jaaq-caption-display {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: white;\n background: rgba(0, 0, 0, 0.8);\n padding: 8px 16px;\n margin-bottom: 12px;\n border-radius: 4px;\n text-align: center;\n max-width: 90%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.jaaq-video-title {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 600;\n font-size: 18.695px;\n line-height: 21.5px;\n color: white;\n margin-bottom: 8px;\n letter-spacing: 0.37px;\n}\n\n.jaaq-video-author {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 500;\n font-size: 14.021px;\n line-height: 16.825px;\n color: white;\n opacity: 0.7;\n margin-bottom: 8px;\n letter-spacing: -0.14px;\n}\n\n.jaaq-video-description {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 11px;\n line-height: 16px;\n color: #aaa8aa;\n letter-spacing: -0.11px;\n}\n\n.jaaq-description-text {\n color: #aaa8aa;\n}\n\n.jaaq-read-more {\n color: white;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.jaaq-read-more:hover {\n text-decoration: underline;\n}\n\n.jaaq-progress-bar {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.jaaq-progress-filled {\n background: white;\n}\n\n.jaaq-captions-btn {\n font-size: 14px;\n font-weight: 600;\n border: 1.5px solid white;\n border-radius: 3px;\n padding: 4px 6px;\n line-height: 1;\n}\n\n.jaaq-captions-btn.active {\n background: white;\n color: #000;\n}\n",document.head.appendChild(t)}}}();var l=".jaaq-video-player {\n position: relative;\n width: 100%;\n max-width: none;\n margin: 0;\n background: #000;\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n aspect-ratio: 9 / 16;\n}\n\n.jaaq-video-player video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: block;\n background: #000;\n object-fit: cover;\n}\n\n.jaaq-video-player.fullscreen {\n max-width: 100%;\n border-radius: 0;\n aspect-ratio: auto;\n}\n\n.jaaq-controls {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\n padding: 40px 16px 16px;\n opacity: 1;\n z-index: 5;\n}\n\n.jaaq-progress-bar {\n width: 100%;\n flex: 1 1 0;\n min-width: 80px;\n height: 4px;\n background: rgba(255, 255, 255, 0.3);\n border-radius: 2px;\n cursor: pointer;\n position: relative;\n}\n\n.jaaq-progress-filled {\n height: 100%;\n background: #007bff;\n border-radius: 2px;\n width: 0%;\n transition: width 0.1s linear;\n}\n\n.jaaq-progress-bar:hover .jaaq-progress-filled {\n background: #0056b3;\n}\n\n.jaaq-controls-bottom {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n color: white;\n}\n\n.jaaq-control-btn {\n background: transparent;\n border: none;\n color: white;\n cursor: pointer;\n padding: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n font-size: 20px;\n line-height: 1;\n}\n\n.jaaq-control-btn:hover {\n transform: scale(1.1);\n}\n\n.jaaq-control-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.jaaq-loading {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 50px;\n height: 50px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-spin 1s linear infinite;\n}\n\n@keyframes jaaq-spin {\n to {\n transform: translate(-50%, -50%) rotate(360deg);\n }\n}\n\n.jaaq-error {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n max-width: 80%;\n text-align: center;\n font-size: 14px;\n}\n\n.jaaq-video-info {\n padding: 16px;\n background: #f8f9fa;\n border-radius: 0 0 12px 12px;\n margin-top: -12px;\n}\n\n.jaaq-video-info h3 {\n margin: 0 0 8px 0;\n color: #333;\n font-size: 18px;\n font-weight: 600;\n}\n\n.jaaq-video-info p {\n margin: 4px 0;\n color: #666;\n font-size: 14px;\n}\n\n.jaaq-video-info strong {\n color: #333;\n}\n\n.jaaq-logo {\n position: absolute;\n top: 20px;\n left: 22px;\n color: white;\n font-size: 16px;\n font-weight: 600;\n z-index: 10;\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n letter-spacing: 0.5px;\n pointer-events: none;\n}\n\n.jaaq-center-play-btn {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 84px;\n height: 84px;\n background: transparent;\n border: none;\n cursor: pointer;\n z-index: 15;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n padding: 0;\n}\n\n.jaaq-center-play-btn:hover {\n transform: translate(-50%, -50%) scale(1.1);\n}\n\n.jaaq-center-play-btn svg {\n width: 100%;\n height: 100%;\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));\n}\n\n.jaaq-video-player.is-playing .jaaq-center-play-btn {\n display: none;\n}\n\n.jaaq-gradient-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(180deg, transparent 0%, #0f0f0f 100%);\n padding: 80px 22px 85px;\n pointer-events: none;\n z-index: 5;\n}\n\n.jaaq-caption-display {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: white;\n background: rgba(0, 0, 0, 0.8);\n padding: 8px 16px;\n margin-bottom: 12px;\n border-radius: 4px;\n text-align: center;\n max-width: 90%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.jaaq-video-title {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 600;\n font-size: 18.695px;\n line-height: 21.5px;\n color: white;\n margin-bottom: 8px;\n letter-spacing: 0.37px;\n}\n\n.jaaq-video-author {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 500;\n font-size: 14.021px;\n line-height: 16.825px;\n color: white;\n opacity: 0.7;\n margin-bottom: 8px;\n letter-spacing: -0.14px;\n}\n\n.jaaq-video-description {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 11px;\n line-height: 16px;\n color: #aaa8aa;\n letter-spacing: -0.11px;\n}\n\n.jaaq-description-text {\n color: #aaa8aa;\n}\n\n.jaaq-read-more {\n color: white;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.jaaq-read-more:hover {\n text-decoration: underline;\n}\n\n.jaaq-progress-bar {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.jaaq-progress-filled {\n background: white;\n}\n\n.jaaq-captions-btn {\n font-size: 14px;\n font-weight: 600;\n border: 1.5px solid white;\n border-radius: 3px;\n padding: 4px 6px;\n line-height: 1;\n}\n\n.jaaq-captions-btn.active {\n background: white;\n color: #000;\n}\n";!function(){if("undefined"!=typeof document){const e="jaaq-styles-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".jaaq-vanilla-player {\n user-select: none;\n}\n\n.jaaq-vanilla-player video {\n outline: none;\n}\n\n.jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: #007bff;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n",document.head.appendChild(t)}}}();class d{constructor(e,t){if(this.client=null,this.hls=null,this.videoElement=null,this.listeners=new Map,this.captionCues=[],this.elements={},this.container="string"==typeof e?document.querySelector(e):e,!this.container)throw new Error("Container element not found");if(this.config=t,this.state={isPlaying:!1,currentTime:0,duration:0,volume:1,isMuted:!0===t.startMuted,isFullscreen:!1,isLoading:!0,error:null,videoData:null,captionsEnabled:!1},t.client)this.client=t.client;else{if(!t.apiKey||!t.clientId)throw new Error("Please provide either a client instance or apiKey and clientId");this.client=s({apiKey:t.apiKey,clientId:t.clientId,baseUrl:t.baseUrl})}this.init()}async init(){this.createDOM(),await this.loadVideo(),this.attachEventListeners(),!0===this.config.startMuted&&this.updateVolumeUI()}createDOM(){this.container.innerHTML="";const e=document.createElement("div");e.style.width=this.config.width||"100%",e.style.height=this.config.height||"auto";const t=document.createElement("div");t.className=`jaaq-video-player jaaq-vanilla-player ${this.config.className||""}`,this.elements.player=t;const n=document.createElement("video");this.videoElement=n,!0===this.config.startMuted&&(n.muted=!0,n.setAttribute("muted","")),t.appendChild(n);const i=document.createElement("div");i.className="jaaq-logo",i.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="50" height="15" viewBox="0 0 50 15" fill="none">\n <path d="M48.0329 10.7826C48.7578 9.6622 49.1402 8.37108 49.1402 7.02322C49.1402 3.19784 46.0283 0.0859375 42.2029 0.0859375C38.3775 0.0859375 35.2656 3.19784 35.2656 7.02322C35.2656 10.8486 38.3753 13.9578 42.1985 13.9605C42.1991 13.9605 42.2002 13.9605 42.2007 13.9605H42.2029C43.8475 13.9605 45.4305 13.3687 46.6698 12.3285L49.9971 14.56V12.0999L48.0334 10.7826H48.0329ZM37.309 7.02322C37.309 4.32479 39.5045 2.12927 42.2035 2.12927C44.9024 2.12927 47.0974 4.32479 47.0974 7.02322C47.0974 7.96252 46.8345 8.862 46.3359 9.64475L43.9817 8.06561C43.4531 7.71378 42.8373 7.52778 42.2002 7.52778C40.4394 7.52778 39.0054 8.95036 38.9846 10.7062C37.9586 9.80839 37.3084 8.49053 37.3084 7.02322H37.309ZM42.2035 11.9172C42.2035 11.9172 42.2002 11.9172 42.1985 11.9172C41.5527 11.9161 41.0274 11.3903 41.0274 10.7439C41.0274 10.0975 41.5538 9.57056 42.2007 9.57056C42.4331 9.57056 42.6578 9.6382 42.8493 9.76584L44.8714 11.1224C44.0853 11.633 43.1586 11.9172 42.2029 11.9172H42.2035Z" fill="white"/>\n <path d="M31.0751 0.686201C30.9856 0.579834 30.8858 0.483286 30.7767 0.39983C30.4374 0.138004 30.0283 0 29.5946 0C29.161 0 28.7524 0.138549 28.4126 0.39983C28.2304 0.540561 28.0755 0.711838 27.9533 0.909844C27.8835 1.02276 27.8257 1.14003 27.7815 1.25785L23.1172 13.7317H25.4551L29.5946 2.66135L33.7342 13.7317H36.0721L31.4078 1.25785C31.3303 1.05003 31.218 0.858024 31.0745 0.686746L31.0751 0.686201Z" fill="white"/>\n <path d="M17.4969 0.686201C17.4075 0.579834 17.3076 0.483286 17.1986 0.39983C16.8593 0.138004 16.4502 0 16.0165 0C15.5829 0 15.1743 0.138549 14.8345 0.39983C14.6523 0.540561 14.4974 0.711838 14.3752 0.909844C14.3054 1.02276 14.2476 1.14003 14.2034 1.25785L9.53906 13.7317H11.8769L16.0165 2.66135L20.1561 13.7317H22.494L17.8302 1.25731C17.7527 1.04948 17.6404 0.857478 17.4969 0.686201Z" fill="white"/>\n <path d="M9.86046 0.511825V0.371094H7.82204V9.02333C7.82204 10.6248 6.51891 11.928 4.91741 11.928C3.47028 11.928 2.23261 10.849 2.03897 9.41771L2.01988 9.27807L1.88024 9.29716L0.13964 9.5328L0 9.5519L0.0190914 9.69154C0.348555 12.1292 2.45462 13.9669 4.91741 13.9669C7.64313 13.9669 9.86046 11.7496 9.86046 9.02388V0.511825Z" fill="white"/>\n </svg>\n ',this.elements.logo=i,t.appendChild(i);const o=document.createElement("button");o.className="jaaq-center-play-btn",o.innerHTML='\n <svg viewBox="0 0 84 84" fill="none">\n <circle cx="42" cy="42" r="42" fill="white" fill-opacity="0.9"/>\n <path d="M33 28L56 42L33 56V28Z" fill="#000"/>\n </svg>\n ',o.setAttribute("aria-label","Play video"),this.elements.centerPlayBtn=o,t.appendChild(o);const s=document.createElement("div");s.className="jaaq-gradient-overlay",this.elements.gradientOverlay=s;const a=document.createElement("div");a.className="jaaq-caption-display",a.style.display="none",this.elements.captionDisplay=a,s.appendChild(a);const r=document.createElement("div");r.className="jaaq-video-title",this.elements.videoTitle=r,s.appendChild(r);const l=document.createElement("div");l.className="jaaq-video-author",this.elements.videoAuthor=l,s.appendChild(l);const d=document.createElement("div");d.className="jaaq-video-description",this.elements.videoDescription=d,s.appendChild(d),t.appendChild(s);const c=document.createElement("div");c.className="jaaq-loading",this.elements.loading=c,t.appendChild(c);const u=document.createElement("div");u.className="jaaq-error",u.style.display="none",this.elements.error=u,t.appendChild(u);const p=document.createElement("div");p.className="jaaq-controls",this.elements.controls=p;const h=document.createElement("div");h.className="jaaq-controls-bottom";const f=document.createElement("button");f.className="jaaq-control-btn",f.textContent="▶",f.setAttribute("aria-label","Play"),this.elements.playPauseBtn=f,h.appendChild(f);const m=document.createElement("button");m.className="jaaq-control-btn",m.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287ZM14.0215 0.150391C16.2405 0.150468 18.1409 1.39074 19.4385 3.17676C20.7365 4.9634 21.499 7.36811 21.499 9.96484C21.499 12.5613 20.7363 14.9654 19.4385 16.752C18.1409 18.538 16.2405 19.7792 14.0215 19.7793V17.1025C15.2032 17.1025 16.3824 16.4464 17.3135 15.165C18.2442 13.8839 18.8593 12.0493 18.8594 9.96484C18.8594 7.88034 18.2442 6.04581 17.3135 4.76465C16.3824 3.4832 15.2033 2.82723 14.0215 2.82715V0.150391ZM14.0215 5.75879C15.5701 5.75896 16.8252 7.64189 16.8252 9.96484C16.8251 12.2877 15.57 14.1707 14.0215 14.1709V5.75879Z" fill="white"/>\n </svg>\n ',m.setAttribute("aria-label","Mute"),this.elements.volumeBtn=m,h.appendChild(m);const g=document.createElement("div");g.className="jaaq-progress-bar",this.elements.progressBar=g;const v=document.createElement("div");v.className="jaaq-progress-filled",this.elements.progressFilled=v,g.appendChild(v),h.appendChild(g);const y=document.createElement("button");y.className="jaaq-control-btn jaaq-captions-btn",y.innerHTML="CC",y.setAttribute("aria-label","Captions"),this.elements.captionsBtn=y,h.appendChild(y);const b=document.createElement("button");b.className="jaaq-control-btn",b.textContent="⛶",b.setAttribute("aria-label","Fullscreen"),this.elements.fullscreenBtn=b,h.appendChild(b),p.appendChild(h),t.appendChild(p),e.appendChild(t),this.container.appendChild(e),this.updateControlsVisibility()}updateControlsVisibility(){const e=!1!==this.config.controls;this.elements.controls&&(this.elements.controls.style.display=e?"":"none")}async loadVideo(){if(this.client&&this.videoElement)try{this.setState({isLoading:!0,error:null});const e=await this.client.videos.getById(this.config.videoId);this.setState({videoData:e}),e.subtitle&&(this.captionCues=this.parseWebVTT(e.subtitle)),this.updateOverlayContent(e),this.emit("loaded",e);const n=e.videoUrl;if(n.includes(".m3u8"))if(t.isSupported()){this.hls&&this.hls.destroy();const e=new t({enableWorker:!0,lowLatencyMode:!0});!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted","")),e.loadSource(n),e.attachMedia(this.videoElement),!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted","")),e.on(t.Events.MANIFEST_PARSED,()=>{this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.config.autoplay&&(!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.play())}),e.on(t.Events.ERROR,(e,t)=>{if(t.fatal){const e=`HLS Error: ${t.type} - ${t.details}`;this.showError(e),this.emit("error",new Error(e))}}),this.hls=e}else{if(!this.videoElement.canPlayType("application/vnd.apple.mpegurl"))throw new Error("HLS is not supported in this browser");this.videoElement.src=n,!0===this.config.startMuted&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),this.config.autoplay&&(!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.play())}else this.videoElement.src=n,!0===this.config.startMuted&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),this.config.autoplay&&(!0===this.config.startMuted&&this.videoElement&&(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0}),this.updateVolumeUI()),this.play())}catch(e){const t=e instanceof Error?e.message:"Failed to load video";this.showError(t),this.setState({isLoading:!1}),this.emit("error",e instanceof Error?e:new Error(t))}}parseWebVTT(e){const t=[],n=e.split("\n");let i=0;for(;i<n.length;){const e=n[i].trim();if(e.includes("--\x3e")){const[o,s]=e.split("--\x3e").map(e=>e.trim()),a=e=>{const t=e.split(":");if(3===t.length){return 3600*parseFloat(t[0])+60*parseFloat(t[1])+parseFloat(t[2])}if(2===t.length){return 60*parseFloat(t[0])+parseFloat(t[1])}return 0},r=a(o),l=a(s);i++;const d=[];for(;i<n.length&&""!==n[i].trim();)d.push(n[i].trim()),i++;d.length>0&&t.push({start:r,end:l,text:d.join(" ")})}i++}return t}updateOverlayContent(e){const t=!1!==this.config.showLogo,n=!1!==this.config.showTitle,i=!1!==this.config.showAuthor,o=!1!==this.config.showDescription,s=!1!==this.config.showCaptions;if(this.elements.logo&&(this.elements.logo.style.display=t?"block":"none"),this.elements.videoTitle){const t=e.question||"",i=e.creator||"",o=i?`${t} - ${i}`:t;this.elements.videoTitle.textContent=o,this.elements.videoTitle.style.display=n&&t?"block":"none"}if(this.elements.videoAuthor){const t=e.author||e.creator||e.userName||"";this.elements.videoAuthor.textContent=t,this.elements.videoAuthor.style.display=i&&t?"block":"none"}if(this.elements.videoDescription){const t=e.creatorBiography||e.description||"";if(t){const e=150,n=t.length>e?t.substring(0,e)+"...":t;this.elements.videoDescription.innerHTML=`\n <span class="jaaq-description-text">${n}</span>\n ${t.length>e?'<span class="jaaq-read-more"> Read more</span>':""}\n `}this.elements.videoDescription.style.display=o&&t?"block":"none"}this.elements.captionsBtn&&(this.elements.captionsBtn.style.display=s?"flex":"none")}attachEventListeners(){this.videoElement&&(this.videoElement.addEventListener("play",()=>{this.setState({isPlaying:!0}),this.updatePlayPauseButton(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="none"),this.emit("play",void 0)}),this.videoElement.addEventListener("pause",()=>{this.setState({isPlaying:!1}),this.updatePlayPauseButton(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="flex"),this.emit("pause",void 0)}),this.videoElement.addEventListener("timeupdate",()=>{this.setState({currentTime:this.videoElement.currentTime}),this.updateProgress(),this.updateCaptions(),this.emit("timeupdate",this.videoElement.currentTime)}),this.videoElement.addEventListener("durationchange",()=>{this.setState({duration:this.videoElement.duration})}),this.videoElement.addEventListener("volumechange",()=>{this.setState({volume:this.videoElement.volume,isMuted:this.videoElement.muted}),this.updateVolumeUI(),this.emit("volumechange",this.videoElement.volume)}),this.videoElement.addEventListener("ended",()=>{this.emit("ended",void 0)}),this.elements.playPauseBtn?.addEventListener("click",()=>{this.togglePlayPause()}),this.elements.centerPlayBtn?.addEventListener("click",()=>{this.play(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="none")}),this.elements.progressBar?.addEventListener("click",e=>{this.handleSeek(e)}),this.elements.volumeBtn?.addEventListener("click",()=>{this.toggleMute()}),this.elements.captionsBtn?.addEventListener("click",()=>{this.toggleCaptions()}),this.elements.fullscreenBtn?.addEventListener("click",()=>{this.toggleFullscreen()}),document.addEventListener("fullscreenchange",()=>{const e=!!document.fullscreenElement;this.setState({isFullscreen:e}),this.elements.player?.classList.toggle("fullscreen",e),this.emit("fullscreenchange",e)}),this.elements.player?.addEventListener("mousemove",()=>{this.elements.player?.classList.remove("is-paused")}),this.videoElement.addEventListener("pause",()=>{this.elements.player?.classList.add("is-paused")}),this.videoElement.addEventListener("play",()=>{this.elements.player?.classList.remove("is-paused")}))}setState(e){this.state={...this.state,...e}}updatePlayPauseButton(){this.elements.playPauseBtn&&(this.elements.playPauseBtn.textContent=this.state.isPlaying?"⏸":"▶",this.elements.playPauseBtn.setAttribute("aria-label",this.state.isPlaying?"Pause":"Play"))}updateProgress(){if(this.elements.progressFilled&&this.state.duration>0){const e=this.state.currentTime/this.state.duration*100;this.elements.progressFilled.style.width=`${e}%`}}updateVolumeUI(){if(this.elements.volumeBtn){const{isMuted:e,volume:t}=this.state;this.elements.volumeBtn.innerHTML=e||0===t?'\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287Z" fill="white"/>\n </svg>\n ':'\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287ZM14.0215 0.150391C16.2405 0.150468 18.1409 1.39074 19.4385 3.17676C20.7365 4.9634 21.499 7.36811 21.499 9.96484C21.499 12.5613 20.7363 14.9654 19.4385 16.752C18.1409 18.538 16.2405 19.7792 14.0215 19.7793V17.1025C15.2032 17.1025 16.3824 16.4464 17.3135 15.165C18.2442 13.8839 18.8593 12.0493 18.8594 9.96484C18.8594 7.88034 18.2442 6.04581 17.3135 4.76465C16.3824 3.4832 15.2033 2.82723 14.0215 2.82715V0.150391ZM14.0215 5.75879C15.5701 5.75896 16.8252 7.64189 16.8252 9.96484C16.8251 12.2877 15.57 14.1707 14.0215 14.1709V5.75879Z" fill="white"/>\n </svg>\n '}}updateCaptions(){if(!this.elements.captionDisplay||!this.state.captionsEnabled)return void(this.elements.captionDisplay&&(this.elements.captionDisplay.style.display="none"));const e=this.state.currentTime,t=this.captionCues.find(t=>e>=t.start&&e<=t.end);t?(this.elements.captionDisplay.textContent=t.text,this.elements.captionDisplay.style.display="block"):this.elements.captionDisplay.style.display="none"}handleSeek(e){if(!this.videoElement||!this.state.duration||!this.elements.progressBar)return;const t=this.elements.progressBar.getBoundingClientRect(),n=(e.clientX-t.left)/t.width;this.videoElement.currentTime=this.state.duration*r(n,0,1)}showError(e){this.setState({error:e,isLoading:!1}),this.elements.error&&(this.elements.error.textContent=e,this.elements.error.style.display="block"),this.elements.loading&&(this.elements.loading.style.display="none")}togglePlayPause(){this.state.isPlaying?this.pause():this.play()}toggleCaptions(){this.setState({captionsEnabled:!this.state.captionsEnabled}),this.updateCaptionsButton(),this.updateCaptions()}updateCaptionsButton(){this.elements.captionsBtn&&(this.state.captionsEnabled?this.elements.captionsBtn.classList.add("active"):this.elements.captionsBtn.classList.remove("active"))}toggleFullscreen(){var e;this.elements.player&&(e=this.elements.player,document.fullscreenElement?document.exitFullscreen():e.requestFullscreen())}play(){this.videoElement&&(!0!==this.config.startMuted||this.videoElement.muted||(this.videoElement.muted=!0,this.videoElement.setAttribute("muted",""),this.setState({isMuted:!0})),this.videoElement.play())}pause(){this.videoElement?.pause()}setVolume(e){this.videoElement&&(this.videoElement.volume=r(e,0,1),this.videoElement.muted=0===e)}toggleMute(){this.videoElement&&(this.videoElement.muted=!this.videoElement.muted)}seek(e){this.videoElement&&(this.videoElement.currentTime=r(e,0,this.state.duration))}setFeatures(e){this.config={...this.config,...e},void 0!==e.controls&&this.updateControlsVisibility(),void 0!==e.startMuted&&this.videoElement&&(this.videoElement.muted=!0===e.startMuted,!0===e.startMuted?this.videoElement.setAttribute("muted",""):this.videoElement.removeAttribute("muted"),this.setState({isMuted:!0===e.startMuted}),this.updateVolumeUI()),this.state.videoData?this.updateOverlayContent(this.state.videoData):(void 0!==e.showLogo&&this.elements.logo&&(this.elements.logo.style.display=e.showLogo?"block":"none"),void 0!==e.showCaptions&&this.elements.captionsBtn&&(this.elements.captionsBtn.style.display=e.showCaptions?"flex":"none"))}getState(){return{...this.state}}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const n=this.listeners.get(e);n&&n.delete(t)}emit(e,t){const n=this.listeners.get(e);n&&n.forEach(e=>e(t))}destroy(){this.hls&&(this.hls.destroy(),this.hls=null),this.videoElement&&(this.videoElement.pause(),this.videoElement.src="",this.videoElement=null),this.listeners.clear(),this.container.innerHTML=""}}function c(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}
2
2
  /*!
3
3
  * Splide.js
4
4
  * Version : 4.1.4
5
5
  * License : MIT
6
6
  * Copyright: 2022 Naotoshi Fujita
7
- */var u="(prefers-reduced-motion: reduce)",p={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function h(e){e.length=0}function f(e,t,n){return Array.prototype.slice.call(e,t,n)}function m(e){return e.bind.apply(e,[null].concat(f(arguments,1)))}var g=setTimeout,v=function(){};function y(e){return requestAnimationFrame(e)}function b(e,t){return typeof t===e}function x(e){return!q(e)&&b("object",e)}var w=Array.isArray,_=m(b,"function"),E=m(b,"string"),j=m(b,"undefined");function q(e){return null===e}function C(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch(e){return!1}}function k(e){return w(e)?e:[e]}function A(e,t){k(e).forEach(t)}function S(e,t){return e.indexOf(t)>-1}function L(e,t){return e.push.apply(e,k(t)),e}function M(e,t,n){e&&A(t,function(t){t&&e.classList[n?"add":"remove"](t)})}function P(e,t){M(e,E(t)?t.split(" "):t,!0)}function I(e,t){A(t,e.appendChild.bind(e))}function T(e,t){A(e,function(e){var n=(t||e).parentNode;n&&n.insertBefore(e,t)})}function z(e,t){return C(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function D(e,t){var n=e?f(e.children):[];return t?n.filter(function(e){return z(e,t)}):n}function B(e,t){return t?D(e,t)[0]:e.firstElementChild}var N=Object.keys;function F(e,t,n){return e&&(n?N(e).reverse():N(e)).forEach(function(n){"__proto__"!==n&&t(e[n],n)}),e}function U(e){return f(arguments,1).forEach(function(t){F(t,function(n,i){e[i]=t[i]})}),e}function H(e){return f(arguments,1).forEach(function(t){F(t,function(t,n){w(t)?e[n]=t.slice():x(t)?e[n]=H({},x(e[n])?e[n]:{},t):e[n]=t})}),e}function R(e,t){A(t||N(e),function(t){delete e[t]})}function O(e,t){A(e,function(e){A(t,function(t){e&&e.removeAttribute(t)})})}function V(e,t,n){x(t)?F(t,function(t,n){V(e,n,t)}):A(e,function(e){q(n)||""===n?O(e,t):e.setAttribute(t,String(n))})}function $(e,t,n){var i=document.createElement(e);return t&&(E(t)?P(i,t):V(i,t)),n&&I(n,i),i}function K(e,t,n){if(j(n))return getComputedStyle(e)[t];q(n)||(e.style[t]=""+n)}function X(e,t){K(e,"display",t)}function W(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function J(e,t){return e.getAttribute(t)}function Z(e,t){return e&&e.classList.contains(t)}function G(e){return e.getBoundingClientRect()}function Y(e){A(e,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function Q(e){return B((new DOMParser).parseFromString(e,"text/html").body)}function ee(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function te(e,t){return e&&e.querySelector(t)}function ne(e,t){return t?f(e.querySelectorAll(t)):[]}function ie(e,t){M(e,t,!1)}function oe(e){return e.timeStamp}function se(e){return E(e)?e:e?e+"px":""}var ae="splide",re="data-"+ae;function le(e,t){if(!e)throw new Error("["+ae+"] "+(t||""))}var de=Math.min,ce=Math.max,ue=Math.floor,pe=Math.ceil,he=Math.abs;function fe(e,t,n){return he(e-t)<n}function me(e,t,n,i){var o=de(t,n),s=ce(t,n);return i?o<e&&e<s:o<=e&&e<=s}function ge(e,t,n){var i=de(t,n),o=ce(t,n);return de(ce(i,e),o)}function ve(e){return+(e>0)-+(e<0)}function ye(e,t){return A(t,function(t){e=e.replace("%s",""+t)}),e}function be(e){return e<10?"0"+e:""+e}var xe={};function we(){var e=[];function t(e,t,n){A(e,function(e){e&&A(t,function(t){t.split(" ").forEach(function(t){var i=t.split(".");n(e,i[0],i[1])})})})}return{bind:function(n,i,o,s){t(n,i,function(t,n,i){var a="addEventListener"in t,r=a?t.removeEventListener.bind(t,n,o,s):t.removeListener.bind(t,o);a?t.addEventListener(n,o,s):t.addListener(o),e.push([t,n,i,o,r])})},unbind:function(n,i,o){t(n,i,function(t,n,i){e=e.filter(function(e){return!!(e[0]!==t||e[1]!==n||e[2]!==i||o&&e[3]!==o)||(e[4](),!1)})})},dispatch:function(e,t,n){var i,o=!0;return"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:o,detail:n}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,o,!1,n),e.dispatchEvent(i),i},destroy:function(){e.forEach(function(e){e[4]()}),h(e)}}}var _e="mounted",Ee="ready",je="move",qe="moved",Ce="click",ke="active",Ae="inactive",Se="visible",Le="hidden",Me="refresh",Pe="updated",Ie="resize",Te="resized",ze="scroll",De="scrolled",Be="destroy",Ne="arrows:mounted",Fe="navigation:mounted",Ue="autoplay:play",He="autoplay:pause",Re="lazyload:loaded",Oe="sk",Ve="sh",$e="ei";function Ke(e){var t=e?e.event.bus:document.createDocumentFragment(),n=we();return e&&e.event.on(Be,n.destroy),U(n,{bus:t,on:function(e,i){n.bind(t,k(e).join(" "),function(e){i.apply(i,w(e.detail)?e.detail:[])})},off:m(n.unbind,t),emit:function(e){n.dispatch(t,e,f(arguments,1))}})}function Xe(e,t,n,i){var o,s,a=Date.now,r=0,l=!0,d=0;function c(){if(!l){if(r=e?de((a()-o)/e,1):1,n&&n(r),r>=1&&(t(),o=a(),i&&++d>=i))return u();s=y(c)}}function u(){l=!0}function p(){s&&cancelAnimationFrame(s),r=0,s=0,l=!0}return{start:function(t){t||p(),o=a()-(t?r*e:0),l=!1,s=y(c)},rewind:function(){o=a(),r=0,n&&n(r)},pause:u,cancel:p,set:function(t){e=t},isPaused:function(){return l}}}var We="Arrow",Je=We+"Left",Ze=We+"Right",Ge=We+"Up",Ye=We+"Down",Qe="ttb",et={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ge,Ze],ArrowRight:[Ye,Je]};var tt="role",nt="tabindex",it="aria-",ot=it+"controls",st=it+"current",at=it+"selected",rt=it+"label",lt=it+"labelledby",dt=it+"hidden",ct=it+"orientation",ut=it+"roledescription",pt=it+"live",ht=it+"busy",ft=it+"atomic",mt=[tt,nt,"disabled",ot,st,rt,lt,dt,ct,ut],gt=ae+"__",vt="is-",yt=ae,bt=gt+"track",xt=gt+"list",wt=gt+"slide",_t=wt+"--clone",Et=wt+"__container",jt=gt+"arrows",qt=gt+"arrow",Ct=qt+"--prev",kt=qt+"--next",At=gt+"pagination",St=At+"__page",Lt=gt+"progress"+"__bar",Mt=gt+"toggle",Pt=gt+"sr",It=vt+"initialized",Tt=vt+"active",zt=vt+"prev",Dt=vt+"next",Bt=vt+"visible",Nt=vt+"loading",Ft=vt+"focus-in",Ut=vt+"overflow",Ht=[Tt,Bt,zt,Dt,Nt,Ft,Ut],Rt={slide:wt,clone:_t,arrows:jt,arrow:qt,prev:Ct,next:kt,pagination:At,page:St,spinner:gt+"spinner"};var Ot="touchstart mousedown",Vt="touchmove mousemove",$t="touchend touchcancel mouseup click";var Kt="slide",Xt="loop",Wt="fade";function Jt(e,t,n,i){var o,s=Ke(e),a=s.on,r=s.emit,l=s.bind,d=e.Components,c=e.root,u=e.options,p=u.isNavigation,h=u.updateOnMove,f=u.i18n,g=u.pagination,v=u.slideFocus,y=d.Direction.resolve,b=J(i,"style"),x=J(i,rt),w=n>-1,_=B(i,"."+Et);function E(){var o=e.splides.map(function(e){var n=e.splide.Components.Slides.getAt(t);return n?n.slide.id:""}).join(" ");V(i,rt,ye(f.slideX,(w?n:t)+1)),V(i,ot,o),V(i,tt,v?"button":""),v&&O(i,ut)}function j(){o||q()}function q(){if(!o){var n=e.index;(s=C())!==Z(i,Tt)&&(M(i,Tt,s),V(i,st,p&&s||""),r(s?ke:Ae,k)),function(){var t=function(){if(e.is(Wt))return C();var t=G(d.Elements.track),n=G(i),o=y("left",!0),s=y("right",!0);return ue(t[o])<=pe(n[o])&&ue(n[s])<=pe(t[s])}(),n=!t&&(!C()||w);e.state.is([4,5])||V(i,dt,n||"");V(ne(i,u.focusableNodes||""),nt,n?-1:""),v&&V(i,nt,n?-1:0);t!==Z(i,Bt)&&(M(i,Bt,t),r(t?Se:Le,k));if(!t&&document.activeElement===i){var o=d.Slides.getAt(e.index);o&&W(o.slide)}}(),M(i,zt,t===n-1),M(i,Dt,t===n+1)}var s}function C(){var i=e.index;return i===t||u.cloneStatus&&i===n}var k={index:t,slideIndex:n,slide:i,container:_,isClone:w,mount:function(){w||(i.id=c.id+"-slide"+be(t+1),V(i,tt,g?"tabpanel":"group"),V(i,ut,f.slide),V(i,rt,x||ye(f.slideLabel,[t+1,e.length]))),l(i,"click",m(r,Ce,k)),l(i,"keydown",m(r,Oe,k)),a([qe,Ve,De],q),a(Fe,E),h&&a(je,j)},destroy:function(){o=!0,s.destroy(),ie(i,Ht),O(i,mt),V(i,"style",b),V(i,rt,x||"")},update:q,style:function(e,t,n){K(n&&_||i,e,t)},isWithin:function(n,i){var o=he(n-t);return w||!u.rewind&&!e.is(Xt)||(o=de(o,e.length-o)),o<=i}};return k}var Zt=re+"-interval";var Gt={passive:!1,capture:!0};var Yt={Spacebar:" ",Right:Ze,Left:Je,Up:Ge,Down:Ye};function Qt(e){return e=E(e)?e:e.key,Yt[e]||e}var en="keydown";var tn=re+"-lazy",nn=tn+"-srcset",on="["+tn+"], ["+nn+"]";var sn=[" ","Enter"];var an=Object.freeze({__proto__:null,Media:function(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},a=we(),r=[];function l(e){e&&a.destroy()}function d(e,t){var n=matchMedia(t);a.bind(n,"change",c),r.push([e,n])}function c(){var t=i.is(7),o=n.direction,s=r.reduce(function(e,t){return H(e,t[1].matches?t[0]:{})},{});R(n),p(s),n.destroy?e.destroy("completely"===n.destroy):t?(l(!0),e.mount()):o!==n.direction&&e.refresh()}function p(t,o,s){H(n,t),o&&H(Object.getPrototypeOf(n),t),!s&&i.is(1)||e.emit(Pe,n)}return{setup:function(){var e="min"===n.mediaQuery;N(o).sort(function(t,n){return e?+t-+n:+n-+t}).forEach(function(t){d(o[t],"("+(e?"min":"max")+"-width:"+t+"px)")}),d(s,u),c()},destroy:l,reduce:function(e){matchMedia(u).matches&&(e?H(n,s):R(n,N(s)))},set:p}},Direction:function(e,t,n){return{resolve:function(e,t,i){var o="rtl"!==(i=i||n.direction)||t?i===Qe?0:-1:1;return et[e]&&et[e][o]||e.replace(/width|left|right/i,function(e,t){var n=et[e.toLowerCase()][o]||e;return t>0?n.charAt(0).toUpperCase()+n.slice(1):n})},orient:function(e){return e*("rtl"===n.direction?1:-1)}}},Elements:function(e,t,n){var i,o,s,a=Ke(e),r=a.on,l=a.bind,d=e.root,c=n.i18n,u={},p=[],f=[],m=[];function g(){i=b("."+bt),o=B(i,"."+xt),le(i&&o,"A track/list element is missing."),L(p,D(o,"."+wt+":not(."+_t+")")),F({arrows:jt,pagination:At,prev:Ct,next:kt,bar:Lt,toggle:Mt},function(e,t){u[t]=b("."+e)}),U(u,{root:d,track:i,list:o,slides:p}),function(){var e=d.id||(s=ae,""+s+be(xe[s]=(xe[s]||0)+1)),t=n.role;var s;d.id=e,i.id=i.id||e+"-track",o.id=o.id||e+"-list",!J(d,tt)&&"SECTION"!==d.tagName&&t&&V(d,tt,t);V(d,ut,c.carousel),V(o,tt,"presentation")}(),y()}function v(e){var t=mt.concat("style");h(p),ie(d,f),ie(i,m),O([i,o],t),O(d,e?t:["style",ut])}function y(){ie(d,f),ie(i,m),f=x(yt),m=x(bt),P(d,f),P(i,m),V(d,rt,n.label),V(d,lt,n.labelledby)}function b(e){var t=te(d,e);return t&&function(e,t){if(_(e.closest))return e.closest(t);for(var n=e;n&&1===n.nodeType&&!z(n,t);)n=n.parentElement;return n}(t,"."+yt)===d?t:void 0}function x(e){return[e+"--"+n.type,e+"--"+n.direction,n.drag&&e+"--draggable",n.isNavigation&&e+"--nav",e===yt&&Tt]}return U(u,{setup:g,mount:function(){r(Me,v),r(Me,g),r(Pe,y),l(document,Ot+" keydown",function(e){s="keydown"===e.type},{capture:!0}),l(d,"focusin",function(){M(d,Ft,!!s)})},destroy:v})},Slides:function(e,t,n){var i=Ke(e),o=i.on,s=i.emit,a=i.bind,r=t.Elements,l=r.slides,d=r.list,c=[];function u(){l.forEach(function(e,t){f(e,t,-1)})}function p(){v(function(e){e.destroy()}),h(c)}function f(t,n,i){var o=Jt(e,n,i,t);o.mount(),c.push(o),c.sort(function(e,t){return e.index-t.index})}function g(e){return e?y(function(e){return!e.isClone}):c}function v(e,t){g(t).forEach(e)}function y(e){return c.filter(_(e)?e:function(t){return E(e)?z(t.slide,e):S(k(e),t.index)})}return{mount:function(){u(),o(Me,p),o(Me,u)},destroy:p,update:function(){v(function(e){e.update()})},register:f,get:g,getIn:function(e){var i=t.Controller,o=i.toIndex(e),s=i.hasFocus()?1:n.perPage;return y(function(e){return me(e.index,o,o+s-1)})},getAt:function(e){return y(e)[0]},add:function(e,t){A(e,function(e){if(E(e)&&(e=Q(e)),C(e)){var i=l[t];i?T(e,i):I(d,e),P(e,n.classes.slide),o=e,r=m(s,Ie),c=ne(o,"img"),(u=c.length)?c.forEach(function(e){a(e,"load error",function(){--u||r()})}):r()}var o,r,c,u}),s(Me)},remove:function(e){Y(y(e).map(function(e){return e.slide})),s(Me)},forEach:v,filter:y,style:function(e,t,n){v(function(i){i.style(e,t,n)})},getLength:function(e){return e?l.length:c.length},isEnough:function(){return c.length>n.perPage}}},Layout:function(e,t,n){var i,o,s,a=Ke(e),r=a.on,l=a.bind,d=a.emit,c=t.Slides,u=t.Direction.resolve,p=t.Elements,h=p.root,f=p.track,g=p.list,v=c.getAt,y=c.style;function b(){i=n.direction===Qe,K(h,"maxWidth",se(n.width)),K(f,u("paddingLeft"),_(!1)),K(f,u("paddingRight"),_(!0)),w(!0)}function w(e){var t=G(h);(e||o.width!==t.width||o.height!==t.height)&&(K(f,"height",function(){var e="";i&&(le(e=E(),"height or heightRatio is missing."),e="calc("+e+" - "+_(!1)+" - "+_(!0)+")");return e}()),y(u("marginRight"),se(n.gap)),y("width",n.autoWidth?null:se(n.fixedWidth)||(i?"":j())),y("height",se(n.fixedHeight)||(i?n.autoHeight?null:j():E()),!0),o=t,d(Te),s!==(s=L())&&(M(h,Ut,s),d("overflow",s)))}function _(e){var t=n.padding,i=u(e?"right":"left");return t&&se(t[i]||(x(t)?0:t))||"0px"}function E(){return se(n.height||G(g).width*n.heightRatio)}function j(){var e=se(n.gap);return"calc((100%"+(e&&" + "+e)+")/"+(n.perPage||1)+(e&&" - "+e)+")"}function q(){return G(g)[u("width")]}function C(e,t){var n=v(e||0);return n?G(n.slide)[u("width")]+(t?0:S()):0}function k(e,t){var n=v(e);if(n){var i=G(n.slide)[u("right")],o=G(g)[u("left")];return he(i-o)+(t?0:S())}return 0}function A(t){return k(e.length-1)-k(0)+C(0,t)}function S(){var e=v(0);return e&&parseFloat(K(e.slide,u("marginRight")))||0}function L(){return e.is(Wt)||A(!0)>q()}return{mount:function(){var e,t;b(),l(window,"resize load",(e=m(d,Ie),t=Xe(0,e,null,1),function(){t.isPaused()&&t.start()})),r([Pe,Me],b),r(Ie,w)},resize:w,listSize:q,slideSize:C,sliderSize:A,totalSize:k,getPadding:function(e){return parseFloat(K(f,u("padding"+(e?"Right":"Left"))))||0},isOverflow:L}},Clones:function(e,t,n){var i,o=Ke(e),s=o.on,a=t.Elements,r=t.Slides,l=t.Direction.resolve,d=[];function c(){s(Me,u),s([Pe,Ie],f),(i=m())&&(!function(t){var i=r.get().slice(),o=i.length;if(o){for(;i.length<t;)L(i,i);L(i.slice(-t),i.slice(0,t)).forEach(function(s,l){var c=l<t,u=function(t,i){var o=t.cloneNode(!0);return P(o,n.classes.clone),o.id=e.root.id+"-clone"+be(i+1),o}(s.slide,l);c?T(u,i[0].slide):I(a.list,u),L(d,u),r.register(u,l-t+(c?0:o),s.index)})}}(i),t.Layout.resize(!0))}function u(){p(),c()}function p(){Y(d),h(d),o.destroy()}function f(){var e=m();i!==e&&(i<e||!e)&&o.emit(Me)}function m(){var i=n.clones;if(e.is(Xt)){if(j(i)){var o=n[l("fixedWidth")]&&t.Layout.slideSize(0);i=o&&pe(G(a.track)[l("width")]/o)||n[l("autoWidth")]&&e.length||2*n.perPage}}else i=0;return i}return{mount:c,destroy:p}},Move:function(e,t,n){var i,o=Ke(e),s=o.on,a=o.emit,r=e.state.set,l=t.Layout,d=l.slideSize,c=l.getPadding,u=l.totalSize,p=l.listSize,h=l.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,v=t.Elements,y=v.list,b=v.track;function x(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function w(e){_(k(e,!0))}function _(n,i){if(!e.is(Wt)){var o=i?n:function(n){if(e.is(Xt)){var i=C(n),o=i>t.Controller.getEnd();(i<0||o)&&(n=E(n,o))}return n}(n);K(y,"transform","translate"+m("X")+"("+o+"px)"),n!==o&&a(Ve)}}function E(e,t){var n=e-S(t),i=h();return e-=g(i*(pe(he(n)/i)||1))*(t?1:-1)}function q(){_(A(),!0),i.cancel()}function C(e){for(var n=t.Slides.get(),i=0,o=1/0,s=0;s<n.length;s++){var a=n[s].index,r=he(k(a,!0)-e);if(!(r<=o))break;o=r,i=a}return i}function k(t,i){var o=g(u(t-1)-function(e){var t=n.focus;return"center"===t?(p()-d(e,!0))/2:+t*d(e)||0}(t));return i?function(t){n.trimSpace&&e.is(Kt)&&(t=ge(t,0,g(h(!0)-p())));return t}(o):o}function A(){var e=m("left");return G(y)[e]-G(b)[e]+g(c(!1))}function S(e){return k(e?t.Controller.getEnd():0,!!n.trimSpace)}return{mount:function(){i=t.Transition,s([_e,Te,Pe,Me],x)},move:function(e,t,n,o){var s,l;e!==t&&(s=e>n,l=g(E(A(),s)),s?l>=0:l<=y[m("scrollWidth")]-G(b)[m("width")])&&(q(),_(E(A(),e>n),!0)),r(4),a(je,t,n,e),i.start(t,function(){r(3),a(qe,t,n,e),o&&o()})},jump:w,translate:_,shift:E,cancel:q,toIndex:C,toPosition:k,getPosition:A,getLimit:S,exceededLimit:function(e,t){t=j(t)?A():t;var n=!0!==e&&g(t)<g(S(!1)),i=!1!==e&&g(t)>g(S(!0));return n||i},reposition:x}},Controller:function(e,t,n){var i,o,s,a,r=Ke(e),l=r.on,d=r.emit,c=t.Move,u=c.getPosition,p=c.getLimit,h=c.toPosition,f=t.Slides,g=f.isEnough,v=f.getLength,y=n.omitEnd,b=e.is(Xt),x=e.is(Kt),w=m(S,!1),_=m(S,!0),q=n.start||0,C=q;function k(){o=v(!0),s=n.perMove,a=n.perPage,i=P();var e=ge(q,0,y?i:o-1);e!==q&&(q=e,c.reposition())}function A(){i!==P()&&d($e)}function S(e,t){var n=s||(D()?1:a),o=L(q+n*(e?-1:1),q,!(s||D()));return-1===o&&x&&!fe(u(),p(!e),1)?e?0:i:t?o:M(o)}function L(t,r,l){if(g()||D()){var d=function(t){if(x&&"move"===n.trimSpace&&t!==q)for(var i=u();i===h(t,!0)&&me(t,0,e.length-1,!n.rewind);)t<q?--t:++t;return t}(t);d!==t&&(r=t,t=d,l=!1),t<0||t>i?t=s||!me(0,t,r,!0)&&!me(i,r,t,!0)?b?l?t<0?-(o%a||a):o:t:n.rewind?t<0?i:0:-1:I(T(t)):l&&t!==r&&(t=I(T(r)+(t<r?-1:1)))}else t=-1;return t}function M(e){return b?(e+o)%o||0:e}function P(){for(var e=o-(D()||b&&s?1:a);y&&e-- >0;)if(h(o-1,!0)!==h(e,!0)){e++;break}return ge(e,0,o-1)}function I(e){return ge(D()?e:a*e,0,i)}function T(e){return D()?de(e,i):ue((e>=i?o-1:e)/a)}function z(e){e!==q&&(C=q,q=e)}function D(){return!j(n.focus)||n.isNavigation}function B(){return e.state.is([4,5])&&!!n.waitForTransition}return{mount:function(){k(),l([Pe,Me,$e],k),l(Te,A)},go:function(e,t,n){if(!B()){var o=function(e){var t=q;if(E(e)){var n=e.match(/([+\-<>])(\d+)?/)||[],o=n[1],s=n[2];"+"===o||"-"===o?t=L(q+ +(""+o+(+s||1)),q):">"===o?t=s?I(+s):w(!0):"<"===o&&(t=_(!0))}else t=b?e:ge(e,0,i);return t}(e),s=M(o);s>-1&&(t||s!==q)&&(z(s),c.move(o,s,C,n))}},scroll:function(e,n,o,s){t.Scroll.scroll(e,n,o,function(){var e=M(c.toIndex(u()));z(y?de(e,i):e),s&&s()})},getNext:w,getPrev:_,getAdjacent:S,getEnd:P,setIndex:z,getIndex:function(e){return e?C:q},toIndex:I,toPage:T,toDest:function(e){var t=c.toIndex(e);return x?ge(t,0,i):t},hasFocus:D,isBusy:B}},Arrows:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.bind,l=s.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,h=u.arrows,f=u.track,g=h,v=u.prev,y=u.next,b={};function x(){!function(){var e=n.arrows;!e||v&&y||(g=h||$("div",d.arrows),v=j(!0),y=j(!1),i=!0,I(g,[v,y]),!h&&T(g,f));v&&y&&(U(b,{prev:v,next:y}),X(g,e?"":"none"),P(g,o=jt+"--"+n.direction),e&&(a([_e,qe,Me,De,$e],q),r(y,"click",m(E,">")),r(v,"click",m(E,"<")),q(),V([v,y],ot,f.id),l(Ne,v,y)))}(),a(Pe,w)}function w(){_(),x()}function _(){s.destroy(),ie(g,o),i?(Y(h?[v,y]:g),v=y=null):O([v,y],mt)}function E(e){p.go(e,!0)}function j(e){return Q('<button class="'+d.arrow+" "+(e?d.prev:d.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(n.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function q(){if(v&&y){var t=e.index,n=p.getPrev(),i=p.getNext(),o=n>-1&&t<n?c.last:c.prev,s=i>-1&&t>i?c.first:c.next;v.disabled=n<0,y.disabled=i<0,V(v,rt,o),V(y,rt,s),l("arrows:updated",v,y,n,i)}}return{arrows:b,mount:x,destroy:_,update:q}},Autoplay:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.bind,l=s.emit,d=Xe(n.interval,e.go.bind(e,">"),function(e){var t=u.bar;t&&K(t,"width",100*e+"%"),l("autoplay:playing",e)}),c=d.isPaused,u=t.Elements,p=t.Elements,h=p.root,f=p.toggle,m=n.autoplay,g="pause"===m;function v(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),o=i=g=!1,x(),l(Ue))}function y(e){void 0===e&&(e=!0),g=!!e,x(),c()||(d.pause(),l(He))}function b(){g||(i||o?y(!1):v())}function x(){f&&(M(f,Tt,!g),V(f,rt,n.i18n[g?"play":"pause"]))}function w(e){var i=t.Slides.getAt(e);d.set(i&&+J(i.slide,Zt)||n.interval)}return{mount:function(){m&&(!function(){n.pauseOnHover&&r(h,"mouseenter mouseleave",function(e){i="mouseenter"===e.type,b()});n.pauseOnFocus&&r(h,"focusin focusout",function(e){o="focusin"===e.type,b()});f&&r(f,"click",function(){g?v():y(!0)});a([je,ze,Me],d.rewind),a(je,w)}(),f&&V(f,ot,u.track.id),g||v(),x())},destroy:d.cancel,play:v,pause:y,isPaused:c}},Cover:function(e,t,n){var i=Ke(e).on;function o(e){t.Slides.forEach(function(t){var n=B(t.container||t.slide,"img");n&&n.src&&s(e,n,t)})}function s(e,t,n){n.style("background",e?'center/cover no-repeat url("'+t.src+'")':"",!0),X(t,e?"none":"")}return{mount:function(){n.cover&&(i(Re,m(s,!0)),i([_e,Pe,Me],m(o,!0)))},destroy:m(o,!1)}},Scroll:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,h=d.translate,f=e.is(Kt),g=1;function v(e,n,s,a,u){var h=c();if(x(),s&&(!f||!p())){var v=t.Layout.sliderSize(),w=ve(e)*v*ue(he(e)/v)||0;e=d.toPosition(t.Controller.toDest(e%v))+w}var _=fe(h,e,1);g=1,n=_?0:n||ce(he(e-h)/1.5,800),o=a,i=Xe(n,y,m(b,h,e,u),1),l(5),r(ze),i.start()}function y(){l(3),o&&o(),r(De)}function b(e,t,i,s){var a,r,l=c(),d=(e+(t-e)*(a=s,(r=n.easingFunc)?r(a):1-Math.pow(1-a,4))-l)*g;h(l+d),f&&!i&&p()&&(g*=.6,he(d)<10&&v(u(p(!0)),600,!1,o,!0))}function x(){i&&i.cancel()}function w(){i&&!i.isPaused()&&(x(),y())}return{mount:function(){a(je,x),a([Pe,Me],w)},destroy:x,scroll:v,cancel:w}},Drag:function(e,t,n){var i,o,s,a,r,l,d,c,u=Ke(e),p=u.on,h=u.emit,f=u.bind,m=u.unbind,g=e.state,y=t.Move,b=t.Scroll,w=t.Controller,_=t.Elements.track,E=t.Media.reduce,j=t.Direction,q=j.resolve,C=j.orient,k=y.getPosition,A=y.exceededLimit,S=!1;function L(){var e=n.drag;R(!e),a="free"===e}function M(e){if(l=!1,!d){var t=H(e);i=e.target,o=n.noDrag,z(i,"."+St+", ."+qt)||o&&z(i,o)||!t&&e.button||(w.isBusy()?ee(e,!0):(c=t?_:window,r=g.is([4,5]),s=null,f(c,Vt,P,Gt),f(c,$t,I,Gt),y.cancel(),b.cancel(),D(e)))}var i,o}function P(t){if(g.is(6)||(g.set(6),h("drag")),t.cancelable)if(r){y.translate(i+B(t)/(S&&e.is(Kt)?5:1));var o=N(t)>200,s=S!==(S=A());(o||s)&&D(t),l=!0,h("dragging"),ee(t)}else(function(e){return he(B(e))>he(B(e,!0))})(t)&&(r=function(e){var t=n.dragMinThreshold,i=x(t),o=i&&t.mouse||0,s=(i?t.touch:+t)||10;return he(B(e))>(H(e)?s:o)}(t),ee(t))}function I(i){g.is(6)&&(g.set(3),h("dragged")),r&&(!function(i){var o=function(t){if(e.is(Xt)||!S){var n=N(t);if(n&&n<200)return B(t)/n}return 0}(i),s=function(e){return k()+ve(e)*de(he(e)*(n.flickPower||600),a?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}(o),r=n.rewind&&n.rewindByDrag;E(!1),a?w.scroll(s,0,n.snap):e.is(Wt)?w.go(C(ve(o))<0?r?"<":"-":r?">":"+"):e.is(Kt)&&S&&r?w.go(A(!0)?">":"<"):w.go(w.toDest(s),!0);E(!0)}(i),ee(i)),m(c,Vt,P),m(c,$t,I),r=!1}function T(e){!d&&l&&ee(e,!0)}function D(e){s=o,o=e,i=k()}function B(e,t){return U(e,t)-U(F(e),t)}function N(e){return oe(e)-oe(F(e))}function F(e){return o===e&&s||o}function U(e,t){return(H(e)?e.changedTouches[0]:e)["page"+q(t?"Y":"X")]}function H(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function R(e){d=e}return{mount:function(){f(_,Vt,v,Gt),f(_,$t,v,Gt),f(_,Ot,M,Gt),f(_,"click",T,{capture:!0}),f(_,"dragstart",ee),p([_e,Pe],L)},disable:R,isDragging:function(){return r}}},Keyboard:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.bind,l=s.unbind,d=e.root,c=t.Direction.resolve;function u(){var e=n.keyboard;e&&(i="global"===e?window:d,r(i,en,f))}function p(){l(i,en)}function h(){var e=o;o=!0,g(function(){o=e})}function f(t){if(!o){var n=Qt(t);n===c(Je)?e.go("<"):n===c(Ze)&&e.go(">")}}return{mount:function(){u(),a(Pe,p),a(Pe,u),a(je,h)},destroy:p,disable:function(e){o=e}}},LazyLoad:function(e,t,n){var i=Ke(e),o=i.on,s=i.off,a=i.bind,r=i.emit,l="sequential"===n.lazyLoad,d=[qe,De],c=[];function u(){h(c),t.Slides.forEach(function(e){ne(e.slide,on).forEach(function(t){var i=J(t,tn),o=J(t,nn);if(i!==t.src||o!==t.srcset){var s=n.classes.spinner,a=t.parentElement,r=B(a,"."+s)||$("span",s,a);c.push([t,e,r]),t.src||X(t,"none")}})}),l?v():(s(d),o(d,p),p())}function p(){(c=c.filter(function(t){var i=n.perPage*((n.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,i)||f(t)})).length||s(d)}function f(e){var t=e[0];P(e[1].slide,Nt),a(t,"load error",m(g,e)),V(t,"src",J(t,tn)),V(t,"srcset",J(t,nn)),O(t,tn),O(t,nn)}function g(e,t){var n=e[0],i=e[1];ie(i.slide,Nt),"error"!==t.type&&(Y(e[2]),X(n,""),r(Re,n,i),r(Ie)),l&&v()}function v(){c.length&&f(c.shift())}return{mount:function(){n.lazyLoad&&(u(),o(Me,u))},destroy:m(h,c),check:p}},Pagination:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.emit,l=s.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,g=u.getIndex,v=u.go,y=t.Direction.resolve,b=c.pagination,x=[];function w(){i&&(Y(b?f(i.children):i),ie(i,o),h(x),i=null),s.destroy()}function _(e){v(">"+e,!0)}function E(e,t){var n=x.length,i=Qt(t),o=j(),s=-1;i===y(Ze,!1,o)?s=++e%n:i===y(Je,!1,o)?s=(--e+n)%n:"Home"===i?s=0:"End"===i&&(s=n-1);var a=x[s];a&&(W(a.button),v(">"+s),ee(t,!0))}function j(){return n.paginationDirection||n.direction}function q(e){return x[u.toPage(e)]}function C(){var e=q(g(!0)),t=q(g());if(e){var n=e.button;ie(n,Tt),O(n,at),V(n,nt,-1)}if(t){var o=t.button;P(o,Tt),V(o,at,!0),V(o,nt,"")}r("pagination:updated",{list:i,items:x},e,t)}return{items:x,mount:function t(){w(),a([Pe,Me,$e],t);var s=n.pagination;b&&X(b,s?"":"none"),s&&(a([je,ze,De],C),function(){var t=e.length,s=n.classes,a=n.i18n,r=n.perPage,h=p()?u.getEnd()+1:pe(t/r);P(i=b||$("ul",s.pagination,c.track.parentElement),o=At+"--"+j()),V(i,tt,"tablist"),V(i,rt,a.select),V(i,ct,j()===Qe?"vertical":"");for(var f=0;f<h;f++){var g=$("li",null,i),v=$("button",{class:s.page,type:"button"},g),y=d.getIn(f).map(function(e){return e.slide.id}),w=!p()&&r>1?a.pageX:a.slideX;l(v,"click",m(_,f)),n.paginationKeyboard&&l(v,"keydown",m(E,f)),V(g,tt,"presentation"),V(v,tt,"tab"),V(v,ot,y.join(" ")),V(v,rt,ye(w,f+1)),V(v,nt,-1),x.push({li:g,button:v,page:f})}}(),C(),r("pagination:mounted",{list:i,items:x},q(e.index)))},destroy:w,getAt:q,update:C}},Sync:function(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function a(){var t,n;e.splides.forEach(function(t){t.isParent||(l(e,t.splide),l(t.splide,e))}),i&&(t=Ke(e),(n=t.on)(Ce,c),n(Oe,u),n([_e,Pe],d),s.push(t),t.emit(Fe,e.splides))}function r(){s.forEach(function(e){e.destroy()}),h(s)}function l(e,t){var n=Ke(e);n.on(je,function(e,n,i){t.go(t.is(Xt)?i:e)}),s.push(n)}function d(){V(t.Elements.list,ct,n.direction===Qe?"vertical":"")}function c(t){e.go(t.index)}function u(e,t){S(sn,Qt(t))&&(c(e),ee(t))}return{setup:m(t.Media.set,{slideFocus:j(o)?i:o},!0),mount:a,destroy:r,remount:function(){r(),a()}}},Wheel:function(e,t,n){var i=Ke(e).bind,o=0;function s(i){if(i.cancelable){var s=i.deltaY,a=s<0,r=oe(i),l=n.wheelMinThreshold||0,d=n.wheelSleep||0;he(s)>l&&r-o>d&&(e.go(a?"<":">"),o=r),function(i){return!n.releaseWheel||e.state.is(4)||-1!==t.Controller.getAdjacent(i)}(a)&&ee(i)}}return{mount:function(){n.wheel&&i(t.Elements.track,"wheel",s,Gt)}}},Live:function(e,t,n){var i=Ke(e).on,o=t.Elements.track,s=n.live&&!n.isNavigation,a=$("span",Pt),r=Xe(90,m(l,!1));function l(e){V(o,ht,e),e?(I(o,a),r.start()):(Y(a),r.cancel())}function d(e){s&&V(o,pt,e?"off":"polite")}return{mount:function(){s&&(d(!t.Autoplay.isPaused()),V(o,ft,!0),a.textContent="…",i(Ue,m(d,!0)),i(He,m(d,!1)),i([qe,De],m(l,!0)))},disable:d,destroy:function(){O(o,[pt,ft,ht]),Y(a)}}}}),rn={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Rt,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ln(e,t,n){var i=t.Slides;function o(){i.forEach(function(e){e.style("transform","translateX(-"+100*e.index+"%)")})}return{mount:function(){Ke(e).on([_e,Me],o)},start:function(e,t){i.style("transition","opacity "+n.speed+"ms "+n.easing),g(t)},cancel:v}}function dn(e,t,n){var i,o=t.Move,s=t.Controller,a=t.Scroll,r=t.Elements.list,l=m(K,r,"transition");function d(){l(""),a.cancel()}return{mount:function(){Ke(e).bind(r,"transitionend",function(e){e.target===r&&i&&(d(),i())})},start:function(t,r){var d=o.toPosition(t,!0),c=o.getPosition(),u=function(t){var i=n.rewindSpeed;if(e.is(Kt)&&i){var o=s.getIndex(!0),a=s.getEnd();if(0===o&&t>=a||o>=a&&0===t)return i}return n.speed}(t);he(d-c)>=1&&u>=1?n.useScroll?a.scroll(d,u,!1,r):(l("transform "+u+"ms "+n.easing),o.translate(d,!0),i=r):(o.jump(t),r())},cancel:d}}var cn=function(){function e(t,n){var i;this.event=Ke(),this.Components={},this.state=(i=1,{set:function(e){i=e},is:function(e){return S(k(e),i)}}),this.splides=[],this._o={},this._E={};var o=E(t)?te(document,t):t;le(o,o+" is invalid."),this.root=o,n=H({label:J(o,rt)||"",labelledby:J(o,lt)||""},rn,e.defaults,n||{});try{H(n,JSON.parse(J(o,re)))}catch(e){le(!1,"Invalid JSON")}this._o=Object.create(H({},n))}var t=e.prototype;return t.mount=function(e,t){var n=this,i=this.state,o=this.Components;return le(i.is([1,7]),"Already mounted!"),i.set(1),this._C=o,this._T=t||this._T||(this.is(Wt)?ln:dn),this._E=e||this._E,F(U({},an,this._E,{Transition:this._T}),function(e,t){var i=e(n,o,n._o);o[t]=i,i.setup&&i.setup()}),F(o,function(e){e.mount&&e.mount()}),this.emit(_e),P(this.root,It),i.set(3),this.emit(Ee),this},t.sync=function(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),e.Components.Sync.remount()),this},t.go=function(e){return this._C.Controller.go(e),this},t.on=function(e,t){return this.event.on(e,t),this},t.off=function(e){return this.event.off(e),this},t.emit=function(e){var t;return(t=this.event).emit.apply(t,[e].concat(f(arguments,1))),this},t.add=function(e,t){return this._C.Slides.add(e,t),this},t.remove=function(e){return this._C.Slides.remove(e),this},t.is=function(e){return this._o.type===e},t.refresh=function(){return this.emit(Me),this},t.destroy=function(e){void 0===e&&(e=!0);var t=this.event,n=this.state;return n.is(1)?Ke(this).on(Ee,this.destroy.bind(this,e)):(F(this._C,function(t){t.destroy&&t.destroy(e)},!0),t.emit(Be),t.destroy(),e&&h(this.splides),n.set(7)),this},c(e,[{key:"options",get:function(){return this._o},set:function(e){this._C.Media.set(e,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e}(),un=cn;un.defaults={},un.STATES=p,function(){if("undefined"!=typeof document){const e="jaaq-styles-splide.min";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0}",document.head.appendChild(t)}}}();const pn=new WeakMap,hn=[];function fn(e){if(pn.has(e))return pn.get(e);const t=function(e){const t=e.getAttribute("data-api-key"),n=e.getAttribute("data-client-id"),i=e.getAttribute("data-video-id");if(!t||!n||!i)return console.error("JAAQ Player: Missing required attributes (data-api-key, data-client-id, data-video-id)",e),null;const o={apiKey:t,clientId:n,videoId:i},s=e.getAttribute("data-autoplay");null!==s&&(o.autoplay="true"===s);const a=e.getAttribute("data-width");a&&(o.width=a);const r=e.getAttribute("data-height");r&&(o.height=r);const l=e.getAttribute("data-base-url");l&&(o.baseUrl=l);const d=e.getAttribute("data-class-name");return d&&(o.className=d),o}(e);if(!t)return null;try{const n=new d(e,t);return pn.set(e,n),hn.push({element:e,player:n}),n}catch(t){return console.error("JAAQ Player: Failed to initialize player",t,e),null}}function mn(e=document){e.querySelectorAll("[data-jaaq-player]").forEach(e=>{fn(e)})}const gn={init:mn,getPlayer:function(e){let t;if("string"==typeof e){if(t=document.querySelector(e),!t)return console.error("JAAQ Player: Element not found for selector",e),null}else t=e;return pn.get(t)||null},destroyAll:function(){hn.forEach(({element:e,player:t})=>{try{t.destroy(),pn.delete(e)}catch(e){console.error("JAAQ Player: Error destroying player",e)}}),hn.length=0}};"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mn()}):mn());class vn extends HTMLElement{static get observedAttributes(){return["video-id","api-key","client-id","autoplay","base-url","width","height","controls","show-logo","show-title","show-author","show-description","show-captions","start-muted"]}constructor(){super(),this.player=null,this.container=null,this.clientInstance=null,this.connected=!1,this.attachShadow({mode:"open"})}connectedCallback(){this.connected=!0,this.render(),this.initPlayer()}disconnectedCallback(){this.connected=!1,this.destroyPlayer()}attributeChangedCallback(e,t,n){if(this.connected&&t!==n)if("video-id"===e&&this.player)this.destroyPlayer(),this.initPlayer();else if("width"===e||"height"===e)this.updateContainerStyles();else if(("controls"===e||"show-logo"===e||"show-title"===e||"show-author"===e||"show-description"===e||"show-captions"===e||"start-muted"===e)&&this.player){const t={};"controls"===e?t.controls=!this.hasAttribute("controls")||"false"!==this.getAttribute("controls"):"show-logo"===e?t.showLogo=!this.hasAttribute("show-logo")||"false"!==this.getAttribute("show-logo"):"show-title"===e?t.showTitle=!this.hasAttribute("show-title")||"false"!==this.getAttribute("show-title"):"show-author"===e?t.showAuthor=!this.hasAttribute("show-author")||"false"!==this.getAttribute("show-author"):"show-description"===e?t.showDescription=!this.hasAttribute("show-description")||"false"!==this.getAttribute("show-description"):"show-captions"===e?t.showCaptions=!this.hasAttribute("show-captions")||"false"!==this.getAttribute("show-captions"):"start-muted"===e&&(t.startMuted=this.hasAttribute("start-muted")&&"false"!==this.getAttribute("start-muted")),this.player.setFeatures(t)}}render(){if(!this.shadowRoot)return;const e=document.createElement("style");e.textContent=`\n ${l}\n .jaaq-vanilla-player {\n user-select: none;\n}\n\n.jaaq-vanilla-player video {\n outline: none;\n}\n\n.jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: #007bff;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n\n \n:host {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n `,this.container=document.createElement("div"),this.container.className="jaaq-webcomponent-container",this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.container),this.updateContainerStyles()}updateContainerStyles(){if(!this.container)return;const e=this.getAttribute("width")||"100%",t=this.getAttribute("height")||"auto";this.container.style.width=e,this.container.style.height=t}async initPlayer(){if(!this.container||this.player)return;const e=this.getAttribute("video-id");if(!e)return void this.emitError(new Error("video-id attribute is required"));const t=this.getAttribute("api-key"),n=this.getAttribute("client-id"),i=this.getAttribute("base-url")||void 0,o=this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay"),s=!this.hasAttribute("controls")||"false"!==this.getAttribute("controls"),a=!this.hasAttribute("show-logo")||"false"!==this.getAttribute("show-logo"),r=!this.hasAttribute("show-title")||"false"!==this.getAttribute("show-title"),l=!this.hasAttribute("show-author")||"false"!==this.getAttribute("show-author"),c=!this.hasAttribute("show-description")||"false"!==this.getAttribute("show-description"),u=!this.hasAttribute("show-captions")||"false"!==this.getAttribute("show-captions"),p=this.hasAttribute("start-muted")&&"false"!==this.getAttribute("start-muted");if(this.clientInstance||t||n)try{this.player=new d(this.container,{videoId:e??void 0,apiKey:t??void 0,clientId:n??void 0,client:this.clientInstance||void 0,baseUrl:i,autoplay:o,controls:s,showLogo:a,showTitle:r,showAuthor:l,showDescription:c,showCaptions:u,startMuted:p}),this.attachPlayerEvents()}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to initialize player"))}else this.emitError(new Error("Either client property or api-key and client-id attributes are required"))}attachPlayerEvents(){this.player&&(this.player.on("loaded",e=>{this.dispatchEvent(new CustomEvent("jaaq:loaded",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("play",()=>{this.dispatchEvent(new CustomEvent("jaaq:play",{bubbles:!0,composed:!0}))}),this.player.on("pause",()=>{this.dispatchEvent(new CustomEvent("jaaq:pause",{bubbles:!0,composed:!0}))}),this.player.on("timeupdate",e=>{this.dispatchEvent(new CustomEvent("jaaq:timeupdate",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("volumechange",e=>{this.dispatchEvent(new CustomEvent("jaaq:volumechange",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("ended",()=>{this.dispatchEvent(new CustomEvent("jaaq:ended",{bubbles:!0,composed:!0}))}),this.player.on("error",e=>{this.emitError(e)}),this.player.on("fullscreenchange",e=>{this.dispatchEvent(new CustomEvent("jaaq:fullscreenchange",{detail:e,bubbles:!0,composed:!0}))}))}emitError(e){this.dispatchEvent(new CustomEvent("jaaq:error",{detail:e,bubbles:!0,composed:!0}))}destroyPlayer(){this.player&&(this.player.destroy(),this.player=null)}get client(){return this.clientInstance}set client(e){this.clientInstance=e,this.connected&&(this.destroyPlayer(),this.initPlayer())}get videoId(){return this.getAttribute("video-id")}set videoId(e){e?this.setAttribute("video-id",e):this.removeAttribute("video-id")}play(){this.player?.play()}pause(){this.player?.pause()}setVolume(e){this.player?.setVolume(e)}toggleMute(){this.player?.toggleMute()}seek(e){this.player?.seek(e)}getState(){return this.player?.getState()||null}destroy(){this.destroyPlayer()}}!function(){if("undefined"!=typeof document){const e="jaaq-styles-CollectionPlayer";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: white;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n",document.head.appendChild(t)}}}();class yn extends HTMLElement{static get observedAttributes(){return["collection-id","api-key","client-id","subscription-id","base-url","autoplay","show-arrows","show-dots","video-settings"]}constructor(){super(),this.splide=null,this.container=null,this.carouselElement=null,this.clientInstance=null,this.connected=!1,this.collectionData=null,this.autoplayTimeoutId=null,this.attachShadow({mode:"open"})}connectedCallback(){this.connected=!0,this.render(),this.initCarousel()}disconnectedCallback(){this.connected=!1,this.destroyCarousel()}attributeChangedCallback(e,t,n){this.connected&&t!==n&&("collection-id"!==e&&"video-settings"!==e||(this.destroyCarousel(),this.initCarousel()),"show-arrows"!==e&&"show-dots"!==e||(this.destroyCarousel(),this.initCarousel()))}getBooleanAttr(e,t){const n=this.getAttribute(e);return null===n?t:"false"!==n}render(){if(!this.shadowRoot)return;const e=document.createElement("style");e.textContent=`\n ${l}\n .jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: white;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n\n .splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0}\n \n:host {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n `,this.container=document.createElement("div"),this.container.className="jaaq-collection-player",this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.container)}async initCarousel(){if(!this.container)return;const e=this.getAttribute("collection-id");if(!e)return void this.emitError(new Error("collection-id attribute is required"));const t=this.getAttribute("api-key"),n=this.getAttribute("client-id"),s=this.getAttribute("base-url")||void 0;if(this.clientInstance||t||n){this.showLoading();try{const a=this.clientInstance||o.init({apiKey:t,clientId:n,baseUrl:s||i});if(this.collectionData=await a.collections.getById(e),!this.collectionData.videos||0===this.collectionData.videos.length)return void this.emitError(new Error("No videos found in collection"));this.renderCarousel(),this.initSplide(),this.dispatchEvent(new CustomEvent("jaaq:collection:loaded",{detail:this.collectionData,bubbles:!0,composed:!0}))}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to load collection"))}}else this.emitError(new Error("Either client property or api-key and client-id attributes are required"))}showLoading(){this.container&&(this.container.innerHTML='\n <div class="jaaq-collection-loading">\n <div class="jaaq-collection-spinner"></div>\n </div>\n ')}renderCarousel(){if(!this.container||!this.collectionData)return;this.container.innerHTML="",this.carouselElement=document.createElement("div"),this.carouselElement.className="splide jaaq-collection-carousel";const e=document.createElement("div");e.className="splide__track";const t=document.createElement("ul");t.className="splide__list";const n=this.getAttribute("api-key"),i=this.getAttribute("client-id"),o=this.getAttribute("base-url"),s=this.getAttribute("video-settings");let a=null;if(s)try{a=JSON.parse(s)}catch(e){console.warn("[CollectionPlayer] Failed to parse video-settings attribute",e)}this.collectionData.videos.forEach(e=>{const s=document.createElement("li");s.className="splide__slide";const r=document.createElement("jaaq-video-player");r.setAttribute("video-id",e.videoId),n&&r.setAttribute("api-key",n),i&&r.setAttribute("client-id",i),o&&r.setAttribute("base-url",o),r.setAttribute("autoplay","false"),r.setAttribute("width","100%"),a&&(void 0!==a.controls&&r.setAttribute("controls",String(a.controls)),void 0!==a.showLogo&&r.setAttribute("show-logo",String(a.showLogo)),void 0!==a.showTitle&&r.setAttribute("show-title",String(a.showTitle)),void 0!==a.showAuthor&&r.setAttribute("show-author",String(a.showAuthor)),void 0!==a.showDescription&&r.setAttribute("show-description",String(a.showDescription)),void 0!==a.showCaptions&&r.setAttribute("show-captions",String(a.showCaptions)),void 0!==a.startMuted&&r.setAttribute("start-muted",String(a.startMuted)),void 0!==a.width&&r.setAttribute("width",String(a.width)),void 0!==a.height&&r.setAttribute("height",String(a.height))),s.appendChild(r),t.appendChild(s)}),e.appendChild(t),this.carouselElement.appendChild(e),this.container.appendChild(this.carouselElement)}initSplide(){if(!this.carouselElement)return;const e=this.getBooleanAttr("show-arrows",!0),t=this.getBooleanAttr("show-dots",!0);this.splide=new un(this.carouselElement,{type:"loop",perPage:3,focus:"center",gap:"0.5rem",perMove:1,autoHeight:!0,updateOnMove:!0,padding:"5 rem",breakpoints:{768:{perPage:1},1024:{perPage:2}},arrows:e,pagination:t,autoplay:!1}),this.splide.on("moved",e=>{console.log("[CollectionPlayer] Splide moved event",{newIndex:e,splideIndex:this.splide?.index,Components:this.splide?.Components}),this.handleSlideChange(e),this.dispatchEvent(new CustomEvent("jaaq:collection:slidechange",{detail:{index:e,video:this.collectionData?.videos[e]},bubbles:!0,composed:!0}))}),this.splide.mount(),console.log("[CollectionPlayer] After mount",{splideIndex:this.splide.index,length:this.splide.length}),setTimeout(()=>{this.splide&&(console.log("[CollectionPlayer] Initial handleSlideChange after DOM update"),this.handleSlideChange(this.splide.index))},100)}handleSlideChange(e){if(!this.carouselElement)return;const t=this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay");console.log("[CollectionPlayer] handleSlideChange called",{activeIndex:e,isAutoplayEnabled:t}),null!==this.autoplayTimeoutId&&(console.log("[CollectionPlayer] Clearing existing autoplay timeout",{timeoutId:this.autoplayTimeoutId}),clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null);const n=this.carouselElement.querySelector(".splide__slide.is-active:not(.splide__slide--clone)"),i=n?.querySelector("jaaq-video-player"),o=i?.getAttribute("video-id");console.log("[CollectionPlayer] Active slide from DOM:",{activeIndex:e,activeVideoId:o,foundActiveSlide:!!n});const s=this.carouselElement.querySelectorAll(".splide__slide:not(.splide__slide--clone)");Array.from(s).map((e,t)=>{const n=e.querySelector("jaaq-video-player");return{index:t,videoId:n?.getAttribute("video-id")||"unknown",isActive:e.classList.contains("is-active")}}),s.forEach((e,n)=>{const i=e.querySelector("jaaq-video-player");if(!i)return;const o=i.getAttribute("video-id");e.classList.contains("is-active")?t&&(this.autoplayTimeoutId=window.setTimeout(()=>{console.log("[CollectionPlayer] 1s delay complete, playing video",{index:n,videoId:o}),i.play?.()},1e3)):i.pause?.()})}destroyCarousel(){null!==this.autoplayTimeoutId&&(clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null),this.splide&&(this.splide.destroy(),this.splide=null),this.container&&(this.container.innerHTML=""),this.collectionData=null}emitError(e){this.container&&(this.container.innerHTML=`\n <div class="jaaq-collection-error">\n ${e.message}\n </div>\n `),this.dispatchEvent(new CustomEvent("jaaq:collection:error",{detail:e,bubbles:!0,composed:!0}))}get client(){return this.clientInstance}set client(e){this.clientInstance=e,this.connected&&(this.destroyCarousel(),this.initCarousel())}get collectionId(){return this.getAttribute("collection-id")}set collectionId(e){e?this.setAttribute("collection-id",e):this.removeAttribute("collection-id")}refresh(){this.destroyCarousel(),this.initCarousel()}next(){this.splide?.go("+1")}prev(){this.splide?.go("-1")}go(e){this.splide?.go(e)}destroy(){this.destroyCarousel()}getCollection(){return this.collectionData}}const bn="jaaq-video-player",xn="jaaq-collection-player";function wn(){"undefined"!=typeof window&&"undefined"!=typeof customElements?(customElements.get(bn)||customElements.define(bn,vn),customElements.get(xn)||customElements.define(xn,yn)):console.warn("Custom Elements API is not available. Web components cannot be registered.")}"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{wn()}):wn()),e.JaaqCollectionPlayer=class{constructor(e,t){if(this.client=null,this.splide=null,this.playerElement=null,this.carouselElement=null,this.collectionData=null,this.autoplayTimeoutId=null,this.listeners=new Map,this.container="string"==typeof e?document.querySelector(e):e,!this.container)throw new Error("Container element not found");if(this.config={autoplay:!1,showArrows:!0,showDots:!0,...t},t.client)this.client=t.client;else{if(!t.apiKey||!t.clientId)throw new Error("Either client property or apiKey and clientId are required");this.client=s({apiKey:t.apiKey,clientId:t.clientId,baseUrl:t.baseUrl||i})}this.init()}async init(){this.render(),await this.initCarousel()}render(){this.container.innerHTML="",this.playerElement=document.createElement("div"),this.playerElement.className=`jaaq-collection-player ${this.config.className||""}`,this.container.appendChild(this.playerElement)}async initCarousel(){if(!this.playerElement)return;const e=this.config.collectionId;if(e){this.showLoading();try{if(!this.client)throw new Error("Client is not initialized");if(this.collectionData=await this.client.collections.getById(e),!this.collectionData.videos||0===this.collectionData.videos.length)return void this.emitError(new Error("No videos found in collection"));this.renderCarousel(),this.initSplide(),this.emit("loaded",this.collectionData)}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to load collection"))}}else this.emitError(new Error("collectionId is required"))}showLoading(){this.playerElement&&(this.playerElement.innerHTML='\n <div class="jaaq-collection-loading">\n <div class="jaaq-collection-spinner"></div>\n </div>\n ')}renderCarousel(){if(!this.playerElement||!this.collectionData)return;this.playerElement.innerHTML="",this.carouselElement=document.createElement("div"),this.carouselElement.className="splide jaaq-collection-carousel";const e=document.createElement("div");e.className="splide__track";const t=document.createElement("ul");t.className="splide__list",this.collectionData.videos.forEach(e=>{const n=document.createElement("li");n.className="splide__slide";const i=document.createElement("jaaq-video-player");if(i.setAttribute("video-id",e.videoId),this.config.apiKey&&i.setAttribute("api-key",this.config.apiKey),this.config.clientId&&i.setAttribute("client-id",this.config.clientId),this.config.baseUrl&&i.setAttribute("base-url",this.config.baseUrl),i.setAttribute("autoplay","false"),i.setAttribute("width","100%"),this.config.videoSettings){const e=this.config.videoSettings;void 0!==e.controls&&i.setAttribute("controls",String(e.controls)),void 0!==e.showLogo&&i.setAttribute("show-logo",String(e.showLogo)),void 0!==e.showTitle&&i.setAttribute("show-title",String(e.showTitle)),void 0!==e.showAuthor&&i.setAttribute("show-author",String(e.showAuthor)),void 0!==e.showDescription&&i.setAttribute("show-description",String(e.showDescription)),void 0!==e.showCaptions&&i.setAttribute("show-captions",String(e.showCaptions)),void 0!==e.startMuted&&i.setAttribute("start-muted",String(e.startMuted)),void 0!==e.width&&i.setAttribute("width",String(e.width)),void 0!==e.height&&i.setAttribute("height",String(e.height))}this.client&&void 0!==i.client&&(i.client=this.client),n.appendChild(i),t.appendChild(n)}),e.appendChild(t),this.carouselElement.appendChild(e),this.playerElement.appendChild(this.carouselElement)}initSplide(){this.carouselElement&&(this.splide=new un(this.carouselElement,{type:"loop",perPage:3,focus:"center",gap:"0.5rem",perMove:1,autoHeight:!0,updateOnMove:!0,padding:"5rem",breakpoints:{768:{perPage:1},1024:{perPage:2}},arrows:!1!==this.config.showArrows,pagination:!1!==this.config.showDots,autoplay:!1}),this.splide.on("moved",e=>{this.handleSlideChange(e),this.collectionData&&this.emit("slidechange",{index:e,video:this.collectionData.videos[e]})}),this.splide.mount(),setTimeout(()=>{this.splide&&this.handleSlideChange(this.splide.index)},100))}handleSlideChange(e){if(!this.carouselElement)return;const t=this.config.autoplay;null!==this.autoplayTimeoutId&&(clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null);this.carouselElement.querySelectorAll(".splide__slide:not(.splide__slide--clone)").forEach(e=>{const n=e.querySelector("jaaq-video-player");if(!n)return;e.classList.contains("is-active")?t&&(this.autoplayTimeoutId=window.setTimeout(()=>{n.play?.()},1e3)):n.pause?.()})}destroyCarousel(){null!==this.autoplayTimeoutId&&(clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null),this.splide&&(this.splide.destroy(),this.splide=null),this.playerElement&&(this.playerElement.innerHTML=""),this.collectionData=null}emitError(e){this.playerElement&&(this.playerElement.innerHTML=`\n <div class="jaaq-collection-error">\n ${e.message}\n </div>\n `),this.emit("error",e)}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const n=this.listeners.get(e);n&&n.delete(t)}emit(e,t){const n=this.listeners.get(e);n&&n.forEach(e=>{e(t)})}refresh(){this.destroyCarousel(),this.initCarousel()}next(){this.splide?.go("+1")}prev(){this.splide?.go("-1")}go(e){this.splide?.go(e)}destroy(){this.destroyCarousel(),this.listeners.clear(),this.container.innerHTML=""}getCollection(){return this.collectionData}},e.JaaqCollectionPlayerElement=yn,e.JaaqPlayer=gn,e.JaaqVideoPlayer=d,e.JaaqVideoPlayerElement=vn,e.isRegistered=function(){return"undefined"!=typeof window&&"undefined"!=typeof customElements&&(!!customElements.get(bn)&&!!customElements.get(xn))},e.registerJaaqComponents=wn});
7
+ */var u="(prefers-reduced-motion: reduce)",p={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function h(e){e.length=0}function f(e,t,n){return Array.prototype.slice.call(e,t,n)}function m(e){return e.bind.apply(e,[null].concat(f(arguments,1)))}var g=setTimeout,v=function(){};function y(e){return requestAnimationFrame(e)}function b(e,t){return typeof t===e}function x(e){return!q(e)&&b("object",e)}var w=Array.isArray,_=m(b,"function"),E=m(b,"string"),j=m(b,"undefined");function q(e){return null===e}function C(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch(e){return!1}}function k(e){return w(e)?e:[e]}function A(e,t){k(e).forEach(t)}function S(e,t){return e.indexOf(t)>-1}function L(e,t){return e.push.apply(e,k(t)),e}function M(e,t,n){e&&A(t,function(t){t&&e.classList[n?"add":"remove"](t)})}function I(e,t){M(e,E(t)?t.split(" "):t,!0)}function P(e,t){A(t,e.appendChild.bind(e))}function T(e,t){A(e,function(e){var n=(t||e).parentNode;n&&n.insertBefore(e,t)})}function z(e,t){return C(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function D(e,t){var n=e?f(e.children):[];return t?n.filter(function(e){return z(e,t)}):n}function B(e,t){return t?D(e,t)[0]:e.firstElementChild}var F=Object.keys;function N(e,t,n){return e&&(n?F(e).reverse():F(e)).forEach(function(n){"__proto__"!==n&&t(e[n],n)}),e}function V(e){return f(arguments,1).forEach(function(t){N(t,function(n,i){e[i]=t[i]})}),e}function U(e){return f(arguments,1).forEach(function(t){N(t,function(t,n){w(t)?e[n]=t.slice():x(t)?e[n]=U({},x(e[n])?e[n]:{},t):e[n]=t})}),e}function H(e,t){A(t||F(e),function(t){delete e[t]})}function R(e,t){A(e,function(e){A(t,function(t){e&&e.removeAttribute(t)})})}function O(e,t,n){x(t)?N(t,function(t,n){O(e,n,t)}):A(e,function(e){q(n)||""===n?R(e,t):e.setAttribute(t,String(n))})}function $(e,t,n){var i=document.createElement(e);return t&&(E(t)?I(i,t):O(i,t)),n&&P(n,i),i}function K(e,t,n){if(j(n))return getComputedStyle(e)[t];q(n)||(e.style[t]=""+n)}function X(e,t){K(e,"display",t)}function G(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function W(e,t){return e.getAttribute(t)}function J(e,t){return e&&e.classList.contains(t)}function Z(e){return e.getBoundingClientRect()}function Y(e){A(e,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function Q(e){return B((new DOMParser).parseFromString(e,"text/html").body)}function ee(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function te(e,t){return e&&e.querySelector(t)}function ne(e,t){return t?f(e.querySelectorAll(t)):[]}function ie(e,t){M(e,t,!1)}function oe(e){return e.timeStamp}function se(e){return E(e)?e:e?e+"px":""}var ae="splide",re="data-"+ae;function le(e,t){if(!e)throw new Error("["+ae+"] "+(t||""))}var de=Math.min,ce=Math.max,ue=Math.floor,pe=Math.ceil,he=Math.abs;function fe(e,t,n){return he(e-t)<n}function me(e,t,n,i){var o=de(t,n),s=ce(t,n);return i?o<e&&e<s:o<=e&&e<=s}function ge(e,t,n){var i=de(t,n),o=ce(t,n);return de(ce(i,e),o)}function ve(e){return+(e>0)-+(e<0)}function ye(e,t){return A(t,function(t){e=e.replace("%s",""+t)}),e}function be(e){return e<10?"0"+e:""+e}var xe={};function we(){var e=[];function t(e,t,n){A(e,function(e){e&&A(t,function(t){t.split(" ").forEach(function(t){var i=t.split(".");n(e,i[0],i[1])})})})}return{bind:function(n,i,o,s){t(n,i,function(t,n,i){var a="addEventListener"in t,r=a?t.removeEventListener.bind(t,n,o,s):t.removeListener.bind(t,o);a?t.addEventListener(n,o,s):t.addListener(o),e.push([t,n,i,o,r])})},unbind:function(n,i,o){t(n,i,function(t,n,i){e=e.filter(function(e){return!!(e[0]!==t||e[1]!==n||e[2]!==i||o&&e[3]!==o)||(e[4](),!1)})})},dispatch:function(e,t,n){var i,o=!0;return"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:o,detail:n}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,o,!1,n),e.dispatchEvent(i),i},destroy:function(){e.forEach(function(e){e[4]()}),h(e)}}}var _e="mounted",Ee="ready",je="move",qe="moved",Ce="click",ke="active",Ae="inactive",Se="visible",Le="hidden",Me="refresh",Ie="updated",Pe="resize",Te="resized",ze="scroll",De="scrolled",Be="destroy",Fe="arrows:mounted",Ne="navigation:mounted",Ve="autoplay:play",Ue="autoplay:pause",He="lazyload:loaded",Re="sk",Oe="sh",$e="ei";function Ke(e){var t=e?e.event.bus:document.createDocumentFragment(),n=we();return e&&e.event.on(Be,n.destroy),V(n,{bus:t,on:function(e,i){n.bind(t,k(e).join(" "),function(e){i.apply(i,w(e.detail)?e.detail:[])})},off:m(n.unbind,t),emit:function(e){n.dispatch(t,e,f(arguments,1))}})}function Xe(e,t,n,i){var o,s,a=Date.now,r=0,l=!0,d=0;function c(){if(!l){if(r=e?de((a()-o)/e,1):1,n&&n(r),r>=1&&(t(),o=a(),i&&++d>=i))return u();s=y(c)}}function u(){l=!0}function p(){s&&cancelAnimationFrame(s),r=0,s=0,l=!0}return{start:function(t){t||p(),o=a()-(t?r*e:0),l=!1,s=y(c)},rewind:function(){o=a(),r=0,n&&n(r)},pause:u,cancel:p,set:function(t){e=t},isPaused:function(){return l}}}var Ge="Arrow",We=Ge+"Left",Je=Ge+"Right",Ze=Ge+"Up",Ye=Ge+"Down",Qe="ttb",et={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[Ze,Je],ArrowRight:[Ye,We]};var tt="role",nt="tabindex",it="aria-",ot=it+"controls",st=it+"current",at=it+"selected",rt=it+"label",lt=it+"labelledby",dt=it+"hidden",ct=it+"orientation",ut=it+"roledescription",pt=it+"live",ht=it+"busy",ft=it+"atomic",mt=[tt,nt,"disabled",ot,st,rt,lt,dt,ct,ut],gt=ae+"__",vt="is-",yt=ae,bt=gt+"track",xt=gt+"list",wt=gt+"slide",_t=wt+"--clone",Et=wt+"__container",jt=gt+"arrows",qt=gt+"arrow",Ct=qt+"--prev",kt=qt+"--next",At=gt+"pagination",St=At+"__page",Lt=gt+"progress"+"__bar",Mt=gt+"toggle",It=gt+"sr",Pt=vt+"initialized",Tt=vt+"active",zt=vt+"prev",Dt=vt+"next",Bt=vt+"visible",Ft=vt+"loading",Nt=vt+"focus-in",Vt=vt+"overflow",Ut=[Tt,Bt,zt,Dt,Ft,Nt,Vt],Ht={slide:wt,clone:_t,arrows:jt,arrow:qt,prev:Ct,next:kt,pagination:At,page:St,spinner:gt+"spinner"};var Rt="touchstart mousedown",Ot="touchmove mousemove",$t="touchend touchcancel mouseup click";var Kt="slide",Xt="loop",Gt="fade";function Wt(e,t,n,i){var o,s=Ke(e),a=s.on,r=s.emit,l=s.bind,d=e.Components,c=e.root,u=e.options,p=u.isNavigation,h=u.updateOnMove,f=u.i18n,g=u.pagination,v=u.slideFocus,y=d.Direction.resolve,b=W(i,"style"),x=W(i,rt),w=n>-1,_=B(i,"."+Et);function E(){var o=e.splides.map(function(e){var n=e.splide.Components.Slides.getAt(t);return n?n.slide.id:""}).join(" ");O(i,rt,ye(f.slideX,(w?n:t)+1)),O(i,ot,o),O(i,tt,v?"button":""),v&&R(i,ut)}function j(){o||q()}function q(){if(!o){var n=e.index;(s=C())!==J(i,Tt)&&(M(i,Tt,s),O(i,st,p&&s||""),r(s?ke:Ae,k)),function(){var t=function(){if(e.is(Gt))return C();var t=Z(d.Elements.track),n=Z(i),o=y("left",!0),s=y("right",!0);return ue(t[o])<=pe(n[o])&&ue(n[s])<=pe(t[s])}(),n=!t&&(!C()||w);e.state.is([4,5])||O(i,dt,n||"");O(ne(i,u.focusableNodes||""),nt,n?-1:""),v&&O(i,nt,n?-1:0);t!==J(i,Bt)&&(M(i,Bt,t),r(t?Se:Le,k));if(!t&&document.activeElement===i){var o=d.Slides.getAt(e.index);o&&G(o.slide)}}(),M(i,zt,t===n-1),M(i,Dt,t===n+1)}var s}function C(){var i=e.index;return i===t||u.cloneStatus&&i===n}var k={index:t,slideIndex:n,slide:i,container:_,isClone:w,mount:function(){w||(i.id=c.id+"-slide"+be(t+1),O(i,tt,g?"tabpanel":"group"),O(i,ut,f.slide),O(i,rt,x||ye(f.slideLabel,[t+1,e.length]))),l(i,"click",m(r,Ce,k)),l(i,"keydown",m(r,Re,k)),a([qe,Oe,De],q),a(Ne,E),h&&a(je,j)},destroy:function(){o=!0,s.destroy(),ie(i,Ut),R(i,mt),O(i,"style",b),O(i,rt,x||"")},update:q,style:function(e,t,n){K(n&&_||i,e,t)},isWithin:function(n,i){var o=he(n-t);return w||!u.rewind&&!e.is(Xt)||(o=de(o,e.length-o)),o<=i}};return k}var Jt=re+"-interval";var Zt={passive:!1,capture:!0};var Yt={Spacebar:" ",Right:Je,Left:We,Up:Ze,Down:Ye};function Qt(e){return e=E(e)?e:e.key,Yt[e]||e}var en="keydown";var tn=re+"-lazy",nn=tn+"-srcset",on="["+tn+"], ["+nn+"]";var sn=[" ","Enter"];var an=Object.freeze({__proto__:null,Media:function(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},a=we(),r=[];function l(e){e&&a.destroy()}function d(e,t){var n=matchMedia(t);a.bind(n,"change",c),r.push([e,n])}function c(){var t=i.is(7),o=n.direction,s=r.reduce(function(e,t){return U(e,t[1].matches?t[0]:{})},{});H(n),p(s),n.destroy?e.destroy("completely"===n.destroy):t?(l(!0),e.mount()):o!==n.direction&&e.refresh()}function p(t,o,s){U(n,t),o&&U(Object.getPrototypeOf(n),t),!s&&i.is(1)||e.emit(Ie,n)}return{setup:function(){var e="min"===n.mediaQuery;F(o).sort(function(t,n){return e?+t-+n:+n-+t}).forEach(function(t){d(o[t],"("+(e?"min":"max")+"-width:"+t+"px)")}),d(s,u),c()},destroy:l,reduce:function(e){matchMedia(u).matches&&(e?U(n,s):H(n,F(s)))},set:p}},Direction:function(e,t,n){return{resolve:function(e,t,i){var o="rtl"!==(i=i||n.direction)||t?i===Qe?0:-1:1;return et[e]&&et[e][o]||e.replace(/width|left|right/i,function(e,t){var n=et[e.toLowerCase()][o]||e;return t>0?n.charAt(0).toUpperCase()+n.slice(1):n})},orient:function(e){return e*("rtl"===n.direction?1:-1)}}},Elements:function(e,t,n){var i,o,s,a=Ke(e),r=a.on,l=a.bind,d=e.root,c=n.i18n,u={},p=[],f=[],m=[];function g(){i=b("."+bt),o=B(i,"."+xt),le(i&&o,"A track/list element is missing."),L(p,D(o,"."+wt+":not(."+_t+")")),N({arrows:jt,pagination:At,prev:Ct,next:kt,bar:Lt,toggle:Mt},function(e,t){u[t]=b("."+e)}),V(u,{root:d,track:i,list:o,slides:p}),function(){var e=d.id||(s=ae,""+s+be(xe[s]=(xe[s]||0)+1)),t=n.role;var s;d.id=e,i.id=i.id||e+"-track",o.id=o.id||e+"-list",!W(d,tt)&&"SECTION"!==d.tagName&&t&&O(d,tt,t);O(d,ut,c.carousel),O(o,tt,"presentation")}(),y()}function v(e){var t=mt.concat("style");h(p),ie(d,f),ie(i,m),R([i,o],t),R(d,e?t:["style",ut])}function y(){ie(d,f),ie(i,m),f=x(yt),m=x(bt),I(d,f),I(i,m),O(d,rt,n.label),O(d,lt,n.labelledby)}function b(e){var t=te(d,e);return t&&function(e,t){if(_(e.closest))return e.closest(t);for(var n=e;n&&1===n.nodeType&&!z(n,t);)n=n.parentElement;return n}(t,"."+yt)===d?t:void 0}function x(e){return[e+"--"+n.type,e+"--"+n.direction,n.drag&&e+"--draggable",n.isNavigation&&e+"--nav",e===yt&&Tt]}return V(u,{setup:g,mount:function(){r(Me,v),r(Me,g),r(Ie,y),l(document,Rt+" keydown",function(e){s="keydown"===e.type},{capture:!0}),l(d,"focusin",function(){M(d,Nt,!!s)})},destroy:v})},Slides:function(e,t,n){var i=Ke(e),o=i.on,s=i.emit,a=i.bind,r=t.Elements,l=r.slides,d=r.list,c=[];function u(){l.forEach(function(e,t){f(e,t,-1)})}function p(){v(function(e){e.destroy()}),h(c)}function f(t,n,i){var o=Wt(e,n,i,t);o.mount(),c.push(o),c.sort(function(e,t){return e.index-t.index})}function g(e){return e?y(function(e){return!e.isClone}):c}function v(e,t){g(t).forEach(e)}function y(e){return c.filter(_(e)?e:function(t){return E(e)?z(t.slide,e):S(k(e),t.index)})}return{mount:function(){u(),o(Me,p),o(Me,u)},destroy:p,update:function(){v(function(e){e.update()})},register:f,get:g,getIn:function(e){var i=t.Controller,o=i.toIndex(e),s=i.hasFocus()?1:n.perPage;return y(function(e){return me(e.index,o,o+s-1)})},getAt:function(e){return y(e)[0]},add:function(e,t){A(e,function(e){if(E(e)&&(e=Q(e)),C(e)){var i=l[t];i?T(e,i):P(d,e),I(e,n.classes.slide),o=e,r=m(s,Pe),c=ne(o,"img"),(u=c.length)?c.forEach(function(e){a(e,"load error",function(){--u||r()})}):r()}var o,r,c,u}),s(Me)},remove:function(e){Y(y(e).map(function(e){return e.slide})),s(Me)},forEach:v,filter:y,style:function(e,t,n){v(function(i){i.style(e,t,n)})},getLength:function(e){return e?l.length:c.length},isEnough:function(){return c.length>n.perPage}}},Layout:function(e,t,n){var i,o,s,a=Ke(e),r=a.on,l=a.bind,d=a.emit,c=t.Slides,u=t.Direction.resolve,p=t.Elements,h=p.root,f=p.track,g=p.list,v=c.getAt,y=c.style;function b(){i=n.direction===Qe,K(h,"maxWidth",se(n.width)),K(f,u("paddingLeft"),_(!1)),K(f,u("paddingRight"),_(!0)),w(!0)}function w(e){var t=Z(h);(e||o.width!==t.width||o.height!==t.height)&&(K(f,"height",function(){var e="";i&&(le(e=E(),"height or heightRatio is missing."),e="calc("+e+" - "+_(!1)+" - "+_(!0)+")");return e}()),y(u("marginRight"),se(n.gap)),y("width",n.autoWidth?null:se(n.fixedWidth)||(i?"":j())),y("height",se(n.fixedHeight)||(i?n.autoHeight?null:j():E()),!0),o=t,d(Te),s!==(s=L())&&(M(h,Vt,s),d("overflow",s)))}function _(e){var t=n.padding,i=u(e?"right":"left");return t&&se(t[i]||(x(t)?0:t))||"0px"}function E(){return se(n.height||Z(g).width*n.heightRatio)}function j(){var e=se(n.gap);return"calc((100%"+(e&&" + "+e)+")/"+(n.perPage||1)+(e&&" - "+e)+")"}function q(){return Z(g)[u("width")]}function C(e,t){var n=v(e||0);return n?Z(n.slide)[u("width")]+(t?0:S()):0}function k(e,t){var n=v(e);if(n){var i=Z(n.slide)[u("right")],o=Z(g)[u("left")];return he(i-o)+(t?0:S())}return 0}function A(t){return k(e.length-1)-k(0)+C(0,t)}function S(){var e=v(0);return e&&parseFloat(K(e.slide,u("marginRight")))||0}function L(){return e.is(Gt)||A(!0)>q()}return{mount:function(){var e,t;b(),l(window,"resize load",(e=m(d,Pe),t=Xe(0,e,null,1),function(){t.isPaused()&&t.start()})),r([Ie,Me],b),r(Pe,w)},resize:w,listSize:q,slideSize:C,sliderSize:A,totalSize:k,getPadding:function(e){return parseFloat(K(f,u("padding"+(e?"Right":"Left"))))||0},isOverflow:L}},Clones:function(e,t,n){var i,o=Ke(e),s=o.on,a=t.Elements,r=t.Slides,l=t.Direction.resolve,d=[];function c(){s(Me,u),s([Ie,Pe],f),(i=m())&&(!function(t){var i=r.get().slice(),o=i.length;if(o){for(;i.length<t;)L(i,i);L(i.slice(-t),i.slice(0,t)).forEach(function(s,l){var c=l<t,u=function(t,i){var o=t.cloneNode(!0);return I(o,n.classes.clone),o.id=e.root.id+"-clone"+be(i+1),o}(s.slide,l);c?T(u,i[0].slide):P(a.list,u),L(d,u),r.register(u,l-t+(c?0:o),s.index)})}}(i),t.Layout.resize(!0))}function u(){p(),c()}function p(){Y(d),h(d),o.destroy()}function f(){var e=m();i!==e&&(i<e||!e)&&o.emit(Me)}function m(){var i=n.clones;if(e.is(Xt)){if(j(i)){var o=n[l("fixedWidth")]&&t.Layout.slideSize(0);i=o&&pe(Z(a.track)[l("width")]/o)||n[l("autoWidth")]&&e.length||2*n.perPage}}else i=0;return i}return{mount:c,destroy:p}},Move:function(e,t,n){var i,o=Ke(e),s=o.on,a=o.emit,r=e.state.set,l=t.Layout,d=l.slideSize,c=l.getPadding,u=l.totalSize,p=l.listSize,h=l.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,v=t.Elements,y=v.list,b=v.track;function x(){t.Controller.isBusy()||(t.Scroll.cancel(),w(e.index),t.Slides.update())}function w(e){_(k(e,!0))}function _(n,i){if(!e.is(Gt)){var o=i?n:function(n){if(e.is(Xt)){var i=C(n),o=i>t.Controller.getEnd();(i<0||o)&&(n=E(n,o))}return n}(n);K(y,"transform","translate"+m("X")+"("+o+"px)"),n!==o&&a(Oe)}}function E(e,t){var n=e-S(t),i=h();return e-=g(i*(pe(he(n)/i)||1))*(t?1:-1)}function q(){_(A(),!0),i.cancel()}function C(e){for(var n=t.Slides.get(),i=0,o=1/0,s=0;s<n.length;s++){var a=n[s].index,r=he(k(a,!0)-e);if(!(r<=o))break;o=r,i=a}return i}function k(t,i){var o=g(u(t-1)-function(e){var t=n.focus;return"center"===t?(p()-d(e,!0))/2:+t*d(e)||0}(t));return i?function(t){n.trimSpace&&e.is(Kt)&&(t=ge(t,0,g(h(!0)-p())));return t}(o):o}function A(){var e=m("left");return Z(y)[e]-Z(b)[e]+g(c(!1))}function S(e){return k(e?t.Controller.getEnd():0,!!n.trimSpace)}return{mount:function(){i=t.Transition,s([_e,Te,Ie,Me],x)},move:function(e,t,n,o){var s,l;e!==t&&(s=e>n,l=g(E(A(),s)),s?l>=0:l<=y[m("scrollWidth")]-Z(b)[m("width")])&&(q(),_(E(A(),e>n),!0)),r(4),a(je,t,n,e),i.start(t,function(){r(3),a(qe,t,n,e),o&&o()})},jump:w,translate:_,shift:E,cancel:q,toIndex:C,toPosition:k,getPosition:A,getLimit:S,exceededLimit:function(e,t){t=j(t)?A():t;var n=!0!==e&&g(t)<g(S(!1)),i=!1!==e&&g(t)>g(S(!0));return n||i},reposition:x}},Controller:function(e,t,n){var i,o,s,a,r=Ke(e),l=r.on,d=r.emit,c=t.Move,u=c.getPosition,p=c.getLimit,h=c.toPosition,f=t.Slides,g=f.isEnough,v=f.getLength,y=n.omitEnd,b=e.is(Xt),x=e.is(Kt),w=m(S,!1),_=m(S,!0),q=n.start||0,C=q;function k(){o=v(!0),s=n.perMove,a=n.perPage,i=I();var e=ge(q,0,y?i:o-1);e!==q&&(q=e,c.reposition())}function A(){i!==I()&&d($e)}function S(e,t){var n=s||(D()?1:a),o=L(q+n*(e?-1:1),q,!(s||D()));return-1===o&&x&&!fe(u(),p(!e),1)?e?0:i:t?o:M(o)}function L(t,r,l){if(g()||D()){var d=function(t){if(x&&"move"===n.trimSpace&&t!==q)for(var i=u();i===h(t,!0)&&me(t,0,e.length-1,!n.rewind);)t<q?--t:++t;return t}(t);d!==t&&(r=t,t=d,l=!1),t<0||t>i?t=s||!me(0,t,r,!0)&&!me(i,r,t,!0)?b?l?t<0?-(o%a||a):o:t:n.rewind?t<0?i:0:-1:P(T(t)):l&&t!==r&&(t=P(T(r)+(t<r?-1:1)))}else t=-1;return t}function M(e){return b?(e+o)%o||0:e}function I(){for(var e=o-(D()||b&&s?1:a);y&&e-- >0;)if(h(o-1,!0)!==h(e,!0)){e++;break}return ge(e,0,o-1)}function P(e){return ge(D()?e:a*e,0,i)}function T(e){return D()?de(e,i):ue((e>=i?o-1:e)/a)}function z(e){e!==q&&(C=q,q=e)}function D(){return!j(n.focus)||n.isNavigation}function B(){return e.state.is([4,5])&&!!n.waitForTransition}return{mount:function(){k(),l([Ie,Me,$e],k),l(Te,A)},go:function(e,t,n){if(!B()){var o=function(e){var t=q;if(E(e)){var n=e.match(/([+\-<>])(\d+)?/)||[],o=n[1],s=n[2];"+"===o||"-"===o?t=L(q+ +(""+o+(+s||1)),q):">"===o?t=s?P(+s):w(!0):"<"===o&&(t=_(!0))}else t=b?e:ge(e,0,i);return t}(e),s=M(o);s>-1&&(t||s!==q)&&(z(s),c.move(o,s,C,n))}},scroll:function(e,n,o,s){t.Scroll.scroll(e,n,o,function(){var e=M(c.toIndex(u()));z(y?de(e,i):e),s&&s()})},getNext:w,getPrev:_,getAdjacent:S,getEnd:I,setIndex:z,getIndex:function(e){return e?C:q},toIndex:P,toPage:T,toDest:function(e){var t=c.toIndex(e);return x?ge(t,0,i):t},hasFocus:D,isBusy:B}},Arrows:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.bind,l=s.emit,d=n.classes,c=n.i18n,u=t.Elements,p=t.Controller,h=u.arrows,f=u.track,g=h,v=u.prev,y=u.next,b={};function x(){!function(){var e=n.arrows;!e||v&&y||(g=h||$("div",d.arrows),v=j(!0),y=j(!1),i=!0,P(g,[v,y]),!h&&T(g,f));v&&y&&(V(b,{prev:v,next:y}),X(g,e?"":"none"),I(g,o=jt+"--"+n.direction),e&&(a([_e,qe,Me,De,$e],q),r(y,"click",m(E,">")),r(v,"click",m(E,"<")),q(),O([v,y],ot,f.id),l(Fe,v,y)))}(),a(Ie,w)}function w(){_(),x()}function _(){s.destroy(),ie(g,o),i?(Y(h?[v,y]:g),v=y=null):R([v,y],mt)}function E(e){p.go(e,!0)}function j(e){return Q('<button class="'+d.arrow+" "+(e?d.prev:d.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(n.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function q(){if(v&&y){var t=e.index,n=p.getPrev(),i=p.getNext(),o=n>-1&&t<n?c.last:c.prev,s=i>-1&&t>i?c.first:c.next;v.disabled=n<0,y.disabled=i<0,O(v,rt,o),O(y,rt,s),l("arrows:updated",v,y,n,i)}}return{arrows:b,mount:x,destroy:_,update:q}},Autoplay:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.bind,l=s.emit,d=Xe(n.interval,e.go.bind(e,">"),function(e){var t=u.bar;t&&K(t,"width",100*e+"%"),l("autoplay:playing",e)}),c=d.isPaused,u=t.Elements,p=t.Elements,h=p.root,f=p.toggle,m=n.autoplay,g="pause"===m;function v(){c()&&t.Slides.isEnough()&&(d.start(!n.resetProgress),o=i=g=!1,x(),l(Ve))}function y(e){void 0===e&&(e=!0),g=!!e,x(),c()||(d.pause(),l(Ue))}function b(){g||(i||o?y(!1):v())}function x(){f&&(M(f,Tt,!g),O(f,rt,n.i18n[g?"play":"pause"]))}function w(e){var i=t.Slides.getAt(e);d.set(i&&+W(i.slide,Jt)||n.interval)}return{mount:function(){m&&(!function(){n.pauseOnHover&&r(h,"mouseenter mouseleave",function(e){i="mouseenter"===e.type,b()});n.pauseOnFocus&&r(h,"focusin focusout",function(e){o="focusin"===e.type,b()});f&&r(f,"click",function(){g?v():y(!0)});a([je,ze,Me],d.rewind),a(je,w)}(),f&&O(f,ot,u.track.id),g||v(),x())},destroy:d.cancel,play:v,pause:y,isPaused:c}},Cover:function(e,t,n){var i=Ke(e).on;function o(e){t.Slides.forEach(function(t){var n=B(t.container||t.slide,"img");n&&n.src&&s(e,n,t)})}function s(e,t,n){n.style("background",e?'center/cover no-repeat url("'+t.src+'")':"",!0),X(t,e?"none":"")}return{mount:function(){n.cover&&(i(He,m(s,!0)),i([_e,Ie,Me],m(o,!0)))},destroy:m(o,!1)}},Scroll:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.emit,l=e.state.set,d=t.Move,c=d.getPosition,u=d.getLimit,p=d.exceededLimit,h=d.translate,f=e.is(Kt),g=1;function v(e,n,s,a,u){var h=c();if(x(),s&&(!f||!p())){var v=t.Layout.sliderSize(),w=ve(e)*v*ue(he(e)/v)||0;e=d.toPosition(t.Controller.toDest(e%v))+w}var _=fe(h,e,1);g=1,n=_?0:n||ce(he(e-h)/1.5,800),o=a,i=Xe(n,y,m(b,h,e,u),1),l(5),r(ze),i.start()}function y(){l(3),o&&o(),r(De)}function b(e,t,i,s){var a,r,l=c(),d=(e+(t-e)*(a=s,(r=n.easingFunc)?r(a):1-Math.pow(1-a,4))-l)*g;h(l+d),f&&!i&&p()&&(g*=.6,he(d)<10&&v(u(p(!0)),600,!1,o,!0))}function x(){i&&i.cancel()}function w(){i&&!i.isPaused()&&(x(),y())}return{mount:function(){a(je,x),a([Ie,Me],w)},destroy:x,scroll:v,cancel:w}},Drag:function(e,t,n){var i,o,s,a,r,l,d,c,u=Ke(e),p=u.on,h=u.emit,f=u.bind,m=u.unbind,g=e.state,y=t.Move,b=t.Scroll,w=t.Controller,_=t.Elements.track,E=t.Media.reduce,j=t.Direction,q=j.resolve,C=j.orient,k=y.getPosition,A=y.exceededLimit,S=!1;function L(){var e=n.drag;H(!e),a="free"===e}function M(e){if(l=!1,!d){var t=U(e);i=e.target,o=n.noDrag,z(i,"."+St+", ."+qt)||o&&z(i,o)||!t&&e.button||(w.isBusy()?ee(e,!0):(c=t?_:window,r=g.is([4,5]),s=null,f(c,Ot,I,Zt),f(c,$t,P,Zt),y.cancel(),b.cancel(),D(e)))}var i,o}function I(t){if(g.is(6)||(g.set(6),h("drag")),t.cancelable)if(r){y.translate(i+B(t)/(S&&e.is(Kt)?5:1));var o=F(t)>200,s=S!==(S=A());(o||s)&&D(t),l=!0,h("dragging"),ee(t)}else(function(e){return he(B(e))>he(B(e,!0))})(t)&&(r=function(e){var t=n.dragMinThreshold,i=x(t),o=i&&t.mouse||0,s=(i?t.touch:+t)||10;return he(B(e))>(U(e)?s:o)}(t),ee(t))}function P(i){g.is(6)&&(g.set(3),h("dragged")),r&&(!function(i){var o=function(t){if(e.is(Xt)||!S){var n=F(t);if(n&&n<200)return B(t)/n}return 0}(i),s=function(e){return k()+ve(e)*de(he(e)*(n.flickPower||600),a?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}(o),r=n.rewind&&n.rewindByDrag;E(!1),a?w.scroll(s,0,n.snap):e.is(Gt)?w.go(C(ve(o))<0?r?"<":"-":r?">":"+"):e.is(Kt)&&S&&r?w.go(A(!0)?">":"<"):w.go(w.toDest(s),!0);E(!0)}(i),ee(i)),m(c,Ot,I),m(c,$t,P),r=!1}function T(e){!d&&l&&ee(e,!0)}function D(e){s=o,o=e,i=k()}function B(e,t){return V(e,t)-V(N(e),t)}function F(e){return oe(e)-oe(N(e))}function N(e){return o===e&&s||o}function V(e,t){return(U(e)?e.changedTouches[0]:e)["page"+q(t?"Y":"X")]}function U(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function H(e){d=e}return{mount:function(){f(_,Ot,v,Zt),f(_,$t,v,Zt),f(_,Rt,M,Zt),f(_,"click",T,{capture:!0}),f(_,"dragstart",ee),p([_e,Ie],L)},disable:H,isDragging:function(){return r}}},Keyboard:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.bind,l=s.unbind,d=e.root,c=t.Direction.resolve;function u(){var e=n.keyboard;e&&(i="global"===e?window:d,r(i,en,f))}function p(){l(i,en)}function h(){var e=o;o=!0,g(function(){o=e})}function f(t){if(!o){var n=Qt(t);n===c(We)?e.go("<"):n===c(Je)&&e.go(">")}}return{mount:function(){u(),a(Ie,p),a(Ie,u),a(je,h)},destroy:p,disable:function(e){o=e}}},LazyLoad:function(e,t,n){var i=Ke(e),o=i.on,s=i.off,a=i.bind,r=i.emit,l="sequential"===n.lazyLoad,d=[qe,De],c=[];function u(){h(c),t.Slides.forEach(function(e){ne(e.slide,on).forEach(function(t){var i=W(t,tn),o=W(t,nn);if(i!==t.src||o!==t.srcset){var s=n.classes.spinner,a=t.parentElement,r=B(a,"."+s)||$("span",s,a);c.push([t,e,r]),t.src||X(t,"none")}})}),l?v():(s(d),o(d,p),p())}function p(){(c=c.filter(function(t){var i=n.perPage*((n.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,i)||f(t)})).length||s(d)}function f(e){var t=e[0];I(e[1].slide,Ft),a(t,"load error",m(g,e)),O(t,"src",W(t,tn)),O(t,"srcset",W(t,nn)),R(t,tn),R(t,nn)}function g(e,t){var n=e[0],i=e[1];ie(i.slide,Ft),"error"!==t.type&&(Y(e[2]),X(n,""),r(He,n,i),r(Pe)),l&&v()}function v(){c.length&&f(c.shift())}return{mount:function(){n.lazyLoad&&(u(),o(Me,u))},destroy:m(h,c),check:p}},Pagination:function(e,t,n){var i,o,s=Ke(e),a=s.on,r=s.emit,l=s.bind,d=t.Slides,c=t.Elements,u=t.Controller,p=u.hasFocus,g=u.getIndex,v=u.go,y=t.Direction.resolve,b=c.pagination,x=[];function w(){i&&(Y(b?f(i.children):i),ie(i,o),h(x),i=null),s.destroy()}function _(e){v(">"+e,!0)}function E(e,t){var n=x.length,i=Qt(t),o=j(),s=-1;i===y(Je,!1,o)?s=++e%n:i===y(We,!1,o)?s=(--e+n)%n:"Home"===i?s=0:"End"===i&&(s=n-1);var a=x[s];a&&(G(a.button),v(">"+s),ee(t,!0))}function j(){return n.paginationDirection||n.direction}function q(e){return x[u.toPage(e)]}function C(){var e=q(g(!0)),t=q(g());if(e){var n=e.button;ie(n,Tt),R(n,at),O(n,nt,-1)}if(t){var o=t.button;I(o,Tt),O(o,at,!0),O(o,nt,"")}r("pagination:updated",{list:i,items:x},e,t)}return{items:x,mount:function t(){w(),a([Ie,Me,$e],t);var s=n.pagination;b&&X(b,s?"":"none"),s&&(a([je,ze,De],C),function(){var t=e.length,s=n.classes,a=n.i18n,r=n.perPage,h=p()?u.getEnd()+1:pe(t/r);I(i=b||$("ul",s.pagination,c.track.parentElement),o=At+"--"+j()),O(i,tt,"tablist"),O(i,rt,a.select),O(i,ct,j()===Qe?"vertical":"");for(var f=0;f<h;f++){var g=$("li",null,i),v=$("button",{class:s.page,type:"button"},g),y=d.getIn(f).map(function(e){return e.slide.id}),w=!p()&&r>1?a.pageX:a.slideX;l(v,"click",m(_,f)),n.paginationKeyboard&&l(v,"keydown",m(E,f)),O(g,tt,"presentation"),O(v,tt,"tab"),O(v,ot,y.join(" ")),O(v,rt,ye(w,f+1)),O(v,nt,-1),x.push({li:g,button:v,page:f})}}(),C(),r("pagination:mounted",{list:i,items:x},q(e.index)))},destroy:w,getAt:q,update:C}},Sync:function(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function a(){var t,n;e.splides.forEach(function(t){t.isParent||(l(e,t.splide),l(t.splide,e))}),i&&(t=Ke(e),(n=t.on)(Ce,c),n(Re,u),n([_e,Ie],d),s.push(t),t.emit(Ne,e.splides))}function r(){s.forEach(function(e){e.destroy()}),h(s)}function l(e,t){var n=Ke(e);n.on(je,function(e,n,i){t.go(t.is(Xt)?i:e)}),s.push(n)}function d(){O(t.Elements.list,ct,n.direction===Qe?"vertical":"")}function c(t){e.go(t.index)}function u(e,t){S(sn,Qt(t))&&(c(e),ee(t))}return{setup:m(t.Media.set,{slideFocus:j(o)?i:o},!0),mount:a,destroy:r,remount:function(){r(),a()}}},Wheel:function(e,t,n){var i=Ke(e).bind,o=0;function s(i){if(i.cancelable){var s=i.deltaY,a=s<0,r=oe(i),l=n.wheelMinThreshold||0,d=n.wheelSleep||0;he(s)>l&&r-o>d&&(e.go(a?"<":">"),o=r),function(i){return!n.releaseWheel||e.state.is(4)||-1!==t.Controller.getAdjacent(i)}(a)&&ee(i)}}return{mount:function(){n.wheel&&i(t.Elements.track,"wheel",s,Zt)}}},Live:function(e,t,n){var i=Ke(e).on,o=t.Elements.track,s=n.live&&!n.isNavigation,a=$("span",It),r=Xe(90,m(l,!1));function l(e){O(o,ht,e),e?(P(o,a),r.start()):(Y(a),r.cancel())}function d(e){s&&O(o,pt,e?"off":"polite")}return{mount:function(){s&&(d(!t.Autoplay.isPaused()),O(o,ft,!0),a.textContent="…",i(Ve,m(d,!0)),i(Ue,m(d,!1)),i([qe,De],m(l,!0)))},disable:d,destroy:function(){R(o,[pt,ft,ht]),Y(a)}}}}),rn={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Ht,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function ln(e,t,n){var i=t.Slides;function o(){i.forEach(function(e){e.style("transform","translateX(-"+100*e.index+"%)")})}return{mount:function(){Ke(e).on([_e,Me],o)},start:function(e,t){i.style("transition","opacity "+n.speed+"ms "+n.easing),g(t)},cancel:v}}function dn(e,t,n){var i,o=t.Move,s=t.Controller,a=t.Scroll,r=t.Elements.list,l=m(K,r,"transition");function d(){l(""),a.cancel()}return{mount:function(){Ke(e).bind(r,"transitionend",function(e){e.target===r&&i&&(d(),i())})},start:function(t,r){var d=o.toPosition(t,!0),c=o.getPosition(),u=function(t){var i=n.rewindSpeed;if(e.is(Kt)&&i){var o=s.getIndex(!0),a=s.getEnd();if(0===o&&t>=a||o>=a&&0===t)return i}return n.speed}(t);he(d-c)>=1&&u>=1?n.useScroll?a.scroll(d,u,!1,r):(l("transform "+u+"ms "+n.easing),o.translate(d,!0),i=r):(o.jump(t),r())},cancel:d}}var cn=function(){function e(t,n){var i;this.event=Ke(),this.Components={},this.state=(i=1,{set:function(e){i=e},is:function(e){return S(k(e),i)}}),this.splides=[],this._o={},this._E={};var o=E(t)?te(document,t):t;le(o,o+" is invalid."),this.root=o,n=U({label:W(o,rt)||"",labelledby:W(o,lt)||""},rn,e.defaults,n||{});try{U(n,JSON.parse(W(o,re)))}catch(e){le(!1,"Invalid JSON")}this._o=Object.create(U({},n))}var t=e.prototype;return t.mount=function(e,t){var n=this,i=this.state,o=this.Components;return le(i.is([1,7]),"Already mounted!"),i.set(1),this._C=o,this._T=t||this._T||(this.is(Gt)?ln:dn),this._E=e||this._E,N(V({},an,this._E,{Transition:this._T}),function(e,t){var i=e(n,o,n._o);o[t]=i,i.setup&&i.setup()}),N(o,function(e){e.mount&&e.mount()}),this.emit(_e),I(this.root,Pt),i.set(3),this.emit(Ee),this},t.sync=function(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),e.Components.Sync.remount()),this},t.go=function(e){return this._C.Controller.go(e),this},t.on=function(e,t){return this.event.on(e,t),this},t.off=function(e){return this.event.off(e),this},t.emit=function(e){var t;return(t=this.event).emit.apply(t,[e].concat(f(arguments,1))),this},t.add=function(e,t){return this._C.Slides.add(e,t),this},t.remove=function(e){return this._C.Slides.remove(e),this},t.is=function(e){return this._o.type===e},t.refresh=function(){return this.emit(Me),this},t.destroy=function(e){void 0===e&&(e=!0);var t=this.event,n=this.state;return n.is(1)?Ke(this).on(Ee,this.destroy.bind(this,e)):(N(this._C,function(t){t.destroy&&t.destroy(e)},!0),t.emit(Be),t.destroy(),e&&h(this.splides),n.set(7)),this},c(e,[{key:"options",get:function(){return this._o},set:function(e){this._C.Media.set(e,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e}(),un=cn;un.defaults={},un.STATES=p,function(){if("undefined"!=typeof document){const e="jaaq-styles-splide.min";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0}",document.head.appendChild(t)}}}();const pn=new WeakMap,hn=[];function fn(e){if(pn.has(e))return pn.get(e);const t=function(e){const t=e.getAttribute("data-api-key"),n=e.getAttribute("data-client-id"),i=e.getAttribute("data-video-id");if(!t||!n||!i)return console.error("JAAQ Player: Missing required attributes (data-api-key, data-client-id, data-video-id)",e),null;const o={apiKey:t,clientId:n,videoId:i},s=e.getAttribute("data-autoplay");null!==s&&(o.autoplay="true"===s);const a=e.getAttribute("data-width");a&&(o.width=a);const r=e.getAttribute("data-height");r&&(o.height=r);const l=e.getAttribute("data-base-url");l&&(o.baseUrl=l);const d=e.getAttribute("data-api-version");d&&(o.apiVersion=d);const c=e.getAttribute("data-class-name");return c&&(o.className=c),o}(e);if(!t)return null;try{const n=new d(e,t);return pn.set(e,n),hn.push({element:e,player:n}),n}catch(t){return console.error("JAAQ Player: Failed to initialize player",t,e),null}}function mn(e=document){e.querySelectorAll("[data-jaaq-player]").forEach(e=>{fn(e)})}const gn={init:mn,getPlayer:function(e){let t;if("string"==typeof e){if(t=document.querySelector(e),!t)return console.error("JAAQ Player: Element not found for selector",e),null}else t=e;return pn.get(t)||null},destroyAll:function(){hn.forEach(({element:e,player:t})=>{try{t.destroy(),pn.delete(e)}catch(e){console.error("JAAQ Player: Error destroying player",e)}}),hn.length=0}};"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{mn()}):mn());class vn extends HTMLElement{static get observedAttributes(){return["video-id","api-key","client-id","autoplay","base-url","width","height","controls","show-logo","show-title","show-author","show-description","show-captions","start-muted"]}constructor(){super(),this.player=null,this.container=null,this.clientInstance=null,this.connected=!1,this.attachShadow({mode:"open"})}connectedCallback(){this.connected=!0,this.render(),this.initPlayer()}disconnectedCallback(){this.connected=!1,this.destroyPlayer()}attributeChangedCallback(e,t,n){if(this.connected&&t!==n)if("video-id"===e&&this.player)this.destroyPlayer(),this.initPlayer();else if("width"===e||"height"===e)this.updateContainerStyles();else if(("controls"===e||"show-logo"===e||"show-title"===e||"show-author"===e||"show-description"===e||"show-captions"===e||"start-muted"===e)&&this.player){const t={};"controls"===e?t.controls=!this.hasAttribute("controls")||"false"!==this.getAttribute("controls"):"show-logo"===e?t.showLogo=!this.hasAttribute("show-logo")||"false"!==this.getAttribute("show-logo"):"show-title"===e?t.showTitle=!this.hasAttribute("show-title")||"false"!==this.getAttribute("show-title"):"show-author"===e?t.showAuthor=!this.hasAttribute("show-author")||"false"!==this.getAttribute("show-author"):"show-description"===e?t.showDescription=!this.hasAttribute("show-description")||"false"!==this.getAttribute("show-description"):"show-captions"===e?t.showCaptions=!this.hasAttribute("show-captions")||"false"!==this.getAttribute("show-captions"):"start-muted"===e&&(t.startMuted=this.hasAttribute("start-muted")&&"false"!==this.getAttribute("start-muted")),this.player.setFeatures(t)}}render(){if(!this.shadowRoot)return;const e=document.createElement("style");e.textContent=`\n ${l}\n .jaaq-vanilla-player {\n user-select: none;\n}\n\n.jaaq-vanilla-player video {\n outline: none;\n}\n\n.jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: #007bff;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n\n \n:host {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n `,this.container=document.createElement("div"),this.container.className="jaaq-webcomponent-container",this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.container),this.updateContainerStyles()}updateContainerStyles(){if(!this.container)return;const e=this.getAttribute("width")||"100%",t=this.getAttribute("height")||"auto";this.container.style.width=e,this.container.style.height=t}async initPlayer(){if(!this.container||this.player)return;const e=this.getAttribute("video-id");if(!e)return void this.emitError(new Error("video-id attribute is required"));const t=this.getAttribute("api-key"),n=this.getAttribute("client-id"),i=this.getAttribute("base-url")||void 0,o=this.getAttribute("api-version")||void 0,s=this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay"),a=!this.hasAttribute("controls")||"false"!==this.getAttribute("controls"),r=!this.hasAttribute("show-logo")||"false"!==this.getAttribute("show-logo"),l=!this.hasAttribute("show-title")||"false"!==this.getAttribute("show-title"),c=!this.hasAttribute("show-author")||"false"!==this.getAttribute("show-author"),u=!this.hasAttribute("show-description")||"false"!==this.getAttribute("show-description"),p=!this.hasAttribute("show-captions")||"false"!==this.getAttribute("show-captions"),h=this.hasAttribute("start-muted")&&"false"!==this.getAttribute("start-muted");if(this.clientInstance||t||n)try{this.player=new d(this.container,{videoId:e??void 0,apiKey:t??void 0,clientId:n??void 0,client:this.clientInstance||void 0,baseUrl:i,apiVersion:o,autoplay:s,controls:a,showLogo:r,showTitle:l,showAuthor:c,showDescription:u,showCaptions:p,startMuted:h}),this.attachPlayerEvents()}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to initialize player"))}else this.emitError(new Error("Either client property or api-key and client-id attributes are required"))}attachPlayerEvents(){this.player&&(this.player.on("loaded",e=>{this.dispatchEvent(new CustomEvent("jaaq:loaded",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("play",()=>{this.dispatchEvent(new CustomEvent("jaaq:play",{bubbles:!0,composed:!0}))}),this.player.on("pause",()=>{this.dispatchEvent(new CustomEvent("jaaq:pause",{bubbles:!0,composed:!0}))}),this.player.on("timeupdate",e=>{this.dispatchEvent(new CustomEvent("jaaq:timeupdate",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("volumechange",e=>{this.dispatchEvent(new CustomEvent("jaaq:volumechange",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("ended",()=>{this.dispatchEvent(new CustomEvent("jaaq:ended",{bubbles:!0,composed:!0}))}),this.player.on("error",e=>{this.emitError(e)}),this.player.on("fullscreenchange",e=>{this.dispatchEvent(new CustomEvent("jaaq:fullscreenchange",{detail:e,bubbles:!0,composed:!0}))}))}emitError(e){this.dispatchEvent(new CustomEvent("jaaq:error",{detail:e,bubbles:!0,composed:!0}))}destroyPlayer(){this.player&&(this.player.destroy(),this.player=null)}get client(){return this.clientInstance}set client(e){this.clientInstance=e,this.connected&&(this.destroyPlayer(),this.initPlayer())}get videoId(){return this.getAttribute("video-id")}set videoId(e){e?this.setAttribute("video-id",e):this.removeAttribute("video-id")}play(){this.player?.play()}pause(){this.player?.pause()}setVolume(e){this.player?.setVolume(e)}toggleMute(){this.player?.toggleMute()}seek(e){this.player?.seek(e)}getState(){return this.player?.getState()||null}destroy(){this.destroyPlayer()}}!function(){if("undefined"!=typeof document){const e="jaaq-styles-CollectionPlayer";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=".jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: white;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n",document.head.appendChild(t)}}}();class yn extends HTMLElement{static get observedAttributes(){return["collection-id","api-key","client-id","subscription-id","base-url","autoplay","show-arrows","show-dots","video-settings"]}constructor(){super(),this.splide=null,this.container=null,this.carouselElement=null,this.clientInstance=null,this.connected=!1,this.collectionData=null,this.autoplayTimeoutId=null,this.attachShadow({mode:"open"})}connectedCallback(){this.connected=!0,this.render(),this.initCarousel()}disconnectedCallback(){this.connected=!1,this.destroyCarousel()}attributeChangedCallback(e,t,n){this.connected&&t!==n&&("collection-id"!==e&&"video-settings"!==e||(this.destroyCarousel(),this.initCarousel()),"show-arrows"!==e&&"show-dots"!==e||(this.destroyCarousel(),this.initCarousel()))}getBooleanAttr(e,t){const n=this.getAttribute(e);return null===n?t:"false"!==n}getVideosFromCollection(e){if(e.videos&&e.videos.length>0)return e.videos;if(e.videoGroups&&e.videoGroups.length>0){const t=[];return e.videoGroups.forEach(e=>{e.videos&&e.videos.length>0&&t.push(...e.videos)}),t}return[]}render(){if(!this.shadowRoot)return;const e=document.createElement("style");e.textContent=`\n ${l}\n .jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: white;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n\n .splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0}\n \n:host {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n `,this.container=document.createElement("div"),this.container.className="jaaq-collection-player",this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.container)}async initCarousel(){if(!this.container)return;const e=this.getAttribute("collection-id");if(!e)return void this.emitError(new Error("collection-id attribute is required"));const t=this.getAttribute("api-key"),n=this.getAttribute("client-id"),s=this.getAttribute("base-url")||void 0,a=this.getAttribute("api-version")||void 0;if(this.clientInstance||t||n){this.showLoading();try{const r=this.clientInstance||o.init({apiKey:t,clientId:n,baseUrl:s||i,apiVersion:a});this.collectionData=await r.collections.getById(e);if(0===this.getVideosFromCollection(this.collectionData).length)return void this.emitError(new Error("No videos found in collection"));this.renderCarousel(),this.initSplide(),this.dispatchEvent(new CustomEvent("jaaq:collection:loaded",{detail:this.collectionData,bubbles:!0,composed:!0}))}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to load collection"))}}else this.emitError(new Error("Either client property or api-key and client-id attributes are required"))}showLoading(){this.container&&(this.container.innerHTML='\n <div class="jaaq-collection-loading">\n <div class="jaaq-collection-spinner"></div>\n </div>\n ')}renderCarousel(){if(!this.container||!this.collectionData)return;this.container.innerHTML="",this.carouselElement=document.createElement("div"),this.carouselElement.className="splide jaaq-collection-carousel";const e=document.createElement("div");e.className="splide__track";const t=document.createElement("ul");t.className="splide__list";const n=this.getAttribute("api-key"),i=this.getAttribute("client-id"),o=this.getAttribute("base-url"),s=this.getAttribute("video-settings");let a=null;if(s)try{a=JSON.parse(s)}catch(e){console.warn("[CollectionPlayer] Failed to parse video-settings attribute",e)}this.getVideosFromCollection(this.collectionData).forEach(e=>{const s=document.createElement("li");s.className="splide__slide";const r=document.createElement("jaaq-video-player");r.setAttribute("video-id",e.videoId),n&&r.setAttribute("api-key",n),i&&r.setAttribute("client-id",i),o&&r.setAttribute("base-url",o),r.setAttribute("autoplay","false"),r.setAttribute("width","100%"),a&&(void 0!==a.controls&&r.setAttribute("controls",String(a.controls)),void 0!==a.showLogo&&r.setAttribute("show-logo",String(a.showLogo)),void 0!==a.showTitle&&r.setAttribute("show-title",String(a.showTitle)),void 0!==a.showAuthor&&r.setAttribute("show-author",String(a.showAuthor)),void 0!==a.showDescription&&r.setAttribute("show-description",String(a.showDescription)),void 0!==a.showCaptions&&r.setAttribute("show-captions",String(a.showCaptions)),void 0!==a.startMuted&&r.setAttribute("start-muted",String(a.startMuted)),void 0!==a.width&&r.setAttribute("width",String(a.width)),void 0!==a.height&&r.setAttribute("height",String(a.height))),s.appendChild(r),t.appendChild(s)}),e.appendChild(t),this.carouselElement.appendChild(e),this.container.appendChild(this.carouselElement)}initSplide(){if(!this.carouselElement)return;const e=this.getBooleanAttr("show-arrows",!0),t=this.getBooleanAttr("show-dots",!0);this.splide=new un(this.carouselElement,{type:"loop",perPage:3,focus:"center",gap:"0.5rem",perMove:1,autoHeight:!0,updateOnMove:!0,padding:"5 rem",breakpoints:{768:{perPage:1},1024:{perPage:2}},arrows:e,pagination:t,autoplay:!1}),this.splide.on("moved",e=>{console.log("[CollectionPlayer] Splide moved event",{newIndex:e,splideIndex:this.splide?.index,Components:this.splide?.Components}),this.handleSlideChange(e);const t=this.collectionData?this.getVideosFromCollection(this.collectionData):[];this.dispatchEvent(new CustomEvent("jaaq:collection:slidechange",{detail:{index:e,video:t[e]},bubbles:!0,composed:!0}))}),this.splide.mount(),console.log("[CollectionPlayer] After mount",{splideIndex:this.splide.index,length:this.splide.length}),setTimeout(()=>{this.splide&&(console.log("[CollectionPlayer] Initial handleSlideChange after DOM update"),this.handleSlideChange(this.splide.index))},100)}handleSlideChange(e){if(!this.carouselElement)return;const t=this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay");console.log("[CollectionPlayer] handleSlideChange called",{activeIndex:e,isAutoplayEnabled:t}),null!==this.autoplayTimeoutId&&(console.log("[CollectionPlayer] Clearing existing autoplay timeout",{timeoutId:this.autoplayTimeoutId}),clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null);const n=this.carouselElement.querySelector(".splide__slide.is-active:not(.splide__slide--clone)"),i=n?.querySelector("jaaq-video-player"),o=i?.getAttribute("video-id");console.log("[CollectionPlayer] Active slide from DOM:",{activeIndex:e,activeVideoId:o,foundActiveSlide:!!n});const s=this.carouselElement.querySelectorAll(".splide__slide:not(.splide__slide--clone)");Array.from(s).map((e,t)=>{const n=e.querySelector("jaaq-video-player");return{index:t,videoId:n?.getAttribute("video-id")||"unknown",isActive:e.classList.contains("is-active")}}),s.forEach((e,n)=>{const i=e.querySelector("jaaq-video-player");if(!i)return;const o=i.getAttribute("video-id");e.classList.contains("is-active")?t&&(this.autoplayTimeoutId=window.setTimeout(()=>{console.log("[CollectionPlayer] 1s delay complete, playing video",{index:n,videoId:o}),i.play?.()},1e3)):i.pause?.()})}destroyCarousel(){null!==this.autoplayTimeoutId&&(clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null),this.splide&&(this.splide.destroy(),this.splide=null),this.container&&(this.container.innerHTML=""),this.collectionData=null}emitError(e){this.container&&(this.container.innerHTML=`\n <div class="jaaq-collection-error">\n ${e.message}\n </div>\n `),this.dispatchEvent(new CustomEvent("jaaq:collection:error",{detail:e,bubbles:!0,composed:!0}))}get client(){return this.clientInstance}set client(e){this.clientInstance=e,this.connected&&(this.destroyCarousel(),this.initCarousel())}get collectionId(){return this.getAttribute("collection-id")}set collectionId(e){e?this.setAttribute("collection-id",e):this.removeAttribute("collection-id")}refresh(){this.destroyCarousel(),this.initCarousel()}next(){this.splide?.go("+1")}prev(){this.splide?.go("-1")}go(e){this.splide?.go(e)}destroy(){this.destroyCarousel()}getCollection(){return this.collectionData}}const bn="jaaq-video-player",xn="jaaq-collection-player";function wn(){"undefined"!=typeof window&&"undefined"!=typeof customElements?(customElements.get(bn)||customElements.define(bn,vn),customElements.get(xn)||customElements.define(xn,yn)):console.warn("Custom Elements API is not available. Web components cannot be registered.")}"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{wn()}):wn()),e.JaaqCollectionPlayer=class{constructor(e,t){if(this.client=null,this.splide=null,this.playerElement=null,this.carouselElement=null,this.collectionData=null,this.autoplayTimeoutId=null,this.listeners=new Map,this.container="string"==typeof e?document.querySelector(e):e,!this.container)throw new Error("Container element not found");if(this.config={autoplay:!1,showArrows:!0,showDots:!0,...t},t.client)this.client=t.client;else{if(!t.apiKey||!t.clientId)throw new Error("Either client property or apiKey and clientId are required");this.client=s({apiKey:t.apiKey,clientId:t.clientId,baseUrl:t.baseUrl||i,apiVersion:t.apiVersion})}this.init()}async init(){this.render(),await this.initCarousel()}render(){this.container.innerHTML="",this.playerElement=document.createElement("div"),this.playerElement.className=`jaaq-collection-player ${this.config.className||""}`,this.container.appendChild(this.playerElement)}async initCarousel(){if(!this.playerElement)return;const e=this.config.collectionId;if(e){this.showLoading();try{if(!this.client)throw new Error("Client is not initialized");this.collectionData=await this.client.collections.getById(e);if(0===this.getVideosFromCollection(this.collectionData).length)return void this.emitError(new Error("No videos found in collection"));this.renderCarousel(),this.initSplide(),this.emit("loaded",this.collectionData)}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to load collection"))}}else this.emitError(new Error("collectionId is required"))}showLoading(){this.playerElement&&(this.playerElement.innerHTML='\n <div class="jaaq-collection-loading">\n <div class="jaaq-collection-spinner"></div>\n </div>\n ')}getVideosFromCollection(e){if(e.videos&&e.videos.length>0)return e.videos;if(e.videoGroups&&e.videoGroups.length>0){const t=[];return e.videoGroups.forEach(e=>{e.videos&&e.videos.length>0&&t.push(...e.videos)}),t}return[]}renderCarousel(){if(!this.playerElement||!this.collectionData)return;this.playerElement.innerHTML="",this.carouselElement=document.createElement("div"),this.carouselElement.className="splide jaaq-collection-carousel";const e=document.createElement("div");e.className="splide__track";const t=document.createElement("ul");t.className="splide__list";this.getVideosFromCollection(this.collectionData).forEach(e=>{const n=document.createElement("li");n.className="splide__slide";const i=document.createElement("jaaq-video-player");if(i.setAttribute("video-id",e.videoId),this.config.apiKey&&i.setAttribute("api-key",this.config.apiKey),this.config.clientId&&i.setAttribute("client-id",this.config.clientId),this.config.baseUrl&&i.setAttribute("base-url",this.config.baseUrl),this.config.apiVersion&&i.setAttribute("api-version",this.config.apiVersion),i.setAttribute("autoplay","false"),i.setAttribute("width","100%"),this.config.videoSettings){const e=this.config.videoSettings;void 0!==e.controls&&i.setAttribute("controls",String(e.controls)),void 0!==e.showLogo&&i.setAttribute("show-logo",String(e.showLogo)),void 0!==e.showTitle&&i.setAttribute("show-title",String(e.showTitle)),void 0!==e.showAuthor&&i.setAttribute("show-author",String(e.showAuthor)),void 0!==e.showDescription&&i.setAttribute("show-description",String(e.showDescription)),void 0!==e.showCaptions&&i.setAttribute("show-captions",String(e.showCaptions)),void 0!==e.startMuted&&i.setAttribute("start-muted",String(e.startMuted)),void 0!==e.width&&i.setAttribute("width",String(e.width)),void 0!==e.height&&i.setAttribute("height",String(e.height))}this.client&&void 0!==i.client&&(i.client=this.client),n.appendChild(i),t.appendChild(n)}),e.appendChild(t),this.carouselElement.appendChild(e),this.playerElement.appendChild(this.carouselElement)}initSplide(){this.carouselElement&&(this.splide=new un(this.carouselElement,{type:"loop",perPage:3,focus:"center",gap:"0.5rem",perMove:1,autoHeight:!0,updateOnMove:!0,padding:"5rem",breakpoints:{768:{perPage:1},1024:{perPage:2}},arrows:!1!==this.config.showArrows,pagination:!1!==this.config.showDots,autoplay:!1}),this.splide.on("moved",e=>{if(this.handleSlideChange(e),this.collectionData){const t=this.getVideosFromCollection(this.collectionData);this.emit("slidechange",{index:e,video:t[e]})}}),this.splide.mount(),setTimeout(()=>{this.splide&&this.handleSlideChange(this.splide.index)},100))}handleSlideChange(e){if(!this.carouselElement)return;const t=this.config.autoplay;null!==this.autoplayTimeoutId&&(clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null);this.carouselElement.querySelectorAll(".splide__slide:not(.splide__slide--clone)").forEach(e=>{const n=e.querySelector("jaaq-video-player");if(!n)return;e.classList.contains("is-active")?t&&(this.autoplayTimeoutId=window.setTimeout(()=>{n.play?.()},1e3)):n.pause?.()})}destroyCarousel(){null!==this.autoplayTimeoutId&&(clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null),this.splide&&(this.splide.destroy(),this.splide=null),this.playerElement&&(this.playerElement.innerHTML=""),this.collectionData=null}emitError(e){this.playerElement&&(this.playerElement.innerHTML=`\n <div class="jaaq-collection-error">\n ${e.message}\n </div>\n `),this.emit("error",e)}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const n=this.listeners.get(e);n&&n.delete(t)}emit(e,t){const n=this.listeners.get(e);n&&n.forEach(e=>{e(t)})}refresh(){this.destroyCarousel(),this.initCarousel()}next(){this.splide?.go("+1")}prev(){this.splide?.go("-1")}go(e){this.splide?.go(e)}destroy(){this.destroyCarousel(),this.listeners.clear(),this.container.innerHTML=""}getCollection(){return this.collectionData}},e.JaaqCollectionPlayerElement=yn,e.JaaqPlayer=gn,e.JaaqVideoPlayer=d,e.JaaqVideoPlayerElement=vn,e.isRegistered=function(){return"undefined"!=typeof window&&"undefined"!=typeof customElements&&(!!customElements.get(bn)&&!!customElements.get(xn))},e.registerJaaqComponents=wn});
8
8
  //# sourceMappingURL=jaaq-vanilla.min.js.map