@onlive.ai/common-121 0.2.70 → 0.2.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/README.md +0 -1
  2. package/components/asset/asset-modal-portal.cjs +550 -0
  3. package/components/asset/asset-modal-portal.d.cts +22 -0
  4. package/components/asset/asset-modal-portal.d.ts +22 -0
  5. package/components/asset/asset-modal-portal.js +550 -0
  6. package/components/asset/asset.cjs +3536 -0
  7. package/components/asset/asset.d.cts +37 -0
  8. package/components/asset/asset.d.ts +37 -0
  9. package/components/asset/asset.js +3536 -0
  10. package/components/asset/asset.loaders.cjs +2 -0
  11. package/components/asset/asset.loaders.d.cts +17 -0
  12. package/components/asset/asset.loaders.d.ts +17 -0
  13. package/components/asset/asset.loaders.js +2 -0
  14. package/components/asset/asset.renderer.cjs +2292 -0
  15. package/components/asset/asset.renderer.d.cts +29 -0
  16. package/components/asset/asset.renderer.d.ts +29 -0
  17. package/components/asset/asset.renderer.js +2292 -0
  18. package/components/asset/asset.styles.cjs +683 -0
  19. package/components/asset/asset.styles.d.cts +6 -0
  20. package/components/asset/asset.styles.d.ts +6 -0
  21. package/components/asset/asset.styles.js +683 -0
  22. package/components/asset/asset.types.cjs +2 -0
  23. package/components/asset/asset.types.d.cts +103 -0
  24. package/components/asset/asset.types.d.ts +103 -0
  25. package/components/asset/asset.types.js +1 -0
  26. package/components/asset/index.cjs +3536 -0
  27. package/components/asset/index.d.cts +8 -0
  28. package/components/asset/index.d.ts +8 -0
  29. package/components/asset/index.js +3536 -0
  30. package/components/player/player.cjs +2044 -0
  31. package/components/player/player.d.cts +25 -0
  32. package/components/player/player.d.ts +25 -0
  33. package/components/player/player.js +2044 -0
  34. package/components/player/player.styles.cjs +16 -0
  35. package/components/player/player.styles.d.cts +6 -0
  36. package/components/player/player.styles.d.ts +6 -0
  37. package/components/player/player.styles.js +16 -0
  38. package/components/side-bar/index.cjs +3185 -0
  39. package/components/side-bar/index.d.cts +11 -0
  40. package/components/side-bar/index.d.ts +11 -0
  41. package/components/side-bar/index.js +3185 -0
  42. package/components/side-bar/side-bar.cjs +3185 -0
  43. package/components/side-bar/side-bar.d.cts +83 -0
  44. package/components/side-bar/side-bar.d.ts +83 -0
  45. package/components/side-bar/side-bar.js +3185 -0
  46. package/components/side-bar/side-bar.styles.cjs +801 -0
  47. package/components/side-bar/side-bar.styles.d.cts +6 -0
  48. package/components/side-bar/side-bar.styles.d.ts +6 -0
  49. package/components/side-bar/side-bar.styles.js +801 -0
  50. package/components/side-bar/side-bar.types.cjs +2 -0
  51. package/components/side-bar/side-bar.types.d.cts +105 -0
  52. package/components/side-bar/side-bar.types.d.ts +105 -0
  53. package/components/side-bar/side-bar.types.js +2 -0
  54. package/components/upload/index.cjs +83 -0
  55. package/components/upload/index.d.cts +4 -0
  56. package/components/upload/index.d.ts +4 -0
  57. package/components/upload/index.js +83 -0
  58. package/components/upload/upload.cjs +83 -0
  59. package/components/upload/upload.d.cts +28 -0
  60. package/components/upload/upload.d.ts +28 -0
  61. package/components/upload/upload.js +83 -0
  62. package/components/upload/upload.styles.cjs +65 -0
  63. package/components/upload/upload.styles.d.cts +6 -0
  64. package/components/upload/upload.styles.d.ts +6 -0
  65. package/components/upload/upload.styles.js +65 -0
  66. package/components/upload/upload.types.cjs +2 -0
  67. package/components/upload/upload.types.d.cts +16 -0
  68. package/components/upload/upload.types.d.ts +16 -0
  69. package/components/upload/upload.types.js +1 -0
  70. package/index.cjs +4677 -0
  71. package/index.d.cts +338 -0
  72. package/index.d.ts +338 -0
  73. package/index.js +4677 -0
  74. package/package.json +32 -11
  75. package/react/components/asset/Asset.cjs +2 -0
  76. package/react/components/asset/Asset.d.cts +33 -0
  77. package/react/components/asset/Asset.d.ts +33 -0
  78. package/react/components/asset/Asset.jsx +2 -0
  79. package/react/components/side-bar/SideBar.cjs +2 -0
  80. package/react/components/side-bar/SideBar.d.cts +37 -0
  81. package/react/components/side-bar/SideBar.d.ts +37 -0
  82. package/react/components/side-bar/SideBar.jsx +2 -0
  83. package/react/components/upload/Upload.cjs +2 -0
  84. package/react/components/upload/Upload.d.cts +23 -0
  85. package/react/components/upload/Upload.d.ts +23 -0
  86. package/react/components/upload/Upload.jsx +2 -0
  87. package/services/audio.service.cjs +2 -2
  88. package/services/audio.service.d.cts +1 -0
  89. package/services/audio.service.d.ts +1 -0
  90. package/services/audio.service.js +2 -2
  91. package/services/conversation/conversation.service.cjs +2 -0
  92. package/services/conversation/conversation.service.d.cts +533 -0
  93. package/services/conversation/conversation.service.d.ts +533 -0
  94. package/services/conversation/conversation.service.js +2 -0
  95. package/services/conversation/conversation.types.cjs +2 -0
  96. package/services/conversation/conversation.types.d.cts +519 -0
  97. package/services/conversation/conversation.types.d.ts +519 -0
  98. package/services/conversation/conversation.types.js +2 -0
  99. package/services/conversation/index.cjs +2 -0
  100. package/services/conversation/index.d.cts +7 -0
  101. package/services/conversation/index.d.ts +7 -0
  102. package/services/conversation/index.js +2 -0
  103. package/services/faqs/faqs.service.cjs +2 -0
  104. package/services/faqs/faqs.service.d.cts +16 -0
  105. package/services/faqs/faqs.service.d.ts +16 -0
  106. package/services/faqs/faqs.service.js +2 -0
  107. package/services/faqs/faqs.types.cjs +2 -0
  108. package/services/faqs/faqs.types.d.cts +60 -0
  109. package/services/faqs/faqs.types.d.ts +60 -0
  110. package/services/faqs/faqs.types.js +1 -0
  111. package/services/faqs/index.cjs +2 -0
  112. package/services/faqs/index.d.cts +3 -0
  113. package/services/faqs/index.d.ts +3 -0
  114. package/services/faqs/index.js +2 -0
  115. package/services/file/file.service.cjs +2 -0
  116. package/services/file/file.service.d.cts +66 -0
  117. package/services/file/file.service.d.ts +66 -0
  118. package/services/file/file.service.js +2 -0
  119. package/services/file/file.types.cjs +2 -0
  120. package/services/file/file.types.d.cts +72 -0
  121. package/services/file/file.types.d.ts +72 -0
  122. package/services/file/file.types.js +1 -0
  123. package/services/file/index.cjs +2 -0
  124. package/services/file/index.d.cts +3 -0
  125. package/services/file/index.d.ts +3 -0
  126. package/services/file/index.js +2 -0
  127. package/services/firebase/firebase-api.cjs +2 -2
  128. package/services/firebase/firebase-api.d.cts +25 -9
  129. package/services/firebase/firebase-api.d.ts +25 -9
  130. package/services/firebase/firebase-api.js +2 -2
  131. package/services/multimedia/config.example.cjs +2 -0
  132. package/services/multimedia/config.example.d.cts +13 -0
  133. package/services/multimedia/config.example.d.ts +13 -0
  134. package/services/multimedia/config.example.js +2 -0
  135. package/services/multimedia/index.cjs +2 -0
  136. package/services/multimedia/index.d.cts +3 -0
  137. package/services/multimedia/index.d.ts +3 -0
  138. package/services/multimedia/index.js +2 -0
  139. package/services/multimedia/multimedia.service.cjs +2 -0
  140. package/services/multimedia/multimedia.service.d.cts +28 -0
  141. package/services/multimedia/multimedia.service.d.ts +28 -0
  142. package/services/multimedia/multimedia.service.js +2 -0
  143. package/services/multimedia/multimedia.types.cjs +2 -0
  144. package/services/multimedia/multimedia.types.d.cts +65 -0
  145. package/services/multimedia/multimedia.types.d.ts +65 -0
  146. package/services/multimedia/multimedia.types.js +1 -0
  147. package/services/product/index.cjs +2 -0
  148. package/services/product/index.d.cts +3 -0
  149. package/services/product/index.d.ts +3 -0
  150. package/services/product/index.js +2 -0
  151. package/services/product/product.service.cjs +2 -0
  152. package/services/product/product.service.d.cts +19 -0
  153. package/services/product/product.service.d.ts +19 -0
  154. package/services/product/product.service.js +2 -0
  155. package/services/product/product.types.cjs +2 -0
  156. package/services/product/product.types.d.cts +78 -0
  157. package/services/product/product.types.d.ts +78 -0
  158. package/services/product/product.types.js +1 -0
  159. package/services/request.provider.cjs +1 -1
  160. package/services/request.provider.d.cts +1 -0
  161. package/services/request.provider.d.ts +1 -0
  162. package/services/request.provider.js +1 -1
  163. package/services/session.service.cjs +2 -0
  164. package/services/session.service.d.cts +70 -0
  165. package/services/session.service.d.ts +70 -0
  166. package/services/session.service.js +2 -0
  167. package/services/upload/index.cjs +2 -0
  168. package/services/upload/index.d.cts +2 -0
  169. package/services/upload/index.d.ts +2 -0
  170. package/services/upload/index.js +2 -0
  171. package/services/upload/upload.service.cjs +2 -0
  172. package/services/upload/upload.service.d.cts +81 -0
  173. package/services/upload/upload.service.d.ts +81 -0
  174. package/services/upload/upload.service.js +2 -0
  175. package/themes/dark.cjs +4 -1
  176. package/themes/dark.d.cts +1 -0
  177. package/themes/dark.d.ts +1 -0
  178. package/themes/dark.js +4 -1
  179. package/themes/light.cjs +1 -1
  180. package/themes/light.d.cts +1 -0
  181. package/themes/light.d.ts +1 -0
  182. package/themes/light.js +1 -1
  183. package/types/globals.cjs +2 -0
  184. package/types/globals.d.cts +39 -0
  185. package/types/globals.d.ts +39 -0
  186. package/types/globals.js +1 -0
  187. package/types/tracking-options.cjs +2 -2
  188. package/types/tracking-options.d.cts +8 -6
  189. package/types/tracking-options.d.ts +8 -6
  190. package/types/tracking-options.js +1 -1
  191. package/utils/adopt-styles.cjs +2 -2
  192. package/utils/adopt-styles.d.cts +1 -0
  193. package/utils/adopt-styles.d.ts +1 -0
  194. package/utils/adopt-styles.js +2 -2
  195. package/utils/browser-preferences.cjs +2 -2
  196. package/utils/browser-preferences.d.cts +1 -0
  197. package/utils/browser-preferences.d.ts +1 -0
  198. package/utils/browser-preferences.js +2 -2
  199. package/utils/classify-media.cjs +1 -1
  200. package/utils/classify-media.d.cts +1 -0
  201. package/utils/classify-media.d.ts +1 -0
  202. package/utils/classify-media.js +1 -1
  203. package/utils/decorators.cjs +1 -1
  204. package/utils/decorators.d.cts +1 -0
  205. package/utils/decorators.d.ts +1 -0
  206. package/utils/decorators.js +1 -1
  207. package/utils/detected-lang.cjs +2 -2
  208. package/utils/detected-lang.d.cts +1 -0
  209. package/utils/detected-lang.d.ts +1 -0
  210. package/utils/detected-lang.js +2 -2
  211. package/utils/fullscreen.cjs +2 -2
  212. package/utils/fullscreen.d.cts +6 -5
  213. package/utils/fullscreen.d.ts +6 -5
  214. package/utils/fullscreen.js +2 -2
  215. package/utils/insert-script.cjs +1 -1
  216. package/utils/insert-script.d.cts +1 -0
  217. package/utils/insert-script.d.ts +1 -0
  218. package/utils/insert-script.js +1 -1
  219. package/utils/is-map-compatible.cjs +1 -1
  220. package/utils/is-map-compatible.d.cts +1 -0
  221. package/utils/is-map-compatible.d.ts +1 -0
  222. package/utils/is-map-compatible.js +1 -1
  223. package/utils/markdown.cjs +2 -2
  224. package/utils/markdown.d.cts +1 -0
  225. package/utils/markdown.d.ts +1 -0
  226. package/utils/markdown.js +2 -2
  227. package/utils/merge.cjs +2 -2
  228. package/utils/merge.d.cts +2 -1
  229. package/utils/merge.d.ts +2 -1
  230. package/utils/merge.js +2 -2
  231. package/utils/multiband-track-volume.cjs +2 -2
  232. package/utils/multiband-track-volume.d.cts +1 -0
  233. package/utils/multiband-track-volume.d.ts +1 -0
  234. package/utils/multiband-track-volume.js +2 -2
  235. package/utils/onlive-url-params.cjs +1 -1
  236. package/utils/onlive-url-params.d.cts +1 -0
  237. package/utils/onlive-url-params.d.ts +1 -0
  238. package/utils/onlive-url-params.js +1 -1
  239. package/utils/pretty-distance.cjs +2 -2
  240. package/utils/pretty-distance.d.cts +2 -1
  241. package/utils/pretty-distance.d.ts +2 -1
  242. package/utils/pretty-distance.js +2 -2
  243. package/utils/pretty-time.cjs +2 -0
  244. package/utils/pretty-time.d.cts +16 -0
  245. package/utils/pretty-time.d.ts +16 -0
  246. package/utils/pretty-time.js +2 -0
  247. package/utils/random-string.cjs +1 -1
  248. package/utils/random-string.d.cts +1 -0
  249. package/utils/random-string.d.ts +1 -0
  250. package/utils/random-string.js +1 -1
  251. package/utils/resource-type.cjs +1 -1
  252. package/utils/resource-type.d.cts +1 -0
  253. package/utils/resource-type.d.ts +1 -0
  254. package/utils/resource-type.js +1 -1
  255. package/utils/round-number.cjs +2 -0
  256. package/utils/round-number.d.cts +30 -0
  257. package/utils/round-number.d.ts +30 -0
  258. package/utils/round-number.js +2 -0
  259. package/utils/safe-html.cjs +2 -2
  260. package/utils/safe-html.d.cts +4 -3
  261. package/utils/safe-html.d.ts +4 -3
  262. package/utils/safe-html.js +2 -2
  263. package/utils/sanitize.cjs +2 -2
  264. package/utils/sanitize.d.cts +1 -0
  265. package/utils/sanitize.d.ts +1 -0
  266. package/utils/sanitize.js +2 -2
  267. package/utils/spread.cjs +2 -2
  268. package/utils/spread.d.cts +1 -0
  269. package/utils/spread.d.ts +1 -0
  270. package/utils/spread.js +2 -2
  271. package/utils/watch.cjs +1 -1
  272. package/utils/watch.d.cts +1 -0
  273. package/utils/watch.d.ts +1 -0
  274. package/utils/watch.js +1 -1
  275. package/services/firebase/firebase.service.cjs +0 -2
  276. package/services/firebase/firebase.service.d.cts +0 -40
  277. package/services/firebase/firebase.service.d.ts +0 -40
  278. package/services/firebase/firebase.service.js +0 -2
  279. package/services/livekit.service.cjs +0 -2
  280. package/services/livekit.service.d.cts +0 -219
  281. package/services/livekit.service.d.ts +0 -219
  282. package/services/livekit.service.js +0 -2
  283. package/types/window-context.cjs +0 -2
  284. package/types/window-context.d.cts +0 -8
  285. package/types/window-context.d.ts +0 -8
  286. package/types/window-context.js +0 -1
package/package.json CHANGED
@@ -1,34 +1,55 @@
1
1
  {
2
2
  "name": "@onlive.ai/common-121",
3
- "version": "0.2.70",
3
+ "version": "0.2.163",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "**/*.js",
7
7
  "**/*.cjs",
8
+ "**/*.jsx",
8
9
  "**/*.d.ts",
9
10
  "**/*.d.cts",
10
11
  "!./*.iife.js",
11
12
  "!./themes/custom/**",
12
13
  "!./node_modules/**"
13
14
  ],
15
+ "main": "./index.cjs",
16
+ "module": "./index.js",
17
+ "types": "./index.d.ts",
14
18
  "exports": {
19
+ ".": {
20
+ "types": "./index.d.ts",
21
+ "import": "./index.js",
22
+ "require": "./index.cjs"
23
+ },
15
24
  "./utils/*": "./utils/*",
16
25
  "./types/*": "./types/*",
17
26
  "./services/*": "./services/*",
18
- "./themes/*": "./themes/*"
27
+ "./themes/*": "./themes/*",
28
+ "./components/*": "./components/*",
29
+ "./react/*": "./react/*"
19
30
  },
20
31
  "dependencies": {
21
32
  "@formatjs/intl-localematcher": "^0.5.10",
22
- "@livekit/components-core": "^0.12.5",
23
- "@onlive.ai/tracker": "^1.0.13",
24
- "dompurify": "^3.2.5",
25
- "firebase": "^11.7.3",
26
- "lit": "^3.3.0",
27
- "livekit-client": "^2.13.0",
28
- "marked": "^15.0.11",
33
+ "@lit/react": "^1.0.8",
34
+ "@livekit/components-core": "^0.12.12",
35
+ "@onlive.ai/tracker": "^1.0.18",
36
+ "@onlive.ai/ui": "^1.9.3",
37
+ "dompurify": "^3.3.1",
38
+ "firebase": "^11.10.0",
39
+ "lit": "^3.3.1",
40
+ "livekit-client": "^2.16.1",
41
+ "marked": "^15.0.12",
29
42
  "rxjs": "^7.8.2",
30
- "tsup": "^8.5.0",
31
- "typescript": "~5.7.3"
43
+ "tsup": "^8.5.1",
44
+ "typescript": "~5.7.3",
45
+ "video.js": "^8.23.4"
46
+ },
47
+ "devDependencies": {
48
+ "@types/react": "^19.2.7",
49
+ "react": "^19.2.3"
50
+ },
51
+ "peerDependencies": {
52
+ "react": "^19.1.1"
32
53
  },
33
54
  "scripts": {
34
55
  "build:package": "tsup",
@@ -0,0 +1,2 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ "use strict";var E=Object.create;var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var N=(t,e)=>{for(var s in e)a(t,s,{get:e[s],enumerable:!0})},m=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l(e))!C.call(t,o)&&o!==s&&a(t,o,{get:()=>e[o],enumerable:!(n=i(e,o))||n.enumerable});return t};var d=(t,e,s)=>(s=t!=null?E(A(t)):{},m(e||!t||!t.__esModule?a(s,"default",{value:t,enumerable:!0}):s,t)),f=t=>m(a({},"__esModule",{value:!0}),t);var I={};N(I,{Asset:()=>v,default:()=>u});module.exports=f(I);var r=require("@lit/react"),c=d(require("react"),1),p=require("../../../components/asset/asset.js"),v=(0,r.createComponent)({tagName:"osb-asset",elementClass:p.OSBAsset,react:c.default,events:{onAssetClick:"asset-click",onAssetDownload:"asset-download",onAssetLoad:"asset-load",onAssetError:"asset-error",onContentClick:"content-click"}}),u=v;0&&(module.exports={Asset});
@@ -0,0 +1,33 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import * as _lit_react from '@lit/react';
3
+ import { EventName } from '@lit/react';
4
+ import { OSBAsset } from '../../../components/asset/asset.js';
5
+ import { IAsset } from '../../../components/asset/asset.types.js';
6
+
7
+ /**
8
+ * React wrapper for the OSBAsset web component
9
+ *
10
+ * This component provides a React-friendly interface for the Onlive Asset component.
11
+ * It supports rendering different types of assets (image, video, presentation, product, faq)
12
+ * with download and modal functionality.
13
+ */
14
+ declare const Asset: _lit_react.ReactWebComponent<OSBAsset, {
15
+ onAssetClick: EventName<CustomEvent<{
16
+ asset: IAsset;
17
+ }>>;
18
+ onAssetDownload: EventName<CustomEvent<{
19
+ asset: IAsset;
20
+ }>>;
21
+ onAssetLoad: EventName<CustomEvent<{
22
+ asset: IAsset;
23
+ }>>;
24
+ onAssetError: EventName<CustomEvent<{
25
+ error: string;
26
+ asset: IAsset;
27
+ }>>;
28
+ onContentClick: EventName<CustomEvent<{
29
+ content: any;
30
+ }>>;
31
+ }>;
32
+
33
+ export { Asset, Asset as default };
@@ -0,0 +1,33 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import * as _lit_react from '@lit/react';
3
+ import { EventName } from '@lit/react';
4
+ import { OSBAsset } from '../../../components/asset/asset.js';
5
+ import { IAsset } from '../../../components/asset/asset.types.js';
6
+
7
+ /**
8
+ * React wrapper for the OSBAsset web component
9
+ *
10
+ * This component provides a React-friendly interface for the Onlive Asset component.
11
+ * It supports rendering different types of assets (image, video, presentation, product, faq)
12
+ * with download and modal functionality.
13
+ */
14
+ declare const Asset: _lit_react.ReactWebComponent<OSBAsset, {
15
+ onAssetClick: EventName<CustomEvent<{
16
+ asset: IAsset;
17
+ }>>;
18
+ onAssetDownload: EventName<CustomEvent<{
19
+ asset: IAsset;
20
+ }>>;
21
+ onAssetLoad: EventName<CustomEvent<{
22
+ asset: IAsset;
23
+ }>>;
24
+ onAssetError: EventName<CustomEvent<{
25
+ error: string;
26
+ asset: IAsset;
27
+ }>>;
28
+ onContentClick: EventName<CustomEvent<{
29
+ content: any;
30
+ }>>;
31
+ }>;
32
+
33
+ export { Asset, Asset as default };
@@ -0,0 +1,2 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import{createComponent as t}from"@lit/react";import e from"react";import{OSBAsset as s}from"../../../components/asset/asset.js";var o=t({tagName:"osb-asset",elementClass:s,react:e,events:{onAssetClick:"asset-click",onAssetDownload:"asset-download",onAssetLoad:"asset-load",onAssetError:"asset-error",onContentClick:"content-click"}}),r=o;export{o as Asset,r as default};
@@ -0,0 +1,2 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ "use strict";var d=Object.create;var n=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var a in t)n(e,a,{get:t[a],enumerable:!0})},m=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of E(t))!p.call(e,o)&&o!==a&&n(e,o,{get:()=>t[o],enumerable:!(r=v(t,o))||r.enumerable});return e};var y=(e,t,a)=>(a=e!=null?d(l(e)):{},m(t||!e||!e.__esModule?n(a,"default",{value:e,enumerable:!0}):a,e)),C=e=>m(n({},"__esModule",{value:!0}),e);var f={};u(f,{SideBar:()=>c,default:()=>N});module.exports=C(f);var s=require("@lit/react"),i=y(require("react"),1),g=require("../../../components/side-bar/side-bar.js"),c=(0,s.createComponent)({tagName:"osb-side-bar",elementClass:g.OSBSideBar,react:i.default,events:{onSearch:"search",onLoadMore:"load-more",onItemAdd:"item-add",onCategoryChange:"category-change",onItemSelect:"item-select",onFileUpload:"file-uploaded"}}),N=c;0&&(module.exports={SideBar});
@@ -0,0 +1,37 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import * as _lit_react from '@lit/react';
3
+ import { EventName } from '@lit/react';
4
+ import { OSBSideBar } from '../../../components/side-bar/side-bar.js';
5
+
6
+ /**
7
+ * React wrapper for the OSBSideBar web component
8
+ *
9
+ * This component provides a React-friendly interface for the Onlive SideBar component.
10
+ * It supports rendering different types of content with customizable display options.
11
+ */
12
+ declare const SideBar: _lit_react.ReactWebComponent<OSBSideBar, {
13
+ onSearch: EventName<CustomEvent<{
14
+ query: string;
15
+ category: string;
16
+ }>>;
17
+ onLoadMore: EventName<CustomEvent<{
18
+ category: string;
19
+ }>>;
20
+ onItemAdd: EventName<CustomEvent<{
21
+ category: string;
22
+ }>>;
23
+ onCategoryChange: EventName<CustomEvent<{
24
+ category: string;
25
+ }>>;
26
+ onItemSelect: EventName<CustomEvent<{
27
+ item: any;
28
+ }>>;
29
+ onFileUpload: EventName<CustomEvent<{
30
+ id: string;
31
+ name: string;
32
+ url: string;
33
+ type: string;
34
+ }>>;
35
+ }>;
36
+
37
+ export { SideBar, SideBar as default };
@@ -0,0 +1,37 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import * as _lit_react from '@lit/react';
3
+ import { EventName } from '@lit/react';
4
+ import { OSBSideBar } from '../../../components/side-bar/side-bar.js';
5
+
6
+ /**
7
+ * React wrapper for the OSBSideBar web component
8
+ *
9
+ * This component provides a React-friendly interface for the Onlive SideBar component.
10
+ * It supports rendering different types of content with customizable display options.
11
+ */
12
+ declare const SideBar: _lit_react.ReactWebComponent<OSBSideBar, {
13
+ onSearch: EventName<CustomEvent<{
14
+ query: string;
15
+ category: string;
16
+ }>>;
17
+ onLoadMore: EventName<CustomEvent<{
18
+ category: string;
19
+ }>>;
20
+ onItemAdd: EventName<CustomEvent<{
21
+ category: string;
22
+ }>>;
23
+ onCategoryChange: EventName<CustomEvent<{
24
+ category: string;
25
+ }>>;
26
+ onItemSelect: EventName<CustomEvent<{
27
+ item: any;
28
+ }>>;
29
+ onFileUpload: EventName<CustomEvent<{
30
+ id: string;
31
+ name: string;
32
+ url: string;
33
+ type: string;
34
+ }>>;
35
+ }>;
36
+
37
+ export { SideBar, SideBar as default };
@@ -0,0 +1,2 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import{createComponent as e}from"@lit/react";import t from"react";import{OSBSideBar as a}from"../../../components/side-bar/side-bar.js";var o=e({tagName:"osb-side-bar",elementClass:a,react:t,events:{onSearch:"search",onLoadMore:"load-more",onItemAdd:"item-add",onCategoryChange:"category-change",onItemSelect:"item-select",onFileUpload:"file-uploaded"}}),s=o;export{o as SideBar,s as default};
@@ -0,0 +1,2 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ "use strict";var i=Object.create;var p=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var y=(e,o)=>{for(var t in o)p(e,t,{get:o[t],enumerable:!0})},l=(e,o,t,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of f(o))!v.call(e,r)&&r!==t&&p(e,r,{get:()=>o[r],enumerable:!(a=c(o,r))||a.enumerable});return e};var E=(e,o,t)=>(t=e!=null?i(u(e)):{},l(o||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),U=e=>l(p({},"__esModule",{value:!0}),e);var N={};y(N,{Upload:()=>d,default:()=>C});module.exports=U(N);var m=require("@lit/react"),s=E(require("react"),1),n=require("../../../components/upload/upload.js"),d=(0,m.createComponent)({tagName:"osb-upload",elementClass:n.OSBUpload,react:s.default,events:{onFileSelected:"osb-file-selected",onUploadError:"osb-upload-error"}}),C=d;0&&(module.exports={Upload});
@@ -0,0 +1,23 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import * as _lit_react from '@lit/react';
3
+ import { EventName } from '@lit/react';
4
+ import { OSBUpload } from '../../../components/upload/upload.js';
5
+ import { UploadType } from '../../../components/upload/upload.types.js';
6
+
7
+ /**
8
+ * React wrapper for the OSBUpload web component
9
+ *
10
+ * This component provides a React-friendly interface for the Onlive Upload component.
11
+ * It supports file selection with customizable trigger button and dropdown menu for different file types.
12
+ */
13
+ declare const Upload: _lit_react.ReactWebComponent<OSBUpload, {
14
+ onFileSelected: EventName<CustomEvent<{
15
+ file: File;
16
+ type: UploadType;
17
+ }>>;
18
+ onUploadError: EventName<CustomEvent<{
19
+ error: string;
20
+ }>>;
21
+ }>;
22
+
23
+ export { Upload, Upload as default };
@@ -0,0 +1,23 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import * as _lit_react from '@lit/react';
3
+ import { EventName } from '@lit/react';
4
+ import { OSBUpload } from '../../../components/upload/upload.js';
5
+ import { UploadType } from '../../../components/upload/upload.types.js';
6
+
7
+ /**
8
+ * React wrapper for the OSBUpload web component
9
+ *
10
+ * This component provides a React-friendly interface for the Onlive Upload component.
11
+ * It supports file selection with customizable trigger button and dropdown menu for different file types.
12
+ */
13
+ declare const Upload: _lit_react.ReactWebComponent<OSBUpload, {
14
+ onFileSelected: EventName<CustomEvent<{
15
+ file: File;
16
+ type: UploadType;
17
+ }>>;
18
+ onUploadError: EventName<CustomEvent<{
19
+ error: string;
20
+ }>>;
21
+ }>;
22
+
23
+ export { Upload, Upload as default };
@@ -0,0 +1,2 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ import{createComponent as e}from"@lit/react";import o from"react";import{OSBUpload as t}from"../../../components/upload/upload.js";var r=e({tagName:"osb-upload",elementClass:t,react:o,events:{onFileSelected:"osb-file-selected",onUploadError:"osb-upload-error"}}),m=r;export{r as Upload,m as default};
@@ -1,2 +1,2 @@
1
- /*! @onlive.ai/common-121 v0.2.70 | © 2025 Onlive.ai */
2
- "use strict";var u=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var p=(t,n,i)=>n in t?u(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i;var g=(t,n)=>{for(var i in n)u(t,i,{get:n[i],enumerable:!0})},h=(t,n,i,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of d(n))!l.call(t,e)&&e!==i&&u(t,e,{get:()=>n[e],enumerable:!(o=c(n,e))||o.enumerable});return t};var S=t=>h(u({},"__esModule",{value:!0}),t);var r=(t,n,i)=>p(t,typeof n!="symbol"?n+"":n,i);var v={};g(v,{AudioService:()=>a});module.exports=S(v);var s=class s{constructor(){r(this,"sounds",new Map);r(this,"currentSound",null);this.loadSound("ringing","https://a.slack-edge.com/bv1-13/flitterbug-77334dc.mp3"),this.loadSound("incoming","https://cdn.onlive.site/widget-assets/call_phone_ring_tone.mp3")}static getInstance(){return s.instance||(s.instance=new s),s.instance}loadSound(n,i){let o=new Audio(i);o.preload="auto",this.sounds.set(n,o)}playSound(n,i=!1){this.stopCurrentSound();let o=this.sounds.get(n);o&&(o.loop=i,o.currentTime=0,o.play().catch(e=>console.warn("Error playing sound:",e)),this.currentSound=o)}stopCurrentSound(){this.currentSound&&(this.currentSound.pause(),this.currentSound.currentTime=0,this.currentSound=null)}playRinging(n=!0){this.playSound("ringing",n)}playIncoming(n=!0){this.playSound("incoming",n)}};r(s,"instance");var a=s;0&&(module.exports={AudioService});
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ "use strict";var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var d=(t,n)=>{for(var o in n)s(t,o,{get:n[o],enumerable:!0})},l=(t,n,o,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of a(n))!c.call(t,e)&&e!==o&&s(t,e,{get:()=>n[e],enumerable:!(i=r(n,e))||i.enumerable});return t};var p=t=>l(s({},"__esModule",{value:!0}),t);var g={};d(g,{AudioService:()=>u});module.exports=p(g);var u=class t{constructor(){this.sounds=new Map;this.currentSound=null;this.loadSound("ringing","https://a.slack-edge.com/bv1-13/flitterbug-77334dc.mp3"),this.loadSound("incoming","https://cdn.onlive.site/widget-assets/call_phone_ring_tone.mp3")}static getInstance(){return t.instance||(t.instance=new t),t.instance}loadSound(n,o){let i=new Audio(o);i.preload="auto",this.sounds.set(n,i)}playSound(n,o=!1){this.stopCurrentSound();let i=this.sounds.get(n);i&&(i.loop=o,i.currentTime=0,i.play().catch(e=>console.warn("Error playing sound:",e)),this.currentSound=i)}stopCurrentSound(){this.currentSound&&(this.currentSound.pause(),this.currentSound.currentTime=0,this.currentSound=null)}playRinging(n=!0){this.playSound("ringing",n)}playIncoming(n=!0){this.playSound("incoming",n)}};0&&(module.exports={AudioService});
@@ -1,3 +1,4 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
1
2
  declare class AudioService {
2
3
  private static instance;
3
4
  private sounds;
@@ -1,3 +1,4 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
1
2
  declare class AudioService {
2
3
  private static instance;
3
4
  private sounds;
@@ -1,2 +1,2 @@
1
- /*! @onlive.ai/common-121 v0.2.70 | © 2025 Onlive.ai */
2
- var a=Object.defineProperty;var c=(e,n,t)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var s=(e,n,t)=>c(e,typeof n!="symbol"?n+"":n,t);var o=class o{constructor(){s(this,"sounds",new Map);s(this,"currentSound",null);this.loadSound("ringing","https://a.slack-edge.com/bv1-13/flitterbug-77334dc.mp3"),this.loadSound("incoming","https://cdn.onlive.site/widget-assets/call_phone_ring_tone.mp3")}static getInstance(){return o.instance||(o.instance=new o),o.instance}loadSound(n,t){let i=new Audio(t);i.preload="auto",this.sounds.set(n,i)}playSound(n,t=!1){this.stopCurrentSound();let i=this.sounds.get(n);i&&(i.loop=t,i.currentTime=0,i.play().catch(r=>console.warn("Error playing sound:",r)),this.currentSound=i)}stopCurrentSound(){this.currentSound&&(this.currentSound.pause(),this.currentSound.currentTime=0,this.currentSound=null)}playRinging(n=!0){this.playSound("ringing",n)}playIncoming(n=!0){this.playSound("incoming",n)}};s(o,"instance");var u=o;export{u as AudioService};
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ var e=class i{constructor(){this.sounds=new Map;this.currentSound=null;this.loadSound("ringing","https://a.slack-edge.com/bv1-13/flitterbug-77334dc.mp3"),this.loadSound("incoming","https://cdn.onlive.site/widget-assets/call_phone_ring_tone.mp3")}static getInstance(){return i.instance||(i.instance=new i),i.instance}loadSound(t,o){let n=new Audio(o);n.preload="auto",this.sounds.set(t,n)}playSound(t,o=!1){this.stopCurrentSound();let n=this.sounds.get(t);n&&(n.loop=o,n.currentTime=0,n.play().catch(s=>console.warn("Error playing sound:",s)),this.currentSound=n)}stopCurrentSound(){this.currentSound&&(this.currentSound.pause(),this.currentSound.currentTime=0,this.currentSound=null)}playRinging(t=!0){this.playSound("ringing",t)}playIncoming(t=!0){this.playSound("incoming",t)}};export{e as AudioService};
@@ -0,0 +1,2 @@
1
+ /*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
2
+ "use strict";var b=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var k=(o,e)=>{for(var t in e)b(o,t,{get:e[t],enumerable:!0})},M=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!x.call(o,n)&&n!==t&&b(o,n,{get:()=>e[n],enumerable:!(i=S(e,n))||i.enumerable});return o};var z=o=>M(b({},"__esModule",{value:!0}),o);var q={};k(q,{ConversationService:()=>f,Room:()=>y});module.exports=z(q);var m=require("@onlive.ai/tracker"),p=require("livekit-client");var v=require("firebase/app"),s=require("firebase/database"),u=class{constructor(e){this.onChildChanged=(e,t)=>(0,s.onChildChanged)(this.ref(e),i=>t(i.key||"",i.val(),i));this.onChildRemoved=(e,t)=>(0,s.onChildRemoved)(this.ref(e),i=>t(i.key||"",i.val(),i));this.onChildChangedQuery=(e,t)=>(0,s.onChildChanged)(e,i=>t(i.key||"",i.val(),i));this.onChildRemovedQuery=(e,t)=>(0,s.onChildRemoved)(e,i=>t(i.key||"",i.val(),i));let t=(0,v.initializeApp)(e.config);this.db=(0,s.getDatabase)(t)}ref(e){return(0,s.ref)(this.db,e)}async getOnce(e){let t=await(0,s.get)(this.ref(e));return t.exists()?t.val():null}async getOnceQuery(e){let t=await(0,s.get)(e),i=[];return t.exists()&&t.forEach(n=>{i.push({key:n.key||"",value:n.val()})}),i}onValue(e,t){return(0,s.onValue)(this.ref(e),i=>t(i.key??"",i.val(),i),i=>console.error("onValue error",i))}onValueQuery(e,t){return(0,s.onValue)(e,i=>t(i.key??"",i.val(),i),i=>console.error("onValueQuery error",i))}onChildAdded(e,t){return(0,s.onChildAdded)(this.ref(e),i=>t(i.key||"",i.val(),i),i=>console.error("onChildAdded error",i))}onChildAddedQuery(e,t){return(0,s.onChildAdded)(e,i=>t(i.key||"",i.val(),i),i=>console.error("onChildAddedQuery error",i))}write(e,t){return(0,s.set)(this.ref(e),t)}update(e,t){return(0,s.update)(this.ref(e),t)}remove(e){return(0,s.remove)(this.ref(e))}async push(e,t){let i=(0,s.push)(this.ref(e));return await(0,s.set)(i,t),i.key}onDisconnectUpdate(e,t){return(0,s.onDisconnect)(this.ref(e)).update(t)}cancelOnDisconnect(e){return(0,s.onDisconnect)(this.ref(e)).cancel()}transaction(e,t){return(0,s.runTransaction)(this.ref(e),i=>t(i))}query(e,t={}){let i=this.ref(e);return t.orderBy==="child"&&t.childKey&&(i=(0,s.query)(i,(0,s.orderByChild)(t.childKey))),t.orderBy==="key"&&(i=(0,s.query)(i,(0,s.orderByKey)())),t.orderBy==="value"&&(i=(0,s.query)(i,(0,s.orderByValue)())),t.startAt!=null&&(i=(0,s.query)(i,(0,s.startAt)(t.startAt))),t.endAt!=null&&(i=(0,s.query)(i,(0,s.endAt)(t.endAt))),t.equalTo!=null&&(i=(0,s.query)(i,(0,s.equalTo)(t.equalTo))),t.limitFirst!=null&&(i=(0,s.query)(i,(0,s.limitToFirst)(t.limitFirst))),t.limitLast!=null&&(i=(0,s.query)(i,(0,s.limitToLast)(t.limitLast))),i}};var l=async(o,e)=>{let t=await fetch(o,e);if(!t.ok){let i=await t.json().catch(()=>({}));throw new Error(JSON.stringify({status:t.status,statusText:t.statusText,...i}))}return t&&t.json()};var T=o=>{let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="";for(let i=0;i<o;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t};var c=require("@onlive.ai/tracker"),d="chatbot",h=class o{static hasSession(){return!!c.Session.getCookie(d)}static getSession(e={role:"guest",regenerate:!1}){e.regenerate&&(c.Session.id=c.Generator.uuid(),c.Session.deleteCookie(d));let t=c.Session.getCookie(d);return t&&o.isValidSession(t,e.role)?t:o.createSession(e.role)}static createSession(e){let t={externalId:e==="agent"?String(o.getUserId()||c.Session.id):c.Session.id,secret:T(16),createdAt:new Date().toISOString()};return c.Session.setCookie(d,t,3600*24*365),t}static isValidSession(e,t){if(t==="guest")return!0;let i=o.getUserId();return!!(i&&String(i)===e.externalId)}static getUserId(){return c.Session.getCookie("user-id",{objectKey:"userId",storageKey:"user",storageType:"localStorage",ttl:3600*24*365,preserveData:!0})}static updateSessionWithRegistrationData(e){let t=c.Session.getCookie(d);if(t||(t=o.createSession("guest")),t){let i={...t,registrationData:e};c.Session.setCookie(d,i,3600*24*365)}}static hasRegistrationData(){return!!c.Session.getCookie(d)?.registrationData}static async getAgentInfo(e){return fetch(`${e}/api/v1/auth/user-info`,{credentials:"include"}).then(t=>t.json())}static getRegistrationData(){return c.Session.getCookie(d)?.registrationData}};var C="lk.chat",I="lk.transcription",A="lk.events",R="typing-indicator";var y=class extends p.Room{},f=class{constructor(e){this.listeners=new Set;this.typingListeners=new Set;this.transcriptionMap=new Map;this.abortControllers={register:new AbortController,createRoom:new AbortController,closeRoom:new AbortController,evaluateRoom:new AbortController,persistMessage:new AbortController,sendMessageReport:new AbortController,deleteMessageReport:new AbortController,updateMessageReactions:new AbortController,getRooms:new AbortController};this.authToken=null;this.firebaseUnsubscribers={};this.seenRequestIds=new Set;this.lastSnapshotById=new Map;this.handleIncomingMessage=async(e,t)=>{let i=e?.info?.id,n=e.info?.attributes?.["lk.segment_id"];n&&(this.transcriptionMap.has(n)?i=this.transcriptionMap.get(n)||"":this.transcriptionMap.set(n,i));let r=t?.identity?this.room.getParticipantByIdentity(t.identity):void 0,a="";for await(let g of e)a+=g,this.emitMessage({id:i,timestamp:Date.now(),message:a,assets:JSON.parse(e.info?.attributes?.assets||"[]"),from:r});this.messagePersistence==="client"&&this.persistMessage({roomId:this.room.id,content:a,externalId:i,identity:r?.identity,kind:r?.kind})};this.emitMessage=e=>{for(let t of this.listeners)t([e])};this.handleDataReceived=(e,t,i,n)=>{if(n===R)try{let r=JSON.parse(new TextDecoder().decode(e));if(r.type==="typing"&&r.participantId!==this.room.localParticipant.identity){let a={type:"typing",isTyping:r.isTyping,timestamp:r.timestamp,participantId:r.participantId};this.emitTypingIndicator(a)}}catch(r){console.warn("Failed to parse typing indicator:",r)}};this.emitTypingIndicator=e=>{for(let t of this.typingListeners)t(e)};this.apiUrl=e.apiUrl,this.authUrl=e.authUrl,this.organizationId=e.organizationId,this.channelTopic=e.channelTopic||C,this.transcriptionTopic=e.transcriptionTopic||I,this.eventsTopic=e.eventsTopic||A,this.messagePersistence=e.messagePersistence||"disabled",this.room=this.createRoomInstance(),e.firebaseConfig&&this.initializeFirebase(e.firebaseConfig)}createRoomInstance(){return new y({adaptiveStream:!0,dynacast:!0})}ensureRoom(){return this.room||(this.room=this.createRoomInstance()),this.room}initializeFirebase(e){this.firebaseApi=new u({config:e}),this.presencePath=`orgs/${this.organizationId}/presence`,this.callsPath=`orgs/${this.organizationId}/calls`}initializeRoomHandlers(){try{this.room.unregisterTextStreamHandler(this.channelTopic),this.room.unregisterTextStreamHandler(this.transcriptionTopic)}catch{}this.room.off(p.RoomEvent.DataReceived,this.handleDataReceived),this.room.registerTextStreamHandler(this.channelTopic,this.handleIncomingMessage),this.room.registerTextStreamHandler(this.transcriptionTopic,this.handleIncomingMessage),this.room.on(p.RoomEvent.DataReceived,this.handleDataReceived)}async registerUser(e,t,i,n){let r=await l(`${this.apiUrl}/users/register`,{method:"POST",body:JSON.stringify({externalId:e,secret:t,...i,metadata:n}),headers:{"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.register.signal});return this.authToken=r.token,r}async registerAgent(e,t){let i=m.Session.getCookie("livekit-agent-token");if(i){if(this.decodeJwtPayload(i)?.username===t.name)return this.authToken=i,i;m.Session.deleteCookie("livekit-agent-token")}let n=await l(`${this.authUrl}/admins/register`,{method:"POST",body:JSON.stringify({externalId:e,name:t.name,email:t.email,avatar:t.avatar}),headers:{"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},credentials:"include",signal:this.abortControllers.register.signal});return m.Session.setCookie("livekit-agent-token",n.token,1440*60),this.authToken=n.token,n.token}decodeJwtPayload(e){try{let t=e.split(".");if(t.length!==3)return null;let i=t[1],n=atob(i.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(n)}catch{return null}}async createRoom(e,t={}){this.room=this.ensureRoom();let i=await l(`${this.apiUrl}/rooms`,{method:"POST",body:JSON.stringify(e),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.createRoom.signal});return this.setRoomMetadata(i),this.setupParticipantAttributesHandler(),this.room.connect(i.wsURL,i.token).then(()=>{this.room.localParticipant.setAttributes(t)}),this.initializeRoomHandlers(),this.room}async joinRoom(e,t,i,n){let r=await l(`${this.apiUrl}/rooms/${e}/join`,{method:"POST",body:JSON.stringify({timezone:t,language:i,...n??{}}),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.createRoom.signal});return this.setRoomMetadata(r),this.setupParticipantAttributesHandler(),await this.room.connect(r.wsURL,r.token),this.initializeRoomHandlers(),this.room}setRoomMetadata(e){this.room.id=e.id,this.room.groupId=e.groupId,this.room.createdAt=e.createdAt,this.room.connectedAt=new Date().toISOString()}setupParticipantAttributesHandler(){this.room.on(p.RoomEvent.ParticipantAttributesChanged,e=>{e.identity===this.room.localParticipant.identity&&h.updateSessionWithRegistrationData(e.attributes)})}async evaluateRoom(e){let t=e.roomId||this.room?.id;if(!t)throw new Error("Room ID is required for evaluation");return l(`${this.apiUrl}/rooms/${t}/evaluate`,{method:"POST",body:JSON.stringify({rating:e.rating,comment:e.comment}),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.evaluateRoom.signal})}async closeRoom(){if(this.room)return l(`${this.apiUrl}/rooms/${this.room.id}/close`,{method:"POST",headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.closeRoom.signal})}async disconnect(){this.room&&(this.room.removeAllListeners(),await this.room.disconnect(),this.room=null)}async disconnectAndCloseRoom(){await this.closeRoom(),await this.disconnect()}async readRoom(e){return l(`${this.apiUrl}/rooms/${e}/read`,{method:"POST",headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.persistMessage.signal})}async getRooms(e){let t=new URLSearchParams;return e.page&&t.append("page",e.page.toString()),e.limit&&t.append("limit",e.limit.toString()),e.offset&&t.append("offset",e.offset.toString()),e.orderBy&&t.append("orderBy",e.orderBy),e.orderDir&&t.append("orderDir",e.orderDir),e.ids?.length&&t.append("ids",e.ids.join(",")),e.with?.length&&t.append("with",e.with.join(",")),e.count?.length&&t.append("count",e.count.join(",")),e.latestOnly&&t.append("latestOnly",e.latestOnly.toString()),e.includeUnread&&t.append("includeUnread",e.includeUnread.toString()),e.roomStatus&&t.append("roomStatus",e.roomStatus),e.archived&&t.append("archived",e.archived.toString()),e.participantIds?.length&&t.append("participantIds",e.participantIds.join(",")),e.participantExternalIds?.length&&t.append("participantExternalIds",e.participantExternalIds.join(",")),e.groupId&&t.append("groupId",e.groupId),e.hasMessages!==void 0&&t.append("hasMessages",e.hasMessages.toString()),l(`${this.authUrl}/rooms?${t}`,{method:"GET",headers:{"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},credentials:"include",signal:this.abortControllers.getRooms.signal})}async sendMessage(e,t){let i=await this.room.localParticipant.sendText(e,{topic:this.channelTopic,attributes:t});this.emitMessage({id:i.id,timestamp:Date.now(),message:e,assets:JSON.parse(t?.assets||"[]"),from:this.room.localParticipant}),this.messagePersistence==="client"&&this.persistMessage({roomId:this.room.id,content:e,externalId:i.id,identity:this.room.localParticipant?.identity,kind:this.room.localParticipant?.kind})}async persistMessage(e){return l(`${this.apiUrl}/messages/create`,{method:"POST",body:JSON.stringify(e),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.persistMessage.signal})}async getMessages(e){let t=new URLSearchParams;return e.limit&&t.append("limit",e.limit.toString()),e.with&&t.append("with",e.with.join(",")),(await l(`${this.apiUrl}/messages/search${t.size?`?${t.toString()}`:""}`,{method:"POST",body:JSON.stringify(e),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.createRoom.signal})).items}async sendMessageReport(e){try{return l(`${this.apiUrl}/messages/${e.messageId}/report`,{method:"POST",headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.sendMessageReport.signal})}catch(t){console.error("Error sending message report:",t)}}async deleteMessageReport(e){try{return l(`${this.apiUrl}/messages/${e.messageId}/report`,{method:"DELETE",headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.deleteMessageReport.signal})}catch(t){console.error("Error deleting message report:",t)}}async updateMessageReactions(e){try{return l(`${this.apiUrl}/messages/${e.messageId}/reactions`,{method:"PATCH",body:JSON.stringify({add:e.add||[],remove:e.remove||[]}),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},signal:this.abortControllers.updateMessageReactions.signal})}catch(t){console.error("Error updating message reactions:",t)}}subscribeMessages(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}async sendTypingIndicator(e){try{let t=new TextEncoder().encode(JSON.stringify({type:"typing",isTyping:e,timestamp:Date.now(),participantId:this.room.localParticipant.identity}));await this.room.localParticipant.publishData(t,{reliable:!1,topic:R})}catch(t){console.warn("Failed to send typing indicator:",t)}}subscribeTypingIndicators(e){return this.typingListeners.add(e),()=>{this.typingListeners.delete(e)}}unsubscribeTypingIndicators(e){this.typingListeners.delete(e)}async sendContextualEvent(e){try{let t=JSON.stringify(e);await this.room.localParticipant.sendText(t,{topic:this.eventsTopic})}catch(t){console.warn("Failed to send event:",t)}}async requestNewRoom(e){return l(`${this.apiUrl}/rooms/request-new`,{method:"POST",body:JSON.stringify(e),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"}})}async confirmRoomRequest(e){return l(`${this.apiUrl}/rooms/confirm-call`,{method:"POST",body:JSON.stringify({roomId:e}),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"}})}async cancelRoomRequest(e){return l(`${this.apiUrl}/rooms/cancel-call`,{method:"POST",body:JSON.stringify({roomId:e}),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"}})}async finishCall(){return l(`${this.apiUrl}/rooms/finish-call`,{method:"POST",body:JSON.stringify({roomId:this.room.id}),headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"}})}isFirebaseEnabled(){return!!(this.firebaseApi&&this.presencePath&&this.callsPath)}getFirebase(){if(!this.firebaseApi||!this.presencePath||!this.callsPath)throw new Error("Firebase is not initialized. Provide firebaseConfig in constructor.");return{api:this.firebaseApi,presencePath:this.presencePath,callsPath:this.callsPath}}buildAgentPresencePath(e){return`${this.presencePath}/${e}`}onPresenceChange(e){let{api:t,presencePath:i}=this.getFirebase();return t.onChildChanged(i,(n,r)=>e(n,r))}onPresenceAgentChange(e,t){let{api:i}=this.getFirebase();return i.onValue(this.buildAgentPresencePath(e),(n,r)=>t(n,r))}async createCallRequest(e){let{api:t,callsPath:i}=this.getFirebase(),r=(await l(`${this.apiUrl}/rooms/call-request`,{method:"POST",headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},body:JSON.stringify(e)})).id;return t.onDisconnectUpdate(`${i}/${r}`,{status:"disconnected"}),r}onNewCallRequest(e){let{api:t,callsPath:i}=this.getFirebase();return t.onChildAdded(i,(n,r)=>e(n,{...r,id:n}))}onCallRequestChange(e){let{api:t,callsPath:i}=this.getFirebase();return t.onChildChanged(i,(n,r)=>e(n,{...r,id:n}))}onCallRequestRemoved(e){let{api:t,callsPath:i}=this.getFirebase();return t.onChildRemoved(i,n=>e(n))}async acceptCallRequest(e){let{api:t,callsPath:i}=this.getFirebase();return await t.cancelOnDisconnect(`${i}/${e}`),t.update(`${i}/${e}`,{status:"accepted"})}async cancelCallRequest(e){let{api:t,callsPath:i}=this.getFirebase();await t.cancelOnDisconnect(`${i}/${e}`),await l(`${this.apiUrl}/rooms/call-request/cancel`,{method:"POST",headers:{Authorization:`Bearer ${this.authToken}`,"X-Onlive-Organization-Id":this.organizationId,"Content-Type":"application/json"},body:JSON.stringify({callId:e})})}async cancelOnDisconnect(e){let{api:t,callsPath:i}=this.getFirebase();await t.cancelOnDisconnect(`${i}/${e}`)}subscribePendingRequests(e,t={}){let{api:i,callsPath:n}=this.getFirebase();t.resetSeen&&this.seenRequestIds.clear(),this.firebaseUnsubscribers["pending-requests"]?.();let r=i.query(n,{orderBy:"child",childKey:"status",equalTo:"pending"}),a=i.onChildAddedQuery(r,(g,P)=>{if(!g||this.seenRequestIds.has(g))return;let O={...P,id:g};this.seenRequestIds.add(g),e(g,O)});return this.firebaseUnsubscribers["pending-requests"]=a,()=>{a?.(),delete this.firebaseUnsubscribers["pending-requests"]}}subscribeRequestChanges(e){let{api:t,callsPath:i}=this.getFirebase();this.firebaseUnsubscribers["request-changes"]?.();let n=t.onChildChanged(i,(r,a)=>{if(!r)return;let g=JSON.stringify(a);this.lastSnapshotById.get(r)!==g&&(this.lastSnapshotById.set(r,g),e(r,{...a,id:r}))});return this.firebaseUnsubscribers["request-changes"]=n,()=>{n?.(),delete this.firebaseUnsubscribers["request-changes"]}}async tryAcceptRequest(e){let{api:t,callsPath:i}=this.getFirebase(),n=`${i}/${e}`;return await t.transaction(n,a=>a&&(a.status==="pending"?{...a,status:"accepted"}:a)),(await t.getOnce(n))?.status==="accepted"}onRoomSync(e,t){let{api:i}=this.getFirebase(),n=`orgs/${this.organizationId}/rooms/${e}/sync`;return i.onValue(n,(r,a)=>{t(a)})}async clearRoomSync(e,t){let{api:i}=this.getFirebase(),n=`orgs/${this.organizationId}/rooms/${e}/sync`;await i.write(n,{needsSync:!1,reason:t||null,timestamp:Date.now()})}onNewRoomRequest(e,t){let{api:i}=this.getFirebase(),n=`orgs/${this.organizationId}/rooms/${e}/call`;return i.onValue(n,(r,a)=>{t(a)})}unsubscribeAllFirebase(){Object.values(this.firebaseUnsubscribers).forEach(e=>e?.()),this.firebaseUnsubscribers={}}async destroy(){this.unsubscribeAllFirebase(),this.listeners.clear(),this.typingListeners.clear(),this.transcriptionMap.clear(),this.seenRequestIds.clear(),this.lastSnapshotById.clear(),Object.values(this.abortControllers).forEach(e=>e.abort()),await this.disconnect()}};0&&(module.exports={ConversationService,Room});