"use strict";define(function(){var e={moving:!1,moveCalls:0},i={bind:function(t,o,a){$("body").on("click",$.proxy(this.focusOut,this,this.selectors(t),o,a))},focusOut:function(t,o,a,e){var i,n,r,c=$(e.target),s="active";i=$(t).data("section"),n=$(t).data("parent"),r=t.replace(".",""),c.hasClass(r)||0!==c.closest(i).length||c.is(o)||($(t).removeClass(s),$(i).removeClass(s),$(n).removeClass(s),a&&$.each(a,function(t,o){o()}))},selectors:function(t){var o=typeof t,a=t.length,e="";switch(o){case"string":e=t;break;case"object":$.each(t,function(t,o){e+=t+1=a?(e.moving=!1,void(e.moveCalls=0)):void o(t))}},addSessionCartData:function(t){localStorage.setItem("cartProductsData",JSON.stringify(t))},updateQuantity:function(a,e){var t=JSON.parse(localStorage.getItem("cartProductsData"));t&&(t.forEach(function(t,o){t.productCode!==a||(t.quantity=parseInt(e))}),localStorage.setItem("cartProductsData",JSON.stringify(t)))},updateAFAsize:function(a,e,i){var t=JSON.parse(localStorage.getItem("cartProductsData"));t&&(t.forEach(function(t,o){if(t.productCode===a)return t.productCode=e,void(t.unitPrice=i)}),localStorage.setItem("cartProductsData",JSON.stringify(t)))},removeProduct:function(a){var e=JSON.parse(localStorage.getItem("cartProductsData"));e&&(e.forEach(function(t,o){t.productCode!==a||e.splice(o,1)}),localStorage.setItem("cartProductsData",JSON.stringify(e)))},cartMerge:function(t){var e=JSON.parse(localStorage.getItem("cartProductsData"));e&&(t.forEach(function(t){var o=$("input[value='"+t+"']").parents(".product-wrapper").find(".paybtn-elemforanalytics"),a={productCode:t,productId:o.data("sku"),quantity:o.data("units"),unitPrice:o.data("price")};e.push(a)}),localStorage.setItem("cartProductsData",JSON.stringify(e)))},createCookie:function(t,o,a,e){o=o||!0,a=a||this.createExpirationCookie(),e=e||"/",document.cookie=t+"="+o+"; "+a+"; path="+e},createExpirationCookie:function(t){var o=new Date;return t=t||30,o.setDate(o.getDate()+t)},lookupCookie:function(t){var a,e,o=document.cookie.split("; "),i={};return $.each(o,function(t,o){a=o.split("=")[0],e=o.split("=")[1],i[a]=e}),i},existsCookie:function(o){var a,t=i.lookupCookie(o);return $.each(t,function(t){o===t&&(a=!0)}),a},getCookie:function(o){var a=i.lookupCookie(o),e=null;return $.each(a,function(t){o===t&&(e=a[t])}),e},removeCookie:function(t){document.cookie=t+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"},initTooltip:function(){$('[data-toggle="tooltip"].checkout-tooltip').each(function(){var o=this,t='';$(this)[0].hasAttribute("data-tooltip-class")&&(-1<$(this).attr("data-tooltip-class").indexOf("giftcard")?t='
':-1<$(this).attr("data-tooltip-class").indexOf("creditcard")?t='
':-1<$(this).attr("data-tooltip-class").indexOf("additional-savings")&&(t='
')),$(this).tooltip({container:"body",template:t}),window.matchMedia("(max-width: 990px)").matches&&$("body").on("touchstart",function(t){$(o).each(function(){$(this).is(t.target)||0!==$(this).has(t.target).length||0!==$(".tooltip").has(t.target).length?$(this).tooltip("show"):$(this).tooltip("hide")})})})},getProductPrice:function(t,o){var a=jQuery.Deferred();return $.ajax({type:"GET",contentType:"application/json",data:{segment:o,upc:t},url:Oakley.variables.contextPath+"/productPrice",success:function(t){var o=JSON.parse(t).reduce(function(t,o){return t[o.code]=o,t},{});a.resolve(o)},error:function(t){a.reject(t)}}),a.promise()},initExternalPaymentsPrice:function(t){if(window.affirm&&window.affirm.ui.refresh){var o=100*t.price.value;$(".affirm-as-low-as").attr("data-amount",o),window.affirm.ui.refresh()}if(0<$(".afterPay-wrapper").length){var a=t.price.value/4;$(".afterpay-price-value").text(a)}0<$(".paybright-widget-container.paybright-disclaimer").length&&$(".paybright-widget-container.paybright-disclaimer").attr("data-pb_financedamount","$"+t.price.value),0<$(".paybright-klarna-placement").length&&$(".paybright-klarna-placement").attr("data-purchase-amount",100*t.price.value)},handleUTAGAddToCartButton:function(){var a=[];if($(".osi-utag-add-to-cart").each(function(t,o){a=a.concat({name:$(o).attr("data-name"),value:$(o).val()})}),a.length){var t=a.reduce(function(t,o){return t[o.name]=[o.value],t},{});"Eyewear"!==$(".osi-utag-product-type").val()&&(t.color_swatch=$(".osi-utag-color-not-eyewear").val()),t.event_type=["addToCart"],t.product_quantity=[$(this).siblings(".product-quantity").find("input[name=qty]").val()],utag.link(t)}}},t=function(){var o={},a={id:"oakley-modal"};function e(t){var o=$("html, body");t&&!0===t?o.removeClass("modalOakley_opened"):o.addClass("modalOakley_opened")}function i(t){var o=document.querySelector(".form-wrapper .right .summary-info .afterpay-disclaimer .js-afterpay-info"),a=document.querySelector("#afterpay-modal-wrapper");o&&a&&t&&(a.style.display="block")}function n(t){t&&t.preventDefault(),a.confirm&&o.container.off("click",".action-confirm",a.data,a.confirm),o.container.off("close",n),o.container.off("click",".action-close",n),a.handlers&&a.handlers instanceof Array&&0