1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7342],{27342:function(e,r,a){a.r(r),a.d(r,{input_component:function(){return n}});var l=a(39986);a(67294),a(85893),a(73935);let t={email:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,phone_number:/^\+?\d{1,15}$/},s={email:"[email protected]",phone_number:"1234567890"},n=class{constructor(e){(0,l.r)(this,e),this.nylasFormInputChanged=(0,l.a)(this,"nylasFormInputChanged",7),this.nylasFormInputFocused=(0,l.a)(this,"nylasFormInputFocused",7),this.nylasFormInputBlurred=(0,l.a)(this,"nylasFormInputBlurred",7),this.name="input",this.defaultValue=void 0,this.label="",this.type="text",this.placeholder=s[this.type],this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.pattern=void 0,this.maxLength=255,this.patternError="",this.requiredError="",this.maxValue=void 0,this.minValue=void 0,this.value=void 0,this.error=""}handleDefaultValueChange(e){this.value=(0,l.y)(e),this.value&&this.validatePattern(this.value)}componentDidLoad(){this.value=(0,l.y)(this.defaultValue||""),"text"===this.type||this.pattern||(this.pattern=t[this.type]),this.value&&this.validatePattern(this.value)}handleBookingFormSubmitted(e){this.validatePattern(this.value),this.error&&e.preventDefault()}async handleFormSubmitted(e){var r;null!=(r=this.el)&&r.getAttribute("data-page-styling")&&(this.validatePattern(this.value),this.error&&e.preventDefault())}handleInput(e){this.error="";let r=e.target.value;if("number"===this.type){let e=parseFloat(r);void 0!==this.maxValue&&e>this.maxValue||void 0!==this.minValue&&e<this.minValue?void 0===this.minValue?this.error=`Value must be less than ${this.maxValue}`:void 0===this.maxValue?this.error=`Value must be greater than ${this.minValue}`:this.error=`Value must be between ${this.minValue} and ${this.maxValue}`:isNaN(e)&&(this.error=this.patternError||"Invalid format.")}this.value=(0,l.y)(r),this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:this.type})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(e){if(this.error="",this.required&&!e){this.error=this.requiredError||"This field is required.";return}if("number"===this.type&&e){let r=parseFloat(e);if(void 0!==this.maxValue&&r>this.maxValue||void 0!==this.minValue&&r<this.minValue){this.error=`Value must be between ${this.minValue} and ${this.maxValue}`;return}}this.pattern&&e&&!this.pattern.test(e)&&(this.error=this.patternError||"Invalid format.")}render(){return(0,l.h)("label",{key:"e497e200e704ef9eb22c79f0279b6b83a0a7c6b0",part:this.error?"ic__label ic__label--error":"ic__label",class:{error:!!this.error}},this.label&&(0,l.h)("p",null,(0,l.h)("span",{class:"label"},this.label),this.required&&(0,l.h)("span",{class:"required"},"*")),(0,l.h)("div",{key:"989b4c98b0b91f3395cb5d746b8c34b4860b91a5",part:"ic__input_wrapper",class:"input_wrapper"},(0,l.h)("input",{key:"c78151f2f4725d01eb78275580d70ccec7554467",type:this.type,name:this.name,part:this.error?"ic__input ic__input--error":"ic__input",title:this.readOnly?"read-only field":void 0,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,max:"number"===this.type?this.maxValue:void 0,min:"number"===this.type?this.minValue:void 0,placeholder:this.placeholder,class:{error:!!this.error},onInput:e=>this.handleInput(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),(0,l.h)("slot",{key:"91d6020c7b7d57fc51842bb6bd9716f304369cc9",name:"additional-input"})),this.error&&(0,l.h)("span",{class:"error help-text",part:"ic__error_message"},this.error))}get el(){return(0,l.g)(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"]}}};n.style=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=text],input[type=number],input[type=email],input[type=phone_number]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available}input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=phone_number]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=number].error,input[type=email].error,input[type=phone_number].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=number].error::placeholder,input[type=email].error::placeholder,input[type=phone_number].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=number]::placeholder,input[type=email]::placeholder,input[type=phone_number]::placeholder{color:var(--nylas-base-300)}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}'}}]); 2//# sourceMappingURL=7342.4eff68f1d8377222.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.