@nexlylab/widget 1.32.17 → 1.32.18

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 (66) hide show
  1. package/dist/INSTALL.txt +1 -1
  2. package/dist/runtime/{1.32.17/chunks/ClickToLoadEmbed-D9eMaBG8-r9dN9klo.js → 1.32.18/chunks/ClickToLoadEmbed-BLIUFZOn-BwY-LAJ8.js} +2 -2
  3. package/dist/runtime/{1.32.17/chunks/PanelInfoVideo-DMU0-9Az-BrU-Qlul.js → 1.32.18/chunks/PanelInfoVideo-BNVzih9J-BrU-Qlul.js} +1 -1
  4. package/dist/runtime/{1.32.17/chunks/assistant-link-components-D0uKk8Hv-xEDu0ls0.js → 1.32.18/chunks/assistant-link-components-DUrLEPUB-DKaQavIJ.js} +2 -2
  5. package/dist/runtime/{1.32.17/chunks/assistant-link-policy-CogLpq-3-Cc-yj-a-.js → 1.32.18/chunks/assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js} +1 -1
  6. package/dist/runtime/{1.32.17/chunks/block-rating-BgOeTm52-CoiP5C2K.js → 1.32.18/chunks/block-rating-D7hR2gTc-CoiP5C2K.js} +1 -1
  7. package/dist/runtime/{1.32.17/chunks/external-url-ninK7gY9-CJQjg_od.js → 1.32.18/chunks/external-url-qbs1SznX-CJQjg_od.js} +1 -1
  8. package/dist/runtime/{1.32.17/chunks/index-DsQ3ssZW-DbuSZfeK.js → 1.32.18/chunks/index--xfG4CIn-DbuSZfeK.js} +1 -1
  9. package/dist/runtime/{1.32.17/chunks/index-CHUW1nlj-DAdxCQyi.js → 1.32.18/chunks/index-7N5M1HdS-DAdxCQyi.js} +1 -1
  10. package/dist/runtime/{1.32.17/chunks/index-CaHbIY6I-QeFj7CR9.js → 1.32.18/chunks/index-99heIIoH-QeFj7CR9.js} +1 -1
  11. package/dist/runtime/{1.32.17/chunks/index-D3OBLy0s-k8E4HOBM.js → 1.32.18/chunks/index-B3DeMFo7-BbdAbuAw.js} +2 -2
  12. package/dist/runtime/{1.32.17/chunks/index-ByEsnceF-CSQQTbsg.js → 1.32.18/chunks/index-BIGVEl9--CSQQTbsg.js} +1 -1
  13. package/dist/runtime/{1.32.17/chunks/index-zmuItIIf-oy07dUaV.js → 1.32.18/chunks/index-BKZyJMr2-oy07dUaV.js} +1 -1
  14. package/dist/runtime/{1.32.17/chunks/index-D6YQ4lFv-pbKZ0WGs.js → 1.32.18/chunks/index-BKrM_uoq-CABL-0v-.js} +2 -2
  15. package/dist/runtime/{1.32.17/chunks/index-BWMbr4oS-Dsa9X9U7.js → 1.32.18/chunks/index-BX6ig9BJ-Dsa9X9U7.js} +1 -1
  16. package/dist/runtime/{1.32.17/chunks/index-B0-9mIbB-DP0QKkgf.js → 1.32.18/chunks/index-BZO9Qaiw-DP0QKkgf.js} +1 -1
  17. package/dist/runtime/{1.32.17/chunks/index-CSDD7Z6C-BpgnWlB8.js → 1.32.18/chunks/index-BauMKr5c-BpgnWlB8.js} +1 -1
  18. package/dist/runtime/{1.32.17/chunks/index-DzCfV77F-C1BzRUwZ.js → 1.32.18/chunks/index-Bf_npmqm-C1BzRUwZ.js} +1 -1
  19. package/dist/runtime/{1.32.17/chunks/index-Dwtd4id8-CiRb-0NX.js → 1.32.18/chunks/index-BtkNePSj-CiRb-0NX.js} +1 -1
  20. package/dist/runtime/{1.32.17/chunks/index-B97ASd4H-ZRnEJoQe.js → 1.32.18/chunks/index-C1Fa-E3e-ZRnEJoQe.js} +1 -1
  21. package/dist/runtime/{1.32.17/chunks/index-CIFQrVkq-DUgMllqN.js → 1.32.18/chunks/index-C5RVj6y1-DUgMllqN.js} +1 -1
  22. package/dist/runtime/{1.32.17/chunks/index-Ba5nbqA8-B620AdXN.js → 1.32.18/chunks/index-CCEWGjHV-BTsOZg4v.js} +2 -2
  23. package/dist/runtime/{1.32.17/chunks/index-D3fwWbIM-BcW8HKb8.js → 1.32.18/chunks/index-CF37rhgu-BcW8HKb8.js} +1 -1
  24. package/dist/runtime/{1.32.17/chunks/index-CtNAXlUH-DQBGsPwB.js → 1.32.18/chunks/index-COTfVuju-DQBGsPwB.js} +1 -1
  25. package/dist/runtime/{1.32.17/chunks/index-1JK_DoDz-D6wzHiS0.js → 1.32.18/chunks/index-COfQIa8G-D6wzHiS0.js} +1 -1
  26. package/dist/runtime/{1.32.17/chunks/index-BlGeDG8W-CoI3p0S7.js → 1.32.18/chunks/index-CSRoJRaW-CoI3p0S7.js} +1 -1
  27. package/dist/runtime/{1.32.17/chunks/index-CpCgmp7C-C9wFr7fa.js → 1.32.18/chunks/index-CV2tGt-4-C9wFr7fa.js} +1 -1
  28. package/dist/runtime/{1.32.17/chunks/index-D30-Ox5Z-BLxOZxZv.js → 1.32.18/chunks/index-CYeJYTiB-BLxOZxZv.js} +1 -1
  29. package/dist/runtime/{1.32.17/chunks/index-_R8QyLD7-TEMHje2B.js → 1.32.18/chunks/index-CZ-JrY2X-TEMHje2B.js} +1 -1
  30. package/dist/runtime/{1.32.17/chunks/index-BsUIWTU6-BQ7DWJhg.js → 1.32.18/chunks/index-Cd1-jHFp-Za3SKEQp.js} +2 -2
  31. package/dist/runtime/{1.32.17/chunks/index-C5olj-Fr-C3bBvEcm.js → 1.32.18/chunks/index-Ce9TuEzb-C3bBvEcm.js} +1 -1
  32. package/dist/runtime/{1.32.17/chunks/index-DIMi29lU-3B-eE3K7.js → 1.32.18/chunks/index-D1YmJ3gf-3B-eE3K7.js} +1 -1
  33. package/dist/runtime/{1.32.17/chunks/index-DnDMirl9-Dp5AxBD4.js → 1.32.18/chunks/index-D96sEJQ6-Dp5AxBD4.js} +1 -1
  34. package/dist/runtime/{1.32.17/chunks/index-CPjLHywY-DBhSkJ7i.js → 1.32.18/chunks/index-DAICBUgn-DBhSkJ7i.js} +1 -1
  35. package/dist/runtime/{1.32.17/chunks/index-DAJM_cb9-VhJcCfAC.js → 1.32.18/chunks/index-DATkkw3P-VhJcCfAC.js} +1 -1
  36. package/dist/runtime/{1.32.17/chunks/index-CM0iRJSw-pkywvGDF.js → 1.32.18/chunks/index-DaW9uf4--pkywvGDF.js} +1 -1
  37. package/dist/runtime/{1.32.17/chunks/index-C_zmepmr-H31PHMqm.js → 1.32.18/chunks/index-DiZcd1hz-H31PHMqm.js} +1 -1
  38. package/dist/runtime/{1.32.17/chunks/index-D5EHdeyl-_M0CWPEY.js → 1.32.18/chunks/index-DuPFNKhZ-_M0CWPEY.js} +1 -1
  39. package/dist/runtime/{1.32.17/chunks/index-DAai_PkG-Dr1V6OGz.js → 1.32.18/chunks/index-Dw7QeZq3-Dr1V6OGz.js} +1 -1
  40. package/dist/runtime/{1.32.17/chunks/index-DDHI4Kxr-DrVjDDba.js → 1.32.18/chunks/index-E59S8-Gw-CovGUxIZ.js} +2 -2
  41. package/dist/runtime/{1.32.17/chunks/index-Ce0ahORn-bdo5pwX-.js → 1.32.18/chunks/index-OcrS6o5Y-bdo5pwX-.js} +1 -1
  42. package/dist/runtime/{1.32.17/chunks/index-Bl_8GpS0-CahNhEcx.js → 1.32.18/chunks/index-PxSB6BA6-DFxY6dqO.js} +2 -2
  43. package/dist/runtime/{1.32.17/chunks/index-Wza_7CGb-W1lJrIDD.js → 1.32.18/chunks/index-cCAzBYyN-W1lJrIDD.js} +1 -1
  44. package/dist/runtime/{1.32.17/chunks/index-DzHo_iNR-Dm9kbc85.js → 1.32.18/chunks/index-kAGaGinD-Dm9kbc85.js} +1 -1
  45. package/dist/runtime/{1.32.17/chunks/index-BDhTixUR-Aqz1AnQ5.js → 1.32.18/chunks/index-l8Oxwea3-Aqz1AnQ5.js} +1 -1
  46. package/dist/runtime/{1.32.17/chunks/index-DMM00SC5-R_xuAEQV.js → 1.32.18/chunks/index-oxM4Cgtc-R_xuAEQV.js} +1 -1
  47. package/dist/runtime/{1.32.17/chunks/index-BJxJr5j5-C_0Ll4qr.js → 1.32.18/chunks/index-qN6oEHVu-C_0Ll4qr.js} +1 -1
  48. package/dist/runtime/{1.32.17/chunks/index-D0qsMexH-I68tb-d3.js → 1.32.18/chunks/index-rblri-2U-I68tb-d3.js} +1 -1
  49. package/dist/runtime/1.32.18/chunks/index-xx1GG5d1-CW29F9vY.js +6 -0
  50. package/dist/runtime/{1.32.17 → 1.32.18}/nexly.js +5 -5
  51. package/dist/v1.js +1 -1
  52. package/package.json +1 -1
  53. package/dist/runtime/1.32.17/chunks/index-tapacGlG--YMQ21rc.js +0 -6
  54. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/PanelVideoOverlay-BY__oBYV-B8OPC1xh.js +0 -0
  55. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/_commonjsHelpers-C6fGbg64-BC8KDfbh.js +0 -0
  56. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/accent-legibility-BJF2VO5n-CDPQ7suO.js +0 -0
  57. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/allowed-elements-BXnLJV1S-C-_lr2zm.js +0 -0
  58. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/block-helpers-Cg_zAqG6-DnN2COvk.js +0 -0
  59. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-BPDIV1BN-DINkyYvc.js +0 -0
  60. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-BcsmWDTX-Dw9WA5Ac.js +0 -0
  61. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-C262wwK4-DpyhuXqd.js +0 -0
  62. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-DMQkz1bV-BuMYksln.js +0 -0
  63. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-DZADUAKv-DPfvWVuj.js +0 -0
  64. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index.modern-CioVZ357-BA5NTOmY.js +0 -0
  65. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/inert-assistant-components-B6Cx9pG5-DWb6n3Yq.js +0 -0
  66. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/use-deferred-rating-XlgCUwcY-DDVOwURi.js +0 -0
package/dist/INSTALL.txt CHANGED
@@ -1,3 +1,3 @@
1
1
  Wklej przed </body>:
2
2
 
3
- <script src="https://cdn.jsdelivr.net/npm/@nexlylab/widget@1.32.17/dist/v1.js" data-api-key="pk_live_TWOJ_KLUCZ" defer></script>
3
+ <script src="https://cdn.jsdelivr.net/npm/@nexlylab/widget@1.32.18/dist/v1.js" data-api-key="pk_live_TWOJ_KLUCZ" defer></script>
@@ -1,2 +1,2 @@
1
- import{t as v,r as y,j as i}from"../nexly.js";import{L as $,N as j,l as N}from"./allowed-elements-BXnLJV1S-C-_lr2zm.js";import{a as m}from"./assistant-link-policy-CogLpq-3-Cc-yj-a-.js";const k=["youtube.com","youtube-nocookie.com"],B=["youtu.be"],E=["vimeo.com"],f=/^[A-Za-z0-9_-]{6,32}$/,P=/^\d{6,12}$/;function S(n){return f.test(n)}const _=4;function w(n){const[t,e]=v(()=>new URL(n));return e||!t?null:t}function b(n,t){if(t){const r=n.pathname.split("/").filter(Boolean);if(r.length!==1)return null;const o=r[0];return f.test(o)?o:null}const e=n.pathname.split("/").filter(Boolean);if(e[0]==="watch"){const r=n.searchParams.get("v");return r&&f.test(r)?r:null}if(e[0]==="embed"||e[0]==="shorts"||e[0]==="v"){if(e.length!==2)return null;const r=e[1];return f.test(r)?r:null}return null}function z(n){const t=n.pathname.split("/").filter(Boolean),e=t[0]==="video"?t[1]:t[0];if(!e)return null;const r=t[0]==="video"?2:1;return t.length!==r?null:P.test(e)?e:null}function C(n){const t=w(n);if(!t||t.protocol!=="https:")return null;const e=t.hostname;if(m(e,B)){const r=b(t,!0);return r?{provider:"youtube",id:r}:null}if(m(e,k)){const r=b(t,!1);return r?{provider:"youtube",id:r}:null}if(m(e,E)){const r=z(t);return r?{provider:"vimeo",id:r}:null}return null}const F=/\.(png|jpe?g|gif|webp|avif|svg)$/i,L=/[;?#]|[\u0000-\u001F\u007F]/,R=5;function U(n){let t=n;for(let e=0;e<R;e++){if(!t.includes("%"))return t;const[r,o]=v(()=>decodeURIComponent(t));if(o||r===void 0)return null;if(r===t)return t;t=r}return null}function H(n,t){if(t.length===0)return null;const e=w(n);if(!e||e.protocol!=="https:"||!m(e.hostname,t)||e.search)return null;const r=U(e.pathname);return r===null||L.test(r)||!F.test(r)?null:(e.username="",e.password="",e.href)}function*x(n){if(n.children)for(const t of n.children)yield t,yield*x(t)}function T(n,t={}){const e=t.allowEmbeds===!0,r=t.allowedImageHosts??[],o={embeds:[],images:[]};if(!n||!e&&r.length===0)return o;const[p,h]=v(()=>$().use(j).use(N).parse(n));if(h||!p)return o;const c=[],s=[],d=new Set,a=new Set;for(const u of x(p)){if(e&&u.type==="link"&&c.length<_){const l=u.url?C(u.url):null;if(l){const g=`${l.provider}:${l.id}`;d.has(g)||(d.add(g),c.push(l))}continue}if(u.type==="image"&&s.length<_){const l=u.url?H(u.url,r):null;l&&!a.has(l)&&(a.add(l),s.push({src:l,alt:(u.alt??"").trim()}))}}return{embeds:c,images:s}}const I={youtube:"support_chat.media_provider_youtube",vimeo:"support_chat.media_provider_vimeo"};function M(n){return n.provider==="youtube"?S(n.id)?`https://www.youtube-nocookie.com/embed/${n.id}`:null:`https://player.vimeo.com/video/${n.id}`}function X({embed:n,t,classPrefix:e,posterUrl:r=null}){const[o,p]=y.useState(!1),[h,c]=y.useState(!1),s=t(I[n.provider]),d=M(n);if(!d)return null;if(o)return i.jsx("div",{className:`${e}__media-frame`,children:i.jsx("iframe",{src:d,title:t("support_chat.media_player_title",{provider:s}),sandbox:"allow-scripts allow-same-origin allow-presentation",referrerPolicy:"strict-origin-when-cross-origin",allow:"accelerometer; encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0,loading:"lazy"})});const a=h?null:r;return i.jsxs("button",{type:"button",className:`${e}__media-tile${a?` ${e}__media-tile--poster`:""}`,onClick:()=>p(!0),"aria-label":t("support_chat.media_play_video",{provider:s}),children:[a&&i.jsx("img",{className:`${e}__media-poster`,src:a,alt:"","aria-hidden":"true",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",onError:()=>c(!0)}),i.jsx("span",{className:`${e}__media-play`,"aria-hidden":"true",children:i.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",children:i.jsx("path",{d:"M8 5v14l11-7z"})})}),i.jsx("span",{className:`${e}__media-tile-label`,children:s})]})}export{S as F,X,T as j};
2
- //# sourceMappingURL=ClickToLoadEmbed-D9eMaBG8-r9dN9klo.js.map
1
+ import{t as v,r as y,j as i}from"../nexly.js";import{L as $,N as j,l as N}from"./allowed-elements-BXnLJV1S-C-_lr2zm.js";import{a as m}from"./assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js";const k=["youtube.com","youtube-nocookie.com"],B=["youtu.be"],E=["vimeo.com"],f=/^[A-Za-z0-9_-]{6,32}$/,P=/^\d{6,12}$/;function S(n){return f.test(n)}const _=4;function w(n){const[t,e]=v(()=>new URL(n));return e||!t?null:t}function b(n,t){if(t){const r=n.pathname.split("/").filter(Boolean);if(r.length!==1)return null;const o=r[0];return f.test(o)?o:null}const e=n.pathname.split("/").filter(Boolean);if(e[0]==="watch"){const r=n.searchParams.get("v");return r&&f.test(r)?r:null}if(e[0]==="embed"||e[0]==="shorts"||e[0]==="v"){if(e.length!==2)return null;const r=e[1];return f.test(r)?r:null}return null}function z(n){const t=n.pathname.split("/").filter(Boolean),e=t[0]==="video"?t[1]:t[0];if(!e)return null;const r=t[0]==="video"?2:1;return t.length!==r?null:P.test(e)?e:null}function C(n){const t=w(n);if(!t||t.protocol!=="https:")return null;const e=t.hostname;if(m(e,B)){const r=b(t,!0);return r?{provider:"youtube",id:r}:null}if(m(e,k)){const r=b(t,!1);return r?{provider:"youtube",id:r}:null}if(m(e,E)){const r=z(t);return r?{provider:"vimeo",id:r}:null}return null}const F=/\.(png|jpe?g|gif|webp|avif|svg)$/i,L=/[;?#]|[\u0000-\u001F\u007F]/,R=5;function U(n){let t=n;for(let e=0;e<R;e++){if(!t.includes("%"))return t;const[r,o]=v(()=>decodeURIComponent(t));if(o||r===void 0)return null;if(r===t)return t;t=r}return null}function H(n,t){if(t.length===0)return null;const e=w(n);if(!e||e.protocol!=="https:"||!m(e.hostname,t)||e.search)return null;const r=U(e.pathname);return r===null||L.test(r)||!F.test(r)?null:(e.username="",e.password="",e.href)}function*x(n){if(n.children)for(const t of n.children)yield t,yield*x(t)}function T(n,t={}){const e=t.allowEmbeds===!0,r=t.allowedImageHosts??[],o={embeds:[],images:[]};if(!n||!e&&r.length===0)return o;const[p,h]=v(()=>$().use(j).use(N).parse(n));if(h||!p)return o;const c=[],s=[],d=new Set,a=new Set;for(const u of x(p)){if(e&&u.type==="link"&&c.length<_){const l=u.url?C(u.url):null;if(l){const g=`${l.provider}:${l.id}`;d.has(g)||(d.add(g),c.push(l))}continue}if(u.type==="image"&&s.length<_){const l=u.url?H(u.url,r):null;l&&!a.has(l)&&(a.add(l),s.push({src:l,alt:(u.alt??"").trim()}))}}return{embeds:c,images:s}}const I={youtube:"support_chat.media_provider_youtube",vimeo:"support_chat.media_provider_vimeo"};function M(n){return n.provider==="youtube"?S(n.id)?`https://www.youtube-nocookie.com/embed/${n.id}`:null:`https://player.vimeo.com/video/${n.id}`}function X({embed:n,t,classPrefix:e,posterUrl:r=null}){const[o,p]=y.useState(!1),[h,c]=y.useState(!1),s=t(I[n.provider]),d=M(n);if(!d)return null;if(o)return i.jsx("div",{className:`${e}__media-frame`,children:i.jsx("iframe",{src:d,title:t("support_chat.media_player_title",{provider:s}),sandbox:"allow-scripts allow-same-origin allow-presentation",referrerPolicy:"strict-origin-when-cross-origin",allow:"accelerometer; encrypted-media; picture-in-picture; fullscreen",allowFullScreen:!0,loading:"lazy"})});const a=h?null:r;return i.jsxs("button",{type:"button",className:`${e}__media-tile${a?` ${e}__media-tile--poster`:""}`,onClick:()=>p(!0),"aria-label":t("support_chat.media_play_video",{provider:s}),children:[a&&i.jsx("img",{className:`${e}__media-poster`,src:a,alt:"","aria-hidden":"true",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",onError:()=>c(!0)}),i.jsx("span",{className:`${e}__media-play`,"aria-hidden":"true",children:i.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor",children:i.jsx("path",{d:"M8 5v14l11-7z"})})}),i.jsx("span",{className:`${e}__media-tile-label`,children:s})]})}export{S as F,X,T as j};
2
+ //# sourceMappingURL=ClickToLoadEmbed-BLIUFZOn-BwY-LAJ8.js.map
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/PanelVideoOverlay-BY__oBYV-B8OPC1xh.js","nexly.js"])))=>i.map(i=>d[i]);
2
2
  import{r as o,j as n,_ as v,b as d}from"../nexly.js";function _(e,r,a){const[i,t]=o.useState(null);return o.useEffect(()=>{if(!a)return;let l=!1;async function s(){const[u,c]=await d(()=>fetch(`${r}/api/widget/panel-video?panel=${e}`,{headers:{"X-API-Key":a}}));if(l||c||!u.ok)return;const[p,f]=await d(()=>u.json());l||f||t(p)}return s(),()=>{l=!0}},[e,r,a]),i}const b=o.lazy(()=>v(()=>import("./PanelVideoOverlay-BY__oBYV-B8OPC1xh.js"),__vite__mapDeps([0,1])).then(e=>({default:e.PanelVideoOverlay})));function x({panelKey:e,baseUrl:r,apiKey:a,t:i}){const t=_(e,r,a),[l,s]=o.useState(!1);if(!t?.enabled||!t.videoUrl)return null;const u=t.videoUrl,c=t.contentType??"video/mp4";return n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",className:"es-panel-video-btn","aria-label":i("panel_video.info_button"),title:i("panel_video.info_button"),onClick:()=>s(!0),"data-testid":"panel-video-info-button",children:n.jsx("span",{"aria-hidden":"true",children:"i"})}),l&&n.jsx(o.Suspense,{fallback:null,children:n.jsx(b,{videoUrl:u,contentType:c,onClose:()=>s(!1),t:i})})]})}export{x as j};
3
- //# sourceMappingURL=PanelInfoVideo-DMU0-9Az-BrU-Qlul.js.map
3
+ //# sourceMappingURL=PanelInfoVideo-BNVzih9J-BrU-Qlul.js.map
@@ -1,2 +1,2 @@
1
- import{j as r}from"../nexly.js";import{u as s}from"./assistant-link-policy-CogLpq-3-Cc-yj-a-.js";function c(o={}){const n=o.allowedHosts??[];return{a:({href:e,title:l,children:t})=>{const i=r.jsx(r.Fragment,{children:t});return s(e,n)?r.jsx("a",{href:e,title:l,target:"_blank",rel:"noopener noreferrer nofollow",children:t}):i}}}export{c as f};
2
- //# sourceMappingURL=assistant-link-components-D0uKk8Hv-xEDu0ls0.js.map
1
+ import{j as r}from"../nexly.js";import{u as s}from"./assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js";function c(o={}){const n=o.allowedHosts??[];return{a:({href:e,title:l,children:t})=>{const i=r.jsx(r.Fragment,{children:t});return s(e,n)?r.jsx("a",{href:e,title:l,target:"_blank",rel:"noopener noreferrer nofollow",children:t}):i}}}export{c as f};
2
+ //# sourceMappingURL=assistant-link-components-DUrLEPUB-DKaQavIJ.js.map
@@ -1,2 +1,2 @@
1
1
  import{t as l}from"../nexly.js";function i(r){const e=r.trim().toLowerCase().replace(/^\.+|\.+$/g,"");return e==="*"?"":e}function a(r,e){const t=r.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;for(const s of e){const n=i(s);if(n&&(t===n||t.endsWith(`.${n}`)))return!0}return!1}function u(r,e){if(!r||e.length===0)return!1;const[t,s]=l(()=>new URL(r));if(s||!t)return!1;if(t.protocol==="http:"||t.protocol==="https:")return a(t.hostname,e);if(t.protocol==="mailto:"){const n=t.pathname.split(",").map(o=>o.trim()).filter(Boolean);return n.length===0?!1:n.every(o=>{const f=o.lastIndexOf("@");return f===-1?!1:a(o.slice(f+1),e)})}return!1}export{a,u};
2
- //# sourceMappingURL=assistant-link-policy-CogLpq-3-Cc-yj-a-.js.map
2
+ //# sourceMappingURL=assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js.map
@@ -1,2 +1,2 @@
1
1
  import{r,j as a,b as X}from"../nexly.js";const de=240,R=30,ue=n=>n<=3?"low":"high",pe=n=>`block_feedback.chip.${n}`;Object.fromEntries([{key:"numbers_wrong",labelEn:"The numbers look wrong"},{key:"too_generic",labelEn:"Too generic"},{key:"hard_to_understand",labelEn:"Hard to understand"},{key:"not_relevant",labelEn:"Not relevant to me"},{key:"accurate",labelEn:"Accurate numbers"},{key:"clear",labelEn:"Clear and easy to follow"},{key:"actionable",labelEn:"I know what to do next"},{key:"saves_time",labelEn:"Saves me time"},{key:"not_my_situation",labelEn:"Doesn't fit my situation"},{key:"where_to_start",labelEn:"Don't know where to start"},{key:"concrete_steps",labelEn:"Concrete steps"},{key:"matches_my_data",labelEn:"Matches my data"},{key:"motivating",labelEn:"Motivates me to act"},{key:"data_stale",labelEn:"Data looks outdated"},{key:"dashboard_mismatch",labelEn:"Differs from my dashboard"},{key:"threshold_unclear",labelEn:"The threshold isn't clear"},{key:"no_next_step",labelEn:"No hint what to do next"},{key:"warned_in_time",labelEn:"Warned me in time"},{key:"clear_threshold",labelEn:"Clear threshold and deadline"},{key:"branch_detail",labelEn:"Not enough branch detail"},{key:"how_to_use",labelEn:"Not sure how to use this"},{key:"comparison_weak",labelEn:"Comparison not helpful"},{key:"see_growth",labelEn:"I can see where my team grows"},{key:"recognize_team",labelEn:"Helps me recognize my team"},{key:"week_over_week",labelEn:"Useful week-over-week view"},{key:"payout_mismatch",labelEn:"Doesn't match my payout"},{key:"assumptions_unclear",labelEn:"Assumptions aren't clear"},{key:"no_what_if",labelEn:"No what-if scenarios"},{key:"currency_unclear",labelEn:"Currency or rate unclear"},{key:"matches_payout",labelEn:"Matches my payout"},{key:"helps_planning",labelEn:"Helps me plan the cycle"},{key:"too_late",labelEn:"Came too late"},{key:"no_context",labelEn:"Not enough context"},{key:"other_topics",labelEn:"I'd prefer other topics"},{key:"spot_on",labelEn:"Spot-on topic"},{key:"learned",labelEn:"I learned something"},{key:"on_time",labelEn:"Right on time"},{key:"want_to_join",labelEn:"Makes me want to join in"},{key:"needs_example",labelEn:"No example"},{key:"too_long",labelEn:"Too long"},{key:"bad_formatting",labelEn:"Badly formatted"},{key:"good_example",labelEn:"Good example"}].map(n=>[n.key,n]));const he={low:["numbers_wrong","too_generic","hard_to_understand","not_relevant"],high:["accurate","clear","actionable","saves_time"]},q={low:["payout_mismatch","assumptions_unclear","no_what_if","currency_unclear"],high:["matches_payout","helps_planning","clear","accurate"]},be={"daily-action-plan":{low:["not_my_situation","numbers_wrong","too_generic","where_to_start"],high:["concrete_steps","matches_my_data","saves_time","motivating"]},"rank-advancement-roadmap":{low:["data_stale","dashboard_mismatch","threshold_unclear","no_next_step"],high:["warned_in_time","clear_threshold","actionable","accurate"]},"network-growth":{low:["branch_detail","data_stale","how_to_use","comparison_weak"],high:["see_growth","recognize_team","week_over_week","motivating"]},"mlm-calculator":q,"commission-forecast":q,"social-insights":{low:["not_relevant","too_late","no_context","other_topics"],high:["spot_on","learned","on_time","want_to_join"]},learning:{low:["hard_to_understand","needs_example","too_long","bad_formatting"],high:["clear","good_example","learned","actionable"]}};function me(n,o){return(be[n]??he)[ue(o)]}function Q(n){const o=n.trim().match(/\S+/g);return o?o.length:0}const ye=[1,2,3,4,5],M=96,_e=20;function fe(n){let o=n.slice(0,de);if(Q(o)>R){let c=0,d=0,p=!1;for(;d<o.length;){const _=/\s/.test(o.charAt(d));if(!_&&!p&&(c++,p=!0,c>R))break;_&&(p=!1),d++}o=o.slice(0,d).trimEnd()}return o}function ge({promptLogId:n,blockSlug:o,sectionKey:c,subjectType:d,subjectId:p,ariaKey:_,onRated:Z,onFeedbackCycleDone:z,settleInPlace:v=!1,baseUrl:H,apiKey:F,jwt:K,t:l,promptKey:ee,compact:s=!1,className:te,previewMode:L=!1}){const[m,E]=r.useState(null),[ae,j]=r.useState(!1),[$,S]=r.useState(null),[f,k]=r.useState("none"),i=f==="settled",[g,A]=r.useState([]),[C,O]=r.useState(""),[oe,B]=r.useState(!1),N=r.useRef(null),T=r.useRef(z);T.current=z;const w=r.useRef(!1),P=r.useRef(!1);r.useEffect(()=>()=>{P.current&&!w.current&&(w.current=!0,T.current?.())},[]),r.useEffect(()=>{if(!(f!=="done"||v))return N.current=setTimeout(()=>{E(null),S(null),A([]),O(""),k("none"),w.current||(w.current=!0,T.current?.())},2500),()=>{N.current&&clearTimeout(N.current)}},[f,v]);const h=n?"ai":o?"block":null;if(!h||!K)return null;const ne=ee??(s?"block_rating.prompt_section":"block_rating.prompt"),u=m!==null||ae,W=m??0,re=!u&&$!==null?$:W,U=s?15:18,J=d&&p?{subjectType:d,subjectId:p}:{},Y={"Content-Type":"application/json",...F?{"X-API-Key":F}:{},Authorization:`Bearer ${K}`},le=async e=>{if(u)return;if(L){E(e),k(h==="block"?"chips":"done");return}j(!0);const t=h==="ai"?"/api/widget/ai-feedback":"/api/widget/block-feedback",b=h==="ai"?{promptLogId:n,rating:e}:{blockSlug:o,rating:e,...c?{sectionKey:c}:{},...J},[y,ce]=await X(fetch(`${H}${t}`,{method:"POST",headers:Y,body:JSON.stringify(b)}));if(ce){j(!1);return}(y.ok||y.status===409)&&(E(e),k(h==="block"&&y.ok?"chips":"done"),P.current=!0,Z?.()),j(!1)},I=()=>k(v?"settled":"done"),se=e=>A(t=>t.includes(e)?t.filter(b=>b!==e):[...t,e]),ie=e=>{O(fe(e.target.value));const t=e.target;t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,M)}px`,t.style.overflowY=t.scrollHeight>M?"auto":"hidden"},D=Q(C),x=!oe&&!i&&(g.length>0||D>0),G=async()=>{if(!x)return;if(L){I();return}B(!0);const e=C.trim(),t={blockSlug:o,...c?{sectionKey:c}:{},...J,...g.length?{categories:g}:{},...e?{feedback:e}:{}},[b,y]=await X(fetch(`${H}/api/widget/block-feedback`,{method:"PUT",headers:Y,body:JSON.stringify(t)}));if(y){B(!1);return}(b.ok||b.status===404)&&I(),B(!1)},V=(f==="chips"||i)&&h==="block"&&m!==null&&o?me(o,m):[];return a.jsxs("div",{className:["es-block__rating",s?"es-block__rating--compact":"",te].filter(Boolean).join(" "),"data-es-no-read":!0,style:{display:"flex",alignItems:"center",gap:s?6:8,flexWrap:"wrap",...s?{marginTop:10,paddingTop:8,borderTop:"1px solid var(--es-color-border, rgba(0, 0, 0, 0.1))"}:{marginBottom:12}},children:[a.jsx("span",{className:"es-block__rating-label",style:{fontSize:s?12:13,color:"var(--es-color-on-surface-muted, #4B5563)"},children:l(m?"support_chat.feedback_thanks":ne)}),a.jsx("div",{className:"es-block__rating-stars",role:"radiogroup","aria-label":l(_??"support_chat.rate_aria"),style:{display:"inline-flex",alignItems:"center",gap:4},onMouseLeave:()=>!u&&S(null),children:ye.map(e=>{const t=e<=re;return a.jsx("button",{type:"button",role:"radio","aria-checked":e===W,"aria-label":l("support_chat.rate_star",{count:e}),disabled:u,onMouseEnter:()=>!u&&S(e),onClick:()=>le(e),style:{background:"none",border:"none",padding:0,cursor:u?"default":"pointer",lineHeight:0,color:"var(--es-color-warning, #9C5300)",opacity:u&&!t?.4:1,transition:"opacity 150ms ease-out"},children:a.jsx("svg",{width:U,height:U,viewBox:"0 0 24 24",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"},children:a.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})},e)})}),V.length>0&&a.jsxs("div",{className:"es-block__rating-followup",style:{flexBasis:"100%",display:"flex",flexDirection:"column",gap:6,marginTop:2},children:[a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:V.map(e=>{const t=g.includes(e);return a.jsx("button",{type:"button","aria-pressed":t,disabled:i,onClick:()=>se(e),style:{font:"inherit",fontSize:s?11.5:12,fontWeight:t?600:400,padding:"3px 10px",borderRadius:999,cursor:i?"default":"pointer",border:t?"1px solid var(--es-color-primary, #2563EB)":"1px solid var(--es-color-control-border, #6B7280)",background:t?"var(--es-color-primary-muted, rgba(37, 99, 235, 0.08))":"var(--es-color-surface-elevated, #f5f5f5)",color:t?"var(--es-color-primary-on-muted, #1D4ED8)":"var(--es-color-on-surface-muted, #4B5563)",transition:"border-color 120ms ease, color 120ms ease"},children:l(pe(e))},e)})}),a.jsxs("div",{style:{display:"flex",gap:6,alignItems:"flex-end"},children:[a.jsx("textarea",{rows:1,value:C,disabled:i,onChange:ie,onKeyDown:e=>{e.key==="Enter"&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),G())},placeholder:l("block_feedback.own_words"),"aria-label":l("block_feedback.input_aria"),style:{flex:1,resize:"none",font:"inherit",fontSize:s?12:13,lineHeight:1.45,padding:"6px 10px",borderRadius:10,border:"1px solid var(--es-color-control-border, #6B7280)",background:"var(--es-color-surface-elevated, #f5f5f5)",color:"var(--es-color-on-surface, #1a1a1a)",minHeight:32,maxHeight:M,overflowY:"hidden"}}),a.jsx("button",{type:"button","aria-label":l("block_feedback.send_aria"),disabled:!x,onClick:()=>{G()},style:{border:"none",borderRadius:10,width:32,height:32,flex:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:x?"pointer":"default",background:"var(--es-color-primary, #2563EB)",color:"var(--es-color-on-primary, #FFFFFF)",opacity:x?1:.35,transition:"opacity 150ms ease-out"},children:a.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{display:"block"},children:[a.jsx("path",{d:"M22 2 11 13"}),a.jsx("path",{d:"M22 2 15 22l-4-9-9-4 20-7z"})]})})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8},children:[a.jsx("span",{"aria-live":"polite","data-es-no-read":!0,style:{fontSize:11,fontVariantNumeric:"tabular-nums",color:"var(--es-color-on-surface-muted, #4B5563)",visibility:D>=_e?"visible":"hidden"},children:l("block_feedback.counter",{count:D,max:R})}),a.jsx("button",{type:"button",disabled:i,onClick:I,style:{background:"none",border:"none",padding:0,font:"inherit",fontSize:11,cursor:i?"default":"pointer",color:"var(--es-color-on-surface-muted, #4B5563)",visibility:i?"hidden":"visible"},children:l("block_feedback.skip")})]})]})]})}export{ge as C};
2
- //# sourceMappingURL=block-rating-BgOeTm52-CoiP5C2K.js.map
2
+ //# sourceMappingURL=block-rating-D7hR2gTc-CoiP5C2K.js.map
@@ -1,2 +1,2 @@
1
1
  import{t as r}from"../nexly.js";import{a as u}from"./allowed-elements-BXnLJV1S-C-_lr2zm.js";const p=["https://external-url-probe.invalid/probe","http://external-url-probe.invalid/probe"];function i(t){return t.length>0&&!/^\.+$/.test(t)}function o(t){if(typeof t!="string"||t.length===0||u(t)===null)return null;const[n]=r(()=>new URL(t));return n===null||n.protocol!=="http:"&&n.protocol!=="https:"||!p.every(l=>{const[e]=r(()=>new URL(t,l));return e!==null&&e.href===n.href})||!i(n.hostname)?null:n}function f(t){return o(t)?.href??null}function h(t){return o(t)?.host??""}export{h as c,f as p};
2
- //# sourceMappingURL=external-url-ninK7gY9-CJQjg_od.js.map
2
+ //# sourceMappingURL=external-url-qbs1SznX-CJQjg_od.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as n,j as s,Q as H}from"../nexly.js";const L={slug:"support-session-nav",name:"Support Session Navigator",version:"1.0.0",category:"interactive",configSchema:{},defaultConfig:{},sizing:{minWidth:200,preferredHeight:"fill",scrollable:!0},supportedPlacements:["sidebar","main"],events:{emits:[{name:"support-chat:select-session",description:"User selected a past support session"}]}};function M(a,o){const u=Date.now()-new Date(a).getTime(),r=Math.floor(u/6e4);if(r<1)return o("time.just_now");if(r<60)return o("time.minutes_ago",{count:r});const i=Math.floor(r/60);return i<24?o("time.hours_ago",{count:i}):o("time.days_ago",{count:Math.floor(i/24)})}function T({actions:a,baseUrl:o,productId:u,i18n:r,supportSessionId:i,auth:k,externalContext:g}){const t=r?.t??(e=>e),m=k?.jwt,w=g?.showTicketsTab??!1,[v,l]=n.useState(!1),[x,y]=n.useState([]),[p,b]=n.useState(!1),[f,j]=n.useState(null),[d,h]=n.useState(i??null);n.useEffect(()=>{h(i??null)},[i]);const _=n.useCallback(async()=>{b(!0),j(null);try{const e=await fetch(`${o}/api/support-chat/sessions?productId=${encodeURIComponent(u||"")}`,{headers:{...m?{Authorization:`Bearer ${m}`}:{}},credentials:"include"});if(!e.ok)throw new Error(`HTTP ${e.status}`);const c=await e.json();if(!c.success||!c.data)throw new Error("Invalid response");y(c.data.sessions)}catch{j(t("support_session_nav.load_error"))}finally{b(!1)}},[o,m,u,t]);n.useEffect(()=>a.on("support-chat:session",e=>{const{sessionId:c}=e;c&&h(c),v&&_()}),[a,_,v]),n.useEffect(()=>a.on("support-chat:showHistory",()=>{l(!0),_()}),[a,_]),n.useEffect(()=>a.on("support-chat:clearHistory",()=>{l(!1)}),[a]);const C=n.useCallback(e=>{e!==d&&(h(e),a.emit("support-chat:select-session",{sessionId:e})),l(!1)},[a,d]),N=n.useCallback(()=>{a.emit("support-chat:clearHistory",void 0),h(null),l(!1)},[a]),S=n.useCallback(()=>{l(!1)},[]),E=n.useCallback(()=>{a.emit("support-chat:showTickets",void 0),l(!1)},[a]);return v?s.jsxs(H,{blockType:"support-session-nav",children:[s.jsxs("div",{className:"es-ssn__header",children:[s.jsx("span",{className:"es-ssn__header-title",children:t("support_session_nav.title")}),s.jsxs("div",{className:"es-ssn__header-actions",children:[s.jsx("button",{type:"button",className:"es-ssn__action-btn","aria-label":t("support_chat.new_conversation_button"),title:t("support_chat.new_conversation_button"),onClick:N,children:s.jsxs("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M12 5H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7"}),s.jsx("path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"})]})}),s.jsx("button",{type:"button",className:"es-ssn__action-btn es-ssn__action-btn--active","aria-label":t("support_chat.history_button"),title:t("support_chat.history_button"),"aria-pressed":"true",onClick:S,children:s.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]})}),w&&s.jsx("button",{type:"button",className:"es-ssn__action-btn","aria-label":t("support_chat.tickets_tab_button"),title:t("support_chat.tickets_tab_button"),onClick:E,children:s.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M2 9a3 3 0 1 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 1 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}),s.jsx("path",{d:"m9 12 2 2 4-4"})]})})]})]}),s.jsx("div",{className:"es-block__body",children:s.jsxs("div",{className:"es-ssn__list",role:"list","aria-label":t("support_session_nav.list_aria"),children:[p&&s.jsx("div",{className:"es-ssn__loading",role:"status",children:t("support_session_nav.loading")}),f&&!p&&s.jsx("div",{className:"es-ssn__error",role:"alert",children:f}),!p&&!f&&x.length===0&&s.jsx("div",{className:"es-ssn__empty",children:t("support_session_nav.empty")}),!p&&x.map(e=>s.jsxs("button",{role:"listitem",type:"button",className:`es-ssn__item${e.id===d?" es-ssn__item--active":""}`,onClick:()=>C(e.id),"aria-current":e.id===d?"true":void 0,children:[s.jsx("div",{className:"es-ssn__item-preview",children:e.firstUserMessage??t("support_session_nav.no_preview")}),s.jsxs("div",{className:"es-ssn__item-meta",children:[s.jsx("span",{className:`es-ssn__item-status es-ssn__item-status--${e.status}`,"aria-label":e.status,children:e.status}),s.jsx("span",{children:M(e.updatedAt,t)}),e.messageCount>0&&s.jsx("span",{children:t("support_session_nav.message_count",{count:e.messageCount})})]})]},e.id))]})})]}):null}export{T as Component,L as manifest};
2
- //# sourceMappingURL=index-DsQ3ssZW-DbuSZfeK.js.map
2
+ //# sourceMappingURL=index--xfG4CIn-DbuSZfeK.js.map
@@ -1,2 +1,2 @@
1
1
  import{j as e,Q as u}from"../nexly.js";const y={slug:"demo-shipping-returns",name:"DEMO — Contact details",version:"0.1.0",category:"content",configSchema:{properties:{rows:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"string"},note:{type:"string"}},required:["label","value"]},default:[]}}},defaultConfig:{rows:[]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main","sidebar"]};function _(t){return Array.isArray(t)?t.flatMap(s=>{if(typeof s!="object"||s===null)return[];const n=s,d=typeof n.label=="string"?n.label.trim():"",a=typeof n.value=="string"?n.value.trim():"";if(!d||!a)return[];const c=typeof n.note=="string"?n.note.trim():"";return[{label:d,value:a,...c?{note:c}:{}}]}):[]}function i(t){if(typeof t!="string")return null;const s=t.trim();return s.length>0?s:null}function x(t){const s=i(t);if(!s||/\s/.test(s))return null;const n=s.indexOf("@");return n>0&&n<s.length-1?s:null}function j(t){const s=i(t);return!s||!/[0-9]/.test(s)?null:s}function f(t){return t.split(/\s+/).filter(s=>/[\p{L}\p{N}]/u.test(s)).slice(0,2).map(s=>s[0].toUpperCase()).join("")}function v({data:t,config:s,i18n:n}){const d=n?.t??(o=>o),a=t?.rows?t:s??{},c=_(a.rows),m=i(a.company),p=i(a.tagline),r=x(a.email),l=j(a.phone),h=i(a.note);return!m&&!r&&!l&&c.length===0?e.jsx(u,{blockType:"demo-shipping-returns",children:e.jsx("div",{className:"es-block__body",children:e.jsx("div",{className:"es-block__empty",children:d("demoTerms.empty")})})}):e.jsx(u,{blockType:"demo-shipping-returns",children:e.jsxs("div",{className:"es-block__body es-democontact",children:[e.jsxs("div",{className:"es-democontact__card",children:[m&&e.jsxs("div",{className:"es-democontact__identity",children:[e.jsx("div",{className:"es-democontact__coin","aria-hidden":"true",children:f(m)}),e.jsxs("div",{className:"es-democontact__names",children:[e.jsx("p",{className:"es-democontact__company",children:m}),p&&e.jsx("p",{className:"es-democontact__tagline",children:p})]})]}),c.length>0&&e.jsx("dl",{className:"es-democontact__grid",children:c.map(o=>e.jsxs("div",{className:"es-democontact__cell",children:[e.jsx("dt",{className:"es-democontact__label",children:o.label}),e.jsx("dd",{className:"es-democontact__value",children:o.value}),o.note&&e.jsx("dd",{className:"es-democontact__note",children:o.note})]},o.label))}),(r||l)&&e.jsxs("div",{className:"es-democontact__actions",children:[r&&e.jsxs("a",{className:"es-democontact__action",href:`mailto:${r}`,children:[e.jsxs("svg",{className:"es-democontact__glyph",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"2.5",y:"4.5",width:"19",height:"15",rx:"2.5"}),e.jsx("path",{d:"M3 7l9 6 9-6"})]}),e.jsx("span",{className:"es-democontact__action-text",children:r})]}),l&&e.jsxs("a",{className:"es-democontact__action",href:`tel:${l.replace(/\s+/g,"")}`,children:[e.jsx("svg",{className:"es-democontact__glyph",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M6.5 3.5h3l1.5 4-2 1.5a11 11 0 006 6l1.5-2 4 1.5v3a2 2 0 01-2.2 2A17 17 0 014.5 5.7 2 2 0 016.5 3.5z"})}),e.jsx("span",{className:"es-democontact__action-text",children:l})]})]})]}),h&&e.jsxs("div",{className:"es-democontact__reassurance",children:[e.jsxs("svg",{className:"es-democontact__glyph",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M12 3l7.5 3v5.5c0 4.6-3.1 8.4-7.5 9.5-4.4-1.1-7.5-4.9-7.5-9.5V6z"}),e.jsx("path",{d:"M9 12.2l2.2 2.2 4-4.2"})]}),e.jsx("p",{className:"es-democontact__reassurance-text",children:h})]})]})})}export{v as Component,y as manifest};
2
- //# sourceMappingURL=index-CHUW1nlj-DAdxCQyi.js.map
2
+ //# sourceMappingURL=index-7N5M1HdS-DAdxCQyi.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as P,j as s,Q as m}from"../nexly.js";const n=28,u=2*Math.PI*n;function w({data:t,config:g,actions:h,metadata:N,i18n:_}){const i=_?.t??(e=>e),b=g.mode??t.mode??"basic",p=t.report,a=t.aiPitch,[v,x]=P.useState("idle");if(!p&&!t.error)return s.jsx(m,{blockType:"product-sales-intel",children:s.jsx("div",{className:"psi-block",children:s.jsxs("div",{className:"psi-pv-card",children:[s.jsxs("div",{className:"psi-ring-container",children:[s.jsx("svg",{className:"psi-ring-svg",width:72,height:72,viewBox:"0 0 72 72",children:s.jsx("circle",{className:"psi-ring-track",cx:36,cy:36,r:n})}),s.jsxs("div",{className:"psi-ring-label",children:[s.jsx("span",{className:"psi-ring-pct",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:"0%"}),s.jsx("span",{className:"psi-ring-sub",children:"PV"})]})]}),s.jsxs("div",{className:"psi-pv-info",children:[s.jsx("div",{className:"psi-pv-title",children:i("product_sales_intel.personal_volume")}),s.jsx("div",{className:"psi-pv-amount",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:"—"}),s.jsx("div",{className:"psi-pv-target",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:N?.dataQuality==="none"?i("product_sales_intel.signin_prompt"):i("product_sales_intel.loading")})]})]})})});if(t.error||!p)return s.jsx(m,{blockType:"product-sales-intel",children:s.jsx("p",{style:{color:"var(--es-color-error, #AD2C26)",fontSize:13},children:i("product_sales_intel.load_error")})});const{pvSummary:c,products:l,topProduct:r}=p,y=u-u*c.progressPct/100,j=l[0]?.pvPoints??1,f=()=>{a&&(navigator.clipboard.writeText(a).catch(()=>{}),x("copied"),h?.emit?.("psi:pitchCopied",{pitch:a}),setTimeout(()=>x("idle"),2e3))},o=e=>{h?.emit?.("psi:productSelected",{productId:e.productId,name:e.name})};return s.jsx(m,{blockType:"product-sales-intel",children:s.jsxs("div",{className:"psi-block",children:[s.jsxs("div",{className:"psi-pv-card",children:[s.jsxs("div",{className:"psi-ring-container",children:[s.jsxs("svg",{className:"psi-ring-svg",width:72,height:72,viewBox:"0 0 72 72",children:[s.jsx("circle",{className:"psi-ring-track",cx:36,cy:36,r:n}),s.jsx("circle",{className:"psi-ring-fill",cx:36,cy:36,r:n,strokeDasharray:u,strokeDashoffset:y})]}),s.jsxs("div",{className:"psi-ring-label",children:[s.jsxs("span",{className:"psi-ring-pct",children:[c.progressPct,"%"]}),s.jsx("span",{className:"psi-ring-sub",children:"PV"})]})]}),s.jsxs("div",{className:"psi-pv-info",children:[s.jsx("div",{className:"psi-pv-title",children:i("product_sales_intel.personal_volume")}),s.jsx("div",{className:"psi-pv-amount",children:c.personalVolume.toLocaleString()}),s.jsx("div",{className:"psi-pv-target",children:i("product_sales_intel.target_label",{value:c.pvTarget.toLocaleString()})}),c.gapToPv>0&&s.jsx("div",{className:"psi-pv-gap",children:i("product_sales_intel.pv_to_go",{value:c.gapToPv.toLocaleString()})})]})]}),r&&s.jsxs("div",{className:"psi-top-product",onClick:()=>o(r),onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(r))},tabIndex:0,role:"button",children:[s.jsx("span",{className:"psi-top-label",children:i("product_sales_intel.top_product")}),s.jsx("span",{className:"psi-top-name",children:r.name}),s.jsxs("span",{className:"psi-top-badge",children:[r.pvPoints," PV"]})]}),b==="pro"&&l.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"psi-section-title",children:i("product_sales_intel.all_products",{count:l.length})}),s.jsx("div",{className:"psi-product-list",children:l.map(e=>{const k=j>0?Math.round(e.pvPoints/j*100):0;return s.jsxs("div",{className:"psi-product-row",onClick:()=>o(e),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(e))},tabIndex:0,role:"button",children:[s.jsxs("div",{className:"psi-product-header",children:[s.jsx("span",{className:"psi-product-name",children:e.name}),s.jsxs("div",{className:"psi-product-stats",children:[s.jsx("span",{className:"psi-product-stat",children:i("product_sales_intel.units_sold",{count:e.unitsSold})}),s.jsxs("span",{className:"psi-product-stat",children:["$",e.revenue.toLocaleString()]}),s.jsxs("span",{className:"psi-product-pv",children:[e.pvPoints," PV"]})]})]}),s.jsx("div",{className:"psi-product-bar-track",children:s.jsx("div",{className:"psi-product-bar-fill",style:{width:`${k}%`}})})]},e.productId)})})]}),a&&s.jsxs("div",{className:"psi-pitch-box",children:[s.jsxs("div",{className:"psi-pitch-header",children:[s.jsx("span",{className:"psi-pitch-label",children:i("product_sales_intel.ai_coach_label")}),s.jsx("button",{className:`psi-copy-btn${v==="copied"?" psi-copied":""}`,onClick:f,children:v==="copied"?`✓ ${i("common.copied")}`:i("common.copy")})]}),s.jsx("p",{className:"psi-pitch-text",children:a})]})]})})}const C={slug:"product-sales-intel",name:"Product Sales Intelligence",version:"1.0.0",category:"data",requiredService:"product-sales-intel",configSchema:{properties:{mode:{type:"string",default:"basic"}}},defaultConfig:{mode:"basic"},sizing:{minWidth:260,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"product-sales-intel",inputSchema:{type:"object",properties:{report:{type:"object"},aiPitch:{type:"string"},mode:{type:"string"}},required:["report","mode"]}},events:{emits:[{name:"psi:productSelected",description:"User clicked on a product in the list"},{name:"psi:pitchCopied",description:"User copied the AI product pitch"}]}};export{w as Component,w as ProductSalesIntelBlock,C as manifest};
2
- //# sourceMappingURL=index-CaHbIY6I-QeFj7CR9.js.map
2
+ //# sourceMappingURL=index-99heIIoH-QeFj7CR9.js.map
@@ -1,4 +1,4 @@
1
- import{r as o,b as T,j as e,Q}from"../nexly.js";import{x as oe,s as me,c as de,a as ue}from"./allowed-elements-BXnLJV1S-C-_lr2zm.js";import{p as he,c as _e}from"./external-url-ninK7gY9-CJQjg_od.js";import{f as pe}from"./assistant-link-components-D0uKk8Hv-xEDu0ls0.js";import{C as ge}from"./block-rating-BgOeTm52-CoiP5C2K.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";import"./assistant-link-policy-CogLpq-3-Cc-yj-a-.js";const Te={slug:"market-insights",name:"Market Insights",version:"2.3.0",category:"data",requiredService:"crypto-intel",configSchema:{properties:{proMode:{type:"boolean",default:!1},showFearGreed:{type:"boolean",default:!0},showNews:{type:"boolean",default:!0},showBtcPrice:{type:"boolean",default:!0},newsLimit:{type:"number",default:5},confirmExternalLinks:{type:"boolean",default:!0}}},defaultConfig:{proMode:!1,showFearGreed:!0,showNews:!0,showBtcPrice:!0,newsLimit:5,confirmExternalLinks:!0},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},dataContract:{serviceSlug:"crypto-intel",inputSchema:{type:"object",properties:{fearGreedIndex:{type:"number"},fearGreedLabel:{type:"string"},btcPrice:{type:"number"},btcChange24h:{type:"number"},dominance:{type:"number"},news:{type:"array",items:{type:"object",properties:{title:{type:"string"},source:{type:"string"},publishedAt:{type:"string"},url:{type:"string"},tagline:{type:"string"},articleSummary:{type:"string"}}}},summary:{type:"string"}},required:["summary"]},previewDataOverride:{fearGreedIndex:72,fearGreedLabel:"Greed",btcPrice:68900,btcChange24h:3.15,dominance:54.2,news:[{title:"Bitcoin surges past $68K on strong ETF inflows",source:"CoinDesk",publishedAt:"2026-04-03T08:00:00Z",url:"https://example.com/news/btc-surges"},{title:"Ethereum developers confirm next upgrade timeline",source:"The Block",publishedAt:"2026-04-03T06:30:00Z",url:"https://example.com/news/eth-upgrade"},{title:"DeFi total value locked hits new all-time high",source:"DeFiLlama",publishedAt:"2026-04-02T22:00:00Z",url:"https://example.com/news/defi-tvl"},{title:"South Korea advances crypto regulation framework",source:"Decrypt",publishedAt:"2026-04-02T18:00:00Z",url:"https://example.com/news/sk-crypto"},{title:"MicroStrategy adds 1,000 BTC to corporate treasury",source:"Bloomberg",publishedAt:"2026-04-02T14:00:00Z",url:"https://example.com/news/mstr-btc"}],summary:`Market Sentiment: 72 (Greed)
1
+ import{r as o,b as T,j as e,Q}from"../nexly.js";import{x as oe,s as me,c as de,a as ue}from"./allowed-elements-BXnLJV1S-C-_lr2zm.js";import{p as he,c as _e}from"./external-url-qbs1SznX-CJQjg_od.js";import{f as pe}from"./assistant-link-components-DUrLEPUB-DKaQavIJ.js";import{C as ge}from"./block-rating-D7hR2gTc-CoiP5C2K.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";import"./assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js";const Te={slug:"market-insights",name:"Market Insights",version:"2.3.0",category:"data",requiredService:"crypto-intel",configSchema:{properties:{proMode:{type:"boolean",default:!1},showFearGreed:{type:"boolean",default:!0},showNews:{type:"boolean",default:!0},showBtcPrice:{type:"boolean",default:!0},newsLimit:{type:"number",default:5},confirmExternalLinks:{type:"boolean",default:!0}}},defaultConfig:{proMode:!1,showFearGreed:!0,showNews:!0,showBtcPrice:!0,newsLimit:5,confirmExternalLinks:!0},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},dataContract:{serviceSlug:"crypto-intel",inputSchema:{type:"object",properties:{fearGreedIndex:{type:"number"},fearGreedLabel:{type:"string"},btcPrice:{type:"number"},btcChange24h:{type:"number"},dominance:{type:"number"},news:{type:"array",items:{type:"object",properties:{title:{type:"string"},source:{type:"string"},publishedAt:{type:"string"},url:{type:"string"},tagline:{type:"string"},articleSummary:{type:"string"}}}},summary:{type:"string"}},required:["summary"]},previewDataOverride:{fearGreedIndex:72,fearGreedLabel:"Greed",btcPrice:68900,btcChange24h:3.15,dominance:54.2,news:[{title:"Bitcoin surges past $68K on strong ETF inflows",source:"CoinDesk",publishedAt:"2026-04-03T08:00:00Z",url:"https://example.com/news/btc-surges"},{title:"Ethereum developers confirm next upgrade timeline",source:"The Block",publishedAt:"2026-04-03T06:30:00Z",url:"https://example.com/news/eth-upgrade"},{title:"DeFi total value locked hits new all-time high",source:"DeFiLlama",publishedAt:"2026-04-02T22:00:00Z",url:"https://example.com/news/defi-tvl"},{title:"South Korea advances crypto regulation framework",source:"Decrypt",publishedAt:"2026-04-02T18:00:00Z",url:"https://example.com/news/sk-crypto"},{title:"MicroStrategy adds 1,000 BTC to corporate treasury",source:"Bloomberg",publishedAt:"2026-04-02T14:00:00Z",url:"https://example.com/news/mstr-btc"}],summary:`Market Sentiment: 72 (Greed)
2
2
 
3
3
  BTC: $68,900 | 24h: +3.15% | Dominance: 54.2%`}},fields:[{id:"proMode",type:"toggle",label:"Pro mode (full analysis with context)",default:!1,group:"Display"},{id:"showFearGreed",type:"toggle",label:"Show Fear & Greed index",default:!0,group:"Display"},{id:"showBtcPrice",type:"toggle",label:"Show BTC price",default:!0,group:"Display"},{id:"showNews",type:"toggle",label:"Show news feed",default:!0,group:"Display"},{id:"newsLimit",type:"range",label:"Max news items",default:5,min:1,max:15,step:1,group:"Display"},{id:"confirmExternalLinks",type:"toggle",label:"Confirm before opening external news links",default:!0,group:"Display"}],events:{emits:[{name:"market:newsClicked",description:"User clicked on a news headline"},{name:"market:sentimentViewed",description:"Fear & Greed index was viewed"},{name:"chat:draft",description:"Seed the chat composer with a draft message + quick-reply chips"}],listens:[{name:"market:refresh",description:"Force refresh market data"}]},supportedPlacements:["main","sidebar"]},xe=1e4,D={price:null,change24h:null,ts:null,live:!1};function ye({baseUrl:a,apiKey:n,enabled:l=!0,intervalMs:c=xe}){const[_,d]=o.useState(D),x=o.useRef(a),S=o.useRef(n);return x.current=a,S.current=n,o.useEffect(()=>{if(!l){d(D);return}let t=!1;const M=async()=>{if(typeof document<"u"&&document.hidden||typeof fetch!="function")return;const k=S.current,[$,y]=await T(fetch(`${x.current}/api/widget/market/btc-price`,{headers:k?{"X-API-Key":k}:void 0}));if(t)return;if(y||!$.ok){d(u=>u.live?D:u);return}const[g,b]=await T($.json());if(!t){if(b||g?.price==null){d(u=>u.live?D:u);return}d({price:g.price,change24h:g.change24h??null,ts:g.ts??null,live:!0})}};M();const v=setInterval(()=>{M()},c);return()=>{t=!0,clearInterval(v)}},[l,c]),_}function W(a){return _e(a)}function R(a){return he(a)}const be="var(--es-color-warning, #9C5300)";function we(a){return a<=25?"var(--es-color-error, #AD2C26)":a<=55?be:"var(--es-color-success, #00672B)"}function fe(a){return a==null?"--":`$${a.toLocaleString("en-US",{maximumFractionDigits:0})}`}function ve(a){if(a==null)return{text:"--",positive:!0};const n=a>=0;return{text:`${n?"+":""}${a.toFixed(1)}%`,positive:n}}function H(a){return a==null?"--":a>=1e12?`$${(a/1e12).toFixed(2)}T`:a>=1e9?`$${(a/1e9).toFixed(1)}B`:a>=1e6?`$${(a/1e6).toFixed(0)}M`:`$${a.toLocaleString()}`}function ke(a){if(!a)return"";const n=Date.now()-new Date(a).getTime(),l=Math.floor(n/6e4);if(l<60)return`${l}m`;const c=Math.floor(l/60);return c<24?`${c}h`:`${Math.floor(c/24)}d`}function je(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}function Ge({data:a,config:n,i18n:l,actions:c,baseUrl:_,externalContext:d,auth:x,previewMode:S}){const t=l?.t??(s=>s),M=a.promptLogId,v=n.proMode??!1,k=n.showFearGreed??!0,$=v&&(n.showNews??!0),y=n.showBtcPrice??!0,g=n.confirmExternalLinks??!0,[b,u]=o.useState(null),X=n.newsLimit??5,j=d?.apiKey??"",J=d?.hasChatView===!0,[G,Y]=o.useState(()=>new Set),[B,L]=o.useState(()=>new Map),w=a.fearGreedIndex,ee=a.fearGreedLabel,P=(a.news??[]).slice(0,X),Z=a.btcPrice,se=a.btcChange24h,A=a.btcVolume,E=a.btcMarketCap,I=a.dominance,K=a.aiSummary,q=w!=null?we(w):void 0,F=ye({baseUrl:_,apiKey:j,enabled:y}),U=F.live&&F.price!=null,V=U?F.price:Z,ae=U?F.change24h:se,O=ve(ae),N=a._errors??[],te=w!=null||Z!=null||P.length>0,ie=typeof K=="string"&&K.trim().length>0,z=o.useCallback(async(s,i)=>{L(C=>{const p=new Map(C);return p.set(s,{status:"loading"}),p});const[m,h]=await T(fetch(`${_}/api/widget/crypto-intel/article-summary`,{method:"POST",headers:{"Content-Type":"application/json",...j?{"X-API-Key":j}:{}},body:JSON.stringify({title:i.title,url:i.url,source:i.source,publishedAt:i.publishedAt,tagline:i.tagline})})),r=()=>L(C=>{const p=new Map(C);return p.set(s,{status:"error"}),p});if(h||!m.ok)return r();const[f,ce]=await T(m.json());if(ce||!f?.summary)return r();L(C=>{const p=new Map(C);return p.set(s,{status:"ready",text:f.summary}),p})},[j,_]),re=o.useCallback((s,i)=>{if(Y(h=>{const r=new Set(h);return r.has(s)?(r.delete(s),r):(r.add(s),r)}),G.has(s)||B.has(s))return;const m=i.articleSummary?.trim();if(m){L(h=>{const r=new Map(h);return r.set(s,{status:"ready",text:m}),r});return}z(s,i)},[G,B,z]),ne=o.useCallback(s=>{c.emit("chat:draft",{message:t("market_insights.gaio_draft",{title:s.title,source:s.source??"",url:s.url??""}),autoSend:!1,quickChips:[{label:t("market_insights.chip.analyze"),message:t("market_insights.chip.analyze_msg",{url:s.url??""}),autoSend:!0},{label:t("market_insights.chip.summarize"),message:t("market_insights.chip.summarize_msg",{url:s.url??""}),autoSend:!0},{label:t("market_insights.chip.conclusions"),message:t("market_insights.chip.conclusions_msg",{url:s.url??""}),autoSend:!0},{label:t("market_insights.chip.other"),message:"",autoSend:!1}]})},[c,t]),le=o.useCallback(s=>{const i=R(s.url);if(!i)return;if(g){u({url:i,source:s.source||W(i)});return}const m=window.open(i,"_blank","noopener,noreferrer");m&&(m.opener=null)},[g]);return te?e.jsxs(Q,{blockType:"market-insights",children:[e.jsxs("div",{className:"es-block__body",children:[e.jsx(ge,{promptLogId:M,baseUrl:_,apiKey:j,jwt:x?.jwt,previewMode:S,t}),(y||k)&&e.jsxs("div",{className:"es-mi__header",children:[y&&V!=null&&e.jsxs("div",{className:"es-mi__card es-mi__card--btc",children:[e.jsx("span",{className:"es-mi__icon","aria-hidden":"true",children:"B"}),e.jsxs("div",{className:"es-mi__card-label",children:[t("market_insights.bitcoin_label"),U&&e.jsxs("span",{className:"es-mi__live",title:t("market_insights.live_aria"),children:[e.jsx("span",{className:"es-mi__live-dot","aria-hidden":"true"}),t("market_insights.live")]})]}),e.jsx("div",{className:"es-mi__card-value",children:fe(V)}),e.jsx("div",{className:`es-mi__delta ${O.positive?"es-mi__delta--up":"es-mi__delta--down"}`,children:O.text})]}),k&&w!=null&&e.jsxs("div",{className:"es-mi__card es-mi__card--fg",children:[e.jsx("span",{className:"es-mi__icon","aria-hidden":"true",children:"FG"}),e.jsx("div",{className:"es-mi__card-label",children:"Fear & Greed"}),e.jsx("div",{className:"es-mi__card-value es-mi__card-value--fg",style:{color:q},children:w}),e.jsx("div",{className:"es-mi__card-tag",style:{color:q},children:ee}),e.jsx("div",{className:"es-mi__card-bar",children:e.jsx("div",{className:"es-mi__card-bar-fill",style:{width:`${w}%`}})})]})]}),v&&y&&(A!=null||E!=null||I!=null)&&e.jsxs("div",{className:"es-mi__stats",children:[A!=null&&e.jsxs("div",{className:"es-mi__stat",children:[e.jsx("span",{className:"es-mi__stat-label",children:t("market_insights.vol_24h")}),e.jsx("span",{className:"es-mi__stat-value",children:H(A)})]}),E!=null&&e.jsxs("div",{className:"es-mi__stat",children:[e.jsx("span",{className:"es-mi__stat-label",children:t("market_insights.market_cap")}),e.jsx("span",{className:"es-mi__stat-value",children:H(E)})]}),I!=null&&e.jsxs("div",{className:"es-mi__stat",children:[e.jsx("span",{className:"es-mi__stat-label",children:t("market_insights.btc_dominance")}),e.jsxs("span",{className:"es-mi__stat-value",children:[I,"%"]})]})]}),v&&ie&&e.jsxs("div",{className:"es-mi__summary",children:[e.jsx("div",{className:"es-mi__summary-eyebrow",children:t("market_insights.summary_eyebrow")}),e.jsx("div",{className:"es-mi__summary-body es-mi__summary-markdown",children:e.jsx(oe,{remarkPlugins:[...de],allowedElements:[...me],transformLinkUri:s=>ue(s)??"",components:{...pe()},children:K})})]}),$&&P.length>0&&e.jsxs("div",{className:"es-mi__news",children:[e.jsx("div",{className:"es-mi__news-header",children:t("market_insights.news_header")}),e.jsx("ul",{className:"es-mi__news-list",children:P.map((s,i)=>{const m=R(s.url)!==null,h=G.has(i),r=B.get(i),f=r?.status==="loading";return e.jsxs("li",{className:"es-mi__news-item",children:[e.jsx("span",{className:"es-mi__news-stripe","aria-hidden":"true"}),e.jsxs("div",{className:"es-mi__news-body",children:[e.jsx("span",{className:"es-mi__news-title",children:s.title}),e.jsxs("div",{className:"es-mi__news-meta",children:[s.source&&e.jsx("span",{className:"es-mi__news-source",children:s.source}),s.publishedAt&&e.jsx("span",{className:"es-mi__news-time",children:ke(s.publishedAt)})]}),s.tagline&&s.tagline.trim().length>0&&e.jsx("div",{className:"es-mi__news-tagline",children:s.tagline}),e.jsxs("div",{className:"es-mi__news-actions",role:"group","aria-label":t("market_insights.actions_aria"),children:[e.jsxs("button",{type:"button",className:"es-mi__news-btn","aria-expanded":h,"aria-busy":f,disabled:f,onClick:()=>re(i,s),children:[t(f?"market_insights.summary_loading":h?"market_insights.hide":"market_insights.read_more"),e.jsx("span",{className:"es-mi__news-btn-caret","aria-hidden":"true",children:"▾"})]}),J&&e.jsx("button",{type:"button",className:"es-mi__news-btn es-mi__news-btn--gaio",onClick:()=>ne(s),children:t("market_insights.talk_to_gaio")}),m&&e.jsxs("button",{type:"button",className:"es-mi__news-btn",onClick:()=>le(s),children:[t("market_insights.open_link"),e.jsx(je,{})]})]}),e.jsx("div",{className:`es-mi__news-summary${h?" es-mi__news-summary--open":""}${r?.status==="error"?" es-mi__news-summary--error":""}`,children:e.jsx("div",{className:"es-mi__news-summary-inner",children:e.jsxs("div",{className:"es-mi__news-summary-panel",children:[r?.status==="loading"&&e.jsxs("div",{className:"es-mi__news-skeleton","aria-label":t("market_insights.summary_loading"),children:[e.jsx("span",{className:"es-mi__news-skeleton-line"}),e.jsx("span",{className:"es-mi__news-skeleton-line"}),e.jsx("span",{className:"es-mi__news-skeleton-line"})]}),r?.status==="ready"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"es-mi__news-summary-eyebrow",children:t("market_insights.summary_eyebrow")}),e.jsx("div",{className:"es-mi__news-summary-body",children:r.text})]}),r?.status==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"es-mi__news-summary-error-text",children:t("market_insights.summary_error")}),e.jsx("button",{type:"button",className:"es-mi__news-retry",onClick:()=>{z(i,s)},children:t("market_insights.summary_retry")})]})]})})})]})]},i)})})]})]}),b&&e.jsx(Ne,{url:b.url,source:b.source,t,onCancel:()=>u(null),onContinue:()=>{const s=window.open(b.url,"_blank","noopener,noreferrer");s&&(s.opener=null),u(null)}})]}):e.jsx(Q,{blockType:"market-insights",children:e.jsxs("div",{className:"es-block__body",children:[e.jsx("div",{className:"es-block__empty",children:N.length>0?`Data sources unavailable (${N.length} error${N.length>1?"s":""})`:"No market data available"}),N.length>0&&e.jsx("ul",{className:"es-mi__errors",children:N.map((s,i)=>e.jsx("li",{className:"es-mi__error-item",children:s},i))})]})})}function Ne({url:a,source:n,t:l,onCancel:c,onContinue:_}){const d=W(a);return e.jsx("div",{className:"es-mi__leave-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"es-mi-leave-title",onClick:c,children:e.jsxs("div",{className:"es-mi__leave-card",onClick:x=>x.stopPropagation(),children:[e.jsx("div",{className:"es-mi__leave-icon","aria-hidden":"true",children:e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}),e.jsx("h2",{id:"es-mi-leave-title",className:"es-mi__leave-title",children:l("market_insights.external_link.title")}),e.jsx("p",{className:"es-mi__leave-body",children:l("market_insights.external_link.body")}),e.jsxs("div",{className:"es-mi__leave-source",title:a,children:[e.jsx("span",{className:"es-mi__leave-source-label",children:n}),e.jsx("span",{className:"es-mi__leave-source-host",children:d})]}),e.jsxs("div",{className:"es-mi__leave-actions",children:[e.jsx("button",{type:"button",className:"es-mi__leave-btn es-mi__leave-btn--cancel",onClick:c,children:l("market_insights.external_link.cancel")}),e.jsx("button",{type:"button",className:"es-mi__leave-btn es-mi__leave-btn--primary",onClick:_,autoFocus:!0,children:l("market_insights.external_link.continue")})]})]})})}export{Ge as Component,Te as manifest};
4
- //# sourceMappingURL=index-D3OBLy0s-k8E4HOBM.js.map
4
+ //# sourceMappingURL=index-B3DeMFo7-BbdAbuAw.js.map
@@ -1,2 +1,2 @@
1
1
  import{w as B,p as T,f as O,x as E,A as W,S as G,O as Y}from"./accent-legibility-BJF2VO5n-CDPQ7suO.js";import{H as J,r as j,j as s,Y as K}from"../nexly.js";const Q=4.5,x="#3B6FD4",Z={"--ai-bg":"#FFFFFF","--ai-bg-elevated":"#F9FAFB","--ai-bg-card":"#F3F4F6","--ai-bg-input":"#FFFFFF","--ai-bg-footer":"#F9FAFB","--ai-fg":"#111827","--ai-fg-secondary":"#374151","--ai-muted":"#4B5563","--ai-muted-dim":"#6B7280","--ai-border":"#E5E7EB","--ai-border-subtle":"#F3F4F6","--ai-assistant-bubble":"#F3F4F6","--ai-assistant-bubble-fg":"#111827","--ai-shadow":"0 20px 60px -15px rgba(15, 23, 42, 0.25)","--ai-success":"#00672B","--ai-warning":"#9C5300","--ai-error":"#AD2C26","--ai-info":"#03669D","--es-color-surface":"#FFFFFF","--es-color-surface-elevated":"#F9FAFB","--es-color-surface-hover":"#F3F4F6","--es-color-on-surface":"#111827","--es-color-on-surface-muted":"#4B5563","--es-color-border":"#E5E7EB","--es-color-control-border":"#6B7280","--es-color-error":"#AD2C26","--es-color-success":"#00672B","--es-color-on-success":"#FFFFFF"},ee={"--ai-bg":"#0F1115","--ai-bg-elevated":"#171A20","--ai-bg-card":"#171A20","--ai-bg-input":"#0F1115","--ai-bg-footer":"#0F1115","--ai-fg":"#F3F4F6","--ai-fg-secondary":"#D1D5DB","--ai-muted":"#9CA3AF","--ai-muted-dim":"#6B7280","--ai-border":"#252A33","--ai-border-subtle":"#1B1F26","--ai-assistant-bubble":"#171A20","--ai-assistant-bubble-fg":"#F3F4F6","--ai-shadow":"0 20px 60px -15px rgba(0, 0, 0, 0.7)","--ai-success":"#4ADE80","--ai-warning":"#FACC15","--ai-error":"#F87171","--ai-info":"#38BDF8","--es-color-surface":"#0F1115","--es-color-surface-elevated":"#171A20","--es-color-surface-hover":"#252A33","--es-color-on-surface":"#F3F4F6","--es-color-on-surface-muted":"#9CA3AF","--es-color-border":"#252A33","--es-color-control-border":"#6B7280","--es-color-error":"#F87171","--es-color-success":"#4ADE80","--es-color-on-success":"#0F1115"};function X(e){const a=Y("#FFFFFF",e),r=Y("#000000",e);return a>=r?"#FFFFFF":"#000000"}function ae(e){const[a,r,o]=O(e),t=G(e)<.2?28:-28;return T([Math.max(0,Math.min(255,a+t)),Math.max(0,Math.min(255,r+t)),Math.max(0,Math.min(255,o+t))])}function L({brandColor:e,mode:a}){const r=a==="light"?Z:ee,o=e&&B(e)?e:x,t=T(O(o)),l=X(t),f={ai:["--ai-bg","--ai-bg-elevated","--ai-bg-card","--ai-bg-input","--ai-bg-sidebar","--ai-bg-footer"],es:["--es-color-surface","--es-color-surface-elevated","--es-color-surface-hover"]},w=(C,c)=>{const g=new Set([c]);for(const S of f[C]){const b=r[S];typeof b=="string"&&B(b)&&g.add(b)}return[...g]},p=E({accent:t,surface:w("ai",r["--ai-bg-card"]),backdrop:r["--ai-bg"],tintAlpha:a==="light"?.08:.12,mode:a}),m=E({accent:t,surface:w("es",r["--es-color-surface-elevated"]),backdrop:r["--es-color-surface"],tintAlpha:a==="light"?.08:.12,mode:a}),u=W(t,w("es",r["--es-color-surface"]),Q,a);return{...r,"--ai-accent":t,"--ai-accent-fg":l,"--ai-accent-hover":ae(t),"--ai-accent-subtle":p.tint,"--ai-accent-on-subtle":p.onTint,"--ai-accent-on-subtle-strong":p.onStrongTint,"--ai-accent-border":p.boundary,"--ai-user-bubble":t,"--ai-user-bubble-fg":l,"--ai-scrollbar":t,"--es-color-primary":u,"--es-color-on-primary":X(u),"--es-color-primary-muted":m.tint,"--es-color-primary-on-muted":m.onTint,"--es-color-interactive":u}}const ge=L({brandColor:x,mode:"light"}),be=L({brandColor:x,mode:"dark"}),n={shape:"--es-demo-launcher-shape",width:"--es-demo-launcher-width",height:"--es-demo-launcher-height",radius:"--es-demo-launcher-radius",background:"--es-demo-launcher-background",shadow:"--es-demo-launcher-shadow",padding:"--es-demo-launcher-padding",offsetX:"--es-demo-launcher-offset-x",offsetY:"--es-demo-launcher-offset-y"},i={width:{min:32,max:240,step:2},height:{min:32,max:240,step:2},radius:{min:0,max:64,step:1},padding:{min:0,max:32,step:1},offsetX:{min:0,max:240,step:2},offsetY:{min:0,max:240,step:2}},H=8,re=8,oe=.6,d={shape:"pill",width:56,height:56,radius:12,background:"accent",shadow:!0,padding:0,offsetX:20,offsetY:20},se=new Set(["pill","circle","square","rectangle"]),te=new Set(["accent","neutral","none"]);function ne(e){if(typeof e!="string")return;const a=/^\s*(-?\d+(?:\.\d+)?)\s*(?:px)?\s*$/i.exec(e);if(!a)return;const r=Number(a[1]);return Number.isFinite(r)?r:void 0}function F(e,a,r){const o=ne(e);return o===void 0?r:Math.min(a.max,Math.max(a.min,o))}function R(e,a,r){if(typeof e!="string")return r;const o=e.trim().toLowerCase();return a.has(o)?o:r}function ie(e,a){if(typeof e!="string")return a;const r=e.trim().toLowerCase();return r==="true"||r==="1"?!0:r==="false"||r==="0"?!1:a}function U(e){const a=e.shape==="circle"||e.shape==="square";return{width:e.width,height:a?e.width:e.height}}function le(e,a,r,o){if(e==="pill")return o;const t=Math.max(0,Math.floor((Math.min(r.width,r.height)-H)/2)),l=a==="accent"?Math.min(re,t):0;return Math.min(t,Math.max(l,o))}function ce(e){const a=e??{},r=d,o=R(a[n.shape],se,r.shape),t=R(a[n.background],te,r.background),l=F(a[n.width],i.width,r.width),f=F(a[n.height],i.height,r.height);return{shape:o,width:l,height:f,radius:F(a[n.radius],i.radius,r.radius),background:t,shadow:ie(a[n.shadow],r.shadow),padding:le(o,t,U({shape:o,width:l,height:f}),F(a[n.padding],i.padding,r.padding)),offsetX:F(a[n.offsetX],i.offsetX,r.offsetX),offsetY:F(a[n.offsetY],i.offsetY,r.offsetY)}}const N={accent:"var(--ai-accent)",neutral:"var(--ai-bg)",none:"transparent"};function de(e){const{width:a,height:r}=U(e),o=e.shape==="circle"?"50%":e.shape==="pill"?"calc(var(--es-demo-launcher-h) / 2)":`${e.radius}px`;return{"--es-demo-launcher-w":`${a}px`,"--es-demo-launcher-h":`${r}px`,"--es-demo-launcher-radius":o,"--es-demo-launcher-bg":N[e.background],"--es-demo-launcher-dot-ring":e.background==="none"?N.neutral:N[e.background],"--es-demo-launcher-shadow":e.shadow?"var(--ai-shadow)":"none","--es-demo-launcher-pad":`${e.padding}px`,"--es-demo-launcher-coin":`${oe}`,"--es-demo-launcher-mark-min":`${H}px`,"--es-demo-launcher-x":`${e.offsetX}px`,"--es-demo-launcher-y":`${e.offsetY}px`}}const Fe={slug:"demo",name:"Demo",version:"0.1.0",slots:["header","main","footer"],cssVariables:{"--ai-accent":x},structure:{header:{id:"header",label:"Header",accepts:!0},main:{id:"main",label:"Main Content",accepts:!0},footer:{id:"footer",label:"Footer",accepts:!0}},defaultViews:[],requiredServices:["support-chat"],description:"Neutral, brand-adaptive shell for demo clones. Carries no mascot and no brand of its own: the logo, name and accent colour all come from the product, and the rest of the palette is derived around them so it stays legible for any input.",author:"E-Commerce Studio",packageName:"@ecommerce-studio/theme-demo",options:[{id:"colorScheme",type:"select",label:"Appearance mode",default:"auto",group:"Appearance",options:[{label:"Auto (match visitor)",value:"auto"},{label:"Light",value:"light"},{label:"Dark",value:"dark"}]},{id:"brandColor",type:"color",label:"Brand colour",default:x,cssVariable:"--ai-accent",group:"Colors"},{id:"launcherShape",type:"select",label:"Button shape",default:d.shape,cssVariable:n.shape,group:"Launcher",options:[{label:"Pill (wordmark on a chip)",value:"pill"},{label:"Circle",value:"circle"},{label:"Square",value:"square"},{label:"Rectangle",value:"rectangle"}]},{id:"launcherWidth",type:"range",label:"Width (side for circle / square)",default:d.width,unit:"px",cssVariable:n.width,group:"Launcher",...i.width},{id:"launcherHeight",type:"range",label:"Height (pill / rectangle)",default:d.height,unit:"px",cssVariable:n.height,group:"Launcher",...i.height},{id:"launcherRadius",type:"range",label:"Corner radius (square / rectangle)",default:d.radius,unit:"px",cssVariable:n.radius,group:"Launcher",...i.radius},{id:"launcherBackground",type:"select",label:"Background",default:d.background,cssVariable:n.background,group:"Launcher",options:[{label:"Brand colour",value:"accent"},{label:"Neutral",value:"neutral"},{label:"None (transparent)",value:"none"}]},{id:"launcherShadow",type:"toggle",label:"Shadow",default:d.shadow,cssVariable:n.shadow,group:"Launcher"},{id:"launcherPadding",type:"range",label:"Logo padding",default:d.padding,unit:"px",cssVariable:n.padding,group:"Launcher",...i.padding},{id:"launcherOffsetX",type:"range",label:"Distance from side",default:d.offsetX,unit:"px",cssVariable:n.offsetX,group:"Launcher",...i.offsetX},{id:"launcherOffsetY",type:"range",label:"Distance from bottom",default:d.offsetY,unit:"px",cssVariable:n.offsetY,group:"Launcher",...i.offsetY}],supports:{customCss:!1,customJs:!1,darkMode:!0,rtl:!1,views:!0}};function ue(e){const a=[e?.["--ai-accent"],e?.["--es-color-primary"]];for(const r of a)if(typeof r=="string"&&B(r))return r;return x}function he(e){const a=(e??"").trim().split(/\s+/).filter(Boolean);return a.length===0?"":a.slice(0,2).map(r=>[...r][0]??"").join("").toLocaleUpperCase()}function xe({brandName:e="",logoUrl:a,position:r="bottom-right",sidebarPosition:o="right",initialOpen:t=!1,views:l=[],activeView:f="",onViewChange:w=()=>{},children:p=null,cssVariables:m,t:u,colorScheme:C,builderMode:c=!1,unreadCount:g=0,onSettingsClick:S,onOpenChange:b,panelReadAloudControl:q}){const A=J(C)==="light"?"light":"dark",[_,M]=j.useState(t||c),y=j.useMemo(()=>ce(m),[m]),P=j.useMemo(()=>({...L({brandColor:ue(m),mode:A}),...de(y),...c?{width:"100%",height:"100%"}:{}}),[m,y,A,c]),I=()=>M(h=>{const v=!h;return b?.(v),v}),z=()=>{M(!1),b?.(!1)},D=r==="bottom-left",V=o!=="hidden"&&l.length>1,k=he(e);return s.jsxs("div",{className:["es-demo",`es-demo--${A}`].join(" "),style:P,children:[!c&&s.jsxs("button",{type:"button",className:["es-demo__launcher",`es-demo__launcher--${y.shape}`,`es-demo__launcher--bg-${y.background}`,D&&"es-demo__launcher--left",_&&"es-demo__launcher--hidden"].filter(Boolean).join(" "),onClick:I,"aria-label":u?.("floating.open_widget")??"Open chat widget",tabIndex:_?-1:0,"aria-hidden":_,children:[a?s.jsx("img",{className:"es-demo__launcher-logo",src:a,alt:""}):s.jsx("span",{className:"es-demo__launcher-monogram","aria-hidden":"true",children:k||"•"}),g>0&&s.jsx("span",{className:"es-demo__launcher-dot","aria-label":u?.("floating.unread",{count:g})??`${g} unread`})]}),s.jsxs("div",{className:["es-demo__panel",D&&!c&&"es-demo__panel--left",(_||c)&&"es-demo__panel--open"].filter(Boolean).join(" "),role:"dialog","aria-label":u?.("chat.widget_aria")??"Chat widget","aria-hidden":c?!1:!_,children:[s.jsxs("header",{className:"es-demo__header",children:[s.jsxs("div",{className:"es-demo__brand",children:[a?s.jsx("img",{className:"es-demo__brand-logo",src:a,alt:""}):k&&s.jsx("span",{className:"es-demo__brand-monogram","aria-hidden":"true",children:k}),e&&s.jsx("h1",{className:"es-demo__brand-name",children:e})]}),s.jsxs("div",{className:"es-demo__header-actions",children:[q,!c&&s.jsx("button",{type:"button",className:"es-demo__header-btn",onClick:z,"aria-label":u?.("header.close_widget")??"Close widget",children:s.jsx(me,{})})]})]}),s.jsxs("div",{className:["es-demo__body",V&&`es-demo__body--rail-${o}`].filter(Boolean).join(" "),children:[V&&s.jsx("nav",{className:`es-demo__rail es-demo__rail--${o}`,"aria-label":u?.("nav.views")??"Views",children:l.map(h=>{const v=K(h.icon||h.slug),$=h.slug===f;return s.jsxs("button",{type:"button",className:["es-demo__rail-item",$&&"es-demo__rail-item--active"].filter(Boolean).join(" "),onClick:()=>w(h.slug),"aria-current":$?"page":void 0,title:h.label,children:[v?s.jsx(v,{size:20}):null,s.jsx("span",{className:"es-demo__rail-label",children:h.label})]},h.slug)})}),s.jsx("main",{className:"es-demo__content",style:{containerName:"es-slot",containerType:"inline-size"},children:p})]})]})]})}function me({size:e=20}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("path",{d:"m6 9 6 6 6-6"})})}export{x as DEFAULT_BRAND,d as LAUNCHER_DEFAULTS,i as LAUNCHER_LIMITS,n as LAUNCHER_VARS,Q as TEXT_FLOOR,xe as ThemeShell,be as darkVariables,L as deriveDemoPalette,ae as hoverStep,X as inkOn,de as launcherRootStyle,ge as lightVariables,Fe as manifest,he as monogram,ce as resolveLauncherSettings};
2
- //# sourceMappingURL=index-ByEsnceF-CSQQTbsg.js.map
2
+ //# sourceMappingURL=index-BIGVEl9--CSQQTbsg.js.map
@@ -3,4 +3,4 @@ import{r as s,j as e,a as De,b as te,Q as it}from"../nexly.js";import{x as Ke,s
3
3
  `)}}function It({config:o,actions:i,baseUrl:n,i18n:p,auth:w,externalContext:b,productId:y,sessionId:j,sessionMessages:g,readOnly:U}){const S=U===!0,r=p?.t??(t=>t),u=b?.apiKey??"",m=p?.currentLanguage??"en",G=De(o.placeholder,m,{t:r,fallbackKey:"chat.input_placeholder",enDefault:"Type a message..."}),H=De(o.welcomeMessage,m,{t:r,fallbackKey:"chat.empty_state",enDefault:["Hi! How can I help you?","Hello! How can I help you?"]}),f=typeof o._draft=="string"?o._draft:void 0,z=typeof o._draftContext=="string"?o._draftContext:void 0,I=o._autoSend===!0,$=Array.isArray(o._quickChips)?o._quickChips:[],E=JSON.stringify($),k=s.useRef(w?.jwt);s.useEffect(()=>{k.current=w?.jwt},[w?.jwt]);const F=b?.voice,d=!!F?.enabled&&(F?.languages??[]).includes(m),[c,h]=s.useState(()=>g?.map(t=>({id:t.id,role:t.role,text:t.content}))??[]),[T,K]=s.useState(""),[ce,se]=s.useState([]),[L,D]=s.useState(!1),[ge,q]=s.useState(null),[me,Z]=s.useState(!1),{containerRef:_,isPinned:V,scrollToBottom:C,stickToBottom:M}=ot(),v=s.useRef(null),J=s.useRef(null),R=s.useRef(j??ze()),Q=s.useRef(g&&g.length>0?j??null:null),ee=s.useRef(null),le=s.useRef(void 0),ae=s.useRef(!1);s.useEffect(()=>{i.emit("chat:session",{sessionId:R.current})},[i]),s.useEffect(()=>{M()},[c,L,M]);const be=s.useCallback(()=>{const t=v.current;if(!t)return;const a=t.closest(".es-block")?.clientHeight??0,l=a>0?Math.round(a*.4):120;t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,l)}px`,t.style.overflowY=t.scrollHeight>l?"auto":"hidden"},[]);s.useLayoutEffect(()=>{be()},[T,be]);const re=s.useCallback(()=>{ae.current&&(ae.current=!1,i.emit("chat:draftConsumed",void 0))},[i]),ne=s.useCallback(async t=>{const a=t.trim();if(!a||L)return;re();const l=le.current;le.current=void 0,se([]),Z(!1),J.current?.abort(),J.current=new AbortController;const A=yt.test(a),B=`user-${Date.now()}`,X={id:B,role:"user",text:a,...A?{linkStatus:"reading",linkFailedCount:0}:{}};h(x=>[...x,X]);const O=()=>{A&&h(x=>x.map(W=>W.id===B&&W.linkStatus==="reading"?{...W,linkStatus:"done"}:W))};C(),K(""),D(!0),q(null),v.current&&(v.current.style.height="auto");const N=c.map(x=>({role:x.role,content:x.text})),Te=await w?.ensureValidToken?.()??k.current,st={"Content-Type":"application/json",...u?{"X-API-Key":u}:{},...Te?{Authorization:`Bearer ${Te}`}:{}},ue=`assistant-${Date.now()}`;let ie="",Le=!1,xe=!1;const Ae=()=>{xe||(xe=!0,q(ue),h(x=>[...x,{id:ue,role:"assistant",text:ie}]))},Be=R.current,Pe=_t.test(Be)?Be:void 0,He=xt(),[je,ke]=await te(fetch(`${n}/api/widget/chat-bot/stream`,{method:"POST",headers:st,body:JSON.stringify({text:a,history:N,...Pe?{sessionId:Pe}:{},...y?{productId:y}:{},...He?{timeZone:He}:{},...l?{blockContext:l}:{}}),signal:J.current.signal}));if(ke){if(ke instanceof Error&&ke.name==="AbortError"){O();return}D(!1),q(null),O(),h(x=>[...x,{id:`error-${Date.now()}`,role:"assistant",text:r("chat.error_message")}]);return}if(!je.ok||!je.body){D(!1),q(null),O(),h(x=>[...x,{id:`error-${Date.now()}`,role:"assistant",text:r("chat.error_message")}]);return}const at=je.body.getReader(),rt=new TextDecoder;let de="",_e;const Me=()=>{_e&&clearTimeout(_e),_e=void 0},Re=()=>{Me(),_e=setTimeout(()=>{J.current?.abort(),D(!1),q(null),O()},bt)},[,ve]=await te((async()=>{for(Re();;){const{done:x,value:W}=await at.read();if(Re(),x)break;de+=rt.decode(W,{stream:!0});let we;for(;(we=de.indexOf(`
4
4
 
5
5
  `))!==-1;){const nt=de.slice(0,we);de=de.slice(we+2);const{event:he,data:pe}=jt(nt);if(!(!he||!pe)){if(he==="start"){const P=JSON.parse(pe);P.sessionId&&P.sessionId!==R.current&&(R.current=P.sessionId,Q.current=P.sessionId,i.emit("chat:session",{sessionId:P.sessionId}))}else if(he==="token"){const P=JSON.parse(pe);ie+=P.value??"",Ae();const Se=ie;h(Ce=>Ce.map(Y=>Y.id===ue?{...Y,text:Se}:Y))}else if(he==="meta"){const P=JSON.parse(pe);Le=!0;const Se=P.assistantMessage?.content??ie,Ce=Array.isArray(P.pastedLinks)?P.pastedLinks.filter(Y=>Y.status&&Y.status!=="ok").length:0;Ae(),h(Y=>Y.map(oe=>oe.id===ue?{...oe,text:Se,promptLogId:P.logId}:oe.id===B&&oe.linkStatus==="reading"?{...oe,linkStatus:"done",linkFailedCount:Ce}:oe))}else if(he==="error"){const P=JSON.parse(pe);throw new Error(P.message??"Stream error")}}}}if(!Le&&!ie)throw new Error("Stream ended before completion")})());if(Me(),D(!1),q(null),O(),ve){if(ve instanceof Error&&ve.name==="AbortError"||ie)return;h(xe?x=>x.map(W=>W.id===ue?{...W,text:r("chat.error_message"),promptLogId:void 0}:W):x=>[...x,{id:`error-${Date.now()}`,role:"assistant",text:r("chat.error_message")}])}},[L,i,c,r,u,n,y,C,w,re]),ye=s.useCallback(()=>{const t=b?.voiceStream;t?.getState&&t.getState()!=="idle"&&t.stop(),ne(T)},[ne,T,b]);s.useEffect(()=>{const t=b?.voiceStream;t?.getState&&t.getState()!=="idle"&&t.stop()},[j]);const qe=s.useCallback(t=>{if(t.autoSend){ne(t.message);return}se([]),K(""),re(),v.current&&(v.current.style.height="auto",v.current.focus())},[ne,re]);s.useEffect(()=>{if(!(f!==void 0||$.length>0))return;const t=`${f}${z??""}${String(I)}${E}`;if(ee.current!==t){if(ee.current=t,ae.current=!0,le.current=z,I&&f!==void 0){se([]),ne(f);return}se($),f!==void 0&&(K(f),v.current&&v.current.focus())}},[f,z,I,E,ne]);const Je=s.useCallback(t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),ye())},[ye]),Xe=s.useCallback(t=>{re(),K(t.target.value)},[re]),Qe=s.useCallback(t=>{const a=t.trim();a&&(K(l=>l?`${l} ${a}`:a),requestAnimationFrame(()=>{v.current?.focus()}))},[]);s.useEffect(()=>()=>J.current?.abort(),[]),s.useEffect(()=>i.on("chat:clearHistory",t=>{const a=t;h([]),Z(!1);const l=a?.sessionId??ze();R.current=l,Q.current=l,i.emit("chat:session",{sessionId:l})}),[i]);const Ye=s.useCallback(async()=>{const t=k.current,[a,l]=await te(fetch(`${n}/api/chat/sessions/new`,{method:"POST",headers:{...u?{"X-API-Key":u}:{},...t?{Authorization:`Bearer ${t}`}:{}}}));if(!l&&a.ok){const[A,B]=await te(a.json());if(!B&&A.success&&A.data?.sessionId){i.emit("chat:clearHistory",{sessionId:A.data.sessionId});return}}i.emit("chat:clearHistory",void 0)},[i,u,n]),Ge=s.useCallback(()=>{i.emit("chat:showHistory",void 0)},[i]),fe=s.useCallback(async t=>{R.current=t,i.emit("chat:session",{sessionId:t}),h([]),Z(!1),D(!0);const a=k.current,[l,A]=await te(fetch(`${n}/api/chat/sessions/${encodeURIComponent(t)}/messages?limit=50`,{headers:{...u?{"X-API-Key":u}:{},...a?{Authorization:`Bearer ${a}`}:{}}}));if(D(!1),A||!l.ok){Z(!0);return}const[B,X]=await te(l.json());if(X){Z(!0);return}const O=B.data?.messages??[];h(O.map(N=>({id:N.id,role:N.role,text:N.content,promptLogId:N.promptLogId??void 0,rating:N.userScore??null}))),Q.current=t,C("auto")},[i,u,n,C]);s.useEffect(()=>i.on("chat:select-session",t=>{const{sessionId:a}=t;!a||a===Q.current||fe(a)}),[i,fe]);const Ze=s.useCallback(()=>{fe(R.current)},[fe]),Ie=s.useRef(c);s.useEffect(()=>{Ie.current=c},[c]);const Ve=s.useCallback(({messageId:t,rating:a},{keepalive:l})=>{const A=Ie.current.find(B=>B.id===t);!A||!A.promptLogId||!k.current||(h(B=>B.map(X=>X.id===t?{...X,rating:a,ratingPending:!0}:X)),(async()=>{const[B,X]=await te(fetch(`${n}/api/widget/ai-feedback`,{method:"POST",keepalive:l,headers:{"Content-Type":"application/json",...u?{"X-API-Key":u}:{},Authorization:`Bearer ${k.current}`},body:JSON.stringify({promptLogId:A.promptLogId,rating:a})}));if(X||!(B.ok||B.status===409)){h(O=>O.map(N=>N.id===t?{...N,rating:null,ratingPending:!1}:N));return}h(O=>O.map(N=>N.id===t?{...N,rating:a,ratingPending:!1}:N))})())},[u,n]),{pending:$e,rate:Ee,undo:et}=ct({submit:Ve}),tt=s.useCallback((t,a)=>{const l=c.find(A=>A.id===t);!l||!l.promptLogId||l.ratingPending||!k.current||Ee(t,a)},[c,Ee]);return e.jsxs(it,{blockType:"chat",children:[e.jsxs("div",{className:"es-chat__header",children:[e.jsx("span",{className:"es-chat__header-title",children:r("chat.chat")}),e.jsxs("div",{className:"es-chat__header-actions",children:[e.jsx("button",{type:"button",className:"es-chat__action-btn","aria-label":r("chat.new_session_button"),title:r("chat.new_session_button"),onClick:Ye,children:e.jsx(gt,{size:18})}),e.jsx("button",{type:"button",className:"es-chat__action-btn","aria-label":r("chat.history_button"),title:r("chat.history_button"),onClick:Ge,children:e.jsx(pt,{size:16})})]})]}),e.jsxs("div",{className:"es-block__body es-chat__body",children:[e.jsxs("div",{className:"es-chat__messages",ref:_,children:[c.length===0&&!me&&!L&&e.jsx("div",{className:"es-chat__welcome",children:H}),me&&e.jsxs("div",{className:"es-chat__load-error",role:"alert",children:[e.jsx("span",{className:"es-chat__load-error-text",children:r("chat.load_session_error")}),e.jsx("button",{type:"button",className:"es-chat__load-error-retry",onClick:Ze,children:r("chat.retry")})]}),c.map(t=>e.jsxs("div",{className:`es-chat__bubble es-chat__bubble--${t.role}${t.id===ge?" es-chat__bubble--streaming":""}`,children:[t.role==="assistant"?e.jsx("div",{className:"es-chat__bubble-text es-chat__bubble-text--md",children:e.jsx(Ke,{remarkPlugins:[...Ue],allowedElements:[...Oe],transformLinkUri:a=>We(a)??"",transformImageUri:()=>"",components:Fe,children:t.text})}):e.jsx("div",{className:"es-chat__bubble-text",children:t.text}),t.role==="user"&&t.linkStatus==="reading"&&e.jsxs("div",{className:"es-chat__link-status",role:"status",children:[e.jsx("span",{className:"es-chat__link-status-spinner","aria-hidden":"true"}),e.jsx("span",{className:"es-chat__link-status-text",children:r("chat.reading_link")})]}),t.role==="user"&&t.linkStatus==="done"&&(t.linkFailedCount??0)>0&&e.jsxs("div",{className:"es-chat__link-status es-chat__link-status--failed",children:[e.jsx(mt,{size:13}),e.jsx("span",{className:"es-chat__link-status-text",children:r("chat.link_unreadable")})]}),t.role==="assistant"&&t.promptLogId&&k.current&&(()=>{const a=$e?.messageId===t.id?$e.rating:null;return e.jsxs("div",{className:"es-chat__feedback",children:[e.jsx("span",{className:"es-chat__feedback-label",children:t.rating&&a===null?r("chat.feedback_thanks"):r("support_chat.rate_aria")}),e.jsx(ft,{value:a??t.rating??null,onChange:l=>tt(t.id,l),disabled:a===null&&(!!t.rating||t.ratingPending),t:r}),a!==null&&e.jsxs("div",{className:"es-chat__rating-undo",role:"status",children:[e.jsx("span",{className:"es-chat__rating-undo-text",children:r("support_chat.rating_undo_toast",{rating:a})}),e.jsx("button",{type:"button",className:"es-chat__rating-undo-btn",onClick:et,children:r("support_chat.rating_undo_button")})]})]})})()]},t.id)),L&&ge===null&&e.jsxs("div",{className:"es-chat__typing","aria-label":r("chat.typing_aria"),children:[e.jsx("span",{className:"es-chat__typing-dot"}),e.jsx("span",{className:"es-chat__typing-dot"}),e.jsx("span",{className:"es-chat__typing-dot"})]})]}),!V&&c.length>0&&e.jsxs("button",{type:"button",className:"es-chat__jump",onClick:()=>C(),"aria-label":r("chat.jump_to_latest"),title:r("chat.jump_to_latest"),children:[e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M12 5v14"}),e.jsx("path",{d:"m19 12-7 7-7-7"})]}),e.jsx("span",{className:"es-chat__jump-label",children:r("chat.jump_to_latest")})]})]}),e.jsxs("div",{className:"es-block__footer es-chat__footer",children:[ce.length>0&&e.jsx("div",{className:"es-chat__chips",role:"group","aria-label":r("chat.quick_actions_aria"),children:ce.map((t,a)=>e.jsx("button",{type:"button",className:"es-chat__chip",onClick:()=>qe(t),disabled:L||S,children:t.labelKey?r(t.labelKey):t.label},`${t.labelKey??t.label}-${a}`))}),e.jsx("div",{className:"es-chat__disclaimer",children:r("chat.disclaimer")}),e.jsxs("div",{className:"es-chat__input-row",children:[e.jsx("textarea",{ref:v,className:"es-chat__textarea",value:T,onChange:Xe,onKeyDown:Je,placeholder:G,rows:1,maxLength:2e3,disabled:L||S,"aria-label":r("chat.input_aria")}),d&&!S&&e.jsx(ht,{baseUrl:n,apiKey:u,jwt:k.current,language:m,onTranscript:Qe,t:r,streaming:F?.streaming,voiceStream:b?.voiceStream,baseText:()=>T,onText:t=>{if(K(t.length>2e3?t.slice(0,2e3):t),t.length>=2e3){const a=b?.voiceStream;a?.getState&&a.getState()!=="idle"&&a.stop()}requestAnimationFrame(()=>{be(),v.current?.focus()})}}),e.jsx("button",{className:"es-chat__send",onClick:ye,disabled:!T.trim()||L||S,type:"button","aria-label":r("chat.send_aria"),children:L?e.jsx("span",{className:"es-chat__send-loading","aria-hidden":"true",children:"⋯"}):e.jsx("span",{"aria-hidden":"true",children:"➤"})})]})]})]})}const Ne=50;function $t({sessionId:o,baseUrl:i,jwt:n,isOpen:p,onToggle:w,i18n:b}){const y=b?.t??(d=>d),j=p!==void 0,[g,U]=s.useState(!1),S=j?p:g,[r,u]=s.useState([]),[m,G]=s.useState(null),[H,f]=s.useState(!1),[z,I]=s.useState(null),$=s.useRef(!1),E=s.useCallback(async d=>{if(n){f(!0),I(null);try{const c=`${i}/api/chat/sessions/${o}/messages?limit=${Ne}&offset=${d}`,h=await fetch(c,{headers:{Authorization:`Bearer ${n}`},credentials:"include"});if(!h.ok)throw new Error(`HTTP ${h.status}`);const T=await h.json();if(!T.success)throw new Error(y("chat_history.error"));u(K=>d===0?T.data.messages:[...T.data.messages,...K]),G(T.data.pagination)}catch(c){I(c instanceof Error?c.message:y("chat_history.error"))}finally{f(!1)}}},[i,n,o,y]),k=s.useCallback(()=>{j?w?.():U(d=>{const c=!d;return c&&!$.current&&($.current=!0,E(0)),c})},[j,w,E]),F=s.useCallback(()=>{if(!m)return;const d=Math.max(0,m.total-m.offset-Ne-Ne);E(d)},[E,m]);return s.useEffect(()=>{j&&S&&!$.current&&n&&($.current=!0,E(0))},[j,S,n,E]),s.useEffect(()=>{$.current=!1,u([]),G(null),I(null),S&&n&&($.current=!0,E(0))},[o,n]),e.jsxs("div",{className:"es-chat-history",children:[!j&&e.jsxs("button",{className:"es-chat-history__toggle",type:"button","aria-expanded":S,onClick:k,disabled:!n,children:[e.jsx("span",{className:"es-chat-history__toggle-icon",children:S?"▲":"▼"}),y("chat_history.toggle")]}),S&&e.jsxs("div",{className:"es-chat-history__panel",children:[H&&e.jsxs("div",{className:"es-chat-history__loading",role:"status","aria-label":y("chat_history.loading_aria"),children:[e.jsx("span",{className:"es-chat-history__dot"}),e.jsx("span",{className:"es-chat-history__dot"}),e.jsx("span",{className:"es-chat-history__dot"})]}),z&&!H&&e.jsx("div",{className:"es-chat-history__error",role:"alert",children:z}),!H&&!z&&e.jsxs(e.Fragment,{children:[m?.hasMore&&e.jsx("button",{className:"es-chat-history__load-more",type:"button",onClick:F,"aria-label":y("chat_history.load_older_aria"),children:y("chat_history.load_older")}),e.jsxs("div",{className:"es-chat-history__messages",role:"log","aria-live":"polite","aria-label":y("chat_history.panel_aria"),children:[r.length===0&&e.jsx("div",{className:"es-chat-history__empty",children:y("chat_history.empty")}),r.filter(d=>d.role!=="system").map(d=>e.jsx("div",{className:`es-chat-history__bubble es-chat-history__bubble--${d.role}`,children:d.role==="assistant"?e.jsx("div",{className:"es-chat-history__bubble-md",children:e.jsx(Ke,{remarkPlugins:[...Ue],allowedElements:[...Oe],transformLinkUri:c=>We(c)??"",transformImageUri:()=>"",components:Fe,children:d.content})}):d.content},d.id))]})]})]})]})}export{$t as ChatHistoryBlock,It as Component,Nt as manifest};
6
- //# sourceMappingURL=index-zmuItIIf-oy07dUaV.js.map
6
+ //# sourceMappingURL=index-BKZyJMr2-oy07dUaV.js.map
@@ -1,2 +1,2 @@
1
- import{r as h,j as e,Q as g,o as M}from"../nexly.js";import{C as L}from"./block-rating-BgOeTm52-CoiP5C2K.js";const A={slug:"social-insights",name:"Social Insights",version:"1.0.0",category:"data",requiredService:"social-insights",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},proMode:{type:"boolean",default:!1},maxEvents:{type:"number",default:2},showCrmPlan:{type:"boolean",default:!0},showConversationTips:{type:"boolean",default:!1}}},defaultConfig:{readAloudEnabled:!1,proMode:!1,maxEvents:2,showCrmPlan:!0,showConversationTips:!1},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!0},dataContract:{serviceSlug:"social-insights",inputSchema:{type:"object",properties:{eventIntelligence:{type:"object",properties:{scoredEvents:{type:"array",items:{type:"object",properties:{eventName:{type:"string"},conversionScore:{type:"number"}}}},recommendedEvent:{type:"object",properties:{eventName:{type:"string"},missionGoal:{type:"string"}}}}},eventMissionBrief:{type:"object",properties:{conversationOpeners:{type:"array",items:{type:"string"}},qualificationQuestions:{type:"array",items:{type:"string"}},positioningStatement:{type:"string"}}},crmExecutionPlan:{type:"object",properties:{leadPipelineStructure:{type:"string"},recommendedDailyOutreachVolume:{type:"number"},messageTemplates:{type:"object",properties:{firstContact:{type:"string"},followup48h:{type:"string"}}}}},weeklySocialStrategy:{type:"object",properties:{mainObjectiveThisWeek:{type:"string"},numericTarget:{type:"string"}}}}},previewDataOverride:{eventIntelligence:{scoredEvents:[{eventName:"Seoul Tech & Crypto Meetup",category:"Networking",conversionScore:92,whyRelevant:"High density of crypto-curious professionals matching your target profile.",targetProfile:"Tech professionals aged 28–42",priorityLevel:"high"},{eventName:"Gangnam Business Luncheon",category:"Business Networking",conversionScore:74,whyRelevant:"Established entrepreneurs with disposable income open to investment opportunities.",targetProfile:"SME owners and executives",priorityLevel:"medium"},{eventName:"Online MLM Success Webinar",category:"Industry",conversionScore:61,whyRelevant:"Pre-qualified audience already interested in network marketing.",targetProfile:"MLM beginners and career changers",priorityLevel:"medium"}],recommendedEvent:{eventName:"Seoul Tech & Crypto Meetup",missionGoal:"Connect with 5 warm prospects and set 2 follow-up calls",contactsTarget:5,followupTarget:2}},eventMissionBrief:{conversationOpeners:["What brings you to the crypto/tech space?","Have you been following the recent Bitcoin surge?"],qualificationQuestions:["Are you currently looking for passive income opportunities?","What's your experience with network marketing?"],positioningStatement:"I help people build financial freedom through crypto-backed network marketing.",whatNotToSay:["Don't mention specific income figures in the first meeting."]},crmExecutionPlan:{leadPipelineStructure:"Prospect → First Contact → Follow-up (48h) → Meeting → Close",recommendedDailyOutreachVolume:8,followupIntervalsHours:48,messageTemplates:{firstContact:"Hi [Name], great meeting you at the Seoul meetup! I'd love to share something exciting with you — when's a good time for a 15-min call?",followup48h:"Hi [Name], just following up on my message. I have some insights about [topic we discussed] that I think you'll find valuable.",postEventMessage:"Thanks for connecting at [event]! Let me know if you're open to exploring what I mentioned."}},weeklySocialStrategy:{mainObjectiveThisWeek:"Qualify 10 new prospects from event pipeline",numericTarget:"10 new prospects, 3 follow-up calls",structureAlignmentGoal:"Focus on right leg to balance binary structure",riskMitigationFocus:"Avoid cap waste by ensuring team volume is distributed evenly"}}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"proMode",type:"toggle",label:"Pro mode (full strategy details)",default:!1,group:"Display"},{id:"maxEvents",type:"range",label:"Max events shown",default:2,min:1,max:5,step:1,group:"Display"},{id:"showCrmPlan",type:"toggle",label:"Show CRM outreach plan",default:!0,group:"Display"},{id:"showConversationTips",type:"toggle",label:"Show conversation tips (pro)",default:!1,group:"Display"}],events:{emits:[{name:"social:eventSelected",description:"User selected an event to attend"},{name:"social:templateCopied",description:"User copied a message template"},{name:"chat:draft",description:"Seed the chat composer with a draft message + quick-reply chips"}],listens:[{name:"social:refresh",description:"Force refresh social insights"}]},supportedPlacements:["main","sidebar"]},j={high:0,medium:1,low:2};function v({text:s,prefix:a,onCopy:l,t:o}){const[t,d]=h.useState(!1),p=h.useRef(null),u=h.useCallback(()=>{l(s),d(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>d(!1),1200)},[l,s]);return h.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]),e.jsxs("div",{className:`es-si__copyable${t?" es-si__copyable--copied":""}`,onClick:u,role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),u())},"aria-label":o(t?"social_insights.copied":"social_insights.tap_to_copy"),title:o("social_insights.tap_to_copy"),children:[a&&e.jsx("span",{className:"es-si__copyable-prefix",children:a}),e.jsx("span",{className:"es-si__copyable-text",children:s})]})}function P({total:s,high:a,medium:l,t:o}){return e.jsxs("div",{className:"es-si__stats",children:[e.jsxs("div",{className:"es-si__stat",children:[e.jsx("div",{className:"es-si__stat-n",children:s}),e.jsx("div",{className:"es-si__stat-l",children:o("social_insights.stat_events")})]}),e.jsxs("div",{className:"es-si__stat",children:[e.jsx("div",{className:"es-si__stat-n es-si__stat-n--high",children:a}),e.jsx("div",{className:"es-si__stat-l",children:o("social_insights.stat_high")})]}),e.jsxs("div",{className:"es-si__stat",children:[e.jsx("div",{className:"es-si__stat-n es-si__stat-n--medium",children:l}),e.jsx("div",{className:"es-si__stat-l",children:o("social_insights.stat_medium")})]})]})}function I({card:s,selected:a,onSelect:l,t:o}){return e.jsxs("div",{className:`es-si__row${a?" es-si__row--active":""}`,onClick:l,role:"button",tabIndex:0,"aria-pressed":a,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),l())},children:[e.jsx("span",{className:`es-si__dot es-si__dot--${s.priorityLevel}`,role:"img","aria-label":o(`social_insights.priority_${s.priorityLevel}`)}),e.jsxs("div",{className:"es-si__row-body",children:[e.jsx("div",{className:"es-si__row-name",children:s.eventName}),e.jsx("div",{className:"es-si__row-why",children:s.whyThisEventMatters})]}),e.jsx("span",{className:"es-si__row-go","aria-hidden":"true",children:o("social_insights.focus_cta")})]})}function D({card:s,onCopy:a,onTalkToGaio:l,hasChatView:o,t}){const d=s.conversationOpeners?.[0];return e.jsxs("div",{className:"es-si__focus",children:[e.jsxs("div",{className:"es-si__focus-tag",children:[e.jsx("span",{"aria-hidden":"true",children:"★"})," ",t("social_insights.focus_play")," ·"," ",e.jsx("span",{className:"es-si__focus-cat",children:s.category})]}),e.jsx("div",{className:"es-si__focus-name",children:s.eventName}),e.jsx("div",{className:"es-si__focus-profile",children:s.targetProfile}),e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"👁"})," ",t("social_insights.spot_them")]}),e.jsx("div",{className:"es-si__detail-text es-si__detail-text--muted",children:s.howToSpotThem}),d&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"💬"})," ",t("social_insights.best_opener")]}),e.jsx(v,{text:d,onCopy:a,t})]}),e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"🌉"})," ",t("social_insights.bridge")]}),e.jsx(v,{text:s.bridgeLine,onCopy:a,t}),e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"📩"})," ",t("social_insights.followup_48h")]}),e.jsx(v,{text:s.followUp48h,onCopy:a,t}),e.jsxs("div",{className:"es-si__focus-warn",children:[e.jsx("div",{className:"es-si__detail-label es-si__detail-label--warn",children:t("social_insights.do_not_say")}),e.jsx("div",{className:"es-si__detail-text",children:s.doNotSay})]}),o&&e.jsx("div",{className:"es-si__gaio-row",children:e.jsxs("button",{type:"button",className:"es-si__gaio-link","aria-label":t("social_insights.gaio.aria",{event:s.eventName}),onClick:()=>l(s),children:[e.jsx("span",{"aria-hidden":"true",children:"💬"})," ",t("social_insights.talk_to_gaio")]})})]})}function F({data:s,actions:a,metadata:l,i18n:o,baseUrl:t,externalContext:d,auth:p,previewMode:u}){const i=o?.t??(n=>n),_=s,b=s.promptLogId,w=d?.apiKey??"",N=d?.hasChatView===!0,[y,k]=h.useState(0),C=h.useCallback(n=>{navigator.clipboard?.writeText(n).catch(()=>{}),a.emit("social:templateCopied",{text:n})},[a]),S=h.useCallback(n=>{const c=n.eventName;a.emit("chat:draft",{message:i("social_insights.gaio_draft",{event:c,why:n.whyThisEventMatters}),autoSend:!1,quickChips:[{label:i("social_insights.gaio.chip.plan"),message:i("social_insights.gaio.chip.plan_msg",{event:c}),autoSend:!0},{label:i("social_insights.gaio.chip.opener"),message:i("social_insights.gaio.chip.opener_msg",{event:c}),autoSend:!0},{label:i("social_insights.gaio.chip.target"),message:i("social_insights.gaio.chip.target_msg",{event:c}),autoSend:!0},{label:i("social_insights.gaio.chip.other"),message:"",autoSend:!1}]})},[a,i]);if(!_.events&&!s.error)return e.jsx(g,{blockType:"social-insights",children:e.jsx("div",{className:"es-block__body",children:e.jsx("div",{className:"es-si__loading",children:l?.dataQuality==="none"?i("social_insights.sign_in_prompt"):i("social_insights.gathering_events")})})});if(s.error)return e.jsx(g,{blockType:"social-insights",error:M(s.error)});const r=[..._.events??[]].sort((n,c)=>j[n.priorityLevel]-j[c.priorityLevel]),m=_.quietWeek,T=r.filter(n=>n.priorityLevel==="high").length,E=r.filter(n=>n.priorityLevel==="medium").length,x=y<r.length?y:0,f=r[x];return e.jsx(g,{blockType:"social-insights",children:e.jsxs("div",{className:"es-block__body",children:[e.jsx(L,{promptLogId:b,baseUrl:t,apiKey:w,jwt:p?.jwt,previewMode:u,t:i}),r.length>0&&e.jsx(P,{total:r.length,high:T,medium:E,t:i}),r.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"es-si__section-head",children:[e.jsx("span",{className:"es-si__section-title",children:i("social_insights.ranked_events")}),e.jsx("span",{className:"es-si__section-hint",children:i("social_insights.tap_to_focus")})]}),e.jsx("div",{className:"es-si__list",role:"list","aria-label":i("social_insights.ranked_events"),children:r.map((n,c)=>e.jsx(I,{card:n,selected:c===x,onSelect:()=>k(c),t:i},`${n.eventName}-${c}`))}),f&&e.jsx(D,{card:f,onCopy:C,onTalkToGaio:S,hasChatView:N,t:i})]}),r.length===0&&m&&e.jsxs("div",{className:"es-si__quiet-week",children:[e.jsx("div",{className:"es-si__quiet-week-headline",children:m.headline}),e.jsxs("div",{className:"es-si__detail-section",children:[e.jsx("div",{className:"es-si__detail-label",children:i("social_insights.downline_focus")}),e.jsx("div",{className:"es-si__detail-text",children:m.downlineActivationTarget})]}),e.jsxs("div",{className:"es-si__detail-section",children:[e.jsx("div",{className:"es-si__detail-label",children:i("social_insights.warm_network_action")}),e.jsx("div",{className:"es-si__detail-text",children:m.warmNetworkAction})]}),e.jsxs("div",{className:"es-si__detail-section",children:[e.jsx("div",{className:"es-si__detail-label",children:i("social_insights.online_conversation")}),e.jsx("div",{className:"es-si__detail-text",children:m.onlineConversationPrompt})]})]}),_.complianceNote&&(r.length>0||m)&&e.jsxs("div",{className:"es-si__compliance",role:"note",children:[e.jsx("span",{className:"es-si__compliance-icon","aria-hidden":"true",children:"⚠"}),e.jsxs("span",{className:"es-si__compliance-text",children:[e.jsxs("span",{className:"es-si__compliance-label",children:[i("social_insights.compliance_label"),":"]})," ",_.complianceNote]})]})]})})}export{F as Component,A as manifest};
2
- //# sourceMappingURL=index-D6YQ4lFv-pbKZ0WGs.js.map
1
+ import{r as h,j as e,Q as g,o as M}from"../nexly.js";import{C as L}from"./block-rating-D7hR2gTc-CoiP5C2K.js";const A={slug:"social-insights",name:"Social Insights",version:"1.0.0",category:"data",requiredService:"social-insights",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},proMode:{type:"boolean",default:!1},maxEvents:{type:"number",default:2},showCrmPlan:{type:"boolean",default:!0},showConversationTips:{type:"boolean",default:!1}}},defaultConfig:{readAloudEnabled:!1,proMode:!1,maxEvents:2,showCrmPlan:!0,showConversationTips:!1},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!0},dataContract:{serviceSlug:"social-insights",inputSchema:{type:"object",properties:{eventIntelligence:{type:"object",properties:{scoredEvents:{type:"array",items:{type:"object",properties:{eventName:{type:"string"},conversionScore:{type:"number"}}}},recommendedEvent:{type:"object",properties:{eventName:{type:"string"},missionGoal:{type:"string"}}}}},eventMissionBrief:{type:"object",properties:{conversationOpeners:{type:"array",items:{type:"string"}},qualificationQuestions:{type:"array",items:{type:"string"}},positioningStatement:{type:"string"}}},crmExecutionPlan:{type:"object",properties:{leadPipelineStructure:{type:"string"},recommendedDailyOutreachVolume:{type:"number"},messageTemplates:{type:"object",properties:{firstContact:{type:"string"},followup48h:{type:"string"}}}}},weeklySocialStrategy:{type:"object",properties:{mainObjectiveThisWeek:{type:"string"},numericTarget:{type:"string"}}}}},previewDataOverride:{eventIntelligence:{scoredEvents:[{eventName:"Seoul Tech & Crypto Meetup",category:"Networking",conversionScore:92,whyRelevant:"High density of crypto-curious professionals matching your target profile.",targetProfile:"Tech professionals aged 28–42",priorityLevel:"high"},{eventName:"Gangnam Business Luncheon",category:"Business Networking",conversionScore:74,whyRelevant:"Established entrepreneurs with disposable income open to investment opportunities.",targetProfile:"SME owners and executives",priorityLevel:"medium"},{eventName:"Online MLM Success Webinar",category:"Industry",conversionScore:61,whyRelevant:"Pre-qualified audience already interested in network marketing.",targetProfile:"MLM beginners and career changers",priorityLevel:"medium"}],recommendedEvent:{eventName:"Seoul Tech & Crypto Meetup",missionGoal:"Connect with 5 warm prospects and set 2 follow-up calls",contactsTarget:5,followupTarget:2}},eventMissionBrief:{conversationOpeners:["What brings you to the crypto/tech space?","Have you been following the recent Bitcoin surge?"],qualificationQuestions:["Are you currently looking for passive income opportunities?","What's your experience with network marketing?"],positioningStatement:"I help people build financial freedom through crypto-backed network marketing.",whatNotToSay:["Don't mention specific income figures in the first meeting."]},crmExecutionPlan:{leadPipelineStructure:"Prospect → First Contact → Follow-up (48h) → Meeting → Close",recommendedDailyOutreachVolume:8,followupIntervalsHours:48,messageTemplates:{firstContact:"Hi [Name], great meeting you at the Seoul meetup! I'd love to share something exciting with you — when's a good time for a 15-min call?",followup48h:"Hi [Name], just following up on my message. I have some insights about [topic we discussed] that I think you'll find valuable.",postEventMessage:"Thanks for connecting at [event]! Let me know if you're open to exploring what I mentioned."}},weeklySocialStrategy:{mainObjectiveThisWeek:"Qualify 10 new prospects from event pipeline",numericTarget:"10 new prospects, 3 follow-up calls",structureAlignmentGoal:"Focus on right leg to balance binary structure",riskMitigationFocus:"Avoid cap waste by ensuring team volume is distributed evenly"}}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"proMode",type:"toggle",label:"Pro mode (full strategy details)",default:!1,group:"Display"},{id:"maxEvents",type:"range",label:"Max events shown",default:2,min:1,max:5,step:1,group:"Display"},{id:"showCrmPlan",type:"toggle",label:"Show CRM outreach plan",default:!0,group:"Display"},{id:"showConversationTips",type:"toggle",label:"Show conversation tips (pro)",default:!1,group:"Display"}],events:{emits:[{name:"social:eventSelected",description:"User selected an event to attend"},{name:"social:templateCopied",description:"User copied a message template"},{name:"chat:draft",description:"Seed the chat composer with a draft message + quick-reply chips"}],listens:[{name:"social:refresh",description:"Force refresh social insights"}]},supportedPlacements:["main","sidebar"]},j={high:0,medium:1,low:2};function v({text:s,prefix:a,onCopy:l,t:o}){const[t,d]=h.useState(!1),p=h.useRef(null),u=h.useCallback(()=>{l(s),d(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>d(!1),1200)},[l,s]);return h.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]),e.jsxs("div",{className:`es-si__copyable${t?" es-si__copyable--copied":""}`,onClick:u,role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),u())},"aria-label":o(t?"social_insights.copied":"social_insights.tap_to_copy"),title:o("social_insights.tap_to_copy"),children:[a&&e.jsx("span",{className:"es-si__copyable-prefix",children:a}),e.jsx("span",{className:"es-si__copyable-text",children:s})]})}function P({total:s,high:a,medium:l,t:o}){return e.jsxs("div",{className:"es-si__stats",children:[e.jsxs("div",{className:"es-si__stat",children:[e.jsx("div",{className:"es-si__stat-n",children:s}),e.jsx("div",{className:"es-si__stat-l",children:o("social_insights.stat_events")})]}),e.jsxs("div",{className:"es-si__stat",children:[e.jsx("div",{className:"es-si__stat-n es-si__stat-n--high",children:a}),e.jsx("div",{className:"es-si__stat-l",children:o("social_insights.stat_high")})]}),e.jsxs("div",{className:"es-si__stat",children:[e.jsx("div",{className:"es-si__stat-n es-si__stat-n--medium",children:l}),e.jsx("div",{className:"es-si__stat-l",children:o("social_insights.stat_medium")})]})]})}function I({card:s,selected:a,onSelect:l,t:o}){return e.jsxs("div",{className:`es-si__row${a?" es-si__row--active":""}`,onClick:l,role:"button",tabIndex:0,"aria-pressed":a,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),l())},children:[e.jsx("span",{className:`es-si__dot es-si__dot--${s.priorityLevel}`,role:"img","aria-label":o(`social_insights.priority_${s.priorityLevel}`)}),e.jsxs("div",{className:"es-si__row-body",children:[e.jsx("div",{className:"es-si__row-name",children:s.eventName}),e.jsx("div",{className:"es-si__row-why",children:s.whyThisEventMatters})]}),e.jsx("span",{className:"es-si__row-go","aria-hidden":"true",children:o("social_insights.focus_cta")})]})}function D({card:s,onCopy:a,onTalkToGaio:l,hasChatView:o,t}){const d=s.conversationOpeners?.[0];return e.jsxs("div",{className:"es-si__focus",children:[e.jsxs("div",{className:"es-si__focus-tag",children:[e.jsx("span",{"aria-hidden":"true",children:"★"})," ",t("social_insights.focus_play")," ·"," ",e.jsx("span",{className:"es-si__focus-cat",children:s.category})]}),e.jsx("div",{className:"es-si__focus-name",children:s.eventName}),e.jsx("div",{className:"es-si__focus-profile",children:s.targetProfile}),e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"👁"})," ",t("social_insights.spot_them")]}),e.jsx("div",{className:"es-si__detail-text es-si__detail-text--muted",children:s.howToSpotThem}),d&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"💬"})," ",t("social_insights.best_opener")]}),e.jsx(v,{text:d,onCopy:a,t})]}),e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"🌉"})," ",t("social_insights.bridge")]}),e.jsx(v,{text:s.bridgeLine,onCopy:a,t}),e.jsxs("div",{className:"es-si__detail-label",children:[e.jsx("span",{"aria-hidden":"true",children:"📩"})," ",t("social_insights.followup_48h")]}),e.jsx(v,{text:s.followUp48h,onCopy:a,t}),e.jsxs("div",{className:"es-si__focus-warn",children:[e.jsx("div",{className:"es-si__detail-label es-si__detail-label--warn",children:t("social_insights.do_not_say")}),e.jsx("div",{className:"es-si__detail-text",children:s.doNotSay})]}),o&&e.jsx("div",{className:"es-si__gaio-row",children:e.jsxs("button",{type:"button",className:"es-si__gaio-link","aria-label":t("social_insights.gaio.aria",{event:s.eventName}),onClick:()=>l(s),children:[e.jsx("span",{"aria-hidden":"true",children:"💬"})," ",t("social_insights.talk_to_gaio")]})})]})}function F({data:s,actions:a,metadata:l,i18n:o,baseUrl:t,externalContext:d,auth:p,previewMode:u}){const i=o?.t??(n=>n),_=s,b=s.promptLogId,w=d?.apiKey??"",N=d?.hasChatView===!0,[y,k]=h.useState(0),C=h.useCallback(n=>{navigator.clipboard?.writeText(n).catch(()=>{}),a.emit("social:templateCopied",{text:n})},[a]),S=h.useCallback(n=>{const c=n.eventName;a.emit("chat:draft",{message:i("social_insights.gaio_draft",{event:c,why:n.whyThisEventMatters}),autoSend:!1,quickChips:[{label:i("social_insights.gaio.chip.plan"),message:i("social_insights.gaio.chip.plan_msg",{event:c}),autoSend:!0},{label:i("social_insights.gaio.chip.opener"),message:i("social_insights.gaio.chip.opener_msg",{event:c}),autoSend:!0},{label:i("social_insights.gaio.chip.target"),message:i("social_insights.gaio.chip.target_msg",{event:c}),autoSend:!0},{label:i("social_insights.gaio.chip.other"),message:"",autoSend:!1}]})},[a,i]);if(!_.events&&!s.error)return e.jsx(g,{blockType:"social-insights",children:e.jsx("div",{className:"es-block__body",children:e.jsx("div",{className:"es-si__loading",children:l?.dataQuality==="none"?i("social_insights.sign_in_prompt"):i("social_insights.gathering_events")})})});if(s.error)return e.jsx(g,{blockType:"social-insights",error:M(s.error)});const r=[..._.events??[]].sort((n,c)=>j[n.priorityLevel]-j[c.priorityLevel]),m=_.quietWeek,T=r.filter(n=>n.priorityLevel==="high").length,E=r.filter(n=>n.priorityLevel==="medium").length,x=y<r.length?y:0,f=r[x];return e.jsx(g,{blockType:"social-insights",children:e.jsxs("div",{className:"es-block__body",children:[e.jsx(L,{promptLogId:b,baseUrl:t,apiKey:w,jwt:p?.jwt,previewMode:u,t:i}),r.length>0&&e.jsx(P,{total:r.length,high:T,medium:E,t:i}),r.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"es-si__section-head",children:[e.jsx("span",{className:"es-si__section-title",children:i("social_insights.ranked_events")}),e.jsx("span",{className:"es-si__section-hint",children:i("social_insights.tap_to_focus")})]}),e.jsx("div",{className:"es-si__list",role:"list","aria-label":i("social_insights.ranked_events"),children:r.map((n,c)=>e.jsx(I,{card:n,selected:c===x,onSelect:()=>k(c),t:i},`${n.eventName}-${c}`))}),f&&e.jsx(D,{card:f,onCopy:C,onTalkToGaio:S,hasChatView:N,t:i})]}),r.length===0&&m&&e.jsxs("div",{className:"es-si__quiet-week",children:[e.jsx("div",{className:"es-si__quiet-week-headline",children:m.headline}),e.jsxs("div",{className:"es-si__detail-section",children:[e.jsx("div",{className:"es-si__detail-label",children:i("social_insights.downline_focus")}),e.jsx("div",{className:"es-si__detail-text",children:m.downlineActivationTarget})]}),e.jsxs("div",{className:"es-si__detail-section",children:[e.jsx("div",{className:"es-si__detail-label",children:i("social_insights.warm_network_action")}),e.jsx("div",{className:"es-si__detail-text",children:m.warmNetworkAction})]}),e.jsxs("div",{className:"es-si__detail-section",children:[e.jsx("div",{className:"es-si__detail-label",children:i("social_insights.online_conversation")}),e.jsx("div",{className:"es-si__detail-text",children:m.onlineConversationPrompt})]})]}),_.complianceNote&&(r.length>0||m)&&e.jsxs("div",{className:"es-si__compliance",role:"note",children:[e.jsx("span",{className:"es-si__compliance-icon","aria-hidden":"true",children:"⚠"}),e.jsxs("span",{className:"es-si__compliance-text",children:[e.jsxs("span",{className:"es-si__compliance-label",children:[i("social_insights.compliance_label"),":"]})," ",_.complianceNote]})]})]})})}export{F as Component,A as manifest};
2
+ //# sourceMappingURL=index-BKrM_uoq-CABL-0v-.js.map
@@ -1,2 +1,2 @@
1
1
  import{j as e,H as N,r as d}from"../nexly.js";const f={"--ai-bg":"#141414","--ai-bg-elevated":"#1F1F1F","--ai-bg-card":"#1F1F1F","--ai-bg-input":"#141414","--ai-bg-footer":"#141414","--ai-fg":"#F5F5F5","--ai-fg-secondary":"#D1D5DB","--ai-muted":"#9CA3AF","--ai-muted-dim":"#6B7280","--ai-border":"#2a2a2a","--ai-border-subtle":"#1e1e1e","--ai-accent":"#FFCC00","--ai-accent-fg":"#1A1A1A","--ai-accent-hover":"#E6B800","--ai-accent-subtle":"rgba(255, 204, 0, 0.12)","--ai-accent-on-subtle":"#FFCC00","--ai-accent-on-subtle-strong":"#FFCC00","--ai-accent-border":"#75600C","--ai-user-bubble":"#FFCC00","--ai-user-bubble-fg":"#1A1A1A","--ai-assistant-bubble":"#1F1F1F","--ai-assistant-bubble-fg":"#F5F5F5","--ai-shadow":"0 20px 60px -15px rgba(0, 0, 0, 0.7)","--ai-scrollbar":"#FFCC00","--ai-success":"#22C55E","--ai-warning":"#EAB308","--ai-error":"#F87171","--ai-info":"#38BDF8","--es-color-surface":"#141414","--es-color-surface-elevated":"#1F1F1F","--es-color-surface-hover":"#2E2E2E","--es-color-on-surface":"#F5F5F5","--es-color-on-surface-muted":"#9CA3AF","--es-color-primary":"#FFCC00","--es-color-on-primary":"#1A1A1A","--es-color-primary-muted":"rgba(255, 204, 0, 0.12)","--es-color-primary-on-muted":"#FFCC00","--es-color-border":"#2a2a2a","--es-color-control-border":"#6B7280","--es-color-error":"#F87171","--es-color-success":"#22C55E","--es-color-on-success":"#1A1A1A","--es-color-warning":"#EAB308","--es-color-interactive":"#FFE066"},S={"--ai-bg":"#FFFFFF","--ai-bg-elevated":"#FAFAFA","--ai-bg-card":"#F2F2F2","--ai-bg-input":"#F2F2F2","--ai-bg-footer":"#FFFFFF","--ai-fg":"#1A1A1A","--ai-fg-secondary":"#4B4B4F","--ai-muted":"#67696E","--ai-muted-dim":"#9CA3AF","--ai-border":"#E5E5E5","--ai-border-subtle":"#EFEFEF","--ai-accent":"#856900","--ai-accent-fg":"#FFFFFF","--ai-accent-hover":"#6B5400","--ai-accent-subtle":"rgba(125, 98, 0, 0.10)","--ai-accent-on-subtle":"#7D6200","--ai-accent-on-subtle-strong":"#765D00","--ai-accent-border":"#A8944A","--ai-user-bubble":"#856900","--ai-user-bubble-fg":"#FFFFFF","--ai-assistant-bubble":"#F2F2F2","--ai-assistant-bubble-fg":"#1A1A1A","--ai-shadow":"0 20px 60px -15px rgba(0, 0, 0, 0.12)","--ai-scrollbar":"#D1D5DB","--ai-success":"#00672B","--ai-warning":"#9C5300","--ai-error":"#AD2C26","--ai-info":"#03669D","--es-color-surface":"#FFFFFF","--es-color-surface-elevated":"#F2F2F2","--es-color-surface-hover":"#EAEAEA","--es-color-on-surface":"#1A1A1A","--es-color-on-surface-muted":"#67696E","--es-color-primary":"#856900","--es-color-on-primary":"#FFFFFF","--es-color-primary-muted":"rgba(118, 93, 0, 0.10)","--es-color-primary-on-muted":"#765D00","--es-color-border":"#E5E5E5","--es-color-control-border":"#6B7280","--es-color-error":"#AD2C26","--es-color-success":"#00672B","--es-color-on-success":"#FFFFFF","--es-color-interactive":"#92400E"},O={slug:"ambient-signal-black",name:"Signal Black",version:"0.1.0",slots:["header","main","footer"],cssVariables:f,structure:{header:{id:"header",label:"Header",accepts:!0},main:{id:"main",label:"Main Content",accepts:!0},footer:{id:"footer",label:"Footer",accepts:!0}},defaultViews:[],requiredServices:["chat-bot"],description:"Bold monochrome theme with a #FFCC00 signal-gold accent, built for the AmbientSystem SupportChat widget.",author:"E-Commerce Studio",packageName:"@ecommerce-studio/theme-ambient-signal-black",options:[{id:"colorScheme",type:"select",label:"Appearance mode",default:"auto",group:"Appearance",options:[{label:"Auto (match visitor)",value:"auto"},{label:"Light",value:"light"},{label:"Dark",value:"dark"}]}],supports:{customCss:!1,customJs:!1,darkMode:!0,rtl:!1,views:!1}},D=105,j=82,x="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGkAAABSCAYAAABXP/pUAAACiklEQVR42u2c23GDQAxFtyc3oGrShupINWogPTn+sCcewmMxSKtdzp3RX2CcPVxJaIFSUEvJM+wZ90coy+KzyLoQsnLcC8o00AlQdGWBl8LeoK0di4sOwtkL5pNAieHgog+lQXBe6XDtAkEzskBAUxfNuRclAUTHlzDF0VAMBIiGIjkgXNSwDuEiXDSesgIy0Py1vXecRKo7EgKivA0DKa+DegSkjiBdvi5J+dtBtcSpD63AMyDRAQJp4ogtV1jZfnikBSwbEcqZtUUXZmeRsHQ0OJ5XszYCpcA5tmARoIDzoaskaPbXrYuyzNo0ABTuOXn4qVd3UeZJtTgNaw1APosp5YLbFNkBXd5N1gkgbzcByMlNw6c87RDQ1E1Dp7xeAV0GUs+ApvVDR4V0B1JuSAqkOkhfADptMV0g3R7xs7HRBaT6WZt5nPcd0vQPhFq0G5LLfdISJO+prA4EyX3i8FUB6e6QDkd0kTqddxekM4GN5qLiCP9jSEfS4SipTiJcdBaktSdrRoXkuTNbPCHVpkPpHJQ4Nguza/btBKm2ndeOgNnM/xHyAEoEpNr6lRmYzmQDi1qbaEi19SsLsDn3aPDF2wxSdmC2kKItGlB5AvpJllbWfrQ4QrMS/1ZF1e1LNkh7W/p3aLbz3C8osnH+5q+23J5teA+vJu6dcshM1B5nDRuo3Xq/UjNBtBNniVJiX8EMf4xYSp6XhK38/+TzNFr/TikJlQlitla+G/U+IrrU52dGBDXk9+qU1AYo4JwMSoEDrKgNTmA1AiMgaTNc3UplgEkyzjGgtJty1DiP+pJAQAISAhKQ6OJaNxBHtkas1H1VEh2Aw01t4ukEWxKd1x5AIYQQQgihhvoFxm18xEWNaMwAAAAASUVORK5CYII=",M=j/D,_=.62;function C({size:a=64,className:o,registerEl:s}){const c=a*_,n=c*M;return e.jsx("div",{className:o,"aria-hidden":"true","data-bird":"badge",style:{position:"relative",width:a,height:a,borderRadius:"9999px",background:"var(--ai-accent, #FFCC00)",color:"var(--ai-accent-fg, #1A1A1A)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"visible"},children:e.jsxs("div",{ref:s,"data-bird":"root",style:{position:"relative",width:c,height:n,transformOrigin:"50% 50%"},children:[e.jsx("div",{"data-bird":"glow",style:{position:"absolute",inset:"-35%",borderRadius:"9999px",background:"radial-gradient(closest-side, currentColor, transparent 72%)",opacity:0,filter:"blur(6px)",pointerEvents:"none"}}),e.jsx("div",{"data-bird":"mark",style:{position:"relative",width:"100%",height:"100%",backgroundColor:"currentColor",WebkitMaskImage:`url("${x}")`,maskImage:`url("${x}")`,WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskSize:"contain",maskSize:"contain"}})]})})}const I=3200,R=2.5,z=4200,J=3,Q=Math.PI/3,P=5200,A=.12,V=.34;function p(a,o){const s=a.querySelector('[data-bird="glow"]');s&&(s.style.opacity=o.toFixed(3))}function X(a){const o=d.useRef(new Set),s=d.useRef(0),c=d.useCallback(n=>{const i=o.current;if(n)i.add(n);else for(const t of i)t.isConnected||i.delete(t)},[]);return d.useEffect(()=>{if(!a)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){for(const t of o.current)t.style.transform="",p(t,A);return}const n=performance.now();function i(t){const r=t-n,h=Math.sin(r/I*Math.PI*2)*R,F=Math.sin(r/z*Math.PI*2+Q)*J,u=(Math.sin(r/P*Math.PI*2)+1)/2,l=A+(V-A)*u;for(const b of o.current)b.style.transform=`translateY(${h.toFixed(2)}px) rotate(${F.toFixed(2)}deg)`,p(b,l);s.current=requestAnimationFrame(i)}return s.current=requestAnimationFrame(i),()=>{cancelAnimationFrame(s.current);for(const t of o.current)t.style.transform="",p(t,0)}},[a]),{registerEl:c}}function T({brandName:a="AMBIENT",position:o="bottom-right",initialOpen:s=!1,children:c,cssVariables:n,t:i,colorScheme:t,builderMode:r=!1,owlIdleLife:h=!1,onOpenChange:F}){const u=N(t),[l,b]=d.useState(s||r),k=X(h),B=()=>b(g=>{const m=!g;return F?.(m),m}),w=()=>{b(!1),F?.(!1)},E=o==="bottom-left",v=d.useMemo(()=>{const g=Object.fromEntries(Object.entries(n??{}).filter(([m,y])=>f[m]!==y));return{...u==="light"?S:f,...g,...r?{width:"100%",height:"100%"}:{}}},[n,u,r]);return e.jsxs("div",{className:["ambient-shell",`ambient-shell--${u}`].join(" "),style:v,children:[!r&&e.jsx("button",{type:"button",className:["ambient-shell__button",E&&"ambient-shell__button--left",l&&"ambient-shell__button--hidden"].filter(Boolean).join(" "),onClick:B,"aria-label":i?.("floating.open_widget")??"Open chat widget",tabIndex:l?-1:0,"aria-hidden":l,children:e.jsx(C,{size:64,registerEl:k.registerEl})}),e.jsxs("div",{className:["ambient-shell__panel",E&&!r&&"ambient-shell__panel--left",(l||r)&&"ambient-shell__panel--open"].filter(Boolean).join(" "),role:"dialog","aria-label":i?.("chat.widget_aria")??"Chat widget","aria-hidden":r?!1:!l,children:[e.jsxs("header",{className:"ambient-shell__header",children:[e.jsxs("div",{className:"ambient-shell__header-brand",children:[e.jsx(C,{size:40,registerEl:k.registerEl}),e.jsxs("div",{className:"ambient-shell__header-info",children:[e.jsx("h1",{className:"ambient-shell__brand-name",children:a}),e.jsx("p",{className:"ambient-shell__brand-tagline",children:i?.("header.brand_tagline_support")??"Support"})]})]}),!r&&e.jsx("button",{type:"button",className:"ambient-shell__header-btn",onClick:w,"aria-label":i?.("header.close_widget")??"Close widget",children:e.jsx(U,{size:20})})]}),e.jsx("main",{className:"ambient-shell__content",style:{containerName:"es-slot",containerType:"inline-size"},children:c})]})]})}function U({size:a=20}){return e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})}export{C as BirdIcon,T as ThemeShell,f as darkVariables,S as lightVariables,O as manifest,X as useBirdAnimation};
2
- //# sourceMappingURL=index-BWMbr4oS-Dsa9X9U7.js.map
2
+ //# sourceMappingURL=index-BX6ig9BJ-Dsa9X9U7.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as S,j as e,Q as _,o as C}from"../nexly.js";const D={slug:"new-member-onboarding-tracker",name:"New Member Onboarding Tracker",version:"1.0.0",category:"interactive",requiredService:"new-member-onboarding-tracker",configSchema:{properties:{mode:{type:"string",default:"basic"},showStreak:{type:"boolean",default:!0}}},defaultConfig:{mode:"basic",showStreak:!0},sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"new-member-onboarding-tracker",inputSchema:{type:"object",properties:{steps:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},completed:{type:"boolean"},timeEstimate:{type:"string"}}}},completedCount:{type:"number"},totalCount:{type:"number"},daysSinceJoin:{type:"number"},aiMessage:{type:"string"},streak:{type:"number"},mode:{type:"string",enum:["basic","pro"]}}},previewDataOverride:{mode:"pro",daysSinceJoin:2,completedCount:2,totalCount:6,streak:3,aiMessage:"Great progress! Setting up your profile is key — it helps your upline and new contacts understand your focus area. Takes about 5 minutes.",steps:[{id:"1",label:"Watch welcome video",completed:!0,timeEstimate:"5 min"},{id:"2",label:"Complete your profile",completed:!0,timeEstimate:"10 min"},{id:"3",label:"Join the team chat group",completed:!1,timeEstimate:"2 min"},{id:"4",label:"Schedule your first 1-on-1 with upline",completed:!1,timeEstimate:"5 min"},{id:"5",label:"Place your first personal purchase",completed:!1,timeEstimate:"15 min"},{id:"6",label:"Share your first product post",completed:!1,timeEstimate:"10 min"}]}},fields:[{id:"mode",type:"select",label:"Display mode",default:"basic",options:[{label:"Basic — checklist + next action",value:"basic"},{label:"Pro — guided steps with AI coaching",value:"pro"}],group:"Display"},{id:"showStreak",type:"toggle",label:"Show streak counter (pro mode)",default:!0,group:"Display"}],events:{emits:[{name:"nmot:stepFocused",description:"User focused a step in pro mode"},{name:"nmot:stepCompleted",description:"User marked a step as done"}],listens:[{name:"nmot:refresh",description:"Force refresh onboarding step data"}]}};function J({data:t,config:b,actions:d,metadata:u,i18n:f}){const a=f?.t??(s=>s),o=b.mode??t.mode??"basic",v=b.showStreak??!0,n=t.steps??[],m=t.completedCount??n.filter(s=>s.completed).length,i=t.totalCount??n.length,g=t.daysSinceJoin??0,h=t.aiMessage,x=t.streak??0,[y,j]=S.useState(()=>n.find(s=>!s.completed)?.id??null);if(n.length===0&&!t.error)return e.jsx(_,{blockType:"new-member-onboarding-tracker",children:e.jsxs("div",{className:"es-block__body es-nmot__body",children:[e.jsx("div",{className:"es-nmot__header",children:e.jsx("div",{className:"es-nmot__day-badge",children:a("onboarding.day_badge",{n:1})})}),e.jsxs("div",{className:"es-nmot__progress-wrap",children:[e.jsxs("div",{className:"es-nmot__progress-label",children:[e.jsx("span",{children:u?.dataQuality==="none"?a("onboarding.signin_prompt"):a("onboarding.getting_started")}),e.jsx("span",{children:"0/0"})]}),e.jsx("div",{className:"es-nmot__progress-bar",role:"progressbar","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"es-nmot__progress-fill",style:{width:"0%"}})})]}),e.jsx("p",{style:{fontSize:13,color:"var(--es-color-on-surface-muted, #4B5563)",margin:"8px 0 0"},children:u?.dataQuality==="none"?a("onboarding.signin_steps_hint"):a("onboarding.empty")})]})});if(t.error)return e.jsx(_,{blockType:"new-member-onboarding-tracker",error:C(t.error)});const c=i>0?Math.round(m/i*100):0,l=m>=i;n.find(s=>s.id===y);function N(s){o==="pro"&&(j(s.id),d.emit("nmot:stepFocused",{stepId:s.id}))}function k(s){d.call("completeStep",{stepId:s}).catch(()=>{}),d.emit("nmot:stepCompleted",{stepId:s});const p=n.find(r=>!r.completed&&r.id!==s);j(p?.id??null)}return e.jsx(_,{blockType:"new-member-onboarding-tracker",children:e.jsxs("div",{className:"es-block__body es-nmot__body",children:[e.jsxs("div",{className:"es-nmot__header",children:[e.jsx("div",{className:"es-nmot__day-badge",children:a("onboarding.day_badge",{n:g+1})}),o==="pro"&&v&&x>0&&e.jsxs("div",{className:"es-nmot__streak",children:[e.jsx("span",{className:"es-nmot__streak-icon","aria-hidden":"true",children:"🔥"}),e.jsx("span",{className:"es-nmot__streak-count",children:x}),e.jsx("span",{className:"es-nmot__streak-label",children:a("onboarding.day_streak")})]})]}),e.jsxs("div",{className:"es-nmot__progress-wrap",children:[e.jsxs("div",{className:"es-nmot__progress-label",children:[e.jsx("span",{children:a(l?"onboarding.complete":"onboarding.getting_started")}),e.jsxs("span",{children:[m,"/",i]})]}),e.jsx("div",{className:"es-nmot__progress-bar",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a("onboarding.progress_aria",{percent:c}),children:e.jsx("div",{className:`es-nmot__progress-fill${l?" es-nmot__progress-fill--done":""}`,style:{width:`${c}%`}})})]}),e.jsx("ul",{className:"es-nmot__steps",role:"list",children:n.map((s,p)=>{const r=o==="pro"&&s.id===y,w=["es-nmot__step",s.completed?"es-nmot__step--done":"",r?"es-nmot__step--active":""].filter(Boolean).join(" ");return e.jsxs("li",{className:w,children:[e.jsxs("button",{className:"es-nmot__step-row",onClick:()=>N(s),"aria-current":r?"step":void 0,disabled:o==="basic",children:[e.jsx("span",{className:"es-nmot__step-check","aria-hidden":"true",children:s.completed?"✓":e.jsx("span",{className:"es-nmot__step-num",children:p+1})}),e.jsx("span",{className:"es-nmot__step-label",children:s.label}),s.timeEstimate&&e.jsx("span",{className:"es-nmot__step-time",children:s.timeEstimate})]}),o==="pro"&&r&&!s.completed&&e.jsxs("div",{className:"es-nmot__step-detail",children:[h&&e.jsxs("div",{className:"es-nmot__ai-message",children:[e.jsx("span",{className:"es-nmot__ai-label",children:a("onboarding.ai_coach_label")}),e.jsx("p",{className:"es-nmot__ai-text",children:h})]}),e.jsx("button",{className:"es-nmot__complete-btn",onClick:()=>k(s.id),children:a("onboarding.mark_done")})]})]},s.id)})}),o==="basic"&&!l&&e.jsxs("div",{className:"es-nmot__next-prompt",children:[e.jsx("span",{className:"es-nmot__next-label",children:a("onboarding.next_up")}),e.jsx("span",{className:"es-nmot__next-text",children:n.find(s=>!s.completed)?.label??a("onboarding.all_steps_complete")})]}),l&&e.jsxs("div",{className:"es-nmot__done-banner",children:[e.jsx("span",{className:"es-nmot__done-icon","aria-hidden":"true",children:"🎉"}),e.jsx("span",{children:a("onboarding.done_banner",{n:g+1})})]})]})})}export{J as Component,D as manifest};
2
- //# sourceMappingURL=index-B0-9mIbB-DP0QKkgf.js.map
2
+ //# sourceMappingURL=index-BZO9Qaiw-DP0QKkgf.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as i,a as j,j as e,Q as m}from"../nexly.js";const E={slug:"auth-register",name:"User Registration",version:"1.0.0",category:"interactive",requiredService:"",configSchema:{properties:{showName:{type:"boolean",default:!0},showEmail:{type:"boolean",default:!0},requireEmail:{type:"boolean",default:!1},showExternalId:{type:"boolean",default:!1},submitLabel:{type:"string",default:""}}},defaultConfig:{showName:!0,showEmail:!0,requireEmail:!1,showExternalId:!1,submitLabel:""},dataContract:{serviceSlug:"chat-bot",inputSchema:{type:"object",properties:{authenticated:{type:"boolean"}}},previewDataOverride:{authenticated:!1}},fields:[{id:"showName",type:"toggle",label:"Show name field",default:!0,group:"Form Fields"},{id:"showEmail",type:"toggle",label:"Show email field",default:!0,group:"Form Fields"},{id:"requireEmail",type:"toggle",label:"Require email",default:!1,group:"Form Fields"},{id:"showExternalId",type:"toggle",label:"Show external ID field",default:!1,group:"Form Fields"},{id:"submitLabel",type:"localized-text",label:"Submit button label",default:"",placeholder:'Leave empty to use translated default (e.g. "Register")',group:"Content"}],events:{emits:[{name:"auth:registered",description:"User successfully completed registration"},{name:"auth:registrationFailed",description:"Registration form submission failed"}],listens:[{name:"auth:reset",description:"Reset the registration form"}]},supportedPlacements:["main"],sizing:{minWidth:280,preferredHeight:"auto",scrollable:!1}};function k({config:o,actions:g,i18n:c}){const r=c?.t??(t=>t),b=c?.currentLanguage??"en",[f,h]=i.useState(""),[n,y]=i.useState(""),[s,p]=i.useState(!1),[a,l]=i.useState(null),v=o.showName??!0,x=o.showEmail??!0,d=o.requireEmail??!1,S=j(o.submitLabel,b,{t:r,fallbackKey:"auth.register.submit",enDefault:"Register"});async function w(t){t.preventDefault(),p(!0),l(null);try{const u=await g.call("register",{name:f||void 0,email:n||void 0});u?.error?l({success:!1,error:u.error}):l({success:!0,apiKey:u?.apiKey})}catch{l({success:!1,error:r("auth.register.error_failed")})}finally{p(!1)}}return a?.success?e.jsx(m,{blockType:"auth-register",children:e.jsxs("div",{className:"es-block__body",style:{padding:24,textAlign:"center"},children:[e.jsx("div",{style:{fontSize:14,color:"var(--es-color-success, #00672B)",marginBottom:8},children:r("auth.register.success")}),a.apiKey&&e.jsxs("div",{style:{fontSize:11,color:"var(--es-color-on-surface-muted, #4B5563)",background:"var(--es-color-surface-elevated, #f5f5f5)",padding:"8px 12px",borderRadius:6,fontFamily:"monospace",wordBreak:"break-all"},children:[r("auth.register.api_key_prompt"),e.jsx("br",{}),e.jsx("span",{style:{color:"var(--es-color-interactive, #2563EB)"},children:a.apiKey})]})]})}):e.jsx(m,{blockType:"auth-register",children:e.jsx("div",{className:"es-block__body",style:{padding:16},children:e.jsxs("form",{onSubmit:w,children:[v&&e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--es-color-on-surface-muted, #4B5563)",marginBottom:4},children:r("auth.register.name_label")}),e.jsx("input",{type:"text",value:f,onChange:t=>h(t.target.value),placeholder:r("auth.register.name_placeholder"),style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid var(--es-color-control-border, #6B7280)",background:"var(--es-color-surface-elevated, #f5f5f5)",color:"var(--es-color-on-surface, #1a1a1a)",fontSize:14,outline:"none",boxSizing:"border-box"}})]}),x&&e.jsxs("div",{style:{marginBottom:12},children:[e.jsxs("label",{style:{display:"block",fontSize:12,color:"var(--es-color-on-surface-muted, #4B5563)",marginBottom:4},children:[r("auth.email_label"),d&&" *"]}),e.jsx("input",{type:"email",value:n,onChange:t=>y(t.target.value),placeholder:r("auth.email_placeholder"),required:d,style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid var(--es-color-control-border, #6B7280)",background:"var(--es-color-surface-elevated, #f5f5f5)",color:"var(--es-color-on-surface, #1a1a1a)",fontSize:14,outline:"none",boxSizing:"border-box"}})]}),a?.error&&e.jsx("div",{style:{fontSize:12,color:"var(--es-color-error, #AD2C26)",marginBottom:8},children:a.error}),e.jsx("button",{type:"submit",disabled:s||d&&!n,style:{width:"100%",padding:"10px 16px",borderRadius:6,border:"none",background:s?"var(--es-color-on-surface-muted, #4B5563)":"var(--es-color-primary, #2563EB)",color:"var(--es-color-on-primary, #ffffff)",fontSize:14,fontWeight:600,cursor:s?"wait":"pointer"},children:s?r("auth.register.submitting"):S})]})})})}export{k as Component,E as manifest};
2
- //# sourceMappingURL=index-CSDD7Z6C-BpgnWlB8.js.map
2
+ //# sourceMappingURL=index-BauMKr5c-BpgnWlB8.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as d,b as a,t as s}from"../nexly.js";const S={slug:"guest-auth",name:"Guest Authentication",version:"1.0.0",category:"content",requiredService:"",configSchema:{properties:{}},defaultConfig:{},sizing:{minWidth:0,preferredHeight:0,scrollable:!1},dataContract:{serviceSlug:"",inputSchema:{type:"object",properties:{fingerprint:{type:"string"}},required:["fingerprint"]},previewDataOverride:{fingerprint:"00000000-0000-4000-a000-000000000000"}},fields:[],events:{emits:[{name:"auth:guest",description:"Guest session created — carries { user: { id }, accessToken }"}],listens:[]},supportedPlacements:["main"]};function m(e){return`es-widget-guest-fp:${e}`}function y(){if(typeof crypto>"u")return null;if(typeof crypto.randomUUID=="function"){const[t]=s(()=>crypto.randomUUID());if(t)return t}if(typeof crypto.getRandomValues!="function")return null;const[e]=s(()=>crypto.getRandomValues(new Uint8Array(16)));if(!e)return null;e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Array.from(e,t=>t.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function h(e,r){if(e)return e;if(typeof window>"u")return;const t=m(r),[i]=s(()=>window.localStorage.getItem(t));if(i)return i;const n=y();if(n)return s(()=>window.localStorage.setItem(t,n)),n}function $({baseUrl:e,actions:r,externalContext:t,productId:i}){const n=d.useRef(!1);return d.useEffect(()=>{if(n.current)return;const c=t?.apiKey;if(!c)return;const u=h(t?.fp,i);u&&(n.current=!0,(async()=>{const[o,f]=await a(fetch(`${e}/api/widget/auth/guest`,{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":c},body:JSON.stringify({fingerprint:u})}));if(f||!o){console.error("[guest-auth] Error:",f);return}if(!o.ok){const[g]=await a(o.text());console.error("[guest-auth] Auth failed:",o.status,g??"");return}const[p]=await a(o.json()),l=p?.data?.user?.id;l&&r.emit("auth:guest",{user:{id:l},accessToken:p?.data?.accessToken})})())},[e,r,t,i]),null}export{$ as Component,S as manifest};
2
- //# sourceMappingURL=index-DzCfV77F-C1BzRUwZ.js.map
2
+ //# sourceMappingURL=index-Bf_npmqm-C1BzRUwZ.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as p,j as e,Q as r}from"../nexly.js";const N={slug:"event-list",name:"Event List",version:"1.0.0",category:"content",requiredService:"event-scraper",configSchema:{properties:{maxEvents:{type:"number",default:20},freeOnly:{type:"boolean",default:!1}}},defaultConfig:{maxEvents:20,freeOnly:!1},dataContract:{serviceSlug:"event-scraper",inputSchema:{type:"object",properties:{events:{type:"array",items:{type:"object",properties:{id:{type:"string"},title:{type:"string"},date:{type:"string"},location:{type:"string"},price:{type:"number"},isFree:{type:"boolean"},url:{type:"string"},imageUrl:{type:"string"}}}},total:{type:"number"}},required:["events"]},previewDataOverride:{events:[{id:"evt-1",title:"Tech Startup Networking Night",date:"2026-04-10T18:00:00Z",location:"Seoul, Gangnam-gu",price:0,isFree:!0,url:"https://onoffmix.com/event/1",imageUrl:""},{id:"evt-2",title:"AI & Machine Learning Summit",date:"2026-04-15T09:00:00Z",location:"Seoul, Mapo-gu",price:25e3,isFree:!1,url:"https://onoffmix.com/event/2",imageUrl:""},{id:"evt-3",title:"Web3 Developer Workshop",date:"2026-04-20T14:00:00Z",location:"Seoul, Songpa-gu",price:0,isFree:!0,url:"https://onoffmix.com/event/3",imageUrl:""}],total:3}},fields:[{id:"maxEvents",type:"range",label:"Max events to show",default:20,min:1,max:100,step:1,group:"Content"},{id:"freeOnly",type:"toggle",label:"Show free events only",default:!1,group:"Filters"}],events:{emits:[{name:"events:eventSelected",description:"User clicked on an event"},{name:"events:filterChanged",description:"User changed the event filter"}],listens:[{name:"events:refresh",description:"Reload events from scraper"}]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main"]};function j(l,s){const n=new Date(l);return isNaN(n.getTime())?l:new Intl.DateTimeFormat(s,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function c(){return e.jsxs("li",{className:"es-evlist__skeleton","aria-hidden":"true",children:[e.jsx("div",{className:"es-evlist__skeleton-line es-evlist__skeleton-line--title"}),e.jsx("div",{className:"es-evlist__skeleton-line es-evlist__skeleton-line--meta"}),e.jsx("div",{className:"es-evlist__skeleton-line es-evlist__skeleton-line--short"})]})}function k({data:l,actions:s,i18n:n}){const i=n?.t??(t=>t),_=n?.currentLanguage??"en",d=l.events??[],u=l.loading===!0,h=l.error,[g,x]=p.useState(null);p.useEffect(()=>{const t=s.on("events:markerHighlight",o=>{x(o?.id??null)});return()=>t()},[s]);const y=t=>{t&&s.emit("events:hover",{id:t})},f=()=>{s.emit("events:hover",{id:null})},v=t=>{t.id&&s.emit("events:eventSelected",{id:t.id,event:t})};return u?e.jsx(r,{blockType:"event-list",children:e.jsx("div",{className:"es-block__body",children:e.jsxs("ul",{className:"es-evlist__items","aria-label":i("event_list.loading"),"aria-busy":"true",children:[e.jsx(c,{}),e.jsx(c,{}),e.jsx(c,{})]})})}):h?e.jsx(r,{blockType:"event-list",children:e.jsx("div",{className:"es-block__body",children:e.jsxs("div",{className:"es-evlist__error",role:"alert",children:[e.jsx("span",{className:"es-evlist__error-icon","aria-hidden":"true",children:"⚠"}),e.jsx("span",{children:i("event_list.error")}),e.jsx("button",{type:"button",className:"es-evlist__retry",onClick:()=>s.refresh(),children:i("event_list.retry")})]})})}):d.length===0?e.jsx(r,{blockType:"event-list",children:e.jsx("div",{className:"es-block__body",children:e.jsxs("div",{className:"es-evlist__empty",children:[e.jsx("span",{className:"es-evlist__empty-icon","aria-hidden":"true",children:"📅"}),e.jsx("span",{className:"es-evlist__empty-text",children:i("event_list.empty")})]})})}):e.jsx(r,{blockType:"event-list",children:e.jsx("div",{className:"es-block__body",children:e.jsx("ul",{className:"es-evlist__items",role:"list","aria-label":i("event_list.aria_list_label"),children:d.map((t,o)=>{const m=t.id!=null&&t.id===g;return e.jsx("li",{className:`es-evlist__item${m?" es-evlist__item--highlighted":""}`,onMouseEnter:()=>y(t.id),onMouseLeave:f,onClick:()=>v(t),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),v(t))},tabIndex:0,role:"button","aria-pressed":m,children:e.jsxs("div",{className:"es-evlist__item-content",children:[e.jsxs("div",{className:"es-evlist__header",children:[e.jsx("span",{className:"es-evlist__title",children:t.title}),t.isFree&&e.jsx("span",{className:"es-evlist__badge es-evlist__badge--free",children:i("event_list.free")})]}),e.jsxs("div",{className:"es-evlist__meta",children:[t.date&&e.jsxs("span",{className:"es-evlist__date","aria-label":t.date,children:[e.jsx("span",{className:"es-evlist__meta-icon","aria-hidden":"true",children:"🗓"}),j(t.date,_)]}),t.location&&e.jsxs("span",{className:"es-evlist__location",children:[e.jsx("span",{className:"es-evlist__meta-icon","aria-hidden":"true",children:"📍"}),t.location]})]}),t.url&&e.jsxs("a",{href:t.url,className:"es-evlist__cta",target:"_blank",rel:"noopener noreferrer","aria-label":`${i("event_list.view_details")}: ${t.title}`,onClick:a=>a.stopPropagation(),children:[i("event_list.view_details")," →"]})]})},t.id??o)})})})})}export{k as Component,N as manifest};
2
- //# sourceMappingURL=index-Dwtd4id8-CiRb-0NX.js.map
2
+ //# sourceMappingURL=index-BtkNePSj-CiRb-0NX.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as i,j as e,Q as x,o as K}from"../nexly.js";import{m as O}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";const Q={slug:"gaio-coach",name:"GAIO Coach",version:"1.0.0",category:"interactive",requiredService:"gaio-coach",configSchema:{properties:{proMode:{type:"boolean",default:!1},showProgressBar:{type:"boolean",default:!0},showMotivationalMessage:{type:"boolean",default:!0},maxActionsShown:{type:"number",default:3}}},defaultConfig:{proMode:!1,showProgressBar:!0,showMotivationalMessage:!0,maxActionsShown:3},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!0},dataContract:{serviceSlug:"gaio-coach",inputSchema:{type:"object",properties:{plan:{type:"object",properties:{date:{type:"string"},topActions:{type:"array",items:{type:"object",properties:{id:{type:"string"},title:{type:"string"}}}},motivationalMessage:{type:"string"},progressSummary:{type:"string"}}},progress:{type:"object",properties:{currentStreak:{type:"number"},completedActions:{type:"number"},weeklyScore:{type:"number"},rank:{type:"string"},nextMilestone:{type:"string"}}}}},previewDataOverride:{plan:{date:"2026-04-05",topActions:[{id:"a1",type:"recruit",title:"Connect with 3 prospects",description:"Reach out to your warm market list. Send personalized messages to 3 contacts who expressed interest.",estimatedMinutes:30,priority:"high",isCompleted:!1},{id:"a2",type:"attend_event",title:"Attend local networking event",description:"Seoul Tech Meetup at 7pm. Bring business cards and focus on making genuine connections.",estimatedMinutes:120,priority:"high",isCompleted:!1},{id:"a3",type:"contact_downliner",title:"Coach team member Kim",description:"Kim is close to qualifying for the next rank. A 15-minute coaching call can help them cross the threshold.",estimatedMinutes:15,priority:"medium",isCompleted:!1}],motivationalMessage:"Your consistent effort is building momentum — one action at a time!",progressSummary:"You are 2 actions away from your weekly goal."},progress:{currentStreak:5,completedActions:14,weeklyScore:78,rank:"Silver",nextMilestone:"Gold (3 more referrals)"}}},fields:[{id:"proMode",type:"toggle",label:"Pro mode (full chat history)",default:!1,group:"Display"},{id:"showProgressBar",type:"toggle",label:"Show progress bar",default:!0,group:"Display"},{id:"showMotivationalMessage",type:"toggle",label:"Show motivational message",default:!0,group:"Display"},{id:"maxActionsShown",type:"range",label:"Max actions shown",default:3,min:1,max:5,step:1,group:"Display"}],events:{emits:[{name:"gaio:actionCompleted",description:"User marked an action as completed"},{name:"gaio:messageSent",description:"User sent a coaching message (pro mode)"}],listens:[{name:"gaio:refresh",description:"Force refresh coaching plan"}]},supportedPlacements:["main","sidebar"]};function A({item:s,onToggle:r}){return e.jsxs("div",{className:`es-gaio__action es-gaio__action--${s.priority}${s.isCompleted?" es-gaio__action--completed":""}`,onClick:()=>r(s.id),role:"button",tabIndex:0,onKeyDown:n=>n.key==="Enter"&&r(s.id),children:[e.jsx("div",{className:"es-gaio__action-check",children:s.isCompleted?"✓":""}),e.jsxs("div",{className:"es-gaio__action-body",children:[e.jsx("div",{className:"es-gaio__action-title",children:s.title}),e.jsx("div",{className:"es-gaio__action-desc",children:s.description}),e.jsx("div",{className:"es-gaio__action-meta",children:e.jsxs("span",{className:"es-gaio__action-time",children:["~",s.estimatedMinutes,"m"]})})]})]})}function U({data:s,config:r,actions:n,baseUrl:f,productId:v,metadata:D,i18n:$}){const t=$?.t??(a=>a),p=r.proMode??!1,T=r.showProgressBar??!0,I=r.showMotivationalMessage??!0,j=r.maxActionsShown??3,d=s.plan,c=s.progress,[l,b]=i.useState([]),[h,u]=i.useState([]),[m,w]=i.useState(""),[g,k]=i.useState(!1),N=i.useRef(null);i.useEffect(()=>{d?.topActions&&b(d.topActions.slice(0,j))},[d,j]),i.useEffect(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[h]);const S=i.useCallback(async a=>{b(_=>_.map(o=>o.id===a?{...o,isCompleted:!o.isCompleted}:o)),await n.call("complete",{actionId:a}).catch(()=>{}),n.emit("gaio:actionCompleted",{actionId:a})},[n]),M=i.useCallback(async()=>{const a=m.trim();if(!a||g)return;const _={id:`u-${Date.now()}`,role:"user",text:a};u(o=>[...o,_]),w(""),k(!0);try{const o=(await(await fetch(`${f}/api/widget/gaio/coach`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({productId:v,context:{dailyGoal:a}})})).json())?.data?.plan,y=o?.motivationalMessage??o?.progressSummary??t("gaio_coach.default_guidance"),P={id:`a-${Date.now()}`,role:"assistant",text:y};u(B=>[...B,P]),n.emit("gaio:messageSent",{text:a})}catch{const o={id:`e-${Date.now()}`,role:"assistant",text:t("gaio_coach.error_unreachable")};u(y=>[...y,o])}finally{k(!1)}},[m,g,f,v,n]);if(!d&&!s.error)return e.jsx(x,{blockType:"gaio-coach",children:e.jsxs("div",{className:"es-block__body",children:[e.jsx("div",{className:"es-gaio__header",children:e.jsx("span",{className:"es-gaio__title",children:t("gaio_coach.title")})}),e.jsx("div",{className:"es-gaio__motivation",style:{color:"var(--es-color-on-surface-muted, #4B5563)",fontStyle:"italic"},children:D?.dataQuality==="none"?t("gaio_coach.sign_in_prompt"):t("gaio_coach.preparing")}),[1,2,3].map(a=>e.jsxs("div",{className:"es-gaio__action",style:{opacity:.35},children:[e.jsx("div",{className:"es-gaio__action-check"}),e.jsx("div",{className:"es-gaio__action-body",children:e.jsx("div",{className:"es-gaio__action-title",style:{background:"var(--es-color-surface-elevated, #f5f5f5)",borderRadius:4,height:14,width:`${60+a*15}%`}})})]},a))]})});if(s.error)return e.jsx(x,{blockType:"gaio-coach",error:K(s.error)});const C=l.filter(a=>a.isCompleted).length,E=l.length>0?C/l.length*100:0;return e.jsx(x,{blockType:"gaio-coach",children:e.jsxs("div",{className:"es-block__body",children:[e.jsxs("div",{className:"es-gaio__header",children:[e.jsx("span",{className:"es-gaio__title",children:t("gaio_coach.title")}),c?.currentStreak!=null&&c.currentStreak>0&&e.jsxs("span",{className:"es-gaio__streak",children:["🔥 ",e.jsx("span",{className:"es-gaio__streak-value",children:c.currentStreak})," ",t("gaio_coach.day_streak")]})]}),T&&l.length>0&&e.jsxs("div",{className:"es-gaio__progress",children:[e.jsxs("div",{className:"es-gaio__progress-label",children:[e.jsx("span",{children:t("gaio_coach.todays_actions")}),e.jsxs("span",{children:[C,"/",l.length]})]}),e.jsx("div",{className:"es-gaio__progress-bar",children:e.jsx("div",{className:"es-gaio__progress-fill",style:{width:`${E}%`}})})]}),p&&c?.rank&&e.jsxs("div",{className:"es-gaio__summary-card",children:[e.jsxs("div",{className:"es-gaio__summary-rank",children:[t("gaio_coach.current_rank"),": ",O(c.rank,t)]}),c.nextMilestone&&e.jsxs("div",{className:"es-gaio__summary-milestone",children:[t("gaio_coach.next"),": ",c.nextMilestone]})]}),I&&d?.motivationalMessage&&e.jsx("div",{className:"es-gaio__motivation",children:d.motivationalMessage}),!p&&e.jsx("div",{className:"es-gaio__actions",children:l.map(a=>e.jsx(A,{item:a,onToggle:S},a.id))}),p&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"es-gaio__actions",children:l.map(a=>e.jsx(A,{item:a,onToggle:S},a.id))}),h.length>0&&e.jsxs("div",{className:"es-gaio__chat",children:[h.map(a=>e.jsx("div",{className:`es-gaio__chat-msg es-gaio__chat-msg--${a.role}`,children:a.text},a.id)),e.jsx("div",{ref:N})]}),e.jsxs("div",{className:"es-gaio__chat-input-row",children:[e.jsx("textarea",{className:"es-gaio__chat-input",rows:1,placeholder:t("gaio_coach.chat_placeholder"),value:m,onChange:a=>w(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),M())}}),e.jsx("button",{className:"es-gaio__chat-send",onClick:M,disabled:g||!m.trim(),children:g?"...":t("gaio_coach.chat_send")})]})]})]})})}export{U as Component,Q as manifest};
2
- //# sourceMappingURL=index-B97ASd4H-ZRnEJoQe.js.map
2
+ //# sourceMappingURL=index-C1Fa-E3e-ZRnEJoQe.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as i,j as e,Q as m}from"../nexly.js";const f={slug:"faq",name:"FAQ",version:"1.0.0",category:"content",requiredService:"knowledge-search",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},limit:{type:"number",default:10}}},defaultConfig:{readAloudEnabled:!1,limit:10},dataContract:{serviceSlug:"knowledge-search",inputSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{question:{type:"string"},answer:{type:"string"},category:{type:"string"}}}},total:{type:"number"}},required:["items"]},previewDataOverride:{items:[{question:"What is your return policy?",answer:"We accept returns within 30 days of purchase.",category:"Returns"},{question:"How long does shipping take?",answer:"Standard shipping takes 3-5 business days.",category:"Shipping"},{question:"Do you offer international shipping?",answer:"Yes, we ship to over 50 countries worldwide.",category:"Shipping"},{question:"How do I track my order?",answer:"You will receive a tracking link via email once your order ships.",category:"Orders"},{question:"Can I change or cancel my order?",answer:"Orders can be modified or cancelled within 1 hour of placement.",category:"Orders"}],total:5}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"limit",type:"range",label:"Number of FAQs",default:10,min:1,max:50,step:1,group:"Content"}],events:{emits:[{name:"faq:itemExpanded",description:"User expanded a FAQ item"},{name:"faq:itemCollapsed",description:"User collapsed a FAQ item"}],listens:[{name:"faq:refresh",description:"Reload FAQ content from service"}]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main","sidebar"]};function g({data:n,config:o,i18n:l}){const d=l?.t??(a=>a),t=n.items??o.items??[],[r,c]=i.useState(null),p=i.useCallback(a=>{c(s=>s===a?null:a)},[]);return e.jsx(m,{blockType:"faq",children:e.jsxs("div",{className:"es-block__body",children:[t.length===0&&e.jsx("div",{className:"es-block__empty",children:d("faq.empty")}),t.map((a,s)=>e.jsxs("div",{className:"es-faq__item",children:[e.jsxs("button",{className:"es-faq__question",onClick:()=>p(s),type:"button",children:[e.jsx("span",{children:a.question}),e.jsx("span",{className:"es-faq__chevron",children:r===s?"▲":"▼"})]}),r===s&&e.jsx("div",{className:"es-faq__answer",children:a.answer})]},s))]})})}export{g as Component,f as manifest};
2
- //# sourceMappingURL=index-CIFQrVkq-DUgMllqN.js.map
2
+ //# sourceMappingURL=index-C5RVj6y1-DUgMllqN.js.map