useblocks 1.1.53 → 1.1.60
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/iframe/js/amp.BP7EklKo.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.4N5s3OV-.js +1 -1
- package/npm-publish.manifest.json +7 -7
- package/package.json +1 -7
- package/runtime/THIRD_PARTY_LICENSES.txt +0 -235
- package/runtime/index.js +0 -2
- package/runtime/package.json +0 -6
- package/runtime/plugin-dev-manifest.json +0 -4
- package/singlepage_headless_plugin.html +1 -1
- package/static/core/{5318562c.js → 161d1254.js} +268 -257
- package/static/core/{b9f47840.js → 17d3ee0b.js} +8 -8
- package/static/core/{6895dd352.js → 195ca4a32.js} +15 -15
- package/static/core/{dc1f9e4f.js → 2569fac8.js} +26 -26
- package/static/core/{4ca527032.js → 26ddf93e2.js} +2 -2
- package/static/core/{9929a348.js → 30c5fe5f.js} +90 -90
- package/static/core/{e93d55b92.js → 3af8f3592.js} +4 -4
- package/static/core/{ebd852b6.js → 40f73dfb.js} +1019 -1032
- package/static/core/{c3058168.js → 43c3f160.js} +3283 -3189
- package/static/core/{542ea53f2.js → 4a27bba92.js} +8 -8
- package/static/core/4c39852e.js +3150 -0
- package/static/core/{e5e07f1d.js → 4e75b331.js} +13 -13
- package/static/core/{e1d239ab.js → 5345bef8.js} +42 -42
- package/static/core/{31e98e6e.js → 53463a60.js} +707 -712
- package/static/core/{27544e7e.js → 581ce428.js} +37 -19
- package/static/core/{d8daf1142.js → 6156301b2.js} +3 -3
- package/static/core/{c3849484.js → 64bea1a9.js} +5 -5
- package/static/core/{ce4fc17f2.js → 680236f4.js} +1 -1
- package/static/core/{4b75d16c2.js → 687795b52.js} +4 -4
- package/static/core/{70407ac0.js → 72f86b2d.js} +3 -3
- package/static/core/{139e4380.js → 7a15fa8b.js} +3 -3
- package/static/core/{b77f0769.js → 8432f11e.js} +5 -5
- package/static/core/{d1eb3c68.js → 8815eb5b.js} +15670 -15289
- package/static/core/{f3cff4c9.js → 8a496b64.js} +158 -158
- package/static/core/{4e1b970f.js → 8ba13f332.js} +1 -1
- package/static/core/{75737a9d.js → 951903fb.js} +9096 -9074
- package/static/core/{a95c02bb.js → a1355a35.js} +5 -5
- package/static/core/{7c6fb2162.js → a36c3ab62.js} +3 -3
- package/static/core/{2da1d66b.js → abd3f34c.js} +5 -5
- package/static/core/{528ad9282.js → ae20f0992.js} +16 -16
- package/static/core/ba6c356e.js +466 -0
- package/static/core/{ee0ddb51.js → c9e59b34.js} +6884 -4960
- package/static/core/{f96d2049.js → d1a1d4902.js} +1 -1
- package/static/core/{5b48fd69.js → d8d6485e.js} +5 -5
- package/static/core/{59e92cc3.js → d9398296.js} +5 -5
- package/static/core/{b408f33a.js → d9baa55e.js} +25 -25
- package/static/core/dbf19c2e.js +811 -0
- package/static/core/{bc7e3d2b.js → f953827c.js} +10 -10
- package/static/core/{1e5bf73c.js → ffee9a77.js} +7 -7
- package/static/esm/2474de05.js +131 -0
- package/static/esm/{d180c108.js → 53b688bd.js} +66 -85
- package/two_step_headless_plugin.html +1 -1
- package/useblocks-core.f6bb8947.js +673 -0
- package/useblocks-esm.js +875 -552
- package/useblocks.d.ts +8 -0
- package/useblocks.js +691 -408
- package/runtime/prop-types/index.js +0 -4
- package/runtime/react-router-dom/index.js +0 -2
- package/static/core/1995fb0a2.js +0 -602
- package/static/core/1f5e1fc9.js +0 -3097
- package/static/core/ce0410b1.js +0 -467
- package/static/esm/448d4bb0.js +0 -127
- package/static/runtime/dom-export-CHgQ7Ws9.js +0 -8069
- package/static/runtime/prop-types-p_yYKrF7.js +0 -47
- package/useblocks-core.2a5dade1.js +0 -643
- /package/iframe/{iframe-eblock.2a5dade1.html → iframe-eblock.f6bb8947.html} +0 -0
- /package/iframe/{iframe.2a5dade1.html → iframe.f6bb8947.html} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/161d1254.js", [
|
|
2
2
|
"require",
|
|
3
3
|
"exports",
|
|
4
4
|
"module",
|
|
5
5
|
"static/core/bd36b180.js",
|
|
6
|
-
"static/core/
|
|
7
|
-
], function(Ee,
|
|
8
|
-
const
|
|
6
|
+
"static/core/c9e59b34.js"
|
|
7
|
+
], function(Ee, y, zt) {
|
|
8
|
+
const We = Ee("./bd36b180.js"), p = Ee("./c9e59b34.js");
|
|
9
9
|
function Ae(t) {
|
|
10
10
|
return function(r) {
|
|
11
11
|
return {
|
|
@@ -16,79 +16,79 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function $e(t) {
|
|
20
20
|
return (r) => {
|
|
21
21
|
const o = {}, s = [];
|
|
22
|
-
for (const
|
|
23
|
-
for (const
|
|
22
|
+
for (const g of t) s.push(g(r));
|
|
23
|
+
for (const g of s) Object.assign(o, g.instance);
|
|
24
24
|
return {
|
|
25
25
|
instance: o,
|
|
26
|
-
setOptions: async (
|
|
27
|
-
for (const S of s) await S.setOptions(
|
|
26
|
+
setOptions: async (g) => {
|
|
27
|
+
for (const S of s) await S.setOptions(g);
|
|
28
28
|
},
|
|
29
29
|
dispose: () => {
|
|
30
|
-
for (const
|
|
30
|
+
for (const g of s) g.dispose();
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Je() {
|
|
36
36
|
const t = new Date();
|
|
37
37
|
return t.valueOf() - t.getTimezoneOffset() * 60 * 1e3;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Xe(t) {
|
|
40
40
|
const r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), o = atob(r), s = new Uint8Array(o.length);
|
|
41
41
|
for (let c = 0; c < o.length; c++) s[c] = o.charCodeAt(c);
|
|
42
42
|
return new TextDecoder().decode(s);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const [r, o, s] = t.split("."), c = JSON.parse(
|
|
44
|
+
function Pe(t) {
|
|
45
|
+
const [r, o, s] = t.split("."), c = JSON.parse(Xe(o));
|
|
46
46
|
return {
|
|
47
47
|
exp: c.exp,
|
|
48
48
|
createdAt: c.iat,
|
|
49
49
|
data: c
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
var ae =
|
|
53
|
-
function
|
|
54
|
-
t.inject(ae, void 0), t.injectFactory(ae, async (c,
|
|
52
|
+
var ae = p.createIdentifier$1();
|
|
53
|
+
function Ie(t, r, o, s) {
|
|
54
|
+
t.inject(ae, void 0), t.injectFactory(ae, async (c, l) => {
|
|
55
55
|
try {
|
|
56
|
-
let
|
|
57
|
-
if (!
|
|
58
|
-
const S = t.getInstance(
|
|
59
|
-
S && (
|
|
56
|
+
let g = l ? await l : void 0;
|
|
57
|
+
if (!g) {
|
|
58
|
+
const S = t.getInstance(p.STANDALONE_BOOTSTRAP_TOKEN_ID);
|
|
59
|
+
S && (g = await S);
|
|
60
60
|
}
|
|
61
|
-
return r ? !
|
|
61
|
+
return r ? !g || (Pe(g)?.exp ?? 0) * 1e3 <= Je() ? await r(o, s, g) : g : "";
|
|
62
62
|
} catch {
|
|
63
63
|
return "";
|
|
64
64
|
}
|
|
65
65
|
}, !0);
|
|
66
66
|
}
|
|
67
|
-
var
|
|
67
|
+
var xe = Ae((t) => {
|
|
68
68
|
let r, o, s;
|
|
69
|
-
return t.addService(
|
|
69
|
+
return t.addService(p.REQUEST_HANDLER_ID, { execute: async (c) => {
|
|
70
70
|
if (r) {
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const l = await t.getInstanceAsync(ae);
|
|
72
|
+
l && c.headers.append("authorization", `Bearer ${l}`);
|
|
73
73
|
}
|
|
74
74
|
} }), { setOptions(c) {
|
|
75
|
-
const
|
|
76
|
-
(r !== c.getAuthToken ||
|
|
75
|
+
const l = !p.deepEqual(o, c.user), g = s !== c.project;
|
|
76
|
+
(r !== c.getAuthToken || l || g) && (r = c.getAuthToken, o = c.user, s = c.project, Ie(t, r, c.user, c.project));
|
|
77
77
|
} };
|
|
78
|
-
}),
|
|
78
|
+
}), _e = We.__commonJSMin(((t, r) => {
|
|
79
79
|
(function(o) {
|
|
80
80
|
"use strict";
|
|
81
|
-
var s = o.setTimeout, c = o.clearTimeout,
|
|
81
|
+
var s = o.setTimeout, c = o.clearTimeout, l = o.XMLHttpRequest, g = o.XDomainRequest, S = o.ActiveXObject, G = o.EventSource, O = o.document, k = o.Promise, Q = o.fetch, M = o.Response, N = o.TextDecoder, Y = o.TextEncoder, J = o.AbortController;
|
|
82
82
|
if (typeof window < "u" && typeof O < "u" && !("readyState" in O) && O.body == null && (O.readyState = "loading", window.addEventListener("load", function(e) {
|
|
83
83
|
O.readyState = "complete";
|
|
84
|
-
}, !1)),
|
|
84
|
+
}, !1)), l == null && S != null && (l = function() {
|
|
85
85
|
return new S("Microsoft.XMLHTTP");
|
|
86
86
|
}), Object.create == null && (Object.create = function(e) {
|
|
87
87
|
function a() {}
|
|
88
88
|
return a.prototype = e, new a();
|
|
89
89
|
}), Date.now || (Date.now = function() {
|
|
90
90
|
return new Date().getTime();
|
|
91
|
-
}),
|
|
91
|
+
}), J == null) {
|
|
92
92
|
var K = Q;
|
|
93
93
|
Q = function(e, a) {
|
|
94
94
|
var i = a.signal;
|
|
@@ -97,17 +97,17 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
97
97
|
credentials: a.credentials,
|
|
98
98
|
cache: a.cache
|
|
99
99
|
}).then(function(n) {
|
|
100
|
-
var
|
|
101
|
-
return i._reader =
|
|
100
|
+
var d = n.body.getReader();
|
|
101
|
+
return i._reader = d, i._aborted && i._reader.cancel(), {
|
|
102
102
|
status: n.status,
|
|
103
103
|
statusText: n.statusText,
|
|
104
104
|
headers: n.headers,
|
|
105
105
|
body: { getReader: function() {
|
|
106
|
-
return
|
|
106
|
+
return d;
|
|
107
107
|
} }
|
|
108
108
|
};
|
|
109
109
|
});
|
|
110
|
-
},
|
|
110
|
+
}, J = function() {
|
|
111
111
|
this.signal = {
|
|
112
112
|
_reader: null,
|
|
113
113
|
_aborted: !1
|
|
@@ -116,10 +116,10 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function de() {
|
|
120
120
|
this.bitsNeeded = 0, this.codePoint = 0;
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
de.prototype.decode = function(e) {
|
|
123
123
|
function a(m, b, f) {
|
|
124
124
|
if (f === 1) return m >= 128 >> b && m << b <= 2047;
|
|
125
125
|
if (f === 2) return m >= 2048 >> b && m << b <= 55295 || m >= 57344 >> b && m << b <= 65535;
|
|
@@ -132,31 +132,31 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
132
132
|
if (m === 18) return 3;
|
|
133
133
|
throw new Error();
|
|
134
134
|
}
|
|
135
|
-
for (var n = 65533,
|
|
136
|
-
var
|
|
137
|
-
u !== 0 && (
|
|
135
|
+
for (var n = 65533, d = "", u = this.bitsNeeded, v = this.codePoint, T = 0; T < e.length; T += 1) {
|
|
136
|
+
var h = e[T];
|
|
137
|
+
u !== 0 && (h < 128 || h > 191 || !a(v << 6 | h & 63, u - 6, i(u, v))) && (u = 0, v = n, d += String.fromCharCode(v)), u === 0 ? (h >= 0 && h <= 127 ? (u = 0, v = h) : h >= 192 && h <= 223 ? (u = 6, v = h & 31) : h >= 224 && h <= 239 ? (u = 12, v = h & 15) : h >= 240 && h <= 247 ? (u = 18, v = h & 7) : (u = 0, v = n), u !== 0 && !a(v, u, i(u, v)) && (u = 0, v = n)) : (u -= 6, v = v << 6 | h & 63), u === 0 && (v <= 65535 ? d += String.fromCharCode(v) : (d += String.fromCharCode(55296 + (v - 65535 - 1 >> 10)), d += String.fromCharCode(56320 + (v - 65535 - 1 & 1023))));
|
|
138
138
|
}
|
|
139
|
-
return this.bitsNeeded = u, this.codePoint =
|
|
139
|
+
return this.bitsNeeded = u, this.codePoint = v, d;
|
|
140
140
|
};
|
|
141
|
-
var
|
|
141
|
+
var Lt = function() {
|
|
142
142
|
try {
|
|
143
143
|
return new N().decode(new Y().encode("test"), { stream: !0 }) === "test";
|
|
144
144
|
} catch {}
|
|
145
145
|
return !1;
|
|
146
146
|
};
|
|
147
|
-
(N == null || Y == null || !
|
|
147
|
+
(N == null || Y == null || !Lt()) && (N = de);
|
|
148
148
|
var D = function() {};
|
|
149
|
-
function
|
|
149
|
+
function X(e) {
|
|
150
150
|
this.withCredentials = !1, this.readyState = 0, this.status = 0, this.statusText = "", this.responseText = "", this.onprogress = D, this.onload = D, this.onerror = D, this.onreadystatechange = D, this._contentType = "", this._xhr = e, this._sendTimeout = 0, this._abort = D;
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
X.prototype.open = function(e, a) {
|
|
153
153
|
this._abort(!0);
|
|
154
|
-
var i = this, n = this._xhr,
|
|
154
|
+
var i = this, n = this._xhr, d = 1, u = 0;
|
|
155
155
|
this._abort = function(f) {
|
|
156
|
-
i._sendTimeout !== 0 && (c(i._sendTimeout), i._sendTimeout = 0), (
|
|
156
|
+
i._sendTimeout !== 0 && (c(i._sendTimeout), i._sendTimeout = 0), (d === 1 || d === 2 || d === 3) && (d = 4, n.onload = D, n.onerror = D, n.onabort = D, n.onprogress = D, n.onreadystatechange = D, n.abort(), u !== 0 && (c(u), u = 0), f || (i.readyState = 4, i.onabort(null), i.onreadystatechange())), d = 0;
|
|
157
157
|
};
|
|
158
|
-
var
|
|
159
|
-
if (
|
|
158
|
+
var v = function() {
|
|
159
|
+
if (d === 1) {
|
|
160
160
|
var f = 0, w = "", F = void 0;
|
|
161
161
|
if ("contentType" in n) f = 200, w = "OK", F = n.contentType;
|
|
162
162
|
else try {
|
|
@@ -164,54 +164,54 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
164
164
|
} catch {
|
|
165
165
|
f = 0, w = "", F = void 0;
|
|
166
166
|
}
|
|
167
|
-
f !== 0 && (
|
|
167
|
+
f !== 0 && (d = 2, i.readyState = 2, i.status = f, i.statusText = w, i._contentType = F, i.onreadystatechange());
|
|
168
168
|
}
|
|
169
169
|
}, T = function() {
|
|
170
|
-
if (
|
|
171
|
-
|
|
170
|
+
if (v(), d === 2 || d === 3) {
|
|
171
|
+
d = 3;
|
|
172
172
|
var f = "";
|
|
173
173
|
try {
|
|
174
174
|
f = n.responseText;
|
|
175
175
|
} catch {}
|
|
176
176
|
i.readyState = 3, i.responseText = f, i.onprogress();
|
|
177
177
|
}
|
|
178
|
-
},
|
|
179
|
-
if ((w == null || w.preventDefault == null) && (w = { preventDefault: D }), T(),
|
|
180
|
-
if (
|
|
178
|
+
}, h = function(f, w) {
|
|
179
|
+
if ((w == null || w.preventDefault == null) && (w = { preventDefault: D }), T(), d === 1 || d === 2 || d === 3) {
|
|
180
|
+
if (d = 4, u !== 0 && (c(u), u = 0), i.readyState = 4, f === "load") i.onload(w);
|
|
181
181
|
else if (f === "error") i.onerror(w);
|
|
182
182
|
else if (f === "abort") i.onabort(w);
|
|
183
183
|
else throw new TypeError();
|
|
184
184
|
i.onreadystatechange();
|
|
185
185
|
}
|
|
186
186
|
}, m = function(f) {
|
|
187
|
-
n != null && (n.readyState === 4 ? (!("onload" in n) || !("onerror" in n) || !("onabort" in n)) &&
|
|
187
|
+
n != null && (n.readyState === 4 ? (!("onload" in n) || !("onerror" in n) || !("onabort" in n)) && h(n.responseText === "" ? "error" : "load", f) : n.readyState === 3 ? "onprogress" in n || T() : n.readyState === 2 && v());
|
|
188
188
|
}, b = function() {
|
|
189
189
|
u = s(function() {
|
|
190
190
|
b();
|
|
191
191
|
}, 500), n.readyState === 3 && T();
|
|
192
192
|
};
|
|
193
193
|
"onload" in n && (n.onload = function(f) {
|
|
194
|
-
|
|
194
|
+
h("load", f);
|
|
195
195
|
}), "onerror" in n && (n.onerror = function(f) {
|
|
196
|
-
|
|
196
|
+
h("error", f);
|
|
197
197
|
}), "onabort" in n && (n.onabort = function(f) {
|
|
198
|
-
|
|
198
|
+
h("abort", f);
|
|
199
199
|
}), "onprogress" in n && (n.onprogress = T), "onreadystatechange" in n && (n.onreadystatechange = function(f) {
|
|
200
200
|
m(f);
|
|
201
|
-
}), ("contentType" in n || !("ontimeout" in
|
|
201
|
+
}), ("contentType" in n || !("ontimeout" in l.prototype)) && (a += (a.indexOf("?") === -1 ? "?" : "&") + "padding=true"), n.open(e, a, !0), "readyState" in n && (u = s(function() {
|
|
202
202
|
b();
|
|
203
203
|
}, 0));
|
|
204
|
-
},
|
|
204
|
+
}, X.prototype.abort = function() {
|
|
205
205
|
this._abort(!1);
|
|
206
|
-
},
|
|
206
|
+
}, X.prototype.getResponseHeader = function(e) {
|
|
207
207
|
return this._contentType;
|
|
208
|
-
},
|
|
208
|
+
}, X.prototype.setRequestHeader = function(e, a) {
|
|
209
209
|
var i = this._xhr;
|
|
210
210
|
"setRequestHeader" in i && i.setRequestHeader(e, a);
|
|
211
|
-
},
|
|
211
|
+
}, X.prototype.getAllResponseHeaders = function() {
|
|
212
212
|
return this._xhr.getAllResponseHeaders != null && this._xhr.getAllResponseHeaders() || "";
|
|
213
|
-
},
|
|
214
|
-
if ((!("ontimeout" in
|
|
213
|
+
}, X.prototype.send = function() {
|
|
214
|
+
if ((!("ontimeout" in l.prototype) || !("sendAsBinary" in l.prototype) && !("mozAnon" in l.prototype)) && O != null && O.readyState != null && O.readyState !== "complete") {
|
|
215
215
|
var e = this;
|
|
216
216
|
e._sendTimeout = s(function() {
|
|
217
217
|
e._sendTimeout = 0, e.send();
|
|
@@ -226,25 +226,25 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
226
226
|
throw i;
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
function
|
|
229
|
+
function Ne(e) {
|
|
230
230
|
return e.replace(/[A-Z]/g, function(a) {
|
|
231
231
|
return String.fromCharCode(a.charCodeAt(0) + 32);
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function De(e) {
|
|
235
235
|
for (var a = Object.create(null), i = e.split(`\r
|
|
236
236
|
`), n = 0; n < i.length; n += 1) {
|
|
237
|
-
var
|
|
238
|
-
a[
|
|
237
|
+
var d = i[n].split(": "), u = d.shift(), v = d.join(": ");
|
|
238
|
+
a[Ne(u)] = v;
|
|
239
239
|
}
|
|
240
240
|
this._map = a;
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
return this._map[
|
|
244
|
-
},
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
e.open("GET",
|
|
242
|
+
De.prototype.get = function(e) {
|
|
243
|
+
return this._map[Ne(e)];
|
|
244
|
+
}, l != null && l.HEADERS_RECEIVED == null && (l.HEADERS_RECEIVED = 2);
|
|
245
|
+
function Ue() {}
|
|
246
|
+
Ue.prototype.open = function(e, a, i, n, d, u, v) {
|
|
247
|
+
e.open("GET", d);
|
|
248
248
|
var T = 0;
|
|
249
249
|
e.onprogress = function() {
|
|
250
250
|
var m = e.responseText.slice(T);
|
|
@@ -256,30 +256,30 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
256
256
|
}, e.onabort = function() {
|
|
257
257
|
n(null);
|
|
258
258
|
}, e.onreadystatechange = function() {
|
|
259
|
-
if (e.readyState ===
|
|
259
|
+
if (e.readyState === l.HEADERS_RECEIVED) {
|
|
260
260
|
var m = e.status, b = e.statusText;
|
|
261
|
-
a(m, b, e.getResponseHeader("Content-Type"), new
|
|
261
|
+
a(m, b, e.getResponseHeader("Content-Type"), new De(e.getAllResponseHeaders()));
|
|
262
262
|
}
|
|
263
263
|
}, e.withCredentials = u;
|
|
264
|
-
for (var
|
|
264
|
+
for (var h in v) Object.prototype.hasOwnProperty.call(v, h) && e.setRequestHeader(h, v[h]);
|
|
265
265
|
return e.send(), e;
|
|
266
266
|
};
|
|
267
|
-
function
|
|
267
|
+
function qe(e) {
|
|
268
268
|
this._headers = e;
|
|
269
269
|
}
|
|
270
|
-
|
|
270
|
+
qe.prototype.get = function(e) {
|
|
271
271
|
return this._headers.get(e);
|
|
272
272
|
};
|
|
273
|
-
function
|
|
274
|
-
|
|
275
|
-
var T = null,
|
|
276
|
-
return Q(
|
|
277
|
-
headers:
|
|
273
|
+
function Ge() {}
|
|
274
|
+
Ge.prototype.open = function(e, a, i, n, d, u, v) {
|
|
275
|
+
var T = null, h = new J(), m = h.signal, b = new N();
|
|
276
|
+
return Q(d, {
|
|
277
|
+
headers: v,
|
|
278
278
|
credentials: u ? "include" : "same-origin",
|
|
279
279
|
signal: m,
|
|
280
280
|
cache: "no-store"
|
|
281
281
|
}).then(function(f) {
|
|
282
|
-
return T = f.body.getReader(), a(f.status, f.statusText, f.headers.get("Content-Type"), new
|
|
282
|
+
return T = f.body.getReader(), a(f.status, f.statusText, f.headers.get("Content-Type"), new qe(f.headers)), new k(function(w, F) {
|
|
283
283
|
var ce = function() {
|
|
284
284
|
T.read().then(function(C) {
|
|
285
285
|
C.done ? w(void 0) : (i(b.decode(C.value, { stream: !0 })), ce());
|
|
@@ -294,13 +294,13 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
294
294
|
}).then(function(f) {
|
|
295
295
|
n(f);
|
|
296
296
|
}), { abort: function() {
|
|
297
|
-
T?.cancel(),
|
|
297
|
+
T?.cancel(), h.abort();
|
|
298
298
|
} };
|
|
299
299
|
};
|
|
300
300
|
function ie() {
|
|
301
301
|
this._listeners = Object.create(null);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Qe(e) {
|
|
304
304
|
s(function() {
|
|
305
305
|
throw e;
|
|
306
306
|
}, 0);
|
|
@@ -309,66 +309,66 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
309
309
|
e.target = this;
|
|
310
310
|
var a = this._listeners[e.type];
|
|
311
311
|
if (a != null) for (var i = a.length, n = 0; n < i; n += 1) {
|
|
312
|
-
var
|
|
312
|
+
var d = a[n];
|
|
313
313
|
try {
|
|
314
|
-
typeof
|
|
314
|
+
typeof d.handleEvent == "function" ? d.handleEvent(e) : d.call(this, e);
|
|
315
315
|
} catch (u) {
|
|
316
|
-
|
|
316
|
+
Qe(u);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}, ie.prototype.addEventListener = function(e, a) {
|
|
320
320
|
e = String(e);
|
|
321
321
|
var i = this._listeners, n = i[e];
|
|
322
322
|
n == null && (n = [], i[e] = n);
|
|
323
|
-
for (var
|
|
324
|
-
|
|
323
|
+
for (var d = !1, u = 0; u < n.length; u += 1) n[u] === a && (d = !0);
|
|
324
|
+
d || n.push(a);
|
|
325
325
|
}, ie.prototype.removeEventListener = function(e, a) {
|
|
326
326
|
e = String(e);
|
|
327
327
|
var i = this._listeners, n = i[e];
|
|
328
328
|
if (n != null) {
|
|
329
|
-
for (var
|
|
330
|
-
|
|
329
|
+
for (var d = [], u = 0; u < n.length; u += 1) n[u] !== a && d.push(n[u]);
|
|
330
|
+
d.length === 0 ? delete i[e] : i[e] = d;
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
333
|
function Z(e) {
|
|
334
334
|
this.type = e, this.target = void 0;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function Fe(e, a) {
|
|
337
337
|
Z.call(this, e), this.data = a.data, this.lastEventId = a.lastEventId;
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
Fe.prototype = Object.create(Z.prototype);
|
|
340
340
|
function he(e, a) {
|
|
341
341
|
Z.call(this, e), this.status = a.status, this.statusText = a.statusText, this.headers = a.headers;
|
|
342
342
|
}
|
|
343
343
|
he.prototype = Object.create(Z.prototype);
|
|
344
|
-
function
|
|
344
|
+
function Be(e, a) {
|
|
345
345
|
Z.call(this, e), this.error = a.error;
|
|
346
346
|
}
|
|
347
|
-
|
|
348
|
-
var ye = -1, W = 0, ee = 1, se = 2, ge = -1,
|
|
347
|
+
Be.prototype = Object.create(Z.prototype);
|
|
348
|
+
var ye = -1, W = 0, ee = 1, se = 2, ge = -1, $ = 0, me = 1, ze = 2, Mt = 3, Nt = /^text\/event\-stream(;.*)?$/i, Dt = 1e3, Ut = 18e6, Se = function(e, a) {
|
|
349
349
|
var i = e == null ? a : parseInt(e, 10);
|
|
350
350
|
return i !== i && (i = a), be(i);
|
|
351
351
|
}, be = function(e) {
|
|
352
|
-
return Math.min(Math.max(e,
|
|
352
|
+
return Math.min(Math.max(e, Dt), Ut);
|
|
353
353
|
}, te = function(e, a, i) {
|
|
354
354
|
try {
|
|
355
355
|
typeof a == "function" && a.call(e, i);
|
|
356
356
|
} catch (n) {
|
|
357
|
-
|
|
357
|
+
Qe(n);
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
360
|
function U(e, a) {
|
|
361
|
-
ie.call(this), a = a || {}, this.onopen = void 0, this.onmessage = void 0, this.onerror = void 0, this.url = void 0, this.readyState = void 0, this.withCredentials = void 0, this.headers = void 0, this._close = void 0,
|
|
361
|
+
ie.call(this), a = a || {}, this.onopen = void 0, this.onmessage = void 0, this.onerror = void 0, this.url = void 0, this.readyState = void 0, this.withCredentials = void 0, this.headers = void 0, this._close = void 0, Qt(this, e, a);
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
return
|
|
363
|
+
function qt() {
|
|
364
|
+
return l != null && "withCredentials" in l.prototype || g == null ? new l() : new g();
|
|
365
365
|
}
|
|
366
|
-
var
|
|
367
|
-
function
|
|
366
|
+
var Gt = Q != null && M != null && "body" in M.prototype;
|
|
367
|
+
function Qt(e, a, i) {
|
|
368
368
|
a = String(a);
|
|
369
|
-
var n = !!i.withCredentials,
|
|
370
|
-
if (q === W) if (A === 200 && R != null &&
|
|
371
|
-
q = ee, m = Date.now(),
|
|
369
|
+
var n = !!i.withCredentials, d = i.lastEventIdQueryParameterName || "lastEventId", u = be(1e3), v = Se(i.heartbeatTimeout, 45e3), T = "", h = u, m = !1, b = 0, f = i.headers || {}, w = i.Transport, F = Gt && w == null ? void 0 : new X(w != null ? new w() : qt()), ce = w != null && typeof w != "string" ? new w() : F == null ? new Ge() : new Ue(), C = void 0, j = 0, q = ye, re = "", fe = "", B = "", ve = "", I = $, Te = 0, x = 0, Ft = function(A, E, R, L) {
|
|
370
|
+
if (q === W) if (A === 200 && R != null && Nt.test(R)) {
|
|
371
|
+
q = ee, m = Date.now(), h = u, e.readyState = ee;
|
|
372
372
|
var _ = new he("open", {
|
|
373
373
|
status: A,
|
|
374
374
|
statusText: E,
|
|
@@ -384,30 +384,30 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
384
384
|
});
|
|
385
385
|
e.dispatchEvent(_), te(e, e.onerror, _);
|
|
386
386
|
}
|
|
387
|
-
},
|
|
387
|
+
}, Bt = function(A) {
|
|
388
388
|
if (q === ee) {
|
|
389
389
|
for (var E = -1, R = 0; R < A.length; R += 1) {
|
|
390
390
|
var L = A.charCodeAt(R);
|
|
391
391
|
(L === 10 || L === 13) && (E = R);
|
|
392
392
|
}
|
|
393
|
-
var _ = (E !== -1 ?
|
|
394
|
-
|
|
395
|
-
for (var
|
|
396
|
-
var L = _.charCodeAt(
|
|
397
|
-
if (
|
|
398
|
-
else if (
|
|
399
|
-
if (
|
|
400
|
-
|
|
401
|
-
var z = _.slice(Te,
|
|
393
|
+
var _ = (E !== -1 ? ve : "") + A.slice(0, E + 1);
|
|
394
|
+
ve = (E === -1 ? ve : "") + A.slice(E + 1), A !== "" && (m = Date.now(), b += A.length);
|
|
395
|
+
for (var P = 0; P < _.length; P += 1) {
|
|
396
|
+
var L = _.charCodeAt(P);
|
|
397
|
+
if (I === ge && L === 10) I = $;
|
|
398
|
+
else if (I === ge && (I = $), L === 13 || L === 10) {
|
|
399
|
+
if (I !== $) {
|
|
400
|
+
I === me && (x = P + 1);
|
|
401
|
+
var z = _.slice(Te, x - 1), H = _.slice(x + (x < P && _.charCodeAt(x) === 32 ? 1 : 0), P);
|
|
402
402
|
z === "data" ? (re += `
|
|
403
|
-
`, re += H) : z === "id" ? fe = H : z === "event" ? B = H : z === "retry" ? (u = Se(H, u),
|
|
403
|
+
`, re += H) : z === "id" ? fe = H : z === "event" ? B = H : z === "retry" ? (u = Se(H, u), h = u) : z === "heartbeatTimeout" && (v = Se(H, v), j !== 0 && (c(j), j = s(function() {
|
|
404
404
|
ue();
|
|
405
|
-
},
|
|
405
|
+
}, v)));
|
|
406
406
|
}
|
|
407
|
-
if (
|
|
407
|
+
if (I === $) {
|
|
408
408
|
if (re !== "") {
|
|
409
409
|
T = fe, B === "" && (B = "message");
|
|
410
|
-
var ne = new
|
|
410
|
+
var ne = new Fe(B, {
|
|
411
411
|
data: re.slice(1),
|
|
412
412
|
lastEventId: fe
|
|
413
413
|
});
|
|
@@ -415,25 +415,25 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
415
415
|
}
|
|
416
416
|
re = "", B = "";
|
|
417
417
|
}
|
|
418
|
-
|
|
419
|
-
} else
|
|
418
|
+
I = L === 13 ? ge : $;
|
|
419
|
+
} else I === $ && (Te = P, I = me), I === me ? L === 58 && (x = P + 1, I = ze) : I === ze && (I = Mt);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
},
|
|
422
|
+
}, ke = function(A) {
|
|
423
423
|
if (q === ee || q === W) {
|
|
424
424
|
q = ye, j !== 0 && (c(j), j = 0), j = s(function() {
|
|
425
425
|
ue();
|
|
426
|
-
},
|
|
427
|
-
var E = new
|
|
426
|
+
}, h), h = be(Math.min(u * 16, h * 2)), e.readyState = W;
|
|
427
|
+
var E = new Be("error", { error: A });
|
|
428
428
|
e.dispatchEvent(E), te(e, e.onerror, E);
|
|
429
429
|
}
|
|
430
430
|
}, we = function() {
|
|
431
431
|
q = se, C != null && (C.abort(), C = void 0), j !== 0 && (c(j), j = 0), e.readyState = se;
|
|
432
432
|
}, ue = function() {
|
|
433
433
|
if (j = 0, q !== ye) {
|
|
434
|
-
if (!m && C != null)
|
|
434
|
+
if (!m && C != null) ke(new Error("No activity within " + v + " milliseconds. " + (q === W ? "No response received." : b + " chars received.") + " Reconnecting.")), C != null && (C.abort(), C = void 0);
|
|
435
435
|
else {
|
|
436
|
-
var A = Math.max((m || Date.now()) +
|
|
436
|
+
var A = Math.max((m || Date.now()) + v - Date.now(), 1);
|
|
437
437
|
m = !1, j = s(function() {
|
|
438
438
|
ue();
|
|
439
439
|
}, A);
|
|
@@ -442,20 +442,20 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
442
442
|
}
|
|
443
443
|
m = !1, b = 0, j = s(function() {
|
|
444
444
|
ue();
|
|
445
|
-
},
|
|
445
|
+
}, v), q = W, re = "", B = "", fe = T, ve = "", Te = 0, x = 0, I = $;
|
|
446
446
|
var E = a;
|
|
447
447
|
if (a.slice(0, 5) !== "data:" && a.slice(0, 5) !== "blob:" && T !== "") {
|
|
448
448
|
var R = a.indexOf("?");
|
|
449
449
|
E = R === -1 ? a : a.slice(0, R + 1) + a.slice(R + 1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g, function(H, ne) {
|
|
450
|
-
return ne ===
|
|
451
|
-
}), E += (a.indexOf("?") === -1 ? "?" : "&") +
|
|
450
|
+
return ne === d ? "" : H;
|
|
451
|
+
}), E += (a.indexOf("?") === -1 ? "?" : "&") + d + "=" + encodeURIComponent(T);
|
|
452
452
|
}
|
|
453
453
|
var L = e.withCredentials, _ = {};
|
|
454
454
|
_.Accept = "text/event-stream";
|
|
455
|
-
var
|
|
456
|
-
if (
|
|
455
|
+
var P = e.headers;
|
|
456
|
+
if (P != null) for (var z in P) Object.prototype.hasOwnProperty.call(P, z) && (_[z] = P[z]);
|
|
457
457
|
try {
|
|
458
|
-
C = ce.open(F,
|
|
458
|
+
C = ce.open(F, Ft, Bt, ke, E, L, _);
|
|
459
459
|
} catch (H) {
|
|
460
460
|
throw we(), H;
|
|
461
461
|
}
|
|
@@ -465,25 +465,25 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
465
465
|
U.prototype = Object.create(ie.prototype), U.prototype.CONNECTING = W, U.prototype.OPEN = ee, U.prototype.CLOSED = se, U.prototype.close = function() {
|
|
466
466
|
this._close();
|
|
467
467
|
}, U.CONNECTING = W, U.OPEN = ee, U.CLOSED = se, U.prototype.withCredentials = void 0;
|
|
468
|
-
var
|
|
469
|
-
|
|
468
|
+
var He = G;
|
|
469
|
+
l != null && (G == null || !("withCredentials" in G.prototype)) && (He = U), (function(e) {
|
|
470
470
|
if (typeof r == "object" && typeof r.exports == "object") {
|
|
471
471
|
var a = e(t);
|
|
472
472
|
a !== void 0 && (r.exports = a);
|
|
473
473
|
} else typeof define == "function" && define.amd ? define(["exports"], e) : e(o);
|
|
474
474
|
})(function(e) {
|
|
475
|
-
e.EventSourcePolyfill = U, e.NativeEventSource = G, e.EventSource =
|
|
475
|
+
e.EventSourcePolyfill = U, e.NativeEventSource = G, e.EventSource = He;
|
|
476
476
|
});
|
|
477
477
|
})(typeof globalThis > "u" ? typeof window < "u" ? window : typeof self < "u" ? self : t : globalThis);
|
|
478
|
-
})), Ve =
|
|
478
|
+
})), Ve = _e();
|
|
479
479
|
function Ye({ candidates: t, headers: r, createEventSource: o, onMessage: s, onError: c }) {
|
|
480
|
-
const
|
|
481
|
-
let
|
|
480
|
+
const l = t.filter(Boolean);
|
|
481
|
+
let g = !1, S = null;
|
|
482
482
|
const G = () => {
|
|
483
483
|
S?.close(), S = null;
|
|
484
484
|
}, O = (k) => {
|
|
485
|
-
if (
|
|
486
|
-
const Q =
|
|
485
|
+
if (g) return;
|
|
486
|
+
const Q = l[k];
|
|
487
487
|
if (!Q) {
|
|
488
488
|
c?.(new Error("Failed to connect to EventSource through proxy chain"));
|
|
489
489
|
return;
|
|
@@ -491,10 +491,10 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
491
491
|
G();
|
|
492
492
|
const M = o(Q, { headers: r });
|
|
493
493
|
S = M, M.onmessage = (N) => {
|
|
494
|
-
|
|
494
|
+
g || S !== M || s(N);
|
|
495
495
|
}, M.onerror = (N) => {
|
|
496
|
-
if (!(
|
|
497
|
-
if (G(), k + 1 <
|
|
496
|
+
if (!(g || S !== M)) {
|
|
497
|
+
if (G(), k + 1 < l.length) {
|
|
498
498
|
O(k + 1);
|
|
499
499
|
return;
|
|
500
500
|
}
|
|
@@ -503,14 +503,14 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
503
503
|
};
|
|
504
504
|
};
|
|
505
505
|
return O(0), { close() {
|
|
506
|
-
|
|
506
|
+
g = !0, G();
|
|
507
507
|
} };
|
|
508
508
|
}
|
|
509
509
|
var Ke = "https://api.unsplash.com", Ze = "https://api.giphy.com/v1/gifs";
|
|
510
510
|
function oe(t) {
|
|
511
511
|
return { error: t instanceof Error ? t : new Error(String(t)) };
|
|
512
512
|
}
|
|
513
|
-
async function
|
|
513
|
+
async function le(t) {
|
|
514
514
|
if (!t.ok) throw new Error(`Request failed with status ${t.status}`);
|
|
515
515
|
const r = await t.text();
|
|
516
516
|
try {
|
|
@@ -525,14 +525,14 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
525
525
|
results: []
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
|
-
var
|
|
528
|
+
var Oe = p.createApi({
|
|
529
529
|
reducerPath: "imageApi",
|
|
530
530
|
baseQuery: void 0,
|
|
531
531
|
endpoints: (t) => ({
|
|
532
532
|
getImageInfo: t.query({ queryFn: async function(r, o) {
|
|
533
533
|
try {
|
|
534
534
|
const s = o.getState().configSlice?.config?.imageInfoToolUrl || "https://scr.useblocks.io/imageinfo";
|
|
535
|
-
return { data: await
|
|
535
|
+
return { data: await le(await fetch(`${s}?url=${encodeURIComponent(r)}`)) };
|
|
536
536
|
} catch (s) {
|
|
537
537
|
return oe(s);
|
|
538
538
|
}
|
|
@@ -540,21 +540,21 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
540
540
|
getSearchImage: t.query({ queryFn: async function({ query: r, page: o }, s) {
|
|
541
541
|
const c = r.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g, "").replace(/[\s_-]+/g, " ");
|
|
542
542
|
try {
|
|
543
|
-
const
|
|
544
|
-
return S.searchParams.set("client_id", "S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"), S.searchParams.set("lang", "ru"), S.searchParams.set("per_page", "18"), S.searchParams.set("query", c), S.searchParams.set("page", String(o)), r.color !== "" && S.searchParams.set("color", r.color), r.orientation !== "" && S.searchParams.set("orientation", r.orientation), { data: et(await
|
|
545
|
-
config:
|
|
546
|
-
standalone:
|
|
543
|
+
const l = s.getState().configSlice?.config, g = p.di.getInstance(s, p.SECURITY_MODULE_ID) !== void 0, S = new URL(`${Ke}/search/photos`);
|
|
544
|
+
return S.searchParams.set("client_id", "S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"), S.searchParams.set("lang", "ru"), S.searchParams.set("per_page", "18"), S.searchParams.set("query", c), S.searchParams.set("page", String(o)), r.color !== "" && S.searchParams.set("color", r.color), r.orientation !== "" && S.searchParams.set("orientation", r.orientation), { data: et(await le(await p.fetchWithResourceProxy(S.toString(), {
|
|
545
|
+
config: l,
|
|
546
|
+
standalone: g,
|
|
547
547
|
resourceType: "stockImages",
|
|
548
548
|
intent: "metadata"
|
|
549
549
|
}))) };
|
|
550
|
-
} catch (
|
|
551
|
-
return oe(
|
|
550
|
+
} catch (l) {
|
|
551
|
+
return oe(l);
|
|
552
552
|
}
|
|
553
553
|
} }),
|
|
554
554
|
getUnsplashImage: t.query({ queryFn: async function(r, o) {
|
|
555
555
|
try {
|
|
556
|
-
const s = o.getState().configSlice?.config, c =
|
|
557
|
-
return
|
|
556
|
+
const s = o.getState().configSlice?.config, c = p.di.getInstance(o, p.SECURITY_MODULE_ID) !== void 0, l = new URL(r);
|
|
557
|
+
return l.searchParams.set("client_id", "S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o"), { data: await le(await p.fetchWithResourceProxy(l.toString(), {
|
|
558
558
|
config: s,
|
|
559
559
|
standalone: c,
|
|
560
560
|
resourceType: "stockImages",
|
|
@@ -566,14 +566,14 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
566
566
|
} }),
|
|
567
567
|
sendAiImageRequest: t.query({ queryFn: async function({ body: r }, o) {
|
|
568
568
|
try {
|
|
569
|
-
return await
|
|
569
|
+
return await p.getClient(o).aiGenerator.ai_create(r);
|
|
570
570
|
} catch (s) {
|
|
571
571
|
throw new Error(s);
|
|
572
572
|
}
|
|
573
573
|
} }),
|
|
574
574
|
getAiImage: t.query({ queryFn: async function(r, o) {
|
|
575
575
|
try {
|
|
576
|
-
return await
|
|
576
|
+
return await p.getClient(o).aiGenerator.ai_status_list(r);
|
|
577
577
|
} catch (s) {
|
|
578
578
|
return oe(s);
|
|
579
579
|
}
|
|
@@ -581,7 +581,7 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
581
581
|
getAiImageSSE: t.query({
|
|
582
582
|
queryFn: (r) => ({ data: [] }),
|
|
583
583
|
async onCacheEntryAdded({ task_id: r, entity_id: o, setError: s }, c) {
|
|
584
|
-
const { updateCachedData:
|
|
584
|
+
const { updateCachedData: l, cacheEntryRemoved: g } = c, S = p.getClient(c).baseUrl || p.normalizeBaseUrl("https://app.useblocks.io/api"), G = c.getState().configSlice?.config, O = p.di.getInstance(c, p.SECURITY_MODULE_ID) !== void 0, k = p.PLUGIN.isPlugin ? await p.di.getInstance(c, ae) : p.api.get(p.APP_COOKIES.em_token), Q = k ? { Authorization: `Bearer ${k}` } : {}, M = `${S}/ai-generator/v1/ai-status?entity_id=${o}&stream=1&task_id=${r}`, N = p.resolveBackendProxyRequestCandidates(M, {
|
|
585
585
|
config: G,
|
|
586
586
|
method: "GET",
|
|
587
587
|
requestType: "ai",
|
|
@@ -589,38 +589,38 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
589
589
|
}), Y = Ye({
|
|
590
590
|
candidates: N.length > 0 ? N : [M],
|
|
591
591
|
headers: Q,
|
|
592
|
-
createEventSource: (
|
|
593
|
-
onMessage: (
|
|
594
|
-
const K = JSON.parse(
|
|
595
|
-
|
|
596
|
-
|
|
592
|
+
createEventSource: (J, K) => new Ve.EventSourcePolyfill(J, K),
|
|
593
|
+
onMessage: (J) => {
|
|
594
|
+
const K = JSON.parse(J.data);
|
|
595
|
+
l((de) => {
|
|
596
|
+
de.push(K);
|
|
597
597
|
}), K.progress === 100 && Y.close();
|
|
598
598
|
},
|
|
599
599
|
onError: () => {
|
|
600
600
|
Y.close();
|
|
601
601
|
}
|
|
602
602
|
});
|
|
603
|
-
await
|
|
603
|
+
await g, Y.close();
|
|
604
604
|
}
|
|
605
605
|
}),
|
|
606
606
|
getSearchGif: t.query({ queryFn: async function({ query: r, page: o }, s) {
|
|
607
607
|
const c = r.keywords.replace(/[^\w\d\sа-яёА-ЯЁ]|_/g, "").replace(/[\s_-]+/g, " ");
|
|
608
608
|
try {
|
|
609
|
-
const
|
|
610
|
-
return { data: await
|
|
611
|
-
config:
|
|
612
|
-
standalone:
|
|
609
|
+
const l = s.getState().configSlice?.config, g = p.di.getInstance(s, p.SECURITY_MODULE_ID) !== void 0;
|
|
610
|
+
return { data: await le(await p.fetchWithResourceProxy(`${Ze}/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${encodeURIComponent(c)}&limit=25&offset=${o}&lang=en`, {
|
|
611
|
+
config: l,
|
|
612
|
+
standalone: g,
|
|
613
613
|
resourceType: "generic",
|
|
614
614
|
intent: "metadata"
|
|
615
615
|
})) };
|
|
616
|
-
} catch (
|
|
617
|
-
return oe(
|
|
616
|
+
} catch (l) {
|
|
617
|
+
return oe(l);
|
|
618
618
|
}
|
|
619
619
|
} })
|
|
620
620
|
})
|
|
621
|
-
}), { useLazyGetImageInfoQuery: tt, useGetImageInfoQuery:
|
|
621
|
+
}), { useLazyGetImageInfoQuery: tt, useGetImageInfoQuery: Ht, useGetSearchImageQuery: kt, useLazyGetSearchImageQuery: rt, useSendAiImageRequestQuery: Wt, useLazySendAiImageRequestQuery: nt, useGetAiImageQuery: $t, useLazyGetAiImageQuery: Jt, useGetUnsplashImageQuery: Xt, useLazyGetUnsplashImageQuery: at, useGetSearchGifQuery: xt, useLazyGetSearchGifQuery: ot, useGetAiImageSSEQuery: Vt, useLazyGetAiImageSSEQuery: it } = Oe, st = "https://app.useblocks.io/api".replaceAll(/[\\/]$/g, ""), pe = "wp-json/limits/v1", ct = "wp-json/subscription/v2", Ce = p.createApi({
|
|
622
622
|
reducerPath: "limitsApi",
|
|
623
|
-
baseQuery:
|
|
623
|
+
baseQuery: p.fetchBaseQueryApp({ baseUrl: st }),
|
|
624
624
|
tagTypes: [
|
|
625
625
|
"LimitsStats",
|
|
626
626
|
"LimitsWarnings",
|
|
@@ -629,14 +629,14 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
629
629
|
endpoints: (t) => ({
|
|
630
630
|
getLimitsStats: t.query({
|
|
631
631
|
query: () => ({
|
|
632
|
-
url: `${
|
|
632
|
+
url: `${pe}/stats`,
|
|
633
633
|
method: "GET"
|
|
634
634
|
}),
|
|
635
635
|
providesTags: ["LimitsStats"]
|
|
636
636
|
}),
|
|
637
637
|
getLimitsStatsByType: t.query({
|
|
638
638
|
query: (r) => ({
|
|
639
|
-
url: `${
|
|
639
|
+
url: `${pe}/stats/${r}`,
|
|
640
640
|
method: "GET"
|
|
641
641
|
}),
|
|
642
642
|
providesTags: (r, o, s) => [{
|
|
@@ -646,7 +646,7 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
646
646
|
}),
|
|
647
647
|
getLimitsWarnings: t.query({
|
|
648
648
|
query: () => ({
|
|
649
|
-
url: `${
|
|
649
|
+
url: `${pe}/warnings`,
|
|
650
650
|
method: "GET"
|
|
651
651
|
}),
|
|
652
652
|
providesTags: ["LimitsWarnings"]
|
|
@@ -657,21 +657,22 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
657
657
|
method: "GET"
|
|
658
658
|
}),
|
|
659
659
|
providesTags: ["SubscriptionMe"]
|
|
660
|
-
})
|
|
660
|
+
}),
|
|
661
|
+
invalidatePlanCache: t.mutation({ queryFn: async (r, o) => p.v2ResultOf(await p.getClientV2(o).billing.planInvalidateCreate()) })
|
|
661
662
|
})
|
|
662
|
-
}), { useGetLimitsStatsQuery: ut, useLazyGetLimitsStatsQuery:
|
|
663
|
+
}), { useGetLimitsStatsQuery: ut, useLazyGetLimitsStatsQuery: Yt, useGetLimitsStatsByTypeQuery: Kt, useLazyGetLimitsStatsByTypeQuery: lt, useGetLimitsWarningsQuery: dt, useLazyGetLimitsWarningsQuery: Zt, useGetSubscriptionMeV2Query: er, useLazyGetSubscriptionMeV2Query: tr, useInvalidatePlanCacheMutation: ft } = Ce, je = new URLSearchParams(window.location.search), Re = je.get("tag"), vt = je.get("folder"), pt = p.createState({
|
|
663
664
|
activeModal: "",
|
|
664
665
|
switchToPlanRequestTitle: "",
|
|
665
666
|
secondModal: "",
|
|
666
667
|
projectsTotal: "",
|
|
667
668
|
projectsTotalPages: "",
|
|
668
669
|
folders: [],
|
|
669
|
-
activeTagId:
|
|
670
|
-
activeFolderId:
|
|
670
|
+
activeTagId: Re || null,
|
|
671
|
+
activeFolderId: vt || (Re ? null : "all"),
|
|
671
672
|
activeTab: null,
|
|
672
673
|
activeIntegration: null,
|
|
673
674
|
addNewProjectInitialTitle: null
|
|
674
|
-
}), V = "projectsPageSlice",
|
|
675
|
+
}), V = "projectsPageSlice", Le = p.createSlice({
|
|
675
676
|
name: V,
|
|
676
677
|
initialState: pt,
|
|
677
678
|
reducers: {
|
|
@@ -679,7 +680,7 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
679
680
|
t.activeModal = r.payload;
|
|
680
681
|
},
|
|
681
682
|
openAddNewProjectModal(t, r) {
|
|
682
|
-
t.activeModal =
|
|
683
|
+
t.activeModal = p.MODALS.ADD_NEW_PROJECT_MODAL, t.addNewProjectInitialTitle = r.payload ?? null;
|
|
683
684
|
},
|
|
684
685
|
setSwitchToPlanRequestTitle(t, r) {
|
|
685
686
|
t.switchToPlanRequestTitle = typeof r.payload == "string" ? r.payload : "";
|
|
@@ -707,21 +708,21 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
707
708
|
}
|
|
708
709
|
},
|
|
709
710
|
extraReducers: (t) => {
|
|
710
|
-
t.addMatcher(
|
|
711
|
-
const s = o.meta, c = s.baseQueryMeta,
|
|
712
|
-
if (
|
|
713
|
-
r.projectsTotal = String(
|
|
711
|
+
t.addMatcher(p.projectsApi.endpoints.getProjects.matchFulfilled, (r, o) => {
|
|
712
|
+
const s = o.meta, c = s.baseQueryMeta, l = s.projectsListPagination ?? c?.projectsListPagination;
|
|
713
|
+
if (l != null && typeof l.total == "number" && Number.isFinite(l.total) && l.total >= 0) {
|
|
714
|
+
r.projectsTotal = String(l.total), r.projectsTotalPages = String(typeof l.totalPages == "number" && Number.isFinite(l.totalPages) ? l.totalPages : "");
|
|
714
715
|
return;
|
|
715
716
|
}
|
|
716
|
-
const
|
|
717
|
-
r.projectsTotal =
|
|
718
|
-
}), t.addMatcher(
|
|
717
|
+
const g = c?.response?.headers?.get?.("X-WP-Total"), S = c?.response?.headers?.get?.("X-WP-TotalPages");
|
|
718
|
+
r.projectsTotal = g ?? "", r.projectsTotalPages = S ?? "";
|
|
719
|
+
}), t.addMatcher(p.taxonomiesApi.endpoints.getTerms.matchFulfilled, (r, { meta: o, payload: s }) => {
|
|
719
720
|
const c = o.arg.originalArgs?.kind;
|
|
720
721
|
(c === "folder" || c === "blockfolder") && (r.folders = s);
|
|
721
722
|
});
|
|
722
723
|
}
|
|
723
|
-
}), { openModal:
|
|
724
|
-
function
|
|
724
|
+
}), { openModal: ht, openAddNewProjectModal: rr, setSwitchToPlanRequestTitle: yt, setActiveTab: gt, closeModal: mt, openSecondModal: St, closeSecondModal: bt, setFolders: nr, setActiveTagId: ar, setActiveIntegration: or } = Le.actions, Tt = (t) => t[V].activeTab, wt = (t) => t[V].activeModal, Et = (t) => t[V].secondModal, At = (t) => t[V].projectsTotal, Pt = (t) => t[V].activeIntegration, It = 3, _t = /^(.+\.[a-zA-Z0-9]{1,8})\?[^?#]*$/;
|
|
725
|
+
function Ot(t) {
|
|
725
726
|
let r = t;
|
|
726
727
|
for (let o = 0; o < It; o++) try {
|
|
727
728
|
const s = decodeURIComponent(r);
|
|
@@ -732,29 +733,29 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
732
733
|
}
|
|
733
734
|
return r.normalize("NFC");
|
|
734
735
|
}
|
|
735
|
-
function
|
|
736
|
-
const r = t.match(
|
|
736
|
+
function Ct(t) {
|
|
737
|
+
const r = t.match(_t);
|
|
737
738
|
return r ? r[1] : t;
|
|
738
739
|
}
|
|
739
|
-
function
|
|
740
|
+
function jt(t) {
|
|
740
741
|
if (/^https?:\/\//i.test(t)) return new URL(t).pathname.split("/").filter(Boolean).pop();
|
|
741
742
|
if (t.startsWith("//")) return new URL(t, "https://placeholder.invalid").pathname.split("/").filter(Boolean).pop();
|
|
742
743
|
}
|
|
743
|
-
function
|
|
744
|
+
function Me(t) {
|
|
744
745
|
const r = t.replaceAll("\\", "/").trim();
|
|
745
746
|
if (!r) return r;
|
|
746
747
|
let o;
|
|
747
748
|
try {
|
|
748
|
-
o =
|
|
749
|
+
o = jt(r);
|
|
749
750
|
} catch {}
|
|
750
751
|
if (!o) {
|
|
751
|
-
o =
|
|
752
|
+
o = Ct(r.split("/").pop() ?? "");
|
|
752
753
|
const s = o.indexOf("#");
|
|
753
754
|
s >= 0 && (o = o.slice(0, s));
|
|
754
755
|
}
|
|
755
|
-
return
|
|
756
|
+
return Ot(o);
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
+
function Rt(t) {
|
|
758
759
|
const r = t.trim();
|
|
759
760
|
if (r) {
|
|
760
761
|
if (!(/^https?:\/\//i.test(r) || r.startsWith("//"))) try {
|
|
@@ -762,160 +763,170 @@ __useblocks__.define("static/core/5318562c.js", [
|
|
|
762
763
|
} catch {
|
|
763
764
|
return;
|
|
764
765
|
}
|
|
765
|
-
return
|
|
766
|
+
return Me(r) || void 0;
|
|
766
767
|
}
|
|
767
768
|
}
|
|
768
|
-
Object.defineProperty(
|
|
769
|
+
Object.defineProperty(y, "OAuthMixin", {
|
|
769
770
|
enumerable: !0,
|
|
770
771
|
get: function() {
|
|
771
|
-
return
|
|
772
|
+
return xe;
|
|
772
773
|
}
|
|
773
|
-
}), Object.defineProperty(
|
|
774
|
+
}), Object.defineProperty(y, "TOKEN_ID", {
|
|
774
775
|
enumerable: !0,
|
|
775
776
|
get: function() {
|
|
776
777
|
return ae;
|
|
777
778
|
}
|
|
778
|
-
}), Object.defineProperty(
|
|
779
|
+
}), Object.defineProperty(y, "closeModal", {
|
|
779
780
|
enumerable: !0,
|
|
780
781
|
get: function() {
|
|
781
|
-
return
|
|
782
|
+
return mt;
|
|
782
783
|
}
|
|
783
|
-
}), Object.defineProperty(
|
|
784
|
+
}), Object.defineProperty(y, "closeSecondModal", {
|
|
784
785
|
enumerable: !0,
|
|
785
786
|
get: function() {
|
|
786
|
-
return
|
|
787
|
+
return bt;
|
|
787
788
|
}
|
|
788
|
-
}), Object.defineProperty(
|
|
789
|
+
}), Object.defineProperty(y, "combineMixins", {
|
|
789
790
|
enumerable: !0,
|
|
790
791
|
get: function() {
|
|
791
|
-
return
|
|
792
|
+
return $e;
|
|
792
793
|
}
|
|
793
|
-
}), Object.defineProperty(
|
|
794
|
+
}), Object.defineProperty(y, "decodeFileNameFromPath", {
|
|
794
795
|
enumerable: !0,
|
|
795
796
|
get: function() {
|
|
796
|
-
return
|
|
797
|
+
return Me;
|
|
797
798
|
}
|
|
798
|
-
}), Object.defineProperty(
|
|
799
|
+
}), Object.defineProperty(y, "decodeFileNameFromUrl", {
|
|
799
800
|
enumerable: !0,
|
|
800
801
|
get: function() {
|
|
801
|
-
return
|
|
802
|
+
return Rt;
|
|
802
803
|
}
|
|
803
|
-
}), Object.defineProperty(
|
|
804
|
+
}), Object.defineProperty(y, "decodeJwt", {
|
|
804
805
|
enumerable: !0,
|
|
805
806
|
get: function() {
|
|
806
|
-
return
|
|
807
|
+
return Pe;
|
|
807
808
|
}
|
|
808
|
-
}), Object.defineProperty(
|
|
809
|
+
}), Object.defineProperty(y, "defineMixin", {
|
|
809
810
|
enumerable: !0,
|
|
810
811
|
get: function() {
|
|
811
812
|
return Ae;
|
|
812
813
|
}
|
|
813
|
-
}), Object.defineProperty(
|
|
814
|
+
}), Object.defineProperty(y, "imageApi", {
|
|
814
815
|
enumerable: !0,
|
|
815
816
|
get: function() {
|
|
816
|
-
return
|
|
817
|
+
return Oe;
|
|
817
818
|
}
|
|
818
|
-
}), Object.defineProperty(
|
|
819
|
+
}), Object.defineProperty(y, "limitsApi", {
|
|
819
820
|
enumerable: !0,
|
|
820
821
|
get: function() {
|
|
821
|
-
return
|
|
822
|
+
return Ce;
|
|
822
823
|
}
|
|
823
|
-
}), Object.defineProperty(
|
|
824
|
+
}), Object.defineProperty(y, "openModal", {
|
|
824
825
|
enumerable: !0,
|
|
825
826
|
get: function() {
|
|
826
|
-
return
|
|
827
|
+
return ht;
|
|
827
828
|
}
|
|
828
|
-
}), Object.defineProperty(
|
|
829
|
+
}), Object.defineProperty(y, "openSecondModal", {
|
|
829
830
|
enumerable: !0,
|
|
830
831
|
get: function() {
|
|
831
|
-
return
|
|
832
|
+
return St;
|
|
832
833
|
}
|
|
833
|
-
}), Object.defineProperty(
|
|
834
|
+
}), Object.defineProperty(y, "projectsPageSlice", {
|
|
834
835
|
enumerable: !0,
|
|
835
836
|
get: function() {
|
|
836
|
-
return
|
|
837
|
+
return Le;
|
|
837
838
|
}
|
|
838
|
-
}), Object.defineProperty(
|
|
839
|
+
}), Object.defineProperty(y, "recreateTokenProvider", {
|
|
839
840
|
enumerable: !0,
|
|
840
841
|
get: function() {
|
|
841
|
-
return
|
|
842
|
+
return Ie;
|
|
842
843
|
}
|
|
843
|
-
}), Object.defineProperty(
|
|
844
|
+
}), Object.defineProperty(y, "require_eventsource", {
|
|
844
845
|
enumerable: !0,
|
|
845
846
|
get: function() {
|
|
846
|
-
return
|
|
847
|
+
return _e;
|
|
847
848
|
}
|
|
848
|
-
}), Object.defineProperty(
|
|
849
|
+
}), Object.defineProperty(y, "selectActiveIntegration", {
|
|
850
|
+
enumerable: !0,
|
|
851
|
+
get: function() {
|
|
852
|
+
return Pt;
|
|
853
|
+
}
|
|
854
|
+
}), Object.defineProperty(y, "selectActiveModal", {
|
|
855
|
+
enumerable: !0,
|
|
856
|
+
get: function() {
|
|
857
|
+
return wt;
|
|
858
|
+
}
|
|
859
|
+
}), Object.defineProperty(y, "selectActiveTab", {
|
|
849
860
|
enumerable: !0,
|
|
850
861
|
get: function() {
|
|
851
862
|
return Tt;
|
|
852
863
|
}
|
|
853
|
-
}), Object.defineProperty(
|
|
864
|
+
}), Object.defineProperty(y, "selectProjectsTotal", {
|
|
854
865
|
enumerable: !0,
|
|
855
866
|
get: function() {
|
|
856
|
-
return
|
|
867
|
+
return At;
|
|
857
868
|
}
|
|
858
|
-
}), Object.defineProperty(
|
|
869
|
+
}), Object.defineProperty(y, "selectSecondModal", {
|
|
859
870
|
enumerable: !0,
|
|
860
871
|
get: function() {
|
|
861
872
|
return Et;
|
|
862
873
|
}
|
|
863
|
-
}), Object.defineProperty(
|
|
874
|
+
}), Object.defineProperty(y, "setActiveTab", {
|
|
864
875
|
enumerable: !0,
|
|
865
876
|
get: function() {
|
|
866
|
-
return
|
|
877
|
+
return gt;
|
|
867
878
|
}
|
|
868
|
-
}), Object.defineProperty(
|
|
879
|
+
}), Object.defineProperty(y, "setSwitchToPlanRequestTitle", {
|
|
869
880
|
enumerable: !0,
|
|
870
881
|
get: function() {
|
|
871
882
|
return yt;
|
|
872
883
|
}
|
|
873
|
-
}), Object.defineProperty(
|
|
884
|
+
}), Object.defineProperty(y, "useGetLimitsStatsQuery", {
|
|
874
885
|
enumerable: !0,
|
|
875
886
|
get: function() {
|
|
876
|
-
return
|
|
887
|
+
return ut;
|
|
877
888
|
}
|
|
878
|
-
}), Object.defineProperty(
|
|
889
|
+
}), Object.defineProperty(y, "useGetLimitsWarningsQuery", {
|
|
879
890
|
enumerable: !0,
|
|
880
891
|
get: function() {
|
|
881
|
-
return
|
|
892
|
+
return dt;
|
|
882
893
|
}
|
|
883
|
-
}), Object.defineProperty(
|
|
894
|
+
}), Object.defineProperty(y, "useInvalidatePlanCacheMutation", {
|
|
884
895
|
enumerable: !0,
|
|
885
896
|
get: function() {
|
|
886
|
-
return
|
|
897
|
+
return ft;
|
|
887
898
|
}
|
|
888
|
-
}), Object.defineProperty(
|
|
899
|
+
}), Object.defineProperty(y, "useLazyGetAiImageSSEQuery", {
|
|
889
900
|
enumerable: !0,
|
|
890
901
|
get: function() {
|
|
891
902
|
return it;
|
|
892
903
|
}
|
|
893
|
-
}), Object.defineProperty(
|
|
904
|
+
}), Object.defineProperty(y, "useLazyGetImageInfoQuery", {
|
|
894
905
|
enumerable: !0,
|
|
895
906
|
get: function() {
|
|
896
907
|
return tt;
|
|
897
908
|
}
|
|
898
|
-
}), Object.defineProperty(
|
|
909
|
+
}), Object.defineProperty(y, "useLazyGetLimitsStatsByTypeQuery", {
|
|
899
910
|
enumerable: !0,
|
|
900
911
|
get: function() {
|
|
901
|
-
return
|
|
912
|
+
return lt;
|
|
902
913
|
}
|
|
903
|
-
}), Object.defineProperty(
|
|
914
|
+
}), Object.defineProperty(y, "useLazyGetSearchGifQuery", {
|
|
904
915
|
enumerable: !0,
|
|
905
916
|
get: function() {
|
|
906
917
|
return ot;
|
|
907
918
|
}
|
|
908
|
-
}), Object.defineProperty(
|
|
919
|
+
}), Object.defineProperty(y, "useLazyGetSearchImageQuery", {
|
|
909
920
|
enumerable: !0,
|
|
910
921
|
get: function() {
|
|
911
922
|
return rt;
|
|
912
923
|
}
|
|
913
|
-
}), Object.defineProperty(
|
|
924
|
+
}), Object.defineProperty(y, "useLazyGetUnsplashImageQuery", {
|
|
914
925
|
enumerable: !0,
|
|
915
926
|
get: function() {
|
|
916
927
|
return at;
|
|
917
928
|
}
|
|
918
|
-
}), Object.defineProperty(
|
|
929
|
+
}), Object.defineProperty(y, "useLazySendAiImageRequestQuery", {
|
|
919
930
|
enumerable: !0,
|
|
920
931
|
get: function() {
|
|
921
932
|
return nt;
|