@bcrumbs.net/bc-chat 1.0.13 â 1.0.14
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/build/index.es.js +52 -46
- package/build/index.es.js.map +1 -1
- package/build/index.js +52 -46
- package/build/index.js.map +1 -1
- package/package.json +2 -1
package/build/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEffect as a,useRef as o,useCallback as r,useState as c}from"react";import s from"@emotion/styled";import l from"react-markdown";import{v4 as
|
|
2
|
-
background-image: ${e=>
|
|
3
|
-
color: ${e=>
|
|
4
|
-
border-color: ${e=>
|
|
1
|
+
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEffect as a,useRef as o,useCallback as r,useState as c}from"react";import s from"@emotion/styled";import l from"react-markdown";import d from"mic-recorder-to-mp3";import{v4 as g}from"uuid";import{BlobServiceClient as p,AnonymousCredential as b}from"@azure/storage-blob";const h={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhClpnG8aBzsTHugbgsLltiJg/6NI3J5pLFLbpIIjEjLuriiH9qnESlI6BQWcGsSEvT2lK8q0CvFChme1hwXs5tKfTWXfT83s6fe3Lz6fn9zvl9f7eL9L/u/xvPuS0GNQqBQqAQKAQKYaYlzfdBk0qPtzRFnL7L7ttoGLzz/EBQSlNRrMzj9HUzA9QdaEygECgECoFCoBAoB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SME7/H/iylAv4QLTN0I+8fWyq1OcypJMIsXh14zY0tFEjDXet6Pxvv1xbiFLWgr3eBB3JtmI65WnKLD/za0xaxeiuSwVK/NwrHgT57SYaZaxAMyjvlkBfF1u4k2Svr/dLEhVSlAIVr+d0y5TF+KYYeu8lZ9d6uKIAFo93YJJ7oK6Q2PfNaKSpJNrcLSyDpcc7TjtuhmT+mxS6fHhK5XIkPHD6wu4sdd2XrD3Fjwm7Gw/iWOGrYQgWq01oFprgI9l0D3kgD80DEfQj+DUBFTJqVBKU5GTqkKRUhdVH+gLuLGz/aSgxVnBIQxNTUYEAfxbbY70C89mrZ5u7LWdF7w6nZDAODQ1ifctDThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",x=["đ¤","đ","đ","âšī¸","đ˛","đŗ","đ ","đ","đ","đ","đ","đ¤Ŗ","đ","đ","đ
","đ","đ","đ","đ","đŖ","đĨ","đŽ","đ´","đ","đ","đ","đ","đ","đ¤","đ¤","đ","đ","đļ","đ"];function u(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function C(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function f(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const w=({message:n})=>e("div",{className:"bc-mediaMessage"+("audio"===n.type?" audio":""),style:{padding:0},children:e("video",{src:n.content,controls:!0})}),v=s.div`
|
|
2
|
+
background-image: ${e=>u(e)};
|
|
3
|
+
color: ${e=>f(e)};
|
|
4
|
+
border-color: ${e=>C(e)};
|
|
5
5
|
border-width: 1px;
|
|
6
6
|
border-style: solid;
|
|
7
7
|
:hover {
|
|
@@ -11,23 +11,23 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
11
11
|
-ms-filter: brightness(80%);
|
|
12
12
|
filter: brightness(80%);
|
|
13
13
|
}
|
|
14
|
-
`;const
|
|
14
|
+
`;const A=s.i`
|
|
15
15
|
background-image: ${e=>`url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.51194%203.00541C9.18829%202.54594%2010.0435%202.53694%2010.6788%202.95419C10.8231%203.04893%2010.9771%203.1993%2011.389%203.61119C11.8009%204.02307%2011.9513%204.17714%2012.046%204.32141C12.4633%204.95675%2012.4543%205.81192%2011.9948%206.48827C11.8899%206.64264%2011.7276%206.80811%2011.3006%207.23511L10.6819%207.85383C10.4867%208.04909%2010.4867%208.36567%2010.6819%208.56093C10.8772%208.7562%2011.1938%208.7562%2011.389%208.56093L12.0077%207.94221L12.0507%207.89929C12.4203%207.52976%2012.6568%207.2933%2012.822%207.0502C13.4972%206.05623%2013.5321%204.76252%2012.8819%203.77248C12.7233%203.53102%2012.4922%203.30001%2012.1408%202.94871L12.0961%202.90408L12.0515%202.85942C11.7002%202.508%2011.4692%202.27689%2011.2277%202.11832C10.2377%201.46813%208.94398%201.50299%207.95001%202.17822C7.70691%202.34336%207.47044%202.57991%207.1009%202.94955L7.058%202.99247L6.43928%203.61119C6.24401%203.80645%206.24401%204.12303%206.43928%204.31829C6.63454%204.51355%206.95112%204.51355%207.14638%204.31829L7.7651%203.69957C8.1921%203.27257%208.35757%203.11027%208.51194%203.00541ZM4.31796%207.14672C4.51322%206.95146%204.51322%206.63487%204.31796%206.43961C4.12269%206.24435%203.80611%206.24435%203.61085%206.43961L2.99213%207.05833L2.94922%207.10124C2.57957%207.47077%202.34303%207.70724%202.17788%207.95035C1.50265%208.94432%201.4678%2010.238%202.11799%2011.2281C2.27656%2011.4695%202.50766%2011.7005%202.8591%2012.0518L2.90374%2012.0965L2.94837%2012.1411C3.29967%2012.4925%203.53068%2012.7237%203.77214%2012.8822C4.76219%2013.5324%206.05589%2013.4976%207.04986%2012.8223C7.29296%2012.6572%207.52943%2012.4206%207.89896%2012.051L7.89897%2012.051L7.94188%2012.0081L8.5606%2011.3894C8.75586%2011.1941%208.75586%2010.8775%208.5606%2010.6823C8.36533%2010.487%208.04875%2010.487%207.85349%2010.6823L7.23477%2011.301C6.80777%2011.728%206.6423%2011.8903%206.48794%2011.9951C5.81158%2012.4546%204.95642%2012.4636%204.32107%2012.0464C4.17681%2011.9516%204.02274%2011.8012%203.61085%2011.3894C3.19896%2010.9775%203.0486%2010.8234%202.95385%2010.6791C2.53661%2010.0438%202.54561%209.18863%203.00507%208.51227C3.10993%208.35791%203.27224%208.19244%203.69924%207.76544L4.31796%207.14672ZM9.62172%206.08558C9.81698%205.89032%209.81698%205.57373%209.62172%205.37847C9.42646%205.18321%209.10988%205.18321%208.91461%205.37847L5.37908%208.91401C5.18382%209.10927%205.18382%209.42585%205.37908%209.62111C5.57434%209.81637%205.89092%209.81637%206.08619%209.62111L9.62172%206.08558Z%22%20fill%3D%22%23${e.color}%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E")`};
|
|
16
16
|
width: 24px;
|
|
17
17
|
background-position: center;
|
|
18
18
|
background-size: contain;
|
|
19
19
|
background-repeat: no-repeat;
|
|
20
|
-
`,
|
|
20
|
+
`,I=s.a`
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: row;
|
|
23
23
|
align-item: center;
|
|
24
24
|
text-decoration: auto;
|
|
25
25
|
gap: 5px;
|
|
26
|
-
color: ${e=>`${
|
|
27
|
-
`,
|
|
28
|
-
background-image: ${e=>
|
|
29
|
-
color: ${e=>
|
|
30
|
-
border-color: ${e=>
|
|
26
|
+
color: ${e=>`${f(e)}`};
|
|
27
|
+
`,M=s.a`
|
|
28
|
+
background-image: ${e=>u(e)};
|
|
29
|
+
color: ${e=>f(e)};
|
|
30
|
+
border-color: ${e=>C(e)};
|
|
31
31
|
border-width: 1px;
|
|
32
32
|
border-style: solid;
|
|
33
33
|
:hover {
|
|
@@ -37,21 +37,21 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
37
37
|
-ms-filter: brightness(80%);
|
|
38
38
|
filter: brightness(80%);
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`,y=s.div`
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: row;
|
|
43
43
|
align-items: center;
|
|
44
44
|
gap: 5px;
|
|
45
|
-
`,
|
|
45
|
+
`,k=s.span`
|
|
46
46
|
color: ${e=>e.color};
|
|
47
|
-
`;const
|
|
47
|
+
`;const L=s.i`
|
|
48
48
|
background-image: ${e=>`url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22currentColor%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22%23${e.color}%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E")`};
|
|
49
49
|
background-position: center;
|
|
50
50
|
background-size: contain;
|
|
51
51
|
background-repeat: no-repeat;
|
|
52
52
|
width: 15px;
|
|
53
53
|
height: 15px;
|
|
54
|
-
`,
|
|
54
|
+
`,E={document:({message:t})=>{let i=t.content.split("/"),a=i[i.length-1];return e(v,{className:"bc-fileMessage",...t,children:n(I,{href:t.content,target:"_blank",download:a,rel:"noopener noreferrer",...t,children:[e(A,{color:(o=t,o.isAgent,"000000")}),e("span",{children:a})]})});var o},image:({message:n})=>e("div",{className:"bc-mediaMessage",style:{backgroundImage:u(n),color:f(n),borderColor:C(n),borderWidth:"1px",borderStyle:"solid",padding:0},children:e("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e("img",{src:n.content,alt:"message content"})})}),location:({message:t})=>{return e(M,{href:"https://www.google.com/maps/?q="+t.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:t.isAgent,children:n(y,{children:[e(L,{color:(i=t,i.isAgent,"000000")}),e(k,{color:f(t),children:"Open location"})]})});var i},text:({message:n})=>e("div",{style:{backgroundImage:u(n),color:f(n),borderColor:C(n),borderWidth:"1px",borderStyle:"solid"},children:(n.content&&n.content.indexOf("\n")>-1?n.content.split("\n"):[n.content]).map((n=>e(l,{children:n})))}),video:w,audio:w,interactive:null,template:null,note:({message:n})=>e("div",{className:"bc-note",children:n.content})},S=s.div`
|
|
55
55
|
display: flex;
|
|
56
56
|
flex-direction: column;
|
|
57
57
|
gap: 5px;
|
|
@@ -60,8 +60,8 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
60
60
|
margin: ${e=>e.isAgent?"0 40px 0 20px":"0 20px 0 40px"};
|
|
61
61
|
text-align: ${e=>e.isAgent?"left":"right"};
|
|
62
62
|
}
|
|
63
|
-
`;function
|
|
64
|
-
background-image: url(${e=>e.brandLogo||
|
|
63
|
+
`;function D({message:t}){const{debug:i,conversationId:a,traceId:o,spanId:r,isAgent:c}=t;return i?e(S,{isAgent:c,className:"bc-debugCon",children:n("div",{children:[n("div",{className:"bc-response-debug",children:["Trace id: ",e("span",{children:o})]}),n("div",{className:"bc-response-debug",children:["Span id: ",e("span",{children:r})]}),n("div",{className:"bc-response-debug",children:["Conversation id: ",e("span",{children:a})]})]})}):null}function z(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}z(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm); }\n .bc-agentMessage div p,\n .bc-clientMessage div p {\n padding: 0;\n margin: 0; }\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent; }\n\n.bc-agentMessage .bc-note,\n.bc-clientMessage .bc-note {\n background-color: #f9f9f9 !important;\n /* Light background */\n border: 1px solid var(--bc-chat-agent-message-border-color); }\n\n.bc-agentMessage .bc-fileMessage,\n.bc-clientMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-locationMessage img,\n .bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n .bc-agentMessage > div:not(.bc-debugCon),\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage,\n .bc-agentMessage audio {\n border-bottom-left-radius: 0; }\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%; }\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right; }\n .bc-clientMessage > div:not(.bc-debugCon),\n .bc-clientMessage .bc-fileMessage,\n .bc-clientMessage .bc-locationMessage,\n .bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0; }\n .bc-clientMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n width: 300px;\n margin-bottom: -5px; }\n\n.bc-mediaMessage.audio video {\n height: 40px; }\n\n.bc-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0; }\n .bc-response-debug span {\n text-decoration: underline; }\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap; }\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%; }\n\n.bc-debug-panel {\n border-radius: 10px;\n box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.15);\n border: solid 1px #ffffff;\n background-color: #ffffff;\n color: var(--bc-chat-dark-gray-color);\n display: table;\n width: calc(100% - 40px);\n margin: 10px -40px 10px 0;\n text-align: left;\n padding: 8px;\n max-width: 310px; }\n\n.bc-exception-debug {\n color: #f5a623;\n position: relative; }\n .bc-exception-debug .bc-exception-icon {\n width: 30px;\n position: absolute;\n top: 3px;\n left: 10px; }\n .bc-exception-debug span {\n margin-left: 40px; }\n\n.bc-parameters-debug span {\n text-decoration: underline; }\n\n.bc-parameters-debug .bc-parameters-title {\n width: 100%;\n border-bottom: solid 1px #f3f3f3;\n text-align: left;\n font-weight: bold;\n margin-bottom: 6px; }\n\n.bc-debugCon {\n width: 100%; }\n");const B=s.i`
|
|
64
|
+
background-image: url(${e=>e.brandLogo||m});
|
|
65
65
|
width: 30px;
|
|
66
66
|
height: 30px;
|
|
67
67
|
background-position: center;
|
|
@@ -69,7 +69,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
69
69
|
display: inline-block;
|
|
70
70
|
border-radius: 50%;
|
|
71
71
|
background-repeat: no-repeat;
|
|
72
|
-
`;function
|
|
72
|
+
`;function F(e,n){return n?"bc-agentMessage":"bc-clientMessage"}const N=t=>{const{type:i,isAgent:a}=t.message,o=E[i]??null;return o?n("div",{className:F(0,a),children:[a?e(B,{brandLogo:t.config?.brandLogo}):null,e(o,{message:t.message}),e(D,{message:t.message})]}):null},Z=s.div`
|
|
73
73
|
width: 100%;
|
|
74
74
|
display: flex;
|
|
75
75
|
align-items: center;
|
|
@@ -82,7 +82,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
82
82
|
align-items: center;
|
|
83
83
|
${e=>e.isAgent?"margin-left: 34px;":"margin-right: 8px;"}
|
|
84
84
|
}
|
|
85
|
-
`,
|
|
85
|
+
`,G=({message:n})=>e("div",{children:e(Z,{isAgent:n.isAgent,children:e("div",{className:"date-seperator-content",children:new Date(n.createdAt).toLocaleString("en-US")})})}),R="bc-message-list-content",J=s.div`
|
|
86
86
|
height: 100%;
|
|
87
87
|
width: 100%;
|
|
88
88
|
overflow-y: auto;
|
|
@@ -90,12 +90,22 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
90
90
|
background-size: 100% 100%;
|
|
91
91
|
background-image: ${e=>`url(${e.config.backgroundImage})`};
|
|
92
92
|
${e=>e.config.backgroundColor&&`background-color: ${e.config.backgroundColor};`}
|
|
93
|
-
`,
|
|
93
|
+
`,j=({sendMessage:i,debug:o,config:r,messages:c})=>(a((()=>{const e=document.getElementById(R);if(!e)return;const n=e.scrollHeight;e.style.scrollBehavior="smooth",e.style.overscrollBehavior="contain",e.scroll(0,n)}),[c]),e(J,{id:R,config:r,children:c?.map(((a,s)=>n(t,{children:[e(N,{message:a,index:s,sendMessage:i,messageActionsEnabled:c.length-1===s,debug:o,config:r},a.messageId?a.messageId:"message"+s),e(G,{message:a},"date-seperator-"+s)]})))},R)),K="text";var P={EN:{share_my_location:"Share My Location",share_my_current_location:"Share My Current Location",placeholder:"Type a Message",see_your_location:"See Your Location",location_permission:"Please give location permission"},TR:{share_my_location:"Konumumu paylaÅ",share_my_current_location:"GÃŧncel konumumu paylaÅ",placeholder:"MesajÄąnÄązÄą yazÄąn",see_your_location:"Konumunuzu GÃļrÃŧntÃŧleyin",location_permission:"LÃŧtfen konum paylaÅÄąmÄą için izin verin"},DE:{share_my_location:"Standortfreigabe",share_my_current_location:"Meinen aktuellen Standort teilen",placeholder:"Geben Sie eine Nachricht ein",see_your_location:"Sehen Sie Ihren Standort",location_permission:"Bitte geben Sie Ihren Standort frei"}};const Q=s.span`
|
|
94
94
|
cursor: pointer;
|
|
95
95
|
width: 20px;
|
|
96
96
|
height: 20px;
|
|
97
97
|
margin: 5px;
|
|
98
|
-
`,
|
|
98
|
+
`,H=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})}),Y=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})}),U=({file:t,isFileSelected:i,cancelFileUpload:a})=>n("div",{className:"bc-uploadFileDetails",style:{border:i?"green dashed 1px":""},id:"uploadFileDetails",children:[e("div",{className:"bc-uploadedFile",children:h.SupportedImageFormats.indexOf(t.extension)>=0?e("img",{src:t.fileUrl,alt:"",className:"bc-imageFile"}):e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO2caXQUVRbHc2bmw8wXP82MJiyByKiDEHCYccN9QXFFEURxZlRcZkBRXHAXN0TZ3FAIKqABEQggSxKWRBwdBR0cUMCQQEhn6e5s3Z1OSIcl/e6c11WVfvXqvlevqjvCHOqe8zt+qeqU95f/va9aMCPDK6+88sorr7zyyiuvvPLKK6+8Os4rVnrKRbGSrCmx0sy5sZKsPEq7iZ557Zt65rXZ0jsvStnIkq1RnODt1uLek1uKsse0FvX73bH+9z7uqq3k9yfHSjO3xEqzQKMHxEo02rvoCe2be8JBE70StG0y07qpN7RuNBPdmA3RDUlaEvSBSHH20UhRn+LQht7nH+s+HBcF3/T8Tawk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PiSoZIBNf8bQZDbNCvswjCxCTTcuRbZIe0bBtDZOPK/BW7u6Nut6Vju6oMdkTZiLAI+JMinCCTHEYMk5bm4nOt/89Ff0Fm6Eg5drpClnmZyjJPIR07nO4Nm52BjSiTDJEIVQl2cjAx2s8/tPUSKF/Qt9kiJLiyx9zaFVnQ8eMEbY+gpyu7caXyVp5iOr6Xp0NdBpsKVkSqEhTFfHcuHPziQihbkA0VH/WbYxECUzJ+5S/IrK9ddjL4V2ZD5MvhEN12K0S3jdYZpXMLRLdSRkJ0680Q3XqTzgiIbr0Rot8Y3ADRrynX61wH0a+v1bkGol8PT/Lvq3WGQfQrnS+v1LkCWij/ulzji8sgssXgEo3PKRdDS+lFEElwIYQpmylDIbyJcr7OeRDaaHAuhDacA6ENZ/+s1K89C8oX5kDZB71pOoK09xlYNRf1OylQkLmzdtkpQMUcC2o+pZwC1Ut1PjkFfJ9kgm9JJlRRFmfCgcVZGvlZUEn5uAfsp3zUA/ZRFvWECspCSi8oX6Cx90NK70Qjjgf2LsrZUZHf7yRUhllM7/7BVVmzgyuz8ln8tvR0QK8kBb3y63RqllOyk3yapJpnaXZ+FWVJH43FSQ4kyMnfv/jU/P0fa+wz+OjYsv/jfjMr8vv3txXhlVdeeeWVV1555ZVXXnnllVdeeeWVV1555VXG/2f9D+lROV6EKZDWAAAAAElFTkSuQmCC",alt:"",className:"bc-documentFile"})}),e("div",{className:"bc-uploadFileName",children:e("span",{children:t.fileName})}),e("div",{className:"bc-uploadFileCancel",children:e("span",{onClick:a,children:e(Y,{})})})]}),W=({text:n,setText:t,config:i,send:c})=>{const s=o(null),l=r((()=>{const e=s.current;e.style.height="20px";const n=e.scrollHeight;n!==e.offsetHeight&&(e.style.height=n+"px")}),[]);return a((()=>{n||(l(),s.current.focus())}),[l,n]),e("textarea",{ref:s,value:n,className:"bc-messageInputTextArea",id:"textInput",placeholder:i.inputPlaceholder||P[i.language]?.placeholder,maxLength:1024,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c(),l())},onChange:e=>{t(e.target.value),l()}})},T=({config:t,send:i,file:a,isFileSelected:o,text:r,setText:c,cancelFileUpload:s})=>n("div",{className:"bc-messageInput",children:[a?e(U,{file:a,isFileSelected:o,cancelFileUpload:s}):e(W,{text:r,setText:c,config:t,send:i}),e(Q,{onClick:i,children:r||a?e(H,{}):null})]});async function V(e,n,t){const i=new p("https://bcuserres.blob.core.windows.net?sp=rc&st=2024-12-31T17:52:49Z&se=2026-01-01T01:52:49Z&spr=https&sv=2022-11-02&sr=c&sig=ZM%2Fdd4vGMglDs%2F9GtJ8y510iYCcXpUO%2Bj5CvVAq8QDg%3D",new b).getContainerClient("anonymous"),a=new Date,o=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}`,r=i.getBlockBlobClient(`${o}/${g()}`);try{await r.uploadBrowserData(e,{onProgress:t=>{const i=Math.round(t.loadedBytes/e.size*100);n(i)},blockSize:4194304,concurrency:20,blobHTTPHeaders:{blobContentType:e.type}});t(r.url.split("?")[0])}catch(e){t(void 0,"Error uploading file:"+e.message)}}const O=(e,n)=>`\n &:hover {\n background-image: ${e.replaceAll("%23a3a3a3",n.activeColor)};\n }\n background-image: ${n.isActive?e.replaceAll("%23a3a3a3",n.activeColor):e};\n`,q=s.i`
|
|
99
|
+
${e=>O("url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='50' height='50' viewBox='0 0 48 48'%3E%3Cpath d='M 19.5 3 C 17.585045 3 16 4.5850452 16 6.5 L 16 23.253906 A 1.50015 1.50015 0 0 0 16 23.740234 L 16 32.5 C 16 34.414955 17.585045 36 19.5 36 L 30.5 36 C 32.414955 36 34 34.414955 34 32.5 L 34 23.746094 A 1.50015 1.50015 0 0 0 34 23.259766 L 34 6.5 C 34 4.5850452 32.414955 3 30.5 3 L 19.5 3 z M 19.5 6 L 30.5 6 C 30.795045 6 31 6.2049548 31 6.5 L 31 22 L 19 22 L 19 6.5 C 19 6.2049548 19.204955 6 19.5 6 z M 11.476562 21.978516 A 1.50015 1.50015 0 0 0 10 23.5 L 10 32.5 C 10 37.728774 14.271226 42 19.5 42 L 23.5 42 L 23.5 46 A 1.50015 1.50015 0 1 0 26.5 46 L 26.5 42 L 30.5 42 C 35.728774 42 40 37.728774 40 32.5 L 40 23.5 A 1.50015 1.50015 0 1 0 37 23.5 L 37 32.5 C 37 36.107226 34.107226 39 30.5 39 L 19.5 39 C 15.892774 39 13 36.107226 13 32.5 L 13 23.5 A 1.50015 1.50015 0 0 0 11.476562 21.978516 z M 19 25 L 31 25 L 31 32.5 C 31 32.795045 30.795045 33 30.5 33 L 19.5 33 C 19.204955 33 19 32.795045 19 32.5 L 19 25 z M 25 27 A 2 2 0 0 0 25 31 A 2 2 0 0 0 25 27 z' fill='%23a3a3a3'%3E%3C/path%3E%3C/svg%3E%0A\");",e)}
|
|
100
|
+
`,X=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666","fill-rule":"evenodd","clip-rule":"evenodd"})}),$=new d({bitRate:128}),_=({setProgress:t,setFile:i,setError:a,send:o})=>{const[s,l]=c(!1),d=r((()=>{a(void 0),s?$.stop().getMp3().then((([e,n])=>{l(!1);V(new File([n],"recording.mp3",{type:"audio/mpeg"}),t,((e,n)=>{e?o({fileUrl:e,fileName:"recording",extension:"mp3"}):n&&a(n)}))})).catch((e=>a(e.message))):navigator.mediaDevices.getUserMedia({audio:!0}).then((()=>{$.start().then((()=>{l(!0)})).catch((e=>a(e.message)))})).catch((e=>a(e.message)))}),[s,a,t,o]);return n("div",{id:"voiceRecorderIcon",className:"mic-container",children:[s?e("i",{onClick:d,children:e(X,{})}):e(q,{onClick:d,activeColor:"var(--bc-chat-dark-gray-color)"}),e("div",{className:"circle "+(s?"active":"")})]})};const ee=s.i`
|
|
101
|
+
${e=>O("url(\"data:image/svg+xml,%3Csvg id='Component_25_5' data-name='Component 25 â 5' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.999 16'%3E%3Cpath id='Path_805' data-name='Path 805' d='M8,16a8,8,0,1,1,8-8,8.009,8.009,0,0,1-8,8M8,1.211A6.789,6.789,0,1,0,14.788,8,6.8,6.8,0,0,0,8,1.211' fill='%23a3a3a3'/%3E%3Cpath id='Path_806' data-name='Path 806' d='M10.908,19.478a4.716,4.716,0,0,1-3.359-1.392.605.605,0,0,1,.856-.856,3.537,3.537,0,0,0,5,0,.605.605,0,1,1,.856.856,4.716,4.716,0,0,1-3.359,1.392' transform='translate(-2.908 -6.728)' fill='%23a3a3a3'/%3E%3Cpath id='Path_807' data-name='Path 807' d='M7.306,10.925A1.635,1.635,0,1,1,8.942,9.289a1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-2.237 -3.02)' fill='%23a3a3a3'/%3E%3Cpath id='Path_808' data-name='Path 808' d='M16.986,10.925a1.635,1.635,0,1,1,1.635-1.635,1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-6.056 -3.02)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
102
|
+
`,ne=s.span`
|
|
103
|
+
margin: 8px;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
font-size: var(--bc-chat-fontSize-xl);
|
|
106
|
+
`,te=({onClick:n})=>e("div",{id:"emojiIcon",children:e(ee,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),ie=({text:n,setText:t,onClick:i})=>{const c=function(e){const n=o(null);return a((()=>{const t=t=>{n.current&&!n.current.contains(t.target)&&e()};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}),[e]),n}(i),s=r((e=>{t(n+e)}),[t,n]),l=x.map(((n,t)=>e(ne,{className:"emoji",onClick:e=>s(e.target.innerText),children:n},"emoji"+t)));return e("div",{ref:c,children:e("div",{className:"bc-emojiPicker",id:"emojiPicker",children:l})})},ae=s.i`
|
|
107
|
+
${e=>O("url(\"data:image/svg+xml,%3Csvg id='attach' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.317 16'%3E%3Cpath id='Path_690' data-name='Path 690' d='M-431.392,1429.762a4.112,4.112,0,0,1-2.928-1.213,4.145,4.145,0,0,1,0-5.854l8.066-8.065a2.94,2.94,0,0,1,2.094-.867,2.94,2.94,0,0,1,2.094.867,2.941,2.941,0,0,1,.867,2.094,2.94,2.94,0,0,1-.867,2.094l-8.065,8.066a1.826,1.826,0,0,1-2.523,0,1.773,1.773,0,0,1-.522-1.261,1.773,1.773,0,0,1,.523-1.262l8.065-8.065a.606.606,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.065,8.066a.566.566,0,0,0-.168.4.569.569,0,0,0,.168.4.585.585,0,0,0,.809,0l8.066-8.066a1.738,1.738,0,0,0,.512-1.238,1.739,1.739,0,0,0-.512-1.238,1.792,1.792,0,0,0-2.475,0l-8.066,8.065a2.933,2.933,0,0,0,0,4.141,2.933,2.933,0,0,0,4.141,0l8.075-8.075a.6.6,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.075,8.075A4.111,4.111,0,0,1-431.392,1429.762Z' transform='translate(435.53 -1413.762)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
108
|
+
`,oe=({setProgress:t,setFile:i,setError:a})=>{const o=r((e=>{i(void 0),a(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:c}=o,s=r.substring(r.lastIndexOf(".")+1).toLowerCase();return h.SupportedFormats.indexOf(s)<0?a("File type is not valid."):c>h.MaxFileSize?a("Maximum limit is 20 MBs"):void V(o,t,((e,n)=>{e?i({fileUrl:e,fileName:r,extension:s}):n&&a(n)}))}),[t,i,a]);return n("div",{id:"attachIcon",children:[e("label",{htmlFor:"fileInput",children:e(ae,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:o})]})},re=s.div`
|
|
99
109
|
padding: 0px 0px 0px 10px;
|
|
100
110
|
margin: 0px;
|
|
101
111
|
width: fit-content;
|
|
@@ -110,17 +120,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
110
120
|
cursor: pointer;
|
|
111
121
|
display: block;
|
|
112
122
|
}
|
|
113
|
-
`,
|
|
114
|
-
${e=>O("url(\"data:image/svg+xml,%3Csvg id='attach' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.317 16'%3E%3Cpath id='Path_690' data-name='Path 690' d='M-431.392,1429.762a4.112,4.112,0,0,1-2.928-1.213,4.145,4.145,0,0,1,0-5.854l8.066-8.065a2.94,2.94,0,0,1,2.094-.867,2.94,2.94,0,0,1,2.094.867,2.941,2.941,0,0,1,.867,2.094,2.94,2.94,0,0,1-.867,2.094l-8.065,8.066a1.826,1.826,0,0,1-2.523,0,1.773,1.773,0,0,1-.522-1.261,1.773,1.773,0,0,1,.523-1.262l8.065-8.065a.606.606,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.065,8.066a.566.566,0,0,0-.168.4.569.569,0,0,0,.168.4.585.585,0,0,0,.809,0l8.066-8.066a1.738,1.738,0,0,0,.512-1.238,1.739,1.739,0,0,0-.512-1.238,1.792,1.792,0,0,0-2.475,0l-8.066,8.065a2.933,2.933,0,0,0,0,4.141,2.933,2.933,0,0,0,4.141,0l8.075-8.075a.6.6,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.075,8.075A4.111,4.111,0,0,1-431.392,1429.762Z' transform='translate(435.53 -1413.762)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
115
|
-
`,X=s.i`
|
|
116
|
-
${e=>O("url(\"data:image/svg+xml,%3Csvg id='Component_25_5' data-name='Component 25 â 5' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.999 16'%3E%3Cpath id='Path_805' data-name='Path 805' d='M8,16a8,8,0,1,1,8-8,8.009,8.009,0,0,1-8,8M8,1.211A6.789,6.789,0,1,0,14.788,8,6.8,6.8,0,0,0,8,1.211' fill='%23a3a3a3'/%3E%3Cpath id='Path_806' data-name='Path 806' d='M10.908,19.478a4.716,4.716,0,0,1-3.359-1.392.605.605,0,0,1,.856-.856,3.537,3.537,0,0,0,5,0,.605.605,0,1,1,.856.856,4.716,4.716,0,0,1-3.359,1.392' transform='translate(-2.908 -6.728)' fill='%23a3a3a3'/%3E%3Cpath id='Path_807' data-name='Path 807' d='M7.306,10.925A1.635,1.635,0,1,1,8.942,9.289a1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-2.237 -3.02)' fill='%23a3a3a3'/%3E%3Cpath id='Path_808' data-name='Path 808' d='M16.986,10.925a1.635,1.635,0,1,1,1.635-1.635,1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-6.056 -3.02)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
117
|
-
`,$=s.i`
|
|
118
|
-
${e=>O("url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='50' height='50' viewBox='0 0 48 48'%3E%3Cpath d='M 19.5 3 C 17.585045 3 16 4.5850452 16 6.5 L 16 23.253906 A 1.50015 1.50015 0 0 0 16 23.740234 L 16 32.5 C 16 34.414955 17.585045 36 19.5 36 L 30.5 36 C 32.414955 36 34 34.414955 34 32.5 L 34 23.746094 A 1.50015 1.50015 0 0 0 34 23.259766 L 34 6.5 C 34 4.5850452 32.414955 3 30.5 3 L 19.5 3 z M 19.5 6 L 30.5 6 C 30.795045 6 31 6.2049548 31 6.5 L 31 22 L 19 22 L 19 6.5 C 19 6.2049548 19.204955 6 19.5 6 z M 11.476562 21.978516 A 1.50015 1.50015 0 0 0 10 23.5 L 10 32.5 C 10 37.728774 14.271226 42 19.5 42 L 23.5 42 L 23.5 46 A 1.50015 1.50015 0 1 0 26.5 46 L 26.5 42 L 30.5 42 C 35.728774 42 40 37.728774 40 32.5 L 40 23.5 A 1.50015 1.50015 0 1 0 37 23.5 L 37 32.5 C 37 36.107226 34.107226 39 30.5 39 L 19.5 39 C 15.892774 39 13 36.107226 13 32.5 L 13 23.5 A 1.50015 1.50015 0 0 0 11.476562 21.978516 z M 19 25 L 31 25 L 31 32.5 C 31 32.795045 30.795045 33 30.5 33 L 19.5 33 C 19.204955 33 19 32.795045 19 32.5 L 19 25 z M 25 27 A 2 2 0 0 0 25 31 A 2 2 0 0 0 25 27 z' fill='%23a3a3a3'%3E%3C/path%3E%3C/svg%3E%0A\");",e)}
|
|
119
|
-
`,_=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666","fill-rule":"evenodd","clip-rule":"evenodd"})}),ee=({setProgress:t,setFile:i,setError:a})=>{const o=r((e=>{i(void 0),a(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:c}=o,s=r.substring(r.lastIndexOf(".")+1).toLowerCase();return b.SupportedFormats.indexOf(s)<0?a("File type is not valid."):c>b.MaxFileSize?a("Maximum limit is 20 MBs"):void T(o,t,((e,n)=>{e?i({fileUrl:e,fileName:r,extension:s}):n&&a(n)}))}),[t,i,a]);return n("div",{id:"attachIcon",children:[e("label",{htmlFor:"fileInput",children:e(q,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:o})]})},ne=({onClick:n})=>e("div",{id:"emojiIcon",children:e(X,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),te=s.span`
|
|
120
|
-
margin: 8px;
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
font-size: var(--bc-chat-fontSize-xl);
|
|
123
|
-
`,ie=({text:n,setText:t,onClick:i})=>{const c=function(e){const n=o(null);return a((()=>{const t=t=>{n.current&&!n.current.contains(t.target)&&e()};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}}),[e]),n}(i),s=r((e=>{t(n+e)}),[t,n]),l=m.map(((n,t)=>e(te,{className:"emoji",onClick:e=>s(e.target.innerText),children:n},"emoji"+t)));return e("div",{ref:c,children:e("div",{className:"bc-emojiPicker",id:"emojiPicker",children:l})})},ae=({setProgress:t,setFile:i,setError:a,send:s})=>{const[l,d]=c(!1),g=o([]),p=o(null),b=r((async()=>{if(l)p.current.stop(),d(!1);else{const e=await navigator.mediaDevices.getUserMedia({audio:!0});p.current=new MediaRecorder(e),p.current.ondataavailable=e=>{g.current.push(e.data)},p.current.onstop=()=>{const e=new Blob(g.current,{type:"audio/wav"});T(new File([e],"recording.wav",{type:"audio/wav"}),t,((e,n)=>{e?s({fileUrl:e,fileName:"recording",extension:"wav"}):n&&a(n)})),g.current=[]},p.current.start(),d(!0)}}),[l,a,t,s]);return n("div",{id:"voiceRecorderIcon",className:"mic-container",children:[l?e("i",{onClick:b,children:e(_,{})}):e($,{onClick:b,activeColor:"var(--bc-chat-dark-gray-color)"}),e("div",{className:"circle "+(l?"active":"")})]})},oe=({setView:t,setFile:i,setProgress:a,setError:o,text:r,setText:s,send:l})=>{const[d,g]=c(!1);return n("div",{className:"bc-inputActions",id:"bc-inputActions",children:[n(V,{id:"iconsContainer",children:[e(ee,{setFile:i,setProgress:a,setError:o}),e(ne,{onClick:()=>g(!0)}),e(ae,{setFile:i,setError:o,setProgress:a,send:l})]}),d?e(ie,{text:r,setText:s,onClick:()=>g(!1)}):null]})};D('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0; }\n\n.bc-messageInput {\n min-height: 30px;\n max-height: 100%;\n border: 1px solid #d9d9d9;\n background-color: #fff;\n overflow-y: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 20px; }\n .bc-messageInput .bc-messageInputTextArea {\n color: var(--bc-chat-dark-gray-color);\n display: block;\n min-height: 36px;\n background-color: #fff;\n box-sizing: border-box;\n font-size: var(--bc-chat-fontSize-md);\n padding: 10px 16px;\n resize: none;\n overflow: auto;\n border-width: 0;\n width: calc(100% - 20px);\n word-wrap: break-word;\n border: none;\n overflow: hidden;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none; }\n\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px; }\n .bc-inputActions .bc-fileUpload {\n display: none; }\n .bc-inputActions i {\n display: block;\n margin: 0 5px; }\n\n.bc-emojiPicker {\n position: absolute;\n bottom: 40px;\n right: 0;\n width: 200px;\n background: #ffffff 0% 0% no-repeat padding-box;\n box-shadow: 0px 0px 15px #0000001a;\n border-radius: 10px;\n opacity: 1;\n padding: 10px;\n z-index: 10;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap; }\n\n.bc-uploadFileDetails {\n background-color: transparent;\n display: flex;\n align-items: center;\n max-width: calc(100% - 40px);\n width: calc(100% - 40px);\n height: 32px;\n border-radius: 20px;\n padding: 2px 10px; }\n .bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-documentFile {\n margin-top: 4px;\n min-width: 25px;\n min-height: 25px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px; }\n\n.mic-container {\n position: relative; }\n .mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative; }\n .mic-container .circle {\n z-index: 4;\n top: -2px;\n left: 2px;\n position: absolute;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n transition: 0.5s; }\n .mic-container .circle:before {\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n opacity: 0.5;\n z-index: 3;\n position: absolute; }\n .mic-container .circle.active {\n background-color: #A8E6A3; }\n .mic-container .circle.active:before {\n background: #A8E6A3;\n animation: bounce 0.8s ease-in-out infinite 0.5s; }\n\n@keyframes bounce {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(1.4); }\n 75% {\n transform: scale(1); }\n 100% {\n transform: scale(1.3); } }\n');const re=s.div`
|
|
123
|
+
`,ce=({setView:t,setFile:i,setProgress:a,setError:o,text:r,setText:s,send:l})=>{const[d,g]=c(!1);return n("div",{className:"bc-inputActions",id:"bc-inputActions",children:[n(re,{id:"iconsContainer",children:[e(oe,{setFile:i,setProgress:a,setError:o}),e(te,{onClick:()=>g(!0)}),e(_,{setFile:i,setError:o,setProgress:a,send:l})]}),d?e(ie,{text:r,setText:s,onClick:()=>g(!1)}):null]})};z('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0; }\n\n.bc-messageInput {\n min-height: 30px;\n max-height: 100%;\n border: 1px solid #d9d9d9;\n background-color: #fff;\n overflow-y: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 20px; }\n .bc-messageInput .bc-messageInputTextArea {\n color: var(--bc-chat-dark-gray-color);\n display: block;\n min-height: 36px;\n background-color: #fff;\n box-sizing: border-box;\n font-size: var(--bc-chat-fontSize-md);\n padding: 10px 16px;\n resize: none;\n overflow: auto;\n border-width: 0;\n width: calc(100% - 20px);\n word-wrap: break-word;\n border: none;\n overflow: hidden;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none; }\n\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px; }\n .bc-inputActions .bc-fileUpload {\n display: none; }\n .bc-inputActions i {\n display: block;\n margin: 0 5px; }\n\n.bc-emojiPicker {\n position: absolute;\n bottom: 40px;\n right: 0;\n width: 200px;\n background: #ffffff 0% 0% no-repeat padding-box;\n box-shadow: 0px 0px 15px #0000001a;\n border-radius: 10px;\n opacity: 1;\n padding: 10px;\n z-index: 10;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap; }\n\n.bc-uploadFileDetails {\n background-color: transparent;\n display: flex;\n align-items: center;\n max-width: calc(100% - 40px);\n width: calc(100% - 40px);\n height: 32px;\n border-radius: 20px;\n padding: 2px 10px; }\n .bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-documentFile {\n margin-top: 4px;\n min-width: 25px;\n min-height: 25px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px; }\n\n.mic-container {\n position: relative; }\n .mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative; }\n .mic-container .circle {\n z-index: 4;\n top: -2px;\n left: 2px;\n position: absolute;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n transition: 0.5s; }\n .mic-container .circle:before {\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n opacity: 0.5;\n z-index: 3;\n position: absolute; }\n .mic-container .circle.active {\n background-color: #A8E6A3; }\n .mic-container .circle.active:before {\n background: #A8E6A3;\n animation: bounce 0.8s ease-in-out infinite 0.5s; }\n\n@keyframes bounce {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(1.4); }\n 75% {\n transform: scale(1); }\n 100% {\n transform: scale(1.3); } }\n');const se=s.div`
|
|
124
124
|
width: calc(100% - 40px);
|
|
125
125
|
background-color: #d9d9d94d;
|
|
126
126
|
padding: 10px 20px;
|
|
@@ -135,26 +135,32 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
135
135
|
.bc-CommandsArea {
|
|
136
136
|
width: 90px;
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
.bc-uploadFileError {
|
|
139
|
+
width: 100%;
|
|
140
|
+
color: red;
|
|
141
|
+
margin-top: 6px;
|
|
142
|
+
text-align: center;
|
|
143
|
+
}
|
|
144
|
+
`,le=({config:t,sendMessage:i,setView:a})=>{const[o,s]=c(),[l,d]=c(),[g,p]=c(),[b,m]=c(0),x=r((e=>{if(e){const{fileUrl:n,extension:t}=e;i(h.SupportedImageFormats.indexOf(t)>=0?"image":h.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(l){const{fileUrl:e,extension:n}=l;i(h.SupportedImageFormats.indexOf(n)>=0?"image":h.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),d(void 0)}else i(K,o),s("")}),[l,o,i]);return n(se,{children:[e("div",{className:"bc-InputArea",children:e(T,{config:t,send:x,text:o,setText:s,file:l,isFileSelected:!!l,cancelFileUpload:()=>d(void 0)})}),e("div",{className:"bc-CommandsArea",children:e(ce,{setView:a,setFile:d,setProgress:m,setError:p,setText:s,text:o,send:x})}),g?e("div",{className:"bc-uploadFileError",children:g}):null]})},de="bc-chat-header-banner",ge=390,pe=s.div`
|
|
145
|
+
${e=>e.bannerWidth>ge?"height: 60px;":"height: 90px;"}
|
|
140
146
|
display: block;
|
|
141
147
|
width: 100%;
|
|
142
148
|
background-color: transparent;
|
|
143
149
|
z-index: 10;
|
|
144
150
|
border-top-left-radius: 15px;
|
|
145
151
|
border-top-right-radius: 15px;
|
|
146
|
-
`,
|
|
152
|
+
`,be=s.div`
|
|
147
153
|
width: 100%;
|
|
148
154
|
display: flex;
|
|
149
155
|
align-items: center;
|
|
150
156
|
background-image: ${e=>`linear-gradient(103deg, ${e.startColor},${e.endColor})`};
|
|
151
|
-
${e=>e.bannerWidth<=
|
|
152
|
-
`,
|
|
157
|
+
${e=>e.bannerWidth<=ge?'\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-repeat: no-repeat;\n mask-size: auto;\n -webkit-mask-size: auto;\n -webkit-mask-repeat: no-repeat;\n height: 90px;\n ':"height: 60px;"}
|
|
158
|
+
`,he=s.div`
|
|
153
159
|
width: 100%;
|
|
154
160
|
height: 100%;
|
|
155
161
|
display: flex;
|
|
156
|
-
`,
|
|
157
|
-
${e=>e.bannerWidth>
|
|
162
|
+
`,me=s.div`
|
|
163
|
+
${e=>e.bannerWidth>ge?"padding-bottom: 0 !important;":""}
|
|
158
164
|
display: flex;
|
|
159
165
|
gap: 10px;
|
|
160
166
|
align-items: center;
|
|
@@ -175,8 +181,8 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
175
181
|
color: #fff;
|
|
176
182
|
font-style: normal;
|
|
177
183
|
}
|
|
178
|
-
`,
|
|
179
|
-
${e=>e.bannerWidth>
|
|
184
|
+
`,xe=s.div`
|
|
185
|
+
${e=>e.bannerWidth>ge?"padding-bottom: 0 !important;":""}
|
|
180
186
|
display: flex;
|
|
181
187
|
flex-direction: row-reverse;
|
|
182
188
|
gap: 10px;
|
|
@@ -191,9 +197,9 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
191
197
|
cursor: pointer;
|
|
192
198
|
display: block;
|
|
193
199
|
}
|
|
194
|
-
`,
|
|
200
|
+
`,ue=s.i`
|
|
195
201
|
background-image: url("data:image/svg+xml;base64,PHN2ZyBpZD0ibWluaW1pemUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgdmlld0JveD0iMCAwIDE2IDEuODE3Ij4KICA8ZGVmcz4KICAgIDxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj4KICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZV82OCIgZGF0YS1uYW1lPSJSZWN0YW5nbGUgNjgiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgZmlsbD0iIzAwMCIvPgogICAgPC9jbGlwUGF0aD4KICA8L2RlZnM+CiAgPGcgaWQ9Ikdyb3VwXzMwMSIgZGF0YS1uYW1lPSJHcm91cCAzMDEiIGNsaXAtcGF0aD0idXJsKCNjbGlwLXBhdGgpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzgwNCIgZGF0YS1uYW1lPSJQYXRoIDgwNCIgZD0iTTE1LjM5NCwyLjIxMUguNjA2QS42MDYuNjA2LDAsMSwxLC42MDYsMUgxNS4zOTRhLjYwNi42MDYsMCwwLDEsMCwxLjIxMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMC4zOTQpIiBmaWxsPSIjZmZmIi8+CiAgPC9nPgo8L3N2Zz4K");
|
|
196
|
-
`,
|
|
202
|
+
`,Ce=({config:t,minimize:i})=>{const[o,r]=c();return a((()=>{new ResizeObserver((()=>{const e=document.getElementById(de)?.offsetWidth;e&&e>50&&e!==o&&r(e)})).observe(document.getElementById(de))}),[]),e(pe,{bannerWidth:o,className:"bc-header",children:e(be,{className:"bc-banner",id:de,startColor:"#065A60",endColor:"#006466",bannerWidth:o,children:n(he,{className:"bc-bannerContents",children:[n(me,{className:"bc-companyInfo",bannerWidth:o,logo:t.brandLogo||m,children:[e("i",{}),e("span",{children:t.brandName||"BreadCrumbs"})]}),e(xe,{className:"bc-bannerActions",bannerWidth:o,children:i?e(ue,{className:"bc-flow-minimize",onClick:()=>i()}):null})]})})})},fe=s.div`
|
|
197
203
|
width: 100%;
|
|
198
204
|
text-align: center;
|
|
199
205
|
i {
|
|
@@ -201,7 +207,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
201
207
|
position: relative;
|
|
202
208
|
width: 20px;
|
|
203
209
|
height: 20px;
|
|
204
|
-
background-image: url(${
|
|
210
|
+
background-image: url(${m});
|
|
205
211
|
background-repeat: no-repeat;
|
|
206
212
|
background-size: 20px 20px;
|
|
207
213
|
background-position: center;
|
|
@@ -224,7 +230,7 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
224
230
|
border-radius: 0px 0px 10px 10px;
|
|
225
231
|
opacity: 1;
|
|
226
232
|
}
|
|
227
|
-
`,
|
|
233
|
+
`,we=i.forwardRef((({forRate:t},i)=>n(fe,{className:""+(t?"bc-ratingPositioning":""),children:[e("i",{}),e("span",{children:"Powered by Bread Crumbs"})]})));z('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");\n:root {\n --bc-chat-font-stack: "Montserrat", sans-serif;\n --bc-chat-fontSize-xs: 10px;\n --bc-chat-fontSize-sm: 12px;\n --bc-chat-fontSize-md: 14px;\n --bc-chat-fontSize-lg: 18px;\n --bc-chat-fontSize-xl: 22px;\n --bc-chat-fontSize-xxl: 26px;\n --bc-chat-fontWeight-light: 100;\n --bc-chat-fontWeight-regular: 400;\n --bc-chat-fontWeight-medium: 500;\n --bc-chat-fontWeight-bold: 700;\n --bc-chat-lineHeight-xs: 18px;\n --bc-chat-lineHeight-sm: 22px;\n --bc-chat-lineHeight-md: 28px;\n --bc-chat-light-gray-color: #9b9b9b;\n --bc-chat-dark-gray-color: #4d4d4d;\n --bc-chat-agent-message-border-color: #95D5B2;\n --bc-chat-agent-message-background-start-color: #fff;\n --bc-chat-agent-message-background-end-color: #fff;\n --bc-chat-agent-message-text-color: #000;\n --bc-chat-client-message-border-color: #95D5B2;\n --bc-chat-client-message-background-start-color: #95D5B2;\n --bc-chat-client-message-background-end-color: #95D5B2;\n --bc-chat-client-message-text-color: #000;\n --bc-chat-danger-color: #d6312e;\n --bc-chat-success-color: #58aa18;\n --bc-chat-white-color: #fff;\n --bc-chat-radius: 5px; }\n');const ve=s.div`
|
|
228
234
|
height: 100%;
|
|
229
235
|
display: flex;
|
|
230
236
|
flex-direction: column;
|
|
@@ -250,5 +256,5 @@ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import i,{useEff
|
|
|
250
256
|
line-height: inherit;
|
|
251
257
|
font-weight: inherit;
|
|
252
258
|
}
|
|
253
|
-
`,
|
|
259
|
+
`,Ae=({config:i={language:"EN",backgroundColor:"#dedede"},messages:a=[],sendMessage:o,debug:r,minimize:s})=>{const[l,d]=c("MESSAGE_LIST"),g="interactive"===(a&&a.length>0&&a[a.length-1].type);return n(ve,{className:"bc-chat",children:[i.hideHeader?null:e(Ce,{config:i,minimize:s}),"MESSAGE_LIST"==l?e(j,{messages:a,sendMessage:o,debug:r,config:i},"message-list"):null,e(t,{children:g?e(we,{forRate:!0}):e(le,{sendMessage:o,setView:d,config:i},"message-input")})]})};export{Ae as BCChat};
|
|
254
260
|
//# sourceMappingURL=index.es.js.map
|
package/build/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6bAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6bAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("@emotion/styled"),a=require("react-markdown"),i=require("
|
|
2
|
-
background-image: ${e=>
|
|
3
|
-
color: ${e=>
|
|
4
|
-
border-color: ${e=>
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("@emotion/styled"),a=require("react-markdown"),i=require("mic-recorder-to-mp3"),o=require("uuid"),r=require("@azure/storage-blob");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(n),l=s(t),d=s(a),g=s(i);const p={MaxFileSize:52428800,SupportedFormats:["png","jpg","jpeg","gif","bmp","pdf","doc","xls","xlsx","docx","ppt","pptx","avi","m4a","m4v","mov","mp4","wav","wma","wmv"],SupportedImageFormats:["png","jpg","jpeg","gif","bmp","webp"],SupportedAudioFormats:["mp3","acc","m4a","ogg","amr"]},b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAYAAACO98lFAAAACXBIWXMAAAsSAAALEgHS3X78AAAFa0lEQVR42u2bX0xTVxzHvzqqVOqQrtJC2gmF4ooMWNg6FEJE3NhClpnG8aBzsTHugbgsLltiJg/6NI3J5pLFLbpIIjEjLuriiH9qnESlI6BQWcGsSEvT2lK8q0CvFChme1hwXs5tKfTWXfT83s6fe3Lz6fn9zvl9f7eL9L/u/xvPuS0GNQqBQqAQKAQKYaYlzfdBk0qPtzRFnL7L7ttoGLzz/EBQSlNRrMzj9HUzA9QdaEygECgECoFCoBAoBAqBQqAQKASaRQph6UlLUCJToCjtZcgkydCmqh6PPQyPo39kEP7QCDoeeGCbCD5bEN5dkQljlgFl6sKo854c97EMfvf2osl1K+FAEgqhPEWBuvyNRModi2XIFDDmVcCYV4FLjnZ8Zf8NQ1OTCysmmFR6HK2smxeAmVatNaC56lPUKrIXzk74Jv8dVGsNEcfZcAh3A25OX4pECp1cE/EZmUSKfaXbUGi/hnp7i7gh7Mku5QXAhkMwOztw8Z4NNx4yEZ+vVWRjbfrqiBCNeRVISUrG7t6L4oRQqMji3f4nesw47u6MyadPMU6cYpwo6G/Fl4U1vOtVaw0wBVyC6ZmCxoSZL8yGQ/j46hEccLbNOajZ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DThjvybIemw4hH1tjdhp/SUh5fmEfp9Qb29Bk+sWduSURa1SRzIfy+CyqzPmOuZTh+APjRCnQTBMvqhtIojdvRdR0N+K9StzUKTIgnZFJq9LTJfsHSODaB2y48KwF0/DFtE/h1JliUKgECgECoFCoBAi2D8QCAe+XuY7HAAAAABJRU5ErkJggg==",h=["đ¤","đ","đ","âšī¸","đ˛","đŗ","đ ","đ","đ","đ","đ","đ¤Ŗ","đ","đ","đ
","đ","đ","đ","đ","đŖ","đĨ","đŽ","đ´","đ","đ","đ","đ","đ","đ¤","đ¤","đ","đ","đļ","đ"];function x(e){return e.isAgent?"linear-gradient(104deg,var(--bc-chat-agent-message-background-start-color),var(--bc-chat-agent-message-background-end-color))":"linear-gradient(104deg,var(--bc-chat-client-message-background-start-color),var(--bc-chat-client-message-background-end-color))"}function m(e){return e.isAgent?"var(--bc-chat-agent-message-border-color)":"var(--bc-chat-client-message-border-color)"}function u(e){return e.isAgent?"var(--bc-chat-agent-message-text-color)":"var(--bc-chat-client-message-text-color)"}const f=({message:n})=>e.jsx("div",{className:"bc-mediaMessage"+("audio"===n.type?" audio":""),style:{padding:0},children:e.jsx("video",{src:n.content,controls:!0})}),C=l.default.div`
|
|
2
|
+
background-image: ${e=>x(e)};
|
|
3
|
+
color: ${e=>u(e)};
|
|
4
|
+
border-color: ${e=>m(e)};
|
|
5
5
|
border-width: 1px;
|
|
6
6
|
border-style: solid;
|
|
7
7
|
:hover {
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
-ms-filter: brightness(80%);
|
|
12
12
|
filter: brightness(80%);
|
|
13
13
|
}
|
|
14
|
-
`;const
|
|
14
|
+
`;const w=l.default.i`
|
|
15
15
|
background-image: ${e=>`url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.51194%203.00541C9.18829%202.54594%2010.0435%202.53694%2010.6788%202.95419C10.8231%203.04893%2010.9771%203.1993%2011.389%203.61119C11.8009%204.02307%2011.9513%204.17714%2012.046%204.32141C12.4633%204.95675%2012.4543%205.81192%2011.9948%206.48827C11.8899%206.64264%2011.7276%206.80811%2011.3006%207.23511L10.6819%207.85383C10.4867%208.04909%2010.4867%208.36567%2010.6819%208.56093C10.8772%208.7562%2011.1938%208.7562%2011.389%208.56093L12.0077%207.94221L12.0507%207.89929C12.4203%207.52976%2012.6568%207.2933%2012.822%207.0502C13.4972%206.05623%2013.5321%204.76252%2012.8819%203.77248C12.7233%203.53102%2012.4922%203.30001%2012.1408%202.94871L12.0961%202.90408L12.0515%202.85942C11.7002%202.508%2011.4692%202.27689%2011.2277%202.11832C10.2377%201.46813%208.94398%201.50299%207.95001%202.17822C7.70691%202.34336%207.47044%202.57991%207.1009%202.94955L7.058%202.99247L6.43928%203.61119C6.24401%203.80645%206.24401%204.12303%206.43928%204.31829C6.63454%204.51355%206.95112%204.51355%207.14638%204.31829L7.7651%203.69957C8.1921%203.27257%208.35757%203.11027%208.51194%203.00541ZM4.31796%207.14672C4.51322%206.95146%204.51322%206.63487%204.31796%206.43961C4.12269%206.24435%203.80611%206.24435%203.61085%206.43961L2.99213%207.05833L2.94922%207.10124C2.57957%207.47077%202.34303%207.70724%202.17788%207.95035C1.50265%208.94432%201.4678%2010.238%202.11799%2011.2281C2.27656%2011.4695%202.50766%2011.7005%202.8591%2012.0518L2.90374%2012.0965L2.94837%2012.1411C3.29967%2012.4925%203.53068%2012.7237%203.77214%2012.8822C4.76219%2013.5324%206.05589%2013.4976%207.04986%2012.8223C7.29296%2012.6572%207.52943%2012.4206%207.89896%2012.051L7.89897%2012.051L7.94188%2012.0081L8.5606%2011.3894C8.75586%2011.1941%208.75586%2010.8775%208.5606%2010.6823C8.36533%2010.487%208.04875%2010.487%207.85349%2010.6823L7.23477%2011.301C6.80777%2011.728%206.6423%2011.8903%206.48794%2011.9951C5.81158%2012.4546%204.95642%2012.4636%204.32107%2012.0464C4.17681%2011.9516%204.02274%2011.8012%203.61085%2011.3894C3.19896%2010.9775%203.0486%2010.8234%202.95385%2010.6791C2.53661%2010.0438%202.54561%209.18863%203.00507%208.51227C3.10993%208.35791%203.27224%208.19244%203.69924%207.76544L4.31796%207.14672ZM9.62172%206.08558C9.81698%205.89032%209.81698%205.57373%209.62172%205.37847C9.42646%205.18321%209.10988%205.18321%208.91461%205.37847L5.37908%208.91401C5.18382%209.10927%205.18382%209.42585%205.37908%209.62111C5.57434%209.81637%205.89092%209.81637%206.08619%209.62111L9.62172%206.08558Z%22%20fill%3D%22%23${e.color}%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E")`};
|
|
16
16
|
width: 24px;
|
|
17
17
|
background-position: center;
|
|
18
18
|
background-size: contain;
|
|
19
19
|
background-repeat: no-repeat;
|
|
20
|
-
`,
|
|
20
|
+
`,v=l.default.a`
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: row;
|
|
23
23
|
align-item: center;
|
|
24
24
|
text-decoration: auto;
|
|
25
25
|
gap: 5px;
|
|
26
|
-
color: ${e=>`${
|
|
27
|
-
`,
|
|
28
|
-
background-image: ${e=>
|
|
29
|
-
color: ${e=>
|
|
30
|
-
border-color: ${e=>
|
|
26
|
+
color: ${e=>`${u(e)}`};
|
|
27
|
+
`,A=l.default.a`
|
|
28
|
+
background-image: ${e=>x(e)};
|
|
29
|
+
color: ${e=>u(e)};
|
|
30
|
+
border-color: ${e=>m(e)};
|
|
31
31
|
border-width: 1px;
|
|
32
32
|
border-style: solid;
|
|
33
33
|
:hover {
|
|
@@ -37,21 +37,21 @@
|
|
|
37
37
|
-ms-filter: brightness(80%);
|
|
38
38
|
filter: brightness(80%);
|
|
39
39
|
}
|
|
40
|
-
`,
|
|
40
|
+
`,I=l.default.div`
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: row;
|
|
43
43
|
align-items: center;
|
|
44
44
|
gap: 5px;
|
|
45
|
-
`,
|
|
45
|
+
`,M=l.default.span`
|
|
46
46
|
color: ${e=>e.color};
|
|
47
|
-
`;const
|
|
47
|
+
`;const k=l.default.i`
|
|
48
48
|
background-image: ${e=>`url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22currentColor%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M9.62129%201.13607C9.81656%200.940808%2010.1331%200.940809%2010.3284%201.13607L11.3891%202.19673L12.8033%203.61094L13.8639%204.6716C14.0592%204.86687%2014.0592%205.18345%2013.8639%205.37871C13.6687%205.57397%2013.3521%205.57397%2013.1568%205.37871L12.5038%204.7257L8.86727%209.57443L9.97485%2010.682C10.1701%2010.8773%2010.1701%2011.1939%209.97485%2011.3891C9.77959%2011.5844%209.463%2011.5844%209.26774%2011.3891L7.85353%209.97491L6.79287%208.91425L3.5225%2012.1846C3.32724%2012.3799%203.01065%2012.3799%202.81539%2012.1846C2.62013%2011.9894%202.62013%2011.6728%202.81539%2011.4775L6.08576%208.20714L5.0251%207.14648L3.61089%205.73226C3.41563%205.537%203.41562%205.22042%203.61089%205.02516C3.80615%204.8299%204.12273%204.8299%204.31799%205.02516L5.42557%206.13274L10.2743%202.49619L9.62129%201.84318C9.42603%201.64792%209.42603%201.33133%209.62129%201.13607Z%22%20fill%3D%22%23${e.color}%22%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E")`};
|
|
49
49
|
background-position: center;
|
|
50
50
|
background-size: contain;
|
|
51
51
|
background-repeat: no-repeat;
|
|
52
52
|
width: 15px;
|
|
53
53
|
height: 15px;
|
|
54
|
-
`,
|
|
54
|
+
`,y={document:({message:n})=>{let t=n.content.split("/"),a=t[t.length-1];return e.jsx(C,{className:"bc-fileMessage",...n,children:e.jsxs(v,{href:n.content,target:"_blank",download:a,rel:"noopener noreferrer",...n,children:[e.jsx(w,{color:(i=n,i.isAgent,"000000")}),e.jsx("span",{children:a})]})});var i},image:({message:n})=>e.jsx("div",{className:"bc-mediaMessage",style:{backgroundImage:x(n),color:u(n),borderColor:m(n),borderWidth:"1px",borderStyle:"solid",padding:0},children:e.jsx("a",{href:n.content,target:"_blank",rel:"noreferrer",children:e.jsx("img",{src:n.content,alt:"message content"})})}),location:({message:n})=>{return e.jsx(A,{href:"https://www.google.com/maps/?q="+n.content,target:"_blank",rel:"noopener noreferrer",className:"bc-locationMessage",isAgent:n.isAgent,children:e.jsxs(I,{children:[e.jsx(k,{color:(t=n,t.isAgent,"000000")}),e.jsx(M,{color:u(n),children:"Open location"})]})});var t},text:({message:n})=>e.jsx("div",{style:{backgroundImage:x(n),color:u(n),borderColor:m(n),borderWidth:"1px",borderStyle:"solid"},children:(n.content&&n.content.indexOf("\n")>-1?n.content.split("\n"):[n.content]).map((n=>e.jsx(d.default,{children:n})))}),video:f,audio:f,interactive:null,template:null,note:({message:n})=>e.jsx("div",{className:"bc-note",children:n.content})},L=l.default.div`
|
|
55
55
|
display: flex;
|
|
56
56
|
flex-direction: column;
|
|
57
57
|
gap: 5px;
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
margin: ${e=>e.isAgent?"0 40px 0 20px":"0 20px 0 40px"};
|
|
61
61
|
text-align: ${e=>e.isAgent?"left":"right"};
|
|
62
62
|
}
|
|
63
|
-
`;function
|
|
64
|
-
background-image: url(${e=>e.brandLogo||
|
|
63
|
+
`;function j({message:n}){const{debug:t,conversationId:a,traceId:i,spanId:o,isAgent:r}=n;return t?e.jsx(L,{isAgent:r,className:"bc-debugCon",children:e.jsxs("div",{children:[e.jsxs("div",{className:"bc-response-debug",children:["Trace id: ",e.jsx("span",{children:i})]}),e.jsxs("div",{className:"bc-response-debug",children:["Span id: ",e.jsx("span",{children:o})]}),e.jsxs("div",{className:"bc-response-debug",children:["Conversation id: ",e.jsx("span",{children:a})]})]})}):null}function E(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===t&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}E(".bc-agentMessage,\n.bc-clientMessage {\n margin: 10px 15px;\n font-size: var(--bc-chat-fontSize-sm); }\n .bc-agentMessage div p,\n .bc-clientMessage div p {\n padding: 0;\n margin: 0; }\n\n.bc-agentMessage > div:not(.bc-debugCon),\n.bc-clientMessage > div:not(.bc-debugCon) {\n display: inline-block;\n padding: 8px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent; }\n\n.bc-agentMessage .bc-note,\n.bc-clientMessage .bc-note {\n background-color: #f9f9f9 !important;\n /* Light background */\n border: 1px solid var(--bc-chat-agent-message-border-color); }\n\n.bc-agentMessage .bc-fileMessage,\n.bc-clientMessage .bc-fileMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-clientMessage .bc-fileMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 15px;\n height: 16px; }\n\n.bc-agentMessage .bc-locationMessage,\n.bc-clientMessage .bc-locationMessage {\n display: inline-block;\n padding: 8px 20px;\n border-radius: 5px;\n overflow: hidden;\n word-break: break-word;\n text-decoration: none;\n background-color: transparent;\n cursor: pointer; }\n .bc-agentMessage .bc-locationMessage img,\n .bc-clientMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n\n.bc-agentMessage {\n text-align: left;\n display: flex;\n align-items: flex-end;\n flex-wrap: wrap;\n gap: 5px; }\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage {\n color: var(--bc-chat-dark-gray-color);\n cursor: pointer; }\n .bc-agentMessage .bc-fileMessage img,\n .bc-agentMessage .bc-locationMessage img {\n vertical-align: middle;\n margin-right: 10px;\n width: 30px; }\n .bc-agentMessage > div:not(.bc-debugCon),\n .bc-agentMessage .bc-fileMessage,\n .bc-agentMessage .bc-locationMessage,\n .bc-agentMessage audio {\n border-bottom-left-radius: 0; }\n\n.bc-agentMessage:first-child {\n flex: 1 0 50%; }\n\n.bc-agentMessage > :nth-child(2) {\n flex: 0 1 auto;\n max-width: 85%; }\n\n.bc-clientMessage {\n padding-left: 20px;\n text-align: right; }\n .bc-clientMessage > div:not(.bc-debugCon),\n .bc-clientMessage .bc-fileMessage,\n .bc-clientMessage .bc-locationMessage,\n .bc-clientMessage audio {\n color: #fff;\n border-bottom-right-radius: 0; }\n .bc-clientMessage svg path:nth-child(2) {\n fill: #fff; }\n\n.bc-mediaMessage video,\n.bc-mediaMessage img {\n width: 300px;\n margin-bottom: -5px; }\n\n.bc-mediaMessage.audio video {\n height: 40px; }\n\n.bc-response-debug {\n background-color: transparent;\n color: #f5a623;\n padding: 0; }\n .bc-response-debug span {\n text-decoration: underline; }\n\n.bc-selectionContainer {\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap; }\n\n.bc-selectionContainer:first-child {\n flex: 1 0 50%; }\n\n.bc-debug-panel {\n border-radius: 10px;\n box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.15);\n border: solid 1px #ffffff;\n background-color: #ffffff;\n color: var(--bc-chat-dark-gray-color);\n display: table;\n width: calc(100% - 40px);\n margin: 10px -40px 10px 0;\n text-align: left;\n padding: 8px;\n max-width: 310px; }\n\n.bc-exception-debug {\n color: #f5a623;\n position: relative; }\n .bc-exception-debug .bc-exception-icon {\n width: 30px;\n position: absolute;\n top: 3px;\n left: 10px; }\n .bc-exception-debug span {\n margin-left: 40px; }\n\n.bc-parameters-debug span {\n text-decoration: underline; }\n\n.bc-parameters-debug .bc-parameters-title {\n width: 100%;\n border-bottom: solid 1px #f3f3f3;\n text-align: left;\n font-weight: bold;\n margin-bottom: 6px; }\n\n.bc-debugCon {\n width: 100%; }\n");const S=l.default.i`
|
|
64
|
+
background-image: url(${e=>e.brandLogo||b});
|
|
65
65
|
width: 30px;
|
|
66
66
|
height: 30px;
|
|
67
67
|
background-position: center;
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
display: inline-block;
|
|
70
70
|
border-radius: 50%;
|
|
71
71
|
background-repeat: no-repeat;
|
|
72
|
-
`;function
|
|
72
|
+
`;function D(e,n){return n?"bc-agentMessage":"bc-clientMessage"}const z=n=>{const{type:t,isAgent:a}=n.message,i=y[t]??null;return i?e.jsxs("div",{className:D(0,a),children:[a?e.jsx(S,{brandLogo:n.config?.brandLogo}):null,e.jsx(i,{message:n.message}),e.jsx(j,{message:n.message})]}):null},F=l.default.div`
|
|
73
73
|
width: 100%;
|
|
74
74
|
display: flex;
|
|
75
75
|
align-items: center;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
align-items: center;
|
|
83
83
|
${e=>e.isAgent?"margin-left: 34px;":"margin-right: 8px;"}
|
|
84
84
|
}
|
|
85
|
-
`,
|
|
85
|
+
`,B=({message:n})=>e.jsx("div",{children:e.jsx(F,{isAgent:n.isAgent,children:e.jsx("div",{className:"date-seperator-content",children:new Date(n.createdAt).toLocaleString("en-US")})})}),N="bc-message-list-content",Z=l.default.div`
|
|
86
86
|
height: 100%;
|
|
87
87
|
width: 100%;
|
|
88
88
|
overflow-y: auto;
|
|
@@ -90,12 +90,22 @@
|
|
|
90
90
|
background-size: 100% 100%;
|
|
91
91
|
background-image: ${e=>`url(${e.config.backgroundImage})`};
|
|
92
92
|
${e=>e.config.backgroundColor&&`background-color: ${e.config.backgroundColor};`}
|
|
93
|
-
`,
|
|
93
|
+
`,G=({sendMessage:t,debug:a,config:i,messages:o})=>(n.useEffect((()=>{const e=document.getElementById(N);if(!e)return;const n=e.scrollHeight;e.style.scrollBehavior="smooth",e.style.overscrollBehavior="contain",e.scroll(0,n)}),[o]),e.jsx(Z,{id:N,config:i,children:o?.map(((n,r)=>e.jsxs(e.Fragment,{children:[e.jsx(z,{message:n,index:r,sendMessage:t,messageActionsEnabled:o.length-1===r,debug:a,config:i},n.messageId?n.messageId:"message"+r),e.jsx(B,{message:n},"date-seperator-"+r)]})))},N)),R="text";var J={EN:{share_my_location:"Share My Location",share_my_current_location:"Share My Current Location",placeholder:"Type a Message",see_your_location:"See Your Location",location_permission:"Please give location permission"},TR:{share_my_location:"Konumumu paylaÅ",share_my_current_location:"GÃŧncel konumumu paylaÅ",placeholder:"MesajÄąnÄązÄą yazÄąn",see_your_location:"Konumunuzu GÃļrÃŧntÃŧleyin",location_permission:"LÃŧtfen konum paylaÅÄąmÄą için izin verin"},DE:{share_my_location:"Standortfreigabe",share_my_current_location:"Meinen aktuellen Standort teilen",placeholder:"Geben Sie eine Nachricht ein",see_your_location:"Sehen Sie Ihren Standort",location_permission:"Bitte geben Sie Ihren Standort frei"}};const K=l.default.span`
|
|
94
94
|
cursor: pointer;
|
|
95
95
|
width: 20px;
|
|
96
96
|
height: 20px;
|
|
97
97
|
margin: 5px;
|
|
98
|
-
`,
|
|
98
|
+
`,P=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})}),Q=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.8536 2.85355C13.0488 2.65829 13.0488 2.34171 12.8536 2.14645C12.6583 1.95118 12.3417 1.95118 12.1464 2.14645L7.5 6.79289L2.85355 2.14645C2.65829 1.95118 2.34171 1.95118 2.14645 2.14645C1.95118 2.34171 1.95118 2.65829 2.14645 2.85355L6.79289 7.5L2.14645 12.1464C1.95118 12.3417 1.95118 12.6583 2.14645 12.8536C2.34171 13.0488 2.65829 13.0488 2.85355 12.8536L7.5 8.20711L12.1464 12.8536C12.3417 13.0488 12.6583 13.0488 12.8536 12.8536C13.0488 12.6583 13.0488 12.3417 12.8536 12.1464L8.20711 7.5L12.8536 2.85355Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})}),H=({file:n,isFileSelected:t,cancelFileUpload:a})=>e.jsxs("div",{className:"bc-uploadFileDetails",style:{border:t?"green dashed 1px":""},id:"uploadFileDetails",children:[e.jsx("div",{className:"bc-uploadedFile",children:p.SupportedImageFormats.indexOf(n.extension)>=0?e.jsx("img",{src:n.fileUrl,alt:"",className:"bc-imageFile"}):e.jsx("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPq0lEQVR4nO2caXQUVRbHc2bmw8wXP82MJiyByKiDEHCYccN9QXFFEURxZlRcZkBRXHAXN0TZ3FAIKqABEQggSxKWRBwdBR0cUMCQQEhn6e5s3Z1OSIcl/e6c11WVfvXqvlevqjvCHOqe8zt+qeqU95f/va9aMCPDK6+88sorr7zyyiuvvPLKK6+8Os4rVnrKRbGSrCmx0sy5sZKsPEq7iZ557Zt65rXZ0jsvStnIkq1RnODt1uLek1uKsse0FvX73bH+9z7uqq3k9yfHSjO3xEqzQKMHxEo02rvoCe2be8JBE70StG0y07qpN7RuNBPdmA3RDUlaEvSBSHH20UhRn+LQht7nH+s+HBcF3/T8Tawkc2dHl4ykkHYFIbyMNipjEyJjo1VGgmKNcHGfeKSo79yqLdm/zjiRq720xyRMhrt0YDLE6TCERLroC+GivhtOaCkdpZnfpCsdrS7TEdFlGISK+qyDKRm/yDgRq6M00+8mHW3dkI4IpSiREirl1YwTsTpKshrt0nHw50pHkSYjIaQwh4TW9xmdcaJVrEuIg1GllI5s1+kIJ8iBcGHftnBhzsCME1JISYrp2Ji+dISpDJ3m9TlVrWtP+23GiSXkOExHUQ4dWxrrczbB8oxfZpwwQo7TdIQMIYWn0n/Oblp/6hB3nJFk9RlDAt3CwCHVPMuT1K4YkBtYPtj+W4lYSY/G7k9HH/fpKDSEnArNlPUG/aDJYJ3BH6DRYK1Gw9rTkqzRqF9zuongZ5QzT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OeRDaaHAuhDacA6ENZ/+s1K89C8oX5kDZB71pOoK09xlYNRf1OylQkLmzdtkpQMUcC2o+pZwC1Ut1PjkFfJ9kgm9JJlRRFmfCgcVZGvlZUEn5uAfsp3zUA/ZRFvWECspCSi8oX6Cx90NK70Qjjgf2LsrZUZHf7yRUhllM7/7BVVmzgyuz8ln8tvR0QK8kBb3y63RqllOyk3yapJpnaXZ+FWVJH43FSQ4kyMnfv/jU/P0fa+wz+OjYsv/jfjMr8vv3txXhlVdeeeWVV1555ZVXXnnllVdeeeWVV1555VXG/2f9D+lROV6EKZDWAAAAAElFTkSuQmCC",alt:"",className:"bc-documentFile"})}),e.jsx("div",{className:"bc-uploadFileName",children:e.jsx("span",{children:n.fileName})}),e.jsx("div",{className:"bc-uploadFileCancel",children:e.jsx("span",{onClick:a,children:e.jsx(Q,{})})})]}),Y=({text:t,setText:a,config:i,send:o})=>{const r=n.useRef(null),s=n.useCallback((()=>{const e=r.current;e.style.height="20px";const n=e.scrollHeight;n!==e.offsetHeight&&(e.style.height=n+"px")}),[]);return n.useEffect((()=>{t||(s(),r.current.focus())}),[s,t]),e.jsx("textarea",{ref:r,value:t,className:"bc-messageInputTextArea",id:"textInput",placeholder:i.inputPlaceholder||J[i.language]?.placeholder,maxLength:1024,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),o(),s())},onChange:e=>{a(e.target.value),s()}})},U=({config:n,send:t,file:a,isFileSelected:i,text:o,setText:r,cancelFileUpload:s})=>e.jsxs("div",{className:"bc-messageInput",children:[a?e.jsx(H,{file:a,isFileSelected:i,cancelFileUpload:s}):e.jsx(Y,{text:o,setText:r,config:n,send:t}),e.jsx(K,{onClick:t,children:o||a?e.jsx(P,{}):null})]});async function W(e,n,t){const a=new r.BlobServiceClient("https://bcuserres.blob.core.windows.net?sp=rc&st=2024-12-31T17:52:49Z&se=2026-01-01T01:52:49Z&spr=https&sv=2022-11-02&sr=c&sig=ZM%2Fdd4vGMglDs%2F9GtJ8y510iYCcXpUO%2Bj5CvVAq8QDg%3D",new r.AnonymousCredential).getContainerClient("anonymous"),i=new Date,s=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}`,c=a.getBlockBlobClient(`${s}/${o.v4()}`);try{await c.uploadBrowserData(e,{onProgress:t=>{const a=Math.round(t.loadedBytes/e.size*100);n(a)},blockSize:4194304,concurrency:20,blobHTTPHeaders:{blobContentType:e.type}});t(c.url.split("?")[0])}catch(e){t(void 0,"Error uploading file:"+e.message)}}const T=(e,n)=>`\n &:hover {\n background-image: ${e.replaceAll("%23a3a3a3",n.activeColor)};\n }\n background-image: ${n.isActive?e.replaceAll("%23a3a3a3",n.activeColor):e};\n`,V=l.default.i`
|
|
99
|
+
${e=>T("url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='50' height='50' viewBox='0 0 48 48'%3E%3Cpath d='M 19.5 3 C 17.585045 3 16 4.5850452 16 6.5 L 16 23.253906 A 1.50015 1.50015 0 0 0 16 23.740234 L 16 32.5 C 16 34.414955 17.585045 36 19.5 36 L 30.5 36 C 32.414955 36 34 34.414955 34 32.5 L 34 23.746094 A 1.50015 1.50015 0 0 0 34 23.259766 L 34 6.5 C 34 4.5850452 32.414955 3 30.5 3 L 19.5 3 z M 19.5 6 L 30.5 6 C 30.795045 6 31 6.2049548 31 6.5 L 31 22 L 19 22 L 19 6.5 C 19 6.2049548 19.204955 6 19.5 6 z M 11.476562 21.978516 A 1.50015 1.50015 0 0 0 10 23.5 L 10 32.5 C 10 37.728774 14.271226 42 19.5 42 L 23.5 42 L 23.5 46 A 1.50015 1.50015 0 1 0 26.5 46 L 26.5 42 L 30.5 42 C 35.728774 42 40 37.728774 40 32.5 L 40 23.5 A 1.50015 1.50015 0 1 0 37 23.5 L 37 32.5 C 37 36.107226 34.107226 39 30.5 39 L 19.5 39 C 15.892774 39 13 36.107226 13 32.5 L 13 23.5 A 1.50015 1.50015 0 0 0 11.476562 21.978516 z M 19 25 L 31 25 L 31 32.5 C 31 32.795045 30.795045 33 30.5 33 L 19.5 33 C 19.204955 33 19 32.795045 19 32.5 L 19 25 z M 25 27 A 2 2 0 0 0 25 31 A 2 2 0 0 0 25 27 z' fill='%23a3a3a3'%3E%3C/path%3E%3C/svg%3E%0A\");",e)}
|
|
100
|
+
`,O=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666","fill-rule":"evenodd","clip-rule":"evenodd"})}),q=new g.default({bitRate:128}),X=({setProgress:t,setFile:a,setError:i,send:o})=>{const[r,s]=n.useState(!1),c=n.useCallback((()=>{i(void 0),r?q.stop().getMp3().then((([e,n])=>{s(!1);W(new File([n],"recording.mp3",{type:"audio/mpeg"}),t,((e,n)=>{e?o({fileUrl:e,fileName:"recording",extension:"mp3"}):n&&i(n)}))})).catch((e=>i(e.message))):navigator.mediaDevices.getUserMedia({audio:!0}).then((()=>{q.start().then((()=>{s(!0)})).catch((e=>i(e.message)))})).catch((e=>i(e.message)))}),[r,i,t,o]);return e.jsxs("div",{id:"voiceRecorderIcon",className:"mic-container",children:[r?e.jsx("i",{onClick:c,children:e.jsx(O,{})}):e.jsx(V,{onClick:c,activeColor:"var(--bc-chat-dark-gray-color)"}),e.jsx("div",{className:"circle "+(r?"active":"")})]})};const $=l.default.i`
|
|
101
|
+
${e=>T("url(\"data:image/svg+xml,%3Csvg id='Component_25_5' data-name='Component 25 â 5' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.999 16'%3E%3Cpath id='Path_805' data-name='Path 805' d='M8,16a8,8,0,1,1,8-8,8.009,8.009,0,0,1-8,8M8,1.211A6.789,6.789,0,1,0,14.788,8,6.8,6.8,0,0,0,8,1.211' fill='%23a3a3a3'/%3E%3Cpath id='Path_806' data-name='Path 806' d='M10.908,19.478a4.716,4.716,0,0,1-3.359-1.392.605.605,0,0,1,.856-.856,3.537,3.537,0,0,0,5,0,.605.605,0,1,1,.856.856,4.716,4.716,0,0,1-3.359,1.392' transform='translate(-2.908 -6.728)' fill='%23a3a3a3'/%3E%3Cpath id='Path_807' data-name='Path 807' d='M7.306,10.925A1.635,1.635,0,1,1,8.942,9.289a1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-2.237 -3.02)' fill='%23a3a3a3'/%3E%3Cpath id='Path_808' data-name='Path 808' d='M16.986,10.925a1.635,1.635,0,1,1,1.635-1.635,1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-6.056 -3.02)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
102
|
+
`,_=l.default.span`
|
|
103
|
+
margin: 8px;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
font-size: var(--bc-chat-fontSize-xl);
|
|
106
|
+
`,ee=({onClick:n})=>e.jsx("div",{id:"emojiIcon",children:e.jsx($,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),ne=({text:t,setText:a,onClick:i})=>{const o=function(e){const t=n.useRef(null);return n.useEffect((()=>{const n=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e]),t}(i),r=n.useCallback((e=>{a(t+e)}),[a,t]),s=h.map(((n,t)=>e.jsx(_,{className:"emoji",onClick:e=>r(e.target.innerText),children:n},"emoji"+t)));return e.jsx("div",{ref:o,children:e.jsx("div",{className:"bc-emojiPicker",id:"emojiPicker",children:s})})},te=l.default.i`
|
|
107
|
+
${e=>T("url(\"data:image/svg+xml,%3Csvg id='attach' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.317 16'%3E%3Cpath id='Path_690' data-name='Path 690' d='M-431.392,1429.762a4.112,4.112,0,0,1-2.928-1.213,4.145,4.145,0,0,1,0-5.854l8.066-8.065a2.94,2.94,0,0,1,2.094-.867,2.94,2.94,0,0,1,2.094.867,2.941,2.941,0,0,1,.867,2.094,2.94,2.94,0,0,1-.867,2.094l-8.065,8.066a1.826,1.826,0,0,1-2.523,0,1.773,1.773,0,0,1-.522-1.261,1.773,1.773,0,0,1,.523-1.262l8.065-8.065a.606.606,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.065,8.066a.566.566,0,0,0-.168.4.569.569,0,0,0,.168.4.585.585,0,0,0,.809,0l8.066-8.066a1.738,1.738,0,0,0,.512-1.238,1.739,1.739,0,0,0-.512-1.238,1.792,1.792,0,0,0-2.475,0l-8.066,8.065a2.933,2.933,0,0,0,0,4.141,2.933,2.933,0,0,0,4.141,0l8.075-8.075a.6.6,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.075,8.075A4.111,4.111,0,0,1-431.392,1429.762Z' transform='translate(435.53 -1413.762)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
108
|
+
`,ae=({setProgress:t,setFile:a,setError:i})=>{const o=n.useCallback((e=>{a(void 0),i(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:s}=o,c=r.substring(r.lastIndexOf(".")+1).toLowerCase();return p.SupportedFormats.indexOf(c)<0?i("File type is not valid."):s>p.MaxFileSize?i("Maximum limit is 20 MBs"):void W(o,t,((e,n)=>{e?a({fileUrl:e,fileName:r,extension:c}):n&&i(n)}))}),[t,a,i]);return e.jsxs("div",{id:"attachIcon",children:[e.jsx("label",{htmlFor:"fileInput",children:e.jsx(te,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e.jsx("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:o})]})},ie=l.default.div`
|
|
99
109
|
padding: 0px 0px 0px 10px;
|
|
100
110
|
margin: 0px;
|
|
101
111
|
width: fit-content;
|
|
@@ -110,17 +120,7 @@
|
|
|
110
120
|
cursor: pointer;
|
|
111
121
|
display: block;
|
|
112
122
|
}
|
|
113
|
-
`,
|
|
114
|
-
${e=>W("url(\"data:image/svg+xml,%3Csvg id='attach' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.317 16'%3E%3Cpath id='Path_690' data-name='Path 690' d='M-431.392,1429.762a4.112,4.112,0,0,1-2.928-1.213,4.145,4.145,0,0,1,0-5.854l8.066-8.065a2.94,2.94,0,0,1,2.094-.867,2.94,2.94,0,0,1,2.094.867,2.941,2.941,0,0,1,.867,2.094,2.94,2.94,0,0,1-.867,2.094l-8.065,8.066a1.826,1.826,0,0,1-2.523,0,1.773,1.773,0,0,1-.522-1.261,1.773,1.773,0,0,1,.523-1.262l8.065-8.065a.606.606,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.065,8.066a.566.566,0,0,0-.168.4.569.569,0,0,0,.168.4.585.585,0,0,0,.809,0l8.066-8.066a1.738,1.738,0,0,0,.512-1.238,1.739,1.739,0,0,0-.512-1.238,1.792,1.792,0,0,0-2.475,0l-8.066,8.065a2.933,2.933,0,0,0,0,4.141,2.933,2.933,0,0,0,4.141,0l8.075-8.075a.6.6,0,0,1,.857,0,.6.6,0,0,1,0,.856l-8.075,8.075A4.111,4.111,0,0,1-431.392,1429.762Z' transform='translate(435.53 -1413.762)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
115
|
-
`,V=c.default.i`
|
|
116
|
-
${e=>W("url(\"data:image/svg+xml,%3Csvg id='Component_25_5' data-name='Component 25 â 5' xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 15.999 16'%3E%3Cpath id='Path_805' data-name='Path 805' d='M8,16a8,8,0,1,1,8-8,8.009,8.009,0,0,1-8,8M8,1.211A6.789,6.789,0,1,0,14.788,8,6.8,6.8,0,0,0,8,1.211' fill='%23a3a3a3'/%3E%3Cpath id='Path_806' data-name='Path 806' d='M10.908,19.478a4.716,4.716,0,0,1-3.359-1.392.605.605,0,0,1,.856-.856,3.537,3.537,0,0,0,5,0,.605.605,0,1,1,.856.856,4.716,4.716,0,0,1-3.359,1.392' transform='translate(-2.908 -6.728)' fill='%23a3a3a3'/%3E%3Cpath id='Path_807' data-name='Path 807' d='M7.306,10.925A1.635,1.635,0,1,1,8.942,9.289a1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-2.237 -3.02)' fill='%23a3a3a3'/%3E%3Cpath id='Path_808' data-name='Path 808' d='M16.986,10.925a1.635,1.635,0,1,1,1.635-1.635,1.638,1.638,0,0,1-1.635,1.635m0-2.06a.424.424,0,1,0,.424.424.425.425,0,0,0-.424-.424' transform='translate(-6.056 -3.02)' fill='%23a3a3a3'/%3E%3C/svg%3E%0A\");",e)}
|
|
117
|
-
`,O=c.default.i`
|
|
118
|
-
${e=>W("url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='50' height='50' viewBox='0 0 48 48'%3E%3Cpath d='M 19.5 3 C 17.585045 3 16 4.5850452 16 6.5 L 16 23.253906 A 1.50015 1.50015 0 0 0 16 23.740234 L 16 32.5 C 16 34.414955 17.585045 36 19.5 36 L 30.5 36 C 32.414955 36 34 34.414955 34 32.5 L 34 23.746094 A 1.50015 1.50015 0 0 0 34 23.259766 L 34 6.5 C 34 4.5850452 32.414955 3 30.5 3 L 19.5 3 z M 19.5 6 L 30.5 6 C 30.795045 6 31 6.2049548 31 6.5 L 31 22 L 19 22 L 19 6.5 C 19 6.2049548 19.204955 6 19.5 6 z M 11.476562 21.978516 A 1.50015 1.50015 0 0 0 10 23.5 L 10 32.5 C 10 37.728774 14.271226 42 19.5 42 L 23.5 42 L 23.5 46 A 1.50015 1.50015 0 1 0 26.5 46 L 26.5 42 L 30.5 42 C 35.728774 42 40 37.728774 40 32.5 L 40 23.5 A 1.50015 1.50015 0 1 0 37 23.5 L 37 32.5 C 37 36.107226 34.107226 39 30.5 39 L 19.5 39 C 15.892774 39 13 36.107226 13 32.5 L 13 23.5 A 1.50015 1.50015 0 0 0 11.476562 21.978516 z M 19 25 L 31 25 L 31 32.5 C 31 32.795045 30.795045 33 30.5 33 L 19.5 33 C 19.204955 33 19 32.795045 19 32.5 L 19 25 z M 25 27 A 2 2 0 0 0 25 31 A 2 2 0 0 0 25 27 z' fill='%23a3a3a3'%3E%3C/path%3E%3C/svg%3E%0A\");",e)}
|
|
119
|
-
`,q=()=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:"#666","fill-rule":"evenodd","clip-rule":"evenodd"})}),X=({setProgress:t,setFile:a,setError:i})=>{const o=n.useCallback((e=>{a(void 0),i(void 0);const n=Array.from(e.target.files);if(e.target.value="",n.length<1)return;const o=n[0],{name:r,size:s}=o,c=r.substring(r.lastIndexOf(".")+1).toLowerCase();return d.SupportedFormats.indexOf(c)<0?i("File type is not valid."):s>d.MaxFileSize?i("Maximum limit is 20 MBs"):void Y(o,t,((e,n)=>{e?a({fileUrl:e,fileName:r,extension:c}):n&&i(n)}))}),[t,a,i]);return e.jsxs("div",{id:"attachIcon",children:[e.jsx("label",{htmlFor:"fileInput",children:e.jsx(T,{activeColor:"var(--bc-chat-dark-gray-color)"})}),e.jsx("input",{type:"file",className:"bc-fileUpload",id:"fileInput",onChange:o})]})},$=({onClick:n})=>e.jsx("div",{id:"emojiIcon",children:e.jsx(V,{onClick:n,activeColor:"var(--bc-chat-dark-gray-color)"})}),_=c.default.span`
|
|
120
|
-
margin: 8px;
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
font-size: var(--bc-chat-fontSize-xl);
|
|
123
|
-
`,ee=({text:t,setText:a,onClick:i})=>{const o=function(e){const t=n.useRef(null);return n.useEffect((()=>{const n=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}}),[e]),t}(i),r=n.useCallback((e=>{a(t+e)}),[a,t]),s=p.map(((n,t)=>e.jsx(_,{className:"emoji",onClick:e=>r(e.target.innerText),children:n},"emoji"+t)));return e.jsx("div",{ref:o,children:e.jsx("div",{className:"bc-emojiPicker",id:"emojiPicker",children:s})})},ne=({setProgress:t,setFile:a,setError:i,send:o})=>{const[r,s]=n.useState(!1),c=n.useRef([]),l=n.useRef(null),d=n.useCallback((async()=>{if(r)l.current.stop(),s(!1);else{const e=await navigator.mediaDevices.getUserMedia({audio:!0});l.current=new MediaRecorder(e),l.current.ondataavailable=e=>{c.current.push(e.data)},l.current.onstop=()=>{const e=new Blob(c.current,{type:"audio/wav"});Y(new File([e],"recording.wav",{type:"audio/wav"}),t,((e,n)=>{e?o({fileUrl:e,fileName:"recording",extension:"wav"}):n&&i(n)})),c.current=[]},l.current.start(),s(!0)}}),[r,i,t,o]);return e.jsxs("div",{id:"voiceRecorderIcon",className:"mic-container",children:[r?e.jsx("i",{onClick:d,children:e.jsx(q,{})}):e.jsx(O,{onClick:d,activeColor:"var(--bc-chat-dark-gray-color)"}),e.jsx("div",{className:"circle "+(r?"active":"")})]})},te=({setView:t,setFile:a,setProgress:i,setError:o,text:r,setText:s,send:c})=>{const[l,d]=n.useState(!1);return e.jsxs("div",{className:"bc-inputActions",id:"bc-inputActions",children:[e.jsxs(U,{id:"iconsContainer",children:[e.jsx(X,{setFile:a,setProgress:i,setError:o}),e.jsx($,{onClick:()=>d(!0)}),e.jsx(ne,{setFile:a,setError:o,setProgress:i,send:c})]}),l?e.jsx(ee,{text:r,setText:s,onClick:()=>d(!1)}):null]})};L('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0; }\n\n.bc-messageInput {\n min-height: 30px;\n max-height: 100%;\n border: 1px solid #d9d9d9;\n background-color: #fff;\n overflow-y: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 20px; }\n .bc-messageInput .bc-messageInputTextArea {\n color: var(--bc-chat-dark-gray-color);\n display: block;\n min-height: 36px;\n background-color: #fff;\n box-sizing: border-box;\n font-size: var(--bc-chat-fontSize-md);\n padding: 10px 16px;\n resize: none;\n overflow: auto;\n border-width: 0;\n width: calc(100% - 20px);\n word-wrap: break-word;\n border: none;\n overflow: hidden;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none; }\n\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px; }\n .bc-inputActions .bc-fileUpload {\n display: none; }\n .bc-inputActions i {\n display: block;\n margin: 0 5px; }\n\n.bc-emojiPicker {\n position: absolute;\n bottom: 40px;\n right: 0;\n width: 200px;\n background: #ffffff 0% 0% no-repeat padding-box;\n box-shadow: 0px 0px 15px #0000001a;\n border-radius: 10px;\n opacity: 1;\n padding: 10px;\n z-index: 10;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap; }\n\n.bc-uploadFileDetails {\n background-color: transparent;\n display: flex;\n align-items: center;\n max-width: calc(100% - 40px);\n width: calc(100% - 40px);\n height: 32px;\n border-radius: 20px;\n padding: 2px 10px; }\n .bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-documentFile {\n margin-top: 4px;\n min-width: 25px;\n min-height: 25px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px; }\n\n.mic-container {\n position: relative; }\n .mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative; }\n .mic-container .circle {\n z-index: 4;\n top: -2px;\n left: 2px;\n position: absolute;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n transition: 0.5s; }\n .mic-container .circle:before {\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n opacity: 0.5;\n z-index: 3;\n position: absolute; }\n .mic-container .circle.active {\n background-color: #A8E6A3; }\n .mic-container .circle.active:before {\n background: #A8E6A3;\n animation: bounce 0.8s ease-in-out infinite 0.5s; }\n\n@keyframes bounce {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(1.4); }\n 75% {\n transform: scale(1); }\n 100% {\n transform: scale(1.3); } }\n');const ae=c.default.div`
|
|
123
|
+
`,oe=({setView:t,setFile:a,setProgress:i,setError:o,text:r,setText:s,send:c})=>{const[l,d]=n.useState(!1);return e.jsxs("div",{className:"bc-inputActions",id:"bc-inputActions",children:[e.jsxs(ie,{id:"iconsContainer",children:[e.jsx(ae,{setFile:a,setProgress:i,setError:o}),e.jsx(ee,{onClick:()=>d(!0)}),e.jsx(X,{setFile:a,setError:o,setProgress:i,send:c})]}),l?e.jsx(ne,{text:r,setText:s,onClick:()=>d(!1)}):null]})};E('.bc-trademark {\n height: 40px;\n width: 100%;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-y: hidden;\n border-bottom-left-radius: 15px;\n border-bottom-right-radius: 15px;\n padding: 15px 0; }\n\n.bc-messageInput {\n min-height: 30px;\n max-height: 100%;\n border: 1px solid #d9d9d9;\n background-color: #fff;\n overflow-y: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 20px; }\n .bc-messageInput .bc-messageInputTextArea {\n color: var(--bc-chat-dark-gray-color);\n display: block;\n min-height: 36px;\n background-color: #fff;\n box-sizing: border-box;\n font-size: var(--bc-chat-fontSize-md);\n padding: 10px 16px;\n resize: none;\n overflow: auto;\n border-width: 0;\n width: calc(100% - 20px);\n word-wrap: break-word;\n border: none;\n overflow: hidden;\n outline: none;\n -webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none; }\n\n.bc-inputActions {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n height: 38px; }\n .bc-inputActions .bc-fileUpload {\n display: none; }\n .bc-inputActions i {\n display: block;\n margin: 0 5px; }\n\n.bc-emojiPicker {\n position: absolute;\n bottom: 40px;\n right: 0;\n width: 200px;\n background: #ffffff 0% 0% no-repeat padding-box;\n box-shadow: 0px 0px 15px #0000001a;\n border-radius: 10px;\n opacity: 1;\n padding: 10px;\n z-index: 10;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap; }\n\n.bc-uploadFileDetails {\n background-color: transparent;\n display: flex;\n align-items: center;\n max-width: calc(100% - 40px);\n width: calc(100% - 40px);\n height: 32px;\n border-radius: 20px;\n padding: 2px 10px; }\n .bc-uploadFileDetails .bc-uploadedFile {\n max-width: 32px;\n max-height: 32px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-imageFile {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadedFile .bc-documentFile {\n margin-top: 4px;\n min-width: 25px;\n min-height: 25px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileName span {\n padding: 10px;\n pointer-events: none; }\n .bc-uploadFileDetails .bc-uploadFileCancel {\n cursor: pointer;\n margin-bottom: -6px; }\n\n.mic-container {\n position: relative; }\n .mic-container i {\n transition: 0.9s;\n z-index: 10;\n position: relative; }\n .mic-container .circle {\n z-index: 4;\n top: -2px;\n left: 2px;\n position: absolute;\n background-color: transparent;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1;\n transition: 0.5s; }\n .mic-container .circle:before {\n content: "";\n width: 30px;\n height: 30px;\n border-radius: 50%;\n opacity: 0.5;\n z-index: 3;\n position: absolute; }\n .mic-container .circle.active {\n background-color: #A8E6A3; }\n .mic-container .circle.active:before {\n background: #A8E6A3;\n animation: bounce 0.8s ease-in-out infinite 0.5s; }\n\n@keyframes bounce {\n 0% {\n transform: scale(1); }\n 25% {\n transform: scale(1.4); }\n 75% {\n transform: scale(1); }\n 100% {\n transform: scale(1.3); } }\n');const re=l.default.div`
|
|
124
124
|
width: calc(100% - 40px);
|
|
125
125
|
background-color: #d9d9d94d;
|
|
126
126
|
padding: 10px 20px;
|
|
@@ -135,26 +135,32 @@
|
|
|
135
135
|
.bc-CommandsArea {
|
|
136
136
|
width: 90px;
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
.bc-uploadFileError {
|
|
139
|
+
width: 100%;
|
|
140
|
+
color: red;
|
|
141
|
+
margin-top: 6px;
|
|
142
|
+
text-align: center;
|
|
143
|
+
}
|
|
144
|
+
`,se=({config:t,sendMessage:a,setView:i})=>{const[o,r]=n.useState(),[s,c]=n.useState(),[l,d]=n.useState(),[g,b]=n.useState(0),h=n.useCallback((e=>{if(e){const{fileUrl:n,extension:t}=e;a(p.SupportedImageFormats.indexOf(t)>=0?"image":p.SupportedAudioFormats.indexOf(t)>=0?"audio":"document",n)}else if(s){const{fileUrl:e,extension:n}=s;a(p.SupportedImageFormats.indexOf(n)>=0?"image":p.SupportedAudioFormats.indexOf(n)>=0?"audio":"document",e),c(void 0)}else a(R,o),r("")}),[s,o,a]);return e.jsxs(re,{children:[e.jsx("div",{className:"bc-InputArea",children:e.jsx(U,{config:t,send:h,text:o,setText:r,file:s,isFileSelected:!!s,cancelFileUpload:()=>c(void 0)})}),e.jsx("div",{className:"bc-CommandsArea",children:e.jsx(oe,{setView:i,setFile:c,setProgress:b,setError:d,setText:r,text:o,send:h})}),l?e.jsx("div",{className:"bc-uploadFileError",children:l}):null]})},ce="bc-chat-header-banner",le=390,de=l.default.div`
|
|
145
|
+
${e=>e.bannerWidth>le?"height: 60px;":"height: 90px;"}
|
|
140
146
|
display: block;
|
|
141
147
|
width: 100%;
|
|
142
148
|
background-color: transparent;
|
|
143
149
|
z-index: 10;
|
|
144
150
|
border-top-left-radius: 15px;
|
|
145
151
|
border-top-right-radius: 15px;
|
|
146
|
-
`,
|
|
152
|
+
`,ge=l.default.div`
|
|
147
153
|
width: 100%;
|
|
148
154
|
display: flex;
|
|
149
155
|
align-items: center;
|
|
150
156
|
background-image: ${e=>`linear-gradient(103deg, ${e.startColor},${e.endColor})`};
|
|
151
|
-
${e=>e.bannerWidth<=
|
|
152
|
-
`,
|
|
157
|
+
${e=>e.bannerWidth<=le?'\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzkwIiBoZWlnaHQ9Ijg4LjM1NCIgdmlld0JveD0iMCAwIDM5MCA4OC4zNTQiPgogIDxkZWZzPgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQiIHgyPSIxIiB5Mj0iMSIgZ3JhZGllbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM2NjJkOTEiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWUyYTdiIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KICA8cGF0aCBpZD0iUGF0aF84NzgiIGRhdGEtbmFtZT0iUGF0aCA4NzgiIGQ9Ik0xMCwwSDM4MGExMCwxMCwwLDAsMSwxMCwxMFY3MHMtNzUuMDYtNy44ODYtMTk5LjYxNywxMS44NjJTMCw3MCwwLDcwVjEwQTEwLDEwLDAsMCwxLDEwLDAiIGZpbGw9InVybCgjbGluZWFyLWdyYWRpZW50KSIvPgo8L3N2Zz4K");\n mask-repeat: no-repeat;\n mask-size: auto;\n -webkit-mask-size: auto;\n -webkit-mask-repeat: no-repeat;\n height: 90px;\n ':"height: 60px;"}
|
|
158
|
+
`,pe=l.default.div`
|
|
153
159
|
width: 100%;
|
|
154
160
|
height: 100%;
|
|
155
161
|
display: flex;
|
|
156
|
-
`,
|
|
157
|
-
${e=>e.bannerWidth>
|
|
162
|
+
`,be=l.default.div`
|
|
163
|
+
${e=>e.bannerWidth>le?"padding-bottom: 0 !important;":""}
|
|
158
164
|
display: flex;
|
|
159
165
|
gap: 10px;
|
|
160
166
|
align-items: center;
|
|
@@ -175,8 +181,8 @@
|
|
|
175
181
|
color: #fff;
|
|
176
182
|
font-style: normal;
|
|
177
183
|
}
|
|
178
|
-
`,
|
|
179
|
-
${e=>e.bannerWidth>
|
|
184
|
+
`,he=l.default.div`
|
|
185
|
+
${e=>e.bannerWidth>le?"padding-bottom: 0 !important;":""}
|
|
180
186
|
display: flex;
|
|
181
187
|
flex-direction: row-reverse;
|
|
182
188
|
gap: 10px;
|
|
@@ -191,9 +197,9 @@
|
|
|
191
197
|
cursor: pointer;
|
|
192
198
|
display: block;
|
|
193
199
|
}
|
|
194
|
-
`,
|
|
200
|
+
`,xe=l.default.i`
|
|
195
201
|
background-image: url("data:image/svg+xml;base64,PHN2ZyBpZD0ibWluaW1pemUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgdmlld0JveD0iMCAwIDE2IDEuODE3Ij4KICA8ZGVmcz4KICAgIDxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj4KICAgICAgPHJlY3QgaWQ9IlJlY3RhbmdsZV82OCIgZGF0YS1uYW1lPSJSZWN0YW5nbGUgNjgiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxLjgxNyIgZmlsbD0iIzAwMCIvPgogICAgPC9jbGlwUGF0aD4KICA8L2RlZnM+CiAgPGcgaWQ9Ikdyb3VwXzMwMSIgZGF0YS1uYW1lPSJHcm91cCAzMDEiIGNsaXAtcGF0aD0idXJsKCNjbGlwLXBhdGgpIj4KICAgIDxwYXRoIGlkPSJQYXRoXzgwNCIgZGF0YS1uYW1lPSJQYXRoIDgwNCIgZD0iTTE1LjM5NCwyLjIxMUguNjA2QS42MDYuNjA2LDAsMSwxLC42MDYsMUgxNS4zOTRhLjYwNi42MDYsMCwwLDEsMCwxLjIxMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMC4zOTQpIiBmaWxsPSIjZmZmIi8+CiAgPC9nPgo8L3N2Zz4K");
|
|
196
|
-
`,
|
|
202
|
+
`,me=({config:t,minimize:a})=>{const[i,o]=n.useState();return n.useEffect((()=>{new ResizeObserver((()=>{const e=document.getElementById(ce)?.offsetWidth;e&&e>50&&e!==i&&o(e)})).observe(document.getElementById(ce))}),[]),e.jsx(de,{bannerWidth:i,className:"bc-header",children:e.jsx(ge,{className:"bc-banner",id:ce,startColor:"#065A60",endColor:"#006466",bannerWidth:i,children:e.jsxs(pe,{className:"bc-bannerContents",children:[e.jsxs(be,{className:"bc-companyInfo",bannerWidth:i,logo:t.brandLogo||b,children:[e.jsx("i",{}),e.jsx("span",{children:t.brandName||"BreadCrumbs"})]}),e.jsx(he,{className:"bc-bannerActions",bannerWidth:i,children:a?e.jsx(xe,{className:"bc-flow-minimize",onClick:()=>a()}):null})]})})})},ue=l.default.div`
|
|
197
203
|
width: 100%;
|
|
198
204
|
text-align: center;
|
|
199
205
|
i {
|
|
@@ -201,7 +207,7 @@
|
|
|
201
207
|
position: relative;
|
|
202
208
|
width: 20px;
|
|
203
209
|
height: 20px;
|
|
204
|
-
background-image: url(${
|
|
210
|
+
background-image: url(${b});
|
|
205
211
|
background-repeat: no-repeat;
|
|
206
212
|
background-size: 20px 20px;
|
|
207
213
|
background-position: center;
|
|
@@ -224,7 +230,7 @@
|
|
|
224
230
|
border-radius: 0px 0px 10px 10px;
|
|
225
231
|
opacity: 1;
|
|
226
232
|
}
|
|
227
|
-
`,
|
|
233
|
+
`,fe=c.default.forwardRef((({forRate:n},t)=>e.jsxs(ue,{className:""+(n?"bc-ratingPositioning":""),children:[e.jsx("i",{}),e.jsx("span",{children:"Powered by Bread Crumbs"})]})));E('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");\n:root {\n --bc-chat-font-stack: "Montserrat", sans-serif;\n --bc-chat-fontSize-xs: 10px;\n --bc-chat-fontSize-sm: 12px;\n --bc-chat-fontSize-md: 14px;\n --bc-chat-fontSize-lg: 18px;\n --bc-chat-fontSize-xl: 22px;\n --bc-chat-fontSize-xxl: 26px;\n --bc-chat-fontWeight-light: 100;\n --bc-chat-fontWeight-regular: 400;\n --bc-chat-fontWeight-medium: 500;\n --bc-chat-fontWeight-bold: 700;\n --bc-chat-lineHeight-xs: 18px;\n --bc-chat-lineHeight-sm: 22px;\n --bc-chat-lineHeight-md: 28px;\n --bc-chat-light-gray-color: #9b9b9b;\n --bc-chat-dark-gray-color: #4d4d4d;\n --bc-chat-agent-message-border-color: #95D5B2;\n --bc-chat-agent-message-background-start-color: #fff;\n --bc-chat-agent-message-background-end-color: #fff;\n --bc-chat-agent-message-text-color: #000;\n --bc-chat-client-message-border-color: #95D5B2;\n --bc-chat-client-message-background-start-color: #95D5B2;\n --bc-chat-client-message-background-end-color: #95D5B2;\n --bc-chat-client-message-text-color: #000;\n --bc-chat-danger-color: #d6312e;\n --bc-chat-success-color: #58aa18;\n --bc-chat-white-color: #fff;\n --bc-chat-radius: 5px; }\n');const Ce=l.default.div`
|
|
228
234
|
height: 100%;
|
|
229
235
|
display: flex;
|
|
230
236
|
flex-direction: column;
|
|
@@ -250,5 +256,5 @@
|
|
|
250
256
|
line-height: inherit;
|
|
251
257
|
font-weight: inherit;
|
|
252
258
|
}
|
|
253
|
-
`;exports.BCChat=({config:t={language:"EN",backgroundColor:"#dedede"},messages:a=[],sendMessage:i,debug:o,minimize:r})=>{const[s,c]=n.useState("MESSAGE_LIST"),l="interactive"===(a&&a.length>0&&a[a.length-1].type);return e.jsxs(
|
|
259
|
+
`;exports.BCChat=({config:t={language:"EN",backgroundColor:"#dedede"},messages:a=[],sendMessage:i,debug:o,minimize:r})=>{const[s,c]=n.useState("MESSAGE_LIST"),l="interactive"===(a&&a.length>0&&a[a.length-1].type);return e.jsxs(Ce,{className:"bc-chat",children:[t.hideHeader?null:e.jsx(me,{config:t,minimize:r}),"MESSAGE_LIST"==s?e.jsx(G,{messages:a,sendMessage:i,debug:o,config:t},"message-list"):null,e.jsx(e.Fragment,{children:l?e.jsx(fe,{forRate:!0}):e.jsx(se,{sendMessage:i,setView:c,config:t},"message-input")})]})};
|
|
254
260
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ieAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ieAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcrumbs.net/bc-chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"module": "build/index.es.js",
|
|
6
6
|
"jsnext:main": "build/index.es.js",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"ajv-keywords": "^5.1.0",
|
|
27
27
|
"mapbox-gl": "^1.13.0",
|
|
28
28
|
"mediaelement": "^4.2.14",
|
|
29
|
+
"mic-recorder-to-mp3": "^2.2.2",
|
|
29
30
|
"react-input-mask": "^2.0.4",
|
|
30
31
|
"react-mapbox-gl": "^3.9.2",
|
|
31
32
|
"react-markdown": "^9.0.1",
|