PageSourceSearch

https://rayacom.com/dist/templates/js/product_info.js?1776865533000

js rayacom.com collected 2026-10-05 22:10:24 UTC 129,929 bytes, 1 lines download raw bytes

1var scrolposition,totalkitproduct=0,collapseAccordionId=[],enterKeyAllowedElements=["prdqty","custom_width","custom_height","custom_length"],dfd=shippingcalldfd="",focusedElement="",includeKitChk=!1,realPreviewInstance={},realLargePreviewInstance="",previewTexture={},texture={};function loadPriceCalculator(){var e=$("#tp4overCalc").length?"yes":"no";"product_info.php"==FILE_FILENAME_WITH_EXT&&$("#product_info .price_calculator").length>0&&"no"==e&&$("#product_info .price_calculator").each((function(){var e=$(this),t=e.find(".products_id").val(),a=e.find(".products_id").data("calc_index")??"";e.html('<div class="loading-container-lg"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>");const i=new URLSearchParams(window.location.search);let n="";""!=i.toString()&&(n="&"+i.toString()),"undefined"!=typeof kitId&&(n+="&kitId="+kitId),$.ajax({type:"GET",dataType:"json",url:SITE_URL+FILE_GET_PRODUCT_CALCULATOR+"?selected_product_id="+t+"&get_price_calculator=yes&hideActionBtn=1&lblposition="+calc_lblposition+"&visual_calc_lblposition="+visual_calc_lblposition+"&calc_index="+a+n,success:function(t){e.html(t.html),init_plugins(),apply_slick_slideshow_tooptions(a);var i=0;$("#additionaloptionid"+a).find("input[data-textmp]").each((function(){if(1==$(this).attr("data-setting")){var e=$(this).val();""!=e&&(i+=parseInt(e))}})),""!=i&&$("#prdqty"+a).val(i),"undefined"!=typeof update_price&&"yes"==update_price&&fetch_updated_price_data(e.find("#pricecalulate"+a).serialize(),a);let n="undefined"!=typeof ADMIN_DATE_LOCALE?ADMIN_DATE_LOCALE:FRONT_DATE_LOCALE;if("undefined"!=typeof holidays_arr){var o=JSON.parse(holidays_arr);$("#mailing_date").datetimepicker({buttons:{showToday:!0},ignoreReadonly:!0,allowInputToggle:!0,minDate:minDate,useCurrent:!1,daysOfWeekDisabled:daysOfWeekDisabled_str.split(","),locale:n,disabledDates:o}),$("#mailing_date").on("change.datetimepicker",(({date:e})=>{$("#mailing_date").datetimepicker("hide"),$("#prdqty").trigger("change")}))}if($("#colorpagesrange").popover({html:!0,sanitize:!1,content:function(){return $("#"+this.id+"_content").html()}}).on("shown.bs.popover",(function(e){$(".popover #colorpagenumbers_pop").focus(),bind_colorpopover()})).on("hide.bs.popover",(function(e){$("#clrpages").trigger("change")})),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&PREDEFINED_PRODUCT_TYPE==CANVAS_PRODUCT&&resizeIframe(!1),$('form[id^="pricecalulate"]').each((function(){validatePriceCalc($(this).attr("id")),"undefined"!=typeof FILE_FILENAME_WITHOUT_EXT&&"product_info"==FILE_FILENAME_WITHOUT_EXT&&"function"==typeof triggerEvent&&triggerEvent("event_productInfo")})),$(".kitproduct").length>0?(getkitamount(),galleryOnLoad(a)):galleryOnLoad(),updatePriceTotal(a),"undefined"!=typeof type){var l=$("[name=hire_designer]:checked").val();void 0===l&&(l=$("#hire_designer").val()),1==l&&($(".hire_designer").parent().removeClass("d-none"),$(".hire_designer").parent().removeClass("col-md-4 col-md-3 col-md-6"),$(".upload_design, .browse_design, .quote_product, .custom_design").parent().addClass("d-none"))}var s;("undefined"!=typeof page_from&&"product_info"==page_from&&call_ajax_listing_product_info(a),$("#themelist").length>0&&0==$("#changesize").length&&call_photobook_ajax_listing(a),"1"==$("#fetchtypesauto").val())&&(show_ship_loader(1),"undefined"!=typeof SITE_VAR_SHIPPING_DEFAULT_TYPE&&""!=SITE_VAR_SHIPPING_DEFAULT_TYPE&&(s="default"),getshippingdetails("calculate",s));("undefined"!=typeof canvasIframeURL&&$("body #canvasFrame").attr("src",canvasIframeURL),null!==localStorage.getItem("tax_include"))&&(1==localStorage.getItem("tax_include")?$("#tax_include_"+t.product_id).removeAttr("checked"):$("#tax_include_"+t.product_id).attr("checked"),$("#tax_include_"+t.product_id).trigger("click"));$(".dynamic_customsizehtmlDefault").length>0&&($("#measurement_unit").length>0&&$("#unit_selection").val($("#measurement_unit").val()),$(".dynamic_customsizehtmlDefault #dynamic_custom_width").val($("#custom_width").val()),$(".dynamic_customsizehtmlDefault #dynamic_custom_height").val($("#custom_height").val()).trigger("change")),loadDispatchCountDown(),initializeDatepickerOptions(),$('div[id^="date_opt"].opt_datepicker,input[
1id^="date_opt"].opt_datepicker').on("change.datetimepicker",(e=>{if(totalkitproduct>0||"undefined"!=typeof PHOTOPRINT_PRODUCT&&PREDEFINED_PRODUCT_TYPE===PHOTOPRINT_PRODUCT){var t="#"+$(e.target).parents("form").attr("id"),a=$(t).find("input[name='calc_index']").val();$("#prdqty"+a).trigger("change")}else $("#prdqty").trigger("change")})),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&"undefined"!=typeof PATTERN_PRODUCT&&PREDEFINED_PRODUCT_TYPE==PATTERN_PRODUCT&&changePatternTab(!0)}})}))}function galleryOnLoad(e=""){$(".prduct_option, .prduct_size").parent("div #additionaloptionid"+e+", div #additionaloptiontopid"+e+", #prductsize"+e).each((function(t){null==e&&""==e&&(e=$(this).parents("form").find('input[name="calc_index"]').val());var a=$(this).parents("form").find('input[name="gallery_setting"]').val(),i=$(this).parents("form").find('input[name="prdid"]').val(),n=$("#product-info_"+i+" .carousel-item").find("img").attr("data-attr");if($("#kitImgprd_"+i).val(n),-1!==$.inArray(a,["attribute_wise","option_wise","refer_from_option","option_combination_wise"])&&$("#product_images").carousel("pause"),"attribute_wise"==a||"refer_from_option"==a){var o="";if(($(this).find(".prduct_size .option_gallery select").length>0||$(this).find(".prduct_size .option_gallery input[type='radio']").length>0)&&(o="prdsize"),$(this).find(".option_gallery select").length>0)var l=$(this).find(".option_gallery option:selected").val();else l=$(this).find(".option_gallery input[type='radio']:checked").val();if(""!=l&&null!=l&&map_gallery(l,e,o),0==t&&"prdsize"==o)return!1}else if($(this).find(".option_gallery select").length>0&&"option_wise"==a){var s=$(".kitproduct").length>0?".card #kit_"+i+" .option_gallery":".option_gallery";$("body").on("shown.bs.select",s,(function(t){var a=$(this).find("select").attr("name");if(void 0!==a){var i=a.replace("]","").split("[")[1];null!=i&&""!=i&&map_gallery(i,e)}}))}else if($("#option_comb_gallery_id"+e).length>0&&"option_combination_wise"==a){var r=$("#option_comb_gallery_id"+e).val();void 0!==r&&""!=r&&map_gallery(r,e)}}))}function updatePriceTotal(e){0==$(".kitproduct").length&&$("#productpricetotal"+e).length&&($(".price_calculator #productpricetotal"+e).css("position","static"),mainTop=void 0!==$("#productpricetotal"+e).offset()?$("#productpricetotal"+e).offset().top:"",$(".price_calculator #productpricetotal"+e).css("position","sticky"),stickyTop=void 0!==$("#productpricetotal"+e).offset()?$("#productpricetotal"+e).offset().top:"",stickyTop<mainTop?$("#productpricetotal"+e).addClass("floating-price"):$("#productpricetotal"+e).removeClass("floating-price"))}function getshippingdetails(e,t){var a=!0;if("string"==typeof shippingcalldfd&&""==shippingcalldfd||null==typeof shippingcalldfd?shippingcalldfd=$.Deferred():"object"==typeof shippingcalldfd&&(a=!1,shippingcalldfd.done((function(e){a=!0}))),void 0!==t&&"local_pickup"==t)var i=$("#local_rdshiptype").val();else i=$("#rdshiptype").val();var n=$("#tp4overCalc").length?"yes":"no";return 1==a&&null!=$("form#shippricecalulate").attr("action")&&$.ajax({url:$("form#shippricecalulate").attr("action"),type:"POST",dataType:"json",data:$("form#shippricecalulate").serialize()+"&cElement=shipping&calc_lblposition="+calc_lblposition+"&saction="+e+"&shippinginfo="+shippinginfo+"&shipping_type_id="+i+"&is_4over_product="+n,success:function(a){for(var i in a)"shippingSummary"!=i?$("#"+i).html(a[i]):""!=a.shippingSummary&&null!=a.shippingSummary&&void 0!==a.shippingSummary?($("#shippingSummary").attr("data-content",a.shippingSummary),$("#shippingSummaryDiv").removeClass("d-none"),$("#shippingSummaryDiv").addClass("d-flex")):($("#shippingSummaryDiv").removeClass("d-flex"),$("#shippingSummaryDiv").addClass("d-none"));if($(".local_pickup_style").length&&"2"==$('input[name="local_pickup_selection"]:checked').val()){if(""!=a.shipping_data.selected_ship_method&&null!=a.shipping_data.selected_ship_method&&""!=a.shipping_data.selected_ship_type&&null!=a.shipping_data.selected_ship_type){var o=a.shipping_data.selected_ship_method+"_"+a.shipping_data.selected_ship_type+"_";$("#local_rdshiptype option[value^='"+o+"']").attr("selected","selected")}if(""!=(s=$("#local_rdshiptype").val())&&void 0!==s){var l=s.split("_");$("#shippingprice").val(l[2])}else $("#shippingprice").val("")}else{if(""!=a.shipping_data.selected_ship_method&&null!=a.shipping_data.selected_ship_method&&""!=a.shipping_data.selected_ship_type&&null!=a.shipping_data.selected_ship_type){o=a.shipping_data.selected_ship_method+"_"+a.shipping_data.selected_ship_type+"_";$("#rdshiptype option[value^='"+o+"']").attr("selected","selected")}var s;if(""!=(s=$("#rdshiptype").val())&&void 0!==s){l=s.split("_");$("#shippingprice").val(l[2])}else $("#shippingprice").val("")}$(".selectpicker").selectpicker("refresh"),init_plugins(),$(".local_pickup_style").length&&"2"
1==$('input[name="local_pickup_selection"]:checked').val()?($("#default_shipping_types").addClass("d-none"),$("#default_shipping_types").removeClass("d-flex"),$("#local_shipping_types").removeClass("d-none")):($("#default_shipping_types").removeClass("d-none"),$("#default_shipping_types").addClass("d-flex"),$("#local_shipping_types").addClass("d-none"));var r=isNaN(parseFloat($("#txttotprice").val()))?0:parseFloat($("#txttotprice").val());if("yes"==n)if($("[name='hide_total_price']").length>0)r=isNaN(parseFloat($("[name='hide_total_price']").val()))?0:parseFloat($("[name='hide_total_price']").val());else r=isNaN(parseFloat($("[name='tp4overPrice']").val()))?0:parseFloat($("[name='tp4overPrice']").val());else r=isNaN(parseFloat($("#txttotprice").val()))?0:parseFloat($("#txttotprice").val());var d=isNaN(parseFloat($("#shippingprice").val()))?0:parseFloat($("#shippingprice").val()),c=Number(r)+Number(d);$("#shipestimatetotalprice #disp_total_price").html(CurrencyFormat(c)),$("#shipestimatetotalprice .hidden_total_price").val(c);var p="undefined"!=typeof CORPORATE_SETTING_SHIPPING_OPTIONS&&"fix_shipping_options"==CORPORATE_SETTING_SHIPPING_OPTIONS?$("#rdshiptype").val():$("#freeshippingproduct").val();if("No"!=DISPLAY_INDIVIDUAL_DELIVERY_DAYS||!("undefined"!=typeof SITE_VAR_SHIPPING_DEFAULT_TYPE&&""!=SITE_VAR_SHIPPING_DEFAULT_TYPE||a.shipping_data.is_product_estimate)||"undefined"==typeof DISPLAY_ESTIMATED_DELIVERY_DATE||void 0!==p&&""!=p?"No"==DISPLAY_INDIVIDUAL_DELIVERY_DAYS&&void 0!==p&&""!=p&&updateExpectedDeliveryDate():""==$("#delivery_days_details").html()||""!=$("#delivery_days_details").html()&&"calculate"==e?void 0!==t?updateExpectedDeliveryDate(t):$(".local_pickup_style").length&&updateExpectedDeliveryDate():"state"==e&&$("#delivery_days_details").html(""),"undefined"!=typeof shippingcalldfd&&shippingcalldfd.resolve("done"),$(".additional_info_help").addClass("d-none"),$(".shipping_types").length>0&&$(".additional_info_help").removeClass("d-none"),show_ship_loader(0),"undefined"!=typeof LOCAL_PICKUP_METHOD_DISPLAY&&"1"===LOCAL_PICKUP_METHOD_DISPLAY&&void 0===p)if(2==$('input[name="local_pickup_selection"]:checked').val()){if(1===$("#local_rdshiptype option").length){var _="",u=$("#calcpincode").val(),m=$("#state").val(),h=$("input[name=local_method_pcalc_config]").val();if(void 0!==h&&"CS"===h&&"0"!==m?_=void 0!==$("select[name='state'] option:selected").html()?$("select[name='state'] option:selected").html():m:void 0!==h&&"CZ"===h&&(_=u),0===$(".store_pickup_error").length){var g=""!=_?LOCAL_PICKUP_NOT_AVAILABLE_FOR_POSTCODE_OR_STATE.replace("%s",_):LOCAL_PICKUP_NOT_AVAILABLE;$(".shipping_type_error").length>0&&$(".shipping_type_error").remove(),$("#local_shipping_types").after('<div class="text-danger store_pickup_error">'+g+"</div>")}}}else 1===$("#rdshiptype option").length&&0===$(".default_shipping_error").length&&0===$(".shipping_type_error").length&&$("#default_shipping_types").after('<div class="text-danger default_shipping_error">'+SHIPPING_TYPE_NOT_EXISTS+"</div>");updateDispatchDate(a.production_due_date),null!==a.production_due_date&&$("body #calc_pro_days").val(0)}}),!1}function SendMailToCustomer(e){if($(".local_pickup_style").length&&"2"==$('input[name="local_pickup_selection"]:checked').val())var t=$("#local_rdshiptype").val();else t=$("#rdshiptype").val();var a=$("#email_id").val(),i=$(".hidden_total_price").val(),n=$("#total_price_with_tax").val(),o=[];$('input[name="taxAmt[]"]').each((function(){o.push($(this).val())}));var l=""!=$(".unit_price").last().text()?$(".unit_price").last().text():"",s=!1;if("pricecalc"==e){var r=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a);if(!r)return bootbox.alert(message_invalid),r}else s=!0;$("#"+e).addClass("running disabled");var d=$("#estimated_delivery_date").length>0?$("#estimated_delivery_date").val():"";return 1==s?$.ajax({url:"/product_mailcalc.php",type:"POST",xhrFields:{responseType:"blob"},data:"email="+a+"&shipping="+t+"&totamt="+i+"&unit_price="+l+"&is_download_price_calc="+s+"&esti_deli_date="+d+"&tax_detail="+JSON.stringify(o)+"&tot_amt_tax="+n,success:function(e){var t=new Blob([e],{type:"application/pdf"}),a=URL.createObjectURL(t),i=document.createElement("a");i.href=a,i.download="product_estimate.pdf",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)},error:function(){var e=JSON.parse($.cookie("flashmsg"));void 0!==e&&e.info[0].length>
10&&(COMMON_SERVER_RESPONSE_ERROR=e.info[0]),$.bootstrapGrowl(COMMON_SERVER_RESPONSE_ERROR,{type:"danger",align:"center",icon:"fa fa-exclamation-triangle fa-2x",delay:-1})},complete:function(){$("#pricecalc").removeClass("running disabled"),$("#"+e).removeClass("running disabled"),$(".ajax_loader").css("display","none")}}):$.ajax({url:"/product_mailcalc.php",type:"POST",data:"email="+a+"&shipping="+t+"&totamt="+i+"&unit_price="+l+"&is_download_price_calc="+s+"&esti_deli_date="+d+"&tax_detail="+JSON.stringify(o)+"&tot_amt_tax="+n,success:function(t){$.bootstrapGrowl(message_success),$("#"+e).removeClass("running disabled")}}),!1}function upload_submit(){}function upload_success(e,t,a){var i=a.file_name,n=a.option_id,o=n.split("_")[1];if($("input[name='option_"+n+"']").val("uploaded"),jQuery(".qq-upload-success").html(""),"multipleFile"==n.split("_")[0]){var l=jQuery(".option_"+n),s=$("input[name='"+l.attr("name")+"']").length;if(l.val()){var r=n+"_"+s;l.after('<input type="hidden" name="'+l.attr("name")+'" value="'+i+'" class="option_'+r+'">')}else{var d=/\[\]$/.test(l.attr("name"))?l.attr("name"):l.attr("name")+"[]";l.attr("name",d),l.val(i);r=n}var c='<a onclick=deleteattribute("'+r+'","aoptions['+o+']","'+o+'");  href="javascript:void(0);" class="text-danger px-1 "> <i class="far fa-times-circle cursor-pointer text-danger"></i> </a>';jQuery("#"+n).find("#showuploadfile").append('<div class="uppy-multiple-filename '+r+'"><div id="fileop_'+o+'" class="mr-2 word-break" title="'+i+'">'+i+"</div><div> "+c+"</div></div>")}else{var p=`<div class="res-img d-flex align-items-center justify-content-between bg-white" ><div class="mr-2">${t}</div><div>${'<a href="javascript:;" title="'+COMMON_DELETE_TEXT+'"><i class="far fa-times-circle cursor-pointer text-danger remove_file" onclick=deleteattribute("'+n+'","aoptions['+o+']","'+o+'")></a>'}</div></div>`;jQuery("#"+n).siblings("[name=aoptions\\["+o+"\\]]").val(i),jQuery("#"+n).find("#showuploadfile").html(p)}}function deleteattribute(e,t,a){bootbox.confirm(COMMON_ALERT_DELETE,(function(i){if(i){var n=$(".option_"+e).val(),o=$("input[id='"+t+"']").parents("form").find('input[name="calc_index"]').val(),l=$("#prdid").val();void 0===l&&void 0!==o&&(l=$("#prdid"+o).val());var s=e.split("_")[2];s||(s=0),jQuery.ajax({url:"/"+SITE_UPLOAD_AJAX_DIRECTORY+FILE_COMMON_UPLOAD,data:"file_name="+n+"&page=product_option_file&action=delete&optId="+a+"&productId="+l+"&fileId="+s,success:function(t){"deleted"==t&&(0!=s?$(".option_"+e).remove():$(".option_"+e).val(""),1==$("input[name='aoptions["+a+"][]']").length&&""==$("input[name='aoptions["+a+"][]']").val()&&($("input[name='option_file_"+a+"']").val(""),$("input[name='aoptions["+a+"][]']").attr("name","aoptions["+a+"]")))}}),"multipleFile"==e.split("_")[0]?jQuery("#showuploadfile ."+e).remove():jQuery("#"+e).find("#showuploadfile").html(""),jQuery("#dragdrop_file"+e).removeClass("d-none")}}))}function updateExpectedDeliveryDate(e){if(void 0!==e&&"local_pickup"==e)var t=$("#local_rdshiptype").val(),a=$("#local_rdshiptype option:selected").attr("data-duedate");else t=$("#rdshiptype").val(),a=$("#rdshiptype option:selected").attr("data-duedate");if("shipping_type"!=e&&void 0!==t&&""!=t&&("Yes"==DISPLAY_ESTIMATED_DELIVERY_DATE||"Retailers"==DISPLAY_ESTIMATED_DELIVERY_DATE&&"1"==SES_USER_TYPE_ID||"Corporates"==DISPLAY_ESTIMATED_DELIVERY_DATE&&"2"==SES_USER_TYPE_ID)){var i="-1"==t.split("_")[0]?ESTIMATED_PICKUP_DATE:ESTIMATED_DELIVERY_DATE;$("#delivery_days_details").html('<i class="fa fa-refresh fa-spin"></i>');var n='<span class="ml-2"><a href="javascript:void(0);" data-easein="fadeInDown" data-placement="bottom" data-toggle="popover" data-container="body" data-trigger="click" data-original-title="'+ADDITIONAL_INFO_HELP_MESSAGE+'" id="estdelhelp"><i class="fas fa-info-circle"></i></a><div class="d-none" id="estdelhelp_content"><div class="help_popup">'+ESTIMATE_DELIVERY_HELP_MESSAGE+"</div></div>";n+="</span>";var o=i.replace(/%s/g,a);o+='<input type="hidden" id="estimated_delivery_date" value="'+a+'">',$("#delivery_days_details").html(o+n),$("#delivery_days_details").show(),init_plugins()}else $("#delivery_days_details").hide();return!1}function check_custom_size_predefined_height_width(){if($("#price_define_method").length&&"3"==$("#price_define_method").val()&&$("#predefined_custom_size").length){var e=!1;if($("#restrict_custom_width").length>0&&"yes"==$("#restrict_custom_width").val()&&!e){var t=parseFloat(parseFloat($("#min_width").val()).toFixed(2)),a=parseFloat(parseFloat($("#max_width").val()).toFixed(2));if($('input[name="predefined_custom_size"]').is(":radio")?custom_width=parseFloat(parseFloat($('input[name="predefined_custom_size"]:checked').attr("data-width")).toFixed(2)):custom_width=parseFloat(parseFloat($("#predefined_custom_size option:selected").attr("data-width")).toFixed(2)),(custom_width>a||custom_width<t)&&t&&a){var i=CUSTOM_SIZE_RESTRICT_WIDTH_ALERT,n=" ";$("#custom_unit_code").length&&(n+=$("#custom_unit_code").val()),i=(i=i.replace("%s",t+n)).replace("%s",a+n),e=!0}}if($("#restrict_custom_height").length>0&&"yes"==$("#restrict_custom_height").val()){var o=parseFloat(parseFloat($("#min_height").val()).toFixed(2)),l=parseFloat(parseFloat($("#max_height").val()).toFixed(2));if($('input[name="predefined_custom_size"]').is(":radio")?custom_height=parseFloat(parseFloat($('input[name="predefined_custom_size"]:checked').attr("data-height")).toFixed(2)):custom_height=parseFloat(parseFloat($("#predefined_custom_size option:selected").attr("data-height")).toFixed(2)),(custom_height>l||custom_height<o)&&o&&l){var s=CUSTOM_SIZE_RESTRICT_HEIGHT_ALERT;n=" ";$("#custom_unit_code").length&&(n+=$("#custom_unit_code").val()),s=(s=s.replace("%s",o+n)).replace("%s",l+n),e=!0}}if($("#restrict_custom_length").length>0&&"yes"==$("#restrict_custom_length").val()){var r=parseFloat(parseFloat($("#min_length").val()).toFixed(2)),d=parseFloat(parseFloat($("#max_length").val()).toFixed(2));if($('input[name="predefined_custom_size"]').is(":radio")?custom_length=parseFloat(parseFloat($('input[name="predefined_custom_size"]:checked').attr("data-length")).toFixed(2)):custom_length=parseFloat(parseFloat($("#predefined_custom_size option:selected").attr("data-length")).toFixed(2)),(custom_length>d||custom_length<r)&&r&&d){var c=CUSTOM_SIZE_RESTRICT_LENGTH_ALERT;n=" ";$("#custom_unit_code").length&&(n+=$("#custom_unit_code").val()),c=(c=c.replace("%s",r+n)).replace("%s",d+n),e=!0}}e?($("#custom_size_error").remove(),i=null!=i?i+"</br>":"",s=null!=s?s:"",c=null!=c?c:"",$("#prductqty").before('<div class="error-block text-danger position-static mb
1-3" id="custom_size_error">'+c+i+s+"</div>")):$("#custom_size_error").remove()}}function bind_colorpopover(){var e=".popover";$("#colorpagesrange_popupcontent").length>0&&(e="#colorpagesrange_popupcontent"),$(e+" #colorpagenumbers_pop").val($("#colorpagenumbers").val()),$(".help_popup #colorpagenumbers_pop").keyup((function(t){if(9!=t.keyCode&&16!=t.keyCode){string=$(this).val(),string=string.replace(/[^\d, -]+/g,""),string=string.replace(/,+/g,","),$(this).val(string),colorpages=$(this).val();var a=colorpages.split(","),i=[];a.forEach((function(e){if(-1===e.indexOf("-"))t=parseInt(e),isNaN(t)||(i=i.setRange(t));else{var t=e.split("-"),a=parseInt(t[0]);if(!isNaN(a))if(lastpage=parseInt(t[t.length-1]),isNaN(lastpage))i=i.setRange(a);else{var n=Math.min(a,lastpage),o=Math.max(a,lastpage);i=i.setRange(n,o)}}}));for(var n=0,o=0;o<i.length;o++)"object"!=typeof i[o]?n++:n+=i[o][1]-i[o][0]+1;$("#clrpages").val(n)}$("#colorpagenumbers").val($(e+" #colorpagenumbers_pop").val())}))}function apply_slick_slideshow_tooptions(e){if("undefined"!=typeof SITE_VAR_VISUAL_CALC_SLIDE_TO_SHOW&&""!=SITE_VAR_VISUAL_CALC_SLIDE_TO_SHOW){var t=$("#pricecalulate"+e).parent(".price_calculator").width(),a=JSON.parse(SITE_VAR_VISUAL_CALC_SLIDE_TO_SHOW);(a=t<=320?a.mobile_view:t<=420?a.ipad_view:a.desktop_view)<1&&(a=1),$("#prductsize"+e+" .slide, #prductqty"+e+" .slide, #additionaloptionid"+e+" .slide, #additionaloptiontopid"+e+" .slide").not(".slick-initialized").slick({slidesToShow:a,slidesToScroll:1,infinite:!1}).each((function(){$(this).removeClass("slide-invisible");var e=$(this);$(this).find('input[type="radio"]:checked, input[type="checkbox"]:checked').each((function(){var t=parseInt($(this).data("id"))-a;t=t>0?t:0,e.slick("unslick"),e.slick({slidesToShow:a,slidesToScroll:1,infinite:!1,initialSlide:t})}))}))}}function call_ajax_listing_product_info(e){var t=template_size=category_list=template_html="";if($("#pid").length>0&&(t=$("#pid").val()),$("#pricecalulate #prdsize"+e).length>0&&(size_id=$("#prdsize"+e).val(),size_id=size_id.split("_"),template_size=size_id[0]),0==$("#pricecalulate #prdsize"+e).length&&$("input[name=prdsize]").length>0&&(size_id=$("input[name=prdsize][type=radio][checked=checked]").val(),size_id=size_id.split("_"),template_size=size_id[0]),null!=document.getElementById("templatecat")){document.getElementById("templatecat").value;$(".templatecat").removeClass("act"),$("div .templatecat").first().addClass("templatecat act")}var a="size="+template_size+"&templatecat=0&pid="+t+"&is_ajax=true",i=SITE_DIRECTORY+FILE_AJAX_GET_PRODUCT_INFO_DESIGNS+"?"+a;return $.ajax({url:i,type:"POST",data:a,dataType:"json",beforeSend:function(){$("#templates_listing_area").html('<div class="loading-container-sm"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>")},success:function(e){if(""!=e){let t=e.response,a=$("#templatelist").parent().attr("class");t.includes("templates_not_found")&&a&&!1===a.includes("tab")?$("#templatelist").hide():($("#templates_listing_area").html(t),$("#templatelist").show())}else $("#templatelist").hide();init_plugins(),TEMPLATES_NO_PER_ROW=parseInt(TEMPLATES_NO_PER_ROW),$("body").on("shown.bs.tab",'#templates_listing_area a[data-toggle="tab"]',(function(e){var t=(t=$(this).attr("href")).substr(9,t.length);try{$(".design_slide"+t).slick("unslick")}catch(e){}$(".design_slide"+t).slick({infinite:!1,slidesToShow:TEMPLATES_NO_PER_ROW,rows:0,responsive:[{breakpoint:1024,settings:{slidesToShow:2}},{breakpoint:768,settings:{slidesToShow:1}}]})})),$('#templates_listing_area a[data-toggle="tab"]:first').trigger("shown.bs.tab"),$(".nav-tabs-dropdown").each((function(e,t){$(t).text($(t).next("ul").find("li.active a").text())})),$(".nav-tabs-dropdown").on("click",(function(e){e.preventDefault(),$(e.target).toggleClass("open").next("ul").slideToggle()})),$("body").on("click","#nav-tabs-wrapper a",(function(e){e.preventDefault(),$(e.target).closest("ul").prev("a").removeClass("open").text($(this).text())})),$("[data-toggle=tooltip]").tooltip({container:"body"})}}),!1}function fetch_updated_price_data(e,t){$("#productpricetotal"+t).length,$("#productpricetotal"+t+" span").addClass("hidden"),e=e.replace("calcaction=icalc&",""),$.ajax({type:"POST",url:SITE_DIRECTORY+FILE_PRICE_LIST,data:"action=get_price&"+e,success:function(e){$("#productpricetotal"+t).length&&$("#product_price_table").html(e)}})}function call_photobook_ajax_listing(e){var t=template_size=extra_param="";$("#pid").length>0&&(t=$("#pid").val()),$("#prdsize"+e).length>0&&(size_id=$("#prdsize"+e).val(),size_id=size_id.split("_"),template_size=size_id[0]),0==$("#prdsize"+e).length&&$("input[name=prdsize]").length>0&&(size_id=$("input[name=prdsize][type=radio][checked=checked]").val(),"undefined"!=typeof size_id&&(size_id=size_id.split("_"),template_size=size_id[0])),$("#changesize").length>0&&(template_size=$("#changesize").val()),$("#pa_calculator").attr("href",SITE_URL+FILE_PHOTOBOOK_PRICE_CALCULATOR+"?productid="+t+"&sizeid="+template_size+"&product_type="+product_type+"&pe="+product_estimate);var a="size="+template_size+"&pid="+t+"&is_ajax=true";if($("#category_list .act").length>0){var i=$("#category_list .act").attr("id");void 0!==i&&(extra_param="&templatecat="+i)}var n=$("#product_sorting option:selected").val();""!=n&&(extra_param+="&sortFilter="+n);var o=SITE_DIRECTORY+FILE_PHOTOBOOKS_DESIGNS_RESPONSE+"?"+a+extra_param;return $.ajax({url:o,type:"POST",data:a,dataType:"json",beforeSend:function(){$("#theme_listing_area").html('<div class="loading-container"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>")},success:function(e){$("#theme_listing_area").html(e.response),init_plugins()}}),!1}function show_loader(e,t){$loader=$("#normalcalc"+t+",#normalcalc"+t+" .ld-ext-left","#price_calculator"+t),e?($loader.addClass("running"),$(".calc_loading").show(),$(".ld-over","#frmkitinfo").addClass("running")):($loader.removeClass("running"),$(".calc_loading").hide(),$(".ld-over","#frmkitinfo").removeClass("running"))}function show_ship_loader(e){$loader=$("#shipping_detail, #shipping_detail .ld-ext-left"),$(document).ajaxStart((function(){$($loader).addClass("running"),$("#download_pricecalc, #pricecalc").addClass("disabled")})).ajaxStop((function(){$($loader).removeClass("running"),$("#download_pricecalc, #pricecalc").removeClass("disabled")}))}function map_gallery(e,t,a=""){var i=$('input[name="gallery_setting"]',"#pricecalulate"+t).val(),n=$(".kitproduct").length>0?"_"+$('input[name="prdid"]',"#pricecalulate"+t).val():"",o=0==$(".attr_"+e).length,l="";if("prdsize"==a||"predefined_custom_size"==a){l=".size_"+e;if("predefined_custom_size"==a)l="."+e;o=0==$(l).length}if("refer_from_option"==i&&o)$("#pricecalulate"+t).find(".option_gallery").each((function(){if("prdsize"==a||"predefined_custom_size"==a)var i=e;else i=$(this).find("option:selected").val();if(null==i||""==i)i=$(this).find("input[type='radio']:checked").val();if(null!=i){var o="."+i;if(("prdsize"==a||"predefined_custom_size"==a)&&$(o).length>0){$("#product_images .carousel-item, #product_images"+n+" .carousel-item, #pricecalulate"+t).removeClass("active"),$(o).parents(".carousel-item").addClass("active");var l=$(o).data("attr");return $("#productsImageGalleryId").val(l),$("#kitImgprd"+n).val(l),!1}if($(".attr_"+i).length>0){$("#product_images .carousel-item, #product_images"+n+" .carousel-item, #pricecalulate"+t).removeClass("active"),$(".attr_"+i).parents(".carousel-item").addClass("active");l=$(".attr_"+i).data("attr");return $("#productsImageGalleryId").val(l),$("#kitImgprd"+n).val(l),!1}$("#product_images"+n+" .carousel-item").removeClass("active"),$("#product_images"+n+" .carousel-item").first().addClass("active")}}));else if(!($(".attr_"+e).length>0||$(l).length>0)||"attribute_wise"!=i&&"refer_from_option"!=i)if("option_wise"==i){if($(".option_"+e).length>0){$("#product_images .carousel-item, #product_images"+n+" .carousel-item").removeClass("active"),$(".option_"+e).parents(".carousel-item").addClass("active");s=$(".option_"+e).data("attr");$("#productsImageGalleryId").val(s),$("#kitImgprd"+n).val(s)}}else if("option_combination_wise"==i){if($(".gallery_id_"+e).length>0){$("#product_images .carousel-item, #product_images"+n+" .carousel-item, #pricecalulate"+t).removeClass("active"),$(".gallery_id_"+e).parents(".carousel-item").addClass("active");s=$(".gallery_id_"+e).data("attr");$("#productsImageGalleryId").val(s),$("#kitImgprd"+n).val(s)}}else $("#product_images"+n+" .carousel-item").removeClass("active"),$("#product_images"+n+" .carousel-item").first().addClass("active");else{$("#product_images .carousel-item, #product_images"+n+" .carousel-item, #pricecalulate"+t).removeClass("active"),("prdsize"==a||"predefined_custom_size"==a)&&$(l).length>0?$(l).parents(".carousel-item").addClass("active"):$(".attr_"+e).parents(".carousel-item").addClass("active");var s=("prdsize"==a||"predefined_custom_size"==a)&&$(l).length>0?$(l).data("attr"):$(".attr_"+e).data("attr");$("#productsImageGalleryId").val(s),$("#kitImgprd"+n).val(s)}}if(jQuery(document).ready((function(e){"undefined"!=typeof AJAX_BASED_PRICE_CALCULATOR&&"yes"==AJAX_BASED_PRICE_CALCULATOR&&(loadPriceCalculator(),e("#tp4overCalc").length>0&&loadDispatchCountDown()),e(".video_script_class").on("click",(function(){var t=e(this).attr("id");Fancybox.show([{src:"#"+t,type:"inline"}])})),e("iframe").parent("div").hasClass("video-container")&&(e(".carousel-control-next, .carousel-control-prev").on("click",(function(){e('.video-container iframe[src*="https://www.youtube.com/embed/"], iframe[src*="http://www.youtube.com/embed/"]').each((function(e){this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})),jQuery(".video-container").find("iframe").contents().find("video").length>0&&jQuery(".video-container").find("iframe").contents().find("video").get(0).pause()})),e(".carousel").on("slide.bs.carousel",(function(){e('.video-container iframe[src*="https://www.youtube.com/embed/"], iframe[src*="http://www.youtube.com/embed/"]').each((function(t){var a=function(e,t){var a=t.split("?");return void 0!==a[1]&&-1==a[1].indexOf(e)?t=t+"&"+e:void 0===a[1]&&(t=t+"?"+e),t}("enablejsapi=1",e(this).attr("src"));e(this).attr("src",a),this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})),jQuery(".video-container").find("iframe").contents().find("video").length>0&&jQuery(".video-container").find("iframe").contents().find("video").get(0).pause()})));var t="";if("undefined"!=typeof AJAX_BASED_PRICE_CALCULATOR&&"no"==AJAX_BASED_PRICE_CALCULATOR&&(bind_colorpopover(),getkitamount()),"undefined"==typeof calc_lblposition&&(calc_lblposition="updown"),"undefined"==typeof visual_calc_lblposition&&(visual_calc_lblposition="updown"),e(".admin_colorpagenumbers").change((function(){e("#clrpages").trigger("change")})),e('input[name="predefined_custom_size"]').is(":radio"))var a=e('input[name="predefined_custom_size"]:checked').attr("data-width"),i=e('input[name="predefined_custom_size"]:checked').attr("data-height"),n=e('input[name="predefined_custom_size"]:checked').attr("data-length");else a=e("#predefined_custom_size option:selected").attr("data-width"),i=e("#predefined_custom_size option:selected").attr("data-height"),n=e("#predefined_custom_size option:selected").attr("data-length");null!=e("#predefined_custom_size option:selected").val()&&-1!=e("#predefined_custom_size option:selected").val()&&(void 0!==a&&e("#custom_width").val(a),void 0!==i&&e("#custom_height").val(i),void 0!==n&&e("#custom_length").val(n)),e("body").on("keydown","form[id^='pricecalulate'] input:text, input[type=number]",(function(t){if(13==t.which)return e(this).trigger("blur"),!1;9==t.which&&setTimeout((function(){void 0===(focusedElement=e(".div_calculator").find(":focus").attr("name"))&&"button"==e(".div_calculator").find(":focus").prop("type")&&(focusedElement=e(".div_calculator").find(":focus").data("id"))}),1)})),"undefined"!=typeof AJAX_BASED_PRICE_CALCULATOR&&"no"==AJAX_BASED_PRICE_CALCULATOR&&(e(".kitproduct").length>0?e(".kitproduct").each((function(){galleryOnLoad(e(this).find('input[name="calc_index"]').val())})):galleryOnLoad(),loadDispatchCountDown()),e("body").on("keyup",".page",(function(){this.value=this.value.replace(/[^0-9.]/g,""),this.value=this.value.replace(/(\..*)\./g,"$1"),0===this.value.indexOf(".")&&(this.value="
10"+this.value)})),e('#mailing input[name="mailing_date"]').on("change.datetimepicker",(({date:t})=>{e("#prdqty").trigger("change")}));e(document).on("click",".add-qty",(function(){e("#qty_action").val("add");var t=parseInt(e('body :input[id^="prdqty"]').last().attr("id").replace("prdqty",""));t=isNaN(t)?0:t,e("#quantity_number").val(t),e("#prdqty").trigger("change")})),e(document).on("click",".remove-qty",(function(){index=e(this).data("index"),e("#delete_index").val(index),e("#qty_action").val("delete");var t=parseInt(e('body :input[id^="prdqty"]').last().attr("id").replace("prdqty",""));e("#quantity_number").val(t),e("#prdqty").trigger("change")}));var o=0;e("#additionaloptionid").find("input[data-textmp]").each((function(){if(1==e(this).attr("data-setting")){var t=e(this).val();""!=t&&(o+=parseInt(t))}})),""!=o&&e("#prdqty").val(o),totalkitproduct=e(".kitproduct").length,e('div[id^="date_opt"].opt_datepicker,input[id^="date_opt"].opt_datepicker').on("change.datetimepicker",(t=>{if(totalkitproduct>0||"undefined"!=typeof PHOTOPRINT_PRODUCT&&PREDEFINED_PRODUCT_TYPE===PHOTOPRINT_PRODUCT){var a="#"+e(t.target).parents("form").attr("id"),i=e(a).find("input[name='calc_index']").val();e("#prdqty"+i).trigger("change")}else e("#prdqty").trigger("change")}));var l,s="undefined"!=typeof prodWiseOutOfStockData&&""!=prodWiseOutOfStockData?JSON.parse(prodWiseOutOfStockData):"";(e(document).on("change",'.div_calculator input:radio, .div_calculator select, .div_calculator input[type="text"][name="prdqty"], .div_calculator input:not([name^="aoptions"]), .div_calculator input[type="text"].page, .div_calculator input:checkbox, .div_calculator textarea#colorpagenumbers, .div_calculator input:not(.datepicker), button[id^="layout_"], [name="canvasWallLayouts"], .kitincludekit input:checkbox, .div_calculator textarea',".price_calculator",(function(t){if(e(this).hasClass("studio_input"))return!1;if(e(this).parents("#customize_design_block").length>0)return e(".studio_design.thumb_preview").click(),!1;scrolposition=e(window).scrollTop();var o=e(this).attr("name"),l=e(this).attr("id");if(-1!==o.indexOf("tax_include"))return t.preventDefault(),!1;if("undefined"!=typeof quickDesign&&"1"==quickDesign){if("comment_agree"==l)return!1;if(!e(this).valid())return e("#optionStep").click(),e("#personalize").addClass("disabled"),e(".productPages").addClass("disabled"),!1;e("#personalize").removeClass("disabled"),e(".productPages").removeClass("disabled")}var r=e(this).attr("type"),d="#"+e(this).parents("form").attr("id"),c=e('input[name="calc_index"]',d).val(),p=(parseInt(e("#price_define_method",d).val()),e(this).parents("#additionaloptiontopid").length);if("file"==r)return!0;dfd=e.Deferred();var u="";if(-1!==o.indexOf("colorpicker"))return t.preventDefault(),!1;if("wallLayout"==o){var m=e(this).attr("id");layoutId=m.split("_")[1],"undefined"==typeof canvasSubType&&(canvasSubType="1")}else"canvasWallLayouts"==o&&(layoutId=e(this).val(),"undefined"==typeof canvasSubType&&(canvasSubType="1"),o="wallLayout",r="button");"undefined"==typeof layoutId&&(layoutId=e("#layout_id").val(),"undefined"==typeof canvasSubType&&(canvasSubType="1")),"undefined"!=typeof canvasSubType&&-1!==jQuery.inArray(canvasSubType,["1","2"])&&(u="&layout_id="+layoutId+"&predefined_product_type="+e("#predefined_product_type").val());var h="";"undefined"!=typeof modify_action&&(h="&action="+modify_action),e("#div_prductqty div #errorQuantity",d).html(""),"undefined"!=typeof is_mailing_product&&1==is_mailing_product&&(e(".shippingcalc").show(),Number(e("#prdqty"+c).val())==Number(e("#mailing_quantity").val())&&(e(".shippingcalc").hide(),e("#shippingprice").val(0)),"undefined"!=typeof common_mailing_qty&&1==common_mailing_qty&&"undefined"!=typeof SERVICE_TYPE&&(SERVICE_TYPE!=PS_PRINTING_AND_MAILING_OPTIONAL||SERVICE_TYPE==PS_PRINTING_AND_MAILING_OPTIONAL&&"Yes"==e('input[name="mailing_calc"]:checked').val())&&e("#mailing_quantity").val(e("#prdqty").val())),e("#stock_error_msg_load",d).addClass("d-none").hide();var g=!1;if(-1!==o.indexOf("prdqty")&&("0"!=e("#form_type").val()||"select-one"!=this.type&&"0"==e("#form_type").val())||"bwpages"==o||"clrpages"==o){if(num_val
1idation=isNumber(e(this).val(),ENTER_VALID_INPUT),""!=num_validation)if(e(this).val(""),"bwpages"==o)e(this).val(1);else"book"==e("#calc_prdtype").val()&&"prdqty"==o?e(this).val(1):e(this).val("");var f=e(this).val();e(this).val(Math.floor(f))}if("predefined_custom_size"==o){var v=e(this).val();if("yes"==e("#restrict_qty").val())parseInt(e("#minqty").val());if("-1"!=v)e('input[name="predefined_custom_size"]').is(":radio")?(a=e('input[name="predefined_custom_size"]:checked').attr("data-width"),i=e('input[name="predefined_custom_size"]:checked').attr("data-height"),n=e('input[name="predefined_custom_size"]:checked').attr("data-length")):(a=e("#predefined_custom_size option:selected").attr("data-width"),i=e("#predefined_custom_size option:selected").attr("data-height"),n=e("#predefined_custom_size option:selected").attr("data-length")),e("#custom_width").val(a),e("#custom_height").val(i),e("#custom_length").val(n);else{var y=JSON.parse(sessionStorage.getItem("customSizes"));e("#custom_width").val(y&&y.customWidth>0?y.customWidth:null),e("#custom_height").val(y&&y.customHeight>0?y.customHeight:null),e("#custom_length").val(y&&y.customLength>0?y.customLength:null),void 0!==e("#measurement_unit").val()&&y&&void 0!==y.measurement_unit&&void 0!==y.prevMeasurementUnit&&(e("#measurement_unit").val(y.measurement_unit),e("#prev_measurement_unit").val(y.prevMeasurementUnit))}}if("custom_width"==o||"custom_height"==o||"measurement_unit"==o||"custom_length"==o){if("measurement_unit"!=o&&(num_validation=isCurrencyNumber(e(this).val(),ENTER_VALID_INPUT),num_validation||e(this).val("")),a=e("#custom_width").val(),i=e("#custom_height").val(),n=e("#custom_length").val(),void 0!==e("#predefined_custom_size").val()){y={customWidth:a,customHeight:i,customLength:n};var E=void 0!==e("#measurement_unit").val()?e("#measurement_unit").val():"",T=void 0!==e("#prev_measurement_unit").val()?e("#prev_measurement_unit").val():"";y={customWidth:a,customHeight:i,customLength:n,measurement_unit:E,prevMeasurementUnit:T};sessionStorage.setItem("customSizes",JSON.stringify(y))}""!=e(this).val()&&0!=e(this).val()||(e(this).val(""),g=!0)}"includeinkit"==o&&(e("input[name^='includeinkit']:checked").length<=0&&!includeKitChk&&bootbox.alert(SELECT_AT_LEAST_ONE_PRODUCT));if(e(".page").each((function(){var t=e(this).attr("id"),a=e("#"+t).data("maxvalue"),i=e("#"+t).data("minvalue");e("#err_"+t).addClass("d-none");var n=e("#"+t).attr("step");num_validation=isNumber(e(this).val(),ENTER_VALID_INPUT),""!=num_validation&&e(this).val("");var o=e(this).attr("data-rule-required");(e(".kitproduct").length>0&&e(this).val()&&0==e(this).val()&&null!=o&&(e("#err_"+t).removeClass("d-none"),g=!0),(parseInt(e(this).val())>a||0==parseInt(e(this).val())&&null!=o||parseInt(e(this).val())<i)&&(e("#err_"+t).removeClass("d-none"),g=!0),""!=e(this).val()&&null!=n)&&(e("#errstep_"+t).addClass("d-none"),checkMultipleOfNumber(e(this).val(),n)||(e("#errstep_"+t).removeClass("d-none"),g=!0));e(".image_column").length>0&&e(this).val()&&0==e(this).val()&&null!=o&&(e("#err_"+t).removeClass("d-none"),g=!0)})),1==g)return!1;var b=e("#coverinpdf_note").val(),I="";void 0!==b&&(I="&covernotes="+b);var C=e("#no_of_kit").val();e(".kitproduct").length>0&&(I="&no_of_kit="+C),show_loader(1,c),show_ship_loader(1),e(".tooltip").remove();var $=0,D=!1;e("#additionaloptionid"+c).find("input[data-textmp]").each((function(){if(1==e(this).attr("data-setting")){var t=e(this).val();""!=t&&($+=parseInt(t)),D=!0}})),1==D&&e("#prdqty"+c).val($);var P="";"undefined"!=typeof orderType&&"reorder"==orderType&&(P="&type="+orderType);var k="";if(e(this).parent("div").hasClass("option_gallery")&&(k=e(this).val()),"option_wise"==e('input[name="gallery_setting"]',"#pricecalulate"+c).val())O=(o=e(this).attr("name")).replace("]","").split("[")[1];else var O=e(this).val();var A="",x=e("#store_id").val();if("undefined"!=typeof edit_order&&""!=edit_order)A="&edit_order="+edit_order;if("bwpages"==o&&0==e("#clrpages").length){var w=parseInt(e("#max_pages").val()),S=parseInt(e("#min_pages").val()),R=(z=e("#bwpages").val())>w||z<S?0:1;e("#is_valid_bwpages").val(R)}else if(("clrpages"==o||"bwpages"==o)&&e("#clrpages").length>0){var L="clrpages"!=o?"clrpages":"bwpages",N=parseInt(e("#"+L).val()),z=(w=parseInt(e("#max_pages").val()),S=parseInt(e("#min_pages").val()),parseInt(e(this).val())+parseInt(N));e("#is_valid_"+L).val(1);R=z>w||z<S?0:1;e("#is_valid_"+o).val(R)}e(this).parents("form").find('input[name="prdid"]').val();var M=e("#prdsize").val();return e.ajax({url:"/price_calculate.php",type:"POST",dataType:"json",data:e("form#pricecalulate"+c).serialize()+"&cElement="+o+P+"&cType="+r+I+"&calc_lblposition="+calc_lblposition+"&visual_calc_lblposition="+visual_calc_lblposition+u+h+"&collapsed_groupids="+JSON.stringify(collapseAccordionId)+"&optid="+O+A+"&store_id="+x,success:function(t){if("Yes"==DISPLAY_ESTIMATED_DELIVERY_DATE&&e("#delivery_days_details").html(""),e("#prductqty"+c+" .slide").slick("unslick"),e("#prductsize"+c+" .slide").slick("unslick"),e("#additionaloptionid"+c+" .slide").slick("unslick"),e("#products_sku").length>0){var a=t.products_sku;void 0!==e("#products_sku").attr("data-prdsku")&&(a=e("#products_sku").attr("data-prdsku"),e("#products_sku").removeAttr("data-prdsku")),e("#products_sku").val(a)}for(var i in t)"queries"==i?e("#"+i,d).html(e("#"+i).html()+"<hr/>"+t[i]):"product_pages_html"==i?(e(".book_product_pages").remove(),e("#prductsize").after(t[i]),e("#colorpagesrange").popover({html:!0,sanitize:!1,content:function(){return e("#"+this.id+"_content").html()}}).on("shown.bs.popover",(function(t){e(".popover #colorpagenumbers_pop").focus(),bind_colorpopover()})).on("hide.bs.popover",(function(t){e("#clrpages").trigger("change")}))):"undefined"!=typeof quickDesign&&"1"==quickDesign&&"productpricetotal"==i||"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&"undefined"!=typeof PATTERN_PRODUCT&&PREDEFINED_PRODUCT_TYPE==PATTERN_PRODUCT?e("#"+i).html(t[i]):e("#"+i+c,d).html(t[i]);e(".group-collapse-button",d).each((function(t,a){var i="button",n="collapse";
1-1!=(o=e(a).attr("id")).indexOf("buttonhh")?(i="buttonhh",n="collapsehh"):-1!=o.indexOf("buttonh")&&(i="buttonh",n="collapseh");var o=o.replace(i,"");"show"==collapseAccordionId[o]?e("#"+n+o).collapse("show"):"hide"==collapseAccordionId[o]&&e("#"+n+o).collapse("hide")}));var n="undefined"!=typeof CORPORATE_SETTING_SHIPPING_OPTIONS&&"fix_shipping_options"==CORPORATE_SETTING_SHIPPING_OPTIONS?e("#rdshiptype").val():e("#freeshippingproduct").val();if(""!=n&&null!=n)if("Yes"==DISPLAY_ESTIMATED_DELIVERY_DATE||"Retailers"==DISPLAY_ESTIMATED_DELIVERY_DATE||"Corporates"==DISPLAY_ESTIMATED_DELIVERY_DATE)e("#rdshiptype").trigger("change");else if(e("#producttotalprice").find("#product_total").length&&e("#shipping_total").length){var l=e("#producttotalprice").find("#product_total").val();e("#shipestimatetotalprice").find("#shipping_total").text(l)}if("yes"==e("#txtshipenable").val()||"click"==e("#txtshipenable").val()){var r="1"==e("#fetchtypesauto").val()?"calculate":"country";e.cookie("cookie_shipinfo")&&"0"==e("#fetchtypesauto").val()&&(r="calculate"),show_loader(0,c),show_ship_loader(1),getshippingdetails(r,"1"==e("#fetchtypesauto").val()?"default":"")}else init_plugins(),show_loader(0,c),show_ship_loader(0),apply_slick_slideshow_tooptions(c);if(apply_slick_slideshow_tooptions(c),init_plugins(),navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&navigator.vendor.toLowerCase().indexOf("google")>-1&&e("[name^='"+o+"']").hasClass("selectpicker")&&e("[name^='"+o+"']").parents(".form-group:first").hasClass("visualcal")&&setTimeout((function(){e(window).scrollTop(scrolposition)}),50),e(".kitproduct").length>0){if(getkitamount(),1==isSubmit){if((currentKitProduct+=1)<totalkitproduct){var u=e(".kitproduct:eq("+currentKitProduct+")").attr("id");void 0!==u&&(isSubmit=!0,e(".kit_prdqty","#"+u).trigger("change"))}currentKitProduct>=totalkitproduct&&(currentKitProduct=0,isSubmit=!1)}var m=!0;e('form[id^="pricecalulate"]').each((function(){var t=e(this).attr("id");if("undefined"!=typeof ALLOW_KIT_PARTIAL&&1==ALLOW_KIT_PARTIAL)var a=e("input[name^='includeinkit']:checked","#"+t).val();else a=e("input:hidden[name^='includeinkit']","#"+t).val();var i=e(this).find('input[name="prdid"]').val(),n=e(this).find('input[name="calc_index"]').val();parseInt(e("#productpricetotal"+n+" #prd_remaining_stock").val())<parseInt(e("#prdqty"+n).val())&&"1"==a&&(void 0===s||void 0===s[i]||1!=s[i])&&(m=!1)})),0==m?e("#div_addinfo_save_box #SubmitBtn").addClass("disabled"):e("#div_addinfo_save_box #SubmitBtn").removeClass("disabled")}("prdsize"==o||void 0!==p&&1==p)&&e("#templatelist").length>0&&call_ajax_listing_product_info(c),"prdsize"==o&&e("#themelist").length>0&&call_photobook_ajax_listing(c);var h=e('input[name="gallery_setting"]',"#pricecalulate"+c).val();if(("prdsize"==o||"predefined_custom_size"==o)&&e(t.prductsize).find(".option_gallery").length>0&&"refer_from_option"==h&&(e("[name^='"+o+"']").hasClass("option_gallery")||e("[name^='"+o+"']").parent("div").hasClass("option_gallery"))){var g="";if(e(t.prductsize).find(".option_gallery option:selected").length>0){g=e(t.prductsize).find(".option_gallery option:selected").val();if("predefined_custom_size"==o)g=e(t.prductsize).find(".option_gallery option:selected").data("attr")}else{g=e(t.prductsize).find(".option_gallery input[type='radio']:checked").val();if("predefined_custom_size"==o)g=e(t.prductsize).find(".option_gallery input[type='radio']:checked").data("attr")}""!=g&&null!=g&&map_gallery(g,c,o)}else if(e(t.additionaloptionid).find(".option_gallery").length>0){if("attribute_wise"==h||"refer_from_option"==h){var f="";if("refer_from_option"==h&&""!=k&&(f=k),0==e(".attr_"+f).length||""==f)if(e(t.additionaloptionid).find(".option_gallery option:selected").length>0)f=e(t.additionaloptionid).find(".option_gallery option:selected").val();else f=e(t.additionaloptionid).find(".option_gallery input[type='radio']:checked").val();""!=f&&null!=f&&map_gallery(f,c)}else if("option_wise"==h){var v=e(this).parents("form").find('input[name="prdid"]').val(),y=e(".kitproduct").length>0?".card #kit_"+v+" .option_gallery":".option_gallery";e("body").on("shown.bs.select",y,(function(t){var a=e(this).find("select").attr("name");if(void 0!==a){var i=a.replace("]","").split("[")[1];null!=i&&""!=i&&map_gallery(i,c)}}))}}else if(e(t.additionaloptiontopid).find(".option_gallery").length>0){if("attribute_wise"==h||"refer_from_option"==h){if("refer_from_option"==h)f=k;if(null==f)if(e(t.additionaloptiontopid).find(".option_gallery option:selected").length>0)f=e(t.additionaloptiontopid).find(".option_gallery option:selected").val();else f=e(t.additionaloptiontopid).find(".option_gallery input[type='radio']:checked").val();""!=f&&null!=f&&map_gallery(f,c)}else if("option_wise"==h){v=e(this).parents("form").find('input[name="prdid"]').val(),y=e(".kitproduct").length>0?".card #kit_"+v+" .option_gallery":".option_gallery";e("body").on("shown.bs.select",y,(function(t){var a=e(this).find("select").attr("name");if(void 0!==a){var i=a.replace("]","").split("[")[1];null!=i&&""!=i&&map_gallery(i,c)}}))}}else if(e(t.additionaloptionid).find("#option_comb_gallery_id"+c).length>0||e(t.additionaloptiontopid).find("#option_comb_gallery_id"+c).length>0){if("option_combination_wise"==(h=e('input[name="gallery_setting"]',"#pricecalulate"+c).val())){var E="";e(t.additionaloptionid).find("#option_comb_gallery_id"+c).length>0?E=e(t.additionaloptionid).find("#option_comb_gallery_id"+c).val():e(t.additionaloptiontopid).find("#option_comb_gallery_id"+c).length>0&&(E=e(t.additionaloptiontopid).find("#option_comb_gallery_id"+c).val()),""!=E&&void 0!==E&&map_gallery(E,c)}}let T="undefined"!=typeof ADMIN_DATE_LOCALE?ADMIN_DATE_LOCALE:FRONT_DATE_LOCALE;if("undefined"!=typeof holidays_arr){var b=JSON.parse(holidays_arr);e("#mailing_date").datetimepicker({buttons:{showToday:!0},ignoreReadonly:!0,allowInputToggle:!0,minDate:minDate,useCurrent:!1,daysOfWeekDisabled:daysOfWeekDisabled_str.split(","),locale:T,disabledDates:b}),e("#mailing_date").on("change.datetimepicker",(({date:t})=>{e("#mailing_date").datetimepicker("hide"),0==e("#prdqty").length&&e("#mailing_quantity").trigger("change"),e("#prdqty").trigger("change")}))}(e("#customproductsize").rules("add","required"),e("#size_error").rules("add","required"),e("#mailing_error").rules("add","required"),e("#
1inventory_data").rules("add","required"),_(c),null!==localStorage.getItem("tax_include"))&&(1==localStorage.getItem("tax_include")?e("#tax_include_"+t.product_id).removeAttr("checked"):e("#tax_include_"+t.product_id).attr("checked"),e("#tax_include_"+t.product_id).trigger("click"));e("#shareProductLinkModal").hasClass("d-block")&&(e("#shareLink").val(""),e("#shareProductLinkModal").addClass("d-none"),e("#shareProductLinkModal").removeClass("d-block")),e(".dynamic_customsizehtmlDefault").length>0&&(e("#measurement_unit").length>0&&e("#unit_selection").val(e("#measurement_unit").val()),e(".dynamic_customsizehtmlDefault #dynamic_custom_width").val(e("#custom_width").val()),e(".dynamic_customsizehtmlDefault #dynamic_custom_height").val(e("#custom_height").val()).trigger("change")),updateDispatchDate(t.production_due_date),initializeDatepickerOptions(),e('div[id^="date_opt"].opt_datepicker,input[id^="date_opt"].opt_datepicker').on("change.datetimepicker",(t=>{if(totalkitproduct>0||"undefined"!=typeof PHOTOPRINT_PRODUCT&&PREDEFINED_PRODUCT_TYPE===PHOTOPRINT_PRODUCT){var a="#"+e(t.target).parents("form").attr("id"),i=e(a).find("input[name='calc_index']").val();e("#prdqty"+i).trigger("change")}else e("#prdqty").trigger("change")})),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&"undefined"!=typeof PATTERN_PRODUCT&&PREDEFINED_PRODUCT_TYPE==PATTERN_PRODUCT&&changePatternTab()},complete:function(){if((e("input[type=text][name^='"+o+"']").length>0||e("input[type=number][name^='"+o+"']").length>0)&&(-1!==e.inArray(o,enterKeyAllowedElements)||"text"==e("input[name^='"+o+"']").prop("type")))if(void 0!==focusedElement&&""!=focusedElement)focusElement="-1"==enterKeyAllowedElements.indexOf(o)?e("input[type=text][name^='"+focusedElement+"']","#additionaloptionid"+c):e("input[type=text][name^='"+focusedElement+"'][id^='"+focusedElement+c+"']"),focusElement.length>0?focusElement.focus().select():e('button[data-id="'+focusedElement+'"]').focus().select(),focusedElement="";else if(e("input[type=number][name^='"+o+"']").length>0&&"prdqty"==o){focusElement="-1"==enterKeyAllowedElements.indexOf(o)?e("input[type=number][name^='"+o+"']","#additionaloptionid"+c):e("input[type=number][name^='"+o+"'][id^='"+o+c+"']"),focusElement.focus();var t=focusElement.val();focusElement.val("").val(t)}else null!=l&&""!=l&&e("#"+l).length>0&&e("input[name^='"+o+"']").parents("#quote_create").length>0?focusElement=e("#"+l):focusElement="-1"==enterKeyAllowedElements.indexOf(o)?e("input[type=text][name^='"+o+"']","#additionaloptionid"+c):e("input[type=text][name^='"+o+"'][id^='"+o+c+"']"),focusElement.focus(),focusElement.length>0&&focusElement[0].setSelectionRange(focusElement.val().length,focusElement.val().length);let a=e("body #price_calculator .price_calculator").find("#cms_update_price").val();if(("undefined"!=typeof update_price&&"yes"==update_price||void 0!==a&&"yes"===a)&&fetch_updated_price_data(e("form#pricecalulate"+c).serialize()+"&cElement="+o+"&cType="+r+I,c),"shipping"!=o&&"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&PREDEFINED_PRODUCT_TYPE==CANVAS_PRODUCT||"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&PREDEFINED_PRODUCT_TYPE==DOCUMENT_PRINT_PRODUCT||"prdqty"==o&&e("#pricecalulate .custom_color_option").length>0&&"undefined"!=typeof canvasInstance){var i=["prdsize","custom_width","custom_height","custom_length","predefined_custom_size","measurement_unit","wallLayout"];(i.indexOf(o)>=0||e("#prdsize").length>0&&M!=e("#prdsize").val())&&"function"==typeof resizeIframe&&resizeIframe(!0),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&PREDEFINED_PRODUCT_TYPE==DOCUMENT_PRINT_PRODUCT&&"function"==typeof changeAdditionalOptions&&changeAdditionalOptions(),(PREDEFINED_PRODUCT_TYPE==CANVAS_PRODUCT&&(e("[name^='"+o+"']").hasClass("canvas_bind_opt")||-1!=i.indexOf(o)||"prdqty"==o&&e("#pricecalulate .custom_color_option").length>0)||e("#prdsize").length>0&&M!=e("#prdsize").val())&&"function"==typeof changeAdditionalOptions&&changeAdditionalOptions()}if("shipping"!=o&&"undefined"!=typeof quickDesign&&"1"==quickDesign&&1==studioLoaded){["prdsize","custom_width","custom_height","custom_length","measurement_unit","predefined_custom_size"].indexOf(o)>=0&&e("button#personalize").val("prdsize"),e("[name^='"+o+"']").hasClass("hide_pages")?(e("button#personalize").addClass("hide_pages"),e("button#personalize").val(e("[name^='"+o+"']").val())):e("[name^='"+o+"']").hasClass("designer_images")?(e("button#personalize").addClass("designer_images"),e("button#personalize").val(e("[name^='"+o+"']").val())):e("[name^='"+o+"']").hasClass("promotional_color")&&(e("button#personalize").addClass("promotional_color"),e("select[name='"+o+"']").length>
10?e("button#personalize").val(e("select[name='"+o+"'] option:selected").attr("data-additionaldata")):e("button#personalize").val(e("[name^='"+o+"']:checked").attr("data-additionaldata")))}if(updatePriceTotal(c),e("#builder #images").length>0){var n=JSON.parse(sizeList);"prdsize"==o&&e(".photoprint","#image_column_"+c).photoprint("changeSize",n[e("#prdsize"+c).val()]),getPrintSummary()}if(void 0!==dfd)return dfd.resolve("done")}}),!1})).on("change","#shippingcalc.normalship select, #shippingcalc.additionship #rdshiptype, #shippingcalc.additionship:not(.cstate) #country, #shippingcalc.additionship #suburb",(function(t){var a=e(this).attr("name");show_ship_loader(1),getshippingdetails(a)})).on("change","#rdshiptype",(function(t){getshippingdetails(e(this).attr("name"),"default"),e("#delivery_days_details").hide(),"No"==DISPLAY_INDIVIDUAL_DELIVERY_DAYS&&("Yes"==DISPLAY_ESTIMATED_DELIVERY_DATE||"Retailers"==DISPLAY_ESTIMATED_DELIVERY_DATE&&"1"==SES_USER_TYPE_ID||"Corporates"==DISPLAY_ESTIMATED_DELIVERY_DATE&&"2"==SES_USER_TYPE_ID)&&""!=e(this).val()&&updateExpectedDeliveryDate("default")})).on("change","#local_rdshiptype",(function(t){getshippingdetails(e(this).attr("name"),"local_pickup"),e("#delivery_days_details").hide(),"No"==DISPLAY_INDIVIDUAL_DELIVERY_DAYS&&("Yes"==DISPLAY_ESTIMATED_DELIVERY_DATE||"Retailers"==DISPLAY_ESTIMATED_DELIVERY_DATE&&"1"==SES_USER_TYPE_ID||"Corporates"==DISPLAY_ESTIMATED_DELIVERY_DATE&&"2"==SES_USER_TYPE_ID)&&""!=e(this).val()&&updateExpectedDeliveryDate("local_pickup")})).on("change","[name=hire_designer]",(function(){var t=e("[name=hire_designer]:checked").val();void 0===t&&(t=e("#hire_designer").val());var a=e("#tp4overCalc").length?"yes":"no";if(SITE_VAR_HIRE_DESIGNER_HIDE_BUTTON){if("undefined"!=typeof type){type.split("-");if(1==t){if("yes"==a?(is4overEddmProduct=checkIsEddmProduct(),is4overEddmProduct||e(".upload_design").parent().addClass("d-none")):e(".upload_design").parent().addClass("d-none"),e(".browse_design").parent().addClass("d-none"),e(".quote_product").parent().addClass("d-none"),e(".custom_design").parent().addClass("d-none"),e(".upload_artwork_letter").addClass("d-none"),e(".hire_designer").parent().removeClass("d-none"),e(".hire_designer").parent().removeClass("col-md-4 col-md-3 col-md-6"),e("#action-btn").children("div").not(".d-none").length<3){e(".actionbtn").addClass("d-none");var i=e("#action-btn").html();e(".hiredes_btns").removeClass("d-none"),e(".hiredes_btns").html(i),e("#action-btn").addClass("d-none")}}else e(".upload_design").parent().removeClass("d-none"),e(".browse_design").parent().removeClass("d-none"),e(".quote_product").parent().removeClass("d-none"),e(".custom_design").parent().removeClass("d-none"),e(".upload_artwork_letter").removeClass("d-none"),e(".hire_designer").parent().addClass("d-none"),e("#actionButtonsModal").removeClass("d-none"),e(".hiredes_btns").addClass("d-none"),e(".actionbtn").removeClass("d-none"),"yes"==a?(is4overEddmProduct=checkIsEddmProduct(),is4overEddmProduct||e(".action-btn").parent().addClass("d-none")):e("#action-btn").removeClass("d-none")}}else e(".hire_designer").parent().removeClass("d-none")})).on("change","#country",(function(t){e(this).attr("name");show_ship_loader(1),getshippingdetails("state")})).on("click","#btncalcship",(function(){var t;show_ship_loader(1),"undefined"!=typeof SITE_VAR_SHIPPING_DEFAULT_TYPE&&""!=SITE_VAR_SHIPPING_DEFAULT_TYPE&&(t="default"),e("#delivery_days_details").html(""),getshippingdetails("calculate",t)})).on("keypress","#email_id",(function(t){if(13===t.which)return e("#pricecalc").hasClass("disabled")?(t.preventDefault(),t.stopPropagation()):SendMailToCustomer("pricecalc"),!1})),e("body").delegate(".group-collapse-button","click",(function(t){var a=e(this).attr("id"),i="button";-1!=a.indexOf("buttonhh")?i="buttonhh":-1!=a.indexOf("buttonh")&&(i="buttonh");var n=a.replace(i,""),o="hide";e(this).hasClass("collapsed")&&(o="show",e(".slick-slider").slick("refresh")),collapseAccordionId[n]=o})),"1"==e("#fetchtypesauto").val()&&"undefined"!=typeof AJAX_BASED_PRICE_CALCULATOR&&"no"==AJAX_BASED_PRICE_CALCULATOR)&&(show_ship_loader(1),"undefined"!=typeof SITE_VAR_SHIPPING_DEFAULT_TYPE&&""!=SITE_VAR_SHIPPING_DEFAULT_TYPE&&(l="default"),getshippingdetails("calculate",l));if("undefined"!=typeof type){type.split("-");var r=e("[name=hire_designer]:checked").val();if(void 0===r&&(r=e("#hire_designer").val()),1==r)if("yes"==(e("#tp4overCalc").length?"yes":"no")?(is4overEddmProduct=checkIsEddmProduct(),is4overEddmProduct||e(".upload_design").parent().addClass("d-none")):e(".upload_design").parent().addClass("d-none"),e(".browse_design").parent().addClass("d-none"),e(".quote_product").parent().addClass("d-none"),e(".custom_design").parent().addClass("d-none"),e(".hire_designer").parent().removeClass("d-none"),e(".hire_designer").parent().removeClass("col-md-4 col-md-3 col-md-6"),e("#action-btn").children("div").not(".d-none").length<3){e(".actionbtn").addClass("d-none");var d=e("#action-btn").html();e(".hiredes_btns").removeClass("d-none"),e(".hiredes_btns").html(d),e("#action-btn").addClass("d-none")}"undefined"!=typeof SITE_VAR_HIRE_DESIGNER_HIDE_BUTTON&&SITE_VAR_HIRE_DESIGNER_HIDE_BUTTON&&1!=r?e(".hire_designer").parent().addClass("d-none"):e(".hire_designer").parent().removeClass("d-none")}if("undefined"!=typeof DISPLAY_ESTIMATED_DELIVERY_DATE&&("Yes"==DISPLAY_ESTIMATED_DELIVERY_DATE||"Corporates"==DISPLAY_ESTIMATED_DELIVERY_DATE||"Retailers"==DISPLAY_ESTIMATED_DELIVERY_DATE)){if("undefined"!=typeof CORPORATE_SETTING_SHIPPING_OPTIONS&&"fix_shipping_options"==CORPORATE_SETTING_SHIPPING_OPTIONS)var c=e("#rdshiptype").val();else c=e("#freeshippingproduct").val();""!=c&&null!=c&&e("#rdshiptype").trigger("change")}e('form[id^="pricecalulate"]').each((function(){validatePriceCalc(e(this).attr("id"))}));var p="undefined"!=typeof PRODUCT_ADDITIONAL_OPTION_REQUIRED_ERROR?PRODUCT_ADDITIONAL_OPTION_REQUIRED_ERROR:"";function _(t){if(e(".price_calculator").length>0){var a=e("#prdsize"+t).val();null==a&&(a=e("input[name='prdsize"+t+"']:checked").val()),null==a&&(a=e("#prductsize"+t+" input[name=prdsize][type=radio][checked=checked]").val()),null==a&&(a=e("#prductsize"+t+" input[name=prdsize][type=hidden]").val());var i="";null!=a&&(i=a.split("_")[0]);var n=0;"undefined"!=typeof PREDEFINED_FILE_DATA&&e.each(PREDEFINED_FILE_DATA,(function(e,t){e==i&&(n=1)})),0==n?e("#downloadprintready"+t).addClass("d-none"):e("#downloadprintready"+t).removeClass("d-none")}}if(e.validator.addMethod("radioblankvalue",(function(t,a){var i=e(a);return!i.is(":checked")||""!=i.val()}),p),e("#customproductsize").rules("add",{required:!0}),e("#mailing_error").rules("add","required"),e("#size_error").rules("add","required"),e(document).on("click","#div_addinfo_save_box #SubmitBtn, #div_addinfo_save_box #SubmitBtnBuyNow",(function(t){var a=!0,i=!0;("undefined"!=typeof FILE_FILENAME_WITH_EXT&&"undefined"!=typeof FILE_PRODUCT_DESIGN_BUILDER&&FILE_FILENAME_WITH_EXT!==FILE_PRODUCT_DESIGN_BUILDER&&
1!e.isEmptyObject(canvasInstance)&&"imagePlaceHolder"===canvasInstance.getStudioData("canvasImage")||e("#div_addinfo_action_box").length>0&&""!==e("#div_addinfo_action_box").html()&&"SubmitBtn"==e(this).attr("id"))&&(a=!1);var n=e("#popup").val();if("undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&"undefined"!=typeof PHOTOPRINT_PRODUCT&&PREDEFINED_PRODUCT_TYPE==PHOTOPRINT_PRODUCT&&e("#product_design_builder").length>0&&0==e("#product_design_builder .image_column").length)return!1;if("SubmitBtn"==e(this).attr("id")&&("yes"==n&&1!=SITE_VAR_SHOPPING_CART_WITHOUT_LOGIN?parent.loginPopup(t):loginPopup(t)),e("#is_valid_pages").length>0)var o=e("#is_valid_pages").val();return void 0!==o&&""==o&&(a=!1),"SubmitBtnBuyNow"==e(this).attr("id")&&e("input#BuyNowProduct").val("buynow"),e('form[id^="pricecalulate"]').each((function(){var t=e(this).attr("id");if("undefined"!=typeof ALLOW_KIT_PARTIAL&&1==ALLOW_KIT_PARTIAL)var n=e("input[name^='includeinkit']:checked","#"+t).val();else n=e("input:hidden[name^='includeinkit']","#"+t).val();is_valid=!0,(e(".kitproduct").length>0&&"1"==n||0==e(".kitproduct").length)&&(is_valid=e(this).valid()),is_valid||(a=!1,i=!1)})),a&&0===totalkitproduct&&"function"==typeof submitEvents&&submitEvents("event_addToCart"),a?void 0:("undefined"==typeof quickDesign||"1"!=quickDesign||i||e("#optionStep").click(),!1)})),e('form[id^="pricecalulate"]').each((function(){var t=e(this).find('input[name="calc_index"]').val();apply_slick_slideshow_tooptions(t),_(t)})),Array.prototype.setRange=function(e,t){for(var a=this,i=0;i<this.length;i++)if("AV"!=a[i])if(void 0===t)"object"!=typeof this[i]&&e==this[i]?a[i]="AV":this[i][0]<=e&&this[i][1]>=e&&(e="AV");else if("object"!=typeof this[i]&&e<=this[i]&&t>=this[i])a[i]="AV";else if("object"==typeof this[i]){if(e==this[i][0]&&t==this[i][1])continue;var n=Math.min(e,this[i][0]),o=Math.max(t,this[i][1]);if(n==e&&o==t)a[i]="AV";else if(n==this[i][0]&&o==this[i][1]&&t>this[i][0]){e=this[i][0],t=this[i][1];a[i]="AV"}else if(n==e&&o==this[i][1]&&t>this[i][0]){e=n,t=this[i][1];a[i]="AV"}else if(n==this[i][0]&&o==t&&this[i][1]>e){e=n,t=o;a[i]="AV"}}for(var l=a.length-1;l>=0;--l)"AV"==a[l]&&a.splice(l,1);return"AV"!=e&&(void 0===t?a.push(e):a.push([e,t])),a},e("body").on("blur",".popover",(function(){e("#colorpagesrange").popover("hide")})),"undefined"!=typeof page_from&&"product_info"==page_from&&"undefined"!=typeof AJAX_BASED_PRICE_CALCULATOR&&"no"==AJAX_BASED_PRICE_CALCULATOR&&call_ajax_listing_product_info(t),"undefined"!=typeof update_price&&"yes"==update_price){o=0;var u=!1;e("#additionaloptionid").find("input[data-textmp]").each((function(){if(1==e(this).attr("data-setting")){var t=e(this).val();""!=t&&(o+=parseInt(t)),u=!0}})),1==u&&e("#prdqty").val(o),"undefined"!=typeof AJAX_BASED_PRICE_CALCULATOR&&"no"==AJAX_BASED_PRICE_CALCULATOR&&fetch_updated_price_data(e("#pricecalulate").serialize(),t)}(e("#themelist").length>0&&0==e("#changesize").length&&"undefined"!=typeof AJAX_BASED_PRICE_CALCULATOR&&"no"==AJAX_BASED_PRICE_CALCULATOR&&call_photobook_ajax_listing(t),e("#changesize").on("change",(function(t){call_photobook_ajax_listing(e(this).parents("form").find('input[name="calc_index"]').val())})).trigger("change"),e("#product_sorting").on("change",(function(t){call_photobook_ajax_listing(e(this).parents("form").find('input[name="product_sorting"]').val())})),e('body a[data-toggle="tab"]').on("shown.bs.tab",(function(a){var i=e(a.target).attr("href");"#price-calculator"==i&&(e("#prductqty .slide").slick("unslick"),e("#prductsize .slide").slick("unslick"),e("#additionaloptionid .slide").slick("unslick"),apply_slick_slideshow_tooptions(t)),"#product-templates"==i&&e('#templates_listing_area a[data-toggle="tab"]').trigger("shown.bs.tab")})),e("body").on("click","#pricecalc, #download_pricecalc",(function(t){var a=parseInt(e("#price_define_method").val());selected_height=parseFloat(e("#custom_height").val()),selected_width=parseFloat(e("#custom_width").val()),selected_length=parseFloat(e("#custom_length").val()),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&PREDEFINED_PRODUCT_TYPE==CANVAS_PRODUCT&&(isNaN(selected_height)||isNaN(selected_width))&&(selected_height=parseFloat(e("#canvas_height").val()),selected_width=parseFloat(e("#canvas_width").val())),3==a&&(isNaN(selected_height)||isNaN(selected_width)||isNaN(selected_length)&&e(".custom_length").length>0)?(bootbox.alert(CUSTOM_SIZE_WIDTH_HEIGHT_REQUIRED_MESSAGE),isNaN(selected_height)&&(selected_height=parseFloat(e("#custom_height").val("1"))),isNaN(selected_width)&&(selected_width=parseFloat(e("#custom_width").val("1"))),isNaN(selected_length)&&(selected_length=parseFloat(e("#custom_length").val("1")))):"download_pricecalc"==t.currentTarget.id?SendMailToCustomer("download_pricecalc"):SendMailToCustomer("pricecalc")})),e("body").on("change",".local_pickup_style",(function(t){var a=e(this).val();e("#delivery_days_details").html(""),2==a?(e("#default_shipping_types").addClass("d-none"),e("#default_shipping_types").removeClass("d-flex"),e("#local_shipping_types, .store_pickup_error").removeClass("d-none"),e("#local_rdshiptype").length||e("#btncalcship").trigger("click"),e("#local_rdshiptype").trigger("change"),e("#calculate_button, #shipcountry, #shipstate, #shipzipcode, .default_shipping_error").addClass("d-none")):(e("#rdshiptype").length||getshippingdetails("rdshiptype","shipping_type"),e("#default_shipping_types").removeClass("d-none"),e("#default_shipping_types").addClass("d-flex"),e("#local_shipping_types, .store_pickup_error").addClass("d-none"),e("#rdshiptype").trigger("change"),e("#calculate_button, #shipcountry, #shipstate, #shipzipcode, .default_shipping_error").removeClass("d-none"))})),e(".local_pickup_style").length&&""!=shippinginfo&&null!=shippinginfo)?2==e("input[name='local_pickup_selection']:checked").val()&&e(".local_pickup_style:checked").trigger("change"):e(".local_pickup_style:checked").trigger("change");if(e(window).scroll((function(){e('form[id^="pricecalulate"]').each((function(){updatePriceTotal(e(this).find('input[name="calc_index"]').val())}))})).trigger("scroll"),"undefined"!=typeof holidays_arr){var m=JSON.parse(holidays_arr);let t="undefined"!=typeof ADMIN_DATE_LOCALE?ADMIN_DATE_LOCALE:FRONT_DATE_LOCALE;e("#mailing_date").datetimepicker({buttons:{showToday:!0},ignoreReadonly:!0,allowInputToggle:!0,minDate:minDate,useCurrent:!1,daysOfWeekDisabled:daysOfWeekDisabled_str.split(","),locale:t,disabledDates:m})}(e("#include_all_kit").on("click",(function(){this.checked?e(".includeinkit").each((function(){this.checked=!0})).trigger("change"):(e(".includeinkit").each((function(){includeKitChk=!0,this.checked=!1}
1)).trigger("change"),bootbox.alert(SELECT_AT_LEAST_ONE_PRODUCT))})),e("body").on("click",".includeinkit",(function(t){e(".includeinkit:checked").length==e(".includeinkit").length?e("#include_all_kit").prop("checked",!0):e("#include_all_kit").prop("checked",!1)})),e(window).on("beforeunload",(function(){null!==sessionStorage.getItem("customSizes")&&sessionStorage.removeItem("customSizes")})),e("body").on("change","#prdsize",(function(t){e("#prdsize").val(e(this).val())})),e("body").on("change",".element_class",(function(t){var a=e(this).attr("name");null!=a&&""!=a&&e('.dynamicHelpTemplateMain select[name="'+a+'"]').val(e(this).val())})),e(window).width()>=1025&&(setTimeout((function(){$calheight=e("#product_images.thumb_vertical .carouselimages .carousel-item.active").height(),e("#product_images.thumb_vertical .carousel-thumbs").css("max-height",$calheight)}),200),e("#product_images").bind("slid.bs.carousel",(function(){$calheight=e("#product_images.thumb_vertical .carouselimages .carousel-item.active").height(),e("#product_images.thumb_vertical .carousel-thumbs").css("max-height",$calheight)}))),e("body").on("click","[id^='tax_include_']",(function(t){var a=this.id.split("_").pop(),i=e(".div_product_price_tax_"+a),n=e(".div_product_price_"+a);1==e("#tax_include_"+a+":checked").val()?(localStorage.setItem("tax_include",1),e(".tax_lbl_"+a).html(PRODUCT_INCLUSIVE_TAX),i.addClass("d-block").removeClass("d-none"),n.addClass("d-none").removeClass("d-block")):(localStorage.setItem("tax_include",0),e(".tax_lbl_"+a).html(PRODUCT_EXCLUSIVE_TAX),i.addClass("d-none").removeClass("d-block"),n.addClass("d-block").removeClass("d-none"))})),null!==localStorage.getItem("tax_include"))&&(1==localStorage.getItem("tax_include")?e("[id^='tax_include_']").removeAttr("checked"):e("[id^='tax_include_']").attr("checked"),e("[id^='tax_include_']").trigger("click"));e("body").on("click","#generate_link",(function(){var t=e("#quick_design_template").length>0?"&qdtemp="+e("#quick_design_template").val():"";return e.ajax({url:"/product_mailcalc.php",type:"POST",data:"action=generate_link&calc_init="+e("#calc_inititialization").val()+t,dataType:"json",success:function(t){""!=t.link?(e(".copy_msg").html(""),e("#shareLink").val(t.link),openShareProductLinkModal()):e("#shareLink").val("")}}),!1})),e("#shareProductLinkModal").hasClass("d-block")&&(e("#shareLink").val(""),e("#shareProductLinkModal").addClass("d-none"),e("#shareProductLinkModal").removeClass("d-block")),e("body").on("click",".summary_toggle",(function(t){var a=this.id.split("_").pop();e("#summary_toggle_"+a).slideToggle(500)})),e(document).on("click",".saving-detail-link",(function(){var t=e(this).data("qty");e("#prdqty").val(t).selectpicker("refresh").trigger("change"),e("#prdqty4over").find(`option[data-original-value="${t}"]`).prop("selected",!0).end().selectpicker("refresh").trigger("change")})),e("body").on("click",".preview_url",(function(t){t.preventDefault();let a=e(this).data("studiomodelid");if(""!=realLargePreviewInstance&&(realLargePreviewInstance.destroy(),realLargePreviewInstance=""),e(".preview_div").addClass("d-none"),null!=a)return e("#studioBackground, .studio_iframe, .canvas_option, .img_uploader_div").addClass("d-none"),void e("#"+a+", .studio_preview_large").removeClass("d-none");e("#studioBackground, .studio_iframe, .canvas_option, .img_uploader_div").removeClass("d-none"),e(".studio_preview_large").addClass("d-none")})),e("body").on("click",".realPreviewContainer",(function(t){t.preventDefault(),""!=realLargePreviewInstance&&(realLargePreviewInstance.destroy(),realLargePreviewInstance=""),e(".preview_div, #studioBackground, .studio_iframe").addClass("d-none"),e("#"+e(this).data("modelid")+", .studio_preview_large").removeClass("d-none");var a=e("#"+e(this).data("modelid")),i=e(this).data("realpreviewopt");e(".custom-loader").removeClass("d-none"),PREDEFINED_PRODUCT_TYPE==PATTERN_PRODUCT&&(i.isPatternProduct=!0),i.studioActionCallbacks=function(t,a){if("onloadSuccess"===t)i.texture=texture,realLargePreviewInstance.updateMaterials(i),e(".custom-loader").addClass("d-none"),texture.onloadSuccess&&texture.onloadSuccess()},realLargePreviewInstance=new AppOpsRealPreview(a[0],i)})),e("#quick_design_template").length>0&&"undefined"!=typeof templateId&&"undefined"!=typeof templateType&&e("#quick_design_template").val(templateId+"_"+templateType),"undefined"!=typeof productID&&"undefined"!=typeof userId&&addRecentlyViewed(productID,userId)})),$(".carousel-item").hasClass("active")){var productsImageGalleryId=$(".carousel-item").find("img, iframe").attr("data-attr");$("#productsImageGalleryId").val(productsImageGalleryId)}function getkitamount(){var e=0;totalkit=$("#no_of_kit").val(),$("form").each((function(){if($(".kitproduct").length>0){var t=$(this).parents(".kitproduct").attr("id");if(1==ALLOW_KIT_PARTIAL)var a=$("input[name^='includeinkit']:checked","#"+t).val();else a=$("input:hidden[name^='includeinkit']","#"+t).val();void 0!==t&&"1"==a&&(e+=Number($(".hidden_total_price","#"+t).val()))}})),famt=e*Number(totalkit),$(".kitamount").html(CurrencyFormat(famt)),$(".kitmaountunit").html(CurrencyFormat(e))}function validatePriceCalc(e){$("#"+e).validate({ignore:'.ignore, input:hidden:not(:checkbox):not(:radio):not(".filereqire"):not("#customproductsize"):not("#mailing_error"):not("#inventory_data"):not("#size_error"):not(".element_class")',errorPlacement:function(e,t){if((!t.is(":hidden")||t.is(".element_class")||t.is(".filereqire"))&&-1===$.inArray(t.attr("name"),["prdqty","bwpages","clrpages"]))if(t.is(":checkbox")||t.is(":radio")){if("0"==$("#form_type").val()&&t.parents().siblings(".text-danger").length)t.parents().siblings(".txt-danger").length>0?t.parents().siblings(".txt-danger").html("<span>"+e.html()+"</span>"):$('<span class="text-danger txt-danger"></span>').html("<span>"+e.html()+"</span>").insertAfter(t.parent().parent());else if(t.parents().siblings(".text-danger").length)t.parents().siblings(".text-danger").html("<span>"+e.html()+"</span>");else{var a=t.parents(".form-group.visualcal").length>0?t.parents().eq(4):t.parents().eq(2);$('<span class="error_block text-danger"></span>').html("<span>"+e.html()+"</span>").insertAfter(a)}t.parents().siblings("#stock_error_msg_load,#stock_error_msg").children("span").remove("")}else if("0"!=$("#form_type").val()||0!=$(".kitproduct").length||t.is(".filereqire")&&!t.is(".file_cloud_upload"))if(t.parents().siblings(".txt-danger").length||0!=$(".kitproduct").length||t.siblings(".txt-danger").length||0!=$(".multiplier-textprice").length)!t.parents().siblings(".error_block").length&&$(".kitproduct").length>0&&$('<span class="error_block text-danger"></span>').html("<span>"+e.html()+"</span>").insertAfter(t.parent());else{i=t.is(".ops_form_file_element")?t:t.parent();$('<span class="text-danger txt-danger"></span>').html("<span>"+e.html()+"</span>").insertAfter(i)}else if(t.parents().siblings(".error_block").length>0)t.parents().siblings(".error_block").html("<span>"+e.html()+"</span>");else if(!t.hasClass("multiplier-textprice")){var i=t.siblings(".text-danger").length>0?t.siblings(".text-danger").parent():t.parent().siblings(".text-danger").parent();$('<span class="error_block text-danger txt-danger"></span>').html("<span>"+e.html()+"</span>").insertAfter(i)}if(t.parents(".collapse").length>0){var n=t.parents(".collapse");$(n).collapse("show");var o=$(n).attr("id"),l="collapse";-1!=o.indexOf("collapseh")&&(l="collapseh");var s=o.split(l);collapseAccordionId[s[1]]="show",$(".slick-slider").slick("refresh")}}})}function openShareProductLinkModal(){$("#shareProductLinkModal").hasClass("modal")?($("#shareProductLinkModal").modal("show"),$("#copy_msg").tooltip("dispose").tooltip({title:COMMON_COPY,container:"#shareProductLinkModal"}),$("#download_pricecalc").length>0&&$("#download_pricecalc").tooltip("dispose").tooltip({title:COMMON_DOWNLOAD_AS_PDF,container:"#shareProductLinkModal"})):($("#shareProductLinkModal").removeClass("d-none"),$("#shareProductLinkModal").addClass("d-block"),$(".prd_price_details").addClass("d-none"))}function closeShareProductLinkModal(){$("#shareProductLinkModal").hasClass("modal")?$("#shareProductLinkModal").modal("hide"):($("#shareProductLinkModal").addClass("d-none"),$("#shareProductLinkModal").removeClass("d-block"))}function copyShareProductLink(){navigator.clipboard.writeText($("#shareLink").val()),$("#copy_msg").attr("title",COMMON_LINK_COPIED_TO_CLIPBOARD),$("#copy_msg").tooltip("dispose").tooltip({title:COMMON_LINK_COPIED_TO_CLIPBOARD,trigger:"manual",container:"#shareProductLinkModal"}).tooltip("show"),$(document.body).on("click",(function(e){$(e.target).closest("#copy_msg").length||($("#copy_msg").attr("title",COMMON_COPY),$("#copy_msg").tooltip("dispose").tooltip({title:COMMON_COPY,container:"#shareProductLinkModal"}))}))}function linkSaveToFeed(){$.ajax({url:SITE_URL+"product_mailcalc.php",type:"POST",data:"action=save_to_feed&link="+$("#shareLink").val()+"&calc_init="+$("#calc_inititialization").val(),dataType:"json",success:function(e){""!=e.link?$(".copy_msg").html('<div class="alert alert-success" role="alert">'+COMMON_LINK_SAVE_FEED_SUCCESS+"</div>"):$(".copy_msg").html('<div class="alert alert-danger" role="alert">'+COMMON_LINK_SAVE_FEED_FAILURE+"</div>")}})}function updateDispatchDate(e){$("body #product_info .dispatch_date").length>0&&null!==e&&($("body #production_date").val(e),$("body #product_info .dispatch_date").length>0&&$("body #product_info .dispatch_date").html(e))}function loadDispatchCountDown(){if($("body #product_cutoff").length>0&&($("body #product_info .countdown_hour").length>0||$("body #product_info .countdown_min").length||$("body #product_info .countdown_sec").length)){var e=$
1("#product_cutoff").val();"undefined"!=typeof CURRENT_TIME_ZONE&&""!=CURRENT_TIME_ZONE||(CURRENT_TIME_ZONE="UTC");let l=(new Date).toLocaleString("en-US",{timeZone:CURRENT_TIME_ZONE});var t=new Date(l);t.setHours(e,0,0,0),isBusinessDay(t)||(t=getNextBusinessDay(t));var a=t.getTime(),i=a,n=new Date(l);n.setDate(n.getDate()+1),n.setHours(e,0,0,0),isBusinessDay(n)||(n=getNextBusinessDay(n));var o=n.getTime();if(a<new Date(l).getTime())i=o;setInterval((function(){let e=(new Date).toLocaleString("en-US",{timeZone:CURRENT_TIME_ZONE});var t=new Date(e).getTime(),a=i-t,n=Math.floor(a/864e5),l=Math.floor(a%864e5/36e5)+24*n,s=Math.floor(a%36e5/6e4),r=Math.floor(a%6e4/1e3);$("body #product_info .countdown_hour").html(l.toString().padStart(2,"0")),$("body #product_info .countdown_min").html(s.toString().padStart(2,"0")),$("body #product_info .countdown_sec").html(r.toString().padStart(2,"0")),a<0&&(i=o)}),1)}$("body #product_info .dispatch_date").length>0?updateDispatchDate($("body #production_date").val()):$("body #calc_pro_days").val(0)}function isBusinessDay(e){if(void 0===typeof SYSTEM_HOLIDAYS)return!0;"string"==typeof SYSTEM_HOLIDAYS&&(SYSTEM_HOLIDAYS=JSON.parse(SYSTEM_HOLIDAYS));const t=SYSTEM_HOLIDAYS.nonBusinessDays,a=SYSTEM_HOLIDAYS.holidays,i=e.getDay(),n=0===i?7:i;if(t.includes(n))return!1;const o=e.toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"});for(var l of a){if(o===(l=new Date(l).toLocaleDateString("en-US",{month:"2-digit",day:"2-digit",year:"numeric"})))return!1}return!0}function getNextBusinessDay(e){for(;!isBusinessDay(e);)e.setDate(e.getDate()+1);return e}function getMultipleRealPreview(){let e=$('[name="prdsize"]').val(),t={},a=$('.price_calculator select[id^="aoptions"]'),i=$('.price_calculator [type=radio][name^="aoptions"]:checked'),n="";$.each(a,(function(e,a){var i=$(a).attr("name"),o=i.substring(i.indexOf("[")+1,i.lastIndexOf("]"));t[o]=$(a).find(":selected").val(),""!=$(a).find(":selected").data("additionaldata")&&(n=$(a).find(":selected").data("additionaldata"))})),$.each(i,(function(e,a){var i=$(a).attr("name"),n=i.substring(i.indexOf("[")+1,i.lastIndexOf("]"));t[n]=$(a).val()}));let o=Object.keys(JSON.parse(patternPagesList)).length;null==e&&(e=0);var l="product_id="+productID+"&size_id="+e+"&attr_id="+JSON.stringify(t)+"&pages="+o;""!=typeof n&&"undefined"!=typeof studioLoaded&&1==studioLoaded&&(l+="&promoColor="+n),"undefined"!=typeof quickDesign&&"1"==quickDesign&&("undefined"!=typeof tempId&&(l+="&tempid="+tempId),"undefined"!=typeof templateType&&(l+="&type="+templateType)),$.ajax({url:SITE_URL+FILE_GET_PERSONALIZE_PREVIEW,type:"POST",async:!1,data:l,success:function(e){let t=(e=JSON.parse(e)).large_preview,a=e.thumb_preview,i='<div class="border design-preview"><img src="'+imagePlaceHolder+'" class="preview_url studio_design thumb_preview "></div>';""==a&&$(".studio_preview").children().html(""),""!=a&&(a=i+a,$(".studio_preview").children().html(a),$(".studio_preview").removeClass("d-none")),""!=t&&$(".studio_preview_large").html(t),$(".preview_div").addClass("d-none"),realPreviewInstance={},""!=texture&&Object.keys(texture).forEach((function(e){$(".imgSpan-"+pagesList[e]).attr("src",texture[e]),0==pagesList[e]&&$(".studio_design").attr("src",texture[e])})),$(".realPreviewContainer").each((function(e){var t=$(this).data("realpreviewopt"),a=$(this).data("modelid");PREDEFINED_PRODUCT_TYPE==PATTERN_PRODUCT&&(t.isPatternProduct=!0),""!=texture&&(t.studioActionCallbacks=function(e,i){if("onloadSuccess"===e)t.texture=texture,realPreviewInstance[a].updateMaterials(t),texture.onloadSuccess&&texture.onloadSuccess()}),realPreviewInstance[$(this).data("modelid")]=new AppOpsRealPreview($(this)[0],t)})),"undefined"!=typeof verticalClass&&$(".preview_url, .large_preview").addClass(verticalClass),null==e.productTypePreview||e.productTypePreview||0==$("#2d_multiplier").length||$("#2d_multiplier").remove(),init_plugins()}})}var objprevAnchor="",searchKeyTxt="";function call_ajax_template_filtering(e,t,a){$(".offcanvas-collapse").hasClass("show")&&$(".offcanvas-collapse").removeClass("show"),template_load_url=[],""==e&&(e=$("#templatecat").val()),void 0===a&&(a="");var i="",n="",o="",l="",s="",r="templates_listing_area",d="template_size";"undefined"!=typeof FILE_PHOTOBOOKS_DESIGNS_RESPONSE&&FILE_AJAX_GET_PRODUCT_TEMPLATE==FILE_PHOTOBOOKS_DESIGNS_RESPONSE&&(r="theme_listing_area",d="changesize"),"undefined"!=typeof FILE_AJAX_GET_PRODUCT_INFO_DESIGNS&&FILE_AJAX_GET_PRODUCT_TEMPLATE==FILE_AJAX_GET_PRODUCT_INFO_DESIGNS&&(d="prdsize"),document.getElementById(r).innerHTML='<div class="loading-container"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>",null!=document.getElementById("template_name")&&""!=document.getElementById("template_name").value&&document.getElementById("template_name").value!=TEMPLATE_KEYWORDS&&(i=document.getElementById("template_name").value),null!=document.getElementById(d)&&""!=document.getElementById(d).value&&(n=document.getElementById(d).value),null!=document.getElementById("templatecat")&&""!=document.getElementById("templatecat").value&&(o=document.getElementById("templatecat").value,$(".templatecat").removeClass("act"),$("#"+o).addClass("templatecat act")),""==a&&$("#pid").length>0&&""!=$("#pid").val()&&(a=$("#pid").val(),$(".pro_text").removeClass("p_act"),$(".pro_text#"+a).addClass("p_act")),$("#selected_colors").length>0&&(l=$("#selected_colors").val()),$("#selected_orientations").length>0&&(s=$("#selected_orientations").val()),i=DOMPurify.sanitize(i),n=DOMPurify.sanitize(n),o=DOMPurify.sanitize(o),null!=e&&(o=e),p="";var c="";if($("#designer_id").length>0){var p=$("#designer_id").val();c+="&designer_id="+p}"undefined"!=typeof DESIGNER_URL&&(c+="&designer_url="+DESIGNER_URL),""!=l&&(c+="&c
1olor="+l),""!=s&&(c+="&orientation="+s);var _=$("#product_sorting option:selected").val();""!=_&&(c+="&sortFilter="+_),"undefined"!=typeof quickDesignPopup&&"1"==quickDesignPopup&&(c+="&popup_req="+quickDesignPopup);var u="keyword="+encodeURIComponent(i)+"&size="+n+"&templatecat="+o+"&pid="+a+"&is_ajax=true"+c;$("#is_corporate_home").length>0&&"yes"==$("#is_corporate_home").val()&&(u+="&is_corporate_home=yes"),"undefined"!=typeof action&&"undefined"!=typeof pos&&""!=action&&""!=pos&&(u+="&action="+action+"&pos="+pos);var m=SITE_DIRECTORY+FILE_AJAX_GET_PRODUCT_TEMPLATE+"?"+u;return objprevAnchor&&(objprevAnchor.className=""),$.ajax({url:m,type:"POST",data:u,dataType:"json",success:function(e){$("#"+r).html(e.response);var t=ALL_CATEGORY;if(""==o&&""==a||(t=""),""!=o&&(template_cat_text=$(".act").text(),""!=template_cat_text?template_cat_text:template_cat_text=$("#templatecat option:selected").text(),"0"!=o&&(t+=template_cat_text)),""!=a&&(product_text=$(".p_act").text(),""!=product_text?product_text:product_text=$("#pid option:selected").text(),""!=t&&""!=product_text?t=t+", "+product_text:""!=product_text&&(t=product_text)),""!=n&&"0"!=n&&(template_size_text=$("#"+d+" option:selected").text(),""==template_size_text.trim()&&(template_size_text=$("#template_size_title").val()),t=""!=t?t+", "+template_size_text:template_size_text),""!=i&&(t=""!=t?t+", "+i:i),""!=p){var c=$("#designer_id option:selected").text();t=""!=t?t+", "+c:c}if(""!=l){var u,m=l.split(","),h=[];$.each(m,(function(e,t){h.push($("input[name=colors][value="+t+"]").data("label"))})),u=h.join(", "),t=""!=t&&t!=SELECT_TEMPLATE_CATEGORY?t+", "+u:u}if(""!=s){m=s.split(",");var g,f=[];$.each(m,(function(e,t){f.push($("input[name=orientation][value="+t+"]").data("label"))})),g=f.join(", "),t=""!=t?t+", "+g:g}if(void 0!==_&&""!=_){var v=$("#product_sorting option:selected").text();t=""!=t?t+", "+v:v}if(t!=ALL_CATEGORY&&""!=t){t=DOMPurify.sanitize(t);var y=document.createElement("div");y.appendChild(document.createTextNode(t)),t=y.innerHTML,$("#"+r).prepend('<small class="d-block mb-2">'+SEARCH_RESULT_FOR+" : "+t+"</small>")}init_plugins(),$("[data-toggle=tooltip]").tooltip({container:"body"})}}),!1}function ShowAjaxPaging(e,t,a){var i=t,n=(a=a,e.split("?")[1]),o="",l="templates_listing_area",s="templates_listing_area";"undefined"!=typeof FILE_PHOTOBOOKS_DESIGNS_RESPONSE&&FILE_AJAX_GET_PRODUCT_TEMPLATE==FILE_PHOTOBOOKS_DESIGNS_RESPONSE&&(l="theme_listing_area",s="themelist"),"lazyload"==TEMPLATES_PAGING_STYLE?$("#"+l).append('<div class="loading-container"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>"):(document.location="#"+s,$("#"+l).html('<div class="loading-container"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>"));var r=null;if(""!=e){var d="";""==!n&&"-1"==n.indexOf("templatecat")&&i>0&&(d+="&templatecat="+i),"lazyload"==TEMPLATES_PAGING_STYLE&&"undefined"!=typeof DESIGNER_URL&&(d+="&designer_url="+DESIGNER_URL),o=SITE_DIRECTORY+FILE_AJAX_GET_PRODUCT_TEMPLATE+"?"+n+d}else r="templatecat="+i+"&pid="+a,o=SITE_DIRECTORY+FILE_AJAX_GET_PRODUCT_TEMPLATE+"?"+r;if(0!=o.length)return $.ajax({url:o,type:"GET",data:r,dataType:"json",success:function(e){"lazyload"==TEMPLATES_PAGING_STYLE?($(".row-pagging").remove(),$(".loading-container").remove(),$("#"+l).append(e.response)):$("#"+l).html(e.response),init_plugins()}}),!1;document.getElementById(l).innerHTML=""}function sharelink_for_product_template(e){return jQuery.ajax({type:"GET",url:e,async:!1,datatype:"JSON",success:function(e){e=JSON.parse(e),FB.ui({method:"feed",name:e.site_name,link:e.link,picture:e.picture,description:e.message,message:""},(function(e){void 0!==e&&void 0===e.error_code&&bootbox.alert("Template Shared successfully.")}))}}),!1}function template_load(){$(window).scroll((function(){var e=footer=0;if($(".extra-footer").length>0)e=parseInt($(".extra-footer").height());if($("#footer").length>0&&(footer=parseInt($("#footer").height())),$(window).scrollTop()+$(window).height()>=parseInt($(document).height())-(footer+e)){var t=$("ul.pagination  li").length;if(t-=1,0!=$("ul.pagination").length&&!$("ul.pagination  li:nth-child("+t+")").hasClass("disabled")){var a=$("ul.pagination  li:nth-child("+t+") a").attr("href");"undefined"==typeof pid||a.includes("pid")||a.includes("pname")||(a=a+"&pid="+pid),-1===jQuery.inArray(a,template_load_url)&&(template_load_url.push(a),"undefined"==typeof templatecat?ShowAjaxPaging(a,0):ShowAjaxPaging(a,templatecat))}}}))}function ShowAjaxPagingPortfolio(e,t,a){var i=t,n=(a=a,e.split("?")[1]),o="";"lazyload"==TEMPLATES_PAGING_STYLE?$("#templates_listing_area").append('<div class="loading-container"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>"):(document.location="#templates_listing_area",$("#templates_listing_area").html('<div class="loading-container"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>"));var l=null;if(""!=e?o=SITE_DIRECTORY+FILE_BOOK_AJAX_GET_PRODUCT_TEMPLATE+"?"+n:(l="templatecat="+i+"&pid="+a,o=SITE_DIRECTORY+FILE_BOOK_AJAX_GET_PRODUCT_TEMPLATE+"?"+l),0!=o.length)return $.ajax({url:o,type:"GET",data:l,success:function(e){"lazyload"==TEMPLATES_PAGING_STYLE?($(".row-pagging").remove(),$(".loading-container").remove(),$("#templates_listing_area").append(e.response)):$("#templates_listing_area").html(e.response),init_plugins()}}),!1;document.getElementById("templates_listing_area").innerHTML=""}function reset_link(){$("#portfolio_name").val(""),$("#department_name").val(-1),$("#portfolio_submit").trigger("click")}function parseQueryString(e){var t,a,i,n,o={};for(i=0,n=(t=e.split("&")).length;i<n;i++)t[i]=t[i].replace("?",""),"pid"!==(a=t[i].split("="))[0].trim()&"type"!==a[0]&&(o[a[0]]=a[1]);return o}$(document).ready((function(){$(".templatecat").click((function(){$(".templatecat").removeClass("act"),$(this).addClass("templatecat act");
1var e=$(this).attr("id");$("#templatecat").val(e)})),$(".pro_text").click((function(){$(".pro_text").removeClass("p_act"),$(this).addClass("p_act");var e=$(this).attr("id");$("#pid").val(e)})),$("input[name=colors]").change((function(){var e,t=[];$("input:checkbox[name=colors]:checked").each((function(){t.push($(this).val())})),e=t.join(","),$("#selected_colors").val(e),("undefined"==typeof IsMobileDevice||"undefined"!=typeof IsMobileDevice&&!IsMobileDevice)&&call_ajax_template_filtering()})),$("input[name=orientation]").change((function(){var e,t=[];$("input:checkbox[name=orientation]:checked").each((function(){t.push($(this).val())})),e=t.join(","),$("#selected_orientations").val(e),("undefined"==typeof IsMobileDevice||"undefined"!=typeof IsMobileDevice&&!IsMobileDevice)&&call_ajax_template_filtering()})),$("ul[id^='template_category_tree']").treeview({animated:"fast",collapsed:!0,unique:!0,persist:"location",toggle:function(){}}),$("body").on("click",".fancyboxLauncher",(function(){return $(this).next("div").find(".fancybox").eq(0).trigger("click"),!1}))})),$((function(){"use strict";$('[data-toggle="offcanvas"]').on("click",(function(){$(".offcanvas-collapse").toggleClass("show"),$("#horizontal_box .navbar-bg-outside").css("z-index","999")})),$(".navbar-bg-outside").on("click",(function(){$(".offcanvas-collapse").removeClass("show")})),$(".closeiconData").on("click",(function(){$("#template_name").val(""),call_ajax_template_filtering()})),$(".allTempDataMobile").on("click",(function(){$("input[name='selectedCategoryId']:checkbox").prop("checked",!1),call_ajax_template_filtering(0,this)})),$("#mobileFilterData").submit((function(e){e.preventDefault();var t=[];
1$(this).find("input").each((function(){var e=$(this).attr("id");$("#"+e).is(":checked")?($(".allTempDataMobile").removeClass("act"),"orientation"!==$(this).attr("name")&&$(this).next().addClass("templatecat act"),"selectedCategoryId[]"==$(this).attr("name")&&void 0!==$(this).val()&&(console.log(this),t.push($(this).val()))):"selectedCategoryId[]"==$(this).attr("name")&&$(this).next().hasClass("templatecat act")&&$(this).next().removeClass("templatecat act")})),call_ajax_template_filtering(t)}))}));var captchaParam="cloudflare"==CAPTCHA_SERVICE_TYPE?"cf-turnstile-response":"g-recaptcha-response";function validate_guest(){var e=1;$("#opt_userid").addClass("ignore"),$("#opt_passwordid").addClass("ignore");let t=!("undefined"==typeof IS_BUYNOW_FLOW||!IS_BUYNOW_FLOW);(jQuery("#txtEmailGuest").valid()||(e=0),"1"!=ENABLE_TERM_CONDITION_CHECKBOX_WITH_VALUE&&"2"!=ENABLE_TERM_CONDITION_CHECKBOX_WITH_VALUE||1!=e||t)||0==validate_term_agree_checkbox(!0,"comment_agreee")&&(e=0);var a=$("#txtEmailGuest").closest("form").attr("id");if(1==e){captchaValidation({form_id:"#guestlogin"})||(e=0)}"cart_page"!=$("#cart_page").val()&&("1"!=PREDEFINED_PRODUCT_TYPE||"1"==PREDEFINED_PRODUCT_TYPE&&1==SITE_VAR_PREDEFINED_PRODUCT_CHECKBOX)&&"product_add_info"==SITE_VAR_CART_AGREE_CHECKBOX&&(jQuery("#comment_guestagree").valid()||(e=0));var i=jQuery("#txtEmailGuest").val(),n=$('input[id="newsLetter"]:checked').length>0?$("#newsLetter").val():"",o="",l="",s="cloudflare"==CAPTCHA_SERVICE_TYPE?jQuery("#"+a+" #guestlogin").find('input[name="cf-turnstile-response"]').val():jQuery("#"+a+" #guestlogin").find(".g-recaptcha-response").val();return"v3"==CAPTCHA_VERSION&&(s=$("#"+a+" #g-recaptcha-response").val()),$("#cart_page").length&&"cart_page"==$("#cart_page").val()&&(l="cart_page",o="&login_frm=cart_page"),t&&(a="frmadditionallogin",l="buynow_flow",o="&form_type=buynow"),e&&jQuery.ajax({type:"POST",url:SITE_DIRECTORY+FILE_EXPRESS_ADDTIONAL_INFO,data:"imgGuest_x=12&txtEmailGuest="+i+"&newsLetter="+n+"&form_name="+a+o+"&"+captchaParam+"="+s,success:function(e){if("buynow_flow"==l&&"success_reload"==e)handleBuyNowFlow(i);else{if("success"==e||"success_reload"==e)return jQuery("#additiona_login_box").html(""),"frmadditionallogin"==a||"frmpredefinedlogin"==a?($("#div_addinfo_action_box").html(""),Fancybox.close(),"cart_page"==l?window.location.reload(!0):1==$('button[name="SubmitData"]').length&&("undefined"==typeof MAILING_PRODUCT_FLAG||"undefined"!=typeof MAILING_PRODUCT_FLAG&&1!=MAILING_PRODUCT_FLAG)&&$('button[name="SubmitData"]').trigger("click")):"undefined"!=typeof MAILING_PRODUCT_FLAG&&1==MAILING_PRODUCT_FLAG?jQuery("#"+a).get(0).submit():jQuery("#"+a).submit(),!1;jQuery("#txtEmailGuest").closest(".form-group").find(".error-block").html("<span>"+e+"</span>")}}}),!1}function handleBuyNowFlow(e){let t="shipping";if($(".contact_details_form").removeClass("d-none"),$("#shipping").slideDown((function(){cartStepShow(t)})),"no"==PRODUCT_PRICE_SHOW_TO_VISITOR.toLowerCase()){new cart_class(cart_options).process_cart("init")}$("#user-section").slideUp(),$.cookie("shopping_accordion","buynow-shipping"),$(".cart-user-detail").html('<div><i class="far fa-user mr-2"></i><span class="text-muted">'+e+"</span></div>").removeClass("d-none"),$(".userShippingDetails").addClass("active"),$(".login-popup-msg").addClass("d-none")}function processLogin(e){if(jQuery("#additiona_login_box").find(".error-message").empty(),jQuery(".show_captcha").find(".captcha_error").empty(),void 0!==e.is_show_captcha&&"1"==e.is_show_captcha?jQuery(".show_captcha").removeClass("d-none"):jQuery(".show_captcha").addClass("d-none"),1==e.success)login_success(),1==$('button[name="SubmitData"]').length&&("undefined"==typeof MAILING_PRODUCT_FLAG||"undefined"!=typeof MAILING_PRODUCT_FLAG&&1!=MAILING_PRODUCT_FLAG)&&$('button[name="SubmitData"]').trigger("click"),1!=$('button[name="SubmitBtn"]').length||"undefined"!=typeof MAILING_PRODUCT_FLAG&&("undefined"==typeof MAILING_PRODUCT_FLAG||1==MAILING_PRODUCT_FLAG)||$('button[name="SubmitBtn"]').hasClass("disabled")||$('button[name="SubmitBtn"]').trigger("click");else if(1==e.success_reload)1==$('button[name="SubmitData"]').length&&("undefined"==typeof MAILING_PRODUCT_FLAG||"undefined"!=typeof MAILING_PRODUCT_FLAG&&1!=MAILING_PRODUCT_FLAG)?(login_success(),$('button[name="SubmitData"]').trigger("click")):window.location.reload(!0);else if(void 0!==e.captcha_code_error&&""!=e.captcha_code_error)jQuery(".show_captcha").find(".captcha_error").html(e.captcha_code_error);else if(void 0!==e.pending_approval&&""!=e.pending_approval)jQuery("#additiona_login_box").find(".error-message").html('<span class="alert alert-warning d-block mb-4">'+e.pending_approval+"</span>");else if(void 0!==e.many_login_attempts||void 0!==e.remaining_attempts&&0==e.remaining_attempts)jQuery("#opt_userid").parent().siblings(".error-block").empty(),jQuery("#additiona_login_box").find(".error-message").html('<span class="alert alert-danger d-block mb-4">'+TOO_MANY_LOGIN_ATTEMPTS_ERROR.replace("%s",e.block_until)+"</span>");else if(void 0!==e.remaining_attempts&&0!=e.remaining_attempts&&e.remaining_attempts<=2)jQuery("#additiona_login_box").find(".error-message").html('<span class="alert alert-warning d-block mb-4">'+REMAINING_ATTEMPTS_FOR_LOGIN_ERROR.replace("%s",e.remaining_attempts)+"</span>");else if(void 0!==e.error_email){var t=e.error_email;jQuery("#opt_userid").parent().siblings(".error-block").html(t)}else if(void 0!==e.invalid){t=e.invalid;jQuery("#opt_userid").parent().siblings(".error-block").empty(),jQuery("#additiona_login_box").find(".error-message").html('<span class="alert alert-danger d-block mb-4">'+t+"</span>")}}function openResetPasswordPopup(e){new Fancybox([{src:e,type:"iframe",width:"700"}],{closeButton:!1,click:!1,escape:!1,touch:!1,keyboard:!1,height:100,on:{destroy:(e,t)=>{$("body").removeClass("fancybox-active")}}})}function validate_additional_login(){$("#opt_userid").removeClass("ignore"),$("#opt_passwordid").removeClass("ignore");var e=1;jQuery("#opt_userid").valid()||(e=0),jQuery("#opt_passwordid").valid()||(e=0);var t="add_opt";$("#cart_page").length&&"cart_page"==$("#cart_page").val()&&(t="cart_page");var a=jQuery("#opt_userid").val(),i=jQuery("#opt_passwordid").val(),n="cloudflare"==CAPTCHA_SERVICE_TYPE?jQuery("#frmadditionallogin #additiona_login_box").find('input[name="cf-turnstile-response"]').val():jQuery("#frmadditionallogin #additiona_login_box").find(".g-recaptcha-response").val();let o="undefined"!=typeof IS_BUYNOW_FLOW&&IS_BUYNOW_FLOW?"buynow":"";return e&&jQuery.ajax({type:"POST",url:"/user_login.php",data:{email_signup:a,password_signup:i,login_frm:t,btnlogin_x:1,btnlogin_y:1,[captchaParam]:n,cart_flow:o},success:function(e){var t=JSON.parse(e);t.hasOwnProperty("resetPassword")&&1==t.resetPassword?(Fancybox.close(),openResetPasswordPopup(t.url),$(window).on("message",(function(e){"1"==e.originalEvent.data.success&&(""!=e.originalEvent.data.flashmsg&&$.bootstrapGrowl(e.originalEvent.data.flashmsg),Fancybox.close()),processLogin(e.originalEvent.data)}))):processLogin(t)}}),!1}function login_success(){jQuery("#instructions_comments_user").show().removeClass("hide"),Fancybox.close(),jQuery("#comment_agree").parent("div").parent("div").parent("div").parent("div").removeClass("hide"),jQuery("#div_addinfo_save_box").show().removeClass("hide"),jQuery("#div_addinfo_action_box").html(""),"undefined"!=typeof quickDesign&&"1"==quickDesign&&saveCall(),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&("undefined"!=typeof CANVAS_PRODUCT&&PREDEFINED_PRODUCT_TYPE==CANVAS_PRODUCT||"undefined"!=typeof PATTERN_PRODUCT&&PREDEFINED_PRODUCT_TYPE==PATTERN_PRODUCT)&&saveC
1all()}function validate_checkout(){var e=jQuery('[name="prdqty"]').length?jQuery('input[name="prdqty"]').val():jQuery("#quantity").val();if(0==e||""==e)return!1;if(3==jQuery("#price_define_method").val())return!0;var t=parseInt($("#minqty").val()),a=parseInt($("#maxqty").val());if(e<t||e>a){var i=PLEASE_ENTER_QUANTITY_BETWEEN,n=MIN_MAX_QUANTITY;return i=(i=i.replace("%d",t)).replace("%d",a),n=(n=n.replace("%d",t)).replace("%d",a),!1}}function validate_agree_checkbox(){if(("1"!=PREDEFINED_PRODUCT_TYPE||"1"==PREDEFINED_PRODUCT_TYPE&&1==SITE_VAR_PREDEFINED_PRODUCT_CHECKBOX||"undefined"!=typeof product_predefined_kit_type_id&&"2"==product_predefined_kit_type_id&&"1"==PREDEFINED_PRODUCT_TYPE)&&"product_add_info"==SITE_VAR_CART_AGREE_CHECKBOX){if(!$("#comment_agree").prop("checked")&&!$("#comment_guestagree").prop("checked"))return 0==$("#instructions_comments_user .bootstrap-growl").length&&$.bootstrapGrowl(PRODUCT_DESIGN_VERIFICATION_ALERT,{ele:"#instructions_comments_user",type:"danger",align:"left",delay:0,allow_dismiss:!1}),$("#comment_agree").focus(),$(".bootstrap-growl").addClass("text-right"),!1;$("#comment_agree").parent("div").removeClass("has-error")}}function loginPopup(e){if($("#div_addinfo_action_box").length>0&&""!=$("#div_addinfo_action_box").html()){const i=document.getElementById("guest_user_captcha"),n=document.getElementById("additional_login_user_captcha");var t="",a="";void 0!==e&&e.preventDefault(),$("#guest_comment_agree").hide(),Fancybox.close(),new Fancybox([{src:"#div_addinfo_action_box"}],{touch:!1,dragToClose:!1,on:{reveal:(e,o,l)=>{$("body").addClass("fancybox-active"),i&&!i.hasAttribute("data-initialized")&&"undefined"!=typeof CAPTCHA_SITE_KEY&&(t=turnstile.render(i,{sitekey:CAPTCHA_SITE_KEY,language:LANGUAGE_SHORTNAME}),i.setAttribute("data-initialized","true")),n&&!n.hasAttribute("data-initialized")&&"undefined"!=typeof CAPTCHA_SITE_KEY&&(a=turnstile.render(n,{sitekey:CAPTCHA_SITE_KEY,language:LANGUAGE_SHORTNAME}),n.setAttribute("data-initialized","true"))},closing:()=>{if(void 0!==e){var t=jQuery(".fancybox_checkout_triger[href='"+e.target.baseURI+"']");t.length>0&&t[0].click()}},close:()=>{i&&i.hasAttribute("data-initialized")&&(i.removeAttribute("data-initialized"),i.innerHTML="",""!=t&&turnstile.remove(t)),n&&n.hasAttribute("data-initialized")&&(n.removeAttribute("data-initialized"),n.innerHTML="",""!=a&&turnstile.remove(a))},destroy:(e,t)=>{$("body").removeClass("fancybox-active")}}});$(".fancybox-inner").find("#div_addinfo_action_box").css({minHeight:"700px",width:"auto",height:"70%"})}}jQuery(document).ready((function(e){e("#txtEmailGuest").keypress((function(e){if(13===e.keyCode)return validate_guest(),!1})),googleRecaptchaV3Initialization("#additiona_login_box, #guestlogin")}));var currentKitProduct=0,isSubmit=!1;function getfeedback(e){var t,a=e.split("?")[1];return t=site_url+product_info_filename,$.ajax({url:t,type:"GET",data:a,success:function(e){document.getElementById("feedbacklisting").innerHTML=e}}),!1}jQuery(document).ready((function(e){e("#frmadditionalinfo").validate({ignore:'.ignore, :hidden:not(:checkbox):not(:radio):not(".filereqire")',errorPlacement:function(e,t){t.is(":checkbox")||t.is(":radio")||t.is(":file")?t.parent(".input-group").length?t.parents(".input-group:first").siblings(".text-danger").append(e):e.addClass("text-danger").insertAfter(t.parents(".input-group:first")):t.parent(".input-group").length?e.addClass("text-danger").insertAfter(t.parent()):e.addClass("text-danger").insertAfter(t.parents(".input-group:first"))},submitHandler:function(t){var a=e("#kitprd").val(),i=e("#txttotprice").val();let n="buynow"==e("#BuyNowProduct").val();if((e("#event_txttotprice").val(i),1!=a||void 0===a)&&0==validate_checkout())return!1;if(1==a&&1==ALLOW_KIT_PARTIAL&&e("input[name^='includeinkit']:checked").length<=0)return e.bootstrapGrowl(SELECT_AT_LEAST_ONE_PRODUCT,{type:"danger",align:"center",delay:0,allow_dismiss:!0}),!1;if((""==e("#additiona_login_box").html()&&e("#div_addinfo_save_box").removeClass("hide").show(),"undefined"!=typeof predefined_product_type&&"2"==predefined_product_type)&&0==validate_book_checkout())return!1;if(1==a){if(!1===e("#frmkitinfo").validate().valid()||""==e("#no_of_kit").val())return e("#frmkitinfo").submit(),!1;if(e("#kitquantity").val(e("#no_of_kit").val()),0==validate_agree_checkbox())return!1;if(currentKitProduct<totalkitproduct){var o=e(".kitproduct:eq("+currentKitProduct+")").attr("id");o.split("_")[2];void 0!==o&&(isSubmit=!0)}}if("string"==typeof dfd&&""==dfd||null==typeof dfd){if(0==validate_agree_checkbox())return!1;if(e("#SubmitData").val("1"),n?e("#SubmitBtnBuyNow").addClass("running disabled"):e("#SubmitBtn").addClass("running disabled"),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&"undefined"!=typeof PHOTOPRINT_PRODUCT&&PREDEFINED_PRODUCT_TYPE==PHOTOPRINT_PRODUCT)return submitPrintImages(),!1;t.submit()}else"object"==typeof dfd&&dfd.done((function(a){return 0!=validate_agree_checkbox()&&(e("#SubmitData").val("1"),n?e("#SubmitBtnBuyNow").addClass("running disabled"):e("#SubmitBtn").addClass("running disabled"),"undefined"!=typeof PREDEFINED_PRODUCT_TYPE&&"undefined"!=typeof PHOTOPRINT_PRODUCT&&PREDEFINED_PRODUCT_TYPE==PHOTOPRINT_PRODUCT?(submitPrintImages(),!1):void t.submit())}
1))}}),e("#frmkitinfo").validate(),e("body").on("keyup change","#no_of_kit",(function(e){getkitamount()})),e("body").on("keypress","#opt_userid, #opt_passwordid",(function(e){if(13==e.which)return e.preventDefault(),validate_additional_login()})),e(".register_link").on("click",(function(t){"undefined"!=typeof FILE_MAILING_LIST&&-1!=t.target.baseURI.indexOf(FILE_MAILING_LIST)||(t.preventDefault(),e(this).attr("href",e(this).attr("href")+"&page=popup_interface"),-1!=t.target.baseURI.indexOf(FILE_SHOPPING_CART)&&e(this).attr("href",e(this).attr("href")+"&pagefrom=cart_page"),Fancybox.close(),Fancybox.show([{type:"iframe",toolbar:!0,openEffect:"elastic",closeEffect:"elastic",clickSlide:!1,src:e(this).attr("href"),iframe:{attr:{scrolling:"yes"},css:{minHeight:700,width:"80%",height:"70%"}},modal:!0,afterShow:function(){e(".fancybox-slide").children().prepend('<button type="button" data-fancybox-close="" class="fancybox-button fancybox-close-small" title="Close"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"></path></svg></button>')},afterClose:function(){loginPopup()}}]))})),e("#div_addinfo_action_box a[href='"+SITE_URL+FILE_FORGOT_PASSWORD+"']").on("click",(function(e){Fancybox.close()}))})),$(".frmfeedback").each((function(){$(this).validate({})})),jQuery(document).ready((function(e){e("body").on("change","SELECT.sizedropdown",(function(){var t=e(this).val(),a=(t=t.split("_"))[0],i=t[1],n=t[2],o=e("#product_type"+i).val();e("#pa_calculator"+a).attr("href",SITE_URL+FILE_PHOTOBOOK_PRICE_CALCULATOR+"?productid="+i+"&sizeid="+n+"&product_type="+o)})),e(".templatecat").click((function(){e(".templatecat").removeClass("act"),e(this).addClass("templatecat act");var t=e(this).attr("id");e("#templatecat").val(t)})),e("body").delegate(".price_calc","click",(function(t){t.preventDefault(),url=e(this).attr("href");Fancybox.show([{src:url,type:"iframe"}])}))}));objprevAnchor="",searchKeyTxt="";function validFiletype(e,t){void 0===t&&(t=!1);var a=-1!==e.indexOf(".")?e.replace(/.*[.]/,"").toLowerCase():"",i=!1,n=allowed_extensions;if("undefined"!=typeof uploadextensionstr&&t&&(n=uploadextensionstr),!n.length)return!0;for(var o=0;o<n.length;o++)n[o].toLowerCase()==a&&(i=!0);return!!i||(alert(e+" has invalid extension. Only "+n+" are allowed"),!1)}function amazon_process_upload(t,a){var i=(n=t.attr("id").replace("clfile_","")).split("_");$("#filename"+n).val($("#orifilename"+n).val()),$("#filename_only"+n).val($("#orifilename_only"+n).val()),$(".cloud_spinner_"+n).removeClass("d-none").addClass("d-flex"),uploadfile=a[0].name;if($(t).parents("#upload_content_page").length>0){!0;var n=i[i.length-1]}if(!validFiletype(uploadfile))return $(".cloud_spinner_"+n).addClass("d-none").removeClass("d-flex"),e.stopPropagation(),e.preventDefault(),$("#filename"+n).val(""),!1;$("#success_msg_"+n).html(uploadfile);var o="";if($("#cloudtypefile"+n).length>0&&(o="none",$(".success_msg_"+n).html(uploadfile)),$("#imagethumb"+n).val(""),window.FileReader){var l=document.getElementById("imageCanvas"+n),s=l.getContext("2d"),r=new FileReader;r.onload=function(e){var t=new Image;
1t.onload=function(){l.style.display=o,l.width=200,l.height=200*t.height/t.width,s.drawImage(t,0,0,l.width,l.height),$("#imagethumb"+n).val(l.toDataURL("image/png"))},t.src=e.target.result},r.readAsDataURL(a[0])}var d=uploadfile.split("."),c="."+d[d.length-1],p=$("#filename"+n).val();$("#filename"+n).val(p+c);var _=$("#filename_only"+n).val();return $("#filename_only"+n).val(_+c),!0}function removeCloudFile(e){bootbox.confirm(COMMON_ALERT_DELETE,(function(t){if(t){var a=e.split("_"),i=a[0],n=a[1];jQuery.ajax({url:"/"+SITE_UPLOAD_AJAX_DIRECTORY+FILE_COMMON_UPLOAD,data:"&page=product_option_file&action=delete&file_type=cloudfile&optId="+i+"&productId="+n,success:function(e){}}),$("#filename_"+e).html(""),$("#upload_file_"+e).val(""),$("#optfiles_"+e).val(""),$("#aoptions"+e).val(""),jQuery("#fileupload_"+e).find("#showuploadfile , .qq-upload-list-selector ").html(""),jQuery("#dragdrop_fileupload_"+e).removeClass("d-none"),$("div[id^=cfile_upload_"+e).length>0&&(jQuery("div[id^=cfile_upload_"+e).find(".cloudshowuploadfile").html(""),$("div[id^=cfile_upload_"+e).parent().attr("style","display: none !important"))}}))}function generateHelpTemplate(){if("undefined"==typeof priceDefiningMethod||"undefined"==typeof globalUnit)return!1;$(".cut-div, .safe-div, .bleed-arrow, .bleed-text, .artwork-size-text").hide(),$(".help-template-p").append('<div class="loader_corp loading-container"><div class="loading"></div><div id="loading-text">'+COMMON_LOADING+"</div></div>");var e=$(".help-template-design").parent().width();e<0&&(e=380),e>550&&(e=550);var t=baseHeight=e,a="",i="",n=1;if("3"==priceDefiningMethod){null==(r=$('select[name="unit_selection"]').val())&&(r=globalUnit);var o=$("#previousUnit").val()+"_"+r;$(".csizeunit").html("("+r+")"),$("#previousUnit").val(r);var l=$("#dynamic_custom_width").val(),s=$("#dynamic_custom_height").val()}else{o="Inch_"+(r=globalUnit);var r,d=$("#tempPrdsize option:selected");i=d.val();l=d.data("width"),s=d.data("height");null!=pageWiseSize[i]&&(l=pageWiseSize[i].width,s=pageWiseSize[i].height),a=d.text()}void 0===(n=scalingFactorList[o])&&(n=1);var c=Math.round(1e4*l)/1e4,p=Math.round(1e4*s)/1e4;if(l*=n,s*=n,"3"==priceDefiningMethod&&($("#dynamic_custom_width").val(isNaN(l.toFixed(2))?"":l.toFixed(2)),$("#dynamic_custom_height").val(isNaN(s.toFixed(2))?"":s.toFixed(2))),l=Math.round(1e4*l)/1e4,s=Math.round(1e4*s)/1e4,!(l>0&&s>0))return $(".loading-container").remove(),$("#template_size_error").show(),!1;$("#template_size_error").hide();var _={MM:3.77,CM:37.79,Inch:72,Ft:1152,Meter:3779.52}[r];s*=_,(l*=_)<200&&(t=e),"undefined"!=typeof isHelpTemplatePage&&!0===isHelpTemplatePage&&s>l&&e>400?t=baseHeight=400:s>l&&e>300&&(t=baseHeight=300);var u=t/l,m=baseHeight/s,h=u<m?u:m;l*=h,s*=h,$(".help-container").css({width:l+"px",height:s+"px"});var g=$('select[name="aoptions[]"]').val();(void 0===g||""===g||isNaN(g))&&(g=0);var f=i+"_0";i=i+"_"+g;let v=72*areaMargin[0]*h,y=72*areaMargin[1]*h,E=72*areaMargin[2]*h,T=72*areaMargin[3]*h,b=l-(y+T),I=s-(v+E),C="",D=72*cutMargin[0]*h,P=72*cutMargin[1]*h,k=72*cutMargin[2]*h,O=72*cutMargin[3]*h,A=l-(P+O),x=s-(D+k);var w="3"==priceDefiningMethod?"INCH":globalUnit,S=Number(getsizemeasurementunit(r,w,"3"==priceDefiningMethod?$("#dynamic_custom_width").val():c)),R=Number(getsizemeasurementunit(r,w,"3"==priceDefiningMethod?$("#dynamic_custom_height").val():p));if("3"==priceDefiningMethod&&"0"!=excludeCutMargine||(S=S-cutMargin[1]-cutMargin[3],R=R-cutMargin[0]-cutMargin[2]),"3"==priceDefiningMethod&&"1"==excludeCutMargine)var L=getsizemeasurementunit("INCH",r,S+Number(cutMargin[1])+Number(cutMargin[3])),N=getsizemeasurementunit("INCH",r,R+Number(cutMargin[0])+Number(cutMargin[2]));if((""===(S=getsizemeasurementunit("INCH",r,S))||isNaN(S))&&(S=""),(""===(R=getsizemeasurementunit("INCH",r,R))||isNaN(R))&&(R=""),"mm"===r.toLowerCase()&&(R=Math.round(100*R)/100,S=Math.round(100*S)/100,"3"==priceDefiningMethod&&"1"==excludeCutMargine&&(N=Math.round(N),L=Math.round(L))),""===R&&""===S)var z=finalCutSize+" : "+a+"<br> "+artworkWithBleed+" :  "+c+" x "+p;else{var M="3"==priceDefiningMethod&&"1"==excludeCutMargine?L:$("#dynamic_custom_width").val(),U="3"==priceDefiningMethod&&"1"==excludeCutMargine?N:$("#dynamic_custom_height").val();z=finalCutSize+": "+parseFloat(S).toFixed(2)+" x "+parseFloat(R).toFixed(2)+" ("+r+")<br> "+artworkWithBleed+": "+("3"==priceDefiningMethod?M:getsizemeasurementunit("INCH",r,c))+" x "+("3"==priceDefiningMethod?U:getsizemeasurementunit("INCH",r,p))+" ("+r+")"}$(".artwork-size-text").html(z);var F="landscape";if(l<s)F="potrait";null!=maskImages[i]?C=maskImages[i][F]:null!=maskImages[f]&&(C=maskImages[f][F]);var H=41*l/481.875,Y=48*l/481.875,j=12*l/481.875,G=15*l/481.875;
1$(".safe-div").css({height:I+"px",width:b+"px",top:v+"px",right:y+"px",bottom:E+"px",left:T+"px"}),""!==C?$(".help-template-design").css({"background-image":"url("+C+")"}):$(".help-template-design").css({"background-image":"url()"}),$(".cut-div").css({height:x+"px",width:A+"px",top:D+"px",right:P+"px",bottom:k+"px",left:O+"px"}),$(".bleed-arrow").css({"font-size":Y+"px"}),$(".bleed-text").css({"margin-top":Y-2+"px","font-size":j+"px"}),$(".safe-arrow").css({color:safeMarkColor,"font-size":H+"px"}),$(".safe-text").css({"margin-top":H-2+"px","font-size":j+"px"}),$(".scissors-arrow-top").css({"margin-top":-G/2+"px","font-size":G+"px"}),$(".scissors-arrow-bottom").css({"margin-top":$(".cut-div").height()-G/2+"px","font-size":G+"px"});var q=cut=!0;""==v&&""==y&&""==E&&""==T&&($(".safe-arrow").remove(),$(".safe-text").remove(),$(".safe-div").css("border",""),q=!1),""==D&&""==P&&""==k&&""==O&&($(".cut-div").css("border",""),$(".scissors-arrow-top").remove(),$(".scissors-arrow-bottom").remove(),cut=!1),!1===q&&!1===cut&&($(".bleed-arrow").remove(),$(".bleed-text").remove()),$(".loading-container").remove(),$(".cut-div, .safe-div, .bleed-arrow, .bleed-text, .artwork-size-text, .help-template-design").show()}function getsizemeasurementunit(e,t,a,i,n){void 0===i&&(i=2),void 0===n&&(n=!1);var o="";if(""!=a&&""!=e&&""!=t&&0==n)switch(e.toLowerCase()+"2"+t.toLowerCase()){case"mm2inch":o=(.03937*a).toFixed(i);break;case"mm2cm":o=(a/10).toFixed(i);break;case"cm2inch":o=(.393701*a).toFixed(i);break;case"cm2mm":o=(10*a).toFixed(i);break;case"inch2cm":o=(a/.393701).toFixed(i);break;case"inch2mm":o=(a/.03937).toFixed(i);break;case"ft2inch":o=(12*a).toFixed(i);break;case"meter2inch":o=(39.3701*a).toFixed(i);break;case"inch2meter":o=(a/39.3701).toFixed(i);break;case"ft2cm":o=(30.48*a).toFixed(i);break;case"meter2cm":o=(100*a).toFixed(i);break;case"cm2meter":o=(a/100).toFixed(i);break;case"mm2meter":o=(a/1e3).toFixed(i);break;case"meter2mm":o=(1e3*a).toFixed(i);break;case"mm2ft":o=(.003281*a).toFixed(i);break;case"cm2ft":o=(.032808*a).toFixed(i);break;case"meter2ft":o=(3.28084*a).toFixed(i);break;case"inch2ft":o=(.083333*a).toFixed(i);break;
1case"ft2mm":o=(304.8*a).toFixed(i);break;case"ft2meter":o=(.3048*a).toFixed(i);break;default:o=a}if(1==n&&""!=a){var l=new Array;return l.mm={cm:.01,inch:.00155,ft:107639e-10,meter:1e-6},l.cm={mm:100,inch:.155,ft:.00107639,meter:1e-4},l.inch={mm:645.16,cm:6.4516,ft:.00694444,meter:64516e-8},l.ft={mm:92903,cm:929.03,inch:144,meter:.092903},l.meter={mm:1e6,cm:1e4,ft:10.7639,inch:1550},(a*l[e.toLowerCase()][t.toLowerCase()]).toFixed(i)}return o}jQuery(document).ready((function(e){e("body").on("change","input:file.dropbox_cloud_file_input, input:file.gdrive_file_input",(function(t){var a=e(this).attr("id").split("_");if(page_no=a[1]+"_"+a[2],void 0!==this.files)var i=this.files[0].name;else i=this.value;e(".cloud_spinner_"+page_no).removeClass("d-none").addClass("d-flex");var n=!1;if(e(this).parents("#upload_content_page").length>0&&(n=!0,page_no=a[1]),!validFiletype(i,n))return e(".cloud_spinner_"+page_no).addClass("d-none").removeClass("d-flex"),!1;e("#success_msg_"+page_no).html(i);var o="";if(e("#cloudtypefile"+a[1]+"_"+a[2]).length>0&&(o="none",e(".success_msg_"+page_no).html(i)),window.FileReader){var l=document.getElementById("imageCanvas"+page_no),s=l.getContext("2d"),r=new FileReader;r.onload=function(t){var a=new Image;
1a.onload=function(){l.style.display=o,l.width=200,l.height=200*a.height/a.width,s.drawImage(a,0,0,l.width,l.height),e("#imagethumb"+page_no).val(l.toDataURL("image/png"))},a.src=t.target.result},r.readAsDataURL(t.target.files[0])}window["upload_cloud"+page_no](i)}))})),function(e){e.extend(e.fn,{swapClass:function(e,t){var a=this.filter("."+e);return this.filter("."+t).removeClass(t).addClass(e),a.removeClass(e).addClass(t),this},replaceClass:function(e,t){return this.filter("."+e).removeClass(e).addClass(t).end()},hoverClass:function(t){return t=t||"hover",this.hover((function(){e(this).addClass(t)}),(function(){e(this).removeClass(t)}))},heightToggle:function(e,t){e?this.animate({height:"toggle"},e,t):this.each((function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"](),t&&t.apply(this,arguments)}))},heightHide:function(e,t){e?this.animate({height:"hide"},e,t):(this.hide(),t&&this.each(t))},prepareBranches:function(e){return e.prerendered||(this.filter(":last-child:not(ul)").addClass(t.last),this.filter((e.collapsed?"":"."+t.closed)+":not(."+t.open+")").find(">ul").hide()),this.filter(":has(>ul)")},applyClasses:function(a,i){if(this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview",(function(t){this==t.target&&i.apply(e(this).next())})).add(e("a",this)).hoverClass(),!a.prerendered){this.filter(":has(>ul:hidden)").addClass(t.expandable).replaceClass(t.last,t.lastExpandable),this.not(":has(>ul:hidden)").addClass(t.collapsable).replaceClass(t.last,t.lastCollapsable);var n=this.find("div."+t.hitarea);n.length||(n=this.prepend('<div class="'+t.hitarea+'"/>').find("div."+t.hitarea)),n.removeClass().addClass(t.hitarea).each((function(){var t="";e.each(e(this).parent().attr("class").split(" "),(function(){t+=this+"-hitarea "})),e(this).addClass(t)}))}this.find("div."+t.hitarea).click(i)},treeview:function(a){if((a=e.extend({cookieId:"treeview"},a)).toggle){var i=a.toggle;a.toggle=function(){return i.apply(e(this).parent()[0],arguments)}}function n(){e(this).parent().find(">.hitarea").swapClass(t.collapsableHitarea,t.expandableHitarea).swapClass(t.lastCollapsableHitarea,t.lastExpandableHitarea).end().swapClass(t.collapsable,t.expandable).swapClass(t.lastCollapsable,t.lastExpandable).find(">ul").heightToggle(a.animated,a.toggle),a.unique&&e(this).parent().siblings().find(">.hitarea").replaceClass(t.collapsableHitarea,t.expandableHitarea).replaceClass(t.lastCollapsableHitarea,t.lastExpandableHitarea).end().replaceClass(t.collapsable,t.expandable).replaceClass(t.lastCollapsable,t.lastExpandable).find(">ul").heightHide(a.animated,a.toggle)}function o(){var t=[];l.each((function(a,i){t[a]=e(i).is(":has(>ul:visible)")?1:0})),e.cookie(a.cookieId,t.join(""),a.cookieOptions)}this.data("toggler",n),this.addClass("treeview");var l=this.find("li").prepareBranches(a);switch(a.persist){case"cookie":var s=a.toggle;a.toggle=function(){o(),s&&s.apply(this,arguments)},function(){var t=e.cookie(a.cookieId);if(t){var i=t.split("");l.each((function(t,a){e(a).find(">ul")[parseInt(i[t])?"show":"hide"]()}))}}();break;case"location":var r=this.find("a").filter((function(){return this.href.toLowerCase()==location.href.toLowerCase()}));if(r.length){var d=r.addClass("selected").parents("ul, li").add(r.next()).show();a.prerendered&&d.filter("li").swapClass(t.collapsable,t.expandable).swapClass(t.lastCollapsable,t.lastExpandable).find(">.hitarea").swapClass(t.collapsableHitarea,t.expandableHitarea).swapClass(t.lastCollapsableHitarea,t.lastExpandableHitarea)}}return l.applyClasses(a,n),a.control&&(!function(a,i){function o(i){return function(){return n.apply(e("div."+t.hitarea,a).filter((function(){return!i||e(this).parent("."+i).length}))),!1}}e("a:eq(0)",i).click(o(t.collapsable)),e("a:eq(1)",i).click(o(t.expandable)),e("a:eq(2)",i).click(o())}(this,a.control),e(a.control).show()),this}}),e.treeview={};var t=e.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"}}(jQuery),function(e,t){var a=/[<>&\r\n"']/gm,i={"<":"lt;",">":"gt;","&":"amp;","\r":"#13;","\n":"#10;",'"':"quot;","'":"#39;"};e.extend({fileDownload:function(n,o){var l,s,r,d=e.extend({preparingMessageHtml:null,failMessageHtml:null,androidPostUnsupportedMessageHtml:"Unfortunately your Android browser doesn't support this type of file download. Please try again with a different browser.",dialogOptions:{modal:!0},prepareCallback:function(e){},successCallback:function(e){},abortCallback:function(e){},failCallback:function(e,t,a){},httpMethod:"GET",data:null,checkInterval:100,cookieName:"fileDownload",cookieValue:"true",cookiePath:"/",cookieDomain:null,popupWindowTitle:"Initiating file download...",encodeHTMLEntities:!0},o),c=new e.Deferred,p=(navigator.userAgent||navigator.vendor||t.opera).toLowerCase();/ip(ad|hone|od)/.test(p)?l=!0:-1!==p.indexOf("android")?s=!0:r=/avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|playbook|silk|iemobile|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(p)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(p.substr(0,4));var _,u,m,h,g=d.httpMethod.toUpperCase(),f=null,v=function(e){f&&f.dialog("close"),d.successCallback(e),c.resolve(e)},y=function(e){f&&f.dialog("close"),d.abortCallback(e),c.reject(e)},E=function(t,a,i){f&&f.dialog("close"),d.failMessageHtml&&e("<div>").html(d.failMessageHtml).dialog(d.dialogOptions),d.failCallback(t,a,i),c.reject(t,a)};if(function(t){d.preparingMessageHtml?f=e("<div>").html(d.preparingMessageHtml).dialog(d.dialogOptions):d.prepareCallback&&d.prepareCallback(t)}(n),null!==d.data&&"string"!=typeof d.data&&(d.data=e.param(d.data)),"GET"===g){if(null!==d.data)-1!==n.indexOf("?")?"&"!==n.substring(n.length-1)&&(n+="&"):n+="?",n+=d.data;l||s?((u=t.open(n)).document.title=d.popupWindowTitle,t.focus()):r?t.location(n):_=e("<iframe style='display: none' src='"+n+"'></iframe>").appendTo("body")}else{var T="";null!==d.data&&e.each(d.data.replace(/\+/g," ").split("&"),(function(){var e=this.split("="),t=e[0];e.shift();var a=e.join("=");e=[t,a];var i=d.encodeHTMLEntities?C(decodeURIComponent(e[0])):decodeURIComponent(e[0]);if(i){var n=d.encodeHTMLEntities?C(decodeURIComponent(e[1])):decodeURIComponent(e[1]);T+='<input type="hidden" name="'+i+'" value="'+n+'" />'}})),r?(h=e("<form>").appendTo("body")).hide().prop("method",d.httpMethod).prop("action",n).html(T):(l?((u=t.open("about:blank")).document.title=d.popupWindowTitle,m=u.document,t.focus()):m=b(_=e("<iframe style='display: none' src='about:blank'></iframe>").appendTo("body")),m.write("<html><head></head><body><form method='"+d.httpMethod+"' action='"+n+"'>"+T+"</form>"+d.popupWindowTitle+"</body></html>"),h=e(m).find("form")),h.submit()}function b(e){var t=e[0].contentWindow||e[0].contentDocument;return t.document&&(t=t.document),t}function I(e){setTimeout((function(){u&&(s&&u.close(),l&&u.focus&&(u.focus(),e&&u.close()))}),0)}function C(e){return e.replace(a,(function(e){return"&"+i[e]}))}setTimeout((function t(){var a=d.cookieValue;"string"==typeof a&&(a=a.toLowerCase());var i=d.cookieName.toLowerCase()+"="+a;if(document.cookie.toLowerCase().indexOf(i)>-1){v(n);var o=d.cookieName+"=; path="+d.cookiePath+"; expires="+new Date(0).toUTCString()+";";return d.cookieDomain&&(o+=" domain="+d.cookieDomain+";"),document.cookie=o,void I(!1)}if(u||_)try{var l=u?u.document:b(_);if(l&&null!==l.body&&l.body.innerHTML.length){var s=!0;if(h&&h.length){var r=e(l.body).contents().first();try{r.length&&r[0]===h[0]&&(s=!1)}catch(e){if(!e||-2146828218!=e.number)throw e;s=!0}}if(s)return void setTimeout((function(){E(l.body.innerHTML,n),I(!0)}),100)}}catch(e){return E("",n,e),void I(!0)}setTimeout(t,d.checkInterval)}),d.checkInterval);var $=c.promise();return $.abort=function(){I(),_.attr("src","").html(""),y(n)},$}})}(jQuery,this||window),jQuery(document).ready((function(e){e(document).on("click",".sizeNameVal",(function(t){e('select[name="unit_selection"]').val()&&(productMeasurementUnit=e('select[name="unit_selection"]').val());var a,i,n,o,l,s,r=[],d=[];e(this).parents(".dynamicHelpTemplateMain:first").find(".helpTempElemnetClass").each((function(){-1===r.indexOf(e(this).val())&&null!=e(this).val()&&""!=e(this).val()&&r.push(e(this).val())})),optIds=e(".helpTempElemnetClasstest").find("option:selected").parents("OPTGROUP").attr("optionid"),""==r&&""==d||(a=r.join(","),d.join(","));var c="";null!=a&&(c="&pAtrId="+a);var p="";null!=optIds&&(p="&pOptId="+optIds),n=e(this).attr("filetype"),null!=e(this).attr("productid")&&""!=e(this).attr("productid")&&(o=e(this).attr("productid")),i=e(this).parents(".dynamicHelpTemplateMain:first").find("#tempPrdsize").val(),l=e("#dynamic_custom_width").val(),s=e("#dynamic_custom_height").val(),null!=l&&""!=l&&null!=s&&""!=s?e(this).attr("href",siteUrl+"product_help_templates.php?pid="+o+"&action=htemplate"+c+p+"&sizeid=-1&fileType="+n+"&dataWidth="+l+"&dataHeight="+s+"&mesurementUnit="+productMeasurementUnit):e(this).attr("href",siteUrl+"product_help_templates.php?pid="+o+"&action=htemplate"+c+p+"&sizeid="+i+"&fileType="+n)})),jQuery(".selectProducts").on("change",(function(){var t,a;t=e(this).val(),a=e(this).attr("pId"),null!=t&&""!=t?(e(this).parents(".dynamicHelpTemplateMain:first").find(".categoryBtn").attr("productId",t),e(".categoryProductSize").addClass("dynamicHelpTemplateMainSize_"+t),e.ajax({url:"product_help_templates.php",type:"POST",dataType:"json",data:"action=categoryWiseHelpTemp&pid="+t,success:function(t){""==t.productOptionsHtml?e(".selectedProductOptions_"+a).addClass("d-none"):e(".selectedProductOptions_"+a).removeClass("d-none"),e(".selectedProductSize_"+a).html(t.productSizeHtml),e(".selectedProductOptions_"+a).html(t.productOptionsHtml),e(".categoryHelpTemplateBtn_"+a).html(t.productName),e(".categoryDownloadBtn_"+a).removeClass("d-none"),e(".selectpicker").selectpicker()}})):(e(".selectedProductSize_"+a).html(""),e(".selectedProductOptions_"+a).html(""),e(".categoryHelpTemplateBtn_"+a).html(""),e(".categoryDownloadBtn_"+a).addClass("d-none"))})),generateHelpTemplate(),e(document).on("change","#tempPrdsize",(function(e){generateHelpTemplate()})),e(document).on("change","#dynamic_custom_width,#dynamic_custom_height",(function(e){generateHelpTemplate()})),e(document).on("change",'select[name="aoptions[]"], select[name="unit_selection"]',(function(e){generateHelpTemplate()})),e('a[data-toggle="tab"]').on("shown.bs.tab",(function(t){var a=e(t.target).attr("href");"#help-template"!==a&&"#download"!==a||generateHelpTemplate()})),e(document).on("keyup","#keywords",(function(t){var a=e(this).val().trim().toLowerCase();e(".templateList").each((function(){var t=e(this),i=0;t.find("a").each((function(){var t=e(this).text().toLowerCase();e(this).parents().show(),i++,""==a||t.includes(a)||(e(this).parent().hide(),i--)}
1)),0===i?e("#no_records").removeClass("d-none"):e("#no_records").addClass("d-none")}))})),e(".upload_size #rdo_size").length>0&&e(".dynamicHelpTemplateMain #tempPrdsize").length>0&&e(".dynamicHelpTemplateMain #tempPrdsize").val(e(".upload_size #rdo_size").find(":selected").val()).trigger("change"),e(document).on("change","#prductsize #prdsize, .upload_size #rdo_size",(function(){e(".dynamicHelpTemplateMain #tempPrdsize").length>0&&e(".dynamicHelpTemplateMain #tempPrdsize").val(e(this).find(":selected").val()).trigger("change")})),e(".customsizehtmlDefault").length>0&&e(".dynamic_customsizehtmlDefault").length>0&&(e(".dynamic_customsizehtmlDefault #dynamic_custom_width").val(e(".customsizehtmlDefault #custom_width").val()),e(".dynamic_customsizehtmlDefault #dynamic_custom_height").val(e(".customsizehtmlDefault #custom_height").val())),e(".upload_size #custom_width").length>0&&e(".dynamic_customsizehtmlDefault").length>0&&(e(".upload_size #measurement_unit").length>0&&e(".cust-measurementUnits #unit_selection").val(e(".upload_size #measurement_unit").val()).trigger("change"),e(".dynamic_customsizehtmlDefault #dynamic_custom_width").val(e(".upload_size #custom_width").val()),e(".dynamic_customsizehtmlDefault #dynamic_custom_height").val(e(".upload_size #custom_height").val())),e("#predefined_custom_size").length>0&&e("#dynamic_custom_width").length>0&&(e("#dynamic_custom_width").val(e("#predefined_custom_size").find(":selected").data("width")),e("#dynamic_custom_height").val(e("#predefined_custom_size").find(":selected").data("height")).trigger("change")),e(document).on("change",".upload_size #predefined_custom_size",(function(){"-1"!=e(this).val()&&(e("#dynamic_custom_width").val(e(this).find(":selected").data("width")),e("#dynamic_custom_height").val(e(this).find(":selected").data("height")).trigger("change"))})),e(document).on("change","#measurement_unit, #custom_width, #custom_height",(function(){e("#dynamic_custom_width").val(e("#custom_width").val()),e("#dynamic_custom_height").val(e("#custom_height").val()).trigger("change"),e("#measurement_unit").length>0&&e("#unit_selection").val()!=e("#measurement_unit").val()&&e("#unit_selection").val(e("#measurement_unit").val()).trigger("change")}))}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.