@escalated-dev/escalated 0.8.0 → 0.11.1

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 (124) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +388 -361
  3. package/package.json +85 -84
  4. package/src/components/ActiveChatsPanel.vue +246 -246
  5. package/src/components/AdminDashboard.stories.js +1423 -1423
  6. package/src/components/AttachmentList.vue +65 -65
  7. package/src/components/ChatActionBar.vue +226 -226
  8. package/src/components/ChatBubble.vue +162 -162
  9. package/src/components/ChatComposer.vue +308 -308
  10. package/src/components/ChatQueue.vue +222 -222
  11. package/src/components/ChatThread.vue +197 -197
  12. package/src/components/CustomTicketActions.stories.js +71 -0
  13. package/src/components/CustomTicketActions.vue +101 -0
  14. package/src/components/EscalatedLayout.vue +628 -604
  15. package/src/components/FollowButton.vue +20 -1
  16. package/src/components/MentionDropdown.vue +154 -154
  17. package/src/components/MetricComparison.vue +89 -89
  18. package/src/components/PercentileChart.vue +67 -67
  19. package/src/components/PeriodSelector.vue +98 -98
  20. package/src/components/PresenceIndicator.vue +228 -213
  21. package/src/components/ReplyComposer.vue +336 -336
  22. package/src/components/ReplyThread.vue +153 -153
  23. package/src/components/ReportChart.vue +395 -395
  24. package/src/components/ReportExportButton.vue +108 -108
  25. package/src/components/SaveViewDialog.vue +172 -172
  26. package/src/components/SavedViewSidebar.vue +208 -208
  27. package/src/components/SkillTagManager.vue +3 -0
  28. package/src/components/SnoozeButton.vue +247 -247
  29. package/src/components/TicketFilters.vue +270 -270
  30. package/src/components/TicketList.vue +655 -655
  31. package/src/components/TicketSidebar.vue +4 -0
  32. package/src/components/TicketSplitDialog.vue +98 -98
  33. package/src/components/TicketSubjects.stories.js +63 -0
  34. package/src/components/TicketSubjects.vue +107 -0
  35. package/src/components/TwoFactorSetup.vue +1 -37
  36. package/src/components/VariableTokenInput.vue +111 -111
  37. package/src/components/WorkflowActionConfig.vue +287 -287
  38. package/src/components/WorkflowActionList.vue +350 -350
  39. package/src/components/WorkflowConditionBuilder.vue +265 -265
  40. package/src/components/WorkflowTriggerSelector.vue +125 -125
  41. package/src/components/admin/newsletters/AnalyticsTiles.stories.js +14 -0
  42. package/src/components/admin/newsletters/AnalyticsTiles.vue +55 -0
  43. package/src/components/admin/newsletters/DeliveriesTable.stories.js +28 -0
  44. package/src/components/admin/newsletters/DeliveriesTable.vue +104 -0
  45. package/src/components/admin/newsletters/DynamicFilterBuilder.stories.js +11 -0
  46. package/src/components/admin/newsletters/DynamicFilterBuilder.vue +53 -0
  47. package/src/components/admin/newsletters/ListMemberTable.stories.js +12 -0
  48. package/src/components/admin/newsletters/ListMemberTable.vue +53 -0
  49. package/src/components/admin/newsletters/MarkdownEditor.stories.js +6 -0
  50. package/src/components/admin/newsletters/MarkdownEditor.vue +53 -0
  51. package/src/components/admin/newsletters/MergeFieldDropdown.stories.js +6 -0
  52. package/src/components/admin/newsletters/MergeFieldDropdown.vue +84 -0
  53. package/src/components/admin/newsletters/PreviewIframe.stories.js +7 -0
  54. package/src/components/admin/newsletters/PreviewIframe.vue +40 -0
  55. package/src/components/admin/newsletters/SummaryTiles.stories.js +8 -0
  56. package/src/components/admin/newsletters/SummaryTiles.vue +63 -0
  57. package/src/composables/useChat.js +187 -187
  58. package/src/composables/useI18n.js +102 -102
  59. package/src/composables/useMentions.js +134 -134
  60. package/src/composables/usePermissions.js +31 -0
  61. package/src/composables/useRealtime.js +182 -182
  62. package/src/index.js +85 -84
  63. package/src/locales/README.md +13 -13
  64. package/src/locales/ar.json +727 -727
  65. package/src/locales/de.json +690 -690
  66. package/src/locales/en.json +889 -729
  67. package/src/locales/es.json +691 -691
  68. package/src/locales/fr.json +691 -691
  69. package/src/locales/index.js +16 -16
  70. package/src/locales/it.json +727 -727
  71. package/src/locales/ja.json +727 -727
  72. package/src/locales/ko.json +727 -727
  73. package/src/locales/nl.json +727 -727
  74. package/src/locales/pl.json +727 -727
  75. package/src/locales/pt-BR.json +727 -727
  76. package/src/locales/ru.json +727 -727
  77. package/src/locales/tr.json +727 -727
  78. package/src/locales/zh-CN.json +727 -727
  79. package/src/pages/Admin/Automations/Form.vue +280 -0
  80. package/src/pages/Admin/Automations/Index.vue +230 -0
  81. package/src/pages/Admin/Newsletters/Compose.vue +192 -0
  82. package/src/pages/Admin/Newsletters/Edit.vue +24 -0
  83. package/src/pages/Admin/Newsletters/Index.vue +141 -0
  84. package/src/pages/Admin/Newsletters/Lists/Create.vue +64 -0
  85. package/src/pages/Admin/Newsletters/Lists/Index.vue +59 -0
  86. package/src/pages/Admin/Newsletters/Lists/Show.vue +53 -0
  87. package/src/pages/Admin/Newsletters/Settings.vue +85 -0
  88. package/src/pages/Admin/Newsletters/Show.vue +140 -0
  89. package/src/pages/Admin/Newsletters/Templates/Create.vue +11 -0
  90. package/src/pages/Admin/Newsletters/Templates/Index.vue +54 -0
  91. package/src/pages/Admin/Newsletters/Templates/Show.vue +65 -0
  92. package/src/pages/Admin/Newsletters/usePreview.js +44 -0
  93. package/src/pages/Admin/Plugins/Index.vue +10 -2
  94. package/src/pages/Admin/Reports/AgentDetail.vue +132 -132
  95. package/src/pages/Admin/Reports/AgentRanking.vue +246 -246
  96. package/src/pages/Admin/Reports/Cohorts.vue +180 -180
  97. package/src/pages/Admin/Reports/Comparison.vue +141 -141
  98. package/src/pages/Admin/Reports/Dashboard.vue +226 -226
  99. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -164
  100. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -164
  101. package/src/pages/Admin/Reports/SlaTrends.vue +183 -183
  102. package/src/pages/Admin/Settings/DatabaseConnection.vue +228 -0
  103. package/src/pages/Admin/Settings/PublicTickets.vue +163 -0
  104. package/src/pages/Admin/Settings/SsoSettings.vue +157 -4
  105. package/src/pages/Admin/Settings/TwoFactor.vue +32 -6
  106. package/src/pages/Admin/Settings.vue +1008 -1008
  107. package/src/pages/Admin/Skills/Form.vue +30 -10
  108. package/src/pages/Admin/Tickets/Index.vue +126 -126
  109. package/src/pages/Admin/Tickets/Show.vue +254 -249
  110. package/src/pages/Admin/Users/Index.vue +145 -145
  111. package/src/pages/Admin/Webhooks/DeliveryLog.vue +1 -2
  112. package/src/pages/Admin/Workflows/Builder.vue +207 -207
  113. package/src/pages/Admin/Workflows/Form.vue +24 -0
  114. package/src/pages/Admin/Workflows/Index.vue +235 -235
  115. package/src/pages/Admin/Workflows/Logs.vue +286 -286
  116. package/src/pages/Agent/TicketIndex.vue +112 -112
  117. package/src/pages/Agent/TicketShow.vue +547 -494
  118. package/src/pages/Customer/Index.vue +56 -56
  119. package/src/pages/Customer/KnowledgeBase/Article.vue +129 -129
  120. package/src/pages/Plugin/Page.vue +61 -0
  121. package/src/plugin.js +175 -175
  122. package/src/utils/mentionHighlight.js +24 -24
  123. package/src/widget/EscalatedWidget.vue +804 -804
  124. package/src/widget/index.js +254 -254
@@ -1,287 +1,287 @@
1
- <script setup>
2
- import { computed } from 'vue';
3
- import VariableTokenInput from './VariableTokenInput.vue';
4
-
5
- const props = defineProps({
6
- actionType: { type: String, required: true },
7
- modelValue: { type: Object, default: () => ({}) },
8
- });
9
-
10
- const emit = defineEmits(['update:modelValue']);
11
-
12
- const headersPlaceholder = '{"Authorization": "Bearer ..."}';
13
- const config = computed(() => props.modelValue || {});
14
-
15
- function update(key, value) {
16
- emit('update:modelValue', { ...config.value, [key]: value });
17
- }
18
-
19
- const statusOptions = [
20
- 'open',
21
- 'in_progress',
22
- 'waiting_on_customer',
23
- 'waiting_on_agent',
24
- 'escalated',
25
- 'resolved',
26
- 'closed',
27
- ];
28
- const priorityOptions = ['low', 'medium', 'high', 'urgent', 'critical'];
29
- const assignModes = [
30
- { value: 'specific', label: 'Specific agent' },
31
- { value: 'least_busy', label: 'Least busy agent' },
32
- { value: 'round_robin', label: 'Round robin' },
33
- ];
34
- const delayUnits = [
35
- { value: 'minutes', label: 'Minutes' },
36
- { value: 'hours', label: 'Hours' },
37
- { value: 'days', label: 'Days' },
38
- ];
39
- const webhookMethods = ['POST', 'PUT', 'PATCH'];
40
-
41
- const inputClass =
42
- 'w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]';
43
- const selectClass =
44
- 'rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none';
45
- const labelClass = 'block text-xs font-medium text-[var(--esc-panel-text-muted)] mb-1';
46
- </script>
47
-
48
- <template>
49
- <div class="space-y-3 pt-2">
50
- <!-- Assign Agent -->
51
- <template v-if="actionType === 'assign_agent'">
52
- <div>
53
- <label :class="labelClass">Assignment mode</label>
54
- <select
55
- :class="selectClass"
56
- :value="config.mode || 'specific'"
57
- @change="update('mode', $event.target.value)"
58
- >
59
- <option v-for="m in assignModes" :key="m.value" :value="m.value">{{ m.label }}</option>
60
- </select>
61
- </div>
62
- <div v-if="(config.mode || 'specific') === 'specific'">
63
- <label :class="labelClass">Agent</label>
64
- <input
65
- :class="inputClass"
66
- :value="config.agent || ''"
67
- placeholder="Agent ID or email"
68
- @input="update('agent', $event.target.value)"
69
- />
70
- </div>
71
- </template>
72
-
73
- <!-- Change Status -->
74
- <template v-else-if="actionType === 'change_status'">
75
- <div>
76
- <label :class="labelClass">New status</label>
77
- <select
78
- :class="selectClass"
79
- :value="config.status || ''"
80
- @change="update('status', $event.target.value)"
81
- >
82
- <option value="">Select status...</option>
83
- <option v-for="s in statusOptions" :key="s" :value="s">{{ s }}</option>
84
- </select>
85
- </div>
86
- </template>
87
-
88
- <!-- Change Priority -->
89
- <template v-else-if="actionType === 'change_priority'">
90
- <div>
91
- <label :class="labelClass">New priority</label>
92
- <select
93
- :class="selectClass"
94
- :value="config.priority || ''"
95
- @change="update('priority', $event.target.value)"
96
- >
97
- <option value="">Select priority...</option>
98
- <option v-for="p in priorityOptions" :key="p" :value="p">{{ p }}</option>
99
- </select>
100
- </div>
101
- </template>
102
-
103
- <!-- Add / Remove Tag -->
104
- <template v-else-if="actionType === 'add_tag' || actionType === 'remove_tag'">
105
- <div>
106
- <label :class="labelClass">Tag name</label>
107
- <input
108
- :class="inputClass"
109
- :value="config.tag || ''"
110
- placeholder="Enter tag name"
111
- @input="update('tag', $event.target.value)"
112
- />
113
- </div>
114
- </template>
115
-
116
- <!-- Move Department -->
117
- <template v-else-if="actionType === 'move_department'">
118
- <div>
119
- <label :class="labelClass">Department</label>
120
- <input
121
- :class="inputClass"
122
- :value="config.department || ''"
123
- placeholder="Department name or ID"
124
- @input="update('department', $event.target.value)"
125
- />
126
- </div>
127
- </template>
128
-
129
- <!-- Add Internal Note -->
130
- <template v-else-if="actionType === 'add_note'">
131
- <div>
132
- <label :class="labelClass">Note content</label>
133
- <VariableTokenInput
134
- :model-value="config.body || ''"
135
- :multiline="true"
136
- placeholder="Write the note..."
137
- @update:model-value="update('body', $event)"
138
- />
139
- </div>
140
- </template>
141
-
142
- <!-- Send Email -->
143
- <template v-else-if="actionType === 'send_email'">
144
- <div>
145
- <label :class="labelClass">To</label>
146
- <VariableTokenInput
147
- :model-value="config.to || ''"
148
- placeholder="Recipient email or variable"
149
- @update:model-value="update('to', $event)"
150
- />
151
- </div>
152
- <div>
153
- <label :class="labelClass">Subject</label>
154
- <VariableTokenInput
155
- :model-value="config.subject || ''"
156
- placeholder="Email subject"
157
- @update:model-value="update('subject', $event)"
158
- />
159
- </div>
160
- <div>
161
- <label :class="labelClass">Body</label>
162
- <VariableTokenInput
163
- :model-value="config.body || ''"
164
- :multiline="true"
165
- placeholder="Email body..."
166
- @update:model-value="update('body', $event)"
167
- />
168
- </div>
169
- </template>
170
-
171
- <!-- Send Webhook -->
172
- <template v-else-if="actionType === 'send_webhook'">
173
- <div>
174
- <label :class="labelClass">URL</label>
175
- <input
176
- :class="inputClass"
177
- :value="config.url || ''"
178
- placeholder="https://..."
179
- @input="update('url', $event.target.value)"
180
- />
181
- </div>
182
- <div>
183
- <label :class="labelClass">Method</label>
184
- <select
185
- :class="selectClass"
186
- :value="config.method || 'POST'"
187
- @change="update('method', $event.target.value)"
188
- >
189
- <option v-for="m in webhookMethods" :key="m" :value="m">{{ m }}</option>
190
- </select>
191
- </div>
192
- <div>
193
- <label :class="labelClass">Headers (JSON)</label>
194
- <input
195
- :class="inputClass"
196
- :value="config.headers || ''"
197
- :placeholder="headersPlaceholder"
198
- @input="update('headers', $event.target.value)"
199
- />
200
- </div>
201
- <div>
202
- <label :class="labelClass">Body template</label>
203
- <VariableTokenInput
204
- :model-value="config.body || ''"
205
- :multiline="true"
206
- placeholder="JSON body with variables..."
207
- @update:model-value="update('body', $event)"
208
- />
209
- </div>
210
- </template>
211
-
212
- <!-- Delay -->
213
- <template v-else-if="actionType === 'delay'">
214
- <div class="flex items-center gap-3">
215
- <div class="flex-1">
216
- <label :class="labelClass">Duration</label>
217
- <input
218
- type="number"
219
- min="1"
220
- :class="inputClass"
221
- :value="config.duration || 1"
222
- @input="update('duration', parseInt($event.target.value) || 1)"
223
- />
224
- </div>
225
- <div class="flex-1">
226
- <label :class="labelClass">Unit</label>
227
- <select
228
- :class="selectClass + ' w-full'"
229
- :value="config.unit || 'hours'"
230
- @change="update('unit', $event.target.value)"
231
- >
232
- <option v-for="u in delayUnits" :key="u.value" :value="u.value">{{ u.label }}</option>
233
- </select>
234
- </div>
235
- </div>
236
- <div class="rounded-lg bg-orange-500/10 px-3 py-2 text-xs text-orange-400">
237
- Wait {{ config.duration || 1 }} {{ config.unit || 'hours' }}, then continue...
238
- </div>
239
- </template>
240
-
241
- <!-- Apply Macro -->
242
- <template v-else-if="actionType === 'apply_macro'">
243
- <div>
244
- <label :class="labelClass">Macro</label>
245
- <input
246
- :class="inputClass"
247
- :value="config.macro || ''"
248
- placeholder="Macro name or ID"
249
- @input="update('macro', $event.target.value)"
250
- />
251
- </div>
252
- </template>
253
-
254
- <!-- Snooze -->
255
- <template v-else-if="actionType === 'snooze'">
256
- <div class="flex items-center gap-3">
257
- <div class="flex-1">
258
- <label :class="labelClass">Duration</label>
259
- <input
260
- type="number"
261
- min="1"
262
- :class="inputClass"
263
- :value="config.duration || 1"
264
- @input="update('duration', parseInt($event.target.value) || 1)"
265
- />
266
- </div>
267
- <div class="flex-1">
268
- <label :class="labelClass">Unit</label>
269
- <select
270
- :class="selectClass + ' w-full'"
271
- :value="config.unit || 'hours'"
272
- @change="update('unit', $event.target.value)"
273
- >
274
- <option v-for="u in delayUnits" :key="u.value" :value="u.value">{{ u.label }}</option>
275
- </select>
276
- </div>
277
- </div>
278
- </template>
279
-
280
- <!-- Close Ticket (no config needed) -->
281
- <template v-else-if="actionType === 'close_ticket'">
282
- <p class="text-xs text-[var(--esc-panel-text-muted)]">
283
- This action closes the ticket immediately. No configuration needed.
284
- </p>
285
- </template>
286
- </div>
287
- </template>
1
+ <script setup>
2
+ import { computed } from 'vue';
3
+ import VariableTokenInput from './VariableTokenInput.vue';
4
+
5
+ const props = defineProps({
6
+ actionType: { type: String, required: true },
7
+ modelValue: { type: Object, default: () => ({}) },
8
+ });
9
+
10
+ const emit = defineEmits(['update:modelValue']);
11
+
12
+ const headersPlaceholder = '{"Authorization": "Bearer ..."}';
13
+ const config = computed(() => props.modelValue || {});
14
+
15
+ function update(key, value) {
16
+ emit('update:modelValue', { ...config.value, [key]: value });
17
+ }
18
+
19
+ const statusOptions = [
20
+ 'open',
21
+ 'in_progress',
22
+ 'waiting_on_customer',
23
+ 'waiting_on_agent',
24
+ 'escalated',
25
+ 'resolved',
26
+ 'closed',
27
+ ];
28
+ const priorityOptions = ['low', 'medium', 'high', 'urgent', 'critical'];
29
+ const assignModes = [
30
+ { value: 'specific', label: 'Specific agent' },
31
+ { value: 'least_busy', label: 'Least busy agent' },
32
+ { value: 'round_robin', label: 'Round robin' },
33
+ ];
34
+ const delayUnits = [
35
+ { value: 'minutes', label: 'Minutes' },
36
+ { value: 'hours', label: 'Hours' },
37
+ { value: 'days', label: 'Days' },
38
+ ];
39
+ const webhookMethods = ['POST', 'PUT', 'PATCH'];
40
+
41
+ const inputClass =
42
+ 'w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]';
43
+ const selectClass =
44
+ 'rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none';
45
+ const labelClass = 'block text-xs font-medium text-[var(--esc-panel-text-muted)] mb-1';
46
+ </script>
47
+
48
+ <template>
49
+ <div class="space-y-3 pt-2">
50
+ <!-- Assign Agent -->
51
+ <template v-if="actionType === 'assign_agent'">
52
+ <div>
53
+ <label :class="labelClass">Assignment mode</label>
54
+ <select
55
+ :class="selectClass"
56
+ :value="config.mode || 'specific'"
57
+ @change="update('mode', $event.target.value)"
58
+ >
59
+ <option v-for="m in assignModes" :key="m.value" :value="m.value">{{ m.label }}</option>
60
+ </select>
61
+ </div>
62
+ <div v-if="(config.mode || 'specific') === 'specific'">
63
+ <label :class="labelClass">Agent</label>
64
+ <input
65
+ :class="inputClass"
66
+ :value="config.agent || ''"
67
+ placeholder="Agent ID or email"
68
+ @input="update('agent', $event.target.value)"
69
+ />
70
+ </div>
71
+ </template>
72
+
73
+ <!-- Change Status -->
74
+ <template v-else-if="actionType === 'change_status'">
75
+ <div>
76
+ <label :class="labelClass">New status</label>
77
+ <select
78
+ :class="selectClass"
79
+ :value="config.status || ''"
80
+ @change="update('status', $event.target.value)"
81
+ >
82
+ <option value="">Select status...</option>
83
+ <option v-for="s in statusOptions" :key="s" :value="s">{{ s }}</option>
84
+ </select>
85
+ </div>
86
+ </template>
87
+
88
+ <!-- Change Priority -->
89
+ <template v-else-if="actionType === 'change_priority'">
90
+ <div>
91
+ <label :class="labelClass">New priority</label>
92
+ <select
93
+ :class="selectClass"
94
+ :value="config.priority || ''"
95
+ @change="update('priority', $event.target.value)"
96
+ >
97
+ <option value="">Select priority...</option>
98
+ <option v-for="p in priorityOptions" :key="p" :value="p">{{ p }}</option>
99
+ </select>
100
+ </div>
101
+ </template>
102
+
103
+ <!-- Add / Remove Tag -->
104
+ <template v-else-if="actionType === 'add_tag' || actionType === 'remove_tag'">
105
+ <div>
106
+ <label :class="labelClass">Tag name</label>
107
+ <input
108
+ :class="inputClass"
109
+ :value="config.tag || ''"
110
+ placeholder="Enter tag name"
111
+ @input="update('tag', $event.target.value)"
112
+ />
113
+ </div>
114
+ </template>
115
+
116
+ <!-- Move Department -->
117
+ <template v-else-if="actionType === 'move_department'">
118
+ <div>
119
+ <label :class="labelClass">Department</label>
120
+ <input
121
+ :class="inputClass"
122
+ :value="config.department || ''"
123
+ placeholder="Department name or ID"
124
+ @input="update('department', $event.target.value)"
125
+ />
126
+ </div>
127
+ </template>
128
+
129
+ <!-- Add Internal Note -->
130
+ <template v-else-if="actionType === 'add_note'">
131
+ <div>
132
+ <label :class="labelClass">Note content</label>
133
+ <VariableTokenInput
134
+ :model-value="config.body || ''"
135
+ :multiline="true"
136
+ placeholder="Write the note..."
137
+ @update:model-value="update('body', $event)"
138
+ />
139
+ </div>
140
+ </template>
141
+
142
+ <!-- Send Email -->
143
+ <template v-else-if="actionType === 'send_email'">
144
+ <div>
145
+ <label :class="labelClass">To</label>
146
+ <VariableTokenInput
147
+ :model-value="config.to || ''"
148
+ placeholder="Recipient email or variable"
149
+ @update:model-value="update('to', $event)"
150
+ />
151
+ </div>
152
+ <div>
153
+ <label :class="labelClass">Subject</label>
154
+ <VariableTokenInput
155
+ :model-value="config.subject || ''"
156
+ placeholder="Email subject"
157
+ @update:model-value="update('subject', $event)"
158
+ />
159
+ </div>
160
+ <div>
161
+ <label :class="labelClass">Body</label>
162
+ <VariableTokenInput
163
+ :model-value="config.body || ''"
164
+ :multiline="true"
165
+ placeholder="Email body..."
166
+ @update:model-value="update('body', $event)"
167
+ />
168
+ </div>
169
+ </template>
170
+
171
+ <!-- Send Webhook -->
172
+ <template v-else-if="actionType === 'send_webhook'">
173
+ <div>
174
+ <label :class="labelClass">URL</label>
175
+ <input
176
+ :class="inputClass"
177
+ :value="config.url || ''"
178
+ placeholder="https://..."
179
+ @input="update('url', $event.target.value)"
180
+ />
181
+ </div>
182
+ <div>
183
+ <label :class="labelClass">Method</label>
184
+ <select
185
+ :class="selectClass"
186
+ :value="config.method || 'POST'"
187
+ @change="update('method', $event.target.value)"
188
+ >
189
+ <option v-for="m in webhookMethods" :key="m" :value="m">{{ m }}</option>
190
+ </select>
191
+ </div>
192
+ <div>
193
+ <label :class="labelClass">Headers (JSON)</label>
194
+ <input
195
+ :class="inputClass"
196
+ :value="config.headers || ''"
197
+ :placeholder="headersPlaceholder"
198
+ @input="update('headers', $event.target.value)"
199
+ />
200
+ </div>
201
+ <div>
202
+ <label :class="labelClass">Body template</label>
203
+ <VariableTokenInput
204
+ :model-value="config.body || ''"
205
+ :multiline="true"
206
+ placeholder="JSON body with variables..."
207
+ @update:model-value="update('body', $event)"
208
+ />
209
+ </div>
210
+ </template>
211
+
212
+ <!-- Delay -->
213
+ <template v-else-if="actionType === 'delay'">
214
+ <div class="flex items-center gap-3">
215
+ <div class="flex-1">
216
+ <label :class="labelClass">Duration</label>
217
+ <input
218
+ type="number"
219
+ min="1"
220
+ :class="inputClass"
221
+ :value="config.duration || 1"
222
+ @input="update('duration', parseInt($event.target.value) || 1)"
223
+ />
224
+ </div>
225
+ <div class="flex-1">
226
+ <label :class="labelClass">Unit</label>
227
+ <select
228
+ :class="selectClass + ' w-full'"
229
+ :value="config.unit || 'hours'"
230
+ @change="update('unit', $event.target.value)"
231
+ >
232
+ <option v-for="u in delayUnits" :key="u.value" :value="u.value">{{ u.label }}</option>
233
+ </select>
234
+ </div>
235
+ </div>
236
+ <div class="rounded-lg bg-orange-500/10 px-3 py-2 text-xs text-orange-400">
237
+ Wait {{ config.duration || 1 }} {{ config.unit || 'hours' }}, then continue...
238
+ </div>
239
+ </template>
240
+
241
+ <!-- Apply Macro -->
242
+ <template v-else-if="actionType === 'apply_macro'">
243
+ <div>
244
+ <label :class="labelClass">Macro</label>
245
+ <input
246
+ :class="inputClass"
247
+ :value="config.macro || ''"
248
+ placeholder="Macro name or ID"
249
+ @input="update('macro', $event.target.value)"
250
+ />
251
+ </div>
252
+ </template>
253
+
254
+ <!-- Snooze -->
255
+ <template v-else-if="actionType === 'snooze'">
256
+ <div class="flex items-center gap-3">
257
+ <div class="flex-1">
258
+ <label :class="labelClass">Duration</label>
259
+ <input
260
+ type="number"
261
+ min="1"
262
+ :class="inputClass"
263
+ :value="config.duration || 1"
264
+ @input="update('duration', parseInt($event.target.value) || 1)"
265
+ />
266
+ </div>
267
+ <div class="flex-1">
268
+ <label :class="labelClass">Unit</label>
269
+ <select
270
+ :class="selectClass + ' w-full'"
271
+ :value="config.unit || 'hours'"
272
+ @change="update('unit', $event.target.value)"
273
+ >
274
+ <option v-for="u in delayUnits" :key="u.value" :value="u.value">{{ u.label }}</option>
275
+ </select>
276
+ </div>
277
+ </div>
278
+ </template>
279
+
280
+ <!-- Close Ticket (no config needed) -->
281
+ <template v-else-if="actionType === 'close_ticket'">
282
+ <p class="text-xs text-[var(--esc-panel-text-muted)]">
283
+ This action closes the ticket immediately. No configuration needed.
284
+ </p>
285
+ </template>
286
+ </div>
287
+ </template>