(()=>{"use strict";var t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{add_payment_info:()=>k,add_shipping_info:()=>b,add_to_cart:()=>w,begin_checkout:()=>v,purchase:()=>E,remove_from_cart:()=>g,search:()=>q,select_content:()=>A,view_item:()=>S,view_item_list:()=>f});const r=window.wp.i18n,o=window.wp.hooks,n=[],c=(t,e)=>null!=t&&null!=e&&String(t)===String(e),i=(t,e)=>{const r={};var o;t.variation&&(r.item_variant=(o=t.variation,Array.isArray(o)?o.map(({attribute:t,value:e})=>t&&e?`${t.toLowerCase()}: ${e}`:null).filter(Boolean).join(", "):o));const n={item_id:u(t),item_name:t.name,...m(t),quantity:t.quantity??e,price:s(t.totals?.line_total||t.prices.price,t.prices.currency_minor_unit),...r};return t?.price_after_coupon_discount<t.prices.price&&(n.discount=s(t.prices.price-t.price_after_coupon_discount,t.prices.currency_minor_unit),n.price=s(t.price_after_coupon_discount,t.prices.currency_minor_unit)),n},a=(t,e)=>({item_id:u(t),item_name:t.name,item_list_name:e,...m(t),price:s(t.prices.price,t.prices.currency_minor_unit)}),s=(t,e=2)=>parseInt(t,10)/10**e,d=(t,e,r)=>{(0,o.removeAction)(t,e),(0,o.addAction)(t,e,r)},u=t=>{const e=t.extensions?.woocommerce_google_analytics_integration?.identifier;return void 0!==e?e:"product_sku"===window.ga4w?.settings?.identifier?t.sku?t.sku:"#"+t.id:t.id},l=t=>t.coupons[0]?.code?{coupon:t.coupons[0]?.code}:{},m=t=>"categories"in t&&t.categories.length?p(t.categories):{},p=t=>Object.fromEntries(t.slice(0,5).map((t,e)=>[_(e),t.name])),_=t=>"item_category"+(t>0?t+1:""),y=(t,e,r)=>e?.find(({id:e})=>c(e,t))??r?.items?.find(({id:e})=>c(e,t))??n.find(({id:e})=>c(e,t)),f=({products:t,listName:e=(0,r.__)("Product List","woocommerce-google-analytics-integration")})=>!!t?.length&&{item_list_id:e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/(^_+|_+$)/g,""),item_list_name:e,items:t.map((t,r)=>({...a(t,e),index:r+1}))},w=({product:t,quantity:e=1})=>({items:t?[i(t,e)]:[]}),g=({product:t,quantity:e=1})=>({items:t?[i(t,e)]:[]}),h=t=>{if(!t?.items?.length)return!1;const e=t.totals,r=t.items.reduce((t,e)=>t+parseInt(e.totals?.line_total??e.prices.price,10),0);return{currency:e.currency_code,value:s(r,e.currency_minor_unit),...l(t),items:t.items.map(i)}},v=({storeCart:t})=>h(t),b=({storeCart:t,shippingTier:e})=>{const r=h(t);return!!r&&{...r,...e?{shipping_tier:e}:{}}},k=({storeCart:t,paymentType:e})=>{const r=h(t);return!!r&&{...r,...e?{payment_type:e}:{}}},A=({product:t})=>!!t&&{content_type:"product",content_id:u(t)},q=({searchTerm:t})=>({search_term:t}),S=({product:t,listName:e=(0,r.__)("Product List","woocommerce-google-analytics-integration")})=>!!t&&{items:[a(t,e)]},E=({order:t})=>void 0!==t&&{transaction_id:t.id,affiliation:t.affiliation,currency:t.totals.currency_code,value:s(t.totals.total_price,t.totals.currency_minor_unit),tax:s(t.totals.tax_total,t.totals.currency_minor_unit),shipping:s(t.totals.shipping_total,t.totals.currency_minor_unit),items:t.items.map(i)},I='input[name="payment_method"]',C='input[name^="shipping_method"], select[name^="shipping_method"]',N=".woocommerce-cart-form .woocommerce-cart-form__cart-item, .woocommerce-cart-form .cart_item",$=t=>Array.from(document.querySelectorAll(t)).find(t=>t.checked||"SELECT"===t.tagName),L=t=>{if(!t)return;if("SELECT"===t.tagName){const e=t.options[t.selectedIndex];return e?.text?.trim()||t.value}const e=t.labels?.[0]||t.closest("label");return e?.textContent?.trim()||t.value},O=t=>{if(!t)return;const e=t.labels?.[0]||t.closest("label");if(e){const t=e.cloneNode(!0);t.querySelectorAll(".woocommerce-Price-amount").forEach(t=>t.remove());const r=t.textContent.replace(/[\s:]+$/,"").trim();if(r)return r}return L(t)};function j(t,{events:e,cart:r,products:o,product:n,added_to_cart:c,order:i,list_name:a}){let s=!1,d=!1,u=r;const l=new WeakSet,m=e=>{s=!0,t("add_shipping_info")({storeCart:r,shippingTier:e})},p=e=>{d=!0,t("add_payment_info")({storeCart:r,paymentType:e})};function _(e,i,a,s){const d=s?.[0]??s,u=parseInt(d?.dataset.product_id||d?.value);if(Number.isNaN(u)){const e=c??n;return e?void(Array.isArray(e)?e:[e]).filter(Boolean).forEach(e=>{t("add_to_cart")({product:e})}):void console.error("Google Analytics for WooCommerce: Could not read product ID from the button given in `added_to_cart` event. Check whether WooCommerce Core events or elements are malformed by other extensions.")}const l=n?.id===u?n:y(u,o,r);l&&t("add_to_cart")({product:l})}Object.values(e??{}).forEach(e=>{"add_to_cart"===e?(Array.isArray(c)?c:[c]).filter(Boolean).forEach(r=>{t(e)({product:r})}):t(e)({storeCart:r,products:o,product:n,order:i,listName:a})}),document.body.addEventListener("change",t=>{r?.items?.length&&t.target.closest?.("form.checkout")&&(t.target.matches(C)&&m(O(t.target)),t.target.matches(I)&&p(L(t.target)))}),document.querySelector("form.checkout")?.addEventListener("submit",()=>{if(r?.items?.length){if(!s){const t=$(C);t&&m(O(t))}d||p(L($(I)))}}),document.body.addEventListener("added_to_cart",t=>{_(t,...Array.isArray(t.detail)?t.detail:[t.detail?.fragments,t.detail?.cartHash,t.detail?.button])}),window.jQuery?.(document.body)?.on("added_to_cart",_);const f=()=>{document.querySelectorAll(".woocommerce-cart-form .woocommerce-cart-form__cart-item .remove[data-product_id]").forEach(t=>t.addEventListener("click",w))};function w(e){const r=parseInt(e.target?.dataset.product_id);Number.isNaN(r)?console.error("Google Analytics for WooCommerce: Could not read product ID from the target element given to remove from cart event. Check whether WooCommerce Core events or elements are malformed by other extensions."):t("remove_from_cart")({product:y(r,o,u)})}function g(t){const e=parseInt(t?.quantity,10),r=parseInt(t?.prices?.price,10);return!Number.isFinite(e)||e<1||!Number.isFinite(r)?null:r/e}function h(t,e){const r=g(t);return null===r?{...t,quantity:e}:{...t,quantity:e,prices:{...t.prices,price:Math.round(r)}}}function v(t,e){const r=function(t){const e=t.querySelector("input.qty")?.name;return e?.match(/^cart\[([^\]]+)\]\[qty]$/)?.[1]}(t),n=u?.items??[];if(r){const t=n.find(({key:t})=>t===r);if(t)return t}if(!Number.isNaN(e))return n.filter(({id:t})=>String(t)===String(e)).length>1?void 0:y(e,n,{items:o})}function b(){u?.items?.length&&document.querySelectorAll(N).forEach(e=>{const r=parseInt(e.querySelector("input.qty")?.value,10);if(!Number.isFinite(r))return;const o=parseInt(e.querySelector(".remove[data-product_id]")?.dataset.product_id,10),n=v(e,o),c=parseInt(n?.quantity,10);if(!n||!Number.isFinite(c)||r===c)return;const i=r>c?"add_to_cart":"remove_from_cart",a=Math.abs(r-c);t(i)({product:h(n,a)})})}function k(){const t=document.querySelector(".woocommerce-cart-form");t&&!l.has(t)&&(l.add(t),t.addEventListener("submit",b))}f(),k();const A=document.body.onupdated_wc_div;document.body.onupdated_wc_div=function(){"function"==typeof A&&A.apply(this,arguments),function(){if(!u?.items?.length)return;if(!document.querySelector(".woocommerce-cart-form"))return;const t=[];document.querySelectorAll(N).forEach(e=>{const r=parseInt(e.querySelector("input.qty")?.value,10),o=parseInt(e.querySelector(".remove[data-product_id]")?.dataset.product_id,10),n=v(e,o);n&&Number.isFinite(r)&&t.push(function(t,e){const r=g(t);return null===r?{...t,quantity:e}:{...t,quantity:e,prices:{...t.prices,price:Math.round(r*e)}}}(n,r))}),u={...u,items:t}}(),f(),k()};const q=document.body.onremoved_from_cart;document.body.onremoved_from_cart=function(t,e,r,o){"function"==typeof q&&q.apply(this,arguments),w({target:o?.[0]})},document.querySelectorAll(".products .product:not(.wp-block-post)")?.forEach(e=>{const n=e.querySelector("a[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",e=>{const c=e.target.closest(".woocommerce-loop-product__link"),i=e.target.classList.contains("button")&&e.target.hasAttribute("data-product_id"),a=e.target.classList.contains("add_to_cart_button")&&!e.target.classList.contains("product_type_variable");(c||i&&!a)&&t("select_content")({product:y(parseInt(n),o,r)})})}),document.querySelectorAll(".products-block-post-template .product, .wc-block-product-template .product, .wc-block-grid__product")?.forEach(e=>{const n=e.querySelector("[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",c=>{const i=c.target,a=i.closest(".wc-block-components-product-image a, .wc-block-grid__product-link"),s=i.closest(".wp-block-post-title a"),d=i.closest(".wc-block-components-product-button [data-product_id]");d&&d.classList.contains("add_to_cart_button")&&!d.classList.contains("product_type_variable")?t("add_to_cart")({product:y(parseInt(n),o,r)}):!e.closest(".wc-block-product-template")&&(a||d||s)&&t("select_content")({product:y(parseInt(n),o,r)})})})}const P="woocommerce-google-analytics",T="experimental__woocommerce_blocks",x=new Set;let F=!1,M=!1;const B=new Set;let G=!1,W=null;const D=new Map,R=t=>{Array.isArray(t?.items)&&t.items.forEach(t=>{null!=t?.key&&D.set(t.key,t)})},U=(t,e)=>{console.warn(`Google Analytics for WooCommerce: ${t}`,e)},z=(t,e,r)=>{try{t(e)(r)}catch(t){U(`could not track the ${e} event.`,t)}},J=t=>{const e=[];return null!=t?.key&&e.push(`key:${t.key}`),(t?.id||t?.name)&&e.push(`id:${t?.id??""}|${t?.name??""}`),e},H=t=>{J(t).forEach(t=>{B.add(t),setTimeout(()=>B.delete(t),200)})},Q=t=>J(t).some(t=>B.has(t));let K=null;const V=()=>window.ga4w?.settings?.currency,X=()=>{try{if(window.wp?.data?.select?.("wc/store/cart")){const t=window.wp.data.select("wc/store/cart").getCartData();if(t?.items?.length>0)return t}return window.ga4w?.data?.cart??null}catch(t){return U("could not read cart data.",t),null}},Y=t=>t?.key??t?.id??t?.name,Z=t=>t?.items?.length>0?t:window.ga4w?.data?.cart,tt=t=>t?.shippingRates??t?.shipping_rates??[],et=t=>window.wc?.wcSettings?.getSetting?.("paymentMethodData")?.[t]?.title||t,rt=t=>{const e=tt(window.wp?.data?.select?.("wc/store/cart")?.getCartData?.());return(e.length?e:tt(t)).flatMap(t=>t.shipping_rates??[])},ot=(t,e)=>rt(t).find(t=>t.rate_id===e)?.name,nt=(t,e,r={})=>{try{const o=Z(r.storeCart);return!!o?.items?.length&&(z(e,t,{...r,storeCart:o}),!0)}catch(e){return U(`could not prepare the ${t} event.`,e),!1}},ct=/\/wc\/store(?:\/v\d+)?\/cart\/add-item/,it=/\/wc\/store(?:\/v\d+)?\/cart\/update-item/,at=/\/wc\/store(?:\/v\d+)?\/batch/,st=(t,e={})=>{let r;try{r=new URL(t?.url??t?.toString?.(),window.location.origin)}catch{return null}return r.origin!==window.location.origin?null:{method:(e?.method??t?.method??"GET").toUpperCase(),pathname:r.searchParams.get("rest_route")??r.pathname}},dt=t=>{if(t instanceof FormData||t instanceof URLSearchParams)return Object.fromEntries(t.entries());if("string"==typeof t)try{return JSON.parse(t)}catch{return Object.fromEntries(new URLSearchParams(t).entries())}return t&&"object"==typeof t?t:{}},ut=(t,e=null)=>{const r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:e},lt=t=>t?.key??t?.id,mt=(t,e)=>{const r=parseInt(t?.quantity,10),o=parseInt(t?.totals?.line_total,10);return Number.isFinite(o)&&Number.isFinite(r)&&Number.isFinite(e)&&r?{...t,totals:{...t.totals,line_total:String(Math.round(o*e/r))}}:t},pt=(t,e,r)=>{const{productId:o,quantity:n}=(t=>{const e=dt(t);return{productId:ut(e.id),quantity:ut(e.quantity,1)}})(t),c=((t,e,r)=>{if(Array.isArray(t?.items)&&t.items.length){if(Array.isArray(e?.items)){const r=t.items.find(t=>{const r=e.items.find(e=>lt(e)===lt(t));return!r||t.quantity>r.quantity});if(r)return r}return r?t.items.find(t=>parseInt(t.id,10)===r):void 0}})(e,r,o),i=c?((t,e,r)=>{const o=parseInt(t?.quantity,10);if(Array.isArray(e?.items)&&Number.isFinite(o)){const r=e.items.find(e=>lt(e)===lt(t)),n=parseInt(r?.quantity??0,10);if(Number.isFinite(n)){const t=o-n;if(t>0)return t}}return Number.isFinite(o)?Math.min(r,o):r})(c,r,n):n;return c?{eventName:"add_to_cart",product:mt(c,i),quantity:i,isAddItem:!0}:null},_t=(t,e,r)=>{const o=(n=t,dt(n)?.key??null);var n;if(!o)return null;const c=Array.isArray(e?.items)?e.items.find(t=>t.key===o):null,i=Array.isArray(r?.items)?r.items.find(t=>t.key===o):null,a=D.get(o);let s=0;a?s=a.quantity??0:i&&(s=i.quantity??0);const d=parseInt(c?.quantity??0,10)-parseInt(s,10);if(!Number.isFinite(d)||0===d)return null;const u=d>0?c:i??a;if(!u)return null;const l=Math.abs(d);return{eventName:d>0?"add_to_cart":"remove_from_cart",product:mt(u,l),quantity:l}},yt=t=>{if(W=(e,r)=>z(t,e,r),G||"function"!=typeof window.fetch)return;G=!0;const e=window.fetch;window.fetch=async function(...t){const[r,o]=t,n=((t,e={})=>{const r=st(t,e);return!!r&&"POST"===r.method&&ct.test(r.pathname)})(r,o),c=!n&&((t,e={})=>{const r=st(t,e);return!!r&&"POST"===r.method&&it.test(r.pathname)})(r,o),i=!n&&!c&&((t,e={})=>{const r=st(t,e);return!!r&&"POST"===r.method&&at.test(r.pathname)})(r,o),a=n||c||i,s=a?X():null,d=a?(async(t,e={})=>e?.body?e.body:"function"==typeof t?.clone?await t.clone().text():null)(r,o):null,u=await e.apply(this,t);if(!a||!u?.ok)return u;try{const t=await d,e=await u.clone().json();let r;i?r=((t,e,r)=>{const o=(t=>{if("string"==typeof t)try{return JSON.parse(t)}catch{return null}return t&&"object"==typeof t?t:null})(t)?.requests,n=e?.responses;if(!Array.isArray(o)||!Array.isArray(n))return[];const c=[];let i=r;return o.forEach((t,e)=>{const r=t?.path??"",o=ct.test(r),a=it.test(r);if(!o&&!a)return;const s=n[e],d=s?.status;if(!s||d<200||d>=300)return;const u=s.body,l=o?pt(t.body,u,i):_t(t.body,u,i);l&&c.push(l),R(u),i=u}),c})(t,e,s):c?(r=[_t(t,e,s)].filter(Boolean),R(e)):(r=[pt(t,e,s)].filter(Boolean),R(e));const o=i?25:0;r.forEach(({eventName:t,product:e,quantity:r,isAddItem:n})=>{"remove_from_cart"!==t&&n?setTimeout(()=>{Q(e)||(H(e),W(t,{product:{...e,quantity:r}}))},o):W(t,{product:{...e,quantity:r}})})}catch(t){return U("could not parse the Store API cart response for cart change tracking.",t),u}return u}},ft=t=>{d(`${T}-product-render`,P,e=>z(t,"view_item",e)),d(`${T}-cart-remove-item`,P,e=>{try{const r=Y(e?.product);r&&(x.add(r),setTimeout(()=>x.delete(r),200)),z(t,"remove_from_cart",e)}catch(t){U("could not process Blocks remove_from_cart tracking.",t)}}),(t=>{document.body.addEventListener("click",e=>{try{const r=e.target?.closest?.(".wc-block-cart-item__remove-link");if(!r)return;const o=r.closest(".wc-block-cart-items__row");if(!o)return;let n=null;const c=o.querySelector(".wc-block-components-product-name"),i=c?.getAttribute("href"),a=c?.textContent?.trim();let s=null;if(i){const t=i.match(/[?&]p=(\d+)/);t&&(s=parseInt(t[1],10))}const d=X();if(Array.isArray(d?.items)&&(s?n=y(s,[],d):a&&(n=d.items.find(t=>t.name===a))),n||(n=(t=>{const e=t.querySelector(".wc-block-components-product-name"),r=e?.textContent?.trim();if(!r)return null;const o=t.querySelector(".wc-block-components-quantity-selector__input"),n=o&&parseInt(o.value,10)||1,c=t.querySelector(".wc-block-components-product-price__value ins .woocommerce-Price-amount")||t.querySelector(".wc-block-components-product-price__value .woocommerce-Price-amount")||t.querySelector(".wc-block-components-product-price__value"),i=X(),a=V(),s=i?.totals?.currency_minor_unit??a?.precision??2,d=c?(t=>{if(!t)return 0;const e=V();if(!e)return 0;const{decimalSeparator:r=".",thousandSeparator:o=","}=e;if("function"==typeof window.accounting?.unformat)return window.accounting.unformat(t,r);let n=t.replace(/[^\d.,]/g,"").trim();if(o){const t=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(t,"g"),"")}return"."!==r&&(n=n.replace(r,".")),parseFloat(n)||0})(c.textContent):0;return{name:r,quantity:n,prices:{price:Math.round(d*10**s),currency_minor_unit:s}}})(o)),n){const e=Y(n);setTimeout(()=>{e&&x.has(e)||z(t,"remove_from_cart",{product:n})},0)}}catch(t){U("could not read mini-cart remove_from_cart data.",t)}})})(t),d(`${T}-checkout-render-checkout-form`,P,e=>{F=!1,M=!1,nt("begin_checkout",t,e)}),d(`${T}-checkout-set-selected-shipping-rate`,P,e=>{try{const r=Z(e.storeCart),o=e.shippingRateId;F=nt("add_shipping_info",t,{...e,shippingTier:ot(r,o)??o})}catch(t){F=!1,U("could not prepare the add_shipping_info event.",t)}}),d(`${T}-checkout-set-active-payment-method`,P,e=>{try{M=nt("add_payment_info",t,{...e,paymentType:et(e.paymentMethodSlug)})}catch(t){M=!1,U("could not prepare the add_payment_info event.",t)}}),d(`${T}-checkout-submit`,P,e=>{try{const r=(t=>{const e=rt(t).find(t=>t.selected);return e?.name??e?.rate_id})(e.storeCart);if(!F&&r&&(F=nt("add_shipping_info",t,{...e,shippingTier:r})),M)return;M=nt("add_payment_info",t,{...e,paymentType:et(window.wp?.data?.select?.("wc/store/payment")?.getActivePaymentMethod?.())})}catch(t){U("could not prepare checkout submit tracking.",t)}}),d(`${T}-cart-add-item`,P,e=>{try{const r=e?.product;if(Q(r))return;H(r),z(t,"add_to_cart",{product:r})}catch(t){U("could not process Blocks add_to_cart tracking.",t)}}),yt(t),d(`${T}-product-list-render`,P,e=>{var r;e?.products&&(r=e.products,Array.isArray(r)&&r.forEach(t=>{null==t?.id||n.some(({id:e})=>c(e,t.id))||n.push(t)})),z(t,"view_item_list",e)}),d(`${T}-product-view-link`,P,e=>z(t,"select_content",e)),K&&document.body.removeEventListener("wc-blocks_viewed_product",K),K=e=>{const{productId:r}=e.detail??{},o=String(r??"");if(/^[1-9]\d*$/.test(o)){const e=parseInt(o,10).toString(),r=y(e,[],null)??{id:e};z(t,"select_content",{product:r})}},document.body.addEventListener("wc-blocks_viewed_product",K)};(0,o.removeAction)(`${T}-checkout-submit`,P),(0,o.removeAction)(`${T}-checkout-set-email-address`,P),(0,o.removeAction)(`${T}-checkout-set-phone-number`,P),(0,o.removeAction)(`${T}-checkout-set-billing-address`,P),(0,o.removeAction)(`${T}-cart-set-item-quantity`,P),(0,o.removeAction)(`${T}-product-search`,P),(0,o.removeAction)(`${T}-store-notice-create`,P);const wt={statistics:["analytics_storage"],marketing:["ad_storage","ad_user_data","ad_personalization"]},gt={formatters:e,utils:{getProductFieldObject:i,getProductImpressionObject:a,formatPrice:s,getProductId:u,getCartCoupon:l}};function ht(){window.wcGoogleAnalyticsIntegration={...window.wcGoogleAnalyticsIntegration??{},...gt},Object.assign(window.ga4w,gt),(({tracker_function_name:t})=>{if("function"==typeof wp_has_consent){void 0===window.wp_consent_type&&(window.wp_consent_type="optin");const e={};for(const[t,r]of Object.entries(wt))if(""!==consent_api_get_cookie(window.consent_api.cookie_prefix+"_"+t)){const o=wp_has_consent(t)?"granted":"denied";r.forEach(t=>{e[t]=o})}Object.keys(e).length>0&&window[t]("consent","update",e)}})(window.ga4w.settings),(({tracker_function_name:t})=>{document.addEventListener("wp_listen_for_consent_change",e=>{const r={},o=wt[Object.keys(e.detail)[0]],n="allow"===Object.values(e.detail)[0]?"granted":"denied";void 0!==o&&(o.forEach(t=>{r[t]=n}),Object.keys(r).length>0&&window[t]("consent","update",r))})})(window.ga4w.settings);const t=function({events:t,tracker_function_name:r}){return function(o){const n=e[o];if("function"!=typeof n)throw new Error(`Event ${o} is not supported.`);return function(e){const c=n(e);t.includes(o)&&c&&window[r]("event",o,c)}}}(window.ga4w.settings);j(t,window.ga4w.data),ft(t)}function vt(){window.ga4w||console.warn("Google Analytics for WooCommerce: Configuration and tracking data not found after the page was fully loaded. Make sure the `woocommerce-google-analytics-integration-data` script gets eventually loaded.")}window.ga4w?ht():(document.addEventListener("ga4w:ready",ht),"complete"===document.readyState?vt():window.addEventListener("load",vt))})();
(()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){if(this.formData={},this.tree={},!(t instanceof FormData))return this;this.formData=t;const e=()=>{const t=new Map;return t.largestIndex=0,t.set=function(e,i){""===e?e=t.largestIndex++:/^[0-9]+$/.test(e)&&(e=parseInt(e),t.largestIndex<=e&&(t.largestIndex=e+1)),Map.prototype.set.call(t,e,i)},t};this.tree=e();const i=/^(?<name>[a-z][-a-z0-9_:]*)(?<array>(?:\[(?:[a-z][-a-z0-9_:]*|[0-9]*)\])*)/i;for(const[t,s]of this.formData){const o=t.match(i);if(o)if(""===o.groups.array)this.tree.set(o.groups.name,s);else{const t=[...o.groups.array.matchAll(/\[([a-z][-a-z0-9_:]*|[0-9]*)\]/gi)].map((([t,e])=>e));t.unshift(o.groups.name);const i=t.pop();t.reduce(((t,i)=>{if(/^[0-9]+$/.test(i)&&(i=parseInt(i)),t.get(i)instanceof Map)return t.get(i);const s=e();return t.set(i,s),s}),this.tree).set(i,s)}}}t.r(e),t.d(e,{all:()=>D,any:()=>M,date:()=>m,dayofweek:()=>u,email:()=>r,enum:()=>h,file:()=>d,maxdate:()=>z,maxfilesize:()=>j,maxitems:()=>v,maxlength:()=>x,maxnumber:()=>y,mindate:()=>A,minfilesize:()=>$,minitems:()=>w,minlength:()=>g,minnumber:()=>b,number:()=>c,required:()=>n,requiredfile:()=>a,stepnumber:()=>I,tel:()=>l,time:()=>f,url:()=>p}),i.prototype.entries=function(){return this.tree.entries()},i.prototype.get=function(t){return this.tree.get(t)},i.prototype.getAll=function(t){if(!this.has(t))return[];const e=t=>{const i=[];if(t instanceof Map)for(const[s,o]of t)i.push(...e(o));else""!==t&&i.push(t);return i};return e(this.get(t))},i.prototype.has=function(t){return this.tree.has(t)},i.prototype.keys=function(){return this.tree.keys()},i.prototype.values=function(){return this.tree.values()};const s=i;function o({rule:t,field:e,error:i,...s}){this.rule=t,this.field=e,this.error=i,this.properties=s}const n=function(t){if(0===t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).length)throw new o(this)},a=function(t){if(0===t.getAll(this.field).length)throw new o(this)},r=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{if(t.length<6)return!1;if(-1===t.indexOf("@",1))return!1;if(t.indexOf("@")!==t.lastIndexOf("@"))return!1;const[e,i]=t.split("@",2);if(!/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/.test(e))return!1;if(/\.{2,}/.test(i))return!1;if(/(?:^[ \t\n\r\0\x0B.]|[ \t\n\r\0\x0B.]$)/.test(i))return!1;const s=i.split(".");if(s.length<2)return!1;for(const t of s){if(/(?:^[ \t\n\r\0\x0B-]|[ \t\n\r\0\x0B-]$)/.test(t))return!1;if(!/^[a-z0-9-]+$/i.test(t))return!1}return!0})))throw new o(this)},p=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));if(!e.every((t=>{try{return(t=>-1!==["http","https","ftp","ftps","mailto","news","irc","irc6","ircs","gopher","nntp","feed","telnet","mms","rtsp","sms","svn","tel","fax","xmpp","webcal","urn"].indexOf(t))(new URL(t).protocol.replace(/:$/,""))}catch{return!1}})))throw new o(this)},l=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>(((t=(t=t.replace(/[#*].*$/,"")).replaceAll(/[()/.*#\s-]+/g,"")).startsWith("+")||t.startsWith("00"))&&(t=`+${t.replace(/^[+0]+/,"")}`),!!/^[+]?[0-9]+$/.test(t)&&5<t.length&&t.length<16))))throw new o(this)},c=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!!/^[-]?[0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)||!!/^[-]?(?:[0-9]+)?[.][0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t))))throw new o(this)},m=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{if(!/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t))return!1;const e=new Date(t);return!Number.isNaN(e.valueOf())})))throw new o(this)},f=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{const e=t.match(/^([0-9]{2})\:([0-9]{2})(?:\:([0-9]{2}))?$/);if(!e)return!1;const i=parseInt(e[1]),s=parseInt(e[2]),o=e[3]?parseInt(e[3]):0;return 0<=i&&i<=23&&0<=s&&s<=59&&0<=o&&o<=59})))throw new o(this)},d=function(t){if(!t.getAll(this.field).every((t=>t instanceof File&&this.accept?.some((e=>/^\.[a-z0-9]+$/i.test(e)?t.name.toLowerCase().endsWith(e.toLowerCase()):(t=>{const e=[],i=t.match(/^(?<toplevel>[a-z]+)\/(?<sub>[*]|[a-z0-9.+-]+)$/i);if(i){const t=i.groups.toplevel.toLowerCase(),s=i.groups.sub.toLowerCase();for(const[o,n]of(()=>{const t=new Map;return t.set("jpg|jpeg|jpe","image/jpeg"),t.set("gif","image/gif"),t.set("png","image/png"),t.set("bmp","image/bmp"),t.set("tiff|tif","image/tiff"),t.set("webp","image/webp"),t.set("ico","image/x-icon"),t.set("heic","image/heic"),t.set("asf|asx","video/x-ms-asf"),t.set("wmv","video/x-ms-wmv"),t.set("wmx","video/x-ms-wmx"),t.set("wm","video/x-ms-wm"),t.set("avi","video/avi"),t.set("divx","video/divx"),t.set("flv","video/x-flv"),t.set("mov|qt","video/quicktime"),t.set("mpeg|mpg|mpe","video/mpeg"),t.set("mp4|m4v","video/mp4"),t.set("ogv","video/ogg"),t.set("webm","video/webm"),t.set("mkv","video/x-matroska"),t.set("3gp|3gpp","video/3gpp"),t.set("3g2|3gp2","video/3gpp2"),t.set("txt|asc|c|cc|h|srt","text/plain"),t.set("csv","text/csv"),t.set("tsv","text/tab-separated-values"),t.set("ics","text/calendar"),t.set("rtx","text/richtext"),t.set("css","text/css"),t.set("htm|html","text/html"),t.set("vtt","text/vtt"),t.set("dfxp","application/ttaf+xml"),t.set("mp3|m4a|m4b","audio/mpeg"),t.set("aac","audio/aac"),t.set("ra|ram","audio/x-realaudio"),t.set("wav","audio/wav"),t.set("ogg|oga","audio/ogg"),t.set("flac","audio/flac"),t.set("mid|midi","audio/midi"),t.set("wma","audio/x-ms-wma"),t.set("wax","audio/x-ms-wax"),t.set("mka","audio/x-matroska"),t.set("rtf","application/rtf"),t.set("js","application/javascript"),t.set("pdf","application/pdf"),t.set("swf","application/x-shockwave-flash"),t.set("class","application/java"),t.set("tar","application/x-tar"),t.set("zip","application/zip"),t.set("gz|gzip","application/x-gzip"),t.set("rar","application/rar"),t.set("7z","application/x-7z-compressed"),t.set("exe","application/x-msdownload"),t.set("psd","application/octet-stream"),t.set("xcf","application/octet-stream"),t.set("doc","application/msword"),t.set("pot|pps|ppt","application/vnd.ms-powerpoint"),t.set("wri","application/vnd.ms-write"),t.set("xla|xls|xlt|xlw","application/vnd.ms-excel"),t.set("mdb","application/vnd.ms-access"),t.set("mpp","application/vnd.ms-project"),t.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),t.set("docm","application/vnd.ms-word.document.macroEnabled.12"),t.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),t.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),t.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),t.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),t.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),t.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),t.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),t.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),t.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),t.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),t.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),t.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),t.set("potm","application/vnd.ms-powerpoint.template.macroEnabled.12"),t.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),t.set("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"),t.set("sldm","application/vnd.ms-powerpoint.slide.macroEnabled.12"),t.set("onetoc|onetoc2|onetmp|onepkg","application/onenote"),t.set("oxps","application/oxps"),t.set("xps","application/vnd.ms-xpsdocument"),t.set("odt","application/vnd.oasis.opendocument.text"),t.set("odp","application/vnd.oasis.opendocument.presentation"),t.set("ods","application/vnd.oasis.opendocument.spreadsheet"),t.set("odg","application/vnd.oasis.opendocument.graphics"),t.set("odc","application/vnd.oasis.opendocument.chart"),t.set("odb","application/vnd.oasis.opendocument.database"),t.set("odf","application/vnd.oasis.opendocument.formula"),t.set("wp|wpd","application/wordperfect"),t.set("key","application/vnd.apple.keynote"),t.set("numbers","application/vnd.apple.numbers"),t.set("pages","application/vnd.apple.pages"),t})())("*"===s&&n.startsWith(t+"/")||n===i[0])&&e.push(...o.split("|"))}return e})(e).some((e=>(e="."+e.trim(),t.name.toLowerCase().endsWith(e.toLowerCase())))))))))throw new o(this)},h=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>this.accept?.some((e=>t===String(e))))))throw new o(this)},u=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>{const e=0===(i=new Date(t).getDay())?7:i;var i;return this.accept?.some((t=>e===parseInt(t)))})))throw new o(this)},w=function(t){if(t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).length<parseInt(this.threshold))throw new o(this)},v=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));if(parseInt(this.threshold)<e.length)throw new o(this)},g=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),0!==i&&i<parseInt(this.threshold))throw new o(this)},x=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t));let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),parseInt(this.threshold)<i)throw new o(this)},b=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(parseFloat(t)<parseFloat(this.threshold)))))throw new o(this)},y=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(parseFloat(this.threshold)<parseFloat(t)))))throw new o(this)},A=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&t<this.threshold))))throw new o(this)},z=function(t){if(!t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)).every((t=>!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&this.threshold<t))))throw new o(this)},$=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),i<parseInt(this.threshold))throw new o(this)},j=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{t instanceof File&&(i+=t.size)})),parseInt(this.threshold)<i)throw new o(this)},I=function(t){const e=t.getAll(this.field).map((t=>t.trim())).filter((t=>""!==t)),i=parseFloat(this.base),s=parseFloat(this.interval);if(!(0<s))return!0;if(!e.every((t=>{const e=(parseFloat(t)-i)%s;return"0.000000"===Math.abs(e).toFixed(6)||"0.000000"===Math.abs(e-s).toFixed(6)})))throw new o(this)},O=({ruleObj:t,options:i})=>{const{rule:s,...o}=t;return"function"==typeof e[s]&&("function"!=typeof e[s].matches||e[s].matches(o,i))},E=({ruleObj:t,formDataTree:i,options:s})=>{const{rule:o}=t;e[o].call(t,i,s)},k=[],F=t=>[...k].reduce(((t,e)=>i=>e(i,t)),t),D=function(t,e={}){const i=(this.rules??[]).filter((t=>O({ruleObj:t,options:e}))),s=F(E);if(!i.every((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;if(void 0!==t.error)throw t;return!1}return!0})))throw new o(this)},M=function(t,e={}){const i=(this.rules??[]).filter((t=>O({ruleObj:t,options:e}))),s=F(E);if(!i.some((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;return!1}return!0})))throw new o(this)};var L;window.swv={validators:e,validate:(t,e,i={})=>{const n=(t.rules??[]).filter((t=>O({ruleObj:t,options:i})));if(!n.length)return new Map;const a=F(E),r=new s(e),p=n.reduce(((t,e)=>{try{a({ruleObj:e,formDataTree:r,options:i})}catch(e){if(!(e instanceof o))throw e;if(void 0!==e.field&&!t.has(e.field)&&void 0!==e.error)return t.set(e.field,e)}return t}),new Map);for(const t of r.keys())p.has(t)||p.set(t,{validInputs:r.getAll(t)});return p},use:t=>{k.push(t)},...null!==(L=window.swv)&&void 0!==L?L:{}}})();
(()=>{"use strict";const e=window.wp.i18n,t=e=>Math.abs(parseInt(e,10)),a=(e,t,a)=>{const n=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:a});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(n)},n=(e,t)=>{const n=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["validating","validating"],["payment_required","payment-required"]]);n.has(t)&&(t=n.get(t)),Array.from(n.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const r=e.getAttribute("data-status");if(e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t){e.classList.remove(r);const t={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,prevStatus:r};a(e,"statuschanged",t)}return t},r=e=>{const{root:t,namespace:a="contact-form-7/v1"}=wpcf7.api;return c.reduceRight(((e,t)=>a=>t(a,e)),(e=>{let n,r,{url:c,path:o,endpoint:s,headers:i,body:l,data:p,...d}=e;"string"==typeof s&&(n=a.replace(/^\/|\/$/g,""),r=s.replace(/^\//,""),o=r?n+"/"+r:n),"string"==typeof o&&(-1!==t.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),c=t+o),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],p&&(l=JSON.stringify(p),i["Content-Type"]="application/json");const f={code:"fetch_error",message:"You are probably offline."},u={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(c||o||window.location.href,{...d,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw u}));throw u}))),(()=>{throw f}))}))(e)},c=[];function o(e,t={}){const{target:a,scope:r=e,...c}=t;if(void 0===e.wpcf7?.schema)return;const o={...e.wpcf7.schema};if(void 0!==a){if(!e.contains(a))return;if(!a.closest(".wpcf7-form-control-wrap[data-name]"))return;if(a.closest(".novalidate"))return}const p=r.querySelectorAll(".wpcf7-form-control-wrap"),d=Array.from(p).reduce(((e,t)=>(t.closest(".novalidate")||t.querySelectorAll(":where(input, textarea, select):enabled").forEach((t=>{if(t.name)switch(t.type){case"button":case"image":case"reset":case"submit":break;case"checkbox":case"radio":t.checked&&e.append(t.name,t.value);break;case"select-multiple":for(const a of t.selectedOptions)e.append(t.name,a.value);break;case"file":for(const a of t.files)e.append(t.name,a);break;default:e.append(t.name,t.value)}})),e)),new FormData),f=e.getAttribute("data-status");Promise.resolve(n(e,"validating")).then((n=>{if(void 0!==swv){const n=swv.validate(o,d,t);for(const t of p){if(void 0===t.dataset.name)continue;const c=t.dataset.name;if(n.has(c)){const{error:t,validInputs:a}=n.get(c);i(e,c),void 0!==t&&s(e,c,t,{scope:r}),l(e,c,null!=a?a:[])}if(t.contains(a))break}}})).finally((()=>{n(e,f)}))}r.use=e=>{c.unshift(e)};const s=(e,t,a,n)=>{const{scope:r=e,...c}=null!=n?n:{},o=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,""),s=e.querySelector(`.wpcf7-form-control-wrap[data-name="${t}"] .wpcf7-form-control`);(()=>{const t=document.createElement("li");t.setAttribute("id",o),s&&s.id?t.insertAdjacentHTML("beforeend",`<a href="#${s.id}">${a}</a>`):t.insertAdjacentText("beforeend",a),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(t)})(),r.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{const t=document.createElement("span");t.classList.add("wpcf7-not-valid-tip"),t.setAttribute("aria-hidden","true"),t.insertAdjacentText("beforeend",a),e.appendChild(t),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.classList.add("wpcf7-not-valid"),e.setAttribute("aria-describedby",o),"function"==typeof e.setCustomValidity&&e.setCustomValidity(a),e.closest(".use-floating-validation-tip")&&(e.addEventListener("focus",(e=>{t.setAttribute("style","display: none")})),t.addEventListener("click",(e=>{t.setAttribute("style","display: none")})))}))}))},i=(e,t)=>{const a=`${e.wpcf7?.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,"");e.wpcf7.parent.querySelector(`.screen-reader-response ul li#${a}`)?.remove(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{e.querySelector(".wpcf7-not-valid-tip")?.remove(),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid"),"function"==typeof e.setCustomValidity&&e.setCustomValidity("")}))}))},l=(e,t,a)=>{e.querySelectorAll(`[data-reflection-of="${t}"]`).forEach((e=>{if("output"===e.tagName.toLowerCase()){const t=e;0===a.length&&a.push(t.dataset.default),a.slice(0,1).forEach((e=>{e instanceof File&&(e=e.name),t.textContent=e}))}else e.querySelectorAll("output").forEach((e=>{e.hasAttribute("data-default")?0===a.length?e.removeAttribute("hidden"):e.setAttribute("hidden","hidden"):e.remove()})),a.forEach((a=>{a instanceof File&&(a=a.name);const n=document.createElement("output");n.setAttribute("name",t),n.textContent=a,e.appendChild(n)}))}))};function p(e,t={}){if(wpcf7.blocked)return d(e),void n(e,"submitting");const c=new FormData(e);t.submitter&&t.submitter.name&&c.append(t.submitter.name,t.submitter.value);const o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(c,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:c};r({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:c,wpcf7:{endpoint:"feedback",form:e,detail:o}}).then((t=>{const r=n(e,t.status);return o.status=t.status,o.apiResponse=t,["invalid","unaccepted","spam","aborted"].includes(r)?a(e,r,o):["sent","failed"].includes(r)&&a(e,`mail${r}`,o),a(e,"submit",o),t})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&t.invalid_fields.forEach((t=>{s(e,t.field,t.message)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:t,detail:r}=e.wpcf7;d(t),a(t,"beforesubmit",r),n(t,"submitting")}return t(e)}));const d=e=>{e.querySelectorAll(".wpcf7-form-control-wrap").forEach((t=>{t.dataset.name&&i(e,t.dataset.name)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function f(e){const t=new FormData(e),c={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(t,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:t};r({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:c}}).then((t=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,n(e,"mail_sent")):n(e,"init"),c.apiResponse=t,a(e,"reset",c)})).catch((e=>console.error(e)))}r.use(((e,t)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:t,detail:a}=e.wpcf7;d(t),n(t,"resetting")}return t(e)}));const u=(e,t)=>{for(const a in t){const n=t[a];e.querySelectorAll(`input[name="${a}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${a.replaceAll(":","")}`).forEach((e=>{e.setAttribute("src",n)}));const r=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);r&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${a}"]`).forEach((e=>{e.value=r[1]}))}},m=(e,t)=>{for(const a in t){const n=t[a][0],r=t[a][1];e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${a}"]`).forEach((e=>{e.querySelector(`input[name="${a}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=n,e.querySelector(`input[name="_wpcf7_quiz_answer_${a}"]`).value=r}))}};function w(e){const a=new FormData(e);e.wpcf7={id:t(a.get("_wpcf7")),status:e.getAttribute("data-status"),pluginVersion:a.get("_wpcf7_version"),locale:a.get("_wpcf7_locale"),unitTag:a.get("_wpcf7_unit_tag"),containerPost:t(a.get("_wpcf7_container_post")),parent:e.closest(".wpcf7"),get schema(){return wpcf7.schemas.get(this.id)}},wpcf7.schemas.set(e.wpcf7.id,void 0),e.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'<span class="wpcf7-spinner"></span>')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const a=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${a}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(e),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const a=t.querySelector("input.wpcf7-free-text"),n=t.querySelector('input[type="checkbox"], input[type="radio"]');a.disabled=!n.checked,e.addEventListener("change",(e=>{a.disabled=!n.checked,e.target===n&&n.checked&&a.focus()}))}))})(e),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let a=e.value.trim();a&&!a.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==a.indexOf(".")&&(a=a.replace(/^\/+/,""),a="http://"+a),e.value=a}))}))})(e),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const a=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&a.checked||!e.classList.contains("invert")&&!a.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(e),(e=>{const a=(e,a)=>{const n=t(e.getAttribute("data-starting-value")),r=t(e.getAttribute("data-maximum-value")),c=t(e.getAttribute("data-minimum-value")),o=e.classList.contains("down")?n-a.value.trim().length:a.value.trim().length;e.setAttribute("data-current-value",o),e.innerText=o,r&&r<a.value.length?e.classList.add("too-long"):e.classList.remove("too-long"),c&&a.value.length<c?e.classList.add("too-short"):e.classList.remove("too-short")},n=t=>{t={init:!1,...t},e.querySelectorAll(".wpcf7-character-count").forEach((n=>{const r=n.getAttribute("data-target-name"),c=e.querySelector(`[name="${r}"]`);c&&(c.value=c.defaultValue,a(n,c),t.init&&c.addEventListener("keyup",(e=>{a(n,c)})))}))};n({init:!0}),e.addEventListener("wpcf7reset",(e=>{n()}))})(e),window.addEventListener("load",(t=>{wpcf7.cached&&e.reset()})),e.addEventListener("reset",(t=>{wpcf7.reset(e)})),e.addEventListener("submit",(t=>{wpcf7.submit(e,{submitter:t.submitter}),t.preventDefault()})),e.addEventListener("wpcf7submit",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("wpcf7reset",(t=>{t.detail.apiResponse.captcha&&u(e,t.detail.apiResponse.captcha),t.detail.apiResponse.quiz&&m(e,t.detail.apiResponse.quiz)})),e.addEventListener("change",(t=>{t.target.closest(".wpcf7-form-control")&&wpcf7.validate(e,{target:t.target})})),e.addEventListener("wpcf7statuschanged",(t=>{const a=t.detail.status;e.querySelectorAll(".active-on-any").forEach((e=>{e.removeAttribute("inert"),e.classList.remove("active-on-any")})),e.querySelectorAll(`.inert-on-${a}`).forEach((e=>{e.setAttribute("inert","inert"),e.classList.add("active-on-any")}))}))}document.addEventListener("DOMContentLoaded",(t=>{var a;if("undefined"!=typeof wpcf7)if(void 0!==wpcf7.api)if("function"==typeof window.fetch)if("function"==typeof window.FormData)if("function"==typeof NodeList.prototype.forEach)if("function"==typeof String.prototype.replaceAll){wpcf7={init:w,submit:p,reset:f,validate:o,schemas:new Map,...null!==(a=wpcf7)&&void 0!==a?a:{}},document.querySelectorAll("form .wpcf7[data-wpcf7-id]").forEach((t=>{const a=document.createElement("p");a.setAttribute("class","wpcf7-form-in-wrong-place");const n=document.createElement("strong");n.append((0,e.__)("Error:","contact-form-7"));const r=(0,e.__)("This contact form is placed in the wrong place.","contact-form-7");a.append(n," ",r),t.replaceWith(a)})),document.querySelectorAll(".wpcf7 > form").forEach((e=>{wpcf7.init(e),e.closest(".wpcf7").classList.replace("no-js","js")}));for(const e of wpcf7.schemas.keys())r({endpoint:`contact-forms/${e}/feedback/schema`,method:"GET"}).then((t=>{wpcf7.schemas.set(e,t)}))}else console.error("Your browser does not support String.replaceAll().");else console.error("Your browser does not support NodeList.forEach().");else console.error("Your browser does not support window.FormData().");else console.error("Your browser does not support window.fetch().");else console.error("wpcf7.api is not defined.");else console.error("wpcf7 is not defined.")}))})();