@tmsoft/webphone 5.0.12 → 5.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webphone.component.js +22 -22
- package/dist/webphone.es.js +478 -457
- package/dist/webphone.umd.js +4 -4
- package/package.json +1 -1
package/dist/webphone.es.js
CHANGED
|
@@ -7094,7 +7094,7 @@ var concatArrays = (e, t) => {
|
|
|
7094
7094
|
"max",
|
|
7095
7095
|
"fit",
|
|
7096
7096
|
...O()
|
|
7097
|
-
],
|
|
7097
|
+
], gm = () => [
|
|
7098
7098
|
isFraction,
|
|
7099
7099
|
"screen",
|
|
7100
7100
|
"full",
|
|
@@ -7105,7 +7105,7 @@ var concatArrays = (e, t) => {
|
|
|
7105
7105
|
"max",
|
|
7106
7106
|
"fit",
|
|
7107
7107
|
...O()
|
|
7108
|
-
],
|
|
7108
|
+
], R = () => [
|
|
7109
7109
|
isFraction,
|
|
7110
7110
|
"screen",
|
|
7111
7111
|
"full",
|
|
@@ -7117,50 +7117,50 @@ var concatArrays = (e, t) => {
|
|
|
7117
7117
|
"max",
|
|
7118
7118
|
"fit",
|
|
7119
7119
|
...O()
|
|
7120
|
-
],
|
|
7120
|
+
], z = () => [
|
|
7121
7121
|
e,
|
|
7122
7122
|
isArbitraryVariable,
|
|
7123
7123
|
isArbitraryValue
|
|
7124
|
-
],
|
|
7124
|
+
], _m = () => [
|
|
7125
7125
|
...w(),
|
|
7126
7126
|
isArbitraryVariablePosition,
|
|
7127
7127
|
isArbitraryPosition,
|
|
7128
7128
|
{ position: [isArbitraryVariable, isArbitraryValue] }
|
|
7129
|
-
],
|
|
7129
|
+
], vm = () => ["no-repeat", { repeat: [
|
|
7130
7130
|
"",
|
|
7131
7131
|
"x",
|
|
7132
7132
|
"y",
|
|
7133
7133
|
"space",
|
|
7134
7134
|
"round"
|
|
7135
|
-
] }],
|
|
7135
|
+
] }], B = () => [
|
|
7136
7136
|
"auto",
|
|
7137
7137
|
"cover",
|
|
7138
7138
|
"contain",
|
|
7139
7139
|
isArbitraryVariableSize,
|
|
7140
7140
|
isArbitrarySize,
|
|
7141
7141
|
{ size: [isArbitraryVariable, isArbitraryValue] }
|
|
7142
|
-
],
|
|
7142
|
+
], V = () => [
|
|
7143
7143
|
isPercent,
|
|
7144
7144
|
isArbitraryVariableLength,
|
|
7145
7145
|
isArbitraryLength
|
|
7146
|
-
],
|
|
7146
|
+
], H = () => [
|
|
7147
7147
|
"",
|
|
7148
7148
|
"none",
|
|
7149
7149
|
"full",
|
|
7150
7150
|
d,
|
|
7151
7151
|
isArbitraryVariable,
|
|
7152
7152
|
isArbitraryValue
|
|
7153
|
-
],
|
|
7153
|
+
], U = () => [
|
|
7154
7154
|
"",
|
|
7155
7155
|
isNumber,
|
|
7156
7156
|
isArbitraryVariableLength,
|
|
7157
7157
|
isArbitraryLength
|
|
7158
|
-
],
|
|
7158
|
+
], ym = () => [
|
|
7159
7159
|
"solid",
|
|
7160
7160
|
"dashed",
|
|
7161
7161
|
"dotted",
|
|
7162
7162
|
"double"
|
|
7163
|
-
],
|
|
7163
|
+
], W = () => [
|
|
7164
7164
|
"normal",
|
|
7165
7165
|
"multiply",
|
|
7166
7166
|
"screen",
|
|
@@ -7177,23 +7177,23 @@ var concatArrays = (e, t) => {
|
|
|
7177
7177
|
"saturation",
|
|
7178
7178
|
"color",
|
|
7179
7179
|
"luminosity"
|
|
7180
|
-
],
|
|
7180
|
+
], G = () => [
|
|
7181
7181
|
isNumber,
|
|
7182
7182
|
isPercent,
|
|
7183
7183
|
isArbitraryVariablePosition,
|
|
7184
7184
|
isArbitraryPosition
|
|
7185
|
-
],
|
|
7185
|
+
], K = () => [
|
|
7186
7186
|
"",
|
|
7187
7187
|
"none",
|
|
7188
7188
|
_,
|
|
7189
7189
|
isArbitraryVariable,
|
|
7190
7190
|
isArbitraryValue
|
|
7191
|
-
],
|
|
7191
|
+
], bm = () => [
|
|
7192
7192
|
"none",
|
|
7193
7193
|
isNumber,
|
|
7194
7194
|
isArbitraryVariable,
|
|
7195
7195
|
isArbitraryValue
|
|
7196
|
-
],
|
|
7196
|
+
], xm = () => [
|
|
7197
7197
|
"none",
|
|
7198
7198
|
isNumber,
|
|
7199
7199
|
isArbitraryVariable,
|
|
@@ -7491,12 +7491,12 @@ var concatArrays = (e, t) => {
|
|
|
7491
7491
|
"space-y": [{ "space-y": O() }],
|
|
7492
7492
|
"space-y-reverse": ["space-y-reverse"],
|
|
7493
7493
|
size: [{ size: L() }],
|
|
7494
|
-
"inline-size": [{ inline: ["auto", ...
|
|
7495
|
-
"min-inline-size": [{ "min-inline": ["auto", ...
|
|
7496
|
-
"max-inline-size": [{ "max-inline": ["none", ...
|
|
7497
|
-
"block-size": [{ block: ["auto", ...
|
|
7498
|
-
"min-block-size": [{ "min-block": ["auto", ...
|
|
7499
|
-
"max-block-size": [{ "max-block": ["none", ...
|
|
7494
|
+
"inline-size": [{ inline: ["auto", ...gm()] }],
|
|
7495
|
+
"min-inline-size": [{ "min-inline": ["auto", ...gm()] }],
|
|
7496
|
+
"max-inline-size": [{ "max-inline": ["none", ...gm()] }],
|
|
7497
|
+
"block-size": [{ block: ["auto", ...R()] }],
|
|
7498
|
+
"min-block-size": [{ "min-block": ["auto", ...R()] }],
|
|
7499
|
+
"max-block-size": [{ "max-block": ["none", ...R()] }],
|
|
7500
7500
|
w: [{ w: [
|
|
7501
7501
|
l,
|
|
7502
7502
|
"screen",
|
|
@@ -7603,15 +7603,15 @@ var concatArrays = (e, t) => {
|
|
|
7603
7603
|
"start",
|
|
7604
7604
|
"end"
|
|
7605
7605
|
] }],
|
|
7606
|
-
"placeholder-color": [{ placeholder:
|
|
7607
|
-
"text-color": [{ text:
|
|
7606
|
+
"placeholder-color": [{ placeholder: z() }],
|
|
7607
|
+
"text-color": [{ text: z() }],
|
|
7608
7608
|
"text-decoration": [
|
|
7609
7609
|
"underline",
|
|
7610
7610
|
"overline",
|
|
7611
7611
|
"line-through",
|
|
7612
7612
|
"no-underline"
|
|
7613
7613
|
],
|
|
7614
|
-
"text-decoration-style": [{ decoration: [...
|
|
7614
|
+
"text-decoration-style": [{ decoration: [...ym(), "wavy"] }],
|
|
7615
7615
|
"text-decoration-thickness": [{ decoration: [
|
|
7616
7616
|
isNumber,
|
|
7617
7617
|
"from-font",
|
|
@@ -7619,7 +7619,7 @@ var concatArrays = (e, t) => {
|
|
|
7619
7619
|
isArbitraryVariable,
|
|
7620
7620
|
isArbitraryLength
|
|
7621
7621
|
] }],
|
|
7622
|
-
"text-decoration-color": [{ decoration:
|
|
7622
|
+
"text-decoration-color": [{ decoration: z() }],
|
|
7623
7623
|
"underline-offset": [{ "underline-offset": [
|
|
7624
7624
|
isNumber,
|
|
7625
7625
|
"auto",
|
|
@@ -7701,9 +7701,9 @@ var concatArrays = (e, t) => {
|
|
|
7701
7701
|
"padding",
|
|
7702
7702
|
"content"
|
|
7703
7703
|
] }],
|
|
7704
|
-
"bg-position": [{ bg:
|
|
7705
|
-
"bg-repeat": [{ bg:
|
|
7706
|
-
"bg-size": [{ bg:
|
|
7704
|
+
"bg-position": [{ bg: _m() }],
|
|
7705
|
+
"bg-repeat": [{ bg: vm() }],
|
|
7706
|
+
"bg-size": [{ bg: B() }],
|
|
7707
7707
|
"bg-image": [{ bg: [
|
|
7708
7708
|
"none",
|
|
7709
7709
|
{
|
|
@@ -7736,67 +7736,67 @@ var concatArrays = (e, t) => {
|
|
|
7736
7736
|
isArbitraryVariableImage,
|
|
7737
7737
|
isArbitraryImage
|
|
7738
7738
|
] }],
|
|
7739
|
-
"bg-color": [{ bg:
|
|
7740
|
-
"gradient-from-pos": [{ from:
|
|
7741
|
-
"gradient-via-pos": [{ via:
|
|
7742
|
-
"gradient-to-pos": [{ to:
|
|
7743
|
-
"gradient-from": [{ from:
|
|
7744
|
-
"gradient-via": [{ via:
|
|
7745
|
-
"gradient-to": [{ to:
|
|
7746
|
-
rounded: [{ rounded:
|
|
7747
|
-
"rounded-s": [{ "rounded-s":
|
|
7748
|
-
"rounded-e": [{ "rounded-e":
|
|
7749
|
-
"rounded-t": [{ "rounded-t":
|
|
7750
|
-
"rounded-r": [{ "rounded-r":
|
|
7751
|
-
"rounded-b": [{ "rounded-b":
|
|
7752
|
-
"rounded-l": [{ "rounded-l":
|
|
7753
|
-
"rounded-ss": [{ "rounded-ss":
|
|
7754
|
-
"rounded-se": [{ "rounded-se":
|
|
7755
|
-
"rounded-ee": [{ "rounded-ee":
|
|
7756
|
-
"rounded-es": [{ "rounded-es":
|
|
7757
|
-
"rounded-tl": [{ "rounded-tl":
|
|
7758
|
-
"rounded-tr": [{ "rounded-tr":
|
|
7759
|
-
"rounded-br": [{ "rounded-br":
|
|
7760
|
-
"rounded-bl": [{ "rounded-bl":
|
|
7761
|
-
"border-w": [{ border:
|
|
7762
|
-
"border-w-x": [{ "border-x":
|
|
7763
|
-
"border-w-y": [{ "border-y":
|
|
7764
|
-
"border-w-s": [{ "border-s":
|
|
7765
|
-
"border-w-e": [{ "border-e":
|
|
7766
|
-
"border-w-bs": [{ "border-bs":
|
|
7767
|
-
"border-w-be": [{ "border-be":
|
|
7768
|
-
"border-w-t": [{ "border-t":
|
|
7769
|
-
"border-w-r": [{ "border-r":
|
|
7770
|
-
"border-w-b": [{ "border-b":
|
|
7771
|
-
"border-w-l": [{ "border-l":
|
|
7772
|
-
"divide-x": [{ "divide-x":
|
|
7739
|
+
"bg-color": [{ bg: z() }],
|
|
7740
|
+
"gradient-from-pos": [{ from: V() }],
|
|
7741
|
+
"gradient-via-pos": [{ via: V() }],
|
|
7742
|
+
"gradient-to-pos": [{ to: V() }],
|
|
7743
|
+
"gradient-from": [{ from: z() }],
|
|
7744
|
+
"gradient-via": [{ via: z() }],
|
|
7745
|
+
"gradient-to": [{ to: z() }],
|
|
7746
|
+
rounded: [{ rounded: H() }],
|
|
7747
|
+
"rounded-s": [{ "rounded-s": H() }],
|
|
7748
|
+
"rounded-e": [{ "rounded-e": H() }],
|
|
7749
|
+
"rounded-t": [{ "rounded-t": H() }],
|
|
7750
|
+
"rounded-r": [{ "rounded-r": H() }],
|
|
7751
|
+
"rounded-b": [{ "rounded-b": H() }],
|
|
7752
|
+
"rounded-l": [{ "rounded-l": H() }],
|
|
7753
|
+
"rounded-ss": [{ "rounded-ss": H() }],
|
|
7754
|
+
"rounded-se": [{ "rounded-se": H() }],
|
|
7755
|
+
"rounded-ee": [{ "rounded-ee": H() }],
|
|
7756
|
+
"rounded-es": [{ "rounded-es": H() }],
|
|
7757
|
+
"rounded-tl": [{ "rounded-tl": H() }],
|
|
7758
|
+
"rounded-tr": [{ "rounded-tr": H() }],
|
|
7759
|
+
"rounded-br": [{ "rounded-br": H() }],
|
|
7760
|
+
"rounded-bl": [{ "rounded-bl": H() }],
|
|
7761
|
+
"border-w": [{ border: U() }],
|
|
7762
|
+
"border-w-x": [{ "border-x": U() }],
|
|
7763
|
+
"border-w-y": [{ "border-y": U() }],
|
|
7764
|
+
"border-w-s": [{ "border-s": U() }],
|
|
7765
|
+
"border-w-e": [{ "border-e": U() }],
|
|
7766
|
+
"border-w-bs": [{ "border-bs": U() }],
|
|
7767
|
+
"border-w-be": [{ "border-be": U() }],
|
|
7768
|
+
"border-w-t": [{ "border-t": U() }],
|
|
7769
|
+
"border-w-r": [{ "border-r": U() }],
|
|
7770
|
+
"border-w-b": [{ "border-b": U() }],
|
|
7771
|
+
"border-w-l": [{ "border-l": U() }],
|
|
7772
|
+
"divide-x": [{ "divide-x": U() }],
|
|
7773
7773
|
"divide-x-reverse": ["divide-x-reverse"],
|
|
7774
|
-
"divide-y": [{ "divide-y":
|
|
7774
|
+
"divide-y": [{ "divide-y": U() }],
|
|
7775
7775
|
"divide-y-reverse": ["divide-y-reverse"],
|
|
7776
7776
|
"border-style": [{ border: [
|
|
7777
|
-
...
|
|
7777
|
+
...ym(),
|
|
7778
7778
|
"hidden",
|
|
7779
7779
|
"none"
|
|
7780
7780
|
] }],
|
|
7781
7781
|
"divide-style": [{ divide: [
|
|
7782
|
-
...
|
|
7782
|
+
...ym(),
|
|
7783
7783
|
"hidden",
|
|
7784
7784
|
"none"
|
|
7785
7785
|
] }],
|
|
7786
|
-
"border-color": [{ border:
|
|
7787
|
-
"border-color-x": [{ "border-x":
|
|
7788
|
-
"border-color-y": [{ "border-y":
|
|
7789
|
-
"border-color-s": [{ "border-s":
|
|
7790
|
-
"border-color-e": [{ "border-e":
|
|
7791
|
-
"border-color-bs": [{ "border-bs":
|
|
7792
|
-
"border-color-be": [{ "border-be":
|
|
7793
|
-
"border-color-t": [{ "border-t":
|
|
7794
|
-
"border-color-r": [{ "border-r":
|
|
7795
|
-
"border-color-b": [{ "border-b":
|
|
7796
|
-
"border-color-l": [{ "border-l":
|
|
7797
|
-
"divide-color": [{ divide:
|
|
7786
|
+
"border-color": [{ border: z() }],
|
|
7787
|
+
"border-color-x": [{ "border-x": z() }],
|
|
7788
|
+
"border-color-y": [{ "border-y": z() }],
|
|
7789
|
+
"border-color-s": [{ "border-s": z() }],
|
|
7790
|
+
"border-color-e": [{ "border-e": z() }],
|
|
7791
|
+
"border-color-bs": [{ "border-bs": z() }],
|
|
7792
|
+
"border-color-be": [{ "border-be": z() }],
|
|
7793
|
+
"border-color-t": [{ "border-t": z() }],
|
|
7794
|
+
"border-color-r": [{ "border-r": z() }],
|
|
7795
|
+
"border-color-b": [{ "border-b": z() }],
|
|
7796
|
+
"border-color-l": [{ "border-l": z() }],
|
|
7797
|
+
"divide-color": [{ divide: z() }],
|
|
7798
7798
|
"outline-style": [{ outline: [
|
|
7799
|
-
...
|
|
7799
|
+
...ym(),
|
|
7800
7800
|
"none",
|
|
7801
7801
|
"hidden"
|
|
7802
7802
|
] }],
|
|
@@ -7811,7 +7811,7 @@ var concatArrays = (e, t) => {
|
|
|
7811
7811
|
isArbitraryVariableLength,
|
|
7812
7812
|
isArbitraryLength
|
|
7813
7813
|
] }],
|
|
7814
|
-
"outline-color": [{ outline:
|
|
7814
|
+
"outline-color": [{ outline: z() }],
|
|
7815
7815
|
shadow: [{ shadow: [
|
|
7816
7816
|
"",
|
|
7817
7817
|
"none",
|
|
@@ -7819,39 +7819,39 @@ var concatArrays = (e, t) => {
|
|
|
7819
7819
|
isArbitraryVariableShadow,
|
|
7820
7820
|
isArbitraryShadow
|
|
7821
7821
|
] }],
|
|
7822
|
-
"shadow-color": [{ shadow:
|
|
7822
|
+
"shadow-color": [{ shadow: z() }],
|
|
7823
7823
|
"inset-shadow": [{ "inset-shadow": [
|
|
7824
7824
|
"none",
|
|
7825
7825
|
p,
|
|
7826
7826
|
isArbitraryVariableShadow,
|
|
7827
7827
|
isArbitraryShadow
|
|
7828
7828
|
] }],
|
|
7829
|
-
"inset-shadow-color": [{ "inset-shadow":
|
|
7830
|
-
"ring-w": [{ ring:
|
|
7829
|
+
"inset-shadow-color": [{ "inset-shadow": z() }],
|
|
7830
|
+
"ring-w": [{ ring: U() }],
|
|
7831
7831
|
"ring-w-inset": ["ring-inset"],
|
|
7832
|
-
"ring-color": [{ ring:
|
|
7832
|
+
"ring-color": [{ ring: z() }],
|
|
7833
7833
|
"ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }],
|
|
7834
|
-
"ring-offset-color": [{ "ring-offset":
|
|
7835
|
-
"inset-ring-w": [{ "inset-ring":
|
|
7836
|
-
"inset-ring-color": [{ "inset-ring":
|
|
7834
|
+
"ring-offset-color": [{ "ring-offset": z() }],
|
|
7835
|
+
"inset-ring-w": [{ "inset-ring": U() }],
|
|
7836
|
+
"inset-ring-color": [{ "inset-ring": z() }],
|
|
7837
7837
|
"text-shadow": [{ "text-shadow": [
|
|
7838
7838
|
"none",
|
|
7839
7839
|
m,
|
|
7840
7840
|
isArbitraryVariableShadow,
|
|
7841
7841
|
isArbitraryShadow
|
|
7842
7842
|
] }],
|
|
7843
|
-
"text-shadow-color": [{ "text-shadow":
|
|
7843
|
+
"text-shadow-color": [{ "text-shadow": z() }],
|
|
7844
7844
|
opacity: [{ opacity: [
|
|
7845
7845
|
isNumber,
|
|
7846
7846
|
isArbitraryVariable,
|
|
7847
7847
|
isArbitraryValue
|
|
7848
7848
|
] }],
|
|
7849
7849
|
"mix-blend": [{ "mix-blend": [
|
|
7850
|
-
...
|
|
7850
|
+
...W(),
|
|
7851
7851
|
"plus-darker",
|
|
7852
7852
|
"plus-lighter"
|
|
7853
7853
|
] }],
|
|
7854
|
-
"bg-blend": [{ "bg-blend":
|
|
7854
|
+
"bg-blend": [{ "bg-blend": W() }],
|
|
7855
7855
|
"mask-clip": [{ "mask-clip": [
|
|
7856
7856
|
"border",
|
|
7857
7857
|
"padding",
|
|
@@ -7867,39 +7867,39 @@ var concatArrays = (e, t) => {
|
|
|
7867
7867
|
"exclude"
|
|
7868
7868
|
] }],
|
|
7869
7869
|
"mask-image-linear-pos": [{ "mask-linear": [isNumber] }],
|
|
7870
|
-
"mask-image-linear-from-pos": [{ "mask-linear-from":
|
|
7871
|
-
"mask-image-linear-to-pos": [{ "mask-linear-to":
|
|
7872
|
-
"mask-image-linear-from-color": [{ "mask-linear-from":
|
|
7873
|
-
"mask-image-linear-to-color": [{ "mask-linear-to":
|
|
7874
|
-
"mask-image-t-from-pos": [{ "mask-t-from":
|
|
7875
|
-
"mask-image-t-to-pos": [{ "mask-t-to":
|
|
7876
|
-
"mask-image-t-from-color": [{ "mask-t-from":
|
|
7877
|
-
"mask-image-t-to-color": [{ "mask-t-to":
|
|
7878
|
-
"mask-image-r-from-pos": [{ "mask-r-from":
|
|
7879
|
-
"mask-image-r-to-pos": [{ "mask-r-to":
|
|
7880
|
-
"mask-image-r-from-color": [{ "mask-r-from":
|
|
7881
|
-
"mask-image-r-to-color": [{ "mask-r-to":
|
|
7882
|
-
"mask-image-b-from-pos": [{ "mask-b-from":
|
|
7883
|
-
"mask-image-b-to-pos": [{ "mask-b-to":
|
|
7884
|
-
"mask-image-b-from-color": [{ "mask-b-from":
|
|
7885
|
-
"mask-image-b-to-color": [{ "mask-b-to":
|
|
7886
|
-
"mask-image-l-from-pos": [{ "mask-l-from":
|
|
7887
|
-
"mask-image-l-to-pos": [{ "mask-l-to":
|
|
7888
|
-
"mask-image-l-from-color": [{ "mask-l-from":
|
|
7889
|
-
"mask-image-l-to-color": [{ "mask-l-to":
|
|
7890
|
-
"mask-image-x-from-pos": [{ "mask-x-from":
|
|
7891
|
-
"mask-image-x-to-pos": [{ "mask-x-to":
|
|
7892
|
-
"mask-image-x-from-color": [{ "mask-x-from":
|
|
7893
|
-
"mask-image-x-to-color": [{ "mask-x-to":
|
|
7894
|
-
"mask-image-y-from-pos": [{ "mask-y-from":
|
|
7895
|
-
"mask-image-y-to-pos": [{ "mask-y-to":
|
|
7896
|
-
"mask-image-y-from-color": [{ "mask-y-from":
|
|
7897
|
-
"mask-image-y-to-color": [{ "mask-y-to":
|
|
7870
|
+
"mask-image-linear-from-pos": [{ "mask-linear-from": G() }],
|
|
7871
|
+
"mask-image-linear-to-pos": [{ "mask-linear-to": G() }],
|
|
7872
|
+
"mask-image-linear-from-color": [{ "mask-linear-from": z() }],
|
|
7873
|
+
"mask-image-linear-to-color": [{ "mask-linear-to": z() }],
|
|
7874
|
+
"mask-image-t-from-pos": [{ "mask-t-from": G() }],
|
|
7875
|
+
"mask-image-t-to-pos": [{ "mask-t-to": G() }],
|
|
7876
|
+
"mask-image-t-from-color": [{ "mask-t-from": z() }],
|
|
7877
|
+
"mask-image-t-to-color": [{ "mask-t-to": z() }],
|
|
7878
|
+
"mask-image-r-from-pos": [{ "mask-r-from": G() }],
|
|
7879
|
+
"mask-image-r-to-pos": [{ "mask-r-to": G() }],
|
|
7880
|
+
"mask-image-r-from-color": [{ "mask-r-from": z() }],
|
|
7881
|
+
"mask-image-r-to-color": [{ "mask-r-to": z() }],
|
|
7882
|
+
"mask-image-b-from-pos": [{ "mask-b-from": G() }],
|
|
7883
|
+
"mask-image-b-to-pos": [{ "mask-b-to": G() }],
|
|
7884
|
+
"mask-image-b-from-color": [{ "mask-b-from": z() }],
|
|
7885
|
+
"mask-image-b-to-color": [{ "mask-b-to": z() }],
|
|
7886
|
+
"mask-image-l-from-pos": [{ "mask-l-from": G() }],
|
|
7887
|
+
"mask-image-l-to-pos": [{ "mask-l-to": G() }],
|
|
7888
|
+
"mask-image-l-from-color": [{ "mask-l-from": z() }],
|
|
7889
|
+
"mask-image-l-to-color": [{ "mask-l-to": z() }],
|
|
7890
|
+
"mask-image-x-from-pos": [{ "mask-x-from": G() }],
|
|
7891
|
+
"mask-image-x-to-pos": [{ "mask-x-to": G() }],
|
|
7892
|
+
"mask-image-x-from-color": [{ "mask-x-from": z() }],
|
|
7893
|
+
"mask-image-x-to-color": [{ "mask-x-to": z() }],
|
|
7894
|
+
"mask-image-y-from-pos": [{ "mask-y-from": G() }],
|
|
7895
|
+
"mask-image-y-to-pos": [{ "mask-y-to": G() }],
|
|
7896
|
+
"mask-image-y-from-color": [{ "mask-y-from": z() }],
|
|
7897
|
+
"mask-image-y-to-color": [{ "mask-y-to": z() }],
|
|
7898
7898
|
"mask-image-radial": [{ "mask-radial": [isArbitraryVariable, isArbitraryValue] }],
|
|
7899
|
-
"mask-image-radial-from-pos": [{ "mask-radial-from":
|
|
7900
|
-
"mask-image-radial-to-pos": [{ "mask-radial-to":
|
|
7901
|
-
"mask-image-radial-from-color": [{ "mask-radial-from":
|
|
7902
|
-
"mask-image-radial-to-color": [{ "mask-radial-to":
|
|
7899
|
+
"mask-image-radial-from-pos": [{ "mask-radial-from": G() }],
|
|
7900
|
+
"mask-image-radial-to-pos": [{ "mask-radial-to": G() }],
|
|
7901
|
+
"mask-image-radial-from-color": [{ "mask-radial-from": z() }],
|
|
7902
|
+
"mask-image-radial-to-color": [{ "mask-radial-to": z() }],
|
|
7903
7903
|
"mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
|
|
7904
7904
|
"mask-image-radial-size": [{ "mask-radial": [{
|
|
7905
7905
|
closest: ["side", "corner"],
|
|
@@ -7907,10 +7907,10 @@ var concatArrays = (e, t) => {
|
|
|
7907
7907
|
}] }],
|
|
7908
7908
|
"mask-image-radial-pos": [{ "mask-radial-at": w() }],
|
|
7909
7909
|
"mask-image-conic-pos": [{ "mask-conic": [isNumber] }],
|
|
7910
|
-
"mask-image-conic-from-pos": [{ "mask-conic-from":
|
|
7911
|
-
"mask-image-conic-to-pos": [{ "mask-conic-to":
|
|
7912
|
-
"mask-image-conic-from-color": [{ "mask-conic-from":
|
|
7913
|
-
"mask-image-conic-to-color": [{ "mask-conic-to":
|
|
7910
|
+
"mask-image-conic-from-pos": [{ "mask-conic-from": G() }],
|
|
7911
|
+
"mask-image-conic-to-pos": [{ "mask-conic-to": G() }],
|
|
7912
|
+
"mask-image-conic-from-color": [{ "mask-conic-from": z() }],
|
|
7913
|
+
"mask-image-conic-to-color": [{ "mask-conic-to": z() }],
|
|
7914
7914
|
"mask-mode": [{ mask: [
|
|
7915
7915
|
"alpha",
|
|
7916
7916
|
"luminance",
|
|
@@ -7924,9 +7924,9 @@ var concatArrays = (e, t) => {
|
|
|
7924
7924
|
"stroke",
|
|
7925
7925
|
"view"
|
|
7926
7926
|
] }],
|
|
7927
|
-
"mask-position": [{ mask:
|
|
7928
|
-
"mask-repeat": [{ mask:
|
|
7929
|
-
"mask-size": [{ mask:
|
|
7927
|
+
"mask-position": [{ mask: _m() }],
|
|
7928
|
+
"mask-repeat": [{ mask: vm() }],
|
|
7929
|
+
"mask-size": [{ mask: B() }],
|
|
7930
7930
|
"mask-type": [{ "mask-type": ["alpha", "luminance"] }],
|
|
7931
7931
|
"mask-image": [{ mask: [
|
|
7932
7932
|
"none",
|
|
@@ -7939,7 +7939,7 @@ var concatArrays = (e, t) => {
|
|
|
7939
7939
|
isArbitraryVariable,
|
|
7940
7940
|
isArbitraryValue
|
|
7941
7941
|
] }],
|
|
7942
|
-
blur: [{ blur:
|
|
7942
|
+
blur: [{ blur: K() }],
|
|
7943
7943
|
brightness: [{ brightness: [
|
|
7944
7944
|
isNumber,
|
|
7945
7945
|
isArbitraryVariable,
|
|
@@ -7957,7 +7957,7 @@ var concatArrays = (e, t) => {
|
|
|
7957
7957
|
isArbitraryVariableShadow,
|
|
7958
7958
|
isArbitraryShadow
|
|
7959
7959
|
] }],
|
|
7960
|
-
"drop-shadow-color": [{ "drop-shadow":
|
|
7960
|
+
"drop-shadow-color": [{ "drop-shadow": z() }],
|
|
7961
7961
|
grayscale: [{ grayscale: [
|
|
7962
7962
|
"",
|
|
7963
7963
|
isNumber,
|
|
@@ -7992,7 +7992,7 @@ var concatArrays = (e, t) => {
|
|
|
7992
7992
|
isArbitraryVariable,
|
|
7993
7993
|
isArbitraryValue
|
|
7994
7994
|
] }],
|
|
7995
|
-
"backdrop-blur": [{ "backdrop-blur":
|
|
7995
|
+
"backdrop-blur": [{ "backdrop-blur": K() }],
|
|
7996
7996
|
"backdrop-brightness": [{ "backdrop-brightness": [
|
|
7997
7997
|
isNumber,
|
|
7998
7998
|
isArbitraryVariable,
|
|
@@ -8085,14 +8085,14 @@ var concatArrays = (e, t) => {
|
|
|
8085
8085
|
isArbitraryValue
|
|
8086
8086
|
] }],
|
|
8087
8087
|
"perspective-origin": [{ "perspective-origin": T() }],
|
|
8088
|
-
rotate: [{ rotate:
|
|
8089
|
-
"rotate-x": [{ "rotate-x":
|
|
8090
|
-
"rotate-y": [{ "rotate-y":
|
|
8091
|
-
"rotate-z": [{ "rotate-z":
|
|
8092
|
-
scale: [{ scale:
|
|
8093
|
-
"scale-x": [{ "scale-x":
|
|
8094
|
-
"scale-y": [{ "scale-y":
|
|
8095
|
-
"scale-z": [{ "scale-z":
|
|
8088
|
+
rotate: [{ rotate: bm() }],
|
|
8089
|
+
"rotate-x": [{ "rotate-x": bm() }],
|
|
8090
|
+
"rotate-y": [{ "rotate-y": bm() }],
|
|
8091
|
+
"rotate-z": [{ "rotate-z": bm() }],
|
|
8092
|
+
scale: [{ scale: xm() }],
|
|
8093
|
+
"scale-x": [{ "scale-x": xm() }],
|
|
8094
|
+
"scale-y": [{ "scale-y": xm() }],
|
|
8095
|
+
"scale-z": [{ "scale-z": xm() }],
|
|
8096
8096
|
"scale-3d": ["scale-3d"],
|
|
8097
8097
|
skew: [{ skew: q() }],
|
|
8098
8098
|
"skew-x": [{ "skew-x": q() }],
|
|
@@ -8112,9 +8112,9 @@ var concatArrays = (e, t) => {
|
|
|
8112
8112
|
"translate-y": [{ "translate-y": J() }],
|
|
8113
8113
|
"translate-z": [{ "translate-z": J() }],
|
|
8114
8114
|
"translate-none": ["translate-none"],
|
|
8115
|
-
accent: [{ accent:
|
|
8115
|
+
accent: [{ accent: z() }],
|
|
8116
8116
|
appearance: [{ appearance: ["none", "auto"] }],
|
|
8117
|
-
"caret-color": [{ caret:
|
|
8117
|
+
"caret-color": [{ caret: z() }],
|
|
8118
8118
|
"color-scheme": [{ scheme: [
|
|
8119
8119
|
"normal",
|
|
8120
8120
|
"dark",
|
|
@@ -8238,14 +8238,14 @@ var concatArrays = (e, t) => {
|
|
|
8238
8238
|
isArbitraryVariable,
|
|
8239
8239
|
isArbitraryValue
|
|
8240
8240
|
] }],
|
|
8241
|
-
fill: [{ fill: ["none", ...
|
|
8241
|
+
fill: [{ fill: ["none", ...z()] }],
|
|
8242
8242
|
"stroke-w": [{ stroke: [
|
|
8243
8243
|
isNumber,
|
|
8244
8244
|
isArbitraryVariableLength,
|
|
8245
8245
|
isArbitraryLength,
|
|
8246
8246
|
isArbitraryNumber
|
|
8247
8247
|
] }],
|
|
8248
|
-
stroke: [{ stroke: ["none", ...
|
|
8248
|
+
stroke: [{ stroke: ["none", ...z()] }],
|
|
8249
8249
|
"forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
|
|
8250
8250
|
},
|
|
8251
8251
|
conflictingClassGroups: {
|
|
@@ -8572,10 +8572,16 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8572
8572
|
1e4,
|
|
8573
8573
|
2e4,
|
|
8574
8574
|
3e4
|
|
8575
|
-
]
|
|
8575
|
+
];
|
|
8576
|
+
var InvalidUriError = class extends Error {
|
|
8577
|
+
constructor() {
|
|
8578
|
+
super("Invalid URI");
|
|
8579
|
+
}
|
|
8580
|
+
};
|
|
8581
|
+
const createSipService = (e, t = {}) => {
|
|
8576
8582
|
let n = shallowRef(null), i = shallowRef(null), a = shallowRef(/* @__PURE__ */ new Map()), o = new Audio();
|
|
8577
8583
|
o.autoplay = !0;
|
|
8578
|
-
let l = shallowRef(void 0), u = shallowRef(null), d = shallowRef(null), f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map(), _ = !1, v = null, y = null, b = null, x = null, S = null, w = null, T = 0, E = null, D = computed(() => n.value?.configuration.uri?.user || ""), { startRingtone:
|
|
8584
|
+
let l = shallowRef(void 0), u = shallowRef(null), d = shallowRef(null), f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map(), _ = !1, v = null, y = null, b = null, x = null, S = null, w = null, T = 0, E = null, D = null, O = 0, k = 0, A = computed(() => n.value?.configuration.uri?.user || ""), { startRingtone: j, stopRingtone: M, startRingback: N, stopRingback: P, playAutoAnswerBeep: F, setNotificationVolume: I, setRingtoneVolume: L, setRingtoneTone: gm } = useAudioSounds(), R = (e) => e instanceof Inviter || e instanceof Invitation ? e.request?.callId || e.dialog?.callId || e.id || crypto.randomUUID() : e.dialog?.callId || e.id || crypto.randomUUID(), z = (e) => {
|
|
8579
8585
|
if (!(e instanceof Invitation)) return;
|
|
8580
8586
|
let t = e.request;
|
|
8581
8587
|
if (!t) return;
|
|
@@ -8584,16 +8590,16 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8584
8590
|
...i ? { id: i } : {},
|
|
8585
8591
|
...n ? { name: n } : {}
|
|
8586
8592
|
};
|
|
8587
|
-
},
|
|
8588
|
-
let o =
|
|
8593
|
+
}, _m = (e, n, i, a) => {
|
|
8594
|
+
let o = z(e), s = {
|
|
8589
8595
|
channelId: n,
|
|
8590
|
-
sipCallId:
|
|
8596
|
+
sipCallId: R(e),
|
|
8591
8597
|
direction: i,
|
|
8592
8598
|
remoteNumber: a,
|
|
8593
8599
|
...o ? { queue: o } : {}
|
|
8594
8600
|
};
|
|
8595
8601
|
return f.set(n, s), t.onCallContext?.(s), s;
|
|
8596
|
-
},
|
|
8602
|
+
}, vm = (e, n) => {
|
|
8597
8603
|
let i = f.get(e);
|
|
8598
8604
|
i && t.onCallState?.({
|
|
8599
8605
|
...i,
|
|
@@ -8614,14 +8620,14 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8614
8620
|
localStream: s,
|
|
8615
8621
|
remoteStream: l
|
|
8616
8622
|
}));
|
|
8617
|
-
},
|
|
8623
|
+
}, V = (e) => {
|
|
8618
8624
|
f.delete(e), p.delete(e), m.delete(e);
|
|
8619
|
-
},
|
|
8625
|
+
}, H = (n, i) => {
|
|
8620
8626
|
if (a.value.get(n) !== i) return;
|
|
8621
8627
|
let o = g.get(i);
|
|
8622
8628
|
o && clearTimeout(o), g.delete(i);
|
|
8623
8629
|
let s = e.channels.value.find((e) => e.id === n), l = f.get(n), u = m.has(n) || s?.status === "connected";
|
|
8624
|
-
|
|
8630
|
+
V(n), a.value.delete(n), e.updateChannelState(n, {
|
|
8625
8631
|
status: "idle",
|
|
8626
8632
|
remoteNumber: "",
|
|
8627
8633
|
remoteDisplayName: void 0,
|
|
@@ -8633,7 +8639,7 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8633
8639
|
hasEarlyMedia: !1
|
|
8634
8640
|
});
|
|
8635
8641
|
let d = e.transferInProgress.value;
|
|
8636
|
-
if (d && (d.originalChannelId === n || d.consultationChannelId === n) && e.setTransferInProgress(null), e.activeChannelId.value === n &&
|
|
8642
|
+
if (d && (d.originalChannelId === n || d.consultationChannelId === n) && e.setTransferInProgress(null), e.activeChannelId.value === n && $(), K(), l) {
|
|
8637
8643
|
try {
|
|
8638
8644
|
e.addCallLog({
|
|
8639
8645
|
number: l.remoteNumber,
|
|
@@ -8655,11 +8661,11 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8655
8661
|
console.warn("[SipJs] Call ended, but the state callback failed:", e);
|
|
8656
8662
|
}
|
|
8657
8663
|
}
|
|
8658
|
-
},
|
|
8664
|
+
}, ym = (e, t) => {
|
|
8659
8665
|
g.has(t) || g.set(t, setTimeout(() => {
|
|
8660
|
-
console.warn("[SipJs] Hangup did not terminate; releasing local call state"),
|
|
8666
|
+
console.warn("[SipJs] Hangup did not terminate; releasing local call state"), W(t), H(e, t);
|
|
8661
8667
|
}, 5e3));
|
|
8662
|
-
},
|
|
8668
|
+
}, W = (e) => {
|
|
8663
8669
|
if (e.state !== SessionState.Terminated) try {
|
|
8664
8670
|
e.dispose().catch((e) => {
|
|
8665
8671
|
console.warn("[SipJs] Session disposal failed:", e);
|
|
@@ -8667,15 +8673,17 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8667
8673
|
} catch (e) {
|
|
8668
8674
|
console.warn("[SipJs] Session disposal failed:", e);
|
|
8669
8675
|
}
|
|
8670
|
-
},
|
|
8671
|
-
e.
|
|
8672
|
-
},
|
|
8673
|
-
|
|
8674
|
-
},
|
|
8676
|
+
}, G = () => {
|
|
8677
|
+
for (let [e, t] of a.value) t.state === SessionState.Initial && f.get(e)?.direction === "incoming" && (console.warn("[SipJs] Transport lost while ringing; releasing the incoming call"), H(e, t), W(t));
|
|
8678
|
+
}, K = () => {
|
|
8679
|
+
e.channels.value.some((e) => e.status === "incoming") && !isAutoAnswerEnabled() ? j() : M(), e.activeChannel.value?.status === "calling" ? N() : P();
|
|
8680
|
+
}, bm = async (e, t, n) => {
|
|
8681
|
+
await F(), isAutoAnswerEnabled() && a.value.get(e) === t && t.state === SessionState.Initial && await Lm(n);
|
|
8682
|
+
}, xm = (e) => {
|
|
8675
8683
|
o.volume = e / 100;
|
|
8676
|
-
},
|
|
8684
|
+
}, q = async (e) => {
|
|
8677
8685
|
typeof o.setSinkId == "function" && await o.setSinkId(e);
|
|
8678
|
-
},
|
|
8686
|
+
}, J = async (t) => {
|
|
8679
8687
|
if (!t) return;
|
|
8680
8688
|
let n = [...a.value.entries()].flatMap(([e, t]) => {
|
|
8681
8689
|
let n = t.sessionDescriptionHandler, i = n?.peerConnection?.getSenders().find((e) => e.track?.kind === "audio");
|
|
@@ -8730,26 +8738,26 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8730
8738
|
} catch (e) {
|
|
8731
8739
|
await Promise.allSettled(o.map(({ sender: e, previousTrack: t }) => e.replaceTrack(t))), i.forEach((e) => e.getTracks().forEach((e) => e.stop())), console.warn("[SipJs] Failed to switch microphone:", e);
|
|
8732
8740
|
}
|
|
8733
|
-
},
|
|
8741
|
+
}, Sm = (e, t) => {
|
|
8734
8742
|
let n = !1, i = e.sessionDescriptionHandler;
|
|
8735
8743
|
return i?.peerConnection && i.peerConnection.getSenders().forEach((e) => {
|
|
8736
8744
|
e.track && e.track.kind === "audio" && (e.track.enabled = t, n = !0);
|
|
8737
8745
|
}), n;
|
|
8738
|
-
},
|
|
8746
|
+
}, Cm = (e) => {
|
|
8739
8747
|
let t = !1;
|
|
8740
8748
|
return d.value && d.value.getAudioTracks().forEach((n) => {
|
|
8741
8749
|
n.enabled = e, t = !0;
|
|
8742
8750
|
}), t;
|
|
8743
|
-
},
|
|
8744
|
-
let n = !(t?.isHeld || t?.isMuted), i =
|
|
8751
|
+
}, wm = (e, t) => {
|
|
8752
|
+
let n = !(t?.isHeld || t?.isMuted), i = Sm(e, n), a = Cm(n);
|
|
8745
8753
|
!i && !a && console.warn("[SipJs] No audio tracks found to apply channel audio state");
|
|
8746
|
-
},
|
|
8754
|
+
}, Tm = (t) => {
|
|
8747
8755
|
for (let [n, i] of a.value.entries()) if (i === t) return e.channels.value.find((e) => e.id === n) || null;
|
|
8748
8756
|
return e.activeChannel.value || null;
|
|
8749
|
-
},
|
|
8757
|
+
}, Em = async (e) => {
|
|
8750
8758
|
let t = e.sessionDescriptionHandler?.peerConnection;
|
|
8751
8759
|
if (!t) return;
|
|
8752
|
-
let n =
|
|
8760
|
+
let n = Tm(e), i = !(n?.isHeld || n?.isMuted), o = t.getSenders().find((e) => e.track?.kind === "audio");
|
|
8753
8761
|
if (o?.track) {
|
|
8754
8762
|
o.track.enabled = i, n && B(e, n.id);
|
|
8755
8763
|
return;
|
|
@@ -8766,7 +8774,7 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8766
8774
|
let l = new MediaStream([s]);
|
|
8767
8775
|
d.value = l;
|
|
8768
8776
|
let u = t.getSenders().find((e) => e.track === null);
|
|
8769
|
-
u ? await u.replaceTrack(s) : t.addTrack(s, l),
|
|
8777
|
+
u ? await u.replaceTrack(s) : t.addTrack(s, l), wm(e, n), n && B(e, n.id);
|
|
8770
8778
|
} catch (e) {
|
|
8771
8779
|
console.warn("[SipJs] Failed to recover outbound audio track:", e);
|
|
8772
8780
|
}
|
|
@@ -8781,7 +8789,7 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8781
8789
|
audio: n,
|
|
8782
8790
|
video: e
|
|
8783
8791
|
};
|
|
8784
|
-
},
|
|
8792
|
+
}, Dm = async () => {
|
|
8785
8793
|
let t = i.value;
|
|
8786
8794
|
t && await t.register({ requestDelegate: {
|
|
8787
8795
|
onAccept: () => {
|
|
@@ -8790,83 +8798,96 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8790
8798
|
onReject: (t) => {
|
|
8791
8799
|
e.setConnected(!1);
|
|
8792
8800
|
let n = t?.message?.statusCode;
|
|
8793
|
-
n === 401 || n === 403 || n === 404 ||
|
|
8801
|
+
n === 401 || n === 403 || n === 404 || jm();
|
|
8794
8802
|
}
|
|
8795
8803
|
} });
|
|
8796
|
-
},
|
|
8797
|
-
if (
|
|
8804
|
+
}, Om = async (t) => {
|
|
8805
|
+
if (n.value) return;
|
|
8806
|
+
D &&= (clearTimeout(D), null);
|
|
8807
|
+
let a = k;
|
|
8808
|
+
try {
|
|
8809
|
+
(await navigator.mediaDevices.getUserMedia({ audio: !0 })).getTracks().forEach((e) => e.stop());
|
|
8810
|
+
} catch (e) {
|
|
8811
|
+
console.error("Microphone permission denied", e);
|
|
8812
|
+
return;
|
|
8813
|
+
}
|
|
8814
|
+
try {
|
|
8815
|
+
let a = UserAgent.makeURI(t.uri);
|
|
8816
|
+
if (!a) throw new InvalidUriError();
|
|
8817
|
+
_ = t.earlyMedia ?? !1;
|
|
8818
|
+
let o = {
|
|
8819
|
+
server: t.transportOptions.server,
|
|
8820
|
+
keepAliveInterval: t.transportOptions.keepAliveInterval ?? 30
|
|
8821
|
+
}, s = {
|
|
8822
|
+
uri: a,
|
|
8823
|
+
logLevel: "error",
|
|
8824
|
+
transportOptions: o,
|
|
8825
|
+
authorizationUsername: t.authorizationUsername,
|
|
8826
|
+
authorizationPassword: t.authorizationPassword,
|
|
8827
|
+
reconnectionAttempts: 0,
|
|
8828
|
+
delegate: {
|
|
8829
|
+
onConnect: () => {},
|
|
8830
|
+
onDisconnect: () => {
|
|
8831
|
+
e.setConnected(!1), G(), jm();
|
|
8832
|
+
},
|
|
8833
|
+
onInvite: (e) => Fm(e)
|
|
8834
|
+
}
|
|
8835
|
+
}, l = typeof SharedWorker < "u", u = l;
|
|
8836
|
+
l && (s.transportConstructor = SharedWorkerTransport, s.transportOptions = {
|
|
8837
|
+
...o,
|
|
8838
|
+
clientId: crypto.randomUUID(),
|
|
8839
|
+
connectionId: `${t.transportOptions.server}|${t.uri}|${crypto.randomUUID()}`
|
|
8840
|
+
});
|
|
8798
8841
|
try {
|
|
8799
|
-
|
|
8842
|
+
n.value = new UserAgent(s);
|
|
8800
8843
|
} catch (e) {
|
|
8801
|
-
|
|
8802
|
-
|
|
8844
|
+
if (!l) throw e;
|
|
8845
|
+
u = !1, console.warn("[SipJs] SharedWorker unavailable, using native WebSocket transport", e), delete s.transportConstructor, s.transportOptions = o, n.value = new UserAgent(s);
|
|
8803
8846
|
}
|
|
8804
8847
|
try {
|
|
8805
|
-
|
|
8806
|
-
if (!a) throw Error("Invalid URI");
|
|
8807
|
-
_ = t.earlyMedia ?? !1;
|
|
8808
|
-
let o = {
|
|
8809
|
-
server: t.transportOptions.server,
|
|
8810
|
-
keepAliveInterval: t.transportOptions.keepAliveInterval ?? 30
|
|
8811
|
-
}, s = {
|
|
8812
|
-
uri: a,
|
|
8813
|
-
logLevel: "error",
|
|
8814
|
-
transportOptions: o,
|
|
8815
|
-
authorizationUsername: t.authorizationUsername,
|
|
8816
|
-
authorizationPassword: t.authorizationPassword,
|
|
8817
|
-
reconnectionAttempts: 0,
|
|
8818
|
-
delegate: {
|
|
8819
|
-
onConnect: () => {},
|
|
8820
|
-
onDisconnect: () => {
|
|
8821
|
-
e.setConnected(!1), Z();
|
|
8822
|
-
},
|
|
8823
|
-
onInvite: (e) => Om(e)
|
|
8824
|
-
}
|
|
8825
|
-
}, l = typeof SharedWorker < "u", u = l;
|
|
8826
|
-
l && (s.transportConstructor = SharedWorkerTransport, s.transportOptions = {
|
|
8827
|
-
...o,
|
|
8828
|
-
clientId: crypto.randomUUID(),
|
|
8829
|
-
connectionId: `${t.transportOptions.server}|${t.uri}|${crypto.randomUUID()}`
|
|
8830
|
-
});
|
|
8831
|
-
try {
|
|
8832
|
-
n.value = new UserAgent(s);
|
|
8833
|
-
} catch (e) {
|
|
8834
|
-
if (!l) throw e;
|
|
8835
|
-
u = !1, console.warn("[SipJs] SharedWorker unavailable, using native WebSocket transport", e), delete s.transportConstructor, s.transportOptions = o, n.value = new UserAgent(s);
|
|
8836
|
-
}
|
|
8837
|
-
try {
|
|
8838
|
-
await n.value.start(), i.value = new Registerer(n.value), await Sm();
|
|
8839
|
-
} catch (e) {
|
|
8840
|
-
if (!u) throw e;
|
|
8841
|
-
console.warn("[SipJs] SharedWorker connection failed, retrying with native WebSocket", e);
|
|
8842
|
-
let t = n.value;
|
|
8843
|
-
n.value = null, i.value = null;
|
|
8844
|
-
try {
|
|
8845
|
-
await t?.stop();
|
|
8846
|
-
} catch (e) {
|
|
8847
|
-
console.warn("[SipJs] Failed to clean up SharedWorker transport", e);
|
|
8848
|
-
}
|
|
8849
|
-
delete s.transportConstructor, s.transportOptions = o, n.value = new UserAgent(s), await n.value.start(), i.value = new Registerer(n.value), await Sm();
|
|
8850
|
-
}
|
|
8851
|
-
wm();
|
|
8848
|
+
await n.value.start(), i.value = new Registerer(n.value), await Dm();
|
|
8852
8849
|
} catch (e) {
|
|
8853
|
-
|
|
8850
|
+
if (!u) throw e;
|
|
8851
|
+
console.warn("[SipJs] SharedWorker connection failed, retrying with native WebSocket", e);
|
|
8854
8852
|
let t = n.value;
|
|
8855
|
-
|
|
8856
|
-
|
|
8853
|
+
n.value = null, i.value = null;
|
|
8854
|
+
try {
|
|
8855
|
+
await t?.stop();
|
|
8857
8856
|
} catch (e) {
|
|
8858
|
-
console.warn("[SipJs] Failed to clean up
|
|
8857
|
+
console.warn("[SipJs] Failed to clean up SharedWorker transport", e);
|
|
8859
8858
|
}
|
|
8859
|
+
delete s.transportConstructor, s.transportOptions = o, n.value = new UserAgent(s), await n.value.start(), i.value = new Registerer(n.value), await Dm();
|
|
8860
8860
|
}
|
|
8861
|
-
|
|
8862
|
-
|
|
8861
|
+
Am(), O = 0;
|
|
8862
|
+
} catch (e) {
|
|
8863
|
+
console.error("[SipJs] Failed to initialize WSS/SIP connection", e);
|
|
8864
|
+
let o = n.value;
|
|
8865
|
+
if (n.value = null, i.value = null, o !== null) try {
|
|
8866
|
+
await o.stop();
|
|
8867
|
+
} catch (e) {
|
|
8868
|
+
console.warn("[SipJs] Failed to clean up after connection error", e);
|
|
8869
|
+
}
|
|
8870
|
+
!(e instanceof InvalidUriError) && a === k && km(t);
|
|
8871
|
+
}
|
|
8872
|
+
}, km = (e) => {
|
|
8873
|
+
if (D) return;
|
|
8874
|
+
let t = RECOVERY_DELAYS_MS[Math.min(O, RECOVERY_DELAYS_MS.length - 1)];
|
|
8875
|
+
O++, D = setTimeout(async () => {
|
|
8876
|
+
if (D = null, !navigator.onLine) {
|
|
8877
|
+
console.log("[SipJs] Skipping initial connection retry, device is offline"), km(e);
|
|
8878
|
+
return;
|
|
8879
|
+
}
|
|
8880
|
+
console.log("[SipJs] Retrying initial connection..."), await Om(e);
|
|
8881
|
+
}, t);
|
|
8882
|
+
}, Am = () => {
|
|
8863
8883
|
b = new AbortController();
|
|
8864
8884
|
let { signal: t } = b, n = Date.now(), i = (e = 1e3) => {
|
|
8865
8885
|
x && clearTimeout(x), x = setTimeout(async () => {
|
|
8866
|
-
x = null, await
|
|
8886
|
+
x = null, await Nm();
|
|
8867
8887
|
}, e);
|
|
8868
8888
|
}, a = () => {
|
|
8869
8889
|
if (document.visibilityState === "visible") {
|
|
8890
|
+
K();
|
|
8870
8891
|
let e = Date.now() - n;
|
|
8871
8892
|
e > 5e3 ? (console.log(`[SipJs] Device was suspended for ${Math.round(e / 1e3)}s, reconnecting...`), i(1500)) : i(500);
|
|
8872
8893
|
}
|
|
@@ -8884,9 +8905,9 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8884
8905
|
document.addEventListener("visibilitychange", a, { signal: t }), window.addEventListener("online", o, { signal: t }), window.addEventListener("offline", s, { signal: t }), document.addEventListener("freeze", () => {
|
|
8885
8906
|
console.log("[SipJs] Page frozen"), S &&= (clearInterval(S), null);
|
|
8886
8907
|
}, { signal: t }), document.addEventListener("resume", () => {
|
|
8887
|
-
console.log("[SipJs] Page resumed"), n = Date.now(), l(), i(1e3);
|
|
8888
|
-
}, { signal: t }), l(),
|
|
8889
|
-
},
|
|
8908
|
+
console.log("[SipJs] Page resumed"), K(), n = Date.now(), l(), i(1e3);
|
|
8909
|
+
}, { signal: t }), l(), Mm();
|
|
8910
|
+
}, jm = () => {
|
|
8890
8911
|
if (w || !n.value) return;
|
|
8891
8912
|
let t = RECOVERY_DELAYS_MS[Math.min(T, RECOVERY_DELAYS_MS.length - 1)];
|
|
8892
8913
|
w = setTimeout(async () => {
|
|
@@ -8894,13 +8915,13 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8894
8915
|
T = 0;
|
|
8895
8916
|
return;
|
|
8896
8917
|
}
|
|
8897
|
-
T++, await
|
|
8918
|
+
T++, await Nm(), e.isConnected.value || jm();
|
|
8898
8919
|
}, t);
|
|
8899
|
-
},
|
|
8920
|
+
}, Mm = () => {
|
|
8900
8921
|
E && clearInterval(E), E = setInterval(() => {
|
|
8901
|
-
n.value && !e.isConnected.value &&
|
|
8922
|
+
n.value && !e.isConnected.value && jm();
|
|
8902
8923
|
}, 3e4);
|
|
8903
|
-
},
|
|
8924
|
+
}, Nm = async () => {
|
|
8904
8925
|
if (n.value) {
|
|
8905
8926
|
if (!navigator.onLine) {
|
|
8906
8927
|
console.log("[SipJs] Skipping reconnect, device is offline");
|
|
@@ -8912,25 +8933,25 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8912
8933
|
}
|
|
8913
8934
|
try {
|
|
8914
8935
|
if (n.value.isConnected() || (console.log("[SipJs] Reconnecting..."), await n.value.reconnect()), i.value && n.value.isConnected()) try {
|
|
8915
|
-
await
|
|
8936
|
+
await Dm();
|
|
8916
8937
|
} catch {}
|
|
8917
8938
|
} catch (e) {
|
|
8918
8939
|
console.error("[SipJs] Reconnection failed:", e);
|
|
8919
8940
|
}
|
|
8920
8941
|
}
|
|
8921
|
-
},
|
|
8922
|
-
b?.abort(), b = null, x &&= (clearTimeout(x), null), S &&= (clearInterval(S), null), E &&= (clearInterval(E), null), w &&= (clearTimeout(w), null), T = 0
|
|
8942
|
+
}, Pm = async () => {
|
|
8943
|
+
b?.abort(), b = null, x &&= (clearTimeout(x), null), S &&= (clearInterval(S), null), E &&= (clearInterval(E), null), w &&= (clearTimeout(w), null), T = 0, D &&= (clearTimeout(D), null), O = 0, k++;
|
|
8923
8944
|
for (let [e, t] of a.value.entries()) {
|
|
8924
8945
|
let n;
|
|
8925
8946
|
try {
|
|
8926
|
-
await Promise.race([
|
|
8947
|
+
await Promise.race([Rm(e, t), new Promise((e) => {
|
|
8927
8948
|
n = setTimeout(e, 1500);
|
|
8928
8949
|
})]);
|
|
8929
8950
|
} finally {
|
|
8930
8951
|
n && clearTimeout(n);
|
|
8931
8952
|
}
|
|
8932
8953
|
}
|
|
8933
|
-
|
|
8954
|
+
$();
|
|
8934
8955
|
let e = i.value, t = n.value;
|
|
8935
8956
|
if (i.value = null, n.value = null, e) try {
|
|
8936
8957
|
await e.unregister();
|
|
@@ -8942,7 +8963,7 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8942
8963
|
} catch (e) {
|
|
8943
8964
|
console.warn("[SipJs] UserAgent stop failed:", e);
|
|
8944
8965
|
}
|
|
8945
|
-
},
|
|
8966
|
+
}, Fm = (t) => {
|
|
8946
8967
|
console.log("[SipJs] 📞 Llamada entrante recibida"), console.log("[SipJs] Remote Identity URI:", t.remoteIdentity.uri.toString()), console.log("[SipJs] Remote Identity URI user:", t.remoteIdentity.uri.user), console.log("[SipJs] Remote Identity displayName:", t.remoteIdentity.displayName);
|
|
8947
8968
|
let n = e.channels.value.find((e) => e.status === "idle" && !a.value.has(e.id));
|
|
8948
8969
|
if (!n) {
|
|
@@ -8957,21 +8978,21 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8957
8978
|
remoteNumber: s,
|
|
8958
8979
|
remoteDisplayName: t.remoteIdentity.displayName || void 0,
|
|
8959
8980
|
hasVideo: o
|
|
8960
|
-
}),
|
|
8981
|
+
}), _m(t, i, "incoming", s), vm(i, "ringing"), K(), e.setActiveChannelId(i), isAutoAnswerEnabled() && bm(i, t, o), t.stateChange.addListener((n) => {
|
|
8961
8982
|
switch (n) {
|
|
8962
8983
|
case SessionState.Terminated:
|
|
8963
|
-
|
|
8984
|
+
H(i, t);
|
|
8964
8985
|
break;
|
|
8965
8986
|
case SessionState.Established:
|
|
8966
8987
|
if (a.value.get(i) !== t) break;
|
|
8967
8988
|
m.add(i), e.updateChannelState(i, {
|
|
8968
8989
|
status: "connected",
|
|
8969
8990
|
startTime: Date.now()
|
|
8970
|
-
}),
|
|
8991
|
+
}), vm(i, "connected"), e.activeChannelId.value === i && (Q(t), Em(t).then(() => B(t, i))), K();
|
|
8971
8992
|
break;
|
|
8972
8993
|
}
|
|
8973
8994
|
});
|
|
8974
|
-
},
|
|
8995
|
+
}, Im = async (t, i = !1) => {
|
|
8975
8996
|
if (!n.value) return;
|
|
8976
8997
|
let o = e.activeChannelId.value;
|
|
8977
8998
|
if (a.value.has(o)) return;
|
|
@@ -8982,21 +9003,21 @@ const RECOVERY_DELAYS_MS = [
|
|
|
8982
9003
|
}
|
|
8983
9004
|
if (!s) return;
|
|
8984
9005
|
let l = new Inviter(n.value, s, { earlyMedia: _ });
|
|
8985
|
-
a.value.set(o, l),
|
|
9006
|
+
a.value.set(o, l), _m(l, o, "outgoing", t), vm(o, "dialing"), e.updateChannelState(o, {
|
|
8986
9007
|
status: "calling",
|
|
8987
9008
|
remoteNumber: t,
|
|
8988
9009
|
hasVideo: i
|
|
8989
|
-
}), e.setLastDialedNumber(t),
|
|
9010
|
+
}), e.setLastDialedNumber(t), K(), l.stateChange.addListener((t) => {
|
|
8990
9011
|
switch (t) {
|
|
8991
9012
|
case SessionState.Established:
|
|
8992
9013
|
if (a.value.get(o) !== l) break;
|
|
8993
9014
|
m.add(o), e.channels.value.find((e) => e.id === o)?.status !== "connected" && (e.updateChannelState(o, {
|
|
8994
9015
|
status: "connected",
|
|
8995
9016
|
startTime: Date.now()
|
|
8996
|
-
}),
|
|
9017
|
+
}), vm(o, "connected"), Q(l), Em(l).then(() => B(l, o)), K());
|
|
8997
9018
|
break;
|
|
8998
9019
|
case SessionState.Terminated:
|
|
8999
|
-
|
|
9020
|
+
H(o, l);
|
|
9000
9021
|
break;
|
|
9001
9022
|
}
|
|
9002
9023
|
});
|
|
@@ -9004,30 +9025,30 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9004
9025
|
sessionDescriptionHandlerOptions: { constraints: Y(i) },
|
|
9005
9026
|
requestDelegate: {
|
|
9006
9027
|
onProgress: (t) => {
|
|
9007
|
-
a.value.get(o) === l && (t.message.statusCode === 180 || t.message.statusCode === 183) && (t.message.body && (e.updateChannelState(o, { hasEarlyMedia: !0 }),
|
|
9028
|
+
a.value.get(o) === l && (t.message.statusCode === 180 || t.message.statusCode === 183) && (t.message.body && (e.updateChannelState(o, { hasEarlyMedia: !0 }), Q(l)), K());
|
|
9008
9029
|
},
|
|
9009
9030
|
onAccept: (t) => {
|
|
9010
9031
|
a.value.get(o) === l && e.channels.value.find((e) => e.id === o)?.status !== "connected" && (m.add(o), e.updateChannelState(o, {
|
|
9011
9032
|
status: "connected",
|
|
9012
9033
|
startTime: Date.now()
|
|
9013
|
-
}),
|
|
9034
|
+
}), vm(o, "connected"), Q(l), Em(l).then(() => B(l, o)), K());
|
|
9014
9035
|
}
|
|
9015
9036
|
}
|
|
9016
9037
|
};
|
|
9017
9038
|
try {
|
|
9018
9039
|
await l.invite(u);
|
|
9019
9040
|
} catch (e) {
|
|
9020
|
-
throw
|
|
9041
|
+
throw H(o, l), e;
|
|
9021
9042
|
}
|
|
9022
|
-
},
|
|
9043
|
+
}, Lm = async (t = !1) => {
|
|
9023
9044
|
let n = e.activeChannelId.value, i = a.value.get(n);
|
|
9024
9045
|
if (i instanceof Invitation && i.state === SessionState.Initial) {
|
|
9025
|
-
|
|
9046
|
+
M(), e.updateChannelState(n, {
|
|
9026
9047
|
status: "connected",
|
|
9027
9048
|
startTime: Date.now()
|
|
9028
|
-
}),
|
|
9049
|
+
}), K();
|
|
9029
9050
|
for (let [t, n] of a.value.entries()) if (t !== e.activeChannelId.value && n.state === SessionState.Established && !e.channels.value.find((e) => e.id === t)?.isHeld) try {
|
|
9030
|
-
await
|
|
9051
|
+
await Z(n, !0), e.updateChannelState(t, { isHeld: !0 });
|
|
9031
9052
|
} catch (e) {
|
|
9032
9053
|
console.error(`[SipJs] Failed to hold channel ${t}:`, e);
|
|
9033
9054
|
}
|
|
@@ -9036,17 +9057,17 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9036
9057
|
iceGatheringTimeout: 1e3
|
|
9037
9058
|
} };
|
|
9038
9059
|
try {
|
|
9039
|
-
await i.accept(o),
|
|
9060
|
+
await i.accept(o), K();
|
|
9040
9061
|
} catch (t) {
|
|
9041
9062
|
let i = a.value.get(n);
|
|
9042
9063
|
throw i instanceof Invitation && i.state === SessionState.Initial && (e.updateChannelState(n, {
|
|
9043
9064
|
status: "incoming",
|
|
9044
9065
|
startTime: void 0
|
|
9045
|
-
}),
|
|
9066
|
+
}), K()), t;
|
|
9046
9067
|
}
|
|
9047
9068
|
}
|
|
9048
|
-
},
|
|
9049
|
-
|
|
9069
|
+
}, Rm = async (e, t) => {
|
|
9070
|
+
ym(e, t);
|
|
9050
9071
|
try {
|
|
9051
9072
|
switch (t.state) {
|
|
9052
9073
|
case SessionState.Initial:
|
|
@@ -9060,40 +9081,40 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9060
9081
|
} catch (e) {
|
|
9061
9082
|
console.warn("[SipJs] Hangup signaling failed:", e);
|
|
9062
9083
|
} finally {
|
|
9063
|
-
|
|
9084
|
+
W(t), H(e, t);
|
|
9064
9085
|
}
|
|
9065
|
-
},
|
|
9086
|
+
}, zm = async () => {
|
|
9066
9087
|
let t = e.activeChannelId.value, n = a.value.get(t);
|
|
9067
|
-
n && await
|
|
9068
|
-
},
|
|
9088
|
+
n && await Rm(t, n);
|
|
9089
|
+
}, Bm = () => {
|
|
9069
9090
|
let t = a.value.get(e.activeChannelId.value);
|
|
9070
9091
|
if (!t) return;
|
|
9071
9092
|
let n = !e.isMuted.value;
|
|
9072
|
-
e.setMuted(n),
|
|
9073
|
-
},
|
|
9093
|
+
e.setMuted(n), wm(t, e.channels.value.find((t) => t.id === e.activeChannelId.value));
|
|
9094
|
+
}, Z = async (e, t) => {
|
|
9074
9095
|
let n = { sessionDescriptionHandlerOptions: { hold: t } };
|
|
9075
9096
|
await e.invite(n);
|
|
9076
|
-
},
|
|
9097
|
+
}, Vm = async () => {
|
|
9077
9098
|
let t = a.value.get(e.activeChannelId.value);
|
|
9078
9099
|
if (t?.state !== SessionState.Established) return;
|
|
9079
9100
|
let n = !e.isHeld.value;
|
|
9080
9101
|
try {
|
|
9081
|
-
await
|
|
9102
|
+
await Z(t, n), e.setHeld(n), wm(t, e.channels.value.find((t) => t.id === e.activeChannelId.value));
|
|
9082
9103
|
} catch {}
|
|
9083
|
-
},
|
|
9104
|
+
}, Hm = async (t) => {
|
|
9084
9105
|
let n = e.activeChannelId.value;
|
|
9085
9106
|
if (n === t) return;
|
|
9086
9107
|
let i = a.value.get(n), o = a.value.get(t), s = e.channels.value.find((e) => e.id === n), l = e.channels.value.find((e) => e.id === t);
|
|
9087
9108
|
if (i && i.state === SessionState.Established && !s?.isHeld) try {
|
|
9088
|
-
await
|
|
9109
|
+
await Z(i, !0), e.updateChannelState(n, { isHeld: !0 }), wm(i, e.channels.value.find((e) => e.id === n));
|
|
9089
9110
|
} catch {}
|
|
9090
|
-
if (e.setActiveChannelId(t),
|
|
9111
|
+
if (e.setActiveChannelId(t), K(), o && o.state === SessionState.Established) {
|
|
9091
9112
|
if (l?.isHeld) try {
|
|
9092
|
-
await
|
|
9113
|
+
await Z(o, !1), e.updateChannelState(t, { isHeld: !1 });
|
|
9093
9114
|
} catch {}
|
|
9094
|
-
|
|
9095
|
-
} else
|
|
9096
|
-
},
|
|
9115
|
+
wm(o, e.channels.value.find((e) => e.id === t)), Q(o);
|
|
9116
|
+
} else $();
|
|
9117
|
+
}, Um = (t) => {
|
|
9097
9118
|
if (!/^[0-9*#]$/.test(t)) return;
|
|
9098
9119
|
let n = a.value.get(e.activeChannelId.value);
|
|
9099
9120
|
if (n?.state !== SessionState.Established) return;
|
|
@@ -9108,10 +9129,10 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9108
9129
|
contentDisposition: "signal"
|
|
9109
9130
|
} } };
|
|
9110
9131
|
n.info(o);
|
|
9111
|
-
},
|
|
9132
|
+
}, Wm = (t, n) => {
|
|
9112
9133
|
let i = e.channels.value.find((e) => e.id === t);
|
|
9113
|
-
!i || i.status !== "connected" || (
|
|
9114
|
-
},
|
|
9134
|
+
!i || i.status !== "connected" || (Q(n), wm(n, i), Em(n), o.play().catch(() => {}));
|
|
9135
|
+
}, Gm = async (t) => {
|
|
9115
9136
|
console.log("[SipJs] 🔄 transferCall iniciado"), console.log("[SipJs] Target:", t);
|
|
9116
9137
|
let i = e.activeChannelId.value, o = a.value.get(i);
|
|
9117
9138
|
if (!o) throw console.error("[SipJs] ❌ No hay sesión activa en el canal", i), Error("No active session to transfer");
|
|
@@ -9131,7 +9152,7 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9131
9152
|
},
|
|
9132
9153
|
onReject: (e) => {
|
|
9133
9154
|
let t = e.message.statusCode;
|
|
9134
|
-
console.error("[SipJs] ❌ Transfer REFER rechazado:", t), console.error("[SipJs] Response completo:", e.message),
|
|
9155
|
+
console.error("[SipJs] ❌ Transfer REFER rechazado:", t), console.error("[SipJs] Response completo:", e.message), Wm(i, o);
|
|
9135
9156
|
}
|
|
9136
9157
|
},
|
|
9137
9158
|
onNotify: (e) => {
|
|
@@ -9154,7 +9175,7 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9154
9175
|
487: "Transferencia cancelada",
|
|
9155
9176
|
503: "Servicio no disponible - el destino puede estar fuera de línea"
|
|
9156
9177
|
}[t] || `Error en transferencia (código ${t})`;
|
|
9157
|
-
console.warn("[SipJs] 💬", e),
|
|
9178
|
+
console.warn("[SipJs] 💬", e), Wm(i, o);
|
|
9158
9179
|
} else t >= 100 && t < 200 && console.log("[SipJs] 📞 Transferencia en progreso:", t, n);
|
|
9159
9180
|
} else console.warn("[SipJs] ⚠️ No se pudo extraer el código de estado del NOTIFY body");
|
|
9160
9181
|
} else console.warn("[SipJs] ⚠️ NOTIFY sin body");
|
|
@@ -9163,28 +9184,28 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9163
9184
|
} catch (e) {
|
|
9164
9185
|
throw console.error("[SipJs] ❌ Error en transferCall:", e), console.error("[SipJs] Error type:", e?.constructor?.name), console.error("[SipJs] Error message:", e instanceof Error ? e.message : String(e)), console.error("[SipJs] Error stack:", e instanceof Error ? e.stack : "N/A"), e;
|
|
9165
9186
|
}
|
|
9166
|
-
},
|
|
9187
|
+
}, Km = async (t) => {
|
|
9167
9188
|
console.log("[SipJs] 🔄 startAttendedTransfer iniciado"), console.log("[SipJs] Target:", t);
|
|
9168
9189
|
let n = e.activeChannelId.value, i = a.value.get(n);
|
|
9169
9190
|
if (console.log("[SipJs] Canal original:", n), console.log("[SipJs] Sesión original:", i?.state), !i || i.state !== SessionState.Established) throw console.error("[SipJs] ❌ No hay llamada establecida para transferir"), Error("No established call to transfer");
|
|
9170
9191
|
let o = e.channels.value.find((e) => e.status === "idle");
|
|
9171
9192
|
if (console.log("[SipJs] Canal de consulta encontrado:", o?.id), !o) throw console.error("[SipJs] ❌ No hay canales disponibles para llamada de consulta"), Error("No available channel for consultation call");
|
|
9172
9193
|
try {
|
|
9173
|
-
console.log("[SipJs] 🔇 Poniendo llamada original en hold..."), await
|
|
9194
|
+
console.log("[SipJs] 🔇 Poniendo llamada original en hold..."), await Z(i, !0), e.updateChannelState(n, { isHeld: !0 }), console.log("[SipJs] ✅ Llamada original en hold");
|
|
9174
9195
|
} catch (e) {
|
|
9175
9196
|
throw console.error("[SipJs] ❌ Failed to hold original call:", e), Error("Failed to put call on hold");
|
|
9176
9197
|
}
|
|
9177
9198
|
console.log("[SipJs] 🔄 Cambiando al canal de consulta:", o.id), e.setActiveChannelId(o.id);
|
|
9178
9199
|
try {
|
|
9179
|
-
console.log("[SipJs] 📞 Iniciando llamada de consulta a:", t), await
|
|
9200
|
+
console.log("[SipJs] 📞 Iniciando llamada de consulta a:", t), await Im(t, !1), console.log("[SipJs] ✅ Llamada de consulta iniciada"), e.setTransferInProgress({
|
|
9180
9201
|
originalChannelId: n,
|
|
9181
9202
|
consultationChannelId: o.id,
|
|
9182
9203
|
targetNumber: t
|
|
9183
9204
|
}), console.log("[SipJs] 📋 Transferencia en progreso registrada");
|
|
9184
9205
|
} catch (t) {
|
|
9185
|
-
throw console.error("[SipJs] ❌ Failed to start consultation call:", t), console.log("[SipJs] 🔄 Volviendo al canal original y quitando hold..."), e.setActiveChannelId(n), await
|
|
9206
|
+
throw console.error("[SipJs] ❌ Failed to start consultation call:", t), console.log("[SipJs] 🔄 Volviendo al canal original y quitando hold..."), e.setActiveChannelId(n), await Z(i, !1).catch(() => {}), e.updateChannelState(n, { isHeld: !1 }), Error("Failed to initiate consultation call");
|
|
9186
9207
|
}
|
|
9187
|
-
},
|
|
9208
|
+
}, qm = async () => {
|
|
9188
9209
|
console.log("[SipJs] 🔄 completeAttendedTransfer iniciado");
|
|
9189
9210
|
let t = e.transferInProgress.value;
|
|
9190
9211
|
if (!t) throw console.error("[SipJs] ❌ No hay transferencia en progreso"), Error("No transfer in progress");
|
|
@@ -9212,7 +9233,7 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9212
9233
|
if (n && n[1]) {
|
|
9213
9234
|
let a = parseInt(n[1]);
|
|
9214
9235
|
a >= 200 && a < 300 ? setTimeout(() => {
|
|
9215
|
-
|
|
9236
|
+
Rm(t.originalChannelId, i), Rm(t.consultationChannelId, o), e.setTransferInProgress(null);
|
|
9216
9237
|
}, 500) : a >= 400 && (console.error("[SipJs] Attended transfer failed with status:", a), e.setTransferInProgress(null));
|
|
9217
9238
|
}
|
|
9218
9239
|
}
|
|
@@ -9227,23 +9248,23 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9227
9248
|
} catch (e) {
|
|
9228
9249
|
throw console.error("[SipJs] Attended transfer failed:", e), e;
|
|
9229
9250
|
}
|
|
9230
|
-
},
|
|
9251
|
+
}, Jm = async () => {
|
|
9231
9252
|
let t = e.transferInProgress.value;
|
|
9232
9253
|
if (!t) throw Error("No transfer in progress");
|
|
9233
9254
|
console.log("[SipJs] Canceling attended transfer...");
|
|
9234
9255
|
let n = a.value.get(t.originalChannelId), i = a.value.get(t.consultationChannelId);
|
|
9235
9256
|
if (i) try {
|
|
9236
|
-
await
|
|
9257
|
+
await Rm(t.consultationChannelId, i), console.log("[SipJs] Consultation call ended");
|
|
9237
9258
|
} catch (e) {
|
|
9238
9259
|
console.warn("[SipJs] Error ending consultation:", e);
|
|
9239
9260
|
}
|
|
9240
9261
|
if (n) try {
|
|
9241
|
-
e.setActiveChannelId(t.originalChannelId), await
|
|
9262
|
+
e.setActiveChannelId(t.originalChannelId), await Z(n, !1), e.updateChannelState(t.originalChannelId, { isHeld: !1 }), console.log("[SipJs] Returned to original call");
|
|
9242
9263
|
} catch (e) {
|
|
9243
9264
|
console.warn("[SipJs] Error resuming original call:", e);
|
|
9244
9265
|
}
|
|
9245
9266
|
e.setTransferInProgress(null);
|
|
9246
|
-
},
|
|
9267
|
+
}, Q = (e) => {
|
|
9247
9268
|
let t = e.sessionDescriptionHandler;
|
|
9248
9269
|
if (!t) {
|
|
9249
9270
|
console.error("[SipJs] setupRemoteMedia: no sessionDescriptionHandler");
|
|
@@ -9256,8 +9277,8 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9256
9277
|
}
|
|
9257
9278
|
if (u.value === n) return;
|
|
9258
9279
|
o.pause(), o.srcObject = null, v?.abort(), v = new AbortController(), u.value = n, d.value = t.localMediaStream ?? null;
|
|
9259
|
-
let i =
|
|
9260
|
-
|
|
9280
|
+
let i = Tm(e);
|
|
9281
|
+
wm(e, i), i && B(e, i.id);
|
|
9261
9282
|
let a = (e) => {
|
|
9262
9283
|
y?.abort(), y = new AbortController();
|
|
9263
9284
|
let { signal: t } = y, n = () => {
|
|
@@ -9274,30 +9295,30 @@ const RECOVERY_DELAYS_MS = [
|
|
|
9274
9295
|
}, { signal: v.signal });
|
|
9275
9296
|
let [s] = n.getTracks();
|
|
9276
9297
|
s && (o.srcObject = n, a(s), i && B(e, i.id));
|
|
9277
|
-
},
|
|
9298
|
+
}, $ = () => {
|
|
9278
9299
|
y?.abort(), y = null, v?.abort(), v = null, o.pause(), o.srcObject = null, u.value = null, d.value = null;
|
|
9279
9300
|
};
|
|
9280
9301
|
return {
|
|
9281
|
-
initUserAgent:
|
|
9282
|
-
stop:
|
|
9283
|
-
makeCall:
|
|
9284
|
-
answerCall:
|
|
9285
|
-
hangupCall:
|
|
9286
|
-
toggleMute:
|
|
9287
|
-
toggleHold:
|
|
9288
|
-
sendDTMF:
|
|
9289
|
-
transferCall:
|
|
9290
|
-
startAttendedTransfer:
|
|
9291
|
-
completeAttendedTransfer:
|
|
9292
|
-
cancelAttendedTransfer:
|
|
9293
|
-
switchChannel:
|
|
9294
|
-
extension:
|
|
9295
|
-
setVolume:
|
|
9296
|
-
setNotificationVolume:
|
|
9297
|
-
setRingtoneVolume:
|
|
9298
|
-
setRingtoneTone:
|
|
9299
|
-
setOutputDevice:
|
|
9300
|
-
setInputDevice:
|
|
9302
|
+
initUserAgent: Om,
|
|
9303
|
+
stop: Pm,
|
|
9304
|
+
makeCall: Im,
|
|
9305
|
+
answerCall: Lm,
|
|
9306
|
+
hangupCall: zm,
|
|
9307
|
+
toggleMute: Bm,
|
|
9308
|
+
toggleHold: Vm,
|
|
9309
|
+
sendDTMF: Um,
|
|
9310
|
+
transferCall: Gm,
|
|
9311
|
+
startAttendedTransfer: Km,
|
|
9312
|
+
completeAttendedTransfer: qm,
|
|
9313
|
+
cancelAttendedTransfer: Jm,
|
|
9314
|
+
switchChannel: Hm,
|
|
9315
|
+
extension: A,
|
|
9316
|
+
setVolume: xm,
|
|
9317
|
+
setNotificationVolume: I,
|
|
9318
|
+
setRingtoneVolume: L,
|
|
9319
|
+
setRingtoneTone: gm,
|
|
9320
|
+
setOutputDevice: q,
|
|
9321
|
+
setInputDevice: J,
|
|
9301
9322
|
remoteStream: u,
|
|
9302
9323
|
localStream: d
|
|
9303
9324
|
};
|
|
@@ -16363,19 +16384,19 @@ var IconDelete_default = { render: render$1 }, _hoisted_1$7 = ["data-call-status
|
|
|
16363
16384
|
p(e);
|
|
16364
16385
|
}, L = async () => {
|
|
16365
16386
|
await o(), await D.onHangup?.();
|
|
16366
|
-
},
|
|
16387
|
+
}, R = () => {
|
|
16367
16388
|
if (D.onReject) {
|
|
16368
16389
|
D.onReject();
|
|
16369
16390
|
return;
|
|
16370
16391
|
}
|
|
16371
16392
|
o();
|
|
16372
|
-
},
|
|
16393
|
+
}, z = computed(() => {
|
|
16373
16394
|
let e = {};
|
|
16374
16395
|
return i.channels.forEach((t) => {
|
|
16375
16396
|
let n = t.status === "connected" || t.status === "calling" || t.status === "incoming";
|
|
16376
16397
|
e[t.id] = n ? "wp:text-[var(--color-red)]" : "wp:text-[var(--color-avaible)]";
|
|
16377
16398
|
}), e;
|
|
16378
|
-
}),
|
|
16399
|
+
}), _m = computed(() => z.value[i.activeChannelId] ?? "wp:text-[var(--p-primary-color)]");
|
|
16379
16400
|
return (e, t) => (openBlock(), createElementBlock("div", {
|
|
16380
16401
|
class: "webphone-actions wp:flex wp:justify-center wp:items-center wp:gap-2 wp:px-4 wp:relative wp:mb-4",
|
|
16381
16402
|
"data-call-status": unref(i).callStatus
|
|
@@ -16398,7 +16419,7 @@ var IconDelete_default = { render: render$1 }, _hoisted_1$7 = ["data-call-status
|
|
|
16398
16419
|
"aria-label": "Video Call",
|
|
16399
16420
|
class: "webphone-actions__button webphone-actions__button--video wp:w-full wp:px-4 wp:bg-transparent wp:border wp:border-primary wp:hover:bg-[var(--p-primary-color)]/8"
|
|
16400
16421
|
}, {
|
|
16401
|
-
default: withCtx(() => [createVNode(unref(videocall_icon_default), { class: normalizeClass(["webphone-actions__button-icon wp:size-6 wp:text-primary wp:dark:text-white",
|
|
16422
|
+
default: withCtx(() => [createVNode(unref(videocall_icon_default), { class: normalizeClass(["webphone-actions__button-icon wp:size-6 wp:text-primary wp:dark:text-white", _m.value]) }, null, 8, ["class"]), t[13] ||= createElementVNode("span", { class: "webphone-actions__button-label wp:w-full wp:text-primary wp:text-xs wp:dark:text-white" }, " Video llamada a extensiones ", -1)]),
|
|
16402
16423
|
_: 1
|
|
16403
16424
|
})) : createCommentVNode("", !0)])) : createCommentVNode("", !0),
|
|
16404
16425
|
unref(i).callStatus === "incoming" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
@@ -16426,7 +16447,7 @@ var IconDelete_default = { render: render$1 }, _hoisted_1$7 = ["data-call-status
|
|
|
16426
16447
|
createVNode(unref(Button_default), {
|
|
16427
16448
|
variant: "destructive",
|
|
16428
16449
|
size: "icon",
|
|
16429
|
-
onClick:
|
|
16450
|
+
onClick: R,
|
|
16430
16451
|
"aria-label": "Reject",
|
|
16431
16452
|
class: "webphone-actions__button webphone-actions__button--hangup webphone-actions__button--reject wp:w-12 wp:h-12 wp:rounded-full wp:border-0 wp:bg-gradient-to-r wp:from-destructive/60 wp:to-destructive/90 wp:hover:from-destructive/70 wp:hover:to-destructive/95"
|
|
16432
16453
|
}, {
|
|
@@ -16795,12 +16816,12 @@ var icon_phone_default = { render }, Tooltip_default = /* @__PURE__ */ defineCom
|
|
|
16795
16816
|
useIntervalFn(() => {
|
|
16796
16817
|
L.value = Date.now();
|
|
16797
16818
|
}, 1e3);
|
|
16798
|
-
let
|
|
16819
|
+
let R = computed(() => {
|
|
16799
16820
|
let e = p.value?.startTime, t = p.value?.status || "idle";
|
|
16800
16821
|
if (!e || t !== "connected") return "00:00:00";
|
|
16801
16822
|
let n = Math.floor((L.value - e) / 1e3);
|
|
16802
16823
|
return n < 0 ? "00:00:00" : `${Math.floor(n / 3600).toString().padStart(2, "0")}:${Math.floor(n % 3600 / 60).toString().padStart(2, "0")}:${(n % 60).toString().padStart(2, "0")}`;
|
|
16803
|
-
}),
|
|
16824
|
+
}), z = computed(() => {
|
|
16804
16825
|
if (!o.isOnline) return "Sin internet";
|
|
16805
16826
|
if (!t.isConnected) return "Sin conexión";
|
|
16806
16827
|
let e = p.value, n = e?.status || "idle";
|
|
@@ -16811,16 +16832,16 @@ var icon_phone_default = { render }, Tooltip_default = /* @__PURE__ */ defineCom
|
|
|
16811
16832
|
return `En espera - ${o.maskNumber ? maskPhoneNumber(t, o.extensions) : t}`;
|
|
16812
16833
|
}
|
|
16813
16834
|
return n === "connected" ? "Conectado" : n.charAt(0).toUpperCase() + n.slice(1);
|
|
16814
|
-
}),
|
|
16835
|
+
}), B = (e) => {
|
|
16815
16836
|
if (!e) return "";
|
|
16816
16837
|
let t = e.trim(), n = t.startsWith("+"), i = t.replace(/[^\d]/g, "");
|
|
16817
16838
|
return n ? `+${i}` : i;
|
|
16818
|
-
},
|
|
16839
|
+
}, V = (e) => /\d/.test(e) && /^[+\d\s().*#-]+$/.test(e.trim()), H = computed(() => {
|
|
16819
16840
|
let e = p.value, t = e?.remoteNumber || e?.keypadValue, n = e?.remoteDisplayName;
|
|
16820
16841
|
if (!t) return "Unknown";
|
|
16821
|
-
let i =
|
|
16822
|
-
return a ? o.maskNumber &&
|
|
16823
|
-
}),
|
|
16842
|
+
let i = B(t), a = o.contacts?.find((e) => B(e.number) === i);
|
|
16843
|
+
return a ? o.maskNumber && V(a.name) ? maskPhoneNumber(a.name, o.extensions) : a.name : n && n !== t ? o.maskNumber && V(n) ? B(n) === i ? maskPhoneNumber(t, o.extensions) : maskPhoneNumber(n, o.extensions) : n : o.maskNumber ? maskPhoneNumber(t, o.extensions) : t;
|
|
16844
|
+
}), U = computed(() => {
|
|
16824
16845
|
let e = p.value, t = e?.remoteNumber || e?.keypadValue || "";
|
|
16825
16846
|
return o.maskNumber ? maskPhoneNumber(t, o.extensions) : t;
|
|
16826
16847
|
});
|
|
@@ -16831,11 +16852,11 @@ var icon_phone_default = { render }, Tooltip_default = /* @__PURE__ */ defineCom
|
|
|
16831
16852
|
(p.value?.status || "idle") === "connected" ? (openBlock(), createElementBlock("div", {
|
|
16832
16853
|
key: 0,
|
|
16833
16854
|
class: normalizeClass([_.value, "webphone-display__connected-status wp:w-full wp:flex wp:items-center wp:justify-between wp:gap-2 wp:text-3xl wp:font-light wp:mb-5"])
|
|
16834
|
-
}, [createElementVNode("div", _hoisted_2$4, [createVNode(unref(icon_phone_default), { class: "webphone-display__connected-status-icon wp:w-4 wp:h-4" }), i[3] ||= createElementVNode("span", { class: "webphone-display__connected-status-text wp:text-sm wp:montserrat wp:font-medium" }, "En llamada", -1)]), createElementVNode("span", _hoisted_3$4, toDisplayString(
|
|
16855
|
+
}, [createElementVNode("div", _hoisted_2$4, [createVNode(unref(icon_phone_default), { class: "webphone-display__connected-status-icon wp:w-4 wp:h-4" }), i[3] ||= createElementVNode("span", { class: "webphone-display__connected-status-text wp:text-sm wp:montserrat wp:font-medium" }, "En llamada", -1)]), createElementVNode("span", _hoisted_3$4, toDisplayString(R.value), 1)], 2)) : createCommentVNode("", !0),
|
|
16835
16856
|
o.user ? (openBlock(), createElementBlock("span", {
|
|
16836
16857
|
key: 1,
|
|
16837
16858
|
class: normalizeClass([_.value, "webphone-display__user wp:font-bold wp:text-lg wp:flex wp:items-center wp:gap-1 wp:transition-colors wp:duration-300"])
|
|
16838
|
-
}, [createElementVNode("div", _hoisted_4$4, [createVNode(unref(icon_phone_default), { class: "webphone-display__user-icon wp:size-6 wp:shrink-0 montserrat" }), createTextVNode(" " + toDisplayString(o.user), 1)]), createElementVNode("div", { class: normalizeClass(["webphone-display__status-text wp:font-semibold wp:tracking-wider wp:text-sm wp:text-[var(--color-primary)] montserrat", _.value]) }, toDisplayString(
|
|
16859
|
+
}, [createElementVNode("div", _hoisted_4$4, [createVNode(unref(icon_phone_default), { class: "webphone-display__user-icon wp:size-6 wp:shrink-0 montserrat" }), createTextVNode(" " + toDisplayString(o.user), 1)]), createElementVNode("div", { class: normalizeClass(["webphone-display__status-text wp:font-semibold wp:tracking-wider wp:text-sm wp:text-[var(--color-primary)] montserrat", _.value]) }, toDisplayString(z.value), 3)], 2)) : createCommentVNode("", !0),
|
|
16839
16860
|
(p.value?.status || "idle") === "idle" && o.allowInput ? (openBlock(), createElementBlock("div", _hoisted_5$4, [createElementVNode("div", {
|
|
16840
16861
|
class: "webphone-display__dialer-container wp:relative wp:w-full wp:max-w-80",
|
|
16841
16862
|
ref_key: "containerRef",
|
|
@@ -16917,7 +16938,7 @@ var icon_phone_default = { render }, Tooltip_default = /* @__PURE__ */ defineCom
|
|
|
16917
16938
|
})) : (openBlock(), createBlock(unref(CircleUser), {
|
|
16918
16939
|
key: 4,
|
|
16919
16940
|
class: "wp:w-3 wp:h-3"
|
|
16920
|
-
}))], 2), createElementVNode("div", _hoisted_9$4, [createElementVNode("span", _hoisted_10$3, toDisplayString(e.name), 1), createElementVNode("span", _hoisted_11$3, toDisplayString(O(e)), 1)])], 40, _hoisted_8$4))), 128))], 512), [[vShow, v.value && E.value && (k.value.length > 0 || D.value)]])], 512)])) : (p.value?.status || "idle") === "connected" ? (openBlock(), createElementBlock("div", _hoisted_12$3, [createElementVNode("div", _hoisted_13$2, [createElementVNode("div", _hoisted_14$2, " En llamada con " + toDisplayString(
|
|
16941
|
+
}))], 2), createElementVNode("div", _hoisted_9$4, [createElementVNode("span", _hoisted_10$3, toDisplayString(e.name), 1), createElementVNode("span", _hoisted_11$3, toDisplayString(O(e)), 1)])], 40, _hoisted_8$4))), 128))], 512), [[vShow, v.value && E.value && (k.value.length > 0 || D.value)]])], 512)])) : (p.value?.status || "idle") === "connected" ? (openBlock(), createElementBlock("div", _hoisted_12$3, [createElementVNode("div", _hoisted_13$2, [createElementVNode("div", _hoisted_14$2, " En llamada con " + toDisplayString(H.value), 1), H.value === U.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_15$2, toDisplayString(U.value), 1))])])) : (p.value?.status || "idle") === "idle" ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16$1, [createElementVNode("div", _hoisted_17$1, [createElementVNode("div", _hoisted_18$1, [createElementVNode("div", _hoisted_19$1, toDisplayString(H.value), 1), H.value === U.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_20$1, toDisplayString(U.value), 1))]), createVNode(unref(TooltipProvider_default), null, {
|
|
16921
16942
|
default: withCtx(() => [createVNode(unref(Tooltip_default), null, {
|
|
16922
16943
|
default: withCtx(() => [createVNode(unref(TooltipTrigger_default), { "as-child": "" }), createVNode(unref(TooltipContent_default), { class: "wp:flex wp:items-center wp:gap-2" }, {
|
|
16923
16944
|
default: withCtx(() => [createElementVNode("span", null, toDisplayString(unref(t).isKeypadVisible ? "Ocultar" : "Mostrar") + " teclado", 1), createVNode(unref(Kbd_default), null, {
|
|
@@ -17431,7 +17452,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17431
17452
|
classic: "original",
|
|
17432
17453
|
"original-loud": "aurora",
|
|
17433
17454
|
"original-intense": "resonancia"
|
|
17434
|
-
},
|
|
17455
|
+
}, R = async () => {
|
|
17435
17456
|
try {
|
|
17436
17457
|
await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
17437
17458
|
let e = await navigator.mediaDevices.enumerateDevices();
|
|
@@ -17449,34 +17470,34 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17449
17470
|
} catch (e) {
|
|
17450
17471
|
console.error("Error loading devices", e);
|
|
17451
17472
|
}
|
|
17452
|
-
},
|
|
17473
|
+
}, z = (e) => {
|
|
17453
17474
|
let t = String(e);
|
|
17454
17475
|
D.value = t, v(t);
|
|
17455
|
-
},
|
|
17476
|
+
}, B = (e) => {
|
|
17456
17477
|
let t = String(e);
|
|
17457
17478
|
O.value = t, _(t);
|
|
17458
|
-
},
|
|
17479
|
+
}, V = (e, t = 35) => e.length <= t ? e : e.substring(0, t) + "...", H = computed({
|
|
17459
17480
|
get: () => [k.value],
|
|
17460
17481
|
set: (e) => {
|
|
17461
17482
|
k.value = e[0], p(k.value);
|
|
17462
17483
|
}
|
|
17463
|
-
}),
|
|
17484
|
+
}), U = computed({
|
|
17464
17485
|
get: () => [j.value],
|
|
17465
17486
|
set: (e) => {
|
|
17466
17487
|
j.value = e[0], y(j.value);
|
|
17467
17488
|
}
|
|
17468
|
-
}),
|
|
17489
|
+
}), W = computed({
|
|
17469
17490
|
get: () => [N.value],
|
|
17470
17491
|
set: (e) => {
|
|
17471
17492
|
N.value = e[0] ?? 100, b(N.value);
|
|
17472
17493
|
}
|
|
17473
|
-
}),
|
|
17494
|
+
}), G = (e) => {
|
|
17474
17495
|
F.value = String(e), x(F.value);
|
|
17475
|
-
},
|
|
17496
|
+
}, K = (e) => {
|
|
17476
17497
|
I.value = e;
|
|
17477
17498
|
};
|
|
17478
17499
|
return onMounted(() => {
|
|
17479
|
-
|
|
17500
|
+
R(), p(k.value), y(j.value), b(N.value), localStorage.removeItem("webphone-custom-ringtone");
|
|
17480
17501
|
let e = L[F.value] ?? F.value;
|
|
17481
17502
|
F.value = [
|
|
17482
17503
|
"original",
|
|
@@ -17503,7 +17524,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17503
17524
|
_: 1
|
|
17504
17525
|
}), createVNode(unref(Select_default), {
|
|
17505
17526
|
modelValue: unref(D),
|
|
17506
|
-
"onUpdate:modelValue": [o[0] ||= (e) => isRef(D) ? D.value = e : null,
|
|
17527
|
+
"onUpdate:modelValue": [o[0] ||= (e) => isRef(D) ? D.value = e : null, z]
|
|
17507
17528
|
}, {
|
|
17508
17529
|
default: withCtx(() => [createVNode(unref(SelectTrigger_default), { class: "wp:w-full" }, {
|
|
17509
17530
|
default: withCtx(() => [createVNode(unref(SelectValue_default), { placeholder: "Select Microphone" })]),
|
|
@@ -17515,7 +17536,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17515
17536
|
value: e.deviceId,
|
|
17516
17537
|
title: e.label
|
|
17517
17538
|
}, {
|
|
17518
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
17539
|
+
default: withCtx(() => [createTextVNode(toDisplayString(V(e.label)), 1)]),
|
|
17519
17540
|
_: 2
|
|
17520
17541
|
}, 1032, ["value", "title"]))), 128))]),
|
|
17521
17542
|
_: 1
|
|
@@ -17529,7 +17550,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17529
17550
|
_: 1
|
|
17530
17551
|
}), createVNode(unref(Select_default), {
|
|
17531
17552
|
modelValue: unref(O),
|
|
17532
|
-
"onUpdate:modelValue": [o[1] ||= (e) => isRef(O) ? O.value = e : null,
|
|
17553
|
+
"onUpdate:modelValue": [o[1] ||= (e) => isRef(O) ? O.value = e : null, B]
|
|
17533
17554
|
}, {
|
|
17534
17555
|
default: withCtx(() => [createVNode(unref(SelectTrigger_default), { class: "wp:w-full" }, {
|
|
17535
17556
|
default: withCtx(() => [createVNode(unref(SelectValue_default), { placeholder: "Select Speaker" })]),
|
|
@@ -17541,7 +17562,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17541
17562
|
value: e.deviceId,
|
|
17542
17563
|
title: e.label
|
|
17543
17564
|
}, {
|
|
17544
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
17565
|
+
default: withCtx(() => [createTextVNode(toDisplayString(V(e.label)), 1)]),
|
|
17545
17566
|
_: 2
|
|
17546
17567
|
}, 1032, ["value", "title"]))), 128))]),
|
|
17547
17568
|
_: 1
|
|
@@ -17554,8 +17575,8 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17554
17575
|
default: withCtx(() => [...o[10] ||= [createTextVNode("Media Volume", -1)]]),
|
|
17555
17576
|
_: 1
|
|
17556
17577
|
}), createElementVNode("span", _hoisted_6$3, toDisplayString(unref(k)) + "%", 1)]), createVNode(unref(Slider_default), {
|
|
17557
|
-
modelValue:
|
|
17558
|
-
"onUpdate:modelValue": o[2] ||= (e) =>
|
|
17578
|
+
modelValue: H.value,
|
|
17579
|
+
"onUpdate:modelValue": o[2] ||= (e) => H.value = e,
|
|
17559
17580
|
max: 100,
|
|
17560
17581
|
step: 1
|
|
17561
17582
|
}, null, 8, ["modelValue"])]),
|
|
@@ -17563,8 +17584,8 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17563
17584
|
default: withCtx(() => [...o[11] ||= [createTextVNode("Notification Volume", -1)]]),
|
|
17564
17585
|
_: 1
|
|
17565
17586
|
}), createElementVNode("span", _hoisted_9$3, toDisplayString(unref(j)) + "%", 1)]), createVNode(unref(Slider_default), {
|
|
17566
|
-
modelValue:
|
|
17567
|
-
"onUpdate:modelValue": o[3] ||= (e) =>
|
|
17587
|
+
modelValue: U.value,
|
|
17588
|
+
"onUpdate:modelValue": o[3] ||= (e) => U.value = e,
|
|
17568
17589
|
max: 100,
|
|
17569
17590
|
step: 1
|
|
17570
17591
|
}, null, 8, ["modelValue"])]),
|
|
@@ -17572,8 +17593,8 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17572
17593
|
default: withCtx(() => [...o[12] ||= [createTextVNode("Volumen del tono", -1)]]),
|
|
17573
17594
|
_: 1
|
|
17574
17595
|
}), createElementVNode("span", _hoisted_12$2, toDisplayString(unref(N)) + "%", 1)]), createVNode(unref(Slider_default), {
|
|
17575
|
-
modelValue:
|
|
17576
|
-
"onUpdate:modelValue": o[4] ||= (e) =>
|
|
17596
|
+
modelValue: W.value,
|
|
17597
|
+
"onUpdate:modelValue": o[4] ||= (e) => W.value = e,
|
|
17577
17598
|
max: 100,
|
|
17578
17599
|
step: 1
|
|
17579
17600
|
}, null, 8, ["modelValue"])]),
|
|
@@ -17582,7 +17603,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17582
17603
|
_: 1
|
|
17583
17604
|
}), createVNode(unref(Select_default), {
|
|
17584
17605
|
"model-value": unref(F),
|
|
17585
|
-
"onUpdate:modelValue":
|
|
17606
|
+
"onUpdate:modelValue": G
|
|
17586
17607
|
}, {
|
|
17587
17608
|
default: withCtx(() => [createVNode(unref(SelectTrigger_default), { class: "wp:w-full" }, {
|
|
17588
17609
|
default: withCtx(() => [createVNode(unref(SelectValue_default), { placeholder: "Seleccionar tono" })]),
|
|
@@ -17621,7 +17642,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
17621
17642
|
"aria-label": unref(I) ? "Desactivar respuesta automática" : "Activar respuesta automática",
|
|
17622
17643
|
class: normalizeClass(["wp:flex wp:h-7 wp:w-12 wp:shrink-0 wp:cursor-pointer wp:items-center wp:justify-start wp:rounded-full wp:border-0 wp:p-0.5 wp:transition-colors wp:focus-visible:ring-2 wp:focus-visible:ring-primary/50"]),
|
|
17623
17644
|
style: normalizeStyle({ backgroundColor: unref(I) ? "var(--color-primary-500)" : "var(--muted)" }),
|
|
17624
|
-
"onUpdate:modelValue":
|
|
17645
|
+
"onUpdate:modelValue": K
|
|
17625
17646
|
}, {
|
|
17626
17647
|
default: withCtx(() => [createElementVNode("span", { class: normalizeClass(["wp:pointer-events-none wp:block wp:h-6 wp:w-6 wp:shrink-0 wp:rounded-full wp:bg-white wp:shadow-sm wp:transition-transform", unref(I) ? "wp:translate-x-5" : "wp:translate-x-0"]) }, null, 2)]),
|
|
17627
17648
|
_: 1
|
|
@@ -18035,14 +18056,14 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18035
18056
|
onMounted(() => {
|
|
18036
18057
|
o.value = "documentPictureInPicture" in window, document.addEventListener("visibilitychange", y), window.addEventListener("blur", b);
|
|
18037
18058
|
}), onUnmounted(() => {
|
|
18038
|
-
document.removeEventListener("visibilitychange", y), window.removeEventListener("blur", b), g &&= (clearTimeout(g), null), S(),
|
|
18059
|
+
document.removeEventListener("visibilitychange", y), window.removeEventListener("blur", b), g &&= (clearTimeout(g), null), S(), R();
|
|
18039
18060
|
});
|
|
18040
18061
|
let _ = () => {
|
|
18041
18062
|
let e = i.callStatus !== "idle", t = document.hidden || !document.hasFocus();
|
|
18042
18063
|
return i.autoOpenOnBlur !== !1 && e && o.value && t && !l.value && !u.value;
|
|
18043
18064
|
}, v = () => {
|
|
18044
18065
|
_() && (g && clearTimeout(g), g = setTimeout(() => {
|
|
18045
|
-
_() &&
|
|
18066
|
+
_() && gm();
|
|
18046
18067
|
}, 120));
|
|
18047
18068
|
}, y = () => {
|
|
18048
18069
|
v();
|
|
@@ -18059,9 +18080,9 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18059
18080
|
return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
|
|
18060
18081
|
};
|
|
18061
18082
|
watch(() => i.callStatus, (e, t) => {
|
|
18062
|
-
e === "connected" && t !== "connected" ? x() : e === "idle" && t !== "idle" && (S(), l.value &&
|
|
18083
|
+
e === "connected" && t !== "connected" ? x() : e === "idle" && t !== "idle" && (S(), l.value && R());
|
|
18063
18084
|
}, { immediate: !0 }), watch(() => i.isConnected, (e) => {
|
|
18064
|
-
!e && l.value && (S(),
|
|
18085
|
+
!e && l.value && (S(), R());
|
|
18065
18086
|
}), watch(() => [
|
|
18066
18087
|
i.callStatus,
|
|
18067
18088
|
i.isMuted,
|
|
@@ -18135,7 +18156,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18135
18156
|
n.className = "pip-btn pip-btn-answer", n.title = "Contestar", n.innerHTML = E.phone, n.onclick = () => a("answer", !1), t.appendChild(n);
|
|
18136
18157
|
let o = e.createElement("button");
|
|
18137
18158
|
o.className = "pip-btn pip-btn-hangup", o.title = "Rechazar", o.innerHTML = E.phoneOff, o.onclick = () => {
|
|
18138
|
-
a("hangup"),
|
|
18159
|
+
a("hangup"), R();
|
|
18139
18160
|
}, t.appendChild(o);
|
|
18140
18161
|
} else if (i.callStatus === "connected") {
|
|
18141
18162
|
let n = e.createElement("button");
|
|
@@ -18146,12 +18167,12 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18146
18167
|
s.className = "pip-btn pip-btn-transfer", s.title = "Transferir", s.innerHTML = E.transfer, s.onclick = () => a("transfer"), t.appendChild(s);
|
|
18147
18168
|
let l = e.createElement("button");
|
|
18148
18169
|
l.className = "pip-btn pip-btn-hangup", l.title = "Colgar", l.innerHTML = E.phoneOff, l.onclick = () => {
|
|
18149
|
-
a("hangup"),
|
|
18170
|
+
a("hangup"), R();
|
|
18150
18171
|
}, t.appendChild(l);
|
|
18151
18172
|
} else if (i.callStatus === "calling") {
|
|
18152
18173
|
let n = e.createElement("button");
|
|
18153
18174
|
n.className = "pip-btn pip-btn-hangup", n.title = "Cancelar", n.innerHTML = E.phoneOff, n.onclick = () => {
|
|
18154
|
-
a("hangup"),
|
|
18175
|
+
a("hangup"), R();
|
|
18155
18176
|
}, t.appendChild(n);
|
|
18156
18177
|
}
|
|
18157
18178
|
}
|
|
@@ -18167,7 +18188,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18167
18188
|
}, 1e3));
|
|
18168
18189
|
}, L = () => {
|
|
18169
18190
|
m &&= (clearInterval(m), null);
|
|
18170
|
-
},
|
|
18191
|
+
}, gm = async () => {
|
|
18171
18192
|
if (!(!o.value || l.value || u.value)) {
|
|
18172
18193
|
u.value = !0;
|
|
18173
18194
|
try {
|
|
@@ -18187,14 +18208,14 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18187
18208
|
u.value = !1;
|
|
18188
18209
|
}
|
|
18189
18210
|
}
|
|
18190
|
-
},
|
|
18211
|
+
}, R = () => {
|
|
18191
18212
|
L(), d.value && (d.value.close(), d.value = null, l.value = !1, a("update:active", !1));
|
|
18192
18213
|
};
|
|
18193
18214
|
return t({
|
|
18194
|
-
open:
|
|
18195
|
-
close:
|
|
18215
|
+
open: gm,
|
|
18216
|
+
close: R,
|
|
18196
18217
|
toggle: () => {
|
|
18197
|
-
l.value ?
|
|
18218
|
+
l.value ? R() : gm();
|
|
18198
18219
|
},
|
|
18199
18220
|
isActive: l,
|
|
18200
18221
|
isSupported: o,
|
|
@@ -18289,7 +18310,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18289
18310
|
provide("webphone", x), provide("sip", S), t({ stop: S.stop }), watchEffect(() => {
|
|
18290
18311
|
o.mode === "webcall" && (o.to || console.error("WebPhone: \"to\" prop is required when mode is \"webcall\""), o.logo || console.error("WebPhone: \"logo\" prop is required when mode is \"webcall\""));
|
|
18291
18312
|
});
|
|
18292
|
-
let O = ref(!1), k = ref(!1), j = ref(!1), N = ref(null), F = ref(null), L = ref(null),
|
|
18313
|
+
let O = ref(!1), k = ref(!1), j = ref(!1), N = ref(null), F = ref(null), L = ref(null), B = navigator.platform.toUpperCase().indexOf("MAC") >= 0 ? "⌘" : "Ctrl+", V = computed(() => o.mode === "webcall"), H = ref(0), U = (e) => !!e && e.getVideoTracks().length > 0;
|
|
18293
18314
|
watch(() => x.callStatus, (e) => {
|
|
18294
18315
|
if (e === "idle" && !x.isKeypadVisible) {
|
|
18295
18316
|
x.toggleKeypad();
|
|
@@ -18297,81 +18318,81 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18297
18318
|
}
|
|
18298
18319
|
e !== "idle" && x.isKeypadVisible && x.toggleKeypad();
|
|
18299
18320
|
});
|
|
18300
|
-
let
|
|
18321
|
+
let W = computed(() => x.channels.find((e) => e.id === x.activeChannelId) ?? null), G = (e) => {
|
|
18301
18322
|
if (!e) return "";
|
|
18302
18323
|
let t = e.trim(), n = t.startsWith("+"), i = t.replace(/[^\d]/g, "");
|
|
18303
18324
|
return n ? `+${i}` : i;
|
|
18304
|
-
},
|
|
18305
|
-
let e =
|
|
18325
|
+
}, K = computed(() => {
|
|
18326
|
+
let e = W.value?.remoteNumber || x.remoteNumber, t = G(e), n = o.contacts.find((e) => G(e.number) === t);
|
|
18306
18327
|
return n?.name ? o.maskNumber && /^[+\d\s().*#-]+$/.test(n.name.trim()) ? maskPhoneNumber(n.name, o.extensions) : n.name : o.maskNumber && e ? maskPhoneNumber(e, o.extensions) : e || "Llamada";
|
|
18307
|
-
}),
|
|
18308
|
-
let e =
|
|
18328
|
+
}), bm = computed(() => {
|
|
18329
|
+
let e = W.value?.remoteNumber || x.remoteNumber;
|
|
18309
18330
|
return o.maskNumber ? maskPhoneNumber(e, o.extensions) : e;
|
|
18310
|
-
}),
|
|
18311
|
-
|
|
18312
|
-
},
|
|
18331
|
+
}), xm = computed(() => (H.value, !!W.value?.hasVideo || U(E.value) || U(D.value))), { isOnline: q } = useNetwork(), J = computed(() => !q.value), Cm = ref(null), Y = ref(!1), km = computed(() => o.enablePictureInPicture), Am = () => {
|
|
18332
|
+
km.value && Cm.value?.toggle();
|
|
18333
|
+
}, jm = async (e, t) => {
|
|
18313
18334
|
try {
|
|
18314
18335
|
t === "blind" ? await S.transferCall(e) : await S.startAttendedTransfer(e);
|
|
18315
18336
|
} catch (e) {
|
|
18316
18337
|
console.error("[WebPhone] Transfer error:", e), alert(e instanceof Error ? e.message : "Transfer failed. Please try again.");
|
|
18317
18338
|
}
|
|
18318
|
-
},
|
|
18339
|
+
}, Mm = async () => {
|
|
18319
18340
|
try {
|
|
18320
18341
|
await S.completeAttendedTransfer();
|
|
18321
18342
|
} catch (e) {
|
|
18322
18343
|
console.error("[WebPhone] Complete transfer error:", e), alert(e instanceof Error ? e.message : "Failed to complete transfer.");
|
|
18323
18344
|
}
|
|
18324
|
-
},
|
|
18345
|
+
}, Nm = async () => {
|
|
18325
18346
|
try {
|
|
18326
18347
|
await S.cancelAttendedTransfer();
|
|
18327
18348
|
} catch (e) {
|
|
18328
18349
|
console.error("[WebPhone] Cancel transfer error:", e), alert(e instanceof Error ? e.message : "Failed to cancel transfer.");
|
|
18329
18350
|
}
|
|
18330
|
-
},
|
|
18351
|
+
}, Pm = (e) => {
|
|
18331
18352
|
x.keypadValue = e, S.makeCall(e);
|
|
18332
|
-
},
|
|
18353
|
+
}, Fm = (e) => {
|
|
18333
18354
|
if (o.onAnswer) {
|
|
18334
18355
|
o.onAnswer(e);
|
|
18335
18356
|
return;
|
|
18336
18357
|
}
|
|
18337
18358
|
S.answerCall(e);
|
|
18338
|
-
},
|
|
18359
|
+
}, Im = async () => {
|
|
18339
18360
|
await S.hangupCall(), await o.onHangup?.();
|
|
18340
|
-
},
|
|
18361
|
+
}, Lm = () => {
|
|
18341
18362
|
if (o.onReject) {
|
|
18342
18363
|
o.onReject();
|
|
18343
18364
|
return;
|
|
18344
18365
|
}
|
|
18345
18366
|
S.hangupCall();
|
|
18346
|
-
},
|
|
18347
|
-
j.value = !0,
|
|
18348
|
-
},
|
|
18349
|
-
if (!
|
|
18367
|
+
}, Rm = () => {
|
|
18368
|
+
j.value = !0, Cm.value?.close(), window.focus();
|
|
18369
|
+
}, zm = () => {
|
|
18370
|
+
if (!km.value) return !1;
|
|
18350
18371
|
let e = x.callStatus !== "idle", t = document.hidden || !document.hasFocus();
|
|
18351
|
-
return e && t && !
|
|
18352
|
-
},
|
|
18372
|
+
return e && t && !Y.value;
|
|
18373
|
+
}, Z = () => {
|
|
18353
18374
|
window.setTimeout(() => {
|
|
18354
|
-
|
|
18375
|
+
zm() && Cm.value?.open();
|
|
18355
18376
|
}, 150);
|
|
18356
18377
|
};
|
|
18357
18378
|
watchEffect(() => {
|
|
18358
|
-
F.value && (
|
|
18379
|
+
F.value && (Y.value || !E.value ? F.value.srcObject = null : F.value.srcObject = E.value), L.value && (Y.value || !D.value ? L.value.srcObject = null : L.value.srcObject = D.value);
|
|
18359
18380
|
});
|
|
18360
|
-
let
|
|
18381
|
+
let Vm = (e) => {
|
|
18361
18382
|
if (!e || typeof e.addEventListener != "function" || typeof e.removeEventListener != "function") return () => {};
|
|
18362
18383
|
let t = () => {
|
|
18363
|
-
|
|
18384
|
+
H.value += 1;
|
|
18364
18385
|
};
|
|
18365
18386
|
return e.addEventListener("addtrack", t), e.addEventListener("removetrack", t), () => {
|
|
18366
18387
|
e.removeEventListener("addtrack", t), e.removeEventListener("removetrack", t);
|
|
18367
18388
|
};
|
|
18368
18389
|
};
|
|
18369
18390
|
watch(E, (e, t, n) => {
|
|
18370
|
-
|
|
18391
|
+
H.value += 1, n(Vm(e));
|
|
18371
18392
|
}, { immediate: !0 }), watch(D, (e, t, n) => {
|
|
18372
|
-
|
|
18393
|
+
H.value += 1, n(Vm(e));
|
|
18373
18394
|
}, { immediate: !0 });
|
|
18374
|
-
let
|
|
18395
|
+
let Hm = [
|
|
18375
18396
|
"button",
|
|
18376
18397
|
"a",
|
|
18377
18398
|
"input",
|
|
@@ -18382,15 +18403,15 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18382
18403
|
"[role=\"button\"]",
|
|
18383
18404
|
"[role=\"radio\"]",
|
|
18384
18405
|
"[data-no-drag]"
|
|
18385
|
-
].join(", "),
|
|
18406
|
+
].join(", "), Wm = () => {
|
|
18386
18407
|
let e = window.innerWidth < 640, t = window.innerWidth < 1024, n = 360;
|
|
18387
18408
|
return e ? n = window.innerWidth * .9 : t && (n = 340), {
|
|
18388
18409
|
x: Math.max(0, (window.innerWidth - n) / 2),
|
|
18389
18410
|
y: e ? 30 : 80
|
|
18390
18411
|
};
|
|
18391
|
-
}, { x:
|
|
18412
|
+
}, { x: Gm, y: Km, style: qm } = useDraggable(N, {
|
|
18392
18413
|
initialValue: computed(() => {
|
|
18393
|
-
let e =
|
|
18414
|
+
let e = Wm();
|
|
18394
18415
|
return {
|
|
18395
18416
|
x: o.position.x ?? e.x,
|
|
18396
18417
|
y: o.position.y ?? e.y
|
|
@@ -18399,14 +18420,14 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18399
18420
|
preventDefault: !0,
|
|
18400
18421
|
onStart: (e, t) => {
|
|
18401
18422
|
let n = t.target;
|
|
18402
|
-
if (n instanceof HTMLElement && n.closest(
|
|
18423
|
+
if (n instanceof HTMLElement && n.closest(Hm)) return !1;
|
|
18403
18424
|
}
|
|
18404
18425
|
});
|
|
18405
18426
|
watch(() => o.position, (e) => {
|
|
18406
|
-
let t =
|
|
18407
|
-
|
|
18427
|
+
let t = Wm();
|
|
18428
|
+
Gm.value = e.x ?? t.x, Km.value = e.y ?? t.y;
|
|
18408
18429
|
}, { deep: !0 });
|
|
18409
|
-
let
|
|
18430
|
+
let Jm = [
|
|
18410
18431
|
{
|
|
18411
18432
|
label: "Canal 1",
|
|
18412
18433
|
value: 0
|
|
@@ -18419,27 +18440,27 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18419
18440
|
label: "Canal 3",
|
|
18420
18441
|
value: 2
|
|
18421
18442
|
}
|
|
18422
|
-
],
|
|
18443
|
+
], Q = ref(!1), $ = computed({
|
|
18423
18444
|
get: () => x.activeChannelId.toString(),
|
|
18424
18445
|
set: async (e) => {
|
|
18425
|
-
if (!J.value && e && !
|
|
18426
|
-
|
|
18446
|
+
if (!J.value && e && !Q.value) {
|
|
18447
|
+
Q.value = !0;
|
|
18427
18448
|
try {
|
|
18428
18449
|
await T(parseInt(e));
|
|
18429
18450
|
} finally {
|
|
18430
|
-
|
|
18451
|
+
Q.value = !1;
|
|
18431
18452
|
}
|
|
18432
18453
|
}
|
|
18433
18454
|
}
|
|
18434
|
-
}),
|
|
18455
|
+
}), Ym = (e) => {
|
|
18435
18456
|
let t = x.channels.find((t) => t.id === e);
|
|
18436
18457
|
return t ? t.status === "connected" || t.status === "calling" || t.status === "incoming" : !1;
|
|
18437
|
-
},
|
|
18458
|
+
}, Xm = (e) => {
|
|
18438
18459
|
let t = x.channels.find((t) => t.id === e);
|
|
18439
18460
|
return t ? t.isHeld || t.status === "held" : !1;
|
|
18440
|
-
}, Xm = (e) => {
|
|
18441
|
-
J.value || (qm.value = e.toString());
|
|
18442
18461
|
}, Zm = (e) => {
|
|
18462
|
+
J.value || ($.value = e.toString());
|
|
18463
|
+
}, Qm = (e) => {
|
|
18443
18464
|
if (!J.value && ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "h" && (e.preventDefault(), k.value = !0), (e.metaKey || e.ctrlKey) && e.key === "," && (e.preventDefault(), O.value = !0), (e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k" && (e.preventDefault(), x.toggleKeypad()), (e.metaKey || e.ctrlKey) && [
|
|
18444
18465
|
"1",
|
|
18445
18466
|
"2",
|
|
@@ -18447,50 +18468,50 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18447
18468
|
].includes(e.key))) {
|
|
18448
18469
|
e.preventDefault();
|
|
18449
18470
|
let t = parseInt(e.key) - 1;
|
|
18450
|
-
|
|
18451
|
-
|
|
18471
|
+
Q.value || (Q.value = !0, T(t).finally(() => {
|
|
18472
|
+
Q.value = !1;
|
|
18452
18473
|
}));
|
|
18453
18474
|
}
|
|
18454
18475
|
};
|
|
18455
18476
|
watch(() => x.callStatus, () => {
|
|
18456
|
-
|
|
18477
|
+
zm() && Z();
|
|
18457
18478
|
}), watch(() => x.isConnected, (e) => {
|
|
18458
18479
|
v.value && a.set(v.value, e);
|
|
18459
|
-
}, { immediate: !0 }), watch(
|
|
18460
|
-
!e &&
|
|
18480
|
+
}, { immediate: !0 }), watch(km, (e) => {
|
|
18481
|
+
!e && Y.value && Cm.value?.close();
|
|
18461
18482
|
});
|
|
18462
|
-
let
|
|
18463
|
-
|
|
18483
|
+
let $m = ref(!1), eh = async () => {
|
|
18484
|
+
$m.value || J.value || !o.host || !o.extension || !o.password || (await w({
|
|
18464
18485
|
uri: `sip:${o.extension}@${o.host}`,
|
|
18465
18486
|
transportOptions: { server: _.value },
|
|
18466
18487
|
authorizationUsername: o.extension,
|
|
18467
18488
|
authorizationPassword: o.password,
|
|
18468
18489
|
earlyMedia: o.earlyMedia
|
|
18469
|
-
}), S.extension.value && (
|
|
18490
|
+
}), S.extension.value && ($m.value = !0, o.mode === "webcall" && o.to && S.makeCall(o.to)));
|
|
18470
18491
|
};
|
|
18471
18492
|
return provide("webphoneRegistration", {
|
|
18472
18493
|
isConnected: computed(() => x.isConnected),
|
|
18473
|
-
register: () =>
|
|
18494
|
+
register: () => eh(),
|
|
18474
18495
|
unregister: async () => {
|
|
18475
|
-
await S.stop(),
|
|
18496
|
+
await S.stop(), $m.value = !1;
|
|
18476
18497
|
}
|
|
18477
18498
|
}), onMounted(async () => {
|
|
18478
|
-
window.addEventListener("keydown",
|
|
18499
|
+
window.addEventListener("keydown", Qm), document.addEventListener("visibilitychange", Z), window.addEventListener("blur", Z), window.addEventListener("pagehide", Z), !(o.mode === "webcall" && (!o.to || !o.logo)) && await eh();
|
|
18479
18500
|
}), watch(() => q.value, async (e) => {
|
|
18480
|
-
e && await
|
|
18501
|
+
e && await eh();
|
|
18481
18502
|
}), onUnmounted(() => {
|
|
18482
|
-
S.stop(), window.removeEventListener("keydown",
|
|
18503
|
+
S.stop(), window.removeEventListener("keydown", Qm), document.removeEventListener("visibilitychange", Z), window.removeEventListener("blur", Z), window.removeEventListener("pagehide", Z);
|
|
18483
18504
|
}), (e, t) => (openBlock(), createElementBlock(Fragment, null, [
|
|
18484
18505
|
createElementVNode("div", {
|
|
18485
18506
|
ref_key: "phoneRef",
|
|
18486
18507
|
ref: N,
|
|
18487
|
-
style: normalizeStyle(unref(
|
|
18508
|
+
style: normalizeStyle(unref(qm)),
|
|
18488
18509
|
class: normalizeClass(["webphone webphone-container wp:bg-white wp:dark:bg-neutral-800 wp:rounded-lg wp:shadow-sm wp:inset-shadow-2xs wp:w-[min(92vw,330px)] wp:fixed wp:z-50 wp:select-none wp:[&_button]:cursor-pointer wp:**:[[role=button]]:cursor-pointer", J.value ? "wp:opacity-70" : ""]),
|
|
18489
18510
|
"data-mode": o.mode,
|
|
18490
18511
|
"data-call-status": x.callStatus,
|
|
18491
18512
|
"data-network-status": J.value ? "offline" : "online"
|
|
18492
18513
|
}, [
|
|
18493
|
-
|
|
18514
|
+
xm.value && !Y.value ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("video", {
|
|
18494
18515
|
ref_key: "remoteVideoRef",
|
|
18495
18516
|
ref: F,
|
|
18496
18517
|
autoplay: "",
|
|
@@ -18505,32 +18526,32 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18505
18526
|
class: "webphone__video-local wp:w-full wp:h-full wp:object-cover"
|
|
18506
18527
|
}, null, 512)])])) : createCommentVNode("", !0),
|
|
18507
18528
|
createElementVNode("div", _hoisted_4, [
|
|
18508
|
-
|
|
18509
|
-
createElementVNode("div", _hoisted_7, [(openBlock(), createElementBlock(Fragment, null, renderList(
|
|
18529
|
+
V.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_5, [createElementVNode("div", _hoisted_6, [
|
|
18530
|
+
createElementVNode("div", _hoisted_7, [(openBlock(), createElementBlock(Fragment, null, renderList(Jm, (e) => createElementVNode("button", {
|
|
18510
18531
|
key: e.value,
|
|
18511
18532
|
type: "button",
|
|
18512
18533
|
role: "radio",
|
|
18513
|
-
"aria-checked":
|
|
18534
|
+
"aria-checked": $.value === e.value.toString(),
|
|
18514
18535
|
disabled: J.value,
|
|
18515
|
-
title: `${e.label} (${unref(
|
|
18516
|
-
class: normalizeClass(["webphone__channel-button wp:flex wp:items-center wp:gap-1 wp:px-2 wp:py-2 wp:rounded-lg wp:transition-colors wp:duration-200 wp:outline-none wp:focus-visible:ring-2 wp:focus-visible:ring-[var(--p-primary-color)] wp:focus-visible:ring-offset-2 wp:focus-visible:ring-offset-white wp:dark:focus-visible:ring-offset-neutral-900",
|
|
18536
|
+
title: `${e.label} (${unref(B)}${e.value + 1})`,
|
|
18537
|
+
class: normalizeClass(["webphone__channel-button wp:flex wp:items-center wp:gap-1 wp:px-2 wp:py-2 wp:rounded-lg wp:transition-colors wp:duration-200 wp:outline-none wp:focus-visible:ring-2 wp:focus-visible:ring-[var(--p-primary-color)] wp:focus-visible:ring-offset-2 wp:focus-visible:ring-offset-white wp:dark:focus-visible:ring-offset-neutral-900", Xm(e.value) ? "wp:bg-status-hold/12 hover:wp:bg-status-hold/18" : Ym(e.value) ? "wp:bg-[var(--color-red)]/12 hover:wp:bg-[var(--color-red)]/18" : $.value === e.value.toString() ? "wp:bg-[var(--p-primary-color)]/12" : "wp:hover:bg-neutral-100 wp:dark:hover:bg-neutral-800/80"]),
|
|
18517
18538
|
"data-channel-id": e.value,
|
|
18518
|
-
"data-state":
|
|
18519
|
-
"data-call-state":
|
|
18520
|
-
onClick: (t) =>
|
|
18539
|
+
"data-state": $.value === e.value.toString() ? "active" : "idle",
|
|
18540
|
+
"data-call-state": Xm(e.value) ? "held" : Ym(e.value) ? "busy" : "available",
|
|
18541
|
+
onClick: (t) => Zm(e.value)
|
|
18521
18542
|
}, [createVNode(unref(icon_phone_default), {
|
|
18522
|
-
class: normalizeClass(["webphone__channel-icon wp:size-3 wp:shrink-0",
|
|
18543
|
+
class: normalizeClass(["webphone__channel-icon wp:size-3 wp:shrink-0", Xm(e.value) ? "wp:text-status-hold" : Ym(e.value) ? "wp:text-[var(--color-red)]" : $.value === e.value.toString() ? "wp:text-[var(--p-primary-color)]" : "wp:text-neutral-400"]),
|
|
18523
18544
|
"stroke-width": 1.8
|
|
18524
|
-
}, null, 8, ["class"]), createElementVNode("span", { class: normalizeClass(["webphone__channel-label wp:text-[11px] wp:leading-none manrope wp:font-bold",
|
|
18545
|
+
}, null, 8, ["class"]), createElementVNode("span", { class: normalizeClass(["webphone__channel-label wp:text-[11px] wp:leading-none manrope wp:font-bold", Xm(e.value) ? "wp:text-status-hold" : Ym(e.value) ? "wp:text-[var(--color-red)]" : $.value === e.value.toString() ? "wp:text-[var(--p-primary-color)]" : "wp:text-neutral-500 wp:dark:text-neutral-400"]) }, toDisplayString(e.label), 3)], 10, _hoisted_8)), 64))]),
|
|
18525
18546
|
createVNode(unref(TooltipProvider_default), null, {
|
|
18526
18547
|
default: withCtx(() => [createVNode(unref(Tooltip_default), null, {
|
|
18527
18548
|
default: withCtx(() => [createVNode(unref(TooltipTrigger_default), { "as-child": "" }, {
|
|
18528
18549
|
default: withCtx(() => [createVNode(unref(Button_default), {
|
|
18529
18550
|
variant: "ghost",
|
|
18530
18551
|
size: "icon",
|
|
18531
|
-
class: normalizeClass(["wp:h-8 wp:w-8 wp:rounded-full",
|
|
18552
|
+
class: normalizeClass(["wp:h-8 wp:w-8 wp:rounded-full", Y.value ? "wp:text-primary" : ""]),
|
|
18532
18553
|
title: "Picture-in-Picture",
|
|
18533
|
-
onClick:
|
|
18554
|
+
onClick: Am
|
|
18534
18555
|
}, {
|
|
18535
18556
|
default: withCtx(() => [createVNode(unref(PictureInPicture2), { class: "wp:w-4 wp:h-4 wp:text-[var(--color-settings)]" })]),
|
|
18536
18557
|
_: 1
|
|
@@ -18559,7 +18580,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18559
18580
|
_: 1
|
|
18560
18581
|
}), createVNode(unref(TooltipContent_default), { class: "wp:flex wp:items-center wp:gap-2" }, {
|
|
18561
18582
|
default: withCtx(() => [t[9] ||= createElementVNode("span", null, "Configuración", -1), createVNode(unref(Kbd_default), null, {
|
|
18562
|
-
default: withCtx(() => [createTextVNode(toDisplayString(unref(
|
|
18583
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(B)) + ",", 1)]),
|
|
18563
18584
|
_: 1
|
|
18564
18585
|
})]),
|
|
18565
18586
|
_: 1
|
|
@@ -18572,8 +18593,8 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18572
18593
|
createElementVNode("div", _hoisted_9, [(openBlock(!0), createElementBlock(Fragment, null, renderList(x.channels, (e) => withDirectives((openBlock(), createBlock(CallDisplay_default, {
|
|
18573
18594
|
key: e.id,
|
|
18574
18595
|
"channel-id": e.id,
|
|
18575
|
-
"allow-input": !
|
|
18576
|
-
"is-web-call":
|
|
18596
|
+
"allow-input": !V.value,
|
|
18597
|
+
"is-web-call": V.value,
|
|
18577
18598
|
"is-online": unref(q),
|
|
18578
18599
|
contacts: o.contacts,
|
|
18579
18600
|
user: o.extension,
|
|
@@ -18596,14 +18617,14 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18596
18617
|
createVNode(CallActions_default, {
|
|
18597
18618
|
class: "webphone__actions",
|
|
18598
18619
|
style: normalizeStyle(J.value ? "pointer-events: none;" : void 0),
|
|
18599
|
-
destination:
|
|
18620
|
+
destination: V.value ? o.to : void 0,
|
|
18600
18621
|
"is-video": o.mode === "video",
|
|
18601
18622
|
"on-answer": o.onAnswer,
|
|
18602
18623
|
"on-hangup": o.onHangup,
|
|
18603
18624
|
"on-reject": o.onReject,
|
|
18604
18625
|
onTransfer: t[1] ||= (e) => j.value = !0,
|
|
18605
|
-
onCompleteTransfer:
|
|
18606
|
-
onCancelTransfer:
|
|
18626
|
+
onCompleteTransfer: Mm,
|
|
18627
|
+
onCancelTransfer: Nm
|
|
18607
18628
|
}, null, 8, [
|
|
18608
18629
|
"style",
|
|
18609
18630
|
"destination",
|
|
@@ -18614,7 +18635,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18614
18635
|
])
|
|
18615
18636
|
]),
|
|
18616
18637
|
J.value ? (openBlock(), createElementBlock("div", _hoisted_11, [...t[10] ||= [createElementVNode("span", { class: "wp:text-sm wp:font-semibold wp:text-status-disconnected" }, "Sin internet", -1)]])) : createCommentVNode("", !0),
|
|
18617
|
-
|
|
18638
|
+
V.value ? (openBlock(), createElementBlock("div", _hoisted_12, [...t[11] ||= [createElementVNode("div", { class: "webphone__footer-label wp:text-[10px] wp:text-primary" }, "Powered By", -1), createElementVNode("div", { class: "webphone__footer-content wp:flex wp:items-center wp:gap-2" }, [createElementVNode("a", {
|
|
18618
18639
|
href: "https://www.nebula123.com",
|
|
18619
18640
|
target: "_blank",
|
|
18620
18641
|
class: "webphone__footer-link wp:text-[10px] wp:text-primary wp:hover:underline"
|
|
@@ -18630,7 +18651,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18630
18651
|
contacts: o.contacts,
|
|
18631
18652
|
"mask-number": o.maskNumber,
|
|
18632
18653
|
extensions: o.extensions,
|
|
18633
|
-
onCall:
|
|
18654
|
+
onCall: Pm
|
|
18634
18655
|
}, null, 8, [
|
|
18635
18656
|
"visible",
|
|
18636
18657
|
"contacts",
|
|
@@ -18643,7 +18664,7 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18643
18664
|
contacts: o.contacts,
|
|
18644
18665
|
"mask-number": o.maskNumber,
|
|
18645
18666
|
extensions: o.extensions,
|
|
18646
|
-
onTransfer:
|
|
18667
|
+
onTransfer: jm
|
|
18647
18668
|
}, null, 8, [
|
|
18648
18669
|
"visible",
|
|
18649
18670
|
"contacts",
|
|
@@ -18652,26 +18673,26 @@ var _hoisted_1$3 = { class: "wp:flex wp:flex-col wp:gap-6 wp:py-4" }, _hoisted_2
|
|
|
18652
18673
|
]),
|
|
18653
18674
|
createVNode(DocumentPip_default, {
|
|
18654
18675
|
ref_key: "documentPipRef",
|
|
18655
|
-
ref:
|
|
18656
|
-
active:
|
|
18657
|
-
"onUpdate:active": t[5] ||= (e) =>
|
|
18658
|
-
"auto-open-on-blur":
|
|
18676
|
+
ref: Cm,
|
|
18677
|
+
active: Y.value,
|
|
18678
|
+
"onUpdate:active": t[5] ||= (e) => Y.value = e,
|
|
18679
|
+
"auto-open-on-blur": km.value,
|
|
18659
18680
|
"is-connected": x.isConnected,
|
|
18660
|
-
"remote-number":
|
|
18661
|
-
"caller-name":
|
|
18662
|
-
"has-video":
|
|
18681
|
+
"remote-number": bm.value,
|
|
18682
|
+
"caller-name": K.value,
|
|
18683
|
+
"has-video": xm.value ?? !1,
|
|
18663
18684
|
"remote-stream": unref(E),
|
|
18664
18685
|
"local-stream": unref(D),
|
|
18665
|
-
destination:
|
|
18686
|
+
destination: V.value ? o.to : void 0,
|
|
18666
18687
|
"is-video": o.mode === "video",
|
|
18667
18688
|
"call-status": x.callStatus,
|
|
18668
18689
|
"is-muted": x.isMuted,
|
|
18669
18690
|
"is-held": x.isHeld,
|
|
18670
|
-
onTransfer:
|
|
18671
|
-
onTransferRequest:
|
|
18672
|
-
onHangup:
|
|
18673
|
-
onReject:
|
|
18674
|
-
onAnswer:
|
|
18691
|
+
onTransfer: Rm,
|
|
18692
|
+
onTransferRequest: jm,
|
|
18693
|
+
onHangup: Im,
|
|
18694
|
+
onReject: Lm,
|
|
18695
|
+
onAnswer: Fm,
|
|
18675
18696
|
onToggleMute: t[6] ||= (e) => unref(S).toggleMute(),
|
|
18676
18697
|
onToggleHold: t[7] ||= (e) => unref(S).toggleHold()
|
|
18677
18698
|
}, null, 8, [
|