@nexlylab/widget 1.32.17 → 1.32.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/INSTALL.txt +1 -1
  2. package/dist/runtime/{1.32.17/chunks/ClickToLoadEmbed-D9eMaBG8-r9dN9klo.js → 1.32.18/chunks/ClickToLoadEmbed-BLIUFZOn-BwY-LAJ8.js} +2 -2
  3. package/dist/runtime/{1.32.17/chunks/PanelInfoVideo-DMU0-9Az-BrU-Qlul.js → 1.32.18/chunks/PanelInfoVideo-BNVzih9J-BrU-Qlul.js} +1 -1
  4. package/dist/runtime/{1.32.17/chunks/assistant-link-components-D0uKk8Hv-xEDu0ls0.js → 1.32.18/chunks/assistant-link-components-DUrLEPUB-DKaQavIJ.js} +2 -2
  5. package/dist/runtime/{1.32.17/chunks/assistant-link-policy-CogLpq-3-Cc-yj-a-.js → 1.32.18/chunks/assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js} +1 -1
  6. package/dist/runtime/{1.32.17/chunks/block-rating-BgOeTm52-CoiP5C2K.js → 1.32.18/chunks/block-rating-D7hR2gTc-CoiP5C2K.js} +1 -1
  7. package/dist/runtime/{1.32.17/chunks/external-url-ninK7gY9-CJQjg_od.js → 1.32.18/chunks/external-url-qbs1SznX-CJQjg_od.js} +1 -1
  8. package/dist/runtime/{1.32.17/chunks/index-DsQ3ssZW-DbuSZfeK.js → 1.32.18/chunks/index--xfG4CIn-DbuSZfeK.js} +1 -1
  9. package/dist/runtime/{1.32.17/chunks/index-CHUW1nlj-DAdxCQyi.js → 1.32.18/chunks/index-7N5M1HdS-DAdxCQyi.js} +1 -1
  10. package/dist/runtime/{1.32.17/chunks/index-CaHbIY6I-QeFj7CR9.js → 1.32.18/chunks/index-99heIIoH-QeFj7CR9.js} +1 -1
  11. package/dist/runtime/{1.32.17/chunks/index-D3OBLy0s-k8E4HOBM.js → 1.32.18/chunks/index-B3DeMFo7-BbdAbuAw.js} +2 -2
  12. package/dist/runtime/{1.32.17/chunks/index-ByEsnceF-CSQQTbsg.js → 1.32.18/chunks/index-BIGVEl9--CSQQTbsg.js} +1 -1
  13. package/dist/runtime/{1.32.17/chunks/index-zmuItIIf-oy07dUaV.js → 1.32.18/chunks/index-BKZyJMr2-oy07dUaV.js} +1 -1
  14. package/dist/runtime/{1.32.17/chunks/index-D6YQ4lFv-pbKZ0WGs.js → 1.32.18/chunks/index-BKrM_uoq-CABL-0v-.js} +2 -2
  15. package/dist/runtime/{1.32.17/chunks/index-BWMbr4oS-Dsa9X9U7.js → 1.32.18/chunks/index-BX6ig9BJ-Dsa9X9U7.js} +1 -1
  16. package/dist/runtime/{1.32.17/chunks/index-B0-9mIbB-DP0QKkgf.js → 1.32.18/chunks/index-BZO9Qaiw-DP0QKkgf.js} +1 -1
  17. package/dist/runtime/{1.32.17/chunks/index-CSDD7Z6C-BpgnWlB8.js → 1.32.18/chunks/index-BauMKr5c-BpgnWlB8.js} +1 -1
  18. package/dist/runtime/{1.32.17/chunks/index-DzCfV77F-C1BzRUwZ.js → 1.32.18/chunks/index-Bf_npmqm-C1BzRUwZ.js} +1 -1
  19. package/dist/runtime/{1.32.17/chunks/index-Dwtd4id8-CiRb-0NX.js → 1.32.18/chunks/index-BtkNePSj-CiRb-0NX.js} +1 -1
  20. package/dist/runtime/{1.32.17/chunks/index-B97ASd4H-ZRnEJoQe.js → 1.32.18/chunks/index-C1Fa-E3e-ZRnEJoQe.js} +1 -1
  21. package/dist/runtime/{1.32.17/chunks/index-CIFQrVkq-DUgMllqN.js → 1.32.18/chunks/index-C5RVj6y1-DUgMllqN.js} +1 -1
  22. package/dist/runtime/{1.32.17/chunks/index-Ba5nbqA8-B620AdXN.js → 1.32.18/chunks/index-CCEWGjHV-BTsOZg4v.js} +2 -2
  23. package/dist/runtime/{1.32.17/chunks/index-D3fwWbIM-BcW8HKb8.js → 1.32.18/chunks/index-CF37rhgu-BcW8HKb8.js} +1 -1
  24. package/dist/runtime/{1.32.17/chunks/index-CtNAXlUH-DQBGsPwB.js → 1.32.18/chunks/index-COTfVuju-DQBGsPwB.js} +1 -1
  25. package/dist/runtime/{1.32.17/chunks/index-1JK_DoDz-D6wzHiS0.js → 1.32.18/chunks/index-COfQIa8G-D6wzHiS0.js} +1 -1
  26. package/dist/runtime/{1.32.17/chunks/index-BlGeDG8W-CoI3p0S7.js → 1.32.18/chunks/index-CSRoJRaW-CoI3p0S7.js} +1 -1
  27. package/dist/runtime/{1.32.17/chunks/index-CpCgmp7C-C9wFr7fa.js → 1.32.18/chunks/index-CV2tGt-4-C9wFr7fa.js} +1 -1
  28. package/dist/runtime/{1.32.17/chunks/index-D30-Ox5Z-BLxOZxZv.js → 1.32.18/chunks/index-CYeJYTiB-BLxOZxZv.js} +1 -1
  29. package/dist/runtime/{1.32.17/chunks/index-_R8QyLD7-TEMHje2B.js → 1.32.18/chunks/index-CZ-JrY2X-TEMHje2B.js} +1 -1
  30. package/dist/runtime/{1.32.17/chunks/index-BsUIWTU6-BQ7DWJhg.js → 1.32.18/chunks/index-Cd1-jHFp-Za3SKEQp.js} +2 -2
  31. package/dist/runtime/{1.32.17/chunks/index-C5olj-Fr-C3bBvEcm.js → 1.32.18/chunks/index-Ce9TuEzb-C3bBvEcm.js} +1 -1
  32. package/dist/runtime/{1.32.17/chunks/index-DIMi29lU-3B-eE3K7.js → 1.32.18/chunks/index-D1YmJ3gf-3B-eE3K7.js} +1 -1
  33. package/dist/runtime/{1.32.17/chunks/index-DnDMirl9-Dp5AxBD4.js → 1.32.18/chunks/index-D96sEJQ6-Dp5AxBD4.js} +1 -1
  34. package/dist/runtime/{1.32.17/chunks/index-CPjLHywY-DBhSkJ7i.js → 1.32.18/chunks/index-DAICBUgn-DBhSkJ7i.js} +1 -1
  35. package/dist/runtime/{1.32.17/chunks/index-DAJM_cb9-VhJcCfAC.js → 1.32.18/chunks/index-DATkkw3P-VhJcCfAC.js} +1 -1
  36. package/dist/runtime/{1.32.17/chunks/index-CM0iRJSw-pkywvGDF.js → 1.32.18/chunks/index-DaW9uf4--pkywvGDF.js} +1 -1
  37. package/dist/runtime/{1.32.17/chunks/index-C_zmepmr-H31PHMqm.js → 1.32.18/chunks/index-DiZcd1hz-H31PHMqm.js} +1 -1
  38. package/dist/runtime/{1.32.17/chunks/index-D5EHdeyl-_M0CWPEY.js → 1.32.18/chunks/index-DuPFNKhZ-_M0CWPEY.js} +1 -1
  39. package/dist/runtime/{1.32.17/chunks/index-DAai_PkG-Dr1V6OGz.js → 1.32.18/chunks/index-Dw7QeZq3-Dr1V6OGz.js} +1 -1
  40. package/dist/runtime/{1.32.17/chunks/index-DDHI4Kxr-DrVjDDba.js → 1.32.18/chunks/index-E59S8-Gw-CovGUxIZ.js} +2 -2
  41. package/dist/runtime/{1.32.17/chunks/index-Ce0ahORn-bdo5pwX-.js → 1.32.18/chunks/index-OcrS6o5Y-bdo5pwX-.js} +1 -1
  42. package/dist/runtime/{1.32.17/chunks/index-Bl_8GpS0-CahNhEcx.js → 1.32.18/chunks/index-PxSB6BA6-DFxY6dqO.js} +2 -2
  43. package/dist/runtime/{1.32.17/chunks/index-Wza_7CGb-W1lJrIDD.js → 1.32.18/chunks/index-cCAzBYyN-W1lJrIDD.js} +1 -1
  44. package/dist/runtime/{1.32.17/chunks/index-DzHo_iNR-Dm9kbc85.js → 1.32.18/chunks/index-kAGaGinD-Dm9kbc85.js} +1 -1
  45. package/dist/runtime/{1.32.17/chunks/index-BDhTixUR-Aqz1AnQ5.js → 1.32.18/chunks/index-l8Oxwea3-Aqz1AnQ5.js} +1 -1
  46. package/dist/runtime/{1.32.17/chunks/index-DMM00SC5-R_xuAEQV.js → 1.32.18/chunks/index-oxM4Cgtc-R_xuAEQV.js} +1 -1
  47. package/dist/runtime/{1.32.17/chunks/index-BJxJr5j5-C_0Ll4qr.js → 1.32.18/chunks/index-qN6oEHVu-C_0Ll4qr.js} +1 -1
  48. package/dist/runtime/{1.32.17/chunks/index-D0qsMexH-I68tb-d3.js → 1.32.18/chunks/index-rblri-2U-I68tb-d3.js} +1 -1
  49. package/dist/runtime/1.32.18/chunks/index-xx1GG5d1-CW29F9vY.js +6 -0
  50. package/dist/runtime/{1.32.17 → 1.32.18}/nexly.js +5 -5
  51. package/dist/v1.js +1 -1
  52. package/package.json +1 -1
  53. package/dist/runtime/1.32.17/chunks/index-tapacGlG--YMQ21rc.js +0 -6
  54. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/PanelVideoOverlay-BY__oBYV-B8OPC1xh.js +0 -0
  55. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/_commonjsHelpers-C6fGbg64-BC8KDfbh.js +0 -0
  56. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/accent-legibility-BJF2VO5n-CDPQ7suO.js +0 -0
  57. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/allowed-elements-BXnLJV1S-C-_lr2zm.js +0 -0
  58. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/block-helpers-Cg_zAqG6-DnN2COvk.js +0 -0
  59. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-BPDIV1BN-DINkyYvc.js +0 -0
  60. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-BcsmWDTX-Dw9WA5Ac.js +0 -0
  61. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-C262wwK4-DpyhuXqd.js +0 -0
  62. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-DMQkz1bV-BuMYksln.js +0 -0
  63. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index-DZADUAKv-DPfvWVuj.js +0 -0
  64. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/index.modern-CioVZ357-BA5NTOmY.js +0 -0
  65. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/inert-assistant-components-B6Cx9pG5-DWb6n3Yq.js +0 -0
  66. /package/dist/runtime/{1.32.17 → 1.32.18}/chunks/use-deferred-rating-XlgCUwcY-DDVOwURi.js +0 -0
@@ -1,2 +1,2 @@
1
1
  import{r as h,j as e,Q as m,o 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-D5EHdeyl-_M0CWPEY.js.map
2
+ //# sourceMappingURL=index-DuPFNKhZ-_M0CWPEY.js.map
@@ -1,2 +1,2 @@
1
1
  import{a as b,r as s,j as e,Q as k}from"../nexly.js";const v={slug:"knowledge-search",name:"Knowledge Search",version:"1.0.0",category:"interactive",requiredService:"knowledge-search",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},maxResults:{type:"number",default:5},minScore:{type:"number",default:.7},placeholder:{type:"string",default:""}}},defaultConfig:{readAloudEnabled:!1,maxResults:5,minScore:.7,placeholder:""},dataContract:{serviceSlug:"knowledge-search",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query entered by user"},results:{type:"array",items:{type:"object",properties:{title:{type:"string"},excerpt:{type:"string"},score:{type:"number"},url:{type:"string"}}}},totalFound:{type:"number"}},required:["results"]},previewDataOverride:{query:"return policy",results:[{title:"Return & Refund Policy",excerpt:"You may return any item within 30 days of purchase for a full refund.",score:.94,url:"/faq/returns"},{title:"Exchange Policy",excerpt:"Exchanges are accepted within 60 days with original receipt.",score:.81,url:"/faq/exchange"},{title:"Damaged Item Returns",excerpt:"For damaged items, please contact support within 7 days.",score:.75,url:"/faq/damaged"}],totalFound:3}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"maxResults",type:"range",label:"Max results",default:5,min:1,max:20,step:1,group:"Search"},{id:"minScore",type:"range",label:"Minimum relevance score",default:.7,min:.1,max:1,step:.05,group:"Search"},{id:"placeholder",type:"localized-text",label:"Search placeholder",default:"",placeholder:'Leave empty to use translated default (e.g. "Search knowledge base...")',group:"Content"},{id:"model",type:"text",label:"AI model",default:"gpt-4o-mini",placeholder:"e.g. gpt-4o-mini, gpt-4o",group:"AI"}],events:{emits:[{name:"search:querySubmitted",description:"User submitted a search query"},{name:"search:resultSelected",description:"User clicked on a search result"}],listens:[{name:"search:clear",description:"Clear search results and query"}]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main"]};function j({config:m,actions:o,i18n:d}){const t=d?.t??(a=>a),g=d?.currentLanguage??"en",y=b(m.placeholder,g,{t,fallbackKey:"knowledge_search.placeholder",enDefault:"Search knowledge base..."}),[l,u]=s.useState(""),[n,f]=s.useState(null),[p,c]=s.useState(null),[r,h]=s.useState(!1),i=s.useCallback(async()=>{const a=l.trim();if(!(!a||r)){f(a),c(null),u(""),h(!0);try{const _=await o.call("search",{query:a});c(_?.answer??null)}catch{c(t("knowledge_search.error"))}finally{h(!1)}}},[l,r,o,t]),x=s.useCallback(a=>{a.key==="Enter"&&(a.preventDefault(),i())},[i]);return e.jsxs(k,{blockType:"knowledge-search",children:[e.jsx("div",{className:"es-block__header",children:e.jsxs("div",{className:"es-ksearch__input-row",children:[e.jsx("input",{className:"es-ksearch__input",type:"text",value:l,onChange:a=>u(a.target.value),onKeyDown:x,placeholder:y}),e.jsx("button",{className:"es-ksearch__btn",onClick:i,disabled:!l.trim()||r,type:"button",children:t("knowledge_search.search_btn")})]})}),e.jsxs("div",{className:"es-block__body",children:[r&&e.jsxs("div",{className:"es-ksearch__loading",children:[e.jsx("div",{className:"es-ksearch__loading-question",children:n}),e.jsxs("div",{className:"es-ksearch__loading-indicator",children:[e.jsx("span",{className:"es-ksearch__dot"}),e.jsx("span",{className:"es-ksearch__dot"}),e.jsx("span",{className:"es-ksearch__dot"})]}),e.jsx("div",{className:"es-ksearch__loading-text",children:t("knowledge_search.generating")})]}),!r&&n&&p&&e.jsxs("div",{className:"es-ksearch__answer-section",children:[e.jsx("div",{className:"es-ksearch__question",children:n}),e.jsx("div",{className:"es-ksearch__answer",children:p})]})]})]})}export{j as Component,v as manifest};
2
- //# sourceMappingURL=index-DAai_PkG-Dr1V6OGz.js.map
2
+ //# sourceMappingURL=index-Dw7QeZq3-Dr1V6OGz.js.map
@@ -1,4 +1,4 @@
1
- import{r as E,j as e,Q as U,o as ue}from"../nexly.js";import{C as ye}from"./block-rating-BgOeTm52-CoiP5C2K.js";import{j as ge}from"./PanelInfoVideo-DMU0-9Az-BrU-Qlul.js";import{m as J}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";const Fe={slug:"daily-action-plan",name:"Daily Action Plan",version:"4.0.0",category:"data",requiredService:"daily-action-plan",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},showGreeting:{type:"boolean",default:!0},showFocus:{type:"boolean",default:!0},showPlays:{type:"boolean",default:!0},showStructural:{type:"boolean",default:!0},showRisk:{type:"boolean",default:!0},showBlocker:{type:"boolean",default:!0},showMyBenefits:{type:"boolean",default:!0}}},defaultConfig:{readAloudEnabled:!1,showGreeting:!0,showFocus:!0,showPlays:!0,showStructural:!0,showRisk:!0,showBlocker:!0,showMyBenefits:!0},sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},dataContract:{serviceSlug:"daily-action-plan",inputSchema:{type:"object",properties:{personalGreeting:{type:"object",properties:{userName:{type:"string"},rankBadge:{type:"string"},summary:{type:"string"},tone:{type:"string",enum:["calm","urgent","celebratory"]}}},todaysFocus:{type:"object",properties:{domain:{type:"string",enum:["relationship","recruitment","sales","structural","risk","market"]},summary:{type:"string"},details:{type:"object",properties:{whyThisToday:{type:"string"},expectedOutcome:{type:"string"},deadlineUtc:{type:"string"}}}}},relationshipPlay:{type:"object",description:"Named downliner outreach play (empty when no real downliner available)",properties:{targetName:{type:"string"},summary:{type:"string"},details:{type:"object",properties:{targetContext:{type:"string"},messageHook:{type:"string"},channelHint:{type:"string",enum:["kakao","line","whatsapp","telegram","email","dashboard","none"]},draftMessage:{type:"string"},complianceNote:{type:"string"}}}}},recruitmentPlay:{type:"object",description:"Recruitment action (actionType='none' when not applicable)",properties:{actionType:{type:"string",enum:["warm_intro","event_invite","follow_up","qualification_call","content_share","none"]},summary:{type:"string"},details:{type:"object",properties:{candidateOrSegment:{type:"string"},rationale:{type:"string"},concreteStep:{type:"string"},complianceNote:{type:"string"}}}}},salesPlay:{type:"object",description:"iMine product or cycle action",properties:{linkedToBinarySide:{type:"string",enum:["left","right","both","none"]},summary:{type:"string"},details:{type:"object",properties:{productOrCycleAction:{type:"string"},rationale:{type:"string"},concreteStep:{type:"string"},marketSignal:{type:"string"},complianceNote:{type:"string"}}}}},structuralCheck:{type:"object",description:"Binary tree, rank, cycle cap, and time alert metrics",properties:{normalRank:{type:"object",properties:{currentRank:{type:"string"},nextRank:{type:"string"},currentVolume:{type:"number"},requiredVolume:{type:"number"},volumeProgressPercent:{type:"number"},creditsEarned:{type:"number"},requiredCredits:{type:"number"},creditsProgressPercent:{type:"number"},binaryQualifyingPlacements:{type:"number"},binaryProgressPercent:{type:"number"},qualifyingBranchLeaders:{type:"number"},branchProgressPercent:{type:"number"},bottleneckProgressPercent:{type:"number"},blockingConditions:{type:"array",items:{type:"string"}}}},paidRank:{type:"object",properties:{currentPaidRank:{type:"string"},nextPaidRank:{type:"string"},active:{type:"boolean"},riskOfDrop:{type:"boolean"},reason:{type:"string"},retentionProgress:{type:"number"},advanceProgress:{type:"number"},rollingWindowSales:{type:"number"},thresholdForCurrentRank:{type:"number"},thresholdForNextRank:{type:"number"},windowDays:{type:"number"},gracePeriodEndsDate:{type:"string"}}},binary:{type:"object",properties:{leftVolume:{type:"number"},rightVolume:{type:"number"},balanced:{type:"boolean"},reason:{type:"string"}}},cycleCap:{type:"object",properties:{}},timeAlert:{type:"object",properties:{}}}},riskFlag:{type:"object",description:"Most critical risk today (severity='none' = no risk)",properties:{severity:{type:"string",enum:["none","low","medium","high","critical"]},riskType:{type:"string"},summary:{type:"string"},details:{type:"object",properties:{description:{type:"string"},preventiveAction:{type:"string"},timeSensitivity:{type:"string"}}}}},myBenefits:{type:"object",description:"Deterministic near-term benefits timeline (1-3 nearest events; empty summary+events hides the tile)",properties:{summary:{type:"string"},events:{type:"array",items:{type:"object",properties:{kind:{type:"string",enum:["mining_start","first_reward","rank_grace","rank_retention","cycles_today","promo"]},dateUtc:{type:"string"},label:{type:"string"},narration:{type:"string"}}}}}}}},previewDataOverride:{personalGreeting:{userName:"Aleksandra",rankBadge:"Senior Manager",summary:"Aleksandra, right leg needs 5 BP to close a cycle before 15:00 UTC.",tone:"urgent"},todaysFocus:{domain:"relationship",summary:"Message Minsu about right-leg cycle close before 15:00 UTC.",details:{whyThisToday:"Minsu is your top right-leg Developer with 12,500 USDT team sales — highest leverage today.",expectedOutcome:"Right-leg +500 USDT or 1 new referral from Minsu by end of day.",deadlineUtc:"15:00 UTC"}},relationshipPlay:{targetName:"Minsu",summary:"Message Minsu on Kakao to align on a right-leg pack placement before 15:00 UTC.",details:{targetContext:"Right-leg Developer, recent activity, team_sales 12,500.",messageHook:"Ask about right-leg cycle close this week.",channelHint:"kakao",draftMessage:"Hi Minsu, we're 5 BP away from closing a right-leg cycle today. Can we align on a pack placement before 15:00 UTC?",complianceNote:"No income guarantee — frame as qualifying for cycle, not earning."}},recruitmentPlay:{actionType:"warm_intro",summary:"Send a warm intro to a BTC-interested contact today — greed index at 71.",details:{candidateOrSegment:"One warm contact who showed interest in BTC mining last week.",rationale:"Greed 71 creates a good opening to discuss Hash Power packages.",concreteStep:"Send iMine partner intro link today by 21:00 local time.",complianceNote:"Frame as 'here's how it works', no ROI claims."}},salesPlay:{linkedToBinarySide:"right",summary:"Place 500 USDT on right leg before 15:00 UTC to close 1 cycle.",details:{productOrCycleAction:"Hash Power Package — right-leg placement (500 USDT)",rationale:"Right 4,200 vs Left 4,500 — right-leg 500 USDT closes 1 cycle.",concreteStep:"Open iMine Distributor Hub → Hash Power Package → right leg → 1 pack.",marketSignal:"BTC up 7% this week — bullish sentiment supports placement urgency.",complianceNote:"No specific earnings amount. Frame as 'activates Senior Manager cycle'."}},structuralCheck:{normalRank:{currentRank:"Senior Manager",nextRank:"Vice President",currentVolume:58e3,requiredVolume:5e4,volumeProgressPercent:100,creditsEarned:500,requiredCredits:1e3,creditsProgressPercent:50,binaryQualifyingPlacements:2,binaryProgressPercent:67,qualifyingBranchLeaders:1,branchProgressPercent:33,bottleneckProgressPercent:33,blockingConditions:[]},paidRank:{currentPaidRank:"Senior Manager",nextPaidRank:"Vice President",active:!0,riskOfDrop:!1,reason:"On track this week.",retentionProgress:.85,advanceProgress:.42,rollingWindowSales:17e3,thresholdForCurrentRank:2e4,thresholdForNextRank:4e4,windowDays:90,gracePeriodEndsDate:null},binary:{leftVolume:4500,rightVolume:4200,balanced:!1,reason:"Right +500 USDT closes 1 cycle."},cycleCap:{dailyCycleLimit:8,cyclesCompletedToday:0,remainingCyclesToday:8,capWasteRisk:!1},timeAlert:{autoPlacementTimeUtc:"15:00",hoursUntilAutoPlacement:4.5,placementUrgency:"high"}},riskFlag:{severity:"low",riskType:"cap_waste",summary:"Right-leg gap may cause 1 missed cycle if not topped up before 15:00 UTC.",details:{description:"If right-leg is not topped up before 15:00 UTC auto-placement, 1 cycle may be missed.",preventiveAction:"Suggest Minsu or place 1 pack on right leg by 14:30 UTC.",timeSensitivity:"4.5 hours"}},myBenefits:{summary:"Your next 3 milestones — mining starts tomorrow, first reward 2 days after.",events:[{kind:"mining_start",dateUtc:"2026-08-14",label:"Mining starts",narration:"Your Hash Power package begins mining tomorrow."},{kind:"first_reward",dateUtc:"2026-08-16",label:"First reward",narration:"Your first mining reward lands 2 days after mining starts."},{kind:"cycles_today",dateUtc:"",label:"0 of 8 cycles used",narration:"You have 8 cycles available today — none used yet."}]}}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"showGreeting",type:"toggle",label:"Show personal greeting",default:!0,group:"Sections"},{id:"showFocus",type:"toggle",label:"Show today's focus",default:!0,group:"Sections"},{id:"showPlays",type:"toggle",label:"Show action plays (relationship / recruitment / sales)",default:!0,group:"Sections"},{id:"showStructural",type:"toggle",label:"Show structural check (rank / binary / cycle)",default:!0,group:"Sections"},{id:"showRisk",type:"toggle",label:"Show risk flag",default:!0,group:"Sections"},{id:"showBlocker",type:"toggle",label:"Show rank blocker tile (structure / payout)",default:!0,group:"Sections"},{id:"showMyBenefits",type:"toggle",label:"Show My Benefits (mining/reward/rank timeline)",default:!0,group:"Sections"}],events:{emits:[{name:"dap:legSelected",description:"User selected a recommended binary leg"},{name:"chat:draft",description:"Seed the chat composer with a draft message + quick-reply chips"}],listens:[{name:"dap:refresh",description:"Force refresh daily action plan"}]},supportedPlacements:["main"]},he=[/MLM\s+PROFILE\s+DATA\s+missing/i,/USER\s+CONTEXT\s+missing/i,/^Cannot\s+verify/i,/Profile\s+data\s+missing/i,/Profile\s+incomplete/i];function X(a){return he.some(s=>s.test(a.trim()))}function l(a){return!a||a.trim()===""}function _e(a){return Math.round(a).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Z(a,s){const t=new Date(a);return isNaN(t.getTime())?a:new Intl.DateTimeFormat(s,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)}function ee(a,s){const t=new Date(a);return isNaN(t.getTime())?a:new Intl.DateTimeFormat(s,{day:"2-digit",month:"short",year:"numeric",timeZone:"UTC"}).format(t)}function P(a){return a.filter(s=>typeof s=="string"&&s.trim()!=="").join(`
1
+ import{r as E,j as e,Q as U,o as ue}from"../nexly.js";import{C as ye}from"./block-rating-D7hR2gTc-CoiP5C2K.js";import{j as ge}from"./PanelInfoVideo-BNVzih9J-BrU-Qlul.js";import{m as J}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";const Fe={slug:"daily-action-plan",name:"Daily Action Plan",version:"4.0.0",category:"data",requiredService:"daily-action-plan",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},showGreeting:{type:"boolean",default:!0},showFocus:{type:"boolean",default:!0},showPlays:{type:"boolean",default:!0},showStructural:{type:"boolean",default:!0},showRisk:{type:"boolean",default:!0},showBlocker:{type:"boolean",default:!0},showMyBenefits:{type:"boolean",default:!0}}},defaultConfig:{readAloudEnabled:!1,showGreeting:!0,showFocus:!0,showPlays:!0,showStructural:!0,showRisk:!0,showBlocker:!0,showMyBenefits:!0},sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},dataContract:{serviceSlug:"daily-action-plan",inputSchema:{type:"object",properties:{personalGreeting:{type:"object",properties:{userName:{type:"string"},rankBadge:{type:"string"},summary:{type:"string"},tone:{type:"string",enum:["calm","urgent","celebratory"]}}},todaysFocus:{type:"object",properties:{domain:{type:"string",enum:["relationship","recruitment","sales","structural","risk","market"]},summary:{type:"string"},details:{type:"object",properties:{whyThisToday:{type:"string"},expectedOutcome:{type:"string"},deadlineUtc:{type:"string"}}}}},relationshipPlay:{type:"object",description:"Named downliner outreach play (empty when no real downliner available)",properties:{targetName:{type:"string"},summary:{type:"string"},details:{type:"object",properties:{targetContext:{type:"string"},messageHook:{type:"string"},channelHint:{type:"string",enum:["kakao","line","whatsapp","telegram","email","dashboard","none"]},draftMessage:{type:"string"},complianceNote:{type:"string"}}}}},recruitmentPlay:{type:"object",description:"Recruitment action (actionType='none' when not applicable)",properties:{actionType:{type:"string",enum:["warm_intro","event_invite","follow_up","qualification_call","content_share","none"]},summary:{type:"string"},details:{type:"object",properties:{candidateOrSegment:{type:"string"},rationale:{type:"string"},concreteStep:{type:"string"},complianceNote:{type:"string"}}}}},salesPlay:{type:"object",description:"iMine product or cycle action",properties:{linkedToBinarySide:{type:"string",enum:["left","right","both","none"]},summary:{type:"string"},details:{type:"object",properties:{productOrCycleAction:{type:"string"},rationale:{type:"string"},concreteStep:{type:"string"},marketSignal:{type:"string"},complianceNote:{type:"string"}}}}},structuralCheck:{type:"object",description:"Binary tree, rank, cycle cap, and time alert metrics",properties:{normalRank:{type:"object",properties:{currentRank:{type:"string"},nextRank:{type:"string"},currentVolume:{type:"number"},requiredVolume:{type:"number"},volumeProgressPercent:{type:"number"},creditsEarned:{type:"number"},requiredCredits:{type:"number"},creditsProgressPercent:{type:"number"},binaryQualifyingPlacements:{type:"number"},binaryProgressPercent:{type:"number"},qualifyingBranchLeaders:{type:"number"},branchProgressPercent:{type:"number"},bottleneckProgressPercent:{type:"number"},blockingConditions:{type:"array",items:{type:"string"}}}},paidRank:{type:"object",properties:{currentPaidRank:{type:"string"},nextPaidRank:{type:"string"},active:{type:"boolean"},riskOfDrop:{type:"boolean"},reason:{type:"string"},retentionProgress:{type:"number"},advanceProgress:{type:"number"},rollingWindowSales:{type:"number"},thresholdForCurrentRank:{type:"number"},thresholdForNextRank:{type:"number"},windowDays:{type:"number"},gracePeriodEndsDate:{type:"string"}}},binary:{type:"object",properties:{leftVolume:{type:"number"},rightVolume:{type:"number"},balanced:{type:"boolean"},reason:{type:"string"}}},cycleCap:{type:"object",properties:{}},timeAlert:{type:"object",properties:{}}}},riskFlag:{type:"object",description:"Most critical risk today (severity='none' = no risk)",properties:{severity:{type:"string",enum:["none","low","medium","high","critical"]},riskType:{type:"string"},summary:{type:"string"},details:{type:"object",properties:{description:{type:"string"},preventiveAction:{type:"string"},timeSensitivity:{type:"string"}}}}},myBenefits:{type:"object",description:"Deterministic near-term benefits timeline (1-3 nearest events; empty summary+events hides the tile)",properties:{summary:{type:"string"},events:{type:"array",items:{type:"object",properties:{kind:{type:"string",enum:["mining_start","first_reward","rank_grace","rank_retention","cycles_today","promo"]},dateUtc:{type:"string"},label:{type:"string"},narration:{type:"string"}}}}}}}},previewDataOverride:{personalGreeting:{userName:"Aleksandra",rankBadge:"Senior Manager",summary:"Aleksandra, right leg needs 5 BP to close a cycle before 15:00 UTC.",tone:"urgent"},todaysFocus:{domain:"relationship",summary:"Message Minsu about right-leg cycle close before 15:00 UTC.",details:{whyThisToday:"Minsu is your top right-leg Developer with 12,500 USDT team sales — highest leverage today.",expectedOutcome:"Right-leg +500 USDT or 1 new referral from Minsu by end of day.",deadlineUtc:"15:00 UTC"}},relationshipPlay:{targetName:"Minsu",summary:"Message Minsu on Kakao to align on a right-leg pack placement before 15:00 UTC.",details:{targetContext:"Right-leg Developer, recent activity, team_sales 12,500.",messageHook:"Ask about right-leg cycle close this week.",channelHint:"kakao",draftMessage:"Hi Minsu, we're 5 BP away from closing a right-leg cycle today. Can we align on a pack placement before 15:00 UTC?",complianceNote:"No income guarantee — frame as qualifying for cycle, not earning."}},recruitmentPlay:{actionType:"warm_intro",summary:"Send a warm intro to a BTC-interested contact today — greed index at 71.",details:{candidateOrSegment:"One warm contact who showed interest in BTC mining last week.",rationale:"Greed 71 creates a good opening to discuss Hash Power packages.",concreteStep:"Send iMine partner intro link today by 21:00 local time.",complianceNote:"Frame as 'here's how it works', no ROI claims."}},salesPlay:{linkedToBinarySide:"right",summary:"Place 500 USDT on right leg before 15:00 UTC to close 1 cycle.",details:{productOrCycleAction:"Hash Power Package — right-leg placement (500 USDT)",rationale:"Right 4,200 vs Left 4,500 — right-leg 500 USDT closes 1 cycle.",concreteStep:"Open iMine Distributor Hub → Hash Power Package → right leg → 1 pack.",marketSignal:"BTC up 7% this week — bullish sentiment supports placement urgency.",complianceNote:"No specific earnings amount. Frame as 'activates Senior Manager cycle'."}},structuralCheck:{normalRank:{currentRank:"Senior Manager",nextRank:"Vice President",currentVolume:58e3,requiredVolume:5e4,volumeProgressPercent:100,creditsEarned:500,requiredCredits:1e3,creditsProgressPercent:50,binaryQualifyingPlacements:2,binaryProgressPercent:67,qualifyingBranchLeaders:1,branchProgressPercent:33,bottleneckProgressPercent:33,blockingConditions:[]},paidRank:{currentPaidRank:"Senior Manager",nextPaidRank:"Vice President",active:!0,riskOfDrop:!1,reason:"On track this week.",retentionProgress:.85,advanceProgress:.42,rollingWindowSales:17e3,thresholdForCurrentRank:2e4,thresholdForNextRank:4e4,windowDays:90,gracePeriodEndsDate:null},binary:{leftVolume:4500,rightVolume:4200,balanced:!1,reason:"Right +500 USDT closes 1 cycle."},cycleCap:{dailyCycleLimit:8,cyclesCompletedToday:0,remainingCyclesToday:8,capWasteRisk:!1},timeAlert:{autoPlacementTimeUtc:"15:00",hoursUntilAutoPlacement:4.5,placementUrgency:"high"}},riskFlag:{severity:"low",riskType:"cap_waste",summary:"Right-leg gap may cause 1 missed cycle if not topped up before 15:00 UTC.",details:{description:"If right-leg is not topped up before 15:00 UTC auto-placement, 1 cycle may be missed.",preventiveAction:"Suggest Minsu or place 1 pack on right leg by 14:30 UTC.",timeSensitivity:"4.5 hours"}},myBenefits:{summary:"Your next 3 milestones — mining starts tomorrow, first reward 2 days after.",events:[{kind:"mining_start",dateUtc:"2026-08-14",label:"Mining starts",narration:"Your Hash Power package begins mining tomorrow."},{kind:"first_reward",dateUtc:"2026-08-16",label:"First reward",narration:"Your first mining reward lands 2 days after mining starts."},{kind:"cycles_today",dateUtc:"",label:"0 of 8 cycles used",narration:"You have 8 cycles available today — none used yet."}]}}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"showGreeting",type:"toggle",label:"Show personal greeting",default:!0,group:"Sections"},{id:"showFocus",type:"toggle",label:"Show today's focus",default:!0,group:"Sections"},{id:"showPlays",type:"toggle",label:"Show action plays (relationship / recruitment / sales)",default:!0,group:"Sections"},{id:"showStructural",type:"toggle",label:"Show structural check (rank / binary / cycle)",default:!0,group:"Sections"},{id:"showRisk",type:"toggle",label:"Show risk flag",default:!0,group:"Sections"},{id:"showBlocker",type:"toggle",label:"Show rank blocker tile (structure / payout)",default:!0,group:"Sections"},{id:"showMyBenefits",type:"toggle",label:"Show My Benefits (mining/reward/rank timeline)",default:!0,group:"Sections"}],events:{emits:[{name:"dap:legSelected",description:"User selected a recommended binary leg"},{name:"chat:draft",description:"Seed the chat composer with a draft message + quick-reply chips"}],listens:[{name:"dap:refresh",description:"Force refresh daily action plan"}]},supportedPlacements:["main"]},he=[/MLM\s+PROFILE\s+DATA\s+missing/i,/USER\s+CONTEXT\s+missing/i,/^Cannot\s+verify/i,/Profile\s+data\s+missing/i,/Profile\s+incomplete/i];function X(a){return he.some(s=>s.test(a.trim()))}function l(a){return!a||a.trim()===""}function _e(a){return Math.round(a).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Z(a,s){const t=new Date(a);return isNaN(t.getTime())?a:new Intl.DateTimeFormat(s,{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)}function ee(a,s){const t=new Date(a);return isNaN(t.getTime())?a:new Intl.DateTimeFormat(s,{day:"2-digit",month:"short",year:"numeric",timeZone:"UTC"}).format(t)}function P(a){return a.filter(s=>typeof s=="string"&&s.trim()!=="").join(`
2
2
  `)}function be(a,s,t){const r=a.details;return P([`${s("dap.section.focus")} · ${a.domain}`,!l(a.summary)&&a.summary,r&&!l(r.whyThisToday)&&`${s("dap.focus.why")}: ${r.whyThisToday}`,r&&!l(r.expectedOutcome)&&`${s("dap.gaio.field.expected")}: ${r.expectedOutcome}`,r&&r.deadlineUtc&&!l(r.deadlineUtc)&&`${s("dap.gaio.field.deadline")}: ${Z(r.deadlineUtc,t)}`])}function ke(a,s){const t=a.details;return P([`${s("dap.gaio.field.severity")}: ${a.severity}`,!l(a.summary)&&a.summary,t&&!l(t.description)&&t.description,t&&!l(t.preventiveAction)&&`${s("dap.gaio.field.preventive")}: ${t.preventiveAction}`,t&&!l(t.timeSensitivity)&&`${s("dap.gaio.field.time_sensitivity")}: ${t.timeSensitivity}`])}function fe(a,s){const t=a.details;return P([`${s("dap.section.relationship")} · ${a.targetName}`,!l(a.summary)&&a.summary,t&&!l(t.targetContext)&&`${s("dap.gaio.field.context")}: ${t.targetContext}`,t&&!l(t.messageHook)&&`${s("dap.gaio.field.hook")}: ${t.messageHook}`,t&&t.channelHint&&t.channelHint!=="none"&&`${s("dap.gaio.field.channel")}: ${t.channelHint}`,t&&!l(t.draftMessage)&&`${s("dap.gaio.field.draft")}: ${t.draftMessage}`,t&&!l(t.complianceNote)&&`${s("dap.gaio.field.compliance")}: ${t.complianceNote}`])}function xe(a,s){const t=a.details;return P([`${s("dap.section.recruitment")} · ${a.actionType.replace(/_/g," ")}`,!l(a.summary)&&a.summary,t&&!l(t.candidateOrSegment)&&`${s("dap.gaio.field.candidate")}: ${t.candidateOrSegment}`,t&&!l(t.rationale)&&`${s("dap.play.why")}: ${t.rationale}`,t&&!l(t.concreteStep)&&`${s("dap.play.do")}: ${t.concreteStep}`,t&&!l(t.complianceNote)&&`${s("dap.gaio.field.compliance")}: ${t.complianceNote}`])}function je(a,s){const t=a.details;return P([`${s("dap.section.sales")} · ${a.linkedToBinarySide}`,!l(a.summary)&&a.summary,t&&!l(t.productOrCycleAction)&&`${s("dap.gaio.field.product")}: ${t.productOrCycleAction}`,t&&!l(t.rationale)&&`${s("dap.play.why")}: ${t.rationale}`,t&&!l(t.concreteStep)&&`${s("dap.play.do")}: ${t.concreteStep}`,t&&!l(t.marketSignal)&&`${s("dap.gaio.field.market")}: ${t.marketSignal}`,t&&!l(t.complianceNote)&&`${s("dap.gaio.field.compliance")}: ${t.complianceNote}`])}function Ne(a,s,t){return P([s("dap.section.my_benefits"),!l(a.summary)&&a.summary,...a.events.map(r=>{const n=r.dateUtc?` (${ee(r.dateUtc,t)})`:"";return`${s(`dap.benefits.kind.${r.kind}`)} — ${r.label}${n}: ${r.narration}`})])}function ae(a,s){const t=!!a.riskOfDrop,r=a.retentionProgress,n=typeof r=="number"&&r<1,m=Math.max(0,(a.thresholdForCurrentRank??0)-(a.rollingWindowSales??0)),h=a.windowDays??0,k=m>0&&h>0;let b;return a.active===!1?b=s("dap.blocker.paid_rank.unlock"):n||t?b=k?s("dap.blocker.paid_rank.at_risk",{gap:_e(m),days:h}):s("dap.blocker.paid_rank.unlock"):b=s("dap.blocker.paid_rank.safe",{rank:J(a.currentPaidRank,s)}),{atRisk:t,message:b}}function te(a,s){if(a.active===!1||a.riskOfDrop||typeof a.retentionProgress=="number"&&a.retentionProgress<1)return;const t=a.nextPaidRank,r=a.thresholdForNextRank??0;if(!t||r<=0)return;const n=typeof a.advanceProgress=="number"?a.advanceProgress:0,m=Math.round(Math.max(0,Math.min(1,n))*100);return s("dap.blocker.paid_rank.advance",{percent:m,rank:J(t,s)})}function ve(a,s,t){const r=s?ae(s,t):void 0,n=s?te(s,t):void 0;return P([a.length>0&&`${t("dap.blocker.normal_rank.title")} (${t("dap.blocker.normal_rank.badge")})`,...a,r&&`${t("dap.blocker.paid_rank.title")}: ${r.message}`,n,r?.atRisk&&s?.gracePeriodEndsDate?t("dap.blocker.paid_rank.grace",{date:s.gracePeriodEndsDate}):void 0])}function we(a){if(!a)return!0;if(!l(a.summary))return!1;const s=a.details;return s?l(s.whyThisToday)&&l(s.expectedOutcome)&&l(s.deadlineUtc):!0}function Te(a){if(!a)return!0;const s=a.normalRank;return s?(s.blockingConditions??[]).filter(t=>!X(t)).length===0&&s.currentVolume===0&&s.requiredVolume===0:!0}function Y(a){return a==="critical"||a==="high"?"var(--es-color-error, #AD2C26)":a==="medium"?"var(--es-color-warning, #9C5300)":"var(--es-color-on-surface-muted, #4B5563)"}const Se={relationship:"🤝",recruitment:"📣",sales:"🛒",structural:"📊",risk:"⚠️",market:"📈"},Pe={mining_start:"⛏️",first_reward:"🎁",rank_grace:"⏳",rank_retention:"🛡️",cycles_today:"🔄",promo:"✨"};function $e({open:a}){return e.jsx("svg",{className:`es-dap__chevron${a?" es-dap__chevron--open":""}`,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})}function O({teaser:a,isOpen:s,children:t}){return s?e.jsx("div",{className:"es-dap__teaser-reveal",children:t}):e.jsx("p",{className:"es-dap__teaser-text",children:a})}function M({isOpen:a,onToggle:s,expandLabel:t,collapseLabel:r,t:n}){return e.jsxs("button",{className:"es-dap__more-toggle",type:"button",onClick:s,"aria-expanded":a,"aria-label":a?r:t,children:[n(a?"dap.teaser.less":"dap.teaser.more"),e.jsx($e,{open:a})]})}function S({moreToggle:a,gaioLink:s}){return!a&&!s?null:e.jsxs("div",{className:"es-dap__actions",children:[a,s]})}function Ce(a){const s=a.trim(),t=/^\[(normal|paid)\]\s*/i.exec(s);return t&&t[1]?{scope:t[1].toLowerCase(),text:s.slice(t[0].length)}:{scope:"normal",text:s}}const Re=[{labelKey:"dap.blocker.credits",pct:a=>a.creditsProgressPercent},{labelKey:"dap.blocker.binary_structure",pct:a=>a.binaryProgressPercent},{labelKey:"dap.blocker.branch_leaders",pct:a=>a.branchProgressPercent},{labelKey:"dap.blocker.team_sales",pct:a=>a.volumeProgressPercent}];function Le({normalRank:a,paidRank:s,normalConditions:t,gaioLink:r,t:n}){const m=a?Re.filter(g=>{const f=g.pct(a);return typeof f=="number"&&f<100}):[],h=m.length>0&&m.length===t.length,k=h&&m.some(g=>g.labelKey==="dap.blocker.branch_leaders"),b=t.length>0,i=s?ae(s,n):void 0,x=s?te(s,n):void 0;return e.jsxs("div",{className:"es-dap__card es-dap__blocker-tile",children:[b&&e.jsxs("div",{className:"es-dap__blocker-section",children:[e.jsxs("div",{className:"es-dap__blocker-head",children:[e.jsx("span",{className:"es-dap__blocker-title",children:n("dap.blocker.normal_rank.title")}),e.jsx("span",{className:"es-dap__pill es-dap__pill--warn",children:n("dap.blocker.normal_rank.badge")})]}),e.jsx("ul",{className:"es-dap__blocker-list",children:t.map((g,f)=>{const j=h?m[f]:void 0;return e.jsxs("li",{className:"es-dap__blocker-item es-dap__blocker-item--structure",children:[j&&e.jsx("span",{className:"es-dap__blocker-itemlabel",children:n(j.labelKey)}),e.jsx("span",{className:"es-dap__blocker-msg",children:g})]},f)})}),k&&e.jsx("p",{className:"es-dap__blocker-note",children:n("dap.blocker.excluded_structure")})]}),s&&i&&e.jsxs("div",{className:`es-dap__blocker-section${b?" es-dap__blocker-section--divided":""}`,children:[e.jsxs("div",{className:"es-dap__blocker-head",children:[e.jsx("span",{className:"es-dap__blocker-title",children:n("dap.blocker.paid_rank.title")}),e.jsx("span",{className:`es-dap__pill ${i.atRisk?"es-dap__pill--danger":"es-dap__pill--ok"}`,children:n("dap.blocker.paid_rank.badge")})]}),e.jsx("p",{className:`es-dap__blocker-item es-dap__blocker-item--${i.atRisk?"risk":"safe"}`,children:e.jsx("span",{className:"es-dap__blocker-msg",children:i.message})}),x&&e.jsx("p",{className:"es-dap__blocker-note es-dap__blocker-note--advance",children:x}),i.atRisk&&s.gracePeriodEndsDate&&e.jsx("p",{className:"es-dap__blocker-note es-dap__blocker-note--grace",children:n("dap.blocker.paid_rank.grace",{date:s.gracePeriodEndsDate})})]}),e.jsx(S,{gaioLink:r})]})}function Oe({benefits:a,lang:s,gaioLink:t,t:r}){return e.jsxs("div",{className:"es-dap__card es-dap__benefits-tile",children:[e.jsx("div",{className:"es-dap__blocker-head",children:e.jsx("span",{className:"es-dap__blocker-title",children:r("dap.section.my_benefits")})}),!l(a.summary)&&e.jsx("p",{className:"es-dap__benefits-summary",children:a.summary}),a.events.length>0&&e.jsx("ul",{className:"es-dap__benefits-list",children:a.events.map((n,m)=>e.jsxs("li",{className:`es-dap__benefits-item es-dap__benefits-item--${n.kind}`,children:[e.jsx("span",{className:"es-dap__benefits-icon","aria-hidden":"true",children:Pe[n.kind]??"•"}),e.jsxs("div",{className:"es-dap__benefits-body",children:[e.jsxs("div",{className:"es-dap__benefits-row",children:[e.jsx("span",{className:"es-dap__benefits-label",children:n.label}),n.dateUtc&&e.jsx("span",{className:"es-dap__benefits-date","data-es-no-read":!0,children:ee(n.dateUtc,s)})]}),!l(n.narration)&&e.jsx("p",{className:"es-dap__benefits-narration",children:n.narration})]})]},m))}),e.jsx(S,{gaioLink:t})]})}function Me({text:a,copyLabel:s,copiedLabel:t}){const[r,n]=E.useState(!1);function m(){const h=()=>{n(!0),window.setTimeout(()=>n(!1),2e3)},k=navigator?.clipboard;k?.writeText&&k.writeText(a).then(h,()=>{})}return e.jsx("button",{className:"es-dap__copy-btn",type:"button",onClick:m,children:r?`${t} ✓`:`📋 ${s}`})}function z({label:a,message:s,btnLabel:t,onNavigate:r}){return e.jsxs("div",{className:"es-dap__card es-dap__tile-cta",children:[e.jsx("div",{className:"es-dap__tile-cta-header",children:e.jsx("span",{className:"es-dap__section-label",children:a})}),e.jsx("p",{className:"es-dap__tile-cta-message",children:s}),e.jsx("button",{className:"es-dap__tile-cta-btn",type:"button",onClick:r,children:t})]})}function T({section:a,summary:s,content:t,onTalk:r,t:n}){return e.jsxs("button",{type:"button",className:"es-dap__gaio-link","aria-label":n("dap.gaio.aria",{section:a}),onClick:()=>r(a,s,t),children:[e.jsx("span",{"aria-hidden":"true",children:"💬"})," ",n("dap.talk_to_gaio")]})}function He({data:a,config:s,metadata:t,i18n:r,actions:n,baseUrl:m,externalContext:h,auth:k,previewMode:b}){const i=r?.t??(y=>y),x=r?.currentLanguage??"en",g=h?.hasChatView===!0,f=s.showFocus??!0,j=s.showPlays??!0,q=s.showStructural??!0,se=s.showRisk??!0,ie=s.showBlocker??!0,re=s.showMyBenefits??!0,ne=a.personalGreeting,u=a.todaysFocus,d=a.relationshipPlay,p=a.recruitmentPlay,o=a.salesPlay,C=a.structuralCheck,c=a.riskFlag,N=a.myBenefits,[_,le]=E.useState({});function R(y){le($=>({...$,[y]:!$[y]}))}function B(){n.navigate("gaio-coach")}const v=E.useCallback((y,$,me)=>{n.emit("chat:draft",{message:`[${y}]
3
3
  ${me}`,autoSend:!1,quickChips:[{labelKey:"dap.gaio.chip.how",label:i("dap.gaio.chip.how"),message:i("dap.gaio.chip.how_msg",{summary:$}),autoSend:!0},{labelKey:"dap.gaio.chip.why",label:i("dap.gaio.chip.why"),message:i("dap.gaio.chip.why_msg",{summary:$}),autoSend:!0},{labelKey:"dap.gaio.chip.draft",label:i("dap.gaio.chip.draft"),message:i("dap.gaio.chip.draft_msg",{summary:$}),autoSend:!0},{labelKey:"dap.gaio.chip.other",label:i("dap.gaio.chip.other"),message:"",autoSend:!1}]})},[n,i]),w=y=>e.jsx(ye,{compact:!0,blockSlug:"daily-action-plan",sectionKey:y,baseUrl:m,apiKey:h?.apiKey,jwt:k?.jwt,previewMode:b,t:i});if(!u&&!ne&&!a.error)return e.jsx(U,{blockType:"daily-action-plan",children:e.jsx("div",{className:"es-block__body es-dap__body",children:e.jsxs("div",{className:"es-dap__empty",children:[e.jsx("div",{className:"es-dap__empty-title",children:i("dap.title")}),e.jsx("p",{className:"es-dap__empty-message",children:t?.dataQuality==="none"?i("dap.empty.sign_in"):i("dap.empty.preparing")}),[1,2,3].map(y=>e.jsxs("div",{className:"es-dap__card es-dap__card--placeholder",children:[e.jsx("div",{className:"es-dap__placeholder-line es-dap__placeholder-line--label"}),e.jsx("div",{className:"es-dap__placeholder-line"})]},y))]})})});if(a.error)return e.jsx(U,{blockType:"daily-action-plan",error:ue(a.error)});const V=we(u),G=Te(C),oe=C?.normalRank?.blockingConditions?.filter(y=>!X(y))??[],ce=f&&!V,D=j&&!!d&&!!d.targetName&&!l(d.summary),A=j&&!!p&&p.actionType!=="none"&&!l(p.summary),L=!!o&&o.linkedToBinarySide==="none"&&!l(o.details?.concreteStep),F=j&&!!o&&(!l(o.summary)||L),de=q&&!G,W=se&&!!c&&c.severity!=="none",I=re&&!!N&&(!l(N.summary)||N.events.length>0);if(!(ce||D||A||F||de||W||I))return e.jsx(U,{blockType:"daily-action-plan",children:e.jsx("div",{className:"es-block__body es-dap__body",children:e.jsxs("div",{className:"es-dap__block-cta",children:[e.jsx("p",{className:"es-dap__block-cta-message",children:i("dap.empty.block_cta")}),e.jsx("button",{className:"es-dap__block-cta-btn",type:"button",onClick:B,children:i("dap.empty.block_cta_btn")})]})})});const pe=C?.normalRank,H=C?.paidRank,K=oe.map(Ce).filter(y=>y.scope==="normal").map(y=>y.text),Q=ie&&!!C&&(K.length>0||!!H);return e.jsxs(U,{blockType:"daily-action-plan",children:[e.jsx("div",{className:"es-dap__icon-row",children:e.jsx(ge,{panelKey:"daily-action-plan",baseUrl:m,apiKey:h?.apiKey,t:i})}),e.jsxs("div",{className:"es-block__body es-dap__body es-dap__deck",children:[f&&(V?e.jsx(z,{label:i("dap.section.focus"),message:i("dap.empty.tile_cta"),btnLabel:i("dap.empty.tile_cta_btn"),onNavigate:B}):u&&e.jsxs("div",{className:"es-dap__hero",children:[e.jsxs("div",{className:"es-dap__hero-lead",children:[e.jsx("span",{"aria-hidden":"true",children:Se[u.domain]??"🎯"})," ",i("dap.section.focus")," · ",u.domain,u.details?.deadlineUtc&&e.jsxs("span",{className:"es-dap__hero-deadline","data-es-no-read":!0,children:[" · ⏱ ",Z(u.details.deadlineUtc,x)]})]}),e.jsx("p",{className:"es-dap__hero-headline",children:u.summary}),u.details?.whyThisToday&&e.jsxs(O,{teaser:u.details.whyThisToday,isOpen:_.focus??!1,children:[e.jsx("p",{className:"es-dap__detail-text",children:u.details.whyThisToday}),u.details?.expectedOutcome&&e.jsx("p",{className:"es-dap__detail-text es-dap__detail-text--outcome",children:u.details.expectedOutcome})]}),e.jsx(S,{moreToggle:u.details?.whyThisToday&&e.jsx(M,{isOpen:_.focus??!1,onToggle:()=>R("focus"),expandLabel:i("dap.aria.expand_focus"),collapseLabel:i("dap.aria.collapse_focus"),t:i}),gaioLink:g&&e.jsx(T,{section:i("dap.section.focus"),summary:u.summary,content:be(u,i,x),onTalk:v,t:i})}),w("focus")]})),W&&c&&e.jsxs("div",{className:"es-dap__risk",style:{borderLeftColor:Y(c.severity)},children:[e.jsxs("div",{className:"es-dap__risk-head",children:[e.jsx("span",{className:"es-dap__risk-title",children:i("dap.section.risk")}),e.jsx("span",{className:"es-dap__pill es-dap__pill--warn",style:{color:Y(c.severity)},children:i(`dap.risk.severity.${c.severity}`)})]}),e.jsx("p",{className:"es-dap__risk-blurb",children:i("dap.risk.blurb")}),c.summary&&e.jsx("p",{className:"es-dap__risk-summary",children:c.summary}),c.details?.description&&e.jsxs(O,{teaser:c.details.description,isOpen:_.risk??!1,children:[e.jsx("p",{className:"es-dap__detail-text",children:c.details.description}),c.details?.preventiveAction&&e.jsx("p",{className:"es-dap__detail-text es-dap__detail-text--step",children:c.details.preventiveAction}),c.details?.timeSensitivity&&e.jsx("p",{className:"es-dap__detail-text es-dap__detail-text--deadline",children:c.details.timeSensitivity})]}),e.jsx(S,{moreToggle:c.details?.description&&e.jsx(M,{isOpen:_.risk??!1,onToggle:()=>R("risk"),expandLabel:i("dap.aria.expand_risk"),collapseLabel:i("dap.aria.collapse_risk"),t:i}),gaioLink:g&&e.jsx(T,{section:i("dap.section.risk"),summary:c.summary||c.details?.description||i("dap.section.risk"),content:ke(c,i),onTalk:v,t:i})}),w("risk")]}),Q&&e.jsxs(e.Fragment,{children:[e.jsx(Le,{normalRank:pe,paidRank:H,normalConditions:K,gaioLink:g&&e.jsx(T,{section:i("dap.gaio.section.blocker"),summary:i("dap.gaio.section.blocker"),content:ve(K,H,i),onTalk:v,t:i}),t:i}),w("blocker")]}),q&&G&&!Q&&e.jsx(z,{label:i("dap.section.structural"),message:i("dap.empty.tile_cta"),btnLabel:i("dap.empty.tile_cta_btn"),onNavigate:B}),I&&N&&e.jsxs(e.Fragment,{children:[e.jsx(Oe,{benefits:N,lang:x,gaioLink:g&&e.jsx(T,{section:i("dap.section.my_benefits"),summary:N.summary||i("dap.section.my_benefits"),content:Ne(N,i,x),onTalk:v,t:i}),t:i}),w("my_benefits")]}),j&&(D||A||F)&&e.jsxs("div",{className:"es-dap__play-rail",children:[D&&d&&e.jsxs("div",{className:"es-dap__play",children:[e.jsxs("div",{className:"es-dap__play-head",children:[e.jsx("span",{"aria-hidden":"true",children:"🤝"}),e.jsxs("span",{className:"es-dap__play-label",children:[i("dap.section.relationship")," · ",d.targetName]}),e.jsx("span",{className:"es-dap__play-spacer"}),d.details?.channelHint&&d.details.channelHint!=="none"&&e.jsxs("span",{className:"es-dap__pill",children:[e.jsx("span",{"aria-hidden":"true",children:"💬"})," ",d.details.channelHint]})]}),e.jsx("div",{className:"es-dap__play-summary",children:d.summary}),d.details?.draftMessage&&e.jsxs(O,{teaser:d.details.draftMessage,isOpen:_.relationship??!1,children:[e.jsx("blockquote",{className:"es-dap__draft-message",children:d.details.draftMessage}),e.jsx(Me,{text:d.details.draftMessage,copyLabel:i("dap.play.copy_send"),copiedLabel:i("dap.play.copied")})]}),d.details?.complianceNote&&e.jsxs("div",{className:"es-dap__compliance",children:[e.jsx("span",{className:"es-dap__compliance-ico","aria-hidden":"true",children:"ⓘ"}),e.jsx("span",{children:d.details.complianceNote})]}),e.jsx(S,{moreToggle:d.details?.draftMessage&&e.jsx(M,{isOpen:_.relationship??!1,onToggle:()=>R("relationship"),expandLabel:i("dap.aria.expand_relationship"),collapseLabel:i("dap.aria.collapse_relationship"),t:i}),gaioLink:g&&e.jsx(T,{section:i("dap.section.relationship"),summary:d.summary,content:fe(d,i),onTalk:v,t:i})}),w("relationship")]}),A&&p&&e.jsxs("div",{className:"es-dap__play",children:[e.jsxs("div",{className:"es-dap__play-head",children:[e.jsx("span",{"aria-hidden":"true",children:"📣"}),e.jsx("span",{className:"es-dap__play-label",children:i("dap.section.recruitment")}),e.jsx("span",{className:"es-dap__play-spacer"}),e.jsx("span",{className:"es-dap__pill es-dap__pill--info",children:p.actionType.replace(/_/g," ")})]}),e.jsx("div",{className:"es-dap__play-summary",children:p.summary}),p.details?.rationale&&e.jsxs(O,{teaser:p.details.rationale,isOpen:_.recruitment??!1,children:[p.details?.candidateOrSegment&&e.jsx("p",{className:"es-dap__detail-text",children:p.details.candidateOrSegment}),e.jsx("p",{className:"es-dap__detail-text",children:p.details.rationale})]}),p.details?.concreteStep&&e.jsxs("div",{className:"es-dap__do",children:[e.jsxs("b",{children:[i("dap.play.do"),":"]})," ",p.details.concreteStep]}),p.details?.complianceNote&&e.jsxs("div",{className:"es-dap__compliance",children:[e.jsx("span",{className:"es-dap__compliance-ico","aria-hidden":"true",children:"ⓘ"}),e.jsx("span",{children:p.details.complianceNote})]}),e.jsx(S,{moreToggle:p.details?.rationale&&e.jsx(M,{isOpen:_.recruitment??!1,onToggle:()=>R("recruitment"),expandLabel:i("dap.aria.expand_recruitment"),collapseLabel:i("dap.aria.collapse_recruitment"),t:i}),gaioLink:g&&e.jsx(T,{section:i("dap.section.recruitment"),summary:p.summary,content:xe(p,i),onTalk:v,t:i})}),w("recruitment")]}),F&&o&&e.jsxs("div",{className:"es-dap__play",children:[e.jsxs("div",{className:"es-dap__play-head",children:[e.jsx("span",{"aria-hidden":"true",children:"🛒"}),e.jsx("span",{className:"es-dap__play-label",children:L?`${i("dap.section.sales")} · ${i("dap.sales.educational")}`:`${i("dap.section.sales")} · ${o.linkedToBinarySide}`}),e.jsx("span",{className:"es-dap__play-spacer"}),!L&&e.jsx("span",{className:"es-dap__pill es-dap__pill--ok",children:`${o.linkedToBinarySide} ${i("dap.gauge.leg")}`}),L&&e.jsx("span",{className:"es-dap__pill es-dap__pill--info",children:i("dap.sales.no_cycle")})]}),o.summary&&e.jsx("div",{className:"es-dap__play-summary",children:o.summary}),o.details?.rationale&&e.jsxs(O,{teaser:o.details.rationale,isOpen:_.sales??!1,children:[o.details?.productOrCycleAction&&e.jsx("p",{className:"es-dap__detail-text es-dap__detail-text--product",children:o.details.productOrCycleAction}),e.jsx("p",{className:"es-dap__detail-text",children:o.details.rationale})]}),o.details?.concreteStep&&e.jsxs("div",{className:"es-dap__do",children:[e.jsxs("b",{children:[i("dap.play.do"),":"]})," ",o.details.concreteStep]}),o.details?.marketSignal&&e.jsx("p",{className:"es-dap__detail-text es-dap__detail-text--market",children:o.details.marketSignal}),o.details?.complianceNote&&e.jsxs("div",{className:"es-dap__compliance",children:[e.jsx("span",{className:"es-dap__compliance-ico","aria-hidden":"true",children:"ⓘ"}),e.jsx("span",{children:o.details.complianceNote})]}),e.jsx(S,{moreToggle:o.details?.rationale&&e.jsx(M,{isOpen:_.sales??!1,onToggle:()=>R("sales"),expandLabel:i("dap.aria.expand_sales"),collapseLabel:i("dap.aria.collapse_sales"),t:i}),gaioLink:!L&&g&&e.jsx(T,{section:i("dap.section.sales"),summary:o.summary,content:je(o,i),onTalk:v,t:i})}),w("sales")]})]})]})]})}export{He as Component,Fe as manifest};
4
- //# sourceMappingURL=index-DDHI4Kxr-DrVjDDba.js.map
4
+ //# sourceMappingURL=index-E59S8-Gw-CovGUxIZ.js.map
@@ -1,4 +1,4 @@
1
1
  import{j as e,Q 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-Ce0ahORn-bdo5pwX-.js.map
4
+ //# sourceMappingURL=index-OcrS6o5Y-bdo5pwX-.js.map
@@ -1,2 +1,2 @@
1
- import{r as g,j as a,Q as B}from"../nexly.js";import{C as K}from"./block-rating-BgOeTm52-CoiP5C2K.js";import{m as L}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";const v=["G-Miner","Miner","Developer","Team Leader","Manager","Senior Manager","Vice President","President","Chairman"],F={"G-Miner":0,Miner:2,Developer:4,"Team Leader":6,Manager:7,"Senior Manager":8,"Vice President":9,President:10,Chairman:15},W={"G-Miner":0,Miner:2,Developer:4,"Team Leader":6,Manager:8,"Senior Manager":9,"Vice President":10,President:11,Chairman:12},A={"G-Miner":50,Miner:50,Developer:50,"Team Leader":50,Manager:50,"Senior Manager":50,"Vice President":50,President:50,Chairman:75},X=.1,I=50,O=150,Q=5,R=1,$=10,U=5e4,z=100,H=7,q=30,S={paidRank:"Miner",scp1Cycles:1,scp1PerCycle:100,scp2Cycles:1,scp2PerCycle:5,scp3DirectSales:500};function E(e){return typeof e=="string"&&v.includes(e)}function G(e,d){const c=F[d];return!Number.isFinite(e)||e<0?0:Math.min(e,c)}function J(e,d){const c=A[d];return!Number.isFinite(e)||e<0?0:Math.min(e,c)}function Y(e){const d=e.paidRank==="G-Miner",c=d?0:Math.max(0,e.scp1Cycles)*Math.max(0,e.scp1PerCycle),s=d?0:Math.max(0,e.scp2Cycles)*Math.max(0,e.scp2PerCycle),m=Math.round(Math.max(0,e.scp3DirectSales)*X),o=c+s+m,x=o*H,l=o*q;return{scp1Daily:c,scp2Daily:s,scp3Daily:m,totalDaily:o,totalWeekly:x,totalMonthly:l}}function Z(e,d){const c=d.currentPayoutRank,s=e.defaultPaidRank,m=E(c)?c:E(s)?s:v[0],o=e.defaultScp2PerCycle,x=typeof o=="number"&&Number.isFinite(o)?Math.min($,Math.max(R,o)):S.scp2PerCycle;return{...S,paidRank:m,scp1Cycles:G(S.scp1Cycles,m),scp2PerCycle:x}}function p(e,d,c){return`${c}${new Intl.NumberFormat(d,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}`}function N({id:e,label:d,value:c,min:s,max:m,step:o,unit:x,currencySymbol:l,locale:n,disabled:b,onChange:i}){const C=x==="$"?p(c,n,l):c.toLocaleString(n),u=x==="$"?p(s,n,l):String(s),t=x==="$"?p(m,n,l):String(m);return a.jsxs("div",{className:`mlmcalc-slider-row${b?" mlmcalc-slider-row--disabled":""}`,children:[a.jsxs("div",{className:"mlmcalc-slider-header",children:[a.jsx("label",{className:"mlmcalc-slider-label",htmlFor:e,children:d}),a.jsx("span",{className:"mlmcalc-slider-value",children:C})]}),a.jsx("input",{id:e,type:"range",className:"mlmcalc-slider",min:s,max:m,step:o,value:c,disabled:b,onChange:h=>i(Number(h.target.value)),onPointerDown:h=>{if(b)return;const k=h.currentTarget.getBoundingClientRect(),f=h.clientX-k.left,M=m-s;if(M<=0)return;const _=(c-s)/M*k.width;if(Math.abs(f-_)<=12)return;const j=Math.max(0,Math.min(1,f/k.width)),D=s+j*M,P=Math.max(s,Math.min(m,Math.round((D-s)/o)*o+s));let r=P;if(P===c){const y=f>_?1:-1;r=Math.max(s,Math.min(m,c+y*o))}r!==c&&(h.preventDefault(),i(r))},style:{"--mlmcalc-fill":`${m>s?(c-s)/(m-s)*100:0}%`}}),a.jsxs("div",{className:"mlmcalc-slider-bounds",children:[a.jsx("span",{children:u}),a.jsx("span",{children:t})]})]})}function ca({data:e,config:d,i18n:c,baseUrl:s,externalContext:m,auth:o,previewMode:x}){const l=c?.t??(r=>r),n=c?.currentLanguage??"en",b=g.useMemo(()=>Z(d,e),[d,e]),[i,C]=g.useState(b),u=g.useMemo(()=>Y(i),[i]),t=l("mlm_calculator.currency_symbol"),h=i.paidRank==="G-Miner",k=F[i.paidRank],f=A[i.paidRank],M=W[i.paidRank],_=g.useCallback(r=>{C(y=>({...y,paidRank:r,scp1Cycles:G(y.scp1Cycles,r),scp2Cycles:J(y.scp2Cycles,r)}))},[]),j=g.useCallback(r=>y=>{C(w=>({...w,[r]:y}))},[]),D=g.useCallback(()=>{C(b)},[b]),P=v.indexOf(i.paidRank);return a.jsx(B,{blockType:"mlm-calculator",children:a.jsxs("div",{className:"es-block__body",children:[a.jsx(K,{blockSlug:"mlm-calculator",baseUrl:s,apiKey:m?.apiKey,jwt:o?.jwt,previewMode:x,t:l,promptKey:"block_rating.prompt_calculator"}),a.jsxs("div",{className:"mlmcalc-block","aria-label":l("mlm_calculator.aria_label"),children:[a.jsx("div",{className:"mlmcalc-title",children:l("mlm_calculator.title")}),a.jsxs("div",{className:"mlmcalc-rank-bar",children:[a.jsx("span",{className:"mlmcalc-rank-label",children:l("mlm_calculator.paid_rank")}),a.jsx("div",{className:"mlmcalc-rank-track",role:"radiogroup","aria-label":l("mlm_calculator.paid_rank"),children:v.map((r,y)=>{const w=r===i.paidRank,T=y<=P,V=["mlmcalc-rank-node",y%2===0?"mlmcalc-rank-node--above":"mlmcalc-rank-node--below",w?"mlmcalc-rank-node--active":"",T?"mlmcalc-rank-node--past":""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",role:"radio","aria-checked":w,"aria-label":L(r,l),className:V,onClick:()=>_(r),children:[a.jsx("span",{className:"mlmcalc-rank-dot","aria-hidden":"true"}),a.jsx("span",{className:"mlmcalc-rank-name",children:L(r,l)})]},r)})})]}),a.jsxs("div",{className:"mlmcalc-earnings-grid",children:[a.jsxs("div",{className:"mlmcalc-earnings-card",children:[a.jsx("span",{className:"mlmcalc-earnings-label",children:l("mlm_calculator.weekly")}),a.jsx("span",{className:"mlmcalc-earnings-amount",children:p(u.totalWeekly,n,t)})]}),a.jsxs("div",{className:"mlmcalc-earnings-card",children:[a.jsx("span",{className:"mlmcalc-earnings-label",children:l("mlm_calculator.monthly")}),a.jsx("span",{className:"mlmcalc-earnings-amount mlmcalc-earnings-amount--monthly",children:p(u.totalMonthly,n,t)})]})]}),h&&a.jsx("div",{className:"mlmcalc-warning",role:"alert",children:l("mlm_calculator.warning.g_miner")}),a.jsxs("div",{className:"mlmcalc-scp-group",children:[a.jsxs("div",{className:"mlmcalc-scp-header",children:[a.jsx("span",{className:"mlmcalc-scp-title",children:l("mlm_calculator.scp1.title")}),a.jsx("span",{className:"mlmcalc-scp-subtotal",children:l("mlm_calculator.subtotal_per_day",{amount:p(u.scp1Daily,n,t)})})]}),a.jsx(N,{id:"mlmcalc-scp1-cycles",label:l("mlm_calculator.scp1.cycles"),value:i.scp1Cycles,min:0,max:k,step:1,unit:"",currencySymbol:t,locale:n,disabled:h,onChange:j("scp1Cycles")}),a.jsx(N,{id:"mlmcalc-scp1-per-cycle",label:l("mlm_calculator.scp1.per_cycle"),value:i.scp1PerCycle,min:I,max:O,step:Q,unit:"$",currencySymbol:t,locale:n,disabled:h,onChange:j("scp1PerCycle")})]}),a.jsxs("div",{className:"mlmcalc-scp-group",children:[a.jsxs("div",{className:"mlmcalc-scp-header",children:[a.jsx("span",{className:"mlmcalc-scp-title",children:l("mlm_calculator.scp2.title")}),a.jsx("span",{className:"mlmcalc-scp-subtotal",children:l("mlm_calculator.subtotal_per_day",{amount:p(u.scp2Daily,n,t)})})]}),a.jsx(N,{id:"mlmcalc-scp2-cycles",label:l("mlm_calculator.scp2.cycles",{levels:M}),value:i.scp2Cycles,min:0,max:f,step:1,unit:"",currencySymbol:t,locale:n,disabled:h,onChange:j("scp2Cycles")}),a.jsx(N,{id:"mlmcalc-scp2-per-cycle",label:l("mlm_calculator.scp2.per_cycle"),value:i.scp2PerCycle,min:R,max:$,step:1,unit:"$",currencySymbol:t,locale:n,disabled:h,onChange:j("scp2PerCycle")})]}),a.jsxs("div",{className:"mlmcalc-scp-group",children:[a.jsxs("div",{className:"mlmcalc-scp-header",children:[a.jsx("span",{className:"mlmcalc-scp-title",children:l("mlm_calculator.scp3.title")}),a.jsx("span",{className:"mlmcalc-scp-subtotal",children:l("mlm_calculator.subtotal_per_day",{amount:p(u.scp3Daily,n,t)})})]}),a.jsx(N,{id:"mlmcalc-scp3-sales",label:l("mlm_calculator.scp3.daily_sales"),value:i.scp3DirectSales,min:0,max:U,step:z,unit:"$",currencySymbol:t,locale:n,onChange:j("scp3DirectSales")})]}),a.jsxs("div",{className:"mlmcalc-breakdown",children:[a.jsxs("div",{className:"mlmcalc-breakdown-row",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.scp1")}),a.jsx("span",{children:p(u.scp1Daily,n,t)})]}),a.jsxs("div",{className:"mlmcalc-breakdown-row",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.scp2")}),a.jsx("span",{children:p(u.scp2Daily,n,t)})]}),a.jsxs("div",{className:"mlmcalc-breakdown-row",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.scp3")}),a.jsx("span",{children:p(u.scp3Daily,n,t)})]}),a.jsxs("div",{className:"mlmcalc-breakdown-row mlmcalc-breakdown-row--total",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.total")}),a.jsx("span",{children:p(u.totalDaily,n,t)})]})]}),a.jsx("div",{className:"mlmcalc-actions",children:a.jsx("button",{type:"button",className:"mlmcalc-reset",onClick:D,children:l("mlm_calculator.reset")})}),a.jsx("p",{className:"mlmcalc-disclaimer",children:l("mlm_calculator.disclaimer")})]})]})})}const sa={slug:"mlm-calculator",name:"MLM Commission Calculator",version:"2.0.0",category:"interactive",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},defaultPaidRank:{type:"string",default:"Miner"},defaultScp2PerCycle:{type:"number",default:5}}},defaultConfig:{readAloudEnabled:!1,defaultPaidRank:"Miner",defaultScp2PerCycle:5},sizing:{minWidth:300,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"defaultPaidRank",type:"select",label:"Default paid rank",default:"Miner",options:v.map(e=>({label:e,value:e})),group:"Defaults"},{id:"defaultScp2PerCycle",type:"number",label:"Default SCP2 per-cycle amount",default:5,min:R,max:$,group:"Defaults"}],events:{}};export{ca as Component,ca as MlmCalculatorBlock,v as RANK_ORDER,F as SCP1_MAX_CYCLES,W as SCP2_MAX_LEVELS,Y as computeImineEarnings,sa as manifest};
2
- //# sourceMappingURL=index-Bl_8GpS0-CahNhEcx.js.map
1
+ import{r as g,j as a,Q as B}from"../nexly.js";import{C as K}from"./block-rating-D7hR2gTc-CoiP5C2K.js";import{m as L}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";const v=["G-Miner","Miner","Developer","Team Leader","Manager","Senior Manager","Vice President","President","Chairman"],F={"G-Miner":0,Miner:2,Developer:4,"Team Leader":6,Manager:7,"Senior Manager":8,"Vice President":9,President:10,Chairman:15},W={"G-Miner":0,Miner:2,Developer:4,"Team Leader":6,Manager:8,"Senior Manager":9,"Vice President":10,President:11,Chairman:12},A={"G-Miner":50,Miner:50,Developer:50,"Team Leader":50,Manager:50,"Senior Manager":50,"Vice President":50,President:50,Chairman:75},X=.1,I=50,O=150,Q=5,R=1,$=10,U=5e4,z=100,H=7,q=30,S={paidRank:"Miner",scp1Cycles:1,scp1PerCycle:100,scp2Cycles:1,scp2PerCycle:5,scp3DirectSales:500};function E(e){return typeof e=="string"&&v.includes(e)}function G(e,d){const c=F[d];return!Number.isFinite(e)||e<0?0:Math.min(e,c)}function J(e,d){const c=A[d];return!Number.isFinite(e)||e<0?0:Math.min(e,c)}function Y(e){const d=e.paidRank==="G-Miner",c=d?0:Math.max(0,e.scp1Cycles)*Math.max(0,e.scp1PerCycle),s=d?0:Math.max(0,e.scp2Cycles)*Math.max(0,e.scp2PerCycle),m=Math.round(Math.max(0,e.scp3DirectSales)*X),o=c+s+m,x=o*H,l=o*q;return{scp1Daily:c,scp2Daily:s,scp3Daily:m,totalDaily:o,totalWeekly:x,totalMonthly:l}}function Z(e,d){const c=d.currentPayoutRank,s=e.defaultPaidRank,m=E(c)?c:E(s)?s:v[0],o=e.defaultScp2PerCycle,x=typeof o=="number"&&Number.isFinite(o)?Math.min($,Math.max(R,o)):S.scp2PerCycle;return{...S,paidRank:m,scp1Cycles:G(S.scp1Cycles,m),scp2PerCycle:x}}function p(e,d,c){return`${c}${new Intl.NumberFormat(d,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}`}function N({id:e,label:d,value:c,min:s,max:m,step:o,unit:x,currencySymbol:l,locale:n,disabled:b,onChange:i}){const C=x==="$"?p(c,n,l):c.toLocaleString(n),u=x==="$"?p(s,n,l):String(s),t=x==="$"?p(m,n,l):String(m);return a.jsxs("div",{className:`mlmcalc-slider-row${b?" mlmcalc-slider-row--disabled":""}`,children:[a.jsxs("div",{className:"mlmcalc-slider-header",children:[a.jsx("label",{className:"mlmcalc-slider-label",htmlFor:e,children:d}),a.jsx("span",{className:"mlmcalc-slider-value",children:C})]}),a.jsx("input",{id:e,type:"range",className:"mlmcalc-slider",min:s,max:m,step:o,value:c,disabled:b,onChange:h=>i(Number(h.target.value)),onPointerDown:h=>{if(b)return;const k=h.currentTarget.getBoundingClientRect(),f=h.clientX-k.left,M=m-s;if(M<=0)return;const _=(c-s)/M*k.width;if(Math.abs(f-_)<=12)return;const j=Math.max(0,Math.min(1,f/k.width)),D=s+j*M,P=Math.max(s,Math.min(m,Math.round((D-s)/o)*o+s));let r=P;if(P===c){const y=f>_?1:-1;r=Math.max(s,Math.min(m,c+y*o))}r!==c&&(h.preventDefault(),i(r))},style:{"--mlmcalc-fill":`${m>s?(c-s)/(m-s)*100:0}%`}}),a.jsxs("div",{className:"mlmcalc-slider-bounds",children:[a.jsx("span",{children:u}),a.jsx("span",{children:t})]})]})}function ca({data:e,config:d,i18n:c,baseUrl:s,externalContext:m,auth:o,previewMode:x}){const l=c?.t??(r=>r),n=c?.currentLanguage??"en",b=g.useMemo(()=>Z(d,e),[d,e]),[i,C]=g.useState(b),u=g.useMemo(()=>Y(i),[i]),t=l("mlm_calculator.currency_symbol"),h=i.paidRank==="G-Miner",k=F[i.paidRank],f=A[i.paidRank],M=W[i.paidRank],_=g.useCallback(r=>{C(y=>({...y,paidRank:r,scp1Cycles:G(y.scp1Cycles,r),scp2Cycles:J(y.scp2Cycles,r)}))},[]),j=g.useCallback(r=>y=>{C(w=>({...w,[r]:y}))},[]),D=g.useCallback(()=>{C(b)},[b]),P=v.indexOf(i.paidRank);return a.jsx(B,{blockType:"mlm-calculator",children:a.jsxs("div",{className:"es-block__body",children:[a.jsx(K,{blockSlug:"mlm-calculator",baseUrl:s,apiKey:m?.apiKey,jwt:o?.jwt,previewMode:x,t:l,promptKey:"block_rating.prompt_calculator"}),a.jsxs("div",{className:"mlmcalc-block","aria-label":l("mlm_calculator.aria_label"),children:[a.jsx("div",{className:"mlmcalc-title",children:l("mlm_calculator.title")}),a.jsxs("div",{className:"mlmcalc-rank-bar",children:[a.jsx("span",{className:"mlmcalc-rank-label",children:l("mlm_calculator.paid_rank")}),a.jsx("div",{className:"mlmcalc-rank-track",role:"radiogroup","aria-label":l("mlm_calculator.paid_rank"),children:v.map((r,y)=>{const w=r===i.paidRank,T=y<=P,V=["mlmcalc-rank-node",y%2===0?"mlmcalc-rank-node--above":"mlmcalc-rank-node--below",w?"mlmcalc-rank-node--active":"",T?"mlmcalc-rank-node--past":""].filter(Boolean).join(" ");return a.jsxs("button",{type:"button",role:"radio","aria-checked":w,"aria-label":L(r,l),className:V,onClick:()=>_(r),children:[a.jsx("span",{className:"mlmcalc-rank-dot","aria-hidden":"true"}),a.jsx("span",{className:"mlmcalc-rank-name",children:L(r,l)})]},r)})})]}),a.jsxs("div",{className:"mlmcalc-earnings-grid",children:[a.jsxs("div",{className:"mlmcalc-earnings-card",children:[a.jsx("span",{className:"mlmcalc-earnings-label",children:l("mlm_calculator.weekly")}),a.jsx("span",{className:"mlmcalc-earnings-amount",children:p(u.totalWeekly,n,t)})]}),a.jsxs("div",{className:"mlmcalc-earnings-card",children:[a.jsx("span",{className:"mlmcalc-earnings-label",children:l("mlm_calculator.monthly")}),a.jsx("span",{className:"mlmcalc-earnings-amount mlmcalc-earnings-amount--monthly",children:p(u.totalMonthly,n,t)})]})]}),h&&a.jsx("div",{className:"mlmcalc-warning",role:"alert",children:l("mlm_calculator.warning.g_miner")}),a.jsxs("div",{className:"mlmcalc-scp-group",children:[a.jsxs("div",{className:"mlmcalc-scp-header",children:[a.jsx("span",{className:"mlmcalc-scp-title",children:l("mlm_calculator.scp1.title")}),a.jsx("span",{className:"mlmcalc-scp-subtotal",children:l("mlm_calculator.subtotal_per_day",{amount:p(u.scp1Daily,n,t)})})]}),a.jsx(N,{id:"mlmcalc-scp1-cycles",label:l("mlm_calculator.scp1.cycles"),value:i.scp1Cycles,min:0,max:k,step:1,unit:"",currencySymbol:t,locale:n,disabled:h,onChange:j("scp1Cycles")}),a.jsx(N,{id:"mlmcalc-scp1-per-cycle",label:l("mlm_calculator.scp1.per_cycle"),value:i.scp1PerCycle,min:I,max:O,step:Q,unit:"$",currencySymbol:t,locale:n,disabled:h,onChange:j("scp1PerCycle")})]}),a.jsxs("div",{className:"mlmcalc-scp-group",children:[a.jsxs("div",{className:"mlmcalc-scp-header",children:[a.jsx("span",{className:"mlmcalc-scp-title",children:l("mlm_calculator.scp2.title")}),a.jsx("span",{className:"mlmcalc-scp-subtotal",children:l("mlm_calculator.subtotal_per_day",{amount:p(u.scp2Daily,n,t)})})]}),a.jsx(N,{id:"mlmcalc-scp2-cycles",label:l("mlm_calculator.scp2.cycles",{levels:M}),value:i.scp2Cycles,min:0,max:f,step:1,unit:"",currencySymbol:t,locale:n,disabled:h,onChange:j("scp2Cycles")}),a.jsx(N,{id:"mlmcalc-scp2-per-cycle",label:l("mlm_calculator.scp2.per_cycle"),value:i.scp2PerCycle,min:R,max:$,step:1,unit:"$",currencySymbol:t,locale:n,disabled:h,onChange:j("scp2PerCycle")})]}),a.jsxs("div",{className:"mlmcalc-scp-group",children:[a.jsxs("div",{className:"mlmcalc-scp-header",children:[a.jsx("span",{className:"mlmcalc-scp-title",children:l("mlm_calculator.scp3.title")}),a.jsx("span",{className:"mlmcalc-scp-subtotal",children:l("mlm_calculator.subtotal_per_day",{amount:p(u.scp3Daily,n,t)})})]}),a.jsx(N,{id:"mlmcalc-scp3-sales",label:l("mlm_calculator.scp3.daily_sales"),value:i.scp3DirectSales,min:0,max:U,step:z,unit:"$",currencySymbol:t,locale:n,onChange:j("scp3DirectSales")})]}),a.jsxs("div",{className:"mlmcalc-breakdown",children:[a.jsxs("div",{className:"mlmcalc-breakdown-row",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.scp1")}),a.jsx("span",{children:p(u.scp1Daily,n,t)})]}),a.jsxs("div",{className:"mlmcalc-breakdown-row",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.scp2")}),a.jsx("span",{children:p(u.scp2Daily,n,t)})]}),a.jsxs("div",{className:"mlmcalc-breakdown-row",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.scp3")}),a.jsx("span",{children:p(u.scp3Daily,n,t)})]}),a.jsxs("div",{className:"mlmcalc-breakdown-row mlmcalc-breakdown-row--total",children:[a.jsx("span",{children:l("mlm_calculator.breakdown.total")}),a.jsx("span",{children:p(u.totalDaily,n,t)})]})]}),a.jsx("div",{className:"mlmcalc-actions",children:a.jsx("button",{type:"button",className:"mlmcalc-reset",onClick:D,children:l("mlm_calculator.reset")})}),a.jsx("p",{className:"mlmcalc-disclaimer",children:l("mlm_calculator.disclaimer")})]})]})})}const sa={slug:"mlm-calculator",name:"MLM Commission Calculator",version:"2.0.0",category:"interactive",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},defaultPaidRank:{type:"string",default:"Miner"},defaultScp2PerCycle:{type:"number",default:5}}},defaultConfig:{readAloudEnabled:!1,defaultPaidRank:"Miner",defaultScp2PerCycle:5},sizing:{minWidth:300,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"defaultPaidRank",type:"select",label:"Default paid rank",default:"Miner",options:v.map(e=>({label:e,value:e})),group:"Defaults"},{id:"defaultScp2PerCycle",type:"number",label:"Default SCP2 per-cycle amount",default:5,min:R,max:$,group:"Defaults"}],events:{}};export{ca as Component,ca as MlmCalculatorBlock,v as RANK_ORDER,F as SCP1_MAX_CYCLES,W as SCP2_MAX_LEVELS,Y as computeImineEarnings,sa as manifest};
2
+ //# sourceMappingURL=index-PxSB6BA6-DFxY6dqO.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as q,j as e,Q as m,o as w}from"../nexly.js";import{m as l}from"./block-helpers-Cg_zAqG6-DnN2COvk.js";const M={slug:"rank-advancement-roadmap",name:"Rank Advancement Roadmap",version:"1.0.0",category:"data",requiredService:"rank-advancement-roadmap",configSchema:{properties:{mode:{type:"string",default:"basic"},showAiTip:{type:"boolean",default:!0}}},defaultConfig:{mode:"basic",showAiTip:!0},sizing:{minWidth:280,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"],dataContract:{serviceSlug:"rank-advancement-roadmap",inputSchema:{type:"object",properties:{currentRank:{type:"string"},nextRank:{type:"string"},progressPercent:{type:"number"},rankTree:{type:"array",items:{type:"object",properties:{rank:{type:"string"},requirements:{type:"array",items:{type:"string"}},achieved:{type:"boolean"}}}},aiTip:{type:"string"},mode:{type:"string",enum:["basic","pro"]}}},previewDataOverride:{currentRank:"Silver",nextRank:"Gold",progressPercent:62,mode:"pro",aiTip:"You're 38% away from Gold. Focus on recruiting 2 active distributors to your right leg — that's your fastest path to the next milestone.",rankTree:[{rank:"G-Miner",requirements:["Personal purchase: 50 pts"],achieved:!0},{rank:"Miner",requirements:["Personal purchase: 100 pts","Team volume: 500 pts"],achieved:!0},{rank:"Developer",requirements:["Personal purchase: 200 pts","Team volume: 1,500 pts"],achieved:!0},{rank:"Team Leader",requirements:["Personal purchase: 300 pts","Team volume: 5,000 pts","2 Developers in team"],achieved:!0},{rank:"Manager",requirements:["Personal purchase: 400 pts","Team volume: 15,000 pts","2 Team Leaders"],achieved:!1},{rank:"Senior Manager",requirements:["Personal purchase: 500 pts","Team volume: 40,000 pts","3 Managers"],achieved:!1},{rank:"Vice President",requirements:["Personal purchase: 600 pts","Team volume: 100,000 pts","4 Senior Managers"],achieved:!1},{rank:"President",requirements:["Personal purchase: 700 pts","Team volume: 250,000 pts","5 Vice Presidents"],achieved:!1}]}},fields:[{id:"mode",type:"select",label:"Display mode",default:"basic",options:[{label:"Basic — current rank + progress",value:"basic"},{label:"Pro — full rank tree",value:"pro"}],group:"Display"},{id:"showAiTip",type:"toggle",label:"Show AI coaching tip (pro mode)",default:!0,group:"Display"}],events:{emits:[{name:"rar:rankExpanded",description:"User expanded a rank in the accordion"}],listens:[{name:"rar:refresh",description:"Force refresh rank data"}]}};function k(s,o,d){return Math.min(Math.max(s,o),d)}function D({data:s,config:o,actions:d,metadata:v,i18n:x}){const r=x?.t??(a=>a),_=o.mode??s.mode??"basic",g=o.showAiTip??!0,p=s.currentRank,t=s.nextRank,b=k(s.progressPercent??0,0,100),u=s.rankTree??[],h=s.aiTip,[j,y]=q.useState(new Set);if(!p&&!s.error)return e.jsx(m,{blockType:"rank-advancement-roadmap",children:e.jsx("div",{className:"es-block__body es-rar__body",children:e.jsxs("div",{className:"es-rar__current-card",children:[e.jsx("div",{className:"es-rar__section-label",children:r("rank_roadmap.current_rank")}),e.jsx("div",{className:"es-rar__rank-row",children:e.jsx("span",{className:"es-rar__rank-name",style:{color:"var(--es-color-on-surface-muted, #4B5563)"},children:"—"})}),e.jsxs("div",{className:"es-rar__progress-label",children:[e.jsx("span",{children:v?.dataQuality==="none"?r("rank_roadmap.signin_prompt"):r("rank_roadmap.loading")}),e.jsx("span",{children:"0%"})]}),e.jsx("div",{className:"es-rar__progress-bar",children:e.jsx("div",{className:"es-rar__progress-fill",style:{width:"0%"}})})]})})});if(s.error)return e.jsx(m,{blockType:"rank-advancement-roadmap",error:w(s.error)});function f(a){y(c=>{const n=new Set(c);return n.has(a)?n.delete(a):(n.add(a),d.emit("rar:rankExpanded",{rank:a})),n})}const i=k(b,0,100);return e.jsx(m,{blockType:"rank-advancement-roadmap",children:e.jsxs("div",{className:"es-block__body es-rar__body",children:[e.jsxs("div",{className:"es-rar__current-card",children:[e.jsx("div",{className:"es-rar__section-label",children:r("rank_roadmap.current_rank")}),e.jsxs("div",{className:"es-rar__rank-row",children:[e.jsx("span",{className:"es-rar__rank-name",children:l(p??"",r)}),e.jsxs("span",{className:"es-rar__rank-badge",children:[i,"%"]})]}),e.jsxs("div",{className:"es-rar__progress-label",children:[e.jsx("span",{children:r("rank_roadmap.progress_to",{rank:t?l(t,r):r("rank_roadmap.next_rank_fallback")})}),e.jsxs("span",{children:[i,"%"]})]}),e.jsx("div",{className:"es-rar__progress-bar",children:e.jsx("div",{className:"es-rar__progress-fill",style:{width:`${i}%`},role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r("rank_roadmap.progress_aria",{percent:i,rank:t?l(t,r):r("rank_roadmap.next_rank_fallback")})})}),t&&e.jsx("div",{className:"es-rar__next-rank-hint",children:r("rank_roadmap.next_label",{rank:l(t,r)})})]}),g&&_==="pro"&&e.jsxs("div",{className:`es-rar__ai-tip${h?"":" es-rar__ai-tip--loading"}`,children:[e.jsx("div",{className:"es-rar__ai-tip-label",children:r("rank_roadmap.ai_tip_label")}),e.jsx("div",{className:"es-rar__ai-tip-text",children:h??r("rank_roadmap.analyzing")})]}),_==="pro"&&u.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"es-rar__tree-label",children:r("rank_roadmap.tree_label")}),e.jsx("ul",{className:"es-rar__tree",role:"list",children:u.map(a=>{const c=a.rank===p,n=j.has(a.rank),N=["es-rar__tree-item",a.achieved?"es-rar__tree-item--achieved":"",c?"es-rar__tree-item--current":""].filter(Boolean).join(" ");return e.jsxs("li",{className:N,children:[e.jsxs("button",{className:"es-rar__tree-header",onClick:()=>f(a.rank),"aria-expanded":n,"aria-controls":`rar-reqs-${a.rank}`,children:[e.jsx("span",{className:"es-rar__tree-status-icon","aria-hidden":"true",children:a.achieved?"✓":c?"▶":"○"}),e.jsx("span",{className:"es-rar__tree-rank-name",children:l(a.rank,r)}),e.jsx("span",{className:`es-rar__tree-chevron${n?" es-rar__tree-chevron--open":""}`,"aria-hidden":"true",children:"▾"})]}),n&&e.jsx("ul",{id:`rar-reqs-${a.rank}`,className:"es-rar__tree-requirements",role:"list",children:a.requirements.map((T,P)=>e.jsx("li",{className:"es-rar__tree-req",children:T},P))})]},a.rank)})})]})]})})}export{D as Component,M as manifest};
2
- //# sourceMappingURL=index-Wza_7CGb-W1lJrIDD.js.map
2
+ //# sourceMappingURL=index-cCAzBYyN-W1lJrIDD.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as u,j as e,Q as c,o 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-DzHo_iNR-Dm9kbc85.js.map
2
+ //# sourceMappingURL=index-kAGaGinD-Dm9kbc85.js.map
@@ -1,2 +1,2 @@
1
1
  import{a as w,r as t,j as e,Q as k}from"../nexly.js";const S={slug:"qa",name:"AI Q&A",version:"1.0.0",category:"interactive",requiredService:"ai-orchestrator",configSchema:{properties:{readAloudEnabled:{type:"boolean",default:!1},placeholder:{type:"string",default:""},maxQuestionsPerSession:{type:"number",default:5},responseLanguage:{type:"string",default:"en"}}},defaultConfig:{readAloudEnabled:!1,placeholder:"",maxQuestionsPerSession:5,responseLanguage:"en"},dataContract:{serviceSlug:"ai-orchestrator",inputSchema:{type:"object",properties:{answer:{type:"string",description:"AI answer to the user question"},question:{type:"string",description:"The question that was asked"}},required:["answer"]},previewDataOverride:{answer:"This product is made from 100% organic cotton and is machine washable. It comes in sizes XS-XXL.",question:"What materials is this made from?"}},fields:[{id:"readAloudEnabled",type:"toggle",label:"Read this panel aloud",default:!1,group:"Voice"},{id:"placeholder",type:"localized-text",label:"Input placeholder",default:"",placeholder:'Leave empty to use translated default (e.g. "Ask a question about this product...")',group:"Content"},{id:"maxQuestionsPerSession",type:"range",label:"Max questions per session",default:5,min:1,max:20,step:1,group:"Behavior"},{id:"responseLanguage",type:"select",label:"Response language",default:"en",options:[{label:"English",value:"en"},{label:"Korean",value:"ko"},{label:"Spanish",value:"es"},{label:"French",value:"fr"},{label:"German",value:"de"}],group:"Behavior"}],events:{emits:[{name:"qa:questionAsked",description:"User submitted a question"},{name:"qa:answerReceived",description:"AI answer received"}],listens:[{name:"qa:clear",description:"Clear Q&A history"}]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!0},supportedPlacements:["main","sidebar"]};function A({config:u,actions:h,i18n:m}){const s=m?.t??(a=>a),f=m?.currentLanguage??"en",x=w(u.placeholder,f,{t:s,fallbackKey:"qa.input_placeholder",enDefault:"Ask a question about this product..."}),i=u.maxQuestionsPerSession??5,[d,_]=t.useState(""),[o,v]=t.useState([]),[n,g]=t.useState(!1),[q,c]=t.useState(null),b=t.useRef(null),r=o.length>=i,p=t.useCallback(async()=>{const a=d.trim();if(!(!a||n||r)){g(!0),c(null);try{const l=await h.call("ask",{question:a,language:u.responseLanguage??"en"});l?.error?c(l.error):l?.answer?(v(j=>[...j,{question:a,answer:l.answer}]),_(""),setTimeout(()=>{b.current?.scrollIntoView({behavior:"smooth"})},50)):c(s("qa.error_no_answer"))}catch{c(s("qa.error_generic"))}finally{g(!1)}}},[d,n,r,h,u.responseLanguage]),y=t.useCallback(a=>{a.key==="Enter"&&(a.preventDefault(),p())},[p]);return e.jsxs(k,{blockType:"qa",children:[e.jsxs("div",{className:"es-block__body",children:[o.length===0&&!n&&e.jsx("div",{className:"es-block__empty es-qa__empty",children:s("qa.empty_state")}),o.length>0&&e.jsxs("div",{className:"es-qa__history",children:[o.map((a,l)=>e.jsxs("div",{className:"es-qa__entry",children:[e.jsxs("div",{className:"es-qa__question",children:[e.jsx("span",{className:"es-qa__question-label","aria-hidden":"true",children:"Q"}),e.jsx("span",{className:"es-qa__question-text",children:a.question})]}),e.jsxs("div",{className:"es-qa__answer",children:[e.jsx("span",{className:"es-qa__answer-label","aria-hidden":"true",children:"A"}),e.jsx("span",{className:"es-qa__answer-text",children:a.answer})]})]},l)),e.jsx("div",{ref:b})]}),q&&e.jsx("div",{className:"es-qa__error",role:"alert",children:q}),r&&e.jsx("div",{className:"es-qa__limit-notice",children:s("qa.limit_reached",{count:i})})]}),e.jsxs("div",{className:"es-block__footer",children:[e.jsxs("div",{className:"es-qa__input-row",children:[e.jsx("input",{className:"es-qa__input",type:"text",value:d,onChange:a=>_(a.target.value),onKeyDown:y,placeholder:r?s("qa.limit_reached",{count:i}):x,disabled:n||r,"aria-label":s("qa.input_aria_label")}),e.jsx("button",{className:"es-qa__btn",onClick:p,disabled:!d.trim()||n||r,type:"button","aria-label":s("qa.submit_aria_label"),children:s(n?"qa.loading":"qa.ask_button")})]}),i>0&&e.jsx("div",{className:"es-qa__counter",children:s("qa.counter",{used:o.length,max:i})})]})]})}export{A as Component,S as manifest};
2
- //# sourceMappingURL=index-BDhTixUR-Aqz1AnQ5.js.map
2
+ //# sourceMappingURL=index-l8Oxwea3-Aqz1AnQ5.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as t,j as e,Q as N}from"../nexly.js";const S={slug:"chat-session-nav",name:"Chat Session Navigator",version:"1.0.0",category:"interactive",configSchema:{},defaultConfig:{},sizing:{minWidth:200,preferredHeight:"fill",scrollable:!0},supportedPlacements:["sidebar","main"],events:{emits:[{name:"chat:select-session",description:"User selected a past chat session"}]}};function E(a,i){const d=Date.now()-new Date(a).getTime(),o=Math.floor(d/6e4);if(o<1)return i("time.just_now");if(o<60)return i("time.minutes_ago",{count:o});const c=Math.floor(o/60);return c<24?i("time.hours_ago",{count:c}):i("time.days_ago",{count:Math.floor(c/24)})}function H({actions:a,baseUrl:i,productId:d,i18n:o,auth:c,sessionId:v}){const n=o?.t??(s=>s),f=c?.jwt,[p,l]=t.useState(!1),[x,w]=t.useState([]),[h,b]=t.useState(!1),[j,g]=t.useState(null),[u,_]=t.useState(v??null);t.useEffect(()=>{_(v??null)},[v]);const m=t.useCallback(async()=>{b(!0),g(null);try{const s=await fetch(`${i}/api/chat/sessions?productId=${encodeURIComponent(d||"")}`,{headers:{...f?{Authorization:`Bearer ${f}`}:{}},credentials:"include"});if(!s.ok)throw new Error(`HTTP ${s.status}`);const r=await s.json();if(!r.success)throw new Error("Invalid response");w(r.data?.sessions??[])}catch{g(n("chat_session_nav.load_error"))}finally{b(!1)}},[i,f,d,n]);t.useEffect(()=>a.on("chat:session",s=>{const{sessionId:r}=s;r&&_(r),p&&m()}),[a,m,p]),t.useEffect(()=>a.on("chat:showHistory",()=>{l(!0),m()}),[a,m]),t.useEffect(()=>a.on("chat:clearHistory",()=>{l(!1)}),[a]);const y=t.useCallback(s=>{s!==u&&(_(s),a.emit("chat:select-session",{sessionId:s}),l(!1))},[a,u]),k=t.useCallback(()=>{a.emit("chat:clearHistory",void 0),_(null),l(!1)},[a]),C=t.useCallback(()=>{l(!1)},[]);return p?e.jsxs(N,{blockType:"chat-session-nav",children:[e.jsxs("div",{className:"es-csn__header",children:[e.jsx("span",{className:"es-csn__header-title",children:n("chat_session_nav.title")}),e.jsxs("div",{className:"es-csn__header-actions",children:[e.jsx("button",{type:"button",className:"es-csn__action-btn","aria-label":n("chat_session_nav.new_session"),title:n("chat_session_nav.new_session"),onClick:k,children:e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M12 5H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"})]})}),e.jsx("button",{type:"button",className:"es-csn__close-btn","aria-label":n("chat_session_nav.close"),onClick:C,children:"✕"})]})]}),e.jsx("div",{className:"es-block__body",children:e.jsxs("div",{className:"es-csn__list",role:"list","aria-label":n("chat_session_nav.list_aria"),children:[h&&e.jsx("div",{className:"es-csn__loading",role:"status",children:n("chat_session_nav.loading")}),j&&!h&&e.jsx("div",{className:"es-csn__error",role:"alert",children:j}),!h&&!j&&x.length===0&&e.jsx("div",{className:"es-csn__empty",children:n("chat_session_nav.empty")}),!h&&x.map(s=>e.jsxs("button",{role:"listitem",type:"button",className:`es-csn__item${s.id===u?" es-csn__item--active":""}`,onClick:()=>y(s.id),"aria-current":s.id===u?"true":void 0,children:[e.jsx("div",{className:"es-csn__item-preview",children:s.lastUserMessage??n("chat_session_nav.no_preview")}),e.jsxs("div",{className:"es-csn__item-meta",children:[e.jsx("span",{children:E(s.updatedAt,n)}),s.messageCount>0&&e.jsx("span",{children:n("chat_session_nav.message_count",{count:s.messageCount})})]})]},s.id))]})})]}):null}export{H as Component,S as manifest};
2
- //# sourceMappingURL=index-DMM00SC5-R_xuAEQV.js.map
2
+ //# sourceMappingURL=index-oxM4Cgtc-R_xuAEQV.js.map
@@ -1,2 +1,2 @@
1
1
  import{r as l,j as e,Q as w}from"../nexly.js";import{S as z,I,L as T,j as W,_ as q,k as D,m as O}from"./index.modern-CioVZ357-BA5NTOmY.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";const Z={slug:"venue-map",name:"Venue Map",version:"1.0.0",category:"interactive",requiredService:"venue-discovery",configSchema:{properties:{zoom:{type:"number",default:13},showRadius:{type:"boolean",default:!0}}},defaultConfig:{zoom:13,showRadius:!0},dataContract:{serviceSlug:"venue-discovery",inputSchema:{type:"object",properties:{venues:{type:"array",items:{type:"object",properties:{id:{type:"string"},name:{type:"string"},category:{type:"string"},lat:{type:"number"},lng:{type:"number"},rating:{type:"number"},distanceKm:{type:"number"}}}},centerLat:{type:"number"},centerLng:{type:"number"},radiusKm:{type:"number"}},required:["venues"]},previewDataOverride:{venues:[{id:"v-1",name:"Blue Bottle Coffee",category:"cafe",lat:37.5172,lng:127.0473,rating:4.5,distanceKm:.3},{id:"v-2",name:"Coexartium Gallery",category:"gallery",lat:37.5118,lng:127.059,rating:4.2,distanceKm:.8},{id:"v-3",name:"Oakwood Premier COEX",category:"hotel",lat:37.5133,lng:127.0585,rating:4.7,distanceKm:1.1}],centerLat:37.515,centerLng:127.053,radiusKm:2}},fields:[{id:"zoom",type:"range",label:"Default zoom level",default:13,min:8,max:18,step:1,group:"Map"},{id:"showRadius",type:"toggle",label:"Show search radius circle",default:!0,group:"Display"}],events:{emits:[{name:"venueMap:markerClicked",description:"User clicked on a venue marker"},{name:"venueMap:viewChanged",description:"Map viewport moved or zoomed"}],listens:[{name:"venue:locationChanged",description:"Re-center map on new user location"},{name:"venues:refresh",description:"Reload venue pins on the map"}]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main"]},P={lat:37.5665,lng:126.978};let A=0;function F(){return e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3.5"}),e.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"5"}),e.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),e.jsx("line",{x1:"2",y1:"12",x2:"5",y2:"12"}),e.jsx("line",{x1:"19",y1:"12",x2:"22",y2:"12"})]})}function G(){return e.jsx("svg",{className:"es-venuemap__spinner",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:e.jsx("path",{d:"M12 3 a9 9 0 1 0 9 9",strokeLinecap:"round"})})}function H({open:i}){return e.jsx("svg",{className:`es-venuemap__chevron${i?" es-venuemap__chevron--open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}function $({data:i,i18n:x,actions:d}){const r=x?.t??(a=>a),L=x?.currentLanguage??i.language??"en",[m,M]=l.useState(null),[o,S]=l.useState(!0),[p,y]=l.useState(!1),v=l.useState(()=>`es-venue-map-body-${A++}`)[0],j=l.useRef(null),K=z(j,"--es-color-on-primary","#ffffff"),R=l.useCallback(()=>{d?.emit&&(y(!0),d.emit("geo:request",void 0))},[d]);l.useEffect(()=>{if(!d?.on)return;const a=d.on("geo:status",t=>{const c=t?.state;(c==="granted"||c==="denied"||c==="unavailable")&&y(!1)});return()=>a()},[d]);const h=i.venues??[],u=h.length,b=i.googleMapsApiKey,g=i.googleMapsMapId??void 0,B=!!g,s=l.useMemo(()=>h.map(a=>{const t=a.coordinates?.lat??a.lat,c=a.coordinates?.lng??a.lng;return typeof t=="number"&&typeof c=="number"?{...a,lat:t,lng:c}:null}).filter(a=>a!==null),[h]),E=l.useMemo(()=>{const a=i.center;return a&&typeof a.lat=="number"&&typeof a.lng=="number"?{lat:a.lat,lng:a.lng}:s.length>0?{lat:s[0].lat,lng:s[0].lng}:P},[i.center,s]),n=m!=null?s[m]??null:null,_=l.useCallback(a=>M(a),[]),f=r(o?"venue_map.hide_map":"venue_map.show_map"),k=r("venue_map.use_my_location"),N=e.jsxs("div",{className:"es-venuemap__bar",children:[e.jsx("button",{type:"button",className:"es-venuemap__locate",onClick:R,disabled:p,"aria-label":k,"aria-busy":p,title:k,children:p?e.jsx(G,{}):e.jsx(F,{})}),e.jsxs("button",{type:"button",className:"es-venuemap__toggle",onClick:()=>S(a=>!a),"aria-expanded":o,"aria-controls":v,"aria-label":f,children:[e.jsx("span",{className:"es-venuemap__toggle-label",children:f}),e.jsx(H,{open:o})]})]}),C=o?void 0:"es-venuemap--collapsed";return b?e.jsxs(w,{blockType:"venue-map",className:C,children:[e.jsx("div",{id:v,className:"es-block__body es-block__body--map",hidden:!o,ref:j,children:o&&e.jsxs(e.Fragment,{children:[e.jsx(I,{apiKey:b,language:L,children:e.jsx(T,{className:"es-venuemap__canvas",defaultCenter:E,defaultZoom:s.length>0?13:11,mapTypeControl:!1,fullscreenControl:!1,streetViewControl:!1,...g?{mapId:g}:{},children:s.map((a,t)=>B?e.jsx(W,{position:{lat:a.lat,lng:a.lng},title:a.name,onClick:()=>_(t),children:e.jsx(q,{background:t===m?"var(--es-color-interactive, #2563EB)":"var(--es-color-primary, #2563EB)",borderColor:D,glyphColor:K,scale:t===m?1.25:1})},t):e.jsx(O,{position:{lat:a.lat,lng:a.lng},title:a.name,onClick:()=>_(t)},t))})}),s.length>0&&u>s.length&&e.jsxs("div",{className:"es-venuemap__no-coords-badge",role:"note",children:[e.jsx("span",{"aria-hidden":"true",children:"📍"})," ",r("venue_map.partial_no_coords_badge",{count:u-s.length})]}),u>0&&s.length===0&&e.jsxs("div",{className:"es-venuemap__no-coords-overlay",role:"note",children:[e.jsx("div",{"aria-hidden":"true",children:"📍"}),e.jsx("div",{children:r("venue_map.no_coords_notice")})]}),n&&e.jsxs("div",{className:"es-venuemap__detail",role:"dialog","aria-label":n.name,children:[e.jsx("button",{type:"button",className:"es-venuemap__detail-close",onClick:()=>_(null),"aria-label":r("venue_map.close_details"),children:"×"}),e.jsx("h3",{className:"es-venuemap__detail-title",children:n.name}),e.jsxs("div",{className:"es-venuemap__detail-meta",children:[n.rating!=null&&e.jsxs("span",{className:"es-venuemap__detail-meta-item",children:["★"," ",n.rating.toFixed(1)]}),(n.type||n.types?.[0])&&e.jsx("span",{className:"es-venuemap__detail-meta-item",children:n.type??n.types?.[0]})]}),n.address&&e.jsx("div",{className:"es-venuemap__detail-address",children:n.address}),n.url&&e.jsxs("a",{href:n.url,className:"es-venuemap__detail-cta",target:"_blank",rel:"noopener noreferrer",children:[r("venue_list.view_details")," →"]})]})]})}),N]}):e.jsxs(w,{blockType:"venue-map",className:C,children:[e.jsx("div",{id:v,className:"es-block__body",hidden:!o,children:e.jsxs("div",{className:"es-map-placeholder",children:[e.jsx("div",{className:"es-map-placeholder__icon","aria-hidden":"true",children:"🗺"}),e.jsx("div",{className:"es-map-placeholder__message",children:r("venue_map.no_api_key")}),u>0&&e.jsx("div",{className:"es-map-placeholder__count",children:r("venue_map.venues_available",{count:u})}),e.jsx("div",{className:"es-map-placeholder__hint",children:r("venue_map.use_list_hint")})]})}),N]})}export{$ as Component,Z as manifest};
2
- //# sourceMappingURL=index-BJxJr5j5-C_0Ll4qr.js.map
2
+ //# sourceMappingURL=index-qN6oEHVu-C_0Ll4qr.js.map
@@ -1,2 +1,2 @@
1
1
  import{j as e,Q as l}from"../nexly.js";const m={slug:"demo-services",name:"DEMO — Services",version:"0.1.0",category:"content",configSchema:{properties:{items:{type:"array",items:{type:"object",properties:{title:{type:"string"},description:{type:"string"}},required:["title"]},default:[]}}},defaultConfig:{items:[]},sizing:{minWidth:240,preferredHeight:"auto",scrollable:!1},supportedPlacements:["main","sidebar"]};function d(r){return Array.isArray(r)?r.flatMap(t=>{if(typeof t!="object"||t===null)return[];const s=t,c=typeof s.title=="string"?s.title.trim():"";if(!c)return[];const o=typeof s.description=="string"&&s.description.trim().length>0?s.description.trim():void 0;return[{title:c,description:o}]}):[]}function p({data:r,config:t,i18n:s}){const c=s?.t??(i=>i),o=d(r?.items??t?.items);return o.length===0?e.jsx(l,{blockType:"demo-services",children:e.jsx("div",{className:"es-block__body",children:e.jsx("div",{className:"es-block__empty",children:c("demoServices.empty")})})}):e.jsx(l,{blockType:"demo-services",children:e.jsx("div",{className:"es-block__body es-demosvc",children:e.jsx("ul",{className:"es-demosvc__list",children:o.map((i,n)=>e.jsxs("li",{className:"es-demosvc__item",children:[e.jsx("span",{className:"es-demosvc__ordinal","aria-hidden":"true",children:n+1}),e.jsxs("div",{className:"es-demosvc__text",children:[e.jsx("h3",{className:"es-demosvc__title",children:i.title}),i.description&&e.jsx("p",{className:"es-demosvc__desc",children:i.description})]})]},n))})})})}export{p as Component,m as manifest};
2
- //# sourceMappingURL=index-D0qsMexH-I68tb-d3.js.map
2
+ //# sourceMappingURL=index-rblri-2U-I68tb-d3.js.map
@@ -0,0 +1,6 @@
1
+ import{r as s,j as t,a as kt,b as Te,Q as ts,_ as Ws,t as Js}from"../nexly.js";import{H as Xs,P as Vs}from"./use-deferred-rating-XlgCUwcY-DDVOwURi.js";import{j as Zs}from"./PanelInfoVideo-BNVzih9J-BrU-Qlul.js";import{x as Ys,s as Gs,c as en,a as tn}from"./allowed-elements-BXnLJV1S-C-_lr2zm.js";import{f as sn}from"./assistant-link-components-DUrLEPUB-DKaQavIJ.js";import{j as nn,X as an}from"./ClickToLoadEmbed-BLIUFZOn-BwY-LAJ8.js";import"./_commonjsHelpers-C6fGbg64-BC8KDfbh.js";import"./assistant-link-policy-DHB-k1Aa-Cc-yj-a-.js";const ca={slug:"support-chat",name:"Support Chat",version:"1.0.0",category:"interactive",requiredService:"support-chat",configSchema:{properties:{voiceEnabled:{type:"boolean",default:!0},voiceConversationEnabled:{type:"boolean",default:!1},voiceReadAloudEnabled:{type:"boolean",default:!1},welcomeMessage:{type:"string",default:""},headerTitle:{type:"string",default:""},placeholder:{type:"string",default:""},showSuggestedQuestions:{type:"boolean",default:!0},suggestedQuestions:{type:"array",items:{type:"string"},default:[]},escalationLabel:{type:"string",default:""},humanHandoffButton:{type:"boolean",default:!1}}},defaultConfig:{voiceEnabled:!0,voiceConversationEnabled:!1,voiceReadAloudEnabled:!1,welcomeMessage:"",headerTitle:"",placeholder:"",showSuggestedQuestions:!0,suggestedQuestions:[],escalationLabel:"",humanHandoffButton:!1},dataContract:{serviceSlug:"support-chat",inputSchema:{type:"object",properties:{answer:{type:"string",description:"AI response text"},confidence:{type:"number",description:"Confidence score 0-1"},sources:{type:"array",items:{type:"object",properties:{title:{type:"string"},url:{type:"string"},excerpt:{type:"string"}}},description:"Source citations for the answer"}},required:["answer"]},previewDataOverride:{answer:"Our return policy allows returns within 30 days of purchase. Items must be in original condition with tags attached.",confidence:.85,sources:[{title:"Return Policy",url:"/policies/returns",excerpt:"Returns accepted within 30 days."}]}},fields:[{id:"voiceConversationEnabled",type:"toggle",label:"Voice conversation (live)",default:!1,group:"Voice"},{id:"voiceReadAloudEnabled",type:"toggle",label:"Read messages aloud",default:!1,group:"Voice"},{id:"headerTitle",type:"localized-text",label:"Header title",default:"",placeholder:'Leave empty to use translated default (e.g. "Support")',group:"Content"},{id:"welcomeMessage",type:"localized-text",label:"Welcome message",default:"",placeholder:'Leave empty to use translated default (e.g. "Hi! How can I help you today?")',group:"Content"},{id:"placeholder",type:"localized-text",label:"Input placeholder",default:"",placeholder:'Leave empty to use translated default (e.g. "Ask a question...")',group:"Content"},{id:"escalationLabel",type:"text",label:"Escalation button label",default:"",placeholder:'Leave empty to use translated default (e.g. "Contact Support")',group:"Content"},{id:"humanHandoffButton",type:"toggle",label:'Show "Human" button',default:!1,group:"Behavior"},{id:"showSuggestedQuestions",type:"toggle",label:"Show suggested questions",default:!0,group:"Behavior"},{id:"suggestedQuestions",type:"json",label:"Suggested questions",default:[],placeholder:'["What is your return policy?", "Do you ship internationally?"]',group:"Behavior"}],events:{emits:[{name:"support-chat:messageSent",description:"User sent a message"},{name:"support-chat:escalated",description:"User requested escalation to human support"},{name:"support-chat:feedbackSubmitted",description:"User rated helpfulness of answer"}],listens:[{name:"support-chat:clearHistory",description:"Clear chat history"}]},sizing:{minWidth:280,preferredHeight:"fill",scrollable:!0},supportedPlacements:["main","sidebar","fullscreen"]};function ss({text:n,allowedLinkHosts:a}){return t.jsx("div",{className:"es-sc__bubble-text es-sc__bubble-text--md",children:t.jsx(Ys,{remarkPlugins:[...en],allowedElements:[...Gs],transformLinkUri:o=>tn(o)??"",transformImageUri:()=>"",components:{input:({node:o,type:i,checked:l,...p})=>i==="checkbox"?t.jsx("input",{...p,type:"checkbox",checked:!!l,disabled:!0,readOnly:!0,className:"es-sc__md-task"}):null,...sn({allowedHosts:a})},children:n})})}function rn({media:n,t:a}){const{embeds:o,images:i}=n;return o.length===0&&i.length===0?null:t.jsxs("div",{className:"es-sc__media","data-testid":"support-chat-media",children:[o.map(l=>t.jsx(an,{embed:l,t:a,classPrefix:"es-sc"},`${l.provider}:${l.id}`)),i.map(l=>t.jsx("img",{className:"es-sc__media-img",src:l.src,alt:l.alt||a("support_chat.media_image_alt"),loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"},l.src))]})}function wt(n){return n?n.join(","):""}const on=s.memo(function({text:n,allowEmbeds:a,allowedImageHosts:o,t:i}){const l=wt(o),p=s.useMemo(()=>nn(n,{allowEmbeds:a,allowedImageHosts:o}),[n,a,l]);return t.jsx(rn,{media:p,t:i})},(n,a)=>n.text===a.text&&n.allowEmbeds===a.allowEmbeds&&n.t===a.t&&wt(n.allowedImageHosts)===wt(a.allowedImageHosts));function cn(n,a){const o=Math.round((Date.now()-n.getTime())/1e3);if(o<60)return a("time.just_now");const i=Math.round(o/60);if(i<60)return a("time.minutes_ago",{count:i});const l=Math.round(i/60);if(l<24)return a("time.hours_ago",{count:l});const p=Math.round(l/24);return a("time.days_ago",{count:p})}function us({card:n,t:a,onSelect:o}){const i=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"es-sc__ticket-card-head",children:[t.jsxs("span",{className:"es-sc__ticket-card-number",children:["#",n.externalNumber]}),t.jsx("span",{className:`es-sc__ticket-card-status es-sc__ticket-card-status--${n.status}`,children:a(`escalation.status_${n.status}`)})]}),n.summary&&t.jsx("p",{className:"es-sc__ticket-card-summary",title:n.summary,children:n.summary}),t.jsxs("p",{className:"es-sc__ticket-card-meta",children:[cn(new Date(n.createdAt),a),n.priority?` · ${a(`support_chat.priority_${n.priority}`)}`:""]})]});if(o&&n.sessionId){const l=n.sessionId;return t.jsx("button",{type:"button",className:"es-sc__ticket-card es-sc__ticket-card--clickable",onClick:()=>o(l),"aria-label":a("support_chat.open_ticket_conversation"),title:a("support_chat.open_ticket_conversation"),children:i})}return t.jsx("div",{className:"es-sc__ticket-card",children:i})}const ln=[{value:"open",key:"support_chat.filter_open"},{value:"closed",key:"support_chat.filter_closed"},{value:"all",key:"support_chat.filter_all"}];function un(n){const{status:a,loading:o,tickets:i,onSelectStatus:l,onSelectSession:p,t:x}=n;return t.jsxs("div",{className:"es-sc__tickets-view",children:[t.jsx("div",{className:"es-sc__tickets-filters",children:ln.map(m=>t.jsx("button",{type:"button",className:`es-sc__tickets-chip${a===m.value?" es-sc__tickets-chip--active":""}`,onClick:()=>l(m.value),children:x(m.key)},m.value))}),t.jsx("div",{className:"es-sc__tickets-view-list",children:o?t.jsx("p",{className:"es-sc__tickets-empty",role:"status","aria-live":"polite",children:"…"}):i.length===0?t.jsx("p",{className:"es-sc__tickets-empty",children:x("support_chat.tickets_empty")}):i.map(m=>t.jsx(us,{card:m,t:x,onSelect:p},m.externalNumber))})]})}const dn=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function pn(){return typeof navigator>"u"||typeof window>"u"?!1:typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof window.MediaRecorder<"u"}function fn(){if(typeof window>"u"||typeof window.MediaRecorder>"u")return;const n=typeof window.MediaRecorder.isTypeSupported=="function";for(const a of dn)if(!n||window.MediaRecorder.isTypeSupported(a))return a}function hn({baseUrl:n,apiKey:a,jwt:o,language:i,onTranscript:l,t:p,disabled:x=!1,streaming:m,voiceStream:g,baseText:_,onText:r}){const[f]=s.useState(pn),[v,b]=s.useState("idle"),[k,A]=s.useState(null),[U,O]=s.useState("idle"),R=!!(m&&g&&_&&r),w=s.useRef(null),q=s.useRef(null),B=s.useRef([]),V=s.useRef(!0);s.useEffect(()=>()=>{V.current=!1},[]);const ce=s.useRef({baseUrl:n,apiKey:a,jwt:o,language:i,onTranscript:l});s.useEffect(()=>{ce.current={baseUrl:n,apiKey:a,jwt:o,language:i,onTranscript:l}},[n,a,o,i,l]);const le=s.useCallback(()=>{q.current?.getTracks().forEach(T=>T.stop()),q.current=null,w.current=null,B.current=[]},[]);s.useEffect(()=>le,[le]);const E=s.useRef(()=>{});E.current=()=>{R&&(U==="connecting"||U==="listening")&&g?.stop()},s.useEffect(()=>()=>E.current(),[]);const H=s.useCallback(async T=>{const{baseUrl:z,apiKey:Z,jwt:Y,language:$,onTranscript:P}=ce.current,te=new FormData;te.append("audio",T,"recording.webm"),te.append("language",$);const ae={};Z&&(ae["X-API-Key"]=Z),Y&&(ae.Authorization=`Bearer ${Y}`);const ke=await fetch(`${z}/api/widget/transcribe`,{method:"POST",headers:ae,credentials:"include",body:te});if(!ke.ok){const J=new Error(`HTTP ${ke.status}`);throw J.status=ke.status,J}const Ie=await ke.json();P(Ie.text??"")},[]),pe=s.useCallback(async()=>{A(null);let T;try{T=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{b("error"),A("voice.permission_denied");return}const z=fn();let Z;try{Z=z?new MediaRecorder(T,{mimeType:z}):new MediaRecorder(T)}catch{T.getTracks().forEach(Y=>Y.stop()),b("error"),A("voice.error_generic");return}q.current=T,w.current=Z,B.current=[],Z.ondataavailable=Y=>{Y.data&&Y.data.size>0&&B.current.push(Y.data)},Z.onstop=async()=>{const Y=Z.mimeType||z||"audio/webm",$=new Blob(B.current,{type:Y});if(le(),$.size===0){b("idle");return}b("transcribing");try{if(await H($),!V.current)return;b("idle"),A(null)}catch(P){if(!V.current)return;const te=P.status;b("error"),A(te===413?"voice.error_too_large":"voice.error_generic")}},Z.start(),b("recording")},[le,H]),ue=s.useCallback(()=>{const T=w.current;T&&T.state!=="inactive"?T.stop():(le(),b("idle"))},[le]),ne=s.useCallback(()=>{f&&(R?U==="connecting"||U==="listening"?(g.stop(),O("idle")):(A(null),g.start({language:i,baseText:_,onText:r,onState:T=>O(T),onError:T=>{A(T),O("error")}})):v==="recording"?ue():(v==="idle"||v==="error")&&pe())},[f,R,U,v,i,_,r,g,pe,ue]);if(!f)return null;const fe=R?U==="connecting"||U==="listening":v==="recording",he=!R&&v==="transcribing",Oe=R?U==="error":v==="error",xe=p(fe?"voice.stop":"voice.start"),me=k?p(k):he?p("voice.transcribing"):xe,ye=["es-sc__mic",fe&&"es-sc__mic--recording",he&&"es-sc__mic--transcribing",Oe&&"es-sc__mic--error"].filter(Boolean).join(" ");return t.jsx("button",{type:"button",className:ye,onClick:ne,disabled:he||x,"aria-label":xe,"aria-pressed":fe,title:me,children:he?t.jsx("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"es-sc__mic-spinner","aria-hidden":"true",children:t.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}):fe?t.jsx("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}):t.jsxs("svg",{width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),t.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),t.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"})]})})}function mn(){return t.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":"true",children:t.jsx("path",{d:"M8 5.14v13.72a1 1 0 0 0 1.5.86l11-6.86a1 1 0 0 0 0-1.72l-11-6.86A1 1 0 0 0 8 5.14Z"})})}function gn(){return t.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"6",y:"5",width:"4",height:"14",rx:"1"}),t.jsx("rect",{x:"14",y:"5",width:"4",height:"14",rx:"1"})]})}function _n(){return t.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":"true",children:t.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function bn(){return t.jsx("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"es-sc__readaloud-spinner","aria-hidden":"true",children:t.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}const vn=s.memo(function({id:n,session:a,onActivate:o,t:i}){const l=a.activeId===n?a.status:"idle",p=s.useCallback(()=>{if(l==="idle"||l==="error"){o();return}l!=="loading"&&a.togglePause()},[l,o,a]),x=s.useCallback(()=>a.stop(),[a]),m=i(l==="playing"?"voice_output.pause":"voice_output.play"),g=l==="error"?i("voice_output.error"):m;return t.jsxs("span",{className:"es-sc__readaloud-group",children:[t.jsx("button",{type:"button",className:["es-sc__readaloud-btn",l==="playing"&&"es-sc__readaloud-btn--playing",l==="paused"&&"es-sc__readaloud-btn--paused",l==="error"&&"es-sc__readaloud-btn--error"].filter(Boolean).join(" "),onClick:p,disabled:l==="loading","aria-label":m,"aria-pressed":l==="playing",title:g,children:l==="loading"?t.jsx(bn,{}):l==="playing"?t.jsx(gn,{}):t.jsx(mn,{})}),(l==="playing"||l==="paused")&&t.jsx("button",{type:"button",className:"es-sc__readaloud-btn es-sc__readaloud-btn--stop",onClick:x,"aria-label":i("voice_output.stop"),title:i("voice_output.stop"),children:t.jsx(_n,{})})]})});function xn(n){let a=null,o=0,i=null;const l=new Set,p={ended:new Set},x=g=>{for(const _ of[...p[g]])_()},m=g=>{g.onended=null,Js(()=>g.stop())};return{push(g){const _=new Uint8Array(g);let r;i&&i.length>0?(r=new Uint8Array(i.length+_.length),r.set(i,0),r.set(_,i.length),i=null):r=_;const f=r.length-r.length%2;if(f<r.length&&(i=r.slice(f)),f===0)return;const v=new Int16Array(r.buffer,r.byteOffset,f/2);if(v.length===0)return;a??(a=new AudioContext({sampleRate:n}));const b=a.createBuffer(1,v.length,n);b.getChannelData(0).set(Float32Array.from(v,U=>U/32768));const k=a.createBufferSource();k.buffer=b,k.connect(a.destination),k.onended=()=>{l.delete(k),l.size===0&&x("ended")},l.add(k);const A=Math.max(a.currentTime,o);k.start(A),o=A+b.duration},reset(){for(const g of[...l])m(g);l.clear(),o=0,i=null},pause(){a?.suspend()},resume(){a?.resume()},on(g,_){return p[g].add(_),()=>{p[g].delete(_)}},close(){for(const g of[...l])m(g);l.clear(),a?.close(),a=null,o=0,p.ended.clear()}}}function yn({baseUrl:n,apiKey:a,getJwt:o}){const[i,l]=s.useState(null),[p,x]=s.useState("idle"),m=s.useRef(null),g=s.useRef(null),_=s.useRef([]),r=s.useRef(!1),f=s.useRef(!1),v=s.useRef(!1),b=s.useRef(0),k=s.useRef(null),A=s.useRef(null),U=s.useCallback(()=>{A.current&&(clearTimeout(A.current),A.current=null)},[]),O=s.useCallback(()=>{k.current?.abort(),k.current=null,A.current&&(clearTimeout(A.current),A.current=null),g.current?.close(),g.current=null,_.current=[],r.current=!1,f.current=!1,v.current=!1},[]),R=s.useCallback(()=>{b.current+=1,O(),m.current=null,l(null),x("idle")},[O]),w=s.useCallback(()=>{const E=g.current;E&&x(H=>H==="playing"?(E.pause(),"paused"):H==="paused"?(E.resume(),"playing"):H)},[]),q=s.useCallback(E=>{if(m.current===E)return;O(),b.current+=1,k.current=new AbortController,m.current=E,l(E),x("loading");const H=b.current;A.current=setTimeout(()=>{H===b.current&&(k.current?.abort(),x("error"))},12e3)},[O]),B=s.useCallback(async E=>{if(!E)return;const H=o?.();await Te(fetch(`${n}/api/widget/read-aloud-play`,{method:"POST",headers:{"Content-Type":"application/json",...a?{"X-API-Key":a}:{},...H?{Authorization:`Bearer ${H}`}:{}},body:JSON.stringify({messageId:E})}))},[n,a,o]),V=s.useCallback((E,H)=>{r.current||(r.current=!0,(async()=>{for(;_.current.length>0;){if(E!==b.current){r.current=!1;return}const pe=_.current.shift();if(!pe)continue;const ue=o?.(),[ne,fe]=await Te(fetch(`${n}/api/widget/read-aloud`,{method:"POST",headers:{"Content-Type":"application/json",...a?{"X-API-Key":a}:{},...ue?{Authorization:`Bearer ${ue}`}:{}},body:JSON.stringify({text:pe,language:H,messageId:m.current??void 0}),signal:k.current?.signal}));if(E!==b.current){r.current=!1;return}if(fe||!ne||!ne.ok||!ne.body){x("error"),r.current=!1;return}const he=ne.headers.get("X-Audio-Encoding");if(he&&he!=="pcm16"){x("error"),r.current=!1;return}if(!g.current){const me=Number(ne.headers.get("X-Audio-Sample-Rate"))||24e3,ye=xn(me);g.current=ye,ye.on("ended",()=>{E===b.current&&(!f.current||_.current.length>0||r.current||R())})}const Oe=g.current,xe=ne.body.getReader();for(;;){const[me,ye]=await Te(xe.read());if(E!==b.current){r.current=!1;return}if(ye){x("error"),r.current=!1;return}const{done:T,value:z}=me;if(T)break;z&&z.byteLength>0&&(Oe.push(z.buffer.slice(z.byteOffset,z.byteOffset+z.byteLength)),v.current||(v.current=!0,U(),x("playing"),B(m.current)))}}r.current=!1,f.current&&!v.current&&E===b.current&&R()})())},[n,a,o,R,B]),ce=s.useCallback((E,H,pe)=>{if(m.current!==E)return;const ue=H.trim();ue&&(_.current.push(ue),V(b.current,pe))},[V]),le=s.useCallback(E=>{m.current===E&&(f.current=!0,_.current.length===0&&!r.current&&!v.current&&R())},[R]);return s.useEffect(()=>()=>R(),[R]),{activeId:i,status:p,activate:q,feed:ce,finish:le,togglePause:w,stop:R}}const kn=1200;function wn(n={language:"en"}){const{voiceStream:a,language:o,silenceMs:i=kn}=n;let l=null,p=null,x="",m=!1;const g=()=>{p&&clearTimeout(p),p=null},_=()=>{!a||!m||(x="",a.start({language:o,baseText:()=>"",onText:r=>{const f=r.trim();!f||f===x||(x=f,l?.({type:"user_partial",text:f}),g(),p=setTimeout(()=>{const v=x;v&&(x="",l?.({type:"user_final",text:v}),a.stop(),_())},i))},onError:r=>l?.({type:"error",message:r})}))};return{get available(){return!!a},async start({onEvent:r}){if(!a)throw new Error("conversation transport unavailable");l=r,m=!0,_()},stop(){m=!1,g(),x="",a&&a.stop(),l=null}}}function jn(n){let a=null,o=null;return{get available(){return n.enabled&&typeof RTCPeerConnection<"u"},async start({onEvent:i}){o=i;const l={"Content-Type":"application/json","X-API-Key":n.apiKey},p=n.getJwt?.()??n.jwt;p&&(l.Authorization=`Bearer ${p}`);const x=n.getSessionId?.()??null,m=await fetch(`${n.baseUrl}/api/widget/realtime-voice`,{method:"POST",headers:l,body:JSON.stringify({language:n.language,...x?{sessionId:x}:{}})});if(!m.ok)throw new Error("eleven token refused");const g=await m.json(),_=g.data?.token;if(g.data?.provider!=="elevenlabs"||!_)throw new Error("not an elevenlabs session");g.data?.sessionId&&n.onSessionId?.(g.data.sessionId);const r=g.data?.endUserToken??"",{Conversation:f}=await Ws(async()=>{const{Conversation:w}=await import("./index-DMQkz1bV-BuMYksln.js");return{Conversation:w}},[]);let v=!1,b=null;const k=.6,A=.35,U=w=>{w!==v&&(v=w,o?.({type:"user_speaking",active:w}))};let O="";const R=w=>{const q=w?.trim();q&&(U(!1),o?.({type:"thinking"}),q!==O&&(O=q,n.onUserTurnEnd?.()))};a=await f.startSession({conversationToken:_,connectionType:"webrtc",customLlmExtraBody:{end_user_token:r},onModeChange:({mode:w})=>{o?.(w==="speaking"?{type:"agent_delta",text:""}:{type:"agent_done"})},onVadScore:({vadScore:w})=>{w>=k?(b&&(clearTimeout(b),b=null),U(!0)):w<=A&&v&&!b&&(b=setTimeout(()=>{b=null,U(!1)},600))},onMessage:({message:w,role:q})=>{const B=w?.trim();B&&(q==="user"?R(B):(n.onTranscript({role:"assistant",text:B,streaming:!1}),O=""))},onIncomingEvent:w=>{w?.type==="user_transcript"&&R(w.user_transcription_event?.user_transcript)},onAgentTyping:()=>o?.({type:"thinking"}),onAgentChatResponsePart:w=>{const q=w?.text??"";q&&n.onTranscript({role:"assistant",text:q,streaming:!0})},onInterruption:()=>o?.({type:"interrupted"}),onError:w=>{console.warn("[voice] eleven blad:",w),o?.({type:"error",message:"voice_conv.error"})}})},setMuted(i){a?.setMicMuted?.(i)},sendUserMessage(i){const l=i.trim();return!l||!a||(a.sendUserActivity?.(),!a.sendUserMessage)?!1:(a.sendUserMessage(l),!0)},stop(){o=null;const i=a;a=null,i?.endSession()}}}function ns({followUps:n,isNewest:a,isPending:o,hasQuickReplies:i,isSending:l,onSelect:p,t:x}){return!a||o||i||!n||n.length===0?null:t.jsx("div",{className:"es-sc__followups",role:"list","aria-label":x("support_chat.followups_aria"),"data-es-no-read":!0,children:n.map(m=>t.jsx("button",{type:"button",role:"listitem",disabled:l,className:"es-sc__suggestion es-sc__suggestion--followup",onClick:()=>p(m.message),children:m.label},m.message))})}function Nn(n){switch(n){case"OUT_OF_HOURS":return"support_chat.handoff.out_of_hours";case"QUEUE_FULL":return"support_chat.handoff.queue_full";default:return"support_chat.handoff.no_operator_title"}}const jt={email:254,phone:32,note:2e3},Cn={email:"",phone:"",note:""};function Sn(n){const[a,o]=s.useState(()=>Date.now());return s.useEffect(()=>{if(n===null)return;const i=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(i)},[n]),n===null?null:Math.max(0,Math.ceil((n-a)/1e3))}function Rn({status:n,onSubmitContact:a,onDismissContact:o,t:i}){const[l,p]=s.useState(Cn),[x,m]=s.useState(!1),[g,_]=s.useState(null),r=s.useRef(null),f=Sn(n.kind==="waiting"?n.until:null);return s.useEffect(()=>{n.kind==="unavailable"&&r.current?.focus()},[n.kind]),n.kind==="idle"?null:n.kind==="waiting"?t.jsxs("div",{className:"es-sc__handoff es-sc__handoff--waiting",role:"status","aria-live":"polite",children:[t.jsx("span",{className:"es-sc__handoff-dot","aria-hidden":"true"}),t.jsx("span",{className:"es-sc__handoff-text",children:f===null?i("support_chat.handoff.queued"):i("support_chat.handoff.waiting",{seconds:f})})]}):n.kind==="human"?t.jsx("div",{className:"es-sc__handoff es-sc__handoff--human",role:"status","aria-live":"polite",children:t.jsx("span",{className:"es-sc__handoff-text",children:n.displayName?i("support_chat.handoff.human_joined",{name:n.displayName}):i("support_chat.handoff.human_joined_unnamed")})}):n.kind==="contact_left"?t.jsx("div",{className:"es-sc__handoff es-sc__handoff--done",role:"status","aria-live":"polite",children:t.jsx("span",{className:"es-sc__handoff-text",children:i("support_chat.handoff.contact_success")})}):t.jsxs("form",{className:"es-sc__handoff es-sc__handoff--form",onSubmit:async v=>{if(v.preventDefault(),x)return;if(l.email.trim().length===0&&l.phone.trim().length===0){_(i("support_chat.handoff.contact_validation")),r.current?.focus();return}m(!0),_(null);const b=await a({email:l.email.trim(),phone:l.phone.trim(),note:l.note.trim()});m(!1),b||_(i("support_chat.handoff.contact_error"))},noValidate:!0,children:[t.jsx("p",{className:"es-sc__handoff-title",children:i(Nn(n.reason))}),t.jsx("p",{className:"es-sc__handoff-text",children:i("support_chat.handoff.contact_prompt")}),t.jsx("label",{className:"es-sc__handoff-label",htmlFor:"es-sc-handoff-email",children:i("support_chat.handoff.contact_email_label")}),t.jsx("input",{id:"es-sc-handoff-email",ref:r,className:"es-sc__handoff-input",type:"email",autoComplete:"email",maxLength:jt.email,value:l.email,"aria-invalid":g!==null,"aria-describedby":g?"es-sc-handoff-error":void 0,onChange:v=>p(b=>({...b,email:v.target.value}))}),t.jsx("label",{className:"es-sc__handoff-label",htmlFor:"es-sc-handoff-phone",children:i("support_chat.handoff.contact_phone_label")}),t.jsx("input",{id:"es-sc-handoff-phone",className:"es-sc__handoff-input",type:"tel",autoComplete:"tel",maxLength:jt.phone,value:l.phone,onChange:v=>p(b=>({...b,phone:v.target.value}))}),t.jsx("label",{className:"es-sc__handoff-label",htmlFor:"es-sc-handoff-note",children:i("support_chat.handoff.contact_note_label")}),t.jsx("textarea",{id:"es-sc-handoff-note",className:"es-sc__handoff-input es-sc__handoff-textarea",rows:3,maxLength:jt.note,value:l.note,onChange:v=>p(b=>({...b,note:v.target.value}))}),g&&t.jsx("p",{className:"es-sc__handoff-error",id:"es-sc-handoff-error",role:"alert",children:g}),t.jsxs("div",{className:"es-sc__handoff-actions",children:[t.jsx("button",{className:"es-sc__handoff-submit",type:"submit",disabled:x,children:i("support_chat.handoff.contact_submit")}),t.jsx("button",{className:"es-sc__handoff-dismiss",type:"button",onClick:o,children:i("support_chat.handoff.contact_dismiss")})]})]})}const ds="live:";function De(n){return n.id.startsWith(ds)}function En(n,a){return n.text!==a.text?!0:JSON.stringify(n.metadata??null)!==JSON.stringify(a.metadata??null)}function Tn(n,a){if(a.length===0)return n;const o=new Map;n.forEach((_,r)=>o.set(_.id,r));let i=null;const l=[];let p=!1;for(const _ of a){const r=o.get(_.id);if(r===void 0){l.push(_),_.role==="assistant"&&(p=!0);continue}const f=n[r];En(f,_)&&(i??(i=[...n]),i[r]={...f,..._})}if(l.length===0)return i??n;const x=i??[...n],m=p?x.filter(_=>!De(_)):x,g=m.filter(De);return[...m.filter(_=>!De(_)),...l,...g]}function In({transport:n,agentId:a,onUserMessage:o,onStopPlayback:i}){const[l,p]=s.useState("idle"),[x,m]=s.useState(null),[g,_]=s.useState(!1),[r,f]=s.useState(null),v=s.useRef(o);v.current=o;const b=s.useRef(i);b.current=i;const k=s.useCallback(R=>{switch(R.type){case"user_partial":b.current(),m(R.text),p("listening");return;case"user_final":m(null),_(!1),p("listening"),R.text.trim()&&v.current(R.text);return;case"user_speaking":_(R.active),R.active&&(b.current(),p("listening"));return;case"thinking":m(null),_(!1),p("thinking");return;case"agent_delta":p("speaking");return;case"agent_done":p("listening");return;case"interrupted":b.current(),p("listening");return;case"error":f(R.message),p("error");return}},[]),A=s.useCallback(async()=>{if(!n.available){f("voice_conv.error"),p("error");return}f(null),p("connecting"),b.current();const[,R]=await Te(n.start({agentId:a,onEvent:k}));if(R){f("voice_conv.error"),p("error");return}p("listening")},[n,a,k]),U=s.useCallback(()=>{n.stop(),m(null),_(!1),p("idle")},[n]),O=s.useRef(n);return O.current=n,s.useEffect(()=>()=>O.current.stop(),[]),{state:l,draft:x,userSpeaking:g,error:r,start:A,stop:U}}const Mn=()=>t.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round","aria-hidden":"true",children:[t.jsx("rect",{x:"9",y:"3",width:"6",height:"11",rx:"3"}),t.jsx("path",{d:"M5 11a7 7 0 0 0 14 0M12 18v3"})]}),as=()=>t.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M4 4l16 16"}),t.jsx("path",{d:"M9 5a3 3 0 0 1 6 0v5m-6 1.5V11"}),t.jsx("path",{d:"M5 11a7 7 0 0 0 10.9 5.8M19 11a7 7 0 0 1-.4 2.3M12 18v3"})]}),An=()=>t.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18"})});function Pn({running:n}){const[a,o]=s.useState(0);return s.useEffect(()=>{if(!n)return;const i=setInterval(()=>o(l=>l+1),1e3);return()=>clearInterval(i)},[n]),t.jsx("span",{className:"es-vm__elapsed","data-testid":"voice-mode-elapsed",children:$n(a)})}function $n(n){const a=Math.floor(n/60),o=n%60;return`${a}:${String(o).padStart(2,"0")}`}function Ln({state:n,draft:a,error:o,muted:i,listening:l,hasTranscript:p,transcript:x,onToggleMute:m,onEnd:g,onRetry:_,t:r}){const f=s.useRef(null);if(s.useEffect(()=>{const k=f.current;k&&(k.scrollTop=k.scrollHeight)},[x]),n==="error")return t.jsxs("div",{className:"es-vm","data-testid":"voice-mode",children:[t.jsxs("div",{className:"es-vm__top",children:[t.jsx("span",{className:"es-vm__dot es-vm__dot--error"}),t.jsx("span",{className:"es-vm__label",children:r("voice_conv.title")})]}),t.jsxs("div",{className:"es-vm__denied",children:[t.jsx("div",{className:"es-vm__denied-icon",children:t.jsx(as,{})}),t.jsxs("div",{children:[t.jsx("div",{className:"es-vm__denied-title",children:r("voice_conv.denied_title")}),t.jsx("div",{className:"es-vm__denied-body",children:r(o||"voice_conv.denied_body")})]}),t.jsxs("div",{className:"es-vm__denied-actions",children:[t.jsx("button",{type:"button",className:"es-vm__action es-vm__action--primary",onClick:_,"data-testid":"voice-mode-retry",children:r("voice_conv.retry")}),t.jsx("button",{type:"button",className:"es-vm__action",onClick:g,"data-testid":"voice-mode-back",children:r("voice_conv.back_to_typing")})]})]})]});const v=!i&&(!!l||!!(a&&a.trim())),b=i?"muted":n==="speaking"?"speaking":n==="thinking"?"thinking":"listening";return t.jsxs("div",{className:"es-vm","data-testid":"voice-mode","data-state":n,children:[t.jsxs("div",{className:"es-vm__top",children:[t.jsx("span",{className:"es-vm__label",children:r("voice_conv.title")}),t.jsx(Pn,{running:n!=="idle"})]}),t.jsxs("div",{className:"es-vm__orbwrap",children:[t.jsxs("div",{className:"es-vm__orb","data-s":b,"data-active":v?"1":void 0,"data-testid":"voice-mode-orb","aria-hidden":"true",children:[t.jsx("span",{className:"es-vm__orb-halo"}),t.jsx("span",{className:"es-vm__orb-halo es-vm__orb-halo--delayed"}),t.jsx("span",{className:"es-vm__orb-core"})]}),t.jsx("div",{className:"es-vm__orb-state",role:"status","data-testid":"voice-mode-state",children:r(`voice_conv.state_${b}`)}),t.jsx("div",{className:"es-vm__orb-hint",children:r(`voice_conv.state_${b}_hint`)})]}),t.jsx("div",{className:"es-vm__transcript","data-testid":"voice-mode-transcript",ref:f,children:p?x:t.jsx("div",{className:"es-vm__invite","data-testid":"voice-mode-invite",children:r("voice_conv.invite")})}),t.jsxs("div",{className:"es-vm__controls",children:[t.jsx("button",{type:"button",className:`es-vm__btn${i?" es-vm__btn--on":""}`,"aria-label":r(i?"voice_conv.unmute":"voice_conv.mute"),onClick:m,"data-testid":"voice-mode-mute",children:i?t.jsx(as,{}):t.jsx(Mn,{})}),t.jsx("button",{type:"button",className:"es-vm__btn es-vm__btn--end","aria-label":r("voice_conv.end"),onClick:g,"data-testid":"voice-mode-end",children:t.jsx(An,{})})]})]})}const rs=/[.!?]+(?:['")\]]+)?(\s+)/g;function Un(n){const a=[];let o=0;rs.lastIndex=0;let i;for(;i=rs.exec(n);){const l=i.index+i[0].length,p=n.slice(o,l).trim();p&&a.push(p),o=l}return{complete:a,remainder:n.slice(o)}}function Dn(n,a,o){return n===void 0?o:n.map(i=>{const l=i.translations?.[a]?.trim();return l||i.translations?.[i.baseLanguage]?.trim()||(Object.values(i.translations??{}).find(x=>x?.trim())?.trim()??"")}).filter(i=>i.length>0)}function On({size:n=16}){return t.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("polyline",{points:"12 6 12 12 16 14"})]})}function qn({size:n=18}){return t.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M12 5H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7"}),t.jsx("path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"})]})}function Bn({size:n=16}){return t.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M2 9a3 3 0 1 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 1 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}),t.jsx("path",{d:"m9 12 2 2 4-4"})]})}const Hn=["confirm_escalation","cancel_escalation","confirm_handoff","decline_handoff"],Fn="<followups>",Kn=/<followups>/i;function zn(n){const a=n.search(Kn);if(a!==-1)return n.slice(0,a).trimEnd();const o=n.lastIndexOf("<");return o!==-1&&Fn.startsWith(n.slice(o).toLowerCase())?n.slice(0,o).trimEnd():n}function is(n){return n>=.6?"high":n>=.35?"medium":"low"}function Qn(n){return/^https?:\/\//i.test(n)}function Wn(n){return n==="OUT_OF_HOURS"||n==="QUEUE_FULL"||n==="NO_OPERATOR"?n:null}function os(n){const{metadata:a,...o}=n;return{...o,...a&&typeof a=="object"?a:{}}}function Jn(n){let a=null;const o=[];for(const i of n.split(`
2
+ `))i.startsWith("event:")?a=i.slice(6).trim():i.startsWith("data:")&&o.push(i.slice(5).trimStart());return{event:a,data:o.join(`
3
+ `)}}const Xn=12e4,cs=1500,Vn=6e4,ls=120,Zn=25e3,Yn=600;function Gn({value:n,onChange:a,disabled:o,t:i}){const[l,p]=s.useState(null),x=n??0,m=!o&&l!==null?l:x;return t.jsxs("div",{className:"es-sc__rating-group",children:[t.jsx("div",{className:"es-sc__rating",role:"radiogroup","aria-label":i("support_chat.rate_aria"),onMouseLeave:()=>!o&&p(null),children:[1,2,3,4,5].map(g=>{const _=g<=m;return t.jsx("button",{type:"button",role:"radio","aria-checked":g===x,"aria-label":i("support_chat.rate_star",{count:g}),disabled:o,onMouseEnter:()=>!o&&p(g),onFocus:()=>!o&&p(g),onBlur:()=>!o&&p(null),onClick:()=>!o&&a?.(g),className:`es-sc__rating-star${_?" es-sc__rating-star--filled":""}${o?" es-sc__rating-star--disabled":""}`,children:t.jsx("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:_?"currentColor":"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.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"})})},g)})}),t.jsx("span",{className:"es-sc__rating-label","aria-live":"polite",children:m>0?i(`support_chat.rate_label_${m}`):""})]})}function la({config:n,actions:a,baseUrl:o,externalContext:i,productId:l,i18n:p,supportSessionId:x,auth:m,readOnly:g}){const _=g===!0,r=p?.t??(e=>e),f=i?.apiKey??"",v=s.useRef(m?.jwt);s.useEffect(()=>{v.current=m?.jwt},[m?.jwt]);const b=i?.voice,k=p?.currentLanguage??"en",A=!!b?.enabled&&(b?.languages??[]).includes(k),U=n.voiceConversationEnabled===!0,O=n.voiceReadAloudEnabled===!0,R=i?.voiceOutput,w=yn({baseUrl:o,apiKey:f,getJwt:()=>v.current}),q=s.useRef(w);q.current=w;const B=O&&!!R?.enabled&&(R?.languages??[]).includes(k),V=s.useRef(0),ce=i?.userContext??void 0,le=i?.resetSession??!1,E=i?.showTicketsTab??!1,H=kt(n.welcomeMessage,k,{t:r,fallbackKey:"support_chat.welcome_message",enDefault:"Hi! How can I help you today?"}),pe=kt(n.placeholder,k,{t:r,fallbackKey:"support_chat.input_placeholder",enDefault:"Ask a question..."}),ue=n.showSuggestedQuestions??!0,ne=Dn(n.localizedSuggestedQuestions,k,n.suggestedQuestions??[]),fe=n.escalationLabel||r("support_chat.escalation_label"),he=n.humanHandoffButton===!0,Oe=kt(n.headerTitle,k,{t:r,fallbackKey:"support.title",enDefault:"Support"}),xe=n.allowedLinkHosts,me=s.useMemo(()=>Array.isArray(xe)?xe.filter(e=>typeof e=="string"):void 0,[xe]),ye=n.allowMediaEmbeds===!0,T=typeof n._draft=="string"?n._draft:void 0,z=n._autoSend===!0,Z=Array.isArray(n._quickChips)?n._quickChips:[],Y=JSON.stringify(Z),[$,P]=s.useState([]);s.useEffect(()=>{if(!B)return;const e=w.activeId;if(!e){V.current=0;return}const c=$.find(h=>h.id===e);if(!c)return;const u=c.role==="assistant"&&c.refusalReason?r(`support_chat.refusal_${c.refusalReason}`,{productName:c.refusalProductName??""}):c.text??"";if(u.length>V.current){const h=u.slice(V.current),{complete:d,remainder:j}=Un(h);if(d.length>0){V.current=u.length-j.length;for(const N of d)w.feed(e,N,k)}}if(!c.isPending){const h=u.slice(V.current).trim();h&&(w.feed(e,h,k),V.current=u.length),w.finish(e)}},[$,w,B,k]);const[te,ae]=s.useState(""),[ke,Ie]=s.useState([]),[J,qe]=s.useState(!1),[Nt,Ze]=s.useState(null),[Be,Ye]=s.useState(null),[X,Se]=s.useState(x??null),[Me,it]=s.useState(null),[ot,ps]=s.useState(!1),[Re,Ct]=s.useState(null),[fs,St]=s.useState(0),[Ae,hs]=s.useState("open"),[ms,He]=s.useState([]),[gs,Ge]=s.useState(!1),[re,Fe]=s.useState("chat"),[Rt,ie]=s.useState({kind:"idle"}),Ee=s.useRef(null),et=s.useRef(le),Et=s.useRef(null),ct=s.useRef(!1),{containerRef:_s,isPinned:bs,scrollToBottom:Pe,stickToBottom:Tt}=Xs(),G=s.useRef(null),ge=s.useRef(null),tt=s.useRef(null),st=s.useRef(null);s.useEffect(()=>{Tt()},[$,Tt]),s.useEffect(()=>()=>{ge.current?.abort()},[]),s.useEffect(()=>{if(Me==null)return;const e=Me-Date.now();if(e<=0){it(null);return}const c=setTimeout(()=>it(null),e);return()=>clearTimeout(c)},[Me]),s.useEffect(()=>{if(Re==null)return;const e=()=>{const u=Re-Date.now();if(u<=0){Ct(null),St(0);return}St(Math.ceil(u/1e3))};e();const c=setInterval(e,1e3);return()=>clearInterval(c)},[Re]);const $e=s.useRef(null),we=s.useCallback(()=>{$e.current&&($e.current.cancelled=!0),$e.current=null},[]);s.useEffect(()=>a.on("support-chat:clearHistory",()=>{ge.current?.abort(),we(),P([]),Ze(null),Ye(null),qe(!1),Se(null),st.current=null,et.current=!0}),[a,we]),s.useEffect(()=>{a.emit("support-chat:session",{sessionId:X})},[a,X]);const It=s.useCallback((e,c,u)=>{we();const h={cancelled:!1};$e.current=h;const d=u?.trim()?u:null,j=`resume-${crypto.randomUUID()}`;P(D=>[...D,{id:j,role:"assistant",text:d??"",isPending:!d}]),Pe();const N=Date.now()+(d?6e3:Vn),C=async()=>{if(h.cancelled)return;let D=null;try{const y=v.current,I=await fetch(`${o}/api/support-chat/sessions/${e}/messages?limit=50`,{headers:{...f?{"X-API-Key":f}:{},...y?{Authorization:`Bearer ${y}`}:{}}});if(I.ok){const W=await I.json(),ve=W.success&&W.data?W.data.messages:[];for(let M=ve.length-1;M>=0;M--){const Q=ve[M];if(Q.role!=="assistant")continue;const S=Q.createdAt?Date.parse(Q.createdAt):NaN;if(Number.isFinite(S)&&S>c){D=Q;break}}}}catch{}if(!h.cancelled){if(D){const y=D.metadata??{},I=y.confidence,W=typeof I=="number"?is(I):void 0;P(ve=>ve.map(M=>M.id===j?{...M,id:D.id,serverId:D.id,promptLogId:D.promptLogId??null,text:D.content,isPending:!1,confidence:I,confidenceLevel:W,sources:y.sources&&y.sources.length>0?y.sources:void 0,actions:y.actions&&y.actions.length>0?y.actions:void 0,quickReplies:y.quickReplies&&y.quickReplies.length>0?y.quickReplies:void 0,ticketCards:y.ticketCards&&y.ticketCards.length>0?y.ticketCards:void 0,suggestedFollowUps:y.suggestedFollowUps&&y.suggestedFollowUps.length>0?y.suggestedFollowUps:void 0,awaitingConfirmation:y.awaitingConfirmation,refusalReason:y.refusalReason,refusalProductName:y.refusalProductName}:M)),Pe(),$e.current=null;return}if(Date.now()>=N){d||P(y=>y.map(I=>I.id===j?{...I,text:r("support_chat.error_message"),isPending:!1}:I)),$e.current=null;return}setTimeout(C,cs)}};setTimeout(C,cs)},[f,o,we,Pe,r]),Ke=s.useCallback(async(e,c)=>{try{const u=v.current,h=await fetch(`${o}/api/support-chat/sessions/${e}/messages?limit=50`,{headers:{...f?{"X-API-Key":f}:{},...u?{Authorization:`Bearer ${u}`}:{}}});if(!h.ok)return;const d=await h.json();if(!d.success||!d.data)return;const j=d.data.messages.filter(y=>y.role==="user"||y.role==="assistant").map(y=>{const I=y.metadata??void 0,W=I?.ticketCards&&I.ticketCards.length>0?I.ticketCards:void 0;return{id:y.id,role:y.role,text:y.content,promptLogId:y.promptLogId??null,rating:y.userScore??null,...W?{ticketCards:W}:{},...I?.suggestedFollowUps&&I.suggestedFollowUps.length>0?{suggestedFollowUps:I.suggestedFollowUps}:{},...I?.refusalReason?{refusalReason:I.refusalReason,refusalProductName:I.refusalProductName}:{}}}),N=j.length-1,C=N>=0?j[N]:void 0;if(C&&C.role==="assistant"){const y=d.data.messages[d.data.messages.length-1]?.metadata;y?.quickReplies&&y.quickReplies.length>0&&(j[N]={...C,quickReplies:y.quickReplies,...y.awaitingConfirmation?{awaitingConfirmation:y.awaitingConfirmation}:{}})}P(j),st.current=e;const D=d.data.messages[d.data.messages.length-1];if(D&&D.role==="user"){const y=D.createdAt?Date.parse(D.createdAt):NaN;Number.isFinite(y)&&Date.now()-y<Xn&&It(e,y,c)}}catch{}},[f,o,It]),_e=s.useCallback(async e=>{if(!E)return[];try{const c=v.current,u=await fetch(`${o}/api/widget/support-chat/tickets?status=${e}`,{headers:{...f?{"X-API-Key":f}:{},...c?{Authorization:`Bearer ${c}`}:{}}});if(!u.ok)return[];const h=await u.json();return h.data?.counts&&h.data?.tickets?h.data.tickets:[]}catch{return[]}},[o,f,E]);s.useEffect(()=>{let e=!1;return(async()=>{const c=await _e("open").catch(()=>[]);e||He(c)})(),()=>{e=!0}},[_e,m?.jwt]);const vs=s.useCallback(async e=>{hs(e),Ge(!0);const c=await _e(e).catch(()=>[]);He(c),Ge(!1)},[_e]),Mt=s.useRef(!1);s.useEffect(()=>{Mt.current||x&&m?.jwt&&(Mt.current=!0,Ke(x))},[m?.jwt,x,Ke]),s.useEffect(()=>we,[we]),s.useEffect(()=>a.on("support-chat:select-session",e=>{const{sessionId:c}=e;Fe("chat"),!(!c||c===st.current)&&(ge.current?.abort(),P([]),Ze(null),Ye(null),qe(!1),Se(c),Ke(c))}),[a,Ke]);const je=s.useCallback(()=>{const e=G.current;if(!e)return;e.style.height="auto";const c=e.scrollHeight>ls;e.style.height=`${Math.min(e.scrollHeight,ls)}px`,e.style.overflowY=c?"auto":"hidden"},[]);s.useEffect(()=>{je()},[je]);const lt=s.useCallback((e,c)=>{const u=c.metadata??{},h=u.confidence,d=typeof h=="number"?is(h):void 0;P(j=>j.map(N=>N.id===e?{...N,id:c.id,serverId:c.id,promptLogId:c.promptLogId,rating:null,text:c.content,isPending:!1,confidence:h,confidenceLevel:d,sources:u.sources&&u.sources.length>0?u.sources:void 0,actions:u.actions&&u.actions.length>0?u.actions:void 0,quickReplies:u.quickReplies&&u.quickReplies.length>0?u.quickReplies:void 0,ticketCards:u.ticketCards&&u.ticketCards.length>0?u.ticketCards:void 0,suggestedFollowUps:u.suggestedFollowUps&&u.suggestedFollowUps.length>0?u.suggestedFollowUps:void 0,awaitingConfirmation:u.awaitingConfirmation,refusalReason:u.refusalReason,refusalProductName:u.refusalProductName}:N))},[]),At=s.useCallback(e=>{ps(!0),P(c=>c.map(u=>u.id===e?{...u,role:"assistant",text:r("support_chat.demo_quota_reached"),isPending:!1}:u))},[r]),ut=s.useCallback((e,c)=>{it(c??Date.now()+6e4),P(u=>u.map(h=>h.id===e?{...h,role:"assistant",text:r("support_chat.daily_limit_reached"),isPending:!1}:h))},[r]),dt=s.useCallback((e,c)=>{const u=typeof c=="number"&&c>0?c:6e4;Ct(Date.now()+u);const h=Math.ceil(u/1e3);P(d=>d.map(j=>j.id===e?{...j,role:"assistant",text:r("support_chat.rate_limited",{seconds:String(h)}),isPending:!1}:j))},[r]),Pt=s.useCallback((e,c)=>{P(u=>u.filter(h=>h.id!==e)),ie(c==="human"?{kind:"human",displayName:null}:{kind:"waiting",until:Ee.current})},[]),Ne=s.useCallback(()=>{ct.current&&(ct.current=!1,a.emit("chat:draftConsumed",void 0))},[a]),ee=s.useCallback(async(e,c)=>{const u=e.trim();if(!u)return;Ne(),we(),ge.current?.abort(),ge.current=new AbortController,Ze(null),Ye(null),ae(""),Ie([]),G.current&&(G.current.style.height="auto");const h={id:`user-${crypto.randomUUID()}`,role:"user",text:u},d=`assistant-${crypto.randomUUID()}`,j={id:d,role:"assistant",text:"",isPending:!0};P(M=>[...M,h,j]),Pe(),qe(!0),tt.current=d;const N=Date.now(),C=async()=>{const M=Yn-(Date.now()-N);M>0&&await new Promise(Q=>setTimeout(Q,M))};a.emit("support-chat:messageSent",{text:u});const[D]=await Te(async()=>await m?.ensureValidToken?.()??null),y=D??v.current,I={"Content-Type":"application/json",...f?{"X-API-Key":f}:{},...y?{Authorization:`Bearer ${y}`}:{}},W=et.current||X===null;let ve=!1;try{if(c?.quickReplyClick){const F=await fetch(`${o}/api/widget/support-chat/message`,{method:"POST",headers:I,body:JSON.stringify({message:u,productId:l,...W?{newSession:!0}:{},...ce?{userContext:os(ce)}:{},quickReplyClick:c.quickReplyClick}),signal:ge.current.signal}),K=await F.json();if(F.status===429&&K?.error?.code==="DAILY_TOKEN_LIMIT_EXCEEDED"){await C(),ut(d,K.error.resetAtMs);return}if(F.status===429&&K?.error?.code==="DEMO_QUOTA_EXCEEDED"){await C(),At(d);return}if(F.status===429&&K?.error?.code==="RATE_LIMITED"){await C(),dt(d,K.error.retryAfterMs);return}if(F.status===409&&K?.error?.code==="HANDOFF_ACTIVE"){await C(),Pt(d,K.data?.handoffState),K.data?.sessionId&&Se(K.data.sessionId);return}if(!F.ok||!K.success||!K.data)throw new Error(K.error?.message??`HTTP ${F.status}`);Se(K.data.sessionId),et.current=!1,lt(d,K.data.assistantMessage),c.quickReplyClick.payload==="confirm_handoff"&&((K.data.assistantMessage.metadata?.toolCalls?.includes("request_human_handoff")??!1)||(ie({kind:"idle"}),Ee.current=null)),_e(Ae).then(bt=>He(bt));return}let M;const Q=()=>{M&&clearTimeout(M),M=setTimeout(()=>{ve=!0,ge.current?.abort()},Zn)};Q();const S=ge.current;if(!S){clearTimeout(M);return}const[Ce,Yt]=await Te(async()=>{const F=await fetch(`${o}/api/widget/support-chat/stream`,{method:"POST",headers:I,body:JSON.stringify({message:u,productId:l,...W?{newSession:!0}:{},...ce?{userContext:os(ce)}:{}}),signal:S.signal});if(!F.ok||!F.body){const se=await F.json().catch(()=>null);if(F.status===429&&se?.error?.code==="DAILY_TOKEN_LIMIT_EXCEEDED")return{dailyLimitResetAtMs:se.error.resetAtMs};if(F.status===429&&se?.error?.code==="DEMO_QUOTA_EXCEEDED")return{demoQuotaExhausted:!0};if(F.status===429&&se?.error?.code==="RATE_LIMITED")return{rateLimitRetryAfterMs:se.error.retryAfterMs??6e4};if(F.status===409&&se?.error?.code==="HANDOFF_ACTIVE")return se.data?.sessionId&&Se(se.data.sessionId),{handoffState:se.data?.handoffState??null};throw new Error(se?.error?.message??`HTTP ${F.status}`)}const K=F.body.getReader(),bt=new TextDecoder;let Je="",Gt="",es=!1;for(;;){const{done:se,value:Ks}=await K.read();if(se)break;Q(),Je+=bt.decode(Ks,{stream:!0});let vt;for(;(vt=Je.indexOf(`
4
+
5
+ `))!==-1;){const zs=Je.slice(0,vt);Je=Je.slice(vt+2);const{event:Xe,data:Ve}=Jn(zs);if(!(!Xe||!Ve)){if(Xe==="start"){const de=JSON.parse(Ve);de.sessionId&&(Se(de.sessionId),st.current=de.sessionId),et.current=!1}else if(Xe==="token"){const de=JSON.parse(Ve);Gt+=de.value??"";const xt=zn(Gt);P(Qs=>Qs.map(yt=>yt.id===d?{...yt,text:xt}:yt))}else if(Xe==="meta"){const de=JSON.parse(Ve);lt(d,de.assistantMessage),_e(Ae).then(xt=>He(xt)),es=!0}else if(Xe==="error"){const de=JSON.parse(Ve);if(de.code==="HANDOFF_ACTIVE")return{handoffState:null};throw new Error(de.message??"Stream error")}}}}if(!es)throw new Error("Stream ended before completion");return null});if(M&&clearTimeout(M),Yt)throw Yt;if(Ce&&"handoffState"in Ce){await C(),Pt(d,Ce.handoffState);return}if(Ce?.dailyLimitResetAtMs!==void 0){await C(),ut(d,Ce.dailyLimitResetAtMs);return}if(Ce?.demoQuotaExhausted){await C(),At(d);return}if(Ce?.rateLimitRetryAfterMs!==void 0){await C(),dt(d,Ce.rateLimitRetryAfterMs);return}}catch(M){if(M instanceof Error&&M.name==="AbortError"&&!ve){P(Q=>Q.filter(S=>S.id!==d));return}await C(),P(Q=>Q.filter(S=>S.id!==d)),tt.current===d&&(Ye({text:u,options:c}),Ze(r("support_chat.error_message")))}finally{tt.current===d&&qe(!1)}},[a,o,ce,f,l,r,lt,ut,dt,_e,Ae,Pe,m,we,Ne]),be=b?.realtimeProvider==="elevenlabs",[pt,ft]=s.useState([]),$t=s.useRef(0),ze=s.useRef([]);ze.current=pt;const nt=s.useRef(null),ht=s.useRef(null),Lt=s.useRef(new Set),mt=s.useRef(new Set),Qe=s.useRef(!1),Le=s.useRef(null),gt=s.useRef(null),at=s.useRef(!1),Ut=s.useRef(X);Ut.current=X;const Dt=b?.realtime===!0,Ot=s.useRef(i?.voiceStream);Ot.current=i?.voiceStream;const qt=s.useMemo(()=>{if(be){const e=jn({baseUrl:o,apiKey:f,getJwt:()=>v.current,language:k,enabled:!0,getSessionId:()=>Ut.current,onSessionId:c=>{ht.current=c,Se(c)},onUserTurnEnd:()=>Le.current?.(),onTranscript:c=>ft(u=>{const h=u[u.length-1];if(!(h&&De(h)&&h.streaming&&h.role===c.role)){$t.current+=1;const j=`${ds}${$t.current}`;return[...u,{id:j,role:c.role,text:c.text,streaming:c.streaming}]}const d=c.role==="assistant"&&c.streaming?h.text+c.text:c.text;return[...u.slice(0,-1),{...h,text:d,streaming:c.streaming}]})});return nt.current=e,e}return nt.current=null,wn({voiceStream:Ot.current,language:k})},[be,o,f,k]),L=In({transport:qt,agentId:i?.voiceAgentId??"",onUserMessage:e=>{ee(e)},onStopPlayback:()=>q.current?.stop()}),Bt=L.state!=="idle"&&L.state!=="error",oe=L.state!=="idle",Ht=s.useRef(!1);s.useEffect(()=>{const e=Ht.current;if(Ht.current=oe,!oe){const c=(()=>{const u=ze.current;for(let h=u.length-1;h>=0;h-=1){const d=u[h];if(d&&d.role==="assistant"&&d.text?.trim())return d.text}return null})();if(ft([]),e){const u=ht.current??X;u&&Ke(u,c??void 0)}}},[oe]),s.useEffect(()=>{try{window.dispatchEvent(new CustomEvent("es-support-voice-mode",{detail:{active:oe}}))}catch{}},[oe]),s.useEffect(()=>{if(!be||!oe){Lt.current=new Set,mt.current=new Set,Qe.current=!1,Le.current=null;return}let e=!1,c=!1;at.current=!1;const u=async(N=!1)=>{const C=ht.current??X;if(!C||e)return!1;const D=v.current;let y=null;try{const S=await fetch(`${o}/api/support-chat/sessions/${C}/messages?limit=30`,{headers:{...f?{"X-API-Key":f}:{},...D?{Authorization:`Bearer ${D}`}:{}}});if(!S.ok)return!1;y=await S.json()}catch{return!1}if(e)return!1;const I=y?.data?.messages??[],W=Lt.current;if(!Qe.current){if(!N)return!1;for(const S of I)S.id&&mt.current.add(S.id),S.role==="user"&&S.id&&W.add(S.id);return Qe.current=!0,!1}const ve=mt.current,M=I.filter(S=>S.id&&S.content?.trim()&&(S.role==="user"||S.role==="assistant")&&!ve.has(S.id)).map(S=>({id:S.id,role:S.role,text:S.content,...S.metadata?{metadata:S.metadata}:{}}));if(M.length===0)return!1;ft(S=>Tn(S,M));const Q=M.filter(S=>S.role==="user"&&!W.has(S.id));if(Q.length===0)return!1;for(const S of Q)W.add(S.id);return at.current=!0,!0},h=async()=>{if(!(c||e)){c=!0;for(let N=0;N<10&&!e&&!await u(!1);N++)await new Promise(C=>setTimeout(C,500));c=!1}};let d=0;const j=5e3;return Le.current=()=>{if(at.current)return;const N=Date.now();N-d<j||(d=N,h())},gt.current=async()=>{for(let N=0;N<6&&!e;N+=1){if(await u(!1),!ze.current.some(De))return;await new Promise(C=>setTimeout(C,700))}},(async()=>{for(let N=0;N<4&&!e&&!Qe.current;N+=1){if(await u(!0),Qe.current)return;await new Promise(C=>setTimeout(C,300))}})(),()=>{e=!0,Le.current=null,gt.current=null}},[be,oe,X,o,f]);const Ft=s.useRef(!1);s.useEffect(()=>{const e=Ft.current;Ft.current=L.userSpeaking,!e&&L.userSpeaking&&(at.current=!1),e&&!L.userSpeaking&&Le.current?.()},[L.userSpeaking]);const Kt=s.useRef(L.state);s.useEffect(()=>{const e=Kt.current;Kt.current=L.state,(L.state==="thinking"||L.state==="speaking")&&!(e==="thinking"||e==="speaking")&&Le.current?.()},[L.state]);const We=s.useRef(null);s.useEffect(()=>{if(!be||!oe)return;const e=ze.current[ze.current.length-1];if(!(!e||!De(e)||e.role!=="assistant"||!e.text.trim()))return We.current&&clearTimeout(We.current),We.current=setTimeout(()=>{gt.current?.()},900),()=>{We.current&&clearTimeout(We.current)}},[pt,be,oe]);const[zt,xs]=s.useState(!1),[ys,Qt]=s.useState(!1),ks=s.useCallback(e=>{nt.current?.sendUserMessage(e)&&Qt(!0)},[]);s.useEffect(()=>{(L.state==="thinking"||L.state==="speaking")&&Qt(!1)},[L.state]);const Ue=be?pt.map(e=>({key:e.id,role:e.role,text:e.text,...e.metadata?{metadata:e.metadata}:{},...e.streaming?{streaming:!0}:{}})):$.map(e=>{const c=e.role==="assistant"&&e.refusalReason?r(`support_chat.refusal_${e.refusalReason}`,{productName:e.refusalProductName??""}):e.text;return c?{key:e.id,role:e.role==="assistant"?"assistant":"user",text:c,confidence:e.confidenceLevel}:null}).filter(e=>e!==null),ws=be&&oe&&Ue.length>0&&Ue[Ue.length-1].role==="user",js=t.jsxs("div",{className:"es-sc__messages",children:[Ue.map((e,c)=>{const u=c===Ue.length-1;return t.jsxs("div",{className:`es-sc__bubble es-sc__bubble--${e.role}`,"data-confidence":e.confidence,children:[e.role==="assistant"?t.jsx(ss,{text:e.text,allowedLinkHosts:me}):t.jsx("div",{className:"es-sc__bubble-text",children:e.text}),e.role==="assistant"&&t.jsx(ns,{followUps:e.metadata?.suggestedFollowUps,isNewest:u,isPending:!!e.streaming,hasQuickReplies:!!e.metadata?.quickReplies?.length,isSending:ys,onSelect:ks,t:r})]},e.key)}),ws?t.jsx("div",{className:"es-vm__answer-pending",role:"status","aria-label":r("voice_conv.thinking"),children:t.jsxs("div",{className:"es-vm__answer-wave",children:[t.jsx("span",{}),t.jsx("span",{}),t.jsx("span",{}),t.jsx("span",{}),t.jsx("span",{})]})}):null]}),Wt=s.useRef(null);s.useEffect(()=>{if(Dt||!Bt||!w||!B)return;const e=$[$.length-1];!e||e.role!=="assistant"||Wt.current!==e.id&&(Wt.current=e.id,w.activate(e.id))},[$,Bt,w,B]);const _t=s.useCallback(()=>{const e=i?.voiceStream;e?.getState&&e.getState()!=="idle"&&e.stop(),ee(te)},[te,ee,i]),Ns=s.useCallback(()=>{ge.current?.abort(),qe(!1);const e=tt.current;e&&P(c=>c.filter(u=>u.id!==e))},[]),Cs=s.useCallback(()=>{Be&&ee(Be.text,Be.options)},[Be,ee]),Ss=s.useCallback(e=>{if(e.autoSend){ee(e.message);return}Ie([]),ae(""),Ne(),G.current&&(G.current.style.height="auto",G.current.focus())},[ee,Ne]);s.useEffect(()=>{if(!(T!==void 0||Z.length>0))return;const e=`${T}${String(z)}${Y}`;if(Et.current!==e){if(Et.current=e,ct.current=!0,z&&T!==void 0){Ie([]),ee(T);return}Ie(Z),T!==void 0&&(ae(T),requestAnimationFrame(()=>{je(),G.current?.focus()}))}},[T,z,Y,ee]),s.useEffect(()=>{const e=i?.voiceStream;e?.getState&&e.getState()!=="idle"&&e.stop()},[x]);const Rs=s.useCallback(e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),_t())},[_t]),Es=s.useCallback(e=>{Ne(),ae(e.target.value),je()},[je,Ne]),Ts=s.useCallback(()=>{Ne(),ae(""),G.current&&(G.current.style.height="auto",G.current.focus())},[Ne]),Is=s.useCallback(e=>{const c=e.trim();c&&(ae(u=>u?`${u} ${c}`:c),requestAnimationFrame(()=>{je(),G.current?.focus()}))},[je]),Ms=s.useCallback(e=>{a.emit("support-chat:escalated",{messageId:e})},[a]),Jt=s.useRef($);s.useEffect(()=>{Jt.current=$},[$]);const As=s.useCallback(({messageId:e,rating:c},{keepalive:u})=>{const h=Jt.current.find(d=>d.id===e);!h||!h.promptLogId||v.current&&(P(d=>d.map(j=>j.id===e?{...j,rating:c,ratingPending:!0}:j)),(async()=>{const[d,j]=await Te(fetch(`${o}/api/widget/ai-feedback`,{method:"POST",keepalive:u,headers:{"Content-Type":"application/json",...f?{"X-API-Key":f}:{},Authorization:`Bearer ${v.current}`},body:JSON.stringify({promptLogId:h.promptLogId,rating:c})}));if(!j&&d.status===409){P(N=>N.map(C=>C.id===e?{...C,rating:c,ratingPending:!1}:C));return}if(j||!d.ok){P(N=>N.map(C=>C.id===e?{...C,rating:null,ratingPending:!1}:C));return}P(N=>N.map(C=>C.id===e?{...C,rating:c,ratingPending:!1}:C)),a.emit("support-chat:feedbackSubmitted",{messageId:e,rating:c})})())},[a,f,o]),{pending:Xt,rate:Vt,undo:Ps}=Vs({submit:As}),$s=s.useCallback((e,c)=>{const u=$.find(h=>h.id===e);!u||!u.promptLogId||u.ratingPending||v.current&&Vt(e,c)},[$,Vt]),Ls=s.useCallback(()=>{Fe("chat"),ie({kind:"idle"}),Ee.current=null,a.emit("support-chat:clearHistory",void 0)},[a]),Us=s.useCallback(async()=>{if(!X)return;const e=v.current;try{const c=await fetch(`${o}/api/widget/support-chat/handoff/request`,{method:"POST",headers:{"Content-Type":"application/json",...f?{"X-API-Key":f}:{},...e?{Authorization:`Bearer ${e}`}:{}},body:JSON.stringify({sessionId:X,productId:l,conversationLanguage:k})}),u=await c.json();if(!c.ok||!u.success){ie({kind:"idle"});return}if(u.data?.outcome==="unavailable"){ie({kind:"unavailable",reason:Wn(u.data.reason)});return}if(u.data?.outcome==="already_active"){ie(u.data.state==="human"?{kind:"human",displayName:null}:{kind:"waiting",until:Ee.current});return}if(u.data?.outcome==="offered"){const h=u.data.acceptTimeoutSec;Ee.current=typeof h=="number"?Date.now()+h*1e3:null,ie({kind:"waiting",until:Ee.current})}}catch{ie({kind:"idle"})}},[f,o,k,l,X]),Ds=s.useCallback(async e=>{if(!X)return!1;const c=v.current;try{const u=await fetch(`${o}/api/widget/support-chat/handoff/contact`,{method:"POST",headers:{"Content-Type":"application/json",...f?{"X-API-Key":f}:{},...c?{Authorization:`Bearer ${c}`}:{}},body:JSON.stringify({sessionId:X,productId:l,...e.email?{email:e.email}:{},...e.phone?{phone:e.phone}:{},...e.note?{note:e.note}:{}})}),h=await u.json();return!u.ok||!h.success?!1:(ie({kind:"contact_left"}),!0)}catch{return!1}},[f,o,l,X]),Os=s.useCallback(()=>{ie({kind:"idle"})},[]),rt=s.useCallback(()=>{Fe("tickets"),Ge(!0),_e(Ae).then(e=>He(e)).catch(()=>{}).finally(()=>Ge(!1))},[_e,Ae]),qs=s.useCallback(()=>{re==="tickets"?Fe("chat"):rt()},[re,rt]),Bs=s.useCallback(e=>{Fe("chat"),a.emit("support-chat:select-session",{sessionId:e})},[a]);s.useEffect(()=>E?a.on("support-chat:showTickets",()=>{rt()}):void 0,[a,rt,E]);const Hs=s.useCallback((e,c,u)=>{P(j=>j.map(N=>N.id===e?{...N,quickReplyAnswered:c}:N));const h=$.find(j=>j.id===e)?.awaitingConfirmation,d=Hn.includes(u);u==="confirm_handoff"&&ie({kind:"waiting",until:Ee.current}),ee(c,{...d?{quickReplyClick:{payload:u,summary:h?.summary,details:h?.details??void 0,priority:h?.priority,sourceMessageId:e}}:{}})},[$,ee]),Fs=s.useCallback(()=>{a.emit("support-chat:showHistory",void 0)},[a]),Zt=$.length===0;return oe?t.jsx(ts,{blockType:"support-chat",children:t.jsx(Ln,{state:L.state,draft:L.draft,error:L.error,muted:zt,listening:L.userSpeaking,hasTranscript:Ue.length>0,transcript:js,onToggleMute:()=>{const e=!zt;xs(e),nt.current?.setMuted(e)},onEnd:()=>L.stop(),onRetry:()=>{L.start()},t:r})}):t.jsxs(ts,{blockType:"support-chat",children:[t.jsxs("div",{className:"es-sc__chat-header",children:[t.jsx("span",{className:"es-sc__chat-header-title",children:E&&re==="tickets"?r("support_chat.tickets_view_title"):Oe}),t.jsxs("div",{className:"es-sc__chat-header-actions",children:[t.jsx("button",{type:"button",className:"es-sc__chat-action-btn","aria-label":r("support_chat.new_conversation_button"),title:r("support_chat.new_conversation_button"),onClick:Ls,children:t.jsx(qn,{size:18})}),t.jsx("button",{type:"button",className:"es-sc__chat-action-btn","aria-label":r("support_chat.history_button"),title:r("support_chat.history_button"),onClick:Fs,children:t.jsx(On,{size:16})}),he&&re==="chat"&&Rt.kind==="idle"&&t.jsx("button",{type:"button",className:"es-sc__chat-action-btn es-sc__chat-action-btn--label","aria-label":r("support_chat.handoff.button_label"),title:r("support_chat.handoff.button_label"),onClick:()=>{Us()},children:r("support_chat.handoff.button_label")}),E&&t.jsx("button",{type:"button",className:`es-sc__chat-action-btn${re==="tickets"?" es-sc__chat-action-btn--active":""}`,"aria-label":r("support_chat.tickets_tab_button"),title:r("support_chat.tickets_tab_button"),"aria-pressed":re==="tickets",onClick:qs,children:t.jsx(Bn,{size:16})}),t.jsx(Zs,{panelKey:"support-chat",baseUrl:o,apiKey:f||void 0,t:r})]})]}),t.jsx("div",{className:"es-block__body es-sc__body",children:E&&re==="tickets"?t.jsx(un,{status:Ae,loading:gs,tickets:ms,onSelectStatus:vs,onSelectSession:Bs,t:r}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"es-sc__messages",ref:_s,children:[Zt&&t.jsx("div",{className:"es-sc__welcome",children:t.jsx("div",{className:"es-sc__welcome-text",children:H})}),$.map((e,c)=>{const u=c===$.length-1,h=e.role==="assistant"&&e.refusalReason?r(`support_chat.refusal_${e.refusalReason}`,{productName:e.refusalProductName??""}):e.text;return t.jsxs("div",{className:`es-sc__bubble es-sc__bubble--${e.role}`,"data-confidence":e.confidenceLevel,children:[h&&(e.role==="assistant"?t.jsxs(t.Fragment,{children:[t.jsx(ss,{text:h,allowedLinkHosts:me}),t.jsx(on,{text:h,allowEmbeds:ye,allowedImageHosts:me,t:r}),B&&t.jsx(vn,{id:e.id,session:w,onActivate:()=>w.activate(e.id),t:r})]}):t.jsx("div",{className:"es-sc__bubble-text",children:h})),e.isPending&&!e.text&&t.jsxs("div",{className:"es-sc__typing","aria-label":r("support_chat.typing_aria"),children:[t.jsx("span",{className:"es-sc__typing-dot"}),t.jsx("span",{className:"es-sc__typing-dot"}),t.jsx("span",{className:"es-sc__typing-dot"})]}),e.actions&&e.actions.length>0&&t.jsx("div",{className:"es-sc__actions","data-es-no-read":!0,children:e.actions.map(d=>t.jsx("a",{href:Qn(d.url)?d.url:"#",target:"_blank",rel:"noopener noreferrer",className:"es-sc__action-btn",children:d.title},d.slug))}),e.ticketCards&&e.ticketCards.length>0&&t.jsx("div",{className:"es-sc__ticket-cards",children:e.ticketCards.map(d=>t.jsx(us,{card:d,t:r},d.externalNumber))}),e.quickReplies&&e.quickReplies.length>0&&t.jsx("div",{className:"es-sc__quick-replies",children:e.quickReplies.map(d=>{const j=e.quickReplyAnswered===d.value;if(e.quickReplyAnswered!==void 0&&!j)return null;const N=d.payload==="confirm_escalation"?r("escalation.confirm_yes"):d.payload==="cancel_escalation"?r("escalation.confirm_no"):d.payload==="confirm_handoff"?r("support_chat.handoff.confirm_yes"):d.payload==="decline_handoff"?r("support_chat.handoff.confirm_no"):d.label;return t.jsx("button",{type:"button",disabled:j||J,onClick:()=>Hs(e.id,d.value,d.payload??""),className:`es-sc__quick-reply-btn${j?" es-sc__quick-reply-btn--clicked":""}`,children:N},d.value)})}),e.role==="assistant"&&t.jsx(ns,{followUps:e.suggestedFollowUps,isNewest:u,isPending:!!e.isPending,hasQuickReplies:!!e.quickReplies?.length,isSending:J,onSelect:d=>ee(d),t:r}),e.role==="assistant"&&!e.isPending&&e.text&&t.jsxs(t.Fragment,{children:[e.promptLogId&&v.current&&(()=>{const d=Xt?.messageId===e.id?Xt.rating:null;return t.jsxs("div",{className:"es-sc__feedback","aria-label":r("support_chat.rate_aria"),"data-es-no-read":!0,children:[t.jsx("span",{className:"es-sc__feedback-label",children:e.rating&&d===null?r("support_chat.feedback_thanks"):r("support_chat.rate_aria")}),t.jsx(Gn,{value:d??e.rating??null,onChange:j=>$s(e.id,j),disabled:d===null&&(!!e.rating||e.ratingPending),t:r}),d!==null&&t.jsxs("div",{className:"es-sc__rating-undo",role:"status",children:[t.jsx("span",{className:"es-sc__rating-undo-text",children:r("support_chat.rating_undo_toast",{rating:d})}),t.jsx("button",{type:"button",className:"es-sc__rating-undo-btn",onClick:Ps,children:r("support_chat.rating_undo_button")})]})]})})(),e.confidenceLevel==="low"&&t.jsxs("div",{className:"es-sc__escalation",children:[t.jsx("span",{className:"es-sc__escalation-text",children:r("support_chat.low_confidence")}),t.jsx("button",{className:"es-sc__escalation-btn",onClick:()=>Ms(e.id),type:"button","aria-label":fe,children:fe})]})]})]},e.id)}),Nt&&t.jsxs("div",{className:"es-sc__error",role:"alert",children:[t.jsx("span",{className:"es-sc__error-text",children:Nt}),Be&&t.jsx("button",{type:"button",className:"es-sc__error-retry",onClick:Cs,children:r("support_chat.retry")})]})]}),!bs&&$.length>0&&t.jsxs("button",{type:"button",className:"es-sc__jump",onClick:()=>Pe(),"aria-label":r("support_chat.jump_to_latest"),title:r("support_chat.jump_to_latest"),children:[t.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M12 5v14"}),t.jsx("path",{d:"m19 12-7 7-7-7"})]}),t.jsx("span",{className:"es-sc__jump-label",children:r("support_chat.jump_to_latest")})]})]})}),re!=="tickets"&&ke.length>0&&t.jsx("div",{className:"es-sc__suggestions",role:"group","aria-label":r("support_chat.quick_actions_aria"),children:ke.map((e,c)=>t.jsx("button",{className:"es-sc__suggestion",onClick:()=>Ss(e),type:"button",disabled:J||_,children:e.labelKey?r(e.labelKey):e.label},`${e.labelKey??e.label}-${c}`))}),re!=="tickets"&&ke.length===0&&Zt&&ue&&ne.length>0&&t.jsx("div",{className:"es-sc__suggestions",role:"list","aria-label":r("support_chat.suggestions_aria"),children:ne.map((e,c)=>t.jsx("button",{className:"es-sc__suggestion",onClick:()=>ee(e),type:"button",role:"listitem",children:e},c))}),re!=="tickets"&&t.jsx(Rn,{status:Rt,onSubmitContact:Ds,onDismissContact:Os,t:r}),re!=="tickets"&&t.jsxs("div",{className:"es-block__footer es-sc__footer",children:[t.jsx("div",{className:"es-sc__disclaimer","data-es-no-read":!0,children:r("support_chat.disclaimer")}),t.jsxs("div",{className:"es-sc__input-row",children:[U&&qt.available&&(be||Dt||A)&&t.jsx("button",{type:"button",className:"es-sc__conv-start","data-testid":"conversation-start","aria-label":r("voice_conv.start"),title:r("voice_conv.start"),onClick:()=>{L.start()},children:t.jsx("svg",{width:"19",height:"19",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",children:t.jsx("path",{d:"M4 10v4M8 6v12M12 3v18M16 6v12M20 10v4"})})}),t.jsxs("div",{className:"es-sc__textarea-wrap",children:[t.jsx("textarea",{ref:G,className:"es-sc__textarea",value:te,onChange:Es,onKeyDown:Rs,placeholder:Re!=null?r("support_chat.rate_limited_wait",{seconds:String(fs)}):pe,rows:1,maxLength:2e3,disabled:J||_||Me!=null||Re!=null||ot,"aria-label":r("support_chat.input_aria")}),te.length>0&&t.jsx("button",{className:"es-sc__clear",onClick:Ts,disabled:J,type:"button","aria-label":r("support_chat.clear_input_aria"),children:t.jsx("span",{"aria-hidden":"true",children:"✕"})})]}),A&&!_&&t.jsx(hn,{baseUrl:o,apiKey:f,jwt:v.current,language:k,onTranscript:Is,t:r,disabled:J||Me!=null||Re!=null||ot,streaming:b?.streaming,voiceStream:i?.voiceStream,baseText:()=>te,onText:e=>{if(ae(e.length>2e3?e.slice(0,2e3):e),e.length>=2e3){const c=i?.voiceStream;c?.getState&&c.getState()!=="idle"&&c.stop()}requestAnimationFrame(()=>{je(),G.current?.focus()})}}),t.jsx("button",{className:`es-sc__send${J?" es-sc__send--stop":""}`,onClick:J?Ns:_t,disabled:!J&&(_||!te.trim()||Me!=null||Re!=null||ot),type:"button","aria-label":r(J?"support_chat.stop_aria":"chat.send_aria"),children:J?t.jsx("span",{className:"es-sc__stop-icon","aria-hidden":"true"}):t.jsx("span",{"aria-hidden":"true",children:"➤"})})]})]})]})}export{on as AssistantMessageMedia,la as Component,ss as MarkdownBubble,rn as MessageMedia,Ln as VoiceModeView,ca as manifest};
6
+ //# sourceMappingURL=index-xx1GG5d1-CW29F9vY.js.map