hermes-web-ui 0.2.7 → 0.2.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 +2 -2
- package/bin/hermes-web-ui.mjs +50 -13
- package/dist/client/assets/Add-XpaL69a7.js +1 -0
- package/dist/client/assets/{Button-zECKCotA.js → Button-DZWlvt3_.js} +14 -14
- package/dist/client/assets/{ChannelsView-xCdAEZam.css → ChannelsView-D168bwSq.css} +1 -1
- package/dist/client/assets/ChannelsView-DsFZWVNp.js +1 -0
- package/dist/client/assets/ChatView-DoqDlZLC.js +127 -0
- package/dist/client/assets/{Close-DjLWDodG.js → Close-CynFIaWE.js} +10 -10
- package/dist/client/assets/FormItem-9JbgiHgw.js +110 -0
- package/dist/client/assets/Input-BUMpvosL.js +234 -0
- package/dist/client/assets/InputNumber-BOptkZXt.js +13 -0
- package/dist/client/assets/{JobsView-DsfGyjnT.js → JobsView-C-nRY00Q.js} +2 -2
- package/dist/client/assets/{LoginView-BiWaCYS0.js → LoginView-CLrTbJPK.js} +1 -1
- package/dist/client/assets/{LogsView-DuORyFFY.js → LogsView-BjeUz4w_.js} +1 -1
- package/dist/client/assets/{MarkdownRenderer-BA3oPVqT.js → MarkdownRenderer-pJXYVaJf.js} +1 -1
- package/dist/client/assets/MemoryView-B_b0Bw4s.js +7 -0
- package/dist/client/assets/MemoryView-hIfyUkwz.css +1 -0
- package/dist/client/assets/{Modal-WQKdvHJY.js → Modal-Gb5CDHOn.js} +56 -56
- package/dist/client/assets/ModelsView-BHO6JeeK.js +1 -0
- package/dist/client/assets/{Popconfirm-02A7vL_z.js → Popconfirm-f3hviugz.js} +4 -4
- package/dist/client/assets/Popover-BtQeULHo.js +117 -0
- package/dist/client/assets/ProfilesView-C4GoKpgi.js +440 -0
- package/dist/client/assets/ProfilesView-jqeO8Zv3.css +1 -0
- package/dist/client/assets/{Scrollbar-Bg2FeTtI.js → Scrollbar-Bui9E0cT.js} +17 -17
- package/dist/client/assets/Select-By6oALhZ.js +340 -0
- package/dist/client/assets/{SettingRow-CLLFxWP3.js → SettingRow-CWqG1TP7.js} +1 -1
- package/dist/client/assets/SettingsView-CzgT0dAx.js +352 -0
- package/dist/client/assets/{SkillsView-D6CegW4w.js → SkillsView-2xeOBpxm.js} +1 -1
- package/dist/client/assets/{Spin-lybeIDeX.js → Spin-DD5RgTEV.js} +4 -4
- package/dist/client/assets/{Suffix-Dv1UElLH.js → Suffix-CkTuXehC.js} +5 -5
- package/dist/client/assets/{Switch-mgeu-lpD.js → Switch-BqpUglHp.js} +15 -15
- package/dist/client/assets/{Tag-DWc4lbAm.js → Tag-BdqJCtwA.js} +15 -15
- package/dist/client/assets/{TerminalView-DmnXOHFu.js → TerminalView-DOvaJfhr.js} +1 -1
- package/dist/client/assets/{Tooltip-DrDTmrj3.js → Tooltip-2f394xdV.js} +1 -1
- package/dist/client/assets/{UsageView-C3O6-vbW.js → UsageView-Cd7Gui1x.js} +1 -1
- package/dist/client/assets/{Warning-t1i_4T5i.js → Warning-21tMOc2L.js} +1 -1
- package/dist/client/assets/{_plugin-vue_export-helper-BkT4A29V.js → _plugin-vue_export-helper-C39Y8Snr.js} +1 -1
- package/dist/client/assets/app-Dc1GzlQi.js +1 -0
- package/dist/client/assets/app-DjAPGKg7.js +1 -0
- package/dist/client/assets/{browser-DzAOCZtm.js → browser-DMdqvQBg.js} +9 -9
- package/dist/client/assets/{chat-CX1Hza8X.js → chat-1kL3Ps59.js} +2 -2
- package/dist/client/assets/composables-BxlGNoT-.js +1 -0
- package/dist/client/assets/create-5zWq3BEB.js +1 -0
- package/dist/client/assets/fade-in-scale-up.cssr-HXBs3oL0.js +1 -0
- package/dist/client/assets/index-BT19Bivl.css +1 -0
- package/dist/client/assets/index-CFIEnaxD.js +284 -0
- package/dist/client/assets/{jobs-B9NHIxuL.js → jobs-YFhNrsBu.js} +1 -1
- package/dist/client/assets/{pinia-bPUFQqFK.js → pinia-BPgWlB7x.js} +1 -1
- package/dist/client/assets/profiles-H8Bd9mDO.js +23 -0
- package/dist/client/assets/{router-COwpqexM.js → router-cAIqC_mO.js} +2 -2
- package/dist/client/assets/{sessions-B1SPfe-R.js → sessions-fFwnFvo3.js} +1 -1
- package/dist/client/assets/{skills-CRtljpt6.js → skills-DZWMwFIf.js} +1 -1
- package/dist/client/assets/use-compitable-esQP7BHf.js +1 -0
- package/dist/client/assets/use-message-CnDHqZf8.js +1 -0
- package/dist/client/index.html +24 -22
- package/dist/server/data/.token +1 -0
- package/dist/server/index.js +70 -4
- package/dist/server/routes/hermes/config.js +11 -11
- package/dist/server/routes/hermes/filesystem.js +154 -29
- package/dist/server/routes/hermes/profiles.js +136 -14
- package/dist/server/routes/hermes/terminal.js +12 -34
- package/dist/server/routes/hermes/weixin.js +6 -6
- package/dist/server/services/hermes-cli.d.ts +4 -0
- package/dist/server/services/hermes-cli.js +17 -0
- package/dist/server/services/hermes-profile.d.ts +22 -0
- package/dist/server/services/hermes-profile.js +60 -0
- package/dist/server/shared/providers.js +8 -14
- package/package.json +1 -1
- package/dist/client/assets/ChannelsView-Bvh3tnio.js +0 -1
- package/dist/client/assets/ChatView-CJZahJ1V.js +0 -127
- package/dist/client/assets/FormItem-CZ9auYA2.js +0 -110
- package/dist/client/assets/Input-DxJk6pT-.js +0 -234
- package/dist/client/assets/InputNumber-BTqp81h0.js +0 -13
- package/dist/client/assets/MemoryView-CU3JHweh.css +0 -1
- package/dist/client/assets/MemoryView-VgQFNMsP.js +0 -5
- package/dist/client/assets/ModelsView-QDRloKd5.js +0 -1
- package/dist/client/assets/Popover-2C1zuptC.js +0 -117
- package/dist/client/assets/Select-C_hKaXgI.js +0 -340
- package/dist/client/assets/SettingsView-CeScqhwO.js +0 -352
- package/dist/client/assets/app-BUjbfMSg.js +0 -1
- package/dist/client/assets/app-p59ZckFN.js +0 -1
- package/dist/client/assets/context-BM8ZQCOz.js +0 -1
- package/dist/client/assets/fade-in-scale-up.cssr-DQl-Z54c.js +0 -1
- package/dist/client/assets/index-95z-iQoj.js +0 -306
- package/dist/client/assets/index-C33O1KZm.css +0 -1
- package/dist/client/assets/use-compitable-BnlNjEug.js +0 -1
- package/dist/client/assets/use-message-g8F4Z57w.js +0 -1
- /package/dist/client/assets/{omit-C4dR5R2G.js → omit-1BRB6K75.js} +0 -0
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import{C as e,F as t,K as n,M as r,N as i,R as a,U as o,X as s,Z as c,ct as l,dt as u,j as d,y as f}from"./router-COwpqexM.js";import{B as ee,G as p,K as m,Q as h,R as g,W as _,at as v,c as y,ct as b,d as te,dt as x,et as S,l as C,lt as w,n as T,ot as E,q as D,s as O,t as ne,tt as k,ut as A,z as j}from"./browser-DzAOCZtm.js";import{f as re,g as ie,h as ae,m as oe,o as M,r as N,s as se,t as P,v as ce}from"./Scrollbar-Bg2FeTtI.js";import{n as F,t as I}from"./Suffix-Dv1UElLH.js";var L=d({name:`Eye`,render(){return i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},i(`path`,{d:`M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`}),i(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`}))}}),R=d({name:`EyeOff`,render(){return i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},i(`path`,{d:`M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z`,fill:`currentColor`}),i(`path`,{d:`M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z`,fill:`currentColor`}),i(`path`,{d:`M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z`,fill:`currentColor`}),i(`path`,{d:`M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z`,fill:`currentColor`}),i(`path`,{d:`M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z`,fill:`currentColor`}))}}),z={paddingTiny:`0 8px`,paddingSmall:`0 10px`,paddingMedium:`0 12px`,paddingLarge:`0 14px`,clearSize:`16px`};function B(e){let{textColor2:t,textColor3:n,textColorDisabled:r,primaryColor:i,primaryColorHover:a,inputColor:o,inputColorDisabled:s,borderColor:c,warningColor:l,warningColorHover:u,errorColor:d,errorColorHover:f,borderRadius:ee,lineHeight:p,fontSizeTiny:m,fontSizeSmall:h,fontSizeMedium:g,fontSizeLarge:_,heightTiny:v,heightSmall:y,heightMedium:b,heightLarge:te,actionColor:x,clearColor:S,clearColorHover:C,clearColorPressed:w,placeholderColor:T,placeholderColorDisabled:E,iconColor:D,iconColorDisabled:O,iconColorHover:ne,iconColorPressed:A,fontWeight:j}=e;return Object.assign(Object.assign({},z),{fontWeight:j,countTextColorDisabled:r,countTextColor:n,heightTiny:v,heightSmall:y,heightMedium:b,heightLarge:te,fontSizeTiny:m,fontSizeSmall:h,fontSizeMedium:g,fontSizeLarge:_,lineHeight:p,lineHeightTextarea:p,borderRadius:ee,iconSize:`16px`,groupLabelColor:x,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:i,placeholderColor:T,placeholderColorDisabled:E,color:o,colorDisabled:s,colorFocus:o,groupLabelBorder:`1px solid ${c}`,border:`1px solid ${c}`,borderHover:`1px solid ${a}`,borderDisabled:`1px solid ${c}`,borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 0 2px ${k(i,{alpha:.2})}`,loadingColor:i,loadingColorWarning:l,borderWarning:`1px solid ${l}`,borderHoverWarning:`1px solid ${u}`,colorFocusWarning:o,borderFocusWarning:`1px solid ${u}`,boxShadowFocusWarning:`0 0 0 2px ${k(l,{alpha:.2})}`,caretColorWarning:l,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${f}`,colorFocusError:o,borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 0 2px ${k(d,{alpha:.2})}`,caretColorError:d,clearColor:S,clearColorHover:C,clearColorPressed:w,iconColor:D,iconColorDisabled:O,iconColorHover:ne,iconColorPressed:A,suffixTextColor:t})}var V=O({name:`Input`,common:T,peers:{Scrollbar:N},self:B}),H=h(`n-input`),le=E(`input`,`
|
|
2
|
-
max-width: 100%;
|
|
3
|
-
cursor: text;
|
|
4
|
-
line-height: 1.5;
|
|
5
|
-
z-index: auto;
|
|
6
|
-
outline: none;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
position: relative;
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
border-radius: var(--n-border-radius);
|
|
11
|
-
background-color: var(--n-color);
|
|
12
|
-
transition: background-color .3s var(--n-bezier);
|
|
13
|
-
font-size: var(--n-font-size);
|
|
14
|
-
font-weight: var(--n-font-weight);
|
|
15
|
-
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
|
|
16
|
-
`,[b(`input, textarea`,`
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
flex-grow: 1;
|
|
19
|
-
position: relative;
|
|
20
|
-
`),b(`input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder`,`
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
font-size: inherit;
|
|
23
|
-
line-height: 1.5;
|
|
24
|
-
font-family: inherit;
|
|
25
|
-
border: none;
|
|
26
|
-
outline: none;
|
|
27
|
-
background-color: #0000;
|
|
28
|
-
text-align: inherit;
|
|
29
|
-
transition:
|
|
30
|
-
-webkit-text-fill-color .3s var(--n-bezier),
|
|
31
|
-
caret-color .3s var(--n-bezier),
|
|
32
|
-
color .3s var(--n-bezier),
|
|
33
|
-
text-decoration-color .3s var(--n-bezier);
|
|
34
|
-
`),b(`input-el, textarea-el`,`
|
|
35
|
-
-webkit-appearance: none;
|
|
36
|
-
scrollbar-width: none;
|
|
37
|
-
width: 100%;
|
|
38
|
-
min-width: 0;
|
|
39
|
-
text-decoration-color: var(--n-text-decoration-color);
|
|
40
|
-
color: var(--n-text-color);
|
|
41
|
-
caret-color: var(--n-caret-color);
|
|
42
|
-
background-color: transparent;
|
|
43
|
-
`,[v(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
|
|
44
|
-
width: 0;
|
|
45
|
-
height: 0;
|
|
46
|
-
display: none;
|
|
47
|
-
`),v(`&::placeholder`,`
|
|
48
|
-
color: #0000;
|
|
49
|
-
-webkit-text-fill-color: transparent !important;
|
|
50
|
-
`),v(`&:-webkit-autofill ~`,[b(`placeholder`,`display: none;`)])]),w(`round`,[A(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),b(`placeholder`,`
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
position: absolute;
|
|
53
|
-
left: 0;
|
|
54
|
-
right: 0;
|
|
55
|
-
top: 0;
|
|
56
|
-
bottom: 0;
|
|
57
|
-
overflow: hidden;
|
|
58
|
-
color: var(--n-placeholder-color);
|
|
59
|
-
`,[v(`span`,`
|
|
60
|
-
width: 100%;
|
|
61
|
-
display: inline-block;
|
|
62
|
-
`)]),w(`textarea`,[b(`placeholder`,`overflow: visible;`)]),A(`autosize`,`width: 100%;`),w(`autosize`,[b(`textarea-el, input-el`,`
|
|
63
|
-
position: absolute;
|
|
64
|
-
top: 0;
|
|
65
|
-
left: 0;
|
|
66
|
-
height: 100%;
|
|
67
|
-
`)]),E(`input-wrapper`,`
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
display: inline-flex;
|
|
70
|
-
flex-grow: 1;
|
|
71
|
-
position: relative;
|
|
72
|
-
padding-left: var(--n-padding-left);
|
|
73
|
-
padding-right: var(--n-padding-right);
|
|
74
|
-
`),b(`input-mirror`,`
|
|
75
|
-
padding: 0;
|
|
76
|
-
height: var(--n-height);
|
|
77
|
-
line-height: var(--n-height);
|
|
78
|
-
overflow: hidden;
|
|
79
|
-
visibility: hidden;
|
|
80
|
-
position: static;
|
|
81
|
-
white-space: pre;
|
|
82
|
-
pointer-events: none;
|
|
83
|
-
`),b(`input-el`,`
|
|
84
|
-
padding: 0;
|
|
85
|
-
height: var(--n-height);
|
|
86
|
-
line-height: var(--n-height);
|
|
87
|
-
`,[v(`&[type=password]::-ms-reveal`,`display: none;`),v(`+`,[b(`placeholder`,`
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
`)])]),A(`textarea`,[b(`placeholder`,`white-space: nowrap;`)]),b(`eye`,`
|
|
91
|
-
display: flex;
|
|
92
|
-
align-items: center;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
transition: color .3s var(--n-bezier);
|
|
95
|
-
`),w(`textarea`,`width: 100%;`,[E(`input-word-count`,`
|
|
96
|
-
position: absolute;
|
|
97
|
-
right: var(--n-padding-right);
|
|
98
|
-
bottom: var(--n-padding-vertical);
|
|
99
|
-
`),w(`resizable`,[E(`input-wrapper`,`
|
|
100
|
-
resize: vertical;
|
|
101
|
-
min-height: var(--n-height);
|
|
102
|
-
`)]),b(`textarea-el, textarea-mirror, placeholder`,`
|
|
103
|
-
height: 100%;
|
|
104
|
-
padding-left: 0;
|
|
105
|
-
padding-right: 0;
|
|
106
|
-
padding-top: var(--n-padding-vertical);
|
|
107
|
-
padding-bottom: var(--n-padding-vertical);
|
|
108
|
-
word-break: break-word;
|
|
109
|
-
display: inline-block;
|
|
110
|
-
vertical-align: bottom;
|
|
111
|
-
box-sizing: border-box;
|
|
112
|
-
line-height: var(--n-line-height-textarea);
|
|
113
|
-
margin: 0;
|
|
114
|
-
resize: none;
|
|
115
|
-
white-space: pre-wrap;
|
|
116
|
-
scroll-padding-block-end: var(--n-padding-vertical);
|
|
117
|
-
`),b(`textarea-mirror`,`
|
|
118
|
-
width: 100%;
|
|
119
|
-
pointer-events: none;
|
|
120
|
-
overflow: hidden;
|
|
121
|
-
visibility: hidden;
|
|
122
|
-
position: static;
|
|
123
|
-
white-space: pre-wrap;
|
|
124
|
-
overflow-wrap: break-word;
|
|
125
|
-
`)]),w(`pair`,[b(`input-el, placeholder`,`text-align: center;`),b(`separator`,`
|
|
126
|
-
display: flex;
|
|
127
|
-
align-items: center;
|
|
128
|
-
transition: color .3s var(--n-bezier);
|
|
129
|
-
color: var(--n-text-color);
|
|
130
|
-
white-space: nowrap;
|
|
131
|
-
`,[E(`icon`,`
|
|
132
|
-
color: var(--n-icon-color);
|
|
133
|
-
`),E(`base-icon`,`
|
|
134
|
-
color: var(--n-icon-color);
|
|
135
|
-
`)])]),w(`disabled`,`
|
|
136
|
-
cursor: not-allowed;
|
|
137
|
-
background-color: var(--n-color-disabled);
|
|
138
|
-
`,[b(`border`,`border: var(--n-border-disabled);`),b(`input-el, textarea-el`,`
|
|
139
|
-
cursor: not-allowed;
|
|
140
|
-
color: var(--n-text-color-disabled);
|
|
141
|
-
text-decoration-color: var(--n-text-color-disabled);
|
|
142
|
-
`),b(`placeholder`,`color: var(--n-placeholder-color-disabled);`),b(`separator`,`color: var(--n-text-color-disabled);`,[E(`icon`,`
|
|
143
|
-
color: var(--n-icon-color-disabled);
|
|
144
|
-
`),E(`base-icon`,`
|
|
145
|
-
color: var(--n-icon-color-disabled);
|
|
146
|
-
`)]),E(`input-word-count`,`
|
|
147
|
-
color: var(--n-count-text-color-disabled);
|
|
148
|
-
`),b(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[E(`icon`,`
|
|
149
|
-
color: var(--n-icon-color-disabled);
|
|
150
|
-
`),E(`internal-icon`,`
|
|
151
|
-
color: var(--n-icon-color-disabled);
|
|
152
|
-
`)])]),A(`disabled`,[b(`eye`,`
|
|
153
|
-
color: var(--n-icon-color);
|
|
154
|
-
cursor: pointer;
|
|
155
|
-
`,[v(`&:hover`,`
|
|
156
|
-
color: var(--n-icon-color-hover);
|
|
157
|
-
`),v(`&:active`,`
|
|
158
|
-
color: var(--n-icon-color-pressed);
|
|
159
|
-
`)]),v(`&:hover`,[b(`state-border`,`border: var(--n-border-hover);`)]),w(`focus`,`background-color: var(--n-color-focus);`,[b(`state-border`,`
|
|
160
|
-
border: var(--n-border-focus);
|
|
161
|
-
box-shadow: var(--n-box-shadow-focus);
|
|
162
|
-
`)])]),b(`border, state-border`,`
|
|
163
|
-
box-sizing: border-box;
|
|
164
|
-
position: absolute;
|
|
165
|
-
left: 0;
|
|
166
|
-
right: 0;
|
|
167
|
-
top: 0;
|
|
168
|
-
bottom: 0;
|
|
169
|
-
pointer-events: none;
|
|
170
|
-
border-radius: inherit;
|
|
171
|
-
border: var(--n-border);
|
|
172
|
-
transition:
|
|
173
|
-
box-shadow .3s var(--n-bezier),
|
|
174
|
-
border-color .3s var(--n-bezier);
|
|
175
|
-
`),b(`state-border`,`
|
|
176
|
-
border-color: #0000;
|
|
177
|
-
z-index: 1;
|
|
178
|
-
`),b(`prefix`,`margin-right: 4px;`),b(`suffix`,`
|
|
179
|
-
margin-left: 4px;
|
|
180
|
-
`),b(`suffix, prefix`,`
|
|
181
|
-
transition: color .3s var(--n-bezier);
|
|
182
|
-
flex-wrap: nowrap;
|
|
183
|
-
flex-shrink: 0;
|
|
184
|
-
line-height: var(--n-height);
|
|
185
|
-
white-space: nowrap;
|
|
186
|
-
display: inline-flex;
|
|
187
|
-
align-items: center;
|
|
188
|
-
justify-content: center;
|
|
189
|
-
color: var(--n-suffix-text-color);
|
|
190
|
-
`,[E(`base-loading`,`
|
|
191
|
-
font-size: var(--n-icon-size);
|
|
192
|
-
margin: 0 2px;
|
|
193
|
-
color: var(--n-loading-color);
|
|
194
|
-
`),E(`base-clear`,`
|
|
195
|
-
font-size: var(--n-icon-size);
|
|
196
|
-
`,[b(`placeholder`,[E(`base-icon`,`
|
|
197
|
-
transition: color .3s var(--n-bezier);
|
|
198
|
-
color: var(--n-icon-color);
|
|
199
|
-
font-size: var(--n-icon-size);
|
|
200
|
-
`)])]),v(`>`,[E(`icon`,`
|
|
201
|
-
transition: color .3s var(--n-bezier);
|
|
202
|
-
color: var(--n-icon-color);
|
|
203
|
-
font-size: var(--n-icon-size);
|
|
204
|
-
`)]),E(`base-icon`,`
|
|
205
|
-
font-size: var(--n-icon-size);
|
|
206
|
-
`)]),E(`input-word-count`,`
|
|
207
|
-
pointer-events: none;
|
|
208
|
-
line-height: 1.5;
|
|
209
|
-
font-size: .85em;
|
|
210
|
-
color: var(--n-count-text-color);
|
|
211
|
-
transition: color .3s var(--n-bezier);
|
|
212
|
-
margin-left: 4px;
|
|
213
|
-
font-variant: tabular-nums;
|
|
214
|
-
`),[`warning`,`error`].map(e=>w(`${e}-status`,[A(`disabled`,[E(`base-loading`,`
|
|
215
|
-
color: var(--n-loading-color-${e})
|
|
216
|
-
`),b(`input-el, textarea-el`,`
|
|
217
|
-
caret-color: var(--n-caret-color-${e});
|
|
218
|
-
`),b(`state-border`,`
|
|
219
|
-
border: var(--n-border-${e});
|
|
220
|
-
`),v(`&:hover`,[b(`state-border`,`
|
|
221
|
-
border: var(--n-border-hover-${e});
|
|
222
|
-
`)]),v(`&:focus`,`
|
|
223
|
-
background-color: var(--n-color-focus-${e});
|
|
224
|
-
`,[b(`state-border`,`
|
|
225
|
-
box-shadow: var(--n-box-shadow-focus-${e});
|
|
226
|
-
border: var(--n-border-focus-${e});
|
|
227
|
-
`)]),w(`focus`,`
|
|
228
|
-
background-color: var(--n-color-focus-${e});
|
|
229
|
-
`,[b(`state-border`,`
|
|
230
|
-
box-shadow: var(--n-box-shadow-focus-${e});
|
|
231
|
-
border: var(--n-border-focus-${e});
|
|
232
|
-
`)])])]))]),ue=E(`input`,[w(`disabled`,[b(`input-el, textarea-el`,`
|
|
233
|
-
-webkit-text-fill-color: var(--n-text-color-disabled);
|
|
234
|
-
`)])]);function U(e){let t=0;for(let n of e)t++;return t}function W(e){return e===``||e==null}function de(e){let t=l(null);function n(){let{value:n}=e;if(!n?.focus){i();return}let{selectionStart:r,selectionEnd:a,value:o}=n;if(r==null||a==null){i();return}t.value={start:r,end:a,beforeText:o.slice(0,r),afterText:o.slice(a)}}function r(){var n;let{value:r}=t,{value:i}=e;if(!r||!i)return;let{value:a}=i,{start:o,beforeText:s,afterText:c}=r,l=a.length;if(a.endsWith(c))l=a.length-c.length;else if(a.startsWith(s))l=s.length;else{let e=s[o-1],t=a.indexOf(e,o-1);t!==-1&&(l=t+1)}(n=i.setSelectionRange)==null||n.call(i,l,l)}function i(){t.value=null}return s(e,i),{recordCursor:n,restoreCursor:r}}var G=d({name:`InputWordCount`,setup(n,{slots:r}){let{mergedValueRef:a,maxlengthRef:o,mergedClsPrefixRef:s,countGraphemesRef:c}=t(H),l=e(()=>{let{value:e}=a;return e===null||Array.isArray(e)?0:(c.value||U)(e)});return()=>{let{value:e}=o,{value:t}=a;return i(`span`,{class:`${s.value}-input-word-count`},p(r.default,{value:t===null||Array.isArray(t)?``:t},()=>[e===void 0?l.value:`${l.value} / ${e}`]))}}}),K=d({name:`Input`,props:Object.assign(Object.assign({},y.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:`text`},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),slots:Object,setup(t){let{mergedClsPrefixRef:i,mergedBorderedRef:d,inlineThemeDisabled:f,mergedRtlRef:p,mergedComponentPropsRef:m}=ee(t),h=y(`Input`,`-input`,le,V,t,i);ne&&C(`-input-safari`,ue,i);let _=l(null),v=l(null),b=l(null),w=l(null),T=l(null),E=l(null),O=l(null),k=de(O),A=l(null),{localeRef:re}=se(`Input`),M=l(t.defaultValue),N=oe(u(t,`value`),M),P=g(t,{mergedSize:e=>{let{size:n}=t;if(n)return n;let{mergedSize:r}=e||{};return r?.value?r.value:m?.value?.Input?.size||`medium`}}),{mergedSizeRef:F,mergedDisabledRef:I,mergedStatusRef:L}=P,R=l(!1),z=l(!1),B=l(!1),U=l(!1),G=null,K=e(()=>{let{placeholder:e,pair:n}=t;return n?Array.isArray(e)?e:e===void 0?[``,``]:[e,e]:e===void 0?[re.value.placeholder]:[e]}),fe=e(()=>{let{value:e}=B,{value:t}=N,{value:n}=K;return!e&&(W(t)||Array.isArray(t)&&W(t[0]))&&n[0]}),pe=e(()=>{let{value:e}=B,{value:t}=N,{value:n}=K;return!e&&n[1]&&(W(t)||Array.isArray(t)&&W(t[1]))}),q=S(()=>t.internalForceFocus||R.value),me=S(()=>{if(I.value||t.readonly||!t.clearable||!q.value&&!z.value)return!1;let{value:e}=N,{value:n}=q;return t.pair?!!(Array.isArray(e)&&(e[0]||e[1]))&&(z.value||n):!!e&&(z.value||n)}),he=e(()=>{let{showPasswordOn:e}=t;if(e)return e;if(t.showPasswordToggle)return`click`}),J=l(!1),ge=e(()=>{let{textDecoration:e}=t;return e?Array.isArray(e)?e.map(e=>({textDecoration:e})):[{textDecoration:e}]:[``,``]}),_e=l(void 0),ve=()=>{if(t.type===`textarea`){let{autosize:e}=t;if(e&&(_e.value=A.value?.$el?.offsetWidth),!v.value||typeof e==`boolean`)return;let{paddingTop:n,paddingBottom:r,lineHeight:i}=window.getComputedStyle(v.value),a=Number(n.slice(0,-2)),o=Number(r.slice(0,-2)),s=Number(i.slice(0,-2)),{value:c}=b;if(!c)return;if(e.minRows){let t=Math.max(e.minRows,1),n=`${a+o+s*t}px`;c.style.minHeight=n}if(e.maxRows){let t=`${a+o+s*e.maxRows}px`;c.style.maxHeight=t}}},ye=e(()=>{let{maxlength:e}=t;return e===void 0?void 0:Number(e)});o(()=>{let{value:e}=N;Array.isArray(e)||nt(e)});let be=r().proxy;function Y(e,n){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=t,{nTriggerFormInput:o}=P;r&&D(r,e,n),i&&D(i,e,n),a&&D(a,e,n),M.value=e,o()}function X(e,n){let{onChange:r}=t,{nTriggerFormChange:i}=P;r&&D(r,e,n),M.value=e,i()}function xe(e){let{onBlur:n}=t,{nTriggerFormBlur:r}=P;n&&D(n,e),r()}function Se(e){let{onFocus:n}=t,{nTriggerFormFocus:r}=P;n&&D(n,e),r()}function Ce(e){let{onClear:n}=t;n&&D(n,e)}function we(e){let{onInputBlur:n}=t;n&&D(n,e)}function Te(e){let{onInputFocus:n}=t;n&&D(n,e)}function Ee(){let{onDeactivate:e}=t;e&&D(e)}function De(){let{onActivate:e}=t;e&&D(e)}function Oe(e){let{onClick:n}=t;n&&D(n,e)}function ke(e){let{onWrapperFocus:n}=t;n&&D(n,e)}function Ae(e){let{onWrapperBlur:n}=t;n&&D(n,e)}function je(){B.value=!0}function Me(e){B.value=!1,e.target===E.value?Z(e,1):Z(e,0)}function Z(e,n=0,r=`input`){let i=e.target.value;if(nt(i),e instanceof InputEvent&&!e.isComposing&&(B.value=!1),t.type===`textarea`){let{value:e}=A;e&&e.syncUnifiedContainer()}if(G=i,B.value)return;k.recordCursor();let o=Ne(i);if(o)if(!t.pair)r===`input`?Y(i,{source:n}):X(i,{source:n});else{let{value:e}=N;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[n]=i,r===`input`?Y(e,{source:n}):X(e,{source:n})}be.$forceUpdate(),o||a(k.restoreCursor)}function Ne(e){let{countGraphemes:n,maxlength:r,minlength:i}=t;if(n){let t;if(r!==void 0&&(t===void 0&&(t=n(e)),t>Number(r))||i!==void 0&&(t===void 0&&(t=n(e)),t<Number(r)))return!1}let{allowInput:a}=t;return typeof a==`function`?a(e):!0}function Pe(e){we(e),e.relatedTarget===_.value&&Ee(),e.relatedTarget!==null&&(e.relatedTarget===T.value||e.relatedTarget===E.value||e.relatedTarget===v.value)||(U.value=!1),Q(e,`blur`),O.value=null}function Fe(e,t){Te(e),R.value=!0,U.value=!0,De(),Q(e,`focus`),t===0?O.value=T.value:t===1?O.value=E.value:t===2&&(O.value=v.value)}function Ie(e){t.passivelyActivated&&(Ae(e),Q(e,`blur`))}function Le(e){t.passivelyActivated&&(R.value=!0,ke(e),Q(e,`focus`))}function Q(e,t){e.relatedTarget!==null&&(e.relatedTarget===T.value||e.relatedTarget===E.value||e.relatedTarget===v.value||e.relatedTarget===_.value)||(t===`focus`?(Se(e),R.value=!0):t===`blur`&&(xe(e),R.value=!1))}function Re(e,t){Z(e,t,`change`)}function ze(e){Oe(e)}function Be(e){Ce(e),Ve()}function Ve(){t.pair?(Y([``,``],{source:`clear`}),X([``,``],{source:`clear`})):(Y(``,{source:`clear`}),X(``,{source:`clear`}))}function He(e){let{onMousedown:n}=t;n&&n(e);let{tagName:r}=e.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(t.resizable){let{value:t}=_;if(t){let{left:n,top:r,width:i,height:a}=t.getBoundingClientRect();if(n+i-14<e.clientX&&e.clientX<n+i&&r+a-14<e.clientY&&e.clientY<r+a)return}}e.preventDefault(),R.value||Xe()}}function Ue(){var e;z.value=!0,t.type===`textarea`&&((e=A.value)==null||e.handleMouseEnterWrapper())}function We(){var e;z.value=!1,t.type===`textarea`&&((e=A.value)==null||e.handleMouseLeaveWrapper())}function Ge(){I.value||he.value===`click`&&(J.value=!J.value)}function Ke(e){if(I.value)return;e.preventDefault();let t=e=>{e.preventDefault(),ae(`mouseup`,document,t)};if(ie(`mouseup`,document,t),he.value!==`mousedown`)return;J.value=!0;let n=()=>{J.value=!1,ae(`mouseup`,document,n)};ie(`mouseup`,document,n)}function qe(e){t.onKeyup&&D(t.onKeyup,e)}function Je(e){switch(t.onKeydown&&D(t.onKeydown,e),e.key){case`Escape`:$();break;case`Enter`:Ye(e);break}}function Ye(e){var n,r;if(t.passivelyActivated){let{value:i}=U;if(i){t.internalDeactivateOnEnter&&$();return}e.preventDefault(),t.type===`textarea`?(n=v.value)==null||n.focus():(r=T.value)==null||r.focus()}}function $(){t.passivelyActivated&&(U.value=!1,a(()=>{var e;(e=_.value)==null||e.focus()}))}function Xe(){var e,n,r;I.value||(t.passivelyActivated?(e=_.value)==null||e.focus():((n=v.value)==null||n.focus(),(r=T.value)==null||r.focus()))}function Ze(){_.value?.contains(document.activeElement)&&document.activeElement.blur()}function Qe(){var e,t;(e=v.value)==null||e.select(),(t=T.value)==null||t.select()}function $e(){I.value||(v.value?v.value.focus():T.value&&T.value.focus())}function et(){let{value:e}=_;e?.contains(document.activeElement)&&e!==document.activeElement&&$()}function tt(e){if(t.type===`textarea`){let{value:t}=v;t?.scrollTo(e)}else{let{value:t}=T;t?.scrollTo(e)}}function nt(e){let{type:n,pair:r,autosize:i}=t;if(!r&&i)if(n===`textarea`){let{value:t}=b;t&&(t.textContent=`${e??``}\r\n`)}else{let{value:t}=w;t&&(e?t.textContent=e:t.innerHTML=` `)}}function rt(){ve()}let it=l({top:`0`});function at(e){var t;let{scrollTop:n}=e.target;it.value.top=`${-n}px`,(t=A.value)==null||t.syncUnifiedContainer()}let ot=null;c(()=>{let{autosize:e,type:n}=t;e&&n===`textarea`?ot=s(N,e=>{!Array.isArray(e)&&e!==G&&nt(e)}):ot?.()});let st=null;c(()=>{t.type===`textarea`?st=s(N,e=>{var t;!Array.isArray(e)&&e!==G&&((t=A.value)==null||t.syncUnifiedContainer())}):st?.()}),n(H,{mergedValueRef:N,maxlengthRef:ye,mergedClsPrefixRef:i,countGraphemesRef:u(t,`countGraphemes`)});let ct={wrapperElRef:_,inputElRef:T,textareaElRef:v,isCompositing:B,clear:Ve,focus:Xe,blur:Ze,select:Qe,deactivate:et,activate:$e,scrollTo:tt},lt=te(`Input`,p,i),ut=e(()=>{let{value:e}=F,{common:{cubicBezierEaseInOut:t},self:{color:n,borderRadius:r,textColor:i,caretColor:a,caretColorError:o,caretColorWarning:s,textDecorationColor:c,border:l,borderDisabled:u,borderHover:d,borderFocus:f,placeholderColor:ee,placeholderColorDisabled:p,lineHeightTextarea:m,colorDisabled:g,colorFocus:_,textColorDisabled:v,boxShadowFocus:y,iconSize:b,colorFocusWarning:te,boxShadowFocusWarning:S,borderWarning:C,borderFocusWarning:w,borderHoverWarning:T,colorFocusError:E,boxShadowFocusError:D,borderError:O,borderFocusError:ne,borderHoverError:k,clearSize:A,clearColor:j,clearColorHover:re,clearColorPressed:ie,iconColor:ae,iconColorDisabled:oe,suffixTextColor:M,countTextColor:N,countTextColorDisabled:se,iconColorHover:P,iconColorPressed:I,loadingColor:L,loadingColorError:R,loadingColorWarning:z,fontWeight:B,[x(`padding`,e)]:V,[x(`fontSize`,e)]:H,[x(`height`,e)]:le}}=h.value,{left:ue,right:U}=ce(V);return{"--n-bezier":t,"--n-count-text-color":N,"--n-count-text-color-disabled":se,"--n-color":n,"--n-font-size":H,"--n-font-weight":B,"--n-border-radius":r,"--n-height":le,"--n-padding-left":ue,"--n-padding-right":U,"--n-text-color":i,"--n-caret-color":a,"--n-text-decoration-color":c,"--n-border":l,"--n-border-disabled":u,"--n-border-hover":d,"--n-border-focus":f,"--n-placeholder-color":ee,"--n-placeholder-color-disabled":p,"--n-icon-size":b,"--n-line-height-textarea":m,"--n-color-disabled":g,"--n-color-focus":_,"--n-text-color-disabled":v,"--n-box-shadow-focus":y,"--n-loading-color":L,"--n-caret-color-warning":s,"--n-color-focus-warning":te,"--n-box-shadow-focus-warning":S,"--n-border-warning":C,"--n-border-focus-warning":w,"--n-border-hover-warning":T,"--n-loading-color-warning":z,"--n-caret-color-error":o,"--n-color-focus-error":E,"--n-box-shadow-focus-error":D,"--n-border-error":O,"--n-border-focus-error":ne,"--n-border-hover-error":k,"--n-loading-color-error":R,"--n-clear-color":j,"--n-clear-size":A,"--n-clear-color-hover":re,"--n-clear-color-pressed":ie,"--n-icon-color":ae,"--n-icon-color-hover":P,"--n-icon-color-pressed":I,"--n-icon-color-disabled":oe,"--n-suffix-text-color":M}}),dt=f?j(`input`,e(()=>{let{value:e}=F;return e[0]}),ut,t):void 0;return Object.assign(Object.assign({},ct),{wrapperElRef:_,inputElRef:T,inputMirrorElRef:w,inputEl2Ref:E,textareaElRef:v,textareaMirrorElRef:b,textareaScrollbarInstRef:A,rtlEnabled:lt,uncontrolledValue:M,mergedValue:N,passwordVisible:J,mergedPlaceholder:K,showPlaceholder1:fe,showPlaceholder2:pe,mergedFocus:q,isComposing:B,activated:U,showClearButton:me,mergedSize:F,mergedDisabled:I,textDecorationStyle:ge,mergedClsPrefix:i,mergedBordered:d,mergedShowPasswordOn:he,placeholderStyle:it,mergedStatus:L,textAreaScrollContainerWidth:_e,handleTextAreaScroll:at,handleCompositionStart:je,handleCompositionEnd:Me,handleInput:Z,handleInputBlur:Pe,handleInputFocus:Fe,handleWrapperBlur:Ie,handleWrapperFocus:Le,handleMouseEnter:Ue,handleMouseLeave:We,handleMouseDown:He,handleChange:Re,handleClick:ze,handleClear:Be,handlePasswordToggleClick:Ge,handlePasswordToggleMousedown:Ke,handleWrapperKeydown:Je,handleWrapperKeyup:qe,handleTextAreaMirrorResize:rt,getTextareaScrollContainer:()=>v.value,mergedTheme:h,cssVars:f?void 0:ut,themeClass:dt?.themeClass,onRender:dt?.onRender})},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:n,type:r,countGraphemes:a,onRender:o}=this,s=this.$slots;return o?.(),i(`div`,{ref:`wrapperElRef`,class:[`${e}-input`,`${e}-input--${this.mergedSize}-size`,n,t&&`${e}-input--${t}-status`,{[`${e}-input--rtl`]:this.rtlEnabled,[`${e}-input--disabled`]:this.mergedDisabled,[`${e}-input--textarea`]:r===`textarea`,[`${e}-input--resizable`]:this.resizable&&!this.autosize,[`${e}-input--autosize`]:this.autosize,[`${e}-input--round`]:this.round&&r!==`textarea`,[`${e}-input--pair`]:this.pair,[`${e}-input--focus`]:this.mergedFocus,[`${e}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},i(`div`,{class:`${e}-input-wrapper`},m(s.prefix,t=>t&&i(`div`,{class:`${e}-input__prefix`},t)),r===`textarea`?i(P,{ref:`textareaScrollbarInstRef`,class:`${e}-input__textarea`,container:this.getTextareaScrollContainer,theme:this.theme?.peers?.Scrollbar,themeOverrides:this.themeOverrides?.peers?.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{let{textAreaScrollContainerWidth:t}=this,n={width:this.autosize&&t&&`${t}px`};return i(f,null,i(`textarea`,Object.assign({},this.inputProps,{ref:`textareaElRef`,class:[`${e}-input__textarea-el`,this.inputProps?.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],this.inputProps?.style,n],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?i(`div`,{class:`${e}-input__placeholder`,style:[this.placeholderStyle,n],key:`placeholder`},this.mergedPlaceholder[0]):null,this.autosize?i(re,{onResize:this.handleTextAreaMirrorResize},{default:()=>i(`div`,{ref:`textareaMirrorElRef`,class:`${e}-input__textarea-mirror`,key:`mirror`})}):null)}}):i(`div`,{class:`${e}-input__input`},i(`input`,Object.assign({type:r===`password`&&this.mergedShowPasswordOn&&this.passwordVisible?`text`:r},this.inputProps,{ref:`inputElRef`,class:[`${e}-input__input-el`,this.inputProps?.class],style:[this.textDecorationStyle[0],this.inputProps?.style],tabindex:this.passivelyActivated&&!this.activated?-1:this.inputProps?.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}})),this.showPlaceholder1?i(`div`,{class:`${e}-input__placeholder`},i(`span`,null,this.mergedPlaceholder[0])):null,this.autosize?i(`div`,{class:`${e}-input__input-mirror`,key:`mirror`,ref:`inputMirrorElRef`},`\xA0`):null),!this.pair&&m(s.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?i(`div`,{class:`${e}-input__suffix`},[m(s[`clear-icon-placeholder`],t=>(this.clearable||t)&&i(F,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>t,icon:()=>{var e;return(e=this.$slots)[`clear-icon`]?.call(e)}})),this.internalLoadingBeforeSuffix?null:t,this.loading===void 0?null:i(I,{clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?i(G,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null,this.mergedShowPasswordOn&&this.type===`password`?i(`div`,{class:`${e}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?_(s[`password-visible-icon`],()=>[i(M,{clsPrefix:e},{default:()=>i(L,null)})]):_(s[`password-invisible-icon`],()=>[i(M,{clsPrefix:e},{default:()=>i(R,null)})])):null]):null)),this.pair?i(`span`,{class:`${e}-input__separator`},_(s.separator,()=>[this.separator])):null,this.pair?i(`div`,{class:`${e}-input-wrapper`},i(`div`,{class:`${e}-input__input`},i(`input`,{ref:`inputEl2Ref`,type:this.type,class:`${e}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}}),this.showPlaceholder2?i(`div`,{class:`${e}-input__placeholder`},i(`span`,null,this.mergedPlaceholder[1])):null),m(s.suffix,t=>(this.clearable||t)&&i(`div`,{class:`${e}-input__suffix`},[this.clearable&&i(F,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>s[`clear-icon`]?.call(s),placeholder:()=>s[`clear-icon-placeholder`]?.call(s)}),t]))):null,this.mergedBordered?i(`div`,{class:`${e}-input__border`}):null,this.mergedBordered?i(`div`,{class:`${e}-input__state-border`}):null,this.showCount&&r===`textarea`?i(G,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null)}});export{V as n,K as t};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{C as e,N as t,R as n,X as r,ct as i,dt as a,j as o}from"./router-COwpqexM.js";import{B as s,K as c,R as ee,W as l,at as u,c as d,d as te,et as f,n as p,ot as m,q as h,rt as ne,s as g}from"./browser-DzAOCZtm.js";import{g as _,m as re,o as v,s as ie}from"./Scrollbar-Bg2FeTtI.js";import{n as y,r as b}from"./Button-zECKCotA.js";import{n as x,t as S}from"./Input-DxJk6pT-.js";var C=o({name:`Add`,render(){return t(`svg`,{width:`512`,height:`512`,viewBox:`0 0 512 512`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},t(`path`,{d:`M256 112V400M400 256H112`,stroke:`currentColor`,"stroke-width":`32`,"stroke-linecap":`round`,"stroke-linejoin":`round`}))}}),w=o({name:`Remove`,render(){return t(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},t(`line`,{x1:`400`,y1:`256`,x2:`112`,y2:`256`,style:`
|
|
2
|
-
fill: none;
|
|
3
|
-
stroke: currentColor;
|
|
4
|
-
stroke-linecap: round;
|
|
5
|
-
stroke-linejoin: round;
|
|
6
|
-
stroke-width: 32px;
|
|
7
|
-
`}))}});function T(e){let{textColorDisabled:t}=e;return{iconColorDisabled:t}}var ae=g({name:`InputNumber`,common:p,peers:{Button:b,Input:x},self:T}),oe=u([m(`input-number-suffix`,`
|
|
8
|
-
display: inline-block;
|
|
9
|
-
margin-right: 10px;
|
|
10
|
-
`),m(`input-number-prefix`,`
|
|
11
|
-
display: inline-block;
|
|
12
|
-
margin-left: 10px;
|
|
13
|
-
`)]);function se(e){return e==null||typeof e==`string`&&e.trim()===``?null:Number(e)}function E(e){return e.includes(`.`)&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e===`-`||e===`-0`}function D(e){return e==null?!0:!Number.isNaN(e)}function O(e,t){return typeof e==`number`?t===void 0?String(e):e.toFixed(t):``}function k(e){if(e===null)return null;if(typeof e==`number`)return e;{let t=Number(e);return Number.isNaN(t)?null:t}}var A=800,j=100,M=o({name:`InputNumber`,props:Object.assign(Object.assign({},d.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:`right`},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),slots:Object,setup(t){let{mergedBorderedRef:o,mergedClsPrefixRef:c,mergedRtlRef:l,mergedComponentPropsRef:u}=s(t),p=d(`InputNumber`,`-input-number`,oe,ae,t,c),{localeRef:m}=ie(`InputNumber`),g=ee(t,{mergedSize:e=>{let{size:n}=t;if(n)return n;let{mergedSize:r}=e||{};return r?.value?r.value:u?.value?.InputNumber?.size||`medium`}}),{mergedSizeRef:v,mergedDisabledRef:y,mergedStatusRef:b}=g,x=i(null),S=i(null),C=i(null),w=i(t.defaultValue),T=re(a(t,`value`),w),M=i(``),N=e=>{let t=String(e).split(`.`)[1];return t?t.length:0},P=e=>{let n=[t.min,t.max,t.step,e].map(e=>e===void 0?0:N(e));return Math.max(...n)},ce=f(()=>{let{placeholder:e}=t;return e===void 0?m.value.placeholder:e}),F=f(()=>{let e=k(t.step);return e===null||e===0?1:Math.abs(e)}),I=f(()=>{let e=k(t.min);return e===null?null:e}),L=f(()=>{let e=k(t.max);return e===null?null:e}),R=()=>{let{value:e}=T;if(D(e)){let{format:n,precision:r}=t;n?M.value=n(e):e===null||r===void 0||N(e)>r?M.value=O(e,void 0):M.value=O(e,r)}else M.value=String(e)};R();let z=e=>{let{value:n}=T;if(e===n){R();return}let{"onUpdate:value":r,onUpdateValue:i,onChange:a}=t,{nTriggerFormInput:o,nTriggerFormChange:s}=g;a&&h(a,e),i&&h(i,e),r&&h(r,e),w.value=e,o(),s()},B=({offset:e,doUpdateIfValid:n,fixPrecision:r,isInputing:i})=>{let{value:a}=M;if(i&&E(a))return!1;let o=(t.parse||se)(a);if(o===null)return n&&z(null),null;if(D(o)){let a=N(o),{precision:s}=t;if(s!==void 0&&s<a&&!r)return!1;let c=Number.parseFloat((o+e).toFixed(s??P(o)));if(D(c)){let{value:e}=L,{value:r}=I;if(e!==null&&c>e){if(!n||i)return!1;c=e}if(r!==null&&c<r){if(!n||i)return!1;c=r}return t.validator&&!t.validator(c)?!1:(n&&z(c),c)}}return!1},le=f(()=>B({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),V=f(()=>{let{value:e}=T;if(t.validator&&e===null)return!1;let{value:n}=F;return B({offset:-n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),H=f(()=>{let{value:e}=T;if(t.validator&&e===null)return!1;let{value:n}=F;return B({offset:+n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function U(e){let{onFocus:n}=t,{nTriggerFormFocus:r}=g;n&&h(n,e),r()}function ue(e){if(e.target===x.value?.wrapperElRef)return;let r=B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(r!==!1){let e=x.value?.inputElRef;e&&(e.value=String(r||``)),T.value===r&&R()}else R();let{onBlur:i}=t,{nTriggerFormBlur:a}=g;i&&h(i,e),a(),n(()=>{R()})}function de(e){let{onClear:n}=t;n&&h(n,e)}function W(){let{value:e}=H;if(!e){Q();return}let{value:n}=T;if(n===null)t.validator||z(K());else{let{value:e}=F;B({offset:e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function G(){let{value:e}=V;if(!e){X();return}let{value:n}=T;if(n===null)t.validator||z(K());else{let{value:e}=F;B({offset:-e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}let fe=U,pe=ue;function K(){if(t.validator)return null;let{value:e}=I,{value:n}=L;return e===null?n===null?0:Math.min(0,n):Math.max(0,e)}function me(e){de(e),z(null)}function he(e){var t;C.value?.$el.contains(e.target)&&e.preventDefault(),S.value?.$el.contains(e.target)&&e.preventDefault(),(t=x.value)==null||t.activate()}let q=null,J=null,Y=null;function X(){Y&&=(window.clearTimeout(Y),null),q&&=(window.clearInterval(q),null)}let Z=null;function Q(){Z&&=(window.clearTimeout(Z),null),J&&=(window.clearInterval(J),null)}function $(){X(),Y=window.setTimeout(()=>{q=window.setInterval(()=>{G()},j)},A),_(`mouseup`,document,X,{once:!0})}function ge(){Q(),Z=window.setTimeout(()=>{J=window.setInterval(()=>{W()},j)},A),_(`mouseup`,document,Q,{once:!0})}let _e=()=>{J||W()},ve=()=>{q||G()};function ye(e){var n;if(e.key===`Enter`){if(e.target===x.value?.wrapperElRef)return;B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((n=x.value)==null||n.deactivate())}else if(e.key===`ArrowUp`){if(!H.value||t.keyboard.ArrowUp===!1)return;e.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&W()}else if(e.key===`ArrowDown`){if(!V.value||t.keyboard.ArrowDown===!1)return;e.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&G()}}function be(e){M.value=e,t.updateValueOnInput&&!t.format&&!t.parse&&t.precision===void 0&&B({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}r(T,()=>{R()});let xe={focus:()=>x.value?.focus(),blur:()=>x.value?.blur(),select:()=>x.value?.select()},Se=te(`InputNumber`,l,c);return Object.assign(Object.assign({},xe),{rtlEnabled:Se,inputInstRef:x,minusButtonInstRef:S,addButtonInstRef:C,mergedClsPrefix:c,mergedBordered:o,uncontrolledValue:w,mergedValue:T,mergedPlaceholder:ce,displayedValueInvalid:le,mergedSize:v,mergedDisabled:y,displayedValue:M,addable:H,minusable:V,mergedStatus:b,handleFocus:fe,handleBlur:pe,handleClear:me,handleMouseDown:he,handleAddClick:_e,handleMinusClick:ve,handleAddMousedown:ge,handleMinusMousedown:$,handleKeyDown:ye,handleUpdateDisplayedValue:be,mergedTheme:p,inputThemeOverrides:{paddingSmall:`0 8px 0 10px`,paddingMedium:`0 8px 0 12px`,paddingLarge:`0 8px 0 14px`},buttonThemeOverrides:e(()=>{let{self:{iconColorDisabled:e}}=p.value,[t,n,r,i]=ne(e);return{textColorTextDisabled:`rgb(${t}, ${n}, ${r})`,opacityDisabled:`${i}`}})})},render(){let{mergedClsPrefix:e,$slots:n}=this,r=()=>t(y,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:`minusButtonInstRef`},{icon:()=>l(n[`minus-icon`],()=>[t(v,{clsPrefix:e},{default:()=>t(w,null)})])}),i=()=>t(y,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:`addButtonInstRef`},{icon:()=>l(n[`add-icon`],()=>[t(v,{clsPrefix:e},{default:()=>t(C,null)})])});return t(`div`,{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},t(S,{ref:`inputInstRef`,autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?`line-through`:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>this.showButton&&this.buttonPlacement===`both`?[r(),c(n.prefix,n=>n?t(`span`,{class:`${e}-input-number-prefix`},n):null)]:n.prefix?.call(n),suffix:()=>this.showButton?[c(n.suffix,n=>n?t(`span`,{class:`${e}-input-number-suffix`},n):null),this.buttonPlacement===`right`?r():null,i()]:n.suffix?.call(n)}))}});export{C as n,M as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.memory-view[data-v-f871a6dd]{height:calc(100 * var(--vh));flex-direction:column;display:flex}.memory-content[data-v-f871a6dd]{flex-direction:column;flex:1;padding:20px;display:flex;overflow:hidden}.memory-loading[data-v-f871a6dd]{color:#999;flex:1;justify-content:center;align-items:center;font-size:13px;display:flex}.memory-sections[data-v-f871a6dd]{flex:1;gap:16px;min-height:0;display:flex}@media (width<=768px){.memory-sections[data-v-f871a6dd]{flex-direction:column}}.memory-section[data-v-f871a6dd]{border:1px solid #e0e0e0;border-radius:10px;flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.section-header[data-v-f871a6dd]{background:#f0f0f0;border-bottom:1px solid #e0e0e0;flex-shrink:0;justify-content:space-between;align-items:center;padding:10px 16px;display:flex}.section-title-row[data-v-f871a6dd]{align-items:center;gap:8px;display:flex}.section-icon[data-v-f871a6dd]{color:#666;display:flex}.section-title[data-v-f871a6dd]{color:#1a1a1a;font-size:14px;font-weight:600}.section-mtime[data-v-f871a6dd]{color:#999;font-size:11px}.section-body[data-v-f871a6dd]{flex:1;min-height:0;padding:16px;overflow-y:auto}.empty-text[data-v-f871a6dd]{color:#999;font-size:13px;font-style:italic}.section-edit[data-v-f871a6dd]{flex-direction:column;flex:1;min-height:0;padding:12px 16px;display:flex}.edit-textarea[data-v-f871a6dd]{color:#1a1a1a;resize:none;background:#fff;border:1px solid #e0e0e0;border-radius:6px;outline:none;flex:1;width:100%;min-height:0;padding:12px;font-family:JetBrains Mono,Fira Code,Consolas,monospace;font-size:13px;line-height:1.6}.edit-textarea[data-v-f871a6dd]:focus{border-color:#333}.edit-actions[data-v-f871a6dd]{justify-content:flex-end;gap:8px;margin-top:10px;display:flex}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{$ as e,A as t,C as n,D as r,E as i,G as a,O as o,Q as s,T as c,U as l,ct as u,gt as d,j as f,k as p,m,pt as h,w as g}from"./router-COwpqexM.js";import{r as _,t as v}from"./_plugin-vue_export-helper-BkT4A29V.js";import{t as y}from"./Button-zECKCotA.js";import{t as b}from"./use-message-g8F4Z57w.js";import{t as x}from"./MarkdownRenderer-BA3oPVqT.js";import{a as ee,t as te}from"./skills-CRtljpt6.js";var S={class:`memory-view`},C={class:`page-header`},w={class:`header-title`},ne={class:`memory-content`},re={key:0,class:`memory-loading`},ie={key:1,class:`memory-sections`},ae={class:`memory-section`},T={class:`section-header`},E={class:`section-title-row`},D={class:`section-title`},O={key:0,class:`section-mtime`},k={key:0,class:`section-body`},A={key:1,class:`empty-text`},j={key:1,class:`section-edit`},M=[`placeholder`],N={class:`edit-actions`},P={class:`memory-section`},F={class:`section-header`},I={class:`section-title-row`},L={class:`section-title`},R={key:0,class:`section-mtime`},z={key:0,class:`section-body`},oe={key:1,class:`empty-text`},B={key:1,class:`section-edit`},V=[`placeholder`],H={class:`edit-actions`},U=v(f({__name:`MemoryView`,setup(f){let{t:v}=_(),U=b(),W=u(!1),G=u(null),K=u(null),q=u(``),J=u(!1);l(Y);async function Y(){W.value=!0;try{G.value=await te()}catch(e){console.error(`Failed to load memory:`,e),U.error(v(`memory.loadFailed`))}finally{W.value=!1}}function X(e){K.value=e,q.value=G.value?.[e]||``}function Z(){K.value=null,q.value=``}async function Q(){if(K.value){J.value=!0;try{await ee(K.value,q.value),await Y(),K.value=null,q.value=``,U.success(v(`common.saved`))}catch(e){U.error(`${v(`common.saveFailed`)}: ${e.message}`)}finally{J.value=!1}}}function $(e){return e?new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``}let se=n(()=>!G.value?.memory?.trim()),ce=n(()=>!G.value?.user?.trim()),le=n(()=>(G.value?.memory||``).replace(/§/g,`
|
|
2
|
-
|
|
3
|
-
`)),ue=n(()=>(G.value?.user||``).replace(/§/g,`
|
|
4
|
-
|
|
5
|
-
`));return(n,l)=>(a(),r(`div`,S,[g(`header`,C,[g(`h2`,w,d(h(v)(`memory.title`)),1),t(h(y),{size:`small`,quaternary:``,onClick:Y},{icon:s(()=>[...l[4]||=[g(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[g(`polyline`,{points:`23 4 23 10 17 10`}),g(`path`,{d:`M20.49 15a9 9 0 1 1-2.12-9.36L23 10`})],-1)]]),default:s(()=>[p(` `+d(h(v)(`memory.refresh`)),1)]),_:1})]),g(`div`,ne,[W.value&&!G.value?(a(),r(`div`,re,d(h(v)(`common.loading`)),1)):(a(),r(`div`,ie,[g(`div`,ae,[g(`div`,T,[g(`div`,E,[l[5]||=o(`<span class="section-icon" data-v-f871a6dd><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-v-f871a6dd><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-f871a6dd></path><polyline points="14 2 14 8 20 8" data-v-f871a6dd></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-f871a6dd></line><line x1="16" y1="17" x2="8" y2="17" data-v-f871a6dd></line></svg></span>`,1),g(`span`,D,d(h(v)(`memory.myNotes`)),1),G.value?.memory_mtime?(a(),r(`span`,O,d($(G.value.memory_mtime)),1)):i(``,!0)]),K.value===`memory`?i(``,!0):(a(),c(h(y),{key:0,size:`tiny`,quaternary:``,onClick:l[0]||=e=>X(`memory`)},{icon:s(()=>[...l[6]||=[g(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[g(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),g(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})],-1)]]),default:s(()=>[p(` `+d(h(v)(`common.edit`)),1)]),_:1}))]),K.value===`memory`?(a(),r(`div`,j,[e(g(`textarea`,{"onUpdate:modelValue":l[1]||=e=>q.value=e,class:`edit-textarea`,placeholder:h(v)(`memory.notesPlaceholder`),spellcheck:`false`},null,8,M),[[m,q.value]]),g(`div`,N,[t(h(y),{size:`small`,onClick:Z},{default:s(()=>[p(d(h(v)(`common.cancel`)),1)]),_:1}),t(h(y),{size:`small`,type:`primary`,loading:J.value,onClick:Q},{default:s(()=>[p(d(h(v)(`common.save`)),1)]),_:1},8,[`loading`])])])):(a(),r(`div`,k,[se.value?(a(),r(`p`,A,d(h(v)(`memory.noNotes`)),1)):(a(),c(x,{key:0,content:le.value},null,8,[`content`]))]))]),g(`div`,P,[g(`div`,F,[g(`div`,I,[l[7]||=g(`span`,{class:`section-icon`},[g(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[g(`path`,{d:`M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2`}),g(`circle`,{cx:`12`,cy:`7`,r:`4`})])],-1),g(`span`,L,d(h(v)(`memory.userProfile`)),1),G.value?.user_mtime?(a(),r(`span`,R,d($(G.value.user_mtime)),1)):i(``,!0)]),K.value===`user`?i(``,!0):(a(),c(h(y),{key:0,size:`tiny`,quaternary:``,onClick:l[2]||=e=>X(`user`)},{icon:s(()=>[...l[8]||=[g(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[g(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),g(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})],-1)]]),default:s(()=>[p(` `+d(h(v)(`common.edit`)),1)]),_:1}))]),K.value===`user`?(a(),r(`div`,B,[e(g(`textarea`,{"onUpdate:modelValue":l[3]||=e=>q.value=e,class:`edit-textarea`,placeholder:h(v)(`memory.profilePlaceholder`),spellcheck:`false`},null,8,V),[[m,q.value]]),g(`div`,H,[t(h(y),{size:`small`,onClick:Z},{default:s(()=>[p(d(h(v)(`common.cancel`)),1)]),_:1}),t(h(y),{size:`small`,type:`primary`,loading:J.value,onClick:Q},{default:s(()=>[p(d(h(v)(`common.save`)),1)]),_:1},8,[`loading`])])])):(a(),r(`div`,z,[ce.value?(a(),r(`p`,oe,d(h(v)(`memory.noProfile`)),1)):(a(),c(x,{key:0,content:ue.value},null,8,[`content`]))]))])]))])]))}}),[[`__scopeId`,`data-v-f871a6dd`]]);export{U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,F as i,G as a,Q as o,T as s,U as c,X as l,ct as u,gt as d,j as f,k as p,mt as m,pt as h,q as g,w as _,y as v}from"./router-COwpqexM.js";import{n as y}from"./pinia-bPUFQqFK.js";import{r as b,t as x}from"./_plugin-vue_export-helper-BkT4A29V.js";import{J as S}from"./browser-DzAOCZtm.js";import{a as C,t as w}from"./Modal-WQKdvHJY.js";import{n as ee,t as T}from"./FormItem-CZ9auYA2.js";import{t as E}from"./Select-C_hKaXgI.js";import{t as D}from"./Button-zECKCotA.js";import{t as O}from"./Input-DxJk6pT-.js";import{t as k}from"./use-message-g8F4Z57w.js";import{t as A}from"./Spin-lybeIDeX.js";import{a as j,i as M,n as N,r as P,t as F}from"./app-BUjbfMSg.js";function I(){let e=i(C,null);return e===null&&S(`use-dialog`,`No outer <n-dialog-provider /> founded.`),e}var L=y(`models`,()=>{let e=u([]),n=u(``),r=u(!1),i=t(()=>e.value.filter(e=>e.provider.startsWith(`custom:`))),a=t(()=>e.value.filter(e=>!e.provider.startsWith(`custom:`))),o=t(()=>e.value.flatMap(e=>e.models.map(t=>({id:t,provider:e.provider,label:e.label,base_url:e.base_url,isDefault:t===n.value}))));async function s(){r.value=!0;try{let t=await P();e.value=t.groups,n.value=t.default}catch(e){console.error(`Failed to fetch providers:`,e)}finally{r.value=!1}}async function c(e,t){await j({default:e,provider:t}),n.value=e,F().loadModels()}async function l(e){await N(e),await s(),F().loadModels()}async function d(e){await M(e),await s(),F().loadModels()}return{providers:e,defaultModel:n,loading:r,customProviders:i,builtinProviders:a,allModels:o,fetchProviders:s,setDefaultModel:c,addProvider:l,removeProvider:d}}),R={class:`provider-card`},z={class:`card-header`},B={class:`provider-name`},V={class:`card-body`},H={class:`info-row`},U={class:`info-label`},W={class:`info-value mono`},G={class:`info-row`},K={class:`info-label`},q={class:`info-value mono`},J={class:`card-actions`},Y=x(f({__name:`ProviderCard`,props:{provider:{}},setup(r){let i=r,{t:s}=b(),c=L(),l=k(),u=I(),f=t(()=>i.provider.provider.startsWith(`custom:`)),g=t(()=>i.provider.label);async function v(){u.warning({title:s(`models.deleteProvider`),content:s(`models.deleteConfirm`,{name:g.value}),positiveText:s(`common.delete`),negativeText:s(`common.cancel`),onPositiveClick:async()=>{try{await c.removeProvider(i.provider.provider),l.success(s(`models.providerDeleted`))}catch(e){l.error(e.message)}}})}return(t,i)=>(a(),n(`div`,R,[_(`div`,z,[_(`h3`,B,d(g.value),1),_(`span`,{class:m([`type-badge`,f.value?`custom`:`builtin`])},d(f.value?h(s)(`models.customType`):h(s)(`models.builtIn`)),3)]),_(`div`,V,[_(`div`,H,[_(`span`,U,d(h(s)(`models.provider`)),1),_(`code`,W,d(r.provider.provider),1)]),_(`div`,G,[_(`span`,K,d(h(s)(`models.baseUrl`)),1),_(`code`,q,d(r.provider.base_url),1)])]),_(`div`,J,[e(h(D),{size:`tiny`,quaternary:``,type:`error`,onClick:v},{default:o(()=>[p(d(h(s)(`common.delete`)),1)]),_:1})])]))}}),[[`__scopeId`,`data-v-bd3d787c`]]),X={key:0,class:`empty-state`},Z={key:1,class:`providers-grid`},Q=x(f({__name:`ProvidersPanel`,setup(e){let{t}=b(),r=L();return(e,i)=>h(r).providers.length===0?(a(),n(`div`,X,[i[0]||=_(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,class:`empty-icon`},[_(`path`,{d:`M12 2L2 7l10 5 10-5-10-5z`}),_(`path`,{d:`M2 17l10 5 10-5`}),_(`path`,{d:`M2 12l10 5 10-5`})],-1),_(`p`,null,d(h(t)(`models.noProviders`)),1)])):(a(),n(`div`,Z,[(a(!0),n(v,null,g(h(r).providers,e=>(a(),s(Y,{key:e.provider,provider:e},null,8,[`provider`]))),128))]))}}),[[`__scopeId`,`data-v-76eec30b`]]),$=[{label:`Anthropic`,value:`anthropic`,base_url:`https://api.anthropic.com`,models:[`claude-opus-4-6`,`claude-sonnet-4-6`,`claude-opus-4-5-20251101`,`claude-sonnet-4-5-20250929`,`claude-opus-4-20250514`,`claude-sonnet-4-20250514`,`claude-haiku-4-5-20251001`]},{label:`Google AI Studio`,value:`gemini`,base_url:`https://generativelanguage.googleapis.com/v1beta/openai`,models:[`gemini-3.1-pro-preview`,`gemini-3-flash-preview`,`gemini-3.1-flash-lite-preview`,`gemini-2.5-pro`,`gemini-2.5-flash`,`gemini-2.5-flash-lite`,`gemma-4-31b-it`,`gemma-4-26b-it`]},{label:`DeepSeek`,value:`deepseek`,base_url:`https://api.deepseek.com/v1`,models:[`deepseek-chat`,`deepseek-reasoner`]},{label:`Z.AI / GLM`,value:`zai`,base_url:`https://api.z.ai/api/paas/v4`,models:[`glm-5`,`glm-5-turbo`,`glm-4.7`,`glm-4.5`,`glm-4.5-flash`]},{label:`Kimi Coding Plan`,value:`kimi-coding`,base_url:`https://api.kimi.com/coding/v1`,models:[`kimi-for-coding`,`kimi-k2.5`,`kimi-k2-thinking`,`kimi-k2-thinking-turbo`,`kimi-k2-turbo-preview`,`kimi-k2-0905-preview`]},{label:`Moonshot (Pay-as-you-go)`,value:`moonshot`,base_url:`https://api.moonshot.ai/v1`,models:[`kimi-k2.5`,`kimi-k2-thinking`,`kimi-k2-turbo-preview`,`kimi-k2-0905-preview`]},{label:`xAI`,value:`xai`,base_url:`https://api.x.ai/v1`,models:[`grok-4.20-0309-reasoning`,`grok-4.20-0309-non-reasoning`,`grok-4-1-fast-reasoning`,`grok-4-1-fast-non-reasoning`,`grok-4-fast-reasoning`,`grok-4-fast-non-reasoning`,`grok-4-0709`,`grok-code-fast-1`,`grok-3`,`grok-3-mini`]},{label:`MiniMax`,value:`minimax`,base_url:`https://api.minimax.io/anthropic`,models:[`MiniMax-M2.7`,`MiniMax-M2.5`,`MiniMax-M2.1`,`MiniMax-M2`]},{label:`MiniMax (China)`,value:`minimax-cn`,base_url:`https://api.minimaxi.com/v1`,models:[`MiniMax-M2.7`,`MiniMax-M2.5`,`MiniMax-M2.1`,`MiniMax-M2`]},{label:`Alibaba Cloud`,value:`alibaba`,base_url:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`,models:[`qwen3.5-plus`,`qwen3-coder-plus`,`qwen3-coder-next`,`glm-5`,`glm-4.7`,`kimi-k2.5`,`MiniMax-M2.5`]},{label:`Hugging Face`,value:`huggingface`,base_url:`https://router.huggingface.co/v1`,models:[`Qwen/Qwen3.5-397B-A17B`,`Qwen/Qwen3.5-35B-A3B`,`deepseek-ai/DeepSeek-V3.2`,`moonshotai/Kimi-K2.5`,`MiniMaxAI/MiniMax-M2.5`,`zai-org/GLM-5`,`XiaomiMiMo/MiMo-V2-Flash`,`moonshotai/Kimi-K2-Thinking`]},{label:`Xiaomi MiMo`,value:`xiaomi`,base_url:`https://api.xiaomimimo.com/v1`,models:[`mimo-v2-pro`,`mimo-v2-omni`,`mimo-v2-flash`]},{label:`Kilo Code`,value:`kilocode`,base_url:`https://api.kilo.ai/api/gateway`,models:[`anthropic/claude-opus-4.6`,`anthropic/claude-sonnet-4.6`,`openai/gpt-5.4`,`google/gemini-3-pro-preview`,`google/gemini-3-flash-preview`]},{label:`AI Gateway`,value:`ai-gateway`,base_url:`https://ai-gateway.vercel.sh/v1`,models:[`anthropic/claude-opus-4.6`,`anthropic/claude-sonnet-4.6`,`anthropic/claude-sonnet-4.5`,`anthropic/claude-haiku-4.5`,`openai/gpt-5`,`openai/gpt-4.1`,`openai/gpt-4.1-mini`,`google/gemini-3-pro-preview`,`google/gemini-3-flash`,`google/gemini-2.5-pro`,`google/gemini-2.5-flash`,`deepseek/deepseek-v3.2`]},{label:`OpenCode Zen`,value:`opencode-zen`,base_url:`https://opencode.ai/zen/v1`,models:[`gpt-5.4-pro`,`gpt-5.4`,`gpt-5.3-codex`,`gpt-5.2`,`gpt-5.1`,`claude-opus-4-6`,`claude-sonnet-4-6`,`claude-haiku-4-5`,`gemini-3.1-pro`,`gemini-3-pro`,`gemini-3-flash`,`minimax-m2.7`,`minimax-m2.5`,`glm-5`,`glm-4.7`,`kimi-k2.5`]},{label:`OpenCode Go`,value:`opencode-go`,base_url:`https://opencode.ai/zen/go/v1`,models:[`glm-5`,`kimi-k2.5`,`mimo-v2-pro`,`mimo-v2-omni`,`minimax-m2.7`,`minimax-m2.5`]},{label:`OpenRouter`,value:`openrouter`,base_url:`https://openrouter.ai/api/v1`,models:[]}],te={style:{display:`flex`,gap:`12px`}},ne={style:{display:`flex`,gap:`8px`,width:`100%`}},re={class:`modal-footer`},ie=x(f({__name:`ProviderFormModal`,emits:[`close`,`saved`],setup(t,{emit:n}){let{t:i}=b(),c=n,f=L(),m=k(),g=u(!0),v=u(!1),y=u(!1),x=u(`preset`),S=u(null),C=u({name:``,base_url:``,api_key:``,model:``}),A=u([]),j=$;function M(e){let t=e.replace(/^https?:\/\//,``).replace(/\/v1\/?$/,``).split(`/`)[0];return t.includes(`localhost`)||t.includes(`127.0.0.1`)?i(`models.local`,{host:t}):t.charAt(0).toUpperCase()+t.slice(1)}l(S,e=>{if(C.value.model=``,e){let t=j.find(t=>t.value===e);t&&(C.value.name=t.label,C.value.base_url=t.base_url,A.value=t.models.map(e=>({label:e,value:e})),t.models.length>0&&(C.value.model=t.models[0]))}}),l(()=>C.value.base_url,e=>{x.value===`custom`&&e.trim()&&(C.value.name=M(e.trim()))}),l(x,()=>{A.value=[],C.value={name:``,base_url:``,api_key:``,model:``},S.value=null});async function N(){let{base_url:e}=C.value;if(!e.trim()){m.warning(i(`models.enterBaseUrl`));return}y.value=!0;try{let t=e.replace(/\/+$/,``)+`/models`,n={};C.value.api_key.trim()&&(n.Authorization=`Bearer ${C.value.api_key.trim()}`);let r=await fetch(t,{headers:n,signal:AbortSignal.timeout(8e3)});if(!r.ok)throw Error(`HTTP ${r.status}`);let a=await r.json();if(!Array.isArray(a.data))throw Error(i(`models.unexpectedFormat`));A.value=a.data.map(e=>({label:e.id,value:e.id})),A.value.length>0&&!C.value.model&&(C.value.model=A.value[0].value),m.success(i(`models.foundModels`,{count:A.value.length}))}catch(e){m.error(i(`models.fetchFailed`)+`: `+e.message)}finally{y.value=!1}}async function P(){if(x.value===`preset`&&!S.value){m.warning(i(`models.selectProviderRequired`));return}if(!C.value.base_url.trim()){m.warning(i(`models.baseUrlRequired`));return}if(!C.value.api_key.trim()){m.warning(i(`models.apiKeyRequired`));return}if(!C.value.model){m.warning(i(`models.modelRequired`));return}v.value=!0;try{let e=x.value===`preset`&&j.find(e=>e.value===S.value)?.value||null;await f.addProvider({name:C.value.name.trim(),base_url:C.value.base_url.trim(),api_key:C.value.api_key.trim(),model:C.value.model,providerKey:e}),m.success(i(`models.providerAdded`)),c(`saved`)}catch(e){m.error(e.message)}finally{v.value=!1}}function F(){g.value=!1,setTimeout(()=>c(`close`),200)}return(t,n)=>(a(),s(h(w),{show:g.value,"onUpdate:show":n[7]||=e=>g.value=e,preset:`card`,title:h(i)(`models.addProvider`),style:{width:`min(520px, calc(100vw - 32px))`},"mask-closable":!v.value,onAfterLeave:n[8]||=e=>c(`close`)},{footer:o(()=>[_(`div`,re,[e(h(D),{onClick:F},{default:o(()=>[p(d(h(i)(`common.cancel`)),1)]),_:1}),e(h(D),{type:`primary`,loading:v.value,onClick:P},{default:o(()=>[p(d(h(i)(`common.add`)),1)]),_:1},8,[`loading`])])]),default:o(()=>[e(h(ee),{"label-placement":`top`},{default:o(()=>[e(h(T),{label:h(i)(`models.providerType`)},{default:o(()=>[_(`div`,te,[e(h(D),{type:x.value===`preset`?`primary`:`default`,size:`small`,onClick:n[0]||=e=>x.value=`preset`},{default:o(()=>[p(d(h(i)(`models.preset`)),1)]),_:1},8,[`type`]),e(h(D),{type:x.value===`custom`?`primary`:`default`,size:`small`,onClick:n[1]||=e=>x.value=`custom`},{default:o(()=>[p(d(h(i)(`models.custom`)),1)]),_:1},8,[`type`])])]),_:1},8,[`label`]),x.value===`preset`?(a(),s(h(T),{key:0,label:h(i)(`models.selectProvider`),required:``},{default:o(()=>[e(h(E),{value:S.value,"onUpdate:value":n[2]||=e=>S.value=e,options:h(j),placeholder:h(i)(`models.chooseProvider`),filterable:``},null,8,[`value`,`options`,`placeholder`])]),_:1},8,[`label`])):r(``,!0),x.value===`custom`?(a(),s(h(T),{key:1,label:h(i)(`models.name`)},{default:o(()=>[e(h(O),{value:C.value.name,"onUpdate:value":n[3]||=e=>C.value.name=e,placeholder:h(i)(`models.autoGeneratedName`),disabled:``},null,8,[`value`,`placeholder`])]),_:1},8,[`label`])):r(``,!0),e(h(T),{label:h(i)(`models.baseUrl`),required:``},{default:o(()=>[e(h(O),{value:C.value.base_url,"onUpdate:value":n[4]||=e=>C.value.base_url=e,placeholder:h(i)(`models.baseUrlPlaceholder`),disabled:x.value===`preset`},null,8,[`value`,`placeholder`,`disabled`])]),_:1},8,[`label`]),e(h(T),{label:h(i)(`models.apiKey`),required:``},{default:o(()=>[e(h(O),{value:C.value.api_key,"onUpdate:value":n[5]||=e=>C.value.api_key=e,type:`password`,"show-password-on":`click`,placeholder:h(i)(`models.apiKeyPlaceholder`)},null,8,[`value`,`placeholder`])]),_:1},8,[`label`]),e(h(T),{label:h(i)(`models.defaultModel`),required:``},{default:o(()=>[_(`div`,ne,[e(h(E),{value:C.value.model,"onUpdate:value":n[6]||=e=>C.value.model=e,options:A.value,filterable:``,placeholder:h(i)(`models.selectModel`),style:{flex:`1`}},null,8,[`value`,`options`,`placeholder`]),x.value===`custom`||x.value===`preset`&&A.value.length===0?(a(),s(h(D),{key:0,loading:y.value,onClick:N},{default:o(()=>[p(d(h(i)(`common.fetch`)),1)]),_:1},8,[`loading`])):r(``,!0)])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-c6cd4f75`]]),ae={class:`models-view`},oe={class:`page-header`},se={class:`header-title`},ce={class:`models-content`},le=x(f({__name:`ModelsView`,setup(t){let{t:i}=b(),l=L(),f=u(!1);c(()=>{l.fetchProviders()});function m(){f.value=!0}function g(){f.value=!1}async function v(){await l.fetchProviders(),g()}return(t,c)=>(a(),n(`div`,ae,[_(`header`,oe,[_(`h2`,se,d(h(i)(`models.title`)),1),e(h(D),{type:`primary`,size:`small`,onClick:m},{icon:o(()=>[...c[0]||=[_(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[_(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),_(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),default:o(()=>[p(` `+d(h(i)(`models.addProvider`)),1)]),_:1})]),_(`div`,ce,[e(h(A),{show:h(l).loading&&h(l).providers.length===0},{default:o(()=>[e(Q)]),_:1},8,[`show`])]),f.value?(a(),s(ie,{key:0,onClose:g,onSaved:v})):r(``,!0)]))}}),[[`__scopeId`,`data-v-f120758c`]]);export{le as default};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import{$ as e,C as t,F as n,K as r,L as i,M as a,N as o,R as s,S as c,U as l,V as u,X as d,Z as f,b as p,ct as m,d as h,dt as g,h as _,j as v,k as y,st as b,v as x,x as S,y as C}from"./router-COwpqexM.js";import{$ as w,A as T,B as ee,C as E,D,E as te,F as O,I as k,K as ne,M as A,N as j,O as M,P as re,Q as N,S as ie,T as ae,U as oe,X as se,Y as ce,_ as le,at as P,b as ue,c as de,ct as fe,d as pe,et as F,g as me,h as he,j as ge,k as I,lt as _e,m as ve,mt as ye,n as be,ot as L,p as xe,q as Se,s as Ce,st as we,ut as Te,v as Ee,w as De,x as Oe,y as ke,z as Ae}from"./browser-DzAOCZtm.js";import{b as je,c as Me,g as R,h as z,l as Ne,m as Pe,n as Fe,r as Ie,u as Le}from"./Scrollbar-Bg2FeTtI.js";import{t as Re}from"./use-compitable-BnlNjEug.js";var ze=[],Be=new WeakMap;function Ve(){ze.forEach(e=>e(...Be.get(e))),ze=[]}function He(e,...t){Be.set(e,t),!ze.includes(e)&&ze.push(e)===1&&requestAnimationFrame(Ve)}function Ue(e=8){return Math.random().toString(16).slice(2,2+e)}function We(e){let t=m(!!e.value);if(t.value)return b(t);let n=d(e,e=>{e&&(t.value=!0,n())});return b(t)}function Ge(){return a()!==null}var Ke=typeof window<`u`,qe=Ke?document?.fonts?.ready:void 0,B=!1;qe===void 0?B=!0:qe.then(()=>{B=!0});function Je(e){if(B)return;let t=!1;l(()=>{B||qe?.then(()=>{t||e()})}),u(()=>{t=!0})}var Ye=N(`n-internal-select-menu`),Xe=N(`n-internal-select-menu-body`),Ze=N(`n-drawer-body`);N(`n-drawer`);var Qe=N(`n-modal-body`),$e=N(`n-modal-provider`),et=N(`n-modal`),tt=N(`n-popover-body`),nt=`__disabled__`;function V(e){let t=n(Qe,null),r=n(Ze,null),i=n(tt,null),a=n(Xe,null),o=m();if(typeof document<`u`){o.value=document.fullscreenElement;let e=()=>{o.value=document.fullscreenElement};l(()=>{R(`fullscreenchange`,document,e)}),u(()=>{z(`fullscreenchange`,document,e)})}return F(()=>{let{to:n}=e;return n===void 0?t?.value?t.value.$el??t.value:r?.value?r.value:i?.value?i.value:a?.value?a.value:n??(o.value||`body`):n===!1?nt:n===!0?o.value||`body`:n})}V.tdkey=nt,V.propTo={type:[String,Object,Boolean],default:void 0};function rt(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function it(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`){(typeof e==`string`||typeof e==`number`)&&n.push(y(String(e)));return}if(Array.isArray(e)){it(e,t,n);return}if(e.type===C){if(e.children===null)return;Array.isArray(e.children)&&it(e.children,t,n)}else e.type!==x&&n.push(e)}}),n}function at(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);let i=it(r());if(i.length===1)return i[0];throw Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}var H=null;function ot(){if(H===null&&(H=document.getElementById(`v-binder-view-measurer`),H===null)){H=document.createElement(`div`),H.id=`v-binder-view-measurer`;let{style:e}=H;e.position=`fixed`,e.left=`0`,e.right=`0`,e.top=`0`,e.bottom=`0`,e.pointerEvents=`none`,e.visibility=`hidden`,document.body.appendChild(H)}return H.getBoundingClientRect()}function st(e,t){let n=ot();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function ct(e){let t=e.getBoundingClientRect(),n=ot();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function lt(e){return e.nodeType===9?null:e.parentNode}function ut(e){if(e===null)return null;let t=lt(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){let{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e+r+n))return t}return ut(t)}var dt=v({name:`Binder`,props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){r(`VBinder`,a()?.proxy);let t=n(`VBinder`,null),i=m(null),o=n=>{i.value=n,t&&e.syncTargetWithParent&&t.setTargetRef(n)},s=[],c=()=>{let e=i.value;for(;e=ut(e),e!==null;)s.push(e);for(let e of s)R(`scroll`,e,h,!0)},l=()=>{for(let e of s)z(`scroll`,e,h,!0);s=[]},d=new Set,f=e=>{d.size===0&&c(),d.has(e)||d.add(e)},p=e=>{d.has(e)&&d.delete(e),d.size===0&&l()},h=()=>{He(g)},g=()=>{d.forEach(e=>e())},_=new Set,v=e=>{_.size===0&&R(`resize`,window,b),_.has(e)||_.add(e)},y=e=>{_.has(e)&&_.delete(e),_.size===0&&z(`resize`,window,b)},b=()=>{_.forEach(e=>e())};return u(()=>{z(`resize`,window,b),l()}),{targetRef:i,setTargetRef:o,addScrollListener:f,removeScrollListener:p,addResizeListener:v,removeResizeListener:y}},render(){return rt(`binder`,this.$slots)}}),ft=v({name:`Target`,setup(){let{setTargetRef:e,syncTarget:t}=n(`VBinder`);return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){let{syncTarget:t,setTargetDirective:n}=this;return t?e(at(`follower`,this.$slots),[[n]]):at(`follower`,this.$slots)}}),U=`@@mmoContext`,pt={mounted(e,{value:t}){e[U]={handler:void 0},typeof t==`function`&&(e[U].handler=t,R(`mousemoveoutside`,e,t))},updated(e,{value:t}){let n=e[U];typeof t==`function`?n.handler?n.handler!==t&&(z(`mousemoveoutside`,e,n.handler),n.handler=t,R(`mousemoveoutside`,e,t)):(e[U].handler=t,R(`mousemoveoutside`,e,t)):n.handler&&=(z(`mousemoveoutside`,e,n.handler),void 0)},unmounted(e){let{handler:t}=e[U];t&&z(`mousemoveoutside`,e,t),e[U].handler=void 0}},W=`@@coContext`,mt={mounted(e,{value:t,modifiers:n}){e[W]={handler:void 0},typeof t==`function`&&(e[W].handler=t,R(`clickoutside`,e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){let r=e[W];typeof t==`function`?r.handler?r.handler!==t&&(z(`clickoutside`,e,r.handler,{capture:n.capture}),r.handler=t,R(`clickoutside`,e,t,{capture:n.capture})):(e[W].handler=t,R(`clickoutside`,e,t,{capture:n.capture})):r.handler&&=(z(`clickoutside`,e,r.handler,{capture:n.capture}),void 0)},unmounted(e,{modifiers:t}){let{handler:n}=e[W];n&&z(`clickoutside`,e,n,{capture:t.capture}),e[W].handler=void 0}};function ht(e,t){console.error(`[vdirs/${e}]: ${t}`)}var gt=new class{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,t){let{elementZIndex:n}=this;if(t!==void 0){e.style.zIndex=`${t}`,n.delete(e);return}let{nextZIndex:r}=this;n.has(e)&&n.get(e)+1===this.nextZIndex||(e.style.zIndex=`${r}`,n.set(e,r),this.nextZIndex=r+1,this.squashState())}unregister(e,t){let{elementZIndex:n}=this;n.has(e)?n.delete(e):t===void 0&&ht(`z-index-manager/unregister-element`,`Element not found when unregistering.`),this.squashState()}squashState(){let{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){let e=Array.from(this.elementZIndex.entries());e.sort((e,t)=>e[1]-t[1]),this.nextZIndex=2e3,e.forEach(e=>{let t=e[0],n=this.nextZIndex++;`${n}`!==t.style.zIndex&&(t.style.zIndex=`${n}`)})}},G=`@@ziContext`,_t={mounted(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n;e[G]={enabled:!!i,initialized:!1},i&&(gt.ensureZIndex(e,r),e[G].initialized=!0)},updated(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n,a=e[G].enabled;i&&!a&&(gt.ensureZIndex(e,r),e[G].initialized=!0),e[G].enabled=!!i},unmounted(e,t){if(!e[G].initialized)return;let{value:n={}}=t,{zIndex:r}=n;gt.unregister(e,r)}},{c:K}=ye(),vt=`vueuc-style`;function yt(e){return typeof e==`string`?document.querySelector(e):e()||null}var bt=v({name:`LazyTeleport`,props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:We(g(e,`show`)),mergedTo:t(()=>{let{to:t}=e;return t??`body`})}},render(){return this.showTeleport?this.disabled?rt(`lazy-teleport`,this.$slots):o(p,{disabled:this.disabled,to:this.mergedTo},rt(`lazy-teleport`,this.$slots)):null}}),xt={top:`bottom`,bottom:`top`,left:`right`,right:`left`},St={start:`end`,center:`center`,end:`start`},Ct={top:`height`,bottom:`height`,left:`width`,right:`width`},wt={"bottom-start":`top left`,bottom:`top center`,"bottom-end":`top right`,"top-start":`bottom left`,top:`bottom center`,"top-end":`bottom right`,"right-start":`top left`,right:`center left`,"right-end":`bottom left`,"left-start":`top right`,left:`center right`,"left-end":`bottom right`},Tt={"bottom-start":`bottom left`,bottom:`bottom center`,"bottom-end":`bottom right`,"top-start":`top left`,top:`top center`,"top-end":`top right`,"right-start":`top right`,right:`center right`,"right-end":`bottom right`,"left-start":`top left`,left:`center left`,"left-end":`bottom left`},Et={"bottom-start":`right`,"bottom-end":`left`,"top-start":`right`,"top-end":`left`,"right-start":`bottom`,"right-end":`top`,"left-start":`bottom`,"left-end":`top`},Dt={top:!0,bottom:!1,left:!0,right:!1},Ot={top:`end`,bottom:`start`,left:`end`,right:`start`};function kt(e,t,n,r,i,a){if(!i||a)return{placement:e,top:0,left:0};let[o,s]=e.split(`-`),c=s??`center`,l={top:0,left:0},u=(e,i,a)=>{let o=0,s=0,c=n[e]-t[i]-t[e];return c>0&&r&&(a?s=Dt[i]?c:-c:o=Dt[i]?c:-c),{left:o,top:s}},d=o===`left`||o===`right`;if(c!==`center`){let r=Et[e],i=xt[r],a=Ct[r];if(n[a]>t[a]){if(t[r]+t[a]<n[a]){let e=(n[a]-t[a])/2;t[r]<e||t[i]<e?t[r]<t[i]?(c=St[s],l=u(a,i,d)):l=u(a,r,d):c=`center`}}else n[a]<t[a]&&t[i]<0&&t[r]>t[i]&&(c=St[s])}else{let e=o===`bottom`||o===`top`?`left`:`top`,r=xt[e],i=Ct[e],a=(n[i]-t[i])/2;(t[e]<a||t[r]<a)&&(t[e]>t[r]?(c=Ot[e],l=u(i,e,d)):(c=Ot[r],l=u(i,r,d)))}let f=o;return t[o]<n[Ct[o]]&&t[o]<t[xt[o]]&&(f=xt[o]),{placement:c===`center`?f:`${f}-${c}`,left:l.left,top:l.top}}function At(e,t){return t?Tt[e]:wt[e]}function jt(e,t,n,r,i,a){if(a)switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`top-end`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-50%)`};default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%) translateY(-100%)`}}switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:``};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-100%)`};case`top-end`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:``};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%)`};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateY(-100%) translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-50%) translateX(-100%)`};default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateX(-50%)`}}}var Mt=K([K(`.v-binder-follower-container`,{position:`absolute`,left:`0`,right:`0`,top:`0`,height:`0`,pointerEvents:`none`,zIndex:`auto`}),K(`.v-binder-follower-content`,{position:`absolute`,zIndex:`auto`},[K(`> *`,{pointerEvents:`all`})])]),Nt=v({name:`Follower`,inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:`bottom`},syncTrigger:{type:Array,default:[`resize`,`scroll`]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){let t=n(`VBinder`),r=F(()=>e.enabled===void 0?e.show:e.enabled),i=m(null),a=m(null),o=()=>{let{syncTrigger:n}=e;n.includes(`scroll`)&&t.addScrollListener(p),n.includes(`resize`)&&t.addResizeListener(p)},c=()=>{t.removeScrollListener(p),t.removeResizeListener(p)};l(()=>{r.value&&(p(),o())});let f=se();Mt.mount({id:`vueuc/binder`,head:!0,anchorMetaName:vt,ssr:f}),u(()=>{c()}),Je(()=>{r.value&&p()});let p=()=>{if(!r.value)return;let n=i.value;if(n===null)return;let o=t.targetRef,{x:s,y:c,overlap:l}=e,u=s!==void 0&&c!==void 0?st(s,c):ct(o);n.style.setProperty(`--v-target-width`,`${Math.round(u.width)}px`),n.style.setProperty(`--v-target-height`,`${Math.round(u.height)}px`);let{width:d,minWidth:f,placement:p,internalShift:m,flip:h}=e;n.setAttribute(`v-placement`,p),l?n.setAttribute(`v-overlap`,``):n.removeAttribute(`v-overlap`);let{style:g}=n;d===`target`?g.width=`${u.width}px`:d===void 0?g.width=``:g.width=d,f===`target`?g.minWidth=`${u.width}px`:f===void 0?g.minWidth=``:g.minWidth=f;let _=ct(n),v=ct(a.value),{left:y,top:b,placement:x}=kt(p,u,_,m,h,l),S=At(x,l),{left:C,top:w,transform:T}=jt(x,v,u,b,y,l);n.setAttribute(`v-placement`,x),n.style.setProperty(`--v-offset-left`,`${Math.round(y)}px`),n.style.setProperty(`--v-offset-top`,`${Math.round(b)}px`),n.style.transform=`translateX(${C}) translateY(${w}) ${T}`,n.style.setProperty(`--v-transform-origin`,S),n.style.transformOrigin=S};d(r,e=>{e?(o(),h()):c()});let h=()=>{s().then(p).catch(e=>console.error(e))};[`placement`,`x`,`y`,`internalShift`,`flip`,`width`,`overlap`,`minWidth`].forEach(t=>{d(g(e,t),p)}),[`teleportDisabled`].forEach(t=>{d(g(e,t),h)}),d(g(e,`syncTrigger`),e=>{e.includes(`resize`)?t.addResizeListener(p):t.removeResizeListener(p),e.includes(`scroll`)?t.addScrollListener(p):t.removeScrollListener(p)});let _=w();return{VBinder:t,mergedEnabled:r,offsetContainerRef:a,followerRef:i,mergedTo:F(()=>{let{to:t}=e;if(t!==void 0)return t;_.value}),syncPosition:p}},render(){return o(bt,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t;let n=o(`div`,{class:[`v-binder-follower-container`,this.containerClass],ref:`offsetContainerRef`},[o(`div`,{class:`v-binder-follower-content`,ref:`followerRef`},(t=this.$slots).default?.call(t))]);return this.zindexable?e(n,[[_t,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});function Pt(e){return e instanceof HTMLElement}function Ft(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(Pt(n)&&(Lt(n)||Ft(n)))return!0}return!1}function It(e){for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];if(Pt(n)&&(Lt(n)||It(n)))return!0}return!1}function Lt(e){if(!Rt(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Rt(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute(`tabIndex`)!==null)return!0;if(e.getAttribute(`disabled`))return!1;switch(e.nodeName){case`A`:return!!e.href&&e.rel!==`ignore`;case`INPUT`:return e.type!==`hidden`&&e.type!==`file`;case`SELECT`:case`TEXTAREA`:return!0;default:return!1}}var q=[],zt=v({name:`FocusTrap`,props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){let t=Ue(),n=m(null),r=m(null),i=!1,a=!1,o=typeof document>`u`?null:document.activeElement;function s(){return q[q.length-1]===t}function c(t){var n;t.code===`Escape`&&s()&&((n=e.onEsc)==null||n.call(e,t))}l(()=>{d(()=>e.active,e=>{e?(h(),R(`keydown`,document,c)):(z(`keydown`,document,c),i&&g())},{immediate:!0})}),u(()=>{z(`keydown`,document,c),i&&g()});function f(e){if(!a&&s()){let t=p();if(t===null||t.contains(je(e)))return;_(`first`)}}function p(){let e=n.value;if(e===null)return null;let t=e;for(;t=t.nextSibling,!(t===null||t instanceof Element&&t.tagName===`DIV`););return t}function h(){var n;if(!e.disabled){if(q.push(t),e.autoFocus){let{initialFocusTo:t}=e;t===void 0?_(`first`):(n=yt(t))==null||n.focus({preventScroll:!0})}i=!0,document.addEventListener(`focus`,f,!0)}}function g(){var n;if(e.disabled||(document.removeEventListener(`focus`,f,!0),q=q.filter(e=>e!==t),s()))return;let{finalFocusTo:r}=e;r===void 0?e.returnFocusOnDeactivated&&o instanceof HTMLElement&&(a=!0,o.focus({preventScroll:!0}),a=!1):(n=yt(r))==null||n.focus({preventScroll:!0})}function _(t){if(s()&&e.active){let e=n.value,i=r.value;if(e!==null&&i!==null){let n=p();if(n==null||n===i){a=!0,e.focus({preventScroll:!0}),a=!1;return}a=!0;let r=t===`first`?Ft(n):It(n);a=!1,r||(a=!0,e.focus({preventScroll:!0}),a=!1)}}}function v(e){if(a)return;let t=p();t!==null&&(e.relatedTarget!==null&&t.contains(e.relatedTarget)?_(`last`):_(`first`))}function y(e){a||(e.relatedTarget!==null&&e.relatedTarget===n.value?_(`last`):_(`first`))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:`position: absolute; height: 0; width: 0;`,handleStartFocus:v,handleEndFocus:y}},render(){let{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();let{active:t,focusableStyle:n}=this;return o(C,null,[o(`div`,{"aria-hidden":`true`,tabindex:t?`0`:`-1`,ref:`focusableStartRef`,style:n,onFocus:this.handleStartFocus}),e(),o(`div`,{"aria-hidden":`true`,style:n,ref:`focusableEndRef`,tabindex:t?`0`:`-1`,onFocus:this.handleEndFocus})])}}),Bt=/^(\d|\.)+$/,Vt=/(\d|\.)+/;function Ht(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e==`number`){let r=(e+n)*t;return r===0?`0`:`${r}px`}else if(typeof e==`string`)if(Bt.test(e)){let i=(Number(e)+n)*t;return r?i===0?`0`:`${i}px`:`${i}`}else{let r=Vt.exec(e);return r?e.replace(Vt,String((Number(r[0])+n)*t)):e}return e}var Ut;function Wt(){return Ut===void 0&&(Ut=navigator.userAgent.includes(`Node.js`)||navigator.userAgent.includes(`jsdom`)),Ut}function J(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`){(typeof e==`string`||typeof e==`number`)&&n.push(y(String(e)));return}if(Array.isArray(e)){J(e,t,n);return}if(e.type===C){if(e.children===null)return;Array.isArray(e.children)&&J(e.children,t,n)}else{if(e.type===x&&t)return;n.push(e)}}}),n}function Gt(e,t=`default`,n=void 0){let r=e[t];if(!r)return ce(`getFirstSlotVNode`,`slot[${t}] is empty`),null;let i=J(r(n));return i.length===1?i[0]:(ce(`getFirstSlotVNode`,`slot[${t}] should have exactly one child`),null)}function Kt(e,t,n){if(!t)return null;let r=J(t(n));return r.length===1?r[0]:(ce(`getFirstSlotVNode`,`slot[${e}] should have exactly one child`),null)}function qt(e,t=[],n){let r={};return t.forEach(t=>{r[t]=e[t]}),Object.assign(r,n)}var Jt=M(k,`WeakMap`),Yt=Ee(Object.keys,Object),Xt=Object.prototype.hasOwnProperty;function Zt(e){if(!E(e))return Yt(e);var t=[];for(var n in Object(e))Xt.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Qt(e){return De(e)?ke(e):Zt(e)}var $t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,en=/^\w*$/;function tn(e,t){if(A(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Le(e)?!0:en.test(e)||!$t.test(e)||t!=null&&e in Object(t)}var nn=`Expected a function`;function rn(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(nn);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(rn.Cache||me),n}rn.Cache=me;var an=500;function on(e){var t=rn(e,function(e){return n.size===an&&n.clear(),e}),n=t.cache;return t}var sn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cn=/\\(\\)?/g,ln=on(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(sn,function(e,n,r,i){t.push(r?i.replace(cn,`$1`):n||e)}),t});function un(e,t){return A(e)?e:tn(e,t)?[e]:ln(Me(e))}var dn=1/0;function fn(e){if(typeof e==`string`||Le(e))return e;var t=e+``;return t==`0`&&1/e==-dn?`-0`:t}function pn(e,t){t=un(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[fn(t[n++])];return n&&n==r?e:void 0}function mn(e,t,n){var r=e==null?void 0:pn(e,t);return r===void 0?n:r}function hn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function gn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function _n(){return[]}var vn=Object.prototype.propertyIsEnumerable,yn=Object.getOwnPropertySymbols,bn=yn?function(e){return e==null?[]:(e=Object(e),gn(yn(e),function(t){return vn.call(e,t)}))}:_n;function xn(e,t,n){var r=t(e);return A(e)?r:hn(r,n(e))}function Sn(e){return xn(e,Qt,bn)}var Cn=M(k,`DataView`),wn=M(k,`Promise`),Tn=M(k,`Set`),En=`[object Map]`,Dn=`[object Object]`,On=`[object Promise]`,kn=`[object Set]`,An=`[object WeakMap]`,jn=`[object DataView]`,Mn=I(Cn),Nn=I(le),Pn=I(wn),Fn=I(Tn),In=I(Jt),Y=re;(Cn&&Y(new Cn(new ArrayBuffer(1)))!=jn||le&&Y(new le)!=En||wn&&Y(wn.resolve())!=On||Tn&&Y(new Tn)!=kn||Jt&&Y(new Jt)!=An)&&(Y=function(e){var t=re(e),n=t==Dn?e.constructor:void 0,r=n?I(n):``;if(r)switch(r){case Mn:return jn;case Nn:return En;case Pn:return On;case Fn:return kn;case In:return An}return t});var Ln=Y,Rn=`__lodash_hash_undefined__`;function zn(e){return this.__data__.set(e,Rn),this}function Bn(e){return this.__data__.has(e)}function Vn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new me;++t<n;)this.add(e[t])}Vn.prototype.add=Vn.prototype.push=zn,Vn.prototype.has=Bn;function Hn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Un(e,t){return e.has(t)}var Wn=1,Gn=2;function Kn(e,t,n,r,i,a){var o=n&Wn,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Gn?new Vn:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Hn(t,function(e,t){if(!Un(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function qn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Jn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Yn=1,Xn=2,Zn=`[object Boolean]`,Qn=`[object Date]`,$n=`[object Error]`,er=`[object Map]`,tr=`[object Number]`,nr=`[object RegExp]`,rr=`[object Set]`,ir=`[object String]`,ar=`[object Symbol]`,or=`[object ArrayBuffer]`,sr=`[object DataView]`,cr=O?O.prototype:void 0,lr=cr?cr.valueOf:void 0;function ur(e,t,n,r,i,a,o){switch(n){case sr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case or:return!(e.byteLength!=t.byteLength||!a(new ve(e),new ve(t)));case Zn:case Qn:case tr:return te(+e,+t);case $n:return e.name==t.name&&e.message==t.message;case nr:case ir:return e==t+``;case er:var s=qn;case rr:var c=r&Yn;if(s||=Jn,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Xn,o.set(e,t);var u=Kn(s(e),s(t),r,i,a,o);return o.delete(e),u;case ar:if(lr)return lr.call(e)==lr.call(t)}return!1}var dr=1,fr=Object.prototype.hasOwnProperty;function pr(e,t,n,r,i,a){var o=n&dr,s=Sn(e),c=s.length;if(c!=Sn(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:fr.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var mr=1,hr=`[object Arguments]`,gr=`[object Array]`,X=`[object Object]`,_r=Object.prototype.hasOwnProperty;function vr(e,t,n,r,i,a){var o=A(e),s=A(t),c=o?gr:Ln(e),l=s?gr:Ln(t);c=c==hr?X:c,l=l==hr?X:l;var u=c==X,d=l==X,f=c==l;if(f&&Oe(e)){if(!Oe(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new he,o||ue(e)?Kn(e,t,n,r,i,a):ur(e,t,c,n,r,i,a);if(!(n&mr)){var p=u&&_r.call(e,`__wrapped__`),m=d&&_r.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new he,i(h,g,n,r,a)}}return f?(a||=new he,pr(e,t,n,r,i,a)):!1}function yr(e,t,n,r,i){return e===t?!0:e==null||t==null||!j(e)&&!j(t)?e!==e&&t!==t:vr(e,t,n,r,yr,i)}var br=1,xr=2;function Sr(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new he;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?yr(u,l,br|xr,r,d):f))return!1}}return!0}function Cr(e){return e===e&&!ge(e)}function wr(e){for(var t=Qt(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Cr(i)]}return t}function Tr(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Er(e){var t=wr(e);return t.length==1&&t[0][2]?Tr(t[0][0],t[0][1]):function(n){return n===e||Sr(n,e,t)}}function Dr(e,t){return e!=null&&t in Object(e)}function Or(e,t,n){t=un(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=fn(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&ae(i)&&D(o,i)&&(A(e)||ie(e)))}function kr(e,t){return e!=null&&Or(e,t,Dr)}var Ar=1,jr=2;function Mr(e,t){return tn(e)&&Cr(t)?Tr(fn(e),t):function(n){var r=mn(n,e);return r===void 0&&r===t?kr(n,e):yr(t,r,Ar|jr)}}function Nr(e){return function(t){return t?.[e]}}function Pr(e){return function(t){return pn(t,e)}}function Fr(e){return tn(e)?Nr(fn(e)):Pr(e)}function Ir(e){return typeof e==`function`?e:e==null?T:typeof e==`object`?A(e)?Mr(e[0],e[1]):Er(e):Fr(e)}function Lr(e,t){return e&&xe(e,t,Qt)}function Rr(e,t){return function(n,r){if(n==null)return n;if(!De(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var zr=Rr(Lr);function Br(e,t){var n=-1,r=De(e)?Array(e.length):[];return zr(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Vr(e,t){return(A(e)?Ne:Br)(e,Ir(t,3))}var Hr={space:`6px`,spaceArrow:`10px`,arrowOffset:`10px`,arrowOffsetVertical:`10px`,arrowHeight:`6px`,padding:`8px 14px`};function Ur(e){let{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:i,fontSize:a,dividerColor:o}=e;return Object.assign(Object.assign({},Hr),{fontSize:a,borderRadius:i,color:n,dividerColor:o,textColor:r,boxShadow:t})}var Wr=Ce({name:`Popover`,common:be,peers:{Scrollbar:Ie},self:Ur}),Gr={top:`bottom`,bottom:`top`,left:`right`,right:`left`},Z=`var(--n-arrow-height) * 1.414`,Kr=P([L(`popover`,`
|
|
2
|
-
transition:
|
|
3
|
-
box-shadow .3s var(--n-bezier),
|
|
4
|
-
background-color .3s var(--n-bezier),
|
|
5
|
-
color .3s var(--n-bezier);
|
|
6
|
-
position: relative;
|
|
7
|
-
font-size: var(--n-font-size);
|
|
8
|
-
color: var(--n-text-color);
|
|
9
|
-
box-shadow: var(--n-box-shadow);
|
|
10
|
-
word-break: break-word;
|
|
11
|
-
`,[P(`>`,[L(`scrollbar`,`
|
|
12
|
-
height: inherit;
|
|
13
|
-
max-height: inherit;
|
|
14
|
-
`)]),Te(`raw`,`
|
|
15
|
-
background-color: var(--n-color);
|
|
16
|
-
border-radius: var(--n-border-radius);
|
|
17
|
-
`,[Te(`scrollable`,[Te(`show-header-or-footer`,`padding: var(--n-padding);`)])]),fe(`header`,`
|
|
18
|
-
padding: var(--n-padding);
|
|
19
|
-
border-bottom: 1px solid var(--n-divider-color);
|
|
20
|
-
transition: border-color .3s var(--n-bezier);
|
|
21
|
-
`),fe(`footer`,`
|
|
22
|
-
padding: var(--n-padding);
|
|
23
|
-
border-top: 1px solid var(--n-divider-color);
|
|
24
|
-
transition: border-color .3s var(--n-bezier);
|
|
25
|
-
`),_e(`scrollable, show-header-or-footer`,[fe(`content`,`
|
|
26
|
-
padding: var(--n-padding);
|
|
27
|
-
`)])]),L(`popover-shared`,`
|
|
28
|
-
transform-origin: inherit;
|
|
29
|
-
`,[L(`popover-arrow-wrapper`,`
|
|
30
|
-
position: absolute;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
pointer-events: none;
|
|
33
|
-
`,[L(`popover-arrow`,`
|
|
34
|
-
transition: background-color .3s var(--n-bezier);
|
|
35
|
-
position: absolute;
|
|
36
|
-
display: block;
|
|
37
|
-
width: calc(${Z});
|
|
38
|
-
height: calc(${Z});
|
|
39
|
-
box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
|
|
40
|
-
transform: rotate(45deg);
|
|
41
|
-
background-color: var(--n-color);
|
|
42
|
-
pointer-events: all;
|
|
43
|
-
`)]),P(`&.popover-transition-enter-from, &.popover-transition-leave-to`,`
|
|
44
|
-
opacity: 0;
|
|
45
|
-
transform: scale(.85);
|
|
46
|
-
`),P(`&.popover-transition-enter-to, &.popover-transition-leave-from`,`
|
|
47
|
-
transform: scale(1);
|
|
48
|
-
opacity: 1;
|
|
49
|
-
`),P(`&.popover-transition-enter-active`,`
|
|
50
|
-
transition:
|
|
51
|
-
box-shadow .3s var(--n-bezier),
|
|
52
|
-
background-color .3s var(--n-bezier),
|
|
53
|
-
color .3s var(--n-bezier),
|
|
54
|
-
opacity .15s var(--n-bezier-ease-out),
|
|
55
|
-
transform .15s var(--n-bezier-ease-out);
|
|
56
|
-
`),P(`&.popover-transition-leave-active`,`
|
|
57
|
-
transition:
|
|
58
|
-
box-shadow .3s var(--n-bezier),
|
|
59
|
-
background-color .3s var(--n-bezier),
|
|
60
|
-
color .3s var(--n-bezier),
|
|
61
|
-
opacity .15s var(--n-bezier-ease-in),
|
|
62
|
-
transform .15s var(--n-bezier-ease-in);
|
|
63
|
-
`)]),$(`top-start`,`
|
|
64
|
-
top: calc(${Z} / -2);
|
|
65
|
-
left: calc(${Q(`top-start`)} - var(--v-offset-left));
|
|
66
|
-
`),$(`top`,`
|
|
67
|
-
top: calc(${Z} / -2);
|
|
68
|
-
transform: translateX(calc(${Z} / -2)) rotate(45deg);
|
|
69
|
-
left: 50%;
|
|
70
|
-
`),$(`top-end`,`
|
|
71
|
-
top: calc(${Z} / -2);
|
|
72
|
-
right: calc(${Q(`top-end`)} + var(--v-offset-left));
|
|
73
|
-
`),$(`bottom-start`,`
|
|
74
|
-
bottom: calc(${Z} / -2);
|
|
75
|
-
left: calc(${Q(`bottom-start`)} - var(--v-offset-left));
|
|
76
|
-
`),$(`bottom`,`
|
|
77
|
-
bottom: calc(${Z} / -2);
|
|
78
|
-
transform: translateX(calc(${Z} / -2)) rotate(45deg);
|
|
79
|
-
left: 50%;
|
|
80
|
-
`),$(`bottom-end`,`
|
|
81
|
-
bottom: calc(${Z} / -2);
|
|
82
|
-
right: calc(${Q(`bottom-end`)} + var(--v-offset-left));
|
|
83
|
-
`),$(`left-start`,`
|
|
84
|
-
left: calc(${Z} / -2);
|
|
85
|
-
top: calc(${Q(`left-start`)} - var(--v-offset-top));
|
|
86
|
-
`),$(`left`,`
|
|
87
|
-
left: calc(${Z} / -2);
|
|
88
|
-
transform: translateY(calc(${Z} / -2)) rotate(45deg);
|
|
89
|
-
top: 50%;
|
|
90
|
-
`),$(`left-end`,`
|
|
91
|
-
left: calc(${Z} / -2);
|
|
92
|
-
bottom: calc(${Q(`left-end`)} + var(--v-offset-top));
|
|
93
|
-
`),$(`right-start`,`
|
|
94
|
-
right: calc(${Z} / -2);
|
|
95
|
-
top: calc(${Q(`right-start`)} - var(--v-offset-top));
|
|
96
|
-
`),$(`right`,`
|
|
97
|
-
right: calc(${Z} / -2);
|
|
98
|
-
transform: translateY(calc(${Z} / -2)) rotate(45deg);
|
|
99
|
-
top: 50%;
|
|
100
|
-
`),$(`right-end`,`
|
|
101
|
-
right: calc(${Z} / -2);
|
|
102
|
-
bottom: calc(${Q(`right-end`)} + var(--v-offset-top));
|
|
103
|
-
`),...Vr({top:[`right-start`,`left-start`],right:[`top-end`,`bottom-end`],bottom:[`right-end`,`left-end`],left:[`top-start`,`bottom-start`]},(e,t)=>{let n=[`right`,`left`].includes(t),r=n?`width`:`height`;return e.map(e=>{let i=e.split(`-`)[1]===`end`,a=`calc((${`var(--v-target-${r}, 0px)`} - ${Z}) / 2)`,o=Q(e);return P(`[v-placement="${e}"] >`,[L(`popover-shared`,[_e(`center-arrow`,[L(`popover-arrow`,`${t}: calc(max(${a}, ${o}) ${i?`+`:`-`} var(--v-offset-${n?`left`:`top`}));`)])])])})})]);function Q(e){return[`top`,`bottom`].includes(e.split(`-`)[0])?`var(--n-arrow-offset)`:`var(--n-arrow-offset-vertical)`}function $(e,t){let n=e.split(`-`)[0],r=[`top`,`bottom`].includes(n)?`height: var(--n-space-arrow);`:`width: var(--n-space-arrow);`;return P(`[v-placement="${e}"] >`,[L(`popover-shared`,`
|
|
104
|
-
margin-${Gr[n]}: var(--n-space);
|
|
105
|
-
`,[_e(`show-arrow`,`
|
|
106
|
-
margin-${Gr[n]}: var(--n-space-arrow);
|
|
107
|
-
`),_e(`overlap`,`
|
|
108
|
-
margin: 0;
|
|
109
|
-
`),we(`popover-arrow-wrapper`,`
|
|
110
|
-
right: 0;
|
|
111
|
-
left: 0;
|
|
112
|
-
top: 0;
|
|
113
|
-
bottom: 0;
|
|
114
|
-
${n}: 100%;
|
|
115
|
-
${Gr[n]}: auto;
|
|
116
|
-
${r}
|
|
117
|
-
`,[L(`popover-arrow`,t)])])])}var qr=Object.assign(Object.assign({},de.props),{to:V.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Jr({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:i}){return o(`div`,{key:`__popover-arrow__`,style:r,class:[`${i}-popover-arrow-wrapper`,n]},o(`div`,{class:[`${i}-popover-arrow`,e],style:t}))}var Yr=v({name:`PopoverBody`,inheritAttrs:!1,props:qr,setup(a,{slots:s,attrs:c}){let{namespaceRef:l,mergedClsPrefixRef:p,inlineThemeDisabled:h,mergedRtlRef:v}=ee(a),y=de(`Popover`,`-popover`,Kr,Wr,a,p),b=pe(`Popover`,v,p),x=m(null),S=n(`NPopover`),w=m(null),T=m(a.show),E=m(!1);f(()=>{let{show:e}=a;e&&!Wt()&&!a.internalDeactivateImmediately&&(E.value=!0)});let D=t(()=>{let{trigger:e,onClickoutside:t}=a,n=[],{positionManuallyRef:{value:r}}=S;return r||(e===`click`&&!t&&n.push([mt,N,void 0,{capture:!0}]),e===`hover`&&n.push([pt,re])),t&&n.push([mt,N,void 0,{capture:!0}]),(a.displayDirective===`show`||a.animated&&E.value)&&n.push([_,a.show]),n}),te=t(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseIn:t,cubicBezierEaseOut:n},self:{space:r,spaceArrow:i,padding:a,fontSize:o,textColor:s,dividerColor:c,color:l,boxShadow:u,borderRadius:d,arrowHeight:f,arrowOffset:p,arrowOffsetVertical:m}}=y.value;return{"--n-box-shadow":u,"--n-bezier":e,"--n-bezier-ease-in":t,"--n-bezier-ease-out":n,"--n-font-size":o,"--n-text-color":s,"--n-color":l,"--n-divider-color":c,"--n-border-radius":d,"--n-arrow-height":f,"--n-arrow-offset":p,"--n-arrow-offset-vertical":m,"--n-padding":a,"--n-space":r,"--n-space-arrow":i}}),O=t(()=>{let e=a.width===`trigger`?void 0:Ht(a.width),t=[];e&&t.push({width:e});let{maxWidth:n,minWidth:r}=a;return n&&t.push({maxWidth:Ht(n)}),r&&t.push({maxWidth:Ht(r)}),h||t.push(te.value),t}),k=h?Ae(`popover`,void 0,te,a):void 0;S.setBodyInstance({syncPosition:A}),u(()=>{S.setBodyInstance(null)}),d(g(a,`show`),e=>{a.animated||(e?T.value=!0:T.value=!1)});function A(){var e;(e=x.value)==null||e.syncPosition()}function j(e){a.trigger===`hover`&&a.keepAliveOnHover&&a.show&&S.handleMouseEnter(e)}function M(e){a.trigger===`hover`&&a.keepAliveOnHover&&S.handleMouseLeave(e)}function re(e){a.trigger===`hover`&&!ie().contains(je(e))&&S.handleMouseMoveOutside(e)}function N(e){(a.trigger===`click`&&!ie().contains(je(e))||a.onClickoutside)&&S.handleClickOutside(e)}function ie(){return S.getTriggerElement()}r(tt,w),r(Ze,null),r(Qe,null);function ae(){if(k?.onRender(),!(a.displayDirective===`show`||a.show||a.animated&&E.value))return null;let t,n=S.internalRenderBodyRef.value,{value:r}=p;if(n)t=n([`${r}-popover-shared`,b?.value&&`${r}-popover--rtl`,k?.themeClass.value,a.overlap&&`${r}-popover-shared--overlap`,a.showArrow&&`${r}-popover-shared--show-arrow`,a.arrowPointToCenter&&`${r}-popover-shared--center-arrow`],w,O.value,j,M);else{let{value:e}=S.extraClassRef,{internalTrapFocus:n}=a,l=!oe(s.header)||!oe(s.footer),u=()=>{let e=l?o(C,null,ne(s.header,e=>e?o(`div`,{class:[`${r}-popover__header`,a.headerClass],style:a.headerStyle},e):null),ne(s.default,e=>e?o(`div`,{class:[`${r}-popover__content`,a.contentClass],style:a.contentStyle},s):null),ne(s.footer,e=>e?o(`div`,{class:[`${r}-popover__footer`,a.footerClass],style:a.footerStyle},e):null)):a.scrollable?s.default?.call(s):o(`div`,{class:[`${r}-popover__content`,a.contentClass],style:a.contentStyle},s);return[a.scrollable?o(Fe,{themeOverrides:y.value.peerOverrides.Scrollbar,theme:y.value.peers.Scrollbar,contentClass:l?void 0:`${r}-popover__content ${a.contentClass??``}`,contentStyle:l?void 0:a.contentStyle},{default:()=>e}):e,a.showArrow?Jr({arrowClass:a.arrowClass,arrowStyle:a.arrowStyle,arrowWrapperClass:a.arrowWrapperClass,arrowWrapperStyle:a.arrowWrapperStyle,clsPrefix:r}):null]};t=o(`div`,i({class:[`${r}-popover`,`${r}-popover-shared`,b?.value&&`${r}-popover--rtl`,k?.themeClass.value,e.map(e=>`${r}-${e}`),{[`${r}-popover--scrollable`]:a.scrollable,[`${r}-popover--show-header-or-footer`]:l,[`${r}-popover--raw`]:a.raw,[`${r}-popover-shared--overlap`]:a.overlap,[`${r}-popover-shared--show-arrow`]:a.showArrow,[`${r}-popover-shared--center-arrow`]:a.arrowPointToCenter}],ref:w,style:O.value,onKeydown:S.handleKeydown,onMouseenter:j,onMouseleave:M},c),n?o(zt,{active:a.show,autoFocus:!0},{default:u}):u())}return e(t,D.value)}return{displayed:E,namespace:l,isMounted:S.isMountedRef,zIndex:S.zIndexRef,followerRef:x,adjustedTo:V(a),followerEnabled:T,renderContentNode:ae}},render(){return o(Nt,{ref:`followerRef`,zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width===`trigger`?`target`:void 0,teleportDisabled:this.adjustedTo===V.tdkey},{default:()=>this.animated?o(h,{name:`popover-transition`,appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)==null||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),Xr=Object.keys(qr),Zr={focus:[`onFocus`,`onBlur`],click:[`onClick`],hover:[`onMouseenter`,`onMouseleave`],manual:[],nested:[`onFocus`,`onBlur`,`onMouseenter`,`onMouseleave`,`onClick`]};function Qr(e,t,n){Zr[t].forEach(t=>{e.props?e.props=Object.assign({},e.props):e.props={};let r=e.props[t],i=n[t];r?e.props[t]=(...e)=>{r(...e),i(...e)}:e.props[t]=i})}var $r={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:`hover`},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:`top`},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:`if`},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:V.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},ei=v({name:`Popover`,inheritAttrs:!1,props:Object.assign(Object.assign(Object.assign({},de.props),$r),{internalOnAfterLeave:Function,internalRenderBody:Function}),slots:Object,__popover__:!0,setup(e){let n=w(),i=m(null),a=t(()=>e.show),o=m(e.defaultShow),s=Pe(a,o),c=F(()=>e.disabled?!1:s.value),l=()=>{if(e.disabled)return!0;let{getDisabled:t}=e;return!!t?.()},u=()=>l()?!1:s.value,d=Re(e,[`arrow`,`showArrow`]),p=t(()=>e.overlap?!1:d.value),h=null,_=m(null),v=m(null),y=F(()=>e.x!==void 0&&e.y!==void 0);function b(t){let{"onUpdate:show":n,onUpdateShow:r,onShow:i,onHide:a}=e;o.value=t,n&&Se(n,t),r&&Se(r,t),t&&i&&Se(i,!0),t&&a&&Se(a,!1)}function x(){h&&h.syncPosition()}function S(){let{value:e}=_;e&&(window.clearTimeout(e),_.value=null)}function C(){let{value:e}=v;e&&(window.clearTimeout(e),v.value=null)}function T(){let t=l();if(e.trigger===`focus`&&!t){if(u())return;b(!0)}}function ee(){let t=l();if(e.trigger===`focus`&&!t){if(!u())return;b(!1)}}function E(){let t=l();if(e.trigger===`hover`&&!t){if(C(),_.value!==null||u())return;let t=()=>{b(!0),_.value=null},{delay:n}=e;n===0?t():_.value=window.setTimeout(t,n)}}function D(){let t=l();if(e.trigger===`hover`&&!t){if(S(),v.value!==null||!u())return;let t=()=>{b(!1),v.value=null},{duration:n}=e;n===0?t():v.value=window.setTimeout(t,n)}}function te(){D()}function O(t){var n;u()&&(e.trigger===`click`&&(S(),C(),b(!1)),(n=e.onClickoutside)==null||n.call(e,t))}function k(){e.trigger===`click`&&!l()&&(S(),C(),b(!u()))}function ne(t){e.internalTrapFocus&&t.key===`Escape`&&(S(),C(),b(!1))}function A(e){o.value=e}function j(){return i.value?.targetRef}function M(e){h=e}return r(`NPopover`,{getTriggerElement:j,handleKeydown:ne,handleMouseEnter:E,handleMouseLeave:D,handleClickOutside:O,handleMouseMoveOutside:te,setBodyInstance:M,positionManuallyRef:y,isMountedRef:n,zIndexRef:g(e,`zIndex`),extraClassRef:g(e,`internalExtraClass`),internalRenderBodyRef:g(e,`internalRenderBody`)}),f(()=>{s.value&&l()&&b(!1)}),{binderInstRef:i,positionManually:y,mergedShowConsideringDisabledProp:c,uncontrolledShow:o,mergedShowArrow:p,getMergedShow:u,setShow:A,handleClick:k,handleMouseEnter:E,handleMouseLeave:D,handleFocus:T,handleBlur:ee,syncPosition:x}},render(){let{positionManually:t,$slots:n}=this,r,i=!1;if(!t&&(r=Gt(n,`trigger`),r)){r=c(r),r=r.type===S?o(`span`,[r]):r;let e={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(r.type?.__popover__)i=!0,r.props||={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]},r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[e,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[e];else{let{internalInheritedEventHandlers:n}=this,i=[e,...n];Qr(r,n?`nested`:t?`manual`:this.trigger,{onBlur:e=>{i.forEach(t=>{t.onBlur(e)})},onFocus:e=>{i.forEach(t=>{t.onFocus(e)})},onClick:e=>{i.forEach(t=>{t.onClick(e)})},onMouseenter:e=>{i.forEach(t=>{t.onMouseenter(e)})},onMouseleave:e=>{i.forEach(t=>{t.onMouseleave(e)})}})}}return o(dt,{ref:`binderInstRef`,syncTarget:!i,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;let n=this.getMergedShow();return[this.internalTrapFocus&&n?e(o(`div`,{style:{position:`fixed`,top:0,right:0,bottom:0,left:0}}),[[_t,{enabled:n,zIndex:this.zIndex}]]):null,t?null:o(ft,null,{default:()=>r}),o(Yr,qt(this.$props,Xr,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:n})),{default:()=>{var e;return(e=this.$slots).default?.call(e)},header:()=>{var e;return(e=this.$slots).header?.call(e)},footer:()=>{var e;return(e=this.$slots).footer?.call(e)}})]}})}});export{Ue as A,$e as C,Je as D,Ye as E,Ge as O,et as S,Xe as T,ft as _,mn as a,tt as b,J as c,Nt as d,bt as f,mt as g,_t as h,Wr as i,He as j,Ke as k,Ht as l,vt as m,$r as n,qt as o,K as p,Jr as r,Kt as s,ei as t,zt as u,dt as v,Ze as w,Qe as x,V as y};
|