@operato/utils 0.3.4 → 0.3.13

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.
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Starts monitoring swipes on the given element and
3
+ * emits `swipe` event when a swipe gesture is performed.
4
+ * @param {DOMElement} element Element on which to listen for swipe gestures.
5
+ * @param {Object} options Optional: Options.
6
+ * @return {Object}
7
+ */
8
+ export function SwipeListener(element, options) {
9
+ if (!element)
10
+ return;
11
+ // CustomEvent polyfill
12
+ if (typeof window !== 'undefined') {
13
+ ;
14
+ (function () {
15
+ if (typeof window.CustomEvent === 'function')
16
+ return false;
17
+ function CustomEvent(event, params) {
18
+ params = params || { bubbles: false, cancelable: false, detail: undefined };
19
+ var evt = document.createEvent('CustomEvent');
20
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
21
+ return evt;
22
+ }
23
+ CustomEvent.prototype = window.Event.prototype;
24
+ window.CustomEvent = CustomEvent;
25
+ })();
26
+ }
27
+ let defaultOpts = {
28
+ minHorizontal: 10,
29
+ minVertical: 10,
30
+ deltaHorizontal: 3,
31
+ deltaVertical: 5,
32
+ preventScroll: false,
33
+ lockAxis: true,
34
+ touch: true,
35
+ mouse: true // Listen for mouse events
36
+ };
37
+ // Set options
38
+ if (!options) {
39
+ options = {};
40
+ }
41
+ options = {
42
+ ...defaultOpts,
43
+ ...options
44
+ };
45
+ // Store the touches
46
+ let touches = [];
47
+ // Not dragging by default.
48
+ let dragging = false;
49
+ // When mouse-click is started, make dragging true.
50
+ const _mousedown = function (e) {
51
+ dragging = true;
52
+ };
53
+ // When mouse-click is released, make dragging false and signify end by imitating `touchend`.
54
+ const _mouseup = function (e) {
55
+ dragging = false;
56
+ _touchend(e);
57
+ };
58
+ // When mouse is moved while being clicked, imitate a `touchmove`.
59
+ const _mousemove = function (e) {
60
+ if (dragging) {
61
+ ;
62
+ e.changedTouches = [
63
+ {
64
+ clientX: e.clientX,
65
+ clientY: e.clientY
66
+ }
67
+ ];
68
+ _touchmove(e);
69
+ }
70
+ };
71
+ if (options.mouse) {
72
+ element.addEventListener('mousedown', _mousedown);
73
+ element.addEventListener('mouseup', _mouseup);
74
+ element.addEventListener('mousemove', _mousemove);
75
+ }
76
+ // When the swipe is completed, calculate the direction.
77
+ const _touchend = function (e) {
78
+ if (!touches.length)
79
+ return;
80
+ const touch = typeof TouchEvent === 'function' && e instanceof TouchEvent;
81
+ let x = [], y = [];
82
+ let directions = {
83
+ top: false,
84
+ right: false,
85
+ bottom: false,
86
+ left: false
87
+ };
88
+ for (let i = 0; i < touches.length; i++) {
89
+ x.push(touches[i].x);
90
+ y.push(touches[i].y);
91
+ }
92
+ const xs = x[0], xe = x[x.length - 1], // Start and end x-coords
93
+ ys = y[0], ye = y[y.length - 1]; // Start and end y-coords
94
+ const eventCoords = {
95
+ x: [xs, xe],
96
+ y: [ys, ye]
97
+ };
98
+ if (touches.length > 1) {
99
+ const swipeReleaseEventData = {
100
+ detail: {
101
+ touch,
102
+ target: e.target,
103
+ ...eventCoords
104
+ }
105
+ };
106
+ let swipeReleaseEvent = new CustomEvent('swiperelease', swipeReleaseEventData);
107
+ element.dispatchEvent(swipeReleaseEvent);
108
+ }
109
+ // Determine left or right
110
+ let diff = x[0] - x[x.length - 1];
111
+ let swipe = 'none';
112
+ if (diff > 0) {
113
+ swipe = 'left';
114
+ }
115
+ else {
116
+ swipe = 'right';
117
+ }
118
+ let min = Math.min(...x), max = Math.max(...x), _diff;
119
+ // If minimum horizontal distance was travelled
120
+ if (Math.abs(diff) >= options.minHorizontal) {
121
+ switch (swipe) {
122
+ case 'left':
123
+ _diff = Math.abs(min - x[x.length - 1]);
124
+ if (_diff <= options.deltaHorizontal) {
125
+ directions.left = true;
126
+ }
127
+ break;
128
+ case 'right':
129
+ _diff = Math.abs(max - x[x.length - 1]);
130
+ if (_diff <= options.deltaHorizontal) {
131
+ directions.right = true;
132
+ }
133
+ break;
134
+ }
135
+ }
136
+ // Determine top or bottom
137
+ diff = y[0] - y[y.length - 1];
138
+ swipe = 'none';
139
+ if (diff > 0) {
140
+ swipe = 'top';
141
+ }
142
+ else {
143
+ swipe = 'bottom';
144
+ }
145
+ min = Math.min(...y);
146
+ max = Math.max(...y);
147
+ // If minimum vertical distance was travelled
148
+ if (Math.abs(diff) >= options.minVertical) {
149
+ switch (swipe) {
150
+ case 'top':
151
+ _diff = Math.abs(min - y[y.length - 1]);
152
+ if (_diff <= options.deltaVertical) {
153
+ directions.top = true;
154
+ }
155
+ break;
156
+ case 'bottom':
157
+ _diff = Math.abs(max - y[y.length - 1]);
158
+ if (_diff <= options.deltaVertical) {
159
+ directions.bottom = true;
160
+ }
161
+ break;
162
+ }
163
+ }
164
+ // Clear touches array.
165
+ touches = [];
166
+ // If there is a swipe direction, emit an event.
167
+ if (directions.top || directions.right || directions.bottom || directions.left) {
168
+ /**
169
+ * If lockAxis is true, determine which axis to select.
170
+ * The axis with the most travel is selected.
171
+ * TODO: Factor in for the orientation of the device
172
+ * and use it as a weight to determine the travel along an axis.
173
+ */
174
+ if (options.lockAxis) {
175
+ if ((directions.left || directions.right) && Math.abs(xs - xe) > Math.abs(ys - ye)) {
176
+ directions.top = directions.bottom = false;
177
+ }
178
+ else if ((directions.top || directions.bottom) && Math.abs(xs - xe) < Math.abs(ys - ye)) {
179
+ directions.left = directions.right = false;
180
+ }
181
+ }
182
+ const eventData = {
183
+ detail: {
184
+ directions,
185
+ touch,
186
+ target: e.target,
187
+ ...eventCoords
188
+ }
189
+ };
190
+ let event = new CustomEvent('swipe', eventData);
191
+ element.dispatchEvent(event);
192
+ }
193
+ else {
194
+ let cancelEvent = new CustomEvent('swipecancel', {
195
+ detail: {
196
+ touch,
197
+ target: e.target,
198
+ ...eventCoords
199
+ }
200
+ });
201
+ element.dispatchEvent(cancelEvent);
202
+ }
203
+ };
204
+ // When a swipe is performed, store the coords.
205
+ const _touchmove = function (e) {
206
+ let touch = e.changedTouches[0];
207
+ touches.push({
208
+ x: touch.clientX,
209
+ y: touch.clientY
210
+ });
211
+ // Emit a `swiping` event if there are more than one touch-points.
212
+ if (touches.length > 1) {
213
+ const xs = touches[0].x, // Start and end x-coords
214
+ xe = touches[touches.length - 1].x, ys = touches[0].y, // Start and end y-coords
215
+ ye = touches[touches.length - 1].y, eventData = {
216
+ detail: {
217
+ x: [xs, xe],
218
+ y: [ys, ye],
219
+ touch: typeof TouchEvent === 'function' && e instanceof TouchEvent,
220
+ target: e.target
221
+ }
222
+ };
223
+ let event = new CustomEvent('swiping', eventData);
224
+ const shouldPrevent = options.preventScroll === true || (typeof options.preventScroll === 'function' && options.preventScroll(event));
225
+ if (shouldPrevent) {
226
+ e.preventDefault();
227
+ }
228
+ element.dispatchEvent(event);
229
+ }
230
+ };
231
+ // Test via a getter in the options object to see if the passive property is accessed
232
+ let passiveOptions = false;
233
+ try {
234
+ const testOptions = Object.defineProperty({}, 'passive', {
235
+ get: function () {
236
+ passiveOptions = { passive: !options.preventScroll };
237
+ }
238
+ });
239
+ window.addEventListener('testPassive', null, testOptions);
240
+ window.removeEventListener('testPassive', null, testOptions);
241
+ }
242
+ catch (e) { }
243
+ if (options.touch) {
244
+ element.addEventListener('touchmove', _touchmove, passiveOptions);
245
+ element.addEventListener('touchend', _touchend);
246
+ }
247
+ return {
248
+ off: function () {
249
+ element.removeEventListener('touchmove', _touchmove, passiveOptions);
250
+ element.removeEventListener('touchend', _touchend);
251
+ element.removeEventListener('mousedown', _mousedown);
252
+ element.removeEventListener('mouseup', _mouseup);
253
+ element.removeEventListener('mousemove', _mousemove);
254
+ }
255
+ };
256
+ }
257
+ //# sourceMappingURL=swipe-listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipe-listener.js","sourceRoot":"","sources":["../../src/swipe-listener.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,OAAoB,EAAE,OAAa;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAM;IAEpB,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AAE,QAAQ,CAAC,CAAA;YAChD,OAAO,CAAC,mBAAmB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;QACtD,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["/**\n * Starts monitoring swipes on the given element and\n * emits `swipe` event when a swipe gesture is performed.\n * @param {DOMElement} element Element on which to listen for swipe gestures.\n * @param {Object} options Optional: Options.\n * @return {Object}\n */\nexport function SwipeListener(element: HTMLElement, options?: any) {\n if (!element) return\n\n // CustomEvent polyfill\n if (typeof window !== 'undefined') {\n ;(function () {\n if (typeof window.CustomEvent === 'function') return false\n function CustomEvent(event: string, params: any) {\n params = params || { bubbles: false, cancelable: false, detail: undefined }\n var evt = document.createEvent('CustomEvent')\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)\n return evt\n }\n CustomEvent.prototype = window.Event.prototype\n ;(window as any).CustomEvent = CustomEvent\n })()\n }\n\n let defaultOpts = {\n minHorizontal: 10, // Minimum number of pixels traveled to count as a horizontal swipe.\n minVertical: 10, // Minimum number of pixels traveled to count as a vertical swipe.\n deltaHorizontal: 3, // Delta for horizontal swipe\n deltaVertical: 5, // Delta for vertical swipe\n preventScroll: false, // Prevents scrolling when swiping.\n lockAxis: true, // Select only one axis to be true instead of multiple.\n touch: true, // Listen for touch events\n mouse: true // Listen for mouse events\n }\n\n // Set options\n if (!options) {\n options = {}\n }\n options = {\n ...defaultOpts,\n ...options\n }\n\n // Store the touches\n let touches: Array<{ x: number; y: number }> = []\n\n // Not dragging by default.\n let dragging = false\n\n // When mouse-click is started, make dragging true.\n const _mousedown = function (e: MouseEvent) {\n dragging = true\n }\n\n // When mouse-click is released, make dragging false and signify end by imitating `touchend`.\n const _mouseup = function (e: MouseEvent) {\n dragging = false\n _touchend(e as any)\n }\n\n // When mouse is moved while being clicked, imitate a `touchmove`.\n const _mousemove = function (e: MouseEvent) {\n if (dragging) {\n ;(e as any).changedTouches = [\n {\n clientX: e.clientX,\n clientY: e.clientY\n }\n ]\n _touchmove(e as any)\n }\n }\n\n if (options.mouse) {\n element.addEventListener('mousedown', _mousedown)\n element.addEventListener('mouseup', _mouseup)\n element.addEventListener('mousemove', _mousemove)\n }\n\n // When the swipe is completed, calculate the direction.\n const _touchend = function (e: TouchEvent) {\n if (!touches.length) return\n\n const touch = typeof TouchEvent === 'function' && e instanceof TouchEvent\n\n let x = [],\n y = []\n\n let directions = {\n top: false,\n right: false,\n bottom: false,\n left: false\n }\n\n for (let i = 0; i < touches.length; i++) {\n x.push(touches[i].x)\n y.push(touches[i].y)\n }\n\n const xs = x[0],\n xe = x[x.length - 1], // Start and end x-coords\n ys = y[0],\n ye = y[y.length - 1] // Start and end y-coords\n\n const eventCoords = {\n x: [xs, xe],\n y: [ys, ye]\n }\n\n if (touches.length > 1) {\n const swipeReleaseEventData = {\n detail: {\n touch,\n target: e.target,\n ...eventCoords\n }\n }\n\n let swipeReleaseEvent = new CustomEvent('swiperelease', swipeReleaseEventData)\n element.dispatchEvent(swipeReleaseEvent)\n }\n\n // Determine left or right\n let diff = x[0] - x[x.length - 1]\n let swipe = 'none'\n if (diff > 0) {\n swipe = 'left'\n } else {\n swipe = 'right'\n }\n\n let min = Math.min(...x),\n max = Math.max(...x),\n _diff\n\n // If minimum horizontal distance was travelled\n if (Math.abs(diff) >= options.minHorizontal) {\n switch (swipe) {\n case 'left':\n _diff = Math.abs(min - x[x.length - 1])\n if (_diff <= options.deltaHorizontal) {\n directions.left = true\n }\n break\n case 'right':\n _diff = Math.abs(max - x[x.length - 1])\n if (_diff <= options.deltaHorizontal) {\n directions.right = true\n }\n break\n }\n }\n\n // Determine top or bottom\n diff = y[0] - y[y.length - 1]\n swipe = 'none'\n if (diff > 0) {\n swipe = 'top'\n } else {\n swipe = 'bottom'\n }\n\n min = Math.min(...y)\n max = Math.max(...y)\n\n // If minimum vertical distance was travelled\n if (Math.abs(diff) >= options.minVertical) {\n switch (swipe) {\n case 'top':\n _diff = Math.abs(min - y[y.length - 1])\n if (_diff <= options.deltaVertical) {\n directions.top = true\n }\n break\n case 'bottom':\n _diff = Math.abs(max - y[y.length - 1])\n if (_diff <= options.deltaVertical) {\n directions.bottom = true\n }\n break\n }\n }\n\n // Clear touches array.\n touches = []\n\n // If there is a swipe direction, emit an event.\n if (directions.top || directions.right || directions.bottom || directions.left) {\n /**\n * If lockAxis is true, determine which axis to select.\n * The axis with the most travel is selected.\n * TODO: Factor in for the orientation of the device\n * and use it as a weight to determine the travel along an axis.\n */\n if (options.lockAxis) {\n if ((directions.left || directions.right) && Math.abs(xs - xe) > Math.abs(ys - ye)) {\n directions.top = directions.bottom = false\n } else if ((directions.top || directions.bottom) && Math.abs(xs - xe) < Math.abs(ys - ye)) {\n directions.left = directions.right = false\n }\n }\n\n const eventData = {\n detail: {\n directions,\n touch,\n target: e.target,\n ...eventCoords\n }\n }\n\n let event = new CustomEvent('swipe', eventData)\n element.dispatchEvent(event)\n } else {\n let cancelEvent = new CustomEvent('swipecancel', {\n detail: {\n touch,\n target: e.target,\n ...eventCoords\n }\n })\n element.dispatchEvent(cancelEvent)\n }\n }\n\n // When a swipe is performed, store the coords.\n const _touchmove = function (e: TouchEvent) {\n let touch = e.changedTouches[0]\n touches.push({\n x: touch.clientX,\n y: touch.clientY\n })\n\n // Emit a `swiping` event if there are more than one touch-points.\n if (touches.length > 1) {\n const xs = touches[0].x, // Start and end x-coords\n xe = touches[touches.length - 1].x,\n ys = touches[0].y, // Start and end y-coords\n ye = touches[touches.length - 1].y,\n eventData = {\n detail: {\n x: [xs, xe],\n y: [ys, ye],\n touch: typeof TouchEvent === 'function' && e instanceof TouchEvent,\n target: e.target\n }\n }\n let event = new CustomEvent('swiping', eventData)\n\n const shouldPrevent =\n options.preventScroll === true || (typeof options.preventScroll === 'function' && options.preventScroll(event))\n\n if (shouldPrevent) {\n e.preventDefault()\n }\n\n element.dispatchEvent(event)\n }\n }\n\n // Test via a getter in the options object to see if the passive property is accessed\n let passiveOptions: any = false\n try {\n const testOptions = Object.defineProperty({}, 'passive', {\n get: function () {\n passiveOptions = { passive: !options.preventScroll }\n }\n })\n window.addEventListener('testPassive', null as any, testOptions)\n window.removeEventListener('testPassive', null as any, testOptions)\n } catch (e) {}\n\n if (options.touch) {\n element.addEventListener('touchmove', _touchmove, passiveOptions)\n element.addEventListener('touchend', _touchend)\n }\n\n return {\n off: function () {\n element.removeEventListener('touchmove', _touchmove, passiveOptions)\n element.removeEventListener('touchend', _touchend)\n element.removeEventListener('mousedown', _mousedown)\n element.removeEventListener('mouseup', _mouseup)\n element.removeEventListener('mousemove', _mousemove)\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../src/file-drop-helper.ts","../src/sleep.ts","../src/index.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","69ef8de8a4e2551f1a0e21d82a04d233fb5d7d8a1f8db661a1a18e880b4e7545","d9e51838c1aa2a91b7d2a495adb92ab70eb35c81fcd3b359c2509903958bf3f8","a69b7e4f4ff570049608138b948181b778c51681f4eb9b2b8f3c016b6862c348","0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"c2ab70bbc7a24c42a790890739dd8a0ba9d2e15038b40dff8163a97a5d148c00","affectsGlobalScope":true},"422dbb183fdced59425ca072c8bd09efaa77ce4e2ab928ec0d8a1ce062d2a45a",{"version":"2a801b0322994c3dd7f0ef30265d19b3dd3bae6d793596879166ed6219c3da68","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","bcc8caf03ee65fe8610d258752f255fbdddbb2e4de7b6c5628956a5a0d859ec8","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","cc0b61316c4f37393f1f9595e93b673f4184e9d07f4c127165a490ec4a928668","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"c28e5baab1b53377c90d12970e207a2644bc3627840066449e37e2a59125d07e","affectsGlobalScope":true},"7a5459efa09ea82088234e6533a203d528c594b01787fb90fba148885a36e8b6","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","fce6a1a1553ff7d54ffb8bb3ae488c9cb5f2f4f4e52212c1abe40f544819ef35","ad41bb744149e92adb06eb953da195115620a3f2ad48e7d3ae04d10762dae197","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"f548e3501187467575e639cabc2e845f2e217a50d5f6869e32cace49874a4255","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"bd1a08e30569b0fb2f0b21035eb9b039871f68faa9b98accf847e9c878c5e0a9","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"cfe724f7c694aab65a9bdd1acb05997848c504548c9d4c71645c187a091cfa2a","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"3345c276cab0e76dda86c0fb79104ff915a4580ba0f3e440870e183b1baec476","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","e383ff72aabf294913f8c346f5da1445ae6ad525836d28efd52cbadc01a361a6","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7","1835259a20b9fa6b1882931375b69ae5978195f2b139b4e0db51ec8319261649","b52cd693219a63dd21282ac99a7bf55f77cbe8a91f097968856419cc2e05f017","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"267af67ea520cabd16402522756b19ac63d9e2c1c86e7c4d1ddeb991c32e12c9",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":true,"target":5,"useDefineForClassFields":false},"fileIdsList":[[87],[44,87],[47,87],[48,53,87],[49,59,60,67,76,86,87],[49,50,59,67,87],[51,87],[52,53,60,68,87],[53,76,83,87],[54,56,59,67,87],[55,87],[56,57,87],[58,59,87],[59,87],[59,60,61,76,86,87],[59,60,61,76,87],[62,67,76,86,87],[59,60,62,63,67,76,83,86,87],[62,64,76,83,86,87],[44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],[59,65,87],[66,86,87],[56,59,67,76,87],[68,87],[69,87],[47,70,87],[71,85,87,91],[72,87],[73,87],[59,74,87],[74,75,87,89],[59,76,77,78,87],[76,78,87],[76,77,87],[79,87],[80,87],[59,81,82,87],[81,82,87],[53,67,76,83,87],[84,87],[67,85,87],[48,62,73,86,87],[53,87],[76,87,88],[87,89],[87,90],[48,53,59,61,70,76,86,87,89,91],[76,87,92],[40,87],[40,41,42,87]],"referencedMap":[[95,1],[44,2],[45,2],[47,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,12],[58,13],[59,14],[60,15],[61,16],[46,1],[93,1],[62,17],[63,18],[64,19],[94,20],[65,21],[66,22],[67,23],[68,24],[69,25],[70,26],[71,27],[72,28],[73,29],[74,30],[75,31],[76,32],[78,33],[77,34],[79,35],[80,36],[81,37],[82,38],[83,39],[84,40],[85,41],[86,42],[87,43],[88,44],[89,45],[90,46],[91,47],[92,48],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[41,49],[43,50],[42,49]],"exportedModulesMap":[[95,1],[44,2],[45,2],[47,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,12],[58,13],[59,14],[60,15],[61,16],[46,1],[93,1],[62,17],[63,18],[64,19],[94,20],[65,21],[66,22],[67,23],[68,24],[69,25],[70,26],[71,27],[72,28],[73,29],[74,30],[75,31],[76,32],[78,33],[77,34],[79,35],[80,36],[81,37],[82,38],[83,39],[84,40],[85,41],[86,42],[87,43],[88,44],[89,45],[90,46],[91,47],[92,48],[40,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[38,1],[34,1],[35,1],[36,1],[37,1],[1,1],[39,1],[41,49],[43,50],[42,49]],"semanticDiagnosticsPerFile":[95,44,45,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,46,93,62,63,64,94,65,66,67,68,69,70,71,72,73,74,75,76,78,77,79,80,81,82,83,84,85,86,87,88,89,90,91,92,40,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,38,34,35,36,37,1,39,41,43,42]},"version":"4.5.4"}
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../node_modules/tslib/tslib.d.ts","../src/context-path.ts","../src/file-drop-helper.ts","../src/fullscreen.ts","../src/sleep.ts","../src/os.ts","../src/swipe-listener.ts","../src/parse-jwt.ts","../src/password-pattern.ts","../src/index.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/lodash/debounce.d.ts","../src/mixins/infinite-scrollable.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"12f4cfe2fe60b810c3174537bc2ddb20c1067b7768643d12cb1266fd183afb75","a84f74a36313258ea3bf2fa085568a35530a423035037be03ce67e02c768787f","69ef8de8a4e2551f1a0e21d82a04d233fb5d7d8a1f8db661a1a18e880b4e7545","b18b9acb5cff76a70fec4f1effd260b9f956bba6edb28c1e160979f0b9a51dd6","d9e51838c1aa2a91b7d2a495adb92ab70eb35c81fcd3b359c2509903958bf3f8","18bfe66747a8e166875e847933a51947a32018b4adbe1f33e9cbc7356f84ced5","d1d0e3e5bd9e070e932c938bd580da6fce3b6a9e230b7156584f7b38ce3a9c4e","f1f7164489347eacf6f1239bcae173a72047ee9be4ba8cd7f4f6af42e8155ce8","75c214d02f82e035a0dc7ca93601b3ddecd4a723d32d1d9f45bd429debbc36f9","9fd0dfe089f09d54a9cf1c9e3a2b2b878fe2ea1b25b55de7050ff4f171d00766","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d88a479cccf787b4aa82362150fbeba5211a32dbfafa7b92ba6995ecaf9a1a89","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","6ac6f24aff52e62c3950461aa17eab26e3a156927858e6b654baef0058b4cd1e",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"a5f9563c1315cffbc1e73072d96dcd42332f4eebbdffd7c3e904f545c9e9fe24","1d12501ae0fc9ed02db30f621fb6f82fdf3fea76b0c82300a86ad7b7e61f8a79","0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"c2ab70bbc7a24c42a790890739dd8a0ba9d2e15038b40dff8163a97a5d148c00","affectsGlobalScope":true},"422dbb183fdced59425ca072c8bd09efaa77ce4e2ab928ec0d8a1ce062d2a45a",{"version":"2a801b0322994c3dd7f0ef30265d19b3dd3bae6d793596879166ed6219c3da68","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","bcc8caf03ee65fe8610d258752f255fbdddbb2e4de7b6c5628956a5a0d859ec8","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","cc0b61316c4f37393f1f9595e93b673f4184e9d07f4c127165a490ec4a928668","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"c28e5baab1b53377c90d12970e207a2644bc3627840066449e37e2a59125d07e","affectsGlobalScope":true},"7a5459efa09ea82088234e6533a203d528c594b01787fb90fba148885a36e8b6","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","fce6a1a1553ff7d54ffb8bb3ae488c9cb5f2f4f4e52212c1abe40f544819ef35","ad41bb744149e92adb06eb953da195115620a3f2ad48e7d3ae04d10762dae197","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"5d0a9ea09d990b5788f867f1c79d4878f86f7384cb7dab38eecbf22f9efd063d","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"cfe724f7c694aab65a9bdd1acb05997848c504548c9d4c71645c187a091cfa2a","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"3345c276cab0e76dda86c0fb79104ff915a4580ba0f3e440870e183b1baec476","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","e383ff72aabf294913f8c346f5da1445ae6ad525836d28efd52cbadc01a361a6","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7","1835259a20b9fa6b1882931375b69ae5978195f2b139b4e0db51ec8319261649","b52cd693219a63dd21282ac99a7bf55f77cbe8a91f097968856419cc2e05f017","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"267af67ea520cabd16402522756b19ac63d9e2c1c86e7c4d1ddeb991c32e12c9",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":false,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"outDir":"./","rootDir":"..","sourceMap":true,"strict":true,"target":5,"useDefineForClassFields":false},"fileIdsList":[[50,52,53,54,55,56,57,58,59,60,61,62,108],[50,51,53,54,55,56,57,58,59,60,61,62,108],[51,52,53,54,55,56,57,58,59,60,61,62,108],[50,51,52,54,55,56,57,58,59,60,61,62,108],[50,51,52,53,55,56,57,58,59,60,61,62,108],[50,51,52,53,54,56,57,58,59,60,61,62,108],[50,51,52,53,54,55,57,58,59,60,61,62,108],[50,51,52,53,54,55,56,58,59,60,61,62,108],[50,51,52,53,54,55,56,57,59,60,61,62,108],[50,51,52,53,54,55,56,57,58,60,61,62,108],[50,51,52,53,54,55,56,57,58,59,61,62,108],[50,51,52,53,54,55,56,57,58,59,60,62,108],[62,108],[50,51,52,53,54,55,56,57,58,59,60,61,108],[108],[65,108],[68,108],[69,74,108],[70,80,81,88,97,107,108],[70,71,80,88,108],[72,108],[73,74,81,89,108],[74,97,104,108],[75,77,80,88,108],[76,108],[77,78,108],[79,80,108],[80,108],[80,81,82,97,107,108],[80,81,82,97,108],[83,88,97,107,108],[80,81,83,84,88,97,104,107,108],[83,85,97,104,107,108],[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114],[80,86,108],[87,107,108],[77,80,88,97,108],[89,108],[90,108],[68,91,108],[92,106,108,112],[93,108],[94,108],[80,95,108],[95,96,108,110],[80,97,98,99,108],[97,99,108],[97,98,108],[100,108],[101,108],[80,102,103,108],[102,103,108],[74,88,97,104,108],[105,108],[88,106,108],[69,83,94,107,108],[74,108],[97,108,109],[108,110],[108,111],[69,74,80,82,91,97,107,108,110,112],[97,108,113],[40,108],[40,41,42,43,44,45,46,47,48,108],[40,63,108]],"referencedMap":[[51,1],[52,2],[50,3],[53,4],[54,5],[55,6],[56,7],[57,8],[58,9],[59,10],[60,11],[61,12],[63,13],[62,14],[116,15],[65,16],[66,16],[68,17],[69,18],[70,19],[71,20],[72,21],[73,22],[74,23],[75,24],[76,25],[77,26],[78,26],[79,27],[80,28],[81,29],[82,30],[67,15],[114,15],[83,31],[84,32],[85,33],[115,34],[86,35],[87,36],[88,37],[89,38],[90,39],[91,40],[92,41],[93,42],[94,43],[95,44],[96,45],[97,46],[99,47],[98,48],[100,49],[101,50],[102,51],[103,52],[104,53],[105,54],[106,55],[107,56],[108,57],[109,58],[110,59],[111,60],[112,61],[113,62],[40,15],[8,15],[10,15],[9,15],[2,15],[11,15],[12,15],[13,15],[14,15],[15,15],[16,15],[17,15],[18,15],[3,15],[4,15],[22,15],[19,15],[20,15],[21,15],[23,15],[24,15],[25,15],[5,15],[26,15],[27,15],[28,15],[29,15],[6,15],[30,15],[31,15],[32,15],[33,15],[7,15],[38,15],[34,15],[35,15],[36,15],[37,15],[1,15],[39,15],[41,63],[42,63],[43,63],[49,64],[64,65],[45,63],[47,63],[48,63],[44,63],[46,63]],"exportedModulesMap":[[51,1],[52,2],[50,3],[53,4],[54,5],[55,6],[56,7],[57,8],[58,9],[59,10],[60,11],[61,12],[63,13],[62,14],[116,15],[65,16],[66,16],[68,17],[69,18],[70,19],[71,20],[72,21],[73,22],[74,23],[75,24],[76,25],[77,26],[78,26],[79,27],[80,28],[81,29],[82,30],[67,15],[114,15],[83,31],[84,32],[85,33],[115,34],[86,35],[87,36],[88,37],[89,38],[90,39],[91,40],[92,41],[93,42],[94,43],[95,44],[96,45],[97,46],[99,47],[98,48],[100,49],[101,50],[102,51],[103,52],[104,53],[105,54],[106,55],[107,56],[108,57],[109,58],[110,59],[111,60],[112,61],[113,62],[40,15],[8,15],[10,15],[9,15],[2,15],[11,15],[12,15],[13,15],[14,15],[15,15],[16,15],[17,15],[18,15],[3,15],[4,15],[22,15],[19,15],[20,15],[21,15],[23,15],[24,15],[25,15],[5,15],[26,15],[27,15],[28,15],[29,15],[6,15],[30,15],[31,15],[32,15],[33,15],[7,15],[38,15],[34,15],[35,15],[36,15],[37,15],[1,15],[39,15],[41,63],[42,63],[43,63],[49,64],[64,65],[45,63],[47,63],[48,63],[44,63],[46,63]],"semanticDiagnosticsPerFile":[51,52,50,53,54,55,56,57,58,59,60,61,63,62,116,65,66,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,67,114,83,84,85,115,86,87,88,89,90,91,92,93,94,95,96,97,99,98,100,101,102,103,104,105,106,107,108,109,110,111,112,113,40,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,38,34,35,36,37,1,39,41,42,43,49,64,45,47,48,44,46]},"version":"4.5.4"}
package/package.json CHANGED
@@ -3,11 +3,18 @@
3
3
  "description": "Webcomponent utils following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "heartyoh",
6
- "version": "0.3.4",
6
+ "version": "0.3.13",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "exports": {
10
- ".": "./dist/src/index.js"
10
+ ".": "./dist/src/index.js",
11
+ "./fullscreen.js": "./dist/src/fullscreen.js",
12
+ "./os.js": "./dist/src/os.js",
13
+ "./swipe-listener.js": "./dist/src/swipe-listener.js",
14
+ "./sleep.js": "./dist/src/sleep.js",
15
+ "./file-drop-helper.js": "./dist/src/file-drop-helper.js",
16
+ "./context-path.js": "./dist/src/context-path.js",
17
+ "./mixins/infinite-scrollable.js": "./dist/src/mixins/infinite-scrollable.js"
11
18
  },
12
19
  "publishConfig": {
13
20
  "access": "public",
@@ -62,5 +69,8 @@
62
69
  "prettier --write"
63
70
  ]
64
71
  },
65
- "gitHead": "730f7f88d9feaec4e42fdfa8f4bd9503f04df72e"
72
+ "dependencies": {
73
+ "lodash": "^4.17.21"
74
+ },
75
+ "gitHead": "1c655a621af7ea9981bd2b9c9d1bbabe71305e63"
66
76
  }
@@ -0,0 +1,17 @@
1
+ const CONTEXT_PATH_PREFIX = 'domain|business'
2
+
3
+ export function getPathInfo(pathname: string) {
4
+ var regexp = new RegExp(`(/(${CONTEXT_PATH_PREFIX})/([^/]+))?(/?.*)`)
5
+ var matched = pathname.match(regexp)
6
+ var contextPath = matched?.[1] || ''
7
+ var prefix = matched?.[2] || ''
8
+ var domain = matched?.[3] || ''
9
+ var path = matched?.[4]
10
+
11
+ return {
12
+ contextPath,
13
+ prefix,
14
+ domain,
15
+ path
16
+ }
17
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * 풀스크린 전환 이후와 풀스크린 해제 이후에 호출되는 콜백함수
3
+ * @callback FullscreenCallback
4
+ */
5
+ export type FullscreenCallback = () => void
6
+
7
+ /**
8
+ * 엘리먼트를 풀스크린으로 표시되도록 한다.
9
+ * @param {HTMLElement} element 대상 엘리먼트
10
+ * @param {FullscreenCallback} afterfull 풀스크린이 된 이후에 호출되는 콜백함수
11
+ * @param {FullscreenCallback} afterfinish 풀스크린이 해제된 이후에 호출되는 콜백함수
12
+ */
13
+ export function fullscreen(element: HTMLElement, afterfull?: FullscreenCallback, afterfinish?: FullscreenCallback) {
14
+ var org_width = element.style.width
15
+ var org_height = element.style.height
16
+
17
+ function _fullscreen_callback(e: Event) {
18
+ if (
19
+ !document.fullscreenElement &&
20
+ //@ts-ignore
21
+ !document.mozFullScreen &&
22
+ //@ts-ignore
23
+ !document.webkitIsFullScreen &&
24
+ //@ts-ignore
25
+ !document.msFullscreenElement
26
+ ) {
27
+ ;['fullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event =>
28
+ document.removeEventListener(event, _fullscreen_callback)
29
+ )
30
+
31
+ element.style.width = org_width
32
+ element.style.height = org_height
33
+
34
+ afterfinish && afterfinish()
35
+ } else {
36
+ element.style.width = '100%'
37
+ element.style.height = '100%'
38
+
39
+ afterfull && afterfull()
40
+ }
41
+ }
42
+
43
+ ;['fullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event =>
44
+ document.addEventListener(event, _fullscreen_callback)
45
+ )
46
+
47
+ if (element.requestFullscreen) element.requestFullscreen()
48
+ //@ts-ignore
49
+ else if (element.webkitRequestFullScreen) element.webkitRequestFullScreen()
50
+ //@ts-ignore
51
+ else if (element.mozRequestFullScreen) element.mozRequestFullScreen()
52
+ //@ts-ignore
53
+ else if (element.msRequestFullscreen) element.msRequestFullscreen()
54
+ }
55
+
56
+ export function exitfullscreen() {
57
+ if (document.exitFullscreen) document.exitFullscreen()
58
+ //@ts-ignore
59
+ else if (document.mozCancelFullScreen) document.mozCancelFullScreen()
60
+ //@ts-ignore
61
+ else if (document.webkitCancelFullScreen) document.webkitCancelFullScreen()
62
+ //@ts-ignore
63
+ else if (document.msExitFullscreen) document.msExitFullscreen()
64
+ }
65
+
66
+ export function togglefullscreen(
67
+ element: HTMLElement,
68
+ afterfull?: FullscreenCallback,
69
+ afterfinish?: FullscreenCallback
70
+ ) {
71
+ if (
72
+ !document.fullscreenElement &&
73
+ //@ts-ignore
74
+ !document.mozFullScreen &&
75
+ //@ts-ignore
76
+ !document.webkitIsFullScreen &&
77
+ //@ts-ignore
78
+ !document.msFullscreenElement
79
+ )
80
+ fullscreen(element, afterfull, afterfinish)
81
+ else exitfullscreen()
82
+ }
package/src/index.ts CHANGED
@@ -1,2 +1,8 @@
1
- export * from './sleep'
2
- export * from './file-drop-helper'
1
+ export * from './sleep.js'
2
+ export * from './file-drop-helper.js'
3
+ export * from './context-path.js'
4
+ export * from './os.js'
5
+ export * from './swipe-listener.js'
6
+ export * from './fullscreen.js'
7
+ export * from './parse-jwt.js'
8
+ export * from './password-pattern.js'
@@ -0,0 +1,40 @@
1
+ import debounce from 'lodash/debounce'
2
+
3
+ type Constructor = new (...args: any[]) => {}
4
+
5
+ export default function InfiniteScrollable<TBase extends Constructor>(Base: TBase) {
6
+ return class Scrolling extends Base {
7
+ _infiniteScrollOptions = {
8
+ threshold: 20,
9
+ limit: 30,
10
+ totalProp: '_total',
11
+ pageProp: '_page'
12
+ }
13
+
14
+ onScroll = debounce(e => {
15
+ var el = this.scrollTargetEl
16
+ if (!el) {
17
+ return
18
+ }
19
+
20
+ var { threshold = 0, limit, totalProp, pageProp } = this._infiniteScrollOptions
21
+
22
+ if (
23
+ (this as any)[pageProp] < (this as any)[totalProp] / limit &&
24
+ el.scrollHeight - el.clientHeight <= el.scrollTop + threshold
25
+ ) {
26
+ this.scrollAction()
27
+ }
28
+ }, 300)
29
+
30
+ get scrollTargetEl(): HTMLElement | null {
31
+ console.warn('scroll target element is not defined.')
32
+
33
+ return null
34
+ }
35
+
36
+ async scrollAction() {
37
+ console.warn('scroll action not implemented.')
38
+ }
39
+ }
40
+ }
package/src/os.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * method to tell if platform of running browser is kind of mobile device
3
+ * @returns {boolean}
4
+ */
5
+ export function isMobileDevice() {
6
+ return window.matchMedia('(max-width: 767px)').matches
7
+ }
8
+
9
+ /**
10
+ * method to tell if operating system of running browser is iOS
11
+ * @returns {boolean}
12
+ */
13
+ export function isIOS() {
14
+ //@ts-ignore
15
+ return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream
16
+ }
17
+
18
+ /**
19
+ * method to tell if operating system of running browser is MacOS
20
+ * @returns {boolean}
21
+ */
22
+ export function isMacOS() {
23
+ return navigator.userAgent.indexOf('Mac') != -1
24
+ }
25
+
26
+ export function isSafari() {
27
+ return !navigator.userAgent.match(/chrome|chromium|crios/i) && navigator.userAgent.match(/safari/i)
28
+ }
@@ -0,0 +1,21 @@
1
+ var atob: any =
2
+ typeof atob !== 'undefined'
3
+ ? atob
4
+ : (base64: string) => {
5
+ return Buffer.from(base64, 'base64').toString()
6
+ }
7
+
8
+ export function parseJwt(token: string): any {
9
+ var base64Url = token.split('.')[1]
10
+ var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
11
+ var jsonPayload = decodeURIComponent(
12
+ atob(base64)
13
+ .split('')
14
+ .map(function (c: string) {
15
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
16
+ })
17
+ .join('')
18
+ )
19
+
20
+ return JSON.parse(jsonPayload)
21
+ }