1"use strict";(self.webpackChunknyp_membership=self.webpackChunknyp_membership||[]).push([[6116],{6116:function(e,n,t){t.r(n),t.d(n,{PhoneNumberInput:function(){return o},formatPhone:function(){return b}});var s=t(1085),a=t(4041),l=t(9067),r=t.n(l),i=t(7309),u=t(4120);const b=e=>{let n=(e.match(/\d/g)||[]).join(""),t="";return""!==n&&("1"!==n.substring(0,1)&&(n=`1${n}`),n.length>7?t=`+${n.substring(0,1)} (${n.substring(1,4)}) ${n.substring(4,7)}-${n.substring(7,11)}`:n.length>4?t=`+${n.substring(0,1)} (${n.substring(1,4)}) ${n.substring(4,7)}`:n.length>1?t=`+${n.substring(0,1)} (${n.substring(1,4)}`:1===n.length&&(t=`+${n.substring(0,1)}`)),t},o=({value:e="",onUpdate:n=()=>{},label:t=(0,i.__)("Mobile Number","nypost"),id:l="phoneNumber"})=>{const r=(0,a.useRef)(),[o,p]=(0,a.useState)(e),{state:g}=(0,u.rR)(),{user:{profile:{phoneNumber:c=""}={}}={}}=g;return(0,a.useEffect)(()=>{c&&p(c)},[c]),(0,s.jsxs)("div",{className:"floating-label input-container input-container--floating-label",children:[(0,s.jsx)("input",{className:"floating-label__input",id:l,name:"phone",type:"text",placeholder:" ",required:!0,"data-empty":!r,"data-testid":"phone-input",onChange:e=>{const{value:t}=e.target,s=b(t);e.target.value=s,p(s),n(s)},value:b(o)}),(0,s.jsx)("div",{className:"floating-label__label-wrap",children:(0,s.jsx)("label",{className:"floating-label__label",htmlFor:l,children:t})})]})};o.propTypes={value:r().string,onUpdate:r().func.isRequired,label:r().string,id:r().string}}}]); 2//# sourceMappingURL=6116.e8ae8d5abd1ffb327a48.bundle.min.js.map
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.