@envive-ai/react-hooks 0.1.3 → 0.1.4
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/adapters/amplitude/index.cjs +13 -13
- package/dist/adapters/amplitude/index.d.cts +5 -3
- package/dist/adapters/amplitude/index.d.ts +5 -3
- package/dist/adapters/amplitude/index.js +10 -10
- package/dist/api-B2euFL-5.cjs +269 -0
- package/dist/api-XRr_lAG6.js +190 -0
- package/dist/application/config/index.cjs +14 -5
- package/dist/application/config/index.d.cts +2 -1
- package/dist/application/config/index.d.ts +2 -1
- package/dist/application/config/index.js +14 -5
- package/dist/application/models/graphql/index.cjs +12 -12
- package/dist/application/models/graphql/index.d.cts +1 -1
- package/dist/application/models/graphql/index.d.ts +1 -1
- package/dist/application/models/graphql/index.js +10 -10
- package/dist/application/models/guards/api/index.cjs +2 -2
- package/dist/application/models/guards/api/index.d.cts +2 -2
- package/dist/application/models/guards/api/index.d.ts +2 -2
- package/dist/application/models/guards/api/index.js +2 -2
- package/dist/application/models/index.cjs +54 -54
- package/dist/application/models/index.d.cts +8 -9
- package/dist/application/models/index.d.ts +8 -9
- package/dist/application/models/index.js +10 -10
- package/dist/application/models/utilityTypes/index.cjs +1 -1
- package/dist/application/models/utilityTypes/index.d.cts +1 -1
- package/dist/application/models/utilityTypes/index.d.ts +1 -1
- package/dist/application/models/utilityTypes/index.js +1 -1
- package/dist/application/models/variantInfo/index.cjs +1 -1
- package/dist/application/models/variantInfo/index.d.cts +1 -1
- package/dist/application/models/variantInfo/index.d.ts +1 -1
- package/dist/application/models/variantInfo/index.js +1 -1
- package/dist/application/service/customerService/index.cjs +2 -2
- package/dist/application/service/customerService/index.d.cts +2 -2
- package/dist/application/service/customerService/index.d.ts +2 -2
- package/dist/application/service/customerService/index.js +2 -2
- package/dist/application/service/index.cjs +37 -757
- package/dist/application/service/index.d.cts +14 -22
- package/dist/application/service/index.d.ts +14 -22
- package/dist/application/service/index.js +12 -727
- package/dist/application/utils/index.cjs +37 -37
- package/dist/application/utils/index.d.cts +13 -13
- package/dist/application/utils/index.d.ts +12 -12
- package/dist/application/utils/index.js +10 -10
- package/dist/atomStore-B1cgmbP0.js +32 -0
- package/dist/atomStore-JwGb7pcy.cjs +58 -0
- package/dist/atoms/app/index.cjs +16 -16
- package/dist/atoms/app/index.d.cts +11 -11
- package/dist/atoms/app/index.d.ts +12 -12
- package/dist/atoms/app/index.js +10 -10
- package/dist/atoms/atomStore/index.cjs +1 -2
- package/dist/atoms/atomStore/index.d.cts +2 -1
- package/dist/atoms/atomStore/index.d.ts +2 -1
- package/dist/atoms/atomStore/index.js +1 -2
- package/dist/atoms/chat/index.cjs +40 -40
- package/dist/atoms/chat/index.d.cts +37 -37
- package/dist/atoms/chat/index.d.ts +38 -38
- package/dist/atoms/chat/index.js +10 -10
- package/dist/atoms/globalSearch/index.cjs +1 -1
- package/dist/atoms/globalSearch/index.d.cts +7 -6
- package/dist/atoms/globalSearch/index.d.ts +7 -6
- package/dist/atoms/globalSearch/index.js +1 -1
- package/dist/atoms/org/index.cjs +37 -40
- package/dist/atoms/org/index.d.cts +32 -53
- package/dist/atoms/org/index.d.ts +31 -52
- package/dist/atoms/org/index.js +11 -12
- package/dist/atoms/search/index.cjs +41 -43
- package/dist/atoms/search/index.d.cts +9 -10
- package/dist/atoms/search/index.d.ts +9 -10
- package/dist/atoms/search/index.js +10 -12
- package/dist/bandolier-B76-OE75.cjs +1230 -0
- package/dist/bandolier-DRn_x1g1.js +1230 -0
- package/dist/carpe-kHi4RLB5.cjs +608 -0
- package/dist/carpe-qrSU99gq.js +606 -0
- package/dist/{chat-CCgyDehy.cjs → chat-BgONoYU7.cjs} +2 -1
- package/dist/chat-CLJ4NWcN.js +26 -0
- package/dist/{components-CScS7Ii-.cjs → components-BKZbet67.cjs} +2 -1
- package/dist/components-CV1fhAkj.js +11 -0
- package/dist/config/locators/components/chat/index.cjs +1 -1
- package/dist/config/locators/components/chat/index.d.cts +1 -1
- package/dist/config/locators/components/chat/index.d.ts +1 -1
- package/dist/config/locators/components/chat/index.js +1 -1
- package/dist/config/locators/components/chat/variants/index.cjs +2 -1
- package/dist/config/locators/components/chat/variants/index.d.cts +2 -1
- package/dist/config/locators/components/chat/variants/index.d.ts +2 -1
- package/dist/config/locators/components/chat/variants/index.js +2 -1
- package/dist/config/locators/components/index.cjs +1 -1
- package/dist/config/locators/components/index.d.cts +1 -1
- package/dist/config/locators/components/index.d.ts +1 -1
- package/dist/config/locators/components/index.js +1 -1
- package/dist/config/locators/components/search/index.cjs +2 -1
- package/dist/config/locators/components/search/index.d.cts +2 -1
- package/dist/config/locators/components/search/index.d.ts +2 -1
- package/dist/config/locators/components/search/index.js +2 -1
- package/dist/config/locators/index.cjs +4 -4
- package/dist/config/locators/index.d.cts +4 -3
- package/dist/config/locators/index.d.ts +4 -3
- package/dist/config/locators/index.js +4 -4
- package/dist/contexts/index.cjs +20 -23
- package/dist/contexts/index.d.cts +38 -19
- package/dist/contexts/index.d.ts +41 -22
- package/dist/contexts/index.js +11 -17
- package/dist/contexts-CQDwe3rK.cjs +14333 -0
- package/dist/contexts-e2sM-B9g.js +12919 -0
- package/dist/coterie-mMirPcHP.js +240 -0
- package/dist/coterie-yQ-_JXSw.cjs +240 -0
- package/dist/customerService-BG1uNZZ1.cjs +36 -0
- package/dist/customerService-BHQRnLhC.js +23 -0
- package/dist/custservice-types-C83itZmy.cjs +35 -0
- package/dist/custservice-types-DPQ-4TI6.js +23 -0
- package/dist/default-8Jfv8ehQ.cjs +199 -0
- package/dist/default-C8PQf-38.js +176 -0
- package/dist/default-LukSiCz1.js +4 -0
- package/dist/default-rJSJ887P.cjs +4 -0
- package/dist/divIds-CWkntTsx.js +23 -0
- package/dist/{divIds-CFyAjjp3.cjs → divIds-DEL_-qU0.cjs} +2 -1
- package/dist/dreamlandBaby-DHltv12Z.cjs +347 -0
- package/dist/dreamlandBaby-cG0HM9bt.js +347 -0
- package/dist/{embedded-BlXJUbik.cjs → embedded--2L0F4b5.cjs} +2 -1
- package/dist/embedded-C5uJqmuD.js +23 -0
- package/dist/entrypoints-CNUvSgnk.js +7 -0
- package/dist/entrypoints-DM9Sm18O.cjs +19 -0
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.cts +2 -1
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.js +1 -1
- package/dist/events-ClCDFK7t.js +78 -0
- package/dist/events-Da7gpmGv.cjs +90 -0
- package/dist/featureFlagService-5wdmW02z.d.ts +18 -0
- package/dist/featureFlagService-DaelrXEk.d.cts +18 -0
- package/dist/fiveCbd-Cvnwh03g.cjs +614 -0
- package/dist/fiveCbd-DhYMlsf9.js +614 -0
- package/dist/forLoveAndLemons-C8DuUexW.js +666 -0
- package/dist/forLoveAndLemons-DR6a1zjJ.cjs +668 -0
- package/dist/{globalSearch-hxbXekus.cjs → globalSearch-BTeZxvk1.cjs} +2 -1
- package/dist/globalSearch-b0wC7ZEO.js +14 -0
- package/dist/greenpan-B4Pu65kV.js +398 -0
- package/dist/greenpan-BL5p6j7f.cjs +398 -0
- package/dist/grooveLife-DjKWHoN3.cjs +343 -0
- package/dist/grooveLife-JK0TyaPz.js +343 -0
- package/dist/homegrownCannabis-DxqSDkmS.js +411 -0
- package/dist/homegrownCannabis-ZnfCqW-m.cjs +411 -0
- package/dist/hooks/index.cjs +38 -38
- package/dist/hooks/index.d.cts +25 -16
- package/dist/hooks/index.d.ts +30 -21
- package/dist/hooks/index.js +11 -17
- package/dist/index-BTK5uzs6.d.cts +98 -0
- package/dist/index-BfuO9b0Q.d.ts +749 -0
- package/dist/index-BzgkfbNO.d.cts +228 -0
- package/dist/index-C62lPpy4.d.cts +25 -0
- package/dist/index-CExtydIH.d.ts +9 -0
- package/dist/index-CKKkTsms.d.ts +39 -0
- package/dist/index-CNsGWfS6.d.cts +749 -0
- package/dist/index-CYtsPztZ.d.cts +203 -0
- package/dist/index-C_C0tLeD.d.ts +203 -0
- package/dist/index-ClJ0nMsR.d.cts +184 -0
- package/dist/index-Cx9e-fRi.d.ts +184 -0
- package/dist/index-D2VaMPA3.d.ts +98 -0
- package/dist/index-D46Rd0io.d.cts +39 -0
- package/dist/index-DFL1dIT_.d.ts +7 -0
- package/dist/index-DPx8s5YH.d.ts +25 -0
- package/dist/index-Dxpscrvz.d.ts +228 -0
- package/dist/index-MFbPQ8Ji.d.ts +95 -0
- package/dist/index-VSFakgAI.d.cts +95 -0
- package/dist/index-jBATkcc_.d.cts +9 -0
- package/dist/index-zZjcds15.d.cts +7 -0
- package/dist/interceptors/index.cjs +12 -13
- package/dist/interceptors/index.d.cts +10 -10
- package/dist/interceptors/index.d.ts +10 -10
- package/dist/interceptors/index.js +10 -11
- package/dist/jackArcher-CXf_IAmC.js +728 -0
- package/dist/jackArcher-mGkojXek.cjs +728 -0
- package/dist/jordanCraig-BvCvPRoR.js +1787 -0
- package/dist/jordanCraig-Dv8pVCiS.cjs +1787 -0
- package/dist/kindredBravely-UQP7wiNu.cjs +491 -0
- package/dist/kindredBravely-X8F_LNph.js +491 -0
- package/dist/kutFromTheKloth-BhYKk3CN.cjs +370 -0
- package/dist/kutFromTheKloth-D1xsTSJr.js +370 -0
- package/dist/larryAndSerges-1411NuZa.cjs +262 -0
- package/dist/larryAndSerges-DVIRLItu.js +262 -0
- package/dist/leapsAndRebounds-BJ8mwr33.js +361 -0
- package/dist/leapsAndRebounds-UcP9EJVO.cjs +361 -0
- package/dist/logger-Dln20ans.cjs +26 -0
- package/dist/logger-pdEEY8T2.js +20 -0
- package/dist/longevityrx-BFSv9GF5.cjs +321 -0
- package/dist/longevityrx-Cp6wleWr.js +321 -0
- package/dist/lookOptic-BGhU4910.js +283 -0
- package/dist/lookOptic-KieSqskd.cjs +283 -0
- package/dist/mantraBrand-CHQw-0nw.cjs +751 -0
- package/dist/mantraBrand-DrqG9uqO.js +751 -0
- package/dist/medterra-CLG6Co1C.cjs +584 -0
- package/dist/medterra-D8ZX9NZC.js +584 -0
- package/dist/modells-BzyPwN2m.cjs +485 -0
- package/dist/modells-CAfqOCW4.js +485 -0
- package/dist/nodeSelector-B3bPtEjX.d.cts +31 -0
- package/dist/nodeSelector-BiCDowlK.d.ts +31 -0
- package/dist/orgConfigResults--dAwtw3W.d.ts +881 -0
- package/dist/orgConfigResults-BL0XBA6x.d.cts +881 -0
- package/dist/pressedFloral-DULBuQwR.cjs +662 -0
- package/dist/pressedFloral-Dp-7Fk3S.js +662 -0
- package/dist/search-filter-types-BNTLVXqQ.d.cts +102 -0
- package/dist/search-filter-types-DkmH1TxJ.d.ts +102 -0
- package/dist/skinPerfection-BxuYCeJX.js +335 -0
- package/dist/skinPerfection-Cd3XZ6By.cjs +335 -0
- package/dist/snapSupplements-Bf6htPM0.js +286 -0
- package/dist/snapSupplements-ZFnXyMuZ.cjs +286 -0
- package/dist/socialProofClasses-DdzG1tZy.js +10 -0
- package/dist/socialProofClasses-ky69yppk.cjs +40 -0
- package/dist/spanx-CwDPQaGj.js +662 -0
- package/dist/spanx-Cyd4qDlK.cjs +664 -0
- package/dist/spanxStaging-D43nyAGy.js +846 -0
- package/dist/spanxStaging-ijbYnHzr.cjs +849 -0
- package/dist/suggestionBarV2-types-CwOXzIKq.js +10 -0
- package/dist/{suggestionBarV2-types-DG3Ekk44.cjs → suggestionBarV2-types-Dc4-zJlV.cjs} +2 -1
- package/dist/supergoop-BnbFG7hm.cjs +338 -0
- package/dist/supergoop-CY043wIg.js +336 -0
- package/dist/test-types-CXVJxTeu.d.ts +40 -0
- package/dist/test-types-CuOq25VT.d.cts +40 -0
- package/dist/types/index.cjs +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -2
- package/dist/types-BF_CJeck.js +177 -0
- package/dist/types-CD4LFta-.d.cts +33 -0
- package/dist/types-CNH4sfF-.cjs +231 -0
- package/dist/types-DBdI0j89.d.ts +33 -0
- package/dist/uniqueVintage-Cui74mlJ.js +1212 -0
- package/dist/uniqueVintage-R2Jcu1y1.cjs +1214 -0
- package/dist/variant-CKVRF2-W.d.ts +13 -0
- package/dist/variant-raYuOP4L.d.cts +13 -0
- package/dist/venaCbd-o5_vOp4e.js +366 -0
- package/dist/venaCbd-r-IxEVc1.cjs +366 -0
- package/dist/westonJonBoucher-C95EuCl-.js +423 -0
- package/dist/westonJonBoucher-DjGEW3ZB.cjs +423 -0
- package/dist/wineEnthusiast-DeTFY8Gm.js +941 -0
- package/dist/wineEnthusiast-DvfcV5B3.cjs +941 -0
- package/dist/wolfMattress-6xPfOJt3.js +373 -0
- package/dist/wolfMattress-BjGnGKjP.cjs +373 -0
- package/dist/wolfTactical-Bi3WZu0m.cjs +350 -0
- package/dist/wolfTactical-C_F9-oPX.js +350 -0
- package/package.json +1 -1
- package/src/adapters/amplitude/amplitudeAdapter.ts +32 -9
- package/src/adapters/spiffy/commerce/api.ts +17 -8
- package/src/adapters/spiffy/commerce/graphql.ts +16 -5
- package/src/application/config/generalStaticConfig.ts +5 -2
- package/src/application/models/api/orgConfigResults.ts +6 -2
- package/src/application/models/validators/validateGraphQLColorsConfig.ts +23 -21
- package/src/application/service/cdnService.ts +4 -2
- package/src/application/service/index.ts +0 -1
- package/src/application/service/pageVariantService.ts +5 -5
- package/src/application/service/searchService.ts +9 -2
- package/src/application/service/windowChatToggleService.ts +28 -19
- package/src/application/service/windowFrontendConfigService.ts +7 -4
- package/src/atoms/app/index.ts +26 -17
- package/src/atoms/app/variant.ts +1 -0
- package/src/atoms/chat/messageQueue.ts +1 -1
- package/src/atoms/envive/enviveConfig.ts +81 -0
- package/src/atoms/org/graphqlConfig.ts +29 -11
- package/src/atoms/org/merchantCss.ts +114 -0
- package/src/atoms/org/org.ts +101 -64
- package/src/atoms/org/orgPageConfig.ts +9 -6
- package/src/atoms/org/orgUIConfig.ts +22 -9
- package/src/atoms/search/chatSearch.ts +85 -67
- package/src/contexts/chatContext.tsx +4 -1
- package/src/contexts/enviveConfigContext.tsx +37 -26
- package/src/contexts/enviveCssContext.tsx +20 -0
- package/src/contexts/index.ts +2 -0
- package/src/contexts/orgConfigContext.tsx +106 -0
- package/src/contexts/systemSettingsContext.tsx +2 -2
- package/src/contexts/types.ts +12 -9
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useSearch.tsx +10 -6
- package/src/hooks/utils.ts +1 -1
- package/src/interceptors/useFormEscalation.ts +26 -9
- package/src/types.ts +0 -2
- package/dist/api-BtzLHcfU.cjs +0 -268
- package/dist/api-kpPTZhV9.js +0 -189
- package/dist/atomStore-BNQyGmU_.cjs +0 -57
- package/dist/atomStore-TnLPtYns.js +0 -31
- package/dist/bandolier-CQrxBHsk.cjs +0 -1230
- package/dist/bandolier-Di9DpZ8e.js +0 -1230
- package/dist/carpe-3NJOR-Rj.cjs +0 -608
- package/dist/carpe-DmWKaIQq.js +0 -606
- package/dist/cdnService-BNreZjqy.js +0 -18
- package/dist/cdnService-vLxePdrU.cjs +0 -23
- package/dist/chat-CCQMmhc1.cjs +0 -5057
- package/dist/chat-Dk6KPb1K.js +0 -25
- package/dist/chat-H6YcCS4I.js +0 -4113
- package/dist/components-DAQxVIn9.js +0 -10
- package/dist/coterie-D0UFsFC5.cjs +0 -240
- package/dist/coterie-JblRmIZL.js +0 -240
- package/dist/customerService-C4wc0glQ.js +0 -22
- package/dist/customerService-zsDlp7g2.cjs +0 -35
- package/dist/custservice-types-D8Npo-5Z.js +0 -22
- package/dist/custservice-types-E9_OSaZ7.cjs +0 -34
- package/dist/default-C5ZTV8HA.cjs +0 -4
- package/dist/default-DPv8m-eQ.js +0 -175
- package/dist/default-DRKBosow.cjs +0 -198
- package/dist/default-ao0vRl0W.js +0 -4
- package/dist/divIds-BWvq-i6I.js +0 -22
- package/dist/dreamlandBaby-CyS8oW8X.js +0 -347
- package/dist/dreamlandBaby-y7kSvwH2.cjs +0 -347
- package/dist/embedded-C1jvFj3v.js +0 -22
- package/dist/entrypoints-CmmOszXO.js +0 -6
- package/dist/entrypoints-fowCLUT2.cjs +0 -18
- package/dist/enviveConfigContext-Bs8kepnO.cjs +0 -48
- package/dist/enviveConfigContext-CWVdVWKW.js +0 -34
- package/dist/events-DgFzlVJR.js +0 -77
- package/dist/events-bH-24eRW.cjs +0 -89
- package/dist/featureFlagService-CroFRxvD.d.cts +0 -17
- package/dist/featureFlagService-NkJ2fuEj.d.ts +0 -17
- package/dist/featureGates-BMWXU0dS.d.ts +0 -90
- package/dist/featureGates-N_gyHCTn.d.cts +0 -90
- package/dist/fiveCbd-CXVuIBiZ.cjs +0 -614
- package/dist/fiveCbd-Cyc3-Ab9.js +0 -614
- package/dist/forLoveAndLemons-CxQS0USq.cjs +0 -668
- package/dist/forLoveAndLemons-D8mcgmdk.js +0 -666
- package/dist/frontendConfig-KeNqU1wa.d.cts +0 -790
- package/dist/frontendConfig-cPvCTWm6.d.ts +0 -790
- package/dist/globalSearch-BC0rOX3E.js +0 -13
- package/dist/greenpan-JM6SHcqO.js +0 -398
- package/dist/greenpan-eIzyxVsn.cjs +0 -398
- package/dist/grooveLife-BmsUc2cD.js +0 -343
- package/dist/grooveLife-KdTizVUn.cjs +0 -343
- package/dist/homegrownCannabis-C0GDai4r.cjs +0 -411
- package/dist/homegrownCannabis-a9udocBT.js +0 -411
- package/dist/hooks-DjOa7ihH.cjs +0 -7331
- package/dist/hooks-fneW8SWw.js +0 -7152
- package/dist/index-BQErGgfM.d.cts +0 -202
- package/dist/index-BdNKc2ix.d.cts +0 -8
- package/dist/index-BrXuc_Ck.d.cts +0 -24
- package/dist/index-C4zjAR1c.d.cts +0 -227
- package/dist/index-CGB6CAmr.d.ts +0 -6
- package/dist/index-CIco0cCQ.d.ts +0 -183
- package/dist/index-COG1kOZG.d.ts +0 -749
- package/dist/index-CVxe7FpL.d.cts +0 -6
- package/dist/index-Cn1SeI5y.d.cts +0 -183
- package/dist/index-CnqHN_jz.d.ts +0 -202
- package/dist/index-Cqg6ltII.d.ts +0 -38
- package/dist/index-DE_7Q8qK.d.ts +0 -94
- package/dist/index-Da0UzyI9.d.ts +0 -24
- package/dist/index-DbWWcYax.d.cts +0 -749
- package/dist/index-DtoVXd6O.d.cts +0 -97
- package/dist/index-JClBRnSX.d.cts +0 -94
- package/dist/index-ghzD_356.d.ts +0 -8
- package/dist/index-hdbCEjYy.d.cts +0 -38
- package/dist/index-luJrHgPN.d.ts +0 -97
- package/dist/index-tfRj22E1.d.ts +0 -227
- package/dist/jackArcher-B6OJ0N3a.cjs +0 -728
- package/dist/jackArcher-B9fe4Hv8.js +0 -728
- package/dist/jordanCraig-0CB_m_ts.cjs +0 -1787
- package/dist/jordanCraig-DNm1iw1L.js +0 -1787
- package/dist/kindredBravely-CZgt7DJA.js +0 -491
- package/dist/kindredBravely-KvYPbckZ.cjs +0 -491
- package/dist/kutFromTheKloth-BxgtWZs9.cjs +0 -370
- package/dist/kutFromTheKloth-SmteSZjk.js +0 -370
- package/dist/larryAndSerges-6O_u3L90.cjs +0 -261
- package/dist/larryAndSerges-DO-zG8ES.js +0 -261
- package/dist/leapsAndRebounds-BK62AmXw.js +0 -361
- package/dist/leapsAndRebounds-gPsWVUmQ.cjs +0 -361
- package/dist/logger-Be0NyKaY.cjs +0 -25
- package/dist/logger-BexDfK3W.js +0 -19
- package/dist/longevityrx-DjKbwJo3.cjs +0 -321
- package/dist/longevityrx-eq5TeUcy.js +0 -321
- package/dist/lookOptic-BPPqms_j.cjs +0 -283
- package/dist/lookOptic-jRpBXQCN.js +0 -283
- package/dist/mantraBrand-BZOZfkUK.js +0 -751
- package/dist/mantraBrand-Cp8zptkj.cjs +0 -751
- package/dist/medterra-BHYCBgvQ.cjs +0 -584
- package/dist/medterra-CShe6CLY.js +0 -584
- package/dist/modells-DE7-gmjK.cjs +0 -485
- package/dist/modells-DFyJxNwT.js +0 -485
- package/dist/nodeSelector-DpKXszfU.d.ts +0 -30
- package/dist/nodeSelector-vKB44CDB.d.cts +0 -30
- package/dist/org-Bkn6fl6I.cjs +0 -106
- package/dist/org-CX8HFbc9.js +0 -63
- package/dist/pressedFloral-BMkCVs8c.cjs +0 -662
- package/dist/pressedFloral-aK9br-LF.js +0 -662
- package/dist/search-DtIFZeMA.cjs +0 -743
- package/dist/search-eWwg8pNn.js +0 -542
- package/dist/search-filter-types-ByJnFPc4.d.cts +0 -101
- package/dist/search-filter-types-DPgeG8FS.d.ts +0 -101
- package/dist/skinPerfection-B9G6yLM2.js +0 -335
- package/dist/skinPerfection-BBC1q65Z.cjs +0 -335
- package/dist/snapSupplements-D7hx6Kgj.cjs +0 -286
- package/dist/snapSupplements-DKvJl__T.js +0 -286
- package/dist/socialProofClasses-BYLiEXpU.cjs +0 -39
- package/dist/socialProofClasses-CkJufEGb.js +0 -9
- package/dist/spanx-D-ZKkxjM.cjs +0 -664
- package/dist/spanx-yl7YfVrf.js +0 -662
- package/dist/spanxStaging-CXeIg6zI.cjs +0 -849
- package/dist/spanxStaging-DzGXL9wD.js +0 -846
- package/dist/suggestionBarV2-types-B0RbMStE.js +0 -9
- package/dist/supergoop-CSpDPOpl.cjs +0 -337
- package/dist/supergoop-D0UkuRiA.js +0 -335
- package/dist/test-types-C9b_OdfO.d.ts +0 -39
- package/dist/test-types-CpKCxk8U.d.cts +0 -39
- package/dist/types-BE4faOO_.d.cts +0 -32
- package/dist/types-C3S1H4hl.js +0 -176
- package/dist/types-TD8g7LnH.d.ts +0 -32
- package/dist/types-lcjuhDBt.cjs +0 -230
- package/dist/uniqueVintage-DygVpCqU.cjs +0 -1214
- package/dist/uniqueVintage-_n0FZFVj.js +0 -1212
- package/dist/useMessageInterceptor-BP6gzo8a.js +0 -57
- package/dist/useMessageInterceptor-BnUG2Pzt.cjs +0 -72
- package/dist/variant-DH4zusMi.d.cts +0 -12
- package/dist/variant-DTEqSBHd.d.ts +0 -12
- package/dist/variantInfo-BTvC6CQh.js +0 -1
- package/dist/variantInfo-Cz2YXraO.cjs +0 -0
- package/dist/venaCbd-BS0dvdBm.js +0 -366
- package/dist/venaCbd-Pqg0bj-P.cjs +0 -366
- package/dist/westonJonBoucher-CLw8Hy6u.js +0 -423
- package/dist/westonJonBoucher-CeA0jwxe.cjs +0 -423
- package/dist/wineEnthusiast-M9P18d1w.js +0 -941
- package/dist/wineEnthusiast-gHBaQMbe.cjs +0 -941
- package/dist/wolfMattress-BQHjoQYu.js +0 -373
- package/dist/wolfMattress-CdmN-Evm.cjs +0 -373
- package/dist/wolfTactical-Cc2ZLBRh.js +0 -350
- package/dist/wolfTactical-dObnPgAG.cjs +0 -350
- package/src/application/service/environmentService.ts +0 -51
- package/src/extension.ts +0 -63
- package/src/initialize.ts +0 -163
- package/src/main.tsx +0 -108
- package/src/merchants/uniqueVintage/views/useUniqueVintageChatSearch.ts +0 -147
- /package/dist/{atomStore-FSZd_20F.js → locators-Dc5ZT0aF.js} +0 -0
- /package/dist/{atomStore-B3tsg6mF.cjs → locators-lQMJj830.cjs} +0 -0
- /package/dist/{locators-C2DX_nX6.js → utilityTypes-BVikejDo.js} +0 -0
- /package/dist/{locators-CUpyd9Wt.cjs → utilityTypes-C4h2wgAK.cjs} +0 -0
- /package/dist/{utilityTypes-DMdsI0DG.cjs → variantInfo-CNRTY0gH.cjs} +0 -0
- /package/dist/{utilityTypes-UWdNHElu.js → variantInfo-CzhR5W6h.js} +0 -0
|
@@ -1,761 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
require('../../
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
require('../../
|
|
8
|
-
|
|
9
|
-
require('../../
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const require_org = require('../../org-Bkn6fl6I.cjs');
|
|
14
|
-
require('../../search-DtIFZeMA.cjs');
|
|
15
|
-
require('../../globalSearch-hxbXekus.cjs');
|
|
16
|
-
require('../../useMessageInterceptor-BnUG2Pzt.cjs');
|
|
17
|
-
require('../../atomStore-B3tsg6mF.cjs');
|
|
18
|
-
const require_cdnService = require('../../cdnService-vLxePdrU.cjs');
|
|
19
|
-
let react = require("react");
|
|
20
|
-
react = require_chunk.__toESM(react);
|
|
21
|
-
let jotai = require("jotai");
|
|
22
|
-
jotai = require_chunk.__toESM(jotai);
|
|
23
|
-
let uuid = require("uuid");
|
|
24
|
-
uuid = require_chunk.__toESM(uuid);
|
|
25
|
-
|
|
26
|
-
//#region src/application/service/cachingService.ts
|
|
27
|
-
const CACHE_VERSION = 1.2;
|
|
28
|
-
function cacheableAsync(func, expiry) {
|
|
29
|
-
return async function(...args) {
|
|
30
|
-
const cacheKey = `spiffy:${CACHE_VERSION}:${JSON.stringify(args)}`;
|
|
31
|
-
const cachedValueString = localStorage.getItem(cacheKey);
|
|
32
|
-
if (cachedValueString !== null) {
|
|
33
|
-
const cachedValue = JSON.parse(cachedValueString);
|
|
34
|
-
if (cachedValue.expiry > Date.now() && cachedValue.value !== null) return cachedValue.value;
|
|
35
|
-
}
|
|
36
|
-
return func(...args).then((result) => {
|
|
37
|
-
if (result) {
|
|
38
|
-
const cachedValue = {
|
|
39
|
-
value: result,
|
|
40
|
-
expiry: Date.now() + expiry
|
|
41
|
-
};
|
|
42
|
-
localStorage.setItem(cacheKey, JSON.stringify(cachedValue));
|
|
43
|
-
}
|
|
44
|
-
return result;
|
|
45
|
-
}).catch((error) => {
|
|
46
|
-
require_logger.logger_default.logError(`[cache-error] Error invoking cacheable underlying func`, error);
|
|
47
|
-
throw error;
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function cacheable(func, expiry) {
|
|
52
|
-
return function(...args) {
|
|
53
|
-
const cacheKey = `spiffy:${CACHE_VERSION}:${JSON.stringify(args)}`;
|
|
54
|
-
const cachedValueString = localStorage.getItem(cacheKey);
|
|
55
|
-
if (cachedValueString !== null) {
|
|
56
|
-
const cachedValue = JSON.parse(cachedValueString);
|
|
57
|
-
if (cachedValue.expiry > Date.now() && cachedValue.value !== null) {
|
|
58
|
-
require_logger.logger_default.logDebug(`[cache-hit] Returning cached value for ${cacheKey}`, cachedValue.value);
|
|
59
|
-
return cachedValue.value;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const result = func(...args);
|
|
63
|
-
if (result) {
|
|
64
|
-
const cachedValue = {
|
|
65
|
-
value: result,
|
|
66
|
-
expiry: Date.now() + expiry
|
|
67
|
-
};
|
|
68
|
-
localStorage.setItem(cacheKey, JSON.stringify(cachedValue));
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/application/service/domMutations/domMutationListenerState.ts
|
|
76
|
-
var DomMutationListenerState = class {
|
|
77
|
-
constructor(listener) {
|
|
78
|
-
this.listener = listener;
|
|
79
|
-
this.currentState = require_chat.DomMutationObserverContinuation.CONTINUE;
|
|
80
|
-
this.attached = false;
|
|
81
|
-
this.currentTryCount = 0;
|
|
82
|
-
}
|
|
83
|
-
getListener() {
|
|
84
|
-
return this.listener;
|
|
85
|
-
}
|
|
86
|
-
setCurrentState(state) {
|
|
87
|
-
this.currentState = state;
|
|
88
|
-
}
|
|
89
|
-
getCurrentState() {
|
|
90
|
-
return this.currentState;
|
|
91
|
-
}
|
|
92
|
-
getIsAttached() {
|
|
93
|
-
return this.attached;
|
|
94
|
-
}
|
|
95
|
-
setIsAttached(attached) {
|
|
96
|
-
this.attached = attached;
|
|
97
|
-
}
|
|
98
|
-
getCurrentTryCount() {
|
|
99
|
-
return this.currentTryCount;
|
|
100
|
-
}
|
|
101
|
-
incrementCurrentTryCount() {
|
|
102
|
-
this.currentTryCount++;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/application/service/domMutationObserver.ts
|
|
108
|
-
/**
|
|
109
|
-
* - When used before page load/render, an unoptimized MutationObserver callback can significantly delay page load time,
|
|
110
|
-
* especially on complex pages.
|
|
111
|
-
* - The callback runs as a microtask and can block further DOM processing, often firing hundreds or even thousands of times
|
|
112
|
-
* per second on a complex page. Many libraries don't optimize for this, resulting in clean-looking but potentially slow code.
|
|
113
|
-
*
|
|
114
|
-
* Best Practices for MutationObserver Optimization:
|
|
115
|
-
* - **Profiling:** Use DevTools Profiler to ensure the observer callback uses less than 0.1% of total CPU during page load.
|
|
116
|
-
* - **Avoid Forced Layouts:** Refrain from triggering synchronous layouts by accessing properties like `offsetTop`.
|
|
117
|
-
* - **Prefer Native DOM:** Use native DOM methods instead of complex frameworks like jQuery to reduce overhead.
|
|
118
|
-
* - **Use `attributeFilter`:** When observing attributes, limit the observations to specific attributes, e.g., `attributeFilter: ['attr1', 'attr2']`.
|
|
119
|
-
* - **Non-recursive Observations:** Observe direct parent elements with `subtree: false` whenever possible. For instance, initially observe `document` recursively, disconnect on success, and reattach a non-recursive observer to the parent element.
|
|
120
|
-
* - **Direct Element Access:** When waiting for a single element with an `id`, use `getElementById` instead of looping over the `mutations` array.
|
|
121
|
-
* - **HTMLCollection Checks:** For rare elements (e.g., `<iframe>` or `<object>`), use live HTMLCollections from `getElementsByTagName` or `getElementsByClassName` rather than enumerating mutations, especially with large numbers of mutations.
|
|
122
|
-
* - **Avoid `querySelectorAll`:** Use `querySelector` first for an initial check; if successful, proceed with `querySelectorAll` only when absolutely necessary. This combo is often faster on average.
|
|
123
|
-
* - **Legacy Browser Compatibility:**
|
|
124
|
-
* - Avoid `Array` methods like `forEach`, `filter`, etc., and ES2015 loops (`for...of`) in pre-2018 Chrome for MutationObserver callbacks,
|
|
125
|
-
* as these can be up to 100x slower than traditional `for` loops.
|
|
126
|
-
* - Alternatively, use a fast functional library like lodash on older browsers. Chrome 2018+ inlines array methods efficiently.
|
|
127
|
-
* - **Scheduled Re-checking:** For visual updates, if you can determine elements are offscreen, disconnect the observer and use `setTimeout(fn, 0)` to delay processing until initial parsing/layout is complete. After that, use `requestAnimationFrame` for chunked processing.
|
|
128
|
-
* - **Debounce Long Processing:** If the callback processing is lengthy, causing unresponsiveness or jank, use debouncing by accumulating mutations in an array and scheduling processing with `setTimeout`, `requestIdleCallback`, or `requestAnimationFrame`.
|
|
129
|
-
*
|
|
130
|
-
* Example of Debounce Setup:
|
|
131
|
-
* ```typescript
|
|
132
|
-
* const queue: MutationRecord[] = [];
|
|
133
|
-
* const mo = new MutationObserver(mutations => {
|
|
134
|
-
* if (!queue.length) requestAnimationFrame(process);
|
|
135
|
-
* queue.push(...mutations);
|
|
136
|
-
* });
|
|
137
|
-
* function process() {
|
|
138
|
-
* for (const mutations of queue) {
|
|
139
|
-
* // Processing logic
|
|
140
|
-
* }
|
|
141
|
-
* queue.length = 0;
|
|
142
|
-
* }
|
|
143
|
-
* ```
|
|
144
|
-
* Note: `requestAnimationFrame` only triggers when the page is visible.
|
|
145
|
-
*/
|
|
146
|
-
var DomMutationObserver = class DomMutationObserver {
|
|
147
|
-
static {
|
|
148
|
-
this.observerVersion = "v1.24";
|
|
149
|
-
}
|
|
150
|
-
static {
|
|
151
|
-
this.individualObservers = false;
|
|
152
|
-
}
|
|
153
|
-
static {
|
|
154
|
-
this.deferredExecutionDelay = 500;
|
|
155
|
-
}
|
|
156
|
-
static {
|
|
157
|
-
this.startingPollingInterval = 250;
|
|
158
|
-
}
|
|
159
|
-
static {
|
|
160
|
-
this.endingPollingInterval = 2e3;
|
|
161
|
-
}
|
|
162
|
-
static {
|
|
163
|
-
this.useDebounce = true;
|
|
164
|
-
}
|
|
165
|
-
static {
|
|
166
|
-
this.listeners = [];
|
|
167
|
-
}
|
|
168
|
-
static {
|
|
169
|
-
this.mutationsQueuePerListener = /* @__PURE__ */ new Map();
|
|
170
|
-
}
|
|
171
|
-
static {
|
|
172
|
-
this.mutationsQueue = [];
|
|
173
|
-
}
|
|
174
|
-
static {
|
|
175
|
-
this.observationStrategy = require_chat.DomObservationStrategy.None;
|
|
176
|
-
}
|
|
177
|
-
static addDomMutationListener(listener) {
|
|
178
|
-
const existingListener = this.listeners.find((l) => l.getListener().getName() === listener.getName());
|
|
179
|
-
if (existingListener) {
|
|
180
|
-
require_logger.logger_default.logDebug(`DomMutationObserver::addDomMutationListener removing existing listener ${existingListener.getListener().getName()}`);
|
|
181
|
-
this.disconnect(existingListener.getListener());
|
|
182
|
-
this.listeners = this.listeners.filter((l) => l.getListener().getName() !== listener.getName());
|
|
183
|
-
}
|
|
184
|
-
const listenerState = new DomMutationListenerState(listener);
|
|
185
|
-
this.listeners.push(listenerState);
|
|
186
|
-
}
|
|
187
|
-
static invokeListener(l) {
|
|
188
|
-
if (l.getCurrentState() === require_chat.DomMutationObserverContinuation.STOP) return;
|
|
189
|
-
const previousState = l.getCurrentState();
|
|
190
|
-
try {
|
|
191
|
-
const continuation = l.getListener().onDomChange();
|
|
192
|
-
l.setCurrentState(continuation);
|
|
193
|
-
l.incrementCurrentTryCount();
|
|
194
|
-
if (l.getListener().triesMax() > 0 && l.getCurrentTryCount() >= l.getListener().triesMax()) {
|
|
195
|
-
l.setCurrentState(require_chat.DomMutationObserverContinuation.STOP);
|
|
196
|
-
require_logger.logger_default.logDebug(`DomMutationObserver invokeListener ${l.getListener().getName()} tries exceeded! max: ${l.getListener().triesMax()} current: ${l.getCurrentTryCount()}`);
|
|
197
|
-
}
|
|
198
|
-
} catch (e) {
|
|
199
|
-
require_logger.logger_default.logError(`DomMutationObserver invokeListener ${l?.getListener()?.getName()} state:${previousState}->${require_chat.DomMutationObserverContinuation.STOP} error: ${e}`, e);
|
|
200
|
-
l.setCurrentState(require_chat.DomMutationObserverContinuation.STOP);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
static observeOnDomReady(strategy) {
|
|
204
|
-
require_logger.logger_default.logDebug(`DomMutationObserver::observeOnDomReady ${document.readyState}`);
|
|
205
|
-
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", () => {
|
|
206
|
-
this.observe(strategy);
|
|
207
|
-
});
|
|
208
|
-
else this.observe(strategy);
|
|
209
|
-
}
|
|
210
|
-
static observe(strategyRequested) {
|
|
211
|
-
if (this.observationStrategy === require_chat.DomObservationStrategy.None) this.observationStrategy = strategyRequested;
|
|
212
|
-
const strategy = this.observationStrategy;
|
|
213
|
-
const listenersNotBound = this.listeners.filter((l) => !l.getIsAttached());
|
|
214
|
-
if (listenersNotBound.length === 0) {
|
|
215
|
-
require_logger.logger_default.logDebug(`DomMutationObserver::observe (${this.observerVersion}) no listeners to attach (${listenersNotBound.length}/${this.listeners.length})`);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
require_logger.logger_default.logInfo(`DomMutationObserver::observe (${this.observerVersion}) listeners to attach strategy=${strategy} (${listenersNotBound.length}/${this.listeners.length})`);
|
|
219
|
-
switch (strategy) {
|
|
220
|
-
case require_chat.DomObservationStrategy.Polling:
|
|
221
|
-
this.observeByPolling(listenersNotBound);
|
|
222
|
-
break;
|
|
223
|
-
default:
|
|
224
|
-
if (this.useDebounce) if (this.individualObservers) this.observeIndividuallyWithDebounce(listenersNotBound);
|
|
225
|
-
else this.observeCollectivelyWithDebounce(listenersNotBound);
|
|
226
|
-
else if (this.individualObservers) this.observeIndividually(listenersNotBound);
|
|
227
|
-
else this.observeCollectively(listenersNotBound);
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
listenersNotBound.forEach((l) => {
|
|
231
|
-
l.setIsAttached(true);
|
|
232
|
-
});
|
|
233
|
-
DomMutationObserver.runOnceImmediatelyIfRequired(listenersNotBound);
|
|
234
|
-
}
|
|
235
|
-
static runOnceImmediatelyIfRequired(listenersNotBound) {
|
|
236
|
-
listenersNotBound.forEach((l) => {
|
|
237
|
-
l.setIsAttached(true);
|
|
238
|
-
if (l.getListener().runOnceImmediately()) this.invokeListener(l);
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
static observeIndividuallyWithDebounce(listenersNotBound) {
|
|
242
|
-
for (let i = 0; i < listenersNotBound.length; i++) {
|
|
243
|
-
const l = listenersNotBound[i];
|
|
244
|
-
new MutationObserver((mutations) => {
|
|
245
|
-
let mutationQueueForListener = this.mutationsQueuePerListener.get(l);
|
|
246
|
-
if (!mutationQueueForListener) {
|
|
247
|
-
this.mutationsQueuePerListener.set(l, []);
|
|
248
|
-
mutationQueueForListener = this.mutationsQueuePerListener.get(l) || [];
|
|
249
|
-
}
|
|
250
|
-
if (!mutationQueueForListener.length) setTimeout(() => {
|
|
251
|
-
this.invokeListener(l);
|
|
252
|
-
mutationQueueForListener.length = 0;
|
|
253
|
-
}, this.deferredExecutionDelay);
|
|
254
|
-
mutationQueueForListener.push(...mutations);
|
|
255
|
-
}).observe(document.body, {
|
|
256
|
-
childList: true,
|
|
257
|
-
subtree: true
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
static observeIndividually(listenersNotBound) {
|
|
262
|
-
for (let i = 0; i < listenersNotBound.length; i++) {
|
|
263
|
-
const l = listenersNotBound[i];
|
|
264
|
-
new MutationObserver(() => {
|
|
265
|
-
if (l.getCurrentState() === require_chat.DomMutationObserverContinuation.CONTINUE) {
|
|
266
|
-
l.setCurrentState(require_chat.DomMutationObserverContinuation.EXECUTING);
|
|
267
|
-
setTimeout(() => {
|
|
268
|
-
this.invokeListener(l);
|
|
269
|
-
}, this.deferredExecutionDelay);
|
|
270
|
-
}
|
|
271
|
-
}).observe(document.body, {
|
|
272
|
-
childList: true,
|
|
273
|
-
subtree: true
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
static observeCollectivelyWithDebounce(listenersNotBound) {
|
|
278
|
-
new MutationObserver((mutations) => {
|
|
279
|
-
if (!this.mutationsQueue.length) setTimeout(() => {
|
|
280
|
-
for (let i = 0; i < listenersNotBound.length; i++) {
|
|
281
|
-
const l = listenersNotBound[i];
|
|
282
|
-
if (l.getCurrentState() === require_chat.DomMutationObserverContinuation.CONTINUE) {
|
|
283
|
-
l.setCurrentState(require_chat.DomMutationObserverContinuation.EXECUTING);
|
|
284
|
-
this.invokeListener(l);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
this.mutationsQueue.length = 0;
|
|
288
|
-
}, this.deferredExecutionDelay);
|
|
289
|
-
this.mutationsQueue.push(...mutations);
|
|
290
|
-
}).observe(document.body, {
|
|
291
|
-
childList: true,
|
|
292
|
-
subtree: true
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
static observeCollectively(listenersNotBound) {
|
|
296
|
-
new MutationObserver(() => {
|
|
297
|
-
setTimeout(() => {
|
|
298
|
-
for (let i = 0; i < listenersNotBound.length; i++) {
|
|
299
|
-
const l = listenersNotBound[i];
|
|
300
|
-
if (l.getCurrentState() === require_chat.DomMutationObserverContinuation.CONTINUE) {
|
|
301
|
-
l.setCurrentState(require_chat.DomMutationObserverContinuation.EXECUTING);
|
|
302
|
-
this.invokeListener(l);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}, this.deferredExecutionDelay);
|
|
306
|
-
}).observe(document.body, {
|
|
307
|
-
childList: true,
|
|
308
|
-
subtree: true
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
static poll(fn, startingInterval, endingInterval) {
|
|
312
|
-
let intervalScalingStep = 1;
|
|
313
|
-
const executePoll = async () => {
|
|
314
|
-
try {
|
|
315
|
-
await fn();
|
|
316
|
-
} catch (error) {
|
|
317
|
-
require_logger.logger_default.logWarn("Polling error:", error);
|
|
318
|
-
} finally {
|
|
319
|
-
let interval = startingInterval * intervalScalingStep;
|
|
320
|
-
interval = Math.min(interval, endingInterval);
|
|
321
|
-
if (interval < endingInterval) intervalScalingStep++;
|
|
322
|
-
setTimeout(executePoll, interval);
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
executePoll().then((_) => require_logger.logger_default.logDebug("Polling started"));
|
|
326
|
-
}
|
|
327
|
-
static observeByPolling(listenersNotBound) {
|
|
328
|
-
this.poll(async () => {
|
|
329
|
-
for (let i = 0; i < listenersNotBound.length; i++) {
|
|
330
|
-
const l = listenersNotBound[i];
|
|
331
|
-
if (l.getCurrentState() === require_chat.DomMutationObserverContinuation.CONTINUE) {
|
|
332
|
-
l.setCurrentState(require_chat.DomMutationObserverContinuation.EXECUTING);
|
|
333
|
-
this.invokeListener(l);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}, this.startingPollingInterval, this.endingPollingInterval);
|
|
337
|
-
}
|
|
338
|
-
static disconnect(listener) {
|
|
339
|
-
const listenerState = this.listeners.find((l) => l.getListener() === listener);
|
|
340
|
-
if (!listenerState) require_logger.logger_default.logDebug(`DomMutationObserver::disconnect listener not found`, void 0);
|
|
341
|
-
else {
|
|
342
|
-
require_logger.logger_default.logDebug(`DomMutationObserver::disconnect listener found`, void 0);
|
|
343
|
-
listenerState.setCurrentState(require_chat.DomMutationObserverContinuation.STOP);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
static setStartingPollingInterval(interval) {
|
|
347
|
-
this.startingPollingInterval = interval;
|
|
348
|
-
}
|
|
349
|
-
static setEndingPollingInterval(interval) {
|
|
350
|
-
this.endingPollingInterval = interval;
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
//#endregion
|
|
355
|
-
//#region src/application/service/kustomerIntegrationService.ts
|
|
356
|
-
var KustomerIntegrationService = class KustomerIntegrationService {
|
|
357
|
-
static {
|
|
358
|
-
this.KUSTOMER_LOCAL_STORAGE_KEY = "kustomerState";
|
|
359
|
-
}
|
|
360
|
-
static {
|
|
361
|
-
this.KUSTOMER_IFRAME_ID = "kustomer-ui-sdk-iframe";
|
|
362
|
-
}
|
|
363
|
-
constructor() {
|
|
364
|
-
require_logger.logger_default.logDebug("[spiffy-ai] KustomerIntegrationService created", void 0);
|
|
365
|
-
this.initialized = false;
|
|
366
|
-
}
|
|
367
|
-
initOnce() {
|
|
368
|
-
if (this.initialized) return;
|
|
369
|
-
const This = this;
|
|
370
|
-
require_chat.LocalStorageService.attachListener({
|
|
371
|
-
storageKey: KustomerIntegrationService.KUSTOMER_LOCAL_STORAGE_KEY,
|
|
372
|
-
listener: (event) => This.onCustomerStateChange(event)
|
|
373
|
-
});
|
|
374
|
-
this.initialized = true;
|
|
375
|
-
}
|
|
376
|
-
disconnect() {
|
|
377
|
-
require_logger.logger_default.logDebug("[spiffy-ai] Disconnecting KustomerIntegrationService");
|
|
378
|
-
const This = this;
|
|
379
|
-
require_chat.LocalStorageService.detachListener({
|
|
380
|
-
storageKey: KustomerIntegrationService.KUSTOMER_LOCAL_STORAGE_KEY,
|
|
381
|
-
listener: (event) => This.onCustomerStateChange(event)
|
|
382
|
-
});
|
|
383
|
-
const elementRef = this.findKustomerButton();
|
|
384
|
-
if (elementRef == null) {
|
|
385
|
-
require_logger.logger_default.logDebug("[spiffy-ai] Kustomer iFrame element not found");
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
elementRef.style.visibility = "visible";
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Updates the visibility of the Kustomer chat icon.
|
|
392
|
-
*/
|
|
393
|
-
updateVisibility() {
|
|
394
|
-
const elementRef = this.findKustomerButton();
|
|
395
|
-
if (elementRef == null) {
|
|
396
|
-
require_logger.logger_default.logDebug("[spiffy-ai] Kustomer iFrame element not found");
|
|
397
|
-
return false;
|
|
398
|
-
}
|
|
399
|
-
let kustomerStateStorageItem = require_chat.LocalStorageService.getItem(KustomerIntegrationService.KUSTOMER_LOCAL_STORAGE_KEY);
|
|
400
|
-
if (kustomerStateStorageItem == null) {
|
|
401
|
-
require_logger.logger_default.logDebug("[spiffy-ai] Kustomer state not found in local storage (defaulting)");
|
|
402
|
-
kustomerStateStorageItem = JSON.stringify({ wasWidgetOpen: false });
|
|
403
|
-
}
|
|
404
|
-
const kustomerState = JSON.parse(kustomerStateStorageItem);
|
|
405
|
-
const visibility = kustomerState.wasWidgetOpen ? "visible" : "hidden";
|
|
406
|
-
elementRef.style.visibility = visibility;
|
|
407
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] Kustomer widget was ${kustomerState.wasWidgetOpen ? "open" : "closed"}, setting visibility to ${visibility}`);
|
|
408
|
-
return true;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Queries the document body for the Kustomer SDK iframe. This function is to be run in a
|
|
412
|
-
* MutationObserver.
|
|
413
|
-
* @returns the iframe element if it exists, else undefine.
|
|
414
|
-
*/
|
|
415
|
-
findKustomerButton() {
|
|
416
|
-
require_logger.logger_default.logDebug("[spiffy-ai] Finding Kustomer button");
|
|
417
|
-
const kustomerElement = window.document.getElementById(KustomerIntegrationService.KUSTOMER_IFRAME_ID) ?? void 0;
|
|
418
|
-
if (kustomerElement != null && kustomerElement instanceof HTMLIFrameElement) return kustomerElement;
|
|
419
|
-
require_logger.logger_default.logDebug("[spiffy-ai] Kustomer iFrame element not found");
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Updates the Kustomer chat icon visibility when the kustomerState localStorage item changes.
|
|
423
|
-
* @param event The event that triggered the event listener.
|
|
424
|
-
*/
|
|
425
|
-
onCustomerStateChange(event) {
|
|
426
|
-
if (event.key === KustomerIntegrationService.KUSTOMER_LOCAL_STORAGE_KEY && event.newValue != null) {
|
|
427
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] Storage change key=${event.key}, updating widget visibility`, event.newValue);
|
|
428
|
-
this.updateVisibility();
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
//#endregion
|
|
434
|
-
//#region src/application/service/windowChatToggleService.ts
|
|
435
|
-
let hasAttachedEnviveChatToggle = false;
|
|
436
|
-
const WindowChatToggleBinder = () => {
|
|
437
|
-
const triggerLocation = require_chat.ChatElementDisplayLocation.WINDOW_API_CALL;
|
|
438
|
-
const hook = require_hooks.useChatToggle();
|
|
439
|
-
const setReply = (0, jotai.useSetAtom)(require_chat.handleReplyAtom);
|
|
440
|
-
const openChatRef = (0, react.useRef)();
|
|
441
|
-
const closeChatRef = (0, react.useRef)();
|
|
442
|
-
const toggleChatRef = (0, react.useRef)();
|
|
443
|
-
const isOpenRef = (0, react.useRef)(hook.isOpen);
|
|
444
|
-
const openChatWithPromptRef = (0, react.useRef)();
|
|
445
|
-
(0, react.useEffect)(() => {
|
|
446
|
-
openChatRef.current = (triggerId) => hook.openChat(triggerLocation, triggerId);
|
|
447
|
-
closeChatRef.current = (triggerId) => hook.closeChat(triggerLocation, triggerId);
|
|
448
|
-
toggleChatRef.current = (triggerId) => hook.toggle(triggerLocation, triggerId);
|
|
449
|
-
isOpenRef.current = hook.isOpen;
|
|
450
|
-
openChatWithPromptRef.current = (prompt, triggerId) => {
|
|
451
|
-
const message = {
|
|
452
|
-
id: (0, uuid.v4)(),
|
|
453
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
454
|
-
role: require_chat.MessageRole.User,
|
|
455
|
-
type: require_chat.MessageType.QueryTyped,
|
|
456
|
-
metadata: { content: prompt }
|
|
457
|
-
};
|
|
458
|
-
setReply({
|
|
459
|
-
message,
|
|
460
|
-
userTyped: false
|
|
461
|
-
});
|
|
462
|
-
hook.openChat(triggerLocation, triggerId);
|
|
463
|
-
};
|
|
464
|
-
}, [
|
|
465
|
-
hook,
|
|
466
|
-
setReply,
|
|
467
|
-
triggerLocation,
|
|
468
|
-
hook.isOpen
|
|
469
|
-
]);
|
|
470
|
-
(0, react.useEffect)(() => {
|
|
471
|
-
if (hasAttachedEnviveChatToggle) return;
|
|
472
|
-
const identifyingPrefix = require_chat.EnvironmentService.getIdentifyingPrefix();
|
|
473
|
-
try {
|
|
474
|
-
if (!window[identifyingPrefix]) window[identifyingPrefix] = {};
|
|
475
|
-
window[identifyingPrefix].openChat = (triggerId) => openChatRef.current?.(triggerId);
|
|
476
|
-
window[identifyingPrefix].closeChat = (triggerId) => closeChatRef.current?.(triggerId);
|
|
477
|
-
window[identifyingPrefix].toggleChat = (triggerId) => toggleChatRef.current?.(triggerId);
|
|
478
|
-
window[identifyingPrefix].getChatIsOpen = () => !!isOpenRef.current;
|
|
479
|
-
window[identifyingPrefix].openChatWithPrompt = (prompt, triggerId) => openChatWithPromptRef.current?.(prompt, triggerId);
|
|
480
|
-
require_logger.logger_default.logDebug("[spiffy-ai] Chat toggle functions attached");
|
|
481
|
-
hasAttachedEnviveChatToggle = true;
|
|
482
|
-
} catch (e) {
|
|
483
|
-
require_logger.logger_default.logError("[spiffy-ai] Failed to attach Chat toggle functions", e);
|
|
484
|
-
}
|
|
485
|
-
}, []);
|
|
486
|
-
return null;
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
//#endregion
|
|
490
|
-
//#region src/application/service/windowFrontendConfigService.ts
|
|
491
|
-
var WindowFrontendConfigService = class WindowFrontendConfigService {
|
|
492
|
-
constructor() {
|
|
493
|
-
this.isInitialized = false;
|
|
494
|
-
}
|
|
495
|
-
static getSingletonInstance() {
|
|
496
|
-
if (!this.instance) this.instance = new WindowFrontendConfigService();
|
|
497
|
-
return this.instance;
|
|
498
|
-
}
|
|
499
|
-
init() {
|
|
500
|
-
if (this.isInitialized) return;
|
|
501
|
-
this.isInitialized = true;
|
|
502
|
-
try {
|
|
503
|
-
const identifyingPrefix = require_chat.EnvironmentService.getIdentifyingPrefix();
|
|
504
|
-
if (!window[identifyingPrefix]) window[identifyingPrefix] = {};
|
|
505
|
-
const apply = (overrides) => {
|
|
506
|
-
require_logger.logger_default.logDebug("[spiffy-ai] applyFrontendConfigOverrides invoked");
|
|
507
|
-
WindowFrontendConfigService.applyOverridesToFrontendConfig(overrides);
|
|
508
|
-
};
|
|
509
|
-
window[identifyingPrefix].applyFrontendConfigOverrides = apply;
|
|
510
|
-
require_logger.logger_default.logDebug("[spiffy-ai] FrontendConfig overrides apply function attached");
|
|
511
|
-
} catch (e) {
|
|
512
|
-
require_logger.logger_default.logError("[spiffy-ai] Failed to attach FrontendConfig overrides apply function", e);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
static async applyOverridesToFrontendConfig(overrides) {
|
|
516
|
-
const atomStore = require_atomStore.getAtomStore();
|
|
517
|
-
try {
|
|
518
|
-
const frontendConfig = await atomStore.get(require_chat.frontendConfigAtom);
|
|
519
|
-
const orgPageConfig = await atomStore.get(require_org.orgPageConfigAtom);
|
|
520
|
-
let currentConfig = {
|
|
521
|
-
orgUIConfig: atomStore.get(require_chat.orgUIConfigAtom),
|
|
522
|
-
colorsConfig: await atomStore.get(require_chat.colorsConfigAtom),
|
|
523
|
-
mountingConfigs: orgPageConfig.mountingConfigs,
|
|
524
|
-
widgetConfigs: orgPageConfig.widgetConfigs
|
|
525
|
-
};
|
|
526
|
-
require_logger.logger_default.logInfo("[spiffy-ai] base config", { baseConfig: currentConfig });
|
|
527
|
-
for (let i = 0; i < overrides.length; i += 1) {
|
|
528
|
-
const currentOverride = overrides[i];
|
|
529
|
-
currentConfig = require_chat.applyOverrides(currentConfig, currentOverride, { arrayStrategy: "mergeByIndex" });
|
|
530
|
-
}
|
|
531
|
-
atomStore.set(require_chat.orgUIConfigAtom, currentConfig.orgUIConfig);
|
|
532
|
-
atomStore.set(require_chat.colorsConfigAtom, currentConfig.colorsConfig);
|
|
533
|
-
atomStore.set(require_chat.frontendConfigAtom, {
|
|
534
|
-
...frontendConfig,
|
|
535
|
-
mountingConfigs: currentConfig.mountingConfigs,
|
|
536
|
-
widgetConfigs: currentConfig.widgetConfigs
|
|
537
|
-
});
|
|
538
|
-
require_logger.logger_default.logInfo("[spiffy-ai] atoms updated via overrides", { currentConfig });
|
|
539
|
-
} catch (e) {
|
|
540
|
-
require_logger.logger_default.logError("[spiffy-ai] Failed to apply FrontendConfig overrides", e);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
const initWindowFrontendConfigOverridesApplyFunction = () => WindowFrontendConfigService.getSingletonInstance().init();
|
|
545
|
-
|
|
546
|
-
//#endregion
|
|
547
|
-
//#region src/application/service/domMutations/dataLayer/dataLayerEventsListener.ts
|
|
548
|
-
var DataLayerEventsListener = class {
|
|
549
|
-
constructor(onDataLayerPush, eventsToIntercept, gaConfig) {
|
|
550
|
-
this.eventsToIntercept = [];
|
|
551
|
-
require_logger.logger_default.logDebug("[spiffy-ai] DataLayerEventsListener created", void 0);
|
|
552
|
-
this.onDataLayerPush = onDataLayerPush;
|
|
553
|
-
this.eventsToIntercept = eventsToIntercept;
|
|
554
|
-
this.windowDataLayerService = require_chat.WindowDataLayerService.getSingletonInstanceOf(gaConfig);
|
|
555
|
-
}
|
|
556
|
-
runOnceImmediately() {
|
|
557
|
-
return true;
|
|
558
|
-
}
|
|
559
|
-
triesMax() {
|
|
560
|
-
return 10;
|
|
561
|
-
}
|
|
562
|
-
onDomChange() {
|
|
563
|
-
if (!require_chat.WindowDataLayerService.isDataLayerAvailable()) return require_chat.DomMutationObserverContinuation.CONTINUE;
|
|
564
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] ${this.getName()} [subscribing] to DataLayer push events`);
|
|
565
|
-
const This = this;
|
|
566
|
-
function dataLayerPushProxyMethod() {
|
|
567
|
-
try {
|
|
568
|
-
const allArguments = require_chat.WindowDataLayerService.tryFlattenArguments(arguments);
|
|
569
|
-
let event = allArguments[0];
|
|
570
|
-
if (!event) {
|
|
571
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] ${This.getName()} dataLayer event undefined. all_arguments=`, allArguments);
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
if (event?.length > 1) {
|
|
575
|
-
if (event[0] === "event") {
|
|
576
|
-
const eventName$1 = require_chat.StringUtils.trimToNull(event[1]) || "";
|
|
577
|
-
if (This.eventsToIntercept.includes(eventName$1)) {
|
|
578
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] ${This.getName()} [datalayer-event] (1) event_name=${eventName$1} events_to_intercept=${This.eventsToIntercept} all_arguments=`, allArguments);
|
|
579
|
-
event[2]["event"] = eventName$1;
|
|
580
|
-
This.onDataLayerPush(event[2]);
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
let eventName = require_chat.StringUtils.trimToNull(event["event"]) || "";
|
|
586
|
-
if (!eventName && event["0"]) {
|
|
587
|
-
eventName = require_chat.StringUtils.trimToNull(event["0"]["event"]) || "";
|
|
588
|
-
event = event["0"];
|
|
589
|
-
}
|
|
590
|
-
if (This.eventsToIntercept.includes(eventName)) {
|
|
591
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] ${This.getName()} [datalayer-event] (2) event_name=${eventName} events_to_intercept=${This.eventsToIntercept} all_arguments=`, arguments);
|
|
592
|
-
This.onDataLayerPush(event);
|
|
593
|
-
}
|
|
594
|
-
} catch (e) {
|
|
595
|
-
require_logger.logger_default.logError(`[spiffy-ai] ${This.getName()} Error in dataLayer.push: `, e);
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
this.windowDataLayerService.wrapWithProxyMethod("push", dataLayerPushProxyMethod);
|
|
599
|
-
return require_chat.DomMutationObserverContinuation.STOP;
|
|
600
|
-
}
|
|
601
|
-
getName() {
|
|
602
|
-
return "DataLayerEventsListener";
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
//#endregion
|
|
607
|
-
//#region src/application/service/domMutations/floatingChat/embeddedChatsPlacementsListener.ts
|
|
608
|
-
var EmbeddedChatsPlacementsListener = class {
|
|
609
|
-
constructor(findPlacementNodes) {
|
|
610
|
-
require_logger.logger_default.logDebug("[spiffy-ai] EmbeddedChatsPlacementsListener created", void 0);
|
|
611
|
-
this.findPlacementNodes = findPlacementNodes;
|
|
612
|
-
}
|
|
613
|
-
runOnceImmediately() {
|
|
614
|
-
return true;
|
|
615
|
-
}
|
|
616
|
-
onDomChange() {
|
|
617
|
-
const continuation = this.findPlacementNodes();
|
|
618
|
-
if (continuation === require_chat.DomMutationObserverContinuation.STOP) require_logger.logger_default.logDebug("[spiffy-ai] EmbeddedChatsPlacementsListener [STOP requested]", void 0);
|
|
619
|
-
return continuation;
|
|
620
|
-
}
|
|
621
|
-
getName() {
|
|
622
|
-
return "EmbeddedChatsPlacementsListener";
|
|
623
|
-
}
|
|
624
|
-
triesMax() {
|
|
625
|
-
return -1;
|
|
626
|
-
}
|
|
627
|
-
};
|
|
628
|
-
|
|
629
|
-
//#endregion
|
|
630
|
-
//#region src/application/service/domMutations/gladly/gladlyListener.ts
|
|
631
|
-
var GladlyListener = class GladlyListener {
|
|
632
|
-
static {
|
|
633
|
-
this.GLADLY_RETRIES_MAX = 25;
|
|
634
|
-
}
|
|
635
|
-
static {
|
|
636
|
-
this.GLADLY_CONVERSATION_STARTED_EVENT_NAME = "conversation:started";
|
|
637
|
-
}
|
|
638
|
-
constructor(onGladlyAvailable) {
|
|
639
|
-
require_logger.logger_default.logDebug("[spiffy-ai] GladlyListener created", void 0);
|
|
640
|
-
this.onGladlyAvailable = onGladlyAvailable;
|
|
641
|
-
}
|
|
642
|
-
runOnceImmediately() {
|
|
643
|
-
return false;
|
|
644
|
-
}
|
|
645
|
-
triesMax() {
|
|
646
|
-
return GladlyListener.GLADLY_RETRIES_MAX;
|
|
647
|
-
}
|
|
648
|
-
onDomChange() {
|
|
649
|
-
if (window.Gladly && window.Gladly.getUser != null && window.Gladly.on != null && window.Gladly.show != null) {
|
|
650
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] subscribing to Gladly ${GladlyListener.GLADLY_CONVERSATION_STARTED_EVENT_NAME} event`);
|
|
651
|
-
window.Gladly.on(GladlyListener.GLADLY_CONVERSATION_STARTED_EVENT_NAME, this.onGladlyAvailable);
|
|
652
|
-
return require_chat.DomMutationObserverContinuation.STOP;
|
|
653
|
-
}
|
|
654
|
-
return require_chat.DomMutationObserverContinuation.CONTINUE;
|
|
655
|
-
}
|
|
656
|
-
getName() {
|
|
657
|
-
return "GladlyListener";
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
//#endregion
|
|
662
|
-
//#region src/application/service/domMutations/spiffy/orgs/common/kustomerVisibilityListener.ts
|
|
663
|
-
var KustomerVisibilityListener = class {
|
|
664
|
-
constructor() {
|
|
665
|
-
require_logger.logger_default.logDebug("[spiffy-ai] KustomerVisibilityListener created");
|
|
666
|
-
this.kustomerIntegrationService = new KustomerIntegrationService();
|
|
667
|
-
}
|
|
668
|
-
runOnceImmediately() {
|
|
669
|
-
return true;
|
|
670
|
-
}
|
|
671
|
-
triesMax() {
|
|
672
|
-
return -1;
|
|
673
|
-
}
|
|
674
|
-
disconnect() {
|
|
675
|
-
this.kustomerIntegrationService.disconnect();
|
|
676
|
-
}
|
|
677
|
-
onDomChange() {
|
|
678
|
-
this.kustomerIntegrationService.initOnce();
|
|
679
|
-
if (this.kustomerIntegrationService.updateVisibility()) return require_chat.DomMutationObserverContinuation.STOP;
|
|
680
|
-
return require_chat.DomMutationObserverContinuation.CONTINUE;
|
|
681
|
-
}
|
|
682
|
-
getName() {
|
|
683
|
-
return "KustomerVisibilityListener";
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
|
|
687
|
-
//#endregion
|
|
688
|
-
//#region src/application/service/domMutations/spiffy/orgs/common/orgsCommonDataLayerListener.ts
|
|
689
|
-
var OrgsCommonDataLayerListener = class OrgsCommonDataLayerListener {
|
|
690
|
-
static {
|
|
691
|
-
this.dataLayerCache = {};
|
|
692
|
-
}
|
|
693
|
-
static resetDataLayerCache() {
|
|
694
|
-
OrgsCommonDataLayerListener.dataLayerCache = {};
|
|
695
|
-
}
|
|
696
|
-
static getSingletonDataLayerListenerCallbackCombo(orgShortName, orgAnalyticsConfig) {
|
|
697
|
-
if (!orgAnalyticsConfig.googleAnalytics) {
|
|
698
|
-
require_logger.logger_default.logError(`[spiffy-ai] Google Analytics config is required for dataLayer event listener`, orgAnalyticsConfig);
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
const allCachedDataLayerListeners = Object.keys(OrgsCommonDataLayerListener.dataLayerCache)?.length;
|
|
702
|
-
if (allCachedDataLayerListeners > 1) require_logger.logger_default.logError(`[spiffy-ai] dataLayer listeners cache size: ${allCachedDataLayerListeners}`, OrgsCommonDataLayerListener.dataLayerCache);
|
|
703
|
-
if (OrgsCommonDataLayerListener.dataLayerCache[orgShortName]) return { dataLayerListener: OrgsCommonDataLayerListener.dataLayerCache[orgShortName] };
|
|
704
|
-
const callback = (event) => {
|
|
705
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] dataLayer event:`, event);
|
|
706
|
-
if (event?.event !== require_chat.GoogleAnalyticsEvents.ADD_TO_CART_v1 && event?.event !== require_chat.GoogleAnalyticsEvents.ADD_TO_CART_v2) {
|
|
707
|
-
require_logger.logger_default.logDebug(`[spiffy-ai] dataLayer [pass-through] event. event_not_captured=`, event);
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
const items = event?.ecommerce?.items || event?.items;
|
|
711
|
-
const itemIdList = items?.map((item) => item?.item_id).filter((id) => id);
|
|
712
|
-
const itemCategoryList = items?.map((item) => item?.item_category).filter((category) => category);
|
|
713
|
-
const eventProps = {
|
|
714
|
-
"ecommerce.item_id_list": itemIdList,
|
|
715
|
-
"ecommerce.item_category_list": itemCategoryList,
|
|
716
|
-
display_location: require_chat.ChatElementDisplayLocation.UNSPECIFIED
|
|
717
|
-
};
|
|
718
|
-
require_chat.AmplitudeAdapter.trackEvent({
|
|
719
|
-
eventName: require_chat.SpiffyMetricsEventName.AddToCartClicked,
|
|
720
|
-
eventProps,
|
|
721
|
-
alsoSendToGoogleAnalytics: true
|
|
722
|
-
});
|
|
723
|
-
};
|
|
724
|
-
const dataLayerListener = new DataLayerEventsListener(callback, [require_chat.GoogleAnalyticsEvents.ADD_TO_CART_v1, require_chat.GoogleAnalyticsEvents.ADD_TO_CART_v2], orgAnalyticsConfig.googleAnalytics);
|
|
725
|
-
OrgsCommonDataLayerListener.dataLayerCache[orgShortName] = dataLayerListener;
|
|
726
|
-
return { dataLayerListener };
|
|
727
|
-
}
|
|
728
|
-
};
|
|
729
|
-
|
|
730
|
-
//#endregion
|
|
731
|
-
exports.CdnService = require_cdnService.CdnService;
|
|
1
|
+
require('../../logger-Dln20ans.cjs');
|
|
2
|
+
require('../../api-B2euFL-5.cjs');
|
|
3
|
+
const require_contexts = require('../../contexts-CQDwe3rK.cjs');
|
|
4
|
+
const require_types = require('../../types-CNH4sfF-.cjs');
|
|
5
|
+
require('../../atomStore-JwGb7pcy.cjs');
|
|
6
|
+
const require_customerService = require('../../customerService-BG1uNZZ1.cjs');
|
|
7
|
+
require('../../globalSearch-BTeZxvk1.cjs');
|
|
8
|
+
require('../../utilityTypes-C4h2wgAK.cjs');
|
|
9
|
+
require('../../variantInfo-CNRTY0gH.cjs');
|
|
10
|
+
require('../../events-Da7gpmGv.cjs');
|
|
11
|
+
|
|
12
|
+
exports.CdnService = require_contexts.CdnService;
|
|
732
13
|
exports.CustomerServiceIntegrationMode = require_types.CustomerServiceIntegrationMode;
|
|
733
14
|
exports.CustomerServiceType = require_types.CustomerServiceType;
|
|
734
|
-
exports.DOMInsertionService =
|
|
735
|
-
exports.DOMInsertionType =
|
|
736
|
-
exports.DOMInsertionTypeToInsertPosition =
|
|
737
|
-
exports.DataLayerEventsListener = DataLayerEventsListener;
|
|
738
|
-
exports.DomMutationListenerState = DomMutationListenerState;
|
|
739
|
-
exports.DomMutationObserver = DomMutationObserver;
|
|
740
|
-
exports.EmbeddedChatsPlacementsListener = EmbeddedChatsPlacementsListener;
|
|
741
|
-
exports.
|
|
742
|
-
exports.
|
|
743
|
-
exports.
|
|
744
|
-
exports.
|
|
745
|
-
exports.
|
|
746
|
-
exports.
|
|
747
|
-
exports.
|
|
748
|
-
exports.
|
|
749
|
-
exports.
|
|
750
|
-
exports.
|
|
751
|
-
exports.
|
|
752
|
-
exports.
|
|
753
|
-
exports.ShopifyUrlService = require_hooks.ShopifyUrlService;
|
|
15
|
+
exports.DOMInsertionService = require_contexts.DOMInsertionService;
|
|
16
|
+
exports.DOMInsertionType = require_contexts.DOMInsertionType;
|
|
17
|
+
exports.DOMInsertionTypeToInsertPosition = require_contexts.DOMInsertionTypeToInsertPosition;
|
|
18
|
+
exports.DataLayerEventsListener = require_contexts.DataLayerEventsListener;
|
|
19
|
+
exports.DomMutationListenerState = require_contexts.DomMutationListenerState;
|
|
20
|
+
exports.DomMutationObserver = require_contexts.DomMutationObserver;
|
|
21
|
+
exports.EmbeddedChatsPlacementsListener = require_contexts.EmbeddedChatsPlacementsListener;
|
|
22
|
+
exports.FeatureFlagService = require_contexts.FeatureFlagService;
|
|
23
|
+
exports.GladlyListener = require_contexts.GladlyListener;
|
|
24
|
+
exports.GridInsertionService = require_contexts.GridInsertionService;
|
|
25
|
+
exports.GridInsertionType = require_contexts.GridInsertionType;
|
|
26
|
+
exports.KustomerIntegrationService = require_contexts.KustomerIntegrationService;
|
|
27
|
+
exports.KustomerVisibilityListener = require_contexts.KustomerVisibilityListener;
|
|
28
|
+
exports.LocalStorageKeys = require_contexts.LocalStorageKeys;
|
|
29
|
+
exports.LocalStorageService = require_contexts.LocalStorageService;
|
|
30
|
+
exports.OrgsCommonDataLayerListener = require_contexts.OrgsCommonDataLayerListener;
|
|
31
|
+
exports.PageVariantService = require_contexts.PageVariantService;
|
|
32
|
+
exports.SessionStorageService = require_contexts.SessionStorageService;
|
|
33
|
+
exports.ShopifyUrlService = require_contexts.ShopifyUrlService;
|
|
754
34
|
exports.UnsupportedCustomerService = require_customerService.UnsupportedCustomerService;
|
|
755
|
-
exports.UserIdentityService =
|
|
756
|
-
exports.WindowChatToggleBinder = WindowChatToggleBinder;
|
|
757
|
-
exports.WindowDataLayerService =
|
|
758
|
-
exports.cacheable = cacheable;
|
|
759
|
-
exports.cacheableAsync = cacheableAsync;
|
|
35
|
+
exports.UserIdentityService = require_contexts.UserIdentityService;
|
|
36
|
+
exports.WindowChatToggleBinder = require_contexts.WindowChatToggleBinder;
|
|
37
|
+
exports.WindowDataLayerService = require_contexts.WindowDataLayerService;
|
|
38
|
+
exports.cacheable = require_contexts.cacheable;
|
|
39
|
+
exports.cacheableAsync = require_contexts.cacheableAsync;
|
|
760
40
|
exports.findCustomerServiceImpl = require_customerService.findCustomerServiceImpl;
|
|
761
|
-
exports.initWindowFrontendConfigOverridesApplyFunction = initWindowFrontendConfigOverridesApplyFunction;
|
|
41
|
+
exports.initWindowFrontendConfigOverridesApplyFunction = require_contexts.initWindowFrontendConfigOverridesApplyFunction;
|