"use strict";(self.webpackChunkapp_container=self.webpackChunkapp_container||[]).push([[8656],{8656:(e,t,i)=>{i.a(e,(async(e,n)=>{try{i.r(t),i.d(t,{NotificationJWT:()=>u});const e=await i.e(5275).then(i.bind(i,5275)).then((e=>e.setNotificationJWTToken)),{React:o,useCallback:s,useEffect:l}=await i.e(4914).then(i.t.bind(i,4914,23)).then((e=>({React:e.default,useCallback:e.useCallback,useEffect:e.useEffect}))),{useDispatch:c,useSelector:a}=await i.e(8330).then(i.t.bind(i,8330,23)).then((e=>({useSelector:e.useSelector,useDispatch:e.useDispatch}))),{API:d}=await i.e(118).then(i.bind(i,118)).then((e=>e)),u=()=>{const t=a((e=>e.storeFrontContainer.notificationJWTToken)),i=c(),n=s((async()=>{var t,n,o,s,l,c,a;let u=null===(t=window)||void 0===t||null===(t=t.flitsThemeAppExtensionObjects)||void 0===t?void 0:t.shop_id;const p=null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n?void 0:n.proxy_name,v={FlitsDev1:"dev1_app_",FlitsDev2:"dev2_app_",FlitsDev3:"dev3_app_",FlitsDev4:"dev4_app_",FlitsTesting:"testing_app_",flits:"shopify_app_"},h={action:"create_notification_token",merchant_id:"".concat(v[p]).concat(u)},r={action:"create_notification_token",merchant_id:"".concat(v[p]).concat(u),customer_id:null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.customer)||void 0===o?void 0:o.customer_id,token:null===(s=window)||void 0===s||null===(s=s.flitsThemeAppExtensionObjects)||void 0===s?void 0:s.shop_token,customer_hash:null===(l=window)||void 0===l||null===(l=l.flitsThemeAppExtensionObjects)||void 0===l||null===(l=l.customer)||void 0===l?void 0:l.customer_hash},_=""!==(null===(c=window)||void 0===c||null===(c=c.flitsThemeAppExtensionObjects)||void 0===c||null===(c=c.customer)||void 0===c?void 0:c.customer_id)&&"-1"!==(null===(a=window)||void 0===a||null===(a=a.flitsThemeAppExtensionObjects)||void 0===a||null===(a=a.customer)||void 0===a?void 0:a.customer_id),f=await d.notification.getJwttoken(_?r:h);i(e(f))}),[i]);return l((()=>{t||n()}),[t,n]),o.createElement(o.Fragment,null)};n()}catch(e){n(e)}}),1)}}]);