ai12z 3.0.13 → 3.0.15

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 (57) hide show
  1. package/dist/cjs/ai12z-bot_12.cjs.entry.js +1 -1
  2. package/dist/cjs/{ai12z-search-panel-5fa6b9fc.js → ai12z-search-panel-a6ce2627.js} +21 -6
  3. package/dist/cjs/ai12z-search-panel-a6ce2627.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/library.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/ai12z-bot/ai12z-bot.js +23 -7
  8. package/dist/collection/components/ai12z-bot/ai12z-bot.js.map +1 -1
  9. package/dist/esm/ai12z-bot_12.entry.js +4 -4
  10. package/dist/esm/{ai12z-inline-search-d046e41f.js → ai12z-inline-search-742ea5aa.js} +3 -3
  11. package/dist/esm/{ai12z-inline-search-d046e41f.js.map → ai12z-inline-search-742ea5aa.js.map} +1 -1
  12. package/dist/esm/ai12z-inline-search.entry.js +3 -3
  13. package/dist/esm/{ai12z-knowledge-box-84c06d7b.js → ai12z-knowledge-box-61edd1b8.js} +2 -2
  14. package/dist/esm/{ai12z-knowledge-box-84c06d7b.js.map → ai12z-knowledge-box-61edd1b8.js.map} +1 -1
  15. package/dist/esm/ai12z-knowledge-box.entry.js +2 -2
  16. package/dist/esm/{ai12z-search-panel-fe7c8f83.js → ai12z-search-panel-d7df7043.js} +24 -9
  17. package/dist/esm/ai12z-search-panel-d7df7043.js.map +1 -0
  18. package/dist/esm/index.js +6 -6
  19. package/dist/esm/library.js +1 -1
  20. package/dist/esm/loader.js +1 -1
  21. package/dist/esm/search-results-page.entry.js +3 -3
  22. package/dist/esm/{search-results-view-239a5088.js → search-results-view-832ccc50.js} +3 -3
  23. package/dist/esm/{search-results-view-239a5088.js.map → search-results-view-832ccc50.js.map} +1 -1
  24. package/dist/esm/{socket-service-a7dc24ef.js → socket-service-9c7e7bfc.js} +2 -2
  25. package/dist/esm/{socket-service-a7dc24ef.js.map → socket-service-9c7e7bfc.js.map} +1 -1
  26. package/dist/esm/{utils-76c67168.js → utils-61923ae6.js} +2 -2
  27. package/dist/esm/{utils-76c67168.js.map → utils-61923ae6.js.map} +1 -1
  28. package/dist/library/index.esm.js +1 -1
  29. package/dist/library/library.esm.js +1 -1
  30. package/dist/library/library.esm.js.map +1 -1
  31. package/dist/library/p-4a5123de.entry.js +2 -0
  32. package/dist/library/{p-3d69bc82.js → p-599eee15.js} +2 -2
  33. package/dist/library/{p-7dfd6e9b.js → p-5c620570.js} +2 -2
  34. package/dist/library/p-6433707a.entry.js +2 -0
  35. package/dist/library/{p-0df5c0b4.js → p-8d25d927.js} +2 -2
  36. package/dist/library/{p-0df5c0b4.js.map → p-8d25d927.js.map} +1 -1
  37. package/dist/library/{p-4660d823.js → p-9e3df302.js} +2 -2
  38. package/dist/library/{p-95e055ba.entry.js → p-b3a2de8d.entry.js} +2 -2
  39. package/dist/library/{p-cfac4c14.js → p-bcf74d74.js} +2 -2
  40. package/dist/library/{p-75377ae8.js → p-e49a0ab7.js} +2 -2
  41. package/dist/library/p-eb9ee526.entry.js +2 -0
  42. package/dist/types/components/ai12z-bot/ai12z-bot.d.ts +1 -0
  43. package/package.json +2 -2
  44. package/dist/cjs/ai12z-search-panel-5fa6b9fc.js.map +0 -1
  45. package/dist/esm/ai12z-search-panel-fe7c8f83.js.map +0 -1
  46. package/dist/library/p-89e108df.entry.js +0 -2
  47. package/dist/library/p-b9015ffe.entry.js +0 -2
  48. package/dist/library/p-f00223ec.entry.js +0 -2
  49. /package/dist/library/{p-89e108df.entry.js.map → p-4a5123de.entry.js.map} +0 -0
  50. /package/dist/library/{p-3d69bc82.js.map → p-599eee15.js.map} +0 -0
  51. /package/dist/library/{p-7dfd6e9b.js.map → p-5c620570.js.map} +0 -0
  52. /package/dist/library/{p-b9015ffe.entry.js.map → p-6433707a.entry.js.map} +0 -0
  53. /package/dist/library/{p-4660d823.js.map → p-9e3df302.js.map} +0 -0
  54. /package/dist/library/{p-95e055ba.entry.js.map → p-b3a2de8d.entry.js.map} +0 -0
  55. /package/dist/library/{p-cfac4c14.js.map → p-bcf74d74.js.map} +0 -0
  56. /package/dist/library/{p-75377ae8.js.map → p-e49a0ab7.js.map} +0 -0
  57. /package/dist/library/{p-f00223ec.entry.js.map → p-eb9ee526.entry.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const ai12zSearchPanel = require('./ai12z-search-panel-5fa6b9fc.js');
5
+ const ai12zSearchPanel = require('./ai12z-search-panel-a6ce2627.js');
6
6
  const index = require('./index-171f7ecf.js');
7
7
  const socketService = require('./socket-service-fa78b351.js');
8
8
  const showdown = require('./showdown-b9a60008.js');
@@ -5018,6 +5018,7 @@ const Ai12zBot = class {
5018
5018
  this.excludeTags = [];
5019
5019
  this.includeTags = [];
5020
5020
  this.botSettings = {};
5021
+ this.canRender = true;
5021
5022
  this.isOpen = false;
5022
5023
  this.isListening = false;
5023
5024
  this.showSubmit = false;
@@ -5223,6 +5224,13 @@ const Ai12zBot = class {
5223
5224
  }
5224
5225
  }
5225
5226
  connectedCallback() {
5227
+ //this.parseMyObjectProp(this.myObject);
5228
+ utils$1.checkStatus(this.dataKey, this.dataMode).then(enable => {
5229
+ this.canRender = enable;
5230
+ // if (!enable) {
5231
+ // console.log("ai12z canRender", this.canRender)
5232
+ // }
5233
+ });
5226
5234
  this.configBot();
5227
5235
  }
5228
5236
  componentWillLoad() {
@@ -5244,7 +5252,7 @@ const Ai12zBot = class {
5244
5252
  if (!this.botSettings.botVersion) {
5245
5253
  this.botSettings.botVersion = "v1"; // Default to v1 if not specified
5246
5254
  }
5247
- if (this.botSettings.botVersion === "v2" && !this.botSettings.isExpanded) {
5255
+ if (this.botSettings.botVersion === "v2" && !this.botSettings.isExpanded && !this.isBot) {
5248
5256
  // this.botSettings.imageUpload = true
5249
5257
  this.isMinimized = true;
5250
5258
  }
@@ -5269,6 +5277,7 @@ const Ai12zBot = class {
5269
5277
  for (var i = 0; i < slot.length; i++) {
5270
5278
  if (slot[i].tagName.toLowerCase() === "bot" || slot[i].getAttribute("slot") === "bot") {
5271
5279
  this.isBot = true;
5280
+ this.isExpanded = false;
5272
5281
  }
5273
5282
  }
5274
5283
  }
@@ -5857,6 +5866,9 @@ const Ai12zBot = class {
5857
5866
  width: (_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.botWidth) !== null && _b !== void 0 ? _b : "35%",
5858
5867
  height: (_d = (_c = this.botSettings) === null || _c === void 0 ? void 0 : _c.botHeight) !== null && _d !== void 0 ? _d : "80%",
5859
5868
  };
5869
+ if (!this.canRender) {
5870
+ return (index.h(index.Host, null, index.h("span", { style: { display: "none" } }, "Failed to load ai12z bot control due to insufficient fund")));
5871
+ }
5860
5872
  return this.botSettings.botVersion === "v1" ? (index.h("div", null, index.h("div", { class: {
5861
5873
  "right": ((_f = this.botSettings) === null || _f === void 0 ? void 0 : _f.botPosition) === "right",
5862
5874
  "left": ((_g = this.botSettings) === null || _g === void 0 ? void 0 : _g.botPosition) === "left",
@@ -6016,15 +6028,18 @@ const Ai12zBot = class {
6016
6028
  this.isContent = false;
6017
6029
  this.isOpened = true;
6018
6030
  this.isExpanded = true;
6019
- } }, index.h("div", { class: "font-bold text-body2 text-white hidden md:flex pl-3 items-center" }, "Return to AI", index.h("i", { class: "inline-block pl-3 ai-minimize-icon block wes-icon--loading text-body1", style: { color: " rgb(255, 255, 255)" } }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 16", fill: "none" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.30775 9.15362H14.077C14.4231 9.15362 14.577 9.5767 14.3462 9.80747L10.6539 13.4998C10.4231 13.7305 10.4231 14.0767 10.6539 14.3075L11.5001 15.1536C11.7308 15.3844 12.077 15.3844 12.3077 15.1536L19.0385 8.38439C19.2693 8.15362 19.2693 7.80747 19.0385 7.5767L12.3077 0.845928C12.077 0.615159 11.7308 0.615159 11.5001 0.845928L10.6924 1.65362C10.4616 1.88439 10.4616 2.23054 10.6924 2.46131L14.3847 6.15362C14.6154 6.42285 14.4616 6.84593 14.1154 6.84593H1.34621C1.03852 6.84593 0.769287 7.0767 0.769287 7.38439V8.53824C0.769287 8.84593 1.00006 9.15362 1.30775 9.15362Z", fill: "white" })))))), this.isExpanded && !this.isOpened && index.h("privacy-modal", { show: this.showPrivacy, message: this.botSettings.privacyTemplate })))), index.h("div", { slot: "bot", class: "fab pointer-events-auto fixed right-7 whitespace-nowrap transition-transform duration-300 ease-in-out", style: {
6031
+ } }, index.h("div", { class: "font-bold text-body2 text-white hidden md:flex pl-3 items-center" }, "Return to AI", index.h("i", { class: "inline-block pl-3 ai-minimize-icon block wes-icon--loading text-body1", style: { color: " rgb(255, 255, 255)" } }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 16", fill: "none" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.30775 9.15362H14.077C14.4231 9.15362 14.577 9.5767 14.3462 9.80747L10.6539 13.4998C10.4231 13.7305 10.4231 14.0767 10.6539 14.3075L11.5001 15.1536C11.7308 15.3844 12.077 15.3844 12.3077 15.1536L19.0385 8.38439C19.2693 8.15362 19.2693 7.80747 19.0385 7.5767L12.3077 0.845928C12.077 0.615159 11.7308 0.615159 11.5001 0.845928L10.6924 1.65362C10.4616 1.88439 10.4616 2.23054 10.6924 2.46131L14.3847 6.15362C14.6154 6.42285 14.4616 6.84593 14.1154 6.84593H1.34621C1.03852 6.84593 0.769287 7.0767 0.769287 7.38439V8.53824C0.769287 8.84593 1.00006 9.15362 1.30775 9.15362Z", fill: "white" })))))), this.isExpanded && !this.isOpened && index.h("privacy-modal", { show: this.showPrivacy, message: this.botSettings.privacyTemplate })))), index.h("div", {
6032
+ // slot="bot"
6033
+ class: "fab pointer-events-auto fixed right-7 whitespace-nowrap transition-transform duration-300 ease-in-out", style: {
6020
6034
  opacity: this.isMinimized ? "1" : "0",
6021
6035
  transform: this.isMinimized ? "translateX(0)" : "translateX(-100%)",
6022
6036
  pointerEvents: this.isMinimized ? "auto" : "none",
6023
6037
  transformOrigin: "50% 50% 0px",
6024
- } }, index.h("button", { class: "rounded-full flex cursor-pointer items-center pr-[14px] md:gap-x-3 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-focused", tabindex: "0", onClick: () => {
6038
+ }, onClick: () => {
6025
6039
  this.openChat();
6026
- } }, index.h("div", { class: "w-10 h-10 flex items-center justify-center bg-white rounded-full border relative" }, this.botSettings.botLaunchIcon && index.h("img", { src: this.botSettings.botLaunchIcon, alt: "bot icon", class: "w-8 h-8 rounded-lg" }), !this.botSettings.botLaunchIcon && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "#2095ae" }, index.h("g", { "stroke-width": "0" }), index.h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", null, " ", index.h("path", { d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", stroke: "#2095ae", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), " ")))), index.h("span", { class: "font-medium text-white" }, "Ask ", (_23 = this.botSettings) === null || _23 === void 0 ? void 0 :
6027
- _23.botName)))));
6040
+ }
6041
+ }, this.isBot && index.h("slot", { name: "bot" }), !this.isBot && (index.h("button", { class: "rounded-full flex cursor-pointer items-center pr-[14px] md:gap-x-3 focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-blue-focused", tabindex: "0" }, index.h("div", { class: "w-10 h-10 flex items-center justify-center bg-white rounded-full border relative" }, this.botSettings.botLaunchIcon && index.h("img", { src: this.botSettings.botLaunchIcon, alt: "bot icon", class: "w-8 h-8 rounded-lg" }), !this.botSettings.botLaunchIcon && (index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "#2095ae" }, index.h("g", { "stroke-width": "0" }), index.h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", null, " ", index.h("path", { d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", stroke: "#2095ae", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), " ")))), index.h("span", { class: "font-medium text-white" }, "Ask ", (_23 = this.botSettings) === null || _23 === void 0 ? void 0 :
6042
+ _23.botName))))));
6028
6043
  }
6029
6044
  get el() { return index.getElement(this); }
6030
6045
  static get watchers() { return {
@@ -6619,4 +6634,4 @@ exports.Handlebars = Handlebars;
6619
6634
  exports.SearchPanel = SearchPanel;
6620
6635
  exports.setItemListElement = setItemListElement;
6621
6636
 
6622
- //# sourceMappingURL=ai12z-search-panel-5fa6b9fc.js.map
6637
+ //# sourceMappingURL=ai12z-search-panel-a6ce2627.js.map