@infinilabs/search-results 0.0.8 → 0.0.9
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/README.md +35 -2
- package/dist/index.d.ts +5 -1
- package/dist/search-results.cjs +2 -2
- package/dist/search-results.js +270 -254
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -198,7 +198,7 @@ import SearchResults, {
|
|
|
198
198
|
type SearchResultsProps
|
|
199
199
|
} from "@infinilabs/search-results";
|
|
200
200
|
|
|
201
|
-
export default function Demo({ data }: { data: Array<SearchResultsProps[
|
|
201
|
+
export default function Demo({ data }: { data: Array<SearchResultsProps["section"]> }) {
|
|
202
202
|
return (
|
|
203
203
|
<div className="space-y-10">
|
|
204
204
|
{data.map((section, index) => {
|
|
@@ -255,11 +255,43 @@ import type { SearchResultsProps } from "@infinilabs/search-results";
|
|
|
255
255
|
| 参数 | 类型 | 说明 |
|
|
256
256
|
|---|---|---|
|
|
257
257
|
| `section` | `SearchResultsProps["section"]` | 输入数据(section / item / record / 数组) |
|
|
258
|
-
| `className` | `string` | 根容器
|
|
258
|
+
| `className` | `string` | 根容器 `className` |
|
|
259
|
+
| `theme` | `"light" \| "dark" \| "auto"` | 组件主题(可选) |
|
|
259
260
|
| `footerAction` | `SearchResultsAction` | 底部“查看全部”动作(可选) |
|
|
260
261
|
| `onRecordClick` | `(record: SearchResultsRecord, index: number) => void` | record 输入时的点击回调 |
|
|
261
262
|
| `onItemClick` | `(item: SearchResultsItem) => void` | 统一点击回调 |
|
|
262
263
|
|
|
264
|
+
## 主题适配(light / dark)
|
|
265
|
+
|
|
266
|
+
组件随包产出样式(业务侧无需安装 Tailwind)。暗色样式基于 `.dark` class 驱动(语义等同于 Tailwind `dark:` 变体)。
|
|
267
|
+
|
|
268
|
+
你有两种接入方式:
|
|
269
|
+
|
|
270
|
+
### 方式 1:跟随业务侧主题(推荐)
|
|
271
|
+
|
|
272
|
+
业务侧在外层容器挂载/移除 `dark` class(例如放在页面根节点或局部容器),组件会自动跟随:
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
<div className={isDark ? "dark" : ""}>
|
|
276
|
+
<SearchResults section={data} />
|
|
277
|
+
</div>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### 方式 2:组件级主题开关
|
|
281
|
+
|
|
282
|
+
通过 `theme` 让组件在自身根节点挂载 `dark` class(不依赖外层):
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
<SearchResults section={data} theme="light" />
|
|
286
|
+
<SearchResults section={data} theme="dark" />
|
|
287
|
+
<SearchResults section={data} theme="auto" />
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
说明:
|
|
291
|
+
|
|
292
|
+
- `theme="auto"` 会根据 `prefers-color-scheme` 自动选择 light/dark
|
|
293
|
+
- 如果业务侧把 `dark` 挂在 `html` 上,组件无法在局部“强制 light”;想局部控制请把 `dark` 放到局部容器
|
|
294
|
+
|
|
263
295
|
## 工具函数
|
|
264
296
|
|
|
265
297
|
```ts
|
|
@@ -271,6 +303,7 @@ import { itemsToSections, recordsToItems } from "@infinilabs/search-results";
|
|
|
271
303
|
```ts
|
|
272
304
|
import type {
|
|
273
305
|
SearchResultsAction,
|
|
306
|
+
SearchResultsTheme,
|
|
274
307
|
SearchResultsItem,
|
|
275
308
|
SearchResultsSection,
|
|
276
309
|
SearchResultsRecord,
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare type SearchResultImageItem = SearchResultCommon & {
|
|
|
30
30
|
imageUrl: string;
|
|
31
31
|
imageAlt?: string;
|
|
32
32
|
subtitle?: string;
|
|
33
|
+
breadcrumbs?: string[];
|
|
33
34
|
onClick?: () => void;
|
|
34
35
|
};
|
|
35
36
|
|
|
@@ -62,7 +63,7 @@ export declare type SearchResultMediaItem = SearchResultCommon & {
|
|
|
62
63
|
onClick?: () => void;
|
|
63
64
|
};
|
|
64
65
|
|
|
65
|
-
declare function SearchResults({ section, className, footerAction, onRecordClick, onItemClick }: SearchResultsProps): JSX_2.Element;
|
|
66
|
+
declare function SearchResults({ section, className, theme, footerAction, onRecordClick, onItemClick }: SearchResultsProps): JSX_2.Element;
|
|
66
67
|
export default SearchResults;
|
|
67
68
|
|
|
68
69
|
export declare type SearchResultsAction = {
|
|
@@ -84,6 +85,7 @@ export declare type SearchResultsItem = SearchResultListItem | SearchResultImage
|
|
|
84
85
|
export declare type SearchResultsProps = {
|
|
85
86
|
section: SearchResultsSection | SearchResultsItem | SearchResultsRecord | Array<SearchResultsItem | SearchResultsRecord>;
|
|
86
87
|
className?: string;
|
|
88
|
+
theme?: SearchResultsTheme;
|
|
87
89
|
footerAction?: SearchResultsAction;
|
|
88
90
|
onRecordClick?: (record: SearchResultsRecord, index: number) => void;
|
|
89
91
|
onItemClick?: (item: SearchResultsItem) => void;
|
|
@@ -173,6 +175,8 @@ export declare type SearchResultsSection = {
|
|
|
173
175
|
className?: string;
|
|
174
176
|
};
|
|
175
177
|
|
|
178
|
+
export declare type SearchResultsTheme = "light" | "dark" | "auto";
|
|
179
|
+
|
|
176
180
|
export declare function SearchResultsVideoGroup(props: SearchResultsVideoGroupProps): JSX_2.Element;
|
|
177
181
|
|
|
178
182
|
export declare type SearchResultsVideoGroupProps = Omit<SearchResultsProps, "section"> & {
|
package/dist/search-results.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-700:oklch(37.2% .044 257.287);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.aspect-4\\/3{aspect-ratio:4/3}.aspect-video{aspect-ratio:var(--aspect-video)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-\\[90px\\]{height:90px}.h-full{height:100%}.h-px{height:1px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-10{width:calc(var(--spacing)*10)}.w-\\[160px\\]{width:160px}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-none{flex:none}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*10)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*10)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-\\[\\#E8E8E8\\]{border-color:#e8e8e8}.border-slate-200{border-color:var(--color-slate-200)}.bg-\\[\\#027FFE\\]{background-color:#027ffe}.bg-\\[\\#666\\]{background-color:#666}.bg-\\[\\#E02E2E\\]{background-color:#e02e2e}.bg-\\[\\#E8E8E8\\]{background-color:#e8e8e8}.bg-black\\/55{background-color:#0000008c}@supports (color:color-mix(in lab,red,red)){.bg-black\\/55{background-color:color-mix(in oklab,var(--color-black)55%,transparent)}}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-white{background-color:var(--color-white)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-12{padding-inline:calc(var(--spacing)*12)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.text-left{text-align:left}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\\[\\#1A0CAB\\]{color:#1a0cab}.text-\\[\\#007EFF\\]{color:#007eff}.text-\\[\\#333\\]{color:#333}.text-\\[\\#666\\]{color:#666}.text-slate-700{color:var(--color-slate-700)}.text-white{color:var(--color-white)}.no-underline{text-decoration-line:none}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-slate-200{--tw-ring-color:var(--color-slate-200)}.ring-white\\/30{--tw-ring-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.ring-white\\/30{--tw-ring-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.group-hover\\:underline:is(:where(.group):hover *){text-decoration-line:underline}.group-hover\\:underline-offset-2:is(:where(.group):hover *){text-underline-offset:2px}.hover\\:border-\\[\\#E8E8E8\\]:hover{border-color:#e8e8e8}.hover\\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:underline-offset-2:hover{text-underline-offset:2px}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-slate-300:focus-visible{--tw-ring-color:var(--color-slate-300)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),o=require("clsx"),u=require("lucide-react");function w(e,t){const i=t==="_blank"?"noreferrer noopener":"";return e?i?[...new Set([...e.split(" "),...i.split(" ")].filter(Boolean))].join(" "):e:i||void 0}function h({href:e,target:t,rel:i,onClick:r,className:n,children:l}){const a=n?`${n} cursor-pointer`:"cursor-pointer";return e?s.jsx("a",{href:e,target:t,rel:w(i,t),className:a,onClick:()=>r?.(),children:l}):s.jsx("button",{type:"button",className:a,onClick:r,children:l})}function G({item:e,onItemClick:t}){const i=e.onClick?void 0:e.href;return s.jsxs(h,{href:i,target:e.target,rel:e.rel,onClick:()=>{e.onClick?.(),t?.(e)},className:o("group w-full rounded-xl text-left transition","hover:border-slate-300 hover:bg-slate-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300"),children:[s.jsx("div",{className:"overflow-hidden rounded-lg ring-1 ring-slate-200",children:s.jsx("div",{className:"relative aspect-video bg-slate-100",children:s.jsx("img",{src:e.imageUrl,alt:e.imageAlt??e.title,className:"absolute inset-0 h-full w-full object-cover",loading:"lazy"})})}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"truncate text-sm font-semibold text-[#333]",children:e.title}),e.subtitle?s.jsx("div",{className:"mt-1 truncate text-sm text-[#666]",children:e.subtitle}):null]})]})}function T({author:e,date:t}){return!e&&!t?null:s.jsxs("div",{className:"flex-none truncate text-xs",children:[e?s.jsx("span",{className:"",children:e}):null,e&&t?s.jsx("span",{className:"mx-1",children:"·"}):null,t?s.jsx("span",{className:"",children:t}):null]})}function A({breadcrumbs:e}){return e?.length?s.jsx("div",{className:"min-w-0 truncate text-xs",children:e.map((t,i)=>s.jsxs("span",{children:[i>0?s.jsx("span",{className:"mx-1",children:">"}):null,s.jsx("span",{className:"",children:t})]},`${t}-${i}`))}):null}function F({meta:e}){return e?.length?s.jsx("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-[#333]",children:e.map((t,i)=>s.jsx("span",{className:"inline-flex items-center rounded border border-slate-200 bg-white px-3 py-1",children:t},`${t}-${i}`))}):null}function k(e){const t=e.trim().toLowerCase();return t?t==="google"?"G":e.trim().slice(0,1).toUpperCase():""}function p({title:e,titleIcon:t,titleIconBgColor:i,source:r,className:n,titleClassName:l}){return!e&&!t&&!r?null:s.jsxs("div",{className:o("mb-2 flex min-w-0 items-center gap-2",n),children:[t?i?s.jsx("span",{className:"inline-flex h-6 w-6 flex-none items-center justify-center rounded-md text-white",style:{backgroundColor:i},children:t}):s.jsx("span",{className:"flex-none",children:t}):null,e?s.jsx("div",{className:o("min-w-0 text-xl font-semibold cursor-pointer hover:underline hover:underline-offset-2 group-hover:underline group-hover:underline-offset-2",l),children:e}):null,r?s.jsx("span",{className:"inline-flex h-6 w-6 flex-none items-center justify-center rounded-md",title:r,children:k(r)}):null]})}function B(e){switch(e){case"doc":case"word":return"bg-[#027FFE] text-white";case"pdf":return"bg-[#E02E2E] text-white";default:return"bg-slate-100 text-slate-700"}}function S(e){switch(e){case"xls":return s.jsx(u.FileSpreadsheet,{className:"h-5 w-5"});case"ppt":return s.jsx(u.Presentation,{className:"h-5 w-5"});case"pdf":case"doc":case"word":case"text":return s.jsx(u.FileText,{className:"h-5 w-5"});default:return s.jsx(u.File,{className:"h-5 w-5"})}}function b({fileType:e,typeIcon:t}){return t?s.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center",children:t}):e?s.jsx("span",{className:o("inline-flex h-6 w-6 items-center justify-center rounded-md",B(e)),children:S(e)}):null}function E({item:e,onItemClick:t}){const i=e.typeIcon?s.jsx(b,{typeIcon:e.typeIcon}):e.fileType?s.jsx(b,{fileType:e.fileType}):null,r=e.onClick||t?()=>{e.onClick?.(),t?.(e)}:void 0,n=e.onClick?void 0:e.href,l=s.jsxs("div",{className:"w-full py-2",children:[s.jsx("div",{className:"flex min-w-0 items-center gap-2",children:s.jsx(p,{className:"mb-0 w-full",title:e.title,titleIcon:i,source:e.source,titleClassName:"truncate text-[#1A0CAB]"})}),s.jsxs("div",{className:"mt-2 flex gap-3",children:[e.thumbnailUrl?s.jsx("img",{src:e.thumbnailUrl,alt:e.thumbnailAlt??e.title,className:"h-[90px] w-[160px] flex-none rounded-lg object-cover ring-1 ring-slate-200",loading:"lazy"}):s.jsx("div",{className:"h-[90px] w-[160px] flex-none rounded-lg bg-slate-100 ring-1 ring-slate-200"}),s.jsxs("div",{className:"min-w-0 flex-1 flex flex-col justify-between",children:[e.description?s.jsx("div",{className:"line-clamp-2 text-sm text-[#666]",children:e.description}):null,e.breadcrumbs?.length||e.author||e.date?s.jsxs("div",{className:"mt-2 flex min-w-0 items-center gap-3 text-[#666]",children:[s.jsx(A,{breadcrumbs:e.breadcrumbs}),s.jsx("span",{className:"h-3 w-px flex-none bg-[#666]","aria-hidden":"true"}),s.jsxs("div",{className:"flex flex-none items-center gap-2",children:[s.jsx(T,{author:e.author,date:e.date}),e.href?s.jsx("span",{className:"flex-none text-[#007EFF]",children:s.jsx(u.ExternalLink,{className:"h-3 w-3"})}):null]})]}):s.jsx(F,{meta:e.meta})]})]})]});return!n&&!r?l:s.jsx(h,{href:n,target:e.target,rel:e.rel,onClick:r,className:"group block w-full rounded-xl px-3 text-left no-underline transition hover:bg-slate-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300",children:l})}function L({item:e,onItemClick:t}){const i=e.breadcrumbs??[e.sourceLabel,e.categoryLabel].filter(Boolean),r=e.onClick?void 0:e.href;return s.jsxs(h,{href:r,target:e.target,rel:e.rel,onClick:()=>{e.onClick?.(),t?.(e)},className:o("group w-full rounded-xl text-left transition","hover:border-slate-300 hover:bg-slate-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300"),children:[s.jsx("div",{className:"overflow-hidden rounded-lg ring-1 ring-slate-200",children:s.jsxs("div",{className:"relative aspect-4/3 bg-slate-100",children:[s.jsx("img",{src:e.thumbnailUrl,alt:e.thumbnailAlt??e.title,className:"absolute inset-0 h-full w-full object-cover",loading:"lazy"}),e.mediaType==="video"?s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full bg-black/55 text-white ring-1 ring-white/30",children:s.jsx(u.Play,{className:"h-5 w-5 translate-x-px"})})}):null]})}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"truncate text-sm font-medium",children:e.title}),e.matchCountText?s.jsx("div",{className:"mt-1 truncate text-xs text-[#666]",children:e.matchCountText}):null,i.length?s.jsx("div",{className:"mt-2 text-[#666]",children:s.jsx(A,{breadcrumbs:i})}):null]})]})}function U({action:e,className:t}){const i=o("flex-none inline-flex items-center justify-center rounded-full border border-slate-200 bg-white","h-9 px-12 text-sm font-medium text-slate-700 no-underline transition","cursor-pointer hover:border-slate-300 hover:bg-slate-50 hover:no-underline","focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300",t);return e.href?s.jsx("a",{className:i,href:e.href,target:e.target,rel:w(e.rel,e.target),onClick:()=>e.onClick?.(),children:e.label}):s.jsx("button",{className:i,type:"button",onClick:e.onClick,children:e.label})}function g({action:e}){return e?s.jsxs("div",{className:"mt-3 flex w-full items-center",children:[s.jsx("span",{className:"h-px flex-1 bg-[#E8E8E8]","aria-hidden":"true"}),s.jsx(U,{action:e,className:o("rounded-full border border-[#E8E8E8] bg-white px-4 py-2 text-sm font-medium text-[#333] transition","hover:border-[#E8E8E8] hover:bg-[#F5F5F5]")}),s.jsx("span",{className:"h-px flex-1 bg-[#E8E8E8]","aria-hidden":"true"})]}):null}function _(e,t){if(e.layout==="list")return s.jsxs("div",{className:o("space-y-6",e.className),children:[s.jsx(p,{title:e.title,titleIcon:e.titleIcon,titleIconBgColor:e.titleIconBgColor,titleClassName:e.titleClassName}),e.items.map(n=>s.jsx(E,{item:n,onItemClick:t},n.id)),s.jsx(g,{action:e.footerAction})]});if(e.layout==="mediaGrid"){const n=e.columns??3,l=n===2?"grid-cols-2":n===4?"grid-cols-4":"grid-cols-3";return s.jsxs("div",{className:o(e.className),children:[s.jsx(p,{title:e.title,titleIcon:e.titleIcon,titleIconBgColor:e.titleIconBgColor,titleClassName:e.titleClassName}),s.jsx("div",{className:o("grid gap-3",l),children:e.items.map(a=>s.jsx(L,{item:a,onItemClick:t},a.id))}),s.jsx(g,{action:e.footerAction})]})}const i=e.columns??3,r=i===2?"grid-cols-2":i===4?"grid-cols-4":"grid-cols-3";return s.jsxs("div",{className:o(e.className),children:[s.jsx(p,{title:e.title,titleIcon:e.titleIcon,titleIconBgColor:e.titleIconBgColor,titleClassName:e.titleClassName}),s.jsx("div",{className:o("grid gap-3",r),children:e.items.map(n=>s.jsx(G,{item:n,onItemClick:t},n.id))}),s.jsx(g,{action:e.footerAction})]})}function $(e){if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(0,10)}function z(e){const t=e?.trim().toLowerCase();if(t)return t==="pdf"?"pdf":t==="doc"||t==="docx"||t==="word"?"doc":t==="ppt"||t==="pptx"?"ppt":t==="xls"||t==="xlsx"||t==="excel"?"xls":t==="link"||t==="url"||t==="html"?"link":t==="txt"||t==="text"?"text":"unknown"}function v(e,t,i){const r=e.thumbnail??e.cover??e.metadata?.thumbnail_link,n=e.summary??e.content,l=z(e.metadata?.file_extension??e.type),a=e.source?.name,c=e.category??e.categories?.join(" / ")??"Categories",d=[a,c].filter(Boolean),m=e.last_updated_by?.user?.username??e.owner?.username,x=$(e.last_updated_by?.timestamp??e.metadata?.last_reviewed),f=e.metadata?.icon_link??e.icon,y=f?s.jsx("img",{src:f,alt:"",className:"h-5 w-5 rounded-sm object-contain"}):void 0;return{type:"result",id:`${e.source?.id??e.url??e.title}-${t}`,title:e.title,href:e.url,description:n,thumbnailUrl:r,fileType:l,typeIcon:y,breadcrumbs:d.length?d:void 0,author:m,date:x,onClick:i}}function j({section:e,className:t,footerAction:i,onRecordClick:r,onItemClick:n}){const l=M(C(e,r),i);return s.jsx("div",{className:o(t),children:_(l,n)})}function M(e,t){return!t||e.footerAction?e:e.layout==="list"?{...e,footerAction:t}:e.layout==="mediaGrid"?{...e,footerAction:t}:{...e,footerAction:t}}function H(e){return s.jsx(j,{...e})}function V(e){return s.jsx(j,{...e})}function C(e,t){if(Array.isArray(e))return q(e,t);if(P(e))return e;const i=e;if(i.type==="imageGroup"&&Array.isArray(i.items)){const n=i;return n.items[0]?.type==="media"?{type:"section",title:n.title,layout:"mediaGrid",items:n.items.filter(a=>typeof a=="object"&&!!a&&a.type==="media"),columns:n.columns,footerAction:n.footerAction,className:n.className}:{type:"section",title:n.title,layout:"imageGrid",items:n.items.filter(a=>typeof a=="object"&&!!a&&a.type==="image"),columns:n.columns,footerAction:n.footerAction,className:n.className}}if(i.type==="videoGroup"&&Array.isArray(i.items)){const n=i;return{type:"section",title:n.title,layout:"mediaGrid",items:n.items,columns:n.columns,footerAction:n.footerAction,className:n.className}}if(i.type==="result")return{type:"section",layout:"list",items:[e]};if(i.type==="media")return{type:"section",layout:"mediaGrid",items:[e]};if(i.type==="image"&&typeof i.imageUrl=="string")return{type:"section",layout:"imageGrid",items:[e]};const r=typeof i.type=="string"?i.type.trim().toLowerCase():void 0;if(r==="image"||r==="video"){const n=typeof i.id=="string"?i.id:void 0,l=typeof i.thumbnail=="string"?i.thumbnail:typeof i.cover=="string"?i.cover:typeof i.metadata=="object"&&i.metadata&&typeof i.metadata.thumbnail_link=="string"?i.metadata.thumbnail_link:void 0;if(l){const a=typeof i.category=="string"?i.category:Array.isArray(i.categories)?i.categories.filter(f=>typeof f=="string").join(" / "):void 0,c=typeof i.title=="string"?i.title:"Untitled",d=typeof i.url=="string"?i.url:void 0,m=typeof i.source=="object"&&i.source&&typeof i.source.name=="string"?i.source.name:void 0;return{type:"section",layout:"mediaGrid",items:[{type:"media",id:n??`${d??c}-0`,mediaType:r==="video"?"video":"image",title:c,href:t?void 0:d,thumbnailUrl:l,sourceLabel:m,categoryLabel:a,breadcrumbs:[m,a].filter(Boolean),...t?{onClick:()=>t(e,0)}:{}}]}}}return{type:"section",layout:"list",items:[v(e,0,t?()=>t(e,0):void 0)]}}function q(e,t){if(!e.length)return{type:"section",layout:"list",items:[]};if(e.every(I)){if(e.every(l=>l.type==="result"))return{type:"section",layout:"list",items:e};if(e.every(l=>l.type==="media"))return{type:"section",layout:"mediaGrid",items:e};if(e.every(l=>l.type==="image"&&"imageUrl"in l))return{type:"section",layout:"imageGrid",items:e};if(e.length===1)return C(e[0],t)}const i=[],r=[];for(const[l,a]of e.entries()){const c=D(a,l,t);c?i.push(c):r.push(v(a,l,t?()=>t(a,l):void 0))}return i.length&&!r.length?{type:"section",title:N(e,a=>a.category??a.source?.name),layout:"mediaGrid",items:i}:{type:"section",title:N(e,l=>l.category??l.source?.name),layout:"list",items:r}}function I(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="result"||t.type==="media"||t.type==="imageGroup"||t.type==="videoGroup"||t.type==="image"&&typeof e.imageUrl=="string"}function D(e,t,i){const r=e,n=typeof r.type=="string"?r.type.trim().toLowerCase():void 0;if(n!=="image"&&n!=="video")return;const l=typeof r.id=="string"?r.id:void 0,a=typeof r.thumbnail=="string"?r.thumbnail:typeof r.cover=="string"?r.cover:typeof r.metadata=="object"&&r.metadata&&typeof r.metadata.thumbnail_link=="string"?r.metadata.thumbnail_link:void 0;if(!a)return;const c=typeof r.category=="string"?r.category:Array.isArray(r.categories)?r.categories.filter(y=>typeof y=="string").join(" / "):void 0,d=typeof r.title=="string"?r.title:"Untitled",m=typeof r.url=="string"?r.url:void 0,x=typeof r.source=="object"&&r.source&&typeof r.source.name=="string"?r.source.name:void 0,f=!!i&&!I(e);return{type:"media",id:l??`${m??d}-0`,mediaType:n==="video"?"video":"image",title:d,href:f?void 0:m,thumbnailUrl:a,sourceLabel:x,categoryLabel:c,breadcrumbs:[x,c].filter(Boolean),...f?{onClick:()=>i(e,t)}:{}}}function N(e,t){const i=e[0],r=t(i);if(r){for(const n of e)if(t(n)!==r)return;return r}}function P(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="section"&&(t.layout==="list"||t.layout==="imageGrid"||t.layout==="mediaGrid")&&Array.isArray(t.items)}function O(e,t){const i=[];for(const r of e){const n=i.length?i[i.length-1]:void 0;if(r.type==="imageGroup"){r.items[0]?.type==="media"?i.push({type:"section",title:r.title,titleIcon:s.jsx(u.Image,{className:"h-4 w-4"}),titleIconBgColor:"#FFAF36",titleClassName:"text-[#1A0CAB]",layout:"mediaGrid",items:r.items.filter(a=>a.type==="media"),columns:r.columns??t,footerAction:r.footerAction,className:r.className}):i.push({type:"section",title:r.title,titleIcon:s.jsx(u.Image,{className:"h-4 w-4"}),titleIconBgColor:"#FFAF36",titleClassName:"text-[#1A0CAB]",layout:"imageGrid",items:r.items.filter(a=>a.type==="image"),columns:r.columns??t,footerAction:r.footerAction,className:r.className});continue}if(r.type==="videoGroup"){i.push({type:"section",title:r.title,titleIcon:s.jsx(u.Video,{className:"h-4 w-4"}),titleIconBgColor:"#1784FC",titleClassName:"text-[#1A0CAB]",layout:"mediaGrid",items:r.items,columns:r.columns??t,footerAction:r.footerAction,className:r.className});continue}if(r.type==="result"){if(n?.layout==="list"){n.items.push(r);continue}i.push({type:"section",layout:"list",items:[r]});continue}if(r.type==="media"){if(n?.layout==="mediaGrid"){n.items.push(r);continue}i.push({type:"section",layout:"mediaGrid",...t?{columns:t}:{},items:[r]});continue}if(n?.layout==="imageGrid"){n.items.push(r);continue}i.push({type:"section",layout:"imageGrid",...t?{columns:t}:{},items:[r]})}return i}function R(e){return e.map((t,i)=>v(t,i))}exports.SearchResultsImageGroup=H;exports.SearchResultsVideoGroup=V;exports.default=j;exports.itemsToSections=O;exports.recordsToItems=R;
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-sky-400:oklch(74.6% .16 232.661);--color-sky-600:oklch(58.8% .158 241.966);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.aspect-4\\/3{aspect-ratio:4/3}.aspect-video{aspect-ratio:var(--aspect-video)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-\\[90px\\]{height:90px}.h-full{height:100%}.h-px{height:1px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-10{width:calc(var(--spacing)*10)}.w-\\[160px\\]{width:160px}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-none{flex:none}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*10)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*10)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-700{border-color:var(--color-slate-700)}.border-transparent{border-color:#0000}.bg-\\[\\#027FFE\\]{background-color:#027ffe}.bg-\\[\\#E02E2E\\]{background-color:#e02e2e}.bg-black\\/55{background-color:#0000008c}@supports (color:color-mix(in lab,red,red)){.bg-black\\/55{background-color:color-mix(in oklab,var(--color-black)55%,transparent)}}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-950{background-color:var(--color-slate-950)}.bg-white{background-color:var(--color-white)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:calc(var(--spacing)*2)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-12{padding-inline:calc(var(--spacing)*12)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.text-left{text-align:left}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\\[\\#1A0CAB\\]{color:#1a0cab}.text-\\[\\#333\\]{color:#333}.text-\\[\\#666\\]{color:#666}.text-sky-600{color:var(--color-sky-600)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.no-underline{text-decoration-line:none}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-slate-200{--tw-ring-color:var(--color-slate-200)}.ring-white\\/30{--tw-ring-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.ring-white\\/30{--tw-ring-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.group-hover\\:underline:is(:where(.group):hover *){text-decoration-line:underline}.group-hover\\:underline-offset-2:is(:where(.group):hover *){text-underline-offset:2px}.hover\\:border-slate-200:hover{border-color:var(--color-slate-200)}.hover\\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:bg-slate-100\\/70:hover{background-color:#f1f5f9b3}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-slate-100\\/70:hover{background-color:color-mix(in oklab,var(--color-slate-100)70%,transparent)}}.hover\\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:underline-offset-2:hover{text-underline-offset:2px}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-slate-300:focus-visible{--tw-ring-color:var(--color-slate-300)}.focus-visible\\:ring-slate-600:focus-visible{--tw-ring-color:var(--color-slate-600)}.dark\\:border-slate-700:where(.dark,.dark *){border-color:var(--color-slate-700)}.dark\\:bg-slate-700:where(.dark,.dark *){background-color:var(--color-slate-700)}.dark\\:bg-slate-800:where(.dark,.dark *){background-color:var(--color-slate-800)}.dark\\:bg-slate-900:where(.dark,.dark *){background-color:var(--color-slate-900)}.dark\\:text-\\[\\#8AB4F8\\]:where(.dark,.dark *){color:#8ab4f8}.dark\\:text-sky-400:where(.dark,.dark *){color:var(--color-sky-400)}.dark\\:text-slate-100:where(.dark,.dark *){color:var(--color-slate-100)}.dark\\:text-slate-200:where(.dark,.dark *){color:var(--color-slate-200)}.dark\\:text-slate-300:where(.dark,.dark *){color:var(--color-slate-300)}.dark\\:text-slate-400:where(.dark,.dark *){color:var(--color-slate-400)}.dark\\:ring-slate-700:where(.dark,.dark *){--tw-ring-color:var(--color-slate-700)}@media(hover:hover){.dark\\:hover\\:border-slate-600:where(.dark,.dark *):hover{border-color:var(--color-slate-600)}.dark\\:hover\\:border-slate-700:where(.dark,.dark *):hover{border-color:var(--color-slate-700)}.dark\\:hover\\:bg-slate-800:where(.dark,.dark *):hover{background-color:var(--color-slate-800)}.dark\\:hover\\:bg-slate-800\\/60:where(.dark,.dark *):hover{background-color:#1d293d99}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-slate-800\\/60:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-slate-800)60%,transparent)}}}.dark\\:focus-visible\\:ring-slate-600:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-slate-600)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("clsx"),u=require("lucide-react");function h({breadcrumbs:e}){return e?.length?r.jsx("div",{className:"min-w-0 truncate text-xs",children:e.map((t,s)=>r.jsxs("span",{children:[s>0?r.jsx("span",{className:"mx-1",children:">"}):null,r.jsx("span",{className:"",children:t})]},`${t}-${s}`))}):null}function w(e,t){const s=t==="_blank"?"noreferrer noopener":"";return e?s?[...new Set([...e.split(" "),...s.split(" ")].filter(Boolean))].join(" "):e:s||void 0}function b({href:e,target:t,rel:s,onClick:l,className:i,children:a}){const n=i?`${i} cursor-pointer`:"cursor-pointer";return e?r.jsx("a",{href:e,target:t,rel:w(s,t),className:n,onClick:()=>l?.(),children:a}):r.jsx("button",{type:"button",className:n,onClick:l,children:a})}function I({item:e,onItemClick:t}){const s=e.onClick?void 0:e.href,l=e.breadcrumbs??[];return r.jsxs(b,{href:s,target:e.target,rel:e.rel,onClick:()=>{e.onClick?.(),t?.(e)},className:o("group block w-full rounded-xl border border-transparent p-2 text-left no-underline transition-colors","hover:border-slate-200 hover:bg-slate-100/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300","dark:hover:border-slate-700 dark:hover:bg-slate-800/60 dark:focus-visible:ring-slate-600"),children:[r.jsx("div",{className:"overflow-hidden rounded-lg ring-1 ring-slate-200 dark:ring-slate-700",children:r.jsx("div",{className:"relative aspect-video bg-slate-100 dark:bg-slate-800",children:r.jsx("img",{src:e.imageUrl,alt:e.imageAlt??e.title,className:"absolute inset-0 h-full w-full object-cover",loading:"lazy"})})}),r.jsxs("div",{className:"mt-2",children:[r.jsx("div",{className:"truncate text-sm font-semibold text-slate-900 dark:text-slate-100",children:e.title}),e.subtitle?r.jsx("div",{className:"mt-1 truncate text-sm text-slate-600 dark:text-slate-300",children:e.subtitle}):null,l.length?r.jsx("div",{className:"mt-2 text-slate-600 dark:text-slate-300",children:r.jsx(h,{breadcrumbs:l})}):null]})]})}function T({author:e,date:t}){return!e&&!t?null:r.jsxs("div",{className:"flex-none truncate text-xs",children:[e?r.jsx("span",{className:"",children:e}):null,e&&t?r.jsx("span",{className:"mx-1",children:"·"}):null,t?r.jsx("span",{className:"",children:t}):null]})}function G({meta:e}){return e?.length?r.jsx("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-slate-700 dark:text-slate-200",children:e.map((t,s)=>r.jsx("span",{className:"inline-flex items-center rounded border border-slate-200 bg-white px-3 py-1 dark:border-slate-700 dark:bg-slate-900",children:t},`${t}-${s}`))}):null}function B(e){const t=e.trim().toLowerCase();return t?t==="google"?"G":e.trim().slice(0,1).toUpperCase():""}function g({title:e,titleIcon:t,titleIconBgColor:s,source:l,className:i,titleClassName:a}){return!e&&!t&&!l?null:r.jsxs("div",{className:o("mb-2 flex min-w-0 items-center gap-2",i),children:[t?r.jsx("span",{className:o("inline-flex h-6 w-6 flex-none items-center justify-center",s&&"rounded-md text-white"),style:s?{backgroundColor:s}:void 0,children:t}):null,e?r.jsx("div",{className:o("min-w-0 cursor-pointer text-xl font-semibold leading-6 hover:underline hover:underline-offset-2 group-hover:underline group-hover:underline-offset-2",a),children:e}):null,l?r.jsx("span",{className:"inline-flex h-6 w-6 flex-none items-center justify-center rounded-md bg-slate-100 text-xs font-semibold text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:l,children:B(l)}):null]})}function F(e){switch(e){case"doc":case"word":return"bg-[#027FFE] text-white";case"pdf":return"bg-[#E02E2E] text-white";default:return"bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200"}}function S(e){switch(e){case"xls":return r.jsx(u.FileSpreadsheet,{className:"h-5 w-5"});case"ppt":return r.jsx(u.Presentation,{className:"h-5 w-5"});case"pdf":case"doc":case"word":case"text":return r.jsx(u.FileText,{className:"h-5 w-5"});default:return r.jsx(u.File,{className:"h-5 w-5"})}}function N({fileType:e,typeIcon:t}){return t?r.jsx("span",{className:"inline-flex h-6 w-6 items-center justify-center",children:t}):e?r.jsx("span",{className:o("inline-flex h-6 w-6 items-center justify-center rounded-md",F(e)),children:S(e)}):null}function L({item:e,onItemClick:t}){const s=e.typeIcon?r.jsx(N,{typeIcon:e.typeIcon}):e.fileType?r.jsx(N,{fileType:e.fileType}):null,l=e.onClick||t?()=>{e.onClick?.(),t?.(e)}:void 0,i=e.onClick?void 0:e.href,a=r.jsxs("div",{className:"w-full py-2",children:[r.jsx("div",{className:"flex min-w-0 items-center gap-2",children:r.jsx(g,{className:"mb-0 w-full",title:e.title,titleIcon:s,source:e.source,titleClassName:"truncate text-[#1A0CAB] dark:text-[#8AB4F8]"})}),r.jsxs("div",{className:"mt-2 flex gap-3",children:[e.thumbnailUrl?r.jsx("img",{src:e.thumbnailUrl,alt:e.thumbnailAlt??e.title,className:"h-[90px] w-[160px] flex-none rounded-lg object-cover ring-1 ring-slate-200 dark:ring-slate-700",loading:"lazy"}):null,r.jsxs("div",{className:"min-w-0 flex-1 flex flex-col justify-between",children:[e.description?r.jsx("div",{className:"line-clamp-2 text-sm text-slate-600 dark:text-slate-400",children:e.description}):null,e.breadcrumbs?.length||e.author||e.date?r.jsxs("div",{className:"mt-2 flex min-w-0 items-center gap-3 text-[#666] dark:text-slate-400",children:[r.jsx(h,{breadcrumbs:e.breadcrumbs}),r.jsx("span",{className:"h-3 w-px flex-none bg-slate-300 dark:bg-slate-700","aria-hidden":"true"}),r.jsxs("div",{className:"flex flex-none items-center gap-2",children:[r.jsx(T,{author:e.author,date:e.date}),e.href?r.jsx("span",{className:"flex-none text-sky-600 dark:text-sky-400",children:r.jsx(u.ExternalLink,{className:"h-3 w-3"})}):null]})]}):r.jsx(G,{meta:e.meta})]})]})]});return!i&&!l?a:r.jsx(b,{href:i,target:e.target,rel:e.rel,onClick:l,className:o("group block w-full rounded-xl border border-transparent px-3 py-2 text-left no-underline transition-colors","hover:border-slate-200 hover:bg-slate-100/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300","dark:hover:border-slate-700 dark:hover:bg-slate-800/60 dark:focus-visible:ring-slate-600"),children:a})}function U({item:e,onItemClick:t}){const s=e.breadcrumbs??[e.sourceLabel,e.categoryLabel].filter(Boolean),l=e.onClick?void 0:e.href;return r.jsxs(b,{href:l,target:e.target,rel:e.rel,onClick:()=>{e.onClick?.(),t?.(e)},className:o("group block w-full rounded-xl border border-transparent p-2 text-left no-underline transition-colors","hover:border-slate-200 hover:bg-slate-100/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300","dark:hover:border-slate-700 dark:hover:bg-slate-800/60 dark:focus-visible:ring-slate-600"),children:[r.jsx("div",{className:"overflow-hidden rounded-lg ring-1 ring-slate-200 dark:ring-slate-700",children:r.jsxs("div",{className:"relative aspect-4/3 bg-slate-100 dark:bg-slate-800",children:[r.jsx("img",{src:e.thumbnailUrl,alt:e.thumbnailAlt??e.title,className:"absolute inset-0 h-full w-full object-cover",loading:"lazy"}),e.mediaType==="video"?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-full bg-black/55 text-white ring-1 ring-white/30",children:r.jsx(u.Play,{className:"h-5 w-5 translate-x-px"})})}):null]})}),r.jsxs("div",{className:"mt-2",children:[r.jsx("div",{className:"mb-1 truncate text-sm font-medium text-[#333] dark:text-slate-100",children:e.title}),e.matchCountText?r.jsx("div",{className:"mb-1 truncate text-xs text-[#666] dark:text-slate-400",children:e.matchCountText}):null,s.length?r.jsxs("div",{className:"text-[#666] dark:text-slate-400",children:[r.jsx(h,{breadcrumbs:s})," "]}):null]})]})}function _({action:e,className:t}){const s=o("flex-none inline-flex items-center justify-center rounded-full border border-slate-200 bg-white","h-9 px-12 text-sm font-medium text-slate-700 no-underline transition","cursor-pointer hover:border-slate-300 hover:bg-slate-50 hover:no-underline","focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300","dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:border-slate-600 dark:hover:bg-slate-800 dark:focus-visible:ring-slate-600",t);return e.href?r.jsx("a",{className:s,href:e.href,target:e.target,rel:w(e.rel,e.target),onClick:()=>e.onClick?.(),children:e.label}):r.jsx("button",{className:s,type:"button",onClick:e.onClick,children:e.label})}function y({action:e}){return e?r.jsxs("div",{className:"mt-3 flex w-full items-center",children:[r.jsx("span",{className:"h-px flex-1 bg-slate-200 dark:bg-slate-700","aria-hidden":"true"}),r.jsx(_,{action:e,className:o("px-4")}),r.jsx("span",{className:"h-px flex-1 bg-slate-200 dark:bg-slate-700","aria-hidden":"true"})]}):null}function $(e,t){if(e.layout==="list")return r.jsxs("div",{className:o("space-y-6",e.className),children:[r.jsx(g,{title:e.title,titleIcon:e.titleIcon,titleIconBgColor:e.titleIconBgColor,titleClassName:e.titleClassName}),e.items.map(i=>r.jsx(L,{item:i,onItemClick:t},i.id)),r.jsx(y,{action:e.footerAction})]});if(e.layout==="mediaGrid"){const i=e.columns??3,a=i===2?"grid-cols-2":i===4?"grid-cols-4":"grid-cols-3";return r.jsxs("div",{className:o(e.className),children:[r.jsx(g,{title:e.title,titleIcon:e.titleIcon,titleIconBgColor:e.titleIconBgColor,titleClassName:e.titleClassName}),r.jsx("div",{className:o("grid gap-3",a),children:e.items.map(n=>r.jsx(U,{item:n,onItemClick:t},n.id))}),r.jsx(y,{action:e.footerAction})]})}const s=e.columns??3,l=s===2?"grid-cols-2":s===4?"grid-cols-4":"grid-cols-3";return r.jsxs("div",{className:o(e.className),children:[r.jsx(g,{title:e.title,titleIcon:e.titleIcon,titleIconBgColor:e.titleIconBgColor,titleClassName:e.titleClassName}),r.jsx("div",{className:o("grid gap-3",l),children:e.items.map(i=>r.jsx(I,{item:i,onItemClick:t},i.id))}),r.jsx(y,{action:e.footerAction})]})}function M(e){if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().slice(0,10)}function z(e){const t=e?.trim().toLowerCase();if(t)return t==="pdf"?"pdf":t==="doc"||t==="docx"||t==="word"?"doc":t==="ppt"||t==="pptx"?"ppt":t==="xls"||t==="xlsx"||t==="excel"?"xls":t==="link"||t==="url"||t==="html"?"link":t==="txt"||t==="text"?"text":"unknown"}function v(e,t,s){const l=e.thumbnail??e.cover??e.metadata?.thumbnail_link,i=e.summary??e.content,a=z(e.metadata?.file_extension??e.type),n=e.source?.name,c=e.category??e.categories?.join(" / ")??"Categories",d=[n,c].filter(Boolean),m=e.last_updated_by?.user?.username??e.owner?.username,x=M(e.last_updated_by?.timestamp??e.metadata?.last_reviewed),f=e.metadata?.icon_link??e.icon,p=f?r.jsx("img",{src:f,alt:"",className:"h-5 w-5 rounded-sm object-contain"}):void 0;return{type:"result",id:`${e.source?.id??e.url??e.title}-${t}`,title:e.title,href:e.url,description:i,thumbnailUrl:l,fileType:a,typeIcon:p,breadcrumbs:d.length?d:void 0,author:m,date:x,onClick:s}}function j({section:e,className:t,theme:s,footerAction:l,onRecordClick:i,onItemClick:a}){const n=H(A(e,i),l),c=E(s);return r.jsx("div",{className:o(c==="dark"&&"dark",t),children:$(n,a)})}function E(e){if(e)return e==="light"?"light":e==="dark"||typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function H(e,t){return!t||e.footerAction?e:e.layout==="list"?{...e,footerAction:t}:e.layout==="mediaGrid"?{...e,footerAction:t}:{...e,footerAction:t}}function V(e){return r.jsx(j,{...e})}function q(e){return r.jsx(j,{...e})}function A(e,t){if(Array.isArray(e))return D(e,t);if(O(e))return e;const s=e;if(s.type==="imageGroup"&&Array.isArray(s.items)){const i=s;return i.items[0]?.type==="media"?{type:"section",title:i.title,layout:"mediaGrid",items:i.items.filter(n=>typeof n=="object"&&!!n&&n.type==="media"),columns:i.columns,footerAction:i.footerAction,className:i.className}:{type:"section",title:i.title,layout:"imageGrid",items:i.items.filter(n=>typeof n=="object"&&!!n&&n.type==="image"),columns:i.columns,footerAction:i.footerAction,className:i.className}}if(s.type==="videoGroup"&&Array.isArray(s.items)){const i=s;return{type:"section",title:i.title,layout:"mediaGrid",items:i.items,columns:i.columns,footerAction:i.footerAction,className:i.className}}if(s.type==="result")return{type:"section",layout:"list",items:[e]};if(s.type==="media")return{type:"section",layout:"mediaGrid",items:[e]};if(s.type==="image"&&typeof s.imageUrl=="string")return{type:"section",layout:"imageGrid",items:[e]};const l=typeof s.type=="string"?s.type.trim().toLowerCase():void 0;if(l==="image"||l==="video"){const i=typeof s.id=="string"?s.id:void 0,a=typeof s.thumbnail=="string"?s.thumbnail:typeof s.cover=="string"?s.cover:typeof s.metadata=="object"&&s.metadata&&typeof s.metadata.thumbnail_link=="string"?s.metadata.thumbnail_link:void 0;if(a){const n=typeof s.category=="string"?s.category:Array.isArray(s.categories)?s.categories.filter(f=>typeof f=="string").join(" / "):void 0,c=typeof s.title=="string"?s.title:"Untitled",d=typeof s.url=="string"?s.url:void 0,m=typeof s.source=="object"&&s.source&&typeof s.source.name=="string"?s.source.name:void 0;return{type:"section",layout:"mediaGrid",items:[{type:"media",id:i??`${d??c}-0`,mediaType:l==="video"?"video":"image",title:c,href:t?void 0:d,thumbnailUrl:a,sourceLabel:m,categoryLabel:n,breadcrumbs:[m,n].filter(Boolean),...t?{onClick:()=>t(e,0)}:{}}]}}}return{type:"section",layout:"list",items:[v(e,0,t?()=>t(e,0):void 0)]}}function D(e,t){if(!e.length)return{type:"section",layout:"list",items:[]};if(e.every(C)){if(e.every(a=>a.type==="result"))return{type:"section",layout:"list",items:e};if(e.every(a=>a.type==="media"))return{type:"section",layout:"mediaGrid",items:e};if(e.every(a=>a.type==="image"&&"imageUrl"in a))return{type:"section",layout:"imageGrid",items:e};if(e.length===1)return A(e[0],t)}const s=[],l=[];for(const[a,n]of e.entries()){const c=P(n,a,t);c?s.push(c):l.push(v(n,a,t?()=>t(n,a):void 0))}return s.length&&!l.length?{type:"section",title:k(e,n=>n.category??n.source?.name),layout:"mediaGrid",items:s}:{type:"section",title:k(e,a=>a.category??a.source?.name),layout:"list",items:l}}function C(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="result"||t.type==="media"||t.type==="imageGroup"||t.type==="videoGroup"||t.type==="image"&&typeof e.imageUrl=="string"}function P(e,t,s){const l=e,i=typeof l.type=="string"?l.type.trim().toLowerCase():void 0;if(i!=="image"&&i!=="video")return;const a=typeof l.id=="string"?l.id:void 0,n=typeof l.thumbnail=="string"?l.thumbnail:typeof l.cover=="string"?l.cover:typeof l.metadata=="object"&&l.metadata&&typeof l.metadata.thumbnail_link=="string"?l.metadata.thumbnail_link:void 0;if(!n)return;const c=typeof l.category=="string"?l.category:Array.isArray(l.categories)?l.categories.filter(p=>typeof p=="string").join(" / "):void 0,d=typeof l.title=="string"?l.title:"Untitled",m=typeof l.url=="string"?l.url:void 0,x=typeof l.source=="object"&&l.source&&typeof l.source.name=="string"?l.source.name:void 0,f=!!s&&!C(e);return{type:"media",id:a??`${m??d}-0`,mediaType:i==="video"?"video":"image",title:d,href:f?void 0:m,thumbnailUrl:n,sourceLabel:x,categoryLabel:c,breadcrumbs:[x,c].filter(Boolean),...f?{onClick:()=>s(e,t)}:{}}}function k(e,t){const s=e[0],l=t(s);if(l){for(const i of e)if(t(i)!==l)return;return l}}function O(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="section"&&(t.layout==="list"||t.layout==="imageGrid"||t.layout==="mediaGrid")&&Array.isArray(t.items)}function R(e,t){const s=[];for(const l of e){const i=s.length?s[s.length-1]:void 0;if(l.type==="imageGroup"){l.items[0]?.type==="media"?s.push({type:"section",title:l.title,titleIcon:r.jsx(u.Image,{className:"h-4 w-4"}),titleIconBgColor:"#FFAF36",titleClassName:"text-[#1A0CAB] dark:text-[#8AB4F8]",layout:"mediaGrid",items:l.items.filter(n=>n.type==="media"),columns:l.columns??t,footerAction:l.footerAction,className:l.className}):s.push({type:"section",title:l.title,titleIcon:r.jsx(u.Image,{className:"h-4 w-4"}),titleIconBgColor:"#FFAF36",titleClassName:"text-[#1A0CAB] dark:text-[#8AB4F8]",layout:"imageGrid",items:l.items.filter(n=>n.type==="image"),columns:l.columns??t,footerAction:l.footerAction,className:l.className});continue}if(l.type==="videoGroup"){s.push({type:"section",title:l.title,titleIcon:r.jsx(u.Video,{className:"h-4 w-4"}),titleIconBgColor:"#1784FC",titleClassName:"text-[#1A0CAB] dark:text-[#8AB4F8]",layout:"mediaGrid",items:l.items,columns:l.columns??t,footerAction:l.footerAction,className:l.className});continue}if(l.type==="result"){if(i?.layout==="list"){i.items.push(l);continue}s.push({type:"section",layout:"list",items:[l]});continue}if(l.type==="media"){if(i?.layout==="mediaGrid"){i.items.push(l);continue}s.push({type:"section",layout:"mediaGrid",...t?{columns:t}:{},items:[l]});continue}if(i?.layout==="imageGrid"){i.items.push(l);continue}s.push({type:"section",layout:"imageGrid",...t?{columns:t}:{},items:[l]})}return s}function J(e){return e.map((t,s)=>v(t,s))}exports.SearchResultsImageGroup=V;exports.SearchResultsVideoGroup=q;exports.default=j;exports.itemsToSections=R;exports.recordsToItems=J;
|
package/dist/search-results.js
CHANGED
|
@@ -1,52 +1,59 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-700:oklch(37.2% .044 257.287);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.aspect-4\\/3{aspect-ratio:4/3}.aspect-video{aspect-ratio:var(--aspect-video)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-\\[90px\\]{height:90px}.h-full{height:100%}.h-px{height:1px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-10{width:calc(var(--spacing)*10)}.w-\\[160px\\]{width:160px}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-none{flex:none}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*10)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*10)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-\\[\\#E8E8E8\\]{border-color:#e8e8e8}.border-slate-200{border-color:var(--color-slate-200)}.bg-\\[\\#027FFE\\]{background-color:#027ffe}.bg-\\[\\#666\\]{background-color:#666}.bg-\\[\\#E02E2E\\]{background-color:#e02e2e}.bg-\\[\\#E8E8E8\\]{background-color:#e8e8e8}.bg-black\\/55{background-color:#0000008c}@supports (color:color-mix(in lab,red,red)){.bg-black\\/55{background-color:color-mix(in oklab,var(--color-black)55%,transparent)}}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-white{background-color:var(--color-white)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-12{padding-inline:calc(var(--spacing)*12)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.text-left{text-align:left}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\\[\\#1A0CAB\\]{color:#1a0cab}.text-\\[\\#007EFF\\]{color:#007eff}.text-\\[\\#333\\]{color:#333}.text-\\[\\#666\\]{color:#666}.text-slate-700{color:var(--color-slate-700)}.text-white{color:var(--color-white)}.no-underline{text-decoration-line:none}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-slate-200{--tw-ring-color:var(--color-slate-200)}.ring-white\\/30{--tw-ring-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.ring-white\\/30{--tw-ring-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.group-hover\\:underline:is(:where(.group):hover *){text-decoration-line:underline}.group-hover\\:underline-offset-2:is(:where(.group):hover *){text-underline-offset:2px}.hover\\:border-\\[\\#E8E8E8\\]:hover{border-color:#e8e8e8}.hover\\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:underline-offset-2:hover{text-underline-offset:2px}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-slate-300:focus-visible{--tw-ring-color:var(--color-slate-300)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { jsx as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-sky-400:oklch(74.6% .16 232.661);--color-sky-600:oklch(58.8% .158 241.966);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.aspect-4\\/3{aspect-ratio:4/3}.aspect-video{aspect-ratio:var(--aspect-video)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-\\[90px\\]{height:90px}.h-full{height:100%}.h-px{height:1px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-10{width:calc(var(--spacing)*10)}.w-\\[160px\\]{width:160px}.w-full{width:100%}.w-px{width:1px}.max-w-3xl{max-width:var(--container-3xl)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-none{flex:none}.translate-x-px{--tw-translate-x:1px;translate:var(--tw-translate-x)var(--tw-translate-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-10>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*10)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*10)*calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-700{border-color:var(--color-slate-700)}.border-transparent{border-color:#0000}.bg-\\[\\#027FFE\\]{background-color:#027ffe}.bg-\\[\\#E02E2E\\]{background-color:#e02e2e}.bg-black\\/55{background-color:#0000008c}@supports (color:color-mix(in lab,red,red)){.bg-black\\/55{background-color:color-mix(in oklab,var(--color-black)55%,transparent)}}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-300{background-color:var(--color-slate-300)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-950{background-color:var(--color-slate-950)}.bg-white{background-color:var(--color-white)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:calc(var(--spacing)*2)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-12{padding-inline:calc(var(--spacing)*12)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.text-left{text-align:left}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\\[\\#1A0CAB\\]{color:#1a0cab}.text-\\[\\#333\\]{color:#333}.text-\\[\\#666\\]{color:#666}.text-sky-600{color:var(--color-sky-600)}.text-slate-100{color:var(--color-slate-100)}.text-slate-200{color:var(--color-slate-200)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.no-underline{text-decoration-line:none}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-slate-200{--tw-ring-color:var(--color-slate-200)}.ring-white\\/30{--tw-ring-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.ring-white\\/30{--tw-ring-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.group-hover\\:underline:is(:where(.group):hover *){text-decoration-line:underline}.group-hover\\:underline-offset-2:is(:where(.group):hover *){text-underline-offset:2px}.hover\\:border-slate-200:hover{border-color:var(--color-slate-200)}.hover\\:border-slate-300:hover{border-color:var(--color-slate-300)}.hover\\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\\:bg-slate-100\\/70:hover{background-color:#f1f5f9b3}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-slate-100\\/70:hover{background-color:color-mix(in oklab,var(--color-slate-100)70%,transparent)}}.hover\\:bg-slate-800:hover{background-color:var(--color-slate-800)}.hover\\:no-underline:hover{text-decoration-line:none}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:underline-offset-2:hover{text-underline-offset:2px}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-slate-300:focus-visible{--tw-ring-color:var(--color-slate-300)}.focus-visible\\:ring-slate-600:focus-visible{--tw-ring-color:var(--color-slate-600)}.dark\\:border-slate-700:where(.dark,.dark *){border-color:var(--color-slate-700)}.dark\\:bg-slate-700:where(.dark,.dark *){background-color:var(--color-slate-700)}.dark\\:bg-slate-800:where(.dark,.dark *){background-color:var(--color-slate-800)}.dark\\:bg-slate-900:where(.dark,.dark *){background-color:var(--color-slate-900)}.dark\\:text-\\[\\#8AB4F8\\]:where(.dark,.dark *){color:#8ab4f8}.dark\\:text-sky-400:where(.dark,.dark *){color:var(--color-sky-400)}.dark\\:text-slate-100:where(.dark,.dark *){color:var(--color-slate-100)}.dark\\:text-slate-200:where(.dark,.dark *){color:var(--color-slate-200)}.dark\\:text-slate-300:where(.dark,.dark *){color:var(--color-slate-300)}.dark\\:text-slate-400:where(.dark,.dark *){color:var(--color-slate-400)}.dark\\:ring-slate-700:where(.dark,.dark *){--tw-ring-color:var(--color-slate-700)}@media(hover:hover){.dark\\:hover\\:border-slate-600:where(.dark,.dark *):hover{border-color:var(--color-slate-600)}.dark\\:hover\\:border-slate-700:where(.dark,.dark *):hover{border-color:var(--color-slate-700)}.dark\\:hover\\:bg-slate-800:where(.dark,.dark *):hover{background-color:var(--color-slate-800)}.dark\\:hover\\:bg-slate-800\\/60:where(.dark,.dark *):hover{background-color:#1d293d99}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-slate-800\\/60:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-slate-800)60%,transparent)}}}.dark\\:focus-visible\\:ring-slate-600:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-slate-600)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
3
|
import c from "clsx";
|
|
4
|
-
import { File as
|
|
4
|
+
import { File as B, FileText as G, Presentation as T, FileSpreadsheet as F, ExternalLink as L, Play as S, Image as N, Video as U } from "lucide-react";
|
|
5
|
+
function b({ breadcrumbs: e }) {
|
|
6
|
+
return e?.length ? /* @__PURE__ */ a("div", { className: "min-w-0 truncate text-xs", children: e.map((t, r) => /* @__PURE__ */ o("span", { children: [
|
|
7
|
+
r > 0 ? /* @__PURE__ */ a("span", { className: "mx-1", children: ">" }) : null,
|
|
8
|
+
/* @__PURE__ */ a("span", { className: "", children: t })
|
|
9
|
+
] }, `${t}-${r}`)) }) : null;
|
|
10
|
+
}
|
|
5
11
|
function A(e, t) {
|
|
6
|
-
const
|
|
7
|
-
return e ?
|
|
12
|
+
const r = t === "_blank" ? "noreferrer noopener" : "";
|
|
13
|
+
return e ? r ? [...new Set([...e.split(" "), ...r.split(" ")].filter(Boolean))].join(" ") : e : r || void 0;
|
|
8
14
|
}
|
|
9
15
|
function v({
|
|
10
16
|
href: e,
|
|
11
17
|
target: t,
|
|
12
|
-
rel:
|
|
13
|
-
onClick:
|
|
14
|
-
className:
|
|
18
|
+
rel: r,
|
|
19
|
+
onClick: l,
|
|
20
|
+
className: i,
|
|
15
21
|
children: s
|
|
16
22
|
}) {
|
|
17
|
-
const
|
|
18
|
-
return e ? /* @__PURE__ */
|
|
23
|
+
const n = i ? `${i} cursor-pointer` : "cursor-pointer";
|
|
24
|
+
return e ? /* @__PURE__ */ a(
|
|
19
25
|
"a",
|
|
20
26
|
{
|
|
21
27
|
href: e,
|
|
22
28
|
target: t,
|
|
23
|
-
rel: A(
|
|
24
|
-
className:
|
|
25
|
-
onClick: () =>
|
|
29
|
+
rel: A(r, t),
|
|
30
|
+
className: n,
|
|
31
|
+
onClick: () => l?.(),
|
|
26
32
|
children: s
|
|
27
33
|
}
|
|
28
|
-
) : /* @__PURE__ */
|
|
34
|
+
) : /* @__PURE__ */ a("button", { type: "button", className: n, onClick: l, children: s });
|
|
29
35
|
}
|
|
30
|
-
function
|
|
36
|
+
function _({
|
|
31
37
|
item: e,
|
|
32
38
|
onItemClick: t
|
|
33
39
|
}) {
|
|
34
|
-
const
|
|
40
|
+
const r = e.onClick ? void 0 : e.href, l = e.breadcrumbs ?? [];
|
|
35
41
|
return /* @__PURE__ */ o(
|
|
36
42
|
v,
|
|
37
43
|
{
|
|
38
|
-
href:
|
|
44
|
+
href: r,
|
|
39
45
|
target: e.target,
|
|
40
46
|
rel: e.rel,
|
|
41
47
|
onClick: () => {
|
|
42
48
|
e.onClick?.(), t?.(e);
|
|
43
49
|
},
|
|
44
50
|
className: c(
|
|
45
|
-
"group w-full rounded-xl text-left transition",
|
|
46
|
-
"hover:border-slate-
|
|
51
|
+
"group block w-full rounded-xl border border-transparent p-2 text-left no-underline transition-colors",
|
|
52
|
+
"hover:border-slate-200 hover:bg-slate-100/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300",
|
|
53
|
+
"dark:hover:border-slate-700 dark:hover:bg-slate-800/60 dark:focus-visible:ring-slate-600"
|
|
47
54
|
),
|
|
48
55
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ a("div", { className: "overflow-hidden rounded-lg ring-1 ring-slate-200 dark:ring-slate-700", children: /* @__PURE__ */ a("div", { className: "relative aspect-video bg-slate-100 dark:bg-slate-800", children: /* @__PURE__ */ a(
|
|
50
57
|
"img",
|
|
51
58
|
{
|
|
52
59
|
src: e.imageUrl,
|
|
@@ -56,78 +63,76 @@ function U({
|
|
|
56
63
|
}
|
|
57
64
|
) }) }),
|
|
58
65
|
/* @__PURE__ */ o("div", { className: "mt-2", children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
e.subtitle ? /* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ a("div", { className: "truncate text-sm font-semibold text-slate-900 dark:text-slate-100", children: e.title }),
|
|
67
|
+
e.subtitle ? /* @__PURE__ */ a("div", { className: "mt-1 truncate text-sm text-slate-600 dark:text-slate-300", children: e.subtitle }) : null,
|
|
68
|
+
l.length ? /* @__PURE__ */ a("div", { className: "mt-2 text-slate-600 dark:text-slate-300", children: /* @__PURE__ */ a(b, { breadcrumbs: l }) }) : null
|
|
61
69
|
] })
|
|
62
70
|
]
|
|
63
71
|
}
|
|
64
72
|
);
|
|
65
73
|
}
|
|
66
|
-
function
|
|
74
|
+
function $({ author: e, date: t }) {
|
|
67
75
|
return !e && !t ? null : /* @__PURE__ */ o("div", { className: "flex-none truncate text-xs", children: [
|
|
68
|
-
e ? /* @__PURE__ */
|
|
69
|
-
e && t ? /* @__PURE__ */
|
|
70
|
-
t ? /* @__PURE__ */
|
|
76
|
+
e ? /* @__PURE__ */ a("span", { className: "", children: e }) : null,
|
|
77
|
+
e && t ? /* @__PURE__ */ a("span", { className: "mx-1", children: "·" }) : null,
|
|
78
|
+
t ? /* @__PURE__ */ a("span", { className: "", children: t }) : null
|
|
71
79
|
] });
|
|
72
80
|
}
|
|
73
|
-
function
|
|
74
|
-
return e?.length ? /* @__PURE__ */
|
|
75
|
-
i > 0 ? /* @__PURE__ */ n("span", { className: "mx-1", children: ">" }) : null,
|
|
76
|
-
/* @__PURE__ */ n("span", { className: "", children: t })
|
|
77
|
-
] }, `${t}-${i}`)) }) : null;
|
|
78
|
-
}
|
|
79
|
-
function $({ meta: e }) {
|
|
80
|
-
return e?.length ? /* @__PURE__ */ n("div", { className: "mt-2 flex flex-wrap gap-2 text-xs text-[#333]", children: e.map((t, i) => /* @__PURE__ */ n(
|
|
81
|
+
function z({ meta: e }) {
|
|
82
|
+
return e?.length ? /* @__PURE__ */ a("div", { className: "mt-2 flex flex-wrap gap-2 text-xs text-slate-700 dark:text-slate-200", children: e.map((t, r) => /* @__PURE__ */ a(
|
|
81
83
|
"span",
|
|
82
84
|
{
|
|
83
|
-
className: "inline-flex items-center rounded border border-slate-200 bg-white px-3 py-1",
|
|
85
|
+
className: "inline-flex items-center rounded border border-slate-200 bg-white px-3 py-1 dark:border-slate-700 dark:bg-slate-900",
|
|
84
86
|
children: t
|
|
85
87
|
},
|
|
86
|
-
`${t}-${
|
|
88
|
+
`${t}-${r}`
|
|
87
89
|
)) }) : null;
|
|
88
90
|
}
|
|
89
|
-
function
|
|
91
|
+
function E(e) {
|
|
90
92
|
const t = e.trim().toLowerCase();
|
|
91
93
|
return t ? t === "google" ? "G" : e.trim().slice(0, 1).toUpperCase() : "";
|
|
92
94
|
}
|
|
93
|
-
function
|
|
95
|
+
function g({
|
|
94
96
|
title: e,
|
|
95
97
|
titleIcon: t,
|
|
96
|
-
titleIconBgColor:
|
|
97
|
-
source:
|
|
98
|
-
className:
|
|
98
|
+
titleIconBgColor: r,
|
|
99
|
+
source: l,
|
|
100
|
+
className: i,
|
|
99
101
|
titleClassName: s
|
|
100
102
|
}) {
|
|
101
|
-
return !e && !t && !
|
|
102
|
-
t ?
|
|
103
|
+
return !e && !t && !l ? null : /* @__PURE__ */ o("div", { className: c("mb-2 flex min-w-0 items-center gap-2", i), children: [
|
|
104
|
+
t ? /* @__PURE__ */ a(
|
|
103
105
|
"span",
|
|
104
106
|
{
|
|
105
|
-
className:
|
|
106
|
-
|
|
107
|
+
className: c(
|
|
108
|
+
"inline-flex h-6 w-6 flex-none items-center justify-center",
|
|
109
|
+
r && "rounded-md text-white"
|
|
110
|
+
),
|
|
111
|
+
style: r ? { backgroundColor: r } : void 0,
|
|
107
112
|
children: t
|
|
108
113
|
}
|
|
109
|
-
) :
|
|
110
|
-
e ? /* @__PURE__ */
|
|
114
|
+
) : null,
|
|
115
|
+
e ? /* @__PURE__ */ a(
|
|
111
116
|
"div",
|
|
112
117
|
{
|
|
113
118
|
className: c(
|
|
114
|
-
"min-w-0 text-xl font-semibold
|
|
119
|
+
"min-w-0 cursor-pointer text-xl font-semibold leading-6 hover:underline hover:underline-offset-2 group-hover:underline group-hover:underline-offset-2",
|
|
115
120
|
s
|
|
116
121
|
),
|
|
117
122
|
children: e
|
|
118
123
|
}
|
|
119
124
|
) : null,
|
|
120
|
-
|
|
125
|
+
l ? /* @__PURE__ */ a(
|
|
121
126
|
"span",
|
|
122
127
|
{
|
|
123
|
-
className: "inline-flex h-6 w-6 flex-none items-center justify-center rounded-md",
|
|
124
|
-
title:
|
|
125
|
-
children:
|
|
128
|
+
className: "inline-flex h-6 w-6 flex-none items-center justify-center rounded-md bg-slate-100 text-xs font-semibold text-slate-700 dark:bg-slate-800 dark:text-slate-200",
|
|
129
|
+
title: l,
|
|
130
|
+
children: E(l)
|
|
126
131
|
}
|
|
127
132
|
) : null
|
|
128
133
|
] });
|
|
129
134
|
}
|
|
130
|
-
function
|
|
135
|
+
function M(e) {
|
|
131
136
|
switch (e) {
|
|
132
137
|
case "doc":
|
|
133
138
|
case "word":
|
|
@@ -135,87 +140,91 @@ function H(e) {
|
|
|
135
140
|
case "pdf":
|
|
136
141
|
return "bg-[#E02E2E] text-white";
|
|
137
142
|
default:
|
|
138
|
-
return "bg-slate-100 text-slate-700";
|
|
143
|
+
return "bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200";
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
|
-
function
|
|
146
|
+
function H(e) {
|
|
142
147
|
switch (e) {
|
|
143
148
|
case "xls":
|
|
144
|
-
return /* @__PURE__ */
|
|
149
|
+
return /* @__PURE__ */ a(F, { className: "h-5 w-5" });
|
|
145
150
|
case "ppt":
|
|
146
|
-
return /* @__PURE__ */
|
|
151
|
+
return /* @__PURE__ */ a(T, { className: "h-5 w-5" });
|
|
147
152
|
case "pdf":
|
|
148
153
|
case "doc":
|
|
149
154
|
case "word":
|
|
150
155
|
case "text":
|
|
151
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ a(G, { className: "h-5 w-5" });
|
|
152
157
|
default:
|
|
153
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ a(B, { className: "h-5 w-5" });
|
|
154
159
|
}
|
|
155
160
|
}
|
|
156
|
-
function
|
|
161
|
+
function k({
|
|
157
162
|
fileType: e,
|
|
158
163
|
typeIcon: t
|
|
159
164
|
}) {
|
|
160
|
-
return t ? /* @__PURE__ */
|
|
165
|
+
return t ? /* @__PURE__ */ a("span", { className: "inline-flex h-6 w-6 items-center justify-center", children: t }) : e ? /* @__PURE__ */ a(
|
|
161
166
|
"span",
|
|
162
167
|
{
|
|
163
168
|
className: c(
|
|
164
169
|
"inline-flex h-6 w-6 items-center justify-center rounded-md",
|
|
165
|
-
|
|
170
|
+
M(e)
|
|
166
171
|
),
|
|
167
|
-
children:
|
|
172
|
+
children: H(e)
|
|
168
173
|
}
|
|
169
174
|
) : null;
|
|
170
175
|
}
|
|
171
|
-
function
|
|
176
|
+
function D({
|
|
172
177
|
item: e,
|
|
173
178
|
onItemClick: t
|
|
174
179
|
}) {
|
|
175
|
-
const
|
|
180
|
+
const r = e.typeIcon ? /* @__PURE__ */ a(k, { typeIcon: e.typeIcon }) : e.fileType ? /* @__PURE__ */ a(k, { fileType: e.fileType }) : null, l = e.onClick || t ? () => {
|
|
176
181
|
e.onClick?.(), t?.(e);
|
|
177
|
-
} : void 0,
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
|
|
182
|
+
} : void 0, i = e.onClick ? void 0 : e.href, s = /* @__PURE__ */ o("div", { className: "w-full py-2", children: [
|
|
183
|
+
/* @__PURE__ */ a("div", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ a(
|
|
184
|
+
g,
|
|
180
185
|
{
|
|
181
186
|
className: "mb-0 w-full",
|
|
182
187
|
title: e.title,
|
|
183
|
-
titleIcon:
|
|
188
|
+
titleIcon: r,
|
|
184
189
|
source: e.source,
|
|
185
|
-
titleClassName: "truncate text-[#1A0CAB]"
|
|
190
|
+
titleClassName: "truncate text-[#1A0CAB] dark:text-[#8AB4F8]"
|
|
186
191
|
}
|
|
187
192
|
) }),
|
|
188
193
|
/* @__PURE__ */ o("div", { className: "mt-2 flex gap-3", children: [
|
|
189
|
-
e.thumbnailUrl ? /* @__PURE__ */
|
|
194
|
+
e.thumbnailUrl ? /* @__PURE__ */ a(
|
|
190
195
|
"img",
|
|
191
196
|
{
|
|
192
197
|
src: e.thumbnailUrl,
|
|
193
198
|
alt: e.thumbnailAlt ?? e.title,
|
|
194
|
-
className: "h-[90px] w-[160px] flex-none rounded-lg object-cover ring-1 ring-slate-200",
|
|
199
|
+
className: "h-[90px] w-[160px] flex-none rounded-lg object-cover ring-1 ring-slate-200 dark:ring-slate-700",
|
|
195
200
|
loading: "lazy"
|
|
196
201
|
}
|
|
197
|
-
) :
|
|
202
|
+
) : null,
|
|
198
203
|
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1 flex flex-col justify-between", children: [
|
|
199
|
-
e.description ? /* @__PURE__ */
|
|
200
|
-
e.breadcrumbs?.length || e.author || e.date ? /* @__PURE__ */ o("div", { className: "mt-2 flex min-w-0 items-center gap-3 text-[#666]", children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
204
|
+
e.description ? /* @__PURE__ */ a("div", { className: "line-clamp-2 text-sm text-slate-600 dark:text-slate-400", children: e.description }) : null,
|
|
205
|
+
e.breadcrumbs?.length || e.author || e.date ? /* @__PURE__ */ o("div", { className: "mt-2 flex min-w-0 items-center gap-3 text-[#666] dark:text-slate-400", children: [
|
|
206
|
+
/* @__PURE__ */ a(b, { breadcrumbs: e.breadcrumbs }),
|
|
207
|
+
/* @__PURE__ */ a("span", { className: "h-3 w-px flex-none bg-slate-300 dark:bg-slate-700", "aria-hidden": "true" }),
|
|
203
208
|
/* @__PURE__ */ o("div", { className: "flex flex-none items-center gap-2", children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
e.href ? /* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ a($, { author: e.author, date: e.date }),
|
|
210
|
+
e.href ? /* @__PURE__ */ a("span", { className: "flex-none text-sky-600 dark:text-sky-400", children: /* @__PURE__ */ a(L, { className: "h-3 w-3" }) }) : null
|
|
206
211
|
] })
|
|
207
|
-
] }) : /* @__PURE__ */
|
|
212
|
+
] }) : /* @__PURE__ */ a(z, { meta: e.meta })
|
|
208
213
|
] })
|
|
209
214
|
] })
|
|
210
215
|
] });
|
|
211
|
-
return !
|
|
216
|
+
return !i && !l ? s : /* @__PURE__ */ a(
|
|
212
217
|
v,
|
|
213
218
|
{
|
|
214
|
-
href:
|
|
219
|
+
href: i,
|
|
215
220
|
target: e.target,
|
|
216
221
|
rel: e.rel,
|
|
217
|
-
onClick:
|
|
218
|
-
className:
|
|
222
|
+
onClick: l,
|
|
223
|
+
className: c(
|
|
224
|
+
"group block w-full rounded-xl border border-transparent px-3 py-2 text-left no-underline transition-colors",
|
|
225
|
+
"hover:border-slate-200 hover:bg-slate-100/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300",
|
|
226
|
+
"dark:hover:border-slate-700 dark:hover:bg-slate-800/60 dark:focus-visible:ring-slate-600"
|
|
227
|
+
),
|
|
219
228
|
children: s
|
|
220
229
|
}
|
|
221
230
|
);
|
|
@@ -224,23 +233,24 @@ function V({
|
|
|
224
233
|
item: e,
|
|
225
234
|
onItemClick: t
|
|
226
235
|
}) {
|
|
227
|
-
const
|
|
236
|
+
const r = e.breadcrumbs ?? [e.sourceLabel, e.categoryLabel].filter(Boolean), l = e.onClick ? void 0 : e.href;
|
|
228
237
|
return /* @__PURE__ */ o(
|
|
229
238
|
v,
|
|
230
239
|
{
|
|
231
|
-
href:
|
|
240
|
+
href: l,
|
|
232
241
|
target: e.target,
|
|
233
242
|
rel: e.rel,
|
|
234
243
|
onClick: () => {
|
|
235
244
|
e.onClick?.(), t?.(e);
|
|
236
245
|
},
|
|
237
246
|
className: c(
|
|
238
|
-
"group w-full rounded-xl text-left transition",
|
|
239
|
-
"hover:border-slate-
|
|
247
|
+
"group block w-full rounded-xl border border-transparent p-2 text-left no-underline transition-colors",
|
|
248
|
+
"hover:border-slate-200 hover:bg-slate-100/70 focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300",
|
|
249
|
+
"dark:hover:border-slate-700 dark:hover:bg-slate-800/60 dark:focus-visible:ring-slate-600"
|
|
240
250
|
),
|
|
241
251
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ a("div", { className: "overflow-hidden rounded-lg ring-1 ring-slate-200 dark:ring-slate-700", children: /* @__PURE__ */ o("div", { className: "relative aspect-4/3 bg-slate-100 dark:bg-slate-800", children: [
|
|
253
|
+
/* @__PURE__ */ a(
|
|
244
254
|
"img",
|
|
245
255
|
{
|
|
246
256
|
src: e.thumbnailUrl,
|
|
@@ -249,12 +259,15 @@ function V({
|
|
|
249
259
|
loading: "lazy"
|
|
250
260
|
}
|
|
251
261
|
),
|
|
252
|
-
e.mediaType === "video" ? /* @__PURE__ */
|
|
262
|
+
e.mediaType === "video" ? /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ a("span", { className: "inline-flex h-10 w-10 items-center justify-center rounded-full bg-black/55 text-white ring-1 ring-white/30", children: /* @__PURE__ */ a(S, { className: "h-5 w-5 translate-x-px" }) }) }) : null
|
|
253
263
|
] }) }),
|
|
254
264
|
/* @__PURE__ */ o("div", { className: "mt-2", children: [
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
e.matchCountText ? /* @__PURE__ */
|
|
257
|
-
|
|
265
|
+
/* @__PURE__ */ a("div", { className: "mb-1 truncate text-sm font-medium text-[#333] dark:text-slate-100", children: e.title }),
|
|
266
|
+
e.matchCountText ? /* @__PURE__ */ a("div", { className: "mb-1 truncate text-xs text-[#666] dark:text-slate-400", children: e.matchCountText }) : null,
|
|
267
|
+
r.length ? /* @__PURE__ */ o("div", { className: "text-[#666] dark:text-slate-400", children: [
|
|
268
|
+
/* @__PURE__ */ a(b, { breadcrumbs: r }),
|
|
269
|
+
" "
|
|
270
|
+
] }) : null
|
|
258
271
|
] })
|
|
259
272
|
]
|
|
260
273
|
}
|
|
@@ -264,46 +277,44 @@ function P({
|
|
|
264
277
|
action: e,
|
|
265
278
|
className: t
|
|
266
279
|
}) {
|
|
267
|
-
const
|
|
280
|
+
const r = c(
|
|
268
281
|
"flex-none inline-flex items-center justify-center rounded-full border border-slate-200 bg-white",
|
|
269
282
|
"h-9 px-12 text-sm font-medium text-slate-700 no-underline transition",
|
|
270
283
|
"cursor-pointer hover:border-slate-300 hover:bg-slate-50 hover:no-underline",
|
|
271
284
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-slate-300",
|
|
285
|
+
"dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:border-slate-600 dark:hover:bg-slate-800 dark:focus-visible:ring-slate-600",
|
|
272
286
|
t
|
|
273
287
|
);
|
|
274
|
-
return e.href ? /* @__PURE__ */
|
|
288
|
+
return e.href ? /* @__PURE__ */ a(
|
|
275
289
|
"a",
|
|
276
290
|
{
|
|
277
|
-
className:
|
|
291
|
+
className: r,
|
|
278
292
|
href: e.href,
|
|
279
293
|
target: e.target,
|
|
280
294
|
rel: A(e.rel, e.target),
|
|
281
295
|
onClick: () => e.onClick?.(),
|
|
282
296
|
children: e.label
|
|
283
297
|
}
|
|
284
|
-
) : /* @__PURE__ */
|
|
298
|
+
) : /* @__PURE__ */ a("button", { className: r, type: "button", onClick: e.onClick, children: e.label });
|
|
285
299
|
}
|
|
286
300
|
function h({ action: e }) {
|
|
287
301
|
return e ? /* @__PURE__ */ o("div", { className: "mt-3 flex w-full items-center", children: [
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ a("span", { className: "h-px flex-1 bg-slate-200 dark:bg-slate-700", "aria-hidden": "true" }),
|
|
303
|
+
/* @__PURE__ */ a(
|
|
290
304
|
P,
|
|
291
305
|
{
|
|
292
306
|
action: e,
|
|
293
|
-
className: c(
|
|
294
|
-
"rounded-full border border-[#E8E8E8] bg-white px-4 py-2 text-sm font-medium text-[#333] transition",
|
|
295
|
-
"hover:border-[#E8E8E8] hover:bg-[#F5F5F5]"
|
|
296
|
-
)
|
|
307
|
+
className: c("px-4")
|
|
297
308
|
}
|
|
298
309
|
),
|
|
299
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ a("span", { className: "h-px flex-1 bg-slate-200 dark:bg-slate-700", "aria-hidden": "true" })
|
|
300
311
|
] }) : null;
|
|
301
312
|
}
|
|
302
313
|
function O(e, t) {
|
|
303
314
|
if (e.layout === "list")
|
|
304
315
|
return /* @__PURE__ */ o("div", { className: c("space-y-6", e.className), children: [
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
|
|
316
|
+
/* @__PURE__ */ a(
|
|
317
|
+
g,
|
|
307
318
|
{
|
|
308
319
|
title: e.title,
|
|
309
320
|
titleIcon: e.titleIcon,
|
|
@@ -311,14 +322,14 @@ function O(e, t) {
|
|
|
311
322
|
titleClassName: e.titleClassName
|
|
312
323
|
}
|
|
313
324
|
),
|
|
314
|
-
e.items.map((
|
|
315
|
-
/* @__PURE__ */
|
|
325
|
+
e.items.map((i) => /* @__PURE__ */ a(D, { item: i, onItemClick: t }, i.id)),
|
|
326
|
+
/* @__PURE__ */ a(h, { action: e.footerAction })
|
|
316
327
|
] });
|
|
317
328
|
if (e.layout === "mediaGrid") {
|
|
318
|
-
const
|
|
329
|
+
const i = e.columns ?? 3, s = i === 2 ? "grid-cols-2" : i === 4 ? "grid-cols-4" : "grid-cols-3";
|
|
319
330
|
return /* @__PURE__ */ o("div", { className: c(e.className), children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
331
|
+
/* @__PURE__ */ a(
|
|
332
|
+
g,
|
|
322
333
|
{
|
|
323
334
|
title: e.title,
|
|
324
335
|
titleIcon: e.titleIcon,
|
|
@@ -326,14 +337,14 @@ function O(e, t) {
|
|
|
326
337
|
titleClassName: e.titleClassName
|
|
327
338
|
}
|
|
328
339
|
),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ a("div", { className: c("grid gap-3", s), children: e.items.map((n) => /* @__PURE__ */ a(V, { item: n, onItemClick: t }, n.id)) }),
|
|
341
|
+
/* @__PURE__ */ a(h, { action: e.footerAction })
|
|
331
342
|
] });
|
|
332
343
|
}
|
|
333
|
-
const
|
|
344
|
+
const r = e.columns ?? 3, l = r === 2 ? "grid-cols-2" : r === 4 ? "grid-cols-4" : "grid-cols-3";
|
|
334
345
|
return /* @__PURE__ */ o("div", { className: c(e.className), children: [
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
|
|
346
|
+
/* @__PURE__ */ a(
|
|
347
|
+
g,
|
|
337
348
|
{
|
|
338
349
|
title: e.title,
|
|
339
350
|
titleIcon: e.titleIcon,
|
|
@@ -341,8 +352,8 @@ function O(e, t) {
|
|
|
341
352
|
titleClassName: e.titleClassName
|
|
342
353
|
}
|
|
343
354
|
),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ a("div", { className: c("grid gap-3", l), children: e.items.map((i) => /* @__PURE__ */ a(_, { item: i, onItemClick: t }, i.id)) }),
|
|
356
|
+
/* @__PURE__ */ a(h, { action: e.footerAction })
|
|
346
357
|
] });
|
|
347
358
|
}
|
|
348
359
|
function q(e) {
|
|
@@ -355,118 +366,123 @@ function J(e) {
|
|
|
355
366
|
if (t)
|
|
356
367
|
return t === "pdf" ? "pdf" : t === "doc" || t === "docx" || t === "word" ? "doc" : t === "ppt" || t === "pptx" ? "ppt" : t === "xls" || t === "xlsx" || t === "excel" ? "xls" : t === "link" || t === "url" || t === "html" ? "link" : t === "txt" || t === "text" ? "text" : "unknown";
|
|
357
368
|
}
|
|
358
|
-
function
|
|
359
|
-
const
|
|
369
|
+
function x(e, t, r) {
|
|
370
|
+
const l = e.thumbnail ?? e.cover ?? e.metadata?.thumbnail_link, i = e.summary ?? e.content, s = J(e.metadata?.file_extension ?? e.type), n = e.source?.name, u = e.category ?? e.categories?.join(" / ") ?? "Categories", d = [n, u].filter(Boolean), m = e.last_updated_by?.user?.username ?? e.owner?.username, p = q(e.last_updated_by?.timestamp ?? e.metadata?.last_reviewed), f = e.metadata?.icon_link ?? e.icon, y = f ? /* @__PURE__ */ a("img", { src: f, alt: "", className: "h-5 w-5 rounded-sm object-contain" }) : void 0;
|
|
360
371
|
return {
|
|
361
372
|
type: "result",
|
|
362
373
|
id: `${e.source?.id ?? e.url ?? e.title}-${t}`,
|
|
363
374
|
title: e.title,
|
|
364
375
|
href: e.url,
|
|
365
|
-
description:
|
|
366
|
-
thumbnailUrl:
|
|
376
|
+
description: i,
|
|
377
|
+
thumbnailUrl: l,
|
|
367
378
|
fileType: s,
|
|
368
|
-
typeIcon:
|
|
379
|
+
typeIcon: y,
|
|
369
380
|
breadcrumbs: d.length ? d : void 0,
|
|
370
381
|
author: m,
|
|
371
382
|
date: p,
|
|
372
|
-
onClick:
|
|
383
|
+
onClick: r
|
|
373
384
|
};
|
|
374
385
|
}
|
|
375
|
-
function
|
|
386
|
+
function C({
|
|
376
387
|
section: e,
|
|
377
388
|
className: t,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
389
|
+
theme: r,
|
|
390
|
+
footerAction: l,
|
|
391
|
+
onRecordClick: i,
|
|
392
|
+
onItemClick: s
|
|
381
393
|
}) {
|
|
382
|
-
const
|
|
383
|
-
return /* @__PURE__ */
|
|
394
|
+
const n = Q(I(e, i), l), u = K(r);
|
|
395
|
+
return /* @__PURE__ */ a("div", { className: c(u === "dark" && "dark", t), children: O(n, s) });
|
|
384
396
|
}
|
|
385
|
-
function K(e
|
|
386
|
-
|
|
397
|
+
function K(e) {
|
|
398
|
+
if (e)
|
|
399
|
+
return e === "light" ? "light" : e === "dark" || typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
387
400
|
}
|
|
388
|
-
function
|
|
389
|
-
return
|
|
401
|
+
function Q(e, t) {
|
|
402
|
+
return !t || e.footerAction ? e : e.layout === "list" ? { ...e, footerAction: t } : e.layout === "mediaGrid" ? { ...e, footerAction: t } : { ...e, footerAction: t };
|
|
390
403
|
}
|
|
391
404
|
function te(e) {
|
|
392
|
-
return /* @__PURE__ */
|
|
393
|
-
}
|
|
394
|
-
function
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
if (
|
|
399
|
-
|
|
400
|
-
|
|
405
|
+
return /* @__PURE__ */ a(C, { ...e });
|
|
406
|
+
}
|
|
407
|
+
function re(e) {
|
|
408
|
+
return /* @__PURE__ */ a(C, { ...e });
|
|
409
|
+
}
|
|
410
|
+
function I(e, t) {
|
|
411
|
+
if (Array.isArray(e)) return W(e, t);
|
|
412
|
+
if (Y(e)) return e;
|
|
413
|
+
const r = e;
|
|
414
|
+
if (r.type === "imageGroup" && Array.isArray(r.items)) {
|
|
415
|
+
const i = r;
|
|
416
|
+
return i.items[0]?.type === "media" ? {
|
|
401
417
|
type: "section",
|
|
402
|
-
title:
|
|
418
|
+
title: i.title,
|
|
403
419
|
layout: "mediaGrid",
|
|
404
|
-
items:
|
|
405
|
-
(
|
|
420
|
+
items: i.items.filter(
|
|
421
|
+
(n) => typeof n == "object" && !!n && n.type === "media"
|
|
406
422
|
),
|
|
407
|
-
columns:
|
|
408
|
-
footerAction:
|
|
409
|
-
className:
|
|
423
|
+
columns: i.columns,
|
|
424
|
+
footerAction: i.footerAction,
|
|
425
|
+
className: i.className
|
|
410
426
|
} : {
|
|
411
427
|
type: "section",
|
|
412
|
-
title:
|
|
428
|
+
title: i.title,
|
|
413
429
|
layout: "imageGrid",
|
|
414
|
-
items:
|
|
415
|
-
(
|
|
430
|
+
items: i.items.filter(
|
|
431
|
+
(n) => typeof n == "object" && !!n && n.type === "image"
|
|
416
432
|
),
|
|
417
|
-
columns:
|
|
418
|
-
footerAction:
|
|
419
|
-
className:
|
|
433
|
+
columns: i.columns,
|
|
434
|
+
footerAction: i.footerAction,
|
|
435
|
+
className: i.className
|
|
420
436
|
};
|
|
421
437
|
}
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
438
|
+
if (r.type === "videoGroup" && Array.isArray(r.items)) {
|
|
439
|
+
const i = r;
|
|
424
440
|
return {
|
|
425
441
|
type: "section",
|
|
426
|
-
title:
|
|
442
|
+
title: i.title,
|
|
427
443
|
layout: "mediaGrid",
|
|
428
|
-
items:
|
|
429
|
-
columns:
|
|
430
|
-
footerAction:
|
|
431
|
-
className:
|
|
444
|
+
items: i.items,
|
|
445
|
+
columns: i.columns,
|
|
446
|
+
footerAction: i.footerAction,
|
|
447
|
+
className: i.className
|
|
432
448
|
};
|
|
433
449
|
}
|
|
434
|
-
if (
|
|
450
|
+
if (r.type === "result")
|
|
435
451
|
return {
|
|
436
452
|
type: "section",
|
|
437
453
|
layout: "list",
|
|
438
454
|
items: [e]
|
|
439
455
|
};
|
|
440
|
-
if (
|
|
456
|
+
if (r.type === "media")
|
|
441
457
|
return {
|
|
442
458
|
type: "section",
|
|
443
459
|
layout: "mediaGrid",
|
|
444
460
|
items: [e]
|
|
445
461
|
};
|
|
446
|
-
if (
|
|
462
|
+
if (r.type === "image" && typeof r.imageUrl == "string")
|
|
447
463
|
return {
|
|
448
464
|
type: "section",
|
|
449
465
|
layout: "imageGrid",
|
|
450
466
|
items: [e]
|
|
451
467
|
};
|
|
452
|
-
const
|
|
453
|
-
if (
|
|
454
|
-
const
|
|
468
|
+
const l = typeof r.type == "string" ? r.type.trim().toLowerCase() : void 0;
|
|
469
|
+
if (l === "image" || l === "video") {
|
|
470
|
+
const i = typeof r.id == "string" ? r.id : void 0, s = typeof r.thumbnail == "string" ? r.thumbnail : typeof r.cover == "string" ? r.cover : typeof r.metadata == "object" && r.metadata && typeof r.metadata.thumbnail_link == "string" ? r.metadata.thumbnail_link : void 0;
|
|
455
471
|
if (s) {
|
|
456
|
-
const
|
|
472
|
+
const n = typeof r.category == "string" ? r.category : Array.isArray(r.categories) ? r.categories.filter((f) => typeof f == "string").join(" / ") : void 0, u = typeof r.title == "string" ? r.title : "Untitled", d = typeof r.url == "string" ? r.url : void 0, m = typeof r.source == "object" && r.source && typeof r.source.name == "string" ? r.source.name : void 0;
|
|
457
473
|
return {
|
|
458
474
|
type: "section",
|
|
459
475
|
layout: "mediaGrid",
|
|
460
476
|
items: [{
|
|
461
477
|
type: "media",
|
|
462
|
-
id:
|
|
463
|
-
mediaType:
|
|
478
|
+
id: i ?? `${d ?? u}-0`,
|
|
479
|
+
mediaType: l === "video" ? "video" : "image",
|
|
464
480
|
title: u,
|
|
465
481
|
href: t ? void 0 : d,
|
|
466
482
|
thumbnailUrl: s,
|
|
467
483
|
sourceLabel: m,
|
|
468
|
-
categoryLabel:
|
|
469
|
-
breadcrumbs: [m,
|
|
484
|
+
categoryLabel: n,
|
|
485
|
+
breadcrumbs: [m, n].filter(Boolean),
|
|
470
486
|
...t ? { onClick: () => t(e, 0) } : {}
|
|
471
487
|
}]
|
|
472
488
|
};
|
|
@@ -476,7 +492,7 @@ function j(e, t) {
|
|
|
476
492
|
type: "section",
|
|
477
493
|
layout: "list",
|
|
478
494
|
items: [
|
|
479
|
-
|
|
495
|
+
x(
|
|
480
496
|
e,
|
|
481
497
|
0,
|
|
482
498
|
t ? () => t(e, 0) : void 0
|
|
@@ -484,158 +500,158 @@ function j(e, t) {
|
|
|
484
500
|
]
|
|
485
501
|
};
|
|
486
502
|
}
|
|
487
|
-
function
|
|
503
|
+
function W(e, t) {
|
|
488
504
|
if (!e.length)
|
|
489
505
|
return { type: "section", layout: "list", items: [] };
|
|
490
|
-
if (e.every(
|
|
506
|
+
if (e.every(j)) {
|
|
491
507
|
if (e.every((s) => s.type === "result"))
|
|
492
508
|
return { type: "section", layout: "list", items: e };
|
|
493
509
|
if (e.every((s) => s.type === "media"))
|
|
494
510
|
return { type: "section", layout: "mediaGrid", items: e };
|
|
495
511
|
if (e.every((s) => s.type === "image" && "imageUrl" in s))
|
|
496
512
|
return { type: "section", layout: "imageGrid", items: e };
|
|
497
|
-
if (e.length === 1) return
|
|
513
|
+
if (e.length === 1) return I(e[0], t);
|
|
498
514
|
}
|
|
499
|
-
const
|
|
500
|
-
for (const [s,
|
|
501
|
-
const u =
|
|
502
|
-
u ?
|
|
503
|
-
|
|
504
|
-
|
|
515
|
+
const r = [], l = [];
|
|
516
|
+
for (const [s, n] of e.entries()) {
|
|
517
|
+
const u = X(n, s, t);
|
|
518
|
+
u ? r.push(u) : l.push(
|
|
519
|
+
x(
|
|
520
|
+
n,
|
|
505
521
|
s,
|
|
506
|
-
t ? () => t(
|
|
522
|
+
t ? () => t(n, s) : void 0
|
|
507
523
|
)
|
|
508
524
|
);
|
|
509
525
|
}
|
|
510
|
-
return
|
|
526
|
+
return r.length && !l.length ? { type: "section", title: w(e, (n) => n.category ?? n.source?.name), layout: "mediaGrid", items: r } : { type: "section", title: w(e, (s) => s.category ?? s.source?.name), layout: "list", items: l };
|
|
511
527
|
}
|
|
512
|
-
function
|
|
528
|
+
function j(e) {
|
|
513
529
|
if (!e || typeof e != "object") return !1;
|
|
514
530
|
const t = e;
|
|
515
531
|
return t.type === "result" || t.type === "media" || t.type === "imageGroup" || t.type === "videoGroup" || t.type === "image" && typeof e.imageUrl == "string";
|
|
516
532
|
}
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
if (
|
|
520
|
-
const s = typeof
|
|
521
|
-
if (!
|
|
522
|
-
const u = typeof
|
|
533
|
+
function X(e, t, r) {
|
|
534
|
+
const l = e, i = typeof l.type == "string" ? l.type.trim().toLowerCase() : void 0;
|
|
535
|
+
if (i !== "image" && i !== "video") return;
|
|
536
|
+
const s = typeof l.id == "string" ? l.id : void 0, n = typeof l.thumbnail == "string" ? l.thumbnail : typeof l.cover == "string" ? l.cover : typeof l.metadata == "object" && l.metadata && typeof l.metadata.thumbnail_link == "string" ? l.metadata.thumbnail_link : void 0;
|
|
537
|
+
if (!n) return;
|
|
538
|
+
const u = typeof l.category == "string" ? l.category : Array.isArray(l.categories) ? l.categories.filter((y) => typeof y == "string").join(" / ") : void 0, d = typeof l.title == "string" ? l.title : "Untitled", m = typeof l.url == "string" ? l.url : void 0, p = typeof l.source == "object" && l.source && typeof l.source.name == "string" ? l.source.name : void 0, f = !!r && !j(e);
|
|
523
539
|
return {
|
|
524
540
|
type: "media",
|
|
525
541
|
id: s ?? `${m ?? d}-0`,
|
|
526
|
-
mediaType:
|
|
542
|
+
mediaType: i === "video" ? "video" : "image",
|
|
527
543
|
title: d,
|
|
528
544
|
href: f ? void 0 : m,
|
|
529
|
-
thumbnailUrl:
|
|
545
|
+
thumbnailUrl: n,
|
|
530
546
|
sourceLabel: p,
|
|
531
547
|
categoryLabel: u,
|
|
532
548
|
breadcrumbs: [p, u].filter(Boolean),
|
|
533
|
-
...f ? { onClick: () =>
|
|
549
|
+
...f ? { onClick: () => r(e, t) } : {}
|
|
534
550
|
};
|
|
535
551
|
}
|
|
536
552
|
function w(e, t) {
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
for (const
|
|
540
|
-
if (t(
|
|
541
|
-
return
|
|
553
|
+
const r = e[0], l = t(r);
|
|
554
|
+
if (l) {
|
|
555
|
+
for (const i of e)
|
|
556
|
+
if (t(i) !== l) return;
|
|
557
|
+
return l;
|
|
542
558
|
}
|
|
543
559
|
}
|
|
544
|
-
function
|
|
560
|
+
function Y(e) {
|
|
545
561
|
if (!e || typeof e != "object") return !1;
|
|
546
562
|
const t = e;
|
|
547
563
|
return t.type === "section" && (t.layout === "list" || t.layout === "imageGrid" || t.layout === "mediaGrid") && Array.isArray(t.items);
|
|
548
564
|
}
|
|
549
|
-
function
|
|
550
|
-
const
|
|
551
|
-
for (const
|
|
552
|
-
const
|
|
553
|
-
if (
|
|
554
|
-
|
|
565
|
+
function le(e, t) {
|
|
566
|
+
const r = [];
|
|
567
|
+
for (const l of e) {
|
|
568
|
+
const i = r.length ? r[r.length - 1] : void 0;
|
|
569
|
+
if (l.type === "imageGroup") {
|
|
570
|
+
l.items[0]?.type === "media" ? r.push({
|
|
555
571
|
type: "section",
|
|
556
|
-
title:
|
|
557
|
-
titleIcon: /* @__PURE__ */
|
|
572
|
+
title: l.title,
|
|
573
|
+
titleIcon: /* @__PURE__ */ a(N, { className: "h-4 w-4" }),
|
|
558
574
|
titleIconBgColor: "#FFAF36",
|
|
559
|
-
titleClassName: "text-[#1A0CAB]",
|
|
575
|
+
titleClassName: "text-[#1A0CAB] dark:text-[#8AB4F8]",
|
|
560
576
|
layout: "mediaGrid",
|
|
561
|
-
items:
|
|
562
|
-
columns:
|
|
563
|
-
footerAction:
|
|
564
|
-
className:
|
|
565
|
-
}) :
|
|
577
|
+
items: l.items.filter((n) => n.type === "media"),
|
|
578
|
+
columns: l.columns ?? t,
|
|
579
|
+
footerAction: l.footerAction,
|
|
580
|
+
className: l.className
|
|
581
|
+
}) : r.push({
|
|
566
582
|
type: "section",
|
|
567
|
-
title:
|
|
568
|
-
titleIcon: /* @__PURE__ */
|
|
583
|
+
title: l.title,
|
|
584
|
+
titleIcon: /* @__PURE__ */ a(N, { className: "h-4 w-4" }),
|
|
569
585
|
titleIconBgColor: "#FFAF36",
|
|
570
|
-
titleClassName: "text-[#1A0CAB]",
|
|
586
|
+
titleClassName: "text-[#1A0CAB] dark:text-[#8AB4F8]",
|
|
571
587
|
layout: "imageGrid",
|
|
572
|
-
items:
|
|
573
|
-
columns:
|
|
574
|
-
footerAction:
|
|
575
|
-
className:
|
|
588
|
+
items: l.items.filter((n) => n.type === "image"),
|
|
589
|
+
columns: l.columns ?? t,
|
|
590
|
+
footerAction: l.footerAction,
|
|
591
|
+
className: l.className
|
|
576
592
|
});
|
|
577
593
|
continue;
|
|
578
594
|
}
|
|
579
|
-
if (
|
|
580
|
-
|
|
595
|
+
if (l.type === "videoGroup") {
|
|
596
|
+
r.push({
|
|
581
597
|
type: "section",
|
|
582
|
-
title:
|
|
583
|
-
titleIcon: /* @__PURE__ */
|
|
598
|
+
title: l.title,
|
|
599
|
+
titleIcon: /* @__PURE__ */ a(U, { className: "h-4 w-4" }),
|
|
584
600
|
titleIconBgColor: "#1784FC",
|
|
585
|
-
titleClassName: "text-[#1A0CAB]",
|
|
601
|
+
titleClassName: "text-[#1A0CAB] dark:text-[#8AB4F8]",
|
|
586
602
|
layout: "mediaGrid",
|
|
587
|
-
items:
|
|
588
|
-
columns:
|
|
589
|
-
footerAction:
|
|
590
|
-
className:
|
|
603
|
+
items: l.items,
|
|
604
|
+
columns: l.columns ?? t,
|
|
605
|
+
footerAction: l.footerAction,
|
|
606
|
+
className: l.className
|
|
591
607
|
});
|
|
592
608
|
continue;
|
|
593
609
|
}
|
|
594
|
-
if (
|
|
595
|
-
if (
|
|
596
|
-
|
|
610
|
+
if (l.type === "result") {
|
|
611
|
+
if (i?.layout === "list") {
|
|
612
|
+
i.items.push(l);
|
|
597
613
|
continue;
|
|
598
614
|
}
|
|
599
|
-
|
|
615
|
+
r.push({
|
|
600
616
|
type: "section",
|
|
601
617
|
layout: "list",
|
|
602
|
-
items: [
|
|
618
|
+
items: [l]
|
|
603
619
|
});
|
|
604
620
|
continue;
|
|
605
621
|
}
|
|
606
|
-
if (
|
|
607
|
-
if (
|
|
608
|
-
|
|
622
|
+
if (l.type === "media") {
|
|
623
|
+
if (i?.layout === "mediaGrid") {
|
|
624
|
+
i.items.push(l);
|
|
609
625
|
continue;
|
|
610
626
|
}
|
|
611
|
-
|
|
627
|
+
r.push({
|
|
612
628
|
type: "section",
|
|
613
629
|
layout: "mediaGrid",
|
|
614
630
|
...t ? { columns: t } : {},
|
|
615
|
-
items: [
|
|
631
|
+
items: [l]
|
|
616
632
|
});
|
|
617
633
|
continue;
|
|
618
634
|
}
|
|
619
|
-
if (
|
|
620
|
-
|
|
635
|
+
if (i?.layout === "imageGrid") {
|
|
636
|
+
i.items.push(l);
|
|
621
637
|
continue;
|
|
622
638
|
}
|
|
623
|
-
|
|
639
|
+
r.push({
|
|
624
640
|
type: "section",
|
|
625
641
|
layout: "imageGrid",
|
|
626
642
|
...t ? { columns: t } : {},
|
|
627
|
-
items: [
|
|
643
|
+
items: [l]
|
|
628
644
|
});
|
|
629
645
|
}
|
|
630
|
-
return
|
|
646
|
+
return r;
|
|
631
647
|
}
|
|
632
|
-
function
|
|
633
|
-
return e.map((t,
|
|
648
|
+
function ae(e) {
|
|
649
|
+
return e.map((t, r) => x(t, r));
|
|
634
650
|
}
|
|
635
651
|
export {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
652
|
+
te as SearchResultsImageGroup,
|
|
653
|
+
re as SearchResultsVideoGroup,
|
|
654
|
+
C as default,
|
|
655
|
+
le as itemsToSections,
|
|
656
|
+
ae as recordsToItems
|
|
641
657
|
};
|