(()=>{var e,t,o,r={2541:(e,t,o)=>{"use strict";const r=window.wp.blocks;var s=o(4530),n=o(6099);const c=JSON.parse('{"name":"woocommerce/order-confirmation-create-account","version":"1.0.0","title":"Account Creation","description":"Allow customers to create an account after their purchase.","category":"woocommerce","keywords":["WooCommerce"],"attributes":{"customerEmail":{"type":"string","default":""},"nonceToken":{"type":"string","default":""},"align":{"type":"string","default":"wide"},"className":{"type":"string","default":""},"hasDarkControls":{"type":"boolean","default":false},"lock":{"type":"object","default":{"remove":true}}},"supports":{"multiple":false,"inserter":false,"html":false,"lock":false,"align":["wide","full"],"color":{"background":true,"text":true,"button":true},"spacing":{"padding":true,"margin":true,"__experimentalDefaultControls":{"margin":false,"padding":false}}},"textdomain":"woocommerce","apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}');var a=o(7723),i=o(4921);const l=window.wp.components,d=window.wp.blockEditor,m=window.wc.wcSettings;o(8177);const u={adminUrl:"",countries:[],countryData:{},currency:{code:"USD",precision:2,symbol:"$",symbolPosition:"left",decimalSeparator:".",priceFormat:"%1$s%2$s",thousandSeparator:","},currentUserId:0,currentUserIsAdmin:!1,homeUrl:"",locale:{siteLocale:"en_US",userLocale:"en_US",weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},orderStatuses:[],placeholderImgSrc:"",siteTitle:"",storePages:[],wcAssetUrl:"",wcVersion:"",wpLoginUrl:"",wpVersion:""},p="object"==typeof window.wcSettings?window.wcSettings:{},w={...u,...p};w.currency={...u.currency,...w.currency},w.locale={...u.locale,...w.locale},w.adminUrl,w.countries,w.currentUserIsAdmin,w.homeUrl,w.locale,w.orderStatuses,w.placeholderImgSrc;const g=w.siteTitle,h=(w.storePages,w.wcAssetUrl,w.wcVersion,w.wpLoginUrl,w.wpVersion,w.currency);h.code,h.symbol,h.thousandSeparator,h.decimalSeparator,h.precision,h.symbol,h.symbolPosition,h.symbol,h.symbolPosition;var f=o(6087),_=o(111),b=(o(6882),o(790));const y=(0,f.forwardRef)(((e,t)=>{const{className:o,children:r,variant:s="contained",removeTextWrap:n=!1,...c}=e,a=(0,i.A)("wc-block-components-button","wp-element-button",o,s);if("href"in e)return(0,b.jsx)(_.$,{render:(0,b.jsx)("a",{ref:t,href:e.href,children:(0,b.jsx)("div",{className:"wc-block-components-button__text",children:r})}),className:a,...c});const l=n?e.children:(0,b.jsx)("div",{className:"wc-block-components-button__text",children:e.children});return(0,b.jsx)(_.$,{ref:t,className:a,...c,children:l})}));var v=o(9491),k=o(3558);o(6713);const S=[(0,a.__)("Too weak","woocommerce"),(0,a.__)("Weak","woocommerce"),(0,a.__)("Medium","woocommerce"),(0,a.__)("Strong","woocommerce"),(0,a.__)("Very strong","woocommerce")],x=e=>void 0===window.zxcvbn?(0,k.Bi)(e,[{id:0,value:S[0],minDiversity:0,minLength:0},{id:1,value:S[1],minDiversity:1,minLength:4},{id:2,value:S[2],minDiversity:2,minLength:8},{id:3,value:S[3],minDiversity:4,minLength:12},{id:4,value:S[4],minDiversity:4,minLength:20}]).id:window.zxcvbn(e).score,j=({password:e="",onChange:t})=>{var o;const r=(0,v.useInstanceId)(j,"woocommerce-password-strength-meter");let s=-1;e.length>0&&(s=x(e));const n=function(e,t){const o=(0,f.useRef)();return(0,f.useEffect)((()=>{o.current===e||(o.current=e)}),[e,t]),o.current}(s);return(0,f.useEffect)((()=>{s!==n&&t&&t(s)}),[s,n,t]),(0,b.jsxs)("div",{id:r,className:(0,i.A)("wc-block-components-password-strength",{hidden:-1===s}),children:[(0,b.jsx)("label",{htmlFor:r+"-meter",className:"screen-reader-text",children:(0,a.__)("Password strength","woocommerce")}),(0,b.jsx)("meter",{id:r+"-meter",className:"wc-block-components-password-strength__meter",min:0,max:4,value:s>-1?s:0,children:null!==(o=S[s])&&void 0!==o?o:""}),!!S[s]&&(0,b.jsxs)("div",{id:r+"-result",className:"wc-block-components-password-strength__result",children:[(0,b.jsx)("span",{className:"screen-reader-text","aria-live":"polite",children:(0,a.sprintf)(/* translators: %s: Password strength */ /* translators: %s: Password strength */
(0,a.__)("Password strength: %1$s (%2$d characters long)","woocommerce"),S[s],e.length)})," ",(0,b.jsx)("span",{"aria-hidden":!0,children:S[s]})]})]})},E=(0,m.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),O=(E.pluginUrl,E.pluginUrl,m.STORE_PAGES.shop,m.STORE_PAGES.checkout,m.STORE_PAGES.checkout,m.STORE_PAGES.privacy?.permalink),P=(m.STORE_PAGES.privacy,m.STORE_PAGES.terms?.permalink),T=(m.STORE_PAGES.terms,m.STORE_PAGES.cart,m.STORE_PAGES.cart,m.STORE_PAGES.myaccount?.permalink?m.STORE_PAGES.myaccount.permalink:(0,m.getSetting)("wpLoginUrl","/wp-login.php"),(0,m.getSetting)("localPickupEnabled",!1),(0,m.getSetting)("shippingMethodsExist",!1),(0,m.getSetting)("shippingEnabled",!0),(0,m.getSetting)("countries",{})),A=(0,m.getSetting)("countryData",{}),C={...Object.fromEntries(Object.keys(A).filter((e=>!0===A[e].allowBilling)).map((e=>[e,T[e]||""]))),...Object.fromEntries(Object.keys(A).filter((e=>!0===A[e].allowShipping)).map((e=>[e,T[e]||""])))},N=(Object.fromEntries(Object.keys(C).map((e=>[e,A[e].states||{}]))),Object.fromEntries(Object.keys(C).map((e=>[e,A[e].locale||{}]))),{address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]}),D=((0,m.getSetting)("addressFieldsLocations",N).address,(0,m.getSetting)("addressFieldsLocations",N).contact,(0,m.getSetting)("addressFieldsLocations",N).order,(0,m.getSetting)("additionalOrderFields",{}),(0,m.getSetting)("additionalContactFields",{}),(0,m.getSetting)("additionalAddressFields",{}),window.wc.blocksComponents),I=window.wp.data,U=window.wc.wcBlocksData,L=P?(0,b.jsx)("a",{href:P,target:"_blank",rel:"noreferrer",children:(0,a.__)("Terms","woocommerce")}):(0,b.jsx)("span",{children:(0,a.__)("Terms","woocommerce")}),R=O?(0,b.jsx)("a",{href:O,target:"_blank",rel:"noreferrer",children:(0,a.__)("Privacy Policy","woocommerce")}):(0,b.jsx)("span",{children:(0,a.__)("Privacy Policy","woocommerce")}),B=({isLoading:e,password:t,setPassword:o})=>(0,b.jsx)("div",{children:(0,b.jsx)(D.ValidatedTextInput,{disabled:e,type:"password",label:(0,a.__)("Password","woocommerce"),className:"wc-block-components-address-form__password",value:t,required:!0,errorId:"account-password",customValidityMessage:e=>{if(e.valueMissing||e.badInput||e.typeMismatch)return(0,a.__)("Please enter a valid password","woocommerce")},customValidation:e=>!(x(e.value)<2&&(e.setCustomValidity((0,a.__)("Please create a stronger password","woocommerce")),1)),onChange:e=>o(e),feedback:(0,b.jsx)(j,{password:t})})}),M=({attributes:e,isEditor:t})=>{const[o,r]=(0,f.useState)(!1),[s,n]=(0,f.useState)(""),c=(0,I.useSelect)((e=>e(U.validationStore).getValidationError("account-password")),[]),l=e?.customerEmail||(t?"customer@email.com":""),d=e?.nonceToken||"",u=(0,m.getSetting)("registrationGeneratePassword",!1),p=!u&&!s;return l?(0,b.jsxs)("form",{className:"wc-block-order-confirmation-create-account-form",id:"create-account",method:"POST",action:"#create-account",onSubmit:e=>{c?e.preventDefault():r(!0)},children:[!u&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{children:(0,f.createInterpolateElement)((0,a.__)("Set a password for <email/>","woocommerce"),{email:(0,b.jsx)("strong",{children:l})})}),(0,b.jsx)(B,{isLoading:o,password:s,setPassword:n})]}),(0,b.jsxs)(y,{className:(0,i.A)("wc-block-order-confirmation-create-account-button",{"wc-block-order-confirmation-create-account-button--loading":o}),type:"submit",disabled:!!c||p||o,children:[!!o&&(0,b.jsx)(D.Spinner,{}),(0,a.__)("Create account","woocommerce")]}),(0,b.jsx)("input",{type:"hidden",name:"email",value:l}),(0,b.jsx)("input",{type:"hidden",name:"password",value:s}),(0,b.jsx)("input",{type:"hidden",name:"create-account",value:"1"}),(0,b.jsx)("input",{type:"hidden",name:"_wpnonce",value:d}),(0,b.jsx)("div",{className:"wc-block-order-confirmation-create-account-description",children:(0,b.jsxs)("p",{children:[u&&(0,b.jsxs)(b.Fragment,{children:[(0,f.createInterpolateElement)((0,a.__)("Check your email at <email/> for the link to set up an account password.","woocommerce"),{email:(0,b.jsx)(b.Fragment,{children:l})})," "]}),(0,f.createInterpolateElement)((0,a.__)("By creating an account you agree to our <terms/> and <privacy/>.","woocommerce"),{terms:L,privacy:R})]})})]}):null},F=[["core/heading",{level:3,content:(0,a.sprintf)(/* translators: %s: site name */ /* translators: %s: site name */
(0,a.__)("Create an account with %s","woocommerce"),g)}],["core/list",{className:"is-style-checkmark-list"},[["core/list-item",{content:(0,a.__)("Faster future purchases","woocommerce")}],["core/list-item",{content:(0,a.__)("Securely save payment info","woocommerce")}],["core/list-item",{content:(0,a.__)("Track orders & view shopping history","woocommerce")}]]]];(0,r.registerBlockType)(c,{apiVersion:3,icon:{src:(0,b.jsx)(s.A,{icon:n.A,className:"wc-block-editor-components-block-icon"})},attributes:{...c.attributes},edit:({attributes:e,setAttributes:t})=>{const o=(0,i.A)("wc-block-order-confirmation-create-account",{"has-dark-controls":e.hasDarkControls}),r=(0,d.useBlockProps)({className:o});if(!(0,m.getSetting)("delayedAccountCreationEnabled",!0))return null;const s=(0,m.getSetting)("registrationGeneratePassword",!0);return(0,b.jsxs)("div",{...r,children:[(0,b.jsx)(d.InnerBlocks,{allowedBlocks:["core/heading","core/paragraph","core/list","core/list-item","core/image"],template:F,templateLock:!1}),(0,b.jsx)(l.Disabled,{children:(0,b.jsx)(M,{isEditor:!0})}),!s&&(0,b.jsx)(d.InspectorControls,{children:(0,b.jsx)(l.PanelBody,{title:(0,a.__)("Style","woocommerce"),children:(0,b.jsx)(l.ToggleControl,{label:(0,a.__)("Dark mode inputs","woocommerce"),help:(0,a.__)("Inputs styled specifically for use on dark background colors.","woocommerce"),checked:e.hasDarkControls,onChange:()=>t({hasDarkControls:!e.hasDarkControls})})})}),(0,b.jsx)(d.InspectorControls,{children:(0,b.jsxs)(l.PanelBody,{children:[(0,b.jsx)("p",{children:(0,a.__)("Configure this feature in your store settings.","woocommerce")}),(0,b.jsx)(l.ExternalLink,{href:`${m.ADMIN_URL}admin.php?page=wc-settings&tab=account`,children:(0,a.__)("Manage account settings","woocommerce")})]})})]})},save:()=>(0,b.jsx)("div",{...d.useBlockProps.save(),children:(0,b.jsx)(d.InnerBlocks.Content,{})})})},6882:()=>{},6713:()=>{},8177:()=>{},1609:e=>{"use strict";e.exports=window.React},790:e=>{"use strict";e.exports=window.ReactJSXRuntime},9491:e=>{"use strict";e.exports=window.wp.compose},6087:e=>{"use strict";e.exports=window.wp.element},7723:e=>{"use strict";e.exports=window.wp.i18n},5573:e=>{"use strict";e.exports=window.wp.primitives}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return r[e].call(o.exports,o,o.exports,n),o.exports}n.m=r,e=[],n.O=(t,o,r,s)=>{if(!o){var c=1/0;for(d=0;d<e.length;d++){for(var[o,r,s]=e[d],a=!0,i=0;i<o.length;i++)(!1&s||c>=s)&&Object.keys(n.O).every((e=>n.O[e](o[i])))?o.splice(i--,1):(a=!1,s<c&&(c=s));if(a){e.splice(d--,1);var l=r();void 0!==l&&(t=l)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[o,r,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,n.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var s=Object.create(null);n.r(s);var c={};t=t||[null,o({}),o([]),o(o)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=o(a))Object.getOwnPropertyNames(a).forEach((t=>c[t]=()=>e[t]));return c.default=()=>e,n.d(s,c),s},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=5932,(()=>{var e={5932:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var r,s,[c,a,i]=o,l=0;if(c.some((t=>0!==e[t]))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(i)var d=i(n)}for(t&&t(o);l<c.length;l++)s=c[l],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(d)},o=globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var c=n.O(void 0,[94],(()=>n(2541)));c=n.O(c),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["order-confirmation-create-account"]=c})();