var OTD_SITE_URL,SERVER_PATH,Scripturl,res,res1,OTD_scid,SITE_FILE_URL,OTD_local=0,OTD_path=__st.pageurl,OTD_cart=OTD_path.search("/cart"),OTD_product=OTD_path.search("/products/"),OTD_shopName=Shopify.shop;1==OTD_local?(SITE_FILE_URL="http://localhost/appsonrent-apps/on-time-delivery/on-time-delivery.php",OTD_SITE_URL=OTD_path="http://localhost/appsonrent-apps/on-time-delivery/"):(SERVER_PATH=document.currentScript.src.includes("devodd")?"dev":"",OTD_path=""==SERVER_PATH?"https://otd.appsonrent.com/on-time-delivery/":"https://devodd.identixweb.com/on-time-delivery/",OTD_scid=void 0===document.currentScript?"":1<(res=(Scripturl=document.currentScript.src).split("&")).length?(res1=res[1].split("="))[1]:"",SITE_FILE_URL=OTD_path+"on-time-delivery.php");var OTD_minDate,OTD_min_date,OTD_maxDate,OTD_currentDate,OTD_data,OTD_loadCount=0,on_time_required_delivery_date="",on_time_use_time_option="",on_time_appsStatus=0,sp_settings="",oddLocationCalanderSettings=[],OTD_delivery_days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],oddStorePickup="",oddItemsData=[],OTD_map_load=0,map_js_load=0,OTD_resultJson="",OTD_eddResultJson="",jQueryOTD="",scriptsOTD=[],OTD_currentTime="",OTD_deliveryTimeArr=[],OTD_daysArr=[],OTD_weekDays=[],OTD_formatedDisableDateArr=[],OTD_formatedDisableDayArr=[];window.Checkout&&window.Checkout.jQuery&&(jQueryOTD=window.Checkout.jQuery);{function IW_dt_loadJavascriptAsynch(e){var t=document.createElement("script");return t.type="text/javascript",t.src=e,t.readyState?t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(t.onreadystatechange=null,jQueryOTD=window.jQuery,console.log("IE jquery load OTD"),IW_dt_handler())}:t.onload=function(){jQueryOTD=window.jQuery,console.log("App jquery load OTD"),IW_dt_handler()},void 0!==t&&document.getElementsByTagName("head")[0].appendChild(t),t}function IW_dt_handler(){var e,t;++OTD_loadCount{document.querySelectorAll(".iweb-order-delivery-dt-pro")?.length&&!document.querySelectorAll(".iweb-order-delivery-dt-pro .appsonrent-dds-main")?.length&&!document.querySelectorAll(".storePickupTab.active_tab").length&&OTD_resultJson.sp_setting_html&&(jQueryOTD(".iweb-order-delivery-dt-pro").html(OTD_resultJson.sp_setting_html),shipping_calender_show(r,i))},100);else{let e=(a=jQueryOTD("form[action*='/cart']:not(form[action='/cart/add']),form[action='/cart?locale=en']:not(form[action='/cart/add'])"))?.length||0;for(;e--;){var s=a[e];t.includes(s.id)&&((d=document.createElement("div")).className="iweb-order-delivery-dt-pro",s.appendChild(d),jQueryOTD(".iweb-order-delivery-dt-pro").append(OTD_resultJson.sp_setting_html))}}if("1"==OTD_resultJson.shipping_status)return shipping_calender_show(r,i),!0}else{if(0
"),setInterval(()=>{document.querySelectorAll(".iweb-order-delivery-dt-pro")?.length&&!document.querySelectorAll(".iweb-order-delivery-dt-pro .iw-order-delivery-dt-main")?.length&&(jQueryOTD(".iweb-order-delivery-dt-pro").html("
"),shipping_calender_show(r,i,1))},100);else if(!jQueryOTD(".iweb-order-delivery-dt-pro").length){let e=(a=jQueryOTD("form[action*='/cart']:not(form[action='/cart/add']),form[action='/cart?locale=en']:not(form[action='/cart/add'])"))?.length||0;for(;e--;){var d,o,s=a[e];t.includes(s.id)&&(d=document.createElement("div"),(o=document.createElement("div")).className="otd_container",d.className="iw-order-delivery-dt-main",d.append(o),s.appendChild(d))}}e=OTD_resultJson.custom_css;e&&jQueryOTD(".iw-order-delivery-dt-main").append("")}if(jQueryOTD("
"+OTD_resultJson.calendar_heading+"
").insertBefore(".iw-order-delivery-dt-pro"),"1"==OTD_resultJson.date_picker_status&&(jQueryOTD('form[action*="/cart"] [name="checkout"],form[action="/cart?locale=en"] [name="checkout"]').removeAttr("disabled"),"1"==OTD_resultJson.shipping_status))return shipping_calender_show(r,i,1),!0}}})}})}function estimated_delivery_date(){var e;jQueryOTD("form[action*='/cart/add']")&&"product"==__st.p&&((e={}).scid=OTD_scid,e.shop=OTD_shopName,e.method_name="getSettings",e.new_method="eddSettings",jQueryOTD.ajax({type:"POST",url:SITE_FILE_URL,data:e,success:function(e){var h,r,i,t,a,v,g,b,s,d,o,n,_,l,j,w,m,u,Q,c,D,y,p,T,x,O,A,S,f,I,J,k,R,F,C,L,N,M,q,E,P,V,H,W,z;e=JSON.parse(e),OTD_eddResultJson=e.data,void 0!==e.data&&"success"==e.msg&&"0"!=e.date_picker_status&&"0"!=e.charge_approve&&OTD_eddResultJson.date_picker_status&&"1"==OTD_eddResultJson.date_picker_status&&jQueryOTD("form[action*='/cart/add']")&&(h=jQueryOTD("form[action*='/cart/add']"),"1"==OTD_eddResultJson.show_edd_datetime&&(a=[],n=(D=new Date(OTD_eddResultJson.timezonecurrenttime24)).getMinutes(),c=D.getHours()+":"+n,y=OTD_eddResultJson.cutoff_time,OTD_currentDate=dateObjToString(D),OTD_currentTime=dateObjToTimeString(D),e=OTD_eddResultJson.min_day_value,"object"==typeof(OTD_min_date=addDays(OTD_currentDate,e))&&(OTD_min_date=OTD_min_date.getFullYear()+"-"+(t=(t=OTD_min_date.getMonth()+1)<10?"0"+t:t)+"-"+(OTD_min_date.getDate()<10?"0"+OTD_min_date.getDate():OTD_min_date.getDate())),r=find_separator_date(OTD_minDate=OTD_eddResultJson.min_date),n=find_separator_date(i=OTD_eddResultJson.date_format),OTD_minDate=dateFormatConvert(i,"yy-mm-dd",r,"-",OTD_minDate),e=parseInt(OTD_eddResultJson.max_date),t=new Date(OTD_minDate),t=(t=(t=(OTD_maxDate=addDays(t,e)).getDate()).toString()).length<2?"0".concat(t):t,e=(e=(OTD_maxDate.getMonth()+1).toString()).length<2?"0".concat(e):e,OTD_maxDate=OTD_maxDate.getFullYear()+"-"+e+"-"+t,""!==(a=OTD_eddResultJson.extra_no_available.split(","))[0]&&a.forEach(function(e){e=dateFormatConvert(i,"yy-mm-dd",r,"-",e);var t=new Date(e),a=t.getFullYear(),e=(e=t.getMonth()+1)<10?"0"+e:e,t=t.getDate()<10?"0"+t.getDate():t.getDate();OTD_formatedDisableDateArr.push(a+"-"+e+"-"+t)}),OTD_minDate=recursiveOnDisableDates(OTD_minDate,OTD_formatedDisableDateArr),a=OTD_eddResultJson.invalid_day,OTD_formatedDisableDayArr=a.split(","),OTD_minDate=recursiveOnDisableDays(OTD_minDate,OTD_formatedDisableDayArr,OTD_formatedDisableDateArr),holiday_minDate="1"==OTD_eddResultJson.required_holiday_interval?OTD_minDate:"",v=OTD_eddResultJson.timer_status_format,"NULL"!==OTD_eddResultJson.timer_status_format&&(W=date_change_onTimeDel_function_edd(OTD_minDate,i,n,OTD_eddResultJson),OTD_deliveryTimeArr=W.tempObj_12,deliveryTimeArr_24=W.tempObj_24,null!=deliveryTimeArr_24&&0==Object.keys(deliveryTimeArr_24).length?(OTD_minDate="object"==typeof(OTD_minDate=recursiveOnDisableDays(OTD_minDate=recursiveOnDisableDates(OTD_minDate=addDays(OTD_minDate,1),OTD_formatedDisableDateArr),OTD_formatedDisableDayArr,OTD_formatedDisableDateArr))?dateObjToString(OTD_minDate):OTD_minDate,OTD_deliveryTimeArr=OTD_eddResultJson.delivery_time.time_24,deliveryTimeArr_24=OTD_eddResultJson.delivery_time.time):null!=deliveryTimeArr_24&&0==Object.keys(W.tempObj_12).length&&0==Object.keys(deliveryTimeArr_24).length?OTD_deliveryTimeArr=W:null!=deliveryTimeArr_24&&0==Object.keys(W.tempObj_12).length&&0!=Object.keys(deliveryTimeArr_24).length&&(OTD_deliveryTimeArr=W.tempObj_24)),"NULL"==OTD_eddResultJson.timer_status_format&&"1"==OTD_eddResultJson.cutoff_time_status&&(_=OTD_eddResultJson.cutoff_time,l=[],OTD_minDate==OTD_currentDate?0==(d=recursiveOnDeliveryTime_cutoff_zero(_,OTD_deliveryTimeArr,"cutoff")).length&&(OTD_minDate="object"==typeof(OTD_minDate=recursiveOnDisableDays(OTD_minDate=recursiveOnDisableDates(OTD_minDate=addDays(OTD_minDate,1),OTD_formatedDisableDateArr),OTD_formatedDisableDayArr,OTD_formatedDisableDateArr))?dateObjToString(OTD_minDate):OTD_minDate):OTD_minDate==OTD_min_date&&1==OTD_eddResultJson.cutoff_time_min_day&&0==(d=recursiveOnDeliveryTime_cutoff_zero(_,OTD_deliveryTimeArr,"cutoff")).length&&(OTD_minDate="object"==typeof(OTD_minDate=recursiveOnDisableDays(OTD_minDate=recursiveOnDisableDates(OTD_minDate=addDays(OTD_minDate,1),OTD_formatedDisableDateArr),OTD_formatedDisableDayArr,OTD_formatedDisableDateArr))?dateObjToString(OTD_minDate):OTD_minDate)),"0"==v?(OTD_minDate==OTD_currentDate&&(OTD_minDate="object"==typeof(OTD_minDate=recursiveOnDisableDays(OTD_minDate=recursiveOnDisableDates(OTD_minDate,OTD_formatedDisableDateArr),OTD_formatedDisableDayArr,OTD_formatedDisableDateArr))?dateObjToString(OTD_minDate):OTD_minDate),"1"==OTD_eddResultJson.cutoff_time_status&&(_=OTD_eddResultJson.cutoff_time,l=[],OTD_minDate==OTD_currentDate?(0==(d=recursiveOnDeliveryTime_cutoff_zero(_,OTD_deliveryTimeArr,"cutoff")).length?(OTD_minDate="object"==typeof(OTD_minDate=recursiveOnDisableDays(OTD_minDate=recursiveOnDisableDates(OTD_minDate=addDays(OTD_minDate,1),OTD_formatedDisableDateArr),OTD_formatedDisableDayArr,OTD_formatedDisableDateArr))?dateObjToString(OTD_minDate):OTD_minDate,OTD_min_date=parseFloat(y)&&(OTD_minDate="object"==typeof(OTD_minDate=recursiveOnDisableDays(OTD_minDate=recursiveOnDisableDates(OTD_minDate=addDays(OTD_minDate,1),OTD_formatedDisableDateArr),OTD_formatedDisableDayArr,OTD_formatedDisableDateArr))?dateObjToString(OTD_minDate):OTD_minDate):OTD_minDate==OTD_min_date&&1==OTD_eddResultJson.cutoff_time_min_day&&parseFloat(c)>=parseFloat(y)&&(OTD_minDate="object"==typeof(OTD_minDate=recursiveOnDisableDays(OTD_minDate=recursiveOnDisableDates(OTD_minDate=addDays(OTD_minDate,1),OTD_formatedDisableDateArr),OTD_formatedDisableDayArr,OTD_formatedDisableDateArr))?dateObjToString(OTD_minDate):OTD_minDate)),"string"==typeof OTD_minDate?(OTD_minDate.includes("-")||OTD_minDate.includes("/")||OTD_minDate.includes("."))&&(j=OTD_minDate):"object"==typeof OTD_minDate&&(j=dateObjToString(OTD_minDate)),c=find_separator_date(j),w=j.split(c),"2"==v&&null!=OTD_deliveryTimeArr?m=OTD_deliveryTimeArr:(u=[],u=OTD_deliveryTimeArr),OTD_daysArr=""!=OTD_eddResultJson.dates_name?OTD_eddResultJson.months_name.split(","):["Jan","Fab","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],OTD_weekDays=""!=OTD_eddResultJson.months_name?OTD_eddResultJson.dates_name.split(","):["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],j.includes("/")&&"string"==typeof j&&(j=(j=j.replaceAll("/","-")).split("-").reverse().join("-")),y=new Date(j),Q=OTD_weekDays[y.getDay()],"24"==OTD_eddResultJson.time_display_format&&"1"==v&&(weekDay_24="",c=u[0].split("-"),f=(D=new Date(OTD_minDate)).getDay(),y=daysArray[f],weekDay_24=OTD_weekDays[D.getDay()],f=OTD_eddResultJson.delivery_time[y].start_time,p=OTD_eddResultJson.delivery_time[y].end_time,T=f.indexOf(c[0]),finalStartDeliveryTime_24=[],finalEndDeliveryTime_24=[],jQueryOTD.each(f,function(e,t){T==e&&(finalStartDeliveryTime_24.push(t),finalEndDeliveryTime_24.push(p[e]))})),x=OTD_eddResultJson.edd_editor_text,O=$("
"),x&&""!=x&&(I=$("
").html(x),$(I[0]).children().each(function(e,t){$(t)[0].textContent.includes("{{timer_day_hour}}")||$(t)[0].textContent.includes("{{day_hour_minute}}")||$(t)[0].textContent.includes("{{date_time}}")?($(t)[0].textContent.includes("{{timer_day_hour}}")&&($(t).addClass("edd_timerDayHour_class"),O.append($(t)[0])),$(t)[0].textContent.includes("{{day_hour_minute}}")&&($(t).addClass("edd_dayHour_class"),O.append($(t)[0])),$(t)[0].textContent.includes("{{date_time}}")&&($(t).addClass("edd_dateTime_class"),O.append($(t)[0]))):O.append($(t)[0])}),x=O[0].innerHTML),A="","2"!==v?x&&""!=x&&(S=j.split("-"),""!=u&&(1==v&&void 0!==deliveryTimeArr_24?(f=(z=deliveryTimeArr_24[0].split("-"))[0].split(":"),I=z[1].split(":"),z[0]=f[0].length<2?"0".concat(f[0]):f[0],z[1]=I[0].length<2?"0".concat(I[0]):I[0],J=f):0==v&&((z=deliveryTimeArr_24[0].split(":"))[0]=z[0].length<2?"0".concat(z[0]):z[0],z[1]=z[1].length<2?"0".concat(z[1]):z[1],(J=u[0].split(":"))[0]=J[0].length<2?"0".concat(J[0]):J[0],J[1]=J[1].length<2?"0".concat(J[1]):J[1]),A=void 0!==z?z[0]:""),k=["{{timer_day_hour}}","{{day_hour_minute}}","{{date_time}}"],R=new Date(S[0],S[1]-1,S[2],A).getTime(),P=E=q=M=N=L=C=F=0,V=setInterval(function(){var e=(new Date).getTime(),t=R-e;t<0&&(t=new Date(S[0],S[1]-1,Number(S[2])+2,A).getTime()-e),F=Math.floor(t/864e5),C=Math.floor(t%864e5/36e5),L=Math.floor(t%36e5/6e4),N=Math.floor(t%6e4/1e3);var a,r,i,s,d,o,n,_,l,m,u,c,D,y,p,T,O,f=F<10?"0"+F.toString():F.toString(),e=C<10?"0"+C.toString():C.toString();L.toString(),N.toString();M=f?f.charAt(0):"0",q=f?f.charAt(1):"0",E=e?e.charAt(0):"0",P=e?e.charAt(1):"0",jQueryOTD(document).find("#main_content").length?(r="display: flex; font-weight: 600; border-radius: 10%; justify-content: center;",i="color: #000000;font-size : "+OTD_eddResultJson.edd_timer_appearance.edd_timer_font_size+"px",s="","NULL"!==OTD_eddResultJson.timer_status_format&&(s=''+M+''+q+'Days:'+E+''+P+'Hrs'),d=0==F?(1'+M+''+q+'Days:'+E+''+P+'Hrs'),d=0==F?(1'+y+"
"):"1"==OTD_eddResultJson.edd_display_position&&(1'+y+"
"),OTD_eddResultJson.edd_datetime_margin&&(p=OTD_eddResultJson.edd_datetime_margin,jQueryOTD("#main_content").find(".edd_dateTime_class")&&jQueryOTD("#main_content").find(".edd_dateTime_class").css({margin:p.edd_datetime_margin_top+"px "+p.edd_datetime_margin_right+"px "+p.edd_datetime_margin_bottom+"px "+p.edd_datetime_margin_left+"px"})),OTD_eddResultJson.edd_timer_margin&&(T=OTD_eddResultJson.edd_timer_margin,jQueryOTD("#main_content").find(".edd_timerDayHour_class")&&jQueryOTD("#main_content").find(".edd_timerDayHour_class").css({margin:T.edd_timer_margin_top+"px "+T.edd_timer_margin_right+"px "+T.edd_timer_margin_bottom+"px "+T.edd_timer_margin_left+"px"})),OTD_eddResultJson.edd_timer_appearance&&(O=OTD_eddResultJson.edd_timer_appearance,jQueryOTD(".timer_digit").css({"background-color":O.edd_timer_digit_bg_color,color:O.edd_timer_digit_color,"font-size":O.edd_timer_font_size+"px"}),jQueryOTD(".timer_label").css({"font-size":O.edd_timer_label_font_size+"px","font-weight":O.edd_timer_label_font_weight,color:O.edd_timer_units_label_color}),jQueryOTD(".edd_timer_separator").css({"font-size":O.edd_timer_font_size+"px",color:O.edd_timer_separator_color}))),-1===Math.sign(t)&&(estimated_delivery_date(),t<0&&clearInterval(V)),clearInterval(V)},1e3)):"2"==v&&(z=x,W=void 0!==(H=null!=m?m[0]:H)?Q+", "+w[2]+" "+OTD_daysArr[w[1]-1]+" "+w[0]+" - "+H:(W=OTD_eddResultJson.delivery_time,Q+", "+w[2]+" "+OTD_daysArr[w[1]-1]+" "+w[0]+" - "+W[0]),z=z.replaceAll("{{date_time}}",W),"0"==OTD_eddResultJson.edd_display_position?(1'+z+""):"1"==OTD_eddResultJson.edd_display_position&&(1'+z+""),jQueryOTD("#main_content").find(".edd_timerDayHour_class").hide(),jQueryOTD("#main_content").find(".edd_dayHour_class").hide(),jQueryOTD("#main_content").find(".edd_dateTime_class").addClass("edd_date_time_style"),OTD_eddResultJson.edd_datetime_margin&&(z=OTD_eddResultJson.edd_datetime_margin,jQueryOTD("#main_content").find(".edd_dateTime_class")&&jQueryOTD("#main_content").find(".edd_dateTime_class").css({"margin-bottom":z.edd_datetime_margin_bottom+"px","margin-left":z.edd_datetime_margin_left+"px","margin-right":z.edd_datetime_margin_right+"px","margin-top":z.edd_datetime_margin_top+"px"})))))}}))}function date_change_onTimeDel_function_edd(e,t,a,r){var d=r.hide_slots_settings;jQueryOTD(".iweb-dt-deliveryTime").addClass("iweb_order_delivery_advance_loader loader"),jQueryOTD(".iweb-dt-deliveryTime").attr("disabled","true"),jQueryOTD(".iweb-dt-deliveryRequired").hide(),jQueryOTD(".iweb-dt-deliveryTime").removeClass("iweb-dt-isRequired"),jQueryOTD(".iw-order-delivery-dt-calendar").removeClass("iweb-dt-isRequired");var i=new Date(e),s=("0"+i.getDate()).slice(-2),o=("0"+(i.getMonth()+1)).slice(-2),n=i.getFullYear(),e=s+"-"+o+"-"+n,_=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"][i.getDay()],l=dateFormatConvert("dd-mm-yy",t,"-",a,e),m=find_separator_date(r.date_format),u=dateFormatConvert(r.date_format,t,m,a,r.min_date),c=r.today_date;jQueryOTD(".iweb-dt-deliveryTime").children("option").remove();var D='",y='",p=r.cutoff_time,T=(p=p.split("."))[0],i=p[1],m=(c=c.split("-"))[0],p=c[1],c=c[2],O=dateFormatConvert("dd-mm-yy",t,"-",a,O=c+"-"+p+"-"+m),f=r.hr_24,h=r.min,v=r.padding_time_status,g=r.padding_time_min_days_status,b=r.padding_hour_24,j=r.padding_minute,w=r.min_day_value,m=!1;if(tempObj={},void 0===e)console.log("Something wrong");else if(void 0!==e&&"0"==r.timer_status_format){for(var Q=r.delivery_time.time,x=[],A=[],S=[],I=[],J=[],k=0;k'+r.delivery_time.time_24[k]+"",A[k]=r.delivery_time.time_24[k],S[k]=r.delivery_time.time[k];1==r.cutoff_time_status&&l==O||1==r.cutoff_time_status&&1==r.cutoff_time_min_day&&l==u&&0!=r.min_day_value?parseInt(T)parseInt(t.count)?-1==N.indexOf(H)&&(N.push(H),M.push(W),q.push(z)):-1==V.indexOf(H)&&(V.push(H),$.push(z))):0==U&&-1==N.indexOf(H)&&(N.push(H),M.push(W),q.push(z))}):(1==U&&0{null!=I&&I[e]&&(tempObj_12[t]=I[e]),J[e]&&(tempObj_24[t]=J[e])}),tempObj={tempObj_12:tempObj_12,tempObj_24:tempObj_24}),tempObj}function addOneDay(e,t,a,r){return e="object"==typeof(e=recursiveOnDisableDays(e=recursiveOnDisableDates(e=addDays(e,t),a),r))?formatDate(e):e}function formatDate(e){var t=new Date(e),a=""+(t.getMonth()+1),e=""+t.getDate();return[t.getFullYear(),a=a.length<2?"0"+a:a,e=e.length<2?"0"+e:e].join("-")}function edd_orderLimit(i,e,t,s){var a=e,d=[],r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],e=new Date(i).getDay(),o=a[r=daysArray[e]].start_time,n=a[r].end_time,_=a[r].to_message,l=a[r].limit,m=a[r].totalorder,u=o.indexOf(t[0]),c=[],D=[],y=[],p=[],T=[];jQueryOTD.each(o,function(e,t){u<=e&&(c.push(o[e]),D.push(n[e]),y.push(_[e]),p.push(l[e]),T.push(m[e]))}),0=parseInt(d[e].totalOrders)&&f.push(e)}}),0e?"":t:r}function recursiveOnDeliveryTime_cutoff_one(e,t,a){var r=[];return r="cutoff"==a?ee.scrollIntoView({behavior:"smooth",block:"center"})),jQueryOTD(".iweb-dt-deliveryRequired").html(r).show(),jQueryOTD(".iweb-dt-deliveryTime").addClass("iweb-dt-isRequired"),setTimeout(function(){t.find("[name='checkout']").removeClass("btn--loading")},0),e.preventDefault(),e.stopImmediatePropagation()):("undefined"!=typeof BOLD&&void 0!==BOLD.recurring_orders&&void 0!==BOLD.recurring_orders.app&&void 0!==BOLD.recurring_orders.app.cartWidget&&(BOLD.recurring_orders.app.cartWidget.checkoutEnabled=!0),jQueryOTD(".iweb-dt-deliveryTime").removeClass("iweb-dt-isRequired"),jQueryOTD(".iw-order-delivery-dt-calendar").removeClass("iweb-dt-isRequired"),jQueryOTD(".iweb-dt-deliveryRequired").hide(),t.unbind("submit"),t.find("[name='checkout']").length?(t.find("[name='checkout']").unbind("click"),t.find("[name='checkout']").click()):"appi-earth.myshopify.com"!=OTD_shopName&&t.submit(),"liliyum-patisserie-cafe.myshopify.com"==OTD_shopName&&(e.preventDefault(),e.stopImmediatePropagation(),window.stop(),window.location.href="/checkout")):("araya-chocolate.myshopify.com"==OTD_shopName?jQueryOTD("html, body").animate({scrollTop:jQueryOTD(".iw-order-delivery-dt-calendar").offset().top-500},1e3):document.querySelectorAll(".iw-order-delivery-dt-calendar").forEach(e=>e.scrollIntoView({behavior:"smooth",block:"center"})),jQueryOTD(".iweb-dt-deliveryRequired").html(a).attr("style","display:block"),jQueryOTD(".iw-order-delivery-dt-calendar").addClass("iweb-dt-isRequired"),setTimeout(function(){t.find("[name='checkout']").removeClass("btn--loading")},0),e.preventDefault(),e.stopImmediatePropagation()):jQueryOTD(".iw-order-delivery-dt-deliveryDateVal").val()?("undefined"!=typeof BOLD&&void 0!==BOLD.recurring_orders&&void 0!==BOLD.recurring_orders.app&&void 0!==BOLD.recurring_orders.app.cartWidget&&(BOLD.recurring_orders.app.cartWidget.checkoutEnabled=!0),jQueryOTD(".iw-order-delivery-dt-calendar").removeClass("iweb-dt-isRequired"),jQueryOTD(".iweb-dt-deliveryRequired").hide(),t.unbind("submit"),jQueryOTD('a[href="/checkout"]').length&&jQueryOTD('a[href="/checkout"]').unbind("click"),t.find("[name='checkout']").length?(t.find("[name='checkout']").unbind("click"),t.find("[name='checkout']").click()):t.submit()):("araya-chocolate.myshopify.com"==OTD_shopName?jQueryOTD("html, body").animate({scrollTop:jQueryOTD(".iw-order-delivery-dt-calendar").offset().top-500},1e3):document.querySelectorAll(".iw-order-delivery-dt-calendar").forEach(e=>e.scrollIntoView({behavior:"smooth",block:"center"})),jQueryOTD(".iweb-dt-deliveryRequired").html(a).show(),jQueryOTD(".iw-order-delivery-dt-calendar").addClass("iweb-dt-isRequired"),setTimeout(function(){t.find("[name='checkout']").removeClass("btn--loading")},0),e.preventDefault(),e.stopImmediatePropagation())}function dateFormatConvert(e,t,a,r,i,s){var d=e.toLowerCase().split(a),o=t.toLowerCase().split(r);if("loop"==s){var n=[];return jQueryOTD.each(i,function(e,t){t=t.split(a);t[d[0]]=t[0],t[d[1]]=t[1],t[d[2]]=t[2],n.push(t[o[0]]+r+t[o[1]]+r+t[o[2]])}),n}n="",i=i.split(a);return i[d[0]]=i[0],i[d[1]]=i[1],i[d[2]]=i[2],n=i[o[0]]+r+i[o[1]]+r+i[o[2]]}function oddt_invalid_days(e){var t=e&&e.split(",");if(t.length)for(var a=0;a=e.cutoff_hour_minute?t:0}function shipping_calender_show(e,t,a){if(0

Delivery date selection is not available for cart.

'),!0;auto_minday_calculation((oddShippingCalander=OTD_resultJson).auto_date,OTD_resultJson,oddt_invalid_days(OTD_resultJson.invalid_day),OTD_resultJson.date_format,oddt_disable_dates(OTD_resultJson.extra_no_available),"otd_shipping"),shipping_show(OTD_resultJson,a)}function convertFixDate(t,a){if(t){let e=t;var r=-1",T='",O=o.cutoff_hour,f=o.cutoff_minute,h=(D=D.split("-"))[0],r=D[1],D=D[2],v=dateFormatConvert("dd-mm-yy",a,"-",u,v=D+"-"+r+"-"+h),g=(o.hr,o.hr_24),b=o.min,j=o.padding_time_status,w=o.padding_time_min_status,Q=o.padding_hour_24,x=o.padding_minute,A=o.min_day_value,h=!1;if(void 0===e)console.log("Something wrong");else if(void 0!==e&&"0"==o.timer_status_format){for(var S=o.delivery_time.time.split(","),I=[],J=0;J'+o.delivery_time.time_24[J]+"";1==o.cutoff_time_status&&c==v||1==o.cutoff_time_status&&1==o.cutoff_time_min_day&&c==n&&0!=o.min_day_value?parseInt(O)parseInt(t.count)?-1==L.indexOf($)&&(L.push($),N.push(W),M.push(z)):-1==P.indexOf($)&&(P.push($),V.push(z))):0==U&&-1==L.indexOf($)&&(L.push($),N.push(W),M.push(z))}):(1==U&&0r&&-1==P.indexOf(t)&&(P.push(t),V.push(M[e])))});h=!1;(1==o.cutoff_time_status&&c==v||1==o.cutoff_time_status&&1==o.cutoff_time_min_day&&c==n&&0!=o.min_day_value)&&(parseInt(O)'+Y[e]+" "+t+" "+G[e]+""}):i=!1)}else if(void 0!==e&&"2"==o.timer_status_format){h=!1;if(h=(1==o.cutoff_time_status&&c==v||1==o.cutoff_time_status&&1==o.cutoff_time_min_day&&c==n&&0!=o.min_day_value)&&(parseInt(O)'+X[J]+"";i=(p+=K).length!==T.length}}else(1==o.cutoff_time_status&&c==v||1==o.cutoff_time_status&&1==o.cutoff_time_min_day&&c==n&&0!=o.min_day_value)&&(i=!(1==o.cutoff_time_status&&parseInt(O)",jQueryOTD(".iweb-dt-deliveryTime").append(p),i}function shipping_show(t,e){var a,r,i,s,d,o,n,_,l,m,u,c,D;null!=t.shipping_product_not_available?(jQueryOTD(".appsonrent-dds-local-delivery-preloader").hide(),jQueryOTD('form[action*="/cart"] [name="checkout"],form[action="/cart?locale=en"] [name="checkout"]').removeAttr("disabled"),jQueryOTD(".identixweb-order-delivery").remove(),jQueryOTD(".main_loader").after('

'+t.shipping_product_not_available+"

")):(appsStatus="1",required_delivery_date=t.required,use_time_option=t.timer_status,a=parseInt(t.week_start),r=t.date_format,i=oddt_invalid_days(t.invalid_day),s=oddt_disable_dates(t.extra_no_available),d=t.time_format,o=oddt_day_text_value(t.current_time_c),n=t.required_message_date,_=t.required_message_time,l=jQueryOTD("form[action*='/cart'],form[action='/cart?locale=en']"),m=t.current_month,"1"==t.required&&("undefined"!=typeof BOLD&&void 0!==BOLD.recurring_orders&&void 0!==BOLD.recurring_orders.app&&void 0!==BOLD.recurring_orders.app.cartWidget&&(BOLD.recurring_orders.app.cartWidget.checkoutEnabled=!1),"tsm-aquatics.myshopify.com"==OTD_shopName||"petitbowl.myshopify.com"==OTD_shopName||"events-by-daniela.myshopify.com"==OTD_shopName||"gutenmorgenvlbg.myshopify.com"==OTD_shopName||"durian-gao.myshopify.com"==OTD_shopName||"fresh-grinds-cafe.myshopify.com"==OTD_shopName||"okaese.myshopify.com"==OTD_shopName||"birchtree-at-home.myshopify.com"==OTD_shopName||"yippiii.myshopify.com"==OTD_shopName?(jQueryOTD("[name='checkout']").removeAttr("disabled"),jQueryOTD("[name='checkout']").length&&jQueryOTD("[name='checkout']").click(function(e){check_validation(e,l,n,_,t)})):jQueryOTD('a[href="/checkout"]').length?jQueryOTD('a[href="/checkout"]').click(function(e){check_validation(e,l,n,_,t)}):jQueryOTD(".additional-checkout-button").length?jQueryOTD(".additional-checkout-button").click(function(e){check_validation(e,l,n,_,t)}):jQueryOTD("[name='checkout']").length?jQueryOTD("[name='checkout']").click(function(e){check_validation(e,l,n,_,t)}):l.find("[name='checkout']").length&&l.find("[name='checkout']").click(function(e){check_validation(e,l,n,_,t)})),"NULL"!=t.timer_status&&t.delivery_time?(c=u="",c=oddt_day_text_value(t.auto_current_time_c),D=t.auto_current_time_c,e?u=date_change_onTimeDel_function(t,D,"default"):(u=oddt_get_time_slots(t,c,D,t.auto_current_month),1==d&&""==u[1]&&(u="")),!u&&e&&auto_minday_calculation(t.auto_date,t,i,r,s),""!=u||e||(1==t.cutoff_time_min_day||1==t.cutoff_time_status&&t.min_day_value,auto_minday_calculation(t.auto_date,t,i,r,s),s=s+","+oddt_get_date_formated(new Date(t.current_time_c),t.date_format)),oddt_delivery_time_change_action(t.delivery_time_text,e)):0==oddt_cutOffTimeDate(t,o,t.auto_current_time_c,m)&&(auto_minday_calculation(t.auto_date,t,i,r,s),s=s+","+oddt_get_date_formated(new Date(t.current_time_c),t.date_format)),1==t.enable&&1==t.shipping_status&&(jQueryOTD(".appsonrent-dds-main").remove(),jQueryOTD(".otd_container").html(t.shipping_html)),bindDatePicker(i,a,r,t.months_name,t.days_name,s,t.max_date,t,e))}function oddt_delivery_time_change_action(n,_){jQueryOTD(document).on("change",".iw-otd-deliveryTime",function(){jQueryOTD('.iw-otd-deliveryTime option[value="'+jQueryOTD(this).val()+'"]').attr("selected","selected"),jQueryOTD(".uiDeliveryTimeVal").val(jQueryOTD(this).val());var e,t,a,r,i,s=jQueryOTD(this).val(),d=jQueryOTD(".uiDeliveryDateVal").val(),o=jQueryOTD(".uiDeliveryDayVal").val();""!=s&&(i="attributes["+n+"]="+s+"&update",e=jQueryOTD(".uiLocationOrderTypeVal").val(),t=jQueryOTD(".uiLocationNameVal").val(),a=jQueryOTD(".uiLocationAddressVal").val(),r=jQueryOTD(".uiLocationIdVal").val(),i="Shipping"==e?"attributes["+OTD_resultJson.delivery_date_text+"]="+d+"&attributes["+OTD_resultJson.delivery_day_text+"]="+o+"&attributes["+OTD_resultJson.delivery_time_text+"]="+s+"&attributes[Order Type]="+(_?"":"Shipping")+"&attributes[Location Id]=&attributes[Location Name]=&attributes[Location Address]=&attributes[Postal Code]=&update":"Store Pickup"==e?"attributes["+OTD_resultJson.delivery_date_text+"]="+d+"&attributes["+OTD_resultJson.delivery_day_text+"]="+o+"&attributes["+OTD_resultJson.delivery_time_text+"]="+s+"&attributes[Order Type]=Store Pickup&attributes[Location Id]="+r+"&attributes[Location Name]="+t+"&attributes[Location Address]="+a+"&attributes[Postal Code]=&update":"attributes["+OTD_resultJson.delivery_date_text+"]="+d+"&attributes["+OTD_resultJson.delivery_day_text+"]="+o+"&attributes["+OTD_resultJson.delivery_time_text+"]="+s,jQueryOTD.ajax({url:"cart/update.js",async:!0,data:i,type:"POST",dataType:"text"}),cartParsData=i),""==s&&jQueryOTD(".additional-checkout-buttons, .dynamic-checkout__content").hide()})}function oddt_time_dropdown_format_zero(e,t,a,r){var i=e.delivery_time.time,s=find_separator_date(e.date_format),d=formatDate(e.today_date.date),o=(d=d.split("-"))[0],n=d[1],_=d[2],l=dateFormatConvert("dd-mm-yy",e.date_format,"-",s,l=_+"-"+n+"-"+o),d=convertFixDate(a,"mm-dd-yy"),_=new Date(d),n=("0"+_.getDate()).slice(-2),o=("0"+(_.getMonth()+1)).slice(-2),_=_.getFullYear(),m=dateFormatConvert("dd-mm-yy",e.date_format,"-",s,d=n+"-"+o+"-"+_),d=e.select_time_text;"Store Pickup"==jQueryOTD(".uiLocationOrderTypeVal").val()&&(d=e.sp_text_settings.store_pickup_timer_heading);var u=t,c=e.currentmonthday,D=r,y=(b=e.currentHr).split("."),p=e.cutoff_time_status,T=e.cutoff_hour_minute;a=parseDate(a);for(var O=new Date(a).getDate(),f=oddt_month_text_value(a),h="",a="",d='",v=i.split(","),g=e.delivery_time.time_24,b=hide_slots_settings(e,b),j=1==(j=e.is_show_hide_slot)?"start":"end",w=0;w'+g[w]+""):"end"==j&&(parseFloat(b)<=parseFloat(v[w])||parseFloat(v[w])==parseFloat(y[0]))&&(h+='"):1==e.cutoff_time_status&&m==l||1==e.cutoff_time_status&&1==e.cutoff_time_min_day&&m==e.min_date&&0!=e.min_day_value?"start"==j?parseFloat(b)<=parseFloat(v[w])&&parseFloat(b)<=parseFloat(T)&&(h+='"):"end"==j&&(parseFloat(b)<=parseFloat(v[w])||parseFloat(v[w])==parseFloat(y[0]))&&parseFloat(b)<=parseFloat(T)&&(h+='"):parseFloat(b)<=parseFloat(v[w])&&(h+='"):h+='";return a=""!=h?d+h:a}function oddt_time_dropdown_format_one(e,t,a,r){var i=0,s=e.delivery_time,d=e.select_time_text,o=find_separator_date(e.date_format),n=formatDate(e.today_date.date),_=(n=n.split("-"))[0],l=n[1],m=n[2],u=dateFormatConvert("dd-mm-yy",e.date_format,"-",o,u=m+"-"+l+"-"+_),c=convertFixDate(a,"mm-dd-yy"),D=new Date(c),y=("0"+D.getDate()).slice(-2),n=("0"+(D.getMonth()+1)).slice(-2),m=D.getFullYear(),l=dateFormatConvert("dd-mm-yy",e.date_format,"-",o,c=y+"-"+n+"-"+m);"Store Pickup"==jQueryOTD(".uiLocationOrderTypeVal").val()&&(d=e.sp_text_settings.store_pickup_timer_heading);_=t,D=e.currentmonthday,o=r,y=e.currentHr,n=e.cutoff_time_status,m=e.cutoff_hour_minute;a=parseDate(a);for(var c=new Date(a).getDate(),r=oddt_month_text_value(a),p="",a="",d='",T=s.split(","),O=0;O'+T[O]+"";return a=1==(i=0==n||t!=_||parseInt(D)!=parseInt(c)||o!=r||!(1==e.cutoff_time_status&&l==u||1==e.cutoff_time_status&&1==e.cutoff_time_min_day&&l==e.min_date&&0!=e.min_day_value)||parseFloat(y)<=parseFloat(m)?1:i)?d+p:a}function get24hTime(e){var t=0<=(e=String(e).toLowerCase().replace(/\s/g,"")).indexOf("am"),a=0<=e.indexOf("pm");(e=e.replace("am","").replace("pm","")).indexOf(":")<0&&(e+=":00"),t&&(e+=" am"),a&&(e+=" pm");a=new Date("1/1/2011 "+e),e=function(e){return parseInt(e)<10?"0"+e:String(e)};return e(a.getHours())+":"+e(a.getMinutes())}function oddt_time_dropdown_format_three(e,t,a,r){var i=t,s=t,d=e.currentmonthday,o=r,n=e.currentHr,_=e.cutoff_time_status,l=e.cutoff_hour_minute,m=e.select_time_text,u=find_separator_date(e.date_format),c=formatDate(e.today_date.date),D=(c=c.split("-"))[0],y=c[1],r=c[2],p=dateFormatConvert("dd-mm-yy",e.date_format,"-",u,p=r+"-"+y+"-"+D),c=convertFixDate(a,"mm-dd-yy"),r=new Date(c),y=("0"+r.getDate()).slice(-2),D=("0"+(r.getMonth()+1)).slice(-2),r=r.getFullYear(),T=dateFormatConvert("dd-mm-yy",e.date_format,"-",u,c=y+"-"+D+"-"+r);"Store Pickup"==jQueryOTD(".uiLocationOrderTypeVal").val()&&(m=e.sp_text_settings.store_pickup_timer_heading);var O=e.delivery_time,f=e.time_display_format;a=parseDate(a);var h,v,g,b=new Date(a).getDate(),j=oddt_month_text_value(a),a=[];h=null==e.day_arr?["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Special"]:e.day_arr;for(var w,Q,x=[],A=[],S=[],I=[],J=[],n=hide_slots_settings(e,n),k=1==(k=e.is_show_hide_slot)?"start":"end",R=0;R",$=order_limit_time_format(e,""==jQueryOTD(".uiDeliveryDateVal").val()||null==jQueryOTD(".uiDeliveryDateVal").val()?e.min_date:jQueryOTD(".uiDeliveryDateVal").val(),e.all_orders,a[0],a[1],a[2],a[3]);J.forEach(function(e,t){-1'+$[1][H]+"");a=V}return a}function dateFormatConvert_new(e,t,a,r,i){e=e.toLowerCase().split(a),i=i.split(a);i[e[0]]=i[0],i[e[1]]=i[1],i[e[2]]=i[2];a=t.toLowerCase().split(a);return newDate=i[a[0]]+r+i[a[1]]+r+i[a[2]],newDate}function order_limit_time_format(e,t,a,r,i,s,d){for(var o=[],n=e.date_format,e=n.charAt(2),t=dateFormatConvert_new(n,"yy"+e+"mm"+e+"dd",""+e,"-",t),_=0;_=d[D]&&(delete r[D],delete i[D],delete s[D],delete d[D]));return(c=[])[0]=r,c[1]=i,c[2]=s,c[3]=d,c}return(c=[])[0]=r,c[1]=i,c[2]=s,c[3]=d,c}function auto_minday_calculation(e,t,a,r,i,s=""){var d,o,e=t.temp_auto_date,n=t.temp_auto_current_week_day,_=r.charAt(2),_=dateFormatConvert_new(r,"mm"+_+"dd"+_+"yy",""+_,"/",e),l=new Date(_);for("otd_shipping"==s&&(d=l.setDate(l.getDate()-1)),"otd_shipping"!=s&&(d=l.setDate(l.getDate()+1),o=convertFixDate(e=oddt_get_date_formated(new Date(d),r),r),n++,OTD_resultJson.auto_current_week_day++);-1
',""!=e.settings.box_title_text&&(1==e.orders.order_type?a+='

'+e.sp_title_text_settings+"

":a+='

'+e.settings.box_title_text+"

"),""!=e.orders.delivery_time?a+='

'+e.settings.delivery_date+" : "+t+'

'+e.settings.delivery_time+" : "+e.orders.delivery_time+"

":a+='

'+e.settings.delivery_date+" : "+t+"

",1==e.orders.order_type&&(a+='

Store Pickup Address : '+e.orders.location_address+"

"),a+="
",window.Checkout.$(".content .section:nth-child(3) .content-box:first-child").after(a),window.Checkout.$(".iweb-dt-delivery_date").length||window.Checkout.$(".content .section:nth-child(2) .content-box:first-child").after(a))}}))),window.RevyBundle&&(window.RevyBundle.api.checkoutValidator=function(){if("1"!=on_time_appsStatus)return!0;var e=!1;return"1"==on_time_use_time_option?("1"==on_time_required_delivery_date&&""!=jQueryOTD(".iw-order-delivery-dt-deliveryDateVal").val()&&""!=jQueryOTD(".iw-order-delivery-dt-deliveryTimeVal").val()||"0"==on_time_required_delivery_date)&&(e=!0):("1"==on_time_required_delivery_date&&""!=jQueryOTD(".iw-order-delivery-dt-deliveryDateVal").val()||"0"==on_time_required_delivery_date)&&(e=!0),e});