ShopGlassesProductSpecificContentContextProvider.react",["CometRelay","FBLogger","ShopGlassesProductContext","ShopGlassesProductSpecificContentContextProviderQuery.graphql","ShopGlassesProductSpecificContext","XFBShopProductDetailsProductCategoryUtils.facebook","react","useCurrentRoute","useCurrentURI","useDollyMarketingProductSpecificModuleID","useMap"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=i||(i=d("react"));e=i;var k=e.useCallback,l=e.useContext,m=e.useEffect,n=e.useMemo;function a(a){var e=a.children,g=a.productDetailsCategory,i=d("CometRelay").useRelayEnvironment(),o=(a=c("useCurrentRoute")())==null?void 0:a.tracePolicy;a=c("useDollyMarketingProductSpecificModuleID")();var p=a.getModuleFromUniqueModuleName;a=l(c("ShopGlassesProductContext"));var q=a.isAvailableInCurrentCountry,r=a.selectedProduct,s=c("useCurrentURI")();a=c("useMap")();var t=a.map,u=a.remove,v=a.set;a=c("useMap")();var w=a.get,x=a.set;a=c("useMap")();var y=a.get,z=a.set;a=c("useMap")();var A=a.get,B=a.set,C=k(function(a,b,c){B(a+"/"+b,c)},[B]),D=k(function(a,b){return A(a+"/"+b)},[A]),E=k(function(a,b,c){v(a,b),z(a,c)},[z,v]),F=k(function(a){u(a)},[u]);a=n(function(){return{registerProductChangeListener:E,removeProductChangeListener:F,getLoadingStatusForModule:function(a){return(a=w(a))!=null?a:!1},productDetailsCategory:g}},[w,E,F,g]);m(function(){var a,e;if((r==null?void 0:r.productKey)==null)if(!q)a="fallback",e="fallback";else return;else{var j;j=(j=r==null?void 0:r.productUrl)!=null?j:"fallback";var k=/^/(?:[a-z]{2}/)?(?:[a-z]{2}/)?ai-glasses/([^/]+)/;a=(k=(j=j.match(k))==null?void 0:j[1])!=null?k:"fallback";e=r.productKey}if(e==null||a==null)throw c("FBLogger")("mdc_glasses_product_specific_content").mustfixThrow("selectedProductKey or selectedProductUrlKey is null in ShopGlassesProductSpecificContentContextProvider");j=Array.from(t.entries()).reduce(function(b,c){var a=c[0];c=c[1];a=p(a);return b.set(a,((b=b.get(a))!=null?b:[]).concat([c]))},new Map());j.forEach(function(k,j){var l;if(y(j)===e)return k.forEach(function(a){return a(null)});var m=D(j,a);if(m!=null)return k.forEach(function(a){return a(m)});x(j,!0);d("CometRelay").fetchQuery(i,h!==void 0?h:h=b("ShopGlassesProductSpecificContentContextProviderQuery.graphql"),{module:j!=null?j:"",product_key:a!=null?a:"fallback",requesterURI:s.toString(),productDetailsCategory:(l=d("XFBShopProductDetailsProductCategoryUtils.facebook").fromJSEnum(g))!=null?l:"HSTN",tracePolicy:o!=null?o+"."+j:j}).toPromise().then(function(b){var c=b==null?void 0:b.xfb_dolly_marketing_glasses_product_specific_content_by_sv;c&&C(j,a,c);x(j,!1);c&&k.forEach(function(a){return a(c)})})["catch"](function(a){throw c("FBLogger")("mdc_spritz").mustfixThrow("Failed to load product specific content in ShopSpritzProductSpecificContentContextProvider: "+(a instanceof Error?a.message:String(a)))})})},[s,i,D,y,p,q,t,r,C,x,o,g]);return j.jsx(c("ShopGlassesProductSpecificContext").Provider,{value:a,children:e})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98);
-----
ShopGlassesProductSpecificContentContextProviderQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24180454034989475"}),null);
-----