@brainfish-ai/components 0.33.1 → 0.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/conversation.d.ts +55 -12
- package/dist/esm/chunks/{ChatSearch.EPCaUj3O.js → ChatSearch.D5EABw51.js} +2 -2
- package/dist/esm/chunks/{ChatSearch.EPCaUj3O.js.map → ChatSearch.D5EABw51.js.map} +1 -1
- package/dist/esm/chunks/Conversation.Dq66Znf4.js +33 -0
- package/dist/esm/chunks/Conversation.Dq66Znf4.js.map +1 -0
- package/dist/esm/chunks/{FormattedMessage.D_knqVl-.js → FormattedMessage.Djy5cn5F.js} +2 -2
- package/dist/esm/chunks/{FormattedMessage.D_knqVl-.js.map → FormattedMessage.Djy5cn5F.js.map} +1 -1
- package/dist/esm/chunks/ai-badge.Be0978vU.js +5 -0
- package/dist/esm/chunks/ai-badge.Be0978vU.js.map +1 -0
- package/dist/esm/chunks/{button.D_2SonNs.js → button.Cs1X8upM.js} +2 -2
- package/dist/esm/chunks/{button.D_2SonNs.js.map → button.Cs1X8upM.js.map} +1 -1
- package/dist/esm/chunks/{combobox.MyoPH18G.js → combobox.CLT9CXUV.js} +2 -2
- package/dist/esm/chunks/{combobox.MyoPH18G.js.map → combobox.CLT9CXUV.js.map} +1 -1
- package/dist/esm/chunks/{date-picker.C2VT_rZ9.js → date-picker.D9CRxYJf.js} +2 -2
- package/dist/esm/chunks/{date-picker.C2VT_rZ9.js.map → date-picker.D9CRxYJf.js.map} +1 -1
- package/dist/esm/chunks/{feedback.CLMuSvsg.js → feedback.CGFAP0XS.js} +2 -2
- package/dist/esm/chunks/{feedback.CLMuSvsg.js.map → feedback.CGFAP0XS.js.map} +1 -1
- package/dist/esm/chunks/{file-upload-status.D8RhMcbO.js → file-upload-status.ClQeoQQB.js} +2 -2
- package/dist/esm/chunks/{file-upload-status.D8RhMcbO.js.map → file-upload-status.ClQeoQQB.js.map} +1 -1
- package/dist/esm/chunks/{filters.BHp3ukNW.js → filters.BRlRsGlZ.js} +2 -2
- package/dist/esm/chunks/{filters.BHp3ukNW.js.map → filters.BRlRsGlZ.js.map} +1 -1
- package/dist/esm/chunks/{font-picker.B9GPXyK4.js → font-picker.Dwwe5av-.js} +2 -2
- package/dist/esm/chunks/{font-picker.B9GPXyK4.js.map → font-picker.Dwwe5av-.js.map} +1 -1
- package/dist/esm/chunks/header-nav.CtUIc9pI.js +12 -0
- package/dist/esm/chunks/header-nav.CtUIc9pI.js.map +1 -0
- package/dist/esm/chunks/{header-pane.eU7f_pim.js → header-pane.BBWfo7uv.js} +5 -5
- package/dist/esm/chunks/header-pane.BBWfo7uv.js.map +1 -0
- package/dist/esm/chunks/index.Ca2JkOFO.js +2 -0
- package/dist/esm/chunks/index.Ca2JkOFO.js.map +1 -0
- package/dist/esm/chunks/{input-with-tags.DLv9e0XI.js → input-with-tags.pmOKv67d.js} +2 -2
- package/dist/esm/chunks/{input-with-tags.DLv9e0XI.js.map → input-with-tags.pmOKv67d.js.map} +1 -1
- package/dist/esm/chunks/{sidebar.CcFsNjrN.js → sidebar.BhcrMAU3.js} +8 -8
- package/dist/esm/chunks/{sidebar.CcFsNjrN.js.map → sidebar.BhcrMAU3.js.map} +1 -1
- package/dist/esm/chunks/{suggestion-card.D-AsG_yB.js → suggestion-card.TDn-dEc0.js} +2 -2
- package/dist/esm/chunks/{suggestion-card.D-AsG_yB.js.map → suggestion-card.TDn-dEc0.js.map} +1 -1
- package/dist/esm/chunks/{two-level-combobox.BVZfsNSN.js → two-level-combobox.SDv7qc_m.js} +2 -2
- package/dist/esm/chunks/{two-level-combobox.BVZfsNSN.js.map → two-level-combobox.SDv7qc_m.js.map} +1 -1
- package/dist/esm/components/article-suggestions-banner.js +1 -1
- package/dist/esm/components/articles-coverage.js +3 -3
- package/dist/esm/components/articles-updated.js +2 -2
- package/dist/esm/components/chat-search.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/conversation.js +1 -1
- package/dist/esm/components/convos.js +11 -11
- package/dist/esm/components/date-picker.js +1 -1
- package/dist/esm/components/feedback.js +1 -1
- package/dist/esm/components/file-upload.js +1 -1
- package/dist/esm/components/filter.js +1 -1
- package/dist/esm/components/font-picker.js +1 -1
- package/dist/esm/components/input-with-tags.js +1 -1
- package/dist/esm/components/markdown.js +1 -1
- package/dist/esm/components/two-level-combobox.js +1 -1
- package/dist/esm/components/ui/alert-dialog.js +1 -1
- package/dist/esm/components/ui/breadcrumb.js +1 -1
- package/dist/esm/components/ui/button-group.js +1 -1
- package/dist/esm/components/ui/button.js +1 -1
- package/dist/esm/components/ui/combobox.js +1 -1
- package/dist/esm/components/ui/div-button.js +1 -1
- package/dist/esm/components/ui/item.js +1 -1
- package/dist/esm/components/ui/sheet.js +1 -1
- package/dist/esm/components/ui/tooltip.js +3 -3
- package/dist/esm/components/ui/tooltip.js.map +1 -1
- package/dist/esm/global.css +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/layouts/full-layout.js +1 -1
- package/dist/esm/layouts/header-nav.js +1 -1
- package/dist/esm/layouts/sidebar.js +1 -1
- package/dist/esm/scenes/knowledge-review.js +1 -1
- package/dist/esm/tailwind.preset.js +1 -1
- package/dist/esm/tailwind.preset.js.map +1 -1
- package/dist/full-layout.d.ts +1 -0
- package/dist/header-nav.d.ts +1 -0
- package/dist/index.d.ts +56 -12
- package/dist/stats.html +1 -1
- package/package.json +7 -7
- package/tailwind.preset.ts +1 -1
- package/dist/esm/chunks/Conversation.C2TpUr4-.js +0 -29
- package/dist/esm/chunks/Conversation.C2TpUr4-.js.map +0 -1
- package/dist/esm/chunks/header-nav.DmlIUqml.js +0 -14
- package/dist/esm/chunks/header-nav.DmlIUqml.js.map +0 -1
- package/dist/esm/chunks/header-pane.eU7f_pim.js.map +0 -1
- package/dist/esm/chunks/index.uF4ME3WQ.js +0 -4
- package/dist/esm/chunks/index.uF4ME3WQ.js.map +0 -1
package/dist/conversation.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ClassProp } from 'class-variance-authority/types';
|
|
2
2
|
import { ConversationActionsProps } from './ConversationActions';
|
|
3
|
+
import { ConversationHeaderProps } from './ConversationHeader';
|
|
3
4
|
import { ConversationInputProps } from './ConversationInput';
|
|
4
5
|
import { ConversationMessagesProps } from './ConversationMessages';
|
|
5
6
|
import { ConversationStatusProps } from './ConversationStatus';
|
|
@@ -76,12 +77,31 @@ declare interface ContextPillBadgeProps {
|
|
|
76
77
|
|
|
77
78
|
export declare type ContextPillIconType = 'image' | 'video' | 'pdf' | 'doc' | 'file' | 'channel' | 'collection' | 'article' | 'page';
|
|
78
79
|
|
|
79
|
-
export declare const Conversation: (({ messages, callbacks, children, suggestions, actions, placeholder, attachments, collections, pages, acceptedFileTypes, showBranding, className, }: ConversationProps) => default_2.JSX.Element) & {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
export declare const Conversation: (({ messages, callbacks, children, suggestions, actions, placeholder, attachments, collections, pages, acceptedFileTypes, showBranding, className, showHistoryButton, headerTitle, }: ConversationProps) => default_2.JSX.Element) & {
|
|
81
|
+
Header: {
|
|
82
|
+
({ className, headerTitle, showHistoryButton, showBorder, }: ConversationHeaderProps): default_2.JSX.Element;
|
|
83
|
+
displayName: string;
|
|
84
|
+
};
|
|
85
|
+
Messages: {
|
|
86
|
+
({ className, bottomPadding, onContentBehind, onScrolledFromTop, }: ConversationMessagesProps): default_2.JSX.Element;
|
|
87
|
+
displayName: string;
|
|
88
|
+
};
|
|
89
|
+
Input: {
|
|
90
|
+
({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps): default_2.JSX.Element;
|
|
91
|
+
displayName: string;
|
|
92
|
+
};
|
|
93
|
+
Suggestions: {
|
|
94
|
+
({ items, className }: ConversationSuggestionsProps): default_2.JSX.Element | null;
|
|
95
|
+
displayName: string;
|
|
96
|
+
};
|
|
97
|
+
Actions: {
|
|
98
|
+
({ actions, onActionClick, className }: ConversationActionsProps): default_2.JSX.Element | null;
|
|
99
|
+
displayName: string;
|
|
100
|
+
};
|
|
101
|
+
Loading: {
|
|
102
|
+
({ className, children, variant, }: ConversationStatusProps): default_2.JSX.Element;
|
|
103
|
+
displayName: string;
|
|
104
|
+
};
|
|
85
105
|
};
|
|
86
106
|
|
|
87
107
|
export declare type ConversationAction = {
|
|
@@ -91,7 +111,10 @@ export declare type ConversationAction = {
|
|
|
91
111
|
description?: string;
|
|
92
112
|
};
|
|
93
113
|
|
|
94
|
-
export declare const ConversationActions:
|
|
114
|
+
export declare const ConversationActions: {
|
|
115
|
+
({ actions, onActionClick, className }: ConversationActionsProps_2): default_2.JSX.Element | null;
|
|
116
|
+
displayName: string;
|
|
117
|
+
};
|
|
95
118
|
|
|
96
119
|
declare interface ConversationActionsProps_2 {
|
|
97
120
|
actions: ConversationAction[];
|
|
@@ -108,15 +131,22 @@ export declare type ConversationCallbacks = {
|
|
|
108
131
|
onAttachmentAdd?: (action: AttachmentAddAction) => void;
|
|
109
132
|
onAttachmentRemove?: (attachment: Attachment) => void;
|
|
110
133
|
onCopy?: (messageId: string, content: string) => void;
|
|
134
|
+
onClose?: () => void;
|
|
135
|
+
onHistoryClick?: () => void;
|
|
136
|
+
onNewConversationClick?: () => void;
|
|
111
137
|
};
|
|
112
138
|
|
|
113
139
|
export declare interface ConversationContextValue {
|
|
114
140
|
messages: Message[];
|
|
115
141
|
callbacks: ConversationCallbacks;
|
|
116
142
|
isStreaming: boolean;
|
|
143
|
+
reportScrolledFromTop?: (isScrolled: boolean) => void;
|
|
117
144
|
}
|
|
118
145
|
|
|
119
|
-
export declare const ConversationInput:
|
|
146
|
+
export declare const ConversationInput: {
|
|
147
|
+
({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps_2): default_2.JSX.Element;
|
|
148
|
+
displayName: string;
|
|
149
|
+
};
|
|
120
150
|
|
|
121
151
|
declare interface ConversationInputProps_2 {
|
|
122
152
|
placeholder?: string;
|
|
@@ -139,12 +169,16 @@ declare interface ConversationMessageAssistantProps {
|
|
|
139
169
|
className?: string;
|
|
140
170
|
}
|
|
141
171
|
|
|
142
|
-
export declare const ConversationMessages:
|
|
172
|
+
export declare const ConversationMessages: {
|
|
173
|
+
({ className, bottomPadding, onContentBehind, onScrolledFromTop, }: ConversationMessagesProps_2): default_2.JSX.Element;
|
|
174
|
+
displayName: string;
|
|
175
|
+
};
|
|
143
176
|
|
|
144
177
|
declare interface ConversationMessagesProps_2 {
|
|
145
178
|
className?: string;
|
|
146
179
|
bottomPadding?: number;
|
|
147
180
|
onContentBehind?: (isBehind: boolean) => void;
|
|
181
|
+
onScrolledFromTop?: (isScrolled: boolean) => void;
|
|
148
182
|
}
|
|
149
183
|
|
|
150
184
|
export declare const ConversationMessageUser: {
|
|
@@ -170,17 +204,23 @@ declare interface ConversationProps {
|
|
|
170
204
|
acceptedFileTypes?: string[];
|
|
171
205
|
showBranding?: boolean;
|
|
172
206
|
className?: string;
|
|
207
|
+
showHistoryButton?: boolean;
|
|
208
|
+
headerTitle?: string;
|
|
173
209
|
}
|
|
174
210
|
|
|
175
|
-
export declare function ConversationProvider({ messages, callbacks, children }: ConversationProviderProps): default_2.JSX.Element;
|
|
211
|
+
export declare function ConversationProvider({ messages, callbacks, reportScrolledFromTop, children, }: ConversationProviderProps): default_2.JSX.Element;
|
|
176
212
|
|
|
177
213
|
declare interface ConversationProviderProps {
|
|
178
214
|
messages: Message[];
|
|
179
215
|
callbacks: ConversationCallbacks;
|
|
216
|
+
reportScrolledFromTop?: (isScrolled: boolean) => void;
|
|
180
217
|
children: default_2.ReactNode;
|
|
181
218
|
}
|
|
182
219
|
|
|
183
|
-
export declare const ConversationStatus:
|
|
220
|
+
export declare const ConversationStatus: {
|
|
221
|
+
({ className, children, variant, }: ConversationStatusProps_2): default_2.JSX.Element;
|
|
222
|
+
displayName: string;
|
|
223
|
+
};
|
|
184
224
|
|
|
185
225
|
declare interface ConversationStatusProps_2 {
|
|
186
226
|
className?: string;
|
|
@@ -188,7 +228,10 @@ declare interface ConversationStatusProps_2 {
|
|
|
188
228
|
variant?: SweepTextVariant;
|
|
189
229
|
}
|
|
190
230
|
|
|
191
|
-
export declare const ConversationSuggestions:
|
|
231
|
+
export declare const ConversationSuggestions: {
|
|
232
|
+
({ items, className }: ConversationSuggestionsProps_2): default_2.JSX.Element | null;
|
|
233
|
+
displayName: string;
|
|
234
|
+
};
|
|
192
235
|
|
|
193
236
|
declare interface ConversationSuggestionsProps_2 {
|
|
194
237
|
items: Suggestion[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useCallback as r,useMemo as n,useContext as a,createContext as s,useEffect as o,useRef as i,forwardRef as c,useImperativeHandle as l}from"react";import{motion as d,AnimatePresence as u}from"framer-motion";import m from"rehype-raw";import p from"remark-gfm";import{TooltipProvider as h,Tooltip as f,TooltipTrigger as g,TooltipContent as y}from"../components/ui/tooltip.js";import{B as v}from"./button.
|
|
1
|
+
import e,{useState as t,useCallback as r,useMemo as n,useContext as a,createContext as s,useEffect as o,useRef as i,forwardRef as c,useImperativeHandle as l}from"react";import{motion as d,AnimatePresence as u}from"framer-motion";import m from"rehype-raw";import p from"remark-gfm";import{TooltipProvider as h,Tooltip as f,TooltipTrigger as g,TooltipContent as y}from"../components/ui/tooltip.js";import{B as v}from"./button.Cs1X8upM.js";import{XCircle as w,X as b,Check as E,Copy as $,CaretDown as x,ArrowSquareOut as _,CaretRight as k,ArrowsVertical as N,Globe as C,LockSimple as I,MagnifyingGlass as S,Image as P,ArrowRight as T,ArrowLeft as A,ArrowsInSimple as R,ArrowsOutSimple as j,ClockCounterClockwise as O,UserCircle as D}from"@phosphor-icons/react";import{F as z,a as L,M as F}from"./FormattedMessage.Djy5cn5F.js";import{appendErrors as U,useForm as Q,Controller as M}from"react-hook-form";import{validateFieldsNatively as V,toNestErrors as q}from"@hookform/resolvers";import K from"ajv";import{g as B}from"./_commonjsHelpers.lGe4XDVY.js";import{Input as H}from"../components/ui/input.js";import{Label as G}from"../components/ui/label.js";import{Textarea as W}from"../components/ui/textarea.js";import{S as J}from"./simpleSelect.CEUUfl3O.js";import{c as Z,i as X}from"./utils.C6Qu-kwd.js";import{D as Y}from"./date-picker.D9CRxYJf.js";import{createId as ee}from"@paralleldrive/cuid2";import{useImmerReducer as te}from"use-immer";import{useSearchParam as re,useEffectOnce as ne}from"react-use";import{a as ae}from"./ripple-status.C20jzXjF.js";import{MemoizedIcon as se}from"../components/ui/icon.js";import{Collapsible as oe,CollapsibleTrigger as ie,CollapsibleContent as ce}from"../components/ui/collapsible.js";import{F as le}from"./feedback.CGFAP0XS.js";import{getCountry as de}from"countries-and-timezones";import{Switch as ue}from"../components/ui/switch.js";import{C as me}from"./combobox.CLT9CXUV.js";import{T as pe}from"./two-level-combobox.SDv7qc_m.js";import{u as he,F as fe}from"./feature-flags.DOcVlPHk.js";import{l as ge,c as ye,a as ve,f as we,m as be,b as Ee,d as $e,s as xe,e as _e,g as ke,h as Ne,i as Ce}from"./hooks.BQTKhHSv.js";import{X as Ie}from"lucide-react";import{C as Se}from"./chat-logo.CqPppEb9.js";import{ScrollArea as Pe}from"../components/ui/scroll-area.js";import '../ChatSearch.css';function Te({suggestions:t,onQuestionClick:r,title:n="Suggested questions"}){return t&&0!==t.length?/* @__PURE__ */e.createElement("div",{className:"w-full p-3 md:p-0","data-name":"Suggestions"},/* @__PURE__ */e.createElement("h3",{className:"text-base font-medium mb-4 text-foreground"},n),/* @__PURE__ */e.createElement("div",{className:"flex flex-wrap gap-2"},t.map(t=>/* @__PURE__ */e.createElement(v,{key:t.id,onClick:()=>r(t),variant:"outline",className:"border-border font-normal whitespace-normal h-auto text-left"},void 0!==t.messageCount&&/* @__PURE__ */e.createElement(h,null,/* @__PURE__ */e.createElement(f,null,/* @__PURE__ */e.createElement(g,{asChild:!0},/* @__PURE__ */e.createElement("span",{className:"bg-gray-100 text-gray-600 px-2 py-0.5 rounded-full text-xs min-w-[20px] border flex items-center justify-center border-border"},t.messageCount)),/* @__PURE__ */e.createElement(y,null,/* @__PURE__ */e.createElement("p",null,t.messageCount," messages in this conversation")))),
|
|
2
2
|
/* @__PURE__ */e.createElement("span",{className:""},t.question))))):null}var Ae,Re={exports:{}},je={},Oe={};function De(){return Ae||(Ae=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function a(e,...t){const r=[e[0]];let a=0;for(;a<t.length;)i(r,t[a]),r.push(e[++a]);return new n(r)}e._Code=n,e.nil=new n(""),e._=a;const s=new n("+");function o(e,...t){const r=[l(e[0])];let a=0;for(;a<t.length;)r.push(s),i(r,t[a]),r.push(s,l(e[++a]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new n(r)}function i(e,t){var a;t instanceof n?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(a=t)||"boolean"==typeof a||null===a?a:l(Array.isArray(a)?a.join(","):a))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=o,e.addCodeArg=i,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`},e.stringify=function(e){return new n(l(e))},e.safeStringify=l,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new n(`.${t}`):a`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new n(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new n(e.toString())}}(Oe)),Oe}var ze,Le,Fe={};function Ue(){return ze||(ze=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=/*@__PURE__*/De();class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var n;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=a;class s extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=t._`.${new t.Name(r)}[${n}]`}}e.ValueScopeName=s;const o=t._`\n`;e.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:a}=n,s=null!==(r=t.key)&&void 0!==r?r:t.ref;let o=this._values[a];if(o){const e=o.get(s);if(e)return e}else o=this._values[a]=new Map;o.set(s,n);const i=this._scope[a]||(this._scope[a]=[]),c=i.length;return i[c]=t.ref,n.setValue(t,{property:a,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(a,s,o={},i){let c=t.nil;for(const l in a){const d=a[l];if(!d)continue;const u=o[l]=o[l]||new Map;d.forEach(a=>{if(u.has(a))return;u.set(a,n.Started);let o=s(a);if(o){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${a} = ${o};${this.opts._n}`}else{if(!(o=null==i?void 0:i(a)))throw new r(a);c=t._`${c}${o}${this.opts._n}`}u.set(a,n.Completed)})}return c}}}(Fe)),Fe}function Qe(){return Le||(Le=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=/*@__PURE__*/De(),r=/*@__PURE__*/Ue();var n=/*@__PURE__*/De();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var a=/*@__PURE__*/Ue();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(e,t){return this}}class o extends s{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=S(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends s{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=S(this.rhs,e,r),this}get names(){return I(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends i{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class l extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends s{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class u extends s{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class m extends s{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=S(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends s{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const a=r[n];a.optimizeNames(e,t)||(P(e,a.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>C(e,t.names),{})}}class h extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class f extends p{}class g extends h{}g.kind="else";class y extends h{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(T(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=S(this.condition,e,t),this}get names(){const e=super.names;return I(e,this.condition),this.else&&C(e,this.else.names),e}}y.kind="if";class v extends h{}v.kind="for";class w extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=S(this.iteration,e,t),this}get names(){return C(super.names,this.iteration.names)}}class b extends v{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:a,to:s}=this;return`for(${t} ${n}=${a}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){const e=I(super.names,this.from);return I(e,this.to)}}class E extends v{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=S(this.iterable,e,t),this}get names(){return C(super.names,this.iterable.names)}}class $ extends h{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}$.kind="func";class x extends p{render(e){return"return "+super.render(e)}}x.kind="return";class _ extends h{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&C(e,this.catch.names),this.finally&&C(e,this.finally.names),e}}class k extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class N extends h{render(e){return"finally"+super.render(e)}}N.kind="finally";function C(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function I(e,r){return r instanceof t._CodeOrName?C(e,r.names):e}function S(e,r,n){return e instanceof t.Name?s(e):(a=e)instanceof t._Code&&a._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str])?new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=s(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[])):e;var a;function s(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function P(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function T(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${O(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new f]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const a=this._scope.toName(t);return void 0!==r&&n&&(this._constants[a.str]=r),this._leafNode(new o(e,a,r)),a}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new i(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new m(e)),this}object(...e){const r=["{"];for(const[n,a]of e)r.length>1&&r.push(","),r.push(n),(n!==a||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,a));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,n,a,s=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const o=this._scope.toName(e);return this._for(new b(s,o,t,n),()=>a(o))}forOf(e,n,a,s=r.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,r=>{this.var(o,t._`${e}[${r}]`),a(o)})}return this._for(new E("of",s,o,n),()=>a(o))}forIn(e,n,a,s=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,a);const o=this._scope.toName(e);return this._for(new E("in",s,o,n),()=>a(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new x;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new _;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new k(e),t(e)}return r&&(this._currNode=n.finally=new N,this.code(r)),this._endBlockNode(k,N)}throw(e){return this._leafNode(new u(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,a){return this._blockNode(new $(e,r,n)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=T;const A=j(e.operators.AND);e.and=function(...e){return e.reduce(A)};const R=j(e.operators.OR);function j(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${O(r)} ${e} ${O(n)}`}function O(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(R)}}(je)),je}var Me,Ve={},qe={},Ke={},Be={};function He(){if(Me)return Be;Me=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.checkStrictMode=Be.getErrorPath=Be.Type=Be.useFunc=Be.setEvaluated=Be.evaluatedPropsToName=Be.mergeEvaluated=Be.eachItem=Be.unescapeJsonPointer=Be.escapeJsonPointer=Be.escapeFragment=Be.unescapeFragment=Be.schemaRefOrVal=Be.schemaHasRulesButRef=Be.schemaHasRules=Be.checkUnknownRules=Be.alwaysValidSchema=Be.toHash=void 0;const e=/*@__PURE__*/Qe(),t=/*@__PURE__*/De();function r(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const a=n.RULES.keywords;for(const s in t)a[s]||u(e,`unknown keyword: "${s}"`)}function n(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function s(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function o({mergeNames:t,mergeToName:r,mergeValues:n,resultToName:a}){return(s,o,i,c)=>{const l=void 0===i?o:i instanceof e.Name?(o instanceof e.Name?t(s,o,i):r(s,o,i),i):o instanceof e.Name?(r(s,i,o),o):n(o,i);return c!==e.Name||l instanceof e.Name?l:a(s,l)}}function i(t,r){if(!0===r)return t.var("props",!0);const n=t.var("props",e._`{}`);return void 0!==r&&c(t,n,r),n}function c(t,r,n){Object.keys(n).forEach(n=>t.assign(e._`${r}${(0,e.getProperty)(n)}`,!0))}Be.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},Be.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!n(t,e.self.RULES.all))},Be.checkUnknownRules=r,Be.schemaHasRules=n,Be.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},Be.schemaRefOrVal=function({topSchemaRef:t,schemaPath:r},n,a,s){if(!s){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return e._`${n}`}return e._`${t}${r}${(0,e.getProperty)(a)}`},Be.unescapeFragment=function(e){return s(decodeURIComponent(e))},Be.escapeFragment=function(e){return encodeURIComponent(a(e))},Be.escapeJsonPointer=a,Be.unescapeJsonPointer=s,Be.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},Be.mergeEvaluated={props:o({mergeNames:(t,r,n)=>t.if(e._`${n} !== true && ${r} !== undefined`,()=>{t.if(e._`${r} === true`,()=>t.assign(n,!0),()=>t.assign(n,e._`${n} || {}`).code(e._`Object.assign(${n}, ${r})`))}),mergeToName:(t,r,n)=>t.if(e._`${n} !== true`,()=>{!0===r?t.assign(n,!0):(t.assign(n,e._`${n} || {}`),c(t,n,r))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:i}),items:o({mergeNames:(t,r,n)=>t.if(e._`${n} !== true && ${r} !== undefined`,()=>t.assign(n,e._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`)),mergeToName:(t,r,n)=>t.if(e._`${n} !== true`,()=>t.assign(n,!0===r||e._`${n} > ${r} ? ${n} : ${r}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},Be.evaluatedPropsToName=i,Be.setEvaluated=c;const l={};var d;function u(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}return Be.useFunc=function(e,r){return e.scopeValue("func",{ref:r,code:l[r.code]||(l[r.code]=new t._Code(r.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d||(Be.Type=d={})),Be.getErrorPath=function(t,r,n){if(t instanceof e.Name){const a=r===d.Num;return n?a?e._`"[" + ${t} + "]"`:e._`"['" + ${t} + "']"`:a?e._`"/" + ${t}`:e._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,e.getProperty)(t).toString():"/"+a(t)},Be.checkStrictMode=u,Be}var Ge,We,Je,Ze={};function Xe(){if(Ge)return Ze;Ge=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=/*@__PURE__*/Qe(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ze.default=t,Ze}function Ye(){return We||(We=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=/*@__PURE__*/Qe(),r=/*@__PURE__*/He(),n=/*@__PURE__*/Xe();function a(e,r){const a=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,()=>e.assign(n.default.vErrors,t._`[${a}]`),t._`${n.default.vErrors}.push(${a})`),e.code(t._`${n.default.errors}++`)}function s(e,r){const{gen:n,validateName:a,schemaEnv:s}=e;s.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${a}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,o,c){const{it:l}=r,{gen:d,compositeRule:u,allErrors:m}=l,p=i(r,n,o);(null!=c?c:u||m)?a(d,p):s(l,t._`[${p}]`)},e.reportExtraError=function(t,r=e.keywordError,o){const{it:c}=t,{gen:l,compositeRule:d,allErrors:u}=c;a(l,i(t,r,o)),d||u||s(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,()=>e.if(r,()=>e.assign(t._`${n.default.vErrors}.length`,r),()=>e.assign(n.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:a,data:s,errsCount:o,it:i}){if(void 0===o)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",o,n.default.errors,o=>{e.const(c,t._`${n.default.vErrors}[${o}]`),e.if(t._`${c}.instancePath === undefined`,()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,i.errorPath))),e.assign(t._`${c}.schemaPath`,t.str`${i.errSchemaPath}/${r}`),i.opts.verbose&&(e.assign(t._`${c}.schema`,a),e.assign(t._`${c}.data`,s))})};const o={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function i(e,r,a){const{createErrors:s}=e.it;return!1===s?t._`{}`:function(e,r,a={}){const{gen:s,it:i}=e,d=[c(i,a),l(e,a)];return function(e,{params:r,message:a},s){const{keyword:i,data:c,schemaValue:l,it:d}=e,{opts:u,propertyName:m,topSchemaRef:p,schemaPath:h}=d;s.push([o.keyword,i],[o.params,"function"==typeof r?r(e):r||t._`{}`]),u.messages&&s.push([o.message,"function"==typeof a?a(e):a]);u.verbose&&s.push([o.schema,l],[o.parentSchema,t._`${p}${h}`],[n.default.data,c]);m&&s.push([o.propertyName,m])}(e,r,d),s.object(...d)}(e,r,a)}function c({errorPath:e},{instancePath:a}){const s=a?t.str`${e}${(0,r.getErrorPath)(a,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,s)]}function l({keyword:e,it:{errSchemaPath:n}},{schemaPath:a,parentSchema:s}){let i=s?n:t.str`${n}/${e}`;return a&&(i=t.str`${i}${(0,r.getErrorPath)(a,r.Type.Str)}`),[o.schemaPath,i]}}(Ke)),Ke}function et(){if(Je)return qe;Je=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.boolOrEmptySchema=qe.topBoolOrEmptySchema=void 0;const e=/*@__PURE__*/Ye(),t=/*@__PURE__*/Qe(),r=/*@__PURE__*/Xe(),n={message:"boolean schema is false"};function a(t,r){const{gen:a,data:s}=t,o={gen:a,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,e.reportError)(o,n,void 0,r)}return qe.topBoolOrEmptySchema=function(e){const{gen:n,schema:s,validateName:o}=e;!1===s?a(e,!1):"object"==typeof s&&!0===s.$async?n.return(r.default.data):(n.assign(t._`${o}.errors`,null),n.return(!0))},qe.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)},qe}var tt,rt={},nt={};function at(){if(tt)return nt;tt=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.getRules=nt.isJSONType=void 0;const e=new Set(["string","number","integer","boolean","null","object","array"]);return nt.isJSONType=function(t){return"string"==typeof t&&e.has(t)},nt.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}},nt}var st,ot,it={};function ct(){if(st)return it;function e(e,r){return r.rules.some(r=>t(e,r))}function t(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}return st=1,Object.defineProperty(it,"__esModule",{value:!0}),it.shouldUseRule=it.shouldUseGroup=it.schemaHasRulesForType=void 0,it.schemaHasRulesForType=function({schema:t,self:r},n){const a=r.RULES.types[n];return a&&!0!==a&&e(t,a)},it.shouldUseGroup=e,it.shouldUseRule=t,it}function lt(){if(ot)return rt;ot=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.reportTypeError=rt.checkDataTypes=rt.checkDataType=rt.coerceAndCheckDataType=rt.getJSONTypes=rt.getSchemaTypes=rt.DataType=void 0;const e=/*@__PURE__*/at(),t=/*@__PURE__*/ct(),r=/*@__PURE__*/Ye(),n=/*@__PURE__*/Qe(),a=/*@__PURE__*/He();var s;function o(t){const r=Array.isArray(t)?t:t?[t]:[];if(r.every(e.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(s||(rt.DataType=s={})),rt.getSchemaTypes=function(e){const t=o(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},rt.getJSONTypes=o,rt.coerceAndCheckDataType=function(e,r){const{gen:a,data:o,opts:c}=e,d=function(e,t){return t?e.filter(e=>i.has(e)||"array"===t&&"array"===e):[]}(r,c.coerceTypes),m=r.length>0&&!(0===d.length&&1===r.length&&(0,t.schemaHasRulesForType)(e,r[0]));if(m){const t=l(r,o,c.strictNumbers,s.Wrong);a.if(t,()=>{d.length?function(e,t,r){const{gen:a,data:s,opts:o}=e,c=a.let("dataType",n._`typeof ${s}`),d=a.let("coerced",n._`undefined`);"array"===o.coerceTypes&&a.if(n._`${c} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>a.assign(s,n._`${s}[0]`).assign(c,n._`typeof ${s}`).if(l(t,s,o.strictNumbers),()=>a.assign(d,s)));a.if(n._`${d} !== undefined`);for(const n of r)(i.has(n)||"array"===n&&"array"===o.coerceTypes)&&m(n);function m(e){switch(e){case"string":return void a.elseIf(n._`${c} == "number" || ${c} == "boolean"`).assign(d,n._`"" + ${s}`).elseIf(n._`${s} === null`).assign(d,n._`""`);case"number":return void a.elseIf(n._`${c} == "boolean" || ${s} === null
|
|
3
3
|
|| (${c} == "string" && ${s} && ${s} == +${s})`).assign(d,n._`+${s}`);case"integer":return void a.elseIf(n._`${c} === "boolean" || ${s} === null
|
|
4
4
|
|| (${c} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(d,n._`+${s}`);case"boolean":return void a.elseIf(n._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(d,!1).elseIf(n._`${s} === "true" || ${s} === 1`).assign(d,!0);case"null":return a.elseIf(n._`${s} === "" || ${s} === 0 || ${s} === false`),void a.assign(d,null);case"array":a.elseIf(n._`${c} === "string" || ${c} === "number"
|
|
@@ -93,4 +93,4 @@ return e.createElement(d.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},t
|
|
|
93
93
|
/* @__PURE__ */e.createElement("div",{ref:dt})),fe&&tt&&!wt&&!W&&!ht&&(()=>{const t=oe.some(e=>"awaiting-knowledge-group"===e.state);/* @__PURE__ */
|
|
94
94
|
return e.createElement(Jr,{ref:lt,initialQuery:de,onQueryChange:ue,isSearching:me,handleFollowUpSearch:Ut,textConfig:ze,enableFileAttachment:Fe,attachedFiles:Ke,isUploading:Be,onAddFiles:He,onRemoveFile:Ge,disabled:t})})(),fe&&wt&&!W&&!ht&&/* @__PURE__ */e.createElement(mn,{onStartNewConversation:()=>Lt()}),!ht&&W)});yn.displayName="ChatSearch";const vn=c(({featureFlags:t,...r},n)=>/* @__PURE__ */e.createElement(fe,{flags:t},/* @__PURE__ */e.createElement(kr,{searchPath:r.searchPath,contentTypeEndpoint:r.contentTypeEndpoint,widgetKey:r.apiKey},
|
|
95
95
|
/* @__PURE__ */e.createElement(yn,{...r,ref:n}))));vn.displayName="ChatSearch";export{vn as C,Dr as N,mn as R,kr as a,Zr as b,Nr as u,Or as v};
|
|
96
|
-
//# sourceMappingURL=ChatSearch.
|
|
96
|
+
//# sourceMappingURL=ChatSearch.D5EABw51.js.map
|