@nexlylab/widget 1.32.15 → 1.32.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/INSTALL.txt +1 -1
- package/dist/runtime/{1.32.15/chunks/ClickToLoadEmbed-CDdotCS8-W2yBrg7b.js → 1.32.17/chunks/ClickToLoadEmbed-D9eMaBG8-r9dN9klo.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/PanelInfoVideo-BKn3ucAb-BrU-Qlul.js → 1.32.17/chunks/PanelInfoVideo-DMU0-9Az-BrU-Qlul.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/assistant-link-components-MZWf5ty7-C44wlQAi.js → 1.32.17/chunks/assistant-link-components-D0uKk8Hv-xEDu0ls0.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/assistant-link-policy-DWaWTnGr-Cc-yj-a-.js → 1.32.17/chunks/assistant-link-policy-CogLpq-3-Cc-yj-a-.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/block-rating-DH7mp-_R-CoiP5C2K.js → 1.32.17/chunks/block-rating-BgOeTm52-CoiP5C2K.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/external-url-LRu_ntew-CJQjg_od.js → 1.32.17/chunks/external-url-ninK7gY9-CJQjg_od.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-BSoCdILD-D6wzHiS0.js → 1.32.17/chunks/index-1JK_DoDz-D6wzHiS0.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-DTVlG27U-DP0QKkgf.js → 1.32.17/chunks/index-B0-9mIbB-DP0QKkgf.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-BD-jPdzs-ZRnEJoQe.js → 1.32.17/chunks/index-B97ASd4H-ZRnEJoQe.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-Dh0aThiP-Aqz1AnQ5.js → 1.32.17/chunks/index-BDhTixUR-Aqz1AnQ5.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-D72orqXX-C_0Ll4qr.js → 1.32.17/chunks/index-BJxJr5j5-C_0Ll4qr.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-uM4Y0lxc-Dsa9X9U7.js → 1.32.17/chunks/index-BWMbr4oS-Dsa9X9U7.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-CNJUK2bK-C0OfCXUx.js → 1.32.17/chunks/index-Ba5nbqA8-B620AdXN.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-C6_8JGpJ-BqZmEVev.js → 1.32.17/chunks/index-BlGeDG8W-CoI3p0S7.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-Bu9Gh6Nc-BfWdQCT7.js → 1.32.17/chunks/index-Bl_8GpS0-CahNhEcx.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-Gi-3UOyp-DuzPeEIz.js → 1.32.17/chunks/index-BsUIWTU6-BQ7DWJhg.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-CwbUW6dx-BLBDoJCM.js → 1.32.17/chunks/index-ByEsnceF-CSQQTbsg.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-Czz6Gyh_-C3bBvEcm.js → 1.32.17/chunks/index-C5olj-Fr-C3bBvEcm.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-DP_6HfDM-DAdxCQyi.js → 1.32.17/chunks/index-CHUW1nlj-DAdxCQyi.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-DO0-ht8E-DUgMllqN.js → 1.32.17/chunks/index-CIFQrVkq-DUgMllqN.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-Dkv5YXXW-pkywvGDF.js → 1.32.17/chunks/index-CM0iRJSw-pkywvGDF.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-BylVnv7X-DBhSkJ7i.js → 1.32.17/chunks/index-CPjLHywY-DBhSkJ7i.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-csHaX5dv-BpgnWlB8.js → 1.32.17/chunks/index-CSDD7Z6C-BpgnWlB8.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-k-jZV_MQ-H31PHMqm.js → 1.32.17/chunks/index-C_zmepmr-H31PHMqm.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-B1ef1IlE-QeFj7CR9.js → 1.32.17/chunks/index-CaHbIY6I-QeFj7CR9.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-V1EfdiK7-bdo5pwX-.js → 1.32.17/chunks/index-Ce0ahORn-bdo5pwX-.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-DphwDFW6-C9wFr7fa.js → 1.32.17/chunks/index-CpCgmp7C-C9wFr7fa.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-DZKtK9hT-DQBGsPwB.js → 1.32.17/chunks/index-CtNAXlUH-DQBGsPwB.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-1o6W5wiJ-I68tb-d3.js → 1.32.17/chunks/index-D0qsMexH-I68tb-d3.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-B8aKMeg5-BLxOZxZv.js → 1.32.17/chunks/index-D30-Ox5Z-BLxOZxZv.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-qpVhJY7A-Cgivx3vY.js → 1.32.17/chunks/index-D3OBLy0s-k8E4HOBM.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-CMFQhtEe-BcW8HKb8.js → 1.32.17/chunks/index-D3fwWbIM-BcW8HKb8.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-DPNGQF5b-_M0CWPEY.js → 1.32.17/chunks/index-D5EHdeyl-_M0CWPEY.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-CqV8rHvG-DS9JaGVN.js → 1.32.17/chunks/index-D6YQ4lFv-pbKZ0WGs.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-C75hX_dj-VhJcCfAC.js → 1.32.17/chunks/index-DAJM_cb9-VhJcCfAC.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-CmYYEi7N-Dr1V6OGz.js → 1.32.17/chunks/index-DAai_PkG-Dr1V6OGz.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-BnKOhYKk-CkemNrch.js → 1.32.17/chunks/index-DDHI4Kxr-DrVjDDba.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-DDEE3QfX-3B-eE3K7.js → 1.32.17/chunks/index-DIMi29lU-3B-eE3K7.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-Dt6OpItC-R_xuAEQV.js → 1.32.17/chunks/index-DMM00SC5-R_xuAEQV.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-D9grn5WJ-Dp5AxBD4.js → 1.32.17/chunks/index-DnDMirl9-Dp5AxBD4.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-BvlAsO4n-DbuSZfeK.js → 1.32.17/chunks/index-DsQ3ssZW-DbuSZfeK.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-Chy2Zmo5-CiRb-0NX.js → 1.32.17/chunks/index-Dwtd4id8-CiRb-0NX.js} +1 -1
- package/dist/runtime/1.32.17/chunks/index-DzCfV77F-C1BzRUwZ.js +2 -0
- package/dist/runtime/{1.32.15/chunks/index-C1WD1dlq-Dm9kbc85.js → 1.32.17/chunks/index-DzHo_iNR-Dm9kbc85.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-IW3aNe-y-W1lJrIDD.js → 1.32.17/chunks/index-Wza_7CGb-W1lJrIDD.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-hHQjRGar-TEMHje2B.js → 1.32.17/chunks/index-_R8QyLD7-TEMHje2B.js} +1 -1
- package/dist/runtime/{1.32.15/chunks/index-D-ZhVFzi-A3rpkVmQ.js → 1.32.17/chunks/index-tapacGlG--YMQ21rc.js} +2 -2
- package/dist/runtime/{1.32.15/chunks/index-B9ozeox8-oy07dUaV.js → 1.32.17/chunks/index-zmuItIIf-oy07dUaV.js} +1 -1
- package/dist/runtime/1.32.17/nexly.js +61 -0
- package/dist/v1.js +1 -1
- package/package.json +1 -1
- package/dist/runtime/1.32.15/chunks/index-BljIlfbh-D9I6jaso.js +0 -2
- package/dist/runtime/1.32.15/nexly.js +0 -61
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/PanelVideoOverlay-BY__oBYV-B8OPC1xh.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/_commonjsHelpers-C6fGbg64-BC8KDfbh.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/accent-legibility-BJF2VO5n-CDPQ7suO.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/allowed-elements-BXnLJV1S-C-_lr2zm.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/block-helpers-Cg_zAqG6-DnN2COvk.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/index-BPDIV1BN-DINkyYvc.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/index-BcsmWDTX-Dw9WA5Ac.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/index-C262wwK4-DpyhuXqd.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/index-DMQkz1bV-BuMYksln.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/index-DZADUAKv-DPfvWVuj.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/index.modern-CioVZ357-BA5NTOmY.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/chunks/inert-assistant-components-B6Cx9pG5-DWb6n3Yq.js +0 -0
- /package/dist/runtime/{1.32.15 → 1.32.17}/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.
|
|
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>
|
|
@@ -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-
|
|
2
|
-
//# sourceMappingURL=ClickToLoadEmbed-
|
|
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,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-
|
|
3
|
+
//# sourceMappingURL=PanelInfoVideo-DMU0-9Az-BrU-Qlul.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as r}from"../nexly.js";import{u as s}from"./assistant-link-policy-
|
|
2
|
-
//# sourceMappingURL=assistant-link-components-
|
|
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,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-
|
|
2
|
+
//# sourceMappingURL=assistant-link-policy-CogLpq-3-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-
|
|
2
|
+
//# sourceMappingURL=block-rating-BgOeTm52-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-
|
|
2
|
+
//# sourceMappingURL=external-url-ninK7gY9-CJQjg_od.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{r as i,a as j,j as e,Q as B}from"../nexly.js";const z={slug:"auth-login",name:"User Login",version:"1.0.0",category:"interactive",requiredService:"",configSchema:{properties:{loginMethod:{type:"string",default:"password"},showGuestOption:{type:"boolean",default:!0},submitLabel:{type:"string",default:""}}},defaultConfig:{loginMethod:"password",showGuestOption:!0,submitLabel:""},dataContract:{serviceSlug:"chat-bot",inputSchema:{type:"object",properties:{authenticated:{type:"boolean"}}},previewDataOverride:{authenticated:!1}},fields:[{id:"loginMethod",type:"select",label:"Login method",default:"password",options:[{label:"Password",value:"password"},{label:"Magic Link",value:"magic-link"},{label:"Guest",value:"guest"}],group:"Behavior"},{id:"showGuestOption",type:"toggle",label:"Show guest login option",default:!0,group:"Behavior"},{id:"submitLabel",type:"localized-text",label:"Submit button label",default:"",placeholder:'Leave empty to use translated default (e.g. "Login")',group:"Content"}],events:{emits:[{name:"auth:login",description:"User successfully logged in — carries { user, accessToken }"},{name:"auth:loginFailed",description:"Login attempt failed"},{name:"auth:guestContinued",description:"User chose to continue as guest"}],listens:[{name:"auth:reset",description:"Reset the login form"}]},supportedPlacements:["main"],sizing:{minWidth:280,preferredHeight:"auto",scrollable:!1}};function L({config:u,actions:s,i18n:d}){const r=d?.t??(o=>o),h=d?.currentLanguage??"en",[p,m]=i.useState(""),[g,y]=i.useState(""),[b,v]=i.useState(""),[l,n]=i.useState(!1),[c,t]=i.useState(null),f=u.loginMethod??"password",x=u.showGuestOption??!0,w=j(u.submitLabel,h,{t:r,fallbackKey:"auth.login.submit",enDefault:"Login"});async function S(o){o.preventDefault(),n(!0),t(null);try{let a;f==="api_key"?a=await s.call("login",{apiKey:p}):a=await s.call("login",{email:g,password:b}),a?.error?t({error:a.error}):(s.emit("auth:login",{user:a.user,accessToken:a.accessToken}),t({success:!0,user:a?.user}))}catch{t({error:r("auth.login.error_failed")})}finally{n(!1)}}async function k(){n(!0),t(null);try{const o=await s.call("login",{guest:!0});o?.error?t({error:o.error}):(s.emit("auth:login",{user:o.user}),t({success:!0}))}catch{t({error:r("auth.login.error_guest_failed")})}finally{n(!1)}}return c?.success?null:e.jsx(B,{blockType:"auth-login",children:e.jsxs("div",{className:"es-block__body",style:{padding:16},children:[e.jsxs("form",{onSubmit:S,children:[f==="api_key"?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.login.api_key_label")}),e.jsx("input",{type:"text",value:p,onChange:o=>m(o.target.value),placeholder:"eu_live_...",required:!0,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",fontFamily:"monospace",boxSizing:"border-box"}})]}):e.jsxs(e.Fragment,{children:[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.email_label")}),e.jsx("input",{type:"email",value:g,onChange:o=>y(o.target.value),placeholder:r("auth.email_placeholder"),required:!0,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"}})]}),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.password_label")}),e.jsx("input",{type:"password",value:b,onChange:o=>v(o.target.value),placeholder:r("auth.password_placeholder"),required:!0,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"}})]})]}),c?.error&&e.jsx("div",{style:{fontSize:12,color:"var(--es-color-error, #AD2C26)",marginBottom:8},children:c.error}),e.jsx("button",{type:"submit",disabled:l,style:{width:"100%",padding:"10px 16px",borderRadius:6,border:"none",background:l?"var(--es-color-on-surface-muted, #4B5563)":"var(--es-color-primary, #2563EB)",color:"var(--es-color-on-primary, #ffffff)",fontSize:14,fontWeight:600,cursor:l?"wait":"pointer"},children:l?r("auth.login.submitting"):w})]}),x&&e.jsx("button",{type:"button",onClick:k,disabled:l,style:{width:"100%",marginTop:8,padding:"8px 16px",borderRadius:6,border:"1px solid var(--es-color-control-border, #6B7280)",background:"transparent",color:"var(--es-color-on-surface-muted, #4B5563)",fontSize:13,cursor:l?"wait":"pointer"},children:r("auth.gate.guest_cta")})]})})}export{L as Component,z as manifest};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
2
|
+
//# sourceMappingURL=index-1JK_DoDz-D6wzHiS0.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-
|
|
2
|
+
//# sourceMappingURL=index-B0-9mIbB-DP0QKkgf.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-
|
|
2
|
+
//# sourceMappingURL=index-B97ASd4H-ZRnEJoQe.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as w,r as t,j as e,Q as k}from"../nexly.js";const S={slug:"qa",name:"AI Q&A",version:"1.0.0",category:"interactive",requiredService:"ai-orchestrator",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},placeholder:{type:"string",default:""},maxQuestionsPerSession:{type:"number",default:5},responseLanguage:{type:"string",default:"en"}}},defaultConfig:{readAloudEnabled:!1,placeholder:"",maxQuestionsPerSession:5,responseLanguage:"en"},dataContract:{serviceSlug:"ai-orchestrator",inputSchema:{type:"object",properties:{answer:{type:"string",description:"AI answer to the user question"},question:{type:"string",description:"The question that was asked"}},required:["answer"]},previewDataOverride:{answer:"This product is made from 100% organic cotton and is machine washable. It comes in sizes XS-XXL.",question:"What materials is this made from?"}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"placeholder",type:"localized-text",label:"Input placeholder",default:"",placeholder:'Leave empty to use translated default (e.g. "Ask a question about this product...")',group:"Content"},{id:"maxQuestionsPerSession",type:"range",label:"Max questions per session",default:5,min:1,max:20,step:1,group:"Behavior"},{id:"responseLanguage",type:"select",label:"Response language",default:"en",options:[{label:"English",value:"en"},{label:"Korean",value:"ko"},{label:"Spanish",value:"es"},{label:"French",value:"fr"},{label:"German",value:"de"}],group:"Behavior"}],events:{emits:[{name:"qa:questionAsked",description:"User submitted a question"},{name:"qa:answerReceived",description:"AI answer received"}],listens:[{name:"qa:clear",description:"Clear Q&A history"}]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"]};function A({config:u,actions:h,i18n:m}){const s=m?.t??(a=>a),f=m?.currentLanguage??"en",x=w(u.placeholder,f,{t:s,fallbackKey:"qa.input_placeholder",enDefault:"Ask a question about this product..."}),i=u.maxQuestionsPerSession??5,[d,_]=t.useState(""),[o,v]=t.useState([]),[n,g]=t.useState(!1),[q,c]=t.useState(null),b=t.useRef(null),r=o.length>=i,p=t.useCallback(async()=>{const a=d.trim();if(!(!a||n||r)){g(!0),c(null);try{const l=await h.call("ask",{question:a,language:u.responseLanguage??"en"});l?.error?c(l.error):l?.answer?(v(j=>[...j,{question:a,answer:l.answer}]),_(""),setTimeout(()=>{b.current?.scrollIntoView({behavior:"smooth"})},50)):c(s("qa.error_no_answer"))}catch{c(s("qa.error_generic"))}finally{g(!1)}}},[d,n,r,h,u.responseLanguage]),y=t.useCallback(a=>{a.key==="Enter"&&(a.preventDefault(),p())},[p]);return e.jsxs(k,{blockType:"qa",children:[e.jsxs("div",{className:"es-block__body",children:[o.length===0&&!n&&e.jsx("div",{className:"es-block__empty es-qa__empty",children:s("qa.empty_state")}),o.length>0&&e.jsxs("div",{className:"es-qa__history",children:[o.map((a,l)=>e.jsxs("div",{className:"es-qa__entry",children:[e.jsxs("div",{className:"es-qa__question",children:[e.jsx("span",{className:"es-qa__question-label","aria-hidden":"true",children:"Q"}),e.jsx("span",{className:"es-qa__question-text",children:a.question})]}),e.jsxs("div",{className:"es-qa__answer",children:[e.jsx("span",{className:"es-qa__answer-label","aria-hidden":"true",children:"A"}),e.jsx("span",{className:"es-qa__answer-text",children:a.answer})]})]},l)),e.jsx("div",{ref:b})]}),q&&e.jsx("div",{className:"es-qa__error",role:"alert",children:q}),r&&e.jsx("div",{className:"es-qa__limit-notice",children:s("qa.limit_reached",{count:i})})]}),e.jsxs("div",{className:"es-block__footer",children:[e.jsxs("div",{className:"es-qa__input-row",children:[e.jsx("input",{className:"es-qa__input",type:"text",value:d,onChange:a=>_(a.target.value),onKeyDown:y,placeholder:r?s("qa.limit_reached",{count:i}):x,disabled:n||r,"aria-label":s("qa.input_aria_label")}),e.jsx("button",{className:"es-qa__btn",onClick:p,disabled:!d.trim()||n||r,type:"button","aria-label":s("qa.submit_aria_label"),children:s(n?"qa.loading":"qa.ask_button")})]}),i>0&&e.jsx("div",{className:"es-qa__counter",children:s("qa.counter",{used:o.length,max:i})})]})]})}export{A as Component,S as manifest};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
2
|
+
//# sourceMappingURL=index-BDhTixUR-Aqz1AnQ5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{r as l,j as e,Q as w}from"../nexly.js";import{S as z,I,L as T,j as W,_ as q,k as D,m as O}from"./index.modern-CioVZ357-BA5NTOmY.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";const Z={slug:"venue-map",name:"Venue Map",version:"1.0.0",category:"interactive",requiredService:"venue-discovery",configSchema:{properties:{zoom:{type:"number",default:13},showRadius:{type:"boolean",default:!0}}},defaultConfig:{zoom:13,showRadius:!0},dataContract:{serviceSlug:"venue-discovery",inputSchema:{type:"object",properties:{venues:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},category:{type:"string"},lat:{type:"number"},lng:{type:"number"},rating:{type:"number"},distanceKm:{type:"number"}}}},centerLat:{type:"number"},centerLng:{type:"number"},radiusKm:{type:"number"}},required:["venues"]},previewDataOverride:{venues:[{id:"v-1",name:"Blue Bottle Coffee",category:"cafe",lat:37.5172,lng:127.0473,rating:4.5,distanceKm:.3},{id:"v-2",name:"Coexartium Gallery",category:"gallery",lat:37.5118,lng:127.059,rating:4.2,distanceKm:.8},{id:"v-3",name:"Oakwood Premier COEX",category:"hotel",lat:37.5133,lng:127.0585,rating:4.7,distanceKm:1.1}],centerLat:37.515,centerLng:127.053,radiusKm:2}},fields:[{id:"zoom",type:"range",label:"Default zoom level",default:13,min:8,max:18,step:1,group:"Map"},{id:"showRadius",type:"toggle",label:"Show search radius circle",default:!0,group:"Display"}],events:{emits:[{name:"venueMap:markerClicked",description:"User clicked on a venue marker"},{name:"venueMap:viewChanged",description:"Map viewport moved or zoomed"}],listens:[{name:"venue:locationChanged",description:"Re-center map on new user location"},{name:"venues:refresh",description:"Reload venue pins on the map"}]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main"]},P={lat:37.5665,lng:126.978};let A=0;function F(){return e.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:[e.jsx("circle",{cx:"12",cy:"12",r:"3.5"}),e.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"5"}),e.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),e.jsx("line",{x1:"2",y1:"12",x2:"5",y2:"12"}),e.jsx("line",{x1:"19",y1:"12",x2:"22",y2:"12"})]})}function G(){return e.jsx("svg",{className:"es-venuemap__spinner",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:e.jsx("path",{d:"M12 3 a9 9 0 1 0 9 9",strokeLinecap:"round"})})}function H({open:i}){return e.jsx("svg",{className:`es-venuemap__chevron${i?" es-venuemap__chevron--open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}function $({data:i,i18n:x,actions:d}){const r=x?.t??(a=>a),L=x?.currentLanguage??i.language??"en",[m,M]=l.useState(null),[o,S]=l.useState(!0),[p,y]=l.useState(!1),v=l.useState(()=>`es-venue-map-body-${A++}`)[0],j=l.useRef(null),K=z(j,"--es-color-on-primary","#ffffff"),R=l.useCallback(()=>{d?.emit&&(y(!0),d.emit("geo:request",void 0))},[d]);l.useEffect(()=>{if(!d?.on)return;const a=d.on("geo:status",t=>{const c=t?.state;(c==="granted"||c==="denied"||c==="unavailable")&&y(!1)});return()=>a()},[d]);const h=i.venues??[],u=h.length,b=i.googleMapsApiKey,g=i.googleMapsMapId??void 0,B=!!g,s=l.useMemo(()=>h.map(a=>{const t=a.coordinates?.lat??a.lat,c=a.coordinates?.lng??a.lng;return typeof t=="number"&&typeof c=="number"?{...a,lat:t,lng:c}:null}).filter(a=>a!==null),[h]),E=l.useMemo(()=>{const a=i.center;return a&&typeof a.lat=="number"&&typeof a.lng=="number"?{lat:a.lat,lng:a.lng}:s.length>0?{lat:s[0].lat,lng:s[0].lng}:P},[i.center,s]),n=m!=null?s[m]??null:null,_=l.useCallback(a=>M(a),[]),f=r(o?"venue_map.hide_map":"venue_map.show_map"),k=r("venue_map.use_my_location"),N=e.jsxs("div",{className:"es-venuemap__bar",children:[e.jsx("button",{type:"button",className:"es-venuemap__locate",onClick:R,disabled:p,"aria-label":k,"aria-busy":p,title:k,children:p?e.jsx(G,{}):e.jsx(F,{})}),e.jsxs("button",{type:"button",className:"es-venuemap__toggle",onClick:()=>S(a=>!a),"aria-expanded":o,"aria-controls":v,"aria-label":f,children:[e.jsx("span",{className:"es-venuemap__toggle-label",children:f}),e.jsx(H,{open:o})]})]}),C=o?void 0:"es-venuemap--collapsed";return b?e.jsxs(w,{blockType:"venue-map",className:C,children:[e.jsx("div",{id:v,className:"es-block__body es-block__body--map",hidden:!o,ref:j,children:o&&e.jsxs(e.Fragment,{children:[e.jsx(I,{apiKey:b,language:L,children:e.jsx(T,{className:"es-venuemap__canvas",defaultCenter:E,defaultZoom:s.length>0?13:11,mapTypeControl:!1,fullscreenControl:!1,streetViewControl:!1,...g?{mapId:g}:{},children:s.map((a,t)=>B?e.jsx(W,{position:{lat:a.lat,lng:a.lng},title:a.name,onClick:()=>_(t),children:e.jsx(q,{background:t===m?"var(--es-color-interactive, #2563EB)":"var(--es-color-primary, #2563EB)",borderColor:D,glyphColor:K,scale:t===m?1.25:1})},t):e.jsx(O,{position:{lat:a.lat,lng:a.lng},title:a.name,onClick:()=>_(t)},t))})}),s.length>0&&u>s.length&&e.jsxs("div",{className:"es-venuemap__no-coords-badge",role:"note",children:[e.jsx("span",{"aria-hidden":"true",children:"📍"})," ",r("venue_map.partial_no_coords_badge",{count:u-s.length})]}),u>0&&s.length===0&&e.jsxs("div",{className:"es-venuemap__no-coords-overlay",role:"note",children:[e.jsx("div",{"aria-hidden":"true",children:"📍"}),e.jsx("div",{children:r("venue_map.no_coords_notice")})]}),n&&e.jsxs("div",{className:"es-venuemap__detail",role:"dialog","aria-label":n.name,children:[e.jsx("button",{type:"button",className:"es-venuemap__detail-close",onClick:()=>_(null),"aria-label":r("venue_map.close_details"),children:"×"}),e.jsx("h3",{className:"es-venuemap__detail-title",children:n.name}),e.jsxs("div",{className:"es-venuemap__detail-meta",children:[n.rating!=null&&e.jsxs("span",{className:"es-venuemap__detail-meta-item",children:["★"," ",n.rating.toFixed(1)]}),(n.type||n.types?.[0])&&e.jsx("span",{className:"es-venuemap__detail-meta-item",children:n.type??n.types?.[0]})]}),n.address&&e.jsx("div",{className:"es-venuemap__detail-address",children:n.address}),n.url&&e.jsxs("a",{href:n.url,className:"es-venuemap__detail-cta",target:"_blank",rel:"noopener noreferrer",children:[r("venue_list.view_details")," →"]})]})]})}),N]}):e.jsxs(w,{blockType:"venue-map",className:C,children:[e.jsx("div",{id:v,className:"es-block__body",hidden:!o,children:e.jsxs("div",{className:"es-map-placeholder",children:[e.jsx("div",{className:"es-map-placeholder__icon","aria-hidden":"true",children:"🗺"}),e.jsx("div",{className:"es-map-placeholder__message",children:r("venue_map.no_api_key")}),u>0&&e.jsx("div",{className:"es-map-placeholder__count",children:r("venue_map.venues_available",{count:u})}),e.jsx("div",{className:"es-map-placeholder__hint",children:r("venue_map.use_list_hint")})]})}),N]})}export{$ as Component,Z as manifest};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
2
|
+
//# sourceMappingURL=index-BJxJr5j5-C_0Ll4qr.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-
|
|
2
|
+
//# sourceMappingURL=index-BWMbr4oS-Dsa9X9U7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as F,j as a,Q as Z,
|
|
1
|
+
import{r as F,j as a,Q as Z,d as oe}from"../nexly.js";import{C as He}from"./block-rating-BgOeTm52-CoiP5C2K.js";import{m as b}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";import{j as ve}from"./PanelInfoVideo-DMU0-9Az-BrU-Qlul.js";const Ve=se([["!","ǃⵑ"],[":","ː˸։׃܃܄ःઃ᛬᠃᠉⁚∶ꓽ꞉"],["<","˂ᐸᚲ‹❮𝈶"],["<<","≪"],["<<<","⋘"],["a","ɑαаᗅ⍶⍺ꓮꭺ𐊠𖽀"],["aa","ꜳ"],["ae","æӕ"],["ao","ꜵ"],["ar","🜇"],["au","ꜷ"],["c","¢ȼςϛсҫငၚᴄ₡ⲋⲥꓚꮯ𐊢𐌂𐐽𐔜𑣩𑣲🅮🝌"],["cc","🅭"],["d","ðđƌɖɗԁᑯᗞᗪ₫ꓒꓓꭰꮷ"],["e","ɇεеҽҿ℮⋿ⴹꓰꬲꭼ𐊆𑣆𑣎"],["g","ƍǥɠɡԍցᏻᶃꓖꮐ"],["h","ħɦнћңһӈӊհᏺᕼⱨⲏꓧꚕꮋꮒ𐋏𐓵"],["i","ıɨɩɪιіւᵻᵼ⍳⍸ⲓꙇꭵ𑣃"],["k","ƙκкқҟᛕ₭ⱪⲕꓗꝁꮶ𐔘"],["l","1|łƚǀɫɭӏ׀וןا١ٳ۱ߊᒪᛁ∣⏽│┃ⳑⵏꓡꓲꮮ𐊊𐌉𐌠𐑃𐔦𑣒𖼖𖼨𝈪𞣇"],["ll","ǁװ‖∥𐆙"],["lls","𐆘"],["lo","ю⏨"],["ls","ʪ"],["lt","₶"],["n","ŋƞɲɳηνղոռበᑎᵰ∩⋂ⲛꓠꓵ𐆎𐔓𝉅"],["o","0øɵθοσϭоѳөօסه٥ھہە۵ۿ߀०০੦૦ଠ୦௦ం౦ಂ೦ംഠ൦ං๐໐ဝ၀ჿዐ០ᴏᴑ⊖⊝⍬ⲑⲟⴱⵁⵔ〇ꓳꝋꬽꬾꭴꮎꮻ𐊒𐊫𐐬𐓪𐔖𑓐𑣈𑣕𑣗𑣠𝈚🜔"],["oe","œ"],["oo","∞ꚙꝏ"],["p","þƥƿρϸрᑭᵽ⍴ⲣⳏꓑꮲ𐊕𐓬"],["q","ʠԛգզⵕ"],["qe","🜀"],["r","ɍɼɽʀгғᖇᴦᵲⲅꓣꭇꭈꭱꮁꮢ𐓜𖼵𝈖"],["rn","mɱμϻмӎᗰᛖᵯ₥ⲙꓟꮇ𐊰𐌑𑜀𑣣"],["s","ƽʂѕտടᵴꓢꜱꮥꮪ𐊖𐑈𑣁𖼺"],["sss","🝜"],["t","ŧƭʈτтҭᵵ₮⊤⍡⟙ⱦⲧꓔꭲ𐊗𐊱𐌕𑣜𖼊🝨"],["ts","ʦ"],["u","ʉʋυџսሀᑌᴜᵾ∪⋃ꓴꞟꭎꭒꮜ𐓶𑣘𖽂"],["ue","ᵫ"],["uo","ꭣ"],["w","ɯшѡѽԝաᗯᴡ₩ⲽꓪꝡꮃꮗꮤ𑓅𑜊𑜎𑜏𑣦𑣯𝈢"]]),Ue=se([["h","Η"],["l","ƖƗΙІⲒ𑢣"]]),We=se([["c","Ϲ"]]),Be=new Set([..."˗۔⁃∸➖⨩⨪ⲲⲳⲺⲻ﬩~"]);function se(r){const t=new Map;for(const[e,o]of r)for(const i of o)t.set(i,e);return t}const pe=7e3,we=80;function xe(r){return r.length<=we?r:`${r.slice(0,we-1).trimEnd()}…`}function ie(r){if(typeof r!="string")return"";const t=r.replace(/\p{Cc}/gu," ").replace(/[\p{Cf}\p{Default_Ignorable_Code_Point}]/gu,"").replace(/\s+/g," ").trim();return t?xe(t):""}function Fe(r){return typeof r!="string"?"":ie(ce(r))}function v(r){return r.length<=pe?r:`${r.slice(0,pe-1).trimEnd()}…`}function S(r,t){return r==null?t("network_growth.gaio.a_member"):ie(ce(r))||t("network_growth.gaio.a_member")}function m(r){return xe(ce(r))}const fe={citizensWithRank:"network_growth.gaio.gap.citizens",binaryTreeRank:"network_growth.gaio.gap.binary",totalTreeVolume:"network_growth.gaio.gap.volume",personalPoints:"network_growth.gaio.gap.points",personalPurchase:"network_growth.gaio.gap.purchase"};function x(r,t){const e=r.next_target_rank?t("network_growth.gaio.leader",{rank:m(r.current_rank),next:m(r.next_target_rank)}):t("network_growth.gaio.leader_top",{rank:m(r.current_rank)}),o=r.binding_constraint;if(!o)return e;const i=t("network_growth.gaio.leader_gap",{gap:t(fe[o.type]),current:o.current,required:o.required});return`${e} ${i}`}function ye(r,t){const e=r.next_rank?t("network_growth.gaio.cand_path",{name:S(r.display_name,t),rank:m(r.current_rank),next:m(r.next_rank)}):t("network_growth.gaio.cand_path_max",{name:S(r.display_name,t),rank:m(r.current_rank)}),o=[];return r.is_tree_branch_qualifier&&o.push(t("network_growth.gaio.flag_branch")),r.is_binary_qualifier&&o.push(t("network_growth.gaio.flag_binary")),r.paid_rank_decay_risk&&o.push(t("network_growth.gaio.flag_decay")),o.length===0?e:`${e} ${t("network_growth.gaio.cand_why",{reasons:o.join("; ")})}`}const V={defend_citizen:"network_growth.t2.reason.defend_citizen",promotes_to_citizen:"network_growth.t2.reason.promotes_to_citizen",existing_citizen:"network_growth.t2.reason.existing_citizen",complete_leg:"network_growth.t2.reason.complete_leg",reengage:"network_growth.t2.reason.reengage",grow_volume:"network_growth.t2.reason.grow_volume"};function Qe(r,t,e,o){switch(r){case"defend_citizen":return o(V.defend_citizen,{rank:m(t.citizen_rank_type??e),payout_rank:m(t.payout_rank??"")});case"promotes_to_citizen":return o(V.promotes_to_citizen,{rank:m(t.citizen_rank_type??""),count:t.citizens_gap??0});case"existing_citizen":return o(V.existing_citizen,{rank:m(t.rank??e)});case"complete_leg":return o(V.complete_leg,{leg:o(`network_growth.leg.${t.leg??"balanced"}`)});case"reengage":return o(V.reengage);default:return o(V.grow_volume)}}function je(r,t){const e=r.next_rank?t("network_growth.gaio.cand_path",{name:S(r.display_name,t),rank:m(r.current_rank),next:m(r.next_rank)}):t("network_growth.gaio.cand_path_max",{name:S(r.display_name,t),rank:m(r.current_rank)}),o=Qe(r.reason_code,r.reason_params,r.current_rank,t);return`${e} ${t("network_growth.gaio.cand_why",{reasons:o})}`}function Ye(r,t){const e=r.recommendations;if(e.length===0)return v(x(r.leader,t));const o=e.map((i,l)=>`${l+1}. ${i.title}. ${i.detail}`);return v(`${x(r.leader,t)}
|
|
2
2
|
|
|
3
3
|
${t("network_growth.gaio.support_list")}
|
|
4
4
|
${o.join(`
|
|
@@ -47,4 +47,4 @@ ${i.join(`
|
|
|
47
47
|
${k}`,autoSend:!1,quickChips:G??[{label:n("network_growth.chip.approach"),message:n("network_growth.chip.approach_msg"),autoSend:!0},{label:n("network_growth.chip.message"),message:n("network_growth.chip.message_msg"),autoSend:!0},{label:n("network_growth.chip.why"),message:n("network_growth.chip.why_msg"),autoSend:!0},{label:n("network_growth.chip.other"),message:"",autoSend:!1}]})},[t,n]),C=F.useCallback(s=>{const k=$e(s,n);if(k===null||!g)return;const G=dt[s.key],H=G?.(g,n);t.emit("chat:draft",{message:H?`${k}
|
|
48
48
|
|
|
49
49
|
${H}`:k,autoSend:!0})},[t,n,g]),L=F.useCallback((s,k)=>{f(s,k,[{label:n("network_growth.chip.plan_first"),message:n("network_growth.chip.plan_first_msg"),autoSend:!0},{label:n("network_growth.chip.plan_fastest"),message:n("network_growth.chip.plan_fastest_msg"),autoSend:!0},{label:n("network_growth.chip.other"),message:"",autoSend:!1}])},[f,n]);if(!g||g.contract_version!=="2.0"&&g.contract_version!=="3.0"){if(r.error)return a.jsx(Z,{blockType:"network-growth",children:a.jsx("div",{className:"ng2",children:a.jsx("p",{className:"ng2__error",children:n("network_growth.error")})})});const s=e?.dataQuality,k=s!=="none"&&!!r&&Object.keys(r).some(Ge=>!Ge.startsWith("_"));let G="🌱",H=n("network_growth.empty.loading");return s==="none"?H=n("network_growth.empty.sign_in"):k&&(G="🔄",H=n("network_growth.empty.stale")),a.jsx(Z,{blockType:"network-growth",children:a.jsxs("div",{className:"ng2 ng2--empty",children:[a.jsx("div",{className:"ng2__empty-icon","aria-hidden":"true",children:G}),a.jsx("p",{className:"ng2__empty-text",children:H})]})})}const{leader:h,tiles:I,recommendations:j,context_size:Y,digest_v3:z}=g,{cascade_potential:p,at_risk:w,binary_placement:c,structure_summary:u,earning_levers:q}=I;if(z)return a.jsx(Ot,{out:g,digestV3:z,t:n,hasChatView:y,handleTalkToGaio:f,handleAskGaio:C,handlePlanWithGaio:L,sectionRating:N,actions:t,baseUrl:l,apiKey:i?.apiKey});const T=n("network_growth.a11y.expand"),P=n("network_growth.a11y.collapse"),ee=n("network_growth.talk_to_gaio"),O=(s,k)=>({text:n(`network_growth.${s}.help`),ariaLabel:n("network_growth.help_aria",{title:n(k)})}),U=(s,k)=>s?.title?.trim()||k,W=(s,k)=>s?.teaser?.trim()||k,te=s=>le(s,n),Ee=s=>s.cascade_reason_code?Se(s.cascade_reason_code,s.cascade_reason_params??{},s.current_rank,n):s.cascade_reason,D=(s,k)=>y?{label:ee,onClick:()=>f(s,k)}:void 0,_e=j[0],Te=_e?_e.teaser:n("network_growth.t3.empty_teaser"),ge=h.path_to_next_rank??[],A=b(h.mode==="defend"?h.defend_target_rank??h.current_rank:h.next_target_rank??h.current_rank,n),re=h.mode==="defend"?n("network_growth.tpath.move_title_defend",{rank:A}):n("network_growth.tpath.move_title_advance",{rank:A}),B=h.binding_constraint??ge.find(s=>!s.met)??null,de=B?h.mode==="defend"?n("network_growth.tpath.move_advice_defend",{rank:A,dimension:n(St[B.type])}):n(`network_growth.tpath.move_advice.${B.type}`,{rank:A,gap:E(Math.max(0,B.required-B.current))}):n("network_growth.tpath.move_all_met",{rank:A}),Pe=h.mode==="defend"?n("network_growth.tpath.move_intro_defend",{rank:A}):n("network_growth.tpath.move_intro_advance",{rank:A}),Re=h.mode==="defend"?n("network_growth.tpath.move_cta_defend",{rank:A}):n("network_growth.tpath.move_cta_advance",{rank:A}),Me=p.cascade_candidates.length>0?n("network_growth.t2.teaser",{count:p.cascade_candidates.length}):n("network_growth.t2.teaser_empty"),Ie=w.re_activatable_count>0?n("network_growth.t4.teaser_reactivatable",{count:w.members.length,reactivatable:w.re_activatable_count}):n("network_growth.t4.teaser",{count:w.members.length}),Oe=n("network_growth.t7.teaser",{count:c.imbalanced_members.length,usd:E(c.estimated_total_weekly_usd_lost)}),De=n("network_growth.t8.teaser",{active:u.active_purchasing_count_30d,paid:u.active_paid_rank_count}),Ke=n("network_growth.t6.teaser",{count:q.scp2_active_members.length,levels:q.scp2_levels_unlocked}),he=c.top5_by_cycle_loss.length>0?c.top5_by_cycle_loss:c.imbalanced_members,K=u.team_binary_force,R=u.structure_expansion_gap;return a.jsx(Z,{blockType:"network-growth",children:a.jsxs("div",{className:`ng2 ng2--${Y}`,children:[a.jsx("div",{className:"ng2__icon-row",children:a.jsx(ve,{panelKey:"network-growth",baseUrl:l,apiKey:i?.apiKey,t:n})}),h.grace_period_ranks.length>0&&a.jsxs("div",{className:"ng2__grace",role:"alert",children:[a.jsx("span",{"aria-hidden":"true",children:"⚠️"}),a.jsx("span",{children:n("network_growth.grace_banner",{rank:h.grace_period_ranks[0]?b(h.grace_period_ranks[0],n):""})})]}),ge.length>0&&a.jsxs(M,{id:"path",title:re,teaser:de,defaultOpen:!0,expandLabel:T,collapseLabel:P,help:{text:n("network_growth.tpath.move_help"),ariaLabel:n("network_growth.help_aria",{title:re})},gaio:y?{label:Re,onClick:()=>f(re,at(g,n))}:void 0,rating:N("path"),children:[a.jsx("p",{className:"ng-path-intro",children:Pe}),a.jsx("p",{className:"ng-path-advice",children:de})]}),a.jsx(M,{id:"support",title:n("network_growth.t3.title"),teaser:Te,defaultOpen:!0,expandLabel:T,collapseLabel:P,help:O("t3","network_growth.t3.title"),gaio:j.length>0?void 0:D(n("network_growth.t3.title"),Ye(g,n)),rating:N("support"),children:j.length===0?a.jsx("p",{className:"ng-empty-note",children:n("network_growth.t3.empty")}):a.jsx("ul",{className:"ng-rec-list",children:j.map(s=>a.jsxs("li",{className:"ng-rec",children:[a.jsxs("div",{className:"ng-rec__head",children:[a.jsx("span",{className:`ng-badge ng-badge--${s.tier.toLowerCase()}`,children:n(Tt[s.tier])}),a.jsx("span",{className:"ng-rec__title",children:s.title})]}),a.jsx("p",{className:"ng-rec__detail",children:s.detail}),y&&a.jsx(Q,{label:ee,onClick:()=>f(s.title,Ne(g,s,n))})]},s.id))})}),p.visible&&a.jsxs(M,{id:"cascade",title:U(p.narrative,n("network_growth.t2.title")),teaser:W(p.narrative,Me),narrativeDetail:p.narrative?.detail,expandLabel:T,collapseLabel:P,help:O("t2","network_growth.t2.title"),gaio:p.cascade_candidates.length>0?void 0:D(n("network_growth.t2.title"),Xe(g,n)),rating:N("cascade"),children:[a.jsx(be,{binary:p.binary_qualification_gap,branch:p.tree_branch_coverage,t:n}),p.rank_elevation_candidates_count>0&&a.jsx("p",{className:"ng-aggregate",children:n("network_growth.t2.elevation",{count:p.rank_elevation_candidates_count,high:p.high_cascade_count})}),p.cascade_candidates.length===0?a.jsx("p",{className:"ng-empty-note",children:n("network_growth.t2.empty")}):a.jsx("ul",{className:"ng-cand-list",children:p.cascade_candidates.map(s=>a.jsxs("li",{className:`ng-cand${s.is_defend_priority?" ng-cand--defend":""}`,children:[a.jsx("div",{className:"ng-cand__top",children:a.jsx("span",{className:"ng-cand__name",children:$(s.display_name,s.user_id)})}),a.jsxs("div",{className:"ng-cand__rank",children:[b(s.current_rank,n),s.next_rank?` → ${b(s.next_rank,n)}`:""]}),(s.is_binary_qualifier||s.is_tree_branch_qualifier||s.paid_rank_decay_risk)&&a.jsxs("div",{className:"ng-cand__chips",children:[s.is_binary_qualifier&&a.jsx("span",{className:"ng-chip ng-chip--qualifier",children:n("network_growth.t2.chip.binary_qualifier")}),s.is_tree_branch_qualifier&&a.jsx("span",{className:"ng-chip ng-chip--qualifier",children:n("network_growth.t2.chip.branch_qualifier")}),s.paid_rank_decay_risk&&a.jsx("span",{className:"ng-chip ng-chip--decay",children:n("network_growth.t2.chip.decay_risk")})]}),a.jsx("p",{className:"ng-cand__reason",children:Ee(s)}),y&&a.jsx(Q,{label:ee,onClick:()=>f(n("network_growth.t2.gaio_headline",{name:$(s.display_name,s.user_id)}),Je(g,s,n))})]},s.user_id))}),p.aggregated_stats&&a.jsx("p",{className:"ng-aggregate",children:n("network_growth.t2.aggregate",{active:p.aggregated_stats.active_count,total:p.total_members})})]}),w.visible&&w.members.length>0&&a.jsxs(M,{id:"atrisk",title:U(w.narrative,n("network_growth.t4.title")),teaser:W(w.narrative,Ie),narrativeDetail:w.narrative?.detail,expandLabel:T,collapseLabel:P,help:O("t4","network_growth.t4.title"),gaio:D(n("network_growth.t4.title"),Ze(g,n)),rating:N("atrisk"),children:[(w.paid_rank_expiry_warnings>0||w.weekly_points_lost_to_dormancy>0)&&a.jsxs("div",{className:"ng-atrisk-summary",children:[w.paid_rank_expiry_warnings>0&&a.jsx("span",{className:"ng-chip ng-chip--urgent",children:n("network_growth.t4.expiry_warning",{count:w.paid_rank_expiry_warnings})}),w.weekly_points_lost_to_dormancy>0&&a.jsx("span",{className:"ng-atrisk-summary__lost",children:n("network_growth.t4.points_lost",{points:w.weekly_points_lost_to_dormancy})})]}),a.jsx("ul",{className:"ng-risk-list",children:w.members.map(s=>a.jsxs("li",{className:`ng-risk ng-risk--${Et[s.severity]}`,children:[a.jsx("span",{className:"ng-risk__dot","aria-hidden":"true"}),a.jsxs("div",{className:"ng-risk__info",children:[a.jsx("span",{className:"ng-risk__name",children:$(s.display_name,s.user_id)}),a.jsx("span",{className:"ng-risk__signal",children:n(`network_growth.signal.${s.signal.toLowerCase()}`)}),s.is_reactivatable&&s.paid_rank_grace_expires_in_days!==null&&a.jsx("span",{className:"ng-risk__grace",children:n("network_growth.t4.grace_expires",{days:s.paid_rank_grace_expires_in_days})})]}),a.jsxs("span",{className:"ng-risk__tags",children:[s.is_reactivatable&&a.jsx("span",{className:"ng-chip ng-chip--reactivate",children:n("network_growth.t4.reactivatable_badge")}),s.is_counted_citizen&&a.jsx("span",{className:"ng-risk__flag",children:n("network_growth.t4.counts")})]})]},s.user_id))})]}),c.visible&&he.length>0&&a.jsxs(M,{id:"placement",title:U(c.narrative,n("network_growth.t7.title")),teaser:W(c.narrative,Oe),narrativeDetail:c.narrative?.detail,expandLabel:T,collapseLabel:P,help:O("t7","network_growth.t7.title"),gaio:D(n("network_growth.t7.title"),et(g,n)),rating:N("placement"),children:[a.jsx("p",{className:"ng-aggregate",children:n("network_growth.t7.totals",{watch:c.imbalanced_count_watch,critical:c.imbalanced_count_critical})}),c.auto_placement_risk.flagged&&a.jsx("div",{className:"ng-placement-warn",role:"note",children:n("network_growth.t7.autoplace_warning",{side:te(c.auto_placement_risk.dominant_leg??"none")})}),a.jsx("ul",{className:"ng-cand-list",children:he.map(s=>a.jsxs("li",{className:`ng-place ng-place--${s.severity}`,children:[a.jsxs("div",{className:"ng-cand__top",children:[a.jsx("span",{className:"ng-cand__name",children:$(s.display_name,s.user_id)}),a.jsx("span",{className:`ng-chip ng-chip--sev-${s.severity}`,children:n(`network_growth.t7.severity.${s.severity}`)})]}),a.jsx("div",{className:"ng-cand__rank",children:n("network_growth.t7.member_ratio",{ratio:ke(s.generation_ratio),side:te(s.dominant_side)})}),s.cycles_lost_lifetime_estimate>0&&a.jsx("p",{className:"ng-cand__reason",children:n("network_growth.t7.member_loss",{cycles:s.cycles_lost_lifetime_estimate,usd:E(s.usd_lost_lifetime_upper_bound)})})]},s.user_id))}),a.jsx("p",{className:"ng-disclaimer",children:n("network_growth.t7.estimate_disclaimer")})]}),a.jsxs(M,{id:"structure",title:U(u.narrative,n("network_growth.t8.title")),teaser:W(u.narrative,De),narrativeDetail:u.narrative?.detail,expandLabel:T,collapseLabel:P,help:O("t8","network_growth.t8.title"),gaio:D(n("network_growth.t8.title"),tt(g,n)),rating:N("structure"),children:[a.jsxs("div",{className:"ng-stats",children:[a.jsx(J,{value:E(u.active_purchasing_count_30d),label:n("network_growth.t8.active_buyers")}),a.jsx(J,{value:E(u.builders_count),label:n("network_growth.t8.builders")}),a.jsx(J,{value:E(u.active_paid_rank_count),label:n("network_growth.t8.active_paid")}),a.jsx(J,{value:E(u.reactivatable_paid_rank_count),label:n("network_growth.t8.reactivatable_paid")})]}),a.jsxs("div",{className:`ng-binforce ng-binforce--${K.balance_status}`,children:[a.jsx("span",{className:"ng-binforce__dot","aria-hidden":"true"}),a.jsx("span",{children:K.dominant_side==="balanced"?n("network_growth.t8.binary_force_balanced",{status:n(`network_growth.t8.balance.${K.balance_status}`)}):n("network_growth.t8.binary_force",{ratio:ke(K.ratio),side:te(K.dominant_side),status:n(`network_growth.t8.balance.${K.balance_status}`)})})]}),R&&a.jsxs("div",{className:"ng-expansion",children:[a.jsx("div",{className:"ng-expansion__title",children:n("network_growth.t8.expansion_title",{rank:b(R.next_normal_rank_target,n)})}),a.jsx(be,{binary:R.binary_gap,branch:R.tree_branch_gap,t:n}),a.jsx("p",{className:"ng-aggregate",children:R.scp2_uncovered_levels>0?n("network_growth.t8.scp2_uncovered",{levels:R.scp2_uncovered_levels,cycles:R.scp2_cycles_per_month_locked}):n("network_growth.t8.scp2_covered")})]})]}),q.visible&&a.jsxs(M,{id:"levers",title:U(q.narrative,n("network_growth.t6.title")),teaser:W(q.narrative,Ke),narrativeDetail:q.narrative?.detail,expandLabel:T,collapseLabel:P,help:O("t6","network_growth.t6.title"),gaio:D(n("network_growth.t6.title"),rt(g,n)),rating:N("levers"),children:[q.scp2_active_members.length>0?a.jsx("ul",{className:"ng-lever-list",children:q.scp2_active_members.map(s=>a.jsxs("li",{className:"ng-lever",children:[a.jsx("span",{className:"ng-lever__name",children:$(s.display_name,s.user_id)}),a.jsxs("span",{className:"ng-lever__meta",children:[n("network_growth.t6.level",{level:s.position})," · ",Ae(s.team_sales)]})]},s.user_id))}):a.jsx("p",{className:"ng-empty-note",children:n("network_growth.t6.empty")}),q.scp3_direct_referrals.length>0&&a.jsx("p",{className:"ng-aggregate",children:n("network_growth.t6.referrals",{count:q.scp3_direct_referrals.length})})]})]})})}function Ot({out:r,digestV3:t,t:e,hasChatView:o,handleTalkToGaio:i,handleAskGaio:l,handlePlanWithGaio:d,sectionRating:_,actions:n,baseUrl:y,apiKey:N}){const{leader:g,context_mode:f,recommendations:C}=r,L=f.is_onboarding,h=L?"onboarding":g.mode,I=L?e("network_growth.v4.hero.onboarding_headline"):h==="defend"?e("network_growth.v4.hero.defend_headline",{rank:b(g.defend_target_rank??g.current_rank,e)}):e("network_growth.v4.hero.advance_headline",{rank:b(g.next_target_rank??g.current_rank,e)}),j=e(L?"network_growth.v4.hero.cta_onboarding":h==="defend"?"network_growth.v4.hero.cta_defend":"network_growth.v4.hero.cta_advance"),Y=L?It(f.member_count,f.has_binary_data,f.leader_has_paid_rank,e):null,z=c=>t.suggested_questions.filter(u=>u.section===c).slice(0,2),p=t.top_candidates.filter(c=>!C.some(u=>u.target_member?.user_id===c.user_id)),w=r.tiles.at_risk.members.find(c=>c.is_reactivatable&&c.has_active_substructure);return a.jsx(Z,{blockType:"network-growth",children:a.jsxs("div",{className:`ng4 ng4--${h}`,children:[a.jsx("div",{className:"ng4__icon-row",children:a.jsx(ve,{panelKey:"network-growth",baseUrl:y,apiKey:N,t:e})}),a.jsxs("section",{className:`ng4-hero ng4-hero--${h}`,children:[a.jsx("p",{className:"ng4-hero__headline",children:I}),r.hero_reason&&a.jsx("p",{className:"ng4-hero__reason",children:r.hero_reason}),Y&&a.jsx("ol",{className:"ng4-hero__milestones",children:Y.map((c,u)=>a.jsxs("li",{className:`ng4-hero__milestone${c.done?" ng4-hero__milestone--done":""}`,children:[a.jsx("span",{className:"ng4-hero__milestone-dot","aria-hidden":"true"}),c.label]},u))}),o&&a.jsxs("button",{type:"button",className:"ng4-hero__cta",onClick:()=>d(j,ot(r,e)),children:[a.jsx(oe,{size:16,className:"ng4-hero__cta-owl"}),j]}),_("hero")]}),t.insights.length>0&&a.jsxs("section",{className:"ng4-section ng4-insights",children:[a.jsx("h3",{className:"ng4-section__title",children:e("network_growth.v4.insights.title")}),a.jsx("ul",{className:"ng4-insight-list",children:t.insights.map((c,u)=>a.jsx("li",{className:`ng4-insight ng4-insight--${c.severity}`,children:Mt(c,e)},u))}),o&&a.jsx(X,{questions:z("branches").concat(z("structure"),z("overview")).slice(0,2),onAsk:l,t:e}),_("insights")]}),t.hidden_leaders.length>0&&a.jsxs("section",{className:"ng4-section ng4-hidden",children:[a.jsx("h3",{className:"ng4-section__title",children:e("network_growth.v4.hidden.title")}),a.jsx("ul",{className:"ng4-hidden-list",children:t.hidden_leaders.map(c=>a.jsxs("li",{className:"ng4-hidden-row",children:[a.jsxs("div",{className:"ng4-hidden-row__info",children:[a.jsx("span",{className:"ng4-hidden-row__name",children:$(c.display_name,c.user_id)}),a.jsx("span",{className:"ng4-hidden-row__meta",children:b(c.rank,e)}),a.jsxs("span",{className:"ng4-hidden-row__caption",children:[c.team_sales>0&&a.jsxs(a.Fragment,{children:[e("network_growth.v4.hidden.team_sales",{sales:Ae(c.team_sales)})," · "]}),e("network_growth.t6.level",{level:c.height})]})]}),o&&a.jsx("button",{type:"button",className:"ng4-hidden-row__cta",onClick:()=>i(e("network_growth.v4.hidden.topic",{name:$(c.display_name,c.user_id)}),it(r,c,e)),children:e("network_growth.v4.hidden.cta")})]},c.user_id))}),o&&a.jsx(X,{questions:z("hidden_leaders"),onAsk:l,t:e}),_("hidden_leaders")]}),a.jsxs("section",{className:"ng4-section ng4-coach",children:[a.jsx("h3",{className:"ng4-section__title",children:e("network_growth.v4.coach.title")}),C.length===0&&p.length===0?a.jsx("p",{className:"ng-empty-note",children:e("network_growth.t3.empty")}):a.jsxs("ul",{className:"ng4-coach-list",children:[C.map(c=>a.jsxs("li",{className:"ng4-coach-item",children:[a.jsx("p",{className:"ng4-coach-item__reason",children:c.detail}),o&&a.jsx(Q,{label:e("network_growth.v4.coach.cta"),onClick:()=>i(c.title,Ne(r,c,e))})]},c.id)),p.map(c=>a.jsxs("li",{className:"ng4-coach-item",children:[a.jsx("span",{className:"ng4-coach-item__name",children:$(c.display_name,c.user_id)}),a.jsx("p",{className:"ng4-coach-item__reason",children:r.candidate_notes?.[c.user_id]??Se(c.reason_code,c.reason_params??{},c.current_rank,e)}),o&&a.jsx(Q,{label:e("network_growth.v4.coach.cta"),onClick:()=>i(e("network_growth.t2.gaio_headline",{name:$(c.display_name,c.user_id)}),nt(r,c,e))})]},c.user_id))]}),o&&a.jsx(X,{questions:z("cascade"),onAsk:l,t:e}),_("coach")]}),t.segments.reactivation_pool_count>0&&a.jsxs("section",{className:"ng4-section ng4-reactivation",children:[a.jsx("p",{className:"ng4-reactivation__sentence",children:w?e("network_growth.v4.reactivation.sentence_named",{name:$(w.display_name,w.user_id)}):e("network_growth.v4.reactivation.sentence")}),o&&a.jsx(X,{questions:z("reactivation"),onAsk:l,t:e}),_("reactivation")]})]})})}const Ut={slug:"network-growth",name:"Network Growth Tracker",version:"2.0.0",category:"interactive",requiredService:"network-growth",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1}}},defaultConfig:{readAloudEnabled:!1},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"}],sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"network-growth",inputSchema:{type:"object",properties:{contract_version:{type:"string"},context_size:{type:"string"},leader:{type:"object"},tiles:{type:"object"},recommendations:{type:"array"},context_mode:{type:"object"},digest_v3:{type:"object"}},required:["contract_version","leader","tiles","recommendations"]}},events:{emits:[{name:"chat:draft",description:'User clicked "Talk to GAIO" on a recommendation — drafts the gaioContext into the chat bot'}]}};export{Vt as Component,Vt as NetworkGrowthBlock,Ut as manifest};
|
|
50
|
-
//# sourceMappingURL=index-
|
|
50
|
+
//# sourceMappingURL=index-Ba5nbqA8-B620AdXN.js.map
|