@polymarket-developers/clob-client 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +78 -0
  4. package/cache/LICENSE +21 -0
  5. package/cache/README.md +62 -0
  6. package/cache/dist/declarations/src/index.d.ts +2 -0
  7. package/cache/dist/declarations/types/index.d.ts +45 -0
  8. package/cache/dist/emotion-cache.browser.cjs.default.js +1 -0
  9. package/cache/dist/emotion-cache.browser.cjs.js +471 -0
  10. package/cache/dist/emotion-cache.browser.cjs.mjs +2 -0
  11. package/cache/dist/emotion-cache.browser.development.cjs.default.js +1 -0
  12. package/cache/dist/emotion-cache.browser.development.cjs.js +616 -0
  13. package/cache/dist/emotion-cache.browser.development.cjs.mjs +2 -0
  14. package/cache/dist/emotion-cache.browser.development.esm.js +612 -0
  15. package/cache/dist/emotion-cache.browser.esm.js +467 -0
  16. package/cache/dist/emotion-cache.cjs.d.mts +3 -0
  17. package/cache/dist/emotion-cache.cjs.d.ts +3 -0
  18. package/cache/dist/emotion-cache.cjs.default.d.ts +1 -0
  19. package/cache/dist/emotion-cache.cjs.default.js +1 -0
  20. package/cache/dist/emotion-cache.cjs.js +565 -0
  21. package/cache/dist/emotion-cache.cjs.mjs +2 -0
  22. package/cache/dist/emotion-cache.development.cjs.default.js +1 -0
  23. package/cache/dist/emotion-cache.development.cjs.js +714 -0
  24. package/cache/dist/emotion-cache.development.cjs.mjs +2 -0
  25. package/cache/dist/emotion-cache.development.edge-light.cjs.default.js +1 -0
  26. package/cache/dist/emotion-cache.development.edge-light.cjs.js +621 -0
  27. package/cache/dist/emotion-cache.development.edge-light.cjs.mjs +2 -0
  28. package/cache/dist/emotion-cache.development.edge-light.esm.js +612 -0
  29. package/cache/dist/emotion-cache.development.esm.js +705 -0
  30. package/cache/dist/emotion-cache.edge-light.cjs.default.js +1 -0
  31. package/cache/dist/emotion-cache.edge-light.cjs.js +490 -0
  32. package/cache/dist/emotion-cache.edge-light.cjs.mjs +2 -0
  33. package/cache/dist/emotion-cache.edge-light.esm.js +481 -0
  34. package/cache/dist/emotion-cache.esm.js +556 -0
  35. package/cache/package.json +100 -0
  36. package/cache/src/conditions/false.js +1 -0
  37. package/cache/src/conditions/is-browser.js +1 -0
  38. package/cache/src/conditions/true.js +1 -0
  39. package/cache/src/index.d.ts +2 -0
  40. package/cache/src/index.js +257 -0
  41. package/cache/src/prefixer.js +340 -0
  42. package/cache/src/stylis-plugins.js +269 -0
  43. package/cache/src/types.js +26 -0
  44. package/cache/types/index.d.ts +45 -0
  45. package/index.d.ts +63 -0
  46. package/index.js +204 -0
  47. package/package.json +27 -0
  48. package/utils.js +15 -0
@@ -0,0 +1,467 @@
1
+ import { StyleSheet } from '@emotion/sheet';
2
+ import { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';
3
+ import '@emotion/weak-memoize';
4
+ import '@emotion/memoize';
5
+
6
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
7
+ var previous = 0;
8
+ var character = 0;
9
+
10
+ while (true) {
11
+ previous = character;
12
+ character = peek(); // &\f
13
+
14
+ if (previous === 38 && character === 12) {
15
+ points[index] = 1;
16
+ }
17
+
18
+ if (token(character)) {
19
+ break;
20
+ }
21
+
22
+ next();
23
+ }
24
+
25
+ return slice(begin, position);
26
+ };
27
+
28
+ var toRules = function toRules(parsed, points) {
29
+ // pretend we've started with a comma
30
+ var index = -1;
31
+ var character = 44;
32
+
33
+ do {
34
+ switch (token(character)) {
35
+ case 0:
36
+ // &\f
37
+ if (character === 38 && peek() === 12) {
38
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
39
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
40
+ // and when it should just concatenate the outer and inner selectors
41
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
42
+ points[index] = 1;
43
+ }
44
+
45
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
46
+ break;
47
+
48
+ case 2:
49
+ parsed[index] += delimit(character);
50
+ break;
51
+
52
+ case 4:
53
+ // comma
54
+ if (character === 44) {
55
+ // colon
56
+ parsed[++index] = peek() === 58 ? '&\f' : '';
57
+ points[index] = parsed[index].length;
58
+ break;
59
+ }
60
+
61
+ // fallthrough
62
+
63
+ default:
64
+ parsed[index] += from(character);
65
+ }
66
+ } while (character = next());
67
+
68
+ return parsed;
69
+ };
70
+
71
+ var getRules = function getRules(value, points) {
72
+ return dealloc(toRules(alloc(value), points));
73
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
74
+
75
+
76
+ var fixedElements = /* #__PURE__ */new WeakMap();
77
+ var compat = function compat(element) {
78
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
79
+ // negative .length indicates that this rule has been already prefixed
80
+ element.length < 1) {
81
+ return;
82
+ }
83
+
84
+ var value = element.value,
85
+ parent = element.parent;
86
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
87
+
88
+ while (parent.type !== 'rule') {
89
+ parent = parent.parent;
90
+ if (!parent) return;
91
+ } // short-circuit for the simplest case
92
+
93
+
94
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
95
+ /* colon */
96
+ && !fixedElements.get(parent)) {
97
+ return;
98
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
99
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
100
+
101
+
102
+ if (isImplicitRule) {
103
+ return;
104
+ }
105
+
106
+ fixedElements.set(element, true);
107
+ var points = [];
108
+ var rules = getRules(value, points);
109
+ var parentRules = parent.props;
110
+
111
+ for (var i = 0, k = 0; i < rules.length; i++) {
112
+ for (var j = 0; j < parentRules.length; j++, k++) {
113
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
114
+ }
115
+ }
116
+ };
117
+ var removeLabel = function removeLabel(element) {
118
+ if (element.type === 'decl') {
119
+ var value = element.value;
120
+
121
+ if ( // charcode for l
122
+ value.charCodeAt(0) === 108 && // charcode for b
123
+ value.charCodeAt(2) === 98) {
124
+ // this ignores label
125
+ element["return"] = '';
126
+ element.value = '';
127
+ }
128
+ }
129
+ };
130
+
131
+ /* eslint-disable no-fallthrough */
132
+
133
+ function prefix(value, length) {
134
+ switch (hash(value, length)) {
135
+ // color-adjust
136
+ case 5103:
137
+ return WEBKIT + 'print-' + value + value;
138
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
139
+
140
+ case 5737:
141
+ case 4201:
142
+ case 3177:
143
+ case 3433:
144
+ case 1641:
145
+ case 4457:
146
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
147
+
148
+ case 5572:
149
+ case 6356:
150
+ case 5844:
151
+ case 3191:
152
+ case 6645:
153
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
154
+
155
+ case 6391:
156
+ case 5879:
157
+ case 5623:
158
+ case 6135:
159
+ case 4599:
160
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
161
+
162
+ case 4215:
163
+ case 6389:
164
+ case 5109:
165
+ case 5365:
166
+ case 5621:
167
+ case 3829:
168
+ return WEBKIT + value + value;
169
+ // appearance, user-select, transform, hyphens, text-size-adjust
170
+
171
+ case 5349:
172
+ case 4246:
173
+ case 4810:
174
+ case 6968:
175
+ case 2756:
176
+ return WEBKIT + value + MOZ + value + MS + value + value;
177
+ // flex, flex-direction
178
+
179
+ case 6828:
180
+ case 4268:
181
+ return WEBKIT + value + MS + value + value;
182
+ // order
183
+
184
+ case 6165:
185
+ return WEBKIT + value + MS + 'flex-' + value + value;
186
+ // align-items
187
+
188
+ case 5187:
189
+ return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
190
+ // align-self
191
+
192
+ case 5443:
193
+ return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
194
+ // align-content
195
+
196
+ case 4675:
197
+ return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
198
+ // flex-shrink
199
+
200
+ case 5548:
201
+ return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
202
+ // flex-basis
203
+
204
+ case 5292:
205
+ return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
206
+ // flex-grow
207
+
208
+ case 6060:
209
+ return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
210
+ // transition
211
+
212
+ case 4554:
213
+ return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
214
+ // cursor
215
+
216
+ case 6187:
217
+ return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
218
+ // background, background-image
219
+
220
+ case 5495:
221
+ case 3959:
222
+ return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
223
+ // justify-content
224
+
225
+ case 4968:
226
+ return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
227
+ // (margin|padding)-inline-(start|end)
228
+
229
+ case 4095:
230
+ case 3583:
231
+ case 4068:
232
+ case 2532:
233
+ return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
234
+ // (min|max)?(width|height|inline-size|block-size)
235
+
236
+ case 8116:
237
+ case 7059:
238
+ case 5753:
239
+ case 5535:
240
+ case 5445:
241
+ case 5701:
242
+ case 4933:
243
+ case 4677:
244
+ case 5533:
245
+ case 5789:
246
+ case 5021:
247
+ case 4765:
248
+ // stretch, max-content, min-content, fill-available
249
+ if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
250
+ // (m)ax-content, (m)in-content
251
+ case 109:
252
+ // -
253
+ if (charat(value, length + 4) !== 45) break;
254
+ // (f)ill-available, (f)it-content
255
+
256
+ case 102:
257
+ return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
258
+ // (s)tretch
259
+
260
+ case 115:
261
+ return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
262
+ }
263
+ break;
264
+ // position: sticky
265
+
266
+ case 4949:
267
+ // (s)ticky?
268
+ if (charat(value, length + 1) !== 115) break;
269
+ // display: (flex|inline-flex)
270
+
271
+ case 6444:
272
+ switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
273
+ // stic(k)y
274
+ case 107:
275
+ return replace(value, ':', ':' + WEBKIT) + value;
276
+ // (inline-)?fl(e)x
277
+
278
+ case 101:
279
+ return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
280
+ }
281
+
282
+ break;
283
+ // writing-mode
284
+
285
+ case 5936:
286
+ switch (charat(value, length + 11)) {
287
+ // vertical-l(r)
288
+ case 114:
289
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
290
+ // vertical-r(l)
291
+
292
+ case 108:
293
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
294
+ // horizontal(-)tb
295
+
296
+ case 45:
297
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
298
+ }
299
+
300
+ return WEBKIT + value + MS + value + value;
301
+ }
302
+
303
+ return value;
304
+ }
305
+
306
+ var prefixer = function prefixer(element, index, children, callback) {
307
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
308
+ case DECLARATION:
309
+ element["return"] = prefix(element.value, element.length);
310
+ break;
311
+
312
+ case KEYFRAMES:
313
+ return serialize([copy(element, {
314
+ value: replace(element.value, '@', '@' + WEBKIT)
315
+ })], callback);
316
+
317
+ case RULESET:
318
+ if (element.length) return combine(element.props, function (value) {
319
+ switch (match(value, /(::plac\w+|:read-\w+)/)) {
320
+ // :read-(only|write)
321
+ case ':read-only':
322
+ case ':read-write':
323
+ return serialize([copy(element, {
324
+ props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
325
+ })], callback);
326
+ // :placeholder
327
+
328
+ case '::placeholder':
329
+ return serialize([copy(element, {
330
+ props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
331
+ }), copy(element, {
332
+ props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
333
+ }), copy(element, {
334
+ props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
335
+ })], callback);
336
+ }
337
+
338
+ return '';
339
+ });
340
+ }
341
+ };
342
+
343
+ var defaultStylisPlugins = [prefixer];
344
+
345
+ var createCache = function
346
+ /*: EmotionCache */
347
+ createCache(options
348
+ /*: Options */
349
+ ) {
350
+ var key = options.key;
351
+
352
+ if (key === 'css') {
353
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
354
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
355
+ // note this very very intentionally targets all style elements regardless of the key to ensure
356
+ // that creating a cache works inside of render of a React component
357
+
358
+ Array.prototype.forEach.call(ssrStyles, function (node
359
+ /*: HTMLStyleElement */
360
+ ) {
361
+ // we want to only move elements which have a space in the data-emotion attribute value
362
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
363
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
364
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
365
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
366
+ // will not result in the Emotion 10 styles being destroyed
367
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
368
+
369
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
370
+ return;
371
+ }
372
+
373
+ document.head.appendChild(node);
374
+ node.setAttribute('data-s', '');
375
+ });
376
+ }
377
+
378
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
379
+
380
+ var inserted = {};
381
+ var container;
382
+ /* : Node */
383
+
384
+ var nodesToHydrate = [];
385
+
386
+ {
387
+ container = options.container || document.head;
388
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
389
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
390
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
391
+ /*: HTMLStyleElement */
392
+ ) {
393
+ var attrib = node.getAttribute("data-emotion").split(' ');
394
+
395
+ for (var i = 1; i < attrib.length; i++) {
396
+ inserted[attrib[i]] = true;
397
+ }
398
+
399
+ nodesToHydrate.push(node);
400
+ });
401
+ }
402
+
403
+ var _insert;
404
+ /*: (
405
+ selector: string,
406
+ serialized: SerializedStyles,
407
+ sheet: StyleSheet,
408
+ shouldCache: boolean
409
+ ) => string | void */
410
+
411
+
412
+ var omnipresentPlugins = [compat, removeLabel];
413
+
414
+ {
415
+ var currentSheet;
416
+ var finalizingPlugins = [stringify, rulesheet(function (rule) {
417
+ currentSheet.insert(rule);
418
+ })];
419
+ var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
420
+
421
+ var stylis = function stylis(styles) {
422
+ return serialize(compile(styles), serializer);
423
+ };
424
+
425
+ _insert = function
426
+ /*: void */
427
+ insert(selector
428
+ /*: string */
429
+ , serialized
430
+ /*: SerializedStyles */
431
+ , sheet
432
+ /*: StyleSheet */
433
+ , shouldCache
434
+ /*: boolean */
435
+ ) {
436
+ currentSheet = sheet;
437
+
438
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
439
+
440
+ if (shouldCache) {
441
+ cache.inserted[serialized.name] = true;
442
+ }
443
+ };
444
+ }
445
+
446
+ var cache
447
+ /*: EmotionCache */
448
+ = {
449
+ key: key,
450
+ sheet: new StyleSheet({
451
+ key: key,
452
+ container: container,
453
+ nonce: options.nonce,
454
+ speedy: options.speedy,
455
+ prepend: options.prepend,
456
+ insertionPoint: options.insertionPoint
457
+ }),
458
+ nonce: options.nonce,
459
+ inserted: inserted,
460
+ registered: {},
461
+ insert: _insert
462
+ };
463
+ cache.sheet.hydrate(nodesToHydrate);
464
+ return cache;
465
+ };
466
+
467
+ export { createCache as default };
@@ -0,0 +1,3 @@
1
+ export * from "./declarations/src/index.js";
2
+ export { _default as default } from "./emotion-cache.cjs.default.js";
3
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1jYWNoZS5janMuZC5tdHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
@@ -0,0 +1,3 @@
1
+ export * from "./declarations/src/index";
2
+ export { default } from "./declarations/src/index";
3
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1vdGlvbi1jYWNoZS5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
@@ -0,0 +1 @@
1
+ export { default as _default } from "./declarations/src/index.js"
@@ -0,0 +1 @@
1
+ exports._default = require("./emotion-cache.cjs.js").default;