{"version":3,"sources":["webpack:///./cartridges/app_storefront_base/cartridge/client/default/js/product/base.js","webpack:///./node_modules/tippy.js/esm/index.all.js","webpack:///./cartridges/app_tfg/cartridge/client/default/js/components/tooltip.js","webpack:///./cartridges/app_tfg/cartridge/client/default/js/product/base.js","webpack:///./cartridges/app_tfg/cartridge/client/default/js/product/components/attributes.js","webpack:///./cartridges/app_tfg/cartridge/client/default/js/product/components/imageCarousel.js","webpack:///./node_modules/lightgallery/lightgallery.es5.js","webpack:///./node_modules/lightgallery/plugins/thumbnail/lg-thumbnail.es5.js","webpack:///./node_modules/lightgallery/plugins/video/lg-video.es5.js","webpack:///./node_modules/lightgallery/plugins/zoom/lg-zoom.es5.js","webpack:///./node_modules/pinch-zoom-js/src/pinch-zoom.js","webpack:///./cartridges/app_tfg/cartridge/client/default/js/product/components/imageGallery.js","webpack:///./cartridges/app_tfg/cartridge/client/default/js/product/components/videoPlayer.js","webpack:///./cartridges/app_tfg/cartridge/client/default/js/thirdParty/bootstrap/carouselSwipe.js","webpack:///./node_modules/tippy.js/node_modules/popper.js/dist/esm/popper.js"],"names":["$","pid","$el","getQuantitySelector","attr","$attrValue","$productContainer","attrValue","$swatchAnchor","$attr","$defaultOption","attrsWithSwatches","attrs","processSwatchValues","processNonSwatchValues","availabilityValue","availabilityMessages","response","product","message","resources","html","promotions","promotion","attributes","attributeGroup","attribute","options","$optionEl","option","valueEl","value","isChoiceOfBonusProducts","updateAttrs","isVaraint","primaryImageUrls","imageUrl","$priceSelector","getPromotionsHtml","updateAvailability","$selectButton","getAttributesHtml","optionsHtml","selected","quantity","url","container","method","success","handleVariantResponse","updateOptions","data","updateQuantities","error","$html","body","footer","bonusUrl","htmlString","dataType","parsedHtml","parseHtml","messageType","Object","chooseBonusProducts","setTimeout","childProducts","parseInt","JSON","$elOption","urlValue","selectedValueId","optionId","attributeSelect","methods","editBonusProducts","colorAttribute","e","selectAttribute","availability","addToCart","setPids","qty","getOptions","pidsObj","getPidValue","addToCartUrl","getAddToCartUrl","form","getChildProducts","getQuantitySelected","handlePostCartAdd","selectBonusProduct","$choiceOfBonusProduct","maxPids","submittedQty","totalQty","optionID","valueId","selectedBonusProductHtml","removeBonusProduct","$selected","count","enableBonusProductSelection","showMoreBonusProducts","addBonusProductsToCart","$readyToOrderBonusProducts","queryString","pidsObject","bonusProducts","qtyOption","location","DEFAULTS","arrow","animation","appendTo","placement","interactive","theme","maxWidth","assign","initTooltip","selector","tippy","CONSTANTS","ADD_NOTIFICATION_DISPLAY_TIME","CLASSES","ATTRIBUTE_HAS_ERROR","SELECTORS","DETAILS","VARIANT_DETAILS","SET_DETAILS","ATTRIBUTES_CONTAINER","ATTRIBUTE","ATTRIBUTE_VALUE","ATTRIBUTE_ERROR","ATTRIBUTE_DROPDOWN","ADD_TO_BASKET_NOTIFICATION","ADD_TO_WISHLIST_NOTIFICATION","SELECTED_ATTRIBUTE_VALUE","getDetailsContainer","child","productContainer","closest","handleAttributeChange","el","isActiveATBMsg","index","$element","parent","length","sameClassElements","find","document","querySelectorAll","classList","contains","querySelector","dispatchEvent","CustomEvent","loadContent","pview","dataset","content","tempContainer","createElement","innerHTML","detailsOnly","outerHTML","PayPalSDK","Messages","render","convertSizes","base","selectVariationPrompt","ispreorder","getAttribute","preorderDisplayMessage","deliveryAccordion","preOrderMessage","remove","add","isLG","removeClass","stickyHeaderScrollHandle","isSizeEL","eq","addClass","isNotify","on","handleErrorField","forEach","attrObj","attrContainer","id","attrErrorContainer","handleErrorFieldForMultipleFields","attributeContainer","onEvent","preventDefault","delegateTarget","action","dropdown","appendAttributeValuesToAddRequest","selectedValues","selectedValuesMap","Array","from","reduce","map","stringify","lastClickedButton","target","$button","notification","parents","attributeErrors","handlePostWishlistAdd","addEventListener","styleFlyouts","toggleOpenedClass","toggle","FLYOUT_EVENTS","FLYOUT_OPEN","bind","FLYOUT_CLOSE","getJSONData","keys","initSizeConversions","ATTRIBUTE_TOOLTIP","tooltip","GLOBALS","CAROUSELS","CAROUSEL","CAROUSEL_CONTAINER","QUICKVIEW_MODAL","clearCarousel","carouselElement","currentCarousel","carousel","currentCarouselIndex","findIndex","splice","disableCarousel","swipeDisabled","enableCarousel","initQuickviewCleanup","quickViewModal","initCarousel","push","interval","addUniqueEventListener","GALLERY_EVENTS","PINCH_ZOOM_START","PINCH_ZOOM_END","GLOBAL_PINCH","PINCH_ZOOM","pinchZoomObj","update","type","forceCarousel","isProductSet","carousels","initCarouselSwipability","PINCH_ZOOM_TOGGLED","PLUGIN","EVENTS","GALLERY","IMAGE_WRAPPER","TOOLBAR","SLIDE","MAIN_IMAGE","PDP_GALLERY_EVENTS","OPEN","addMouseMoveEvent","image","style","top","mouseEvent","toolbar","imgHeight","clientHeight","windowHeight","window","outerHeight","toolbarHeight","mouseY","clientY","verticalOffsetPercent","imageOffset","calculatedOffset","Math","min","scrollInitialized","handleZoomOutVideo","currentVideoSlide","height","innerHeight","offsetHeight","initGallery","enableZoomControls","zoomControls","imageWrapper","width","outerWidth","plugin","lightGallery","plugins","lgZoom","lgThumbnail","lgVideo","thumbnail","enableDrag","download","controls","actualSize","counter","autoplayVideoOnSlide","autoplayvideo","gotoNextSlideOnVideoEnd","gotonextslideonvideoend","zoomFromOrigin","vimeoPlayerParams","loop","playvideoinloop","autopause","autoPlay","responsive","maincontainer","zoomIn","slides","slide","videoEle","getElementById","playButton","thumbnailArea","zoomIconsWrapper","searchIcon","zoomIcons","out","in","appendChild","zoomLevel","scale","handlePinchZoom","initialized","images","imgElement","PinchZoom","draggableUnzoomed","minZoom","setOffsetsOnce","onZoomUpdate","zoomObj","zoomStart","zoomFactor","zoomEnd","initImageGallery","imgObj","videoButton","galleryId","imageWrappers","item","items","destroy","lgData","videoPlayer","pauseButton","displayPlayButton","hidePlayButton","displayPauseButton","hidePauseButton","playVideo","isPlayVideo","bannerImgElement","videoWrapper","imageCarousel","imageElement","videoElement","videoid","autoplay","offsetWidth","muted","Vimeo","Player","play","pause","carouselControlNext","carouselControlPrev","thumbPlayBtn","thumbImgs","touchstartY","touchendY","videoSlot","videoslot","thumbBtn","src","thumbBtnSrc","lgItemId","player","click","getPaused","then","paused","changedTouches","screenY","bcSwipe","settings","config","threshold","stillMoving","start","documentElement","onTouchStart","touches","pageX","onTouchMove","x","difference","abs","cancelTouch","removeEventListener"],"mappings":";;;;;;;;;;;AAAA;AAAA,yCAAa;AAEb;;;;;;AAKA,0BAA0B;AACtB;;AAEA,MAAIA,CAAC,CAADA,iBAAC,CAADA,qBAAyC,CAACA,CAAC,CAADA,cAAC,CAADA,CAA9C,QAAwE;AACpEC,OAAG,GAAGD,CAAC,CAADA,GAAC,CAADA,2DAANC,KAAMD,CAANC;AADJ,SAEO,IAAID,CAAC,CAADA,qBAAC,CAADA,WAAmCA,CAAC,CAADA,cAAC,CAADA,CAAvC,QAAiE;AACpEC,OAAG,GAAGD,CAAC,CAADA,GAAC,CAADA,gDAANC,IAAMD,EAANC;AADG,SAEA;AACHA,OAAG,GAAGD,CAAC,CAADA,qCAAC,CAADA,MAANC,KAAMD,CAANC;AACH;;AAED;AACH;AAED;;;;;;;AAKA,kCAAkC;AAC9B,SAAOC,GAAG,IAAIF,CAAC,CAADA,YAAC,CAADA,CAAPE,SACDF,CAAC,CAADA,GAAC,CAADA,iCADCE,kBACDF,CADCE,GAEDF,CAAC,CAFP,kBAEO,CAFP;AAGH;AAED;;;;;;;AAKA,kCAAkC;AAC9B,SAAOG,mBAAmB,CAAnBA,GAAmB,CAAnBA,CAAP,GAAOA,EAAP;AACH;AAED;;;;;;;;;;;;;;;AAaA,sDAAsD;AAClDC,MAAI,CAAJA,eAAoB,qBAAqB;AACrC,QAAIC,UAAU,GAAGC,iBAAiB,CAAjBA,KAAuB,iBAAiBF,IAAI,CAArB,+BACpCG,SAAS,CAD2B,QAAxC,IAAiBD,CAAjB;AAEA,QAAIE,aAAa,GAAGH,UAAU,CAA9B,MAAoBA,EAApB;;AAEA,QAAIE,SAAS,CAAb,UAAwB;AACpBF,gBAAU,CAAVA;AADJ,WAEO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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,YAAY;AACZ;;AAEA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA,SAAS,wBAAc;AACvB,WAAW;AACX;AACA;AACA;AACA,WAAW,IAAI;AACf,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,IAAI;AACf,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,MAAM;AACjB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,IAAI;AACf;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,eAAe;AAC1B;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,WAAW,QAAQ;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;AACH;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;AACH;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;AACH;AACA,GAAG;;;AAGH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEA;AACA,mFAAmF;AACnF;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,WAAW;AACtB,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;;AAE9B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;;AAGH;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,YAAY;AACZ;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA,GAAG,IAAI;AACP;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,oDAAoD;AACpD,0DAA0D;AAC1D;AACA,oBAAoB;AACpB;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA,uBAAuB;AACvB;AACA,GAAG,6BAA6B;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA,SAAS,wBAAc;AACvB;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;AAEA;AACA,wDAAwD;;AAExD;AACA;AACA;AACA;AACA;;;AAGA,4BAA4B;;AAE5B,gCAAgC;;AAEhC,wBAAwB;;AAExB,wBAAwB;;AAExB,gCAAgC;;AAEhC,kEAAkE;;;AAGlE,qBAAqB;;AAErB,4HAA4H;;AAE5H;AACA;AACA;;AAEA,uBAAuB;;AAEvB,8CAA8C;AAC9C;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG,EAAE,8BAA8B;;AAEnC,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;;AAGH;AACA;AACA,GAAG;;;AAGH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;AACA,uEAAuE;;AAEvE;AACA,yEAAyE;;AAEzE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B;AAC/B;;AAEA;AACA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAM;AACxC;AACA,KAAK;AACL,4BAA4B,8CAA8C;AAC1E;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA,KAAK;AACL,iCAAiC,wBAAc;AAC/C;;AAEA,QAAQ,wBAAc,wBAAwB,wBAAc;AAC5D;AACA;AACA;;AAEA,QAAQ,wBAAc;AACtB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe,wBAAc;AAC7B,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;;;AAGA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA,KAAK;;;AAGL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,KAAK;AACL;;;AAGA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yCAAyC;AACpD,WAAW,OAAO;AAClB,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yBAAyB,qBAAqB;AAC9C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D;AAQD,CAZD,E;;;;;;;;;;;;;;;;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD,QAAQ;AACzD,wCAAwC,QAAQ;AAChD,wDAAwD,QAAQ;AAChE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iCAAiC,oBAAoB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,UAAU,EAAE;AAC9C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iCAAiC,EAAE;AAC9E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mBAAmB,EAAE;AACvD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,2BAA2B,EAAE;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,aAAa;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,KAAK;AACL;AACA;AACA,eAAe;AACf,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,6FAA6F,kCAAkC,8BAA8B;AAC7J,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4BAA4B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,qDAAqD;AACrD,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,+BAA+B,6BAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS;AACtC,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,8DAA8D,8DAA8D;AAC5K;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,0DAA0D,eAAe;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iCAAiC,qDAAqD;AACtF;AACA;AACA;AACA,6BAA6B,qDAAqD;AAClF;AACA;AACA;AACA;AACA,iCAAiC;AACjC,wDAAwD;AACxD;AACA;AACA;AACA,6BAA6B,qDAAqD;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEe,iEAAY,EAAC;AAC5B;;;ACzqFA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAI,uBAAQ;AACZ,IAAI,uBAAQ;AACZ,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA,WAAW,uBAAQ;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,yBAAQ;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAQ,CAAC,uBAAQ,GAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,0BAA0B,yBAAQ;AAClC;AACA;AACA,SAAS;AACT,0BAA0B,yBAAQ;AAClC;AACA,SAAS;AACT,0BAA0B,yBAAQ;AAClC;AACA,SAAS;AACT,0BAA0B,yBAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+LAA+L,2CAA2C,gEAAgE;AAC1S;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,yBAAQ;AAClC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAEc,8DAAS,EAAC;AACzB;;;ACleA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAI,mBAAQ;AACZ,IAAI,mBAAQ;AACZ,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAQ;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,qBAAQ;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB,EAAE;AAClD;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAQ,CAAC,mBAAQ,CAAC,mBAAQ,GAAG;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAQ,CAAC,mBAAQ,GAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qBAAQ;AAClC,0BAA0B,qBAAQ;AAClC;AACA;AACA,SAAS;AACT,0BAA0B,qBAAQ;AAClC;AACA,0BAA0B,qBAAQ;AAClC;AACA,0BAA0B,qBAAQ;AAClC;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,qBAAqB;AACrB;AACA;AACA,+BAA+B,8BAA8B;AAC7D;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,qEAAqE;AACrI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAEc,sDAAK,EAAC;AACrB;;;ACthBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAI,kBAAQ;AACZ,IAAI,kBAAQ;AACZ,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAQ;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI,oBAAQ;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAQ,CAAC,kBAAQ,GAAG;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,0BAA0B,oBAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0BAA0B,oBAAQ,8BAA8B,oBAAQ,0BAA0B,oBAAQ,yBAAyB,oBAAQ,6BAA6B,oBAAQ;AAChL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,aAAa;AAC1D;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,0BAA0B,oBAAQ;AAClC;AACA,SAAS;AACT,0BAA0B,oBAAQ;AAClC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0BAA0B,oBAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAEc,oDAAI,EAAC;AACpB;;;ACh8BA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,2BAA2B;AAC3B;AACA;;AAEA;;AAEA,yBAAyB,0BAA0B;AACnD;;AAEA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,6CAA6C,YAAY,EAAE;AAC3D,6CAA6C,YAAY,EAAE;AAC3D;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA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AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,kCAAkC;AACjD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,IAAI;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,YAAY;AACvB,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;AAMD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA,oBAAoB;AACpB;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,aAAa,QAAQ;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,YAAY;AACvB,WAAW,QAAQ;AACnB,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;;AAEA,oBAAoB;AACpB;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA,cAAc;AACd;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd,mBAAmB;AACnB,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,QAAQ;AACtB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,gBAAgB;;AAE5D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,gBAAgB;;AAEtF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,YAAY;AACvB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,yDAAyD;;AAE9E;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,+BAA+B;AAC/B,2BAA2B;AAC3B,gCAAgC;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,gDAAgD;;AAEhD;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,aAAa,MAAM;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,uCAAuC;;AAEvC;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,MAAM;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,cAAc;AAC5B;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA,wBAAwB;AACxB,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B,4BAA4B;AAC5B;;AAEA,qCAAqC;AACrC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,WAAW;AACzB,cAAc,OAAO;AACrB,aAAa,WAAW;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA;AACA,cAAc,MAAM;AACpB;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA,eAAe,mBAAmB;AAClC;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA;AACA,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,WAAW;AAC1B;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,IAAI;AACJ;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kBAAkB;AAC9B;AACA;;AAEA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,kCAAkC;;AAElC;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,WAAW,WAAW;AACtB;;AAEA;AACA;AACA,WAAW,WAAW;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,4BAA4B;AACzC,aAAa,YAAY;AACzB,aAAa,OAAO;AACpB,cAAc,OAAO;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,cAAc;AACd,8BAA8B;;AAE9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B;AAC3B,iDAAiD,uCAAuC,kDAAkD;AAC1I,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA,GAAG;AACH;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,SAAS;AACvB;AACA,cAAc,OAAO;AACrB;AACA,cAAc,OAAO;AACrB;AACA;;;AAGA;AACA;AACA;;AAEe,qEAAM,EAAC;AACtB","file":"js/productDetail~js/productTile~js/search.js","sourcesContent":["'use strict';\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n var pid;\n\n if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n pid = $($el).closest('.modal-content').find('.product-quickview').data('pid');\n } else if ($('.product-set-detail').length || $('.product-set').length) {\n pid = $($el).closest('.product-detail').find('.product-id').text();\n } else {\n pid = $('.product-detail:not(\".bundle-item\")').data('pid');\n }\n\n return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n return $el && $('.set-items').length\n ? $($el).closest('.product-detail').find('.quantity-select')\n : $('.quantity-select');\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processSwatchValues(attr, $productContainer) {\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n attrValue.value + '\"]');\n var $swatchAnchor = $attrValue.parent();\n\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n } else {\n $attrValue.removeClass('selected');\n }\n\n if (attrValue.url) {\n $swatchAnchor.attr('href', attrValue.url);\n } else {\n $swatchAnchor.removeAttr('href');\n }\n\n // Disable if not selectable\n $attrValue.removeClass('selectable unselectable');\n\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n $defaultOption.attr('value', attr.resetUrl);\n\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer\n .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n $attrValue.attr('value', attrValue.url)\n .removeAttr('disabled');\n\n if (!attrValue.selectable) {\n $attrValue.attr('disabled', true);\n }\n });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n * swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAttrs(attrs, $productContainer) {\n // Currently, the only attribute type that has image swatches is Color.\n var attrsWithSwatches = ['color'];\n\n attrs.forEach(function (attr) {\n if (attrsWithSwatches.indexOf(attr.id) > -1) {\n processSwatchValues(attr, $productContainer);\n } else {\n processNonSwatchValues(attr, $productContainer);\n }\n });\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n * attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n if (!response.product.readyToOrder) {\n availabilityValue = '
' + response.resources.info_selectforstock + '
';\n } else {\n availabilityMessages.forEach(function (message) {\n availabilityValue += '
' + message + '
';\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n}\n\n/**\n * Generates html for promotions section\n *\n * @param {array} promotions - list of promotions\n * @return {string} - Compiled HTML\n */\nfunction getPromotionsHtml(promotions) {\n if (!promotions) {\n return '';\n }\n\n var html = '';\n\n promotions.forEach(function (promotion) {\n html += '
' + promotion.calloutMsg +\n '
';\n });\n\n return html;\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n if (!attributes) {\n return '';\n }\n\n var html = '';\n\n attributes.forEach(function (attributeGroup) {\n if (attributeGroup.ID === 'mainAttributes') {\n attributeGroup.attributes.forEach(function (attribute) {\n html += '
' + attribute.label + ': '\n + attribute.value + '
';\n });\n }\n });\n\n return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} options - Ajax response options from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(options, $productContainer) {\n options.forEach(function (option) {\n var $optionEl = $productContainer.find('.product-option[data-option-id*=\"' + option.id\n + '\"]');\n option.values.forEach(function (value) {\n var valueEl = $optionEl.find('option[data-value-id*=\"' + value.id + '\"]');\n valueEl.val(value.url);\n });\n });\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n * attributes have been selected. Used partially to\n * determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n var isChoiceOfBonusProducts =\n $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n var isVaraint;\n if (response.product.variationAttributes) {\n updateAttrs(response.product.variationAttributes, $productContainer);\n isVaraint = response.product.productType === 'variant';\n if (isChoiceOfBonusProducts && isVaraint) {\n $productContainer.parent('.bonus-product-item')\n .data('pid', response.product.id);\n\n $productContainer.parent('.bonus-product-item')\n .data('ready-to-order', response.product.readyToOrder);\n }\n }\n\n // Update primary images\n var primaryImageUrls = response.product.images;\n primaryImageUrls.large.forEach(function (imageUrl, idx) {\n $productContainer.find('.primary-images').find('img').eq(idx)\n .attr('src', imageUrl.url);\n });\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n var $priceSelector = $('.prices .price', $productContainer).length\n ? $('.prices .price', $productContainer)\n : $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update promotions\n $('.promotions').empty().html(getPromotionsHtml(response.product.promotions));\n\n updateAvailability(response, $productContainer);\n\n if (isChoiceOfBonusProducts) {\n var $selectButton = $productContainer.find('.select-bonus-product');\n $selectButton.trigger('bonusproduct:updateSelectButton', {\n product: response.product, $productContainer: $productContainer\n });\n } else {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n product: response.product, $productContainer: $productContainer\n }).trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty()\n .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n * etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n if (!($productContainer.parent('.bonus-product-item').length > 0)) {\n var optionsHtml = quantities.map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n }).join('');\n getQuantitySelector($productContainer).empty().html(optionsHtml);\n }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelect',\n { url: selectedValueUrl, container: $productContainer });\n\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer);\n updateOptions(data.product.options, $productContainer);\n updateQuantities(data.product.quantities, $productContainer);\n $('body').trigger('product:afterAttributeSelect',\n { data: data, container: $productContainer });\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n var $html = $('
').append($.parseHTML(html));\n\n var body = $html.find('.choice-of-bonus-product');\n var footer = $html.find('.modal-footer').children();\n\n return { body: body, footer: footer };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n $('.modal-body').spinner().start();\n\n if ($('#chooseBonusProductModal').length !== 0) {\n $('#chooseBonusProductModal').remove();\n }\n var bonusUrl;\n if (data.bonusChoiceRuleBased) {\n bonusUrl = data.showProductsUrlRuleBased;\n } else {\n bonusUrl = data.showProductsUrlListBased;\n }\n\n var htmlString = ''\n + '
'\n + '
'\n + ''\n + '
'\n + '
'\n + ' ' + data.labels.selectprods + ''\n + ' '\n + '
'\n + '
'\n + '
'\n + '
'\n + '
'\n + '
';\n $('body').append(htmlString);\n $('.modal-body').spinner().start();\n\n $.ajax({\n url: bonusUrl,\n method: 'GET',\n dataType: 'html',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('#chooseBonusProductModal .modal-body').empty();\n $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n $('#chooseBonusProductModal').modal('show');\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n $('.minicart').trigger('count:update', response);\n var messageType = response.error ? 'alert-danger' : 'alert-success';\n // show add to cart toast\n if (response.newBonusDiscountLineItem\n && Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n chooseBonusProducts(response.newBonusDiscountLineItem);\n } else {\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append(\n '
'\n );\n }\n\n $('.add-to-cart-messages').append(\n '
'\n + response.message\n + '
'\n );\n\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n var childProducts = [];\n $('.bundle-item').each(function () {\n childProducts.push({\n pid: $(this).find('.product-id').text(),\n quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n });\n });\n\n return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n var options = $productContainer\n .find('.product-option')\n .map(function () {\n var $elOption = $(this).find('.options-select');\n var urlValue = $elOption.val();\n var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]')\n .data('value-id');\n return {\n optionId: $(this).data('option-id'),\n selectedValueId: selectedValueId\n };\n }).toArray();\n\n return JSON.stringify(options);\n}\n\nmodule.exports = {\n attributeSelect: attributeSelect,\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n }\n },\n colorAttribute: function () {\n $(document).on('click', '[data-attr=\"color\"] a', function (e) {\n e.preventDefault();\n\n if ($(this).attr('disabled')) {\n return;\n }\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n\n attributeSelect(e.currentTarget.href, $productContainer);\n });\n },\n\n selectAttribute: function () {\n $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n attributeSelect(e.currentTarget.value, $productContainer);\n });\n },\n\n availability: function () {\n $(document).on('change', '.quantity-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n }\n\n if ($('.bundle-items', $productContainer).length === 0) {\n attributeSelect($(e.currentTarget).find('option:selected').data('url'),\n $productContainer);\n }\n });\n },\n\n addToCart: function () {\n $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function () {\n var addToCartUrl;\n var pid;\n var pidsObj;\n var setPids;\n\n $('body').trigger('product:beforeAddToCart', this);\n\n if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) {\n setPids = [];\n\n $('.product-detail').each(function () {\n if (!$(this).hasClass('product-set-detail')) {\n setPids.push({\n pid: $(this).find('.product-id').text(),\n qty: $(this).find('.quantity-select').val(),\n options: getOptions($(this))\n });\n }\n });\n pidsObj = JSON.stringify(setPids);\n }\n\n pid = getPidValue($(this));\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail');\n }\n\n addToCartUrl = getAddToCartUrl();\n\n var form = {\n pid: pid,\n pidsObj: pidsObj,\n childProducts: getChildProducts(),\n quantity: getQuantitySelected($(this))\n };\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n $(this).trigger('updateAddToCartFormData', form);\n if (addToCartUrl) {\n $.ajax({\n url: addToCartUrl,\n method: 'POST',\n data: form,\n success: function (data) {\n handlePostCartAdd(data);\n $('body').trigger('product:afterAddToCart', data);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n });\n },\n selectBonusProduct: function () {\n $(document).on('click', '.select-bonus-product', function () {\n var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n var pid = $(this).data('pid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n var submittedQty = parseInt($(this).parents('.choice-of-bonus-product').find('.bonus-quantity-select').val(), 10);\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n totalQty += submittedQty;\n var optionID = $(this).parents('.choice-of-bonus-product').find('.product-option').data('option-id');\n var valueId = $(this).parents('.choice-of-bonus-product').find('.options-select option:selected').data('valueId');\n if (totalQty <= maxPids) {\n var selectedBonusProductHtml = ''\n + '
'\n + '
'\n + $choiceOfBonusProduct.find('.product-name').html()\n + '
'\n + '
'\n + '
'\n ;\n $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n $('.pre-cart-products').html(totalQty);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n } else {\n $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n }\n });\n },\n removeBonusProduct: function () {\n $(document).on('click', '.selected-pid', function () {\n $(this).remove();\n var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n var count = 0;\n if ($selected.length) {\n $selected.each(function () {\n count += parseInt($(this).data('qty'), 10);\n });\n }\n\n $('.pre-cart-products').html(count);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n });\n },\n enableBonusProductSelection: function () {\n $('body').on('bonusproduct:updateSelectButton', function (e, response) {\n $('button.select-bonus-product', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available));\n var pid = response.product.id;\n $('button.select-bonus-product').data('pid', pid);\n });\n },\n showMoreBonusProducts: function () {\n $(document).on('click', '.show-more-bonus-products', function () {\n var url = $(this).data('url');\n $('.modal-content').spinner().start();\n $.ajax({\n url: url,\n method: 'GET',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('.modal-body').append(parsedHtml.body);\n $('.show-more-bonus-products:first').remove();\n $('.modal-content').spinner().stop();\n },\n error: function () {\n $('.modal-content').spinner().stop();\n }\n });\n });\n },\n addBonusProductsToCart: function () {\n $(document).on('click', '.add-bonus-products', function () {\n var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n var queryString = '?pids=';\n var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n var pidsObject = {\n bonusProducts: []\n };\n\n $.each($readyToOrderBonusProducts, function () {\n var qtyOption =\n parseInt($(this)\n .data('qty'), 10);\n\n var option = null;\n if (qtyOption > 0) {\n if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n option = {};\n option.optionId = $(this).data('optionid');\n option.productId = $(this).data('pid');\n option.selectedValueId = $(this).data('option-selected-value');\n }\n pidsObject.bonusProducts.push({\n pid: $(this).data('pid'),\n qty: qtyOption,\n options: [option]\n });\n pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n }\n });\n queryString += JSON.stringify(pidsObject);\n queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid');\n queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid');\n $.spinner().start();\n $.ajax({\n url: url + queryString,\n method: 'POST',\n success: function (data) {\n $.spinner().stop();\n if (data.error) {\n $('.error-choice-of-bonus-products')\n .html(data.errorMessage);\n } else {\n $('.configure-bonus-product-attributes').html(data);\n $('.bonus-products-step2').removeClass('hidden-xl-down');\n $('#chooseBonusProductModal').modal('hide');\n\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append(\n '
'\n );\n }\n $('.minicart-quantity').html(data.totalQty);\n $('.add-to-cart-messages').append(\n '
'\n + data.msgSuccess + '
'\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n if ($('.cart-page').length) {\n location.reload();\n }\n }, 3000);\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected\n};\n","/**!\n* tippy.js v4.0.3\n* (c) 2017-2019 atomiks\n* MIT License\n*/\nimport Popper from 'popper.js';\n\nvar css = \".tippy-iOS{cursor:pointer!important}.tippy-notransition{transition:none}.tippy-popper{transition-timing-function:cubic-bezier(.165,.84,.44,1);max-width:calc(100% - 10px);pointer-events:none;outline:0}.tippy-popper[x-placement^=top] .tippy-backdrop{border-radius:40% 40% 0 0}.tippy-popper[x-placement^=top] .tippy-roundarrow{bottom:-8px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.tippy-popper[x-placement^=top] .tippy-arrow{border-top:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;bottom:-7px;margin:0 6px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-backdrop{-webkit-transform-origin:0 25%;transform-origin:0 25%}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-55%);transform:scale(1) translate(-50%,-55%)}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%,-45%);transform:scale(.2) translate(-50%,-45%);opacity:0}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}.tippy-popper[x-placement^=top] [data-animation=perspective]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(-10px) rotateX(0);transform:perspective(700px) translateY(-10px) rotateX(0)}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateY(0) rotateX(60deg);transform:perspective(700px) translateY(0) rotateX(60deg)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=top] [data-animation=scale]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(-10px) scale(1);transform:translateY(-10px) scale(1)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px) scale(.5);transform:translateY(-10px) scale(.5)}.tippy-popper[x-placement^=bottom] .tippy-backdrop{border-radius:0 0 30% 30%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow{top:-8px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(0);transform:rotate(0)}.tippy-popper[x-placement^=bottom] .tippy-arrow{border-bottom:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;top:-7px;margin:0 6px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-backdrop{-webkit-transform-origin:0 -50%;transform-origin:0 -50%}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-45%);transform:scale(1) translate(-50%,-45%)}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%);transform:scale(.2) translate(-50%);opacity:0}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}.tippy-popper[x-placement^=bottom] [data-animation=perspective]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(10px) rotateX(0);transform:perspective(700px) translateY(10px) rotateX(0)}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateY(0) rotateX(-60deg);transform:perspective(700px) translateY(0) rotateX(-60deg)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=bottom] [data-animation=scale]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(10px) scale(1);transform:translateY(10px) scale(1)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px) scale(.5);transform:translateY(10px) scale(.5)}.tippy-popper[x-placement^=left] .tippy-backdrop{border-radius:50% 0 0 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow{right:-16px;-webkit-transform-origin:33.33333333% 50%;transform-origin:33.33333333% 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.tippy-popper[x-placement^=left] .tippy-arrow{border-left:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;right:-7px;margin:3px 0;-webkit-transform-origin:0 50%;transform-origin:0 50%}.tippy-popper[x-placement^=left] .tippy-backdrop{-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-75%,-50%);transform:scale(.2) translate(-75%,-50%);opacity:0}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}.tippy-popper[x-placement^=left] [data-animation=perspective]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(-10px) rotateY(0);transform:perspective(700px) translateX(-10px) rotateY(0)}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateX(0) rotateY(-60deg);transform:perspective(700px) translateX(0) rotateY(-60deg)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=left] [data-animation=scale]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(-10px) scale(1);transform:translateX(-10px) scale(1)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px) scale(.5);transform:translateX(-10px) scale(.5)}.tippy-popper[x-placement^=right] .tippy-backdrop{border-radius:0 50% 50% 0}.tippy-popper[x-placement^=right] .tippy-roundarrow{left:-16px;-webkit-transform-origin:66.66666666% 50%;transform-origin:66.66666666% 50%}.tippy-popper[x-placement^=right] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.tippy-popper[x-placement^=right] .tippy-arrow{border-right:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;left:-7px;margin:3px 0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.tippy-popper[x-placement^=right] .tippy-backdrop{-webkit-transform-origin:-50% 0;transform-origin:-50% 0}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-25%,-50%);transform:scale(.2) translate(-25%,-50%);opacity:0}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.tippy-popper[x-placement^=right] [data-animation=perspective]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(10px) rotateY(0);transform:perspective(700px) translateX(10px) rotateY(0)}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateX(0) rotateY(60deg);transform:perspective(700px) translateX(0) rotateY(60deg)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=right] [data-animation=scale]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(10px) scale(1);transform:translateX(10px) scale(1)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px) scale(.5);transform:translateX(10px) scale(.5)}.tippy-tooltip{position:relative;color:#fff;border-radius:4px;font-size:.9rem;padding:.3rem .6rem;line-height:1.4;text-align:center;will-change:transform;background-color:#333}.tippy-tooltip[data-size=small]{padding:.2rem .4rem;font-size:.75rem}.tippy-tooltip[data-size=large]{padding:.4rem .8rem;font-size:1rem}.tippy-tooltip[data-animatefill]{overflow:hidden;background-color:transparent}.tippy-tooltip[data-interactive],.tippy-tooltip[data-interactive] path{pointer-events:auto}.tippy-tooltip[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-tooltip[data-inertia][data-state=hidden]{transition-timing-function:ease}.tippy-arrow,.tippy-roundarrow{position:absolute;width:0;height:0}.tippy-roundarrow{width:24px;height:8px;fill:#333;pointer-events:none}.tippy-backdrop{position:absolute;will-change:transform;background-color:#333;border-radius:50%;width:calc(110% + 2rem);left:50%;top:50%;z-index:-1;transition:all cubic-bezier(.46,.1,.52,.98);-webkit-backface-visibility:hidden;backface-visibility:hidden}.tippy-backdrop:after{content:\\\"\\\";float:left;padding-top:100%}.tippy-backdrop+.tippy-content{transition-property:opacity;will-change:opacity}.tippy-backdrop+.tippy-content[data-state=visible]{opacity:1}.tippy-backdrop+.tippy-content[data-state=hidden]{opacity:0}\";\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nvar version = \"4.0.3\";\n\nvar isBrowser = typeof window !== 'undefined';\nvar ua = isBrowser && navigator.userAgent;\nvar isIE = /MSIE |Trident\\//.test(ua);\nvar isUCBrowser = /UCBrowser\\//.test(ua);\nvar isIOS = isBrowser && /iPhone|iPad|iPod/.test(navigator.platform) && !window.MSStream;\n\nvar Defaults = {\n a11y: true,\n allowHTML: true,\n animateFill: true,\n animation: 'shift-away',\n appendTo: function appendTo() {\n return document.body;\n },\n aria: 'describedby',\n arrow: false,\n arrowType: 'sharp',\n boundary: 'scrollParent',\n content: '',\n delay: [0, 20],\n distance: 10,\n duration: [325, 275],\n flip: true,\n flipBehavior: 'flip',\n flipOnUpdate: false,\n followCursor: false,\n hideOnClick: true,\n ignoreAttributes: false,\n inertia: false,\n interactive: false,\n interactiveBorder: 2,\n interactiveDebounce: 0,\n lazy: true,\n maxWidth: 350,\n multiple: false,\n offset: 0,\n onHidden: function onHidden() {},\n onHide: function onHide() {},\n onMount: function onMount() {},\n onShow: function onShow() {},\n onShown: function onShown() {},\n placement: 'top',\n popperOptions: {},\n role: 'tooltip',\n showOnInit: false,\n size: 'regular',\n sticky: false,\n target: '',\n theme: 'dark',\n touch: true,\n touchHold: false,\n trigger: 'mouseenter focus',\n updateDuration: 0,\n wait: null,\n zIndex: 9999\n /**\n * If the set() method encounters one of these, the popperInstance must be\n * recreated\n */\n\n};\nvar POPPER_INSTANCE_DEPENDENCIES = ['arrow', 'arrowType', 'boundary', 'distance', 'flip', 'flipBehavior', 'flipOnUpdate', 'offset', 'placement', 'popperOptions'];\n\nvar Selectors = {\n POPPER: '.tippy-popper',\n TOOLTIP: '.tippy-tooltip',\n CONTENT: '.tippy-content',\n BACKDROP: '.tippy-backdrop',\n ARROW: '.tippy-arrow',\n ROUND_ARROW: '.tippy-roundarrow'\n};\n\nvar elementProto = isBrowser ? Element.prototype : {};\nvar matches = elementProto.matches || elementProto.matchesSelector || elementProto.webkitMatchesSelector || elementProto.mozMatchesSelector || elementProto.msMatchesSelector;\n/**\n * Ponyfill for Array.from - converts iterable values to an array\n * @param {ArrayLike} value\n * @return {any[]}\n */\n\nfunction arrayFrom(value) {\n return [].slice.call(value);\n}\n/**\n * Ponyfill for Element.prototype.closest\n * @param {Element} element\n * @param {String} parentSelector\n * @return {Element}\n */\n\nfunction closest(element, parentSelector) {\n return (elementProto.closest || function (selector) {\n var el = this;\n\n while (el) {\n if (matches.call(el, selector)) return el;\n el = el.parentElement;\n }\n }).call(element, parentSelector);\n}\n/**\n * Works like Element.prototype.closest, but uses a callback instead\n * @param {Element} element\n * @param {Function} callback\n * @return {Element}\n */\n\nfunction closestCallback(element, callback) {\n while (element) {\n if (callback(element)) return element;\n element = element.parentElement;\n }\n}\n\n/**\n * Determines if a value is a \"bare\" virtual element (before mutations done\n * by `polyfillElementPrototypeProperties()`). JSDOM elements show up as\n * [object Object], we can check if the value is \"element-like\" if it has\n * `addEventListener`\n * @param {any} value\n * @return {Boolean}\n */\n\nfunction isBareVirtualElement(value) {\n return {}.toString.call(value) === '[object Object]' && !value.addEventListener;\n}\n/**\n * Safe .hasOwnProperty check, for prototype-less objects\n * @param {Object} obj\n * @param {String} key\n * @return {Boolean}\n */\n\nfunction hasOwnProperty(obj, key) {\n return {}.hasOwnProperty.call(obj, key);\n}\n/**\n * Returns an array of elements based on the value\n * @param {any} value\n * @return {Array}\n */\n\nfunction getArrayOfElements(value) {\n if (isSingular(value)) {\n return [value];\n }\n\n if (value instanceof NodeList) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n try {\n return arrayFrom(document.querySelectorAll(value));\n } catch (e) {\n return [];\n }\n}\n/**\n * Returns a value at a given index depending on if it's an array or number\n * @param {any} value\n * @param {Number} index\n * @param {any} defaultValue\n */\n\nfunction getValue(value, index, defaultValue) {\n if (Array.isArray(value)) {\n var v = value[index];\n return v == null ? defaultValue : v;\n }\n\n return value;\n}\n/**\n * Debounce utility\n * @param {Function} fn\n * @param {Number} ms\n */\n\nfunction debounce(fn, ms) {\n var timeoutId;\n return function () {\n var _this = this,\n _arguments = arguments;\n\n clearTimeout(timeoutId);\n timeoutId = setTimeout(function () {\n return fn.apply(_this, _arguments);\n }, ms);\n };\n}\n/**\n * Prevents errors from being thrown while accessing nested modifier objects\n * in `popperOptions`\n * @param {Object} obj\n * @param {String} key\n * @return {Object|undefined}\n */\n\nfunction getModifier(obj, key) {\n return obj && obj.modifiers && obj.modifiers[key];\n}\n/**\n * Determines if an array or string includes a value\n * @param {Array|String} a\n * @param {any} b\n * @return {Boolean}\n */\n\nfunction includes(a, b) {\n return a.indexOf(b) > -1;\n}\n/**\n * Determines if the value is singular-like\n * @param {any} value\n * @return {Boolean}\n */\n\nfunction isSingular(value) {\n return !!value && value.isVirtual || value instanceof Element;\n}\n/**\n * Tricking bundlers, linters, and minifiers\n * @return {String}\n */\n\nfunction innerHTML() {\n return 'innerHTML';\n}\n/**\n * Evaluates a function if one, or returns the value\n * @param {any} value\n * @param {any[]} args\n * @return {Boolean}\n */\n\nfunction evaluateValue(value, args) {\n return typeof value === 'function' ? value.apply(null, args) : value;\n}\n/**\n * Sets a popperInstance `flip` modifier's enabled state\n * @param {Object[]} modifiers\n * @param {any} value\n */\n\nfunction setFlipModifierEnabled(modifiers, value) {\n modifiers.filter(function (m) {\n return m.name === 'flip';\n })[0].enabled = value;\n}\n\n/**\n * Returns a new `div` element\n * @return {HTMLDivElement}\n */\n\nfunction div() {\n return document.createElement('div');\n}\n/**\n * Sets the innerHTML of an element while tricking linters & minifiers\n * @param {HTMLElement} el\n * @param {Element|String} html\n */\n\nfunction setInnerHTML(el, html) {\n el[innerHTML()] = html instanceof Element ? html[innerHTML()] : html;\n}\n/**\n * Sets the content of a tooltip\n * @param {HTMLElement} contentEl\n * @param {Object} props\n */\n\nfunction setContent(contentEl, props) {\n if (props.content instanceof Element) {\n setInnerHTML(contentEl, '');\n contentEl.appendChild(props.content);\n } else {\n contentEl[props.allowHTML ? 'innerHTML' : 'textContent'] = props.content;\n }\n}\n/**\n * Returns the child elements of a popper element\n * @param {HTMLElement} popper\n * @return {Object}\n */\n\nfunction getChildren(popper) {\n return {\n tooltip: popper.querySelector(Selectors.TOOLTIP),\n backdrop: popper.querySelector(Selectors.BACKDROP),\n content: popper.querySelector(Selectors.CONTENT),\n arrow: popper.querySelector(Selectors.ARROW) || popper.querySelector(Selectors.ROUND_ARROW)\n };\n}\n/**\n * Adds `data-inertia` attribute\n * @param {HTMLElement} tooltip\n */\n\nfunction addInertia(tooltip) {\n tooltip.setAttribute('data-inertia', '');\n}\n/**\n * Removes `data-inertia` attribute\n * @param {HTMLElement} tooltip\n */\n\nfunction removeInertia(tooltip) {\n tooltip.removeAttribute('data-inertia');\n}\n/**\n * Creates an arrow element and returns it\n * @return {HTMLDivElement}\n */\n\nfunction createArrowElement(arrowType) {\n var arrow = div();\n\n if (arrowType === 'round') {\n arrow.className = 'tippy-roundarrow';\n setInnerHTML(arrow, '');\n } else {\n arrow.className = 'tippy-arrow';\n }\n\n return arrow;\n}\n/**\n * Creates a backdrop element and returns it\n * @return {HTMLDivElement}\n */\n\nfunction createBackdropElement() {\n var backdrop = div();\n backdrop.className = 'tippy-backdrop';\n backdrop.setAttribute('data-state', 'hidden');\n return backdrop;\n}\n/**\n * Adds interactive-related attributes\n * @param {HTMLElement} popper\n * @param {HTMLElement} tooltip\n */\n\nfunction addInteractive(popper, tooltip) {\n popper.setAttribute('tabindex', '-1');\n tooltip.setAttribute('data-interactive', '');\n}\n/**\n * Removes interactive-related attributes\n * @param {HTMLElement} popper\n * @param {HTMLElement} tooltip\n */\n\nfunction removeInteractive(popper, tooltip) {\n popper.removeAttribute('tabindex');\n tooltip.removeAttribute('data-interactive');\n}\n/**\n * Applies a transition duration to a list of elements\n * @param {Array} els\n * @param {Number} value\n */\n\nfunction applyTransitionDuration(els, value) {\n els.forEach(function (el) {\n if (el) {\n el.style.transitionDuration = \"\".concat(value, \"ms\");\n }\n });\n}\n/**\n * Add/remove transitionend listener from tooltip\n * @param {Element} tooltip\n * @param {String} action\n * @param {Function} listener\n */\n\nfunction toggleTransitionEndListener(tooltip, action, listener) {\n // UC Browser hasn't adopted the `transitionend` event despite supporting\n // unprefixed transitions...\n var eventName = isUCBrowser && document.body.style.WebkitTransition !== undefined ? 'webkitTransitionEnd' : 'transitionend';\n tooltip[action + 'EventListener'](eventName, listener);\n}\n/**\n * Returns the popper's placement, ignoring shifting (top-start, etc)\n * @param {Element} popper\n * @return {String}\n */\n\nfunction getPopperPlacement(popper) {\n var fullPlacement = popper.getAttribute('x-placement');\n return fullPlacement ? fullPlacement.split('-')[0] : '';\n}\n/**\n * Sets the visibility state to elements so they can begin to transition\n * @param {Array} els\n * @param {String} state\n */\n\nfunction setVisibilityState(els, state) {\n els.forEach(function (el) {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\n/**\n * Triggers reflow\n * @param {Element} popper\n */\n\nfunction reflow(popper) {\n void popper.offsetHeight;\n}\n/**\n * Adds/removes theme from tooltip's classList\n * @param {HTMLDivElement} tooltip\n * @param {String} action\n * @param {String} theme\n */\n\nfunction toggleTheme(tooltip, action, theme) {\n theme.split(' ').forEach(function (themeName) {\n tooltip.classList[action](themeName + '-theme');\n });\n}\n/**\n * Constructs the popper element and returns it\n * @param {Number} id\n * @param {Object} props\n * @return {HTMLDivElement}\n */\n\nfunction createPopperElement(id, props) {\n var popper = div();\n popper.className = 'tippy-popper';\n popper.id = \"tippy-\".concat(id);\n popper.style.zIndex = props.zIndex;\n\n if (props.role) {\n popper.setAttribute('role', props.role);\n }\n\n var tooltip = div();\n tooltip.className = 'tippy-tooltip';\n tooltip.style.maxWidth = props.maxWidth + (typeof props.maxWidth === 'number' ? 'px' : '');\n tooltip.setAttribute('data-size', props.size);\n tooltip.setAttribute('data-animation', props.animation);\n tooltip.setAttribute('data-state', 'hidden');\n toggleTheme(tooltip, 'add', props.theme);\n var content = div();\n content.className = 'tippy-content';\n content.setAttribute('data-state', 'hidden');\n\n if (props.interactive) {\n addInteractive(popper, tooltip);\n }\n\n if (props.arrow) {\n tooltip.appendChild(createArrowElement(props.arrowType));\n }\n\n if (props.animateFill) {\n tooltip.appendChild(createBackdropElement());\n tooltip.setAttribute('data-animatefill', '');\n }\n\n if (props.inertia) {\n addInertia(tooltip);\n }\n\n setContent(content, props);\n tooltip.appendChild(content);\n popper.appendChild(tooltip);\n return popper;\n}\n/**\n * Updates the popper element based on the new props\n * @param {HTMLDivElement} popper\n * @param {Object} prevProps\n * @param {Object} nextProps\n */\n\nfunction updatePopperElement(popper, prevProps, nextProps) {\n var _getChildren = getChildren(popper),\n tooltip = _getChildren.tooltip,\n content = _getChildren.content,\n backdrop = _getChildren.backdrop,\n arrow = _getChildren.arrow;\n\n popper.style.zIndex = nextProps.zIndex;\n tooltip.setAttribute('data-size', nextProps.size);\n tooltip.setAttribute('data-animation', nextProps.animation);\n tooltip.style.maxWidth = nextProps.maxWidth + (typeof nextProps.maxWidth === 'number' ? 'px' : '');\n\n if (nextProps.role) {\n popper.setAttribute('role', nextProps.role);\n } else {\n popper.removeAttribute('role');\n }\n\n if (prevProps.content !== nextProps.content) {\n setContent(content, nextProps);\n } // animateFill\n\n\n if (!prevProps.animateFill && nextProps.animateFill) {\n tooltip.appendChild(createBackdropElement());\n tooltip.setAttribute('data-animatefill', '');\n } else if (prevProps.animateFill && !nextProps.animateFill) {\n tooltip.removeChild(backdrop);\n tooltip.removeAttribute('data-animatefill');\n } // arrow\n\n\n if (!prevProps.arrow && nextProps.arrow) {\n tooltip.appendChild(createArrowElement(nextProps.arrowType));\n } else if (prevProps.arrow && !nextProps.arrow) {\n tooltip.removeChild(arrow);\n } // arrowType\n\n\n if (prevProps.arrow && nextProps.arrow && prevProps.arrowType !== nextProps.arrowType) {\n tooltip.replaceChild(createArrowElement(nextProps.arrowType), arrow);\n } // interactive\n\n\n if (!prevProps.interactive && nextProps.interactive) {\n addInteractive(popper, tooltip);\n } else if (prevProps.interactive && !nextProps.interactive) {\n removeInteractive(popper, tooltip);\n } // inertia\n\n\n if (!prevProps.inertia && nextProps.inertia) {\n addInertia(tooltip);\n } else if (prevProps.inertia && !nextProps.inertia) {\n removeInertia(tooltip);\n } // theme\n\n\n if (prevProps.theme !== nextProps.theme) {\n toggleTheme(tooltip, 'remove', prevProps.theme);\n toggleTheme(tooltip, 'add', nextProps.theme);\n }\n}\n/**\n * Runs the callback after the popper's position has been updated\n * update() is debounced with Promise.resolve() or setTimeout()\n * scheduleUpdate() is update() wrapped in requestAnimationFrame()\n * @param {Popper} popperInstance\n * @param {Function} callback\n */\n\nfunction afterPopperPositionUpdates(popperInstance, callback) {\n var popper = popperInstance.popper,\n options = popperInstance.options;\n var onCreate = options.onCreate,\n onUpdate = options.onUpdate;\n\n options.onCreate = options.onUpdate = function (data) {\n reflow(popper);\n callback();\n onUpdate(data);\n options.onCreate = onCreate;\n options.onUpdate = onUpdate;\n };\n}\n/**\n * Hides all visible poppers on the document\n * @param {Object} options\n */\n\nfunction hideAll() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n checkHideOnClick = _ref.checkHideOnClick,\n exclude = _ref.exclude,\n duration = _ref.duration;\n\n arrayFrom(document.querySelectorAll(Selectors.POPPER)).forEach(function (popper) {\n var instance = popper._tippy;\n\n if (instance && (checkHideOnClick ? instance.props.hideOnClick === true : true) && (!exclude || popper !== exclude.popper)) {\n instance.hide(duration);\n }\n });\n}\n/**\n * Determines if the mouse cursor is outside of the popper's interactive border\n * region\n * @param {String} popperPlacement\n * @param {ClientRect} popperRect\n * @param {MouseEvent} event\n * @param {Object} props\n * @return {Boolean}\n */\n\nfunction isCursorOutsideInteractiveBorder(popperPlacement, popperRect, event, props) {\n if (!popperPlacement) {\n return true;\n }\n\n var x = event.clientX,\n y = event.clientY;\n var interactiveBorder = props.interactiveBorder,\n distance = props.distance;\n var exceedsTop = popperRect.top - y > (popperPlacement === 'top' ? interactiveBorder + distance : interactiveBorder);\n var exceedsBottom = y - popperRect.bottom > (popperPlacement === 'bottom' ? interactiveBorder + distance : interactiveBorder);\n var exceedsLeft = popperRect.left - x > (popperPlacement === 'left' ? interactiveBorder + distance : interactiveBorder);\n var exceedsRight = x - popperRect.right > (popperPlacement === 'right' ? interactiveBorder + distance : interactiveBorder);\n return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;\n}\n/**\n * Returns the distance offset, taking into account the default offset due to\n * the transform: translate() rule (10px) in CSS\n * @param {Number} distance\n * @return {String}\n */\n\nfunction getOffsetDistanceInPx(distance) {\n return -(distance - 10) + 'px';\n}\n\nvar PASSIVE = {\n passive: true\n};\nvar PADDING = 3;\n\nvar isUsingTouch = false;\nfunction onDocumentTouch() {\n if (isUsingTouch) {\n return;\n }\n\n isUsingTouch = true;\n\n if (isIOS) {\n document.body.classList.add('tippy-iOS');\n }\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}\nvar lastMouseMoveTime = 0;\nfunction onDocumentMouseMove() {\n var now = performance.now(); // Chrome 60+ is 1 mousemove per animation frame, use 20ms time difference\n\n if (now - lastMouseMoveTime < 20) {\n isUsingTouch = false;\n document.removeEventListener('mousemove', onDocumentMouseMove);\n\n if (!isIOS) {\n document.body.classList.remove('tippy-iOS');\n }\n }\n\n lastMouseMoveTime = now;\n}\nfunction onDocumentClick(_ref) {\n var target = _ref.target;\n\n // Simulated events dispatched on the document\n if (!(target instanceof Element)) {\n return hideAll();\n } // Clicked on an interactive popper\n\n\n var popper = closest(target, Selectors.POPPER);\n\n if (popper && popper._tippy && popper._tippy.props.interactive) {\n return;\n } // Clicked on a reference\n\n\n var reference = closestCallback(target, function (el) {\n return el._tippy && el._tippy.reference === el;\n });\n\n if (reference) {\n var instance = reference._tippy;\n var isClickTrigger = includes(instance.props.trigger, 'click');\n\n if (isUsingTouch || isClickTrigger) {\n return hideAll({\n exclude: instance,\n checkHideOnClick: true\n });\n }\n\n if (instance.props.hideOnClick !== true || isClickTrigger) {\n return;\n }\n\n instance.clearDelayTimeouts();\n }\n\n hideAll({\n checkHideOnClick: true\n });\n}\nfunction onWindowBlur() {\n var _document = document,\n activeElement = _document.activeElement;\n\n if (activeElement && activeElement.blur && activeElement._tippy) {\n activeElement.blur();\n }\n}\n/**\n * Adds the needed global event listeners\n */\n\nfunction bindGlobalEventListeners() {\n document.addEventListener('click', onDocumentClick, true);\n document.addEventListener('touchstart', onDocumentTouch, PASSIVE);\n window.addEventListener('blur', onWindowBlur);\n}\n\nvar keys = Object.keys(Defaults);\n/**\n * Determines if an element can receive focus\n * @param {Element|Object} el\n * @return {Boolean}\n */\n\nfunction canReceiveFocus(el) {\n return el instanceof Element ? matches.call(el, 'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]') && !el.hasAttribute('disabled') : true;\n}\n/**\n * Returns an object of optional props from data-tippy-* attributes\n * @param {Element|Object} reference\n * @return {Object}\n */\n\nfunction getDataAttributeOptions(reference) {\n return keys.reduce(function (acc, key) {\n var valueAsString = (reference.getAttribute(\"data-tippy-\".concat(key)) || '').trim();\n\n if (!valueAsString) {\n return acc;\n }\n\n if (key === 'content') {\n acc[key] = valueAsString;\n } else {\n try {\n acc[key] = JSON.parse(valueAsString);\n } catch (e) {\n acc[key] = valueAsString;\n }\n }\n\n return acc;\n }, {});\n}\n/**\n * Polyfills the virtual reference (plain object) with Element.prototype props\n * Mutating because DOM elements are mutated, adds `_tippy` property\n * @param {Object} virtualReference\n */\n\nfunction polyfillElementPrototypeProperties(virtualReference) {\n var polyfills = {\n isVirtual: true,\n attributes: virtualReference.attributes || {},\n setAttribute: function setAttribute(key, value) {\n virtualReference.attributes[key] = value;\n },\n getAttribute: function getAttribute(key) {\n return virtualReference.attributes[key];\n },\n removeAttribute: function removeAttribute(key) {\n delete virtualReference.attributes[key];\n },\n hasAttribute: function hasAttribute(key) {\n return key in virtualReference.attributes;\n },\n addEventListener: function addEventListener() {},\n removeEventListener: function removeEventListener() {},\n classList: {\n classNames: {},\n add: function add(key) {\n virtualReference.classList.classNames[key] = true;\n },\n remove: function remove(key) {\n delete virtualReference.classList.classNames[key];\n },\n contains: function contains(key) {\n return key in virtualReference.classList.classNames;\n }\n }\n };\n\n for (var key in polyfills) {\n virtualReference[key] = polyfills[key];\n }\n}\n\n/**\n * Evaluates the props object by merging data attributes and\n * disabling conflicting options where necessary\n * @param {Element} reference\n * @param {Object} props\n * @return {Object}\n */\n\nfunction evaluateProps(reference, props) {\n var out = _extends({}, props, {\n content: evaluateValue(props.content, [reference])\n }, props.ignoreAttributes ? {} : getDataAttributeOptions(reference));\n\n if (out.arrow || isUCBrowser) {\n out.animateFill = false;\n }\n\n return out;\n}\n/**\n * Validates an object of options with the valid default props object\n * @param {Object} options\n * @param {Object} defaults\n */\n\nfunction validateOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var defaults = arguments.length > 1 ? arguments[1] : undefined;\n Object.keys(options).forEach(function (option) {\n if (!hasOwnProperty(defaults, option)) {\n throw new Error(\"[tippy]: `\".concat(option, \"` is not a valid option\"));\n }\n });\n}\n\nvar idCounter = 1;\n/**\n * Creates and returns a Tippy object. We're using a closure pattern instead of\n * a class so that the exposed object API is clean without private members\n * prefixed with `_`.\n * @param {Element} reference\n * @param {Object} collectionProps\n * @return {Object} instance\n */\n\nfunction createTippy(reference, collectionProps) {\n var props = evaluateProps(reference, collectionProps); // If the reference shouldn't have multiple tippys, return null early\n\n if (!props.multiple && reference._tippy) {\n return null;\n }\n /* ======================= 🔒 Private members 🔒 ======================= */\n // The last trigger event object that caused the tippy to show\n\n\n var lastTriggerEvent = {}; // The last mousemove event object created by the document mousemove event\n\n var lastMouseMoveEvent = null; // Timeout created by the show delay\n\n var showTimeoutId = 0; // Timeout created by the hide delay\n\n var hideTimeoutId = 0; // Flag to determine if the tippy is preparing to show due to the show timeout\n\n var isPreparingToShow = false; // The current `transitionend` callback reference\n\n var transitionEndListener = function transitionEndListener() {}; // Array of event listeners currently attached to the reference element\n\n\n var listeners = []; // Private onMouseMove handler reference, debounced or not\n\n var debouncedOnMouseMove = props.interactiveDebounce > 0 ? debounce(onMouseMove, props.interactiveDebounce) : onMouseMove; // Node the tippy is currently appended to\n\n var parentNode = null;\n /* ======================= 🔑 Public members 🔑 ======================= */\n // id used for the `aria-describedby` / `aria-labelledby` attribute\n\n var id = idCounter++; // Popper element reference\n\n var popper = createPopperElement(id, props); // Prevent a tippy with a delay from hiding if the cursor left then returned\n // before it started hiding\n\n popper.addEventListener('mouseenter', function (event) {\n if (instance.props.interactive && instance.state.isVisible && lastTriggerEvent.type === 'mouseenter') {\n prepareShow(event);\n }\n });\n popper.addEventListener('mouseleave', function () {\n if (instance.props.interactive && lastTriggerEvent.type === 'mouseenter') {\n document.addEventListener('mousemove', debouncedOnMouseMove);\n }\n }); // Popper element children: { arrow, backdrop, content, tooltip }\n\n var popperChildren = getChildren(popper); // The state of the tippy\n\n var state = {\n // If the tippy is currently enabled\n isEnabled: true,\n // show() invoked, not currently transitioning out\n isVisible: false,\n // If the tippy has been destroyed\n isDestroyed: false,\n // If the tippy is on the DOM (transitioning out or in)\n isMounted: false,\n // show() transition finished\n isShown: false // Popper.js instance for the tippy is lazily created\n\n };\n var popperInstance = null; // 🌟 tippy instance\n\n var instance = {\n // properties\n id: id,\n reference: reference,\n popper: popper,\n popperChildren: popperChildren,\n popperInstance: popperInstance,\n props: props,\n state: state,\n // methods\n clearDelayTimeouts: clearDelayTimeouts,\n set: set,\n setContent: setContent$$1,\n show: show,\n hide: hide,\n enable: enable,\n disable: disable,\n destroy: destroy\n };\n addTriggersToReference();\n\n if (!props.lazy) {\n createPopperInstance();\n instance.popperInstance.disableEventListeners();\n }\n\n if (props.showOnInit) {\n prepareShow();\n } // Ensure the reference element can receive focus (and is not a delegate)\n\n\n if (props.a11y && !props.target && !canReceiveFocus(reference)) {\n reference.setAttribute('tabindex', '0');\n } // Install shortcuts\n\n\n reference._tippy = instance;\n popper._tippy = instance;\n return instance;\n /* ======================= 🔒 Private methods 🔒 ======================= */\n\n /**\n * Positions the virtual reference near the mouse cursor\n */\n\n function positionVirtualReferenceNearCursor(event) {\n var _lastMouseMoveEvent = lastMouseMoveEvent = event,\n clientX = _lastMouseMoveEvent.clientX,\n clientY = _lastMouseMoveEvent.clientY;\n\n if (!instance.popperInstance) {\n return;\n } // Ensure virtual reference is padded to prevent tooltip from\n // overflowing. Maybe Popper.js issue?\n\n\n var placement = getPopperPlacement(instance.popper);\n var padding = instance.popperChildren.arrow ? PADDING + 16 : PADDING;\n var isVerticalPlacement = includes(['top', 'bottom'], placement);\n var isHorizontalPlacement = includes(['left', 'right'], placement); // Top / left boundary\n\n var x = isVerticalPlacement ? Math.max(padding, clientX) : clientX;\n var y = isHorizontalPlacement ? Math.max(padding, clientY) : clientY; // Bottom / right boundary\n\n if (isVerticalPlacement && x > padding) {\n x = Math.min(clientX, window.innerWidth - padding);\n }\n\n if (isHorizontalPlacement && y > padding) {\n y = Math.min(clientY, window.innerHeight - padding);\n }\n\n var rect = instance.reference.getBoundingClientRect();\n var followCursor = instance.props.followCursor;\n var isHorizontal = followCursor === 'horizontal';\n var isVertical = followCursor === 'vertical';\n instance.popperInstance.reference = {\n getBoundingClientRect: function getBoundingClientRect() {\n return {\n width: 0,\n height: 0,\n top: isHorizontal ? rect.top : y,\n bottom: isHorizontal ? rect.bottom : y,\n left: isVertical ? rect.left : x,\n right: isVertical ? rect.right : x\n };\n },\n clientWidth: 0,\n clientHeight: 0\n };\n instance.popperInstance.scheduleUpdate();\n\n if (followCursor === 'initial' && instance.state.isVisible) {\n removeFollowCursorListener();\n }\n }\n /**\n * Creates the tippy instance for a delegate when it's been triggered\n */\n\n\n function createDelegateChildTippy(event) {\n var targetEl = closest(event.target, instance.props.target);\n\n if (targetEl && !targetEl._tippy) {\n createTippy(targetEl, _extends({}, instance.props, {\n content: evaluateValue(collectionProps.content, [targetEl]),\n appendTo: collectionProps.appendTo,\n target: '',\n showOnInit: true\n }));\n prepareShow(event);\n }\n }\n /**\n * Setup before show() is invoked (delays, etc.)\n */\n\n\n function prepareShow(event) {\n clearDelayTimeouts();\n\n if (instance.state.isVisible) {\n return;\n } // Is a delegate, create an instance for the child target\n\n\n if (instance.props.target) {\n return createDelegateChildTippy(event);\n }\n\n isPreparingToShow = true;\n\n if (instance.props.wait) {\n return instance.props.wait(instance, event);\n } // If the tooltip has a delay, we need to be listening to the mousemove as\n // soon as the trigger event is fired, so that it's in the correct position\n // upon mount.\n // Edge case: if the tooltip is still mounted, but then prepareShow() is\n // called, it causes a jump.\n\n\n if (hasFollowCursorBehavior() && !instance.state.isMounted) {\n document.addEventListener('mousemove', positionVirtualReferenceNearCursor);\n }\n\n var delay = getValue(instance.props.delay, 0, Defaults.delay);\n\n if (delay) {\n showTimeoutId = setTimeout(function () {\n show();\n }, delay);\n } else {\n show();\n }\n }\n /**\n * Setup before hide() is invoked (delays, etc.)\n */\n\n\n function prepareHide() {\n clearDelayTimeouts();\n\n if (!instance.state.isVisible) {\n return removeFollowCursorListener();\n }\n\n isPreparingToShow = false;\n var delay = getValue(instance.props.delay, 1, Defaults.delay);\n\n if (delay) {\n hideTimeoutId = setTimeout(function () {\n if (instance.state.isVisible) {\n hide();\n }\n }, delay);\n } else {\n hide();\n }\n }\n /**\n * Removes the follow cursor listener\n */\n\n\n function removeFollowCursorListener() {\n document.removeEventListener('mousemove', positionVirtualReferenceNearCursor);\n lastMouseMoveEvent = null;\n }\n /**\n * Cleans up old listeners\n */\n\n\n function cleanupOldMouseListeners() {\n document.body.removeEventListener('mouseleave', prepareHide);\n document.removeEventListener('mousemove', debouncedOnMouseMove);\n }\n /**\n * Event listener invoked upon trigger\n */\n\n\n function onTrigger(event) {\n if (!instance.state.isEnabled || isEventListenerStopped(event)) {\n return;\n }\n\n if (!instance.state.isVisible) {\n lastTriggerEvent = event; // Use the `mouseenter` event as a \"mock\" mousemove event for touch\n // devices\n\n if (isUsingTouch && includes(event.type, 'mouse')) {\n lastMouseMoveEvent = event;\n }\n } // Toggle show/hide when clicking click-triggered tooltips\n\n\n if (event.type === 'click' && instance.props.hideOnClick !== false && instance.state.isVisible) {\n prepareHide();\n } else {\n prepareShow(event);\n }\n }\n /**\n * Event listener used for interactive tooltips to detect when they should\n * hide\n */\n\n\n function onMouseMove(event) {\n var referenceTheCursorIsOver = closestCallback(event.target, function (el) {\n return el._tippy;\n });\n var isCursorOverPopper = closest(event.target, Selectors.POPPER) === instance.popper;\n var isCursorOverReference = referenceTheCursorIsOver === instance.reference;\n\n if (isCursorOverPopper || isCursorOverReference) {\n return;\n }\n\n if (isCursorOutsideInteractiveBorder(getPopperPlacement(instance.popper), instance.popper.getBoundingClientRect(), event, instance.props)) {\n cleanupOldMouseListeners();\n prepareHide();\n }\n }\n /**\n * Event listener invoked upon mouseleave\n */\n\n\n function onMouseLeave(event) {\n if (isEventListenerStopped(event)) {\n return;\n }\n\n if (instance.props.interactive) {\n document.body.addEventListener('mouseleave', prepareHide);\n document.addEventListener('mousemove', debouncedOnMouseMove);\n return;\n }\n\n prepareHide();\n }\n /**\n * Event listener invoked upon blur\n */\n\n\n function onBlur(event) {\n if (event.target !== instance.reference) {\n return;\n }\n\n if (instance.props.interactive && event.relatedTarget && instance.popper.contains(event.relatedTarget)) {\n return;\n }\n\n prepareHide();\n }\n /**\n * Event listener invoked when a child target is triggered\n */\n\n\n function onDelegateShow(event) {\n if (closest(event.target, instance.props.target)) {\n prepareShow(event);\n }\n }\n /**\n * Event listener invoked when a child target should hide\n */\n\n\n function onDelegateHide(event) {\n if (closest(event.target, instance.props.target)) {\n prepareHide();\n }\n }\n /**\n * Determines if an event listener should stop further execution due to the\n * `touchHold` option\n */\n\n\n function isEventListenerStopped(event) {\n var supportsTouch = 'ontouchstart' in window;\n var isTouchEvent = includes(event.type, 'touch');\n var touchHold = instance.props.touchHold;\n return supportsTouch && isUsingTouch && touchHold && !isTouchEvent || isUsingTouch && !touchHold && isTouchEvent;\n }\n /**\n * Creates the popper instance for the instance\n */\n\n\n function createPopperInstance() {\n var popperOptions = instance.props.popperOptions;\n var _instance$popperChild = instance.popperChildren,\n tooltip = _instance$popperChild.tooltip,\n arrow = _instance$popperChild.arrow;\n instance.popperInstance = new Popper(instance.reference, instance.popper, _extends({\n placement: instance.props.placement\n }, popperOptions, {\n modifiers: _extends({}, popperOptions ? popperOptions.modifiers : {}, {\n preventOverflow: _extends({\n boundariesElement: instance.props.boundary,\n padding: PADDING\n }, getModifier(popperOptions, 'preventOverflow')),\n arrow: _extends({\n element: arrow,\n enabled: !!arrow\n }, getModifier(popperOptions, 'arrow')),\n flip: _extends({\n enabled: instance.props.flip,\n // The tooltip is offset by 10px from the popper in CSS,\n // we need to account for its distance\n padding: instance.props.distance + PADDING,\n behavior: instance.props.flipBehavior\n }, getModifier(popperOptions, 'flip')),\n offset: _extends({\n offset: instance.props.offset\n }, getModifier(popperOptions, 'offset'))\n }),\n onUpdate: function onUpdate(data) {\n if (instance.props.flip && !instance.props.flipOnUpdate) {\n if (data.flipped) {\n instance.popperInstance.options.placement = data.placement;\n }\n\n setFlipModifierEnabled(instance.popperInstance.modifiers, false);\n }\n\n var styles = tooltip.style;\n styles.top = '';\n styles.bottom = '';\n styles.left = '';\n styles.right = '';\n styles[getPopperPlacement(instance.popper)] = getOffsetDistanceInPx(instance.props.distance);\n\n if (popperOptions.onUpdate) {\n popperOptions.onUpdate(data);\n }\n }\n }));\n }\n /**\n * Mounts the tooltip to the DOM, callback to show tooltip is run **after**\n * popper's position has updated\n */\n\n\n function mount(callback) {\n var shouldEnableListeners = !hasFollowCursorBehavior() && !(instance.props.followCursor === 'initial' && isUsingTouch);\n\n if (!instance.popperInstance) {\n createPopperInstance();\n\n if (!shouldEnableListeners) {\n instance.popperInstance.disableEventListeners();\n }\n } else {\n if (!hasFollowCursorBehavior()) {\n instance.popperInstance.scheduleUpdate();\n\n if (shouldEnableListeners) {\n instance.popperInstance.enableEventListeners();\n }\n }\n\n setFlipModifierEnabled(instance.popperInstance.modifiers, instance.props.flip);\n } // If the instance previously had followCursor behavior, it will be\n // positioned incorrectly if triggered by `focus` afterwards.\n // Update the reference back to the real DOM element\n\n\n instance.popperInstance.reference = instance.reference;\n var arrow = instance.popperChildren.arrow;\n\n if (hasFollowCursorBehavior()) {\n if (arrow) {\n arrow.style.margin = '0';\n }\n\n var delay = getValue(instance.props.delay, 0, Defaults.delay);\n\n if (lastTriggerEvent.type) {\n positionVirtualReferenceNearCursor(delay && lastMouseMoveEvent ? lastMouseMoveEvent : lastTriggerEvent);\n }\n } else if (arrow) {\n arrow.style.margin = '';\n }\n\n afterPopperPositionUpdates(instance.popperInstance, callback);\n var appendTo = instance.props.appendTo;\n parentNode = appendTo === 'parent' ? instance.reference.parentNode : evaluateValue(appendTo, [instance.reference]);\n\n if (!parentNode.contains(instance.popper)) {\n parentNode.appendChild(instance.popper);\n instance.props.onMount(instance);\n instance.state.isMounted = true;\n }\n }\n /**\n * Determines if the instance is in `followCursor` mode\n */\n\n\n function hasFollowCursorBehavior() {\n return instance.props.followCursor && !isUsingTouch && lastTriggerEvent.type !== 'focus';\n }\n /**\n * Updates the tooltip's position on each animation frame + timeout\n */\n\n\n function makeSticky() {\n applyTransitionDuration([instance.popper], isIE ? 0 : instance.props.updateDuration);\n\n var updatePosition = function updatePosition() {\n if (instance.popperInstance) {\n instance.popperInstance.scheduleUpdate();\n }\n\n if (instance.state.isMounted) {\n requestAnimationFrame(updatePosition);\n } else {\n applyTransitionDuration([instance.popper], 0);\n }\n };\n\n updatePosition();\n }\n /**\n * Invokes a callback once the tooltip has fully transitioned out\n */\n\n\n function onTransitionedOut(duration, callback) {\n onTransitionEnd(duration, function () {\n if (!instance.state.isVisible && parentNode && parentNode.contains(instance.popper)) {\n callback();\n }\n });\n }\n /**\n * Invokes a callback once the tooltip has fully transitioned in\n */\n\n\n function onTransitionedIn(duration, callback) {\n onTransitionEnd(duration, callback);\n }\n /**\n * Invokes a callback once the tooltip's CSS transition ends\n */\n\n\n function onTransitionEnd(duration, callback) {\n // Make callback synchronous if duration is 0\n if (duration === 0) {\n return callback();\n }\n\n var tooltip = instance.popperChildren.tooltip;\n\n var listener = function listener(e) {\n if (e.target === tooltip) {\n toggleTransitionEndListener(tooltip, 'remove', listener);\n callback();\n }\n };\n\n toggleTransitionEndListener(tooltip, 'remove', transitionEndListener);\n toggleTransitionEndListener(tooltip, 'add', listener);\n transitionEndListener = listener;\n }\n /**\n * Adds an event listener to the reference and stores it in `listeners`\n */\n\n\n function on(eventType, handler) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n instance.reference.addEventListener(eventType, handler, options);\n listeners.push({\n eventType: eventType,\n handler: handler,\n options: options\n });\n }\n /**\n * Adds event listeners to the reference based on the `trigger` prop\n */\n\n\n function addTriggersToReference() {\n if (instance.props.touchHold && !instance.props.target) {\n on('touchstart', onTrigger, PASSIVE);\n on('touchend', onMouseLeave, PASSIVE);\n }\n\n instance.props.trigger.trim().split(' ').forEach(function (eventType) {\n if (eventType === 'manual') {\n return;\n }\n\n if (!instance.props.target) {\n on(eventType, onTrigger);\n\n switch (eventType) {\n case 'mouseenter':\n on('mouseleave', onMouseLeave);\n break;\n\n case 'focus':\n on(isIE ? 'focusout' : 'blur', onBlur);\n break;\n }\n } else {\n switch (eventType) {\n case 'mouseenter':\n on('mouseover', onDelegateShow);\n on('mouseout', onDelegateHide);\n break;\n\n case 'focus':\n on('focusin', onDelegateShow);\n on('focusout', onDelegateHide);\n break;\n\n case 'click':\n on(eventType, onDelegateShow);\n break;\n }\n }\n });\n }\n /**\n * Removes event listeners from the reference\n */\n\n\n function removeTriggersFromReference() {\n listeners.forEach(function (_ref) {\n var eventType = _ref.eventType,\n handler = _ref.handler,\n options = _ref.options;\n instance.reference.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n /**\n * Returns inner elements used in show/hide methods\n */\n\n\n function getInnerElements() {\n return [instance.popperChildren.tooltip, instance.popperChildren.backdrop, instance.popperChildren.content];\n }\n /* ======================= 🔑 Public methods 🔑 ======================= */\n\n /**\n * Enables the instance to allow it to show or hide\n */\n\n\n function enable() {\n instance.state.isEnabled = true;\n }\n /**\n * Disables the instance to disallow it to show or hide\n */\n\n\n function disable() {\n instance.state.isEnabled = false;\n }\n /**\n * Clears pending timeouts related to the `delay` prop if any\n */\n\n\n function clearDelayTimeouts() {\n clearTimeout(showTimeoutId);\n clearTimeout(hideTimeoutId);\n }\n /**\n * Sets new props for the instance and redraws the tooltip\n */\n\n\n function set() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n validateOptions(options, Defaults);\n var prevProps = instance.props;\n var nextProps = evaluateProps(instance.reference, _extends({}, instance.props, options, {\n ignoreAttributes: true\n }));\n nextProps.ignoreAttributes = hasOwnProperty(options, 'ignoreAttributes') ? options.ignoreAttributes : prevProps.ignoreAttributes;\n instance.props = nextProps;\n\n if (hasOwnProperty(options, 'trigger') || hasOwnProperty(options, 'touchHold')) {\n removeTriggersFromReference();\n addTriggersToReference();\n }\n\n if (hasOwnProperty(options, 'interactiveDebounce')) {\n cleanupOldMouseListeners();\n debouncedOnMouseMove = debounce(onMouseMove, options.interactiveDebounce);\n }\n\n updatePopperElement(instance.popper, prevProps, nextProps);\n instance.popperChildren = getChildren(instance.popper);\n\n if (instance.popperInstance) {\n instance.popperInstance.update();\n\n if (POPPER_INSTANCE_DEPENDENCIES.some(function (prop) {\n return hasOwnProperty(options, prop);\n })) {\n instance.popperInstance.destroy();\n createPopperInstance();\n\n if (!instance.state.isVisible) {\n instance.popperInstance.disableEventListeners();\n }\n\n if (instance.props.followCursor && lastMouseMoveEvent) {\n positionVirtualReferenceNearCursor(lastMouseMoveEvent);\n }\n }\n }\n }\n /**\n * Shortcut for .set({ content: newContent })\n */\n\n\n function setContent$$1(content) {\n set({\n content: content\n });\n }\n /**\n * Shows the tooltip\n */\n\n\n function show() {\n var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue(instance.props.duration, 0, Defaults.duration[0]);\n\n if (instance.state.isDestroyed || !instance.state.isEnabled || isUsingTouch && !instance.props.touch) {\n return;\n } // Destroy tooltip if the reference element is no longer on the DOM\n\n\n if (!instance.reference.isVirtual && !document.documentElement.contains(instance.reference)) {\n return destroy();\n } // Do not show tooltip if the reference element has a `disabled` attribute\n\n\n if (instance.reference.hasAttribute('disabled')) {\n return;\n }\n\n if (instance.props.onShow(instance) === false) {\n return;\n }\n\n instance.popper.style.visibility = 'visible';\n instance.state.isVisible = true;\n\n if (instance.props.interactive) {\n instance.reference.classList.add('tippy-active');\n } // Prevent a transition if the popper is at the opposite placement\n\n\n applyTransitionDuration([instance.popper, instance.popperChildren.tooltip, instance.popperChildren.backdrop], 0);\n mount(function () {\n if (!instance.state.isVisible) {\n return;\n } // Arrow will sometimes not be positioned correctly. Force another update\n\n\n if (!hasFollowCursorBehavior()) {\n instance.popperInstance.update();\n } // Allow followCursor: 'initial' on touch devices\n\n\n if (isUsingTouch && instance.props.followCursor === 'initial') {\n positionVirtualReferenceNearCursor(lastMouseMoveEvent);\n }\n\n applyTransitionDuration([instance.popper], props.updateDuration);\n applyTransitionDuration(getInnerElements(), duration);\n\n if (instance.popperChildren.backdrop) {\n instance.popperChildren.content.style.transitionDelay = Math.round(duration / 12) + 'ms';\n }\n\n if (instance.props.sticky) {\n makeSticky();\n }\n\n setVisibilityState(getInnerElements(), 'visible');\n onTransitionedIn(duration, function () {\n instance.popperChildren.tooltip.classList.add('tippy-notransition');\n\n if (instance.props.aria) {\n instance.reference.setAttribute(\"aria-\".concat(instance.props.aria), instance.popper.id);\n }\n\n instance.props.onShown(instance);\n instance.state.isShown = true;\n });\n });\n }\n /**\n * Hides the tooltip\n */\n\n\n function hide() {\n var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue(instance.props.duration, 1, Defaults.duration[1]);\n\n if (instance.state.isDestroyed || !instance.state.isEnabled) {\n return;\n }\n\n if (instance.props.onHide(instance) === false) {\n return;\n }\n\n instance.popperChildren.tooltip.classList.remove('tippy-notransition');\n\n if (instance.props.interactive) {\n instance.reference.classList.remove('tippy-active');\n }\n\n instance.popper.style.visibility = 'hidden';\n instance.state.isVisible = false;\n instance.state.isShown = false;\n applyTransitionDuration(getInnerElements(), duration);\n setVisibilityState(getInnerElements(), 'hidden');\n onTransitionedOut(duration, function () {\n if (!isPreparingToShow) {\n removeFollowCursorListener();\n }\n\n if (instance.props.aria) {\n instance.reference.removeAttribute(\"aria-\".concat(instance.props.aria));\n }\n\n instance.popperInstance.disableEventListeners();\n instance.popperInstance.options.placement = instance.props.placement;\n parentNode.removeChild(instance.popper);\n instance.props.onHidden(instance);\n instance.state.isMounted = false;\n });\n }\n /**\n * Destroys the tooltip\n */\n\n\n function destroy(destroyTargetInstances) {\n if (instance.state.isDestroyed) {\n return;\n } // If the popper is currently mounted to the DOM, we want to ensure it gets\n // hidden and unmounted instantly upon destruction\n\n\n if (instance.state.isMounted) {\n hide(0);\n }\n\n removeTriggersFromReference();\n delete instance.reference._tippy;\n\n if (instance.props.target && destroyTargetInstances) {\n arrayFrom(instance.reference.querySelectorAll(instance.props.target)).forEach(function (child) {\n if (child._tippy) {\n child._tippy.destroy();\n }\n });\n }\n\n if (instance.popperInstance) {\n instance.popperInstance.destroy();\n }\n\n instance.state.isDestroyed = true;\n }\n}\n\n/**\n * Groups an array of instances by taking control of their props during\n * certain lifecycles.\n * @param {Object[]} targets\n * @param {Object} options\n */\nfunction group(instances) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$delay = _ref.delay,\n delay = _ref$delay === void 0 ? instances[0].props.delay : _ref$delay,\n _ref$duration = _ref.duration,\n duration = _ref$duration === void 0 ? 0 : _ref$duration;\n\n var isAnyTippyOpen = false;\n instances.forEach(function (instance) {\n instance._originalProps = {\n duration: instance.props.duration,\n onHide: instance.props.onHide,\n onShow: instance.props.onShow,\n onShown: instance.props.onShown\n };\n });\n\n function setIsAnyTippyOpen(value) {\n isAnyTippyOpen = value;\n updateInstances();\n }\n\n function onShow(instance) {\n instance._originalProps.onShow(instance);\n\n instances.forEach(function (instance) {\n instance.set({\n duration: duration\n });\n instance.hide();\n });\n setIsAnyTippyOpen(true);\n }\n\n function onHide(instance) {\n instance._originalProps.onHide(instance);\n\n setIsAnyTippyOpen(false);\n }\n\n function onShown(instance) {\n instance._originalProps.onShown(instance);\n\n instance.set({\n duration: instance._originalProps.duration\n });\n }\n\n function updateInstances() {\n instances.forEach(function (instance) {\n instance.set({\n onShow: onShow,\n onShown: onShown,\n onHide: onHide,\n delay: isAnyTippyOpen ? [0, Array.isArray(delay) ? delay[1] : delay] : delay,\n duration: isAnyTippyOpen ? duration : instance._originalProps.duration\n });\n });\n }\n\n updateInstances();\n}\n\nvar globalEventListenersBound = false;\n/**\n * Exported module\n * @param {String|Element|Element[]|NodeList|Object} targets\n * @param {Object} options\n * @return {Object}\n */\n\nfunction tippy(targets, options) {\n validateOptions(options, Defaults);\n\n if (!globalEventListenersBound) {\n bindGlobalEventListeners();\n globalEventListenersBound = true;\n }\n\n var props = _extends({}, Defaults, options); // If they are specifying a virtual positioning reference, we need to polyfill\n // some native DOM props\n\n\n if (isBareVirtualElement(targets)) {\n polyfillElementPrototypeProperties(targets);\n }\n\n var instances = getArrayOfElements(targets).reduce(function (acc, reference) {\n var instance = reference && createTippy(reference, props);\n\n if (instance) {\n acc.push(instance);\n }\n\n return acc;\n }, []);\n return isSingular(targets) ? instances[0] : instances;\n}\n/**\n * Static props\n */\n\n\ntippy.version = version;\ntippy.defaults = Defaults;\n/**\n * Static methods\n */\n\ntippy.setDefaults = function (partialDefaults) {\n Object.keys(partialDefaults).forEach(function (key) {\n Defaults[key] = partialDefaults[key];\n });\n};\n\ntippy.hideAll = hideAll;\ntippy.group = group;\n/**\n * Auto-init tooltips for elements with a `data-tippy=\"...\"` attribute\n */\n\nfunction autoInit() {\n arrayFrom(document.querySelectorAll('[data-tippy]')).forEach(function (el) {\n var content = el.getAttribute('data-tippy');\n\n if (content) {\n tippy(el, {\n content: content\n });\n }\n });\n}\n\nif (isBrowser) {\n setTimeout(autoInit);\n}\n\n/**\n * Injects a string of CSS styles to a style node in \n * @param {String} css\n */\n\nfunction injectCSS(css) {\n if (isBrowser) {\n var style = document.createElement('style');\n style.type = 'text/css';\n style.textContent = css;\n var head = document.head;\n var firstChild = head.firstChild;\n\n if (firstChild) {\n head.insertBefore(style, firstChild);\n } else {\n head.appendChild(style);\n }\n }\n}\n\ninjectCSS(css);\n\nexport default tippy;\n//# sourceMappingURL=index.all.js.map\n","import tippy from 'tippy.js';\n\nconst DEFAULTS = {\n arrow: true,\n animation: 'fade',\n appendTo: 'parent',\n placement: 'top',\n interactive: true,\n theme: 'light-border',\n maxWidth: 240,\n};\n\nconst getOptions = options => Object.assign({}, DEFAULTS, options || {});\n\nconst initTooltip = (selector, options) => {\n tippy(selector, getOptions(options));\n};\n\nexport default (selector, options) => {\n initTooltip(selector, options);\n};\n","/* eslint-disable import/no-named-as-default */\nimport $ from 'jquery';\nimport base from '~base';\nimport { onEvent, getJSONData, isLG } from '../util/domutils'; // eslint-disable-line import/named\nimport { loadContent } from '../util/fetchutils';\nimport convertSizes from '../components/sizeConversions';\nimport stickyHeaderScrollHandle from '../components/stickyHeaderScroll';\nimport { EVENTS as FLYOUT_EVENTS } from '../components/flyoutUnderHeader';\n\nconst CONSTANTS = {\n ADD_NOTIFICATION_DISPLAY_TIME: 5000,\n};\n\nconst CLASSES = {\n ATTRIBUTE_HAS_ERROR: 'product-detail__attribute--error',\n};\n\nconst SELECTORS = {\n DETAILS: '.product-detail',\n VARIANT_DETAILS: '.product-detail__details-row',\n SET_DETAILS: '.set-item',\n ATTRIBUTES_CONTAINER: '.product-detail__attributes',\n ATTRIBUTE: '.product-detail__attribute',\n ATTRIBUTE_VALUE: '.product-detail__attribute__value',\n ATTRIBUTE_ERROR: '.product-detail__attribute__error',\n ATTRIBUTE_DROPDOWN: '.product-detail__attribute__dropdown',\n ADD_TO_BASKET_NOTIFICATION: '.product-detail__add-to-cart__notification',\n ADD_TO_WISHLIST_NOTIFICATION: '.product-detail__add-to-wishlist__notification',\n get SELECTED_ATTRIBUTE_VALUE() { return `${this.ATTRIBUTE_VALUE}--current`; },\n};\n\nconst getDetailsContainer = (child) => {\n let productContainer = child.closest(SELECTORS.SET_DETAILS);\n\n if (!productContainer) {\n productContainer = child.closest(SELECTORS.VARIANT_DETAILS);\n }\n if (!productContainer) {\n productContainer = child.closest(SELECTORS.DETAILS);\n }\n\n return productContainer;\n};\n\nconst handleAttributeChange = async (el) => {\n const container = getDetailsContainer(el);\n let isActiveATBMsg;\n let index;\n const $element = $(el);\n // eslint-disable-next-line jquery/no-closest\n const parent = $element.closest('.set-item');\n if (parent.length > 0) {\n // eslint-disable-next-line jquery/no-find\n const sameClassElements = $('body').find('.set-item');\n index = sameClassElements.index(parent);\n }\n\n if (index) {\n isActiveATBMsg = document.querySelectorAll('.add-to-bag-msg')\n && document.querySelectorAll('.add-to-bag-msg')[index].classList.contains('active');\n } else {\n isActiveATBMsg = document.querySelector('.add-to-bag-msg')\n && document.querySelector('.add-to-bag-msg').classList.contains('active');\n }\n document.dispatchEvent(new CustomEvent('product:beforeAttributeSelect'));\n\n // eslint-disable-next-line jquery/no-text\n const { content } = await loadContent(el, el.value, { pview: container.dataset.pview || 'pdp' });\n const tempContainer = document.createElement('div');\n tempContainer.innerHTML = content;\n let detailsOnly = '';\n if (tempContainer.querySelector(SELECTORS.VARIANT_DETAILS)) {\n detailsOnly = tempContainer.querySelector(SELECTORS.VARIANT_DETAILS).outerHTML;\n container.outerHTML = detailsOnly;\n }\n if (tempContainer.querySelector(SELECTORS.DETAILS) && detailsOnly === '') {\n detailsOnly = tempContainer.querySelector(SELECTORS.DETAILS).outerHTML;\n container.outerHTML = detailsOnly;\n }\n // eslint-disable-next-line no-undef\n if (typeof PayPalSDK !== 'undefined') {\n // eslint-disable-next-line no-undef\n PayPalSDK.Messages().render();\n }\n\n convertSizes();\n base.selectVariationPrompt();\n\n document.dispatchEvent(new CustomEvent('product:afterAttributeSelect'));\n const ispreorder = el.getAttribute('data-ispreorder');\n const preorderDisplayMessage = el.getAttribute('data-preordemessage');\n const deliveryAccordion = document.querySelector('.product-detail__accordion__product-details-delivery-returns');\n const preOrderMessage = document.querySelector('.pre-order__message');\n if (deliveryAccordion) {\n if (ispreorder === 'true') {\n preOrderMessage.innerHTML = preorderDisplayMessage;\n if (deliveryAccordion.classList.contains('d-none')) {\n deliveryAccordion.classList.remove('d-none');\n }\n } else if (!deliveryAccordion.classList.contains('d-none')) {\n deliveryAccordion.classList.add('d-none');\n }\n }\n // eslint-disable-next-line jquery/no-class\n if (!isLG()) {\n // eslint-disable-next-line jquery/no-class\n $('body,html').removeClass('overflow-text');\n }\n stickyHeaderScrollHandle();\n\n const isSizeEL = el && el.classList.contains('select-dropdown__list-item');\n if (isSizeEL || (isActiveATBMsg && el.dataset.attr === 'color')) {\n if (index >= 0) {\n // eslint-disable-next-line jquery/no-class\n $('.add-to-bag-msg').eq(index).addClass('active');\n } else {\n // eslint-disable-next-line jquery/no-class\n $('.add-to-bag-msg').addClass('active');\n }\n }\n\n // eslint-disable-next-line jquery/no-class\n const isNotify = el && el.querySelector('#notify-btn');\n if (isNotify) {\n // eslint-disable-next-line jquery/no-class\n if (index >= 0) {\n // eslint-disable-next-line jquery/no-class\n $('.add-to-bag-msg').eq(index).removeClass('active');\n } else {\n // eslint-disable-next-line jquery/no-class\n $('.add-to-bag-msg').removeClass('active');\n }\n if (index >= 0) {\n // eslint-disable-next-line jquery/no-class\n $('.continuity-flyout__pane').removeClass('show');\n // eslint-disable-next-line jquery/no-class\n $('.continuity-flyout__pane').eq(index).addClass('show');\n } else {\n // eslint-disable-next-line jquery/no-class\n $('.continuity-flyout__pane').addClass('show');\n }\n }\n $('.sizeguidelabel .close-icon, #sizeGuideAccordion, .continuity-flyout__close').on('click', () => {\n // eslint-disable-next-line jquery/no-class\n $('.select-dropdown__list,.select-dropdown__button').removeClass('active');\n // eslint-disable-next-line jquery/no-class\n if (!isLG()) {\n // eslint-disable-next-line jquery/no-class\n $('body,html').removeClass('overflow-text');\n }\n });\n};\n\nconst handleErrorField = (data) => {\n data.forEach((attrObj) => {\n const attrContainer = document.querySelector(`${SELECTORS.ATTRIBUTE}--${attrObj.id}`);\n\n if (attrContainer) {\n const attrErrorContainer = attrContainer.querySelector(SELECTORS.ATTRIBUTE_ERROR);\n\n attrContainer.classList.add(CLASSES.ATTRIBUTE_HAS_ERROR);\n\n if (attrErrorContainer) {\n attrErrorContainer.innerHTML = attrObj.message;\n }\n }\n });\n};\n\nconst handleErrorFieldForMultipleFields = (data, attributeContainer) => {\n data.forEach((attrObj) => {\n const attrContainer = attributeContainer.find(`${SELECTORS.ATTRIBUTE}--${attrObj.id}`);\n const attrErrorContainer = attrContainer.find(SELECTORS.ATTRIBUTE_ERROR);\n\n attrContainer.addClass(CLASSES.ATTRIBUTE_HAS_ERROR);\n\n if (attrErrorContainer) {\n attrErrorContainer.html(attrObj.message);\n }\n });\n};\n\nbase.colorAttribute = () => {};\n\nbase.selectAttribute = () => {\n onEvent(document, 'click', SELECTORS.ATTRIBUTE_VALUE, async (e) => {\n e.preventDefault();\n\n const value = e.delegateTarget;\n\n if (value.dataset.action) {\n handleAttributeChange(value);\n }\n });\n\n onEvent(document, 'change', SELECTORS.ATTRIBUTE_DROPDOWN, async (e) => {\n const dropdown = e.delegateTarget;\n\n if (dropdown.value) {\n handleAttributeChange(dropdown);\n }\n });\n};\n\nbase.appendAttributeValuesToAddRequest = () => {\n $(document).on('updateAddToCartFormData', (e, form) => {\n const selectedValues = document.querySelectorAll(SELECTORS.SELECTED_ATTRIBUTE_VALUE);\n const selectedValuesMap = Array.from(selectedValues).reduce((map, attrValue) => Object.assign(map, {\n [attrValue.dataset.attr]: attrValue.dataset.value,\n }), {});\n\n form.selectedValues = JSON.stringify(selectedValuesMap);\n });\n};\n\nbase.handlePostCartAdd = () => {\n // eslint-disable-next-line no-unused-vars\n let lastClickedButton = null;\n $(document).on('updateAddToCartFormData', (e, data) => {\n if (!data.error) {\n lastClickedButton = e.target;\n }\n }).on('product:afterAddToCart', (e, data) => {\n const $button = $(lastClickedButton);\n\n // eslint-disable-next-line jquery/no-closest\n const parent = $button.closest('.set-item');\n if (parent.length > 0) {\n parent.find('.add-to-bag-msg').removeClass('active');\n } else {\n // eslint-disable-next-line jquery/no-class\n $('.add-to-bag-msg').removeClass('active');\n }\n\n if (data && !data.error) {\n // eslint-disable-next-line jquery/no-find, jquery/no-parents\n let notification = $button.parents(SELECTORS.DETAILS).find(SELECTORS.ADD_TO_BASKET_NOTIFICATION);\n if (notification.length > 1) {\n // eslint-disable-next-line jquery/no-find, jquery/no-parents\n notification = $button.parents(SELECTORS.SET_DETAILS).find(SELECTORS.ADD_TO_BASKET_NOTIFICATION);\n }\n if (notification) {\n notification.removeClass('d-none');\n\n setTimeout(() => {\n notification.addClass('d-none');\n }, CONSTANTS.ADD_NOTIFICATION_DISPLAY_TIME);\n }\n }\n\n if (data && data.attributeErrors) {\n // eslint-disable-next-line jquery/no-parents\n let attributeContainer = $button.parents(SELECTORS.DETAILS);\n if (attributeContainer.length > 1) {\n // eslint-disable-next-line jquery/no-parents\n attributeContainer = $button.parents(SELECTORS.SET_DETAILS);\n handleErrorFieldForMultipleFields(data.attributeErrors, attributeContainer);\n } else {\n handleErrorField(data.attributeErrors);\n }\n }\n });\n};\n\nbase.handlePostWishlistAdd = () => {\n document.addEventListener('product:addedToWishlist', () => {\n const notification = document.querySelector(SELECTORS.ADD_TO_WISHLIST_NOTIFICATION);\n\n if (notification) {\n notification.classList.remove('d-none');\n\n setTimeout(() => {\n notification.classList.add('d-none');\n }, CONSTANTS.ADD_NOTIFICATION_DISPLAY_TIME);\n }\n });\n};\n\nbase.styleFlyouts = () => {\n const toggleOpenedClass = (add) => {\n const container = document.querySelector(SELECTORS.DETAILS);\n\n if (container) {\n container.classList.toggle('flyout-open', !!add);\n }\n };\n\n document.addEventListener(FLYOUT_EVENTS.FLYOUT_OPEN, toggleOpenedClass.bind(null, true));\n document.addEventListener(FLYOUT_EVENTS.FLYOUT_CLOSE, toggleOpenedClass.bind(null, false));\n};\n\nbase.selectVariationPrompt = () => {\n const attributeContainer = document.querySelector(SELECTORS.ATTRIBUTES_CONTAINER);\n\n if (attributeContainer && attributeContainer.dataset.attributeErrors) {\n const data = getJSONData(attributeContainer, 'attributeErrors');\n\n if (Object.keys(data).length > 0) {\n handleErrorField(data);\n }\n }\n};\n\nbase.initSizeConversions = convertSizes;\n\nexport default base;\n","import tooltip from '../../components/tooltip';\n\nconst SELECTORS = {\n ATTRIBUTE_TOOLTIP: '.product-detail__attribute__value[data-tippy-content]',\n};\n\nexport default () => {\n tooltip(SELECTORS.ATTRIBUTE_TOOLTIP);\n};\n","import $ from 'jquery';\nimport { isLG, addUniqueEventListener } from '../../util/domutils';\nimport initCarouselSwipability from '../../thirdParty/bootstrap/carouselSwipe';\nimport { EVENTS as GALLERY_EVENTS, GLOBALS as GLOBAL_PINCH } from './imageGallery';\n\nconst GLOBALS = {\n CAROUSELS: [],\n};\n\nconst CLASSES = {\n CAROUSEL: 'carousel',\n};\n\nconst SELECTORS = {\n CAROUSEL_CONTAINER: '.primary-images__carousel',\n QUICKVIEW_MODAL: '#quickViewModal',\n};\n\nconst clearCarousel = (carouselElement) => {\n if (GLOBALS.CAROUSELS.length) {\n const currentCarousel = GLOBALS.CAROUSELS.find(carousel => carousel === carouselElement);\n const currentCarouselIndex = GLOBALS.CAROUSELS.findIndex(carousel => carousel === carouselElement);\n\n if (currentCarousel) {\n currentCarousel.classList.remove(CLASSES.CAROUSEL);\n $(currentCarousel).carousel('dispose');\n\n GLOBALS.CAROUSELS.splice(currentCarouselIndex, 1);\n }\n }\n};\n\nconst disableCarousel = (carouselElement) => {\n carouselElement.dataset.swipeDisabled = 'true';\n};\n\nconst enableCarousel = (carouselElement) => {\n carouselElement.dataset.swipeDisabled = 'false';\n};\n\nconst initQuickviewCleanup = (carouselElement) => {\n const quickViewModal = document.querySelector(SELECTORS.QUICKVIEW_MODAL);\n\n if (quickViewModal) {\n $(quickViewModal).on('hidden.bs.modal', clearCarousel.bind(null, carouselElement));\n }\n};\n\nconst initCarousel = (carouselElement) => {\n carouselElement.classList.add(CLASSES.CAROUSEL);\n\n GLOBALS.CAROUSELS.push($(carouselElement).carousel({ interval: false })[0]);\n\n addUniqueEventListener(document, 'product:beforeAttributeSelect', clearCarousel.bind(null, carouselElement));\n addUniqueEventListener(document, GALLERY_EVENTS.PINCH_ZOOM_START, disableCarousel.bind(null, carouselElement));\n addUniqueEventListener(document, GALLERY_EVENTS.PINCH_ZOOM_END, enableCarousel.bind(null, carouselElement));\n\n $(carouselElement).on('slid.bs.carousel', () => {\n GLOBAL_PINCH.PINCH_ZOOM.forEach((pinchZoomObj) => {\n pinchZoomObj.update({ type: 'resize' });\n });\n });\n initQuickviewCleanup(carouselElement);\n};\n\nexport default (forceCarousel) => {\n const isProductSet = document.querySelector('.product-set-detail') !== null;\n const carousels = Array.from(document.querySelectorAll(SELECTORS.CAROUSEL_CONTAINER));\n\n carousels.forEach((carousel) => {\n if (!isLG() || forceCarousel || isProductSet) {\n initCarousel(carousel);\n initCarouselSwipability(carousel, {});\n } else {\n clearCarousel(carousel);\n }\n });\n};\n","/*!\n * lightgallery | 2.7.1 | January 11th 2023\n * http://www.lightgalleryjs.com/\n * Copyright (c) 2020 Sachin Neravath;\n * @license GPLv3\n */\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\n/**\r\n * List of lightGallery events\r\n * All events should be documented here\r\n * Below interfaces are used to build the website documentations\r\n * */\r\nvar lGEvents = {\r\n afterAppendSlide: 'lgAfterAppendSlide',\r\n init: 'lgInit',\r\n hasVideo: 'lgHasVideo',\r\n containerResize: 'lgContainerResize',\r\n updateSlides: 'lgUpdateSlides',\r\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\r\n beforeOpen: 'lgBeforeOpen',\r\n afterOpen: 'lgAfterOpen',\r\n slideItemLoad: 'lgSlideItemLoad',\r\n beforeSlide: 'lgBeforeSlide',\r\n afterSlide: 'lgAfterSlide',\r\n posterClick: 'lgPosterClick',\r\n dragStart: 'lgDragStart',\r\n dragMove: 'lgDragMove',\r\n dragEnd: 'lgDragEnd',\r\n beforeNextSlide: 'lgBeforeNextSlide',\r\n beforePrevSlide: 'lgBeforePrevSlide',\r\n beforeClose: 'lgBeforeClose',\r\n afterClose: 'lgAfterClose',\r\n rotateLeft: 'lgRotateLeft',\r\n rotateRight: 'lgRotateRight',\r\n flipHorizontal: 'lgFlipHorizontal',\r\n flipVertical: 'lgFlipVertical',\r\n autoplay: 'lgAutoplay',\r\n autoplayStart: 'lgAutoplayStart',\r\n autoplayStop: 'lgAutoplayStop',\r\n};\n\nvar lightGalleryCoreSettings = {\r\n mode: 'lg-slide',\r\n easing: 'ease',\r\n speed: 400,\r\n licenseKey: '0000-0000-000-0000',\r\n height: '100%',\r\n width: '100%',\r\n addClass: '',\r\n startClass: 'lg-start-zoom',\r\n backdropDuration: 300,\r\n container: '',\r\n startAnimationDuration: 400,\r\n zoomFromOrigin: true,\r\n hideBarsDelay: 0,\r\n showBarsAfter: 10000,\r\n slideDelay: 0,\r\n supportLegacyBrowser: true,\r\n allowMediaOverlap: false,\r\n videoMaxSize: '1280-720',\r\n loadYouTubePoster: true,\r\n defaultCaptionHeight: 0,\r\n ariaLabelledby: '',\r\n ariaDescribedby: '',\r\n resetScrollPosition: true,\r\n hideScrollbar: false,\r\n closable: true,\r\n swipeToClose: true,\r\n closeOnTap: true,\r\n showCloseIcon: true,\r\n showMaximizeIcon: false,\r\n loop: true,\r\n escKey: true,\r\n keyPress: true,\r\n trapFocus: true,\r\n controls: true,\r\n slideEndAnimation: true,\r\n hideControlOnEnd: false,\r\n mousewheel: false,\r\n getCaptionFromTitleOrAlt: true,\r\n appendSubHtmlTo: '.lg-sub-html',\r\n subHtmlSelectorRelative: false,\r\n preload: 2,\r\n numberOfSlideItemsInDom: 10,\r\n selector: '',\r\n selectWithin: '',\r\n nextHtml: '',\r\n prevHtml: '',\r\n index: 0,\r\n iframeWidth: '100%',\r\n iframeHeight: '100%',\r\n iframeMaxWidth: '100%',\r\n iframeMaxHeight: '100%',\r\n download: true,\r\n counter: true,\r\n appendCounterTo: '.lg-toolbar',\r\n swipeThreshold: 50,\r\n enableSwipe: true,\r\n enableDrag: true,\r\n dynamic: false,\r\n dynamicEl: [],\r\n extraProps: [],\r\n exThumbImage: '',\r\n isMobile: undefined,\r\n mobileSettings: {\r\n controls: false,\r\n showCloseIcon: false,\r\n download: false,\r\n },\r\n plugins: [],\r\n strings: {\r\n closeGallery: 'Close gallery',\r\n toggleMaximize: 'Toggle maximize',\r\n previousSlide: 'Previous slide',\r\n nextSlide: 'Next slide',\r\n download: 'Download',\r\n playVideo: 'Play video',\r\n },\r\n};\n\nfunction initLgPolyfills() {\r\n (function () {\r\n if (typeof window.CustomEvent === 'function')\r\n return false;\r\n function CustomEvent(event, params) {\r\n params = params || {\r\n bubbles: false,\r\n cancelable: false,\r\n detail: null,\r\n };\r\n var evt = document.createEvent('CustomEvent');\r\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\r\n return evt;\r\n }\r\n window.CustomEvent = CustomEvent;\r\n })();\r\n (function () {\r\n if (!Element.prototype.matches) {\r\n Element.prototype.matches =\r\n Element.prototype.msMatchesSelector ||\r\n Element.prototype.webkitMatchesSelector;\r\n }\r\n })();\r\n}\r\nvar lgQuery = /** @class */ (function () {\r\n function lgQuery(selector) {\r\n this.cssVenderPrefixes = [\r\n 'TransitionDuration',\r\n 'TransitionTimingFunction',\r\n 'Transform',\r\n 'Transition',\r\n ];\r\n this.selector = this._getSelector(selector);\r\n this.firstElement = this._getFirstEl();\r\n return this;\r\n }\r\n lgQuery.generateUUID = function () {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n });\r\n };\r\n lgQuery.prototype._getSelector = function (selector, context) {\r\n if (context === void 0) { context = document; }\r\n if (typeof selector !== 'string') {\r\n return selector;\r\n }\r\n context = context || document;\r\n var fl = selector.substring(0, 1);\r\n if (fl === '#') {\r\n return context.querySelector(selector);\r\n }\r\n else {\r\n return context.querySelectorAll(selector);\r\n }\r\n };\r\n lgQuery.prototype._each = function (func) {\r\n if (!this.selector) {\r\n return this;\r\n }\r\n if (this.selector.length !== undefined) {\r\n [].forEach.call(this.selector, func);\r\n }\r\n else {\r\n func(this.selector, 0);\r\n }\r\n return this;\r\n };\r\n lgQuery.prototype._setCssVendorPrefix = function (el, cssProperty, value) {\r\n // prettier-ignore\r\n var property = cssProperty.replace(/-([a-z])/gi, function (s, group1) {\r\n return group1.toUpperCase();\r\n });\r\n if (this.cssVenderPrefixes.indexOf(property) !== -1) {\r\n el.style[property.charAt(0).toLowerCase() + property.slice(1)] = value;\r\n el.style['webkit' + property] = value;\r\n el.style['moz' + property] = value;\r\n el.style['ms' + property] = value;\r\n el.style['o' + property] = value;\r\n }\r\n else {\r\n el.style[property] = value;\r\n }\r\n };\r\n lgQuery.prototype._getFirstEl = function () {\r\n if (this.selector && this.selector.length !== undefined) {\r\n return this.selector[0];\r\n }\r\n else {\r\n return this.selector;\r\n }\r\n };\r\n lgQuery.prototype.isEventMatched = function (event, eventName) {\r\n var eventNamespace = eventName.split('.');\r\n return event\r\n .split('.')\r\n .filter(function (e) { return e; })\r\n .every(function (e) {\r\n return eventNamespace.indexOf(e) !== -1;\r\n });\r\n };\r\n lgQuery.prototype.attr = function (attr, value) {\r\n if (value === undefined) {\r\n if (!this.firstElement) {\r\n return '';\r\n }\r\n return this.firstElement.getAttribute(attr);\r\n }\r\n this._each(function (el) {\r\n el.setAttribute(attr, value);\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.find = function (selector) {\r\n return $LG(this._getSelector(selector, this.selector));\r\n };\r\n lgQuery.prototype.first = function () {\r\n if (this.selector && this.selector.length !== undefined) {\r\n return $LG(this.selector[0]);\r\n }\r\n else {\r\n return $LG(this.selector);\r\n }\r\n };\r\n lgQuery.prototype.eq = function (index) {\r\n return $LG(this.selector[index]);\r\n };\r\n lgQuery.prototype.parent = function () {\r\n return $LG(this.selector.parentElement);\r\n };\r\n lgQuery.prototype.get = function () {\r\n return this._getFirstEl();\r\n };\r\n lgQuery.prototype.removeAttr = function (attributes) {\r\n var attrs = attributes.split(' ');\r\n this._each(function (el) {\r\n attrs.forEach(function (attr) { return el.removeAttribute(attr); });\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.wrap = function (className) {\r\n if (!this.firstElement) {\r\n return this;\r\n }\r\n var wrapper = document.createElement('div');\r\n wrapper.className = className;\r\n this.firstElement.parentNode.insertBefore(wrapper, this.firstElement);\r\n this.firstElement.parentNode.removeChild(this.firstElement);\r\n wrapper.appendChild(this.firstElement);\r\n return this;\r\n };\r\n lgQuery.prototype.addClass = function (classNames) {\r\n if (classNames === void 0) { classNames = ''; }\r\n this._each(function (el) {\r\n // IE doesn't support multiple arguments\r\n classNames.split(' ').forEach(function (className) {\r\n if (className) {\r\n el.classList.add(className);\r\n }\r\n });\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.removeClass = function (classNames) {\r\n this._each(function (el) {\r\n // IE doesn't support multiple arguments\r\n classNames.split(' ').forEach(function (className) {\r\n if (className) {\r\n el.classList.remove(className);\r\n }\r\n });\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.hasClass = function (className) {\r\n if (!this.firstElement) {\r\n return false;\r\n }\r\n return this.firstElement.classList.contains(className);\r\n };\r\n lgQuery.prototype.hasAttribute = function (attribute) {\r\n if (!this.firstElement) {\r\n return false;\r\n }\r\n return this.firstElement.hasAttribute(attribute);\r\n };\r\n lgQuery.prototype.toggleClass = function (className) {\r\n if (!this.firstElement) {\r\n return this;\r\n }\r\n if (this.hasClass(className)) {\r\n this.removeClass(className);\r\n }\r\n else {\r\n this.addClass(className);\r\n }\r\n return this;\r\n };\r\n lgQuery.prototype.css = function (property, value) {\r\n var _this = this;\r\n this._each(function (el) {\r\n _this._setCssVendorPrefix(el, property, value);\r\n });\r\n return this;\r\n };\r\n // Need to pass separate namespaces for separate elements\r\n lgQuery.prototype.on = function (events, listener) {\r\n var _this = this;\r\n if (!this.selector) {\r\n return this;\r\n }\r\n events.split(' ').forEach(function (event) {\r\n if (!Array.isArray(lgQuery.eventListeners[event])) {\r\n lgQuery.eventListeners[event] = [];\r\n }\r\n lgQuery.eventListeners[event].push(listener);\r\n _this.selector.addEventListener(event.split('.')[0], listener);\r\n });\r\n return this;\r\n };\r\n // @todo - test this\r\n lgQuery.prototype.once = function (event, listener) {\r\n var _this = this;\r\n this.on(event, function () {\r\n _this.off(event);\r\n listener(event);\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.off = function (event) {\r\n var _this = this;\r\n if (!this.selector) {\r\n return this;\r\n }\r\n Object.keys(lgQuery.eventListeners).forEach(function (eventName) {\r\n if (_this.isEventMatched(event, eventName)) {\r\n lgQuery.eventListeners[eventName].forEach(function (listener) {\r\n _this.selector.removeEventListener(eventName.split('.')[0], listener);\r\n });\r\n lgQuery.eventListeners[eventName] = [];\r\n }\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.trigger = function (event, detail) {\r\n if (!this.firstElement) {\r\n return this;\r\n }\r\n var customEvent = new CustomEvent(event.split('.')[0], {\r\n detail: detail || null,\r\n });\r\n this.firstElement.dispatchEvent(customEvent);\r\n return this;\r\n };\r\n // Does not support IE\r\n lgQuery.prototype.load = function (url) {\r\n var _this = this;\r\n fetch(url)\r\n .then(function (res) { return res.text(); })\r\n .then(function (html) {\r\n _this.selector.innerHTML = html;\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.html = function (html) {\r\n if (html === undefined) {\r\n if (!this.firstElement) {\r\n return '';\r\n }\r\n return this.firstElement.innerHTML;\r\n }\r\n this._each(function (el) {\r\n el.innerHTML = html;\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.append = function (html) {\r\n this._each(function (el) {\r\n if (typeof html === 'string') {\r\n el.insertAdjacentHTML('beforeend', html);\r\n }\r\n else {\r\n el.appendChild(html);\r\n }\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.prepend = function (html) {\r\n this._each(function (el) {\r\n el.insertAdjacentHTML('afterbegin', html);\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.remove = function () {\r\n this._each(function (el) {\r\n el.parentNode.removeChild(el);\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.empty = function () {\r\n this._each(function (el) {\r\n el.innerHTML = '';\r\n });\r\n return this;\r\n };\r\n lgQuery.prototype.scrollTop = function (scrollTop) {\r\n if (scrollTop !== undefined) {\r\n document.body.scrollTop = scrollTop;\r\n document.documentElement.scrollTop = scrollTop;\r\n return this;\r\n }\r\n else {\r\n return (window.pageYOffset ||\r\n document.documentElement.scrollTop ||\r\n document.body.scrollTop ||\r\n 0);\r\n }\r\n };\r\n lgQuery.prototype.scrollLeft = function (scrollLeft) {\r\n if (scrollLeft !== undefined) {\r\n document.body.scrollLeft = scrollLeft;\r\n document.documentElement.scrollLeft = scrollLeft;\r\n return this;\r\n }\r\n else {\r\n return (window.pageXOffset ||\r\n document.documentElement.scrollLeft ||\r\n document.body.scrollLeft ||\r\n 0);\r\n }\r\n };\r\n lgQuery.prototype.offset = function () {\r\n if (!this.firstElement) {\r\n return {\r\n left: 0,\r\n top: 0,\r\n };\r\n }\r\n var rect = this.firstElement.getBoundingClientRect();\r\n var bodyMarginLeft = $LG('body').style().marginLeft;\r\n // Minus body margin - https://stackoverflow.com/questions/30711548/is-getboundingclientrect-left-returning-a-wrong-value\r\n return {\r\n left: rect.left - parseFloat(bodyMarginLeft) + this.scrollLeft(),\r\n top: rect.top + this.scrollTop(),\r\n };\r\n };\r\n lgQuery.prototype.style = function () {\r\n if (!this.firstElement) {\r\n return {};\r\n }\r\n return (this.firstElement.currentStyle ||\r\n window.getComputedStyle(this.firstElement));\r\n };\r\n // Width without padding and border even if box-sizing is used.\r\n lgQuery.prototype.width = function () {\r\n var style = this.style();\r\n return (this.firstElement.clientWidth -\r\n parseFloat(style.paddingLeft) -\r\n parseFloat(style.paddingRight));\r\n };\r\n // Height without padding and border even if box-sizing is used.\r\n lgQuery.prototype.height = function () {\r\n var style = this.style();\r\n return (this.firstElement.clientHeight -\r\n parseFloat(style.paddingTop) -\r\n parseFloat(style.paddingBottom));\r\n };\r\n lgQuery.eventListeners = {};\r\n return lgQuery;\r\n}());\r\nfunction $LG(selector) {\r\n initLgPolyfills();\r\n return new lgQuery(selector);\r\n}\n\nvar defaultDynamicOptions = [\r\n 'src',\r\n 'sources',\r\n 'subHtml',\r\n 'subHtmlUrl',\r\n 'html',\r\n 'video',\r\n 'poster',\r\n 'slideName',\r\n 'responsive',\r\n 'srcset',\r\n 'sizes',\r\n 'iframe',\r\n 'downloadUrl',\r\n 'download',\r\n 'width',\r\n 'facebookShareUrl',\r\n 'tweetText',\r\n 'iframeTitle',\r\n 'twitterShareUrl',\r\n 'pinterestShareUrl',\r\n 'pinterestText',\r\n 'fbHtml',\r\n 'disqusIdentifier',\r\n 'disqusUrl',\r\n];\r\n// Convert html data-attribute to camalcase\r\nfunction convertToData(attr) {\r\n // FInd a way for lgsize\r\n if (attr === 'href') {\r\n return 'src';\r\n }\r\n attr = attr.replace('data-', '');\r\n attr = attr.charAt(0).toLowerCase() + attr.slice(1);\r\n attr = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });\r\n return attr;\r\n}\r\nvar utils = {\r\n /**\r\n * get possible width and height from the lgSize attribute. Used for ZoomFromOrigin option\r\n */\r\n getSize: function (el, container, spacing, defaultLgSize) {\r\n if (spacing === void 0) { spacing = 0; }\r\n var LGel = $LG(el);\r\n var lgSize = LGel.attr('data-lg-size') || defaultLgSize;\r\n if (!lgSize) {\r\n return;\r\n }\r\n var isResponsiveSizes = lgSize.split(',');\r\n // if at-least two viewport sizes are available\r\n if (isResponsiveSizes[1]) {\r\n var wWidth = window.innerWidth;\r\n for (var i = 0; i < isResponsiveSizes.length; i++) {\r\n var size_1 = isResponsiveSizes[i];\r\n var responsiveWidth = parseInt(size_1.split('-')[2], 10);\r\n if (responsiveWidth > wWidth) {\r\n lgSize = size_1;\r\n break;\r\n }\r\n // take last item as last option\r\n if (i === isResponsiveSizes.length - 1) {\r\n lgSize = size_1;\r\n }\r\n }\r\n }\r\n var size = lgSize.split('-');\r\n var width = parseInt(size[0], 10);\r\n var height = parseInt(size[1], 10);\r\n var cWidth = container.width();\r\n var cHeight = container.height() - spacing;\r\n var maxWidth = Math.min(cWidth, width);\r\n var maxHeight = Math.min(cHeight, height);\r\n var ratio = Math.min(maxWidth / width, maxHeight / height);\r\n return { width: width * ratio, height: height * ratio };\r\n },\r\n /**\r\n * @desc Get transform value based on the imageSize. Used for ZoomFromOrigin option\r\n * @param {jQuery Element}\r\n * @returns {String} Transform CSS string\r\n */\r\n getTransform: function (el, container, top, bottom, imageSize) {\r\n if (!imageSize) {\r\n return;\r\n }\r\n var LGel = $LG(el).find('img').first();\r\n if (!LGel.get()) {\r\n return;\r\n }\r\n var containerRect = container.get().getBoundingClientRect();\r\n var wWidth = containerRect.width;\r\n // using innerWidth to include mobile safari bottom bar\r\n var wHeight = container.height() - (top + bottom);\r\n var elWidth = LGel.width();\r\n var elHeight = LGel.height();\r\n var elStyle = LGel.style();\r\n var x = (wWidth - elWidth) / 2 -\r\n LGel.offset().left +\r\n (parseFloat(elStyle.paddingLeft) || 0) +\r\n (parseFloat(elStyle.borderLeft) || 0) +\r\n $LG(window).scrollLeft() +\r\n containerRect.left;\r\n var y = (wHeight - elHeight) / 2 -\r\n LGel.offset().top +\r\n (parseFloat(elStyle.paddingTop) || 0) +\r\n (parseFloat(elStyle.borderTop) || 0) +\r\n $LG(window).scrollTop() +\r\n top;\r\n var scX = elWidth / imageSize.width;\r\n var scY = elHeight / imageSize.height;\r\n var transform = 'translate3d(' +\r\n (x *= -1) +\r\n 'px, ' +\r\n (y *= -1) +\r\n 'px, 0) scale3d(' +\r\n scX +\r\n ', ' +\r\n scY +\r\n ', 1)';\r\n return transform;\r\n },\r\n getIframeMarkup: function (iframeWidth, iframeHeight, iframeMaxWidth, iframeMaxHeight, src, iframeTitle) {\r\n var title = iframeTitle ? 'title=\"' + iframeTitle + '\"' : '';\r\n return \"
\\n \\n
\";\r\n },\r\n getImgMarkup: function (index, src, altAttr, srcset, sizes, sources) {\r\n var srcsetAttr = srcset ? \"srcset=\\\"\" + srcset + \"\\\"\" : '';\r\n var sizesAttr = sizes ? \"sizes=\\\"\" + sizes + \"\\\"\" : '';\r\n var imgMarkup = \"\";\r\n var sourceTag = '';\r\n if (sources) {\r\n var sourceObj = typeof sources === 'string' ? JSON.parse(sources) : sources;\r\n sourceTag = sourceObj.map(function (source) {\r\n var attrs = '';\r\n Object.keys(source).forEach(function (key) {\r\n // Do not remove the first space as it is required to separate the attributes\r\n attrs += \" \" + key + \"=\\\"\" + source[key] + \"\\\"\";\r\n });\r\n return \"\";\r\n });\r\n }\r\n return \"\" + sourceTag + imgMarkup;\r\n },\r\n // Get src from responsive src\r\n getResponsiveSrc: function (srcItms) {\r\n var rsWidth = [];\r\n var rsSrc = [];\r\n var src = '';\r\n for (var i = 0; i < srcItms.length; i++) {\r\n var _src = srcItms[i].split(' ');\r\n // Manage empty space\r\n if (_src[0] === '') {\r\n _src.splice(0, 1);\r\n }\r\n rsSrc.push(_src[0]);\r\n rsWidth.push(_src[1]);\r\n }\r\n var wWidth = window.innerWidth;\r\n for (var j = 0; j < rsWidth.length; j++) {\r\n if (parseInt(rsWidth[j], 10) > wWidth) {\r\n src = rsSrc[j];\r\n break;\r\n }\r\n }\r\n return src;\r\n },\r\n isImageLoaded: function (img) {\r\n if (!img)\r\n return false;\r\n // During the onload event, IE correctly identifies any images that\r\n // weren’t downloaded as not complete. Others should too. Gecko-based\r\n // browsers act like NS4 in that they report this incorrectly.\r\n if (!img.complete) {\r\n return false;\r\n }\r\n // However, they do have two very useful properties: naturalWidth and\r\n // naturalHeight. These give the true size of the image. If it failed\r\n // to load, either of these should be zero.\r\n if (img.naturalWidth === 0) {\r\n return false;\r\n }\r\n // No other way of checking: assume it’s ok.\r\n return true;\r\n },\r\n getVideoPosterMarkup: function (_poster, dummyImg, videoContStyle, playVideoString, _isVideo) {\r\n var videoClass = '';\r\n if (_isVideo && _isVideo.youtube) {\r\n videoClass = 'lg-has-youtube';\r\n }\r\n else if (_isVideo && _isVideo.vimeo) {\r\n videoClass = 'lg-has-vimeo';\r\n }\r\n else {\r\n videoClass = 'lg-has-html5';\r\n }\r\n return \"
\\n
\\n \\n \" + playVideoString + \"\\n \\n \\n \\n \\n \\n \\n \\n
\\n \" + (dummyImg || '') + \"\\n \\n
\";\r\n },\r\n getFocusableElements: function (container) {\r\n var elements = container.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type=\"text\"]:not([disabled]), input[type=\"radio\"]:not([disabled]), input[type=\"checkbox\"]:not([disabled]), select:not([disabled])');\r\n var visibleElements = [].filter.call(elements, function (element) {\r\n var style = window.getComputedStyle(element);\r\n return style.display !== 'none' && style.visibility !== 'hidden';\r\n });\r\n return visibleElements;\r\n },\r\n /**\r\n * @desc Create dynamic elements array from gallery items when dynamic option is false\r\n * It helps to avoid frequent DOM interaction\r\n * and avoid multiple checks for dynamic elments\r\n *\r\n * @returns {Array} dynamicEl\r\n */\r\n getDynamicOptions: function (items, extraProps, getCaptionFromTitleOrAlt, exThumbImage) {\r\n var dynamicElements = [];\r\n var availableDynamicOptions = __spreadArrays(defaultDynamicOptions, extraProps);\r\n [].forEach.call(items, function (item) {\r\n var dynamicEl = {};\r\n for (var i = 0; i < item.attributes.length; i++) {\r\n var attr = item.attributes[i];\r\n if (attr.specified) {\r\n var dynamicAttr = convertToData(attr.name);\r\n var label = '';\r\n if (availableDynamicOptions.indexOf(dynamicAttr) > -1) {\r\n label = dynamicAttr;\r\n }\r\n if (label) {\r\n dynamicEl[label] = attr.value;\r\n }\r\n }\r\n }\r\n var currentItem = $LG(item);\r\n var alt = currentItem.find('img').first().attr('alt');\r\n var title = currentItem.attr('title');\r\n var thumb = exThumbImage\r\n ? currentItem.attr(exThumbImage)\r\n : currentItem.find('img').first().attr('src');\r\n dynamicEl.thumb = thumb;\r\n if (getCaptionFromTitleOrAlt && !dynamicEl.subHtml) {\r\n dynamicEl.subHtml = title || alt || '';\r\n }\r\n dynamicEl.alt = alt || title || '';\r\n dynamicElements.push(dynamicEl);\r\n });\r\n return dynamicElements;\r\n },\r\n isMobile: function () {\r\n return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);\r\n },\r\n /**\r\n * @desc Check the given src is video\r\n * @param {String} src\r\n * @return {Object} video type\r\n * Ex:{ youtube : [\"//www.youtube.com/watch?v=c0asJgSyxcY\", \"c0asJgSyxcY\"] }\r\n *\r\n * @todo - this information can be moved to dynamicEl to avoid frequent calls\r\n */\r\n isVideo: function (src, isHTML5VIdeo, index) {\r\n if (!src) {\r\n if (isHTML5VIdeo) {\r\n return {\r\n html5: true,\r\n };\r\n }\r\n else {\r\n console.error('lightGallery :- data-src is not provided on slide item ' +\r\n (index + 1) +\r\n '. Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/');\r\n return;\r\n }\r\n }\r\n var youtube = src.match(/\\/\\/(?:www\\.)?youtu(?:\\.be|be\\.com|be-nocookie\\.com)\\/(?:watch\\?v=|embed\\/)?([a-z0-9\\-\\_\\%]+)([\\&|?][\\S]*)*/i);\r\n var vimeo = src.match(/\\/\\/(?:www\\.)?(?:player\\.)?vimeo.com\\/(?:video\\/)?([0-9a-z\\-_]+)(.*)?/i);\r\n var wistia = src.match(/https?:\\/\\/(.+)?(wistia\\.com|wi\\.st)\\/(medias|embed)\\/([0-9a-z\\-_]+)(.*)/);\r\n if (youtube) {\r\n return {\r\n youtube: youtube,\r\n };\r\n }\r\n else if (vimeo) {\r\n return {\r\n vimeo: vimeo,\r\n };\r\n }\r\n else if (wistia) {\r\n return {\r\n wistia: wistia,\r\n };\r\n }\r\n },\r\n};\n\n// @ref - https://stackoverflow.com/questions/3971841/how-to-resize-images-proportionally-keeping-the-aspect-ratio\r\n// @ref - https://2ality.com/2017/04/setting-up-multi-platform-packages.html\r\n// Unique id for each gallery\r\nvar lgId = 0;\r\nvar LightGallery = /** @class */ (function () {\r\n function LightGallery(element, options) {\r\n this.lgOpened = false;\r\n this.index = 0;\r\n // lightGallery modules\r\n this.plugins = [];\r\n // false when lightGallery load first slide content;\r\n this.lGalleryOn = false;\r\n // True when a slide animation is in progress\r\n this.lgBusy = false;\r\n this.currentItemsInDom = [];\r\n // Scroll top value before lightGallery is opened\r\n this.prevScrollTop = 0;\r\n this.bodyPaddingRight = 0;\r\n this.isDummyImageRemoved = false;\r\n this.dragOrSwipeEnabled = false;\r\n this.mediaContainerPosition = {\r\n top: 0,\r\n bottom: 0,\r\n };\r\n if (!element) {\r\n return this;\r\n }\r\n lgId++;\r\n this.lgId = lgId;\r\n this.el = element;\r\n this.LGel = $LG(element);\r\n this.generateSettings(options);\r\n this.buildModules();\r\n // When using dynamic mode, ensure dynamicEl is an array\r\n if (this.settings.dynamic &&\r\n this.settings.dynamicEl !== undefined &&\r\n !Array.isArray(this.settings.dynamicEl)) {\r\n throw 'When using dynamic mode, you must also define dynamicEl as an Array.';\r\n }\r\n this.galleryItems = this.getItems();\r\n this.normalizeSettings();\r\n // Gallery items\r\n this.init();\r\n this.validateLicense();\r\n return this;\r\n }\r\n LightGallery.prototype.generateSettings = function (options) {\r\n // lightGallery settings\r\n this.settings = __assign(__assign({}, lightGalleryCoreSettings), options);\r\n if (this.settings.isMobile &&\r\n typeof this.settings.isMobile === 'function'\r\n ? this.settings.isMobile()\r\n : utils.isMobile()) {\r\n var mobileSettings = __assign(__assign({}, this.settings.mobileSettings), this.settings.mobileSettings);\r\n this.settings = __assign(__assign({}, this.settings), mobileSettings);\r\n }\r\n };\r\n LightGallery.prototype.normalizeSettings = function () {\r\n if (this.settings.slideEndAnimation) {\r\n this.settings.hideControlOnEnd = false;\r\n }\r\n if (!this.settings.closable) {\r\n this.settings.swipeToClose = false;\r\n }\r\n // And reset it on close to get the correct value next time\r\n this.zoomFromOrigin = this.settings.zoomFromOrigin;\r\n // At the moment, Zoom from image doesn't support dynamic options\r\n // @todo add zoomFromOrigin support for dynamic images\r\n if (this.settings.dynamic) {\r\n this.zoomFromOrigin = false;\r\n }\r\n if (!this.settings.container) {\r\n this.settings.container = document.body;\r\n }\r\n // settings.preload should not be grater than $item.length\r\n this.settings.preload = Math.min(this.settings.preload, this.galleryItems.length);\r\n };\r\n LightGallery.prototype.init = function () {\r\n var _this = this;\r\n this.addSlideVideoInfo(this.galleryItems);\r\n this.buildStructure();\r\n this.LGel.trigger(lGEvents.init, {\r\n instance: this,\r\n });\r\n if (this.settings.keyPress) {\r\n this.keyPress();\r\n }\r\n setTimeout(function () {\r\n _this.enableDrag();\r\n _this.enableSwipe();\r\n _this.triggerPosterClick();\r\n }, 50);\r\n this.arrow();\r\n if (this.settings.mousewheel) {\r\n this.mousewheel();\r\n }\r\n if (!this.settings.dynamic) {\r\n this.openGalleryOnItemClick();\r\n }\r\n };\r\n LightGallery.prototype.openGalleryOnItemClick = function () {\r\n var _this = this;\r\n var _loop_1 = function (index) {\r\n var element = this_1.items[index];\r\n var $element = $LG(element);\r\n // Using different namespace for click because click event should not unbind if selector is same object('this')\r\n // @todo manage all event listners - should have namespace that represent element\r\n var uuid = lgQuery.generateUUID();\r\n $element\r\n .attr('data-lg-id', uuid)\r\n .on(\"click.lgcustom-item-\" + uuid, function (e) {\r\n e.preventDefault();\r\n var currentItemIndex = _this.settings.index || index;\r\n _this.openGallery(currentItemIndex, element);\r\n });\r\n };\r\n var this_1 = this;\r\n // Using for loop instead of using bubbling as the items can be any html element.\r\n for (var index = 0; index < this.items.length; index++) {\r\n _loop_1(index);\r\n }\r\n };\r\n /**\r\n * Module constructor\r\n * Modules are build incrementally.\r\n * Gallery should be opened only once all the modules are initialized.\r\n * use moduleBuildTimeout to make sure this\r\n */\r\n LightGallery.prototype.buildModules = function () {\r\n var _this = this;\r\n this.settings.plugins.forEach(function (plugin) {\r\n _this.plugins.push(new plugin(_this, $LG));\r\n });\r\n };\r\n LightGallery.prototype.validateLicense = function () {\r\n if (!this.settings.licenseKey) {\r\n console.error('Please provide a valid license key');\r\n }\r\n else if (this.settings.licenseKey === '0000-0000-000-0000') {\r\n console.warn(\"lightGallery: \" + this.settings.licenseKey + \" license key is not valid for production use\");\r\n }\r\n };\r\n LightGallery.prototype.getSlideItem = function (index) {\r\n return $LG(this.getSlideItemId(index));\r\n };\r\n LightGallery.prototype.getSlideItemId = function (index) {\r\n return \"#lg-item-\" + this.lgId + \"-\" + index;\r\n };\r\n LightGallery.prototype.getIdName = function (id) {\r\n return id + \"-\" + this.lgId;\r\n };\r\n LightGallery.prototype.getElementById = function (id) {\r\n return $LG(\"#\" + this.getIdName(id));\r\n };\r\n LightGallery.prototype.manageSingleSlideClassName = function () {\r\n if (this.galleryItems.length < 2) {\r\n this.outer.addClass('lg-single-item');\r\n }\r\n else {\r\n this.outer.removeClass('lg-single-item');\r\n }\r\n };\r\n LightGallery.prototype.buildStructure = function () {\r\n var _this = this;\r\n var container = this.$container && this.$container.get();\r\n if (container) {\r\n return;\r\n }\r\n var controls = '';\r\n var subHtmlCont = '';\r\n // Create controls\r\n if (this.settings.controls) {\r\n controls = \"\\n \";\r\n }\r\n if (this.settings.appendSubHtmlTo !== '.lg-item') {\r\n subHtmlCont =\r\n '
';\r\n }\r\n var addClasses = '';\r\n if (this.settings.allowMediaOverlap) {\r\n // Do not remove space before last single quote\r\n addClasses += 'lg-media-overlap ';\r\n }\r\n var ariaLabelledby = this.settings.ariaLabelledby\r\n ? 'aria-labelledby=\"' + this.settings.ariaLabelledby + '\"'\r\n : '';\r\n var ariaDescribedby = this.settings.ariaDescribedby\r\n ? 'aria-describedby=\"' + this.settings.ariaDescribedby + '\"'\r\n : '';\r\n var containerClassName = \"lg-container \" + this.settings.addClass + \" \" + (document.body !== this.settings.container ? 'lg-inline' : '');\r\n var closeIcon = this.settings.closable && this.settings.showCloseIcon\r\n ? \"\"\r\n : '';\r\n var maximizeIcon = this.settings.showMaximizeIcon\r\n ? \"\"\r\n : '';\r\n var template = \"\\n
\\n
\\n\\n
\\n\\n
\\n
\\n
\\n \" + controls + \"\\n
\\n
\\n \" + maximizeIcon + \"\\n \" + closeIcon + \"\\n
\\n \" + (this.settings.appendSubHtmlTo === '.lg-outer'\r\n ? subHtmlCont\r\n : '') + \"\\n
\\n \" + (this.settings.appendSubHtmlTo === '.lg-sub-html'\r\n ? subHtmlCont\r\n : '') + \"\\n
\\n
\\n
\\n \";\r\n $LG(this.settings.container).append(template);\r\n if (document.body !== this.settings.container) {\r\n $LG(this.settings.container).css('position', 'relative');\r\n }\r\n this.outer = this.getElementById('lg-outer');\r\n this.$lgComponents = this.getElementById('lg-components');\r\n this.$backdrop = this.getElementById('lg-backdrop');\r\n this.$container = this.getElementById('lg-container');\r\n this.$inner = this.getElementById('lg-inner');\r\n this.$content = this.getElementById('lg-content');\r\n this.$toolbar = this.getElementById('lg-toolbar');\r\n this.$backdrop.css('transition-duration', this.settings.backdropDuration + 'ms');\r\n var outerClassNames = this.settings.mode + \" \";\r\n this.manageSingleSlideClassName();\r\n if (this.settings.enableDrag) {\r\n outerClassNames += 'lg-grab ';\r\n }\r\n this.outer.addClass(outerClassNames);\r\n this.$inner.css('transition-timing-function', this.settings.easing);\r\n this.$inner.css('transition-duration', this.settings.speed + 'ms');\r\n if (this.settings.download) {\r\n this.$toolbar.append(\"\");\r\n }\r\n this.counter();\r\n $LG(window).on(\"resize.lg.global\" + this.lgId + \" orientationchange.lg.global\" + this.lgId, function () {\r\n _this.refreshOnResize();\r\n });\r\n this.hideBars();\r\n this.manageCloseGallery();\r\n this.toggleMaximize();\r\n this.initModules();\r\n };\r\n LightGallery.prototype.refreshOnResize = function () {\r\n if (this.lgOpened) {\r\n var currentGalleryItem = this.galleryItems[this.index];\r\n var __slideVideoInfo = currentGalleryItem.__slideVideoInfo;\r\n this.mediaContainerPosition = this.getMediaContainerPosition();\r\n var _a = this.mediaContainerPosition, top_1 = _a.top, bottom = _a.bottom;\r\n this.currentImageSize = utils.getSize(this.items[this.index], this.outer, top_1 + bottom, __slideVideoInfo && this.settings.videoMaxSize);\r\n if (__slideVideoInfo) {\r\n this.resizeVideoSlide(this.index, this.currentImageSize);\r\n }\r\n if (this.zoomFromOrigin && !this.isDummyImageRemoved) {\r\n var imgStyle = this.getDummyImgStyles(this.currentImageSize);\r\n this.outer\r\n .find('.lg-current .lg-dummy-img')\r\n .first()\r\n .attr('style', imgStyle);\r\n }\r\n this.LGel.trigger(lGEvents.containerResize);\r\n }\r\n };\r\n LightGallery.prototype.resizeVideoSlide = function (index, imageSize) {\r\n var lgVideoStyle = this.getVideoContStyle(imageSize);\r\n var currentSlide = this.getSlideItem(index);\r\n currentSlide.find('.lg-video-cont').attr('style', lgVideoStyle);\r\n };\r\n /**\r\n * Update slides dynamically.\r\n * Add, edit or delete slides dynamically when lightGallery is opened.\r\n * Modify the current gallery items and pass it via updateSlides method\r\n * @note\r\n * - Do not mutate existing lightGallery items directly.\r\n * - Always pass new list of gallery items\r\n * - You need to take care of thumbnails outside the gallery if any\r\n * - user this method only if you want to update slides when the gallery is opened. Otherwise, use `refresh()` method.\r\n * @param items Gallery items\r\n * @param index After the update operation, which slide gallery should navigate to\r\n * @category lGPublicMethods\r\n * @example\r\n * const plugin = lightGallery();\r\n *\r\n * // Adding slides dynamically\r\n * let galleryItems = [\r\n * // Access existing lightGallery items\r\n * // galleryItems are automatically generated internally from the gallery HTML markup\r\n * // or directly from galleryItems when dynamic gallery is used\r\n * ...plugin.galleryItems,\r\n * ...[\r\n * {\r\n * src: 'img/img-1.png',\r\n * thumb: 'img/thumb1.png',\r\n * },\r\n * ],\r\n * ];\r\n * plugin.updateSlides(\r\n * galleryItems,\r\n * plugin.index,\r\n * );\r\n *\r\n *\r\n * // Remove slides dynamically\r\n * galleryItems = JSON.parse(\r\n * JSON.stringify(updateSlideInstance.galleryItems),\r\n * );\r\n * galleryItems.shift();\r\n * updateSlideInstance.updateSlides(galleryItems, 1);\r\n * @see Demo\r\n */\r\n LightGallery.prototype.updateSlides = function (items, index) {\r\n if (this.index > items.length - 1) {\r\n this.index = items.length - 1;\r\n }\r\n if (items.length === 1) {\r\n this.index = 0;\r\n }\r\n if (!items.length) {\r\n this.closeGallery();\r\n return;\r\n }\r\n var currentSrc = this.galleryItems[index].src;\r\n this.galleryItems = items;\r\n this.updateControls();\r\n this.$inner.empty();\r\n this.currentItemsInDom = [];\r\n var _index = 0;\r\n // Find the current index based on source value of the slide\r\n this.galleryItems.some(function (galleryItem, itemIndex) {\r\n if (galleryItem.src === currentSrc) {\r\n _index = itemIndex;\r\n return true;\r\n }\r\n return false;\r\n });\r\n this.currentItemsInDom = this.organizeSlideItems(_index, -1);\r\n this.loadContent(_index, true);\r\n this.getSlideItem(_index).addClass('lg-current');\r\n this.index = _index;\r\n this.updateCurrentCounter(_index);\r\n this.LGel.trigger(lGEvents.updateSlides);\r\n };\r\n // Get gallery items based on multiple conditions\r\n LightGallery.prototype.getItems = function () {\r\n // Gallery items\r\n this.items = [];\r\n if (!this.settings.dynamic) {\r\n if (this.settings.selector === 'this') {\r\n this.items.push(this.el);\r\n }\r\n else if (this.settings.selector) {\r\n if (typeof this.settings.selector === 'string') {\r\n if (this.settings.selectWithin) {\r\n var selectWithin = $LG(this.settings.selectWithin);\r\n this.items = selectWithin\r\n .find(this.settings.selector)\r\n .get();\r\n }\r\n else {\r\n this.items = this.el.querySelectorAll(this.settings.selector);\r\n }\r\n }\r\n else {\r\n this.items = this.settings.selector;\r\n }\r\n }\r\n else {\r\n this.items = this.el.children;\r\n }\r\n return utils.getDynamicOptions(this.items, this.settings.extraProps, this.settings.getCaptionFromTitleOrAlt, this.settings.exThumbImage);\r\n }\r\n else {\r\n return this.settings.dynamicEl || [];\r\n }\r\n };\r\n LightGallery.prototype.shouldHideScrollbar = function () {\r\n return (this.settings.hideScrollbar &&\r\n document.body === this.settings.container);\r\n };\r\n LightGallery.prototype.hideScrollbar = function () {\r\n if (!this.shouldHideScrollbar()) {\r\n return;\r\n }\r\n this.bodyPaddingRight = parseFloat($LG('body').style().paddingRight);\r\n var bodyRect = document.documentElement.getBoundingClientRect();\r\n var scrollbarWidth = window.innerWidth - bodyRect.width;\r\n $LG(document.body).css('padding-right', scrollbarWidth + this.bodyPaddingRight + 'px');\r\n $LG(document.body).addClass('lg-overlay-open');\r\n };\r\n LightGallery.prototype.resetScrollBar = function () {\r\n if (!this.shouldHideScrollbar()) {\r\n return;\r\n }\r\n $LG(document.body).css('padding-right', this.bodyPaddingRight + 'px');\r\n $LG(document.body).removeClass('lg-overlay-open');\r\n };\r\n /**\r\n * Open lightGallery.\r\n * Open gallery with specific slide by passing index of the slide as parameter.\r\n * @category lGPublicMethods\r\n * @param {Number} index - index of the slide\r\n * @param {HTMLElement} element - Which image lightGallery should zoom from\r\n *\r\n * @example\r\n * const $dynamicGallery = document.getElementById('dynamic-gallery-demo');\r\n * const dynamicGallery = lightGallery($dynamicGallery, {\r\n * dynamic: true,\r\n * dynamicEl: [\r\n * {\r\n * src: 'img/1.jpg',\r\n * thumb: 'img/thumb-1.jpg',\r\n * subHtml: '

Image 1 title

Image 1 descriptions.

',\r\n * },\r\n * ...\r\n * ],\r\n * });\r\n * $dynamicGallery.addEventListener('click', function () {\r\n * // Starts with third item.(Optional).\r\n * // This is useful if you want use dynamic mode with\r\n * // custom thumbnails (thumbnails outside gallery),\r\n * dynamicGallery.openGallery(2);\r\n * });\r\n *\r\n */\r\n LightGallery.prototype.openGallery = function (index, element) {\r\n var _this = this;\r\n if (index === void 0) { index = this.settings.index; }\r\n // prevent accidental double execution\r\n if (this.lgOpened)\r\n return;\r\n this.lgOpened = true;\r\n this.outer.removeClass('lg-hide-items');\r\n this.hideScrollbar();\r\n // Add display block, but still has opacity 0\r\n this.$container.addClass('lg-show');\r\n var itemsToBeInsertedToDom = this.getItemsToBeInsertedToDom(index, index);\r\n this.currentItemsInDom = itemsToBeInsertedToDom;\r\n var items = '';\r\n itemsToBeInsertedToDom.forEach(function (item) {\r\n items = items + (\"
\");\r\n });\r\n this.$inner.append(items);\r\n this.addHtml(index);\r\n var transform = '';\r\n this.mediaContainerPosition = this.getMediaContainerPosition();\r\n var _a = this.mediaContainerPosition, top = _a.top, bottom = _a.bottom;\r\n if (!this.settings.allowMediaOverlap) {\r\n this.setMediaContainerPosition(top, bottom);\r\n }\r\n var __slideVideoInfo = this.galleryItems[index].__slideVideoInfo;\r\n if (this.zoomFromOrigin && element) {\r\n this.currentImageSize = utils.getSize(element, this.outer, top + bottom, __slideVideoInfo && this.settings.videoMaxSize);\r\n transform = utils.getTransform(element, this.outer, top, bottom, this.currentImageSize);\r\n }\r\n if (!this.zoomFromOrigin || !transform) {\r\n this.outer.addClass(this.settings.startClass);\r\n this.getSlideItem(index).removeClass('lg-complete');\r\n }\r\n var timeout = this.settings.zoomFromOrigin\r\n ? 100\r\n : this.settings.backdropDuration;\r\n setTimeout(function () {\r\n _this.outer.addClass('lg-components-open');\r\n }, timeout);\r\n this.index = index;\r\n this.LGel.trigger(lGEvents.beforeOpen);\r\n // add class lg-current to remove initial transition\r\n this.getSlideItem(index).addClass('lg-current');\r\n this.lGalleryOn = false;\r\n // Store the current scroll top value to scroll back after closing the gallery..\r\n this.prevScrollTop = $LG(window).scrollTop();\r\n setTimeout(function () {\r\n // Need to check both zoomFromOrigin and transform values as we need to set set the\r\n // default opening animation if user missed to add the lg-size attribute\r\n if (_this.zoomFromOrigin && transform) {\r\n var currentSlide_1 = _this.getSlideItem(index);\r\n currentSlide_1.css('transform', transform);\r\n setTimeout(function () {\r\n currentSlide_1\r\n .addClass('lg-start-progress lg-start-end-progress')\r\n .css('transition-duration', _this.settings.startAnimationDuration + 'ms');\r\n _this.outer.addClass('lg-zoom-from-image');\r\n });\r\n setTimeout(function () {\r\n currentSlide_1.css('transform', 'translate3d(0, 0, 0)');\r\n }, 100);\r\n }\r\n setTimeout(function () {\r\n _this.$backdrop.addClass('in');\r\n _this.$container.addClass('lg-show-in');\r\n }, 10);\r\n setTimeout(function () {\r\n if (_this.settings.trapFocus &&\r\n document.body === _this.settings.container) {\r\n _this.trapFocus();\r\n }\r\n }, _this.settings.backdropDuration + 50);\r\n // lg-visible class resets gallery opacity to 1\r\n if (!_this.zoomFromOrigin || !transform) {\r\n setTimeout(function () {\r\n _this.outer.addClass('lg-visible');\r\n }, _this.settings.backdropDuration);\r\n }\r\n // initiate slide function\r\n _this.slide(index, false, false, false);\r\n _this.LGel.trigger(lGEvents.afterOpen);\r\n });\r\n if (document.body === this.settings.container) {\r\n $LG('html').addClass('lg-on');\r\n }\r\n };\r\n /**\r\n * Note - Changing the position of the media on every slide transition creates a flickering effect.\r\n * Therefore, The height of the caption is calculated dynamically, only once based on the first slide caption.\r\n * if you have dynamic captions for each media,\r\n * you can provide an appropriate height for the captions via allowMediaOverlap option\r\n */\r\n LightGallery.prototype.getMediaContainerPosition = function () {\r\n if (this.settings.allowMediaOverlap) {\r\n return {\r\n top: 0,\r\n bottom: 0,\r\n };\r\n }\r\n var top = this.$toolbar.get().clientHeight || 0;\r\n var subHtml = this.outer.find('.lg-components .lg-sub-html').get();\r\n var captionHeight = this.settings.defaultCaptionHeight ||\r\n (subHtml && subHtml.clientHeight) ||\r\n 0;\r\n var thumbContainer = this.outer.find('.lg-thumb-outer').get();\r\n var thumbHeight = thumbContainer ? thumbContainer.clientHeight : 0;\r\n var bottom = thumbHeight + captionHeight;\r\n return {\r\n top: top,\r\n bottom: bottom,\r\n };\r\n };\r\n LightGallery.prototype.setMediaContainerPosition = function (top, bottom) {\r\n if (top === void 0) { top = 0; }\r\n if (bottom === void 0) { bottom = 0; }\r\n this.$content.css('top', top + 'px').css('bottom', bottom + 'px');\r\n };\r\n LightGallery.prototype.hideBars = function () {\r\n var _this = this;\r\n // Hide controllers if mouse doesn't move for some period\r\n setTimeout(function () {\r\n _this.outer.removeClass('lg-hide-items');\r\n if (_this.settings.hideBarsDelay > 0) {\r\n _this.outer.on('mousemove.lg click.lg touchstart.lg', function () {\r\n _this.outer.removeClass('lg-hide-items');\r\n clearTimeout(_this.hideBarTimeout);\r\n // Timeout will be cleared on each slide movement also\r\n _this.hideBarTimeout = setTimeout(function () {\r\n _this.outer.addClass('lg-hide-items');\r\n }, _this.settings.hideBarsDelay);\r\n });\r\n _this.outer.trigger('mousemove.lg');\r\n }\r\n }, this.settings.showBarsAfter);\r\n };\r\n LightGallery.prototype.initPictureFill = function ($img) {\r\n if (this.settings.supportLegacyBrowser) {\r\n try {\r\n picturefill({\r\n elements: [$img.get()],\r\n });\r\n }\r\n catch (e) {\r\n console.warn('lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.');\r\n }\r\n }\r\n };\r\n /**\r\n * @desc Create image counter\r\n * Ex: 1/10\r\n */\r\n LightGallery.prototype.counter = function () {\r\n if (this.settings.counter) {\r\n var counterHtml = \"
\\n \" + (this.index + 1) + \" /\\n \" + this.galleryItems.length + \"
\";\r\n this.outer.find(this.settings.appendCounterTo).append(counterHtml);\r\n }\r\n };\r\n /**\r\n * @desc add sub-html into the slide\r\n * @param {Number} index - index of the slide\r\n */\r\n LightGallery.prototype.addHtml = function (index) {\r\n var subHtml;\r\n var subHtmlUrl;\r\n if (this.galleryItems[index].subHtmlUrl) {\r\n subHtmlUrl = this.galleryItems[index].subHtmlUrl;\r\n }\r\n else {\r\n subHtml = this.galleryItems[index].subHtml;\r\n }\r\n if (!subHtmlUrl) {\r\n if (subHtml) {\r\n // get first letter of sub-html\r\n // if first letter starts with . or # get the html form the jQuery object\r\n var fL = subHtml.substring(0, 1);\r\n if (fL === '.' || fL === '#') {\r\n if (this.settings.subHtmlSelectorRelative &&\r\n !this.settings.dynamic) {\r\n subHtml = $LG(this.items)\r\n .eq(index)\r\n .find(subHtml)\r\n .first()\r\n .html();\r\n }\r\n else {\r\n subHtml = $LG(subHtml).first().html();\r\n }\r\n }\r\n }\r\n else {\r\n subHtml = '';\r\n }\r\n }\r\n if (this.settings.appendSubHtmlTo !== '.lg-item') {\r\n if (subHtmlUrl) {\r\n this.outer.find('.lg-sub-html').load(subHtmlUrl);\r\n }\r\n else {\r\n this.outer.find('.lg-sub-html').html(subHtml);\r\n }\r\n }\r\n else {\r\n var currentSlide = $LG(this.getSlideItemId(index));\r\n if (subHtmlUrl) {\r\n currentSlide.load(subHtmlUrl);\r\n }\r\n else {\r\n currentSlide.append(\"
\" + subHtml + \"
\");\r\n }\r\n }\r\n // Add lg-empty-html class if title doesn't exist\r\n if (typeof subHtml !== 'undefined' && subHtml !== null) {\r\n if (subHtml === '') {\r\n this.outer\r\n .find(this.settings.appendSubHtmlTo)\r\n .addClass('lg-empty-html');\r\n }\r\n else {\r\n this.outer\r\n .find(this.settings.appendSubHtmlTo)\r\n .removeClass('lg-empty-html');\r\n }\r\n }\r\n this.LGel.trigger(lGEvents.afterAppendSubHtml, {\r\n index: index,\r\n });\r\n };\r\n /**\r\n * @desc Preload slides\r\n * @param {Number} index - index of the slide\r\n * @todo preload not working for the first slide, Also, should work for the first and last slide as well\r\n */\r\n LightGallery.prototype.preload = function (index) {\r\n for (var i = 1; i <= this.settings.preload; i++) {\r\n if (i >= this.galleryItems.length - index) {\r\n break;\r\n }\r\n this.loadContent(index + i, false);\r\n }\r\n for (var j = 1; j <= this.settings.preload; j++) {\r\n if (index - j < 0) {\r\n break;\r\n }\r\n this.loadContent(index - j, false);\r\n }\r\n };\r\n LightGallery.prototype.getDummyImgStyles = function (imageSize) {\r\n if (!imageSize)\r\n return '';\r\n return \"width:\" + imageSize.width + \"px;\\n margin-left: -\" + imageSize.width / 2 + \"px;\\n margin-top: -\" + imageSize.height / 2 + \"px;\\n height:\" + imageSize.height + \"px\";\r\n };\r\n LightGallery.prototype.getVideoContStyle = function (imageSize) {\r\n if (!imageSize)\r\n return '';\r\n return \"width:\" + imageSize.width + \"px;\\n height:\" + imageSize.height + \"px\";\r\n };\r\n LightGallery.prototype.getDummyImageContent = function ($currentSlide, index, alt) {\r\n var $currentItem;\r\n if (!this.settings.dynamic) {\r\n $currentItem = $LG(this.items).eq(index);\r\n }\r\n if ($currentItem) {\r\n var _dummyImgSrc = void 0;\r\n if (!this.settings.exThumbImage) {\r\n _dummyImgSrc = $currentItem.find('img').first().attr('src');\r\n }\r\n else {\r\n _dummyImgSrc = $currentItem.attr(this.settings.exThumbImage);\r\n }\r\n if (!_dummyImgSrc)\r\n return '';\r\n var imgStyle = this.getDummyImgStyles(this.currentImageSize);\r\n var dummyImgContent = \"\";\r\n $currentSlide.addClass('lg-first-slide');\r\n this.outer.addClass('lg-first-slide-loading');\r\n return dummyImgContent;\r\n }\r\n return '';\r\n };\r\n LightGallery.prototype.setImgMarkup = function (src, $currentSlide, index) {\r\n var currentGalleryItem = this.galleryItems[index];\r\n var alt = currentGalleryItem.alt, srcset = currentGalleryItem.srcset, sizes = currentGalleryItem.sizes, sources = currentGalleryItem.sources;\r\n // Use the thumbnail as dummy image which will be resized to actual image size and\r\n // displayed on top of actual image\r\n var imgContent = '';\r\n var altAttr = alt ? 'alt=\"' + alt + '\"' : '';\r\n if (this.isFirstSlideWithZoomAnimation()) {\r\n imgContent = this.getDummyImageContent($currentSlide, index, altAttr);\r\n }\r\n else {\r\n imgContent = utils.getImgMarkup(index, src, altAttr, srcset, sizes, sources);\r\n }\r\n var imgMarkup = \" \" + imgContent + \"\";\r\n $currentSlide.prepend(imgMarkup);\r\n };\r\n LightGallery.prototype.onSlideObjectLoad = function ($slide, isHTML5VideoWithoutPoster, onLoad, onError) {\r\n var mediaObject = $slide.find('.lg-object').first();\r\n if (utils.isImageLoaded(mediaObject.get()) ||\r\n isHTML5VideoWithoutPoster) {\r\n onLoad();\r\n }\r\n else {\r\n mediaObject.on('load.lg error.lg', function () {\r\n onLoad && onLoad();\r\n });\r\n mediaObject.on('error.lg', function () {\r\n onError && onError();\r\n });\r\n }\r\n };\r\n /**\r\n *\r\n * @param $el Current slide item\r\n * @param index\r\n * @param delay Delay is 0 except first time\r\n * @param speed Speed is same as delay, except it is 0 if gallery is opened via hash plugin\r\n * @param isFirstSlide\r\n */\r\n LightGallery.prototype.onLgObjectLoad = function (currentSlide, index, delay, speed, isFirstSlide, isHTML5VideoWithoutPoster) {\r\n var _this = this;\r\n this.onSlideObjectLoad(currentSlide, isHTML5VideoWithoutPoster, function () {\r\n _this.triggerSlideItemLoad(currentSlide, index, delay, speed, isFirstSlide);\r\n }, function () {\r\n currentSlide.addClass('lg-complete lg-complete_');\r\n currentSlide.html('Oops... Failed to load content...');\r\n });\r\n };\r\n LightGallery.prototype.triggerSlideItemLoad = function ($currentSlide, index, delay, speed, isFirstSlide) {\r\n var _this = this;\r\n var currentGalleryItem = this.galleryItems[index];\r\n // Adding delay for video slides without poster for better performance and user experience\r\n // Videos should start playing once once the gallery is completely loaded\r\n var _speed = isFirstSlide &&\r\n this.getSlideType(currentGalleryItem) === 'video' &&\r\n !currentGalleryItem.poster\r\n ? speed\r\n : 0;\r\n setTimeout(function () {\r\n $currentSlide.addClass('lg-complete lg-complete_');\r\n _this.LGel.trigger(lGEvents.slideItemLoad, {\r\n index: index,\r\n delay: delay || 0,\r\n isFirstSlide: isFirstSlide,\r\n });\r\n }, _speed);\r\n };\r\n LightGallery.prototype.isFirstSlideWithZoomAnimation = function () {\r\n return !!(!this.lGalleryOn &&\r\n this.zoomFromOrigin &&\r\n this.currentImageSize);\r\n };\r\n // Add video slideInfo\r\n LightGallery.prototype.addSlideVideoInfo = function (items) {\r\n var _this = this;\r\n items.forEach(function (element, index) {\r\n element.__slideVideoInfo = utils.isVideo(element.src, !!element.video, index);\r\n if (element.__slideVideoInfo &&\r\n _this.settings.loadYouTubePoster &&\r\n !element.poster &&\r\n element.__slideVideoInfo.youtube) {\r\n element.poster = \"//img.youtube.com/vi/\" + element.__slideVideoInfo.youtube[1] + \"/maxresdefault.jpg\";\r\n }\r\n });\r\n };\r\n /**\r\n * Load slide content into slide.\r\n * This is used to load content into slides that is not visible too\r\n * @param {Number} index - index of the slide.\r\n * @param {Boolean} rec - if true call loadcontent() function again.\r\n */\r\n LightGallery.prototype.loadContent = function (index, rec) {\r\n var _this = this;\r\n var currentGalleryItem = this.galleryItems[index];\r\n var $currentSlide = $LG(this.getSlideItemId(index));\r\n var poster = currentGalleryItem.poster, srcset = currentGalleryItem.srcset, sizes = currentGalleryItem.sizes, sources = currentGalleryItem.sources;\r\n var src = currentGalleryItem.src;\r\n var video = currentGalleryItem.video;\r\n var _html5Video = video && typeof video === 'string' ? JSON.parse(video) : video;\r\n if (currentGalleryItem.responsive) {\r\n var srcDyItms = currentGalleryItem.responsive.split(',');\r\n src = utils.getResponsiveSrc(srcDyItms) || src;\r\n }\r\n var videoInfo = currentGalleryItem.__slideVideoInfo;\r\n var lgVideoStyle = '';\r\n var iframe = !!currentGalleryItem.iframe;\r\n var isFirstSlide = !this.lGalleryOn;\r\n // delay for adding complete class. it is 0 except first time.\r\n var delay = 0;\r\n if (isFirstSlide) {\r\n if (this.zoomFromOrigin && this.currentImageSize) {\r\n delay = this.settings.startAnimationDuration + 10;\r\n }\r\n else {\r\n delay = this.settings.backdropDuration + 10;\r\n }\r\n }\r\n if (!$currentSlide.hasClass('lg-loaded')) {\r\n if (videoInfo) {\r\n var _a = this.mediaContainerPosition, top_2 = _a.top, bottom = _a.bottom;\r\n var videoSize = utils.getSize(this.items[index], this.outer, top_2 + bottom, videoInfo && this.settings.videoMaxSize);\r\n lgVideoStyle = this.getVideoContStyle(videoSize);\r\n }\r\n if (iframe) {\r\n var markup = utils.getIframeMarkup(this.settings.iframeWidth, this.settings.iframeHeight, this.settings.iframeMaxWidth, this.settings.iframeMaxHeight, src, currentGalleryItem.iframeTitle);\r\n $currentSlide.prepend(markup);\r\n }\r\n else if (poster) {\r\n var dummyImg = '';\r\n var hasStartAnimation = isFirstSlide &&\r\n this.zoomFromOrigin &&\r\n this.currentImageSize;\r\n if (hasStartAnimation) {\r\n dummyImg = this.getDummyImageContent($currentSlide, index, '');\r\n }\r\n var markup = utils.getVideoPosterMarkup(poster, dummyImg || '', lgVideoStyle, this.settings.strings['playVideo'], videoInfo);\r\n $currentSlide.prepend(markup);\r\n }\r\n else if (videoInfo) {\r\n var markup = \"
\";\r\n $currentSlide.prepend(markup);\r\n }\r\n else {\r\n this.setImgMarkup(src, $currentSlide, index);\r\n if (srcset || sources) {\r\n var $img = $currentSlide.find('.lg-object');\r\n this.initPictureFill($img);\r\n }\r\n }\r\n if (poster || videoInfo) {\r\n this.LGel.trigger(lGEvents.hasVideo, {\r\n index: index,\r\n src: src,\r\n html5Video: _html5Video,\r\n hasPoster: !!poster,\r\n });\r\n }\r\n this.LGel.trigger(lGEvents.afterAppendSlide, { index: index });\r\n if (this.lGalleryOn &&\r\n this.settings.appendSubHtmlTo === '.lg-item') {\r\n this.addHtml(index);\r\n }\r\n }\r\n // For first time add some delay for displaying the start animation.\r\n var _speed = 0;\r\n // Do not change the delay value because it is required for zoom plugin.\r\n // If gallery opened from direct url (hash) speed value should be 0\r\n if (delay && !$LG(document.body).hasClass('lg-from-hash')) {\r\n _speed = delay;\r\n }\r\n // Only for first slide and zoomFromOrigin is enabled\r\n if (this.isFirstSlideWithZoomAnimation()) {\r\n setTimeout(function () {\r\n $currentSlide\r\n .removeClass('lg-start-end-progress lg-start-progress')\r\n .removeAttr('style');\r\n }, this.settings.startAnimationDuration + 100);\r\n if (!$currentSlide.hasClass('lg-loaded')) {\r\n setTimeout(function () {\r\n if (_this.getSlideType(currentGalleryItem) === 'image') {\r\n var alt = currentGalleryItem.alt;\r\n var altAttr = alt ? 'alt=\"' + alt + '\"' : '';\r\n $currentSlide\r\n .find('.lg-img-wrap')\r\n .append(utils.getImgMarkup(index, src, altAttr, srcset, sizes, currentGalleryItem.sources));\r\n if (srcset || sources) {\r\n var $img = $currentSlide.find('.lg-object');\r\n _this.initPictureFill($img);\r\n }\r\n }\r\n if (_this.getSlideType(currentGalleryItem) === 'image' ||\r\n (_this.getSlideType(currentGalleryItem) === 'video' &&\r\n poster)) {\r\n _this.onLgObjectLoad($currentSlide, index, delay, _speed, true, false);\r\n // load remaining slides once the slide is completely loaded\r\n _this.onSlideObjectLoad($currentSlide, !!(videoInfo && videoInfo.html5 && !poster), function () {\r\n _this.loadContentOnFirstSlideLoad(index, $currentSlide, _speed);\r\n }, function () {\r\n _this.loadContentOnFirstSlideLoad(index, $currentSlide, _speed);\r\n });\r\n }\r\n }, this.settings.startAnimationDuration + 100);\r\n }\r\n }\r\n // SLide content has been added to dom\r\n $currentSlide.addClass('lg-loaded');\r\n if (!this.isFirstSlideWithZoomAnimation() ||\r\n (this.getSlideType(currentGalleryItem) === 'video' && !poster)) {\r\n this.onLgObjectLoad($currentSlide, index, delay, _speed, isFirstSlide, !!(videoInfo && videoInfo.html5 && !poster));\r\n }\r\n // When gallery is opened once content is loaded (second time) need to add lg-complete class for css styling\r\n if ((!this.zoomFromOrigin || !this.currentImageSize) &&\r\n $currentSlide.hasClass('lg-complete_') &&\r\n !this.lGalleryOn) {\r\n setTimeout(function () {\r\n $currentSlide.addClass('lg-complete');\r\n }, this.settings.backdropDuration);\r\n }\r\n // Content loaded\r\n // Need to set lGalleryOn before calling preload function\r\n this.lGalleryOn = true;\r\n if (rec === true) {\r\n if (!$currentSlide.hasClass('lg-complete_')) {\r\n $currentSlide\r\n .find('.lg-object')\r\n .first()\r\n .on('load.lg error.lg', function () {\r\n _this.preload(index);\r\n });\r\n }\r\n else {\r\n this.preload(index);\r\n }\r\n }\r\n };\r\n /**\r\n * @desc Remove dummy image content and load next slides\r\n * Called only for the first time if zoomFromOrigin animation is enabled\r\n * @param index\r\n * @param $currentSlide\r\n * @param speed\r\n */\r\n LightGallery.prototype.loadContentOnFirstSlideLoad = function (index, $currentSlide, speed) {\r\n var _this = this;\r\n setTimeout(function () {\r\n $currentSlide.find('.lg-dummy-img').remove();\r\n $currentSlide.removeClass('lg-first-slide');\r\n _this.outer.removeClass('lg-first-slide-loading');\r\n _this.isDummyImageRemoved = true;\r\n _this.preload(index);\r\n }, speed + 300);\r\n };\r\n LightGallery.prototype.getItemsToBeInsertedToDom = function (index, prevIndex, numberOfItems) {\r\n var _this = this;\r\n if (numberOfItems === void 0) { numberOfItems = 0; }\r\n var itemsToBeInsertedToDom = [];\r\n // Minimum 2 items should be there\r\n var possibleNumberOfItems = Math.max(numberOfItems, 3);\r\n possibleNumberOfItems = Math.min(possibleNumberOfItems, this.galleryItems.length);\r\n var prevIndexItem = \"lg-item-\" + this.lgId + \"-\" + prevIndex;\r\n if (this.galleryItems.length <= 3) {\r\n this.galleryItems.forEach(function (_element, index) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + _this.lgId + \"-\" + index);\r\n });\r\n return itemsToBeInsertedToDom;\r\n }\r\n if (index < (this.galleryItems.length - 1) / 2) {\r\n for (var idx = index; idx > index - possibleNumberOfItems / 2 && idx >= 0; idx--) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + this.lgId + \"-\" + idx);\r\n }\r\n var numberOfExistingItems = itemsToBeInsertedToDom.length;\r\n for (var idx = 0; idx < possibleNumberOfItems - numberOfExistingItems; idx++) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + this.lgId + \"-\" + (index + idx + 1));\r\n }\r\n }\r\n else {\r\n for (var idx = index; idx <= this.galleryItems.length - 1 &&\r\n idx < index + possibleNumberOfItems / 2; idx++) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + this.lgId + \"-\" + idx);\r\n }\r\n var numberOfExistingItems = itemsToBeInsertedToDom.length;\r\n for (var idx = 0; idx < possibleNumberOfItems - numberOfExistingItems; idx++) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + this.lgId + \"-\" + (index - idx - 1));\r\n }\r\n }\r\n if (this.settings.loop) {\r\n if (index === this.galleryItems.length - 1) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + this.lgId + \"-\" + 0);\r\n }\r\n else if (index === 0) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + this.lgId + \"-\" + (this.galleryItems.length - 1));\r\n }\r\n }\r\n if (itemsToBeInsertedToDom.indexOf(prevIndexItem) === -1) {\r\n itemsToBeInsertedToDom.push(\"lg-item-\" + this.lgId + \"-\" + prevIndex);\r\n }\r\n return itemsToBeInsertedToDom;\r\n };\r\n LightGallery.prototype.organizeSlideItems = function (index, prevIndex) {\r\n var _this = this;\r\n var itemsToBeInsertedToDom = this.getItemsToBeInsertedToDom(index, prevIndex, this.settings.numberOfSlideItemsInDom);\r\n itemsToBeInsertedToDom.forEach(function (item) {\r\n if (_this.currentItemsInDom.indexOf(item) === -1) {\r\n _this.$inner.append(\"
\");\r\n }\r\n });\r\n this.currentItemsInDom.forEach(function (item) {\r\n if (itemsToBeInsertedToDom.indexOf(item) === -1) {\r\n $LG(\"#\" + item).remove();\r\n }\r\n });\r\n return itemsToBeInsertedToDom;\r\n };\r\n /**\r\n * Get previous index of the slide\r\n */\r\n LightGallery.prototype.getPreviousSlideIndex = function () {\r\n var prevIndex = 0;\r\n try {\r\n var currentItemId = this.outer\r\n .find('.lg-current')\r\n .first()\r\n .attr('id');\r\n prevIndex = parseInt(currentItemId.split('-')[3]) || 0;\r\n }\r\n catch (error) {\r\n prevIndex = 0;\r\n }\r\n return prevIndex;\r\n };\r\n LightGallery.prototype.setDownloadValue = function (index) {\r\n if (this.settings.download) {\r\n var currentGalleryItem = this.galleryItems[index];\r\n var hideDownloadBtn = currentGalleryItem.downloadUrl === false ||\r\n currentGalleryItem.downloadUrl === 'false';\r\n if (hideDownloadBtn) {\r\n this.outer.addClass('lg-hide-download');\r\n }\r\n else {\r\n var $download = this.getElementById('lg-download');\r\n this.outer.removeClass('lg-hide-download');\r\n $download.attr('href', currentGalleryItem.downloadUrl ||\r\n currentGalleryItem.src);\r\n if (currentGalleryItem.download) {\r\n $download.attr('download', currentGalleryItem.download);\r\n }\r\n }\r\n }\r\n };\r\n LightGallery.prototype.makeSlideAnimation = function (direction, currentSlideItem, previousSlideItem) {\r\n var _this = this;\r\n if (this.lGalleryOn) {\r\n previousSlideItem.addClass('lg-slide-progress');\r\n }\r\n setTimeout(function () {\r\n // remove all transitions\r\n _this.outer.addClass('lg-no-trans');\r\n _this.outer\r\n .find('.lg-item')\r\n .removeClass('lg-prev-slide lg-next-slide');\r\n if (direction === 'prev') {\r\n //prevslide\r\n currentSlideItem.addClass('lg-prev-slide');\r\n previousSlideItem.addClass('lg-next-slide');\r\n }\r\n else {\r\n // next slide\r\n currentSlideItem.addClass('lg-next-slide');\r\n previousSlideItem.addClass('lg-prev-slide');\r\n }\r\n // give 50 ms for browser to add/remove class\r\n setTimeout(function () {\r\n _this.outer.find('.lg-item').removeClass('lg-current');\r\n currentSlideItem.addClass('lg-current');\r\n // reset all transitions\r\n _this.outer.removeClass('lg-no-trans');\r\n }, 50);\r\n }, this.lGalleryOn ? this.settings.slideDelay : 0);\r\n };\r\n /**\r\n * Goto a specific slide.\r\n * @param {Number} index - index of the slide\r\n * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag\r\n * @param {Boolean} fromThumb - true if slide function called via thumbnail click\r\n * @param {String} direction - Direction of the slide(next/prev)\r\n * @category lGPublicMethods\r\n * @example\r\n * const plugin = lightGallery();\r\n * // to go to 3rd slide\r\n * plugin.slide(2);\r\n *\r\n */\r\n LightGallery.prototype.slide = function (index, fromTouch, fromThumb, direction) {\r\n var _this = this;\r\n var prevIndex = this.getPreviousSlideIndex();\r\n this.currentItemsInDom = this.organizeSlideItems(index, prevIndex);\r\n // Prevent multiple call, Required for hsh plugin\r\n if (this.lGalleryOn && prevIndex === index) {\r\n return;\r\n }\r\n var numberOfGalleryItems = this.galleryItems.length;\r\n if (!this.lgBusy) {\r\n if (this.settings.counter) {\r\n this.updateCurrentCounter(index);\r\n }\r\n var currentSlideItem = this.getSlideItem(index);\r\n var previousSlideItem_1 = this.getSlideItem(prevIndex);\r\n var currentGalleryItem = this.galleryItems[index];\r\n var videoInfo = currentGalleryItem.__slideVideoInfo;\r\n this.outer.attr('data-lg-slide-type', this.getSlideType(currentGalleryItem));\r\n this.setDownloadValue(index);\r\n if (videoInfo) {\r\n var _a = this.mediaContainerPosition, top_3 = _a.top, bottom = _a.bottom;\r\n var videoSize = utils.getSize(this.items[index], this.outer, top_3 + bottom, videoInfo && this.settings.videoMaxSize);\r\n this.resizeVideoSlide(index, videoSize);\r\n }\r\n this.LGel.trigger(lGEvents.beforeSlide, {\r\n prevIndex: prevIndex,\r\n index: index,\r\n fromTouch: !!fromTouch,\r\n fromThumb: !!fromThumb,\r\n });\r\n this.lgBusy = true;\r\n clearTimeout(this.hideBarTimeout);\r\n this.arrowDisable(index);\r\n if (!direction) {\r\n if (index < prevIndex) {\r\n direction = 'prev';\r\n }\r\n else if (index > prevIndex) {\r\n direction = 'next';\r\n }\r\n }\r\n if (!fromTouch) {\r\n this.makeSlideAnimation(direction, currentSlideItem, previousSlideItem_1);\r\n }\r\n else {\r\n this.outer\r\n .find('.lg-item')\r\n .removeClass('lg-prev-slide lg-current lg-next-slide');\r\n var touchPrev = void 0;\r\n var touchNext = void 0;\r\n if (numberOfGalleryItems > 2) {\r\n touchPrev = index - 1;\r\n touchNext = index + 1;\r\n if (index === 0 && prevIndex === numberOfGalleryItems - 1) {\r\n // next slide\r\n touchNext = 0;\r\n touchPrev = numberOfGalleryItems - 1;\r\n }\r\n else if (index === numberOfGalleryItems - 1 &&\r\n prevIndex === 0) {\r\n // prev slide\r\n touchNext = 0;\r\n touchPrev = numberOfGalleryItems - 1;\r\n }\r\n }\r\n else {\r\n touchPrev = 0;\r\n touchNext = 1;\r\n }\r\n if (direction === 'prev') {\r\n this.getSlideItem(touchNext).addClass('lg-next-slide');\r\n }\r\n else {\r\n this.getSlideItem(touchPrev).addClass('lg-prev-slide');\r\n }\r\n currentSlideItem.addClass('lg-current');\r\n }\r\n // Do not put load content in set timeout as it needs to load immediately when the gallery is opened\r\n if (!this.lGalleryOn) {\r\n this.loadContent(index, true);\r\n }\r\n else {\r\n setTimeout(function () {\r\n _this.loadContent(index, true);\r\n // Add title if this.settings.appendSubHtmlTo === lg-sub-html\r\n if (_this.settings.appendSubHtmlTo !== '.lg-item') {\r\n _this.addHtml(index);\r\n }\r\n }, this.settings.speed + 50 + (fromTouch ? 0 : this.settings.slideDelay));\r\n }\r\n setTimeout(function () {\r\n _this.lgBusy = false;\r\n previousSlideItem_1.removeClass('lg-slide-progress');\r\n _this.LGel.trigger(lGEvents.afterSlide, {\r\n prevIndex: prevIndex,\r\n index: index,\r\n fromTouch: fromTouch,\r\n fromThumb: fromThumb,\r\n });\r\n }, (this.lGalleryOn ? this.settings.speed + 100 : 100) + (fromTouch ? 0 : this.settings.slideDelay));\r\n }\r\n this.index = index;\r\n };\r\n LightGallery.prototype.updateCurrentCounter = function (index) {\r\n this.getElementById('lg-counter-current').html(index + 1 + '');\r\n };\r\n LightGallery.prototype.updateCounterTotal = function () {\r\n this.getElementById('lg-counter-all').html(this.galleryItems.length + '');\r\n };\r\n LightGallery.prototype.getSlideType = function (item) {\r\n if (item.__slideVideoInfo) {\r\n return 'video';\r\n }\r\n else if (item.iframe) {\r\n return 'iframe';\r\n }\r\n else {\r\n return 'image';\r\n }\r\n };\r\n LightGallery.prototype.touchMove = function (startCoords, endCoords, e) {\r\n var distanceX = endCoords.pageX - startCoords.pageX;\r\n var distanceY = endCoords.pageY - startCoords.pageY;\r\n var allowSwipe = false;\r\n if (this.swipeDirection) {\r\n allowSwipe = true;\r\n }\r\n else {\r\n if (Math.abs(distanceX) > 15) {\r\n this.swipeDirection = 'horizontal';\r\n allowSwipe = true;\r\n }\r\n else if (Math.abs(distanceY) > 15) {\r\n this.swipeDirection = 'vertical';\r\n allowSwipe = true;\r\n }\r\n }\r\n if (!allowSwipe) {\r\n return;\r\n }\r\n var $currentSlide = this.getSlideItem(this.index);\r\n if (this.swipeDirection === 'horizontal') {\r\n e === null || e === void 0 ? void 0 : e.preventDefault();\r\n // reset opacity and transition duration\r\n this.outer.addClass('lg-dragging');\r\n // move current slide\r\n this.setTranslate($currentSlide, distanceX, 0);\r\n // move next and prev slide with current slide\r\n var width = $currentSlide.get().offsetWidth;\r\n var slideWidthAmount = (width * 15) / 100;\r\n var gutter = slideWidthAmount - Math.abs((distanceX * 10) / 100);\r\n this.setTranslate(this.outer.find('.lg-prev-slide').first(), -width + distanceX - gutter, 0);\r\n this.setTranslate(this.outer.find('.lg-next-slide').first(), width + distanceX + gutter, 0);\r\n }\r\n else if (this.swipeDirection === 'vertical') {\r\n if (this.settings.swipeToClose) {\r\n e === null || e === void 0 ? void 0 : e.preventDefault();\r\n this.$container.addClass('lg-dragging-vertical');\r\n var opacity = 1 - Math.abs(distanceY) / window.innerHeight;\r\n this.$backdrop.css('opacity', opacity);\r\n var scale = 1 - Math.abs(distanceY) / (window.innerWidth * 2);\r\n this.setTranslate($currentSlide, 0, distanceY, scale, scale);\r\n if (Math.abs(distanceY) > 100) {\r\n this.outer\r\n .addClass('lg-hide-items')\r\n .removeClass('lg-components-open');\r\n }\r\n }\r\n }\r\n };\r\n LightGallery.prototype.touchEnd = function (endCoords, startCoords, event) {\r\n var _this = this;\r\n var distance;\r\n // keep slide animation for any mode while dragg/swipe\r\n if (this.settings.mode !== 'lg-slide') {\r\n this.outer.addClass('lg-slide');\r\n }\r\n // set transition duration\r\n setTimeout(function () {\r\n _this.$container.removeClass('lg-dragging-vertical');\r\n _this.outer\r\n .removeClass('lg-dragging lg-hide-items')\r\n .addClass('lg-components-open');\r\n var triggerClick = true;\r\n if (_this.swipeDirection === 'horizontal') {\r\n distance = endCoords.pageX - startCoords.pageX;\r\n var distanceAbs = Math.abs(endCoords.pageX - startCoords.pageX);\r\n if (distance < 0 &&\r\n distanceAbs > _this.settings.swipeThreshold) {\r\n _this.goToNextSlide(true);\r\n triggerClick = false;\r\n }\r\n else if (distance > 0 &&\r\n distanceAbs > _this.settings.swipeThreshold) {\r\n _this.goToPrevSlide(true);\r\n triggerClick = false;\r\n }\r\n }\r\n else if (_this.swipeDirection === 'vertical') {\r\n distance = Math.abs(endCoords.pageY - startCoords.pageY);\r\n if (_this.settings.closable &&\r\n _this.settings.swipeToClose &&\r\n distance > 100) {\r\n _this.closeGallery();\r\n return;\r\n }\r\n else {\r\n _this.$backdrop.css('opacity', 1);\r\n }\r\n }\r\n _this.outer.find('.lg-item').removeAttr('style');\r\n if (triggerClick &&\r\n Math.abs(endCoords.pageX - startCoords.pageX) < 5) {\r\n // Trigger click if distance is less than 5 pix\r\n var target = $LG(event.target);\r\n if (_this.isPosterElement(target)) {\r\n _this.LGel.trigger(lGEvents.posterClick);\r\n }\r\n }\r\n _this.swipeDirection = undefined;\r\n });\r\n // remove slide class once drag/swipe is completed if mode is not slide\r\n setTimeout(function () {\r\n if (!_this.outer.hasClass('lg-dragging') &&\r\n _this.settings.mode !== 'lg-slide') {\r\n _this.outer.removeClass('lg-slide');\r\n }\r\n }, this.settings.speed + 100);\r\n };\r\n LightGallery.prototype.enableSwipe = function () {\r\n var _this = this;\r\n var startCoords = {};\r\n var endCoords = {};\r\n var isMoved = false;\r\n var isSwiping = false;\r\n if (this.settings.enableSwipe) {\r\n this.$inner.on('touchstart.lg', function (e) {\r\n _this.dragOrSwipeEnabled = true;\r\n var $item = _this.getSlideItem(_this.index);\r\n if (($LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target)) &&\r\n !_this.outer.hasClass('lg-zoomed') &&\r\n !_this.lgBusy &&\r\n e.touches.length === 1) {\r\n isSwiping = true;\r\n _this.touchAction = 'swipe';\r\n _this.manageSwipeClass();\r\n startCoords = {\r\n pageX: e.touches[0].pageX,\r\n pageY: e.touches[0].pageY,\r\n };\r\n }\r\n });\r\n this.$inner.on('touchmove.lg', function (e) {\r\n if (isSwiping &&\r\n _this.touchAction === 'swipe' &&\r\n e.touches.length === 1) {\r\n endCoords = {\r\n pageX: e.touches[0].pageX,\r\n pageY: e.touches[0].pageY,\r\n };\r\n _this.touchMove(startCoords, endCoords, e);\r\n isMoved = true;\r\n }\r\n });\r\n this.$inner.on('touchend.lg', function (event) {\r\n if (_this.touchAction === 'swipe') {\r\n if (isMoved) {\r\n isMoved = false;\r\n _this.touchEnd(endCoords, startCoords, event);\r\n }\r\n else if (isSwiping) {\r\n var target = $LG(event.target);\r\n if (_this.isPosterElement(target)) {\r\n _this.LGel.trigger(lGEvents.posterClick);\r\n }\r\n }\r\n _this.touchAction = undefined;\r\n isSwiping = false;\r\n }\r\n });\r\n }\r\n };\r\n LightGallery.prototype.enableDrag = function () {\r\n var _this = this;\r\n var startCoords = {};\r\n var endCoords = {};\r\n var isDraging = false;\r\n var isMoved = false;\r\n if (this.settings.enableDrag) {\r\n this.outer.on('mousedown.lg', function (e) {\r\n _this.dragOrSwipeEnabled = true;\r\n var $item = _this.getSlideItem(_this.index);\r\n if ($LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target)) {\r\n if (!_this.outer.hasClass('lg-zoomed') && !_this.lgBusy) {\r\n e.preventDefault();\r\n if (!_this.lgBusy) {\r\n _this.manageSwipeClass();\r\n startCoords = {\r\n pageX: e.pageX,\r\n pageY: e.pageY,\r\n };\r\n isDraging = true;\r\n // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723\r\n _this.outer.get().scrollLeft += 1;\r\n _this.outer.get().scrollLeft -= 1;\r\n // *\r\n _this.outer\r\n .removeClass('lg-grab')\r\n .addClass('lg-grabbing');\r\n _this.LGel.trigger(lGEvents.dragStart);\r\n }\r\n }\r\n }\r\n });\r\n $LG(window).on(\"mousemove.lg.global\" + this.lgId, function (e) {\r\n if (isDraging && _this.lgOpened) {\r\n isMoved = true;\r\n endCoords = {\r\n pageX: e.pageX,\r\n pageY: e.pageY,\r\n };\r\n _this.touchMove(startCoords, endCoords);\r\n _this.LGel.trigger(lGEvents.dragMove);\r\n }\r\n });\r\n $LG(window).on(\"mouseup.lg.global\" + this.lgId, function (event) {\r\n if (!_this.lgOpened) {\r\n return;\r\n }\r\n var target = $LG(event.target);\r\n if (isMoved) {\r\n isMoved = false;\r\n _this.touchEnd(endCoords, startCoords, event);\r\n _this.LGel.trigger(lGEvents.dragEnd);\r\n }\r\n else if (_this.isPosterElement(target)) {\r\n _this.LGel.trigger(lGEvents.posterClick);\r\n }\r\n // Prevent execution on click\r\n if (isDraging) {\r\n isDraging = false;\r\n _this.outer.removeClass('lg-grabbing').addClass('lg-grab');\r\n }\r\n });\r\n }\r\n };\r\n LightGallery.prototype.triggerPosterClick = function () {\r\n var _this = this;\r\n this.$inner.on('click.lg', function (event) {\r\n if (!_this.dragOrSwipeEnabled &&\r\n _this.isPosterElement($LG(event.target))) {\r\n _this.LGel.trigger(lGEvents.posterClick);\r\n }\r\n });\r\n };\r\n LightGallery.prototype.manageSwipeClass = function () {\r\n var _touchNext = this.index + 1;\r\n var _touchPrev = this.index - 1;\r\n if (this.settings.loop && this.galleryItems.length > 2) {\r\n if (this.index === 0) {\r\n _touchPrev = this.galleryItems.length - 1;\r\n }\r\n else if (this.index === this.galleryItems.length - 1) {\r\n _touchNext = 0;\r\n }\r\n }\r\n this.outer.find('.lg-item').removeClass('lg-next-slide lg-prev-slide');\r\n if (_touchPrev > -1) {\r\n this.getSlideItem(_touchPrev).addClass('lg-prev-slide');\r\n }\r\n this.getSlideItem(_touchNext).addClass('lg-next-slide');\r\n };\r\n /**\r\n * Go to next slide\r\n * @param {Boolean} fromTouch - true if slide function called via touch event\r\n * @category lGPublicMethods\r\n * @example\r\n * const plugin = lightGallery();\r\n * plugin.goToNextSlide();\r\n * @see Demo\r\n */\r\n LightGallery.prototype.goToNextSlide = function (fromTouch) {\r\n var _this = this;\r\n var _loop = this.settings.loop;\r\n if (fromTouch && this.galleryItems.length < 3) {\r\n _loop = false;\r\n }\r\n if (!this.lgBusy) {\r\n if (this.index + 1 < this.galleryItems.length) {\r\n this.index++;\r\n this.LGel.trigger(lGEvents.beforeNextSlide, {\r\n index: this.index,\r\n });\r\n this.slide(this.index, !!fromTouch, false, 'next');\r\n }\r\n else {\r\n if (_loop) {\r\n this.index = 0;\r\n this.LGel.trigger(lGEvents.beforeNextSlide, {\r\n index: this.index,\r\n });\r\n this.slide(this.index, !!fromTouch, false, 'next');\r\n }\r\n else if (this.settings.slideEndAnimation && !fromTouch) {\r\n this.outer.addClass('lg-right-end');\r\n setTimeout(function () {\r\n _this.outer.removeClass('lg-right-end');\r\n }, 400);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Go to previous slides\r\n * @param {Boolean} fromTouch - true if slide function called via touch event\r\n * @category lGPublicMethods\r\n * @example\r\n * const plugin = lightGallery({});\r\n * plugin.goToPrevSlide();\r\n * @see Demo\r\n *\r\n */\r\n LightGallery.prototype.goToPrevSlide = function (fromTouch) {\r\n var _this = this;\r\n var _loop = this.settings.loop;\r\n if (fromTouch && this.galleryItems.length < 3) {\r\n _loop = false;\r\n }\r\n if (!this.lgBusy) {\r\n if (this.index > 0) {\r\n this.index--;\r\n this.LGel.trigger(lGEvents.beforePrevSlide, {\r\n index: this.index,\r\n fromTouch: fromTouch,\r\n });\r\n this.slide(this.index, !!fromTouch, false, 'prev');\r\n }\r\n else {\r\n if (_loop) {\r\n this.index = this.galleryItems.length - 1;\r\n this.LGel.trigger(lGEvents.beforePrevSlide, {\r\n index: this.index,\r\n fromTouch: fromTouch,\r\n });\r\n this.slide(this.index, !!fromTouch, false, 'prev');\r\n }\r\n else if (this.settings.slideEndAnimation && !fromTouch) {\r\n this.outer.addClass('lg-left-end');\r\n setTimeout(function () {\r\n _this.outer.removeClass('lg-left-end');\r\n }, 400);\r\n }\r\n }\r\n }\r\n };\r\n LightGallery.prototype.keyPress = function () {\r\n var _this = this;\r\n $LG(window).on(\"keydown.lg.global\" + this.lgId, function (e) {\r\n if (_this.lgOpened &&\r\n _this.settings.escKey === true &&\r\n e.keyCode === 27) {\r\n e.preventDefault();\r\n if (_this.settings.allowMediaOverlap &&\r\n _this.outer.hasClass('lg-can-toggle') &&\r\n _this.outer.hasClass('lg-components-open')) {\r\n _this.outer.removeClass('lg-components-open');\r\n }\r\n else {\r\n _this.closeGallery();\r\n }\r\n }\r\n if (_this.lgOpened && _this.galleryItems.length > 1) {\r\n if (e.keyCode === 37) {\r\n e.preventDefault();\r\n _this.goToPrevSlide();\r\n }\r\n if (e.keyCode === 39) {\r\n e.preventDefault();\r\n _this.goToNextSlide();\r\n }\r\n }\r\n });\r\n };\r\n LightGallery.prototype.arrow = function () {\r\n var _this = this;\r\n this.getElementById('lg-prev').on('click.lg', function () {\r\n _this.goToPrevSlide();\r\n });\r\n this.getElementById('lg-next').on('click.lg', function () {\r\n _this.goToNextSlide();\r\n });\r\n };\r\n LightGallery.prototype.arrowDisable = function (index) {\r\n // Disable arrows if settings.hideControlOnEnd is true\r\n if (!this.settings.loop && this.settings.hideControlOnEnd) {\r\n var $prev = this.getElementById('lg-prev');\r\n var $next = this.getElementById('lg-next');\r\n if (index + 1 === this.galleryItems.length) {\r\n $next.attr('disabled', 'disabled').addClass('disabled');\r\n }\r\n else {\r\n $next.removeAttr('disabled').removeClass('disabled');\r\n }\r\n if (index === 0) {\r\n $prev.attr('disabled', 'disabled').addClass('disabled');\r\n }\r\n else {\r\n $prev.removeAttr('disabled').removeClass('disabled');\r\n }\r\n }\r\n };\r\n LightGallery.prototype.setTranslate = function ($el, xValue, yValue, scaleX, scaleY) {\r\n if (scaleX === void 0) { scaleX = 1; }\r\n if (scaleY === void 0) { scaleY = 1; }\r\n $el.css('transform', 'translate3d(' +\r\n xValue +\r\n 'px, ' +\r\n yValue +\r\n 'px, 0px) scale3d(' +\r\n scaleX +\r\n ', ' +\r\n scaleY +\r\n ', 1)');\r\n };\r\n LightGallery.prototype.mousewheel = function () {\r\n var _this = this;\r\n var lastCall = 0;\r\n this.outer.on('wheel.lg', function (e) {\r\n if (!e.deltaY || _this.galleryItems.length < 2) {\r\n return;\r\n }\r\n e.preventDefault();\r\n var now = new Date().getTime();\r\n if (now - lastCall < 1000) {\r\n return;\r\n }\r\n lastCall = now;\r\n if (e.deltaY > 0) {\r\n _this.goToNextSlide();\r\n }\r\n else if (e.deltaY < 0) {\r\n _this.goToPrevSlide();\r\n }\r\n });\r\n };\r\n LightGallery.prototype.isSlideElement = function (target) {\r\n return (target.hasClass('lg-outer') ||\r\n target.hasClass('lg-item') ||\r\n target.hasClass('lg-img-wrap'));\r\n };\r\n LightGallery.prototype.isPosterElement = function (target) {\r\n var playButton = this.getSlideItem(this.index)\r\n .find('.lg-video-play-button')\r\n .get();\r\n return (target.hasClass('lg-video-poster') ||\r\n target.hasClass('lg-video-play-button') ||\r\n (playButton && playButton.contains(target.get())));\r\n };\r\n /**\r\n * Maximize minimize inline gallery.\r\n * @category lGPublicMethods\r\n */\r\n LightGallery.prototype.toggleMaximize = function () {\r\n var _this = this;\r\n this.getElementById('lg-maximize').on('click.lg', function () {\r\n _this.$container.toggleClass('lg-inline');\r\n _this.refreshOnResize();\r\n });\r\n };\r\n LightGallery.prototype.invalidateItems = function () {\r\n for (var index = 0; index < this.items.length; index++) {\r\n var element = this.items[index];\r\n var $element = $LG(element);\r\n $element.off(\"click.lgcustom-item-\" + $element.attr('data-lg-id'));\r\n }\r\n };\r\n LightGallery.prototype.trapFocus = function () {\r\n var _this = this;\r\n this.$container.get().focus({\r\n preventScroll: true,\r\n });\r\n $LG(window).on(\"keydown.lg.global\" + this.lgId, function (e) {\r\n if (!_this.lgOpened) {\r\n return;\r\n }\r\n var isTabPressed = e.key === 'Tab' || e.keyCode === 9;\r\n if (!isTabPressed) {\r\n return;\r\n }\r\n var focusableEls = utils.getFocusableElements(_this.$container.get());\r\n var firstFocusableEl = focusableEls[0];\r\n var lastFocusableEl = focusableEls[focusableEls.length - 1];\r\n if (e.shiftKey) {\r\n if (document.activeElement === firstFocusableEl) {\r\n lastFocusableEl.focus();\r\n e.preventDefault();\r\n }\r\n }\r\n else {\r\n if (document.activeElement === lastFocusableEl) {\r\n firstFocusableEl.focus();\r\n e.preventDefault();\r\n }\r\n }\r\n });\r\n };\r\n LightGallery.prototype.manageCloseGallery = function () {\r\n var _this = this;\r\n if (!this.settings.closable)\r\n return;\r\n var mousedown = false;\r\n this.getElementById('lg-close').on('click.lg', function () {\r\n _this.closeGallery();\r\n });\r\n if (this.settings.closeOnTap) {\r\n // If you drag the slide and release outside gallery gets close on chrome\r\n // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer\r\n this.outer.on('mousedown.lg', function (e) {\r\n var target = $LG(e.target);\r\n if (_this.isSlideElement(target)) {\r\n mousedown = true;\r\n }\r\n else {\r\n mousedown = false;\r\n }\r\n });\r\n this.outer.on('mousemove.lg', function () {\r\n mousedown = false;\r\n });\r\n this.outer.on('mouseup.lg', function (e) {\r\n var target = $LG(e.target);\r\n if (_this.isSlideElement(target) && mousedown) {\r\n if (!_this.outer.hasClass('lg-dragging')) {\r\n _this.closeGallery();\r\n }\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Close lightGallery if it is opened.\r\n *\r\n * @description If closable is false in the settings, you need to pass true via closeGallery method to force close gallery\r\n * @return returns the estimated time to close gallery completely including the close animation duration\r\n * @category lGPublicMethods\r\n * @example\r\n * const plugin = lightGallery();\r\n * plugin.closeGallery();\r\n *\r\n */\r\n LightGallery.prototype.closeGallery = function (force) {\r\n var _this = this;\r\n if (!this.lgOpened || (!this.settings.closable && !force)) {\r\n return 0;\r\n }\r\n this.LGel.trigger(lGEvents.beforeClose);\r\n if (this.settings.resetScrollPosition && !this.settings.hideScrollbar) {\r\n $LG(window).scrollTop(this.prevScrollTop);\r\n }\r\n var currentItem = this.items[this.index];\r\n var transform;\r\n if (this.zoomFromOrigin && currentItem) {\r\n var _a = this.mediaContainerPosition, top_4 = _a.top, bottom = _a.bottom;\r\n var _b = this.galleryItems[this.index], __slideVideoInfo = _b.__slideVideoInfo, poster = _b.poster;\r\n var imageSize = utils.getSize(currentItem, this.outer, top_4 + bottom, __slideVideoInfo && poster && this.settings.videoMaxSize);\r\n transform = utils.getTransform(currentItem, this.outer, top_4, bottom, imageSize);\r\n }\r\n if (this.zoomFromOrigin && transform) {\r\n this.outer.addClass('lg-closing lg-zoom-from-image');\r\n this.getSlideItem(this.index)\r\n .addClass('lg-start-end-progress')\r\n .css('transition-duration', this.settings.startAnimationDuration + 'ms')\r\n .css('transform', transform);\r\n }\r\n else {\r\n this.outer.addClass('lg-hide-items');\r\n // lg-zoom-from-image is used for setting the opacity to 1 if zoomFromOrigin is true\r\n // If the closing item doesn't have the lg-size attribute, remove this class to avoid the closing css conflicts\r\n this.outer.removeClass('lg-zoom-from-image');\r\n }\r\n // Unbind all events added by lightGallery\r\n // @todo\r\n //this.$el.off('.lg.tm');\r\n this.destroyModules();\r\n this.lGalleryOn = false;\r\n this.isDummyImageRemoved = false;\r\n this.zoomFromOrigin = this.settings.zoomFromOrigin;\r\n clearTimeout(this.hideBarTimeout);\r\n this.hideBarTimeout = false;\r\n $LG('html').removeClass('lg-on');\r\n this.outer.removeClass('lg-visible lg-components-open');\r\n // Resetting opacity to 0 isd required as vertical swipe to close function adds inline opacity.\r\n this.$backdrop.removeClass('in').css('opacity', 0);\r\n var removeTimeout = this.zoomFromOrigin && transform\r\n ? Math.max(this.settings.startAnimationDuration, this.settings.backdropDuration)\r\n : this.settings.backdropDuration;\r\n this.$container.removeClass('lg-show-in');\r\n // Once the closign animation is completed and gallery is invisible\r\n setTimeout(function () {\r\n if (_this.zoomFromOrigin && transform) {\r\n _this.outer.removeClass('lg-zoom-from-image');\r\n }\r\n _this.$container.removeClass('lg-show');\r\n // Reset scrollbar\r\n _this.resetScrollBar();\r\n // Need to remove inline opacity as it is used in the stylesheet as well\r\n _this.$backdrop\r\n .removeAttr('style')\r\n .css('transition-duration', _this.settings.backdropDuration + 'ms');\r\n _this.outer.removeClass(\"lg-closing \" + _this.settings.startClass);\r\n _this.getSlideItem(_this.index).removeClass('lg-start-end-progress');\r\n _this.$inner.empty();\r\n if (_this.lgOpened) {\r\n _this.LGel.trigger(lGEvents.afterClose, {\r\n instance: _this,\r\n });\r\n }\r\n if (_this.$container.get()) {\r\n _this.$container.get().blur();\r\n }\r\n _this.lgOpened = false;\r\n }, removeTimeout + 100);\r\n return removeTimeout + 100;\r\n };\r\n LightGallery.prototype.initModules = function () {\r\n this.plugins.forEach(function (module) {\r\n try {\r\n module.init();\r\n }\r\n catch (err) {\r\n console.warn(\"lightGallery:- make sure lightGallery module is properly initiated\");\r\n }\r\n });\r\n };\r\n LightGallery.prototype.destroyModules = function (destroy) {\r\n this.plugins.forEach(function (module) {\r\n try {\r\n if (destroy) {\r\n module.destroy();\r\n }\r\n else {\r\n module.closeGallery && module.closeGallery();\r\n }\r\n }\r\n catch (err) {\r\n console.warn(\"lightGallery:- make sure lightGallery module is properly destroyed\");\r\n }\r\n });\r\n };\r\n /**\r\n * Refresh lightGallery with new set of children.\r\n *\r\n * @description This is useful to update the gallery when the child elements are changed without calling destroy method.\r\n *\r\n * If you are using dynamic mode, you can pass the modified array of dynamicEl as the first parameter to refresh the dynamic gallery\r\n * @see Demo\r\n * @category lGPublicMethods\r\n * @example\r\n * const plugin = lightGallery();\r\n * // Delete or add children, then call\r\n * plugin.refresh();\r\n *\r\n */\r\n LightGallery.prototype.refresh = function (galleryItems) {\r\n if (!this.settings.dynamic) {\r\n this.invalidateItems();\r\n }\r\n if (galleryItems) {\r\n this.galleryItems = galleryItems;\r\n }\r\n else {\r\n this.galleryItems = this.getItems();\r\n }\r\n this.updateControls();\r\n this.openGalleryOnItemClick();\r\n this.LGel.trigger(lGEvents.updateSlides);\r\n };\r\n LightGallery.prototype.updateControls = function () {\r\n this.addSlideVideoInfo(this.galleryItems);\r\n this.updateCounterTotal();\r\n this.manageSingleSlideClassName();\r\n };\r\n LightGallery.prototype.destroyGallery = function () {\r\n this.destroyModules(true);\r\n if (!this.settings.dynamic) {\r\n this.invalidateItems();\r\n }\r\n $LG(window).off(\".lg.global\" + this.lgId);\r\n this.LGel.off('.lg');\r\n this.$container.remove();\r\n };\r\n /**\r\n * Destroy lightGallery.\r\n * Destroy lightGallery and its plugin instances completely\r\n *\r\n * @description This method also calls CloseGallery function internally. Returns the time takes to completely close and destroy the instance.\r\n * In case if you want to re-initialize lightGallery right after destroying it, initialize it only once the destroy process is completed.\r\n * You can use refresh method most of the times.\r\n * @category lGPublicMethods\r\n * @example\r\n * const plugin = lightGallery();\r\n * plugin.destroy();\r\n *\r\n */\r\n LightGallery.prototype.destroy = function () {\r\n var closeTimeout = this.closeGallery(true);\r\n if (closeTimeout) {\r\n setTimeout(this.destroyGallery.bind(this), closeTimeout);\r\n }\r\n else {\r\n this.destroyGallery();\r\n }\r\n return closeTimeout;\r\n };\r\n return LightGallery;\r\n}());\n\nfunction lightGallery(el, options) {\r\n return new LightGallery(el, options);\r\n}\n\nexport default lightGallery;\n//# sourceMappingURL=lightgallery.es5.js.map\n","/*!\n * lightgallery | 2.7.1 | January 11th 2023\n * http://www.lightgalleryjs.com/\n * Copyright (c) 2020 Sachin Neravath;\n * @license GPLv3\n */\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar thumbnailsSettings = {\r\n thumbnail: true,\r\n animateThumb: true,\r\n currentPagerPosition: 'middle',\r\n alignThumbnails: 'middle',\r\n thumbWidth: 100,\r\n thumbHeight: '80px',\r\n thumbMargin: 5,\r\n appendThumbnailsTo: '.lg-components',\r\n toggleThumb: false,\r\n enableThumbDrag: true,\r\n enableThumbSwipe: true,\r\n thumbnailSwipeThreshold: 10,\r\n loadYouTubeThumbnail: true,\r\n youTubeThumbSize: 1,\r\n thumbnailPluginStrings: {\r\n toggleThumbnails: 'Toggle thumbnails',\r\n },\r\n};\n\n/**\r\n * List of lightGallery events\r\n * All events should be documented here\r\n * Below interfaces are used to build the website documentations\r\n * */\r\nvar lGEvents = {\r\n afterAppendSlide: 'lgAfterAppendSlide',\r\n init: 'lgInit',\r\n hasVideo: 'lgHasVideo',\r\n containerResize: 'lgContainerResize',\r\n updateSlides: 'lgUpdateSlides',\r\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\r\n beforeOpen: 'lgBeforeOpen',\r\n afterOpen: 'lgAfterOpen',\r\n slideItemLoad: 'lgSlideItemLoad',\r\n beforeSlide: 'lgBeforeSlide',\r\n afterSlide: 'lgAfterSlide',\r\n posterClick: 'lgPosterClick',\r\n dragStart: 'lgDragStart',\r\n dragMove: 'lgDragMove',\r\n dragEnd: 'lgDragEnd',\r\n beforeNextSlide: 'lgBeforeNextSlide',\r\n beforePrevSlide: 'lgBeforePrevSlide',\r\n beforeClose: 'lgBeforeClose',\r\n afterClose: 'lgAfterClose',\r\n rotateLeft: 'lgRotateLeft',\r\n rotateRight: 'lgRotateRight',\r\n flipHorizontal: 'lgFlipHorizontal',\r\n flipVertical: 'lgFlipVertical',\r\n autoplay: 'lgAutoplay',\r\n autoplayStart: 'lgAutoplayStart',\r\n autoplayStop: 'lgAutoplayStop',\r\n};\n\nvar Thumbnail = /** @class */ (function () {\r\n function Thumbnail(instance, $LG) {\r\n this.thumbOuterWidth = 0;\r\n this.thumbTotalWidth = 0;\r\n this.translateX = 0;\r\n this.thumbClickable = false;\r\n // get lightGallery core plugin instance\r\n this.core = instance;\r\n this.$LG = $LG;\r\n return this;\r\n }\r\n Thumbnail.prototype.init = function () {\r\n // extend module default settings with lightGallery core settings\r\n this.settings = __assign(__assign({}, thumbnailsSettings), this.core.settings);\r\n this.thumbOuterWidth = 0;\r\n this.thumbTotalWidth =\r\n this.core.galleryItems.length *\r\n (this.settings.thumbWidth + this.settings.thumbMargin);\r\n // Thumbnail animation value\r\n this.translateX = 0;\r\n this.setAnimateThumbStyles();\r\n if (!this.core.settings.allowMediaOverlap) {\r\n this.settings.toggleThumb = false;\r\n }\r\n if (this.settings.thumbnail) {\r\n this.build();\r\n if (this.settings.animateThumb) {\r\n if (this.settings.enableThumbDrag) {\r\n this.enableThumbDrag();\r\n }\r\n if (this.settings.enableThumbSwipe) {\r\n this.enableThumbSwipe();\r\n }\r\n this.thumbClickable = false;\r\n }\r\n else {\r\n this.thumbClickable = true;\r\n }\r\n this.toggleThumbBar();\r\n this.thumbKeyPress();\r\n }\r\n };\r\n Thumbnail.prototype.build = function () {\r\n var _this = this;\r\n this.setThumbMarkup();\r\n this.manageActiveClassOnSlideChange();\r\n this.$lgThumb.first().on('click.lg touchend.lg', function (e) {\r\n var $target = _this.$LG(e.target);\r\n if (!$target.hasAttribute('data-lg-item-id')) {\r\n return;\r\n }\r\n setTimeout(function () {\r\n // In IE9 and bellow touch does not support\r\n // Go to slide if browser does not support css transitions\r\n if (_this.thumbClickable && !_this.core.lgBusy) {\r\n var index = parseInt($target.attr('data-lg-item-id'));\r\n _this.core.slide(index, false, true, false);\r\n }\r\n }, 50);\r\n });\r\n this.core.LGel.on(lGEvents.beforeSlide + \".thumb\", function (event) {\r\n var index = event.detail.index;\r\n _this.animateThumb(index);\r\n });\r\n this.core.LGel.on(lGEvents.beforeOpen + \".thumb\", function () {\r\n _this.thumbOuterWidth = _this.core.outer.get().offsetWidth;\r\n });\r\n this.core.LGel.on(lGEvents.updateSlides + \".thumb\", function () {\r\n _this.rebuildThumbnails();\r\n });\r\n this.core.LGel.on(lGEvents.containerResize + \".thumb\", function () {\r\n if (!_this.core.lgOpened)\r\n return;\r\n setTimeout(function () {\r\n _this.thumbOuterWidth = _this.core.outer.get().offsetWidth;\r\n _this.animateThumb(_this.core.index);\r\n _this.thumbOuterWidth = _this.core.outer.get().offsetWidth;\r\n }, 50);\r\n });\r\n };\r\n Thumbnail.prototype.setThumbMarkup = function () {\r\n var thumbOuterClassNames = 'lg-thumb-outer ';\r\n if (this.settings.alignThumbnails) {\r\n thumbOuterClassNames += \"lg-thumb-align-\" + this.settings.alignThumbnails;\r\n }\r\n var html = \"
\\n
\\n
\\n
\";\r\n this.core.outer.addClass('lg-has-thumb');\r\n if (this.settings.appendThumbnailsTo === '.lg-components') {\r\n this.core.$lgComponents.append(html);\r\n }\r\n else {\r\n this.core.outer.append(html);\r\n }\r\n this.$thumbOuter = this.core.outer.find('.lg-thumb-outer').first();\r\n this.$lgThumb = this.core.outer.find('.lg-thumb').first();\r\n if (this.settings.animateThumb) {\r\n this.core.outer\r\n .find('.lg-thumb')\r\n .css('transition-duration', this.core.settings.speed + 'ms')\r\n .css('width', this.thumbTotalWidth + 'px')\r\n .css('position', 'relative');\r\n }\r\n this.setThumbItemHtml(this.core.galleryItems);\r\n };\r\n Thumbnail.prototype.enableThumbDrag = function () {\r\n var _this = this;\r\n var thumbDragUtils = {\r\n cords: {\r\n startX: 0,\r\n endX: 0,\r\n },\r\n isMoved: false,\r\n newTranslateX: 0,\r\n startTime: new Date(),\r\n endTime: new Date(),\r\n touchMoveTime: 0,\r\n };\r\n var isDragging = false;\r\n this.$thumbOuter.addClass('lg-grab');\r\n this.core.outer\r\n .find('.lg-thumb')\r\n .first()\r\n .on('mousedown.lg.thumb', function (e) {\r\n if (_this.thumbTotalWidth > _this.thumbOuterWidth) {\r\n // execute only on .lg-object\r\n e.preventDefault();\r\n thumbDragUtils.cords.startX = e.pageX;\r\n thumbDragUtils.startTime = new Date();\r\n _this.thumbClickable = false;\r\n isDragging = true;\r\n // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723\r\n _this.core.outer.get().scrollLeft += 1;\r\n _this.core.outer.get().scrollLeft -= 1;\r\n // *\r\n _this.$thumbOuter\r\n .removeClass('lg-grab')\r\n .addClass('lg-grabbing');\r\n }\r\n });\r\n this.$LG(window).on(\"mousemove.lg.thumb.global\" + this.core.lgId, function (e) {\r\n if (!_this.core.lgOpened)\r\n return;\r\n if (isDragging) {\r\n thumbDragUtils.cords.endX = e.pageX;\r\n thumbDragUtils = _this.onThumbTouchMove(thumbDragUtils);\r\n }\r\n });\r\n this.$LG(window).on(\"mouseup.lg.thumb.global\" + this.core.lgId, function () {\r\n if (!_this.core.lgOpened)\r\n return;\r\n if (thumbDragUtils.isMoved) {\r\n thumbDragUtils = _this.onThumbTouchEnd(thumbDragUtils);\r\n }\r\n else {\r\n _this.thumbClickable = true;\r\n }\r\n if (isDragging) {\r\n isDragging = false;\r\n _this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');\r\n }\r\n });\r\n };\r\n Thumbnail.prototype.enableThumbSwipe = function () {\r\n var _this = this;\r\n var thumbDragUtils = {\r\n cords: {\r\n startX: 0,\r\n endX: 0,\r\n },\r\n isMoved: false,\r\n newTranslateX: 0,\r\n startTime: new Date(),\r\n endTime: new Date(),\r\n touchMoveTime: 0,\r\n };\r\n this.$lgThumb.on('touchstart.lg', function (e) {\r\n if (_this.thumbTotalWidth > _this.thumbOuterWidth) {\r\n e.preventDefault();\r\n thumbDragUtils.cords.startX = e.targetTouches[0].pageX;\r\n _this.thumbClickable = false;\r\n thumbDragUtils.startTime = new Date();\r\n }\r\n });\r\n this.$lgThumb.on('touchmove.lg', function (e) {\r\n if (_this.thumbTotalWidth > _this.thumbOuterWidth) {\r\n e.preventDefault();\r\n thumbDragUtils.cords.endX = e.targetTouches[0].pageX;\r\n thumbDragUtils = _this.onThumbTouchMove(thumbDragUtils);\r\n }\r\n });\r\n this.$lgThumb.on('touchend.lg', function () {\r\n if (thumbDragUtils.isMoved) {\r\n thumbDragUtils = _this.onThumbTouchEnd(thumbDragUtils);\r\n }\r\n else {\r\n _this.thumbClickable = true;\r\n }\r\n });\r\n };\r\n // Rebuild thumbnails\r\n Thumbnail.prototype.rebuildThumbnails = function () {\r\n var _this = this;\r\n // Remove transitions\r\n this.$thumbOuter.addClass('lg-rebuilding-thumbnails');\r\n setTimeout(function () {\r\n _this.thumbTotalWidth =\r\n _this.core.galleryItems.length *\r\n (_this.settings.thumbWidth + _this.settings.thumbMargin);\r\n _this.$lgThumb.css('width', _this.thumbTotalWidth + 'px');\r\n _this.$lgThumb.empty();\r\n _this.setThumbItemHtml(_this.core.galleryItems);\r\n _this.animateThumb(_this.core.index);\r\n }, 50);\r\n setTimeout(function () {\r\n _this.$thumbOuter.removeClass('lg-rebuilding-thumbnails');\r\n }, 200);\r\n };\r\n // @ts-check\r\n Thumbnail.prototype.setTranslate = function (value) {\r\n this.$lgThumb.css('transform', 'translate3d(-' + value + 'px, 0px, 0px)');\r\n };\r\n Thumbnail.prototype.getPossibleTransformX = function (left) {\r\n if (left > this.thumbTotalWidth - this.thumbOuterWidth) {\r\n left = this.thumbTotalWidth - this.thumbOuterWidth;\r\n }\r\n if (left < 0) {\r\n left = 0;\r\n }\r\n return left;\r\n };\r\n Thumbnail.prototype.animateThumb = function (index) {\r\n this.$lgThumb.css('transition-duration', this.core.settings.speed + 'ms');\r\n if (this.settings.animateThumb) {\r\n var position = 0;\r\n switch (this.settings.currentPagerPosition) {\r\n case 'left':\r\n position = 0;\r\n break;\r\n case 'middle':\r\n position =\r\n this.thumbOuterWidth / 2 - this.settings.thumbWidth / 2;\r\n break;\r\n case 'right':\r\n position = this.thumbOuterWidth - this.settings.thumbWidth;\r\n }\r\n this.translateX =\r\n (this.settings.thumbWidth + this.settings.thumbMargin) * index -\r\n 1 -\r\n position;\r\n if (this.translateX > this.thumbTotalWidth - this.thumbOuterWidth) {\r\n this.translateX = this.thumbTotalWidth - this.thumbOuterWidth;\r\n }\r\n if (this.translateX < 0) {\r\n this.translateX = 0;\r\n }\r\n this.setTranslate(this.translateX);\r\n }\r\n };\r\n Thumbnail.prototype.onThumbTouchMove = function (thumbDragUtils) {\r\n thumbDragUtils.newTranslateX = this.translateX;\r\n thumbDragUtils.isMoved = true;\r\n thumbDragUtils.touchMoveTime = new Date().valueOf();\r\n thumbDragUtils.newTranslateX -=\r\n thumbDragUtils.cords.endX - thumbDragUtils.cords.startX;\r\n thumbDragUtils.newTranslateX = this.getPossibleTransformX(thumbDragUtils.newTranslateX);\r\n // move current slide\r\n this.setTranslate(thumbDragUtils.newTranslateX);\r\n this.$thumbOuter.addClass('lg-dragging');\r\n return thumbDragUtils;\r\n };\r\n Thumbnail.prototype.onThumbTouchEnd = function (thumbDragUtils) {\r\n thumbDragUtils.isMoved = false;\r\n thumbDragUtils.endTime = new Date();\r\n this.$thumbOuter.removeClass('lg-dragging');\r\n var touchDuration = thumbDragUtils.endTime.valueOf() -\r\n thumbDragUtils.startTime.valueOf();\r\n var distanceXnew = thumbDragUtils.cords.endX - thumbDragUtils.cords.startX;\r\n var speedX = Math.abs(distanceXnew) / touchDuration;\r\n // Some magical numbers\r\n // Can be improved\r\n if (speedX > 0.15 &&\r\n thumbDragUtils.endTime.valueOf() - thumbDragUtils.touchMoveTime < 30) {\r\n speedX += 1;\r\n if (speedX > 2) {\r\n speedX += 1;\r\n }\r\n speedX =\r\n speedX +\r\n speedX * (Math.abs(distanceXnew) / this.thumbOuterWidth);\r\n this.$lgThumb.css('transition-duration', Math.min(speedX - 1, 2) + 'settings');\r\n distanceXnew = distanceXnew * speedX;\r\n this.translateX = this.getPossibleTransformX(this.translateX - distanceXnew);\r\n this.setTranslate(this.translateX);\r\n }\r\n else {\r\n this.translateX = thumbDragUtils.newTranslateX;\r\n }\r\n if (Math.abs(thumbDragUtils.cords.endX - thumbDragUtils.cords.startX) <\r\n this.settings.thumbnailSwipeThreshold) {\r\n this.thumbClickable = true;\r\n }\r\n return thumbDragUtils;\r\n };\r\n Thumbnail.prototype.getThumbHtml = function (thumb, index) {\r\n var slideVideoInfo = this.core.galleryItems[index].__slideVideoInfo || {};\r\n var thumbImg;\r\n if (slideVideoInfo.youtube) {\r\n if (this.settings.loadYouTubeThumbnail) {\r\n thumbImg =\r\n '//img.youtube.com/vi/' +\r\n slideVideoInfo.youtube[1] +\r\n '/' +\r\n this.settings.youTubeThumbSize +\r\n '.jpg';\r\n }\r\n else {\r\n thumbImg = thumb;\r\n }\r\n }\r\n else {\r\n thumbImg = thumb;\r\n }\r\n return \"
\\n \\n
\";\r\n };\r\n Thumbnail.prototype.getThumbItemHtml = function (items) {\r\n var thumbList = '';\r\n for (var i = 0; i < items.length; i++) {\r\n thumbList += this.getThumbHtml(items[i].thumb, i);\r\n }\r\n return thumbList;\r\n };\r\n Thumbnail.prototype.setThumbItemHtml = function (items) {\r\n var thumbList = this.getThumbItemHtml(items);\r\n this.$lgThumb.html(thumbList);\r\n };\r\n Thumbnail.prototype.setAnimateThumbStyles = function () {\r\n if (this.settings.animateThumb) {\r\n this.core.outer.addClass('lg-animate-thumb');\r\n }\r\n };\r\n // Manage thumbnail active calss\r\n Thumbnail.prototype.manageActiveClassOnSlideChange = function () {\r\n var _this = this;\r\n // manage active class for thumbnail\r\n this.core.LGel.on(lGEvents.beforeSlide + \".thumb\", function (event) {\r\n var $thumb = _this.core.outer.find('.lg-thumb-item');\r\n var index = event.detail.index;\r\n $thumb.removeClass('active');\r\n $thumb.eq(index).addClass('active');\r\n });\r\n };\r\n // Toggle thumbnail bar\r\n Thumbnail.prototype.toggleThumbBar = function () {\r\n var _this = this;\r\n if (this.settings.toggleThumb) {\r\n this.core.outer.addClass('lg-can-toggle');\r\n this.core.$toolbar.append('');\r\n this.core.outer\r\n .find('.lg-toggle-thumb')\r\n .first()\r\n .on('click.lg', function () {\r\n _this.core.outer.toggleClass('lg-components-open');\r\n });\r\n }\r\n };\r\n Thumbnail.prototype.thumbKeyPress = function () {\r\n var _this = this;\r\n this.$LG(window).on(\"keydown.lg.thumb.global\" + this.core.lgId, function (e) {\r\n if (!_this.core.lgOpened || !_this.settings.toggleThumb)\r\n return;\r\n if (e.keyCode === 38) {\r\n e.preventDefault();\r\n _this.core.outer.addClass('lg-components-open');\r\n }\r\n else if (e.keyCode === 40) {\r\n e.preventDefault();\r\n _this.core.outer.removeClass('lg-components-open');\r\n }\r\n });\r\n };\r\n Thumbnail.prototype.destroy = function () {\r\n if (this.settings.thumbnail) {\r\n this.$LG(window).off(\".lg.thumb.global\" + this.core.lgId);\r\n this.core.LGel.off('.lg.thumb');\r\n this.core.LGel.off('.thumb');\r\n this.$thumbOuter.remove();\r\n this.core.outer.removeClass('lg-has-thumb');\r\n }\r\n };\r\n return Thumbnail;\r\n}());\n\nexport default Thumbnail;\n//# sourceMappingURL=lg-thumbnail.es5.js.map\n","/*!\n * lightgallery | 2.7.1 | January 11th 2023\n * http://www.lightgalleryjs.com/\n * Copyright (c) 2020 Sachin Neravath;\n * @license GPLv3\n */\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar videoSettings = {\r\n autoplayFirstVideo: true,\r\n youTubePlayerParams: false,\r\n vimeoPlayerParams: false,\r\n wistiaPlayerParams: false,\r\n gotoNextSlideOnVideoEnd: true,\r\n autoplayVideoOnSlide: false,\r\n videojs: false,\r\n videojsTheme: '',\r\n videojsOptions: {},\r\n};\n\n/**\r\n * List of lightGallery events\r\n * All events should be documented here\r\n * Below interfaces are used to build the website documentations\r\n * */\r\nvar lGEvents = {\r\n afterAppendSlide: 'lgAfterAppendSlide',\r\n init: 'lgInit',\r\n hasVideo: 'lgHasVideo',\r\n containerResize: 'lgContainerResize',\r\n updateSlides: 'lgUpdateSlides',\r\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\r\n beforeOpen: 'lgBeforeOpen',\r\n afterOpen: 'lgAfterOpen',\r\n slideItemLoad: 'lgSlideItemLoad',\r\n beforeSlide: 'lgBeforeSlide',\r\n afterSlide: 'lgAfterSlide',\r\n posterClick: 'lgPosterClick',\r\n dragStart: 'lgDragStart',\r\n dragMove: 'lgDragMove',\r\n dragEnd: 'lgDragEnd',\r\n beforeNextSlide: 'lgBeforeNextSlide',\r\n beforePrevSlide: 'lgBeforePrevSlide',\r\n beforeClose: 'lgBeforeClose',\r\n afterClose: 'lgAfterClose',\r\n rotateLeft: 'lgRotateLeft',\r\n rotateRight: 'lgRotateRight',\r\n flipHorizontal: 'lgFlipHorizontal',\r\n flipVertical: 'lgFlipVertical',\r\n autoplay: 'lgAutoplay',\r\n autoplayStart: 'lgAutoplayStart',\r\n autoplayStop: 'lgAutoplayStop',\r\n};\n\nvar param = function (obj) {\r\n return Object.keys(obj)\r\n .map(function (k) {\r\n return encodeURIComponent(k) + '=' + encodeURIComponent(obj[k]);\r\n })\r\n .join('&');\r\n};\r\nvar paramsToObject = function (url) {\r\n var paramas = url\r\n .slice(1)\r\n .split('&')\r\n .map(function (p) { return p.split('='); })\r\n .reduce(function (obj, pair) {\r\n var _a = pair.map(decodeURIComponent), key = _a[0], value = _a[1];\r\n obj[key] = value;\r\n return obj;\r\n }, {});\r\n return paramas;\r\n};\r\nvar getYouTubeParams = function (videoInfo, youTubePlayerParamsSettings) {\r\n if (!videoInfo.youtube)\r\n return '';\r\n var slideUrlParams = videoInfo.youtube[2]\r\n ? paramsToObject(videoInfo.youtube[2])\r\n : '';\r\n // For youtube first params gets priority if duplicates found\r\n var defaultYouTubePlayerParams = {\r\n wmode: 'opaque',\r\n autoplay: 0,\r\n mute: 1,\r\n enablejsapi: 1,\r\n };\r\n var playerParamsSettings = youTubePlayerParamsSettings || {};\r\n var youTubePlayerParams = __assign(__assign(__assign({}, defaultYouTubePlayerParams), playerParamsSettings), slideUrlParams);\r\n var youTubeParams = \"?\" + param(youTubePlayerParams);\r\n return youTubeParams;\r\n};\r\nvar isYouTubeNoCookie = function (url) {\r\n return url.includes('youtube-nocookie.com');\r\n};\r\nvar getVimeoURLParams = function (defaultParams, videoInfo) {\r\n if (!videoInfo || !videoInfo.vimeo)\r\n return '';\r\n var urlParams = videoInfo.vimeo[2] || '';\r\n var defaultPlayerParams = defaultParams && Object.keys(defaultParams).length !== 0\r\n ? '&' + param(defaultParams)\r\n : '';\r\n // Support private video\r\n var urlWithHash = videoInfo.vimeo[0].split('/').pop() || '';\r\n var urlWithHashWithParams = urlWithHash.split('?')[0] || '';\r\n var hash = urlWithHashWithParams.split('#')[0];\r\n var isPrivate = videoInfo.vimeo[1] !== hash;\r\n if (isPrivate) {\r\n urlParams = urlParams.replace(\"/\" + hash, '');\r\n }\r\n urlParams =\r\n urlParams[0] == '?' ? '&' + urlParams.slice(1) : urlParams || '';\r\n // For vimeo last params gets priority if duplicates found\r\n var vimeoPlayerParams = \"?autoplay=0&muted=1\" + (isPrivate ? \"&h=\" + hash : '') + defaultPlayerParams + urlParams;\r\n return vimeoPlayerParams;\r\n};\n\n/**\r\n * Video module for lightGallery\r\n * Supports HTML5, YouTube, Vimeo, wistia videos\r\n *\r\n *\r\n * @ref Wistia\r\n * https://wistia.com/support/integrations/wordpress(How to get url)\r\n * https://wistia.com/support/developers/embed-options#using-embed-options\r\n * https://wistia.com/support/developers/player-api\r\n * https://wistia.com/support/developers/construct-an-embed-code\r\n * http://jsfiddle.net/xvnm7xLm/\r\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video\r\n * https://wistia.com/support/embed-and-share/sharing-videos\r\n * https://private-sharing.wistia.com/medias/mwhrulrucj\r\n *\r\n * @ref Youtube\r\n * https://developers.google.com/youtube/player_parameters#enablejsapi\r\n * https://developers.google.com/youtube/iframe_api_reference\r\n * https://developer.chrome.com/blog/autoplay/#iframe-delegation\r\n *\r\n * @ref Vimeo\r\n * https://stackoverflow.com/questions/10488943/easy-way-to-get-vimeo-id-from-a-vimeo-url\r\n * https://vimeo.zendesk.com/hc/en-us/articles/360000121668-Starting-playback-at-a-specific-timecode\r\n * https://vimeo.zendesk.com/hc/en-us/articles/360001494447-Using-Player-Parameters\r\n */\r\nvar Video = /** @class */ (function () {\r\n function Video(instance) {\r\n // get lightGallery core plugin instance\r\n this.core = instance;\r\n this.settings = __assign(__assign({}, videoSettings), this.core.settings);\r\n return this;\r\n }\r\n Video.prototype.init = function () {\r\n var _this = this;\r\n /**\r\n * Event triggered when video url found without poster\r\n * Append video HTML\r\n * Play if autoplayFirstVideo is true\r\n */\r\n this.core.LGel.on(lGEvents.hasVideo + \".video\", this.onHasVideo.bind(this));\r\n this.core.LGel.on(lGEvents.posterClick + \".video\", function () {\r\n var $el = _this.core.getSlideItem(_this.core.index);\r\n _this.loadVideoOnPosterClick($el);\r\n });\r\n this.core.LGel.on(lGEvents.slideItemLoad + \".video\", this.onSlideItemLoad.bind(this));\r\n // @desc fired immediately before each slide transition.\r\n this.core.LGel.on(lGEvents.beforeSlide + \".video\", this.onBeforeSlide.bind(this));\r\n // @desc fired immediately after each slide transition.\r\n this.core.LGel.on(lGEvents.afterSlide + \".video\", this.onAfterSlide.bind(this));\r\n };\r\n /**\r\n * @desc Event triggered when a slide is completely loaded\r\n *\r\n * @param {Event} event - lightGalley custom event\r\n */\r\n Video.prototype.onSlideItemLoad = function (event) {\r\n var _this = this;\r\n var _a = event.detail, isFirstSlide = _a.isFirstSlide, index = _a.index;\r\n // Should check the active slide as well as user may have moved to different slide before the first slide is loaded\r\n if (this.settings.autoplayFirstVideo &&\r\n isFirstSlide &&\r\n index === this.core.index) {\r\n // Delay is just for the transition effect on video load\r\n setTimeout(function () {\r\n _this.loadAndPlayVideo(index);\r\n }, 200);\r\n }\r\n // Should not call on first slide. should check only if the slide is active\r\n if (!isFirstSlide &&\r\n this.settings.autoplayVideoOnSlide &&\r\n index === this.core.index) {\r\n this.loadAndPlayVideo(index);\r\n }\r\n };\r\n /**\r\n * @desc Event triggered when video url or poster found\r\n * Append video HTML is poster is not given\r\n * Play if autoplayFirstVideo is true\r\n *\r\n * @param {Event} event - Javascript Event object.\r\n */\r\n Video.prototype.onHasVideo = function (event) {\r\n var _a = event.detail, index = _a.index, src = _a.src, html5Video = _a.html5Video, hasPoster = _a.hasPoster;\r\n if (!hasPoster) {\r\n // All functions are called separately if poster exist in loadVideoOnPosterClick function\r\n this.appendVideos(this.core.getSlideItem(index), {\r\n src: src,\r\n addClass: 'lg-object',\r\n index: index,\r\n html5Video: html5Video,\r\n });\r\n // Automatically navigate to next slide once video reaches the end.\r\n this.gotoNextSlideOnVideoEnd(src, index);\r\n }\r\n };\r\n /**\r\n * @desc fired immediately before each slide transition.\r\n * Pause the previous video\r\n * Hide the download button if the slide contains YouTube, Vimeo, or Wistia videos.\r\n *\r\n * @param {Event} event - Javascript Event object.\r\n * @param {number} prevIndex - Previous index of the slide.\r\n * @param {number} index - Current index of the slide\r\n */\r\n Video.prototype.onBeforeSlide = function (event) {\r\n if (this.core.lGalleryOn) {\r\n var prevIndex = event.detail.prevIndex;\r\n this.pauseVideo(prevIndex);\r\n }\r\n };\r\n /**\r\n * @desc fired immediately after each slide transition.\r\n * Play video if autoplayVideoOnSlide option is enabled.\r\n *\r\n * @param {Event} event - Javascript Event object.\r\n * @param {number} prevIndex - Previous index of the slide.\r\n * @param {number} index - Current index of the slide\r\n * @todo should check on onSlideLoad as well if video is not loaded on after slide\r\n */\r\n Video.prototype.onAfterSlide = function (event) {\r\n var _this = this;\r\n var _a = event.detail, index = _a.index, prevIndex = _a.prevIndex;\r\n // Do not call on first slide\r\n var $slide = this.core.getSlideItem(index);\r\n if (this.settings.autoplayVideoOnSlide && index !== prevIndex) {\r\n if ($slide.hasClass('lg-complete')) {\r\n setTimeout(function () {\r\n _this.loadAndPlayVideo(index);\r\n }, 100);\r\n }\r\n }\r\n };\r\n Video.prototype.loadAndPlayVideo = function (index) {\r\n var $slide = this.core.getSlideItem(index);\r\n var currentGalleryItem = this.core.galleryItems[index];\r\n if (currentGalleryItem.poster) {\r\n this.loadVideoOnPosterClick($slide, true);\r\n }\r\n else {\r\n this.playVideo(index);\r\n }\r\n };\r\n /**\r\n * Play HTML5, Youtube, Vimeo or Wistia videos in a particular slide.\r\n * @param {number} index - Index of the slide\r\n */\r\n Video.prototype.playVideo = function (index) {\r\n this.controlVideo(index, 'play');\r\n };\r\n /**\r\n * Pause HTML5, Youtube, Vimeo or Wistia videos in a particular slide.\r\n * @param {number} index - Index of the slide\r\n */\r\n Video.prototype.pauseVideo = function (index) {\r\n this.controlVideo(index, 'pause');\r\n };\r\n Video.prototype.getVideoHtml = function (src, addClass, index, html5Video) {\r\n var video = '';\r\n var videoInfo = this.core.galleryItems[index]\r\n .__slideVideoInfo || {};\r\n var currentGalleryItem = this.core.galleryItems[index];\r\n var videoTitle = currentGalleryItem.title || currentGalleryItem.alt;\r\n videoTitle = videoTitle ? 'title=\"' + videoTitle + '\"' : '';\r\n var commonIframeProps = \"allowtransparency=\\\"true\\\"\\n frameborder=\\\"0\\\"\\n scrolling=\\\"no\\\"\\n allowfullscreen\\n mozallowfullscreen\\n webkitallowfullscreen\\n oallowfullscreen\\n msallowfullscreen\";\r\n if (videoInfo.youtube) {\r\n var videoId = 'lg-youtube' + index;\r\n var youTubeParams = getYouTubeParams(videoInfo, this.settings.youTubePlayerParams);\r\n var isYouTubeNoCookieURL = isYouTubeNoCookie(src);\r\n var youtubeURL = isYouTubeNoCookieURL\r\n ? '//www.youtube-nocookie.com/'\r\n : '//www.youtube.com/';\r\n video = \"\";\r\n }\r\n else if (videoInfo.vimeo) {\r\n var videoId = 'lg-vimeo' + index;\r\n var playerParams = getVimeoURLParams(this.settings.vimeoPlayerParams, videoInfo);\r\n video = \"\";\r\n }\r\n else if (videoInfo.wistia) {\r\n var wistiaId = 'lg-wistia' + index;\r\n var playerParams = param(this.settings.wistiaPlayerParams);\r\n playerParams = playerParams ? '?' + playerParams : '';\r\n video = \"\";\r\n }\r\n else if (videoInfo.html5) {\r\n var html5VideoMarkup = '';\r\n for (var i = 0; i < html5Video.source.length; i++) {\r\n html5VideoMarkup += \"\";\r\n }\r\n if (html5Video.tracks) {\r\n var _loop_1 = function (i) {\r\n var trackAttributes = '';\r\n var track = html5Video.tracks[i];\r\n Object.keys(track || {}).forEach(function (key) {\r\n trackAttributes += key + \"=\\\"\" + track[key] + \"\\\" \";\r\n });\r\n html5VideoMarkup += \"\";\r\n };\r\n for (var i = 0; i < html5Video.tracks.length; i++) {\r\n _loop_1(i);\r\n }\r\n }\r\n var html5VideoAttrs_1 = '';\r\n var videoAttributes_1 = html5Video.attributes || {};\r\n Object.keys(videoAttributes_1 || {}).forEach(function (key) {\r\n html5VideoAttrs_1 += key + \"=\\\"\" + videoAttributes_1[key] + \"\\\" \";\r\n });\r\n video = \"\";\r\n }\r\n return video;\r\n };\r\n /**\r\n * @desc - Append videos to the slide\r\n *\r\n * @param {HTMLElement} el - slide element\r\n * @param {Object} videoParams - Video parameters, Contains src, class, index, htmlVideo\r\n */\r\n Video.prototype.appendVideos = function (el, videoParams) {\r\n var _a;\r\n var videoHtml = this.getVideoHtml(videoParams.src, videoParams.addClass, videoParams.index, videoParams.html5Video);\r\n el.find('.lg-video-cont').append(videoHtml);\r\n var $videoElement = el.find('.lg-video-object').first();\r\n if (videoParams.html5Video) {\r\n $videoElement.on('mousedown.lg.video', function (e) {\r\n e.stopPropagation();\r\n });\r\n }\r\n if (this.settings.videojs && ((_a = this.core.galleryItems[videoParams.index].__slideVideoInfo) === null || _a === void 0 ? void 0 : _a.html5)) {\r\n try {\r\n return videojs($videoElement.get(), this.settings.videojsOptions);\r\n }\r\n catch (e) {\r\n console.error('lightGallery:- Make sure you have included videojs');\r\n }\r\n }\r\n };\r\n Video.prototype.gotoNextSlideOnVideoEnd = function (src, index) {\r\n var _this = this;\r\n var $videoElement = this.core\r\n .getSlideItem(index)\r\n .find('.lg-video-object')\r\n .first();\r\n var videoInfo = this.core.galleryItems[index].__slideVideoInfo || {};\r\n if (this.settings.gotoNextSlideOnVideoEnd) {\r\n if (videoInfo.html5) {\r\n $videoElement.on('ended', function () {\r\n _this.core.goToNextSlide();\r\n });\r\n }\r\n else if (videoInfo.vimeo) {\r\n try {\r\n // https://github.com/vimeo/player.js/#ended\r\n new Vimeo.Player($videoElement.get()).on('ended', function () {\r\n _this.core.goToNextSlide();\r\n });\r\n }\r\n catch (e) {\r\n console.error('lightGallery:- Make sure you have included //github.com/vimeo/player.js');\r\n }\r\n }\r\n else if (videoInfo.wistia) {\r\n try {\r\n window._wq = window._wq || [];\r\n // @todo Event is gettign triggered multiple times\r\n window._wq.push({\r\n id: $videoElement.attr('id'),\r\n onReady: function (video) {\r\n video.bind('end', function () {\r\n _this.core.goToNextSlide();\r\n });\r\n },\r\n });\r\n }\r\n catch (e) {\r\n console.error('lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js');\r\n }\r\n }\r\n }\r\n };\r\n Video.prototype.controlVideo = function (index, action) {\r\n var $videoElement = this.core\r\n .getSlideItem(index)\r\n .find('.lg-video-object')\r\n .first();\r\n var videoInfo = this.core.galleryItems[index].__slideVideoInfo || {};\r\n if (!$videoElement.get())\r\n return;\r\n if (videoInfo.youtube) {\r\n try {\r\n $videoElement.get().contentWindow.postMessage(\"{\\\"event\\\":\\\"command\\\",\\\"func\\\":\\\"\" + action + \"Video\\\",\\\"args\\\":\\\"\\\"}\", '*');\r\n }\r\n catch (e) {\r\n console.error(\"lightGallery:- \" + e);\r\n }\r\n }\r\n else if (videoInfo.vimeo) {\r\n try {\r\n new Vimeo.Player($videoElement.get())[action]();\r\n }\r\n catch (e) {\r\n console.error('lightGallery:- Make sure you have included //github.com/vimeo/player.js');\r\n }\r\n }\r\n else if (videoInfo.html5) {\r\n if (this.settings.videojs) {\r\n try {\r\n videojs($videoElement.get())[action]();\r\n }\r\n catch (e) {\r\n console.error('lightGallery:- Make sure you have included videojs');\r\n }\r\n }\r\n else {\r\n $videoElement.get()[action]();\r\n }\r\n }\r\n else if (videoInfo.wistia) {\r\n try {\r\n window._wq = window._wq || [];\r\n // @todo Find a way to destroy wistia player instance\r\n window._wq.push({\r\n id: $videoElement.attr('id'),\r\n onReady: function (video) {\r\n video[action]();\r\n },\r\n });\r\n }\r\n catch (e) {\r\n console.error('lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js');\r\n }\r\n }\r\n };\r\n Video.prototype.loadVideoOnPosterClick = function ($el, forcePlay) {\r\n var _this = this;\r\n // check slide has poster\r\n if (!$el.hasClass('lg-video-loaded')) {\r\n // check already video element present\r\n if (!$el.hasClass('lg-has-video')) {\r\n $el.addClass('lg-has-video');\r\n var _html = void 0;\r\n var _src = this.core.galleryItems[this.core.index].src;\r\n var video = this.core.galleryItems[this.core.index].video;\r\n if (video) {\r\n _html =\r\n typeof video === 'string' ? JSON.parse(video) : video;\r\n }\r\n var videoJsPlayer_1 = this.appendVideos($el, {\r\n src: _src,\r\n addClass: '',\r\n index: this.core.index,\r\n html5Video: _html,\r\n });\r\n this.gotoNextSlideOnVideoEnd(_src, this.core.index);\r\n var $tempImg = $el.find('.lg-object').first().get();\r\n // @todo make sure it is working\r\n $el.find('.lg-video-cont').first().append($tempImg);\r\n $el.addClass('lg-video-loading');\r\n videoJsPlayer_1 &&\r\n videoJsPlayer_1.ready(function () {\r\n videoJsPlayer_1.on('loadedmetadata', function () {\r\n _this.onVideoLoadAfterPosterClick($el, _this.core.index);\r\n });\r\n });\r\n $el.find('.lg-video-object')\r\n .first()\r\n .on('load.lg error.lg loadedmetadata.lg', function () {\r\n setTimeout(function () {\r\n _this.onVideoLoadAfterPosterClick($el, _this.core.index);\r\n }, 50);\r\n });\r\n }\r\n else {\r\n this.playVideo(this.core.index);\r\n }\r\n }\r\n else if (forcePlay) {\r\n this.playVideo(this.core.index);\r\n }\r\n };\r\n Video.prototype.onVideoLoadAfterPosterClick = function ($el, index) {\r\n $el.addClass('lg-video-loaded');\r\n this.playVideo(index);\r\n };\r\n Video.prototype.destroy = function () {\r\n this.core.LGel.off('.lg.video');\r\n this.core.LGel.off('.video');\r\n };\r\n return Video;\r\n}());\n\nexport default Video;\n//# sourceMappingURL=lg-video.es5.js.map\n","/*!\n * lightgallery | 2.7.1 | January 11th 2023\n * http://www.lightgalleryjs.com/\n * Copyright (c) 2020 Sachin Neravath;\n * @license GPLv3\n */\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar zoomSettings = {\r\n scale: 1,\r\n zoom: true,\r\n actualSize: true,\r\n showZoomInOutIcons: false,\r\n actualSizeIcons: {\r\n zoomIn: 'lg-zoom-in',\r\n zoomOut: 'lg-zoom-out',\r\n },\r\n enableZoomAfter: 300,\r\n zoomPluginStrings: {\r\n zoomIn: 'Zoom in',\r\n zoomOut: 'Zoom out',\r\n viewActualSize: 'View actual size',\r\n },\r\n};\n\n/**\r\n * List of lightGallery events\r\n * All events should be documented here\r\n * Below interfaces are used to build the website documentations\r\n * */\r\nvar lGEvents = {\r\n afterAppendSlide: 'lgAfterAppendSlide',\r\n init: 'lgInit',\r\n hasVideo: 'lgHasVideo',\r\n containerResize: 'lgContainerResize',\r\n updateSlides: 'lgUpdateSlides',\r\n afterAppendSubHtml: 'lgAfterAppendSubHtml',\r\n beforeOpen: 'lgBeforeOpen',\r\n afterOpen: 'lgAfterOpen',\r\n slideItemLoad: 'lgSlideItemLoad',\r\n beforeSlide: 'lgBeforeSlide',\r\n afterSlide: 'lgAfterSlide',\r\n posterClick: 'lgPosterClick',\r\n dragStart: 'lgDragStart',\r\n dragMove: 'lgDragMove',\r\n dragEnd: 'lgDragEnd',\r\n beforeNextSlide: 'lgBeforeNextSlide',\r\n beforePrevSlide: 'lgBeforePrevSlide',\r\n beforeClose: 'lgBeforeClose',\r\n afterClose: 'lgAfterClose',\r\n rotateLeft: 'lgRotateLeft',\r\n rotateRight: 'lgRotateRight',\r\n flipHorizontal: 'lgFlipHorizontal',\r\n flipVertical: 'lgFlipVertical',\r\n autoplay: 'lgAutoplay',\r\n autoplayStart: 'lgAutoplayStart',\r\n autoplayStop: 'lgAutoplayStop',\r\n};\n\nvar ZOOM_TRANSITION_DURATION = 500;\r\nvar Zoom = /** @class */ (function () {\r\n function Zoom(instance, $LG) {\r\n // get lightGallery core plugin instance\r\n this.core = instance;\r\n this.$LG = $LG;\r\n this.settings = __assign(__assign({}, zoomSettings), this.core.settings);\r\n return this;\r\n }\r\n // Append Zoom controls. Actual size, Zoom-in, Zoom-out\r\n Zoom.prototype.buildTemplates = function () {\r\n var zoomIcons = this.settings.showZoomInOutIcons\r\n ? \"\"\r\n : '';\r\n if (this.settings.actualSize) {\r\n zoomIcons += \"\";\r\n }\r\n this.core.outer.addClass('lg-use-transition-for-zoom');\r\n this.core.$toolbar.first().append(zoomIcons);\r\n };\r\n /**\r\n * @desc Enable zoom option only once the image is completely loaded\r\n * If zoomFromOrigin is true, Zoom is enabled once the dummy image has been inserted\r\n *\r\n * Zoom styles are defined under lg-zoomable CSS class.\r\n */\r\n Zoom.prototype.enableZoom = function (event) {\r\n var _this = this;\r\n // delay will be 0 except first time\r\n var _speed = this.settings.enableZoomAfter + event.detail.delay;\r\n // set _speed value 0 if gallery opened from direct url and if it is first slide\r\n if (this.$LG('body').first().hasClass('lg-from-hash') &&\r\n event.detail.delay) {\r\n // will execute only once\r\n _speed = 0;\r\n }\r\n else {\r\n // Remove lg-from-hash to enable starting animation.\r\n this.$LG('body').first().removeClass('lg-from-hash');\r\n }\r\n this.zoomableTimeout = setTimeout(function () {\r\n if (!_this.isImageSlide(_this.core.index)) {\r\n return;\r\n }\r\n _this.core.getSlideItem(event.detail.index).addClass('lg-zoomable');\r\n if (event.detail.index === _this.core.index) {\r\n _this.setZoomEssentials();\r\n }\r\n }, _speed + 30);\r\n };\r\n Zoom.prototype.enableZoomOnSlideItemLoad = function () {\r\n // Add zoomable class\r\n this.core.LGel.on(lGEvents.slideItemLoad + \".zoom\", this.enableZoom.bind(this));\r\n };\r\n Zoom.prototype.getDragCords = function (e) {\r\n return {\r\n x: e.pageX,\r\n y: e.pageY,\r\n };\r\n };\r\n Zoom.prototype.getSwipeCords = function (e) {\r\n var x = e.touches[0].pageX;\r\n var y = e.touches[0].pageY;\r\n return {\r\n x: x,\r\n y: y,\r\n };\r\n };\r\n Zoom.prototype.getDragAllowedAxises = function (scale, scaleDiff) {\r\n var $image = this.core\r\n .getSlideItem(this.core.index)\r\n .find('.lg-image')\r\n .first()\r\n .get();\r\n var height = 0;\r\n var width = 0;\r\n var rect = $image.getBoundingClientRect();\r\n if (scale) {\r\n height = $image.offsetHeight * scale;\r\n width = $image.offsetWidth * scale;\r\n }\r\n else if (scaleDiff) {\r\n height = rect.height + scaleDiff * rect.height;\r\n width = rect.width + scaleDiff * rect.width;\r\n }\r\n else {\r\n height = rect.height;\r\n width = rect.width;\r\n }\r\n var allowY = height > this.containerRect.height;\r\n var allowX = width > this.containerRect.width;\r\n return {\r\n allowX: allowX,\r\n allowY: allowY,\r\n };\r\n };\r\n Zoom.prototype.setZoomEssentials = function () {\r\n this.containerRect = this.core.$content.get().getBoundingClientRect();\r\n };\r\n /**\r\n * @desc Image zoom\r\n * Translate the wrap and scale the image to get better user experience\r\n *\r\n * @param {String} scale - Zoom decrement/increment value\r\n */\r\n Zoom.prototype.zoomImage = function (scale, scaleDiff, reposition, resetToMax) {\r\n if (Math.abs(scaleDiff) <= 0)\r\n return;\r\n var offsetX = this.containerRect.width / 2 + this.containerRect.left;\r\n var offsetY = this.containerRect.height / 2 +\r\n this.containerRect.top +\r\n this.scrollTop;\r\n var originalX;\r\n var originalY;\r\n if (scale === 1) {\r\n this.positionChanged = false;\r\n }\r\n var dragAllowedAxises = this.getDragAllowedAxises(0, scaleDiff);\r\n var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX;\r\n if (this.positionChanged) {\r\n originalX = this.left / (this.scale - scaleDiff);\r\n originalY = this.top / (this.scale - scaleDiff);\r\n this.pageX = offsetX - originalX;\r\n this.pageY = offsetY - originalY;\r\n this.positionChanged = false;\r\n }\r\n var possibleSwipeCords = this.getPossibleSwipeDragCords(scaleDiff);\r\n var x;\r\n var y;\r\n var _x = offsetX - this.pageX;\r\n var _y = offsetY - this.pageY;\r\n if (scale - scaleDiff > 1) {\r\n var scaleVal = (scale - scaleDiff) / Math.abs(scaleDiff);\r\n _x =\r\n (scaleDiff < 0 ? -_x : _x) +\r\n this.left * (scaleVal + (scaleDiff < 0 ? -1 : 1));\r\n _y =\r\n (scaleDiff < 0 ? -_y : _y) +\r\n this.top * (scaleVal + (scaleDiff < 0 ? -1 : 1));\r\n x = _x / scaleVal;\r\n y = _y / scaleVal;\r\n }\r\n else {\r\n var scaleVal = (scale - scaleDiff) * scaleDiff;\r\n x = _x * scaleVal;\r\n y = _y * scaleVal;\r\n }\r\n if (reposition) {\r\n if (allowX) {\r\n if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) {\r\n x = possibleSwipeCords.minX;\r\n }\r\n else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) {\r\n x = possibleSwipeCords.maxX;\r\n }\r\n }\r\n else {\r\n if (scale > 1) {\r\n if (x < possibleSwipeCords.minX) {\r\n x = possibleSwipeCords.minX;\r\n }\r\n else if (x > possibleSwipeCords.maxX) {\r\n x = possibleSwipeCords.maxX;\r\n }\r\n }\r\n }\r\n // @todo fix this\r\n if (allowY) {\r\n if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) {\r\n y = possibleSwipeCords.minY;\r\n }\r\n else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) {\r\n y = possibleSwipeCords.maxY;\r\n }\r\n }\r\n else {\r\n // If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out\r\n if (scale > 1) {\r\n //If image goes beyond viewport top, use the minim possible translate value\r\n if (y < possibleSwipeCords.minY) {\r\n y = possibleSwipeCords.minY;\r\n }\r\n else if (y > possibleSwipeCords.maxY) {\r\n y = possibleSwipeCords.maxY;\r\n }\r\n }\r\n }\r\n }\r\n this.setZoomStyles({\r\n x: x,\r\n y: y,\r\n scale: scale,\r\n });\r\n this.left = x;\r\n this.top = y;\r\n if (resetToMax) {\r\n this.setZoomImageSize();\r\n }\r\n };\r\n Zoom.prototype.resetImageTranslate = function (index) {\r\n if (!this.isImageSlide(index)) {\r\n return;\r\n }\r\n var $image = this.core.getSlideItem(index).find('.lg-image').first();\r\n this.imageReset = false;\r\n $image.removeClass('reset-transition reset-transition-y reset-transition-x');\r\n this.core.outer.removeClass('lg-actual-size');\r\n $image.css('width', 'auto').css('height', 'auto');\r\n setTimeout(function () {\r\n $image.removeClass('no-transition');\r\n }, 10);\r\n };\r\n Zoom.prototype.setZoomImageSize = function () {\r\n var _this = this;\r\n var $image = this.core\r\n .getSlideItem(this.core.index)\r\n .find('.lg-image')\r\n .first();\r\n setTimeout(function () {\r\n var actualSizeScale = _this.getCurrentImageActualSizeScale();\r\n if (_this.scale >= actualSizeScale) {\r\n $image.addClass('no-transition');\r\n _this.imageReset = true;\r\n }\r\n }, ZOOM_TRANSITION_DURATION);\r\n setTimeout(function () {\r\n var actualSizeScale = _this.getCurrentImageActualSizeScale();\r\n if (_this.scale >= actualSizeScale) {\r\n var dragAllowedAxises = _this.getDragAllowedAxises(_this.scale);\r\n $image\r\n .css('width', $image.get().naturalWidth + 'px')\r\n .css('height', $image.get().naturalHeight + 'px');\r\n _this.core.outer.addClass('lg-actual-size');\r\n if (dragAllowedAxises.allowX && dragAllowedAxises.allowY) {\r\n $image.addClass('reset-transition');\r\n }\r\n else if (dragAllowedAxises.allowX &&\r\n !dragAllowedAxises.allowY) {\r\n $image.addClass('reset-transition-x');\r\n }\r\n else if (!dragAllowedAxises.allowX &&\r\n dragAllowedAxises.allowY) {\r\n $image.addClass('reset-transition-y');\r\n }\r\n }\r\n }, ZOOM_TRANSITION_DURATION + 50);\r\n };\r\n /**\r\n * @desc apply scale3d to image and translate to image wrap\r\n * @param {style} X,Y and scale\r\n */\r\n Zoom.prototype.setZoomStyles = function (style) {\r\n var $imageWrap = this.core\r\n .getSlideItem(this.core.index)\r\n .find('.lg-img-wrap')\r\n .first();\r\n var $image = this.core\r\n .getSlideItem(this.core.index)\r\n .find('.lg-image')\r\n .first();\r\n var $dummyImage = this.core.outer\r\n .find('.lg-current .lg-dummy-img')\r\n .first();\r\n this.scale = style.scale;\r\n $image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');\r\n $dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');\r\n var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)';\r\n $imageWrap.css('transform', transform);\r\n };\r\n /**\r\n * @param index - Index of the current slide\r\n * @param event - event will be available only if the function is called on clicking/taping the imags\r\n */\r\n Zoom.prototype.setActualSize = function (index, event) {\r\n var _this = this;\r\n var currentItem = this.core.galleryItems[this.core.index];\r\n this.resetImageTranslate(index);\r\n setTimeout(function () {\r\n // Allow zoom only on image\r\n if (!currentItem.src ||\r\n _this.core.outer.hasClass('lg-first-slide-loading')) {\r\n return;\r\n }\r\n var scale = _this.getCurrentImageActualSizeScale();\r\n var prevScale = _this.scale;\r\n if (_this.core.outer.hasClass('lg-zoomed')) {\r\n _this.scale = 1;\r\n }\r\n else {\r\n _this.scale = _this.getScale(scale);\r\n }\r\n _this.setPageCords(event);\r\n _this.beginZoom(_this.scale);\r\n _this.zoomImage(_this.scale, _this.scale - prevScale, true, true);\r\n setTimeout(function () {\r\n _this.core.outer.removeClass('lg-grabbing').addClass('lg-grab');\r\n }, 10);\r\n }, 50);\r\n };\r\n Zoom.prototype.getNaturalWidth = function (index) {\r\n var $image = this.core.getSlideItem(index).find('.lg-image').first();\r\n var naturalWidth = this.core.galleryItems[index].width;\r\n return naturalWidth\r\n ? parseFloat(naturalWidth)\r\n : $image.get().naturalWidth;\r\n };\r\n Zoom.prototype.getActualSizeScale = function (naturalWidth, width) {\r\n var _scale;\r\n var scale;\r\n if (naturalWidth >= width) {\r\n _scale = naturalWidth / width;\r\n scale = _scale || 2;\r\n }\r\n else {\r\n scale = 1;\r\n }\r\n return scale;\r\n };\r\n Zoom.prototype.getCurrentImageActualSizeScale = function () {\r\n var $image = this.core\r\n .getSlideItem(this.core.index)\r\n .find('.lg-image')\r\n .first();\r\n var width = $image.get().offsetWidth;\r\n var naturalWidth = this.getNaturalWidth(this.core.index) || width;\r\n return this.getActualSizeScale(naturalWidth, width);\r\n };\r\n Zoom.prototype.getPageCords = function (event) {\r\n var cords = {};\r\n if (event) {\r\n cords.x = event.pageX || event.touches[0].pageX;\r\n cords.y = event.pageY || event.touches[0].pageY;\r\n }\r\n else {\r\n var containerRect = this.core.$content\r\n .get()\r\n .getBoundingClientRect();\r\n cords.x = containerRect.width / 2 + containerRect.left;\r\n cords.y =\r\n containerRect.height / 2 + this.scrollTop + containerRect.top;\r\n }\r\n return cords;\r\n };\r\n Zoom.prototype.setPageCords = function (event) {\r\n var pageCords = this.getPageCords(event);\r\n this.pageX = pageCords.x;\r\n this.pageY = pageCords.y;\r\n };\r\n Zoom.prototype.manageActualPixelClassNames = function () {\r\n var $actualSize = this.core.getElementById('lg-actual-size');\r\n $actualSize\r\n .removeClass(this.settings.actualSizeIcons.zoomIn)\r\n .addClass(this.settings.actualSizeIcons.zoomOut);\r\n };\r\n // If true, zoomed - in else zoomed out\r\n Zoom.prototype.beginZoom = function (scale) {\r\n this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging');\r\n if (scale > 1) {\r\n this.core.outer.addClass('lg-zoomed');\r\n this.manageActualPixelClassNames();\r\n }\r\n else {\r\n this.resetZoom();\r\n }\r\n return scale > 1;\r\n };\r\n Zoom.prototype.getScale = function (scale) {\r\n var actualSizeScale = this.getCurrentImageActualSizeScale();\r\n if (scale < 1) {\r\n scale = 1;\r\n }\r\n else if (scale > actualSizeScale) {\r\n scale = actualSizeScale;\r\n }\r\n return scale;\r\n };\r\n Zoom.prototype.init = function () {\r\n var _this = this;\r\n if (!this.settings.zoom) {\r\n return;\r\n }\r\n this.buildTemplates();\r\n this.enableZoomOnSlideItemLoad();\r\n var tapped = null;\r\n this.core.outer.on('dblclick.lg', function (event) {\r\n if (!_this.$LG(event.target).hasClass('lg-image')) {\r\n return;\r\n }\r\n _this.setActualSize(_this.core.index, event);\r\n });\r\n this.core.outer.on('touchstart.lg', function (event) {\r\n var $target = _this.$LG(event.target);\r\n if (event.touches.length === 1 && $target.hasClass('lg-image')) {\r\n if (!tapped) {\r\n tapped = setTimeout(function () {\r\n tapped = null;\r\n }, 300);\r\n }\r\n else {\r\n clearTimeout(tapped);\r\n tapped = null;\r\n event.preventDefault();\r\n _this.setActualSize(_this.core.index, event);\r\n }\r\n }\r\n });\r\n this.core.LGel.on(lGEvents.containerResize + \".zoom \" + lGEvents.rotateRight + \".zoom \" + lGEvents.rotateLeft + \".zoom \" + lGEvents.flipHorizontal + \".zoom \" + lGEvents.flipVertical + \".zoom\", function () {\r\n if (!_this.core.lgOpened ||\r\n !_this.isImageSlide(_this.core.index) ||\r\n _this.core.touchAction) {\r\n return;\r\n }\r\n var _LGel = _this.core\r\n .getSlideItem(_this.core.index)\r\n .find('.lg-img-wrap')\r\n .first();\r\n _this.top = 0;\r\n _this.left = 0;\r\n _this.setZoomEssentials();\r\n _this.setZoomSwipeStyles(_LGel, { x: 0, y: 0 });\r\n _this.positionChanged = true;\r\n });\r\n // Update zoom on resize and orientationchange\r\n this.$LG(window).on(\"scroll.lg.zoom.global\" + this.core.lgId, function () {\r\n if (!_this.core.lgOpened)\r\n return;\r\n _this.scrollTop = _this.$LG(window).scrollTop();\r\n });\r\n this.core.getElementById('lg-zoom-out').on('click.lg', function () {\r\n // Allow zoom only on image\r\n if (!_this.isImageSlide(_this.core.index)) {\r\n return;\r\n }\r\n var timeout = 0;\r\n if (_this.imageReset) {\r\n _this.resetImageTranslate(_this.core.index);\r\n timeout = 50;\r\n }\r\n setTimeout(function () {\r\n var scale = _this.scale - _this.settings.scale;\r\n if (scale < 1) {\r\n scale = 1;\r\n }\r\n _this.beginZoom(scale);\r\n _this.zoomImage(scale, -_this.settings.scale, true, true);\r\n }, timeout);\r\n });\r\n this.core.getElementById('lg-zoom-in').on('click.lg', function () {\r\n _this.zoomIn();\r\n });\r\n this.core.getElementById('lg-actual-size').on('click.lg', function () {\r\n _this.setActualSize(_this.core.index);\r\n });\r\n this.core.LGel.on(lGEvents.beforeOpen + \".zoom\", function () {\r\n _this.core.outer.find('.lg-item').removeClass('lg-zoomable');\r\n });\r\n this.core.LGel.on(lGEvents.afterOpen + \".zoom\", function () {\r\n _this.scrollTop = _this.$LG(window).scrollTop();\r\n // Set the initial value center\r\n _this.pageX = _this.core.outer.width() / 2;\r\n _this.pageY = _this.core.outer.height() / 2 + _this.scrollTop;\r\n _this.scale = 1;\r\n });\r\n // Reset zoom on slide change\r\n this.core.LGel.on(lGEvents.afterSlide + \".zoom\", function (event) {\r\n var prevIndex = event.detail.prevIndex;\r\n _this.scale = 1;\r\n _this.positionChanged = false;\r\n _this.resetZoom(prevIndex);\r\n _this.resetImageTranslate(prevIndex);\r\n if (_this.isImageSlide(_this.core.index)) {\r\n _this.setZoomEssentials();\r\n }\r\n });\r\n // Drag option after zoom\r\n this.zoomDrag();\r\n this.pinchZoom();\r\n this.zoomSwipe();\r\n // Store the zoomable timeout value just to clear it while closing\r\n this.zoomableTimeout = false;\r\n this.positionChanged = false;\r\n };\r\n Zoom.prototype.zoomIn = function () {\r\n // Allow zoom only on image\r\n if (!this.isImageSlide(this.core.index)) {\r\n return;\r\n }\r\n var scale = this.scale + this.settings.scale;\r\n scale = this.getScale(scale);\r\n this.beginZoom(scale);\r\n this.zoomImage(scale, Math.min(this.settings.scale, scale - this.scale), true, true);\r\n };\r\n // Reset zoom effect\r\n Zoom.prototype.resetZoom = function (index) {\r\n this.core.outer.removeClass('lg-zoomed lg-zoom-drag-transition');\r\n var $actualSize = this.core.getElementById('lg-actual-size');\r\n var $item = this.core.getSlideItem(index !== undefined ? index : this.core.index);\r\n $actualSize\r\n .removeClass(this.settings.actualSizeIcons.zoomOut)\r\n .addClass(this.settings.actualSizeIcons.zoomIn);\r\n $item.find('.lg-img-wrap').first().removeAttr('style');\r\n $item.find('.lg-image').first().removeAttr('style');\r\n this.scale = 1;\r\n this.left = 0;\r\n this.top = 0;\r\n // Reset pagx pagy values to center\r\n this.setPageCords();\r\n };\r\n Zoom.prototype.getTouchDistance = function (e) {\r\n return Math.sqrt((e.touches[0].pageX - e.touches[1].pageX) *\r\n (e.touches[0].pageX - e.touches[1].pageX) +\r\n (e.touches[0].pageY - e.touches[1].pageY) *\r\n (e.touches[0].pageY - e.touches[1].pageY));\r\n };\r\n Zoom.prototype.pinchZoom = function () {\r\n var _this = this;\r\n var startDist = 0;\r\n var pinchStarted = false;\r\n var initScale = 1;\r\n var prevScale = 0;\r\n var $item = this.core.getSlideItem(this.core.index);\r\n this.core.outer.on('touchstart.lg', function (e) {\r\n $item = _this.core.getSlideItem(_this.core.index);\r\n if (!_this.isImageSlide(_this.core.index)) {\r\n return;\r\n }\r\n if (e.touches.length === 2) {\r\n e.preventDefault();\r\n if (_this.core.outer.hasClass('lg-first-slide-loading')) {\r\n return;\r\n }\r\n initScale = _this.scale || 1;\r\n _this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging');\r\n _this.setPageCords(e);\r\n _this.resetImageTranslate(_this.core.index);\r\n _this.core.touchAction = 'pinch';\r\n startDist = _this.getTouchDistance(e);\r\n }\r\n });\r\n this.core.$inner.on('touchmove.lg', function (e) {\r\n if (e.touches.length === 2 &&\r\n _this.core.touchAction === 'pinch' &&\r\n (_this.$LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target))) {\r\n e.preventDefault();\r\n var endDist = _this.getTouchDistance(e);\r\n var distance = startDist - endDist;\r\n if (!pinchStarted && Math.abs(distance) > 5) {\r\n pinchStarted = true;\r\n }\r\n if (pinchStarted) {\r\n prevScale = _this.scale;\r\n var _scale = Math.max(1, initScale + -distance * 0.02);\r\n _this.scale =\r\n Math.round((_scale + Number.EPSILON) * 100) / 100;\r\n var diff = _this.scale - prevScale;\r\n _this.zoomImage(_this.scale, Math.round((diff + Number.EPSILON) * 100) / 100, false, false);\r\n }\r\n }\r\n });\r\n this.core.$inner.on('touchend.lg', function (e) {\r\n if (_this.core.touchAction === 'pinch' &&\r\n (_this.$LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target))) {\r\n pinchStarted = false;\r\n startDist = 0;\r\n if (_this.scale <= 1) {\r\n _this.resetZoom();\r\n }\r\n else {\r\n var actualSizeScale = _this.getCurrentImageActualSizeScale();\r\n if (_this.scale >= actualSizeScale) {\r\n var scaleDiff = actualSizeScale - _this.scale;\r\n if (scaleDiff === 0) {\r\n scaleDiff = 0.01;\r\n }\r\n _this.zoomImage(actualSizeScale, scaleDiff, false, true);\r\n }\r\n _this.manageActualPixelClassNames();\r\n _this.core.outer.addClass('lg-zoomed');\r\n }\r\n _this.core.touchAction = undefined;\r\n }\r\n });\r\n };\r\n Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration) {\r\n var distanceXnew = endCoords.x - startCoords.x;\r\n var distanceYnew = endCoords.y - startCoords.y;\r\n var speedX = Math.abs(distanceXnew) / touchDuration + 1;\r\n var speedY = Math.abs(distanceYnew) / touchDuration + 1;\r\n if (speedX > 2) {\r\n speedX += 1;\r\n }\r\n if (speedY > 2) {\r\n speedY += 1;\r\n }\r\n distanceXnew = distanceXnew * speedX;\r\n distanceYnew = distanceYnew * speedY;\r\n var _LGel = this.core\r\n .getSlideItem(this.core.index)\r\n .find('.lg-img-wrap')\r\n .first();\r\n var distance = {};\r\n distance.x = this.left + distanceXnew;\r\n distance.y = this.top + distanceYnew;\r\n var possibleSwipeCords = this.getPossibleSwipeDragCords();\r\n if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) {\r\n if (allowY) {\r\n if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {\r\n distance.y = possibleSwipeCords.minY;\r\n }\r\n else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {\r\n distance.y = possibleSwipeCords.maxY;\r\n }\r\n }\r\n if (allowX) {\r\n if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {\r\n distance.x = possibleSwipeCords.minX;\r\n }\r\n else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {\r\n distance.x = possibleSwipeCords.maxX;\r\n }\r\n }\r\n if (allowY) {\r\n this.top = distance.y;\r\n }\r\n else {\r\n distance.y = this.top;\r\n }\r\n if (allowX) {\r\n this.left = distance.x;\r\n }\r\n else {\r\n distance.x = this.left;\r\n }\r\n this.setZoomSwipeStyles(_LGel, distance);\r\n this.positionChanged = true;\r\n }\r\n };\r\n Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) {\r\n var distance = {};\r\n if (allowY) {\r\n distance.y = this.top + (endCoords.y - startCoords.y);\r\n if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {\r\n var diffMinY = possibleSwipeCords.minY - distance.y;\r\n distance.y = possibleSwipeCords.minY - diffMinY / 6;\r\n }\r\n else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {\r\n var diffMaxY = distance.y - possibleSwipeCords.maxY;\r\n distance.y = possibleSwipeCords.maxY + diffMaxY / 6;\r\n }\r\n }\r\n else {\r\n distance.y = this.top;\r\n }\r\n if (allowX) {\r\n distance.x = this.left + (endCoords.x - startCoords.x);\r\n if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {\r\n var diffMinX = possibleSwipeCords.minX - distance.x;\r\n distance.x = possibleSwipeCords.minX - diffMinX / 6;\r\n }\r\n else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {\r\n var difMaxX = distance.x - possibleSwipeCords.maxX;\r\n distance.x = possibleSwipeCords.maxX + difMaxX / 6;\r\n }\r\n }\r\n else {\r\n distance.x = this.left;\r\n }\r\n return distance;\r\n };\r\n Zoom.prototype.isBeyondPossibleLeft = function (x, minX) {\r\n return x >= minX;\r\n };\r\n Zoom.prototype.isBeyondPossibleRight = function (x, maxX) {\r\n return x <= maxX;\r\n };\r\n Zoom.prototype.isBeyondPossibleTop = function (y, minY) {\r\n return y >= minY;\r\n };\r\n Zoom.prototype.isBeyondPossibleBottom = function (y, maxY) {\r\n return y <= maxY;\r\n };\r\n Zoom.prototype.isImageSlide = function (index) {\r\n var currentItem = this.core.galleryItems[index];\r\n return this.core.getSlideType(currentItem) === 'image';\r\n };\r\n Zoom.prototype.getPossibleSwipeDragCords = function (scale) {\r\n var $image = this.core\r\n .getSlideItem(this.core.index)\r\n .find('.lg-image')\r\n .first();\r\n var bottom = this.core.mediaContainerPosition.bottom;\r\n var imgRect = $image.get().getBoundingClientRect();\r\n var imageHeight = imgRect.height;\r\n var imageWidth = imgRect.width;\r\n if (scale) {\r\n imageHeight = imageHeight + scale * imageHeight;\r\n imageWidth = imageWidth + scale * imageWidth;\r\n }\r\n var minY = (imageHeight - this.containerRect.height) / 2;\r\n var maxY = (this.containerRect.height - imageHeight) / 2 + bottom;\r\n var minX = (imageWidth - this.containerRect.width) / 2;\r\n var maxX = (this.containerRect.width - imageWidth) / 2;\r\n var possibleSwipeCords = {\r\n minY: minY,\r\n maxY: maxY,\r\n minX: minX,\r\n maxX: maxX,\r\n };\r\n return possibleSwipeCords;\r\n };\r\n Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) {\r\n LGel.css('transform', 'translate3d(' + distance.x + 'px, ' + distance.y + 'px, 0)');\r\n };\r\n Zoom.prototype.zoomSwipe = function () {\r\n var _this = this;\r\n var startCoords = {};\r\n var endCoords = {};\r\n var isMoved = false;\r\n // Allow x direction drag\r\n var allowX = false;\r\n // Allow Y direction drag\r\n var allowY = false;\r\n var startTime = new Date();\r\n var endTime = new Date();\r\n var possibleSwipeCords;\r\n var _LGel;\r\n var $item = this.core.getSlideItem(this.core.index);\r\n this.core.$inner.on('touchstart.lg', function (e) {\r\n // Allow zoom only on image\r\n if (!_this.isImageSlide(_this.core.index)) {\r\n return;\r\n }\r\n $item = _this.core.getSlideItem(_this.core.index);\r\n if ((_this.$LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target)) &&\r\n e.touches.length === 1 &&\r\n _this.core.outer.hasClass('lg-zoomed')) {\r\n e.preventDefault();\r\n startTime = new Date();\r\n _this.core.touchAction = 'zoomSwipe';\r\n _LGel = _this.core\r\n .getSlideItem(_this.core.index)\r\n .find('.lg-img-wrap')\r\n .first();\r\n var dragAllowedAxises = _this.getDragAllowedAxises(0);\r\n allowY = dragAllowedAxises.allowY;\r\n allowX = dragAllowedAxises.allowX;\r\n if (allowX || allowY) {\r\n startCoords = _this.getSwipeCords(e);\r\n }\r\n possibleSwipeCords = _this.getPossibleSwipeDragCords();\r\n // reset opacity and transition duration\r\n _this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition');\r\n }\r\n });\r\n this.core.$inner.on('touchmove.lg', function (e) {\r\n if (e.touches.length === 1 &&\r\n _this.core.touchAction === 'zoomSwipe' &&\r\n (_this.$LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target))) {\r\n e.preventDefault();\r\n _this.core.touchAction = 'zoomSwipe';\r\n endCoords = _this.getSwipeCords(e);\r\n var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);\r\n if (Math.abs(endCoords.x - startCoords.x) > 15 ||\r\n Math.abs(endCoords.y - startCoords.y) > 15) {\r\n isMoved = true;\r\n _this.setZoomSwipeStyles(_LGel, distance);\r\n }\r\n }\r\n });\r\n this.core.$inner.on('touchend.lg', function (e) {\r\n if (_this.core.touchAction === 'zoomSwipe' &&\r\n (_this.$LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target))) {\r\n e.preventDefault();\r\n _this.core.touchAction = undefined;\r\n _this.core.outer.removeClass('lg-zoom-dragging');\r\n if (!isMoved) {\r\n return;\r\n }\r\n isMoved = false;\r\n endTime = new Date();\r\n var touchDuration = endTime.valueOf() - startTime.valueOf();\r\n _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration);\r\n }\r\n });\r\n };\r\n Zoom.prototype.zoomDrag = function () {\r\n var _this = this;\r\n var startCoords = {};\r\n var endCoords = {};\r\n var isDragging = false;\r\n var isMoved = false;\r\n // Allow x direction drag\r\n var allowX = false;\r\n // Allow Y direction drag\r\n var allowY = false;\r\n var startTime;\r\n var endTime;\r\n var possibleSwipeCords;\r\n var _LGel;\r\n this.core.outer.on('mousedown.lg.zoom', function (e) {\r\n // Allow zoom only on image\r\n if (!_this.isImageSlide(_this.core.index)) {\r\n return;\r\n }\r\n var $item = _this.core.getSlideItem(_this.core.index);\r\n if (_this.$LG(e.target).hasClass('lg-item') ||\r\n $item.get().contains(e.target)) {\r\n startTime = new Date();\r\n _LGel = _this.core\r\n .getSlideItem(_this.core.index)\r\n .find('.lg-img-wrap')\r\n .first();\r\n var dragAllowedAxises = _this.getDragAllowedAxises(0);\r\n allowY = dragAllowedAxises.allowY;\r\n allowX = dragAllowedAxises.allowX;\r\n if (_this.core.outer.hasClass('lg-zoomed')) {\r\n if (_this.$LG(e.target).hasClass('lg-object') &&\r\n (allowX || allowY)) {\r\n e.preventDefault();\r\n startCoords = _this.getDragCords(e);\r\n possibleSwipeCords = _this.getPossibleSwipeDragCords();\r\n isDragging = true;\r\n _this.core.outer\r\n .removeClass('lg-grab')\r\n .addClass('lg-grabbing lg-zoom-drag-transition lg-zoom-dragging');\r\n // reset opacity and transition duration\r\n }\r\n }\r\n }\r\n });\r\n this.$LG(window).on(\"mousemove.lg.zoom.global\" + this.core.lgId, function (e) {\r\n if (isDragging) {\r\n isMoved = true;\r\n endCoords = _this.getDragCords(e);\r\n var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);\r\n _this.setZoomSwipeStyles(_LGel, distance);\r\n }\r\n });\r\n this.$LG(window).on(\"mouseup.lg.zoom.global\" + this.core.lgId, function (e) {\r\n if (isDragging) {\r\n endTime = new Date();\r\n isDragging = false;\r\n _this.core.outer.removeClass('lg-zoom-dragging');\r\n // Fix for chrome mouse move on click\r\n if (isMoved &&\r\n (startCoords.x !== endCoords.x ||\r\n startCoords.y !== endCoords.y)) {\r\n endCoords = _this.getDragCords(e);\r\n var touchDuration = endTime.valueOf() - startTime.valueOf();\r\n _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration);\r\n }\r\n isMoved = false;\r\n }\r\n _this.core.outer.removeClass('lg-grabbing').addClass('lg-grab');\r\n });\r\n };\r\n Zoom.prototype.closeGallery = function () {\r\n this.resetZoom();\r\n };\r\n Zoom.prototype.destroy = function () {\r\n // Unbind all events added by lightGallery zoom plugin\r\n this.$LG(window).off(\".lg.zoom.global\" + this.core.lgId);\r\n this.core.LGel.off('.lg.zoom');\r\n this.core.LGel.off('.zoom');\r\n clearTimeout(this.zoomableTimeout);\r\n this.zoomableTimeout = false;\r\n };\r\n return Zoom;\r\n}());\n\nexport default Zoom;\n//# sourceMappingURL=lg-zoom.es5.js.map\n","/*\n\n PinchZoom.js\n Copyright (c) Manuel Stofer 2013 - today\n\n Author: Manuel Stofer (mst@rtp.ch)\n Version: 2.3.4\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n*/\n\n// polyfills\nif (typeof Object.assign != 'function') {\n // Must be writable: true, enumerable: false, configurable: true\n Object.defineProperty(Object, \"assign\", {\n value: function assign(target, varArgs) { // .length of function is 2\n if (target == null) { // TypeError if undefined or null\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n var to = Object(target);\n\n for (var index = 1; index < arguments.length; index++) {\n var nextSource = arguments[index];\n\n if (nextSource != null) { // Skip over if undefined or null\n for (var nextKey in nextSource) {\n // Avoid bugs when hasOwnProperty is shadowed\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return to;\n },\n writable: true,\n configurable: true\n });\n}\n\nif (typeof Array.from != 'function') {\n Array.from = function (object) {\n return [].slice.call(object);\n };\n}\n\n// utils\nvar buildElement = function(str) {\n // empty string as title argument required by IE and Edge\n var tmp = document.implementation.createHTMLDocument('');\n tmp.body.innerHTML = str;\n return Array.from(tmp.body.children)[0];\n};\n\nvar triggerEvent = function(el, name) {\n var event = document.createEvent('HTMLEvents');\n event.initEvent(name, true, false);\n el.dispatchEvent(event);\n};\n\nvar definePinchZoom = function () {\n\n /**\n * Pinch zoom\n * @param el\n * @param options\n * @constructor\n */\n var PinchZoom = function (el, options) {\n this.el = el;\n this.zoomFactor = 1;\n this.lastScale = 1;\n this.offset = {\n x: 0,\n y: 0\n };\n this.initialOffset = {\n x: 0,\n y: 0,\n };\n this.options = Object.assign({}, this.defaults, options);\n this.setupMarkup();\n this.bindEvents();\n this.update();\n\n // The image may already be loaded when PinchZoom is initialized,\n // and then the load event (which trigger update) will never fire.\n if (this.isImageLoaded(this.el)) {\n this.updateAspectRatio();\n this.setupOffsets();\n }\n\n this.enable();\n\n },\n sum = function (a, b) {\n return a + b;\n },\n isCloseTo = function (value, expected) {\n return value > expected - 0.01 && value < expected + 0.01;\n };\n\n PinchZoom.prototype = {\n\n defaults: {\n tapZoomFactor: 2,\n zoomOutFactor: 1.3,\n animationDuration: 300,\n maxZoom: 4,\n minZoom: 0.5,\n draggableUnzoomed: true,\n lockDragAxis: false,\n setOffsetsOnce: false,\n use2d: true,\n zoomStartEventName: 'pz_zoomstart',\n zoomUpdateEventName: 'pz_zoomupdate',\n zoomEndEventName: 'pz_zoomend',\n dragStartEventName: 'pz_dragstart',\n dragUpdateEventName: 'pz_dragupdate',\n dragEndEventName: 'pz_dragend',\n doubleTapEventName: 'pz_doubletap',\n verticalPadding: 0,\n horizontalPadding: 0,\n onZoomStart: null,\n onZoomEnd: null,\n onZoomUpdate: null,\n onDragStart: null,\n onDragEnd: null,\n onDragUpdate: null,\n onDoubleTap: null\n },\n\n /**\n * Event handler for 'dragstart'\n * @param event\n */\n handleDragStart: function (event) {\n triggerEvent(this.el, this.options.dragStartEventName);\n if(typeof this.options.onDragStart == \"function\"){\n this.options.onDragStart(this, event)\n }\n this.stopAnimation();\n this.lastDragPosition = false;\n this.hasInteraction = true;\n this.handleDrag(event);\n },\n\n /**\n * Event handler for 'drag'\n * @param event\n */\n handleDrag: function (event) {\n var touch = this.getTouches(event)[0];\n this.drag(touch, this.lastDragPosition);\n this.offset = this.sanitizeOffset(this.offset);\n this.lastDragPosition = touch;\n },\n\n handleDragEnd: function () {\n triggerEvent(this.el, this.options.dragEndEventName);\n if(typeof this.options.onDragEnd == \"function\"){\n this.options.onDragEnd(this, event)\n }\n this.end();\n },\n\n /**\n * Event handler for 'zoomstart'\n * @param event\n */\n handleZoomStart: function (event) {\n triggerEvent(this.el, this.options.zoomStartEventName);\n if(typeof this.options.onZoomStart == \"function\"){\n this.options.onZoomStart(this, event)\n }\n this.stopAnimation();\n this.lastScale = 1;\n this.nthZoom = 0;\n this.lastZoomCenter = false;\n this.hasInteraction = true;\n },\n\n /**\n * Event handler for 'zoom'\n * @param event\n */\n handleZoom: function (event, newScale) {\n // a relative scale factor is used\n var touchCenter = this.getTouchCenter(this.getTouches(event)),\n scale = newScale / this.lastScale;\n this.lastScale = newScale;\n\n // the first touch events are thrown away since they are not precise\n this.nthZoom += 1;\n if (this.nthZoom > 3) {\n\n this.scale(scale, touchCenter);\n this.drag(touchCenter, this.lastZoomCenter);\n }\n this.lastZoomCenter = touchCenter;\n },\n\n handleZoomEnd: function () {\n triggerEvent(this.el, this.options.zoomEndEventName);\n if(typeof this.options.onZoomEnd == \"function\"){\n this.options.onZoomEnd(this, event)\n }\n this.end();\n },\n\n /**\n * Event handler for 'doubletap'\n * @param event\n */\n handleDoubleTap: function (event) {\n var center = this.getTouches(event)[0],\n zoomFactor = this.zoomFactor > 1 ? 1 : this.options.tapZoomFactor,\n startZoomFactor = this.zoomFactor,\n updateProgress = (function (progress) {\n this.scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);\n }).bind(this);\n\n if (this.hasInteraction) {\n return;\n }\n\n this.isDoubleTap = true;\n\n if (startZoomFactor > zoomFactor) {\n center = this.getCurrentZoomCenter();\n }\n\n this.animate(this.options.animationDuration, updateProgress, this.swing);\n triggerEvent(this.el, this.options.doubleTapEventName);\n if(typeof this.options.onDoubleTap == \"function\"){\n this.options.onDoubleTap(this, event)\n }\n },\n\n /**\n * Compute the initial offset\n *\n * the element should be centered in the container upon initialization\n */\n computeInitialOffset: function () {\n this.initialOffset = {\n x: -Math.abs(this.el.offsetWidth * this.getInitialZoomFactor() - this.container.offsetWidth) / 2,\n y: -Math.abs(this.el.offsetHeight * this.getInitialZoomFactor() - this.container.offsetHeight) / 2,\n };\n },\n\n /**\n * Reset current image offset to that of the initial offset\n */\n resetOffset: function() {\n this.offset.x = this.initialOffset.x;\n this.offset.y = this.initialOffset.y;\n },\n\n /**\n * Determine if image is loaded\n */\n isImageLoaded: function (el) {\n if (el.nodeName === 'IMG') {\n return el.complete && el.naturalHeight !== 0;\n } else {\n return Array.from(el.querySelectorAll('img')).every(this.isImageLoaded);\n }\n },\n\n setupOffsets: function() {\n if (this.options.setOffsetsOnce && this._isOffsetsSet) {\n return;\n }\n\n this._isOffsetsSet = true;\n\n this.computeInitialOffset();\n this.resetOffset();\n },\n\n /**\n * Max / min values for the offset\n * @param offset\n * @return {Object} the sanitized offset\n */\n sanitizeOffset: function (offset) {\n var elWidth = this.el.offsetWidth * this.getInitialZoomFactor() * this.zoomFactor;\n var elHeight = this.el.offsetHeight * this.getInitialZoomFactor() * this.zoomFactor;\n var maxX = elWidth - this.getContainerX() + this.options.horizontalPadding,\n maxY = elHeight - this.getContainerY() + this.options.verticalPadding,\n maxOffsetX = Math.max(maxX, 0),\n maxOffsetY = Math.max(maxY, 0),\n minOffsetX = Math.min(maxX, 0) - this.options.horizontalPadding,\n minOffsetY = Math.min(maxY, 0) - this.options.verticalPadding;\n\n return {\n x: Math.min(Math.max(offset.x, minOffsetX), maxOffsetX),\n y: Math.min(Math.max(offset.y, minOffsetY), maxOffsetY)\n };\n },\n\n /**\n * Scale to a specific zoom factor (not relative)\n * @param zoomFactor\n * @param center\n */\n scaleTo: function (zoomFactor, center) {\n this.scale(zoomFactor / this.zoomFactor, center);\n },\n\n /**\n * Scales the element from specified center\n * @param scale\n * @param center\n */\n scale: function (scale, center) {\n scale = this.scaleZoomFactor(scale);\n this.addOffset({\n x: (scale - 1) * (center.x + this.offset.x),\n y: (scale - 1) * (center.y + this.offset.y)\n });\n triggerEvent(this.el, this.options.zoomUpdateEventName);\n if(typeof this.options.onZoomUpdate == \"function\"){\n this.options.onZoomUpdate(this, event)\n }\n },\n\n /**\n * Scales the zoom factor relative to current state\n * @param scale\n * @return the actual scale (can differ because of max min zoom factor)\n */\n scaleZoomFactor: function (scale) {\n var originalZoomFactor = this.zoomFactor;\n this.zoomFactor *= scale;\n this.zoomFactor = Math.min(this.options.maxZoom, Math.max(this.zoomFactor, this.options.minZoom));\n return this.zoomFactor / originalZoomFactor;\n },\n\n /**\n * Determine if the image is in a draggable state\n *\n * When the image can be dragged, the drag event is acted upon and cancelled.\n * When not draggable, the drag event bubbles through this component.\n *\n * @return {Boolean}\n */\n canDrag: function () {\n return this.options.draggableUnzoomed || !isCloseTo(this.zoomFactor, 1);\n },\n\n /**\n * Drags the element\n * @param center\n * @param lastCenter\n */\n drag: function (center, lastCenter) {\n if (lastCenter) {\n if(this.options.lockDragAxis) {\n // lock scroll to position that was changed the most\n if(Math.abs(center.x - lastCenter.x) > Math.abs(center.y - lastCenter.y)) {\n this.addOffset({\n x: -(center.x - lastCenter.x),\n y: 0\n });\n }\n else {\n this.addOffset({\n y: -(center.y - lastCenter.y),\n x: 0\n });\n }\n }\n else {\n this.addOffset({\n y: -(center.y - lastCenter.y),\n x: -(center.x - lastCenter.x)\n });\n }\n triggerEvent(this.el, this.options.dragUpdateEventName);\n if(typeof this.options.onDragUpdate == \"function\"){\n this.options.onDragUpdate(this, event)\n }\n }\n },\n\n /**\n * Calculates the touch center of multiple touches\n * @param touches\n * @return {Object}\n */\n getTouchCenter: function (touches) {\n return this.getVectorAvg(touches);\n },\n\n /**\n * Calculates the average of multiple vectors (x, y values)\n */\n getVectorAvg: function (vectors) {\n return {\n x: vectors.map(function (v) { return v.x; }).reduce(sum) / vectors.length,\n y: vectors.map(function (v) { return v.y; }).reduce(sum) / vectors.length\n };\n },\n\n /**\n * Adds an offset\n * @param offset the offset to add\n * @return return true when the offset change was accepted\n */\n addOffset: function (offset) {\n this.offset = {\n x: this.offset.x + offset.x,\n y: this.offset.y + offset.y\n };\n },\n\n sanitize: function () {\n if (this.zoomFactor < this.options.zoomOutFactor) {\n this.zoomOutAnimation();\n } else if (this.isInsaneOffset(this.offset)) {\n this.sanitizeOffsetAnimation();\n }\n },\n\n /**\n * Checks if the offset is ok with the current zoom factor\n * @param offset\n * @return {Boolean}\n */\n isInsaneOffset: function (offset) {\n var sanitizedOffset = this.sanitizeOffset(offset);\n return sanitizedOffset.x !== offset.x ||\n sanitizedOffset.y !== offset.y;\n },\n\n /**\n * Creates an animation moving to a sane offset\n */\n sanitizeOffsetAnimation: function () {\n var targetOffset = this.sanitizeOffset(this.offset),\n startOffset = {\n x: this.offset.x,\n y: this.offset.y\n },\n updateProgress = (function (progress) {\n this.offset.x = startOffset.x + progress * (targetOffset.x - startOffset.x);\n this.offset.y = startOffset.y + progress * (targetOffset.y - startOffset.y);\n this.update();\n }).bind(this);\n\n this.animate(\n this.options.animationDuration,\n updateProgress,\n this.swing\n );\n },\n\n /**\n * Zooms back to the original position,\n * (no offset and zoom factor 1)\n */\n zoomOutAnimation: function () {\n if (this.zoomFactor === 1) {\n return;\n }\n\n var startZoomFactor = this.zoomFactor,\n zoomFactor = 1,\n center = this.getCurrentZoomCenter(),\n updateProgress = (function (progress) {\n this.scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);\n }).bind(this);\n\n this.animate(\n this.options.animationDuration,\n updateProgress,\n this.swing\n );\n },\n\n /**\n * Updates the container aspect ratio\n *\n * Any previous container height must be cleared before re-measuring the\n * parent height, since it depends implicitly on the height of any of its children\n */\n updateAspectRatio: function () {\n this.unsetContainerY();\n this.setContainerY(this.container.parentElement.offsetHeight);\n },\n\n /**\n * Calculates the initial zoom factor (for the element to fit into the container)\n * @return {number} the initial zoom factor\n */\n getInitialZoomFactor: function () {\n var xZoomFactor = this.container.offsetWidth / this.el.offsetWidth;\n var yZoomFactor = this.container.offsetHeight / this.el.offsetHeight;\n\n return Math.min(xZoomFactor, yZoomFactor);\n },\n\n /**\n * Calculates the aspect ratio of the element\n * @return the aspect ratio\n */\n getAspectRatio: function () {\n return this.el.offsetWidth / this.el.offsetHeight;\n },\n\n /**\n * Calculates the virtual zoom center for the current offset and zoom factor\n * (used for reverse zoom)\n * @return {Object} the current zoom center\n */\n getCurrentZoomCenter: function () {\n var offsetLeft = this.offset.x - this.initialOffset.x;\n var centerX = -1 * this.offset.x - offsetLeft / (1 / this.zoomFactor - 1);\n\n var offsetTop = this.offset.y - this.initialOffset.y;\n var centerY = -1 * this.offset.y - offsetTop / (1 / this.zoomFactor - 1);\n\n return {\n x: centerX,\n y: centerY\n };\n },\n\n /**\n * Returns the touches of an event relative to the container offset\n * @param event\n * @return array touches\n */\n getTouches: function (event) {\n var rect = this.container.getBoundingClientRect();\n var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;\n var posTop = rect.top + scrollTop;\n var posLeft = rect.left + scrollLeft;\n\n return Array.prototype.slice.call(event.touches).map(function (touch) {\n return {\n x: touch.pageX - posLeft,\n y: touch.pageY - posTop,\n };\n });\n },\n\n /**\n * Animation loop\n * does not support simultaneous animations\n * @param duration\n * @param framefn\n * @param timefn\n * @param callback\n */\n animate: function (duration, framefn, timefn, callback) {\n var startTime = new Date().getTime(),\n renderFrame = (function () {\n if (!this.inAnimation) { return; }\n var frameTime = new Date().getTime() - startTime,\n progress = frameTime / duration;\n if (frameTime >= duration) {\n framefn(1);\n if (callback) {\n callback();\n }\n this.update();\n this.stopAnimation();\n this.update();\n } else {\n if (timefn) {\n progress = timefn(progress);\n }\n framefn(progress);\n this.update();\n requestAnimationFrame(renderFrame);\n }\n }).bind(this);\n this.inAnimation = true;\n requestAnimationFrame(renderFrame);\n },\n\n /**\n * Stops the animation\n */\n stopAnimation: function () {\n this.inAnimation = false;\n },\n\n /**\n * Swing timing function for animations\n * @param p\n * @return {Number}\n */\n swing: function (p) {\n return -Math.cos(p * Math.PI) / 2 + 0.5;\n },\n\n getContainerX: function () {\n return this.container.offsetWidth;\n },\n\n getContainerY: function () {\n return this.container.offsetHeight;\n },\n\n setContainerY: function (y) {\n return this.container.style.height = y + 'px';\n },\n\n unsetContainerY: function () {\n this.container.style.height = null;\n },\n\n /**\n * Creates the expected html structure\n */\n setupMarkup: function () {\n this.container = buildElement('
');\n this.el.parentNode.insertBefore(this.container, this.el);\n this.container.appendChild(this.el);\n\n this.container.style.overflow = 'hidden';\n this.container.style.position = 'relative';\n\n this.el.style.webkitTransformOrigin = '0% 0%';\n this.el.style.mozTransformOrigin = '0% 0%';\n this.el.style.msTransformOrigin = '0% 0%';\n this.el.style.oTransformOrigin = '0% 0%';\n this.el.style.transformOrigin = '0% 0%';\n\n this.el.style.position = 'absolute';\n },\n\n end: function () {\n this.hasInteraction = false;\n this.sanitize();\n this.update();\n },\n\n /**\n * Binds all required event listeners\n */\n bindEvents: function () {\n var self = this;\n detectGestures(this.container, this);\n\n window.addEventListener('resize', this.update.bind(this));\n Array.from(this.el.querySelectorAll('img')).forEach(function(imgEl) {\n imgEl.addEventListener('load', self.update.bind(self));\n });\n\n if (this.el.nodeName === 'IMG') {\n this.el.addEventListener('load', this.update.bind(this));\n }\n },\n\n /**\n * Updates the css values according to the current zoom factor and offset\n */\n update: function (event) {\n if (this.updatePlaned) {\n return;\n }\n this.updatePlaned = true;\n\n window.setTimeout((function () {\n this.updatePlaned = false;\n\n if (event && event.type === 'resize') {\n this.updateAspectRatio();\n this.setupOffsets();\n }\n\n if (event && event.type === 'load') {\n this.updateAspectRatio();\n this.setupOffsets();\n }\n\n var zoomFactor = this.getInitialZoomFactor() * this.zoomFactor,\n offsetX = -this.offset.x / zoomFactor,\n offsetY = -this.offset.y / zoomFactor,\n transform3d = 'scale3d(' + zoomFactor + ', ' + zoomFactor + ',1) ' +\n 'translate3d(' + offsetX + 'px,' + offsetY + 'px,0px)',\n transform2d = 'scale(' + zoomFactor + ', ' + zoomFactor + ') ' +\n 'translate(' + offsetX + 'px,' + offsetY + 'px)',\n removeClone = (function () {\n if (this.clone) {\n this.clone.parentNode.removeChild(this.clone);\n delete this.clone;\n }\n }).bind(this);\n\n // Scale 3d and translate3d are faster (at least on ios)\n // but they also reduce the quality.\n // PinchZoom uses the 3d transformations during interactions\n // after interactions it falls back to 2d transformations\n if (!this.options.use2d || this.hasInteraction || this.inAnimation) {\n this.is3d = true;\n removeClone();\n\n this.el.style.webkitTransform = transform3d;\n this.el.style.mozTransform = transform2d;\n this.el.style.msTransform = transform2d;\n this.el.style.oTransform = transform2d;\n this.el.style.transform = transform3d;\n } else {\n // When changing from 3d to 2d transform webkit has some glitches.\n // To avoid this, a copy of the 3d transformed element is displayed in the\n // foreground while the element is converted from 3d to 2d transform\n if (this.is3d) {\n this.clone = this.el.cloneNode(true);\n this.clone.style.pointerEvents = 'none';\n this.container.appendChild(this.clone);\n window.setTimeout(removeClone, 200);\n }\n\n this.el.style.webkitTransform = transform2d;\n this.el.style.mozTransform = transform2d;\n this.el.style.msTransform = transform2d;\n this.el.style.oTransform = transform2d;\n this.el.style.transform = transform2d;\n\n this.is3d = false;\n }\n }).bind(this), 0);\n },\n\n /**\n * Enables event handling for gestures\n */\n enable: function() {\n this.enabled = true;\n },\n\n /**\n * Disables event handling for gestures\n */\n disable: function() {\n this.enabled = false;\n }\n };\n\n var detectGestures = function (el, target) {\n var interaction = null,\n fingers = 0,\n lastTouchStart = null,\n startTouches = null,\n\n setInteraction = function (newInteraction, event) {\n if (interaction !== newInteraction) {\n\n if (interaction && !newInteraction) {\n switch (interaction) {\n case \"zoom\":\n target.handleZoomEnd(event);\n break;\n case 'drag':\n target.handleDragEnd(event);\n break;\n }\n }\n\n switch (newInteraction) {\n case 'zoom':\n target.handleZoomStart(event);\n break;\n case 'drag':\n target.handleDragStart(event);\n break;\n }\n }\n interaction = newInteraction;\n },\n\n updateInteraction = function (event) {\n if (fingers === 2) {\n setInteraction('zoom');\n } else if (fingers === 1 && target.canDrag()) {\n setInteraction('drag', event);\n } else {\n setInteraction(null, event);\n }\n },\n\n targetTouches = function (touches) {\n return Array.from(touches).map(function (touch) {\n return {\n x: touch.pageX,\n y: touch.pageY\n };\n });\n },\n\n getDistance = function (a, b) {\n var x, y;\n x = a.x - b.x;\n y = a.y - b.y;\n return Math.sqrt(x * x + y * y);\n },\n\n calculateScale = function (startTouches, endTouches) {\n var startDistance = getDistance(startTouches[0], startTouches[1]),\n endDistance = getDistance(endTouches[0], endTouches[1]);\n return endDistance / startDistance;\n },\n\n cancelEvent = function (event) {\n event.stopPropagation();\n event.preventDefault();\n },\n\n detectDoubleTap = function (event) {\n var time = (new Date()).getTime();\n\n if (fingers > 1) {\n lastTouchStart = null;\n }\n\n if (time - lastTouchStart < 300) {\n cancelEvent(event);\n\n target.handleDoubleTap(event);\n switch (interaction) {\n case \"zoom\":\n target.handleZoomEnd(event);\n break;\n case 'drag':\n target.handleDragEnd(event);\n break;\n }\n } else {\n target.isDoubleTap = false;\n }\n\n if (fingers === 1) {\n lastTouchStart = time;\n }\n },\n firstMove = true;\n\n el.addEventListener('touchstart', function (event) {\n if(target.enabled) {\n firstMove = true;\n fingers = event.touches.length;\n detectDoubleTap(event);\n }\n });\n\n el.addEventListener('touchmove', function (event) {\n if(target.enabled && !target.isDoubleTap) {\n if (firstMove) {\n updateInteraction(event);\n if (interaction) {\n cancelEvent(event);\n }\n startTouches = targetTouches(event.touches);\n } else {\n switch (interaction) {\n case 'zoom':\n if (startTouches.length == 2 && event.touches.length == 2) {\n target.handleZoom(event, calculateScale(startTouches, targetTouches(event.touches)));\n }\n break;\n case 'drag':\n target.handleDrag(event);\n break;\n }\n if (interaction) {\n cancelEvent(event);\n target.update();\n }\n }\n\n firstMove = false;\n }\n });\n\n el.addEventListener('touchend', function (event) {\n if(target.enabled) {\n fingers = event.touches.length;\n updateInteraction(event);\n }\n });\n };\n\n return PinchZoom;\n};\n\nvar PinchZoom = definePinchZoom();\n\nexport default PinchZoom;\n","/* eslint-disable no-unused-vars */\nimport lightGallery from 'lightgallery';\nimport lgThumbnail from 'lightgallery/plugins/thumbnail';\nimport lgVideo from 'lightgallery/plugins/video';\nimport lgZoom from 'lightgallery/plugins/zoom';\nimport PinchZoom from 'pinch-zoom-js';\nimport { isLG } from '../../util/domutils';\nimport videoPlayer from './videoPlayer';\n\nexport const GLOBALS = {\n PINCH_ZOOM: [],\n PINCH_ZOOM_TOGGLED: false,\n PLUGIN: null,\n};\n\nexport const EVENTS = {\n PINCH_ZOOM_START: 'pinch-zoom:start',\n PINCH_ZOOM_END: 'pinch-zoom:end',\n};\n\nconst SELECTORS = {\n GALLERY: '.primary-images__wrapper',\n IMAGE_WRAPPER: '.primary-images__image-wrapper',\n TOOLBAR: '.lg-toolbar',\n SLIDE: '.lg-item',\n MAIN_IMAGE: '.lg-image',\n};\n\nexport const PDP_GALLERY_EVENTS = {\n OPEN: 'gallery:open',\n};\n\nconst addMouseMoveEvent = (image) => {\n if (image) {\n image.style.top = '0';\n image.addEventListener('mousemove', (mouseEvent) => {\n const toolbar = document.querySelector(SELECTORS.TOOLBAR);\n\n const imgHeight = image.clientHeight;\n const windowHeight = window.outerHeight;\n const toolbarHeight = (toolbar && toolbar.clientHeight) || 0;\n const mouseY = mouseEvent.clientY - toolbarHeight;\n\n const verticalOffsetPercent = (mouseY / windowHeight) * 100;\n const imageOffset = (imgHeight / 100) * verticalOffsetPercent;\n const calculatedOffset = Math.min(imgHeight - windowHeight, imageOffset);\n\n image.style.top = `-${calculatedOffset}px`;\n });\n\n image.dataset.scrollInitialized = 'true';\n }\n};\n\nconst handleZoomOutVideo = () => {\n const currentVideoSlide = document.querySelector('.lg-current .lg-video-cont');\n if (currentVideoSlide) {\n document.querySelector('.lg-video-cont').style.height = `${window.innerHeight\n - document.querySelector('.lg-thumb-outer').offsetHeight}px`;\n }\n};\n\nconst initGallery = (container) => {\n const enableZoomControls = document.querySelector(SELECTORS.GALLERY).dataset.zoomControls;\n\n document.querySelectorAll(SELECTORS.IMAGE_WRAPPER).forEach((imageWrapper) => {\n imageWrapper.dataset.width = window.outerWidth;\n });\n\n // eslint-disable-next-line prefer-const\n let plugin = lightGallery(container, {\n plugins: [lgZoom, lgThumbnail, lgVideo],\n thumbnail: true,\n enableDrag: false,\n download: false,\n controls: false,\n actualSize: false,\n counter: false,\n autoplayVideoOnSlide: container.dataset.autoplayvideo === 'true',\n gotoNextSlideOnVideoEnd: container.dataset.gotonextslideonvideoend === 'true',\n zoomFromOrigin: false,\n vimeoPlayerParams: {\n controls: true,\n loop: container.dataset.playvideoinloop === 'true',\n autopause: true,\n autoPlay: container.dataset.autoplayvideo === 'true',\n responsive: true,\n },\n });\n\n container.addEventListener('lgBeforeOpen', () => {\n document.dispatchEvent(new CustomEvent(PDP_GALLERY_EVENTS.OPEN));\n });\n\n container.addEventListener('lgAfterOpen', () => {\n const maincontainer = document.querySelectorAll('.lg-container');\n if (maincontainer.length > 1) {\n maincontainer[0].remove();\n }\n });\n\n container.addEventListener('lgAfterSlide', () => {\n const zoomIn = document.querySelector('.lg #lg-zoom-in');\n if (zoomIn) {\n zoomIn.classList.remove('inactive');\n }\n });\n\n container.addEventListener('lgSlideItemLoad', () => {\n handleZoomOutVideo();\n const slides = document.querySelectorAll(`${SELECTORS.SLIDE}`);\n slides.forEach((slide) => {\n const image = slide && slide.querySelector(SELECTORS.MAIN_IMAGE);\n addMouseMoveEvent(image);\n });\n });\n\n container.addEventListener('lgAfterClose', () => {\n const videoEle = document.getElementById('product-video');\n if (videoEle && !videoEle.classList.contains('d-none')) {\n const playButton = document.querySelector('.play-button');\n if (playButton) {\n if (playButton.classList.contains('d-none')) {\n playButton.classList.remove('d-none');\n }\n }\n }\n });\n\n if (enableZoomControls === 'true') {\n container.addEventListener('lgAfterOpen', () => {\n const thumbnailArea = document.querySelector('.lg-thumb-outer .lg-thumb.group');\n const zoomIconsWrapper = document.createElement('div');\n const searchIcon = document.createElement('i');\n const zoomIcons = {\n out: document.querySelector('.lg #lg-zoom-out'),\n in: document.querySelector('.lg #lg-zoom-in'),\n };\n\n zoomIcons.in.classList.remove('lg-icon');\n zoomIcons.out.classList.remove('lg-icon');\n zoomIcons.in.classList.add('border', 'border-primary', 'font-icon', 'icon-plus', 'text-center', 'mx-4');\n zoomIcons.out.classList.add('border', 'border-primary', 'font-icon', 'icon-minus', 'text-center', 'mx-4');\n searchIcon.classList.add('lg-zoom-icon', 'font-icon', 'icon-fa-search');\n\n zoomIconsWrapper.classList.add('lg-toolbar-custom');\n zoomIconsWrapper.appendChild(zoomIcons.out);\n zoomIconsWrapper.appendChild(searchIcon);\n zoomIconsWrapper.appendChild(zoomIcons.in);\n\n thumbnailArea.appendChild(zoomIconsWrapper);\n\n zoomIcons.in.addEventListener('click', () => {\n const zoomLevel = document.querySelector('.lg-current .lg-image').dataset.scale;\n if (zoomLevel > 10) {\n zoomIcons.in.classList.add('inactive');\n } else {\n zoomIcons.in.classList.remove('inactive');\n }\n });\n\n zoomIcons.out.addEventListener('click', () => {\n zoomIcons.in.classList.remove('inactive');\n });\n });\n }\n return plugin;\n};\n\nconst handlePinchZoom = (container) => {\n if (!container.dataset.initialized) {\n const images = container.querySelectorAll('img');\n\n images.forEach((imgElement) => {\n const pinchZoomObj = new PinchZoom(imgElement, {\n draggableUnzoomed: false,\n minZoom: 1,\n setOffsetsOnce: false,\n onZoomUpdate: (zoomObj) => {\n const zoomStart = zoomObj.zoomFactor > 1 && !GLOBALS.PINCH_ZOOM_TOGGLED;\n const zoomEnd = zoomObj.zoomFactor <= 1 && GLOBALS.PINCH_ZOOM_TOGGLED;\n if (zoomStart) {\n GLOBALS.PINCH_ZOOM_TOGGLED = true;\n document.dispatchEvent(new CustomEvent(EVENTS.PINCH_ZOOM_START));\n } else if (zoomEnd) {\n GLOBALS.PINCH_ZOOM_TOGGLED = false;\n document.dispatchEvent(new CustomEvent(EVENTS.PINCH_ZOOM_END));\n }\n },\n });\n GLOBALS.PINCH_ZOOM.push(pinchZoomObj);\n });\n\n container.dataset.initialized = 'true';\n } else if (GLOBALS.PINCH_ZOOM.length > 0) {\n GLOBALS.PINCH_ZOOM.forEach((pinchZoomObj) => {\n pinchZoomObj.update({ type: 'resize' });\n if (pinchZoomObj.el.classList.contains('product-video-slot')) {\n setTimeout(() => {\n handleZoomOutVideo();\n }, 0);\n }\n });\n }\n};\n\nexport const initImageGallery = () => {\n const imgObj = document.querySelectorAll('.zoom-image');\n const videoButton = document.querySelector('.play-button');\n const container = document.querySelector(SELECTORS.GALLERY);\n let galleryId = container.getAttribute('lg-uid');\n const imageWrappers = container.querySelectorAll(SELECTORS.IMAGE_WRAPPER);\n GLOBALS.PLUGIN = lightGallery();\n\n if (isLG()) {\n imgObj.forEach((item) => {\n item.addEventListener('click', () => {\n if (GLOBALS.PLUGIN && GLOBALS.PLUGIN.items) {\n GLOBALS.PLUGIN.destroy();\n galleryId = false;\n }\n if (!galleryId) {\n GLOBALS.PLUGIN = initGallery(container);\n }\n });\n });\n } else if (!isLG() && galleryId && window.lgData && window.lgData[galleryId]) {\n GLOBALS.PLUGIN.destroy();\n }\n\n handlePinchZoom(container);\n if (videoButton) {\n videoButton.addEventListener('click', () => {\n if (isLG()) {\n if (GLOBALS.PLUGIN && GLOBALS.PLUGIN.items) {\n GLOBALS.PLUGIN.destroy();\n }\n GLOBALS.PLUGIN = initGallery(container);\n }\n videoPlayer();\n });\n }\n};\n","import $ from 'jquery';\n\nconst playButton = document.querySelector('.play-button');\nconst pauseButton = document.querySelector('.pause-button');\n\nfunction displayPlayButton() {\n if (playButton) {\n if (playButton.classList.contains('d-none')) {\n playButton.classList.remove('d-none');\n }\n }\n}\n\nfunction hidePlayButton() {\n if (playButton) {\n if (!playButton.classList.contains('d-none')) {\n playButton.classList.add('d-none');\n }\n }\n}\n\nfunction displayPauseButton() {\n if (pauseButton) {\n if (pauseButton.classList.contains('d-none')) {\n pauseButton.classList.remove('d-none');\n }\n }\n}\n\nfunction hidePauseButton() {\n if (pauseButton) {\n if (!pauseButton.classList.contains('d-none')) {\n pauseButton.classList.add('d-none');\n }\n }\n}\n\nfunction playVideo(isPlayVideo) {\n const bannerImgElement = document.querySelector('.product-video-slot');\n const videoWrapper = document.querySelector('.primary-images__video-wrapper');\n const videoEle = document.getElementById('product-video');\n const imageCarousel = document.querySelector('.primary-images__carousel');\n const container = document.querySelector('.primary-images__wrapper');\n const imageElement = document.querySelector('.primary-images__image-wrapper__inner');\n const videoElement = document.querySelector('.primary-images__video-wrapper__inner');\n let options;\n\n if (videoEle) {\n if (isPlayVideo === 'true') {\n if (bannerImgElement) {\n bannerImgElement.classList.add('d-none');\n }\n videoEle.classList.remove('d-none');\n hidePlayButton();\n }\n if (imageCarousel.classList.contains('carousel')) {\n options = {\n id: videoEle.dataset.videoid,\n autoplay: videoWrapper.dataset.autoplayvideo === 'true',\n width: imageElement.offsetWidth,\n height: imageElement.offsetHeight,\n muted: true,\n controls: false,\n loop: container.dataset.playvideoinloop === 'true',\n autopause: true,\n responsive: true,\n };\n } else {\n options = {\n id: videoEle.dataset.videoid,\n autoplay: videoWrapper.dataset.autoplayvideo === 'true',\n width: videoElement.offsetWidth,\n height: videoElement.offsetHeight,\n muted: true,\n controls: false,\n loop: container.dataset.playvideoinloop === 'true',\n autopause: true,\n responsive: true,\n };\n }\n // eslint-disable-next-line no-undef\n const videoPlayer = new Vimeo.Player(videoEle, options);\n if (imageCarousel.classList.contains('carousel')) {\n if (videoWrapper.classList.contains('active')\n && ((isPlayVideo === 'true')\n && !videoEle.classList.contains('d-none'))) {\n hidePlayButton();\n hidePauseButton();\n videoPlayer.play();\n } else {\n displayPlayButton();\n hidePauseButton();\n videoPlayer.pause();\n }\n } else if (((isPlayVideo === 'true') && !videoEle.classList.contains('d-none'))) {\n hidePlayButton();\n hidePauseButton();\n videoPlayer.play();\n } else {\n displayPlayButton();\n hidePauseButton();\n videoPlayer.pause();\n }\n\n videoPlayer.on('ended', () => {\n displayPlayButton();\n hidePauseButton();\n });\n return videoPlayer;\n }\n return null;\n}\n\nexport default () => {\n const videoWrapper = document.querySelector('.primary-images__video-wrapper');\n const carouselControlNext = document.querySelector('.primary-images__carousel .carousel-control-next');\n const carouselControlPrev = document.querySelector('.primary-images__carousel .carousel-control-prev');\n let thumbPlayBtn = document.querySelector('.pdp-video-thumb-playButton');\n const videoEle = document.getElementById('product-video');\n const thumbImgs = document.querySelectorAll('.lg-thumb-item');\n const imageCarousel = document.querySelector('.primary-images__carousel');\n let touchstartY = 0;\n let touchendY = 0;\n\n if ((thumbImgs.length > 0) && videoWrapper && videoEle) {\n if (!thumbPlayBtn) {\n const videoSlot = +videoWrapper.dataset.videoslot;\n const thumbBtn = document.createElement('img');\n thumbBtn.classList.add('pdp-video-thumb-playButton');\n thumbBtn.src = videoWrapper.dataset.thumbBtnSrc;\n thumbBtn.dataset.lgItemId = videoWrapper.dataset.videoslot;\n thumbImgs[videoSlot].appendChild(thumbBtn);\n thumbPlayBtn = thumbBtn;\n }\n }\n if (videoWrapper) {\n let player;\n $(carouselControlNext).on('click', () => {\n setTimeout(() => {\n player = playVideo(videoWrapper.dataset.autoplayvideo);\n }, 1000);\n });\n $(carouselControlPrev).on('click', () => {\n setTimeout(() => {\n player = playVideo(videoWrapper.dataset.autoplayvideo);\n }, 1000);\n });\n $(playButton).on('click', () => {\n setTimeout(() => {\n player = playVideo('true');\n }, 1000);\n });\n $(pauseButton).on('click', () => {\n player = playVideo('false');\n });\n $(thumbPlayBtn).on('click', () => {\n setTimeout(() => {\n if ($('.lg-video-play-button')) {\n $('.lg-video-play-button').click();\n }\n }, 1500);\n });\n\n if (videoWrapper.dataset.autoplayvideo) {\n player = playVideo(videoWrapper.dataset.autoplayvideo);\n }\n $(document.querySelector('.primary-images__video-link-button')).on('click', () => {\n setTimeout(() => {\n player = playVideo(videoWrapper.dataset.autoplayvideo);\n }, 1000);\n });\n\n $(imageCarousel).on('touchstart', (e) => {\n if (imageCarousel.classList.contains('carousel')) {\n if (videoWrapper.classList.contains('active') && !videoEle.classList.contains('d-none')) {\n if (playButton) {\n if (playButton.classList.contains('d-none')) {\n player.getPaused().then((paused) => {\n if (!paused) {\n displayPauseButton();\n }\n });\n }\n }\n }\n }\n touchstartY = e.changedTouches[0].screenY;\n });\n $(imageCarousel).on('touchend', (e) => {\n touchendY = e.changedTouches[0].screenY;\n if (touchendY !== touchstartY) {\n if (imageCarousel.classList.contains('carousel')) {\n if (!videoWrapper.classList.contains('active') && videoEle.classList.contains('d-none')) {\n setTimeout(() => {\n player = playVideo('false');\n }, 1000);\n } else {\n setTimeout(() => {\n player = playVideo(videoWrapper.dataset.autoplayvideo);\n }, 1000);\n }\n }\n }\n });\n }\n};\n","/**\n * Bootstrap Carousel Swipe v1.1\n *\n * jQuery plugin to enable swipe gestures on Bootstrap 3 carousels.\n * Examples and documentation: https://github.com/maaaaark/bcSwipe\n *\n * Licensed under the MIT license.\n */\n\nimport $ from 'jquery';\n\nfunction bcSwipe(carousel, settings) {\n let config = {\n threshold: 50,\n };\n if (settings) {\n config = Object.assign(config, settings);\n }\n\n let stillMoving = false;\n let start;\n\n if ('ontouchstart' in document.documentElement) {\n carousel.addEventListener('touchstart', onTouchStart, false);\n }\n\n function onTouchStart(e) {\n if (e.target.dataset.swipeDisabled !== 'true' && e.touches.length === 1) {\n start = e.touches[0].pageX;\n stillMoving = true;\n carousel.addEventListener('touchmove', onTouchMove, false);\n }\n }\n\n function onTouchMove(e) {\n if (stillMoving) {\n const x = e.touches[0].pageX;\n const difference = start - x;\n if (Math.abs(difference) >= config.threshold) {\n cancelTouch();\n if (difference > 0) {\n $(carousel).carousel('next');\n } else {\n $(carousel).carousel('prev');\n }\n }\n }\n }\n\n function cancelTouch() {\n carousel.removeEventListener('touchmove', onTouchMove);\n start = null;\n stillMoving = false;\n }\n\n return this;\n}\n\nexport default (carousel, settings) => bcSwipe(carousel, settings);\n","/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.14.7\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nvar longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\nvar timeoutDuration = 0;\nfor (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n timeoutDuration = 1;\n break;\n }\n}\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var window = element.ownerDocument.defaultView;\n var css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\nvar isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nvar isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nfunction isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);\n}\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);\n}\n\nfunction getWindowSizes(document) {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n var width = sizes.width || element.clientWidth || result.right - result.left;\n var height = sizes.height || element.clientHeight || result.bottom - result.top;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth, 10);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop, 10);\n var marginLeft = parseFloat(styles.marginLeft, 10);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n var parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nfunction getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n var el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n // NOTE: 1 DOM access here\n\n var boundaries = { top: 0, left: 0 };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(popper.ownerDocument),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n var isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0;\n boundaries.top += isPaddingNumber ? padding : padding.top || 0;\n boundaries.right -= isPaddingNumber ? padding : padding.right || 0;\n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var window = element.ownerDocument.defaultView;\n var styles = window.getComputedStyle(element);\n var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nfunction getRoundedOffsets(data, shouldRound) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var round = Math.round,\n floor = Math.floor;\n\n var noRound = function noRound(v) {\n return v;\n };\n\n var referenceWidth = round(reference.width);\n var popperWidth = round(popper.width);\n\n var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n var isVariation = data.placement.indexOf('-') !== -1;\n var sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;\n var verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right)\n };\n}\n\nvar isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.
\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n var _data$offsets$arrow;\n\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.
\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
\n * It will read the variation of the `placement` property.
\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.
\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport'\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.
\n * These can be overridden using the `options` argument of Popper.js.
\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\nexport default Popper;\n//# sourceMappingURL=popper.js.map\n"],"sourceRoot":""}