mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 20:15:26 +00:00
widget 0.2.0
This commit is contained in:
1 parent
816c7c95ed
commit
c2c18b25d2
8 files changed
+241
-226
No files matched your search
@@ -20,6 +20,17 @@ npm install docsgpt
|
||||
};
|
||||
```
|
||||
|
||||
To link the widget to your api and your documents you can pass parameters to the <DocsGPTWidget /> component.
|
||||
|
||||
```javascript
|
||||
import { DocsGPTWidget } from "docsgpt";
|
||||
import "docsgpt/dist/style.css";
|
||||
|
||||
const App = () => {
|
||||
return <DocsGPTWidget apiHost="http://localhost:7001" selectDocs='default' apiKey=''/>;
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
## Our github
|
||||
|
||||
|
||||
+209
-208
@@ -1,5 +1,5 @@
|
||||
import Ce, { useState as Se, useRef as lr, useEffect as ur } from "react";
|
||||
var ne = { exports: {} }, W = {};
|
||||
var ne = { exports: {} }, Y = {};
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
@@ -12,22 +12,22 @@ var ne = { exports: {} }, W = {};
|
||||
var Pe;
|
||||
function cr() {
|
||||
if (Pe)
|
||||
return W;
|
||||
return Y;
|
||||
Pe = 1;
|
||||
var h = Ce, g = Symbol.for("react.element"), j = Symbol.for("react.fragment"), _ = Object.prototype.hasOwnProperty, P = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 };
|
||||
function R(b, l, w) {
|
||||
var v, p = {}, c = null, E = null;
|
||||
w !== void 0 && (c = "" + w), l.key !== void 0 && (c = "" + l.key), l.ref !== void 0 && (E = l.ref);
|
||||
for (v in l)
|
||||
_.call(l, v) && !O.hasOwnProperty(v) && (p[v] = l[v]);
|
||||
var D = Ce, w = Symbol.for("react.element"), O = Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, E = D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
||||
function T(b, d, v) {
|
||||
var m, h = {}, x = null, p = null;
|
||||
v !== void 0 && (x = "" + v), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (p = d.ref);
|
||||
for (m in d)
|
||||
f.call(d, m) && !j.hasOwnProperty(m) && (h[m] = d[m]);
|
||||
if (b && b.defaultProps)
|
||||
for (v in l = b.defaultProps, l)
|
||||
p[v] === void 0 && (p[v] = l[v]);
|
||||
return { $$typeof: g, type: b, key: c, ref: E, props: p, _owner: P.current };
|
||||
for (m in d = b.defaultProps, d)
|
||||
h[m] === void 0 && (h[m] = d[m]);
|
||||
return { $$typeof: w, type: b, key: x, ref: p, props: h, _owner: E.current };
|
||||
}
|
||||
return W.Fragment = j, W.jsx = R, W.jsxs = R, W;
|
||||
return Y.Fragment = O, Y.jsx = T, Y.jsxs = T, Y;
|
||||
}
|
||||
var Y = {};
|
||||
var L = {};
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.development.js
|
||||
@@ -40,15 +40,15 @@ var Y = {};
|
||||
var Oe;
|
||||
function fr() {
|
||||
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && function() {
|
||||
var h = Ce, g = Symbol.for("react.element"), j = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), b = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), T = Symbol.iterator, L = "@@iterator";
|
||||
var D = Ce, w = Symbol.for("react.element"), O = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), b = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), R = Symbol.iterator, k = "@@iterator";
|
||||
function J(e) {
|
||||
if (e === null || typeof e != "object")
|
||||
return null;
|
||||
var r = T && e[T] || e[L];
|
||||
var r = R && e[R] || e[k];
|
||||
return typeof r == "function" ? r : null;
|
||||
}
|
||||
var C = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
function m(e) {
|
||||
var C = D.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
function g(e) {
|
||||
{
|
||||
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
||||
t[n - 1] = arguments[n];
|
||||
@@ -65,10 +65,10 @@ function fr() {
|
||||
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
||||
}
|
||||
}
|
||||
var D = !1, z = !1, De = !1, Ne = !1, Ae = !1, ae;
|
||||
var N = !1, z = !1, De = !1, Ne = !1, Ae = !1, ae;
|
||||
ae = Symbol.for("react.module.reference");
|
||||
function Fe(e) {
|
||||
return !!(typeof e == "string" || typeof e == "function" || e === _ || e === O || Ae || e === P || e === w || e === v || Ne || e === E || D || z || De || typeof e == "object" && e !== null && (e.$$typeof === c || e.$$typeof === p || e.$$typeof === R || e.$$typeof === b || e.$$typeof === l || // This needs to include all possible module reference object
|
||||
return !!(typeof e == "string" || typeof e == "function" || e === f || e === j || Ae || e === E || e === v || e === m || Ne || e === p || N || z || De || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === h || e.$$typeof === T || e.$$typeof === b || e.$$typeof === d || // This needs to include all possible module reference object
|
||||
// types supported by any Flight configuration anywhere since
|
||||
// we don't know which Flight build this will end up being used
|
||||
// with.
|
||||
@@ -84,25 +84,25 @@ function fr() {
|
||||
function ie(e) {
|
||||
return e.displayName || "Context";
|
||||
}
|
||||
function k(e) {
|
||||
function S(e) {
|
||||
if (e == null)
|
||||
return null;
|
||||
if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
||||
if (typeof e.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
||||
return e.displayName || e.name || null;
|
||||
if (typeof e == "string")
|
||||
return e;
|
||||
switch (e) {
|
||||
case _:
|
||||
case f:
|
||||
return "Fragment";
|
||||
case j:
|
||||
return "Portal";
|
||||
case O:
|
||||
return "Portal";
|
||||
case j:
|
||||
return "Profiler";
|
||||
case P:
|
||||
case E:
|
||||
return "StrictMode";
|
||||
case w:
|
||||
return "Suspense";
|
||||
case v:
|
||||
return "Suspense";
|
||||
case m:
|
||||
return "SuspenseList";
|
||||
}
|
||||
if (typeof e == "object")
|
||||
@@ -110,18 +110,18 @@ function fr() {
|
||||
case b:
|
||||
var r = e;
|
||||
return ie(r) + ".Consumer";
|
||||
case R:
|
||||
case T:
|
||||
var t = e;
|
||||
return ie(t._context) + ".Provider";
|
||||
case l:
|
||||
case d:
|
||||
return $e(e, e.render, "ForwardRef");
|
||||
case p:
|
||||
case h:
|
||||
var n = e.displayName || null;
|
||||
return n !== null ? n : k(e.type) || "Memo";
|
||||
case c: {
|
||||
return n !== null ? n : S(e.type) || "Memo";
|
||||
case x: {
|
||||
var o = e, s = o._payload, i = o._init;
|
||||
try {
|
||||
return k(i(s));
|
||||
return S(i(s));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
@@ -129,13 +129,13 @@ function fr() {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var N = Object.assign, $ = 0, oe, se, le, ue, ce, fe, de;
|
||||
var A = Object.assign, I = 0, oe, se, le, ue, ce, fe, de;
|
||||
function ve() {
|
||||
}
|
||||
ve.__reactDisabledLog = !0;
|
||||
function Ie() {
|
||||
{
|
||||
if ($ === 0) {
|
||||
if (I === 0) {
|
||||
oe = console.log, se = console.info, le = console.warn, ue = console.error, ce = console.group, fe = console.groupCollapsed, de = console.groupEnd;
|
||||
var e = {
|
||||
configurable: !0,
|
||||
@@ -153,42 +153,42 @@ function fr() {
|
||||
groupEnd: e
|
||||
});
|
||||
}
|
||||
$++;
|
||||
I++;
|
||||
}
|
||||
}
|
||||
function We() {
|
||||
{
|
||||
if ($--, $ === 0) {
|
||||
if (I--, I === 0) {
|
||||
var e = {
|
||||
configurable: !0,
|
||||
enumerable: !0,
|
||||
writable: !0
|
||||
};
|
||||
Object.defineProperties(console, {
|
||||
log: N({}, e, {
|
||||
log: A({}, e, {
|
||||
value: oe
|
||||
}),
|
||||
info: N({}, e, {
|
||||
info: A({}, e, {
|
||||
value: se
|
||||
}),
|
||||
warn: N({}, e, {
|
||||
warn: A({}, e, {
|
||||
value: le
|
||||
}),
|
||||
error: N({}, e, {
|
||||
error: A({}, e, {
|
||||
value: ue
|
||||
}),
|
||||
group: N({}, e, {
|
||||
group: A({}, e, {
|
||||
value: ce
|
||||
}),
|
||||
groupCollapsed: N({}, e, {
|
||||
groupCollapsed: A({}, e, {
|
||||
value: fe
|
||||
}),
|
||||
groupEnd: N({}, e, {
|
||||
groupEnd: A({}, e, {
|
||||
value: de
|
||||
})
|
||||
});
|
||||
}
|
||||
$ < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
||||
I < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
||||
}
|
||||
}
|
||||
var H = C.ReactCurrentDispatcher, K;
|
||||
@@ -236,49 +236,49 @@ function fr() {
|
||||
}), typeof Reflect == "object" && Reflect.construct) {
|
||||
try {
|
||||
Reflect.construct(i, []);
|
||||
} catch (S) {
|
||||
n = S;
|
||||
} catch (P) {
|
||||
n = P;
|
||||
}
|
||||
Reflect.construct(e, [], i);
|
||||
} else {
|
||||
try {
|
||||
i.call();
|
||||
} catch (S) {
|
||||
n = S;
|
||||
} catch (P) {
|
||||
n = P;
|
||||
}
|
||||
e.call(i.prototype);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
throw Error();
|
||||
} catch (S) {
|
||||
n = S;
|
||||
} catch (P) {
|
||||
n = P;
|
||||
}
|
||||
e();
|
||||
}
|
||||
} catch (S) {
|
||||
if (S && n && typeof S.stack == "string") {
|
||||
for (var a = S.stack.split(`
|
||||
} catch (P) {
|
||||
if (P && n && typeof P.stack == "string") {
|
||||
for (var a = P.stack.split(`
|
||||
`), y = n.stack.split(`
|
||||
`), f = a.length - 1, d = y.length - 1; f >= 1 && d >= 0 && a[f] !== y[d]; )
|
||||
d--;
|
||||
for (; f >= 1 && d >= 0; f--, d--)
|
||||
if (a[f] !== y[d]) {
|
||||
if (f !== 1 || d !== 1)
|
||||
`), u = a.length - 1, c = y.length - 1; u >= 1 && c >= 0 && a[u] !== y[c]; )
|
||||
c--;
|
||||
for (; u >= 1 && c >= 0; u--, c--)
|
||||
if (a[u] !== y[c]) {
|
||||
if (u !== 1 || c !== 1)
|
||||
do
|
||||
if (f--, d--, d < 0 || a[f] !== y[d]) {
|
||||
var x = `
|
||||
` + a[f].replace(" at new ", " at ");
|
||||
return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, x), x;
|
||||
if (u--, c--, c < 0 || a[u] !== y[c]) {
|
||||
var _ = `
|
||||
` + a[u].replace(" at new ", " at ");
|
||||
return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, _), _;
|
||||
}
|
||||
while (f >= 1 && d >= 0);
|
||||
while (u >= 1 && c >= 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
X = !1, H.current = s, We(), Error.prepareStackTrace = o;
|
||||
}
|
||||
var F = e ? e.displayName || e.name : "", ke = F ? V(F) : "";
|
||||
var $ = e ? e.displayName || e.name : "", ke = $ ? V($) : "";
|
||||
return typeof e == "function" && M.set(e, ke), ke;
|
||||
}
|
||||
function Le(e, r, t) {
|
||||
@@ -296,18 +296,18 @@ function fr() {
|
||||
if (typeof e == "string")
|
||||
return V(e);
|
||||
switch (e) {
|
||||
case w:
|
||||
return V("Suspense");
|
||||
case v:
|
||||
return V("Suspense");
|
||||
case m:
|
||||
return V("SuspenseList");
|
||||
}
|
||||
if (typeof e == "object")
|
||||
switch (e.$$typeof) {
|
||||
case l:
|
||||
case d:
|
||||
return Le(e.render);
|
||||
case p:
|
||||
case h:
|
||||
return U(e.type, r, t);
|
||||
case c: {
|
||||
case x: {
|
||||
var n = e, o = n._payload, s = n._init;
|
||||
try {
|
||||
return U(s(o), r, t);
|
||||
@@ -337,10 +337,10 @@ function fr() {
|
||||
throw y.name = "Invariant Violation", y;
|
||||
}
|
||||
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
||||
} catch (f) {
|
||||
a = f;
|
||||
} catch (u) {
|
||||
a = u;
|
||||
}
|
||||
a && !(a instanceof Error) && (G(o), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), G(null)), a instanceof Error && !(a.message in he) && (he[a.message] = !0, G(o), m("Failed %s type: %s", t, a.message), G(null));
|
||||
a && !(a instanceof Error) && (G(o), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), G(null)), a instanceof Error && !(a.message in he) && (he[a.message] = !0, G(o), g("Failed %s type: %s", t, a.message), G(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,9 +366,9 @@ function fr() {
|
||||
}
|
||||
function ye(e) {
|
||||
if (Ge(e))
|
||||
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ge(e);
|
||||
return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), ge(e);
|
||||
}
|
||||
var I = C.ReactCurrentOwner, Je = {
|
||||
var W = C.ReactCurrentOwner, Je = {
|
||||
key: !0,
|
||||
ref: !0,
|
||||
__self: !0,
|
||||
@@ -392,15 +392,15 @@ function fr() {
|
||||
return e.key !== void 0;
|
||||
}
|
||||
function He(e, r) {
|
||||
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
|
||||
var t = k(I.current.type);
|
||||
Q[t] || (m('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', k(I.current.type), e.ref), Q[t] = !0);
|
||||
if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
|
||||
var t = S(W.current.type);
|
||||
Q[t] || (g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', S(W.current.type), e.ref), Q[t] = !0);
|
||||
}
|
||||
}
|
||||
function Ke(e, r) {
|
||||
{
|
||||
var t = function() {
|
||||
be || (be = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
||||
be || (be = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
||||
};
|
||||
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
||||
get: t,
|
||||
@@ -411,7 +411,7 @@ function fr() {
|
||||
function Xe(e, r) {
|
||||
{
|
||||
var t = function() {
|
||||
Ee || (Ee = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
||||
Ee || (Ee = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
||||
};
|
||||
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
||||
get: t,
|
||||
@@ -422,7 +422,7 @@ function fr() {
|
||||
var Ze = function(e, r, t, n, o, s, i) {
|
||||
var a = {
|
||||
// This tag allows us to uniquely identify this as a React Element
|
||||
$$typeof: g,
|
||||
$$typeof: w,
|
||||
// Built-in properties that belong on the element
|
||||
type: e,
|
||||
key: r,
|
||||
@@ -455,19 +455,19 @@ function fr() {
|
||||
for (s in r)
|
||||
q.call(r, s) && !Je.hasOwnProperty(s) && (i[s] = r[s]);
|
||||
if (e && e.defaultProps) {
|
||||
var f = e.defaultProps;
|
||||
for (s in f)
|
||||
i[s] === void 0 && (i[s] = f[s]);
|
||||
var u = e.defaultProps;
|
||||
for (s in u)
|
||||
i[s] === void 0 && (i[s] = u[s]);
|
||||
}
|
||||
if (a || y) {
|
||||
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
||||
a && Ke(i, d), y && Xe(i, d);
|
||||
var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
||||
a && Ke(i, c), y && Xe(i, c);
|
||||
}
|
||||
return Ze(e, a, y, o, n, I.current, i);
|
||||
return Ze(e, a, y, o, n, W.current, i);
|
||||
}
|
||||
}
|
||||
var ee = C.ReactCurrentOwner, xe = C.ReactDebugCurrentFrame;
|
||||
function A(e) {
|
||||
function F(e) {
|
||||
if (e) {
|
||||
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
||||
xe.setExtraStackFrame(t);
|
||||
@@ -477,12 +477,12 @@ function fr() {
|
||||
var re;
|
||||
re = !1;
|
||||
function te(e) {
|
||||
return typeof e == "object" && e !== null && e.$$typeof === g;
|
||||
return typeof e == "object" && e !== null && e.$$typeof === w;
|
||||
}
|
||||
function _e() {
|
||||
{
|
||||
if (ee.current) {
|
||||
var e = k(ee.current.type);
|
||||
var e = S(ee.current.type);
|
||||
if (e)
|
||||
return `
|
||||
|
||||
@@ -525,7 +525,7 @@ Check the top-level render call using <` + t + ">.");
|
||||
return;
|
||||
Re[t] = !0;
|
||||
var n = "";
|
||||
e && e._owner && e._owner !== ee.current && (n = " It was passed a child from " + k(e._owner.type) + "."), A(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), A(null);
|
||||
e && e._owner && e._owner !== ee.current && (n = " It was passed a child from " + S(e._owner.type) + "."), F(e), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
|
||||
}
|
||||
}
|
||||
function Te(e, r) {
|
||||
@@ -555,21 +555,21 @@ Check the top-level render call using <` + t + ">.");
|
||||
var t;
|
||||
if (typeof r == "function")
|
||||
t = r.propTypes;
|
||||
else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
|
||||
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
|
||||
// Inner props are checked in the reconciler.
|
||||
r.$$typeof === p))
|
||||
r.$$typeof === h))
|
||||
t = r.propTypes;
|
||||
else
|
||||
return;
|
||||
if (t) {
|
||||
var n = k(r);
|
||||
var n = S(r);
|
||||
Me(t, e.props, "prop", n, e);
|
||||
} else if (r.PropTypes !== void 0 && !re) {
|
||||
re = !0;
|
||||
var o = k(r);
|
||||
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
||||
var o = S(r);
|
||||
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
||||
}
|
||||
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
||||
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
||||
}
|
||||
}
|
||||
function nr(e) {
|
||||
@@ -577,11 +577,11 @@ Check the top-level render call using <` + t + ">.");
|
||||
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
||||
var n = r[t];
|
||||
if (n !== "children" && n !== "key") {
|
||||
A(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
|
||||
F(e), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
e.ref !== null && (A(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
|
||||
e.ref !== null && (F(e), g("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
||||
}
|
||||
}
|
||||
function je(e, r, t, n, o, s) {
|
||||
@@ -592,26 +592,26 @@ Check the top-level render call using <` + t + ">.");
|
||||
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
||||
var y = er(o);
|
||||
y ? a += y : a += _e();
|
||||
var f;
|
||||
e === null ? f = "null" : Z(e) ? f = "array" : e !== void 0 && e.$$typeof === g ? (f = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a);
|
||||
var u;
|
||||
e === null ? u = "null" : Z(e) ? u = "array" : e !== void 0 && e.$$typeof === w ? (u = "<" + (S(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : u = typeof e, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", u, a);
|
||||
}
|
||||
var d = Qe(e, r, t, o, s);
|
||||
if (d == null)
|
||||
return d;
|
||||
var c = Qe(e, r, t, o, s);
|
||||
if (c == null)
|
||||
return c;
|
||||
if (i) {
|
||||
var x = r.children;
|
||||
if (x !== void 0)
|
||||
var _ = r.children;
|
||||
if (_ !== void 0)
|
||||
if (n)
|
||||
if (Z(x)) {
|
||||
for (var F = 0; F < x.length; F++)
|
||||
Te(x[F], e);
|
||||
Object.freeze && Object.freeze(x);
|
||||
if (Z(_)) {
|
||||
for (var $ = 0; $ < _.length; $++)
|
||||
Te(_[$], e);
|
||||
Object.freeze && Object.freeze(_);
|
||||
} else
|
||||
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
||||
else
|
||||
Te(x, e);
|
||||
Te(_, e);
|
||||
}
|
||||
return e === _ ? nr(d) : tr(d), d;
|
||||
return e === f ? nr(c) : tr(c), c;
|
||||
}
|
||||
}
|
||||
function ar(e, r, t) {
|
||||
@@ -621,137 +621,138 @@ Check the top-level render call using <` + t + ">.");
|
||||
return je(e, r, t, !1);
|
||||
}
|
||||
var or = ir, sr = ar;
|
||||
Y.Fragment = _, Y.jsx = or, Y.jsxs = sr;
|
||||
}()), Y;
|
||||
L.Fragment = f, L.jsx = or, L.jsxs = sr;
|
||||
}()), L;
|
||||
}
|
||||
process.env.NODE_ENV === "production" ? ne.exports = cr() : ne.exports = fr();
|
||||
var u = ne.exports;
|
||||
var l = ne.exports;
|
||||
function dr({
|
||||
question: h = "",
|
||||
apiKey: g = "",
|
||||
selectedDocs: j = "",
|
||||
history: _ = [],
|
||||
conversationId: P = null,
|
||||
apiHost: O = "",
|
||||
onEvent: R = () => {
|
||||
question: D = "",
|
||||
apiKey: w = "",
|
||||
selectedDocs: O = "",
|
||||
history: f = [],
|
||||
conversationId: E = null,
|
||||
apiHost: j = "",
|
||||
onEvent: T = () => {
|
||||
console.log("Event triggered, but no handler provided.");
|
||||
}
|
||||
}) {
|
||||
let b = "default";
|
||||
return j && (b = j), new Promise((l, w) => {
|
||||
const v = {
|
||||
question: h,
|
||||
api_key: g,
|
||||
embeddings_key: g,
|
||||
return O && (b = O), new Promise((d, v) => {
|
||||
const m = {
|
||||
question: D,
|
||||
api_key: w,
|
||||
embeddings_key: w,
|
||||
active_docs: b,
|
||||
history: JSON.stringify(_),
|
||||
conversation_id: P
|
||||
history: JSON.stringify(f),
|
||||
conversation_id: E,
|
||||
model: "default"
|
||||
};
|
||||
fetch(O + "/stream", {
|
||||
fetch(j + "/stream", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify(v)
|
||||
}).then((p) => {
|
||||
if (!p.body)
|
||||
body: JSON.stringify(m)
|
||||
}).then((h) => {
|
||||
if (!h.body)
|
||||
throw Error("No response body");
|
||||
const c = p.body.getReader(), E = new TextDecoder("utf-8");
|
||||
let T = 0;
|
||||
const L = ({
|
||||
const x = h.body.getReader(), p = new TextDecoder("utf-8");
|
||||
let R = 0;
|
||||
const k = ({
|
||||
done: J,
|
||||
value: C
|
||||
}) => {
|
||||
if (J) {
|
||||
console.log(T), l();
|
||||
console.log(R), d();
|
||||
return;
|
||||
}
|
||||
T += 1;
|
||||
const B = E.decode(C).split(`
|
||||
R += 1;
|
||||
const B = p.decode(C).split(`
|
||||
`);
|
||||
for (let D of B) {
|
||||
if (D.trim() == "")
|
||||
for (let N of B) {
|
||||
if (N.trim() == "")
|
||||
continue;
|
||||
D.startsWith("data:") && (D = D.substring(5));
|
||||
N.startsWith("data:") && (N = N.substring(5));
|
||||
const z = new MessageEvent("message", {
|
||||
data: D
|
||||
data: N
|
||||
});
|
||||
R(z);
|
||||
T(z);
|
||||
}
|
||||
c.read().then(L).catch(w);
|
||||
x.read().then(k).catch(v);
|
||||
};
|
||||
c.read().then(L).catch(w);
|
||||
}).catch((p) => {
|
||||
console.error("Connection failed:", p), w(p);
|
||||
x.read().then(k).catch(v);
|
||||
}).catch((h) => {
|
||||
console.error("Connection failed:", h), v(h);
|
||||
});
|
||||
});
|
||||
}
|
||||
const pr = () => {
|
||||
const [h, g] = Se(
|
||||
const pr = ({ apiHost: D = "https://gptcloud.arc53.com", selectDocs: w = "default", apiKey: O = "docsgpt-public" }) => {
|
||||
const [f, E] = Se(
|
||||
"init"
|
||||
/* Init */
|
||||
), [j, _] = Se(""), P = "local/1706.03762.pdf/", O = "http://localhost:7091", R = lr(null);
|
||||
), [j, T] = Se(""), b = lr(null);
|
||||
ur(() => {
|
||||
if (R.current) {
|
||||
const l = R.current;
|
||||
l.scrollTop = l.scrollHeight;
|
||||
if (b.current) {
|
||||
const v = b.current;
|
||||
v.scrollTop = v.scrollHeight;
|
||||
}
|
||||
}, [j]);
|
||||
const b = (l) => {
|
||||
_(""), l.preventDefault(), g(
|
||||
const d = (v) => {
|
||||
T(""), v.preventDefault(), E(
|
||||
"processing"
|
||||
/* Processing */
|
||||
), setTimeout(() => {
|
||||
g(
|
||||
E(
|
||||
"answer"
|
||||
/* Answer */
|
||||
);
|
||||
}, 2e3);
|
||||
const v = l.currentTarget[0].value;
|
||||
}, 800);
|
||||
const h = v.currentTarget[0].value;
|
||||
dr({
|
||||
question: v,
|
||||
apiKey: "",
|
||||
selectedDocs: P,
|
||||
question: h,
|
||||
apiKey: O,
|
||||
selectedDocs: w,
|
||||
history: [],
|
||||
conversationId: null,
|
||||
apiHost: O,
|
||||
onEvent: (p) => {
|
||||
const c = JSON.parse(p.data);
|
||||
if (c.type === "end")
|
||||
g(
|
||||
apiHost: D,
|
||||
onEvent: (x) => {
|
||||
const p = JSON.parse(x.data);
|
||||
if (p.type === "end")
|
||||
E(
|
||||
"answer"
|
||||
/* Answer */
|
||||
);
|
||||
else if (c.type === "source") {
|
||||
let E;
|
||||
if (c.metadata && c.metadata.title) {
|
||||
const T = c.metadata.title.split("/");
|
||||
E = {
|
||||
title: T[T.length - 1],
|
||||
text: c.doc
|
||||
else if (p.type === "source") {
|
||||
let R;
|
||||
if (p.metadata && p.metadata.title) {
|
||||
const k = p.metadata.title.split("/");
|
||||
R = {
|
||||
title: k[k.length - 1],
|
||||
text: p.doc
|
||||
};
|
||||
} else
|
||||
E = { title: c.doc, text: c.doc };
|
||||
console.log(E);
|
||||
} else if (c.type === "id")
|
||||
console.log(c.id);
|
||||
R = { title: p.doc, text: p.doc };
|
||||
console.log(R);
|
||||
} else if (p.type === "id")
|
||||
console.log(p.id);
|
||||
else {
|
||||
const E = c.answer;
|
||||
_((T) => T + E);
|
||||
const R = p.answer;
|
||||
T((k) => k + R);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
return /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsxs("div", { className: "dark widget-container", children: [
|
||||
/* @__PURE__ */ u.jsx(
|
||||
return /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsxs("div", { className: "dark widget-container", children: [
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"div",
|
||||
{
|
||||
onClick: () => g(
|
||||
onClick: () => E(
|
||||
"init"
|
||||
/* Init */
|
||||
),
|
||||
className: `${h !== "minimized" ? "hidden" : ""} cursor-pointer`,
|
||||
children: /* @__PURE__ */ u.jsx("div", { className: "mr-2 mb-2 w-20 h-20 rounded-full overflow-hidden dark:divide-gray-700 border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ u.jsx(
|
||||
className: `${f !== "minimized" ? "hidden" : ""} cursor-pointer`,
|
||||
children: /* @__PURE__ */ l.jsx("div", { className: "mr-2 mb-2 w-20 h-20 rounded-full overflow-hidden dark:divide-gray-700 border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm flex items-center justify-center", children: /* @__PURE__ */ l.jsx(
|
||||
"img",
|
||||
{
|
||||
src: "https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png",
|
||||
@@ -761,50 +762,50 @@ const pr = () => {
|
||||
) })
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ u.jsxs("div", { className: ` ${h !== "minimized" ? "" : "hidden"} divide-y dark:divide-gray-700 rounded-md border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm`, style: { width: "18rem", transform: "translateY(0%) translateZ(0px)" }, children: [
|
||||
/* @__PURE__ */ u.jsxs("div", { children: [
|
||||
/* @__PURE__ */ u.jsx(
|
||||
/* @__PURE__ */ l.jsxs("div", { className: ` ${f !== "minimized" ? "" : "hidden"} divide-y dark:divide-gray-700 rounded-md border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm`, style: { width: "18rem", transform: "translateY(0%) translateZ(0px)" }, children: [
|
||||
/* @__PURE__ */ l.jsxs("div", { children: [
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"img",
|
||||
{
|
||||
src: "https://d3dg1063dc54p9.cloudfront.net/exit.svg",
|
||||
alt: "Exit",
|
||||
className: "cursor-pointer hover:opacity-50 h-3 absolute top-0 right-0 m-2 white-filter",
|
||||
onClick: (l) => {
|
||||
l.stopPropagation(), g(
|
||||
onClick: (v) => {
|
||||
v.stopPropagation(), E(
|
||||
"minimized"
|
||||
/* Minimized */
|
||||
);
|
||||
}
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 p-3", children: [
|
||||
/* @__PURE__ */ u.jsxs("div", { className: `${h === "init" || h === "processing" || h === "typing" ? "" : "hidden"} flex-1`, children: [
|
||||
/* @__PURE__ */ u.jsx("h3", { className: "text-sm font-bold text-gray-700 dark:text-gray-200", children: "Looking for help with documentation?" }),
|
||||
/* @__PURE__ */ u.jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: "DocsGPT AI assistant will help you with docs" })
|
||||
/* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 p-3", children: [
|
||||
/* @__PURE__ */ l.jsxs("div", { className: `${f === "init" || f === "processing" || f === "typing" ? "" : "hidden"} flex-1`, children: [
|
||||
/* @__PURE__ */ l.jsx("h3", { className: "text-sm font-bold text-gray-700 dark:text-gray-200", children: "Looking for help with documentation?" }),
|
||||
/* @__PURE__ */ l.jsx("p", { className: "mt-1 text-xs text-gray-400 dark:text-gray-500", children: "DocsGPT AI assistant will help you with docs" })
|
||||
] }),
|
||||
/* @__PURE__ */ u.jsx("div", { id: "docsgpt-answer", ref: R, className: `${h !== "answer" ? "hidden" : ""}`, children: /* @__PURE__ */ u.jsx("p", { className: "mt-1 text-sm text-gray-600 dark:text-white text-left", children: j }) })
|
||||
/* @__PURE__ */ l.jsx("div", { id: "docsgpt-answer", ref: b, className: `${f !== "answer" ? "hidden" : ""}`, children: /* @__PURE__ */ l.jsx("p", { className: "mt-1 text-sm text-gray-600 dark:text-white text-left", children: j }) })
|
||||
] })
|
||||
] }),
|
||||
/* @__PURE__ */ u.jsxs("div", { className: "w-full", children: [
|
||||
/* @__PURE__ */ u.jsx(
|
||||
/* @__PURE__ */ l.jsxs("div", { className: "w-full", children: [
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"button",
|
||||
{
|
||||
onClick: () => g(
|
||||
onClick: () => E(
|
||||
"typing"
|
||||
/* Typing */
|
||||
),
|
||||
className: `flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 hover:bg-gray-100 rounded-b dark:hover:bg-gray-800/70 ${h !== "init" ? "hidden" : ""}`,
|
||||
className: `flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 hover:bg-gray-100 rounded-b dark:hover:bg-gray-800/70 ${f !== "init" ? "hidden" : ""}`,
|
||||
children: "Ask DocsGPT"
|
||||
}
|
||||
),
|
||||
(h === "typing" || h === "answer") && /* @__PURE__ */ u.jsxs(
|
||||
(f === "typing" || f === "answer") && /* @__PURE__ */ l.jsxs(
|
||||
"form",
|
||||
{
|
||||
onSubmit: b,
|
||||
onSubmit: d,
|
||||
className: "relative w-full m-0",
|
||||
style: { opacity: 1 },
|
||||
children: [
|
||||
/* @__PURE__ */ u.jsx(
|
||||
/* @__PURE__ */ l.jsx(
|
||||
"input",
|
||||
{
|
||||
type: "text",
|
||||
@@ -812,15 +813,15 @@ const pr = () => {
|
||||
placeholder: "What do you want to do?"
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ u.jsx("button", { className: "absolute text-gray-400 dark:text-gray-500 text-sm inset-y-0 right-2 -mx-2 px-2", type: "submit", children: "Sumbit" })
|
||||
/* @__PURE__ */ l.jsx("button", { className: "absolute text-gray-400 dark:text-gray-500 text-sm inset-y-0 right-2 -mx-2 px-2", type: "submit", children: "Sumbit" })
|
||||
]
|
||||
}
|
||||
),
|
||||
/* @__PURE__ */ u.jsxs("p", { className: `${h !== "processing" ? "hidden" : ""} flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 rounded-b`, children: [
|
||||
/* @__PURE__ */ l.jsxs("p", { className: `${f !== "processing" ? "hidden" : ""} flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 rounded-b`, children: [
|
||||
"Processing",
|
||||
/* @__PURE__ */ u.jsx("span", { className: "dot-animation", children: "." }),
|
||||
/* @__PURE__ */ u.jsx("span", { className: "dot-animation delay-200", children: "." }),
|
||||
/* @__PURE__ */ u.jsx("span", { className: "dot-animation delay-400", children: "." })
|
||||
/* @__PURE__ */ l.jsx("span", { className: "dot-animation", children: "." }),
|
||||
/* @__PURE__ */ l.jsx("span", { className: "dot-animation delay-200", children: "." }),
|
||||
/* @__PURE__ */ l.jsx("span", { className: "dot-animation delay-400", children: "." })
|
||||
] })
|
||||
] })
|
||||
] })
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n Line truncated
|
||||
{"version":3,"file":"index.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n Line truncated
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
(function(N,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],T):(N=typeof globalThis<"u"?globalThis:N||self,T(N.ViteButton={},N.React))})(this,function(N,T){"use strict";var q={exports:{}},Y={};/**
|
||||
(function(N,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],w):(N=typeof globalThis<"u"?globalThis:N||self,w(N.ViteButton={},N.React))})(this,function(N,w){"use strict";var q={exports:{}},L={};/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var oe;function De(){if(oe)return Y;oe=1;var h=T,g=Symbol.for("react.element"),S=Symbol.for("react.fragment"),_=Object.prototype.hasOwnProperty,O=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C={key:!0,ref:!0,__self:!0,__source:!0};function R(b,l,w){var v,p={},c=null,x=null;w!==void 0&&(c=""+w),l.key!==void 0&&(c=""+l.key),l.ref!==void 0&&(x=l.ref);for(v in l)_.call(l,v)&&!C.hasOwnProperty(v)&&(p[v]=l[v]);if(b&&b.defaultProps)for(v in l=b.defaultProps,l)p[v]===void 0&&(p[v]=l[v]);return{$$typeof:g,type:b,key:c,ref:x,props:p,_owner:O.current}}return Y.Fragment=S,Y.jsx=R,Y.jsxs=R,Y}var L={};/**
|
||||
*/var oe;function De(){if(oe)return L;oe=1;var A=w,T=Symbol.for("react.element"),C=Symbol.for("react.fragment"),f=Object.prototype.hasOwnProperty,x=A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,S={key:!0,ref:!0,__self:!0,__source:!0};function j(b,d,v){var m,h={},E=null,p=null;v!==void 0&&(E=""+v),d.key!==void 0&&(E=""+d.key),d.ref!==void 0&&(p=d.ref);for(m in d)f.call(d,m)&&!S.hasOwnProperty(m)&&(h[m]=d[m]);if(b&&b.defaultProps)for(m in d=b.defaultProps,d)h[m]===void 0&&(h[m]=d[m]);return{$$typeof:T,type:b,key:E,ref:p,props:h,_owner:x.current}}return L.Fragment=C,L.jsx=j,L.jsxs=j,L}var V={};/**
|
||||
* @license React
|
||||
* react-jsx-runtime.development.js
|
||||
*
|
||||
@@ -14,16 +14,16 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var se;function Ne(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var h=T,g=Symbol.for("react.element"),S=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),b=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),j=Symbol.iterator,M="@@iterator";function H(e){if(e===null||typeof e!="object")return null;var r=j&&e[j]||e[M];return typeof r=="function"?r:null}var D=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];K("error",e,t)}}function K(e,r,t){{var n=D.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var A=!1,X=!1,Ie=!1,We=!1,Ye=!1,le;le=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===_||e===C||Ye||e===O||e===w||e===v||We||e===x||A||X||Ie||typeof e=="object"&&e!==null&&(e.$$typeof===c||e.$$typeof===p||e.$$typeof===R||e.$$typeof===b||e.$$typeof===l||e.$$typeof===le||e.getModuleId!==void 0))}function Ve(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ue(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _:return"Fragment";case S:return"Portal";case C:return"Profiler";case O:return"StrictMode";case w:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return ue(r)+".Consumer";case R:var t=e;return ue(t._context)+".Provider";case l:return Ve(e,e.render,"ForwardRef");case p:var n=e.displayName||null;return n!==null?n:k(e.type)||"Memo";case c:{var o=e,s=o._payload,i=o._init;try{return k(i(s))}catch{return null}}}return null}var F=Object.assign,V=0,ce,fe,de,ve,pe,he,me;function ge(){}ge.__reactDisabledLog=!0;function $e(){{if(V===0){ce=console.log,fe=console.info,de=console.warn,ve=console.error,pe=console.group,he=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function Me(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:ce}),info:F({},e,{value:fe}),warn:F({},e,{value:de}),error:F({},e,{value:ve}),group:F({},e,{value:pe}),groupCollapsed:F({},e,{value:he}),groupEnd:F({},e,{value:me})})}V<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=D.ReactCurrentDispatcher,Q;function U(e,r,t){{if(Q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);Q=n&&n[1]||""}return`
|
||||
`+Q+e}}var ee=!1,G;{var Ue=typeof WeakMap=="function"?WeakMap:Map;G=new Ue}function ye(e,r){if(!e||ee)return"";{var t=G.get(e);if(t!==void 0)return t}var n;ee=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=Z.current,Z.current=null,$e();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(P){n=P}Reflect.construct(e,[],i)}else{try{i.call()}catch(P){n=P}e.call(i.prototype)}}else{try{throw Error()}catch(P){n=P}e()}}catch(P){if(P&&n&&typeof P.stack=="string"){for(var a=P.stack.split(`
|
||||
*/var se;function Ne(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var A=w,T=Symbol.for("react.element"),C=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),b=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),R=Symbol.iterator,k="@@iterator";function H(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[k];return typeof r=="function"?r:null}var D=A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];K("error",e,t)}}function K(e,r,t){{var n=D.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var F=!1,X=!1,Ie=!1,We=!1,Ye=!1,le;le=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===f||e===S||Ye||e===x||e===v||e===m||We||e===p||F||X||Ie||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===h||e.$$typeof===j||e.$$typeof===b||e.$$typeof===d||e.$$typeof===le||e.getModuleId!==void 0))}function Ve(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function ue(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case f:return"Fragment";case C:return"Portal";case S:return"Profiler";case x:return"StrictMode";case v:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return ue(r)+".Consumer";case j:var t=e;return ue(t._context)+".Provider";case d:return Ve(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case E:{var o=e,s=o._payload,i=o._init;try{return P(i(s))}catch{return null}}}return null}var I=Object.assign,$=0,ce,fe,de,ve,pe,he,me;function ge(){}ge.__reactDisabledLog=!0;function $e(){{if($===0){ce=console.log,fe=console.info,de=console.warn,ve=console.error,pe=console.group,he=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}$++}}function Me(){{if($--,$===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ce}),info:I({},e,{value:fe}),warn:I({},e,{value:de}),error:I({},e,{value:ve}),group:I({},e,{value:pe}),groupCollapsed:I({},e,{value:he}),groupEnd:I({},e,{value:me})})}$<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=D.ReactCurrentDispatcher,Q;function U(e,r,t){{if(Q===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);Q=n&&n[1]||""}return`
|
||||
`+Q+e}}var ee=!1,G;{var Ue=typeof WeakMap=="function"?WeakMap:Map;G=new Ue}function ye(e,r){if(!e||ee)return"";{var t=G.get(e);if(t!==void 0)return t}var n;ee=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=Z.current,Z.current=null,$e();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(O){n=O}Reflect.construct(e,[],i)}else{try{i.call()}catch(O){n=O}e.call(i.prototype)}}else{try{throw Error()}catch(O){n=O}e()}}catch(O){if(O&&n&&typeof O.stack=="string"){for(var a=O.stack.split(`
|
||||
`),y=n.stack.split(`
|
||||
`),f=a.length-1,d=y.length-1;f>=1&&d>=0&&a[f]!==y[d];)d--;for(;f>=1&&d>=0;f--,d--)if(a[f]!==y[d]){if(f!==1||d!==1)do if(f--,d--,d<0||a[f]!==y[d]){var E=`
|
||||
`+a[f].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,E),E}while(f>=1&&d>=0);break}}}finally{ee=!1,Z.current=s,Me(),Error.prepareStackTrace=o}var W=e?e.displayName||e.name:"",Ce=W?U(W):"";return typeof e=="function"&&G.set(e,Ce),Ce}function Ge(e,r,t){return ye(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,Be(e));if(typeof e=="string")return U(e);switch(e){case w:return U("Suspense");case v:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Ge(e.render);case p:return B(e.type,r,t);case c:{var n=e,o=n._payload,s=n._init;try{return B(s(o),r,t)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,be={},xe=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function Je(e,r,t,n,o){{var s=Function.call.bind(J);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){a=f}a&&!(a instanceof Error)&&(z(o),m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),z(null)),a instanceof Error&&!(a.message in be)&&(be[a.message]=!0,z(o),m("Failed %s type: %s",t,a.message),z(null))}}}var ze=Array.isArray;function re(e){return ze(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return Ee(e),!1}catch{return!0}}function Ee(e){return""+e}function _e(e){if(He(e))return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(e)),Ee(e)}var $=D.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},Re,we,te;te={};function Xe(e){if(J.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=k($.current.type);te[t]||(m('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k($.current.type),e.ref),te[t]=!0)}}function er(e,r){{var t=function(){Re||(Re=!0,m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){we||(we=!0,m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,o,s,i){var a={$$typeof:g,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,o){{var s,i={},a=null,y=null;t!==void 0&&(_e(t),a=""+t),Ze(r)&&(_e(r.key),a=""+r.key),Xe(r)&&(y=r.ref,Qe(r,o));for(s in r)J.call(r,s)&&!Ke.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var f=e.defaultProps;for(s in f)i[s]===void 0&&(i[s]=f[s])}if(a||y){var d=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(i,d),y&&rr(i,d)}return tr(e,a,y,o,n,$.current,i)}}var ne=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var ae;ae=!
Line truncated
|
||||
`),u=a.length-1,c=y.length-1;u>=1&&c>=0&&a[u]!==y[c];)c--;for(;u>=1&&c>=0;u--,c--)if(a[u]!==y[c]){if(u!==1||c!==1)do if(u--,c--,c<0||a[u]!==y[c]){var _=`
|
||||
`+a[u].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,_),_}while(u>=1&&c>=0);break}}}finally{ee=!1,Z.current=s,Me(),Error.prepareStackTrace=o}var Y=e?e.displayName||e.name:"",Ce=Y?U(Y):"";return typeof e=="function"&&G.set(e,Ce),Ce}function Ge(e,r,t){return ye(e,!1)}function Be(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return ye(e,Be(e));if(typeof e=="string")return U(e);switch(e){case v:return U("Suspense");case m:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Ge(e.render);case h:return B(e.type,r,t);case E:{var n=e,o=n._payload,s=n._init;try{return B(s(o),r,t)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,be={},xe=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function Je(e,r,t,n,o){{var s=Function.call.bind(J);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){a=u}a&&!(a instanceof Error)&&(z(o),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),z(null)),a instanceof Error&&!(a.message in be)&&(be[a.message]=!0,z(o),g("Failed %s type: %s",t,a.message),z(null))}}}var ze=Array.isArray;function re(e){return ze(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return Ee(e),!1}catch{return!0}}function Ee(e){return""+e}function _e(e){if(He(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(e)),Ee(e)}var M=D.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},Re,we,te;te={};function Xe(e){if(J.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=P(M.current.type);te[t]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',P(M.current.type),e.ref),te[t]=!0)}}function er(e,r){{var t=function(){Re||(Re=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){we||(we=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,o,s,i){var a={$$typeof:T,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,o){{var s,i={},a=null,y=null;t!==void 0&&(_e(t),a=""+t),Ze(r)&&(_e(r.key),a=""+r.key),Xe(r)&&(y=r.ref,Qe(r,o));for(s in r)J.call(r,s)&&!Ke.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var u=e.defaultProps;for(s in u)i[s]===void 0&&(i[s]=u[s])}if(a||y){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(i,c),y&&rr(i,c)}return tr(e,a,y,o,n,M.current,i)}}var ne=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var ae;ae=!
Line truncated
|
||||
|
||||
Check the render method of \``+e+"`."}return""}}function ar(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
||||
|
||||
Check your code at `+r+":"+t+"."}return""}}var Se={};function ir(e){{var r=je();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
||||
|
||||
Check the top-level render call using <`+t+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==ne.current&&(n=" It was passed a child from "+k(e._owner.type)+"."),I(e),m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),I(null)}}function Pe(e,r){{if(typeof e!="object")return;if(re(e))for(var t=0;t<e.length;t++){var n=e[t];ie(n)&&ke(n,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var o=H(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)ie(i.value)&&ke(i.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===p))t=r.propTypes;else return;if(t){var n=k(r);Je(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ae){ae=!0;var o=k(r);m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){I(e),m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}e.ref!==null&&(I(e),m("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}function Oe(e,r,t,n,o,s){{var i=Le(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=ar(o);y?a+=y:a+=je();var f;e===null?f="null":re(e)?f="array":e!==void 0&&e.$$typeof===g?(f="<"+(k(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,a)}var d=nr(e,r,t,o,s);if(d==null)return d;if(i){var E=r.children;if(E!==void 0)if(n)if(re(E)){for(var W=0;W<E.length;W++)Pe(E[W],e);Object.freeze&&Object.freeze(E)}else m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Pe(E,e)}return e===_?sr(d):or(d),d}}function lr(e,r,t){return Oe(e,r,t,!0)}function ur(e,r,t){return Oe(e,r,t,!1)}var cr=ur,fr=lr;L.Fragment=_,L.jsx=cr,L.jsxs=fr}()),L}process.env.NODE_ENV==="production"?q.exports=De():q.exports=Ne();var u=q.exports;function Ae({question:h="",apiKey:g="",selectedDocs:S="",history:_=[],conversationId:O=null,apiHost:C="",onEvent:R=()=>{console.log("Event triggered, but no handler provided.")}}){let b="default";return S&&(b=S),new Promise((l,w)=>{const v={question:h,api_key:g,embeddings_key:g,active_docs:b,history:JSON.stringify(_),conversation_id:O};fetch(C+"/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)}).then(p=>{if(!p.body)throw Error("No response body");const c=p.body.getReader(),x=new TextDecoder("utf-8");let j=0;const M=({done:H,value:D})=>{if(H){console.log(j),l();return}j+=1;const K=x.decode(D).split(`
|
||||
`);for(let A of K){if(A.trim()=="")continue;A.startsWith("data:")&&(A=A.substring(5));const X=new MessageEvent("message",{data:A});R(X)}c.read().then(M).catch(w)};c.read().then(M).catch(w)}).catch(p=>{console.error("Connection failed:",p),w(p)})})}const Fe=()=>{const[h,g]=T.useState("init"),[S,_]=T.useState(""),O="local/1706.03762.pdf/",C="http://localhost:7091",R=T.useRef(null);T.useEffect(()=>{if(R.current){const l=R.current;l.scrollTop=l.scrollHeight}},[S]);const b=l=>{_(""),l.preventDefault(),g("processing"),setTimeout(()=>{g("answer")},2e3);const v=l.currentTarget[0].value;Ae({question:v,apiKey:"",selectedDocs:O,history:[],conversationId:null,apiHost:C,onEvent:p=>{const c=JSON.parse(p.data);if(c.type==="end")g("answer");else if(c.type==="source"){let x;if(c.metadata&&c.metadata.title){const j=c.metadata.title.split("/");x={title:j[j.length-1],text:c.doc}}else x={title:c.doc,text:c.doc};console.log(x)}else if(c.type==="id")console.log(c.id);else{const x=c.answer;_(j=>j+x)}}})};return u.jsx(u.Fragment,{children:u.jsxs("div",{className:"dark widget-container",children:[u.jsx("div",{onClick:()=>g("init"),className:`${h!=="minimized"?"hidden":""} cursor-pointer`,children:u.jsx("div",{className:"mr-2 mb-2 w-20 h-20 rounded-full overflow-hidden dark:divide-gray-700 border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm flex items-center justify-center",children:u.jsx("img",{src:"https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png",alt:"DocsGPT",className:"cursor-pointer hover:opacity-50 h-14"})})}),u.jsxs("div",{className:` ${h!=="minimized"?"":"hidden"} divide-y dark:divide-gray-700 rounded-md border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm`,style:{width:"18rem",transform:"translateY(0%) translateZ(0px)"},children:[u.jsxs("div",{children:[u.jsx("img",{src:"https://d3dg1063dc54p9.cloudfront.net/exit.svg",alt:"Exit",className:"cursor-pointer hover:opacity-50 h-3 absolute top-0 right-0 m-2 white-filter",onClick:l=>{l.stopPropagation(),g("minimized")}}),u.jsxs("div",{className:"flex items-center gap-2 p-3",children:[u.jsxs("div",{className:`${h==="init"||h==="processing"||h==="typing"?"":"hidden"} flex-1`,children:[u.jsx("h3",{className:"text-sm font-bold text-gray-700 dark:text-gray-200",children:"Looking for help with documentation?"}),u.jsx("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:"DocsGPT AI assistant will help you with docs"})]}),u.jsx("div",{id:"docsgpt-answer",ref:R,className:`${h!=="answer"?"hidden":""}`,children:u.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-white text-left",children:S})})]})]}),u.jsxs("div",{className:"w-full",children:[u.jsx("button",{onClick:()=>g("typing"),className:`flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 hover:bg-gray-100 rounded-b dark:hover:bg-gray-800/70 ${h!=="init"?"hidden":""}`,children:"Ask DocsGPT"}),(h==="typing"||h==="answer")&&u.jsxs("form",{onSubmit:b,className:"relative w-full m-0",style:{opacity:1},children:[u.jsx("input",{type:"text",className:"w-full bg-transparent px-5 py-3 pr-8 text-sm text-gray-700 dark:text-white focus:outline-none",placeholder:"What do you want to do?"}),u.jsx("button",{className:"absolute text-gray-400 dark:text-gray-500 text-sm inset-y-0 right-2 -mx-2 px-2",type:"submit",children:"Sumbit"})]}),u.jsxs("p",{className:`${h!=="processing"?"hidden":""} flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 rounded-b`,children:["Processing",u.jsx("span",{className:"dot-animation",children:"."}),u.jsx("span",{className:"dot-animation delay-200",children:"."}),u.jsx("span",{className:"dot-animation delay-400",children:"."})]})]})]})]})})};N.DocsGPTWidget=Fe,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
||||
Check the top-level render call using <`+t+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==ne.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),W(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),W(null)}}function Pe(e,r){{if(typeof e!="object")return;if(re(e))for(var t=0;t<e.length;t++){var n=e[t];ie(n)&&ke(n,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var o=H(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)ie(i.value)&&ke(i.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===h))t=r.propTypes;else return;if(t){var n=P(r);Je(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ae){ae=!0;var o=P(r);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){W(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),W(null);break}}e.ref!==null&&(W(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Oe(e,r,t,n,o,s){{var i=Le(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=ar(o);y?a+=y:a+=je();var u;e===null?u="null":re(e)?u="array":e!==void 0&&e.$$typeof===T?(u="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var c=nr(e,r,t,o,s);if(c==null)return c;if(i){var _=r.children;if(_!==void 0)if(n)if(re(_)){for(var Y=0;Y<_.length;Y++)Pe(_[Y],e);Object.freeze&&Object.freeze(_)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Pe(_,e)}return e===f?sr(c):or(c),c}}function lr(e,r,t){return Oe(e,r,t,!0)}function ur(e,r,t){return Oe(e,r,t,!1)}var cr=ur,fr=lr;V.Fragment=f,V.jsx=cr,V.jsxs=fr}()),V}process.env.NODE_ENV==="production"?q.exports=De():q.exports=Ne();var l=q.exports;function Ae({question:A="",apiKey:T="",selectedDocs:C="",history:f=[],conversationId:x=null,apiHost:S="",onEvent:j=()=>{console.log("Event triggered, but no handler provided.")}}){let b="default";return C&&(b=C),new Promise((d,v)=>{const m={question:A,api_key:T,embeddings_key:T,active_docs:b,history:JSON.stringify(f),conversation_id:x,model:"default"};fetch(S+"/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then(h=>{if(!h.body)throw Error("No response body");const E=h.body.getReader(),p=new TextDecoder("utf-8");let R=0;const k=({done:H,value:D})=>{if(H){console.log(R),d();return}R+=1;const K=p.decode(D).split(`
|
||||
`);for(let F of K){if(F.trim()=="")continue;F.startsWith("data:")&&(F=F.substring(5));const X=new MessageEvent("message",{data:F});j(X)}E.read().then(k).catch(v)};E.read().then(k).catch(v)}).catch(h=>{console.error("Connection failed:",h),v(h)})})}const Fe=({apiHost:A="https://gptcloud.arc53.com",selectDocs:T="default",apiKey:C="docsgpt-public"})=>{const[f,x]=w.useState("init"),[S,j]=w.useState(""),b=w.useRef(null);w.useEffect(()=>{if(b.current){const v=b.current;v.scrollTop=v.scrollHeight}},[S]);const d=v=>{j(""),v.preventDefault(),x("processing"),setTimeout(()=>{x("answer")},800);const h=v.currentTarget[0].value;Ae({question:h,apiKey:C,selectedDocs:T,history:[],conversationId:null,apiHost:A,onEvent:E=>{const p=JSON.parse(E.data);if(p.type==="end")x("answer");else if(p.type==="source"){let R;if(p.metadata&&p.metadata.title){const k=p.metadata.title.split("/");R={title:k[k.length-1],text:p.doc}}else R={title:p.doc,text:p.doc};console.log(R)}else if(p.type==="id")console.log(p.id);else{const R=p.answer;j(k=>k+R)}}})};return l.jsx(l.Fragment,{children:l.jsxs("div",{className:"dark widget-container",children:[l.jsx("div",{onClick:()=>x("init"),className:`${f!=="minimized"?"hidden":""} cursor-pointer`,children:l.jsx("div",{className:"mr-2 mb-2 w-20 h-20 rounded-full overflow-hidden dark:divide-gray-700 border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm flex items-center justify-center",children:l.jsx("img",{src:"https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png",alt:"DocsGPT",className:"cursor-pointer hover:opacity-50 h-14"})})}),l.jsxs("div",{className:` ${f!=="minimized"?"":"hidden"} divide-y dark:divide-gray-700 rounded-md border dark:border-gray-700 bg-gradient-to-br from-gray-100/80 via-white to-white dark:from-gray-900/80 dark:via-gray-900 dark:to-gray-900 font-sans shadow backdrop-blur-sm`,style:{width:"18rem",transform:"translateY(0%) translateZ(0px)"},children:[l.jsxs("div",{children:[l.jsx("img",{src:"https://d3dg1063dc54p9.cloudfront.net/exit.svg",alt:"Exit",className:"cursor-pointer hover:opacity-50 h-3 absolute top-0 right-0 m-2 white-filter",onClick:v=>{v.stopPropagation(),x("minimized")}}),l.jsxs("div",{className:"flex items-center gap-2 p-3",children:[l.jsxs("div",{className:`${f==="init"||f==="processing"||f==="typing"?"":"hidden"} flex-1`,children:[l.jsx("h3",{className:"text-sm font-bold text-gray-700 dark:text-gray-200",children:"Looking for help with documentation?"}),l.jsx("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:"DocsGPT AI assistant will help you with docs"})]}),l.jsx("div",{id:"docsgpt-answer",ref:b,className:`${f!=="answer"?"hidden":""}`,children:l.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-white text-left",children:S})})]})]}),l.jsxs("div",{className:"w-full",children:[l.jsx("button",{onClick:()=>x("typing"),className:`flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 hover:bg-gray-100 rounded-b dark:hover:bg-gray-800/70 ${f!=="init"?"hidden":""}`,children:"Ask DocsGPT"}),(f==="typing"||f==="answer")&&l.jsxs("form",{onSubmit:d,className:"relative w-full m-0",style:{opacity:1},children:[l.jsx("input",{type:"text",className:"w-full bg-transparent px-5 py-3 pr-8 text-sm text-gray-700 dark:text-white focus:outline-none",placeholder:"What do you want to do?"}),l.jsx("button",{className:"absolute text-gray-400 dark:text-gray-500 text-sm inset-y-0 right-2 -mx-2 px-2",type:"submit",children:"Sumbit"})]}),l.jsxs("p",{className:`${f!=="processing"?"hidden":""} flex w-full justify-center px-5 py-3 text-sm text-gray-800 font-bold dark:text-white transition duration-300 rounded-b`,children:["Processing",l.jsx("span",{className:"dot-animation",children:"."}),l.jsx("span",{className:"dot-animation delay-200",children:"."}),l.jsx("span",{className:"dot-animation delay-400",children:"."})]})]})]})]})})};N.DocsGPTWidget=Fe,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
||||
//# sourceMappingURL=index.umd.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"index.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n Line truncated
|
||||
{"version":3,"file":"index.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/components/DocsGPTWidget.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n Line truncated
|
||||
@@ -1 +1,5 @@
|
||||
export declare const DocsGPTWidget: () => JSX.Element;
|
||||
export declare const DocsGPTWidget: ({ apiHost, selectDocs, apiKey }: {
|
||||
apiHost?: string | undefined;
|
||||
selectDocs?: string | undefined;
|
||||
apiKey?: string | undefined;
|
||||
}) => JSX.Element;
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "docsgpt",
|
||||
"private": false,
|
||||
"version": "0.1.9",
|
||||
"version": "0.2.0",
|
||||
"type": "module",
|
||||
"main": "dist/index.umd.js",
|
||||
"module": "dist/index.es.js",
|
||||
|
||||
@@ -48,6 +48,7 @@ function fetchAnswerStreaming({
|
||||
active_docs: docPath,
|
||||
history: JSON.stringify(history),
|
||||
conversation_id: conversationId,
|
||||
model: 'default'
|
||||
};
|
||||
|
||||
fetch(apiHost + '/stream', {
|
||||
@@ -106,14 +107,12 @@ function fetchAnswerStreaming({
|
||||
});
|
||||
}
|
||||
|
||||
export const DocsGPTWidget = ({ apiHost = 'http://localhost:7091' }) => {
|
||||
export const DocsGPTWidget = ({ apiHost = 'https://gptcloud.arc53.com', selectDocs = 'default', apiKey = 'docsgpt-public'}) => {
|
||||
// processing states
|
||||
const [chatState, setChatState] = useState<ChatStates>(ChatStates.Init);
|
||||
const [answer, setAnswer] = useState<string>('');
|
||||
|
||||
const selectDocs = 'local/1706.03762.pdf/'
|
||||
//const selectDocs = 'default'
|
||||
//const apiHost = 'http://localhost:7091'
|
||||
//const selectDocs = 'local/1706.03762.pdf/'
|
||||
const answerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -133,13 +132,13 @@ export const DocsGPTWidget = ({ apiHost = 'http://localhost:7091' }) => {
|
||||
setChatState(ChatStates.Processing)
|
||||
setTimeout(() => {
|
||||
setChatState(ChatStates.Answer)
|
||||
}, 2000)
|
||||
}, 800)
|
||||
const inputElement = e.currentTarget[0] as HTMLInputElement;
|
||||
const questionValue = inputElement.value;
|
||||
|
||||
fetchAnswerStreaming({
|
||||
question: questionValue,
|
||||
apiKey: '',
|
||||
apiKey: apiKey,
|
||||
selectedDocs: selectDocs,
|
||||
history: [],
|
||||
conversationId: null,
|
||||
|
||||
Reference in new issue
Block a user