shopar-plugin 0.7.4-alpha.3 → 0.7.4

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.
@@ -201,6 +201,23 @@ PERFORMANCE OF THIS SOFTWARE.
201
201
  * =============================================================================
202
202
  */
203
203
 
204
+ /**
205
+ * @license
206
+ * Copyright 2023 Google LLC.
207
+ * Licensed under the Apache License, Version 2.0 (the "License");
208
+ * you may not use this file except in compliance with the License.
209
+ * You may obtain a copy of the License at
210
+ *
211
+ * http://www.apache.org/licenses/LICENSE-2.0
212
+ *
213
+ * Unless required by applicable law or agreed to in writing, software
214
+ * distributed under the License is distributed on an "AS IS" BASIS,
215
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
216
+ * See the License for the specific language governing permissions and
217
+ * limitations under the License.
218
+ * =============================================================================
219
+ */
220
+
204
221
  /**
205
222
  * @license
206
223
  * Copyright 2023 Google LLC. All Rights Reserved.
@@ -503,4 +503,10 @@ export declare class DeepAR {
503
503
  * Resets tone mapping to the one that was specified within an effect file.
504
504
  */
505
505
  resetToneMapping(): void;
506
+ /**
507
+ * Sets the input video/camera rotation.
508
+ *
509
+ * @param rotation
510
+ */
511
+ setVideoRotation(rotation: number): void;
506
512
  }
@@ -80,6 +80,10 @@ export interface DeepARParams {
80
80
  * Can be "user" or "environment". User will be a front facing camera on mobile devices, while environment will be the back facing camera. Default is "user".
81
81
  */
82
82
  facingMode?: string;
83
+ /**
84
+ * Rotate the input camera. valid values: 0, 90, 180, 270.
85
+ */
86
+ rotation?: number;
83
87
  /**
84
88
  * Called when the camera permission is asked.
85
89
  */
@@ -293,6 +297,9 @@ export interface DeepARParams {
293
297
  * Tone mapping.
294
298
  */
295
299
  toneMapping?: ToneMapping;
300
+ /**
301
+ * @internal
302
+ */
296
303
  onVerify?: (x: any) => any;
297
304
  };
298
305
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * DeepAR Web SDK version.
3
3
  */
4
- declare const version = "5.6.6-test-alpha-210";
4
+ declare const version = "5.6.6-shopar";
5
5
  export { version };
@@ -0,0 +1,506 @@
1
+ # Blender 4.0.2
2
+ # www.blender.org
3
+ o foot-right-593
4
+ v 3.493493 -1.268400 4.097427
5
+ v -2.665580 -1.553605 0.515584
6
+ v -2.717207 -1.593497 1.517754
7
+ v 3.096442 -0.137222 4.196724
8
+ v -1.250542 -1.647299 -2.702633
9
+ v 3.277949 2.158581 -7.366480
10
+ v -2.150677 2.500865 -9.815022
11
+ v -1.881188 -1.639495 0.463831
12
+ v -1.135285 0.522178 -0.049048
13
+ v -1.189944 -1.719505 -1.512143
14
+ v 3.708835 -1.372140 3.143969
15
+ v 3.481355 -0.798109 4.396039
16
+ v 4.055679 -0.742501 3.489604
17
+ v 1.850696 -1.495964 3.927697
18
+ v 2.769648 -1.165399 4.429564
19
+ v 2.432951 -1.614270 3.286349
20
+ v -2.586604 -1.581199 -2.136254
21
+ v -2.809271 0.162170 -1.398785
22
+ v -2.413261 -0.560448 1.138679
23
+ v -2.678592 -1.409528 1.800867
24
+ v -2.658818 -1.174085 1.763798
25
+ v -2.967838 -1.234237 1.112000
26
+ v 2.292746 -1.657782 -0.630454
27
+ v 2.284825 -1.574026 1.482029
28
+ v 2.138926 -0.746424 4.552808
29
+ v 1.826681 -0.259686 4.159352
30
+ v 0.145463 -1.597898 -2.251771
31
+ v 1.172312 -1.015896 -3.941179
32
+ v 2.407624 -1.547549 -1.593077
33
+ v -1.651213 -0.500573 -8.682105
34
+ v -1.149742 -1.408562 -4.489002
35
+ v -0.184926 -1.082147 -5.420763
36
+ v -0.488972 0.689867 -14.913762
37
+ v 0.419874 0.632856 -15.333393
38
+ v -0.571460 -0.079674 -13.496238
39
+ v -1.085944 0.384628 -13.495565
40
+ v 2.613483 0.334656 -13.144159
41
+ v 2.725136 1.353358 -13.849046
42
+ v 2.841804 4.858887 -10.527215
43
+ v 2.680608 4.600781 -12.112723
44
+ v 3.019842 0.957827 -8.540087
45
+ v 2.981496 1.226770 -12.457829
46
+ v -2.688277 0.913609 -7.722145
47
+ v -2.391547 2.120177 -8.041261
48
+ v -1.908782 4.106802 -9.687854
49
+ v -1.915242 3.762520 -11.218586
50
+ v -2.080218 1.663956 -10.654223
51
+ v -2.122781 0.426224 -9.764613
52
+ v -1.907329 -0.032760 -9.665165
53
+ v -2.918219 -0.447485 -5.599372
54
+ v -3.238653 -0.244154 -4.508717
55
+ v -2.931154 -1.415366 -2.389086
56
+ v -3.396683 -0.794657 -2.199305
57
+ v -3.277377 -0.147470 -1.938980
58
+ v -2.632283 1.423792 -6.150446
59
+ v -1.682856 1.863607 -4.166433
60
+ v -1.945356 2.921957 -7.102166
61
+ v -1.511504 4.761775 -8.630571
62
+ v -0.415573 3.363956 -4.986281
63
+ v -0.387761 5.248563 -7.625167
64
+ v 1.287056 5.389028 -7.608476
65
+ v -1.395853 4.021281 -13.072028
66
+ v -0.450736 4.599067 -14.521903
67
+ v -0.825460 2.055530 -14.648381
68
+ v -1.440583 1.921651 -13.286095
69
+ v 0.139658 4.845506 -15.035983
70
+ v 0.324064 2.390648 -15.670342
71
+ v 0.777420 5.007576 -15.132179
72
+ v 0.904201 2.754066 -15.781592
73
+ v 1.428185 0.741418 -15.427825
74
+ v 1.698723 2.869515 -15.441997
75
+ v 1.995386 0.902026 -15.112062
76
+ v 1.826227 -0.174594 -13.678450
77
+ v 0.845821 -0.318956 -13.731177
78
+ v 1.900953 -0.341401 -12.127693
79
+ v 0.130141 -0.625783 -10.636457
80
+ v -0.304786 -0.389508 -12.382499
81
+ v -0.173678 -0.763249 -7.864836
82
+ v -0.909149 -0.728700 -8.411684
83
+ v 1.500500 -0.288800 -7.393453
84
+ v 1.676161 -0.423620 -5.528619
85
+ v 3.013458 0.390314 -5.613921
86
+ v 3.068805 -0.041832 -4.403095
87
+ v 3.677436 -1.035661 -1.740203
88
+ v 3.696185 -1.294852 -0.382872
89
+ v 4.177698 -0.796446 2.588493
90
+ v 4.063449 -0.141053 2.138413
91
+ v 3.960575 -0.350473 3.350919
92
+ v 3.379051 -0.474692 4.385287
93
+ v 3.135754 0.993233 0.370364
94
+ v 3.191975 0.487746 2.384642
95
+ v 3.038985 1.765924 -1.950236
96
+ v 4.008371 0.430324 -1.480206
97
+ v 3.466957 1.710307 -4.731249
98
+ v 4.143972 -0.553090 -0.941228
99
+ v 3.941565 -0.256007 -2.598271
100
+ v 3.395876 1.133185 -5.559489
101
+ v 2.695451 0.465881 -7.549995
102
+ v 2.778720 0.382612 -12.098856
103
+ v 2.674358 3.844680 -6.887899
104
+ v 2.823408 2.629326 -3.993881
105
+ v 1.291298 3.561684 -4.370032
106
+ v 1.523466 1.344244 -0.228959
107
+ v -0.511988 1.968271 -2.641506
108
+ v 2.558833 5.307809 -8.992738
109
+ v 2.279659 4.827816 -13.505116
110
+ v 2.701473 2.496245 -13.666631
111
+ v 1.546742 5.014976 -14.576999
112
+ v -3.104900 -0.915566 0.427258
113
+ v -0.133980 -1.582090 3.192957
114
+ v -2.004064 -1.783144 1.854821
115
+ v -0.791818 -1.548447 3.234907
116
+ v -2.484846 -1.649676 1.848395
117
+ v -0.012751 -1.306023 3.930007
118
+ v -0.932618 -1.143198 3.492485
119
+ v -0.060320 -0.684289 3.773515
120
+ v -0.872827 -0.782208 3.285248
121
+ v -0.314227 -0.328373 2.988199
122
+ v -2.463258 -1.736776 1.522424
123
+ v -1.048337 -0.147823 1.542929
124
+ v 1.159065 0.510098 1.523273
125
+ v 2.409624 0.156836 3.287348
126
+ v 3.113309 -1.424564 3.969714
127
+ v 2.717391 -0.197224 4.315508
128
+ v 2.653400 0.641180 -13.687723
129
+ v -0.411130 1.210474 -15.164309
130
+ v 0.398362 1.396366 -15.658464
131
+ v 1.915192 1.666795 -15.422181
132
+ v 1.369880 -0.525916 -12.063953
133
+ v 3.722443 0.679274 -0.197635
134
+ v 2.389422 -0.024713 -12.048052
135
+ v 3.312767 2.008885 -3.970142
136
+ v 0.468014 2.892867 -3.408174
137
+ v 2.516858 4.686830 -12.860903
138
+ v 2.116430 2.862443 -14.880667
139
+ v -3.166120 -1.240898 -1.781371
140
+ v 4.014788 -1.130682 3.098155
141
+ v 3.187707 -1.539661 3.112259
142
+ v -2.408137 -1.509312 -3.248885
143
+ v 0.368197 0.094769 -14.675917
144
+ v -1.968447 3.865142 -10.374638
145
+ v -2.880629 -1.026026 -4.354803
146
+ v -3.271665 -0.904663 -3.126354
147
+ v -2.340508 1.653741 -5.450163
148
+ v -1.762446 4.420399 -9.146877
149
+ v -0.319595 2.296955 -15.233745
150
+ v 2.406130 1.263301 -14.670062
151
+ v 2.022266 0.314597 -14.501474
152
+ v 3.299604 -1.437652 1.173774
153
+ v 4.022306 -0.940044 -0.861773
154
+ v 3.081338 0.888392 -7.027977
155
+ v 2.204731 0.069098 -8.242702
156
+ v 2.263582 2.166326 -2.059151
157
+ v 2.022384 5.383266 -8.198249
158
+ v -3.360806 -0.674612 -1.296498
159
+ v -0.439102 -1.577629 1.202998
160
+ v 1.018172 -1.252952 4.217589
161
+ v -0.097129 -1.000045 3.965488
162
+ v 3.803310 -1.075754 3.924807
163
+ v -2.957304 -1.419592 0.838186
164
+ v 2.790245 4.667728 -11.323300
165
+ v -3.355909 -0.171486 -3.134023
166
+ v -1.736221 1.416937 -3.103640
167
+ v -1.164904 3.107101 -5.711294
168
+ v 0.418715 5.347423 -7.430505
169
+ v -1.023473 1.068572 -14.239973
170
+ v -1.707653 3.833995 -12.175900
171
+ v 1.343059 1.564542 -15.773653
172
+ v 1.325041 2.823475 -15.713838
173
+ v 2.379308 -0.469358 -4.277666
174
+ v 3.666894 0.031088 3.119953
175
+ v 4.144165 -0.055759 -1.456963
176
+ v 3.766929 -0.536197 4.051866
177
+ v 3.490763 0.414792 -4.458779
178
+ v 2.937774 0.751355 -12.231247
179
+ v 2.794713 5.089291 -9.810385
180
+ v -2.891733 -0.653957 0.529973
181
+ v 0.315689 0.829576 0.315924
182
+ v -2.635945 -0.826367 1.357457
183
+ v 3.055156 2.791194 -11.064740
184
+ v -1.669340 0.849727 -12.145147
185
+ v -1.050235 5.050004 -8.079413
186
+ v -1.044691 4.246847 -13.733924
187
+ v 4.187198 -0.518414 2.566460
188
+ v 0.228312 3.660955 -15.398685
189
+ v 1.436812 0.120481 -14.733003
190
+ v 0.606530 -0.515852 -12.557848
191
+ v 0.481858 -0.652588 -7.457066
192
+ v 3.227045 -1.280219 -1.715263
193
+ v 2.922948 -0.713597 4.602629
194
+ v 3.770793 0.232193 2.168300
195
+ v 2.435882 1.254523 0.020572
196
+ v 3.815809 0.684566 -3.546581
197
+ v 3.092418 3.092720 -7.200329
198
+ v 2.004727 3.742208 -5.231478
199
+ v -3.164994 -1.168566 0.199920
200
+ v -0.915331 -1.415736 3.344880
201
+ v 0.942900 -0.855112 4.303597
202
+ v 2.320038 0.799226 1.327200
203
+ v -0.308423 0.298519 -14.615201
204
+ s 1
205
+ f 124 4 122
206
+ f 1 159 12
207
+ f 8 2 17
208
+ f 20 21 22
209
+ f 100 194 176
210
+ f 27 28 29
211
+ f 23 27 29
212
+ f 10 27 23
213
+ f 5 10 17
214
+ f 17 139 5
215
+ f 5 31 27
216
+ f 180 39 6
217
+ f 6 42 180
218
+ f 7 44 45
219
+ f 43 7 47
220
+ f 181 49 48
221
+ f 143 53 51
222
+ f 162 54 55
223
+ f 55 44 162
224
+ f 54 144 55
225
+ f 18 163 144
226
+ f 58 145 57
227
+ f 164 60 182
228
+ f 18 104 163
229
+ f 163 104 56
230
+ f 191 91 171
231
+ f 65 47 167
232
+ f 167 47 46
233
+ f 64 166 65
234
+ f 64 126 166
235
+ f 166 36 181
236
+ f 65 181 47
237
+ f 63 146 64
238
+ f 185 69 67
239
+ f 148 73 186
240
+ f 186 73 74
241
+ f 74 140 186
242
+ f 73 75 129
243
+ f 187 129 76
244
+ f 76 77 187
245
+ f 77 76 79
246
+ f 76 78 79
247
+ f 30 49 35
248
+ f 12 190 15 1
249
+ f 129 80 188
250
+ f 81 28 32
251
+ f 28 27 31
252
+ f 23 85 149
253
+ f 149 85 11
254
+ f 150 95 86
255
+ f 88 13 184
256
+ f 184 13 86
257
+ f 88 173 13
258
+ f 173 12 159
259
+ f 122 199 121
260
+ f 122 91 199
261
+ f 123 14 16
262
+ f 93 132 130
263
+ f 172 95 96
264
+ f 174 97 193
265
+ f 41 6 151
266
+ f 97 6 94
267
+ f 97 174 82
268
+ f 82 98 151
269
+ f 151 98 41
270
+ f 99 175 98
271
+ f 131 37 99
272
+ f 195 101 100
273
+ f 96 84 83
274
+ f 150 85 84
275
+ f 153 92 101
276
+ f 92 153 192
277
+ f 100 154 195
278
+ f 103 133 178
279
+ f 133 59 104
280
+ f 102 165 133
281
+ f 147 72 128
282
+ f 116 26 118
283
+ f 108 135 71
284
+ f 106 134 107
285
+ f 107 40 161
286
+ f 107 161 180
287
+ f 180 42 107
288
+ f 53 155 162
289
+ f 109 177 54
290
+ f 22 177 109
291
+ f 196 136 160
292
+ f 53 143 136
293
+ f 136 52 17
294
+ f 52 142 139
295
+ f 142 30 139
296
+ f 10 8 17
297
+ f 117 118 19
298
+ f 20 115 21
299
+ f 112 110 14
300
+ f 110 112 111
301
+ f 111 119 8
302
+ f 114 115 197
303
+ f 113 20 3
304
+ f 3 22 160
305
+ f 113 3 119
306
+ f 120 178 9
307
+ f 118 122 120
308
+ f 26 122 118
309
+ f 4 89 173
310
+ f 15 14 123
311
+ f 15 123 1
312
+ f 137 159 1 11
313
+ f 26 124 122
314
+ f 56 104 59 164
315
+ f 159 137 13
316
+ f 125 37 73 148
317
+ f 164 57 144
318
+ f 164 144 56
319
+ f 3 20 22
320
+ f 147 125 148 72
321
+ f 25 190 124 26
322
+ f 125 147 38
323
+ f 190 89 4 124
324
+ f 6 39 176 194
325
+ f 105 100 176
326
+ f 140 200 33 34
327
+ f 10 5 27
328
+ f 5 139 31
329
+ f 79 32 31
330
+ f 35 36 33 200
331
+ f 200 140 35
332
+ f 46 47 7 141
333
+ f 180 161 39
334
+ f 6 41 42
335
+ f 7 43 44
336
+ f 7 45 141
337
+ f 48 43 47 181
338
+ f 142 48 49 30
339
+ f 48 142 50
340
+ f 51 43 48 50
341
+ f 143 51 50 142
342
+ f 43 51 162 44
343
+ f 142 52 143
344
+ f 51 53 162
345
+ f 57 44 55 144
346
+ f 54 18 144
347
+ f 144 163 56
348
+ f 182 58 57 164
349
+ f 145 45 44
350
+ f 57 145 44
351
+ f 164 59 60
352
+ f 171 88 87 191
353
+ f 80 98 82 81
354
+ f 171 91 4
355
+ f 98 80 152
356
+ f 64 65 62 183
357
+ f 185 146 63 66
358
+ f 183 63 64
359
+ f 62 65 167
360
+ f 166 126 33
361
+ f 166 33 36
362
+ f 65 166 181
363
+ f 181 36 49
364
+ f 127 126 146 67
365
+ f 146 185 67
366
+ f 64 146 126
367
+ f 34 33 126 127
368
+ f 69 185 66 68
369
+ f 168 127 67 69
370
+ f 70 34 127 168
371
+ f 128 168 169 71
372
+ f 69 169 168
373
+ f 128 72 70 168
374
+ f 186 70 72 148
375
+ f 34 70 186 140
376
+ f 129 187 74 73
377
+ f 74 35 140
378
+ f 35 74 187 77
379
+ f 35 77 79 30
380
+ f 139 30 79 31
381
+ f 35 49 36
382
+ f 79 78 32
383
+ f 188 78 76 129
384
+ f 81 32 188 80
385
+ f 129 75 80
386
+ f 170 81 82 83
387
+ f 78 188 32
388
+ f 81 170 28
389
+ f 170 189 29 28
390
+ f 83 84 189 170
391
+ f 189 85 23 29
392
+ f 28 31 32
393
+ f 149 138 16 24
394
+ f 85 189 84
395
+ f 24 23 149
396
+ f 150 137 11 85
397
+ f 138 149 11
398
+ f 25 15 190
399
+ f 190 12 89
400
+ f 172 184 86 95
401
+ f 137 150 86
402
+ f 86 13 137
403
+ f 130 191 87 93
404
+ f 184 172 87
405
+ f 87 88 184
406
+ f 191 90 91
407
+ f 173 89 12
408
+ f 13 173 159
409
+ f 122 4 91
410
+ f 191 130 90
411
+ f 199 192 103 121
412
+ f 152 80 75 131
413
+ f 192 199 90
414
+ f 98 152 131 99
415
+ f 123 138 11 1
416
+ f 138 123 16
417
+ f 92 90 130 132
418
+ f 194 132 94 6
419
+ f 93 94 132
420
+ f 101 92 132
421
+ f 100 101 132 194
422
+ f 172 193 94 93
423
+ f 37 131 75 73
424
+ f 193 172 96
425
+ f 96 174 193
426
+ f 193 97 94
427
+ f 151 6 97
428
+ f 174 96 83
429
+ f 82 174 83
430
+ f 97 82 151
431
+ f 98 175 41
432
+ f 175 42 41
433
+ f 175 99 37 125
434
+ f 42 175 125 38
435
+ f 153 195 102 103
436
+ f 96 95 150
437
+ f 96 150 84
438
+ f 93 87 172
439
+ f 195 153 101
440
+ f 61 102 195 154
441
+ f 90 92 192
442
+ f 192 153 103
443
+ f 100 105 154
444
+ f 128 71 135 147
445
+ f 103 102 133
446
+ f 178 133 104
447
+ f 104 9 178
448
+ f 133 165 59
449
+ f 102 61 165
450
+ f 165 60 59
451
+ f 147 135 107 38
452
+ f 68 108 71 169
453
+ f 116 198 26
454
+ f 198 25 26
455
+ f 135 108 106
456
+ f 135 106 107
457
+ f 104 18 9
458
+ f 9 18 19
459
+ f 196 109 54 155
460
+ f 169 69 68
461
+ f 107 134 40
462
+ f 107 42 38
463
+ f 54 162 155
464
+ f 53 196 155
465
+ f 54 177 18
466
+ f 177 19 18
467
+ f 160 22 109 196
468
+ f 179 19 177 22
469
+ f 22 21 179
470
+ f 17 2 160 136
471
+ f 114 157 198 158
472
+ f 196 53 136
473
+ f 136 143 52
474
+ f 139 17 52
475
+ f 117 116 118
476
+ f 179 21 117
477
+ f 19 179 117
478
+ f 198 116 158
479
+ f 157 15 25 198
480
+ f 116 117 115 158
481
+ f 115 114 158
482
+ f 156 10 23 24
483
+ f 21 115 117
484
+ f 14 110 16
485
+ f 111 112 113
486
+ f 114 112 14 157
487
+ f 10 156 8
488
+ f 110 24 16
489
+ f 110 156 24
490
+ f 156 110 111
491
+ f 8 156 111
492
+ f 115 20 113 197
493
+ f 14 15 157
494
+ f 112 114 197
495
+ f 112 197 113
496
+ f 173 88 171 4
497
+ f 199 91 90
498
+ f 3 160 119
499
+ f 119 111 113
500
+ f 119 2 8
501
+ f 119 160 2
502
+ f 19 120 9
503
+ f 19 118 120
504
+ f 178 121 103
505
+ f 120 121 178
506
+ f 120 122 121
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepar",
3
- "version": "5.6.6-test-alpha-210",
3
+ "version": "5.6.6-shopar",
4
4
  "description": "The official DeepAR Web SDK",
5
5
  "main": "js/deepar.esm.js",
6
6
  "jsdelivr": "js/deepar.js",
Binary file
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShopAR__analytics={})}(this,(function(t){"use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t){return Number.isInteger(t)&&t>=0}function n(t){this.name="ArgumentError",this.message=t}var s=e((function(t,e){if(e=e||{},"function"!=typeof t)throw new n("fetch must be a function");if("object"!=typeof e)throw new n("defaults must be an object");if(void 0!==e.retries&&!i(e.retries))throw new n("retries must be a positive integer");if(void 0!==e.retryDelay&&!i(e.retryDelay)&&"function"!=typeof e.retryDelay)throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==e.retryOn&&!Array.isArray(e.retryOn)&&"function"!=typeof e.retryOn)throw new n("retryOn property expects an array or function");return e=Object.assign({retries:3,retryDelay:1e3,retryOn:[]},e),function(s,r){var a=e.retries,o=e.retryDelay,c=e.retryOn;if(r&&void 0!==r.retries){if(!i(r.retries))throw new n("retries must be a positive integer");a=r.retries}if(r&&void 0!==r.retryDelay){if(!i(r.retryDelay)&&"function"!=typeof r.retryDelay)throw new n("retryDelay must be a positive integer or a function returning a positive integer");o=r.retryDelay}if(r&&r.retryOn){if(!Array.isArray(r.retryOn)&&"function"!=typeof r.retryOn)throw new n("retryOn property expects an array or function");c=r.retryOn}return new Promise((function(e,i){var n=function(n){var o="undefined"!=typeof Request&&s instanceof Request?s.clone():s;t(o,r).then((function(t){if(Array.isArray(c)&&-1===c.indexOf(t.status))e(t);else if("function"==typeof c)try{return Promise.resolve(c(n,null,t)).then((function(i){i?u(n,null,t):e(t)})).catch(i)}catch(t){i(t)}else n<a?u(n,null,t):e(t)})).catch((function(t){if("function"==typeof c)try{Promise.resolve(c(n,t,null)).then((function(e){e?u(n,t,null):i(t)})).catch((function(t){i(t)}))}catch(t){i(t)}else n<a?u(n,t,null):i(t)}))};function u(t,e,i){var s="function"==typeof o?o(t,e,i):o;setTimeout((function(){n(++t)}),s)}n(0)}))}}));var r,a;!function(t){t.unknown="unknown",t.user="user",t.organization="organization",t.anonymous="anonymous"}(r||(r={})),function(t){t.api="api",t.query="query",t.ingest="ingest"}(a||(a={}));class o{scope;type;value;remaining;reset;constructor(t=r.unknown,e=a.api,i=0,n=-1,s=new Date){this.scope=t,this.type=e,this.value=i,this.remaining=n,this.reset=s}}function c(t,e,i,n,s){let a=new o;const c=t.headers.get(e.toLowerCase())||r.unknown;a.scope=r[c];const u=t.headers.get(i.toLowerCase())||"",h=parseInt(u,10);isNaN(h)||(a.value=h);const l=t.headers.get(n.toLowerCase())||"",f=parseInt(l,10);isNaN(f)||(a.remaining=f);const m=t.headers.get(s.toLowerCase())||"",y=parseInt(m,10);return isNaN(y)||(a.reset=new Date(1e3*y)),a}class u{config;constructor(t){this.config=t}async doReq(t,e,i={},n={}){let r=`${this.config.baseUrl}${t}`;const o=this._prepareSearchParams(n);o&&(r+=`?${o.toString()}`);const u={...this.config.headers,...i.headers},l=await s(fetch)(r,{retries:3,retryDelay:function(t,e,i){return 1e3*Math.pow(2,t)},retryOn:[503,502,504,500],headers:u,method:e,body:i.body?i.body:void 0});if(204===l.status)return l;if(429==l.status){const t=function(t){let e;return t.url?.endsWith("/ingest")?(e=c(t,"","X-IngestLimit-Limit","X-IngestLimit-Remaining","X-IngestLimit-Reset"),e.type=a.ingest):t.url?.endsWith("/query")||t.url?.endsWith("/_apl")?(e=c(t,"","X-QueryLimit-Limit","X-QueryLimit-Remaining","X-QueryLimit-Reset"),e.type=a.query):(e=c(t,"X-RateLimit-Scope","X-RateLimit-Limit","X-RateLimit-Remaining","X-RateLimit-Reset"),e.type=a.api),e}(l);return Promise.reject(new h(t))}if(401===l.status)return Promise.reject(new Error("Forbidden"));if(l.status>=400){const t=await l.json();return Promise.reject(new Error(t.message))}return await l.json()}post(t,e={},i={}){return this.doReq(t,"POST",e,i)}get(t,e={},i={}){return this.doReq(t,"GET",e,i)}put(t,e={},i={}){return this.doReq(t,"PUT",e,i)}delete(t,e={},i={}){return this.doReq(t,"DELETE",e,i)}_prepareSearchParams=t=>{const e=new URLSearchParams;let i=!1;return Object.keys(t).forEach((n=>{t[n]&&(e.append(n,t[n]),i=!0)})),i?e:null}}class h extends Error{limit;shortcircuit;message="";constructor(t,e=!1){super(),this.limit=t,this.shortcircuit=e,Object.setPrototypeOf(this,h.prototype);const i=h.timeUntilReset(t);this.message=`${t.type} limit exceeded, try again in ${i.minutes}m${i.seconds}s`,t.type==a.api&&(this.message=`${t.scope} `+this.message)}static timeUntilReset(t){const e=t.reset.getTime()-(new Date).getTime(),i=Math.floor(e/1e3%60);return{total:e,minutes:Math.floor(e/1e3/60%60),seconds:i}}}class l{client;constructor({orgId:t="",token:e,url:i}){e||console.warn("Missing Axiom token");const n=i??"https://api.axiom.co",s={Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+e};"undefined"==typeof window&&(s["User-Agent"]="axiom-js/1.0.0-rc.1"),t&&(s["X-Axiom-Org-Id"]=t),this.client=new u({baseUrl:n,headers:s,timeout:3e3})}}var f,m,y,p,d,g;!function(t){t.TimestampField="_time";t.Service=class extends l{localPath="/v1/datasets";list=()=>this.client.get(this.localPath);get=t=>this.client.get(this.localPath+"/"+t);create=t=>this.client.post(this.localPath,{body:JSON.stringify(t)});update=(t,e)=>this.client.put(this.localPath+"/"+t,{body:JSON.stringify(e)});delete=t=>this.client.delete(this.localPath+"/"+t);trim=(t,e)=>{const i={maxDuration:e};return this.client.post(this.localPath+"/"+t+"/trim",{body:JSON.stringify(i)})}}}(f||(f={})),function(t){t.Service=class extends l{current=()=>this.client.get("/v1/user")}}(m||(m={}));class w{ingestFn;id;options;events=[];activeFlush=Promise.resolve();nextFlush=setTimeout((()=>{}),0);lastFlush=new Date;constructor(t,e,i){this.ingestFn=t,this.id=e,this.options=i}ingest=t=>{Array.isArray(t)?this.events=this.events.concat(t):this.events.push(t),this.events.length>=1e3||this.lastFlush.getTime()<Date.now()-1e3?(clearTimeout(this.nextFlush),this.activeFlush=this.flush()):(clearTimeout(this.nextFlush),this.nextFlush=setTimeout((()=>{this.activeFlush=this.flush()}),1e3))};flush=async()=>{const t=this.events.splice(0,this.events.length);if(clearTimeout(this.nextFlush),await this.activeFlush,0===t.length)return void(this.lastFlush=new Date);const e=await this.ingestFn(this.id,t,this.options);return this.lastFlush=new Date,e}}class v extends l{datasets;users;localPath="/v1";constructor(t){super(t),this.datasets=new f.Service(t),this.users=new m.Service(t)}ingestRaw=(t,e,i=y.JSON,n=p.Identity,s)=>this.client.post(this.localPath+"/datasets/"+t+"/ingest",{headers:{"Content-Type":i,"Content-Encoding":n},body:e},{"timestamp-field":s?.timestampField,"timestamp-format":s?.timestampFormat,"csv-delimiter":s?.csvDelimiter});queryLegacy=(t,e,i)=>this.client.post(this.localPath+"/datasets/"+t+"/query",{body:JSON.stringify(e)},{"streaming-duration":i?.streamingDuration,nocache:i?.noCache});query=(t,e)=>{const i={apl:t};return e?.startTime&&(i.startTime=e?.startTime),e?.endTime&&(i.endTime=e?.endTime),this.client.post(this.localPath+"/datasets/_apl",{body:JSON.stringify(i)},{"streaming-duration":e?.streamingDuration,nocache:e?.noCache,format:"legacy"})};aplQuery=(t,e)=>this.query(t,e)}class b extends v{batch={};ingest=(t,e,i)=>{const n=function(t,e){return`${t}:${e?.timestampField||"-"}:${e?.timestampFormat||"-"}:${e?.csvDelimiter||"-"}`}(t,i);return this.batch[n]||(this.batch[n]=new w(((t,e,i)=>{const n=(Array.isArray(e)?e:[e]).map((t=>JSON.stringify(t))).join("\n");return this.ingestRaw(t,n,y.NDJSON,p.Identity,i)}),t,i)),this.batch[n].ingest(e)};flush=async()=>{let t=[];for(const e in this.batch)t.push(this.batch[e].flush());await Promise.all(t)}}let x;!function(t){t.JSON="application/json",t.NDJSON="application/x-ndjson",t.CSV="text/csv"}(y||(y={})),function(t){t.Identity="",t.GZIP="gzip"}(p||(p={})),function(t){t.Count="count",t.Distinct="distinct",t.Sum="sum",t.Avg="avg",t.Min="min",t.Max="max",t.Topk="topk",t.Percentiles="percentiles",t.Histogram="histogram",t.Variance="variance",t.Stdev="stdev",t.ArgMin="argmin",t.ArgMax="argmax",t.MakeSet="makeset",t.MakeSetIf="makesetif",t.CountIf="countif",t.CountDistinctIf="distinctif"}(d||(d={})),function(t){t.And="and",t.Or="or",t.Not="not",t.Equal="==",t.NotEqual="!=",t.Exists="exists",t.NotExists="not-exists",t.GreaterThan=">",t.GreaterThanOrEqualTo=">=",t.LessThan="<",t.LessThanOrEqualTo="<=",t.Gt="gt",t.Gte="gte",t.Lt="lt",t.Lte="lte",t.StartsWith="starts-with",t.NotStartsWith="not-starts-with",t.EndsWith="ends-with",t.NotEndsWith="not-ends-with",t.Contains="contains",t.NotContains="not-contains",t.Regexp="regexp",t.NotRegexp="not-regexp"}(g||(g={})),t.initializeImpl=function(){x=new b({token:"xaat-16d05fdd-4ab9-4990-acba-7cee24974bfb"})},t.trackEventImpl=function(t,e){x.ingest("shopar-plugin-alpha",Object.assign({name:t},e))}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ShopAR__analytics={})}(this,(function(t){"use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function i(t){return Number.isInteger(t)&&t>=0}function n(t){this.name="ArgumentError",this.message=t}var s=e((function(t,e){if(e=e||{},"function"!=typeof t)throw new n("fetch must be a function");if("object"!=typeof e)throw new n("defaults must be an object");if(void 0!==e.retries&&!i(e.retries))throw new n("retries must be a positive integer");if(void 0!==e.retryDelay&&!i(e.retryDelay)&&"function"!=typeof e.retryDelay)throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==e.retryOn&&!Array.isArray(e.retryOn)&&"function"!=typeof e.retryOn)throw new n("retryOn property expects an array or function");return e=Object.assign({retries:3,retryDelay:1e3,retryOn:[]},e),function(s,r){var a=e.retries,o=e.retryDelay,c=e.retryOn;if(r&&void 0!==r.retries){if(!i(r.retries))throw new n("retries must be a positive integer");a=r.retries}if(r&&void 0!==r.retryDelay){if(!i(r.retryDelay)&&"function"!=typeof r.retryDelay)throw new n("retryDelay must be a positive integer or a function returning a positive integer");o=r.retryDelay}if(r&&r.retryOn){if(!Array.isArray(r.retryOn)&&"function"!=typeof r.retryOn)throw new n("retryOn property expects an array or function");c=r.retryOn}return new Promise((function(e,i){var n=function(n){var o="undefined"!=typeof Request&&s instanceof Request?s.clone():s;t(o,r).then((function(t){if(Array.isArray(c)&&-1===c.indexOf(t.status))e(t);else if("function"==typeof c)try{return Promise.resolve(c(n,null,t)).then((function(i){i?u(n,null,t):e(t)})).catch(i)}catch(t){i(t)}else n<a?u(n,null,t):e(t)})).catch((function(t){if("function"==typeof c)try{Promise.resolve(c(n,t,null)).then((function(e){e?u(n,t,null):i(t)})).catch((function(t){i(t)}))}catch(t){i(t)}else n<a?u(n,t,null):i(t)}))};function u(t,e,i){var s="function"==typeof o?o(t,e,i):o;setTimeout((function(){n(++t)}),s)}n(0)}))}}));var r,a;!function(t){t.unknown="unknown",t.user="user",t.organization="organization",t.anonymous="anonymous"}(r||(r={})),function(t){t.api="api",t.query="query",t.ingest="ingest"}(a||(a={}));class o{scope;type;value;remaining;reset;constructor(t=r.unknown,e=a.api,i=0,n=-1,s=new Date){this.scope=t,this.type=e,this.value=i,this.remaining=n,this.reset=s}}function c(t,e,i,n,s){let a=new o;const c=t.headers.get(e.toLowerCase())||r.unknown;a.scope=r[c];const u=t.headers.get(i.toLowerCase())||"",h=parseInt(u,10);isNaN(h)||(a.value=h);const l=t.headers.get(n.toLowerCase())||"",f=parseInt(l,10);isNaN(f)||(a.remaining=f);const m=t.headers.get(s.toLowerCase())||"",y=parseInt(m,10);return isNaN(y)||(a.reset=new Date(1e3*y)),a}class u{config;constructor(t){this.config=t}async doReq(t,e,i={},n={}){let r=`${this.config.baseUrl}${t}`;const o=this._prepareSearchParams(n);o&&(r+=`?${o.toString()}`);const u={...this.config.headers,...i.headers},l=await s(fetch)(r,{retries:3,retryDelay:function(t,e,i){return 1e3*Math.pow(2,t)},retryOn:[503,502,504,500],headers:u,method:e,body:i.body?i.body:void 0});if(204===l.status)return l;if(429==l.status){const t=function(t){let e;return t.url?.endsWith("/ingest")?(e=c(t,"","X-IngestLimit-Limit","X-IngestLimit-Remaining","X-IngestLimit-Reset"),e.type=a.ingest):t.url?.endsWith("/query")||t.url?.endsWith("/_apl")?(e=c(t,"","X-QueryLimit-Limit","X-QueryLimit-Remaining","X-QueryLimit-Reset"),e.type=a.query):(e=c(t,"X-RateLimit-Scope","X-RateLimit-Limit","X-RateLimit-Remaining","X-RateLimit-Reset"),e.type=a.api),e}(l);return Promise.reject(new h(t))}if(401===l.status)return Promise.reject(new Error("Forbidden"));if(l.status>=400){const t=await l.json();return Promise.reject(new Error(t.message))}return await l.json()}post(t,e={},i={}){return this.doReq(t,"POST",e,i)}get(t,e={},i={}){return this.doReq(t,"GET",e,i)}put(t,e={},i={}){return this.doReq(t,"PUT",e,i)}delete(t,e={},i={}){return this.doReq(t,"DELETE",e,i)}_prepareSearchParams=t=>{const e=new URLSearchParams;let i=!1;return Object.keys(t).forEach((n=>{t[n]&&(e.append(n,t[n]),i=!0)})),i?e:null}}class h extends Error{limit;shortcircuit;message="";constructor(t,e=!1){super(),this.limit=t,this.shortcircuit=e,Object.setPrototypeOf(this,h.prototype);const i=h.timeUntilReset(t);this.message=`${t.type} limit exceeded, try again in ${i.minutes}m${i.seconds}s`,t.type==a.api&&(this.message=`${t.scope} `+this.message)}static timeUntilReset(t){const e=t.reset.getTime()-(new Date).getTime(),i=Math.floor(e/1e3%60);return{total:e,minutes:Math.floor(e/1e3/60%60),seconds:i}}}class l{client;constructor({orgId:t="",token:e,url:i}){e||console.warn("Missing Axiom token");const n=i??"https://api.axiom.co",s={Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+e};"undefined"==typeof window&&(s["User-Agent"]="axiom-js/1.0.0-rc.1"),t&&(s["X-Axiom-Org-Id"]=t),this.client=new u({baseUrl:n,headers:s,timeout:3e3})}}var f,m,y,p,d,g;!function(t){t.TimestampField="_time";t.Service=class extends l{localPath="/v1/datasets";list=()=>this.client.get(this.localPath);get=t=>this.client.get(this.localPath+"/"+t);create=t=>this.client.post(this.localPath,{body:JSON.stringify(t)});update=(t,e)=>this.client.put(this.localPath+"/"+t,{body:JSON.stringify(e)});delete=t=>this.client.delete(this.localPath+"/"+t);trim=(t,e)=>{const i={maxDuration:e};return this.client.post(this.localPath+"/"+t+"/trim",{body:JSON.stringify(i)})}}}(f||(f={})),function(t){t.Service=class extends l{current=()=>this.client.get("/v1/user")}}(m||(m={}));class w{ingestFn;id;options;events=[];activeFlush=Promise.resolve();nextFlush=setTimeout((()=>{}),0);lastFlush=new Date;constructor(t,e,i){this.ingestFn=t,this.id=e,this.options=i}ingest=t=>{Array.isArray(t)?this.events=this.events.concat(t):this.events.push(t),this.events.length>=1e3||this.lastFlush.getTime()<Date.now()-1e3?(clearTimeout(this.nextFlush),this.activeFlush=this.flush()):(clearTimeout(this.nextFlush),this.nextFlush=setTimeout((()=>{this.activeFlush=this.flush()}),1e3))};flush=async()=>{const t=this.events.splice(0,this.events.length);if(clearTimeout(this.nextFlush),await this.activeFlush,0===t.length)return void(this.lastFlush=new Date);const e=await this.ingestFn(this.id,t,this.options);return this.lastFlush=new Date,e}}class v extends l{datasets;users;localPath="/v1";constructor(t){super(t),this.datasets=new f.Service(t),this.users=new m.Service(t)}ingestRaw=(t,e,i=y.JSON,n=p.Identity,s)=>this.client.post(this.localPath+"/datasets/"+t+"/ingest",{headers:{"Content-Type":i,"Content-Encoding":n},body:e},{"timestamp-field":s?.timestampField,"timestamp-format":s?.timestampFormat,"csv-delimiter":s?.csvDelimiter});queryLegacy=(t,e,i)=>this.client.post(this.localPath+"/datasets/"+t+"/query",{body:JSON.stringify(e)},{"streaming-duration":i?.streamingDuration,nocache:i?.noCache});query=(t,e)=>{const i={apl:t};return e?.startTime&&(i.startTime=e?.startTime),e?.endTime&&(i.endTime=e?.endTime),this.client.post(this.localPath+"/datasets/_apl",{body:JSON.stringify(i)},{"streaming-duration":e?.streamingDuration,nocache:e?.noCache,format:"legacy"})};aplQuery=(t,e)=>this.query(t,e)}class x extends v{batch={};ingest=(t,e,i)=>{const n=function(t,e){return`${t}:${e?.timestampField||"-"}:${e?.timestampFormat||"-"}:${e?.csvDelimiter||"-"}`}(t,i);return this.batch[n]||(this.batch[n]=new w(((t,e,i)=>{const n=(Array.isArray(e)?e:[e]).map((t=>JSON.stringify(t))).join("\n");return this.ingestRaw(t,n,y.NDJSON,p.Identity,i)}),t,i)),this.batch[n].ingest(e)};flush=async()=>{let t=[];for(const e in this.batch)t.push(this.batch[e].flush());await Promise.all(t)}}let b;!function(t){t.JSON="application/json",t.NDJSON="application/x-ndjson",t.CSV="text/csv"}(y||(y={})),function(t){t.Identity="",t.GZIP="gzip"}(p||(p={})),function(t){t.Count="count",t.Distinct="distinct",t.Sum="sum",t.Avg="avg",t.Min="min",t.Max="max",t.Topk="topk",t.Percentiles="percentiles",t.Histogram="histogram",t.Variance="variance",t.Stdev="stdev",t.ArgMin="argmin",t.ArgMax="argmax",t.MakeSet="makeset",t.MakeSetIf="makesetif",t.CountIf="countif",t.CountDistinctIf="distinctif"}(d||(d={})),function(t){t.And="and",t.Or="or",t.Not="not",t.Equal="==",t.NotEqual="!=",t.Exists="exists",t.NotExists="not-exists",t.GreaterThan=">",t.GreaterThanOrEqualTo=">=",t.LessThan="<",t.LessThanOrEqualTo="<=",t.Gt="gt",t.Gte="gte",t.Lt="lt",t.Lte="lte",t.StartsWith="starts-with",t.NotStartsWith="not-starts-with",t.EndsWith="ends-with",t.NotEndsWith="not-ends-with",t.Contains="contains",t.NotContains="not-contains",t.Regexp="regexp",t.NotRegexp="not-regexp"}(g||(g={})),t.initializeImpl=function(){b=new x({token:"xaat-f69a9dd7-3988-4fc2-849b-4a0978468c25"})},t.trackEventImpl=function(t,e){b.ingest("shopar-plugin",Object.assign({name:t},e))}}));