srs-heritage-chatbot 1.0.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.
Files changed (187) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +194 -0
  3. package/lib/commonjs/assets/chat-icon-mobile.svg +1 -0
  4. package/lib/commonjs/assets/heritage.png +0 -0
  5. package/lib/commonjs/assets/posiden.svg +51 -0
  6. package/lib/commonjs/components/LoadingTips.js +104 -0
  7. package/lib/commonjs/components/LoadingTips.js.map +1 -0
  8. package/lib/commonjs/components/email.js +461 -0
  9. package/lib/commonjs/components/email.js.map +1 -0
  10. package/lib/commonjs/components/feedback.js +114 -0
  11. package/lib/commonjs/components/feedback.js.map +1 -0
  12. package/lib/commonjs/components/header.js +126 -0
  13. package/lib/commonjs/components/header.js.map +1 -0
  14. package/lib/commonjs/components/input.js +144 -0
  15. package/lib/commonjs/components/input.js.map +1 -0
  16. package/lib/commonjs/components/productCard.js +688 -0
  17. package/lib/commonjs/components/productCard.js.map +1 -0
  18. package/lib/commonjs/components/progressCircle.js +99 -0
  19. package/lib/commonjs/components/progressCircle.js.map +1 -0
  20. package/lib/commonjs/components/testing.js +74 -0
  21. package/lib/commonjs/components/testing.js.map +1 -0
  22. package/lib/commonjs/components/voice.js +184 -0
  23. package/lib/commonjs/components/voice.js.map +1 -0
  24. package/lib/commonjs/components/welcomeButton.js +149 -0
  25. package/lib/commonjs/components/welcomeButton.js.map +1 -0
  26. package/lib/commonjs/components/welcomeInput.js +137 -0
  27. package/lib/commonjs/components/welcomeInput.js.map +1 -0
  28. package/lib/commonjs/contexts/AppContext.js +552 -0
  29. package/lib/commonjs/contexts/AppContext.js.map +1 -0
  30. package/lib/commonjs/hooks/Stream.js +599 -0
  31. package/lib/commonjs/hooks/Stream.js.map +1 -0
  32. package/lib/commonjs/hooks/useAsyncStorage.js +36 -0
  33. package/lib/commonjs/hooks/useAsyncStorage.js.map +1 -0
  34. package/lib/commonjs/index.js +44 -0
  35. package/lib/commonjs/index.js.map +1 -0
  36. package/lib/commonjs/layout/disclaimer.js +208 -0
  37. package/lib/commonjs/layout/disclaimer.js.map +1 -0
  38. package/lib/commonjs/layout/ex.js +254 -0
  39. package/lib/commonjs/layout/ex.js.map +1 -0
  40. package/lib/commonjs/layout/icon.js +118 -0
  41. package/lib/commonjs/layout/icon.js.map +1 -0
  42. package/lib/commonjs/layout/layout.js +168 -0
  43. package/lib/commonjs/layout/layout.js.map +1 -0
  44. package/lib/commonjs/layout/welcome.js +160 -0
  45. package/lib/commonjs/layout/welcome.js.map +1 -0
  46. package/lib/commonjs/layout/window.js +396 -0
  47. package/lib/commonjs/layout/window.js.map +1 -0
  48. package/lib/commonjs/utils/audioRecorder.js +412 -0
  49. package/lib/commonjs/utils/audioRecorder.js.map +1 -0
  50. package/lib/commonjs/utils/cloudinary.js +69 -0
  51. package/lib/commonjs/utils/cloudinary.js.map +1 -0
  52. package/lib/commonjs/utils/storage.js +76 -0
  53. package/lib/commonjs/utils/storage.js.map +1 -0
  54. package/lib/commonjs/utils/textToSpeech.js +53 -0
  55. package/lib/commonjs/utils/textToSpeech.js.map +1 -0
  56. package/lib/module/assets/chat-icon-mobile.svg +1 -0
  57. package/lib/module/assets/heritage.png +0 -0
  58. package/lib/module/assets/posiden.svg +51 -0
  59. package/lib/module/components/LoadingTips.js +95 -0
  60. package/lib/module/components/LoadingTips.js.map +1 -0
  61. package/lib/module/components/email.js +452 -0
  62. package/lib/module/components/email.js.map +1 -0
  63. package/lib/module/components/feedback.js +105 -0
  64. package/lib/module/components/feedback.js.map +1 -0
  65. package/lib/module/components/header.js +117 -0
  66. package/lib/module/components/header.js.map +1 -0
  67. package/lib/module/components/input.js +135 -0
  68. package/lib/module/components/input.js.map +1 -0
  69. package/lib/module/components/productCard.js +679 -0
  70. package/lib/module/components/productCard.js.map +1 -0
  71. package/lib/module/components/progressCircle.js +91 -0
  72. package/lib/module/components/progressCircle.js.map +1 -0
  73. package/lib/module/components/testing.js +66 -0
  74. package/lib/module/components/testing.js.map +1 -0
  75. package/lib/module/components/voice.js +175 -0
  76. package/lib/module/components/voice.js.map +1 -0
  77. package/lib/module/components/welcomeButton.js +140 -0
  78. package/lib/module/components/welcomeButton.js.map +1 -0
  79. package/lib/module/components/welcomeInput.js +128 -0
  80. package/lib/module/components/welcomeInput.js.map +1 -0
  81. package/lib/module/contexts/AppContext.js +542 -0
  82. package/lib/module/contexts/AppContext.js.map +1 -0
  83. package/lib/module/hooks/Stream.js +592 -0
  84. package/lib/module/hooks/Stream.js.map +1 -0
  85. package/lib/module/hooks/useAsyncStorage.js +29 -0
  86. package/lib/module/hooks/useAsyncStorage.js.map +1 -0
  87. package/lib/module/index.js +36 -0
  88. package/lib/module/index.js.map +1 -0
  89. package/lib/module/layout/disclaimer.js +199 -0
  90. package/lib/module/layout/disclaimer.js.map +1 -0
  91. package/lib/module/layout/ex.js +253 -0
  92. package/lib/module/layout/ex.js.map +1 -0
  93. package/lib/module/layout/icon.js +108 -0
  94. package/lib/module/layout/icon.js.map +1 -0
  95. package/lib/module/layout/layout.js +160 -0
  96. package/lib/module/layout/layout.js.map +1 -0
  97. package/lib/module/layout/welcome.js +150 -0
  98. package/lib/module/layout/welcome.js.map +1 -0
  99. package/lib/module/layout/window.js +387 -0
  100. package/lib/module/layout/window.js.map +1 -0
  101. package/lib/module/utils/audioRecorder.js +398 -0
  102. package/lib/module/utils/audioRecorder.js.map +1 -0
  103. package/lib/module/utils/cloudinary.js +61 -0
  104. package/lib/module/utils/cloudinary.js.map +1 -0
  105. package/lib/module/utils/storage.js +67 -0
  106. package/lib/module/utils/storage.js.map +1 -0
  107. package/lib/module/utils/textToSpeech.js +43 -0
  108. package/lib/module/utils/textToSpeech.js.map +1 -0
  109. package/lib/typescript/components/LoadingTips.d.ts +3 -0
  110. package/lib/typescript/components/LoadingTips.d.ts.map +1 -0
  111. package/lib/typescript/components/email.d.ts +6 -0
  112. package/lib/typescript/components/email.d.ts.map +1 -0
  113. package/lib/typescript/components/feedback.d.ts +6 -0
  114. package/lib/typescript/components/feedback.d.ts.map +1 -0
  115. package/lib/typescript/components/header.d.ts +3 -0
  116. package/lib/typescript/components/header.d.ts.map +1 -0
  117. package/lib/typescript/components/input.d.ts +6 -0
  118. package/lib/typescript/components/input.d.ts.map +1 -0
  119. package/lib/typescript/components/productCard.d.ts +7 -0
  120. package/lib/typescript/components/productCard.d.ts.map +1 -0
  121. package/lib/typescript/components/progressCircle.d.ts +3 -0
  122. package/lib/typescript/components/progressCircle.d.ts.map +1 -0
  123. package/lib/typescript/components/testing.d.ts +6 -0
  124. package/lib/typescript/components/testing.d.ts.map +1 -0
  125. package/lib/typescript/components/voice.d.ts +5 -0
  126. package/lib/typescript/components/voice.d.ts.map +1 -0
  127. package/lib/typescript/components/welcomeButton.d.ts +4 -0
  128. package/lib/typescript/components/welcomeButton.d.ts.map +1 -0
  129. package/lib/typescript/components/welcomeInput.d.ts +6 -0
  130. package/lib/typescript/components/welcomeInput.d.ts.map +1 -0
  131. package/lib/typescript/contexts/AppContext.d.ts +10 -0
  132. package/lib/typescript/contexts/AppContext.d.ts.map +1 -0
  133. package/lib/typescript/hooks/Stream.d.ts +2 -0
  134. package/lib/typescript/hooks/Stream.d.ts.map +1 -0
  135. package/lib/typescript/hooks/useAsyncStorage.d.ts +2 -0
  136. package/lib/typescript/hooks/useAsyncStorage.d.ts.map +1 -0
  137. package/lib/typescript/index.d.ts +8 -0
  138. package/lib/typescript/index.d.ts.map +1 -0
  139. package/lib/typescript/layout/disclaimer.d.ts +5 -0
  140. package/lib/typescript/layout/disclaimer.d.ts.map +1 -0
  141. package/lib/typescript/layout/ex.d.ts +1 -0
  142. package/lib/typescript/layout/ex.d.ts.map +1 -0
  143. package/lib/typescript/layout/icon.d.ts +3 -0
  144. package/lib/typescript/layout/icon.d.ts.map +1 -0
  145. package/lib/typescript/layout/layout.d.ts +3 -0
  146. package/lib/typescript/layout/layout.d.ts.map +1 -0
  147. package/lib/typescript/layout/welcome.d.ts +6 -0
  148. package/lib/typescript/layout/welcome.d.ts.map +1 -0
  149. package/lib/typescript/layout/window.d.ts +5 -0
  150. package/lib/typescript/layout/window.d.ts.map +1 -0
  151. package/lib/typescript/utils/audioRecorder.d.ts +9 -0
  152. package/lib/typescript/utils/audioRecorder.d.ts.map +1 -0
  153. package/lib/typescript/utils/cloudinary.d.ts +17 -0
  154. package/lib/typescript/utils/cloudinary.d.ts.map +1 -0
  155. package/lib/typescript/utils/storage.d.ts +29 -0
  156. package/lib/typescript/utils/storage.d.ts.map +1 -0
  157. package/lib/typescript/utils/textToSpeech.d.ts +2 -0
  158. package/lib/typescript/utils/textToSpeech.d.ts.map +1 -0
  159. package/package.json +109 -0
  160. package/src/assets/chat-icon-mobile.svg +1 -0
  161. package/src/assets/heritage.png +0 -0
  162. package/src/assets/posiden.svg +51 -0
  163. package/src/components/LoadingTips.js +99 -0
  164. package/src/components/email.js +467 -0
  165. package/src/components/feedback.js +114 -0
  166. package/src/components/header.js +119 -0
  167. package/src/components/input.js +133 -0
  168. package/src/components/productCard.js +815 -0
  169. package/src/components/progressCircle.js +88 -0
  170. package/src/components/testing.js +60 -0
  171. package/src/components/voice.js +228 -0
  172. package/src/components/welcomeButton.js +161 -0
  173. package/src/components/welcomeInput.js +133 -0
  174. package/src/contexts/AppContext.js +678 -0
  175. package/src/hooks/Stream.js +655 -0
  176. package/src/hooks/useAsyncStorage.js +33 -0
  177. package/src/index.js +30 -0
  178. package/src/layout/disclaimer.js +231 -0
  179. package/src/layout/ex.js +252 -0
  180. package/src/layout/icon.js +105 -0
  181. package/src/layout/layout.js +160 -0
  182. package/src/layout/welcome.js +172 -0
  183. package/src/layout/window.js +476 -0
  184. package/src/utils/audioRecorder.js +445 -0
  185. package/src/utils/cloudinary.js +61 -0
  186. package/src/utils/storage.ts +89 -0
  187. package/src/utils/textToSpeech.js +49 -0
@@ -0,0 +1,29 @@
1
+ import { useState, useEffect } from 'react';
2
+ import AsyncStorage from '@react-native-async-storage/async-storage';
3
+ export default function useAsyncStorage(key, defaultValue) {
4
+ const [value, setValue] = useState(defaultValue);
5
+ useEffect(() => {
6
+ const loadValue = async () => {
7
+ try {
8
+ const storedValue = await AsyncStorage.getItem(key);
9
+ if (storedValue !== null) {
10
+ setValue(JSON.parse(storedValue));
11
+ }
12
+ } catch (error) {
13
+ console.error(`Error loading data for key "${key}":`, error);
14
+ }
15
+ };
16
+ loadValue();
17
+ }, [key]);
18
+ const setValueInAsyncStorage = async newValue => {
19
+ try {
20
+ const result = typeof newValue === 'function' ? newValue(value) : newValue;
21
+ setValue(result);
22
+ await AsyncStorage.setItem(key, JSON.stringify(result));
23
+ } catch (error) {
24
+ console.error(`Error saving data for key "${key}":`, error);
25
+ }
26
+ };
27
+ return [value, setValueInAsyncStorage];
28
+ }
29
+ //# sourceMappingURL=useAsyncStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useState","useEffect","AsyncStorage","useAsyncStorage","key","defaultValue","value","setValue","loadValue","storedValue","getItem","JSON","parse","error","console","setValueInAsyncStorage","newValue","result","setItem","stringify"],"sourceRoot":"../../../src","sources":["hooks/useAsyncStorage.js"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,OAAOC,YAAY,MAAM,2CAA2C;AAEpE,eAAe,SAASC,eAAeA,CAACC,GAAG,EAAEC,YAAY,EAAE;EACzD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGP,QAAQ,CAACK,YAAY,CAAC;EAEhDJ,SAAS,CAAC,MAAM;IACd,MAAMO,SAAS,GAAG,MAAAA,CAAA,KAAY;MAC5B,IAAI;QACF,MAAMC,WAAW,GAAG,MAAMP,YAAY,CAACQ,OAAO,CAACN,GAAG,CAAC;QACnD,IAAIK,WAAW,KAAK,IAAI,EAAE;UACxBF,QAAQ,CAACI,IAAI,CAACC,KAAK,CAACH,WAAW,CAAC,CAAC;QACnC;MACF,CAAC,CAAC,OAAOI,KAAK,EAAE;QACdC,OAAO,CAACD,KAAK,CAAC,+BAA+BT,GAAG,IAAI,EAAES,KAAK,CAAC;MAC9D;IACF,CAAC;IAEDL,SAAS,CAAC,CAAC;EACb,CAAC,EAAE,CAACJ,GAAG,CAAC,CAAC;EAET,MAAMW,sBAAsB,GAAG,MAAOC,QAAQ,IAAK;IACjD,IAAI;MACF,MAAMC,MAAM,GAAG,OAAOD,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACV,KAAK,CAAC,GAAGU,QAAQ;MAC1ET,QAAQ,CAACU,MAAM,CAAC;MAChB,MAAMf,YAAY,CAACgB,OAAO,CAACd,GAAG,EAAEO,IAAI,CAACQ,SAAS,CAACF,MAAM,CAAC,CAAC;IACzD,CAAC,CAAC,OAAOJ,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,8BAA8BT,GAAG,IAAI,EAAES,KAAK,CAAC;IAC7D;EACF,CAAC;EAED,OAAO,CAACP,KAAK,EAAES,sBAAsB,CAAC;AACxC","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { View, StyleSheet } from 'react-native';
3
+ import { AppProvider } from './contexts/AppContext';
4
+ import { Layout } from './layout/layout';
5
+ export const Chat = ({
6
+ data,
7
+ onProductCardClick,
8
+ onAddToCartClick,
9
+ uiConfig
10
+ }) => {
11
+ return /*#__PURE__*/React.createElement(AppProvider, {
12
+ data: data,
13
+ onProductCardClick: onProductCardClick,
14
+ onAddToCartClick: onAddToCartClick,
15
+ uiConfig: uiConfig
16
+ }, /*#__PURE__*/React.createElement(View, {
17
+ style: styles.container,
18
+ pointerEvents: "box-none"
19
+ }, /*#__PURE__*/React.createElement(Layout, null)));
20
+ };
21
+ const styles = StyleSheet.create({
22
+ container: {
23
+ flex: 1,
24
+ position: 'absolute',
25
+ top: 0,
26
+ left: 0,
27
+ right: 0,
28
+ bottom: 0,
29
+ zIndex: 1000
30
+ },
31
+ text: {
32
+ fontFamily: "Helvetica Neue" || "sans-serif",
33
+ fontSize: 16
34
+ }
35
+ });
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","StyleSheet","AppProvider","Layout","Chat","data","onProductCardClick","onAddToCartClick","uiConfig","createElement","style","styles","container","pointerEvents","create","flex","position","top","left","right","bottom","zIndex","text","fontFamily","fontSize"],"sourceRoot":"../../src","sources":["index.js"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,MAAM,QAAQ,iBAAiB;AAExC,OAAO,MAAMC,IAAI,GAAGA,CAAC;EAAEC,IAAI;EAAEC,kBAAkB;EAAEC,gBAAgB;EAAEC;AAAS,CAAC,KAAK;EAChF,oBACET,KAAA,CAAAU,aAAA,CAACP,WAAW;IAACG,IAAI,EAAEA,IAAK;IAACC,kBAAkB,EAAEA,kBAAmB;IAACC,gBAAgB,EAAEA,gBAAiB;IAACC,QAAQ,EAAEA;EAAS,gBACtHT,KAAA,CAAAU,aAAA,CAACT,IAAI;IAACU,KAAK,EAAEC,MAAM,CAACC,SAAU;IAACC,aAAa,EAAC;EAAU,gBACrDd,KAAA,CAAAU,aAAA,CAACN,MAAM,MAAC,CACJ,CACK,CAAC;AAElB,CAAC;AAED,MAAMQ,MAAM,GAAGV,UAAU,CAACa,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJC,UAAU,EAAE,gBAAgB,IAAI,YAAY;IAC5CC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,199 @@
1
+ import React, { useContext } from 'react';
2
+ import { View, Text, ScrollView, StyleSheet, TouchableOpacity } from 'react-native';
3
+ import { AppContext } from '../contexts/AppContext';
4
+ import Feather from 'react-native-vector-icons/Feather';
5
+ import { Header } from '../components/header';
6
+ import { Testing } from '../components/testing';
7
+ export const Disclaimer = ({
8
+ panHandlers
9
+ }) => {
10
+ const {
11
+ version,
12
+ setShowModal,
13
+ confirmDisclaimer,
14
+ uiConfig,
15
+ onAddToCartClick,
16
+ onProductCardClick,
17
+ theme
18
+ } = useContext(AppContext);
19
+ const sections = [{
20
+ title: 'General Information',
21
+ details: 'The AI agent is an automated system powered by Instalily. It is designed to provide information and assistance based on HeritagePool+ Suppliers and documentation in product brand manuals. While we strive to provide accurate information through the AI agent, we cannot guarantee the accuracy, completeness, or up-to-date nature of the information provided. We recommend that you use responses as a starting point and verify the information in the linked public documentation sources.',
22
+ icon: 'file-text'
23
+ }, {
24
+ title: 'User Responsibility',
25
+ details: "Users of the AI agent bear sole responsibility for their interactions and reliance on the information provided. It is important to exercise caution and use your discretion while interpreting and acting upon the agent's responses. We cannot be held liable for any actions, losses, or damages resulting from the use of the agent.",
26
+ icon: 'thumbs-up'
27
+ }, {
28
+ title: 'Data Privacy and Security',
29
+ details: "We prioritize the privacy and security of our users' information. Be aware that agent conversations are recorded and stored for later review and quality monitoring by SRS Distribution and its contractors, including by SRS’ content team to improve results. While SRS and the vendor retain logs of these conversations, this data is not used to train their AI models.",
30
+ icon: 'lock'
31
+ }];
32
+ return /*#__PURE__*/React.createElement(View, {
33
+ style: styles.container
34
+ }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Header, null)), /*#__PURE__*/React.createElement(ScrollView, {
35
+ contentContainerStyle: styles.scrollContainer
36
+ }, /*#__PURE__*/React.createElement(View, {
37
+ style: styles.header
38
+ }, /*#__PURE__*/React.createElement(Text, {
39
+ style: styles.welcomeTitle
40
+ }, "Welcome to your AI Agent"), /*#__PURE__*/React.createElement(View, {
41
+ style: styles.betaTag
42
+ }, /*#__PURE__*/React.createElement(Text, {
43
+ style: styles.betaText
44
+ }, "BETA"))), /*#__PURE__*/React.createElement(Text, {
45
+ style: styles.disclaimerText
46
+ }, "The following disclaimer is intended to inform users of the limitations and usage guidelines of the AI agent."), /*#__PURE__*/React.createElement(Text, {
47
+ style: styles.disclaimerText
48
+ }, "Please read this disclaimer carefully before engaging with the agent."), sections.map((section, index) => /*#__PURE__*/React.createElement(Paragraph, {
49
+ key: index,
50
+ title: section.title,
51
+ details: section.details,
52
+ icon: section.icon,
53
+ theme: theme
54
+ })), /*#__PURE__*/React.createElement(Text, {
55
+ style: styles.disclaimerText
56
+ }, "Do not share any sensitive or personal information in your conversations."), /*#__PURE__*/React.createElement(Text, {
57
+ style: styles.disclaimerText
58
+ }, "By using our AI agent, you indicate your acceptance and understanding of the above disclaimer. If you do not agree with any part of this disclaimer, we recommend refraining from using the agent. For further assistance or inquiries, please contact", ' ', /*#__PURE__*/React.createElement(Text, {
59
+ style: styles.boldText
60
+ }, "srs@instalily.ai"), ".")), uiConfig.testButtons && /*#__PURE__*/React.createElement(Testing, {
61
+ onProductCardClick: onProductCardClick,
62
+ onAddToCartClick: onAddToCartClick
63
+ }), /*#__PURE__*/React.createElement(View, {
64
+ style: styles.confirmArea
65
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
66
+ style: [styles.button, {
67
+ backgroundColor: theme.primaryColor
68
+ }],
69
+ onPress: confirmDisclaimer
70
+ }, /*#__PURE__*/React.createElement(Text, {
71
+ style: styles.buttonText
72
+ }, "Confirm")), /*#__PURE__*/React.createElement(Text, {
73
+ style: styles.confirmText
74
+ }, `By clicking the "Confirm" button above, you understand and confirm
75
+ that your use of ${version === 'pool' ? 'HeritagePool+' : 'Heritage+'} AI Agent is subject to our current Terms of
76
+ Service and Privacy Policy, and you confirm your understanding of the
77
+ above.`)));
78
+ };
79
+ const Paragraph = ({
80
+ title,
81
+ details,
82
+ icon,
83
+ theme
84
+ }) => {
85
+ return /*#__PURE__*/React.createElement(View, {
86
+ style: styles.sectionContainer
87
+ }, /*#__PURE__*/React.createElement(View, {
88
+ style: [styles.iconContainer, {
89
+ backgroundColor: `${theme.primaryColor}20`
90
+ }]
91
+ }, /*#__PURE__*/React.createElement(Feather, {
92
+ name: icon,
93
+ size: 18,
94
+ color: (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1976d2'
95
+ })), /*#__PURE__*/React.createElement(View, {
96
+ style: styles.textContainer
97
+ }, /*#__PURE__*/React.createElement(Text, {
98
+ style: styles.sectionTitle
99
+ }, title), /*#__PURE__*/React.createElement(Text, {
100
+ style: styles.sectionDetails
101
+ }, details)));
102
+ };
103
+ const styles = StyleSheet.create({
104
+ container: {
105
+ flex: 1
106
+ },
107
+ scrollContainer: {
108
+ paddingBottom: 20,
109
+ padding: 20
110
+ },
111
+ header: {
112
+ flexDirection: 'row',
113
+ alignItems: 'center',
114
+ marginBottom: 10
115
+ },
116
+ welcomeTitle: {
117
+ fontSize: 18,
118
+ fontWeight: '500',
119
+ color: '#161616'
120
+ },
121
+ betaTag: {
122
+ backgroundColor: '#f6921e',
123
+ borderRadius: 8,
124
+ paddingHorizontal: 10,
125
+ paddingVertical: 4,
126
+ marginLeft: 10
127
+ },
128
+ betaText: {
129
+ color: '#ffffff',
130
+ fontSize: 11,
131
+ fontWeight: '500'
132
+ },
133
+ disclaimerText: {
134
+ fontSize: 13,
135
+ color: '#505050',
136
+ lineHeight: 18,
137
+ marginBottom: 8
138
+ },
139
+ boldText: {
140
+ fontWeight: 'bold'
141
+ },
142
+ sectionContainer: {
143
+ flexDirection: 'row',
144
+ alignItems: 'flex-start',
145
+ backgroundColor: '#fff',
146
+ padding: 12,
147
+ marginBottom: 10,
148
+ borderRadius: 10,
149
+ elevation: 1
150
+ },
151
+ iconContainer: {
152
+ borderRadius: 10,
153
+ padding: 10,
154
+ alignItems: 'center',
155
+ justifyContent: 'center',
156
+ marginRight: 10
157
+ },
158
+ textContainer: {
159
+ flex: 1
160
+ },
161
+ sectionTitle: {
162
+ fontSize: 14,
163
+ fontWeight: '500',
164
+ color: '#161616',
165
+ marginBottom: 3
166
+ },
167
+ sectionDetails: {
168
+ fontSize: 12,
169
+ color: '#505050',
170
+ lineHeight: 18
171
+ },
172
+ confirmArea: {
173
+ alignItems: 'center',
174
+ padding: 20,
175
+ backgroundColor: '#f6f6f6',
176
+ borderTopWidth: 1,
177
+ borderTopColor: 'rgba(0, 0, 0, 0.1)',
178
+ paddingBottom: 25
179
+ },
180
+ button: {
181
+ width: '100%',
182
+ paddingVertical: 12,
183
+ borderRadius: 5,
184
+ alignItems: 'center',
185
+ marginBottom: 10
186
+ },
187
+ buttonText: {
188
+ color: '#FFFFFF',
189
+ fontSize: 16,
190
+ fontWeight: '500'
191
+ },
192
+ confirmText: {
193
+ fontSize: 11,
194
+ color: 'gray',
195
+ lineHeight: 16,
196
+ paddingHorizontal: 10
197
+ }
198
+ });
199
+ //# sourceMappingURL=disclaimer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useContext","View","Text","ScrollView","StyleSheet","TouchableOpacity","AppContext","Feather","Header","Testing","Disclaimer","panHandlers","version","setShowModal","confirmDisclaimer","uiConfig","onAddToCartClick","onProductCardClick","theme","sections","title","details","icon","createElement","style","styles","container","contentContainerStyle","scrollContainer","header","welcomeTitle","betaTag","betaText","disclaimerText","map","section","index","Paragraph","key","boldText","testButtons","confirmArea","button","backgroundColor","primaryColor","onPress","buttonText","confirmText","sectionContainer","iconContainer","name","size","color","textContainer","sectionTitle","sectionDetails","create","flex","paddingBottom","padding","flexDirection","alignItems","marginBottom","fontSize","fontWeight","borderRadius","paddingHorizontal","paddingVertical","marginLeft","lineHeight","elevation","justifyContent","marginRight","borderTopWidth","borderTopColor","width"],"sourceRoot":"../../../src","sources":["layout/disclaimer.js"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,UAAU,EACVC,gBAAgB,QACX,cAAc;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;IACZC,UAAU,EAAE,KAAK;IACjBZ,KAAK,EAAE,SAAS;IAChBU,YAAY,EAAE;EAChB,CAAC;EACDP,cAAc,EAAE;IACdQ,QAAQ,EAAE,EAAE;IACZX,KAAK,EAAE,SAAS;IAChBiB,UAAU,EAAE;EACd,CAAC;EACD5B,WAAW,EAAE;IACXoB,UAAU,EAAE,QAAQ;IACpBF,OAAO,EAAE,EAAE;IACXhB,eAAe,EAAE,SAAS;IAC1B8B,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE,oBAAoB;IACpChB,aAAa,EAAE;EACjB,CAAC;EACDhB,MAAM,EAAE;IACNiC,KAAK,EAAE,MAAM;IACbR,eAAe,EAAE,EAAE;IACnBF,YAAY,EAAE,CAAC;IACfJ,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAE;EAChB,CAAC;EACDhB,UAAU,EAAE;IACVM,KAAK,EAAE,SAAS;IAChBW,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDjB,WAAW,EAAE;IACXgB,QAAQ,EAAE,EAAE;IACZX,KAAK,EAAE,MAAM;IACbiB,UAAU,EAAE,EAAE;IACdH,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,253 @@
1
+ // import React, { useState, useEffect, useContext, useRef } from 'react';
2
+ // import { Text, StyleSheet, View, TextInput, TouchableOpacity, Platform, KeyboardAvoidingView,
3
+ // Keyboard, Animated, PanResponder, Pressable } from 'react-native';
4
+ // import { Header } from '../components/header';
5
+ // import { AppContext } from '../contexts/AppContext';
6
+ // import Ionicons from 'react-native-vector-icons/Ionicons';
7
+ // import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
8
+ // import { Testing } from '../components/testing';
9
+ // import { ChatInput } from '../components/input';
10
+ // import { useWebSocketMessage } from '../hooks/Stream';
11
+ // import { ProductCard } from '../components/productCard'
12
+ // import Markdown from 'react-native-markdown-display';
13
+
14
+ // export const ChatWindow = () => {
15
+ // const { handleSend, messages, input, setInput, ghostMessage, handleButtonClick, setShowModal } = useContext(AppContext);
16
+
17
+ // const scrollViewRef = useRef(null);
18
+ // const fadeAnim = useRef(new Animated.Value(0.6)).current;
19
+ // const panY = useRef(new Animated.Value(0)).current;
20
+ // const isDragging = useRef(false);
21
+
22
+ // useEffect(() => {
23
+ // if (scrollViewRef.current) {
24
+ // setTimeout(() => {
25
+ // scrollViewRef.current.scrollToEnd({ animated: false });
26
+ // }, 100);
27
+ // }
28
+ // }, []);
29
+
30
+ // useEffect(() => {
31
+ // if (ghostMessage) {
32
+ // Animated.loop(
33
+ // Animated.sequence([
34
+ // Animated.timing(fadeAnim, { toValue: 1, duration: 500, useNativeDriver: false }),
35
+ // Animated.timing(fadeAnim, { toValue: 0.6, duration: 500, useNativeDriver: false }),
36
+ // ])
37
+ // ).start();
38
+ // }
39
+ // }, [ghostMessage]);
40
+
41
+ // useWebSocketMessage()
42
+
43
+ // const headerPanResponder = PanResponder.create({
44
+ // onStartShouldSetPanResponder: () => true,
45
+ // onMoveShouldSetPanResponder: () => true,
46
+ // onPanResponderGrant: () => {
47
+ // isDragging.current = true;
48
+ // },
49
+ // onPanResponderMove: (evt, gestureState) => {
50
+ // if (isDragging.current && gestureState.dy > 0) { // Downward swipe
51
+ // panY.setValue(gestureState.dy);
52
+ // }
53
+ // },
54
+ // onPanResponderRelease: (evt, gestureState) => {
55
+ // if (gestureState.dy > 100) { // Swiped down enough
56
+ // handleClick()
57
+ // } else {
58
+ // Animated.spring(panY, { toValue: 0, useNativeDriver: false }).start();
59
+ // }
60
+ // isDragging.current = false;
61
+ // },
62
+ // });
63
+
64
+ // const handleClick = () => {
65
+ // if ((uiConfig.showIcon ?? true) !== true) {
66
+ // setShowModal("Off");
67
+ // } else {
68
+ // setShowModal("Icon");
69
+ // }
70
+ // };
71
+
72
+ // return (
73
+ // <View style={styles.overlay}>
74
+ // {/* Click outside chat to close */}
75
+ // <Pressable style={styles.outsideTouchable} onPress={() => handleClick()} />
76
+
77
+ // <Animated.View style={[styles.container, { transform: [{ translateY: panY }] }]}>
78
+ // {/* Header - Only this section triggers drag-to-close */}
79
+ // <View style={styles.headerContainer} {...headerPanResponder.panHandlers}>
80
+ // <Header />
81
+ // </View>
82
+
83
+ // {/* Messages area */}
84
+ // <KeyboardAwareScrollView
85
+ // ref={scrollViewRef}
86
+ // contentContainerStyle={styles.messagesContent}
87
+ // enableOnAndroid
88
+ // contentInsetAdjustmentBehavior="never"
89
+ // automaticallyAdjustContentInsets={false}
90
+ // contentInset={{ bottom: 0 }}
91
+ // keyboardShouldPersistTaps="always"
92
+ // showsVerticalScrollIndicator={false}
93
+ // extraScrollHeight={0}
94
+ // onContentSizeChange={() => {
95
+ // scrollViewRef.current?.scrollToEnd({ animated: true });
96
+ // }}
97
+ // >
98
+ // {messages.map((msg, i) => (
99
+
100
+ // <View key={i} style={styles.messageWrapper}>
101
+ // {msg.type !== "middle" && (
102
+ // <View style={[ styles.messageBubble, msg.type === "user" ? styles.userMessage : styles.aiMessage,]}>
103
+ // <Markdown style={{ body: { color: msg.type === "user" ? "#ffffff" : "#161616",fontSize: 16, lineHeight: 22 }}}>
104
+ // {msg.text}
105
+ // </Markdown>
106
+ // </View>
107
+ // )}
108
+
109
+ // {msg.products && msg.products.length > 0 &&
110
+ // msg.products.map((prod, index) => (
111
+ // <View key={index} style={styles.productCardWrapper}>
112
+ // <ProductCard prod={prod} />
113
+ // </View>
114
+ // ))}
115
+
116
+ // {msg.suggested_questions && Array.isArray(msg.questions) && msg.questions.map((question, index) => (
117
+ // <TouchableOpacity key={index} style={styles.suggestedQuestionButton}
118
+ // onPress={() => handleButtonClick(question)}>
119
+ // <Text style={styles.suggestedQuestionText}>{question}</Text>
120
+ // </TouchableOpacity>
121
+ // ))}
122
+
123
+ // {ghostMessage && i === messages.length - 1 && (
124
+ // <View style={styles.ghostMessageContainer}>
125
+ // <Animated.View style={[styles.ghostBar, styles.ghostBarShort, { opacity: fadeAnim }]} />
126
+ // <Animated.View style={[styles.ghostBar, styles.ghostBarLong, { opacity: fadeAnim }]} />
127
+ // <Animated.View style={[styles.ghostBar, styles.ghostBarMedium, { opacity: fadeAnim }]} />
128
+ // </View>
129
+ // )}
130
+ // </View>
131
+ // ))}
132
+
133
+ // <KeyboardAvoidingView
134
+ // behavior={Platform.OS === 'ios' ? 'padding' : undefined}
135
+ // keyboardVerticalOffset={Platform.OS === 'ios' ? 120 : 60}
136
+ // >
137
+ // <ChatInput/>
138
+ // </KeyboardAvoidingView>
139
+ // </KeyboardAwareScrollView>
140
+
141
+ // </Animated.View>
142
+ // </View>
143
+ // );
144
+ // };
145
+
146
+ // const styles = StyleSheet.create({
147
+ // overlay: {
148
+ // flex: 1,
149
+ // position: 'absolute',
150
+ // left: 0,
151
+ // right: 0,
152
+ // top: 0,
153
+ // bottom: 0,
154
+ // backgroundColor: 'rgba(0, 0, 0, 0.3)',
155
+ // justifyContent: 'flex-end',
156
+ // },
157
+ // outsideTouchable: {
158
+ // flex: 1, // Takes up the space above the chat, allows clicking to close
159
+ // },
160
+ // container: {
161
+ // flex: 1,
162
+ // backgroundColor: '#f6f6f6',
163
+ // position: 'absolute',
164
+ // zIndex: 1000,
165
+ // left: 0,
166
+ // right: 0,
167
+ // bottom: 0,
168
+ // top: 140,
169
+ // pointerEvents: 'box-none',
170
+ // borderTopWidth: 1,
171
+ // borderTopColor: '#DDD',
172
+ // borderTopLeftRadius: 16,
173
+ // borderTopRightRadius: 16,
174
+ // overflow: 'hidden',
175
+ // },
176
+ // headerContainer: {
177
+ // alignItems: "center",
178
+ // backgroundColor: "#f6f6f6",
179
+ // borderTopLeftRadius: 16,
180
+ // borderTopRightRadius: 16,
181
+ // },
182
+ // messagesContent: {
183
+ // padding: 16,
184
+ // justifyContent: 'flex-end',
185
+ // },
186
+ // messageWrapper: {
187
+ // marginBottom: 0,
188
+ // },
189
+ // messageBubble: {
190
+ // padding: 6,
191
+ // paddingHorizontal: 16,
192
+ // borderRadius: 12,
193
+ // marginBottom: 5
194
+ // },
195
+ // userMessage: {
196
+ // alignSelf: 'flex-end',
197
+ // backgroundColor: "#003764",
198
+ // color: "#ffffff"
199
+ // },
200
+ // aiMessage: {
201
+ // alignSelf: 'flex-start',
202
+ // backgroundColor: '#FFFFFF',
203
+ // width: '100%',
204
+ // },
205
+ // productCardWrapper: {
206
+ // marginTop: 5,
207
+ // },
208
+ // suggestedQuestionButton: {
209
+ // backgroundColor: "white",
210
+ // borderWidth: 1,
211
+ // borderColor: "#437D3D",
212
+ // borderRadius: 18,
213
+ // paddingVertical: 10,
214
+ // paddingHorizontal: 16,
215
+ // marginBottom: 7,
216
+ // alignSelf: "flex-start",
217
+ // },
218
+ // suggestedQuestionText: {
219
+ // color: "#437D3D",
220
+ // fontSize: 13,
221
+ // textAlign: "left",
222
+ // },
223
+ // ghostMessageContainer: {
224
+ // alignSelf: 'flex-start',
225
+ // width: '100%',
226
+ // backgroundColor: "#FFFFFF",
227
+ // borderRadius: 10,
228
+ // borderTopLeftRadius: 0,
229
+ // padding: 14,
230
+ // marginVertical: 5,
231
+ // },
232
+ // ghostBar: {
233
+ // height: 20,
234
+ // borderRadius: 10,
235
+ // backgroundColor: "#ebebeb",
236
+ // marginVertical: 3,
237
+ // },
238
+ // ghostBarShort: {
239
+ // width: "50%",
240
+ // },
241
+ // ghostBarMedium: {
242
+ // width: "75%",
243
+ // },
244
+ // ghostBarLong: {
245
+ // width: "100%",
246
+ // },
247
+ // });
248
+
249
+ // {/* <Testing
250
+ // onProductCardClick={onProductCardClick}
251
+ // onAddToCartClick={onAddToCartClick}
252
+ // /> */}
253
+ //# sourceMappingURL=ex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["layout/ex.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,108 @@
1
+ import React, { useContext } from 'react';
2
+ import { TouchableOpacity, View, StyleSheet, Text } from 'react-native';
3
+ import { AppContext } from '../contexts/AppContext';
4
+ import Ionicons from 'react-native-vector-icons/Ionicons';
5
+ // import { SvgCssUri } from 'react-native-svg/css';
6
+ import CloudinaryImage from '../utils/cloudinary';
7
+ export const ChatIcon = () => {
8
+ var _uiConfig$iconPositio, _uiConfig$iconPositio2;
9
+ const {
10
+ setShowModal,
11
+ messages,
12
+ maintenance,
13
+ disclaimer,
14
+ uiConfig
15
+ } = useContext(AppContext);
16
+
17
+ // Determine position from uiConfig or default
18
+ const iconPosition = {
19
+ top: (uiConfig === null || uiConfig === void 0 || (_uiConfig$iconPositio = uiConfig.iconPosition) === null || _uiConfig$iconPositio === void 0 ? void 0 : _uiConfig$iconPositio.top) ?? 50,
20
+ right: (uiConfig === null || uiConfig === void 0 || (_uiConfig$iconPositio2 = uiConfig.iconPosition) === null || _uiConfig$iconPositio2 === void 0 ? void 0 : _uiConfig$iconPositio2.right) ?? 20
21
+ };
22
+
23
+ // Determine icon type (bubble or tab)
24
+ const iconType = (uiConfig === null || uiConfig === void 0 ? void 0 : uiConfig.iconType) ?? 'bubble';
25
+ const handleClick = () => {
26
+ if (!disclaimer) {
27
+ setShowModal("Form");
28
+ } else {
29
+ if (messages.length > 1 || maintenance) {
30
+ // console.log("UI Config", uiConfig.showWelcome)
31
+ setShowModal("ChatWindow");
32
+ } else {
33
+ setShowModal("Welcome");
34
+ }
35
+ }
36
+ };
37
+
38
+ // Different styles for bubble and tab
39
+ const containerStyle = iconType === 'tab' ? [styles.tabContainer, iconPosition] : [styles.bubbleContainer, iconPosition];
40
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
41
+ style: containerStyle,
42
+ onPress: handleClick,
43
+ activeOpacity: 0.7
44
+ }, /*#__PURE__*/React.createElement(View, {
45
+ style: styles.iconContent
46
+ }, /*#__PURE__*/React.createElement(CloudinaryImage, {
47
+ cldImg: "chat-icon-mobile",
48
+ imageStyle: {
49
+ width: 44,
50
+ height: 44
51
+ }
52
+ }), iconType === 'tab' && /*#__PURE__*/React.createElement(Text, {
53
+ style: styles.tabText
54
+ }, "Chat with Heritage")));
55
+ };
56
+ const styles = StyleSheet.create({
57
+ // Bubble Style
58
+ bubbleContainer: {
59
+ position: 'absolute',
60
+ width: 60,
61
+ height: 60,
62
+ borderRadius: 30,
63
+ alignItems: 'center',
64
+ justifyContent: 'center',
65
+ zIndex: 10,
66
+ shadowColor: '#000',
67
+ shadowOffset: {
68
+ width: 0,
69
+ height: 2
70
+ },
71
+ shadowOpacity: 0.2,
72
+ shadowRadius: 3,
73
+ elevation: 5
74
+ },
75
+ // Tab Style
76
+ tabContainer: {
77
+ position: 'absolute',
78
+ width: 130,
79
+ height: 50,
80
+ borderTopLeftRadius: 25,
81
+ borderBottomLeftRadius: 25,
82
+ backgroundColor: '#367CB6',
83
+ flexDirection: 'row',
84
+ alignItems: 'center',
85
+ paddingHorizontal: 15,
86
+ justifyContent: 'flex-start',
87
+ zIndex: 10,
88
+ shadowColor: '#000',
89
+ shadowOffset: {
90
+ width: 0,
91
+ height: 2
92
+ },
93
+ shadowOpacity: 0.2,
94
+ shadowRadius: 3,
95
+ elevation: 5
96
+ },
97
+ iconContent: {
98
+ flexDirection: 'row',
99
+ alignItems: 'center'
100
+ },
101
+ tabText: {
102
+ color: 'white',
103
+ fontSize: 14,
104
+ fontWeight: '500',
105
+ marginLeft: 8
106
+ }
107
+ });
108
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useContext","TouchableOpacity","View","StyleSheet","Text","AppContext","Ionicons","CloudinaryImage","ChatIcon","_uiConfig$iconPositio","_uiConfig$iconPositio2","setShowModal","messages","maintenance","disclaimer","uiConfig","iconPosition","top","right","iconType","handleClick","length","containerStyle","styles","tabContainer","bubbleContainer","createElement","style","onPress","activeOpacity","iconContent","cldImg","imageStyle","width","height","tabText","create","position","borderRadius","alignItems","justifyContent","zIndex","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderTopLeftRadius","borderBottomLeftRadius","backgroundColor","flexDirection","paddingHorizontal","color","fontSize","fontWeight","marginLeft"],"sourceRoot":"../../../src","sources":["layout/icon.js"],"mappings":"AAAA,OAAOA,KAA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