"use strict";!function(){var n=[{name:"funcEndOverlay",isProduction:!1},{name:"funcShowAndHideRange",isProduction:!0}],m=SPSDK.$,e=!1,p=SPSDK.debug("custom:function");SPSDK.custom.calculateTheCountdown=function(t,n,e){var s,o,a,i=new Date,t=Math.floor((t-i)/1e3),i=86400,i="hour"===e?(s=0,o=Math.floor(t%i/3600)+24*Math.floor(t/i),a=Math.floor(t%3600/60),t%60):"minute"===e?(o=s=0,a=Math.floor(t%3600/60)+(Math.floor(t%i/3600)+24*Math.floor(t/i)*60),t%60):"second"===e?(a=o=s=0,t%60+60*(Math.floor(t%i/3600)+24*Math.floor(t/i)*60)):(s=Math.floor(t/i),o=Math.floor(t%i/3600),a=Math.floor(t%3600/60),t%60);return n&&(i=("hour"===e?a=("0"+a).substr(-2):"minute"===e||(o=("0"+o).substr(-2),a=("0"+a).substr(-2)),("0"+i).substr(-2))),0<=t&&{day:s,hour:o,min:a,sec:i}},SPSDK.custom.countdown={endDateTime:new Date("2100/1/1 0:0:0"),alignDigits:!0,prefix:"残り",unitOfDay:"日",unitOfHour:"時間",unitOfMin:"分",unitOfSec:"秒",updateInterval:1e3,run:function(){var t,n=m(".spg-navigation,.spg-tour02"),e=m(".spm-time"===SPSDK.custom.countdown.maxUnit?"hour"===SPSDK.custom.countdown.dsiplayMinUnit?e.append('').append('').append(''):"minute"===SPSDK.custom.countdown.dsiplayMinUnit?e.append('').append('').append('').append('').append(''):e.append('').append('').append('').append('').append('').append('').append(''):"minute"===SPSDK.custom.countdown.maxUnit?"minute"===SPSDK.custom.countdown.dsiplayMinUnit?e.append('').append('').append(''):e.append('').append('').append('').append('').append(''):"second"===SPSDK.custom.countdown.maxUnit?e.append('').append('').append(''):"day"===SPSDK.custom.countdown.dsiplayMinUnit?e.append('').append('').append(''):"hour"===SPSDK.custom.countdown.dsiplayMinUnit?e.append('').append('').append('').append('').append(''):"minute"===SPSDK.custom.countdown.dsiplayMinUnit?e.append('').append('').append('').append('').append('').append('').append(''):e.append('').append('').append('').append('').append('').append('').append('').append('').append('');var s=n.find(".spm-prefix"),o=n.find(".spm-day"),a=n.find(".spm-unit-of-day"),i=n.find(".spm-hour"),c=n.find(".spm-unit-of-hour"),p=n.find(".spm-min"),u=n.find(".spm-unit-of-min"),r=n.find(".spm-sec"),e=n.find(".spm-unit-of-sec");s.text(this.prefix),a.text(this.unitOfDay),c.text(this.unitOfHour),u.text(this.unitOfMin),e.text(this.unitOfSec),n.find('[class$="-close"],[class$="-button"],.spg-tour02-end').on("click.spr",function(){SPSDK.custom.countdown.endDateTime=new Date("1900/1/1 0:0:0")});var d=function(){(t=SPSDK.custom.calculateTheCountdown(SPSDK.custom.countdown.endDateTime,SPSDK.custom.countdown.alignDigits,SPSDK.custom.countdown.maxUnit))?(0===parseInt(t.day,10)?(o.text(""),SPSDK.custom.countdown.unitOfDay="",a.text(SPSDK.custom.countdown.unitOfDay)):o.text(t.day),0===parseInt(t.hour,10)?(i.text(""),SPSDK.custom.countdown.unitOfHour="",c.text(SPSDK.custom.countdown.unitOfHour)):i.text(t.hour),p.text(t.min),r.text(t.sec),setTimeout(function(){d()},SPSDK.custom.countdown.updateInterval)):n.css("display","none")};d()}},SPSDK.custom.exitIntentDetector={delayTimer:null,didGoStep:!1,isPc:!1,scrollDelayTimer:null,scenarioId:null,unTrigger:"*",settings:{mouseOut:{enabled:!1,delayTop:1,delayOther:5},countDown:{enabled:!1,delay:10},closeButton:{enabled:!1},scroll:{enabled:!1,position:10,delay:5}},checkDevice:function(){var t=navigator.userAgent;return p(t),0=SPSDK.custom.minPercentToShow[i]&&c()<=SPSDK.custom.maxPercentToShow[i]?s[i]=!0:s[i]=!1,s[i]?o[i]?(m('.spg-navigation[data-scenario="'+i+'"],.spg-tour02[data-scenario="'+i+'"]').removeClass(function(t,n){return o[i]=!1,(n.match(/\bspgCustom-showRange-\S+/g)||[]).join(" ")}),setTimeout(function(){m('.spg-navigation[data-scenario="'+i+'"],.spg-tour02[data-scenario="'+i+'"]').css("animation","none")},500)):m('.spg-navigation[data-scenario="'+i+'"],.spg-tour02[data-scenario="'+i+'"]').fadeIn(400):s[i]||m('.spg-navigation[data-scenario="'+i+'"],.spg-tour02[data-scenario="'+i+'"]').fadeOut(400)})(),m(window).on("load scroll",function(){return p("scroll % = "+c()),p("shouldShowPopup."+i+" = "+s[i]),0===m('.spg-tour02[data-scenario="'+SPSDK.custom.hideAndShowId.scenario+'"][data-step="'+SPSDK.custom.hideAndShowId.step+'"]').length?(p("return: no show-hide popup"),void m(window).off("load scroll")):void a()})):m(window).off("load scroll"))})}},funcEndOverlay:{run:function(){SPSDK.gears.navigation.on("shown",function(t,n,e){var s=m(e);0===s.length||!s.attr("class")||null!==s.attr("class").match(/spgCustom-endOverlay/)&&m(".spm-navigation-overlay,.spg-tour02-modal").on("click.spr",function(){m(".spm-navigation-overlay,.spg-tour02-modal").off("click.spr"),s.find('[class$="-close"],.spg-tour02-end').trigger("click")})})}}};window.SPSDK.userReady(function(){SPSDK.storage.get("debug_mode").then(function(t){e=null!==t&&(p("sprocket_debug_mode"),!0),n.forEach(function(t){(t.isProduction||e)&&s[t.name]&&"function"==typeof s[t.name].run&&s[t.name].run()})})})}();