From a7b65ed9fd752235634e8bcfbdd7532cfb0dfe85 Mon Sep 17 00:00:00 2001 From: 1-6 Date: Wed, 12 Jul 2023 23:10:49 +0800 Subject: [PATCH] x --- core/adapter.go | 79 ++++++++++++- core/admin/index.html | 2 +- core/admin/p__Carry__index.2bf73a4a.async.js | 1 + core/admin/p__Carry__index.dfb417bd.async.js | 1 - .../{umi.c0e983ad.js => umi.1e8ac0f4.js} | 2 +- core/base_sender.go | 8 ++ core/carry.go | 110 +++++++++++++++--- core/common/sender.go | 2 + core/node_strings.go | 20 +++- core/plugin_core.go | 1 + core/queue.go | 80 +++++++++++++ 11 files changed, 277 insertions(+), 29 deletions(-) create mode 100644 core/admin/p__Carry__index.2bf73a4a.async.js delete mode 100644 core/admin/p__Carry__index.dfb417bd.async.js rename core/admin/{umi.c0e983ad.js => umi.1e8ac0f4.js} (99%) create mode 100644 core/queue.go diff --git a/core/adapter.go b/core/adapter.go index 70d0098..039338d 100644 --- a/core/adapter.go +++ b/core/adapter.go @@ -521,6 +521,12 @@ func (f *Factory) SetIsAdmin(function func(string) bool) { } } +func (f *Factory) Sender() *CustomSender { + var demo = *f.demo + sender := &demo + return sender +} + func (f *Factory) Receive(wt interface{}) *CustomSender { var demo = *f.demo sender := &demo @@ -553,9 +559,9 @@ func (f *Factory) Receive(wt interface{}) *CustomSender { } } sender.SetExpandMessageInfo(emf) - if sender.details.Content != "" { - Messages <- sender - } + // if sender.details.Content != "" { + Messages <- sender + // } return sender } @@ -602,6 +608,50 @@ func (sender *CustomSender) GetBotID() string { type PUSH string +func (sender *CustomSender) Action(options map[string]interface{}) (interface{}, string) { + var platform = sender.f.botplt + var any *common.Function + var one *common.Function + var result interface{} + var err = "" + for _, function := range Functions { + if function.Reply != nil && function.Reply.Platform == platform { + if len(function.Reply.BotsID) == 0 { + any = function + } else if Contains(function.Reply.BotsID, sender.f.botid) { + one = function + } + } + } + if one == nil && any != nil { + one = any + } + if one != nil { + one.Handle(&Faker{ + Type: "action", + }, func(vm *goja.Runtime) { + obj := vm.NewObject() + for k, v := range options { + obj.Set(k, v) + } + proxy := vm.NewProxy(obj, &goja.ProxyTrapConfig{ + Set: func(target *goja.Object, property string, value, receiver goja.Value) (success bool) { + if property == "result" { + result = value + } + if property == "error" { + err = value.String() + } + return true + }, + }) + vm.Set("action", proxy) + vm.Set("adapter", sender.f) + }) + } + return result, err +} + func (sender *CustomSender) Reply(msgs ...interface{}) (string, error) { var push = false var platform = sender.f.botplt @@ -740,6 +790,14 @@ func (sender *CustomSender) Copy() common.Sender { return &new } +func (sender *CustomSender) Event() map[string]interface{} { + e := sender.GetVar("event") + if e == nil { + return nil + } + return e.(map[string]interface{}) +} + func (sender *CustomSender) RecallMessage(ps ...interface{}) { recalls := []func(){} var timeout int @@ -750,14 +808,20 @@ func (sender *CustomSender) RecallMessage(ps ...interface{}) { case string: if p != "" { recalls = append(recalls, func() { - sender.Reply(mystr.BuildCQCode("delete", H{"id": p}, "")) + sender.Action(H{ + "type": "delete_message", + "message_id": p, + }) }) } case []string: for _, v := range p { if v != "" { recalls = append(recalls, func() { - sender.Reply(mystr.BuildCQCode("delete", H{"id": v}, "")) + sender.Action(H{ + "type": "delete_message", + "message_id": v, + }) }) } } @@ -765,7 +829,10 @@ func (sender *CustomSender) RecallMessage(ps ...interface{}) { for _, v := range p { for _, v2 := range v { recalls = append(recalls, func() { - sender.Reply(mystr.BuildCQCode("delete", H{"id": v2}, "")) + sender.Action(H{ + "type": "delete_message", + "message_id": v2, + }) }) } } diff --git a/core/admin/index.html b/core/admin/index.html index 0e93e97..fcf6c5d 100644 --- a/core/admin/index.html +++ b/core/admin/index.html @@ -8,6 +8,6 @@
- + \ No newline at end of file diff --git a/core/admin/p__Carry__index.2bf73a4a.async.js b/core/admin/p__Carry__index.2bf73a4a.async.js new file mode 100644 index 0000000..ed6da4a --- /dev/null +++ b/core/admin/p__Carry__index.2bf73a4a.async.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[274],{59419:function(ce,_,u){var E=u(75782),A=u(58733),U=u(18518),c=u(50959),T=u(60061),f=u(72961),V=u(11527),D=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],I=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],Z=c.forwardRef(function(e,K){var te=e.fieldProps,ue=e.children,ae=e.params,ne=e.proFieldProps,Q=e.mode,R=e.valueEnum,q=e.request,t=e.showSearch,v=e.options,s=(0,A.Z)(e,D),a=(0,c.useContext)(T.Z);return(0,V.jsx)(f.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,U.h)(R),request:q,params:ae,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({options:v,mode:Q,showSearch:t,getPopupContainer:a.getPopupContainer},te),ref:K,proFieldProps:ne},s),{},{children:ue}))}),M=c.forwardRef(function(e,K){var te=e.fieldProps,ue=e.children,ae=e.params,ne=e.proFieldProps,Q=e.mode,R=e.valueEnum,q=e.request,t=e.options,v=(0,A.Z)(e,I),s=(0,E.Z)({options:t,mode:Q||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},te),a=(0,c.useContext)(T.Z);return(0,V.jsx)(f.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,U.h)(R),request:q,params:ae,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({getPopupContainer:a.getPopupContainer},s),ref:K,proFieldProps:ne},v),{},{children:ue}))}),b=Z,p=M,o=b;o.SearchSelect=p,o.displayName="ProFormComponent",_.Z=o},40792:function(ce,_,u){var E=u(75782),A=u(58733),U=u(50959),c=u(72961),T=u(11527),f=["fieldProps","unCheckedChildren","checkedChildren","proFieldProps"],V=U.forwardRef(function(D,I){var Z=D.fieldProps,M=D.unCheckedChildren,b=D.checkedChildren,p=D.proFieldProps,o=(0,A.Z)(D,f);return(0,T.jsx)(c.Z,(0,E.Z)({valueType:"switch",fieldProps:(0,E.Z)({unCheckedChildren:M,checkedChildren:b},Z),ref:I,valuePropName:"checked",proFieldProps:p,filedConfig:{valuePropName:"checked",ignoreWidth:!0}},o))});_.Z=V},66732:function(ce,_,u){var E=u(75782),A=u(58733),U=u(50959),c=u(72961),T=u(11527),f=["fieldProps","proFieldProps"],V=["fieldProps","proFieldProps"],D="text",I=function(p){var o=p.fieldProps,e=p.proFieldProps,K=(0,A.Z)(p,f);return(0,T.jsx)(c.Z,(0,E.Z)({valueType:D,fieldProps:o,filedConfig:{valueType:D},proFieldProps:e},K))},Z=function(p){var o=p.fieldProps,e=p.proFieldProps,K=(0,A.Z)(p,V);return(0,T.jsx)(c.Z,(0,E.Z)({valueType:"password",fieldProps:o,proFieldProps:e,filedConfig:{valueType:D}},K))},M=I;M.Password=Z,M.displayName="ProFormComponent",_.Z=M},3176:function(ce,_,u){var E=u(75782),A=u(58733),U=u(50959),c=u(72961),T=u(11527),f=["fieldProps","proFieldProps"],V=function(I,Z){var M=I.fieldProps,b=I.proFieldProps,p=(0,A.Z)(I,f);return(0,T.jsx)(c.Z,(0,E.Z)({ref:Z,valueType:"textarea",fieldProps:M,proFieldProps:b},p))};_.Z=U.forwardRef(V)},7765:function(ce,_,u){u.r(_),u.d(_,{default:function(){return w}});var E=u(25359),A=u.n(E),U=u(49811),c=u.n(U),T=u(54306),f=u.n(T),V=u(93525),D=u.n(V),I=u(27693),Z=u(68243),M=u(28964),b=u(4050),p=u(31255),o=u(50959),e=u(11527);function K(n,W){var z=n.concat(W);return D()(new Set(z))}function te(n){var W,z=(0,o.useState)((W=n.data)!==null&&W!==void 0?W:[]),H=f()(z,2),O=H[0],G=H[1],g=(0,o.useState)(!1),d=f()(g,2),h=d[0],J=d[1],m=(0,o.useState)(""),L=f()(m,2),$=L[0],X=L[1],ee=(0,o.useState)(-1),oe=f()(ee,2),le=oe[0],Y=oe[1],xe=(0,o.useState)(""),Ce=f()(xe,2),pe=Ce[0],fe=Ce[1],me=(0,o.useRef)(null),Fe=(0,o.useRef)(null);(0,o.useEffect)(function(){if(h){var C;(C=me.current)===null||C===void 0||C.focus()}},[h]),(0,o.useEffect)(function(){var C;(C=Fe.current)===null||C===void 0||C.focus()},[$]);var Ae=function(P){var k=O.filter(function(de){return de!==P});console.log(k),G(k),n.setTags(k)},Ee=function(){J(!0)},ye=function(P){X(P.target.value)},ge=function(){if($&&O.indexOf($)===-1){var P=$.trim().split(/\s+/),k=K(O,P);G(k),n.setTags(k)}J(!1),X("")},be=function(P){fe(P.target.value)},ve=function(){var P=D()(O);P[le]=pe,G(P),n.setTags(P),Y(-1),X("")},Pe={width:78,verticalAlign:"top"},he={borderStyle:"dashed"};return(0,e.jsxs)(Z.Z,{size:[0,8],wrap:!0,children:[(0,e.jsx)(Z.Z,{size:[0,8],wrap:!0,children:O.map(function(C,P){if(le===P)return(0,e.jsx)(M.Z,{ref:Fe,size:"small",style:Pe,value:pe,onChange:be,onBlur:ve,onPressEnter:ve},C);var k=C.length>20,de=(0,e.jsx)(b.Z,{closable:!0,style:{userSelect:"none"},onClose:function(){return Ae(C)},children:(0,e.jsx)("span",{onDoubleClick:function(De){P!==0&&(Y(P),fe(C),De.preventDefault())},children:k?"".concat(C.slice(0,20),"..."):C})},C);return k?(0,e.jsx)(p.Z,{title:C,children:de},C):de})}),h?(0,e.jsx)(M.Z,{ref:me,type:"text",size:"small",style:Pe,value:$,onChange:ye,onBlur:ge,onPressEnter:ge}):(0,e.jsxs)(b.Z,{style:he,onClick:Ee,children:[(0,e.jsx)(I.Z,{}),"\u589E\u52A0"]})]})}var ue=te,ae=u(12472),ne=u(61643),Q=u(81308),R=u(59419),q=u(66732),t=u(24176),v=u(40792),s=u(3176),a=u(86195),i=u(833),B=u(26572),j=u(79112),re=u(53315),w=function(){var n=(0,o.useRef)(),W=(0,o.useState)(y),z=f()(W,2),H=z[0],O=z[1],G=[{title:"\u7F16\u53F7",dataIndex:"id",key:"id"},{title:"\u7FA4\u7EC4ID",dataIndex:"chat_id",key:"chat_id"},{title:"\u7FA4\u540D",dataIndex:"chat_name",key:"chat_name"},{title:"\u5E73\u53F0",dataIndex:"platform",key:"platform",render:function(d,h){return(0,e.jsx)(b.Z,{color:"purple",children:d})}},{title:"\u6A21\u5F0F",dataIndex:"in",key:"in",render:function(d,h){return(0,e.jsxs)(Z.Z,{size:[0,8],wrap:!0,children:[h.in&&(0,e.jsx)(b.Z,{color:"blue",children:"\u91C7\u96C6"}),h.out&&(0,e.jsx)(b.Z,{color:"geekblue",children:"\u8F6C\u53D1"})]})}},{title:"\u5907\u6CE8",dataIndex:"remark",key:"remark"},{title:"\u521B\u5EFA\u65E5\u671F",dataIndex:"created_at",key:"created_at",render:function(d,h){return(0,e.jsx)("span",{children:new Date(d*1e3).toLocaleDateString()})}},{title:"\u542F\u7528",dataIndex:"enable",key:"enable",renderFormItem:function(){return(0,e.jsx)(i.Z,{disabled:!0,defaultChecked:!1})},render:function(d,h){return(0,e.jsx)(i.Z,{onChange:function(m){(0,a.request)("/api/carry/group",{method:"post",data:JSON.stringify({chat_id:h.chat_id,enable:m})})},defaultChecked:h==null?void 0:h.enable})}},{title:"\u64CD\u4F5C",valueType:"option",width:"10%",render:function(d,h){return[(0,e.jsx)("a",{onClick:function(){return O(h)},children:"\u7F16\u8F91"},"more"),(0,e.jsx)("a",{onClick:function(){var m,L;(0,a.request)("/api/carry/group",{method:"delete",data:JSON.stringify({chat_id:h.chat_id})}),(m=n.current)===null||m===void 0||(L=m.reloadAndRest)===null||L===void 0||L.call(m)},children:"\u5220\u9664"},"delete")]}}];return(0,e.jsxs)(ae._z,{content:"\u642C\u8FD0\u7FA4\u7EC4",children:[(0,e.jsx)(Z.Z,{style:{marginBottom:10},children:(0,e.jsx)(B.ZP,{type:"primary",onClick:function(){O(ie)},icon:(0,e.jsx)(I.Z,{}),children:"\u65B0\u5EFA\u4E00\u884C"})}),(0,e.jsx)(ne.Z,{search:!1,actionRef:n,rowKey:function(d){return d.chat_id},columns:G,request:c()(A()().mark(function g(){var d,h=arguments;return A()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return d=h.length>0&&h[0]!==void 0?h[0]:{},m.abrupt("return",(0,a.request)("/api/carry/groups",{params:d}));case 2:case"end":return m.stop()}},g)}))}),H.id!=-1&&(0,e.jsx)(N,{open:H.id!=-1,data:H,onCancel:function(){return O(y)},onFinish:function(){var g=c()(A()().mark(function d(h){return A()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:(0,a.request)("/api/carry/group",{method:"post",data:JSON.stringify(h)}).then(function(L){var $,X;($=n.current)===null||$===void 0||(X=$.reloadAndRest)===null||X===void 0||X.call($),O(y)});case 1:case"end":return m.stop()}},d)}));return function(d){return g.apply(this,arguments)}}()})]})};function N(n){var W,z,H,O=(0,o.useState)([]),G=f()(O,2),g=G[0],d=G[1],h=(0,o.useState)({}),J=f()(h,2),m=J[0],L=J[1],$=(0,o.useState)(!1),X=f()($,2),ee=X[0],oe=X[1],le=(0,o.useState)({}),Y=f()(le,2),xe=Y[0],Ce=Y[1],pe=(0,o.useState)([]),fe=f()(pe,2),me=fe[0],Fe=fe[1],Ae=(0,o.useState)(n.data.out),Ee=f()(Ae,2),ye=Ee[0],ge=Ee[1],be=(0,o.useState)(n.data.allowed.length==0),ve=f()(be,2),Pe=ve[0],he=ve[1],C=(0,o.useState)(se.allowed),P=f()(C,2),k=P[0],de=P[1],Be=(0,o.useState)([]),De=f()(Be,2),Se=De[0],Ve=De[1],We=(0,o.useState)([]),Ze=f()(We,2),Me=Ze[0],je=Ze[1],Le=(0,o.useState)([]),Re=f()(Le,2),_e=Re[0],Ue=Re[1],S=(0,o.useRef)(),Oe=function(r){var l;return(l=S.current)===null||l===void 0?void 0:l.getFieldValue(r)},Te=function(r,l){var x;return(x=S.current)===null||x===void 0?void 0:x.setFieldValue(r,l)};return(0,o.useEffect)(function(){var F,r,l=(F=S.current)===null||F===void 0?void 0:F.getFieldValue("platform");return(0,a.request)((r="/api/carry/group_selects?chat_id="+n.data.chat_id+"&platform="+l)!==null&&r!==void 0?r:"").then(function(x){if(x.data){var Ie;d(x.data.bots_id),Ce(x.data.group_names),Fe(x.data.platforms),L(x.data.scripts),je(x.data.user_names);var $e=(Ie=S.current)===null||Ie===void 0?void 0:Ie.getFieldValue("bots_id");(!$e||!$e.length)&&x.data.bots_id.length&&Te("bots_id",[x.data.bots_id[0]])}}),function(){}},[ee]),(0,e.jsx)(j.Z,{title:n.data.id==0?"\u521B\u5EFA":"\u7F16\u8F91",open:!0,onCancel:n.onCancel,onOk:function(){var r;n.onFinish(S==null||(r=S.current)===null||r===void 0?void 0:r.getFieldsValue())},children:(0,e.jsxs)(Q.A,{formRef:S,onValuesChange:function(r){if(r.platform){var l;oe(!ee),S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({bots_id:[]})}"out"in r&&ge(r.out),r.allowed&&he(r.allowed)},onFinish:n.onFinish,submitter:!1,children:[(0,e.jsx)(R.Z,{tooltip:"\u7CFB\u7EDF\u552F\u4E00\u4E0D\u53EF\u66F4\u6539\uFF0C\u53EA\u80FD\u5220\u9664\u3002",name:"chat_id",initialValue:n.data.chat_id,label:"\u7FA4\u7EC4ID",disabled:n.data.id!=0,required:!0,fieldProps:{showSearch:!0,onSearch:function(r){(0,a.request)("/api/nickname/labels?gkeyword="+r).then(function(l){l&&l.data&&Ve(l.data)})},onChange:function(r){if(Se)for(var l in Se){var x=Se[l];x.value==r&&(Te("chat_name",x.chat_name),x.platform!=!Oe("platform")&&(Te("platform",x.platform),oe(!ee)))}},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null},options:Se}),(0,e.jsxs)(Q.A.Group,{children:[(0,e.jsx)(q.Z,{name:"remark",initialValue:n.data.remark,label:"\u7FA4\u7EC4\u5907\u6CE8",rules:[{message:"\u8BF7\u586B\u5199\u7FA4\u5907\u6CE8"}]}),(0,e.jsx)(q.Z,{name:"chat_name",initialValue:n.data.chat_name,label:"\u7FA4\u540D\u79F0",disabled:!0})]}),(0,e.jsxs)(Q.A.Group,{children:[(0,e.jsx)(R.Z,{tooltip:"\u5E73\u53F0\u63A5\u5165\u7CFB\u7EDF\u540E\u5C06\u81EA\u52A8\u51FA\u73B0\u5728\u5217\u8868\u4E2D\u3002",initialValue:n.data.platform,valueEnum:me.reduce(function(F,r){return F[r]=r,F},{}),name:"platform",label:"\u901A\u4FE1\u5E73\u53F0",required:!0}),(0,e.jsxs)(t.UW,{children:[(0,e.jsx)(v.Z,{name:"in",tooltip:"\u5F00\u542F\u540E\u5C06\u5728\u6B64\u7FA4\u804A\u76D1\u542C\u6D88\u606F\uFF0C\u4F46\u673A\u5668\u4EBA\u540C\u65F6\u4E0D\u518D\u56DE\u590D\u8BE5\u7FA4\u804A\u6307\u4EE4\uFF0C\u4F46\u662F\u4E0D\u5F71\u54CD\u6D88\u606F\u63A8\u9001\u3002\u5F00\u542F\u6B64\u6A21\u5F0F\u7684\u4E00\u822C\u662F\u522B\u4EBA\u7684\u7FA4\u3002",label:"\u91C7\u96C6\u6A21\u5F0F",initialValue:n.data.in}),(0,e.jsx)(v.Z,{name:"out",tooltip:"\u5F00\u542F\u540E\u5C06\u5728\u6B64\u7FA4\u8F6C\u53D1\u6D88\u606F\u3002\u5F00\u542F\u6B64\u6A21\u5F0F\u7684\u7FA4\u4E00\u822C\u662F\u81EA\u5DF1\u7684\u7FA4\u3002",label:"\u8F6C\u53D1\u6A21\u5F0F",initialValue:n.data.out})]})]}),ye&&(0,e.jsx)(R.Z,{name:"from",label:"\u91C7\u96C6\u6E90",tooltip:"\u6307\u5B9A\u8981\u8FDB\u884C\u6D88\u606F\u91C7\u96C6\u7684\u7FA4\u804A\u3002",valueEnum:xe,fieldProps:{mode:"multiple"},initialValue:(W=n.data.from)!==null&&W!==void 0?W:[]}),(0,e.jsx)(R.Z,{name:"bots_id",label:"\u5DE5\u4F5C\u673A\u5668\u4EBA",tooltip:"\u6307\u5B9A\u8981\u8FDB\u884C\u6D88\u606F\u91C7\u96C6\u548C\u8F6C\u53D1\u7684\u673A\u5668\u4EBA\uFF0C\u540C\u4E00\u6D88\u606F\u540C\u65F6\u53EA\u5141\u8BB8\u4E00\u4E2A\u673A\u5668\u4EBA\u5DE5\u4F5C\uFF0C\u5982\u679C\u6307\u5B9A\u7684\u673A\u5668\u4EBA\u79BB\u7EBF\u5219\u91C7\u7528\u5176\u4ED6\u673A\u5668\u4EBA\u9876\u4E0A\u3002\u6B64\u5916\uFF0C\u91C7\u96C6\u6A21\u5F0F\u4E2D\u53EA\u6709\u7B2C\u4E00\u4E2AID\u6709\u6548\u3002",valueEnum:g.reduce(function(F,r){return F[r]=r,F},{}),fieldProps:{mode:"multiple"},placeholder:"\u9ED8\u8BA4\u9009\u62E9\u4E00\u4E2A",initialValue:(z=n.data.bots_id)!==null&&z!==void 0?z:[]}),(0,e.jsx)(R.Z,{tooltip:"\u53EF\u4EE5\u987A\u5E8F\u901A\u8FC7\u811A\u672C\u5904\u7406\u53D1\u9001\u524D\u7684\u6D88\u606F\u3002",name:"scripts",label:"\u5904\u7406\u811A\u672C",fieldProps:{mode:"multiple"},valueEnum:m,initialValue:(H=n.data.scripts)!==null&&H!==void 0?H:[]}),(0,e.jsx)(R.Z,{name:"allowed",tooltip:"\u6B64\u5904\u586B\u767D\u540D\u5355\u7528\u6237ID\u3002\u91C7\u96C6\u7FA4\u53EA\u63A5\u6536\u6765\u81EA\u767D\u540D\u5355\u7528\u6237\u6D88\u606F\uFF0C\u8F6C\u53D1\u7FA4\u53EA\u8F6C\u53D1\u6765\u81EA\u767D\u540D\u5355\u7528\u6237\u6D88\u606F\u3002\u8BBE\u7F6E\u767D\u540D\u5355\u5C06\u5FFD\u7565\u9ED1\u540D\u5355\u3002",initialValue:n.data.allowed,label:"\u767D\u540D\u5355",fieldProps:{mode:"multiple",showSearch:!0,onSearch:function(r){(0,a.request)("/api/nickname/labels?ukeyword="+r+"&platform="+Oe("platform")).then(function(l){l&&l.data&&je(l.data)})},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null,onChange:function(r){r.length!=0?he(!1):he(!0)}},options:Me}),Pe&&(0,e.jsx)(R.Z,{name:"prohibited",initialValue:n.data.prohibited,tooltip:"\u6B64\u5904\u586B\u9ED1\u540D\u5355\u7528\u6237ID\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u9ED1\u540D\u5355\u7528\u6237\u6240\u6709\u6D88\u606F\u3002",label:"\u9ED1\u540D\u5355",fieldProps:{mode:"multiple",showSearch:!0,onSearch:function(r){(0,a.request)("/api/nickname/labels?ukeyword="+r+"&platform="+Oe("platform")).then(function(l){l&&l.data&&je(l.data)})},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null},options:Me}),(0,e.jsxs)(t.UW,{children:[(0,e.jsx)(v.Z,{name:"deduplication",tooltip:"\u5F00\u542F\u540E\u5C06\u4F1A\u5BF9\u6587\u672C\u6D88\u606F\u3001\u56FE\u6587\u6D88\u606F\u8FDB\u884C\u53BB\u91CD\uFF0C\u4E0D\u4FDD\u8BC1\u5341\u5206\u51C6\u786E\u3002",label:"\u6587\u672C\u53BB\u91CD",initialValue:n.data.deduplication}),(0,e.jsx)(v.Z,{name:"deduplication2",tooltip:"\u5F85\u5B9E\u73B0\uFF0C\u5360\u4E2A\u4F4D\u7F6E\uFF0C\u5F00\u542F\u540E\u5C06\u4F1A\u5BF9\u56FE\u7247\u6D88\u606F\u8FDB\u884C\u53BB\u91CD\uFF0C\u5BF9\u8BA1\u7B97\u673A\u6027\u80FD\u6709\u8F83\u9AD8\u8981\u6C42\u3002",label:"\u56FE\u7247\u53BB\u91CD",initialValue:n.data.deduplication2})]}),(0,e.jsx)(re.Z,{tabBarExtraContent:(0,e.jsx)(p.Z,{placement:"top",title:k,children:(0,e.jsx)(B.ZP,{children:"\u63D0\u793A"})}),onTabClick:function(r,l){de(se[r])},items:[{label:"\u5305\u542B\u8BCD",key:"include",children:(0,e.jsx)(ue,{setTags:function(r){var l;S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({include:r})},data:n.data.include})},{label:"\u6392\u9664\u8BCD",key:"exclude",children:(0,e.jsx)(ue,{setTags:function(r){var l;S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({exclude:r})},data:n.data.exclude})}]}),(0,e.jsx)(s.Z,{hidden:!0,name:"allowed",initialValue:n.data.allowed,label:"\u767D\u540D\u5355"}),(0,e.jsx)(s.Z,{hidden:!0,name:"prohibited",initialValue:n.data.prohibited,label:"\u9ED1\u540D\u5355"}),(0,e.jsx)(s.Z,{hidden:!0,name:"include",initialValue:n.data.include,label:"\u5305\u542B\u5173\u952E\u8BCD"}),(0,e.jsx)(s.Z,{hidden:!0,name:"exclude",initialValue:n.data.exclude,label:"\u6392\u9664\u5173\u952E\u8BCD"})]})},n.data.chat_id)}var y={id:-1},ie={id:0},se={include:"\u6B64\u5904\u586B\u5199\u5305\u542B\u8BCD\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u4E0D\u542B\u6709\u4EFB\u610F\u5305\u542B\u8BCD\u7684\u6D88\u606F\u3002\u652F\u6301\u6B63\u5219\uFF0C\u9700\u8981\u4F7F\u7528\u201C/\u201D\u5C06\u6B63\u5219\u8868\u8FBE\u5F0F\u5305\u8D77\u6765\u3002",exclude:"\u6B64\u5904\u586B\u5199\u6392\u9664\u8BCD\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u4EFB\u4F55\u542B\u6709\u4EFB\u610F\u6392\u9664\u8BCD\u7684\u6D88\u606F\u3002\u652F\u6301\u6B63\u5219\uFF0C\u9700\u8981\u4F7F\u7528\u201C/\u201D\u5C06\u6B63\u5219\u8868\u8FBE\u5F0F\u5305\u8D77\u6765\u3002"}},4050:function(ce,_,u){u.d(_,{Z:function(){return q}});var E=u(96157),A=u(84875),U=u.n(A),c=u(50959),T=u(85548),f=u(78862),V=u(70458);function D(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.slice(1)}var I=u(49272),Z=u(42498),M=u(97624),b=u(74074);const p=(t,v,s)=>{const a=D(s);return{[`${t.componentCls}-${v}`]:{color:t[`color${s}`],background:t[`color${a}Bg`],borderColor:t[`color${a}Border`]}}},o=t=>(0,Z.Z)(t,(v,s)=>{let{textColor:a,lightBorderColor:i,lightColor:B,darkColor:j}=s;return{[`${t.componentCls}-${v}`]:{color:a,background:B,borderColor:i,"&-inverse":{color:t.colorTextLightSolid,background:j,borderColor:j},[`&${t.componentCls}-borderless`]:{borderColor:"transparent"}}}}),e=t=>{const{paddingXXS:v,lineWidth:s,tagPaddingHorizontal:a,componentCls:i}=t,B=a-s,j=v-s;return{[i]:Object.assign(Object.assign({},(0,I.Wf)(t)),{display:"inline-block",height:"auto",marginInlineEnd:t.marginXS,paddingInline:B,fontSize:t.tagFontSize,lineHeight:`${t.tagLineHeight}px`,whiteSpace:"nowrap",background:t.tagDefaultBg,border:`${t.lineWidth}px ${t.lineType} ${t.colorBorder}`,borderRadius:t.borderRadiusSM,opacity:1,transition:`all ${t.motionDurationMid}`,textAlign:"start",[`&${i}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:t.tagDefaultColor},[`${i}-close-icon`]:{marginInlineStart:j,color:t.colorTextDescription,fontSize:t.tagIconSize,cursor:"pointer",transition:`all ${t.motionDurationMid}`,"&:hover":{color:t.colorTextHeading}},[`&${i}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${t.iconCls}-close, ${t.iconCls}-close:hover`]:{color:t.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${i}-checkable-checked):hover`]:{color:t.colorPrimary,backgroundColor:t.colorFillSecondary},"&:active, &-checked":{color:t.colorTextLightSolid},"&-checked":{backgroundColor:t.colorPrimary,"&:hover":{backgroundColor:t.colorPrimaryHover}},"&:active":{backgroundColor:t.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${t.iconCls} + span, > span + ${t.iconCls}`]:{marginInlineStart:B}}),[`${i}-borderless`]:{borderColor:"transparent",background:t.tagBorderlessBg}}};var K=(0,M.Z)("Tag",t=>{const{fontSize:v,lineHeight:s,lineWidth:a,fontSizeIcon:i}=t,B=Math.round(v*s),j=t.fontSizeSM,re=B-a*2,w=t.colorFillQuaternary,N=t.colorText,y=(0,b.TS)(t,{tagFontSize:j,tagLineHeight:re,tagDefaultBg:w,tagDefaultColor:N,tagIconSize:i-2*a,tagPaddingHorizontal:8,tagBorderlessBg:t.colorFillTertiary});return[e(y),o(y),p(y,"success","Success"),p(y,"processing","Info"),p(y,"error","Error"),p(y,"warning","Warning")]}),te=function(t,v){var s={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&v.indexOf(a)<0&&(s[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(t);i{const{prefixCls:v,className:s,checked:a,onChange:i,onClick:B}=t,j=te(t,["prefixCls","className","checked","onChange","onClick"]),{getPrefixCls:re}=c.useContext(V.E_),w=n=>{i==null||i(!a),B==null||B(n)},N=re("tag",v),[y,ie]=K(N),se=U()(N,{[`${N}-checkable`]:!0,[`${N}-checkable-checked`]:a},s,ie);return y(c.createElement("span",Object.assign({},j,{className:se,onClick:w})))},ne=function(t,v){var s={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&v.indexOf(a)<0&&(s[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(t);i{const{prefixCls:s,className:a,rootClassName:i,style:B,children:j,icon:re,color:w,onClose:N,closeIcon:y,closable:ie=!1,bordered:se=!0}=t,n=ne(t,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:W,direction:z}=c.useContext(V.E_),[H,O]=c.useState(!0);c.useEffect(()=>{"visible"in n&&O(n.visible)},[n.visible]);const G=(0,T.o2)(w)||(0,T.yT)(w),g=Object.assign({backgroundColor:w&&!G?w:void 0},B),d=W("tag",s),[h,J]=K(d),m=U()(d,{[`${d}-${w}`]:G,[`${d}-has-color`]:w&&!G,[`${d}-hidden`]:!H,[`${d}-rtl`]:z==="rtl",[`${d}-borderless`]:!se},a,i,J),L=Y=>{Y.stopPropagation(),N==null||N(Y),!Y.defaultPrevented&&O(!1)},$=c.useMemo(()=>ie?y?c.createElement("span",{className:`${d}-close-icon`,onClick:L},y):c.createElement(E.Z,{className:`${d}-close-icon`,onClick:L}):null,[ie,y,d,L]),X=typeof n.onClick=="function"||j&&j.type==="a",ee=re||null,oe=ee?c.createElement(c.Fragment,null,ee,c.createElement("span",null,j)):j,le=c.createElement("span",Object.assign({},n,{ref:v,className:m,style:g}),oe,$);return h(X?c.createElement(f.Z,null,le):le)},R=c.forwardRef(Q);R.CheckableTag=ae;var q=R}}]); diff --git a/core/admin/p__Carry__index.dfb417bd.async.js b/core/admin/p__Carry__index.dfb417bd.async.js deleted file mode 100644 index c1d3ccb..0000000 --- a/core/admin/p__Carry__index.dfb417bd.async.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[274],{59419:function(ce,L,a){var E=a(75782),A=a(58733),w=a(18518),c=a(50959),B=a(60061),f=a(72961),V=a(11527),D=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],I=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],Z=c.forwardRef(function(t,U){var te=t.fieldProps,ae=t.children,ue=t.params,re=t.proFieldProps,Q=t.mode,R=t.valueEnum,q=t.request,e=t.showSearch,v=t.options,s=(0,A.Z)(t,D),u=(0,c.useContext)(B.Z);return(0,V.jsx)(f.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,w.h)(R),request:q,params:ue,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({options:v,mode:Q,showSearch:e,getPopupContainer:u.getPopupContainer},te),ref:U,proFieldProps:re},s),{},{children:ae}))}),M=c.forwardRef(function(t,U){var te=t.fieldProps,ae=t.children,ue=t.params,re=t.proFieldProps,Q=t.mode,R=t.valueEnum,q=t.request,e=t.options,v=(0,A.Z)(t,I),s=(0,E.Z)({options:e,mode:Q||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},te),u=(0,c.useContext)(B.Z);return(0,V.jsx)(f.Z,(0,E.Z)((0,E.Z)({valueEnum:(0,w.h)(R),request:q,params:ue,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,E.Z)({getPopupContainer:u.getPopupContainer},s),ref:U,proFieldProps:re},v),{},{children:ae}))}),y=Z,m=M,o=y;o.SearchSelect=m,o.displayName="ProFormComponent",L.Z=o},40792:function(ce,L,a){var E=a(75782),A=a(58733),w=a(50959),c=a(72961),B=a(11527),f=["fieldProps","unCheckedChildren","checkedChildren","proFieldProps"],V=w.forwardRef(function(D,I){var Z=D.fieldProps,M=D.unCheckedChildren,y=D.checkedChildren,m=D.proFieldProps,o=(0,A.Z)(D,f);return(0,B.jsx)(c.Z,(0,E.Z)({valueType:"switch",fieldProps:(0,E.Z)({unCheckedChildren:M,checkedChildren:y},Z),ref:I,valuePropName:"checked",proFieldProps:m,filedConfig:{valuePropName:"checked",ignoreWidth:!0}},o))});L.Z=V},66732:function(ce,L,a){var E=a(75782),A=a(58733),w=a(50959),c=a(72961),B=a(11527),f=["fieldProps","proFieldProps"],V=["fieldProps","proFieldProps"],D="text",I=function(m){var o=m.fieldProps,t=m.proFieldProps,U=(0,A.Z)(m,f);return(0,B.jsx)(c.Z,(0,E.Z)({valueType:D,fieldProps:o,filedConfig:{valueType:D},proFieldProps:t},U))},Z=function(m){var o=m.fieldProps,t=m.proFieldProps,U=(0,A.Z)(m,V);return(0,B.jsx)(c.Z,(0,E.Z)({valueType:"password",fieldProps:o,proFieldProps:t,filedConfig:{valueType:D}},U))},M=I;M.Password=Z,M.displayName="ProFormComponent",L.Z=M},3176:function(ce,L,a){var E=a(75782),A=a(58733),w=a(50959),c=a(72961),B=a(11527),f=["fieldProps","proFieldProps"],V=function(I,Z){var M=I.fieldProps,y=I.proFieldProps,m=(0,A.Z)(I,f);return(0,B.jsx)(c.Z,(0,E.Z)({ref:Z,valueType:"textarea",fieldProps:M,proFieldProps:y},m))};L.Z=w.forwardRef(V)},7765:function(ce,L,a){a.r(L),a.d(L,{default:function(){return K}});var E=a(25359),A=a.n(E),w=a(49811),c=a.n(w),B=a(54306),f=a.n(B),V=a(93525),D=a.n(V),I=a(27693),Z=a(68243),M=a(28964),y=a(4050),m=a(31255),o=a(50959),t=a(11527);function U(r,W){var z=r.concat(W);return D()(new Set(z))}function te(r){var W,z=(0,o.useState)((W=r.data)!==null&&W!==void 0?W:[]),H=f()(z,2),T=H[0],G=H[1],F=(0,o.useState)(!1),d=f()(F,2),h=d[0],k=d[1],C=(0,o.useState)(""),_=f()(C,2),$=_[0],J=_[1],ee=(0,o.useState)(-1),oe=f()(ee,2),le=oe[0],Y=oe[1],xe=(0,o.useState)(""),pe=f()(xe,2),me=pe[0],fe=pe[1],Ce=(0,o.useRef)(null),ge=(0,o.useRef)(null);(0,o.useEffect)(function(){if(h){var p;(p=Ce.current)===null||p===void 0||p.focus()}},[h]),(0,o.useEffect)(function(){var p;(p=ge.current)===null||p===void 0||p.focus()},[$]);var Ae=function(P){var X=T.filter(function(de){return de!==P});console.log(X),G(X),r.setTags(X)},Ee=function(){k(!0)},be=function(P){J(P.target.value)},Fe=function(){if($&&T.indexOf($)===-1){var P=$.trim().split(/\s+/),X=U(T,P);G(X),r.setTags(X)}k(!1),J("")},ye=function(P){fe(P.target.value)},he=function(){var P=D()(T);P[le]=me,G(P),r.setTags(P),Y(-1),J("")},Pe={width:78,verticalAlign:"top"},ve={borderStyle:"dashed"};return(0,t.jsxs)(Z.Z,{size:[0,8],wrap:!0,children:[(0,t.jsx)(Z.Z,{size:[0,8],wrap:!0,children:T.map(function(p,P){if(le===P)return(0,t.jsx)(M.Z,{ref:ge,size:"small",style:Pe,value:me,onChange:ye,onBlur:he,onPressEnter:he},p);var X=p.length>20,de=(0,t.jsx)(y.Z,{closable:!0,style:{userSelect:"none"},onClose:function(){return Ae(p)},children:(0,t.jsx)("span",{onDoubleClick:function(De){P!==0&&(Y(P),fe(p),De.preventDefault())},children:X?"".concat(p.slice(0,20),"..."):p})},p);return X?(0,t.jsx)(m.Z,{title:p,children:de},p):de})}),h?(0,t.jsx)(M.Z,{ref:Ce,type:"text",size:"small",style:Pe,value:$,onChange:be,onBlur:Fe,onPressEnter:Fe}):(0,t.jsxs)(y.Z,{style:ve,onClick:Ee,children:[(0,t.jsx)(I.Z,{}),"\u589E\u52A0"]})]})}var ae=te,ue=a(12472),re=a(61643),Q=a(81308),R=a(59419),q=a(66732),e=a(24176),v=a(40792),s=a(3176),u=a(86195),i=a(833),j=a(26572),O=a(79112),ne=a(53315),K=function(){var r=(0,o.useRef)(),W=(0,o.useState)(b),z=f()(W,2),H=z[0],T=z[1],G=[{title:"\u7F16\u53F7",dataIndex:"id",key:"id"},{title:"\u7FA4\u7EC4ID",dataIndex:"chat_id",key:"chat_id"},{title:"\u7FA4\u540D",dataIndex:"chat_name",key:"chat_name"},{title:"\u5E73\u53F0",dataIndex:"platform",key:"platform",render:function(d,h){return(0,t.jsx)(y.Z,{color:"purple",children:d})}},{title:"\u6A21\u5F0F",dataIndex:"in",key:"in",render:function(d,h){return(0,t.jsxs)(Z.Z,{size:[0,8],wrap:!0,children:[h.in&&(0,t.jsx)(y.Z,{color:"blue",children:"\u91C7\u96C6"}),h.out&&(0,t.jsx)(y.Z,{color:"geekblue",children:"\u8F6C\u53D1"})]})}},{title:"\u5907\u6CE8",dataIndex:"remark",key:"remark"},{title:"\u521B\u5EFA\u65E5\u671F",dataIndex:"created_at",key:"created_at",render:function(d,h){return(0,t.jsx)("span",{children:new Date(d*1e3).toLocaleDateString()})}},{title:"\u542F\u7528",dataIndex:"enable",key:"enable",renderFormItem:function(){return(0,t.jsx)(i.Z,{disabled:!0,defaultChecked:!1})},render:function(d,h){return(0,t.jsx)(i.Z,{onChange:function(C){(0,u.request)("/api/carry/group",{method:"post",data:JSON.stringify({chat_id:h.chat_id,enable:C})})},defaultChecked:h==null?void 0:h.enable})}},{title:"\u64CD\u4F5C",valueType:"option",width:"10%",render:function(d,h){return[(0,t.jsx)("a",{onClick:function(){return T(h)},children:"\u7F16\u8F91"},"more"),(0,t.jsx)("a",{onClick:function(){var C,_;(0,u.request)("/api/carry/group",{method:"delete",data:JSON.stringify({chat_id:h.chat_id})}),(C=r.current)===null||C===void 0||(_=C.reloadAndRest)===null||_===void 0||_.call(C)},children:"\u5220\u9664"},"delete")]}}];return(0,t.jsxs)(ue._z,{content:"\u642C\u8FD0\u7FA4\u7EC4",children:[(0,t.jsx)(Z.Z,{style:{marginBottom:10},children:(0,t.jsx)(j.ZP,{type:"primary",onClick:function(){T(ie)},icon:(0,t.jsx)(I.Z,{}),children:"\u65B0\u5EFA\u4E00\u884C"})}),(0,t.jsx)(re.Z,{search:!1,actionRef:r,rowKey:function(d){return d.chat_id},columns:G,request:c()(A()().mark(function F(){var d,h=arguments;return A()().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return d=h.length>0&&h[0]!==void 0?h[0]:{},C.abrupt("return",(0,u.request)("/api/carry/groups",{params:d}));case 2:case"end":return C.stop()}},F)}))}),H.id!=-1&&(0,t.jsx)(N,{open:H.id!=-1,data:H,onCancel:function(){return T(b)},onFinish:function(){var F=c()(A()().mark(function d(h){return A()().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:(0,u.request)("/api/carry/group",{method:"post",data:JSON.stringify(h)}).then(function(_){var $,J;($=r.current)===null||$===void 0||(J=$.reloadAndRest)===null||J===void 0||J.call($),T(b)});case 1:case"end":return C.stop()}},d)}));return function(d){return F.apply(this,arguments)}}()})]})};function N(r){var W,z,H,T=(0,o.useState)([]),G=f()(T,2),F=G[0],d=G[1],h=(0,o.useState)({}),k=f()(h,2),C=k[0],_=k[1],$=(0,o.useState)(!1),J=f()($,2),ee=J[0],oe=J[1],le=(0,o.useState)({}),Y=f()(le,2),xe=Y[0],pe=Y[1],me=(0,o.useState)([]),fe=f()(me,2),Ce=fe[0],ge=fe[1],Ae=(0,o.useState)(r.data.out),Ee=f()(Ae,2),be=Ee[0],Fe=Ee[1],ye=(0,o.useState)(r.data.allowed.length==0),he=f()(ye,2),Pe=he[0],ve=he[1],p=(0,o.useState)(se.allowed),P=f()(p,2),X=P[0],de=P[1],je=(0,o.useState)([]),De=f()(je,2),Se=De[0],Ve=De[1],We=(0,o.useState)([]),Ze=f()(We,2),Me=Ze[0],Oe=Ze[1],_e=(0,o.useState)([]),Re=f()(_e,2),Le=Re[0],we=Re[1],S=(0,o.useRef)(),Te=function(n){var l;return(l=S.current)===null||l===void 0?void 0:l.getFieldValue(n)},Be=function(n,l){var x;return(x=S.current)===null||x===void 0?void 0:x.setFieldValue(n,l)};return(0,o.useEffect)(function(){var g,n,l=(g=S.current)===null||g===void 0?void 0:g.getFieldValue("platform");return(0,u.request)((n="/api/carry/group_selects?chat_id="+r.data.chat_id+"&platform="+l)!==null&&n!==void 0?n:"").then(function(x){if(x.data){var Ie;d(x.data.bots_id),pe(x.data.group_names),ge(x.data.platforms),_(x.data.scripts),Oe(x.data.user_names);var $e=(Ie=S.current)===null||Ie===void 0?void 0:Ie.getFieldValue("bots_id");(!$e||!$e.length)&&x.data.bots_id.length&&Be("bots_id",[x.data.bots_id[0]])}}),function(){}},[ee]),(0,t.jsx)(O.Z,{title:r.data.id==0?"\u521B\u5EFA":"\u7F16\u8F91",open:!0,onCancel:r.onCancel,onOk:function(){var n;r.onFinish(S==null||(n=S.current)===null||n===void 0?void 0:n.getFieldsValue())},children:(0,t.jsxs)(Q.A,{formRef:S,onValuesChange:function(n){if(n.platform){var l;oe(!ee),S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({bots_id:[]})}"out"in n&&Fe(n.out),n.allowed&&ve(n.allowed)},onFinish:r.onFinish,submitter:!1,children:[(0,t.jsx)(R.Z,{tooltip:"\u7CFB\u7EDF\u552F\u4E00\u4E0D\u53EF\u66F4\u6539\uFF0C\u53EA\u80FD\u5220\u9664\u3002",name:"chat_id",initialValue:r.data.chat_id,label:"\u7FA4\u7EC4ID",disabled:r.data.id!=0,required:!0,fieldProps:{showSearch:!0,onSearch:function(n){(0,u.request)("/api/nickname/labels?gkeyword="+n).then(function(l){l&&l.data&&Ve(l.data)})},onChange:function(n){if(Se)for(var l in Se){var x=Se[l];x.value==n&&(Be("chat_name",x.chat_name),x.platform!=!Te("platform")&&(Be("platform",x.platform),oe(!ee)))}},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null},options:Se}),(0,t.jsxs)(Q.A.Group,{children:[(0,t.jsx)(q.Z,{name:"remark",initialValue:r.data.remark,label:"\u7FA4\u7EC4\u5907\u6CE8",rules:[{message:"\u8BF7\u586B\u5199\u7FA4\u5907\u6CE8"}]}),(0,t.jsx)(q.Z,{name:"chat_name",initialValue:r.data.chat_name,label:"\u7FA4\u540D\u79F0",disabled:!0})]}),(0,t.jsxs)(Q.A.Group,{children:[(0,t.jsx)(R.Z,{tooltip:"\u5E73\u53F0\u63A5\u5165\u7CFB\u7EDF\u540E\u5C06\u81EA\u52A8\u51FA\u73B0\u5728\u5217\u8868\u4E2D\u3002",initialValue:r.data.platform,valueEnum:Ce.reduce(function(g,n){return g[n]=n,g},{}),name:"platform",label:"\u901A\u4FE1\u5E73\u53F0",required:!0}),(0,t.jsxs)(e.UW,{children:[(0,t.jsx)(v.Z,{name:"in",tooltip:"\u5F00\u542F\u540E\u5C06\u5728\u6B64\u7FA4\u804A\u76D1\u542C\u6D88\u606F\uFF0C\u4F46\u673A\u5668\u4EBA\u540C\u65F6\u4E0D\u518D\u56DE\u590D\u8BE5\u7FA4\u804A\u6307\u4EE4\uFF0C\u4F46\u662F\u4E0D\u5F71\u54CD\u6D88\u606F\u63A8\u9001\u3002\u5F00\u542F\u6B64\u6A21\u5F0F\u7684\u4E00\u822C\u662F\u522B\u4EBA\u7684\u7FA4\u3002",label:"\u91C7\u96C6\u6A21\u5F0F",initialValue:r.data.in}),(0,t.jsx)(v.Z,{name:"out",tooltip:"\u5F00\u542F\u540E\u5C06\u5728\u6B64\u7FA4\u8F6C\u53D1\u6D88\u606F\u3002\u5F00\u542F\u6B64\u6A21\u5F0F\u7684\u7FA4\u4E00\u822C\u662F\u81EA\u5DF1\u7684\u7FA4\u3002",label:"\u8F6C\u53D1\u6A21\u5F0F",initialValue:r.data.out})]})]}),be&&(0,t.jsx)(R.Z,{name:"from",label:"\u91C7\u96C6\u6E90",tooltip:"\u6307\u5B9A\u8981\u8FDB\u884C\u6D88\u606F\u91C7\u96C6\u7684\u7FA4\u804A\u3002",valueEnum:xe,fieldProps:{mode:"multiple"},initialValue:(W=r.data.from)!==null&&W!==void 0?W:[]}),(0,t.jsx)(R.Z,{name:"bots_id",label:"\u5DE5\u4F5C\u673A\u5668\u4EBA",tooltip:"\u6307\u5B9A\u8981\u8FDB\u884C\u6D88\u606F\u91C7\u96C6\u548C\u8F6C\u53D1\u7684\u673A\u5668\u4EBA\uFF0C\u540C\u4E00\u6D88\u606F\u540C\u65F6\u53EA\u5141\u8BB8\u4E00\u4E2A\u673A\u5668\u4EBA\u5DE5\u4F5C\uFF0C\u5982\u679C\u6307\u5B9A\u7684\u673A\u5668\u4EBA\u79BB\u7EBF\u5219\u91C7\u7528\u5176\u4ED6\u673A\u5668\u4EBA\u9876\u4E0A\u3002\u6B64\u5916\uFF0C\u91C7\u96C6\u6A21\u5F0F\u4E2D\u53EA\u6709\u7B2C\u4E00\u4E2AID\u6709\u6548\u3002",valueEnum:F.reduce(function(g,n){return g[n]=n,g},{}),fieldProps:{mode:"multiple"},placeholder:"\u9ED8\u8BA4\u9009\u62E9\u4E00\u4E2A",initialValue:(z=r.data.bots_id)!==null&&z!==void 0?z:[]}),(0,t.jsx)(R.Z,{tooltip:"\u53EF\u4EE5\u987A\u5E8F\u901A\u8FC7\u811A\u672C\u5904\u7406\u53D1\u9001\u524D\u7684\u6D88\u606F\u3002",name:"scripts",label:"\u5904\u7406\u811A\u672C",fieldProps:{mode:"multiple"},valueEnum:C,initialValue:(H=r.data.scripts)!==null&&H!==void 0?H:[]}),(0,t.jsx)(R.Z,{name:"allowed",tooltip:"\u6B64\u5904\u586B\u767D\u540D\u5355\u7528\u6237ID\u3002\u91C7\u96C6\u7FA4\u53EA\u63A5\u6536\u6765\u81EA\u767D\u540D\u5355\u7528\u6237\u6D88\u606F\uFF0C\u8F6C\u53D1\u7FA4\u53EA\u8F6C\u53D1\u6765\u81EA\u767D\u540D\u5355\u7528\u6237\u6D88\u606F\u3002\u8BBE\u7F6E\u767D\u540D\u5355\u5C06\u5FFD\u7565\u9ED1\u540D\u5355\u3002",initialValue:r.data.allowed,label:"\u767D\u540D\u5355",fieldProps:{mode:"multiple",showSearch:!0,onSearch:function(n){(0,u.request)("/api/nickname/labels?ukeyword="+n+"&platform="+Te("platform")).then(function(l){l&&l.data&&Oe(l.data)})},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null,onChange:function(n){n.length!=0?ve(!1):ve(!0)}},options:Me}),Pe&&(0,t.jsx)(R.Z,{name:"prohibited",initialValue:r.data.prohibited,tooltip:"\u6B64\u5904\u586B\u9ED1\u540D\u5355\u7528\u6237ID\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u9ED1\u540D\u5355\u7528\u6237\u6240\u6709\u6D88\u606F\u3002",label:"\u9ED1\u540D\u5355",fieldProps:{mode:"multiple",showSearch:!0,onSearch:function(n){(0,u.request)("/api/nickname/labels?ukeyword="+n+"&platform="+Te("platform")).then(function(l){l&&l.data&&Oe(l.data)})},filterOption:!1,defaultActiveFirstOption:!1,showArrow:!1,notFoundContent:null},options:Me}),(0,t.jsx)(ne.Z,{tabBarExtraContent:(0,t.jsx)(m.Z,{placement:"top",title:X,children:(0,t.jsx)(j.ZP,{children:"\u63D0\u793A"})}),onTabClick:function(n,l){de(se[n])},items:[{label:"\u5305\u542B\u8BCD",key:"include",children:(0,t.jsx)(ae,{setTags:function(n){var l;S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({include:n})},data:r.data.include})},{label:"\u6392\u9664\u8BCD",key:"exclude",children:(0,t.jsx)(ae,{setTags:function(n){var l;S==null||(l=S.current)===null||l===void 0||l.setFieldsValue({exclude:n})},data:r.data.exclude})}]}),(0,t.jsx)(s.Z,{hidden:!0,name:"allowed",initialValue:r.data.allowed,label:"\u767D\u540D\u5355"}),(0,t.jsx)(s.Z,{hidden:!0,name:"prohibited",initialValue:r.data.prohibited,label:"\u9ED1\u540D\u5355"}),(0,t.jsx)(s.Z,{hidden:!0,name:"include",initialValue:r.data.include,label:"\u5305\u542B\u5173\u952E\u8BCD"}),(0,t.jsx)(s.Z,{hidden:!0,name:"exclude",initialValue:r.data.exclude,label:"\u6392\u9664\u5173\u952E\u8BCD"})]})},r.data.chat_id)}var b={id:-1,in:!1,out:!1,allowed:[],from:[],prohibited:[],chat_id:"",chat_name:"",remark:"",platform:"",enable:!1,include:[],exclude:[],created_at:0,bots_id:[],scripts:[]},ie={id:0,in:!1,out:!1,allowed:[],from:[],prohibited:[],chat_id:"",chat_name:"",remark:"",platform:"",enable:!1,include:[],exclude:[],created_at:0,bots_id:[],scripts:[]},se={include:"\u6B64\u5904\u586B\u5199\u5305\u542B\u8BCD\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u4E0D\u542B\u6709\u4EFB\u610F\u5305\u542B\u8BCD\u7684\u6D88\u606F\u3002\u652F\u6301\u6B63\u5219\uFF0C\u9700\u8981\u4F7F\u7528\u201C/\u201D\u5C06\u6B63\u5219\u8868\u8FBE\u5F0F\u5305\u8D77\u6765\u3002",exclude:"\u6B64\u5904\u586B\u5199\u6392\u9664\u8BCD\u3002\u91C7\u96C6\u7FA4\u548C\u8F6C\u53D1\u7FA4\u5C06\u5FFD\u7565\u4EFB\u4F55\u542B\u6709\u4EFB\u610F\u6392\u9664\u8BCD\u7684\u6D88\u606F\u3002\u652F\u6301\u6B63\u5219\uFF0C\u9700\u8981\u4F7F\u7528\u201C/\u201D\u5C06\u6B63\u5219\u8868\u8FBE\u5F0F\u5305\u8D77\u6765\u3002"}},4050:function(ce,L,a){a.d(L,{Z:function(){return q}});var E=a(96157),A=a(84875),w=a.n(A),c=a(50959),B=a(85548),f=a(78862),V=a(70458);function D(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var I=a(49272),Z=a(42498),M=a(97624),y=a(74074);const m=(e,v,s)=>{const u=D(s);return{[`${e.componentCls}-${v}`]:{color:e[`color${s}`],background:e[`color${u}Bg`],borderColor:e[`color${u}Border`]}}},o=e=>(0,Z.Z)(e,(v,s)=>{let{textColor:u,lightBorderColor:i,lightColor:j,darkColor:O}=s;return{[`${e.componentCls}-${v}`]:{color:u,background:j,borderColor:i,"&-inverse":{color:e.colorTextLightSolid,background:O,borderColor:O},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),t=e=>{const{paddingXXS:v,lineWidth:s,tagPaddingHorizontal:u,componentCls:i}=e,j=u-s,O=v-s;return{[i]:Object.assign(Object.assign({},(0,I.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:j,fontSize:e.tagFontSize,lineHeight:`${e.tagLineHeight}px`,whiteSpace:"nowrap",background:e.tagDefaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",[`&${i}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.tagDefaultColor},[`${i}-close-icon`]:{marginInlineStart:O,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${i}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${i}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:j}}),[`${i}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}};var U=(0,M.Z)("Tag",e=>{const{fontSize:v,lineHeight:s,lineWidth:u,fontSizeIcon:i}=e,j=Math.round(v*s),O=e.fontSizeSM,ne=j-u*2,K=e.colorFillQuaternary,N=e.colorText,b=(0,y.TS)(e,{tagFontSize:O,tagLineHeight:ne,tagDefaultBg:K,tagDefaultColor:N,tagIconSize:i-2*u,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[t(b),o(b),m(b,"success","Success"),m(b,"processing","Info"),m(b,"error","Error"),m(b,"warning","Warning")]}),te=function(e,v){var s={};for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&v.indexOf(u)<0&&(s[u]=e[u]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,u=Object.getOwnPropertySymbols(e);i{const{prefixCls:v,className:s,checked:u,onChange:i,onClick:j}=e,O=te(e,["prefixCls","className","checked","onChange","onClick"]),{getPrefixCls:ne}=c.useContext(V.E_),K=r=>{i==null||i(!u),j==null||j(r)},N=ne("tag",v),[b,ie]=U(N),se=w()(N,{[`${N}-checkable`]:!0,[`${N}-checkable-checked`]:u},s,ie);return b(c.createElement("span",Object.assign({},O,{className:se,onClick:K})))},re=function(e,v){var s={};for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&v.indexOf(u)<0&&(s[u]=e[u]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,u=Object.getOwnPropertySymbols(e);i{const{prefixCls:s,className:u,rootClassName:i,style:j,children:O,icon:ne,color:K,onClose:N,closeIcon:b,closable:ie=!1,bordered:se=!0}=e,r=re(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:W,direction:z}=c.useContext(V.E_),[H,T]=c.useState(!0);c.useEffect(()=>{"visible"in r&&T(r.visible)},[r.visible]);const G=(0,B.o2)(K)||(0,B.yT)(K),F=Object.assign({backgroundColor:K&&!G?K:void 0},j),d=W("tag",s),[h,k]=U(d),C=w()(d,{[`${d}-${K}`]:G,[`${d}-has-color`]:K&&!G,[`${d}-hidden`]:!H,[`${d}-rtl`]:z==="rtl",[`${d}-borderless`]:!se},u,i,k),_=Y=>{Y.stopPropagation(),N==null||N(Y),!Y.defaultPrevented&&T(!1)},$=c.useMemo(()=>ie?b?c.createElement("span",{className:`${d}-close-icon`,onClick:_},b):c.createElement(E.Z,{className:`${d}-close-icon`,onClick:_}):null,[ie,b,d,_]),J=typeof r.onClick=="function"||O&&O.type==="a",ee=ne||null,oe=ee?c.createElement(c.Fragment,null,ee,c.createElement("span",null,O)):O,le=c.createElement("span",Object.assign({},r,{ref:v,className:C,style:F}),oe,$);return h(J?c.createElement(f.Z,null,le):le)},R=c.forwardRef(Q);R.CheckableTag=ue;var q=R}}]); diff --git a/core/admin/umi.c0e983ad.js b/core/admin/umi.1e8ac0f4.js similarity index 99% rename from core/admin/umi.c0e983ad.js rename to core/admin/umi.1e8ac0f4.js index 63df6b4..91057eb 100644 --- a/core/admin/umi.c0e983ad.js +++ b/core/admin/umi.1e8ac0f4.js @@ -287,6 +287,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(c){return n(c)||i(c)||(0,l.Z)(c)||r()}},34242:function(h,y,e){"use strict";e.d(y,{Z:function(){return i}});var o=e(82604);function n(l,r){if((0,o.Z)(l)!=="object"||l===null)return l;var f=l[Symbol.toPrimitive];if(f!==void 0){var c=f.call(l,r||"default");if((0,o.Z)(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(l)}function i(l){var r=n(l,"string");return(0,o.Z)(r)==="symbol"?r:String(r)}},82604:function(h,y,e){"use strict";e.d(y,{Z:function(){return o}});function o(n){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},o(n)}},7979:function(h,y,e){"use strict";e.d(y,{Z:function(){return n}});var o=e(45725);function n(i,l){if(i){if(typeof i=="string")return(0,o.Z)(i,l);var r=Object.prototype.toString.call(i).slice(8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Array.from(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return(0,o.Z)(i,l)}}},8681:function(h,y,e){"use strict";e.d(y,{Z:function(){return o}});function o(n,i){(i==null||i>n.length)&&(i=n.length);for(var l=0,r=new Array(i);l=i.length?{done:!0}:{done:!1,value:i[f++]}},e:function(g){throw g},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u=!0,d=!1,m;return{s:function(){r=r.call(i)},n:function(){var g=r.next();return u=g.done,g},e:function(g){d=!0,m=g},f:function(){try{!u&&r.return!=null&&r.return()}finally{if(d)throw m}}}}},76614:function(h,y,e){"use strict";e.d(y,{Z:function(){return f}});function o(c){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(d){return d.__proto__||Object.getPrototypeOf(d)},o(c)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}var i=e(26143),l=e(60790);function r(c,u){if(u&&((0,i.Z)(u)==="object"||typeof u=="function"))return u;if(u!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(0,l.Z)(c)}function f(c){var u=n();return function(){var m=o(c),b;if(u){var g=o(this).constructor;b=Reflect.construct(m,arguments,g)}else b=m.apply(this,arguments);return r(this,b)}}},24572:function(h,y,e){"use strict";e.d(y,{Z:function(){return n}});var o=e(1536);function n(i,l,r){return l=(0,o.Z)(l),l in i?Object.defineProperty(i,l,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[l]=r,i}},51163:function(h,y,e){"use strict";e.d(y,{Z:function(){return o}});function o(){return o=Object.assign?Object.assign.bind():function(n){for(var i=1;i=0)&&(r[c]=i[c]);return r}function n(i,l){if(i==null)return{};var r=o(i,l),f,c;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(i);for(c=0;c=0)&&Object.prototype.propertyIsEnumerable.call(i,f)&&(r[f]=i[f])}return r}},99932:function(h,y,e){"use strict";e.d(y,{Z:function(){return n}});var o=e(26143);function n(){"use strict";n=function(){return i};var i={},l=Object.prototype,r=l.hasOwnProperty,f=Object.defineProperty||function(F,D,w){F[D]=w.value},c=typeof Symbol=="function"?Symbol:{},u=c.iterator||"@@iterator",d=c.asyncIterator||"@@asyncIterator",m=c.toStringTag||"@@toStringTag";function b(F,D,w){return Object.defineProperty(F,D,{value:w,enumerable:!0,configurable:!0,writable:!0}),F[D]}try{b({},"")}catch(F){b=function(w,k,U){return w[k]=U}}function g(F,D,w,k){var U=D&&D.prototype instanceof M?D:M,Z=Object.create(U.prototype),J=new ne(k||[]);return f(Z,"_invoke",{value:V(F,w,J)}),Z}function x(F,D,w){try{return{type:"normal",arg:F.call(D,w)}}catch(k){return{type:"throw",arg:k}}}i.wrap=g;var T={};function M(){}function L(){}function $(){}var O={};b(O,u,function(){return this});var N=Object.getPrototypeOf,j=N&&N(N(oe([])));j&&j!==l&&r.call(j,u)&&(O=j);var I=$.prototype=M.prototype=Object.create(O);function R(F){["next","throw","return"].forEach(function(D){b(F,D,function(w){return this._invoke(D,w)})})}function A(F,D){function w(U,Z,J,ue){var Fe=x(F[U],F,Z);if(Fe.type!=="throw"){var be=Fe.arg,we=be.value;return we&&(0,o.Z)(we)=="object"&&r.call(we,"__await")?D.resolve(we.__await).then(function(De){w("next",De,J,ue)},function(De){w("throw",De,J,ue)}):D.resolve(we).then(function(De){be.value=De,J(be)},function(De){return w("throw",De,J,ue)})}ue(Fe.arg)}var k;f(this,"_invoke",{value:function(Z,J){function ue(){return new D(function(Fe,be){w(Z,J,Fe,be)})}return k=k?k.then(ue,ue):ue()}})}function V(F,D,w){var k="suspendedStart";return function(U,Z){if(k==="executing")throw new Error("Generator is already running");if(k==="completed"){if(U==="throw")throw Z;return _()}for(w.method=U,w.arg=Z;;){var J=w.delegate;if(J){var ue=H(J,w);if(ue){if(ue===T)continue;return ue}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(k==="suspendedStart")throw k="completed",w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);k="executing";var Fe=x(F,D,w);if(Fe.type==="normal"){if(k=w.done?"completed":"suspendedYield",Fe.arg===T)continue;return{value:Fe.arg,done:w.done}}Fe.type==="throw"&&(k="completed",w.method="throw",w.arg=Fe.arg)}}}function H(F,D){var w=D.method,k=F.iterator[w];if(k===void 0)return D.delegate=null,w==="throw"&&F.iterator.return&&(D.method="return",D.arg=void 0,H(F,D),D.method==="throw")||w!=="return"&&(D.method="throw",D.arg=new TypeError("The iterator does not provide a '"+w+"' method")),T;var U=x(k,F.iterator,D.arg);if(U.type==="throw")return D.method="throw",D.arg=U.arg,D.delegate=null,T;var Z=U.arg;return Z?Z.done?(D[F.resultName]=Z.value,D.next=F.nextLoc,D.method!=="return"&&(D.method="next",D.arg=void 0),D.delegate=null,T):Z:(D.method="throw",D.arg=new TypeError("iterator result is not an object"),D.delegate=null,T)}function G(F){var D={tryLoc:F[0]};1 in F&&(D.catchLoc=F[1]),2 in F&&(D.finallyLoc=F[2],D.afterLoc=F[3]),this.tryEntries.push(D)}function K(F){var D=F.completion||{};D.type="normal",delete D.arg,F.completion=D}function ne(F){this.tryEntries=[{tryLoc:"root"}],F.forEach(G,this),this.reset(!0)}function oe(F){if(F){var D=F[u];if(D)return D.call(F);if(typeof F.next=="function")return F;if(!isNaN(F.length)){var w=-1,k=function U(){for(;++w=0;--U){var Z=this.tryEntries[U],J=Z.completion;if(Z.tryLoc==="root")return k("end");if(Z.tryLoc<=this.prev){var ue=r.call(Z,"catchLoc"),Fe=r.call(Z,"finallyLoc");if(ue&&Fe){if(this.prev=0;--k){var U=this.tryEntries[k];if(U.tryLoc<=this.prev&&r.call(U,"finallyLoc")&&this.prev=0;--w){var k=this.tryEntries[w];if(k.finallyLoc===D)return this.complete(k.completion,k.afterLoc),K(k),T}},catch:function(D){for(var w=this.tryEntries.length-1;w>=0;--w){var k=this.tryEntries[w];if(k.tryLoc===D){var U=k.completion;if(U.type==="throw"){var Z=U.arg;K(k)}return Z}}throw new Error("illegal catch attempt")},delegateYield:function(D,w,k){return this.delegate={iterator:oe(D),resultName:w,nextLoc:k},this.method==="next"&&(this.arg=void 0),T}},i}},91600:function(h,y,e){"use strict";e.d(y,{Z:function(){return r}});var o=e(20533);function n(f,c){var u=f==null?null:typeof Symbol!="undefined"&&f[Symbol.iterator]||f["@@iterator"];if(u!=null){var d,m,b,g,x=[],T=!0,M=!1;try{if(b=(u=u.call(f)).next,c===0){if(Object(u)!==u)return;T=!1}else for(;!(T=(d=b.call(u)).done)&&(x.push(d.value),x.length!==c);T=!0);}catch(L){M=!0,m=L}finally{try{if(!T&&u.return!=null&&(g=u.return(),Object(g)!==g))return}finally{if(M)throw m}}return x}}var i=e(22266),l=e(71885);function r(f,c){return(0,o.Z)(f)||n(f,c)||(0,i.Z)(f,c)||(0,l.Z)()}},9942:function(h,y,e){"use strict";e.d(y,{Z:function(){return r}});var o=e(20533),n=e(52987),i=e(22266),l=e(71885);function r(f){return(0,o.Z)(f)||(0,n.Z)(f)||(0,i.Z)(f)||(0,l.Z)()}},49544:function(h,y,e){"use strict";e.d(y,{Z:function(){return f}});var o=e(8681);function n(c){if(Array.isArray(c))return(0,o.Z)(c)}var i=e(52987),l=e(22266);function r(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(c){return n(c)||(0,i.Z)(c)||(0,l.Z)(c)||r()}},1536:function(h,y,e){"use strict";e.d(y,{Z:function(){return i}});var o=e(26143);function n(l,r){if((0,o.Z)(l)!=="object"||l===null)return l;var f=l[Symbol.toPrimitive];if(f!==void 0){var c=f.call(l,r||"default");if((0,o.Z)(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(l)}function i(l){var r=n(l,"string");return(0,o.Z)(r)==="symbol"?r:String(r)}},26143:function(h,y,e){"use strict";e.d(y,{Z:function(){return o}});function o(n){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},o(n)}},22266:function(h,y,e){"use strict";e.d(y,{Z:function(){return n}});var o=e(8681);function n(i,l){if(i){if(typeof i=="string")return(0,o.Z)(i,l);var r=Object.prototype.toString.call(i).slice(8,-1);if(r==="Object"&&i.constructor&&(r=i.constructor.name),r==="Map"||r==="Set")return Array.from(i);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return(0,o.Z)(i,l)}}},71448:function(h,y,e){"use strict";e.d(y,{Ab:function(){return l},Fr:function(){return r},G$:function(){return i},K$:function(){return d},MS:function(){return o},h5:function(){return f},lK:function(){return M},uj:function(){return n}});var o="-ms-",n="-moz-",i="-webkit-",l="comm",r="rule",f="decl",c="@page",u="@media",d="@import",m="@charset",b="@viewport",g="@supports",x="@document",T="@namespace",M="@keyframes",L="@font-face",$="@counter-style",O="@font-feature-values"},42727:function(h,y,e){"use strict";e.d(y,{MY:function(){return l}});var o=e(71448),n=e(22697),i=e(97765);function l(d){return(0,i.cE)(r("",null,null,null,[""],d=(0,i.un)(d),0,[0],d))}function r(d,m,b,g,x,T,M,L,$){for(var O=0,N=0,j=M,I=0,R=0,A=0,V=1,H=1,G=1,K=0,ne="",oe=x,_=T,F=g,D=ne;H;)switch(A=K,K=(0,i.lp)()){case 40:if(A!=108&&(0,n.uO)(D,j-1)==58){(0,n.Cw)(D+=(0,n.gx)((0,i.iF)(K),"&","&\f"),"&\f")!=-1&&(G=-1);break}case 34:case 39:case 91:D+=(0,i.iF)(K);break;case 9:case 10:case 13:case 32:D+=(0,i.Qb)(A);break;case 92:D+=(0,i.kq)((0,i.Ud)()-1,7);continue;case 47:switch((0,i.fj)()){case 42:case 47:(0,n.R3)(c((0,i.q6)((0,i.lp)(),(0,i.Ud)()),m,b),$);break;default:D+="/"}break;case 123*V:L[O++]=(0,n.to)(D)*G;case 125*V:case 59:case 0:switch(K){case 0:case 125:H=0;case 59+N:R>0&&(0,n.to)(D)-j&&(0,n.R3)(R>32?u(D+";",g,b,j-1):u((0,n.gx)(D," ","")+";",g,b,j-2),$);break;case 59:D+=";";default:if((0,n.R3)(F=f(D,m,b,O,N,x,L,ne,oe=[],_=[],j),T),K===123)if(N===0)r(D,m,F,F,oe,T,j,L,_);else switch(I===99&&(0,n.uO)(D,3)===110?100:I){case 100:case 109:case 115:r(d,F,F,g&&(0,n.R3)(f(d,F,F,0,0,x,L,ne,x,oe=[],j),_),x,_,j,L,g?oe:_);break;default:r(D,F,F,F,[""],_,0,L,_)}}O=N=R=0,V=G=1,ne=D="",j=M;break;case 58:j=1+(0,n.to)(D),R=A;default:if(V<1){if(K==123)--V;else if(K==125&&V++==0&&(0,i.mp)()==125)continue}switch(D+=(0,n.Dp)(K),K*V){case 38:G=N>0?1:(D+="\f",-1);break;case 44:L[O++]=((0,n.to)(D)-1)*G,G=1;break;case 64:(0,i.fj)()===45&&(D+=(0,i.iF)((0,i.lp)())),I=(0,i.fj)(),N=j=(0,n.to)(ne=D+=(0,i.QU)((0,i.Ud)())),K++;break;case 45:A===45&&(0,n.to)(D)==2&&(V=0)}}return T}function f(d,m,b,g,x,T,M,L,$,O,N){for(var j=x-1,I=x===0?T:[""],R=(0,n.Ei)(I),A=0,V=0,H=0;A0?I[G]+" "+K:(0,n.gx)(K,/&\f/g,I[G])))&&($[H++]=ne);return(0,i.dH)(d,m,b,x===0?o.Fr:L,$,O,N)}function c(d,m,b){return(0,i.dH)(d,m,b,o.Ab,(0,n.Dp)((0,i.Tb)()),(0,n.tb)(d,2,-2),0)}function u(d,m,b,g){return(0,i.dH)(d,m,b,o.h5,(0,n.tb)(d,0,g),(0,n.tb)(d,g+1,-1),g)}},90137:function(h,y,e){"use strict";e.d(y,{P:function(){return l},q:function(){return i}});var o=e(71448),n=e(22697);function i(r,f){for(var c="",u=(0,n.Ei)(r),d=0;d0?(0,o.uO)(c,--r):0,i--,f===10&&(i=1,n--),f}function g(){return f=r2||L(f)>3?"":" "}function R(K){for(;g();)switch(L(f)){case 0:append(G(r-1),K);break;case 2:append(N(f),K);break;default:append(from(f),K)}return K}function A(K,ne){for(;--ne&&g()&&!(f<48||f>102||f>57&&f<65||f>70&&f<97););return M(K,T()+(ne<6&&x()==32&&g()==32))}function V(K){for(;g();)switch(f){case K:return r;case 34:case 39:K!==34&&K!==39&&V(f);break;case 40:K===41&&V(K);break;case 92:g();break}return r}function H(K,ne){for(;g()&&K+f!==57;)if(K+f===84&&x()===47)break;return"/*"+M(ne,r-1)+"*"+(0,o.Dp)(K===47?K:g())}function G(K){for(;!L(x());)g();return M(K,r)}},22697:function(h,y,e){"use strict";e.d(y,{$e:function(){return T},Cw:function(){return u},Dp:function(){return n},EQ:function(){return f},Ei:function(){return g},R3:function(){return x},Wn:function(){return o},f0:function(){return i},fy:function(){return r},gx:function(){return c},tb:function(){return m},to:function(){return b},uO:function(){return d},vp:function(){return l}});var o=Math.abs,n=String.fromCharCode,i=Object.assign;function l(M,L){return d(M,0)^45?(((L<<2^d(M,0))<<2^d(M,1))<<2^d(M,2))<<2^d(M,3):0}function r(M){return M.trim()}function f(M,L){return(M=L.exec(M))?M[0]:M}function c(M,L,$){return M.replace(L,$)}function u(M,L){return M.indexOf(L)}function d(M,L){return M.charCodeAt(L)|0}function m(M,L,$){return M.slice(L,$)}function b(M){return M.length}function g(M){return M.length}function x(M,L){return L.push(M),M}function T(M,L){return M.map(L).join("")}},94083:function(h,y,e){"use strict";e.d(y,{J$:function(){return Je},ZP:function(){return _e},kY:function(){return Q}});var o=e(50959),n=e(4322);const i=new WeakMap,l={},r={},f=()=>{},c=f(),u=Object,d=Ze=>Ze===c,m=Ze=>typeof Ze=="function",b=(Ze,vt)=>Kp(Kp({},Ze),vt),g="undefined",x=typeof window!=g,T=typeof document!=g,M=()=>x&&typeof window.requestAnimationFrame!=g,L=(Ze,vt)=>{const wt=i.get(Ze);return[()=>Ze.get(vt)||l,me=>{if(!d(vt)){const We=Ze.get(vt);vt in r||(r[vt]=We),wt[5](vt,b(We,me),We||l)}},wt[6],()=>!d(vt)&&vt in r?r[vt]:Ze.get(vt)||l]},$=new WeakMap;let O=0;const N=Ze=>{const vt=typeof Ze,wt=Ze&&Ze.constructor,me=wt==Date;let We,Ke;if(u(Ze)===Ze&&!me&&wt!=RegExp){if(We=$.get(Ze),We)return We;if(We=++O+"~",$.set(Ze,We),wt==Array){for(We="@",Ke=0;Kej,[R,A]=x&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[f,f],V=()=>{const Ze=T&&document.visibilityState;return d(Ze)||Ze!=="hidden"},H=Ze=>(T&&document.addEventListener("visibilitychange",Ze),R("focus",Ze),()=>{T&&document.removeEventListener("visibilitychange",Ze),A("focus",Ze)}),G=Ze=>{const vt=()=>{j=!0,Ze()},wt=()=>{j=!1};return R("online",vt),R("offline",wt),()=>{A("online",vt),A("offline",wt)}},K={isOnline:I,isVisible:V},ne={initFocus:H,initReconnect:G},oe=!o.useId,_=!x||"Deno"in window,F=Ze=>M()?window.requestAnimationFrame(Ze):setTimeout(Ze,1),D=_?o.useEffect:o.useLayoutEffect,w=typeof navigator!="undefined"&&navigator.connection,k=!_&&w&&(["slow-2g","2g"].includes(w.effectiveType)||w.saveData),U=Ze=>{if(m(Ze))try{Ze=Ze()}catch(wt){Ze=""}const vt=Ze;return Ze=typeof Ze=="string"?Ze:(Array.isArray(Ze)?Ze.length:Ze)?N(Ze):"",[Ze,vt]};let Z=0;const J=()=>++Z,ue=0,Fe=1,be=2;var we={__proto__:null,FOCUS_EVENT:ue,RECONNECT_EVENT:Fe,MUTATE_EVENT:be};function De(...Ze){return Dv(this,null,function*(){const[vt,wt,me,We]=Ze,Ke=b({populateCache:!0,throwOnError:!0},typeof We=="boolean"?{revalidate:We}:We||{});let mt=Ke.populateCache;const Ot=Ke.rollbackOnError;let Ut=Ke.optimisticData;const cn=Ke.revalidate!==!1,Ne=nt=>typeof Ot=="function"?Ot(nt):Ot!==!1,Me=Ke.throwOnError;if(m(wt)){const nt=wt,Mt=[],Lt=vt.keys();for(let Ct=Lt.next();!Ct.done;Ct=Lt.next()){const fn=Ct.value;!fn.startsWith("$inf$")&&nt(vt.get(fn)._k)&&Mt.push(fn)}return Promise.all(Mt.map(at))}return at(wt);function at(nt){return Dv(this,null,function*(){const[Mt]=U(nt);if(!Mt)return;const[Lt,Ct]=L(vt,Mt),[fn,zn,Mn]=i.get(vt),Tn=fn[Mt],or=()=>cn&&(delete Mn[Mt],Tn&&Tn[0])?Tn[0](be).then(()=>Lt().data):Lt().data;if(Ze.length<3)return or();let Qn=me,In;const Dn=J();zn[Mt]=[Dn,0];const $t=!d(Ut),kt=Lt(),jt=kt.data,Jt=kt._c,pn=d(Jt)?jt:Jt;if($t&&(Ut=m(Ut)?Ut(pn):Ut,Ct({data:Ut,_c:pn})),m(Qn))try{Qn=Qn(pn)}catch(bn){In=bn}if(Qn&&m(Qn.then))if(Qn=yield Qn.catch(bn=>{In=bn}),Dn!==zn[Mt][0]){if(In)throw In;return Qn}else In&&$t&&Ne(In)&&(mt=!0,Qn=pn,Ct({data:Qn,_c:c}));mt&&(In||(m(mt)&&(Qn=mt(Qn,pn)),Ct({data:Qn,_c:c}))),zn[Mt][1]=J();const Fn=yield or();if(Ct({_c:c}),In){if(Me)throw In;return}return mt?Fn:Qn})}})}const He=(Ze,vt)=>{for(const wt in Ze)Ze[wt][0]&&Ze[wt][0](vt)},Ve=(Ze,vt)=>{if(!i.has(Ze)){const wt=b(ne,vt),me={},We=De.bind(c,Ze);let Ke=f;const mt={},Ot=(Ne,Me)=>{const at=mt[Ne]||[];return mt[Ne]=at,at.push(Me),()=>at.splice(at.indexOf(Me),1)},Ut=(Ne,Me,at)=>{Ze.set(Ne,Me);const nt=mt[Ne];if(nt)for(let Mt=nt.length;Mt--;)nt[Mt](Me,at)},cn=()=>{if(!i.has(Ze)&&(i.set(Ze,[me,{},{},{},We,Ut,Ot]),!_)){const Ne=wt.initFocus(setTimeout.bind(c,He.bind(c,me,ue))),Me=wt.initReconnect(setTimeout.bind(c,He.bind(c,me,Fe)));Ke=()=>{Ne&&Ne(),Me&&Me(),i.delete(Ze)}}};return cn(),[Ze,We,cn,Ke]}return[Ze,i.get(Ze)[4]]},Ie=(Ze,vt,wt,me,We)=>{const Ke=wt.errorRetryCount,mt=We.retryCount,Ot=~~((Math.random()+.5)*(1<<(mt<8?mt:8)))*wt.errorRetryInterval;!d(Ke)&&mt>Ke||setTimeout(me,Ot,We)},Le=(Ze,vt)=>N(Ze)==N(vt),[dt,St]=Ve(new Map),ht=b({onLoadingSlow:f,onSuccess:f,onError:f,onErrorRetry:Ie,onDiscarded:f,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:k?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:k?5e3:3e3,compare:Le,isPaused:()=>!1,cache:dt,mutate:St,fallback:{}},K),pt=(Ze,vt)=>{const wt=b(Ze,vt);if(vt){const{use:me,fallback:We}=Ze,{use:Ke,fallback:mt}=vt;me&&Ke&&(wt.use=me.concat(Ke)),We&&mt&&(wt.fallback=b(We,mt))}return wt},Rt=(0,o.createContext)({}),q=Ze=>{const{value:vt}=Ze,wt=(0,o.useContext)(Rt),me=m(vt),We=(0,o.useMemo)(()=>me?vt(wt):vt,[me,wt,vt]),Ke=(0,o.useMemo)(()=>me?We:pt(wt,We),[me,wt,We]),mt=We&&We.provider,[Ot]=(0,o.useState)(()=>mt?Ve(mt(Ke.cache||dt),We):c);return Ot&&(Ke.cache=Ot[0],Ke.mutate=Ot[1]),D(()=>{if(Ot)return Ot[2]&&Ot[2](),Ot[3]},[]),(0,o.createElement)(Rt.Provider,b(Ze,{value:Ke}))},B=x&&window.__SWR_DEVTOOLS_USE__,S=B?window.__SWR_DEVTOOLS_USE__:[],C=()=>{B&&(window.__SWR_DEVTOOLS_REACT__=o)},Y=Ze=>m(Ze[1])?[Ze[0],Ze[1],Ze[2]||{}]:[Ze[0],null,(Ze[1]===null?Ze[2]:Ze[1])||{}],Q=()=>b(ht,(0,o.useContext)(Rt)),se=(Ze,vt)=>{const wt=U(Ze)[0],[,,,me]=i.get(dt);if(me[wt])return me[wt];const We=vt(Ze);return me[wt]=We,We},ye=Ze=>(vt,wt,me)=>Ze(vt,wt&&((...Ke)=>{const mt=U(vt)[0],[,,,Ot]=i.get(dt),Ut=Ot[mt];return Ut?(delete Ot[mt],Ut):wt(...Ke)}),me),re=S.concat(ye),he=Ze=>function(...wt){const me=Q(),[We,Ke,mt]=Y(wt),Ot=pt(me,mt);let Ut=Ze;const{use:cn}=Ot,Ne=(cn||[]).concat(re);for(let Me=Ne.length;Me--;)Ut=Ne[Me](Ut);return Ut(We,Ke||Ot.fetcher||null,Ot)},ot=Ze=>{const vt=useState({})[1],wt=useRef(!1),me=useRef(Ze),We=useRef({data:!1,error:!1,isValidating:!1}),Ke=useCallback(mt=>{let Ot=!1;const Ut=me.current;for(const cn in mt){const Ne=cn;Ut[Ne]!==mt[Ne]&&(Ut[Ne]=mt[Ne],We.current[Ne]&&(Ot=!0))}Ot&&!wt.current&&(oe?vt({}):React.startTransition(()=>vt({})))},[]);return D(()=>(wt.current=!1,()=>{wt.current=!0})),[me,We.current,Ke]},Ue=(Ze,vt,wt)=>{const me=vt[Ze]||(vt[Ze]=[]);return me.push(wt),()=>{const We=me.indexOf(wt);We>=0&&(me[We]=me[me.length-1],me.pop())}},Se=(Ze,vt)=>(...wt)=>{const[me,We,Ke]=Y(wt),mt=(Ke.use||[]).concat(vt);return Ze(me,We,KC(Kp({},Ke),{use:mt}))};C();const tt={dedupe:!0},yt=(Ze,vt,wt)=>{const{cache:me,compare:We,suspense:Ke,fallbackData:mt,revalidateOnMount:Ot,revalidateIfStale:Ut,refreshInterval:cn,refreshWhenHidden:Ne,refreshWhenOffline:Me,keepPreviousData:at}=wt,[nt,Mt,Lt]=i.get(me),[Ct,fn]=U(Ze),zn=(0,o.useRef)(!1),Mn=(0,o.useRef)(!1),Tn=(0,o.useRef)(Ct),or=(0,o.useRef)(vt),Qn=(0,o.useRef)(wt),In=()=>Qn.current,Dn=()=>In().isVisible()&&In().isOnline(),[$t,kt,jt,Jt]=L(me,Ct),pn=(0,o.useRef)({}).current,Fn=d(mt)?wt.fallback[Ct]:mt,bn=(_n,tr)=>{let Tr=!0;for(const Ir in pn){const Sr=Ir;Sr==="data"?We(tr[Sr],_n[Sr])||d(_n[Sr])&&We(tr[Sr],er)||(Tr=!1):tr[Sr]!==_n[Sr]&&(Tr=!1)}return Tr},Zn=(0,o.useMemo)(()=>{const _n=(()=>!Ct||!vt?!1:d(Ot)?In().isPaused()||Ke?!1:d(Ut)?!0:Ut:Ot)(),tr=Sr=>{const rt=b(Sr);return delete rt._k,_n?Kp({isValidating:!0,isLoading:!0},rt):rt};let Tr=tr($t());const Ir=tr(Jt());return[()=>{const Sr=tr($t());return bn(Sr,Tr)?Tr:Tr=Sr},()=>Ir]},[me,Ct]),Jn=(0,n.useSyncExternalStore)((0,o.useCallback)(_n=>jt(Ct,(tr,Tr)=>{bn(Tr,tr)||_n()}),[me,Ct]),Zn[0],Zn[1]),sr=!zn.current,br=nt[Ct]&&nt[Ct].length>0,Or=Jn.data,ur=d(Or)?Fn:Or,cr=Jn.error,Pr=(0,o.useRef)(ur),er=at?d(Or)?Pr.current:Or:ur,Sa=(()=>br&&!d(cr)?!1:sr&&!d(Ot)?Ot:In().isPaused()?!1:Ke?d(ur)?!1:Ut:d(ur)||Ut)(),ya=!!(Ct&&vt&&sr&&Sa),Pa=d(Jn.isValidating)?ya:Jn.isValidating,$a=d(Jn.isLoading)?ya:Jn.isLoading,fa=(0,o.useCallback)(_n=>Dv(this,null,function*(){const tr=or.current;if(!Ct||!tr||Mn.current||In().isPaused())return!1;let Tr,Ir,Sr=!0;const rt=_n||{},Xe=!Lt[Ct]||!rt.dedupe,ut=()=>oe?!Mn.current&&Ct===Tn.current&&zn.current:Ct===Tn.current,st={isValidating:!1,isLoading:!1},It=()=>{kt(st)},Ye=()=>{const le=Lt[Ct];le&&le[1]===Ir&&delete Lt[Ct]},ve={isValidating:!0};d($t().data)&&(ve.isLoading=!0);try{if(Xe&&(kt(ve),wt.loadingTimeout&&d($t().data)&&setTimeout(()=>{Sr&&ut()&&In().onLoadingSlow(Ct,wt)},wt.loadingTimeout),Lt[Ct]=[tr(fn),J()]),[Tr,Ir]=Lt[Ct],Tr=yield Tr,Xe&&setTimeout(Ye,wt.dedupingInterval),!Lt[Ct]||Lt[Ct][1]!==Ir)return Xe&&ut()&&In().onDiscarded(Ct),!1;st.error=c;const le=Mt[Ct];if(!d(le)&&(Ir<=le[0]||Ir<=le[1]||le[1]===0))return It(),Xe&&ut()&&In().onDiscarded(Ct),!1;const Ee=$t().data;st.data=We(Ee,Tr)?Ee:Tr,Xe&&ut()&&In().onSuccess(Tr,Ct,wt)}catch(le){Ye();const Ee=In(),{shouldRetryOnError:de}=Ee;Ee.isPaused()||(st.error=le,Xe&&ut()&&(Ee.onError(le,Ct,Ee),(de===!0||m(de)&&de(le))&&Dn()&&Ee.onErrorRetry(le,Ct,Ee,fa,{retryCount:(rt.retryCount||0)+1,dedupe:!0})))}return Sr=!1,It(),!0}),[Ct,me]),nr=(0,o.useCallback)((..._n)=>De(me,Tn.current,..._n),[]);if(D(()=>{or.current=vt,Qn.current=wt,d(Or)||(Pr.current=Or)}),D(()=>{if(!Ct)return;const _n=fa.bind(c,tt);let tr=0;const Ir=Ue(Ct,nt,Sr=>{if(Sr==we.FOCUS_EVENT){const rt=Date.now();In().revalidateOnFocus&&rt>tr&&Dn()&&(tr=rt+In().focusThrottleInterval,_n())}else if(Sr==we.RECONNECT_EVENT)In().revalidateOnReconnect&&Dn()&&_n();else if(Sr==we.MUTATE_EVENT)return fa()});return Mn.current=!1,Tn.current=Ct,zn.current=!0,kt({_k:fn}),Sa&&(d(ur)||_?_n():F(_n)),()=>{Mn.current=!0,Ir()}},[Ct]),D(()=>{let _n;function tr(){const Ir=m(cn)?cn(ur):cn;Ir&&_n!==-1&&(_n=setTimeout(Tr,Ir))}function Tr(){!$t().error&&(Ne||In().isVisible())&&(Me||In().isOnline())?fa(tt).then(tr):tr()}return tr(),()=>{_n&&(clearTimeout(_n),_n=-1)}},[cn,Ne,Me,Ct]),(0,o.useDebugValue)(er),Ke&&d(ur)&&Ct)throw!oe&&_?new Error("Fallback data is required when using suspense in SSR."):(or.current=vt,Qn.current=wt,Mn.current=!1,d(cr)?fa(tt):cr);return{mutate:nr,get data(){return pn.data=!0,er},get error(){return pn.error=!0,cr},get isValidating(){return pn.isValidating=!0,Pa},get isLoading(){return pn.isLoading=!0,$a}}},Je=u.defineProperty(q,"defaultValue",{value:ht}),Nt=Ze=>serialize(Ze)[0];var _e=he(yt)}},Ls={};function fe(h){var y=Ls[h];if(y!==void 0)return y.exports;var e=Ls[h]={id:h,loaded:!1,exports:{}};return yl[h].call(e.exports,e,e.exports,fe),e.loaded=!0,e.exports}fe.m=yl,function(){fe.n=function(h){var y=h&&h.__esModule?function(){return h.default}:function(){return h};return fe.d(y,{a:y}),y}}(),function(){var h=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},y;fe.t=function(e,o){if(o&1&&(e=this(e)),o&8||typeof e=="object"&&e&&(o&4&&e.__esModule||o&16&&typeof e.then=="function"))return e;var n=Object.create(null);fe.r(n);var i={};y=y||[null,h({}),h([]),h(h)];for(var l=o&2&&e;typeof l=="object"&&!~y.indexOf(l);l=h(l))Object.getOwnPropertyNames(l).forEach(function(r){i[r]=function(){return e[r]}});return i.default=function(){return e},fe.d(n,i),n}}(),function(){fe.d=function(h,y){for(var e in y)fe.o(y,e)&&!fe.o(h,e)&&Object.defineProperty(h,e,{enumerable:!0,get:y[e]})}}(),function(){fe.f={},fe.e=function(h){return Promise.all(Object.keys(fe.f).reduce(function(y,e){return fe.f[e](h,y),y},[]))}}(),function(){fe.u=function(h){return""+({81:"p__Message__Noreply__index",96:"p__Plugin__Share__index",145:"p__Plugin__Subscribe__index",185:"p__Welcome",274:"p__Carry__index",294:"p__Basic__index",301:"t__plugin-layout__Layout",354:"p__Storage__index",366:"p__User__Login__index",398:"p__Script__index",402:"p__Reply__index",430:"p__Master__index",538:"p__Message__Private__index",571:"p__404",583:"p__Proxy__index",737:"p__Plugin__Publish__index",929:"p__Secret__Fenyong__index",966:"p__Message__Listen__index"}[h]||h)+"."+{54:"698cd806",81:"21ff9f2d",96:"81ec9e1e",118:"99dbea07",145:"694c5bee",164:"339064d0",185:"31f51469",273:"3dfaac85",274:"dfb417bd",294:"a03f98fd",301:"f972cb61",315:"ca5fa681",354:"31101d21",361:"a6a74763",366:"a85e5196",398:"0e7dfab6",402:"c1b22478",430:"efad6296",454:"045543df",472:"ccfb3d48",538:"d005e661",571:"7e3f819c",583:"0a9790e6",630:"42a3526e",643:"eb5ab551",650:"6dec3238",737:"3b4ea689",845:"1f162f9a",852:"e34fba04",929:"809c357f",964:"43acb396",966:"5377170b",989:"2d9cc9ce"}[h]+".async.js"}}(),function(){fe.miniCssF=function(h){return"t__plugin-layout__Layout.74b4118c.chunk.css"}}(),function(){fe.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(h){if(typeof window=="object")return window}}()}(),function(){fe.o=function(h,y){return Object.prototype.hasOwnProperty.call(h,y)}}(),function(){var h={},y="ant-design-pro:";fe.l=function(e,o,n,i){if(h[e]){h[e].push(o);return}var l,r;if(n!==void 0)for(var f=document.getElementsByTagName("script"),c=0;c0&&(0,n.to)(D)-j&&(0,n.R3)(R>32?u(D+";",g,b,j-1):u((0,n.gx)(D," ","")+";",g,b,j-2),$);break;case 59:D+=";";default:if((0,n.R3)(F=f(D,m,b,O,N,x,L,ne,oe=[],_=[],j),T),K===123)if(N===0)r(D,m,F,F,oe,T,j,L,_);else switch(I===99&&(0,n.uO)(D,3)===110?100:I){case 100:case 109:case 115:r(d,F,F,g&&(0,n.R3)(f(d,F,F,0,0,x,L,ne,x,oe=[],j),_),x,_,j,L,g?oe:_);break;default:r(D,F,F,F,[""],_,0,L,_)}}O=N=R=0,V=G=1,ne=D="",j=M;break;case 58:j=1+(0,n.to)(D),R=A;default:if(V<1){if(K==123)--V;else if(K==125&&V++==0&&(0,i.mp)()==125)continue}switch(D+=(0,n.Dp)(K),K*V){case 38:G=N>0?1:(D+="\f",-1);break;case 44:L[O++]=((0,n.to)(D)-1)*G,G=1;break;case 64:(0,i.fj)()===45&&(D+=(0,i.iF)((0,i.lp)())),I=(0,i.fj)(),N=j=(0,n.to)(ne=D+=(0,i.QU)((0,i.Ud)())),K++;break;case 45:A===45&&(0,n.to)(D)==2&&(V=0)}}return T}function f(d,m,b,g,x,T,M,L,$,O,N){for(var j=x-1,I=x===0?T:[""],R=(0,n.Ei)(I),A=0,V=0,H=0;A0?I[G]+" "+K:(0,n.gx)(K,/&\f/g,I[G])))&&($[H++]=ne);return(0,i.dH)(d,m,b,x===0?o.Fr:L,$,O,N)}function c(d,m,b){return(0,i.dH)(d,m,b,o.Ab,(0,n.Dp)((0,i.Tb)()),(0,n.tb)(d,2,-2),0)}function u(d,m,b,g){return(0,i.dH)(d,m,b,o.h5,(0,n.tb)(d,0,g),(0,n.tb)(d,g+1,-1),g)}},90137:function(h,y,e){"use strict";e.d(y,{P:function(){return l},q:function(){return i}});var o=e(71448),n=e(22697);function i(r,f){for(var c="",u=(0,n.Ei)(r),d=0;d0?(0,o.uO)(c,--r):0,i--,f===10&&(i=1,n--),f}function g(){return f=r2||L(f)>3?"":" "}function R(K){for(;g();)switch(L(f)){case 0:append(G(r-1),K);break;case 2:append(N(f),K);break;default:append(from(f),K)}return K}function A(K,ne){for(;--ne&&g()&&!(f<48||f>102||f>57&&f<65||f>70&&f<97););return M(K,T()+(ne<6&&x()==32&&g()==32))}function V(K){for(;g();)switch(f){case K:return r;case 34:case 39:K!==34&&K!==39&&V(f);break;case 40:K===41&&V(K);break;case 92:g();break}return r}function H(K,ne){for(;g()&&K+f!==57;)if(K+f===84&&x()===47)break;return"/*"+M(ne,r-1)+"*"+(0,o.Dp)(K===47?K:g())}function G(K){for(;!L(x());)g();return M(K,r)}},22697:function(h,y,e){"use strict";e.d(y,{$e:function(){return T},Cw:function(){return u},Dp:function(){return n},EQ:function(){return f},Ei:function(){return g},R3:function(){return x},Wn:function(){return o},f0:function(){return i},fy:function(){return r},gx:function(){return c},tb:function(){return m},to:function(){return b},uO:function(){return d},vp:function(){return l}});var o=Math.abs,n=String.fromCharCode,i=Object.assign;function l(M,L){return d(M,0)^45?(((L<<2^d(M,0))<<2^d(M,1))<<2^d(M,2))<<2^d(M,3):0}function r(M){return M.trim()}function f(M,L){return(M=L.exec(M))?M[0]:M}function c(M,L,$){return M.replace(L,$)}function u(M,L){return M.indexOf(L)}function d(M,L){return M.charCodeAt(L)|0}function m(M,L,$){return M.slice(L,$)}function b(M){return M.length}function g(M){return M.length}function x(M,L){return L.push(M),M}function T(M,L){return M.map(L).join("")}},94083:function(h,y,e){"use strict";e.d(y,{J$:function(){return Je},ZP:function(){return _e},kY:function(){return Q}});var o=e(50959),n=e(4322);const i=new WeakMap,l={},r={},f=()=>{},c=f(),u=Object,d=Ze=>Ze===c,m=Ze=>typeof Ze=="function",b=(Ze,vt)=>Kp(Kp({},Ze),vt),g="undefined",x=typeof window!=g,T=typeof document!=g,M=()=>x&&typeof window.requestAnimationFrame!=g,L=(Ze,vt)=>{const wt=i.get(Ze);return[()=>Ze.get(vt)||l,me=>{if(!d(vt)){const We=Ze.get(vt);vt in r||(r[vt]=We),wt[5](vt,b(We,me),We||l)}},wt[6],()=>!d(vt)&&vt in r?r[vt]:Ze.get(vt)||l]},$=new WeakMap;let O=0;const N=Ze=>{const vt=typeof Ze,wt=Ze&&Ze.constructor,me=wt==Date;let We,Ke;if(u(Ze)===Ze&&!me&&wt!=RegExp){if(We=$.get(Ze),We)return We;if(We=++O+"~",$.set(Ze,We),wt==Array){for(We="@",Ke=0;Kej,[R,A]=x&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[f,f],V=()=>{const Ze=T&&document.visibilityState;return d(Ze)||Ze!=="hidden"},H=Ze=>(T&&document.addEventListener("visibilitychange",Ze),R("focus",Ze),()=>{T&&document.removeEventListener("visibilitychange",Ze),A("focus",Ze)}),G=Ze=>{const vt=()=>{j=!0,Ze()},wt=()=>{j=!1};return R("online",vt),R("offline",wt),()=>{A("online",vt),A("offline",wt)}},K={isOnline:I,isVisible:V},ne={initFocus:H,initReconnect:G},oe=!o.useId,_=!x||"Deno"in window,F=Ze=>M()?window.requestAnimationFrame(Ze):setTimeout(Ze,1),D=_?o.useEffect:o.useLayoutEffect,w=typeof navigator!="undefined"&&navigator.connection,k=!_&&w&&(["slow-2g","2g"].includes(w.effectiveType)||w.saveData),U=Ze=>{if(m(Ze))try{Ze=Ze()}catch(wt){Ze=""}const vt=Ze;return Ze=typeof Ze=="string"?Ze:(Array.isArray(Ze)?Ze.length:Ze)?N(Ze):"",[Ze,vt]};let Z=0;const J=()=>++Z,ue=0,Fe=1,be=2;var we={__proto__:null,FOCUS_EVENT:ue,RECONNECT_EVENT:Fe,MUTATE_EVENT:be};function De(...Ze){return Dv(this,null,function*(){const[vt,wt,me,We]=Ze,Ke=b({populateCache:!0,throwOnError:!0},typeof We=="boolean"?{revalidate:We}:We||{});let mt=Ke.populateCache;const Ot=Ke.rollbackOnError;let Ut=Ke.optimisticData;const cn=Ke.revalidate!==!1,Ne=nt=>typeof Ot=="function"?Ot(nt):Ot!==!1,Me=Ke.throwOnError;if(m(wt)){const nt=wt,Mt=[],Lt=vt.keys();for(let Ct=Lt.next();!Ct.done;Ct=Lt.next()){const fn=Ct.value;!fn.startsWith("$inf$")&&nt(vt.get(fn)._k)&&Mt.push(fn)}return Promise.all(Mt.map(at))}return at(wt);function at(nt){return Dv(this,null,function*(){const[Mt]=U(nt);if(!Mt)return;const[Lt,Ct]=L(vt,Mt),[fn,zn,Mn]=i.get(vt),Tn=fn[Mt],or=()=>cn&&(delete Mn[Mt],Tn&&Tn[0])?Tn[0](be).then(()=>Lt().data):Lt().data;if(Ze.length<3)return or();let Qn=me,In;const Dn=J();zn[Mt]=[Dn,0];const $t=!d(Ut),kt=Lt(),jt=kt.data,Jt=kt._c,pn=d(Jt)?jt:Jt;if($t&&(Ut=m(Ut)?Ut(pn):Ut,Ct({data:Ut,_c:pn})),m(Qn))try{Qn=Qn(pn)}catch(bn){In=bn}if(Qn&&m(Qn.then))if(Qn=yield Qn.catch(bn=>{In=bn}),Dn!==zn[Mt][0]){if(In)throw In;return Qn}else In&&$t&&Ne(In)&&(mt=!0,Qn=pn,Ct({data:Qn,_c:c}));mt&&(In||(m(mt)&&(Qn=mt(Qn,pn)),Ct({data:Qn,_c:c}))),zn[Mt][1]=J();const Fn=yield or();if(Ct({_c:c}),In){if(Me)throw In;return}return mt?Fn:Qn})}})}const He=(Ze,vt)=>{for(const wt in Ze)Ze[wt][0]&&Ze[wt][0](vt)},Ve=(Ze,vt)=>{if(!i.has(Ze)){const wt=b(ne,vt),me={},We=De.bind(c,Ze);let Ke=f;const mt={},Ot=(Ne,Me)=>{const at=mt[Ne]||[];return mt[Ne]=at,at.push(Me),()=>at.splice(at.indexOf(Me),1)},Ut=(Ne,Me,at)=>{Ze.set(Ne,Me);const nt=mt[Ne];if(nt)for(let Mt=nt.length;Mt--;)nt[Mt](Me,at)},cn=()=>{if(!i.has(Ze)&&(i.set(Ze,[me,{},{},{},We,Ut,Ot]),!_)){const Ne=wt.initFocus(setTimeout.bind(c,He.bind(c,me,ue))),Me=wt.initReconnect(setTimeout.bind(c,He.bind(c,me,Fe)));Ke=()=>{Ne&&Ne(),Me&&Me(),i.delete(Ze)}}};return cn(),[Ze,We,cn,Ke]}return[Ze,i.get(Ze)[4]]},Ie=(Ze,vt,wt,me,We)=>{const Ke=wt.errorRetryCount,mt=We.retryCount,Ot=~~((Math.random()+.5)*(1<<(mt<8?mt:8)))*wt.errorRetryInterval;!d(Ke)&&mt>Ke||setTimeout(me,Ot,We)},Le=(Ze,vt)=>N(Ze)==N(vt),[dt,St]=Ve(new Map),ht=b({onLoadingSlow:f,onSuccess:f,onError:f,onErrorRetry:Ie,onDiscarded:f,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:k?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:k?5e3:3e3,compare:Le,isPaused:()=>!1,cache:dt,mutate:St,fallback:{}},K),pt=(Ze,vt)=>{const wt=b(Ze,vt);if(vt){const{use:me,fallback:We}=Ze,{use:Ke,fallback:mt}=vt;me&&Ke&&(wt.use=me.concat(Ke)),We&&mt&&(wt.fallback=b(We,mt))}return wt},Rt=(0,o.createContext)({}),q=Ze=>{const{value:vt}=Ze,wt=(0,o.useContext)(Rt),me=m(vt),We=(0,o.useMemo)(()=>me?vt(wt):vt,[me,wt,vt]),Ke=(0,o.useMemo)(()=>me?We:pt(wt,We),[me,wt,We]),mt=We&&We.provider,[Ot]=(0,o.useState)(()=>mt?Ve(mt(Ke.cache||dt),We):c);return Ot&&(Ke.cache=Ot[0],Ke.mutate=Ot[1]),D(()=>{if(Ot)return Ot[2]&&Ot[2](),Ot[3]},[]),(0,o.createElement)(Rt.Provider,b(Ze,{value:Ke}))},B=x&&window.__SWR_DEVTOOLS_USE__,S=B?window.__SWR_DEVTOOLS_USE__:[],C=()=>{B&&(window.__SWR_DEVTOOLS_REACT__=o)},Y=Ze=>m(Ze[1])?[Ze[0],Ze[1],Ze[2]||{}]:[Ze[0],null,(Ze[1]===null?Ze[2]:Ze[1])||{}],Q=()=>b(ht,(0,o.useContext)(Rt)),se=(Ze,vt)=>{const wt=U(Ze)[0],[,,,me]=i.get(dt);if(me[wt])return me[wt];const We=vt(Ze);return me[wt]=We,We},ye=Ze=>(vt,wt,me)=>Ze(vt,wt&&((...Ke)=>{const mt=U(vt)[0],[,,,Ot]=i.get(dt),Ut=Ot[mt];return Ut?(delete Ot[mt],Ut):wt(...Ke)}),me),re=S.concat(ye),he=Ze=>function(...wt){const me=Q(),[We,Ke,mt]=Y(wt),Ot=pt(me,mt);let Ut=Ze;const{use:cn}=Ot,Ne=(cn||[]).concat(re);for(let Me=Ne.length;Me--;)Ut=Ne[Me](Ut);return Ut(We,Ke||Ot.fetcher||null,Ot)},ot=Ze=>{const vt=useState({})[1],wt=useRef(!1),me=useRef(Ze),We=useRef({data:!1,error:!1,isValidating:!1}),Ke=useCallback(mt=>{let Ot=!1;const Ut=me.current;for(const cn in mt){const Ne=cn;Ut[Ne]!==mt[Ne]&&(Ut[Ne]=mt[Ne],We.current[Ne]&&(Ot=!0))}Ot&&!wt.current&&(oe?vt({}):React.startTransition(()=>vt({})))},[]);return D(()=>(wt.current=!1,()=>{wt.current=!0})),[me,We.current,Ke]},Ue=(Ze,vt,wt)=>{const me=vt[Ze]||(vt[Ze]=[]);return me.push(wt),()=>{const We=me.indexOf(wt);We>=0&&(me[We]=me[me.length-1],me.pop())}},Se=(Ze,vt)=>(...wt)=>{const[me,We,Ke]=Y(wt),mt=(Ke.use||[]).concat(vt);return Ze(me,We,KC(Kp({},Ke),{use:mt}))};C();const tt={dedupe:!0},yt=(Ze,vt,wt)=>{const{cache:me,compare:We,suspense:Ke,fallbackData:mt,revalidateOnMount:Ot,revalidateIfStale:Ut,refreshInterval:cn,refreshWhenHidden:Ne,refreshWhenOffline:Me,keepPreviousData:at}=wt,[nt,Mt,Lt]=i.get(me),[Ct,fn]=U(Ze),zn=(0,o.useRef)(!1),Mn=(0,o.useRef)(!1),Tn=(0,o.useRef)(Ct),or=(0,o.useRef)(vt),Qn=(0,o.useRef)(wt),In=()=>Qn.current,Dn=()=>In().isVisible()&&In().isOnline(),[$t,kt,jt,Jt]=L(me,Ct),pn=(0,o.useRef)({}).current,Fn=d(mt)?wt.fallback[Ct]:mt,bn=(_n,tr)=>{let Tr=!0;for(const Ir in pn){const Sr=Ir;Sr==="data"?We(tr[Sr],_n[Sr])||d(_n[Sr])&&We(tr[Sr],er)||(Tr=!1):tr[Sr]!==_n[Sr]&&(Tr=!1)}return Tr},Zn=(0,o.useMemo)(()=>{const _n=(()=>!Ct||!vt?!1:d(Ot)?In().isPaused()||Ke?!1:d(Ut)?!0:Ut:Ot)(),tr=Sr=>{const rt=b(Sr);return delete rt._k,_n?Kp({isValidating:!0,isLoading:!0},rt):rt};let Tr=tr($t());const Ir=tr(Jt());return[()=>{const Sr=tr($t());return bn(Sr,Tr)?Tr:Tr=Sr},()=>Ir]},[me,Ct]),Jn=(0,n.useSyncExternalStore)((0,o.useCallback)(_n=>jt(Ct,(tr,Tr)=>{bn(Tr,tr)||_n()}),[me,Ct]),Zn[0],Zn[1]),sr=!zn.current,br=nt[Ct]&&nt[Ct].length>0,Or=Jn.data,ur=d(Or)?Fn:Or,cr=Jn.error,Pr=(0,o.useRef)(ur),er=at?d(Or)?Pr.current:Or:ur,Sa=(()=>br&&!d(cr)?!1:sr&&!d(Ot)?Ot:In().isPaused()?!1:Ke?d(ur)?!1:Ut:d(ur)||Ut)(),ya=!!(Ct&&vt&&sr&&Sa),Pa=d(Jn.isValidating)?ya:Jn.isValidating,$a=d(Jn.isLoading)?ya:Jn.isLoading,fa=(0,o.useCallback)(_n=>Dv(this,null,function*(){const tr=or.current;if(!Ct||!tr||Mn.current||In().isPaused())return!1;let Tr,Ir,Sr=!0;const rt=_n||{},Xe=!Lt[Ct]||!rt.dedupe,ut=()=>oe?!Mn.current&&Ct===Tn.current&&zn.current:Ct===Tn.current,st={isValidating:!1,isLoading:!1},It=()=>{kt(st)},Ye=()=>{const le=Lt[Ct];le&&le[1]===Ir&&delete Lt[Ct]},ve={isValidating:!0};d($t().data)&&(ve.isLoading=!0);try{if(Xe&&(kt(ve),wt.loadingTimeout&&d($t().data)&&setTimeout(()=>{Sr&&ut()&&In().onLoadingSlow(Ct,wt)},wt.loadingTimeout),Lt[Ct]=[tr(fn),J()]),[Tr,Ir]=Lt[Ct],Tr=yield Tr,Xe&&setTimeout(Ye,wt.dedupingInterval),!Lt[Ct]||Lt[Ct][1]!==Ir)return Xe&&ut()&&In().onDiscarded(Ct),!1;st.error=c;const le=Mt[Ct];if(!d(le)&&(Ir<=le[0]||Ir<=le[1]||le[1]===0))return It(),Xe&&ut()&&In().onDiscarded(Ct),!1;const Ee=$t().data;st.data=We(Ee,Tr)?Ee:Tr,Xe&&ut()&&In().onSuccess(Tr,Ct,wt)}catch(le){Ye();const Ee=In(),{shouldRetryOnError:de}=Ee;Ee.isPaused()||(st.error=le,Xe&&ut()&&(Ee.onError(le,Ct,Ee),(de===!0||m(de)&&de(le))&&Dn()&&Ee.onErrorRetry(le,Ct,Ee,fa,{retryCount:(rt.retryCount||0)+1,dedupe:!0})))}return Sr=!1,It(),!0}),[Ct,me]),nr=(0,o.useCallback)((..._n)=>De(me,Tn.current,..._n),[]);if(D(()=>{or.current=vt,Qn.current=wt,d(Or)||(Pr.current=Or)}),D(()=>{if(!Ct)return;const _n=fa.bind(c,tt);let tr=0;const Ir=Ue(Ct,nt,Sr=>{if(Sr==we.FOCUS_EVENT){const rt=Date.now();In().revalidateOnFocus&&rt>tr&&Dn()&&(tr=rt+In().focusThrottleInterval,_n())}else if(Sr==we.RECONNECT_EVENT)In().revalidateOnReconnect&&Dn()&&_n();else if(Sr==we.MUTATE_EVENT)return fa()});return Mn.current=!1,Tn.current=Ct,zn.current=!0,kt({_k:fn}),Sa&&(d(ur)||_?_n():F(_n)),()=>{Mn.current=!0,Ir()}},[Ct]),D(()=>{let _n;function tr(){const Ir=m(cn)?cn(ur):cn;Ir&&_n!==-1&&(_n=setTimeout(Tr,Ir))}function Tr(){!$t().error&&(Ne||In().isVisible())&&(Me||In().isOnline())?fa(tt).then(tr):tr()}return tr(),()=>{_n&&(clearTimeout(_n),_n=-1)}},[cn,Ne,Me,Ct]),(0,o.useDebugValue)(er),Ke&&d(ur)&&Ct)throw!oe&&_?new Error("Fallback data is required when using suspense in SSR."):(or.current=vt,Qn.current=wt,Mn.current=!1,d(cr)?fa(tt):cr);return{mutate:nr,get data(){return pn.data=!0,er},get error(){return pn.error=!0,cr},get isValidating(){return pn.isValidating=!0,Pa},get isLoading(){return pn.isLoading=!0,$a}}},Je=u.defineProperty(q,"defaultValue",{value:ht}),Nt=Ze=>serialize(Ze)[0];var _e=he(yt)}},Ls={};function fe(h){var y=Ls[h];if(y!==void 0)return y.exports;var e=Ls[h]={id:h,loaded:!1,exports:{}};return yl[h].call(e.exports,e,e.exports,fe),e.loaded=!0,e.exports}fe.m=yl,function(){fe.n=function(h){var y=h&&h.__esModule?function(){return h.default}:function(){return h};return fe.d(y,{a:y}),y}}(),function(){var h=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},y;fe.t=function(e,o){if(o&1&&(e=this(e)),o&8||typeof e=="object"&&e&&(o&4&&e.__esModule||o&16&&typeof e.then=="function"))return e;var n=Object.create(null);fe.r(n);var i={};y=y||[null,h({}),h([]),h(h)];for(var l=o&2&&e;typeof l=="object"&&!~y.indexOf(l);l=h(l))Object.getOwnPropertyNames(l).forEach(function(r){i[r]=function(){return e[r]}});return i.default=function(){return e},fe.d(n,i),n}}(),function(){fe.d=function(h,y){for(var e in y)fe.o(y,e)&&!fe.o(h,e)&&Object.defineProperty(h,e,{enumerable:!0,get:y[e]})}}(),function(){fe.f={},fe.e=function(h){return Promise.all(Object.keys(fe.f).reduce(function(y,e){return fe.f[e](h,y),y},[]))}}(),function(){fe.u=function(h){return""+({81:"p__Message__Noreply__index",96:"p__Plugin__Share__index",145:"p__Plugin__Subscribe__index",185:"p__Welcome",274:"p__Carry__index",294:"p__Basic__index",301:"t__plugin-layout__Layout",354:"p__Storage__index",366:"p__User__Login__index",398:"p__Script__index",402:"p__Reply__index",430:"p__Master__index",538:"p__Message__Private__index",571:"p__404",583:"p__Proxy__index",737:"p__Plugin__Publish__index",929:"p__Secret__Fenyong__index",966:"p__Message__Listen__index"}[h]||h)+"."+{54:"698cd806",81:"21ff9f2d",96:"81ec9e1e",118:"99dbea07",145:"694c5bee",164:"339064d0",185:"31f51469",273:"3dfaac85",274:"2bf73a4a",294:"a03f98fd",301:"f972cb61",315:"ca5fa681",354:"31101d21",361:"a6a74763",366:"a85e5196",398:"0e7dfab6",402:"c1b22478",430:"efad6296",454:"045543df",472:"ccfb3d48",538:"d005e661",571:"7e3f819c",583:"0a9790e6",630:"42a3526e",643:"eb5ab551",650:"6dec3238",737:"3b4ea689",845:"1f162f9a",852:"e34fba04",929:"809c357f",964:"43acb396",966:"5377170b",989:"2d9cc9ce"}[h]+".async.js"}}(),function(){fe.miniCssF=function(h){return"t__plugin-layout__Layout.74b4118c.chunk.css"}}(),function(){fe.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(h){if(typeof window=="object")return window}}()}(),function(){fe.o=function(h,y){return Object.prototype.hasOwnProperty.call(h,y)}}(),function(){var h={},y="ant-design-pro:";fe.l=function(e,o,n,i){if(h[e]){h[e].push(o);return}var l,r;if(n!==void 0)for(var f=document.getElementsByTagName("script"),c=0;c0})),ca=js({routesById:Sn,routeComponents:Lr,parentId:ra.id,loadingComponent:Ln.loadingComponent,reactRouter5Compat:Ln.reactRouter5Compat});return ca.length>0&&(ra.children=ca,ra.routes=ca),ra})}function bl(Ln){var Sn=(0,za.UO)(),xr=(0,wa.Z)((0,wa.Z)({},Ln),{},{to:(0,za.Gn)(Ln.to,Sn)});return qn.createElement(za.Fg,(0,jo.Z)({replace:!0},xr))}function Oa(Ln){var Sn=Ln.route,xr=Sn.redirect,Lr=(0,ao.Z)(Sn,Pi),Xr=Ln.reactRouter5Compat?Cr:Aa;return(0,wa.Z)({element:xr?qn.createElement(bl,{to:xr}):qn.createElement(si.Provider,{value:{route:Ln.route}},qn.createElement(Xr,{loader:qn.memo(Ln.routeComponent),loadingComponent:Ln.loadingComponent||Jr,hasChildren:Ln.hasChildren}))},Lr)}function Jr(){return qn.createElement("div",null)}function Cr(Ln){var Sn=Xo(),xr=Sn.route,Lr=(0,Va.Ov)(),Xr=Lr.history,ra=Lr.clientRoutes,ca=(0,za.UO)(),Ma={params:ca,isExact:!0,path:xr.path,url:Xr.location.pathname},Xa=Ln.loader;return qn.createElement(qn.Suspense,{fallback:qn.createElement(Ln.loadingComponent,null)},qn.createElement(Xa,{location:Xr.location,match:Ma,history:Xr,params:ca,route:xr,routes:ra},Ln.hasChildren&&qn.createElement(za.j3,null)))}function Aa(Ln){var Sn=Ln.loader;return qn.createElement(qn.Suspense,{fallback:qn.createElement(Ln.loadingComponent,null)},qn.createElement(Sn,null))}var Ca=null;function Vo(){return Ca}function yi(Ln){var Sn=Ln.history,xr=qn.useState({action:Sn.action,location:Sn.location}),Lr=(0,Wo.Z)(xr,2),Xr=Lr[0],ra=Lr[1];return(0,qn.useLayoutEffect)(function(){return Sn.listen(ra)},[Sn]),(0,qn.useLayoutEffect)(function(){function ca(Ma){Ln.pluginManager.applyPlugins({key:"onRouteChange",type:"event",args:{routes:Ln.routes,clientRoutes:Ln.clientRoutes,location:Ma.location,action:Ma.action,basename:Ln.basename,isFirst:Boolean(Ma.isFirst)}})}Sn.listen(ca),ca({location:Xr.location,action:Xr.action,isFirst:!0})},[Sn,Ln.routes,Ln.clientRoutes]),qn.createElement(za.F0,{navigator:Sn,location:Xr.location,basename:Ln.basename},Ln.children)}function Ui(){var Ln=(0,Va.Ov)(),Sn=Ln.clientRoutes;return(0,za.V$)(Sn)}var _i=["innerProvider","i18nProvider","accessProvider","dataflowProvider","outerProvider","rootContainer"],$o=function(Sn,xr){var Lr=Sn.basename||"/",Xr=js({routesById:Sn.routes,routeComponents:Sn.routeComponents,loadingComponent:Sn.loadingComponent,reactRouter5Compat:Sn.reactRouter5Compat});Sn.pluginManager.applyPlugins({key:"patchClientRoutes",type:"event",args:{routes:Xr}});for(var ra=qn.createElement(yi,{basename:Lr,pluginManager:Sn.pluginManager,routes:Sn.routes,clientRoutes:Xr,history:Sn.history},xr),ca=0,Ma=_i;ca 0.9 { + console.Debug("%s 忽略重复采集信息", uuid) + return nil + } + } + } + _ = q.Enqueue(&QMessage{ + UserID: user_id, + Content: content, + MessageID: message_id, + }) bots_id := GetAdapterBotsID(platform) if len(from.BotsID) == 0 && len(bots_id) != 0 { from.BotsID = bots_id @@ -187,10 +229,31 @@ func initCarry() { console.Debug("%s 指定(%s)机器人都不在线,转发群(%s)已选择其他机器人(%s)推送", uuid, platform, chat_id, adapter.botid) } if adapter != nil { - adapter.Push(map[string]string{ + //采集消息去重逻辑 + q := NewQueue(chat_id, 50) + if outs[i].Deduplication { + for _, qm := range q.GetValues() { + v := ss.HansSimilarity(qm.Content, content) + if v > 0.9 { + console.Debug("%s 忽略重复转发信息", uuid) + continue + } + } + } + qm := &QMessage{ + UserID: user_id, + Content: content, + From: s, + To: adapter, + } + _ = q.Enqueue(qm) + message_id, err := adapter.Push(map[string]string{ CONETNT: content, CHAT_ID: chat_id, }) + if err == nil { + qm.MessageID = message_id + } } } } @@ -299,27 +362,28 @@ func setCgs() { } type CarryGroup struct { - Index int `json:"id"` //编号 顺序编号 - In bool `json:"in"` //搬进来 勾选按钮 - Out bool `json:"out"` //运出去 勾选按钮 - From []string `json:"from"` //采集源 - Allowed []string `json:"allowed"` //白名单模式 - Prohibited []string `json:"prohibited"` //黑名单模式 Select选择器多选 - ID string `json:"chat_id"` //群组ID 文字表单 - ChatName string `json:"chat_name"` //群昵称 文字表单 - Remark string `json:"remark"` //备注 - Platform string `json:"platform"` //平台 Select选择器单选 - Enable bool `json:"enable"` //启用状态 开关 - Include []string `json:"include"` //包含关键词 多个关键词用逗号隔开 用户复制粘贴过去后自动转换成多彩标签 - Exclude []string `json:"exclude"` //排除关键词 包含关键词 - CreatedAt int `json:"created_at"` //创建时间戳(秒)转换成日期 - BotsID []string `json:"bots_id"` //工作机器人 多选 - Scripts []string `json:"scripts"` //处理脚本 + Index int `json:"id"` //编号 顺序编号 + In bool `json:"in"` //搬进来 勾选按钮 + Out bool `json:"out"` //运出去 勾选按钮 + From []string `json:"from"` //采集源 + Allowed []string `json:"allowed"` //白名单模式 + Prohibited []string `json:"prohibited"` //黑名单模式 Select选择器多选 + ID string `json:"chat_id"` //群组ID 文字表单 + ChatName string `json:"chat_name"` //群昵称 文字表单 + Remark string `json:"remark"` //备注 + Platform string `json:"platform"` //平台 Select选择器单选 + Enable bool `json:"enable"` //启用状态 开关 + Include []string `json:"include"` //包含关键词 多个关键词用逗号隔开 用户复制粘贴过去后自动转换成多彩标签 + Exclude []string `json:"exclude"` //排除关键词 包含关键词 + CreatedAt int `json:"created_at"` //创建时间戳(秒)转换成日期 + BotsID []string `json:"bots_id"` //工作机器人 多选 + Scripts []string `json:"scripts"` //处理脚本 + Deduplication bool `json:"deduplication"` //文本去重 + Deduplication2 bool `json:"deduplication2"` //图片去重 } // CARRY API func init() { - GinApi(GET, "/api/carry/groups", RequireAuth, func(ctx *gin.Context) { current := utils.Int(ctx.Query("current")) pageSize := utils.Int(ctx.Query("pageSize")) @@ -504,6 +568,14 @@ func init() { if out, ok := value.(bool); ok { cg.Out = out } + case "deduplication": + if deduplication, ok := value.(bool); ok { + cg.Deduplication = deduplication + } + case "deduplication2": + if deduplication, ok := value.(bool); ok { + cg.Deduplication2 = deduplication + } case "from": if from, ok := value.([]interface{}); ok { cg.From = toStringSlice(from) diff --git a/core/common/sender.go b/core/common/sender.go index 099216d..4c4d22b 100644 --- a/core/common/sender.go +++ b/core/common/sender.go @@ -50,6 +50,8 @@ type Sender interface { GetVar(string) interface{} SetLevel(int) GetLevel() int + Event() map[string]interface{} + Action(map[string]interface{}) (interface{}, string) } type FakerSenderParams struct { diff --git a/core/node_strings.go b/core/node_strings.go index 93b2d88..8ef51b7 100644 --- a/core/node_strings.go +++ b/core/node_strings.go @@ -61,11 +61,29 @@ func similarity(str1, str2 string) int { } func (sender *Strings) Similarity(str1, str2 string) float64 { + if str1 == "" || str2 == "" { + return 0 + } max := math.Max( float64(similarity(str1, str2))/float64(len(str2)), float64(similarity(str2, str1))/float64(len(str1)), ) - return max + b := float64(len(str2)) / float64(len(str1)) + if b > 1 { + b = 1 / b + } + return max * ((b + 1) / 2) +} + +func (sender *Strings) HansSimilarity(str1, str2 string) float64 { + if str1 == str2 { + return 1 + } + return sender.Similarity(str1, str2) +} + +func (sender *Strings) ExtractHans(text string) []string { + return regexp.MustCompile(`[\p{Han}]+`).FindAllString(text, -1) } func (sender *Strings) Intersect(a, b interface{}) interface{} { diff --git a/core/plugin_core.go b/core/plugin_core.go index 0ee7eaf..604b692 100644 --- a/core/plugin_core.go +++ b/core/plugin_core.go @@ -539,6 +539,7 @@ func initPlugin(data string, uuid string) (*common.Function, []func(), error) { vm.Set("message", goja.Undefined()) vm.Set("res", goja.Undefined()) vm.Set("req", goja.Undefined()) + vm.Set("action", goja.Undefined()) vm.Set("sender", ss) vm.Set("run", func(uuid string) bool { //执行子脚本 fs := Functions diff --git a/core/queue.go b/core/queue.go new file mode 100644 index 0000000..465df20 --- /dev/null +++ b/core/queue.go @@ -0,0 +1,80 @@ +package core + +import ( + "errors" + "sync" +) + +var queues sync.Map + +type Queue struct { + data []*QMessage + head int + tail int + size int + lock *sync.Mutex +} + +func NewQueue(name string, size int) *Queue { + q := &Queue{ + head: 0, + tail: 0, + size: size, + } + v, ok := queues.LoadOrStore(name, q) + if ok { + q = v.(*Queue) + } else { + q.data = make([]*QMessage, size) + q.lock = new(sync.Mutex) + } + return q +} + +func (q *Queue) Enqueue(value *QMessage) error { + q.lock.Lock() + defer q.lock.Unlock() + if q.IsFull() { + return errors.New("queue is full") + } + q.data[q.tail] = value + q.tail = (q.tail + 1) % q.size + return nil +} + +func (q *Queue) Dequeue() (*QMessage, error) { + q.lock.Lock() + defer q.lock.Unlock() + + if q.IsEmpty() { + return nil, errors.New("queue is empty") + } + value := q.data[q.head] + q.head = (q.head + 1) % q.size + + return value, nil +} + +func (q *Queue) IsEmpty() bool { + return q.head == q.tail +} + +func (q *Queue) IsFull() bool { + return (q.tail+1)%q.size == q.head +} + +func (q *Queue) Size() int { + return (q.tail - q.head + q.size) % q.size +} + +func (q *Queue) GetValues() []*QMessage { + q.lock.Lock() + defer q.lock.Unlock() + + values := make([]*QMessage, q.Size()) + for i := 0; i < q.Size(); i++ { + values[i] = q.data[(q.head+i)%q.size] + } + + return values +}