PageSourceSearch

https://www.fm-academy.co.uk/wp-content/plugins/woocommerce-appoin…/assets/js/frontend/addons.min.js

js fm-academy.co.uk collected 2026-10-04 05:53:42 UTC 33,870 bytes, 1 lines download raw bytes

1!function(h,_){function t(a){return this instanceof t?!!a.length&&(this.$el=a,this.$addons=this.$el.find(".wc-pao-addon-field"),this.$addons.length?(this.is_rtl="rtl"===document.documentElement.dir,this.validation=new e(this),this.totals=new o(this),this.show_incomplete_subtotals=this.totals.showIncompleteSubtotals(),this.setupEvents(),this.validation.validate(),this.updateTotals(),h(".wc-pao-addon-image-swatch").tipTip({delay:200}),void WC_PAO.initialized_forms.push(this)):this.$addons=!1):new t(a)}function o(a){return this instanceof o?!h.isEmptyObject(a)&&(this.$form=a.$el,this.$addons=a.$addons,this.$variation_input=!!this.$form.hasClass("variations_form")&&this.$form.find('input[name="variation_id"], input.variation_id'),this.is_variable=this.$variation_input&&0<this.$variation_input.length,this.$totals=this.$form.find("#product-addons-total"),this.product_id=this.is_variable?this.$variation_input.val():this.$totals.data("product-id"),!!this.product_id&&(this.base_price=this.$totals.data("price"),this.raw_price=this.$totals.data("raw-price"),this.product_type=this.$totals.data("type"),this.qty=parseFloat(this.$form.find("input.qty").val()),this.addons_price_data=[],this.$subscription_plans=this.$form.find(".wcsatt-options-product"),this.has_subscription_plans=0<this.$subscription_plans.length,this.is_rtl=a.is_rtl,this.total=0,this.total_raw=0,void(this.show_subtotal_panel=!0))):new o(a)}function e(a){return this instanceof e?!!a.$addons.length&&(this.$form=a.$el,this.$addons=a.$addons,void(this.validationState=this.getInitialState())):new e(a)}(WC_PAO=_.WC_PAO||{}).initialized_forms=[],WC_PAO.Helper={escapeHtml:function(a){return document.createElement("div").appendChild(document.createTextNode(a)).parentNode.innerHTML},isGroupedSubsSelected:function(){var a=h(".product-type-grouped"),t=!1;return a.length&&a.find(".group_table tr.product").each(function(){if(0<h(this).find(".input-text.qty").val()&&h(this).find(".entry-summary .subscription-details").length)return!(t=!0)}),t},isGroupedMixedProductType:function(){var a=h(".product-type-grouped"),t=0,o=0;return!!(a.length&&(a.find(".group_table tr.product").each(function(){0<h(this).find(".input-text.qty").val()&&(h(this).find(".entry-summary .subscription-details").length?t++:o++)}),0<t&&0<o))},delay:function(a,t){clearTimeout(0),setTimeout(a,t)}},WC_PAO.Form=(t.prototype.setupEvents=function(){var i,n=this;n.$el.find('button[type="submit"]').on("click",function(){if(n.validation.validate(!0))return!0;var a=n.$el.find(".wc-pao-validation-notice");return 0<a.length&&(0<(a=n.$el.find(a[0].closest(".wc-pao-addon-container"))).length&&!n.is_in_viewport(a)&&a[0].scrollIntoView()),!1}),n.$el.on("blur change",".wc-pao-addon input, .wc-pao-addon textarea, .wc-pao-addon select, .wc-pao-addon-custom-text",function(){n.validation.validateAddon(h(this),!0),n.updateTotals()}),n.$el.on("keyup",".wc-pao-addon input, .wc-pao-addon textarea, .wc-pao-addon-custom-text",function(){var a=h(this);WC_PAO.Helper.delay(function(){n.validation.validateAddon(a,!0),n.updateTotals()},300)}),n.$el.on("change","input.qty",function(){n.updateTotals()}),n.$el.on("touchstart",".wc-pao-addon-image-swatch",function(a){i=new Date}),n.$el.on("click touchend",".wc-pao-addon-image-swatch",function(a){if((a.preventDefault(),"touchend"===a.type&&i)&&100<new Date-i)return;var a=h(this).data("value"),t=h(this).parents(".wc-pao-addon-wrap"),o=h.parseHTML(h(this).data("price")),e=t.find(".wc-pao-addon-image-swatch-selected-swatch");e.html(""),t.find(".wc-pao-addon-image-swatch").removeClass("selected"),h(this).addClass("selected"),t.find(".wc-pao-addon-image-swatch-select").val(a),e.html(o),n.validation.validateAddon(t.find("select.wc-pao-addon-field"),!0),n.updateTotals()}),n.$el.on("click",".reset_variations",function(){n.totals.reset()}),n.$el.on("wc_variation_form",function(){n.validation.validate(),n.updateTotals()}
1),n.$el.on("found_variation",function(a,t){n.totals.updateVariation(t),n.validation.validate(),n.updateTotals()}),n.$el.on("hide_variation",function(a){n.updateTotals()}),n.$el.on("woocommerce-product-addons-update",function(){n.validation.validate(),n.updateTotals()}),h("#credit_called").on("keyup",function(){n.validation.validate(),n.updateTotals()})},t.prototype.updateTotals=function(){this.totals.calculate(),this.show_incomplete_subtotals||this.isValid()?this.totals.render():this.totals.reset()},t.prototype.isValid=function(){var a=!0;return this.$el.find("button.single_add_to_cart_button").is(".disabled")?a=!1:(h.each(this.validation.getValidationState(),function(){if(!this.validity)return a=!1}),a)},t.prototype.is_in_viewport=function(a,t,o,e){var i,n,s,d,r,c,l,p=h(_);if(!(a.length<1))return a=1<a.length?a.eq(0):a,s=a.get(0),r=p.width(),l=p.height(),o=!0!==o||s.offsetWidth*s.offsetHeight,e=e||"vertical","function"==typeof s.getBoundingClientRect?(c=0<=(s=s.getBoundingClientRect()).top&&s.top<l,i=0<s.bottom&&s.bottom<=l,d=s.top<0&&s.bottom>l,n=0<=s.left&&s.left<r,s=0<s.right&&s.right<=r,d=t?c||i||d:c&&i,c=t?n||s:n&&s,"both"===e?o&&d&&c:"vertical"===e?o&&d:"horizontal"===e?o&&c:void 0):(n=(i=p.scrollTop())+l,d=(s=p.scrollLeft())+r,p=(l=(c=a.offset()).top)+a.height(),c=(r=c.left)+a.width(),a=!0===t?p:l,l=!0===t?l:p,p=!0===t?c:r,t=!0===t?r:c,"both"===e?!!o&&l<=n&&i<=a&&t<=d&&s<=p:"vertical"===e?!!o&&l<=n&&i<=a:"horizontal"===e?!!o&&t<=d&&s<=p:void 0)},o.prototype.showIncompleteSubtotals=function(){return 1===this.$totals.data("show-incomplete-sub-total")},o.prototype.updateVariation=function(a){this.$variation_input=!!this.$form.hasClass("variations_form")&&this.$form.find('input[name="variation_id"], input.variation_id'),this.product_id=a.variation_id,this.$totals.data("product-id",this.product_id),"undefined"!=typeof a.display_price?this.base_price=a.display_price:h(a.price_html).find(".amount").last().length&&(this.base_price=h(a.price_html).find(".amount").last().text(),this.base_price=this.base_price.replace(woocommerce_addons_params.currency_format_symbol,""),this.base_price=this.base_price.replace(woocommerce_addons_params.currency_format_thousand_sep,""),this.base_price=this.base_price.replace(woocommerce_addons_params.currency_format_decimal_sep,"."),this.base_price=this.base_price.replace(/[^0-9\.]/g,""),this.base_price=parseFloat(this.base_price)),this.$totals.data("price",this.base_price)},o.prototype.calculate=function(){var f=this;f.qty=parseFloat(f.$form.find("input.qty").val()),f.addons_price_data=[],f.total=0,f.total_raw=0,f.base_price=f.$totals.data("price"),f.raw_price=f.$totals.data("raw-price"),f.product_id=f.is_variable?f.$variation_input.val():f.$totals.data("product-id"),""===f.base_price&&"undefined"!=typeof custom_gift_card_amount&&custom_gift_card_amount.length&&0<custom_gift_card_amount.val()&&(f.base_price=custom_gift_card_amount.val()),woocommerce_addons_params.is_bookings&&h(".wc-bookings-booking-cost").length&&(f.base_price=parseFloat(h(".wc-bookings-booking-cost").attr("data-raw-price"))),this.$addons.each(function(){if(h(this).val()){var a,t,o,e=h(this),i=e.parents(".wc-pao-addon"),n=i.find(".wc-pao-addon-name").length?i.find(".wc-pao-addon-name").data("addon-name"):"",s="",d=0,r=0,c=e.data("price-type"),l=0,p=e.data("duration-type"),_=!1,u={},m=!!i.find(".wc-pao-addon-name").length&&i.find(".wc-pao-addon-name").data("has-per-person-pricing"),i=!!i.find(".wc-pao-addon-name").length&&i.find(".wc-pao-addon-name").data("has-per-block-pricing");if(e.is(".wc-pao-addon-custom-price"))_=!0,d=e.val(),r=e.val(),c="quantity_based";else if(e.is(".wc-pao-addon-input-multiplier"))""!==e.val()&&(e.val(Math.ceil(e.val())),d=e.data("price")*e.val(),r=e.data("raw-price")*e.val(),e.data("duration"),e.val(),l=e.data("raw-duration")*e.val());else if(e.is(".wc-pao-addon-checkbox, .wc-pao-addon-radio")){if(!e.is(":checked"))return;s=e.data("label"),d=e.data("price"),r=e.data("raw-price"),e.data("duration"),l=e.data("raw-duration")}else if(e.is(".wc-pao-addon-image-swatch-select, .wc-pao-addon-select")){if(!e.find("option:selected")||""===e.find("option:selected").val())return;c=e.find("option:selected").data("price-type"),p=e.find("option:selected").data("duration-type"),s=e.find("option:selected").data("label"),d=e.find("option:selected").data("price"),r=e.find("option:selected").data("raw-price"),e.find("option:selected").data("duration"),l=e.find("option:selected").data("raw-duration")}else{if(!e.val())return;d=e.data("price"),r=e.data("raw-price"),e.data("duration"),l=e.data("raw-duration")}switch(d=d||0,r=r||0,l=l||0,"booking"!==f.product_type&&"accommodation-booking"!==f.product_type||!woocommerce_addons_params.is_bookings||(void(a=f.qty=0)!==h("#wc_bookings_field_duration")&&0<h("#wc_bookings_field_duration").val()&&(a=h("#wc_bookings_field_duration").val()),void 0!==h("#wc-bookings-form-end-time")&&0<h("#wc-bookings-form-end-time").val()&&(a=h("#wc-bookings-form-end-time").val()),o=h("#wc_bookings_field_persons"),t=0,1===o.length?t=parseInt(t,10)+parseInt(o.val(),10):h(".wc-bookings-booking-form").find("input").each(function(){var a=this.id.match(/wc_bookings_field_persons_(\d+)/);null!=a&&h("#"+a[0]).length&&(t=parseInt(t,10)+parseInt(h("#"+a[0]).val(),10))}),0===f.qty&&h(".wc-bookings-booking-cost").length&&(f.qty=1),m&&t&&(f.qty*=t),i&&a&&(f.qty*=a)),c){case"flat_fee":u.cost=parseFloat(d),u.cost_raw=parseFloat(r);break;case"quantity_based":u.cost_pu=parseFloat(d),u.cost_raw_pu=parseFloat(r),u.cost=u.cost_pu*f.qty,u.cost_raw=u.cost_raw_pu*f.qty;break;case"percentage_based":u.cost_pct=parseFloat(d)/100,u.cost_raw_pct=parseFloat(r)/100,u.cost=parseFloat(f.base_price)*u.cost_pct*f.qty,u.cost_raw=parseFloat(f.raw_price)*u.cost_raw_pct*f.qty}switch(f.total+=u.cost||0,f.total_raw+=u.cost_raw||0,p){case"flat_time":case"":u.duration=l,u.duration_raw=l;break;case"quantity_based":u.duration_pu=l,u.duration_raw_pu=l,u.duration=u.duration_pu*f.qty,u.duration_raw=u.duration_raw_pu*f.qty}void 0!==s&&("number"==typeof s||s.length?u.name=n+(s?" - "+s:""):(o=e.val(),(m=parseInt(woocommerce_addons_params.trim_user_input_characters,10))<(o=e.is(".wc-pao-addon-file-upload")?o.replace(/^.*[\\\/]/,""):o).length&&(o=o.slice(0,m)+"..."),u.name=n+" - "+WC_PAO.Helper.escapeHtml(o)),u.is_custom_price=_,u.price_type=c,u.duration_type=p,f.addons_price_data.push(u))}}),f.$totals.data("price_data",f.addons_price_data),f.$form.trigger("updated_addons")},o.prototype.render=function(){var i=this;if(!i.$totals.data("show-sub-total"))return i.$totals.empty(),void i.$form.trigger("updated_addons");if(i.qty){i.formatMoney(i.total);var a,o,n=!1;if("undefined"!=typeof i.base_price&&i.product_id&&(a=h(".wc-bookings-booking-form").length||h(".wc-appointments-appointment-cost").length?isNaN(i.base_price)?0:parseFloat(i.base_price):parseFloat(i.base_price*i.qty),o=i.formatMoney(a+i.total)),i.has_subscription_plans?(t=i.$form.data("satt_script"))&&t.schemes_model.get_active_scheme_key()&&((t=i.$subscription_plans.find("input:checked")).val()&&(e=t.parent().find(".subscription-detail
1s"))):i.$form.parent().find(".subscription-details").length&&!i.$form.hasClass("bundle_data")&&(e=i.$form.parent().find(".subscription-details"),i.$variation_input&&0<i.$variation_input.length&&(e=i.$form.parent().find(".woocommerce-variation .subscription-details"))),e&&0<e.length&&(d=" "+e.clone().wrap("<p>").parent().html()),"grouped"===i.product_type?d&&!WC_PAO.Helper.isGroupedMixedProductType()&&WC_PAO.Helper.isGroupedSubsSelected()&&(o&&(o+=d)):d&&o&&(o+=d),o){var s,t=i.$form.find(".wc-pao-addon-container").data("product-name"),e=i.formatMoney(a),d=i.$form.find(".wc-pao-addon-container").data("product-tax-status"),r=(s=h(".wc-bookings-booking-form").length?'<div class="product-addon-totals"><ul><li><div class="wc-pao-col1"><strong>'+t+'</strong></div><div class="wc-pao-col2"><strong><span class="amount">'+e+"</span></strong></div></li>":'<div class="product-addon-totals"><ul><li><div class="wc-pao-col1"><strong><span>'+(i.is_rtl?woocommerce_addons_params.quantity_symbol+i.qty:i.qty+woocommerce_addons_params.quantity_symbol)+"</span> "+t+'</strong></div><div class="wc-pao-col2"><strong><span class="amount">'+e+"</span></strong></div></li>",i.addons_price_data.length&&h.each(i.addons_price_data,function(a,t){var o,e;s="quantity_based"===t.price_type?(e=0===(o=t.cost)?"-":i.formatMoney(o),s+'<li class="wc-pao-row-quantity-based"><div class="wc-pao-col1">'+t.name+'</div><div class="wc-pao-col2"><span class="amount">'+e+"</span></div></li>"):(e=0===(o=t.cost)?"-":'<span class="amount">'+i.formatMoney(o)+"</span>",s+'<li><div class="wc-pao-col1"><strong>'+t.name+'</strong></div><div class="wc-pao-col2">'+e+"</div></li>"),woocommerce_addons_params.tax_enabled&&t.is_custom_price&&(n=!0)}),""),c=void 0===i.$totals.data("i18n_sub_total")?woocommerce_addons_params.i18n_sub_total:i.$totals.data("i18n_sub_total");if(n||woocommerce_addons_params.price_display_suffix&&woocommerce_addons_params.tax_enabled)return"taxable"!==d||n||!1!=-1<woocommerce_addons_params.price_display_suffix.indexOf("{price_including_tax}")||!1!=-1<woocommerce_addons_params.price_display_suffix.indexOf("{price_excluding_tax}")?void h.ajax({type:"POST",url:woocommerce_addons_params.ajax_url,data:{action:"wc_product_addons_calculate_tax",product_id:i.product_id,add_on_total:i.total,add_on_total_raw:i.total_raw,qty:i.qty},success:function(a){var t;s="SUCCESS"==a.result?(r='<small class="woocommerce-price-suffix">'+woocommerce_addons_params.price_display_suffix+"</small>",t=i.formatMoney(a.price_including_tax),a=i.formatMoney(a.price_excluding_tax),r=(r=r.replace("{price_including_tax}",'<span class="amount">'+t+"</span>")).replace("{price_excluding_tax}",'<span class="amount">'+a+"</span>"),t=woocommerce_addons_params.display_include_tax?t:a,s+'<li class="wc-pao-subtotal-line"><p class="price">'+c+' <span class="amount">'+t+"</span> "+r+" </p></li></ul></div>"):s+'<li class="wc-pao-subtotal-line"><p class="price">'+c+' <span class="amount">'+o+"</span></p></li></ul></div>",i.show_subtotal_panel?i.$totals.html(s):i.$totals.html(""),i.$form.trigger("updated_addons")},error:function(){s=s+'<li class="wc-pao-subtotal-line"><p class="price">'+c+' <span class="amount">'+o+"</span></p></li></ul></div>",i.show_subtotal_panel?i.$totals.html(s):i.$totals.html(""),i.$form.trigger("updated_addons")}}):(s=s+'<li class="wc-pao-subtotal-line"><strong>'+c+' <span class="amount">'+o+"</span> "+woocommerce_addons_params.price_display_suffix+"</strong></li></ul></div>",i.show_subtotal_panel?i.$totals.html(s):i.$totals.html(""),void i.$form.trigger("updated_addons"));s=s+'<li class="wc-pao-subtotal-line"><p class="price">'+c+' <span class="amount">'+o+"</span></p></li></ul></div>",i.show_subtotal_panel?i.$totals.html(s):i.$totals.html(""),void i.$form.trigger("updated_addons")}else i.$totals.empty(),i.$form.trigger("updated_addons")}else i.$totals.empty(),i.$form.trigger("updated_addons")},o.prototype.reset=function(){this.$totals.empty(),this.$totals.html(""),this.$form.trigger("updated_addons")},o.prototype.formatMoney=function(a){let t=woocommerce_addons_params.currency_format_num_decimals;var o;return woocommerce_addons_params.trim_trailing_zeros&&(o=parseFloat(a)%1==0,a=parseFloat(a),t=o?0:a.toString().split(".")[1].length),accounting.formatMoney(a,{symbol:woocommerce_addons_params.currency_format_symbol,decimal:woocommerce_addons_params.currency_format_decimal_sep,thousand:woocommerce_addons_params.currency_format_thousand_sep,precision:t,format:woocommerce_addons_params.currency_format})},e.prototype.getInitialState=function(){var a={};return h.each(this.$addons,function(){a[h(this).attr("id")]={validity:!0,message:""}}),a},e.prototype.getValidationState=function(){return this.validationState},e.prototype.validateAddon=function(a,t=!1){var o=a.data("restrictions"),e=a.attr("id"),i=!0;return h.isEmptyObject(o)||((i="required"in o&&"yes"===o.required?this.validateRequired(a):i)&&"content"in o&&("only_letters"===o.content?i=this.validateLetters(a):"only_numbers"===o.content?i=this.validateNumbers(a):"only_letters_numbers"===o.content?i=this.validateLettersNumbers(a):"email"===o.content&&(i=this.validateEmail(a))),(i=i&&"min"in o?this.validateMin(a,o.min):i)&&"max"in o&&(i=this.validateMax(a,o.max))),t&&this.printMessage(
1a),this.validationState[e].validity},e.prototype.validate=function(a=!1){var t=!0,o=this;return h.each(o.$addons,function(){o.validateAddon(h(this),a)||(t=!1)}),t},e.prototype.printMessage=function(a){var t,a=a.attr("id"),o=this.$form.find("#"+a),e=a+"-validation-notice",i=this.validationState[a].message;o.is(":radio")||o.is(":checkbox")?((t=o.closest(".wc-pao-addon-container .wc-pao-addon-wrap")).find(".wc-pao-validation-notice").remove(),this.validationState[a].validity||t.append('<small id="'+e+'" class="wc-pao-validation-notice">'+i+"</small>")):(o.closest(".wc-pao-addon-container").find(".wc-pao-validation-notice").remove(),this.validationState[a].validity||o.after('<small id="'+e+'" class="wc-pao-validation-notice">'+i.replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</small>"))},e.prototype.validateRequired=function(a){var t=!0,o="",e="",i=a.attr("id");if(a.is(":checkbox")||a.is(":radio")){var n,s=(n=a.closest(".wc-pao-addon-container")).find(".wc-pao-addon-field"),d=this,t=!1;if(h.each(s,function(){h(this).is(":checked")&&(t=!0)}),t)return void h.each(s,function(){var a=h(this).attr("id");d.validationState[a]={validity:t,message:o,reason:e}});o=woocommerce_addons_params.i18n_validation_required_select}else a.hasClass("wc-pao-addon-image-swatch-select")?(n=a.closest(".wc-pao-addon-container"),t=!1,h.each(n.find(".wc-pao-addon-image-swatch"),function(){h(this).hasClass("selected")&&(t=!0)}),t||(o=woocommerce_addons_params.i18n_validation_required_select)):a.val()||(t=!1,"file"===a.attr("type")?o=woocommerce_addons_params.i18n_validation_required_file:"number"===a.attr("type")?o=woocommerce_addons_params.i18n_validation_required_number:a.is("input")||a.is("textarea")?o=woocommerce_addons_params.i18n_validation_required_input:a.is("select")&&(o=woocommerce_addons_params.i18n_validation_required_select));return t||(e="required"),this.validationState[i]={validity:t,message:o,reason:e},this.validationState[i].validity},e.prototype.validateLetters=function(a){var t=!/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~\d]/g.test(a.val()),o="",e="",i=a.attr("id");return(t=a.val()?t:!0)||(o=woocommerce_addons_params.i18n_validation_letters_only,e="letters"),this.validationState[i]={validity:t,message:o,reason:e},this.validationState[i].validity},e.prototype.validateNumbers=function(a){var t=/^[0-9]*$/g.test(a.val()),o="",e="",i=a.attr("id");return(t=a.val()?t:!0)||(o=woocommerce_addons_params.i18n_validation_numbers_only,e="numbers"),this.validationState[i]={validity:t,message:o,reason:e},this.validationState[i].validity},e.prototype.validateLettersNumbers=function(a){var t=!/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/g.test(a.val()),o="",e="",i=a.attr("id");return(t=a.val()?t:!0)||(o=woocommerce_addons_params.i18n_validation_letters_and_numbers_only,e="letters_numbers"),this.validationState[i]={validity:t,message:o,reason:e},this.validationState[i].validity},e.prototype.validateEmail=function(a){var t=/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(a.val()),o="",e="",i=a.attr("id");return(t=a.val()?t:!0)||(o=woocommerce_addons_params.i18n_validation_email_only,e="email"),this.validationState[i]={validity:t,message:o,reason:e},this.validationState[i].validity},e.prototype.validateMin=function(a,t){var o,e=!0,i="",n="",s=a.attr("id");return a.val()?"number"===a.attr("type")?(o=((o=a.val()).includes(".")||o.includes(",")?parseFloat:parseInt)(o))<t&&(e=!1,i=woocommerce_addons_params.i18n_validation_min_number.replace("%c",t)):("text"===a.attr("type")||a.is("textarea"))&&a.val().length<t&&(e=!1,i=woocommerce_addons_params.i18n_validation_min_characters.replace("%c",t)):e=!0,this.validationState[s]={validity:e,message:i,reason:n=e?n:"min"},this.validationState[s].validity},e.prototype.validateMax=function(a,t){var o,e,i=!0,n="",s=a.attr("id");return a.val()?"number"===a.attr("type")?t<(e=((e=a.val()).includes(".")||e.includes(",")?parseFloat:parseInt)(e))&&(i=!1,n=woocommerce_addons_params.i18n_validation_max_number.replace("%c",t)):("text"===a.attr("type")||a.is("textarea"))&&a.val().length>t&&(i=!1,n=woocommerce_addons_params.i18n_validation_max_characters.replace("%c",t)):i=!0,this.validationState[s]={validity:i,message:n,reason:o=i?o:"max"},this.validationState[s].validity},t),h(function(){h("body").on("quick-view-displayed",function(){h(this).find(".cart:not(.cart_group)").each(function(){new WC_PAO.Form(h(this))})}),h("body").find(".cart:not(.cart_group)").each(function(){new WC_PAO.Form(h(this))})})}(jQuery,window),jQuery(function(w){var v={isGroupedMixedProductType:function(){var a=w(".product-type-grouped"),t=0,o=0;return!!(a.length&&(a.find(".group_table tr.product").each(function(){0<w(this).find(".input-text.qty").val()&&(w(this).find(".entry-summary .subscription-detail
1s").length?t++:o++)}),0<t&&0<o))},escapeHtml:function(a){return document.createElement("div").appendChild(document.createTextNode(a)).parentNode.innerHTML},isGroupedSubsSelected:function(){var a=w(".product-type-grouped"),t=!1;return a.length&&a.find(".group_table tr.product").each(function(){if(0<w(this).find(".input-text.qty").val()&&w(this).find(".entry-summary .subscription-details").length)return!(t=!0)}),t},formatMoney:function(a){return accounting.formatMoney(a,{symbol:woocommerce_addons_params.currency_format_symbol,decimal:woocommerce_addons_params.currency_format_decimal_sep,thousand:woocommerce_addons_params.currency_format_thousand_sep,precision:woocommerce_addons_params.trim_trailing_zeros?0:woocommerce_addons_params.currency_format_num_decimals,format:woocommerce_addons_params.currency_format})},getCostByTax:function(a,t){t=(!woocommerce_addons_params.price_include_tax||!woocommerce_addons_params.display_include_tax)&&(woocommerce_addons_params.price_include_tax&&!woocommerce_addons_params.display_include_tax||!woocommerce_addons_params.price_include_tax&&woocommerce_addons_params.display_include_tax||woocommerce_addons_params.price_include_tax||woocommerce_addons_params.display_include_tax)?t:a;return t},init:function(a){var _=a,u=!!_.hasClass("variations_form")&&_.find('input[name="variation_id"], input.variation_id'),a=(_.on("click",".reset_variations",function(){w.each(_.find(".product-addon"),function(){var a=w(this).find(".addon");(a.is(":checkbox")||a.is(":radio"))&&a.prop("checked",!1),a.is("select")&&a.prop("selectedIndex",0),(a.is(":text")||a.is("textarea")||a.is('input[type="number"]')||a.is('input[type="file"]'))&&a.val("")}),_.trigger("woocommerce-product-addons-update")}).on("mouseup","input[type=number]",function(){w(this).trigger("woocommerce-product-addons-update")}).on("keyup change",".wc-pao-addon input, .wc-pao-addon textarea",function(){var a;0<w(this).attr("maxlength")&&(a=w(this).val(),a=w(this).attr("maxlength")-a.length,w(this).next(".wc-pao-addon-chars-remaining").find("span").text(a))}).on("input change",".wc-pao-addon input, .wc-pao-addon textarea, .wc-pao-addon select, input.qty, .wc-pao-addon-custom-text, .wc-pao-addon-custom-price",function(){w(this).trigger("woocommerce-product-addons-update")}).on("found_variation",function(a,t){var o=w(this),e=o.find("#product-addons-total");"undefined"!=typeof t.display_price?e.data("price",t.display_price):w(t.price_html).find(".amount:last").length&&(t=(t=(t=(t=(t=w(t.price_html).find(".amount").last().text()).replace(woocommerce_addons_params.currency_format_symbol,"")).replace(woocommerce_addons_params.currency_format_thousand_sep,"")).replace(woocommerce_addons_params.currency_format_decimal_sep,".")).replace(/[^0-9\.]/g,""),t=parseFloat(t),e.data("price",t)),o.trigger("woocommerce-product-addons-update")}).on("woocommerce-product-addons-update",function(){var f=0,h=0,o=_.find("#product-addons-total"),a=u&&0<u.length,t=_.find(".wcsatt-options-product"),e=0<t.length;if(product_id=a?u.val():o.data("product-id"),product_price=o.data("price"),product_type=o.data("type"),qty=parseFloat(_.find("input.qty").val()),addons=[],""===product_price&&"undefined"!=typeof custom_gift_card_amount&&custom_gift_card_amount.length&&0<custom_gift_card_amount.val()&&(product_price=custom_gift_card_amount.val()),woocommerce_addons_params.is_bookings&&w(".wc-bookings-booking-cost").length&&(product_price=parseFloat(w(".wc-bookings-booking-cost").attr("data-raw-price"))),w(".wc-appointments-appointment-cost").length,_.find(".wc-pao-required-addon").each(function(){var a=w(this).find(":checkbox[required]");a.on("change",function(){a.is(":checked")?a.prop("required",!1):a.prop("required",!0)})}),_.find(".wc-pao-addon-field").each(function(){var a,t,o,e=w(this),i=e.parents(".wc-pao-addon"),n=i.find(".wc-pao-addon-name").length?i.find(".wc-pao-addon-name").data("addon-name"):"",s="",d=0,r=0,c=e.data("price-type"),l=0,p=e.data("duration-type"),_=!1,u={},m=!!i.find(".wc-pao-addon-name").length&&i.find(".wc-pao-addon-name").data("has-per-person-pricing"),i=!!i.find(".wc-pao-addon-name").length&&i.find(".wc-pao-addon-name").data("has-per-block-pricing");
1if(e.is(".wc-pao-addon-custom-price")){if(!e.val())return;_=!0,d=e.val(),r=e.val(),c="quantity_based"}else if(e.is(".wc-pao-addon-input-multiplier")){if(isNaN(e.val())||""===e.val()?(e.val(""),e.closest("p").find(".wc-pao-addon-alert").show()):(""!==e.val()&&e.val(Math.ceil(e.val())),e.closest("p").find(".wc-pao-addon-alert").hide()),!e.val())return;d=e.data("price")*e.val(),r=e.data("raw-price")*e.val(),e.data("duration"),e.val(),l=e.data("raw-duration")*e.val()}else if(e.is(".wc-pao-addon-checkbox, .wc-pao-addon-radio")){if(!e.is(":checked"))return;s=e.data("label"),d=e.data("price"),r=e.data("raw-price"),e.data("duration"),l=e.data("raw-duration")}else if(e.is(".wc-pao-addon-image-swatch-select, .wc-pao-addon-select")){if(!e.find("option:selected")||""===e.find("option:selected").val())return;c=e.find("option:selected").data("price-type"),p=e.find("option:selected").data("duration-type"),e.val()&&(s=e.find("option:selected").data("label"),d=e.find("option:selected").data("price"),r=e.find("option:selected").data("raw-price"),e.find("option:selected").data("duration"),l=e.find("option:selected").data("raw-duration"))}else{if(!e.val())return;d=e.data("price"),r=e.data("raw-price"),e.data("duration"),l=e.data("raw-duration")}switch(d=d||0,r=r||0,l=l||0,"booking"!==product_type&&"accommodation-booking"!==product_type||!woocommerce_addons_params.is_bookings||(void(a=qty=0)!==w("#wc_bookings_field_duration")&&0<w("#wc_bookings_field_duration").val()&&(a=w("#wc_bookings_field_duration").val()),void 0!==w("#wc-bookings-form-end-time")&&0<w("#wc-bookings-form-end-time").val()&&(a=w("#wc-bookings-form-end-time").val()),o=w("#wc_bookings_field_persons"),t=0,1===o.length?t=parseInt(t,10)+parseInt(o.val(),10):w(".wc-bookings-booking-form").find("input").each(function(){var a=this.id.match(/wc_bookings_field_persons_(\d+)/);null!=a&&w("#"+a[0]).length&&(t=parseInt(t,10)+parseInt(w("#"+a[0]).val(),10))}),0===qty&&w(".wc-bookings-booking-cost").length&&(qty=1),m&&t&&(qty*=t),i&&a&&(qty*=a)),c){case"flat_fee":u.cost=parseFloat(d),u.cost_raw=parseFloat(r);break;case"quantity_based":u.cost_pu=parseFloat(d),u.cost_raw_pu=parseFloat(r),u.cost=u.cost_pu*qty,u.cost_raw=u.cost_raw_pu*qty;break;case"percentage_based":u.cost_pct=parseFloat(d)/100,u.cost_raw_pct=parseFloat(r)/100,u.cost=parseFloat(product_price)*u.cost_pct*qty,u.cost_raw=parseFloat(product_price)*u.cost_raw_pct*qty}switch(f+=u.cost||0,h+=u.cost_raw||0,p){case"flat_time":case"":u.duration=l,u.duration_raw=l;break;case"quantity_based":u.duration_pu=l,u.duration_raw_pu=l,u.duration=u.duration_pu*qty,u.duration_raw=u.duration_raw_pu*qty}void 0!==s&&("number"==typeof s||s.length?u.name=n+(s?" - "+s:""):(o=e.val(),(m=parseInt(woocommerce_addons_params.trim_user_input_characters,10))<(o=e.is(".wc-pao-addon-file-upload")?o.replace(/^.*[\\\/]/,""):o).length&&(o=o.slice(0,m)+"..."),u.name=n+" - "+v.escapeHtml(o)),u.is_custom_price=_,u.price_type=c,u.duration_type=p,addons.push(u))}),o.data("price_data",addons),qty){var i,n,s,d;v.formatMoney(f);if("undefined"!=typeof product_price&&product_id&&(i=w(".wc-bookings-booking-form").length||w(".wc-appointments-appointment-cost").length?isNaN(product_price)?0:parseFloat(product_price):parseFloat(product_price*qty),n=v.formatMoney(i+f)),e?(a=_.data("satt_script"))&&a.schemes_model.get_active_scheme_key()&&((e=t.find("input:checked")).val()&&(s=e.parent().find(".subscription-details"))):_.parent().find(".subscription-details").length&&!_.hasClass("bundle_data")&&(s=_.parent().find(".subscription-details"),u&&0<u.length&&(s=_.parent().find(".woocommerce-variation .subscription-details"))),s&&0<s.length&&(d=" "+s.clone().wrap("<p>").parent().html()),"grouped"===product_type?d&&!isGroupedMixedProductType()&&isGroupedSubsSelected()&&(n&&(n+=d)):d&&n&&(n+=d),n&&"1"==o.data("show-sub-total")){var r,a=_.find(".wc-pao-addon-container").data("product-name"),t=v.formatMoney(i),c=(r=w(".wc-bookings-booking-form").length?'<div class="product-addon-totals"><ul><li><div class="wc-pao-col1"><strong>'+a+'</strong></div><div class="wc-pao-col2"><strong><span class="amount">'+t+"</span></strong></div></li>":'<div class="product-addon-totals"><ul><li><div class="wc-pao-col1"><strong><span>'+(m()?woocommerce_addons_params.quantity_symbol+qty:qty+woocommerce_addons_params.quantity_symbol)+"</span> "+a+'</strong></div><div class="wc-pao-col2"><strong><span class="amount">'+t+"</span></strong></div></li>",!1),l=(addons.length&&(w.each(addons,function(a,t){var o;"quantity_based"===t.price_type&&(o=0===(o=v.getCostByTax(t.cost_raw,t.cost))?"-":v.formatMoney(o),r=r+'<li class="wc-pao-row-quantity-based"><div class="wc-pao-col1">
1'+t.name+'</div><div class="wc-pao-col2"><span class="amount">'+o+"</span></div></li>"),woocommerce_addons_params.tax_enabled&&t.is_custom_price&&(c=!0)}),w.each(addons,function(a,t){var o;"quantity_based"!==t.price_type&&(o=0===(o="percentage_based"!==t.price_type?v.getCostByTax(t.cost_raw,t.cost):t.cost_raw)?"-":'<span class="amount">'+v.formatMoney(o)+"</span>",r=r+'<li><div class="wc-pao-col1"><strong>'+t.name+'</strong></div><div class="wc-pao-col2">'+o+"</div></li>")})),""),p=void 0===o.data("i18n_sub_total")?woocommerce_addons_params.i18n_sub_total:o.data("i18n_sub_total");if(c||woocommerce_addons_params.price_display_suffix&&woocommerce_addons_params.tax_enabled)return c||!1!=-1<woocommerce_addons_params.price_display_suffix.indexOf("{price_including_tax}")||!1!=-1<woocommerce_addons_params.price_display_suffix.indexOf("{price_excluding_tax}")?void w.ajax({type:"POST",url:woocommerce_addons_params.ajax_url,data:{action:"wc_product_addons_calculate_tax",product_id:product_id,add_on_total:f,add_on_total_raw:h,qty:qty},success:function(a){var t;r="SUCCESS"==a.result?(l='<small class="woocommerce-price-suffix">'+woocommerce_addons_params.price_display_suffix+"</small>",t=v.formatMoney(a.price_including_tax),a=v.formatMoney(a.price_excluding_tax),l=(l=l.replace("{price_including_tax}",'<span class="amount">'+t+"</span>")).replace("{price_excluding_tax}",'<span class="amount">'+a+"</span>"),t=woocommerce_addons_params.display_include_tax?t:a,r+'<li class="wc-pao-subtotal-line"><p class="price">'+p+' <span class="amount">'+t+"</span> "+l+" </p></li></ul></div>"):r+'<li class="wc-pao-subtotal-line"><p class="price">'+p+' <span class="amount">'+n+"</span></p></li></ul></div>",o.html(r),_.trigger("updated_addons")},error:function(){r=r+'<li class="wc-pao-subtotal-line"><p class="price">'+p+' <span class="amount">'+n+"</span></p></li></ul></div>",o.html(r),_.trigger("updated_addons")}}):(r=r+'<li class="wc-pao-subtotal-line"><strong>'+p+' <span class="amount">'+n+"</span> "+woocommerce_addons_params.price_display_suffix+"</strong></li></ul></div>",o.html(r),void _.trigger("updated_addons"));r=r+'<li class="wc-pao-subtotal-line"><p class="price">'+p+' <span class="amount">'+n+"</span></p></li></ul></div>",o.html(r),void _.trigger("updated_addons")}else o.empty(),_.trigger("updated_addons")}else o.empty(),_.trigger("updated_addons")}).on("click touchend",".wc-pao-addon-image-swatch",function(a){a.preventDefault();var a=w(this).data("value"),t=w(this).parents(".wc-pao-addon-wrap"),o=w.parseHTML(w(this).data("price"));t.prevAll("label").find(".wc-pao-addon-image-swatch-price").remove(),t.find(".wc-pao-addon-image-swatch").removeClass("selected"),w(this).addClass("selected"),t.find(".wc-pao-addon-image-swatch-select").val(a),t.prevAll("label").append(w(o)),_.trigger("woocommerce-product-addons-update")}),_.find(" .wc-pao-addon-custom-text, .wc-pao-addon-custom-textarea").each(function(){0<w(this).attr("maxlength")&&w(this).after('<small class="wc-pao-addon-chars-remaining">'+woocommerce_addons_params.i18n_remaining+"</small>")}),w("#credit_called").on("keyup",function(){_.trigger("woocommerce-product-addons-update")}),_.find(".wc-pao-addon-custom, .wc-pao-addon-custom-textarea, .wc-pao-addon input, .wc-pao-addon textarea, .wc-pao-addon select, input.qty, .variations select").trigger("change"),_.get(0).querySelector('button[type="submit"]')),a=(a&&a.addEventListener("click",function(){var a=_.get(0).querySelector("*:invalid");a&&(a.focus(),a.scrollIntoView({block:"center",inline:"center"}))}),w(".wc-pao-addon-image-swatch"));a.length&&a.tipTip({delay:200})}},m=function(){return"rtl"===document.documentElement.dir};w("body").on("quick-view-displayed",function(){w(this).find(".cart:not(.cart_group)").each(function(){v.init(w(this))})}),w("body .component").on("wc-composite-component-loaded",function(){w(this).find(".cart").each(function(){v.init(w(this))})}),w("body").find(".cart:not(.cart_group)").each(function(){v.init(w(this))})});

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.