@thefittingroom/sdk 1.4.3 → 1.5.0

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * thefittingroom v1.4.3 (2024-08-27T23:39:34.070Z)
2
+ * thefittingroom v1.5.0 (2024-09-01T16:52:25.366Z)
3
3
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
4
4
  */
5
5
  var t=Object.freeze({__proto__:null}),e=Object.freeze({__proto__:null});
@@ -3277,5 +3277,5 @@ class sm{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var
3277
3277
  * See the License for the specific language governing permissions and
3278
3278
  * limitations under the License.
3279
3279
  */
3280
- const im=h("authIdTokenMaxAge")||300;let om=null;function am(t=xt()){const e=Dt(t,"auth");if(e.isInitialized())return e.getImmediate();const n=function(t,e){const n=Dt(t,"auth");if(n.isInitialized()){const t=n.getImmediate();if(m(n.getOptions(),null!=e?e:{}))return t;_f(t,"already-initialized")}return n.initialize({options:e})}(t,{popupRedirectResolver:em,persistence:[mg,Zp,eg]}),r=h("authTokenSyncURL");if(r){const t=(s=r,async t=>{const e=t&&await t.getIdTokenResult(),n=e&&((new Date).getTime()-Date.parse(e.issuedAtTime))/1e3;if(n&&n>im)return;const r=null==e?void 0:e.token;om!==r&&(om=r,await fetch(s,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))});!function(t,e,n){S(t).beforeAuthStateChanged(e,n)}(n,t,(()=>t(n.currentUser))),function(t,e,n,r){S(t).onIdTokenChanged(e,n,r)}(n,(e=>t(e)))}var s;const i=(t=>{var e,n;return null===(n=null===(e=c())||void 0===e?void 0:e.emulatorHosts)||void 0===n?void 0:n[t]})("auth");return i&&bp(n,`http://${i}`),n}var cm;cm="Browser",Nt(new I("auth",((t,{options:e})=>{const n=t.getProvider("app").getImmediate(),r=t.getProvider("heartbeat"),s=t.getProvider("app-check-internal"),{apiKey:i,authDomain:o}=n.options;Sf(i&&!i.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:i,authDomain:o,clientPlatform:cm,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:pp(cm)},c=new Ep(n,r,s,a);return function(t,e){const n=(null==e?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Xf);(null==e?void 0:e.errorMap)&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,null==e?void 0:e.popupRedirectResolver)}(c,e),c}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((t,e,n)=>{t.getProvider("auth-internal").initialize()}))),Nt(new I("auth-internal",(t=>(t=>new sm(t))(Sp(t.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),Ut(nm,rm,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(cm)),Ut(nm,rm,"esm2017");class um extends Error{constructor(){super("Avatar not created"),this.name="AvatarNotCreatedError"}}class hm extends Error{constructor(){super("user not logged in"),this.name="UserNotLoggedInError"}}class lm extends Error{constructor(){super("no colorway size assets found"),this.name="NoColorwaySizeAssetsFoundError"}}const dm="avatar not created";var fm=Object.freeze({__proto__:null,AvatarNotCreatedError:um,UserNotLoggedInError:hm,NoColorwaySizeAssetsFoundError:lm,AvatarNotCreated:dm});class pm{constructor(t,e){this.firestore=t,this.brandUserId=null,this.auth=am(e),this.auth.setPersistence(Zp)}get id(){var t;return null===(t=this.user)||void 0===t?void 0:t.uid}onInit(t){return new Promise((e=>{const n=this.auth.onAuthStateChanged((r=>{this.setUser(r),e(Boolean(r)),n(),r&&this.logUserLogin(t,r)}))}))}setUser(t){this.user=t}async logUserLogin(t,e){var n,r,s,i,o;try{const a=Ll(this.firestore,"user_logging",e.uid),c=await Rd(a),u=new Date,h=c.exists?c.data():null,l=null===(r=null===(n=null==h?void 0:h.brands)||void 0===n?void 0:n[t])||void 0===r?void 0:r.last_login;if(l&&uf(u).diff(uf(1e3*l.seconds),"seconds")<=10080)return;const d=null!==(o=null===(i=null===(s=null==h?void 0:h.brands)||void 0===s?void 0:s[t])||void 0===i?void 0:i.logins)&&void 0!==o?o:[];d.push(u);const f={brands:{[t]:{brand_id:t,last_login:u,logins:d}},last_brand_id:t,created_at:c.exists()?c.data().created_at:u,updated_at:u};await Od(a,f,{merge:!0})}catch(t){console.error("LOGGING ERROR:",t)}}setBrandUserId(t){this.brandUserId=t}async getToken(){var t;if(!(null===(t=this.user)||void 0===t?void 0:t.uid))throw new hm;return await this.user.getIdToken()}async getUserProfile(){var t;if(!(null===(t=this.user)||void 0===t?void 0:t.uid))throw new hm;return(await Rd(Ll(this.firestore,"users",this.id))).data()}watchUserProfileForChanges(t){let e;const n=md(Ol(this.firestore,"users"),vd(new Kl("__name__"),"==",this.id));return e=Ld(n,(e=>t(e.docs[0].data()))),()=>e()}async login(t,e){this.auth.currentUser&&await this.auth.signOut();const n=await Qp(this.auth,t,e);this.setUser(n.user)}async logout(){await this.auth.signOut(),this.setUser(null)}async sendPasswordResetEmail(t){await async function(t,e,n){var r;const s=Sp(t),i={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};if(null===(r=s._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const t=await _p(s,i,"getOobCode",!0);n&&Gp(s,t,n),await Np(s,t)}else n&&Gp(s,i,n),await Np(s,i).catch((async t=>{if("auth/missing-recaptcha-token"!==t.code)return Promise.reject(t);{console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");const t=await _p(s,i,"getOobCode",!0);n&&Gp(s,t,n),await Np(s,t)}}))}(this.auth,t)}async confirmPasswordReset(t,e){await zp(this.auth,t,e)}}class gm{constructor(){this.promisefyOnSnapshot=(t,e)=>{let n;return{promise:new Promise((r=>{n=Ld(t,(t=>{r(t),e&&n()}))})),unsubscribe:()=>n()}};const t=Mt(Md.getInstance().firebase);this.firestore=function(t,e){const n="string"==typeof t?t:e||"(default)",r=Dt("object"==typeof t?t:xt(),"firestore").getImmediate({identifier:n});if(!r._initialized){const t=ne("firestore");t&&kl(r,...t)}return r}(t),this.user=new pm(this.firestore,t)}onInit(t){return this.user.onInit(t)}query(t,e,n=!0){const r=md(Ol(this.firestore,t),e);return this.promisefyOnSnapshot(r,n)}getDocs(t,e){return Dd(md(Ol(this.firestore,t),...e))}async getDoc(t,e){const n=Ll(this.firestore,t,e),r=await Rd(n);return r.exists()?r.data():null}}const mm=t=>{if(t.code===yf)throw new Error("account has been disabled");throw new Error(t.message)};class ym{static get endpoint(){return Md.getInstance().api.url}static async Fetch({user:t,endpointPath:e,method:n,body:r,useToken:s=!0}){const i=this.getUrl(e,s),o={method:n,headers:await this.getHeaders(t,s),credentials:"omit"};r&&(o.body=JSON.stringify(r));const a=await fetch(i,o);if(a.ok)return a;if(500===a.status)throw new Error(a.statusText);const c=await a.json();return Promise.reject(c)}static getUrl(t,e){return e?`${this.endpoint}/v1${t}`:this.endpoint+t}static async getHeaders(t,e){if(!e)return{"Content-Type":"application/json"};return{"Content-Type":"application/json",Authorization:`Bearer ${await t.getToken()}`}}static Get(t,e,n){return this.Fetch({user:t,endpointPath:e,method:"GET",body:null,useToken:n})}static Post(t,e,n=null,r){return this.Fetch({user:t,endpointPath:e,method:"POST",body:n,useToken:r})}static Put(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"PUT",body:n,useToken:r})}static Patch(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"PATCH",body:n,useToken:r})}static Delete(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"DELETE",body:n,useToken:r})}}class vm{constructor(t,e){this.brandId=t,this.firebase=e,this.measurementLocations=new Map}get user(){return this.firebase.user}get isLoggedIn(){return!this.firebase||Boolean(this.user.id)}async onInit(){return await this.getMeasurementLocations(),this.firebase.onInit(this.brandId)}async getRecommendedSizes(t){var e,n;if(!this.isLoggedIn)throw new hm;try{const r=await ym.Get(this.user,`/styles/${t}/recommendation`),s=await r.json();return(null===(e=null==s?void 0:s.fits)||void 0===e?void 0:e.length)&&(null===(n=null==s?void 0:s.recommended_size)||void 0===n?void 0:n.id)?s:null}catch(t){if((null==t?void 0:t.error)===dm)throw new um;throw t}}async submitTelephoneNumber(t){const e=t.replace(/[^\+0-9]/g,""),n=await ym.Post(this.user,"/ios-app-link",{phone_number:e},!1);console.log(n)}async getColorwaySizeAssetFromSku(t){const e=await this.getColorwaySizeAssets(null,[t]);if(!(null==e?void 0:e.size))throw new lm;return Array.from(e.values())[0]}async getColorwaySizeAssetFromBrandStyleId(t){const e=await this.getColorwaySizeAssets(t);if(!(null==e?void 0:e.size))throw new lm;return Array.from(e.values())[0]}async getMeasurementLocationsFromSku(t,e=[]){const n=await this.getColorwaySizeAssetFromSku(t);if(!n)throw new Error("No colorway size asset found for sku");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const s=await this.getGetTaxonomy(r.style_garment_category_id);if(!s)throw new Error("Taxonomy not found for style garment category id");return(e.length?s.measurement_locations.female.filter((t=>e.includes(t))):s.measurement_locations.female).map((t=>this.measurementLocations.has(t)?this.measurementLocations.get(t):t))}async getMeasurementLocationsFromBrandStyleId(t,e=[]){const n=await this.getColorwaySizeAssetFromBrandStyleId(t);if(!n)throw new Error("No colorway size asset found for brand style id");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const s=await this.getGetTaxonomy(r.style_garment_category_id);if(!s)throw new Error("Taxonomy not found for style garment category id");return(e.length?s.measurement_locations.female.filter((t=>e.includes(t))):s.measurement_locations.female).map((t=>this.measurementLocations.has(t)?this.measurementLocations.get(t):t))}async getStyleByBrandStyleId(t){var e,n;try{const r=[vd("brand_id","==",this.brandId)];r.push(vd("brand_style_id","==",t));return null===(n=null===(e=(await this.firebase.getDocs("styles",r)).docs)||void 0===e?void 0:e[0])||void 0===n?void 0:n.data()}catch(t){return mm(t)}}async getColorwaySizeAssets(t,e){const n=[vd("brand_id","==",this.brandId)];t&&n.push(vd("style_id","==",t)),(null==e?void 0:e.length)>0&&n.push(vd("sku","in",e));try{const t=await this.firebase.getDocs("colorway_size_assets",n),e=new Map;return t.forEach((t=>{const n=t.data();e.set(n.id,n)})),e}catch(t){return mm(t)}}async getStyle(t){try{return await this.firebase.getDoc("styles",String(t))}catch(t){return mm(t)}}getMeasurementLocationName(t){return this.measurementLocations.has(t)?this.measurementLocations.get(t):t}async getGetTaxonomy(t){try{return await this.firebase.getDoc("style_garment_categories",String(t))}catch(t){return mm(t)}}async getMeasurementLocations(){(await this.fetchMeasurementLocations()).forEach((t=>{this.measurementLocations.set(t.name,t.garment_label)}))}async fetchMeasurementLocations(){try{return(await this.firebase.getDocs("measurement_locations",[])).docs.map((t=>t.data()))}catch(t){return mm(t)}}}const wm=(t,e="dev")=>("dev"!==e&&"development"!==e||console.warn("TfrShop is in development mode"),Md.getInstance().setEnv(e),new vm(t,new gm));var _m;!function(t){t.ACROSS_BACK="across_back",t.ACROSS_FRONT="across_front",t.ACROSS_SHOULDER="across_shoulder",t.ANKLE="ankle",t.ARMEYE="arm_eye",t.ARM_LENGTH_FROM_SHOULDER="arm_length_from_shoulder",t.BACK_CROTCH_LENGTH="back_crotch_length",t.BACK_NECK_TO_EBLOW="back_neck_to_elbow",t.BELOW_KNEE="below_knee",t.BICEP="bicep",t.BUST="bust",t.BUST_POINT_TO_BUST_POINT="bust_point_to_bust_point",t.CALF="calf",t.CB_NECK_TO_WAIST="cb_neck_to_waist",t.CB_NECK_TO_WRIST="cb_neck_to_wrist",t.CF_NECK_TO_WAIST="cf_neck_to_waist",t.ELBOW="elbow",t.FOREARM="forearm",t.FRONT_CROTCH_LENGTH="front_crotch_length",t.HIGH_HIP_PLACEMENT_FROM_WAIST="high_hip_placement",t.HIGH_HIP="high_hip",t.HSP_TO_ACROSS_BACK="hsp_to_across_back",t.HSP_TO_ACROSS_FRONT="hsp_to_across_front",t.HSP_TO_BUST_POINT="hsp_to_bust_point",t.HSP_TO_LOW_HIP_POSITION="hsp_to_low_hip_position",t.HSP_TO_WAIST_POSITION="hsp_to_waist_position",t.INSEAM="inseam",t.KNEE="knee",t.LOW_HIP="low_hip",t.LOW_HIP_PLACEMENT_FROM_WAIST="low_hip_placement",t.MID_NECK="mid_neck",t.NECK_AT_BASE="neck_base",t.SHOULDER_DROP="shoulder_drop",t.SHOULDER_TO_SHOULDER="shoulder_to_shoulder",t.SIDE_WAIST_TO_FLOOR="side_waist_to_floor",t.SIDE_WAIST_TO_KNEE="side_waist_to_knee",t.THIGH="thigh",t.TOTAL_RISE_LENGTH="total_rise_length",t.UNDER_BUST="under_bust",t.VERTICAL_TRUNK="vertical_trunk",t.WAIST="waist",t.WRIST="wrist"}(_m||(_m={}));const Tm={[_m.ACROSS_BACK]:"Across back",[_m.ACROSS_FRONT]:"Across front",[_m.ACROSS_SHOULDER]:"Across shoulder",[_m.ANKLE]:"Ankle",[_m.ARMEYE]:"Armeye",[_m.ARM_LENGTH_FROM_SHOULDER]:"Arm length from shoulder",[_m.BACK_CROTCH_LENGTH]:"Back crotch length",[_m.BACK_NECK_TO_EBLOW]:"Back neck to eblow",[_m.BELOW_KNEE]:"Below knee",[_m.BICEP]:"Bicep",[_m.BUST]:"Chest/Bust",[_m.BUST_POINT_TO_BUST_POINT]:"Bust point to bust point",[_m.CALF]:"Calf",[_m.CB_NECK_TO_WAIST]:"Cb neck to waist",[_m.CB_NECK_TO_WRIST]:"Cb neck to wrist",[_m.CF_NECK_TO_WAIST]:"Cf neck to waist",[_m.ELBOW]:"Elbow",[_m.FOREARM]:"Forearm",[_m.FRONT_CROTCH_LENGTH]:"Front crotch length",[_m.HIGH_HIP_PLACEMENT_FROM_WAIST]:"High hip placement from waist",[_m.HIGH_HIP]:"High hip",[_m.HSP_TO_ACROSS_BACK]:"Hsp to across back",[_m.HSP_TO_ACROSS_FRONT]:"Hsp to across front",[_m.HSP_TO_BUST_POINT]:"Hsp to bust point",[_m.HSP_TO_LOW_HIP_POSITION]:"Hsp to low hip position",[_m.HSP_TO_WAIST_POSITION]:"Hsp to waist position",[_m.INSEAM]:"Inseam",[_m.KNEE]:"Knee",[_m.LOW_HIP]:"Low hip",[_m.LOW_HIP_PLACEMENT_FROM_WAIST]:"Low hip placement from waist",[_m.MID_NECK]:"Mid neck",[_m.NECK_AT_BASE]:"Neck at base",[_m.SHOULDER_DROP]:"Shoulder drop",[_m.SHOULDER_TO_SHOULDER]:"Shoulder to shoulder",[_m.SIDE_WAIST_TO_FLOOR]:"Side waist to floor",[_m.SIDE_WAIST_TO_KNEE]:"Side waist to knee",[_m.THIGH]:"Thigh",[_m.TOTAL_RISE_LENGTH]:"Total rise length",[_m.UNDER_BUST]:"Under bust",[_m.VERTICAL_TRUNK]:"Vertical trunk",[_m.WAIST]:"Waist",[_m.WRIST]:"Wrist"};var Em;!function(t){t.BLOUSES="blouses",t.COATS="coats",t.DRESSES="dresses",t.JACKETS="jackets",t.PANTS="pants",t.PUFFERS_AND_PARKAS="puffer_and_parkas",t.SHORTS="shorts",t.SKIRTS="skirts",t.SWEATERS="sweaters",t.T_SHIRTS_AND_TANKS="t_shirts_and_tanks"}(Em||(Em={}));const Sm={[Em.BLOUSES]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.COATS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.DRESSES]:[_m.LOW_HIP,_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST],[Em.JACKETS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.PANTS]:[_m.LOW_HIP,_m.WAIST,_m.THIGH,_m.INSEAM],[Em.PUFFERS_AND_PARKAS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.SHORTS]:[_m.LOW_HIP,_m.WAIST,_m.THIGH,_m.INSEAM],[Em.SKIRTS]:[_m.LOW_HIP,_m.WAIST],[Em.SWEATERS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.T_SHIRTS_AND_TANKS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP]},Im={activewear:"Active Wear",dresses:"Dresses",jackets_and_coats:"Jackets and Coats",jeans:"Jeans",jumpsuits_and_rompers:"Jumpsuits and Rompers",pants_and_shorts:"Pants and Shorts",skirts:"Skirts",suits_and_tailoring:"Suits and Tailoring",sweaters:"Sweaters",tops:"Tops"},bm={a_line:"A Line",a_line_flared:"A Line Flared",blazers:"Blazers",bodycon:"Bodycon",bodysuits:"Bodysuits",boiler_suits:"Boiler Suits",bootcut:"Bootcut",cardigans:"Cardigans",cigarette:"Cigarette",corsets_and_bustiers:"Corsets and Bustiers",crewnecks:"Crewnecks",culottes:"Culottes",denim:"Denim",denim_jackets:"Denim Jackets",denim_shorts:"Denim Shorts",fit_and_flare:"Fit and Flare",flared:"Flared",hoodies_and_zipups:"Hoodies and Zipups",joggers:"Joggers",jumpsuits:"Jumpsuits",knit:"Knit",leggings:"Leggings",mom:"Mom",overalls:"Overalls",parkas:"Parkas",peacoats:"Peacoats",pencil:"Pencil",pleated:"Pleated",polos:"Polos",puffer_jackets:"Puffer Jackets",raincoats:"Raincoats",relaxed:"Relaxed",rompers:"Rompers",shackets:"Shackets",shirt:"Shirt",shirts_and_blouses:"Shirts and Blouses",skater:"Skater",skinny:"Skinny",slim:"Slim",slip:"Slip",sports_bras:"Sports Bras",straight:"Straight",suit_jackets:"Suit Jackets",suit_skirts:"Suit Skirts",suit_trousers:"Suit Trousers",suit_vests:"Suit Vests",sweatshirts:"Sweatshirts",t_shirts:"T-Shirts",tank_tops_and_camisoles:"Tank Tops and Camisoles",tapered:"Tapered",trench_coats:"Trench Coats",trousers:"Trousers",turtlenecks:"Turtleneck",unitards:"Unitards",v_necks:"V-Necks",wide_leg:"Wide Leg",wrap:"Wrap"},Am={activewear:{leggings:Em.PANTS,joggers:Em.PANTS,sweatshirts:Em.SWEATERS},dresses:{a_line:Em.DRESSES,bodycon:Em.DRESSES,fit_and_flare:Em.DRESSES,knit:Em.DRESSES,shirt:Em.DRESSES,slip:Em.DRESSES,straight:Em.DRESSES,wrap:Em.DRESSES},jackets_and_coats:{denim_jackets:Em.JACKETS,parkas:Em.PUFFERS_AND_PARKAS,peacoats:Em.COATS,puffer_jackets:Em.PUFFERS_AND_PARKAS,raincoats:Em.COATS,rompers:Em.COATS,shackets:Em.JACKETS,trench_coats:Em.COATS},jeans:{bootcut:Em.PANTS,flared:Em.PANTS,mom:Em.PANTS,relaxed:Em.PANTS,skinny:Em.PANTS,slim:Em.PANTS,straight:Em.PANTS,tapered:Em.PANTS,wide_leg:Em.PANTS},jumpsuits_and_rompers:{boiler_suits:Em.DRESSES,denim:Em.DRESSES,jumpsuits:Em.DRESSES,overalls:Em.DRESSES,rompers:Em.DRESSES,unitards:Em.DRESSES},pants_and_shorts:{cigarette:Em.PANTS,culottes:Em.SHORTS,denim_shorts:Em.SHORTS,flared:Em.PANTS,joggers:Em.PANTS,leggings:Em.PANTS,skinny:Em.PANTS,wide_leg:Em.PANTS},skirts:{a_line_flared:Em.SKIRTS,denim:Em.SKIRTS,knit:Em.SKIRTS,pencil:Em.SKIRTS,pleated:Em.SKIRTS,skater:Em.SKIRTS,slip:Em.SKIRTS,wrap:Em.SKIRTS},suits_and_tailoring:{blazers:Em.JACKETS,suit_jackets:Em.JACKETS,suit_skirts:Em.SKIRTS,suit_trousers:Em.PANTS,suit_vests:Em.SWEATERS,trousers:Em.PANTS},sweaters:{cardigans:Em.SWEATERS,crewnecks:Em.SWEATERS,hoodies_and_zipups:Em.SWEATERS,sweatshirts:Em.SWEATERS,turtlenecks:Em.SWEATERS,v_necks:Em.SWEATERS},tops:{bodysuits:Em.BLOUSES,corsets_and_bustiers:Em.BLOUSES,polos:Em.T_SHIRTS_AND_TANKS,shirts_and_blouses:Em.BLOUSES,t_shirts:Em.T_SHIRTS_AND_TANKS,tank_tops_and_camisoles:Em.T_SHIRTS_AND_TANKS}};var Cm;!function(t){t.TOO_TIGHT="too_tight",t.TIGHT="tight",t.SLIGHTLY_TIGHT="slightly_tight",t.PERFECT_FIT="perfect_fit",t.SLIGHTLY_LOOSE="slightly_loose",t.LOOSE="loose",t.OVERSIZED="oversized",t.TOO_SHORT="too_short",t.SHORT="short",t.SLIGHTLY_SHORT="slightly_short",t.SLIGHTLY_LONG="slightly_long",t.LONG="long",t.TOO_LONG="too_long"}(Cm||(Cm={}));const km={[Cm.TOO_TIGHT]:"Too Tight",[Cm.TIGHT]:"Tight",[Cm.SLIGHTLY_TIGHT]:"Slightly Tight",[Cm.PERFECT_FIT]:"Perfect Fit",[Cm.SLIGHTLY_LOOSE]:"Slightly Loose",[Cm.LOOSE]:"Loose",[Cm.OVERSIZED]:"Oversized",[Cm.TOO_SHORT]:"Too Short",[Cm.SHORT]:"Short",[Cm.SLIGHTLY_SHORT]:"Slightly Short",[Cm.SLIGHTLY_LONG]:"Slightly Long",[Cm.LONG]:"Long",[Cm.TOO_LONG]:"Too Long"};var Rm;!function(t){t.NOT_CREATED="NOT_CREATED",t.CREATED="CREATED",t.PENDING="PENDING"}(Rm||(Rm={}));var Nm=Object.freeze({__proto__:null,get AvatarState(){return Rm},get MeasurementLocation(){return _m},MeasurementLocationName:Tm,get Classification(){return Em},ClassificationLocations:Sm,CategoryNames:Im,Categories:["activewear","dresses","jackets_and_coats","jeans","jumpsuits_and_rompers","pants_and_shorts","skirts","suits_and_tailoring","sweaters","tops"],SubcategoryNames:bm,Taxonomy:Am,get Fit(){return Cm},FitNames:km});export{fm as Errors,wm as initShop,t as requests,e as responses,Nm as types};
3280
+ const im=h("authIdTokenMaxAge")||300;let om=null;function am(t=xt()){const e=Dt(t,"auth");if(e.isInitialized())return e.getImmediate();const n=function(t,e){const n=Dt(t,"auth");if(n.isInitialized()){const t=n.getImmediate();if(m(n.getOptions(),null!=e?e:{}))return t;_f(t,"already-initialized")}return n.initialize({options:e})}(t,{popupRedirectResolver:em,persistence:[mg,Zp,eg]}),r=h("authTokenSyncURL");if(r){const t=(s=r,async t=>{const e=t&&await t.getIdTokenResult(),n=e&&((new Date).getTime()-Date.parse(e.issuedAtTime))/1e3;if(n&&n>im)return;const r=null==e?void 0:e.token;om!==r&&(om=r,await fetch(s,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))});!function(t,e,n){S(t).beforeAuthStateChanged(e,n)}(n,t,(()=>t(n.currentUser))),function(t,e,n,r){S(t).onIdTokenChanged(e,n,r)}(n,(e=>t(e)))}var s;const i=(t=>{var e,n;return null===(n=null===(e=c())||void 0===e?void 0:e.emulatorHosts)||void 0===n?void 0:n[t]})("auth");return i&&bp(n,`http://${i}`),n}var cm;cm="Browser",Nt(new I("auth",((t,{options:e})=>{const n=t.getProvider("app").getImmediate(),r=t.getProvider("heartbeat"),s=t.getProvider("app-check-internal"),{apiKey:i,authDomain:o}=n.options;Sf(i&&!i.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:i,authDomain:o,clientPlatform:cm,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:pp(cm)},c=new Ep(n,r,s,a);return function(t,e){const n=(null==e?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Xf);(null==e?void 0:e.errorMap)&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,null==e?void 0:e.popupRedirectResolver)}(c,e),c}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((t,e,n)=>{t.getProvider("auth-internal").initialize()}))),Nt(new I("auth-internal",(t=>(t=>new sm(t))(Sp(t.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),Ut(nm,rm,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(cm)),Ut(nm,rm,"esm2017");class um extends Error{constructor(){super("Avatar not created"),this.name="AvatarNotCreatedError"}}class hm extends Error{constructor(){super("user not logged in"),this.name="UserNotLoggedInError"}}class lm extends Error{constructor(){super("no colorway size assets found"),this.name="NoColorwaySizeAssetsFoundError"}}const dm="avatar not created";var fm=Object.freeze({__proto__:null,AvatarNotCreatedError:um,UserNotLoggedInError:hm,NoColorwaySizeAssetsFoundError:lm,AvatarNotCreated:dm});class pm{constructor(t,e){this.firestore=t,this.brandUserId=null,this.auth=am(e),this.auth.setPersistence(Zp)}get id(){var t;return null===(t=this.user)||void 0===t?void 0:t.uid}onInit(t){return new Promise((e=>{const n=this.auth.onAuthStateChanged((r=>{this.setUser(r),e(Boolean(r)),n(),r&&this.logUserLogin(t,r)}))}))}setUser(t){this.user=t}async logUserLogin(t,e){var n,r,s,i,o;try{const a=Ll(this.firestore,"user_logging",e.uid),c=await Rd(a),u=new Date,h=c.exists?c.data():null,l=null===(r=null===(n=null==h?void 0:h.brands)||void 0===n?void 0:n[t])||void 0===r?void 0:r.last_login;if(l&&uf(u).diff(uf(1e3*l.seconds),"seconds")<=10080)return;const d=null!==(o=null===(i=null===(s=null==h?void 0:h.brands)||void 0===s?void 0:s[t])||void 0===i?void 0:i.logins)&&void 0!==o?o:[];d.push(u);const f={brands:{[t]:{brand_id:t,last_login:u,logins:d}},last_brand_id:t,created_at:c.exists()?c.data().created_at:u,updated_at:u};await Od(a,f,{merge:!0})}catch(t){console.error("LOGGING ERROR:",t)}}setBrandUserId(t){this.brandUserId=t}async getToken(){var t;if(!(null===(t=this.user)||void 0===t?void 0:t.uid))throw new hm;return await this.user.getIdToken()}async getUserProfile(){var t;if(!(null===(t=this.user)||void 0===t?void 0:t.uid))throw new hm;return(await Rd(Ll(this.firestore,"users",this.id))).data()}watchUserProfileForChanges(t){let e;const n=md(Ol(this.firestore,"users"),vd(new Kl("__name__"),"==",this.id));return e=Ld(n,(e=>t(e.docs[0].data()))),()=>e()}async login(t,e){this.auth.currentUser&&await this.auth.signOut();const n=await Qp(this.auth,t,e);this.setUser(n.user)}async logout(){await this.auth.signOut(),this.setUser(null)}async sendPasswordResetEmail(t){await async function(t,e,n){var r;const s=Sp(t),i={requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"};if(null===(r=s._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const t=await _p(s,i,"getOobCode",!0);n&&Gp(s,t,n),await Np(s,t)}else n&&Gp(s,i,n),await Np(s,i).catch((async t=>{if("auth/missing-recaptcha-token"!==t.code)return Promise.reject(t);{console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");const t=await _p(s,i,"getOobCode",!0);n&&Gp(s,t,n),await Np(s,t)}}))}(this.auth,t)}async confirmPasswordReset(t,e){await zp(this.auth,t,e)}}class gm{constructor(){this.promisefyOnSnapshot=(t,e)=>{let n;return{promise:new Promise((r=>{n=Ld(t,(t=>{r(t),e&&n()}))})),unsubscribe:()=>n()}};const t=Mt(Md.getInstance().firebase);this.firestore=function(t,e){const n="string"==typeof t?t:e||"(default)",r=Dt("object"==typeof t?t:xt(),"firestore").getImmediate({identifier:n});if(!r._initialized){const t=ne("firestore");t&&kl(r,...t)}return r}(t),this.user=new pm(this.firestore,t)}onInit(t){return this.user.onInit(t)}query(t,e,n=!0){const r=md(Ol(this.firestore,t),e);return this.promisefyOnSnapshot(r,n)}getDocs(t,e){return Dd(md(Ol(this.firestore,t),...e))}async getDoc(t,e){const n=Ll(this.firestore,t,e),r=await Rd(n);return r.exists()?r.data():null}}const mm=t=>{if(t.code===yf)throw new Error("account has been disabled");throw new Error(t.message)};class ym{static get endpoint(){return Md.getInstance().api.url}static async Fetch({user:t,endpointPath:e,method:n,body:r,useToken:s=!0}){const i=this.getUrl(e,s),o={method:n,headers:await this.getHeaders(t,s),credentials:"omit"};r&&(o.body=JSON.stringify(r));const a=await fetch(i,o);if(a.ok)return a;if(500===a.status)throw new Error(a.statusText);const c=await a.json();return Promise.reject(c)}static getUrl(t,e){return e?`${this.endpoint}/v1${t}`:this.endpoint+t}static async getHeaders(t,e){if(!e)return{"Content-Type":"application/json"};return{"Content-Type":"application/json",Authorization:`Bearer ${await t.getToken()}`}}static Get(t,e,n){return this.Fetch({user:t,endpointPath:e,method:"GET",body:null,useToken:n})}static Post(t,e,n=null,r){return this.Fetch({user:t,endpointPath:e,method:"POST",body:n,useToken:r})}static Put(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"PUT",body:n,useToken:r})}static Patch(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"PATCH",body:n,useToken:r})}static Delete(t,e,n,r){return this.Fetch({user:t,endpointPath:e,method:"DELETE",body:n,useToken:r})}}class vm{constructor(t,e){this.brandId=t,this.firebase=e,this.measurementLocations=new Map}get user(){return this.firebase.user}get isLoggedIn(){return!this.firebase||Boolean(this.user.id)}async onInit(){return await this.getMeasurementLocations(),this.firebase.onInit(this.brandId)}async getRecommendedSizes(t){var e,n;if(!this.isLoggedIn)throw new hm;try{const r=await ym.Get(this.user,`/styles/${t}/recommendation`),s=await r.json();return(null===(e=null==s?void 0:s.fits)||void 0===e?void 0:e.length)&&(null===(n=null==s?void 0:s.recommended_size)||void 0===n?void 0:n.id)?s:null}catch(t){if((null==t?void 0:t.error)===dm)throw new um;throw t}}async submitTelephoneNumber(t){const e=t.replace(/[^\+0-9]/g,""),n=await ym.Post(this.user,"/ios-app-link",{phone_number:e},!1);console.log(n)}async getColorwaySizeAssetFromSku(t){const e=await this.getColorwaySizeAssets(null,[t]);if(!(null==e?void 0:e.size))throw new lm;return Array.from(e.values())[0]}async getColorwaySizeAssetFromBrandStyleId(t){const e=await this.getColorwaySizeAssets(t);if(!(null==e?void 0:e.size))throw new lm;return Array.from(e.values())[0]}async getMeasurementLocationsFromSku(t,e=[]){const n=await this.getColorwaySizeAssetFromSku(t);if(!n)throw new Error("No colorway size asset found for sku");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const s=await this.getGetTaxonomy(r.style_garment_category_id);if(!s)throw new Error("Taxonomy not found for style garment category id");return(e.length?s.measurement_locations.female.filter((t=>e.includes(t))):s.measurement_locations.female).map((t=>this.measurementLocations.has(t)?this.measurementLocations.get(t):{name:t,sort_order:1/0})).sort(((t,e)=>t.sort_order<e.sort_order?-1:0)).map((t=>t.name))}async getMeasurementLocationsFromBrandStyleId(t,e=[]){const n=await this.getColorwaySizeAssetFromBrandStyleId(t);if(!n)throw new Error("No colorway size asset found for brand style id");const r=await this.getStyle(n.style_id);if(!r)throw new Error("Style category not found for style id");const s=await this.getGetTaxonomy(r.style_garment_category_id);if(!s)throw new Error("Taxonomy not found for style garment category id");return(e.length?s.measurement_locations.female.filter((t=>e.includes(t))):s.measurement_locations.female).map((t=>this.measurementLocations.has(t)?this.measurementLocations.get(t):{name:t,sort_order:1/0})).sort(((t,e)=>t.sort_order<e.sort_order?-1:0)).map((t=>t.name))}async getStyleByBrandStyleId(t){var e,n;try{const r=[vd("brand_id","==",this.brandId)];r.push(vd("brand_style_id","==",t));return null===(n=null===(e=(await this.firebase.getDocs("styles",r)).docs)||void 0===e?void 0:e[0])||void 0===n?void 0:n.data()}catch(t){return mm(t)}}async getColorwaySizeAssets(t,e){const n=[vd("brand_id","==",this.brandId)];t&&n.push(vd("style_id","==",t)),(null==e?void 0:e.length)>0&&n.push(vd("sku","in",e));try{const t=await this.firebase.getDocs("colorway_size_assets",n),e=new Map;return t.forEach((t=>{const n=t.data();e.set(n.id,n)})),e}catch(t){return mm(t)}}async getStyle(t){try{return await this.firebase.getDoc("styles",String(t))}catch(t){return mm(t)}}getMeasurementLocationName(t){return this.measurementLocations.has(t)?this.measurementLocations.get(t).name:t}getMeasurementLocationSortOrder(t){return this.measurementLocations.has(t)?this.measurementLocations.get(t).sort_order:1/0}async getGetTaxonomy(t){try{return await this.firebase.getDoc("style_garment_categories",String(t))}catch(t){return mm(t)}}async getMeasurementLocations(){(await this.fetchMeasurementLocations()).forEach((t=>{this.measurementLocations.set(t.name,{name:t.garment_label,sort_order:t.sort_order})}))}async fetchMeasurementLocations(){try{return(await this.firebase.getDocs("measurement_locations",[])).docs.map((t=>t.data()))}catch(t){return mm(t)}}}const wm=(t,e="dev")=>("dev"!==e&&"development"!==e||console.warn("TfrShop is in development mode"),Md.getInstance().setEnv(e),new vm(t,new gm));var _m;!function(t){t.ACROSS_BACK="across_back",t.ACROSS_FRONT="across_front",t.ACROSS_SHOULDER="across_shoulder",t.ANKLE="ankle",t.ARMEYE="arm_eye",t.ARM_LENGTH_FROM_SHOULDER="arm_length_from_shoulder",t.BACK_CROTCH_LENGTH="back_crotch_length",t.BACK_NECK_TO_EBLOW="back_neck_to_elbow",t.BELOW_KNEE="below_knee",t.BICEP="bicep",t.BUST="bust",t.BUST_POINT_TO_BUST_POINT="bust_point_to_bust_point",t.CALF="calf",t.CB_NECK_TO_WAIST="cb_neck_to_waist",t.CB_NECK_TO_WRIST="cb_neck_to_wrist",t.CF_NECK_TO_WAIST="cf_neck_to_waist",t.ELBOW="elbow",t.FOREARM="forearm",t.FRONT_CROTCH_LENGTH="front_crotch_length",t.HIGH_HIP_PLACEMENT_FROM_WAIST="high_hip_placement",t.HIGH_HIP="high_hip",t.HSP_TO_ACROSS_BACK="hsp_to_across_back",t.HSP_TO_ACROSS_FRONT="hsp_to_across_front",t.HSP_TO_BUST_POINT="hsp_to_bust_point",t.HSP_TO_LOW_HIP_POSITION="hsp_to_low_hip_position",t.HSP_TO_WAIST_POSITION="hsp_to_waist_position",t.INSEAM="inseam",t.KNEE="knee",t.LOW_HIP="low_hip",t.LOW_HIP_PLACEMENT_FROM_WAIST="low_hip_placement",t.MID_NECK="mid_neck",t.NECK_AT_BASE="neck_base",t.SHOULDER_DROP="shoulder_drop",t.SHOULDER_TO_SHOULDER="shoulder_to_shoulder",t.SIDE_WAIST_TO_FLOOR="side_waist_to_floor",t.SIDE_WAIST_TO_KNEE="side_waist_to_knee",t.THIGH="thigh",t.TOTAL_RISE_LENGTH="total_rise_length",t.UNDER_BUST="under_bust",t.VERTICAL_TRUNK="vertical_trunk",t.WAIST="waist",t.WRIST="wrist"}(_m||(_m={}));const Tm={[_m.ACROSS_BACK]:"Across back",[_m.ACROSS_FRONT]:"Across front",[_m.ACROSS_SHOULDER]:"Across shoulder",[_m.ANKLE]:"Ankle",[_m.ARMEYE]:"Armeye",[_m.ARM_LENGTH_FROM_SHOULDER]:"Arm length from shoulder",[_m.BACK_CROTCH_LENGTH]:"Back crotch length",[_m.BACK_NECK_TO_EBLOW]:"Back neck to eblow",[_m.BELOW_KNEE]:"Below knee",[_m.BICEP]:"Bicep",[_m.BUST]:"Chest/Bust",[_m.BUST_POINT_TO_BUST_POINT]:"Bust point to bust point",[_m.CALF]:"Calf",[_m.CB_NECK_TO_WAIST]:"Cb neck to waist",[_m.CB_NECK_TO_WRIST]:"Cb neck to wrist",[_m.CF_NECK_TO_WAIST]:"Cf neck to waist",[_m.ELBOW]:"Elbow",[_m.FOREARM]:"Forearm",[_m.FRONT_CROTCH_LENGTH]:"Front crotch length",[_m.HIGH_HIP_PLACEMENT_FROM_WAIST]:"High hip placement from waist",[_m.HIGH_HIP]:"High hip",[_m.HSP_TO_ACROSS_BACK]:"Hsp to across back",[_m.HSP_TO_ACROSS_FRONT]:"Hsp to across front",[_m.HSP_TO_BUST_POINT]:"Hsp to bust point",[_m.HSP_TO_LOW_HIP_POSITION]:"Hsp to low hip position",[_m.HSP_TO_WAIST_POSITION]:"Hsp to waist position",[_m.INSEAM]:"Inseam",[_m.KNEE]:"Knee",[_m.LOW_HIP]:"Low hip",[_m.LOW_HIP_PLACEMENT_FROM_WAIST]:"Low hip placement from waist",[_m.MID_NECK]:"Mid neck",[_m.NECK_AT_BASE]:"Neck at base",[_m.SHOULDER_DROP]:"Shoulder drop",[_m.SHOULDER_TO_SHOULDER]:"Shoulder to shoulder",[_m.SIDE_WAIST_TO_FLOOR]:"Side waist to floor",[_m.SIDE_WAIST_TO_KNEE]:"Side waist to knee",[_m.THIGH]:"Thigh",[_m.TOTAL_RISE_LENGTH]:"Total rise length",[_m.UNDER_BUST]:"Under bust",[_m.VERTICAL_TRUNK]:"Vertical trunk",[_m.WAIST]:"Waist",[_m.WRIST]:"Wrist"};var Em;!function(t){t.BLOUSES="blouses",t.COATS="coats",t.DRESSES="dresses",t.JACKETS="jackets",t.PANTS="pants",t.PUFFERS_AND_PARKAS="puffer_and_parkas",t.SHORTS="shorts",t.SKIRTS="skirts",t.SWEATERS="sweaters",t.T_SHIRTS_AND_TANKS="t_shirts_and_tanks"}(Em||(Em={}));const Sm={[Em.BLOUSES]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.COATS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.DRESSES]:[_m.LOW_HIP,_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST],[Em.JACKETS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.PANTS]:[_m.LOW_HIP,_m.WAIST,_m.THIGH,_m.INSEAM],[Em.PUFFERS_AND_PARKAS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.SHORTS]:[_m.LOW_HIP,_m.WAIST,_m.THIGH,_m.INSEAM],[Em.SKIRTS]:[_m.LOW_HIP,_m.WAIST],[Em.SWEATERS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP],[Em.T_SHIRTS_AND_TANKS]:[_m.BUST,_m.ACROSS_SHOULDER,_m.WAIST,_m.LOW_HIP,_m.HIGH_HIP]},Im={activewear:"Active Wear",dresses:"Dresses",jackets_and_coats:"Jackets and Coats",jeans:"Jeans",jumpsuits_and_rompers:"Jumpsuits and Rompers",pants_and_shorts:"Pants and Shorts",skirts:"Skirts",suits_and_tailoring:"Suits and Tailoring",sweaters:"Sweaters",tops:"Tops"},bm={a_line:"A Line",a_line_flared:"A Line Flared",blazers:"Blazers",bodycon:"Bodycon",bodysuits:"Bodysuits",boiler_suits:"Boiler Suits",bootcut:"Bootcut",cardigans:"Cardigans",cigarette:"Cigarette",corsets_and_bustiers:"Corsets and Bustiers",crewnecks:"Crewnecks",culottes:"Culottes",denim:"Denim",denim_jackets:"Denim Jackets",denim_shorts:"Denim Shorts",fit_and_flare:"Fit and Flare",flared:"Flared",hoodies_and_zipups:"Hoodies and Zipups",joggers:"Joggers",jumpsuits:"Jumpsuits",knit:"Knit",leggings:"Leggings",mom:"Mom",overalls:"Overalls",parkas:"Parkas",peacoats:"Peacoats",pencil:"Pencil",pleated:"Pleated",polos:"Polos",puffer_jackets:"Puffer Jackets",raincoats:"Raincoats",relaxed:"Relaxed",rompers:"Rompers",shackets:"Shackets",shirt:"Shirt",shirts_and_blouses:"Shirts and Blouses",skater:"Skater",skinny:"Skinny",slim:"Slim",slip:"Slip",sports_bras:"Sports Bras",straight:"Straight",suit_jackets:"Suit Jackets",suit_skirts:"Suit Skirts",suit_trousers:"Suit Trousers",suit_vests:"Suit Vests",sweatshirts:"Sweatshirts",t_shirts:"T-Shirts",tank_tops_and_camisoles:"Tank Tops and Camisoles",tapered:"Tapered",trench_coats:"Trench Coats",trousers:"Trousers",turtlenecks:"Turtleneck",unitards:"Unitards",v_necks:"V-Necks",wide_leg:"Wide Leg",wrap:"Wrap"},Am={activewear:{leggings:Em.PANTS,joggers:Em.PANTS,sweatshirts:Em.SWEATERS},dresses:{a_line:Em.DRESSES,bodycon:Em.DRESSES,fit_and_flare:Em.DRESSES,knit:Em.DRESSES,shirt:Em.DRESSES,slip:Em.DRESSES,straight:Em.DRESSES,wrap:Em.DRESSES},jackets_and_coats:{denim_jackets:Em.JACKETS,parkas:Em.PUFFERS_AND_PARKAS,peacoats:Em.COATS,puffer_jackets:Em.PUFFERS_AND_PARKAS,raincoats:Em.COATS,rompers:Em.COATS,shackets:Em.JACKETS,trench_coats:Em.COATS},jeans:{bootcut:Em.PANTS,flared:Em.PANTS,mom:Em.PANTS,relaxed:Em.PANTS,skinny:Em.PANTS,slim:Em.PANTS,straight:Em.PANTS,tapered:Em.PANTS,wide_leg:Em.PANTS},jumpsuits_and_rompers:{boiler_suits:Em.DRESSES,denim:Em.DRESSES,jumpsuits:Em.DRESSES,overalls:Em.DRESSES,rompers:Em.DRESSES,unitards:Em.DRESSES},pants_and_shorts:{cigarette:Em.PANTS,culottes:Em.SHORTS,denim_shorts:Em.SHORTS,flared:Em.PANTS,joggers:Em.PANTS,leggings:Em.PANTS,skinny:Em.PANTS,wide_leg:Em.PANTS},skirts:{a_line_flared:Em.SKIRTS,denim:Em.SKIRTS,knit:Em.SKIRTS,pencil:Em.SKIRTS,pleated:Em.SKIRTS,skater:Em.SKIRTS,slip:Em.SKIRTS,wrap:Em.SKIRTS},suits_and_tailoring:{blazers:Em.JACKETS,suit_jackets:Em.JACKETS,suit_skirts:Em.SKIRTS,suit_trousers:Em.PANTS,suit_vests:Em.SWEATERS,trousers:Em.PANTS},sweaters:{cardigans:Em.SWEATERS,crewnecks:Em.SWEATERS,hoodies_and_zipups:Em.SWEATERS,sweatshirts:Em.SWEATERS,turtlenecks:Em.SWEATERS,v_necks:Em.SWEATERS},tops:{bodysuits:Em.BLOUSES,corsets_and_bustiers:Em.BLOUSES,polos:Em.T_SHIRTS_AND_TANKS,shirts_and_blouses:Em.BLOUSES,t_shirts:Em.T_SHIRTS_AND_TANKS,tank_tops_and_camisoles:Em.T_SHIRTS_AND_TANKS}};var Cm;!function(t){t.TOO_TIGHT="too_tight",t.TIGHT="tight",t.SLIGHTLY_TIGHT="slightly_tight",t.PERFECT_FIT="perfect_fit",t.SLIGHTLY_LOOSE="slightly_loose",t.LOOSE="loose",t.OVERSIZED="oversized",t.TOO_SHORT="too_short",t.SHORT="short",t.SLIGHTLY_SHORT="slightly_short",t.SLIGHTLY_LONG="slightly_long",t.LONG="long",t.TOO_LONG="too_long"}(Cm||(Cm={}));const km={[Cm.TOO_TIGHT]:"Too Tight",[Cm.TIGHT]:"Tight",[Cm.SLIGHTLY_TIGHT]:"Slightly Tight",[Cm.PERFECT_FIT]:"Perfect Fit",[Cm.SLIGHTLY_LOOSE]:"Slightly Loose",[Cm.LOOSE]:"Loose",[Cm.OVERSIZED]:"Oversized",[Cm.TOO_SHORT]:"Too Short",[Cm.SHORT]:"Short",[Cm.SLIGHTLY_SHORT]:"Slightly Short",[Cm.SLIGHTLY_LONG]:"Slightly Long",[Cm.LONG]:"Long",[Cm.TOO_LONG]:"Too Long"};var Rm;!function(t){t.NOT_CREATED="NOT_CREATED",t.CREATED="CREATED",t.PENDING="PENDING"}(Rm||(Rm={}));var Nm=Object.freeze({__proto__:null,get AvatarState(){return Rm},get MeasurementLocation(){return _m},MeasurementLocationName:Tm,get Classification(){return Em},ClassificationLocations:Sm,CategoryNames:Im,Categories:["activewear","dresses","jackets_and_coats","jeans","jumpsuits_and_rompers","pants_and_shorts","skirts","suits_and_tailoring","sweaters","tops"],SubcategoryNames:bm,Taxonomy:Am,get Fit(){return Cm},FitNames:km});export{fm as Errors,wm as initShop,t as requests,e as responses,Nm as types};
3281
3281
  //# sourceMappingURL=index.min.js.map