1import{cW as s,gm as e}from"./4c290a1e.D9lE9kmU.js";class t{constructor(){this.listeners=new Set}listen(s){return this.listeners.add(s),()=>{this.listeners.delete(s)}}emit(s){this.listeners.forEach((e=>e(s)))}}const r={billingAddress:0,shippingAddress:1,phone:2,firstName:3,paymentMethod:4,installmentsCard:5},n={billingAddress:[],shippingAddress:[],phone:[],firstName:[],paymentMethod:["billingAddress","shippingAddress","firstName","phone"],installmentsCard:["billingAddress","shippingAddress","firstName","phone","paymentMethod"]};class i{constructor(){this.interceptors=new Set,this.resultEmitter=new t}async runInterceptors(){const s=[...this.interceptors];s.sort((({name:s},{name:e})=>r[s]-r[e]));const e=[],t=new Set;for(const{name:r,interceptor:i}of s){if(n[r].some((s=>t.has(s))))continue;const s=await i();e.push(s),s.success||t.add(r)}return this.resultEmitter.emit(o(e)),e}intercept(s,e){const t={interceptor:e,name:s};return this.interceptors.add(t),()=>{this.interceptors.delete(t)}}listenResult(s){return this.resultEmitter.listen(s)}}function a({addressType:s,validate:e,setErrors:t}){const r=e();return r.size>0?(t(r),{success:!1,location:`intercept_${s}_address_has_errors`}):{success:!0}}function o(s){return s.every((s=>s.success))}function l(s){return s.flatMap((s=>!s.success&&"location"in s?[s.location]:[]))}function d(s){return s.flatMap((s=>"errors"in s?s.errors??[]:[]))}function c(t,r,n,i){if(!t)return!1;const{expired:a,supportsInstallmentsInterestLoan:o,supportsInstallmentsSplitPayLoan:l}=t,d=s(r.value),c=t.billingAddressValid&&t.billingAddress.address.countryCode&&d?.supportedCountries.includes(t.billingAddress.address.countryCode)&&e(d?.availableLoanTypes,l,o);return Boolean(a||n.value&&!c||i.value&&!o)}export{i as S,o as a,l as b,d as g,c as i,a as v};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.