{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/checkout/formErrors.js","webpack:///../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js","webpack:///../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/scrollAnimate.js","webpack:///../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/common/handleADA.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/base.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/detail.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/quickView.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/product/recommendationQuickView.js","webpack:///./cartridges/app_custom_core/cartridge/client/default/js/productDetail.js","webpack:///./node_modules/jquery-zoom/jquery.zoom.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb,oBAAoB,mBAAO,CAAC,gKAA6B;;AAEzD;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACjCa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClCa;;AAEb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;ACZa;;AAEb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxFa;;AAEb,kBAAkB,mBAAO,CAAC,kJAAuB;AACjD,kBAAkB,mBAAO,CAAC,wJAA0B;AACpD,oBAAoB,mBAAO,CAAC,4FAAU;AACtC,sBAAsB,mBAAO,CAAC,4FAAU;AACxC,4BAA4B,mBAAO,CAAC,4FAAU;AAC9C,0BAA0B,mBAAO,CAAC,4FAAU;;AAE5C;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,qCAAqC;AAChE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,MAAM;AACjB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4BAA4B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gGAAgG,QAAQ,SAAS,aAAa,cAAc;AAC5I;AACA,kHAAkH,cAAc,qBAAqB;AACrJ;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA,mBAAmB,6CAA6C;AAChE;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC;AACA;AACA;AACA,mBAAmB,uDAAuD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,aAAa,sDAAsD;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2CAA2C;AAChE;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;;AAEA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;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;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;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,aAAa;AACb;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;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,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kEAAkE,qBAAqB;AACvF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,gEAAgE,EAAE,kCAAkC,EAAE;AACtG;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACt9Ca;;AAEb,WAAW,mBAAO,CAAC,wFAAQ;AAC3B,gBAAgB,mBAAO,CAAC,yGAAqB;;AAE7C;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,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;;AAED;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,4CAA4C,kCAAkC,EAAE;;AAEhF;AACA,4CAA4C,uCAAuC,EAAE;;AAErF;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,2HAA2H;AAC3L;AACA,iBAAiB;AACjB,gEAAgE,6CAA6C;AAC7G;AACA,aAAa;AACb,4DAA4D,6CAA6C;AACzG;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oCAAoC,sCAAsC;AAC1E,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,uCAAuC,0BAA0B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mBAAmB;AAC9C;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;AC5lBa;;AAEb,WAAW,mBAAO,CAAC,wFAAQ;AAC3B,kBAAkB,mBAAO,CAAC,kJAAuB;;AAEjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,OAAO;AACpB,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,cAAc;AAC1B;AACA;AACA;;AAEA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,kCAAkC,EAAE;;AAEhF;AACA,4CAA4C,uCAAuC,EAAE;;AAErF;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;;;;;;;;;;;;;AClNa;;AAEb,oBAAoB,mBAAO,CAAC,2GAAsB;AAClD,WAAW,mBAAO,CAAC,iGAAiB;;AAEpC;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,aAAa,sDAAsD;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2CAA2C;AAChE;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxIA,qBAAqB,mBAAO,CAAC,0HAAW;;AAExC;AACA;AACA,mBAAmB,mBAAO,CAAC,8DAAa;AACxC,mBAAmB,mBAAO,CAAC,oGAAkB;;AAE7C;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,uBAAuB,mBAAO,CAAC,sIAAmC;AAClE,KAAK;AACL;AACA;AACA,CAAC;;;;;;;;;;;;AC1BD;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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB,yBAAyB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,CAAC","file":"default/js/productDetail.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/app_custom_core/cartridge/client/default/js/productDetail.js\");\n","'use strict';\n\nvar scrollAnimate = require('../components/scrollAnimate');\n\n/**\n * Display error messages and highlight form fields with errors.\n * @param {string} parentSelector - the form which contains the fields\n * @param {Object} fieldErrors - the fields with errors\n */\nfunction loadFormErrors(parentSelector, fieldErrors) { // eslint-disable-line\n // Display error messages and highlight form fields with errors.\n $.each(fieldErrors, function (attr) {\n $('*[name=' + attr + ']', parentSelector)\n .addClass('is-invalid')\n .siblings('.invalid-feedback')\n .html(fieldErrors[attr]);\n });\n // Animate to top of form that has errors\n scrollAnimate($(parentSelector));\n}\n\n/**\n * Clear the form errors.\n * @param {string} parentSelector - the parent form selector.\n */\nfunction clearPreviousErrors(parentSelector) {\n $(parentSelector).find('.form-control.is-invalid').removeClass('is-invalid');\n $('.error-message').hide();\n}\n\nmodule.exports = {\n loadFormErrors: loadFormErrors,\n clearPreviousErrors: clearPreviousErrors\n};\n","'use strict';\n\nmodule.exports = {\n setTabNextFocus: function (focusParams) {\n var KEYCODE_TAB = 9;\n var isTabPressed = (focusParams.event.key === 'Tab' || focusParams.event.keyCode === KEYCODE_TAB);\n\n if (!isTabPressed) {\n return;\n }\n\n var firstFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.firstElementSelector);\n var lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.lastElementSelector);\n\n if ($(focusParams.containerSelector + ' ' + focusParams.lastElementSelector).is(':disabled')) {\n lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.nextToLastElementSelector);\n if ($('.product-quickview.product-set').length > 0) {\n var linkElements = $(focusParams.containerSelector + ' a#fa-link.share-icons');\n lastFocusableEl = linkElements[linkElements.length - 1];\n }\n }\n\n if (focusParams.event.shiftKey) /* shift + tab */ {\n if ($(':focus').is(firstFocusableEl)) {\n lastFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n } else /* tab */ {\n if ($(':focus').is(lastFocusableEl)) { // eslint-disable-line\n firstFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n }\n }\n};\n","'use strict';\n\nmodule.exports = function (element) {\n var position = element && element.length ? element.offset().top : 0;\n $('html, body').animate({\n scrollTop: position\n }, 500);\n if (!element) {\n $('.logo-home').focus();\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","'use strict';\n\nfunction pressEnterItem(actionItem, itemForClick) {\n $(actionItem).keypress(function (e) {\n if (e.which === 13) {\n if (itemForClick) {\n $(itemForClick).click();\n } else {\n $(actionItem).click();\n }\n }\n });\n}\n\nfunction pressEnterToClickInsideElement(container, itemForEnter, itemForNavigate) {\n $(container).on('keydown', itemForEnter, function (e) {\n if (e.which === 13) {\n if (itemForEnter === itemForNavigate) {\n $(e.target).click();\n } else if ($(e.target).find(itemForNavigate)[0]) {\n $(e.target).find(itemForNavigate)[0].click();\n } else {\n $(e.target).find(itemForNavigate).click();\n }\n }\n });\n}\n\nfunction pressEnterToNavigateUsingAInsideElement(container, itemForEnter, itemForNavigate) {\n $(container).on('keydown', itemForEnter, function (e) {\n if (e.which === 13) {\n $(location).attr('href', $(e.target).find(itemForNavigate)[0].href);\n }\n });\n}\n\nfunction focusNextElementOutsidefromSortOrderContainerWhenPressTab() {\n $('#sort-order-by-button').keydown(function (e) {\n if (e.which === 9 && !$('#sort-by-container').hasClass('show')) {\n $('.refinement-tipo > .card-header > button').focus();\n }\n });\n}\n\nfunction focusNextElementOutsidefromContainerWhenPressTab(container, flagClass, nextElement) {\n $(container).keydown(function (e) {\n if (e.which === 9 && !$(container).hasClass(flagClass)) {\n e.preventDefault();\n $(nextElement).focus();\n }\n });\n}\n\nfunction pressEnterInHeaderActionsItems(actionItem) {\n $('.header-action-item').has(actionItem).keypress(function (e) {\n if (e.which === 13) {\n $(actionItem).click();\n }\n });\n}\n\nfunction tabParagraphCollapsible(currentElement, nextElement) {\n $(currentElement).on('blur', function (event) {\n if (event.which === 0 && $(this).attr('aria-expanded') === 'false') {\n $(nextElement).trigger('focus');\n }\n });\n}\n\nfunction shippingMethod() {\n $('[id^=\"labelshippingMethod\"]').keypress(function (e) {\n var id = $(this).prop('id');\n id = id.slice(5);\n if (e.which === 13) {\n $('#' + id).trigger('click');\n }\n });\n}\n\nmodule.exports = {\n pressEnterItem : pressEnterItem,\n focusNextElementOutsidefromSortOrderContainerWhenPressTab : focusNextElementOutsidefromSortOrderContainerWhenPressTab,\n pressEnterInHeaderActionsItems : pressEnterInHeaderActionsItems,\n tabParagraphCollapsible : tabParagraphCollapsible,\n shippingMethod : shippingMethod,\n pressEnterToNavigateUsingAInsideElement : pressEnterToNavigateUsingAInsideElement,\n pressEnterToClickInsideElement : pressEnterToClickInsideElement,\n focusNextElementOutsidefromContainerWhenPressTab : focusNextElementOutsidefromContainerWhenPressTab\n};\n","'use strict';\n\nvar focusHelper = require('base/components/focus');\nvar formHelpers = require('base/checkout/formErrors');\nvar reloadGallery = require('./detail').showMainGalleryMobile;\nvar openZoomDesktop = require('./detail').openZoomDesktop;\nvar createCarouselDesktop = require('./detail').createCarouselDesktop;\nvar showRecommendations = require('./detail').showRecommendations;\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 ($($el).hasClass('add-to-cart-no-checkout')) {\n pid = $($el).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 var quantitySelected;\n if ($el && $('.set-items').length) {\n quantitySelected = $($el).closest('.product-detail').find('.quantity-select');\n } else if ($el && $('.product-bundle').length) {\n var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select');\n var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select');\n if (quantitySelectedModal.val() === undefined) {\n quantitySelected = quantitySelectedPDP;\n } else {\n quantitySelected = quantitySelectedModal;\n }\n } else {\n quantitySelected = $('.quantity-select');\n }\n return quantitySelected;\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 * Change add-to-cart-size-selector button to add-to-cart button.\n */\nfunction changeAddToCartSizeSelectorButton() {\n if ($('button.add-to-cart-size-selector').length) {\n var addToCartSizeSelectorElement = $('button.add-to-cart-size-selector');\n addToCartSizeSelectorElement.addClass('add-to-cart').removeClass('add-to-cart-size-selector');\n addToCartSizeSelectorElement.attr('data-target', '#chooseBonusProductModal');\n }\n}\n\n/**\n * Change add-to-cart button to add-to-cart-size-selector button.\n */\nfunction changeAddToCartButton() {\n if ($('button.add-to-cart').length && !$('.js-product-list-size').hasClass('selected')) {\n var addToCartElement = $('button.add-to-cart');\n addToCartElement.addClass('add-to-cart-size-selector').removeClass('add-to-cart');\n addToCartElement.attr('data-target', '#sizeSelectorModal');\n addToCartElement.removeAttr('disabled');\n addToCartElement.removeProp('disabled');\n }\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 * @param {Object} msgs - object containing resource messages\n * @param {Boolean} updateUrlSwatch - true if you want update the data-url attribute\n */\nfunction processSwatchValues(attr, $productContainer, msgs, updateUrlSwatch) {\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n attrValue.value + '\"]');\n var $swatchButton = $attrValue.parent();\n var label = $productContainer.find('.' + attr.id + '.non-input-label');\n\n if (attrValue.selected) {\n if (label && label.length > 0) {\n label.empty().append(attr.displayName + ' : ' + attrValue.displayValue);\n }\n $attrValue.addClass('selected');\n $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n } else {\n $attrValue.removeClass('selected');\n $attrValue.siblings('.selected-assistive-text').empty();\n }\n\n if (updateUrlSwatch) {\n if (attrValue.url) {\n $swatchButton.attr('data-url', attrValue.url);\n } else {\n $swatchButton.removeAttr('data-url');\n }\n }\n\n // Disable if not selectable\n $attrValue.removeClass('selectable unselectable');\n\n if (updateUrlSwatch) {\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n } else {\n $attrValue.addClass('selectable');\n }\n });\n}\n\n/**\n * Recorremos los diferentes selectors, ya que a cada uno hay que añadirle o quitarle diferentes *clases.\n * @param {Array} selectors diferentes selectores de talla\n */\nfunction addClassesDependsOnSelectorType(selectors, isAlertSizeNotificationEnabled) {\n selectors.each(function () {\n var item = $(this)[0];\n if (item.nodeName == 'LI' && isAlertSizeNotificationEnabled) {\n $(this).addClass('unselectable');\n } else if (item.nodeName == 'LI' && !isAlertSizeNotificationEnabled) {\n $(this).append('
');\n $(this).addClass('unselectable');\n } else {\n item.setAttribute('disabled', '');\n }\n });\n}\n\nfunction removeIconSizeNotificationFromModal() {\n $('li.js-product-list-size-modal.swatch-rectangle.disabled.unselectable').each(function () {\n if ($(this).find('.email-size-available').length > 0) {\n $(this).find('.email-size-available').remove();\n }\n });\n}\n\nfunction addDiagoanlToModal() {\n $('li.js-product-list-size-modal.swatch-rectangle.disabled.unselectable').each(function () {\n $(this).first().prepend('
');\n });\n}\n\nfunction showEmailIconOrDiagonal(params) {\n var $attrValue = params && params.$attrValue;\n var attrValue = params && params.attrValue;\n var attrSelected = params && params.attrSelected;\n var isOutlet = params && params.attrValue.isOutlet;\n var isAlertSizeNotificationEnabled = params && params.attrValue.isAlertSizeNotificationEnabled;\n\n if (!attrValue.selectable) {\n $attrValue.addClass('disabled');\n if (isAlertSizeNotificationEnabled && !isOutlet) {\n $attrValue.prepend('
');\n } else if (isAlertSizeNotificationEnabled && isOutlet) {\n var hasDiagonal = false;\n for (var i = 0; i < $attrValue[0].childNodes.length; i++) {\n var childNode = $attrValue[0].childNodes[i];\n if (childNode.nodeName === 'DIV' && childNode.className === 'diagonal') {\n hasDiagonal = true;\n }\n }\n\n if (!hasDiagonal) {\n $attrValue.prepend('
');\n }\n }\n addClassesDependsOnSelectorType($attrValue, attrValue.isAlertSizeNotificationEnabled);\n } else {\n $attrValue.removeClass('disabled');\n $attrValue.removeAttr('disabled');\n $attrValue.removeClass('unselectable');\n $attrValue.find('.diagonal').remove();\n if (isAlertSizeNotificationEnabled && !isOutlet) {\n $attrValue.find('.icon').remove();\n }\n }\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n attrSelected = true;\n }\n\n return attrSelected;\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 */\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 var attrSelected = false;\n $('.icon.email-size-available').remove();\n $('.icon.email-size-available-white').remove();\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('hidden');\n\n var params = {\n attrValue : attrValue,\n $attrValue: $attrValue,\n attrSelected : attrSelected\n };\n\n // en base a isOutlet y isAlertSizeNotificationEnabled se mostrar o la diagonal para el tachado o el icono de email para la alerta por tallas.\n attrSelected = showEmailIconOrDiagonal(params);\n\n // Se añade la información referente a los nuevos atributos añadios para el aviso de stock por tallas.\n $attrValue.attr('data-attr-value', attrValue.displayValue);\n $attrValue.attr('data-attr-ean', attrValue.ean);\n $attrValue.attr('data-attr-stock', attrValue.stock);\n });\n\n removeIconSizeNotificationFromModal();\n addDiagoanlToModal();\n\n if (!attrSelected && !$('button.add-to-cart-size-selector').length) {\n changeAddToCartButton();\n }\n // Disabled add to cart pdp button.\n var addToCartElement;\n if ($('button.add-to-cart-size-selector').length) {\n addToCartElement = $('button.add-to-cart-size-selector');\n } else if ($('button.add-to-cart').length) {\n addToCartElement = $('button.add-to-cart');\n }\n if (addToCartElement) {\n if (attr.values.length === 0) {\n addToCartElement.prop('disabled', true);\n addToCartElement.attr('disabled', true);\n } else {\n addToCartElement.removeAttr('disabled');\n addToCartElement.removeProp('disabled');\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 * @param {Object} msgs - object containing resource messages\n * @param {Boolean} updateUrlSwatch - true if you want update the data-url attribute\n */\nfunction updateAttrs(attrs, $productContainer, msgs, updateUrlSwatch) {\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, msgs, updateUrlSwatch);\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 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 * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(optionsHtml, $productContainer) {\n // Update options\n $productContainer.find('.product-options').empty().html(optionsHtml);\n}\n\n/**\n * Update the icons.\n * @param {Object} product - The product.\n */\nfunction updateIcons(product) {\n var ribbonIcons = $('#nameProductContainer .productIcons');\n if (ribbonIcons) {\n ribbonIcons.empty();\n }\n if (product.icons) {\n var template = '';\n if (product.priceInfo) {\n template += '';\n }\n if (product.promotions != null) {\n for (var i = 0; i < product.promotions.length; i++) {\n var promotion = product.promotions[i];\n if (promotion.image != null) {\n template += '\"'';\n }\n }\n }\n if (product.ribbons != null) {\n for (var j = 0; j < product.ribbons.length; j++) {\n var ribbon = product.ribbons[j];\n template += '\"'';\n }\n }\n ribbonIcons.html(template);\n }\n}\n\n/** Actualiza las imagenes del modelo color seleccionado para el zoom Desktop */\n// function createZoomDesktop(images) {\n// var container = $('#zoom #image-container');\n// container.empty();\n// $.each(images, function (key, dataImage) {\n// var url = dataImage[0];\n// var srcset = dataImage[1];\n// var title = dataImage[2];\n// var alt = dataImage[2];\n// if (!srcset.includes('video')) {\n// var preffix = url.substring(url.lastIndexOf('/'), url.length).split('-')[0].substring(1);\n// container.append('\"'');\n// }\n// });\n// openZoomDesktop();\n// createCarouselDesktop();\n// }\n\nfunction createZoomDesktop(images) {\n var container = $('#zoom #image-container');\n container.empty().css({\n position: 'relative',\n overflow: 'hidden'\n });\n\n $.each(images, function (key, dataImage) {\n var url = dataImage[0];\n var type = dataImage[1];\n var title = dataImage[2];\n var alt = dataImage[3];\n var srcset = dataImage[4];\n\n if (type !== 'video') {\n var preffix = url.substring(url.lastIndexOf('/'), url.length).split('-')[0].substring(1);\n container.append(\n '' +\n '' +\n '\"'' +\n ''\n );\n }\n });\n\n // Reset zoom\n container.trigger('zoom.destroy');\n\n openZoomDesktop();\n createCarouselDesktop();\n}\n\n/**\n * Actualiza y renderiza las imagenes y video\n * @param {*} media\n * */\nfunction createGallery(media, poster) {\n if (media.length > 0) {\n $('#galleryBox').empty();\n $('#galleryBox').removeClass('slick-initialized slick-slider slick-dotted');\n var videoKey = 0;\n $.each(media, function (key, dataImage) {\n var preffix;\n var url = dataImage[0];\n var type = dataImage[1];\n var title = dataImage[2];\n var alt = dataImage[3];\n var srcset = dataImage[4];\n\n if (type.includes('video')) {\n preffix = 'video';\n } else {\n preffix = url.substring(url.lastIndexOf('/'), url.length).split('-')[0].substring(1);\n }\n\n if (type.includes('video')) {\n $('#galleryBox').append('
    ');\n videoKey++;\n } else {\n $('#galleryBox').append(\n '
    ' +\n '' +\n '' +\n '' +\n '\"'' +\n '' +\n '' +\n '
    '\n );\n }\n });\n }\n}\n\n/** TODO FBM: custom function to add imgSmall\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {Object[]} imgsSmall - Array of small product images,along with related information\n * @param {Object[]} primaryVideos - Array of videos\n * @param {Object[]} primaryImageVideos - Array of small product images videos\n * @param {String} productName\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction createCarousel(imgs, imgsSmall, $productContainer, primaryVideos, primaryImageVideos, productName) {\n var carousel = $productContainer.find('.carousel');\n $(carousel).carousel('dispose');\n var carouselId = $(carousel).attr('id');\n $(carousel).empty().append('
    ' + $(carousel).data('prev') + '' + $(carousel).data('next') + '
      ');\n for (var i = 0; i < imgs.length; i++) {\n $('
      \"'
      ').appendTo($(carousel).find('.carousel-inner'));\n }\n // Add videos\n for (var k = 0; k < (primaryVideos && primaryVideos.length); k++) {\n $('
      ').appendTo($(carousel).find('.carousel-inner'));\n }\n $($(carousel).find('.carousel-item')).first().addClass('active');\n for (var j = 0; j < imgsSmall.length; j++) {\n $('
    1. \"'
    2. ').appendTo($(carousel).find('.carousel-indicators'));\n }\n // Add images videos\n for (var l = 0; l < (primaryImageVideos && primaryImageVideos.length); l++) {\n $('
    3. \"'
    4. ').appendTo($(carousel).find('.carousel-indicators'));\n }\n $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n if (imgs.length === 1 && primaryVideos && primaryVideos.length === 0) {\n $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n }\n $(carousel).carousel();\n}\n\n\nfunction changeImageModal(imageSmall) {\n var alt = imageSmall.alt.trim();\n var url = imageSmall.url;\n var item = $('#sizeSelectorModal .imageSizeSelectorModal img');\n item.attr('src', url).attr('alt', alt);\n}\n/** TODO FBM: custom function to add imgSmall in call to createCarousel\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 * @param {Boolean} updateUrlSwatch - true if you want update the data-url attribute\n */\nfunction handleVariantResponse(response, $productContainer, updateUrlSwatch) {\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, response.resources, updateUrlSwatch);\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 allGallery = response.mediaFiles;\n var primaryImageUrls = response.product.images.large;\n var color = response.colorSelected;\n var currentImageColorURL = $('#galleryBox div[class^=\"mediaBox\"]:first-child img').attr('src');\n var search = '_' + color.toUpperCase() + '_';\n if (!$('#quickViewModal').hasClass('show')) {\n if (currentImageColorURL && !currentImageColorURL.includes(search)) {\n $.spinner().start();\n createGallery(allGallery, response.videoPoster);\n changeImageModal(response.product.images.small[0]);\n createZoomDesktop(allGallery);\n $.spinner().stop();\n }\n } else {\n var primaryImageSmallUrls = response.product.images.small;\n var primaryImageVideos = response.product.imagesVideos;\n var productName = response.product.productName;\n createCarousel(primaryImageUrls, primaryImageSmallUrls, $productContainer, null, primaryImageVideos, productName);\n }\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 // Empty promotions before calculation if it has\n $productContainer.find('.promotions').empty();\n\n // Update promotions\n if (Array.isArray(response.product.promotions) && response.product.promotions.length > 0) {\n response.product.promotions.forEach(function (promotion, index) { // eslint-disable-line no-unused-vars\n if (promotion.calloutMsg !== '') {\n $productContainer.find('.promotions').empty().html(promotion.calloutMsg);\n }\n });\n } else {\n $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n }\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 // Update icons.\n updateIcons(response.product);\n\n if (!$('#quickViewModal').hasClass('show')) {\n reloadGallery();\n\n if (currentImageColorURL && !currentImageColorURL.includes(search)) {\n var recommendationOther = response.productRecomendationsOther && response.productRecomendationsOther.trim();\n var recommendationCrossSelling = response.productRecomendationsCrossSelling && response.productRecomendationsCrossSelling.trim();\n var currentCarousel = $('#recommendationsContainer');\n currentCarousel.html('');\n\n // Mostramos los productos recomendados pero si NO estamos en el quick view.\n if (recommendationOther) {\n currentCarousel.append(recommendationOther);\n }\n\n if (recommendationCrossSelling) {\n currentCarousel.append(recommendationCrossSelling);\n }\n showRecommendations();\n }\n }\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 * @param {Boolean} updateUrlSwatch - true if you want update the data-url attribute\n */\nfunction attributeSelect(selectedValueUrl, $productContainer, updateUrlSwatch) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelect',\n { url: selectedValueUrl, container: $productContainer });\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer, updateUrlSwatch);\n updateOptions(data.product.optionsHtml, $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 + '
      '\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: 'json',\n success: function (response) {\n var parsedHtml = parseHtml(response.renderedTemplate);\n $('#chooseBonusProductModal .modal-body').empty();\n $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage);\n $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText);\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 * (Remove the SFRA alert message)\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n $('.minicart').trigger('count:update', response);\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\n/**\n * Return an property of an element of a form\n *\n * @param {object} form - DOM form\n * @param {string} element - DOM element (id, class...)\n * @param {string} property - DOM property element\n * @return {string} - Content of a prop\n */\nfunction getPropertyElementForm(form, element, property) {\n return form.find(element).prop(property);\n}\n\n/**\n * Return an data of an element of a form\n *\n * @param {object} form - DOM form\n * @param {string} element - DOM element (id, class...)\n * @param {string} data - DOM data element\n * @return {string} - Content of a data\n */\nfunction getDataElementForm(form, element, data) {\n return form.find(element).data(data);\n}\n\n/**\n * Return an data of an element of a form\n *\n * @param {object} form - DOM form\n * @param {string} element - DOM element (id, class...)\n * @param {string} data - DOM data element\n * @param {object} error - object with errors\n */\nfunction addErrorForm(form, element, data, error) {\n var inputName = getPropertyElementForm(form, element, 'name');\n error[inputName] = getDataElementForm(form, element, data);\n}\n\n/**\n * Function to validate fields form\n *\n * @return {Object} - with error\n */\nfunction getErrorsPersonalizationForm(personalizationForm, name1, name2, date) {\n // Validations\n var MAX_LENGTH_NAME1 = 16;\n var MAX_LENGTH_NAME2 = 16;\n var MAX_LENGTH_DATE = 16;\n var error = {};\n\n if (!name1 || name1.length > MAX_LENGTH_NAME1) {\n addErrorForm(personalizationForm, '#name1', !name1 ? 'missing-error' : 'range-error', error);\n }\n if (!name2 || name2.length > MAX_LENGTH_NAME2) {\n addErrorForm(personalizationForm, '#name2', !name2 ? 'missing-error' : 'range-error', error);\n }\n if (date.length > MAX_LENGTH_DATE) {\n addErrorForm(personalizationForm, '#date', 'range-error', error);\n }\n return $.isEmptyObject(error) ? null : [error];\n}\n\n/**\n * Function to validate personalization form\n *\n * @return {Object} - with form serialize and boolean with isCustomizable\n */\nfunction validatePersonalizationForm() {\n var idPersonalizationForm = '#personalization-form';\n formHelpers.clearPreviousErrors(idPersonalizationForm);\n var personalizationForm = $(idPersonalizationForm);\n var personalizationFormSerialize = personalizationForm.serialize();\n var isCustomizable = false;\n var valid = true;\n var name1 = personalizationForm.find('#name1').val();\n var name2 = personalizationForm.find('#name2').val();\n var date = personalizationForm.find('#date').val();\n if (personalizationForm && personalizationForm.length > 0) {\n isCustomizable = true;\n var errors = getErrorsPersonalizationForm(personalizationForm, name1, name2, date);\n if (errors && errors.length > 0) {\n valid = false;\n personalizationForm.find('#name1').focus();\n errors.forEach(function (error) {\n if (Object.keys(error).length) {\n // formHelpers.loadFormErrors(idPersonalizationForm, error);\n $.each(error, function (attr) {\n $('*[name=' + attr + ']', idPersonalizationForm)\n .addClass('is-invalid')\n .siblings('.invalid-feedback')\n .html(error[attr]);\n });\n }\n });\n }\n }\n return {\n name1 : name1,\n name2 : name2,\n date : date,\n valid : valid,\n isCustomizable : isCustomizable,\n personalizationFormSerialize : personalizationFormSerialize\n };\n}\n\n/**\n * Makes a call to the server to report the event of adding an item to the cart\n *\n * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false\n */\nfunction miniCartReportingUrl(url) {\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function () {\n // reporting urls hit on the server\n },\n error: function () {\n // no reporting urls hit on the server\n }\n });\n }\n}\n\nmodule.exports = {\n attributeSelect: attributeSelect,\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n }\n },\n\n focusChooseBonusProductModal: function () {\n $('body').on('shown.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'true');\n $('#chooseBonusProductModal .close').focus();\n });\n },\n\n onClosingChooseBonusProductModal: function () {\n $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'false');\n });\n },\n\n trapChooseBonusProductModalFocus: function () {\n $('body').on('keydown', '#chooseBonusProductModal', function (e) {\n var focusParams = {\n event: e,\n containerSelector: '#chooseBonusProductModal',\n firstElementSelector: '.close',\n lastElementSelector: '.add-bonus-products'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n\n colorAttribute: function () {\n $(document).on('touchstart click', '[data-attr=\"color\"] button', function (e) {\n e.preventDefault();\n var isSelected = $(this).find('span').hasClass('selected');\n if ($(this).attr('disabled') || isSelected) {\n return;\n }\n var updateUrlSwatch = true;\n var $productContainer;\n $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n $('.js-product-list-size').removeClass('selected');\n $('.js-product-list-size-modal').removeClass('selected');\n attributeSelect($(this).attr('data-url'), $productContainer, updateUrlSwatch);\n });\n },\n\n selectAttribute: function () {\n $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n e.preventDefault();\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n var updateUrlSwatch = false;\n attributeSelect(e.currentTarget.value, $productContainer, updateUrlSwatch);\n });\n },\n\n availability: function () {\n $(document).on('change', '.quantity-select', function (e) {\n e.preventDefault();\n\n var searchPID = $(this).closest('.product-detail').attr('data-pid');\n var selectorPrefix = '.product-detail[data-pid=\"' + searchPID + '\"]';\n\n if ($(selectorPrefix + ' .selected-store-with-inventory').is(':visible')) {\n return;\n }\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 var updateUrlSwatch = true;\n attributeSelect($(e.currentTarget).find('option:selected').data('url'),\n $productContainer, updateUrlSwatch);\n }\n });\n },\n\n addToCart: function () {\n $(document).on('touchstart click', 'button.add-to-cart, button.add-to-cart-global, button.add-to-cart-no-checkout', function () {\n var addToCartUrl;\n var pid;\n var pidsObj;\n var setPids;\n var goToCheckout = $(this).hasClass('add-to-cart');\n\n var personalizationForm = validatePersonalizationForm();\n if (!personalizationForm.valid) {\n return;\n }\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 personalizationForm: personalizationForm.personalizationFormSerialize,\n isCustomizable: personalizationForm.isCustomizable,\n name1: personalizationForm.name1,\n name2: personalizationForm.name2,\n date: personalizationForm.date\n };\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n var addToCartEvent = $(this).hasClass('add-to-cart-recommendation-btn') ? 'addToCartRecommendation' : 'addToCart';\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 /* Añadir datalayer push, lo ponemos aquí ya que si no selecciona talla, se\n realiza la petición pero no devuelve un succes, por lo que solo si lo ponemos aquí saltará una vez. */\n /* eslint-disable no-undef */\n dataLayer.push({\n event: addToCartEvent\n });\n handlePostCartAdd(data);\n if (goToCheckout) {\n $('body').trigger('product:afterAddToCart', data);\n } else {\n if ($('#quickViewModal').length) {\n $('#quickViewModal').modal('hide');\n }\n $('body').trigger('cart:update', data);\n }\n $.spinner().stop();\n miniCartReportingUrl(data.reportingURL);\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n });\n },\n selectBonusProduct: function () {\n $(document).on('touchstart 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($choiceOfBonusProduct.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 = $choiceOfBonusProduct.find('.product-option').data('option-id');\n var valueId = $choiceOfBonusProduct.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('touchstart 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 || !response.product.availablePrice));\n var pid = response.product.id;\n $('button.select-bonus-product', response.$productContainer).data('pid', pid);\n });\n },\n showMoreBonusProducts: function () {\n $(document).on('touchstart 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('touchstart 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 $('#chooseBonusProductModal').modal('hide');\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
      ');\n }\n $('.add-to-cart-messages').append(\n '
      '\n + data.errorMessage + '
      '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 3000);\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 $('.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 }, 1500);\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected,\n miniCartReportingUrl: miniCartReportingUrl,\n customSelectSize: function () {\n $('select.select-size').on('change', function () {\n var selectedSize = $('select.select-size option:selected');\n if (selectedSize.hasClass('disabled')) {\n return;\n }\n var size = selectedSize.data('attr-value');\n var value = selectedSize.val();\n $('.product-sizes__selector .js-product-list-size').removeClass('selected');\n $('.product-sizes__selector .js-product-list-size[data-attr-value=' + size + ']').addClass('selected');\n if (size && value) {\n changeAddToCartSizeSelectorButton();\n } else {\n changeAddToCartButton();\n }\n });\n\n var clearSelectClasses = function () {\n $('.product-sizes__selector .js-product-list-size').removeClass('selected');\n $('.email-size-available-white').addClass('email-size-available');\n $('.email-size-available-white').removeClass('email-size-available-white');\n $('.select-size option').removeAttr('selected');\n $('#notifySizeButton').removeClass('d-none');\n $('#notificationSucces').addClass('d-none');\n $('#notificationFail').addClass('d-none');\n $('#buyButton').removeClass('add-to-cart');\n $('#buyButton').addClass('add-to-cart-size-selector');\n $('#buyButton').attr('data-target', '#sizeSelectorModal');\n $('#buyButtonBlock .prices').removeClass('top');\n\n // Recoremos las tallas del modal, y también quitamos la seleccion, ya que si se abre el modal, aparecería la última talla seleccionada.\n $('.js-product-list-size-modal').removeClass('selected');\n $('.js-product-list-size-modal').each(function () {\n $(this)[0].childNodes.forEach(function (child) {\n if (child.nodeName == 'DIV' && child.className.includes('icon email-size-available')) {\n child.remove();\n }\n });\n });\n };\n\n var addSelectClasses = function (sizeObject) {\n var value = sizeObject.data('attr-value');\n sizeObject.addClass('selected');\n $('.select-size option[data-attr-value=\"' + value + '\"]').prop('selected', true);\n };\n\n $('.js-product-list-size').on('click', function () {\n var sizeObject = $(this);\n var notificationSizeIcon = sizeObject.children('.icon.email-size-available');\n\n // Mostramos el bloque para introducir el email y avisar cuando entre stock de la talla.\n if (sizeObject.hasClass('selected') && sizeObject.attr('data-attr-stock') == '0.0' && sizeObject.attr('data-attr-value') !== 'U' || (notificationSizeIcon && notificationSizeIcon.length > 0)) {\n clearSelectClasses();\n $('#closeNotify').trigger('click');\n\n notificationSizeIcon.length > 0 ?\n notificationSizeIcon.addClass('email-size-available-white') :\n notificationSizeIcon.removeClass('email-size-available');\n\n addSelectClasses(sizeObject);\n\n $('#buyButton').addClass('d-none');\n $('#notifySizeBlock').removeClass('d-none');\n $('#notificationInfo').removeClass('d-none');\n $('.prices.d-lg-none.col-3').addClass('top');\n } else {\n notificationSizeIcon.addClass('email-size-available');\n notificationSizeIcon.removeClass('email-size-available-white');\n $('#buyButton').removeClass('d-none');\n $('#inputEmailBlock').addClass('d-none');\n $('#notifySizeBlock').addClass('d-none');\n }\n\n var isSelected = sizeObject.hasClass('selected') || sizeObject.hasClass('unselectable') || sizeObject.hasClass('disabled');\n if (isSelected) {\n return;\n }\n\n clearSelectClasses();\n addSelectClasses(sizeObject);\n $('select.select-size').trigger('change');\n });\n\n $('#closeNotify').on('click', function () {\n clearSelectClasses();\n $('#notifySizeBlock').addClass('d-none');\n $('#buyButton').removeClass('d-none');\n $('#inputEmailBlock').addClass('d-none');\n $('#closeNotify').addClass('d-none');\n });\n\n $('#notifySizeButton').on('click', function () {\n $('.prices.d-lg-none.col-3').addClass('top');\n $('#notifySizeButton').addClass('d-none');\n $('#inputEmailBlock').removeClass('d-none');\n $('#inputEmailBlock').addClass('fade-in-block');\n $('#closeNotify').addClass('fade-in-block');\n $('#closeNotify').removeClass('d-none');\n\n if ($(window).width() < 768) {\n $('#infoProductContainer').get(0).scrollIntoView({ behavior: 'smooth' });\n }\n });\n\n $('#notifyButtonEmail').on('click', function (e) {\n // Validamos el email introducido por el usuario y ya realizamos llamada al controlador para guardar email en custom object.\n var inputEmail = $('#customerEmail').val();\n inputEmail = inputEmail.trim();\n e.preventDefault();\n\n if (inputEmail !== '' && /^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(inputEmail)) {\n var actionUrl = $('#sizeReminderForm').attr('action');\n var itemSelected =\n $('.js-product-list-size.swatch-rectangle.unselectable.disabled.selected');\n\n $('#notify-email-error').css('display', 'none');\n $('#customerEmail').val(inputEmail);\n $('#ean').val(itemSelected.attr('data-attr-ean'));\n $('#size').val(itemSelected.attr('data-attr-value'));\n\n $.spinner().start();\n var formData = $('#sizeReminderForm');\n\n $.ajax({\n url: actionUrl,\n method: 'POST',\n data: formData.serialize(),\n success: function (response) {\n $.spinner().stop();\n if (response && !response.succes) {\n console.error(response.message);\n }\n\n $('#buyButtonBlock .prices').removeClass('top');\n $('#notificationInfo').addClass('d-none');\n $('#inputEmailBlock').addClass('d-none');\n $('#notificationSucces').removeClass('d-none');\n\n // Datalayer push para evento Alerta Tallas de GA4.\n dataLayer.push({\n event: 'Solicitud Alerta Talla',\n Categoria : 'Solicitud Alerta Talla',\n Accion : 'Solicitud de aviso de disponibiliad de talla por cliente',\n Etiqueta : window.location.href\n });\n },\n error: function () {\n $.spinner().stop();\n }\n });\n } else {\n var emailError = $('#customerEmail').attr('data-error-email');\n $('#notify-email-error').text(emailError);\n $('#notify-email-error').css('display', 'block');\n return;\n }\n });\n },\n sizeSelectorAddToCartModal: function () {\n $('body').on('click', '.js-product-list-size-modal', function (e) {\n e.preventDefault();\n var sizeObject = $(this);\n var isSelected = sizeObject.hasClass('unselectable') || sizeObject.hasClass('disabled');\n if (isSelected) {\n return;\n }\n var size = $(this).data('attr-value');\n $('.js-product-list-size-modal').removeClass('selected');\n $(this).addClass('selected');\n $('.select-size option').removeAttr('selected');\n $('.select-size option[data-attr-value=\"' + size + '\"]').prop('selected', true);\n // Close modal, select size and add to cart.\n $('.sizeSelectorModalClass').modal('hide');\n if ($('button.add-to-cart-size-selector').length) {\n $('button.add-to-cart-size-selector').blur();\n }\n // Select size.\n $('.js-product-list-size').each(function () {\n if ($(this).data('attr-value') === size) {\n $(this).fadeIn().delay(500).queue(function () {\n $(this).click();\n changeAddToCartSizeSelectorButton();\n $('button.add-to-cart').fadeIn().delay(500).queue(function () {\n $(this).focus();\n $(this).click();\n });\n });\n }\n });\n });\n },\n updateIcons: updateIcons,\n updateAvailability: updateAvailability,\n updateOptions: updateOptions,\n updateQuantities: updateQuantities,\n handlePostCartAdd : handlePostCartAdd\n};\n","'use strict';\n\nvar base = require('./base');\nvar handleADA = require('../common/handleADA');\n\nvar mediaBreakLimit = 992;\nvar mainGallery =\n{\n lazyLoad : 'ondemand',\n dots : true,\n arrows : false,\n infinite : false,\n vertical : false,\n slidesToShow : 1,\n slidesToScroll : 1\n};\n\nvar optionsType =\n{\n dots : false,\n arrows : true,\n infinite : true,\n vertical : false,\n slidesToShow : 4,\n slidesToScroll : 1,\n responsive : [{\n breakpoint : 1200,\n settings : {\n slidesToShow : 3,\n slidesToScroll : 1,\n arrows : true\n }\n },\n {\n breakpoint : 991,\n settings : {\n slidesToShow : 3,\n slidesToScroll : 1,\n arrows : true\n }\n },\n {\n breakpoint : 768,\n settings : {\n slidesToShow : 2,\n slidesToScroll : 1,\n arrows : true\n }\n },\n {\n breakpoint : 500,\n settings : {\n slidesToShow : 2,\n slidesToScroll : 1,\n arrows : true\n }\n }]\n};\n\n/** Fix carousel trigger keyboard */\n$(document).bind('keyup', function (e) {\n if (e.which == 39) {\n $('.carousel').carousel('next');\n } else if (e.which == 37) {\n $('.carousel').carousel('prev');\n }\n});\n\n/**\n * Enable/disable UI elements\n * @param {boolean} enableOrDisable - true or false\n */\nfunction updateAddToCartEnableDisableOtherElements(enableOrDisable) {\n $('button.add-to-cart-global').attr('disabled', enableOrDisable);\n}\n\nfunction showLightbox() {\n $('#galleryBox').slickLightbox({\n navigateByKeyboard: true,\n background: 'rgba(255,255,255,1)',\n lazy: true\n }).on({\n 'show.slickLightbox': function () {\n $('meta[name=\"viewport\"]').attr('content', 'width=device-width, initial-scale=1');\n },\n 'hide.slickLightbox': function () {\n $('meta[name=\"viewport\"]').attr('content', 'width=device-width, initial-scale=1, maximum-scale=1');\n $('#galleryBox').unslickLightbox();\n }\n });\n}\n\n/** Inicializacion del slick slider en la galeria principal */\nfunction showMainGalleryMobile() {\n var deviceScreenWidth = $(window).width();\n if (deviceScreenWidth < mediaBreakLimit) {\n if (!$('#galleryBox').hasClass('slick-initialized')) {\n $('#galleryBox').slick(mainGallery);\n $('.slick-lightbox').remove();\n $('.slick-current.slick-active').on('click', function () {\n showLightbox();\n });\n }\n } else if ($('#galleryBox').hasClass('slick-initialized')) {\n $('#galleryBox').slick('unslick');\n }\n}\n/** cambia la posicion del título entre dispositivos */\nfunction changeProductName() {\n var deviceScreenWidth = $(window).width();\n if (deviceScreenWidth < mediaBreakLimit) {\n $('#mediaContainer').parent().prepend($('#nameProductContainer'));\n } else {\n $('#infoProductContainer').prepend($('#nameProductContainer'));\n }\n}\n\n/** Cambia la posicion de los bloques de informacion */\nfunction changeInfoPositions() {\n var deviceScreenWidth = $(window).width();\n if (deviceScreenWidth < mediaBreakLimit) {\n $('#recommendationsContainer').parent().prepend($('#descriptionContainer'));\n $('#recommendationsContainer').parent().prepend($('#sustainabilityContainer'));\n $('#recommendationsContainer').parent().prepend($('#shippingReturnsContainer'));\n $('#recommendationsContainer').parent().prepend($('#descriptionContainer'));\n $('#recommendationsContainer').parent().prepend($('#moreInfoContainer'));\n } else {\n $('#infoProductContainer').prepend($('#descriptionContainer'));\n $('#infoProductContainer').prepend($('#sustainabilityContainer'));\n $('#infoProductContainer').prepend($('#shippingReturnsContainer'));\n $('#infoProductContainer').prepend($('#descriptionContainer'));\n $('#infoProductContainer').prepend($('#moreInfoContainer'));\n }\n}\n\nfunction showMobileView() {\n showMainGalleryMobile();\n changeProductName();\n changeInfoPositions();\n}\n\nfunction ekomiName() {\n setTimeout(function () {\n var names = document.querySelectorAll('.reviews-stack .review_date');\n if (names.length > 0) {\n for (var nameIndex = 0; nameIndex < names.length; nameIndex++) {\n var name = names[nameIndex].firstChild.nodeValue.split(' ')[0];\n names[nameIndex].firstChild.nodeValue = name;\n }\n }\n }, 500);\n}\n\nmodule.exports = {\n methods: {\n updateAddToCartEnableDisableOtherElements: updateAddToCartEnableDisableOtherElements\n },\n availability: base.availability,\n addToCart: base.addToCart,\n showMainGalleryMobile: function () {\n $(document).ready(function () {\n showMobileView();\n });\n $(window).on('resize', function () {\n showMobileView();\n });\n },\n updateAttributesAndDetails: function () {\n $('body').on('product:statusUpdate', function (e, data) {\n var $productContainer = $('.product-detail[data-pid=\"' + data.id + '\"]');\n\n $productContainer.find('.description-and-detail .product-attributes')\n .empty()\n .html(data.attributesHtml);\n\n if (data.shortDescription) {\n $productContainer.find('.product-short-description')\n .removeClass('hidden-xl-down');\n $productContainer.find('.product-short-description').empty().html('

      ' + data.shortDescription + '

      ');\n } else {\n $productContainer.find('.product-short-description')\n .addClass('hidden-xl-down');\n }\n\n if (data.longDescription) {\n $productContainer.find('.description-and-detail .details')\n .removeClass('hidden-xl-down');\n $productContainer.find('.description-and-detail .details .content')\n .empty()\n .html(data.longDescription);\n } else {\n $productContainer.find('.description-and-detail .details')\n .addClass('hidden-xl-down');\n }\n });\n },\n showSpinner: function () {\n $('body').on('product:beforeAddToCart product:beforeAttributeSelect', function () {\n $.spinner().start();\n });\n },\n updateAttribute: function () {\n $('body').on('product:afterAttributeSelect', function (e, response) {\n if ($('.product-detail>.bundle-items').length) {\n response.container.data('pid', response.data.product.id);\n response.container.find('.product-id').text(response.data.product.id);\n } else if ($('.product-set-detail').eq(0)) {\n response.container.data('pid', response.data.product.id);\n response.container.find('.product-id').text(response.data.product.id);\n } else {\n $('.product-id').text(response.data.product.id);\n $('.product-detail:not(\".bundle-item\")').data('pid', response.data.product.id);\n }\n });\n },\n updateAddToCart: function () {\n $('body').on('product:updateAddToCart', function (e, response) {\n // update local add to cart (for sets)\n $('button.add-to-cart', response.$productContainer).attr('disabled',\n (!response.product.availableCountry || !response.product.readyToOrder || !response.product.available || !response.product.availablePrice));\n\n var enable = $('.product-availability').toArray().every(function (item) {\n return $(item).data('availableCountry') && $(item).data('available') && $(item).data('ready-to-order');\n });\n module.exports.methods.updateAddToCartEnableDisableOtherElements(!enable);\n });\n },\n updateAvailability: function () {\n $('body').on('product:updateAvailability', function (e, response) {\n $('div.availability', response.$productContainer)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available && response.product.availablePrice);\n\n $('.availability-msg', response.$productContainer)\n .empty().html(response.message);\n\n if ($('.global-availability').length) {\n var allAvailable = $('.product-availability').toArray()\n .every(function (item) { return $(item).data('available'); });\n\n var allReady = $('.product-availability').toArray()\n .every(function (item) { return $(item).data('ready-to-order'); });\n\n $('.global-availability')\n .data('ready-to-order', allReady)\n .data('available', allAvailable);\n\n $('.global-availability .availability-msg').empty()\n .html(allReady ? response.message : response.resources.info_selectforstock);\n }\n });\n },\n sizeChart: function () {\n $('.size-chart a').on('touchstart click', function (e) {\n e.preventDefault();\n var url = $(this).attr('href');\n var $prodSizeChart = $(this).closest('.size-chart').find('.size-chart-collapsible');\n if ($prodSizeChart.is(':empty')) {\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $prodSizeChart.append(data.content);\n },\n error: function (err) {\n console.error(err);\n }\n });\n }\n $prodSizeChart.toggleClass('active');\n });\n\n var $sizeChart = $('.size-chart-collapsible');\n $('body').on('touchstart click', function (e) {\n if ($('.size-chart').has(e.target).length <= 0) {\n $sizeChart.removeClass('active');\n }\n });\n },\n copyProductLink: function () {\n $('body').on('touchstart click', '#fa-link', function () {\n event.preventDefault();\n var $temp = $('');\n $('body').append($temp);\n $temp.val($('#shareUrl').val()).select();\n document.execCommand('copy');\n $temp.remove();\n $('.copy-link-message').attr('role', 'alert');\n $('.copy-link-message').removeClass('d-none');\n setTimeout(function () {\n $('.copy-link-message').addClass('d-none');\n }, 3000);\n });\n },\n showRecommendations: function () {\n $(document).ready(function () {\n var carruselType = ['recommendationType1', 'recommendationType2'];\n $.each(carruselType, function (index, value) {\n var carrusel = $('#' + value + ' div[id^=\"pdpCarouselRecomendations-\"]');\n var items = $('#' + value + ' div[id^=\"pdpCarouselRecomendations-\"]').length;\n if (items > 0) {\n carrusel.slick(optionsType);\n }\n });\n });\n },\n openWhatsapp: function () {\n $('.icon-wh').on('click', function (e) {\n e.preventDefault();\n window.open(\n this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600'\n );\n return false;\n });\n },\n fixedAddCartButton: function () {\n $(window).on('scroll', function () {\n if ((window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) < 769) {\n var footerHeight = $('footer')[0].clientHeight;\n var footerIsVisible = document.scrollingElement.scrollHeight - document.scrollingElement.scrollTop - footerHeight <= window.innerHeight;\n if (footerIsVisible) {\n $('.prices-add-to-cart-actions').eq(0).css({ position: 'absolute', bottom: '-' + ($('.prices-add-to-cart-actions')[0].clientHeight + 20) + 'px', 'box-shadow': 'none' });\n $('#maincontent').css('margin-bottom', ($('.prices-add-to-cart-actions')[0].clientHeight + 20) + 'px');\n } else {\n $('.prices-add-to-cart-actions').eq(0).css({ position: '', bottom: '', 'box-shadow': '' });\n }\n } else {\n $('.prices-add-to-cart-actions').eq(0).css({ position: '', bottom: '', 'box-shadow': '' });\n }\n });\n },\n stickyRigthColumn: function () {\n $(window).scroll(function () {\n var rigthColumn = $('#sticky-product-details');\n if ($(window).scrollTop() >= 1800) {\n rigthColumn.removeClass('product-details-fixed-top');\n rigthColumn.addClass('product-details-fixed-bottom');\n $('.page').css('overflow-x', 'hidden');\n } else if ($(window).scrollTop() >= 30) {\n rigthColumn.addClass('product-details-fixed-top');\n $('.page').css('overflow-x', 'unset');\n rigthColumn.removeClass('product-details-fixed-bottom');\n if ($('.search').hasClass('active')) {\n rigthColumn.addClass('search-add-top');\n } else {\n rigthColumn.removeClass('search-add-top');\n }\n } else {\n rigthColumn.removeClass('product-details-fixed-top');\n $('.page').css('overflow-x', 'hidden');\n rigthColumn.removeClass('product-details-fixed-bottom');\n }\n });\n },\n focusChooseBonusProductModal: base.focusChooseBonusProductModal,\n sizeSelectorAddToCartModal: base.sizeSelectorAddToCartModal,\n pressEnterAndClickInElementRecommedations: handleADA.pressEnterToClickInsideElement('.pdpRecommendation', '.tile-body', 'button'),\n pressEnterAndClickInElementSizes: handleADA.pressEnterToClickInsideElement('.attribute > ul', 'li', 'li'),\n pressEnterAndClickInElementDescriptionAndDetail: handleADA.pressEnterToClickInsideElement('.description-and-detail', '.collapsible-xl', 'h2'),\n focusNextElementOutsidefromCollapsibleInfoWhenIsClosedAndPressTab: handleADA.focusNextElementOutsidefromContainerWhenPressTab('.description-and-detail > div:nth-child(3)', 'active', '.icon-fb'),\n collapsibleInfoItems: function () {\n $('.collapsible').on('click', function (event) {\n if ($(event.target).closest('.content').length) {\n return;\n }\n\n var current = $(this);\n if (current.hasClass('active')) {\n current.removeClass('active');\n current.attr('aria-expanded', false);\n } else {\n var currentId = current.parent().attr('id');\n $('.collapsible').each(function () {\n var collapsible = $(this);\n var id = collapsible.parent().attr('id');\n if (currentId != id) {\n if (collapsible.hasClass('active')) {\n collapsible.removeClass('active');\n collapsible.attr('aria-expanded', false);\n }\n } else {\n collapsible.addClass('active');\n collapsible.attr('aria-expanded', true);\n }\n });\n }\n });\n },\n customSelectSize: base.customSelectSize,\n ekomiScroll: function () {\n $('.ekomi-widget-container').click(function (e) {\n e.preventDefault();\n var id = '#reviewsContainer';\n $('html,body').animate({ scrollTop: $(id).offset().top - 100 }, 1000);\n });\n },\n ekomiName: ekomiName,\n moreReviews: function () {\n setTimeout(function () {\n var names = document.querySelectorAll('.reviews-stack .review_date');\n if (names.length > 0) {\n for (var nameIndex = 0; nameIndex < names.length; nameIndex++) {\n var name = names[nameIndex].firstChild && names[nameIndex].firstChild.nodeValue && names[nameIndex].firstChild.nodeValue.split(' ')[0];\n if (names[nameIndex].firstChild && names[nameIndex].firstChild.nodeValue) {\n names[nameIndex].firstChild.nodeValue = name;\n }\n }\n }\n var button = document.querySelectorAll('.read-more-reviews');\n for (var i = 0; i < button.length; i++) {\n button[i].addEventListener('click', function () {\n ekomiName();\n });\n }\n }, 3500);\n },\n createCarouselDesktop: function () {\n $(document).ready(function () {\n var carrusel = $('#zoom #image-container');\n\n carrusel.css({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n width: '100%',\n height: '100%'\n });\n\n var slides = $('#zoom #image-container picture.zoom-slide');\n slides.css({\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: '100%',\n display: 'none'\n });\n\n slides.first().css('display', 'block');\n });\n },\n closeZoomDesktop: function () {\n $('#zoom').click(function (event) {\n if (event.target.id == $('#zoom').attr('id')) {\n $('#zoom').addClass('d-none');\n var parentZoom = $('#zoom #image-container');\n parentZoom.trigger('zoom.destroy');\n }\n });\n\n $('#zoom .close').click(function () {\n $('#zoom').addClass('d-none');\n var parentZoom = $('#zoom #image-container');\n parentZoom.trigger('zoom.destroy');\n });\n\n $('#zoom .navigation').click(function (event) {\n if (!event.target.className.includes('left') && !event.target.className.includes('right')) {\n $('#zoom').addClass('d-none');\n var parentZoom = $('#zoom #image-container');\n parentZoom.trigger('zoom.destroy');\n }\n });\n },\n\n openZoomDesktop: function () {\n $('#galleryBox div[class^=\"mediaBox-\"]').click(function () {\n var deviceScreenWidth = $(window).width();\n if (deviceScreenWidth >= mediaBreakLimit) {\n var parentZoom = $('#zoom #image-container');\n\n var clickedIndex = $(this).index();\n\n var currentSlide = $('#zoom #image-container picture.zoom-slide').eq(clickedIndex);\n\n $('#zoom #image-container picture.zoom-slide').removeClass('current').hide();\n currentSlide.addClass('current').show();\n\n $('#zoom').removeClass('d-none');\n\n parentZoom.trigger('zoom.destroy');\n\n var zoomImageSrc = currentSlide.find('source').attr('srcset').split(',')[0].trim().split(' ')[0];\n\n parentZoom.zoom({\n on: 'grab',\n url: zoomImageSrc,\n onZoomIn: function () {\n $(this).css('cursor', 'zoom-out');\n },\n onZoomOut: function () {\n $(this).css('cursor', 'zoom-in');\n }\n });\n }\n });\n },\n\n navigateZoomDesktop: function () {\n function loopSlide(node, direction) {\n $.spinner().start();\n var parentZoom = $('#zoom #image-container');\n parentZoom.zoom().trigger('zoom.destroy');\n\n var currentSlide = $('#zoom #image-container picture.zoom-slide.current');\n currentSlide.removeClass('current').hide();\n\n if (node.length == 0) {\n var allSlides = $('#zoom #image-container picture.zoom-slide');\n if (direction === 'right') {\n node = currentSlide.next().length ? currentSlide.next() : allSlides.first();\n } else {\n node = currentSlide.prev().length ? currentSlide.prev() : allSlides.last();\n }\n }\n\n node.show().addClass('current');\n\n var zoomImageSrc = node.find('source').attr('srcset').split(',')[0].trim().split(' ')[0];\n\n parentZoom.zoom({\n on: 'grab',\n url: zoomImageSrc,\n onZoomIn: function () {\n $(this).css('cursor', 'zoom-out');\n },\n onZoomOut: function () {\n $(this).css('cursor', 'zoom-in');\n }\n });\n\n $.spinner().stop();\n }\n\n $('#zoom .navigation .right').click(function () {\n var next = $('#zoom #image-container picture.zoom-slide.current').next('picture.zoom-slide');\n loopSlide(next, 'right');\n });\n\n $('#zoom .navigation .left').click(function () {\n var prev = $('#zoom #image-container picture.zoom-slide.current').prev('picture.zoom-slide');\n loopSlide(prev, 'left');\n });\n },\n initTechnicalIconsSlider: function () {\n var container = document.querySelector('.technicalIconBlock');\n var slider = container.querySelector('ul');\n if (!slider) return;\n\n var isDown = false;\n var startX;\n var scrollLeft;\n\n /** Codigo que segun la resolucion marca si es mobile o no, y si es asi deja el justifycontent de manera fija, o si hay mas iconos de los esperados flex-start para realizar scroll */\n function updateLayout() {\n var items = slider.querySelectorAll('li');\n var itemCount = items.length;\n var isMobile = window.innerWidth <= 768;\n var limit = isMobile ? 4 : 7;\n\n if (itemCount <= limit) {\n slider.style.justifyContent = 'center';\n slider.style.width = '100%';\n } else {\n slider.style.justifyContent = 'flex-start';\n slider.style.width = 'max-content';\n }\n }\n\n function startDragging(e) {\n isDown = true;\n container.style.cursor = 'grabbing';\n startX = e.type.includes('mouse') ? e.pageX : e.touches[0].pageX;\n scrollLeft = container.scrollLeft;\n }\n\n function stopDragging() {\n isDown = false;\n container.style.cursor = 'grab';\n }\n\n function drag(e) {\n if (!isDown) return;\n e.preventDefault();\n var x = e.type.includes('mouse') ? e.pageX : e.touches[0].pageX;\n var walk = (x - startX) * 2;\n container.scrollLeft = scrollLeft - walk;\n }\n\n updateLayout();\n window.addEventListener('resize', updateLayout);\n\n container.addEventListener('mousedown', startDragging);\n container.addEventListener('touchstart', startDragging);\n\n document.addEventListener('mousemove', drag);\n document.addEventListener('touchmove', drag);\n\n document.addEventListener('mouseup', stopDragging);\n document.addEventListener('touchend', stopDragging);\n\n container.addEventListener('mouseleave', stopDragging);\n }\n};\n","'use strict';\n\nvar base = require('./base');\nvar focusHelper = require('base/components/focus');\n\n/**\n * Generates the modal window on the first call.\n *\n */\n\nfunction getModalHtmlElement() {\n if ($('#quickViewModal').length !== 0) {\n $('#quickViewModal').remove();\n }\n var htmlString = ''\n + '
      '\n + ''\n + '
      '\n + ''\n + '
      '\n + '
      '\n + ' '\n + ' '\n + '
      '\n + '
      '\n + '
      '\n + '
      '\n + '
      '\n + '
      ';\n $('body').append(htmlString);\n}\n\n/**\n * @typedef {Object} QuickViewHtml\n * @property {string} body - Main Quick View body\n * @property {string} footer - Quick View footer content\n */\n\n/**\n * Parse HTML code in Ajax response\n *\n * @param {string} html - Rendered HTML from quickview template\n * @return {QuickViewHtml} - QuickView content components\n */\nfunction parseHtml(html) {\n var $html = $('
      ').append($.parseHTML(html));\n\n var body = $html.find('.product-quickview');\n var footer = $html.find('.modal-footer').children();\n\n return { body: body, footer: footer };\n}\n\n/**\n * replaces the content in the modal window on for the selected product variation.\n * @param {string} selectedValueUrl - url to be used to retrieve a new product model\n */\nfunction fillModalElement(selectedValueUrl) {\n $('.modal-body').spinner().start();\n $.ajax({\n url : selectedValueUrl,\n method : 'GET',\n dataType : 'json',\n success : function (data) {\n var parsedHtml = parseHtml(data.renderedTemplate);\n\n $('.modal-body').empty();\n $('.modal-body').html(parsedHtml.body);\n $('.modal-footer').html(parsedHtml.footer);\n $('.view-details-link').text(data.quickViewFullDetailMsg);\n $('#quickViewModal .view-details-link').attr('href', data.productUrl);\n $('#quickViewModal .size-chart').attr('href', data.productUrl);\n $('#quickViewModal .modal-header .close .sr-only').text(data.closeButtonText);\n $('#quickViewModal .enter-message').text(data.enterDialogMessage);\n $('#quickViewModal').modal('show');\n $('body').trigger('quickview:ready');\n base.customSelectSize();\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\nmodule.exports = {\n showQuickview: function () {\n $('body').on('click', '.quickview', function (e) {\n e.preventDefault();\n var selectedValueUrl = $(this).closest('a.quickview').attr('href');\n $(e.target).trigger('quickview:show');\n getModalHtmlElement();\n fillModalElement(selectedValueUrl);\n });\n },\n focusQuickview: function () {\n $('body').on('shown.bs.modal', '#quickViewModal', function () {\n $('#quickViewModal .close').focus();\n });\n },\n trapQuickviewFocus: function () {\n $('body').on('keydown', '#quickViewModal', function (e) {\n var focusParams = {\n event : e,\n containerSelector : '#quickViewModal',\n firstElementSelector : '.full-pdp-link',\n lastElementSelector : '.add-to-cart-global',\n nextToLastElementSelector : '.modal-footer .quantity-select'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n availability : base.availability,\n addToCart : base.addToCart,\n showSpinner : function () {\n $('body').on('product:beforeAddToCart', function (e, data) {\n $(data).closest('.modal-content').spinner().start();\n });\n },\n hideDialog: function () {\n $('body').on('product:afterAddToCart', function () {\n $('#quickViewModal').modal('hide');\n });\n },\n beforeUpdateAttribute: function () {\n $('body').on('product:beforeAttributeSelect', function () {\n $('.modal.show .modal-content').spinner().start();\n });\n },\n updateAttribute: function () {\n $('body').on('product:afterAttributeSelect', function (e, response) {\n if ($('.modal.show .product-quickview>.bundle-items').length) {\n $('.modal.show').find(response.container).data('pid', response.data.product.id);\n $('.modal.show').find(response.container)\n .find('.product-id').text(response.data.product.id);\n } else if ($('.set-items').length) {\n response.container.find('.product-id').text(response.data.product.id);\n } else {\n $('.modal.show .product-quickview').data('pid', response.data.product.id);\n $('.modal.show .view-details-link')\n .attr('href', response.data.product.selectedProductUrl);\n }\n });\n },\n updateAddToCart: function () {\n $('body').on('product:updateAddToCart', function (e, response) {\n // update local add to cart (for sets)\n $('button.add-to-cart', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available || !response.product.availablePrice));\n\n // update global add to cart (single products, bundles)\n var dialog = $(response.$productContainer)\n .closest('.quick-view-dialog');\n\n $('.add-to-cart-global', dialog).attr('disabled',\n !$('.global-availability', dialog).data('ready-to-order')\n || !$('.global-availability', dialog).data('available')\n );\n });\n },\n updateAvailability: function () {\n $('body').on('product:updateAvailability', function (e, response) {\n // bundle individual products\n $('.product-availability', response.$productContainer)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available && response.product.availablePrice)\n .find('.availability-msg')\n .empty()\n .html(response.message);\n\n\n var dialog = $(response.$productContainer)\n .closest('.quick-view-dialog');\n\n if ($('.product-availability', dialog).length) {\n // bundle all products\n var allAvailable = $('.product-availability', dialog).toArray()\n .every(function (item) { return $(item).data('available'); });\n\n var allReady = $('.product-availability', dialog).toArray()\n .every(function (item) { return $(item).data('ready-to-order'); });\n\n $('.global-availability', dialog)\n .data('ready-to-order', allReady)\n .data('available', allAvailable);\n\n $('.global-availability .availability-msg', dialog).empty()\n .html(allReady ? response.message : response.resources.info_selectforstock);\n } else {\n // single product\n $('.global-availability', dialog)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available && response.product.availablePrice)\n .find('.availability-msg')\n .empty()\n .html(response.message);\n }\n });\n },\n hideModalResize: function () {\n $(window).resize(function () {\n if ($(window).width() < 992) {\n $('#quickViewModal').modal('hide');\n }\n });\n },\n customSelectSize: base.customSelectSize\n};\n","'use strict';\n\nvar quickViewBase = require('../product/quickView');\nvar base = require('../product/base');\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 * @param {Boolean} updateRecommendationsProduct - Update recommendations product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n var isChoiceOfBonusProducts =\n $productContainer.parents('.choose-bonus-product-dialog').length > 0;\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 $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n\n //\n base.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 icons.\n base.updateIcons(response.product, $productContainer);\n}\n\n/**\n * updates the recommendation product view when a recommendation 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 attributeSelectRecommendation(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelectRecommendation',\n { url: selectedValueUrl, container: $productContainer });\n\n $.ajax({\n url : selectedValueUrl,\n method : 'GET',\n success : function (data) {\n handleVariantResponse(data, $productContainer);\n base.updateOptions(data.product.optionsHtml, $productContainer);\n base.updateQuantities(data.product.quantities, $productContainer);\n $('body').trigger('product:afterAttributeSelectRecommendation',\n { data: data, container: $productContainer });\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\n/**\n * Extended quickView without addToCart event. We make this change to avoid double events binded from PDP and Quickview recommendation used in PDP, when invoke addtocart\n */\nmodule.exports = {\n showSpinner: function () {\n $('body').on('product:beforeAttributeSelectRecommendation', function () {\n $.spinner().start();\n });\n },\n selectRecommendationAttribute: function () {\n $(document).on('change', 'select[class*=\"selectrecommendation-\"]', function (e) {\n e.preventDefault();\n var $productContainer = $(this).closest('.product-recommendation-detail');\n attributeSelectRecommendation(e.currentTarget.value, $productContainer);\n });\n },\n beforeUpdateAttribute: function () {\n $('body').on('product:beforeAttributeSelectRecommendation', function () {\n $('.modal.show .modal-content').spinner().start();\n });\n },\n updateAttributeRecommendation: function () {\n $('body').on('product:afterAttributeSelectRecommendation', function (e, response) {\n if ($('.modal.show .product-quickview>.bundle-items').length) {\n $('.modal.show').find(response.container).data('pid', response.data.product.id);\n $('.modal.show').find(response.container)\n .find('.product-recommendation-id').text(response.data.product.id);\n } else if ($('.set-items').length) {\n response.container.find('.product-recommendation-id').text(response.data.product.id);\n } else {\n $('.modal.show .product-quickview').data('pid', response.data.product.id);\n $('.modal.show .view-details-link')\n .attr('href', response.data.product.selectedProductUrl);\n }\n });\n },\n customRecommendationSelectSize: function () {\n $('body').on('touchstart click', '.js-recommendation-product-list-size', function () {\n var isSelected = $(this).hasClass('selected');\n if (isSelected) {\n return;\n }\n var size = $(this).attr('data-attr-value');\n $('.js-recommendation-product-list-size').removeClass('selected');\n $(this).addClass('selected');\n $('.selectrecommendation-size option').removeAttr('selected');\n $('.selectrecommendation-size option[data-attr-value=\"' + size + '\"]').prop('selected', true);\n $('.selectrecommendation-size').trigger('change');\n });\n },\n showQuickview : quickViewBase.showQuickview,\n hideDialog : quickViewBase.hideDialog,\n updateAddToCart : quickViewBase.updateAddToCart,\n updateAvailability : quickViewBase.updateAvailability,\n hideModalResize : quickViewBase.hideModalResize\n};\n","var processInclude = require('base/util');\n\n$(document).ready(function () {\n // Include base details\n processInclude(require('jquery-zoom'));\n processInclude(require('./product/detail'));\n\n // Gift Registry\n // try {\n // processInclude(require('giftregistry/product/giftRegistry'));\n // } catch (ex) {\n // plugin not in use\n // }\n\n // Instore pickup\n // try {\n // processInclude(require('instorepickup/product/pdpInstoreInventory'));\n // } catch (ex) {\n // plugin not in use\n // }\n\n try {\n processInclude(require('./product/recommendationQuickView'));\n } catch (ex) {\n console.log('Error at recommendation quickview script: ' + ex);\n }\n});\n","/*!\n\tZoom 1.7.21\n\tlicense: MIT\n\thttp://www.jacklmoore.com/zoom\n*/\n(function ($) {\n\tvar defaults = {\n\t\turl: false,\n\t\tcallback: false,\n\t\ttarget: false,\n\t\tduration: 120,\n\t\ton: 'mouseover', // other options: grab, click, toggle\n\t\ttouch: true, // enables a touch fallback\n\t\tonZoomIn: false,\n\t\tonZoomOut: false,\n\t\tmagnify: 1\n\t};\n\n\t// Core Zoom Logic, independent of event listeners.\n\t$.zoom = function(target, source, img, magnify) {\n\t\tvar targetHeight,\n\t\t\ttargetWidth,\n\t\t\tsourceHeight,\n\t\t\tsourceWidth,\n\t\t\txRatio,\n\t\t\tyRatio,\n\t\t\toffset,\n\t\t\t$target = $(target),\n\t\t\tposition = $target.css('position'),\n\t\t\t$source = $(source);\n\n\t\t// The parent element needs positioning so that the zoomed element can be correctly positioned within.\n\t\ttarget.style.position = /(absolute|fixed)/.test(position) ? position : 'relative';\n\t\ttarget.style.overflow = 'hidden';\n\t\timg.style.width = img.style.height = '';\n\n\t\t$(img)\n\t\t\t.addClass('zoomImg')\n\t\t\t.css({\n\t\t\t\tposition: 'absolute',\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\topacity: 0,\n\t\t\t\twidth: img.width * magnify,\n\t\t\t\theight: img.height * magnify,\n\t\t\t\tborder: 'none',\n\t\t\t\tmaxWidth: 'none',\n\t\t\t\tmaxHeight: 'none'\n\t\t\t})\n\t\t\t.appendTo(target);\n\n\t\treturn {\n\t\t\tinit: function() {\n\t\t\t\ttargetWidth = $target.outerWidth();\n\t\t\t\ttargetHeight = $target.outerHeight();\n\n\t\t\t\tif (source === target) {\n\t\t\t\t\tsourceWidth = targetWidth;\n\t\t\t\t\tsourceHeight = targetHeight;\n\t\t\t\t} else {\n\t\t\t\t\tsourceWidth = $source.outerWidth();\n\t\t\t\t\tsourceHeight = $source.outerHeight();\n\t\t\t\t}\n\n\t\t\t\txRatio = (img.width - targetWidth) / sourceWidth;\n\t\t\t\tyRatio = (img.height - targetHeight) / sourceHeight;\n\n\t\t\t\toffset = $source.offset();\n\t\t\t},\n\t\t\tmove: function (e) {\n\t\t\t\tvar left = (e.pageX - offset.left),\n\t\t\t\t\ttop = (e.pageY - offset.top);\n\n\t\t\t\ttop = Math.max(Math.min(top, sourceHeight), 0);\n\t\t\t\tleft = Math.max(Math.min(left, sourceWidth), 0);\n\n\t\t\t\timg.style.left = (left * -xRatio) + 'px';\n\t\t\t\timg.style.top = (top * -yRatio) + 'px';\n\t\t\t}\n\t\t};\n\t};\n\n\t$.fn.zoom = function (options) {\n\t\treturn this.each(function () {\n\t\t\tvar\n\t\t\tsettings = $.extend({}, defaults, options || {}),\n\t\t\t//target will display the zoomed image\n\t\t\ttarget = settings.target && $(settings.target)[0] || this,\n\t\t\t//source will provide zoom location info (thumbnail)\n\t\t\tsource = this,\n\t\t\t$source = $(source),\n\t\t\timg = document.createElement('img'),\n\t\t\t$img = $(img),\n\t\t\tmousemove = 'mousemove.zoom',\n\t\t\tclicked = false,\n\t\t\ttouched = false;\n\n\t\t\t// If a url wasn't specified, look for an image element.\n\t\t\tif (!settings.url) {\n\t\t\t\tvar srcElement = source.querySelector('img');\n\t\t\t\tif (srcElement) {\n\t\t\t\t\tsettings.url = srcElement.getAttribute('data-src') || srcElement.currentSrc || srcElement.src;\n\t\t\t\t}\n\t\t\t\tif (!settings.url) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$source.one('zoom.destroy', function(position, overflow){\n\t\t\t\t$source.off(\".zoom\");\n\t\t\t\ttarget.style.position = position;\n\t\t\t\ttarget.style.overflow = overflow;\n\t\t\t\timg.onload = null;\n\t\t\t\t$img.remove();\n\t\t\t}.bind(this, target.style.position, target.style.overflow));\n\n\t\t\timg.onload = function () {\n\t\t\t\tvar zoom = $.zoom(target, source, img, settings.magnify);\n\n\t\t\t\tfunction start(e) {\n\t\t\t\t\tzoom.init();\n\t\t\t\t\tzoom.move(e);\n\n\t\t\t\t\t// Skip the fade-in for IE8 and lower since it chokes on fading-in\n\t\t\t\t\t// and changing position based on mousemovement at the same time.\n\t\t\t\t\t$img.stop()\n\t\t\t\t\t.fadeTo($.support.opacity ? settings.duration : 0, 1, $.isFunction(settings.onZoomIn) ? settings.onZoomIn.call(img) : false);\n\t\t\t\t}\n\n\t\t\t\tfunction stop() {\n\t\t\t\t\t$img.stop()\n\t\t\t\t\t.fadeTo(settings.duration, 0, $.isFunction(settings.onZoomOut) ? settings.onZoomOut.call(img) : false);\n\t\t\t\t}\n\n\t\t\t\t// Mouse events\n\t\t\t\tif (settings.on === 'grab') {\n\t\t\t\t\t$source\n\t\t\t\t\t\t.on('mousedown.zoom',\n\t\t\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\t\t\tif (e.which === 1) {\n\t\t\t\t\t\t\t\t\t$(document).one('mouseup.zoom',\n\t\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\t\tstop();\n\n\t\t\t\t\t\t\t\t\t\t\t$(document).off(mousemove, zoom.move);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tstart(e);\n\n\t\t\t\t\t\t\t\t\t$(document).on(mousemove, zoom.move);\n\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t} else if (settings.on === 'click') {\n\t\t\t\t\t$source.on('click.zoom',\n\t\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\t\tif (clicked) {\n\t\t\t\t\t\t\t\t// bubble the event up to the document to trigger the unbind.\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tclicked = true;\n\t\t\t\t\t\t\t\tstart(e);\n\t\t\t\t\t\t\t\t$(document).on(mousemove, zoom.move);\n\t\t\t\t\t\t\t\t$(document).one('click.zoom',\n\t\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\t\tstop();\n\t\t\t\t\t\t\t\t\t\tclicked = false;\n\t\t\t\t\t\t\t\t\t\t$(document).off(mousemove, zoom.move);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else if (settings.on === 'toggle') {\n\t\t\t\t\t$source.on('click.zoom',\n\t\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\t\tif (clicked) {\n\t\t\t\t\t\t\t\tstop();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstart(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclicked = !clicked;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} else if (settings.on === 'mouseover') {\n\t\t\t\t\tzoom.init(); // Preemptively call init because IE7 will fire the mousemove handler before the hover handler.\n\n\t\t\t\t\t$source\n\t\t\t\t\t\t.on('mouseenter.zoom', start)\n\t\t\t\t\t\t.on('mouseleave.zoom', stop)\n\t\t\t\t\t\t.on(mousemove, zoom.move);\n\t\t\t\t}\n\n\t\t\t\t// Touch fallback\n\t\t\t\tif (settings.touch) {\n\t\t\t\t\t$source\n\t\t\t\t\t\t.on('touchstart.zoom', function (e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tif (touched) {\n\t\t\t\t\t\t\t\ttouched = false;\n\t\t\t\t\t\t\t\tstop();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttouched = true;\n\t\t\t\t\t\t\t\tstart( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('touchmove.zoom', function (e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tzoom.move( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] );\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('touchend.zoom', function (e) {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tif (touched) {\n\t\t\t\t\t\t\t\ttouched = false;\n\t\t\t\t\t\t\t\tstop();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($.isFunction(settings.callback)) {\n\t\t\t\t\tsettings.callback.call(img);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\timg.setAttribute('role', 'presentation');\n\t\t\timg.alt = '';\n\t\t\timg.src = settings.url;\n\t\t});\n\t};\n\n\t$.fn.zoom.defaults = defaults;\n}(window.jQuery));\n"],"sourceRoot":""}