@linktr.ee/arbor-mcp 0.1.0 → 0.1.1-rc.007c43bf.5683
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +564 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,485 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
2
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
4
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
5
10
|
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
// ../../node_modules/lz-string/libs/lz-string.js
|
|
29
|
+
var require_lz_string = __commonJS({
|
|
30
|
+
"../../node_modules/lz-string/libs/lz-string.js"(exports, module) {
|
|
31
|
+
var LZString = (function() {
|
|
32
|
+
var f = String.fromCharCode;
|
|
33
|
+
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
34
|
+
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
35
|
+
var baseReverseDic = {};
|
|
36
|
+
function getBaseValue(alphabet, character) {
|
|
37
|
+
if (!baseReverseDic[alphabet]) {
|
|
38
|
+
baseReverseDic[alphabet] = {};
|
|
39
|
+
for (var i = 0; i < alphabet.length; i++) {
|
|
40
|
+
baseReverseDic[alphabet][alphabet.charAt(i)] = i;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return baseReverseDic[alphabet][character];
|
|
44
|
+
}
|
|
45
|
+
var LZString2 = {
|
|
46
|
+
compressToBase64: function(input) {
|
|
47
|
+
if (input == null) return "";
|
|
48
|
+
var res = LZString2._compress(input, 6, function(a) {
|
|
49
|
+
return keyStrBase64.charAt(a);
|
|
50
|
+
});
|
|
51
|
+
switch (res.length % 4) {
|
|
52
|
+
// To produce valid Base64
|
|
53
|
+
default:
|
|
54
|
+
// When could this happen ?
|
|
55
|
+
case 0:
|
|
56
|
+
return res;
|
|
57
|
+
case 1:
|
|
58
|
+
return res + "===";
|
|
59
|
+
case 2:
|
|
60
|
+
return res + "==";
|
|
61
|
+
case 3:
|
|
62
|
+
return res + "=";
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
decompressFromBase64: function(input) {
|
|
66
|
+
if (input == null) return "";
|
|
67
|
+
if (input == "") return null;
|
|
68
|
+
return LZString2._decompress(input.length, 32, function(index) {
|
|
69
|
+
return getBaseValue(keyStrBase64, input.charAt(index));
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
compressToUTF16: function(input) {
|
|
73
|
+
if (input == null) return "";
|
|
74
|
+
return LZString2._compress(input, 15, function(a) {
|
|
75
|
+
return f(a + 32);
|
|
76
|
+
}) + " ";
|
|
77
|
+
},
|
|
78
|
+
decompressFromUTF16: function(compressed) {
|
|
79
|
+
if (compressed == null) return "";
|
|
80
|
+
if (compressed == "") return null;
|
|
81
|
+
return LZString2._decompress(compressed.length, 16384, function(index) {
|
|
82
|
+
return compressed.charCodeAt(index) - 32;
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
//compress into uint8array (UCS-2 big endian format)
|
|
86
|
+
compressToUint8Array: function(uncompressed) {
|
|
87
|
+
var compressed = LZString2.compress(uncompressed);
|
|
88
|
+
var buf = new Uint8Array(compressed.length * 2);
|
|
89
|
+
for (var i = 0, TotalLen = compressed.length; i < TotalLen; i++) {
|
|
90
|
+
var current_value = compressed.charCodeAt(i);
|
|
91
|
+
buf[i * 2] = current_value >>> 8;
|
|
92
|
+
buf[i * 2 + 1] = current_value % 256;
|
|
93
|
+
}
|
|
94
|
+
return buf;
|
|
95
|
+
},
|
|
96
|
+
//decompress from uint8array (UCS-2 big endian format)
|
|
97
|
+
decompressFromUint8Array: function(compressed) {
|
|
98
|
+
if (compressed === null || compressed === void 0) {
|
|
99
|
+
return LZString2.decompress(compressed);
|
|
100
|
+
} else {
|
|
101
|
+
var buf = new Array(compressed.length / 2);
|
|
102
|
+
for (var i = 0, TotalLen = buf.length; i < TotalLen; i++) {
|
|
103
|
+
buf[i] = compressed[i * 2] * 256 + compressed[i * 2 + 1];
|
|
104
|
+
}
|
|
105
|
+
var result = [];
|
|
106
|
+
buf.forEach(function(c) {
|
|
107
|
+
result.push(f(c));
|
|
108
|
+
});
|
|
109
|
+
return LZString2.decompress(result.join(""));
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
//compress into a string that is already URI encoded
|
|
113
|
+
compressToEncodedURIComponent: function(input) {
|
|
114
|
+
if (input == null) return "";
|
|
115
|
+
return LZString2._compress(input, 6, function(a) {
|
|
116
|
+
return keyStrUriSafe.charAt(a);
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
//decompress from an output of compressToEncodedURIComponent
|
|
120
|
+
decompressFromEncodedURIComponent: function(input) {
|
|
121
|
+
if (input == null) return "";
|
|
122
|
+
if (input == "") return null;
|
|
123
|
+
input = input.replace(/ /g, "+");
|
|
124
|
+
return LZString2._decompress(input.length, 32, function(index) {
|
|
125
|
+
return getBaseValue(keyStrUriSafe, input.charAt(index));
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
compress: function(uncompressed) {
|
|
129
|
+
return LZString2._compress(uncompressed, 16, function(a) {
|
|
130
|
+
return f(a);
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
134
|
+
if (uncompressed == null) return "";
|
|
135
|
+
var i, value, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii;
|
|
136
|
+
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
137
|
+
context_c = uncompressed.charAt(ii);
|
|
138
|
+
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
139
|
+
context_dictionary[context_c] = context_dictSize++;
|
|
140
|
+
context_dictionaryToCreate[context_c] = true;
|
|
141
|
+
}
|
|
142
|
+
context_wc = context_w + context_c;
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {
|
|
144
|
+
context_w = context_wc;
|
|
145
|
+
} else {
|
|
146
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
147
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
148
|
+
for (i = 0; i < context_numBits; i++) {
|
|
149
|
+
context_data_val = context_data_val << 1;
|
|
150
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
151
|
+
context_data_position = 0;
|
|
152
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
153
|
+
context_data_val = 0;
|
|
154
|
+
} else {
|
|
155
|
+
context_data_position++;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
value = context_w.charCodeAt(0);
|
|
159
|
+
for (i = 0; i < 8; i++) {
|
|
160
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
161
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
162
|
+
context_data_position = 0;
|
|
163
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
164
|
+
context_data_val = 0;
|
|
165
|
+
} else {
|
|
166
|
+
context_data_position++;
|
|
167
|
+
}
|
|
168
|
+
value = value >> 1;
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
value = 1;
|
|
172
|
+
for (i = 0; i < context_numBits; i++) {
|
|
173
|
+
context_data_val = context_data_val << 1 | value;
|
|
174
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
175
|
+
context_data_position = 0;
|
|
176
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
177
|
+
context_data_val = 0;
|
|
178
|
+
} else {
|
|
179
|
+
context_data_position++;
|
|
180
|
+
}
|
|
181
|
+
value = 0;
|
|
182
|
+
}
|
|
183
|
+
value = context_w.charCodeAt(0);
|
|
184
|
+
for (i = 0; i < 16; i++) {
|
|
185
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
186
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
187
|
+
context_data_position = 0;
|
|
188
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
189
|
+
context_data_val = 0;
|
|
190
|
+
} else {
|
|
191
|
+
context_data_position++;
|
|
192
|
+
}
|
|
193
|
+
value = value >> 1;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
context_enlargeIn--;
|
|
197
|
+
if (context_enlargeIn == 0) {
|
|
198
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
199
|
+
context_numBits++;
|
|
200
|
+
}
|
|
201
|
+
delete context_dictionaryToCreate[context_w];
|
|
202
|
+
} else {
|
|
203
|
+
value = context_dictionary[context_w];
|
|
204
|
+
for (i = 0; i < context_numBits; i++) {
|
|
205
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
206
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
207
|
+
context_data_position = 0;
|
|
208
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
209
|
+
context_data_val = 0;
|
|
210
|
+
} else {
|
|
211
|
+
context_data_position++;
|
|
212
|
+
}
|
|
213
|
+
value = value >> 1;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
context_enlargeIn--;
|
|
217
|
+
if (context_enlargeIn == 0) {
|
|
218
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
219
|
+
context_numBits++;
|
|
220
|
+
}
|
|
221
|
+
context_dictionary[context_wc] = context_dictSize++;
|
|
222
|
+
context_w = String(context_c);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (context_w !== "") {
|
|
226
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
227
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
228
|
+
for (i = 0; i < context_numBits; i++) {
|
|
229
|
+
context_data_val = context_data_val << 1;
|
|
230
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
231
|
+
context_data_position = 0;
|
|
232
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
233
|
+
context_data_val = 0;
|
|
234
|
+
} else {
|
|
235
|
+
context_data_position++;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
value = context_w.charCodeAt(0);
|
|
239
|
+
for (i = 0; i < 8; i++) {
|
|
240
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
241
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
242
|
+
context_data_position = 0;
|
|
243
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
244
|
+
context_data_val = 0;
|
|
245
|
+
} else {
|
|
246
|
+
context_data_position++;
|
|
247
|
+
}
|
|
248
|
+
value = value >> 1;
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
value = 1;
|
|
252
|
+
for (i = 0; i < context_numBits; i++) {
|
|
253
|
+
context_data_val = context_data_val << 1 | value;
|
|
254
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
255
|
+
context_data_position = 0;
|
|
256
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
257
|
+
context_data_val = 0;
|
|
258
|
+
} else {
|
|
259
|
+
context_data_position++;
|
|
260
|
+
}
|
|
261
|
+
value = 0;
|
|
262
|
+
}
|
|
263
|
+
value = context_w.charCodeAt(0);
|
|
264
|
+
for (i = 0; i < 16; i++) {
|
|
265
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
266
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
267
|
+
context_data_position = 0;
|
|
268
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
269
|
+
context_data_val = 0;
|
|
270
|
+
} else {
|
|
271
|
+
context_data_position++;
|
|
272
|
+
}
|
|
273
|
+
value = value >> 1;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
context_enlargeIn--;
|
|
277
|
+
if (context_enlargeIn == 0) {
|
|
278
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
279
|
+
context_numBits++;
|
|
280
|
+
}
|
|
281
|
+
delete context_dictionaryToCreate[context_w];
|
|
282
|
+
} else {
|
|
283
|
+
value = context_dictionary[context_w];
|
|
284
|
+
for (i = 0; i < context_numBits; i++) {
|
|
285
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
286
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
287
|
+
context_data_position = 0;
|
|
288
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
289
|
+
context_data_val = 0;
|
|
290
|
+
} else {
|
|
291
|
+
context_data_position++;
|
|
292
|
+
}
|
|
293
|
+
value = value >> 1;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
context_enlargeIn--;
|
|
297
|
+
if (context_enlargeIn == 0) {
|
|
298
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
299
|
+
context_numBits++;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
value = 2;
|
|
303
|
+
for (i = 0; i < context_numBits; i++) {
|
|
304
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
305
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
306
|
+
context_data_position = 0;
|
|
307
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
308
|
+
context_data_val = 0;
|
|
309
|
+
} else {
|
|
310
|
+
context_data_position++;
|
|
311
|
+
}
|
|
312
|
+
value = value >> 1;
|
|
313
|
+
}
|
|
314
|
+
while (true) {
|
|
315
|
+
context_data_val = context_data_val << 1;
|
|
316
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
317
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
318
|
+
break;
|
|
319
|
+
} else context_data_position++;
|
|
320
|
+
}
|
|
321
|
+
return context_data.join("");
|
|
322
|
+
},
|
|
323
|
+
decompress: function(compressed) {
|
|
324
|
+
if (compressed == null) return "";
|
|
325
|
+
if (compressed == "") return null;
|
|
326
|
+
return LZString2._decompress(compressed.length, 32768, function(index) {
|
|
327
|
+
return compressed.charCodeAt(index);
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
_decompress: function(length, resetValue, getNextValue) {
|
|
331
|
+
var dictionary = [], next, enlargeIn = 4, dictSize = 4, numBits = 3, entry = "", result = [], i, w, bits, resb, maxpower, power, c, data = { val: getNextValue(0), position: resetValue, index: 1 };
|
|
332
|
+
for (i = 0; i < 3; i += 1) {
|
|
333
|
+
dictionary[i] = i;
|
|
334
|
+
}
|
|
335
|
+
bits = 0;
|
|
336
|
+
maxpower = Math.pow(2, 2);
|
|
337
|
+
power = 1;
|
|
338
|
+
while (power != maxpower) {
|
|
339
|
+
resb = data.val & data.position;
|
|
340
|
+
data.position >>= 1;
|
|
341
|
+
if (data.position == 0) {
|
|
342
|
+
data.position = resetValue;
|
|
343
|
+
data.val = getNextValue(data.index++);
|
|
344
|
+
}
|
|
345
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
346
|
+
power <<= 1;
|
|
347
|
+
}
|
|
348
|
+
switch (next = bits) {
|
|
349
|
+
case 0:
|
|
350
|
+
bits = 0;
|
|
351
|
+
maxpower = Math.pow(2, 8);
|
|
352
|
+
power = 1;
|
|
353
|
+
while (power != maxpower) {
|
|
354
|
+
resb = data.val & data.position;
|
|
355
|
+
data.position >>= 1;
|
|
356
|
+
if (data.position == 0) {
|
|
357
|
+
data.position = resetValue;
|
|
358
|
+
data.val = getNextValue(data.index++);
|
|
359
|
+
}
|
|
360
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
361
|
+
power <<= 1;
|
|
362
|
+
}
|
|
363
|
+
c = f(bits);
|
|
364
|
+
break;
|
|
365
|
+
case 1:
|
|
366
|
+
bits = 0;
|
|
367
|
+
maxpower = Math.pow(2, 16);
|
|
368
|
+
power = 1;
|
|
369
|
+
while (power != maxpower) {
|
|
370
|
+
resb = data.val & data.position;
|
|
371
|
+
data.position >>= 1;
|
|
372
|
+
if (data.position == 0) {
|
|
373
|
+
data.position = resetValue;
|
|
374
|
+
data.val = getNextValue(data.index++);
|
|
375
|
+
}
|
|
376
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
377
|
+
power <<= 1;
|
|
378
|
+
}
|
|
379
|
+
c = f(bits);
|
|
380
|
+
break;
|
|
381
|
+
case 2:
|
|
382
|
+
return "";
|
|
383
|
+
}
|
|
384
|
+
dictionary[3] = c;
|
|
385
|
+
w = c;
|
|
386
|
+
result.push(c);
|
|
387
|
+
while (true) {
|
|
388
|
+
if (data.index > length) {
|
|
389
|
+
return "";
|
|
390
|
+
}
|
|
391
|
+
bits = 0;
|
|
392
|
+
maxpower = Math.pow(2, numBits);
|
|
393
|
+
power = 1;
|
|
394
|
+
while (power != maxpower) {
|
|
395
|
+
resb = data.val & data.position;
|
|
396
|
+
data.position >>= 1;
|
|
397
|
+
if (data.position == 0) {
|
|
398
|
+
data.position = resetValue;
|
|
399
|
+
data.val = getNextValue(data.index++);
|
|
400
|
+
}
|
|
401
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
402
|
+
power <<= 1;
|
|
403
|
+
}
|
|
404
|
+
switch (c = bits) {
|
|
405
|
+
case 0:
|
|
406
|
+
bits = 0;
|
|
407
|
+
maxpower = Math.pow(2, 8);
|
|
408
|
+
power = 1;
|
|
409
|
+
while (power != maxpower) {
|
|
410
|
+
resb = data.val & data.position;
|
|
411
|
+
data.position >>= 1;
|
|
412
|
+
if (data.position == 0) {
|
|
413
|
+
data.position = resetValue;
|
|
414
|
+
data.val = getNextValue(data.index++);
|
|
415
|
+
}
|
|
416
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
417
|
+
power <<= 1;
|
|
418
|
+
}
|
|
419
|
+
dictionary[dictSize++] = f(bits);
|
|
420
|
+
c = dictSize - 1;
|
|
421
|
+
enlargeIn--;
|
|
422
|
+
break;
|
|
423
|
+
case 1:
|
|
424
|
+
bits = 0;
|
|
425
|
+
maxpower = Math.pow(2, 16);
|
|
426
|
+
power = 1;
|
|
427
|
+
while (power != maxpower) {
|
|
428
|
+
resb = data.val & data.position;
|
|
429
|
+
data.position >>= 1;
|
|
430
|
+
if (data.position == 0) {
|
|
431
|
+
data.position = resetValue;
|
|
432
|
+
data.val = getNextValue(data.index++);
|
|
433
|
+
}
|
|
434
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
435
|
+
power <<= 1;
|
|
436
|
+
}
|
|
437
|
+
dictionary[dictSize++] = f(bits);
|
|
438
|
+
c = dictSize - 1;
|
|
439
|
+
enlargeIn--;
|
|
440
|
+
break;
|
|
441
|
+
case 2:
|
|
442
|
+
return result.join("");
|
|
443
|
+
}
|
|
444
|
+
if (enlargeIn == 0) {
|
|
445
|
+
enlargeIn = Math.pow(2, numBits);
|
|
446
|
+
numBits++;
|
|
447
|
+
}
|
|
448
|
+
if (dictionary[c]) {
|
|
449
|
+
entry = dictionary[c];
|
|
450
|
+
} else {
|
|
451
|
+
if (c === dictSize) {
|
|
452
|
+
entry = w + w.charAt(0);
|
|
453
|
+
} else {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
result.push(entry);
|
|
458
|
+
dictionary[dictSize++] = w + entry.charAt(0);
|
|
459
|
+
enlargeIn--;
|
|
460
|
+
w = entry;
|
|
461
|
+
if (enlargeIn == 0) {
|
|
462
|
+
enlargeIn = Math.pow(2, numBits);
|
|
463
|
+
numBits++;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
return LZString2;
|
|
469
|
+
})();
|
|
470
|
+
if (typeof define === "function" && define.amd) {
|
|
471
|
+
define(function() {
|
|
472
|
+
return LZString;
|
|
473
|
+
});
|
|
474
|
+
} else if (typeof module !== "undefined" && module != null) {
|
|
475
|
+
module.exports = LZString;
|
|
476
|
+
} else if (typeof angular !== "undefined" && angular != null) {
|
|
477
|
+
angular.module("LZString", []).factory("LZString", function() {
|
|
478
|
+
return LZString;
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
});
|
|
6
483
|
|
|
7
484
|
// ../../apps/playroom/src/hash-code.js
|
|
8
485
|
var require_hash_code = __commonJS({
|
|
@@ -35,7 +512,7 @@ import {
|
|
|
35
512
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
36
513
|
|
|
37
514
|
// ../../apps/playroom/src/canonical-snippet-lookup.ts
|
|
38
|
-
|
|
515
|
+
var import_lz_string = __toESM(require_lz_string());
|
|
39
516
|
|
|
40
517
|
// ../../apps/playroom/src/compositions.ts
|
|
41
518
|
var compositions_default = [
|
|
@@ -103,6 +580,20 @@ var compositions_default = [
|
|
|
103
580
|
<AvatarGroupCount count={5} size="sm" />
|
|
104
581
|
</AvatarGroup>`
|
|
105
582
|
},
|
|
583
|
+
// ── Backdrop ──
|
|
584
|
+
// Maps to figma-mappings `Backdrop` (node 11643-116065). DNG-196 follow-up of DNG-50.
|
|
585
|
+
// Default = dark scrim (matches production parity for Dialog/Drawer);
|
|
586
|
+
// `inverted` flips to light scrim for dark surfaces.
|
|
587
|
+
{
|
|
588
|
+
group: "Backdrop",
|
|
589
|
+
name: "Backdrop",
|
|
590
|
+
code: "<Backdrop />"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
group: "Backdrop",
|
|
594
|
+
name: "Backdrop (inverted)",
|
|
595
|
+
code: "<Backdrop inverted />"
|
|
596
|
+
},
|
|
106
597
|
// ── Badge ──
|
|
107
598
|
{
|
|
108
599
|
group: "Badge",
|
|
@@ -452,6 +943,31 @@ var compositions_default = [
|
|
|
452
943
|
<Text variant="body-sm-regular">This setting controls who can see your profile. Changes take effect immediately.</Text>
|
|
453
944
|
</PopoverContent>
|
|
454
945
|
</Popover>`
|
|
946
|
+
},
|
|
947
|
+
// ── RichTooltip ──
|
|
948
|
+
{
|
|
949
|
+
group: "RichTooltip",
|
|
950
|
+
name: "RichTooltip",
|
|
951
|
+
code: `<RichTooltip defaultOpen>
|
|
952
|
+
<RichTooltipTrigger asChild>
|
|
953
|
+
<Button variant="secondary" shape="squircle">Show tip</Button>
|
|
954
|
+
</RichTooltipTrigger>
|
|
955
|
+
<RichTooltipContent>
|
|
956
|
+
<RichTooltipIcon>
|
|
957
|
+
<InfoIcon size={16} weight="bold" />
|
|
958
|
+
</RichTooltipIcon>
|
|
959
|
+
<RichTooltipBody>
|
|
960
|
+
<RichTooltipTitle>Customize your link</RichTooltipTitle>
|
|
961
|
+
<RichTooltipDescription>
|
|
962
|
+
Pick a colour, add an icon, and reorder anything on your Linktree to match your style.
|
|
963
|
+
</RichTooltipDescription>
|
|
964
|
+
</RichTooltipBody>
|
|
965
|
+
<RichTooltipClose aria-label="Dismiss tip">
|
|
966
|
+
<XIcon size={16} weight="bold" />
|
|
967
|
+
</RichTooltipClose>
|
|
968
|
+
<RichTooltipArrow />
|
|
969
|
+
</RichTooltipContent>
|
|
970
|
+
</RichTooltip>`
|
|
455
971
|
},
|
|
456
972
|
// ── RadioGroup ──
|
|
457
973
|
{
|
|
@@ -897,35 +1413,51 @@ function findCanonicalEntryByGroup(group) {
|
|
|
897
1413
|
return null;
|
|
898
1414
|
}
|
|
899
1415
|
function buildPlayroomUrl(jsx) {
|
|
900
|
-
const compressed = compressToEncodedURIComponent(
|
|
1416
|
+
const compressed = (0, import_lz_string.compressToEncodedURIComponent)(
|
|
901
1417
|
JSON.stringify({ code: jsx })
|
|
902
1418
|
);
|
|
903
1419
|
return `${PLAYROOM_HOMEPAGE_URL}#?code=${compressed}`;
|
|
904
1420
|
}
|
|
905
|
-
async function mintPlayroomUrl(jsx, slugClient) {
|
|
1421
|
+
async function mintPlayroomUrl(jsx, slugClient, opts) {
|
|
1422
|
+
const title = typeof opts?.title === "string" && opts.title.length > 0 ? opts.title : void 0;
|
|
1423
|
+
const derivedTitleAtSave = typeof opts?.derivedTitleAtSave === "string" && opts.derivedTitleAtSave.length > 0 ? opts.derivedTitleAtSave : void 0;
|
|
906
1424
|
let result;
|
|
907
1425
|
try {
|
|
908
|
-
|
|
1426
|
+
const mintOpts = title === void 0 ? void 0 : derivedTitleAtSave === void 0 ? { title } : { title, derivedTitleAtSave };
|
|
1427
|
+
result = await slugClient.mintOrReuse(jsx, mintOpts);
|
|
909
1428
|
} catch {
|
|
910
1429
|
return {
|
|
911
|
-
url: buildPlayroomUrl(jsx),
|
|
1430
|
+
url: appendTitleParam(buildPlayroomUrl(jsx), title),
|
|
912
1431
|
source: "lz-string-fallback",
|
|
913
1432
|
reason: "network"
|
|
914
1433
|
};
|
|
915
1434
|
}
|
|
916
1435
|
if (result.ok) {
|
|
917
1436
|
return {
|
|
918
|
-
url: result.url,
|
|
1437
|
+
url: appendTitleParam(result.url, title),
|
|
919
1438
|
source: result.source,
|
|
920
1439
|
slug: result.slug
|
|
921
1440
|
};
|
|
922
1441
|
}
|
|
923
1442
|
return {
|
|
924
|
-
url: buildPlayroomUrl(jsx),
|
|
1443
|
+
url: appendTitleParam(buildPlayroomUrl(jsx), title),
|
|
925
1444
|
source: "lz-string-fallback",
|
|
926
1445
|
reason: result.reason
|
|
927
1446
|
};
|
|
928
1447
|
}
|
|
1448
|
+
function appendTitleParam(url, title) {
|
|
1449
|
+
if (!title) return url;
|
|
1450
|
+
const encoded = encodeURIComponent(title);
|
|
1451
|
+
const hashIdx = url.indexOf("#");
|
|
1452
|
+
if (hashIdx === -1) {
|
|
1453
|
+
const sep2 = url.indexOf("?") === -1 ? "?" : "&";
|
|
1454
|
+
return `${url}${sep2}title=${encoded}`;
|
|
1455
|
+
}
|
|
1456
|
+
const before = url.slice(0, hashIdx);
|
|
1457
|
+
const hash = url.slice(hashIdx);
|
|
1458
|
+
const sep = before.indexOf("?") === -1 ? "?" : "&";
|
|
1459
|
+
return `${before}${sep}title=${encoded}${hash}`;
|
|
1460
|
+
}
|
|
929
1461
|
function lookupByArborName(arborName) {
|
|
930
1462
|
const normalized = typeof arborName === "string" ? arborName.trim() : "";
|
|
931
1463
|
if (!normalized) {
|
|
@@ -990,7 +1522,7 @@ function createSlugClient(opts) {
|
|
|
990
1522
|
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
991
1523
|
const endpointUrl = opts.endpoint.toString();
|
|
992
1524
|
const inflight = /* @__PURE__ */ new Map();
|
|
993
|
-
async function performMint(jsx, key) {
|
|
1525
|
+
async function performMint(jsx, key, mintOpts) {
|
|
994
1526
|
const controller = new AbortController();
|
|
995
1527
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
996
1528
|
const headers = {
|
|
@@ -1002,12 +1534,19 @@ function createSlugClient(opts) {
|
|
|
1002
1534
|
if (opts.producerName) {
|
|
1003
1535
|
headers["X-Arbor-Producer"] = opts.producerName;
|
|
1004
1536
|
}
|
|
1537
|
+
const requestBody = { snippet: jsx };
|
|
1538
|
+
if (mintOpts && typeof mintOpts.title === "string" && mintOpts.title.length > 0) {
|
|
1539
|
+
requestBody.title = mintOpts.title;
|
|
1540
|
+
if (typeof mintOpts.derivedTitleAtSave === "string" && mintOpts.derivedTitleAtSave.length > 0) {
|
|
1541
|
+
requestBody.derivedTitleAtSave = mintOpts.derivedTitleAtSave;
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1005
1544
|
let response;
|
|
1006
1545
|
try {
|
|
1007
1546
|
response = await fetchImpl(endpointUrl, {
|
|
1008
1547
|
method: "POST",
|
|
1009
1548
|
headers,
|
|
1010
|
-
body: JSON.stringify(
|
|
1549
|
+
body: JSON.stringify(requestBody),
|
|
1011
1550
|
signal: controller.signal
|
|
1012
1551
|
});
|
|
1013
1552
|
} catch (err) {
|
|
@@ -1034,24 +1573,28 @@ function createSlugClient(opts) {
|
|
|
1034
1573
|
cache.set(key, branded);
|
|
1035
1574
|
return { ok: true, source: "minted", slug: branded, url };
|
|
1036
1575
|
}
|
|
1037
|
-
async function mintOrReuse(jsx) {
|
|
1576
|
+
async function mintOrReuse(jsx, mintOpts) {
|
|
1038
1577
|
const byteLength = new TextEncoder().encode(jsx).length;
|
|
1039
1578
|
if (byteLength > MAX_SNIPPET_BYTES) {
|
|
1040
1579
|
return { ok: false, reason: "oversize" };
|
|
1041
1580
|
}
|
|
1042
1581
|
const key = hashCode(jsx);
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1582
|
+
const hasTitleOverride = typeof mintOpts?.title === "string" && mintOpts.title.length > 0;
|
|
1583
|
+
if (!hasTitleOverride) {
|
|
1584
|
+
const cached = cache.get(key);
|
|
1585
|
+
if (cached) {
|
|
1586
|
+
const url = `${PLAYROOM_BASE_URL}?slug=${cached}`;
|
|
1587
|
+
return { ok: true, source: "cached", slug: cached, url };
|
|
1588
|
+
}
|
|
1589
|
+
const existing = inflight.get(key);
|
|
1590
|
+
if (existing) return existing;
|
|
1591
|
+
const promise = performMint(jsx, key, mintOpts).finally(() => {
|
|
1592
|
+
inflight.delete(key);
|
|
1593
|
+
});
|
|
1594
|
+
inflight.set(key, promise);
|
|
1595
|
+
return promise;
|
|
1047
1596
|
}
|
|
1048
|
-
|
|
1049
|
-
if (existing) return existing;
|
|
1050
|
-
const promise = performMint(jsx, key).finally(() => {
|
|
1051
|
-
inflight.delete(key);
|
|
1052
|
-
});
|
|
1053
|
-
inflight.set(key, promise);
|
|
1054
|
-
return promise;
|
|
1597
|
+
return performMint(jsx, key, mintOpts);
|
|
1055
1598
|
}
|
|
1056
1599
|
return { mintOrReuse };
|
|
1057
1600
|
}
|