native-fn 1.0.71 → 1.0.73
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/native.cjs +2 -507
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +2 -507
- package/dist/native.umd.js +2 -507
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +435 -423
- package/dist/plugin/app/index.d.ts +8 -33
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +435 -423
- package/dist/plugin/app/index.umd.js +435 -423
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/app/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/app/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/app/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/app/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/app/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/appearance/index.cjs +30 -16
- package/dist/plugin/appearance/index.min.cjs +1 -1
- package/dist/plugin/appearance/index.min.mjs +1 -1
- package/dist/plugin/appearance/index.mjs +30 -16
- package/dist/plugin/appearance/index.umd.js +30 -16
- package/dist/plugin/appearance/index.umd.min.js +1 -1
- package/dist/plugin/appearance/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/appearance/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/appearance/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/appearance/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/appearance/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/appearance/src/plugin/platform/index.d.ts +12 -0
- package/dist/plugin/appearance/src/plugin/platform/types/index.d.ts +11 -0
- package/dist/plugin/appearance/src/plugin/platform/types/platform.d.ts +18 -0
- package/dist/plugin/appearance/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/appearance/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/appearance/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/appearance/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/camera/index.cjs +118 -109
- package/dist/plugin/camera/index.min.cjs +1 -1
- package/dist/plugin/camera/index.min.mjs +1 -1
- package/dist/plugin/camera/index.mjs +118 -109
- package/dist/plugin/camera/index.umd.js +118 -109
- package/dist/plugin/camera/index.umd.min.js +1 -1
- package/dist/plugin/camera/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/camera/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/camera/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/camera/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/camera/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/camera/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/camera/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/camera/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/camera/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/camera/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/camera/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/clipboard/index.cjs +226 -212
- package/dist/plugin/clipboard/index.min.cjs +1 -1
- package/dist/plugin/clipboard/index.min.mjs +1 -1
- package/dist/plugin/clipboard/index.mjs +226 -212
- package/dist/plugin/clipboard/index.umd.js +226 -212
- package/dist/plugin/clipboard/index.umd.min.js +1 -1
- package/dist/plugin/clipboard/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/clipboard/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/clipboard/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/clipboard/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/clipboard/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/clipboard/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/fullscreen/index.cjs +34 -20
- package/dist/plugin/fullscreen/index.d.ts +4 -13
- package/dist/plugin/fullscreen/index.min.cjs +1 -1
- package/dist/plugin/fullscreen/index.min.mjs +1 -1
- package/dist/plugin/fullscreen/index.mjs +34 -20
- package/dist/plugin/fullscreen/index.umd.js +34 -20
- package/dist/plugin/fullscreen/index.umd.min.js +1 -1
- package/dist/plugin/fullscreen/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/fullscreen/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/fullscreen/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/fullscreen/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/fullscreen/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/fullscreen/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/plugin/platform/index.cjs +356 -109
- package/dist/plugin/platform/index.d.ts +15 -19
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +356 -109
- package/dist/plugin/platform/index.umd.js +356 -109
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/plugin/app/constants/index.d.ts +12 -0
- package/dist/plugin/platform/src/plugin/app/cores/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/app/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/app/types/app.d.ts +11 -2
- package/dist/plugin/platform/src/plugin/app/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/appearance/constants/index.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/appearance/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/appearance/index.d.ts +8 -0
- package/dist/plugin/platform/src/plugin/appearance/types/appearance.d.ts +12 -0
- package/dist/plugin/platform/src/plugin/appearance/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/camera/constants/inedx.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/camera/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/camera/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/types/camera.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/types/index.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/camera/utils/try-open-camera.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/clipboard/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/fullscreen/cores/index.d.ts +35 -0
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +5 -5
- package/dist/plugin/platform/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/platform/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/platform/src/plugin/theme/constants/index.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/theme/cores/index.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +2 -21
- package/dist/plugin/platform/src/utils/create-hidden-element.d.ts +1 -1
- package/dist/plugin/theme/index.cjs +63 -906
- package/dist/plugin/theme/index.d.ts +4 -87
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +63 -906
- package/dist/plugin/theme/index.umd.js +63 -906
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/plugin/theme/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/plugin/theme/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +3 -2
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/plugin/theme/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +1 -13
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -22
- package/dist/src/plugin/app/cores/index.d.ts +0 -4
- package/dist/src/plugin/app/types/app.d.ts +1 -1
- package/dist/src/plugin/camera/cores/index.d.ts +2 -2
- package/dist/src/plugin/clipboard/cores/index.d.ts +2 -2
- package/dist/src/plugin/fullscreen/cores/index.d.ts +2 -2
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +3 -10
- package/dist/src/plugin/platform/constants/index.d.ts +42 -0
- package/dist/src/plugin/platform/cores/index.d.ts +28 -0
- package/dist/src/plugin/platform/index.d.ts +3 -2
- package/dist/src/plugin/platform/types/index.d.ts +4 -0
- package/dist/src/plugin/platform/types/platform.d.ts +5 -2
- package/dist/src/plugin/theme/constants/index.d.ts +0 -12
- package/dist/src/plugin/theme/cores/index.d.ts +2 -2
- package/dist/src/plugin/theme/index.d.ts +1 -13
- package/dist/src/plugin/theme/types/index.d.ts +0 -12
- package/dist/src/plugin/theme/types/theme.d.ts +2 -22
- package/package.json +1 -1
|
@@ -13,6 +13,86 @@ var MessengerType;
|
|
|
13
13
|
MessengerType["Mail"] = "mail";
|
|
14
14
|
})(MessengerType || (MessengerType = {}));
|
|
15
15
|
|
|
16
|
+
function createCustomError(name, Base) {
|
|
17
|
+
if (Base === void 0) { Base = Error; }
|
|
18
|
+
function CustomError(message) {
|
|
19
|
+
if (!(this instanceof CustomError))
|
|
20
|
+
return new CustomError(message);
|
|
21
|
+
var error = new Base(message || '');
|
|
22
|
+
if (typeof Object.setPrototypeOf === 'function')
|
|
23
|
+
Object.setPrototypeOf(error, CustomError.prototype);
|
|
24
|
+
else
|
|
25
|
+
error.__proto__ = CustomError.prototype;
|
|
26
|
+
error.name = name;
|
|
27
|
+
if (message !== undefined)
|
|
28
|
+
error.message = message;
|
|
29
|
+
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
30
|
+
try {
|
|
31
|
+
Object.defineProperty(error, Symbol.toStringTag, {
|
|
32
|
+
value: name,
|
|
33
|
+
writable: false,
|
|
34
|
+
enumerable: false,
|
|
35
|
+
configurable: true
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch (_) {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (typeof Error.captureStackTrace === 'function') {
|
|
42
|
+
Error.captureStackTrace(error, CustomError);
|
|
43
|
+
}
|
|
44
|
+
else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
|
|
45
|
+
Base.captureStackTrace(error, CustomError);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
try {
|
|
49
|
+
var tempError = new Base();
|
|
50
|
+
if (tempError.stack)
|
|
51
|
+
error.stack = tempError.stack;
|
|
52
|
+
}
|
|
53
|
+
catch (_) {
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return error;
|
|
57
|
+
}
|
|
58
|
+
CustomError.prototype = Object.create(Base.prototype, {
|
|
59
|
+
constructor: {
|
|
60
|
+
value: CustomError,
|
|
61
|
+
writable: true,
|
|
62
|
+
enumerable: false,
|
|
63
|
+
configurable: true
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
try {
|
|
67
|
+
Object.defineProperty(CustomError.prototype, 'name', {
|
|
68
|
+
value: name,
|
|
69
|
+
writable: true,
|
|
70
|
+
enumerable: false,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
catch (_) {
|
|
75
|
+
try {
|
|
76
|
+
CustomError.prototype.name = name;
|
|
77
|
+
}
|
|
78
|
+
catch (_) {
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
Object.defineProperty(CustomError, 'name', {
|
|
83
|
+
value: name,
|
|
84
|
+
writable: false,
|
|
85
|
+
enumerable: false,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (_) {
|
|
90
|
+
}
|
|
91
|
+
return CustomError;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
var URLOpenError = createCustomError('URLOpenError');
|
|
95
|
+
|
|
16
96
|
function compareVersion(lhs, rhs) {
|
|
17
97
|
var pa = lhs.split('.');
|
|
18
98
|
var pb = rhs.split('.');
|
|
@@ -33,8 +113,235 @@ function compareVersion(lhs, rhs) {
|
|
|
33
113
|
if (a < b)
|
|
34
114
|
return -1;
|
|
35
115
|
}
|
|
36
|
-
return 0;
|
|
37
|
-
}
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getTopmostWindow() {
|
|
120
|
+
try {
|
|
121
|
+
if (globalThis.top && globalThis.top !== window) {
|
|
122
|
+
void globalThis.top.location.href;
|
|
123
|
+
return globalThis.top;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (_) {
|
|
127
|
+
}
|
|
128
|
+
return window;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function createHiddenElement(tagName, focusable) {
|
|
132
|
+
if (focusable === void 0) { focusable = true; }
|
|
133
|
+
if (typeof globalThis.document === 'undefined')
|
|
134
|
+
return undefined;
|
|
135
|
+
var element = globalThis.document.createElement(tagName);
|
|
136
|
+
if ('width' in element)
|
|
137
|
+
element.width = '0';
|
|
138
|
+
if ('height' in element)
|
|
139
|
+
element.height = '0';
|
|
140
|
+
if ('border' in element)
|
|
141
|
+
element.border = '0';
|
|
142
|
+
if ('frameBorder' in element)
|
|
143
|
+
element.frameBorder = '0';
|
|
144
|
+
if ('scrolling' in element)
|
|
145
|
+
element.scrolling = 'no';
|
|
146
|
+
if ('cellPadding' in element)
|
|
147
|
+
element.cellPadding = '0';
|
|
148
|
+
if ('cellSpacing' in element)
|
|
149
|
+
element.cellSpacing = '0';
|
|
150
|
+
if ('frame' in element)
|
|
151
|
+
element.frame = 'void';
|
|
152
|
+
if ('rules' in element)
|
|
153
|
+
element.rules = 'none';
|
|
154
|
+
if ('noWrap' in element)
|
|
155
|
+
element.noWrap = true;
|
|
156
|
+
element.tabIndex = -1;
|
|
157
|
+
element.setAttribute('role', 'presentation');
|
|
158
|
+
if (focusable) {
|
|
159
|
+
element.style.width = '1px';
|
|
160
|
+
element.style.height = '1px';
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
element.setAttribute('aria-hidden', 'true');
|
|
164
|
+
element.style.width = '0';
|
|
165
|
+
element.style.height = '0';
|
|
166
|
+
element.style.zIndex = '-9999';
|
|
167
|
+
element.style.display = 'none';
|
|
168
|
+
element.style.visibility = 'hidden';
|
|
169
|
+
element.style.pointerEvents = 'none';
|
|
170
|
+
}
|
|
171
|
+
element.style.position = 'absolute';
|
|
172
|
+
element.style.top = '0';
|
|
173
|
+
element.style.left = '0';
|
|
174
|
+
element.style.padding = '0';
|
|
175
|
+
element.style.margin = '0';
|
|
176
|
+
element.style.border = 'none';
|
|
177
|
+
element.style.outline = 'none';
|
|
178
|
+
element.style.clip = 'rect(1px, 1px, 1px, 1px)';
|
|
179
|
+
element.style.clipPath = 'inset(50%)';
|
|
180
|
+
element.style.overflow = 'hidden';
|
|
181
|
+
element.style.whiteSpace = 'nowrap';
|
|
182
|
+
return element;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function dispatchClickEvent(element, view) {
|
|
186
|
+
if (view === void 0) { view = window; }
|
|
187
|
+
var fake;
|
|
188
|
+
try {
|
|
189
|
+
fake = new MouseEvent('click', {
|
|
190
|
+
bubbles: true,
|
|
191
|
+
cancelable: true,
|
|
192
|
+
view: view
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
catch (_) {
|
|
196
|
+
fake = globalThis.document.createEvent('MouseEvents');
|
|
197
|
+
fake.initMouseEvent('click', true, true, view, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
198
|
+
}
|
|
199
|
+
element.dispatchEvent(fake);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function capitalize(_) {
|
|
203
|
+
var groups = [];
|
|
204
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
205
|
+
groups[_i - 1] = arguments[_i];
|
|
206
|
+
}
|
|
207
|
+
var result = '';
|
|
208
|
+
for (var i = 0; i < groups.length - 2; i++) {
|
|
209
|
+
var arg = groups[i];
|
|
210
|
+
if (arg !== undefined)
|
|
211
|
+
result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
|
|
212
|
+
}
|
|
213
|
+
return result;
|
|
214
|
+
}
|
|
215
|
+
function preventDefaultPolyfill() {
|
|
216
|
+
this.returnValue = false;
|
|
217
|
+
}
|
|
218
|
+
function stopPropagationPolyfill() {
|
|
219
|
+
this.cancelBubble = true;
|
|
220
|
+
}
|
|
221
|
+
var EVENT_TYPE_REGEXP = /(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i;
|
|
222
|
+
var VENDORS = ['', 'webkit', 'moz', 'ms', 'MS', 'o', 'O'];
|
|
223
|
+
var LEGACY_TYPE_MAP = {
|
|
224
|
+
'wheel': ['wheel', 'mousewheel', 'DOMMouseScroll'],
|
|
225
|
+
'focus': ['focus', 'focusin'],
|
|
226
|
+
'blur': ['blur', 'focusout'],
|
|
227
|
+
'beforeinput': ['beforeinput', 'textInput'],
|
|
228
|
+
};
|
|
229
|
+
var EventListenerUtils = {
|
|
230
|
+
useStd: typeof globalThis.document !== 'undefined' && typeof globalThis.document.addEventListener === 'function',
|
|
231
|
+
add: function (target, eventListenerOptions) {
|
|
232
|
+
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
233
|
+
var callback = eventListenerOptions.callback;
|
|
234
|
+
if (target === undefined || callback === null)
|
|
235
|
+
return;
|
|
236
|
+
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
237
|
+
var options = eventListenerOptions.options;
|
|
238
|
+
if (typeof target.addEventListener === 'function') {
|
|
239
|
+
try {
|
|
240
|
+
return target.addEventListener(type, callback, options);
|
|
241
|
+
}
|
|
242
|
+
catch (_) {
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (typeof target.addListener === 'function') {
|
|
246
|
+
if (typeof target.matches === 'boolean') {
|
|
247
|
+
try {
|
|
248
|
+
return target.addListener(callback);
|
|
249
|
+
}
|
|
250
|
+
catch (_) {
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
try {
|
|
255
|
+
return target.addListener(type, callback);
|
|
256
|
+
}
|
|
257
|
+
catch (_) {
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function wrapper(event) {
|
|
262
|
+
if (event === undefined)
|
|
263
|
+
event = globalThis.event;
|
|
264
|
+
if (event === undefined)
|
|
265
|
+
return;
|
|
266
|
+
event.currentTarget = target;
|
|
267
|
+
if (typeof event.preventDefault !== 'function')
|
|
268
|
+
event.preventDefault = preventDefaultPolyfill;
|
|
269
|
+
if (typeof event.stopPropagation !== 'function')
|
|
270
|
+
event.stopPropagation = stopPropagationPolyfill;
|
|
271
|
+
if (typeof callback === 'function')
|
|
272
|
+
callback.call(target, event);
|
|
273
|
+
else if (callback && typeof callback.handleEvent === 'function')
|
|
274
|
+
callback.handleEvent.call(target, event);
|
|
275
|
+
}
|
|
276
|
+
if (typeof target.attachEvent === 'function') {
|
|
277
|
+
if (callback.__ieWrapper)
|
|
278
|
+
return target.attachEvent('on' + type, callback.__ieWrapper);
|
|
279
|
+
return target.attachEvent('on' + type, callback.__ieWrapper = wrapper);
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
remove: function (target, eventListenerOptions) {
|
|
283
|
+
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
284
|
+
var callback = eventListenerOptions.callback;
|
|
285
|
+
if (target === undefined || callback === null)
|
|
286
|
+
return;
|
|
287
|
+
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
288
|
+
var options = eventListenerOptions.options;
|
|
289
|
+
if (typeof target.removeEventListener === 'function') {
|
|
290
|
+
try {
|
|
291
|
+
return target.removeEventListener(type, callback, options);
|
|
292
|
+
}
|
|
293
|
+
catch (_) {
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (typeof target.removeListener === 'function') {
|
|
297
|
+
if (typeof target.matches === 'boolean') {
|
|
298
|
+
try {
|
|
299
|
+
return target.removeListener(callback);
|
|
300
|
+
}
|
|
301
|
+
catch (_) {
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
try {
|
|
306
|
+
return target.removeListener(type, callback);
|
|
307
|
+
}
|
|
308
|
+
catch (_) {
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (typeof target.detachEvent === 'function') {
|
|
313
|
+
var wrapper = callback.__ieWrapper;
|
|
314
|
+
if (wrapper !== undefined) {
|
|
315
|
+
target.detachEvent('on' + type, wrapper);
|
|
316
|
+
delete callback.__ieWrapper;
|
|
317
|
+
}
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
withVender: function (target, type) {
|
|
322
|
+
if (type === undefined)
|
|
323
|
+
return '';
|
|
324
|
+
if (target === globalThis.document && ['deviceready', 'pause', 'resume', 'backbutton', 'menubutton', 'searchbutton', 'startcallbutton', 'endcallbutton', 'volumedownbutton', 'volumeupbutton', 'activated', 'cordovacallbackerror'].indexOf(type) > -1)
|
|
325
|
+
return type;
|
|
326
|
+
if (typeof target.webkitEnterFullscreen !== 'undefined' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
|
|
327
|
+
return type;
|
|
328
|
+
var types;
|
|
329
|
+
if (type in LEGACY_TYPE_MAP)
|
|
330
|
+
types = LEGACY_TYPE_MAP[type];
|
|
331
|
+
else if (EVENT_TYPE_REGEXP.test(type))
|
|
332
|
+
types = [type, type.replace(EVENT_TYPE_REGEXP, capitalize)];
|
|
333
|
+
else
|
|
334
|
+
types = [type];
|
|
335
|
+
for (var i = 0; i < VENDORS.length; i++) {
|
|
336
|
+
for (var j = 0; j < types.length; j++) {
|
|
337
|
+
var name_1 = VENDORS[i] + types[j];
|
|
338
|
+
if (typeof target['on' + name_1] !== 'undefined')
|
|
339
|
+
return name_1;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return '';
|
|
343
|
+
}
|
|
344
|
+
};
|
|
38
345
|
|
|
39
346
|
var OS;
|
|
40
347
|
(function (OS) {
|
|
@@ -75,25 +382,31 @@ var Browsers;
|
|
|
75
382
|
Browsers["IE"] = "IE";
|
|
76
383
|
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
77
384
|
})(Browsers || (Browsers = {}));
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
385
|
+
var CrossPlatformFramework;
|
|
386
|
+
(function (CrossPlatformFramework) {
|
|
387
|
+
CrossPlatformFramework["NotACrossPlatformFramework"] = "NotACrossPlatformFramework";
|
|
388
|
+
CrossPlatformFramework["ReactNative"] = "ReactNative";
|
|
389
|
+
CrossPlatformFramework["Electron"] = "Electron";
|
|
390
|
+
CrossPlatformFramework["Cordova"] = "Cordova";
|
|
391
|
+
})(CrossPlatformFramework || (CrossPlatformFramework = {}));
|
|
392
|
+
var USER_AGENT = typeof globalThis.navigator !== 'undefined' && typeof globalThis.navigator.userAgent === 'string' ? globalThis.navigator.userAgent : '';
|
|
393
|
+
|
|
83
394
|
var Platform = {
|
|
84
395
|
device: Devices.Unknown,
|
|
85
396
|
os: OS.Unknown,
|
|
86
|
-
osVersion: '',
|
|
87
397
|
engine: Engines.Unknown,
|
|
88
|
-
engineVersion: '',
|
|
89
398
|
browser: Browsers.Unknown,
|
|
399
|
+
crossPlatformFramework: CrossPlatformFramework.NotACrossPlatformFramework,
|
|
400
|
+
osVersion: '',
|
|
401
|
+
engineVersion: '',
|
|
90
402
|
browserVersion: '',
|
|
91
403
|
renderer: getRenderer(),
|
|
92
|
-
userAgent:
|
|
404
|
+
userAgent: USER_AGENT,
|
|
405
|
+
isNode: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
|
|
93
406
|
isMobile: false,
|
|
94
407
|
isDesktop: false,
|
|
95
408
|
isStandalone: false,
|
|
96
|
-
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(
|
|
409
|
+
isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(USER_AGENT),
|
|
97
410
|
};
|
|
98
411
|
var OS_RESOLVER_MAP = [
|
|
99
412
|
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
@@ -362,6 +675,12 @@ function getSemanticVersion(string) {
|
|
|
362
675
|
build: parseInt(parts[2] || '0')
|
|
363
676
|
};
|
|
364
677
|
}
|
|
678
|
+
if ((typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(USER_AGENT))) {
|
|
679
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Electron;
|
|
680
|
+
}
|
|
681
|
+
if (typeof globalThis.navigator !== 'undefined' && globalThis.navigator.product === 'ReactNative') {
|
|
682
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.ReactNative;
|
|
683
|
+
}
|
|
365
684
|
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
366
685
|
var map = OS_RESOLVER_MAP[i];
|
|
367
686
|
var regexp = map[0];
|
|
@@ -395,424 +714,117 @@ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
|
395
714
|
var map = BROWSER_RESOLVER_MAP[i];
|
|
396
715
|
var regexp = map[0];
|
|
397
716
|
var browser = map[1];
|
|
398
|
-
var resolver = map[2];
|
|
399
|
-
var matched = Platform.userAgent.match(regexp);
|
|
400
|
-
if (matched !== null) {
|
|
401
|
-
Platform.browser = browser;
|
|
402
|
-
Platform.browserVersion = resolveVersion(matched[1], resolver);
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (IS_REACT_NATIVE) {
|
|
407
|
-
try {
|
|
408
|
-
var reactNative = require('react-native');
|
|
409
|
-
var platform = reactNative.Platform;
|
|
410
|
-
var os = platform.OS;
|
|
411
|
-
var release = '' + platform.Version;
|
|
412
|
-
var version = getSemanticVersion(release);
|
|
413
|
-
switch (os) {
|
|
414
|
-
case 'android':
|
|
415
|
-
Platform.os = OS.Android;
|
|
416
|
-
Platform.osVersion = resolveSemanticAndroidVersion(version, release);
|
|
417
|
-
break;
|
|
418
|
-
case 'ios':
|
|
419
|
-
Platform.os = OS.iOS;
|
|
420
|
-
Platform.osVersion = release;
|
|
421
|
-
break;
|
|
422
|
-
case 'windows':
|
|
423
|
-
Platform.os = OS.Windows;
|
|
424
|
-
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
425
|
-
break;
|
|
426
|
-
case 'macos':
|
|
427
|
-
Platform.os = OS.MacOS;
|
|
428
|
-
Platform.osVersion = release;
|
|
429
|
-
break;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
catch (_) {
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
if (IS_NODE_JS) {
|
|
436
|
-
try {
|
|
437
|
-
var os = require('os');
|
|
438
|
-
var platform = os.platform();
|
|
439
|
-
var release = os.release();
|
|
440
|
-
var version = getSemanticVersion(release);
|
|
441
|
-
switch (platform) {
|
|
442
|
-
case 'win32':
|
|
443
|
-
Platform.os = OS.Windows;
|
|
444
|
-
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
445
|
-
break;
|
|
446
|
-
case 'darwin':
|
|
447
|
-
Platform.os = OS.MacOS;
|
|
448
|
-
Platform.osVersion = resolveSemanticDarwinVersion(version, release);
|
|
449
|
-
break;
|
|
450
|
-
case 'android':
|
|
451
|
-
Platform.os = OS.Android;
|
|
452
|
-
Platform.osVersion = release;
|
|
453
|
-
break;
|
|
454
|
-
case 'linux':
|
|
455
|
-
if (/android/i.test(release)) {
|
|
456
|
-
Platform.os = OS.Android;
|
|
457
|
-
Platform.osVersion = release;
|
|
458
|
-
}
|
|
459
|
-
break;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
catch (_) {
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
if (typeof globalThis.document !== 'undefined') {
|
|
466
|
-
globalThis.document.addEventListener("deviceready", function () {
|
|
467
|
-
IS_CORDOVA = true;
|
|
468
|
-
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
469
|
-
switch (globalThis.device.platform) {
|
|
470
|
-
case 'Android':
|
|
471
|
-
Platform.os = OS.Android;
|
|
472
|
-
break;
|
|
473
|
-
case 'iOS':
|
|
474
|
-
Platform.os = OS.iOS;
|
|
475
|
-
break;
|
|
476
|
-
}
|
|
477
|
-
Platform.osVersion = globalThis.device.version;
|
|
478
|
-
}
|
|
479
|
-
}, false);
|
|
480
|
-
}
|
|
481
|
-
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
482
|
-
navigator
|
|
483
|
-
.userAgentData
|
|
484
|
-
.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
485
|
-
.then(function (result) {
|
|
486
|
-
var brands = result.fullVersionList || result.brands || [];
|
|
487
|
-
var platformVersion = result.platformVersion;
|
|
488
|
-
for (var i = 0; i < brands.length; i++) {
|
|
489
|
-
var brand = normalizeBrand(brands[i]);
|
|
490
|
-
var brandName = brand.brand;
|
|
491
|
-
var brandVersion = brand.version;
|
|
492
|
-
if (/not.a.brand/i.test(brandName))
|
|
493
|
-
continue;
|
|
494
|
-
if (brandName === "Chromium")
|
|
495
|
-
Platform.engineVersion = brandVersion;
|
|
496
|
-
}
|
|
497
|
-
if (typeof platformVersion === 'string') {
|
|
498
|
-
if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
|
|
499
|
-
Platform.osVersion = '11';
|
|
500
|
-
else
|
|
501
|
-
Platform.osVersion = platformVersion;
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
}
|
|
505
|
-
Platform.device = Platform.os === OS.iOS || Platform.os === OS.Android ? Devices.Mobile : Platform.os === OS.Windows || Platform.os === OS.MacOS ? Devices.Desktop : Devices.Unknown;
|
|
506
|
-
Platform.isMobile = Platform.device === Devices.Mobile;
|
|
507
|
-
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
508
|
-
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
509
|
-
|
|
510
|
-
function createCustomError(name, Base) {
|
|
511
|
-
if (Base === void 0) { Base = Error; }
|
|
512
|
-
function CustomError(message) {
|
|
513
|
-
if (!(this instanceof CustomError))
|
|
514
|
-
return new CustomError(message);
|
|
515
|
-
var error = new Base(message || '');
|
|
516
|
-
if (typeof Object.setPrototypeOf === 'function')
|
|
517
|
-
Object.setPrototypeOf(error, CustomError.prototype);
|
|
518
|
-
else
|
|
519
|
-
error.__proto__ = CustomError.prototype;
|
|
520
|
-
error.name = name;
|
|
521
|
-
if (message !== undefined)
|
|
522
|
-
error.message = message;
|
|
523
|
-
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
524
|
-
try {
|
|
525
|
-
Object.defineProperty(error, Symbol.toStringTag, {
|
|
526
|
-
value: name,
|
|
527
|
-
writable: false,
|
|
528
|
-
enumerable: false,
|
|
529
|
-
configurable: true
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
catch (_) {
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
if (typeof Error.captureStackTrace === 'function') {
|
|
536
|
-
Error.captureStackTrace(error, CustomError);
|
|
537
|
-
}
|
|
538
|
-
else if (Base.captureStackTrace && typeof Base.captureStackTrace === 'function') {
|
|
539
|
-
Base.captureStackTrace(error, CustomError);
|
|
540
|
-
}
|
|
541
|
-
else {
|
|
542
|
-
try {
|
|
543
|
-
var tempError = new Base();
|
|
544
|
-
if (tempError.stack)
|
|
545
|
-
error.stack = tempError.stack;
|
|
546
|
-
}
|
|
547
|
-
catch (_) {
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
return error;
|
|
551
|
-
}
|
|
552
|
-
CustomError.prototype = Object.create(Base.prototype, {
|
|
553
|
-
constructor: {
|
|
554
|
-
value: CustomError,
|
|
555
|
-
writable: true,
|
|
556
|
-
enumerable: false,
|
|
557
|
-
configurable: true
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
try {
|
|
561
|
-
Object.defineProperty(CustomError.prototype, 'name', {
|
|
562
|
-
value: name,
|
|
563
|
-
writable: true,
|
|
564
|
-
enumerable: false,
|
|
565
|
-
configurable: true
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
catch (_) {
|
|
569
|
-
try {
|
|
570
|
-
CustomError.prototype.name = name;
|
|
571
|
-
}
|
|
572
|
-
catch (_) {
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
try {
|
|
576
|
-
Object.defineProperty(CustomError, 'name', {
|
|
577
|
-
value: name,
|
|
578
|
-
writable: false,
|
|
579
|
-
enumerable: false,
|
|
580
|
-
configurable: true
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
catch (_) {
|
|
584
|
-
}
|
|
585
|
-
return CustomError;
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
var URLOpenError = createCustomError('URLOpenError');
|
|
589
|
-
|
|
590
|
-
function getTopmostWindow() {
|
|
591
|
-
try {
|
|
592
|
-
if (globalThis.top && globalThis.top !== window) {
|
|
593
|
-
void globalThis.top.location.href;
|
|
594
|
-
return globalThis.top;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
catch (_) {
|
|
598
|
-
}
|
|
599
|
-
return window;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
function createHiddenElement(tagName, focusable) {
|
|
603
|
-
if (focusable === void 0) { focusable = true; }
|
|
604
|
-
if (typeof globalThis.document === 'undefined')
|
|
605
|
-
return undefined;
|
|
606
|
-
var element = globalThis.document.createElement(tagName);
|
|
607
|
-
if ('width' in element)
|
|
608
|
-
element.width = '0';
|
|
609
|
-
if ('height' in element)
|
|
610
|
-
element.height = '0';
|
|
611
|
-
if ('border' in element)
|
|
612
|
-
element.border = '0';
|
|
613
|
-
if ('frameBorder' in element)
|
|
614
|
-
element.frameBorder = '0';
|
|
615
|
-
if ('scrolling' in element)
|
|
616
|
-
element.scrolling = 'no';
|
|
617
|
-
if ('cellPadding' in element)
|
|
618
|
-
element.cellPadding = '0';
|
|
619
|
-
if ('cellSpacing' in element)
|
|
620
|
-
element.cellSpacing = '0';
|
|
621
|
-
if ('frame' in element)
|
|
622
|
-
element.frame = 'void';
|
|
623
|
-
if ('rules' in element)
|
|
624
|
-
element.rules = 'none';
|
|
625
|
-
if ('noWrap' in element)
|
|
626
|
-
element.noWrap = true;
|
|
627
|
-
element.tabIndex = -1;
|
|
628
|
-
element.setAttribute('role', 'presentation');
|
|
629
|
-
if (focusable) {
|
|
630
|
-
element.style.width = '1px';
|
|
631
|
-
element.style.height = '1px';
|
|
632
|
-
}
|
|
633
|
-
else {
|
|
634
|
-
element.setAttribute('aria-hidden', 'true');
|
|
635
|
-
element.style.width = '0';
|
|
636
|
-
element.style.height = '0';
|
|
637
|
-
element.style.zIndex = '-9999';
|
|
638
|
-
element.style.display = 'none';
|
|
639
|
-
element.style.visibility = 'hidden';
|
|
640
|
-
element.style.pointerEvents = 'none';
|
|
717
|
+
var resolver = map[2];
|
|
718
|
+
var matched = Platform.userAgent.match(regexp);
|
|
719
|
+
if (matched !== null) {
|
|
720
|
+
Platform.browser = browser;
|
|
721
|
+
Platform.browserVersion = resolveVersion(matched[1], resolver);
|
|
722
|
+
break;
|
|
641
723
|
}
|
|
642
|
-
element.style.position = 'absolute';
|
|
643
|
-
element.style.top = '0';
|
|
644
|
-
element.style.left = '0';
|
|
645
|
-
element.style.padding = '0';
|
|
646
|
-
element.style.margin = '0';
|
|
647
|
-
element.style.border = 'none';
|
|
648
|
-
element.style.outline = 'none';
|
|
649
|
-
element.style.clip = 'rect(1px, 1px, 1px, 1px)';
|
|
650
|
-
element.style.clipPath = 'inset(50%)';
|
|
651
|
-
element.style.overflow = 'hidden';
|
|
652
|
-
element.style.whiteSpace = 'nowrap';
|
|
653
|
-
return element;
|
|
654
724
|
}
|
|
655
|
-
|
|
656
|
-
function dispatchClickEvent(element, view) {
|
|
657
|
-
if (view === void 0) { view = window; }
|
|
658
|
-
var fake;
|
|
725
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative) {
|
|
659
726
|
try {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
727
|
+
var reactNative = require('react-native');
|
|
728
|
+
var platform = reactNative.Platform;
|
|
729
|
+
var os = platform.OS;
|
|
730
|
+
var release = '' + platform.Version;
|
|
731
|
+
var version = getSemanticVersion(release);
|
|
732
|
+
switch (os) {
|
|
733
|
+
case 'android':
|
|
734
|
+
Platform.os = OS.Android;
|
|
735
|
+
Platform.osVersion = resolveSemanticAndroidVersion(version, release);
|
|
736
|
+
break;
|
|
737
|
+
case 'ios':
|
|
738
|
+
Platform.os = OS.iOS;
|
|
739
|
+
Platform.osVersion = release;
|
|
740
|
+
break;
|
|
741
|
+
case 'windows':
|
|
742
|
+
Platform.os = OS.Windows;
|
|
743
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
744
|
+
break;
|
|
745
|
+
case 'macos':
|
|
746
|
+
Platform.os = OS.MacOS;
|
|
747
|
+
Platform.osVersion = release;
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
665
750
|
}
|
|
666
751
|
catch (_) {
|
|
667
|
-
fake = globalThis.document.createEvent('MouseEvents');
|
|
668
|
-
fake.initMouseEvent('click', true, true, view, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
|
669
752
|
}
|
|
670
|
-
element.dispatchEvent(fake);
|
|
671
753
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
754
|
+
if (Platform.isNode) {
|
|
755
|
+
try {
|
|
756
|
+
var os = require('os');
|
|
757
|
+
var platform = os.platform();
|
|
758
|
+
var release = os.release();
|
|
759
|
+
var version = getSemanticVersion(release);
|
|
760
|
+
switch (platform) {
|
|
761
|
+
case 'win32':
|
|
762
|
+
Platform.os = OS.Windows;
|
|
763
|
+
Platform.osVersion = resolveSemanticWindowsVersion(version, release);
|
|
764
|
+
break;
|
|
765
|
+
case 'darwin':
|
|
766
|
+
Platform.os = OS.MacOS;
|
|
767
|
+
Platform.osVersion = resolveSemanticDarwinVersion(version, release);
|
|
768
|
+
break;
|
|
769
|
+
case 'android':
|
|
770
|
+
Platform.os = OS.Android;
|
|
771
|
+
Platform.osVersion = release;
|
|
772
|
+
break;
|
|
773
|
+
case 'linux':
|
|
774
|
+
if (/android/i.test(release)) {
|
|
775
|
+
Platform.os = OS.Android;
|
|
776
|
+
Platform.osVersion = release;
|
|
777
|
+
}
|
|
778
|
+
break;
|
|
779
|
+
}
|
|
677
780
|
}
|
|
678
|
-
|
|
679
|
-
for (var i = 0; i < groups.length - 2; i++) {
|
|
680
|
-
var arg = groups[i];
|
|
681
|
-
if (arg !== undefined)
|
|
682
|
-
result = result + arg.charAt(0).toUpperCase() + arg.slice(1);
|
|
781
|
+
catch (_) {
|
|
683
782
|
}
|
|
684
|
-
return result;
|
|
685
|
-
}
|
|
686
|
-
function preventDefaultPolyfill() {
|
|
687
|
-
this.returnValue = false;
|
|
688
|
-
}
|
|
689
|
-
function stopPropagationPolyfill() {
|
|
690
|
-
this.cancelBubble = true;
|
|
691
783
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
704
|
-
var callback = eventListenerOptions.callback;
|
|
705
|
-
if (target === undefined || callback === null)
|
|
706
|
-
return;
|
|
707
|
-
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
708
|
-
var options = eventListenerOptions.options;
|
|
709
|
-
if (typeof target.addEventListener === 'function') {
|
|
710
|
-
try {
|
|
711
|
-
return target.addEventListener(type, callback, options);
|
|
712
|
-
}
|
|
713
|
-
catch (_) {
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
if (typeof target.addListener === 'function') {
|
|
717
|
-
if (typeof target.matches === 'boolean') {
|
|
718
|
-
try {
|
|
719
|
-
return target.addListener(callback);
|
|
720
|
-
}
|
|
721
|
-
catch (_) {
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
else {
|
|
725
|
-
try {
|
|
726
|
-
return target.addListener(type, callback);
|
|
727
|
-
}
|
|
728
|
-
catch (_) {
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
function wrapper(event) {
|
|
733
|
-
if (event === undefined)
|
|
734
|
-
event = globalThis.event;
|
|
735
|
-
if (event === undefined)
|
|
736
|
-
return;
|
|
737
|
-
event.currentTarget = target;
|
|
738
|
-
if (typeof event.preventDefault !== 'function')
|
|
739
|
-
event.preventDefault = preventDefaultPolyfill;
|
|
740
|
-
if (typeof event.stopPropagation !== 'function')
|
|
741
|
-
event.stopPropagation = stopPropagationPolyfill;
|
|
742
|
-
if (typeof callback === 'function')
|
|
743
|
-
callback.call(target, event);
|
|
744
|
-
else if (callback && typeof callback.handleEvent === 'function')
|
|
745
|
-
callback.handleEvent.call(target, event);
|
|
746
|
-
}
|
|
747
|
-
if (typeof target.attachEvent === 'function') {
|
|
748
|
-
if (callback.__ieWrapper)
|
|
749
|
-
return target.attachEvent('on' + type, callback.__ieWrapper);
|
|
750
|
-
return target.attachEvent('on' + type, callback.__ieWrapper = wrapper);
|
|
751
|
-
}
|
|
752
|
-
},
|
|
753
|
-
remove: function (target, eventListenerOptions) {
|
|
754
|
-
if (eventListenerOptions === void 0) { eventListenerOptions = { callback: null, options: false }; }
|
|
755
|
-
var callback = eventListenerOptions.callback;
|
|
756
|
-
if (target === undefined || callback === null)
|
|
757
|
-
return;
|
|
758
|
-
var type = EventListenerUtils.withVender(target, eventListenerOptions.type);
|
|
759
|
-
var options = eventListenerOptions.options;
|
|
760
|
-
if (typeof target.removeEventListener === 'function') {
|
|
761
|
-
try {
|
|
762
|
-
return target.removeEventListener(type, callback, options);
|
|
763
|
-
}
|
|
764
|
-
catch (_) {
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
if (typeof target.removeListener === 'function') {
|
|
768
|
-
if (typeof target.matches === 'boolean') {
|
|
769
|
-
try {
|
|
770
|
-
return target.removeListener(callback);
|
|
771
|
-
}
|
|
772
|
-
catch (_) {
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
else {
|
|
776
|
-
try {
|
|
777
|
-
return target.removeListener(type, callback);
|
|
778
|
-
}
|
|
779
|
-
catch (_) {
|
|
780
|
-
}
|
|
784
|
+
if (typeof globalThis.document !== 'undefined') {
|
|
785
|
+
globalThis.document.addEventListener("deviceready", function () {
|
|
786
|
+
Platform.crossPlatformFramework = CrossPlatformFramework.Cordova;
|
|
787
|
+
if (Platform.os === OS.Unknown && typeof globalThis.device !== 'undefined') {
|
|
788
|
+
switch (globalThis.device.platform) {
|
|
789
|
+
case 'Android':
|
|
790
|
+
Platform.os = OS.Android;
|
|
791
|
+
break;
|
|
792
|
+
case 'iOS':
|
|
793
|
+
Platform.os = OS.iOS;
|
|
794
|
+
break;
|
|
781
795
|
}
|
|
796
|
+
Platform.osVersion = globalThis.device.version;
|
|
782
797
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
798
|
+
}, false);
|
|
799
|
+
}
|
|
800
|
+
if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
|
|
801
|
+
navigator
|
|
802
|
+
.userAgentData
|
|
803
|
+
.getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
|
|
804
|
+
.then(function (result) {
|
|
805
|
+
var brands = result.fullVersionList || result.brands || [];
|
|
806
|
+
var platformVersion = result.platformVersion;
|
|
807
|
+
for (var i = 0; i < brands.length; i++) {
|
|
808
|
+
var brand = normalizeBrand(brands[i]);
|
|
809
|
+
var brandName = brand.brand;
|
|
810
|
+
var brandVersion = brand.version;
|
|
811
|
+
if (/not.a.brand/i.test(brandName))
|
|
812
|
+
continue;
|
|
813
|
+
if (brandName === "Chromium")
|
|
814
|
+
Platform.engineVersion = brandVersion;
|
|
790
815
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
return type;
|
|
797
|
-
if (typeof target.webkitEnterFullscreen !== 'undefined' && ['webkitbeginfullscreen', 'webkitendfullscreen', 'webkitpresentationmodechanged'].indexOf(type) > -1)
|
|
798
|
-
return type;
|
|
799
|
-
var types;
|
|
800
|
-
if (type in LEGACY_TYPE_MAP)
|
|
801
|
-
types = LEGACY_TYPE_MAP[type];
|
|
802
|
-
else if (EVENT_TYPE_REGEXP.test(type))
|
|
803
|
-
types = [type, type.replace(EVENT_TYPE_REGEXP, capitalize)];
|
|
804
|
-
else
|
|
805
|
-
types = [type];
|
|
806
|
-
for (var i = 0; i < VENDORS.length; i++) {
|
|
807
|
-
for (var j = 0; j < types.length; j++) {
|
|
808
|
-
var name_1 = VENDORS[i] + types[j];
|
|
809
|
-
if (typeof target['on' + name_1] !== 'undefined')
|
|
810
|
-
return name_1;
|
|
811
|
-
}
|
|
816
|
+
if (typeof platformVersion === 'string') {
|
|
817
|
+
if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
|
|
818
|
+
Platform.osVersion = '11';
|
|
819
|
+
else
|
|
820
|
+
Platform.osVersion = platformVersion;
|
|
812
821
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
Platform.device = Platform.os === OS.iOS || Platform.os === OS.Android ? Devices.Mobile : Platform.os === OS.Windows || Platform.os === OS.MacOS ? Devices.Desktop : Devices.Unknown;
|
|
825
|
+
Platform.isMobile = Platform.device === Devices.Mobile;
|
|
826
|
+
Platform.isDesktop = Platform.device === Devices.Desktop;
|
|
827
|
+
Platform.isStandalone = getIsStandalone(Platform.os);
|
|
816
828
|
|
|
817
829
|
var _a;
|
|
818
830
|
var App = {
|
|
@@ -1140,15 +1152,15 @@ function tryOpenURLViaElectron(url) {
|
|
|
1140
1152
|
}
|
|
1141
1153
|
}
|
|
1142
1154
|
function tryOpenURL(url, index, timeout) {
|
|
1143
|
-
if (
|
|
1155
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.ReactNative)
|
|
1144
1156
|
return tryOpenURLViaReactNative(url);
|
|
1145
|
-
if (
|
|
1157
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Electron)
|
|
1146
1158
|
return tryOpenURLViaElectron(url);
|
|
1147
1159
|
var top = getTopmostWindow();
|
|
1148
1160
|
var topDocument = top.document;
|
|
1149
1161
|
var eventType = { focus: undefined, blur: undefined, visibilitychange: undefined };
|
|
1150
1162
|
var eventTarget = { focus: undefined, blur: undefined, visibilitychange: undefined };
|
|
1151
|
-
if (
|
|
1163
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Cordova) {
|
|
1152
1164
|
eventTarget = { focus: topDocument, blur: topDocument };
|
|
1153
1165
|
eventType = { focus: 'resume', blur: 'pause' };
|
|
1154
1166
|
}
|
|
@@ -1242,7 +1254,7 @@ function tryOpenURL(url, index, timeout) {
|
|
|
1242
1254
|
if (!hasFocus(topDocument))
|
|
1243
1255
|
restoreFocus();
|
|
1244
1256
|
try {
|
|
1245
|
-
if (
|
|
1257
|
+
if (Platform.crossPlatformFramework === CrossPlatformFramework.Cordova) {
|
|
1246
1258
|
globalThis.open(url, '_system');
|
|
1247
1259
|
}
|
|
1248
1260
|
else {
|
|
@@ -1261,7 +1273,7 @@ function open(options) {
|
|
|
1261
1273
|
var tried = [];
|
|
1262
1274
|
var infos = {};
|
|
1263
1275
|
var timeout;
|
|
1264
|
-
if (os === OS.Android) {
|
|
1276
|
+
if (Platform.os === OS.Android) {
|
|
1265
1277
|
var option = options[OS.Android] || options['android'];
|
|
1266
1278
|
if (option === undefined)
|
|
1267
1279
|
return Promise.reject(getURLOpenError(tried));
|
|
@@ -1286,7 +1298,7 @@ function open(options) {
|
|
|
1286
1298
|
if (infos.scheme !== undefined && infos.intent === undefined)
|
|
1287
1299
|
infos.intent = createIntentURL(infos.scheme, infos.packageName, infos.fallback);
|
|
1288
1300
|
}
|
|
1289
|
-
else if (os === OS.iOS) {
|
|
1301
|
+
else if (Platform.os === OS.iOS) {
|
|
1290
1302
|
var option = options[OS.iOS] || options['ios'];
|
|
1291
1303
|
if (option === undefined)
|
|
1292
1304
|
return Promise.reject(getURLOpenError(tried));
|
|
@@ -1303,7 +1315,7 @@ function open(options) {
|
|
|
1303
1315
|
if (infos.bundleId !== undefined && infos.trackId === undefined)
|
|
1304
1316
|
infos.trackId = getTrackId(infos.bundleId);
|
|
1305
1317
|
}
|
|
1306
|
-
else if (os === OS.Windows) {
|
|
1318
|
+
else if (Platform.os === OS.Windows) {
|
|
1307
1319
|
var option = options[OS.Windows] || options['windows'];
|
|
1308
1320
|
if (option === undefined)
|
|
1309
1321
|
return Promise.reject(getURLOpenError(tried));
|
|
@@ -1316,7 +1328,7 @@ function open(options) {
|
|
|
1316
1328
|
infos.allowAppStore = option.allowAppStore;
|
|
1317
1329
|
infos.allowWebStore = option.allowWebStore;
|
|
1318
1330
|
}
|
|
1319
|
-
else if (os === OS.MacOS) {
|
|
1331
|
+
else if (Platform.os === OS.MacOS) {
|
|
1320
1332
|
var option = options[OS.MacOS] || options['mac'];
|
|
1321
1333
|
if (option === undefined)
|
|
1322
1334
|
return Promise.reject(getURLOpenError(tried));
|