@fileverse-dev/fortune-react 1.0.2-mod-99 → 1.0.2-mod-100
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.esm.js +1 -8
- package/dist/index.js +1 -8
- package/dist/index.umd.js +433 -87
- package/dist/index.umd.min.js +7 -7
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -18604,10 +18604,37 @@
|
|
|
18604
18604
|
return -1 * toNumber(number);
|
|
18605
18605
|
}
|
|
18606
18606
|
|
|
18607
|
-
function _typeof$1(o) {
|
|
18608
|
-
|
|
18609
|
-
|
|
18610
|
-
|
|
18607
|
+
function _typeof$1(o) {
|
|
18608
|
+
"@babel/helpers - typeof";
|
|
18609
|
+
|
|
18610
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
18611
|
+
return typeof o;
|
|
18612
|
+
} : function (o) {
|
|
18613
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
18614
|
+
}, _typeof$1(o);
|
|
18615
|
+
}
|
|
18616
|
+
function _defineProperty$1(e, r, t) {
|
|
18617
|
+
return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
|
|
18618
|
+
value: t,
|
|
18619
|
+
enumerable: !0,
|
|
18620
|
+
configurable: !0,
|
|
18621
|
+
writable: !0
|
|
18622
|
+
}) : e[r] = t, e;
|
|
18623
|
+
}
|
|
18624
|
+
function _toPropertyKey$1(t) {
|
|
18625
|
+
var i = _toPrimitive$1(t, "string");
|
|
18626
|
+
return "symbol" == _typeof$1(i) ? i : i + "";
|
|
18627
|
+
}
|
|
18628
|
+
function _toPrimitive$1(t, r) {
|
|
18629
|
+
if ("object" != _typeof$1(t) || !t) return t;
|
|
18630
|
+
var e = t[Symbol.toPrimitive];
|
|
18631
|
+
if (void 0 !== e) {
|
|
18632
|
+
var i = e.call(t, r || "default");
|
|
18633
|
+
if ("object" != _typeof$1(i)) return i;
|
|
18634
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18635
|
+
}
|
|
18636
|
+
return ("string" === r ? String : Number)(t);
|
|
18637
|
+
}
|
|
18611
18638
|
var ERROR = "ERROR";
|
|
18612
18639
|
var ERROR_DIV_ZERO = "DIV/0";
|
|
18613
18640
|
var ERROR_NAME = "NAME";
|
|
@@ -37029,7 +37056,9 @@
|
|
|
37029
37056
|
Gnosisscan: "GNOSIS_API_KEY",
|
|
37030
37057
|
Firefly: "FIRE_FLY_API_KEY",
|
|
37031
37058
|
GnosisPay: 'GNOSIS_API_KEY',
|
|
37032
|
-
Neynar: 'NEYNAR_API_KEY'
|
|
37059
|
+
Neynar: 'NEYNAR_API_KEY',
|
|
37060
|
+
Defillama: 'DEFILLAMA_API_KEY',
|
|
37061
|
+
Uniswap: 'UNISWAP_API_KEY'
|
|
37033
37062
|
};
|
|
37034
37063
|
|
|
37035
37064
|
const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
|
|
@@ -37153,13 +37182,10 @@
|
|
|
37153
37182
|
}
|
|
37154
37183
|
}
|
|
37155
37184
|
|
|
37156
|
-
const fromUsernameToFid = async (username) => {
|
|
37185
|
+
const fromUsernameToFid = async (username, apiKey) => {
|
|
37157
37186
|
if(!username) return null
|
|
37158
|
-
const url = `https://api.neynar.com/v2/farcaster/user/search
|
|
37187
|
+
const url = `https://api.neynar.com/v2/farcaster/user/search/?q=${username}&limit=5`;
|
|
37159
37188
|
const res = await fetch(url, {
|
|
37160
|
-
query: {
|
|
37161
|
-
q: username
|
|
37162
|
-
},
|
|
37163
37189
|
headers: {
|
|
37164
37190
|
'x-api-key': API_KEY,
|
|
37165
37191
|
'x-neynar-experimental': 'false'
|
|
@@ -37171,6 +37197,19 @@
|
|
|
37171
37197
|
return user && user.fid || null;
|
|
37172
37198
|
};
|
|
37173
37199
|
|
|
37200
|
+
// remove nested structure from the response
|
|
37201
|
+
const removeNestedStructure = (json) => {
|
|
37202
|
+
return json.map(item => {
|
|
37203
|
+
const flat = {};
|
|
37204
|
+
for (const [key, value] of Object.entries(item)) {
|
|
37205
|
+
if (typeof value !== 'object' || value === null) {
|
|
37206
|
+
flat[key] = value;
|
|
37207
|
+
}
|
|
37208
|
+
}
|
|
37209
|
+
return flat;
|
|
37210
|
+
});
|
|
37211
|
+
};
|
|
37212
|
+
|
|
37174
37213
|
async function FIREFLY() {
|
|
37175
37214
|
const [platform, contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
37176
37215
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
@@ -37230,9 +37269,110 @@
|
|
|
37230
37269
|
}
|
|
37231
37270
|
}
|
|
37232
37271
|
|
|
37272
|
+
async function LENS() {
|
|
37273
|
+
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
37274
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
37275
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
37276
|
+
|
|
37277
|
+
const baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
|
|
37278
|
+
const headers = { "x-api-key": API_KEY };
|
|
37279
|
+
|
|
37280
|
+
const typeMap = {
|
|
37281
|
+
posts: "lensid",
|
|
37282
|
+
replies: "lenspostid",
|
|
37283
|
+
};
|
|
37284
|
+
|
|
37285
|
+
const platformType = typeMap[contentType];
|
|
37286
|
+
if (!platformType) return `Lens: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
37233
37287
|
|
|
37288
|
+
const query = identifier
|
|
37289
|
+
.split(",")
|
|
37290
|
+
.map(s => s.trim())
|
|
37291
|
+
.filter(Boolean)
|
|
37292
|
+
.join(",");
|
|
37293
|
+
|
|
37294
|
+
const url = new URL(baseUrl);
|
|
37295
|
+
url.searchParams.set("query", query);
|
|
37296
|
+
url.searchParams.set("type", platformType);
|
|
37297
|
+
url.searchParams.set("start", String(start));
|
|
37298
|
+
url.searchParams.set("end", String(end));
|
|
37234
37299
|
|
|
37300
|
+
try {
|
|
37301
|
+
const res = await fetch(url.toString(), { headers });
|
|
37302
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37235
37303
|
|
|
37304
|
+
const json = await res.json();
|
|
37305
|
+
if (!Array.isArray(json?.data)) return [];
|
|
37306
|
+
|
|
37307
|
+
return json.data.map(item => {
|
|
37308
|
+
const flat = {};
|
|
37309
|
+
for (const [key, value] of Object.entries(item)) {
|
|
37310
|
+
if (typeof value !== "object" || value === null) {
|
|
37311
|
+
flat[key] = value;
|
|
37312
|
+
}
|
|
37313
|
+
}
|
|
37314
|
+
flat.platform = 'lens';
|
|
37315
|
+
return flat;
|
|
37316
|
+
});
|
|
37317
|
+
|
|
37318
|
+
} catch (err) {
|
|
37319
|
+
console.error("LENS fetch error:", err);
|
|
37320
|
+
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
37321
|
+
}
|
|
37322
|
+
}
|
|
37323
|
+
|
|
37324
|
+
async function FARCASTER() {
|
|
37325
|
+
const [contentType, identifier, start = 0, end = 10] = argsToArray(arguments);
|
|
37326
|
+
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
|
|
37327
|
+
if (!API_KEY) return `${SERVICE_API_KEY.Firefly}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
37328
|
+
|
|
37329
|
+
const baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
|
|
37330
|
+
const headers = { "x-api-key": API_KEY };
|
|
37331
|
+
|
|
37332
|
+
const typeMap = {
|
|
37333
|
+
posts: "farcasterid",
|
|
37334
|
+
replies: "farcasterpostid",
|
|
37335
|
+
channels: "farcasterchannels",
|
|
37336
|
+
};
|
|
37337
|
+
|
|
37338
|
+
const platformType = typeMap[contentType];
|
|
37339
|
+
if (!platformType) return `Farcaster: ${ERROR_MESSAGES_FLAG.INVALID_TYPE}`;
|
|
37340
|
+
|
|
37341
|
+
const query = identifier
|
|
37342
|
+
.split(",")
|
|
37343
|
+
.map(s => s.trim())
|
|
37344
|
+
.filter(Boolean)
|
|
37345
|
+
.join(",");
|
|
37346
|
+
|
|
37347
|
+
const url = new URL(baseUrl);
|
|
37348
|
+
url.searchParams.set("query", query);
|
|
37349
|
+
url.searchParams.set("type", platformType);
|
|
37350
|
+
url.searchParams.set("start", String(start));
|
|
37351
|
+
url.searchParams.set("end", String(end));
|
|
37352
|
+
|
|
37353
|
+
try {
|
|
37354
|
+
const res = await fetch(url.toString(), { headers });
|
|
37355
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
37356
|
+
|
|
37357
|
+
const json = await res.json();
|
|
37358
|
+
if (!Array.isArray(json?.data)) return [];
|
|
37359
|
+
|
|
37360
|
+
return json.data.map(item => {
|
|
37361
|
+
const flat = {};
|
|
37362
|
+
for (const [key, value] of Object.entries(item)) {
|
|
37363
|
+
if (typeof value !== "object" || value === null) {
|
|
37364
|
+
flat[key] = value;
|
|
37365
|
+
}
|
|
37366
|
+
}
|
|
37367
|
+
flat.platform = "farcaster";
|
|
37368
|
+
return flat;
|
|
37369
|
+
});
|
|
37370
|
+
|
|
37371
|
+
} catch (err) {
|
|
37372
|
+
console.error("Farcaster fetch error:", err);
|
|
37373
|
+
return ERROR_MESSAGES_FLAG.DEFAULT;
|
|
37374
|
+
}
|
|
37375
|
+
}
|
|
37236
37376
|
|
|
37237
37377
|
async function BLOCKSCOUT() {
|
|
37238
37378
|
let [address, type, chain, startTimestamp, endTimestamp, page, offset] = argsToArray(arguments);
|
|
@@ -37467,9 +37607,9 @@
|
|
|
37467
37607
|
|
|
37468
37608
|
switch (lowerCategory) {
|
|
37469
37609
|
case 'price': {
|
|
37470
|
-
const
|
|
37471
|
-
const
|
|
37472
|
-
if (!token
|
|
37610
|
+
const token = param1;
|
|
37611
|
+
const vsCurrencies = param2;
|
|
37612
|
+
if (!token) {
|
|
37473
37613
|
return `${SERVICE_API_KEY.Coingecko}${ERROR_MESSAGES_FLAG.INVALID_PARAM}`;
|
|
37474
37614
|
}
|
|
37475
37615
|
url = `https://api.coingecko.com/api/v3/simple/price?vs_currencies=${vsCurrencies ? vsCurrencies : 'usd' }&symbols=${token}`;
|
|
@@ -37550,11 +37690,31 @@
|
|
|
37550
37690
|
return [output];
|
|
37551
37691
|
}
|
|
37552
37692
|
|
|
37553
|
-
|
|
37693
|
+
let data = json;
|
|
37554
37694
|
|
|
37555
37695
|
if (lowerCategory === 'derivatives') {
|
|
37556
|
-
if (json
|
|
37557
|
-
data = json.
|
|
37696
|
+
if (json.length > 200) {
|
|
37697
|
+
data = json.slice(0, 200);
|
|
37698
|
+
}
|
|
37699
|
+
|
|
37700
|
+
if(param1 !== 'all' && json && json.tickers){
|
|
37701
|
+
const exchangeDetails = {
|
|
37702
|
+
exchange_id: param1,
|
|
37703
|
+
exchange_name: json.name,
|
|
37704
|
+
exchange_logo: json.logo,
|
|
37705
|
+
exchange_url: json.url,
|
|
37706
|
+
exchange_trade_volume_24h_btc: json.trade_volume_24h_btc,
|
|
37707
|
+
exchange_number_of_futures_pairs: json.number_of_futures_pairs,
|
|
37708
|
+
exchange_number_of_perpetual_pairs: json.number_of_perpetual_pairs,
|
|
37709
|
+
exchange_open_interest_btc: json.open_interest_btc,
|
|
37710
|
+
};
|
|
37711
|
+
data = json.tickers.slice(0, 200).map(item => {
|
|
37712
|
+
return {
|
|
37713
|
+
...item,
|
|
37714
|
+
...exchangeDetails,
|
|
37715
|
+
usd_volume: item.converted_volume && item.converted_volume.usd,
|
|
37716
|
+
}
|
|
37717
|
+
});
|
|
37558
37718
|
}
|
|
37559
37719
|
}
|
|
37560
37720
|
|
|
@@ -37574,31 +37734,23 @@
|
|
|
37574
37734
|
}
|
|
37575
37735
|
}
|
|
37576
37736
|
|
|
37577
|
-
|
|
37578
|
-
|
|
37579
|
-
|
|
37580
|
-
async function EOA(
|
|
37581
|
-
) {
|
|
37737
|
+
async function EOA() {
|
|
37582
37738
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
37583
37739
|
if (!API_KEY) return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`;
|
|
37584
|
-
|
|
37585
37740
|
let [
|
|
37586
|
-
|
|
37587
|
-
|
|
37588
|
-
|
|
37589
|
-
|
|
37590
|
-
|
|
37591
|
-
|
|
37592
|
-
|
|
37741
|
+
addresses,
|
|
37742
|
+
category,
|
|
37743
|
+
chains,
|
|
37744
|
+
startTime,
|
|
37745
|
+
endTime,
|
|
37746
|
+
page = 1,
|
|
37747
|
+
offset = 10,
|
|
37593
37748
|
] = argsToArray(arguments);
|
|
37594
|
-
|
|
37595
37749
|
const INPUTS = addresses.split(",").map(a => a.trim()).filter(Boolean);
|
|
37596
37750
|
const CHAINS = chains.split(",").map(c => c.trim()).filter(Boolean);
|
|
37597
37751
|
const out = [];
|
|
37598
|
-
|
|
37599
37752
|
// Map: finalAddress => ENS name (if applicable)
|
|
37600
37753
|
const ADDRESS_MAP = {};
|
|
37601
|
-
|
|
37602
37754
|
for (const input of INPUTS) {
|
|
37603
37755
|
if (isAddress(input)) {
|
|
37604
37756
|
ADDRESS_MAP[input.toLowerCase()] = null; // it's a direct address
|
|
@@ -37611,51 +37763,42 @@
|
|
|
37611
37763
|
}
|
|
37612
37764
|
}
|
|
37613
37765
|
}
|
|
37614
|
-
|
|
37615
37766
|
const ADDRS = Object.keys(ADDRESS_MAP);
|
|
37616
|
-
|
|
37617
37767
|
for (const chain of CHAINS) {
|
|
37618
37768
|
const chainId = CHAIN_ID_MAP[chain];
|
|
37619
37769
|
if (!chainId) return ERROR_MESSAGES_FLAG.UNSUPPORTED_CHAIN;
|
|
37620
|
-
|
|
37621
37770
|
if (category === "balance") {
|
|
37622
37771
|
for (let i = 0; i < ADDRS.length; i += 20) {
|
|
37623
37772
|
const slice = ADDRS.slice(i, i + 20).join(",");
|
|
37624
|
-
const action =
|
|
37625
|
-
|
|
37773
|
+
const action = 'addresstokenbalance';
|
|
37626
37774
|
const url =
|
|
37627
37775
|
`https://api.etherscan.io/v2/api?chainid=${chainId}` +
|
|
37628
37776
|
`&module=account&action=${action}&address=${slice}` +
|
|
37629
|
-
`&
|
|
37630
|
-
|
|
37777
|
+
`&page=${page}&offset=${offset}&apikey=${API_KEY}`;
|
|
37631
37778
|
const data = await fetchJSON(url);
|
|
37632
37779
|
if (typeof data === "string") return data;
|
|
37633
|
-
|
|
37634
|
-
(Array.isArray(data) ? data : [data]).forEach(r =>
|
|
37780
|
+
data.forEach(tx =>
|
|
37635
37781
|
out.push({
|
|
37636
37782
|
chain,
|
|
37637
|
-
|
|
37638
|
-
name: ADDRESS_MAP[
|
|
37783
|
+
address: ADDRS[i],
|
|
37784
|
+
name: ADDRESS_MAP[ADDRS[i]],
|
|
37785
|
+
...tx,
|
|
37639
37786
|
}),
|
|
37640
37787
|
);
|
|
37641
37788
|
}
|
|
37642
37789
|
continue;
|
|
37643
37790
|
}
|
|
37644
|
-
|
|
37645
37791
|
if (category === "txns") {
|
|
37646
37792
|
const startBlock = await fromTimeStampToBlock(toTimestamp(startTime), chain, API_KEY);
|
|
37647
37793
|
const endBlock = await fromTimeStampToBlock(toTimestamp(endTime), chain, API_KEY);
|
|
37648
|
-
|
|
37649
37794
|
for (const addr of ADDRS) {
|
|
37650
37795
|
const url =
|
|
37651
37796
|
`https://api.etherscan.io/v2/api?chainid=${chainId}` +
|
|
37652
37797
|
`&module=account&action=txlist&address=${addr}` +
|
|
37653
37798
|
`&startblock=${startBlock}&endblock=${endBlock}` +
|
|
37654
37799
|
`&page=${page}&offset=${offset}&sort=asc&apikey=${API_KEY}`;
|
|
37655
|
-
|
|
37656
37800
|
const data = await fetchJSON(url);
|
|
37657
37801
|
if (typeof data === "string") return data;
|
|
37658
|
-
|
|
37659
37802
|
data.forEach(tx =>
|
|
37660
37803
|
out.push({
|
|
37661
37804
|
chain,
|
|
@@ -37667,7 +37810,6 @@
|
|
|
37667
37810
|
}
|
|
37668
37811
|
continue;
|
|
37669
37812
|
}
|
|
37670
|
-
|
|
37671
37813
|
return ERROR_MESSAGES_FLAG.INVALID_CATEGORY;
|
|
37672
37814
|
}
|
|
37673
37815
|
|
|
@@ -37748,6 +37890,46 @@
|
|
|
37748
37890
|
}
|
|
37749
37891
|
}
|
|
37750
37892
|
|
|
37893
|
+
async function DEFILLAMA() {
|
|
37894
|
+
let [category] = argsToArray(arguments);
|
|
37895
|
+
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Defillama);
|
|
37896
|
+
if (!apiKey) return `${SERVICE_API_KEY.Defillama}_MISSING`;
|
|
37897
|
+
const categoryList = ['protocols', 'yields', 'dex'];
|
|
37898
|
+
const categoryMap = {
|
|
37899
|
+
[categoryList[0]]: 'https://api.llama.fi/protocols',
|
|
37900
|
+
[categoryList[1]]: 'https://yields.llama.fi/pools',
|
|
37901
|
+
[categoryList[2]]: 'https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true'
|
|
37902
|
+
};
|
|
37903
|
+
let url = categoryMap[category];
|
|
37904
|
+
|
|
37905
|
+
try {
|
|
37906
|
+
const response = await fetch(url);
|
|
37907
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
|
|
37908
|
+
let json = await response.json();
|
|
37909
|
+
switch(category){
|
|
37910
|
+
case categoryList[0]: {
|
|
37911
|
+
if(json.length > 500){
|
|
37912
|
+
json = json.slice(0, 500);
|
|
37913
|
+
}
|
|
37914
|
+
break;
|
|
37915
|
+
}
|
|
37916
|
+
case categoryList[1]: {
|
|
37917
|
+
json = json.data.slice(0, 500);
|
|
37918
|
+
break;
|
|
37919
|
+
}
|
|
37920
|
+
case categoryList[2]: {
|
|
37921
|
+
json = json.protocols.slice(0, 500);
|
|
37922
|
+
break;
|
|
37923
|
+
}
|
|
37924
|
+
}
|
|
37925
|
+
|
|
37926
|
+
return removeNestedStructure(Array.isArray(json) ? json : [json]);
|
|
37927
|
+
} catch (e) {
|
|
37928
|
+
console.log(e);
|
|
37929
|
+
return "ERROR IN FETCHING";
|
|
37930
|
+
}
|
|
37931
|
+
}
|
|
37932
|
+
|
|
37751
37933
|
function POLYMARKET() {
|
|
37752
37934
|
return "Coming Soon"
|
|
37753
37935
|
}
|
|
@@ -37877,6 +38059,7 @@
|
|
|
37877
38059
|
DEC2HEX: DEC2HEX,
|
|
37878
38060
|
DEC2OCT: DEC2OCT,
|
|
37879
38061
|
DECIMAL: DECIMAL,
|
|
38062
|
+
DEFILLAMA: DEFILLAMA,
|
|
37880
38063
|
DEGREES: DEGREES,
|
|
37881
38064
|
DELTA: DELTA,
|
|
37882
38065
|
DEVSQ: DEVSQ,
|
|
@@ -37912,6 +38095,7 @@
|
|
|
37912
38095
|
FACT: FACT,
|
|
37913
38096
|
FACTDOUBLE: FACTDOUBLE,
|
|
37914
38097
|
FALSE: FALSE,
|
|
38098
|
+
FARCASTER: FARCASTER,
|
|
37915
38099
|
FDIST: FDIST,
|
|
37916
38100
|
FDISTRT: FDISTRT,
|
|
37917
38101
|
FIND: FIND,
|
|
@@ -38003,6 +38187,7 @@
|
|
|
38003
38187
|
LCM: LCM,
|
|
38004
38188
|
LEFT: LEFT,
|
|
38005
38189
|
LEN: LEN,
|
|
38190
|
+
LENS: LENS,
|
|
38006
38191
|
LINEST: LINEST,
|
|
38007
38192
|
LN: LN,
|
|
38008
38193
|
LOG: LOG,
|
|
@@ -38304,12 +38489,30 @@
|
|
|
38304
38489
|
}
|
|
38305
38490
|
func$c.SYMBOL = SYMBOL$c;
|
|
38306
38491
|
|
|
38307
|
-
function _toConsumableArray$1(r) {
|
|
38308
|
-
|
|
38309
|
-
|
|
38310
|
-
function
|
|
38311
|
-
|
|
38312
|
-
|
|
38492
|
+
function _toConsumableArray$1(r) {
|
|
38493
|
+
return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$1();
|
|
38494
|
+
}
|
|
38495
|
+
function _nonIterableSpread$1() {
|
|
38496
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
38497
|
+
}
|
|
38498
|
+
function _unsupportedIterableToArray$1(r, a) {
|
|
38499
|
+
if (r) {
|
|
38500
|
+
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
|
|
38501
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
38502
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
|
|
38503
|
+
}
|
|
38504
|
+
}
|
|
38505
|
+
function _iterableToArray$1(r) {
|
|
38506
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
38507
|
+
}
|
|
38508
|
+
function _arrayWithoutHoles$1(r) {
|
|
38509
|
+
if (Array.isArray(r)) return _arrayLikeToArray$1(r);
|
|
38510
|
+
}
|
|
38511
|
+
function _arrayLikeToArray$1(r, a) {
|
|
38512
|
+
(null == a || a > r.length) && (a = r.length);
|
|
38513
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
38514
|
+
return n;
|
|
38515
|
+
}
|
|
38313
38516
|
var availableOperators = Object.create(null);
|
|
38314
38517
|
|
|
38315
38518
|
/**
|
|
@@ -39857,12 +40060,54 @@
|
|
|
39857
40060
|
return string;
|
|
39858
40061
|
}
|
|
39859
40062
|
|
|
39860
|
-
function _slicedToArray$1(r, e) {
|
|
39861
|
-
|
|
39862
|
-
|
|
39863
|
-
function
|
|
39864
|
-
|
|
39865
|
-
|
|
40063
|
+
function _slicedToArray$1(r, e) {
|
|
40064
|
+
return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest$1();
|
|
40065
|
+
}
|
|
40066
|
+
function _nonIterableRest$1() {
|
|
40067
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
40068
|
+
}
|
|
40069
|
+
function _unsupportedIterableToArray$2(r, a) {
|
|
40070
|
+
if (r) {
|
|
40071
|
+
if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
|
|
40072
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
40073
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0;
|
|
40074
|
+
}
|
|
40075
|
+
}
|
|
40076
|
+
function _arrayLikeToArray$2(r, a) {
|
|
40077
|
+
(null == a || a > r.length) && (a = r.length);
|
|
40078
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
40079
|
+
return n;
|
|
40080
|
+
}
|
|
40081
|
+
function _iterableToArrayLimit$1(r, l) {
|
|
40082
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
40083
|
+
if (null != t) {
|
|
40084
|
+
var e,
|
|
40085
|
+
n,
|
|
40086
|
+
i,
|
|
40087
|
+
u,
|
|
40088
|
+
a = [],
|
|
40089
|
+
f = !0,
|
|
40090
|
+
o = !1;
|
|
40091
|
+
try {
|
|
40092
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
40093
|
+
if (Object(t) !== t) return;
|
|
40094
|
+
f = !1;
|
|
40095
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
40096
|
+
} catch (r) {
|
|
40097
|
+
o = !0, n = r;
|
|
40098
|
+
} finally {
|
|
40099
|
+
try {
|
|
40100
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
40101
|
+
} finally {
|
|
40102
|
+
if (o) throw n;
|
|
40103
|
+
}
|
|
40104
|
+
}
|
|
40105
|
+
return a;
|
|
40106
|
+
}
|
|
40107
|
+
}
|
|
40108
|
+
function _arrayWithHoles$1(r) {
|
|
40109
|
+
if (Array.isArray(r)) return r;
|
|
40110
|
+
}
|
|
39866
40111
|
/**
|
|
39867
40112
|
* Convert row label to index.
|
|
39868
40113
|
*
|
|
@@ -39975,25 +40220,133 @@
|
|
|
39975
40220
|
return columnLabel + rowLabel;
|
|
39976
40221
|
}
|
|
39977
40222
|
|
|
39978
|
-
function _typeof$2(o) {
|
|
39979
|
-
|
|
39980
|
-
|
|
39981
|
-
|
|
39982
|
-
|
|
39983
|
-
|
|
39984
|
-
|
|
39985
|
-
|
|
39986
|
-
|
|
39987
|
-
function
|
|
39988
|
-
|
|
39989
|
-
|
|
39990
|
-
function
|
|
39991
|
-
|
|
39992
|
-
|
|
39993
|
-
function
|
|
39994
|
-
|
|
39995
|
-
|
|
39996
|
-
|
|
40223
|
+
function _typeof$2(o) {
|
|
40224
|
+
"@babel/helpers - typeof";
|
|
40225
|
+
|
|
40226
|
+
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
40227
|
+
return typeof o;
|
|
40228
|
+
} : function (o) {
|
|
40229
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
40230
|
+
}, _typeof$2(o);
|
|
40231
|
+
}
|
|
40232
|
+
function _slicedToArray$2(r, e) {
|
|
40233
|
+
return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest$2();
|
|
40234
|
+
}
|
|
40235
|
+
function _nonIterableRest$2() {
|
|
40236
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
40237
|
+
}
|
|
40238
|
+
function _unsupportedIterableToArray$3(r, a) {
|
|
40239
|
+
if (r) {
|
|
40240
|
+
if ("string" == typeof r) return _arrayLikeToArray$3(r, a);
|
|
40241
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
40242
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0;
|
|
40243
|
+
}
|
|
40244
|
+
}
|
|
40245
|
+
function _arrayLikeToArray$3(r, a) {
|
|
40246
|
+
(null == a || a > r.length) && (a = r.length);
|
|
40247
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
40248
|
+
return n;
|
|
40249
|
+
}
|
|
40250
|
+
function _iterableToArrayLimit$2(r, l) {
|
|
40251
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
40252
|
+
if (null != t) {
|
|
40253
|
+
var e,
|
|
40254
|
+
n,
|
|
40255
|
+
i,
|
|
40256
|
+
u,
|
|
40257
|
+
a = [],
|
|
40258
|
+
f = !0,
|
|
40259
|
+
o = !1;
|
|
40260
|
+
try {
|
|
40261
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
40262
|
+
if (Object(t) !== t) return;
|
|
40263
|
+
f = !1;
|
|
40264
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
40265
|
+
} catch (r) {
|
|
40266
|
+
o = !0, n = r;
|
|
40267
|
+
} finally {
|
|
40268
|
+
try {
|
|
40269
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
40270
|
+
} finally {
|
|
40271
|
+
if (o) throw n;
|
|
40272
|
+
}
|
|
40273
|
+
}
|
|
40274
|
+
return a;
|
|
40275
|
+
}
|
|
40276
|
+
}
|
|
40277
|
+
function _arrayWithHoles$2(r) {
|
|
40278
|
+
if (Array.isArray(r)) return r;
|
|
40279
|
+
}
|
|
40280
|
+
function _classCallCheck(a, n) {
|
|
40281
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
40282
|
+
}
|
|
40283
|
+
function _defineProperties(e, r) {
|
|
40284
|
+
for (var t = 0; t < r.length; t++) {
|
|
40285
|
+
var o = r[t];
|
|
40286
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$2(o.key), o);
|
|
40287
|
+
}
|
|
40288
|
+
}
|
|
40289
|
+
function _createClass(e, r, t) {
|
|
40290
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
40291
|
+
writable: !1
|
|
40292
|
+
}), e;
|
|
40293
|
+
}
|
|
40294
|
+
function _toPropertyKey$2(t) {
|
|
40295
|
+
var i = _toPrimitive$2(t, "string");
|
|
40296
|
+
return "symbol" == _typeof$2(i) ? i : i + "";
|
|
40297
|
+
}
|
|
40298
|
+
function _toPrimitive$2(t, r) {
|
|
40299
|
+
if ("object" != _typeof$2(t) || !t) return t;
|
|
40300
|
+
var e = t[Symbol.toPrimitive];
|
|
40301
|
+
if (void 0 !== e) {
|
|
40302
|
+
var i = e.call(t, r || "default");
|
|
40303
|
+
if ("object" != _typeof$2(i)) return i;
|
|
40304
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
40305
|
+
}
|
|
40306
|
+
return ("string" === r ? String : Number)(t);
|
|
40307
|
+
}
|
|
40308
|
+
function _callSuper(t, o, e) {
|
|
40309
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
40310
|
+
}
|
|
40311
|
+
function _possibleConstructorReturn(t, e) {
|
|
40312
|
+
if (e && ("object" == _typeof$2(e) || "function" == typeof e)) return e;
|
|
40313
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
40314
|
+
return _assertThisInitialized(t);
|
|
40315
|
+
}
|
|
40316
|
+
function _assertThisInitialized(e) {
|
|
40317
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
40318
|
+
return e;
|
|
40319
|
+
}
|
|
40320
|
+
function _isNativeReflectConstruct() {
|
|
40321
|
+
try {
|
|
40322
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
40323
|
+
} catch (t) {}
|
|
40324
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
40325
|
+
return !!t;
|
|
40326
|
+
})();
|
|
40327
|
+
}
|
|
40328
|
+
function _getPrototypeOf(t) {
|
|
40329
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
40330
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
40331
|
+
}, _getPrototypeOf(t);
|
|
40332
|
+
}
|
|
40333
|
+
function _inherits(t, e) {
|
|
40334
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
40335
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
40336
|
+
constructor: {
|
|
40337
|
+
value: t,
|
|
40338
|
+
writable: !0,
|
|
40339
|
+
configurable: !0
|
|
40340
|
+
}
|
|
40341
|
+
}), Object.defineProperty(t, "prototype", {
|
|
40342
|
+
writable: !1
|
|
40343
|
+
}), e && _setPrototypeOf(t, e);
|
|
40344
|
+
}
|
|
40345
|
+
function _setPrototypeOf(t, e) {
|
|
40346
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
40347
|
+
return t.__proto__ = e, t;
|
|
40348
|
+
}, _setPrototypeOf(t, e);
|
|
40349
|
+
}
|
|
39997
40350
|
|
|
39998
40351
|
/**
|
|
39999
40352
|
* @class Parser
|
|
@@ -105964,18 +106317,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
105964
106317
|
e.preventDefault();
|
|
105965
106318
|
}
|
|
105966
106319
|
}, [clearSearchItemActiveClass, context.luckysheetCellUpdate.length, selectActiveFormula, setContext, firstSelection]);
|
|
105967
|
-
var _useState3 = React.useState(false),
|
|
105968
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
105969
|
-
showCrypoModal = _useState4[0],
|
|
105970
|
-
setShowCryptoModal = _useState4[1];
|
|
105971
106320
|
var onChange = React.useCallback(function (__, isBlur) {
|
|
105972
106321
|
var e = lastKeyDownEventRef.current;
|
|
105973
106322
|
if (!e) return;
|
|
105974
106323
|
var kcode = e.keyCode;
|
|
105975
106324
|
if (!kcode) return;
|
|
105976
|
-
if (!document.getElementById("luckysheet-formula-search-c")) {
|
|
105977
|
-
setShowCryptoModal(!document.getElementById("luckysheet-formula-search-c"));
|
|
105978
|
-
}
|
|
105979
106325
|
if (!(kcode >= 112 && kcode <= 123 || kcode <= 46 || kcode === 144 || kcode === 108 || e.ctrlKey || e.altKey || e.shiftKey && (kcode === 37 || kcode === 38 || kcode === 39 || kcode === 40)) || kcode === 8 || kcode === 32 || kcode === 46 || e.ctrlKey && kcode === 86) {
|
|
105980
106326
|
setContext(function (draftCtx) {
|
|
105981
106327
|
if ((draftCtx.formulaCache.rangestart || draftCtx.formulaCache.rangedrag_column_start || draftCtx.formulaCache.rangedrag_row_start || israngeseleciton(draftCtx)) && isBlur) return;
|
|
@@ -106037,7 +106383,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
106037
106383
|
onKeyDown: onKeyDown,
|
|
106038
106384
|
onPaste: onPaste,
|
|
106039
106385
|
allowEdit: edit ? !isHidenRC : edit
|
|
106040
|
-
})), (context.functionCandidates.length > 0 || context.functionHint || context.defaultCandidates.length > 0) &&
|
|
106386
|
+
})), (context.functionCandidates.length > 0 || context.functionHint || context.defaultCandidates.length > 0) && (/*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(FormulaSearch, {
|
|
106041
106387
|
onMouseOver: function onMouseOver(e) {
|
|
106042
106388
|
if (document.getElementById("luckysheet-formula-search-c")) {
|
|
106043
106389
|
var hoveredItem = e.target.closest(".luckysheet-formula-search-item");
|