@getcredify/credify-insurance-widget 1.11.0 → 1.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/assets/{iframe-vkgKSRmN.js → iframe-DGJKVzYH.js} +22 -22
- package/dist/iframe/assets/{iframe-vkgKSRmN.js.map → iframe-DGJKVzYH.js.map} +1 -1
- package/dist/iframe/iframe.html +1 -1
- package/dist/index.es.js +710 -697
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +19 -19
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@import"https://fonts.googleapis.com/css2?family=Spline+Sans:wght@400;500;700&display=swap";/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */@layer properties,theme,base,components,utilities;@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-emerald-600:oklch(59.6% .145 163.225);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-2xl:42rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.z-0{z-index:0}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.col-span-full{grid-column:1/-1}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-mt-4{margin-top:calc(var(--spacing)*-4)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.h-5{height:calc(var(--spacing)*5)}.h-12{height:calc(var(--spacing)*12)}.h-full{height:100%}.max-h-60{max-height:calc(var(--spacing)*60)}.max-h-\\[90vh\\]{max-height:90vh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-screen{min-height:100vh}.\\!w-auto{width:auto!important}.w-5{width:calc(var(--spacing)*5)}.w-12{width:calc(var(--spacing)*12)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8\\.5rem\\]{min-width:8.5rem}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-items-center{justify-items:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.self-end{align-self:flex-end}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-\\[var\\(--accent-color\\)\\]{border-color:var(--accent-color)}.border-blue-300{border-color:var(--color-blue-300)}.border-blue-600{border-color:var(--color-blue-600)}.border-cyan-500{border-color:var(--color-cyan-500)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-red-500{border-color:var(--color-red-500)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-transparent{border-color:#0000}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-50\\/30{background-color:#eff6ff4d}@supports (color:color-mix(in lab,red,red)){.bg-blue-50\\/30{background-color:color-mix(in oklab,var(--color-blue-50)30%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.object-contain{object-fit:contain}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--text-primary\\)\\]{color:var(--text-primary)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-red-600{color:var(--color-red-600)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-blue-100\\/60{--tw-shadow-color:#dbeafe99}@supports (color:color-mix(in lab,red,red)){.shadow-blue-100\\/60{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-blue-100)60%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-100{--tw-ring-color:var(--color-blue-100)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.focus-within\\:border-\\[var\\(--primary-color\\)\\]:focus-within{border-color:var(--primary-color)}@media (hover:hover){.hover\\:bg-blue-600\\/90:hover{background-color:#155dfce6}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/90:hover{background-color:color-mix(in oklab,var(--color-blue-600)90%,transparent)}}.hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:text-blue-700:hover{color:var(--color-blue-700)}.hover\\:text-slate-600:hover{color:var(--color-slate-600)}.hover\\:text-slate-800:hover{color:var(--color-slate-800)}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-600\\/40:focus-visible{--tw-ring-color:#155dfc66}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-600\\/40:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-600)40%,transparent)}}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-slate-300:disabled{background-color:var(--color-slate-300)}.disabled\\:text-slate-500:disabled{color:var(--color-slate-500)}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.sm\\:max-w-\\[calc\\(\\(100\\%-1rem\\)\\/2\\)\\]{max-width:calc(50% - .5rem)}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}}:root{--primary-color:#006aff;--secondary-color:#f0f4ff;--background-color:#fff;--text-primary:#1a202c;--text-secondary:#718096;--accent-color:#e2e8f0;--radius-sm:.25rem;--radius-md:.5rem;--radius-lg:.75rem;--radius-xl:1rem;--radius-2xl:1.25rem;--radius-3xl:1.75rem;--radius-full:9999px;--radio-dot-svg:url("data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27%23006aff%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%274%27/%3e%3c/svg%3e");--select-button-svg:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24px' height='24px' fill='%23718096' viewBox='0 0 256 256'%3e%3cpath d='m215.39 92.94-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 1 1 11.32-11.32L128 154.06l74.07-72.44a8 8 0 0 1 11.32 11.32Z'/%3e%3c/svg%3e")}#insurance-widget-root,#root{color:var(--text-primary);font-family:Spline Sans,ui-sans-serif,system-ui,sans-serif}#insurance-widget-root .backdrop,#root .backdrop{background:#00000080;position:fixed;inset:0}#insurance-widget-root .modal-panel,#root .modal-panel{border-radius:var(--radius-2xl);padding:1.5rem;box-shadow:0 24px 64px -20px #00000059;background:#fff!important}@media (min-width:640px){#insurance-widget-root .modal-panel,#root .modal-panel{padding:2rem}}@media (min-width:768px){#insurance-widget-root .modal-panel,#root .modal-panel{padding:2.5rem}}@media (max-width:767px){#insurance-widget-root .modal-panel,#root .modal-panel{width:100%;max-width:none;height:100%;max-height:none;box-shadow:none;border-radius:0;position:fixed;inset:0}}#insurance-widget-root .h1-title,#root .h1-title{letter-spacing:-.01em;color:var(--text-primary);font-size:1.875rem;font-weight:700;line-height:2.25rem}@media (min-width:640px){#insurance-widget-root .h1-title,#root .h1-title{font-size:2.25rem;line-height:2.5rem}}#insurance-widget-root .p-subtitle,#root .p-subtitle{color:var(--text-secondary);margin-top:.5rem}#insurance-widget-root .form-label,#root .form-label{color:var(--text-secondary);margin-bottom:.5rem;font-size:.875rem;font-weight:500;display:block}#insurance-widget-root .form-input,#root .form-input{border-radius:var(--radius-lg);border:1px solid var(--accent-color);width:100%;color:var(--text-primary);background:#fff;outline:none;padding:.75rem 1rem;font-size:1rem;transition:box-shadow .15s,border-color .15s}#insurance-widget-root input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#insurance-widget-root input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#root input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#root input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#insurance-widget-root input[type=number],#root input[type=number]{-moz-appearance:textfield}#insurance-widget-root .form-input::placeholder,#root .form-input::placeholder{color:#94a3b8}#insurance-widget-root .form-input:focus,#root .form-input:focus{border-color:var(--primary-color);box-shadow:0 0 0 1px var(--primary-color)}#insurance-widget-root .select-caret,#root .select-caret{background-image:var(--select-button-svg);appearance:none;background-position:right .75rem center;background-repeat:no-repeat;background-size:1.25rem 1.25rem;padding-right:2.5rem}#insurance-widget-root .radio-card,#root .radio-card{border-radius:var(--radius-md);border:2px solid var(--accent-color);cursor:pointer;background:#fff;align-items:center;gap:.75rem;padding:1rem;transition:all .15s;display:flex}#insurance-widget-root .radio-card:hover,#root .radio-card:hover{border-color:#cfd8e3}#insurance-widget-root .radio-input,#root .radio-input{border:2px solid var(--accent-color);appearance:none;background:0 0;border-radius:9999px;outline:none;width:1.25rem;height:1.25rem}#insurance-widget-root .radio-input:checked,#root .radio-input:checked{border-color:var(--primary-color);background-image:var(--radio-dot-svg);background-position:50%;background-repeat:no-repeat}#insurance-widget-root .radio-card:has(.radio-input:checked),#root .radio-card:has(.radio-input:checked){border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color)}@supports (color:color-mix(in lab,red,red)){#insurance-widget-root .radio-card:has(.radio-input:checked),#root .radio-card:has(.radio-input:checked){box-shadow:0 0 0 2px color-mix(in oklab,var(--primary-color)20%,transparent)}}#insurance-widget-root .radio-label,#root .radio-label{color:var(--text-primary);font-size:1rem;font-weight:600}#insurance-widget-root .btn-primary,#root .btn-primary{border-radius:var(--radius-full);background:var(--primary-color);color:#fff;letter-spacing:.02em;justify-content:center;align-items:center;width:100%;height:3rem;font-weight:700;transition:opacity .15s;display:flex}#insurance-widget-root .btn-primary:hover,#root .btn-primary:hover{opacity:.9}#insurance-widget-root .btn-outline,#root .btn-outline{border-radius:var(--radius-full);width:100%;height:3rem;color:var(--text-primary);border:1px solid var(--accent-color);letter-spacing:.02em;background:#fff;justify-content:center;align-items:center;font-weight:700;transition:background .15s,color .15s,border-color .15s,opacity .15s;display:flex}#insurance-widget-root .btn-outline:hover,#root .btn-outline:hover{border-color:#cfd8e3}#insurance-widget-root .btn-primary,#root .btn-primary,#insurance-widget-root .btn-outline,#root .btn-outline{cursor:pointer}#insurance-widget-root .btn-primary:disabled,#root .btn-primary:disabled,#insurance-widget-root .btn-outline:disabled,#root .btn-outline:disabled{opacity:.5;cursor:not-allowed;filter:grayscale(20%)}#insurance-widget-root .btn-primary:not(:disabled):hover,#root .btn-primary:not(:disabled):hover{opacity:.95}#insurance-widget-root .btn-outline:not(:disabled):hover,#root .btn-outline:not(:disabled):hover{border-color:#cfd8e3}#insurance-widget-root .quote-btn,#root .quote-btn{background-color:var(--color-blue-600);padding-inline:calc(var(--spacing)*6);padding-block:calc(var(--spacing)*3);--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-white);--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));border-radius:3.40282e38px}@media (hover:hover){:is(#insurance-widget-root .quote-btn,#root .quote-btn):hover{background-color:var(--color-blue-700)}}#insurance-widget-root .input-error,#root .input-error{border-color:#dc2626!important;box-shadow:0 0 0 1px #dc2626!important}#insurance-widget-root .checkbox-card,#root .checkbox-card{border-radius:var(--radius-md);border:2px solid var(--accent-color);cursor:pointer;background:#fff;align-items:center;gap:.75rem;padding:1rem;transition:all .15s;display:flex}#insurance-widget-root .checkbox-card:hover,#root .checkbox-card:hover{border-color:#cfd8e3}#insurance-widget-root .checkbox-input,#root .checkbox-input{border:2px solid var(--accent-color);appearance:none;background:#fff;border-radius:.375rem;outline:none;place-items:center;width:1.25rem;height:1.25rem;display:grid}#insurance-widget-root .checkbox-input:checked,#root .checkbox-input:checked{border-color:var(--primary-color);background-color:var(--primary-color);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 24 24'%3e%3cpath d='M20.285 6.709a1 1 0 0 1 0 1.414l-9.192 9.193a1 1 0 0 1-1.414 0L3.715 11.55a1 1 0 1 1 1.414-1.414l5.05 5.05 8.485-8.478a1 1 0 0 1 1.621.001z'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat}#insurance-widget-root .checkbox-card:has(.checkbox-input:checked),#root .checkbox-card:has(.checkbox-input:checked){border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color)}@supports (color:color-mix(in lab,red,red)){#insurance-widget-root .checkbox-card:has(.checkbox-input:checked),#root .checkbox-card:has(.checkbox-input:checked){box-shadow:0 0 0 2px color-mix(in oklab,var(--primary-color)20%,transparent)}}#insurance-widget-root .checkbox-label,#root .checkbox-label{color:var(--text-primary);font-size:1rem;font-weight:600}#insurance-widget-root .modal-scroll,#root .modal-scroll{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;max-height:min(90dvh,800px);overflow-y:auto}#insurance-widget-root .modal-scroll .h1-title,#root .modal-scroll .h1-title{z-index:1;background:#fff;padding-top:.25rem;padding-bottom:.75rem;position:sticky;top:0}#insurance-widget-root .panel-body,#root .panel-body{padding:4px;scroll-padding:4px}#insurance-widget-root .tel-input-wrapper:focus-within:not(.error),#root .tel-input-wrapper:focus-within:not(.error){outline:1px solid var(--primary-color);outline-offset:0px;z-index:1}#insurance-widget-root .tel-input-wrapper.error,#root .tel-input-wrapper.error{outline-offset:0px;z-index:1;outline:1px solid #ef4444}#insurance-widget-root .tel-input-wrapper:focus-within:after,#root .tel-input-wrapper:focus-within:after{content:"";border:1px solid var(--primary-color);pointer-events:none;z-index:10;border-radius:.75rem;position:absolute;inset:-1px}#insurance-widget-root .tel-input-wrapper.error:after,#root .tel-input-wrapper.error:after{content:"";pointer-events:none;z-index:10;border:1px solid #ef4444;border-radius:.75rem;position:absolute;inset:-1px}#insurance-widget-root .form-label:has(+input[aria-required=true]):after,#root .form-label:has(+input[aria-required=true]):after,#insurance-widget-root .form-label:has(+select[aria-required=true]):after,#root .form-label:has(+select[aria-required=true]):after,#insurance-widget-root .form-label:has(+textarea[aria-required=true]):after,#root .form-label:has(+textarea[aria-required=true]):after,#insurance-widget-root .legend-required:after,#root .legend-required:after{content:" *";color:#dc2626;margin-left:.25rem}#insurance-widget-root .scrollbar-hide,#root .scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}#insurance-widget-root .scrollbar-hide::-webkit-scrollbar{display:none}#root .scrollbar-hide::-webkit-scrollbar{display:none}#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button],#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button],#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled,#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;color:#fff!important;background-color:#2563eb!important;min-height:3rem!important;display:flex!important;position:relative!important;overflow:visible!important}#insurance-widget-root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled,#root button.form-wizard-next-btn[data-widget-ctrl=next][type=button]:disabled{opacity:.5!important;background-color:#d1d5db!important}#insurance-widget-root .credify-link-underline,#root .credify-link-underline{color:var(--primary-color);text-decoration:underline}#insurance-widget-root .credify-link-underline:hover,#root .credify-link-underline:hover{color:#0052cc}#insurance-widget-root button.modal-close-btn[type=button],#root button.modal-close-btn[type=button]{appearance:none;background:0 0;border:none;padding:0;visibility:visible!important;opacity:1!important;cursor:pointer!important;clip-path:none!important;pointer-events:auto!important;display:inline-flex!important;overflow:visible!important}@media (max-width:767px){#insurance-widget-root button.modal-close-btn[type=button],#root button.modal-close-btn[type=button]{visibility:hidden!important;pointer-events:none!important;display:none!important}}#insurance-widget-root button.credify-btn-back[type=button],#root button.credify-btn-back[type=button],#insurance-widget-root button.credify-btn-back[type=button]:disabled,#root button.credify-btn-back[type=button]:disabled{transition:border-color .15s,background-color .15s;visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;box-sizing:border-box!important;border-radius:var(--radius-full)!important;color:#1a202c!important;text-align:center!important;cursor:pointer!important;background-color:#fff!important;border:1px solid #e2e8f0!important;place-content:center!important;place-items:center!important;height:3rem!important;min-height:3rem!important;margin:0!important;padding:0!important;font-size:1rem!important;font-weight:600!important;line-height:1!important;display:grid!important;overflow:visible!important}#insurance-widget-root button.credify-btn-back[type=button]:not(:disabled):hover,#root button.credify-btn-back[type=button]:not(:disabled):hover{background-color:#f9fafb!important;border-color:#cbd5e1!important}#insurance-widget-root button.credify-btn-back[type=button]:disabled,#root button.credify-btn-back[type=button]:disabled{opacity:.5!important;cursor:not-allowed!important;background-color:#f3f4f6!important}#insurance-widget-root button.credify-btn-back-rates[type=button],#root button.credify-btn-back-rates[type=button]{margin-top:2rem!important}#insurance-widget-root button.credify-retry-btn[type=button],#root button.credify-retry-btn[type=button]{cursor:pointer;font:inherit;border:none;visibility:visible!important;color:var(--text-primary)!important;clip-path:none!important;pointer-events:auto!important;background:0 0!important;text-decoration:underline!important;display:inline!important;overflow:visible!important}#insurance-widget-root button.rates-bind-btn[type=button],#root button.rates-bind-btn[type=button],#insurance-widget-root button.rates-bind-btn[type=button]:disabled,#root button.rates-bind-btn[type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;box-sizing:border-box!important;text-align:center!important;color:#fff!important;background-color:#2563eb!important;place-content:center!important;place-items:center!important;min-height:2.5rem!important;padding:0 1rem!important;line-height:1!important;display:grid!important;overflow:visible!important}#insurance-widget-root button.rates-bind-btn[type=button]:disabled,#root button.rates-bind-btn[type=button]:disabled{opacity:.5!important;background-color:#cbd5e1!important}#insurance-widget-root button.rates-bind-btn.rates-bind-btn-requested,#root button.rates-bind-btn.rates-bind-btn-requested{color:#fff!important;background-color:#10b981!important}#insurance-widget-root button.quote-btn[type=button],#root button.quote-btn[type=button]{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;color:#fff!important;background-color:#2563eb!important;display:inline-flex!important;overflow:visible!important}#insurance-widget-root a.credify-link-underline[href],#root a.credify-link-underline[href]{color:var(--primary-color);visibility:visible!important;clip-path:none!important;pointer-events:auto!important;text-decoration:underline!important;display:inline!important;overflow:visible!important}#insurance-widget-root input.form-input,#root input.form-input,#insurance-widget-root select.form-input,#root select.form-input,#insurance-widget-root textarea.form-input,#root textarea.form-input{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;display:block!important;overflow:visible!important}#insurance-widget-root button.btn-primary[type=button],#root button.btn-primary[type=button],#insurance-widget-root button.btn-primary[type=submit],#root button.btn-primary[type=submit],#insurance-widget-root button.btn-outline[type=button],#root button.btn-outline[type=button],#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled,#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{visibility:visible!important;opacity:1!important;clip-path:none!important;pointer-events:auto!important;min-height:3rem!important;display:flex!important;overflow:visible!important}#insurance-widget-root button.btn-primary[type=button],#root button.btn-primary[type=button],#insurance-widget-root button.btn-primary[type=submit],#root button.btn-primary[type=submit]{color:#fff!important;background-color:#2563eb!important}#insurance-widget-root button.btn-outline[type=button],#root button.btn-outline[type=button]{color:var(--text-primary)!important;border:1px solid var(--accent-color)!important;background-color:#fff!important}#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled,#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{opacity:.5!important}#insurance-widget-root button.btn-primary[type=button]:disabled,#root button.btn-primary[type=button]:disabled{color:#fff!important;background-color:#d1d5db!important}#insurance-widget-root button.btn-outline[type=button]:disabled,#root button.btn-outline[type=button]:disabled{color:var(--text-primary)!important;background-color:#f1f5f9!important}#insurance-widget-root .form-wizard-steps-header,#root .form-wizard-steps-header{visibility:visible!important;display:flex!important}#insurance-widget-root .form-wizard-steps,#root .form-wizard-steps{flex:1;align-items:center;gap:.5rem;min-width:0;margin:0;padding:0;font-size:.75rem;line-height:1rem;list-style:none;overflow-x:auto;display:flex!important}#insurance-widget-root .form-wizard-step-pill,#root .form-wizard-step-pill{white-space:nowrap;border:1px solid;border-radius:9999px;flex-shrink:0;padding:.25rem .625rem;visibility:visible!important;display:inline-flex!important}#insurance-widget-root .form-wizard-step-arrow,#root .form-wizard-step-arrow{color:#94a3b8;flex-shrink:0;visibility:visible!important;display:inline-flex!important}#insurance-widget-root .form-wizard-step-counter,#root .form-wizard-step-counter{color:#64748b;flex-shrink:0;font-size:.875rem;line-height:1.25rem;visibility:visible!important;display:block!important}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as ie, useRef as Te, useEffect as de, useMemo as be, useCallback as fr, createElement as Fo } from "react";
|
|
3
3
|
import { createRoot as Bo } from "react-dom/client";
|
|
4
|
-
import { jsxs as E, jsx as d, Fragment as
|
|
4
|
+
import { jsxs as E, jsx as d, Fragment as zt } from "react/jsx-runtime";
|
|
5
5
|
(function() {
|
|
6
6
|
if (typeof e > "u")
|
|
7
7
|
var e = { env: {} };
|
|
@@ -32,7 +32,7 @@ function Ur({ id: e, label: t, hint: r, error: n, required: o, className: i, ...
|
|
|
32
32
|
}
|
|
33
33
|
) });
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function nr({ id: e, label: t, hint: r, error: n, required: o, className: i, ...a }) {
|
|
36
36
|
return /* @__PURE__ */ d(xe, { id: e, label: t, hint: r, error: n, required: o, className: i, children: /* @__PURE__ */ d(
|
|
37
37
|
"input",
|
|
38
38
|
{
|
|
@@ -62,7 +62,7 @@ function zo({ id: e, label: t, hint: r, error: n, required: o, className: i, ...
|
|
|
62
62
|
}
|
|
63
63
|
) });
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function or(e) {
|
|
66
66
|
const t = e.replace(/\D/g, "");
|
|
67
67
|
if (t.length === 10)
|
|
68
68
|
return `(${t.slice(0, 3)}) ${t.slice(3, 6)} - ${t.slice(6)}`;
|
|
@@ -72,41 +72,41 @@ function nr(e) {
|
|
|
72
72
|
}
|
|
73
73
|
return t.length >= 6 ? `(${t.slice(0, 3)}) ${t.slice(3, 6)} - ${t.slice(6)}` : t.length >= 3 ? `(${t.slice(0, 3)}) ${t.slice(3)}` : t.length > 0 ? `(${t}` : t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ir(e) {
|
|
76
76
|
return e.replace(/\D/g, "");
|
|
77
77
|
}
|
|
78
78
|
function Uo({ id: e, label: t, hint: r, error: n, required: o, className: i, value: a = "", onChange: s, ...c }) {
|
|
79
|
-
const [l, u] =
|
|
79
|
+
const [l, u] = ie(""), m = Te(null), v = Te(0);
|
|
80
80
|
de(() => {
|
|
81
81
|
if (!a) {
|
|
82
82
|
u("");
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
let b =
|
|
85
|
+
let b = ir(a);
|
|
86
86
|
b.length === 11 && b.startsWith("1") && (b = b.slice(1));
|
|
87
87
|
const h = b.slice(0, 10);
|
|
88
|
-
u(
|
|
88
|
+
u(or(h));
|
|
89
89
|
}, [a]);
|
|
90
90
|
const g = (b) => {
|
|
91
91
|
const h = b.target, W = h.value;
|
|
92
92
|
v.current = h.selectionStart || 0;
|
|
93
|
-
const
|
|
94
|
-
u(
|
|
95
|
-
const
|
|
93
|
+
const te = ir(W).slice(0, 10), X = or(te);
|
|
94
|
+
u(X);
|
|
95
|
+
const G = te.length === 10 ? `+1${te}` : te, M = {
|
|
96
96
|
...b,
|
|
97
97
|
currentTarget: {
|
|
98
98
|
...b.currentTarget,
|
|
99
|
-
value:
|
|
99
|
+
value: G
|
|
100
100
|
},
|
|
101
101
|
target: {
|
|
102
102
|
...b.target,
|
|
103
|
-
value:
|
|
103
|
+
value: G
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
s?.(
|
|
106
|
+
s?.(M), setTimeout(() => {
|
|
107
107
|
if (m.current) {
|
|
108
|
-
const
|
|
109
|
-
m.current.setSelectionRange(
|
|
108
|
+
const $ = W.slice(0, v.current), I = ir($), re = or(I), O = Math.min(re.length, X.length);
|
|
109
|
+
m.current.setSelectionRange(O, O);
|
|
110
110
|
}
|
|
111
111
|
}, 0);
|
|
112
112
|
};
|
|
@@ -276,92 +276,92 @@ function Jo(e) {
|
|
|
276
276
|
}), t;
|
|
277
277
|
}
|
|
278
278
|
function qo({ id: e, label: t, hint: r, error: n, required: o, className: i, onChange: a, onPlaceSelect: s, value: c, ...l }) {
|
|
279
|
-
const u =
|
|
279
|
+
const u = Te(null), m = Te(null), v = Te(null), g = Te(null), [b, h] = ie(!0), [W, se] = ie(c || ""), [te, X] = ie([]), [G, M] = ie(!1), [$, I] = ie(-1), re = Te([]), O = Te(!1), Q = Te(-1);
|
|
280
280
|
de(() => {
|
|
281
|
-
|
|
282
|
-
}, [
|
|
283
|
-
|
|
284
|
-
}, [
|
|
285
|
-
|
|
286
|
-
}, [
|
|
287
|
-
c !== void 0 &&
|
|
281
|
+
re.current = te;
|
|
282
|
+
}, [te]), de(() => {
|
|
283
|
+
O.current = G;
|
|
284
|
+
}, [G]), de(() => {
|
|
285
|
+
Q.current = $;
|
|
286
|
+
}, [$]), de(() => {
|
|
287
|
+
c !== void 0 && se(String(c));
|
|
288
288
|
}, [c]);
|
|
289
|
-
const
|
|
289
|
+
const j = Te(null);
|
|
290
290
|
de(() => {
|
|
291
291
|
if (!u.current) return;
|
|
292
|
-
let
|
|
292
|
+
let U = !0;
|
|
293
293
|
return Ko().then(() => {
|
|
294
|
-
!
|
|
294
|
+
!U || !u.current || (m.current = new google.maps.places.AutocompleteService(), v.current = new google.maps.places.PlacesService(document.createElement("div")), h(!1));
|
|
295
295
|
}).catch((f) => {
|
|
296
296
|
console.error("Error loading Google Maps:", f), h(!1);
|
|
297
297
|
}), () => {
|
|
298
|
-
|
|
298
|
+
U = !1, j.current && clearTimeout(j.current);
|
|
299
299
|
};
|
|
300
300
|
}, []);
|
|
301
|
-
const
|
|
302
|
-
const f =
|
|
303
|
-
if (
|
|
304
|
-
|
|
301
|
+
const fe = (U) => {
|
|
302
|
+
const f = U.target.value;
|
|
303
|
+
if (se(f), a?.(f), j.current && clearTimeout(j.current), f.length < 3) {
|
|
304
|
+
X([]), M(!1);
|
|
305
305
|
return;
|
|
306
306
|
}
|
|
307
|
-
|
|
307
|
+
j.current = setTimeout(() => {
|
|
308
308
|
m.current && m.current.getPlacePredictions(
|
|
309
309
|
{
|
|
310
310
|
input: f,
|
|
311
311
|
types: ["address"]
|
|
312
312
|
},
|
|
313
|
-
(N,
|
|
314
|
-
|
|
313
|
+
(N, V) => {
|
|
314
|
+
V === google.maps.places.PlacesServiceStatus.OK && N ? (X(N), M(!0), I(-1)) : (X([]), M(!1));
|
|
315
315
|
}
|
|
316
316
|
);
|
|
317
317
|
}, 300);
|
|
318
|
-
},
|
|
319
|
-
if (!
|
|
320
|
-
|
|
318
|
+
}, ne = (U) => {
|
|
319
|
+
if (!O.current || re.current.length === 0) {
|
|
320
|
+
U.key === "Escape" && (M(!1), O.current = !1);
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
switch (
|
|
323
|
+
switch (U.key) {
|
|
324
324
|
case "ArrowDown":
|
|
325
|
-
|
|
326
|
-
const N = f <
|
|
327
|
-
return
|
|
325
|
+
U.preventDefault(), I((f) => {
|
|
326
|
+
const N = f < re.current.length - 1 ? f + 1 : f;
|
|
327
|
+
return Q.current = N, N;
|
|
328
328
|
});
|
|
329
329
|
break;
|
|
330
330
|
case "ArrowUp":
|
|
331
|
-
|
|
331
|
+
U.preventDefault(), I((f) => {
|
|
332
332
|
const N = f > 0 ? f - 1 : -1;
|
|
333
|
-
return
|
|
333
|
+
return Q.current = N, N;
|
|
334
334
|
});
|
|
335
335
|
break;
|
|
336
336
|
case "Enter":
|
|
337
|
-
|
|
337
|
+
U.preventDefault(), Q.current >= 0 && Q.current < re.current.length && ee(re.current[Q.current]);
|
|
338
338
|
break;
|
|
339
339
|
case "Escape":
|
|
340
|
-
|
|
340
|
+
U.preventDefault(), M(!1), O.current = !1;
|
|
341
341
|
break;
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
de(() => {
|
|
345
|
-
const
|
|
346
|
-
g.current && !g.current.contains(f.target) && u.current && !u.current.contains(f.target) && (
|
|
345
|
+
const U = (f) => {
|
|
346
|
+
g.current && !g.current.contains(f.target) && u.current && !u.current.contains(f.target) && (M(!1), O.current = !1);
|
|
347
347
|
};
|
|
348
|
-
if (
|
|
349
|
-
return document.addEventListener("mousedown",
|
|
350
|
-
document.removeEventListener("mousedown",
|
|
348
|
+
if (G)
|
|
349
|
+
return document.addEventListener("mousedown", U), () => {
|
|
350
|
+
document.removeEventListener("mousedown", U);
|
|
351
351
|
};
|
|
352
|
-
}, [
|
|
353
|
-
const
|
|
352
|
+
}, [G]);
|
|
353
|
+
const ee = (U) => {
|
|
354
354
|
v.current && v.current.getDetails(
|
|
355
355
|
{
|
|
356
|
-
placeId:
|
|
356
|
+
placeId: U.place_id,
|
|
357
357
|
fields: ["address_components", "formatted_address", "geometry"]
|
|
358
358
|
},
|
|
359
359
|
(f, N) => {
|
|
360
360
|
if (N === google.maps.places.PlacesServiceStatus.OK && f) {
|
|
361
|
-
const
|
|
362
|
-
|
|
361
|
+
const V = f.formatted_address || "";
|
|
362
|
+
se(V), M(!1), X([]), O.current = !1;
|
|
363
363
|
const F = Jo(f);
|
|
364
|
-
a?.(
|
|
364
|
+
a?.(V, F), s?.(f);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
);
|
|
@@ -375,8 +375,8 @@ function qo({ id: e, label: t, hint: r, error: n, required: o, className: i, onC
|
|
|
375
375
|
type: "text",
|
|
376
376
|
className: `form-input ${n ? "input-error" : ""}`,
|
|
377
377
|
value: W,
|
|
378
|
-
onChange:
|
|
379
|
-
onKeyDown:
|
|
378
|
+
onChange: fe,
|
|
379
|
+
onKeyDown: ne,
|
|
380
380
|
"aria-invalid": !!n,
|
|
381
381
|
"aria-describedby": [r ? `${e}-hint` : null, n ? `${e}-error` : null].filter(Boolean).join(" ") || void 0,
|
|
382
382
|
required: o,
|
|
@@ -387,26 +387,26 @@ function qo({ id: e, label: t, hint: r, error: n, required: o, className: i, onC
|
|
|
387
387
|
}
|
|
388
388
|
),
|
|
389
389
|
b && /* @__PURE__ */ d("p", { className: "mt-1 text-sm text-slate-500", children: "Loading address suggestions..." }),
|
|
390
|
-
|
|
390
|
+
G && te.length > 0 && /* @__PURE__ */ d(
|
|
391
391
|
"div",
|
|
392
392
|
{
|
|
393
393
|
ref: g,
|
|
394
394
|
className: "absolute z-50 w-full mt-1 bg-white border border-slate-200 rounded-lg shadow-lg max-h-60 overflow-y-auto",
|
|
395
395
|
role: "listbox",
|
|
396
|
-
children:
|
|
396
|
+
children: te.map((U, f) => /* @__PURE__ */ E(
|
|
397
397
|
"div",
|
|
398
398
|
{
|
|
399
|
-
className: `px-4 py-3 cursor-pointer transition-colors ${f ===
|
|
399
|
+
className: `px-4 py-3 cursor-pointer transition-colors ${f === $ ? "bg-blue-50 text-slate-900" : "bg-white text-slate-900 hover:bg-slate-50"} ${f < te.length - 1 ? "border-b border-slate-100" : ""}`,
|
|
400
400
|
role: "option",
|
|
401
|
-
"aria-selected": f ===
|
|
402
|
-
onClick: () =>
|
|
403
|
-
onMouseEnter: () =>
|
|
401
|
+
"aria-selected": f === $,
|
|
402
|
+
onClick: () => ee(U),
|
|
403
|
+
onMouseEnter: () => I(f),
|
|
404
404
|
children: [
|
|
405
|
-
/* @__PURE__ */ d("div", { className: "font-medium text-slate-900", children:
|
|
406
|
-
|
|
405
|
+
/* @__PURE__ */ d("div", { className: "font-medium text-slate-900", children: U.structured_formatting.main_text }),
|
|
406
|
+
U.structured_formatting.secondary_text && /* @__PURE__ */ d("div", { className: "text-sm text-slate-500 mt-0.5", children: U.structured_formatting.secondary_text })
|
|
407
407
|
]
|
|
408
408
|
},
|
|
409
|
-
|
|
409
|
+
U.place_id
|
|
410
410
|
))
|
|
411
411
|
}
|
|
412
412
|
)
|
|
@@ -505,7 +505,7 @@ function Qo(e, t) {
|
|
|
505
505
|
return a % s / 10 ** i;
|
|
506
506
|
}
|
|
507
507
|
const Zr = Symbol("evaluating");
|
|
508
|
-
function
|
|
508
|
+
function ae(e, t, r) {
|
|
509
509
|
let n;
|
|
510
510
|
Object.defineProperty(e, t, {
|
|
511
511
|
get() {
|
|
@@ -545,7 +545,7 @@ function Xo(e) {
|
|
|
545
545
|
}
|
|
546
546
|
const zn = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
547
547
|
};
|
|
548
|
-
function
|
|
548
|
+
function Ut(e) {
|
|
549
549
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
550
550
|
}
|
|
551
551
|
const ei = Nr(() => {
|
|
@@ -559,13 +559,13 @@ const ei = Nr(() => {
|
|
|
559
559
|
}
|
|
560
560
|
});
|
|
561
561
|
function vt(e) {
|
|
562
|
-
if (
|
|
562
|
+
if (Ut(e) === !1)
|
|
563
563
|
return !1;
|
|
564
564
|
const t = e.constructor;
|
|
565
565
|
if (t === void 0 || typeof t != "function")
|
|
566
566
|
return !0;
|
|
567
567
|
const r = t.prototype;
|
|
568
|
-
return !(
|
|
568
|
+
return !(Ut(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
|
|
569
569
|
}
|
|
570
570
|
function Un(e) {
|
|
571
571
|
return vt(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
@@ -825,7 +825,7 @@ const Ir = (e) => (t, r, n, o) => {
|
|
|
825
825
|
throw zn(s, o?.callee), s;
|
|
826
826
|
}
|
|
827
827
|
return a.value;
|
|
828
|
-
},
|
|
828
|
+
}, Yt = (e) => (t, r, n) => {
|
|
829
829
|
const o = n ? { ...n, async: !1 } : { async: !1 }, i = t._zod.run({ value: r, issues: [] }, o);
|
|
830
830
|
if (i instanceof Promise)
|
|
831
831
|
throw new it();
|
|
@@ -833,26 +833,26 @@ const Ir = (e) => (t, r, n, o) => {
|
|
|
833
833
|
success: !1,
|
|
834
834
|
error: new (e ?? jn)(i.issues.map((a) => Qe(a, o, qe())))
|
|
835
835
|
} : { success: !0, data: i.value };
|
|
836
|
-
}, fi = /* @__PURE__ */
|
|
836
|
+
}, fi = /* @__PURE__ */ Yt(Wn), Kt = (e) => async (t, r, n) => {
|
|
837
837
|
const o = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
|
838
838
|
let i = t._zod.run({ value: r, issues: [] }, o);
|
|
839
839
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
840
840
|
success: !1,
|
|
841
841
|
error: new e(i.issues.map((a) => Qe(a, o, qe())))
|
|
842
842
|
} : { success: !0, data: i.value };
|
|
843
|
-
}, mi = /* @__PURE__ */
|
|
843
|
+
}, mi = /* @__PURE__ */ Kt(Wn), pi = (e) => (t, r, n) => {
|
|
844
844
|
const o = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
845
845
|
return Ir(e)(t, r, o);
|
|
846
846
|
}, hi = (e) => (t, r, n) => Ir(e)(t, r, n), gi = (e) => async (t, r, n) => {
|
|
847
847
|
const o = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
848
848
|
return Lr(e)(t, r, o);
|
|
849
849
|
}, yi = (e) => async (t, r, n) => Lr(e)(t, r, n), vi = (e) => (t, r, n) => {
|
|
850
|
-
const o = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
851
|
-
return Vt(e)(t, r, o);
|
|
852
|
-
}, bi = (e) => (t, r, n) => Vt(e)(t, r, n), Si = (e) => async (t, r, n) => {
|
|
853
850
|
const o = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
854
851
|
return Yt(e)(t, r, o);
|
|
855
|
-
},
|
|
852
|
+
}, bi = (e) => (t, r, n) => Yt(e)(t, r, n), Si = (e) => async (t, r, n) => {
|
|
853
|
+
const o = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
854
|
+
return Kt(e)(t, r, o);
|
|
855
|
+
}, wi = (e) => async (t, r, n) => Kt(e)(t, r, n), Ci = /^[cC][^\s-]{8,}$/, Ai = /^[0-9a-z]+$/, Ti = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Ni = /^[0-9a-vA-V]{20}$/, Ei = /^[A-Za-z0-9]{27}$/, ki = /^[a-zA-Z0-9_-]{21}$/, Oi = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Ii = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Wr = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Li = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Mi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
856
856
|
function Ri() {
|
|
857
857
|
return new RegExp(Mi, "u");
|
|
858
858
|
}
|
|
@@ -1060,7 +1060,7 @@ const Zi = (e) => {
|
|
|
1060
1060
|
continue: !t.abort
|
|
1061
1061
|
});
|
|
1062
1062
|
};
|
|
1063
|
-
}),
|
|
1063
|
+
}), Jt = /* @__PURE__ */ p("$ZodCheckStringFormat", (e, t) => {
|
|
1064
1064
|
var r, n;
|
|
1065
1065
|
Le.init(e, t), e._zod.onattach.push((o) => {
|
|
1066
1066
|
const i = o._zod.bag;
|
|
@@ -1078,7 +1078,7 @@ const Zi = (e) => {
|
|
|
1078
1078
|
}) : (n = e._zod).check ?? (n.check = () => {
|
|
1079
1079
|
});
|
|
1080
1080
|
}), ea = /* @__PURE__ */ p("$ZodCheckRegex", (e, t) => {
|
|
1081
|
-
|
|
1081
|
+
Jt.init(e, t), e._zod.check = (r) => {
|
|
1082
1082
|
t.pattern.lastIndex = 0, !t.pattern.test(r.value) && r.issues.push({
|
|
1083
1083
|
origin: "string",
|
|
1084
1084
|
code: "invalid_format",
|
|
@@ -1090,9 +1090,9 @@ const Zi = (e) => {
|
|
|
1090
1090
|
});
|
|
1091
1091
|
};
|
|
1092
1092
|
}), ta = /* @__PURE__ */ p("$ZodCheckLowerCase", (e, t) => {
|
|
1093
|
-
t.pattern ?? (t.pattern = Vi),
|
|
1093
|
+
t.pattern ?? (t.pattern = Vi), Jt.init(e, t);
|
|
1094
1094
|
}), ra = /* @__PURE__ */ p("$ZodCheckUpperCase", (e, t) => {
|
|
1095
|
-
t.pattern ?? (t.pattern = Yi),
|
|
1095
|
+
t.pattern ?? (t.pattern = Yi), Jt.init(e, t);
|
|
1096
1096
|
}), na = /* @__PURE__ */ p("$ZodCheckIncludes", (e, t) => {
|
|
1097
1097
|
Le.init(e, t);
|
|
1098
1098
|
const r = st(t.includes), n = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${r}` : r);
|
|
@@ -1238,7 +1238,7 @@ const ca = {
|
|
|
1238
1238
|
return o(c, n, s);
|
|
1239
1239
|
};
|
|
1240
1240
|
}
|
|
1241
|
-
|
|
1241
|
+
ae(e, "~standard", () => ({
|
|
1242
1242
|
validate: (o) => {
|
|
1243
1243
|
try {
|
|
1244
1244
|
const i = fi(e, o);
|
|
@@ -1264,10 +1264,10 @@ const ca = {
|
|
|
1264
1264
|
inst: e
|
|
1265
1265
|
}), r;
|
|
1266
1266
|
};
|
|
1267
|
-
}),
|
|
1268
|
-
|
|
1267
|
+
}), me = /* @__PURE__ */ p("$ZodStringFormat", (e, t) => {
|
|
1268
|
+
Jt.init(e, t), Mr.init(e, t);
|
|
1269
1269
|
}), la = /* @__PURE__ */ p("$ZodGUID", (e, t) => {
|
|
1270
|
-
t.pattern ?? (t.pattern = Ii),
|
|
1270
|
+
t.pattern ?? (t.pattern = Ii), me.init(e, t);
|
|
1271
1271
|
}), ua = /* @__PURE__ */ p("$ZodUUID", (e, t) => {
|
|
1272
1272
|
if (t.version) {
|
|
1273
1273
|
const n = {
|
|
@@ -1285,11 +1285,11 @@ const ca = {
|
|
|
1285
1285
|
t.pattern ?? (t.pattern = Wr(n));
|
|
1286
1286
|
} else
|
|
1287
1287
|
t.pattern ?? (t.pattern = Wr());
|
|
1288
|
-
|
|
1288
|
+
me.init(e, t);
|
|
1289
1289
|
}), da = /* @__PURE__ */ p("$ZodEmail", (e, t) => {
|
|
1290
|
-
t.pattern ?? (t.pattern = Li),
|
|
1290
|
+
t.pattern ?? (t.pattern = Li), me.init(e, t);
|
|
1291
1291
|
}), _a = /* @__PURE__ */ p("$ZodURL", (e, t) => {
|
|
1292
|
-
|
|
1292
|
+
me.init(e, t), e._zod.check = (r) => {
|
|
1293
1293
|
try {
|
|
1294
1294
|
const n = r.value.trim(), o = new URL(n);
|
|
1295
1295
|
t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || r.issues.push({
|
|
@@ -1321,31 +1321,31 @@ const ca = {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
};
|
|
1323
1323
|
}), fa = /* @__PURE__ */ p("$ZodEmoji", (e, t) => {
|
|
1324
|
-
t.pattern ?? (t.pattern = Ri()),
|
|
1324
|
+
t.pattern ?? (t.pattern = Ri()), me.init(e, t);
|
|
1325
1325
|
}), ma = /* @__PURE__ */ p("$ZodNanoID", (e, t) => {
|
|
1326
|
-
t.pattern ?? (t.pattern = ki),
|
|
1326
|
+
t.pattern ?? (t.pattern = ki), me.init(e, t);
|
|
1327
1327
|
}), pa = /* @__PURE__ */ p("$ZodCUID", (e, t) => {
|
|
1328
|
-
t.pattern ?? (t.pattern = Ci),
|
|
1328
|
+
t.pattern ?? (t.pattern = Ci), me.init(e, t);
|
|
1329
1329
|
}), ha = /* @__PURE__ */ p("$ZodCUID2", (e, t) => {
|
|
1330
|
-
t.pattern ?? (t.pattern = Ai),
|
|
1330
|
+
t.pattern ?? (t.pattern = Ai), me.init(e, t);
|
|
1331
1331
|
}), ga = /* @__PURE__ */ p("$ZodULID", (e, t) => {
|
|
1332
|
-
t.pattern ?? (t.pattern = Ti),
|
|
1332
|
+
t.pattern ?? (t.pattern = Ti), me.init(e, t);
|
|
1333
1333
|
}), ya = /* @__PURE__ */ p("$ZodXID", (e, t) => {
|
|
1334
|
-
t.pattern ?? (t.pattern = Ni),
|
|
1334
|
+
t.pattern ?? (t.pattern = Ni), me.init(e, t);
|
|
1335
1335
|
}), va = /* @__PURE__ */ p("$ZodKSUID", (e, t) => {
|
|
1336
|
-
t.pattern ?? (t.pattern = Ei),
|
|
1336
|
+
t.pattern ?? (t.pattern = Ei), me.init(e, t);
|
|
1337
1337
|
}), ba = /* @__PURE__ */ p("$ZodISODateTime", (e, t) => {
|
|
1338
|
-
t.pattern ?? (t.pattern = Hi(t)),
|
|
1338
|
+
t.pattern ?? (t.pattern = Hi(t)), me.init(e, t);
|
|
1339
1339
|
}), Sa = /* @__PURE__ */ p("$ZodISODate", (e, t) => {
|
|
1340
|
-
t.pattern ?? (t.pattern = zi),
|
|
1340
|
+
t.pattern ?? (t.pattern = zi), me.init(e, t);
|
|
1341
1341
|
}), wa = /* @__PURE__ */ p("$ZodISOTime", (e, t) => {
|
|
1342
|
-
t.pattern ?? (t.pattern = Ui(t)),
|
|
1342
|
+
t.pattern ?? (t.pattern = Ui(t)), me.init(e, t);
|
|
1343
1343
|
}), Ca = /* @__PURE__ */ p("$ZodISODuration", (e, t) => {
|
|
1344
|
-
t.pattern ?? (t.pattern = Oi),
|
|
1344
|
+
t.pattern ?? (t.pattern = Oi), me.init(e, t);
|
|
1345
1345
|
}), Aa = /* @__PURE__ */ p("$ZodIPv4", (e, t) => {
|
|
1346
|
-
t.pattern ?? (t.pattern = Di),
|
|
1346
|
+
t.pattern ?? (t.pattern = Di), me.init(e, t), e._zod.bag.format = "ipv4";
|
|
1347
1347
|
}), Ta = /* @__PURE__ */ p("$ZodIPv6", (e, t) => {
|
|
1348
|
-
t.pattern ?? (t.pattern = Pi),
|
|
1348
|
+
t.pattern ?? (t.pattern = Pi), me.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (r) => {
|
|
1349
1349
|
try {
|
|
1350
1350
|
new URL(`http://[${r.value}]`);
|
|
1351
1351
|
} catch {
|
|
@@ -1359,9 +1359,9 @@ const ca = {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
};
|
|
1361
1361
|
}), Na = /* @__PURE__ */ p("$ZodCIDRv4", (e, t) => {
|
|
1362
|
-
t.pattern ?? (t.pattern = $i),
|
|
1362
|
+
t.pattern ?? (t.pattern = $i), me.init(e, t);
|
|
1363
1363
|
}), Ea = /* @__PURE__ */ p("$ZodCIDRv6", (e, t) => {
|
|
1364
|
-
t.pattern ?? (t.pattern = xi),
|
|
1364
|
+
t.pattern ?? (t.pattern = xi), me.init(e, t), e._zod.check = (r) => {
|
|
1365
1365
|
const n = r.value.split("/");
|
|
1366
1366
|
try {
|
|
1367
1367
|
if (n.length !== 2)
|
|
@@ -1398,7 +1398,7 @@ function Qn(e) {
|
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
1400
|
const ka = /* @__PURE__ */ p("$ZodBase64", (e, t) => {
|
|
1401
|
-
t.pattern ?? (t.pattern = Fi),
|
|
1401
|
+
t.pattern ?? (t.pattern = Fi), me.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (r) => {
|
|
1402
1402
|
Qn(r.value) || r.issues.push({
|
|
1403
1403
|
code: "invalid_format",
|
|
1404
1404
|
format: "base64",
|
|
@@ -1415,7 +1415,7 @@ function Oa(e) {
|
|
|
1415
1415
|
return Qn(r);
|
|
1416
1416
|
}
|
|
1417
1417
|
const Ia = /* @__PURE__ */ p("$ZodBase64URL", (e, t) => {
|
|
1418
|
-
t.pattern ?? (t.pattern = Gn),
|
|
1418
|
+
t.pattern ?? (t.pattern = Gn), me.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (r) => {
|
|
1419
1419
|
Oa(r.value) || r.issues.push({
|
|
1420
1420
|
code: "invalid_format",
|
|
1421
1421
|
format: "base64url",
|
|
@@ -1425,7 +1425,7 @@ const Ia = /* @__PURE__ */ p("$ZodBase64URL", (e, t) => {
|
|
|
1425
1425
|
});
|
|
1426
1426
|
};
|
|
1427
1427
|
}), La = /* @__PURE__ */ p("$ZodE164", (e, t) => {
|
|
1428
|
-
t.pattern ?? (t.pattern = Bi),
|
|
1428
|
+
t.pattern ?? (t.pattern = Bi), me.init(e, t);
|
|
1429
1429
|
});
|
|
1430
1430
|
function Ma(e, t = null) {
|
|
1431
1431
|
try {
|
|
@@ -1442,7 +1442,7 @@ function Ma(e, t = null) {
|
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
const Ra = /* @__PURE__ */ p("$ZodJWT", (e, t) => {
|
|
1445
|
-
|
|
1445
|
+
me.init(e, t), e._zod.check = (r) => {
|
|
1446
1446
|
Ma(r.value, t.alg) || r.issues.push({
|
|
1447
1447
|
code: "invalid_format",
|
|
1448
1448
|
format: "jwt",
|
|
@@ -1522,7 +1522,7 @@ const Fa = /* @__PURE__ */ p("$ZodArray", (e, t) => {
|
|
|
1522
1522
|
return i.length ? Promise.all(i).then(() => r) : r;
|
|
1523
1523
|
};
|
|
1524
1524
|
});
|
|
1525
|
-
function
|
|
1525
|
+
function Ht(e, t, r, n, o) {
|
|
1526
1526
|
if (e.issues.length) {
|
|
1527
1527
|
if (o && !(r in n))
|
|
1528
1528
|
return;
|
|
@@ -1554,7 +1554,7 @@ function to(e, t, r, n, o, i) {
|
|
|
1554
1554
|
continue;
|
|
1555
1555
|
}
|
|
1556
1556
|
const v = c.run({ value: t[m], issues: [] }, n);
|
|
1557
|
-
v instanceof Promise ? e.push(v.then((g) =>
|
|
1557
|
+
v instanceof Promise ? e.push(v.then((g) => Ht(g, r, m, t, u))) : Ht(v, r, m, t, u);
|
|
1558
1558
|
}
|
|
1559
1559
|
return a.length && r.issues.push({
|
|
1560
1560
|
code: "unrecognized_keys",
|
|
@@ -1576,7 +1576,7 @@ const Ba = /* @__PURE__ */ p("$ZodObject", (e, t) => {
|
|
|
1576
1576
|
});
|
|
1577
1577
|
}
|
|
1578
1578
|
const n = Nr(() => eo(t));
|
|
1579
|
-
|
|
1579
|
+
ae(e._zod, "propValues", () => {
|
|
1580
1580
|
const s = t.shape, c = {};
|
|
1581
1581
|
for (const l in s) {
|
|
1582
1582
|
const u = s[l]._zod;
|
|
@@ -1588,7 +1588,7 @@ const Ba = /* @__PURE__ */ p("$ZodObject", (e, t) => {
|
|
|
1588
1588
|
}
|
|
1589
1589
|
return c;
|
|
1590
1590
|
});
|
|
1591
|
-
const o =
|
|
1591
|
+
const o = Ut, i = t.catchall;
|
|
1592
1592
|
let a;
|
|
1593
1593
|
e._zod.parse = (s, c) => {
|
|
1594
1594
|
a ?? (a = n.value);
|
|
@@ -1604,67 +1604,67 @@ const Ba = /* @__PURE__ */ p("$ZodObject", (e, t) => {
|
|
|
1604
1604
|
const u = [], m = a.shape;
|
|
1605
1605
|
for (const v of a.keys) {
|
|
1606
1606
|
const g = m[v], b = g._zod.optout === "optional", h = g._zod.run({ value: l[v], issues: [] }, c);
|
|
1607
|
-
h instanceof Promise ? u.push(h.then((W) =>
|
|
1607
|
+
h instanceof Promise ? u.push(h.then((W) => Ht(W, s, v, l, b))) : Ht(h, s, v, l, b);
|
|
1608
1608
|
}
|
|
1609
1609
|
return i ? to(u, l, s, c, n.value, e) : u.length ? Promise.all(u).then(() => s) : s;
|
|
1610
1610
|
};
|
|
1611
1611
|
}), za = /* @__PURE__ */ p("$ZodObjectJIT", (e, t) => {
|
|
1612
1612
|
Ba.init(e, t);
|
|
1613
1613
|
const r = e._zod.parse, n = Nr(() => eo(t)), o = (v) => {
|
|
1614
|
-
const g = new sa(["shape", "payload", "ctx"]), b = n.value, h = (
|
|
1615
|
-
const
|
|
1616
|
-
return `shape[${
|
|
1614
|
+
const g = new sa(["shape", "payload", "ctx"]), b = n.value, h = (X) => {
|
|
1615
|
+
const G = jr(X);
|
|
1616
|
+
return `shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`;
|
|
1617
1617
|
};
|
|
1618
1618
|
g.write("const input = payload.value;");
|
|
1619
1619
|
const W = /* @__PURE__ */ Object.create(null);
|
|
1620
|
-
let
|
|
1621
|
-
for (const
|
|
1622
|
-
W[
|
|
1620
|
+
let se = 0;
|
|
1621
|
+
for (const X of b.keys)
|
|
1622
|
+
W[X] = `key_${se++}`;
|
|
1623
1623
|
g.write("const newResult = {};");
|
|
1624
|
-
for (const
|
|
1625
|
-
const
|
|
1626
|
-
g.write(`const ${
|
|
1627
|
-
if (${
|
|
1628
|
-
if (${
|
|
1629
|
-
payload.issues = payload.issues.concat(${
|
|
1624
|
+
for (const X of b.keys) {
|
|
1625
|
+
const G = W[X], M = jr(X), I = v[X]?._zod?.optout === "optional";
|
|
1626
|
+
g.write(`const ${G} = ${h(X)};`), I ? g.write(`
|
|
1627
|
+
if (${G}.issues.length) {
|
|
1628
|
+
if (${M} in input) {
|
|
1629
|
+
payload.issues = payload.issues.concat(${G}.issues.map(iss => ({
|
|
1630
1630
|
...iss,
|
|
1631
|
-
path: iss.path ? [${
|
|
1631
|
+
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
1632
1632
|
})));
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
1636
|
-
if (${
|
|
1637
|
-
if (${
|
|
1638
|
-
newResult[${
|
|
1636
|
+
if (${G}.value === undefined) {
|
|
1637
|
+
if (${M} in input) {
|
|
1638
|
+
newResult[${M}] = undefined;
|
|
1639
1639
|
}
|
|
1640
1640
|
} else {
|
|
1641
|
-
newResult[${
|
|
1641
|
+
newResult[${M}] = ${G}.value;
|
|
1642
1642
|
}
|
|
1643
1643
|
|
|
1644
1644
|
`) : g.write(`
|
|
1645
|
-
if (${
|
|
1646
|
-
payload.issues = payload.issues.concat(${
|
|
1645
|
+
if (${G}.issues.length) {
|
|
1646
|
+
payload.issues = payload.issues.concat(${G}.issues.map(iss => ({
|
|
1647
1647
|
...iss,
|
|
1648
|
-
path: iss.path ? [${
|
|
1648
|
+
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
1649
1649
|
})));
|
|
1650
1650
|
}
|
|
1651
1651
|
|
|
1652
|
-
if (${
|
|
1653
|
-
if (${
|
|
1654
|
-
newResult[${
|
|
1652
|
+
if (${G}.value === undefined) {
|
|
1653
|
+
if (${M} in input) {
|
|
1654
|
+
newResult[${M}] = undefined;
|
|
1655
1655
|
}
|
|
1656
1656
|
} else {
|
|
1657
|
-
newResult[${
|
|
1657
|
+
newResult[${M}] = ${G}.value;
|
|
1658
1658
|
}
|
|
1659
1659
|
|
|
1660
1660
|
`);
|
|
1661
1661
|
}
|
|
1662
1662
|
g.write("payload.value = newResult;"), g.write("return payload;");
|
|
1663
|
-
const
|
|
1664
|
-
return (
|
|
1663
|
+
const te = g.compile();
|
|
1664
|
+
return (X, G) => te(v, X, G);
|
|
1665
1665
|
};
|
|
1666
1666
|
let i;
|
|
1667
|
-
const a =
|
|
1667
|
+
const a = Ut, s = !Fn.jitless, l = s && ei.value, u = t.catchall;
|
|
1668
1668
|
let m;
|
|
1669
1669
|
e._zod.parse = (v, g) => {
|
|
1670
1670
|
m ?? (m = n.value);
|
|
@@ -1690,10 +1690,10 @@ function Vr(e, t, r, n) {
|
|
|
1690
1690
|
}), t);
|
|
1691
1691
|
}
|
|
1692
1692
|
const Ua = /* @__PURE__ */ p("$ZodUnion", (e, t) => {
|
|
1693
|
-
ge.init(e, t),
|
|
1693
|
+
ge.init(e, t), ae(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), ae(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), ae(e._zod, "values", () => {
|
|
1694
1694
|
if (t.options.every((o) => o._zod.values))
|
|
1695
1695
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1696
|
-
}),
|
|
1696
|
+
}), ae(e._zod, "pattern", () => {
|
|
1697
1697
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
1698
1698
|
const o = t.options.map((i) => i._zod.pattern);
|
|
1699
1699
|
return new RegExp(`^(${o.map((i) => kr(i.source)).join("|")})$`);
|
|
@@ -1826,7 +1826,7 @@ function Kr(e, t) {
|
|
|
1826
1826
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1827
1827
|
}
|
|
1828
1828
|
const ro = /* @__PURE__ */ p("$ZodOptional", (e, t) => {
|
|
1829
|
-
ge.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional",
|
|
1829
|
+
ge.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", ae(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), ae(e._zod, "pattern", () => {
|
|
1830
1830
|
const r = t.innerType._zod.pattern;
|
|
1831
1831
|
return r ? new RegExp(`^(${kr(r.source)})?$`) : void 0;
|
|
1832
1832
|
}), e._zod.parse = (r, n) => {
|
|
@@ -1837,14 +1837,14 @@ const ro = /* @__PURE__ */ p("$ZodOptional", (e, t) => {
|
|
|
1837
1837
|
return r.value === void 0 ? r : t.innerType._zod.run(r, n);
|
|
1838
1838
|
};
|
|
1839
1839
|
}), Ga = /* @__PURE__ */ p("$ZodExactOptional", (e, t) => {
|
|
1840
|
-
ro.init(e, t),
|
|
1840
|
+
ro.init(e, t), ae(e._zod, "values", () => t.innerType._zod.values), ae(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (r, n) => t.innerType._zod.run(r, n);
|
|
1841
1841
|
}), Va = /* @__PURE__ */ p("$ZodNullable", (e, t) => {
|
|
1842
|
-
ge.init(e, t),
|
|
1842
|
+
ge.init(e, t), ae(e._zod, "optin", () => t.innerType._zod.optin), ae(e._zod, "optout", () => t.innerType._zod.optout), ae(e._zod, "pattern", () => {
|
|
1843
1843
|
const r = t.innerType._zod.pattern;
|
|
1844
1844
|
return r ? new RegExp(`^(${kr(r.source)}|null)$`) : void 0;
|
|
1845
|
-
}),
|
|
1845
|
+
}), ae(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (r, n) => r.value === null ? r : t.innerType._zod.run(r, n);
|
|
1846
1846
|
}), Ya = /* @__PURE__ */ p("$ZodDefault", (e, t) => {
|
|
1847
|
-
ge.init(e, t), e._zod.optin = "optional",
|
|
1847
|
+
ge.init(e, t), e._zod.optin = "optional", ae(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1848
1848
|
if (n.direction === "backward")
|
|
1849
1849
|
return t.innerType._zod.run(r, n);
|
|
1850
1850
|
if (r.value === void 0)
|
|
@@ -1857,9 +1857,9 @@ function Jr(e, t) {
|
|
|
1857
1857
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1858
1858
|
}
|
|
1859
1859
|
const Ka = /* @__PURE__ */ p("$ZodPrefault", (e, t) => {
|
|
1860
|
-
ge.init(e, t), e._zod.optin = "optional",
|
|
1860
|
+
ge.init(e, t), e._zod.optin = "optional", ae(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => (n.direction === "backward" || r.value === void 0 && (r.value = t.defaultValue), t.innerType._zod.run(r, n));
|
|
1861
1861
|
}), Ja = /* @__PURE__ */ p("$ZodNonOptional", (e, t) => {
|
|
1862
|
-
ge.init(e, t),
|
|
1862
|
+
ge.init(e, t), ae(e._zod, "values", () => {
|
|
1863
1863
|
const r = t.innerType._zod.values;
|
|
1864
1864
|
return r ? new Set([...r].filter((n) => n !== void 0)) : void 0;
|
|
1865
1865
|
}), e._zod.parse = (r, n) => {
|
|
@@ -1876,7 +1876,7 @@ function qr(e, t) {
|
|
|
1876
1876
|
}), e;
|
|
1877
1877
|
}
|
|
1878
1878
|
const qa = /* @__PURE__ */ p("$ZodCatch", (e, t) => {
|
|
1879
|
-
ge.init(e, t),
|
|
1879
|
+
ge.init(e, t), ae(e._zod, "optin", () => t.innerType._zod.optin), ae(e._zod, "optout", () => t.innerType._zod.optout), ae(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1880
1880
|
if (n.direction === "backward")
|
|
1881
1881
|
return t.innerType._zod.run(r, n);
|
|
1882
1882
|
const o = t.innerType._zod.run(r, n);
|
|
@@ -1895,7 +1895,7 @@ const qa = /* @__PURE__ */ p("$ZodCatch", (e, t) => {
|
|
|
1895
1895
|
}), r.issues = []), r);
|
|
1896
1896
|
};
|
|
1897
1897
|
}), Qa = /* @__PURE__ */ p("$ZodPipe", (e, t) => {
|
|
1898
|
-
ge.init(e, t),
|
|
1898
|
+
ge.init(e, t), ae(e._zod, "values", () => t.in._zod.values), ae(e._zod, "optin", () => t.in._zod.optin), ae(e._zod, "optout", () => t.out._zod.optout), ae(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (r, n) => {
|
|
1899
1899
|
if (n.direction === "backward") {
|
|
1900
1900
|
const i = t.out._zod.run(r, n);
|
|
1901
1901
|
return i instanceof Promise ? i.then((a) => Nt(a, t.in, n)) : Nt(i, t.in, n);
|
|
@@ -1908,7 +1908,7 @@ function Nt(e, t, r) {
|
|
|
1908
1908
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, r);
|
|
1909
1909
|
}
|
|
1910
1910
|
const Xa = /* @__PURE__ */ p("$ZodReadonly", (e, t) => {
|
|
1911
|
-
ge.init(e, t),
|
|
1911
|
+
ge.init(e, t), ae(e._zod, "propValues", () => t.innerType._zod.propValues), ae(e._zod, "values", () => t.innerType._zod.values), ae(e._zod, "optin", () => t.innerType?._zod?.optin), ae(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (r, n) => {
|
|
1912
1912
|
if (n.direction === "backward")
|
|
1913
1913
|
return t.innerType._zod.run(r, n);
|
|
1914
1914
|
const o = t.innerType._zod.run(r, n);
|
|
@@ -2295,7 +2295,7 @@ function rn(e, t) {
|
|
|
2295
2295
|
});
|
|
2296
2296
|
}
|
|
2297
2297
|
// @__NO_SIDE_EFFECTS__
|
|
2298
|
-
function
|
|
2298
|
+
function ar(e, t) {
|
|
2299
2299
|
return new Jn({
|
|
2300
2300
|
check: "less_than",
|
|
2301
2301
|
...R(t),
|
|
@@ -2313,7 +2313,7 @@ function nn(e, t) {
|
|
|
2313
2313
|
});
|
|
2314
2314
|
}
|
|
2315
2315
|
// @__NO_SIDE_EFFECTS__
|
|
2316
|
-
function
|
|
2316
|
+
function sr(e, t) {
|
|
2317
2317
|
return new qn({
|
|
2318
2318
|
check: "greater_than",
|
|
2319
2319
|
...R(t),
|
|
@@ -2338,7 +2338,7 @@ function no(e, t) {
|
|
|
2338
2338
|
});
|
|
2339
2339
|
}
|
|
2340
2340
|
// @__NO_SIDE_EFFECTS__
|
|
2341
|
-
function
|
|
2341
|
+
function Zt(e, t) {
|
|
2342
2342
|
return new Qi({
|
|
2343
2343
|
check: "min_length",
|
|
2344
2344
|
...R(t),
|
|
@@ -2489,7 +2489,7 @@ function io(e) {
|
|
|
2489
2489
|
external: e?.external ?? void 0
|
|
2490
2490
|
};
|
|
2491
2491
|
}
|
|
2492
|
-
function
|
|
2492
|
+
function Ne(e, t, r = { path: [], schemaPath: [] }) {
|
|
2493
2493
|
var n;
|
|
2494
2494
|
const o = e._zod.def, i = t.seen.get(e);
|
|
2495
2495
|
if (i)
|
|
@@ -2514,7 +2514,7 @@ function Te(e, t, r = { path: [], schemaPath: [] }) {
|
|
|
2514
2514
|
g(e, t, v, u);
|
|
2515
2515
|
}
|
|
2516
2516
|
const m = e._zod.parent;
|
|
2517
|
-
m && (a.ref || (a.ref = m),
|
|
2517
|
+
m && (a.ref || (a.ref = m), Ne(m, t, u), t.seen.get(m).isParent = !0);
|
|
2518
2518
|
}
|
|
2519
2519
|
const c = t.metadataRegistry.get(e);
|
|
2520
2520
|
return c && Object.assign(a.schema, c), t.io === "input" && Oe(e) && (delete a.schema.examples, delete a.schema.default), t.io === "input" && a.schema._prefault && ((n = a.schema).default ?? (n.default = a.schema._prefault)), delete a.schema._prefault, t.seen.get(e).schema;
|
|
@@ -2646,8 +2646,8 @@ function so(e, t) {
|
|
|
2646
2646
|
value: {
|
|
2647
2647
|
...t["~standard"],
|
|
2648
2648
|
jsonSchema: {
|
|
2649
|
-
input:
|
|
2650
|
-
output:
|
|
2649
|
+
input: jt(t, "input", e.processors),
|
|
2650
|
+
output: jt(t, "output", e.processors)
|
|
2651
2651
|
}
|
|
2652
2652
|
},
|
|
2653
2653
|
enumerable: !1,
|
|
@@ -2701,10 +2701,10 @@ function Oe(e, t) {
|
|
|
2701
2701
|
}
|
|
2702
2702
|
const Ks = (e, t = {}) => (r) => {
|
|
2703
2703
|
const n = io({ ...r, processors: t });
|
|
2704
|
-
return
|
|
2705
|
-
},
|
|
2704
|
+
return Ne(e, n), ao(n, e), so(n, e);
|
|
2705
|
+
}, jt = (e, t, r = {}) => (n) => {
|
|
2706
2706
|
const { libraryOptions: o, target: i } = n ?? {}, a = io({ ...o ?? {}, target: i, io: t, processors: r });
|
|
2707
|
-
return
|
|
2707
|
+
return Ne(e, a), ao(a, e), so(a, e);
|
|
2708
2708
|
}, Js = {
|
|
2709
2709
|
guid: "uuid",
|
|
2710
2710
|
url: "uri",
|
|
@@ -2761,13 +2761,13 @@ const Ks = (e, t = {}) => (r) => {
|
|
|
2761
2761
|
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
2762
2762
|
}, ac = (e, t, r, n) => {
|
|
2763
2763
|
const o = r, i = e._zod.def, { minimum: a, maximum: s } = e._zod.bag;
|
|
2764
|
-
typeof a == "number" && (o.minItems = a), typeof s == "number" && (o.maxItems = s), o.type = "array", o.items =
|
|
2764
|
+
typeof a == "number" && (o.minItems = a), typeof s == "number" && (o.maxItems = s), o.type = "array", o.items = Ne(i.element, t, { ...n, path: [...n.path, "items"] });
|
|
2765
2765
|
}, sc = (e, t, r, n) => {
|
|
2766
2766
|
const o = r, i = e._zod.def;
|
|
2767
2767
|
o.type = "object", o.properties = {};
|
|
2768
2768
|
const a = i.shape;
|
|
2769
2769
|
for (const l in a)
|
|
2770
|
-
o.properties[l] =
|
|
2770
|
+
o.properties[l] = Ne(a[l], t, {
|
|
2771
2771
|
...n,
|
|
2772
2772
|
path: [...n.path, "properties", l]
|
|
2773
2773
|
});
|
|
@@ -2775,21 +2775,21 @@ const Ks = (e, t = {}) => (r) => {
|
|
|
2775
2775
|
const u = i.shape[l]._zod;
|
|
2776
2776
|
return t.io === "input" ? u.optin === void 0 : u.optout === void 0;
|
|
2777
2777
|
}));
|
|
2778
|
-
c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties =
|
|
2778
|
+
c.size > 0 && (o.required = Array.from(c)), i.catchall?._zod.def.type === "never" ? o.additionalProperties = !1 : i.catchall ? i.catchall && (o.additionalProperties = Ne(i.catchall, t, {
|
|
2779
2779
|
...n,
|
|
2780
2780
|
path: [...n.path, "additionalProperties"]
|
|
2781
2781
|
})) : t.io === "output" && (o.additionalProperties = !1);
|
|
2782
2782
|
}, cc = (e, t, r, n) => {
|
|
2783
|
-
const o = e._zod.def, i = o.inclusive === !1, a = o.options.map((s, c) =>
|
|
2783
|
+
const o = e._zod.def, i = o.inclusive === !1, a = o.options.map((s, c) => Ne(s, t, {
|
|
2784
2784
|
...n,
|
|
2785
2785
|
path: [...n.path, i ? "oneOf" : "anyOf", c]
|
|
2786
2786
|
}));
|
|
2787
2787
|
i ? r.oneOf = a : r.anyOf = a;
|
|
2788
2788
|
}, lc = (e, t, r, n) => {
|
|
2789
|
-
const o = e._zod.def, i =
|
|
2789
|
+
const o = e._zod.def, i = Ne(o.left, t, {
|
|
2790
2790
|
...n,
|
|
2791
2791
|
path: [...n.path, "allOf", 0]
|
|
2792
|
-
}), a =
|
|
2792
|
+
}), a = Ne(o.right, t, {
|
|
2793
2793
|
...n,
|
|
2794
2794
|
path: [...n.path, "allOf", 1]
|
|
2795
2795
|
}), s = (l) => "allOf" in l && Object.keys(l).length === 1, c = [
|
|
@@ -2798,26 +2798,26 @@ const Ks = (e, t = {}) => (r) => {
|
|
|
2798
2798
|
];
|
|
2799
2799
|
r.allOf = c;
|
|
2800
2800
|
}, uc = (e, t, r, n) => {
|
|
2801
|
-
const o = e._zod.def, i =
|
|
2801
|
+
const o = e._zod.def, i = Ne(o.innerType, t, n), a = t.seen.get(e);
|
|
2802
2802
|
t.target === "openapi-3.0" ? (a.ref = o.innerType, r.nullable = !0) : r.anyOf = [i, { type: "null" }];
|
|
2803
2803
|
}, dc = (e, t, r, n) => {
|
|
2804
2804
|
const o = e._zod.def;
|
|
2805
|
-
|
|
2805
|
+
Ne(o.innerType, t, n);
|
|
2806
2806
|
const i = t.seen.get(e);
|
|
2807
2807
|
i.ref = o.innerType;
|
|
2808
2808
|
}, _c = (e, t, r, n) => {
|
|
2809
2809
|
const o = e._zod.def;
|
|
2810
|
-
|
|
2810
|
+
Ne(o.innerType, t, n);
|
|
2811
2811
|
const i = t.seen.get(e);
|
|
2812
2812
|
i.ref = o.innerType, r.default = JSON.parse(JSON.stringify(o.defaultValue));
|
|
2813
2813
|
}, fc = (e, t, r, n) => {
|
|
2814
2814
|
const o = e._zod.def;
|
|
2815
|
-
|
|
2815
|
+
Ne(o.innerType, t, n);
|
|
2816
2816
|
const i = t.seen.get(e);
|
|
2817
2817
|
i.ref = o.innerType, t.io === "input" && (r._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
|
|
2818
2818
|
}, mc = (e, t, r, n) => {
|
|
2819
2819
|
const o = e._zod.def;
|
|
2820
|
-
|
|
2820
|
+
Ne(o.innerType, t, n);
|
|
2821
2821
|
const i = t.seen.get(e);
|
|
2822
2822
|
i.ref = o.innerType;
|
|
2823
2823
|
let a;
|
|
@@ -2829,39 +2829,39 @@ const Ks = (e, t = {}) => (r) => {
|
|
|
2829
2829
|
r.default = a;
|
|
2830
2830
|
}, pc = (e, t, r, n) => {
|
|
2831
2831
|
const o = e._zod.def, i = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
|
|
2832
|
-
|
|
2832
|
+
Ne(i, t, n);
|
|
2833
2833
|
const a = t.seen.get(e);
|
|
2834
2834
|
a.ref = i;
|
|
2835
2835
|
}, hc = (e, t, r, n) => {
|
|
2836
2836
|
const o = e._zod.def;
|
|
2837
|
-
|
|
2837
|
+
Ne(o.innerType, t, n);
|
|
2838
2838
|
const i = t.seen.get(e);
|
|
2839
2839
|
i.ref = o.innerType, r.readOnly = !0;
|
|
2840
2840
|
}, co = (e, t, r, n) => {
|
|
2841
2841
|
const o = e._zod.def;
|
|
2842
|
-
|
|
2842
|
+
Ne(o.innerType, t, n);
|
|
2843
2843
|
const i = t.seen.get(e);
|
|
2844
2844
|
i.ref = o.innerType;
|
|
2845
2845
|
}, gc = /* @__PURE__ */ p("ZodISODateTime", (e, t) => {
|
|
2846
|
-
ba.init(e, t),
|
|
2846
|
+
ba.init(e, t), pe.init(e, t);
|
|
2847
2847
|
});
|
|
2848
2848
|
function yc(e) {
|
|
2849
2849
|
return /* @__PURE__ */ Ts(gc, e);
|
|
2850
2850
|
}
|
|
2851
2851
|
const vc = /* @__PURE__ */ p("ZodISODate", (e, t) => {
|
|
2852
|
-
Sa.init(e, t),
|
|
2852
|
+
Sa.init(e, t), pe.init(e, t);
|
|
2853
2853
|
});
|
|
2854
2854
|
function bc(e) {
|
|
2855
2855
|
return /* @__PURE__ */ Ns(vc, e);
|
|
2856
2856
|
}
|
|
2857
2857
|
const Sc = /* @__PURE__ */ p("ZodISOTime", (e, t) => {
|
|
2858
|
-
wa.init(e, t),
|
|
2858
|
+
wa.init(e, t), pe.init(e, t);
|
|
2859
2859
|
});
|
|
2860
2860
|
function wc(e) {
|
|
2861
2861
|
return /* @__PURE__ */ Es(Sc, e);
|
|
2862
2862
|
}
|
|
2863
2863
|
const Cc = /* @__PURE__ */ p("ZodISODuration", (e, t) => {
|
|
2864
|
-
Ca.init(e, t),
|
|
2864
|
+
Ca.init(e, t), pe.init(e, t);
|
|
2865
2865
|
});
|
|
2866
2866
|
function Ac(e) {
|
|
2867
2867
|
return /* @__PURE__ */ ks(Cc, e);
|
|
@@ -2897,10 +2897,10 @@ const Tc = (e, t) => {
|
|
|
2897
2897
|
});
|
|
2898
2898
|
}, Pe = p("ZodError", Tc, {
|
|
2899
2899
|
Parent: Error
|
|
2900
|
-
}), Nc = /* @__PURE__ */ Ir(Pe), Ec = /* @__PURE__ */ Lr(Pe), kc = /* @__PURE__ */
|
|
2900
|
+
}), Nc = /* @__PURE__ */ Ir(Pe), Ec = /* @__PURE__ */ Lr(Pe), kc = /* @__PURE__ */ Yt(Pe), Oc = /* @__PURE__ */ Kt(Pe), Ic = /* @__PURE__ */ pi(Pe), Lc = /* @__PURE__ */ hi(Pe), Mc = /* @__PURE__ */ gi(Pe), Rc = /* @__PURE__ */ yi(Pe), Dc = /* @__PURE__ */ vi(Pe), Pc = /* @__PURE__ */ bi(Pe), $c = /* @__PURE__ */ Si(Pe), xc = /* @__PURE__ */ wi(Pe), ye = /* @__PURE__ */ p("ZodType", (e, t) => (ge.init(e, t), Object.assign(e["~standard"], {
|
|
2901
2901
|
jsonSchema: {
|
|
2902
|
-
input:
|
|
2903
|
-
output:
|
|
2902
|
+
input: jt(e, "input"),
|
|
2903
|
+
output: jt(e, "output")
|
|
2904
2904
|
}
|
|
2905
2905
|
}), e.toJSONSchema = Ks(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...r) => e.clone(We(t, {
|
|
2906
2906
|
checks: [
|
|
@@ -2925,55 +2925,55 @@ const Tc = (e, t) => {
|
|
|
2925
2925
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (r) => r(e), e)), lo = /* @__PURE__ */ p("_ZodString", (e, t) => {
|
|
2926
2926
|
Mr.init(e, t), ye.init(e, t), e._zod.processJSONSchema = (n, o, i) => qs(e, n, o);
|
|
2927
2927
|
const r = e._zod.bag;
|
|
2928
|
-
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(/* @__PURE__ */ Ds(...n)), e.includes = (...n) => e.check(/* @__PURE__ */ xs(...n)), e.startsWith = (...n) => e.check(/* @__PURE__ */ Fs(...n)), e.endsWith = (...n) => e.check(/* @__PURE__ */ Bs(...n)), e.min = (...n) => e.check(/* @__PURE__ */
|
|
2928
|
+
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(/* @__PURE__ */ Ds(...n)), e.includes = (...n) => e.check(/* @__PURE__ */ xs(...n)), e.startsWith = (...n) => e.check(/* @__PURE__ */ Fs(...n)), e.endsWith = (...n) => e.check(/* @__PURE__ */ Bs(...n)), e.min = (...n) => e.check(/* @__PURE__ */ Zt(...n)), e.max = (...n) => e.check(/* @__PURE__ */ no(...n)), e.length = (...n) => e.check(/* @__PURE__ */ oo(...n)), e.nonempty = (...n) => e.check(/* @__PURE__ */ Zt(1, ...n)), e.lowercase = (n) => e.check(/* @__PURE__ */ Ps(n)), e.uppercase = (n) => e.check(/* @__PURE__ */ $s(n)), e.trim = () => e.check(/* @__PURE__ */ Us()), e.normalize = (...n) => e.check(/* @__PURE__ */ zs(...n)), e.toLowerCase = () => e.check(/* @__PURE__ */ Hs()), e.toUpperCase = () => e.check(/* @__PURE__ */ Zs()), e.slugify = () => e.check(/* @__PURE__ */ js());
|
|
2929
2929
|
}), Fc = /* @__PURE__ */ p("ZodString", (e, t) => {
|
|
2930
2930
|
Mr.init(e, t), lo.init(e, t), e.email = (r) => e.check(/* @__PURE__ */ os(Bc, r)), e.url = (r) => e.check(/* @__PURE__ */ ls(zc, r)), e.jwt = (r) => e.check(/* @__PURE__ */ As(tl, r)), e.emoji = (r) => e.check(/* @__PURE__ */ us(Uc, r)), e.guid = (r) => e.check(/* @__PURE__ */ tn(an, r)), e.uuid = (r) => e.check(/* @__PURE__ */ is(Et, r)), e.uuidv4 = (r) => e.check(/* @__PURE__ */ as(Et, r)), e.uuidv6 = (r) => e.check(/* @__PURE__ */ ss(Et, r)), e.uuidv7 = (r) => e.check(/* @__PURE__ */ cs(Et, r)), e.nanoid = (r) => e.check(/* @__PURE__ */ ds(Hc, r)), e.guid = (r) => e.check(/* @__PURE__ */ tn(an, r)), e.cuid = (r) => e.check(/* @__PURE__ */ _s(Zc, r)), e.cuid2 = (r) => e.check(/* @__PURE__ */ fs(jc, r)), e.ulid = (r) => e.check(/* @__PURE__ */ ms(Wc, r)), e.base64 = (r) => e.check(/* @__PURE__ */ Ss(Qc, r)), e.base64url = (r) => e.check(/* @__PURE__ */ ws(Xc, r)), e.xid = (r) => e.check(/* @__PURE__ */ ps(Gc, r)), e.ksuid = (r) => e.check(/* @__PURE__ */ hs(Vc, r)), e.ipv4 = (r) => e.check(/* @__PURE__ */ gs(Yc, r)), e.ipv6 = (r) => e.check(/* @__PURE__ */ ys(Kc, r)), e.cidrv4 = (r) => e.check(/* @__PURE__ */ vs(Jc, r)), e.cidrv6 = (r) => e.check(/* @__PURE__ */ bs(qc, r)), e.e164 = (r) => e.check(/* @__PURE__ */ Cs(el, r)), e.datetime = (r) => e.check(yc(r)), e.date = (r) => e.check(bc(r)), e.time = (r) => e.check(wc(r)), e.duration = (r) => e.check(Ac(r));
|
|
2931
2931
|
});
|
|
2932
2932
|
function Ke(e) {
|
|
2933
2933
|
return /* @__PURE__ */ ns(Fc, e);
|
|
2934
2934
|
}
|
|
2935
|
-
const
|
|
2936
|
-
|
|
2935
|
+
const pe = /* @__PURE__ */ p("ZodStringFormat", (e, t) => {
|
|
2936
|
+
me.init(e, t), lo.init(e, t);
|
|
2937
2937
|
}), Bc = /* @__PURE__ */ p("ZodEmail", (e, t) => {
|
|
2938
|
-
da.init(e, t),
|
|
2938
|
+
da.init(e, t), pe.init(e, t);
|
|
2939
2939
|
}), an = /* @__PURE__ */ p("ZodGUID", (e, t) => {
|
|
2940
|
-
la.init(e, t),
|
|
2940
|
+
la.init(e, t), pe.init(e, t);
|
|
2941
2941
|
}), Et = /* @__PURE__ */ p("ZodUUID", (e, t) => {
|
|
2942
|
-
ua.init(e, t),
|
|
2942
|
+
ua.init(e, t), pe.init(e, t);
|
|
2943
2943
|
}), zc = /* @__PURE__ */ p("ZodURL", (e, t) => {
|
|
2944
|
-
_a.init(e, t),
|
|
2944
|
+
_a.init(e, t), pe.init(e, t);
|
|
2945
2945
|
}), Uc = /* @__PURE__ */ p("ZodEmoji", (e, t) => {
|
|
2946
|
-
fa.init(e, t),
|
|
2946
|
+
fa.init(e, t), pe.init(e, t);
|
|
2947
2947
|
}), Hc = /* @__PURE__ */ p("ZodNanoID", (e, t) => {
|
|
2948
|
-
ma.init(e, t),
|
|
2948
|
+
ma.init(e, t), pe.init(e, t);
|
|
2949
2949
|
}), Zc = /* @__PURE__ */ p("ZodCUID", (e, t) => {
|
|
2950
|
-
pa.init(e, t),
|
|
2950
|
+
pa.init(e, t), pe.init(e, t);
|
|
2951
2951
|
}), jc = /* @__PURE__ */ p("ZodCUID2", (e, t) => {
|
|
2952
|
-
ha.init(e, t),
|
|
2952
|
+
ha.init(e, t), pe.init(e, t);
|
|
2953
2953
|
}), Wc = /* @__PURE__ */ p("ZodULID", (e, t) => {
|
|
2954
|
-
ga.init(e, t),
|
|
2954
|
+
ga.init(e, t), pe.init(e, t);
|
|
2955
2955
|
}), Gc = /* @__PURE__ */ p("ZodXID", (e, t) => {
|
|
2956
|
-
ya.init(e, t),
|
|
2956
|
+
ya.init(e, t), pe.init(e, t);
|
|
2957
2957
|
}), Vc = /* @__PURE__ */ p("ZodKSUID", (e, t) => {
|
|
2958
|
-
va.init(e, t),
|
|
2958
|
+
va.init(e, t), pe.init(e, t);
|
|
2959
2959
|
}), Yc = /* @__PURE__ */ p("ZodIPv4", (e, t) => {
|
|
2960
|
-
Aa.init(e, t),
|
|
2960
|
+
Aa.init(e, t), pe.init(e, t);
|
|
2961
2961
|
}), Kc = /* @__PURE__ */ p("ZodIPv6", (e, t) => {
|
|
2962
|
-
Ta.init(e, t),
|
|
2962
|
+
Ta.init(e, t), pe.init(e, t);
|
|
2963
2963
|
}), Jc = /* @__PURE__ */ p("ZodCIDRv4", (e, t) => {
|
|
2964
|
-
Na.init(e, t),
|
|
2964
|
+
Na.init(e, t), pe.init(e, t);
|
|
2965
2965
|
}), qc = /* @__PURE__ */ p("ZodCIDRv6", (e, t) => {
|
|
2966
|
-
Ea.init(e, t),
|
|
2966
|
+
Ea.init(e, t), pe.init(e, t);
|
|
2967
2967
|
}), Qc = /* @__PURE__ */ p("ZodBase64", (e, t) => {
|
|
2968
|
-
ka.init(e, t),
|
|
2968
|
+
ka.init(e, t), pe.init(e, t);
|
|
2969
2969
|
}), Xc = /* @__PURE__ */ p("ZodBase64URL", (e, t) => {
|
|
2970
|
-
Ia.init(e, t),
|
|
2970
|
+
Ia.init(e, t), pe.init(e, t);
|
|
2971
2971
|
}), el = /* @__PURE__ */ p("ZodE164", (e, t) => {
|
|
2972
|
-
La.init(e, t),
|
|
2972
|
+
La.init(e, t), pe.init(e, t);
|
|
2973
2973
|
}), tl = /* @__PURE__ */ p("ZodJWT", (e, t) => {
|
|
2974
|
-
Ra.init(e, t),
|
|
2974
|
+
Ra.init(e, t), pe.init(e, t);
|
|
2975
2975
|
}), uo = /* @__PURE__ */ p("ZodNumber", (e, t) => {
|
|
2976
|
-
Xn.init(e, t), ye.init(e, t), e._zod.processJSONSchema = (n, o, i) => Qs(e, n, o), e.gt = (n, o) => e.check(/* @__PURE__ */ nn(n, o)), e.gte = (n, o) => e.check(/* @__PURE__ */
|
|
2976
|
+
Xn.init(e, t), ye.init(e, t), e._zod.processJSONSchema = (n, o, i) => Qs(e, n, o), e.gt = (n, o) => e.check(/* @__PURE__ */ nn(n, o)), e.gte = (n, o) => e.check(/* @__PURE__ */ sr(n, o)), e.min = (n, o) => e.check(/* @__PURE__ */ sr(n, o)), e.lt = (n, o) => e.check(/* @__PURE__ */ rn(n, o)), e.lte = (n, o) => e.check(/* @__PURE__ */ ar(n, o)), e.max = (n, o) => e.check(/* @__PURE__ */ ar(n, o)), e.int = (n) => e.check(sn(n)), e.safe = (n) => e.check(sn(n)), e.positive = (n) => e.check(/* @__PURE__ */ nn(0, n)), e.nonnegative = (n) => e.check(/* @__PURE__ */ sr(0, n)), e.negative = (n) => e.check(/* @__PURE__ */ rn(0, n)), e.nonpositive = (n) => e.check(/* @__PURE__ */ ar(0, n)), e.multipleOf = (n, o) => e.check(/* @__PURE__ */ on(n, o)), e.step = (n, o) => e.check(/* @__PURE__ */ on(n, o)), e.finite = () => e;
|
|
2977
2977
|
const r = e._zod.bag;
|
|
2978
2978
|
e.minValue = Math.max(r.minimum ?? Number.NEGATIVE_INFINITY, r.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(r.maximum ?? Number.POSITIVE_INFINITY, r.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (r.format ?? "").includes("int") || Number.isSafeInteger(r.multipleOf ?? 0.5), e.isFinite = !0, e.format = r.format ?? null;
|
|
2979
2979
|
}), rl = /* @__PURE__ */ p("ZodNumberFormat", (e, t) => {
|
|
@@ -3001,13 +3001,13 @@ function sl(e) {
|
|
|
3001
3001
|
return /* @__PURE__ */ Rs(al, e);
|
|
3002
3002
|
}
|
|
3003
3003
|
const cl = /* @__PURE__ */ p("ZodArray", (e, t) => {
|
|
3004
|
-
Fa.init(e, t), ye.init(e, t), e._zod.processJSONSchema = (r, n, o) => ac(e, r, n, o), e.element = t.element, e.min = (r, n) => e.check(/* @__PURE__ */
|
|
3004
|
+
Fa.init(e, t), ye.init(e, t), e._zod.processJSONSchema = (r, n, o) => ac(e, r, n, o), e.element = t.element, e.min = (r, n) => e.check(/* @__PURE__ */ Zt(r, n)), e.nonempty = (r) => e.check(/* @__PURE__ */ Zt(1, r)), e.max = (r, n) => e.check(/* @__PURE__ */ no(r, n)), e.length = (r, n) => e.check(/* @__PURE__ */ oo(r, n)), e.unwrap = () => e.element;
|
|
3005
3005
|
});
|
|
3006
3006
|
function ll(e, t) {
|
|
3007
3007
|
return /* @__PURE__ */ Ws(cl, e, t);
|
|
3008
3008
|
}
|
|
3009
3009
|
const ul = /* @__PURE__ */ p("ZodObject", (e, t) => {
|
|
3010
|
-
za.init(e, t), ye.init(e, t), e._zod.processJSONSchema = (r, n, o) => sc(e, r, n, o),
|
|
3010
|
+
za.init(e, t), ye.init(e, t), e._zod.processJSONSchema = (r, n, o) => sc(e, r, n, o), ae(e, "shape", () => t.shape), e.keyof = () => nt(Object.keys(e._zod.def.shape)), e.catchall = (r) => e.clone({ ...e._zod.def, catchall: r }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: cn() }), e.loose = () => e.clone({ ...e._zod.def, catchall: cn() }), e.strict = () => e.clone({ ...e._zod.def, catchall: sl() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (r) => ai(e, r), e.safeExtend = (r) => si(e, r), e.merge = (r) => ci(e, r), e.pick = (r) => oi(e, r), e.omit = (r) => ii(e, r), e.partial = (...r) => li(fo, e, r[0]), e.required = (...r) => ui(mo, e, r[0]);
|
|
3011
3011
|
});
|
|
3012
3012
|
function dl(e, t) {
|
|
3013
3013
|
const r = {
|
|
@@ -3677,16 +3677,16 @@ function xl(e, t) {
|
|
|
3677
3677
|
function vr(e) {
|
|
3678
3678
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
3679
3679
|
}
|
|
3680
|
-
function
|
|
3680
|
+
function Dt(e, t) {
|
|
3681
3681
|
return e.key ?? `${vr(e.question)}-${t}`;
|
|
3682
3682
|
}
|
|
3683
3683
|
function je(e, t) {
|
|
3684
3684
|
return t === "number" ? e == null || typeof e == "string" && e.trim() === "" : t === "checkbox" ? e !== !0 : e == null || typeof e == "string" && e.trim() === "";
|
|
3685
3685
|
}
|
|
3686
|
-
function
|
|
3686
|
+
function Wt(e, t) {
|
|
3687
3687
|
const r = {};
|
|
3688
3688
|
e.forEach((i, a) => {
|
|
3689
|
-
const s =
|
|
3689
|
+
const s = Dt(i, a), c = t[s];
|
|
3690
3690
|
if (i.required && je(c, i.inputType)) {
|
|
3691
3691
|
r[s] = "Required";
|
|
3692
3692
|
return;
|
|
@@ -5215,7 +5215,7 @@ function Dr(e, t) {
|
|
|
5215
5215
|
const n = r.toLowerCase();
|
|
5216
5216
|
return Object.keys(t).find((i) => i.toLowerCase() === n || t[i]?.toLowerCase() === n) ?? e;
|
|
5217
5217
|
}
|
|
5218
|
-
function
|
|
5218
|
+
function Gt(e) {
|
|
5219
5219
|
return Dr(e, bo);
|
|
5220
5220
|
}
|
|
5221
5221
|
function wo(e) {
|
|
@@ -5242,7 +5242,7 @@ function at(e, t) {
|
|
|
5242
5242
|
return r == null || n == null ? !1 : r < n;
|
|
5243
5243
|
}
|
|
5244
5244
|
const Ru = /* @__PURE__ */ new Set(["HomePolicy", "BundlePolicy"]);
|
|
5245
|
-
function
|
|
5245
|
+
function Pt(e, t, r) {
|
|
5246
5246
|
return String(e.key ?? "") !== "lapse_in_coverage" || !r || !Ru.has(r) ? !0 : t.home_prior_carrier_name !== "NoPriorInsurance";
|
|
5247
5247
|
}
|
|
5248
5248
|
function Pr(e) {
|
|
@@ -5271,14 +5271,14 @@ function Pr(e) {
|
|
|
5271
5271
|
function St(e, t) {
|
|
5272
5272
|
return t.currentCarrierKey === "home_prior_carrier_name" && e.home_prior_carrier_name === "NoPriorInsurance" && e.auto_prior_carrier_name !== "NoPriorInsurance" ? !1 : (t.currentCarrierKey ? e[t.currentCarrierKey] : void 0) === "NoPriorInsurance" ? !0 : !t.effectiveDateKey || !t.expirationDateKey || t.expirationDateKey === "home_prior_expiration_date" && at(e, t) ? !1 : at(e, t);
|
|
5273
5273
|
}
|
|
5274
|
-
function
|
|
5274
|
+
function $t(e, t, r) {
|
|
5275
5275
|
const n = String(e.key ?? "");
|
|
5276
5276
|
if (r.noInsuranceReasonKeys.has(n) && r.currentCarrierKey === "home_prior_carrier_name" && t.home_prior_carrier_name === "NoPriorInsurance" && t.auto_prior_carrier_name !== "NoPriorInsurance")
|
|
5277
5277
|
return !1;
|
|
5278
5278
|
const i = (r.currentCarrierKey ? t[r.currentCarrierKey] : void 0) === "NoPriorInsurance";
|
|
5279
5279
|
return i && r.hideWhenNoPriorInsuranceKeys.has(n) ? !1 : !r.noInsuranceReasonKeys.has(n) || i ? !0 : St(t, r);
|
|
5280
5280
|
}
|
|
5281
|
-
function
|
|
5281
|
+
function Vt(e, t) {
|
|
5282
5282
|
const r = String(e.key ?? "");
|
|
5283
5283
|
return t.noInsuranceReasonKeys.has(r);
|
|
5284
5284
|
}
|
|
@@ -5382,7 +5382,7 @@ let ct = null;
|
|
|
5382
5382
|
function zu(e) {
|
|
5383
5383
|
ct = e, xu(e);
|
|
5384
5384
|
}
|
|
5385
|
-
function
|
|
5385
|
+
function xt() {
|
|
5386
5386
|
return ct;
|
|
5387
5387
|
}
|
|
5388
5388
|
function Sr() {
|
|
@@ -5425,7 +5425,7 @@ async function Hu(e, t) {
|
|
|
5425
5425
|
const r = t ? { stage: e, quoteId: t } : { stage: e };
|
|
5426
5426
|
return await (await Be(`${Fe}/get-questions-by-stage`, r)).json();
|
|
5427
5427
|
}
|
|
5428
|
-
async function
|
|
5428
|
+
async function Lt(e) {
|
|
5429
5429
|
const t = e ? { quoteId: e } : {};
|
|
5430
5430
|
return await (await Be(`${Fe}/get-stages-for-quote`, t)).json();
|
|
5431
5431
|
}
|
|
@@ -5464,7 +5464,7 @@ async function Ku(e) {
|
|
|
5464
5464
|
const r = await (await Be(`${Fe}/request-bind`, { quoteRateId: e })).json();
|
|
5465
5465
|
return r && typeof r == "object" && "success" in r ? r : { success: !0 };
|
|
5466
5466
|
}
|
|
5467
|
-
const Ju = ["additional_pip", "tort_threshold", "pip_coverage_type", "extended_medical", "policy_pip_deductible"],
|
|
5467
|
+
const Ju = ["additional_pip", "tort_threshold", "pip_coverage_type", "extended_medical", "policy_pip_deductible"], qt = /* @__PURE__ */ new Set([...Ju, "is_corporation"]);
|
|
5468
5468
|
dl({
|
|
5469
5469
|
additional_pip: nt([
|
|
5470
5470
|
"cov100_10400_LIMITED",
|
|
@@ -5636,7 +5636,7 @@ const nd = {
|
|
|
5636
5636
|
auto_prior_years: 2,
|
|
5637
5637
|
auto_prior_months: 2,
|
|
5638
5638
|
auto_continuous_coverage_years: 2
|
|
5639
|
-
},
|
|
5639
|
+
}, Mt = {
|
|
5640
5640
|
first_name: "given-name",
|
|
5641
5641
|
last_name: "family-name",
|
|
5642
5642
|
co_applicant_first_name: "given-name",
|
|
@@ -5682,7 +5682,7 @@ const id = /* @__PURE__ */ new Set(["Disabled", "Retired", "Unemployed", "Other"
|
|
|
5682
5682
|
function lr(e, t, r) {
|
|
5683
5683
|
const n = String(e.key ?? "");
|
|
5684
5684
|
if (n !== "occupation" && n !== "co_applicant_occupation" || n === "co_applicant_occupation") return !0;
|
|
5685
|
-
const o =
|
|
5685
|
+
const o = ke(t, r, "industry"), i = ke(t, r, "employment_industry"), a = String(o ?? i ?? "").trim();
|
|
5686
5686
|
return !id.has(a);
|
|
5687
5687
|
}
|
|
5688
5688
|
function Eo(e) {
|
|
@@ -5693,20 +5693,20 @@ function Eo(e) {
|
|
|
5693
5693
|
}
|
|
5694
5694
|
function ur(e, t) {
|
|
5695
5695
|
const r = String(e.key ?? "");
|
|
5696
|
-
return
|
|
5696
|
+
return qt.has(r) ? Eo(t) : !0;
|
|
5697
5697
|
}
|
|
5698
5698
|
function ad(e, t) {
|
|
5699
|
-
const r = String(e ?? ""), n =
|
|
5699
|
+
const r = String(e ?? ""), n = qt.has(r) || r === "has_health_insurance_auto_accident" || r === "is_corporation";
|
|
5700
5700
|
return Eo(t) && n;
|
|
5701
5701
|
}
|
|
5702
5702
|
function dr(e, t, r, n) {
|
|
5703
5703
|
return !(!Rr(e, n) || ad(e, r));
|
|
5704
5704
|
}
|
|
5705
|
-
function
|
|
5705
|
+
function Ft(e) {
|
|
5706
5706
|
return e.inputType !== "radio" || !e.options || e.options.length !== 1 || e.options[0] !== "Yes" ? !1 : (e.conditionals ?? []).some((r) => r.conditionalQuestionsAllowMultiple && r.conditionalType === "equals" && r.conditionalValue === "Yes");
|
|
5707
5707
|
}
|
|
5708
5708
|
function Sn(e, t) {
|
|
5709
|
-
return
|
|
5709
|
+
return Ft(e) ? "Yes" : t;
|
|
5710
5710
|
}
|
|
5711
5711
|
function wn(e) {
|
|
5712
5712
|
return typeof e == "number" && Number.isFinite(e) ? e : typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? Number(e) : null;
|
|
@@ -5772,16 +5772,16 @@ function $e(e, t, r) {
|
|
|
5772
5772
|
}
|
|
5773
5773
|
return { ...e, [n]: s };
|
|
5774
5774
|
}
|
|
5775
|
-
function
|
|
5775
|
+
function ke(e, t, r) {
|
|
5776
5776
|
return yt(e, [...t ?? [], r]);
|
|
5777
5777
|
}
|
|
5778
|
-
function
|
|
5778
|
+
function Ee(e, t, r, n) {
|
|
5779
5779
|
return $e(e, [...t ?? [], r], n);
|
|
5780
5780
|
}
|
|
5781
5781
|
function cd(e, t) {
|
|
5782
5782
|
return e?.length ? `${e.join("-")}-${t}` : t;
|
|
5783
5783
|
}
|
|
5784
|
-
const ld = "__items",
|
|
5784
|
+
const ld = "__items", Rt = (e) => `${e}${ld}`;
|
|
5785
5785
|
function De(e) {
|
|
5786
5786
|
return e == null ? "" : typeof e == "string" ? e : String(e);
|
|
5787
5787
|
}
|
|
@@ -5803,89 +5803,89 @@ function _d({
|
|
|
5803
5803
|
const s = be(() => Tr(e), [e]), c = be(() => Pr(s), [s]), l = be(() => a === "BundlePolicy" ? !0 : s.some((S) => String(S.key) === "home_prior_carrier_name") && s.some((S) => String(S.key) === "driver_vehicle_assignments"), [a, s]), u = be(() => {
|
|
5804
5804
|
const S = {};
|
|
5805
5805
|
return t && Object.assign(S, t), S;
|
|
5806
|
-
}, [t]), [m, v] =
|
|
5806
|
+
}, [t]), [m, v] = ie(u);
|
|
5807
5807
|
de(() => {
|
|
5808
5808
|
v(u);
|
|
5809
5809
|
}, [u]);
|
|
5810
|
-
const [g, b] =
|
|
5810
|
+
const [g, b] = ie({}), h = be(
|
|
5811
5811
|
() => ({ ...g, ...r ?? m }),
|
|
5812
5812
|
[g, r, m]
|
|
5813
5813
|
);
|
|
5814
5814
|
de(() => {
|
|
5815
5815
|
r && b((S) => ({ ...S, ...r }));
|
|
5816
5816
|
}, [r]);
|
|
5817
|
-
const [W,
|
|
5817
|
+
const [W, se] = ie({}), te = Te(/* @__PURE__ */ new Map()), X = Te(/* @__PURE__ */ new Set()), [, G] = ie({}), [M, $] = ie({}), I = Te(!1);
|
|
5818
5818
|
de(() => {
|
|
5819
|
-
!i ||
|
|
5819
|
+
!i || I.current || !s.some((y) => y.key === "year" || y.key === "make" || y.key === "model" || y.key === "body_style") || (I.current = !0, vn({ quoteId: i }).catch(() => {
|
|
5820
5820
|
}));
|
|
5821
5821
|
}, [i, s]);
|
|
5822
|
-
const [
|
|
5822
|
+
const [re, O] = ie({}), [Q, j] = ie({}), fe = fr(
|
|
5823
5823
|
async (S, y) => {
|
|
5824
5824
|
if (!i || !fn(y)) return;
|
|
5825
5825
|
const _ = S ? S.join("-") : "_root";
|
|
5826
|
-
|
|
5826
|
+
O((T) => ({ ...T, [_]: !0 })), j((T) => ({ ...T, [_]: null }));
|
|
5827
5827
|
try {
|
|
5828
5828
|
const T = await Yu({ quoteId: i, vin: y });
|
|
5829
5829
|
if (T.error) {
|
|
5830
|
-
|
|
5830
|
+
j((L) => ({ ...L, [_]: T.error }));
|
|
5831
5831
|
return;
|
|
5832
5832
|
}
|
|
5833
5833
|
let w = h;
|
|
5834
|
-
T.year && (w =
|
|
5834
|
+
T.year && (w = Ee(w, S, "year", String(T.year))), T.make && (w = Ee(w, S, "make", T.make)), T.model && (w = Ee(w, S, "model", T.model)), T.bodyStyle && (w = Ee(w, S, "body_style", T.bodyStyle)), r && n ? n(w) : v(w), b(w), te.current.clear(), X.current.clear(), G({});
|
|
5835
5835
|
} catch {
|
|
5836
|
-
|
|
5836
|
+
j((T) => ({ ...T, [_]: "VIN lookup failed — please enter vehicle details manually" }));
|
|
5837
5837
|
} finally {
|
|
5838
|
-
|
|
5838
|
+
O((T) => ({ ...T, [_]: !1 }));
|
|
5839
5839
|
}
|
|
5840
5840
|
},
|
|
5841
5841
|
[i, h, r, n]
|
|
5842
|
-
),
|
|
5842
|
+
), ne = fr(
|
|
5843
5843
|
(S, y) => {
|
|
5844
5844
|
if (!i) return;
|
|
5845
|
-
const _ = `${y.year}|${y.make ?? ""}|${y.model ?? ""}`, T = y.model ? "bodyStyles" : y.make ? "models" : "makes", w = `${S}:${T}`,
|
|
5846
|
-
if (
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5845
|
+
const _ = `${y.year}|${y.make ?? ""}|${y.model ?? ""}`, T = y.model ? "bodyStyles" : y.make ? "models" : "makes", w = `${S}:${T}`, L = te.current.get(_);
|
|
5846
|
+
if (L) return L[T] ?? [];
|
|
5847
|
+
X.current.has(_) || (X.current.add(_), queueMicrotask(() => {
|
|
5848
|
+
$((H) => ({ ...H, [w]: !0 })), vn({ quoteId: i, ...y }).then((H) => {
|
|
5849
|
+
te.current.set(_, H), G((P) => ({ ...P, [w]: H[T] ?? [] }));
|
|
5850
5850
|
}).catch(() => {
|
|
5851
|
-
|
|
5851
|
+
te.current.set(_, {}), G((H) => ({ ...H, [w]: [] }));
|
|
5852
5852
|
}).finally(() => {
|
|
5853
|
-
|
|
5853
|
+
X.current.delete(_), $((H) => ({ ...H, [w]: !1 }));
|
|
5854
5854
|
});
|
|
5855
5855
|
}));
|
|
5856
5856
|
},
|
|
5857
5857
|
[i]
|
|
5858
5858
|
);
|
|
5859
|
-
function
|
|
5859
|
+
function ee(S, y, _) {
|
|
5860
5860
|
return { ...S ? yt(h, S) ?? {} : h, [y]: _ };
|
|
5861
5861
|
}
|
|
5862
|
-
function
|
|
5862
|
+
function U(S, y) {
|
|
5863
5863
|
const _ = ho.filter((w) => w.targetKey === S || w.dependsOn.includes(S)), T = { [S]: void 0 };
|
|
5864
5864
|
for (const w of _) {
|
|
5865
|
-
const
|
|
5866
|
-
w.targetKey in T ?
|
|
5865
|
+
const L = w.validate(y);
|
|
5866
|
+
w.targetKey in T ? L !== void 0 && (T[w.targetKey] = L) : T[w.targetKey] = L;
|
|
5867
5867
|
}
|
|
5868
|
-
|
|
5868
|
+
se((w) => ({ ...w, ...T }));
|
|
5869
5869
|
}
|
|
5870
5870
|
const f = (S, y, _) => {
|
|
5871
|
-
const T =
|
|
5871
|
+
const T = ke(h, _, S);
|
|
5872
5872
|
if (je(T, y)) {
|
|
5873
|
-
W[S] &&
|
|
5873
|
+
W[S] && se((L) => ({ ...L, [S]: void 0 }));
|
|
5874
5874
|
return;
|
|
5875
5875
|
}
|
|
5876
5876
|
const w = yr(S, T);
|
|
5877
5877
|
if (w) {
|
|
5878
|
-
|
|
5878
|
+
se((L) => ({ ...L, [S]: w }));
|
|
5879
5879
|
return;
|
|
5880
5880
|
}
|
|
5881
|
-
|
|
5881
|
+
U(S, ee(_, S, T));
|
|
5882
5882
|
};
|
|
5883
5883
|
de(() => {
|
|
5884
5884
|
let S = h, y = !1;
|
|
5885
5885
|
s.forEach((_) => {
|
|
5886
|
-
if (!
|
|
5886
|
+
if (!Ft(_)) return;
|
|
5887
5887
|
const T = String(_.key);
|
|
5888
|
-
|
|
5888
|
+
ke(S, void 0, T) !== "Yes" && (S = Ee(S, void 0, T, "Yes"), y = !0);
|
|
5889
5889
|
}), y && (r && n ? n(S) : v(S), b(S));
|
|
5890
5890
|
}, [s, h, r, n]);
|
|
5891
5891
|
function N(S, y) {
|
|
@@ -5897,33 +5897,33 @@ function _d({
|
|
|
5897
5897
|
if ((_ === "purchase_date" || _ === "cost_new_value_cents") && y)
|
|
5898
5898
|
return null;
|
|
5899
5899
|
if (_ === "custom_equipment_value_cents" && y) {
|
|
5900
|
-
const A =
|
|
5900
|
+
const A = ke(h, y, "vehicle_has_modifications");
|
|
5901
5901
|
if (A !== "Yes" && A !== !0) return null;
|
|
5902
5902
|
}
|
|
5903
|
-
const T = _ === "auto_reason_for_no_insurance" && c.currentCarrierKey ? h[c.currentCarrierKey] === "NoPriorInsurance" ? "Reason you are not currently insured" : "Reason for lapse in coverage" : S.question, w = S.hint,
|
|
5904
|
-
let C =
|
|
5903
|
+
const T = _ === "auto_reason_for_no_insurance" && c.currentCarrierKey ? h[c.currentCarrierKey] === "NoPriorInsurance" ? "Reason you are not currently insured" : "Reason for lapse in coverage" : S.question, w = S.hint, L = ke(h, y, _), H = Vt(S, c) ? St(h, c) : S.required, P = W[_], z = (A) => {
|
|
5904
|
+
let C = Ee(h, y, _, A);
|
|
5905
5905
|
if (S.inputType === "radio" && S.conditionals) {
|
|
5906
5906
|
const k = S.conditionals ?? [];
|
|
5907
|
-
for (const
|
|
5908
|
-
const x =
|
|
5909
|
-
if (Z && !
|
|
5910
|
-
const he =
|
|
5907
|
+
for (const J of k) {
|
|
5908
|
+
const x = ke(h, y, _), Z = mt(x, J.conditionalType, J.conditionalValue), D = mt(A, J.conditionalType, J.conditionalValue);
|
|
5909
|
+
if (Z && !D && J.conditionalQuestionsAllowMultiple) {
|
|
5910
|
+
const he = J.conditionalQuestions ?? [];
|
|
5911
5911
|
if (he.length > 0) {
|
|
5912
|
-
const
|
|
5913
|
-
C = $e(C, [...y ?? [],
|
|
5914
|
-
const ce = (
|
|
5915
|
-
|
|
5916
|
-
(
|
|
5912
|
+
const Y = Rt(_);
|
|
5913
|
+
C = $e(C, [...y ?? [], Y], []);
|
|
5914
|
+
const ce = (oe, q) => {
|
|
5915
|
+
oe.forEach((K) => {
|
|
5916
|
+
(K.conditionals ?? []).forEach((le) => {
|
|
5917
5917
|
if (le.conditionalQuestionsAllowMultiple) {
|
|
5918
|
-
const ue =
|
|
5919
|
-
C = $e(C, [...
|
|
5918
|
+
const ue = Rt(K.key);
|
|
5919
|
+
C = $e(C, [...q, ue], []);
|
|
5920
5920
|
}
|
|
5921
5921
|
const Ce = le.conditionalQuestions ?? [];
|
|
5922
|
-
Ce.length > 0 && ce(Ce,
|
|
5922
|
+
Ce.length > 0 && ce(Ce, q);
|
|
5923
5923
|
});
|
|
5924
5924
|
});
|
|
5925
5925
|
};
|
|
5926
|
-
ce(he, [...y ?? [],
|
|
5926
|
+
ce(he, [...y ?? [], Y]);
|
|
5927
5927
|
}
|
|
5928
5928
|
}
|
|
5929
5929
|
}
|
|
@@ -5934,26 +5934,26 @@ function _d({
|
|
|
5934
5934
|
const A = h.vehicles__items ?? [], C = h.drivers__items ?? [];
|
|
5935
5935
|
if (A.length === 0)
|
|
5936
5936
|
return /* @__PURE__ */ d("p", { style: { color: "#666", fontStyle: "italic" }, children: "Add vehicles first to configure coverage selections." }, _);
|
|
5937
|
-
const k = h.driver_vehicle_assignments ?? {},
|
|
5938
|
-
const le = $e(h, ["vehicles__items",
|
|
5937
|
+
const k = h.driver_vehicle_assignments ?? {}, J = C.length > 1, x = (q) => Object.entries(q).map(([K, Se]) => ({ value: K, label: Se })), Z = x(br), D = x(go), he = x(yo), Y = (q, K, Se) => {
|
|
5938
|
+
const le = $e(h, ["vehicles__items", q, K], Se);
|
|
5939
5939
|
r && n ? n(le) : v(le), b(le);
|
|
5940
|
-
}, ce = (
|
|
5941
|
-
const le = { ...k }, Ce = `v${
|
|
5942
|
-
le[Ce] = { ...le[Ce] ?? {} }, le[Ce][`d${
|
|
5940
|
+
}, ce = (q, K, Se) => {
|
|
5941
|
+
const le = { ...k }, Ce = `v${q}`;
|
|
5942
|
+
le[Ce] = { ...le[Ce] ?? {} }, le[Ce][`d${K}`] = Se;
|
|
5943
5943
|
const ue = $e(h, ["driver_vehicle_assignments"], le);
|
|
5944
5944
|
r && n ? n(ue) : v(ue), b(ue);
|
|
5945
|
-
},
|
|
5946
|
-
if (!q) return null;
|
|
5947
|
-
const J = k[`v${Q}`];
|
|
5945
|
+
}, oe = (q) => {
|
|
5948
5946
|
if (!J) return null;
|
|
5949
|
-
const
|
|
5947
|
+
const K = k[`v${q}`];
|
|
5948
|
+
if (!K) return null;
|
|
5949
|
+
const Se = C.map((ue, ze) => K[`d${ze}`] ?? 0), le = Se.filter((ue) => ue > 0);
|
|
5950
5950
|
if (le.length >= 2 && le.every((ue) => ue === le[0]) && le[0] === 50)
|
|
5951
|
-
return `Assignments for Vehicle ${
|
|
5951
|
+
return `Assignments for Vehicle ${q + 1} cannot be 50 percent for both Drivers.`;
|
|
5952
5952
|
const Ce = Se.reduce((ue, ze) => ue + ze, 0);
|
|
5953
5953
|
return Ce > 0 && Ce !== 100 ? `Driver percentages for this vehicle must add up to 100% (currently ${Ce}%).` : null;
|
|
5954
5954
|
};
|
|
5955
|
-
return /* @__PURE__ */ d("div", { children: A.map((
|
|
5956
|
-
const Se = [
|
|
5955
|
+
return /* @__PURE__ */ d("div", { children: A.map((q, K) => {
|
|
5956
|
+
const Se = [q.year, q.make, q.model].filter(Boolean).join(" ") || `Vehicle ${K + 1}`, le = oe(K), Ce = (ue) => typeof q[ue] == "string" ? q[ue] : "";
|
|
5957
5957
|
return /* @__PURE__ */ E(
|
|
5958
5958
|
"fieldset",
|
|
5959
5959
|
{
|
|
@@ -5964,78 +5964,78 @@ function _d({
|
|
|
5964
5964
|
/* @__PURE__ */ d(
|
|
5965
5965
|
dt,
|
|
5966
5966
|
{
|
|
5967
|
-
id: `veh-${
|
|
5967
|
+
id: `veh-${K}-comp`,
|
|
5968
5968
|
label: "Comprehensive deductible",
|
|
5969
5969
|
required: !0,
|
|
5970
5970
|
placeholder: "Select...",
|
|
5971
5971
|
options: Z,
|
|
5972
5972
|
value: Ce("vehicle_comp_deductible"),
|
|
5973
|
-
onChange: (ue) => K
|
|
5973
|
+
onChange: (ue) => Y(K, "vehicle_comp_deductible", ue.currentTarget.value)
|
|
5974
5974
|
}
|
|
5975
5975
|
),
|
|
5976
5976
|
/* @__PURE__ */ d(
|
|
5977
5977
|
dt,
|
|
5978
5978
|
{
|
|
5979
|
-
id: `veh-${
|
|
5979
|
+
id: `veh-${K}-coll`,
|
|
5980
5980
|
label: "Collision deductible",
|
|
5981
5981
|
required: !0,
|
|
5982
5982
|
placeholder: "Select...",
|
|
5983
5983
|
options: Z,
|
|
5984
5984
|
value: Ce("vehicle_coll_deductible"),
|
|
5985
|
-
onChange: (ue) => K
|
|
5985
|
+
onChange: (ue) => Y(K, "vehicle_coll_deductible", ue.currentTarget.value)
|
|
5986
5986
|
}
|
|
5987
5987
|
),
|
|
5988
5988
|
/* @__PURE__ */ d(
|
|
5989
5989
|
dt,
|
|
5990
5990
|
{
|
|
5991
|
-
id: `veh-${
|
|
5991
|
+
id: `veh-${K}-tow`,
|
|
5992
5992
|
label: "Towing and Labor",
|
|
5993
5993
|
required: !0,
|
|
5994
5994
|
placeholder: "Select...",
|
|
5995
|
-
options:
|
|
5995
|
+
options: D,
|
|
5996
5996
|
value: Ce("vehicle_towing_and_labor"),
|
|
5997
|
-
onChange: (ue) => K
|
|
5997
|
+
onChange: (ue) => Y(K, "vehicle_towing_and_labor", ue.currentTarget.value)
|
|
5998
5998
|
}
|
|
5999
5999
|
),
|
|
6000
6000
|
/* @__PURE__ */ d(
|
|
6001
6001
|
dt,
|
|
6002
6002
|
{
|
|
6003
|
-
id: `veh-${
|
|
6003
|
+
id: `veh-${K}-trans`,
|
|
6004
6004
|
label: "Transportation expense",
|
|
6005
6005
|
required: !0,
|
|
6006
6006
|
placeholder: "Select...",
|
|
6007
6007
|
options: he,
|
|
6008
6008
|
value: Ce("vehicle_transportation_expense"),
|
|
6009
|
-
onChange: (ue) => K
|
|
6009
|
+
onChange: (ue) => Y(K, "vehicle_transportation_expense", ue.currentTarget.value)
|
|
6010
6010
|
}
|
|
6011
6011
|
)
|
|
6012
6012
|
] }),
|
|
6013
|
-
|
|
6013
|
+
J && /* @__PURE__ */ E("div", { style: { marginTop: "16px" }, children: [
|
|
6014
6014
|
/* @__PURE__ */ d("p", { style: { fontWeight: 600, margin: "0 0 8px" }, children: "Drivers usage (%)" }),
|
|
6015
6015
|
/* @__PURE__ */ d("div", { style: { display: "flex", flexWrap: "wrap", gap: "12px" }, children: C.map((ue, ze) => {
|
|
6016
|
-
const
|
|
6016
|
+
const Qt = [ue.first_name, ue.last_name].filter(Boolean).join(" ") || `Driver ${ze + 1}`, Fr = k[`v${K}`]?.[`d${ze}`];
|
|
6017
6017
|
return /* @__PURE__ */ d("div", { style: { flex: "0 0 140px" }, children: /* @__PURE__ */ d(
|
|
6018
|
-
|
|
6018
|
+
nr,
|
|
6019
6019
|
{
|
|
6020
|
-
id: `assignment-v${
|
|
6021
|
-
label: `${
|
|
6020
|
+
id: `assignment-v${K}-d${ze}`,
|
|
6021
|
+
label: `${Qt} %`,
|
|
6022
6022
|
value: Fr ?? "",
|
|
6023
6023
|
min: 0,
|
|
6024
6024
|
max: 100,
|
|
6025
6025
|
step: 1,
|
|
6026
6026
|
inputMode: "numeric",
|
|
6027
|
-
onChange: (
|
|
6028
|
-
const Me =
|
|
6029
|
-
ce(
|
|
6027
|
+
onChange: (Xt) => {
|
|
6028
|
+
const Me = Xt.currentTarget.value.replace(/\D+/g, "");
|
|
6029
|
+
ce(K, ze, Me === "" ? 0 : Math.min(100, parseInt(Me, 10)));
|
|
6030
6030
|
}
|
|
6031
6031
|
}
|
|
6032
|
-
) }, `${
|
|
6032
|
+
) }, `${K}-${ze}`);
|
|
6033
6033
|
}) }),
|
|
6034
6034
|
le && /* @__PURE__ */ d("p", { style: { color: "#dc3545", fontSize: "0.85rem", marginTop: "8px", marginBottom: 0 }, children: le })
|
|
6035
6035
|
] })
|
|
6036
6036
|
]
|
|
6037
6037
|
},
|
|
6038
|
-
|
|
6038
|
+
K
|
|
6039
6039
|
);
|
|
6040
6040
|
}) }, _);
|
|
6041
6041
|
}
|
|
@@ -6045,52 +6045,52 @@ function _d({
|
|
|
6045
6045
|
return null;
|
|
6046
6046
|
if (A.length === 0 || C.length === 0)
|
|
6047
6047
|
return /* @__PURE__ */ d("p", { style: { color: "#666", fontStyle: "italic" }, children: "Add vehicles and drivers first to configure driver usage percentages." }, _);
|
|
6048
|
-
const k = h.driver_vehicle_assignments ?? {},
|
|
6049
|
-
const
|
|
6050
|
-
|
|
6048
|
+
const k = h.driver_vehicle_assignments ?? {}, J = (Z, D, he) => {
|
|
6049
|
+
const Y = { ...k }, ce = `v${Z}`;
|
|
6050
|
+
Y[ce] = { ...Y[ce] ?? {} }, Y[ce][`d${D}`] = he, z(Y);
|
|
6051
6051
|
}, x = (Z) => {
|
|
6052
6052
|
if (C.length < 2) return null;
|
|
6053
|
-
const
|
|
6054
|
-
if (!
|
|
6055
|
-
const he = C.map((
|
|
6056
|
-
if (
|
|
6053
|
+
const D = k[`v${Z}`];
|
|
6054
|
+
if (!D) return null;
|
|
6055
|
+
const he = C.map((oe, q) => D[`d${q}`] ?? 0), Y = he.filter((oe) => oe > 0);
|
|
6056
|
+
if (Y.length >= 2 && Y.every((oe) => oe === Y[0]) && Y[0] === 50)
|
|
6057
6057
|
return `Assignments for Vehicle ${Z + 1} cannot be 50 percent for both Drivers.`;
|
|
6058
|
-
const ce = he.reduce((
|
|
6058
|
+
const ce = he.reduce((oe, q) => oe + q, 0);
|
|
6059
6059
|
return ce > 0 && ce !== 100 ? `Driver percentages for this vehicle must add up to 100% (currently ${ce}%).` : null;
|
|
6060
6060
|
};
|
|
6061
6061
|
return /* @__PURE__ */ E("div", { children: [
|
|
6062
6062
|
/* @__PURE__ */ d("h4", { style: { marginBottom: "12px" }, children: T }),
|
|
6063
|
-
A.map((Z,
|
|
6064
|
-
const he = [Z.year, Z.make, Z.model].filter(Boolean).join(" ") || `Vehicle ${
|
|
6063
|
+
A.map((Z, D) => {
|
|
6064
|
+
const he = [Z.year, Z.make, Z.model].filter(Boolean).join(" ") || `Vehicle ${D + 1}`, Y = x(D);
|
|
6065
6065
|
return /* @__PURE__ */ E(
|
|
6066
6066
|
"fieldset",
|
|
6067
6067
|
{
|
|
6068
|
-
style: { border: `1px solid ${
|
|
6068
|
+
style: { border: `1px solid ${Y ? "#dc3545" : "#ddd"}`, borderRadius: "8px", padding: "16px", marginBottom: "16px" },
|
|
6069
6069
|
children: [
|
|
6070
6070
|
/* @__PURE__ */ d("legend", { style: { fontWeight: 600, padding: "0 8px" }, children: he }),
|
|
6071
|
-
/* @__PURE__ */ d("div", { style: { display: "flex", flexWrap: "wrap", gap: "12px" }, children: C.map((ce,
|
|
6072
|
-
const
|
|
6071
|
+
/* @__PURE__ */ d("div", { style: { display: "flex", flexWrap: "wrap", gap: "12px" }, children: C.map((ce, oe) => {
|
|
6072
|
+
const q = [ce.first_name, ce.last_name].filter(Boolean).join(" ") || `Driver ${oe + 1}`, K = k[`v${D}`]?.[`d${oe}`];
|
|
6073
6073
|
return /* @__PURE__ */ d("div", { style: { flex: "0 0 140px" }, children: /* @__PURE__ */ d(
|
|
6074
|
-
|
|
6074
|
+
nr,
|
|
6075
6075
|
{
|
|
6076
|
-
id: `assignment-v${
|
|
6077
|
-
label: `${
|
|
6078
|
-
value:
|
|
6076
|
+
id: `assignment-v${D}-d${oe}`,
|
|
6077
|
+
label: `${q} %`,
|
|
6078
|
+
value: K ?? "",
|
|
6079
6079
|
min: 0,
|
|
6080
6080
|
max: 100,
|
|
6081
6081
|
step: 1,
|
|
6082
6082
|
inputMode: "numeric",
|
|
6083
6083
|
onChange: (Se) => {
|
|
6084
6084
|
const le = Se.currentTarget.value.replace(/\D+/g, "");
|
|
6085
|
-
|
|
6085
|
+
J(D, oe, le === "" ? 0 : Math.min(100, parseInt(le, 10)));
|
|
6086
6086
|
}
|
|
6087
6087
|
}
|
|
6088
|
-
) }, `${
|
|
6088
|
+
) }, `${D}-${oe}`);
|
|
6089
6089
|
}) }),
|
|
6090
|
-
|
|
6090
|
+
Y && /* @__PURE__ */ d("p", { style: { color: "#dc3545", fontSize: "0.85rem", marginTop: "8px", marginBottom: 0 }, children: Y })
|
|
6091
6091
|
]
|
|
6092
6092
|
},
|
|
6093
|
-
|
|
6093
|
+
D
|
|
6094
6094
|
);
|
|
6095
6095
|
})
|
|
6096
6096
|
] }, _);
|
|
@@ -6098,23 +6098,23 @@ function _d({
|
|
|
6098
6098
|
switch (S.inputType) {
|
|
6099
6099
|
case "text": {
|
|
6100
6100
|
if (_ === "vin" && i) {
|
|
6101
|
-
const A = y ? y.join("-") : "_root", C =
|
|
6101
|
+
const A = y ? y.join("-") : "_root", C = re[A] ?? !1, k = Q[A] ?? null, J = [w ? `${_}-hint` : null, P ? `${_}-error` : null, k ? `${_}-vin-error` : null].filter(Boolean).join(" ");
|
|
6102
6102
|
return /* @__PURE__ */ E("div", { children: [
|
|
6103
|
-
/* @__PURE__ */ d(xe, { id: _, label: T, hint: w, error:
|
|
6103
|
+
/* @__PURE__ */ d(xe, { id: _, label: T, hint: w, error: P, required: H, children: /* @__PURE__ */ E("div", { className: "flex items-end gap-2", children: [
|
|
6104
6104
|
/* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ d(
|
|
6105
6105
|
"input",
|
|
6106
6106
|
{
|
|
6107
6107
|
id: _,
|
|
6108
|
-
className: `form-input ${
|
|
6109
|
-
"aria-invalid":
|
|
6110
|
-
"aria-describedby":
|
|
6108
|
+
className: `form-input ${P ? "input-error" : ""}`,
|
|
6109
|
+
"aria-invalid": !!P,
|
|
6110
|
+
"aria-describedby": J || void 0,
|
|
6111
6111
|
"aria-required": H || void 0,
|
|
6112
6112
|
required: H,
|
|
6113
|
-
value: De(
|
|
6113
|
+
value: De(L),
|
|
6114
6114
|
maxLength: 17,
|
|
6115
|
-
onChange: (x) =>
|
|
6115
|
+
onChange: (x) => z(x.currentTarget.value),
|
|
6116
6116
|
onBlur: () => f(_, "text", y),
|
|
6117
|
-
autoComplete:
|
|
6117
|
+
autoComplete: Mt[_],
|
|
6118
6118
|
type: "text"
|
|
6119
6119
|
}
|
|
6120
6120
|
) }),
|
|
@@ -6122,9 +6122,9 @@ function _d({
|
|
|
6122
6122
|
"button",
|
|
6123
6123
|
{
|
|
6124
6124
|
type: "button",
|
|
6125
|
-
disabled: C || !fn(De(
|
|
6125
|
+
disabled: C || !fn(De(L)),
|
|
6126
6126
|
className: "btn btn-outline shrink-0 self-end !w-auto min-w-[8.5rem] px-4 whitespace-nowrap disabled:opacity-50",
|
|
6127
|
-
onClick: () =>
|
|
6127
|
+
onClick: () => fe(y, De(L)),
|
|
6128
6128
|
children: C ? "Looking up..." : "Verify VIN"
|
|
6129
6129
|
}
|
|
6130
6130
|
)
|
|
@@ -6133,7 +6133,7 @@ function _d({
|
|
|
6133
6133
|
] }, _);
|
|
6134
6134
|
}
|
|
6135
6135
|
if (_ === "sms_code") {
|
|
6136
|
-
const A = De(
|
|
6136
|
+
const A = De(L);
|
|
6137
6137
|
return /* @__PURE__ */ d(
|
|
6138
6138
|
Ur,
|
|
6139
6139
|
{
|
|
@@ -6146,12 +6146,12 @@ function _d({
|
|
|
6146
6146
|
maxLength: 6,
|
|
6147
6147
|
onChange: (C) => {
|
|
6148
6148
|
const k = C.currentTarget.value.replace(/\D+/g, "").slice(0, 6);
|
|
6149
|
-
|
|
6149
|
+
z(k);
|
|
6150
6150
|
},
|
|
6151
6151
|
onBlur: () => f(_, "text", y),
|
|
6152
6152
|
"aria-required": H || void 0,
|
|
6153
|
-
error:
|
|
6154
|
-
autoComplete:
|
|
6153
|
+
error: P,
|
|
6154
|
+
autoComplete: Mt[_]
|
|
6155
6155
|
},
|
|
6156
6156
|
_
|
|
6157
6157
|
);
|
|
@@ -6162,12 +6162,12 @@ function _d({
|
|
|
6162
6162
|
id: _,
|
|
6163
6163
|
label: T,
|
|
6164
6164
|
hint: w,
|
|
6165
|
-
value: De(
|
|
6166
|
-
onChange: (A) =>
|
|
6165
|
+
value: De(L),
|
|
6166
|
+
onChange: (A) => z(A.currentTarget.value),
|
|
6167
6167
|
onBlur: () => f(_, "text", y),
|
|
6168
6168
|
"aria-required": H || void 0,
|
|
6169
|
-
error:
|
|
6170
|
-
autoComplete:
|
|
6169
|
+
error: P,
|
|
6170
|
+
autoComplete: Mt[_]
|
|
6171
6171
|
},
|
|
6172
6172
|
_
|
|
6173
6173
|
);
|
|
@@ -6178,11 +6178,11 @@ function _d({
|
|
|
6178
6178
|
{
|
|
6179
6179
|
id: _,
|
|
6180
6180
|
label: T,
|
|
6181
|
-
value: De(
|
|
6182
|
-
onChange: (A) =>
|
|
6181
|
+
value: De(L),
|
|
6182
|
+
onChange: (A) => z(A.currentTarget.value),
|
|
6183
6183
|
onBlur: () => f(_, "email", y),
|
|
6184
6184
|
"aria-required": H || void 0,
|
|
6185
|
-
error:
|
|
6185
|
+
error: P
|
|
6186
6186
|
},
|
|
6187
6187
|
_
|
|
6188
6188
|
);
|
|
@@ -6192,26 +6192,26 @@ function _d({
|
|
|
6192
6192
|
{
|
|
6193
6193
|
id: _,
|
|
6194
6194
|
label: T,
|
|
6195
|
-
value: De(
|
|
6196
|
-
onChange: (A) =>
|
|
6195
|
+
value: De(L),
|
|
6196
|
+
onChange: (A) => z(A.currentTarget.value),
|
|
6197
6197
|
onBlur: () => f(_, "password", y),
|
|
6198
6198
|
"aria-required": H || void 0,
|
|
6199
|
-
error:
|
|
6199
|
+
error: P
|
|
6200
6200
|
},
|
|
6201
6201
|
_
|
|
6202
6202
|
);
|
|
6203
6203
|
case "tel":
|
|
6204
|
-
return /* @__PURE__ */ E(
|
|
6204
|
+
return /* @__PURE__ */ E(zt, { children: [
|
|
6205
6205
|
/* @__PURE__ */ d(
|
|
6206
6206
|
Uo,
|
|
6207
6207
|
{
|
|
6208
6208
|
id: _,
|
|
6209
6209
|
label: T,
|
|
6210
|
-
value: De(
|
|
6211
|
-
onChange: (A) =>
|
|
6210
|
+
value: De(L),
|
|
6211
|
+
onChange: (A) => z(A.currentTarget.value),
|
|
6212
6212
|
onBlur: () => f(_, "tel", y),
|
|
6213
6213
|
"aria-required": H || void 0,
|
|
6214
|
-
error:
|
|
6214
|
+
error: P
|
|
6215
6215
|
},
|
|
6216
6216
|
_
|
|
6217
6217
|
),
|
|
@@ -6236,23 +6236,23 @@ function _d({
|
|
|
6236
6236
|
{
|
|
6237
6237
|
id: _,
|
|
6238
6238
|
label: T,
|
|
6239
|
-
value: De(
|
|
6240
|
-
onChange: (A) =>
|
|
6239
|
+
value: De(L),
|
|
6240
|
+
onChange: (A) => z(A.currentTarget.value),
|
|
6241
6241
|
onBlur: () => f(_, "url", y),
|
|
6242
6242
|
"aria-required": H || void 0,
|
|
6243
|
-
error:
|
|
6243
|
+
error: P
|
|
6244
6244
|
},
|
|
6245
6245
|
_
|
|
6246
6246
|
);
|
|
6247
6247
|
case "number": {
|
|
6248
6248
|
const A = nd[_];
|
|
6249
6249
|
return /* @__PURE__ */ d(
|
|
6250
|
-
|
|
6250
|
+
nr,
|
|
6251
6251
|
{
|
|
6252
6252
|
id: _,
|
|
6253
6253
|
label: T,
|
|
6254
6254
|
hint: w,
|
|
6255
|
-
value: ud(
|
|
6255
|
+
value: ud(L),
|
|
6256
6256
|
inputMode: "numeric",
|
|
6257
6257
|
pattern: "[0-9]*",
|
|
6258
6258
|
onKeyDown: (C) => {
|
|
@@ -6264,11 +6264,11 @@ function _d({
|
|
|
6264
6264
|
},
|
|
6265
6265
|
onChange: (C) => {
|
|
6266
6266
|
let k = C.currentTarget.value;
|
|
6267
|
-
A !== void 0 && (k = k.slice(0, A)),
|
|
6267
|
+
A !== void 0 && (k = k.slice(0, A)), z(td(k));
|
|
6268
6268
|
},
|
|
6269
6269
|
onBlur: () => f(_, "number", y),
|
|
6270
6270
|
"aria-required": H || void 0,
|
|
6271
|
-
error:
|
|
6271
|
+
error: P
|
|
6272
6272
|
},
|
|
6273
6273
|
_
|
|
6274
6274
|
);
|
|
@@ -6279,11 +6279,11 @@ function _d({
|
|
|
6279
6279
|
{
|
|
6280
6280
|
id: _,
|
|
6281
6281
|
label: T,
|
|
6282
|
-
value: De(
|
|
6283
|
-
onChange: (A) =>
|
|
6282
|
+
value: De(L),
|
|
6283
|
+
onChange: (A) => z(A.currentTarget.value),
|
|
6284
6284
|
onBlur: () => f(_, "textarea", y),
|
|
6285
6285
|
"aria-required": H || void 0,
|
|
6286
|
-
error:
|
|
6286
|
+
error: P,
|
|
6287
6287
|
rows: 4
|
|
6288
6288
|
},
|
|
6289
6289
|
_
|
|
@@ -6296,47 +6296,47 @@ function _d({
|
|
|
6296
6296
|
id: _,
|
|
6297
6297
|
label: T,
|
|
6298
6298
|
hint: w,
|
|
6299
|
-
value: De(
|
|
6299
|
+
value: De(L),
|
|
6300
6300
|
min: A,
|
|
6301
6301
|
max: C,
|
|
6302
6302
|
onChange: (k) => {
|
|
6303
|
-
const
|
|
6304
|
-
|
|
6303
|
+
const J = k.currentTarget.value;
|
|
6304
|
+
z(J), !je(J, "date") && !yr(_, J) && U(_, ee(y, _, J));
|
|
6305
6305
|
},
|
|
6306
6306
|
onBlur: () => f(_, "date", y),
|
|
6307
6307
|
"aria-required": H || void 0,
|
|
6308
|
-
error:
|
|
6309
|
-
autoComplete:
|
|
6308
|
+
error: P,
|
|
6309
|
+
autoComplete: Mt[_]
|
|
6310
6310
|
},
|
|
6311
6311
|
_
|
|
6312
6312
|
);
|
|
6313
6313
|
}
|
|
6314
6314
|
case "checkbox": {
|
|
6315
6315
|
if (S.options) {
|
|
6316
|
-
const A = Array.isArray(
|
|
6316
|
+
const A = Array.isArray(L) ? L : [];
|
|
6317
6317
|
return /* @__PURE__ */ E("div", { className: "space-y-2", children: [
|
|
6318
6318
|
/* @__PURE__ */ E("div", { className: "form-label", children: [
|
|
6319
6319
|
T,
|
|
6320
6320
|
H && /* @__PURE__ */ d("span", { className: "text-red-600 ml-1", children: "*" })
|
|
6321
6321
|
] }),
|
|
6322
6322
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: S.options.map((C) => {
|
|
6323
|
-
const k = `${_}-${vr(C)}`,
|
|
6323
|
+
const k = `${_}-${vr(C)}`, J = A.includes(C);
|
|
6324
6324
|
return /* @__PURE__ */ d(
|
|
6325
6325
|
Hr,
|
|
6326
6326
|
{
|
|
6327
6327
|
id: k,
|
|
6328
6328
|
label: C,
|
|
6329
|
-
checked:
|
|
6329
|
+
checked: J,
|
|
6330
6330
|
onChange: (x) => {
|
|
6331
6331
|
const Z = new Set(A);
|
|
6332
|
-
x.currentTarget.checked ? Z.add(C) : Z.delete(C),
|
|
6332
|
+
x.currentTarget.checked ? Z.add(C) : Z.delete(C), z(Array.from(Z));
|
|
6333
6333
|
},
|
|
6334
6334
|
"aria-required": H || void 0
|
|
6335
6335
|
},
|
|
6336
6336
|
k
|
|
6337
6337
|
);
|
|
6338
6338
|
}) }),
|
|
6339
|
-
|
|
6339
|
+
P && /* @__PURE__ */ d("p", { className: "mt-1 text-sm text-red-600", children: P })
|
|
6340
6340
|
] }, _);
|
|
6341
6341
|
}
|
|
6342
6342
|
return /* @__PURE__ */ d(
|
|
@@ -6344,15 +6344,15 @@ function _d({
|
|
|
6344
6344
|
{
|
|
6345
6345
|
id: _,
|
|
6346
6346
|
label: H ? `${T} *` : T,
|
|
6347
|
-
checked: !!
|
|
6348
|
-
onChange: (A) =>
|
|
6347
|
+
checked: !!L,
|
|
6348
|
+
onChange: (A) => z(A.currentTarget.checked),
|
|
6349
6349
|
"aria-required": H || void 0
|
|
6350
6350
|
},
|
|
6351
6351
|
_
|
|
6352
6352
|
);
|
|
6353
6353
|
}
|
|
6354
6354
|
case "radio": {
|
|
6355
|
-
if (
|
|
6355
|
+
if (Ft(S))
|
|
6356
6356
|
return null;
|
|
6357
6357
|
const A = S.options ?? [], C = y && y.length > 0 ? `${_}__${y.join("__")}` : _;
|
|
6358
6358
|
return /* @__PURE__ */ d(Vo, { legend: T, legendClassName: H ? "legend-required" : void 0, children: A.map((k) => /* @__PURE__ */ d(
|
|
@@ -6360,9 +6360,9 @@ function _d({
|
|
|
6360
6360
|
{
|
|
6361
6361
|
name: C,
|
|
6362
6362
|
value: k,
|
|
6363
|
-
checked:
|
|
6363
|
+
checked: L === k,
|
|
6364
6364
|
onChange: () => {
|
|
6365
|
-
|
|
6365
|
+
z(k), U(_, ee(y, _, k));
|
|
6366
6366
|
},
|
|
6367
6367
|
children: bn[_]?.[k] ?? k
|
|
6368
6368
|
},
|
|
@@ -6374,71 +6374,71 @@ function _d({
|
|
|
6374
6374
|
_ === "quote_vehicle_id" && (A = r?.vehicles__items?.map((x) => x.vin) ?? []);
|
|
6375
6375
|
let C = !1, k;
|
|
6376
6376
|
if (_ === "make" || _ === "model" || _ === "body_style") {
|
|
6377
|
-
const x = y ? y.join("-") : "_root", Z =
|
|
6377
|
+
const x = y ? y.join("-") : "_root", Z = ke(h, y, "year"), D = typeof Z == "number" ? Z : Number(Z);
|
|
6378
6378
|
if (_ === "make") {
|
|
6379
6379
|
const he = `${x}:makes`;
|
|
6380
|
-
if (!
|
|
6380
|
+
if (!D || !Number.isFinite(D))
|
|
6381
6381
|
C = !0, k = "Select a year first";
|
|
6382
6382
|
else {
|
|
6383
|
-
const
|
|
6384
|
-
|
|
6383
|
+
const Y = ne(x, { year: D });
|
|
6384
|
+
Y && Y.length > 0 ? A = Y : M[he] ? (C = !0, k = "Loading makes...") : A = [...Du];
|
|
6385
6385
|
}
|
|
6386
6386
|
} else if (_ === "model") {
|
|
6387
|
-
const he = `${x}:models`,
|
|
6388
|
-
if (!
|
|
6387
|
+
const he = `${x}:models`, Y = String(ke(h, y, "make") ?? "");
|
|
6388
|
+
if (!Y)
|
|
6389
6389
|
C = !0, k = "Select a make first";
|
|
6390
|
-
else if (
|
|
6391
|
-
const ce =
|
|
6392
|
-
ce && ce.length > 0 ? A = ce :
|
|
6390
|
+
else if (D && Number.isFinite(D)) {
|
|
6391
|
+
const ce = ne(x, { year: D, make: Y });
|
|
6392
|
+
ce && ce.length > 0 ? A = ce : M[he] ? (C = !0, k = "Loading models...") : A = [...Qu];
|
|
6393
6393
|
}
|
|
6394
|
-
typeof
|
|
6394
|
+
typeof L == "string" && L && !A.includes(L) && (A = [L, ...A]);
|
|
6395
6395
|
} else {
|
|
6396
|
-
const he = `${x}:bodyStyles`,
|
|
6396
|
+
const he = `${x}:bodyStyles`, Y = String(ke(h, y, "make") ?? ""), ce = String(ke(h, y, "model") ?? "");
|
|
6397
6397
|
if (!ce)
|
|
6398
6398
|
C = !0, k = "Select a model first";
|
|
6399
|
-
else if (
|
|
6400
|
-
const
|
|
6401
|
-
|
|
6399
|
+
else if (D && Number.isFinite(D) && Y) {
|
|
6400
|
+
const oe = ne(x, { year: D, make: Y, model: ce });
|
|
6401
|
+
oe && oe.length > 0 ? A = oe : M[he] ? (C = !0, k = "Loading body styles...") : A = [...Xu];
|
|
6402
6402
|
}
|
|
6403
|
-
typeof
|
|
6403
|
+
typeof L == "string" && L && !A.includes(L) && (A = [L, ...A]);
|
|
6404
6404
|
}
|
|
6405
6405
|
}
|
|
6406
6406
|
if (_ === "occupation" || _ === "co_applicant_occupation") {
|
|
6407
|
-
const x = _ === "co_applicant_occupation" ? "co_applicant_employment_industry" : void 0, Z = x ? void 0 :
|
|
6408
|
-
A = [...gn[
|
|
6407
|
+
const x = _ === "co_applicant_occupation" ? "co_applicant_employment_industry" : void 0, Z = x ? void 0 : ke(h, y, "industry"), D = ke(h, y, x ?? "employment_industry"), Y = String(Gt(Z ?? D) ?? "").trim();
|
|
6408
|
+
A = [...gn[Y] ?? ed], typeof L == "string" && L && !A.includes(L) && (A = [L, ...A]);
|
|
6409
6409
|
}
|
|
6410
|
-
const
|
|
6410
|
+
const J = cd(y, _);
|
|
6411
6411
|
return /* @__PURE__ */ d(
|
|
6412
6412
|
dt,
|
|
6413
6413
|
{
|
|
6414
|
-
id:
|
|
6414
|
+
id: J,
|
|
6415
6415
|
label: k ? `${T} — ${k}` : T,
|
|
6416
6416
|
"aria-required": H || void 0,
|
|
6417
|
-
error:
|
|
6417
|
+
error: P,
|
|
6418
6418
|
disabled: C,
|
|
6419
|
-
value: dd(
|
|
6419
|
+
value: dd(L),
|
|
6420
6420
|
onChange: (x) => {
|
|
6421
6421
|
const Z = x.currentTarget.value;
|
|
6422
6422
|
if (_ !== "year" && _ !== "make" && _ !== "model" && _ !== "industry" && _ !== "employment_industry" && _ !== "co_applicant_employment_industry") {
|
|
6423
|
-
|
|
6423
|
+
z(Z), U(_, ee(y, _, Z));
|
|
6424
6424
|
return;
|
|
6425
6425
|
}
|
|
6426
|
-
let
|
|
6426
|
+
let D = Ee(h, y, _, Z);
|
|
6427
6427
|
if (_ === "year")
|
|
6428
|
-
|
|
6428
|
+
D = Ee(D, y, "make", ""), D = Ee(D, y, "model", ""), D = Ee(D, y, "body_style", "");
|
|
6429
6429
|
else if (_ === "make")
|
|
6430
|
-
|
|
6430
|
+
D = Ee(D, y, "model", ""), D = Ee(D, y, "body_style", "");
|
|
6431
6431
|
else if (_ === "model")
|
|
6432
|
-
|
|
6432
|
+
D = Ee(D, y, "body_style", "");
|
|
6433
6433
|
else if (_ === "industry" || _ === "employment_industry")
|
|
6434
|
-
|
|
6434
|
+
D = Ee(D, y, "occupation", "");
|
|
6435
6435
|
else if (_ === "co_applicant_employment_industry") {
|
|
6436
|
-
const
|
|
6437
|
-
|
|
6436
|
+
const Y = String(Gt(Z) ?? "").trim(), ce = gn[Y] ?? [], oe = ce.find((q) => q === Y) ?? ce[0] ?? "";
|
|
6437
|
+
D = Ee(D, y, "co_applicant_occupation", oe ?? "");
|
|
6438
6438
|
}
|
|
6439
|
-
r && n ? n(
|
|
6440
|
-
const he = y ? yt(
|
|
6441
|
-
|
|
6439
|
+
r && n ? n(D) : v(D), b(D);
|
|
6440
|
+
const he = y ? yt(D, y) ?? {} : D;
|
|
6441
|
+
U(_, { ...he, [_]: Z });
|
|
6442
6442
|
},
|
|
6443
6443
|
placeholder: k ?? "Select an option",
|
|
6444
6444
|
options: A.map((x) => ({
|
|
@@ -6446,7 +6446,7 @@ function _d({
|
|
|
6446
6446
|
label: bn[_]?.[x] ?? qu[x] ?? x
|
|
6447
6447
|
}))
|
|
6448
6448
|
},
|
|
6449
|
-
|
|
6449
|
+
J
|
|
6450
6450
|
);
|
|
6451
6451
|
}
|
|
6452
6452
|
case "address":
|
|
@@ -6455,19 +6455,19 @@ function _d({
|
|
|
6455
6455
|
{
|
|
6456
6456
|
id: _,
|
|
6457
6457
|
label: T,
|
|
6458
|
-
value: De(
|
|
6458
|
+
value: De(L),
|
|
6459
6459
|
onChange: (A, C) => {
|
|
6460
|
-
let k =
|
|
6460
|
+
let k = Ee(h, y, _, A);
|
|
6461
6461
|
if (C?.state) {
|
|
6462
|
-
const
|
|
6463
|
-
k = $e(k,
|
|
6462
|
+
const J = y ? [...y, "state"] : ["state"];
|
|
6463
|
+
k = $e(k, J, C.state);
|
|
6464
6464
|
}
|
|
6465
6465
|
r && n ? n(k) : v(k), b(k);
|
|
6466
6466
|
},
|
|
6467
6467
|
onBlur: () => f(_, "address", y),
|
|
6468
6468
|
required: H,
|
|
6469
6469
|
"aria-required": H || void 0,
|
|
6470
|
-
error:
|
|
6470
|
+
error: P
|
|
6471
6471
|
},
|
|
6472
6472
|
_
|
|
6473
6473
|
);
|
|
@@ -6475,73 +6475,73 @@ function _d({
|
|
|
6475
6475
|
return null;
|
|
6476
6476
|
}
|
|
6477
6477
|
}
|
|
6478
|
-
function
|
|
6478
|
+
function V(S, y) {
|
|
6479
6479
|
return S.map((_, T) => {
|
|
6480
6480
|
const w = String(_.key);
|
|
6481
|
-
if (
|
|
6481
|
+
if (!$t(_, h, c) || !lr(_, h, y) || !ur(_, h) || !Pt(_, h, a)) return null;
|
|
6482
6482
|
if (dr(w, _, h, a)) {
|
|
6483
6483
|
const C = c.currentCarrierKey ? h[c.currentCarrierKey] : void 0;
|
|
6484
6484
|
if (!(C && C !== "NoPriorInsurance" && at(h, c) && cr.has(w))) return null;
|
|
6485
6485
|
}
|
|
6486
|
-
const
|
|
6486
|
+
const L = N(_, y), H = _.conditionals ?? [];
|
|
6487
6487
|
if (!H.length)
|
|
6488
6488
|
return a === "BundlePolicy" && w === "policy_bi" ? /* @__PURE__ */ E("div", { children: [
|
|
6489
6489
|
/* @__PURE__ */ d("h3", { className: "text-lg font-semibold mt-6 mb-3", children: "Vehicle Coverage Information" }),
|
|
6490
|
-
|
|
6491
|
-
] }, `wrap-${w}-${T}`) : /* @__PURE__ */ d("div", { children:
|
|
6492
|
-
const
|
|
6490
|
+
L
|
|
6491
|
+
] }, `wrap-${w}-${T}`) : /* @__PURE__ */ d("div", { children: L }, `wrap-${w}-${T}`);
|
|
6492
|
+
const P = Sn(_, ke(h, y, w)), z = H.filter((C) => mt(P, C.conditionalType, C.conditionalValue)), A = z.length > 1 && !z.some((C) => C.conditionalQuestionsAllowMultiple) ? z.slice(0, 1) : z;
|
|
6493
6493
|
return /* @__PURE__ */ E("div", { children: [
|
|
6494
|
-
|
|
6494
|
+
L,
|
|
6495
6495
|
A.map((C, k) => {
|
|
6496
|
-
const
|
|
6497
|
-
if (!
|
|
6496
|
+
const J = C.conditionalQuestions ?? [];
|
|
6497
|
+
if (!J.length) return null;
|
|
6498
6498
|
if (!C.conditionalQuestionsAllowMultiple)
|
|
6499
|
-
return /* @__PURE__ */ d("div", { className: "mt-3", children:
|
|
6500
|
-
const x =
|
|
6501
|
-
const
|
|
6502
|
-
r && n ? n(
|
|
6503
|
-
},
|
|
6504
|
-
const
|
|
6505
|
-
r && n ? n(
|
|
6499
|
+
return /* @__PURE__ */ d("div", { className: "mt-3", children: V(J, y) }, `branch-${w}-${k}`);
|
|
6500
|
+
const x = Rt(w), Z = yt(h, [...y ?? [], x]) ?? [], D = Math.max(1, Z.length || 1), he = () => {
|
|
6501
|
+
const oe = $e(h, [...y ?? [], x, Z.length], {});
|
|
6502
|
+
r && n ? n(oe) : v(oe), b(oe);
|
|
6503
|
+
}, Y = () => {
|
|
6504
|
+
const oe = Z.slice(0, Math.max(0, Z.length - 1)), q = $e(h, [...y ?? [], x], oe);
|
|
6505
|
+
r && n ? n(q) : v(q), b(q);
|
|
6506
6506
|
}, ce = `${w}__c${k}`;
|
|
6507
6507
|
return /* @__PURE__ */ E("div", { className: "mt-3", children: [
|
|
6508
6508
|
/* @__PURE__ */ E("div", { className: "flex items-center justify-between mb-2", children: [
|
|
6509
6509
|
/* @__PURE__ */ d("div", { className: "text-sm font-medium opacity-75", children: "Add one or more entries" }),
|
|
6510
6510
|
/* @__PURE__ */ E("div", { className: "space-x-2", children: [
|
|
6511
6511
|
/* @__PURE__ */ d("button", { type: "button", className: "btn-outline px-3 py-1", onClick: he, children: "Add another" }),
|
|
6512
|
-
|
|
6512
|
+
D > 1 && /* @__PURE__ */ d("button", { type: "button", className: "btn-outline px-3 py-1", onClick: Y, children: "Remove last" })
|
|
6513
6513
|
] })
|
|
6514
6514
|
] }),
|
|
6515
|
-
Array.from({ length:
|
|
6516
|
-
const
|
|
6515
|
+
Array.from({ length: D }).map((oe, q) => {
|
|
6516
|
+
const K = [...y ?? [], x, q], Se = `${ce}__i${q}`, le = Z[q] ?? {}, Ce = w === "drivers", Qt = Ce ? `Driver #${q + 1}` : w === "vehicles" ? `Vehicle #${q + 1}` : w === "home_losses" || w === "losses" ? `Loss #${q + 1}` : `Entry #${q + 1}`, Xt = Ce && typeof le.ssn_display == "string" && le.ssn_display ? ` — ${le.ssn_display}` : "";
|
|
6517
6517
|
return /* @__PURE__ */ E("div", { className: "rounded-lg border p-3 mb-3", children: [
|
|
6518
6518
|
/* @__PURE__ */ E("div", { className: "text-sm font-semibold mb-2", children: [
|
|
6519
|
-
|
|
6520
|
-
|
|
6519
|
+
Qt,
|
|
6520
|
+
Xt
|
|
6521
6521
|
] }),
|
|
6522
|
-
|
|
6523
|
-
const
|
|
6524
|
-
if (
|
|
6525
|
-
if (dr(
|
|
6522
|
+
J.map((Me) => {
|
|
6523
|
+
const er = String(Me.key);
|
|
6524
|
+
if (!$t(Me, h, c) || !lr(Me, h, K) || !ur(Me, h) || !Pt(Me, h, a)) return null;
|
|
6525
|
+
if (dr(er, Me, h, a)) {
|
|
6526
6526
|
const ut = c.currentCarrierKey ? h[c.currentCarrierKey] : void 0;
|
|
6527
|
-
if (!(ut && ut !== "NoPriorInsurance" && at(h, c) && cr.has(
|
|
6527
|
+
if (!(ut && ut !== "NoPriorInsurance" && at(h, c) && cr.has(er))) return null;
|
|
6528
6528
|
}
|
|
6529
6529
|
return /* @__PURE__ */ E("div", { className: "mt-3", children: [
|
|
6530
|
-
N(Me,
|
|
6530
|
+
N(Me, K),
|
|
6531
6531
|
(() => {
|
|
6532
6532
|
const ut = Me.conditionals ?? [];
|
|
6533
6533
|
if (!ut.length) return null;
|
|
6534
|
-
const Br =
|
|
6535
|
-
return (wt.length > 1 && !wt.some((Ve) => Ve.conditionalQuestionsAllowMultiple) ? wt.slice(0, 1) : wt).map((Ve,
|
|
6536
|
-
const
|
|
6537
|
-
if (!
|
|
6534
|
+
const Br = ke(h, K, Me.key), wt = ut.filter((Ve) => mt(Br, Ve.conditionalType, Ve.conditionalValue));
|
|
6535
|
+
return (wt.length > 1 && !wt.some((Ve) => Ve.conditionalQuestionsAllowMultiple) ? wt.slice(0, 1) : wt).map((Ve, tr) => {
|
|
6536
|
+
const rr = Ve.conditionalQuestions ?? [];
|
|
6537
|
+
if (!rr.length) return null;
|
|
6538
6538
|
if (!Ve.conditionalQuestionsAllowMultiple)
|
|
6539
|
-
return /* @__PURE__ */ d("div", { className: "mt-3", children:
|
|
6540
|
-
const Ct =
|
|
6541
|
-
const tt = $e(h, [...
|
|
6539
|
+
return /* @__PURE__ */ d("div", { className: "mt-3", children: V(rr, K) }, `nested-${Se}-${tr}`);
|
|
6540
|
+
const Ct = Rt(Me.key), At = yt(h, [...K, Ct]) ?? [], zr = Math.max(1, At.length || 1), Po = () => {
|
|
6541
|
+
const tt = $e(h, [...K, Ct, At.length], {});
|
|
6542
6542
|
r && n ? n(tt) : v(tt), b(tt);
|
|
6543
6543
|
}, $o = () => {
|
|
6544
|
-
const tt = At.slice(0, Math.max(0, At.length - 1)), Ye = $e(h, [...
|
|
6544
|
+
const tt = At.slice(0, Math.max(0, At.length - 1)), Ye = $e(h, [...K, Ct], tt);
|
|
6545
6545
|
r && n ? n(Ye) : v(Ye), b(Ye);
|
|
6546
6546
|
};
|
|
6547
6547
|
return /* @__PURE__ */ E("div", { className: "mt-3", children: [
|
|
@@ -6553,19 +6553,19 @@ function _d({
|
|
|
6553
6553
|
] })
|
|
6554
6554
|
] }),
|
|
6555
6555
|
Array.from({ length: zr }).map((tt, Ye) => {
|
|
6556
|
-
const xo = [...
|
|
6556
|
+
const xo = [...K, Ct, Ye];
|
|
6557
6557
|
return /* @__PURE__ */ E("div", { className: "rounded-lg border p-3 mb-3", children: [
|
|
6558
6558
|
/* @__PURE__ */ E("div", { className: "text-sm font-semibold mb-2", children: [
|
|
6559
6559
|
"Entry #",
|
|
6560
6560
|
Ye + 1
|
|
6561
6561
|
] }),
|
|
6562
|
-
|
|
6563
|
-
] }, `nested-item-${Se}-${
|
|
6562
|
+
V(rr, xo)
|
|
6563
|
+
] }, `nested-item-${Se}-${tr}-${Ye}`);
|
|
6564
6564
|
})
|
|
6565
|
-
] }, `nested-repeat-${Se}-${
|
|
6565
|
+
] }, `nested-repeat-${Se}-${tr}`);
|
|
6566
6566
|
});
|
|
6567
6567
|
})()
|
|
6568
|
-
] }, `${Se}-${
|
|
6568
|
+
] }, `${Se}-${er}`);
|
|
6569
6569
|
})
|
|
6570
6570
|
] }, `group-${Se}`);
|
|
6571
6571
|
})
|
|
@@ -6577,17 +6577,17 @@ function _d({
|
|
|
6577
6577
|
const F = be(() => {
|
|
6578
6578
|
const S = [], y = (_, T) => {
|
|
6579
6579
|
_.forEach((w) => {
|
|
6580
|
-
if (
|
|
6581
|
-
const
|
|
6582
|
-
if (dr(
|
|
6580
|
+
if (!$t(w, h, c) || !lr(w, h, T) || !ur(w, h) || !Pt(w, h, a)) return;
|
|
6581
|
+
const L = String(w.key);
|
|
6582
|
+
if (dr(L, w, h, a)) {
|
|
6583
6583
|
const C = c.currentCarrierKey ? h[c.currentCarrierKey] : void 0;
|
|
6584
|
-
if (!(C && C !== "NoPriorInsurance" && at(h, c) && cr.has(
|
|
6584
|
+
if (!(C && C !== "NoPriorInsurance" && at(h, c) && cr.has(L))) return;
|
|
6585
6585
|
}
|
|
6586
|
-
|
|
6586
|
+
Ft(w) || S.push(w);
|
|
6587
6587
|
const H = w.conditionals ?? [];
|
|
6588
6588
|
if (!H.length) return;
|
|
6589
|
-
const
|
|
6590
|
-
(
|
|
6589
|
+
const P = Sn(w, ke(h, T, L)), z = H.filter((C) => mt(P, C.conditionalType, C.conditionalValue));
|
|
6590
|
+
(z.length > 1 && !z.some((C) => C.conditionalQuestionsAllowMultiple) ? z.slice(0, 1) : z).forEach((C) => {
|
|
6591
6591
|
const k = C.conditionalQuestions ?? [];
|
|
6592
6592
|
k.length && (C.conditionalQuestionsAllowMultiple || y(k, T));
|
|
6593
6593
|
});
|
|
@@ -6597,15 +6597,15 @@ function _d({
|
|
|
6597
6597
|
}, [s, h, c, a]);
|
|
6598
6598
|
function _e(S) {
|
|
6599
6599
|
S.preventDefault();
|
|
6600
|
-
const y = St(h, c), _ = F.map((w) =>
|
|
6601
|
-
if (
|
|
6602
|
-
const w = F.findIndex((
|
|
6600
|
+
const y = St(h, c), _ = F.map((w) => Vt(w, c) ? { ...w, required: y } : w), T = Wt(_, h);
|
|
6601
|
+
if (se(T), Object.keys(T).length > 0) {
|
|
6602
|
+
const w = F.findIndex((L) => T[L.key]);
|
|
6603
6603
|
w >= 0 && document.getElementById(F[w].key)?.focus();
|
|
6604
6604
|
return;
|
|
6605
6605
|
}
|
|
6606
6606
|
o(h);
|
|
6607
6607
|
}
|
|
6608
|
-
return /* @__PURE__ */ d("form", { className: "space-y-6 px-1", onSubmit: _e, noValidate: !0, children:
|
|
6608
|
+
return /* @__PURE__ */ d("form", { className: "space-y-6 px-1", onSubmit: _e, noValidate: !0, children: V(s) });
|
|
6609
6609
|
}
|
|
6610
6610
|
const fd = "GTM-NK8LGHTQ";
|
|
6611
6611
|
function md() {
|
|
@@ -6643,7 +6643,7 @@ function vd() {
|
|
|
6643
6643
|
}
|
|
6644
6644
|
function bd(e, t) {
|
|
6645
6645
|
const r = String(e.key ?? "");
|
|
6646
|
-
if (!
|
|
6646
|
+
if (!qt.has(r)) return !0;
|
|
6647
6647
|
const n = t.state ?? t.State ?? t.state ?? t.State ?? "";
|
|
6648
6648
|
if (typeof n != "string" || !n.trim()) return !1;
|
|
6649
6649
|
const o = n.trim().toLowerCase();
|
|
@@ -6656,7 +6656,7 @@ function Sd(e) {
|
|
|
6656
6656
|
return r === "nj" || r === "n.j." || r === "n.j" || r === "new jersey";
|
|
6657
6657
|
}
|
|
6658
6658
|
function wd(e, t) {
|
|
6659
|
-
const r = String(e ?? ""), n =
|
|
6659
|
+
const r = String(e ?? ""), n = qt.has(r) || r === "has_health_insurance_auto_accident" || r === "is_corporation";
|
|
6660
6660
|
return Sd(t) && n;
|
|
6661
6661
|
}
|
|
6662
6662
|
const ko = /* @__PURE__ */ new Set(["Disabled", "Retired", "Unemployed", "Other"]);
|
|
@@ -6726,7 +6726,7 @@ const Nd = /* @__PURE__ */ new Set(["auto_prior_years", "auto_prior_months", "au
|
|
|
6726
6726
|
function In(e, t, r) {
|
|
6727
6727
|
const n = Tr([...e]), o = Pr(n), i = [], a = (s) => {
|
|
6728
6728
|
s.forEach((c) => {
|
|
6729
|
-
if (
|
|
6729
|
+
if (!$t(c, t, o) || !Cd(c, t) || !bd(c, t) || !Pt(c, t, r)) return;
|
|
6730
6730
|
const l = String(c.key);
|
|
6731
6731
|
if (Rr(l, r) && !wd(l, t)) {
|
|
6732
6732
|
const b = o.currentCarrierKey ? t[o.currentCarrierKey] : void 0;
|
|
@@ -6767,8 +6767,8 @@ function Cr(e, t, r = [], n = void 0) {
|
|
|
6767
6767
|
const v = t[wr(i)] ?? [];
|
|
6768
6768
|
if (v.length === 0) return !0;
|
|
6769
6769
|
for (const [g, b] of v.entries()) {
|
|
6770
|
-
const h = [...r, wr(i), g], W = m.filter((
|
|
6771
|
-
if (Object.values(
|
|
6770
|
+
const h = [...r, wr(i), g], W = m.filter((te) => !(Ed(te, h) || Rr(String(te.key), n) || !Ad(te, b))), se = Wt(W, b);
|
|
6771
|
+
if (Object.values(se).some(Boolean) || Cr(m, b, h, n)) return !0;
|
|
6772
6772
|
}
|
|
6773
6773
|
}
|
|
6774
6774
|
}
|
|
@@ -6792,67 +6792,67 @@ function kd({
|
|
|
6792
6792
|
initialActive: o,
|
|
6793
6793
|
quoteId: i
|
|
6794
6794
|
}) {
|
|
6795
|
-
const [a, s] =
|
|
6795
|
+
const [a, s] = ie(o ?? 0), [c, l] = ie(n ?? {}), [u, m] = ie({}), [v, g] = ie(!1), [b, h] = ie(!1), [W, se] = ie(null), te = Te([]), X = Te(e), G = Array.isArray(e) && e.length > 0, M = G ? Math.min(a, e.length - 1) : 0, $ = G ? e[M] : null, I = $?.key ?? null;
|
|
6796
6796
|
de(() => {
|
|
6797
6797
|
o !== void 0 && s(o);
|
|
6798
|
-
}, [o]),
|
|
6799
|
-
const
|
|
6798
|
+
}, [o]), X.current = e;
|
|
6799
|
+
const re = be(() => !!(M >= e.length - 1 || e.slice(M + 1).every((N) => N.key === "AutoPolicy") && (c.drivers__items ?? []).length <= 1), [M, e, c]);
|
|
6800
6800
|
de(() => {
|
|
6801
|
-
|
|
6802
|
-
}, [a, e.length,
|
|
6803
|
-
const f =
|
|
6801
|
+
G && a >= e.length && s(e.length - 1);
|
|
6802
|
+
}, [a, e.length, G]), de(() => {
|
|
6803
|
+
const f = te.current[M];
|
|
6804
6804
|
f && f.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" });
|
|
6805
|
-
}, [
|
|
6805
|
+
}, [M]), de(() => {
|
|
6806
6806
|
n !== void 0 && l(n);
|
|
6807
6807
|
}, [n]), de(() => {
|
|
6808
|
-
if (
|
|
6809
|
-
g(!1),
|
|
6808
|
+
if (!$ || !I) {
|
|
6809
|
+
g(!1), se(null);
|
|
6810
6810
|
return;
|
|
6811
6811
|
}
|
|
6812
|
-
if (u[
|
|
6813
|
-
g(!1),
|
|
6812
|
+
if (u[I]) {
|
|
6813
|
+
g(!1), se(null);
|
|
6814
6814
|
return;
|
|
6815
6815
|
}
|
|
6816
6816
|
let f = !1;
|
|
6817
|
-
return g(!0),
|
|
6817
|
+
return g(!0), se(null), Promise.resolve($.loadQuestions()).then((N) => {
|
|
6818
6818
|
if (!f) {
|
|
6819
|
-
if (!Array.isArray(N)) throw new Error(`loadQuestions("${
|
|
6820
|
-
m((
|
|
6819
|
+
if (!Array.isArray(N)) throw new Error(`loadQuestions("${I}") did not return an array`);
|
|
6820
|
+
m((V) => ({ ...V, [I]: N }));
|
|
6821
6821
|
}
|
|
6822
6822
|
}).catch((N) => {
|
|
6823
|
-
f ||
|
|
6823
|
+
f || se(`Failed to load stage "${$?.title ?? ""}": ${N?.message ?? "Unknown error"}`);
|
|
6824
6824
|
}).finally(() => {
|
|
6825
6825
|
f || g(!1);
|
|
6826
6826
|
}), () => {
|
|
6827
6827
|
f = !0;
|
|
6828
6828
|
};
|
|
6829
|
-
}, [
|
|
6830
|
-
const
|
|
6829
|
+
}, [$, I, u]);
|
|
6830
|
+
const O = I ? u[I] : void 0, Q = be(() => Pr(Tr(O ?? [])), [O]);
|
|
6831
6831
|
de(() => {
|
|
6832
|
-
|
|
6833
|
-
stageKey:
|
|
6834
|
-
stageTitle:
|
|
6832
|
+
$ && I && O && hd({
|
|
6833
|
+
stageKey: I,
|
|
6834
|
+
stageTitle: $.title ?? I,
|
|
6835
6835
|
stepIndex: a + 1,
|
|
6836
6836
|
totalSteps: e.length
|
|
6837
6837
|
});
|
|
6838
|
-
}, [
|
|
6839
|
-
const
|
|
6840
|
-
if (!
|
|
6838
|
+
}, [I, a, e.length, $, O]);
|
|
6839
|
+
const j = be(() => {
|
|
6840
|
+
if (!O) return {};
|
|
6841
6841
|
const f = {};
|
|
6842
6842
|
((F) => {
|
|
6843
6843
|
const _e = [], S = (y) => {
|
|
6844
6844
|
y.forEach((_, T) => {
|
|
6845
|
-
const w =
|
|
6845
|
+
const w = Dt(_, T);
|
|
6846
6846
|
_e.push(w);
|
|
6847
|
-
const
|
|
6848
|
-
_e.push(
|
|
6849
|
-
const
|
|
6850
|
-
|
|
6847
|
+
const L = wr(w);
|
|
6848
|
+
_e.push(L), (_.conditionals ?? []).forEach((P) => {
|
|
6849
|
+
const z = P.conditionalQuestions ?? [];
|
|
6850
|
+
z.length > 0 && S(z);
|
|
6851
6851
|
});
|
|
6852
6852
|
});
|
|
6853
6853
|
};
|
|
6854
6854
|
return S(F), _e;
|
|
6855
|
-
})(
|
|
6855
|
+
})(O).forEach((F) => {
|
|
6856
6856
|
F in c && (f[F] = c[F]);
|
|
6857
6857
|
});
|
|
6858
6858
|
for (const F of ["state", "State", "address", "product"])
|
|
@@ -6860,26 +6860,26 @@ function kd({
|
|
|
6860
6860
|
for (const [F, _e] of Object.entries(c))
|
|
6861
6861
|
F.endsWith(Mo) && !(F in f) && (f[F] = _e);
|
|
6862
6862
|
return f;
|
|
6863
|
-
}, [
|
|
6863
|
+
}, [O, c]), fe = (f) => {
|
|
6864
6864
|
l((N) => ({ ...N, ...f }));
|
|
6865
|
-
},
|
|
6865
|
+
}, ne = () => {
|
|
6866
6866
|
s((f) => f > 0 ? f - 1 : 0), document.querySelector(".panel-body")?.scrollTo({ top: 0, behavior: "instant" });
|
|
6867
|
-
},
|
|
6868
|
-
if (!
|
|
6869
|
-
const f = In(
|
|
6867
|
+
}, ee = async () => {
|
|
6868
|
+
if (!O || !$ || v || W || b) return;
|
|
6869
|
+
const f = In(O, j, I ?? void 0), N = St(c, Q), V = f.map((P) => Vt(P, Q) ? { ...P, required: N } : P), F = Wt(V, j), _e = new Set(V.map((P, z) => Dt(P, z))), S = Object.entries(F).some(([P, z]) => z && _e.has(P)), y = Ln(O, c, I ?? void 0), T = f.some((P) => String(P.key ?? "") === "vehicle_policy_selections") ? Mn(c) : !1, w = c.driver_vehicle_assignments, L = c.drivers__items ?? [];
|
|
6870
6870
|
let H = !1;
|
|
6871
|
-
if (w &&
|
|
6872
|
-
const
|
|
6873
|
-
for (let
|
|
6874
|
-
const A = w[`v${
|
|
6871
|
+
if (w && L.length >= 2) {
|
|
6872
|
+
const P = c.vehicles__items ?? [];
|
|
6873
|
+
for (let z = 0; z < P.length; z++) {
|
|
6874
|
+
const A = w[`v${z}`];
|
|
6875
6875
|
if (!A) continue;
|
|
6876
|
-
const C =
|
|
6876
|
+
const C = L.map((x, Z) => A[`d${Z}`] ?? 0), k = C.filter((x) => x > 0);
|
|
6877
6877
|
if (k.length >= 2 && k.every((x) => x === 50)) {
|
|
6878
6878
|
H = !0;
|
|
6879
6879
|
break;
|
|
6880
6880
|
}
|
|
6881
|
-
const
|
|
6882
|
-
if (
|
|
6881
|
+
const J = C.reduce((x, Z) => x + Z, 0);
|
|
6882
|
+
if (J > 0 && J !== 100) {
|
|
6883
6883
|
H = !0;
|
|
6884
6884
|
break;
|
|
6885
6885
|
}
|
|
@@ -6888,43 +6888,43 @@ function kd({
|
|
|
6888
6888
|
if (!(S || y || T || H)) {
|
|
6889
6889
|
h(!0);
|
|
6890
6890
|
try {
|
|
6891
|
-
const
|
|
6892
|
-
if (!
|
|
6893
|
-
|
|
6891
|
+
const P = re, { success: z, error: A } = P ? await r(c, I ?? "") : await t(j, I ?? "");
|
|
6892
|
+
if (!z) {
|
|
6893
|
+
se(A ?? "An error occurred");
|
|
6894
6894
|
return;
|
|
6895
6895
|
}
|
|
6896
|
-
if (
|
|
6897
|
-
const C =
|
|
6898
|
-
s(
|
|
6896
|
+
if (!P) {
|
|
6897
|
+
const C = X.current, k = C.findIndex((x) => x.key === I), J = k >= 0 ? Math.min(k + 1, C.length - 1) : Math.min(a + 1, C.length - 1);
|
|
6898
|
+
s(J);
|
|
6899
6899
|
}
|
|
6900
6900
|
} finally {
|
|
6901
6901
|
h(!1);
|
|
6902
6902
|
}
|
|
6903
6903
|
}
|
|
6904
|
-
},
|
|
6905
|
-
if (!
|
|
6906
|
-
const f = In(
|
|
6904
|
+
}, U = be(() => {
|
|
6905
|
+
if (!O || v || W || b) return !0;
|
|
6906
|
+
const f = In(O, j, I ?? void 0), N = St(c, Q), V = f.map((P) => Vt(P, Q) ? { ...P, required: N } : P), F = Wt(V, j), _e = new Set(V.map((P, z) => Dt(P, z))), S = Object.entries(F).some(([P, z]) => z && _e.has(P)), y = Ln(O, c, I ?? void 0), T = f.some((P) => String(P.key ?? "") === "vehicle_policy_selections") ? Mn(c) : !1, w = c.driver_vehicle_assignments, L = c.drivers__items ?? [];
|
|
6907
6907
|
let H = !1;
|
|
6908
|
-
if (w &&
|
|
6909
|
-
const
|
|
6910
|
-
for (let
|
|
6911
|
-
const A = w[`v${
|
|
6908
|
+
if (w && L.length >= 2) {
|
|
6909
|
+
const P = c.vehicles__items ?? [];
|
|
6910
|
+
for (let z = 0; z < P.length; z++) {
|
|
6911
|
+
const A = w[`v${z}`];
|
|
6912
6912
|
if (!A) continue;
|
|
6913
|
-
const C =
|
|
6913
|
+
const C = L.map((x, Z) => A[`d${Z}`] ?? 0), k = C.filter((x) => x > 0);
|
|
6914
6914
|
if (k.length >= 2 && k.every((x) => x === 50)) {
|
|
6915
6915
|
H = !0;
|
|
6916
6916
|
break;
|
|
6917
6917
|
}
|
|
6918
|
-
const
|
|
6919
|
-
if (
|
|
6918
|
+
const J = C.reduce((x, Z) => x + Z, 0);
|
|
6919
|
+
if (J > 0 && J !== 100) {
|
|
6920
6920
|
H = !0;
|
|
6921
6921
|
break;
|
|
6922
6922
|
}
|
|
6923
6923
|
}
|
|
6924
6924
|
}
|
|
6925
6925
|
return S || y || T || H;
|
|
6926
|
-
}, [
|
|
6927
|
-
return
|
|
6926
|
+
}, [O, j, c, v, W, b, Q, I]);
|
|
6927
|
+
return G ? /* @__PURE__ */ E("div", { className: "space-y-6", children: [
|
|
6928
6928
|
/* @__PURE__ */ E("div", { className: "form-wizard-steps-header flex items-center justify-between gap-4", children: [
|
|
6929
6929
|
/* @__PURE__ */ d(
|
|
6930
6930
|
"ol",
|
|
@@ -6935,10 +6935,10 @@ function kd({
|
|
|
6935
6935
|
/* @__PURE__ */ d(
|
|
6936
6936
|
"li",
|
|
6937
6937
|
{
|
|
6938
|
-
ref: (
|
|
6939
|
-
|
|
6938
|
+
ref: (V) => {
|
|
6939
|
+
te.current[N] = V;
|
|
6940
6940
|
},
|
|
6941
|
-
className: `form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${N <
|
|
6941
|
+
className: `form-wizard-step-pill px-2.5 py-1 rounded-full border whitespace-nowrap flex-shrink-0 ${N < M ? "bg-blue-600 text-white border-blue-600" : N === M ? "border-blue-600 text-blue-600 bg-white" : "border-slate-200 text-slate-600"}`,
|
|
6942
6942
|
children: f.title
|
|
6943
6943
|
},
|
|
6944
6944
|
f.key ?? `stage-${N}`
|
|
@@ -6950,50 +6950,50 @@ function kd({
|
|
|
6950
6950
|
}
|
|
6951
6951
|
),
|
|
6952
6952
|
/* @__PURE__ */ E("div", { className: "form-wizard-step-counter text-sm text-slate-500 flex-shrink-0", children: [
|
|
6953
|
-
|
|
6953
|
+
M + 1,
|
|
6954
6954
|
" / ",
|
|
6955
6955
|
e.length
|
|
6956
6956
|
] })
|
|
6957
6957
|
] }),
|
|
6958
6958
|
/* @__PURE__ */ E("div", { children: [
|
|
6959
6959
|
v && /* @__PURE__ */ d("div", { className: "text-slate-500", children: "Loading…" }),
|
|
6960
|
-
|
|
6960
|
+
$ && /* @__PURE__ */ d(
|
|
6961
6961
|
_d,
|
|
6962
6962
|
{
|
|
6963
|
-
questions:
|
|
6964
|
-
controlledValues:
|
|
6965
|
-
onChangeValues:
|
|
6966
|
-
onSubmit: () =>
|
|
6963
|
+
questions: O ?? [],
|
|
6964
|
+
controlledValues: j,
|
|
6965
|
+
onChangeValues: fe,
|
|
6966
|
+
onSubmit: () => ee(),
|
|
6967
6967
|
quoteId: i,
|
|
6968
|
-
widgetStageKey:
|
|
6968
|
+
widgetStageKey: I ?? void 0
|
|
6969
6969
|
},
|
|
6970
|
-
|
|
6970
|
+
$.key
|
|
6971
6971
|
)
|
|
6972
6972
|
] }),
|
|
6973
6973
|
!v && W && /* @__PURE__ */ E("div", { className: "text-red-600 text-sm -mt-4", children: [
|
|
6974
6974
|
/* @__PURE__ */ d("div", { children: W }),
|
|
6975
|
-
|
|
6975
|
+
$ && /* @__PURE__ */ d(
|
|
6976
6976
|
"button",
|
|
6977
6977
|
{
|
|
6978
6978
|
type: "button",
|
|
6979
6979
|
className: "credify-retry-btn underline mt-1 font-bold",
|
|
6980
6980
|
onClick: () => {
|
|
6981
6981
|
m((f) => {
|
|
6982
|
-
if (!
|
|
6982
|
+
if (!I) return f;
|
|
6983
6983
|
const N = { ...f };
|
|
6984
|
-
return delete N[
|
|
6984
|
+
return delete N[I], N;
|
|
6985
6985
|
});
|
|
6986
6986
|
},
|
|
6987
6987
|
children: "Retry"
|
|
6988
6988
|
}
|
|
6989
6989
|
)
|
|
6990
6990
|
] }),
|
|
6991
|
-
/* @__PURE__ */ E("div", { className:
|
|
6992
|
-
|
|
6991
|
+
/* @__PURE__ */ E("div", { className: M > 0 ? "grid grid-cols-2 gap-3" : "", children: [
|
|
6992
|
+
M > 0 && /* @__PURE__ */ d(
|
|
6993
6993
|
"button",
|
|
6994
6994
|
{
|
|
6995
6995
|
type: "button",
|
|
6996
|
-
onClick:
|
|
6996
|
+
onClick: ne,
|
|
6997
6997
|
disabled: v,
|
|
6998
6998
|
className: "credify-btn-back h-12 rounded-full border border-gray-300 text-text-primary hover:bg-gray-50 transition",
|
|
6999
6999
|
children: "Back"
|
|
@@ -7004,15 +7004,15 @@ function kd({
|
|
|
7004
7004
|
{
|
|
7005
7005
|
type: "button",
|
|
7006
7006
|
"data-widget-ctrl": "next",
|
|
7007
|
-
onClick:
|
|
7008
|
-
disabled:
|
|
7007
|
+
onClick: ee,
|
|
7008
|
+
disabled: U,
|
|
7009
7009
|
className: [
|
|
7010
7010
|
"form-wizard-next-btn",
|
|
7011
|
-
|
|
7011
|
+
M > 0 ? "" : "w-full",
|
|
7012
7012
|
"h-12 rounded-full text-white transition",
|
|
7013
7013
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
7014
7014
|
"flex items-center justify-center gap-2",
|
|
7015
|
-
|
|
7015
|
+
U ? "bg-gray-300" : "bg-blue-600 hover:bg-blue-600/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600/40 bg-primary hover:bg-primary/90 focus-visible:ring-primary/40"
|
|
7016
7016
|
].join(" "),
|
|
7017
7017
|
children: [
|
|
7018
7018
|
b && /* @__PURE__ */ E("svg", { className: "animate-spin h-5 w-5 text-white", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
@@ -7026,7 +7026,7 @@ function kd({
|
|
|
7026
7026
|
}
|
|
7027
7027
|
)
|
|
7028
7028
|
] }),
|
|
7029
|
-
|
|
7029
|
+
re ? "Finish" : "Next"
|
|
7030
7030
|
]
|
|
7031
7031
|
}
|
|
7032
7032
|
)
|
|
@@ -7066,14 +7066,14 @@ function Ze({
|
|
|
7066
7066
|
showFeaturedBadge: a,
|
|
7067
7067
|
className: s
|
|
7068
7068
|
}) {
|
|
7069
|
-
const c = Number.isFinite(e.term_months) && e.term_months > 0 ? e.term_months : 1, u = (e.monthly_premium_cents != null ? e.monthly_premium_cents : Math.round((e.premium_cents || 0) / c)) / 100, m = Od.format(u), v = t === "loading", g = t === "success", b = !!n || v || g, h = !!(e.effective_date && e.policy_end_date), W = e.lob ? Ro[e.lob] || e.lob : null,
|
|
7069
|
+
const c = Number.isFinite(e.term_months) && e.term_months > 0 ? e.term_months : 1, u = (e.monthly_premium_cents != null ? e.monthly_premium_cents : Math.round((e.premium_cents || 0) / c)) / 100, m = Od.format(u), v = t === "loading", g = t === "success", b = !!n || v || g, h = !!(e.effective_date && e.policy_end_date), W = e.lob ? Ro[e.lob] || e.lob : null, se = a ?? o;
|
|
7070
7070
|
return /* @__PURE__ */ E(
|
|
7071
7071
|
"div",
|
|
7072
7072
|
{
|
|
7073
7073
|
className: `flex w-full flex-col rounded-xl bg-white p-6 shadow-sm transition hover:shadow-md ${o ? "border-2 border-blue-300 shadow-blue-100/60 ring-1 ring-blue-100" : "border border-slate-200"}${s ? ` ${s}` : ""}`,
|
|
7074
7074
|
children: [
|
|
7075
7075
|
i && W && /* @__PURE__ */ d("div", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-slate-500", children: W }),
|
|
7076
|
-
|
|
7076
|
+
se && /* @__PURE__ */ d("div", { className: "mb-3 inline-flex w-fit items-center rounded-full bg-blue-50 px-2.5 py-1 text-xs font-semibold text-blue-700", children: "Featured" }),
|
|
7077
7077
|
/* @__PURE__ */ E("div", { className: "mb-4 flex flex-col items-start gap-2", children: [
|
|
7078
7078
|
e.carrier_logo_base64 ? /* @__PURE__ */ d("img", { src: `data:image/png;base64,${e.carrier_logo_base64}`, alt: e.carrier_name, className: "h-12 w-auto max-w-full object-contain" }) : /* @__PURE__ */ d("div", { className: "flex h-12 w-12 items-center justify-center rounded-md bg-slate-100 text-sm font-semibold text-slate-500", children: e.carrier_name.charAt(0).toUpperCase() }),
|
|
7079
7079
|
/* @__PURE__ */ d("h4", { className: "w-full break-words text-left font-semibold text-slate-900", children: e.carrier_name })
|
|
@@ -7111,36 +7111,36 @@ function Ze({
|
|
|
7111
7111
|
);
|
|
7112
7112
|
}
|
|
7113
7113
|
function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
7114
|
-
const n = Array.isArray(e) ? e : [], o = n.length > 0, [i, a] =
|
|
7114
|
+
const n = Array.isArray(e) ? e : [], o = n.length > 0, [i, a] = ie({}), [s, c] = ie("admitted"), [l, u] = ie(!1), m = be(() => n.some((f) => f.lob === "PersonalAuto"), [n]), v = be(() => n.some((f) => f.lob === "PersonalHome"), [n]), g = be(() => {
|
|
7115
7115
|
if (!r) return [];
|
|
7116
7116
|
const f = [];
|
|
7117
7117
|
return m && f.push("PersonalAuto"), v && f.push("PersonalHome"), f;
|
|
7118
7118
|
}, [r, m, v]), b = be(() => {
|
|
7119
7119
|
const f = /* @__PURE__ */ new Set();
|
|
7120
7120
|
for (const N of n) {
|
|
7121
|
-
const
|
|
7122
|
-
|
|
7121
|
+
const V = N.lob ?? null;
|
|
7122
|
+
V && i[N.quote_rate_id] === "success" && f.add(V);
|
|
7123
7123
|
}
|
|
7124
7124
|
return f;
|
|
7125
|
-
}, [n, i]), h = be(() => Object.values(i).some((f) => f === "success"), [i]), W = be(() => l ? !0 : !r || g.length === 0 ? h : g.every((f) => b.has(f)), [l, r, h, g, b]),
|
|
7125
|
+
}, [n, i]), h = be(() => Object.values(i).some((f) => f === "success"), [i]), W = be(() => l ? !0 : !r || g.length === 0 ? h : g.every((f) => b.has(f)), [l, r, h, g, b]), se = be(() => o ? n.filter((f) => (f.admitted_status ?? "admitted") === "admitted") : [], [n, o]), te = be(() => o ? n.filter((f) => f.admitted_status === "non_admitted") : [], [n, o]), X = se.length, G = te.length, M = X + G > 0;
|
|
7126
7126
|
de(() => {
|
|
7127
|
-
|
|
7128
|
-
}, [s,
|
|
7129
|
-
const
|
|
7127
|
+
M && s === "admitted" && X === 0 && G > 0 && c("non_admitted");
|
|
7128
|
+
}, [s, X, G, M]);
|
|
7129
|
+
const $ = be(() => M ? s === "admitted" ? se : te : [], [M, s, se, te]);
|
|
7130
7130
|
de(() => {
|
|
7131
7131
|
Sr();
|
|
7132
7132
|
}, []), de(() => {
|
|
7133
7133
|
!W || l || (Bu(), No(), u(!0));
|
|
7134
7134
|
}, [W, l]);
|
|
7135
|
-
const
|
|
7136
|
-
if (
|
|
7137
|
-
if (
|
|
7138
|
-
return [{ lob: null, title: "Rates", rates: [
|
|
7135
|
+
const I = be(() => {
|
|
7136
|
+
if ($.length === 0) return [];
|
|
7137
|
+
if (!$.some((F) => F.lob))
|
|
7138
|
+
return [{ lob: null, title: "Rates", rates: [...$].sort((_e, S) => {
|
|
7139
7139
|
const y = Number.isFinite(_e.term_months) && _e.term_months > 0 ? _e.term_months : 1, _ = Number.isFinite(S.term_months) && S.term_months > 0 ? S.term_months : 1, T = _e.monthly_premium_cents ?? Math.round((_e.premium_cents || 0) / y), w = S.monthly_premium_cents ?? Math.round((S.premium_cents || 0) / _);
|
|
7140
7140
|
return T - w;
|
|
7141
7141
|
}) }];
|
|
7142
7142
|
const N = /* @__PURE__ */ new Map();
|
|
7143
|
-
for (const F of
|
|
7143
|
+
for (const F of $) {
|
|
7144
7144
|
const _e = F.lob || "_other", S = N.get(_e);
|
|
7145
7145
|
S ? S.push(F) : N.set(_e, [F]);
|
|
7146
7146
|
}
|
|
@@ -7151,35 +7151,35 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7151
7151
|
lob: F,
|
|
7152
7152
|
title: Ro[F] ?? F,
|
|
7153
7153
|
rates: [..._e].sort((S, y) => {
|
|
7154
|
-
const _ = Number.isFinite(S.term_months) && S.term_months > 0 ? S.term_months : 1, T = Number.isFinite(y.term_months) && y.term_months > 0 ? y.term_months : 1, w = S.monthly_premium_cents ?? Math.round((S.premium_cents || 0) / _),
|
|
7155
|
-
return w -
|
|
7154
|
+
const _ = Number.isFinite(S.term_months) && S.term_months > 0 ? S.term_months : 1, T = Number.isFinite(y.term_months) && y.term_months > 0 ? y.term_months : 1, w = S.monthly_premium_cents ?? Math.round((S.premium_cents || 0) / _), L = y.monthly_premium_cents ?? Math.round((y.premium_cents || 0) / T);
|
|
7155
|
+
return w - L;
|
|
7156
7156
|
})
|
|
7157
7157
|
}));
|
|
7158
|
-
}, [
|
|
7158
|
+
}, [$]), re = be(() => {
|
|
7159
7159
|
if (!r) return [];
|
|
7160
|
-
const f = n.some((F) => F.lob === "PersonalAuto"), N = n.some((F) => F.lob === "PersonalHome"),
|
|
7161
|
-
return f ||
|
|
7160
|
+
const f = n.some((F) => F.lob === "PersonalAuto"), N = n.some((F) => F.lob === "PersonalHome"), V = [];
|
|
7161
|
+
return f || V.push("Sorry, no rates found for Personal Auto."), N || V.push("Sorry, no rates found for Homeowners."), V;
|
|
7162
7162
|
}, [r, n]);
|
|
7163
|
-
if (!
|
|
7163
|
+
if (!M)
|
|
7164
7164
|
return /* @__PURE__ */ E("section", { className: "mt-8", children: [
|
|
7165
7165
|
/* @__PURE__ */ d("h3", { className: "text-lg font-semibold text-slate-900", children: "Rates" }),
|
|
7166
7166
|
/* @__PURE__ */ d("p", { className: "mt-2 text-sm text-slate-500", children: "Sorry, no rates are available at this time." }),
|
|
7167
7167
|
t && /* @__PURE__ */ d(Pn, { onBack: t })
|
|
7168
7168
|
] });
|
|
7169
|
-
const
|
|
7169
|
+
const O = async (f) => {
|
|
7170
7170
|
a((N) => ({ ...N, [f]: "loading" }));
|
|
7171
7171
|
try {
|
|
7172
|
-
if (Sr(),
|
|
7172
|
+
if (Sr(), !xt())
|
|
7173
7173
|
throw new Error("Authentication required. Please verify your phone number first.");
|
|
7174
7174
|
if (!((await Ku(f))?.success !== !1)) throw new Error("Request failed");
|
|
7175
7175
|
a((_e) => ({ ..._e, [f]: "success" }));
|
|
7176
7176
|
} catch {
|
|
7177
7177
|
a((N) => ({ ...N, [f]: "error" }));
|
|
7178
7178
|
}
|
|
7179
|
-
},
|
|
7179
|
+
}, Q = I.find((f) => f.lob === "PersonalAuto"), j = I.find((f) => f.lob === "PersonalHome"), fe = !!(Q?.rates.length && j?.rates.length), ne = I.filter((f) => !fe || f.lob !== "PersonalAuto" && f.lob !== "PersonalHome"), ee = fe && Q && j ? [{ rate: Q.rates[0] }, { rate: j.rates[0] }] : [], U = ee.length === 1;
|
|
7180
7180
|
return /* @__PURE__ */ E("section", { className: "mt-8", children: [
|
|
7181
7181
|
/* @__PURE__ */ d("h3", { className: "text-lg font-semibold text-slate-900", children: "Rates" }),
|
|
7182
|
-
|
|
7182
|
+
re.length > 0 && /* @__PURE__ */ d("div", { className: "mt-3 space-y-1", children: re.map((f) => /* @__PURE__ */ d("p", { className: "text-sm text-slate-600", children: f }, f)) }),
|
|
7183
7183
|
/* @__PURE__ */ d("div", { className: "mt-4 border-b border-slate-200", children: /* @__PURE__ */ E("div", { className: "flex items-center gap-6", children: [
|
|
7184
7184
|
/* @__PURE__ */ E(
|
|
7185
7185
|
"button",
|
|
@@ -7189,7 +7189,7 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7189
7189
|
className: `border-b-2 px-1 py-2 text-sm font-semibold transition ${s === "admitted" ? "border-cyan-500 text-slate-900" : "border-transparent text-slate-500 hover:text-slate-800"}`,
|
|
7190
7190
|
children: [
|
|
7191
7191
|
"Admitted (",
|
|
7192
|
-
|
|
7192
|
+
X,
|
|
7193
7193
|
")"
|
|
7194
7194
|
]
|
|
7195
7195
|
}
|
|
@@ -7202,17 +7202,17 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7202
7202
|
className: `border-b-2 px-1 py-2 text-sm font-semibold transition ${s === "non_admitted" ? "border-cyan-500 text-slate-900" : "border-transparent text-slate-500 hover:text-slate-800"}`,
|
|
7203
7203
|
children: [
|
|
7204
7204
|
"Non-admitted (",
|
|
7205
|
-
|
|
7205
|
+
G,
|
|
7206
7206
|
")"
|
|
7207
7207
|
]
|
|
7208
7208
|
}
|
|
7209
7209
|
)
|
|
7210
7210
|
] }) }),
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
/* @__PURE__ */ d("div", { className:
|
|
7211
|
+
$.length === 0 && /* @__PURE__ */ d("p", { className: "mt-4 text-sm text-slate-500", children: s === "admitted" ? "Sorry, no admitted rates are available at this time." : "Sorry, no non-admitted rates are available at this time." }),
|
|
7212
|
+
$.length > 0 && fe && Q && j && /* @__PURE__ */ E(zt, { children: [
|
|
7213
|
+
/* @__PURE__ */ d("div", { className: U ? "mt-6 flex justify-center" : "mt-6", children: /* @__PURE__ */ E("div", { className: U ? `w-full max-w-md ${pt}` : pt, children: [
|
|
7214
7214
|
/* @__PURE__ */ d("div", { className: ht, children: "Featured Bundle" }),
|
|
7215
|
-
/* @__PURE__ */ d("div", { className:
|
|
7215
|
+
/* @__PURE__ */ d("div", { className: U ? "grid justify-items-center gap-4" : "grid gap-4 sm:grid-cols-2", children: ee.map(({ rate: f }) => /* @__PURE__ */ d("div", { className: "mx-auto w-full min-w-0 max-w-md", children: /* @__PURE__ */ d(
|
|
7216
7216
|
Ze,
|
|
7217
7217
|
{
|
|
7218
7218
|
rate: f,
|
|
@@ -7221,17 +7221,17 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7221
7221
|
showFeaturedBadge: !1,
|
|
7222
7222
|
status: i[f.quote_rate_id] ?? "idle",
|
|
7223
7223
|
disabled: W || (r ? !!(f.lob && g.includes(f.lob) && b.has(f.lob)) : h),
|
|
7224
|
-
onRequestBind: () =>
|
|
7224
|
+
onRequestBind: () => O(f.quote_rate_id)
|
|
7225
7225
|
}
|
|
7226
7226
|
) }, f.quote_rate_id)) })
|
|
7227
7227
|
] }) }),
|
|
7228
|
-
|
|
7228
|
+
Q.rates.length > 1 && /* @__PURE__ */ E("div", { className: "mt-6", children: [
|
|
7229
7229
|
/* @__PURE__ */ E("h4", { className: "mb-3 text-base font-semibold text-slate-800", children: [
|
|
7230
7230
|
"More ",
|
|
7231
|
-
|
|
7231
|
+
Q.title,
|
|
7232
7232
|
" Options"
|
|
7233
7233
|
] }),
|
|
7234
|
-
/* @__PURE__ */ d("div", { className: "grid gap-4 sm:grid-cols-2", children:
|
|
7234
|
+
/* @__PURE__ */ d("div", { className: "grid gap-4 sm:grid-cols-2", children: Q.rates.slice(1).map((f) => /* @__PURE__ */ d("div", { className: "mx-auto w-full min-w-0 max-w-md", children: /* @__PURE__ */ d(
|
|
7235
7235
|
Ze,
|
|
7236
7236
|
{
|
|
7237
7237
|
rate: f,
|
|
@@ -7240,17 +7240,17 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7240
7240
|
showFeaturedBadge: !1,
|
|
7241
7241
|
status: i[f.quote_rate_id] ?? "idle",
|
|
7242
7242
|
disabled: W || (r ? !!(f.lob && g.includes(f.lob) && b.has(f.lob)) : h),
|
|
7243
|
-
onRequestBind: () =>
|
|
7243
|
+
onRequestBind: () => O(f.quote_rate_id)
|
|
7244
7244
|
}
|
|
7245
7245
|
) }, f.quote_rate_id)) })
|
|
7246
7246
|
] }),
|
|
7247
|
-
|
|
7247
|
+
j.rates.length > 1 && /* @__PURE__ */ E("div", { className: "mt-6", children: [
|
|
7248
7248
|
/* @__PURE__ */ E("h4", { className: "mb-3 text-base font-semibold text-slate-800", children: [
|
|
7249
7249
|
"More ",
|
|
7250
|
-
|
|
7250
|
+
j.title,
|
|
7251
7251
|
" Options"
|
|
7252
7252
|
] }),
|
|
7253
|
-
/* @__PURE__ */ d("div", { className: "grid gap-4 sm:grid-cols-2", children:
|
|
7253
|
+
/* @__PURE__ */ d("div", { className: "grid gap-4 sm:grid-cols-2", children: j.rates.slice(1).map((f) => /* @__PURE__ */ d("div", { className: "mx-auto w-full min-w-0 max-w-md", children: /* @__PURE__ */ d(
|
|
7254
7254
|
Ze,
|
|
7255
7255
|
{
|
|
7256
7256
|
rate: f,
|
|
@@ -7259,16 +7259,16 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7259
7259
|
showFeaturedBadge: !1,
|
|
7260
7260
|
status: i[f.quote_rate_id] ?? "idle",
|
|
7261
7261
|
disabled: W || (r ? !!(f.lob && g.includes(f.lob) && b.has(f.lob)) : h),
|
|
7262
|
-
onRequestBind: () =>
|
|
7262
|
+
onRequestBind: () => O(f.quote_rate_id)
|
|
7263
7263
|
}
|
|
7264
7264
|
) }, f.quote_rate_id)) })
|
|
7265
7265
|
] })
|
|
7266
7266
|
] }),
|
|
7267
|
-
|
|
7268
|
-
const [N, ...
|
|
7267
|
+
$.length > 0 && ne.map((f) => {
|
|
7268
|
+
const [N, ...V] = f.rates;
|
|
7269
7269
|
return /* @__PURE__ */ E("div", { className: "mt-6", children: [
|
|
7270
7270
|
/* @__PURE__ */ d("h4", { className: "mb-3 text-base font-semibold text-slate-800", children: f.title }),
|
|
7271
|
-
|
|
7271
|
+
V.length === 0 ? /* @__PURE__ */ d("div", { className: "grid gap-4 sm:grid-cols-2", children: /* @__PURE__ */ d("div", { className: "col-span-full flex justify-center", children: /* @__PURE__ */ E("div", { className: `${Dn} ${pt}`, children: [
|
|
7272
7272
|
/* @__PURE__ */ d("div", { className: ht, children: "Featured" }),
|
|
7273
7273
|
/* @__PURE__ */ d(
|
|
7274
7274
|
Ze,
|
|
@@ -7279,10 +7279,10 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7279
7279
|
showFeaturedBadge: !1,
|
|
7280
7280
|
status: i[N.quote_rate_id] ?? "idle",
|
|
7281
7281
|
disabled: W || (r ? !!(N.lob && g.includes(N.lob) && b.has(N.lob)) : h),
|
|
7282
|
-
onRequestBind: () =>
|
|
7282
|
+
onRequestBind: () => O(N.quote_rate_id)
|
|
7283
7283
|
}
|
|
7284
7284
|
)
|
|
7285
|
-
] }) }) }) :
|
|
7285
|
+
] }) }) }) : V.length === 1 ? /* @__PURE__ */ E("div", { className: "grid items-stretch gap-4 sm:grid-cols-2", children: [
|
|
7286
7286
|
/* @__PURE__ */ E("div", { className: `flex h-full min-h-0 w-full min-w-0 flex-col ${pt}`, children: [
|
|
7287
7287
|
/* @__PURE__ */ d("div", { className: ht, children: "Featured" }),
|
|
7288
7288
|
/* @__PURE__ */ d("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ d(
|
|
@@ -7293,7 +7293,7 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7293
7293
|
showLobLabel: f.lob == null,
|
|
7294
7294
|
showFeaturedBadge: !1,
|
|
7295
7295
|
status: i[N.quote_rate_id] ?? "idle",
|
|
7296
|
-
onRequestBind: () =>
|
|
7296
|
+
onRequestBind: () => O(N.quote_rate_id),
|
|
7297
7297
|
disabled: W || (r ? !!(N.lob && g.includes(N.lob) && b.has(N.lob)) : h),
|
|
7298
7298
|
className: "h-full min-h-0"
|
|
7299
7299
|
}
|
|
@@ -7304,18 +7304,18 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7304
7304
|
/* @__PURE__ */ d("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ d(
|
|
7305
7305
|
Ze,
|
|
7306
7306
|
{
|
|
7307
|
-
rate:
|
|
7307
|
+
rate: V[0],
|
|
7308
7308
|
featured: !1,
|
|
7309
7309
|
showLobLabel: f.lob == null,
|
|
7310
7310
|
showFeaturedBadge: !1,
|
|
7311
|
-
status: i[
|
|
7312
|
-
onRequestBind: () =>
|
|
7313
|
-
disabled: W || (r ? !!(
|
|
7311
|
+
status: i[V[0].quote_rate_id] ?? "idle",
|
|
7312
|
+
onRequestBind: () => O(V[0].quote_rate_id),
|
|
7313
|
+
disabled: W || (r ? !!(V[0].lob && g.includes(V[0].lob) && b.has(V[0].lob)) : h),
|
|
7314
7314
|
className: "h-full min-h-0"
|
|
7315
7315
|
}
|
|
7316
7316
|
) })
|
|
7317
7317
|
] })
|
|
7318
|
-
] }) : /* @__PURE__ */ E(
|
|
7318
|
+
] }) : /* @__PURE__ */ E(zt, { children: [
|
|
7319
7319
|
/* @__PURE__ */ d("div", { className: "grid gap-4 sm:grid-cols-2", children: /* @__PURE__ */ d("div", { className: "col-span-full flex justify-center", children: /* @__PURE__ */ E("div", { className: `${Dn} ${pt}`, children: [
|
|
7320
7320
|
/* @__PURE__ */ d("div", { className: ht, children: "Featured" }),
|
|
7321
7321
|
/* @__PURE__ */ d(
|
|
@@ -7327,11 +7327,11 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7327
7327
|
showFeaturedBadge: !1,
|
|
7328
7328
|
status: i[N.quote_rate_id] ?? "idle",
|
|
7329
7329
|
disabled: W || (r ? !!(N.lob && g.includes(N.lob) && b.has(N.lob)) : h),
|
|
7330
|
-
onRequestBind: () =>
|
|
7330
|
+
onRequestBind: () => O(N.quote_rate_id)
|
|
7331
7331
|
}
|
|
7332
7332
|
)
|
|
7333
7333
|
] }) }) }),
|
|
7334
|
-
/* @__PURE__ */ d("div", { className: "mt-6 grid gap-4 sm:grid-cols-2", children:
|
|
7334
|
+
/* @__PURE__ */ d("div", { className: "mt-6 grid gap-4 sm:grid-cols-2", children: V.map((F) => /* @__PURE__ */ d("div", { className: "mx-auto w-full min-w-0 max-w-md", children: /* @__PURE__ */ d(
|
|
7335
7335
|
Ze,
|
|
7336
7336
|
{
|
|
7337
7337
|
rate: F,
|
|
@@ -7340,7 +7340,7 @@ function Ld({ rates: e, onBack: t, isBundleFlow: r = !1 }) {
|
|
|
7340
7340
|
showFeaturedBadge: !1,
|
|
7341
7341
|
status: i[F.quote_rate_id] ?? "idle",
|
|
7342
7342
|
disabled: W || (r ? !!(F.lob && g.includes(F.lob) && b.has(F.lob)) : h),
|
|
7343
|
-
onRequestBind: () =>
|
|
7343
|
+
onRequestBind: () => O(F.quote_rate_id)
|
|
7344
7344
|
}
|
|
7345
7345
|
) }, F.quote_rate_id)) })
|
|
7346
7346
|
] })
|
|
@@ -7375,7 +7375,7 @@ function Md(e) {
|
|
|
7375
7375
|
a.quote_vehicle_id && a.vin && (i[a.quote_vehicle_id] = a.vin);
|
|
7376
7376
|
return t.drivers && t.drivers.length > 0 ? (r.drivers = "Yes", r.drivers__items = t.drivers.map((a) => {
|
|
7377
7377
|
const s = a, c = {};
|
|
7378
|
-
s.first_name && (c.first_name = s.first_name), s.middle_name && (c.middle_name = s.middle_name), s.last_name && (c.last_name = s.last_name), s.date_of_birth && (c.date_of_birth = Ie(s.date_of_birth)), s.gender && (c.gender = s.gender), s.marital_status && (c.marital_status = s.marital_status), s.relationship_to_insured && (c.relationship_to_insured = s.relationship_to_insured), s.is_registered_owner !== null && s.is_registered_owner !== void 0 && (c.is_registered_owner = s.is_registered_owner ? "Yes" : "No"), s.license_state && (c.license_state = s.license_state), s.license_status && (c.license_status = s.license_status), s.license_number && (c.license_number = s.license_number), s.date_first_licensed && (c.date_first_licensed = Ie(s.date_first_licensed)), s.education_level && (c.education_level = wo(s.education_level)), s.occupation && (c.occupation = Co(s.occupation)), s.industry && (c.industry =
|
|
7378
|
+
s.first_name && (c.first_name = s.first_name), s.middle_name && (c.middle_name = s.middle_name), s.last_name && (c.last_name = s.last_name), s.date_of_birth && (c.date_of_birth = Ie(s.date_of_birth)), s.gender && (c.gender = s.gender), s.marital_status && (c.marital_status = s.marital_status), s.relationship_to_insured && (c.relationship_to_insured = s.relationship_to_insured), s.is_registered_owner !== null && s.is_registered_owner !== void 0 && (c.is_registered_owner = s.is_registered_owner ? "Yes" : "No"), s.license_state && (c.license_state = s.license_state), s.license_status && (c.license_status = s.license_status), s.license_number && (c.license_number = s.license_number), s.date_first_licensed && (c.date_first_licensed = Ie(s.date_first_licensed)), s.education_level && (c.education_level = wo(s.education_level)), s.occupation && (c.occupation = Co(s.occupation)), s.industry && (c.industry = Gt(s.industry)), s.employment_status && (c.employment_status = s.employment_status), s.last_5_years_license_suspended_or_revoked !== null && s.last_5_years_license_suspended_or_revoked !== void 0 && (c.last_5_years_license_suspended_or_revoked = B(s.last_5_years_license_suspended_or_revoked)), s.accident_prevention_course !== null && s.accident_prevention_course !== void 0 && (c.accident_prevention_course = B(s.accident_prevention_course)), s.accident_prevention_course_date && (c.accident_prevention_course_date = Ie(s.accident_prevention_course_date)), s.sr22 !== null && s.sr22 !== void 0 && (c.sr22 = B(s.sr22));
|
|
7379
7379
|
const l = s.ssn_display;
|
|
7380
7380
|
typeof l == "string" && (c.ssn_display = l);
|
|
7381
7381
|
const u = s.driver_violations;
|
|
@@ -7455,7 +7455,7 @@ function Ar(e) {
|
|
|
7455
7455
|
Array.isArray(t.drivers) && (t.drivers = t.drivers.map((l) => {
|
|
7456
7456
|
if (!l || typeof l != "object") return l;
|
|
7457
7457
|
const u = { ...l };
|
|
7458
|
-
return u.industry =
|
|
7458
|
+
return u.industry = Gt(u.industry), u.education_level = wo(u.education_level), u.occupation = Co(u.occupation), u;
|
|
7459
7459
|
})), console.log(
|
|
7460
7460
|
"[DEBUG_TRANSFORM] transformed.drivers type:",
|
|
7461
7461
|
typeof t.drivers,
|
|
@@ -7536,13 +7536,13 @@ function Fd(e, t) {
|
|
|
7536
7536
|
return r(t);
|
|
7537
7537
|
}
|
|
7538
7538
|
function Bd({ isOpen: e, onClose: t }) {
|
|
7539
|
-
const [r, n] =
|
|
7539
|
+
const [r, n] = ie([]), [o, i] = ie(null), a = Te(null);
|
|
7540
7540
|
de(() => {
|
|
7541
7541
|
a.current = o;
|
|
7542
7542
|
}, [o]);
|
|
7543
|
-
const [s, c] =
|
|
7544
|
-
function
|
|
7545
|
-
const
|
|
7543
|
+
const [s, c] = ie(null), [l, u] = ie(!1), [m, v] = ie(null), [g, b] = ie(void 0), [h, W] = ie(!1), se = Te(!1);
|
|
7544
|
+
function te(M) {
|
|
7545
|
+
const $ = {
|
|
7546
7546
|
SMSVerification: "Verify",
|
|
7547
7547
|
Name: "Basic Details",
|
|
7548
7548
|
Product: "Product & Address",
|
|
@@ -7559,63 +7559,76 @@ function Bd({ isOpen: e, onClose: t }) {
|
|
|
7559
7559
|
BundlePolicy: "Policy",
|
|
7560
7560
|
BundleCustomer: "Customer"
|
|
7561
7561
|
};
|
|
7562
|
-
let
|
|
7563
|
-
key:
|
|
7564
|
-
title:
|
|
7562
|
+
let I = M.map((O) => ({
|
|
7563
|
+
key: O,
|
|
7564
|
+
title: $[O] || O,
|
|
7565
7565
|
loadQuestions: async () => {
|
|
7566
|
-
const
|
|
7567
|
-
let
|
|
7568
|
-
return
|
|
7566
|
+
const Q = await Hu(O, a.current ?? void 0);
|
|
7567
|
+
let j = xd(O, Q.questions);
|
|
7568
|
+
return j = Fd(O, j), j;
|
|
7569
7569
|
}
|
|
7570
7570
|
}));
|
|
7571
7571
|
if (M.includes("Vehicle") && M.includes("Driver") && M.includes("AutoCurrentCarrier") && M.includes("Customer")) {
|
|
7572
|
-
const
|
|
7573
|
-
if (
|
|
7574
|
-
const
|
|
7575
|
-
(
|
|
7576
|
-
),
|
|
7577
|
-
|
|
7572
|
+
const O = I.findIndex((Q) => Q.key === "Product");
|
|
7573
|
+
if (O >= 0) {
|
|
7574
|
+
const Q = I.slice(0, O + 1), j = I.slice(O + 1), fe = (U) => j.find((f) => f.key === U) ?? null, ne = [fe("Vehicle"), fe("Driver"), fe("AutoCurrentCarrier"), fe("Customer")].filter(
|
|
7575
|
+
(U) => !!U
|
|
7576
|
+
), ee = j.filter((U) => !["Vehicle", "Driver", "AutoCurrentCarrier", "Customer", "AutoPolicy"].includes(String(U.key)));
|
|
7577
|
+
I = [...Q, ...ne, ...ee];
|
|
7578
7578
|
}
|
|
7579
7579
|
}
|
|
7580
|
-
return
|
|
7580
|
+
return I;
|
|
7581
7581
|
}
|
|
7582
7582
|
de(() => {
|
|
7583
|
-
|
|
7583
|
+
const M = async () => {
|
|
7584
7584
|
try {
|
|
7585
|
-
const
|
|
7586
|
-
if (Sr(),
|
|
7587
|
-
W(!0), i(
|
|
7585
|
+
const $ = $u();
|
|
7586
|
+
if (Sr(), $) {
|
|
7587
|
+
W(!0), i($);
|
|
7588
7588
|
try {
|
|
7589
|
-
const
|
|
7590
|
-
if (!
|
|
7589
|
+
const I = xt(), re = await Vu(I ? void 0 : $);
|
|
7590
|
+
if (!re || !re.quote)
|
|
7591
7591
|
throw new Error("Invalid response from getQuote: missing quote data");
|
|
7592
|
-
const { quote:
|
|
7593
|
-
n(
|
|
7594
|
-
let
|
|
7592
|
+
const { quote: O } = re, { stages: Q } = await Lt($), j = te(Q);
|
|
7593
|
+
n(j);
|
|
7594
|
+
let fe;
|
|
7595
7595
|
try {
|
|
7596
|
-
|
|
7597
|
-
} catch (
|
|
7598
|
-
throw new Error(`Failed to transform quote data: ${
|
|
7596
|
+
fe = Md(O), v(fe);
|
|
7597
|
+
} catch (ee) {
|
|
7598
|
+
throw new Error(`Failed to transform quote data: ${ee instanceof Error ? ee.message : "Unknown error"}`);
|
|
7599
7599
|
}
|
|
7600
|
-
const
|
|
7601
|
-
if (n(
|
|
7602
|
-
const
|
|
7603
|
-
|
|
7600
|
+
const ne = $n(j, fe);
|
|
7601
|
+
if (n(ne), O.current_stage) {
|
|
7602
|
+
const ee = O.current_stage === "State" ? "Product" : O.current_stage, U = ne.findIndex((f) => f.key === ee);
|
|
7603
|
+
U >= 0 ? b(U) : b(ne.length - 1);
|
|
7604
7604
|
} else
|
|
7605
|
-
b(
|
|
7606
|
-
} catch (
|
|
7607
|
-
|
|
7605
|
+
b(ne.length - 1);
|
|
7606
|
+
} catch (I) {
|
|
7607
|
+
const re = I;
|
|
7608
|
+
if (re.statusCode === 404)
|
|
7609
|
+
Ao(), i(null);
|
|
7610
|
+
else if (re.statusCode === 401) {
|
|
7611
|
+
No();
|
|
7612
|
+
try {
|
|
7613
|
+
const { stages: O } = await Lt($), Q = te(O);
|
|
7614
|
+
n(Q);
|
|
7615
|
+
const j = Q.findIndex((fe) => fe.key === "SMSVerification");
|
|
7616
|
+
j >= 0 && b(j);
|
|
7617
|
+
} catch {
|
|
7618
|
+
}
|
|
7619
|
+
}
|
|
7608
7620
|
} finally {
|
|
7609
7621
|
W(!1);
|
|
7610
7622
|
}
|
|
7611
7623
|
} else {
|
|
7612
|
-
const { stages:
|
|
7613
|
-
n(
|
|
7624
|
+
const { stages: I } = await Lt();
|
|
7625
|
+
n(te(I));
|
|
7614
7626
|
}
|
|
7615
7627
|
} catch {
|
|
7616
7628
|
W(!1);
|
|
7617
7629
|
}
|
|
7618
|
-
}
|
|
7630
|
+
};
|
|
7631
|
+
e && !se.current && (se.current = !0, M());
|
|
7619
7632
|
}, [e]), de(() => {
|
|
7620
7633
|
if (!e) return;
|
|
7621
7634
|
const { overflow: M } = document.body.style;
|
|
@@ -7623,7 +7636,7 @@ function Bd({ isOpen: e, onClose: t }) {
|
|
|
7623
7636
|
document.body.style.overflow = M;
|
|
7624
7637
|
};
|
|
7625
7638
|
}, [e]);
|
|
7626
|
-
const
|
|
7639
|
+
const X = fr(
|
|
7627
7640
|
(M) => {
|
|
7628
7641
|
M.key === "Escape" && (Tn(), t());
|
|
7629
7642
|
},
|
|
@@ -7631,8 +7644,8 @@ function Bd({ isOpen: e, onClose: t }) {
|
|
|
7631
7644
|
);
|
|
7632
7645
|
return de(() => {
|
|
7633
7646
|
if (e)
|
|
7634
|
-
return window.addEventListener("keydown",
|
|
7635
|
-
}, [e,
|
|
7647
|
+
return window.addEventListener("keydown", X), () => window.removeEventListener("keydown", X);
|
|
7648
|
+
}, [e, X]), de(() => {
|
|
7636
7649
|
e || (v(null), b(void 0), W(!1), u(!1));
|
|
7637
7650
|
}, [e]), de(() => {
|
|
7638
7651
|
e && pd();
|
|
@@ -7658,79 +7671,79 @@ function Bd({ isOpen: e, onClose: t }) {
|
|
|
7658
7671
|
l && /* @__PURE__ */ d("p", { className: "p-subtitle", children: "This should only take a few minutes." })
|
|
7659
7672
|
] }),
|
|
7660
7673
|
/* @__PURE__ */ E("div", { className: "panel-body flex-1 min-h-0 overflow-y-auto", children: [
|
|
7661
|
-
!s && /* @__PURE__ */ d(
|
|
7674
|
+
!s && /* @__PURE__ */ d(zt, { children: h || r.length === 0 ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ d("div", { className: "text-slate-600", children: "Loading..." }) }) : /* @__PURE__ */ d(
|
|
7662
7675
|
kd,
|
|
7663
7676
|
{
|
|
7664
7677
|
stages: r,
|
|
7665
7678
|
initialValues: m ?? void 0,
|
|
7666
7679
|
initialActive: g,
|
|
7667
7680
|
quoteId: o ?? void 0,
|
|
7668
|
-
onStageComplete: async (M,
|
|
7681
|
+
onStageComplete: async (M, $) => {
|
|
7669
7682
|
try {
|
|
7670
|
-
const
|
|
7671
|
-
let
|
|
7672
|
-
const
|
|
7673
|
-
if (
|
|
7674
|
-
if (
|
|
7675
|
-
const { isVerified:
|
|
7676
|
-
if (!
|
|
7683
|
+
const I = Ar(M);
|
|
7684
|
+
let re = o, O = r;
|
|
7685
|
+
const Q = O.findIndex((ne) => ne.key === $), j = O[Q], fe = Pd(O, $);
|
|
7686
|
+
if (re)
|
|
7687
|
+
if ($ === "SMSVerification") {
|
|
7688
|
+
const { isVerified: ne, token: ee } = await ju(re, I.sms_code);
|
|
7689
|
+
if (!ne)
|
|
7677
7690
|
throw new Error("Invalid SMS code");
|
|
7678
|
-
|
|
7679
|
-
} else if (
|
|
7680
|
-
const { isSupported:
|
|
7681
|
-
if (!
|
|
7691
|
+
ee && zu(ee), await ft({ current_stage: fe }, !1);
|
|
7692
|
+
} else if ($ === "Product") {
|
|
7693
|
+
const { isSupported: ne } = await Wu(I.state);
|
|
7694
|
+
if (!ne)
|
|
7682
7695
|
throw new Error("State is not supported");
|
|
7683
|
-
const
|
|
7684
|
-
await ft({ ...
|
|
7696
|
+
const ee = xt();
|
|
7697
|
+
await ft({ ...I, current_stage: fe }, !1, ee ? void 0 : re);
|
|
7685
7698
|
} else {
|
|
7686
|
-
const
|
|
7699
|
+
const ne = xt();
|
|
7687
7700
|
await ft(
|
|
7688
|
-
{ ...
|
|
7701
|
+
{ ...I, current_stage: fe },
|
|
7689
7702
|
!1,
|
|
7690
|
-
|
|
7703
|
+
ne ? void 0 : re || void 0
|
|
7691
7704
|
);
|
|
7692
7705
|
}
|
|
7693
7706
|
else {
|
|
7694
|
-
const
|
|
7695
|
-
if (!
|
|
7696
|
-
throw new Error(`Failed to create quote - invalid quoteId returned: ${
|
|
7697
|
-
|
|
7707
|
+
const ee = (await Zu(I.phone))?.quoteId;
|
|
7708
|
+
if (!ee || typeof ee != "string" || ee.trim() === "")
|
|
7709
|
+
throw new Error(`Failed to create quote - invalid quoteId returned: ${ee}`);
|
|
7710
|
+
re = ee, i(ee), Pu(ee), await ft({ current_stage: fe }, !1, ee);
|
|
7698
7711
|
}
|
|
7699
|
-
if (Rd.has(
|
|
7712
|
+
if (Rd.has($))
|
|
7700
7713
|
try {
|
|
7701
|
-
const { stages:
|
|
7702
|
-
|
|
7703
|
-
} catch (
|
|
7704
|
-
console.warn("Unable to refresh stages after flow-shaping step",
|
|
7714
|
+
const { stages: ne } = await Lt(re || void 0);
|
|
7715
|
+
O = te(ne), O = $n(O, M), n(O);
|
|
7716
|
+
} catch (ne) {
|
|
7717
|
+
console.warn("Unable to refresh stages after flow-shaping step", ne);
|
|
7705
7718
|
}
|
|
7706
7719
|
return Nn({
|
|
7707
|
-
stageKey:
|
|
7708
|
-
stageTitle:
|
|
7709
|
-
stepIndex:
|
|
7710
|
-
totalSteps:
|
|
7720
|
+
stageKey: $,
|
|
7721
|
+
stageTitle: j?.title ?? $,
|
|
7722
|
+
stepIndex: Q + 1,
|
|
7723
|
+
totalSteps: O.length
|
|
7711
7724
|
}), { success: !0 };
|
|
7712
|
-
} catch (
|
|
7713
|
-
return { success: !1, error:
|
|
7725
|
+
} catch (I) {
|
|
7726
|
+
return { success: !1, error: I instanceof Error ? I.message : "An error occurred" };
|
|
7714
7727
|
}
|
|
7715
7728
|
},
|
|
7716
7729
|
onComplete: async (M) => {
|
|
7717
7730
|
try {
|
|
7718
|
-
const
|
|
7731
|
+
const $ = Ar(M);
|
|
7719
7732
|
if (!o)
|
|
7720
7733
|
throw new Error("Quote ID is required");
|
|
7721
|
-
await ft(
|
|
7734
|
+
await ft($, !0), v(M), u(!0);
|
|
7722
7735
|
try {
|
|
7723
|
-
const { rates:
|
|
7724
|
-
c(
|
|
7736
|
+
const { rates: O } = await Gu();
|
|
7737
|
+
c(O);
|
|
7725
7738
|
} finally {
|
|
7726
7739
|
u(!1);
|
|
7727
7740
|
}
|
|
7728
|
-
const
|
|
7741
|
+
const I = r.length, re = r[I - 1];
|
|
7729
7742
|
return Nn({
|
|
7730
|
-
stageKey:
|
|
7731
|
-
stageTitle:
|
|
7732
|
-
stepIndex:
|
|
7733
|
-
totalSteps:
|
|
7743
|
+
stageKey: re?.key ?? "unknown",
|
|
7744
|
+
stageTitle: re?.title ?? "unknown",
|
|
7745
|
+
stepIndex: I,
|
|
7746
|
+
totalSteps: I
|
|
7734
7747
|
}), gd(), { success: !0 };
|
|
7735
7748
|
} catch {
|
|
7736
7749
|
return { success: !1, error: "Oops, something went wrong. Please try again later." };
|
|
@@ -7756,25 +7769,25 @@ function zd({ isOpen: e }) {
|
|
|
7756
7769
|
}
|
|
7757
7770
|
);
|
|
7758
7771
|
}
|
|
7759
|
-
let Ue = null, Je = null,
|
|
7772
|
+
let Ue = null, Je = null, Bt = !1;
|
|
7760
7773
|
function Ud() {
|
|
7761
7774
|
Ue || (Ue = document.createElement("div"), Ue.id = "insurance-widget-root", document.documentElement.appendChild(Ue)), !Je && Ue && (Je = Bo(Ue));
|
|
7762
7775
|
}
|
|
7763
7776
|
function _r() {
|
|
7764
|
-
Ud(), Je && Je.render(Fo(zd, { isOpen:
|
|
7777
|
+
Ud(), Je && Je.render(Fo(zd, { isOpen: Bt }));
|
|
7765
7778
|
}
|
|
7766
7779
|
function Hd() {
|
|
7767
7780
|
Je && Ue && (Je.unmount(), Ue.remove()), Je = null, Ue = null;
|
|
7768
7781
|
}
|
|
7769
7782
|
const Do = {
|
|
7770
7783
|
init: (e) => {
|
|
7771
|
-
|
|
7784
|
+
Bt = !!e?.autoOpen, _r();
|
|
7772
7785
|
},
|
|
7773
7786
|
open: () => {
|
|
7774
|
-
|
|
7787
|
+
Bt = !0, _r();
|
|
7775
7788
|
},
|
|
7776
7789
|
close: () => {
|
|
7777
|
-
|
|
7790
|
+
Bt = !1, _r();
|
|
7778
7791
|
},
|
|
7779
7792
|
destroy: Hd
|
|
7780
7793
|
};
|