comisai 1.0.16 → 1.0.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 (90) hide show
  1. package/node_modules/@comis/agent/package.json +1 -1
  2. package/node_modules/@comis/channels/package.json +1 -1
  3. package/node_modules/@comis/cli/dist/wizard/non-interactive.js +1 -0
  4. package/node_modules/@comis/cli/dist/wizard/steps/01-detect-existing.js +2 -0
  5. package/node_modules/@comis/cli/dist/wizard/steps/07-gateway.js +9 -0
  6. package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.js +2 -0
  7. package/node_modules/@comis/cli/dist/wizard/steps/12-finish.js +5 -2
  8. package/node_modules/@comis/cli/dist/wizard/types.d.ts +1 -0
  9. package/node_modules/@comis/cli/package.json +1 -1
  10. package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +17 -2
  11. package/node_modules/@comis/core/dist/config/schema-gateway.js +11 -0
  12. package/node_modules/@comis/core/dist/config/schema.d.ts +60 -57
  13. package/node_modules/@comis/core/package.json +1 -1
  14. package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +34 -6
  15. package/node_modules/@comis/daemon/package.json +1 -1
  16. package/node_modules/@comis/gateway/package.json +1 -1
  17. package/node_modules/@comis/infra/package.json +1 -1
  18. package/node_modules/@comis/memory/package.json +1 -1
  19. package/node_modules/@comis/scheduler/package.json +1 -1
  20. package/node_modules/@comis/shared/package.json +1 -1
  21. package/node_modules/@comis/skills/package.json +1 -1
  22. package/node_modules/@comis/web/dist/android-chrome-192x192.png +0 -0
  23. package/node_modules/@comis/web/dist/android-chrome-512x512.png +0 -0
  24. package/node_modules/@comis/web/dist/apple-touch-icon.png +0 -0
  25. package/node_modules/@comis/web/dist/assets/agent-detail-BG9MGWWj.js +615 -0
  26. package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +2173 -0
  27. package/node_modules/@comis/web/dist/assets/agent-list-LHCJ4rw2.js +504 -0
  28. package/node_modules/@comis/web/dist/assets/approvals-q9VH_IKr.js +54 -0
  29. package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +375 -0
  30. package/node_modules/@comis/web/dist/assets/channel-detail-CaInesJM.js +681 -0
  31. package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +323 -0
  32. package/node_modules/@comis/web/dist/assets/chat-console-CNmzl0JW.js +943 -0
  33. package/node_modules/@comis/web/dist/assets/config-editor-DX4ITw6y.js +1374 -0
  34. package/node_modules/@comis/web/dist/assets/context-dag-browser-BwiaF5tf.js +393 -0
  35. package/node_modules/@comis/web/dist/assets/context-engine-BZ5Am6hA.js +393 -0
  36. package/node_modules/@comis/web/dist/assets/delivery-view-OfBZof-m.js +392 -0
  37. package/node_modules/@comis/web/dist/assets/diagnostics-view-YFwCxgr2.js +231 -0
  38. package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +1 -0
  39. package/node_modules/@comis/web/dist/assets/extract-variables-BM5qyK-s.js +149 -0
  40. package/node_modules/@comis/web/dist/assets/ic-array-editor-B7m6x7-S.js +118 -0
  41. package/node_modules/@comis/web/dist/assets/ic-breadcrumb-CUMpp3BL.js +75 -0
  42. package/node_modules/@comis/web/dist/assets/ic-budget-segment-bar-BtJ6x5mN.js +64 -0
  43. package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +352 -0
  44. package/node_modules/@comis/web/dist/assets/ic-confirm-dialog-CCDbB04e.js +110 -0
  45. package/node_modules/@comis/web/dist/assets/ic-connection-dot-CnT1b8xr.js +54 -0
  46. package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +277 -0
  47. package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +67 -0
  48. package/node_modules/@comis/web/dist/assets/ic-detail-panel-BF83r-if.js +116 -0
  49. package/node_modules/@comis/web/dist/assets/ic-empty-state-60l2ePhd.js +52 -0
  50. package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +359 -0
  51. package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +33 -0
  52. package/node_modules/@comis/web/dist/assets/ic-layer-waterfall-COvEYMg5.js +69 -0
  53. package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +12 -0
  54. package/node_modules/@comis/web/dist/assets/ic-search-input-CSOxY9g7.js +92 -0
  55. package/node_modules/@comis/web/dist/assets/ic-select-Ce-Raudx.js +127 -0
  56. package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +95 -0
  57. package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +33 -0
  58. package/node_modules/@comis/web/dist/assets/ic-time-range-picker-CypCT68y.js +93 -0
  59. package/node_modules/@comis/web/dist/assets/ic-tool-call-7MaXSsCW.js +146 -0
  60. package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +2830 -0
  61. package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +1 -0
  62. package/node_modules/@comis/web/dist/assets/mcp-management-BNZPnpDn.js +582 -0
  63. package/node_modules/@comis/web/dist/assets/media-config-BBvTYxOX.js +314 -0
  64. package/node_modules/@comis/web/dist/assets/media-test-BkK3RCRK.js +496 -0
  65. package/node_modules/@comis/web/dist/assets/memory-inspector-1hDGCGat.js +1139 -0
  66. package/node_modules/@comis/web/dist/assets/message-center-CXefwsUu.js +785 -0
  67. package/node_modules/@comis/web/dist/assets/models-C1qcU_j3.js +894 -0
  68. package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +1 -0
  69. package/node_modules/@comis/web/dist/assets/observe-view-C0VBhX4C.js +814 -0
  70. package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +1496 -0
  71. package/node_modules/@comis/web/dist/assets/pipeline-history-DkfOQ6SW.js +317 -0
  72. package/node_modules/@comis/web/dist/assets/pipeline-history-detail-hyHgD0ai.js +287 -0
  73. package/node_modules/@comis/web/dist/assets/pipeline-list-BPW8hV-q.js +518 -0
  74. package/node_modules/@comis/web/dist/assets/pipeline-monitor-Bip16T7e.js +972 -0
  75. package/node_modules/@comis/web/dist/assets/scheduler-BGgwKd06.js +1182 -0
  76. package/node_modules/@comis/web/dist/assets/security-D15st4xx.js +1224 -0
  77. package/node_modules/@comis/web/dist/assets/session-detail-SGEYNJ0M.js +632 -0
  78. package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +1 -0
  79. package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +231 -0
  80. package/node_modules/@comis/web/dist/assets/setup-wizard-nT0tz9QP.js +853 -0
  81. package/node_modules/@comis/web/dist/assets/skills-D8yVfSUy.js +1051 -0
  82. package/node_modules/@comis/web/dist/assets/subagents-HHXMeHYo.js +193 -0
  83. package/node_modules/@comis/web/dist/assets/workspace-manager-BQlr10iH.js +785 -0
  84. package/node_modules/@comis/web/dist/comis-logo.png +0 -0
  85. package/node_modules/@comis/web/dist/favicon-16x16.png +0 -0
  86. package/node_modules/@comis/web/dist/favicon-32x32.png +0 -0
  87. package/node_modules/@comis/web/dist/favicon.ico +0 -0
  88. package/node_modules/@comis/web/dist/index.html +17 -0
  89. package/node_modules/@comis/web/package.json +29 -0
  90. package/package.json +15 -13
@@ -0,0 +1,785 @@
1
+ import{a as _,I as l,b as r,A as d,s as g,f as v,i as b,n as f,r as o,t as y}from"./index-CEcM1R_C.js";import"./ic-breadcrumb-CUMpp3BL.js";import"./ic-empty-state-60l2ePhd.js";import"./ic-confirm-dialog-CCDbB04e.js";import"./ic-relative-time-3FqpjeAI.js";import"./ic-icon-xeGTVhVG.js";var C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,c=(e,t,s,i)=>{for(var a=i>1?void 0:i?x(t,s):t,h=e.length-1,p;h>=0;h--)(p=e[h])&&(a=(i?p(t,s,a):p(a))||a);return i&&a&&C(t,s,a),a};const w=["👍","👎","❤️","😂","😢","🤔","🔥","💯","👏","🚀","👀","👋","✅","❌","⭐","🎉","🙏","💪","🧠","💡","👑","💎","✨","🌈"],I={discord:[{group:"Messages",actions:[{action:"pin",label:"Pin Message",needsMessageId:!0},{action:"unpin",label:"Unpin Message",needsMessageId:!0}]},{group:"Moderation",actions:[{action:"kick",label:"Kick User",needsInput:"userId"},{action:"ban",label:"Ban User",needsInput:"userId"},{action:"unban",label:"Unban User",needsInput:"userId"}]},{group:"Channel",actions:[{action:"set_topic",label:"Set Topic",needsInput:"topic"},{action:"set_slowmode",label:"Set Slowmode",needsInput:"seconds"},{action:"sendTyping",label:"Send Typing Indicator"}]},{group:"Threads",actions:[{action:"threadCreate",label:"Create Thread",needsInput:"name"},{action:"threadList",label:"List Threads"}]},{group:"Info",actions:[{action:"guild_info",label:"Guild Info"},{action:"channel_info",label:"Channel Info"}]}],telegram:[{group:"Messages",actions:[{action:"pin",label:"Pin Message",needsMessageId:!0},{action:"unpin",label:"Unpin Message",needsMessageId:!0}]},{group:"Moderation",actions:[{action:"ban",label:"Ban User",needsInput:"userId"},{action:"unban",label:"Unban User",needsInput:"userId"},{action:"restrict",label:"Restrict User",needsInput:"userId"},{action:"promote",label:"Promote User",needsInput:"userId"},{action:"demote",label:"Demote User",needsInput:"userId"}]},{group:"Chat",actions:[{action:"set_title",label:"Set Chat Title",needsInput:"title"},{action:"set_description",label:"Set Description",needsInput:"description"},{action:"sendTyping",label:"Send Typing Indicator"}]},{group:"Info",actions:[{action:"chat_info",label:"Chat Info"},{action:"member_count",label:"Member Count"},{action:"get_admins",label:"Get Admins"}]}],slack:[{group:"Messages",actions:[{action:"pin",label:"Pin Message",needsMessageId:!0},{action:"unpin",label:"Unpin Message",needsMessageId:!0}]},{group:"Channel",actions:[{action:"set_topic",label:"Set Topic",needsInput:"topic"},{action:"set_purpose",label:"Set Purpose",needsInput:"purpose"},{action:"archive",label:"Archive Channel"},{action:"unarchive",label:"Unarchive Channel"},{action:"sendTyping",label:"Send Typing Indicator"}]},{group:"Members",actions:[{action:"invite",label:"Invite User",needsInput:"userId"},{action:"kick",label:"Kick User",needsInput:"userId"},{action:"members_list",label:"List Members"}]},{group:"Info",actions:[{action:"channel_info",label:"Channel Info"},{action:"bookmark_add",label:"Add Bookmark",needsInput:"url"}]}],whatsapp:[{group:"Group",actions:[{action:"group_info",label:"Group Info"},{action:"group_update_subject",label:"Update Subject",needsInput:"subject"},{action:"group_update_description",label:"Update Description",needsInput:"description"},{action:"group_invite_code",label:"Get Invite Code"}]},{group:"Members",actions:[{action:"group_participants_add",label:"Add Participant",needsInput:"participant"},{action:"group_participants_remove",label:"Remove Participant",needsInput:"participant"},{action:"group_promote",label:"Promote to Admin",needsInput:"participant"},{action:"group_demote",label:"Demote from Admin",needsInput:"participant"}]},{group:"Settings",actions:[{action:"group_settings",label:"Group Settings"}]}]},$={discord:"discord.action",telegram:"telegram.action",slack:"slack.action",whatsapp:"whatsapp.action"};let n=class extends _{constructor(){super(...arguments),this.rpcClient=null,this.eventDispatcher=null,this.channelType="",this._loadState="idle",this._error="",this._messages=[],this._effectiveChannel="",this._capabilities=null,this._channelList=[],this._sendText="",this._showSendConfirm=!1,this._actionPending=!1,this._botName="",this._replyToId="",this._replyText="",this._showReplyConfirm=!1,this._editingId="",this._editText="",this._deleteTargetId="",this._showDeleteConfirm=!1,this._reactTargetId="",this._showEmojiPicker=!1,this._attachUrl="",this._attachType="file",this._attachCaption="",this._showAttachForm=!1,this._chatList=[],this._selectedChatId="",this._platformActionPending=!1,this._selectedMessageId="",this._actionResult="",this._actionInputs={},this._hasLoaded=!1,this._previousChannelType="",this._boundEmojiOutsideClick=null,this._autoSelectAttempted=!1}disconnectedCallback(){super.disconnectedCallback(),this._removeEmojiOutsideListener()}updated(e){const t=this.rpcClient&&this.rpcClient.status==="connected";e.has("channelType")&&this.channelType&&(this._effectiveChannel=this.channelType,this._selectedChatId="",this._chatList=[]),e.has("channelType")&&this.channelType&&this.channelType!==this._previousChannelType?(this._previousChannelType=this.channelType,this._hasLoaded=!1,this._loadData()):e.has("rpcClient")&&t&&this._effectiveChannel&&!this._hasLoaded&&this._loadData(),!this.channelType&&this.rpcClient&&!this._autoSelectAttempted&&(this._autoSelectAttempted=!0,this._autoSelectChannel())}async _autoSelectChannel(){if(!this.rpcClient)return;const e=this.rpcClient;if(e.status!=="connected"&&await new Promise(t=>{const s=()=>{if(e.status==="connected"){t();return}if(e.status==="disconnected"){t();return}setTimeout(s,100)};s()}),e.status!=="connected"){this._loadState="error",this._error="RPC connection failed";return}try{const s=(await e.call("channels.list"))?.channels??[];this._channelList=s;const i=s.filter(a=>a.status==="running");i.length>0?(this._effectiveChannel=i[0].channelType,this._loadChats(),this._loadData()):this._loadState="loaded"}catch{this._loadState="error",this._error="Failed to load channel list"}}async _loadData(){const e=this._effectiveChannel;if(!(!this.rpcClient||!e)){this._loadState="loading",this._error="";try{const[t,s,i]=await Promise.allSettled([this.rpcClient.call("channels.list"),this.rpcClient.call("channels.capabilities",{channel_type:e}),this.rpcClient.call("channels.get",{channel_type:e})]);t.status==="fulfilled"&&t.value?.channels&&(this._channelList=t.value.channels),s.status==="fulfilled"&&s.value?.features&&(this._capabilities=s.value.features),i.status==="fulfilled"&&i.value&&(this._botName=i.value.botName??i.value.name??e),await this._loadChats(),await this._refetchMessages(),this._loadState="loaded",this._hasLoaded=!0}catch(t){this._loadState="error",this._error=t instanceof Error?t.message:"Failed to load message center data"}}}async _loadChats(){if(!(!this.rpcClient||!this._effectiveChannel))try{const t=(await this.rpcClient.call("obs.channels.all"))?.channels??[],s=new Map;for(const i of t){if(i.channelType!==this._effectiveChannel||!i.channelId||i.channelId==="unknown")continue;const a=i.messagesSent+i.messagesReceived;s.set(i.channelId,`${i.channelId} (${a} msgs)`)}this._chatList=Array.from(s.entries()).map(([i,a])=>({chatId:i,label:a})),this._chatList.length>0&&!this._selectedChatId&&(this._selectedChatId=this._chatList[0].chatId)}catch{}}async _refetchMessages(){if(this.rpcClient){if(this._capabilities?.fetchHistory){try{const e=await this.rpcClient.call("message.fetch",{channel_type:this._effectiveChannel,channel_id:this._selectedChatId||this._effectiveChannel,limit:50});this._messages=e?.messages??[]}catch{}return}try{const t=(await this.rpcClient.call("session.list",{kind:"all"}))?.sessions??[],s=this._selectedChatId,i=s?t.filter(m=>m.channelId===s):[];if(i.length===0){this._messages=[];return}i.sort((m,u)=>u.updatedAt-m.updatedAt);const a=i[0],p=(await this.rpcClient.call("session.history",{session_key:a.sessionKey,limit:50}))?.messages??[];this._messages=p.map((m,u)=>({id:`stored-${u}`,senderId:m.role,text:m.content,timestamp:m.timestamp}))}catch{this._messages=[]}}}_handleChannelChange(e){const s=e.target.value;s&&s!==this._effectiveChannel&&this.dispatchEvent(new CustomEvent("navigate",{detail:`messages/${s}`,bubbles:!0,composed:!0}))}_handleChatChange(e){const t=e.target;this._selectedChatId=t.value,this._refetchMessages()}_handleSendClick(){this._sendText.trim()&&(this._showSendConfirm=!0)}async _handleSendConfirm(){if(this._showSendConfirm=!1,!(!this.rpcClient||!this._sendText.trim())){this._actionPending=!0;try{await this.rpcClient.call("message.send",{channel_type:this._effectiveChannel,channel_id:this._selectedChatId||this._effectiveChannel,text:this._sendText.trim()}),l.show("Message sent","success"),this._sendText="",await this._refetchMessages()}catch(e){const t=e instanceof Error?e.message:"Failed to send message";l.show(t,"error")}finally{this._actionPending=!1}}}_handleSendCancel(){this._showSendConfirm=!1}_handleKeydown(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this._handleSendClick())}_handleReplyClick(e){this._replyToId=e,this._replyText="",this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".reply-input")?.focus()})}_handleReplyCancelClick(){this._replyToId="",this._replyText="",this._showReplyConfirm=!1}_handleReplySendClick(){!this._replyText.trim()||!this._replyToId||(this._showReplyConfirm=!0)}async _handleReplyConfirm(){if(this._showReplyConfirm=!1,!(!this.rpcClient||!this._replyText.trim()||!this._replyToId)){this._actionPending=!0;try{await this.rpcClient.call("message.reply",{channel_type:this._effectiveChannel,channel_id:this._selectedChatId||this._effectiveChannel,text:this._replyText.trim(),message_id:this._replyToId}),l.show("Reply sent","success"),this._replyToId="",this._replyText="",await this._refetchMessages()}catch(e){const t=e instanceof Error?e.message:"Failed to send reply";l.show(t,"error")}finally{this._actionPending=!1}}}_handleReplyCancel(){this._showReplyConfirm=!1}_handleReplyKeydown(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this._handleReplySendClick()),e.key==="Escape"&&this._handleReplyCancelClick()}_handleEditClick(e){this._editingId=e.id,this._editText=e.text,this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".edit-input")?.focus()})}_handleEditCancelClick(){this._editingId="",this._editText=""}async _handleEditSave(){if(!(!this.rpcClient||!this._editText.trim()||!this._editingId)){this._actionPending=!0;try{await this.rpcClient.call("message.edit",{channel_type:this._effectiveChannel,channel_id:this._selectedChatId||this._effectiveChannel,message_id:this._editingId,text:this._editText.trim()}),l.show("Message edited","success"),this._editingId="",this._editText="",await this._refetchMessages()}catch(e){const t=e instanceof Error?e.message:"Failed to edit message";l.show(t,"error")}finally{this._actionPending=!1}}}_handleEditKeydown(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this._handleEditSave()),e.key==="Escape"&&this._handleEditCancelClick()}_handleDeleteClick(e){this._deleteTargetId=e,this._showDeleteConfirm=!0}async _handleDeleteConfirm(){if(this._showDeleteConfirm=!1,!(!this.rpcClient||!this._deleteTargetId)){this._actionPending=!0;try{await this.rpcClient.call("message.delete",{channel_type:this._effectiveChannel,channel_id:this._selectedChatId||this._effectiveChannel,message_id:this._deleteTargetId}),l.show("Message deleted","success"),this._messages=this._messages.filter(e=>e.id!==this._deleteTargetId),this._deleteTargetId=""}catch(e){const t=e instanceof Error?e.message:"Failed to delete message";l.show(t,"error"),this._deleteTargetId="",await this._refetchMessages()}finally{this._actionPending=!1}}}_handleDeleteCancel(){this._showDeleteConfirm=!1,this._deleteTargetId=""}_handleReactClick(e){if(this._reactTargetId===e&&this._showEmojiPicker){this._closeEmojiPicker();return}this._reactTargetId=e,this._showEmojiPicker=!0,requestAnimationFrame(()=>this._installEmojiOutsideListener())}async _handleEmojiSelect(e){if(!(!this.rpcClient||!this._reactTargetId)){this._closeEmojiPicker(),this._actionPending=!0;try{await this.rpcClient.call("message.react",{channel_type:this._effectiveChannel,channel_id:this._selectedChatId||this._effectiveChannel,message_id:this._reactTargetId,emoji:e}),l.show("Reaction added","success")}catch(t){const s=t instanceof Error?t.message:"Failed to add reaction";l.show(s,"error")}finally{this._actionPending=!1,this._reactTargetId=""}}}_closeEmojiPicker(){this._showEmojiPicker=!1,this._reactTargetId="",this._removeEmojiOutsideListener()}_installEmojiOutsideListener(){this._removeEmojiOutsideListener(),this._boundEmojiOutsideClick=e=>{const t=e.composedPath(),s=this.shadowRoot?.querySelector(".emoji-picker"),i=this.shadowRoot?.querySelector(`[data-react-id="${this._reactTargetId}"]`);s&&!t.includes(s)&&(!i||!t.includes(i))&&this._closeEmojiPicker()},document.addEventListener("click",this._boundEmojiOutsideClick,!0)}_removeEmojiOutsideListener(){this._boundEmojiOutsideClick&&(document.removeEventListener("click",this._boundEmojiOutsideClick,!0),this._boundEmojiOutsideClick=null)}_toggleAttachForm(){this._showAttachForm=!this._showAttachForm,this._showAttachForm||(this._attachUrl="",this._attachType="file",this._attachCaption="")}async _handleAttachSend(){if(!(!this.rpcClient||!this._attachUrl.trim())){this._actionPending=!0;try{await this.rpcClient.call("message.attach",{channel_type:this._effectiveChannel,channel_id:this._selectedChatId||this._effectiveChannel,attachment_url:this._attachUrl.trim(),attachment_type:this._attachType,caption:this._attachCaption.trim()||void 0}),l.show("Attachment sent","success"),this._attachUrl="",this._attachType="file",this._attachCaption="",this._showAttachForm=!1}catch(e){const t=e instanceof Error?e.message:"Failed to send attachment";l.show(t,"error")}finally{this._actionPending=!1}}}_handleMessageClick(e){this._selectedMessageId=this._selectedMessageId===e?"":e}_getActionInputKey(e,t){return`${e}-${t}`}_handleActionInputChange(e,t){this._actionInputs={...this._actionInputs,[e]:t}}async _handlePlatformAction(e){if(!this.rpcClient)return;const t=$[this._effectiveChannel];if(!t)return;const s={action:e.action};if(this._effectiveChannel==="telegram"?s.chat_id=this._selectedChatId||this._effectiveChannel:this._effectiveChannel==="whatsapp"?s.group_jid=this._selectedChatId||this._effectiveChannel:s.channel_id=this._selectedChatId||this._effectiveChannel,e.needsMessageId&&this._selectedMessageId&&(s.message_id=this._selectedMessageId),e.needsInput){const i=this._getActionInputKey("",e.action),a=this._actionInputs[i]?.trim();a&&(s[e.needsInput]=a)}this._platformActionPending=!0,this._actionResult="";try{const i=await this.rpcClient.call(t,s);l.show("Action completed","success"),this._actionResult=typeof i=="string"?i:JSON.stringify(i,null,2)}catch(i){const a=i instanceof Error?i.message:"Action failed";l.show(a,"error"),this._actionResult=""}finally{this._platformActionPending=!1}}render(){return r`
2
+ <div class="message-center">
3
+ ${this._renderBreadcrumb()}
4
+ ${this._renderHeader()}
5
+ ${this._renderBody()}
6
+ ${this._renderSendConfirmDialog()}
7
+ ${this._renderReplyConfirmDialog()}
8
+ ${this._renderDeleteConfirmDialog()}
9
+ </div>
10
+ `}_renderBreadcrumb(){return r`
11
+ <ic-breadcrumb .items=${[{label:"Channels",route:"channels"},{label:this._effectiveChannel||"...",route:`channels/${this._effectiveChannel}`},{label:"Messages"}]}></ic-breadcrumb>
12
+ `}_renderHeader(){return r`
13
+ <div class="header-row">
14
+ <div class="header-left">
15
+ <h1 class="page-title">Messages</h1>
16
+ </div>
17
+ <div class="channel-selector">
18
+ <label for="channel-select">Channel:</label>
19
+ <select
20
+ id="channel-select"
21
+ class="channel-select"
22
+ .value=${this._effectiveChannel}
23
+ @change=${this._handleChannelChange}
24
+ >
25
+ ${this._channelList.length===0?r`<option value=${this._effectiveChannel}>${this._effectiveChannel}</option>`:this._channelList.map(e=>r`<option value=${e.channelType} ?selected=${e.channelType===this._effectiveChannel}>${e.channelType}</option>`)}
26
+ </select>
27
+ </div>
28
+ <div class="channel-selector">
29
+ <label for="chat-select">Chat:</label>
30
+ <select
31
+ id="chat-select"
32
+ class="channel-select"
33
+ .value=${this._selectedChatId}
34
+ @change=${this._handleChatChange}
35
+ ?disabled=${this._chatList.length===0}
36
+ >
37
+ ${this._chatList.length===0?r`<option value="">No chats found</option>`:this._chatList.map(e=>r`<option value=${e.chatId} ?selected=${e.chatId===this._selectedChatId}>${e.label}</option>`)}
38
+ </select>
39
+ </div>
40
+ </div>
41
+ `}_renderBody(){switch(this._loadState){case"idle":case"loading":return r`<ic-loading></ic-loading>`;case"error":return r`
42
+ <div class="error-container">
43
+ <div class="error-text">${this._error||"Failed to load"}</div>
44
+ <button class="retry-btn" @click=${()=>{this._loadData()}}>Retry</button>
45
+ </div>
46
+ `;case"loaded":return r`
47
+ ${this._renderMessageList()}
48
+ ${this._renderSendForm()}
49
+ ${this._renderAttachForm()}
50
+ ${this._renderPlatformActions()}
51
+ `;default:return d}}_renderMessageList(){if(this._messages.length===0)return r`
52
+ <ic-empty-state
53
+ message="No messages found"
54
+ description="No recent messages in this channel."
55
+ ></ic-empty-state>
56
+ `;const e=[...this._messages].sort((a,h)=>a.timestamp-h.timestamp),t=this._capabilities?.editMessages===!0,s=this._capabilities?.deleteMessages===!0,i=this._capabilities?.reactions===!0;return r`
57
+ <div class="section">
58
+ <div class="section-title">Recent Messages (${e.length})</div>
59
+ <div class="message-list">
60
+ ${e.map(a=>r`
61
+ <div class="msg-row ${this._selectedMessageId===a.id?"msg-row--selected":""}" @click=${()=>this._handleMessageClick(a.id)}>
62
+ <span class="msg-sender" title=${a.senderId}>${a.senderId}</span>
63
+ ${this._editingId===a.id?this._renderEditForm(a):r`<span class="msg-text">${a.text}</span>`}
64
+ <span class="msg-time"><ic-relative-time .timestamp=${a.timestamp}></ic-relative-time></span>
65
+ <span class="msg-actions">
66
+ <button class="msg-action-btn" title="Reply" @click=${()=>this._handleReplyClick(a.id)}>Reply</button>
67
+ ${t?r`
68
+ <button class="msg-action-btn" title="Edit" @click=${()=>this._handleEditClick(a)}>Edit</button>
69
+ `:d}
70
+ ${s?r`
71
+ <button class="msg-action-btn msg-action-btn--danger" title="Delete" @click=${()=>this._handleDeleteClick(a.id)}>Delete</button>
72
+ `:d}
73
+ ${i?r`
74
+ <span class="emoji-picker-anchor">
75
+ <button class="msg-action-btn" title="React" data-react-id=${a.id} @click=${()=>this._handleReactClick(a.id)}>React</button>
76
+ ${this._showEmojiPicker&&this._reactTargetId===a.id?this._renderEmojiPicker():d}
77
+ </span>
78
+ `:d}
79
+ </span>
80
+ </div>
81
+ ${this._replyToId===a.id?this._renderReplyForm(a):d}
82
+ `)}
83
+ </div>
84
+ </div>
85
+ `}_renderReplyForm(e){return r`
86
+ <div class="inline-form">
87
+ <div class="inline-form-label">
88
+ Replying to ${e.senderId}
89
+ <button class="inline-form-cancel" title="Cancel reply" @click=${this._handleReplyCancelClick}>X</button>
90
+ </div>
91
+ <div class="inline-form-row">
92
+ <textarea
93
+ class="inline-form-input reply-input"
94
+ placeholder="Type your reply..."
95
+ .value=${this._replyText}
96
+ @input=${t=>{this._replyText=t.target.value}}
97
+ @keydown=${this._handleReplyKeydown}
98
+ ?disabled=${this._actionPending}
99
+ rows="1"
100
+ ></textarea>
101
+ <button
102
+ class="btn-sm btn-sm-primary"
103
+ @click=${this._handleReplySendClick}
104
+ ?disabled=${this._actionPending||!this._replyText.trim()}
105
+ >Send Reply</button>
106
+ </div>
107
+ </div>
108
+ `}_renderEditForm(e){return r`
109
+ <span class="msg-text" style="flex:1;min-width:0;">
110
+ <div class="inline-form" style="margin:0;">
111
+ <div class="inline-form-row">
112
+ <textarea
113
+ class="inline-form-input edit-input"
114
+ .value=${this._editText}
115
+ @input=${t=>{this._editText=t.target.value}}
116
+ @keydown=${this._handleEditKeydown}
117
+ ?disabled=${this._actionPending}
118
+ rows="1"
119
+ ></textarea>
120
+ <button
121
+ class="btn-sm btn-sm-primary"
122
+ @click=${()=>{this._handleEditSave()}}
123
+ ?disabled=${this._actionPending||!this._editText.trim()}
124
+ >Save</button>
125
+ <button
126
+ class="btn-sm btn-sm-ghost"
127
+ @click=${this._handleEditCancelClick}
128
+ ?disabled=${this._actionPending}
129
+ >Cancel</button>
130
+ </div>
131
+ </div>
132
+ </span>
133
+ `}_renderEmojiPicker(){return r`
134
+ <div class="emoji-picker">
135
+ ${w.map(e=>r`
136
+ <button class="emoji-btn" title=${e} @click=${()=>{this._handleEmojiSelect(e)}}>${e}</button>
137
+ `)}
138
+ </div>
139
+ `}_renderSendForm(){const e=this._capabilities?.attachments===!0;return r`
140
+ <div class="section">
141
+ <div class="section-title">Send Message</div>
142
+ <div class="send-form">
143
+ <textarea
144
+ class="send-input"
145
+ placeholder="Type a message to send as ${this._botName||this._effectiveChannel}..."
146
+ .value=${this._sendText}
147
+ @input=${t=>{this._sendText=t.target.value}}
148
+ @keydown=${this._handleKeydown}
149
+ ?disabled=${this._actionPending}
150
+ rows="2"
151
+ ></textarea>
152
+ <button
153
+ class="btn btn-primary"
154
+ @click=${this._handleSendClick}
155
+ ?disabled=${this._actionPending||!this._sendText.trim()}
156
+ >
157
+ ${this._actionPending?"Sending...":"Send"}
158
+ </button>
159
+ ${e?r`
160
+ <button
161
+ class="btn-sm btn-sm-ghost"
162
+ @click=${this._toggleAttachForm}
163
+ ?disabled=${this._actionPending}
164
+ title="Attach File"
165
+ >
166
+ ${this._showAttachForm?"Close Attach":"Attach File"}
167
+ </button>
168
+ `:r`
169
+ <button
170
+ class="btn-sm btn-sm-ghost"
171
+ disabled
172
+ title="Attachments not supported on ${this._effectiveChannel}"
173
+ >Attach File</button>
174
+ `}
175
+ </div>
176
+ </div>
177
+ `}_renderAttachForm(){return!this._showAttachForm||this._capabilities?.attachments!==!0?d:r`
178
+ <div class="section">
179
+ <div class="section-title">Send Attachment</div>
180
+ <div class="attach-form">
181
+ <div class="attach-form-row">
182
+ <input
183
+ class="attach-input"
184
+ type="text"
185
+ placeholder="File URL or Path"
186
+ .value=${this._attachUrl}
187
+ @input=${e=>{this._attachUrl=e.target.value}}
188
+ ?disabled=${this._actionPending}
189
+ />
190
+ <select
191
+ class="attach-select"
192
+ .value=${this._attachType}
193
+ @change=${e=>{this._attachType=e.target.value}}
194
+ ?disabled=${this._actionPending}
195
+ >
196
+ <option value="file">File</option>
197
+ <option value="image">Image</option>
198
+ <option value="audio">Audio</option>
199
+ <option value="video">Video</option>
200
+ </select>
201
+ </div>
202
+ <div class="attach-form-row">
203
+ <input
204
+ class="attach-input"
205
+ type="text"
206
+ placeholder="Caption (optional)"
207
+ .value=${this._attachCaption}
208
+ @input=${e=>{this._attachCaption=e.target.value}}
209
+ ?disabled=${this._actionPending}
210
+ />
211
+ <button
212
+ class="btn-sm btn-sm-primary"
213
+ @click=${()=>{this._handleAttachSend()}}
214
+ ?disabled=${this._actionPending||!this._attachUrl.trim()}
215
+ >
216
+ Send Attachment
217
+ </button>
218
+ <button
219
+ class="btn-sm btn-sm-ghost"
220
+ @click=${this._toggleAttachForm}
221
+ ?disabled=${this._actionPending}
222
+ >Cancel</button>
223
+ </div>
224
+ </div>
225
+ </div>
226
+ `}_renderPlatformActions(){const e=I[this._effectiveChannel];if(!e)return d;const t=this._effectiveChannel.charAt(0).toUpperCase()+this._effectiveChannel.slice(1);return r`
227
+ <div class="platform-actions">
228
+ <div class="platform-actions-title">
229
+ <ic-platform-icon platform=${this._effectiveChannel}></ic-platform-icon>
230
+ ${t} Actions
231
+ </div>
232
+ ${e.map(s=>r`
233
+ <div class="action-group-header">${s.group}</div>
234
+ <div class="action-buttons">
235
+ ${s.actions.map(i=>{const a=this._getActionInputKey("",i.action),h=i.needsMessageId&&!this._selectedMessageId;return r`
236
+ ${i.needsInput?r`
237
+ <input
238
+ class="action-input"
239
+ type="text"
240
+ placeholder=${i.needsInput}
241
+ .value=${this._actionInputs[a]??""}
242
+ @input=${p=>this._handleActionInputChange(a,p.target.value)}
243
+ ?disabled=${this._platformActionPending}
244
+ />
245
+ `:d}
246
+ <button
247
+ class="btn-sm btn-sm-ghost"
248
+ @click=${()=>{this._handlePlatformAction(i)}}
249
+ ?disabled=${this._platformActionPending||h}
250
+ title=${h?"Select a message first":i.label}
251
+ >
252
+ ${i.label}
253
+ </button>
254
+ `})}
255
+ </div>
256
+ `)}
257
+ ${this._actionResult?r`
258
+ <div class="action-result">${this._actionResult}</div>
259
+ `:d}
260
+ </div>
261
+ `}_renderSendConfirmDialog(){return this._showSendConfirm?r`
262
+ <ic-confirm-dialog
263
+ open
264
+ title="Send Message"
265
+ message="This message will be sent as ${this._botName||this._effectiveChannel} on ${this._effectiveChannel}. You are acting as operator."
266
+ confirmLabel="Send"
267
+ @confirm=${this._handleSendConfirm}
268
+ @cancel=${this._handleSendCancel}
269
+ ></ic-confirm-dialog>
270
+ `:d}_renderReplyConfirmDialog(){return this._showReplyConfirm?r`
271
+ <ic-confirm-dialog
272
+ open
273
+ title="Send Reply"
274
+ message="This reply will be sent as ${this._botName||this._effectiveChannel} on ${this._effectiveChannel}. You are acting as operator."
275
+ confirmLabel="Send Reply"
276
+ @confirm=${this._handleReplyConfirm}
277
+ @cancel=${this._handleReplyCancel}
278
+ ></ic-confirm-dialog>
279
+ `:d}_renderDeleteConfirmDialog(){return this._showDeleteConfirm?r`
280
+ <ic-confirm-dialog
281
+ open
282
+ title="Delete Message"
283
+ message="This will permanently delete this message from ${this._effectiveChannel}. This cannot be undone."
284
+ variant="danger"
285
+ confirmLabel="Delete"
286
+ @confirm=${this._handleDeleteConfirm}
287
+ @cancel=${this._handleDeleteCancel}
288
+ ></ic-confirm-dialog>
289
+ `:d}};n.styles=[g,v,b`
290
+ :host {
291
+ display: block;
292
+ }
293
+
294
+ .message-center {
295
+ display: flex;
296
+ flex-direction: column;
297
+ gap: var(--ic-space-md, 1rem);
298
+ }
299
+
300
+ /* Header */
301
+ .header-row {
302
+ display: flex;
303
+ align-items: center;
304
+ justify-content: space-between;
305
+ gap: var(--ic-space-md, 1rem);
306
+ flex-wrap: wrap;
307
+ }
308
+
309
+ .header-left {
310
+ display: flex;
311
+ align-items: center;
312
+ gap: var(--ic-space-sm, 0.5rem);
313
+ }
314
+
315
+ .page-title {
316
+ font-size: 1.5rem;
317
+ font-weight: 700;
318
+ margin: 0;
319
+ }
320
+
321
+ /* Channel selector */
322
+ .channel-selector {
323
+ display: flex;
324
+ align-items: center;
325
+ gap: var(--ic-space-sm, 0.5rem);
326
+ }
327
+
328
+ .channel-selector label {
329
+ font-size: var(--ic-text-sm, 0.875rem);
330
+ color: var(--ic-text-muted, #9ca3af);
331
+ }
332
+
333
+ .channel-select {
334
+ padding: 0.375rem 0.5rem;
335
+ background: var(--ic-surface-2, #1f2937);
336
+ border: 1px solid var(--ic-border, #374151);
337
+ border-radius: var(--ic-radius-md, 0.5rem);
338
+ color: var(--ic-text, #f3f4f6);
339
+ font-size: var(--ic-text-sm, 0.875rem);
340
+ outline: none;
341
+ cursor: pointer;
342
+ }
343
+
344
+ .channel-select:focus {
345
+ border-color: var(--ic-accent, #3b82f6);
346
+ }
347
+
348
+ /* Section card */
349
+ .section {
350
+ background: var(--ic-surface, #111827);
351
+ border: 1px solid var(--ic-border, #374151);
352
+ border-radius: var(--ic-radius-md, 0.5rem);
353
+ padding: var(--ic-space-md, 1rem);
354
+ }
355
+
356
+ .section-title {
357
+ font-size: var(--ic-text-sm, 0.875rem);
358
+ font-weight: 600;
359
+ color: var(--ic-text-muted, #9ca3af);
360
+ margin: 0 0 var(--ic-space-sm, 0.5rem) 0;
361
+ }
362
+
363
+ /* Message list */
364
+ .message-list {
365
+ overflow-y: auto;
366
+ max-height: 60vh;
367
+ display: flex;
368
+ flex-direction: column;
369
+ gap: 2px;
370
+ }
371
+
372
+ .msg-row {
373
+ display: flex;
374
+ align-items: baseline;
375
+ gap: var(--ic-space-sm, 0.5rem);
376
+ padding: var(--ic-space-xs, 0.25rem) var(--ic-space-sm, 0.5rem);
377
+ border-radius: var(--ic-radius-sm, 0.25rem);
378
+ font-size: var(--ic-text-sm, 0.875rem);
379
+ }
380
+
381
+ .msg-row:nth-child(odd) {
382
+ background: var(--ic-surface-2, #1f2937);
383
+ }
384
+
385
+ .msg-row:nth-child(even) {
386
+ background: transparent;
387
+ }
388
+
389
+ .msg-sender {
390
+ color: var(--ic-text-dim, #6b7280);
391
+ font-size: var(--ic-text-xs, 0.75rem);
392
+ flex-shrink: 0;
393
+ min-width: 6rem;
394
+ max-width: 10rem;
395
+ overflow: hidden;
396
+ text-overflow: ellipsis;
397
+ white-space: nowrap;
398
+ }
399
+
400
+ .msg-text {
401
+ flex: 1;
402
+ min-width: 0;
403
+ color: var(--ic-text, #f3f4f6);
404
+ word-break: break-word;
405
+ }
406
+
407
+ .msg-time {
408
+ flex-shrink: 0;
409
+ font-size: var(--ic-text-xs, 0.75rem);
410
+ color: var(--ic-text-dim, #6b7280);
411
+ }
412
+
413
+ /* Send form */
414
+ .send-form {
415
+ display: flex;
416
+ gap: var(--ic-space-sm, 0.5rem);
417
+ align-items: flex-end;
418
+ }
419
+
420
+ .send-input {
421
+ flex: 1;
422
+ padding: 0.625rem 0.75rem;
423
+ background: var(--ic-surface-2, #1f2937);
424
+ border: 1px solid var(--ic-border, #374151);
425
+ border-radius: var(--ic-radius-md, 0.5rem);
426
+ color: var(--ic-text, #f3f4f6);
427
+ font-size: var(--ic-text-sm, 0.875rem);
428
+ outline: none;
429
+ resize: vertical;
430
+ min-height: 2.5rem;
431
+ max-height: 8rem;
432
+ font-family: inherit;
433
+ }
434
+
435
+ .send-input:focus {
436
+ border-color: var(--ic-accent, #3b82f6);
437
+ }
438
+
439
+ .send-input::placeholder {
440
+ color: var(--ic-text-dim, #6b7280);
441
+ }
442
+
443
+ .btn {
444
+ padding: 0.5rem 1rem;
445
+ font-size: var(--ic-text-sm, 0.875rem);
446
+ font-weight: 500;
447
+ border-radius: var(--ic-radius-md, 0.5rem);
448
+ border: 1px solid transparent;
449
+ cursor: pointer;
450
+ transition: background var(--ic-transition, 150ms);
451
+ }
452
+
453
+ .btn:disabled {
454
+ opacity: 0.5;
455
+ cursor: not-allowed;
456
+ }
457
+
458
+ .btn-primary {
459
+ background: var(--ic-accent, #3b82f6);
460
+ color: white;
461
+ }
462
+
463
+ .btn-primary:hover:not(:disabled) {
464
+ background: var(--ic-accent-hover, #2563eb);
465
+ }
466
+
467
+ /* Message action buttons (hover-visible) */
468
+ .msg-actions {
469
+ display: none;
470
+ gap: 4px;
471
+ align-items: center;
472
+ flex-shrink: 0;
473
+ }
474
+
475
+ .msg-row:hover .msg-actions {
476
+ display: flex;
477
+ }
478
+
479
+ .msg-action-btn {
480
+ padding: 2px 6px;
481
+ font-size: var(--ic-text-xs, 0.75rem);
482
+ background: transparent;
483
+ border: 1px solid var(--ic-border, #374151);
484
+ border-radius: var(--ic-radius-sm, 0.25rem);
485
+ color: var(--ic-text-dim, #6b7280);
486
+ cursor: pointer;
487
+ white-space: nowrap;
488
+ transition: background var(--ic-transition, 150ms), color var(--ic-transition, 150ms);
489
+ }
490
+
491
+ .msg-action-btn:hover {
492
+ background: var(--ic-surface-raised, #1e293b);
493
+ color: var(--ic-text, #f3f4f6);
494
+ }
495
+
496
+ /* Inline reply / edit forms */
497
+ .inline-form {
498
+ background: var(--ic-surface-raised, #1e293b);
499
+ border-radius: var(--ic-radius-sm, 0.25rem);
500
+ padding: var(--ic-space-sm, 0.5rem);
501
+ margin: 2px var(--ic-space-sm, 0.5rem);
502
+ }
503
+
504
+ .inline-form-label {
505
+ font-size: var(--ic-text-xs, 0.75rem);
506
+ color: var(--ic-text-muted, #9ca3af);
507
+ margin-bottom: 4px;
508
+ display: flex;
509
+ align-items: center;
510
+ gap: var(--ic-space-sm, 0.5rem);
511
+ }
512
+
513
+ .inline-form-cancel {
514
+ background: none;
515
+ border: none;
516
+ color: var(--ic-text-dim, #6b7280);
517
+ cursor: pointer;
518
+ font-size: var(--ic-text-xs, 0.75rem);
519
+ padding: 0 2px;
520
+ }
521
+
522
+ .inline-form-cancel:hover {
523
+ color: var(--ic-text, #f3f4f6);
524
+ }
525
+
526
+ .inline-form-row {
527
+ display: flex;
528
+ gap: var(--ic-space-sm, 0.5rem);
529
+ align-items: flex-end;
530
+ }
531
+
532
+ .inline-form-input {
533
+ flex: 1;
534
+ padding: 0.375rem 0.5rem;
535
+ background: var(--ic-surface-2, #1f2937);
536
+ border: 1px solid var(--ic-border, #374151);
537
+ border-radius: var(--ic-radius-sm, 0.25rem);
538
+ color: var(--ic-text, #f3f4f6);
539
+ font-size: var(--ic-text-sm, 0.875rem);
540
+ font-family: inherit;
541
+ outline: none;
542
+ resize: vertical;
543
+ min-height: 2rem;
544
+ max-height: 6rem;
545
+ }
546
+
547
+ .inline-form-input:focus {
548
+ border-color: var(--ic-accent, #3b82f6);
549
+ }
550
+
551
+ .btn-sm {
552
+ padding: 0.25rem 0.5rem;
553
+ font-size: var(--ic-text-xs, 0.75rem);
554
+ font-weight: 500;
555
+ border-radius: var(--ic-radius-sm, 0.25rem);
556
+ border: 1px solid transparent;
557
+ cursor: pointer;
558
+ transition: background var(--ic-transition, 150ms);
559
+ }
560
+
561
+ .btn-sm:disabled {
562
+ opacity: 0.5;
563
+ cursor: not-allowed;
564
+ }
565
+
566
+ .btn-sm-primary {
567
+ background: var(--ic-accent, #3b82f6);
568
+ color: white;
569
+ }
570
+
571
+ .btn-sm-primary:hover:not(:disabled) {
572
+ background: var(--ic-accent-hover, #2563eb);
573
+ }
574
+
575
+ .btn-sm-ghost {
576
+ background: transparent;
577
+ border-color: var(--ic-border, #374151);
578
+ color: var(--ic-text-muted, #9ca3af);
579
+ }
580
+
581
+ .btn-sm-ghost:hover:not(:disabled) {
582
+ background: var(--ic-surface-2, #1f2937);
583
+ color: var(--ic-text, #f3f4f6);
584
+ }
585
+
586
+ /* Danger action button variant */
587
+ .msg-action-btn--danger:hover {
588
+ color: var(--ic-error, #f87171);
589
+ border-color: var(--ic-error, #f87171);
590
+ background: transparent;
591
+ }
592
+
593
+ /* Emoji picker floating panel */
594
+ .emoji-picker-anchor {
595
+ position: relative;
596
+ }
597
+
598
+ .emoji-picker {
599
+ position: absolute;
600
+ top: 100%;
601
+ right: 0;
602
+ z-index: 100;
603
+ background: var(--ic-surface, #111827);
604
+ border: 1px solid var(--ic-border, #374151);
605
+ border-radius: var(--ic-radius-md, 0.5rem);
606
+ box-shadow: var(--ic-shadow-lg, 0 10px 15px rgba(0,0,0,0.25));
607
+ padding: var(--ic-space-sm, 0.5rem);
608
+ display: grid;
609
+ grid-template-columns: repeat(6, 1fr);
610
+ gap: 2px;
611
+ width: max-content;
612
+ min-width: 12rem;
613
+ }
614
+
615
+ .emoji-btn {
616
+ font-size: 1.25rem;
617
+ padding: 4px;
618
+ cursor: pointer;
619
+ border: none;
620
+ background: none;
621
+ border-radius: var(--ic-radius-sm, 0.25rem);
622
+ line-height: 1;
623
+ text-align: center;
624
+ }
625
+
626
+ .emoji-btn:hover {
627
+ background: var(--ic-surface-raised, #1e293b);
628
+ }
629
+
630
+ /* Selected message highlight */
631
+ .msg-row--selected {
632
+ border-left: 3px solid var(--ic-accent, #3b82f6);
633
+ cursor: pointer;
634
+ }
635
+
636
+ .msg-row:not(.msg-row--selected) {
637
+ cursor: pointer;
638
+ border-left: 3px solid transparent;
639
+ }
640
+
641
+ /* Attachment form */
642
+ .attach-form {
643
+ display: flex;
644
+ flex-direction: column;
645
+ gap: var(--ic-space-sm, 0.5rem);
646
+ padding: var(--ic-space-sm, 0.5rem);
647
+ background: var(--ic-surface-raised, #1e293b);
648
+ border-radius: var(--ic-radius-sm, 0.25rem);
649
+ margin-top: var(--ic-space-xs, 0.25rem);
650
+ }
651
+
652
+ .attach-form-row {
653
+ display: flex;
654
+ gap: var(--ic-space-sm, 0.5rem);
655
+ align-items: center;
656
+ flex-wrap: wrap;
657
+ }
658
+
659
+ .attach-input {
660
+ flex: 1;
661
+ min-width: 12rem;
662
+ padding: 0.375rem 0.5rem;
663
+ background: var(--ic-surface-2, #1f2937);
664
+ border: 1px solid var(--ic-border, #374151);
665
+ border-radius: var(--ic-radius-sm, 0.25rem);
666
+ color: var(--ic-text, #f3f4f6);
667
+ font-size: var(--ic-text-sm, 0.875rem);
668
+ font-family: inherit;
669
+ outline: none;
670
+ }
671
+
672
+ .attach-input:focus {
673
+ border-color: var(--ic-accent, #3b82f6);
674
+ }
675
+
676
+ .attach-select {
677
+ padding: 0.375rem 0.5rem;
678
+ background: var(--ic-surface-2, #1f2937);
679
+ border: 1px solid var(--ic-border, #374151);
680
+ border-radius: var(--ic-radius-sm, 0.25rem);
681
+ color: var(--ic-text, #f3f4f6);
682
+ font-size: var(--ic-text-sm, 0.875rem);
683
+ outline: none;
684
+ cursor: pointer;
685
+ }
686
+
687
+ .attach-select:focus {
688
+ border-color: var(--ic-accent, #3b82f6);
689
+ }
690
+
691
+ /* Platform actions */
692
+ .platform-actions {
693
+ background: var(--ic-surface, #111827);
694
+ border: 1px solid var(--ic-border, #374151);
695
+ border-radius: var(--ic-radius-md, 0.5rem);
696
+ padding: var(--ic-space-md, 1rem);
697
+ }
698
+
699
+ .platform-actions-title {
700
+ display: flex;
701
+ align-items: center;
702
+ gap: var(--ic-space-sm, 0.5rem);
703
+ font-size: 1rem;
704
+ font-weight: 600;
705
+ color: var(--ic-text, #f3f4f6);
706
+ margin: 0 0 var(--ic-space-md, 1rem) 0;
707
+ }
708
+
709
+ .action-group-header {
710
+ font-weight: 600;
711
+ font-size: var(--ic-text-sm, 0.875rem);
712
+ color: var(--ic-text-muted, #9ca3af);
713
+ margin-top: var(--ic-space-md, 1rem);
714
+ margin-bottom: var(--ic-space-xs, 0.25rem);
715
+ }
716
+
717
+ .action-group-header:first-of-type {
718
+ margin-top: 0;
719
+ }
720
+
721
+ .action-buttons {
722
+ display: flex;
723
+ flex-wrap: wrap;
724
+ gap: var(--ic-space-xs, 0.25rem);
725
+ align-items: center;
726
+ }
727
+
728
+ .action-input {
729
+ padding: 0.25rem 0.5rem;
730
+ background: var(--ic-surface-2, #1f2937);
731
+ border: 1px solid var(--ic-border, #374151);
732
+ border-radius: var(--ic-radius-sm, 0.25rem);
733
+ color: var(--ic-text, #f3f4f6);
734
+ font-size: var(--ic-text-xs, 0.75rem);
735
+ outline: none;
736
+ width: 8rem;
737
+ }
738
+
739
+ .action-input:focus {
740
+ border-color: var(--ic-accent, #3b82f6);
741
+ }
742
+
743
+ .action-input::placeholder {
744
+ color: var(--ic-text-dim, #6b7280);
745
+ }
746
+
747
+ .action-result {
748
+ margin-top: var(--ic-space-sm, 0.5rem);
749
+ padding: var(--ic-space-sm, 0.5rem);
750
+ background: var(--ic-surface-2, #1f2937);
751
+ border: 1px solid var(--ic-border, #374151);
752
+ border-radius: var(--ic-radius-sm, 0.25rem);
753
+ font-size: var(--ic-text-xs, 0.75rem);
754
+ color: var(--ic-text-muted, #9ca3af);
755
+ max-height: 8rem;
756
+ overflow-y: auto;
757
+ white-space: pre-wrap;
758
+ word-break: break-word;
759
+ }
760
+
761
+ /* Error retry */
762
+ .error-container {
763
+ text-align: center;
764
+ padding: var(--ic-space-lg, 1.5rem);
765
+ }
766
+
767
+ .error-text {
768
+ color: var(--ic-error, #f87171);
769
+ margin-bottom: var(--ic-space-sm, 0.5rem);
770
+ }
771
+
772
+ .retry-btn {
773
+ padding: 0.375rem 0.75rem;
774
+ background: var(--ic-surface-2, #1f2937);
775
+ border: 1px solid var(--ic-border, #374151);
776
+ border-radius: var(--ic-radius-md, 0.5rem);
777
+ color: var(--ic-text, #f3f4f6);
778
+ cursor: pointer;
779
+ font-size: var(--ic-text-sm, 0.875rem);
780
+ }
781
+
782
+ .retry-btn:hover {
783
+ background: var(--ic-border, #374151);
784
+ }
785
+ `];c([f({attribute:!1})],n.prototype,"rpcClient",2);c([f({attribute:!1})],n.prototype,"eventDispatcher",2);c([f()],n.prototype,"channelType",2);c([o()],n.prototype,"_loadState",2);c([o()],n.prototype,"_error",2);c([o()],n.prototype,"_messages",2);c([o()],n.prototype,"_effectiveChannel",2);c([o()],n.prototype,"_capabilities",2);c([o()],n.prototype,"_channelList",2);c([o()],n.prototype,"_sendText",2);c([o()],n.prototype,"_showSendConfirm",2);c([o()],n.prototype,"_actionPending",2);c([o()],n.prototype,"_botName",2);c([o()],n.prototype,"_replyToId",2);c([o()],n.prototype,"_replyText",2);c([o()],n.prototype,"_showReplyConfirm",2);c([o()],n.prototype,"_editingId",2);c([o()],n.prototype,"_editText",2);c([o()],n.prototype,"_deleteTargetId",2);c([o()],n.prototype,"_showDeleteConfirm",2);c([o()],n.prototype,"_reactTargetId",2);c([o()],n.prototype,"_showEmojiPicker",2);c([o()],n.prototype,"_attachUrl",2);c([o()],n.prototype,"_attachType",2);c([o()],n.prototype,"_attachCaption",2);c([o()],n.prototype,"_showAttachForm",2);c([o()],n.prototype,"_chatList",2);c([o()],n.prototype,"_selectedChatId",2);c([o()],n.prototype,"_platformActionPending",2);c([o()],n.prototype,"_selectedMessageId",2);c([o()],n.prototype,"_actionResult",2);n=c([y("ic-message-center")],n);export{n as IcMessageCenter};