@nexlylab/widget 1.32.18 → 1.34.0
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.18/chunks/ClickToLoadEmbed-BLIUFZOn-BwY-LAJ8.js → 1.34.0/chunks/ClickToLoadEmbed-BNWVfZ1y-DuTZcv6f.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/PanelInfoVideo-BNVzih9J-BrU-Qlul.js → 1.34.0/chunks/PanelInfoVideo-Di7qwhV_-qpxDXdLm.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/allowed-elements-BXnLJV1S-C-_lr2zm.js → 1.34.0/chunks/allowed-elements-C0OfX2zF-DIBV8lKu.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/assistant-link-components-DUrLEPUB-DKaQavIJ.js → 1.34.0/chunks/assistant-link-components-DtT0biCl-jR32KHTm.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js → 1.34.0/chunks/assistant-link-policy-B77YPf4E-By6jpR50.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/block-rating-D7hR2gTc-CoiP5C2K.js → 1.34.0/chunks/block-rating-uD_0LK-1-CQMNokIy.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/external-url-qbs1SznX-CJQjg_od.js → 1.34.0/chunks/external-url-Bx_GTDOx-rLiy7c9v.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-BtkNePSj-CiRb-0NX.js → 1.34.0/chunks/index--7VB9nyF-BoVmvEOm.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-OcrS6o5Y-bdo5pwX-.js → 1.34.0/chunks/index-66kR66X--CzwqZYRk.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-kAGaGinD-Dm9kbc85.js → 1.34.0/chunks/index-67cmm3Si-Bhh8_8Oh.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-DiZcd1hz-H31PHMqm.js → 1.34.0/chunks/index-7wlPUbYV-Deg8QEW2.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-B3DeMFo7-BbdAbuAw.js → 1.34.0/chunks/index-B80p2HRD-BHvEiO2X.js} +3 -3
- package/dist/runtime/{1.32.18/chunks/index-DuPFNKhZ-_M0CWPEY.js → 1.34.0/chunks/index-BHphkqVW-CEIHlemy.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-7N5M1HdS-DAdxCQyi.js → 1.34.0/chunks/index-BIeasoH0-BlFXtfQb.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-99heIIoH-QeFj7CR9.js → 1.34.0/chunks/index-BPwttNii-f3F4IxQ5.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-l8Oxwea3-Aqz1AnQ5.js → 1.34.0/chunks/index-BTgHOj2W-D6H0juMn.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-PxSB6BA6-DFxY6dqO.js → 1.34.0/chunks/index-BfGmnBJ0-BOltxOU-.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-CYeJYTiB-BLxOZxZv.js → 1.34.0/chunks/index-BjNWgAJk-B-pT4hKt.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-CZ-JrY2X-TEMHje2B.js → 1.34.0/chunks/index-BlY9hgA--pCzSL4DD.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-C1Fa-E3e-ZRnEJoQe.js → 1.34.0/chunks/index-BmajLlTC-qsVnaLmo.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-DaW9uf4--pkywvGDF.js → 1.34.0/chunks/index-BtBJMXR--DWm0RYZF.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-CF37rhgu-BcW8HKb8.js → 1.34.0/chunks/index-Bz-3E3Sa-B9PuY2Gx.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-qN6oEHVu-C_0Ll4qr.js → 1.34.0/chunks/index-CM2ok1Hp-k8zxZkfU.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-COfQIa8G-D6wzHiS0.js → 1.34.0/chunks/index-CMdx7oFx-bh6F7tw3.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-D1YmJ3gf-3B-eE3K7.js → 1.34.0/chunks/index-COobDdoM-BZw4n83V.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-DAICBUgn-DBhSkJ7i.js → 1.34.0/chunks/index-CQCPJl3S-CV5ZiVsD.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-BKZyJMr2-oy07dUaV.js → 1.34.0/chunks/index-CSsAPgvv-qK4w7DnX.js} +4 -4
- package/dist/runtime/{1.32.18/chunks/index-oxM4Cgtc-R_xuAEQV.js → 1.34.0/chunks/index-CXm6d9l1-BmIQ-NmU.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-D96sEJQ6-Dp5AxBD4.js → 1.34.0/chunks/index-CZcU6ylZ-Bt7j8evJ.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-BKrM_uoq-CABL-0v-.js → 1.34.0/chunks/index-Ce73FsEJ-Ce0fEutJ.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-C5RVj6y1-DUgMllqN.js → 1.34.0/chunks/index-Cf3qMIwZ-PMvqlUvO.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-CSRoJRaW-CoI3p0S7.js → 1.34.0/chunks/index-CqSCG8MM-Yl3jEGAx.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-COTfVuju-DQBGsPwB.js → 1.34.0/chunks/index-CzfX3ctc-qH_mrcVT.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-BZO9Qaiw-DP0QKkgf.js → 1.34.0/chunks/index-DBhWCUM5-DpMzyqHN.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-CCEWGjHV-BTsOZg4v.js → 1.34.0/chunks/index-DT9H1y9L-DladDuuj.js} +4 -4
- package/dist/runtime/{1.32.18/chunks/index-E59S8-Gw-CovGUxIZ.js → 1.34.0/chunks/index-DbY1AG4s-C-OyGFef.js} +4 -4
- package/dist/runtime/{1.32.18/chunks/index-Bf_npmqm-C1BzRUwZ.js → 1.34.0/chunks/index-Ddxqdy4M-CDVtcfdt.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-Dw7QeZq3-Dr1V6OGz.js → 1.34.0/chunks/index-DmV2pHdJ-Dtq7n928.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-Cd1-jHFp-Za3SKEQp.js → 1.34.0/chunks/index-DnWzIgAa-DlTfKZaL.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-BX6ig9BJ-Dsa9X9U7.js → 1.34.0/chunks/index-Dnqtxtmw-CgO1smBF.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-Ce9TuEzb-C3bBvEcm.js → 1.34.0/chunks/index-Dw35VwDs-DX50C5MZ.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index--xfG4CIn-DbuSZfeK.js → 1.34.0/chunks/index-Dydy8_XR-F9_TzvkO.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-cCAzBYyN-W1lJrIDD.js → 1.34.0/chunks/index-FHHrEvNZ-VW9D8cgC.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-BauMKr5c-BpgnWlB8.js → 1.34.0/chunks/index-RyI_7m1j-CavFmRiD.js} +2 -2
- package/dist/runtime/1.34.0/chunks/index-TJEJpVI7-CqZ9_vG_.js +2 -0
- package/dist/runtime/1.34.0/chunks/index-Va_2P_Gg-Kzu4aFqn.js +6 -0
- package/dist/runtime/{1.32.18/chunks/index-BIGVEl9--CSQQTbsg.js → 1.34.0/chunks/index-_wovirve-BzpgdoE8.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-CV2tGt-4-C9wFr7fa.js → 1.34.0/chunks/index-kmVVSAKR-BlRhWcs1.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index-DATkkw3P-VhJcCfAC.js → 1.34.0/chunks/index-xV27oZEe-ErDxRmJu.js} +2 -2
- package/dist/runtime/{1.32.18/chunks/index.modern-CioVZ357-BA5NTOmY.js → 1.34.0/chunks/index.modern-CioVZ357-nfRNslCS.js} +2 -2
- package/dist/runtime/1.34.0/nexly.js +61 -0
- package/dist/v1.js +4 -4
- package/package.json +1 -1
- package/dist/runtime/1.32.18/chunks/index-rblri-2U-I68tb-d3.js +0 -2
- package/dist/runtime/1.32.18/chunks/index-xx1GG5d1-CW29F9vY.js +0 -6
- package/dist/runtime/1.32.18/nexly.js +0 -61
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/PanelVideoOverlay-BY__oBYV-B8OPC1xh.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/_commonjsHelpers-C6fGbg64-BC8KDfbh.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/accent-legibility-BJF2VO5n-CDPQ7suO.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/block-helpers-Cg_zAqG6-DnN2COvk.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/index-BPDIV1BN-DINkyYvc.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/index-BcsmWDTX-Dw9WA5Ac.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/index-C262wwK4-DpyhuXqd.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/index-DMQkz1bV-BuMYksln.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/index-DZADUAKv-DPfvWVuj.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/chunks/inert-assistant-components-B6Cx9pG5-DWb6n3Yq.js +0 -0
- /package/dist/runtime/{1.32.18 → 1.34.0}/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.
|
|
3
|
+
<script src="https://cdn.jsdelivr.net/npm/@nexlylab/widget@1.34.0/dist/v1.js" data-api-key="pk_live_TWOJ_KLUCZ" defer></script>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=ClickToLoadEmbed-
|
|
1
|
+
import{Z as v,r as y,j as i}from"../nexly.js";import{L as $,N as j,l as N}from"./allowed-elements-C0OfX2zF-DIBV8lKu.js";import{a as m}from"./assistant-link-policy-B77YPf4E-By6jpR50.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 Z(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 O(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?Z(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 H={youtube:"support_chat.media_provider_youtube",vimeo:"support_chat.media_provider_vimeo"};function I(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 T({embed:n,t,classPrefix:e,posterUrl:r=null}){const[o,p]=y.useState(!1),[h,c]=y.useState(!1),s=t(H[n.provider]),d=I(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,T as X,O as j};
|
|
2
|
+
//# sourceMappingURL=ClickToLoadEmbed-BNWVfZ1y-DuTZcv6f.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
|
-
import{r as o,j as n,_ as v,
|
|
3
|
-
//# sourceMappingURL=PanelInfoVideo-
|
|
2
|
+
import{r as o,j as n,_ as v,K 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-Di7qwhV_-qpxDXdLm.js.map
|
|
@@ -24,5 +24,5 @@ import{M as Le}from"../nexly.js";import{e as Ne}from"./_commonjsHelpers-C6fGbg64
|
|
|
24
24
|
`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),u=" ",s=t.createTracker(n),s.move(o.join(""))),o.push(s.move(t.handle(c,e,t,{...s.current(),before:u,after:f}))),u=o[o.length-1].slice(-1)}return r.pop(),o.join("")}const ss=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Nr.peek=hs;const cs={canContainEols:["delete"],enter:{strikethrough:ps},exit:{strikethrough:ds}},fs={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ss}],handlers:{delete:Nr}};function ps(e){this.enter({type:"delete",children:[]},e)}function ds(e){this.exit(e)}function Nr(e,t,n,r){const i=tt(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=Br(e,n,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function hs(){return"~"}Hr.peek=gs;function Hr(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],u=Rr(l);let s;if(l.atBreak)for(;s=u.exec(r);){let c=s.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(s.index+1)}}return i+r+i}function gs(){return"`"}function ms(e){return e.length}function ys(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ms,o=[],l=[],u=[],s=[];let c=0,f=-1;for(;++f<e.length;){const m=[],y=[];let k=-1;for(e[f].length>c&&(c=e[f].length);++k<e[f].length;){const F=ks(e[f][k]);if(n.alignDelimiters!==!1){const C=i(F);y[k]=C,(s[k]===void 0||C>s[k])&&(s[k]=C)}m.push(F)}l[f]=m,u[f]=y}let a=-1;if(typeof r=="object"&&"length"in r)for(;++a<c;)o[a]=Un(r[a]);else{const m=Un(r);for(;++a<c;)o[a]=m}a=-1;const d=[],p=[];for(;++a<c;){const m=o[a];let y="",k="";m===99?(y=":",k=":"):m===108?y=":":m===114&&(k=":");let F=n.alignDelimiters===!1?1:Math.max(1,s[a]-y.length-k.length);const C=y+"-".repeat(F)+k;n.alignDelimiters!==!1&&(F=y.length+F+k.length,F>s[a]&&(s[a]=F),p[a]=F),d[a]=C}l.splice(1,0,d),u.splice(1,0,p),f=-1;const x=[];for(;++f<l.length;){const m=l[f],y=u[f];a=-1;const k=[];for(;++a<c;){const F=m[a]||"";let C="",P="";if(n.alignDelimiters!==!1){const I=s[a]-(y[a]||0),b=o[a];b===114?C=" ".repeat(I):b===99?I%2?(C=" ".repeat(I/2+.5),P=" ".repeat(I/2-.5)):(C=" ".repeat(I/2),P=C):P=" ".repeat(I)}n.delimiterStart!==!1&&!a&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&F==="")&&(n.delimiterStart!==!1||a)&&k.push(" "),n.alignDelimiters!==!1&&k.push(C),k.push(F),n.alignDelimiters!==!1&&k.push(P),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||a!==c-1)&&k.push("|")}x.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return x.join(`
|
|
25
25
|
`)}function ks(e){return e==null?"":String(e)}function Un(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const xs={enter:{table:bs,tableData:Vn,tableHeader:Vn,tableRow:ws},exit:{codeText:Cs,table:vs,tableData:wt,tableHeader:wt,tableRow:wt}};function bs(e){const t=e._align;this.enter({type:"table",align:t.map(n=>n==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function vs(e){this.exit(e),this.setData("inTable")}function ws(e){this.enter({type:"tableRow",children:[]},e)}function wt(e){this.exit(e)}function Vn(e){this.enter({type:"tableCell",children:[]},e)}function Cs(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,Ss));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function Ss(e,t){return t==="|"?t:e}function Fs(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
26
26
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:l,tableRow:u,tableCell:s,inlineCode:d}};function l(p,x,m,y){return c(f(p,m,y),p.align)}function u(p,x,m,y){const k=a(p,m,y),F=c([k]);return F.slice(0,F.indexOf(`
|
|
27
|
-
`))}function s(p,x,m,y){const k=m.enter("tableCell"),F=m.enter("phrasing"),C=Br(p,m,{...y,before:o,after:o});return F(),k(),C}function c(p,x){return ys(p,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(p,x,m){const y=p.children;let k=-1;const F=[],C=x.enter("table");for(;++k<y.length;)F[k]=a(y[k],x,m);return C(),F}function a(p,x,m){const y=p.children;let k=-1;const F=[],C=x.enter("tableRow");for(;++k<y.length;)F[k]=s(y[k],p,x,m);return C(),F}function d(p,x,m){let y=Hr(p,x,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function As(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Es(e){const t=e.options.listItemIndent||"tab";if(t===1||t==="1")return"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Ds(e,t,n,r){const i=Es(n);let o=n.bulletCurrent||As(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(l-o.length)),u.shift(l);const s=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,u.current()),f);return s(),c;function f(a,d,p){return d?(p?"":" ".repeat(l))+a:(p?o:o+" ".repeat(l-o.length))+a}}const Ts={exit:{taskListCheckValueChecked:qn,taskListCheckValueUnchecked:qn,paragraph:Ls}},Os={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ps}};function qn(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function Ls(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const u=i[o];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Ps(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=tt(r);o&&u.move(l);let s=Ds(e,t,n,{...r,...u.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),s;function c(f){return f+l}}function Is(){return[Pa,Ka(),cs,xs,Ts]}function zs(e){return{extensions:[Ia,Za(),fs,Fs(e),Os]}}function Ms(e={}){const t=this.data();n("micromarkExtensions",Ea(e)),n("fromMarkdownExtensions",Is()),n("toMarkdownExtensions",zs(e));function n(r,i){(t[r]?t[r]:t[r]=[]).push(i)}}const Bs=["p","br","strong","em","del","a","code","pre","ul","ol","li","input","h1","h2","h3","h4","h5","h6","blockquote","hr","table","thead","tbody","tr","th","td"],Ns=[Ms];export{mo as L,vl as N,_s as a,Ns as c,Ms as l,Bs as s,Xu as x};
|
|
28
|
-
//# sourceMappingURL=allowed-elements-
|
|
27
|
+
`))}function s(p,x,m,y){const k=m.enter("tableCell"),F=m.enter("phrasing"),C=Br(p,m,{...y,before:o,after:o});return F(),k(),C}function c(p,x){return ys(p,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(p,x,m){const y=p.children;let k=-1;const F=[],C=x.enter("table");for(;++k<y.length;)F[k]=a(y[k],x,m);return C(),F}function a(p,x,m){const y=p.children;let k=-1;const F=[],C=x.enter("tableRow");for(;++k<y.length;)F[k]=s(y[k],p,x,m);return C(),F}function d(p,x,m){let y=Hr(p,x,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function As(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Es(e){const t=e.options.listItemIndent||"tab";if(t===1||t==="1")return"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Ds(e,t,n,r){const i=Es(n);let o=n.bulletCurrent||As(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(l-o.length)),u.shift(l);const s=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,u.current()),f);return s(),c;function f(a,d,p){return d?(p?"":" ".repeat(l))+a:(p?o:o+" ".repeat(l-o.length))+a}}const Ts={exit:{taskListCheckValueChecked:qn,taskListCheckValueUnchecked:qn,paragraph:Ls}},Os={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Ps}};function qn(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function Ls(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const u=i[o];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Ps(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=tt(r);o&&u.move(l);let s=Ds(e,t,n,{...r,...u.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),s;function c(f){return f+l}}function Is(){return[Pa,Ka(),cs,xs,Ts]}function zs(e){return{extensions:[Ia,Za(),fs,Fs(e),Os]}}function Ms(e={}){const t=this.data();n("micromarkExtensions",Ea(e)),n("fromMarkdownExtensions",Is()),n("toMarkdownExtensions",zs(e));function n(r,i){(t[r]?t[r]:t[r]=[]).push(i)}}const Bs=["p","br","strong","em","del","a","code","pre","ul","ol","li","input","h1","h2","h3","h4","h5","h6","blockquote","hr","table","thead","tbody","tr","th","td"],Ns=[Ms],Hs=[];export{mo as L,vl as N,_s as a,Ns as c,Hs as f,Ms as l,Bs as s,Xu as x};
|
|
28
|
+
//# sourceMappingURL=allowed-elements-C0OfX2zF-DIBV8lKu.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-B77YPf4E-By6jpR50.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-DtT0biCl-jR32KHTm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=assistant-link-policy-
|
|
1
|
+
import{Z 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-B77YPf4E-By6jpR50.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
1
|
+
import{r,j as a,K 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:K,jwt:F,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||!F)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",...K?{"X-API-Key":K}:{},Authorization:`Bearer ${F}`},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-uD_0LK-1-CQMNokIy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=external-url-
|
|
1
|
+
import{Z as r}from"../nexly.js";import{a as u}from"./allowed-elements-C0OfX2zF-DIBV8lKu.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-Bx_GTDOx-rLiy7c9v.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as p,j as e,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{r as p,j as e,e 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--7VB9nyF-BoVmvEOm.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,
|
|
1
|
+
import{j as e,e as m}from"../nexly.js";const h={slug:"crypto-ticker",name:"Crypto Ticker",version:"2.0.0",category:"data",requiredService:"crypto-intel",configSchema:{properties:{showFearGreed:{type:"boolean",default:!0},showNews:{type:"boolean",default:!0},newsLimit:{type:"number",default:5},showBtcPrice:{type:"boolean",default:!0}}},defaultConfig:{showFearGreed:!0,showNews:!0,newsLimit:5,showBtcPrice:!0},dataContract:{serviceSlug:"crypto-intel",inputSchema:{type:"object",properties:{fearGreedIndex:{type:"number"},fearGreedLabel:{type:"string"},btcPrice:{type:"number"},btcChange24h:{type:"number"},news:{type:"array",items:{type:"object",properties:{title:{type:"string"},source:{type:"string"}}}},summary:{type:"string"}},required:["summary"]},previewDataOverride:{fearGreedIndex:65,fearGreedLabel:"Greed",btcPrice:67420.5,btcChange24h:2.34,news:[{title:"Bitcoin hits new monthly high amid institutional buying",source:"CoinDesk"},{title:"Ethereum staking reaches record 32M ETH",source:"The Block"},{title:"SEC approves spot Solana ETF applications",source:"Bloomberg"}],summary:`Market Sentiment: 65 (Greed)
|
|
2
2
|
|
|
3
3
|
BTC: $67,420 | 24h: +2.34%`}},fields:[{id:"showFearGreed",type:"toggle",label:"Show Fear & Greed",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:"showBtcPrice",type:"toggle",label:"Show BTC price",default:!0,group:"Display"}],events:{emits:[{name:"ticker:coinSelected",description:"User clicked on a coin entry"}],listens:[{name:"market:refresh",description:"Force refresh market data"}]},sizing:{minWidth:200,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main","sidebar"]};function g({data:r,config:s,i18n:o}){const a=o?.t??(t=>t),l=s.showFearGreed??!0,p=s.showNews??!0,d=s.newsLimit??5,i=r.fearGreedIndex,n=r.fearGreedLabel,c=(r.news??[]).slice(0,d);return e.jsx(m,{blockType:"crypto-ticker",children:e.jsxs("div",{className:"es-block__body",children:[l&&i!=null&&e.jsxs("div",{className:"es-crypto__gauge",children:[e.jsx("div",{className:"es-crypto__gauge-label",children:a("crypto_ticker.fear_greed_label")}),e.jsx("div",{className:"es-crypto__gauge-value",children:i}),n&&e.jsx("div",{className:"es-crypto__gauge-sentiment",children:n})]}),p&&c.length>0&&e.jsxs("div",{className:"es-crypto__news",children:[e.jsx("div",{className:"es-crypto__news-title",children:a("crypto_ticker.news_title")}),e.jsx("ul",{className:"es-crypto__news-list",children:c.map((t,u)=>e.jsxs("li",{className:"es-crypto__news-item",children:[e.jsx("span",{children:t.title}),t.source&&e.jsx("span",{className:"es-crypto__news-source",children:t.source})]},u))})]}),!i&&c.length===0&&e.jsx("div",{className:"es-block__empty",children:a("crypto_ticker.empty")})]})})}export{g as Component,h as manifest};
|
|
4
|
-
//# sourceMappingURL=index-
|
|
4
|
+
//# sourceMappingURL=index-66kR66X--CzwqZYRk.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as u,j as e,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{r as u,j as e,e as c,l as j}from"../nexly.js";const f={slug:"recognition-milestone-hub",name:"Recognition & Milestone Hub",version:"1.0.0",category:"interactive",requiredService:"recognition-milestone-hub",configSchema:{properties:{mode:{type:"string",default:"basic"}}},defaultConfig:{mode:"basic"},sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"recognition-milestone-hub",inputSchema:{type:"object",properties:{latestAchievement:{type:"object",properties:{badge:{type:"string"},label:{type:"string"},date:{type:"string"}}},nextMilestone:{type:"object",properties:{label:{type:"string"},progressPercent:{type:"number"}}},achievementHistory:{type:"array",items:{type:"object",properties:{badge:{type:"string"},label:{type:"string"},date:{type:"string"}}}},milestoneTimeline:{type:"array",items:{type:"object",properties:{label:{type:"string"},achieved:{type:"boolean"},date:{type:"string"}}}},celebrationMessage:{type:"string"},mode:{type:"string",enum:["basic","pro"]}}},previewDataOverride:{mode:"pro",latestAchievement:{badge:"🥇",label:"First Sale Achieved",date:"2026-04-04"},nextMilestone:{label:"Silver Rank",progressPercent:68},celebrationMessage:"Amazing work hitting your first sale! You're already 68% of the way to Silver Rank. Focus on 2 more referrals this week to cross the threshold.",achievementHistory:[{badge:"🥇",label:"First Sale Achieved",date:"2026-04-04"},{badge:"🚀",label:"Team of 3 Built",date:"2026-03-28"},{badge:"⭐",label:"Profile Completed",date:"2026-03-20"}],milestoneTimeline:[{label:"Bronze Rank",achieved:!0,date:"2026-03-20"},{label:"Silver Rank",achieved:!1},{label:"Gold Rank",achieved:!1},{label:"Platinum Rank",achieved:!1}]}},fields:[{id:"mode",type:"select",label:"Display mode",default:"basic",options:[{label:"Basic — badge + next milestone card",value:"basic"},{label:"Pro — full history, timeline & AI celebration",value:"pro"}],group:"Display"}],events:{emits:[{name:"rmh:achievementCopied",description:"User copied an achievement to clipboard"}],listens:[{name:"rmh:refresh",description:"Force refresh recognition data"}]}};function k({data:i,config:g,actions:y,metadata:x,i18n:v}){const a=v?.t??(s=>s),o=g.mode??i.mode??"basic",r=i.latestAchievement,l=i.nextMilestone,m=i.achievementHistory??[],h=i.milestoneTimeline??[],d=i.celebrationMessage,[p,_]=u.useState("idle");if(!r&&!i.error)return e.jsx(c,{blockType:"recognition-milestone-hub",children:e.jsx("div",{className:"es-block__body es-rmh__body",children:e.jsxs("div",{className:"es-rmh__hero",style:{opacity:.5},children:[e.jsx("div",{className:"es-rmh__badge-circle","aria-hidden":"true",children:"🏆"}),e.jsxs("div",{className:"es-rmh__hero-info",children:[e.jsx("span",{className:"es-rmh__hero-eyebrow",children:a("recognition.title")}),e.jsx("span",{className:"es-rmh__hero-label",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:x?.dataQuality==="none"?a("recognition.signin_prompt"):a("recognition.empty")})]})]})})});if(i.error)return e.jsx(c,{blockType:"recognition-milestone-hub",error:j(i.error)});const n=Math.min(100,Math.max(0,l?.progressPercent??0));async function b(s){const t=`${s.badge} ${s.label} — ${s.date}`;try{await navigator.clipboard.writeText(t),_("copied"),y.emit("rmh:achievementCopied",{label:s.label}),setTimeout(()=>_("idle"),2e3)}catch{}}return e.jsx(c,{blockType:"recognition-milestone-hub",children:e.jsxs("div",{className:"es-block__body es-rmh__body",children:[r&&e.jsxs("div",{className:"es-rmh__hero",children:[e.jsx("div",{className:"es-rmh__badge-circle","aria-hidden":"true",children:r.badge}),e.jsxs("div",{className:"es-rmh__hero-info",children:[e.jsx("span",{className:"es-rmh__hero-eyebrow",children:a("recognition.latest_achievement")}),e.jsx("span",{className:"es-rmh__hero-label",children:r.label}),e.jsx("span",{className:"es-rmh__hero-date",children:r.date})]}),e.jsx("button",{className:`es-rmh__copy-btn${p==="copied"?" es-rmh__copy-btn--copied":""}`,onClick:()=>b(r),"aria-label":a("recognition.copy_achievement_aria"),title:a("common.copy_to_clipboard"),children:p==="copied"?"✓":"⎘"})]}),l&&e.jsxs("div",{className:"es-rmh__next-milestone",children:[e.jsxs("div",{className:"es-rmh__next-header",children:[e.jsx("span",{className:"es-rmh__next-eyebrow",children:a("recognition.next_milestone")}),e.jsxs("span",{className:"es-rmh__next-percent",children:[n,"%"]})]}),e.jsx("span",{className:"es-rmh__next-label",children:l.label}),e.jsx("div",{className:"es-rmh__progress-bar",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a("recognition.milestone_progress_aria",{percent:n,label:l.label}),children:e.jsx("div",{className:"es-rmh__progress-fill",style:{width:`${n}%`}})})]}),o==="pro"&&d&&e.jsxs("div",{className:"es-rmh__celebration",children:[e.jsx("span",{className:"es-rmh__celebration-label",children:a("recognition.ai_coach_label")}),e.jsx("p",{className:"es-rmh__celebration-text",children:d})]}),o==="pro"&&m.length>0&&e.jsxs("div",{className:"es-rmh__section",children:[e.jsx("h3",{className:"es-rmh__section-title",children:a("recognition.achievement_history")}),e.jsx("ul",{className:"es-rmh__history-list",role:"list",children:m.map((s,t)=>e.jsxs("li",{className:"es-rmh__history-item",children:[e.jsx("span",{className:"es-rmh__history-badge","aria-hidden":"true",children:s.badge}),e.jsx("span",{className:"es-rmh__history-label",children:s.label}),e.jsx("span",{className:"es-rmh__history-date",children:s.date}),e.jsx("button",{className:"es-rmh__history-copy",onClick:()=>b(s),"aria-label":a("recognition.copy_item_aria",{label:s.label}),title:a("common.copy_to_clipboard"),children:"⎘"})]},t))})]}),o==="pro"&&h.length>0&&e.jsxs("div",{className:"es-rmh__section",children:[e.jsx("h3",{className:"es-rmh__section-title",children:a("recognition.milestone_timeline")}),e.jsx("ol",{className:"es-rmh__timeline","aria-label":a("recognition.milestone_progression_aria"),children:h.map((s,t)=>e.jsxs("li",{className:`es-rmh__timeline-item${s.achieved?" es-rmh__timeline-item--achieved":""}`,children:[e.jsx("span",{className:"es-rmh__timeline-dot","aria-hidden":"true",children:s.achieved?"✓":"○"}),e.jsx("span",{className:"es-rmh__timeline-label",children:s.label}),s.date&&e.jsx("span",{className:"es-rmh__timeline-date",children:s.date})]},t))})]})]})})}export{k as Component,f as manifest};
|
|
2
|
+
//# sourceMappingURL=index-67cmm3Si-Bhh8_8Oh.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as e,e as p}from"../nexly.js";const y={slug:"widget-settings",name:"Widget Settings",version:"1.0.0",category:"content",configSchema:{},defaultConfig:{},dataContract:{serviceSlug:null,inputSchema:{type:"object",properties:{}}},fields:[],sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main"],events:{emits:[{name:"preferences:set",description:"Sets theme ({ theme }) or language ({ language }) preference via WidgetShell."},{name:"auth:logout",description:"Signs the user out."}]}},g=[{value:"en",flag:"🇬🇧",labelKey:"languages.en"},{value:"ko",flag:"🇰🇷",labelKey:"languages.ko"},{value:"ja",flag:"🇯🇵",labelKey:"languages.ja"},{value:"es",flag:"🇪🇸",labelKey:"languages.es"},{value:"zh",flag:"🇨🇳",labelKey:"languages.zh"},{value:"id",flag:"🇮🇩",labelKey:"languages.id"},{value:"vi",flag:"🇻🇳",labelKey:"languages.vi"},{value:"pl",flag:"🇵🇱",labelKey:"languages.pl"}],b=[{value:"light",labelKey:"settings.theme_light"},{value:"dark",labelKey:"settings.theme_dark"},{value:"system",labelKey:"settings.theme_auto"}];function j(l){return l.split(" ").map(t=>t[0]).filter(Boolean).slice(0,2).join("").toUpperCase()}function w(l){if(!Array.isArray(l))return g;const t=new Set(l.filter(i=>typeof i=="string")),r=g.filter(i=>t.has(i.value));return r.length>0?r:g}function N({i18n:l,auth:t,preferences:r,actions:i,readOnly:o,config:m}){const a=l?.t??(s=>s),d=l?.isLoadingTranslations??!1,f=l?.translationError??!1,h=l?.retryTranslations;if(!t?.isAuthenticated||!t.user)return e.jsx(p,{blockType:"widget-settings",children:e.jsx("div",{className:"es-widget__profile",children:e.jsx("div",{className:"es-widget__profile-empty",children:e.jsx("p",{children:a("profile.not_logged_in")})})})});const{user:n}=t,_=l?.currentLanguage??r?.language??"en",c=w(m?.enabledLocales),v=c.length>1,u=r?.theme??"system";return e.jsx(p,{blockType:"widget-settings",children:e.jsxs("div",{className:"es-widget__profile",children:[e.jsxs("div",{className:"es-widget__profile-card",children:[e.jsx("div",{className:"es-widget__profile-avatar",children:e.jsx("div",{className:"es-widget__profile-avatar-inner",children:n.name?e.jsx("span",{className:"es-widget__profile-avatar-initials",children:j(n.name)}):null})}),e.jsxs("div",{className:"es-widget__profile-info",children:[n.name&&e.jsx("h3",{className:"es-widget__profile-name",children:n.name}),n.email&&e.jsx("p",{className:"es-widget__profile-email",children:n.email})]})]}),e.jsxs("div",{className:"es-widget__profile-settings",children:[v&&e.jsxs("div",{className:"es-widget__profile-setting-row",children:[e.jsx("label",{htmlFor:"es-lang-select",className:"es-widget__profile-setting-label",children:a("profile.language_label")}),e.jsxs("div",{className:"es-widget__profile-lang-control",children:[e.jsx("select",{id:"es-lang-select",className:"es-widget__profile-lang-select",value:_,disabled:d||o===!0,onChange:s=>i.emit("preferences:set",{language:s.target.value}),children:c.map(s=>e.jsxs("option",{value:s.value,children:[s.flag," ",a(s.labelKey)]},s.value))}),d&&e.jsx("span",{className:"es-widget__profile-lang-spinner",role:"status","aria-label":a("settings.language_loading")})]})]}),f&&e.jsxs("div",{className:"es-widget__profile-lang-error",role:"alert",children:[e.jsx("span",{children:a("settings.language_error")}),e.jsx("button",{type:"button",className:"es-widget__profile-lang-retry",onClick:()=>h?.(),children:a("settings.language_retry")})]}),e.jsxs("div",{className:"es-widget__profile-setting-row",children:[e.jsx("span",{className:"es-widget__profile-setting-label",children:a("settings.theme_label")}),e.jsx("div",{className:"es-widget__profile-theme-switcher",role:"group","aria-label":a("settings.theme_label"),children:b.map(s=>e.jsx("button",{type:"button",className:`es-widget__profile-theme-btn${u===s.value?" es-widget__profile-theme-btn--active":""}`,"aria-pressed":u===s.value,disabled:o===!0,onClick:()=>i.emit("preferences:set",{theme:s.value==="system"?null:s.value}),children:e.jsx("span",{children:a(s.labelKey)})},s.value))})]})]})]})})}export{N as Component,y as manifest};
|
|
2
|
+
//# sourceMappingURL=index-7wlPUbYV-Deg8QEW2.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,
|
|
1
|
+
import{r as o,K as T,j as e,e as R}from"../nexly.js";import{x as oe,s as me,c as de,a as ue}from"./allowed-elements-C0OfX2zF-DIBV8lKu.js";import{p as he,c as _e}from"./external-url-Bx_GTDOx-rLiy7c9v.js";import{f as pe}from"./assistant-link-components-DtT0biCl-jR32KHTm.js";import{C as ge}from"./block-rating-uD_0LK-1-CQMNokIy.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";import"./assistant-link-policy-B77YPf4E-By6jpR50.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
|
-
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-
|
|
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 X(a){return _e(a)}function H(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 W(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),J=n.newsLimit??5,j=d?.apiKey??"",Q=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,J),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=H(s.url);if(!i)return;if(g){u({url:i,source:s.source||X(i)});return}const m=window.open(i,"_blank","noopener,noreferrer");m&&(m.opener=null)},[g]);return te?e.jsxs(R,{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:W(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:W(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=H(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:"▾"})]}),Q&&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(R,{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=X(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-B80p2HRD-BHvEiO2X.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as h,j as e,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{r as h,j as e,e as m,l as j}from"../nexly.js";const C={slug:"recruitment-pipeline",name:"Recruitment Pipeline",version:"1.0.0",category:"interactive",requiredService:"recruitment-pipeline",configSchema:{properties:{mode:{type:"string",default:"basic"}}},defaultConfig:{mode:"basic"},sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"recruitment-pipeline",inputSchema:{type:"object",properties:{stageCounts:{type:"object",properties:{contacted:{type:"number"},interested:{type:"number"},pending:{type:"number"},active:{type:"number"}}},topFollowUpToday:{type:"object",properties:{id:{type:"string"},name:{type:"string"},stage:{type:"string"},notes:{type:"string"},lastContactDate:{type:"string"}}},topFollowUpMessage:{type:"string"},prospects:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},contactInfo:{type:"string"},stage:{type:"string"},notes:{type:"string"},lastContactDate:{type:"string"},aiFollowupMessage:{type:"string"}}}},mode:{type:"string",enum:["basic","pro"]}}},previewDataOverride:{mode:"pro",stageCounts:{contacted:3,interested:5,pending:2,active:4},topFollowUpToday:{id:"preview-1",name:"Piotr Nowak",stage:"interested",notes:"Met at networking event, interested in health products",lastContactDate:new Date(Date.now()-5*864e5).toISOString().slice(0,10)},topFollowUpMessage:"Hi Piotr! I was thinking about you — I'd love to share how our latest health product has been helping people in similar situations. Can we hop on a 10-minute call this week?",prospects:[{id:"preview-1",name:"Piotr Nowak",stage:"interested",notes:"Met at networking event",lastContactDate:new Date(Date.now()-5*864e5).toISOString().slice(0,10)},{id:"preview-2",name:"Anna Kowalska",stage:"pending",notes:"Waiting for reply after product demo",lastContactDate:new Date(Date.now()-2*864e5).toISOString().slice(0,10)},{id:"preview-3",name:"Maria Wiśniewska",stage:"contacted",lastContactDate:new Date(Date.now()-8*864e5).toISOString().slice(0,10)},{id:"preview-4",name:"Tomasz Wójcik",stage:"active",lastContactDate:new Date().toISOString().slice(0,10)}]}},fields:[{id:"mode",type:"select",label:"Display mode",default:"basic",options:[{label:"Basic — funnel summary + top follow-up + AI script",value:"basic"},{label:"Pro — full prospect list with Kanban + AI panel",value:"pro"}],group:"Display"}],events:{emits:[{name:"rp:prospectAdded",description:"User added a new prospect"},{name:"rp:stageChanged",description:"User moved a prospect to a new stage"},{name:"rp:followUpCopied",description:"User copied the AI follow-up message"}],listens:[{name:"rp:refresh",description:"Force refresh recruitment pipeline data"}]}},o={contacted:"recruitment.stage.contacted",interested:"recruitment.stage.interested",pending:"recruitment.stage.pending",active:"recruitment.stage.active"},p={contacted:"es-rp__stage--contacted",interested:"es-rp__stage--interested",pending:"es-rp__stage--pending",active:"es-rp__stage--active"};function D({data:n,config:y,actions:f,metadata:w,i18n:b}){const s=b?.t??(t=>t),v=y.mode??n.mode??"basic",i=n.stageCounts??{contacted:0,interested:0,pending:0,active:0},a=n.topFollowUpToday,c=n.topFollowUpMessage,l=n.prospects??[],[_,u]=h.useState("idle"),[r,g]=h.useState(null);if(i.contacted+i.interested+i.pending+i.active===0&&!a&&!n.error)return e.jsx(m,{blockType:"recruitment-pipeline",children:e.jsxs("div",{className:"es-block__body es-rp__body",children:[e.jsx("div",{className:"es-rp__funnel",role:"list","aria-label":s("recruitment.pipeline_stages_aria"),children:["contacted","interested","pending","active"].map(t=>e.jsxs("div",{role:"listitem",className:`es-rp__funnel-stage ${p[t]??""} es-rp__stage--empty`,children:[e.jsx("span",{className:"es-rp__funnel-count",children:"0"}),e.jsx("span",{className:"es-rp__funnel-label",children:s(o[t])})]},t))}),e.jsx("p",{style:{fontSize:13,color:"var(--es-color-on-surface-muted, #4B5563)",margin:"8px 0 0",textAlign:"center"},children:w?.dataQuality==="none"?s("recruitment.signin_prompt"):s("recruitment.empty_pipeline")})]})});if(n.error)return e.jsx(m,{blockType:"recruitment-pipeline",error:j(n.error)});async function x(){const t=c??"";if(t)try{await navigator.clipboard.writeText(t),u("copied"),f.emit("rp:followUpCopied",{prospectId:a?.id}),setTimeout(()=>u("idle"),2e3)}catch{}}const d=r?l.filter(t=>t.stage===r):l;return e.jsx(m,{blockType:"recruitment-pipeline",children:e.jsxs("div",{className:"es-block__body es-rp__body",children:[e.jsx("div",{className:"es-rp__funnel",role:"list","aria-label":s("recruitment.pipeline_stages_aria"),children:["contacted","interested","pending","active"].map(t=>e.jsxs("button",{role:"listitem",className:`es-rp__funnel-stage ${p[t]??""} ${r===t?"es-rp__funnel-stage--active":""}`,onClick:()=>g(r===t?null:t),"aria-pressed":r===t,"aria-label":s("recruitment.stage_count_aria",{stage:s(o[t]),count:i[t]}),children:[e.jsx("span",{className:"es-rp__funnel-count",children:i[t]}),e.jsx("span",{className:"es-rp__funnel-label",children:s(o[t])})]},t))}),a&&e.jsxs("div",{className:"es-rp__followup-card",children:[e.jsxs("div",{className:"es-rp__followup-eyebrow",children:["📅 ",s("recruitment.follow_up_today")]}),e.jsx("div",{className:"es-rp__followup-name",children:a.name}),e.jsxs("div",{className:"es-rp__followup-meta",children:[e.jsx("span",{className:`es-rp__badge ${p[a.stage]??""}`,children:s(o[a.stage])}),a.lastContactDate&&e.jsx("span",{className:"es-rp__followup-date",children:s("recruitment.last_contact",{date:a.lastContactDate})})]}),a.notes&&e.jsx("div",{className:"es-rp__followup-notes",children:a.notes}),c&&e.jsxs("div",{className:"es-rp__followup-message",children:[e.jsxs("div",{className:"es-rp__followup-message-header",children:[e.jsxs("span",{className:"es-rp__ai-label",children:["✨ ",s("recruitment.ai_followup_script")]}),e.jsx("button",{className:`es-rp__copy-btn${_==="copied"?" es-rp__copy-btn--copied":""}`,onClick:x,"aria-label":s("recruitment.copy_followup_aria"),title:s("common.copy_to_clipboard"),children:_==="copied"?"✓":"⎘"})]}),e.jsx("p",{className:"es-rp__followup-message-text",children:c})]})]}),v==="pro"&&e.jsxs("div",{className:"es-rp__prospect-list",children:[e.jsxs("div",{className:"es-rp__prospect-list-header",children:[e.jsx("span",{className:"es-rp__section-title",children:r?s("recruitment.stage_filtered",{stage:s(o[r]),count:d.length}):s("recruitment.all_prospects",{count:l.length})}),r&&e.jsx("button",{className:"es-rp__clear-filter",onClick:()=>g(null),children:s("recruitment.clear_filter")})]}),d.length===0?e.jsx("p",{className:"es-rp__empty",children:s("recruitment.empty_stage")}):e.jsx("ul",{className:"es-rp__prospects","aria-label":s("recruitment.prospects_list_aria"),children:d.map(t=>e.jsxs("li",{className:"es-rp__prospect-item",children:[e.jsxs("div",{className:"es-rp__prospect-header",children:[e.jsx("span",{className:"es-rp__prospect-name",children:t.name}),e.jsx("span",{className:`es-rp__badge ${p[t.stage]??""}`,children:s(o[t.stage])})]}),t.contactInfo&&e.jsx("span",{className:"es-rp__prospect-contact",children:t.contactInfo}),t.notes&&e.jsx("p",{className:"es-rp__prospect-notes",children:t.notes}),t.lastContactDate&&e.jsx("span",{className:"es-rp__prospect-date",children:s("recruitment.last_contact",{date:t.lastContactDate})})]},t.id))})]})]})})}export{D as Component,C as manifest};
|
|
2
|
+
//# sourceMappingURL=index-BHphkqVW-CEIHlemy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as e,e 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-BIeasoH0-BlFXtfQb.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as P,j as s,
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{r as P,j as s,e as m}from"../nexly.js";const o=28,u=2*Math.PI*o;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:o})}),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))},n=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:o}),s.jsx("circle",{className:"psi-ring-fill",cx:36,cy:36,r:o,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:()=>n(r),onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n(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:()=>n(e),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n(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-BPwttNii-f3F4IxQ5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{L as w,r as t,j as e,e 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-BTgHOj2W-D6H0juMn.js.map
|