@medialane/ui 0.212.2 → 0.213.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/asset-page.cjs +45 -4
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.js +45 -4
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/asset-top-sections.cjs +1 -1
- package/dist/components/asset-top-sections.cjs.map +1 -1
- package/dist/components/asset-top-sections.js +1 -1
- package/dist/components/asset-top-sections.js.map +1 -1
- package/dist/components/asset-video.cjs +101 -0
- package/dist/components/asset-video.cjs.map +1 -0
- package/dist/components/asset-video.d.cts +36 -0
- package/dist/components/asset-video.d.ts +36 -0
- package/dist/components/asset-video.js +64 -0
- package/dist/components/asset-video.js.map +1 -0
- package/dist/components/ip-type-badge.cjs +11 -4
- package/dist/components/ip-type-badge.cjs.map +1 -1
- package/dist/components/ip-type-badge.d.cts +2 -1
- package/dist/components/ip-type-badge.d.ts +2 -1
- package/dist/components/ip-type-badge.js +12 -5
- package/dist/components/ip-type-badge.js.map +1 -1
- package/dist/components/ip-type-display.cjs +4 -2
- package/dist/components/ip-type-display.cjs.map +1 -1
- package/dist/components/ip-type-display.d.cts +5 -1
- package/dist/components/ip-type-display.d.ts +5 -1
- package/dist/components/ip-type-display.js +2 -1
- package/dist/components/ip-type-display.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var asset_video_exports = {};
|
|
31
|
+
__export(asset_video_exports, {
|
|
32
|
+
AssetRelatedList: () => AssetRelatedList,
|
|
33
|
+
AssetVideo: () => AssetVideo,
|
|
34
|
+
VIDEO_EMBED_TRAITS: () => VIDEO_EMBED_TRAITS,
|
|
35
|
+
videoEmbed: () => videoEmbed
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(asset_video_exports);
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_link = __toESM(require("./link.js"), 1);
|
|
40
|
+
var import_lucide_react = require("lucide-react");
|
|
41
|
+
var import_expandable_text = require("./expandable-text.js");
|
|
42
|
+
var import_ip_type_display = require("./ip-type-display.js");
|
|
43
|
+
var import_ip_templates = require("../data/ip-templates.js");
|
|
44
|
+
const VIDEO_PLATFORMS = ["youtube", "vimeo", "tiktok"];
|
|
45
|
+
const VIDEO_EMBED_TRAITS = new Set(VIDEO_PLATFORMS.map((p) => import_ip_templates.EMBED_PLATFORM_META[p].traitKey));
|
|
46
|
+
function videoEmbed(attributes) {
|
|
47
|
+
for (const platform of VIDEO_PLATFORMS) {
|
|
48
|
+
const meta = import_ip_templates.EMBED_PLATFORM_META[platform];
|
|
49
|
+
const value = attributes.find((a) => a.trait_type === meta.traitKey)?.value;
|
|
50
|
+
const src = value ? (0, import_ip_type_display.getEmbedSrc)(platform, value) : null;
|
|
51
|
+
if (src) return { src, label: meta.label };
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function AssetVideo({ name, embedSrc, embedLabel, description, collectionName, collectionImage, collectionHref, utilities }) {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 space-y-4", children: [
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative w-full aspect-video overflow-hidden rounded-2xl bg-black", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
+
"iframe",
|
|
59
|
+
{
|
|
60
|
+
src: embedSrc,
|
|
61
|
+
title: embedLabel,
|
|
62
|
+
className: "absolute inset-0 h-full w-full",
|
|
63
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
64
|
+
allowFullScreen: true
|
|
65
|
+
}
|
|
66
|
+
) }),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-xl lg:text-2xl font-bold break-words", children: name }),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: collectionHref, className: "flex min-w-0 items-center gap-3 hover:text-primary transition-colors", children: [
|
|
70
|
+
collectionImage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: collectionImage, alt: "", className: "h-10 w-10 shrink-0 rounded-full object-cover" }) : null,
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate text-sm font-semibold", children: collectionName })
|
|
72
|
+
] }),
|
|
73
|
+
utilities
|
|
74
|
+
] }),
|
|
75
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-2xl bg-muted/30 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_expandable_text.ExpandableText, { text: description }) }) : null
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
function AssetRelatedList({ title, titleHref, items }) {
|
|
79
|
+
if (items.length === 0) return null;
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-3", children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: titleHref, className: "flex items-center justify-between gap-2 text-sm font-semibold hover:text-primary transition-colors", children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "truncate", children: [
|
|
83
|
+
"More from ",
|
|
84
|
+
title
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-4 w-4 shrink-0" })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "space-y-3", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: item.href, className: "group flex gap-3", children: [
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-video w-40 shrink-0 overflow-hidden rounded-xl bg-muted/40", children: item.image ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: item.image, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) : null }),
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "min-w-0 text-sm font-medium leading-snug line-clamp-3 group-hover:text-primary transition-colors", children: item.name })
|
|
91
|
+
] }) }, item.tokenId)) })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
AssetRelatedList,
|
|
97
|
+
AssetVideo,
|
|
98
|
+
VIDEO_EMBED_TRAITS,
|
|
99
|
+
videoEmbed
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=asset-video.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-video.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport type { ReactNode } from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { ExpandableText } from \"./expandable-text.js\";\nimport { getEmbedSrc } from \"./ip-type-display.js\";\nimport { EMBED_PLATFORM_META, type EmbedPlatform } from \"../data/ip-templates.js\";\n\ninterface Attr {\n trait_type?: string;\n value?: string;\n}\n\nconst VIDEO_PLATFORMS: EmbedPlatform[] = [\"youtube\", \"vimeo\", \"tiktok\"];\n\nexport const VIDEO_EMBED_TRAITS = new Set<string>(VIDEO_PLATFORMS.map((p) => EMBED_PLATFORM_META[p].traitKey));\n\nexport function videoEmbed(attributes: Attr[]): { src: string; label: string } | null {\n for (const platform of VIDEO_PLATFORMS) {\n const meta = EMBED_PLATFORM_META[platform];\n const value = attributes.find((a) => a.trait_type === meta.traitKey)?.value;\n const src = value ? getEmbedSrc(platform, value) : null;\n if (src) return { src, label: meta.label };\n }\n return null;\n}\n\nexport interface AssetVideoProps {\n name: string;\n embedSrc: string;\n embedLabel: string;\n description?: string | null;\n collectionName: string;\n collectionImage?: string | null;\n collectionHref: string;\n utilities: ReactNode;\n}\n\nexport function AssetVideo({ name, embedSrc, embedLabel, description, collectionName, collectionImage, collectionHref, utilities }: AssetVideoProps) {\n return (\n <div className=\"min-w-0 space-y-4\">\n <div className=\"relative w-full aspect-video overflow-hidden rounded-2xl bg-black\">\n <iframe\n src={embedSrc}\n title={embedLabel}\n className=\"absolute inset-0 h-full w-full\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n </div>\n\n <h1 className=\"text-xl lg:text-2xl font-bold break-words\">{name}</h1>\n\n <div className=\"flex items-center justify-between gap-3\">\n <Link href={collectionHref} className=\"flex min-w-0 items-center gap-3 hover:text-primary transition-colors\">\n {collectionImage ? <img src={collectionImage} alt=\"\" className=\"h-10 w-10 shrink-0 rounded-full object-cover\" /> : null}\n <span className=\"truncate text-sm font-semibold\">{collectionName}</span>\n </Link>\n {utilities}\n </div>\n\n {description ? (\n <div className=\"rounded-2xl bg-muted/30 p-4\">\n <ExpandableText text={description} />\n </div>\n ) : null}\n </div>\n );\n}\n\nexport interface AssetRelatedItem {\n tokenId: string;\n name: string;\n image: string | null;\n href: string;\n}\n\nexport function AssetRelatedList({ title, titleHref, items }: { title: string; titleHref: string; items: AssetRelatedItem[] }) {\n if (items.length === 0) return null;\n return (\n <section className=\"space-y-3\">\n <Link href={titleHref} className=\"flex items-center justify-between gap-2 text-sm font-semibold hover:text-primary transition-colors\">\n <span className=\"truncate\">More from {title}</span>\n <ArrowRight className=\"h-4 w-4 shrink-0\" />\n </Link>\n <ul className=\"space-y-3\">\n {items.map((item) => (\n <li key={item.tokenId}>\n <Link href={item.href} className=\"group flex gap-3\">\n <div className=\"aspect-video w-40 shrink-0 overflow-hidden rounded-xl bg-muted/40\">\n {item.image ? <img src={item.image} alt=\"\" loading=\"lazy\" className=\"h-full w-full object-cover\" /> : null}\n </div>\n <p className=\"min-w-0 text-sm font-medium leading-snug line-clamp-3 group-hover:text-primary transition-colors\">{item.name}</p>\n </Link>\n </li>\n ))}\n </ul>\n </section>\n );\n}\n"],"mappings":";;;;;;;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Ae,MAAM,aAAa,GACrC,IACE;AAAA,KACN;AAEJ;AASO,SAAS,iBAAiB,EAAE,OAAO,WAAW,MAAM,GAAoE;AAC7H,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SACE,6CAAC,aAAQ,WAAU,aACjB;AAAA,iDAAC,YAAAA,SAAA,EAAK,MAAM,WAAW,WAAU,sGAC/B;AAAA,mDAAC,UAAK,WAAU,YAAW;AAAA;AAAA,QAAW;AAAA,SAAM;AAAA,MAC5C,4CAAC,kCAAW,WAAU,oBAAmB;AAAA,OAC3C;AAAA,IACA,4CAAC,QAAG,WAAU,aACX,gBAAM,IAAI,CAAC,SACV,4CAAC,QACC,uDAAC,YAAAA,SAAA,EAAK,MAAM,KAAK,MAAM,WAAU,oBAC/B;AAAA,kDAAC,SAAI,WAAU,qEACZ,eAAK,QAAQ,4CAAC,SAAI,KAAK,KAAK,OAAO,KAAI,IAAG,SAAQ,QAAO,WAAU,8BAA6B,IAAK,MACxG;AAAA,MACA,4CAAC,OAAE,WAAU,oGAAoG,eAAK,MAAK;AAAA,OAC7H,KANO,KAAK,OAOd,CACD,GACH;AAAA,KACF;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Attr {
|
|
5
|
+
trait_type?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const VIDEO_EMBED_TRAITS: Set<string>;
|
|
9
|
+
declare function videoEmbed(attributes: Attr[]): {
|
|
10
|
+
src: string;
|
|
11
|
+
label: string;
|
|
12
|
+
} | null;
|
|
13
|
+
interface AssetVideoProps {
|
|
14
|
+
name: string;
|
|
15
|
+
embedSrc: string;
|
|
16
|
+
embedLabel: string;
|
|
17
|
+
description?: string | null;
|
|
18
|
+
collectionName: string;
|
|
19
|
+
collectionImage?: string | null;
|
|
20
|
+
collectionHref: string;
|
|
21
|
+
utilities: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare function AssetVideo({ name, embedSrc, embedLabel, description, collectionName, collectionImage, collectionHref, utilities }: AssetVideoProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
interface AssetRelatedItem {
|
|
25
|
+
tokenId: string;
|
|
26
|
+
name: string;
|
|
27
|
+
image: string | null;
|
|
28
|
+
href: string;
|
|
29
|
+
}
|
|
30
|
+
declare function AssetRelatedList({ title, titleHref, items }: {
|
|
31
|
+
title: string;
|
|
32
|
+
titleHref: string;
|
|
33
|
+
items: AssetRelatedItem[];
|
|
34
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
35
|
+
|
|
36
|
+
export { type AssetRelatedItem, AssetRelatedList, AssetVideo, type AssetVideoProps, VIDEO_EMBED_TRAITS, videoEmbed };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Attr {
|
|
5
|
+
trait_type?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const VIDEO_EMBED_TRAITS: Set<string>;
|
|
9
|
+
declare function videoEmbed(attributes: Attr[]): {
|
|
10
|
+
src: string;
|
|
11
|
+
label: string;
|
|
12
|
+
} | null;
|
|
13
|
+
interface AssetVideoProps {
|
|
14
|
+
name: string;
|
|
15
|
+
embedSrc: string;
|
|
16
|
+
embedLabel: string;
|
|
17
|
+
description?: string | null;
|
|
18
|
+
collectionName: string;
|
|
19
|
+
collectionImage?: string | null;
|
|
20
|
+
collectionHref: string;
|
|
21
|
+
utilities: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare function AssetVideo({ name, embedSrc, embedLabel, description, collectionName, collectionImage, collectionHref, utilities }: AssetVideoProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
interface AssetRelatedItem {
|
|
25
|
+
tokenId: string;
|
|
26
|
+
name: string;
|
|
27
|
+
image: string | null;
|
|
28
|
+
href: string;
|
|
29
|
+
}
|
|
30
|
+
declare function AssetRelatedList({ title, titleHref, items }: {
|
|
31
|
+
title: string;
|
|
32
|
+
titleHref: string;
|
|
33
|
+
items: AssetRelatedItem[];
|
|
34
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
35
|
+
|
|
36
|
+
export { type AssetRelatedItem, AssetRelatedList, AssetVideo, type AssetVideoProps, VIDEO_EMBED_TRAITS, videoEmbed };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Link from "./link.js";
|
|
4
|
+
import { ArrowRight } from "lucide-react";
|
|
5
|
+
import { ExpandableText } from "./expandable-text.js";
|
|
6
|
+
import { getEmbedSrc } from "./ip-type-display.js";
|
|
7
|
+
import { EMBED_PLATFORM_META } from "../data/ip-templates.js";
|
|
8
|
+
const VIDEO_PLATFORMS = ["youtube", "vimeo", "tiktok"];
|
|
9
|
+
const VIDEO_EMBED_TRAITS = new Set(VIDEO_PLATFORMS.map((p) => EMBED_PLATFORM_META[p].traitKey));
|
|
10
|
+
function videoEmbed(attributes) {
|
|
11
|
+
for (const platform of VIDEO_PLATFORMS) {
|
|
12
|
+
const meta = EMBED_PLATFORM_META[platform];
|
|
13
|
+
const value = attributes.find((a) => a.trait_type === meta.traitKey)?.value;
|
|
14
|
+
const src = value ? getEmbedSrc(platform, value) : null;
|
|
15
|
+
if (src) return { src, label: meta.label };
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
function AssetVideo({ name, embedSrc, embedLabel, description, collectionName, collectionImage, collectionHref, utilities }) {
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-4", children: [
|
|
21
|
+
/* @__PURE__ */ jsx("div", { className: "relative w-full aspect-video overflow-hidden rounded-2xl bg-black", children: /* @__PURE__ */ jsx(
|
|
22
|
+
"iframe",
|
|
23
|
+
{
|
|
24
|
+
src: embedSrc,
|
|
25
|
+
title: embedLabel,
|
|
26
|
+
className: "absolute inset-0 h-full w-full",
|
|
27
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
28
|
+
allowFullScreen: true
|
|
29
|
+
}
|
|
30
|
+
) }),
|
|
31
|
+
/* @__PURE__ */ jsx("h1", { className: "text-xl lg:text-2xl font-bold break-words", children: name }),
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
33
|
+
/* @__PURE__ */ jsxs(Link, { href: collectionHref, className: "flex min-w-0 items-center gap-3 hover:text-primary transition-colors", children: [
|
|
34
|
+
collectionImage ? /* @__PURE__ */ jsx("img", { src: collectionImage, alt: "", className: "h-10 w-10 shrink-0 rounded-full object-cover" }) : null,
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm font-semibold", children: collectionName })
|
|
36
|
+
] }),
|
|
37
|
+
utilities
|
|
38
|
+
] }),
|
|
39
|
+
description ? /* @__PURE__ */ jsx("div", { className: "rounded-2xl bg-muted/30 p-4", children: /* @__PURE__ */ jsx(ExpandableText, { text: description }) }) : null
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
function AssetRelatedList({ title, titleHref, items }) {
|
|
43
|
+
if (items.length === 0) return null;
|
|
44
|
+
return /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
45
|
+
/* @__PURE__ */ jsxs(Link, { href: titleHref, className: "flex items-center justify-between gap-2 text-sm font-semibold hover:text-primary transition-colors", children: [
|
|
46
|
+
/* @__PURE__ */ jsxs("span", { className: "truncate", children: [
|
|
47
|
+
"More from ",
|
|
48
|
+
title
|
|
49
|
+
] }),
|
|
50
|
+
/* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4 shrink-0" })
|
|
51
|
+
] }),
|
|
52
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-3", children: items.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Link, { href: item.href, className: "group flex gap-3", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "aspect-video w-40 shrink-0 overflow-hidden rounded-xl bg-muted/40", children: item.image ? /* @__PURE__ */ jsx("img", { src: item.image, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) : null }),
|
|
54
|
+
/* @__PURE__ */ jsx("p", { className: "min-w-0 text-sm font-medium leading-snug line-clamp-3 group-hover:text-primary transition-colors", children: item.name })
|
|
55
|
+
] }) }, item.tokenId)) })
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
AssetRelatedList,
|
|
60
|
+
AssetVideo,
|
|
61
|
+
VIDEO_EMBED_TRAITS,
|
|
62
|
+
videoEmbed
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=asset-video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/asset-video.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport type { ReactNode } from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { ExpandableText } from \"./expandable-text.js\";\nimport { getEmbedSrc } from \"./ip-type-display.js\";\nimport { EMBED_PLATFORM_META, type EmbedPlatform } from \"../data/ip-templates.js\";\n\ninterface Attr {\n trait_type?: string;\n value?: string;\n}\n\nconst VIDEO_PLATFORMS: EmbedPlatform[] = [\"youtube\", \"vimeo\", \"tiktok\"];\n\nexport const VIDEO_EMBED_TRAITS = new Set<string>(VIDEO_PLATFORMS.map((p) => EMBED_PLATFORM_META[p].traitKey));\n\nexport function videoEmbed(attributes: Attr[]): { src: string; label: string } | null {\n for (const platform of VIDEO_PLATFORMS) {\n const meta = EMBED_PLATFORM_META[platform];\n const value = attributes.find((a) => a.trait_type === meta.traitKey)?.value;\n const src = value ? getEmbedSrc(platform, value) : null;\n if (src) return { src, label: meta.label };\n }\n return null;\n}\n\nexport interface AssetVideoProps {\n name: string;\n embedSrc: string;\n embedLabel: string;\n description?: string | null;\n collectionName: string;\n collectionImage?: string | null;\n collectionHref: string;\n utilities: ReactNode;\n}\n\nexport function AssetVideo({ name, embedSrc, embedLabel, description, collectionName, collectionImage, collectionHref, utilities }: AssetVideoProps) {\n return (\n <div className=\"min-w-0 space-y-4\">\n <div className=\"relative w-full aspect-video overflow-hidden rounded-2xl bg-black\">\n <iframe\n src={embedSrc}\n title={embedLabel}\n className=\"absolute inset-0 h-full w-full\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n </div>\n\n <h1 className=\"text-xl lg:text-2xl font-bold break-words\">{name}</h1>\n\n <div className=\"flex items-center justify-between gap-3\">\n <Link href={collectionHref} className=\"flex min-w-0 items-center gap-3 hover:text-primary transition-colors\">\n {collectionImage ? <img src={collectionImage} alt=\"\" className=\"h-10 w-10 shrink-0 rounded-full object-cover\" /> : null}\n <span className=\"truncate text-sm font-semibold\">{collectionName}</span>\n </Link>\n {utilities}\n </div>\n\n {description ? (\n <div className=\"rounded-2xl bg-muted/30 p-4\">\n <ExpandableText text={description} />\n </div>\n ) : null}\n </div>\n );\n}\n\nexport interface AssetRelatedItem {\n tokenId: string;\n name: string;\n image: string | null;\n href: string;\n}\n\nexport function AssetRelatedList({ title, titleHref, items }: { title: string; titleHref: string; items: AssetRelatedItem[] }) {\n if (items.length === 0) return null;\n return (\n <section className=\"space-y-3\">\n <Link href={titleHref} className=\"flex items-center justify-between gap-2 text-sm font-semibold hover:text-primary transition-colors\">\n <span className=\"truncate\">More from {title}</span>\n <ArrowRight className=\"h-4 w-4 shrink-0\" />\n </Link>\n <ul className=\"space-y-3\">\n {items.map((item) => (\n <li key={item.tokenId}>\n <Link href={item.href} className=\"group flex gap-3\">\n <div className=\"aspect-video w-40 shrink-0 overflow-hidden rounded-xl bg-muted/40\">\n {item.image ? <img src={item.image} alt=\"\" loading=\"lazy\" className=\"h-full w-full object-cover\" /> : null}\n </div>\n <p className=\"min-w-0 text-sm font-medium leading-snug line-clamp-3 group-hover:text-primary transition-colors\">{item.name}</p>\n </Link>\n </li>\n ))}\n </ul>\n </section>\n );\n}\n"],"mappings":";AA2CQ,cAYA,YAZA;AAzCR,OAAO,UAAU;AAEjB,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,2BAA+C;AAOxD,MAAM,kBAAmC,CAAC,WAAW,SAAS,QAAQ;AAE/D,MAAM,qBAAqB,IAAI,IAAY,gBAAgB,IAAI,CAAC,MAAM,oBAAoB,CAAC,EAAE,QAAQ,CAAC;AAEtG,SAAS,WAAW,YAA2D;AACpF,aAAW,YAAY,iBAAiB;AACtC,UAAM,OAAO,oBAAoB,QAAQ;AACzC,UAAM,QAAQ,WAAW,KAAK,CAAC,MAAM,EAAE,eAAe,KAAK,QAAQ,GAAG;AACtE,UAAM,MAAM,QAAQ,YAAY,UAAU,KAAK,IAAI;AACnD,QAAI,IAAK,QAAO,EAAE,KAAK,OAAO,KAAK,MAAM;AAAA,EAC3C;AACA,SAAO;AACT;AAaO,SAAS,WAAW,EAAE,MAAM,UAAU,YAAY,aAAa,gBAAgB,iBAAiB,gBAAgB,UAAU,GAAoB;AACnJ,SACE,qBAAC,SAAI,WAAU,qBACb;AAAA,wBAAC,SAAI,WAAU,qEACb;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,OAAO;AAAA,QACP,WAAU;AAAA,QACV,OAAM;AAAA,QACN,iBAAe;AAAA;AAAA,IACjB,GACF;AAAA,IAEA,oBAAC,QAAG,WAAU,6CAA6C,gBAAK;AAAA,IAEhE,qBAAC,SAAI,WAAU,2CACb;AAAA,2BAAC,QAAK,MAAM,gBAAgB,WAAU,wEACnC;AAAA,0BAAkB,oBAAC,SAAI,KAAK,iBAAiB,KAAI,IAAG,WAAU,gDAA+C,IAAK;AAAA,QACnH,oBAAC,UAAK,WAAU,kCAAkC,0BAAe;AAAA,SACnE;AAAA,MACC;AAAA,OACH;AAAA,IAEC,cACC,oBAAC,SAAI,WAAU,+BACb,8BAAC,kBAAe,MAAM,aAAa,GACrC,IACE;AAAA,KACN;AAEJ;AASO,SAAS,iBAAiB,EAAE,OAAO,WAAW,MAAM,GAAoE;AAC7H,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SACE,qBAAC,aAAQ,WAAU,aACjB;AAAA,yBAAC,QAAK,MAAM,WAAW,WAAU,sGAC/B;AAAA,2BAAC,UAAK,WAAU,YAAW;AAAA;AAAA,QAAW;AAAA,SAAM;AAAA,MAC5C,oBAAC,cAAW,WAAU,oBAAmB;AAAA,OAC3C;AAAA,IACA,oBAAC,QAAG,WAAU,aACX,gBAAM,IAAI,CAAC,SACV,oBAAC,QACC,+BAAC,QAAK,MAAM,KAAK,MAAM,WAAU,oBAC/B;AAAA,0BAAC,SAAI,WAAU,qEACZ,eAAK,QAAQ,oBAAC,SAAI,KAAK,KAAK,OAAO,KAAI,IAAG,SAAQ,QAAO,WAAU,8BAA6B,IAAK,MACxG;AAAA,MACA,oBAAC,OAAE,WAAU,oGAAoG,eAAK,MAAK;AAAA,OAC7H,KANO,KAAK,OAOd,CACD,GACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -54,14 +54,18 @@ const SIZE = {
|
|
|
54
54
|
sm: { container: "h-6 w-6", icon: "h-3 w-3" },
|
|
55
55
|
md: { container: "h-8 w-8", icon: "h-4 w-4" }
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
const PILL = {
|
|
58
|
+
sm: "h-6 gap-1.5 px-2.5",
|
|
59
|
+
md: "h-8 gap-2 px-3"
|
|
60
|
+
};
|
|
61
|
+
function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUrl = "" }) {
|
|
58
62
|
const config = IP_TYPE_CONFIG.find(
|
|
59
63
|
(c) => c.label === ipType || c.apiValue === ipType
|
|
60
64
|
);
|
|
61
65
|
if (!config) return null;
|
|
62
66
|
const { icon: Icon, colorClass, bgClass, slug, label } = config;
|
|
63
67
|
const { container, icon } = SIZE[size];
|
|
64
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
65
69
|
"a",
|
|
66
70
|
{
|
|
67
71
|
href: `${baseUrl}/${slug}`,
|
|
@@ -70,11 +74,14 @@ function IpTypeBadge({ ipType, size = "sm", className, baseUrl = "" }) {
|
|
|
70
74
|
"inline-flex items-center justify-center rounded-full",
|
|
71
75
|
"transition-opacity hover:opacity-80",
|
|
72
76
|
bgClass,
|
|
73
|
-
container,
|
|
77
|
+
showLabel ? PILL[size] : container,
|
|
74
78
|
className
|
|
75
79
|
),
|
|
76
80
|
onClick: (e) => e.stopPropagation(),
|
|
77
|
-
children:
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: (0, import_cn.cn)(colorClass, icon) }),
|
|
83
|
+
showLabel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_cn.cn)("text-xs font-semibold", colorClass), children: label }) : null
|
|
84
|
+
]
|
|
78
85
|
}
|
|
79
86
|
);
|
|
80
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem, Award,\n FileText, BookOpen, File, Building, Code, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n software: Code,\n rwa: Building,\n patents: Award,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n custom: Layers,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={label}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n </a>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
1
|
+
{"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem, Award,\n FileText, BookOpen, File, Building, Code, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n software: Code,\n rwa: Building,\n patents: Award,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n custom: Layers,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={label}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\", colorClass)}>{label}</span> : null}\n </a>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkEI;AAhEJ,0BAGO;AACP,gBAAmB;AAC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AAW,cAAG,YAAY,IAAI,GAAG;AAAA,QACtC,YAAY,4CAAC,UAAK,eAAW,cAAG,yBAAyB,UAAU,GAAI,iBAAM,IAAU;AAAA;AAAA;AAAA,EAC1F;AAEJ;","names":[]}
|
|
@@ -11,9 +11,10 @@ declare const IP_TYPE_MAP: Record<string, IpTypeConfig>;
|
|
|
11
11
|
interface IpTypeBadgeProps {
|
|
12
12
|
ipType: string;
|
|
13
13
|
size?: "sm" | "md";
|
|
14
|
+
showLabel?: boolean;
|
|
14
15
|
className?: string;
|
|
15
16
|
baseUrl?: string;
|
|
16
17
|
}
|
|
17
|
-
declare function IpTypeBadge({ ipType, size, className, baseUrl }: IpTypeBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
18
|
+
declare function IpTypeBadge({ ipType, size, showLabel, className, baseUrl }: IpTypeBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
18
19
|
|
|
19
20
|
export { IP_TYPE_CONFIG, IP_TYPE_MAP, IpTypeBadge, type IpTypeBadgeProps, type IpTypeConfig, IpTypeData };
|
|
@@ -11,9 +11,10 @@ declare const IP_TYPE_MAP: Record<string, IpTypeConfig>;
|
|
|
11
11
|
interface IpTypeBadgeProps {
|
|
12
12
|
ipType: string;
|
|
13
13
|
size?: "sm" | "md";
|
|
14
|
+
showLabel?: boolean;
|
|
14
15
|
className?: string;
|
|
15
16
|
baseUrl?: string;
|
|
16
17
|
}
|
|
17
|
-
declare function IpTypeBadge({ ipType, size, className, baseUrl }: IpTypeBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
18
|
+
declare function IpTypeBadge({ ipType, size, showLabel, className, baseUrl }: IpTypeBadgeProps): react_jsx_runtime.JSX.Element | null;
|
|
18
19
|
|
|
19
20
|
export { IP_TYPE_CONFIG, IP_TYPE_MAP, IpTypeBadge, type IpTypeBadgeProps, type IpTypeConfig, IpTypeData };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import {
|
|
4
4
|
Music,
|
|
5
5
|
Palette,
|
|
@@ -40,14 +40,18 @@ const SIZE = {
|
|
|
40
40
|
sm: { container: "h-6 w-6", icon: "h-3 w-3" },
|
|
41
41
|
md: { container: "h-8 w-8", icon: "h-4 w-4" }
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
const PILL = {
|
|
44
|
+
sm: "h-6 gap-1.5 px-2.5",
|
|
45
|
+
md: "h-8 gap-2 px-3"
|
|
46
|
+
};
|
|
47
|
+
function IpTypeBadge({ ipType, size = "sm", showLabel = false, className, baseUrl = "" }) {
|
|
44
48
|
const config = IP_TYPE_CONFIG.find(
|
|
45
49
|
(c) => c.label === ipType || c.apiValue === ipType
|
|
46
50
|
);
|
|
47
51
|
if (!config) return null;
|
|
48
52
|
const { icon: Icon, colorClass, bgClass, slug, label } = config;
|
|
49
53
|
const { container, icon } = SIZE[size];
|
|
50
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
51
55
|
"a",
|
|
52
56
|
{
|
|
53
57
|
href: `${baseUrl}/${slug}`,
|
|
@@ -56,11 +60,14 @@ function IpTypeBadge({ ipType, size = "sm", className, baseUrl = "" }) {
|
|
|
56
60
|
"inline-flex items-center justify-center rounded-full",
|
|
57
61
|
"transition-opacity hover:opacity-80",
|
|
58
62
|
bgClass,
|
|
59
|
-
container,
|
|
63
|
+
showLabel ? PILL[size] : container,
|
|
60
64
|
className
|
|
61
65
|
),
|
|
62
66
|
onClick: (e) => e.stopPropagation(),
|
|
63
|
-
children:
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Icon, { className: cn(colorClass, icon) }),
|
|
69
|
+
showLabel ? /* @__PURE__ */ jsx("span", { className: cn("text-xs font-semibold", colorClass), children: label }) : null
|
|
70
|
+
]
|
|
64
71
|
}
|
|
65
72
|
);
|
|
66
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem, Award,\n FileText, BookOpen, File, Building, Code, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n software: Code,\n rwa: Building,\n patents: Award,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n custom: Layers,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={label}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n </a>\n );\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/components/ip-type-badge.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Music, Palette, Film, Camera, Gem, Award,\n FileText, BookOpen, File, Building, Code, Layers,\n} from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { IP_TYPE_DATA, IP_TYPE_DATA_MAP } from \"../data/ip-types.js\";\nimport type { IpTypeData } from \"../data/ip-types.js\";\n\nexport interface IpTypeConfig extends IpTypeData {\n icon: React.ElementType;\n}\n\nexport const IP_TYPE_CONFIG: IpTypeConfig[] = IP_TYPE_DATA.map((d) => {\n const icons: Record<string, React.ElementType> = {\n audio: Music,\n video: Film,\n art: Palette,\n photography: Camera,\n nft: Gem,\n software: Code,\n rwa: Building,\n patents: Award,\n posts: FileText,\n publications: BookOpen,\n documents: File,\n custom: Layers,\n };\n return { ...d, icon: icons[d.slug] ?? Layers };\n});\n\nexport const IP_TYPE_MAP = Object.fromEntries(\n IP_TYPE_CONFIG.map((c) => [c.slug, c])\n) as Record<string, IpTypeConfig>;\n\nexport { IP_TYPE_DATA, IP_TYPE_DATA_MAP };\nexport type { IpTypeData };\n\nconst SIZE = {\n sm: { container: \"h-6 w-6\", icon: \"h-3 w-3\" },\n md: { container: \"h-8 w-8\", icon: \"h-4 w-4\" },\n};\n\nconst PILL = {\n sm: \"h-6 gap-1.5 px-2.5\",\n md: \"h-8 gap-2 px-3\",\n};\n\nexport interface IpTypeBadgeProps {\n ipType: string;\n size?: \"sm\" | \"md\";\n showLabel?: boolean;\n className?: string;\n\n baseUrl?: string;\n}\n\nexport function IpTypeBadge({ ipType, size = \"sm\", showLabel = false, className, baseUrl = \"\" }: IpTypeBadgeProps) {\n const config = IP_TYPE_CONFIG.find(\n (c) => c.label === ipType || c.apiValue === ipType\n );\n if (!config) return null;\n const { icon: Icon, colorClass, bgClass, slug, label } = config;\n const { container, icon } = SIZE[size];\n return (\n <a\n href={`${baseUrl}/${slug}`}\n title={label}\n className={cn(\n \"inline-flex items-center justify-center rounded-full\",\n \"transition-opacity hover:opacity-80\",\n bgClass,\n showLabel ? PILL[size] : container,\n className\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Icon className={cn(colorClass, icon)} />\n {showLabel ? <span className={cn(\"text-xs font-semibold\", colorClass)}>{label}</span> : null}\n </a>\n );\n}\n"],"mappings":";AAkEI,SAYE,KAZF;AAhEJ;AAAA,EACE;AAAA,EAAO;AAAA,EAAS;AAAA,EAAM;AAAA,EAAQ;AAAA,EAAK;AAAA,EACnC;AAAA,EAAU;AAAA,EAAU;AAAA,EAAM;AAAA,EAAU;AAAA,EAAM;AAAA,OACrC;AACP,SAAS,UAAU;AACnB,SAAS,cAAc,wBAAwB;AAOxC,MAAM,iBAAiC,aAAa,IAAI,CAAC,MAAM;AACpE,QAAM,QAA2C;AAAA,IAC/C,OAAO;AAAA,IACP,OAAO;AAAA,IACP,KAAK;AAAA,IACL,aAAa;AAAA,IACb,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,SAAS;AAAA,IACT,OAAO;AAAA,IACP,cAAc;AAAA,IACd,WAAW;AAAA,IACX,QAAQ;AAAA,EACV;AACA,SAAO,EAAE,GAAG,GAAG,MAAM,MAAM,EAAE,IAAI,KAAK,OAAO;AAC/C,CAAC;AAEM,MAAM,cAAc,OAAO;AAAA,EAChC,eAAe,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AACvC;AAKA,MAAM,OAAO;AAAA,EACX,IAAI,EAAE,WAAW,WAAW,MAAM,UAAU;AAAA,EAC5C,IAAI,EAAE,WAAW,WAAW,MAAM,UAAU;AAC9C;AAEA,MAAM,OAAO;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AACN;AAWO,SAAS,YAAY,EAAE,QAAQ,OAAO,MAAM,YAAY,OAAO,WAAW,UAAU,GAAG,GAAqB;AACjH,QAAM,SAAS,eAAe;AAAA,IAC5B,CAAC,MAAM,EAAE,UAAU,UAAU,EAAE,aAAa;AAAA,EAC9C;AACA,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,EAAE,MAAM,MAAM,YAAY,SAAS,MAAM,MAAM,IAAI;AACzD,QAAM,EAAE,WAAW,KAAK,IAAI,KAAK,IAAI;AACrC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,GAAG,OAAO,IAAI,IAAI;AAAA,MACxB,OAAO;AAAA,MACP,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAY,KAAK,IAAI,IAAI;AAAA,QACzB;AAAA,MACF;AAAA,MACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,MAElC;AAAA,4BAAC,QAAK,WAAW,GAAG,YAAY,IAAI,GAAG;AAAA,QACtC,YAAY,oBAAC,UAAK,WAAW,GAAG,yBAAyB,UAAU,GAAI,iBAAM,IAAU;AAAA;AAAA;AAAA,EAC1F;AAEJ;","names":[]}
|
|
@@ -19,7 +19,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var ip_type_display_exports = {};
|
|
21
21
|
__export(ip_type_display_exports, {
|
|
22
|
-
IPTypeDisplay: () => IPTypeDisplay
|
|
22
|
+
IPTypeDisplay: () => IPTypeDisplay,
|
|
23
|
+
getEmbedSrc: () => getEmbedSrc
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(ip_type_display_exports);
|
|
25
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -221,6 +222,7 @@ function IPTypeDisplay({ attributes }) {
|
|
|
221
222
|
}
|
|
222
223
|
// Annotate the CommonJS export names for ESM import in node:
|
|
223
224
|
0 && (module.exports = {
|
|
224
|
-
IPTypeDisplay
|
|
225
|
+
IPTypeDisplay,
|
|
226
|
+
getEmbedSrc
|
|
225
227
|
});
|
|
226
228
|
//# sourceMappingURL=ip-type-display.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ip-type-display.tsx"],"sourcesContent":["\"use client\";\n\nimport type { IPType } from \"../data/ip.js\";\nimport {\n IP_TEMPLATES,\n EMBED_PLATFORM_META,\n SOCIAL_PLATFORM_META,\n type EmbedPlatform,\n} from \"../data/ip-templates.js\";\nimport { ipfsToHttp } from \"../utils/ipfs.js\";\nimport { ExternalLink, FileText, ShieldCheck } from \"lucide-react\";\n\ninterface Attr {\n trait_type?: string | null;\n value?: string | null;\n}\n\ninterface IPTypeDisplayProps {\n attributes: Attr[] | null | undefined;\n}\n\nfunction parseYouTubeEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n let id: string | null = null;\n if (u.hostname.includes(\"youtu.be\")) {\n id = u.pathname.slice(1);\n } else if (u.hostname.includes(\"youtube.com\")) {\n id = u.searchParams.get(\"v\");\n }\n if (!id) return null;\n return `https://www.youtube.com/embed/${id}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSpotifyEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"spotify.com\")) return null;\n\n const match = u.pathname.match(\n /(track|album|playlist|episode|show|artist)\\/([A-Za-z0-9]+)/\n );\n if (!match) return null;\n return `https://open.spotify.com/embed/${match[1]}/${match[2]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSoundCloudEmbed(url: string): string | null {\n try {\n new URL(url);\n if (!url.includes(\"soundcloud.com\")) return null;\n const encoded = encodeURIComponent(url);\n return `https://w.soundcloud.com/player/?url=${encoded}&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false`;\n } catch {\n return null;\n }\n}\n\nfunction parseTikTokEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"tiktok.com\")) return null;\n const match = u.pathname.match(/\\/video\\/(\\d+)/);\n if (!match) return null;\n return `https://www.tiktok.com/embed/v2/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseVimeoEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"vimeo.com\")) return null;\n const match = u.pathname.match(/(\\d+)/);\n if (!match) return null;\n return `https://player.vimeo.com/video/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nfunction getEmbedSrc(platform: EmbedPlatform, value: string): string | null {\n switch (platform) {\n case \"youtube\": return parseYouTubeEmbed(value);\n case \"spotify\": return parseSpotifyEmbed(value);\n case \"soundcloud\": return parseSoundCloudEmbed(value);\n case \"tiktok\": return parseTikTokEmbed(value);\n case \"vimeo\": return parseVimeoEmbed(value);\n }\n}\n\nconst COMPACT: Record<EmbedPlatform, boolean> = {\n spotify: true,\n soundcloud: true,\n youtube: false,\n tiktok: false,\n vimeo: false,\n};\n\nexport function IPTypeDisplay({ attributes }: IPTypeDisplayProps) {\n const attrs = attributes ?? [];\n\n const ipType = attrs.find(\n (a) => a.trait_type?.toLowerCase() === \"ip type\"\n )?.value as IPType | undefined;\n if (!ipType) return null;\n\n const template = IP_TEMPLATES[ipType];\n if (!template) return null;\n\n const getAttr = (key: string) =>\n attrs.find((a) => a.trait_type === key)?.value ?? null;\n\n const embeds = (template.embeds ?? []).flatMap((platform) => {\n const meta = EMBED_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const socials = (template.socials ?? []).flatMap((platform) => {\n const meta = SOCIAL_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const docUri = template.docUpload ? getAttr(template.docUpload.traitType) : null;\n\n if (embeds.length === 0 && socials.length === 0 && !docUri) return null;\n\n return (\n <div className=\"space-y-5\">\n\n {docUri && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Document\n </p>\n <a\n href={docUri.startsWith(\"ipfs://\") ? ipfsToHttp(docUri) : docUri}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-3 rounded-xl border border-border bg-muted/20 px-4 py-3 transition-colors hover:border-primary/40 group\"\n >\n <FileText className=\"h-5 w-5 text-primary shrink-0\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold group-hover:text-primary transition-colors\">\n View document\n </p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1 mt-0.5\">\n <ShieldCheck className=\"h-3 w-3 shrink-0\" />\n Stored on IPFS — immutable, timestamped copy of the original\n </p>\n </div>\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </a>\n </div>\n )}\n {embeds.map(({ platform, meta, value }) => {\n const src = getEmbedSrc(platform, value);\n if (src) {\n return (\n <div key={platform} className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n {meta.label}\n </p>\n {COMPACT[platform] ? (\n <iframe\n src={src}\n className=\"w-full rounded-xl border-0\"\n height={166}\n allow=\"autoplay\"\n loading=\"lazy\"\n title={meta.label}\n />\n ) : (\n <div className=\"relative w-full aspect-video rounded-xl overflow-hidden bg-muted/20\">\n <iframe\n src={src}\n className=\"absolute inset-0 w-full h-full\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n loading=\"lazy\"\n title={meta.label}\n />\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div key={platform}>\n <p className=\"text-xs font-medium text-muted-foreground mb-1\">\n {meta.label}\n </p>\n <a\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\"\n >\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n </div>\n );\n })}\n\n {socials.length > 0 && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Links\n </p>\n <div className=\"flex flex-wrap gap-2\">\n {socials.map(({ platform, meta, value }) => {\n const SIcon = meta.icon;\n return (\n <a\n key={platform}\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/30 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary/40 hover:text-foreground\"\n >\n <SIcon className=\"h-3.5 w-3.5\" />\n {meta.label}\n </a>\n );\n })}\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4IU;AAzIV,0BAKO;AACP,kBAA2B;AAC3B,0BAAoD;AAWpD,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,KAAoB;AACxB,QAAI,EAAE,SAAS,SAAS,UAAU,GAAG;AACnC,WAAK,EAAE,SAAS,MAAM,CAAC;AAAA,IACzB,WAAW,EAAE,SAAS,SAAS,aAAa,GAAG;AAC7C,WAAK,EAAE,aAAa,IAAI,GAAG;AAAA,IAC7B;AACA,QAAI,CAAC,GAAI,QAAO;AAChB,WAAO,iCAAiC,EAAE;AAAA,EAC5C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,CAAC,EAAE,SAAS,SAAS,aAAa,EAAG,QAAO;AAEhD,UAAM,QAAQ,EAAE,SAAS;AAAA,MACvB;AAAA,IACF;AACA,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,kCAAkC,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,EAC/D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,qBAAqB,KAA4B;AACxD,MAAI;AACF,QAAI,IAAI,GAAG;AACX,QAAI,CAAC,IAAI,SAAS,gBAAgB,EAAG,QAAO;AAC5C,UAAM,UAAU,mBAAmB,GAAG;AACtC,WAAO,wCAAwC,OAAO;AAAA,EACxD,QAAQ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c;AAAA,cAC9B,KAAK;AAAA;AAAA;AAAA,UAPD;AAAA,QAQP;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/ip-type-display.tsx"],"sourcesContent":["\"use client\";\n\nimport type { IPType } from \"../data/ip.js\";\nimport {\n IP_TEMPLATES,\n EMBED_PLATFORM_META,\n SOCIAL_PLATFORM_META,\n type EmbedPlatform,\n} from \"../data/ip-templates.js\";\nimport { ipfsToHttp } from \"../utils/ipfs.js\";\nimport { ExternalLink, FileText, ShieldCheck } from \"lucide-react\";\n\ninterface Attr {\n trait_type?: string | null;\n value?: string | null;\n}\n\ninterface IPTypeDisplayProps {\n attributes: Attr[] | null | undefined;\n}\n\nfunction parseYouTubeEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n let id: string | null = null;\n if (u.hostname.includes(\"youtu.be\")) {\n id = u.pathname.slice(1);\n } else if (u.hostname.includes(\"youtube.com\")) {\n id = u.searchParams.get(\"v\");\n }\n if (!id) return null;\n return `https://www.youtube.com/embed/${id}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSpotifyEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"spotify.com\")) return null;\n\n const match = u.pathname.match(\n /(track|album|playlist|episode|show|artist)\\/([A-Za-z0-9]+)/\n );\n if (!match) return null;\n return `https://open.spotify.com/embed/${match[1]}/${match[2]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSoundCloudEmbed(url: string): string | null {\n try {\n new URL(url);\n if (!url.includes(\"soundcloud.com\")) return null;\n const encoded = encodeURIComponent(url);\n return `https://w.soundcloud.com/player/?url=${encoded}&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false`;\n } catch {\n return null;\n }\n}\n\nfunction parseTikTokEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"tiktok.com\")) return null;\n const match = u.pathname.match(/\\/video\\/(\\d+)/);\n if (!match) return null;\n return `https://www.tiktok.com/embed/v2/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseVimeoEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"vimeo.com\")) return null;\n const match = u.pathname.match(/(\\d+)/);\n if (!match) return null;\n return `https://player.vimeo.com/video/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nexport function getEmbedSrc(platform: EmbedPlatform, value: string): string | null {\n switch (platform) {\n case \"youtube\": return parseYouTubeEmbed(value);\n case \"spotify\": return parseSpotifyEmbed(value);\n case \"soundcloud\": return parseSoundCloudEmbed(value);\n case \"tiktok\": return parseTikTokEmbed(value);\n case \"vimeo\": return parseVimeoEmbed(value);\n }\n}\n\nconst COMPACT: Record<EmbedPlatform, boolean> = {\n spotify: true,\n soundcloud: true,\n youtube: false,\n tiktok: false,\n vimeo: false,\n};\n\nexport function IPTypeDisplay({ attributes }: IPTypeDisplayProps) {\n const attrs = attributes ?? [];\n\n const ipType = attrs.find(\n (a) => a.trait_type?.toLowerCase() === \"ip type\"\n )?.value as IPType | undefined;\n if (!ipType) return null;\n\n const template = IP_TEMPLATES[ipType];\n if (!template) return null;\n\n const getAttr = (key: string) =>\n attrs.find((a) => a.trait_type === key)?.value ?? null;\n\n const embeds = (template.embeds ?? []).flatMap((platform) => {\n const meta = EMBED_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const socials = (template.socials ?? []).flatMap((platform) => {\n const meta = SOCIAL_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const docUri = template.docUpload ? getAttr(template.docUpload.traitType) : null;\n\n if (embeds.length === 0 && socials.length === 0 && !docUri) return null;\n\n return (\n <div className=\"space-y-5\">\n\n {docUri && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Document\n </p>\n <a\n href={docUri.startsWith(\"ipfs://\") ? ipfsToHttp(docUri) : docUri}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-3 rounded-xl border border-border bg-muted/20 px-4 py-3 transition-colors hover:border-primary/40 group\"\n >\n <FileText className=\"h-5 w-5 text-primary shrink-0\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold group-hover:text-primary transition-colors\">\n View document\n </p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1 mt-0.5\">\n <ShieldCheck className=\"h-3 w-3 shrink-0\" />\n Stored on IPFS — immutable, timestamped copy of the original\n </p>\n </div>\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </a>\n </div>\n )}\n {embeds.map(({ platform, meta, value }) => {\n const src = getEmbedSrc(platform, value);\n if (src) {\n return (\n <div key={platform} className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n {meta.label}\n </p>\n {COMPACT[platform] ? (\n <iframe\n src={src}\n className=\"w-full rounded-xl border-0\"\n height={166}\n allow=\"autoplay\"\n loading=\"lazy\"\n title={meta.label}\n />\n ) : (\n <div className=\"relative w-full aspect-video rounded-xl overflow-hidden bg-muted/20\">\n <iframe\n src={src}\n className=\"absolute inset-0 w-full h-full\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n loading=\"lazy\"\n title={meta.label}\n />\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div key={platform}>\n <p className=\"text-xs font-medium text-muted-foreground mb-1\">\n {meta.label}\n </p>\n <a\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\"\n >\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n </div>\n );\n })}\n\n {socials.length > 0 && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Links\n </p>\n <div className=\"flex flex-wrap gap-2\">\n {socials.map(({ platform, meta, value }) => {\n const SIcon = meta.icon;\n return (\n <a\n key={platform}\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/30 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary/40 hover:text-foreground\"\n >\n <SIcon className=\"h-3.5 w-3.5\" />\n {meta.label}\n </a>\n );\n })}\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4IU;AAzIV,0BAKO;AACP,kBAA2B;AAC3B,0BAAoD;AAWpD,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,KAAoB;AACxB,QAAI,EAAE,SAAS,SAAS,UAAU,GAAG;AACnC,WAAK,EAAE,SAAS,MAAM,CAAC;AAAA,IACzB,WAAW,EAAE,SAAS,SAAS,aAAa,GAAG;AAC7C,WAAK,EAAE,aAAa,IAAI,GAAG;AAAA,IAC7B;AACA,QAAI,CAAC,GAAI,QAAO;AAChB,WAAO,iCAAiC,EAAE;AAAA,EAC5C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,CAAC,EAAE,SAAS,SAAS,aAAa,EAAG,QAAO;AAEhD,UAAM,QAAQ,EAAE,SAAS;AAAA,MACvB;AAAA,IACF;AACA,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,kCAAkC,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,EAC/D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,qBAAqB,KAA4B;AACxD,MAAI;AACF,QAAI,IAAI,GAAG;AACX,QAAI,CAAC,IAAI,SAAS,gBAAgB,EAAG,QAAO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;AAAA,YACP,KAAI;AAAA,YACJ,WAAU;AAAA,YAEV;AAAA,0DAAC,SAAM,WAAU,eAAc;AAAA,cAC9B,KAAK;AAAA;AAAA;AAAA,UAPD;AAAA,QAQP;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { EmbedPlatform } from '../data/ip-templates.cjs';
|
|
3
|
+
import 'lucide-react';
|
|
4
|
+
import '../data/ip.cjs';
|
|
2
5
|
|
|
3
6
|
interface Attr {
|
|
4
7
|
trait_type?: string | null;
|
|
@@ -7,6 +10,7 @@ interface Attr {
|
|
|
7
10
|
interface IPTypeDisplayProps {
|
|
8
11
|
attributes: Attr[] | null | undefined;
|
|
9
12
|
}
|
|
13
|
+
declare function getEmbedSrc(platform: EmbedPlatform, value: string): string | null;
|
|
10
14
|
declare function IPTypeDisplay({ attributes }: IPTypeDisplayProps): react_jsx_runtime.JSX.Element | null;
|
|
11
15
|
|
|
12
|
-
export { IPTypeDisplay };
|
|
16
|
+
export { IPTypeDisplay, getEmbedSrc };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { EmbedPlatform } from '../data/ip-templates.js';
|
|
3
|
+
import 'lucide-react';
|
|
4
|
+
import '../data/ip.js';
|
|
2
5
|
|
|
3
6
|
interface Attr {
|
|
4
7
|
trait_type?: string | null;
|
|
@@ -7,6 +10,7 @@ interface Attr {
|
|
|
7
10
|
interface IPTypeDisplayProps {
|
|
8
11
|
attributes: Attr[] | null | undefined;
|
|
9
12
|
}
|
|
13
|
+
declare function getEmbedSrc(platform: EmbedPlatform, value: string): string | null;
|
|
10
14
|
declare function IPTypeDisplay({ attributes }: IPTypeDisplayProps): react_jsx_runtime.JSX.Element | null;
|
|
11
15
|
|
|
12
|
-
export { IPTypeDisplay };
|
|
16
|
+
export { IPTypeDisplay, getEmbedSrc };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/ip-type-display.tsx"],"sourcesContent":["\"use client\";\n\nimport type { IPType } from \"../data/ip.js\";\nimport {\n IP_TEMPLATES,\n EMBED_PLATFORM_META,\n SOCIAL_PLATFORM_META,\n type EmbedPlatform,\n} from \"../data/ip-templates.js\";\nimport { ipfsToHttp } from \"../utils/ipfs.js\";\nimport { ExternalLink, FileText, ShieldCheck } from \"lucide-react\";\n\ninterface Attr {\n trait_type?: string | null;\n value?: string | null;\n}\n\ninterface IPTypeDisplayProps {\n attributes: Attr[] | null | undefined;\n}\n\nfunction parseYouTubeEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n let id: string | null = null;\n if (u.hostname.includes(\"youtu.be\")) {\n id = u.pathname.slice(1);\n } else if (u.hostname.includes(\"youtube.com\")) {\n id = u.searchParams.get(\"v\");\n }\n if (!id) return null;\n return `https://www.youtube.com/embed/${id}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSpotifyEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"spotify.com\")) return null;\n\n const match = u.pathname.match(\n /(track|album|playlist|episode|show|artist)\\/([A-Za-z0-9]+)/\n );\n if (!match) return null;\n return `https://open.spotify.com/embed/${match[1]}/${match[2]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSoundCloudEmbed(url: string): string | null {\n try {\n new URL(url);\n if (!url.includes(\"soundcloud.com\")) return null;\n const encoded = encodeURIComponent(url);\n return `https://w.soundcloud.com/player/?url=${encoded}&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false`;\n } catch {\n return null;\n }\n}\n\nfunction parseTikTokEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"tiktok.com\")) return null;\n const match = u.pathname.match(/\\/video\\/(\\d+)/);\n if (!match) return null;\n return `https://www.tiktok.com/embed/v2/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseVimeoEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"vimeo.com\")) return null;\n const match = u.pathname.match(/(\\d+)/);\n if (!match) return null;\n return `https://player.vimeo.com/video/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nfunction getEmbedSrc(platform: EmbedPlatform, value: string): string | null {\n switch (platform) {\n case \"youtube\": return parseYouTubeEmbed(value);\n case \"spotify\": return parseSpotifyEmbed(value);\n case \"soundcloud\": return parseSoundCloudEmbed(value);\n case \"tiktok\": return parseTikTokEmbed(value);\n case \"vimeo\": return parseVimeoEmbed(value);\n }\n}\n\nconst COMPACT: Record<EmbedPlatform, boolean> = {\n spotify: true,\n soundcloud: true,\n youtube: false,\n tiktok: false,\n vimeo: false,\n};\n\nexport function IPTypeDisplay({ attributes }: IPTypeDisplayProps) {\n const attrs = attributes ?? [];\n\n const ipType = attrs.find(\n (a) => a.trait_type?.toLowerCase() === \"ip type\"\n )?.value as IPType | undefined;\n if (!ipType) return null;\n\n const template = IP_TEMPLATES[ipType];\n if (!template) return null;\n\n const getAttr = (key: string) =>\n attrs.find((a) => a.trait_type === key)?.value ?? null;\n\n const embeds = (template.embeds ?? []).flatMap((platform) => {\n const meta = EMBED_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const socials = (template.socials ?? []).flatMap((platform) => {\n const meta = SOCIAL_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const docUri = template.docUpload ? getAttr(template.docUpload.traitType) : null;\n\n if (embeds.length === 0 && socials.length === 0 && !docUri) return null;\n\n return (\n <div className=\"space-y-5\">\n\n {docUri && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Document\n </p>\n <a\n href={docUri.startsWith(\"ipfs://\") ? ipfsToHttp(docUri) : docUri}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-3 rounded-xl border border-border bg-muted/20 px-4 py-3 transition-colors hover:border-primary/40 group\"\n >\n <FileText className=\"h-5 w-5 text-primary shrink-0\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold group-hover:text-primary transition-colors\">\n View document\n </p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1 mt-0.5\">\n <ShieldCheck className=\"h-3 w-3 shrink-0\" />\n Stored on IPFS — immutable, timestamped copy of the original\n </p>\n </div>\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </a>\n </div>\n )}\n {embeds.map(({ platform, meta, value }) => {\n const src = getEmbedSrc(platform, value);\n if (src) {\n return (\n <div key={platform} className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n {meta.label}\n </p>\n {COMPACT[platform] ? (\n <iframe\n src={src}\n className=\"w-full rounded-xl border-0\"\n height={166}\n allow=\"autoplay\"\n loading=\"lazy\"\n title={meta.label}\n />\n ) : (\n <div className=\"relative w-full aspect-video rounded-xl overflow-hidden bg-muted/20\">\n <iframe\n src={src}\n className=\"absolute inset-0 w-full h-full\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n loading=\"lazy\"\n title={meta.label}\n />\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div key={platform}>\n <p className=\"text-xs font-medium text-muted-foreground mb-1\">\n {meta.label}\n </p>\n <a\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\"\n >\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n </div>\n );\n })}\n\n {socials.length > 0 && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Links\n </p>\n <div className=\"flex flex-wrap gap-2\">\n {socials.map(({ platform, meta, value }) => {\n const SIcon = meta.icon;\n return (\n <a\n key={platform}\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/30 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary/40 hover:text-foreground\"\n >\n <SIcon className=\"h-3.5 w-3.5\" />\n {meta.label}\n </a>\n );\n })}\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";AA4IU,cAcI,YAdJ;AAzIV;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,kBAAkB;AAC3B,SAAS,cAAc,UAAU,mBAAmB;AAWpD,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,KAAoB;AACxB,QAAI,EAAE,SAAS,SAAS,UAAU,GAAG;AACnC,WAAK,EAAE,SAAS,MAAM,CAAC;AAAA,IACzB,WAAW,EAAE,SAAS,SAAS,aAAa,GAAG;AAC7C,WAAK,EAAE,aAAa,IAAI,GAAG;AAAA,IAC7B;AACA,QAAI,CAAC,GAAI,QAAO;AAChB,WAAO,iCAAiC,EAAE;AAAA,EAC5C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,CAAC,EAAE,SAAS,SAAS,aAAa,EAAG,QAAO;AAEhD,UAAM,QAAQ,EAAE,SAAS;AAAA,MACvB;AAAA,IACF;AACA,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,kCAAkC,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,EAC/D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,qBAAqB,KAA4B;AACxD,MAAI;AACF,QAAI,IAAI,GAAG;AACX,QAAI,CAAC,IAAI,SAAS,gBAAgB,EAAG,QAAO;AAC5C,UAAM,UAAU,mBAAmB,GAAG;AACtC,WA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;AAAA,kCAAC,SAAM,WAAU,eAAc;AAAA,cAC9B,KAAK;AAAA;AAAA;AAAA,UAPD;AAAA,QAQP;AAAA,MAEJ,CAAC,GACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/ip-type-display.tsx"],"sourcesContent":["\"use client\";\n\nimport type { IPType } from \"../data/ip.js\";\nimport {\n IP_TEMPLATES,\n EMBED_PLATFORM_META,\n SOCIAL_PLATFORM_META,\n type EmbedPlatform,\n} from \"../data/ip-templates.js\";\nimport { ipfsToHttp } from \"../utils/ipfs.js\";\nimport { ExternalLink, FileText, ShieldCheck } from \"lucide-react\";\n\ninterface Attr {\n trait_type?: string | null;\n value?: string | null;\n}\n\ninterface IPTypeDisplayProps {\n attributes: Attr[] | null | undefined;\n}\n\nfunction parseYouTubeEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n let id: string | null = null;\n if (u.hostname.includes(\"youtu.be\")) {\n id = u.pathname.slice(1);\n } else if (u.hostname.includes(\"youtube.com\")) {\n id = u.searchParams.get(\"v\");\n }\n if (!id) return null;\n return `https://www.youtube.com/embed/${id}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSpotifyEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"spotify.com\")) return null;\n\n const match = u.pathname.match(\n /(track|album|playlist|episode|show|artist)\\/([A-Za-z0-9]+)/\n );\n if (!match) return null;\n return `https://open.spotify.com/embed/${match[1]}/${match[2]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseSoundCloudEmbed(url: string): string | null {\n try {\n new URL(url);\n if (!url.includes(\"soundcloud.com\")) return null;\n const encoded = encodeURIComponent(url);\n return `https://w.soundcloud.com/player/?url=${encoded}&color=%23ff5500&auto_play=false&hide_related=true&show_comments=false&show_user=true&show_reposts=false`;\n } catch {\n return null;\n }\n}\n\nfunction parseTikTokEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"tiktok.com\")) return null;\n const match = u.pathname.match(/\\/video\\/(\\d+)/);\n if (!match) return null;\n return `https://www.tiktok.com/embed/v2/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nfunction parseVimeoEmbed(url: string): string | null {\n try {\n const u = new URL(url);\n if (!u.hostname.includes(\"vimeo.com\")) return null;\n const match = u.pathname.match(/(\\d+)/);\n if (!match) return null;\n return `https://player.vimeo.com/video/${match[1]}`;\n } catch {\n return null;\n }\n}\n\nexport function getEmbedSrc(platform: EmbedPlatform, value: string): string | null {\n switch (platform) {\n case \"youtube\": return parseYouTubeEmbed(value);\n case \"spotify\": return parseSpotifyEmbed(value);\n case \"soundcloud\": return parseSoundCloudEmbed(value);\n case \"tiktok\": return parseTikTokEmbed(value);\n case \"vimeo\": return parseVimeoEmbed(value);\n }\n}\n\nconst COMPACT: Record<EmbedPlatform, boolean> = {\n spotify: true,\n soundcloud: true,\n youtube: false,\n tiktok: false,\n vimeo: false,\n};\n\nexport function IPTypeDisplay({ attributes }: IPTypeDisplayProps) {\n const attrs = attributes ?? [];\n\n const ipType = attrs.find(\n (a) => a.trait_type?.toLowerCase() === \"ip type\"\n )?.value as IPType | undefined;\n if (!ipType) return null;\n\n const template = IP_TEMPLATES[ipType];\n if (!template) return null;\n\n const getAttr = (key: string) =>\n attrs.find((a) => a.trait_type === key)?.value ?? null;\n\n const embeds = (template.embeds ?? []).flatMap((platform) => {\n const meta = EMBED_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const socials = (template.socials ?? []).flatMap((platform) => {\n const meta = SOCIAL_PLATFORM_META[platform];\n const value = getAttr(meta.traitKey);\n return value ? [{ platform, meta, value }] : [];\n });\n\n const docUri = template.docUpload ? getAttr(template.docUpload.traitType) : null;\n\n if (embeds.length === 0 && socials.length === 0 && !docUri) return null;\n\n return (\n <div className=\"space-y-5\">\n\n {docUri && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Document\n </p>\n <a\n href={docUri.startsWith(\"ipfs://\") ? ipfsToHttp(docUri) : docUri}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center gap-3 rounded-xl border border-border bg-muted/20 px-4 py-3 transition-colors hover:border-primary/40 group\"\n >\n <FileText className=\"h-5 w-5 text-primary shrink-0\" />\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm font-semibold group-hover:text-primary transition-colors\">\n View document\n </p>\n <p className=\"text-xs text-muted-foreground flex items-center gap-1 mt-0.5\">\n <ShieldCheck className=\"h-3 w-3 shrink-0\" />\n Stored on IPFS — immutable, timestamped copy of the original\n </p>\n </div>\n <ExternalLink className=\"h-3.5 w-3.5 text-muted-foreground shrink-0\" />\n </a>\n </div>\n )}\n {embeds.map(({ platform, meta, value }) => {\n const src = getEmbedSrc(platform, value);\n if (src) {\n return (\n <div key={platform} className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n {meta.label}\n </p>\n {COMPACT[platform] ? (\n <iframe\n src={src}\n className=\"w-full rounded-xl border-0\"\n height={166}\n allow=\"autoplay\"\n loading=\"lazy\"\n title={meta.label}\n />\n ) : (\n <div className=\"relative w-full aspect-video rounded-xl overflow-hidden bg-muted/20\">\n <iframe\n src={src}\n className=\"absolute inset-0 w-full h-full\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n loading=\"lazy\"\n title={meta.label}\n />\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div key={platform}>\n <p className=\"text-xs font-medium text-muted-foreground mb-1\">\n {meta.label}\n </p>\n <a\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 text-sm text-primary hover:underline\"\n >\n <ExternalLink className=\"h-3.5 w-3.5\" />\n Open link\n </a>\n </div>\n );\n })}\n\n {socials.length > 0 && (\n <div className=\"space-y-1.5\">\n <p className=\"text-xs font-medium text-muted-foreground\">\n Links\n </p>\n <div className=\"flex flex-wrap gap-2\">\n {socials.map(({ platform, meta, value }) => {\n const SIcon = meta.icon;\n return (\n <a\n key={platform}\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/30 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:border-primary/40 hover:text-foreground\"\n >\n <SIcon className=\"h-3.5 w-3.5\" />\n {meta.label}\n </a>\n );\n })}\n </div>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";AA4IU,cAcI,YAdJ;AAzIV;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,kBAAkB;AAC3B,SAAS,cAAc,UAAU,mBAAmB;AAWpD,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,KAAoB;AACxB,QAAI,EAAE,SAAS,SAAS,UAAU,GAAG;AACnC,WAAK,EAAE,SAAS,MAAM,CAAC;AAAA,IACzB,WAAW,EAAE,SAAS,SAAS,aAAa,GAAG;AAC7C,WAAK,EAAE,aAAa,IAAI,GAAG;AAAA,IAC7B;AACA,QAAI,CAAC,GAAI,QAAO;AAChB,WAAO,iCAAiC,EAAE;AAAA,EAC5C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,kBAAkB,KAA4B;AACrD,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,GAAG;AACrB,QAAI,CAAC,EAAE,SAAS,SAAS,aAAa,EAAG,QAAO;AAEhD,UAAM,QAAQ,EAAE,SAAS;AAAA,MACvB;AAAA,IACF;AACA,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,kCAAkC,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,EAC/D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,qBAAqB,KAA4B;AACxD,MAAI;AACF,QAAI,IAAI,GAAG;A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