karin-plugin-kkk 2.45.1-beta.2 → 2.45.1-beta.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [2.45.1-beta.3](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.45.1-beta.2...v2.45.1-beta.3) (2026-10-16)
6
+
7
+
8
+ ### ✨ 新功能
9
+
10
+ * **xiaohongshu:** 添加子评论请求数量配置,支持动态拉取小红书子评论 ([39f96b4](https://github.com/ikenxuan/karin-plugin-kkk/commit/39f96b4ff4012c08d50ba1a0872d1e887c668a6c))
11
+
5
12
  ## [2.45.1-beta.2](https://github.com/ikenxuan/karin-plugin-kkk/compare/v2.45.1-beta.1...v2.45.1-beta.2) (2026-10-15)
6
13
 
7
14
 
@@ -168,6 +168,7 @@
168
168
  "image"
169
169
  ],
170
170
  "numcomment": 10,
171
+ "subCommentLimit": 2,
171
172
  "videoQuality": "4k",
172
173
  "maxAutoVideoSize": 1000,
173
174
  "loginPerm": "master"
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "2.45.1-beta.2",
3
- "buildTime": "2026-10-15T15:58:50.688Z",
4
- "buildTimestamp": 1792079930688,
2
+ "version": "2.45.1-beta.3",
3
+ "buildTime": "2026-10-16T15:33:36.385Z",
4
+ "buildTimestamp": 1792164816385,
5
5
  "name": "karin-plugin-kkk",
6
6
  "description": "Karin 的「抖音」「B 站」视频解析/动态推送插件",
7
7
  "homepage": "https://github.com/ikenxuan/karin-plugin-kkk",
8
- "commitHash": "58a61933782f72400c52c9a838572fa5eedf6d74",
9
- "shortCommitHash": "58a61933"
8
+ "commitHash": "96f2fb735c6a9a7f1d15d6fac453ba4851b2f918",
9
+ "shortCommitHash": "96f2fb73"
10
10
  }
@@ -38788,15 +38788,27 @@ var xiaohongshuLogin = async (e) => {
38788
38788
  };
38789
38789
  //#endregion
38790
38790
  //#region src/platform/xiaohongshu/comments.ts
38791
+ /** 一次最多同时打几条一级评论的子评论请求 */
38792
+ var SUB_COMMENT_BATCH = 5;
38791
38793
  /**
38792
38794
  * 处理小红书评论数据。
38793
38795
  *
38794
38796
  * 这里直接输出结构化评论 JSON,正文部分使用 richtext 文档,避免后端拼接 HTML。
38797
+ *
38798
+ * 配了 ck 且 `subCommentLimit > 2` 时,会对带子评论的一级评论逐条请求子评论接口
38799
+ * (见 {@link shouldFetchSubComments}),取回后与响应自带的预览合并去重;
38800
+ * 否则完全用预览,一个额外请求都不发。
38795
38801
  */
38796
- var xiaohongshuComments = (data, emojiData) => {
38802
+ var xiaohongshuComments = async (data, emojiData, note) => {
38797
38803
  const rawComments = data?.data?.comments;
38798
38804
  if (!Array.isArray(rawComments) || rawComments.length === 0) return [];
38799
- return rawComments.map((comment) => {
38805
+ const ordered = [...rawComments].sort((a, b) => Number(normalizeTagNames(b.show_tags).includes("user_top")) - Number(normalizeTagNames(a.show_tags).includes("user_top"))).slice(0, Config.xiaohongshu.numcomment);
38806
+ const fetchEnabled = shouldFetchSubComments();
38807
+ const topLevelIds = new Set(ordered.map((comment) => comment.id));
38808
+ const comments = [];
38809
+ for (let index = 0; index < ordered.length; index += SUB_COMMENT_BATCH) comments.push(...await Promise.all(ordered.slice(index, index + SUB_COMMENT_BATCH).map(async (comment) => {
38810
+ const preview = Array.isArray(comment.sub_comments) ? comment.sub_comments : [];
38811
+ const fetched = fetchEnabled ? await fetchSubComments(comment, note) : [];
38800
38812
  const showTags = normalizeTagNames(comment.show_tags);
38801
38813
  return {
38802
38814
  id: comment.id,
@@ -38809,12 +38821,65 @@ var xiaohongshuComments = (data, emojiData) => {
38809
38821
  liked: comment.liked,
38810
38822
  pictures: Array.isArray(comment.pictures) ? comment.pictures : [],
38811
38823
  sub_comment_count: comment.sub_comment_count,
38812
- sub_comments: buildXiaohongshuSubComments(comment.sub_comments, emojiData),
38824
+ sub_comments: buildXiaohongshuSubComments(mergeSubComments(preview, fetched, topLevelIds), emojiData),
38813
38825
  show_tags: showTags,
38814
38826
  at_users: normalizeAtUsers(comment.at_users).map((item) => item.text),
38815
38827
  status: comment.status
38816
38828
  };
38817
- }).sort((a, b) => Number(b.show_tags.includes("user_top")) - Number(a.show_tags.includes("user_top"))).slice(0, Config.xiaohongshu.numcomment);
38829
+ })));
38830
+ return comments;
38831
+ };
38832
+ /**
38833
+ * 要不要请求子评论接口。两个条件缺一不可:
38834
+ *
38835
+ * 1. **配了小红书 ck** —— 平台不允许游客拿二级评论,没 ck 请求必然失败;
38836
+ * 2. **`subCommentLimit > 2`** —— 一级评论响应自带的预览就是每条最多 2 条,
38837
+ * 配置 ≤ 2 时请求回来也不会多出任何东西,默认值 2 即「不请求」。
38838
+ */
38839
+ var shouldFetchSubComments = () => Config.xiaohongshu.subCommentLimit > 2 && Config.amagi.cookies.xiaohongshu.trim() !== "";
38840
+ /**
38841
+ * 取一条一级评论下的子评论(楼中楼)。
38842
+ *
38843
+ * 失败只吞掉这一条并记 debug —— 评论图是尽力而为的展示,一条楼中楼取不到
38844
+ * 不该带崩整张图。本来就没有子评论的(`sub_comment_count` 为 0)直接跳过。
38845
+ * @param comment - 一级评论
38846
+ * @param note - 笔记定位信息
38847
+ * @returns 接口取回的子评论;失败或没有子评论时为空数组
38848
+ */
38849
+ var fetchSubComments = async (comment, note) => {
38850
+ if (Number(comment.sub_comment_count) <= 0) return [];
38851
+ try {
38852
+ const fetched = (await xiaohongshuFetcher.fetchSubComments({
38853
+ note_id: note.note_id,
38854
+ root_comment_id: comment.id,
38855
+ xsec_token: note.xsec_token,
38856
+ number: Config.xiaohongshu.subCommentLimit
38857
+ })).data?.data?.comments;
38858
+ return Array.isArray(fetched) ? fetched : [];
38859
+ } catch (error) {
38860
+ logger$1.debug(`[xiaohongshu] 取子评论失败(${comment.id}): ${error}`);
38861
+ return [];
38862
+ }
38863
+ };
38864
+ /**
38865
+ * 合并预览与接口取回的子评论:**预览在前,新增的追加在后**。
38866
+ *
38867
+ * 两类重复按 id 排除:① 同一条一级评论自带的那几条预览;② 一级评论列表里出现过的 id
38868
+ * —— 楼中楼偶尔会把同一条评论也挂在顶层,两处都渲染就成了重复条目。
38869
+ * @param preview - 一级评论响应自带的子评论
38870
+ * @param fetched - 子评论接口取回的列表
38871
+ * @param topLevelIds - 本次渲染的一级评论 id 集合
38872
+ * @returns 去重后的子评论列表
38873
+ */
38874
+ var mergeSubComments = (preview, fetched, topLevelIds) => {
38875
+ const seen = /* @__PURE__ */ new Set([...topLevelIds, ...preview.map((item) => item.id)]);
38876
+ const merged = [...preview];
38877
+ for (const item of fetched) {
38878
+ if (!item?.id || seen.has(item.id)) continue;
38879
+ seen.add(item.id);
38880
+ merged.push(item);
38881
+ }
38882
+ return merged;
38818
38883
  };
38819
38884
  var buildXiaohongshuSubComments = (subComments, emojiData) => {
38820
38885
  if (!Array.isArray(subComments)) return [];
@@ -38981,7 +39046,10 @@ var Xiaohongshu = class extends Base {
38981
39046
  const CommentData = await this.fetchConfiguredNoteComments(data);
38982
39047
  if (!CommentData.data.comments || CommentData.data.comments.length === 0) await this.e.reply("这个笔记没有评论 ~");
38983
39048
  else {
38984
- const processedComments = xiaohongshuComments(CommentData, formattedEmojis);
39049
+ const processedComments = await xiaohongshuComments(CommentData, formattedEmojis, {
39050
+ note_id: data.note_id,
39051
+ xsec_token: data.xsec_token
39052
+ });
38985
39053
  const commentListImg = await Render(this.e, "xiaohongshu/comment", {
38986
39054
  Type: NoteData.data.data.items[0].note_card.video ? "视频" : "图文",
38987
39055
  CommentsData: processedComments,
@@ -1 +1 @@
1
- import{t as e}from"./separator-BQ8-sWCU.js";import{$ as t,A as n,At as r,B as i,Bt as a,C as o,Ct as s,D as c,Dt as l,Et as u,F as d,Ft as f,G as p,H as m,Ht as h,I as g,It as _,J as v,K as y,L as b,Lt as x,M as S,Mt as C,N as w,Nt as T,Ot as E,P as D,Pt as O,Q as k,Rt as A,S as j,St as M,T as N,Tt as ee,U as P,Ut as F,V as I,Vt as L,W as te,X as R,Y as z,Z as ne,_ as re,_t as ie,at as ae,b as B,bt as oe,ct as se,dt as ce,et as le,f as ue,ft as de,gt as fe,h as pe,ht as me,it as he,j as ge,jt as V,k as _e,kt as ve,lt as ye,m as H,mt as be,nt as xe,o as Se,ot as Ce,p as U,pt as we,q as Te,rt as Ee,st as De,tt as Oe,ut as ke,v as W,vt as Ae,w as je,wt as G,x as K,xt as Me,y as Ne,zt as Pe}from"./index-DBbIxsmd.js";var Fe=oe({base:`header`}),Ie=oe({defaultVariants:{fullWidth:!1,variant:`primary`},slots:{base:`number-field`,decrementButton:`number-field__decrement-button`,group:`number-field__group`,incrementButton:`number-field__increment-button`,input:`number-field__input`},variants:{fullWidth:{false:{},true:{base:`number-field--full-width`,group:`number-field__group--full-width`}},variant:{primary:{base:`number-field--primary`},secondary:{base:`number-field--secondary`}}}}),Le=oe({base:`radio-group`,defaultVariants:{variant:`primary`},variants:{variant:{primary:`radio-group--primary`,secondary:`radio-group--secondary`}}}),Re=oe({slots:{base:`radio`,content:`radio__content`,control:`radio__control`,indicator:`radio__indicator`}}),ze=RegExp(`^.*\\(.*\\).*$`),Be=[`latn`,`arab`,`hanidec`,`deva`,`beng`,`fullwide`],Ve=class{constructor(e,t={}){this.locale=e,this.options=t}parse(e){return Ue(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return Ue(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return Ue(this.locale,this.options,e).options.numberingSystem}},He=new Map;function Ue(e,t,n){let r=We(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of Be)if(i!==r.options.numberingSystem){let r=We(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function We(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``),r=He.get(n);return r||(r=new Ge(e,t),He.set(n,r)),r}var Ge=class{constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits??=t.maximumFractionDigits),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=Je(e,this.formatter,this.options,t),this.options.style===`percent`&&((this.options.minimumFractionDigits??0)>18||(this.options.maximumFractionDigits??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}parse(e){let t=this.formatter.resolvedOptions().useGrouping,n=this.sanitize(e);if(!t&&this.symbols.group&&n.includes(this.symbols.group))return NaN;if(this.symbols.group&&(n=n.replaceAll(this.symbols.group,``)),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,`.`)),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,`-`)),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style===`percent`){let e=n.indexOf(`-`);n=n.replace(`-`,``),n=n.replace(`+`,``);let t=n.indexOf(`.`);t===-1&&(t=n.length),n=n.replace(`.`,``),n=t-2==0?`0.${n}`:t-2==-1?`0.0${n}`:t-2==-2?`0.00`:`${n.slice(0,t-2)}.${n.slice(t-2)}`,e>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style===`percent`){let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min((this.options.minimumFractionDigits??0)+2,20),maximumFractionDigits:Math.min((this.options.maximumFractionDigits??0)+2,20)};return new Ve(this.locale,e).parse(new ye(this.locale,e).format(r))}return this.options.currencySign===`accounting`&&ze.test(e)&&(r=-1*r),r}sanitize(e){let t=this.formatter.resolvedOptions().useGrouping;return this.symbols.noNumeralUnits.length>0&&this.symbols.noNumeralUnits.find(t=>t.unit===e)?this.symbols.noNumeralUnits.find(t=>t.unit===e).value.toString():(e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=q(e,`,`,this.symbols.decimal),e=q(e,`،`,this.symbols.decimal)),this.symbols.group&&t&&(e=q(e,`.`,this.symbols.group))),this.symbols.group===`’`&&e.includes(`'`)&&t&&(e=q(e,`'`,this.symbols.group)),this.symbols.group===`'`&&e.includes(`’`)&&t&&(e=q(e,`’`,this.symbols.group)),this.options.locale===`fr-FR`&&this.symbols.group&&t&&(e=q(e,` `,this.symbols.group),e=q(e,/\u00A0/g,this.symbols.group)),e)}isValidPartialNumber(e,t=-1/0,n=1/0){let r=this.formatter.resolvedOptions().useGrouping;return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&r&&(e=q(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}},Ke=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),qe=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function Je(e,t,n,r){let i=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`,useGrouping:!0}),a=i.formatToParts(-10000.111),o=i.formatToParts(10000.111),s=qe.map(e=>i.formatToParts(e)),c=s.map((e,t)=>{let n=e.find(e=>e.type===`unit`);return n&&!e.some(e=>e.type===`integer`||e.type===`fraction`)?{unit:n.value,value:qe[t]}:null}).filter(e=>!!e),l=a.find(e=>e.type===`minusSign`)?.value??`-`,u=o.find(e=>e.type===`plusSign`)?.value;!u&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(u=`+`);let d=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(e=>e.type===`decimal`)?.value,f=a.find(e=>e.type===`group`)?.value,p=a.filter(e=>!Ke.has(e.type)).map(e=>Ye(e.value)),m=s.flatMap(e=>e.filter(e=>!Ke.has(e.type)).map(e=>Ye(e.value))),h=[...new Set([...p,...m])].sort((e,t)=>t.length-e.length),g=h.length===0?RegExp(`\\p{White_Space}|\\p{Cf}`,`gu`):RegExp(`${h.join(`|`)}|\\p{White_Space}|\\p{Cf}`,`gu`),_=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),v=new Map(_.map((e,t)=>[e,t])),y=RegExp(`[${_.join(``)}]`,`g`);return{minusSign:l,plusSign:u,decimal:d,group:f,literals:g,numeral:y,numerals:_,index:e=>String(v.get(e)),noNumeralUnits:c}}function q(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function Ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var J=F(h(),1);function Xe(){return typeof window<`u`&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges==`function`}function Ze(e,t,n){let r=l(e=>{let r=n.current;if(!r)return;let i=null;switch(e.inputType){case`historyUndo`:case`historyRedo`:return;case`insertLineBreak`:return;case`deleteContent`:case`deleteByCut`:case`deleteByDrag`:i=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentForward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentBackward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:i=r.value.slice(r.selectionStart);break;default:e.data!=null&&(i=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}(i==null||!t.validate(i))&&e.preventDefault()});(0,J.useEffect)(()=>{if(!Xe()||!n.current)return;let e=n.current;return e.addEventListener(`beforeinput`,r,!1),()=>{e.removeEventListener(`beforeinput`,r,!1)}},[n]);let i=Xe()?null:e=>{let n=O(e).value.slice(0,O(e).selectionStart)+e.data+O(e).value.slice(O(e).selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:a,inputProps:o,descriptionProps:s,errorMessageProps:c,...u}=j(e,n),d=(0,J.useRef)(null);return{inputProps:V(o,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;d.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:i}=d.current;n.current.value=e,n.current.setSelectionRange(r,i),t.setInputValue(e)}}}),labelProps:a,descriptionProps:s,errorMessageProps:c,...u}}function Qe(e,t){let{onScroll:n,isDisabled:r}=e,i=(0,J.useCallback)(e=>{e.ctrlKey||(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);u(t,`wheel`,r?void 0:i)}var $e={};$e={Empty:`فارغ`};var et={};et={Empty:`Изпразни`};var tt={};tt={Empty:`Prázdné`};var nt={};nt={Empty:`Tom`};var rt={};rt={Empty:`Leer`};var it={};it={Empty:`Άδειο`};var at={};at={Empty:`Empty`};var ot={};ot={Empty:`Vacío`};var st={};st={Empty:`Tühjenda`};var ct={};ct={Empty:`Tyhjä`};var lt={};lt={Empty:`Vide`};var ut={};ut={Empty:`ריק`};var dt={};dt={Empty:`Prazno`};var ft={};ft={Empty:`Üres`};var pt={};pt={Empty:`Vuoto`};var mt={};mt={Empty:`空`};var ht={};ht={Empty:`비어 있음`};var gt={};gt={Empty:`Tuščias`};var _t={};_t={Empty:`Tukšs`};var vt={};vt={Empty:`Tom`};var yt={};yt={Empty:`Leeg`};var bt={};bt={Empty:`Pusty`};var xt={};xt={Empty:`Vazio`};var St={};St={Empty:`Vazio`};var Ct={};Ct={Empty:`Gol`};var wt={};wt={Empty:`Не заполнено`};var Tt={};Tt={Empty:`Prázdne`};var Et={};Et={Empty:`Prazen`};var Dt={};Dt={Empty:`Prazno`};var Ot={};Ot={Empty:`Tomt`};var kt={};kt={Empty:`Boş`};var At={};At={Empty:`Пусто`};var jt={};jt={Empty:`空`};var Mt={};Mt={Empty:`空白`};var Nt={};Nt={"ar-AE":$e,"bg-BG":et,"cs-CZ":tt,"da-DK":nt,"de-DE":rt,"el-GR":it,"en-US":at,"es-ES":ot,"et-EE":st,"fi-FI":ct,"fr-FR":lt,"he-IL":ut,"hr-HR":dt,"hu-HU":ft,"it-IT":pt,"ja-JP":mt,"ko-KR":ht,"lt-LT":gt,"lv-LV":_t,"nb-NO":vt,"nl-NL":yt,"pl-PL":bt,"pt-BR":xt,"pt-PT":St,"ro-RO":Ct,"ru-RU":wt,"sk-SK":Tt,"sl-SI":Et,"sr-SP":Dt,"sv-SE":Ot,"tr-TR":kt,"uk-UA":At,"zh-CN":jt,"zh-TW":Mt};function Pt(e){return e&&e.__esModule?e.default:e}var Ft=()=>{};function It(e){let t=(0,J.useRef)(void 0),{value:n,textValue:r,minValue:i,maxValue:a,isDisabled:o,isReadOnly:s,isRequired:c,onIncrement:u,onIncrementPage:d,onDecrement:f,onDecrementPage:p,onDecrementToMin:m,onIncrementToMax:h}=e,g=te(Pt(Nt),`@react-aria/spinbutton`),_=(0,J.useRef)(!1),v=(0,J.useCallback)(()=>{clearTimeout(t.current),_.current=!1},[]),y=l(()=>{v()});(0,J.useEffect)(()=>()=>y(),[]);let{keyboardProps:b}=he({isDisabled:o||s,shortcuts:{PageUp:()=>{if(d){d();return}if(u){u();return}return!1},ArrowUp:()=>{if(u){u();return}return!1},PageDown:()=>{if(p){p();return}if(f){f();return}return!1},ArrowDown:()=>{if(f){f();return}return!1},Home:()=>{if(m){m();return}return!1},End:()=>{if(h){h();return}return!1}},allowRepeats:!0}),x=(0,J.useRef)(!1),S=()=>{x.current=!0},C=()=>{x.current=!1},w=r===``?g.format(`Empty`):(r||`${n}`).replace(`-`,`−`);(0,J.useEffect)(()=>{x.current&&(De(`assertive`),Ce(w,`assertive`))},[w]);let T=(0,J.useCallback)(()=>{v()},[v]),E=l(u??Ft),D=l(f??Ft),O=l(()=>{(a===void 0||isNaN(a)||n===void 0||isNaN(n)||n<a)&&(E(),k(60))}),k=l(e=>{y(),_.current=!0,t.current=window.setTimeout(O,e)}),A=l(()=>{(i===void 0||isNaN(i)||n===void 0||isNaN(n)||n>i)&&(D(),j(60))}),j=l(e=>{y(),_.current=!0,t.current=window.setTimeout(A,e)}),M=e=>{e.preventDefault()},{addGlobalListener:N,removeAllGlobalListeners:ee}=ve(),P=(0,J.useRef)(!1),[F,I]=(0,J.useState)(null);(0,J.useEffect)(()=>{F===`touch`?k(600):F?k(400):F||y()},[F]);let[L,R]=(0,J.useState)(null);return(0,J.useEffect)(()=>{L===`touch`?j(600):L?j(400):L||y()},[L]),{spinButtonProps:{role:`spinbutton`,"aria-valuenow":n!==void 0&&!isNaN(n)?n:void 0,"aria-valuetext":w,"aria-valuemin":i,"aria-valuemax":a,"aria-disabled":o||void 0,"aria-readonly":s||void 0,"aria-required":c||void 0,...b,onFocus:S,onBlur:C},incrementButtonProps:{onPressStart:e=>{v(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),P.current=!1,I(`touch`)):(u?.(),I(`mouse`)),N(window,`contextmenu`,M)},onPressUp:e=>{v(),e.pointerType===`touch`&&(P.current=!0),ee(),I(null)},onPressEnd:e=>{v(),e.pointerType===`touch`&&!_.current&&P.current&&u?.(),P.current=!1,I(null)},onFocus:S,onBlur:C},decrementButtonProps:{onPressStart:e=>{v(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),P.current=!1,R(`touch`)):(f?.(),R(`mouse`))},onPressUp:e=>{v(),e.pointerType===`touch`&&(P.current=!0),ee(),R(null)},onPressEnd:e=>{v(),e.pointerType===`touch`&&!_.current&&P.current&&f?.(),P.current=!1,R(null)},onFocus:S,onBlur:C}}}var Lt={};Lt={decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:`حقل رقمي`};var Rt={};Rt={decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:`Номер на полето`};var zt={};zt={decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:`Číselné pole`};var Bt={};Bt={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:`Talfelt`};var Vt={};Vt={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:`Nummernfeld`};var Ht={};Ht={decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:`Πεδίο αριθμού`};var Ut={};Ut={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:`Number field`};var Wt={};Wt={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var Gt={};Gt={decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:`Numbri väli`};var Kt={};Kt={decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:`Numerokenttä`};var qt={};qt={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:`Champ de nombre`};var Jt={};Jt={decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:`שדה מספר`};var Yt={};Yt={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var Xt={};Xt={decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:`Számmező`};var Zt={};Zt={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:`Campo numero`};var Qt={};Qt={decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:`数値フィールド`};var $t={};$t={decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:`번호 필드`};var en={};en={decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:`Numerio laukas`};var tn={};tn={decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:`Skaitļu lauks`};var nn={};nn={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:`Tallfelt`};var rn={};rn={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:`Getalveld`};var an={};an={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:`Pole numeru`};var on={};on={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var sn={};sn={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo numérico`};var cn={};cn={decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:`Câmp numeric`};var ln={};ln={decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:`Числовое поле`};var un={};un={decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:`Číselné pole`};var dn={};dn={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:`Številčno polje`};var fn={};fn={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var pn={};pn={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:`Nummerfält`};var mn={};mn={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:`Sayı alanı`};var hn={};hn={decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:`Поле номера`};var gn={};gn={decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:`数字字段`};var _n={};_n={decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:`數字欄位`};var vn={};vn={"ar-AE":Lt,"bg-BG":Rt,"cs-CZ":zt,"da-DK":Bt,"de-DE":Vt,"el-GR":Ht,"en-US":Ut,"es-ES":Wt,"et-EE":Gt,"fi-FI":Kt,"fr-FR":qt,"he-IL":Jt,"hr-HR":Yt,"hu-HU":Xt,"it-IT":Zt,"ja-JP":Qt,"ko-KR":$t,"lt-LT":en,"lv-LV":tn,"nb-NO":nn,"nl-NL":rn,"pl-PL":an,"pt-BR":on,"pt-PT":sn,"ro-RO":cn,"ru-RU":ln,"sk-SK":un,"sl-SI":dn,"sr-SP":fn,"sv-SE":pn,"tr-TR":mn,"uk-UA":hn,"zh-CN":gn,"zh-TW":_n};var yn=F(L(),1);function bn(e){return e&&e.__esModule?e.default:e}function xn(e,t,n){let{id:i,decrementAriaLabel:o,incrementAriaLabel:s,isDisabled:c,isReadOnly:l,isRequired:u,minValue:d,maxValue:f,autoFocus:p,label:m,formatOptions:h,onBlur:g=()=>{},onFocus:v,onFocusChange:y,onKeyDown:b,onKeyUp:x,description:C,errorMessage:w,isWheelDisabled:E,...D}=e,{increment:k,incrementToMax:j,decrement:M,decrementToMin:N,numberValue:P,inputValue:F,commit:I,commitValidation:L}=t,R=te(bn(vn),`@react-aria/numberfield`),z=(0,J.useCallback)(()=>{let e=n.current?.value??``;(0,yn.flushSync)(()=>{I()}),n.current?.value!==e&&Ce(n.current?.value??``,`assertive`)},[I,n]),ne=_(i),{focusProps:re}=ae({onBlur(){z()}}),ie=se(h),B=(0,J.useMemo)(()=>ie.resolvedOptions(),[ie]),oe=se({...h,currencySign:void 0}),{spinButtonProps:ce,incrementButtonProps:le,decrementButtonProps:ue}=It({isDisabled:c,isReadOnly:l,isRequired:u,maxValue:f,minValue:d,onIncrement:k,onIncrementToMax:j,onDecrement:M,onDecrementToMin:N,value:P,textValue:(0,J.useMemo)(()=>isNaN(P)?``:oe.format(P),[oe,P])}),[de,fe]=(0,J.useState)(!1),{focusWithinProps:pe}=Oe({isDisabled:c,onFocusWithinChange:fe});Qe({onScroll:(0,J.useCallback)(e=>{Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.deltaY>0?k():e.deltaY<0&&M())},[M,k]),isDisabled:E||c||l||!de},n);let me=(B.maximumFractionDigits??0)>0,ge=t.minValue===void 0||isNaN(t.minValue)||t.minValue<0,_e=`numeric`;A()?ge?_e=`text`:me&&(_e=`decimal`):Pe()&&(ge?_e=`numeric`:me&&(_e=`decimal`));let ve=e=>{t.validate(e)&&t.setInputValue(e)},ye=t=>{e.onPaste?.(t);let n=O(t);n&&(n.selectionEnd??-1)-(n.selectionStart??0)===n.value.length&&(t.preventDefault(),I(t.clipboardData?.getData?.(`text/plain`)?.trim()??``))},H=r(e),{keyboardProps:be}=he({isDisabled:c||l,shortcuts:{Enter:()=>((0,yn.flushSync)(()=>{I()}),L(),{shouldPreventDefault:!1})},onKeyDown:b,onKeyUp:x}),{isInvalid:xe,validationErrors:Se,validationDetails:U}=t.displayValidation,{labelProps:we,inputProps:Te,descriptionProps:Ee,errorMessageProps:De}=Ze({...D,...H,name:void 0,form:void 0,label:m,autoFocus:p,isDisabled:c,isReadOnly:l,isRequired:u,validate:void 0,[S]:t,value:F,defaultValue:`!`,autoComplete:`off`,"aria-label":e[`aria-label`]||void 0,"aria-labelledby":e[`aria-labelledby`]||void 0,id:ne,type:`text`,inputMode:_e,onChange:ve,onBlur:g,onFocus:v,onFocusChange:y,onPaste:ye,description:C,errorMessage:w},t,n),ke=V(be,Te);ee(n,t.defaultNumberValue,t.setNumberValue),Sn(t,e.validationBehavior,e.commitBehavior,n,t.minValue,t.maxValue,e.step,t.numberValue);let W=V(ce,re,ke,{role:null,"aria-roledescription":a()?null:R.format(`numberField`),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:`off`,spellCheck:`false`});e.validationBehavior===`native`&&(W[`aria-required`]=void 0);let Ae=e=>{T()!==n.current&&(e.pointerType===`mouse`?n.current?.focus():e.target.focus())},je=e[`aria-label`]||(typeof e.label==`string`?e.label:``),G;je||(G=e.label==null?e[`aria-labelledby`]:we.id);let K=_(),Me=_(),Ne=V(le,{"aria-label":s||R.format(`increase`,{fieldLabel:je}).trim(),id:G&&!s?K:null,"aria-labelledby":G&&!s?`${K} ${G}`:null,"aria-controls":ne,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:Ae}),Fe=V(ue,{"aria-label":o||R.format(`decrease`,{fieldLabel:je}).trim(),id:G&&!o?Me:null,"aria-labelledby":G&&!o?`${Me} ${G}`:null,"aria-controls":ne,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:Ae});return{groupProps:{...pe,role:`group`,"aria-disabled":c,"aria-invalid":xe?`true`:void 0},labelProps:we,inputProps:W,incrementButtonProps:Ne,decrementButtonProps:Fe,errorMessageProps:De,descriptionProps:Ee,isInvalid:xe,validationErrors:Se,validationDetails:U}}var Y=null;function Sn(e,t,n,r,i,a,o,s){x(()=>{let c=r.current;if(n!==`validate`||e.realtimeValidation.isInvalid||!c||c.disabled||(!Y&&typeof document<`u`&&(Y=document.createElement(`input`),Y.type=`number`),!Y))return;Y.min=i!=null&&!isNaN(i)?String(i):``,Y.max=a!=null&&!isNaN(a)?String(a):``,Y.step=o!=null&&!isNaN(o)?String(o):``,Y.value=s!=null&&!isNaN(s)?String(s):``;let l=c.validity.valid&&Y.validity.valid,u=c.validationMessage||Y.validationMessage,d={isInvalid:!l,validationErrors:u?[u]:[],validationDetails:{badInput:c.validity.badInput,customError:c.validity.customError,patternMismatch:c.validity.patternMismatch,rangeOverflow:Y.validity.rangeOverflow,rangeUnderflow:Y.validity.rangeUnderflow,stepMismatch:Y.validity.stepMismatch,tooLong:c.validity.tooLong,tooShort:c.validity.tooShort,typeMismatch:c.validity.typeMismatch,valueMissing:c.validity.valueMissing,valid:l}};e.updateValidation(d),t===`native`&&!Y.validity.valid&&c.setCustomValidity(Y.validationMessage)})}function Cn(e){let{minValue:t,maxValue:n,step:r,formatOptions:i,value:a,defaultValue:o=NaN,onChange:c,locale:l,isDisabled:u,isReadOnly:d,commitBehavior:f=`snap`}=e;a===null&&(a=NaN);let p=(0,J.useCallback)(e=>r===void 0||isNaN(r)?s(e,t,n):G(e,t,n,r),[r,t,n]);a!==void 0&&!isNaN(a)&&f===`snap`&&(a=p(a)),!isNaN(o)&&f===`snap`&&(o=p(o));let[m,h]=R(a,isNaN(o)?NaN:o,c),[g]=(0,J.useState)(m),[_,v]=(0,J.useState)(()=>isNaN(m)?``:new ye(l,i).format(m)),y=(0,J.useMemo)(()=>new Ve(l,i),[l,i]),b=(0,J.useMemo)(()=>y.getNumberingSystem(_),[y,_]),x=(0,J.useMemo)(()=>new ye(l,{...i,numberingSystem:b}),[l,i,b]),S=(0,J.useMemo)(()=>x.resolvedOptions(),[x]),C=(0,J.useCallback)(e=>isNaN(e)||e===null?``:x.format(e),[x]),T=w({...e,value:m}),E=r!==void 0&&!isNaN(r)?r:1;S.style===`percent`&&(r===void 0||isNaN(r))&&(E=.01);let[D,O]=(0,J.useState)(m),[k,A]=(0,J.useState)(l),[j,M]=(0,J.useState)(i);(!Object.is(m,D)||l!==k||!wn(i,j))&&(v(C(m)),O(m),A(l),M(i));let N=(0,J.useMemo)(()=>y.parse(_),[y,_]),ee=e=>{let t=e===void 0?_:e,n=N;if(e!==void 0&&(n=y.parse(t)),!t.length){h(NaN),v(a===void 0?``:C(m));return}if(isNaN(n)){v(C(m));return}let r=f===`snap`?p(n):n;r=y.parse(C(r));let i=r!==m;h(r),v(C(a===void 0?r:m)),i&&T.commitValidation()},P=(e,r=0)=>{let i=N;if(isNaN(i))return G(isNaN(r)?0:r,t,n,E);{let r=G(i,t,n,E);return e===`+`&&r>i||e===`-`&&r<i?r:G(Tn(e,i,E),t,n,E)}},F=()=>{let e=P(`+`,t);e===m&&v(C(e)),h(e),T.commitValidation()},I=()=>{let e=P(`-`,n);e===m&&v(C(e)),h(e),T.commitValidation()},L=()=>{n!=null&&(h(G(n,t,n,E)),T.commitValidation())},te=()=>{t!=null&&(h(t),T.commitValidation())},z=(0,J.useMemo)(()=>!u&&!d&&(isNaN(N)||n===void 0||isNaN(n)||G(N,t,n,E)>N||Tn(`+`,N,E)<=n),[u,d,t,n,E,N]),ne=(0,J.useMemo)(()=>!u&&!d&&(isNaN(N)||t===void 0||isNaN(t)||G(N,t,n,E)<N||Tn(`-`,N,E)>=t),[u,d,t,n,E,N]),re=e=>y.isValidPartialNumber(e,t,n);return{...T,validate:re,increment:F,incrementToMax:L,decrement:I,decrementToMin:te,canIncrement:z,canDecrement:ne,minValue:t,maxValue:n,numberValue:N,defaultNumberValue:isNaN(o)?g:o,setNumberValue:h,setInputValue:v,inputValue:_,commit:ee}}function wn(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function Tn(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var En=(0,J.createContext)(null),Dn=(0,J.createContext)(null),On=(0,J.forwardRef)(function(e,t){[e,t]=we(e,t,En);let{validationBehavior:n}=Ae(ge)||{},i=e.validationBehavior??n??`native`,{locale:a}=ke(),s=Cn({...e,locale:a,validationBehavior:i}),c=(0,J.useRef)(null),[l,u]=me(!e[`aria-label`]&&!e[`aria-labelledby`]),{labelProps:d,groupProps:f,inputProps:p,incrementButtonProps:m,decrementButtonProps:h,descriptionProps:_,errorMessageProps:v,...y}=xn({...ie(e),label:u,validationBehavior:i},s,c),x=be({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:y.isInvalid||!1,isRequired:e.isRequired||!1,isReadOnly:e.isReadOnly||!1},defaultClassName:`react-aria-NumberField`}),S=r(e,{global:!0});return delete S.id,J.createElement(de,{values:[[Dn,s],[g,f],[o,{...p,ref:c}],[ce,{...d,ref:l}],[ne,{slots:{increment:m,decrement:h}}],[b,{slots:{description:_,errorMessage:v}}],[D,y]]},J.createElement(fe.div,{...S,...x,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":y.isInvalid||void 0}),e.name&&J.createElement(`input`,{type:`hidden`,name:e.name,form:e.form,value:isNaN(s.numberValue)?``:s.numberValue,disabled:e.isDisabled||void 0}))}),kn=new WeakMap;function An(e,t,n){let{value:i,children:a,"aria-label":o,"aria-labelledby":s,onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p}=e,m=e.isDisabled||t.isDisabled,h=t.selectedValue===i,g=e=>{e.stopPropagation(),t.setSelectedValue(i)},{pressProps:_,isPressed:v}=xe({onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p,isDisabled:m}),{pressProps:y,isPressed:b}=xe({onPressStart:c,onPressEnd:l,onPressChange:u,onPressUp:f,onClick:p,isDisabled:m,onPress(e){d?.(e),t.setSelectedValue(i),n.current?.focus()}}),{focusableProps:x}=Ee(V(e,{onFocus:()=>t.setLastFocusedValue(i)}),n),S=V(_,x),C=r(e,{labelable:!0}),w=-1;t.selectedValue==null?(t.lastFocusedValue===i||t.lastFocusedValue==null)&&(w=0):t.selectedValue===i&&(w=0),m&&(w=void 0);let{name:T,form:E,descriptionId:D,errorMessageId:O,validationBehavior:k}=kn.get(t);ee(n,t.defaultSelectedValue,t.setSelectedValue),_e({validationBehavior:k},t,n);let A=N();return{labelProps:V(y,(0,J.useMemo)(()=>({onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault()}),[])),inputProps:V(C,{...S,type:`radio`,name:T,form:E,tabIndex:w,disabled:m,required:t.isRequired&&k===`native`,checked:h,value:i,onChange:g,"aria-describedby":[e[`aria-describedby`],A.id,t.isInvalid?O:null,D].filter(Boolean).join(` `)||void 0}),descriptionProps:A,isDisabled:m,isSelected:h,isPressed:v||b}}function jn(e,t){let{name:i,form:a,isReadOnly:o,isRequired:s,isDisabled:c,orientation:l=`vertical`,validationBehavior:u=`aria`}=e,{direction:d}=ke(),{isInvalid:m,validationErrors:h,validationDetails:g}=t.displayValidation,{labelProps:v,fieldProps:y,descriptionProps:b,errorMessageProps:x}=n({...e,labelElementType:`span`,isInvalid:t.isInvalid,errorMessage:e.errorMessage||h}),S=r(e,{labelable:!0}),{focusWithinProps:C}=Oe({onBlurWithin(n){e.onBlur?.(n),t.selectedValue||t.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});function w(e,n){let r=p(n.currentTarget,{from:O(n),accept:e=>e instanceof f(e).HTMLInputElement&&e.type===`radio`}),i;return e===`next`?(i=r.nextNode(),i||=(r.currentNode=n.currentTarget,r.firstChild())):(i=r.previousNode(),i||=(r.currentNode=n.currentTarget,r.lastChild())),i?(i.focus(),t.setSelectedValue(i.value),!0):!1}let{keyboardProps:T}=he({shortcuts:{ArrowRight:e=>w(d===`rtl`&&l!==`vertical`?`prev`:`next`,e),ArrowLeft:e=>w(d===`rtl`&&l!==`vertical`?`next`:`prev`,e),ArrowDown:e=>w(`next`,e),ArrowUp:e=>w(`prev`,e)},allowRepeats:!0}),E=_(i);return kn.set(t,{name:E,form:a,descriptionId:b.id,errorMessageId:x.id,validationBehavior:u}),{radioGroupProps:V(S,{role:`radiogroup`,...T,"aria-invalid":t.isInvalid||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-readonly":o||void 0,"aria-required":s||void 0,"aria-disabled":c||void 0,"aria-orientation":l,...y,...C}),labelProps:v,descriptionProps:b,errorMessageProps:x,isInvalid:m,validationErrors:h,validationDetails:g}}var Mn=Math.round(Math.random()*1e10),Nn=0;function Pn(e){let t=(0,J.useMemo)(()=>e.name||`radio-group-${Mn}-${++Nn}`,[e.name]),[n,r]=R(e.value,e.defaultValue??null,e.onChange),[i]=(0,J.useState)(n),[a,o]=(0,J.useState)(null),s=w({...e,value:n}),c=t=>{!e.isReadOnly&&!e.isDisabled&&(r(t),s.commitValidation())},l=s.displayValidation.isInvalid;return{...s,name:t,selectedValue:n,defaultSelectedValue:e.value===void 0?e.defaultValue??null:i,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,validationState:e.validationState||(l?`invalid`:null),isInvalid:l}}var Fn=(0,J.createContext)(null),In=(0,J.createContext)(null),Ln=(0,J.createContext)(null),Rn=(0,J.forwardRef)(function(e,t){[e,t]=we(e,t,Fn);let{validationBehavior:n}=Ae(ge)||{},i=e.validationBehavior??n??`native`,a=Pn({...e,validationBehavior:i}),[o,s]=me(!e[`aria-label`]&&!e[`aria-labelledby`]),{radioGroupProps:c,labelProps:l,descriptionProps:u,errorMessageProps:d,...f}=jn({...e,label:s,validationBehavior:i},a),p=be({...e,values:{orientation:e.orientation||`vertical`,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isRequired:a.isRequired,isInvalid:a.isInvalid,state:a},defaultClassName:`react-aria-RadioGroup`}),m=r(e,{global:!0});return J.createElement(fe.div,{...V(m,p,c),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`vertical`,"data-invalid":a.isInvalid||void 0,"data-disabled":a.isDisabled||void 0,"data-readonly":a.isReadOnly||void 0,"data-required":a.isRequired||void 0},J.createElement(de,{values:[[Ln,a],[ce,{...l,ref:o,elementType:`span`}],[b,{slots:{description:u,errorMessage:d}}],[D,f]]},J.createElement(I,null,p.children)))}),zn=(0,J.createContext)(null),Bn=(0,J.forwardRef)(function(e,t){let{inputRef:n=null,...a}=e;[e,t]=we(a,t,In);let o=J.useContext(Ln),s=E((0,J.useMemo)(()=>C(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),c=An({...ie(e),children:typeof e.children==`function`||e.children},o,s),{descriptionProps:l,isSelected:u,isDisabled:d}=c,f=be({...e,defaultClassName:`react-aria-RadioField`,values:{isSelected:u,isDisabled:d,isReadOnly:o.isReadOnly,isInvalid:o.isInvalid,isRequired:o.isRequired}}),p=r(e,{global:!0});return delete p.id,delete p.onClick,J.createElement(fe.div,{...V(p,f),ref:t,"data-selected":u||void 0,"data-disabled":d||void 0,"data-readonly":o.isReadOnly||void 0,"data-invalid":o.isInvalid||void 0,"data-required":o.isRequired||void 0},J.createElement(de,{values:[[i,{isSelected:u}],[zn,{...c,inputRef:s,defaultClassName:`react-aria-RadioButton`}],[b,{slots:{description:l}}]]},f.children))}),Vn=(0,J.forwardRef)(function(e,n){let{labelProps:i,inputProps:a,isSelected:o,isDisabled:s,isPressed:c,defaultClassName:l,inputRef:u}=(0,J.useContext)(zn),d=J.useContext(Ln),{isFocused:f,isFocusVisible:p,focusProps:m}=le(),h=s||d.isReadOnly,{hoverProps:g,isHovered:_}=t({...e,isDisabled:h}),v=be({...e,defaultClassName:l,values:{isSelected:o,isPressed:c,isHovered:_,isFocused:f,isFocusVisible:p,isDisabled:s,isReadOnly:d.isReadOnly,isInvalid:d.isInvalid,isRequired:d.isRequired}}),y=r(e,{global:!0});return delete y.id,delete y.onClick,J.createElement(fe.label,{...V(y,i,g,v),ref:n,"data-selected":o||void 0,"data-pressed":c||void 0,"data-hovered":_||void 0,"data-focused":f||void 0,"data-focus-visible":p||void 0,"data-disabled":s||void 0,"data-readonly":d.isReadOnly||void 0,"data-invalid":d.isInvalid||void 0,"data-required":d.isRequired||void 0},J.createElement(P,{elementType:`span`},J.createElement(`input`,{...V(a,m),ref:u})),v.children)}),X=M(),Hn=({children:e,className:t,...n})=>(0,X.jsx)(m,{className:Fe({className:t}),"data-slot":`header`,...n,children:e}),Un=(0,J.createContext)({}),Wn=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=J.useMemo(()=>Ie({fullWidth:n,variant:r}),[n,r]),o=J.useMemo(()=>({slots:a}),[a]);return(0,X.jsx)(Un,{value:o,children:(0,X.jsx)(On,{"data-slot":`number-field`,...i,className:z(t,a?.base()),children:t=>(0,X.jsx)(X.Fragment,{children:typeof e==`function`?e(t):e})})})},Z=Object.assign(Wn,{Root:Wn,Group:({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Un);return(0,X.jsx)(d,{className:z(t,r?.group()),"data-slot":`number-field-group`,...n,children:t=>(0,X.jsx)(X.Fragment,{children:typeof e==`function`?e(t):e})})},Input:({className:e,...t})=>{let{slots:n}=(0,J.use)(Un);return(0,X.jsx)(je,{className:z(e,n?.input()),"data-slot":`number-field-input`,...t})},IncrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Un);return(0,X.jsx)(k,{className:z(t,r?.incrementButton()),"data-slot":`number-field-increment-button`,slot:`increment`,...n,children:e&&J.isValidElement(e)?e:(0,X.jsx)(Te,{"data-slot":`number-field-increment-button-icon`})})},DecrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Un);return(0,X.jsx)(k,{className:z(t,r?.decrementButton()),"data-slot":`number-field-decrement-button`,slot:`decrement`,...n,children:e&&J.isValidElement(e)?e:(0,X.jsx)(y,{"data-slot":`number-field-decrement-button-icon`})})}}),Gn={elementType:`span`},Kn=(0,J.createContext)({}),qn=({children:e,className:t,...n})=>{let r=J.useMemo(()=>Re(),[]);return(0,X.jsx)(Bn,{"data-slot":`radio`,...n,className:z(t,r.base()),children:t=>(0,X.jsx)(Kn,{value:{slots:r,state:t},children:typeof e==`function`?e(t):e})})};qn.displayName=`HeroUI.Radio`;var Jn=({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Kn);return(0,X.jsx)(Vn,{"data-slot":`radio-content`,...n,className:z(t,r?.content()),children:t=>(0,X.jsx)(ce,{value:Gn,children:typeof e==`function`?e(t):e})})};Jn.displayName=`HeroUI.Radio.Content`;var Yn=({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Kn);return(0,X.jsx)(Me.span,{className:v(r?.control,t),"data-slot":`radio-control`,...n,children:e})};Yn.displayName=`HeroUI.Radio.Control`;var Xn=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,J.use)(Kn),a=typeof e==`function`?e(i??{}):e;return(0,X.jsx)(Me.span,{"aria-hidden":`true`,className:v(r?.indicator,t),"data-slot":`radio-indicator`,...n,children:a})};Xn.displayName=`HeroUI.Radio.Indicator`;var Q=Object.assign(qn,{Root:qn,Content:Jn,Control:Yn,Indicator:Xn}),Zn=({children:e,className:t,variant:n,...r})=>{let i=J.useMemo(()=>Le({variant:n}),[n]);return(0,X.jsx)(Rn,{"data-slot":`radio-group`,...r,className:z(t,i),children:t=>(0,X.jsx)(X.Fragment,{children:typeof e==`function`?e(t):e})})},Qn=Object.assign(Zn,{Root:Zn}),$n={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};$n.node;var er=Se($n),tr=`*/10 * * * *`,nr=[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],rr=[{title:`高频检查`,presets:[{id:`every5`,label:`每 5 分钟`,description:`更频繁地检查推送,适合更新很密集的账号。`,value:`*/5 * * * *`},{id:`every10`,label:`每 10 分钟`,description:`推荐:全天每 10 分钟检查一次推送。`,value:`*/10 * * * *`},{id:`every15`,label:`每 15 分钟`,description:`兼顾及时性和任务频率,适合大多数推送。`,value:`*/15 * * * *`},{id:`every30`,label:`每 30 分钟`,description:`检查频率较低,适合不太活跃的推送。`,value:`*/30 * * * *`}]},{title:`按小时轮询`,presets:[{id:`hourly`,label:`每小时一次`,description:`每个整点执行,例如 00:00、01:00。`,value:`0 * * * *`},{id:`every2Hours`,label:`每 2 小时`,description:`从 0 点开始,每隔 2 小时执行一次。`,value:`0 */2 * * *`},{id:`every3Hours`,label:`每 3 小时`,description:`从 0 点开始,每隔 3 小时执行一次。`,value:`0 */3 * * *`},{id:`every6Hours`,label:`每 6 小时`,description:`每天 0 点、6 点、12 点、18 点执行。`,value:`0 */6 * * *`}]},{title:`每天固定时间`,presets:[{id:`daily8`,label:`每天上午 8 点`,description:`每天早上固定执行一次。`,value:`0 8 * * *`},{id:`daily9`,label:`每天上午 9 点`,description:`每天固定执行一次。`,value:`0 9 * * *`},{id:`daily12`,label:`每天中午 12 点`,description:`每天午间固定执行一次。`,value:`0 12 * * *`},{id:`daily18`,label:`每天晚上 6 点`,description:`每天傍晚固定执行一次。`,value:`0 18 * * *`},{id:`daily20`,label:`每天晚上 8 点`,description:`适合晚间集中推送。`,value:`0 20 * * *`},{id:`daily22`,label:`每天晚上 10 点`,description:`每天夜间固定执行一次。`,value:`0 22 * * *`}]},{title:`每天多次`,presets:[{id:`daily9And20`,label:`每天 9 点和 20 点`,description:`每天早晚各执行一次。`,value:`0 9,20 * * *`},{id:`daily9And12And18`,label:`每天 9 点、12 点、18 点`,description:`每天早中晚各执行一次。`,value:`0 9,12,18 * * *`}]},{title:`按星期`,presets:[{id:`weekday9`,label:`工作日上午 9 点`,description:`只在周一到周五执行。`,value:`0 9 * * 1,2,3,4,5`},{id:`weekday18`,label:`工作日晚上 6 点`,description:`只在周一到周五的傍晚执行。`,value:`0 18 * * 1,2,3,4,5`},{id:`weekend10`,label:`周末上午 10 点`,description:`只在周六和周日执行。`,value:`0 10 * * 0,6`},{id:`friday20`,label:`每周五晚上 8 点`,description:`每周五固定执行一次。`,value:`0 20 * * 5`}]}],ir=rr.flatMap(e=>e.presets),ar={minuteType:`interval`,minuteInterval:10,specificMinutes:[],hourType:`every`,hourInterval:1,specificHours:[],dayType:`every`,dayInterval:1,specificDays:[],weekType:`every`,specificWeeks:[]},or=e=>String(e).padStart(2,`0`),sr=(e,t,n,r)=>Number.isFinite(e)?Math.min(n,Math.max(t,Math.trunc(e))):r,$=(e,t,n)=>Array.from(new Set(e.filter(e=>Number.isInteger(e)&&e>=t&&e<=n))).sort((e,t)=>e-t),cr=(e,t,n)=>$(e.split(`,`).map(e=>Number(e.trim())).filter(e=>Number.isFinite(e)),t,n),lr=e=>$(e.split(`,`).map(e=>{let t=Number(e.trim());return t===7?0:t}).filter(e=>Number.isFinite(e)),0,6),ur=(e,t,n,r)=>{if(e===`*`||e===`*/1`)return{type:`every`,interval:r,specific:[]};let i=e.match(/^\*\/(\d+)$/);if(i){let e=sr(Number(i[1]),1,n,r);return e<=1?{type:`every`,interval:r,specific:[]}:{type:`interval`,interval:e,specific:[]}}let a=cr(e,t,n);return a.length>0?{type:`specific`,interval:r,specific:a}:{type:`every`,interval:r,specific:[]}},dr=e=>{let t=(e||tr).trim().split(/\s+/);if(t.length!==5)return{...ar};let[n,r,i,,a]=t,o=ur(n,0,59,10),s=ur(r,0,23,1),c=ur(i,1,31,1),l=a===`*`?[]:lr(a),u=l.length>0;return{minuteType:o.type,minuteInterval:o.interval,specificMinutes:o.specific,hourType:s.type,hourInterval:s.interval,specificHours:s.specific,dayType:u?`every`:c.type,dayInterval:u?1:c.interval,specificDays:u?[]:c.specific,weekType:u?`specific`:`every`,specificWeeks:l}},fr=e=>{let t=`*`,n=`*`,r=`*`,i=`*`;switch(e.minuteType){case`every`:t=`*`;break;case`interval`:t=e.minuteInterval<=1?`*`:`*/${e.minuteInterval}`;break;case`specific`:t=e.specificMinutes.length>0?$(e.specificMinutes,0,59).join(`,`):`0`}switch(e.hourType){case`every`:n=`*`;break;case`interval`:n=e.hourInterval<=1?`*`:`*/${e.hourInterval}`;break;case`specific`:n=e.specificHours.length>0?$(e.specificHours,0,23).join(`,`):`0`}switch(e.dayType){case`every`:r=`*`;break;case`interval`:r=e.dayInterval<=1?`*`:`*/${e.dayInterval}`;break;case`specific`:r=e.specificDays.length>0?$(e.specificDays,1,31).join(`,`):`1`}return e.weekType===`specific`&&(i=e.specificWeeks.length>0?$(e.specificWeeks,0,6).join(`,`):`*`),`${t} ${n} ${r} * ${i}`},pr=e=>{let t=(e||tr).trim().replace(/\s+/g,` `);return ir.find(e=>e.value===t)?.id??null},mr=e=>e.join(`、`),hr=e=>e.map(e=>`${e} 点`).join(`、`),gr=e=>{if(e.weekType===`specific`&&e.specificWeeks.length>0){let t=$(e.specificWeeks,0,6);return t.length===5&&t.every(e=>[1,2,3,4,5].includes(e))?`工作日`:t.length===2&&t.every(e=>[0,6].includes(e))?`周末`:`每${t.map(e=>nr[e]).join(`、`)}`}return e.dayType===`interval`&&e.dayInterval>1?`每隔 ${e.dayInterval} 天`:e.dayType===`specific`&&e.specificDays.length>0?`每月 ${mr($(e.specificDays,1,31))} 号`:`每天`},_r=e=>e.minuteType===`every`?`每分钟`:e.minuteType===`interval`?e.minuteInterval<=1?`每分钟`:`每 ${e.minuteInterval} 分钟`:`第 ${mr(e.specificMinutes.length>0?$(e.specificMinutes,0,59):[0])} 分钟`,vr=e=>{let t=_r(e);if(e.hourType===`every`||e.hourType===`interval`&&e.hourInterval<=1)return e.minuteType===`specific`?`每小时的${t}`:`全天${t}`;if(e.hourType===`specific`){let n=e.specificHours.length>0?$(e.specificHours,0,23):[0];return e.minuteType===`specific`?`在 ${hr(n)} 的${t}`:`在 ${hr(n)} 内${t}`}return e.minuteType===`specific`?`从 0 点开始每隔 ${e.hourInterval} 小时,在${t}`:`从 0 点开始每隔 ${e.hourInterval} 小时,该小时内${t}`},yr=e=>{let t=gr(e),n=vr(e);return`${t},${t===`每天`?n.replace(/^全天/,``):n}执行`},br=e=>yr(dr(e)),xr=e=>{if(e.minuteType===`every`)return Array.from({length:60},(e,t)=>t);if(e.minuteType===`interval`){let t=Math.max(1,e.minuteInterval);return Array.from({length:Math.ceil(60/t)},(e,n)=>n*t).filter(e=>e<=59)}return e.specificMinutes.length>0?$(e.specificMinutes,0,59):[0]},Sr=e=>{if(e.hourType===`every`)return Array.from({length:24},(e,t)=>t);if(e.hourType===`interval`){let t=Math.max(1,e.hourInterval);return Array.from({length:Math.ceil(24/t)},(e,n)=>n*t).filter(e=>e<=23)}return e.specificHours.length>0?$(e.specificHours,0,23):[0]},Cr=e=>{let t=[],n=Sr(e),r=xr(e);for(let e of n)for(let n of r)if(t.push(`${or(e)}:${or(n)}`),t.length>=6)return t;return t},wr=e=>{let t=Cr(e).join(`、`);return`${e.dayType===`every`&&e.weekType===`every`?`一天内示例`:`符合日期时,一天内示例`}:${t}`},Tr=({value:t,onChange:n,disabled:r=!1,device:i=`desktop`})=>{let[a,o]=(0,J.useState)(!1),[s,l]=(0,J.useState)(`quick`),[u,d]=(0,J.useState)(pr(t)),[f,p]=(0,J.useState)(`interval`),[m,h]=(0,J.useState)(10),[g,_]=(0,J.useState)([]),[v,y]=(0,J.useState)(`every`),[b,x]=(0,J.useState)(1),[S,C]=(0,J.useState)([]),[w,T]=(0,J.useState)(`every`),[E,D]=(0,J.useState)(1),[O,k]=(0,J.useState)([]),[A,j]=(0,J.useState)(`every`),[M,N]=(0,J.useState)([]),ee=e=>{p(e.minuteType),h(e.minuteInterval),_(e.specificMinutes),y(e.hourType),x(e.hourInterval),C(e.specificHours),T(e.dayType),D(e.dayInterval),k(e.specificDays),j(e.weekType),N(e.specificWeeks)},P=()=>({minuteType:f,minuteInterval:m,specificMinutes:g,hourType:v,hourInterval:b,specificHours:S,dayType:w,dayInterval:E,specificDays:O,weekType:A,specificWeeks:M});(0,J.useEffect)(()=>{if(!a)return;let e=dr(t||tr);ee(e),d(pr(fr(e))),l(`quick`)},[t,a]);let F=()=>fr(P()),I=()=>yr(P()),L=()=>wr(P()),te=()=>xr({...P(),minuteType:`interval`,minuteInterval:m}).slice(0,5).join(`、`),R=()=>Sr({...P(),hourType:`interval`,hourInterval:b}).slice(0,5).map(e=>`${e} 点`).join(`、`),z=()=>{n(F()),o(!1)},ne=e=>{let t=dr(e.value);ee(t),d(e.id)},ie=e=>{if(e===null||Array.isArray(e))return;let t=ir.find(t=>t.id===String(e));t&&ne(t)},ae=e=>{d(null),p(e)},oe=e=>{d(null),y(e)},se=e=>{d(null),T(e),e!==`every`&&(j(`every`),N([]))},ce=e=>{d(null),j(e),e!==`every`&&(T(`every`),D(1),k([]))},le=()=>(0,X.jsxs)(`div`,{className:`min-w-0 space-y-4 overflow-x-hidden`,children:[(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(W,{className:`block text-base font-semibold`,children:`常用规则`}),(0,X.jsx)(K,{className:`block leading-relaxed`,children:`不用理解 Cron,直接选一个最接近的执行时间,再看下方预览确认。`})]}),(0,X.jsxs)(pe,{fullWidth:!0,variant:`secondary`,placeholder:`选择常用执行规则`,value:u??``,onChange:ie,children:[(0,X.jsx)(W,{children:`执行规则`}),(0,X.jsxs)(pe.Trigger,{children:[(0,X.jsx)(pe.Value,{}),(0,X.jsx)(pe.Indicator,{})]}),(0,X.jsx)(pe.Popover,{children:(0,X.jsx)(re,{children:rr.map((t,n)=>(0,X.jsxs)(J.Fragment,{children:[n>0?(0,X.jsx)(e,{}):null,(0,X.jsxs)(re.Section,{children:[(0,X.jsx)(Hn,{children:t.title}),t.presets.map(e=>(0,X.jsxs)(re.Item,{id:e.id,textValue:e.label,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(W,{children:e.label}),(0,X.jsx)(K,{children:e.description})]}),(0,X.jsx)(re.ItemIndicator,{})]},e.id))]})]},t.title))})})]})]}),(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`需要更细的规则?`}),(0,X.jsx)(c,{size:`sm`,variant:`secondary`,onPress:()=>l(`minute`),children:`转到高级`})]})})]}),de=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`分钟类型`,variant:`secondary`,value:f,onChange:e=>ae(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`每个小时里,哪些分钟执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`例如选“每 10 分钟”,就是 00、10、20、30、40、50 分执行。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`每分钟`]}),(0,X.jsx)(K,{children:`该小时里的每一分钟都执行,频率最高。`})]}),(0,X.jsxs)(Q,{value:`interval`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`间隔执行`]}),(0,X.jsx)(K,{children:`从第 0 分钟开始,按固定分钟数重复。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定分钟`]}),(0,X.jsx)(K,{children:`只在你点选的分钟执行,适合“整点”或“半点”。`})]})]})]})}),f===`interval`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`间隔设置`}),(0,X.jsxs)(Z,{variant:`secondary`,minValue:1,maxValue:59,value:m,onChange:e=>{d(null),h(sr(e,1,59,10))},children:[(0,X.jsx)(W,{children:`间隔(分钟)`}),(0,X.jsxs)(Z.Group,{children:[(0,X.jsx)(Z.DecrementButton,{}),(0,X.jsx)(Z.Input,{className:`w-24`}),(0,X.jsx)(Z.IncrementButton,{})]}),(0,X.jsx)(K,{children:m<=1?`等价于每分钟执行。`:`每个小时的 ${te()} 分执行。`})]})]}),f===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择分钟`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择要执行的分钟数,可多选。选 0 就是整点执行。`})]}),(0,X.jsx)(`div`,{className:`grid max-h-80 grid-cols-5 gap-2 overflow-y-auto p-1 md:grid-cols-10`,children:Array.from({length:60},(e,t)=>t).map(e=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:g.includes(e)?`primary`:`secondary`,onPress:()=>{d(null),_(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))},children:e},e))}),g.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,g.length,` 个:`,g.join(`, `)]})]})]}),fe=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`小时类型`,variant:`secondary`,value:v,onChange:e=>oe(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`一天里,哪些小时允许执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`如果选择“全部小时”,分钟页的规则会全天生效。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`全部小时`]}),(0,X.jsx)(K,{children:`不限制小时。例如分钟为每 10 分钟时,就是全天每 10 分钟。`})]}),(0,X.jsxs)(Q,{value:`interval`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`间隔执行`]}),(0,X.jsx)(K,{children:`从 0 点开始,每隔几个小时开放一次执行时段。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定小时`]}),(0,X.jsx)(K,{children:`只在你点选的小时内执行。`})]})]})]})}),v===`interval`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`间隔设置`}),(0,X.jsxs)(Z,{variant:`secondary`,minValue:1,maxValue:23,value:b,onChange:e=>{d(null),x(sr(e,1,23,1))},children:[(0,X.jsx)(W,{children:`间隔(小时)`}),(0,X.jsxs)(Z.Group,{children:[(0,X.jsx)(Z.DecrementButton,{}),(0,X.jsx)(Z.Input,{className:`w-24`}),(0,X.jsx)(Z.IncrementButton,{})]}),(0,X.jsx)(K,{children:b<=1?`间隔 1 小时等价于全部小时,保存时会自动写成 *。`:`只在 ${R()} 这些小时内执行。`})]})]}),v===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择小时`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择允许执行的小时,可多选。具体分钟仍由“分钟”页决定。`})]}),(0,X.jsx)(`div`,{className:`grid max-h-80 grid-cols-4 gap-2 overflow-y-auto p-1 md:grid-cols-6`,children:Array.from({length:24},(e,t)=>t).map(e=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:S.includes(e)?`primary`:`secondary`,onPress:()=>{d(null),C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))},children:e},e))}),S.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,S.length,` 个:`,S.map(e=>`${e}点`).join(`, `)]})]})]}),me=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`日期类型`,variant:`secondary`,value:w,onChange:e=>se(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`一个月里,哪些日期允许执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`日期和星期只保留一个条件。选择日期后,会自动清空星期条件。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`全部日期`]}),(0,X.jsx)(K,{children:`不限制几号执行。`})]}),(0,X.jsxs)(Q,{value:`interval`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`间隔执行`]}),(0,X.jsx)(K,{children:`从每月 1 号开始,每隔几天开放一次执行日期。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定日期`]}),(0,X.jsx)(K,{children:`只在你点选的几号执行。`})]})]})]})}),w===`interval`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`间隔设置`}),(0,X.jsxs)(Z,{variant:`secondary`,minValue:1,maxValue:31,value:E,onChange:e=>{d(null),D(sr(e,1,31,1)),j(`every`),N([])},children:[(0,X.jsx)(W,{children:`间隔(天)`}),(0,X.jsxs)(Z.Group,{children:[(0,X.jsx)(Z.DecrementButton,{}),(0,X.jsx)(Z.Input,{className:`w-24`}),(0,X.jsx)(Z.IncrementButton,{})]}),(0,X.jsx)(K,{children:E<=1?`间隔 1 天等价于全部日期,保存时会自动写成 *。`:`每月从 1 号开始,每隔 ${E} 天执行。`})]})]}),w===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择日期`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择允许执行的日期,可多选。月份没有这一天时会自动跳过。`})]}),(0,X.jsx)(`div`,{className:`grid max-h-80 grid-cols-5 gap-2 overflow-y-auto p-1 md:grid-cols-7`,children:Array.from({length:31},(e,t)=>t+1).map(e=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:O.includes(e)?`primary`:`secondary`,onPress:()=>{d(null),j(`every`),N([]),k(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))},children:e},e))}),O.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,O.length,` 个:`,O.map(e=>`${e}号`).join(`, `)]})]})]}),he=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`星期类型`,variant:`secondary`,value:A,onChange:e=>ce(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`一周里,哪些星期允许执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`日期和星期只保留一个条件。选择星期后,会自动清空日期条件。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`全部星期`]}),(0,X.jsx)(K,{children:`不限制星期几执行。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定星期`]}),(0,X.jsx)(K,{children:`只在你点选的星期执行。`})]})]})]})}),A===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择星期`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择允许执行的星期,可多选。具体时间仍由分钟和小时页决定。`})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-7 gap-2 p-1`,children:[`日`,`一`,`二`,`三`,`四`,`五`,`六`].map((e,t)=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:M.includes(t)?`primary`:`secondary`,onPress:()=>{d(null),T(`every`),D(1),k([]),N(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t].sort((e,t)=>e-t))},children:e},t))}),M.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,M.length,` 天:`,M.map(e=>`周${`日一二三四五六`[e]}`).join(`, `)]})]})]}),ge=i===`desktop`?`right`:`bottom`,V=br(t||tr);return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex gap-2 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsxs)(ue,{fullWidth:!0,isDisabled:!0,value:t,children:[(0,X.jsx)(W,{className:`sr-only`,children:`定时推送时间`}),(0,X.jsx)(Ne,{placeholder:`*/10 * * * *`,variant:`secondary`,"aria-label":`定时任务表达式`})]}),(0,X.jsxs)(c,{isDisabled:r,variant:`secondary`,onPress:()=>o(!0),children:[(0,X.jsx)(er,{className:`size-4`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:`编辑`})]})]}),(0,X.jsxs)(K,{children:[`当前规则:`,V]})]}),(0,X.jsx)(B.Backdrop,{isOpen:a,variant:`blur`,onOpenChange:o,children:(0,X.jsx)(B.Content,{placement:ge,children:(0,X.jsxs)(B.Dialog,{className:i===`desktop`?`h-full w-120 max-w-[90vw]`:`max-h-[85dvh]`,children:[(0,X.jsx)(B.Handle,{}),(0,X.jsx)(B.CloseTrigger,{}),(0,X.jsxs)(B.Header,{children:[(0,X.jsx)(B.Heading,{children:`定时推送时间`}),(0,X.jsx)(K,{children:`先选常用规则;需要精细控制时,再进入分钟、小时、日期、星期设置。`})]}),(0,X.jsxs)(B.Body,{className:`min-w-0 space-y-4 overflow-x-hidden`,children:[(0,X.jsxs)(U,{className:`min-w-0`,selectedKey:s,onSelectionChange:e=>l(e),children:[(0,X.jsx)(U.ListContainer,{children:(0,X.jsxs)(U.List,{children:[(0,X.jsxs)(U.Tab,{id:`quick`,children:[(0,X.jsx)(`span`,{children:`常用`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`minute`,children:[(0,X.jsx)(`span`,{children:`分钟`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`hour`,children:[(0,X.jsx)(`span`,{children:`小时`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`day`,children:[(0,X.jsx)(`span`,{children:`日期`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`week`,children:[(0,X.jsx)(`span`,{children:`星期`}),(0,X.jsx)(U.Indicator,{})]})]})}),(0,X.jsx)(`div`,{className:`h-1`}),(0,X.jsx)(U.Panel,{id:`quick`,className:`p-0`,children:le()}),(0,X.jsx)(U.Panel,{id:`minute`,className:`p-0`,children:de()}),(0,X.jsx)(U.Panel,{id:`hour`,className:`p-0`,children:fe()}),(0,X.jsx)(U.Panel,{id:`day`,className:`p-0`,children:me()}),(0,X.jsx)(U.Panel,{id:`week`,className:`p-0`,children:he()})]}),(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(W,{className:`text-sm font-medium text-muted`,children:`实际执行时间`}),(0,X.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed`,children:I()}),(0,X.jsx)(K,{className:`mt-1`,children:L()})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(W,{className:`text-sm font-medium text-muted`,children:`表达式`}),(0,X.jsx)(`code`,{className:`mt-1 block font-mono text-base font-semibold`,children:F()})]})]})})]}),(0,X.jsxs)(B.Footer,{children:[(0,X.jsx)(c,{className:`flex-1`,slot:`close`,variant:`tertiary`,children:`取消`}),(0,X.jsx)(c,{className:`flex-1`,variant:`primary`,onPress:z,children:`使用这个规则`})]})]})})})]})};export{Tr as default};
1
+ import{t as e}from"./separator-CFLVDixH.js";import{$ as t,A as n,At as r,B as i,Bt as a,C as o,Ct as s,D as c,Dt as l,Et as u,F as d,Ft as f,G as p,H as m,Ht as h,I as g,It as _,J as v,K as y,L as b,Lt as x,M as S,Mt as C,N as w,Nt as T,Ot as E,P as D,Pt as O,Q as k,Rt as A,S as j,St as M,T as N,Tt as ee,U as P,Ut as F,V as I,Vt as L,W as te,X as R,Y as z,Z as ne,_ as re,_t as ie,at as ae,b as B,bt as oe,ct as se,dt as ce,et as le,f as ue,ft as de,gt as fe,h as pe,ht as me,it as he,j as ge,jt as V,k as _e,kt as ve,lt as ye,m as H,mt as be,nt as xe,o as Se,ot as Ce,p as U,pt as we,q as Te,rt as Ee,st as De,tt as Oe,ut as ke,v as W,vt as Ae,w as je,wt as G,x as K,xt as Me,y as Ne,zt as Pe}from"./index-Zn_7piH-.js";var Fe=oe({base:`header`}),Ie=oe({defaultVariants:{fullWidth:!1,variant:`primary`},slots:{base:`number-field`,decrementButton:`number-field__decrement-button`,group:`number-field__group`,incrementButton:`number-field__increment-button`,input:`number-field__input`},variants:{fullWidth:{false:{},true:{base:`number-field--full-width`,group:`number-field__group--full-width`}},variant:{primary:{base:`number-field--primary`},secondary:{base:`number-field--secondary`}}}}),Le=oe({base:`radio-group`,defaultVariants:{variant:`primary`},variants:{variant:{primary:`radio-group--primary`,secondary:`radio-group--secondary`}}}),Re=oe({slots:{base:`radio`,content:`radio__content`,control:`radio__control`,indicator:`radio__indicator`}}),ze=RegExp(`^.*\\(.*\\).*$`),Be=[`latn`,`arab`,`hanidec`,`deva`,`beng`,`fullwide`],Ve=class{constructor(e,t={}){this.locale=e,this.options=t}parse(e){return Ue(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,n){return Ue(this.locale,this.options,e).isValidPartialNumber(e,t,n)}getNumberingSystem(e){return Ue(this.locale,this.options,e).options.numberingSystem}},He=new Map;function Ue(e,t,n){let r=We(e,t);if(!e.includes(`-nu-`)&&!r.isValidPartialNumber(n)){for(let i of Be)if(i!==r.options.numberingSystem){let r=We(e+(e.includes(`-u-`)?`-nu-`:`-u-nu-`)+i,t);if(r.isValidPartialNumber(n))return r}}return r}function We(e,t){let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``),r=He.get(n);return r||(r=new Ge(e,t),He.set(n,r)),r}var Ge=class{constructor(e,t={}){this.locale=e,t.roundingIncrement!==1&&t.roundingIncrement!=null&&(t.maximumFractionDigits==null&&t.minimumFractionDigits==null?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):t.maximumFractionDigits==null?t.maximumFractionDigits=t.minimumFractionDigits:t.minimumFractionDigits??=t.maximumFractionDigits),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=Je(e,this.formatter,this.options,t),this.options.style===`percent`&&((this.options.minimumFractionDigits??0)>18||(this.options.maximumFractionDigits??0)>18)&&console.warn(`NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.`)}parse(e){let t=this.formatter.resolvedOptions().useGrouping,n=this.sanitize(e);if(!t&&this.symbols.group&&n.includes(this.symbols.group))return NaN;if(this.symbols.group&&(n=n.replaceAll(this.symbols.group,``)),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,`.`)),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,`-`)),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style===`percent`){let e=n.indexOf(`-`);n=n.replace(`-`,``),n=n.replace(`+`,``);let t=n.indexOf(`.`);t===-1&&(t=n.length),n=n.replace(`.`,``),n=t-2==0?`0.${n}`:t-2==-1?`0.0${n}`:t-2==-2?`0.00`:`${n.slice(0,t-2)}.${n.slice(t-2)}`,e>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style===`percent`){let e={...this.options,style:`decimal`,minimumFractionDigits:Math.min((this.options.minimumFractionDigits??0)+2,20),maximumFractionDigits:Math.min((this.options.maximumFractionDigits??0)+2,20)};return new Ve(this.locale,e).parse(new ye(this.locale,e).format(r))}return this.options.currencySign===`accounting`&&ze.test(e)&&(r=-1*r),r}sanitize(e){let t=this.formatter.resolvedOptions().useGrouping;return this.symbols.noNumeralUnits.length>0&&this.symbols.noNumeralUnits.find(t=>t.unit===e)?this.symbols.noNumeralUnits.find(t=>t.unit===e).value.toString():(e=e.replace(this.symbols.literals,``),this.symbols.minusSign&&(e=e.replace(`-`,this.symbols.minusSign)),this.options.numberingSystem===`arab`&&(this.symbols.decimal&&(e=q(e,`,`,this.symbols.decimal),e=q(e,`،`,this.symbols.decimal)),this.symbols.group&&t&&(e=q(e,`.`,this.symbols.group))),this.symbols.group===`’`&&e.includes(`'`)&&t&&(e=q(e,`'`,this.symbols.group)),this.symbols.group===`'`&&e.includes(`’`)&&t&&(e=q(e,`’`,this.symbols.group)),this.options.locale===`fr-FR`&&this.symbols.group&&t&&(e=q(e,` `,this.symbols.group),e=q(e,/\u00A0/g,this.symbols.group)),e)}isValidPartialNumber(e,t=-1/0,n=1/0){let r=this.formatter.resolvedOptions().useGrouping;return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&t<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&r&&(e=q(e,this.symbols.group,``)),e=e.replace(this.symbols.numeral,``),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,``)),e.length===0)}},Ke=new Set([`decimal`,`fraction`,`integer`,`minusSign`,`plusSign`,`group`]),qe=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function Je(e,t,n,r){let i=new Intl.NumberFormat(e,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:`auto`,roundingMode:`halfExpand`,useGrouping:!0}),a=i.formatToParts(-10000.111),o=i.formatToParts(10000.111),s=qe.map(e=>i.formatToParts(e)),c=s.map((e,t)=>{let n=e.find(e=>e.type===`unit`);return n&&!e.some(e=>e.type===`integer`||e.type===`fraction`)?{unit:n.value,value:qe[t]}:null}).filter(e=>!!e),l=a.find(e=>e.type===`minusSign`)?.value??`-`,u=o.find(e=>e.type===`plusSign`)?.value;!u&&(r?.signDisplay===`exceptZero`||r?.signDisplay===`always`)&&(u=`+`);let d=new Intl.NumberFormat(e,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(e=>e.type===`decimal`)?.value,f=a.find(e=>e.type===`group`)?.value,p=a.filter(e=>!Ke.has(e.type)).map(e=>Ye(e.value)),m=s.flatMap(e=>e.filter(e=>!Ke.has(e.type)).map(e=>Ye(e.value))),h=[...new Set([...p,...m])].sort((e,t)=>t.length-e.length),g=h.length===0?RegExp(`\\p{White_Space}|\\p{Cf}`,`gu`):RegExp(`${h.join(`|`)}|\\p{White_Space}|\\p{Cf}`,`gu`),_=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),v=new Map(_.map((e,t)=>[e,t])),y=RegExp(`[${_.join(``)}]`,`g`);return{minusSign:l,plusSign:u,decimal:d,group:f,literals:g,numeral:y,numerals:_,index:e=>String(v.get(e)),noNumeralUnits:c}}function q(e,t,n){return e.replaceAll?e.replaceAll(t,n):e.split(t).join(n)}function Ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var J=F(h(),1);function Xe(){return typeof window<`u`&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges==`function`}function Ze(e,t,n){let r=l(e=>{let r=n.current;if(!r)return;let i=null;switch(e.inputType){case`historyUndo`:case`historyRedo`:return;case`insertLineBreak`:return;case`deleteContent`:case`deleteByCut`:case`deleteByDrag`:i=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentForward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteContentBackward`:i=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:i=r.value.slice(r.selectionStart);break;default:e.data!=null&&(i=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}(i==null||!t.validate(i))&&e.preventDefault()});(0,J.useEffect)(()=>{if(!Xe()||!n.current)return;let e=n.current;return e.addEventListener(`beforeinput`,r,!1),()=>{e.removeEventListener(`beforeinput`,r,!1)}},[n]);let i=Xe()?null:e=>{let n=O(e).value.slice(0,O(e).selectionStart)+e.data+O(e).value.slice(O(e).selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:a,inputProps:o,descriptionProps:s,errorMessageProps:c,...u}=j(e,n),d=(0,J.useRef)(null);return{inputProps:V(o,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;d.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:i}=d.current;n.current.value=e,n.current.setSelectionRange(r,i),t.setInputValue(e)}}}),labelProps:a,descriptionProps:s,errorMessageProps:c,...u}}function Qe(e,t){let{onScroll:n,isDisabled:r}=e,i=(0,J.useCallback)(e=>{e.ctrlKey||(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);u(t,`wheel`,r?void 0:i)}var $e={};$e={Empty:`فارغ`};var et={};et={Empty:`Изпразни`};var tt={};tt={Empty:`Prázdné`};var nt={};nt={Empty:`Tom`};var rt={};rt={Empty:`Leer`};var it={};it={Empty:`Άδειο`};var at={};at={Empty:`Empty`};var ot={};ot={Empty:`Vacío`};var st={};st={Empty:`Tühjenda`};var ct={};ct={Empty:`Tyhjä`};var lt={};lt={Empty:`Vide`};var ut={};ut={Empty:`ריק`};var dt={};dt={Empty:`Prazno`};var ft={};ft={Empty:`Üres`};var pt={};pt={Empty:`Vuoto`};var mt={};mt={Empty:`空`};var ht={};ht={Empty:`비어 있음`};var gt={};gt={Empty:`Tuščias`};var _t={};_t={Empty:`Tukšs`};var vt={};vt={Empty:`Tom`};var yt={};yt={Empty:`Leeg`};var bt={};bt={Empty:`Pusty`};var xt={};xt={Empty:`Vazio`};var St={};St={Empty:`Vazio`};var Ct={};Ct={Empty:`Gol`};var wt={};wt={Empty:`Не заполнено`};var Tt={};Tt={Empty:`Prázdne`};var Et={};Et={Empty:`Prazen`};var Dt={};Dt={Empty:`Prazno`};var Ot={};Ot={Empty:`Tomt`};var kt={};kt={Empty:`Boş`};var At={};At={Empty:`Пусто`};var jt={};jt={Empty:`空`};var Mt={};Mt={Empty:`空白`};var Nt={};Nt={"ar-AE":$e,"bg-BG":et,"cs-CZ":tt,"da-DK":nt,"de-DE":rt,"el-GR":it,"en-US":at,"es-ES":ot,"et-EE":st,"fi-FI":ct,"fr-FR":lt,"he-IL":ut,"hr-HR":dt,"hu-HU":ft,"it-IT":pt,"ja-JP":mt,"ko-KR":ht,"lt-LT":gt,"lv-LV":_t,"nb-NO":vt,"nl-NL":yt,"pl-PL":bt,"pt-BR":xt,"pt-PT":St,"ro-RO":Ct,"ru-RU":wt,"sk-SK":Tt,"sl-SI":Et,"sr-SP":Dt,"sv-SE":Ot,"tr-TR":kt,"uk-UA":At,"zh-CN":jt,"zh-TW":Mt};function Pt(e){return e&&e.__esModule?e.default:e}var Ft=()=>{};function It(e){let t=(0,J.useRef)(void 0),{value:n,textValue:r,minValue:i,maxValue:a,isDisabled:o,isReadOnly:s,isRequired:c,onIncrement:u,onIncrementPage:d,onDecrement:f,onDecrementPage:p,onDecrementToMin:m,onIncrementToMax:h}=e,g=te(Pt(Nt),`@react-aria/spinbutton`),_=(0,J.useRef)(!1),v=(0,J.useCallback)(()=>{clearTimeout(t.current),_.current=!1},[]),y=l(()=>{v()});(0,J.useEffect)(()=>()=>y(),[]);let{keyboardProps:b}=he({isDisabled:o||s,shortcuts:{PageUp:()=>{if(d){d();return}if(u){u();return}return!1},ArrowUp:()=>{if(u){u();return}return!1},PageDown:()=>{if(p){p();return}if(f){f();return}return!1},ArrowDown:()=>{if(f){f();return}return!1},Home:()=>{if(m){m();return}return!1},End:()=>{if(h){h();return}return!1}},allowRepeats:!0}),x=(0,J.useRef)(!1),S=()=>{x.current=!0},C=()=>{x.current=!1},w=r===``?g.format(`Empty`):(r||`${n}`).replace(`-`,`−`);(0,J.useEffect)(()=>{x.current&&(De(`assertive`),Ce(w,`assertive`))},[w]);let T=(0,J.useCallback)(()=>{v()},[v]),E=l(u??Ft),D=l(f??Ft),O=l(()=>{(a===void 0||isNaN(a)||n===void 0||isNaN(n)||n<a)&&(E(),k(60))}),k=l(e=>{y(),_.current=!0,t.current=window.setTimeout(O,e)}),A=l(()=>{(i===void 0||isNaN(i)||n===void 0||isNaN(n)||n>i)&&(D(),j(60))}),j=l(e=>{y(),_.current=!0,t.current=window.setTimeout(A,e)}),M=e=>{e.preventDefault()},{addGlobalListener:N,removeAllGlobalListeners:ee}=ve(),P=(0,J.useRef)(!1),[F,I]=(0,J.useState)(null);(0,J.useEffect)(()=>{F===`touch`?k(600):F?k(400):F||y()},[F]);let[L,R]=(0,J.useState)(null);return(0,J.useEffect)(()=>{L===`touch`?j(600):L?j(400):L||y()},[L]),{spinButtonProps:{role:`spinbutton`,"aria-valuenow":n!==void 0&&!isNaN(n)?n:void 0,"aria-valuetext":w,"aria-valuemin":i,"aria-valuemax":a,"aria-disabled":o||void 0,"aria-readonly":s||void 0,"aria-required":c||void 0,...b,onFocus:S,onBlur:C},incrementButtonProps:{onPressStart:e=>{v(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),P.current=!1,I(`touch`)):(u?.(),I(`mouse`)),N(window,`contextmenu`,M)},onPressUp:e=>{v(),e.pointerType===`touch`&&(P.current=!0),ee(),I(null)},onPressEnd:e=>{v(),e.pointerType===`touch`&&!_.current&&P.current&&u?.(),P.current=!1,I(null)},onFocus:S,onBlur:C},decrementButtonProps:{onPressStart:e=>{v(),e.pointerType===`touch`?(N(window,`pointercancel`,T,{capture:!0}),P.current=!1,R(`touch`)):(f?.(),R(`mouse`))},onPressUp:e=>{v(),e.pointerType===`touch`&&(P.current=!0),ee(),R(null)},onPressEnd:e=>{v(),e.pointerType===`touch`&&!_.current&&P.current&&f?.(),P.current=!1,R(null)},onFocus:S,onBlur:C}}}var Lt={};Lt={decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:`حقل رقمي`};var Rt={};Rt={decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:`Номер на полето`};var zt={};zt={decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:`Číselné pole`};var Bt={};Bt={decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:`Talfelt`};var Vt={};Vt={decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:`Nummernfeld`};var Ht={};Ht={decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:`Πεδίο αριθμού`};var Ut={};Ut={decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:`Number field`};var Wt={};Wt={decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var Gt={};Gt={decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:`Numbri väli`};var Kt={};Kt={decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:`Numerokenttä`};var qt={};qt={decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:`Champ de nombre`};var Jt={};Jt={decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:`שדה מספר`};var Yt={};Yt={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var Xt={};Xt={decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:`Számmező`};var Zt={};Zt={decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:`Campo numero`};var Qt={};Qt={decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:`数値フィールド`};var $t={};$t={decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:`번호 필드`};var en={};en={decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:`Numerio laukas`};var tn={};tn={decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:`Skaitļu lauks`};var nn={};nn={decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:`Tallfelt`};var rn={};rn={decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:`Getalveld`};var an={};an={decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:`Pole numeru`};var on={};on={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo de número`};var sn={};sn={decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:`Campo numérico`};var cn={};cn={decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:`Câmp numeric`};var ln={};ln={decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:`Числовое поле`};var un={};un={decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:`Číselné pole`};var dn={};dn={decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:`Številčno polje`};var fn={};fn={decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:`Polje broja`};var pn={};pn={decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:`Nummerfält`};var mn={};mn={decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:`Sayı alanı`};var hn={};hn={decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:`Поле номера`};var gn={};gn={decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:`数字字段`};var _n={};_n={decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:`數字欄位`};var vn={};vn={"ar-AE":Lt,"bg-BG":Rt,"cs-CZ":zt,"da-DK":Bt,"de-DE":Vt,"el-GR":Ht,"en-US":Ut,"es-ES":Wt,"et-EE":Gt,"fi-FI":Kt,"fr-FR":qt,"he-IL":Jt,"hr-HR":Yt,"hu-HU":Xt,"it-IT":Zt,"ja-JP":Qt,"ko-KR":$t,"lt-LT":en,"lv-LV":tn,"nb-NO":nn,"nl-NL":rn,"pl-PL":an,"pt-BR":on,"pt-PT":sn,"ro-RO":cn,"ru-RU":ln,"sk-SK":un,"sl-SI":dn,"sr-SP":fn,"sv-SE":pn,"tr-TR":mn,"uk-UA":hn,"zh-CN":gn,"zh-TW":_n};var yn=F(L(),1);function bn(e){return e&&e.__esModule?e.default:e}function xn(e,t,n){let{id:i,decrementAriaLabel:o,incrementAriaLabel:s,isDisabled:c,isReadOnly:l,isRequired:u,minValue:d,maxValue:f,autoFocus:p,label:m,formatOptions:h,onBlur:g=()=>{},onFocus:v,onFocusChange:y,onKeyDown:b,onKeyUp:x,description:C,errorMessage:w,isWheelDisabled:E,...D}=e,{increment:k,incrementToMax:j,decrement:M,decrementToMin:N,numberValue:P,inputValue:F,commit:I,commitValidation:L}=t,R=te(bn(vn),`@react-aria/numberfield`),z=(0,J.useCallback)(()=>{let e=n.current?.value??``;(0,yn.flushSync)(()=>{I()}),n.current?.value!==e&&Ce(n.current?.value??``,`assertive`)},[I,n]),ne=_(i),{focusProps:re}=ae({onBlur(){z()}}),ie=se(h),B=(0,J.useMemo)(()=>ie.resolvedOptions(),[ie]),oe=se({...h,currencySign:void 0}),{spinButtonProps:ce,incrementButtonProps:le,decrementButtonProps:ue}=It({isDisabled:c,isReadOnly:l,isRequired:u,maxValue:f,minValue:d,onIncrement:k,onIncrementToMax:j,onDecrement:M,onDecrementToMin:N,value:P,textValue:(0,J.useMemo)(()=>isNaN(P)?``:oe.format(P),[oe,P])}),[de,fe]=(0,J.useState)(!1),{focusWithinProps:pe}=Oe({isDisabled:c,onFocusWithinChange:fe});Qe({onScroll:(0,J.useCallback)(e=>{Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.deltaY>0?k():e.deltaY<0&&M())},[M,k]),isDisabled:E||c||l||!de},n);let me=(B.maximumFractionDigits??0)>0,ge=t.minValue===void 0||isNaN(t.minValue)||t.minValue<0,_e=`numeric`;A()?ge?_e=`text`:me&&(_e=`decimal`):Pe()&&(ge?_e=`numeric`:me&&(_e=`decimal`));let ve=e=>{t.validate(e)&&t.setInputValue(e)},ye=t=>{e.onPaste?.(t);let n=O(t);n&&(n.selectionEnd??-1)-(n.selectionStart??0)===n.value.length&&(t.preventDefault(),I(t.clipboardData?.getData?.(`text/plain`)?.trim()??``))},H=r(e),{keyboardProps:be}=he({isDisabled:c||l,shortcuts:{Enter:()=>((0,yn.flushSync)(()=>{I()}),L(),{shouldPreventDefault:!1})},onKeyDown:b,onKeyUp:x}),{isInvalid:xe,validationErrors:Se,validationDetails:U}=t.displayValidation,{labelProps:we,inputProps:Te,descriptionProps:Ee,errorMessageProps:De}=Ze({...D,...H,name:void 0,form:void 0,label:m,autoFocus:p,isDisabled:c,isReadOnly:l,isRequired:u,validate:void 0,[S]:t,value:F,defaultValue:`!`,autoComplete:`off`,"aria-label":e[`aria-label`]||void 0,"aria-labelledby":e[`aria-labelledby`]||void 0,id:ne,type:`text`,inputMode:_e,onChange:ve,onBlur:g,onFocus:v,onFocusChange:y,onPaste:ye,description:C,errorMessage:w},t,n),ke=V(be,Te);ee(n,t.defaultNumberValue,t.setNumberValue),Sn(t,e.validationBehavior,e.commitBehavior,n,t.minValue,t.maxValue,e.step,t.numberValue);let W=V(ce,re,ke,{role:null,"aria-roledescription":a()?null:R.format(`numberField`),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:`off`,spellCheck:`false`});e.validationBehavior===`native`&&(W[`aria-required`]=void 0);let Ae=e=>{T()!==n.current&&(e.pointerType===`mouse`?n.current?.focus():e.target.focus())},je=e[`aria-label`]||(typeof e.label==`string`?e.label:``),G;je||(G=e.label==null?e[`aria-labelledby`]:we.id);let K=_(),Me=_(),Ne=V(le,{"aria-label":s||R.format(`increase`,{fieldLabel:je}).trim(),id:G&&!s?K:null,"aria-labelledby":G&&!s?`${K} ${G}`:null,"aria-controls":ne,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:Ae}),Fe=V(ue,{"aria-label":o||R.format(`decrease`,{fieldLabel:je}).trim(),id:G&&!o?Me:null,"aria-labelledby":G&&!o?`${Me} ${G}`:null,"aria-controls":ne,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:Ae});return{groupProps:{...pe,role:`group`,"aria-disabled":c,"aria-invalid":xe?`true`:void 0},labelProps:we,inputProps:W,incrementButtonProps:Ne,decrementButtonProps:Fe,errorMessageProps:De,descriptionProps:Ee,isInvalid:xe,validationErrors:Se,validationDetails:U}}var Y=null;function Sn(e,t,n,r,i,a,o,s){x(()=>{let c=r.current;if(n!==`validate`||e.realtimeValidation.isInvalid||!c||c.disabled||(!Y&&typeof document<`u`&&(Y=document.createElement(`input`),Y.type=`number`),!Y))return;Y.min=i!=null&&!isNaN(i)?String(i):``,Y.max=a!=null&&!isNaN(a)?String(a):``,Y.step=o!=null&&!isNaN(o)?String(o):``,Y.value=s!=null&&!isNaN(s)?String(s):``;let l=c.validity.valid&&Y.validity.valid,u=c.validationMessage||Y.validationMessage,d={isInvalid:!l,validationErrors:u?[u]:[],validationDetails:{badInput:c.validity.badInput,customError:c.validity.customError,patternMismatch:c.validity.patternMismatch,rangeOverflow:Y.validity.rangeOverflow,rangeUnderflow:Y.validity.rangeUnderflow,stepMismatch:Y.validity.stepMismatch,tooLong:c.validity.tooLong,tooShort:c.validity.tooShort,typeMismatch:c.validity.typeMismatch,valueMissing:c.validity.valueMissing,valid:l}};e.updateValidation(d),t===`native`&&!Y.validity.valid&&c.setCustomValidity(Y.validationMessage)})}function Cn(e){let{minValue:t,maxValue:n,step:r,formatOptions:i,value:a,defaultValue:o=NaN,onChange:c,locale:l,isDisabled:u,isReadOnly:d,commitBehavior:f=`snap`}=e;a===null&&(a=NaN);let p=(0,J.useCallback)(e=>r===void 0||isNaN(r)?s(e,t,n):G(e,t,n,r),[r,t,n]);a!==void 0&&!isNaN(a)&&f===`snap`&&(a=p(a)),!isNaN(o)&&f===`snap`&&(o=p(o));let[m,h]=R(a,isNaN(o)?NaN:o,c),[g]=(0,J.useState)(m),[_,v]=(0,J.useState)(()=>isNaN(m)?``:new ye(l,i).format(m)),y=(0,J.useMemo)(()=>new Ve(l,i),[l,i]),b=(0,J.useMemo)(()=>y.getNumberingSystem(_),[y,_]),x=(0,J.useMemo)(()=>new ye(l,{...i,numberingSystem:b}),[l,i,b]),S=(0,J.useMemo)(()=>x.resolvedOptions(),[x]),C=(0,J.useCallback)(e=>isNaN(e)||e===null?``:x.format(e),[x]),T=w({...e,value:m}),E=r!==void 0&&!isNaN(r)?r:1;S.style===`percent`&&(r===void 0||isNaN(r))&&(E=.01);let[D,O]=(0,J.useState)(m),[k,A]=(0,J.useState)(l),[j,M]=(0,J.useState)(i);(!Object.is(m,D)||l!==k||!wn(i,j))&&(v(C(m)),O(m),A(l),M(i));let N=(0,J.useMemo)(()=>y.parse(_),[y,_]),ee=e=>{let t=e===void 0?_:e,n=N;if(e!==void 0&&(n=y.parse(t)),!t.length){h(NaN),v(a===void 0?``:C(m));return}if(isNaN(n)){v(C(m));return}let r=f===`snap`?p(n):n;r=y.parse(C(r));let i=r!==m;h(r),v(C(a===void 0?r:m)),i&&T.commitValidation()},P=(e,r=0)=>{let i=N;if(isNaN(i))return G(isNaN(r)?0:r,t,n,E);{let r=G(i,t,n,E);return e===`+`&&r>i||e===`-`&&r<i?r:G(Tn(e,i,E),t,n,E)}},F=()=>{let e=P(`+`,t);e===m&&v(C(e)),h(e),T.commitValidation()},I=()=>{let e=P(`-`,n);e===m&&v(C(e)),h(e),T.commitValidation()},L=()=>{n!=null&&(h(G(n,t,n,E)),T.commitValidation())},te=()=>{t!=null&&(h(t),T.commitValidation())},z=(0,J.useMemo)(()=>!u&&!d&&(isNaN(N)||n===void 0||isNaN(n)||G(N,t,n,E)>N||Tn(`+`,N,E)<=n),[u,d,t,n,E,N]),ne=(0,J.useMemo)(()=>!u&&!d&&(isNaN(N)||t===void 0||isNaN(t)||G(N,t,n,E)<N||Tn(`-`,N,E)>=t),[u,d,t,n,E,N]),re=e=>y.isValidPartialNumber(e,t,n);return{...T,validate:re,increment:F,incrementToMax:L,decrement:I,decrementToMin:te,canIncrement:z,canDecrement:ne,minValue:t,maxValue:n,numberValue:N,defaultNumberValue:isNaN(o)?g:o,setNumberValue:h,setInputValue:v,inputValue:_,commit:ee}}function wn(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function Tn(e,t,n){let r=e===`+`?t+n:t-n;if(t%1!=0||n%1!=0){let i=t.toString().split(`.`),a=n.toString().split(`.`),o=i[1]&&i[1].length||0,s=a[1]&&a[1].length||0,c=10**Math.max(o,s);t=Math.round(t*c),n=Math.round(n*c),r=e===`+`?t+n:t-n,r/=c}return r}var En=(0,J.createContext)(null),Dn=(0,J.createContext)(null),On=(0,J.forwardRef)(function(e,t){[e,t]=we(e,t,En);let{validationBehavior:n}=Ae(ge)||{},i=e.validationBehavior??n??`native`,{locale:a}=ke(),s=Cn({...e,locale:a,validationBehavior:i}),c=(0,J.useRef)(null),[l,u]=me(!e[`aria-label`]&&!e[`aria-labelledby`]),{labelProps:d,groupProps:f,inputProps:p,incrementButtonProps:m,decrementButtonProps:h,descriptionProps:_,errorMessageProps:v,...y}=xn({...ie(e),label:u,validationBehavior:i},s,c),x=be({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:y.isInvalid||!1,isRequired:e.isRequired||!1,isReadOnly:e.isReadOnly||!1},defaultClassName:`react-aria-NumberField`}),S=r(e,{global:!0});return delete S.id,J.createElement(de,{values:[[Dn,s],[g,f],[o,{...p,ref:c}],[ce,{...d,ref:l}],[ne,{slots:{increment:m,decrement:h}}],[b,{slots:{description:_,errorMessage:v}}],[D,y]]},J.createElement(fe.div,{...S,...x,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":y.isInvalid||void 0}),e.name&&J.createElement(`input`,{type:`hidden`,name:e.name,form:e.form,value:isNaN(s.numberValue)?``:s.numberValue,disabled:e.isDisabled||void 0}))}),kn=new WeakMap;function An(e,t,n){let{value:i,children:a,"aria-label":o,"aria-labelledby":s,onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p}=e,m=e.isDisabled||t.isDisabled,h=t.selectedValue===i,g=e=>{e.stopPropagation(),t.setSelectedValue(i)},{pressProps:_,isPressed:v}=xe({onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p,isDisabled:m}),{pressProps:y,isPressed:b}=xe({onPressStart:c,onPressEnd:l,onPressChange:u,onPressUp:f,onClick:p,isDisabled:m,onPress(e){d?.(e),t.setSelectedValue(i),n.current?.focus()}}),{focusableProps:x}=Ee(V(e,{onFocus:()=>t.setLastFocusedValue(i)}),n),S=V(_,x),C=r(e,{labelable:!0}),w=-1;t.selectedValue==null?(t.lastFocusedValue===i||t.lastFocusedValue==null)&&(w=0):t.selectedValue===i&&(w=0),m&&(w=void 0);let{name:T,form:E,descriptionId:D,errorMessageId:O,validationBehavior:k}=kn.get(t);ee(n,t.defaultSelectedValue,t.setSelectedValue),_e({validationBehavior:k},t,n);let A=N();return{labelProps:V(y,(0,J.useMemo)(()=>({onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault()}),[])),inputProps:V(C,{...S,type:`radio`,name:T,form:E,tabIndex:w,disabled:m,required:t.isRequired&&k===`native`,checked:h,value:i,onChange:g,"aria-describedby":[e[`aria-describedby`],A.id,t.isInvalid?O:null,D].filter(Boolean).join(` `)||void 0}),descriptionProps:A,isDisabled:m,isSelected:h,isPressed:v||b}}function jn(e,t){let{name:i,form:a,isReadOnly:o,isRequired:s,isDisabled:c,orientation:l=`vertical`,validationBehavior:u=`aria`}=e,{direction:d}=ke(),{isInvalid:m,validationErrors:h,validationDetails:g}=t.displayValidation,{labelProps:v,fieldProps:y,descriptionProps:b,errorMessageProps:x}=n({...e,labelElementType:`span`,isInvalid:t.isInvalid,errorMessage:e.errorMessage||h}),S=r(e,{labelable:!0}),{focusWithinProps:C}=Oe({onBlurWithin(n){e.onBlur?.(n),t.selectedValue||t.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});function w(e,n){let r=p(n.currentTarget,{from:O(n),accept:e=>e instanceof f(e).HTMLInputElement&&e.type===`radio`}),i;return e===`next`?(i=r.nextNode(),i||=(r.currentNode=n.currentTarget,r.firstChild())):(i=r.previousNode(),i||=(r.currentNode=n.currentTarget,r.lastChild())),i?(i.focus(),t.setSelectedValue(i.value),!0):!1}let{keyboardProps:T}=he({shortcuts:{ArrowRight:e=>w(d===`rtl`&&l!==`vertical`?`prev`:`next`,e),ArrowLeft:e=>w(d===`rtl`&&l!==`vertical`?`next`:`prev`,e),ArrowDown:e=>w(`next`,e),ArrowUp:e=>w(`prev`,e)},allowRepeats:!0}),E=_(i);return kn.set(t,{name:E,form:a,descriptionId:b.id,errorMessageId:x.id,validationBehavior:u}),{radioGroupProps:V(S,{role:`radiogroup`,...T,"aria-invalid":t.isInvalid||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-readonly":o||void 0,"aria-required":s||void 0,"aria-disabled":c||void 0,"aria-orientation":l,...y,...C}),labelProps:v,descriptionProps:b,errorMessageProps:x,isInvalid:m,validationErrors:h,validationDetails:g}}var Mn=Math.round(Math.random()*1e10),Nn=0;function Pn(e){let t=(0,J.useMemo)(()=>e.name||`radio-group-${Mn}-${++Nn}`,[e.name]),[n,r]=R(e.value,e.defaultValue??null,e.onChange),[i]=(0,J.useState)(n),[a,o]=(0,J.useState)(null),s=w({...e,value:n}),c=t=>{!e.isReadOnly&&!e.isDisabled&&(r(t),s.commitValidation())},l=s.displayValidation.isInvalid;return{...s,name:t,selectedValue:n,defaultSelectedValue:e.value===void 0?e.defaultValue??null:i,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,validationState:e.validationState||(l?`invalid`:null),isInvalid:l}}var Fn=(0,J.createContext)(null),In=(0,J.createContext)(null),Ln=(0,J.createContext)(null),Rn=(0,J.forwardRef)(function(e,t){[e,t]=we(e,t,Fn);let{validationBehavior:n}=Ae(ge)||{},i=e.validationBehavior??n??`native`,a=Pn({...e,validationBehavior:i}),[o,s]=me(!e[`aria-label`]&&!e[`aria-labelledby`]),{radioGroupProps:c,labelProps:l,descriptionProps:u,errorMessageProps:d,...f}=jn({...e,label:s,validationBehavior:i},a),p=be({...e,values:{orientation:e.orientation||`vertical`,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly,isRequired:a.isRequired,isInvalid:a.isInvalid,state:a},defaultClassName:`react-aria-RadioGroup`}),m=r(e,{global:!0});return J.createElement(fe.div,{...V(m,p,c),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`vertical`,"data-invalid":a.isInvalid||void 0,"data-disabled":a.isDisabled||void 0,"data-readonly":a.isReadOnly||void 0,"data-required":a.isRequired||void 0},J.createElement(de,{values:[[Ln,a],[ce,{...l,ref:o,elementType:`span`}],[b,{slots:{description:u,errorMessage:d}}],[D,f]]},J.createElement(I,null,p.children)))}),zn=(0,J.createContext)(null),Bn=(0,J.forwardRef)(function(e,t){let{inputRef:n=null,...a}=e;[e,t]=we(a,t,In);let o=J.useContext(Ln),s=E((0,J.useMemo)(()=>C(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),c=An({...ie(e),children:typeof e.children==`function`||e.children},o,s),{descriptionProps:l,isSelected:u,isDisabled:d}=c,f=be({...e,defaultClassName:`react-aria-RadioField`,values:{isSelected:u,isDisabled:d,isReadOnly:o.isReadOnly,isInvalid:o.isInvalid,isRequired:o.isRequired}}),p=r(e,{global:!0});return delete p.id,delete p.onClick,J.createElement(fe.div,{...V(p,f),ref:t,"data-selected":u||void 0,"data-disabled":d||void 0,"data-readonly":o.isReadOnly||void 0,"data-invalid":o.isInvalid||void 0,"data-required":o.isRequired||void 0},J.createElement(de,{values:[[i,{isSelected:u}],[zn,{...c,inputRef:s,defaultClassName:`react-aria-RadioButton`}],[b,{slots:{description:l}}]]},f.children))}),Vn=(0,J.forwardRef)(function(e,n){let{labelProps:i,inputProps:a,isSelected:o,isDisabled:s,isPressed:c,defaultClassName:l,inputRef:u}=(0,J.useContext)(zn),d=J.useContext(Ln),{isFocused:f,isFocusVisible:p,focusProps:m}=le(),h=s||d.isReadOnly,{hoverProps:g,isHovered:_}=t({...e,isDisabled:h}),v=be({...e,defaultClassName:l,values:{isSelected:o,isPressed:c,isHovered:_,isFocused:f,isFocusVisible:p,isDisabled:s,isReadOnly:d.isReadOnly,isInvalid:d.isInvalid,isRequired:d.isRequired}}),y=r(e,{global:!0});return delete y.id,delete y.onClick,J.createElement(fe.label,{...V(y,i,g,v),ref:n,"data-selected":o||void 0,"data-pressed":c||void 0,"data-hovered":_||void 0,"data-focused":f||void 0,"data-focus-visible":p||void 0,"data-disabled":s||void 0,"data-readonly":d.isReadOnly||void 0,"data-invalid":d.isInvalid||void 0,"data-required":d.isRequired||void 0},J.createElement(P,{elementType:`span`},J.createElement(`input`,{...V(a,m),ref:u})),v.children)}),X=M(),Hn=({children:e,className:t,...n})=>(0,X.jsx)(m,{className:Fe({className:t}),"data-slot":`header`,...n,children:e}),Un=(0,J.createContext)({}),Wn=({children:e,className:t,fullWidth:n,variant:r,...i})=>{let a=J.useMemo(()=>Ie({fullWidth:n,variant:r}),[n,r]),o=J.useMemo(()=>({slots:a}),[a]);return(0,X.jsx)(Un,{value:o,children:(0,X.jsx)(On,{"data-slot":`number-field`,...i,className:z(t,a?.base()),children:t=>(0,X.jsx)(X.Fragment,{children:typeof e==`function`?e(t):e})})})},Z=Object.assign(Wn,{Root:Wn,Group:({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Un);return(0,X.jsx)(d,{className:z(t,r?.group()),"data-slot":`number-field-group`,...n,children:t=>(0,X.jsx)(X.Fragment,{children:typeof e==`function`?e(t):e})})},Input:({className:e,...t})=>{let{slots:n}=(0,J.use)(Un);return(0,X.jsx)(je,{className:z(e,n?.input()),"data-slot":`number-field-input`,...t})},IncrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Un);return(0,X.jsx)(k,{className:z(t,r?.incrementButton()),"data-slot":`number-field-increment-button`,slot:`increment`,...n,children:e&&J.isValidElement(e)?e:(0,X.jsx)(Te,{"data-slot":`number-field-increment-button-icon`})})},DecrementButton:({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Un);return(0,X.jsx)(k,{className:z(t,r?.decrementButton()),"data-slot":`number-field-decrement-button`,slot:`decrement`,...n,children:e&&J.isValidElement(e)?e:(0,X.jsx)(y,{"data-slot":`number-field-decrement-button-icon`})})}}),Gn={elementType:`span`},Kn=(0,J.createContext)({}),qn=({children:e,className:t,...n})=>{let r=J.useMemo(()=>Re(),[]);return(0,X.jsx)(Bn,{"data-slot":`radio`,...n,className:z(t,r.base()),children:t=>(0,X.jsx)(Kn,{value:{slots:r,state:t},children:typeof e==`function`?e(t):e})})};qn.displayName=`HeroUI.Radio`;var Jn=({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Kn);return(0,X.jsx)(Vn,{"data-slot":`radio-content`,...n,className:z(t,r?.content()),children:t=>(0,X.jsx)(ce,{value:Gn,children:typeof e==`function`?e(t):e})})};Jn.displayName=`HeroUI.Radio.Content`;var Yn=({children:e,className:t,...n})=>{let{slots:r}=(0,J.use)(Kn);return(0,X.jsx)(Me.span,{className:v(r?.control,t),"data-slot":`radio-control`,...n,children:e})};Yn.displayName=`HeroUI.Radio.Control`;var Xn=({children:e,className:t,...n})=>{let{slots:r,state:i}=(0,J.use)(Kn),a=typeof e==`function`?e(i??{}):e;return(0,X.jsx)(Me.span,{"aria-hidden":`true`,className:v(r?.indicator,t),"data-slot":`radio-indicator`,...n,children:a})};Xn.displayName=`HeroUI.Radio.Indicator`;var Q=Object.assign(qn,{Root:qn,Content:Jn,Control:Yn,Indicator:Xn}),Zn=({children:e,className:t,variant:n,...r})=>{let i=J.useMemo(()=>Le({variant:n}),[n]);return(0,X.jsx)(Rn,{"data-slot":`radio-group`,...r,className:z(t,i),children:t=>(0,X.jsx)(X.Fragment,{children:typeof e==`function`?e(t):e})})},Qn=Object.assign(Zn,{Root:Zn}),$n={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};$n.node;var er=Se($n),tr=`*/10 * * * *`,nr=[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],rr=[{title:`高频检查`,presets:[{id:`every5`,label:`每 5 分钟`,description:`更频繁地检查推送,适合更新很密集的账号。`,value:`*/5 * * * *`},{id:`every10`,label:`每 10 分钟`,description:`推荐:全天每 10 分钟检查一次推送。`,value:`*/10 * * * *`},{id:`every15`,label:`每 15 分钟`,description:`兼顾及时性和任务频率,适合大多数推送。`,value:`*/15 * * * *`},{id:`every30`,label:`每 30 分钟`,description:`检查频率较低,适合不太活跃的推送。`,value:`*/30 * * * *`}]},{title:`按小时轮询`,presets:[{id:`hourly`,label:`每小时一次`,description:`每个整点执行,例如 00:00、01:00。`,value:`0 * * * *`},{id:`every2Hours`,label:`每 2 小时`,description:`从 0 点开始,每隔 2 小时执行一次。`,value:`0 */2 * * *`},{id:`every3Hours`,label:`每 3 小时`,description:`从 0 点开始,每隔 3 小时执行一次。`,value:`0 */3 * * *`},{id:`every6Hours`,label:`每 6 小时`,description:`每天 0 点、6 点、12 点、18 点执行。`,value:`0 */6 * * *`}]},{title:`每天固定时间`,presets:[{id:`daily8`,label:`每天上午 8 点`,description:`每天早上固定执行一次。`,value:`0 8 * * *`},{id:`daily9`,label:`每天上午 9 点`,description:`每天固定执行一次。`,value:`0 9 * * *`},{id:`daily12`,label:`每天中午 12 点`,description:`每天午间固定执行一次。`,value:`0 12 * * *`},{id:`daily18`,label:`每天晚上 6 点`,description:`每天傍晚固定执行一次。`,value:`0 18 * * *`},{id:`daily20`,label:`每天晚上 8 点`,description:`适合晚间集中推送。`,value:`0 20 * * *`},{id:`daily22`,label:`每天晚上 10 点`,description:`每天夜间固定执行一次。`,value:`0 22 * * *`}]},{title:`每天多次`,presets:[{id:`daily9And20`,label:`每天 9 点和 20 点`,description:`每天早晚各执行一次。`,value:`0 9,20 * * *`},{id:`daily9And12And18`,label:`每天 9 点、12 点、18 点`,description:`每天早中晚各执行一次。`,value:`0 9,12,18 * * *`}]},{title:`按星期`,presets:[{id:`weekday9`,label:`工作日上午 9 点`,description:`只在周一到周五执行。`,value:`0 9 * * 1,2,3,4,5`},{id:`weekday18`,label:`工作日晚上 6 点`,description:`只在周一到周五的傍晚执行。`,value:`0 18 * * 1,2,3,4,5`},{id:`weekend10`,label:`周末上午 10 点`,description:`只在周六和周日执行。`,value:`0 10 * * 0,6`},{id:`friday20`,label:`每周五晚上 8 点`,description:`每周五固定执行一次。`,value:`0 20 * * 5`}]}],ir=rr.flatMap(e=>e.presets),ar={minuteType:`interval`,minuteInterval:10,specificMinutes:[],hourType:`every`,hourInterval:1,specificHours:[],dayType:`every`,dayInterval:1,specificDays:[],weekType:`every`,specificWeeks:[]},or=e=>String(e).padStart(2,`0`),sr=(e,t,n,r)=>Number.isFinite(e)?Math.min(n,Math.max(t,Math.trunc(e))):r,$=(e,t,n)=>Array.from(new Set(e.filter(e=>Number.isInteger(e)&&e>=t&&e<=n))).sort((e,t)=>e-t),cr=(e,t,n)=>$(e.split(`,`).map(e=>Number(e.trim())).filter(e=>Number.isFinite(e)),t,n),lr=e=>$(e.split(`,`).map(e=>{let t=Number(e.trim());return t===7?0:t}).filter(e=>Number.isFinite(e)),0,6),ur=(e,t,n,r)=>{if(e===`*`||e===`*/1`)return{type:`every`,interval:r,specific:[]};let i=e.match(/^\*\/(\d+)$/);if(i){let e=sr(Number(i[1]),1,n,r);return e<=1?{type:`every`,interval:r,specific:[]}:{type:`interval`,interval:e,specific:[]}}let a=cr(e,t,n);return a.length>0?{type:`specific`,interval:r,specific:a}:{type:`every`,interval:r,specific:[]}},dr=e=>{let t=(e||tr).trim().split(/\s+/);if(t.length!==5)return{...ar};let[n,r,i,,a]=t,o=ur(n,0,59,10),s=ur(r,0,23,1),c=ur(i,1,31,1),l=a===`*`?[]:lr(a),u=l.length>0;return{minuteType:o.type,minuteInterval:o.interval,specificMinutes:o.specific,hourType:s.type,hourInterval:s.interval,specificHours:s.specific,dayType:u?`every`:c.type,dayInterval:u?1:c.interval,specificDays:u?[]:c.specific,weekType:u?`specific`:`every`,specificWeeks:l}},fr=e=>{let t=`*`,n=`*`,r=`*`,i=`*`;switch(e.minuteType){case`every`:t=`*`;break;case`interval`:t=e.minuteInterval<=1?`*`:`*/${e.minuteInterval}`;break;case`specific`:t=e.specificMinutes.length>0?$(e.specificMinutes,0,59).join(`,`):`0`}switch(e.hourType){case`every`:n=`*`;break;case`interval`:n=e.hourInterval<=1?`*`:`*/${e.hourInterval}`;break;case`specific`:n=e.specificHours.length>0?$(e.specificHours,0,23).join(`,`):`0`}switch(e.dayType){case`every`:r=`*`;break;case`interval`:r=e.dayInterval<=1?`*`:`*/${e.dayInterval}`;break;case`specific`:r=e.specificDays.length>0?$(e.specificDays,1,31).join(`,`):`1`}return e.weekType===`specific`&&(i=e.specificWeeks.length>0?$(e.specificWeeks,0,6).join(`,`):`*`),`${t} ${n} ${r} * ${i}`},pr=e=>{let t=(e||tr).trim().replace(/\s+/g,` `);return ir.find(e=>e.value===t)?.id??null},mr=e=>e.join(`、`),hr=e=>e.map(e=>`${e} 点`).join(`、`),gr=e=>{if(e.weekType===`specific`&&e.specificWeeks.length>0){let t=$(e.specificWeeks,0,6);return t.length===5&&t.every(e=>[1,2,3,4,5].includes(e))?`工作日`:t.length===2&&t.every(e=>[0,6].includes(e))?`周末`:`每${t.map(e=>nr[e]).join(`、`)}`}return e.dayType===`interval`&&e.dayInterval>1?`每隔 ${e.dayInterval} 天`:e.dayType===`specific`&&e.specificDays.length>0?`每月 ${mr($(e.specificDays,1,31))} 号`:`每天`},_r=e=>e.minuteType===`every`?`每分钟`:e.minuteType===`interval`?e.minuteInterval<=1?`每分钟`:`每 ${e.minuteInterval} 分钟`:`第 ${mr(e.specificMinutes.length>0?$(e.specificMinutes,0,59):[0])} 分钟`,vr=e=>{let t=_r(e);if(e.hourType===`every`||e.hourType===`interval`&&e.hourInterval<=1)return e.minuteType===`specific`?`每小时的${t}`:`全天${t}`;if(e.hourType===`specific`){let n=e.specificHours.length>0?$(e.specificHours,0,23):[0];return e.minuteType===`specific`?`在 ${hr(n)} 的${t}`:`在 ${hr(n)} 内${t}`}return e.minuteType===`specific`?`从 0 点开始每隔 ${e.hourInterval} 小时,在${t}`:`从 0 点开始每隔 ${e.hourInterval} 小时,该小时内${t}`},yr=e=>{let t=gr(e),n=vr(e);return`${t},${t===`每天`?n.replace(/^全天/,``):n}执行`},br=e=>yr(dr(e)),xr=e=>{if(e.minuteType===`every`)return Array.from({length:60},(e,t)=>t);if(e.minuteType===`interval`){let t=Math.max(1,e.minuteInterval);return Array.from({length:Math.ceil(60/t)},(e,n)=>n*t).filter(e=>e<=59)}return e.specificMinutes.length>0?$(e.specificMinutes,0,59):[0]},Sr=e=>{if(e.hourType===`every`)return Array.from({length:24},(e,t)=>t);if(e.hourType===`interval`){let t=Math.max(1,e.hourInterval);return Array.from({length:Math.ceil(24/t)},(e,n)=>n*t).filter(e=>e<=23)}return e.specificHours.length>0?$(e.specificHours,0,23):[0]},Cr=e=>{let t=[],n=Sr(e),r=xr(e);for(let e of n)for(let n of r)if(t.push(`${or(e)}:${or(n)}`),t.length>=6)return t;return t},wr=e=>{let t=Cr(e).join(`、`);return`${e.dayType===`every`&&e.weekType===`every`?`一天内示例`:`符合日期时,一天内示例`}:${t}`},Tr=({value:t,onChange:n,disabled:r=!1,device:i=`desktop`})=>{let[a,o]=(0,J.useState)(!1),[s,l]=(0,J.useState)(`quick`),[u,d]=(0,J.useState)(pr(t)),[f,p]=(0,J.useState)(`interval`),[m,h]=(0,J.useState)(10),[g,_]=(0,J.useState)([]),[v,y]=(0,J.useState)(`every`),[b,x]=(0,J.useState)(1),[S,C]=(0,J.useState)([]),[w,T]=(0,J.useState)(`every`),[E,D]=(0,J.useState)(1),[O,k]=(0,J.useState)([]),[A,j]=(0,J.useState)(`every`),[M,N]=(0,J.useState)([]),ee=e=>{p(e.minuteType),h(e.minuteInterval),_(e.specificMinutes),y(e.hourType),x(e.hourInterval),C(e.specificHours),T(e.dayType),D(e.dayInterval),k(e.specificDays),j(e.weekType),N(e.specificWeeks)},P=()=>({minuteType:f,minuteInterval:m,specificMinutes:g,hourType:v,hourInterval:b,specificHours:S,dayType:w,dayInterval:E,specificDays:O,weekType:A,specificWeeks:M});(0,J.useEffect)(()=>{if(!a)return;let e=dr(t||tr);ee(e),d(pr(fr(e))),l(`quick`)},[t,a]);let F=()=>fr(P()),I=()=>yr(P()),L=()=>wr(P()),te=()=>xr({...P(),minuteType:`interval`,minuteInterval:m}).slice(0,5).join(`、`),R=()=>Sr({...P(),hourType:`interval`,hourInterval:b}).slice(0,5).map(e=>`${e} 点`).join(`、`),z=()=>{n(F()),o(!1)},ne=e=>{let t=dr(e.value);ee(t),d(e.id)},ie=e=>{if(e===null||Array.isArray(e))return;let t=ir.find(t=>t.id===String(e));t&&ne(t)},ae=e=>{d(null),p(e)},oe=e=>{d(null),y(e)},se=e=>{d(null),T(e),e!==`every`&&(j(`every`),N([]))},ce=e=>{d(null),j(e),e!==`every`&&(T(`every`),D(1),k([]))},le=()=>(0,X.jsxs)(`div`,{className:`min-w-0 space-y-4 overflow-x-hidden`,children:[(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(W,{className:`block text-base font-semibold`,children:`常用规则`}),(0,X.jsx)(K,{className:`block leading-relaxed`,children:`不用理解 Cron,直接选一个最接近的执行时间,再看下方预览确认。`})]}),(0,X.jsxs)(pe,{fullWidth:!0,variant:`secondary`,placeholder:`选择常用执行规则`,value:u??``,onChange:ie,children:[(0,X.jsx)(W,{children:`执行规则`}),(0,X.jsxs)(pe.Trigger,{children:[(0,X.jsx)(pe.Value,{}),(0,X.jsx)(pe.Indicator,{})]}),(0,X.jsx)(pe.Popover,{children:(0,X.jsx)(re,{children:rr.map((t,n)=>(0,X.jsxs)(J.Fragment,{children:[n>0?(0,X.jsx)(e,{}):null,(0,X.jsxs)(re.Section,{children:[(0,X.jsx)(Hn,{children:t.title}),t.presets.map(e=>(0,X.jsxs)(re.Item,{id:e.id,textValue:e.label,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,X.jsx)(W,{children:e.label}),(0,X.jsx)(K,{children:e.description})]}),(0,X.jsx)(re.ItemIndicator,{})]},e.id))]})]},t.title))})})]})]}),(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`需要更细的规则?`}),(0,X.jsx)(c,{size:`sm`,variant:`secondary`,onPress:()=>l(`minute`),children:`转到高级`})]})})]}),de=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`分钟类型`,variant:`secondary`,value:f,onChange:e=>ae(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`每个小时里,哪些分钟执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`例如选“每 10 分钟”,就是 00、10、20、30、40、50 分执行。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`每分钟`]}),(0,X.jsx)(K,{children:`该小时里的每一分钟都执行,频率最高。`})]}),(0,X.jsxs)(Q,{value:`interval`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`间隔执行`]}),(0,X.jsx)(K,{children:`从第 0 分钟开始,按固定分钟数重复。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定分钟`]}),(0,X.jsx)(K,{children:`只在你点选的分钟执行,适合“整点”或“半点”。`})]})]})]})}),f===`interval`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`间隔设置`}),(0,X.jsxs)(Z,{variant:`secondary`,minValue:1,maxValue:59,value:m,onChange:e=>{d(null),h(sr(e,1,59,10))},children:[(0,X.jsx)(W,{children:`间隔(分钟)`}),(0,X.jsxs)(Z.Group,{children:[(0,X.jsx)(Z.DecrementButton,{}),(0,X.jsx)(Z.Input,{className:`w-24`}),(0,X.jsx)(Z.IncrementButton,{})]}),(0,X.jsx)(K,{children:m<=1?`等价于每分钟执行。`:`每个小时的 ${te()} 分执行。`})]})]}),f===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择分钟`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择要执行的分钟数,可多选。选 0 就是整点执行。`})]}),(0,X.jsx)(`div`,{className:`grid max-h-80 grid-cols-5 gap-2 overflow-y-auto p-1 md:grid-cols-10`,children:Array.from({length:60},(e,t)=>t).map(e=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:g.includes(e)?`primary`:`secondary`,onPress:()=>{d(null),_(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))},children:e},e))}),g.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,g.length,` 个:`,g.join(`, `)]})]})]}),fe=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`小时类型`,variant:`secondary`,value:v,onChange:e=>oe(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`一天里,哪些小时允许执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`如果选择“全部小时”,分钟页的规则会全天生效。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`全部小时`]}),(0,X.jsx)(K,{children:`不限制小时。例如分钟为每 10 分钟时,就是全天每 10 分钟。`})]}),(0,X.jsxs)(Q,{value:`interval`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`间隔执行`]}),(0,X.jsx)(K,{children:`从 0 点开始,每隔几个小时开放一次执行时段。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定小时`]}),(0,X.jsx)(K,{children:`只在你点选的小时内执行。`})]})]})]})}),v===`interval`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`间隔设置`}),(0,X.jsxs)(Z,{variant:`secondary`,minValue:1,maxValue:23,value:b,onChange:e=>{d(null),x(sr(e,1,23,1))},children:[(0,X.jsx)(W,{children:`间隔(小时)`}),(0,X.jsxs)(Z.Group,{children:[(0,X.jsx)(Z.DecrementButton,{}),(0,X.jsx)(Z.Input,{className:`w-24`}),(0,X.jsx)(Z.IncrementButton,{})]}),(0,X.jsx)(K,{children:b<=1?`间隔 1 小时等价于全部小时,保存时会自动写成 *。`:`只在 ${R()} 这些小时内执行。`})]})]}),v===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择小时`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择允许执行的小时,可多选。具体分钟仍由“分钟”页决定。`})]}),(0,X.jsx)(`div`,{className:`grid max-h-80 grid-cols-4 gap-2 overflow-y-auto p-1 md:grid-cols-6`,children:Array.from({length:24},(e,t)=>t).map(e=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:S.includes(e)?`primary`:`secondary`,onPress:()=>{d(null),C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))},children:e},e))}),S.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,S.length,` 个:`,S.map(e=>`${e}点`).join(`, `)]})]})]}),me=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`日期类型`,variant:`secondary`,value:w,onChange:e=>se(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`一个月里,哪些日期允许执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`日期和星期只保留一个条件。选择日期后,会自动清空星期条件。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`全部日期`]}),(0,X.jsx)(K,{children:`不限制几号执行。`})]}),(0,X.jsxs)(Q,{value:`interval`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`间隔执行`]}),(0,X.jsx)(K,{children:`从每月 1 号开始,每隔几天开放一次执行日期。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定日期`]}),(0,X.jsx)(K,{children:`只在你点选的几号执行。`})]})]})]})}),w===`interval`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`间隔设置`}),(0,X.jsxs)(Z,{variant:`secondary`,minValue:1,maxValue:31,value:E,onChange:e=>{d(null),D(sr(e,1,31,1)),j(`every`),N([])},children:[(0,X.jsx)(W,{children:`间隔(天)`}),(0,X.jsxs)(Z.Group,{children:[(0,X.jsx)(Z.DecrementButton,{}),(0,X.jsx)(Z.Input,{className:`w-24`}),(0,X.jsx)(Z.IncrementButton,{})]}),(0,X.jsx)(K,{children:E<=1?`间隔 1 天等价于全部日期,保存时会自动写成 *。`:`每月从 1 号开始,每隔 ${E} 天执行。`})]})]}),w===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择日期`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择允许执行的日期,可多选。月份没有这一天时会自动跳过。`})]}),(0,X.jsx)(`div`,{className:`grid max-h-80 grid-cols-5 gap-2 overflow-y-auto p-1 md:grid-cols-7`,children:Array.from({length:31},(e,t)=>t+1).map(e=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:O.includes(e)?`primary`:`secondary`,onPress:()=>{d(null),j(`every`),N([]),k(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))},children:e},e))}),O.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,O.length,` 个:`,O.map(e=>`${e}号`).join(`, `)]})]})]}),he=()=>(0,X.jsxs)(`div`,{className:`space-y-4`,children:[(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(Qn,{"aria-label":`星期类型`,variant:`secondary`,value:A,onChange:e=>ce(e),children:[(0,X.jsx)(W,{className:`text-base font-semibold`,children:`一周里,哪些星期允许执行?`}),(0,X.jsx)(K,{className:`mb-3`,children:`日期和星期只保留一个条件。选择星期后,会自动清空日期条件。`}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(Q,{value:`every`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`全部星期`]}),(0,X.jsx)(K,{children:`不限制星期几执行。`})]}),(0,X.jsxs)(Q,{value:`specific`,children:[(0,X.jsxs)(Q.Content,{children:[(0,X.jsx)(Q.Control,{children:(0,X.jsx)(Q.Indicator,{})}),`指定星期`]}),(0,X.jsx)(K,{children:`只在你点选的星期执行。`})]})]})]})}),A===`specific`&&(0,X.jsxs)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsx)(W,{className:`mb-2 text-base font-semibold`,children:`选择星期`}),(0,X.jsx)(K,{className:`mb-3`,children:`点击选择允许执行的星期,可多选。具体时间仍由分钟和小时页决定。`})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-7 gap-2 p-1`,children:[`日`,`一`,`二`,`三`,`四`,`五`,`六`].map((e,t)=>(0,X.jsx)(c,{className:`aspect-square min-w-0 shrink-0 p-0`,size:`sm`,variant:M.includes(t)?`primary`:`secondary`,onPress:()=>{d(null),T(`every`),D(1),k([]),N(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t].sort((e,t)=>e-t))},children:e},t))}),M.length>0&&(0,X.jsxs)(K,{className:`mt-2`,children:[`已选择 `,M.length,` 天:`,M.map(e=>`周${`日一二三四五六`[e]}`).join(`, `)]})]})]}),ge=i===`desktop`?`right`:`bottom`,V=br(t||tr);return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex gap-2 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsxs)(ue,{fullWidth:!0,isDisabled:!0,value:t,children:[(0,X.jsx)(W,{className:`sr-only`,children:`定时推送时间`}),(0,X.jsx)(Ne,{placeholder:`*/10 * * * *`,variant:`secondary`,"aria-label":`定时任务表达式`})]}),(0,X.jsxs)(c,{isDisabled:r,variant:`secondary`,onPress:()=>o(!0),children:[(0,X.jsx)(er,{className:`size-4`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:`编辑`})]})]}),(0,X.jsxs)(K,{children:[`当前规则:`,V]})]}),(0,X.jsx)(B.Backdrop,{isOpen:a,variant:`blur`,onOpenChange:o,children:(0,X.jsx)(B.Content,{placement:ge,children:(0,X.jsxs)(B.Dialog,{className:i===`desktop`?`h-full w-120 max-w-[90vw]`:`max-h-[85dvh]`,children:[(0,X.jsx)(B.Handle,{}),(0,X.jsx)(B.CloseTrigger,{}),(0,X.jsxs)(B.Header,{children:[(0,X.jsx)(B.Heading,{children:`定时推送时间`}),(0,X.jsx)(K,{children:`先选常用规则;需要精细控制时,再进入分钟、小时、日期、星期设置。`})]}),(0,X.jsxs)(B.Body,{className:`min-w-0 space-y-4 overflow-x-hidden`,children:[(0,X.jsxs)(U,{className:`min-w-0`,selectedKey:s,onSelectionChange:e=>l(e),children:[(0,X.jsx)(U.ListContainer,{children:(0,X.jsxs)(U.List,{children:[(0,X.jsxs)(U.Tab,{id:`quick`,children:[(0,X.jsx)(`span`,{children:`常用`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`minute`,children:[(0,X.jsx)(`span`,{children:`分钟`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`hour`,children:[(0,X.jsx)(`span`,{children:`小时`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`day`,children:[(0,X.jsx)(`span`,{children:`日期`}),(0,X.jsx)(U.Indicator,{})]}),(0,X.jsxs)(U.Tab,{id:`week`,children:[(0,X.jsx)(`span`,{children:`星期`}),(0,X.jsx)(U.Indicator,{})]})]})}),(0,X.jsx)(`div`,{className:`h-1`}),(0,X.jsx)(U.Panel,{id:`quick`,className:`p-0`,children:le()}),(0,X.jsx)(U.Panel,{id:`minute`,className:`p-0`,children:de()}),(0,X.jsx)(U.Panel,{id:`hour`,className:`p-0`,children:fe()}),(0,X.jsx)(U.Panel,{id:`day`,className:`p-0`,children:me()}),(0,X.jsx)(U.Panel,{id:`week`,className:`p-0`,children:he()})]}),(0,X.jsx)(H,{className:`p-4 rounded-3xl`,variant:`secondary`,children:(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(W,{className:`text-sm font-medium text-muted`,children:`实际执行时间`}),(0,X.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed`,children:I()}),(0,X.jsx)(K,{className:`mt-1`,children:L()})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(W,{className:`text-sm font-medium text-muted`,children:`表达式`}),(0,X.jsx)(`code`,{className:`mt-1 block font-mono text-base font-semibold`,children:F()})]})]})})]}),(0,X.jsxs)(B.Footer,{children:[(0,X.jsx)(c,{className:`flex-1`,slot:`close`,variant:`tertiary`,children:`取消`}),(0,X.jsx)(c,{className:`flex-1`,variant:`primary`,onPress:z,children:`使用这个规则`})]})]})})})]})};export{Tr as default};
@@ -1 +1 @@
1
- import{t as e}from"./separator-BQ8-sWCU.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./ThemeSwitch-Cm4QAM5e.js";import{D as u,Ht as d,O as f,St as p,Ut as m,a as h,c as g,g as _,i as v,l as y,n as b,o as x,s as S,u as C,yt as w}from"./index-DBbIxsmd.js";var T={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};T.node;var E=x(T),D=m(d(),1),O=p(),k=({activeMenu:e})=>{let t=(0,D.useRef)(null);return(0,D.useEffect)(()=>{t.current&&S.fromTo(t.current,{autoAlpha:0},{autoAlpha:1,duration:h(.2),ease:`power2.out`,overwrite:`auto`})},[e]),(0,O.jsx)(`div`,{ref:t,className:`mx-auto w-full max-w-7xl px-4`,children:(()=>{switch(e){case`config`:return(0,O.jsx)(v,{device:`desktop`});case`about`:return(0,O.jsx)(s,{});default:return(0,O.jsx)(v,{device:`desktop`})}})()})},A=[{id:`config`,label:`配置管理`,icon:r},{id:`about`,label:`关于插件`,icon:n}],j=({collapsed:t,activeMenu:n,onMenuChange:r})=>{let o=C(()=>{window.open(`https://kkk.karinjs.com`,`_blank`,`noopener,noreferrer`)}),s=C(()=>{g(),window.location.reload()});return t?null:(0,O.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,O.jsx)(`div`,{className:`shrink-0 px-4 pt-3 pb-2`,children:(0,O.jsxs)(_,{children:[(0,O.jsx)(_.Trigger,{"aria-label":`用户信息`,children:(0,O.jsxs)(`div`,{className:`flex w-full items-center gap-3 rounded-lg p-2 transition-colors hover:bg-default-100 cursor-pointer`,tabIndex:0,children:[(0,O.jsxs)(f,{size:`lg`,children:[(0,O.jsx)(f.Image,{src:a}),(0,O.jsx)(f.Fallback,{children:`ikenxuan`})]}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start`,children:[(0,O.jsx)(`p`,{className:`truncate text-lg font-semibold`,children:`炫炫`}),(0,O.jsx)(`p`,{className:`truncate text-md text-muted`,children:`Super Admin`})]})]})}),(0,O.jsx)(_.Content,{className:`w-60`,children:(0,O.jsxs)(_.Dialog,{children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3 pb-3`,children:[(0,O.jsxs)(f,{size:`md`,children:[(0,O.jsx)(f.Image,{src:a}),(0,O.jsx)(f.Fallback,{children:`U`})]}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(`p`,{className:`truncate font-medium`,children:`用户`}),(0,O.jsx)(`p`,{className:`truncate text-md text-muted`,children:`Super Admin`})]})]}),(0,O.jsx)(e,{className:`my-2`}),(0,O.jsx)(`p`,{className:`text-xs text-muted`,children:`当前身份:管理员`})]})})]})}),(0,O.jsx)(`nav`,{className:`flex flex-1 flex-col gap-1 overflow-y-auto px-3 py-3`,"aria-label":`主导航`,children:A.map(e=>{let t=e.icon,i=n===e.id;return(0,O.jsxs)(u,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:i?`tertiary`:`ghost`,"aria-label":e.label,"aria-current":i?`page`:void 0,onPress:()=>r(e.id),children:[(0,O.jsx)(t,{size:20,className:w(`shrink-0 mr-3`,!i&&`text-muted`),"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:w(`truncate`,i&&`font-medium`),children:e.label})]},e.id)})}),(0,O.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 px-3 py-3`,children:[(0,O.jsxs)(u,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`查看帮助文档`,onPress:o,children:[(0,O.jsx)(i,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`帮助文档`})]}),(0,O.jsxs)(u,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`登出`,onPress:s,children:[(0,O.jsx)(c,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`登出`})]})]})]})},M=({onToggleSidebar:e,sidebarCollapsed:n,currentMenuLabel:r})=>(0,O.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,O.jsx)(u,{isIconOnly:!0,variant:`ghost`,onPress:e,"aria-label":n?`展开侧边栏`:`折叠侧边栏`,"aria-expanded":!n,children:n?(0,O.jsx)(o,{size:20,"aria-hidden":`true`}):(0,O.jsx)(E,{size:20,"aria-hidden":`true`})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(t,{size:24,"aria-hidden":`true`}),(0,O.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:`KKK Config`})]}),!n&&(0,O.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:r||`配置管理面板`})]}),(0,O.jsx)(l,{})]}),N=[{id:`config`,label:`配置管理`,icon:r},{id:`about`,label:`关于插件`,icon:n}],P=({activeMenu:e,onMenuChange:t})=>{let[n,{toggle:r}]=y(!1),i=(0,D.useRef)(null),a=(0,D.useRef)(null),o=(0,D.useRef)(null);return(0,D.useEffect)(()=>(o.current=b(a),()=>{o.current?.destroy(),o.current=null}),[]),(0,D.useEffect)(()=>{o.current?.scrollTo(0)},[e]),(0,D.useEffect)(()=>{i.current&&(n?S.to(i.current,{width:0,opacity:0,borderRightWidth:0,duration:.3,ease:`power2.inOut`,onComplete:()=>{i.current&&(i.current.style.display=`none`)}}):(i.current.style.display=`flex`,S.fromTo(i.current,{width:0,opacity:0,borderRightWidth:0},{width:260,opacity:1,borderRightWidth:1,duration:.3,ease:`power2.inOut`})))},[n]),(0,O.jsxs)(`div`,{className:`flex h-screen overflow-hidden`,children:[(0,O.jsx)(`aside`,{ref:i,className:`flex h-full w-65 shrink-0 flex-col border-r border-default-100`,"aria-label":`侧边栏导航`,children:(0,O.jsx)(j,{collapsed:n,activeMenu:e,onMenuChange:t,onToggleCollapse:r})}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,O.jsx)(`header`,{className:`flex h-16 shrink-0 items-center px-6`,children:(0,O.jsx)(M,{onToggleSidebar:r,sidebarCollapsed:n,currentMenuLabel:N.find(t=>t.id===e)?.label})}),(0,O.jsx)(`main`,{ref:a,className:`scrollbar flex-1 overflow-y-auto p-6`,id:`main-content`,children:(0,O.jsx)(`div`,{"data-scrollbar":`thin`,children:(0,O.jsx)(k,{activeMenu:e})})})]})]})};export{P as default};
1
+ import{t as e}from"./separator-CFLVDixH.js";import{a as t,c as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./ThemeSwitch-DNCjCIP-.js";import{D as u,Ht as d,O as f,St as p,Ut as m,a as h,c as g,g as _,i as v,l as y,n as b,o as x,s as S,u as C,yt as w}from"./index-Zn_7piH-.js";var T={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};T.node;var E=x(T),D=m(d(),1),O=p(),k=({activeMenu:e})=>{let t=(0,D.useRef)(null);return(0,D.useEffect)(()=>{t.current&&S.fromTo(t.current,{autoAlpha:0},{autoAlpha:1,duration:h(.2),ease:`power2.out`,overwrite:`auto`})},[e]),(0,O.jsx)(`div`,{ref:t,className:`mx-auto w-full max-w-7xl px-4`,children:(()=>{switch(e){case`config`:return(0,O.jsx)(v,{device:`desktop`});case`about`:return(0,O.jsx)(s,{});default:return(0,O.jsx)(v,{device:`desktop`})}})()})},A=[{id:`config`,label:`配置管理`,icon:r},{id:`about`,label:`关于插件`,icon:n}],j=({collapsed:t,activeMenu:n,onMenuChange:r})=>{let o=C(()=>{window.open(`https://kkk.karinjs.com`,`_blank`,`noopener,noreferrer`)}),s=C(()=>{g(),window.location.reload()});return t?null:(0,O.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,O.jsx)(`div`,{className:`shrink-0 px-4 pt-3 pb-2`,children:(0,O.jsxs)(_,{children:[(0,O.jsx)(_.Trigger,{"aria-label":`用户信息`,children:(0,O.jsxs)(`div`,{className:`flex w-full items-center gap-3 rounded-lg p-2 transition-colors hover:bg-default-100 cursor-pointer`,tabIndex:0,children:[(0,O.jsxs)(f,{size:`lg`,children:[(0,O.jsx)(f.Image,{src:a}),(0,O.jsx)(f.Fallback,{children:`ikenxuan`})]}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start`,children:[(0,O.jsx)(`p`,{className:`truncate text-lg font-semibold`,children:`炫炫`}),(0,O.jsx)(`p`,{className:`truncate text-md text-muted`,children:`Super Admin`})]})]})}),(0,O.jsx)(_.Content,{className:`w-60`,children:(0,O.jsxs)(_.Dialog,{children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3 pb-3`,children:[(0,O.jsxs)(f,{size:`md`,children:[(0,O.jsx)(f.Image,{src:a}),(0,O.jsx)(f.Fallback,{children:`U`})]}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsx)(`p`,{className:`truncate font-medium`,children:`用户`}),(0,O.jsx)(`p`,{className:`truncate text-md text-muted`,children:`Super Admin`})]})]}),(0,O.jsx)(e,{className:`my-2`}),(0,O.jsx)(`p`,{className:`text-xs text-muted`,children:`当前身份:管理员`})]})})]})}),(0,O.jsx)(`nav`,{className:`flex flex-1 flex-col gap-1 overflow-y-auto px-3 py-3`,"aria-label":`主导航`,children:A.map(e=>{let t=e.icon,i=n===e.id;return(0,O.jsxs)(u,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:i?`tertiary`:`ghost`,"aria-label":e.label,"aria-current":i?`page`:void 0,onPress:()=>r(e.id),children:[(0,O.jsx)(t,{size:20,className:w(`shrink-0 mr-3`,!i&&`text-muted`),"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:w(`truncate`,i&&`font-medium`),children:e.label})]},e.id)})}),(0,O.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 px-3 py-3`,children:[(0,O.jsxs)(u,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`查看帮助文档`,onPress:o,children:[(0,O.jsx)(i,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`帮助文档`})]}),(0,O.jsxs)(u,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`登出`,onPress:s,children:[(0,O.jsx)(c,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`登出`})]})]})]})},M=({onToggleSidebar:e,sidebarCollapsed:n,currentMenuLabel:r})=>(0,O.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,O.jsx)(u,{isIconOnly:!0,variant:`ghost`,onPress:e,"aria-label":n?`展开侧边栏`:`折叠侧边栏`,"aria-expanded":!n,children:n?(0,O.jsx)(o,{size:20,"aria-hidden":`true`}):(0,O.jsx)(E,{size:20,"aria-hidden":`true`})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(t,{size:24,"aria-hidden":`true`}),(0,O.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:`KKK Config`})]}),!n&&(0,O.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:r||`配置管理面板`})]}),(0,O.jsx)(l,{})]}),N=[{id:`config`,label:`配置管理`,icon:r},{id:`about`,label:`关于插件`,icon:n}],P=({activeMenu:e,onMenuChange:t})=>{let[n,{toggle:r}]=y(!1),i=(0,D.useRef)(null),a=(0,D.useRef)(null),o=(0,D.useRef)(null);return(0,D.useEffect)(()=>(o.current=b(a),()=>{o.current?.destroy(),o.current=null}),[]),(0,D.useEffect)(()=>{o.current?.scrollTo(0)},[e]),(0,D.useEffect)(()=>{i.current&&(n?S.to(i.current,{width:0,opacity:0,borderRightWidth:0,duration:.3,ease:`power2.inOut`,onComplete:()=>{i.current&&(i.current.style.display=`none`)}}):(i.current.style.display=`flex`,S.fromTo(i.current,{width:0,opacity:0,borderRightWidth:0},{width:260,opacity:1,borderRightWidth:1,duration:.3,ease:`power2.inOut`})))},[n]),(0,O.jsxs)(`div`,{className:`flex h-screen overflow-hidden`,children:[(0,O.jsx)(`aside`,{ref:i,className:`flex h-full w-65 shrink-0 flex-col border-r border-default-100`,"aria-label":`侧边栏导航`,children:(0,O.jsx)(j,{collapsed:n,activeMenu:e,onMenuChange:t,onToggleCollapse:r})}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,O.jsx)(`header`,{className:`flex h-16 shrink-0 items-center px-6`,children:(0,O.jsx)(M,{onToggleSidebar:r,sidebarCollapsed:n,currentMenuLabel:N.find(t=>t.id===e)?.label})}),(0,O.jsx)(`main`,{ref:a,className:`scrollbar flex-1 overflow-y-auto p-6`,id:`main-content`,children:(0,O.jsx)(`div`,{"data-scrollbar":`thin`,children:(0,O.jsx)(k,{activeMenu:e})})})]})]})};export{P as default};
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./ThemeSwitch-Cm4QAM5e.js";import{D as l,Ht as u,O as d,St as f,Ut as p,a as m,b as h,c as g,i as _,l as v,m as y,o as b,s as x,t as S,u as C,yt as w}from"./index-DBbIxsmd.js";var T={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};T.node;var E=b(T),D=p(u(),1),O=f(),k=({activeMenu:e})=>{let t=(0,D.useRef)(null);return(0,D.useEffect)(()=>{t.current&&x.fromTo(t.current,{autoAlpha:0},{autoAlpha:1,duration:m(.2),ease:`power2.out`,overwrite:`auto`})},[e]),(0,O.jsx)(`div`,{ref:t,className:`w-full max-w-2xl mx-auto`,children:(()=>{switch(e){case`config`:return(0,O.jsx)(_,{device:`mobile`});case`about`:return(0,O.jsx)(o,{});default:return(0,O.jsx)(_,{device:`mobile`})}})()})},A=[{id:`config`,label:`配置管理`,icon:n},{id:`about`,label:`关于插件`,icon:t}],j=({open:e,onClose:t,activeMenu:n,onMenuChange:a})=>{let o=C(()=>{window.open(`https://kkk.karinjs.com`,`_blank`,`noopener,noreferrer`)}),c=C(()=>{g(),window.location.reload()});return(0,D.useEffect)(()=>{let n=n=>{n.key===`Escape`&&e&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,D.useEffect)(()=>(e?document.body.style.overflow=`hidden`:document.body.style.overflow=``,()=>{document.body.style.overflow=``}),[e]),(0,O.jsx)(h.Backdrop,{isOpen:e,isDismissable:!0,className:`backdrop-blur-sm`,onOpenChange:e=>{e||t()},children:(0,O.jsx)(h.Content,{placement:`right`,children:(0,O.jsxs)(h.Dialog,{className:`px-4`,children:[(0,O.jsxs)(h.Header,{className:`flex items-center justify-between pb-4`,children:[(0,O.jsx)(h.Heading,{className:`text-lg font-semibold`,children:`菜单`}),(0,O.jsx)(h.CloseTrigger,{"aria-label":`关闭菜单`,className:`mr-2`,children:(0,O.jsx)(E,{size:24,"aria-hidden":`true`})})]}),(0,O.jsxs)(h.Body,{className:`flex flex-col`,children:[(0,O.jsx)(`div`,{className:`shrink-0 pb-5`,children:(0,O.jsxs)(`div`,{className:`flex items-center gap-3 px-1`,children:[(0,O.jsxs)(d,{size:`md`,children:[(0,O.jsx)(d.Image,{src:i}),(0,O.jsx)(d.Fallback,{children:`ikenxuan`})]}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,O.jsx)(`p`,{className:`truncate text-sm font-medium`,children:`炫炫`}),(0,O.jsx)(`p`,{className:`truncate text-xs text-muted`,children:`Super Admin`})]})]})}),(0,O.jsx)(`nav`,{className:`flex flex-1 flex-col gap-2 overflow-y-auto`,"aria-label":`主导航`,children:A.map(e=>{let t=e.icon,r=n===e.id;return(0,O.jsxs)(l,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:r?`tertiary`:`ghost`,"aria-label":e.label,"aria-current":r?`page`:void 0,onPress:()=>a(e.id),children:[(0,O.jsx)(t,{size:20,className:w(`shrink-0 mr-3`,!r&&`text-muted`),"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:w(`truncate`,r&&`font-semibold`),children:e.label})]},e.id)})}),(0,O.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,O.jsxs)(l,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`查看帮助文档`,onPress:o,children:[(0,O.jsx)(r,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`帮助文档`})]}),(0,O.jsxs)(l,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`登出`,onPress:c,children:[(0,O.jsx)(s,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`登出`})]})]})]})]})})})},M=({onOpenDrawer:t})=>(0,O.jsxs)(`div`,{className:`flex h-full items-center justify-between px-4`,children:[(0,O.jsx)(c,{className:`shrink-0`}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center justify-center gap-2 px-2`,children:[(0,O.jsx)(e,{size:22,"aria-hidden":`true`}),(0,O.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:`KKK Config`})]}),(0,O.jsx)(l,{isIconOnly:!0,className:`shrink-0`,variant:`ghost`,onPress:t,"aria-label":`打开菜单`,"aria-expanded":!1,children:(0,O.jsx)(a,{size:24,"aria-hidden":`true`})})]}),N=({activeMenu:e,onMenuChange:t})=>{let[n,{setTrue:r,setFalse:i}]=v(!1),a=(0,D.useRef)(null),o=(0,D.useRef)(null);(0,D.useEffect)(()=>(o.current=S(a),()=>{o.current?.destroy(),o.current=null}),[]),(0,D.useEffect)(()=>{o.current?.scrollTo(0)},[e]);let s=C(e=>{t(e),i()});return(0,O.jsxs)(y,{ref:a,"data-scrollbar":`thin`,className:`flex min-h-screen flex-col`,children:[(0,O.jsx)(`header`,{className:`sticky top-0 z-50 h-14 shrink-0 backdrop-blur-xs mask-[linear-gradient(to_bottom,black_40%,transparent_100%)]`,children:(0,O.jsx)(M,{onOpenDrawer:r})}),(0,O.jsx)(j,{open:n,onClose:i,activeMenu:e,onMenuChange:s}),(0,O.jsx)(`main`,{className:`scrollbar flex-1 overflow-y-auto p-4`,id:`main-content`,children:(0,O.jsx)(k,{activeMenu:e})})]})};export{N as default};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./ThemeSwitch-DNCjCIP-.js";import{D as l,Ht as u,O as d,St as f,Ut as p,a as m,b as h,c as g,i as _,l as v,m as y,o as b,s as x,t as S,u as C,yt as w}from"./index-Zn_7piH-.js";var T={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};T.node;var E=b(T),D=p(u(),1),O=f(),k=({activeMenu:e})=>{let t=(0,D.useRef)(null);return(0,D.useEffect)(()=>{t.current&&x.fromTo(t.current,{autoAlpha:0},{autoAlpha:1,duration:m(.2),ease:`power2.out`,overwrite:`auto`})},[e]),(0,O.jsx)(`div`,{ref:t,className:`w-full max-w-2xl mx-auto`,children:(()=>{switch(e){case`config`:return(0,O.jsx)(_,{device:`mobile`});case`about`:return(0,O.jsx)(o,{});default:return(0,O.jsx)(_,{device:`mobile`})}})()})},A=[{id:`config`,label:`配置管理`,icon:n},{id:`about`,label:`关于插件`,icon:t}],j=({open:e,onClose:t,activeMenu:n,onMenuChange:a})=>{let o=C(()=>{window.open(`https://kkk.karinjs.com`,`_blank`,`noopener,noreferrer`)}),c=C(()=>{g(),window.location.reload()});return(0,D.useEffect)(()=>{let n=n=>{n.key===`Escape`&&e&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),(0,D.useEffect)(()=>(e?document.body.style.overflow=`hidden`:document.body.style.overflow=``,()=>{document.body.style.overflow=``}),[e]),(0,O.jsx)(h.Backdrop,{isOpen:e,isDismissable:!0,className:`backdrop-blur-sm`,onOpenChange:e=>{e||t()},children:(0,O.jsx)(h.Content,{placement:`right`,children:(0,O.jsxs)(h.Dialog,{className:`px-4`,children:[(0,O.jsxs)(h.Header,{className:`flex items-center justify-between pb-4`,children:[(0,O.jsx)(h.Heading,{className:`text-lg font-semibold`,children:`菜单`}),(0,O.jsx)(h.CloseTrigger,{"aria-label":`关闭菜单`,className:`mr-2`,children:(0,O.jsx)(E,{size:24,"aria-hidden":`true`})})]}),(0,O.jsxs)(h.Body,{className:`flex flex-col`,children:[(0,O.jsx)(`div`,{className:`shrink-0 pb-5`,children:(0,O.jsxs)(`div`,{className:`flex items-center gap-3 px-1`,children:[(0,O.jsxs)(d,{size:`md`,children:[(0,O.jsx)(d.Image,{src:i}),(0,O.jsx)(d.Fallback,{children:`ikenxuan`})]}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,O.jsx)(`p`,{className:`truncate text-sm font-medium`,children:`炫炫`}),(0,O.jsx)(`p`,{className:`truncate text-xs text-muted`,children:`Super Admin`})]})]})}),(0,O.jsx)(`nav`,{className:`flex flex-1 flex-col gap-2 overflow-y-auto`,"aria-label":`主导航`,children:A.map(e=>{let t=e.icon,r=n===e.id;return(0,O.jsxs)(l,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:r?`tertiary`:`ghost`,"aria-label":e.label,"aria-current":r?`page`:void 0,onPress:()=>a(e.id),children:[(0,O.jsx)(t,{size:20,className:w(`shrink-0 mr-3`,!r&&`text-muted`),"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:w(`truncate`,r&&`font-semibold`),children:e.label})]},e.id)})}),(0,O.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,O.jsxs)(l,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`查看帮助文档`,onPress:o,children:[(0,O.jsx)(r,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`帮助文档`})]}),(0,O.jsxs)(l,{fullWidth:!0,className:`justify-start`,size:`lg`,variant:`ghost`,"aria-label":`登出`,onPress:c,children:[(0,O.jsx)(s,{size:20,className:`shrink-0 mr-3 text-muted`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:`登出`})]})]})]})]})})})},M=({onOpenDrawer:t})=>(0,O.jsxs)(`div`,{className:`flex h-full items-center justify-between px-4`,children:[(0,O.jsx)(c,{className:`shrink-0`}),(0,O.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center justify-center gap-2 px-2`,children:[(0,O.jsx)(e,{size:22,"aria-hidden":`true`}),(0,O.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:`KKK Config`})]}),(0,O.jsx)(l,{isIconOnly:!0,className:`shrink-0`,variant:`ghost`,onPress:t,"aria-label":`打开菜单`,"aria-expanded":!1,children:(0,O.jsx)(a,{size:24,"aria-hidden":`true`})})]}),N=({activeMenu:e,onMenuChange:t})=>{let[n,{setTrue:r,setFalse:i}]=v(!1),a=(0,D.useRef)(null),o=(0,D.useRef)(null);(0,D.useEffect)(()=>(o.current=S(a),()=>{o.current?.destroy(),o.current=null}),[]),(0,D.useEffect)(()=>{o.current?.scrollTo(0)},[e]);let s=C(e=>{t(e),i()});return(0,O.jsxs)(y,{ref:a,"data-scrollbar":`thin`,className:`flex min-h-screen flex-col`,children:[(0,O.jsx)(`header`,{className:`sticky top-0 z-50 h-14 shrink-0 backdrop-blur-xs mask-[linear-gradient(to_bottom,black_40%,transparent_100%)]`,children:(0,O.jsx)(M,{onOpenDrawer:r})}),(0,O.jsx)(j,{open:n,onClose:i,activeMenu:e,onMenuChange:s}),(0,O.jsx)(`main`,{className:`scrollbar flex-1 overflow-y-auto p-4`,id:`main-content`,children:(0,O.jsx)(k,{activeMenu:e})})]})};export{N as default};
@@ -1 +1 @@
1
- import{D as e,E as t,St as n,d as r,o as i,r as a,x as o}from"./index-DBbIxsmd.js";var s={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};s.node;var c=i(s),l={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};l.node;var u=i(l),d={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};d.node;var f=i(d),p={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};p.node;var m=i(p),h={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};h.node;var g=i(h),_={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};_.node;var v=i(_),y={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};y.node;var b=i(y),x={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};x.node;var S=i(x),C={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};C.node;var w=i(C),T=n(),E=()=>{let n=e=>{window.open(e,`_blank`)};return(0,T.jsxs)(t,{className:`mx-auto max-w-3xl`,children:[(0,T.jsxs)(t.Header,{className:`items-center text-center gap-4 pt-8 pb-6`,children:[(0,T.jsx)(b,{size:64,"aria-hidden":`true`}),(0,T.jsx)(t.Title,{children:`karin-plugin-kkk`}),(0,T.jsx)(t.Description,{children:`版本 2.33.0`})]}),(0,T.jsxs)(t.Content,{className:`flex flex-col gap-6 pb-8`,children:[(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`插件简介`}),(0,T.jsx)(o,{children:`Karin 的「抖音」「B站」视频解析/动态推送插件。 支持视频解析、动态推送、扫码登录等功能。`})]}),(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`开发者`}),(0,T.jsx)(o,{children:`ikenxuan, sj817`})]}),(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`相关链接`}),(0,T.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3`,children:[(0,T.jsxs)(e,{variant:`outline`,onPress:()=>n(`https://github.com/ikenxuan/karin-plugin-kkk`),children:[(0,T.jsx)(u,{size:18,"aria-hidden":`true`}),(0,T.jsx)(`span`,{children:`GitHub 仓库`})]}),(0,T.jsxs)(e,{variant:`outline`,onPress:()=>n(`https://github.com/ikenxuan/karin-plugin-kkk/issues`),children:[(0,T.jsx)(u,{size:18,"aria-hidden":`true`}),(0,T.jsx)(`span`,{children:`反馈问题`})]})]})]})]})]})},D=`https://github.com/ikenxuan.png`,O=({className:t})=>{let{isDark:n,toggleTheme:i}=a();return(0,T.jsxs)(r,{delay:1,closeDelay:1,children:[(0,T.jsx)(e,{isIconOnly:!0,"aria-label":n?`切换到浅色模式`:`切换到深色模式`,className:t,variant:`ghost`,onPress:i,children:n?(0,T.jsx)(w,{size:20,"aria-hidden":`true`}):(0,T.jsx)(v,{size:20,"aria-hidden":`true`})}),(0,T.jsx)(r.Content,{children:n?`浅色模式`:`深色模式`})]})};export{b as a,f as c,S as i,c as l,D as n,g as o,E as r,m as s,O as t};
1
+ import{D as e,E as t,St as n,d as r,o as i,r as a,x as o}from"./index-Zn_7piH-.js";var s={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};s.node;var c=i(s),l={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};l.node;var u=i(l),d={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};d.node;var f=i(d),p={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};p.node;var m=i(p),h={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};h.node;var g=i(h),_={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};_.node;var v=i(_),y={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};y.node;var b=i(y),x={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};x.node;var S=i(x),C={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};C.node;var w=i(C),T=n(),E=()=>{let n=e=>{window.open(e,`_blank`)};return(0,T.jsxs)(t,{className:`mx-auto max-w-3xl`,children:[(0,T.jsxs)(t.Header,{className:`items-center text-center gap-4 pt-8 pb-6`,children:[(0,T.jsx)(b,{size:64,"aria-hidden":`true`}),(0,T.jsx)(t.Title,{children:`karin-plugin-kkk`}),(0,T.jsx)(t.Description,{children:`版本 2.33.0`})]}),(0,T.jsxs)(t.Content,{className:`flex flex-col gap-6 pb-8`,children:[(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`插件简介`}),(0,T.jsx)(o,{children:`Karin 的「抖音」「B站」视频解析/动态推送插件。 支持视频解析、动态推送、扫码登录等功能。`})]}),(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`开发者`}),(0,T.jsx)(o,{children:`ikenxuan, sj817`})]}),(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{className:`mb-3 text-base font-semibold`,children:`相关链接`}),(0,T.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3`,children:[(0,T.jsxs)(e,{variant:`outline`,onPress:()=>n(`https://github.com/ikenxuan/karin-plugin-kkk`),children:[(0,T.jsx)(u,{size:18,"aria-hidden":`true`}),(0,T.jsx)(`span`,{children:`GitHub 仓库`})]}),(0,T.jsxs)(e,{variant:`outline`,onPress:()=>n(`https://github.com/ikenxuan/karin-plugin-kkk/issues`),children:[(0,T.jsx)(u,{size:18,"aria-hidden":`true`}),(0,T.jsx)(`span`,{children:`反馈问题`})]})]})]})]})]})},D=`https://github.com/ikenxuan.png`,O=({className:t})=>{let{isDark:n,toggleTheme:i}=a();return(0,T.jsxs)(r,{delay:1,closeDelay:1,children:[(0,T.jsx)(e,{isIconOnly:!0,"aria-label":n?`切换到浅色模式`:`切换到深色模式`,className:t,variant:`ghost`,onPress:i,children:n?(0,T.jsx)(w,{size:20,"aria-hidden":`true`}):(0,T.jsx)(v,{size:20,"aria-hidden":`true`})}),(0,T.jsx)(r.Content,{children:n?`浅色模式`:`深色模式`})]})};export{b as a,f as c,S as i,c as l,D as n,g as o,E as r,m as s,O as t};
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CronEditor-SToxfZLf.js","assets/separator-BQ8-sWCU.js","assets/DesktopLayout-wpebBuCj.js","assets/ThemeSwitch-Cm4QAM5e.js","assets/MobileLayout-DhcWgEcj.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CronEditor-Bvl90nHa.js","assets/separator-CFLVDixH.js","assets/DesktopLayout-t8vT4Hmg.js","assets/ThemeSwitch-DNCjCIP-.js","assets/MobileLayout-CTAoQc-J.js"])))=>i.map(i=>d[i]);
2
2
  var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function te(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ne(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else te(ne.bind(null,e))}var re={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ne,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=te,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),re=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),oe=Symbol.for(`react.memo_cache_sentinel`),se=Symbol.for(`react.view_transition`),L=Symbol.for(`react.recoverable`),ce=Symbol.iterator;function le(e){return typeof e!=`object`||!e?null:(e=ce&&e[ce]||e[`@@iterator`],typeof e==`function`?e:null)}var ue=Symbol.for(`react.client.reference`);function de(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case ie:return`Activity`;case se:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?de(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var fe=Array.isArray,R=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function ve(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function ye(e,t){ge++,he[ge]=e.current,e.current=t}var be=_e(null),xe=_e(null),Se=_e(null),Ce=_e(null);function we(e,t){switch(ye(Se,t),ye(xe,e),ye(be,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mp(t),e=hp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ve(be),ye(be,e)}function Te(){ve(be),ve(xe),ve(Se)}function Ee(e){var t=e.memoizedState;t!==null&&(dh._currentValue=t.memoizedState,ye(Ce,e)),t=be.current;var n=hp(t,e.type);t!==n&&(ye(xe,e),ye(be,n))}function De(e){xe.current===e&&(ve(be),ve(xe)),Ce.current===e&&(ve(Ce),dh._currentValue=me)}var Oe,ke;function Ae(e){if(Oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||``,ke=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Oe+e+ke}var je=!1;function Me(e,t){if(!e||je)return``;je=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -44,4 +44,4 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
44
44
  style="stroke: #88f; stroke-width: 2px; fill: none; stroke-opacity: 0.5; marker-end: url(#markerArrow);"
45
45
  ></path>
46
46
  </svg>
47
- </div>`),e.hasArrows=!0}format_textdiff(e,t){e.out(`<div class="jsondiffpatch-value">`),this.formatTextDiffString(e,t[0]),e.out(`</div>`)}};function dB(e){if(typeof e==`number`)return e;let t=String(e);for(let e of[[/&/g,`&amp;`],[/</g,`&lt;`],[/>/g,`&gt;`],[/'/g,`&apos;`],[/"/g,`&quot;`]])t=t.replace(e[0],e[1]);return t}var fB=function(e){let t=e||document,n=({textContent:e,innerText:t})=>e||t,r=(e,t,n)=>{let r=e.querySelectorAll(t);for(let e=0,t=r.length;e<t;e++)n(r[e])},i=({children:e},t)=>{for(let n=0,r=e.length;n<r;n++){let r=e[n];r&&t(r,n)}};r(t,`.jsondiffpatch-arrow`,({parentNode:e,children:t,style:r})=>{let a=e,o=t[0],s=o.children[1];o.style.display=`none`;let c=a.querySelector(`.jsondiffpatch-moved-destination`);if(!(c instanceof HTMLElement))return;let l=n(c),u=a.parentNode;if(!u)return;let d;if(i(u,e=>{e.getAttribute(`data-key`)===l&&(d=e)}),d)try{let e=d.offsetTop-a.offsetTop;o.setAttribute(`height`,`${Math.abs(e)+6}`),r.top=`${-8+(e>0?0:e)}px`;let t=e>0?`M30,0 Q-10,${Math.round(e/2)} 26,${e-4}`:`M30,${-e} Q-10,${Math.round(-e/2)} 26,4`;s.setAttribute(`d`,t),o.style.display=``}catch(e){console.debug(`[jsondiffpatch] error adjusting arrows: ${e}`)}})},pB=(e,t,n)=>{let r=t||document.body,i=`jsondiffpatch-unchanged-`,a={showing:`${i}showing`,hiding:`${i}hiding`,visible:`${i}visible`,hidden:`${i}hidden`},o=r.classList;if(!o)return;if(!n){o.remove(a.showing),o.remove(a.hiding),o.remove(a.visible),o.remove(a.hidden),e===!1&&o.add(a.hidden);return}e===!1?(o.remove(a.showing),o.add(a.visible),setTimeout(()=>{o.add(a.hiding)},10)):(o.remove(a.hiding),o.add(a.showing),o.remove(a.hidden));let s=setInterval(()=>{fB(r)},100);setTimeout(()=>{o.remove(a.showing),o.remove(a.hiding),e===!1?(o.add(a.hidden),o.remove(a.visible)):(o.add(a.visible),o.remove(a.hidden)),setTimeout(()=>{o.remove(a.visible),clearInterval(s)},n+400)},n)},mB=(e,t)=>pB(!1,e,t),hB;function gB(e,t){return hB||=new uB,hB.format(e,t)}var _B=e=>e.join(`.`),vB=e=>!!(e&&typeof e==`object`),Q=(e,t,n)=>e?t.reduce((e,t)=>{if(vB(e))return e[t]},e)??n:n,yB=(e,t,n)=>{let r=structuredClone(e),i=r;for(let e=0;e<t.length-1;e++){let n=t[e],r=i[n];vB(r)||(i[n]={}),i=i[n]}return i[t[t.length-1]]=n,r},bB=(e,t)=>{let n=Number(e);return Number.isFinite(n)?n:t},xB=(e,t)=>Array.isArray(e)&&e.includes(t),SB=e=>!!(e&&typeof e==`object`&&`description`in e),CB=e=>{if(!e||typeof e!=`object`)return e;let t=structuredClone(e);for(let{path:e,options:n}of[{path:[`bilibili`,`sendContent`],options:[`info`,`comment`,`video`,`image`]},{path:[`bilibili`,`displayContent`],options:[`cover`,`title`,`author`,`stats`,`desc`]},{path:[`bilibili`,`push`,`parseDynamicTypes`],options:[`DYNAMIC_TYPE_AV`,`DYNAMIC_TYPE_DRAW`,`DYNAMIC_TYPE_ARTICLE`]},{path:[`douyin`,`sendContent`],options:[`info`,`comment`,`video`,`image`]},{path:[`xiaohongshu`,`sendContent`],options:[`info`,`comment`,`video`,`image`]},{path:[`kuaishou`,`sendContent`],options:[`info`,`comment`,`video`,`image`]}]){let r=Q(t,e,null);if(!Array.isArray(r))continue;let i=n.filter(e=>r.includes(e)),a=t;for(let t=0;t<e.length-1;t++){let n=e[t];vB(a[n])||(a[n]={}),a=a[n]}a[e[e.length-1]]=i}return t},wB=e=>typeof e==`object`&&!!e,TB=e=>{let t={added:0,modified:0,deleted:0},n=e=>{if(wB(e)){if(Array.isArray(e)){e.length===1?t.added+=1:e.length===2?t.modified+=1:e.length===3&&e[2]===0&&(t.deleted+=1);return}for(let[t,r]of Object.entries(e))t!==`_t`&&n(r)}};return n(e),t},EB=({original:e,current:t,showUnchanged:n=!1})=>{let r=(0,v.useRef)(null),i=(0,v.useMemo)(()=>{if(e&&t)return cB(CB(e),CB(t))},[e,t]),a=(0,v.useMemo)(()=>e?CB(e):void 0,[e]),o=(0,v.useMemo)(()=>{if(i)return gB(i,a)},[i,a]),s=(0,v.useMemo)(()=>TB(i),[i]);return(0,v.useEffect)(()=>{r.current&&(o?(r.current.innerHTML=o,n?pB(!0,r.current):mB(r.current)):r.current.innerHTML=``)},[o,n]),o?(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(Rv,{size:`sm`,color:`success`,variant:`soft`,children:(0,H.jsxs)(Rv.Label,{children:[`+ `,s.added,` 新增`]})}),(0,H.jsx)(Rv,{size:`sm`,color:`warning`,variant:`soft`,children:(0,H.jsxs)(Rv.Label,{children:[`~ `,s.modified,` 修改`]})}),(0,H.jsx)(Rv,{size:`sm`,color:`danger`,variant:`soft`,children:(0,H.jsxs)(Rv.Label,{children:[`- `,s.deleted,` 删除`]})})]}),(0,H.jsx)(`div`,{className:`max-h-[60vh] overflow-auto rounded-xl border border-default-200 bg-surface p-4`,children:(0,H.jsx)(`div`,{ref:r,className:`min-w-fit`})})]}):(0,H.jsx)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-10 text-center`,children:(0,H.jsx)(aS,{className:`text-sm text-muted`,children:`当前没有检测到配置变更`})})},DB=`变更预览`,OB=`绿色 = 新增/改后的内容,红色 = 删除/改前的内容,灰色 = 没变化的内容。`,kB=({device:e,original:t,current:n,isOpen:r,onOpenChange:i})=>{let[a,o]=(0,v.useState)(!1),s=(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(aS,{className:`text-xs text-muted`,children:OB}),(0,H.jsx)(DC,{size:`sm`,isSelected:a,onChange:o,"aria-label":`显示未变更字段`,children:(0,H.jsxs)(DC.Content,{children:[(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})}),`显示未变更`]})})]}),(0,H.jsx)(EB,{original:t,current:n,showUnchanged:a})]}),c=(0,H.jsx)(ov,{slot:`close`,size:`sm`,variant:`secondary`,children:`关闭`});return e===`mobile`?(0,H.jsx)(wS,{children:(0,H.jsx)(wS.Backdrop,{isOpen:r,onOpenChange:i,children:(0,H.jsx)(wS.Content,{placement:`bottom`,children:(0,H.jsxs)(wS.Dialog,{className:`h-[85vh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsx)(wS.Header,{children:(0,H.jsx)(wS.Heading,{children:DB})}),(0,H.jsx)(wS.Body,{children:s}),(0,H.jsx)(wS.Footer,{children:c})]})})})}):(0,H.jsx)(qS,{children:(0,H.jsx)(qS.Backdrop,{isOpen:r,onOpenChange:i,children:(0,H.jsx)(qS.Container,{scroll:`inside`,size:`lg`,children:(0,H.jsxs)(qS.Dialog,{className:`w-full max-w-4xl`,children:[(0,H.jsx)(qS.CloseTrigger,{}),(0,H.jsxs)(qS.Header,{children:[(0,H.jsx)(qS.Icon,{className:`bg-accent-soft text-accent-soft-foreground`,children:(0,H.jsx)(SP,{className:`size-5`})}),(0,H.jsx)(qS.Heading,{children:DB})]}),(0,H.jsx)(qS.Body,{children:s}),(0,H.jsx)(qS.Footer,{children:c})]})})})})},AB=e=>!!(e&&typeof e==`object`),$=(e,t,n)=>e?t.reduce((e,t)=>{if(AB(e))return e[t]},e)??n:n,jB=(e,t)=>Array.isArray(e)&&e.includes(t),MB=[{path:[`app`,`priority`],rules:[{condition:e=>$(e,[`app`,`videoTool`],!0),message:`修改此配置项需要先将「默认解析优先级」关闭`}]},{path:[`app`,`multiPageHeight`],rules:[{condition:e=>!$(e,[`app`,`multiPageRender`],!0),message:`修改此配置项需要先将「分页渲染」打开`}]},{path:[`app`,`livePhotoSystem`],rules:[{condition:e=>$(e,[`app`,`livePhotoMode`],`video_and_livephoto`)===`video_only`,message:`修改此配置项需要先将「Live Photo 处理和发送方式」改为非「仅视频」模式`}]},{path:[`amagi`,`APIServerMount`],rules:[{condition:e=>!$(e,[`amagi`,`APIServer`],!1),message:`修改此配置项需要先将「API 服务」打开`}]},{path:[`amagi`,`APIServerPort`],rules:[{condition:e=>$(e,[`amagi`,`APIServerMount`],!0),message:`修改此配置项需要先将「挂载到 Karin」关闭`}]},{path:[`app`,`qrLoginExternalAddr`],rules:[{condition:e=>$(e,[`app`,`qrLoginAddrType`],`lan`)!==`external`,message:`修改此配置项需要先将「扫码登录地址」改为「外部地址」`}]},{path:[`app`,`videoSendMode`],rules:[{condition:e=>$(e,[`app`,`usegroupfile`],!1),message:`修改此配置项需要先将「群文件上传」关闭`}]},{path:[`app`,`usegroupfile`],rules:[{condition:e=>$(e,[`app`,`videoSendMode`],`file`)===`base64`,message:`修改此配置项需要先将「本地视频发送方式」改为「File 协议」`}]},{path:[`app`,`groupfilevalue`],rules:[{condition:e=>!$(e,[`app`,`usegroupfile`],!1),message:`修改此配置项需要先将「群文件上传」打开`},{condition:e=>$(e,[`app`,`videoSendMode`],`file`)===`base64`,message:`修改此配置项需要先将「本地视频发送方式」改为「File 协议」`}]},{path:[`app`,`filelimit`],rules:[{condition:e=>!$(e,[`app`,`usefilelimit`],!1),message:`修改此配置项需要先将「视频上传拦截」打开`}]},{path:[`app`,`compresstrigger`],rules:[{condition:e=>!$(e,[`app`,`compress`],!1),message:`修改此配置项需要先将「压缩视频」打开`}]},{path:[`app`,`compressvalue`],rules:[{condition:e=>!$(e,[`app`,`compress`],!1),message:`修改此配置项需要先将「压缩视频」打开`}]},{path:[`app`,`downloadMaxSpeed`],rules:[{condition:e=>!$(e,[`app`,`downloadThrottle`],!1),message:`修改此配置项需要先将「下载限速」打开`}]},{path:[`app`,`downloadAutoReduce`],rules:[{condition:e=>!$(e,[`app`,`downloadThrottle`],!1),message:`修改此配置项需要先将「下载限速」打开`}]},{path:[`app`,`downloadMinSpeed`],rules:[{condition:e=>!$(e,[`app`,`downloadThrottle`],!1),message:`修改此配置项需要先将「下载限速」打开`},{condition:e=>!$(e,[`app`,`downloadAutoReduce`],!1),message:`修改此配置项需要先将「断流自动降速」打开`}]},{path:[`amagi`,`proxy`,`protocol`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`host`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`port`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`auth`,`username`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`auth`,`password`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`douyin`,`sendContent`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`numcomment`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`douyin`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`douyin`,`subCommentLimit`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`douyin`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`douyin`,`commentImageCollection`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`douyin`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`douyin`,`liveImageMergeMode`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`app`,`livePhotoMode`],`video_and_livephoto`)===`livephoto_only`,message:`修改此配置项需要先将「Live Photo 处理和发送方式」改为非「仅实况图」模式`}]},{path:[`douyin`,`videoQuality`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`maxAutoVideoSize`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`douyin`,`videoQuality`],`adapt`)!==`adapt`,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]},{path:[`douyin`,`videoInfoMode`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`displayContent`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`douyin`,`videoInfoMode`],`text`)===`image`,message:`修改此配置项需要先将「视频信息返回形式」改为「文本模式」`}]},{path:[`douyin`,`burnDanmaku`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`danmakuArea`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`danmakuFontSize`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`danmakuOpacity`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`verticalMode`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`videoCodec`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`push`,`permission`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`cron`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`parsedynamic`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`shareType`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`pushVideoQuality`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`pushMaxAutoVideoSize`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>$(e,[`douyin`,`push`,`pushVideoQuality`],`adapt`)!==`adapt`,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]},{path:[`bilibili`,`sendContent`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`numcomment`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`bilibili`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`bilibili`,`realCommentCount`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`bilibili`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`bilibili`,`commentImageCollection`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`bilibili`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`bilibili`,`videoQuality`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`maxAutoVideoSize`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>Number($(e,[`bilibili`,`videoQuality`],0))!==0,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]},{path:[`bilibili`,`videoInfoMode`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`displayContent`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`bilibili`,`videoInfoMode`],`text`)===`image`,message:`修改此配置项需要先将「视频信息返回形式」改为「文本模式」`}]},{path:[`bilibili`,`showDanmakuInVideoInfo`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`bilibili`,`videoInfoMode`],`text`)===`text`,message:`修改此配置项需要先将「视频信息返回形式」改为「图片模式」`}]},{path:[`bilibili`,`burnDanmaku`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`danmakuArea`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`danmakuFontSize`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`danmakuOpacity`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`verticalMode`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`videoCodec`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`push`,`permission`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`bilibili`,`push`,`cron`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`bilibili`,`push`,`parsedynamic`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`bilibili`,`push`,`parseDynamicTypes`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>!$(e,[`bilibili`,`push`,`parsedynamic`],!1),message:`修改此配置项需要先将「作品解析」打开`}]},{path:[`bilibili`,`push`,`pushVideoQuality`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>!$(e,[`bilibili`,`push`,`parsedynamic`],!1),message:`修改此配置项需要先将「作品解析」打开`}]},{path:[`bilibili`,`push`,`pushMaxAutoVideoSize`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>!$(e,[`bilibili`,`push`,`parsedynamic`],!1),message:`修改此配置项需要先将「作品解析」打开`},{condition:e=>Number($(e,[`bilibili`,`push`,`pushVideoQuality`],0))!==0,message:`修改此配置项需要先将「解析视频动态时的画质偏好」改为「自动选择」`}]},{path:[`kuaishou`,`comment`],rules:[{condition:e=>!$(e,[`kuaishou`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`kuaishou`,`numcomment`],rules:[{condition:e=>!$(e,[`kuaishou`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`kuaishou`,`comment`],!1),message:`修改此配置项需要先将「评论解析」打开`}]},{path:[`xiaohongshu`,`sendContent`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`xiaohongshu`,`numcomment`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`xiaohongshu`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`xiaohongshu`,`videoQuality`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`xiaohongshu`,`maxAutoVideoSize`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`xiaohongshu`,`videoQuality`],`adapt`)!==`adapt`,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]}],NB=e=>e.join(`.`),PB=(e,t)=>{let n=NB(t),r=MB.find(e=>NB(e.path)===n);if(!r)return``;for(let t of r.rules)if(t.condition(e))return t.message;return``},FB=[{label:`信息`,value:`info`},{label:`评论图`,value:`comment`},{label:`视频`,value:`video`},{label:`图片`,value:`image`}],IB=[{label:`封面`,value:`cover`},{label:`标题`,value:`title`},{label:`作者`,value:`author`},{label:`统计`,value:`stats`},{label:`简介`,value:`desc`}],LB=[{label:`自动选择`,value:`adapt`,description:`根据「视频体积上限(MB)」自动选择分辨率进行下载`},{label:`标清 540p`,value:`540p`},{label:`高清 720p`,value:`720p`},{label:`高清 1080p`,value:`1080p`},{label:`超清 2k`,value:`2k`},{label:`超清 4k`,value:`4k`}],RB=[{label:`自动选择`,value:`0`},{label:`240P 极速`,value:`6`},{label:`360P 流畅`,value:`16`},{label:`480P 清晰`,value:`32`,description:`需登录(配置ck)`},{label:`720P 高清`,value:`64`,description:`需登录(配置ck)`},{label:`720P60 高帧率`,value:`74`,description:`需登录(配置ck)`},{label:`1080P 高清`,value:`80`,description:`需登录(配置ck)`},{label:`1080P+ 高码率`,value:`112`,description:`需大会员&视频支持`},{label:`1080P60 高帧率`,value:`116`,description:`需大会员&视频支持`},{label:`4K 超清`,value:`120`,description:`需大会员&视频支持`},{label:`8K 超高清`,value:`127`,description:`需大会员&视频支持`}],zB=[{label:`视频动态`,value:`DYNAMIC_TYPE_AV`},{label:`图文动态`,value:`DYNAMIC_TYPE_DRAW`},{label:`文章动态`,value:`DYNAMIC_TYPE_ARTICLE`}],BB=[{label:`所有人`,value:`all`},{label:`管理员`,value:`admin`},{label:`主人`,value:`master`},{label:`群主`,value:`group.owner`},{label:`群管理员`,value:`group.admin`}],VB=[{label:`H.264`,value:`h264`,description:`兼容性最好,支持几乎所有设备`},{label:`H.265`,value:`h265`,description:`压缩率更高,近几年设备支持良好(推荐)`},{label:`AV1`,value:`av1`,description:`最新编码格式,压缩率最高,但编码较慢`}],HB=[{label:`关闭`,value:`off`,description:`保持原始比例,不做转换`},{label:`智能`,value:`standard`,description:`仅对宽屏比例视频生效`},{label:`强制 9:16`,value:`force`,description:`所有视频统一转为 9:16 竖屏`}],UB=[{label:`1/4 屏`,value:`0.25`,description:`仅顶部区域`},{label:`半屏`,value:`0.5`,description:`上半部分(推荐)`},{label:`3/4 屏`,value:`0.75`,description:`大部分区域`},{label:`全屏`,value:`1`,description:`铺满整个画面`}],WB=[{label:`小号`,value:`small`},{label:`中号`,value:`medium`},{label:`大号`,value:`large`}],GB={enabled:`已开启`,disabled:`已关闭`},KB=[{key:`amagi`,label:`接口库`,description:`请求与 Cookies`},{key:`app`,label:`通用`,description:`运行与交互`},{key:`douyin`,label:`抖音`,description:`解析与推送`},{key:`bilibili`,label:`哔哩哔哩`,description:`解析与推送`},{key:`kuaishou`,label:`快手`,description:`快手解析`},{key:`xiaohongshu`,label:`小红书`,description:`小红书解析`},{key:`pushlist`,label:`推送列表`,description:`订阅 JSON`}],qB=(0,v.lazy)(()=>AT(()=>import(`./CronEditor-SToxfZLf.js`),__vite__mapDeps([0,1]))),JB=({className:e,disabled:t,...n})=>{let[r,i]=(0,v.useState)(!1),a=r?`隐藏密码`:`显示密码`;return(0,H.jsxs)(`div`,{className:`relative w-full`,children:[(0,H.jsx)(PS,{...n,variant:`secondary`,className:`w-full pr-10 ${e??``}`,type:r?`text`:`password`}),(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":a,className:`absolute right-1 top-1/2 -translate-y-1/2`,isDisabled:t,size:`sm`,type:`button`,variant:`tertiary`,onPress:()=>i(e=>!e),children:r?(0,H.jsx)(vP,{className:`size-4`,"aria-hidden":`true`}):(0,H.jsx)(bP,{className:`size-4`,"aria-hidden":`true`})})]})},YB=({config:e,device:t,classes:n,validationErrors:r,updateConfigValue:i})=>{let a=e=>{let n=SB(e)?e:{description:e},r=t===`mobile`?n.mobileContent??n.desktopContent:n.desktopContent;return(0,H.jsxs)(aS,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:n.description}),r?(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{"aria-label":`查看详细说明`,children:(0,H.jsx)(ov,{isIconOnly:!0,size:`sm`,variant:`tertiary`,children:(0,H.jsx)(wP,{className:`size-4`,"aria-hidden":`true`})})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:t===`mobile`?`bottom`:`top`,children:[(0,H.jsx)(uw.Arrow,{}),(0,H.jsx)(`div`,{className:`max-w-72`,children:r})]})]}):null,n.extra]})},o=(n,r,i)=>{if(!i)return n;let a=PB(e,r);return a?t===`mobile`?(0,H.jsxs)(ZS,{children:[(0,H.jsx)(ZS.Trigger,{className:`w-full cursor-not-allowed`,children:n}),(0,H.jsx)(ZS.Content,{placement:`bottom`,children:(0,H.jsxs)(ZS.Dialog,{children:[(0,H.jsx)(ZS.Arrow,{}),(0,H.jsx)(`div`,{className:`max-w-72 text-sm`,children:a})]})})]}):(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{className:`w-full cursor-not-allowed`,children:n}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),(0,H.jsx)(`div`,{className:`max-w-72`,children:a})]})]}):n},s=(t,n,r,a)=>{let o=Q(e,t,[]),s=r?Array.from(new Set([...o,n])):o.filter(e=>e!==n);if(a&&r){let e=a.find(e=>e.includes(n));if(e){let t=e.filter(e=>e!==n);s=s.filter(e=>!t.includes(e))}}i(t,s)};return{renderSwitch:(t,n,r,s=!1)=>{let c=Q(e,t,!1),l=(0,H.jsxs)(DC,{isDisabled:s,isSelected:c,onChange:e=>i(t,e),children:[(0,H.jsxs)(DC.Content,{children:[(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})}),(0,H.jsx)(`span`,{className:`font-semibold`,children:n})]}),a(r||(c?GB.enabled:GB.disabled))]});return o(l,t,s)},renderTextField:(t,n,s,c)=>{let l=c?.type||`text`,u=String(Q(e,t,l===`number`?c?.fallback??0:``)),d=r[_B(t)],f=c?.disabled??!1,p=(0,H.jsxs)(MC,{fullWidth:!0,isInvalid:!!d,isDisabled:f,name:t.join(`.`),type:l,value:u,onChange:e=>{i(t,l===`number`?bB(e,c?.fallback??0):e)},children:[(0,H.jsx)(IS,{className:`font-semibold`,children:n}),l===`password`?(0,H.jsx)(JB,{disabled:f,max:c?.max,min:c?.min,pattern:c?.pattern,placeholder:c?.placeholder||n,step:c?.step}):(0,H.jsx)(PS,{variant:`secondary`,max:c?.max,min:c?.min,pattern:c?.pattern,placeholder:c?.placeholder||n,step:c?.step}),d?(0,H.jsx)(OS,{children:d}):a(s)]});return o(p,t,f)},renderSelectField:(t,n,r,s,c=e=>e,l=!1)=>{let u=String(Q(e,t,s[0]?.value||``)),d=s.filter(e=>e.disabled).map(e=>e.value),f=(0,H.jsxs)(uC,{disabledKeys:d,fullWidth:!0,isDisabled:l,name:t.join(`.`),placeholder:n,value:u,variant:`secondary`,onChange:e=>{e===null||Array.isArray(e)||i(t,c(String(e)))},children:[(0,H.jsx)(IS,{className:`font-semibold`,children:n}),(0,H.jsxs)(uC.Trigger,{children:[(0,H.jsx)(uC.Value,{}),(0,H.jsx)(uC.Indicator,{})]}),a(r),(0,H.jsx)(uC.Popover,{children:(0,H.jsx)(US,{children:s.map(e=>(0,H.jsxs)(US.Item,{id:e.value,textValue:e.label,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(IS,{children:e.label}),e.description?(0,H.jsx)(aS,{children:e.description}):null]}),(0,H.jsx)(US.ItemIndicator,{})]},e.value))})})]});return o(f,t,l)},renderCheckboxGroup:(t,r,i,c,l=!1,u)=>{let d=Q(e,t,[]),f=(0,H.jsxs)(`div`,{className:n.field,children:[(0,H.jsx)(IS,{className:`font-semibold`,children:r}),a(i),(0,H.jsx)(`div`,{className:n.choiceGrid,children:c.map(e=>{let n=xB(d,e.value);return(0,H.jsxs)(Pv,{variant:`secondary`,isDisabled:l,isSelected:n,onChange:n=>s(t,e.value,n,u),children:[(0,H.jsxs)(Pv.Content,{children:[(0,H.jsx)(Pv.Control,{children:(0,H.jsx)(Pv.Indicator,{})}),e.label]}),e.description?(0,H.jsx)(aS,{children:e.description}):null]},e.value)})})]});return o(f,t,l)},renderSlider:(t,r,s,c)=>{let l=Q(e,t,c?.fallback??0),u=c?.disabled??!1,d=(0,H.jsxs)(`div`,{className:n.field,children:[(0,H.jsxs)(hC,{className:`w-full`,isDisabled:u,value:l,formatOptions:c?.formatOptions??{style:`percent`,maximumFractionDigits:0},maxValue:c?.max??1,minValue:c?.min??0,step:c?.step??.01,onChange:e=>{Array.isArray(e)||i(t,e)},children:[(0,H.jsx)(IS,{className:`font-semibold`,children:r}),(0,H.jsx)(hC.Output,{}),(0,H.jsxs)(hC.Track,{children:[(0,H.jsx)(hC.Fill,{}),(0,H.jsx)(hC.Thumb,{})]})]}),a(s)]});return o(d,t,u)},renderCronField:(r,a,s,c=!1)=>{let l=Q(e,r,`*/10 * * * *`),u=(0,H.jsx)(`div`,{className:n.field,children:(0,H.jsx)(v.Suspense,{fallback:(0,H.jsx)(`div`,{className:`h-64 animate-pulse rounded-lg bg-muted/30`}),children:(0,H.jsx)(qB,{device:t,disabled:c,value:l,onChange:e=>i(r,e)})})});return o(u,r,c)},renderPageHeader:(e,n)=>(0,H.jsxs)(`div`,{className:`mb-6 ${t===`mobile`?`pr-36`:``}`,"data-config-section":!0,children:[(0,H.jsx)(`h2`,{className:`text-2xl font-bold`,children:e}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(aS,{children:n})})]}),renderSubSection:(e,t)=>(0,H.jsxs)(lv,{"data-config-section":!0,className:`mb-4`,children:[(0,H.jsx)(lv.Header,{className:n.sectionHeader,children:(0,H.jsx)(lv.Title,{className:`text-lg font-semibold`,children:e})}),(0,H.jsx)(lv.Content,{className:n.sectionContent,children:(0,H.jsx)(`div`,{className:n.fields,children:t})})]})}},XB={root:`relative flex min-w-0 max-w-full flex-col gap-8`,loading:`flex min-h-80 items-center justify-center gap-3`,header:`grid grid-cols-[minmax(0,1fr)_auto] items-start gap-8 pr-44`,headerCopy:`flex min-w-0 flex-col gap-2`,form:`flex min-w-0 max-w-full flex-col gap-6`,floatingActions:`fixed right-6 top-20 z-10`,actionControls:`flex items-center justify-end gap-3`,sectionHeader:`p-2`,sectionContent:`p-6`,fields:`grid grid-cols-2 gap-x-6 gap-y-5`,field:`flex min-w-0 flex-col gap-2`,choiceGrid:`grid grid-cols-2 gap-3`,divider:`col-span-full flex min-w-0 flex-col gap-2 pt-3`,tabsListContainer:`w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden overscroll-x-contain overscroll-y-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,tabsList:`w-fit min-w-max *:w-fit *:min-w-fit *:flex-none *:shrink-0 *:whitespace-nowrap`,topLevelFields:`mb-4 space-y-4 px-2`},ZB={root:`relative flex min-w-0 max-w-full flex-col gap-5`,loading:`flex min-h-80 items-center justify-center gap-3`,header:`flex flex-col gap-3 pt-12`,headerCopy:`flex min-w-0 flex-col gap-2`,form:`flex min-w-0 max-w-full flex-col gap-3`,floatingActions:`sticky top-0 z-20 flex h-0 w-full justify-end overflow-visible`,actionControls:`flex w-fit h-11 p-1 items-center gap-2 rounded-full border border-default-200 bg-background/90 shadow-sm backdrop-blur-md`,sectionHeader:`p-1`,sectionContent:`p-0`,fields:`grid grid-cols-1 gap-5`,field:`flex min-w-0 flex-col gap-2`,choiceGrid:`grid grid-cols-1 gap-3`,divider:`col-span-full flex min-w-0 flex-col gap-2 pt-3`,tabsListContainer:`w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden overscroll-x-contain overscroll-y-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,tabsList:`w-fit min-w-max *:w-fit *:min-w-fit *:flex-none *:shrink-0 *:whitespace-nowrap`,topLevelFields:`mb-4 space-y-4 px-4`},QB=e=>e===`mobile`?ZB:XB,$B=({config:e,renderers:t})=>{let{renderPageHeader:n,renderSelectField:r,renderSubSection:i,renderSwitch:a,renderTextField:o}=t,s=Q(e,[`amagi`,`proxy`,`switch`],!1),c=Q(e,[`amagi`,`APIServer`],!1);return(0,H.jsxs)(H.Fragment,{children:[n(`接口库配置`,`接口库的 Cookies、请求、代理和 API 服务配置。保存后后端会重载接口库客户端。`),i(`平台 Cookies`,(0,H.jsxs)(H.Fragment,{children:[o([`amagi`,`cookies`,`douyin`],`抖音 Cookies`,`请输入你的抖音Cookies,不输入则无法使用抖音相关功能噢。`,{type:`password`}),o([`amagi`,`cookies`,`bilibili`],`B站 Cookies`,`请输入你的B站Cookies,不输入部分功能将受限噢。`,{type:`password`}),o([`amagi`,`cookies`,`kuaishou`],`快手 Cookies`,`请输入你的快手Cookies,不输入则无法使用快手相关功能噢。`,{type:`password`}),o([`amagi`,`cookies`,`xiaohongshu`],`小红书 Cookies`,`请输入你的小红书Cookies,不输入则无法使用小红书相关功能噢。`,{type:`password`})]})),i(`请求配置`,(0,H.jsxs)(H.Fragment,{children:[o([`amagi`,`timeout`],`请求超时时间`,`网络请求的超时时间,单位:毫秒。`,{type:`number`,fallback:15e3,min:1e3,max:3e5}),o([`amagi`,`User-Agent`],`User-Agent`,`请求头中的User-Agent字段,用于标识客户端类型。`)]})),i(`代理配置(可选)`,(0,H.jsxs)(H.Fragment,{children:[a([`amagi`,`proxy`,`switch`],`代理开关`,`开启后需要配置「代理主机」「代理端口」。`),r([`amagi`,`proxy`,`protocol`],`代理协议`,`代理服务使用的协议。`,[{label:`HTTP`,value:`http`},{label:`HTTPS`,value:`https`}],e=>e,!s),o([`amagi`,`proxy`,`host`],`代理主机`,`代理服务器的主机地址,如:127.0.0.1。`,{disabled:!s}),o([`amagi`,`proxy`,`port`],`代理端口`,`代理服务器的端口号。`,{type:`number`,fallback:7890,min:1,max:65535,disabled:!s}),o([`amagi`,`proxy`,`auth`,`username`],`代理用户名`,`代理服务器的认证用户名(如果需要)。`,{disabled:!s}),o([`amagi`,`proxy`,`auth`,`password`],`代理密码`,`代理服务器的认证密码(如果需要)。`,{type:`password`,disabled:!s})]})),i(`API 服务配置`,(0,H.jsxs)(H.Fragment,{children:[a([`amagi`,`APIServer`],`API 服务`,`本地部署一个视频解析API服务,接口范围为本插件用到的所有。`),a([`amagi`,`APIServerMount`],`挂载到 Karin`,`API 服务是否挂载到 Karin 上,开启后监听端口为 Karin 的 http 端口,修改后需重启。需开启「API服务」。`,!c),o([`amagi`,`APIServerPort`],`API 服务端口`,`仅未挂载到 Karin 时生效。`,{type:`number`,disabled:Q(e,[`amagi`,`APIServerMount`],!0),fallback:4567,min:1024,max:65535})]}))]})},eV=({config:e,renderers:t})=>{let{renderCheckboxGroup:n,renderPageHeader:r,renderSelectField:i,renderSlider:a,renderSubSection:o,renderSwitch:s,renderTextField:c}=t,l=Q(e,[`app`,`livePhotoMode`],`video_and_livephoto`);return(0,H.jsxs)(H.Fragment,{children:[r(`通用`,`插件运行、渲染和交互相关配置。`),o(`缓存设置`,(0,H.jsx)(H.Fragment,{children:s([`app`,`removeCache`],`自动删除视频缓存`,`任务完成后删除下载缓存。`)})),o(`交互设置`,(0,H.jsxs)(H.Fragment,{children:[s([`app`,`EmojiReply`],`表情回应`,`在解析任务开始时添加表情回应,若适配器不支持需要关闭。`),s([`app`,`parseTip`],`解析提示`,`发送提示信息:"检测到xxx链接,开始解析"。`),s([`app`,`fakeForward`],`伪造合并转发消息`,`开启后合并转发将使用触发者身份展示;关闭后使用机器人身份展示。`),n([`app`,`errorLogSendTo`],`错误日志`,`遇到错误时谁会收到错误日志。注:推送任务只可发送给主人。「第一个主人」与「所有主人」互斥。`,[{label:`第一个主人`,value:`master`},{label:`所有主人`,value:`allMasters`},{label:`触发者的群聊`,value:`trigger`}],!1,[[`master`,`allMasters`]])]})),o(`渲染设置`,(0,H.jsxs)(H.Fragment,{children:[c([`app`,`renderScale`],`渲染精度`,`可选值50~200,建议100。设置高精度会提高图片的精细度,过高可能会影响渲染与发送速度。`,{type:`number`,fallback:100,min:50,max:200}),(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:i([`app`,`Theme`],`渲染图片的主题色`,`渲染评论图和推送图的主题色。`,[{label:`自动`,value:`0`,description:`06:00-18:00为浅色,18:00-06:00为深色`},{label:`浅色`,value:`1`},{label:`深色`,value:`2`},{label:`智能场景(实验性)`,value:`3`,description:`自动模式的超集;部分模板会根据封面色调 智能调整主题色,可能会出现不适配的情况。`}],e=>Number(e))}),(0,H.jsxs)(ZS,{children:[(0,H.jsx)(ZS.Trigger,{"aria-label":`封面氛围背景参数`,className:`mt-7 shrink-0`,children:(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":`封面氛围背景参数`,variant:`secondary`,children:(0,H.jsx)(RP,{className:`size-4`,"aria-hidden":`true`})})}),(0,H.jsx)(ZS.Content,{className:`w-90 max-w-[calc(100vw-2rem)]`,placement:`bottom`,children:(0,H.jsxs)(ZS.Dialog,{children:[(0,H.jsx)(ZS.Arrow,{}),(0,H.jsx)(ZS.Heading,{children:`封面氛围背景`}),(0,H.jsx)(`p`,{className:`mt-1 mb-5 text-sm text-muted`,children:`仅对使用封面氛围背景的模板生效(抖音视频/图文作品、B站视频信息、B站直播推荐动态)。`}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[a([`app`,`ambientCover`,`coverOpacity`],`封面氛围强度`,`封面图对背景氛围的贡献度,即模糊封面层的不透明度,越大封面色越浓。`,{fallback:.7}),a([`app`,`ambientCover`,`overlayEdgeOpacity`],`氛围压色(顶部/底部)`,`背景两端主题色压色罩的不透明度,越大两端越接近纯色主题背景。`,{fallback:.9}),a([`app`,`ambientCover`,`overlayMiddleOpacity`],`氛围压色(中间带)`,`背景中间带主题色压色罩的不透明度,越小封面色越透。`,{fallback:.2})]})]})})]})]}),c([`app`,`RenderWaitTime`],`渲染图片的等待时间`,`单位:秒,Linux系统下不能为0;其他系统传递 0 可禁用。`,{type:`number`,fallback:60,min:0}),s([`app`,`multiPageRender`],`分页渲染`,`将模板渲染成多页的图片,以降低渲染器压力,默认开启,非必要不修改!`),c([`app`,`multiPageHeight`],`分页渲染时,每页的高度`,`经测试最佳每页高度为12000px,默认12000px。`,{type:`number`,disabled:!Q(e,[`app`,`multiPageRender`],!0),fallback:12e3,min:1e3,max:2e4})]})),o(`更新推送设置`,(0,H.jsx)(H.Fragment,{children:n([`app`,`UpdateNotifyChannels`],`更新推送渠道`,`接收哪些渠道的版本更新推送;金丝雀构建经 pkg.pr.new 分发,不提供推送。`,[{label:`正式版`,value:`stable`},{label:`预览版`,value:`rc`},{label:`测试版`,value:`beta`}])})),o(`上传与下载设置`,(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(yC,{className:`flex flex-col gap-5 p-4 mb-4 rounded-3xl`,variant:`secondary`,children:[i([`app`,`videoSendMode`],`本地视频发送方式`,`选择本地视频交付给协议端的方式。`,[{label:`File 协议(本地文件)`,value:`file`,description:`使用 file 协议发送本地视频,需 Karin 与协议端在同一网络环境下`},{label:`Base64(编码传输)`,value:`base64`,description:`将本地视频转换为 base64 发送,传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本,适合 karin 和协议端不在同一网络环境`}],e=>e,Q(e,[`app`,`usegroupfile`],!1)),s([`app`,`usegroupfile`],`群文件上传`,`使用群文件上传,开启后会将视频文件上传到群文件中,需配置「群文件上传阈值」。与「本地视频发送方式 = Base64」互斥。`,Q(e,[`app`,`videoSendMode`],`file`)===`base64`),c([`app`,`groupfilevalue`],`群文件上传阈值`,`当文件大小超过该值时将使用群文件上传,单位:MB,「使用群文件上传」开启后才会生效。`,{type:`number`,fallback:100,min:1,disabled:!Q(e,[`app`,`usegroupfile`],!1)||Q(e,[`app`,`videoSendMode`],`file`)===`base64`})]}),(0,H.jsx)(yC,{className:`flex flex-col gap-5 p-4 mb-4 rounded-3xl`,variant:`secondary`,children:i([`app`,`imageSendMode`],`网络图片发送方式`,`图片资源发送给协议端的方式。`,[{label:`URL 链接(直接传递)`,value:`url`,description:`直接传递 HTTP 链接给上游下载,可能因上游网络问题导致下载超时`},{label:`File 协议(本地文件)`,value:`file`,description:`下载到本地后使用 file 协议发送,需 Karin 与协议端在同一网络环境下`},{label:`Base64(编码传输)`,value:`base64`,description:`下载后转换为 base64 发送,传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本`}])}),(0,H.jsxs)(yC,{className:`flex flex-col gap-5 p-4 mb-4 rounded-3xl`,variant:`secondary`,children:[s([`app`,`usefilelimit`],`视频上传拦截`,`开启后会根据视频文件大小判断是否需要上传,需配置「视频拦截阈值」。`),c([`app`,`filelimit`],`视频拦截阈值`,`视频文件大于该数值则直接结束任务,不会上传,单位: MB,「视频上传拦截」开启后才会生效。`,{type:`number`,fallback:20,min:1,disabled:!Q(e,[`app`,`usefilelimit`],!1)}),s([`app`,`compress`],`压缩视频`,`开启后会将视频文件压缩后再上传,适合上传大文件,任务过程中会吃满CPU,对低配服务器不友好。需配置「压缩触发阈值」与「压缩后的值」。`),c([`app`,`compresstrigger`],`压缩触发阈值`,`触发视频压缩的阈值,单位:MB。当文件大小超过该值时,才会压缩视频,「压缩视频」开启后才会生效。`,{type:`number`,fallback:80,min:1,disabled:!Q(e,[`app`,`compress`],!1)}),c([`app`,`compressvalue`],`压缩后的值`,`单位:MB,若视频文件大小大于「压缩触发阈值」的值,则会进行压缩至该值(±5%),「压缩视频」开启后才会生效。`,{type:`number`,fallback:30,min:1,disabled:!Q(e,[`app`,`compress`],!1)})]}),(0,H.jsxs)(yC,{className:`flex flex-col gap-5 p-4 rounded-3xl`,variant:`secondary`,children:[s([`app`,`downloadThrottle`],`下载限速`,`开启后会限制下载速度,避免触发服务器风控导致连接被重置(ECONNRESET)。如果下载时经常报错"连接被重置",建议开启。`),c([`app`,`downloadMaxSpeed`],`最大下载速度`,`限速开关打开后生效。单位:MB/s,建议值:10,根据实际情况调整。`,{type:`number`,fallback:10,min:1,max:100,disabled:!Q(e,[`app`,`downloadThrottle`],!1)}),s([`app`,`downloadAutoReduce`],`断流自动降速`,`限速开关打开后生效。当检测到下载中断时,自动降低下载速度,避免再次触发风控。`,!Q(e,[`app`,`downloadThrottle`],!1)),c([`app`,`downloadMinSpeed`],`最低下载速度`,`断流降速开关打开后生效。单位:MB/s,自动降速的下限值。`,{type:`number`,fallback:1,min:.5,max:50,disabled:!Q(e,[`app`,`downloadThrottle`],!1)||!Q(e,[`app`,`downloadAutoReduce`],!1)})]})]})),o(`Live Photo 兼容设置`,(0,H.jsxs)(H.Fragment,{children:[i([`app`,`livePhotoMode`],`Live Photo 处理和发送方式`,`解析遇到实况图时的处理和发送方式。注意:生成视频性能开销大,2C2G 服务器单张约需 20 秒。`,[{label:`视频 + 实况图`,value:`video_and_livephoto`,description:`生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)+ 对应系统的实况图`},{label:`仅视频`,value:`video_only`,description:`仅生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)`},{label:`仅实况图`,value:`livephoto_only`,description:`仅生成并发送对应系统的实况图,性能开销小`}]),i([`app`,`livePhotoSystem`],`Live Photo 静态图兼容系统`,`当解析到作品/动态包含 Live Photo 时,合并转发里发送的 Live Photo 静态图按所选系统生成。推荐 OPPO,兼容性最广。`,[{label:`Google`,value:`google`,description:`Google Motion Photo 格式`},{label:`小米(HyperOS)`,value:`xiaomi`,description:`兼容小米(任何版本)和 Google,但无法被 OPPO 识别`},{label:`OPPO(ColorOS)`,value:`oppo`,description:`推荐,兼容 OPPO、小米(较新版本)和 Google`},{label:`华为/荣耀(HarmonyOS/MagicOS)`,value:`huawei_honor`,description:`理论可行但未实测(作者无对应设备)`},{label:`vivo(Origin OS)`,value:`vivo`,description:`需要独立的图片和同名视频文件,暂不支持`,disabled:!0},{label:`iPhone(iOS)`,value:`iphone`,description:`需要独立的图片和同名视频文件,暂不支持`,disabled:!0}],e=>e,l===`video_only`)]})),o(`我的小玩具`,(0,H.jsxs)(H.Fragment,{children:[s([`app`,`videoTool`],`默认解析优先级`,`关闭后使用自定义优先级,修改后需重启。`),c([`app`,`priority`],`自定义优先级`,`默认解析优先级关闭后生效。`,{type:`number`,disabled:Q(e,[`app`,`videoTool`],!0),fallback:800}),i([`app`,`qrLoginAddrType`],`扫码登录地址`,`生成登录二维码时使用的服务器地址。`,[{label:`局域网`,value:`lan`,description:`适用于手机和服务器在同一局域网`},{label:`外部地址`,value:`external`,description:`适用于远程访问,需手动配置`}]),c([`app`,`qrLoginExternalAddr`],`外部访问地址`,`公网 IP 或域名,如:123.45.67.89 或 example.com。`,{disabled:Q(e,[`app`,`qrLoginAddrType`],`lan`)!==`external`})]}))]})},tV=({config:e,renderers:t,classes:n})=>{let{renderCheckboxGroup:r,renderCronField:i,renderPageHeader:a,renderSelectField:o,renderSubSection:s,renderSwitch:c,renderTextField:l}=t,u=Q(e,[`bilibili`,`switch`],!1),d=Q(e,[`bilibili`,`sendContent`],[]),f=Q(e,[`bilibili`,`burnDanmaku`],!1),p=Q(e,[`bilibili`,`videoQuality`],0),m=Q(e,[`bilibili`,`videoInfoMode`],`text`),h=Q(e,[`bilibili`,`push`,`switch`],!1),g=Q(e,[`bilibili`,`push`,`parsedynamic`],!1),_=Q(e,[`bilibili`,`push`,`pushVideoQuality`],0),v=!u||!xB(d,`comment`),y=!u||!f;return(0,H.jsxs)(H.Fragment,{children:[a(`哔哩哔哩`,`B站解析、动态图片布局、弹幕和推送基础设置。`),(0,H.jsxs)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:[c([`bilibili`,`switch`],`解析开关`,`B站解析开关,此开关为单独开关。`),r([`bilibili`,`sendContent`],`解析时发送的内容`,`若什么都不选,可能不会返回任何解析结果。`,FB.filter(e=>e.value!==`image`),!u)]}),s(`评论详情设置`,(0,H.jsxs)(H.Fragment,{children:[l([`bilibili`,`numcomment`],`评论解析数量`,`主评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:v}),c([`bilibili`,`realCommentCount`],`显示真实评论数量`,`关闭则显示解析到的评论数量。`,v),c([`bilibili`,`commentImageCollection`],`是否收集评论区的图片`,`开启后将收集评论区的图片,以合并转发的形式返回。`,v)]})),s(`渲染与画质设置`,(0,H.jsxs)(H.Fragment,{children:[o([`bilibili`,`videoQuality`],`画质偏好`,`解析视频的分辨率偏好。`,RB,Number,!u),l([`bilibili`,`maxAutoVideoSize`],`视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!u||Number(p)!==0}),o([`bilibili`,`imageLayout`],`解析图文动态时,遇到多张图片时的页面布局方式(动态推送图片也生效)`,`自动布局:少于4张时逐张上下排列;4~8张时瀑布流;9张及以上九宫格。`,[{label:`自动布局`,value:`auto`},{label:`逐张上下排列`,value:`vertical`},{label:`瀑布流排列`,value:`waterfall`},{label:`九宫格排列`,value:`grid`}]),o([`bilibili`,`videoInfoMode`],`视频信息返回形式`,`视频信息返回文本或图片。`,[{label:`图片模式`,value:`image`},{label:`文本模式`,value:`text`}],e=>e,!u),r([`bilibili`,`displayContent`],`视频信息前返回的内容`,`若什么都不选,则不会返回任何视频相关信息。`,IB,!u||m===`image`),c([`bilibili`,`showDanmakuInVideoInfo`],`视频信息图片中显示弹幕`,`开启后在视频信息图片的封面区域显示热门弹幕。关闭后不会请求弹幕数据,可提升解析速度。仅「视频信息返回形式」为图片模式时生效。`,!u||m===`text`)]})),s(`权限设置`,(0,H.jsx)(H.Fragment,{children:o([`bilibili`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)})),s(`弹幕烧录相关`,(0,H.jsxs)(H.Fragment,{children:[c([`bilibili`,`burnDanmaku`],`弹幕烧录`,`将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长,高分辨率视频会占用较多资源。`,!u),o([`bilibili`,`danmakuArea`],`弹幕区域`,`限制弹幕的显示范围,避免遮挡视频主体内容。`,UB,Number,y),o([`bilibili`,`danmakuFontSize`],`弹幕字号`,`弹幕文字大小。`,WB,e=>e,y),l([`bilibili`,`danmakuOpacity`],`弹幕透明度`,`0为完全透明,100为完全不透明,推荐70。`,{type:`number`,fallback:70,min:0,max:100,disabled:y}),o([`bilibili`,`verticalMode`],`竖屏适配`,`模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕。`,HB,e=>e,y),o([`bilibili`,`videoCodec`],`视频编码格式`,`弹幕烧录时使用的视频编码格式,会自动检测硬件加速。`,VB,e=>e,y)]})),s(`B站推送相关`,(0,H.jsxs)(H.Fragment,{children:[c([`bilibili`,`push`,`switch`],`推送开关`,`推送开关,修改后需重启;使用「#设置B站推送 + UID」配置推送列表。`),o([`bilibili`,`push`,`permission`],`谁可以设置推送`,`修改后需重启。`,BB,e=>e,!h),i([`bilibili`,`push`,`cron`],`定时任务表达式`,`定时推送的时间,支持可视化编辑或手动输入 cron 表达式。`,!h),c([`bilibili`,`push`,`parsedynamic`],`作品解析`,`触发推送时是否一同解析该作品。`,!h),r([`bilibili`,`push`,`parseDynamicTypes`],`需要解析的动态类型`,`选择推送时需要进一步解析的动态类型;未选择的类型只发送动态卡片。`,zB,!h||!g),o([`bilibili`,`push`,`pushVideoQuality`],`解析视频动态时的画质偏好`,`「作品解析」开启时生效,仅对视频动态有效。`,RB.filter(e=>e.value!==`127`),Number,!h||!g),l([`bilibili`,`push`,`pushMaxAutoVideoSize`],`视频动态的视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「解析视频动态时的画质偏好」 为 "自动选择" 且「作品解析」开启时生效,仅对视频动态有效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!h||!g||Number(_)!==0})]}))]})},nV=({config:e,renderers:t,classes:n})=>{let{renderCheckboxGroup:r,renderCronField:i,renderPageHeader:a,renderSelectField:o,renderSubSection:s,renderSwitch:c,renderTextField:l}=t,u=Q(e,[`app`,`livePhotoMode`],`video_and_livephoto`),d=Q(e,[`douyin`,`switch`],!1),f=Q(e,[`douyin`,`sendContent`],[]),p=Q(e,[`douyin`,`burnDanmaku`],!1),m=Q(e,[`douyin`,`videoQuality`],`adapt`),h=Q(e,[`douyin`,`videoInfoMode`],`text`),g=Q(e,[`douyin`,`push`,`switch`],!1),_=Q(e,[`douyin`,`push`,`pushVideoQuality`],`adapt`),v=!d||!xB(f,`comment`),y=!d||!p;return(0,H.jsxs)(H.Fragment,{children:[a(`抖音`,`抖音解析、画质、弹幕和推送基础设置。`),(0,H.jsxs)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:[c([`douyin`,`switch`],`解析开关`,`抖音解析开关,此开关为单独开关。`),r([`douyin`,`sendContent`],`解析时发送的内容`,`若什么都不选,可能不会返回任何解析结果。`,FB.filter(e=>e.value!==`image`),!d)]}),s(`评论详情设置`,(0,H.jsxs)(H.Fragment,{children:[l([`douyin`,`numcomment`],`评论解析数量`,`主评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:v}),l([`douyin`,`subCommentLimit`],`子评论请求数量`,`单条主评论下请求的子评论总条数(含多层嵌套)。注意:UI中最多显示 6 层回复嵌套,超出部分会被隐藏;因实际嵌套深度不可预知,配置数量不代表最终可见数量。`,{type:`number`,fallback:5,min:1,max:20,disabled:v}),c([`douyin`,`commentImageCollection`],`是否收集评论区的图片`,`开启后将收集评论区的图片,以合并转发的形式返回。`,v)]})),s(`渲染与画质设置`,(0,H.jsxs)(H.Fragment,{children:[o([`douyin`,`liveImageMergeMode`],`合辑 Live 图 BGM 合并方式`,`合辑 Live 图 BGM 合并方式,仅 Live Photo 模式不是「仅实况图」时生效。`,[{label:`连续`,value:`continuous`,description:`BGM 接续播放,结束后自动循环`},{label:`独立`,value:`independent`,description:`每张图 BGM 从头开始`}],e=>e,!d||u===`livephoto_only`),o([`douyin`,`videoQuality`],`画质偏好`,`解析视频的分辨率偏好。`,LB,e=>e,!d),l([`douyin`,`maxAutoVideoSize`],`视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!d||m!==`adapt`}),o([`douyin`,`videoInfoMode`],`视频信息返回形式`,`视频信息返回文本或图片。`,[{label:`图片模式`,value:`image`},{label:`文本模式`,value:`text`}],e=>e,!d),r([`douyin`,`displayContent`],`视频信息的内容`,`若什么都不选,则不会返回任何视频相关信息。`,IB.filter(e=>e.value!==`desc`),!d||h===`image`)]})),s(`权限设置`,(0,H.jsx)(H.Fragment,{children:o([`douyin`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)})),s(`弹幕烧录相关`,(0,H.jsxs)(H.Fragment,{children:[c([`douyin`,`burnDanmaku`],`弹幕烧录`,`将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长。`,!d),o([`douyin`,`danmakuArea`],`弹幕显示区域`,`限制弹幕范围,避免遮挡视频主体。`,UB,Number,y),o([`douyin`,`danmakuFontSize`],`弹幕字号`,`弹幕文字大小。`,WB,e=>e,y),l([`douyin`,`danmakuOpacity`],`弹幕透明度`,`0为完全透明,100为完全不透明,推荐70。`,{type:`number`,fallback:70,min:0,max:100,disabled:y}),o([`douyin`,`verticalMode`],`竖屏适配`,`针对横屏视频,模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕。`,HB,e=>e,y),o([`douyin`,`videoCodec`],`视频编码格式`,`烧录弹幕后的视频编码格式。`,VB,e=>e,y)]})),s(`抖音推送相关`,(0,H.jsxs)(H.Fragment,{children:[c([`douyin`,`push`,`switch`],`推送开关`,`推送开关,修改后需重启;使用「#设置抖音推送 + 抖音号」配置推送列表。`),o([`douyin`,`push`,`permission`],`谁可以设置推送`,`修改后需重启。`,BB,e=>e,!g),i([`douyin`,`push`,`cron`],`定时任务表达式`,`定时推送的时间,支持可视化编辑或手动输入 cron 表达式。`,!g),c([`douyin`,`push`,`parsedynamic`],`作品解析`,`触发推送时是否一同解析该作品。`,!g),o([`douyin`,`push`,`shareType`],`推送图二维码的类型`,`推送图二维码识别后的跳转类型。`,[{label:`网页链接`,value:`web`,description:`识别后访问抖音官网对应的作品地址`},{label:`下载链接`,value:`download`,description:`识别后访问无水印作品下载地址`}],e=>e,!g),o([`douyin`,`push`,`pushVideoQuality`],`画质偏好`,`推送解析时解析视频的分辨率偏好。`,LB,e=>e,!g),l([`douyin`,`push`,`pushMaxAutoVideoSize`],`视频体积上限(MB)`,`推送解析时根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!g||_!==`adapt`})]}))]})},rV=({config:e,renderers:t,classes:n})=>{let{renderPageHeader:r,renderSelectField:i,renderSubSection:a,renderSwitch:o,renderTextField:s}=t,c=Q(e,[`kuaishou`,`switch`],!1),l=Q(e,[`kuaishou`,`comment`],!1);return(0,H.jsxs)(H.Fragment,{children:[r(`快手`,`快手解析基础设置。`),(0,H.jsx)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:o([`kuaishou`,`switch`],`解析开关`,`快手解析开关,此开关为单独开关。`)}),a(`评论详情设置`,(0,H.jsxs)(H.Fragment,{children:[o([`kuaishou`,`comment`],`评论解析`,`快手评论解析,开启后可发送快手作品评论图。`,!c),s([`kuaishou`,`numcomment`],`评论解析数量`,`快手评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:!c||!l})]})),a(`权限设置`,(0,H.jsx)(H.Fragment,{children:i([`kuaishou`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)}))]})},iV=({children:e,disabled:t,message:n,device:r})=>t?r===`mobile`?(0,H.jsxs)(ZS,{children:[(0,H.jsx)(ZS.Trigger,{className:`w-full cursor-not-allowed`,children:e}),(0,H.jsxs)(ZS.Content,{placement:`bottom`,children:[(0,H.jsx)(ZS.Arrow,{}),(0,H.jsx)(`div`,{className:`px-3 py-2`,children:(0,H.jsx)(`p`,{className:`text-sm text-foreground`,children:n})})]})]}):(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{className:`w-full cursor-not-allowed`,children:e}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),n]})]}):e,aV=e=>e===`desktop`?`grid grid-cols-2 gap-4`:`flex flex-col gap-4`,oV=[{label:`作品列表`,value:`post`,description:`推送用户发布的作品`},{label:`喜欢列表`,value:`favorite`,description:`推送用户喜欢的作品`},{label:`推荐列表`,value:`recommend`,description:`推送推荐的作品`},{label:`直播`,value:`live`,description:`推送直播状态`}],sV=[{label:`投稿视频`,value:`video`,description:`推送UP主投稿的视频`},{label:`图文动态`,value:`draw`,description:`推送图文动态`},{label:`纯文动态`,value:`word`,description:`推送纯文字动态`},{label:`直播动态`,value:`live`,description:`推送直播状态`},{label:`转发动态`,value:`forward`,description:`推送转发的动态`},{label:`投稿专栏`,value:`article`,description:`推送专栏文章`}],cV=[{label:`黑名单`,value:`blacklist`,description:`命中关键词/标签则不推送`},{label:`白名单`,value:`whitelist`,description:`只推送命中关键词/标签的内容`}],lV=({label:e,description:t,items:n,onAdd:r,onRemove:i,disabled:a=!1})=>{let[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),u=()=>{let e=o.trim();if(!e){l(`请输入内容`);return}if(n.includes(e)){l(`该项已存在,请勿重复添加`);return}r(e),s(``),l(``)};return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsxs)(MC,{className:`flex-1`,isDisabled:a,isInvalid:!!c,value:o,onChange:e=>{s(e),c&&l(``)},children:[(0,H.jsx)(IS,{children:e}),(0,H.jsx)(PS,{variant:`secondary`,placeholder:`输入${e}`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}}),c?(0,H.jsx)(OS,{children:c}):null]}),(0,H.jsx)(ov,{isDisabled:a,variant:`secondary`,onPress:u,children:(0,H.jsx)(MP,{className:`size-4`})})]}),n.length>0?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>(0,H.jsxs)(Rv,{color:`accent`,variant:`soft`,children:[(0,H.jsx)(`span`,{children:e}),a?null:(0,H.jsx)(`button`,{type:`button`,className:`ml-1 rounded-full p-0.5 hover:bg-black/10`,onClick:()=>i(e),children:(0,H.jsx)(BP,{className:`size-3`})})]},e))}):(0,H.jsxs)(aS,{children:[`暂无`,e]}),(0,H.jsx)(aS,{children:t})]})},uV=(e,t)=>{if((e.success||e.code===200)&&e.data!==void 0)return e.data;throw Error(e.message||t)},dV=async()=>uV((await iz.get(`/kkk/v1/bots`)).data,`获取 Bot 列表失败`),fV=async e=>uV((await iz.get(`/kkk/v1/bots/${encodeURIComponent(e)}/groups`)).data,`获取群列表失败`),pV=async e=>e.length===0?[]:uV((await iz.post(`/kkk/v1/groups/batch`,{groups:e})).data,`获取推送目标信息失败`),mV=({label:e,description:t,placeholder:n,disabled:r=!1,items:i,selectedId:a,onSelect:o})=>{let{contains:s}=rh({sensitivity:`base`});return(0,H.jsxs)(n_,{fullWidth:!0,allowsEmptyCollection:!0,isDisabled:r,placeholder:n,selectionMode:`single`,value:a||null,variant:`secondary`,onChange:e=>o(String(e??``)),children:[(0,H.jsx)(IS,{children:e}),(0,H.jsxs)(n_.Trigger,{children:[(0,H.jsx)(n_.Value,{className:`min-w-0`,children:({defaultChildren:e,isPlaceholder:t,state:n})=>{if(t||n.selectedItems.length===0)return e;let r=i.find(e=>e.id===n.selectedItems[0]?.key);return r?(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{className:`size-4 shrink-0`,size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:r.name,src:r.avatar}),(0,H.jsx)(tv.Fallback,{children:r.name.slice(0,1)})]}),(0,H.jsx)(`span`,{className:`truncate`,children:r.name})]}):e}}),(0,H.jsx)(n_.ClearButton,{}),(0,H.jsx)(n_.Indicator,{})]}),(0,H.jsx)(aS,{children:t}),!r&&i.length===0?(0,H.jsx)(aS,{className:`text-warning`,children:`当前没有可选项`}):null,(0,H.jsx)(n_.Popover,{className:`max-h-72`,children:(0,H.jsxs)(n_.Filter,{filter:s,children:[(0,H.jsx)(iC,{autoFocus:!0,"aria-label":`搜索${e}`,variant:`secondary`,children:(0,H.jsxs)(iC.Group,{children:[(0,H.jsx)(iC.SearchIcon,{}),(0,H.jsx)(iC.Input,{placeholder:`搜索名称或 ID…`}),(0,H.jsx)(iC.ClearButton,{})]})}),(0,H.jsx)(US,{items:i,renderEmptyState:()=>(0,H.jsx)(ES,{children:`未找到结果`}),children:e=>(0,H.jsxs)(US.Item,{id:e.id,textValue:`${e.name} ${e.id} ${e.description}`,children:[(0,H.jsxs)(tv,{className:`shrink-0`,size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.name,src:e.avatar}),(0,H.jsx)(tv.Fallback,{children:e.name.slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(IS,{className:`max-w-full truncate`,children:e.name}),(0,H.jsx)(aS,{className:`truncate`,children:e.description})]}),(0,H.jsx)(US.ItemIndicator,{})]})})]})})]})},hV=e=>`${e.groupId}:${e.botId}`,gV=e=>{let[t,n,r]=e.split(`:`);return!t||!n||r!==void 0?null:{groupId:t,botId:n}},_V=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=gV(e);if(!r)return;let i=hV(r);t.has(i)||(t.add(i),n.push(i))}),n},vV=(e,t)=>{let n=gV(e);return n?hV({groupId:n.groupId,botId:t}):e},yV=e=>{let t=new Map;for(let n of e)for(let e of n){let n=gV(e);n&&t.set(n.botId,(t.get(n.botId)??0)+1)}return Array.from(t,([e,t])=>({botId:e,count:t})).sort((e,t)=>t.count-e.count)},bV=({name:e,avatar:t})=>(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e,src:t}),(0,H.jsx)(tv.Fallback,{children:e.slice(0,1)})]}),xV=({isOpen:e,onOpenChange:t,device:n,platformLabel:r,items:i,onApply:a,title:o=`推送 Bot 快捷切换`,description:s=r?`把「${r}」的推送目标从当前 Bot 批量切换到目标 Bot。`:`把推送目标从当前 Bot 切换到目标 Bot。`,appliedHint:c=`保存配置后生效`})=>{let[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(new Map),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(!0),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)([]),[E,D]=(0,v.useState)(null),O=n===`desktop`?`right`:`bottom`,k=n===`mobile`?`sm`:`md`;(0,v.useEffect)(()=>{if(!e)return;m(``),g(``),C(!1),T([]),D(null),u([]),f(new Map),x(``),y(!0);let t=!1,n=new Set,r=[];return i.forEach(e=>e.values.forEach(e=>{let t=gV(e);if(!t)return;let i=hV(t);n.has(i)||(n.add(i),r.push(t))})),Promise.all([dV(),pV(r).catch(()=>[])]).then(([e,n])=>{t||(u(e),f(new Map(n.map(e=>[hV(e),e]))))}).catch(e=>{t||x(e instanceof Error?e.message:`获取 Bot 列表失败`)}).finally(()=>{t||y(!1)}),()=>{t=!0}},[e]);let A=i.some(e=>e.values.length>0),j=(0,v.useMemo)(()=>yV(i.map(e=>e.values)).map(e=>{let t=l.find(t=>t.id===e.botId);return{id:e.botId,name:t?.name||e.botId,avatar:t?.avatar||``,description:`${e.count} 条推送目标 · ${t?`在线`:`离线/未注册`}`}}),[l,i]),M=(0,v.useMemo)(()=>l.filter(e=>e.id!==p).map(e=>({id:e.id,name:e.name,avatar:e.avatar,description:e.id})),[l,p]),N=(0,v.useMemo)(()=>{if(!p||!h)return[];let e=[];return i.forEach(t=>{let n=t.values.filter(e=>gV(e)?.botId===p).map(e=>({oldValue:e,newValue:vV(e,h)}));n.length>0&&e.push({item:t,entries:n})}),e},[i,p,h]),P=N.reduce((e,t)=>e+t.entries.length,0),F=S?w:N,I=()=>{if(!p||!h||N.length===0)return;let e=l.find(e=>e.id===p),t=l.find(e=>e.id===h);a(i.map(e=>e.values.map(e=>gV(e)?.botId===p?vV(e,h):e))),T(N),D({objects:N.length,entries:P,fromName:e?.name||p,toName:t?.name||h}),C(!0),WC.success(`已切换 ${N.length} 个推送对象的 ${P} 条推送目标,${c}`)},ee=e=>{let t=gV(e.oldValue);if(!t)return null;let n=d.get(e.oldValue),r=l.find(e=>e.id===h),i=n?.botName||p,a=r?.name||h;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-default-200 bg-default-50/50 p-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:n?.groupName||t.groupId,src:n?.groupAvatar}),(0,H.jsx)(tv.Fallback,{children:(n?.groupName||t.groupId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:n?.groupName||t.groupId}),(0,H.jsx)(aS,{className:`block truncate`,children:t.groupId})]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pl-8`,children:[(0,H.jsx)(bV,{name:i,avatar:n?.botAvatar}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted`,children:i}),(0,H.jsx)(`span`,{className:`shrink-0 text-xs text-muted`,children:`→`}),(0,H.jsx)(bV,{name:a,avatar:r?.avatar}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:a})]})]},e.oldValue)};return(0,H.jsx)(wS.Backdrop,{isOpen:e,onOpenChange:t,variant:`blur`,children:(0,H.jsx)(wS.Content,{placement:O,children:(0,H.jsxs)(wS.Dialog,{className:n===`desktop`?`h-full w-130 max-w-[90vw]`:`max-h-[84dvh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsxs)(wS.Header,{children:[(0,H.jsx)(wS.Heading,{children:o}),(0,H.jsx)(aS,{children:s})]}),(0,H.jsxs)(wS.Body,{className:`flex min-h-0 flex-col gap-3`,children:[S&&E?(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-success/30 bg-success/10 p-3 text-sm`,children:[(0,H.jsx)(gP,{className:`size-4 shrink-0 text-success`}),(0,H.jsxs)(`span`,{children:[`已将 `,E.objects,` 个推送对象的 `,E.entries,` 条推送目标从「`,E.fromName,`」切换到「`,E.toName,`」,`,c,`。`]})]}):null,_?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取 Bot 信息`}),(0,H.jsx)(`span`,{children:`正在读取 Bot 信息`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mV,{description:`列出推送目标中实际出现的 Bot,含离线 Bot。`,disabled:S,items:j,label:`当前 Bot`,placeholder:`选择要替换掉的 Bot`,selectedId:p,onSelect:e=>{g(``),m(e)}}),(0,H.jsx)(mV,{description:p?`Karin 当前在线的 Bot。`:`请先选择当前 Bot。`,disabled:S||!p,items:M,label:`目标 Bot`,placeholder:`选择切换后的 Bot`,selectedId:h,onSelect:g}),!p&&M.length===0&&l.length>0?(0,H.jsx)(aS,{className:`text-warning`,children:`当前没有其他在线 Bot 可作为切换目标。`}):null]}),b?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-danger/30 bg-danger/10 p-3 text-sm text-danger`,children:[(0,H.jsx)(HP,{className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{children:b})]}):null,A?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(IS,{children:S?`已更改的推送对象`:`将被更改的推送对象`}),(0,H.jsx)(aS,{children:S&&E?`${E.objects} 个推送对象 / ${E.entries} 条推送目标`:p&&h?N.length>0?`${N.length} 个推送对象 / ${P} 条推送目标`:`没有匹配「当前 Bot」的推送目标。`:`选择当前 Bot 与目标 Bot 后,这里会预览受影响的推送对象。`})]}),F.length>0?(0,H.jsx)(`div`,{className:n===`mobile`?`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pb-2`:`flex max-h-96 flex-col gap-4 overflow-y-auto`,children:F.map(({item:e,entries:t},r)=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(tv,{size:`sm`,children:(0,H.jsx)(tv.Fallback,{children:e.label.slice(0,1)})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.label}),e.description?(0,H.jsx)(aS,{className:`block truncate`,children:e.description}):null]}),(0,H.jsxs)(Rv,{color:`accent`,variant:`soft`,children:[t.length,` 条`]})]}),(0,H.jsx)(`div`,{className:n===`mobile`?`flex flex-col gap-2`:`flex flex-col gap-2 pl-8`,children:t.map(ee)})]},r))}):null]}):(0,H.jsx)(`div`,{className:`rounded-lg border border-dashed border-default-300 px-4 py-5 text-sm text-muted`,children:r?`「${r}」还没有配置推送目标。`:`还没有配置推送目标。`})]}),(0,H.jsxs)(wS.Footer,{children:[(0,H.jsx)(ov,{size:k,slot:`close`,variant:`secondary`,children:`取消`}),S?(0,H.jsx)(ov,{size:k,slot:`close`,children:`完成`}):(0,H.jsx)(ov,{size:k,isDisabled:!p||!h||N.length===0,onPress:I,children:`应用更改`})]})]})})})},SV=({mapping:e,compact:t=!1,stacked:n=!1})=>n?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.groupName||e.groupId,src:e.groupAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.groupName||e.groupId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.groupName||e.groupId}),(0,H.jsx)(aS,{className:`block truncate`,children:e.groupId})]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pl-8`,children:[(0,H.jsx)(fP,{className:`size-4 shrink-0 text-muted`}),(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.botName||e.botId,src:e.botAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.botName||e.botId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.botName||e.botId}),(0,H.jsx)(aS,{className:`block truncate`,children:t?e.botId:`Bot ${e.botId}`})]})]})]}):(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.groupName||e.groupId,src:e.groupAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.groupName||e.groupId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.groupName||e.groupId}),(0,H.jsx)(aS,{className:`block truncate`,children:e.groupId})]}),(0,H.jsx)(fP,{className:`size-4 shrink-0 text-muted`}),(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.botName||e.botId,src:e.botAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.botName||e.botId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.botName||e.botId}),(0,H.jsx)(aS,{className:`block truncate`,children:t?e.botId:`Bot ${e.botId}`})]})]}),CV=({device:e,mappings:t,onEdit:n,onRemove:r})=>(0,H.jsxs)(`div`,{className:e===`mobile`?`flex min-h-0 min-w-0 flex-1 flex-col gap-4`:`flex min-w-0 flex-col gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(IS,{children:`已配置目标`}),(0,H.jsxs)(aS,{children:[t.length,` 个推送目标`]})]}),t.length>0?(0,H.jsx)(`div`,{className:e===`mobile`?`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto pb-2`:`flex max-h-72 flex-col gap-2 overflow-y-auto`,children:t.map(t=>{let i=hV(t);return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 rounded-lg border border-default-200 bg-default-50/50 p-2.5`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(SV,{compact:!0,mapping:t,stacked:e===`mobile`})}),(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":`编辑推送目标`,size:`sm`,variant:`tertiary`,onPress:()=>n(i),children:(0,H.jsx)(AP,{className:`size-4`})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),`编辑`]})]}),(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":`删除推送目标`,size:`sm`,variant:`danger`,onPress:()=>r(i),children:(0,H.jsx)(BP,{className:`size-4`})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),`删除`]})]})]},i)})}):(0,H.jsx)(`div`,{className:`rounded-lg border border-dashed border-default-300 px-4 py-5 text-sm text-muted`,children:`还没有推送目标,点击上方按钮添加。`})]}),wV=({isOpen:e,device:t,initialMapping:n,onOpenChange:r,onConfirm:i})=>{let[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(n?.botId||``),[d,f]=(0,v.useState)(n?.groupId||``),[p,m]=(0,v.useState)(!0),[h,g]=(0,v.useState)(!!n?.botId),[_,y]=(0,v.useState)(``);(0,v.useEffect)(()=>{e&&(u(n?.botId||``),f(n?.groupId||``),c([]),o([]),m(!0),g(!!n?.botId),y(``))},[e,n?.botId,n?.groupId]);let b=(0,v.useMemo)(()=>a.find(e=>e.id===l),[a,l]),x=(0,v.useMemo)(()=>s.find(e=>e.id===d),[s,d]),S=(0,v.useMemo)(()=>a.map(e=>({id:e.id,name:e.name,avatar:e.avatar,description:e.id})),[a]),C=(0,v.useMemo)(()=>s.map(e=>({id:e.id,name:e.name,avatar:e.avatar,description:e.id})),[s]),w=!!(l&&d);(0,v.useEffect)(()=>{e&&dV().then(o).catch(e=>{y(e instanceof Error?e.message:`获取 Bot 列表失败`)}).finally(()=>m(!1))},[e]),(0,v.useEffect)(()=>{e&&l&&fV(l).then(e=>{c(e),f(t=>e.some(e=>e.id===t)?t:``)}).catch(e=>{y(e instanceof Error?e.message:`获取群列表失败`)}).finally(()=>g(!1))},[e,l]);let T=()=>{if(!w||!b||!x)return;let e={groupId:x.id,botId:b.id};x.name&&(e.groupName=x.name),x.avatar&&(e.groupAvatar=x.avatar),b.name&&(e.botName=b.name),b.avatar&&(e.botAvatar=b.avatar),b.isOnline!==void 0&&(e.isOnline=b.isOnline),i(e)},E=t===`desktop`?`right`:`bottom`,D=n?`编辑推送目标`:`添加推送目标`;return(0,H.jsx)(wS.Backdrop,{isOpen:e,onOpenChange:r,children:(0,H.jsx)(wS.Content,{placement:E,children:(0,H.jsxs)(wS.Dialog,{className:t===`desktop`?`h-full w-105 max-w-[90vw]`:`max-h-[78dvh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsxs)(wS.Header,{children:[(0,H.jsx)(wS.Heading,{children:D}),(0,H.jsx)(aS,{children:`先选择 Bot,再选择该 Bot 加入的群。`})]}),(0,H.jsxs)(wS.Body,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(mV,{description:`Karin 当前已注册且在线的 Bot。`,disabled:p,items:S,label:`机器人账号`,placeholder:`选择机器人账号`,selectedId:l,onSelect:e=>{y(``),c([]),g(!!e),u(e),f(``)}}),(0,H.jsx)(mV,{description:l?`当前 Bot 已加入的群。`:`请先选择机器人账号。`,disabled:!l||h,items:C,label:`推送群`,placeholder:`选择推送群`,selectedId:d,onSelect:f}),p||h?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取列表`}),(0,H.jsx)(`span`,{children:`正在读取列表`})]}):null,b&&x?(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-default-200 bg-default-50/60 p-3`,children:[(0,H.jsx)(IS,{children:`将写入`}),(0,H.jsxs)(aS,{className:`mt-1`,children:[x.name,`(`,x.id,`) -> `,b.name,`(`,b.id,`)`]})]}):null,_?(0,H.jsx)(aS,{className:`text-danger`,children:_}):null]}),(0,H.jsxs)(wS.Footer,{children:[(0,H.jsx)(ov,{size:t===`mobile`?`sm`:`md`,slot:`close`,variant:`secondary`,children:`取消`}),(0,H.jsx)(ov,{size:t===`mobile`?`sm`:`md`,slot:`close`,isDisabled:!w,onPress:T,children:n?`保存`:`添加`})]})]})})})},TV=(e,t,n)=>{let r=_V(e);return{values:r,mappings:r.map(e=>{let r=gV(e),i=n[e]||t.find(t=>hV(t)===e);if(!r)return null;let a={groupId:r.groupId,botId:r.botId};return i?.groupName&&(a.groupName=i.groupName),i?.groupAvatar&&(a.groupAvatar=i.groupAvatar),i?.botName&&(a.botName=i.botName),i?.botAvatar&&(a.botAvatar=i.botAvatar),i?.isOnline!==void 0&&(a.isOnline=i.isOnline),a}).filter(e=>!!e)}},EV=({isOpen:e,values:t,mappings:n,device:r,itemLabel:i,onOpenChange:a,onApply:o})=>{let[s,c]=(0,v.useState)(()=>_V(t)),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)([]),b=(0,v.useMemo)(()=>TV(s,n,l),[s,l,n]),x=r===`desktop`?`right`:`bottom`,S=r===`mobile`?`sm`:`md`,C=d?gV(d):null;(0,v.useEffect)(()=>{e&&dV().then(y).catch(()=>y([]))},[e]),(0,v.useEffect)(()=>{e||(c(_V(t)),u({}))},[e,t]);let w=e=>{f(e),m(!0)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(wS.Backdrop,{isOpen:e,onOpenChange:e=>{e||o(b.values),a(e)},variant:`blur`,children:(0,H.jsx)(wS.Content,{placement:x,children:(0,H.jsxs)(wS.Dialog,{className:r===`desktop`?`h-full w-130 max-w-[90vw]`:`max-h-[84dvh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsxs)(wS.Header,{children:[(0,H.jsx)(wS.Heading,{children:`推送目标`}),(0,H.jsx)(aS,{children:`管理所有接收推送的群和 Bot 映射。`})]}),(0,H.jsxs)(wS.Body,{className:`flex min-h-0 flex-col gap-3`,children:[(0,H.jsx)(`div`,{className:`rounded-lg border border-default-200 bg-default-50/50 p-3`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(IS,{children:`快捷切换 Bot`}),(0,H.jsx)(aS,{children:`把本推送对象的推送目标从当前 Bot 切换到目标 Bot,先应用到下方草稿。`})]}),(0,H.jsxs)(ov,{className:`self-start`,size:S,variant:`secondary`,isDisabled:s.length===0,onPress:()=>g(!0),children:[(0,H.jsx)(uP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`切换 Bot`})]})]})}),(0,H.jsxs)(ov,{className:`self-start`,size:S,onPress:()=>w(null),children:[(0,H.jsx)(MP,{className:`size-4`}),`添加推送目标`]}),(0,H.jsx)(CV,{device:r,mappings:b.mappings,onEdit:e=>w(e),onRemove:e=>{c(t=>t.filter(t=>t!==e)),u(t=>{let n={...t};return delete n[e],n})}})]}),(0,H.jsxs)(wS.Footer,{children:[(0,H.jsx)(ov,{size:S,slot:`close`,variant:`secondary`,children:`取消`}),(0,H.jsx)(ov,{size:S,slot:`close`,onPress:()=>{o(b.values)},children:`完成`})]})]})})}),(0,H.jsx)(wV,{device:r,initialMapping:C,isOpen:p,onConfirm:e=>{let t=hV(e),n=[...s],r=d?n.indexOf(d):-1;r>=0?n[r]=t:n.unshift(t),c(_V(n)),u(n=>{let r={...n,[t]:e};return d&&d!==t&&delete r[d],r}),m(!1),f(null)},onOpenChange:m},d||`new`),(0,H.jsx)(xV,{device:r,isOpen:h,items:[{label:i||`本推送对象`,description:``,values:s}],title:`快捷切换 Bot`,description:`把本推送对象的推送目标从当前 Bot 切换到目标 Bot,先应用到抽屉草稿。`,appliedHint:`完成抽屉并保存配置后生效`,onApply:e=>{let t=_V(e[0]??s),r={};t.forEach(e=>{if(s.includes(e))return;let t=gV(e);if(!t)return;let i=s.find(e=>gV(e)?.groupId===t.groupId),a=i?l[i]||n.find(e=>hV(e)===i):void 0,o=_.find(e=>e.id===t.botId),c={groupId:t.groupId,botId:t.botId};a?.groupName&&(c.groupName=a.groupName),a?.groupAvatar&&(c.groupAvatar=a.groupAvatar),o?.name&&(c.botName=o.name),o?.avatar&&(c.botAvatar=o.avatar),o&&(c.isOnline=o.isOnline),r[e]=c}),c(t),u(e=>{let n={...e,...r};return s.forEach(e=>{t.includes(e)||delete n[e]}),n})},onOpenChange:g})]})},DV=(e,t)=>{let n=gV(e);if(!n)return null;let r={groupId:n.groupId,botId:n.botId};return t?.groupName&&(r.groupName=t.groupName),t?.groupAvatar&&(r.groupAvatar=t.groupAvatar),t?.botName&&(r.botName=t.botName),t?.botAvatar&&(r.botAvatar=t.botAvatar),t?.isOnline!==void 0&&(r.isOnline=t.isOnline),r},OV=({value:e,disabled:t,itemLabel:n,device:r,onChange:i})=>{let a=(0,v.useMemo)(()=>_V(e),[e]),o=(0,v.useMemo)(()=>e.filter(e=>!gV(e)),[e]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),p=(0,v.useMemo)(()=>a.map(e=>{let t=gV(e);return DV(e,t?s.find(e=>e.groupId===t.groupId&&e.botId===t.botId):void 0)}).filter(e=>!!e),[s,a]);(0,v.useEffect)(()=>{pV(a.map(gV).filter(e=>!!e)).then(c).catch(()=>c([])).finally(()=>u(!1))},[a]);let m=e=>i(_V(e)),h=`开启【${n}】的推送开关后才能编辑此字段`,g=a.length>0?`已配置 ${a.length} 个推送目标`:`还没有配置推送目标`;return(0,H.jsx)(iV,{disabled:t,device:r,message:h,children:(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-default-200 bg-default-50/50 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,H.jsx)(IS,{children:`推送目标`}),(0,H.jsx)(aS,{className:`mt-1`,children:g})]}),(0,H.jsxs)(ov,{isDisabled:t,size:r===`mobile`?`sm`:`md`,variant:r===`mobile`?`primary`:`secondary`,onPress:()=>f(!0),children:[(0,H.jsx)(AP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`管理`})]})]}),l?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取推送目标`}),(0,H.jsx)(`span`,{children:`正在读取推送目标`})]}):null,o.length>0?(0,H.jsxs)(`div`,{className:`rounded-lg border border-warning/30 bg-warning/10 p-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-warning`,children:[(0,H.jsx)(HP,{className:`size-4`}),(0,H.jsxs)(`span`,{children:[`发现 `,o.length,` 条旧格式或错误格式`]})]}),(0,H.jsx)(aS,{className:`mt-1`,children:`建议删除后用可视化选择重新添加,避免后端解析异常。`})]}):null,(0,H.jsx)(EV,{device:r,isOpen:d,itemLabel:n,mappings:p,values:a,onApply:m,onOpenChange:f})]})})},kV=({disabled:e,itemLabel:t,device:n,value:r,onChange:i})=>(0,H.jsx)(OV,{disabled:e,device:n,itemLabel:t,value:r,onChange:i}),AV=({disabled:e,itemLabel:t,device:n,options:r,value:i,onChange:a})=>(0,H.jsx)(iV,{disabled:e,device:n,message:`开启【${t}】的推送开关后才能编辑此字段`,children:(0,H.jsxs)(Dv,{"aria-label":`推送类型`,isDisabled:e,value:i,onChange:e=>a(e),children:[(0,H.jsx)(IS,{children:`推送类型`}),(0,H.jsx)(aS,{children:`选择要推送的内容类型`}),(0,H.jsx)(`div`,{className:`mt-2 ${aV(n)}`,children:r.map(e=>(0,H.jsxs)(Pv,{value:e.value,variant:`secondary`,children:[(0,H.jsxs)(Pv.Content,{children:[(0,H.jsx)(Pv.Control,{children:(0,H.jsx)(Pv.Indicator,{})}),e.label]}),(0,H.jsx)(aS,{children:e.description})]},e.value))})]})}),jV=({disabled:e,itemLabel:t,device:n,value:r,onChange:i})=>(0,H.jsx)(iV,{disabled:e,device:n,message:`开启【${t}】的推送开关后才能编辑此字段`,children:(0,H.jsxs)(uC,{fullWidth:!0,isDisabled:e,value:r,onChange:e=>{e&&!Array.isArray(e)&&i(e)},children:[(0,H.jsx)(IS,{children:`过滤模式`}),(0,H.jsxs)(uC.Trigger,{children:[(0,H.jsx)(uC.Value,{}),(0,H.jsx)(uC.Indicator,{})]}),(0,H.jsx)(aS,{children:`设置关键词/标签的过滤方式`}),(0,H.jsx)(uC.Popover,{children:(0,H.jsx)(US,{children:cV.map(e=>(0,H.jsxs)(US.Item,{id:e.value,textValue:e.label,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(IS,{children:e.label}),(0,H.jsx)(aS,{children:e.description})]}),(0,H.jsx)(US.ItemIndicator,{})]},e.value))})})]})}),MV=({disabled:e,itemLabel:t,device:n,keywords:r,tags:i,onKeywordsChange:a,onTagsChange:o})=>{let s=`开启【${t}】的推送开关后才能编辑此字段`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(iV,{disabled:e,device:n,message:s,children:(0,H.jsx)(`div`,{children:(0,H.jsx)(lV,{label:`关键词`,description:`多个关键词用于内容过滤`,disabled:e,items:r,onAdd:e=>a([...r,e]),onRemove:e=>a(r.filter(t=>t!==e))})})}),(0,H.jsx)(iV,{disabled:e,device:n,message:s,children:(0,H.jsx)(`div`,{children:(0,H.jsx)(lV,{label:`标签`,description:`多个标签用于内容过滤`,disabled:e,items:i,onAdd:e=>o([...i,e]),onRemove:e=>o(i.filter(t=>t!==e))})})})]})},NV=({onDelete:e})=>(0,H.jsxs)(ov,{className:`w-full`,variant:`danger`,onPress:e,children:[(0,H.jsx)(BP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`删除此推送项`})]}),PV=({item:e,index:t,list:n,onChange:r,device:i})=>{let a=i=>{let a=[...n];a[t]={...e,...i},r(a)},o=!e.switch,s=e.remark||`UID: ${e.host_mid}`||`未命名`,c=`开启【${s}】的推送开关后才能编辑此字段`;return(0,H.jsxs)(qc.Item,{id:`bilibili-${t}`,children:[(0,H.jsx)(qc.Heading,{children:(0,H.jsxs)(qc.Trigger,{children:[(0,H.jsxs)(`div`,{className:`flex flex-1 items-center gap-3`,children:[(0,H.jsx)(`div`,{onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,H.jsx)(DC,{"aria-label":`推送开关`,isSelected:e.switch,onChange:e=>a({switch:e}),children:(0,H.jsx)(DC.Content,{children:(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})})})})}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.remark||`UID: ${e.host_mid}`||`推送项 ${t+1}`}),(0,H.jsxs)(aS,{className:`text-xs`,children:[`B站 UID: `,e.host_mid]})]})]}),(0,H.jsx)(qc.Indicator,{children:(0,H.jsx)(mP,{className:`size-5`})})]})}),(0,H.jsx)(qc.Panel,{children:(0,H.jsx)(qc.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:aV(i),children:[(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,isRequired:!0,type:`number`,value:String(e.host_mid),onChange:e=>a({host_mid:Number(e)||0}),children:[(0,H.jsx)(IS,{children:`B站 UID`}),(0,H.jsx)(PS,{placeholder:`UP主的 UID`}),(0,H.jsx)(aS,{children:`B站用户的唯一标识,必填`})]})}),(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,value:e.remark,onChange:e=>a({remark:e}),children:[(0,H.jsx)(IS,{children:`备注名称`}),(0,H.jsx)(PS,{placeholder:`可选,用于识别该推送项`}),(0,H.jsx)(aS,{children:`方便识别的名称,如:UP主昵称`})]})})]}),(0,H.jsx)(kV,{disabled:o,device:i,itemLabel:s,value:e.group_id,onChange:e=>a({group_id:e})}),(0,H.jsx)(AV,{disabled:o,device:i,itemLabel:s,options:sV,value:e.pushTypes||[],onChange:e=>a({pushTypes:e})}),(0,H.jsx)(jV,{disabled:o,device:i,itemLabel:s,value:e.filterMode||`blacklist`,onChange:e=>a({filterMode:e})}),(0,H.jsx)(MV,{disabled:o,device:i,itemLabel:s,keywords:e.Keywords||[],tags:e.Tags||[],onKeywordsChange:e=>a({Keywords:e}),onTagsChange:e=>a({Tags:e})}),(0,H.jsx)(NV,{onDelete:()=>r(n.filter((e,n)=>n!==t))})]})})})]},t)},FV=({item:e,index:t,list:n,onChange:r,device:i})=>{let a=i=>{let a=[...n];a[t]={...e,...i},r(a)},o=!e.switch,s=e.remark||e.short_id||e.sec_uid||`未命名`,c=`开启【${s}】的推送开关后才能编辑此字段`;return(0,H.jsxs)(qc.Item,{id:`douyin-${t}`,children:[(0,H.jsx)(qc.Heading,{children:(0,H.jsxs)(qc.Trigger,{children:[(0,H.jsxs)(`div`,{className:`flex flex-1 items-center gap-3`,children:[(0,H.jsx)(`div`,{onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,H.jsx)(DC,{"aria-label":`推送开关`,isSelected:e.switch,onChange:e=>a({switch:e}),children:(0,H.jsx)(DC.Content,{children:(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})})})})}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.remark||e.short_id||e.sec_uid||`推送项 ${t+1}`}),(0,H.jsxs)(aS,{className:`text-xs`,children:[e.short_id&&`抖音号: ${e.short_id}`,e.sec_uid&&!e.short_id&&`sec_uid: ${e.sec_uid.slice(0,20)}...`]})]})]}),(0,H.jsx)(qc.Indicator,{children:(0,H.jsx)(mP,{className:`size-5`})})]})}),(0,H.jsx)(qc.Panel,{children:(0,H.jsx)(qc.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:aV(i),children:[(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,isRequired:!0,value:e.short_id,onChange:e=>a({short_id:e}),children:[(0,H.jsx)(IS,{children:`抖音号`}),(0,H.jsx)(PS,{placeholder:`用户的抖音号`,variant:`secondary`}),(0,H.jsx)(aS,{children:`用户的抖音号(short_id),必填`})]})}),(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,value:e.sec_uid,onChange:e=>a({sec_uid:e}),children:[(0,H.jsx)(IS,{children:`sec_uid`}),(0,H.jsx)(PS,{placeholder:`选填,会根据抖音号自动获取`,variant:`secondary`}),(0,H.jsx)(aS,{children:`用户的 sec_uid,可从分享链接获取。选填,推送时会自动获取`})]})})]}),(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,value:e.remark,onChange:e=>a({remark:e}),children:[(0,H.jsx)(IS,{children:`备注名称`}),(0,H.jsx)(PS,{placeholder:`可选,用于识别该推送项`,variant:`secondary`}),(0,H.jsx)(aS,{children:`方便识别的名称,如:博主昵称`})]})}),(0,H.jsx)(kV,{disabled:o,device:i,itemLabel:s,value:e.group_id,onChange:e=>a({group_id:e})}),(0,H.jsx)(AV,{disabled:o,device:i,itemLabel:s,options:oV,value:e.pushTypes||[],onChange:e=>a({pushTypes:e})}),(0,H.jsx)(jV,{disabled:o,device:i,itemLabel:s,value:e.filterMode||`blacklist`,onChange:e=>a({filterMode:e})}),(0,H.jsx)(MV,{disabled:o,device:i,itemLabel:s,keywords:e.Keywords||[],tags:e.Tags||[],onKeywordsChange:e=>a({Keywords:e}),onTagsChange:e=>a({Tags:e})}),(0,H.jsx)(NV,{onDelete:()=>r(n.filter((e,n)=>n!==t))})]})})})]},t)},IV=({device:e,platformLabel:t,items:n,onApply:r})=>{let[i,a]=(0,v.useState)(!1),o=n.reduce((e,t)=>e+t.values.filter(e=>gV(e)).length,0),s=new Set;n.forEach(e=>e.values.forEach(e=>{let t=gV(e);t&&s.add(t.botId)}));let c=o===0?`「${t}」还没有配置推送目标`:`共 ${o} 条推送目标,涉及 ${s.size} 个 Bot`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-default-200 bg-default-50/50 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(IS,{children:`推送 Bot 快捷切换`}),(0,H.jsx)(aS,{className:`mt-1`,children:c})]}),(0,H.jsxs)(ov,{isDisabled:o===0,size:e===`mobile`?`sm`:`md`,variant:`secondary`,onPress:()=>a(!0),children:[(0,H.jsx)(uP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`切换 Bot`})]})]}),(0,H.jsx)(xV,{device:e,isOpen:i,items:n,platformLabel:t,onApply:r,onOpenChange:a})]})},LV=()=>({switch:!0,sec_uid:``,short_id:``,group_id:[],remark:``,pushTypes:[`post`],filterMode:`blacklist`,Keywords:[],Tags:[]}),RV=()=>({switch:!0,host_mid:0,group_id:[],remark:``,pushTypes:[`video`],filterMode:`blacklist`,Keywords:[],Tags:[]}),zV=({platform:e})=>(0,H.jsx)(`div`,{className:`rounded-lg border-2 border-dashed border-gray-300 p-8 text-center`,children:(0,H.jsxs)(`p`,{className:`text-muted`,children:[`暂无`,e===`douyin`?`抖音`:`B站`,`推送项,点击上方按钮添加`]})});function BV({douyinList:e,bilibiliList:t,onDouyinChange:n,onBilibiliChange:r,device:i}){let[a,o]=(0,v.useState)(`douyin`);return(0,H.jsx)(`div`,{className:`space-y-4`,children:(0,H.jsxs)(jC,{selectedKey:a,onSelectionChange:e=>o(e),children:[(0,H.jsx)(jC.ListContainer,{children:(0,H.jsxs)(jC.List,{children:[(0,H.jsxs)(jC.Tab,{id:`douyin`,children:[(0,H.jsx)(`span`,{children:`抖音推送`}),(0,H.jsx)(jC.Indicator,{})]}),(0,H.jsxs)(jC.Tab,{id:`bilibili`,children:[(0,H.jsx)(`span`,{children:`B站推送`}),(0,H.jsx)(jC.Indicator,{})]})]})}),(0,H.jsx)(jC.Panel,{id:`douyin`,children:(0,H.jsxs)(`div`,{className:`space-y-4 pt-4`,children:[(0,H.jsx)(IV,{device:i,platformLabel:`抖音`,items:e.map((e,t)=>({label:e.remark||e.short_id||e.sec_uid||`推送项 ${t+1}`,description:e.short_id?`抖音号: ${e.short_id}`:e.sec_uid?`sec_uid: ${e.sec_uid.slice(0,20)}...`:``,values:e.group_id})),onApply:t=>n(e.map((e,n)=>({...e,group_id:t[n]??e.group_id})))}),(0,H.jsxs)(ov,{className:`w-full`,variant:`primary`,size:`sm`,onPress:()=>n([...e,LV()]),children:[(0,H.jsx)(MP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`添加抖音推送项`})]}),e.length>0?(0,H.jsx)(qc,{variant:`surface`,"aria-label":`抖音推送列表`,children:e.map((t,r)=>(0,H.jsx)(FV,{device:i,index:r,item:t,list:e,onChange:n},r))}):(0,H.jsx)(zV,{platform:`douyin`})]})}),(0,H.jsx)(jC.Panel,{id:`bilibili`,children:(0,H.jsxs)(`div`,{className:`space-y-4 pt-4`,children:[(0,H.jsx)(IV,{device:i,platformLabel:`B站`,items:t.map((e,t)=>({label:e.remark||`UID: ${e.host_mid}`||`推送项 ${t+1}`,description:`B站 UID: ${e.host_mid}`,values:e.group_id})),onApply:e=>r(t.map((t,n)=>({...t,group_id:e[n]??t.group_id})))}),(0,H.jsxs)(ov,{className:`w-full`,variant:`primary`,onPress:()=>r([...t,RV()]),children:[(0,H.jsx)(MP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`添加B站推送项`})]}),t.length>0?(0,H.jsx)(qc,{variant:`surface`,"aria-label":`B站推送列表`,children:t.map((e,n)=>(0,H.jsx)(PV,{device:i,index:n,item:e,list:t,onChange:r},n))}):(0,H.jsx)(zV,{platform:`bilibili`})]})})]})})}var VV=({config:e,device:t,renderers:n,updateConfigValue:r})=>{let{renderPageHeader:i}=n;return(0,H.jsxs)(H.Fragment,{children:[i(`推送列表`,`管理「抖音」与「哔哩哔哩」的推送订阅。`),(0,H.jsx)(BV,{douyinList:e.pushlist?.douyin||[],bilibiliList:e.pushlist?.bilibili||[],onDouyinChange:e=>{r([`pushlist`,`douyin`],e)},onBilibiliChange:e=>{r([`pushlist`,`bilibili`],e)},device:t})]})},HV=({config:e,renderers:t,classes:n})=>{let{renderCheckboxGroup:r,renderPageHeader:i,renderSelectField:a,renderSubSection:o,renderSwitch:s,renderTextField:c}=t,l=Q(e,[`xiaohongshu`,`switch`],!1),u=Q(e,[`xiaohongshu`,`sendContent`],[]),d=Q(e,[`xiaohongshu`,`videoQuality`],`adapt`);return(0,H.jsxs)(H.Fragment,{children:[i(`小红书`,`小红书解析基础设置。`),(0,H.jsxs)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:[s([`xiaohongshu`,`switch`],`解析开关`,`小红书解析开关,此开关为单独开关。`),r([`xiaohongshu`,`sendContent`],`解析时发送的内容`,`若什么都不选,可能不会返回任何解析结果。`,FB,!l),c([`xiaohongshu`,`numcomment`],`评论解析数量`,`小红书评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:!l||!xB(u,`comment`)})]}),o(`渲染与画质设置`,(0,H.jsxs)(H.Fragment,{children:[a([`xiaohongshu`,`videoQuality`],`画质偏好`,`解析视频的分辨率偏好。`,LB,e=>e,!l),c([`xiaohongshu`,`maxAutoVideoSize`],`视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!l||d!==`adapt`})]})),o(`权限设置`,(0,H.jsx)(H.Fragment,{children:a([`xiaohongshu`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)}))]})},UV=e=>{switch(e.activeFile){case`amagi`:return(0,H.jsx)($B,{...e});case`app`:return(0,H.jsx)(eV,{...e});case`douyin`:return(0,H.jsx)(nV,{...e});case`bilibili`:return(0,H.jsx)(tV,{...e});case`kuaishou`:return(0,H.jsx)(rV,{...e});case`xiaohongshu`:return(0,H.jsx)(HV,{...e});case`pushlist`:return(0,H.jsx)(VV,{...e})}},WV=(e,t)=>{let n=Number(e);return Number.isFinite(n)?t.min!==void 0&&n<t.min?t.error||`${t.label} 不能小于 ${t.min}`:t.max!==void 0&&n>t.max?t.error||`${t.label} 不能大于 ${t.max}`:``:`${t.label} 必须是数字`},GV=(e,t,n)=>{if(n.disabled)return;let r=WV(Q(t,n.path,0),n);r&&(e[_B(n.path)]=r)},KV=e=>typeof e==`string`&&/.+:.+/.test(e),qV=(e,t,n)=>{if(!Array.isArray(n)){e[`pushlist.${t}`]=`${t} 推送列表必须是数组`;return}let r=n.findIndex(e=>{if(!vB(e))return!0;let n=e.group_id,r=t===`douyin`?e.short_id:e.host_mid;return r==null||String(r).trim()===``||!Array.isArray(n)||n.some(e=>!KV(e))});r>=0&&(e[`pushlist.${t}`]=`${t} 推送列表第 ${r+1} 项缺少必填 UID/抖音号,或 group_id 未使用「群号:机器人账号」格式`)},JV=e=>{if(!e)return{};let t={},n=Q(e,[`app`,`livePhotoMode`],`video_and_livephoto`),r=Q(e,[`amagi`,`APIServerMount`],!1),i=Q(e,[`app`,`videoSendMode`],`file`),a=Q(e,[`app`,`usegroupfile`],!1),o=Q(e,[`app`,`usefilelimit`],!1),s=Q(e,[`app`,`compress`],!1),c=Q(e,[`app`,`downloadThrottle`],!1),l=Q(e,[`app`,`downloadAutoReduce`],!1),u=Q(e,[`amagi`,`proxy`,`switch`],!1),d=Q(e,[`douyin`,`switch`],!1),f=Q(e,[`douyin`,`sendContent`],[]),p=Q(e,[`douyin`,`burnDanmaku`],!1),m=Q(e,[`douyin`,`videoQuality`],`adapt`),h=Q(e,[`douyin`,`push`,`switch`],!1),g=Q(e,[`douyin`,`push`,`pushVideoQuality`],`adapt`),_=Q(e,[`bilibili`,`switch`],!1),v=Q(e,[`bilibili`,`sendContent`],[]),y=Q(e,[`bilibili`,`burnDanmaku`],!1),b=Q(e,[`bilibili`,`videoQuality`],0),x=Q(e,[`bilibili`,`push`,`switch`],!1),S=Q(e,[`bilibili`,`push`,`parsedynamic`],!1),C=Q(e,[`bilibili`,`push`,`pushVideoQuality`],0),w=Q(e,[`kuaishou`,`switch`],!1),T=Q(e,[`kuaishou`,`comment`],!1),E=Q(e,[`xiaohongshu`,`switch`],!1),D=Q(e,[`xiaohongshu`,`sendContent`],[]),O=Q(e,[`xiaohongshu`,`videoQuality`],`adapt`);return[{path:[`app`,`renderScale`],label:`渲染精度`,min:50,max:200},{path:[`app`,`ambientCover`,`coverOpacity`],label:`封面氛围强度`,min:0,max:1},{path:[`app`,`ambientCover`,`overlayEdgeOpacity`],label:`氛围压色(顶部/底部)`,min:0,max:1},{path:[`app`,`ambientCover`,`overlayMiddleOpacity`],label:`氛围压色(中间带)`,min:0,max:1},{path:[`app`,`RenderWaitTime`],label:`渲染图片的等待时间`,min:0},{path:[`app`,`multiPageHeight`],label:`分页渲染时,每页的高度`,min:1e3,max:2e4,disabled:!Q(e,[`app`,`multiPageRender`],!0),error:`请输入一个范围在 1000 到 20000 之间的数字`},{path:[`amagi`,`APIServerPort`],label:`API服务端口`,min:1024,max:65535,disabled:r,error:`请输入一个范围在 1024 到 65535 之间的数字`},{path:[`app`,`groupfilevalue`],label:`群文件上传阈值`,min:1,disabled:!a||i===`base64`},{path:[`app`,`filelimit`],label:`视频拦截阈值`,min:1,disabled:!o},{path:[`app`,`compresstrigger`],label:`压缩触发阈值`,min:1,disabled:!s},{path:[`app`,`compressvalue`],label:`压缩后的值`,min:1,disabled:!s},{path:[`app`,`downloadMaxSpeed`],label:`最大下载速度`,min:1,max:1e3,disabled:!c,error:`请输入一个范围在 1 到 1000 之间的数字`},{path:[`app`,`downloadMinSpeed`],label:`最低下载速度`,min:.1,max:100,disabled:!c||!l,error:`请输入一个范围在 0.1 到 100 之间的数字`},{path:[`amagi`,`timeout`],label:`请求超时时间`,min:1e3,max:3e5,error:`请输入一个范围在 1000 到 300000 之间的数字`},{path:[`amagi`,`proxy`,`port`],label:`代理端口`,min:1,max:65535,disabled:!u,error:`请输入一个范围在 1 到 65535 之间的数字`},{path:[`douyin`,`numcomment`],label:`评论解析数量`,min:1,disabled:!d||!xB(f,`comment`)},{path:[`douyin`,`subCommentLimit`],label:`次级评论解析数量`,min:1,max:20,disabled:!d||!xB(f,`comment`)},{path:[`douyin`,`maxAutoVideoSize`],label:`视频体积上限(MB)`,min:1,max:2e4,disabled:!d||m!==`adapt`},{path:[`douyin`,`danmakuOpacity`],label:`弹幕透明度`,min:0,max:100,disabled:!d||!p},{path:[`douyin`,`push`,`pushMaxAutoVideoSize`],label:`推送视频体积上限(MB)`,min:1,max:2e4,disabled:!h||g!==`adapt`},{path:[`bilibili`,`numcomment`],label:`评论解析数量`,min:1,disabled:!_||!xB(v,`comment`)},{path:[`bilibili`,`maxAutoVideoSize`],label:`视频体积上限(MB)`,min:1,max:2e4,disabled:!_||Number(b)!==0},{path:[`bilibili`,`danmakuOpacity`],label:`弹幕透明度`,min:0,max:100,disabled:!_||!y},{path:[`bilibili`,`push`,`pushMaxAutoVideoSize`],label:`视频动态的视频体积上限(MB)`,min:1,max:2e4,disabled:!x||!S||Number(C)!==0},{path:[`kuaishou`,`numcomment`],label:`评论解析数量`,min:1,disabled:!w||!T},{path:[`xiaohongshu`,`numcomment`],label:`评论解析数量`,min:1,disabled:!E||!xB(D,`comment`)},{path:[`xiaohongshu`,`maxAutoVideoSize`],label:`视频体积上限(MB)`,min:1,max:2e4,disabled:!E||O!==`adapt`}].forEach(n=>GV(t,e,n)),n===`video_only`&&delete t[`app.livePhotoSystem`],qV(t,`douyin`,e.pushlist?.douyin||[]),qV(t,`bilibili`,e.pushlist?.bilibili||[]),t},YV=({device:e=`desktop`})=>{let t=(0,v.useRef)(null),[n,r]=TO(),i=dw(),a=n.get(`file`),[o,s]=TT({config:null,savedConfig:null,activeFile:a&&KB.some(e=>e.key===a)?a:`amagi`}),{activeFile:c,config:l,savedConfig:u}=o,d=(0,v.useMemo)(()=>QB(e),[e]),f=e===`mobile`?`sm`:`md`,{loading:p,run:m}=ST(cz,{onSuccess:e=>{s({config:structuredClone(e),savedConfig:structuredClone(e)})},onError:e=>{WC.danger(`加载配置失败`,{description:e.message})}}),{loading:h,runAsync:g}=ST(lz,{manual:!0}),_=(0,v.useMemo)(()=>{if(!l||!u)return!1;let e=CB(l),t=CB(u);return!(0,BO.default)(e,t)},[l,u]),y=(0,v.useMemo)(()=>JV(l),[l]),b=(0,v.useMemo)(()=>Object.values(y).some(Boolean),[y]),x=(0,v.useMemo)(()=>_&&!b&&!p,[_,b,p]),S=vw((e,t)=>{s(n=>n.config?{config:yB(n.config,e,t)}:null)}),C=vw(()=>{if(!l||b)return;let e=l,t=g(e).then(()=>{s({savedConfig:e})});WC.promise(t,{loading:`正在保存配置...`,success:`配置已保存`,error:e=>e instanceof Error?e.message:`保存配置失败`})}),w=vw(()=>{m()}),T=vw(e=>{r({file:e})}),E=vw(e=>{e.preventDefault(),C()});(0,v.useEffect)(()=>{let e=n.get(`file`);e&&KB.some(t=>t.key===e)&&e!==c&&s({activeFile:e})},[n,c,s]),(0,v.useEffect)(()=>{let e=t.current?.querySelector(`[data-config-tabs-scroll="true"]`);if(!e)return;let n=t=>{let n=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!(e.scrollWidth<=e.clientWidth)&&(e.scrollLeft+=n))};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{e.removeEventListener(`wheel`,n)}},[l]);let D=vw(()=>{t.current&&JN.fromTo(t.current.querySelectorAll(`[data-config-section]`),mz,{...hz,duration:dz(.35),stagger:fz(.03)})});(0,v.useEffect)(()=>{l&&t.current?.dataset.animated!==`true`&&(t.current&&(t.current.dataset.animated=`true`),D())},[l,D]),yw(()=>{D()},[c]);let O=(0,v.useMemo)(()=>l?YB({config:l,device:e,classes:d,validationErrors:y,updateConfigValue:S}):{},[l,e,d,y,S]);if(p||!l)return(0,H.jsxs)(`div`,{className:`${d.root} ${d.loading}`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取配置`}),(0,H.jsx)(`span`,{children:`正在读取配置`})]});let k=(0,H.jsx)(`div`,{className:d.floatingActions,children:(0,H.jsxs)(`div`,{className:d.actionControls,children:[(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{"aria-label":`重新读取配置`,children:(0,H.jsx)(ov,{isIconOnly:!0,size:f,variant:`secondary`,isDisabled:p||h,onPress:w,children:(0,H.jsx)(PP,{size:16,"aria-hidden":`true`})})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`bottom`,children:[(0,H.jsx)(uw.Arrow,{}),`重新读取`]})]}),(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{"aria-label":`查看配置变更`,children:(0,H.jsx)(ov,{isIconOnly:!0,size:f,variant:`secondary`,isDisabled:!_,onPress:i.open,children:(0,H.jsx)(SP,{size:16,"aria-hidden":`true`})})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`bottom`,children:[(0,H.jsx)(uw.Arrow,{}),`查看变更`]})]}),(0,H.jsxs)(ov,{size:f,isDisabled:!x,isPending:h,onPress:C,variant:`primary`,children:[(0,H.jsx)(IP,{size:16,"aria-hidden":`true`}),(0,H.jsx)(`span`,{children:`保存`})]})]})});return(0,H.jsxs)(`div`,{ref:t,className:d.root,children:[(0,H.jsx)(kB,{device:e,original:u,current:l,isOpen:i.isOpen,onOpenChange:i.setOpen}),(0,H.jsxs)(AS,{className:d.form,onSubmit:E,children:[(0,H.jsx)(jC,{className:`w-full min-w-0 max-w-full`,selectedKey:c,onSelectionChange:T,children:(0,H.jsx)(jC.ListContainer,{className:d.tabsListContainer,"data-config-tabs-scroll":`true`,"data-scrollbar":`none`,children:(0,H.jsx)(jC.List,{"aria-label":`配置文件选择`,className:d.tabsList,children:KB.map((e,t)=>(0,H.jsxs)(jC.Tab,{id:e.key,children:[t>0?(0,H.jsx)(jC.Separator,{}):null,(0,H.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,H.jsx)(jC.Indicator,{})]},e.key))})})}),(0,H.jsxs)(`div`,{className:`relative min-w-0 max-w-full`,children:[k,(0,H.jsx)(UV,{activeFile:c,classes:d,config:l,device:e,renderers:O,updateConfigValue:S},c)]})]})]})},XV=({onLogin:e})=>{let[t,n]=TT({authKey:``,loading:!1,error:``}),[r,{toggle:i}]=wT(!1),a=r?`隐藏密钥`:`显示密钥`,o=vw(async r=>{r.preventDefault();let i=t.authKey.trim();if(!i){n({error:`请输入 Karin HTTP 鉴权密钥`});return}try{n({loading:!0,error:``}),await az(i),e()}catch(e){n({error:e instanceof Error?e.message:`登录失败`})}finally{n({loading:!1})}});return(0,H.jsx)(yC,{className:`flex min-h-screen items-center justify-center px-4 py-8`,children:(0,H.jsxs)(lv,{className:`w-full max-w-105`,children:[(0,H.jsxs)(lv.Header,{className:`gap-4 p-6`,children:[(0,H.jsx)(EP,{className:`size-8 shrink-0`,"aria-hidden":`true`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(lv.Title,{children:`Karin 鉴权`}),(0,H.jsx)(lv.Description,{children:`使用 Karin HTTP 鉴权密钥登录后管理 KKK 配置。`})]})]}),(0,H.jsx)(lv.Content,{className:`p-6`,children:(0,H.jsxs)(AS,{className:`flex flex-col gap-6`,onSubmit:o,children:[(0,H.jsxs)(MC,{fullWidth:!0,isInvalid:!!t.error,value:t.authKey,onChange:e=>{n({authKey:e,error:t.error?``:t.error})},children:[(0,H.jsx)(IS,{children:`HTTP 鉴权密钥`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(PS,{autoComplete:`current-password`,className:`min-w-0 flex-1`,placeholder:`请输入 Karin 的 HTTP_AUTH_KEY`,type:r?`text`:`password`}),(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":a,type:`button`,variant:`tertiary`,onPress:i,children:r?(0,H.jsx)(vP,{className:`size-4`,"aria-hidden":`true`}):(0,H.jsx)(bP,{className:`size-4`,"aria-hidden":`true`})})]}),(0,H.jsx)(aS,{children:t.error||`生产环境会复用 Karin 主 Web 已保存的登录凭据。`})]}),(0,H.jsx)(ov,{fullWidth:!0,isPending:t.loading,type:`submit`,children:({isPending:e})=>(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsx)(vC,{color:`current`,size:`sm`,"aria-label":`登录中`}):(0,H.jsx)(OP,{className:`size-4`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{children:`登录`})]})})]})})]})})},ZV=`theme`,QV=`kkk-theme-changed`,$V=`karin-theme-change`,eH={light:`light`,dark:`dark`,system:`system`,inverse:`inverse`},tH=e=>e===eH.system||e===eH.inverse,nH=e=>e===eH.light||e===eH.dark,rH=e=>!e||typeof e!=`object`?!1:e.type===$V,iH=()=>{let e=localStorage.getItem(ZV);if(tH(e))return e;try{let t=JSON.parse(e??``);if(tH(t))return t}catch{}return localStorage.setItem(ZV,eH.system),eH.system},aH=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches?eH.dark:eH.light,oH=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches?eH.light:eH.dark,sH=e=>e===eH.system?aH():oH(),cH=e=>lH(sH(e)),lH=e=>(document.documentElement.classList.remove(eH.light,eH.dark),document.documentElement.classList.add(e),document.documentElement.dataset.theme=e,e),uH=()=>{let[e,t]=(0,v.useState)(()=>iH()),[n,r]=(0,v.useState)(()=>sH(e)),i=(0,v.useRef)(!1),a=(0,v.useCallback)(e=>{localStorage.setItem(ZV,e),t(e),r(cH(e)),window.dispatchEvent(new CustomEvent(QV,{detail:e}))},[]),o=(0,v.useCallback)(()=>{a(eH.system)},[a]),s=(0,v.useCallback)(()=>{a(eH.inverse)},[a]),c=(0,v.useCallback)(()=>{a(e===eH.system?eH.inverse:eH.system)},[a,e]);return(0,v.useEffect)(()=>{i.current?i.current=!1:r(cH(e));let n=window.matchMedia(`(prefers-color-scheme: dark)`),a=()=>{r(cH(e))},o=e=>{if(e.key!==ZV||window.self!==window.top)return;let n=iH();t(n),r(cH(n))},s=e=>{let n=e.detail;tH(n)&&(t(n),r(cH(n)))},c=e=>{if(!rH(e.data))return;let n=e.data.theme,a=tH(n??null)?n:iH(),o=nH(e.data.appliedTheme)?e.data.appliedTheme:sH(a);i.current=!0,localStorage.setItem(ZV,a),t(a),r(lH(o))};return n.addEventListener(`change`,a),window.addEventListener(`storage`,o),window.addEventListener(QV,s),window.addEventListener(`message`,c),()=>{n.removeEventListener(`change`,a),window.removeEventListener(`storage`,o),window.removeEventListener(QV,s),window.removeEventListener(`message`,c)}},[e]),{theme:e,appliedTheme:n,isDark:(0,v.useMemo)(()=>n===eH.dark,[n]),isLight:(0,v.useMemo)(()=>n===eH.light,[n]),isSystem:e===eH.system,isInverse:e===eH.inverse,setSystemTheme:o,setInverseTheme:s,toggleTheme:c}},dH=()=>document.documentElement.clientWidth||window.innerWidth,fH=(e=dH())=>e<=768?`mobile`:`desktop`,pH=()=>{let e=navigator.userAgent.toLowerCase();return[`android`,`webos`,`iphone`,`ipad`,`ipod`,`blackberry`,`windows phone`,`mobile`].some(t=>e.includes(t))},mH=()=>{let e=fH();return pH()||e===`mobile`?`mobile`:`desktop`},hH=.12,gH=33,_H=1,vH={scrollTo:()=>{},destroy:()=>{}},yH=(e,t)=>Math.min(Math.max(e,0),Math.max(t,0)),bH=()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,xH=(e,t,n)=>{let r=e.scrollTop,i=r,a=r,o=!1,s=!1,c=()=>e.scrollHeight-e.clientHeight;function l(){o&&(o=!1,JN.ticker.remove(u))}function u(){let t=s?hH:1-.88**JN.ticker.deltaRatio(60);if(s=!1,i=yH(i,c()),r+=(i-r)*t,e.scrollTop!==r){e.scrollTop=r;let t=e.scrollTop;a=t,Math.abs(t-r)>_H&&(r=t,i=t)}Math.abs(i-r)<_H&&(r=i,l())}function d(){o||(o=!0,s=!0,JN.ticker.add(u))}let f=()=>{Math.abs(e.scrollTop-a)<_H||(r=e.scrollTop,i=r)};function p(t){let n=t.deltaY>0,r=t.target;for(;r&&r!==e;){if(r instanceof HTMLElement){let e=window.getComputedStyle(r).overflowY;if((e===`auto`||e===`scroll`)&&r.scrollHeight>r.clientHeight&&(n?r.scrollTop+r.clientHeight<r.scrollHeight-1:r.scrollTop>1))return!0}r=r.parentElement}return!1}let m=t=>{let n=t;if(n.ctrlKey||Math.abs(n.deltaX)>Math.abs(n.deltaY)||bH()||p(n))return;let r=n.deltaY;n.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=gH:n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=e.clientHeight),r&&(n.preventDefault(),i=yH(i+r,c()),d())};return n.addEventListener(`scroll`,f,{passive:!0}),t.addEventListener(`wheel`,m,{passive:!1}),{scrollTo:t=>{if(r=e.scrollTop,i=yH(t,c()),bH()){r=i,a=i,e.scrollTop=i;return}d()},destroy:()=>{l(),n.removeEventListener(`scroll`,f),t.removeEventListener(`wheel`,m)}}},SH=e=>{let t=e.current;return t?xH(t,t,t):vH},CH=e=>{let t=e.current,n=document.scrollingElement;return!t||!n?vH:xH(n,t,window)},wH=()=>AT(()=>import(`./DesktopLayout-wpebBuCj.js`),__vite__mapDeps([2,1,3])),TH=()=>AT(()=>import(`./MobileLayout-DhcWgEcj.js`),__vite__mapDeps([4,3])),EH={config:`/kkk/assets/config`,about:`/kkk/assets/about`},DH={"/kkk/assets/config":`config`,"/kkk/assets/about":`about`},OH=({device:e})=>{let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>SH(t).destroy,[]),(0,H.jsxs)(yC,{className:`h-screen overflow-hidden bg-background`,children:[(0,H.jsx)(aw.Provider,{placement:`top`}),(0,H.jsx)(tC,{ref:t,hideScrollBar:!0,className:`h-full px-3 py-3 sm:px-5 sm:py-4 ${e===`mobile`?`data-[top-scroll=true]:mask-none data-[top-scroll=true]:[-webkit-mask-image:none] data-[top-bottom-scroll=true]:mask-[linear-gradient(180deg,black_calc(100%-var(--scroll-shadow-size)),transparent)] data-[top-bottom-scroll=true]:[-webkit-mask-image:linear-gradient(180deg,black_calc(100%-var(--scroll-shadow-size)),transparent)]`:``}`,size:56,children:(0,H.jsx)(YV,{device:e})})]})},kH=({LayoutComponent:e})=>{let t=rD(),n=oD(),r=DH[t.pathname]||`config`,i=vw(e=>{n(EH[e])});return e?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(aw.Provider,{placement:`top`}),(0,H.jsx)(e,{activeMenu:r,onMenuChange:i})]}):(0,H.jsxs)(yC,{className:`flex min-h-screen items-center justify-center gap-4`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在加载布局`}),(0,H.jsx)(aS,{children:`正在加载`})]})},AH=()=>{uH();let[e,t]=TT({authenticated:IO(),device:mH(),LayoutComponent:null}),{authenticated:n,device:r,LayoutComponent:i}=e;(0,v.useEffect)(()=>{let e=()=>{t({authenticated:IO()})};return window.addEventListener(MO,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(MO,e),window.removeEventListener(`storage`,e)}},[t]);let a=vw(()=>{let e=mH();t(t=>t.device===e?null:{device:e,LayoutComponent:null})});(0,v.useEffect)(()=>{let e=0,t=()=>{window.cancelAnimationFrame(e),e=window.requestAnimationFrame(a)};return window.addEventListener(`resize`,t),window.addEventListener(`orientationchange`,t),()=>{window.cancelAnimationFrame(e),window.removeEventListener(`resize`,t),window.removeEventListener(`orientationchange`,t)}},[a]),(0,v.useEffect)(()=>{if(!n){t({LayoutComponent:null});return}let e=!1;return(async()=>{if(r===`mobile`){let n=await TH();e||t({LayoutComponent:n.default})}else{let n=await wH();e||t({LayoutComponent:n.default})}})(),()=>{e=!0}},[n,r,t]);let o=vw(()=>{t({authenticated:!0})});return n?(0,H.jsxs)(MD,{children:[(0,H.jsx)(AD,{path:`/kkk/assets/karin-config`,element:(0,H.jsx)(OH,{device:r})}),(0,H.jsx)(AD,{path:`/kkk/assets/config`,element:(0,H.jsx)(kH,{LayoutComponent:i})}),(0,H.jsx)(AD,{path:`/kkk/assets/about`,element:(0,H.jsx)(kH,{LayoutComponent:i})}),(0,H.jsx)(AD,{path:`/kkk/assets`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})}),(0,H.jsx)(AD,{path:`/kkk`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})}),(0,H.jsx)(AD,{path:`/kkk/login`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})}),(0,H.jsx)(AD,{path:`*`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})})]}):(0,H.jsxs)(MD,{children:[(0,H.jsx)(AD,{path:`/kkk/login`,element:(0,H.jsx)(XV,{onLogin:o})}),(0,H.jsx)(AD,{path:`*`,element:(0,H.jsx)(kD,{to:`/kkk/login`,replace:!0})})]})};(0,y.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(v.StrictMode,{children:(0,H.jsx)(()=>(0,H.jsx)(vO,{children:(0,H.jsx)(AH,{})}),{})}));export{uc as $,Ag as A,V as At,up as B,O as Bt,Bv as C,Qt as Ct,ov as D,lt as Dt,lv as E,Et,ah as F,ke as Ft,$l as G,op as H,d as Ht,ih as I,we as It,Y as J,zc as K,hp as L,L as Lt,ph as M,We as Mt,mh as N,ze as Nt,tv as O,st as Ot,oh as P,z as Pt,fc as Q,mp as R,E as Rt,Uv as S,nn as St,pv as T,Mt as Tt,pd as U,l as Ut,cp as V,h as Vt,ud as W,_c as X,J as Y,dc as Z,US as _,oo as _t,dz as a,vs as at,wS as b,ya as bt,zO as c,Fo as ct,uw as d,mo as dt,ic as et,MC as f,to as ft,ZS as g,K as gt,uC as h,ao as ht,YV as i,Ms as it,xh as j,B as jt,Ng as k,at as kt,wT as l,Mo as lt,yC as m,G as mt,SH as n,Js as nt,cP as o,Ro as ot,jC as p,io as pt,Bc as q,uH as r,Is as rt,JN as s,zo as st,CH as t,rc as tt,vw as u,Do as ut,IS as v,ro as vt,Hv as w,en as wt,aS as x,on as xt,PS as y,_a as yt,pp as z,M as zt};
47
+ </div>`),e.hasArrows=!0}format_textdiff(e,t){e.out(`<div class="jsondiffpatch-value">`),this.formatTextDiffString(e,t[0]),e.out(`</div>`)}};function dB(e){if(typeof e==`number`)return e;let t=String(e);for(let e of[[/&/g,`&amp;`],[/</g,`&lt;`],[/>/g,`&gt;`],[/'/g,`&apos;`],[/"/g,`&quot;`]])t=t.replace(e[0],e[1]);return t}var fB=function(e){let t=e||document,n=({textContent:e,innerText:t})=>e||t,r=(e,t,n)=>{let r=e.querySelectorAll(t);for(let e=0,t=r.length;e<t;e++)n(r[e])},i=({children:e},t)=>{for(let n=0,r=e.length;n<r;n++){let r=e[n];r&&t(r,n)}};r(t,`.jsondiffpatch-arrow`,({parentNode:e,children:t,style:r})=>{let a=e,o=t[0],s=o.children[1];o.style.display=`none`;let c=a.querySelector(`.jsondiffpatch-moved-destination`);if(!(c instanceof HTMLElement))return;let l=n(c),u=a.parentNode;if(!u)return;let d;if(i(u,e=>{e.getAttribute(`data-key`)===l&&(d=e)}),d)try{let e=d.offsetTop-a.offsetTop;o.setAttribute(`height`,`${Math.abs(e)+6}`),r.top=`${-8+(e>0?0:e)}px`;let t=e>0?`M30,0 Q-10,${Math.round(e/2)} 26,${e-4}`:`M30,${-e} Q-10,${Math.round(-e/2)} 26,4`;s.setAttribute(`d`,t),o.style.display=``}catch(e){console.debug(`[jsondiffpatch] error adjusting arrows: ${e}`)}})},pB=(e,t,n)=>{let r=t||document.body,i=`jsondiffpatch-unchanged-`,a={showing:`${i}showing`,hiding:`${i}hiding`,visible:`${i}visible`,hidden:`${i}hidden`},o=r.classList;if(!o)return;if(!n){o.remove(a.showing),o.remove(a.hiding),o.remove(a.visible),o.remove(a.hidden),e===!1&&o.add(a.hidden);return}e===!1?(o.remove(a.showing),o.add(a.visible),setTimeout(()=>{o.add(a.hiding)},10)):(o.remove(a.hiding),o.add(a.showing),o.remove(a.hidden));let s=setInterval(()=>{fB(r)},100);setTimeout(()=>{o.remove(a.showing),o.remove(a.hiding),e===!1?(o.add(a.hidden),o.remove(a.visible)):(o.add(a.visible),o.remove(a.hidden)),setTimeout(()=>{o.remove(a.visible),clearInterval(s)},n+400)},n)},mB=(e,t)=>pB(!1,e,t),hB;function gB(e,t){return hB||=new uB,hB.format(e,t)}var _B=e=>e.join(`.`),vB=e=>!!(e&&typeof e==`object`),Q=(e,t,n)=>e?t.reduce((e,t)=>{if(vB(e))return e[t]},e)??n:n,yB=(e,t,n)=>{let r=structuredClone(e),i=r;for(let e=0;e<t.length-1;e++){let n=t[e],r=i[n];vB(r)||(i[n]={}),i=i[n]}return i[t[t.length-1]]=n,r},bB=(e,t)=>{let n=Number(e);return Number.isFinite(n)?n:t},xB=(e,t)=>Array.isArray(e)&&e.includes(t),SB=e=>!!(e&&typeof e==`object`&&`description`in e),CB=e=>{if(!e||typeof e!=`object`)return e;let t=structuredClone(e);for(let{path:e,options:n}of[{path:[`bilibili`,`sendContent`],options:[`info`,`comment`,`video`,`image`]},{path:[`bilibili`,`displayContent`],options:[`cover`,`title`,`author`,`stats`,`desc`]},{path:[`bilibili`,`push`,`parseDynamicTypes`],options:[`DYNAMIC_TYPE_AV`,`DYNAMIC_TYPE_DRAW`,`DYNAMIC_TYPE_ARTICLE`]},{path:[`douyin`,`sendContent`],options:[`info`,`comment`,`video`,`image`]},{path:[`xiaohongshu`,`sendContent`],options:[`info`,`comment`,`video`,`image`]},{path:[`kuaishou`,`sendContent`],options:[`info`,`comment`,`video`,`image`]}]){let r=Q(t,e,null);if(!Array.isArray(r))continue;let i=n.filter(e=>r.includes(e)),a=t;for(let t=0;t<e.length-1;t++){let n=e[t];vB(a[n])||(a[n]={}),a=a[n]}a[e[e.length-1]]=i}return t},wB=e=>typeof e==`object`&&!!e,TB=e=>{let t={added:0,modified:0,deleted:0},n=e=>{if(wB(e)){if(Array.isArray(e)){e.length===1?t.added+=1:e.length===2?t.modified+=1:e.length===3&&e[2]===0&&(t.deleted+=1);return}for(let[t,r]of Object.entries(e))t!==`_t`&&n(r)}};return n(e),t},EB=({original:e,current:t,showUnchanged:n=!1})=>{let r=(0,v.useRef)(null),i=(0,v.useMemo)(()=>{if(e&&t)return cB(CB(e),CB(t))},[e,t]),a=(0,v.useMemo)(()=>e?CB(e):void 0,[e]),o=(0,v.useMemo)(()=>{if(i)return gB(i,a)},[i,a]),s=(0,v.useMemo)(()=>TB(i),[i]);return(0,v.useEffect)(()=>{r.current&&(o?(r.current.innerHTML=o,n?pB(!0,r.current):mB(r.current)):r.current.innerHTML=``)},[o,n]),o?(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(Rv,{size:`sm`,color:`success`,variant:`soft`,children:(0,H.jsxs)(Rv.Label,{children:[`+ `,s.added,` 新增`]})}),(0,H.jsx)(Rv,{size:`sm`,color:`warning`,variant:`soft`,children:(0,H.jsxs)(Rv.Label,{children:[`~ `,s.modified,` 修改`]})}),(0,H.jsx)(Rv,{size:`sm`,color:`danger`,variant:`soft`,children:(0,H.jsxs)(Rv.Label,{children:[`- `,s.deleted,` 删除`]})})]}),(0,H.jsx)(`div`,{className:`max-h-[60vh] overflow-auto rounded-xl border border-default-200 bg-surface p-4`,children:(0,H.jsx)(`div`,{ref:r,className:`min-w-fit`})})]}):(0,H.jsx)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-10 text-center`,children:(0,H.jsx)(aS,{className:`text-sm text-muted`,children:`当前没有检测到配置变更`})})},DB=`变更预览`,OB=`绿色 = 新增/改后的内容,红色 = 删除/改前的内容,灰色 = 没变化的内容。`,kB=({device:e,original:t,current:n,isOpen:r,onOpenChange:i})=>{let[a,o]=(0,v.useState)(!1),s=(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(aS,{className:`text-xs text-muted`,children:OB}),(0,H.jsx)(DC,{size:`sm`,isSelected:a,onChange:o,"aria-label":`显示未变更字段`,children:(0,H.jsxs)(DC.Content,{children:[(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})}),`显示未变更`]})})]}),(0,H.jsx)(EB,{original:t,current:n,showUnchanged:a})]}),c=(0,H.jsx)(ov,{slot:`close`,size:`sm`,variant:`secondary`,children:`关闭`});return e===`mobile`?(0,H.jsx)(wS,{children:(0,H.jsx)(wS.Backdrop,{isOpen:r,onOpenChange:i,children:(0,H.jsx)(wS.Content,{placement:`bottom`,children:(0,H.jsxs)(wS.Dialog,{className:`h-[85vh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsx)(wS.Header,{children:(0,H.jsx)(wS.Heading,{children:DB})}),(0,H.jsx)(wS.Body,{children:s}),(0,H.jsx)(wS.Footer,{children:c})]})})})}):(0,H.jsx)(qS,{children:(0,H.jsx)(qS.Backdrop,{isOpen:r,onOpenChange:i,children:(0,H.jsx)(qS.Container,{scroll:`inside`,size:`lg`,children:(0,H.jsxs)(qS.Dialog,{className:`w-full max-w-4xl`,children:[(0,H.jsx)(qS.CloseTrigger,{}),(0,H.jsxs)(qS.Header,{children:[(0,H.jsx)(qS.Icon,{className:`bg-accent-soft text-accent-soft-foreground`,children:(0,H.jsx)(SP,{className:`size-5`})}),(0,H.jsx)(qS.Heading,{children:DB})]}),(0,H.jsx)(qS.Body,{children:s}),(0,H.jsx)(qS.Footer,{children:c})]})})})})},AB=e=>!!(e&&typeof e==`object`),$=(e,t,n)=>e?t.reduce((e,t)=>{if(AB(e))return e[t]},e)??n:n,jB=(e,t)=>Array.isArray(e)&&e.includes(t),MB=[{path:[`app`,`priority`],rules:[{condition:e=>$(e,[`app`,`videoTool`],!0),message:`修改此配置项需要先将「默认解析优先级」关闭`}]},{path:[`app`,`multiPageHeight`],rules:[{condition:e=>!$(e,[`app`,`multiPageRender`],!0),message:`修改此配置项需要先将「分页渲染」打开`}]},{path:[`app`,`livePhotoSystem`],rules:[{condition:e=>$(e,[`app`,`livePhotoMode`],`video_and_livephoto`)===`video_only`,message:`修改此配置项需要先将「Live Photo 处理和发送方式」改为非「仅视频」模式`}]},{path:[`amagi`,`APIServerMount`],rules:[{condition:e=>!$(e,[`amagi`,`APIServer`],!1),message:`修改此配置项需要先将「API 服务」打开`}]},{path:[`amagi`,`APIServerPort`],rules:[{condition:e=>$(e,[`amagi`,`APIServerMount`],!0),message:`修改此配置项需要先将「挂载到 Karin」关闭`}]},{path:[`app`,`qrLoginExternalAddr`],rules:[{condition:e=>$(e,[`app`,`qrLoginAddrType`],`lan`)!==`external`,message:`修改此配置项需要先将「扫码登录地址」改为「外部地址」`}]},{path:[`app`,`videoSendMode`],rules:[{condition:e=>$(e,[`app`,`usegroupfile`],!1),message:`修改此配置项需要先将「群文件上传」关闭`}]},{path:[`app`,`usegroupfile`],rules:[{condition:e=>$(e,[`app`,`videoSendMode`],`file`)===`base64`,message:`修改此配置项需要先将「本地视频发送方式」改为「File 协议」`}]},{path:[`app`,`groupfilevalue`],rules:[{condition:e=>!$(e,[`app`,`usegroupfile`],!1),message:`修改此配置项需要先将「群文件上传」打开`},{condition:e=>$(e,[`app`,`videoSendMode`],`file`)===`base64`,message:`修改此配置项需要先将「本地视频发送方式」改为「File 协议」`}]},{path:[`app`,`filelimit`],rules:[{condition:e=>!$(e,[`app`,`usefilelimit`],!1),message:`修改此配置项需要先将「视频上传拦截」打开`}]},{path:[`app`,`compresstrigger`],rules:[{condition:e=>!$(e,[`app`,`compress`],!1),message:`修改此配置项需要先将「压缩视频」打开`}]},{path:[`app`,`compressvalue`],rules:[{condition:e=>!$(e,[`app`,`compress`],!1),message:`修改此配置项需要先将「压缩视频」打开`}]},{path:[`app`,`downloadMaxSpeed`],rules:[{condition:e=>!$(e,[`app`,`downloadThrottle`],!1),message:`修改此配置项需要先将「下载限速」打开`}]},{path:[`app`,`downloadAutoReduce`],rules:[{condition:e=>!$(e,[`app`,`downloadThrottle`],!1),message:`修改此配置项需要先将「下载限速」打开`}]},{path:[`app`,`downloadMinSpeed`],rules:[{condition:e=>!$(e,[`app`,`downloadThrottle`],!1),message:`修改此配置项需要先将「下载限速」打开`},{condition:e=>!$(e,[`app`,`downloadAutoReduce`],!1),message:`修改此配置项需要先将「断流自动降速」打开`}]},{path:[`amagi`,`proxy`,`protocol`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`host`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`port`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`auth`,`username`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`amagi`,`proxy`,`auth`,`password`],rules:[{condition:e=>!$(e,[`amagi`,`proxy`,`switch`],!1),message:`修改此配置项需要先将「代理开关」打开`}]},{path:[`douyin`,`sendContent`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`numcomment`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`douyin`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`douyin`,`subCommentLimit`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`douyin`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`douyin`,`commentImageCollection`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`douyin`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`douyin`,`liveImageMergeMode`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`app`,`livePhotoMode`],`video_and_livephoto`)===`livephoto_only`,message:`修改此配置项需要先将「Live Photo 处理和发送方式」改为非「仅实况图」模式`}]},{path:[`douyin`,`videoQuality`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`maxAutoVideoSize`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`douyin`,`videoQuality`],`adapt`)!==`adapt`,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]},{path:[`douyin`,`videoInfoMode`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`displayContent`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`douyin`,`videoInfoMode`],`text`)===`image`,message:`修改此配置项需要先将「视频信息返回形式」改为「文本模式」`}]},{path:[`douyin`,`burnDanmaku`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`douyin`,`danmakuArea`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`danmakuFontSize`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`danmakuOpacity`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`verticalMode`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`videoCodec`],rules:[{condition:e=>!$(e,[`douyin`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`douyin`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`douyin`,`push`,`permission`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`cron`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`parsedynamic`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`shareType`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`pushVideoQuality`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`douyin`,`push`,`pushMaxAutoVideoSize`],rules:[{condition:e=>!$(e,[`douyin`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>$(e,[`douyin`,`push`,`pushVideoQuality`],`adapt`)!==`adapt`,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]},{path:[`bilibili`,`sendContent`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`numcomment`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`bilibili`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`bilibili`,`realCommentCount`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`bilibili`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`bilibili`,`commentImageCollection`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`bilibili`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`bilibili`,`videoQuality`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`maxAutoVideoSize`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>Number($(e,[`bilibili`,`videoQuality`],0))!==0,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]},{path:[`bilibili`,`videoInfoMode`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`displayContent`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`bilibili`,`videoInfoMode`],`text`)===`image`,message:`修改此配置项需要先将「视频信息返回形式」改为「文本模式」`}]},{path:[`bilibili`,`showDanmakuInVideoInfo`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`bilibili`,`videoInfoMode`],`text`)===`text`,message:`修改此配置项需要先将「视频信息返回形式」改为「图片模式」`}]},{path:[`bilibili`,`burnDanmaku`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`bilibili`,`danmakuArea`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`danmakuFontSize`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`danmakuOpacity`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`verticalMode`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`videoCodec`],rules:[{condition:e=>!$(e,[`bilibili`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`bilibili`,`burnDanmaku`],!1),message:`修改此配置项需要先将「弹幕烧录」打开`}]},{path:[`bilibili`,`push`,`permission`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`bilibili`,`push`,`cron`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`bilibili`,`push`,`parsedynamic`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`}]},{path:[`bilibili`,`push`,`parseDynamicTypes`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>!$(e,[`bilibili`,`push`,`parsedynamic`],!1),message:`修改此配置项需要先将「作品解析」打开`}]},{path:[`bilibili`,`push`,`pushVideoQuality`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>!$(e,[`bilibili`,`push`,`parsedynamic`],!1),message:`修改此配置项需要先将「作品解析」打开`}]},{path:[`bilibili`,`push`,`pushMaxAutoVideoSize`],rules:[{condition:e=>!$(e,[`bilibili`,`push`,`switch`],!1),message:`修改此配置项需要先将「推送开关」打开`},{condition:e=>!$(e,[`bilibili`,`push`,`parsedynamic`],!1),message:`修改此配置项需要先将「作品解析」打开`},{condition:e=>Number($(e,[`bilibili`,`push`,`pushVideoQuality`],0))!==0,message:`修改此配置项需要先将「解析视频动态时的画质偏好」改为「自动选择」`}]},{path:[`kuaishou`,`comment`],rules:[{condition:e=>!$(e,[`kuaishou`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`kuaishou`,`numcomment`],rules:[{condition:e=>!$(e,[`kuaishou`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!$(e,[`kuaishou`,`comment`],!1),message:`修改此配置项需要先将「评论解析」打开`}]},{path:[`xiaohongshu`,`sendContent`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`xiaohongshu`,`numcomment`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`xiaohongshu`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`xiaohongshu`,`subCommentLimit`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>!jB($(e,[`xiaohongshu`,`sendContent`],[]),`comment`),message:`修改此配置项需要在「解析时发送的内容」中勾选「评论图」`}]},{path:[`xiaohongshu`,`videoQuality`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`}]},{path:[`xiaohongshu`,`maxAutoVideoSize`],rules:[{condition:e=>!$(e,[`xiaohongshu`,`switch`],!1),message:`修改此配置项需要先将「解析开关」打开`},{condition:e=>$(e,[`xiaohongshu`,`videoQuality`],`adapt`)!==`adapt`,message:`修改此配置项需要先将「画质偏好」改为「自动选择」`}]}],NB=e=>e.join(`.`),PB=(e,t)=>{let n=NB(t),r=MB.find(e=>NB(e.path)===n);if(!r)return``;for(let t of r.rules)if(t.condition(e))return t.message;return``},FB=[{label:`信息`,value:`info`},{label:`评论图`,value:`comment`},{label:`视频`,value:`video`},{label:`图片`,value:`image`}],IB=[{label:`封面`,value:`cover`},{label:`标题`,value:`title`},{label:`作者`,value:`author`},{label:`统计`,value:`stats`},{label:`简介`,value:`desc`}],LB=[{label:`自动选择`,value:`adapt`,description:`根据「视频体积上限(MB)」自动选择分辨率进行下载`},{label:`标清 540p`,value:`540p`},{label:`高清 720p`,value:`720p`},{label:`高清 1080p`,value:`1080p`},{label:`超清 2k`,value:`2k`},{label:`超清 4k`,value:`4k`}],RB=[{label:`自动选择`,value:`0`},{label:`240P 极速`,value:`6`},{label:`360P 流畅`,value:`16`},{label:`480P 清晰`,value:`32`,description:`需登录(配置ck)`},{label:`720P 高清`,value:`64`,description:`需登录(配置ck)`},{label:`720P60 高帧率`,value:`74`,description:`需登录(配置ck)`},{label:`1080P 高清`,value:`80`,description:`需登录(配置ck)`},{label:`1080P+ 高码率`,value:`112`,description:`需大会员&视频支持`},{label:`1080P60 高帧率`,value:`116`,description:`需大会员&视频支持`},{label:`4K 超清`,value:`120`,description:`需大会员&视频支持`},{label:`8K 超高清`,value:`127`,description:`需大会员&视频支持`}],zB=[{label:`视频动态`,value:`DYNAMIC_TYPE_AV`},{label:`图文动态`,value:`DYNAMIC_TYPE_DRAW`},{label:`文章动态`,value:`DYNAMIC_TYPE_ARTICLE`}],BB=[{label:`所有人`,value:`all`},{label:`管理员`,value:`admin`},{label:`主人`,value:`master`},{label:`群主`,value:`group.owner`},{label:`群管理员`,value:`group.admin`}],VB=[{label:`H.264`,value:`h264`,description:`兼容性最好,支持几乎所有设备`},{label:`H.265`,value:`h265`,description:`压缩率更高,近几年设备支持良好(推荐)`},{label:`AV1`,value:`av1`,description:`最新编码格式,压缩率最高,但编码较慢`}],HB=[{label:`关闭`,value:`off`,description:`保持原始比例,不做转换`},{label:`智能`,value:`standard`,description:`仅对宽屏比例视频生效`},{label:`强制 9:16`,value:`force`,description:`所有视频统一转为 9:16 竖屏`}],UB=[{label:`1/4 屏`,value:`0.25`,description:`仅顶部区域`},{label:`半屏`,value:`0.5`,description:`上半部分(推荐)`},{label:`3/4 屏`,value:`0.75`,description:`大部分区域`},{label:`全屏`,value:`1`,description:`铺满整个画面`}],WB=[{label:`小号`,value:`small`},{label:`中号`,value:`medium`},{label:`大号`,value:`large`}],GB={enabled:`已开启`,disabled:`已关闭`},KB=[{key:`amagi`,label:`接口库`,description:`请求与 Cookies`},{key:`app`,label:`通用`,description:`运行与交互`},{key:`douyin`,label:`抖音`,description:`解析与推送`},{key:`bilibili`,label:`哔哩哔哩`,description:`解析与推送`},{key:`kuaishou`,label:`快手`,description:`快手解析`},{key:`xiaohongshu`,label:`小红书`,description:`小红书解析`},{key:`pushlist`,label:`推送列表`,description:`订阅 JSON`}],qB=(0,v.lazy)(()=>AT(()=>import(`./CronEditor-Bvl90nHa.js`),__vite__mapDeps([0,1]))),JB=({className:e,disabled:t,...n})=>{let[r,i]=(0,v.useState)(!1),a=r?`隐藏密码`:`显示密码`;return(0,H.jsxs)(`div`,{className:`relative w-full`,children:[(0,H.jsx)(PS,{...n,variant:`secondary`,className:`w-full pr-10 ${e??``}`,type:r?`text`:`password`}),(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":a,className:`absolute right-1 top-1/2 -translate-y-1/2`,isDisabled:t,size:`sm`,type:`button`,variant:`tertiary`,onPress:()=>i(e=>!e),children:r?(0,H.jsx)(vP,{className:`size-4`,"aria-hidden":`true`}):(0,H.jsx)(bP,{className:`size-4`,"aria-hidden":`true`})})]})},YB=({config:e,device:t,classes:n,validationErrors:r,updateConfigValue:i})=>{let a=e=>{let n=SB(e)?e:{description:e},r=t===`mobile`?n.mobileContent??n.desktopContent:n.desktopContent;return(0,H.jsxs)(aS,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:n.description}),r?(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{"aria-label":`查看详细说明`,children:(0,H.jsx)(ov,{isIconOnly:!0,size:`sm`,variant:`tertiary`,children:(0,H.jsx)(wP,{className:`size-4`,"aria-hidden":`true`})})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:t===`mobile`?`bottom`:`top`,children:[(0,H.jsx)(uw.Arrow,{}),(0,H.jsx)(`div`,{className:`max-w-72`,children:r})]})]}):null,n.extra]})},o=(n,r,i)=>{if(!i)return n;let a=PB(e,r);return a?t===`mobile`?(0,H.jsxs)(ZS,{children:[(0,H.jsx)(ZS.Trigger,{className:`w-full cursor-not-allowed`,children:n}),(0,H.jsx)(ZS.Content,{placement:`bottom`,children:(0,H.jsxs)(ZS.Dialog,{children:[(0,H.jsx)(ZS.Arrow,{}),(0,H.jsx)(`div`,{className:`max-w-72 text-sm`,children:a})]})})]}):(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{className:`w-full cursor-not-allowed`,children:n}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),(0,H.jsx)(`div`,{className:`max-w-72`,children:a})]})]}):n},s=(t,n,r,a)=>{let o=Q(e,t,[]),s=r?Array.from(new Set([...o,n])):o.filter(e=>e!==n);if(a&&r){let e=a.find(e=>e.includes(n));if(e){let t=e.filter(e=>e!==n);s=s.filter(e=>!t.includes(e))}}i(t,s)};return{renderSwitch:(t,n,r,s=!1)=>{let c=Q(e,t,!1),l=(0,H.jsxs)(DC,{isDisabled:s,isSelected:c,onChange:e=>i(t,e),children:[(0,H.jsxs)(DC.Content,{children:[(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})}),(0,H.jsx)(`span`,{className:`font-semibold`,children:n})]}),a(r||(c?GB.enabled:GB.disabled))]});return o(l,t,s)},renderTextField:(t,n,s,c)=>{let l=c?.type||`text`,u=String(Q(e,t,l===`number`?c?.fallback??0:``)),d=r[_B(t)],f=c?.disabled??!1,p=(0,H.jsxs)(MC,{fullWidth:!0,isInvalid:!!d,isDisabled:f,name:t.join(`.`),type:l,value:u,onChange:e=>{i(t,l===`number`?bB(e,c?.fallback??0):e)},children:[(0,H.jsx)(IS,{className:`font-semibold`,children:n}),l===`password`?(0,H.jsx)(JB,{disabled:f,max:c?.max,min:c?.min,pattern:c?.pattern,placeholder:c?.placeholder||n,step:c?.step}):(0,H.jsx)(PS,{variant:`secondary`,max:c?.max,min:c?.min,pattern:c?.pattern,placeholder:c?.placeholder||n,step:c?.step}),d?(0,H.jsx)(OS,{children:d}):a(s)]});return o(p,t,f)},renderSelectField:(t,n,r,s,c=e=>e,l=!1)=>{let u=String(Q(e,t,s[0]?.value||``)),d=s.filter(e=>e.disabled).map(e=>e.value),f=(0,H.jsxs)(uC,{disabledKeys:d,fullWidth:!0,isDisabled:l,name:t.join(`.`),placeholder:n,value:u,variant:`secondary`,onChange:e=>{e===null||Array.isArray(e)||i(t,c(String(e)))},children:[(0,H.jsx)(IS,{className:`font-semibold`,children:n}),(0,H.jsxs)(uC.Trigger,{children:[(0,H.jsx)(uC.Value,{}),(0,H.jsx)(uC.Indicator,{})]}),a(r),(0,H.jsx)(uC.Popover,{children:(0,H.jsx)(US,{children:s.map(e=>(0,H.jsxs)(US.Item,{id:e.value,textValue:e.label,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(IS,{children:e.label}),e.description?(0,H.jsx)(aS,{children:e.description}):null]}),(0,H.jsx)(US.ItemIndicator,{})]},e.value))})})]});return o(f,t,l)},renderCheckboxGroup:(t,r,i,c,l=!1,u)=>{let d=Q(e,t,[]),f=(0,H.jsxs)(`div`,{className:n.field,children:[(0,H.jsx)(IS,{className:`font-semibold`,children:r}),a(i),(0,H.jsx)(`div`,{className:n.choiceGrid,children:c.map(e=>{let n=xB(d,e.value);return(0,H.jsxs)(Pv,{variant:`secondary`,isDisabled:l,isSelected:n,onChange:n=>s(t,e.value,n,u),children:[(0,H.jsxs)(Pv.Content,{children:[(0,H.jsx)(Pv.Control,{children:(0,H.jsx)(Pv.Indicator,{})}),e.label]}),e.description?(0,H.jsx)(aS,{children:e.description}):null]},e.value)})})]});return o(f,t,l)},renderSlider:(t,r,s,c)=>{let l=Q(e,t,c?.fallback??0),u=c?.disabled??!1,d=(0,H.jsxs)(`div`,{className:n.field,children:[(0,H.jsxs)(hC,{className:`w-full`,isDisabled:u,value:l,formatOptions:c?.formatOptions??{style:`percent`,maximumFractionDigits:0},maxValue:c?.max??1,minValue:c?.min??0,step:c?.step??.01,onChange:e=>{Array.isArray(e)||i(t,e)},children:[(0,H.jsx)(IS,{className:`font-semibold`,children:r}),(0,H.jsx)(hC.Output,{}),(0,H.jsxs)(hC.Track,{children:[(0,H.jsx)(hC.Fill,{}),(0,H.jsx)(hC.Thumb,{})]})]}),a(s)]});return o(d,t,u)},renderCronField:(r,a,s,c=!1)=>{let l=Q(e,r,`*/10 * * * *`),u=(0,H.jsx)(`div`,{className:n.field,children:(0,H.jsx)(v.Suspense,{fallback:(0,H.jsx)(`div`,{className:`h-64 animate-pulse rounded-lg bg-muted/30`}),children:(0,H.jsx)(qB,{device:t,disabled:c,value:l,onChange:e=>i(r,e)})})});return o(u,r,c)},renderPageHeader:(e,n)=>(0,H.jsxs)(`div`,{className:`mb-6 ${t===`mobile`?`pr-36`:``}`,"data-config-section":!0,children:[(0,H.jsx)(`h2`,{className:`text-2xl font-bold`,children:e}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(aS,{children:n})})]}),renderSubSection:(e,t)=>(0,H.jsxs)(lv,{"data-config-section":!0,className:`mb-4`,children:[(0,H.jsx)(lv.Header,{className:n.sectionHeader,children:(0,H.jsx)(lv.Title,{className:`text-lg font-semibold`,children:e})}),(0,H.jsx)(lv.Content,{className:n.sectionContent,children:(0,H.jsx)(`div`,{className:n.fields,children:t})})]})}},XB={root:`relative flex min-w-0 max-w-full flex-col gap-8`,loading:`flex min-h-80 items-center justify-center gap-3`,header:`grid grid-cols-[minmax(0,1fr)_auto] items-start gap-8 pr-44`,headerCopy:`flex min-w-0 flex-col gap-2`,form:`flex min-w-0 max-w-full flex-col gap-6`,floatingActions:`fixed right-6 top-20 z-10`,actionControls:`flex items-center justify-end gap-3`,sectionHeader:`p-2`,sectionContent:`p-6`,fields:`grid grid-cols-2 gap-x-6 gap-y-5`,field:`flex min-w-0 flex-col gap-2`,choiceGrid:`grid grid-cols-2 gap-3`,divider:`col-span-full flex min-w-0 flex-col gap-2 pt-3`,tabsListContainer:`w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden overscroll-x-contain overscroll-y-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,tabsList:`w-fit min-w-max *:w-fit *:min-w-fit *:flex-none *:shrink-0 *:whitespace-nowrap`,topLevelFields:`mb-4 space-y-4 px-2`},ZB={root:`relative flex min-w-0 max-w-full flex-col gap-5`,loading:`flex min-h-80 items-center justify-center gap-3`,header:`flex flex-col gap-3 pt-12`,headerCopy:`flex min-w-0 flex-col gap-2`,form:`flex min-w-0 max-w-full flex-col gap-3`,floatingActions:`sticky top-0 z-20 flex h-0 w-full justify-end overflow-visible`,actionControls:`flex w-fit h-11 p-1 items-center gap-2 rounded-full border border-default-200 bg-background/90 shadow-sm backdrop-blur-md`,sectionHeader:`p-1`,sectionContent:`p-0`,fields:`grid grid-cols-1 gap-5`,field:`flex min-w-0 flex-col gap-2`,choiceGrid:`grid grid-cols-1 gap-3`,divider:`col-span-full flex min-w-0 flex-col gap-2 pt-3`,tabsListContainer:`w-full min-w-0 max-w-full overflow-x-auto overflow-y-hidden overscroll-x-contain overscroll-y-none [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,tabsList:`w-fit min-w-max *:w-fit *:min-w-fit *:flex-none *:shrink-0 *:whitespace-nowrap`,topLevelFields:`mb-4 space-y-4 px-4`},QB=e=>e===`mobile`?ZB:XB,$B=({config:e,renderers:t})=>{let{renderPageHeader:n,renderSelectField:r,renderSubSection:i,renderSwitch:a,renderTextField:o}=t,s=Q(e,[`amagi`,`proxy`,`switch`],!1),c=Q(e,[`amagi`,`APIServer`],!1);return(0,H.jsxs)(H.Fragment,{children:[n(`接口库配置`,`接口库的 Cookies、请求、代理和 API 服务配置。保存后后端会重载接口库客户端。`),i(`平台 Cookies`,(0,H.jsxs)(H.Fragment,{children:[o([`amagi`,`cookies`,`douyin`],`抖音 Cookies`,`请输入你的抖音Cookies,不输入则无法使用抖音相关功能噢。`,{type:`password`}),o([`amagi`,`cookies`,`bilibili`],`B站 Cookies`,`请输入你的B站Cookies,不输入部分功能将受限噢。`,{type:`password`}),o([`amagi`,`cookies`,`kuaishou`],`快手 Cookies`,`请输入你的快手Cookies,不输入则无法使用快手相关功能噢。`,{type:`password`}),o([`amagi`,`cookies`,`xiaohongshu`],`小红书 Cookies`,`请输入你的小红书Cookies,不输入则无法使用小红书相关功能噢。`,{type:`password`})]})),i(`请求配置`,(0,H.jsxs)(H.Fragment,{children:[o([`amagi`,`timeout`],`请求超时时间`,`网络请求的超时时间,单位:毫秒。`,{type:`number`,fallback:15e3,min:1e3,max:3e5}),o([`amagi`,`User-Agent`],`User-Agent`,`请求头中的User-Agent字段,用于标识客户端类型。`)]})),i(`代理配置(可选)`,(0,H.jsxs)(H.Fragment,{children:[a([`amagi`,`proxy`,`switch`],`代理开关`,`开启后需要配置「代理主机」「代理端口」。`),r([`amagi`,`proxy`,`protocol`],`代理协议`,`代理服务使用的协议。`,[{label:`HTTP`,value:`http`},{label:`HTTPS`,value:`https`}],e=>e,!s),o([`amagi`,`proxy`,`host`],`代理主机`,`代理服务器的主机地址,如:127.0.0.1。`,{disabled:!s}),o([`amagi`,`proxy`,`port`],`代理端口`,`代理服务器的端口号。`,{type:`number`,fallback:7890,min:1,max:65535,disabled:!s}),o([`amagi`,`proxy`,`auth`,`username`],`代理用户名`,`代理服务器的认证用户名(如果需要)。`,{disabled:!s}),o([`amagi`,`proxy`,`auth`,`password`],`代理密码`,`代理服务器的认证密码(如果需要)。`,{type:`password`,disabled:!s})]})),i(`API 服务配置`,(0,H.jsxs)(H.Fragment,{children:[a([`amagi`,`APIServer`],`API 服务`,`本地部署一个视频解析API服务,接口范围为本插件用到的所有。`),a([`amagi`,`APIServerMount`],`挂载到 Karin`,`API 服务是否挂载到 Karin 上,开启后监听端口为 Karin 的 http 端口,修改后需重启。需开启「API服务」。`,!c),o([`amagi`,`APIServerPort`],`API 服务端口`,`仅未挂载到 Karin 时生效。`,{type:`number`,disabled:Q(e,[`amagi`,`APIServerMount`],!0),fallback:4567,min:1024,max:65535})]}))]})},eV=({config:e,renderers:t})=>{let{renderCheckboxGroup:n,renderPageHeader:r,renderSelectField:i,renderSlider:a,renderSubSection:o,renderSwitch:s,renderTextField:c}=t,l=Q(e,[`app`,`livePhotoMode`],`video_and_livephoto`);return(0,H.jsxs)(H.Fragment,{children:[r(`通用`,`插件运行、渲染和交互相关配置。`),o(`缓存设置`,(0,H.jsx)(H.Fragment,{children:s([`app`,`removeCache`],`自动删除视频缓存`,`任务完成后删除下载缓存。`)})),o(`交互设置`,(0,H.jsxs)(H.Fragment,{children:[s([`app`,`EmojiReply`],`表情回应`,`在解析任务开始时添加表情回应,若适配器不支持需要关闭。`),s([`app`,`parseTip`],`解析提示`,`发送提示信息:"检测到xxx链接,开始解析"。`),s([`app`,`fakeForward`],`伪造合并转发消息`,`开启后合并转发将使用触发者身份展示;关闭后使用机器人身份展示。`),n([`app`,`errorLogSendTo`],`错误日志`,`遇到错误时谁会收到错误日志。注:推送任务只可发送给主人。「第一个主人」与「所有主人」互斥。`,[{label:`第一个主人`,value:`master`},{label:`所有主人`,value:`allMasters`},{label:`触发者的群聊`,value:`trigger`}],!1,[[`master`,`allMasters`]])]})),o(`渲染设置`,(0,H.jsxs)(H.Fragment,{children:[c([`app`,`renderScale`],`渲染精度`,`可选值50~200,建议100。设置高精度会提高图片的精细度,过高可能会影响渲染与发送速度。`,{type:`number`,fallback:100,min:50,max:200}),(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:i([`app`,`Theme`],`渲染图片的主题色`,`渲染评论图和推送图的主题色。`,[{label:`自动`,value:`0`,description:`06:00-18:00为浅色,18:00-06:00为深色`},{label:`浅色`,value:`1`},{label:`深色`,value:`2`},{label:`智能场景(实验性)`,value:`3`,description:`自动模式的超集;部分模板会根据封面色调 智能调整主题色,可能会出现不适配的情况。`}],e=>Number(e))}),(0,H.jsxs)(ZS,{children:[(0,H.jsx)(ZS.Trigger,{"aria-label":`封面氛围背景参数`,className:`mt-7 shrink-0`,children:(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":`封面氛围背景参数`,variant:`secondary`,children:(0,H.jsx)(RP,{className:`size-4`,"aria-hidden":`true`})})}),(0,H.jsx)(ZS.Content,{className:`w-90 max-w-[calc(100vw-2rem)]`,placement:`bottom`,children:(0,H.jsxs)(ZS.Dialog,{children:[(0,H.jsx)(ZS.Arrow,{}),(0,H.jsx)(ZS.Heading,{children:`封面氛围背景`}),(0,H.jsx)(`p`,{className:`mt-1 mb-5 text-sm text-muted`,children:`仅对使用封面氛围背景的模板生效(抖音视频/图文作品、B站视频信息、B站直播推荐动态)。`}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[a([`app`,`ambientCover`,`coverOpacity`],`封面氛围强度`,`封面图对背景氛围的贡献度,即模糊封面层的不透明度,越大封面色越浓。`,{fallback:.7}),a([`app`,`ambientCover`,`overlayEdgeOpacity`],`氛围压色(顶部/底部)`,`背景两端主题色压色罩的不透明度,越大两端越接近纯色主题背景。`,{fallback:.9}),a([`app`,`ambientCover`,`overlayMiddleOpacity`],`氛围压色(中间带)`,`背景中间带主题色压色罩的不透明度,越小封面色越透。`,{fallback:.2})]})]})})]})]}),c([`app`,`RenderWaitTime`],`渲染图片的等待时间`,`单位:秒,Linux系统下不能为0;其他系统传递 0 可禁用。`,{type:`number`,fallback:60,min:0}),s([`app`,`multiPageRender`],`分页渲染`,`将模板渲染成多页的图片,以降低渲染器压力,默认开启,非必要不修改!`),c([`app`,`multiPageHeight`],`分页渲染时,每页的高度`,`经测试最佳每页高度为12000px,默认12000px。`,{type:`number`,disabled:!Q(e,[`app`,`multiPageRender`],!0),fallback:12e3,min:1e3,max:2e4})]})),o(`更新推送设置`,(0,H.jsx)(H.Fragment,{children:n([`app`,`UpdateNotifyChannels`],`更新推送渠道`,`接收哪些渠道的版本更新推送;金丝雀构建经 pkg.pr.new 分发,不提供推送。`,[{label:`正式版`,value:`stable`},{label:`预览版`,value:`rc`},{label:`测试版`,value:`beta`}])})),o(`上传与下载设置`,(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(yC,{className:`flex flex-col gap-5 p-4 mb-4 rounded-3xl`,variant:`secondary`,children:[i([`app`,`videoSendMode`],`本地视频发送方式`,`选择本地视频交付给协议端的方式。`,[{label:`File 协议(本地文件)`,value:`file`,description:`使用 file 协议发送本地视频,需 Karin 与协议端在同一网络环境下`},{label:`Base64(编码传输)`,value:`base64`,description:`将本地视频转换为 base64 发送,传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本,适合 karin 和协议端不在同一网络环境`}],e=>e,Q(e,[`app`,`usegroupfile`],!1)),s([`app`,`usegroupfile`],`群文件上传`,`使用群文件上传,开启后会将视频文件上传到群文件中,需配置「群文件上传阈值」。与「本地视频发送方式 = Base64」互斥。`,Q(e,[`app`,`videoSendMode`],`file`)===`base64`),c([`app`,`groupfilevalue`],`群文件上传阈值`,`当文件大小超过该值时将使用群文件上传,单位:MB,「使用群文件上传」开启后才会生效。`,{type:`number`,fallback:100,min:1,disabled:!Q(e,[`app`,`usegroupfile`],!1)||Q(e,[`app`,`videoSendMode`],`file`)===`base64`})]}),(0,H.jsx)(yC,{className:`flex flex-col gap-5 p-4 mb-4 rounded-3xl`,variant:`secondary`,children:i([`app`,`imageSendMode`],`网络图片发送方式`,`图片资源发送给协议端的方式。`,[{label:`URL 链接(直接传递)`,value:`url`,description:`直接传递 HTTP 链接给上游下载,可能因上游网络问题导致下载超时`},{label:`File 协议(本地文件)`,value:`file`,description:`下载到本地后使用 file 协议发送,需 Karin 与协议端在同一网络环境下`},{label:`Base64(编码传输)`,value:`base64`,description:`下载后转换为 base64 发送,传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本`}])}),(0,H.jsxs)(yC,{className:`flex flex-col gap-5 p-4 mb-4 rounded-3xl`,variant:`secondary`,children:[s([`app`,`usefilelimit`],`视频上传拦截`,`开启后会根据视频文件大小判断是否需要上传,需配置「视频拦截阈值」。`),c([`app`,`filelimit`],`视频拦截阈值`,`视频文件大于该数值则直接结束任务,不会上传,单位: MB,「视频上传拦截」开启后才会生效。`,{type:`number`,fallback:20,min:1,disabled:!Q(e,[`app`,`usefilelimit`],!1)}),s([`app`,`compress`],`压缩视频`,`开启后会将视频文件压缩后再上传,适合上传大文件,任务过程中会吃满CPU,对低配服务器不友好。需配置「压缩触发阈值」与「压缩后的值」。`),c([`app`,`compresstrigger`],`压缩触发阈值`,`触发视频压缩的阈值,单位:MB。当文件大小超过该值时,才会压缩视频,「压缩视频」开启后才会生效。`,{type:`number`,fallback:80,min:1,disabled:!Q(e,[`app`,`compress`],!1)}),c([`app`,`compressvalue`],`压缩后的值`,`单位:MB,若视频文件大小大于「压缩触发阈值」的值,则会进行压缩至该值(±5%),「压缩视频」开启后才会生效。`,{type:`number`,fallback:30,min:1,disabled:!Q(e,[`app`,`compress`],!1)})]}),(0,H.jsxs)(yC,{className:`flex flex-col gap-5 p-4 rounded-3xl`,variant:`secondary`,children:[s([`app`,`downloadThrottle`],`下载限速`,`开启后会限制下载速度,避免触发服务器风控导致连接被重置(ECONNRESET)。如果下载时经常报错"连接被重置",建议开启。`),c([`app`,`downloadMaxSpeed`],`最大下载速度`,`限速开关打开后生效。单位:MB/s,建议值:10,根据实际情况调整。`,{type:`number`,fallback:10,min:1,max:100,disabled:!Q(e,[`app`,`downloadThrottle`],!1)}),s([`app`,`downloadAutoReduce`],`断流自动降速`,`限速开关打开后生效。当检测到下载中断时,自动降低下载速度,避免再次触发风控。`,!Q(e,[`app`,`downloadThrottle`],!1)),c([`app`,`downloadMinSpeed`],`最低下载速度`,`断流降速开关打开后生效。单位:MB/s,自动降速的下限值。`,{type:`number`,fallback:1,min:.5,max:50,disabled:!Q(e,[`app`,`downloadThrottle`],!1)||!Q(e,[`app`,`downloadAutoReduce`],!1)})]})]})),o(`Live Photo 兼容设置`,(0,H.jsxs)(H.Fragment,{children:[i([`app`,`livePhotoMode`],`Live Photo 处理和发送方式`,`解析遇到实况图时的处理和发送方式。注意:生成视频性能开销大,2C2G 服务器单张约需 20 秒。`,[{label:`视频 + 实况图`,value:`video_and_livephoto`,description:`生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)+ 对应系统的实况图`},{label:`仅视频`,value:`video_only`,description:`仅生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次)`},{label:`仅实况图`,value:`livephoto_only`,description:`仅生成并发送对应系统的实况图,性能开销小`}]),i([`app`,`livePhotoSystem`],`Live Photo 静态图兼容系统`,`当解析到作品/动态包含 Live Photo 时,合并转发里发送的 Live Photo 静态图按所选系统生成。推荐 OPPO,兼容性最广。`,[{label:`Google`,value:`google`,description:`Google Motion Photo 格式`},{label:`小米(HyperOS)`,value:`xiaomi`,description:`兼容小米(任何版本)和 Google,但无法被 OPPO 识别`},{label:`OPPO(ColorOS)`,value:`oppo`,description:`推荐,兼容 OPPO、小米(较新版本)和 Google`},{label:`华为/荣耀(HarmonyOS/MagicOS)`,value:`huawei_honor`,description:`理论可行但未实测(作者无对应设备)`},{label:`vivo(Origin OS)`,value:`vivo`,description:`需要独立的图片和同名视频文件,暂不支持`,disabled:!0},{label:`iPhone(iOS)`,value:`iphone`,description:`需要独立的图片和同名视频文件,暂不支持`,disabled:!0}],e=>e,l===`video_only`)]})),o(`我的小玩具`,(0,H.jsxs)(H.Fragment,{children:[s([`app`,`videoTool`],`默认解析优先级`,`关闭后使用自定义优先级,修改后需重启。`),c([`app`,`priority`],`自定义优先级`,`默认解析优先级关闭后生效。`,{type:`number`,disabled:Q(e,[`app`,`videoTool`],!0),fallback:800}),i([`app`,`qrLoginAddrType`],`扫码登录地址`,`生成登录二维码时使用的服务器地址。`,[{label:`局域网`,value:`lan`,description:`适用于手机和服务器在同一局域网`},{label:`外部地址`,value:`external`,description:`适用于远程访问,需手动配置`}]),c([`app`,`qrLoginExternalAddr`],`外部访问地址`,`公网 IP 或域名,如:123.45.67.89 或 example.com。`,{disabled:Q(e,[`app`,`qrLoginAddrType`],`lan`)!==`external`})]}))]})},tV=({config:e,renderers:t,classes:n})=>{let{renderCheckboxGroup:r,renderCronField:i,renderPageHeader:a,renderSelectField:o,renderSubSection:s,renderSwitch:c,renderTextField:l}=t,u=Q(e,[`bilibili`,`switch`],!1),d=Q(e,[`bilibili`,`sendContent`],[]),f=Q(e,[`bilibili`,`burnDanmaku`],!1),p=Q(e,[`bilibili`,`videoQuality`],0),m=Q(e,[`bilibili`,`videoInfoMode`],`text`),h=Q(e,[`bilibili`,`push`,`switch`],!1),g=Q(e,[`bilibili`,`push`,`parsedynamic`],!1),_=Q(e,[`bilibili`,`push`,`pushVideoQuality`],0),v=!u||!xB(d,`comment`),y=!u||!f;return(0,H.jsxs)(H.Fragment,{children:[a(`哔哩哔哩`,`B站解析、动态图片布局、弹幕和推送基础设置。`),(0,H.jsxs)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:[c([`bilibili`,`switch`],`解析开关`,`B站解析开关,此开关为单独开关。`),r([`bilibili`,`sendContent`],`解析时发送的内容`,`若什么都不选,可能不会返回任何解析结果。`,FB.filter(e=>e.value!==`image`),!u)]}),s(`评论详情设置`,(0,H.jsxs)(H.Fragment,{children:[l([`bilibili`,`numcomment`],`评论解析数量`,`主评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:v}),c([`bilibili`,`realCommentCount`],`显示真实评论数量`,`关闭则显示解析到的评论数量。`,v),c([`bilibili`,`commentImageCollection`],`是否收集评论区的图片`,`开启后将收集评论区的图片,以合并转发的形式返回。`,v)]})),s(`渲染与画质设置`,(0,H.jsxs)(H.Fragment,{children:[o([`bilibili`,`videoQuality`],`画质偏好`,`解析视频的分辨率偏好。`,RB,Number,!u),l([`bilibili`,`maxAutoVideoSize`],`视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!u||Number(p)!==0}),o([`bilibili`,`imageLayout`],`解析图文动态时,遇到多张图片时的页面布局方式(动态推送图片也生效)`,`自动布局:少于4张时逐张上下排列;4~8张时瀑布流;9张及以上九宫格。`,[{label:`自动布局`,value:`auto`},{label:`逐张上下排列`,value:`vertical`},{label:`瀑布流排列`,value:`waterfall`},{label:`九宫格排列`,value:`grid`}]),o([`bilibili`,`videoInfoMode`],`视频信息返回形式`,`视频信息返回文本或图片。`,[{label:`图片模式`,value:`image`},{label:`文本模式`,value:`text`}],e=>e,!u),r([`bilibili`,`displayContent`],`视频信息前返回的内容`,`若什么都不选,则不会返回任何视频相关信息。`,IB,!u||m===`image`),c([`bilibili`,`showDanmakuInVideoInfo`],`视频信息图片中显示弹幕`,`开启后在视频信息图片的封面区域显示热门弹幕。关闭后不会请求弹幕数据,可提升解析速度。仅「视频信息返回形式」为图片模式时生效。`,!u||m===`text`)]})),s(`权限设置`,(0,H.jsx)(H.Fragment,{children:o([`bilibili`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)})),s(`弹幕烧录相关`,(0,H.jsxs)(H.Fragment,{children:[c([`bilibili`,`burnDanmaku`],`弹幕烧录`,`将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长,高分辨率视频会占用较多资源。`,!u),o([`bilibili`,`danmakuArea`],`弹幕区域`,`限制弹幕的显示范围,避免遮挡视频主体内容。`,UB,Number,y),o([`bilibili`,`danmakuFontSize`],`弹幕字号`,`弹幕文字大小。`,WB,e=>e,y),l([`bilibili`,`danmakuOpacity`],`弹幕透明度`,`0为完全透明,100为完全不透明,推荐70。`,{type:`number`,fallback:70,min:0,max:100,disabled:y}),o([`bilibili`,`verticalMode`],`竖屏适配`,`模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕。`,HB,e=>e,y),o([`bilibili`,`videoCodec`],`视频编码格式`,`弹幕烧录时使用的视频编码格式,会自动检测硬件加速。`,VB,e=>e,y)]})),s(`B站推送相关`,(0,H.jsxs)(H.Fragment,{children:[c([`bilibili`,`push`,`switch`],`推送开关`,`推送开关,修改后需重启;使用「#设置B站推送 + UID」配置推送列表。`),o([`bilibili`,`push`,`permission`],`谁可以设置推送`,`修改后需重启。`,BB,e=>e,!h),i([`bilibili`,`push`,`cron`],`定时任务表达式`,`定时推送的时间,支持可视化编辑或手动输入 cron 表达式。`,!h),c([`bilibili`,`push`,`parsedynamic`],`作品解析`,`触发推送时是否一同解析该作品。`,!h),r([`bilibili`,`push`,`parseDynamicTypes`],`需要解析的动态类型`,`选择推送时需要进一步解析的动态类型;未选择的类型只发送动态卡片。`,zB,!h||!g),o([`bilibili`,`push`,`pushVideoQuality`],`解析视频动态时的画质偏好`,`「作品解析」开启时生效,仅对视频动态有效。`,RB.filter(e=>e.value!==`127`),Number,!h||!g),l([`bilibili`,`push`,`pushMaxAutoVideoSize`],`视频动态的视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「解析视频动态时的画质偏好」 为 "自动选择" 且「作品解析」开启时生效,仅对视频动态有效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!h||!g||Number(_)!==0})]}))]})},nV=({config:e,renderers:t,classes:n})=>{let{renderCheckboxGroup:r,renderCronField:i,renderPageHeader:a,renderSelectField:o,renderSubSection:s,renderSwitch:c,renderTextField:l}=t,u=Q(e,[`app`,`livePhotoMode`],`video_and_livephoto`),d=Q(e,[`douyin`,`switch`],!1),f=Q(e,[`douyin`,`sendContent`],[]),p=Q(e,[`douyin`,`burnDanmaku`],!1),m=Q(e,[`douyin`,`videoQuality`],`adapt`),h=Q(e,[`douyin`,`videoInfoMode`],`text`),g=Q(e,[`douyin`,`push`,`switch`],!1),_=Q(e,[`douyin`,`push`,`pushVideoQuality`],`adapt`),v=!d||!xB(f,`comment`),y=!d||!p;return(0,H.jsxs)(H.Fragment,{children:[a(`抖音`,`抖音解析、画质、弹幕和推送基础设置。`),(0,H.jsxs)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:[c([`douyin`,`switch`],`解析开关`,`抖音解析开关,此开关为单独开关。`),r([`douyin`,`sendContent`],`解析时发送的内容`,`若什么都不选,可能不会返回任何解析结果。`,FB.filter(e=>e.value!==`image`),!d)]}),s(`评论详情设置`,(0,H.jsxs)(H.Fragment,{children:[l([`douyin`,`numcomment`],`评论解析数量`,`主评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:v}),l([`douyin`,`subCommentLimit`],`子评论请求数量`,`单条主评论下请求的子评论总条数(含多层嵌套)。注意:UI中最多显示 6 层回复嵌套,超出部分会被隐藏;因实际嵌套深度不可预知,配置数量不代表最终可见数量。`,{type:`number`,fallback:5,min:1,max:20,disabled:v}),c([`douyin`,`commentImageCollection`],`是否收集评论区的图片`,`开启后将收集评论区的图片,以合并转发的形式返回。`,v)]})),s(`渲染与画质设置`,(0,H.jsxs)(H.Fragment,{children:[o([`douyin`,`liveImageMergeMode`],`合辑 Live 图 BGM 合并方式`,`合辑 Live 图 BGM 合并方式,仅 Live Photo 模式不是「仅实况图」时生效。`,[{label:`连续`,value:`continuous`,description:`BGM 接续播放,结束后自动循环`},{label:`独立`,value:`independent`,description:`每张图 BGM 从头开始`}],e=>e,!d||u===`livephoto_only`),o([`douyin`,`videoQuality`],`画质偏好`,`解析视频的分辨率偏好。`,LB,e=>e,!d),l([`douyin`,`maxAutoVideoSize`],`视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!d||m!==`adapt`}),o([`douyin`,`videoInfoMode`],`视频信息返回形式`,`视频信息返回文本或图片。`,[{label:`图片模式`,value:`image`},{label:`文本模式`,value:`text`}],e=>e,!d),r([`douyin`,`displayContent`],`视频信息的内容`,`若什么都不选,则不会返回任何视频相关信息。`,IB.filter(e=>e.value!==`desc`),!d||h===`image`)]})),s(`权限设置`,(0,H.jsx)(H.Fragment,{children:o([`douyin`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)})),s(`弹幕烧录相关`,(0,H.jsxs)(H.Fragment,{children:[c([`douyin`,`burnDanmaku`],`弹幕烧录`,`将弹幕硬编码到视频画面中。开启后视频需要重新编码,耗时较长。`,!d),o([`douyin`,`danmakuArea`],`弹幕显示区域`,`限制弹幕范围,避免遮挡视频主体。`,UB,Number,y),o([`douyin`,`danmakuFontSize`],`弹幕字号`,`弹幕文字大小。`,WB,e=>e,y),l([`douyin`,`danmakuOpacity`],`弹幕透明度`,`0为完全透明,100为完全不透明,推荐70。`,{type:`number`,fallback:70,min:0,max:100,disabled:y}),o([`douyin`,`verticalMode`],`竖屏适配`,`针对横屏视频,模拟手机端竖屏观看体验,视频居中显示,上下黑边区域用于展示弹幕。`,HB,e=>e,y),o([`douyin`,`videoCodec`],`视频编码格式`,`烧录弹幕后的视频编码格式。`,VB,e=>e,y)]})),s(`抖音推送相关`,(0,H.jsxs)(H.Fragment,{children:[c([`douyin`,`push`,`switch`],`推送开关`,`推送开关,修改后需重启;使用「#设置抖音推送 + 抖音号」配置推送列表。`),o([`douyin`,`push`,`permission`],`谁可以设置推送`,`修改后需重启。`,BB,e=>e,!g),i([`douyin`,`push`,`cron`],`定时任务表达式`,`定时推送的时间,支持可视化编辑或手动输入 cron 表达式。`,!g),c([`douyin`,`push`,`parsedynamic`],`作品解析`,`触发推送时是否一同解析该作品。`,!g),o([`douyin`,`push`,`shareType`],`推送图二维码的类型`,`推送图二维码识别后的跳转类型。`,[{label:`网页链接`,value:`web`,description:`识别后访问抖音官网对应的作品地址`},{label:`下载链接`,value:`download`,description:`识别后访问无水印作品下载地址`}],e=>e,!g),o([`douyin`,`push`,`pushVideoQuality`],`画质偏好`,`推送解析时解析视频的分辨率偏好。`,LB,e=>e,!g),l([`douyin`,`push`,`pushMaxAutoVideoSize`],`视频体积上限(MB)`,`推送解析时根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!g||_!==`adapt`})]}))]})},rV=({config:e,renderers:t,classes:n})=>{let{renderPageHeader:r,renderSelectField:i,renderSubSection:a,renderSwitch:o,renderTextField:s}=t,c=Q(e,[`kuaishou`,`switch`],!1),l=Q(e,[`kuaishou`,`comment`],!1);return(0,H.jsxs)(H.Fragment,{children:[r(`快手`,`快手解析基础设置。`),(0,H.jsx)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:o([`kuaishou`,`switch`],`解析开关`,`快手解析开关,此开关为单独开关。`)}),a(`评论详情设置`,(0,H.jsxs)(H.Fragment,{children:[o([`kuaishou`,`comment`],`评论解析`,`快手评论解析,开启后可发送快手作品评论图。`,!c),s([`kuaishou`,`numcomment`],`评论解析数量`,`快手评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:!c||!l})]})),a(`权限设置`,(0,H.jsx)(H.Fragment,{children:i([`kuaishou`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)}))]})},iV=({children:e,disabled:t,message:n,device:r})=>t?r===`mobile`?(0,H.jsxs)(ZS,{children:[(0,H.jsx)(ZS.Trigger,{className:`w-full cursor-not-allowed`,children:e}),(0,H.jsxs)(ZS.Content,{placement:`bottom`,children:[(0,H.jsx)(ZS.Arrow,{}),(0,H.jsx)(`div`,{className:`px-3 py-2`,children:(0,H.jsx)(`p`,{className:`text-sm text-foreground`,children:n})})]})]}):(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{className:`w-full cursor-not-allowed`,children:e}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),n]})]}):e,aV=e=>e===`desktop`?`grid grid-cols-2 gap-4`:`flex flex-col gap-4`,oV=[{label:`作品列表`,value:`post`,description:`推送用户发布的作品`},{label:`喜欢列表`,value:`favorite`,description:`推送用户喜欢的作品`},{label:`推荐列表`,value:`recommend`,description:`推送推荐的作品`},{label:`直播`,value:`live`,description:`推送直播状态`}],sV=[{label:`投稿视频`,value:`video`,description:`推送UP主投稿的视频`},{label:`图文动态`,value:`draw`,description:`推送图文动态`},{label:`纯文动态`,value:`word`,description:`推送纯文字动态`},{label:`直播动态`,value:`live`,description:`推送直播状态`},{label:`转发动态`,value:`forward`,description:`推送转发的动态`},{label:`投稿专栏`,value:`article`,description:`推送专栏文章`}],cV=[{label:`黑名单`,value:`blacklist`,description:`命中关键词/标签则不推送`},{label:`白名单`,value:`whitelist`,description:`只推送命中关键词/标签的内容`}],lV=({label:e,description:t,items:n,onAdd:r,onRemove:i,disabled:a=!1})=>{let[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),u=()=>{let e=o.trim();if(!e){l(`请输入内容`);return}if(n.includes(e)){l(`该项已存在,请勿重复添加`);return}r(e),s(``),l(``)};return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsxs)(MC,{className:`flex-1`,isDisabled:a,isInvalid:!!c,value:o,onChange:e=>{s(e),c&&l(``)},children:[(0,H.jsx)(IS,{children:e}),(0,H.jsx)(PS,{variant:`secondary`,placeholder:`输入${e}`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),u())}}),c?(0,H.jsx)(OS,{children:c}):null]}),(0,H.jsx)(ov,{isDisabled:a,variant:`secondary`,onPress:u,children:(0,H.jsx)(MP,{className:`size-4`})})]}),n.length>0?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>(0,H.jsxs)(Rv,{color:`accent`,variant:`soft`,children:[(0,H.jsx)(`span`,{children:e}),a?null:(0,H.jsx)(`button`,{type:`button`,className:`ml-1 rounded-full p-0.5 hover:bg-black/10`,onClick:()=>i(e),children:(0,H.jsx)(BP,{className:`size-3`})})]},e))}):(0,H.jsxs)(aS,{children:[`暂无`,e]}),(0,H.jsx)(aS,{children:t})]})},uV=(e,t)=>{if((e.success||e.code===200)&&e.data!==void 0)return e.data;throw Error(e.message||t)},dV=async()=>uV((await iz.get(`/kkk/v1/bots`)).data,`获取 Bot 列表失败`),fV=async e=>uV((await iz.get(`/kkk/v1/bots/${encodeURIComponent(e)}/groups`)).data,`获取群列表失败`),pV=async e=>e.length===0?[]:uV((await iz.post(`/kkk/v1/groups/batch`,{groups:e})).data,`获取推送目标信息失败`),mV=({label:e,description:t,placeholder:n,disabled:r=!1,items:i,selectedId:a,onSelect:o})=>{let{contains:s}=rh({sensitivity:`base`});return(0,H.jsxs)(n_,{fullWidth:!0,allowsEmptyCollection:!0,isDisabled:r,placeholder:n,selectionMode:`single`,value:a||null,variant:`secondary`,onChange:e=>o(String(e??``)),children:[(0,H.jsx)(IS,{children:e}),(0,H.jsxs)(n_.Trigger,{children:[(0,H.jsx)(n_.Value,{className:`min-w-0`,children:({defaultChildren:e,isPlaceholder:t,state:n})=>{if(t||n.selectedItems.length===0)return e;let r=i.find(e=>e.id===n.selectedItems[0]?.key);return r?(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{className:`size-4 shrink-0`,size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:r.name,src:r.avatar}),(0,H.jsx)(tv.Fallback,{children:r.name.slice(0,1)})]}),(0,H.jsx)(`span`,{className:`truncate`,children:r.name})]}):e}}),(0,H.jsx)(n_.ClearButton,{}),(0,H.jsx)(n_.Indicator,{})]}),(0,H.jsx)(aS,{children:t}),!r&&i.length===0?(0,H.jsx)(aS,{className:`text-warning`,children:`当前没有可选项`}):null,(0,H.jsx)(n_.Popover,{className:`max-h-72`,children:(0,H.jsxs)(n_.Filter,{filter:s,children:[(0,H.jsx)(iC,{autoFocus:!0,"aria-label":`搜索${e}`,variant:`secondary`,children:(0,H.jsxs)(iC.Group,{children:[(0,H.jsx)(iC.SearchIcon,{}),(0,H.jsx)(iC.Input,{placeholder:`搜索名称或 ID…`}),(0,H.jsx)(iC.ClearButton,{})]})}),(0,H.jsx)(US,{items:i,renderEmptyState:()=>(0,H.jsx)(ES,{children:`未找到结果`}),children:e=>(0,H.jsxs)(US.Item,{id:e.id,textValue:`${e.name} ${e.id} ${e.description}`,children:[(0,H.jsxs)(tv,{className:`shrink-0`,size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.name,src:e.avatar}),(0,H.jsx)(tv.Fallback,{children:e.name.slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(IS,{className:`max-w-full truncate`,children:e.name}),(0,H.jsx)(aS,{className:`truncate`,children:e.description})]}),(0,H.jsx)(US.ItemIndicator,{})]})})]})})]})},hV=e=>`${e.groupId}:${e.botId}`,gV=e=>{let[t,n,r]=e.split(`:`);return!t||!n||r!==void 0?null:{groupId:t,botId:n}},_V=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=gV(e);if(!r)return;let i=hV(r);t.has(i)||(t.add(i),n.push(i))}),n},vV=(e,t)=>{let n=gV(e);return n?hV({groupId:n.groupId,botId:t}):e},yV=e=>{let t=new Map;for(let n of e)for(let e of n){let n=gV(e);n&&t.set(n.botId,(t.get(n.botId)??0)+1)}return Array.from(t,([e,t])=>({botId:e,count:t})).sort((e,t)=>t.count-e.count)},bV=({name:e,avatar:t})=>(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e,src:t}),(0,H.jsx)(tv.Fallback,{children:e.slice(0,1)})]}),xV=({isOpen:e,onOpenChange:t,device:n,platformLabel:r,items:i,onApply:a,title:o=`推送 Bot 快捷切换`,description:s=r?`把「${r}」的推送目标从当前 Bot 批量切换到目标 Bot。`:`把推送目标从当前 Bot 切换到目标 Bot。`,appliedHint:c=`保存配置后生效`})=>{let[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)(new Map),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(!0),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)([]),[E,D]=(0,v.useState)(null),O=n===`desktop`?`right`:`bottom`,k=n===`mobile`?`sm`:`md`;(0,v.useEffect)(()=>{if(!e)return;m(``),g(``),C(!1),T([]),D(null),u([]),f(new Map),x(``),y(!0);let t=!1,n=new Set,r=[];return i.forEach(e=>e.values.forEach(e=>{let t=gV(e);if(!t)return;let i=hV(t);n.has(i)||(n.add(i),r.push(t))})),Promise.all([dV(),pV(r).catch(()=>[])]).then(([e,n])=>{t||(u(e),f(new Map(n.map(e=>[hV(e),e]))))}).catch(e=>{t||x(e instanceof Error?e.message:`获取 Bot 列表失败`)}).finally(()=>{t||y(!1)}),()=>{t=!0}},[e]);let A=i.some(e=>e.values.length>0),j=(0,v.useMemo)(()=>yV(i.map(e=>e.values)).map(e=>{let t=l.find(t=>t.id===e.botId);return{id:e.botId,name:t?.name||e.botId,avatar:t?.avatar||``,description:`${e.count} 条推送目标 · ${t?`在线`:`离线/未注册`}`}}),[l,i]),M=(0,v.useMemo)(()=>l.filter(e=>e.id!==p).map(e=>({id:e.id,name:e.name,avatar:e.avatar,description:e.id})),[l,p]),N=(0,v.useMemo)(()=>{if(!p||!h)return[];let e=[];return i.forEach(t=>{let n=t.values.filter(e=>gV(e)?.botId===p).map(e=>({oldValue:e,newValue:vV(e,h)}));n.length>0&&e.push({item:t,entries:n})}),e},[i,p,h]),P=N.reduce((e,t)=>e+t.entries.length,0),F=S?w:N,I=()=>{if(!p||!h||N.length===0)return;let e=l.find(e=>e.id===p),t=l.find(e=>e.id===h);a(i.map(e=>e.values.map(e=>gV(e)?.botId===p?vV(e,h):e))),T(N),D({objects:N.length,entries:P,fromName:e?.name||p,toName:t?.name||h}),C(!0),WC.success(`已切换 ${N.length} 个推送对象的 ${P} 条推送目标,${c}`)},ee=e=>{let t=gV(e.oldValue);if(!t)return null;let n=d.get(e.oldValue),r=l.find(e=>e.id===h),i=n?.botName||p,a=r?.name||h;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-default-200 bg-default-50/50 p-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:n?.groupName||t.groupId,src:n?.groupAvatar}),(0,H.jsx)(tv.Fallback,{children:(n?.groupName||t.groupId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:n?.groupName||t.groupId}),(0,H.jsx)(aS,{className:`block truncate`,children:t.groupId})]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pl-8`,children:[(0,H.jsx)(bV,{name:i,avatar:n?.botAvatar}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted`,children:i}),(0,H.jsx)(`span`,{className:`shrink-0 text-xs text-muted`,children:`→`}),(0,H.jsx)(bV,{name:a,avatar:r?.avatar}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-xs`,children:a})]})]},e.oldValue)};return(0,H.jsx)(wS.Backdrop,{isOpen:e,onOpenChange:t,variant:`blur`,children:(0,H.jsx)(wS.Content,{placement:O,children:(0,H.jsxs)(wS.Dialog,{className:n===`desktop`?`h-full w-130 max-w-[90vw]`:`max-h-[84dvh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsxs)(wS.Header,{children:[(0,H.jsx)(wS.Heading,{children:o}),(0,H.jsx)(aS,{children:s})]}),(0,H.jsxs)(wS.Body,{className:`flex min-h-0 flex-col gap-3`,children:[S&&E?(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-success/30 bg-success/10 p-3 text-sm`,children:[(0,H.jsx)(gP,{className:`size-4 shrink-0 text-success`}),(0,H.jsxs)(`span`,{children:[`已将 `,E.objects,` 个推送对象的 `,E.entries,` 条推送目标从「`,E.fromName,`」切换到「`,E.toName,`」,`,c,`。`]})]}):null,_?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取 Bot 信息`}),(0,H.jsx)(`span`,{children:`正在读取 Bot 信息`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(mV,{description:`列出推送目标中实际出现的 Bot,含离线 Bot。`,disabled:S,items:j,label:`当前 Bot`,placeholder:`选择要替换掉的 Bot`,selectedId:p,onSelect:e=>{g(``),m(e)}}),(0,H.jsx)(mV,{description:p?`Karin 当前在线的 Bot。`:`请先选择当前 Bot。`,disabled:S||!p,items:M,label:`目标 Bot`,placeholder:`选择切换后的 Bot`,selectedId:h,onSelect:g}),!p&&M.length===0&&l.length>0?(0,H.jsx)(aS,{className:`text-warning`,children:`当前没有其他在线 Bot 可作为切换目标。`}):null]}),b?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-danger/30 bg-danger/10 p-3 text-sm text-danger`,children:[(0,H.jsx)(HP,{className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{children:b})]}):null,A?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(IS,{children:S?`已更改的推送对象`:`将被更改的推送对象`}),(0,H.jsx)(aS,{children:S&&E?`${E.objects} 个推送对象 / ${E.entries} 条推送目标`:p&&h?N.length>0?`${N.length} 个推送对象 / ${P} 条推送目标`:`没有匹配「当前 Bot」的推送目标。`:`选择当前 Bot 与目标 Bot 后,这里会预览受影响的推送对象。`})]}),F.length>0?(0,H.jsx)(`div`,{className:n===`mobile`?`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pb-2`:`flex max-h-96 flex-col gap-4 overflow-y-auto`,children:F.map(({item:e,entries:t},r)=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(tv,{size:`sm`,children:(0,H.jsx)(tv.Fallback,{children:e.label.slice(0,1)})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.label}),e.description?(0,H.jsx)(aS,{className:`block truncate`,children:e.description}):null]}),(0,H.jsxs)(Rv,{color:`accent`,variant:`soft`,children:[t.length,` 条`]})]}),(0,H.jsx)(`div`,{className:n===`mobile`?`flex flex-col gap-2`:`flex flex-col gap-2 pl-8`,children:t.map(ee)})]},r))}):null]}):(0,H.jsx)(`div`,{className:`rounded-lg border border-dashed border-default-300 px-4 py-5 text-sm text-muted`,children:r?`「${r}」还没有配置推送目标。`:`还没有配置推送目标。`})]}),(0,H.jsxs)(wS.Footer,{children:[(0,H.jsx)(ov,{size:k,slot:`close`,variant:`secondary`,children:`取消`}),S?(0,H.jsx)(ov,{size:k,slot:`close`,children:`完成`}):(0,H.jsx)(ov,{size:k,isDisabled:!p||!h||N.length===0,onPress:I,children:`应用更改`})]})]})})})},SV=({mapping:e,compact:t=!1,stacked:n=!1})=>n?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.groupName||e.groupId,src:e.groupAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.groupName||e.groupId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.groupName||e.groupId}),(0,H.jsx)(aS,{className:`block truncate`,children:e.groupId})]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 pl-8`,children:[(0,H.jsx)(fP,{className:`size-4 shrink-0 text-muted`}),(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.botName||e.botId,src:e.botAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.botName||e.botId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.botName||e.botId}),(0,H.jsx)(aS,{className:`block truncate`,children:t?e.botId:`Bot ${e.botId}`})]})]})]}):(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.groupName||e.groupId,src:e.groupAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.groupName||e.groupId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.groupName||e.groupId}),(0,H.jsx)(aS,{className:`block truncate`,children:e.groupId})]}),(0,H.jsx)(fP,{className:`size-4 shrink-0 text-muted`}),(0,H.jsxs)(tv,{size:`sm`,children:[(0,H.jsx)(tv.Image,{alt:e.botName||e.botId,src:e.botAvatar}),(0,H.jsx)(tv.Fallback,{children:(e.botName||e.botId).slice(0,1)})]}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(IS,{className:`block truncate`,children:e.botName||e.botId}),(0,H.jsx)(aS,{className:`block truncate`,children:t?e.botId:`Bot ${e.botId}`})]})]}),CV=({device:e,mappings:t,onEdit:n,onRemove:r})=>(0,H.jsxs)(`div`,{className:e===`mobile`?`flex min-h-0 min-w-0 flex-1 flex-col gap-4`:`flex min-w-0 flex-col gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(IS,{children:`已配置目标`}),(0,H.jsxs)(aS,{children:[t.length,` 个推送目标`]})]}),t.length>0?(0,H.jsx)(`div`,{className:e===`mobile`?`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto pb-2`:`flex max-h-72 flex-col gap-2 overflow-y-auto`,children:t.map(t=>{let i=hV(t);return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 rounded-lg border border-default-200 bg-default-50/50 p-2.5`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(SV,{compact:!0,mapping:t,stacked:e===`mobile`})}),(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":`编辑推送目标`,size:`sm`,variant:`tertiary`,onPress:()=>n(i),children:(0,H.jsx)(AP,{className:`size-4`})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),`编辑`]})]}),(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":`删除推送目标`,size:`sm`,variant:`danger`,onPress:()=>r(i),children:(0,H.jsx)(BP,{className:`size-4`})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`top`,children:[(0,H.jsx)(uw.Arrow,{}),`删除`]})]})]},i)})}):(0,H.jsx)(`div`,{className:`rounded-lg border border-dashed border-default-300 px-4 py-5 text-sm text-muted`,children:`还没有推送目标,点击上方按钮添加。`})]}),wV=({isOpen:e,device:t,initialMapping:n,onOpenChange:r,onConfirm:i})=>{let[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(n?.botId||``),[d,f]=(0,v.useState)(n?.groupId||``),[p,m]=(0,v.useState)(!0),[h,g]=(0,v.useState)(!!n?.botId),[_,y]=(0,v.useState)(``);(0,v.useEffect)(()=>{e&&(u(n?.botId||``),f(n?.groupId||``),c([]),o([]),m(!0),g(!!n?.botId),y(``))},[e,n?.botId,n?.groupId]);let b=(0,v.useMemo)(()=>a.find(e=>e.id===l),[a,l]),x=(0,v.useMemo)(()=>s.find(e=>e.id===d),[s,d]),S=(0,v.useMemo)(()=>a.map(e=>({id:e.id,name:e.name,avatar:e.avatar,description:e.id})),[a]),C=(0,v.useMemo)(()=>s.map(e=>({id:e.id,name:e.name,avatar:e.avatar,description:e.id})),[s]),w=!!(l&&d);(0,v.useEffect)(()=>{e&&dV().then(o).catch(e=>{y(e instanceof Error?e.message:`获取 Bot 列表失败`)}).finally(()=>m(!1))},[e]),(0,v.useEffect)(()=>{e&&l&&fV(l).then(e=>{c(e),f(t=>e.some(e=>e.id===t)?t:``)}).catch(e=>{y(e instanceof Error?e.message:`获取群列表失败`)}).finally(()=>g(!1))},[e,l]);let T=()=>{if(!w||!b||!x)return;let e={groupId:x.id,botId:b.id};x.name&&(e.groupName=x.name),x.avatar&&(e.groupAvatar=x.avatar),b.name&&(e.botName=b.name),b.avatar&&(e.botAvatar=b.avatar),b.isOnline!==void 0&&(e.isOnline=b.isOnline),i(e)},E=t===`desktop`?`right`:`bottom`,D=n?`编辑推送目标`:`添加推送目标`;return(0,H.jsx)(wS.Backdrop,{isOpen:e,onOpenChange:r,children:(0,H.jsx)(wS.Content,{placement:E,children:(0,H.jsxs)(wS.Dialog,{className:t===`desktop`?`h-full w-105 max-w-[90vw]`:`max-h-[78dvh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsxs)(wS.Header,{children:[(0,H.jsx)(wS.Heading,{children:D}),(0,H.jsx)(aS,{children:`先选择 Bot,再选择该 Bot 加入的群。`})]}),(0,H.jsxs)(wS.Body,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(mV,{description:`Karin 当前已注册且在线的 Bot。`,disabled:p,items:S,label:`机器人账号`,placeholder:`选择机器人账号`,selectedId:l,onSelect:e=>{y(``),c([]),g(!!e),u(e),f(``)}}),(0,H.jsx)(mV,{description:l?`当前 Bot 已加入的群。`:`请先选择机器人账号。`,disabled:!l||h,items:C,label:`推送群`,placeholder:`选择推送群`,selectedId:d,onSelect:f}),p||h?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取列表`}),(0,H.jsx)(`span`,{children:`正在读取列表`})]}):null,b&&x?(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-default-200 bg-default-50/60 p-3`,children:[(0,H.jsx)(IS,{children:`将写入`}),(0,H.jsxs)(aS,{className:`mt-1`,children:[x.name,`(`,x.id,`) -> `,b.name,`(`,b.id,`)`]})]}):null,_?(0,H.jsx)(aS,{className:`text-danger`,children:_}):null]}),(0,H.jsxs)(wS.Footer,{children:[(0,H.jsx)(ov,{size:t===`mobile`?`sm`:`md`,slot:`close`,variant:`secondary`,children:`取消`}),(0,H.jsx)(ov,{size:t===`mobile`?`sm`:`md`,slot:`close`,isDisabled:!w,onPress:T,children:n?`保存`:`添加`})]})]})})})},TV=(e,t,n)=>{let r=_V(e);return{values:r,mappings:r.map(e=>{let r=gV(e),i=n[e]||t.find(t=>hV(t)===e);if(!r)return null;let a={groupId:r.groupId,botId:r.botId};return i?.groupName&&(a.groupName=i.groupName),i?.groupAvatar&&(a.groupAvatar=i.groupAvatar),i?.botName&&(a.botName=i.botName),i?.botAvatar&&(a.botAvatar=i.botAvatar),i?.isOnline!==void 0&&(a.isOnline=i.isOnline),a}).filter(e=>!!e)}},EV=({isOpen:e,values:t,mappings:n,device:r,itemLabel:i,onOpenChange:a,onApply:o})=>{let[s,c]=(0,v.useState)(()=>_V(t)),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)([]),b=(0,v.useMemo)(()=>TV(s,n,l),[s,l,n]),x=r===`desktop`?`right`:`bottom`,S=r===`mobile`?`sm`:`md`,C=d?gV(d):null;(0,v.useEffect)(()=>{e&&dV().then(y).catch(()=>y([]))},[e]),(0,v.useEffect)(()=>{e||(c(_V(t)),u({}))},[e,t]);let w=e=>{f(e),m(!0)};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(wS.Backdrop,{isOpen:e,onOpenChange:e=>{e||o(b.values),a(e)},variant:`blur`,children:(0,H.jsx)(wS.Content,{placement:x,children:(0,H.jsxs)(wS.Dialog,{className:r===`desktop`?`h-full w-130 max-w-[90vw]`:`max-h-[84dvh]`,children:[(0,H.jsx)(wS.Handle,{}),(0,H.jsx)(wS.CloseTrigger,{}),(0,H.jsxs)(wS.Header,{children:[(0,H.jsx)(wS.Heading,{children:`推送目标`}),(0,H.jsx)(aS,{children:`管理所有接收推送的群和 Bot 映射。`})]}),(0,H.jsxs)(wS.Body,{className:`flex min-h-0 flex-col gap-3`,children:[(0,H.jsx)(`div`,{className:`rounded-lg border border-default-200 bg-default-50/50 p-3`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(IS,{children:`快捷切换 Bot`}),(0,H.jsx)(aS,{children:`把本推送对象的推送目标从当前 Bot 切换到目标 Bot,先应用到下方草稿。`})]}),(0,H.jsxs)(ov,{className:`self-start`,size:S,variant:`secondary`,isDisabled:s.length===0,onPress:()=>g(!0),children:[(0,H.jsx)(uP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`切换 Bot`})]})]})}),(0,H.jsxs)(ov,{className:`self-start`,size:S,onPress:()=>w(null),children:[(0,H.jsx)(MP,{className:`size-4`}),`添加推送目标`]}),(0,H.jsx)(CV,{device:r,mappings:b.mappings,onEdit:e=>w(e),onRemove:e=>{c(t=>t.filter(t=>t!==e)),u(t=>{let n={...t};return delete n[e],n})}})]}),(0,H.jsxs)(wS.Footer,{children:[(0,H.jsx)(ov,{size:S,slot:`close`,variant:`secondary`,children:`取消`}),(0,H.jsx)(ov,{size:S,slot:`close`,onPress:()=>{o(b.values)},children:`完成`})]})]})})}),(0,H.jsx)(wV,{device:r,initialMapping:C,isOpen:p,onConfirm:e=>{let t=hV(e),n=[...s],r=d?n.indexOf(d):-1;r>=0?n[r]=t:n.unshift(t),c(_V(n)),u(n=>{let r={...n,[t]:e};return d&&d!==t&&delete r[d],r}),m(!1),f(null)},onOpenChange:m},d||`new`),(0,H.jsx)(xV,{device:r,isOpen:h,items:[{label:i||`本推送对象`,description:``,values:s}],title:`快捷切换 Bot`,description:`把本推送对象的推送目标从当前 Bot 切换到目标 Bot,先应用到抽屉草稿。`,appliedHint:`完成抽屉并保存配置后生效`,onApply:e=>{let t=_V(e[0]??s),r={};t.forEach(e=>{if(s.includes(e))return;let t=gV(e);if(!t)return;let i=s.find(e=>gV(e)?.groupId===t.groupId),a=i?l[i]||n.find(e=>hV(e)===i):void 0,o=_.find(e=>e.id===t.botId),c={groupId:t.groupId,botId:t.botId};a?.groupName&&(c.groupName=a.groupName),a?.groupAvatar&&(c.groupAvatar=a.groupAvatar),o?.name&&(c.botName=o.name),o?.avatar&&(c.botAvatar=o.avatar),o&&(c.isOnline=o.isOnline),r[e]=c}),c(t),u(e=>{let n={...e,...r};return s.forEach(e=>{t.includes(e)||delete n[e]}),n})},onOpenChange:g})]})},DV=(e,t)=>{let n=gV(e);if(!n)return null;let r={groupId:n.groupId,botId:n.botId};return t?.groupName&&(r.groupName=t.groupName),t?.groupAvatar&&(r.groupAvatar=t.groupAvatar),t?.botName&&(r.botName=t.botName),t?.botAvatar&&(r.botAvatar=t.botAvatar),t?.isOnline!==void 0&&(r.isOnline=t.isOnline),r},OV=({value:e,disabled:t,itemLabel:n,device:r,onChange:i})=>{let a=(0,v.useMemo)(()=>_V(e),[e]),o=(0,v.useMemo)(()=>e.filter(e=>!gV(e)),[e]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),p=(0,v.useMemo)(()=>a.map(e=>{let t=gV(e);return DV(e,t?s.find(e=>e.groupId===t.groupId&&e.botId===t.botId):void 0)}).filter(e=>!!e),[s,a]);(0,v.useEffect)(()=>{pV(a.map(gV).filter(e=>!!e)).then(c).catch(()=>c([])).finally(()=>u(!1))},[a]);let m=e=>i(_V(e)),h=`开启【${n}】的推送开关后才能编辑此字段`,g=a.length>0?`已配置 ${a.length} 个推送目标`:`还没有配置推送目标`;return(0,H.jsx)(iV,{disabled:t,device:r,message:h,children:(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-default-200 bg-default-50/50 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,H.jsx)(IS,{children:`推送目标`}),(0,H.jsx)(aS,{className:`mt-1`,children:g})]}),(0,H.jsxs)(ov,{isDisabled:t,size:r===`mobile`?`sm`:`md`,variant:r===`mobile`?`primary`:`secondary`,onPress:()=>f(!0),children:[(0,H.jsx)(AP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`管理`})]})]}),l?(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取推送目标`}),(0,H.jsx)(`span`,{children:`正在读取推送目标`})]}):null,o.length>0?(0,H.jsxs)(`div`,{className:`rounded-lg border border-warning/30 bg-warning/10 p-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-warning`,children:[(0,H.jsx)(HP,{className:`size-4`}),(0,H.jsxs)(`span`,{children:[`发现 `,o.length,` 条旧格式或错误格式`]})]}),(0,H.jsx)(aS,{className:`mt-1`,children:`建议删除后用可视化选择重新添加,避免后端解析异常。`})]}):null,(0,H.jsx)(EV,{device:r,isOpen:d,itemLabel:n,mappings:p,values:a,onApply:m,onOpenChange:f})]})})},kV=({disabled:e,itemLabel:t,device:n,value:r,onChange:i})=>(0,H.jsx)(OV,{disabled:e,device:n,itemLabel:t,value:r,onChange:i}),AV=({disabled:e,itemLabel:t,device:n,options:r,value:i,onChange:a})=>(0,H.jsx)(iV,{disabled:e,device:n,message:`开启【${t}】的推送开关后才能编辑此字段`,children:(0,H.jsxs)(Dv,{"aria-label":`推送类型`,isDisabled:e,value:i,onChange:e=>a(e),children:[(0,H.jsx)(IS,{children:`推送类型`}),(0,H.jsx)(aS,{children:`选择要推送的内容类型`}),(0,H.jsx)(`div`,{className:`mt-2 ${aV(n)}`,children:r.map(e=>(0,H.jsxs)(Pv,{value:e.value,variant:`secondary`,children:[(0,H.jsxs)(Pv.Content,{children:[(0,H.jsx)(Pv.Control,{children:(0,H.jsx)(Pv.Indicator,{})}),e.label]}),(0,H.jsx)(aS,{children:e.description})]},e.value))})]})}),jV=({disabled:e,itemLabel:t,device:n,value:r,onChange:i})=>(0,H.jsx)(iV,{disabled:e,device:n,message:`开启【${t}】的推送开关后才能编辑此字段`,children:(0,H.jsxs)(uC,{fullWidth:!0,isDisabled:e,value:r,onChange:e=>{e&&!Array.isArray(e)&&i(e)},children:[(0,H.jsx)(IS,{children:`过滤模式`}),(0,H.jsxs)(uC.Trigger,{children:[(0,H.jsx)(uC.Value,{}),(0,H.jsx)(uC.Indicator,{})]}),(0,H.jsx)(aS,{children:`设置关键词/标签的过滤方式`}),(0,H.jsx)(uC.Popover,{children:(0,H.jsx)(US,{children:cV.map(e=>(0,H.jsxs)(US.Item,{id:e.value,textValue:e.label,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(IS,{children:e.label}),(0,H.jsx)(aS,{children:e.description})]}),(0,H.jsx)(US.ItemIndicator,{})]},e.value))})})]})}),MV=({disabled:e,itemLabel:t,device:n,keywords:r,tags:i,onKeywordsChange:a,onTagsChange:o})=>{let s=`开启【${t}】的推送开关后才能编辑此字段`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(iV,{disabled:e,device:n,message:s,children:(0,H.jsx)(`div`,{children:(0,H.jsx)(lV,{label:`关键词`,description:`多个关键词用于内容过滤`,disabled:e,items:r,onAdd:e=>a([...r,e]),onRemove:e=>a(r.filter(t=>t!==e))})})}),(0,H.jsx)(iV,{disabled:e,device:n,message:s,children:(0,H.jsx)(`div`,{children:(0,H.jsx)(lV,{label:`标签`,description:`多个标签用于内容过滤`,disabled:e,items:i,onAdd:e=>o([...i,e]),onRemove:e=>o(i.filter(t=>t!==e))})})})]})},NV=({onDelete:e})=>(0,H.jsxs)(ov,{className:`w-full`,variant:`danger`,onPress:e,children:[(0,H.jsx)(BP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`删除此推送项`})]}),PV=({item:e,index:t,list:n,onChange:r,device:i})=>{let a=i=>{let a=[...n];a[t]={...e,...i},r(a)},o=!e.switch,s=e.remark||`UID: ${e.host_mid}`||`未命名`,c=`开启【${s}】的推送开关后才能编辑此字段`;return(0,H.jsxs)(qc.Item,{id:`bilibili-${t}`,children:[(0,H.jsx)(qc.Heading,{children:(0,H.jsxs)(qc.Trigger,{children:[(0,H.jsxs)(`div`,{className:`flex flex-1 items-center gap-3`,children:[(0,H.jsx)(`div`,{onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,H.jsx)(DC,{"aria-label":`推送开关`,isSelected:e.switch,onChange:e=>a({switch:e}),children:(0,H.jsx)(DC.Content,{children:(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})})})})}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.remark||`UID: ${e.host_mid}`||`推送项 ${t+1}`}),(0,H.jsxs)(aS,{className:`text-xs`,children:[`B站 UID: `,e.host_mid]})]})]}),(0,H.jsx)(qc.Indicator,{children:(0,H.jsx)(mP,{className:`size-5`})})]})}),(0,H.jsx)(qc.Panel,{children:(0,H.jsx)(qc.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:aV(i),children:[(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,isRequired:!0,type:`number`,value:String(e.host_mid),onChange:e=>a({host_mid:Number(e)||0}),children:[(0,H.jsx)(IS,{children:`B站 UID`}),(0,H.jsx)(PS,{placeholder:`UP主的 UID`}),(0,H.jsx)(aS,{children:`B站用户的唯一标识,必填`})]})}),(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,value:e.remark,onChange:e=>a({remark:e}),children:[(0,H.jsx)(IS,{children:`备注名称`}),(0,H.jsx)(PS,{placeholder:`可选,用于识别该推送项`}),(0,H.jsx)(aS,{children:`方便识别的名称,如:UP主昵称`})]})})]}),(0,H.jsx)(kV,{disabled:o,device:i,itemLabel:s,value:e.group_id,onChange:e=>a({group_id:e})}),(0,H.jsx)(AV,{disabled:o,device:i,itemLabel:s,options:sV,value:e.pushTypes||[],onChange:e=>a({pushTypes:e})}),(0,H.jsx)(jV,{disabled:o,device:i,itemLabel:s,value:e.filterMode||`blacklist`,onChange:e=>a({filterMode:e})}),(0,H.jsx)(MV,{disabled:o,device:i,itemLabel:s,keywords:e.Keywords||[],tags:e.Tags||[],onKeywordsChange:e=>a({Keywords:e}),onTagsChange:e=>a({Tags:e})}),(0,H.jsx)(NV,{onDelete:()=>r(n.filter((e,n)=>n!==t))})]})})})]},t)},FV=({item:e,index:t,list:n,onChange:r,device:i})=>{let a=i=>{let a=[...n];a[t]={...e,...i},r(a)},o=!e.switch,s=e.remark||e.short_id||e.sec_uid||`未命名`,c=`开启【${s}】的推送开关后才能编辑此字段`;return(0,H.jsxs)(qc.Item,{id:`douyin-${t}`,children:[(0,H.jsx)(qc.Heading,{children:(0,H.jsxs)(qc.Trigger,{children:[(0,H.jsxs)(`div`,{className:`flex flex-1 items-center gap-3`,children:[(0,H.jsx)(`div`,{onClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,H.jsx)(DC,{"aria-label":`推送开关`,isSelected:e.switch,onChange:e=>a({switch:e}),children:(0,H.jsx)(DC.Content,{children:(0,H.jsx)(DC.Control,{children:(0,H.jsx)(DC.Thumb,{})})})})}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.remark||e.short_id||e.sec_uid||`推送项 ${t+1}`}),(0,H.jsxs)(aS,{className:`text-xs`,children:[e.short_id&&`抖音号: ${e.short_id}`,e.sec_uid&&!e.short_id&&`sec_uid: ${e.sec_uid.slice(0,20)}...`]})]})]}),(0,H.jsx)(qc.Indicator,{children:(0,H.jsx)(mP,{className:`size-5`})})]})}),(0,H.jsx)(qc.Panel,{children:(0,H.jsx)(qc.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:aV(i),children:[(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,isRequired:!0,value:e.short_id,onChange:e=>a({short_id:e}),children:[(0,H.jsx)(IS,{children:`抖音号`}),(0,H.jsx)(PS,{placeholder:`用户的抖音号`,variant:`secondary`}),(0,H.jsx)(aS,{children:`用户的抖音号(short_id),必填`})]})}),(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,value:e.sec_uid,onChange:e=>a({sec_uid:e}),children:[(0,H.jsx)(IS,{children:`sec_uid`}),(0,H.jsx)(PS,{placeholder:`选填,会根据抖音号自动获取`,variant:`secondary`}),(0,H.jsx)(aS,{children:`用户的 sec_uid,可从分享链接获取。选填,推送时会自动获取`})]})})]}),(0,H.jsx)(iV,{disabled:o,device:i,message:c,children:(0,H.jsxs)(MC,{fullWidth:!0,isDisabled:o,value:e.remark,onChange:e=>a({remark:e}),children:[(0,H.jsx)(IS,{children:`备注名称`}),(0,H.jsx)(PS,{placeholder:`可选,用于识别该推送项`,variant:`secondary`}),(0,H.jsx)(aS,{children:`方便识别的名称,如:博主昵称`})]})}),(0,H.jsx)(kV,{disabled:o,device:i,itemLabel:s,value:e.group_id,onChange:e=>a({group_id:e})}),(0,H.jsx)(AV,{disabled:o,device:i,itemLabel:s,options:oV,value:e.pushTypes||[],onChange:e=>a({pushTypes:e})}),(0,H.jsx)(jV,{disabled:o,device:i,itemLabel:s,value:e.filterMode||`blacklist`,onChange:e=>a({filterMode:e})}),(0,H.jsx)(MV,{disabled:o,device:i,itemLabel:s,keywords:e.Keywords||[],tags:e.Tags||[],onKeywordsChange:e=>a({Keywords:e}),onTagsChange:e=>a({Tags:e})}),(0,H.jsx)(NV,{onDelete:()=>r(n.filter((e,n)=>n!==t))})]})})})]},t)},IV=({device:e,platformLabel:t,items:n,onApply:r})=>{let[i,a]=(0,v.useState)(!1),o=n.reduce((e,t)=>e+t.values.filter(e=>gV(e)).length,0),s=new Set;n.forEach(e=>e.values.forEach(e=>{let t=gV(e);t&&s.add(t.botId)}));let c=o===0?`「${t}」还没有配置推送目标`:`共 ${o} 条推送目标,涉及 ${s.size} 个 Bot`;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-default-200 bg-default-50/50 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,H.jsx)(IS,{children:`推送 Bot 快捷切换`}),(0,H.jsx)(aS,{className:`mt-1`,children:c})]}),(0,H.jsxs)(ov,{isDisabled:o===0,size:e===`mobile`?`sm`:`md`,variant:`secondary`,onPress:()=>a(!0),children:[(0,H.jsx)(uP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`切换 Bot`})]})]}),(0,H.jsx)(xV,{device:e,isOpen:i,items:n,platformLabel:t,onApply:r,onOpenChange:a})]})},LV=()=>({switch:!0,sec_uid:``,short_id:``,group_id:[],remark:``,pushTypes:[`post`],filterMode:`blacklist`,Keywords:[],Tags:[]}),RV=()=>({switch:!0,host_mid:0,group_id:[],remark:``,pushTypes:[`video`],filterMode:`blacklist`,Keywords:[],Tags:[]}),zV=({platform:e})=>(0,H.jsx)(`div`,{className:`rounded-lg border-2 border-dashed border-gray-300 p-8 text-center`,children:(0,H.jsxs)(`p`,{className:`text-muted`,children:[`暂无`,e===`douyin`?`抖音`:`B站`,`推送项,点击上方按钮添加`]})});function BV({douyinList:e,bilibiliList:t,onDouyinChange:n,onBilibiliChange:r,device:i}){let[a,o]=(0,v.useState)(`douyin`);return(0,H.jsx)(`div`,{className:`space-y-4`,children:(0,H.jsxs)(jC,{selectedKey:a,onSelectionChange:e=>o(e),children:[(0,H.jsx)(jC.ListContainer,{children:(0,H.jsxs)(jC.List,{children:[(0,H.jsxs)(jC.Tab,{id:`douyin`,children:[(0,H.jsx)(`span`,{children:`抖音推送`}),(0,H.jsx)(jC.Indicator,{})]}),(0,H.jsxs)(jC.Tab,{id:`bilibili`,children:[(0,H.jsx)(`span`,{children:`B站推送`}),(0,H.jsx)(jC.Indicator,{})]})]})}),(0,H.jsx)(jC.Panel,{id:`douyin`,children:(0,H.jsxs)(`div`,{className:`space-y-4 pt-4`,children:[(0,H.jsx)(IV,{device:i,platformLabel:`抖音`,items:e.map((e,t)=>({label:e.remark||e.short_id||e.sec_uid||`推送项 ${t+1}`,description:e.short_id?`抖音号: ${e.short_id}`:e.sec_uid?`sec_uid: ${e.sec_uid.slice(0,20)}...`:``,values:e.group_id})),onApply:t=>n(e.map((e,n)=>({...e,group_id:t[n]??e.group_id})))}),(0,H.jsxs)(ov,{className:`w-full`,variant:`primary`,size:`sm`,onPress:()=>n([...e,LV()]),children:[(0,H.jsx)(MP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`添加抖音推送项`})]}),e.length>0?(0,H.jsx)(qc,{variant:`surface`,"aria-label":`抖音推送列表`,children:e.map((t,r)=>(0,H.jsx)(FV,{device:i,index:r,item:t,list:e,onChange:n},r))}):(0,H.jsx)(zV,{platform:`douyin`})]})}),(0,H.jsx)(jC.Panel,{id:`bilibili`,children:(0,H.jsxs)(`div`,{className:`space-y-4 pt-4`,children:[(0,H.jsx)(IV,{device:i,platformLabel:`B站`,items:t.map((e,t)=>({label:e.remark||`UID: ${e.host_mid}`||`推送项 ${t+1}`,description:`B站 UID: ${e.host_mid}`,values:e.group_id})),onApply:e=>r(t.map((t,n)=>({...t,group_id:e[n]??t.group_id})))}),(0,H.jsxs)(ov,{className:`w-full`,variant:`primary`,onPress:()=>r([...t,RV()]),children:[(0,H.jsx)(MP,{className:`size-4`}),(0,H.jsx)(`span`,{children:`添加B站推送项`})]}),t.length>0?(0,H.jsx)(qc,{variant:`surface`,"aria-label":`B站推送列表`,children:t.map((e,n)=>(0,H.jsx)(PV,{device:i,index:n,item:e,list:t,onChange:r},n))}):(0,H.jsx)(zV,{platform:`bilibili`})]})})]})})}var VV=({config:e,device:t,renderers:n,updateConfigValue:r})=>{let{renderPageHeader:i}=n;return(0,H.jsxs)(H.Fragment,{children:[i(`推送列表`,`管理「抖音」与「哔哩哔哩」的推送订阅。`),(0,H.jsx)(BV,{douyinList:e.pushlist?.douyin||[],bilibiliList:e.pushlist?.bilibili||[],onDouyinChange:e=>{r([`pushlist`,`douyin`],e)},onBilibiliChange:e=>{r([`pushlist`,`bilibili`],e)},device:t})]})},HV=({config:e,renderers:t,classes:n})=>{let{renderCheckboxGroup:r,renderPageHeader:i,renderSelectField:a,renderSubSection:o,renderSwitch:s,renderTextField:c}=t,l=Q(e,[`xiaohongshu`,`switch`],!1),u=Q(e,[`xiaohongshu`,`sendContent`],[]),d=Q(e,[`xiaohongshu`,`videoQuality`],`adapt`);return(0,H.jsxs)(H.Fragment,{children:[i(`小红书`,`小红书解析基础设置。`),(0,H.jsxs)(`div`,{className:n.topLevelFields,"data-config-section":!0,children:[s([`xiaohongshu`,`switch`],`解析开关`,`小红书解析开关,此开关为单独开关。`),r([`xiaohongshu`,`sendContent`],`解析时发送的内容`,`若什么都不选,可能不会返回任何解析结果。`,FB,!l),c([`xiaohongshu`,`numcomment`],`评论解析数量`,`小红书评论解析数量。`,{type:`number`,fallback:5,min:1,disabled:!l||!xB(u,`comment`)}),c([`xiaohongshu`,`subCommentLimit`],`子评论请求数量`,`大于 2 时需要配置小红书 ck(平台不允许游客获取二级评论)。`,{type:`number`,fallback:2,min:2,max:20,disabled:!l||!xB(u,`comment`)})]}),o(`渲染与画质设置`,(0,H.jsxs)(H.Fragment,{children:[a([`xiaohongshu`,`videoQuality`],`画质偏好`,`解析视频的分辨率偏好。`,LB,e=>e,!l),c([`xiaohongshu`,`maxAutoVideoSize`],`视频体积上限(MB)`,`根据该值自动选择分辨率进行下载。仅在「画质偏好」 为 "自动选择" 时生效。`,{type:`number`,fallback:50,min:1,max:2e4,disabled:!l||d!==`adapt`})]})),o(`权限设置`,(0,H.jsx)(H.Fragment,{children:a([`xiaohongshu`,`loginPerm`],`谁可以触发扫码登录`,`修改后需重启。`,BB)}))]})},UV=e=>{switch(e.activeFile){case`amagi`:return(0,H.jsx)($B,{...e});case`app`:return(0,H.jsx)(eV,{...e});case`douyin`:return(0,H.jsx)(nV,{...e});case`bilibili`:return(0,H.jsx)(tV,{...e});case`kuaishou`:return(0,H.jsx)(rV,{...e});case`xiaohongshu`:return(0,H.jsx)(HV,{...e});case`pushlist`:return(0,H.jsx)(VV,{...e})}},WV=(e,t)=>{let n=Number(e);return Number.isFinite(n)?t.min!==void 0&&n<t.min?t.error||`${t.label} 不能小于 ${t.min}`:t.max!==void 0&&n>t.max?t.error||`${t.label} 不能大于 ${t.max}`:``:`${t.label} 必须是数字`},GV=(e,t,n)=>{if(n.disabled)return;let r=WV(Q(t,n.path,0),n);r&&(e[_B(n.path)]=r)},KV=e=>typeof e==`string`&&/.+:.+/.test(e),qV=(e,t,n)=>{if(!Array.isArray(n)){e[`pushlist.${t}`]=`${t} 推送列表必须是数组`;return}let r=n.findIndex(e=>{if(!vB(e))return!0;let n=e.group_id,r=t===`douyin`?e.short_id:e.host_mid;return r==null||String(r).trim()===``||!Array.isArray(n)||n.some(e=>!KV(e))});r>=0&&(e[`pushlist.${t}`]=`${t} 推送列表第 ${r+1} 项缺少必填 UID/抖音号,或 group_id 未使用「群号:机器人账号」格式`)},JV=e=>{if(!e)return{};let t={},n=Q(e,[`app`,`livePhotoMode`],`video_and_livephoto`),r=Q(e,[`amagi`,`APIServerMount`],!1),i=Q(e,[`app`,`videoSendMode`],`file`),a=Q(e,[`app`,`usegroupfile`],!1),o=Q(e,[`app`,`usefilelimit`],!1),s=Q(e,[`app`,`compress`],!1),c=Q(e,[`app`,`downloadThrottle`],!1),l=Q(e,[`app`,`downloadAutoReduce`],!1),u=Q(e,[`amagi`,`proxy`,`switch`],!1),d=Q(e,[`douyin`,`switch`],!1),f=Q(e,[`douyin`,`sendContent`],[]),p=Q(e,[`douyin`,`burnDanmaku`],!1),m=Q(e,[`douyin`,`videoQuality`],`adapt`),h=Q(e,[`douyin`,`push`,`switch`],!1),g=Q(e,[`douyin`,`push`,`pushVideoQuality`],`adapt`),_=Q(e,[`bilibili`,`switch`],!1),v=Q(e,[`bilibili`,`sendContent`],[]),y=Q(e,[`bilibili`,`burnDanmaku`],!1),b=Q(e,[`bilibili`,`videoQuality`],0),x=Q(e,[`bilibili`,`push`,`switch`],!1),S=Q(e,[`bilibili`,`push`,`parsedynamic`],!1),C=Q(e,[`bilibili`,`push`,`pushVideoQuality`],0),w=Q(e,[`kuaishou`,`switch`],!1),T=Q(e,[`kuaishou`,`comment`],!1),E=Q(e,[`xiaohongshu`,`switch`],!1),D=Q(e,[`xiaohongshu`,`sendContent`],[]),O=Q(e,[`xiaohongshu`,`videoQuality`],`adapt`);return[{path:[`app`,`renderScale`],label:`渲染精度`,min:50,max:200},{path:[`app`,`ambientCover`,`coverOpacity`],label:`封面氛围强度`,min:0,max:1},{path:[`app`,`ambientCover`,`overlayEdgeOpacity`],label:`氛围压色(顶部/底部)`,min:0,max:1},{path:[`app`,`ambientCover`,`overlayMiddleOpacity`],label:`氛围压色(中间带)`,min:0,max:1},{path:[`app`,`RenderWaitTime`],label:`渲染图片的等待时间`,min:0},{path:[`app`,`multiPageHeight`],label:`分页渲染时,每页的高度`,min:1e3,max:2e4,disabled:!Q(e,[`app`,`multiPageRender`],!0),error:`请输入一个范围在 1000 到 20000 之间的数字`},{path:[`amagi`,`APIServerPort`],label:`API服务端口`,min:1024,max:65535,disabled:r,error:`请输入一个范围在 1024 到 65535 之间的数字`},{path:[`app`,`groupfilevalue`],label:`群文件上传阈值`,min:1,disabled:!a||i===`base64`},{path:[`app`,`filelimit`],label:`视频拦截阈值`,min:1,disabled:!o},{path:[`app`,`compresstrigger`],label:`压缩触发阈值`,min:1,disabled:!s},{path:[`app`,`compressvalue`],label:`压缩后的值`,min:1,disabled:!s},{path:[`app`,`downloadMaxSpeed`],label:`最大下载速度`,min:1,max:1e3,disabled:!c,error:`请输入一个范围在 1 到 1000 之间的数字`},{path:[`app`,`downloadMinSpeed`],label:`最低下载速度`,min:.1,max:100,disabled:!c||!l,error:`请输入一个范围在 0.1 到 100 之间的数字`},{path:[`amagi`,`timeout`],label:`请求超时时间`,min:1e3,max:3e5,error:`请输入一个范围在 1000 到 300000 之间的数字`},{path:[`amagi`,`proxy`,`port`],label:`代理端口`,min:1,max:65535,disabled:!u,error:`请输入一个范围在 1 到 65535 之间的数字`},{path:[`douyin`,`numcomment`],label:`评论解析数量`,min:1,disabled:!d||!xB(f,`comment`)},{path:[`douyin`,`subCommentLimit`],label:`次级评论解析数量`,min:1,max:20,disabled:!d||!xB(f,`comment`)},{path:[`douyin`,`maxAutoVideoSize`],label:`视频体积上限(MB)`,min:1,max:2e4,disabled:!d||m!==`adapt`},{path:[`douyin`,`danmakuOpacity`],label:`弹幕透明度`,min:0,max:100,disabled:!d||!p},{path:[`douyin`,`push`,`pushMaxAutoVideoSize`],label:`推送视频体积上限(MB)`,min:1,max:2e4,disabled:!h||g!==`adapt`},{path:[`bilibili`,`numcomment`],label:`评论解析数量`,min:1,disabled:!_||!xB(v,`comment`)},{path:[`bilibili`,`maxAutoVideoSize`],label:`视频体积上限(MB)`,min:1,max:2e4,disabled:!_||Number(b)!==0},{path:[`bilibili`,`danmakuOpacity`],label:`弹幕透明度`,min:0,max:100,disabled:!_||!y},{path:[`bilibili`,`push`,`pushMaxAutoVideoSize`],label:`视频动态的视频体积上限(MB)`,min:1,max:2e4,disabled:!x||!S||Number(C)!==0},{path:[`kuaishou`,`numcomment`],label:`评论解析数量`,min:1,disabled:!w||!T},{path:[`xiaohongshu`,`numcomment`],label:`评论解析数量`,min:1,disabled:!E||!xB(D,`comment`)},{path:[`xiaohongshu`,`subCommentLimit`],label:`子评论请求数量`,min:2,max:20,disabled:!E||!xB(D,`comment`)},{path:[`xiaohongshu`,`maxAutoVideoSize`],label:`视频体积上限(MB)`,min:1,max:2e4,disabled:!E||O!==`adapt`}].forEach(n=>GV(t,e,n)),n===`video_only`&&delete t[`app.livePhotoSystem`],qV(t,`douyin`,e.pushlist?.douyin||[]),qV(t,`bilibili`,e.pushlist?.bilibili||[]),t},YV=({device:e=`desktop`})=>{let t=(0,v.useRef)(null),[n,r]=TO(),i=dw(),a=n.get(`file`),[o,s]=TT({config:null,savedConfig:null,activeFile:a&&KB.some(e=>e.key===a)?a:`amagi`}),{activeFile:c,config:l,savedConfig:u}=o,d=(0,v.useMemo)(()=>QB(e),[e]),f=e===`mobile`?`sm`:`md`,{loading:p,run:m}=ST(cz,{onSuccess:e=>{s({config:structuredClone(e),savedConfig:structuredClone(e)})},onError:e=>{WC.danger(`加载配置失败`,{description:e.message})}}),{loading:h,runAsync:g}=ST(lz,{manual:!0}),_=(0,v.useMemo)(()=>{if(!l||!u)return!1;let e=CB(l),t=CB(u);return!(0,BO.default)(e,t)},[l,u]),y=(0,v.useMemo)(()=>JV(l),[l]),b=(0,v.useMemo)(()=>Object.values(y).some(Boolean),[y]),x=(0,v.useMemo)(()=>_&&!b&&!p,[_,b,p]),S=vw((e,t)=>{s(n=>n.config?{config:yB(n.config,e,t)}:null)}),C=vw(()=>{if(!l||b)return;let e=l,t=g(e).then(()=>{s({savedConfig:e})});WC.promise(t,{loading:`正在保存配置...`,success:`配置已保存`,error:e=>e instanceof Error?e.message:`保存配置失败`})}),w=vw(()=>{m()}),T=vw(e=>{r({file:e})}),E=vw(e=>{e.preventDefault(),C()});(0,v.useEffect)(()=>{let e=n.get(`file`);e&&KB.some(t=>t.key===e)&&e!==c&&s({activeFile:e})},[n,c,s]),(0,v.useEffect)(()=>{let e=t.current?.querySelector(`[data-config-tabs-scroll="true"]`);if(!e)return;let n=t=>{let n=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;n&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),!(e.scrollWidth<=e.clientWidth)&&(e.scrollLeft+=n))};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{e.removeEventListener(`wheel`,n)}},[l]);let D=vw(()=>{t.current&&JN.fromTo(t.current.querySelectorAll(`[data-config-section]`),mz,{...hz,duration:dz(.35),stagger:fz(.03)})});(0,v.useEffect)(()=>{l&&t.current?.dataset.animated!==`true`&&(t.current&&(t.current.dataset.animated=`true`),D())},[l,D]),yw(()=>{D()},[c]);let O=(0,v.useMemo)(()=>l?YB({config:l,device:e,classes:d,validationErrors:y,updateConfigValue:S}):{},[l,e,d,y,S]);if(p||!l)return(0,H.jsxs)(`div`,{className:`${d.root} ${d.loading}`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在读取配置`}),(0,H.jsx)(`span`,{children:`正在读取配置`})]});let k=(0,H.jsx)(`div`,{className:d.floatingActions,children:(0,H.jsxs)(`div`,{className:d.actionControls,children:[(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{"aria-label":`重新读取配置`,children:(0,H.jsx)(ov,{isIconOnly:!0,size:f,variant:`secondary`,isDisabled:p||h,onPress:w,children:(0,H.jsx)(PP,{size:16,"aria-hidden":`true`})})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`bottom`,children:[(0,H.jsx)(uw.Arrow,{}),`重新读取`]})]}),(0,H.jsxs)(uw,{delay:0,children:[(0,H.jsx)(uw.Trigger,{"aria-label":`查看配置变更`,children:(0,H.jsx)(ov,{isIconOnly:!0,size:f,variant:`secondary`,isDisabled:!_,onPress:i.open,children:(0,H.jsx)(SP,{size:16,"aria-hidden":`true`})})}),(0,H.jsxs)(uw.Content,{showArrow:!0,placement:`bottom`,children:[(0,H.jsx)(uw.Arrow,{}),`查看变更`]})]}),(0,H.jsxs)(ov,{size:f,isDisabled:!x,isPending:h,onPress:C,variant:`primary`,children:[(0,H.jsx)(IP,{size:16,"aria-hidden":`true`}),(0,H.jsx)(`span`,{children:`保存`})]})]})});return(0,H.jsxs)(`div`,{ref:t,className:d.root,children:[(0,H.jsx)(kB,{device:e,original:u,current:l,isOpen:i.isOpen,onOpenChange:i.setOpen}),(0,H.jsxs)(AS,{className:d.form,onSubmit:E,children:[(0,H.jsx)(jC,{className:`w-full min-w-0 max-w-full`,selectedKey:c,onSelectionChange:T,children:(0,H.jsx)(jC.ListContainer,{className:d.tabsListContainer,"data-config-tabs-scroll":`true`,"data-scrollbar":`none`,children:(0,H.jsx)(jC.List,{"aria-label":`配置文件选择`,className:d.tabsList,children:KB.map((e,t)=>(0,H.jsxs)(jC.Tab,{id:e.key,children:[t>0?(0,H.jsx)(jC.Separator,{}):null,(0,H.jsx)(`span`,{className:`whitespace-nowrap`,children:e.label}),(0,H.jsx)(jC.Indicator,{})]},e.key))})})}),(0,H.jsxs)(`div`,{className:`relative min-w-0 max-w-full`,children:[k,(0,H.jsx)(UV,{activeFile:c,classes:d,config:l,device:e,renderers:O,updateConfigValue:S},c)]})]})]})},XV=({onLogin:e})=>{let[t,n]=TT({authKey:``,loading:!1,error:``}),[r,{toggle:i}]=wT(!1),a=r?`隐藏密钥`:`显示密钥`,o=vw(async r=>{r.preventDefault();let i=t.authKey.trim();if(!i){n({error:`请输入 Karin HTTP 鉴权密钥`});return}try{n({loading:!0,error:``}),await az(i),e()}catch(e){n({error:e instanceof Error?e.message:`登录失败`})}finally{n({loading:!1})}});return(0,H.jsx)(yC,{className:`flex min-h-screen items-center justify-center px-4 py-8`,children:(0,H.jsxs)(lv,{className:`w-full max-w-105`,children:[(0,H.jsxs)(lv.Header,{className:`gap-4 p-6`,children:[(0,H.jsx)(EP,{className:`size-8 shrink-0`,"aria-hidden":`true`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(lv.Title,{children:`Karin 鉴权`}),(0,H.jsx)(lv.Description,{children:`使用 Karin HTTP 鉴权密钥登录后管理 KKK 配置。`})]})]}),(0,H.jsx)(lv.Content,{className:`p-6`,children:(0,H.jsxs)(AS,{className:`flex flex-col gap-6`,onSubmit:o,children:[(0,H.jsxs)(MC,{fullWidth:!0,isInvalid:!!t.error,value:t.authKey,onChange:e=>{n({authKey:e,error:t.error?``:t.error})},children:[(0,H.jsx)(IS,{children:`HTTP 鉴权密钥`}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(PS,{autoComplete:`current-password`,className:`min-w-0 flex-1`,placeholder:`请输入 Karin 的 HTTP_AUTH_KEY`,type:r?`text`:`password`}),(0,H.jsx)(ov,{isIconOnly:!0,"aria-label":a,type:`button`,variant:`tertiary`,onPress:i,children:r?(0,H.jsx)(vP,{className:`size-4`,"aria-hidden":`true`}):(0,H.jsx)(bP,{className:`size-4`,"aria-hidden":`true`})})]}),(0,H.jsx)(aS,{children:t.error||`生产环境会复用 Karin 主 Web 已保存的登录凭据。`})]}),(0,H.jsx)(ov,{fullWidth:!0,isPending:t.loading,type:`submit`,children:({isPending:e})=>(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsx)(vC,{color:`current`,size:`sm`,"aria-label":`登录中`}):(0,H.jsx)(OP,{className:`size-4`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{children:`登录`})]})})]})})]})})},ZV=`theme`,QV=`kkk-theme-changed`,$V=`karin-theme-change`,eH={light:`light`,dark:`dark`,system:`system`,inverse:`inverse`},tH=e=>e===eH.system||e===eH.inverse,nH=e=>e===eH.light||e===eH.dark,rH=e=>!e||typeof e!=`object`?!1:e.type===$V,iH=()=>{let e=localStorage.getItem(ZV);if(tH(e))return e;try{let t=JSON.parse(e??``);if(tH(t))return t}catch{}return localStorage.setItem(ZV,eH.system),eH.system},aH=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches?eH.dark:eH.light,oH=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches?eH.light:eH.dark,sH=e=>e===eH.system?aH():oH(),cH=e=>lH(sH(e)),lH=e=>(document.documentElement.classList.remove(eH.light,eH.dark),document.documentElement.classList.add(e),document.documentElement.dataset.theme=e,e),uH=()=>{let[e,t]=(0,v.useState)(()=>iH()),[n,r]=(0,v.useState)(()=>sH(e)),i=(0,v.useRef)(!1),a=(0,v.useCallback)(e=>{localStorage.setItem(ZV,e),t(e),r(cH(e)),window.dispatchEvent(new CustomEvent(QV,{detail:e}))},[]),o=(0,v.useCallback)(()=>{a(eH.system)},[a]),s=(0,v.useCallback)(()=>{a(eH.inverse)},[a]),c=(0,v.useCallback)(()=>{a(e===eH.system?eH.inverse:eH.system)},[a,e]);return(0,v.useEffect)(()=>{i.current?i.current=!1:r(cH(e));let n=window.matchMedia(`(prefers-color-scheme: dark)`),a=()=>{r(cH(e))},o=e=>{if(e.key!==ZV||window.self!==window.top)return;let n=iH();t(n),r(cH(n))},s=e=>{let n=e.detail;tH(n)&&(t(n),r(cH(n)))},c=e=>{if(!rH(e.data))return;let n=e.data.theme,a=tH(n??null)?n:iH(),o=nH(e.data.appliedTheme)?e.data.appliedTheme:sH(a);i.current=!0,localStorage.setItem(ZV,a),t(a),r(lH(o))};return n.addEventListener(`change`,a),window.addEventListener(`storage`,o),window.addEventListener(QV,s),window.addEventListener(`message`,c),()=>{n.removeEventListener(`change`,a),window.removeEventListener(`storage`,o),window.removeEventListener(QV,s),window.removeEventListener(`message`,c)}},[e]),{theme:e,appliedTheme:n,isDark:(0,v.useMemo)(()=>n===eH.dark,[n]),isLight:(0,v.useMemo)(()=>n===eH.light,[n]),isSystem:e===eH.system,isInverse:e===eH.inverse,setSystemTheme:o,setInverseTheme:s,toggleTheme:c}},dH=()=>document.documentElement.clientWidth||window.innerWidth,fH=(e=dH())=>e<=768?`mobile`:`desktop`,pH=()=>{let e=navigator.userAgent.toLowerCase();return[`android`,`webos`,`iphone`,`ipad`,`ipod`,`blackberry`,`windows phone`,`mobile`].some(t=>e.includes(t))},mH=()=>{let e=fH();return pH()||e===`mobile`?`mobile`:`desktop`},hH=.12,gH=33,_H=1,vH={scrollTo:()=>{},destroy:()=>{}},yH=(e,t)=>Math.min(Math.max(e,0),Math.max(t,0)),bH=()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,xH=(e,t,n)=>{let r=e.scrollTop,i=r,a=r,o=!1,s=!1,c=()=>e.scrollHeight-e.clientHeight;function l(){o&&(o=!1,JN.ticker.remove(u))}function u(){let t=s?hH:1-.88**JN.ticker.deltaRatio(60);if(s=!1,i=yH(i,c()),r+=(i-r)*t,e.scrollTop!==r){e.scrollTop=r;let t=e.scrollTop;a=t,Math.abs(t-r)>_H&&(r=t,i=t)}Math.abs(i-r)<_H&&(r=i,l())}function d(){o||(o=!0,s=!0,JN.ticker.add(u))}let f=()=>{Math.abs(e.scrollTop-a)<_H||(r=e.scrollTop,i=r)};function p(t){let n=t.deltaY>0,r=t.target;for(;r&&r!==e;){if(r instanceof HTMLElement){let e=window.getComputedStyle(r).overflowY;if((e===`auto`||e===`scroll`)&&r.scrollHeight>r.clientHeight&&(n?r.scrollTop+r.clientHeight<r.scrollHeight-1:r.scrollTop>1))return!0}r=r.parentElement}return!1}let m=t=>{let n=t;if(n.ctrlKey||Math.abs(n.deltaX)>Math.abs(n.deltaY)||bH()||p(n))return;let r=n.deltaY;n.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=gH:n.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=e.clientHeight),r&&(n.preventDefault(),i=yH(i+r,c()),d())};return n.addEventListener(`scroll`,f,{passive:!0}),t.addEventListener(`wheel`,m,{passive:!1}),{scrollTo:t=>{if(r=e.scrollTop,i=yH(t,c()),bH()){r=i,a=i,e.scrollTop=i;return}d()},destroy:()=>{l(),n.removeEventListener(`scroll`,f),t.removeEventListener(`wheel`,m)}}},SH=e=>{let t=e.current;return t?xH(t,t,t):vH},CH=e=>{let t=e.current,n=document.scrollingElement;return!t||!n?vH:xH(n,t,window)},wH=()=>AT(()=>import(`./DesktopLayout-t8vT4Hmg.js`),__vite__mapDeps([2,1,3])),TH=()=>AT(()=>import(`./MobileLayout-CTAoQc-J.js`),__vite__mapDeps([4,3])),EH={config:`/kkk/assets/config`,about:`/kkk/assets/about`},DH={"/kkk/assets/config":`config`,"/kkk/assets/about":`about`},OH=({device:e})=>{let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>SH(t).destroy,[]),(0,H.jsxs)(yC,{className:`h-screen overflow-hidden bg-background`,children:[(0,H.jsx)(aw.Provider,{placement:`top`}),(0,H.jsx)(tC,{ref:t,hideScrollBar:!0,className:`h-full px-3 py-3 sm:px-5 sm:py-4 ${e===`mobile`?`data-[top-scroll=true]:mask-none data-[top-scroll=true]:[-webkit-mask-image:none] data-[top-bottom-scroll=true]:mask-[linear-gradient(180deg,black_calc(100%-var(--scroll-shadow-size)),transparent)] data-[top-bottom-scroll=true]:[-webkit-mask-image:linear-gradient(180deg,black_calc(100%-var(--scroll-shadow-size)),transparent)]`:``}`,size:56,children:(0,H.jsx)(YV,{device:e})})]})},kH=({LayoutComponent:e})=>{let t=rD(),n=oD(),r=DH[t.pathname]||`config`,i=vw(e=>{n(EH[e])});return e?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(aw.Provider,{placement:`top`}),(0,H.jsx)(e,{activeMenu:r,onMenuChange:i})]}):(0,H.jsxs)(yC,{className:`flex min-h-screen items-center justify-center gap-4`,children:[(0,H.jsx)(vC,{size:`sm`,"aria-label":`正在加载布局`}),(0,H.jsx)(aS,{children:`正在加载`})]})},AH=()=>{uH();let[e,t]=TT({authenticated:IO(),device:mH(),LayoutComponent:null}),{authenticated:n,device:r,LayoutComponent:i}=e;(0,v.useEffect)(()=>{let e=()=>{t({authenticated:IO()})};return window.addEventListener(MO,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(MO,e),window.removeEventListener(`storage`,e)}},[t]);let a=vw(()=>{let e=mH();t(t=>t.device===e?null:{device:e,LayoutComponent:null})});(0,v.useEffect)(()=>{let e=0,t=()=>{window.cancelAnimationFrame(e),e=window.requestAnimationFrame(a)};return window.addEventListener(`resize`,t),window.addEventListener(`orientationchange`,t),()=>{window.cancelAnimationFrame(e),window.removeEventListener(`resize`,t),window.removeEventListener(`orientationchange`,t)}},[a]),(0,v.useEffect)(()=>{if(!n){t({LayoutComponent:null});return}let e=!1;return(async()=>{if(r===`mobile`){let n=await TH();e||t({LayoutComponent:n.default})}else{let n=await wH();e||t({LayoutComponent:n.default})}})(),()=>{e=!0}},[n,r,t]);let o=vw(()=>{t({authenticated:!0})});return n?(0,H.jsxs)(MD,{children:[(0,H.jsx)(AD,{path:`/kkk/assets/karin-config`,element:(0,H.jsx)(OH,{device:r})}),(0,H.jsx)(AD,{path:`/kkk/assets/config`,element:(0,H.jsx)(kH,{LayoutComponent:i})}),(0,H.jsx)(AD,{path:`/kkk/assets/about`,element:(0,H.jsx)(kH,{LayoutComponent:i})}),(0,H.jsx)(AD,{path:`/kkk/assets`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})}),(0,H.jsx)(AD,{path:`/kkk`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})}),(0,H.jsx)(AD,{path:`/kkk/login`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})}),(0,H.jsx)(AD,{path:`*`,element:(0,H.jsx)(kD,{to:`/kkk/assets/config`,replace:!0})})]}):(0,H.jsxs)(MD,{children:[(0,H.jsx)(AD,{path:`/kkk/login`,element:(0,H.jsx)(XV,{onLogin:o})}),(0,H.jsx)(AD,{path:`*`,element:(0,H.jsx)(kD,{to:`/kkk/login`,replace:!0})})]})};(0,y.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(v.StrictMode,{children:(0,H.jsx)(()=>(0,H.jsx)(vO,{children:(0,H.jsx)(AH,{})}),{})}));export{uc as $,Ag as A,V as At,up as B,O as Bt,Bv as C,Qt as Ct,ov as D,lt as Dt,lv as E,Et,ah as F,ke as Ft,$l as G,op as H,d as Ht,ih as I,we as It,Y as J,zc as K,hp as L,L as Lt,ph as M,We as Mt,mh as N,ze as Nt,tv as O,st as Ot,oh as P,z as Pt,fc as Q,mp as R,E as Rt,Uv as S,nn as St,pv as T,Mt as Tt,pd as U,l as Ut,cp as V,h as Vt,ud as W,_c as X,J as Y,dc as Z,US as _,oo as _t,dz as a,vs as at,wS as b,ya as bt,zO as c,Fo as ct,uw as d,mo as dt,ic as et,MC as f,to as ft,ZS as g,K as gt,uC as h,ao as ht,YV as i,Ms as it,xh as j,B as jt,Ng as k,at as kt,wT as l,Mo as lt,yC as m,G as mt,SH as n,Js as nt,cP as o,Ro as ot,jC as p,io as pt,Bc as q,uH as r,Is as rt,JN as s,zo as st,CH as t,rc as tt,vw as u,Do as ut,IS as v,ro as vt,Hv as w,en as wt,aS as x,on as xt,PS as y,_a as yt,pp as z,M as zt};
@@ -1 +1 @@
1
- import{R as e,St as t,bt as n,vt as r,z as i}from"./index-DBbIxsmd.js";var a=n({base:`separator`,defaultVariants:{orientation:`horizontal`,variant:`default`},variants:{orientation:{horizontal:`separator--horizontal`,vertical:`separator--vertical`},variant:{default:`separator--default`,secondary:`separator--secondary`,tertiary:`separator--tertiary`}}}),o=t(),s=({className:t,orientation:n,variant:s,...c})=>{let l=r(i),u=n??l?.orientation??`horizontal`;return(0,o.jsx)(e,{"data-orientation":u,"data-slot":`separator`,orientation:u,className:a({orientation:u,variant:s,className:t}),...c})},c=Object.assign(s,{Root:s});export{c as t};
1
+ import{R as e,St as t,bt as n,vt as r,z as i}from"./index-Zn_7piH-.js";var a=n({base:`separator`,defaultVariants:{orientation:`horizontal`,variant:`default`},variants:{orientation:{horizontal:`separator--horizontal`,vertical:`separator--vertical`},variant:{default:`separator--default`,secondary:`separator--secondary`,tertiary:`separator--tertiary`}}}),o=t(),s=({className:t,orientation:n,variant:s,...c})=>{let l=r(i),u=n??l?.orientation??`horizontal`;return(0,o.jsx)(e,{"data-orientation":u,"data-slot":`separator`,orientation:u,className:a({orientation:u,variant:s,className:t}),...c})},c=Object.assign(s,{Root:s});export{c as t};
@@ -6,7 +6,7 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <meta name="description" content="KKK Config - Karin 插件配置管理面板" />
8
8
  <title>KKK Config</title>
9
- <script type="module" crossorigin src="/kkk/assets/assets/index-DBbIxsmd.js"></script>
9
+ <script type="module" crossorigin src="/kkk/assets/assets/index-Zn_7piH-.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/kkk/assets/assets/index-D1zuPqD3.css">
11
11
  </head>
12
12
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karin-plugin-kkk",
3
- "version": "2.45.1-beta.2",
3
+ "version": "2.45.1-beta.3",
4
4
  "description": "Karin 的「抖音」「B 站」视频解析/动态推送插件",
5
5
  "keywords": [
6
6
  "karin",
@@ -83,7 +83,7 @@
83
83
  "@lobehub/webfont-harmony-sans-sc": "^1.0.0",
84
84
  "emoji-datasource-apple": "16.0.0"
85
85
  },
86
- "timestamp": "2026-10-15T15:53:55.899Z",
86
+ "timestamp": "2026-10-16T15:32:45.381Z",
87
87
  "engines": {
88
88
  "node": ">=18.0.0"
89
89
  }