rebase on oct-10-2023

This commit is contained in:
Rachit Bhargava
2023-10-10 17:23:21 -04:00
parent d37566ffb6
commit d096058d7d
4789 changed files with 254611 additions and 307223 deletions

View File

@@ -1 +1 @@
jQuery(function(u){var h={states:null,init:function(){"undefined"!=typeof wc_users_params.countries&&(this.states=JSON.parse(wc_users_params.countries.replace(/&quot;/g,'"'))),u(".js_field-country").selectWoo().on("change",this.change_country),u(".js_field-country").trigger("change",[!0]),u(document.body).on("change","select.js_field-state",this.change_state),u(document.body).on("click","button.js_copy-billing",this.copy_billing)},change_country:function(e,t){var a,n,o,i,c,s,l,r,p,d;void 0===t&&(t=!1),null!==h.states&&(n=(a=u(this)).val(),i=(o=a.parents(".form-table").find(":input.js_field-state")).parent(),c=o.attr("name"),s=o.attr("id"),l=a.data(l="woocommerce.stickState-"+n)?a.data(l):o.val(),r=o.attr("placeholder"),t&&a.data("woocommerce.stickState-"+n,l),i.show().find(".select2-container").remove(),u.isEmptyObject(h.states[n])?(d=u('<input type="text" />').prop("id",s).prop("name",c).prop("placeholder",r).addClass("js_field-state regular-text").val(l),o.replaceWith(d)):(p=h.states[n],t=u('<option value=""></option>').text(h.i18n_select_state_text),d=u('<select style="width: 25em;"></select>').prop("id",s).prop("name",c).prop("placeholder",r).addClass("js_field-state").append(t),u.each(p,function(e){e=u("<option></option>").prop("value",e).text(p[e]);d.append(e)}),d.val(l),o.replaceWith(d),d.show().selectWoo().hide().trigger("change")),u(document.body).trigger("contry-change.woocommerce",[n,u(this).closest("div")]),u(document.body).trigger("country-change.woocommerce",[n,u(this).closest("div")]))},change_state:function(){var e=u(this),t=e.val(),e=e.parents(".form-table").find(":input.js_field-country"),a=e.val();e.data("woocommerce.stickState-"+a,t)},copy_billing:function(e){e.preventDefault(),u("#fieldset-billing").find("input, select").each(function(e,t){var a=t.name.replace(/^billing_/,"shipping_"),a=u('[name="'+a+'"]');a.length&&a.val(t.value).trigger("change")})}};h.init()});
jQuery(function(e){var t={states:null,init:function(){"undefined"!=typeof wc_users_params.countries&&(this.states=JSON.parse(wc_users_params.countries.replace(/&quot;/g,'"'))),e(".js_field-country").selectWoo().on("change",this.change_country),e(".js_field-country").trigger("change",[!0]),e(document.body).on("change","select.js_field-state",this.change_state),e(document.body).on("click","button.js_copy-billing",this.copy_billing)},change_country:function(a,n){if(void 0===n&&(n=!1),null!==t.states){var o,i=e(this),c=i.val(),s=i.parents(".form-table").find(":input.js_field-state"),r=s.parent(),l=s.attr("name"),p=s.attr("id"),d="woocommerce.stickState-"+c,u=i.data(d)?i.data(d):s.val(),h=s.attr("placeholder");if(n&&i.data("woocommerce.stickState-"+c,u),r.show().find(".select2-container").remove(),e.isEmptyObject(t.states[c]))o=e('<input type="text" />').prop("id",p).prop("name",l).prop("placeholder",h).addClass("js_field-state regular-text").val(u),s.replaceWith(o);else{var g=t.states[c],f=e('<option value=""></option>').text(t.i18n_select_state_text);o=e('<select style="width: 25em;"></select>').prop("id",p).prop("name",l).prop("placeholder",h).addClass("js_field-state").append(f),e.each(g,function(t){var a=e("<option></option>").prop("value",t).text(g[t]);o.append(a)}),o.val(u),s.replaceWith(o),o.show().selectWoo().hide().trigger("change")}e(document.body).trigger("contry-change.woocommerce",[c,e(this).closest("div")]),e(document.body).trigger("country-change.woocommerce",[c,e(this).closest("div")])}},change_state:function(){var t=e(this),a=t.val(),n=t.parents(".form-table").find(":input.js_field-country"),o=n.val();n.data("woocommerce.stickState-"+o,a)},copy_billing:function(t){t.preventDefault(),e("#fieldset-billing").find("input, select").each(function(t,a){var n=a.name.replace(/^billing_/,"shipping_"),o=e('[name="'+n+'"]');o.length&&o.val(a.value).trigger("change")})}};t.init()});