PageSourceSearch

https://www.adiglobal.fr/dist/7611_b18a4fdf7d784d4d29ca.chunk.js

js adiglobal.fr collected 2026-10-08 21:32:26 UTC 30,969 bytes, 15 lines download raw bytes

1"use strict";(self.webpackChunkroot=self.webpackChunkroot||[]).push([[7611],{86948:(e,t,s)=>{s.d(t,{Z:()=>j});var i=s(94856),a=s(11298),n=s(62602),o=s(68367),r=s(94610),d=s(87930),l=s(63944),m=s(84716),c=s(83185),h=s(70287),u=s(72035),p=s(26413),g=s(92141),v=s(98852),b=s(35765),x=s(50361),y=s.n(x),f=s(67294),C=s(37703),P=s(12788);const N={loadingOverlay:{css:P.iv`& > div:first-child[data-loading="true"]{position:fixed;}`},mainWrapperScroll:{css:P.iv`overflow-y:auto;padding-right:20px;max-height:50vh;min-height:inherit;${({theme:e})=>(0,v.ZP)(e,[null,P.iv`
2                            padding-right: 15px;
3                        `],"max")} &::-webkit-scrollbar{width:4px;overflow-y:auto;}&::-webkit-scrollbar-track{background:${(0,b.Z)("common.background")};overflow-y:auto;}&::-webkit-scrollbar-thumb{background-color:${a.Z.lightGrey};border-radius:7px;overflow-y:auto;}`},mainWrapperScrollTest:{css:P.iv`overflow-y:auto;padding-right:20px;max-height:50vh;min-height:inherit;&::-webkit-scrollbar{width:4px;overflow-y:auto;}&::-webkit-scrollbar-track{background:${(0,b.Z)("common.background")};overflow-y:auto;}&::-webkit-scrollbar-thumb{background-color:${a.Z.lightGrey};border-radius:7px;overflow-y:auto;}label [data-test-selector="customerAddressForm_city-label"]{color:blue !important;}`},errorWrapper:{css:P.iv`> ${g.Z}{font-size:14px;padding-bottom:9px;}`},pleaseEnterText:{css:P.iv`font-size:14px;padding-bottom:9px;`},formButtonsWrapper:{css:P.iv`display:flex;justify-content:flex-end;margin-top:30px;> ${h.W4}{${({theme:e})=>(0,v.ZP)(e,[null,P.iv`
4                                width: 50%;
5                                min-width: inherit;
6                                max-width: inherit;
7                            `,null,null,null],"max")}}`},cancelButton:{variant:"secondary",css:P.iv`margin-right:25px;height:auto;min-height:42px !important;border-radius:4px;align-items:center;justify-content:center;padding:9px 10px;margin-bottom:2px;display:flex;min-width:110px;border:1px solid ${(0,b.Z)("secondary")};&:hover{background:${a.Z.secondaryButtonHoverLightBlue};}`},submitButton:{css:P.iv`height:auto;min-height:42px !important;border-radius:4px;align-items:center;justify-content:center;padding:9px 10px;margin-bottom:2px;display:flex;min-width:160px;`}},Z=(l.ZP,N),E=(0,o.z)("form"),O=e=>(0,r.ZP)("Field_Required",e.displayName);class S extends f.Component{constructor(e){var t,s,i,a,o,d,l;let m,h;super(e),this.handleRadioChange=e=>{this.setState({removeinfuture:e})},this.handleInputChange2=e=>{var t;const{target:s}=e,i=s.name;if("nickname"===i){const e=s.value;this.setState(()=>({nicknameProperty:s.value}),()=>{});let a=0;const n=e.toLowerCase();e&&(a=0,null===(t=this.props.shipTosArray)||void 0===t||t.forEach(e=>{void 0!==e.properties.nickname&&e.properties.nickname.toLowerCase()===n&&a++})),0!==a&&""!==e||this.isValidatedAllFields||(this.setState(()=>({formErrors:{}}),()=>{this.isNotAvailableNickName=!1}),this.setState({address:Object.assign(Object.assign({},this.state.address),{properties:Object.assign(Object.assign({},this.state.address.properties),{[i]:s.value})})})),a>0&&this.setState(()=>({nicknameProperty:n}),()=>{this.isNotAvailableNickName=!0,""!==this.state.nicknameProperty&&this.validateForm()})}},this.handlePhoneChange=e=>{const{target:t}=e,s=t.name;"phone"===s&&(""===t.value||/^[0-9]{1,14}$/.test(t.value))&&this.setState({address:Object.assign(Object.assign({},this.state.address),{[s]:t.value})})},this.handleMobilePhoneChange=e=>{var t;const{target:s}=e,i=s.name;if("mobilephone"===i){const e=s.value;this.setState(()=>({mobilePhoneProperty:s.value}),()=>{});let a=0;const n=e.toLowerCase();e&&(a=0,null===(t=this.props.shipTosArray)||void 0===t||t.forEach(e=>{void 0!==e.properties.mobilephone&&e.properties.mobilephone.toLowerCase()===n&&a++})),0!==a&&""!==e||this.isValidatedAllFields||(this.setState(()=>({formErrors:{}}),()=>{this.isNotAvailableMobilePhone=!1}),this.setState({address:Object.assign(Object.assign({},this.state.address),{properties:Object.assign(Object.assign({},this.state.address.properties),{[i]:s.value})})})),a>0&&this.setState(()=>({mobilePhoneProperty:n}),()=>{this.isNotAvailableMobilePhone=!0,""!==this.state.mobilePhoneProperty&&this.validateForm()})}},this.handleExtensionChange=e=>{var t;const{target:s}=e,i=s.name;if("extension"===i){const e=s.value;this.setState(()=>({extensionProperty:s.value}),()=>{});let a=0;const n=e.toLowerCase();e&&(a=0,null===(t=this.props.shipTosArray)||void 0===t||t.forEach(e
7=>{void 0!==e.properties.extension&&e.properties.extension.toLowerCase()===n&&a++})),0!==a&&""!==e||this.isValidatedAllFields||(this.setState(()=>({formErrors:{}}),()=>{this.isNotAvailableExtension=!1}),this.setState({address:Object.assign(Object.assign({},this.state.address),{properties:Object.assign(Object.assign({},this.state.address.properties),{[i]:s.value})})})),a>0&&this.setState(()=>({extensionProperty:n}),()=>{this.isNotAvailableExtension=!0,""!==this.state.extensionProperty&&this.validateForm()})}},this.handleInputChange=e=>{const{target:t}=e,s=t.name;this.setState({address:Object.assign(Object.assign({},this.state.address),{[s]:t.value})})},this.handleCountryChange=(e,t)=>{const s=this.props.countries.find(e=>e.id===(null==t?void 0:t.id));this.setState({address:Object.assign(Object.assign({},this.state.address),{country:t,state:null}),countryLookup:s})},this.handleStateChange=(e,t)=>this.setState({address:Object.assign(Object.assign({},this.state.address),{state:t})}),this.validateForm=()=>{var e,t,s,i,a,n,o,d,l,m,h,u,p,g,v,b,x,y,f,C,P,N,Z,E,S,j,I,A,w,k,F,R;const q=this.props.addressFieldDisplayCollection,D=this.props.address.validation,{countries:T}=this.props,{firstName:L,lastName:G,attention:V,companyName:$,address1:_,address2:B,address3:M,address4:W,country:z,city:H,state:U,postalCode:J,properties:K,phone:Y,email:Q,fax:X}=this.state.address,ee={};if(this.isNotAvailableNickName)this.state.nicknameProperty&&(ee.nickname=(0,c.ZP)("The Nickname you entered is already in use. Please enter a unique name."));else{(!this.state.nicknameProperty||this.state.nicknameProperty.trim().length<=0)&&(ee.nickname=(0,c.ZP)("field nick name is required")),(null===(e=q.firstName)||void 0===e?void 0:e.isVisible)&&(null===(t=D.firstName)||void 0===t?void 0:t.isRequired)&&L.trim().length<=0&&(ee.firstName=O(q.firstName)),(null===(s=q.lastName)||void 0===s?void 0:s.isVisible)&&(null===(i=D.lastName)||void 0===i?void 0:i.isRequired)&&G.trim().length<=0&&(ee.lastName=O(q.lastName)),(null===(a=q.attention)||void 0===a?void 0:a.isVisible)&&(null===(n=D.attention)||void 0===n?void 0:n.isRequired)&&V.trim().length<=0&&(ee.attention=O(q.attention)),(null===(o=q.companyName)||void 0===o?void 0:o.isVisible)&&(null===(d=D.companyName)||void 0===d?void 0:d.isRequired)&&$.trim().length<=0&&(ee.companyName=O(q.companyName)),(null===(l=q.address1)||void 0===l?void 0:l.isVisible)&&(null===(m=D.address1)||void 0===m?void 0:m.isRequired)&&_.trim().length<=0&&(ee.address1=O(q.address1)),(null===(h=q.address2)||void 0===h?void 0:h.isVisible)&&(null===(u=D.address2)||void 0===u?void 0:u.isRequired)&&B.trim().length<=0&&(ee.address2=O(q.address2)),(null===(p=q.address3)||void 0===p?void 0:p.isVisible)&&(null===(g=D.address3)||void 0===g?void 0:g.isRequired)&&M.trim().length<=0&&(ee.address3=O(q.address3)),(null===(v=q.address4)||void 0===v?void 0:v.isVisible)&&(null===(b=D.address4)||void 0===b?void 0:b.isRequired)&&W.trim().length<=0&&(ee.address4=O(q.address4)),T.length>1&&!z&&q.country&&(ee.country=O(q.country)),(null===(x=q.city)||void 0===x?void 0:x.isVisible)&&(null===(y=D.city)||void 0===y?void 0:y.isRequired)&&H.trim().length<=0&&(ee.city=O(q.city)),(null===(f=q.postalCode)||void 0===f?void 0:f.isVisible)&&(null===(C=D.postalCode)||void 0===C?void 0:C.isRequired)&&J.trim().length<=0&&(ee.postalCode=O(q.postalCode));const{countryLookup:U}=this.state;let K=/^[A-Za-z0-9]{2,4}$/;if(z&&void 0!==z&&null!=z&&(null===(P=this.props.adiSettings)||void 0===P?void 0:P.UserPostalCode_Regex.indexOf(z.abbreviation))>-1){const e=null===(N=this.props.adiSettings)||void 0===N?void 0:N.UserPostalCode_Regex.split(";");null===(Z=this.props.adiSettings)||void 0===Z||Z.UserPostalCode_RegexLength;let t=0;for(let s=0;s<e.length;s++)e[s].indexOf(z.abbreviation)>-1&&(t=e[s].indexOf("^"),K=e[s].substring(t,e[s].length))}(null===(E=q.postalCode)||void 0===E?void 0:E.isVisible)&&(null===(S=D.postalCode)||void 0===S?void 0:S.isRequired)&&J.trim().length<=0?ee.postalCode=O(q.postalCode):(null===(j=q.postalCode)||void 0===j?void 0:j.isVisible)&&J.trim().length>0&&!new RegExp(K).test(J)&&(ee.postalCode=(0,r.ZP)("AddressInfo_PostalCode_Validation")),(null===(I=q.phone)||void 0===I?void 0:I.isVisible)&&(null===(A=D.phone)||void 0===A?void 0:A.isRequired)&&Y.trim().length<=0?ee.phone=O(q.phone):Y.trim().length>0&&!/^([\(\)/\-\.\+\s]*\d\s?(ext)?[\(\)/\-\.\+\s]*){9,14}$/g.test(Y)&&(ee.phone=(0,r.ZP)("AddressInfo_Phone_Validation")),(null===(w=q.email)||void 0===w?void 0:w.isVisible)&&(null===(k=D.email)||void 0===k?void 0:k.isRequired)&&Q.trim().length<=0?ee.email=O(q.email):Q.trim().length>0&&!/\w+([-+."]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/g.test(Q)&&(ee.email=(0,r.ZP)("AddressInfo_EmailAddress_Validation")),(null===(F=q.fax)||void 0===F?void 0:F.isVisible)&&(null===(R=D.fax)||void 0===R?void 0:R.isRequired)&&X.trim().length<=0?ee.fax=O(q.fax):X.trim().length>0&&!/^([\(\)/\-\.\+\s]*\d\s?(ext)?[\(\)/\-\.\+\s]*){10,}$/g.test(X)&&(ee.fax=(0,r.ZP)("AddressInfo_Phone_Validation"))}return this.setState({formErrors:ee}),ee},this.submitHandler=async e=>{e.preventDefault(),e.stopPropagation(),this.setState({formSubmitAttempted:!0,isSubmitting:!0});const t=y()(this.state.address);"doNotSaveOption"===this.state.removeinfuture?t.properties.removeinfuture="Y":"saveOption"===this.state.removeinfuture&&(t.properties.removeinfuture="N");const s=this.validateForm(),{state:i,city:a,postalCode:n}=this.state.address;null==i||i.abbreviation,this.setState({formErrors:s},()=>{0===Object.keys(this.state.formErrors).length?(this.props.onSubmit(e,Object.assign(Object.assign({},this.state.address),t)),this.isValidatedAllFields=!1):this.setState(()=>({isSubmitting:!1,isAddressDataInvalid:!1}),()=>{this.state.isSubmitting||(this.isValidatedAllFields=!1)})})},this.message={nickname:"Nickname",firstName:"First Name",lastName:"Last Name",companyName:"Company",address1:"Address Line 1",city:"City",state:"State",postalCode:"Postal Code"},this.getMessage=e=>this.message[e]?this.message[e]:e,this.isNotAvailableNickName=!1,this.isNotAvailableMobilePhone=!1,this.isNotAvailableExtension=!1,this.isValidatedAllFields=!1,this.postalCode1RegEx="",this.styles=(0,n.Z)(Z,e.extendedStyles);const{address:u}=this.props;null==(null==u?void 0:u.country)?(m=Object.assign(Object.assign({},u),{country:(null===(t=this.props)||void 0===t?void 0:t.countriesDataFromState)&&this.props.countriesDataFromState[0]}),h=this.props.countries.find(e=>{var t;return e.id===(null===(t=m.country)||void 0===t?void 0:t.id)}),this.state={address:m,countryLookup:h,formErrors:{},formSubmitAttempted:!1,isSubmitting:!1,removeinfuture:"saveOption",isAddressDataInvalid:!1,nicknameProperty:null!==(s=u.properties.nickname)&&void 0!==s?s:"",mobilePhoneProperty:null!==(i=u.properties.mobilephone)&&void 0!==i?i:"",extensionProperty:null!==(a=u.properties.extension)&&void 0!==a?a:""}):(h=this.props.countries.find(e=>{var t;return e.id===(null===(t=u.country)||void 0===t?void 0:t.id)}),this.state={address:u,countryLookup:h,formErrors:{},formSubmitAttempted:!1,isSubmitting:!1,removeinfuture:"saveOption",isAddressDataInvalid:!1,nicknameProperty:null!==(o=u.properties.nickname)&&void 0!==o?o:"",mobilePhoneProperty:null!==(d=u.properties.mobilephone)&&void 0!==d?d:"",extensionProperty:null!==(l=u.properties.extension)&&void 0!==l?l:""})}render(){var e;const{firstName:t,lastName:s,attention:a,companyName:n,address1:r,address2:d,address3:l,address4:m,country:g,city:v,state:b,postalCode:x,phone:y,email:C,fax:P}=this.state.address,{formErrors:N}=this.state,{countries:O,extendedStyles:S}=this.props,{validation:j}=this.props.address,I=this.props.addressFieldDisplayCollection;if(!j)return null;const A=j.firstName.isDisabled&&j.lastName.isDisabled&&j.companyName.isDisabled&&j.attention.isDisabled&&j.address1.isDisabled&&j.address2.isDisabled&&j.address3.isDisabled&&j.address4.isDisabled&&j.country.isDisabled&&j.city.isDisabled&&j.postalCode.isDisabled&&j.phone.isDisabled&&j.fax.isDisabled&&j.email.isDisabled||this.state.isSubmitting;return f.createElement(u.Z,Object.assign({},Z.loadingOverlay,{loading:this.state.isSubmitting}),f.createElement(E,Object.assign({},Z.form,{onSubmit:this.submitHandler,noValidate:!0}),Object.keys(N).length>0?this.isNotAvailableNickName?f.createElement(f.Fragment,null,f.createElement(o.Z,null,f.createElement(p.Z,Object.assign({as:"p"},Z.pleaseEnterText),"* ",(0,c.ZP)("Please enter information in required fields."))),f.createElement(p.Z,{as:"p",color:"danger"},Object.values(N).map(e=>f.createElement(p.Z,{as:"span"},e)))):f.createElement(o.Z,Object.assign({},Z.errorWrapper),f.createElement(p.Z,{as:"p",color:"danger"},"* ",(0,c.ZP)("Please enter information in required fields."))):f.createElement(o.Z,null,f.createElement(p.Z,Object.assign({as:"p"},Z.pleaseEnterText),"* ",(0,c.ZP)("Please enter information in required fields."))),this.state.isAddressDataInvalid&&0!==(null==b?void 0:b.name.trim().length)&&0!==v.trim().length&&0!==x.trim().length&&f.createElement(p.Z,{as:"p",color:"danger"},"* ",(0,c.ZP)("City, State and Zip combination does not match.")),f.createElement(o.Z,Object.assign({},Z.mainWrapperScrollTest),f.createElement(i.Z,{firstName:t,lastName:s,attention:a,companyName:n,address1:r,address2:d,address3:l,address4:m,country:g,city:v,state:b,postalCode:x,phone:y,email:C,fax:P,nickname:this.state.nicknameProperty,nickNameError:N.nickname,onChangeNickName:this.handleInputChange2,mobilePhone:this.state.mobilePhoneProperty,mobilePhoneError:N.mobilePhone,onChangeMobilePhone:this.handleMobilePhoneChange,extension:this.state.extensionProperty,extensionError:N.extension,onChangeExtension:this.handleExtensionChange,postalcode2:this.state.address.properties.postalcode2,removeinfuture:this.state.removeinfuture,onChangeRemoveInFuture:this.handleRadioChange,onChangePostalCode2:this.handleInputChange,onChangeFirstName:this.handleInputChange,onChangeLastName:this.handleInputChange,onChangeAttention:this.handleInputChange,onChangeCompanyName:this.handleInputChange,onChangeAddress1:this.handleInputChange,onChangeAddress2:this.handleInputChange,onChangeAddress3:this.handleInputChange,onChangeAddress4:this.handleInputChange,onChangeCountry:this.handleCountryChange,onChangeState:this.handleStateChange,onChangeCity:this.handleInputChange,onChangePostalCode:this.handleInputChange,onChangePhone:this.handlePhoneChange,onChangeEmail:this.handleInputChange,onChangeFax:this.handleInputChange,firstNameError:N.firstName,lastNameError:N.lastName,attentionError:N.attention,companyNameError:N.companyName,address1Error:N.address1,address2Error:N.address2,address3Error:N.address3,address4Error:N.address4,countryError:N.country,stateError:N.state,cityError:N.city,postalError:N.postalCode,phoneError:N.phone,emailError:N.email,faxError:N.fax,countries:O,validation:j,fieldDisplay:I,extendedStyles:null==S?void 0:S.formFields,showRemoveInFuture:this.props.showRemoveInFuture}),f.createElement(o.Z,Object.assign({},Z.formButtonsWrapper),this.props.onCancel&&!this.props.showRemoveInFuture&&f.createElement(h.ZP,Object.assign({},this.styles.cancelButton,{type:"button",onClick:this.props.onCancel,"data-test-selector":"customerAddressForm_cancel"}),(0,c.ZP)("Cancel")),f.createElement(h.ZP,Object.assign({},this.styles.submitButton,{type:"submit",disabled:A,"data-test-selector":"customerAddressForm_save"}),null!==(e=this.props.saveButtonTextOverride)&&void 0!==e?e:(0,c.ZP)("Save")))
7)))}}const j=(0,C.$j)(e=>{var t,s,i,a,n,o,r;const l=null===(t=e.data.carts.byId)||void 0===t?void 0:t.current,c=null===(i=null===(s=e.data.carts.byId)||void 0===s?void 0:s.current)||void 0===i?void 0:i.billToId;let h;if(c){const t={billToId:null==l?void 0:l.billToId,expand:["validation"],exclude:["showAll","billTo","oneTime"],additionalQueryStringParameters:[{customBillToId:null===(a=null==l?void 0:l.properties)||void 0===a?void 0:a.customBillToId,isSelectAddressPopup:"Y"}],additionalExpands:["assignedOnly"]};h=(0,m.Ng)(e,t).value}return{billToId:c,shipTosArray:h,countriesDataFromState:(0,d.s)(e),siteName:e.context.website.name,adiSettings:null===(r=null===(o=null===(n=null==e?void 0:e.context)||void 0===n?void 0:n.settings)||void 0===o?void 0:o.settingsCollection)||void 0===r?void 0:r.adiExclusiveSetting}})(S)},94856:(e,t,s)=>{s.d(t,{Z:()=>f});var i=s(62602),a=s(83185),n=s(37585),o=s(66394),r=s(44543),d=s(12656),l=s(83725),m=s(47128),c=s(15881),h=s(25758),u=s(26413),p=s(98852),g=s(67294),v=s(37703),b=s(12788);const x={getTranslationsData:n.default},y={container:{css:b.iv`> ${r.ci}{> ${d.P}{padding-bottom:5px;padding-top:13px;}}${({theme:e})=>(0,p.ZP)(e,[null,b.iv`
8                            max-width: 100%;
9                        `],"max")} input:not(:focus){border:1px solid #cfcfcf !important;}`},radioGroupDiv:{css:b.iv`flex-direction:row;${({theme:e})=>(0,p.ZP)(e,[null,b.iv`
10                            flex-direction: column;
11                        `,null,null,null],"max")} input:not(:checked)+ label::before{border:1px solid #cfcfcf;}> ${l.H}{> input{margin:0 1px;}> label{font-size:16px;}}> ${l.H} + ${l.H}{margin-top:0;margin-left:16px;${({theme:e})=>(0,p.ZP)(e,[null,b.iv`
12                                margin-left: 0;
13                            `,null,null,null],"max")}}`},nickNameGridItem:{width:12},mobilePhoneGridItem:{width:6},extensionGridItem:{width:6},postalCodeGridItem:{width:[6,6,4,4,4]},postalCode2GridItem:{width:[6,6,2,2,2],css:b.iv`> ${o.xj}{label{visibility:hidden;max-height:22px;}}${({theme:e})=>(0,p.ZP)(e,[null,b.iv`
14                            padding-left: 0;
15                        `],"max")}`},removeInFutureGridItem:{width:12,css:b.iv`flex-direction:column;`},removeInFutureText:{css:b.iv`font-size:14px;text-transform:capitalize;font-weight:700;`},firstNameGridItem:{width:[12,12,6,6,6]},lastNameGridItem:{width:[12,12,6,6,6]},companyNameGridItem:{width:12},attentionGridItem:{width:6},address1GridItem:{width:12},address2GridItem:{width:12},address3GridItem:{width:12},address4GridItem:{width:12},countryGridItem:{width:12},cityGridItem:{width:[12,12,6,6,6]},stateGridItem:{width:[12,12,6,6,6]},phoneGridItem:{width:6},faxGridItem:{width:6},emailGridItem:{width:12},formButtonsWrapper:{css:b.iv`display:flex;justify-content:flex-end;margin-top:30px;`},cancelButton:{color:"secondary",css:b.iv`margin-right:10px;`}},f=(0,v.$j)(e=>{var t,s,i,a;return{siteName:e.context.website.name,adiSettings:null===(i=null===(s=null===(t=null==e?void 0:e.context)||void 0===t?void 0:t.settings)||void 0===s?void 0:s.settingsCollection)||void 0===i?void 0:i.adiExclusiveSetting,languageId:null===(a=e.context.session.language)||void 0===a?void 0:a.id}},x)(({firstName:e,lastName:t,attention:s,companyName:n,address1:p,address2:v,address3:x,address4:f,country:C,state:P,city:N,postalCode:Z,phone:E,email:O,fax:S,onChangeFirstName:j,onChangeLastName:I,onChangeAttention:A,onChangeCompanyName:w,onChangeAddress1:k,onChangeAddress2:F,onChangeAddress3:R,onChangeAddress4:q,onChangeCountry:D,onChangeState:T,onChangeCity:L,onChangePostalCode:G,onChangePhone:V,onChangeEmail:$,onChangeFax:_,firstNameError:B,lastNameError:M,companyNameError:W,address1Error:z,countryError:H,stateError:U,cityError:J,countries:K,fieldDisplay:Y,validation:Q,extendedStyles:X,nickname:ee,onChangeNickName:te,mobilePhone:se,onChangeMobilePhone:ie,extension:ae,onChangeExtension:ne,postalcode2:oe,removeinfuture:re,onChangeRemoveInFuture:de,onChangePostalCode2:le,nickNameError:me,mobilePhoneError:ce,extensionError:he,showRemoveInFuture:ue,siteName:pe,adiSettings:ge,languageId:ve,getTranslationsData:be,phoneError:xe,postalError:ye,emailError:fe})=>{const[Ce]=g.useState(()=>(0,i.Z)(y,X));if(!K)return null;
15const[Pe,Ne]=(0,g.useState)(void 0),[Ze,Ee]=(0,g.useState)(Z),[Oe,Se]=(0,g.useState)(void 0),je=null==ge?void 0:ge.UserPostalCode_Regex,Ie=null==ge?void 0:ge.UserPostalCode_RegexLength,[Ae,we]=(0,g.useState)(""),[ke,Fe]=(0,g.useState)(""),[Re,qe]=g.useState(8),[De,Te]=g.useState(2),[Le,Ge]=(0,g.useState)("");let Ve;const[$e,_e]=(0,g.useState)([]),[Be,Me]=(0,g.useState)([]),[We,ze]=(0,g.useState)([]);window.location.hostname.toString().indexOf("fr"),(0,g.useEffect)(()=>{Ee(Z)},[Z]);const[He,Ue]=(0,g.useState)([]);(0,g.useEffect)(()=>{Ne(K.find(e=>e.name===("string"==typeof C?C:null==C?void 0:C.name)))},[C,K]),(0,g.useEffect)(()=>{Ue((null==Pe?void 0:Pe.states)||[])},[Pe]);const[Je,Ke]=(0,g.useState)("");(0,g.useEffect)(()=>{const e=K.find(e=>e.name===("string"==typeof C?C:null==C?void 0:C.name));ve&&(null==e?void 0:e.abbreviation)&&be({languageId:ve,onSuccess:t=>{const s=t.result.find(t=>t.frKeyword===e.abbreviation);Ke((null==s?void 0:s.frTranslatedValue)||"")},onComplete(e){var t;e.apiResult&&(null===(t=this.onSuccess)||void 0===t||t.call(this,e.apiResult))}})},[ve,C,K,be]);const Ye=(e,t)=>{let s=0,i=0;if($e)for(let i=0;i<$e.length;i++)$e[i].indexOf(e.abbreviation)>-1&&(s=$e[i].indexOf("^"),"regex1"===t&&(we($e[i].substring(s,$e[i].length)),Fe($e[i].substring(s,$e[i].length))));if(Be)for(let s=0;s<Be.length;s++)Be[s].indexOf(e.abbreviation)>-1&&(i=Be[s].indexOf("|"),Ge(Be[s].substring(i+1,Be[s].length)),Be[s].substring(i+1,Be[s].length),(null==Le?void 0:Le.indexOf(","))>-1&&"regex1"===t?(Te(Number(Le.split(",")[0])),qe(Number(Le.split(",")[1]))):qe(Number(Le)))},Qe=e=>b.iv`> ${o.xj}{label{color:${e?"#ac1e2d":""};}}`;return g.createElement(r.ZP,Object.assign({},Ce.container,{"data-test-selector":"customerAddressFormFields"}),g.createElement(d.Z,Object.assign({},Ce.nickNameGridItem,{css:Qe(me)}),g.createElement(h.Z,Object.assign({},Ce.nickNameText,{name:"nickname",label:`${(0,a.ZP)("Nickname")} *`,value:ee,onChange:te,"data-test-selector":"customerAddressForm_nickName",placeholder:(0,a.ZP)("Johny")}))),Y.companyName.isVisible&&g.createElement(d.Z,Object.assign({},Ce.companyNameGridItem,{css:Qe(W)}),g.createElement(h.Z,Object.assign({},Ce.companyNameText,{name:"companyName",label:`${(0,a.ZP)("Company")}`,value:n,disabled:Q.companyName.isDisabled,required:Q.companyName.isRequired,maxLength:Q.companyName.maxLength||void 0,onChange:w,"data-test-selector":"customerAddressForm_companyName",placeholder:(0,a.ZP)("Company Name")}))),Y.firstName.isVisible&&g.createElement(d.Z,Object.assign({},Ce.firstNameGridItem,{css:Qe(B)}),g.createElement(h.Z,Object.assign({},Ce.firstNameText,{name:"firstName",label:(0,a.ZP)(Y.firstName.displayName),value:e,disabled:Q.firstName.isDisabled,required:Q.firstName.isRequired,maxLength:Q.firstName.maxLength||void 0,onChange:j,"data-test-selector":"customerAddressForm_firstName",placeholder:(0,a.ZP)("John")}))),Y.lastName.isVisible&&g.createElement(d.Z,Object.assign({},Ce.lastNameGridItem,{css:Qe(M)}),g.createElement(h.Z,Object.assign({},Ce.lastNameText,{name:"lastName",label:(0,a.ZP)(Y.lastName.displayName),value:t,disabled:Q.lastName.isDisabled,required:Q.lastName.isRequired,maxLength:Q.lastName.maxLength||void 0,onChange:I,"data-test-selector":"customerAddressForm_lastName",placeholder:(0,a.ZP)("Doe")}))),Y.attention.isVisible&&g.createElement(d.Z,Object.assign({},Ce.attentionGridItem),g.createElement(h.Z,Object.assign({},Ce.attentionText,{name:"attention",label:(0,a.ZP)(Y.attention.displayName),value:s,disabled:Q.attention.isDisabled,required:Q.attention.isRequired,maxLength:Q.attention.maxLength||void 0,onChange:A,"data-test-selector":"customerAddressForm_attention",placeholder:(0,a.ZP)("attention")}))),Y.address1.isVisible&&g.createElement(d.Z,Object.assign({},Ce.address1GridItem,{css:Qe(z)}),g.createElement(h.Z,Object.assign({},Ce.address1Text,{name:"address1",label:(0,a.ZP)("Address line 1"),value:p,disabled:Q.address1.isDisabled,required:Q.address1.isRequired,maxLength:Q.address1.maxLength||void 0,onChange:k,"data-test-selector":"customerAddressForm_address1",placeholder:(0,a.ZP)("Addressline1")}))),Y.address2.isVisible&&g.createElement(d.Z,Object.assign({},Ce.address2GridItem),g.createElement(h.Z,Object.assign({},Ce.address2Text,{name:"address2",label:(0,a.ZP)("Address Line 2"),value:v,disabled:Q.address2.isDisabled,required:Q.address2.isRequired,maxLength:Q.address2.maxLength||void 0,onChange:F,"data-test-selector":"customerAddressForm_address2",placeholder:(0,a.ZP)("Addressline2")}))),Y.address3.isVisible&&g.createElement(d.Z,Object.assign({},Ce.address3GridItem),g.createElement(h.Z,Object.assign({},Ce.address3Text,{name:"address3",label:(0,a.ZP)(Y.address3.displayName),value:x,disabled:Q.address3.isDisabled,required:Q.address3.isRequired,maxLength:Q.address3.maxLength||void 0,onChange:R,"data-test-selector":"customerAddressForm_address3",placeholder:(0,a.ZP)("Addressline3")}))),Y.address4.isVisible&&g.createElement(d.Z,Object.assign({},Ce.address4GridItem),g.createElement(h.Z,Object.assign({},Ce.address4Text,{name:"address4",label:(0,a.ZP)(Y.address4.displayName),value:f,disabled:Q.address4.isDisabled,required:Q.address4.isRequired,maxLength:Q.address4.maxLength||void 0,onChange:q,"data-test-selector":"customerAddressForm_address4",placeholder:(0,a.ZP)("Addressline4")}))),Y.country.isVisible&&K.length>1&&g.createElement(d.Z,Object.assign({},Ce.countryGridItem),g.createElement(c.Z,Object.assign({},Ce.countrySelect,{label:(0,a.ZP)(Y.country.displayName),value:(null==Pe?void 0:Pe.name)||"",disabled:Q.country.isDisabled||1===K.length,required:Q.country.isRequired,onChange:e=>{const t=e.target.value;Ee("");const s=K.find(e=>e.name===t);Ne(s),s&&(D(e,s),((e,t)=>{Te(0),""===e?(Ve=t[0],e=t[0].name):Ve=null==t?void 0:t.filter(t=>t.name===e)[0],Ve&&void 0!==Ve&&null!=Ve&&(null==je?void 0:je.indexOf(null==Ve?void 0:Ve.abbreviation))>-1&&(_e(null==je?void 0:je.split(";")),Me(null==Ie?void 0:Ie.split(";")),Ye(Ve,"regex1"))})(t,K))},error:H,"data-test-selector":"customerAddressForm_country"}),g.createElement("option",{value:""},(0,a.ZP)("Select Country")),K.map(e=>g.createElement("option",{key:e.id,value:e.name},e.name)))),Y.city.isVisible&&g.createElement(d.Z,Object.assign({},Ce.cityGridItem,{css:Qe(J)}),g.createElement(h.Z,Object.assign({},Ce.cityText,{name:"city",label:(0,a.ZP)(Y.city.displayName),value:N,disabled:Q.city.isDisabled,required:Q.city.isRequired,maxLength:Q.city.maxLength||void 0,onChange:L,"data-test-selector":"customerAddressForm_city",placeholder:(0,a.ZP)("City")}))),He.length>0&&g.createElement(d.Z,Object.assign({},Ce.stateGridItem,{css:Qe(U)}),g.createElement(c.Z,Object.assign({},Ce.stateSelect,{label:(0,a.ZP)(Y.state.displayName),value:(null==P?void 0:P.id)||"",disabled:Q.state.isDisabled,required:!1,onChange:e=>{var t;const s=null===(t=null==Pe?void 0:Pe.states)||void 0===t?void 0:t.find(t=>
15t.id===e.target.value);T(e,s||null)},"data-test-selector":"customerAddressForm_state"}),g.createElement("option",{value:""},(0,a.ZP)("Select One")),He.map(e=>g.createElement("option",{key:e.id,value:e.id},e.name)))),g.createElement(d.Z,{width:12},g.createElement(r.ZP,null,Y.postalCode.isVisible&&g.createElement(d.Z,Object.assign({},Ce.postalCodeGridItem,{css:Qe(ye||Oe)}),g.createElement(h.Z,Object.assign({},Ce.postalCodeText,{name:"postalCode",label:(0,a.ZP)("Postal code"),value:Ze,disabled:Q.postalCode.isDisabled,required:Q.postalCode.isRequired,minLength:De,maxLength:Re,onChange:e=>{const t=e.target.value;Ee(t);const s=(e=>{let t="";return e?Ae&&(new RegExp(Ae).test(e)||(t=(0,a.ZP)("Postal Code is invalid"))):t=`${(0,a.ZP)("Postal Code")} ${(0,a.ZP)("is required")}`,e&&void 0!==De&&e.length<De&&(t=`${(0,a.ZP)("Postal Code")} ${(0,a.ZP)("is too short")}`),e&&void 0!==Re&&e.length>Re&&(t=`${(0,a.ZP)("Postal Code")} ${(0,a.ZP)("is too long")}`),t})(t);Se(s||void 0),G&&G(e)},"data-test-selector":"customerAddressForm_postalCode",placeholder:Je,error:Oe}))))),Y.phone.isVisible&&g.createElement(d.Z,Object.assign({},Ce.phoneGridItem,{css:Qe(xe)}),g.createElement(h.Z,Object.assign({},Ce.phoneText,{name:"phone",label:(0,a.ZP)(Y.phone.displayName),value:E,disabled:Q.phone.isDisabled,required:Q.phone.isRequired,onChange:V,"data-test-selector":"customerAddressForm_phone",placeholder:(0,a.ZP)("0123456789")}))),g.createElement(d.Z,Object.assign({},Ce.extensionGridItem,{css:Qe(he)}),g.createElement(h.Z,Object.assign({},Ce.extensionText,{name:"extension",label:(0,a.ZP)("Extension"),value:ae,onChange:ne,"data-test-selector":"customerAddressForm_extension",placeholder:(0,a.ZP)("012")}))),g.createElement(d.Z,Object.assign({},Ce.mobilePhoneGridItem,{css:Qe(ce)}),g.createElement(h.Z,Object.assign({},Ce.mobilePhoneText,{name:"mobilephone",label:(0,a.ZP)("Mobile Phone"),value:se,onChange:ie,"data-test-selector":"customerAddressForm_mobilephone"}))),Y.fax.isVisible&&g.createElement(d.Z,Object.assign({},Ce.faxGridItem),g.createElement(h.Z,Object.assign({},Ce.faxText,{name:"fax",label:(0,a.ZP)(Y.fax.displayName),value:S,disabled:Q.fax.isDisabled,required:Q.fax.isRequired,maxLength:Q.fax.maxLength||void 0,onChange:_,"data-test-selector":"customerAddressForm_fax"}))),Y.email.isVisible&&g.createElement(d.Z,Object.assign({},Ce.emailGridItem,{css:Qe(fe)}),g.createElement(h.Z,Object.assign({},Ce.emailText,{name:"email",label:(0,a.ZP)(Y.email.displayName),value:O,disabled:Q.email.isDisabled,required:Q.email.isRequired,maxLength:Q.email.maxLength||void 0,onChange:$,"data-test-selector":"customerAddressForm_email",placeholder:(0,a.ZP)("[email protected]")}))),ue&&g.createElement(d.Z,Object.assign({},Ce.removeInFutureGridItem),g.createElement(u.Z,Object.assign({},Ce.removeInFutureText),(0,a.ZP)("Select One *")),g.createElement(m.Z,Object.assign({},Ce.radioGroupDiv,{value:re,onChangeHandler:e=>de(e.target.value)}),g.createElement(l.Z,Object.assign({},Ce.radioButton,{key:"saveOption",value:"saveOption",defaultChecked:!0}),(0,a.ZP)("Save For Future Use")),g.createElement(l.Z,Object.assign({},Ce.radioButton,{key:"doNotSaveOption",value:"doNotSaveOption"}),(0,a.ZP)("Do Not Save")))))})},88359:(e,t,s)=>{s.d(t,{n:()=>a});var i=s(78161);function a(e){return e.data.addressFields.dataViews[(0,i.kJ)({})]||i.K7}},21640:(e,t,s)=>{s.d(t,{ZP:()=>o});var i=s(24501),a=s(26289);const n=[e=>{e.apiParameter=e.parameter},async e=>{e.apiParameter.isEdit?e.apiResult=await(0,a.jy)(e.apiParameter):e.apiResult=e.apiParameter.billTo},e=>{e.dispatch({type:"Data/BillTos/CompleteLoadBillTo",model:e.apiResult})},e=>{let t=e.getState().data.shipTos.byId[e.apiResult.id];if(t){t=Object.assign({},t);for(const s in t){const i=e.apiResult[s];void 0!==i&&(t[s]=i)}e.dispatch({type:"Data/ShipTos/CompleteLoadShipTo",model:t})}},e=>{var t,s;return null===(s=(t=e.parameter).onSuccess)||void 0===s?void 0:s.call(t)}],o=(0,i.hN)(n,"UpdateBillTo")}}]);

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.