@scalar/agent-chat 0.5.18 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/App.vue.d.ts +2 -1
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/api.d.ts +3 -1
  4. package/dist/api.d.ts.map +1 -1
  5. package/dist/api.js +54 -53
  6. package/dist/client-tools/execute-request.d.ts +1 -0
  7. package/dist/client-tools/execute-request.d.ts.map +1 -1
  8. package/dist/client-tools/execute-request.js +33 -27
  9. package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +1 -1
  10. package/dist/components/FreeMessagesInfoSection.vue.js +1 -1
  11. package/dist/components/FreeMessagesInfoSection.vue2.js +27 -25
  12. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  13. package/dist/components/PaymentSection.vue.js +1 -1
  14. package/dist/components/PaymentSection.vue2.js +16 -20
  15. package/dist/components/ServerSelector.vue.d.ts.map +1 -1
  16. package/dist/components/ServerSelector.vue.js +27 -21
  17. package/dist/components/UploadSection.vue.js +2 -2
  18. package/dist/components/UploadSection.vue2.js +13 -13
  19. package/dist/consts/urls.d.ts +8 -0
  20. package/dist/consts/urls.d.ts.map +1 -0
  21. package/dist/consts/urls.js +10 -0
  22. package/dist/helpers.d.ts +4 -10
  23. package/dist/helpers.d.ts.map +1 -1
  24. package/dist/helpers.js +34 -45
  25. package/dist/hooks/use-agent-key-documents.js +6 -6
  26. package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
  27. package/dist/hooks/use-chat-approvals.js +7 -6
  28. package/dist/hooks/use-signup-link.d.ts +12 -0
  29. package/dist/hooks/use-signup-link.d.ts.map +1 -0
  30. package/dist/hooks/use-signup-link.js +12 -0
  31. package/dist/hooks/use-upload-tmp-document.d.ts +3 -0
  32. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -1
  33. package/dist/hooks/use-upload-tmp-document.js +31 -28
  34. package/dist/package.json +1 -1
  35. package/dist/state/state.d.ts +2 -1
  36. package/dist/state/state.d.ts.map +1 -1
  37. package/dist/state/state.js +134 -127
  38. package/dist/style.css +1 -1
  39. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +1 -1
  40. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +12 -12
  41. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  42. package/dist/views/PromptForm.vue.js +2 -2
  43. package/dist/views/PromptForm.vue2.js +100 -93
  44. package/dist/views/Settings/DocSettings.vue.js +1 -1
  45. package/dist/views/Settings/DocSettings.vue2.js +10 -10
  46. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  47. package/dist/views/Settings/Settings.vue.js +2 -2
  48. package/dist/views/Settings/Settings.vue2.js +53 -43
  49. package/dist/views/Start.vue.d.ts.map +1 -1
  50. package/dist/views/Start.vue.js +1 -1
  51. package/dist/views/Start.vue2.js +28 -27
  52. package/package.json +8 -8
package/dist/App.vue.d.ts CHANGED
@@ -21,7 +21,8 @@ declare const state: {
21
21
  loading: import("vue").ComputedRef<boolean>;
22
22
  settingsModal: import("@scalar/components").ModalState;
23
23
  eventBus: import("@scalar/workspace-store/events").WorkspaceEventBus;
24
- proxyUrl: Ref<string | undefined>;
24
+ proxyUrl: import("vue").ComputedRef<string>;
25
+ proxyUrlRaw: Ref<string | undefined>;
25
26
  config: import("vue").ComputedRef<import("@scalar/types/api-reference").ApiReferenceConfigurationRaw>;
26
27
  registryUrl: string;
27
28
  dashboardUrl: string;
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../src/App.vue"],"names":[],"mappings":"AAsEA,OAAO,EAAW,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAGvC,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,gBAAgB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A;IAC1B,qBAAqB,CAAC,EAAE,MAAM,MAAM,CAAA;IACpC,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACzB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;AAqBF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;iBA+BwC,CAAC;;;;;iBAIrC,CAAC;;;;;;;;;;;;;CAvBd,CAAA;AAIF,MAAM,MAAM,WAAW,GAAG;IACxB,gBAAgB,EAAE,OAAO,KAAK,CAAC,gBAAgB,CAAA;CAChD,CAAA;AA8CD,QAAA,MAAM,YAAY;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
package/dist/api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Ref } from 'vue';
1
2
  export declare function createAuthorizationHeaders({ getAccessToken, getAgentKey, }: {
2
3
  getAccessToken?: () => string;
3
4
  getAgentKey?: () => string;
@@ -6,8 +7,9 @@ export declare function createAuthorizationHeaders({ getAccessToken, getAgentKey
6
7
  Authorization?: string | undefined;
7
8
  };
8
9
  /** Minimal set of API requests needed for agent chat */
9
- export declare function createApi({ baseUrl, getAccessToken, getAgentKey, }: {
10
+ export declare function createApi({ baseUrl, proxyUrl, getAccessToken, getAgentKey, }: {
10
11
  baseUrl: string;
12
+ proxyUrl: Ref<string>;
11
13
  getAccessToken?: () => string;
12
14
  getAgentKey?: () => string;
13
15
  }): {
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAOA,wBAAgB,0BAA0B,CAAC,EACzC,cAAc,EACd,WAAW,GACZ,EAAE;IACD,cAAc,CAAC,EAAE,MAAM,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,MAAM,CAAA;CAC3B;;;EAYA;AAED,wDA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AU,CAAC,OAAO,SAAS,CAAC,CAAA"}
package/dist/api.js CHANGED
@@ -1,98 +1,99 @@
1
- import { n as f } from "neverpanic";
1
+ import { redirectToProxy as E } from "@scalar/helpers/url/redirect-to-proxy";
2
+ import { n as d } from "neverpanic";
2
3
  import t from "zod";
3
- import { createError as a } from "./entities/error/helpers.js";
4
- import { registryApiMetadata as n } from "./entities/registry/document.js";
5
- import { makeScalarProxyUrl as D } from "./helpers.js";
6
- function E({
7
- getAccessToken: u,
8
- getAgentKey: i
4
+ import { createError as s } from "./entities/error/helpers.js";
5
+ import { registryApiMetadata as u } from "./entities/registry/document.js";
6
+ function R({
7
+ getAccessToken: i,
8
+ getAgentKey: m
9
9
  }) {
10
- const c = u?.(), e = i?.();
10
+ const a = i?.(), c = m?.();
11
11
  return {
12
- ...c && {
13
- Authorization: `Bearer ${c}`
12
+ ...a && {
13
+ Authorization: `Bearer ${a}`
14
14
  },
15
- ...e && {
16
- "x-scalar-agent-key": e
15
+ ...c && {
16
+ "x-scalar-agent-key": c
17
17
  }
18
18
  };
19
19
  }
20
- function $({
21
- baseUrl: u,
22
- getAccessToken: i,
20
+ function T({
21
+ baseUrl: i,
22
+ proxyUrl: m,
23
+ getAccessToken: a,
23
24
  getAgentKey: c
24
25
  }) {
25
- const e = f.safeFn(
26
+ const o = d.safeFn(
26
27
  async ({
27
- path: s,
28
- method: g = "get",
28
+ path: r,
29
+ method: h = "get",
29
30
  query: p,
30
- body: d,
31
- responseSchema: h
31
+ body: y,
32
+ responseSchema: l
32
33
  }) => {
33
- const l = `${u}${s}${p ? `?${new URLSearchParams(p)}` : ""}`, o = await f.fromUnsafe(
34
- async () => fetch(D(l), {
35
- method: g,
36
- ...d && { body: JSON.stringify(d) },
34
+ const D = `${i}${r}${p ? `?${new URLSearchParams(p)}` : ""}`, n = await d.fromUnsafe(
35
+ async () => fetch(E(m.value, D), {
36
+ method: h,
37
+ ...y && { body: JSON.stringify(y) },
37
38
  headers: {
38
- ...E({ getAccessToken: i, getAgentKey: c })
39
+ ...R({ getAccessToken: a, getAgentKey: c })
39
40
  }
40
41
  }),
41
- (r) => a("FAILED_TO_FETCH", r)
42
+ (e) => s("FAILED_TO_FETCH", e)
42
43
  );
43
- if (!o.success)
44
- return o;
45
- const m = await f.fromUnsafe(
46
- async () => o.data.json(),
47
- (r) => a("FAILED_TO_FETCH_DATA", r)
44
+ if (!n.success)
45
+ return n;
46
+ const f = await d.fromUnsafe(
47
+ async () => n.data.json(),
48
+ (e) => s("FAILED_TO_FETCH_DATA", e)
48
49
  );
49
- if (!m.success)
50
+ if (!f.success)
50
51
  return {
51
52
  success: !1,
52
- error: a("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
53
+ error: s("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
53
54
  };
54
- if (!o.data.ok) {
55
- const r = t.object({ message: t.string(), code: t.string() }).safeParse(m.data);
56
- return r.success ? {
55
+ if (!n.data.ok) {
56
+ const e = t.object({ message: t.string(), code: t.string() }).safeParse(f.data);
57
+ return e.success ? {
57
58
  success: !1,
58
- error: a(r.data.code, r.data.message)
59
+ error: s(e.data.code, e.data.message)
59
60
  } : {
60
61
  success: !1,
61
- error: a("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
62
+ error: s("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
62
63
  };
63
64
  }
64
- const y = h.safeParse(m.data);
65
- return y.success ? { success: !0, data: y.data } : {
65
+ const g = l.safeParse(f.data);
66
+ return g.success ? { success: !0, data: g.data } : {
66
67
  success: !1,
67
- error: a("INVALID_RESPONSE", "Invalid response. Please contact support")
68
+ error: s("INVALID_RESPONSE", "Invalid response. Please contact support")
68
69
  };
69
70
  }
70
71
  );
71
72
  return {
72
- search: async (s) => e({
73
+ search: async (r) => o({
73
74
  path: "/vector/registry/search",
74
- query: { query: s },
75
+ query: { query: r },
75
76
  responseSchema: t.object({
76
- results: n.array()
77
+ results: u.array()
77
78
  })
78
79
  }),
79
- getDocument: async (s) => e({
80
- path: `/vector/registry/document/${s.namespace}/${s.slug}`,
81
- responseSchema: n
80
+ getDocument: async (r) => o({
81
+ path: `/vector/registry/document/${r.namespace}/${r.slug}`,
82
+ responseSchema: u
82
83
  }),
83
- getKeyDocuments: async () => e({
84
+ getKeyDocuments: async () => o({
84
85
  path: "/vector/registry/documents",
85
- responseSchema: t.object({ documents: n.array() })
86
+ responseSchema: t.object({ documents: u.array() })
86
87
  }),
87
- getCuratedDocuments: async () => e({
88
+ getCuratedDocuments: async () => o({
88
89
  path: "/vector/registry/curated",
89
90
  responseSchema: t.object({
90
- results: n.array()
91
+ results: u.array()
91
92
  })
92
93
  })
93
94
  };
94
95
  }
95
96
  export {
96
- $ as createApi,
97
- E as createAuthorizationHeaders
97
+ T as createApi,
98
+ R as createAuthorizationHeaders
98
99
  };
@@ -13,6 +13,7 @@ export declare const executeRequestTool: (args_0: {
13
13
  }>;
14
14
  toolCallId: string;
15
15
  chat: Chat<UIMessage<unknown, UIDataTypes, Tools>>;
16
+ proxyUrl: string;
16
17
  input: {
17
18
  method: string;
18
19
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"execute-request.d.ts","sourceRoot":"","sources":["../../src/client-tools/execute-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AAEzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAOhD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAsE1C;;GAEG;AACH,eAAO,MAAM,kBAAkB;sBAOT,MAAM,CACtB,MAAM,EACN;QAAE,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;QAAC,eAAe,EAAE,0BAA0B,EAAE,CAAA;KAAE,CACrF;gBACW,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;;;;;;;;;;;;;;;;;;kHAsDJ,CAAA"}
@@ -1,17 +1,17 @@
1
- import { buildRequestSecurity as S, getResolvedUrl as y } from "@scalar/api-client/v2/blocks/operation-block";
2
- import { redirectToProxy as N } from "@scalar/helpers/url/redirect-to-proxy";
1
+ import { buildRequestSecurity as N, getResolvedUrl as y } from "@scalar/api-client/v2/blocks/operation-block";
2
+ import { redirectToProxy as D } from "@scalar/helpers/url/redirect-to-proxy";
3
3
  import { n as u } from "neverpanic";
4
- import D from "truncate-json";
4
+ import R from "truncate-json";
5
5
  import { createError as o } from "../entities/error/helpers.js";
6
- import { createDocumentName as R } from "../registry/create-document-name.js";
7
- import { TOOL_NAMESPACE_SLUG_DELIMITER as h } from "../entities/tools/constants.js";
8
- import { EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME as U } from "../entities/tools/execute-request.js";
9
- const v = 5e4, I = u.safeFn(
6
+ import { createDocumentName as h } from "../registry/create-document-name.js";
7
+ import { TOOL_NAMESPACE_SLUG_DELIMITER as U } from "../entities/tools/constants.js";
8
+ import { EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME as v } from "../entities/tools/execute-request.js";
9
+ const I = 5e4, L = u.safeFn(
10
10
  async (e) => e.headers.get("content-type") === "application/json" ? { success: !0, data: await e.json() } : { success: !0, data: await e.text() },
11
11
  (e) => o("FAILED_TO_PARSE_RESPONSE_BODY", { originalError: e })
12
- ), T = (e) => JSON.parse(D(JSON.stringify(e), v).jsonString), L = u.safeFn(
12
+ ), T = (e) => JSON.parse(R(JSON.stringify(e), I).jsonString), A = u.safeFn(
13
13
  async (e, r) => {
14
- const t = await fetch(e, r), s = await I(t);
14
+ const t = await fetch(e, r), s = await L(t);
15
15
  return t.ok ? s.success ? {
16
16
  success: !0,
17
17
  data: {
@@ -31,8 +31,12 @@ const v = 5e4, I = u.safeFn(
31
31
  },
32
32
  (e) => o("FAILED_TO_FETCH", { originalError: e })
33
33
  );
34
- function A({ path: e, activeServer: r }) {
35
- const t = y({
34
+ function F({
35
+ path: e,
36
+ activeServer: r,
37
+ proxyUrl: t
38
+ }) {
39
+ const s = y({
36
40
  path: e,
37
41
  server: r,
38
42
  pathVariables: {},
@@ -41,22 +45,23 @@ function A({ path: e, activeServer: r }) {
41
45
  variables: []
42
46
  }
43
47
  });
44
- return N("https://proxy.scalar.com", t);
48
+ return D(t, s);
45
49
  }
46
50
  const x = u.safeFn(
47
51
  async ({
48
52
  documentSettings: e,
49
53
  toolCallId: r,
50
54
  chat: t,
51
- input: { method: s, path: l, body: f, headers: m, documentIdentifier: i }
55
+ proxyUrl: s,
56
+ input: { method: f, path: l, body: m, headers: O, documentIdentifier: i }
52
57
  }) => {
53
- const [a, n] = i.split(h);
58
+ const [a, n] = i.split(U);
54
59
  if (!a || !n)
55
60
  return {
56
61
  success: !1,
57
62
  error: o("FAILED_TO_DETERMINE_DOCUMENT", { namespace: a, slug: n, documentIdentifier: i })
58
63
  };
59
- const E = R(a, n), c = e[E];
64
+ const E = h(a, n), c = e[E];
60
65
  if (!c)
61
66
  return {
62
67
  success: !1,
@@ -66,24 +71,25 @@ const x = u.safeFn(
66
71
  slug: n
67
72
  })
68
73
  };
69
- const p = S(c.securitySchemes), O = {
70
- method: s,
71
- body: f,
72
- ...p,
74
+ const _ = N(c.securitySchemes), d = {
75
+ method: f,
76
+ body: m,
77
+ ..._,
73
78
  headers: {
74
- ...m,
75
- ...p.headers
79
+ ...O,
80
+ ..._.headers
76
81
  }
77
- }, d = A({
82
+ }, S = F({
78
83
  path: l,
79
- activeServer: c.activeServer
80
- }), _ = await L(d, O);
84
+ activeServer: c.activeServer,
85
+ proxyUrl: s
86
+ }), p = await A(S, d);
81
87
  return t.addToolOutput({
82
- tool: U,
88
+ tool: v,
83
89
  toolCallId: r,
84
- output: _,
90
+ output: p,
85
91
  state: "output-available"
86
- }), _;
92
+ }), p;
87
93
  },
88
94
  (e) => o("FAILED_TO_EXECUTE_REQUEST", e)
89
95
  );
@@ -1 +1 @@
1
- {"version":3,"file":"FreeMessagesInfoSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/FreeMessagesInfoSection.vue"],"names":[],"mappings":"AA6PA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"FreeMessagesInfoSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/FreeMessagesInfoSection.vue"],"names":[],"mappings":"AAqPA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./FreeMessagesInfoSection.vue2.js";
2
2
  /* empty css */
3
3
  import e from "../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-593b8dcb"]]);
4
+ const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-913a3815"]]);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,49 +1,51 @@
1
- import { defineComponent as u, ref as p, withDirectives as f, createElementBlock as m, openBlock as g, createElementVNode as e, createVNode as r, createTextVNode as _, unref as c, vShow as w } from "vue";
2
- import { ScalarIconInfo as b, ScalarIconX as h } from "@scalar/icons";
3
- import { useState as v } from "../state/state.js";
4
- const S = { class: "freeMessagesInfoSection" }, x = { class: "infoText flex items-center gap-1.5" }, I = { class: "actionsContainer" }, M = /* @__PURE__ */ u({
1
+ import { defineComponent as r, ref as c, withDirectives as l, createElementBlock as u, openBlock as f, createElementVNode as e, createVNode as n, createTextVNode as _, unref as t, vShow as d } from "vue";
2
+ import { ScalarIconInfo as m, ScalarIconX as p } from "@scalar/icons";
3
+ import { URLS as g } from "../consts/urls.js";
4
+ import { useSignupLink as h } from "../hooks/use-signup-link.js";
5
+ const S = { class: "freeMessagesInfoSection" }, b = { class: "infoText flex items-center gap-1.5" }, k = ["href"], v = { class: "actionsContainer" }, x = ["href"], T = /* @__PURE__ */ r({
5
6
  __name: "FreeMessagesInfoSection",
6
- setup(k) {
7
- const o = p(!1), { dashboardUrl: t, mode: n, uploadedTmpDocumentUrl: s } = v();
8
- function l() {
9
- window.open("https://scalar.com/products/agent/getting-started", "_blank"), n === "full" && window.location.replace(t), n === "preview" && window.location.replace(
10
- s.value ? `${t}/register?flow=oss-agent&docUrl=${s.value}` : t
11
- );
12
- }
13
- function i() {
7
+ setup(C) {
8
+ const o = c(!1), { signupLink: i } = h();
9
+ function a() {
14
10
  o.value = !0;
15
11
  }
16
- return (d, a) => f((g(), m("div", S, [
17
- e("strong", x, [
18
- r(c(b), {
12
+ return (I, s) => l((f(), u("div", S, [
13
+ e("strong", b, [
14
+ n(t(m), {
19
15
  class: "text-blue size-4",
20
16
  weight: "bold"
21
17
  }),
22
- a[0] || (a[0] = _(" Get an API Key to enable Agent Scalar for your docs. ", -1))
18
+ e("a", {
19
+ class: "underline",
20
+ href: t(i),
21
+ target: "_blank"
22
+ }, "Sign up for Agent Scalar", 8, k),
23
+ s[0] || (s[0] = _(" to continue without hitting limits. ", -1))
23
24
  ]),
24
- e("div", I, [
25
- e("button", {
25
+ e("div", v, [
26
+ e("a", {
26
27
  class: "actionButton upgradeButton",
27
- type: "button",
28
- onClick: l
29
- }, " Learn More "),
28
+ href: t(g).AGENT_SCALAR_DOCUMENTATION,
29
+ target: "_blank",
30
+ type: "button"
31
+ }, " Read more ", 8, x),
30
32
  e("button", {
31
33
  "aria-label": "Close",
32
34
  class: "closeButton",
33
35
  type: "button",
34
- onClick: i
36
+ onClick: a
35
37
  }, [
36
- r(c(h), {
38
+ n(t(p), {
37
39
  class: "size-4",
38
40
  weight: "bold"
39
41
  })
40
42
  ])
41
43
  ])
42
44
  ], 512)), [
43
- [w, !o.value]
45
+ [d, !o.value]
44
46
  ]);
45
47
  }
46
48
  });
47
49
  export {
48
- M as default
50
+ T as default
49
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/PaymentSection.vue"],"names":[],"mappings":"AA+TA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"PaymentSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/PaymentSection.vue"],"names":[],"mappings":"AAoSA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./PaymentSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-59a0be07"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7ab1200e"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,34 +1,30 @@
1
- import { defineComponent as d, createElementBlock as p, openBlock as i, createElementVNode as t, createVNode as r, createTextVNode as l, unref as v, createStaticVNode as c } from "vue";
2
- import { ScalarIconInfo as m } from "@scalar/icons";
3
- import { useState as b } from "../state/state.js";
4
- const f = { class: "paymentSection" }, u = { class: "approvalText flex items-center gap-1.5" }, x = /* @__PURE__ */ d({
1
+ import { defineComponent as o, createElementBlock as d, openBlock as i, createElementVNode as e, createVNode as p, createTextVNode as v, unref as t, createStaticVNode as m } from "vue";
2
+ import { ScalarIconInfo as r } from "@scalar/icons";
3
+ import { useSignupLink as c } from "../hooks/use-signup-link.js";
4
+ const l = { class: "paymentSection" }, b = { class: "approvalText flex items-center gap-1.5" }, u = { class: "paymentContainer" }, _ = /* @__PURE__ */ o({
5
5
  __name: "PaymentSection",
6
- setup(y) {
7
- const { dashboardUrl: e, mode: n, uploadedTmpDocumentUrl: s } = b();
8
- function o() {
9
- n === "full" && window.location.replace(e), n === "preview" && window.location.replace(
10
- s.value ? `${e}/register?flow=oss-agent&docUrl=${s.value}` : e
11
- );
12
- }
13
- return (I, a) => (i(), p("div", f, [
14
- t("strong", u, [
15
- r(v(m), {
6
+ setup(f) {
7
+ const { navigateToSignup: n } = c();
8
+ return (y, a) => (i(), d("div", l, [
9
+ e("strong", b, [
10
+ p(t(r), {
16
11
  class: "text-blue size-4",
17
12
  weight: "bold"
18
13
  }),
19
- a[0] || (a[0] = l(" You've used up all your free messages, upgrade for $24/mo. ", -1))
14
+ a[1] || (a[1] = v(" You've reached your free message limit. Unlock unlimited access by upgrading now. ", -1))
20
15
  ]),
21
- t("div", { class: "paymentContainer" }, [
22
- t("button", {
16
+ e("div", u, [
17
+ e("button", {
23
18
  class: "actionButton approveButton",
24
19
  type: "button",
25
- onClick: o
20
+ onClick: a[0] || (a[0] = //@ts-ignore
21
+ (...s) => t(n) && t(n)(...s))
26
22
  }, " Upgrade "),
27
- a[1] || (a[1] = c('<div class="paymentInfo" data-v-59a0be07><h3 data-v-59a0be07>$24 <span data-v-59a0be07>/ month</span></h3><div class="paymentInfoSection" data-v-59a0be07><div class="paymentInfoItem" data-v-59a0be07><span data-v-59a0be07>Members in your workspace</span><span data-v-59a0be07>1</span></div><div class="paymentInfoItem" data-v-59a0be07><span data-v-59a0be07>x $24 / month / member</span><span data-v-59a0be07>$24.00</span></div></div><div class="paymentInfoSection" data-v-59a0be07><div class="paymentInfoItem" data-v-59a0be07><span data-v-59a0be07>Messages</span><span data-v-59a0be07>1,000</span></div><div class="paymentInfoItem" data-v-59a0be07><span data-v-59a0be07>Additional Messages</span><span data-v-59a0be07>+ $0.02 Message</span></div></div></div>', 1))
23
+ a[2] || (a[2] = m('<div class="paymentInfo" data-v-7ab1200e><h3 data-v-7ab1200e>$24 <span data-v-7ab1200e>/ month</span></h3><div class="paymentInfoSection" data-v-7ab1200e><div class="paymentInfoItem" data-v-7ab1200e><span data-v-7ab1200e>Members in your workspace</span><span data-v-7ab1200e>1</span></div><div class="paymentInfoItem" data-v-7ab1200e><span data-v-7ab1200e>x $24 / month / member</span><span data-v-7ab1200e>$24.00</span></div></div><div class="paymentInfoSection" data-v-7ab1200e><div class="paymentInfoItem" data-v-7ab1200e><span data-v-7ab1200e>Messages</span><span data-v-7ab1200e>1,000</span></div><div class="paymentInfoItem" data-v-7ab1200e><span data-v-7ab1200e>Additional Messages</span><span data-v-7ab1200e>+ $0.02 Message</span></div></div></div>', 1))
28
24
  ])
29
25
  ]));
30
26
  }
31
27
  });
32
28
  export {
33
- x as default
29
+ _ as default
34
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ServerSelector.vue.d.ts","sourceRoot":"","sources":["../../src/components/ServerSelector.vue"],"names":[],"mappings":"AA6FA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,aAAa,GAAG;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,2BAA2B;IAC3B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,sSA4Id,CAAC"}
1
+ {"version":3,"file":"ServerSelector.vue.d.ts","sourceRoot":"","sources":["../../src/components/ServerSelector.vue"],"names":[],"mappings":"AAmGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,aAAa,GAAG;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,2BAA2B;IAC3B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,sSAkJd,CAAC"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as m, useId as b, createElementBlock as S, openBlock as d, Fragment as f, createElementVNode as n, createVNode as x, createBlock as c, createCommentVNode as o, normalizeClass as k, unref as l } from "vue";
2
- import { ServerVariablesForm as B } from "@scalar/api-client/components/Server";
3
- import { ScalarMarkdown as V } from "@scalar/components";
4
- import g from "./Selector.vue.js";
5
- const y = ["id"], C = {}, I = /* @__PURE__ */ m({
1
+ import { defineComponent as m, useId as b, createElementBlock as S, openBlock as d, Fragment as f, createElementVNode as n, createVNode as x, createBlock as c, createCommentVNode as o, normalizeClass as y, unref as l } from "vue";
2
+ import { ServerVariablesForm as k } from "@scalar/api-client/components/Server";
3
+ import { ScalarMarkdown as B } from "@scalar/components";
4
+ import V from "./Selector.vue.js";
5
+ const g = ["id"], C = {}, I = /* @__PURE__ */ m({
6
6
  ...C,
7
7
  __name: "ServerSelector",
8
8
  props: {
@@ -11,40 +11,46 @@ const y = ["id"], C = {}, I = /* @__PURE__ */ m({
11
11
  servers: {}
12
12
  },
13
13
  setup(e) {
14
- const s = b(), v = (r) => {
14
+ const a = b(), u = (r) => {
15
15
  e.eventBus.emit("server:update:selected", {
16
- url: e.selectedServer?.url === r ? "" : r
16
+ url: e.selectedServer?.url === r ? "" : r,
17
+ meta: {
18
+ type: "document"
19
+ }
17
20
  });
18
- }, i = (r, t) => {
19
- const a = e.servers.findIndex((u) => u.url === e.selectedServer?.url);
20
- a !== -1 && e.eventBus.emit("server:update:variables", {
21
- index: a,
21
+ }, v = (r, t) => {
22
+ const s = e.servers.findIndex((i) => i.url === e.selectedServer?.url);
23
+ s !== -1 && e.eventBus.emit("server:update:variables", {
24
+ index: s,
22
25
  key: r,
23
- value: t
26
+ value: t,
27
+ meta: {
28
+ type: "document"
29
+ }
24
30
  });
25
31
  };
26
32
  return (r, t) => (d(), S(f, null, [
27
33
  t[0] || (t[0] = n("label", { class: "bg-b-2 flex h-8 items-center rounded-t-xl border border-b-0 px-3 py-2.5 font-medium" }, " Server ", -1)),
28
34
  n("div", {
29
- id: l(s),
30
- class: k(["border", {
35
+ id: l(a),
36
+ class: y(["border", {
31
37
  "rounded-b-xl": !e.selectedServer?.description && !e.selectedServer?.variables
32
38
  }])
33
39
  }, [
34
- e.servers.length ? (d(), c(g, {
40
+ e.servers.length ? (d(), c(V, {
35
41
  key: 0,
36
42
  selectedServer: e.selectedServer,
37
43
  servers: e.servers,
38
- target: l(s),
39
- "onUpdate:modelValue": v
44
+ target: l(a),
45
+ "onUpdate:modelValue": u
40
46
  }, null, 8, ["selectedServer", "servers", "target"])) : o("", !0)
41
- ], 10, y),
42
- x(l(B), {
47
+ ], 10, g),
48
+ x(l(k), {
43
49
  layout: "reference",
44
50
  variables: e.selectedServer?.variables,
45
- "onUpdate:variable": i
51
+ "onUpdate:variable": v
46
52
  }, null, 8, ["variables"]),
47
- e.selectedServer?.description ? (d(), c(l(V), {
53
+ e.selectedServer?.description ? (d(), c(l(B), {
48
54
  key: 0,
49
55
  class: "text-c-3 rounded-b-xl border border-t-0 px-3 py-1.5",
50
56
  value: e.selectedServer.description
@@ -1,7 +1,7 @@
1
1
  import o from "./UploadSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f9d3a579"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9551cf83"]]);
5
5
  export {
6
- f as default
6
+ c as default
7
7
  };