@yinshan-tech/webrtc-react 0.8.5 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -13
- package/dist/OutboundCallButton.js +4 -1
- package/dist/OutboundCallButton.js.map +1 -1
- package/dist/OutboundModeShell.d.ts +34 -1
- package/dist/OutboundModeShell.js +162 -46
- package/dist/OutboundModeShell.js.map +1 -1
- package/dist/host/MicrophoneRegisterGate.d.ts +14 -0
- package/dist/host/MicrophoneRegisterGate.js +242 -0
- package/dist/host/MicrophoneRegisterGate.js.map +1 -0
- package/dist/host/SoftphoneConnectToast.js +4 -2
- package/dist/host/SoftphoneConnectToast.js.map +1 -1
- package/dist/host/SoftphoneHost.js +13 -5
- package/dist/host/SoftphoneHost.js.map +1 -1
- package/dist/host/connectToast.d.ts +4 -1
- package/dist/host/connectToast.js +13 -1
- package/dist/host/connectToast.js.map +1 -1
- package/dist/host/microphoneGate.d.ts +8 -0
- package/dist/host/microphoneGate.js +15 -0
- package/dist/host/microphoneGate.js.map +1 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/kit/callCenterTaskEndpoints.d.ts +9 -0
- package/dist/kit/callCenterTaskEndpoints.js +11 -0
- package/dist/kit/callCenterTaskEndpoints.js.map +1 -1
- package/dist/kit/clickCallMutex.d.ts +12 -1
- package/dist/kit/clickCallMutex.js +9 -3
- package/dist/kit/clickCallMutex.js.map +1 -1
- package/dist/kit/createCallCenterSoftphone.d.ts +5 -0
- package/dist/kit/createCallCenterSoftphone.js +55 -3
- package/dist/kit/createCallCenterSoftphone.js.map +1 -1
- package/dist/kit/hooks.d.ts +6 -1
- package/dist/kit/hooks.js +21 -1
- package/dist/kit/hooks.js.map +1 -1
- package/dist/kit/useProgressiveSession.d.ts +2 -0
- package/dist/kit/useProgressiveSession.js +4 -4
- package/dist/kit/useProgressiveSession.js.map +1 -1
- package/dist/kit/waitingHostKind.d.ts +1 -0
- package/dist/kit/waitingHostKind.js +2 -1
- package/dist/kit/waitingHostKind.js.map +1 -1
- package/dist/locales/resolveNotifyMessage.js +8 -0
- package/dist/locales/resolveNotifyMessage.js.map +1 -1
- package/dist/locales/resolveSoftphoneTexts.js +81 -0
- package/dist/locales/resolveSoftphoneTexts.js.map +1 -1
- package/dist/locales/types.d.ts +27 -0
- package/dist/locales/types.js +27 -0
- package/dist/locales/types.js.map +1 -1
- package/dist/outboundShell/PredictiveTaskBody.d.ts +19 -4
- package/dist/outboundShell/PredictiveTaskBody.js +27 -19
- package/dist/outboundShell/PredictiveTaskBody.js.map +1 -1
- package/dist/outboundTaskUi.d.ts +14 -1
- package/dist/outboundTaskUi.js +30 -3
- package/dist/outboundTaskUi.js.map +1 -1
- package/dist/predictive/PredictiveAligningMask.d.ts +6 -0
- package/dist/predictive/PredictiveAligningMask.js +14 -0
- package/dist/predictive/PredictiveAligningMask.js.map +1 -0
- package/dist/predictive/PredictiveHostLoop.d.ts +1 -0
- package/dist/predictive/PredictiveHostLoop.js +269 -0
- package/dist/predictive/PredictiveHostLoop.js.map +1 -0
- package/dist/predictive/createPredictiveSipSession.d.ts +8 -2
- package/dist/predictive/createPredictiveSipSession.js +74 -23
- package/dist/predictive/createPredictiveSipSession.js.map +1 -1
- package/dist/predictive/decidePredictiveEnter.d.ts +21 -4
- package/dist/predictive/decidePredictiveEnter.js +27 -5
- package/dist/predictive/decidePredictiveEnter.js.map +1 -1
- package/dist/predictive/predictiveAgentViewPoll.d.ts +62 -0
- package/dist/predictive/predictiveAgentViewPoll.js +116 -0
- package/dist/predictive/predictiveAgentViewPoll.js.map +1 -0
- package/dist/predictive/predictiveBinding.d.ts +53 -0
- package/dist/predictive/predictiveBinding.js +182 -0
- package/dist/predictive/predictiveBinding.js.map +1 -0
- package/dist/predictive/predictiveStatusLine.d.ts +31 -0
- package/dist/predictive/predictiveStatusLine.js +113 -0
- package/dist/predictive/predictiveStatusLine.js.map +1 -0
- package/dist/predictive/usePredictiveSnapshot.d.ts +11 -0
- package/dist/predictive/usePredictiveSnapshot.js +36 -0
- package/dist/predictive/usePredictiveSnapshot.js.map +1 -0
- package/dist/progressiveStatusLine.js +4 -3
- package/dist/progressiveStatusLine.js.map +1 -1
- package/dist/styles.css +66 -0
- package/dist/stylesInject.d.ts +1 -1
- package/dist/stylesInject.js +1 -1
- package/dist/stylesInject.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { softphoneError } from '@yinshan-tech/webrtc-sdk';
|
|
2
|
+
import { shouldStartPredictiveTerminalCountdown } from './predictiveStatusLine';
|
|
3
|
+
import { adoptWrapUpRemaining, applyPredictiveLiveCase, occupancyAfterWrapUp, } from './predictiveAgentViewPoll';
|
|
4
|
+
const INITIAL_HOST = {
|
|
5
|
+
checkedIn: false,
|
|
6
|
+
completing: false,
|
|
7
|
+
availability: null,
|
|
8
|
+
assignedTasks: [],
|
|
9
|
+
occupancy: null,
|
|
10
|
+
wrapUpRemainingSeconds: null,
|
|
11
|
+
wrapUpEndsAtMs: null,
|
|
12
|
+
aligning: false,
|
|
13
|
+
sessionSawAssignedTasks: false,
|
|
14
|
+
};
|
|
15
|
+
const bindings = new WeakMap();
|
|
16
|
+
export function bindPredictiveSession(phone, session, opts) {
|
|
17
|
+
const existing = bindings.get(phone);
|
|
18
|
+
if (existing) {
|
|
19
|
+
return existing;
|
|
20
|
+
}
|
|
21
|
+
const binding = {
|
|
22
|
+
session,
|
|
23
|
+
getExtNo: opts.getExtNo,
|
|
24
|
+
ensureExtNo: opts.ensureExtNo,
|
|
25
|
+
viewUrl: opts.viewUrl,
|
|
26
|
+
http: opts.http,
|
|
27
|
+
state: Object.assign({}, INITIAL_HOST),
|
|
28
|
+
listeners: new Set(),
|
|
29
|
+
};
|
|
30
|
+
bindings.set(phone, binding);
|
|
31
|
+
return binding;
|
|
32
|
+
}
|
|
33
|
+
export function unbindPredictiveSession(phone) {
|
|
34
|
+
const binding = bindings.get(phone);
|
|
35
|
+
if (!binding) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
binding.state = Object.assign({}, INITIAL_HOST);
|
|
39
|
+
binding.listeners.forEach((fn) => fn());
|
|
40
|
+
bindings.delete(phone);
|
|
41
|
+
}
|
|
42
|
+
export function getPredictiveBinding(phone) {
|
|
43
|
+
return phone ? bindings.get(phone) : undefined;
|
|
44
|
+
}
|
|
45
|
+
export function getPredictiveSipSession(phone) {
|
|
46
|
+
var _a;
|
|
47
|
+
return (_a = getPredictiveBinding(phone)) === null || _a === void 0 ? void 0 : _a.session;
|
|
48
|
+
}
|
|
49
|
+
export function getPredictiveHostState(phone) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
return (_b = (_a = getPredictiveBinding(phone)) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : Object.assign({}, INITIAL_HOST);
|
|
52
|
+
}
|
|
53
|
+
export function subscribePredictiveHost(phone, listener) {
|
|
54
|
+
const binding = getPredictiveBinding(phone);
|
|
55
|
+
if (!binding) {
|
|
56
|
+
return () => undefined;
|
|
57
|
+
}
|
|
58
|
+
binding.listeners.add(listener);
|
|
59
|
+
return () => {
|
|
60
|
+
binding.listeners.delete(listener);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export function patchPredictiveHost(phone, partial) {
|
|
64
|
+
const binding = getPredictiveBinding(phone);
|
|
65
|
+
if (!binding) {
|
|
66
|
+
return Object.assign(Object.assign({}, INITIAL_HOST), partial);
|
|
67
|
+
}
|
|
68
|
+
binding.state = Object.assign(Object.assign({}, binding.state), partial);
|
|
69
|
+
binding.listeners.forEach((fn) => fn());
|
|
70
|
+
return binding.state;
|
|
71
|
+
}
|
|
72
|
+
export function resetPredictiveHost(phone) {
|
|
73
|
+
const binding = getPredictiveBinding(phone);
|
|
74
|
+
if (!binding) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
binding.state = Object.assign({}, INITIAL_HOST);
|
|
78
|
+
binding.listeners.forEach((fn) => fn());
|
|
79
|
+
}
|
|
80
|
+
export function applyPredictiveViewToHost(phone, view) {
|
|
81
|
+
var _a;
|
|
82
|
+
const tasks = (_a = view.assignedTasks) !== null && _a !== void 0 ? _a : [];
|
|
83
|
+
const prev = getPredictiveHostState(phone);
|
|
84
|
+
const sessionSawAssignedTasks = prev.sessionSawAssignedTasks || tasks.length > 0;
|
|
85
|
+
const availability = view.availability === 'ready' || view.availability === 'paused'
|
|
86
|
+
? view.availability
|
|
87
|
+
: prev.availability;
|
|
88
|
+
if (phone.hasActiveCall()) {
|
|
89
|
+
applyPredictiveLiveCase(phone, view.liveCase, { hasActiveCall: true });
|
|
90
|
+
}
|
|
91
|
+
const completing = shouldStartPredictiveTerminalCountdown({
|
|
92
|
+
assignedTasks: tasks,
|
|
93
|
+
sessionSawAssignedTasks,
|
|
94
|
+
hasActiveCall: phone.hasActiveCall(),
|
|
95
|
+
});
|
|
96
|
+
const wrapUp = adoptWrapUpRemaining(prev, view.wrapUpRemainingSeconds, Date.now());
|
|
97
|
+
patchPredictiveHost(phone, Object.assign({ checkedIn: true, availability, assignedTasks: tasks, occupancy: occupancyAfterWrapUp(wrapUp.wrapUpRemainingSeconds, view.occupancy, prev.occupancy), sessionSawAssignedTasks,
|
|
98
|
+
completing }, wrapUp));
|
|
99
|
+
}
|
|
100
|
+
export function applyPredictiveOccupancyToHost(phone, ev) {
|
|
101
|
+
const prev = getPredictiveHostState(phone);
|
|
102
|
+
const wrapUp = adoptWrapUpRemaining(prev, ev.wrapUpRemainingSeconds, Date.now());
|
|
103
|
+
const availability = ev.availability === 'ready' || ev.availability === 'paused'
|
|
104
|
+
? ev.availability
|
|
105
|
+
: prev.availability;
|
|
106
|
+
patchPredictiveHost(phone, Object.assign({ occupancy: occupancyAfterWrapUp(wrapUp.wrapUpRemainingSeconds, ev.occupancy, prev.occupancy), availability }, wrapUp));
|
|
107
|
+
}
|
|
108
|
+
function fail(code, message) {
|
|
109
|
+
return { ok: false, error: softphoneError(code, message) };
|
|
110
|
+
}
|
|
111
|
+
export async function enterPredictive(phone) {
|
|
112
|
+
const binding = getPredictiveBinding(phone);
|
|
113
|
+
if (!binding) {
|
|
114
|
+
return fail('predictive_enter_failed', 'Predictive session is not attached');
|
|
115
|
+
}
|
|
116
|
+
if (binding.ensureExtNo) {
|
|
117
|
+
await binding.ensureExtNo();
|
|
118
|
+
}
|
|
119
|
+
patchPredictiveHost(phone, { aligning: true });
|
|
120
|
+
try {
|
|
121
|
+
const result = await binding.session.enter();
|
|
122
|
+
if (result.ok) {
|
|
123
|
+
patchPredictiveHost(phone, {
|
|
124
|
+
checkedIn: true,
|
|
125
|
+
aligning: false,
|
|
126
|
+
availability: binding.session.getAvailability(),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
resetPredictiveHost(phone);
|
|
131
|
+
}
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
if (getPredictiveHostState(phone).aligning) {
|
|
136
|
+
patchPredictiveHost(phone, { aligning: false });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
export async function leavePredictive(phone) {
|
|
141
|
+
const binding = getPredictiveBinding(phone);
|
|
142
|
+
if (!binding) {
|
|
143
|
+
return fail('predictive_enter_failed', 'Predictive session is not attached');
|
|
144
|
+
}
|
|
145
|
+
const result = await binding.session.leave();
|
|
146
|
+
if (result.ok) {
|
|
147
|
+
resetPredictiveHost(phone);
|
|
148
|
+
}
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
export async function pausePredictive(phone) {
|
|
152
|
+
const binding = getPredictiveBinding(phone);
|
|
153
|
+
if (!binding) {
|
|
154
|
+
return fail('predictive_pause_failed', 'Predictive session is not attached');
|
|
155
|
+
}
|
|
156
|
+
const result = await binding.session.pause();
|
|
157
|
+
if (result.ok) {
|
|
158
|
+
patchPredictiveHost(phone, { availability: binding.session.getAvailability() });
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
export async function readyPredictive(phone) {
|
|
163
|
+
const binding = getPredictiveBinding(phone);
|
|
164
|
+
if (!binding) {
|
|
165
|
+
return fail('predictive_ready_failed', 'Predictive session is not attached');
|
|
166
|
+
}
|
|
167
|
+
const result = await binding.session.ready();
|
|
168
|
+
if (result.ok) {
|
|
169
|
+
patchPredictiveHost(phone, { availability: binding.session.getAvailability() });
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
export function predictiveModeSession(state) {
|
|
174
|
+
return {
|
|
175
|
+
predictiveAvailability: state.availability,
|
|
176
|
+
assignedTasks: state.assignedTasks,
|
|
177
|
+
occupancy: state.occupancy,
|
|
178
|
+
wrapUpRemainingSeconds: state.wrapUpRemainingSeconds,
|
|
179
|
+
aligning: state.aligning,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=predictiveBinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predictiveBinding.js","sourceRoot":"","sources":["../../src/predictive/predictiveBinding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuC,MAAM,0BAA0B,CAAC;AAS/F,OAAO,EAAE,sCAAsC,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GAErB,MAAM,2BAA2B,CAAC;AAwBnC,MAAM,YAAY,GAAwB;IACxC,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,EAAE;IACjB,SAAS,EAAE,IAAI;IACf,sBAAsB,EAAE,IAAI;IAC5B,cAAc,EAAE,IAAI;IACpB,QAAQ,EAAE,KAAK;IACf,uBAAuB,EAAE,KAAK;CAC/B,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAgC,CAAC;AAE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OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC7C,IAAI,MAAM,CAAC,EAAE,EAAE;QACb,mBAAmB,CAAC,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA0B;IAC9D,OAAO;QACL,sBAAsB,EAAE,KAAK,CAAC,YAAY;QAC1C,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;QACpD,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CallSnapshot } from '@yinshan-tech/webrtc-sdk';
|
|
2
|
+
import type { OutboundModeShellTexts } from '../OutboundModeShell';
|
|
3
|
+
export type PredictiveStatusLine = {
|
|
4
|
+
className: string;
|
|
5
|
+
text: string | null;
|
|
6
|
+
highlight?: string;
|
|
7
|
+
prefix?: string;
|
|
8
|
+
suffix?: string;
|
|
9
|
+
};
|
|
10
|
+
export type PredictiveAssignedTask = {
|
|
11
|
+
status?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function resolvePredictiveIdleCopy(tasks: PredictiveAssignedTask[] | null | undefined, texts: OutboundModeShellTexts): string;
|
|
14
|
+
/** 15s only when the session saw tasks, today's unfinished set is empty, and there is no live SIP. */
|
|
15
|
+
export declare function shouldStartPredictiveTerminalCountdown(input: {
|
|
16
|
+
assignedTasks?: PredictiveAssignedTask[] | null;
|
|
17
|
+
sessionSawAssignedTasks: boolean;
|
|
18
|
+
hasActiveCall: boolean;
|
|
19
|
+
}): boolean;
|
|
20
|
+
export declare function resolvePredictiveStatusLine(input: {
|
|
21
|
+
completing?: boolean;
|
|
22
|
+
completeExitSeconds?: number;
|
|
23
|
+
call?: Pick<CallSnapshot, 'phase' | 'id'> | null;
|
|
24
|
+
occupancy?: string | null;
|
|
25
|
+
wrapUpRemainingSeconds?: number | null;
|
|
26
|
+
availability?: 'ready' | 'paused' | null;
|
|
27
|
+
assignedTasks?: PredictiveAssignedTask[] | null;
|
|
28
|
+
aligning?: boolean;
|
|
29
|
+
texts: OutboundModeShellTexts;
|
|
30
|
+
sipText?: (phase: CallSnapshot['phase']) => string;
|
|
31
|
+
}): PredictiveStatusLine;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
function fillTemplate(template, token) {
|
|
2
|
+
var _a;
|
|
3
|
+
const parts = template.split(token);
|
|
4
|
+
return { prefix: (_a = parts[0]) !== null && _a !== void 0 ? _a : '', suffix: parts.slice(1).join(token) };
|
|
5
|
+
}
|
|
6
|
+
function taskStatus(task) {
|
|
7
|
+
return String(task.status || '').toUpperCase();
|
|
8
|
+
}
|
|
9
|
+
export function resolvePredictiveIdleCopy(tasks, texts) {
|
|
10
|
+
const t = (key, fallback) => texts[key] || fallback;
|
|
11
|
+
const list = tasks !== null && tasks !== void 0 ? tasks : [];
|
|
12
|
+
if (list.length === 0) {
|
|
13
|
+
return t('predictiveReadyIdleNone', 'Ready · no active tasks');
|
|
14
|
+
}
|
|
15
|
+
const statuses = list.map(taskStatus);
|
|
16
|
+
const hasRunning = statuses.includes('RUNNING');
|
|
17
|
+
const hasPending = statuses.includes('PENDING');
|
|
18
|
+
const hasPaused = statuses.includes('PAUSED');
|
|
19
|
+
if (hasRunning) {
|
|
20
|
+
return t('predictiveReadyIdleWaiting', 'Ready · waiting for assignment');
|
|
21
|
+
}
|
|
22
|
+
if (hasPending) {
|
|
23
|
+
return t('predictiveReadyIdlePending', 'Ready · task not started');
|
|
24
|
+
}
|
|
25
|
+
if (hasPaused) {
|
|
26
|
+
return t('predictiveReadyIdlePaused', 'Ready · task paused');
|
|
27
|
+
}
|
|
28
|
+
return t('predictiveReadyIdleNone', 'Ready · no active tasks');
|
|
29
|
+
}
|
|
30
|
+
/** 15s only when the session saw tasks, today's unfinished set is empty, and there is no live SIP. */
|
|
31
|
+
export function shouldStartPredictiveTerminalCountdown(input) {
|
|
32
|
+
var _a;
|
|
33
|
+
if (input.hasActiveCall || !input.sessionSawAssignedTasks) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return ((_a = input.assignedTasks) !== null && _a !== void 0 ? _a : []).length === 0;
|
|
37
|
+
}
|
|
38
|
+
export function resolvePredictiveStatusLine(input) {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
const t = (key, fallback) => input.texts[key] || fallback;
|
|
41
|
+
if (input.completing && input.completeExitSeconds != null) {
|
|
42
|
+
const template = t('predictiveCompletedCountdown', 'Assigned tasks finished · auto check-out in {n}s');
|
|
43
|
+
const parts = fillTemplate(template, '{n}');
|
|
44
|
+
return {
|
|
45
|
+
className: 'wro-shell__state is-calling',
|
|
46
|
+
text: null,
|
|
47
|
+
prefix: parts.prefix,
|
|
48
|
+
highlight: String(input.completeExitSeconds),
|
|
49
|
+
suffix: parts.suffix,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const phase = (_a = input.call) === null || _a === void 0 ? void 0 : _a.phase;
|
|
53
|
+
if (phase === 'active') {
|
|
54
|
+
const talking = input.availability === 'paused'
|
|
55
|
+
? t('predictivePausedTalking', 'Paused · in call')
|
|
56
|
+
: t('predictiveReadyTalking', 'Ready · in call');
|
|
57
|
+
return { className: 'wro-shell__state is-connected', text: talking };
|
|
58
|
+
}
|
|
59
|
+
if (phase === 'dialing' || phase === 'ringing' || phase === 'ending') {
|
|
60
|
+
return {
|
|
61
|
+
className: 'wro-shell__state is-calling',
|
|
62
|
+
text: t('predictiveConnecting', 'Connecting'),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (phase === 'ended') {
|
|
66
|
+
return {
|
|
67
|
+
className: 'wro-shell__state',
|
|
68
|
+
text: ((_b = input.sipText) === null || _b === void 0 ? void 0 : _b.call(input, phase)) || t('ended', 'Call ended'),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (phase === 'failed') {
|
|
72
|
+
return {
|
|
73
|
+
className: 'wro-shell__state is-failed',
|
|
74
|
+
text: ((_c = input.sipText) === null || _c === void 0 ? void 0 : _c.call(input, phase)) || t('failed', 'Call failed'),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const wrapSeconds = input.wrapUpRemainingSeconds;
|
|
78
|
+
const inWrapup = input.occupancy === 'wrapup' || (typeof wrapSeconds === 'number' && wrapSeconds > 0);
|
|
79
|
+
if (inWrapup) {
|
|
80
|
+
if (typeof wrapSeconds === 'number' && wrapSeconds > 0) {
|
|
81
|
+
const template = t('predictiveWrapUpCountdown', 'After-call work · {n}s');
|
|
82
|
+
const parts = fillTemplate(template, '{n}');
|
|
83
|
+
return {
|
|
84
|
+
className: 'wro-shell__state is-calling',
|
|
85
|
+
text: null,
|
|
86
|
+
prefix: parts.prefix,
|
|
87
|
+
highlight: String(wrapSeconds),
|
|
88
|
+
suffix: parts.suffix,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
className: 'wro-shell__state',
|
|
93
|
+
text: t('predictiveWrapUp', 'After-call work'),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (input.availability === 'paused') {
|
|
97
|
+
return {
|
|
98
|
+
className: 'wro-shell__state',
|
|
99
|
+
text: t('pausedStatus', 'Paused'),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (input.aligning) {
|
|
103
|
+
return {
|
|
104
|
+
className: 'wro-shell__state is-calling',
|
|
105
|
+
text: t('predictiveAligning', 'Aligning'),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
className: 'wro-shell__state',
|
|
110
|
+
text: resolvePredictiveIdleCopy(input.assignedTasks, input.texts),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=pred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AQ,EAAE,KAAK,CAAC,CAAC;YAC5C,OAAO;gBACL,SAAS,EAAE,6BAA6B;gBACxC,IAAI,EAAE,IAAI;gBACV,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;gBAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB,CAAC;SACH;QACD,OAAO;YACL,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,CAAC,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;SAC/C,CAAC;KACH;IAED,IAAI,KAAK,CAAC,YAAY,KAAK,QAAQ,EAAE;QACnC,OAAO;YACL,SAAS,EAAE,kBAAkB;YAC7B,IAAI,EAAE,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC;SAClC,CAAC;KACH;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE;QAClB,OAAO;YACL,SAAS,EAAE,6BAA6B;YACxC,IAAI,EAAE,CAAC,CAAC,oBAAoB,EAAE,UAAU,CAAC;SAC1C,CAAC;KACH;IAED,OAAO;QACL,SAAS,EAAE,kBAAkB;QAC7B,IAAI,EAAE,yBAAyB,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC;KAClE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { predictiveModeSession, type PredictiveHostState } from './predictiveBinding';
|
|
2
|
+
import type { PredictiveSipSessionResult } from './createPredictiveSipSession';
|
|
3
|
+
export type PredictiveSnapshot = PredictiveHostState & {
|
|
4
|
+
bound: boolean;
|
|
5
|
+
modeSession: ReturnType<typeof predictiveModeSession>;
|
|
6
|
+
enter(): Promise<PredictiveSipSessionResult>;
|
|
7
|
+
leave(): Promise<PredictiveSipSessionResult>;
|
|
8
|
+
pause(): Promise<PredictiveSipSessionResult>;
|
|
9
|
+
ready(): Promise<PredictiveSipSessionResult>;
|
|
10
|
+
};
|
|
11
|
+
export declare function usePredictiveSnapshot(): PredictiveSnapshot;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { softphoneError } from '@yinshan-tech/webrtc-sdk';
|
|
3
|
+
import { tryUseSoftphoneContext } from '../SoftphoneProvider';
|
|
4
|
+
import { enterPredictive, getPredictiveBinding, getPredictiveHostState, leavePredictive, pausePredictive, predictiveModeSession, readyPredictive, subscribePredictiveHost, } from './predictiveBinding';
|
|
5
|
+
export function usePredictiveSnapshot() {
|
|
6
|
+
const phone = tryUseSoftphoneContext();
|
|
7
|
+
const [state, setState] = useState(() => getPredictiveHostState(phone));
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setState(getPredictiveHostState(phone));
|
|
10
|
+
return subscribePredictiveHost(phone, () => {
|
|
11
|
+
setState(getPredictiveHostState(phone));
|
|
12
|
+
});
|
|
13
|
+
}, [phone]);
|
|
14
|
+
return useMemo(() => (Object.assign(Object.assign({}, state), { bound: !!getPredictiveBinding(phone), modeSession: predictiveModeSession(state), enter: () => phone
|
|
15
|
+
? enterPredictive(phone)
|
|
16
|
+
: Promise.resolve({
|
|
17
|
+
ok: false,
|
|
18
|
+
error: softphoneError('not_connected', 'Softphone missing'),
|
|
19
|
+
}), leave: () => phone
|
|
20
|
+
? leavePredictive(phone)
|
|
21
|
+
: Promise.resolve({
|
|
22
|
+
ok: false,
|
|
23
|
+
error: softphoneError('not_connected', 'Softphone missing'),
|
|
24
|
+
}), pause: () => phone
|
|
25
|
+
? pausePredictive(phone)
|
|
26
|
+
: Promise.resolve({
|
|
27
|
+
ok: false,
|
|
28
|
+
error: softphoneError('not_connected', 'Softphone missing'),
|
|
29
|
+
}), ready: () => phone
|
|
30
|
+
? readyPredictive(phone)
|
|
31
|
+
: Promise.resolve({
|
|
32
|
+
ok: false,
|
|
33
|
+
error: softphoneError('not_connected', 'Softphone missing'),
|
|
34
|
+
}) })), [phone, state]);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=usePredictiveS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cAAc,CAAC,eAAe,EAAE,mBAAmB,CAAC;aAC5D,CAAC,EACR,KAAK,EAAE,GAAG,EAAE,CACV,KAAK;YACH,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC;YACxB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;gBACd,EAAE,EAAE,KAAc;gBAClB,KAAK,EAAE,cAAc,CAAC,eAAe,EAAE,mBAAmB,CAAC;aAC5D,CAAC,EACR,KAAK,EAAE,GAAG,EAAE,CACV,KAAK;YACH,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC;YACxB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;gBACd,EAAE,EAAE,KAAc;gBAClB,KAAK,EAAE,cAAc,CAAC,eAAe,EAAE,mBAAmB,CAAC;aAC5D,CAAC,EACR,KAAK,EAAE,GAAG,EAAE,CACV,KAAK;YACH,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC;YACxB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;gBACd,EAAE,EAAE,KAAc;gBAClB,KAAK,EAAE,cAAc,CAAC,eAAe,EAAE,mBAAmB,CAAC;aAC5D,CAAC,IACR,EACF,CAAC,KAAK,EAAE,KAAK,CAAC,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -44,10 +44,11 @@ export function resolveProgressiveStatusLine(input) {
|
|
|
44
44
|
var _a, _b, _c, _d;
|
|
45
45
|
const t = (key, fallback) => input.texts[key] || fallback;
|
|
46
46
|
if (input.completing && input.completeExitSeconds != null) {
|
|
47
|
-
const
|
|
48
|
-
const template = expired
|
|
47
|
+
const template = input.taskStatus === 'expired'
|
|
49
48
|
? t('taskExpiredCountdown', 'Task expired · auto exit in {n}s')
|
|
50
|
-
:
|
|
49
|
+
: input.taskStatus === 'cancelled'
|
|
50
|
+
? t('taskCancelledCountdown', 'Progressive outbound cancelled · auto exit in {n}s')
|
|
51
|
+
: t('taskCompletedCountdown', 'Progressive outbound completed · auto exit in {n}s');
|
|
51
52
|
const parts = fillTemplate(template, '{n}');
|
|
52
53
|
return {
|
|
53
54
|
className: 'wro-shell__state is-calling',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressiveStatusLine.js","sourceRoot":"","sources":["../src/progressiveStatusLine.ts"],"names":[],"mappings":"AAWA,SAAS,YAAY,CAAC,QAAgB,EAAE,KAAa;;IACnD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,EAAE,MAAA,KAAK,CAAC,CAAC,CAAC,mCAAI,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;AACxE,CAAC;AAED,SAAS,qBAAqB,CAAC,EAA8B,EAAE,KAAa;IAC1E,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,YAAY,IAAI,IAAI,EAAE;QAClC,OAAO,CAAC,CAAC;KACV;IACD,IAAI,EAAE,CAAC,QAAQ,KAAK,UAAU,IAAI,EAAE,CAAC,SAAS,IAAI,IAAI,EAAE;QACtD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;KACrC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,MAAc,EAAE,GAAS,EAAE,QAAiB;IACxF,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,EA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,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACvD,CAAC"}
|
package/dist/styles.css
CHANGED
|
@@ -733,3 +733,69 @@
|
|
|
733
733
|
color: #2dd4bf;
|
|
734
734
|
font-size: 12px;
|
|
735
735
|
}
|
|
736
|
+
|
|
737
|
+
.wro-mic-banner {
|
|
738
|
+
position: fixed;
|
|
739
|
+
top: 0;
|
|
740
|
+
left: 0;
|
|
741
|
+
right: 0;
|
|
742
|
+
z-index: 1000;
|
|
743
|
+
display: flex;
|
|
744
|
+
align-items: center;
|
|
745
|
+
justify-content: center;
|
|
746
|
+
gap: 12px;
|
|
747
|
+
padding: 10px 16px;
|
|
748
|
+
background: #fff7ed;
|
|
749
|
+
color: #9a3412;
|
|
750
|
+
font-size: 14px;
|
|
751
|
+
line-height: 1.4;
|
|
752
|
+
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.wro-mic-banner__text {
|
|
756
|
+
display: flex;
|
|
757
|
+
flex-direction: column;
|
|
758
|
+
gap: 4px;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.wro-mic-banner__still {
|
|
762
|
+
font-weight: 600;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.wro-mic-banner__action {
|
|
766
|
+
border: 1px solid #c2410c;
|
|
767
|
+
background: #fff;
|
|
768
|
+
color: #9a3412;
|
|
769
|
+
border-radius: 6px;
|
|
770
|
+
padding: 4px 10px;
|
|
771
|
+
cursor: pointer;
|
|
772
|
+
font-size: 13px;
|
|
773
|
+
white-space: nowrap;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
.wro-mic-banner__action:disabled {
|
|
777
|
+
opacity: 0.55;
|
|
778
|
+
cursor: not-allowed;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.wro-aligning-mask {
|
|
782
|
+
position: fixed;
|
|
783
|
+
inset: 0;
|
|
784
|
+
z-index: 1400;
|
|
785
|
+
display: flex;
|
|
786
|
+
align-items: center;
|
|
787
|
+
justify-content: center;
|
|
788
|
+
background: rgba(15, 23, 42, 0.45);
|
|
789
|
+
pointer-events: auto;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.wro-aligning-box {
|
|
793
|
+
min-width: 220px;
|
|
794
|
+
padding: 20px 28px;
|
|
795
|
+
border-radius: 12px;
|
|
796
|
+
background: #fff;
|
|
797
|
+
color: #0f172a;
|
|
798
|
+
font-size: 15px;
|
|
799
|
+
font-weight: 600;
|
|
800
|
+
box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
|
|
801
|
+
}
|
package/dist/stylesInject.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Auto-generated from styles.css — do not edit. */
|
|
2
|
-
export declare const STYLES_CSS = "/* @yinshan-tech/webrtc-react \u2014 override via CSS variables / className */\n\n.wro-root {\n --wro-btn-bg: #ef4444;\n --wro-btn-color: #fff;\n --wro-btn-radius: 8px;\n --wro-btn-padding: 6px 14px;\n --wro-btn-font-size: 14px;\n --wro-modal-z: 1100;\n font-family:\n system-ui,\n -apple-system,\n \"Segoe UI\",\n Roboto,\n sans-serif;\n}\n\n.wro-btn {\n background: var(--wro-btn-bg);\n color: var(--wro-btn-color);\n border: none;\n border-radius: var(--wro-btn-radius);\n padding: var(--wro-btn-padding);\n font-size: var(--wro-btn-font-size);\n cursor: pointer;\n}\n\n.wro-btn:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n\n/* Floating call card (no full-screen mask) */\n.wro-call {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 320px;\n padding: 20px 24px 28px;\n background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%);\n color: #0f172a;\n border-radius: 20px;\n box-shadow:\n 0 12px 40px rgba(15, 23, 42, 0.16),\n 0 2px 8px rgba(15, 23, 42, 0.06);\n text-align: center;\n cursor: grab;\n user-select: none;\n}\n\n.wro-call.is-dragging {\n cursor: grabbing;\n}\n\n.wro-call button {\n cursor: pointer;\n}\n\n.wro-call__minimize {\n position: absolute;\n top: 10px;\n right: 10px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: rgba(0, 0, 0, 0.45);\n background: transparent;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n}\n\n.wro-call__minimize:hover {\n color: rgba(0, 0, 0, 0.85);\n background: rgba(0, 0, 0, 0.06);\n}\n\n.wro-call__avatar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 72px;\n height: 72px;\n margin: 8px auto 16px;\n color: #fff;\n font-weight: 600;\n font-size: 28px;\n background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);\n border-radius: 50%;\n box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);\n}\n\n.wro-call__avatar.is-calling::after {\n position: absolute;\n inset: -6px;\n border: 2px solid rgba(59, 130, 246, 0.45);\n border-radius: 50%;\n animation: wro-ring 1.6s ease-out infinite;\n content: \"\";\n}\n\n.wro-call__avatar.is-connected {\n background: linear-gradient(145deg, #22c55e 0%, #15803d 100%);\n box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);\n}\n\n.wro-call__avatar.is-failed {\n background: linear-gradient(145deg, #f87171 0%, #dc2626 100%);\n box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);\n}\n\n.wro-call__avatar.is-ended {\n background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);\n box-shadow: none;\n}\n\n.wro-call__name {\n max-width: 100%;\n margin-bottom: 8px;\n overflow: hidden;\n font-weight: 600;\n font-size: 20px;\n line-height: 1.3;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call__number {\n max-width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n color: #0f172a;\n font-weight: 700;\n font-size: 18px;\n letter-spacing: 0.02em;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call__status {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 36px;\n margin-bottom: 8px;\n}\n\n.wro-call__state {\n font-size: 14px;\n color: #64748b;\n}\n\n.wro-call__state.is-calling {\n color: #2563eb;\n animation: wro-blink 1.5s ease-in-out infinite;\n}\n\n.wro-call__state.is-failed {\n color: #dc2626;\n}\n\n.wro-call__state.is-timeout {\n color: #d97706;\n}\n\n.wro-call__state.is-ended {\n color: #64748b;\n}\n\n.wro-call__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n letter-spacing: 1px;\n}\n\n.wro-call__actions {\n display: flex;\n gap: 28px;\n justify-content: center;\n margin-top: 16px;\n cursor: grab;\n}\n\n.wro-call__action {\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n}\n\n.wro-call__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);\n cursor: pointer;\n transition:\n transform 0.15s ease,\n box-shadow 0.15s ease;\n}\n\n.wro-call__circle:hover:not(:disabled) {\n transform: translateY(-1px);\n box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);\n}\n\n.wro-call__circle:disabled {\n background: #fecaca !important;\n box-shadow: none;\n cursor: not-allowed;\n}\n\n.wro-call__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-call__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-call__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-call__circle.is-hangup:hover:not(:disabled) {\n background: #dc2626;\n}\n\n.wro-call__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-call__label {\n color: #475569;\n font-size: 13px;\n line-height: 1;\n}\n\n.wro-call-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n background: #fff;\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);\n cursor: grab;\n user-select: none;\n transition:\n box-shadow 0.2s ease,\n transform 0.2s ease;\n}\n\n.wro-call-mini.is-dragging {\n cursor: grabbing;\n transition: none;\n}\n\n.wro-call-mini:hover {\n box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);\n transform: translateY(-1px);\n}\n\n.wro-call-mini__name {\n overflow: hidden;\n color: #0f172a;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call-mini__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-call-mini__status {\n color: #2563eb;\n font-size: 12px;\n}\n\n@keyframes wro-blink {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.45;\n }\n}\n\n@keyframes wro-ring {\n 0% {\n transform: scale(0.92);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1.18);\n opacity: 0;\n }\n}\n\n/* OutboundModeShell \u2014 dark workbench chrome */\n.wro-shell {\n --wro-shell-bg: #1a2332;\n --wro-shell-panel: #243044;\n --wro-shell-text: #e8eef7;\n --wro-shell-muted: #8b9bb4;\n --wro-shell-accent: #2dd4bf;\n --wro-shell-green: #22c55e;\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 360px;\n padding: 0 0 16px;\n color: var(--wro-shell-text);\n background: var(--wro-shell-bg);\n border-radius: 12px;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 14px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__title {\n display: inline-flex;\n gap: 8px;\n align-items: center;\n color: var(--wro-shell-accent);\n font-weight: 600;\n font-size: 14px;\n}\n\n.wro-shell__title-icon {\n display: inline-flex;\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__title-icon svg {\n width: 16px;\n height: 16px;\n}\n\n.wro-shell__header-actions {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.wro-shell__icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: var(--wro-shell-muted);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n}\n\n.wro-shell__icon-btn:hover {\n color: var(--wro-shell-text);\n background: rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__icon-btn.is-close {\n color: #d54941;\n background: rgba(213, 73, 65, 0.25);\n}\n\n.wro-shell__icon-btn.is-close:hover {\n color: #fff;\n background: rgba(213, 73, 65, 0.6);\n}\n\n.wro-shell__mode-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 12px 14px 0;\n}\n\n.wro-shell__agent-status {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--wro-shell-muted);\n font-size: 13px;\n}\n\n.wro-shell__agent-status-value {\n color: var(--wro-shell-green);\n font-weight: 600;\n}\n\n.wro-shell__mode-actions {\n display: flex;\n gap: 8px;\n}\n\n.wro-shell__mode-actions > * {\n flex: 1;\n}\n\n.wro-shell__task-btn {\n border: 0;\n border-radius: 6px;\n padding: 6px 8px;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n\n.wro-shell__task-btn.is-pause {\n background: #e8730c;\n color: #fff;\n}\n\n.wro-shell__task-btn.is-resume {\n background: var(--wro-shell-accent, #42a5f5);\n color: #fff;\n}\n\n.wro-shell__task-btn.is-cancel {\n background: rgba(213, 73, 65, 0.16);\n color: #d54941;\n}\n\n.wro-shell__task-btn.is-disabled,\n.wro-shell__icon-btn.is-disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.wro-shell__call-status {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n justify-content: center;\n margin-top: 16px;\n padding: 0 16px;\n text-align: center;\n}\n\n.wro-shell__state {\n color: var(--wro-shell-muted);\n font-size: 14px;\n}\n\n.wro-shell__state.is-calling {\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__state.is-next-missed {\n color: var(--wro-shell-muted);\n}\n\n.wro-shell__countdown-sec {\n color: var(--wro-shell-green);\n font-weight: 700;\n}\n\n.wro-shell__state.is-connected {\n color: var(--wro-shell-green);\n}\n\n.wro-shell__state.is-failed {\n color: #f87171;\n}\n\n.wro-shell__number {\n margin-top: 8px;\n padding: 0 16px;\n color: #fff;\n font-weight: 700;\n font-size: 26px;\n line-height: 1.2;\n text-align: center;\n letter-spacing: 0.5px;\n}\n\n.wro-shell__name {\n margin-top: 6px;\n padding: 0 16px;\n overflow: hidden;\n color: var(--wro-shell-muted);\n font-size: 13px;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell__idle-hint {\n min-height: 36px;\n margin-top: 16px;\n padding: 0 16px;\n color: var(--wro-shell-accent);\n font-size: 14px;\n line-height: 36px;\n text-align: center;\n}\n\n.wro-shell__info {\n display: grid;\n grid-template-columns: repeat(5, 1fr);\n gap: 2px;\n width: calc(100% - 28px);\n margin: 10px 14px 4px;\n padding: 6px 4px;\n background: var(--wro-shell-panel);\n border-radius: 5px;\n}\n\n.wro-shell__info-item {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n padding: 2px 1px;\n text-align: center;\n border-right: 1px solid rgba(255, 255, 255, 0.08);\n}\n\n.wro-shell__info-item:last-child {\n border-right: none;\n}\n\n.wro-shell__info-label {\n display: flex;\n align-items: flex-end;\n justify-content: center;\n min-height: 2.4em;\n margin-bottom: 2px;\n color: var(--wro-shell-muted);\n font-size: 9px;\n line-height: 1.2;\n text-align: center;\n}\n\n.wro-shell__info-value {\n color: var(--wro-shell-text);\n font-weight: 600;\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-shell__info-meta {\n margin: 0 14px 4px;\n color: var(--wro-shell-muted);\n font-size: 11px;\n text-align: center;\n}\n\n.wro-shell__info-meta-val {\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__duration {\n margin-top: 14px;\n color: var(--wro-shell-green);\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n text-align: center;\n letter-spacing: 1px;\n}\n\n.wro-shell__actions {\n display: flex;\n gap: 20px;\n justify-content: center;\n margin-top: 14px;\n}\n\n.wro-shell__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 52px;\n height: 52px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.wro-shell__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-shell__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-shell__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-shell__circle:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.wro-shell__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-shell__batch {\n margin: 16px 14px 0;\n padding: 12px;\n background: var(--wro-shell-panel);\n border-radius: 8px;\n}\n\n.wro-shell__batch-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 8px;\n color: var(--wro-shell-accent);\n font-size: 13px;\n}\n\n.wro-shell__batch-bar {\n height: 6px;\n overflow: hidden;\n background: rgba(255, 255, 255, 0.08);\n border-radius: 999px;\n}\n\n.wro-shell__batch-bar-fill {\n height: 100%;\n background: var(--wro-shell-accent);\n border-radius: 999px;\n transition: width 0.2s ease;\n}\n\n.wro-shell__batch-stats {\n display: flex;\n justify-content: flex-start;\n gap: 16px;\n margin-top: 8px;\n color: var(--wro-shell-muted);\n font-size: 12px;\n}\n\n.wro-shell__batch-stats-val {\n color: var(--wro-shell-accent);\n font-weight: 600;\n}\n\n.wro-shell-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n color: var(--wro-shell-text, #e8eef7);\n background: #1a2332;\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell-mini.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell-mini__name {\n overflow: hidden;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell-mini__duration {\n color: #22c55e;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-shell-mini__status {\n color: #2dd4bf;\n font-size: 12px;\n}\n";
|
|
2
|
+
export declare const STYLES_CSS = "/* @yinshan-tech/webrtc-react \u2014 override via CSS variables / className */\n\n.wro-root {\n --wro-btn-bg: #ef4444;\n --wro-btn-color: #fff;\n --wro-btn-radius: 8px;\n --wro-btn-padding: 6px 14px;\n --wro-btn-font-size: 14px;\n --wro-modal-z: 1100;\n font-family:\n system-ui,\n -apple-system,\n \"Segoe UI\",\n Roboto,\n sans-serif;\n}\n\n.wro-btn {\n background: var(--wro-btn-bg);\n color: var(--wro-btn-color);\n border: none;\n border-radius: var(--wro-btn-radius);\n padding: var(--wro-btn-padding);\n font-size: var(--wro-btn-font-size);\n cursor: pointer;\n}\n\n.wro-btn:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n\n/* Floating call card (no full-screen mask) */\n.wro-call {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 320px;\n padding: 20px 24px 28px;\n background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%);\n color: #0f172a;\n border-radius: 20px;\n box-shadow:\n 0 12px 40px rgba(15, 23, 42, 0.16),\n 0 2px 8px rgba(15, 23, 42, 0.06);\n text-align: center;\n cursor: grab;\n user-select: none;\n}\n\n.wro-call.is-dragging {\n cursor: grabbing;\n}\n\n.wro-call button {\n cursor: pointer;\n}\n\n.wro-call__minimize {\n position: absolute;\n top: 10px;\n right: 10px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: rgba(0, 0, 0, 0.45);\n background: transparent;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n}\n\n.wro-call__minimize:hover {\n color: rgba(0, 0, 0, 0.85);\n background: rgba(0, 0, 0, 0.06);\n}\n\n.wro-call__avatar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 72px;\n height: 72px;\n margin: 8px auto 16px;\n color: #fff;\n font-weight: 600;\n font-size: 28px;\n background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);\n border-radius: 50%;\n box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);\n}\n\n.wro-call__avatar.is-calling::after {\n position: absolute;\n inset: -6px;\n border: 2px solid rgba(59, 130, 246, 0.45);\n border-radius: 50%;\n animation: wro-ring 1.6s ease-out infinite;\n content: \"\";\n}\n\n.wro-call__avatar.is-connected {\n background: linear-gradient(145deg, #22c55e 0%, #15803d 100%);\n box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);\n}\n\n.wro-call__avatar.is-failed {\n background: linear-gradient(145deg, #f87171 0%, #dc2626 100%);\n box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);\n}\n\n.wro-call__avatar.is-ended {\n background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);\n box-shadow: none;\n}\n\n.wro-call__name {\n max-width: 100%;\n margin-bottom: 8px;\n overflow: hidden;\n font-weight: 600;\n font-size: 20px;\n line-height: 1.3;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call__number {\n max-width: 100%;\n margin-bottom: 4px;\n overflow: hidden;\n color: #0f172a;\n font-weight: 700;\n font-size: 18px;\n letter-spacing: 0.02em;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call__status {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 36px;\n margin-bottom: 8px;\n}\n\n.wro-call__state {\n font-size: 14px;\n color: #64748b;\n}\n\n.wro-call__state.is-calling {\n color: #2563eb;\n animation: wro-blink 1.5s ease-in-out infinite;\n}\n\n.wro-call__state.is-failed {\n color: #dc2626;\n}\n\n.wro-call__state.is-timeout {\n color: #d97706;\n}\n\n.wro-call__state.is-ended {\n color: #64748b;\n}\n\n.wro-call__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n letter-spacing: 1px;\n}\n\n.wro-call__actions {\n display: flex;\n gap: 28px;\n justify-content: center;\n margin-top: 16px;\n cursor: grab;\n}\n\n.wro-call__action {\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n}\n\n.wro-call__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);\n cursor: pointer;\n transition:\n transform 0.15s ease,\n box-shadow 0.15s ease;\n}\n\n.wro-call__circle:hover:not(:disabled) {\n transform: translateY(-1px);\n box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);\n}\n\n.wro-call__circle:disabled {\n background: #fecaca !important;\n box-shadow: none;\n cursor: not-allowed;\n}\n\n.wro-call__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-call__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-call__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-call__circle.is-hangup:hover:not(:disabled) {\n background: #dc2626;\n}\n\n.wro-call__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-call__label {\n color: #475569;\n font-size: 13px;\n line-height: 1;\n}\n\n.wro-call-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n background: #fff;\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);\n cursor: grab;\n user-select: none;\n transition:\n box-shadow 0.2s ease,\n transform 0.2s ease;\n}\n\n.wro-call-mini.is-dragging {\n cursor: grabbing;\n transition: none;\n}\n\n.wro-call-mini:hover {\n box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);\n transform: translateY(-1px);\n}\n\n.wro-call-mini__name {\n overflow: hidden;\n color: #0f172a;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call-mini__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-call-mini__status {\n color: #2563eb;\n font-size: 12px;\n}\n\n@keyframes wro-blink {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.45;\n }\n}\n\n@keyframes wro-ring {\n 0% {\n transform: scale(0.92);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1.18);\n opacity: 0;\n }\n}\n\n/* OutboundModeShell \u2014 dark workbench chrome */\n.wro-shell {\n --wro-shell-bg: #1a2332;\n --wro-shell-panel: #243044;\n --wro-shell-text: #e8eef7;\n --wro-shell-muted: #8b9bb4;\n --wro-shell-accent: #2dd4bf;\n --wro-shell-green: #22c55e;\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 360px;\n padding: 0 0 16px;\n color: var(--wro-shell-text);\n background: var(--wro-shell-bg);\n border-radius: 12px;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 14px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__title {\n display: inline-flex;\n gap: 8px;\n align-items: center;\n color: var(--wro-shell-accent);\n font-weight: 600;\n font-size: 14px;\n}\n\n.wro-shell__title-icon {\n display: inline-flex;\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__title-icon svg {\n width: 16px;\n height: 16px;\n}\n\n.wro-shell__header-actions {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.wro-shell__icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: var(--wro-shell-muted);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n}\n\n.wro-shell__icon-btn:hover {\n color: var(--wro-shell-text);\n background: rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__icon-btn.is-close {\n color: #d54941;\n background: rgba(213, 73, 65, 0.25);\n}\n\n.wro-shell__icon-btn.is-close:hover {\n color: #fff;\n background: rgba(213, 73, 65, 0.6);\n}\n\n.wro-shell__mode-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 12px 14px 0;\n}\n\n.wro-shell__agent-status {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--wro-shell-muted);\n font-size: 13px;\n}\n\n.wro-shell__agent-status-value {\n color: var(--wro-shell-green);\n font-weight: 600;\n}\n\n.wro-shell__mode-actions {\n display: flex;\n gap: 8px;\n}\n\n.wro-shell__mode-actions > * {\n flex: 1;\n}\n\n.wro-shell__task-btn {\n border: 0;\n border-radius: 6px;\n padding: 6px 8px;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n\n.wro-shell__task-btn.is-pause {\n background: #e8730c;\n color: #fff;\n}\n\n.wro-shell__task-btn.is-resume {\n background: var(--wro-shell-accent, #42a5f5);\n color: #fff;\n}\n\n.wro-shell__task-btn.is-cancel {\n background: rgba(213, 73, 65, 0.16);\n color: #d54941;\n}\n\n.wro-shell__task-btn.is-disabled,\n.wro-shell__icon-btn.is-disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.wro-shell__call-status {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n justify-content: center;\n margin-top: 16px;\n padding: 0 16px;\n text-align: center;\n}\n\n.wro-shell__state {\n color: var(--wro-shell-muted);\n font-size: 14px;\n}\n\n.wro-shell__state.is-calling {\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__state.is-next-missed {\n color: var(--wro-shell-muted);\n}\n\n.wro-shell__countdown-sec {\n color: var(--wro-shell-green);\n font-weight: 700;\n}\n\n.wro-shell__state.is-connected {\n color: var(--wro-shell-green);\n}\n\n.wro-shell__state.is-failed {\n color: #f87171;\n}\n\n.wro-shell__number {\n margin-top: 8px;\n padding: 0 16px;\n color: #fff;\n font-weight: 700;\n font-size: 26px;\n line-height: 1.2;\n text-align: center;\n letter-spacing: 0.5px;\n}\n\n.wro-shell__name {\n margin-top: 6px;\n padding: 0 16px;\n overflow: hidden;\n color: var(--wro-shell-muted);\n font-size: 13px;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell__idle-hint {\n min-height: 36px;\n margin-top: 16px;\n padding: 0 16px;\n color: var(--wro-shell-accent);\n font-size: 14px;\n line-height: 36px;\n text-align: center;\n}\n\n.wro-shell__info {\n display: grid;\n grid-template-columns: repeat(5, 1fr);\n gap: 2px;\n width: calc(100% - 28px);\n margin: 10px 14px 4px;\n padding: 6px 4px;\n background: var(--wro-shell-panel);\n border-radius: 5px;\n}\n\n.wro-shell__info-item {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n padding: 2px 1px;\n text-align: center;\n border-right: 1px solid rgba(255, 255, 255, 0.08);\n}\n\n.wro-shell__info-item:last-child {\n border-right: none;\n}\n\n.wro-shell__info-label {\n display: flex;\n align-items: flex-end;\n justify-content: center;\n min-height: 2.4em;\n margin-bottom: 2px;\n color: var(--wro-shell-muted);\n font-size: 9px;\n line-height: 1.2;\n text-align: center;\n}\n\n.wro-shell__info-value {\n color: var(--wro-shell-text);\n font-weight: 600;\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-shell__info-meta {\n margin: 0 14px 4px;\n color: var(--wro-shell-muted);\n font-size: 11px;\n text-align: center;\n}\n\n.wro-shell__info-meta-val {\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__duration {\n margin-top: 14px;\n color: var(--wro-shell-green);\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n text-align: center;\n letter-spacing: 1px;\n}\n\n.wro-shell__actions {\n display: flex;\n gap: 20px;\n justify-content: center;\n margin-top: 14px;\n}\n\n.wro-shell__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 52px;\n height: 52px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.wro-shell__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-shell__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-shell__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-shell__circle:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.wro-shell__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-shell__batch {\n margin: 16px 14px 0;\n padding: 12px;\n background: var(--wro-shell-panel);\n border-radius: 8px;\n}\n\n.wro-shell__batch-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 8px;\n color: var(--wro-shell-accent);\n font-size: 13px;\n}\n\n.wro-shell__batch-bar {\n height: 6px;\n overflow: hidden;\n background: rgba(255, 255, 255, 0.08);\n border-radius: 999px;\n}\n\n.wro-shell__batch-bar-fill {\n height: 100%;\n background: var(--wro-shell-accent);\n border-radius: 999px;\n transition: width 0.2s ease;\n}\n\n.wro-shell__batch-stats {\n display: flex;\n justify-content: flex-start;\n gap: 16px;\n margin-top: 8px;\n color: var(--wro-shell-muted);\n font-size: 12px;\n}\n\n.wro-shell__batch-stats-val {\n color: var(--wro-shell-accent);\n font-weight: 600;\n}\n\n.wro-shell-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n color: var(--wro-shell-text, #e8eef7);\n background: #1a2332;\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell-mini.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell-mini__name {\n overflow: hidden;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell-mini__duration {\n color: #22c55e;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-shell-mini__status {\n color: #2dd4bf;\n font-size: 12px;\n}\n\n.wro-mic-banner {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n padding: 10px 16px;\n background: #fff7ed;\n color: #9a3412;\n font-size: 14px;\n line-height: 1.4;\n box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);\n}\n\n.wro-mic-banner__text {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.wro-mic-banner__still {\n font-weight: 600;\n}\n\n.wro-mic-banner__action {\n border: 1px solid #c2410c;\n background: #fff;\n color: #9a3412;\n border-radius: 6px;\n padding: 4px 10px;\n cursor: pointer;\n font-size: 13px;\n white-space: nowrap;\n}\n\n.wro-mic-banner__action:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n\n.wro-aligning-mask {\n position: fixed;\n inset: 0;\n z-index: 1400;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(15, 23, 42, 0.45);\n pointer-events: auto;\n}\n\n.wro-aligning-box {\n min-width: 220px;\n padding: 20px 28px;\n border-radius: 12px;\n background: #fff;\n color: #0f172a;\n font-size: 15px;\n font-weight: 600;\n box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);\n}\n";
|