@8wave/ai-elements 0.117.0-beta.29 → 0.117.0-beta.30

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 (23) hide show
  1. package/dist/_chunks/PkToolShowVideo-C5RfIsFU.js +141 -0
  2. package/dist/_chunks/PkToolShowVideo-C5RfIsFU.js.map +1 -0
  3. package/dist/ai-elements.es.js +1 -1
  4. package/dist-vue/PkChatbot.js +1 -1
  5. package/dist-vue/PkChatbotMessages.js +1 -1
  6. package/dist-vue/PkChatbotViewChat.js +1 -1
  7. package/dist-vue/_chunks/{PkChatbot-BsTXbdI2.js → PkChatbot-DP2XuKXf.js} +2 -2
  8. package/dist-vue/_chunks/{PkChatbot-BsTXbdI2.js.map → PkChatbot-DP2XuKXf.js.map} +1 -1
  9. package/dist-vue/_chunks/{PkChatbotMessages-BDh_t2MT.js → PkChatbotMessages-CVefdmkP.js} +3 -3
  10. package/dist-vue/_chunks/{PkChatbotMessages-BDh_t2MT.js.map → PkChatbotMessages-CVefdmkP.js.map} +1 -1
  11. package/dist-vue/_chunks/{PkChatbotViewChat-Cd5t_ESd.js → PkChatbotViewChat-BOankj81.js} +3 -3
  12. package/dist-vue/_chunks/{PkChatbotViewChat-Cd5t_ESd.js.map → PkChatbotViewChat-BOankj81.js.map} +1 -1
  13. package/dist-vue/_chunks/{PkToolShowDiagram-ysQaeMuo.js → PkToolShowDiagram-CjtKqj4N.js} +2 -2
  14. package/dist-vue/_chunks/{PkToolShowDiagram-ysQaeMuo.js.map → PkToolShowDiagram-CjtKqj4N.js.map} +1 -1
  15. package/dist-vue/_chunks/PkToolShowVideo-Cw2QqlRI.js +140 -0
  16. package/dist-vue/_chunks/PkToolShowVideo-Cw2QqlRI.js.map +1 -0
  17. package/dist-vue/index.js +7 -7
  18. package/dist-vue/index.js.map +1 -1
  19. package/package.json +1 -1
  20. package/dist/_chunks/PkToolShowVideo-he5c61Er.js +0 -142
  21. package/dist/_chunks/PkToolShowVideo-he5c61Er.js.map +0 -1
  22. package/dist-vue/_chunks/PkToolShowVideo-DNqbPNq7.js +0 -141
  23. package/dist-vue/_chunks/PkToolShowVideo-DNqbPNq7.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8wave/ai-elements",
3
3
  "private": false,
4
- "version": "0.117.0-beta.29",
4
+ "version": "0.117.0-beta.30",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --port 8082 --open --host",
@@ -1,142 +0,0 @@
1
- import { C as e, Ct as t, Dt as n, L as r, O as i, St as a, _ as o, d as s, h as c, it as l, m as u, v as d, x as f, z as p } from "./vue.runtime.esm-bundler-DKVd2gci.js";
2
- import "./src-Dt4rhhPN.js";
3
- import { t as m } from "./index.es-dTcgyeM4.js";
4
- import { n as h } from "./chatImagePolicy-CiUR4uD1.js";
5
- import { t as g } from "./PkHeldImage-eNPFmmdh.js";
6
- //#region ../../packages/utils/src/video-source.ts
7
- var _ = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), v = (e, t) => e === t || e.endsWith(`.${t}`), y = (e) => {
8
- if (e.hostname.endsWith("youtu.be")) return _(e.pathname.split("/")[1] ?? "") || null;
9
- let t = e.searchParams.get("v");
10
- if (t) return _(t) || null;
11
- let n = e.pathname.match(/^\/(?:shorts|live|embed|v)\/([^/?#]+)/);
12
- return n && _(n[1]) || null;
13
- }, b = (e) => {
14
- let t = e.pathname.match(/(?:^|\/)(\d+)(?:$|[/?#])/);
15
- return t ? t[1] : null;
16
- };
17
- function x(e, t) {
18
- let n;
19
- try {
20
- n = new URL(e);
21
- } catch {
22
- return {
23
- provider: "file",
24
- url: e,
25
- embedUrl: e
26
- };
27
- }
28
- let r = n.hostname.toLowerCase();
29
- if (v(r, "youtube.com") || v(r, "youtu.be") || v(r, "youtube-nocookie.com")) {
30
- let t = y(n);
31
- if (t) return {
32
- provider: "youtube",
33
- url: e,
34
- videoId: t,
35
- embedUrl: `https://www.youtube-nocookie.com/embed/${t}`,
36
- thumbnailUrl: `https://img.youtube.com/vi/${t}/hqdefault.jpg`
37
- };
38
- }
39
- if (v(r, "vimeo.com")) {
40
- let t = b(n);
41
- if (t) return {
42
- provider: "vimeo",
43
- url: e,
44
- videoId: t,
45
- embedUrl: `https://player.vimeo.com/video/${t}?dnt=1`
46
- };
47
- }
48
- return t && t !== "file" ? {
49
- provider: t,
50
- url: e,
51
- embedUrl: e
52
- } : {
53
- provider: "file",
54
- url: e,
55
- embedUrl: e
56
- };
57
- }
58
- //#endregion
59
- //#region ../../packages/components/src/chat/PkToolShowVideo.vue?vue&type=script&setup=true&lang.ts
60
- i(), t(), l();
61
- var S = {
62
- key: 0,
63
- class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface"
64
- }, C = { class: "px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40" }, w = { class: "font-bold" }, T = { class: "p-sm flex flex-col gap-16" }, E = {
65
- key: 0,
66
- class: "font-bold text-14 mb-sm"
67
- }, D = {
68
- key: 1,
69
- class: "w-full rounded-xl overflow-hidden",
70
- style: { "aspect-ratio": "16 / 9" }
71
- }, O = ["src", "poster"], k = ["href"], A = {
72
- key: 3,
73
- class: "relative w-full overflow-hidden rounded-xl bg-word-1",
74
- style: { "aspect-ratio": "16 / 9" }
75
- }, j = ["src", "title"], M = {
76
- key: 4,
77
- class: "text-12 text-word-3 mt-sm"
78
- }, N = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", P = /* @__PURE__ */ e({
79
- __name: "PkToolShowVideo",
80
- props: { part: { type: null } },
81
- setup(e) {
82
- let t = e, i = ["www.youtube-nocookie.com", "player.vimeo.com"], l = h(), _ = u(() => (t.part.input?.videos ?? []).map((e) => {
83
- let t = x(e.url, e.provider), n = (t.provider === "file" ? [t.embedUrl, e.poster] : [t.embedUrl]).filter((e) => !!e && !i.includes(l.hostOf(e) ?? ""));
84
- return {
85
- ...e,
86
- source: t,
87
- gated: n,
88
- held: n.some((e) => !l.canLoad(e))
89
- };
90
- }));
91
- function v(e) {
92
- for (let t of e) l.release(t);
93
- }
94
- return (e, t) => {
95
- let i = m;
96
- return _.value.length ? (r(), d("div", S, [c("div", C, [f(i, {
97
- name: "ri:film-line",
98
- class: "text-16"
99
- }), c("strong", w, n(e.$t("label.video")), 1)]), c("div", T, [(r(!0), d(s, null, p(_.value, (e) => (r(), d("div", {
100
- key: e.url,
101
- class: "flex flex-col"
102
- }, [
103
- e.title ? (r(), d("strong", E, n(e.title), 1)) : o("", !0),
104
- e.held ? (r(), d("div", D, [f(g, {
105
- host: a(l).hostOf(e.gated[0]),
106
- kind: "video",
107
- fill: "",
108
- onRelease: (t) => v(e.gated)
109
- }, null, 8, ["host", "onRelease"])])) : e.source.provider === "file" ? (r(), d("video", {
110
- key: 2,
111
- src: e.source.embedUrl,
112
- poster: e.poster,
113
- controls: "",
114
- preload: "metadata",
115
- playsinline: "",
116
- class: "w-full rounded-xl bg-word-1",
117
- style: {
118
- "aspect-ratio": "16 / 9",
119
- "max-height": "480px"
120
- }
121
- }, [c("a", {
122
- href: e.url,
123
- target: "_blank",
124
- rel: "noopener noreferrer"
125
- }, n(e.title ?? e.url), 9, k)], 8, O)) : (r(), d("div", A, [c("iframe", {
126
- src: e.source.embedUrl,
127
- title: e.title ?? e.url,
128
- loading: "lazy",
129
- referrerpolicy: "strict-origin-when-cross-origin",
130
- allow: N,
131
- allowfullscreen: "",
132
- class: "absolute inset-0 w-full h-full border-0"
133
- }, null, 8, j)])),
134
- e.description ? (r(), d("span", M, n(e.description), 1)) : o("", !0)
135
- ]))), 128))])])) : o("", !0);
136
- };
137
- }
138
- });
139
- //#endregion
140
- export { P as default };
141
-
142
- //# sourceMappingURL=PkToolShowVideo-he5c61Er.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PkToolShowVideo-he5c61Er.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_Fragment","_renderList","_createCommentVNode","PkHeldImage","_unref","_sfc_main","defineComponent","init_shared_esm_bundler","toDisplayString","openBlock","init_runtime_core_esm_bundler","unref","createCommentVNode","Fragment","createBaseVNode","init_reactivity_esm_bundler","computed","createElementBlock","createVNode","renderList","Ae","useChatImageGate","PkHeldImage_default","sanitizeId","raw","hostMatches","host","domain","youtubeId","u","v","m","vimeoId","parseVideoSource","url","id","hint","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","IFRAME_ALLOW","PkToolShowVideo_default","props","__props","PLAYER_HOSTS","imageGate","videos","source","video","gated","src","release","urls","_component_VvIcon","_ctx"],"sources":["../../../../packages/utils/src/video-source.ts","../../../../packages/components/src/chat/PkToolShowVideo.vue","../../../../packages/components/src/chat/PkToolShowVideo.vue"],"sourcesContent":["/**\n * Video source parsing shared by the backend platform renderer and the frontend\n * player component, so both classify a video URL the same way.\n *\n * A URL is either a known provider (YouTube/Vimeo), which plays through the\n * provider's iframe embed, or a direct media file (`file`), which plays in a\n * native `<video>` element. Detection is by URL shape; an explicit `hint` is\n * used only as a fallback when the URL alone is inconclusive.\n */\n\nexport type VideoProvider = 'youtube' | 'vimeo' | 'file'\n\nexport interface ParsedVideoSource {\n provider: VideoProvider\n /** The original URL, unchanged. */\n url: string\n /**\n * The URL to actually load: the provider iframe embed URL for\n * YouTube/Vimeo, or the direct file URL for `file`.\n */\n embedUrl: string\n /** The provider video id (providers only). */\n videoId?: string\n /**\n * A preview image URL derived from the provider, when one is available\n * without an extra API call (currently YouTube only). Lets a link-only\n * surface (e.g. a Teams card) show a thumbnail instead of a bare link.\n */\n thumbnailUrl?: string\n}\n\n/** Keep only characters that are legal in a provider video id. */\nconst sanitizeId = (raw: string): string => raw.replace(/[^a-zA-Z0-9_-]/g, '')\n\n/**\n * True when `host` is exactly `domain` or a subdomain of it. Guards against\n * lookalike hosts (e.g. `notyoutube.com`) that a bare substring check would\n * misclassify.\n */\nconst hostMatches = (host: string, domain: string): boolean =>\n host === domain || host.endsWith(`.${domain}`)\n\n/** Extract the YouTube video id from any of its URL shapes, or null. */\nconst youtubeId = (u: URL): string | null => {\n // youtu.be/<id>\n if (u.hostname.endsWith('youtu.be')) {\n return sanitizeId(u.pathname.split('/')[1] ?? '') || null\n }\n // youtube.com/watch?v=<id>\n const v = u.searchParams.get('v')\n if (v) {\n return sanitizeId(v) || null\n }\n // youtube.com/shorts/<id>, /live/<id>, /embed/<id>, /v/<id>\n const m = u.pathname.match(/^\\/(?:shorts|live|embed|v)\\/([^/?#]+)/)\n return m ? sanitizeId(m[1]) || null : null\n}\n\n/** Extract the Vimeo (numeric) video id, or null. */\nconst vimeoId = (u: URL): string | null => {\n // player.vimeo.com/video/<id> or vimeo.com/<id>\n const m = u.pathname.match(/(?:^|\\/)(\\d+)(?:$|[/?#])/)\n return m ? m[1] : null\n}\n\n/**\n * Classify a video URL into a provider + a loadable embed/file URL.\n * Falls back to `file` (native `<video>`) for anything not recognized as a\n * supported provider, or when a provider is matched but no id can be extracted.\n */\nexport function parseVideoSource(\n url: string,\n hint?: VideoProvider,\n): ParsedVideoSource {\n let u: URL | undefined\n try {\n u = new URL(url)\n } catch {\n // Not an absolute URL: treat as a direct file reference.\n return { provider: 'file', url, embedUrl: url }\n }\n\n const host = u.hostname.toLowerCase()\n\n const isYouTube =\n hostMatches(host, 'youtube.com') ||\n hostMatches(host, 'youtu.be') ||\n hostMatches(host, 'youtube-nocookie.com')\n if (isYouTube) {\n const id = youtubeId(u)\n if (id) {\n return {\n provider: 'youtube',\n url,\n videoId: id,\n embedUrl: `https://www.youtube-nocookie.com/embed/${id}`,\n thumbnailUrl: `https://img.youtube.com/vi/${id}/hqdefault.jpg`,\n }\n }\n }\n\n if (hostMatches(host, 'vimeo.com')) {\n const id = vimeoId(u)\n if (id) {\n return {\n provider: 'vimeo',\n url,\n videoId: id,\n // `dnt=1`: the player sets no cookies and records no session\n // data, the Vimeo counterpart of youtube-nocookie above.\n embedUrl: `https://player.vimeo.com/video/${id}?dnt=1`,\n }\n }\n }\n\n // Honor an explicit provider hint only if we could not extract an id from a\n // provider URL (so a caller-tagged provider link still routes to an iframe\n // via its original URL rather than a broken native <video>).\n if (hint && hint !== 'file') {\n return { provider: hint, url, embedUrl: url }\n }\n\n return { provider: 'file', url, embedUrl: url }\n}\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { parseVideoSource, type VideoProvider } from 'utils'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n interface VideoInput {\n url: string\n title?: string\n description?: string\n poster?: string\n provider?: VideoProvider\n }\n\n // Permissions granted to provider embeds (YouTube/Vimeo players).\n const IFRAME_ALLOW =\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n\n /**\n * Where a YouTube or Vimeo player lives: the url is built here from the\n * video id, so nothing the model wrote reaches these hosts but the id.\n */\n const PLAYER_HOSTS = ['www.youtube-nocookie.com', 'player.vimeo.com']\n\n // A file, its poster, or an embed this card does not recognize, fetch the\n // url the model wrote as soon as they render: from a host the agent does\n // not list they wait for a click, like an image (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n const videos = computed(() => {\n const part = props.part as { input?: { videos?: VideoInput[] } }\n return (part.input?.videos ?? []).map((video) => {\n const source = parseVideoSource(video.url, video.provider)\n const fetched =\n source.provider === 'file'\n ? [source.embedUrl, video.poster]\n : [source.embedUrl]\n const gated = fetched.filter(\n (src): src is string =>\n !!src &&\n !PLAYER_HOSTS.includes(imageGate.hostOf(src) ?? ''),\n )\n return {\n ...video,\n source,\n gated,\n held: gated.some((src) => !imageGate.canLoad(src)),\n }\n })\n })\n\n function release(urls: string[]) {\n for (const url of urls) {\n imageGate.release(url)\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"videos.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:film-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.video') }}\n </strong>\n </div>\n <div class=\"p-sm flex flex-col gap-16\">\n <div v-for=\"video in videos\" :key=\"video.url\" class=\"flex flex-col\">\n <strong v-if=\"video.title\" class=\"font-bold text-14 mb-sm\">\n {{ video.title }}\n </strong>\n <!-- Direct file: native player. Handles MP4/WebM/OGG and works\n inside the widget's Shadow DOM without any extra CSS. -->\n <div\n v-if=\"video.held\"\n class=\"w-full rounded-xl overflow-hidden\"\n style=\"aspect-ratio: 16 / 9\">\n <PkHeldImage\n :host=\"imageGate.hostOf(video.gated[0])\"\n kind=\"video\"\n fill\n @release=\"release(video.gated)\" />\n </div>\n <video\n v-else-if=\"video.source.provider === 'file'\"\n :src=\"video.source.embedUrl\"\n :poster=\"video.poster\"\n controls\n preload=\"metadata\"\n playsinline\n class=\"w-full rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9; max-height: 480px\">\n <a\n :href=\"video.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {{ video.title ?? video.url }}\n </a>\n </video>\n <!-- Provider (YouTube/Vimeo): iframe embed, 16:9 responsive. -->\n <div\n v-else\n class=\"relative w-full overflow-hidden rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9\">\n <iframe\n :src=\"video.source.embedUrl\"\n :title=\"video.title ?? video.url\"\n loading=\"lazy\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n :allow=\"IFRAME_ALLOW\"\n allowfullscreen\n class=\"absolute inset-0 w-full h-full border-0\"></iframe>\n </div>\n <span\n v-if=\"video.description\"\n class=\"text-12 text-word-3 mt-sm\">\n {{ video.description }}\n </span>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { parseVideoSource, type VideoProvider } from 'utils'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n interface VideoInput {\n url: string\n title?: string\n description?: string\n poster?: string\n provider?: VideoProvider\n }\n\n // Permissions granted to provider embeds (YouTube/Vimeo players).\n const IFRAME_ALLOW =\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n\n /**\n * Where a YouTube or Vimeo player lives: the url is built here from the\n * video id, so nothing the model wrote reaches these hosts but the id.\n */\n const PLAYER_HOSTS = ['www.youtube-nocookie.com', 'player.vimeo.com']\n\n // A file, its poster, or an embed this card does not recognize, fetch the\n // url the model wrote as soon as they render: from a host the agent does\n // not list they wait for a click, like an image (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n const videos = computed(() => {\n const part = props.part as { input?: { videos?: VideoInput[] } }\n return (part.input?.videos ?? []).map((video) => {\n const source = parseVideoSource(video.url, video.provider)\n const fetched =\n source.provider === 'file'\n ? [source.embedUrl, video.poster]\n : [source.embedUrl]\n const gated = fetched.filter(\n (src): src is string =>\n !!src &&\n !PLAYER_HOSTS.includes(imageGate.hostOf(src) ?? ''),\n )\n return {\n ...video,\n source,\n gated,\n held: gated.some((src) => !imageGate.canLoad(src)),\n }\n })\n })\n\n function release(urls: string[]) {\n for (const url of urls) {\n imageGate.release(url)\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"videos.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:film-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.video') }}\n </strong>\n </div>\n <div class=\"p-sm flex flex-col gap-16\">\n <div v-for=\"video in videos\" :key=\"video.url\" class=\"flex flex-col\">\n <strong v-if=\"video.title\" class=\"font-bold text-14 mb-sm\">\n {{ video.title }}\n </strong>\n <!-- Direct file: native player. Handles MP4/WebM/OGG and works\n inside the widget's Shadow DOM without any extra CSS. -->\n <div\n v-if=\"video.held\"\n class=\"w-full rounded-xl overflow-hidden\"\n style=\"aspect-ratio: 16 / 9\">\n <PkHeldImage\n :host=\"imageGate.hostOf(video.gated[0])\"\n kind=\"video\"\n fill\n @release=\"release(video.gated)\" />\n </div>\n <video\n v-else-if=\"video.source.provider === 'file'\"\n :src=\"video.source.embedUrl\"\n :poster=\"video.poster\"\n controls\n preload=\"metadata\"\n playsinline\n class=\"w-full rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9; max-height: 480px\">\n <a\n :href=\"video.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {{ video.title ?? video.url }}\n </a>\n </video>\n <!-- Provider (YouTube/Vimeo): iframe embed, 16:9 responsive. -->\n <div\n v-else\n class=\"relative w-full overflow-hidden rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9\">\n <iframe\n :src=\"video.source.embedUrl\"\n :title=\"video.title ?? video.url\"\n loading=\"lazy\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n :allow=\"IFRAME_ALLOW\"\n allowfullscreen\n class=\"absolute inset-0 w-full h-full border-0\"></iframe>\n </div>\n <span\n v-if=\"video.description\"\n class=\"text-12 text-word-3 mt-sm\">\n {{ video.description }}\n </span>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;AAgCA,IAAM8B,KAAc,MAAwBC,EAAI,QAAQ,mBAAmB,EAAE,GAOvEC,KAAe,GAAc,MAC/BC,MAASC,KAAUD,EAAK,SAAS,IAAIC,GAAQ,GAG3CC,KAAa,MAA0B;CAEzC,IAAIC,EAAE,SAAS,SAAS,UAAU,GAC9B,OAAON,EAAWM,EAAE,SAAS,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK;CAGzD,IAAMC,IAAID,EAAE,aAAa,IAAI,GAAG;CAChC,IAAIC,GACA,OAAOP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AbH,KAAK4D,EAAM,OAAO;KAClB,QAAQA,EAAM;KACf,UAAA;KACA,SAAQ;KACR,aAAA;KACA,OAAM;KACN,OAAA;MAAA,gBAAA;MAAA,cAAA;KAAA;IACA3D,GAAAA,CAAAA,EAKI,KAAA;KAJC,MAAM2D,EAAM;KACb,QAAO;KACP,KAAI;IACD,GAAAzD,EAAAyD,EAAM,SAASA,EAAM,GAAG,GAAA,GAAAZ,CAAA,CAAA,GAAA,GAAAD,CAAA,MAInChD,EAAA,GAAAC,EAYM,OAZNiD,GAYM,CARFhD,EAO6D,UAAA;KANxD,KAAK2D,EAAM,OAAO;KAClB,OAAOA,EAAM,SAASA,EAAM;KAC7B,SAAQ;KACR,gBAAe;KACd,OAAOR;KACR,iBAAA;KACA,OAAM;;IAGJQ,EAAM,eADhB7D,EAAA,GAAAC,EAIO,QAJPmD,GAIOhD,EADAyD,EAAM,WAAW,GAAA,CAAA,KAAA5C,EAAA,IAAA,EAAA"}
@@ -1,141 +0,0 @@
1
- import { r as e } from "./PkStreamingMarkdown-By0JBQUl.js";
2
- import "./src-DCfvejyT.js";
3
- import { t } from "./PkHeldImage-BqnlurT_.js";
4
- import { VvIcon as n } from "@volverjs/ui-vue/components";
5
- import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, openBlock as u, renderList as d, toDisplayString as f, unref as p } from "vue";
6
- //#region ../../packages/utils/src/video-source.ts
7
- var m = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), h = (e, t) => e === t || e.endsWith(`.${t}`), g = (e) => {
8
- if (e.hostname.endsWith("youtu.be")) return m(e.pathname.split("/")[1] ?? "") || null;
9
- let t = e.searchParams.get("v");
10
- if (t) return m(t) || null;
11
- let n = e.pathname.match(/^\/(?:shorts|live|embed|v)\/([^/?#]+)/);
12
- return n && m(n[1]) || null;
13
- }, _ = (e) => {
14
- let t = e.pathname.match(/(?:^|\/)(\d+)(?:$|[/?#])/);
15
- return t ? t[1] : null;
16
- };
17
- function v(e, t) {
18
- let n;
19
- try {
20
- n = new URL(e);
21
- } catch {
22
- return {
23
- provider: "file",
24
- url: e,
25
- embedUrl: e
26
- };
27
- }
28
- let r = n.hostname.toLowerCase();
29
- if (h(r, "youtube.com") || h(r, "youtu.be") || h(r, "youtube-nocookie.com")) {
30
- let t = g(n);
31
- if (t) return {
32
- provider: "youtube",
33
- url: e,
34
- videoId: t,
35
- embedUrl: `https://www.youtube-nocookie.com/embed/${t}`,
36
- thumbnailUrl: `https://img.youtube.com/vi/${t}/hqdefault.jpg`
37
- };
38
- }
39
- if (h(r, "vimeo.com")) {
40
- let t = _(n);
41
- if (t) return {
42
- provider: "vimeo",
43
- url: e,
44
- videoId: t,
45
- embedUrl: `https://player.vimeo.com/video/${t}?dnt=1`
46
- };
47
- }
48
- return t && t !== "file" ? {
49
- provider: t,
50
- url: e,
51
- embedUrl: e
52
- } : {
53
- provider: "file",
54
- url: e,
55
- embedUrl: e
56
- };
57
- }
58
- //#endregion
59
- //#region ../../packages/components/src/chat/PkToolShowVideo.vue?vue&type=script&setup=true&lang.ts
60
- var y = {
61
- key: 0,
62
- class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-surface"
63
- }, b = { class: "px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40" }, x = { class: "font-bold" }, S = { class: "p-sm flex flex-col gap-16" }, C = {
64
- key: 0,
65
- class: "font-bold text-14 mb-sm"
66
- }, w = {
67
- key: 1,
68
- class: "w-full rounded-xl overflow-hidden",
69
- style: { "aspect-ratio": "16 / 9" }
70
- }, T = ["src", "poster"], E = ["href"], D = {
71
- key: 3,
72
- class: "relative w-full overflow-hidden rounded-xl bg-word-1",
73
- style: { "aspect-ratio": "16 / 9" }
74
- }, O = ["src", "title"], k = {
75
- key: 4,
76
- class: "text-12 text-word-3 mt-sm"
77
- }, A = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", j = /* @__PURE__ */ l({
78
- __name: "PkToolShowVideo",
79
- props: { part: {} },
80
- setup(l) {
81
- let m = l, h = ["www.youtube-nocookie.com", "player.vimeo.com"], g = e(), _ = i(() => (m.part.input?.videos ?? []).map((e) => {
82
- let t = v(e.url, e.provider), n = (t.provider === "file" ? [t.embedUrl, e.poster] : [t.embedUrl]).filter((e) => !!e && !h.includes(g.hostOf(e) ?? ""));
83
- return {
84
- ...e,
85
- source: t,
86
- gated: n,
87
- held: n.some((e) => !g.canLoad(e))
88
- };
89
- }));
90
- function j(e) {
91
- for (let t of e) g.release(t);
92
- }
93
- return (e, i) => {
94
- let l = n;
95
- return _.value.length ? (u(), o("div", y, [s("div", b, [c(l, {
96
- name: "ri:film-line",
97
- class: "text-16"
98
- }), s("strong", x, f(e.$t("label.video")), 1)]), s("div", S, [(u(!0), o(r, null, d(_.value, (e) => (u(), o("div", {
99
- key: e.url,
100
- class: "flex flex-col"
101
- }, [
102
- e.title ? (u(), o("strong", C, f(e.title), 1)) : a("", !0),
103
- e.held ? (u(), o("div", w, [c(t, {
104
- host: p(g).hostOf(e.gated[0]),
105
- kind: "video",
106
- fill: "",
107
- onRelease: (t) => j(e.gated)
108
- }, null, 8, ["host", "onRelease"])])) : e.source.provider === "file" ? (u(), o("video", {
109
- key: 2,
110
- src: e.source.embedUrl,
111
- poster: e.poster,
112
- controls: "",
113
- preload: "metadata",
114
- playsinline: "",
115
- class: "w-full rounded-xl bg-word-1",
116
- style: {
117
- "aspect-ratio": "16 / 9",
118
- "max-height": "480px"
119
- }
120
- }, [s("a", {
121
- href: e.url,
122
- target: "_blank",
123
- rel: "noopener noreferrer"
124
- }, f(e.title ?? e.url), 9, E)], 8, T)) : (u(), o("div", D, [s("iframe", {
125
- src: e.source.embedUrl,
126
- title: e.title ?? e.url,
127
- loading: "lazy",
128
- referrerpolicy: "strict-origin-when-cross-origin",
129
- allow: A,
130
- allowfullscreen: "",
131
- class: "absolute inset-0 w-full h-full border-0"
132
- }, null, 8, O)])),
133
- e.description ? (u(), o("span", k, f(e.description), 1)) : a("", !0)
134
- ]))), 128))])])) : a("", !0);
135
- };
136
- }
137
- });
138
- //#endregion
139
- export { j as default };
140
-
141
- //# sourceMappingURL=PkToolShowVideo-DNqbPNq7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PkToolShowVideo-DNqbPNq7.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_Fragment","_renderList","_createCommentVNode","PkHeldImage","_unref","_sfc_main","useChatImageGate","sanitizeId","raw","hostMatches","host","domain","youtubeId","u","v","m","vimeoId","parseVideoSource","url","id","hint","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","IFRAME_ALLOW","PkToolShowVideo_default","defineComponent","props","__props","PLAYER_HOSTS","imageGate","videos","computed","source","video","gated","src","release","urls","_component_VvIcon","VvIcon","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","Fragment","renderList","createCommentVNode","PkHeldImage_default","unref"],"sources":["../../../../packages/utils/src/video-source.ts","../../../../packages/components/src/chat/PkToolShowVideo.vue","../../../../packages/components/src/chat/PkToolShowVideo.vue"],"sourcesContent":["/**\n * Video source parsing shared by the backend platform renderer and the frontend\n * player component, so both classify a video URL the same way.\n *\n * A URL is either a known provider (YouTube/Vimeo), which plays through the\n * provider's iframe embed, or a direct media file (`file`), which plays in a\n * native `<video>` element. Detection is by URL shape; an explicit `hint` is\n * used only as a fallback when the URL alone is inconclusive.\n */\n\nexport type VideoProvider = 'youtube' | 'vimeo' | 'file'\n\nexport interface ParsedVideoSource {\n provider: VideoProvider\n /** The original URL, unchanged. */\n url: string\n /**\n * The URL to actually load: the provider iframe embed URL for\n * YouTube/Vimeo, or the direct file URL for `file`.\n */\n embedUrl: string\n /** The provider video id (providers only). */\n videoId?: string\n /**\n * A preview image URL derived from the provider, when one is available\n * without an extra API call (currently YouTube only). Lets a link-only\n * surface (e.g. a Teams card) show a thumbnail instead of a bare link.\n */\n thumbnailUrl?: string\n}\n\n/** Keep only characters that are legal in a provider video id. */\nconst sanitizeId = (raw: string): string => raw.replace(/[^a-zA-Z0-9_-]/g, '')\n\n/**\n * True when `host` is exactly `domain` or a subdomain of it. Guards against\n * lookalike hosts (e.g. `notyoutube.com`) that a bare substring check would\n * misclassify.\n */\nconst hostMatches = (host: string, domain: string): boolean =>\n host === domain || host.endsWith(`.${domain}`)\n\n/** Extract the YouTube video id from any of its URL shapes, or null. */\nconst youtubeId = (u: URL): string | null => {\n // youtu.be/<id>\n if (u.hostname.endsWith('youtu.be')) {\n return sanitizeId(u.pathname.split('/')[1] ?? '') || null\n }\n // youtube.com/watch?v=<id>\n const v = u.searchParams.get('v')\n if (v) {\n return sanitizeId(v) || null\n }\n // youtube.com/shorts/<id>, /live/<id>, /embed/<id>, /v/<id>\n const m = u.pathname.match(/^\\/(?:shorts|live|embed|v)\\/([^/?#]+)/)\n return m ? sanitizeId(m[1]) || null : null\n}\n\n/** Extract the Vimeo (numeric) video id, or null. */\nconst vimeoId = (u: URL): string | null => {\n // player.vimeo.com/video/<id> or vimeo.com/<id>\n const m = u.pathname.match(/(?:^|\\/)(\\d+)(?:$|[/?#])/)\n return m ? m[1] : null\n}\n\n/**\n * Classify a video URL into a provider + a loadable embed/file URL.\n * Falls back to `file` (native `<video>`) for anything not recognized as a\n * supported provider, or when a provider is matched but no id can be extracted.\n */\nexport function parseVideoSource(\n url: string,\n hint?: VideoProvider,\n): ParsedVideoSource {\n let u: URL | undefined\n try {\n u = new URL(url)\n } catch {\n // Not an absolute URL: treat as a direct file reference.\n return { provider: 'file', url, embedUrl: url }\n }\n\n const host = u.hostname.toLowerCase()\n\n const isYouTube =\n hostMatches(host, 'youtube.com') ||\n hostMatches(host, 'youtu.be') ||\n hostMatches(host, 'youtube-nocookie.com')\n if (isYouTube) {\n const id = youtubeId(u)\n if (id) {\n return {\n provider: 'youtube',\n url,\n videoId: id,\n embedUrl: `https://www.youtube-nocookie.com/embed/${id}`,\n thumbnailUrl: `https://img.youtube.com/vi/${id}/hqdefault.jpg`,\n }\n }\n }\n\n if (hostMatches(host, 'vimeo.com')) {\n const id = vimeoId(u)\n if (id) {\n return {\n provider: 'vimeo',\n url,\n videoId: id,\n // `dnt=1`: the player sets no cookies and records no session\n // data, the Vimeo counterpart of youtube-nocookie above.\n embedUrl: `https://player.vimeo.com/video/${id}?dnt=1`,\n }\n }\n }\n\n // Honor an explicit provider hint only if we could not extract an id from a\n // provider URL (so a caller-tagged provider link still routes to an iframe\n // via its original URL rather than a broken native <video>).\n if (hint && hint !== 'file') {\n return { provider: hint, url, embedUrl: url }\n }\n\n return { provider: 'file', url, embedUrl: url }\n}\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { parseVideoSource, type VideoProvider } from 'utils'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n interface VideoInput {\n url: string\n title?: string\n description?: string\n poster?: string\n provider?: VideoProvider\n }\n\n // Permissions granted to provider embeds (YouTube/Vimeo players).\n const IFRAME_ALLOW =\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n\n /**\n * Where a YouTube or Vimeo player lives: the url is built here from the\n * video id, so nothing the model wrote reaches these hosts but the id.\n */\n const PLAYER_HOSTS = ['www.youtube-nocookie.com', 'player.vimeo.com']\n\n // A file, its poster, or an embed this card does not recognize, fetch the\n // url the model wrote as soon as they render: from a host the agent does\n // not list they wait for a click, like an image (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n const videos = computed(() => {\n const part = props.part as { input?: { videos?: VideoInput[] } }\n return (part.input?.videos ?? []).map((video) => {\n const source = parseVideoSource(video.url, video.provider)\n const fetched =\n source.provider === 'file'\n ? [source.embedUrl, video.poster]\n : [source.embedUrl]\n const gated = fetched.filter(\n (src): src is string =>\n !!src &&\n !PLAYER_HOSTS.includes(imageGate.hostOf(src) ?? ''),\n )\n return {\n ...video,\n source,\n gated,\n held: gated.some((src) => !imageGate.canLoad(src)),\n }\n })\n })\n\n function release(urls: string[]) {\n for (const url of urls) {\n imageGate.release(url)\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"videos.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:film-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.video') }}\n </strong>\n </div>\n <div class=\"p-sm flex flex-col gap-16\">\n <div v-for=\"video in videos\" :key=\"video.url\" class=\"flex flex-col\">\n <strong v-if=\"video.title\" class=\"font-bold text-14 mb-sm\">\n {{ video.title }}\n </strong>\n <!-- Direct file: native player. Handles MP4/WebM/OGG and works\n inside the widget's Shadow DOM without any extra CSS. -->\n <div\n v-if=\"video.held\"\n class=\"w-full rounded-xl overflow-hidden\"\n style=\"aspect-ratio: 16 / 9\">\n <PkHeldImage\n :host=\"imageGate.hostOf(video.gated[0])\"\n kind=\"video\"\n fill\n @release=\"release(video.gated)\" />\n </div>\n <video\n v-else-if=\"video.source.provider === 'file'\"\n :src=\"video.source.embedUrl\"\n :poster=\"video.poster\"\n controls\n preload=\"metadata\"\n playsinline\n class=\"w-full rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9; max-height: 480px\">\n <a\n :href=\"video.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {{ video.title ?? video.url }}\n </a>\n </video>\n <!-- Provider (YouTube/Vimeo): iframe embed, 16:9 responsive. -->\n <div\n v-else\n class=\"relative w-full overflow-hidden rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9\">\n <iframe\n :src=\"video.source.embedUrl\"\n :title=\"video.title ?? video.url\"\n loading=\"lazy\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n :allow=\"IFRAME_ALLOW\"\n allowfullscreen\n class=\"absolute inset-0 w-full h-full border-0\"></iframe>\n </div>\n <span\n v-if=\"video.description\"\n class=\"text-12 text-word-3 mt-sm\">\n {{ video.description }}\n </span>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { parseVideoSource, type VideoProvider } from 'utils'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n interface VideoInput {\n url: string\n title?: string\n description?: string\n poster?: string\n provider?: VideoProvider\n }\n\n // Permissions granted to provider embeds (YouTube/Vimeo players).\n const IFRAME_ALLOW =\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n\n /**\n * Where a YouTube or Vimeo player lives: the url is built here from the\n * video id, so nothing the model wrote reaches these hosts but the id.\n */\n const PLAYER_HOSTS = ['www.youtube-nocookie.com', 'player.vimeo.com']\n\n // A file, its poster, or an embed this card does not recognize, fetch the\n // url the model wrote as soon as they render: from a host the agent does\n // not list they wait for a click, like an image (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n\n const videos = computed(() => {\n const part = props.part as { input?: { videos?: VideoInput[] } }\n return (part.input?.videos ?? []).map((video) => {\n const source = parseVideoSource(video.url, video.provider)\n const fetched =\n source.provider === 'file'\n ? [source.embedUrl, video.poster]\n : [source.embedUrl]\n const gated = fetched.filter(\n (src): src is string =>\n !!src &&\n !PLAYER_HOSTS.includes(imageGate.hostOf(src) ?? ''),\n )\n return {\n ...video,\n source,\n gated,\n held: gated.some((src) => !imageGate.canLoad(src)),\n }\n })\n })\n\n function release(urls: string[]) {\n for (const url of urls) {\n imageGate.release(url)\n }\n }\n</script>\n\n<template>\n <div\n v-if=\"videos.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:film-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.video') }}\n </strong>\n </div>\n <div class=\"p-sm flex flex-col gap-16\">\n <div v-for=\"video in videos\" :key=\"video.url\" class=\"flex flex-col\">\n <strong v-if=\"video.title\" class=\"font-bold text-14 mb-sm\">\n {{ video.title }}\n </strong>\n <!-- Direct file: native player. Handles MP4/WebM/OGG and works\n inside the widget's Shadow DOM without any extra CSS. -->\n <div\n v-if=\"video.held\"\n class=\"w-full rounded-xl overflow-hidden\"\n style=\"aspect-ratio: 16 / 9\">\n <PkHeldImage\n :host=\"imageGate.hostOf(video.gated[0])\"\n kind=\"video\"\n fill\n @release=\"release(video.gated)\" />\n </div>\n <video\n v-else-if=\"video.source.provider === 'file'\"\n :src=\"video.source.embedUrl\"\n :poster=\"video.poster\"\n controls\n preload=\"metadata\"\n playsinline\n class=\"w-full rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9; max-height: 480px\">\n <a\n :href=\"video.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {{ video.title ?? video.url }}\n </a>\n </video>\n <!-- Provider (YouTube/Vimeo): iframe embed, 16:9 responsive. -->\n <div\n v-else\n class=\"relative w-full overflow-hidden rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9\">\n <iframe\n :src=\"video.source.embedUrl\"\n :title=\"video.title ?? video.url\"\n loading=\"lazy\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n :allow=\"IFRAME_ALLOW\"\n allowfullscreen\n class=\"absolute inset-0 w-full h-full border-0\"></iframe>\n </div>\n <span\n v-if=\"video.description\"\n class=\"text-12 text-word-3 mt-sm\">\n {{ video.description }}\n </span>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;AAgCA,IAAMc,KAAc,MAAwBC,EAAI,QAAQ,mBAAmB,EAAE,GAOvEC,KAAe,GAAc,MAC/BC,MAASC,KAAUD,EAAK,SAA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