@pagelines/sdk 1.0.758 → 1.0.760

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 (40) hide show
  1. package/dist/AgentProvider.js +251 -235
  2. package/dist/AgentProvider.js.map +1 -1
  3. package/dist/AgentWidgetModal.js +184 -29
  4. package/dist/AgentWidgetModal.js.map +1 -1
  5. package/dist/AgentWrap.js +821 -613
  6. package/dist/AgentWrap.js.map +1 -1
  7. package/dist/agent/AgentController.d.ts +82 -22
  8. package/dist/agent/index.d.ts +4 -2
  9. package/dist/agent/schema.d.ts +2 -17
  10. package/dist/agent/ui/AgentAvatar.vue.d.ts +2 -0
  11. package/dist/agent/ui/AgentChat.vue.d.ts +7 -0
  12. package/dist/agent/ui/AgentProvider.vue.d.ts +4 -0
  13. package/dist/agent/ui/ElCreateAgent.vue.d.ts +8 -0
  14. package/dist/agent/ui/{AgentModal.vue.d.ts → VoiceMode.vue.d.ts} +7 -10
  15. package/dist/agent/utils.d.ts +0 -4
  16. package/dist/agent/voice/provider.d.ts +28 -0
  17. package/dist/agent/voice/providers/elevenlabs/provider.d.ts +30 -0
  18. package/dist/agent/voice/providers/livekit/provider.d.ts +55 -0
  19. package/dist/agent/voice/voice-session-client.d.ts +49 -0
  20. package/dist/agent.js +168 -74
  21. package/dist/agent.js.map +1 -1
  22. package/dist/clients/ChatClient.d.ts +1 -9
  23. package/dist/contract.js +1756 -1664
  24. package/dist/contract.js.map +1 -1
  25. package/dist/demo/index.d.ts +4 -0
  26. package/dist/provider.js +40 -0
  27. package/dist/provider.js.map +1 -0
  28. package/dist/provider2.js +16451 -0
  29. package/dist/provider2.js.map +1 -0
  30. package/dist/provider3.js +18439 -0
  31. package/dist/provider3.js.map +1 -0
  32. package/dist/sdk.css +1 -1
  33. package/dist/sdkClient.d.ts +17 -0
  34. package/dist/sdkClient.js +37 -47
  35. package/dist/sdkClient.js.map +1 -1
  36. package/dist/widget/composables/useWidgetState.d.ts +12 -0
  37. package/dist/widget.js +23 -23
  38. package/package.json +3 -1
  39. package/dist/FModal.js +0 -165
  40. package/dist/FModal.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagelines/sdk",
3
- "version": "1.0.758",
3
+ "version": "1.0.760",
4
4
  "description": "PageLines SDK for agent management, auth, and billing",
5
5
  "type": "module",
6
6
  "main": "./dist/sdk.js",
@@ -59,7 +59,9 @@
59
59
  "vue": "^3.5.0"
60
60
  },
61
61
  "dependencies": {
62
+ "@elevenlabs/client": "^1.17.0",
62
63
  "dompurify": "3.4.12",
64
+ "livekit-client": "^2.21.0",
63
65
  "marked": "^18.0.7",
64
66
  "nanostores": "^1.4.1",
65
67
  "zod": "^4.4.3",
package/dist/FModal.js DELETED
@@ -1,165 +0,0 @@
1
- import "./rolldown-runtime.js";
2
- import { Teleport as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, normalizeClass as u, normalizeProps as d, onMounted as f, onUnmounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y, withModifiers as b } from "vue";
3
- //#region ui/FClose.vue?vue&type=script&setup=true&lang.ts
4
- var x = ["aria-label"], S = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden" }, C = /* @__PURE__ */ c({
5
- name: "FClose",
6
- __name: "FClose",
7
- props: { ariaLabel: {} },
8
- emits: ["click"],
9
- setup(e) {
10
- let t = h(!1);
11
- return f(() => {
12
- setTimeout(() => {
13
- t.value = !0;
14
- }, 100);
15
- }), (n, r) => (m(), a("button", {
16
- type: "button",
17
- "aria-label": e.ariaLabel || "Close",
18
- class: "close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90",
19
- onClick: r[0] || (r[0] = (e) => n.$emit("click", e))
20
- }, [r[1] || (r[1] = o("span", { class: "absolute inset-0 rounded-full transition-all" }, null, -1)), o("span", S, [o("span", {
21
- class: u(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 rotate-45" : "translate-y-[30px] -translate-x-[30px] rotate-0"]),
22
- style: {
23
- "background-color": "currentColor",
24
- "transition-delay": "0.15s"
25
- }
26
- }, null, 2), o("span", {
27
- class: u(["absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]", t.value ? "translate-y-0 translate-x-0 -rotate-45" : "-translate-y-[30px] -translate-x-[30px] rotate-0"]),
28
- style: {
29
- "background-color": "currentColor",
30
- "transition-delay": "0.45s"
31
- }
32
- }, null, 2)])], 8, x));
33
- }
34
- }), w = { class: "flex min-h-full items-center justify-center text-center p-4" }, T = {
35
- key: 0,
36
- class: "text-base p-4 font-semibold"
37
- }, E = {
38
- key: 1,
39
- class: "flex items-center gap-2 px-2"
40
- }, D = /* @__PURE__ */ c({
41
- inheritAttrs: !1,
42
- name: "FModal",
43
- __name: "FModal",
44
- props: {
45
- vis: {
46
- type: Boolean,
47
- default: !1
48
- },
49
- modalClass: {},
50
- styleClass: {},
51
- fullScreen: {
52
- type: Boolean,
53
- default: !1
54
- },
55
- hasClose: {
56
- type: Boolean,
57
- default: !1
58
- },
59
- title: { default: "" },
60
- transitionMode: { default: "modal" },
61
- teleportTo: { default: "body" },
62
- disableTeleport: {
63
- type: Boolean,
64
- default: !1
65
- }
66
- },
67
- emits: [
68
- "update:vis",
69
- "close",
70
- "escape"
71
- ],
72
- setup(c, { emit: x }) {
73
- let S = x, D = h(!1);
74
- function close(e) {
75
- let { reason: t } = e;
76
- S("update:vis", !1), S("close", !0), t === "escape" && S("escape", !0);
77
- }
78
- let O = n(() => {
79
- let e = c.modalClass ? [c.modalClass] : ["max-w-screen-md p-24"], t = c.styleClass ? [c.styleClass] : ["bg-theme-0", "shadow-xl"];
80
- return c.fullScreen ? e.push("fixed inset-0") : e.push("rounded-2xl"), [
81
- "relative",
82
- "text-left",
83
- "transform",
84
- "transition-all",
85
- "w-full",
86
- "overflow-hidden",
87
- ...e,
88
- ...t
89
- ];
90
- }), k = h(!1), A = [];
91
- function onKeydown(e) {
92
- e.key === "Escape" && c.vis && close({ reason: "escape" });
93
- }
94
- f(async () => {
95
- D.value = !0;
96
- let e = v(() => c.vis, (e) => {
97
- e ? setTimeout(() => k.value = !0, 300) : k.value = !1;
98
- }, { immediate: !0 });
99
- A.push(e), typeof document < "u" && (document.addEventListener("keydown", onKeydown), A.push(() => document.removeEventListener("keydown", onKeydown)));
100
- }), p(() => {
101
- A.forEach((e) => e());
102
- });
103
- let j = n(() => c.transitionMode === "slideUp" ? {
104
- enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
105
- enterFromClass: "opacity-0 translate-y-full scale-95",
106
- enterToClass: "opacity-100 translate-y-0 scale-100",
107
- leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
108
- leaveFromClass: "opacity-100 translate-y-0 scale-100",
109
- leaveToClass: "opacity-0 translate-y-full scale-95"
110
- } : {
111
- enterActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
112
- enterFromClass: "opacity-0 scale-75",
113
- enterToClass: "opacity-100 translate-y-0 scale-100",
114
- leaveActiveClass: "ease-[cubic-bezier(0.25,1,0.33,1)] duration-500",
115
- leaveFromClass: "opacity-100 translate-y-0 scale-100",
116
- leaveToClass: "opacity-0 scale-75"
117
- });
118
- return (n, f) => D.value ? (m(), r(e, {
119
- key: 0,
120
- to: c.teleportTo,
121
- disabled: c.disableTeleport
122
- }, [o("div", {
123
- class: u(["fixed inset-0 z-50", c.vis ? "" : "pointer-events-none"]),
124
- "aria-labelledby": "modal-title",
125
- role: "dialog",
126
- "aria-modal": "true"
127
- }, [s(t, {
128
- "enter-active-class": "ease-out duration-300",
129
- "enter-from-class": "opacity-0",
130
- "enter-to-class": "opacity-100",
131
- "leave-active-class": "ease-in duration-200",
132
- "leave-from-class": "opacity-100",
133
- "leave-to-class": "opacity-0"
134
- }, {
135
- default: y(() => [c.vis ? (m(), a("div", {
136
- key: 0,
137
- class: "fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity",
138
- onClick: f[0] || (f[0] = (e) => close({ reason: "escape" }))
139
- })) : i("", !0)]),
140
- _: 1
141
- }), o("div", {
142
- class: "fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar",
143
- onClick: f[3] || (f[3] = (e) => close({ reason: "escape" }))
144
- }, [o("div", w, [s(t, d(l(j.value)), {
145
- default: y(() => [c.vis ? (m(), a("div", {
146
- key: 0,
147
- class: u([O.value, "w-full"]),
148
- onClick: f[2] || (f[2] = b(() => {}, ["stop"]))
149
- }, [c.hasClose || c.title || n.$slots.actions ? (m(), a("div", {
150
- key: 0,
151
- class: u(!c.title && (c.hasClose || n.$slots.actions) ? "absolute top-0 right-0 z-10" : "flex justify-between items-center")
152
- }, [c.title ? (m(), a("h2", T, _(c.title), 1)) : i("", !0), c.hasClose || n.$slots.actions ? (m(), a("div", E, [g(n.$slots, "actions"), c.hasClose ? (m(), r(C, {
153
- key: 0,
154
- class: "relative",
155
- "data-test-id": "close-modal",
156
- onClick: f[1] || (f[1] = b((e) => close({ reason: "escape" }), ["stop"]))
157
- })) : i("", !0)])) : i("", !0)], 2)) : i("", !0), g(n.$slots, "default")], 2)) : i("", !0)]),
158
- _: 3
159
- }, 16)])])], 2)], 8, ["to", "disabled"])) : i("", !0);
160
- }
161
- });
162
- //#endregion
163
- export { D as t };
164
-
165
- //# sourceMappingURL=FModal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FModal.js","names":["$emit","$slots"],"sources":["../ui/FClose.vue","../ui/FClose.vue","../ui/FModal.vue","../ui/FModal.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n// SDK-local copy of src/ui/common/FClose.vue — the SDK package must not\n// import app source, so the primitives it needs live here.\nimport { onMounted, ref } from 'vue'\n\ndefineOptions({ name: 'FClose' })\n\ndefineProps<{\n ariaLabel?: string\n}>()\n\ndefineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst inView = ref(false)\n\nonMounted(() => {\n setTimeout(() => {\n inView.value = true\n }, 100)\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :aria-label=\"ariaLabel || 'Close'\"\n class=\"close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90\"\n @click=\"$emit('click', $event)\"\n >\n <!-- Background circle (invisible, for hover area) -->\n <span class=\"absolute inset-0 rounded-full transition-all\" />\n\n <!-- Close lines container -->\n <span class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden\">\n <!-- Line 1 - animates from bottom-left to center, rotates 45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 rotate-45' : 'translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.15s\"\n />\n\n <!-- Line 2 - animates from top-left to center, rotates -45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 -rotate-45' : '-translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.45s\"\n />\n </span>\n </button>\n</template>\n","<script lang=\"ts\" setup>\n// SDK-local copy of src/ui/common/FClose.vue — the SDK package must not\n// import app source, so the primitives it needs live here.\nimport { onMounted, ref } from 'vue'\n\ndefineOptions({ name: 'FClose' })\n\ndefineProps<{\n ariaLabel?: string\n}>()\n\ndefineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst inView = ref(false)\n\nonMounted(() => {\n setTimeout(() => {\n inView.value = true\n }, 100)\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :aria-label=\"ariaLabel || 'Close'\"\n class=\"close block cursor-pointer w-[60px] h-[60px] rounded-full transition-all duration-1000 ease-[cubic-bezier(0.25,1,0.33,1)] hover:scale-110 active:scale-90 hover:rotate-90\"\n @click=\"$emit('click', $event)\"\n >\n <!-- Background circle (invisible, for hover area) -->\n <span class=\"absolute inset-0 rounded-full transition-all\" />\n\n <!-- Close lines container -->\n <span class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[28px] h-[28px] overflow-hidden\">\n <!-- Line 1 - animates from bottom-left to center, rotates 45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 rotate-45' : 'translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.15s\"\n />\n\n <!-- Line 2 - animates from top-left to center, rotates -45deg -->\n <span\n class=\"absolute h-full w-[3px] rounded-[5px] left-[13px] transition-all duration-[400ms] ease-[cubic-bezier(0.52,0.01,0.16,1)]\"\n :class=\"inView ? 'translate-y-0 translate-x-0 -rotate-45' : '-translate-y-[30px] -translate-x-[30px] rotate-0'\"\n style=\"background-color: currentColor; transition-delay: 0.45s\"\n />\n </span>\n </button>\n</template>\n","<script lang=\"ts\" setup>\n// SDK-local copy of src/ui/common/FModal.vue — the SDK package must not\n// import app source, so the primitives it needs live here.\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport FClose from './FClose.vue'\n\ndefineOptions({ name: 'FModal' })\n\nconst {\n vis = false,\n modalClass,\n styleClass,\n fullScreen = false,\n hasClose = false,\n title = '',\n transitionMode = 'modal',\n teleportTo = 'body',\n disableTeleport = false,\n} = defineProps<{\n vis?: boolean\n modalClass?: string\n styleClass?: string\n fullScreen?: boolean\n hasClose?: boolean\n title?: string\n transitionMode?: 'modal' | 'slideUp'\n teleportTo?: string | Element\n disableTeleport?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n 'close': [value: boolean]\n 'escape': [value: boolean]\n}>()\n\nconst isMounted = ref(false)\n\nfunction close(args: { reason: 'escape' | 'reset' }): void {\n const { reason } = args\n emit('update:vis', false)\n emit('close', true)\n if (reason === 'escape')\n emit('escape', true)\n}\n\nconst classes = computed(() => {\n const cls = modalClass ? [modalClass] : ['max-w-screen-md p-24']\n const style = styleClass ? [styleClass] : ['bg-theme-0', 'shadow-xl']\n\n if (fullScreen)\n cls.push('fixed inset-0')\n else\n cls.push('rounded-2xl')\n\n return [\n 'relative',\n 'text-left',\n 'transform',\n 'transition-all',\n 'w-full',\n 'overflow-hidden',\n ...cls,\n ...style,\n ]\n})\n\nconst afterVisible = ref(false)\nconst cleanups: (() => void)[] = []\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && vis)\n close({ reason: 'escape' })\n}\n\nonMounted(async () => {\n isMounted.value = true\n\n const unwatch = watch(\n () => vis,\n (vis) => {\n if (vis) {\n setTimeout(() => (afterVisible.value = true), 300)\n } else {\n afterVisible.value = false\n }\n },\n { immediate: true },\n )\n\n cleanups.push(unwatch)\n\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', onKeydown)\n cleanups.push(() => document.removeEventListener('keydown', onKeydown))\n }\n})\n\nonUnmounted(() => {\n cleanups.forEach((c) => c())\n})\n\nconst modalTransition = computed(() => {\n if (transitionMode === 'slideUp') {\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 translate-y-full scale-95',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 translate-y-full scale-95',\n }\n }\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 scale-75',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 scale-75',\n }\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<template>\n <Teleport v-if=\"isMounted\" :to=\"teleportTo\" :disabled=\"disableTeleport\">\n <div\n class=\"fixed inset-0 z-50\"\n aria-labelledby=\"modal-title\"\n role=\"dialog\"\n aria-modal=\"true\"\n :class=\"!vis ? 'pointer-events-none' : ''\"\n >\n <Transition\n enter-active-class=\"ease-out duration-300\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-200\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"vis\"\n class=\"fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity\"\n @click=\"close({ reason: 'escape' })\"\n />\n </Transition>\n <div\n class=\"fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar\"\n @click=\"close({ reason: 'escape' })\"\n >\n <!-- min-h-full, never h-full: a taller-than-viewport panel must grow this\n row so the outer layer scrolls; h-full + items-center centers the\n overflow and clips the modal top unreachably. p-4 = the 1em minimum\n viewport gap for tall modals. -->\n <div class=\"flex min-h-full items-center justify-center text-center p-4\">\n <Transition v-bind=\"modalTransition\">\n <div\n v-if=\"vis\"\n :class=\"classes\"\n class=\"w-full\"\n @click.stop\n >\n <div\n v-if=\"hasClose || title || $slots.actions\"\n :class=\"!title && (hasClose || $slots.actions) ? 'absolute top-0 right-0 z-10' : 'flex justify-between items-center'\"\n >\n <h2 v-if=\"title\" class=\"text-base p-4 font-semibold\">\n {{ title }}\n </h2>\n <div v-if=\"hasClose || $slots.actions\" class=\"flex items-center gap-2 px-2\">\n <slot name=\"actions\" />\n <FClose\n v-if=\"hasClose\"\n class=\"relative\"\n data-test-id=\"close-modal\"\n @click.stop=\"close({ reason: 'escape' })\"\n />\n </div>\n </div>\n <slot />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n","<script lang=\"ts\" setup>\n// SDK-local copy of src/ui/common/FModal.vue — the SDK package must not\n// import app source, so the primitives it needs live here.\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport FClose from './FClose.vue'\n\ndefineOptions({ name: 'FModal' })\n\nconst {\n vis = false,\n modalClass,\n styleClass,\n fullScreen = false,\n hasClose = false,\n title = '',\n transitionMode = 'modal',\n teleportTo = 'body',\n disableTeleport = false,\n} = defineProps<{\n vis?: boolean\n modalClass?: string\n styleClass?: string\n fullScreen?: boolean\n hasClose?: boolean\n title?: string\n transitionMode?: 'modal' | 'slideUp'\n teleportTo?: string | Element\n disableTeleport?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n 'close': [value: boolean]\n 'escape': [value: boolean]\n}>()\n\nconst isMounted = ref(false)\n\nfunction close(args: { reason: 'escape' | 'reset' }): void {\n const { reason } = args\n emit('update:vis', false)\n emit('close', true)\n if (reason === 'escape')\n emit('escape', true)\n}\n\nconst classes = computed(() => {\n const cls = modalClass ? [modalClass] : ['max-w-screen-md p-24']\n const style = styleClass ? [styleClass] : ['bg-theme-0', 'shadow-xl']\n\n if (fullScreen)\n cls.push('fixed inset-0')\n else\n cls.push('rounded-2xl')\n\n return [\n 'relative',\n 'text-left',\n 'transform',\n 'transition-all',\n 'w-full',\n 'overflow-hidden',\n ...cls,\n ...style,\n ]\n})\n\nconst afterVisible = ref(false)\nconst cleanups: (() => void)[] = []\n\nfunction onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && vis)\n close({ reason: 'escape' })\n}\n\nonMounted(async () => {\n isMounted.value = true\n\n const unwatch = watch(\n () => vis,\n (vis) => {\n if (vis) {\n setTimeout(() => (afterVisible.value = true), 300)\n } else {\n afterVisible.value = false\n }\n },\n { immediate: true },\n )\n\n cleanups.push(unwatch)\n\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', onKeydown)\n cleanups.push(() => document.removeEventListener('keydown', onKeydown))\n }\n})\n\nonUnmounted(() => {\n cleanups.forEach((c) => c())\n})\n\nconst modalTransition = computed(() => {\n if (transitionMode === 'slideUp') {\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 translate-y-full scale-95',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 translate-y-full scale-95',\n }\n }\n return {\n enterActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n enterFromClass: 'opacity-0 scale-75',\n enterToClass: 'opacity-100 translate-y-0 scale-100',\n leaveActiveClass: 'ease-[cubic-bezier(0.25,1,0.33,1)] duration-500',\n leaveFromClass: 'opacity-100 translate-y-0 scale-100',\n leaveToClass: 'opacity-0 scale-75',\n }\n})\n</script>\n\n<script lang=\"ts\">\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<template>\n <Teleport v-if=\"isMounted\" :to=\"teleportTo\" :disabled=\"disableTeleport\">\n <div\n class=\"fixed inset-0 z-50\"\n aria-labelledby=\"modal-title\"\n role=\"dialog\"\n aria-modal=\"true\"\n :class=\"!vis ? 'pointer-events-none' : ''\"\n >\n <Transition\n enter-active-class=\"ease-out duration-300\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"ease-in duration-200\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"vis\"\n class=\"fixed inset-0 bg-theme-800/60 active:bg-theme-800/80 cursor-pointer dark:bg-theme-600/90 backdrop-blur-sm transition-opacity\"\n @click=\"close({ reason: 'escape' })\"\n />\n </Transition>\n <div\n class=\"fixed inset-0 z-40 overflow-y-auto overscroll-contain no-scrollbar\"\n @click=\"close({ reason: 'escape' })\"\n >\n <!-- min-h-full, never h-full: a taller-than-viewport panel must grow this\n row so the outer layer scrolls; h-full + items-center centers the\n overflow and clips the modal top unreachably. p-4 = the 1em minimum\n viewport gap for tall modals. -->\n <div class=\"flex min-h-full items-center justify-center text-center p-4\">\n <Transition v-bind=\"modalTransition\">\n <div\n v-if=\"vis\"\n :class=\"classes\"\n class=\"w-full\"\n @click.stop\n >\n <div\n v-if=\"hasClose || title || $slots.actions\"\n :class=\"!title && (hasClose || $slots.actions) ? 'absolute top-0 right-0 z-10' : 'flex justify-between items-center'\"\n >\n <h2 v-if=\"title\" class=\"text-base p-4 font-semibold\">\n {{ title }}\n </h2>\n <div v-if=\"hasClose || $slots.actions\" class=\"flex items-center gap-2 px-2\">\n <slot name=\"actions\" />\n <FClose\n v-if=\"hasClose\"\n class=\"relative\"\n data-test-id=\"close-modal\"\n @click.stop=\"close({ reason: 'escape' })\"\n />\n </div>\n </div>\n <slot />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;EAeA,IAAM,IAAS,EAAI,EAAK;SAExB,QAAgB;GACd,iBAAiB;IACf,EAAO,QAAQ;GACjB,GAAG,GAAG;EACR,CAAC,mBAIC,EAyBS,UAAA;GAxBP,MAAK;GACJ,cAAY,EAAA,aAAS;GACtB,OAAM;GACL,SAAK,EAAA,OAAA,EAAA,MAAA,MAAEA,EAAAA,MAAK,SAAU,CAAM;sBAG7B,EAA6D,QAAA,EA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