UNPKG

miraipie

Version:

the most powerful nodejs development kit for mirai-api-http

2 lines 124 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Miraipie=e():t.Miraipie=e()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";var i=n(12),r=Object.prototype.toString;function o(t){return"[object Array]"===r.call(t)}function s(t){return void 0===t}function u(t){return null!==t&&"object"==typeof t}function a(t){if("[object Object]"!==r.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===r.call(t)}function f(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.call(null,t[r],r,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===r.call(t)},isBuffer:function(t){return null!==t&&!s(t)&&null!==t.constructor&&!s(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:u,isPlainObject:a,isUndefined:s,isDate:function(t){return"[object Date]"===r.call(t)},isFile:function(t){return"[object File]"===r.call(t)},isBlob:function(t){return"[object Blob]"===r.call(t)},isFunction:c,isStream:function(t){return u(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function t(){var e={};function n(n,i){a(e[i])&&a(n)?e[i]=t(e[i],n):a(n)?e[i]=t({},n):o(n)?e[i]=n.slice():e[i]=n}for(var i=0,r=arguments.length;i<r;i++)f(arguments[i],n);return e},extend:function(t,e,n){return f(e,(function(e,r){t[r]=n&&"function"==typeof e?i(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MIRAI_API_HTTP_VERSION=e.ResponseCode=e.FaceType=void 0,function(t){t[t.JING_YA=0]="JING_YA",t[t["惊讶"]=0]="惊讶",t[t.PIE_ZUI=1]="PIE_ZUI",t[t["撇嘴"]=1]="撇嘴",t[t.SE=2]="SE",t[t["色"]=2]="色",t[t.FA_DAI=3]="FA_DAI",t[t["发呆"]=3]="发呆",t[t.DE_YI=4]="DE_YI",t[t["得意"]=4]="得意",t[t.LIU_LEI=5]="LIU_LEI",t[t["流泪"]=5]="流泪",t[t.HAI_XIU=6]="HAI_XIU",t[t["害羞"]=6]="害羞",t[t.BI_ZUI=7]="BI_ZUI",t[t["闭嘴"]=7]="闭嘴",t[t.SHUI=8]="SHUI",t[t["睡"]=8]="睡",t[t.DA_KU=9]="DA_KU",t[t["大哭"]=9]="大哭",t[t.GAN_GA=10]="GAN_GA",t[t["尴尬"]=10]="尴尬",t[t.FA_NU=11]="FA_NU",t[t["发怒"]=11]="发怒",t[t.TIAO_PI=12]="TIAO_PI",t[t["调皮"]=12]="调皮",t[t.ZI_YA=13]="ZI_YA",t[t["呲牙"]=13]="呲牙",t[t.WEI_XIAO=14]="WEI_XIAO",t[t["微笑"]=14]="微笑",t[t.NAN_GUO=15]="NAN_GUO",t[t["难过"]=15]="难过",t[t.KU=16]="KU",t[t["酷"]=16]="酷",t[t.ZHUA_KUANG=18]="ZHUA_KUANG",t[t["抓狂"]=18]="抓狂",t[t.TU=19]="TU",t[t["吐"]=19]="吐",t[t.TOU_XIAO=20]="TOU_XIAO",t[t["偷笑"]=20]="偷笑",t[t.KE_AI=21]="KE_AI",t[t["可爱"]=21]="可爱",t[t.BAI_YAN=22]="BAI_YAN",t[t["白眼"]=22]="白眼",t[t.AO_MAN=23]="AO_MAN",t[t["傲慢"]=23]="傲慢",t[t.JI_E=24]="JI_E",t[t["饥饿"]=24]="饥饿",t[t.KUN=25]="KUN",t[t["困"]=25]="困",t[t.JING_KONG=26]="JING_KONG",t[t["惊恐"]=26]="惊恐",t[t.LIU_HAN=27]="LIU_HAN",t[t["流汗"]=27]="流汗",t[t.HAN_XIAO=28]="HAN_XIAO",t[t["憨笑"]=28]="憨笑",t[t.YOU_XIAN=29]="YOU_XIAN",t[t["悠闲"]=29]="悠闲",t[t.FEN_DOU=30]="FEN_DOU",t[t["奋斗"]=30]="奋斗",t[t.ZHOU_MA=31]="ZHOU_MA",t[t["咒骂"]=31]="咒骂",t[t.YI_WEN=32]="YI_WEN",t[t["疑问"]=32]="疑问",t[t.XU=33]="XU",t[t["嘘"]=33]="嘘",t[t.YUN=34]="YUN",t[t["晕"]=34]="晕",t[t.ZHE_MO=35]="ZHE_MO",t[t["折磨"]=35]="折磨",t[t.SHUAI=36]="SHUAI",t[t["衰"]=36]="衰",t[t.KU_LOU=37]="KU_LOU",t[t["骷髅"]=37]="骷髅",t[t.QIAO_DA=38]="QIAO_DA",t[t["敲打"]=38]="敲打",t[t.ZAI_JIAN=39]="ZAI_JIAN",t[t["再见"]=39]="再见",t[t.FA_DOU=41]="FA_DOU",t[t["发抖"]=41]="发抖",t[t.AI_QING=42]="AI_QING",t[t["爱情"]=42]="爱情",t[t.TIAO_TIAO=43]="TIAO_TIAO",t[t["跳跳"]=43]="跳跳",t[t.ZHU_TOU=46]="ZHU_TOU",t[t["猪头"]=46]="猪头",t[t.YONG_BAO=49]="YONG_BAO",t[t["拥抱"]=49]="拥抱",t[t.DAN_GAO=53]="DAN_GAO",t[t["蛋糕"]=53]="蛋糕",t[t.SHAN_DIAN=54]="SHAN_DIAN",t[t["闪电"]=54]="闪电",t[t.ZHA_DAN=55]="ZHA_DAN",t[t["炸弹"]=55]="炸弹",t[t.DAO=56]="DAO",t[t["刀"]=56]="刀",t[t.ZU_QIU=57]="ZU_QIU",t[t["足球"]=57]="足球",t[t.BIAN_BIAN=59]="BIAN_BIAN",t[t["便便"]=59]="便便",t[t.KA_FEI=60]="KA_FEI",t[t["咖啡"]=60]="咖啡",t[t.FAN=61]="FAN",t[t["饭"]=61]="饭",t[t.MEI_GUI=63]="MEI_GUI",t[t["玫瑰"]=63]="玫瑰",t[t.DIAO_XIE=64]="DIAO_XIE",t[t["凋谢"]=64]="凋谢",t[t.AI_XIN=66]="AI_XIN",t[t["爱心"]=66]="爱心",t[t.XIN_SUI=67]="XIN_SUI",t[t["心碎"]=67]="心碎",t[t.LI_WU=69]="LI_WU",t[t["礼物"]=69]="礼物",t[t.TAI_YANG=74]="TAI_YANG",t[t["太阳"]=74]="太阳",t[t.YUE_LIANG=75]="YUE_LIANG",t[t["月亮"]=75]="月亮",t[t.ZAN=76]="ZAN",t[t["赞"]=76]="赞",t[t.CAI=77]="CAI",t[t["踩"]=77]="踩",t[t.WO_SHOU=78]="WO_SHOU",t[t["握手"]=78]="握手",t[t.SHENG_LI=79]="SHENG_LI",t[t["胜利"]=79]="胜利",t[t.FEI_WEN=85]="FEI_WEN",t[t["飞吻"]=85]="飞吻",t[t.OU_HUO=86]="OU_HUO",t[t["怄火"]=86]="怄火",t[t.XI_GUA=89]="XI_GUA",t[t["西瓜"]=89]="西瓜",t[t.LENG_HAN=96]="LENG_HAN",t[t["冷汗"]=96]="冷汗",t[t.CA_HAN=97]="CA_HAN",t[t["擦汗"]=97]="擦汗",t[t.KOU_BI=98]="KOU_BI",t[t["抠鼻"]=98]="抠鼻",t[t.GU_ZHANG=99]="GU_ZHANG",t[t["鼓掌"]=99]="鼓掌",t[t.QIU_DA_LE=100]="QIU_DA_LE",t[t["糗大了"]=100]="糗大了",t[t.HUAI_XIAO=101]="HUAI_XIAO",t[t["坏笑"]=101]="坏笑",t[t.ZUO_HENG_HENG=102]="ZUO_HENG_HENG",t[t["左哼哼"]=102]="左哼哼",t[t.YOU_HENG_HENG=103]="YOU_HENG_HENG",t[t["右哼哼"]=103]="右哼哼",t[t.HA_QIAN=104]="HA_QIAN",t[t["哈欠"]=104]="哈欠",t[t.BI_SHI=105]="BI_SHI",t[t["鄙视"]=105]="鄙视",t[t.WEI_QU=106]="WEI_QU",t[t["委屈"]=106]="委屈",t[t.KUAI_KU_LE=107]="KUAI_KU_LE",t[t["快哭了"]=107]="快哭了",t[t.YIN_XIAN=108]="YIN_XIAN",t[t["阴险"]=108]="阴险",t[t.QIN_QIN=109]="QIN_QIN",t[t["亲亲"]=109]="亲亲",t[t.XIA=110]="XIA",t[t["吓"]=110]="吓",t[t.KE_LIAN=111]="KE_LIAN",t[t["可怜"]=111]="可怜",t[t.CAI_DAO=112]="CAI_DAO",t[t["菜刀"]=112]="菜刀",t[t.PI_JIU=113]="PI_JIU",t[t["啤酒"]=113]="啤酒",t[t.LAN_QIU=114]="LAN_QIU",t[t["篮球"]=114]="篮球",t[t.PING_PANG=115]="PING_PANG",t[t["乒乓"]=115]="乒乓",t[t.SHI_AI=116]="SHI_AI",t[t["示爱"]=116]="示爱",t[t.PIAO_CHONG=117]="PIAO_CHONG",t[t["瓢虫"]=117]="瓢虫",t[t.BAO_QUAN=118]="BAO_QUAN",t[t["抱拳"]=118]="抱拳",t[t.GOU_YIN=119]="GOU_YIN",t[t["勾引"]=119]="勾引",t[t.QUAN_TOU=120]="QUAN_TOU",t[t["拳头"]=120]="拳头",t[t.CHA_JIN=121]="CHA_JIN",t[t["差劲"]=121]="差劲",t[t.AI_NI=122]="AI_NI",t[t["爱你"]=122]="爱你",t[t.NO=123]="NO",t[t.BU=123]="BU",t[t["不"]=123]="不",t[t.OK=124]="OK",t[t.HAO=124]="HAO",t[t["好"]=124]="好",t[t.ZHUAN_QUAN=125]="ZHUAN_QUAN",t[t["转圈"]=125]="转圈",t[t.KE_TOU=126]="KE_TOU",t[t["磕头"]=126]="磕头",t[t.HUI_TOU=127]="HUI_TOU",t[t["回头"]=127]="回头",t[t.TIAO_SHENG=128]="TIAO_SHENG",t[t["跳绳"]=128]="跳绳",t[t.HUI_SHOU=129]="HUI_SHOU",t[t["挥手"]=129]="挥手",t[t.JI_DONG=130]="JI_DONG",t[t["激动"]=130]="激动",t[t.JIE_WU=131]="JIE_WU",t[t["街舞"]=131]="街舞",t[t.XIAN_WEN=132]="XIAN_WEN",t[t["献吻"]=132]="献吻",t[t.ZUO_TAI_JI=133]="ZUO_TAI_JI",t[t["左太极"]=133]="左太极",t[t.YOU_TAI_JI=134]="YOU_TAI_JI",t[t["右太极"]=134]="右太极",t[t.SHUANG_XI=136]="SHUANG_XI",t[t["双喜"]=136]="双喜",t[t.BIAN_PAO=137]="BIAN_PAO",t[t["鞭炮"]=137]="鞭炮",t[t.DENG_LONG=138]="DENG_LONG",t[t["灯笼"]=138]="灯笼",t[t.K_GE=140]="K_GE",t[t["K歌"]=140]="K歌",t[t.HE_CAI=144]="HE_CAI",t[t["喝彩"]=144]="喝彩",t[t.QI_DAO=145]="QI_DAO",t[t["祈祷"]=145]="祈祷",t[t.BAO_JIN=146]="BAO_JIN",t[t["爆筋"]=146]="爆筋",t[t.BANG_BANG_TANG=147]="BANG_BANG_TANG",t[t["棒棒糖"]=147]="棒棒糖",t[t.HE_NAI=148]="HE_NAI",t[t["喝奶"]=148]="喝奶",t[t.FEI_JI=151]="FEI_JI",t[t["飞机"]=151]="飞机",t[t.CHAO_PIAO=158]="CHAO_PIAO",t[t["钞票"]=158]="钞票",t[t.YAO=168]="YAO",t[t["药"]=168]="药",t[t.SHOU_QIANG=169]="SHOU_QIANG",t[t["手枪"]=169]="手枪",t[t.CHA=171]="CHA",t[t["茶"]=171]="茶",t[t.ZHA_YAN_JING=172]="ZHA_YAN_JING",t[t["眨眼睛"]=172]="眨眼睛",t[t.LEI_BEN=173]="LEI_BEN",t[t["泪奔"]=173]="泪奔",t[t.WU_NAI=174]="WU_NAI",t[t["无奈"]=174]="无奈",t[t.MAI_MENG=175]="MAI_MENG",t[t["卖萌"]=175]="卖萌",t[t.XIAO_JIU_JIE=176]="XIAO_JIU_JIE",t[t["小纠结"]=176]="小纠结",t[t.PEN_XIE=177]="PEN_XIE",t[t["喷血"]=177]="喷血",t[t.XIE_YAN_XIAO=178]="XIE_YAN_XIAO",t[t["斜眼笑"]=178]="斜眼笑",t[t.doge=179]="doge",t[t.JING_XI=180]="JING_XI",t[t["惊喜"]=180]="惊喜",t[t.SAO_RAO=181]="SAO_RAO",t[t["骚扰"]=181]="骚扰",t[t.XIAO_KU=182]="XIAO_KU",t[t["笑哭"]=182]="笑哭",t[t.WO_ZUI_MEI=183]="WO_ZUI_MEI",t[t["我最美"]=183]="我最美",t[t.HE_XIE=184]="HE_XIE",t[t["河蟹"]=184]="河蟹",t[t.YANG_TUO=185]="YANG_TUO",t[t["羊驼"]=185]="羊驼",t[t.YOU_LING=187]="YOU_LING",t[t["幽灵"]=187]="幽灵",t[t.DAN=188]="DAN",t[t["蛋"]=188]="蛋",t[t.JU_HUA=190]="JU_HUA",t[t["菊花"]=190]="菊花",t[t.HONG_BAO=192]="HONG_BAO",t[t["红包"]=192]="红包",t[t.DA_XIAO=193]="DA_XIAO",t[t["大笑"]=193]="大笑",t[t.BU_KAI_XIN=194]="BU_KAI_XIN",t[t["不开心"]=194]="不开心",t[t.LENG_MO=197]="LENG_MO",t[t["冷漠"]=197]="冷漠",t[t.E=198]="E",t[t["呃"]=198]="呃",t[t.HAO_BANG=199]="HAO_BANG",t[t["好棒"]=199]="好棒",t[t.BAI_TUO=200]="BAI_TUO",t[t["拜托"]=200]="拜托",t[t.DIAN_ZAN=201]="DIAN_ZAN",t[t["点赞"]=201]="点赞",t[t.WU_LIAO=202]="WU_LIAO",t[t["无聊"]=202]="无聊",t[t.TUO_LIAN=203]="TUO_LIAN",t[t["托脸"]=203]="托脸",t[t.CHI=204]="CHI",t[t["吃"]=204]="吃",t[t.SONG_HUA=205]="SONG_HUA",t[t["送花"]=205]="送花",t[t.HAI_PA=206]="HAI_PA",t[t["害怕"]=206]="害怕",t[t.HUA_CHI=207]="HUA_CHI",t[t["花痴"]=207]="花痴",t[t.XIAO_YANG_ER=208]="XIAO_YANG_ER",t[t["小样儿"]=208]="小样儿",t[t.BIAO_LEI=210]="BIAO_LEI",t[t["飙泪"]=210]="飙泪",t[t.WO_BU_KAN=211]="WO_BU_KAN",t[t["我不看"]=211]="我不看",t[t.TUO_SAI=212]="TUO_SAI",t[t["托腮"]=212]="托腮",t[t.BO_BO=214]="BO_BO",t[t["啵啵"]=214]="啵啵",t[t.HU_LIAN=215]="HU_LIAN",t[t["糊脸"]=215]="糊脸",t[t.PAI_TOU=216]="PAI_TOU",t[t["拍头"]=216]="拍头",t[t.CHE_YI_CHE=217]="CHE_YI_CHE",t[t["扯一扯"]=217]="扯一扯",t[t.TIAN_YI_TIAN=218]="TIAN_YI_TIAN",t[t["舔一舔"]=218]="舔一舔",t[t.CENG_YI_CENG=219]="CENG_YI_CENG",t[t["蹭一蹭"]=219]="蹭一蹭",t[t.ZHUAI_ZHA_TIAN=220]="ZHUAI_ZHA_TIAN",t[t["拽炸天"]=220]="拽炸天",t[t.DING_GUA_GUA=221]="DING_GUA_GUA",t[t["顶呱呱"]=221]="顶呱呱",t[t.BAO_BAO=222]="BAO_BAO",t[t["抱抱"]=222]="抱抱",t[t.BAO_JI=223]="BAO_JI",t[t["暴击"]=223]="暴击",t[t.KAI_QIANG=224]="KAI_QIANG",t[t["开枪"]=224]="开枪",t[t.LIAO_YI_LIAO=225]="LIAO_YI_LIAO",t[t["撩一撩"]=225]="撩一撩",t[t.PAI_ZHUO=226]="PAI_ZHUO",t[t["拍桌"]=226]="拍桌",t[t.PAI_SHOU=227]="PAI_SHOU",t[t["拍手"]=227]="拍手",t[t.GONG_XI=228]="GONG_XI",t[t["恭喜"]=228]="恭喜",t[t.GAN_BEI=229]="GAN_BEI",t[t["干杯"]=229]="干杯",t[t.CHAO_FENG=230]="CHAO_FENG",t[t["嘲讽"]=230]="嘲讽",t[t.HENG=231]="HENG",t[t["哼"]=231]="哼",t[t.FO_XI=232]="FO_XI",t[t["佛系"]=232]="佛系",t[t.QIA_YI_QIA=233]="QIA_YI_QIA",t[t["掐一掐"]=233]="掐一掐",t[t.JING_DAI=234]="JING_DAI",t[t["惊呆"]=234]="惊呆",t[t.CHAN_DOU=235]="CHAN_DOU",t[t["颤抖"]=235]="颤抖",t[t.KEN_TOU=236]="KEN_TOU",t[t["啃头"]=236]="啃头",t[t.TOU_KAN=237]="TOU_KAN",t[t["偷看"]=237]="偷看",t[t.SHAN_LIAN=238]="SHAN_LIAN",t[t["扇脸"]=238]="扇脸",t[t.YUAN_LIANG=239]="YUAN_LIANG",t[t["原谅"]=239]="原谅",t[t.PEN_LIAN=240]="PEN_LIAN",t[t["喷脸"]=240]="喷脸",t[t.SHENG_RI_KUAI_LE=241]="SHENG_RI_KUAI_LE",t[t["生日快乐"]=241]="生日快乐",t[t.TOU_ZHUANG_JI=242]="TOU_ZHUANG_JI",t[t["头撞击"]=242]="头撞击",t[t.SHUAI_TOU=243]="SHUAI_TOU",t[t["甩头"]=243]="甩头",t[t.RENG_GOU=244]="RENG_GOU",t[t["扔狗"]=244]="扔狗",t[t.JIA_YOU_BI_SHENG=245]="JIA_YOU_BI_SHENG",t[t["加油必胜"]=245]="加油必胜",t[t.JIA_YOU_BAO_BAO=246]="JIA_YOU_BAO_BAO",t[t["加油抱抱"]=246]="加油抱抱",t[t.KOU_ZHAO_HU_TI=247]="KOU_ZHAO_HU_TI",t[t["口罩护体"]=247]="口罩护体",t[t.BAN_ZHUAN_ZHONG=260]="BAN_ZHUAN_ZHONG",t[t["搬砖中"]=260]="搬砖中",t[t.MANG_DAO_FEI_QI=261]="MANG_DAO_FEI_QI",t[t["忙到飞起"]=261]="忙到飞起",t[t.NAO_KUO_TENG=262]="NAO_KUO_TENG",t[t["脑阔疼"]=262]="脑阔疼",t[t.CANG_SANG=263]="CANG_SANG",t[t["沧桑"]=263]="沧桑",t[t.WU_LIAN=264]="WU_LIAN",t[t["捂脸"]=264]="捂脸",t[t.LA_YAN_JING=265]="LA_YAN_JING",t[t["辣眼睛"]=265]="辣眼睛",t[t.O_YO=266]="O_YO",t[t["哦哟"]=266]="哦哟",t[t.TOU_TU=267]="TOU_TU",t[t["头秃"]=267]="头秃",t[t.WEN_HAO_LIAN=268]="WEN_HAO_LIAN",t[t["问号脸"]=268]="问号脸",t[t.AN_ZHONG_GUAN_CHA=269]="AN_ZHONG_GUAN_CHA",t[t["暗中观察"]=269]="暗中观察",t[t.EMM=270]="EMM",t[t.emm=270]="emm",t[t.CHI_GUA=271]="CHI_GUA",t[t["吃瓜"]=271]="吃瓜",t[t.HE_HE_DA=272]="HE_HE_DA",t[t["呵呵哒"]=272]="呵呵哒",t[t.WO_SUAN_LE=273]="WO_SUAN_LE",t[t["我酸了"]=273]="我酸了",t[t.TAI_NAN_LE=274]="TAI_NAN_LE",t[t["太南了"]=274]="太南了",t[t.LA_JIAO_JIANG=276]="LA_JIAO_JIANG",t[t["辣椒酱"]=276]="辣椒酱",t[t.WANG_WANG=277]="WANG_WANG",t[t["汪汪"]=277]="汪汪",t[t.HAN=278]="HAN",t[t["汗"]=278]="汗",t[t.DA_LIAN=279]="DA_LIAN",t[t["打脸"]=279]="打脸",t[t.JI_ZHANG=280]="JI_ZHANG",t[t["击掌"]=280]="击掌",t[t.WU_YAN_XIAO=281]="WU_YAN_XIAO",t[t["无眼笑"]=281]="无眼笑",t[t.JING_LI=282]="JING_LI",t[t["敬礼"]=282]="敬礼",t[t.KUANG_XIAO=283]="KUANG_XIAO",t[t["狂笑"]=283]="狂笑",t[t.MIAN_WU_BIAO_QING=284]="MIAN_WU_BIAO_QING",t[t["面无表情"]=284]="面无表情",t[t.MO_YU=285]="MO_YU",t[t["摸鱼"]=285]="摸鱼",t[t.MO_GUI_XIAO=286]="MO_GUI_XIAO",t[t["魔鬼笑"]=286]="魔鬼笑",t[t.O=287]="O",t[t["哦"]=287]="哦",t[t.QING=288]="QING",t[t["请"]=288]="请",t[t.ZHENG_YAN=289]="ZHENG_YAN",t[t["睁眼"]=289]="睁眼"}(e.FaceType||(e.FaceType={})),function(t){t[t.Success=0]="Success",t[t.WrongVerifyKey=1]="WrongVerifyKey",t[t.BotNotExist=2]="BotNotExist",t[t.SessionNotExist=3]="SessionNotExist",t[t.UnverifiedSession=4]="UnverifiedSession",t[t.TargetNotExist=5]="TargetNotExist",t[t.FileNotExist=6]="FileNotExist",t[t.NoPermission=10]="NoPermission",t[t.BotIsMuted=20]="BotIsMuted",t[t.MessageTooLong=30]="MessageTooLong",t[t.BadRequest=400]="BadRequest",t[t.InternalError=500]="InternalError"}(e.ResponseCode||(e.ResponseCode={})),e.MIRAI_API_HTTP_VERSION="2.5.0"},function(t,e,n){"use strict";var i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationConfig=e.checkUserConfig=e.makeConfigs=void 0,e.makeConfigs=function(t){var e={};for(var n in t||{})t.hasOwnProperty(n)&&(e[n]=t[n].default&&t[n].default());return e},e.checkUserConfig=function(t,e,n){var r,o;try{for(var s=i(Object.keys(t)),u=s.next();!u.done;u=s.next()){var a=u.value;if(a in e&&typeof e[a]!=typeof t[a].type()&&n&&n.warn("配置项 "+a+" 不符合类型定义, 需要类型 "+typeof t[a].type()+", 得到类型 "+typeof e[a]),!(a in e)&&t[a].required){if(!n)throw new Error("必要配置项 "+a+" 缺失");n.error("必要配置项 "+a+" 缺失")}}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}};var r=function(){function t(){}return t.make=function(t){if(!t.qq)throw Error("配置文件缺少服务qq号");return{qq:t.qq,adapterInUse:t.adapterInUse||"http",logDirectory:t.logDirectory||null,logLevel:t.logLevel||"debug",verbose:t.verbose||!1,adapters:t.adapters||{},pies:t.pies||{},extensions:t.extensions||[]}},t}();e.ApplicationConfig=r},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.makeApiAdapter=void 0;var s=o(n(6)),u=n(7),a=n(2);e.makeApiAdapter=function(t){var e=t.data,n=void 0===e?{}:e,o=t.methods,c=void 0===o?{}:o,f=t.configMeta,l=void 0===f?{}:f,d=t.installed,p=void 0===d?void 0:d,h=t.uninstalled,v=void 0===h?void 0:h,g=t.used,m=void 0===g?void 0:g,y=t.unused,_=void 0===y?void 0:y,A=r(t,["data","methods","configMeta","installed","uninstalled","used","unused"]),I=Object.assign(new s.default,i(i(i(i({},n),c),A),{configMeta:l,configs:a.makeConfigs(t.configMeta),listening:!1,logger:u.getLogger("adapter:"+t.id),__isApiAdapter:!0}));return"function"==typeof p&&I.on("installed",(function(){return p.apply(I)})),"function"==typeof v&&I.on("uninstalled",(function(){return v.apply(I)})),"function"==typeof m&&I.on("used",(function(){return m.apply(I)})),"function"==typeof _&&I.on("unused",(function(){return _.apply(I)})),I}},function(t,e,n){"use strict";(function(i){var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),u=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return u(e,t),e},c=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||s(e,t,n)},f=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))},l=this&&this.__generator||function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},d=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},p=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},h=this&&this.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;n<i;n++,r++)t[r]=e[n];return t},v=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.makeAppConfig=e.createApp=e.Mirai=e.FaceType=e.ResponseCode=e.MiraiPieApplication=void 0;var g=v(n(6)),m=n(7),y=v(n(23)),_=n(10),A=n(2),I=n(8),b=n(9),O=function(e){function r(o,s){var u,a,c,f,l=e.call(this)||this;l.config=o,l.logger=m.getLogger("miraipie"),r.instance=l,Object({}).MIRAIPIE_MODULE=t.i,l.qq=o.qq,m.configure(s||{appenders:{console:{type:"console"},file:{type:"dateFile",filename:o.logDirectory+"/miraipie.log"}},categories:{default:{appenders:o.logDirectory?["console","file"]:["console"],level:o.logLevel||"debug"}}}),l.setMaxListeners(0),l.__apiAdapterMap=new Map,l.__piesMap=new Map,l.__piesEnabledMap=new Map;var v=[n(25),n(43),n(44)];try{for(var g=d(v),_=g.next();!_.done;_=g.next()){var A=_.value;A.configs.qq=l.qq,l.adapter(A)}}catch(t){u={error:t}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(u)throw u.error}}var I=new Set(h(h(h([],p(l.config.extensions)),p(Object.keys(l.config.adapters).map((function(t){return l.config.adapters[t].module})))),p(Object.keys(l.config.pies).map((function(t){return l.config.pies[t].module})))));try{for(var b=d(I),O=b.next();!O.done;O=b.next()){var w=O.value;if(w)try{n(22)(y.default.join(i.cwd(),w))(l)}catch(t){l.logger.error("加载拓展模块 '"+w+"' 时出错:",t)}}}catch(t){c={error:t}}finally{try{O&&!O.done&&(f=b.return)&&f.call(b)}finally{if(c)throw c.error}}return l.config.verbose&&(l.on("message",(function(t){var e=t.messageChain.toDisplayString();if("FriendMessage"===t.type){var n=t.sender;l.logger.info(n.nickname+"("+n.id+") -> "+e)}else if("GroupMessage"===t.type){n=t.sender;l.logger.info("["+n.group.name+"("+n.group.id+")] "+n.memberName+"("+n.id+") -> "+e)}else if("TempMessage"===t.type){n=t.sender;l.logger.info(n.memberName+"("+n.id+") -> "+e)}})),l.on("event",(function(t){l.logger.info(t.type+": "+JSON.stringify(t))}))),l.useAdapter(o.adapterInUse),i.on("uncaughtException",(function(t){l.logger.debug("捕获到未处理的异常:",t)})),i.on("unhandledRejection",(function(t){l.logger.debug("捕获到未处理的rejection:",t)})),i.on("SIGINT",(function(){l.logger.info("已手动停止运行 (Ctrl-C)"),i.exit()})),l}return o(r,e),r.createApp=function(t,e){return new r(t,e)},r.prototype.install=function(t){return t.__isPie?this.pie(t):t.__isApiAdapter?this.adapter(t):this.logger.error("未知的拓展类型: "+t),this},r.prototype.adapter=function(t){var e=this;return t.__isApiAdapter?(this.__apiAdapterMap.set(t.id,t),t.on("message",(function(t){return f(e,void 0,void 0,(function(){return l(this,(function(e){switch(e.label){case 0:return t.messageChain=I.MessageChain.from(t.messageChain),this.emit("message",t),this.emit(t.type,t),[4,this.__messageDispatcher(t)];case 1:return e.sent(),[2]}}))}))})),t.on("sync",(function(t){return f(e,void 0,void 0,(function(){return l(this,(function(e){return t.messageChain=I.MessageChain.from(t.messageChain),this.emit("sync",t),this.emit(t.type,t),[2]}))}))})),t.on("event",(function(t){e.emit("event",t),e.emit(t.type,t)})),t.on("listen",(function(){e.emit("listen")})),t.on("stop",(function(){e.emit("stop")})),t.once("listen",(function(){return f(e,void 0,void 0,(function(){var e;return l(this,(function(n){switch(n.label){case 0:return[4,t.getAbout()];case 1:return(e=n.sent()).data.version!==t.supportVersion&&this.logger.warn("当前使用的adapter: '"+t.id+"' 支持 mirai-api-http V"+t.supportVersion+", 而服务端运行的版本为 V"+e.data.version+", 使用中可能产生兼容性问题"),[2]}}))}))})),t.id in this.config.adapters&&(t.configs=Object.assign(t.configs,this.config.adapters[t.id].configs),A.checkUserConfig(t.configMeta,t.configs,t.logger)),this.logger.info("已安装 adapter '"+t.id+"'"),t.emit("installed"),this):(this.logger.error("安装 adapter 失败, "+t+" 不是有效的 adapter"),this)},r.prototype.useAdapter=function(t){return this.__apiAdapterMap.has(t)?(this.api&&(this.api.emit("unused"),this.api.stop()),this.api=this.__apiAdapterMap.get(t),this.__apiAdapterMap.get(t).emit("used")):this.logger.error("使用 adapter 失败, 指定的 adapter '"+t+"' 未安装"),this},r.prototype.uninstallAdapter=function(t){if(this.api&&this.api.id===t&&this.logger.error("卸载 adapter '"+t+"' 失败, 当前正在使用"),this.__apiAdapterMap.has(t)){var e=this.__apiAdapterMap.get(t);return this.__apiAdapterMap.delete(t),this.logger.info("已卸载 adapter '"+t+"'"),e}this.logger.error("卸载 adapter 失败, 指定的 adapter '"+t+"' 未安装")},r.prototype.pie=function(t){if(!t.__isPie)return this.logger.error("安装 pie 失败, "+t+" 不是有效的 pie"),this;if(this.__piesMap.set(t.id,t),t.id in this.config.pies){var e=this.config.pies[t.id];t.configs=Object.assign(t.configs,e.configs),A.checkUserConfig(t.configMeta,t.configs,t.logger),this.__piesEnabledMap.set(t.id,e.enabled)}else this.__piesEnabledMap.set(t.id,!0);return this.logger.info("已安装 pie '"+t.id+"'"),t.emit("installed"),this.__piesEnabledMap.get(t.id)&&this.enable(t.id),this},r.prototype.enable=function(t){return this.__piesMap.has(t)&&(this.__piesEnabledMap.set(t,!0),this.__piesMap.get(t).emit("enabled"),this.logger.info("已启用 pie '"+t+"'")),this},r.prototype.disable=function(t){return this.__piesMap.has(t)&&(this.__piesEnabledMap.set(t,!1),this.__piesMap.get(t).emit("disabled"),this.logger.info("已禁用 pie '"+t+"'")),this},r.prototype.uninstallPie=function(t){if(this.__piesMap.has(t)){var e=this.__piesMap.get(t);return this.disable(t),this.__piesEnabledMap.delete(t),this.__piesMap.delete(t),e.emit("uninstalled"),this.logger.info("已卸载 pie '"+t+"'"),e}this.logger.error("卸载 pie 失败, 指定的 pie '"+t+"' 未安装")},r.prototype.listen=function(){return f(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return this.api?this.api.listening?[3,2]:[4,this.api.listen()]:[3,3];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:this.logger.error("未指定使用的 adapter, 无法启动监听"),t.label=4;case 4:return[2]}}))}))},r.prototype.stop=function(){this.api&&this.api.listening&&this.api.stop()},r.prototype.addListener=function(t,n){return e.prototype.addListener.call(this,t,n)},r.prototype.on=function(t,n){return e.prototype.on.call(this,t,n)},r.prototype.once=function(t,n){return e.prototype.once.call(this,t,n)},r.prototype.listeners=function(t){return e.prototype.listeners.call(this,t)},r.prototype.emit=function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return e.prototype.emit.apply(this,h([t],p(n)))},r.prototype.prependListener=function(t,n){return e.prototype.prependListener.call(this,t,n)},r.prototype.prependOnceListener=function(t,n){return e.prototype.prependOnceListener.call(this,t,n)},r.prototype.__messageDispatcher=function(t){return f(this,void 0,void 0,(function(){var e,n,i,r,o,s,u,a,c,f,h;return l(this,(function(l){if(e=null,"FriendMessage"===t.type)e=new _.FriendChat(t.sender);else if("GroupMessage"===t.type)e=new _.GroupChat(t.sender);else{if("TempMessage"!==t.type)return[2];e=new _.TempChat(t.sender)}e=b.makeReadonly(e),n=b.makeReadonly(I.MessageChain.from(t.messageChain)),i=function(t,i){if(i){var o=r.__piesMap.get(t);if(o.filters.map((function(t){return t.handler(e,n,o)})).some((function(t){return!t})))return"continue";o.emit("received",e,n)}},r=this;try{for(o=d(this.__piesEnabledMap.entries()),s=o.next();!s.done;s=o.next())u=p(s.value,2),a=u[0],c=u[1],i(a,c)}catch(t){f={error:t}}finally{try{s&&!s.done&&(h=o.return)&&h.call(o)}finally{if(f)throw f.error}}return[2]}))}))},r.instance=null,r}(g.default);e.MiraiPieApplication=O;var w=n(1);Object.defineProperty(e,"ResponseCode",{enumerable:!0,get:function(){return w.ResponseCode}}),Object.defineProperty(e,"FaceType",{enumerable:!0,get:function(){return w.FaceType}}),e.Mirai=a(n(1)),c(n(3),e),c(n(45),e),c(n(8),e),c(n(10),e),c(n(2),e),e.createApp=O.createApp,e.makeAppConfig=A.ApplicationConfig.make,e.default=e.createApp,Object({}).MIRAIPIE_MODULE&&(t.exports=n(22)(Object({}).MIRAIPIE_MODULE))}).call(this,n(5))},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var a,c=[],f=!1,l=-1;function d(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length&&p())}function p(){if(!f){var t=u(d);f=!0;for(var e=c.length;e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function h(t,e){this.fun=t,this.array=e}function v(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new h(t,e)),1!==c.length||f||u(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(t,e){return new Promise((function(n,i){function r(n){t.removeListener(e,o),i(n)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",r),n([].slice.call(arguments))}m(t,e,o,{once:!0}),"error"!==e&&function(t,e,n){"function"==typeof t.on&&m(t,"error",e,n)}(t,r,{once:!0})}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,n,i){var r,o,s,u;if(c(n),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),s=o[e]),void 0===s)s=o[e]=n,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),(r=f(t))>0&&s.length>r&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=d.bind(i);return r.listener=n,i.wrapFn=r,r}function h(t,e,n){var i=t._events;if(void 0===i)return[];var r=i[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(r):g(r,r.length)}function v(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function m(t,e,n,i){if("function"==typeof t.on)i.once?t.once(e,n):t.on(e,n);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(o){i.once&&t.removeEventListener(e,r),n(o)}))}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,r=this._events;if(void 0!==r)i=i&&void 0===r.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=r[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var c=a.length,f=g(a,c);for(n=0;n<c;++n)o(f[n],this,e)}return!0},u.prototype.addListener=function(t,e){return l(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return l(this,t,e,!0)},u.prototype.once=function(t,e){return c(e),this.on(t,p(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return c(e),this.prependListener(t,p(this,t,e)),this},u.prototype.removeListener=function(t,e){var n,i,r,o,s;if(c(e),void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,r),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var r,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},u.prototype.listeners=function(t){return h(this,t,!0)},u.prototype.rawListeners=function(t){return h(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e){let n=console;t.exports={setLogger:t=>{n=t},configure:()=>{},getLogger:()=>n}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),u=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&s(e,t,n);return u(e,t),e},c=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},f=this&&this.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;n<i;n++,r++)t[r]=e[n];return t},l=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.MiraiCode=e.File=e.Forward=e.ForwardNode=e.makeMusicShare=e.MusicShare=e.Dice=e.Poke=e.App=e.Json=e.Xml=e.makeVoice=e.Voice=e.makeFlashImage=e.FlashImage=e.makeImage=e.Image=e.Plain=e.Face=e.AtAll=e.At=e.Quote=e.MessageChain=void 0;var d=a(n(1));function p(t){return this.type===t}function h(t){return t.replace(/([\[\]:,\\])/g,"\\$1").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}function v(){return this.isType("Source")?"[mirai:source:"+this.id+"]":this.isType("Quote")?"[mirai:quote:"+this.id+"]":this.isType("At")?"[mirai:at:"+this.target+"]":this.isType("AtAll")?"[mirai:atall]":this.isType("Face")?"[mirai:face:"+this.faceId+"]":this.isType("Plain")?""+this.text:this.isType("Image")?"[mirai:image:"+this.imageId+"]":this.isType("FlashImage")?"[mirai:flash:"+this.imageId+"]":this.isType("Voice")?"[mirai:voice:"+this.voiceId+"]":this.isType("Xml")?"[mirai:xml:"+h(this.xml)+"]":this.isType("Json")?"[mirai:json:"+h(this.json)+"]":this.isType("App")?"[mirai:app:"+h(this.content)+"]":this.isType("Poke")?"[mirai:poke:"+this.name+"]":this.isType("Dice")?"[mirai:dice:"+this.value+"]":this.isType("MusicShare")?"[mirai:musicshare:"+this.kind+","+this.title+","+this.summary+","+this.jumpUrl+","+this.pictureUrl+","+this.musicUrl+","+this.brief+"]":this.isType("Forward")?"[mirai:forward:"+this.nodeList.length+"]":this.isType("File")?"[mirai:file:"+this.id+","+this.name+","+this.size+"]":this.isType("MiraiCode")?this.code:"[mirai:unknown]"}function g(){return this.isType("Quote")?"[回复]"+this.origin.toString():this.isType("At")?"@"+this.target:this.isType("AtAll")?"@全体成员":this.isType("Face")?"["+(this.name||d.FaceType[this.faceId]||"表情")+"]":this.isType("Plain")?""+this.text:this.isType("Image")?"[图片]":this.isType("FlashImage")?"[闪照]":this.isType("Voice")?"[语音消息]":this.isType("Xml")?""+this.xml:this.isType("Json")?""+this.json:this.isType("App")?""+this.content:this.isType("Poke")?"[戳一戳]":this.isType("Dice")?"[骰子:"+this.value+"]":this.isType("MusicShare")?"[分享]"+this.title:this.isType("Forward")?"[转发消息]":this.isType("File")?"[文件]"+this.name:"[不支持的消息类型#"+this.type+"]"}var m=function(t){function e(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=t.apply(this,f([],c(n)))||this;return Object.setPrototypeOf(r,e.prototype),r}return r(e,t),Object.defineProperty(e.prototype,"firstClientMessage",{get:function(){var t,e;try{for(var n=l(this),i=n.next();!i.done;i=n.next()){var r=i.value;if("Source"!==r.type)return r}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"f",{get:function(){return this.firstClientMessage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sourceId",{get:function(){return this.length>0&&this[0].isType("Source")?this[0].id:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{get:function(){return this.length>0&&this[0].isType("Source")?this[0].time:null},enumerable:!1,configurable:!0}),e.prototype.select=function(t){var e=this;return this.forEach((function(n,i){n.type!==t&&e.splice(i,1)})),this},e.prototype.selected=function(t){return e.from(Array.from(this).filter((function(e){return e.type===t})))},e.prototype.drop=function(t){for(var e=this.length-1;e>=0;e--)this[e].type===t&&this.splice(e,1);return this},e.prototype.dropped=function(t){return e.from(Array.from(this).filter((function(e){return e.type!==t})))},e.prototype.toMiraiCode=function(){return this.map((function(t){return t.toMiraiCode()})).join("")},e.prototype.toDisplayString=function(){return this.dropped("Source").map((function(t){return t.toDisplayString()})).join("")},e.from=function(t){var n=new e;return n.push.apply(n,f([],c(t.map((function(t){return o(o({},t),{isType:p,toDisplayString:g,toMiraiCode:v})}))))),n},e}(Array);e.MessageChain=m,e.Quote=function(t,e,n,i,r){return{type:"Quote",id:t,groupId:e,senderId:n,targetId:r,origin:i,isType:p,toDisplayString:g,toMiraiCode:v}},e.At=function(t,e){return void 0===e&&(e=""),{type:"At",target:t,display:e,isType:p,toDisplayString:g,toMiraiCode:v}},e.AtAll=function(){return{type:"AtAll",isType:p,toDisplayString:g,toMiraiCode:v}},e.Face=function(t,e){return{type:"Face",faceId:t,name:e,isType:p,toDisplayString:g,toMiraiCode:v}},e.Plain=function(t){return{type:"Plain",text:t,isType:p,toDisplayString:g,toMiraiCode:v}},e.Image=function(t,e,n,i){return{type:"Image",imageId:t,url:e,path:n,base64:i,isType:p,toDisplayString:g,toMiraiCode:v}},e.makeImage=function(t){return o(o({type:"Image",imageId:t.imageId,url:t.url},t),{isType:p,toDisplayString:g,toMiraiCode:v})},e.FlashImage=function(t,e,n,i){return{type:"FlashImage",imageId:t,url:e,path:n,base64:i,isType:p,toDisplayString:g,toMiraiCode:v}},e.makeFlashImage=function(t){return o(o({type:"FlashImage",imageId:t.imageId,url:t.url},t),{isType:p,toDisplayString:g,toMiraiCode:v})},e.Voice=function(t,e,n,i){return{type:"Voice",voiceId:t,path:n,base64:i,isType:p,toDisplayString:g,toMiraiCode:v}},e.makeVoice=function(t){return o(o({type:"Voice",voiceId:t.voiceId},t),{isType:p,toDisplayString:g,toMiraiCode:v})},e.Xml=function(t){return{type:"Xml",xml:t,isType:p,toDisplayString:g,toMiraiCode:v}},e.Json=function(t){return{type:"Json",json:t,isType:p,toDisplayString:g,toMiraiCode:v}},e.App=function(t){return{type:"App",content:t,isType:p,toDisplayString:g,toMiraiCode:v}},e.Poke=function(t){return{type:"Poke",name:t,isType:p,toDisplayString:g,toMiraiCode:v}},e.Dice=function(t){return{type:"Dice",value:t,isType:p,toDisplayString:g,toMiraiCode:v}},e.MusicShare=function(t,e,n,i,r,o,s){return{type:"MusicShare",kind:t,title:e,summary:n,jumpUrl:i,pictureUrl:r,musicUrl:o,brief:s,isType:p,toDisplayString:g,toMiraiCode:v}},e.makeMusicShare=function(t){return{type:"MusicShare",kind:t.kind,title:t.title,summary:t.summary,jumpUrl:t.jumpUrl,pictureUrl:t.pictureUrl,musicUrl:t.musicUrl,brief:t.brief,isType:p,toDisplayString:g,toMiraiCode:v}},e.ForwardNode=function(t,e,n,i,r){return{senderId:t,time:e,senderName:n,messageChain:i,messageId:r}},e.Forward=function(t){return{type:"Forward",nodeList:t,isType:p,toDisplayString:g,toMiraiCode:v}},e.File=function(t,e,n){return{type:"File",id:t,name:e,size:n,isType:p,toDisplayString:g,toMiraiCode:v}},e.MiraiCode=function(t){return{type:"MiraiCode",code:t,isType:p,toDisplayString:g,toMiraiCode:v}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.makeTemplate=e.formatDate=e.dependencyResolve=e.sleep=e.makeAsync=e.makeReadonly=void 0;var a=u(n(24));e.makeReadonly=function(t){return t?new Proxy(t,{get:function(t,e,n){return Reflect.get(t,e,n)},set:function(){return!1}}):null},e.makeAsync=function(t,e){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return i(this,void 0,void 0,(function(){return r(this,(function(i){switch(i.label){case 0:return[4,t.apply(e,n)];case 1:return[2,i.sent()]}}))}))}},e.sleep=function(t){return void 0===t&&(t=100),i(this,void 0,void 0,(function(){return r(this,(function(e){return[2,new Promise((function(e){return setTimeout(e,t)}))]}))}))},e.dependencyResolve=function(t){for(var e=[],n=function(){var n,i,r,u,a=null;try{for(var c=(n=void 0,o(t.entries())),f=c.next();!f.done;f=c.next()){var l=s(f.value,2),d=l[0],p=l[1];if(null===a&&(a=d),0===p.length){a=d;break}p.length<t.get(a).length&&(a=d)}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}e.push(a),t.delete(a);try{for(var h=(r=void 0,o(t.entries())),v=h.next();!v.done;v=h.next()){var g=s(v.value,2);d=g[0],p=g[1];t.set(d,p.filter((function(t){return t!==a})))}}catch(t){r={error:t}}finally{try{v&&!v.done&&(u=h.return)&&u.call(h)}finally{if(r)throw r.error}}};t.size>0;)n();return e},e.formatDate=function(t){return t?t.getUTCFullYear()+"-"+(t.getMonth()+1).toString().padStart(2,"0")+"-"+t.getDate().toString().padStart(2,"0")+" "+t.getHours().toString().padStart(2,"0")+":"+t.getMinutes().toString().padEnd(2,"0")+":"+t.getSeconds().toString().padStart(2,"0"):null},e.makeTemplate=function(t,e,n){var i,r,s=a.default.readFileSync(t).toString();try{for(var u=o(Object.keys(n)),c=u.next();!c.done;c=u.next()){var f=c.value;s=s.replace("{{"+f+"}}",n[f])}}catch(t){i={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}a.default.writeFileSync(e,s)}},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},u=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.TempChat=e.GroupChat=e.FriendChat=e.Chat=void 0;var a=n(8),c=n(1),f=n(4),l=function(){function t(){}return t.recall=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.recall(t)];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},t.findFriend=function(t){return o(this,void 0,void 0,(function(){var e,n,i,r,o,a;return s(this,(function(s){switch(s.label){case 0:return[4,f.MiraiPieApplication.instance.api.getFriendList()];case 1:e=s.sent();try{for(n=u(e.data),i=n.next();!i.done;i=n.next())if((r=i.value).id===t)return[2,new d(r)]}catch(t){o={error:t}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}}return[2,null]}}))}))},t.findGroup=function(t){return o(this,void 0,void 0,(function(){var e,n,i,r,o,a;return s(this,(function(s){switch(s.label){case 0:return[4,f.MiraiPieApplication.instance.api.getMemberList(t)];case 1:if((e=s.sent()).code===c.ResponseCode.Success)try{for(n=u(e.data),i=n.next();!i.done;i=n.next())if("OWNER"===(r=i.value).permission)return[2,new p(r)]}catch(t){o={error:t}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}}return[2,null]}}))}))},t.prototype.send=function(t,e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=new a.MessageChain,"string"==typeof t?n.push(a.Plain(t)):Array.isArray(t)?n=a.MessageChain.from(t):n.push(t),[2,this._send(n,e)]}))}))},t.prototype.isFriendChat=function(){return"FriendChat"===this.type},t.prototype.isGroupChat=function(){return"GroupChat"===this.type},t.prototype.isTempChat=function(){return"TempChat"===this.type},t}();e.Chat=l;var d=function(t){function e(e){var n=t.call(this)||this;return n.contact=e,n.type="FriendChat",n.sender=e,n}return r(e,t),e.prototype.nextMessage=function(t){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){return[2,new Promise((function(n,i){var r=!0;f.MiraiPieApplication.instance.once("FriendMessage",(function(t){e.sender.id===t.sender.id&&(r=!1,n(a.MessageChain.from(t.messageChain)))})),t>0&&setTimeout((function(){r&&i(new Error("等待消息已超时"))}),t)}))]}))}))},e.prototype.sendNudge=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.sendNudge(t||this.contact.id,this.contact.id,"Friend")];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype._send=function(t,e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.sendFriendMessage(this.contact.id,t,e)];case 1:return[2,null==(n=i.sent())?void 0:n.messageId]}}))}))},e.prototype.getProfile=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.getFriendProfile(this.contact.id)];case 1:return[2,null==(t=e.sent())?void 0:t.data]}}))}))},e.prototype.delete=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.deleteFriend(this.contact.id)];case 1:return[2,(null==(t=e.sent())?void 0:t.code)===c.ResponseCode.Success]}}))}))},e}(l);e.FriendChat=d;var p=function(t){function e(e){var n=t.call(this)||this;return n.sender=e,n.type="GroupChat",n.contact=e.group,n}return r(e,t),e.prototype.nextMessage=function(t){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){return[2,new Promise((function(n,i){var r=!0;f.MiraiPieApplication.instance.once("GroupMessage",(function(t){e.sender.id===t.sender.id&&e.contact.id===t.sender.group.id&&(r=!1,n(a.MessageChain.from(t.messageChain)))})),t>0&&setTimeout((function(){r&&i(new Error("等待消息已超时"))}),t)}))]}))}))},e.prototype.sendNudge=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.sendNudge(t,this.contact.id,"Group")];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype._send=function(t,e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.sendGroupMessage(this.contact.id,t,e)];case 1:return[2,null==(n=i.sent())?void 0:n.messageId]}}))}))},Object.defineProperty(e.prototype,"permission",{get:function(){return this.contact.permission},enumerable:!1,configurable:!0}),e.setEssence=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.setEssence(t)];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype.nextGroupMessage=function(t){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){return[2,new Promise((function(n,i){var r=!0;f.MiraiPieApplication.instance.once("GroupMessage",(function(t){e.contact.id===t.sender.group.id&&(r=!1,n(a.MessageChain.from(t.messageChain)))})),t>0&&setTimeout((function(){r&&i(new Error("等待消息已超时"))}),t)}))]}))}))},e.prototype.getMemberList=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.getMemberList(this.contact.id)];case 1:return[2,null==(t=e.sent())?void 0:t.data]}}))}))},e.prototype.getProfile=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.getMemberProfile(t||this.sender.id,this.contact.id)];case 1:return[2,null==(e=n.sent())?void 0:e.data]}}))}))},e.prototype.getAnnouncements=function(t,e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.getGroupAnnouncements(this.contact.id,t,e)];case 1:return[2,null==(n=i.sent())?void 0:n.data]}}))}))},e.prototype.postAnnouncement=function(t,e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.postGroupAnnouncement(this.contact.id,e)];case 1:return[2,null==(t=n.sent())?void 0:t.data]}}))}))},e.prototype.deleteAnnouncement=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.deleteGroupAnnouncement(this.contact.id,t)];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype.getInfo=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.getMemberInfo(t||this.sender.id,this.contact.id)];case 1:return[2,null==(e=n.sent())?void 0:e.data]}}))}))},e.prototype.setInfo=function(t,e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.setMemberInfo(e||this.sender.id,this.contact.id,t)];case 1:return[2,(null==(n=i.sent())?void 0:n.code)===c.ResponseCode.Success]}}))}))},e.prototype.mute=function(t,e){return void 0===t&&(t=60),o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.muteMember(e||this.sender.id,this.contact.id,t)];case 1:return[2,(null==(n=i.sent())?void 0:n.code)===c.ResponseCode.Success]}}))}))},e.prototype.unmute=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.unmuteMember(t||this.sender.id,this.contact.id)];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype.kick=function(t,e){return void 0===t&&(t=""),o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.kickMember(e||this.sender.id,this.contact.id,t)];case 1:return[2,(null==(n=i.sent())?void 0:n.code)===c.ResponseCode.Success]}}))}))},e.prototype.quit=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.quitGroup(this.contact.id)];case 1:return[2,(null==(t=e.sent())?void 0:t.code)===c.ResponseCode.Success]}}))}))},e.prototype.muteAll=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.muteAll(this.contact.id)];case 1:return[2,(null==(t=e.sent())?void 0:t.code)===c.ResponseCode.Success]}}))}))},e.prototype.unmuteAll=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.unmuteAll(this.contact.id)];case 1:return[2,(null==(t=e.sent())?void 0:t.code)===c.ResponseCode.Success]}}))}))},e.prototype.getConfig=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.getGroupConfig(this.contact.id)];case 1:return[2,null==(t=e.sent())?void 0:t.data]}}))}))},e.prototype.setConfig=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.setGroupConfig(this.contact.id,t)];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype.setAdmin=function(t,e){return void 0===t&&(t=!0),o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.setMemberAdmin(e||this.sender.id,this.contact.id,t)];case 1:return[2,(null==(n=i.sent())?void 0:n.code)===c.ResponseCode.Success]}}))}))},e.prototype.getFileList=function(t,e,n){return void 0===t&&(t=""),void 0===e&&(e=0),void 0===n&&(n=100),o(this,void 0,void 0,(function(){var i;return s(this,(function(r){switch(r.label){case 0:return[4,f.MiraiPieApplication.instance.api.getFileList(t,t,this.contact.id,null,e,n,!0)];case 1:return[2,null==(i=r.sent())?void 0:i.data]}}))}))},e.prototype.getFileInfo=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.getFileInfo(t,t,this.contact.id,null,!0)];case 1:return[2,null==(e=n.sent())?void 0:e.data]}}))}))},e.prototype.createDirectory=function(t,e){return void 0===e&&(e=""),o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.createFileDirectory(e,e,t,this.contact.id,null)];case 1:return[2,null==(n=i.sent())?void 0:n.data]}}))}))},e.prototype.deleteFile=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.deleteFile(t,t,this.contact.id,null)];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype.moveFile=function(t,e){return void 0===e&&(e=null),o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.moveFile(t,t,this.contact.id,null,e,e)];case 1:return[2,(null==(n=i.sent())?void 0:n.code)===c.ResponseCode.Success]}}))}))},e.prototype.renameFile=function(t,e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.renameFile(t,t,this.contact.id,null,e)];case 1:return[2,(null==(n=i.sent())?void 0:n.code)===c.ResponseCode.Success]}}))}))},e.prototype.openTempChat=function(){return new h(this.sender)},e}(l);e.GroupChat=p;var h=function(t){function e(e){var n=t.call(this)||this;return n.contact=e,n.type="TempChat",n.sender=e,n}return r(e,t),e.prototype.nextMessage=function(t){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){return[2,new Promise((function(n,i){var r=!0;f.MiraiPieApplication.instance.once("TempMessage",(function(t){e.sender.id===t.sender.id&&(r=!1,n(a.MessageChain.from(t.messageChain)))})),t>0&&setTimeout((function(){r&&i(new Error("等待消息已超时"))}),t)}))]}))}))},e.prototype.sendNudge=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return[4,f.MiraiPieApplication.instance.api.sendNudge(t||this.contact.id,this.contact.id,"Stranger")];case 1:return[2,(null==(e=n.sent())?void 0:e.code)===c.ResponseCode.Success]}}))}))},e.prototype._send=function(t,e){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return[4,f.MiraiPieApplication.instance.api.sendTempMessage(this.contact.id,this.contact.group.id,t,e)];case 1:return[2,null==(n=i.sent())?void 0:n.messageId]}}))}))},e.prototype.getProfile=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return[4,f.MiraiPieApplication.instance.api.getMemberProfile(this.contact.group.id,this.contact.id)];case 1:return[2,null==(t=e.sent())?void 0:t.data]}}))}))},e}(l);e.TempChat=h},function(t,e,n){t.exports=n(26)},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return t.apply(e,n)}}},function(t,e,n){"use strict";var i=n(0);function r(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(i.isURLSearchParams(e))o=e.toString();else{var s=[];i.forEach(e,(function(t,e){null!=t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),s.push(r(e)+"="+r(t))})))})),o=s.join("&")}if(o){var u=t.indexOf("#");-1!==u&&(t=t.slice(0,u)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var i=n(0),r=n(31),o={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,a={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(u=n(16)),u),transformRequest:[function(t,e){return r(e,"Accept"),r(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};a.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],(function(t){a.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){a.headers[t]=i.merge(o)})),t.exports=a}).call(this,n(5))},function(t,e,n){"use strict";var i=n(0),r=n(32),o=n(34),s=n(13),u=n(35),a=n(38),c=n(39),f=n(17);t.exports=function(t){return new Promise((function(e,n){var l=t.data,d=t.headers;i.isFormData(l)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(t.auth){var h=t.auth.username||"",v=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";d.Authorization="Basic "+btoa(h+":"+v)}var g=u(t.baseURL,t.url);if(p.open(t.method.toUpperCase(),s(g,t.params,t.paramsSerializer),!0),p.timeout=t.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var i="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,o={data:t.responseType&&"text"!==t.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:i,config:t,request:p};r(e,n,o),p=null}},p.onabort=function(){p&&(n(f("Request aborted",t,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(f("Network Error",t,null,p)),p=null},p.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(f(e,t,"ECONNABORTED",p)),p=null},i.isStandardBrowserEnv()){var m=(t.withCredentials||c(g))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;m&&(d[t.xsrfHeaderName]=m)}if("setRequestHeader"in p&&i.forEach(d,(function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete d[e]:p.setRequestHeader(e,t)})),i.isUndefined(t.withCredentials)||(p.withCredentials=!!t.withCredentials),t.responseType)try{p.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&p.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){p&&(p.abort(),n(t),p=null)})),l||(l=null),p.send(l)}))}},function(t,e,n){"use strict";var i=n(33);t.exports=function(t,e,n,r,o){var s=new Error(t);return i(s,e,n,r,o)}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e){e=e||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function a(t,e){return i.isPlainObject(t)&&i.isPlainObject(e)?i.merge(t,e):i.isPlainObject(e)?i.merge({},e):i.isArray(e)?e.slice():e}function c(r){i.isUndefined(e[r])?i.isUndefined(t[r])||(n[r]=a(void 0,t[r])):n[r]=a(t[r],e[r])}i.forEach(r,(function(t){i.isUndefined(e[t])||(n[t]=a(void 0,e[t]))})),i.forEach(o,c),i.forEach(s,(function(r){i.isUndefined(e[r])?i.isUndefined(t[r])||(n[r]=a(void 0,t[r])):n[r]=a(void 0,e[r])})),i.forEach(u,(function(i){i in e?n[i]=a(t[i],e[i]):i in t&&(n[i]=a(void 0,t[i]))}));var f=r.concat(o).concat(s).concat(u),l=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===f.indexOf(t)}));return i.forEach(l,c),n}},function(t,e,n){"use strict";function i(t){this.message=t}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,t.exports=i},function(t,e){t.exports="object"==typeof self?self.FormData:window.FormData},function(t,e){t.exports=class extends WebSocket{on(t,e){"message"===t?this.addEventListener("message",t=>{e(t.data)}):"error"===t&&this.addEventListener("error",t=>{e({message:t})})}}},function(t,e){function n(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=22},function(t,e,n){(function(t){function n(t,e){for(var n=0,i=t.length-1;i>=0;i--){var r=t[i];"."===r?t.splice(i,1):".."===r?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i<t.length;i++)e(t[i],i,t)&&n.push(t[i]);return n}e.resolve=function(){for(var e="",r=!1,o=arguments.length-1;o>=-1&&!r;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,r="/"===s.charAt(0))}return(r?"/":"")+(e=n(i(e.split("/"),(function(t){return!!t})),!r).join("/"))||"."},e.normalize=function(t){var o=e.isAbsolute(t),s="/"===r(t,-1);return(t=n(i(t.split("/"),(function(t){return!!t})),!o).join("/"))||o||(t="."),t&&s&&(t+="/"),(o?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var r=i(t.split("/")),o=i(n.split("/")),s=Math.min(r.length,o.length),u=s,a=0;a<s;a++)if(r[a]!==o[a]){u=a;break}var c=[];for(a=u;a<r.length;a++)c.push("..");return(c=c.concat(o.slice(u))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,i=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"/":t.slice(0,i)},e.basename=function(t,e){var n=function(t){"string"!=typeof t&&(t+="");var e,n=0,i=-1,r=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!r){n=e+1;break}}else-1===i&&(r=!1,i=e+1);return-1===i?"":t.slice(n,i)}(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,n=0,i=-1,r=!0,o=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(47!==u)-1===i&&(r=!1,i=s+1),46===u?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){n=s+1;break}}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===n+1?"":t.slice(e,i)};var r="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n(5))},function(t,e){t.exports={}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},a=u(n(11)),c=u(n(20)),f=n(3),l=n(1),d=n(9),p=f.makeApiAdapter({id:"http",supportVersion:l.MIRAI_API_HTTP_VERSION,configMeta:{qq:{type:Number,description:"mirai-api-http服务的QQ号"},verifyKey:{type:String,required:!0,description:"mirai-api-http配置中的verifyKey"},host:{type:String,required:!0,description:"mirai-api-http服务的主机地址",default:function(){return"127.0.0.1"}},port:{type:Number,required:!0,description:"mirai-api-http服务的端口号",default:function(){return 23333}},interval:{type:Number,description:"http轮询周期(毫秒)",default:function(){return 500}},ssl:{type:Boolean,description:"是否使用SSL",default:function(){return!1}}},data:{session:null},methods:{request:function(t,e,n,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),r(this,void 0,void 0,(function(){var r,u,c;return o(this,(function(o){switch(o.label){case 0:return r={method:n,url:"http"+(this.configs.ssl?"s":"")+"://"+this.configs.host+":"+this.configs.port+"/"+t,headers:{}},"POST"===n?r.data=e:r.params=e,s&&(r.headers=e.getHeaders()),i?this.session?[3,3]:[4,this.verify()]:[3,4];case 1:return o.sent(),[4,this.bind()];case 2:o.sent(),this.session||this.logger.error("session未绑定或已失效"),o.label=3;case 3:r.headers.sessionKey=this.session,o.label=4;case 4:return o.trys.push([4,6,,7]),[4,a.default.request(r)];case 5:return"code"in(u=o.sent().data)&&u.code!==l.ResponseCode.Success&&this.logger.warn("发送的请求未能达到预期的效果, 请求uri: "+t+", 错误原因: "+u.msg+", 请求原始数据:",e),[2,u];case 6:return c=o.sent(),this.logger.error("发送请求错误, 请求原始数据:",e,c.message),[3,7];case 7:return[2]}}))}))},get:function(t,e,n,i){return void 0===n&&(n=!0),void 0===i&&(i=!1),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.request(t,e,"GET",n,i)]}))}))},post:function(t,e,n,i){return void 0===n&&(n=!0),void 0===i&&(i=!1),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.request(t,e,"POST",n,i)]}))}))}},verify:function(){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return[2,new Promise((function(e,n){t.post("verify",{verifyKey:t.configs.verifyKey},!1).then((function(n){n.code===l.ResponseCode.WrongVerifyKey?t.logger.error("认证失败, 错误的verifyKey"):t.session=n.session,e(n)})).catch((function(t){n(t)}))}))]}))}))},bind:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.post("bind",{sessionKey:this.session,qq:this.configs.qq},!1)]}))}))},release:function(){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return[2,new Promise((function(e,n){t.post("release",{sessionKey:t.session,qq:t.configs.qq},!1).then((function(n){t.session=null,e(n)})).catch((function(t){n(t)}))}))]}))}))},listen:function(){return r(this,void 0,void 0,(function(){var t,e,n,i,r,u,a,c;return o(this,(function(o){switch(o.label){case 0:if(this.listening)return[3,10];t=!0,o.label=1;case 1:if(!this.listening&&!t)return[3,10];o.label=2;case 2:return o.trys.push([2,7,8,9]),[4,this.get("fetchMessage",{count:30})];case 3:if((e=o.sent()).code!==l.ResponseCode.Success)return[3,5];t&&(this.listening=!0,this.logger.info("已启动监听"),this.emit("listen"));try{for(a=void 0,n=s(e.data),i=n.next();!i.done;i=n.next())(r=i.value).type.endsWith("Message")?this.emit("message",r):r.type.endsWith("SyncMessage")?this.emit("sync",r):this.emit("event",r)}catch(t){a={error:t}}finally{try{i&&!i.done&&(c=n.return)&&c.call(n)}finally{if(a)throw a.error}}return[4,d.sleep(this.configs.interval)];case 4:return o.sent(),[3,6];case 5:this.logger.error("监听器启动失败, 错误原因: "+e.msg),o.label=6;case 6:return[3,9];case 7:return u=o.sent(),this.logger.error("监听时发生错误:",u.message),this.listening=!1,[3,9];case 8:return t=!1,[7];case 9:return[3,1];case 10:return[2]}}))}))},stop:function(){this.listening&&(this.listening=!1,this.logger.info("已停止监听"),this.emit("stop"))},getAbout:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("about",null,!1)]}))}))},getMessageFromId:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("messageFromId",{id:t})]}))}))},getBotProfile:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("botProfile")]}))}))},getFriendList:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("friendList")]}))}))},getGroupList:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("groupList")]}))}))},getMemberList:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("memberList",{target:t})]}))}))},getFriendProfile:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("friendProfile",{target:t})]}))}))},getMemberProfile:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.get("memberProfile",{target:e,memberId:t})]}))}))},getUserProfile:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("userProfile",{target:t})]}))}))},sendFriendMessage:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("sendFriendMessage",{target:t,messageChain:e,quote:n})]}))}))},sendGroupMessage:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("sendGroupMessage",{target:t,messageChain:e,quote:n})]}))}))},sendTempMessage:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("sendTempMessage",{qq:t,group:e,messageChain:n,quote:i})]}))}))},sendNudge:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("sendNudge",{target:t,subject:e,kind:n})]}))}))},recall:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("recall",{target:t})]}))}))},getFileList:function(t,e,n,i,s,u,a){return void 0===s&&(s=1),void 0===u&&(u=100),void 0===a&&(a=!0),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.get("file/list",{id:t,path:e,group:n,qq:i,offset:s,size:u,withDownloadInfo:a})]}))}))},getFileInfo:function(t,e,n,i,s){return void 0===s&&(s=!0),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.get("file/info",{id:t,path:e,group:n,qq:i,withDownloadInfo:s})]}))}))},createFileDirectory:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/mkdir",{id:t,path:e,group:i,qq:s,directoryName:n})]}))}))},deleteFile:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/delete",{id:t,path:e,group:n,qq:i})]}))}))},moveFile:function(t,e,n,i,s,u){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/move",{id:t,path:e,group:n,qq:i,moveTo:s,moveToPath:u})]}))}))},renameFile:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/rename",{id:t,path:e,group:n,qq:i,renameTo:s})]}))}))},deleteFriend:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("deleteFriend",{target:t})]}))}))},muteMember:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("mute",{target:e,memberId:t,time:n})]}))}))},unmuteMember:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("unmute",{target:e,memberId:t})]}))}))},kickMember:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("kick",{target:e,memberId:t,msg:n})]}))}))},quitGroup:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("quit",{target:t})]}))}))},muteAll:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("muteAll",{target:t})]}))}))},unmuteAll:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("unmuteAll",{target:t})]}))}))},setEssence:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("setEssence",{target:t})]}))}))},getGroupConfig:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("groupConfig",{target:t})]}))}))},setGroupConfig:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("groupConfig",{target:t,config:e})]}))}))},getMemberInfo:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.get("memberInfo",{target:e,memberId:t})]}))}))},setMemberInfo:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("memberInfo",{target:e,memberId:t,info:n})]}))}))},setMemberAdmin:function(t,e,n){return void 0===n&&(n=!0),r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("memberAdmin",{target:e,memberId:t,assign:n})]}))}))},getGroupAnnouncements:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.get("anno/list",{id:t,offset:e,size:n})]}))}))},postGroupAnnouncement:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("anno/publish",i({target:t},e))]}))}))},deleteGroupAnnouncement:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("anno/delete",{id:t,fid:e})]}))}))},handleNewFriendRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("resp/newFriendRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})]}))}))},handleMemberJoinRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("resp/memberJoinRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})]}))}))},handleBotInvitedJoinGroupRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("resp/botInvitedJoinGroupRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})]}))}))},executeCommand:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("cmd/execute",{command:t})]}))}))},registerCommand:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("cmd/register",{name:t,alias:e,usage:n,description:i})]}))}))},uploadImage:function(t,e){return r(this,void 0,void 0,(function(){var n;return o(this,(function(i){return(n=new c.default).append("type",t),n.append("img",e),[2,this.post("uploadImage",n,!0,!0)]}))}))},uploadVoice:function(t,e){return r(this,void 0,void 0,(function(){var n;return o(this,(function(i){return(n=new c.default).append("type",t),n.append("voice",e),[2,this.post("uploadVoice",n,!0,!0)]}))}))},uploadGroupFile:function(t,e,n){return r(this,void 0,void 0,(function(){var i;return o(this,(function(r){return(i=new c.default).append("type",t),i.append("path",e),i.append("file",n),[2,this.post("uploadFile",i,!0,!0)]}))}))}});t.exports=p},function(t,e,n){"use strict";var i=n(0),r=n(12),o=n(27),s=n(18);function u(t){var e=new o(t),n=r(o.prototype.request,e);return i.extend(n,o.prototype,e),i.extend(n,e),n}var a=u(n(15));a.Axios=o,a.create=function(t){return u(s(a.defaults,t))},a.Cancel=n(19),a.CancelToken=n(40),a.isCancel=n(14),a.all=function(t){return Promise.all(t)},a.spread=n(41),a.isAxiosError=n(42),t.exports=a,t.exports.default=a},function(t,e,n){"use strict";var i=n(0),r=n(13),o=n(28),s=n(29),u=n(18);function a(t){this.defaults=t,this.interceptors={request:new o,response:new o}}a.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},a.prototype.getUri=function(t){return t=u(this.defaults,t),r(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(t){a.prototype[t]=function(e,n){return this.request(u(n||{},{method:t,url:e,data:(n||{}).data}))}})),i.forEach(["post","put","patch"],(function(t){a.prototype[t]=function(e,n,i){return this.request(u(i||{},{method:t,url:e,data:n}))}})),t.exports=a},function(t,e,n){"use strict";var i=n(0);function r(){this.handlers=[]}r.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},r.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},r.prototype.forEach=function(t){i.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=r},function(t,e,n){"use strict";var i=n(0),r=n(30),o=n(14),s=n(15);function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=r(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return u(t),e.data=r(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=r(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e,n){return i.forEach(n,(function(n){t=n(t,e)})),t}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e){i.forEach(t,(function(n,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[i])}))}},function(t,e,n){"use strict";var i=n(17);t.exports=function(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(i("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,i,r){return t.config=e,n&&(t.code=n),t.request=i,t.response=r,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,n){"use strict";var i=n(0);t.exports=i.isStandardBrowserEnv()?{write:function(t,e,n,r,o,s){var u=[];u.push(t+"="+encodeURIComponent(e)),i.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),i.isString(r)&&u.push("path="+r),i.isString(o)&&u.push("domain="+o),!0===s&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var i=n(36),r=n(37);t.exports=function(t,e){return t&&!i(e)?r(t,e):e}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var i=n(0),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,s={};return t?(i.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=i.trim(t.substr(0,o)).toLowerCase(),n=i.trim(t.substr(o+1)),e){if(s[e]&&r.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}})),s):s}},function(t,e,n){"use strict";var i=n(0);t.exports=i.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(t){var i=t;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=r(window.location.href),function(e){var n=i.isString(e)?r(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var i=n(19);function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new i(t),e(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r((function(e){t=e})),cancel:t}},t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(21)),u=n(3),a=n(1),c=n(9);var f=u.makeApiAdapter({id:"ws",supportVersion:a.MIRAI_API_HTTP_VERSION,configMeta:{qq:{type:Number,description:"mirai-api-http服务的QQ号"},verifyKey:{type:String,required:!0,description:"mirai-api-http配置中的verifyKey"},host:{type:String,required:!0,description:"mirai-api-http服务的主机地址",default:function(){return"127.0.0.1"}},port:{type:Number,required:!0,description:"mirai-api-http服务的端口号",default:function(){return 23333}},timeout:{type:Number,description:"发送请求的超时时间(毫秒)",default:function(){return 1e4}},ssl:{type:Boolean,description:"是否使用SSL",default:function(){return!1}}},data:{queue:new Map,syncIdGenerator:function(){var t;return o(this,(function(e){switch(e.label){case 0:t=1,e.label=1;case 1:return[4,t=(t+1)%100];case 2:return e.sent(),[3,1];case 3:return[2]}}))}(),ws:null},methods:{request:function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n=null),r(this,void 0,void 0,(function(){var i,r,s,u,f=this;return o(this,(function(o){switch(o.label){case 0:if(i=this.syncIdGenerator.next().value,!this.listening)return this.logger.error("进行 '"+t+"' 操作前必须启动监听"),[2];r={syncId:i,command:t,subCommand:n,content:e},this.ws.send(JSON.stringify(r),(function(e){e&&f.logger.error("发送请求错误, 请求命令字: "+t+", 请求原始数据:",r,e.message)})),s=0,o.label=1;case 1:return 200*s<this.configs.timeout?this.queue.has(i)?[3,4]:[4,c.sleep(200)]:[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:return(u=this.queue.get(i))?(this.queue.delete(i),"code"in u&&u.code!==a.ResponseCode.Success&&this.logger.warn("发送的请求未能达到预期的效果, 请求命令字: "+t+", 错误原因: "+u.msg+", 请求原始数据:",r),[2,u]):(this.logger.error("发送的请求已超时, 请求原始数据:",r),[2])}}))}))}},listen:function(){return r(this,void 0,void 0,(function(){var t,e=this;return o(this,(function(n){return this.listening||(t=this.configs.qq,this.ws=new s.default("ws"+(this.configs.ssl?"s":"")+"://"+this.configs.host+":"+this.configs.port+"/all?verifyKey="+this.configs.verifyKey+"&qq="+t),this.ws.on("error",(function(t){e.logger.error("监听器启动出错:",t.message)})),this.ws.on("message",(function(t){var n=JSON.parse(t.toString());if("syncId"in n)if("-1"===n.syncId)(i=n.data).type.endsWith("Message")?e.emit("message",i):i.type.endsWith("SyncMessage")?e.emit("sync",i):i.type.endsWith("Event")&&e.emit("event",i);else if(""===n.syncId){var i;(i=n.data).code===a.ResponseCode.Success?(e.listening=!0,e.emit("listen"),e.logger.info("已启动监听")):(e.logger.error("监听器启动失败, 错误原因: "+i.msg),e.ws.close())}else e.queue.set(parseInt(n.syncId),n.data);else e.logger.warn("未能解析的数据:",n)}))),[2]}))}))},stop:function(){this.ws&&this.ws.readyState===this.ws.OPEN&&(this.ws.close(),this.listening=!1,this.logger.info("已停止监听"),this.emit("stop"))},getAbout:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.request("about")];case 1:return[2,t.sent()]}}))}))},getMessageFromId:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("messageFromId",{target:t})];case 1:return[2,e.sent()]}}))}))},getFriendList:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.request("friendList")];case 1:return[2,t.sent()]}}))}))},getGroupList:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.request("groupList")];case 1:return[2,t.sent()]}}))}))},getMemberList:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("memberList",{target:t})];case 1:return[2,e.sent()]}}))}))},getBotProfile:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.request("botProfile")];case 1:return[2,t.sent()]}}))}))},getFriendProfile:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("friendProfile",{target:t})];case 1:return[2,e.sent()]}}))}))},getMemberProfile:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.request("memberProfile",{target:e,memberId:t})];case 1:return[2,n.sent()]}}))}))},getUserProfile:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.request("userProfile",{target:t})]}))}))},sendFriendMessage:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.request("sendFriendMessage",{qq:t,messageChain:e,quote:n})];case 1:return[2,i.sent()]}}))}))},sendGroupMessage:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.request("sendGroupMessage",{group:t,messageChain:e,quote:n})];case 1:return[2,i.sent()]}}))}))},sendTempMessage:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("sendTempMessage",{qq:t,group:e,messageChain:n,quote:i})];case 1:return[2,r.sent()]}}))}))},sendNudge:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.request("sendNudge",{target:t,subject:e,kind:n})];case 1:return[2,i.sent()]}}))}))},recall:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("recall",{target:t})];case 1:return[2,e.sent()]}}))}))},getFileList:function(t,e,n,i,s,u,a){return void 0===s&&(s=1),void 0===u&&(u=100),void 0===a&&(a=!0),r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("file_list",{id:t,path:e,group:n,qq:i,offset:s,size:u,withDownloadInfo:a})];case 1:return[2,r.sent()]}}))}))},getFileInfo:function(t,e,n,i,s){return void 0===s&&(s=!0),r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("file_info",{id:t,path:e,group:n,qq:i,withDownloadInfo:s})];case 1:return[2,r.sent()]}}))}))},createFileDirectory:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("file_mkdir",{id:t,path:e,group:i,qq:s,directoryName:n})];case 1:return[2,r.sent()]}}))}))},deleteFile:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("file_delete",{id:t,path:e,group:n,qq:i})];case 1:return[2,r.sent()]}}))}))},moveFile:function(t,e,n,i,s,u){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("file_move",{id:t,path:e,group:n,qq:i,moveTo:s,moveToPath:u})];case 1:return[2,r.sent()]}}))}))},renameFile:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("file_rename",{id:t,path:e,group:n,qq:i,renameTo:s})];case 1:return[2,r.sent()]}}))}))},deleteFriend:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("deleteFriend",{target:t})];case 1:return[2,e.sent()]}}))}))},muteMember:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.request("mute",{target:e,memberId:t,time:n})];case 1:return[2,i.sent()]}}))}))},unmuteMember:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.request("unmute",{target:e,memberId:t})];case 1:return[2,n.sent()]}}))}))},kickMember:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.request("kick",{target:e,memberId:t,msg:n})];case 1:return[2,i.sent()]}}))}))},quitGroup:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("quit",{target:t})];case 1:return[2,e.sent()]}}))}))},muteAll:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("muteAll",{target:t})];case 1:return[2,e.sent()]}}))}))},unmuteAll:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("unmuteAll",{target:t})];case 1:return[2,e.sent()]}}))}))},setEssence:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("setEssence",{target:t})];case 1:return[2,e.sent()]}}))}))},getGroupConfig:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.request("groupConfig",{target:t},"get")];case 1:return[2,e.sent()]}}))}))},setGroupConfig:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.request("groupConfig",{target:t,config:e},"update")];case 1:return[2,n.sent()]}}))}))},getMemberInfo:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.request("memberInfo",{target:e,memberId:t},"get")];case 1:return[2,n.sent()]}}))}))},setMemberInfo:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.request("memberInfo",{target:e,memberId:t,info:n},"update")];case 1:return[2,i.sent()]}}))}))},setMemberAdmin:function(t,e,n){return void 0===n&&(n=!0),r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return[4,this.request("memberAdmin",{target:e,memberId:t,assign:n})];case 1:return[2,i.sent()]}}))}))},getGroupAnnouncements:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.request("anno_list",{id:t,offset:e,size:n})]}))}))},postGroupAnnouncement:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.request("anno_publish",i({target:t},e))]}))}))},deleteGroupAnnouncement:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.request("anno_delete",{id:t,fid:e})]}))}))},executeCommand:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.request("cmd_execute",{command:t})]}))}))},registerCommand:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.request("cmd_register",{name:t,alias:e,usage:n,description:i})]}))}))},handleNewFriendRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("resp_newFriendRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})];case 1:return[2,r.sent()]}}))}))},handleMemberJoinRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("resp_memberJoinRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})];case 1:return[2,r.sent()]}}))}))},handleBotInvitedJoinGroupRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.request("resp_botInvitedJoinGroupRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})];case 1:return[2,r.sent()]}}))}))},uploadImage:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.logger.error("暂不支持的操作: uploadImage"),[2,null]}))}))},uploadVoice:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.logger.error("暂不支持的操作: uploadVoice"),[2,null]}))}))},uploadGroupFile:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return this.logger.error("暂不支持的操作: uploadGroupFile"),[2,null]}))}))}});t.exports=f},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},u=s(n(11)),a=s(n(20)),c=s(n(21)),f=n(3),l=n(1),d=f.makeApiAdapter({id:"mixed",supportVersion:l.MIRAI_API_HTTP_VERSION,configMeta:{qq:{type:Number,description:"mirai-api-http服务的QQ号"},verifyKey:{type:String,required:!0,description:"mirai-api-http配置中的verifyKey"},host:{type:String,required:!0,description:"mirai-api-http服务的主机地址",default:function(){return"127.0.0.1"}},port:{type:Number,required:!0,description:"mirai-api-http服务的端口号",default:function(){return 23333}},ssl:{type:Boolean,description:"是否使用SSL",default:function(){return!1}}},data:{session:null,ws:null},methods:{request:function(t,e,n,i,s){return void 0===i&&(i=!0),void 0===s&&(s=!1),r(this,void 0,void 0,(function(){var r,a,c;return o(this,(function(o){switch(o.label){case 0:return r={method:n,url:"http"+(this.configs.ssl?"s":"")+"://"+this.configs.host+":"+this.configs.port+"/"+t,headers:{}},"POST"===n?r.data=e:r.params=e,s&&(r.headers=e.getHeaders()),i?this.session?[3,3]:[4,this.verify()]:[3,4];case 1:return o.sent(),[4,this.bind()];case 2:o.sent(),this.session||this.logger.error("session未绑定或已失效"),o.label=3;case 3:r.headers.sessionKey=this.session,o.label=4;case 4:return o.trys.push([4,6,,7]),[4,u.default.request(r)];case 5:return"code"in(a=o.sent().data)&&a.code!==l.ResponseCode.Success&&this.logger.warn("发送的请求未能达到预期的效果, 请求uri: "+t+", 错误原因: "+a.msg+", 请求原始数据:",e),[2,a];case 6:return c=o.sent(),this.logger.error("发送请求错误, 请求原始数据:",e,c.message),[3,7];case 7:return[2]}}))}))},get:function(t,e,n,i){return void 0===n&&(n=!0),void 0===i&&(i=!1),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.request(t,e,"GET",n,i)]}))}))},post:function(t,e,n,i){return void 0===n&&(n=!0),void 0===i&&(i=!1),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.request(t,e,"POST",n,i)]}))}))}},verify:function(){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return[2,new Promise((function(e,n){t.post("verify",{verifyKey:t.configs.verifyKey},!1).then((function(n){n.code===l.ResponseCode.WrongVerifyKey?t.logger.error("认证失败, 错误的verifyKey"):t.session=n.session,e(n)})).catch((function(t){n(t)}))}))]}))}))},bind:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.post("bind",{sessionKey:this.session,qq:this.configs.qq},!1)]}))}))},release:function(){return r(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return[2,new Promise((function(e,n){t.post("release",{sessionKey:t.session,qq:t.configs.qq},!1).then((function(n){t.session=null,e(n)})).catch((function(t){n(t)}))}))]}))}))},listen:function(){return r(this,void 0,void 0,(function(){var t,e=this;return o(this,(function(n){return this.listening||(t=this.configs.qq,this.ws=new c.default("ws"+(this.configs.ssl?"s":"")+"://"+this.configs.host+":"+this.configs.port+"/all?verifyKey="+this.configs.verifyKey+"&qq="+t),this.ws.on("error",(function(t){e.logger.error("监听器启动出错:",t.message)})),this.ws.on("message",(function(t){var n=JSON.parse(t.toString());if("syncId"in n)if("-1"===n.syncId)(i=n.data).type.endsWith("Message")?e.emit("message",i):i.type.endsWith("SyncMessage")?e.emit("sync",i):i.type.endsWith("Event")&&e.emit("event",i);else if(""===n.syncId){var i;(i=n.data).code===l.ResponseCode.Success?(e.listening=!0,e.emit("listen"),e.logger.info("已启动监听")):(e.logger.error("监听器启动失败, 错误原因: "+i.msg),e.ws.close())}else e.queue.set(parseInt(n.syncId),n.data);else e.logger.warn("未能解析的数据:",n)}))),[2]}))}))},stop:function(){this.ws&&this.ws.readyState===this.ws.OPEN&&(this.ws.close(),this.listening=!1,this.logger.info("已停止监听"),this.emit("stop"))},getAbout:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("about",null,!1)]}))}))},getMessageFromId:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("messageFromId",{id:t})]}))}))},getBotProfile:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("botProfile")]}))}))},getFriendList:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("friendList")]}))}))},getGroupList:function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.get("groupList")]}))}))},getMemberList:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("memberList",{target:t})]}))}))},getFriendProfile:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("friendProfile",{target:t})]}))}))},getMemberProfile:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.get("memberProfile",{target:e,memberId:t})]}))}))},getUserProfile:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("userProfile",{target:t})]}))}))},sendFriendMessage:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("sendFriendMessage",{target:t,messageChain:e,quote:n})]}))}))},sendGroupMessage:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("sendGroupMessage",{target:t,messageChain:e,quote:n})]}))}))},sendTempMessage:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("sendTempMessage",{qq:t,group:e,messageChain:n,quote:i})]}))}))},sendNudge:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("sendNudge",{target:t,subject:e,kind:n})]}))}))},recall:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("recall",{target:t})]}))}))},getFileList:function(t,e,n,i,s,u,a){return void 0===s&&(s=1),void 0===u&&(u=100),void 0===a&&(a=!0),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.get("file/list",{id:t,path:e,group:n,qq:i,offset:s,size:u,withDownloadInfo:a})]}))}))},getFileInfo:function(t,e,n,i,s){return void 0===s&&(s=!0),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.get("file/info",{id:t,path:e,group:n,qq:i,withDownloadInfo:s})]}))}))},createFileDirectory:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/mkdir",{id:t,path:e,group:i,qq:s,directoryName:n})]}))}))},deleteFile:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/delete",{id:t,path:e,group:n,qq:i})]}))}))},moveFile:function(t,e,n,i,s,u){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/move",{id:t,path:e,group:n,qq:i,moveTo:s,moveToPath:u})]}))}))},renameFile:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("file/rename",{id:t,path:e,group:n,qq:i,renameTo:s})]}))}))},deleteFriend:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("deleteFriend",{target:t})]}))}))},muteMember:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("mute",{target:e,memberId:t,time:n})]}))}))},unmuteMember:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("unmute",{target:e,memberId:t})]}))}))},kickMember:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("kick",{target:e,memberId:t,msg:n})]}))}))},quitGroup:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("quit",{target:t})]}))}))},muteAll:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("muteAll",{target:t})]}))}))},unmuteAll:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("unmuteAll",{target:t})]}))}))},setEssence:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("setEssence",{target:t})]}))}))},getGroupConfig:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.get("groupConfig",{target:t})]}))}))},setGroupConfig:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("groupConfig",{target:t,config:e})]}))}))},getMemberInfo:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.get("memberInfo",{target:e,memberId:t})]}))}))},setMemberInfo:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("memberInfo",{target:e,memberId:t,info:n})]}))}))},setMemberAdmin:function(t,e,n){return void 0===n&&(n=!0),r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.post("memberAdmin",{target:e,memberId:t,assign:n})]}))}))},executeCommand:function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.post("cmd/execute",{command:t})]}))}))},registerCommand:function(t,e,n,i){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("cmd/register",{name:t,alias:e,usage:n,description:i})]}))}))},getGroupAnnouncements:function(t,e,n){return r(this,void 0,void 0,(function(){return o(this,(function(i){return[2,this.get("anno/list",{id:t,offset:e,size:n})]}))}))},postGroupAnnouncement:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("anno/publish",i({target:t},e))]}))}))},deleteGroupAnnouncement:function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.post("anno/delete",{id:t,fid:e})]}))}))},handleNewFriendRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("resp/newFriendRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})]}))}))},handleMemberJoinRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("resp/memberJoinRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})]}))}))},handleBotInvitedJoinGroupRequest:function(t,e,n,i,s){return r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.post("resp/botInvitedJoinGroupRequestEvent",{eventId:t,fromId:e,groupId:n,operate:i,message:s})]}))}))},uploadImage:function(t,e){return r(this,void 0,void 0,(function(){var n;return o(this,(function(i){return(n=new a.default).append("type",t),n.append("img",e),[2,this.post("uploadImage",n,!0,!0)]}))}))},uploadVoice:function(t,e){return r(this,void 0,void 0,(function(){var n;return o(this,(function(i){return(n=new a.default).append("type",t),n.append("voice",e),[2,this.post("uploadVoice",n,!0,!0)]}))}))},uploadGroupFile:function(t,e,n){return r(this,void 0,void 0,(function(){var i;return o(this,(function(r){return(i=new a.default).append("type",t),i.append("path",e),i.append("file",n),[2,this.post("uploadFile",i,!0,!0)]}))}))}});t.exports=d},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.makePie=e.PieFilter=void 0;var o=r(n(6)),s=n(7),u=n(2),a=n(4),c=function(){function t(){}return t.atMe={sign:"AtMe",handler:function(t,e){return e.selected("At").some((function(t){return t.target===a.MiraiPieApplication.instance.qq}))}},t.atAll={sign:"AtAll",handler:function(t,e){return e.selected("AtAll").length>0}},t.fromFriend={sign:"FromFriend",handler:function(t){return t.isFriendChat()}},t.fromGroup={sign:"FromGroup",handler:function(t){return t.isGroupChat()}},t.fromMember={sign:"FromMember",handler:function(t){return t.isTempChat()}},t.at=function(t){return{sign:"At("+t+")",handler:function(e,n){return n.selected("At").some((function(e){return e.target===t}))}}},t.from=function(t){return{sign:"From("+t+")",handler:function(e){return e.contact.id===t}}},t.notFrom=function(t){return{sign:"NotFrom("+t+")",handler:function(e){return e.contact.id!==t}}},t.containsType=function(t){return{sign:"ContainsType("+t+")",handler:function(e,n){return n.selected(t).length>0}}},t.displayStringMatch=function(t){return{sign:"DisplayStringMatch("+t+")",handler:function(e,n){return null!==n.toDisplayString().match(t)}}},t.displayStringEquals=function(t){return{sign:"DisplayStringEquals("+t+")",handler:function(e,n){return n.toDisplayString()===t}}},t.or=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{sign:"Or("+t.map((function(t){return t.sign})).join(", ")+")",handler:function(e,n,i){return t.some((function(t){return t.handler(e,n,i)}))}}},t}();e.PieFilter=c,e.makePie=function(t){var e=Object.assign(new o.default,i(i(i({},t.data||{}),t.methods||{}),{id:t.id,name:t.name,author:t.author,version:t.version,description:t.description||"",authorUrl:t.authorUrl||"",projectUrl:t.projectUrl||"",configMeta:t.configMeta||{},configs:u.makeConfigs(t.configMeta),filters:t.filters||[],logger:s.getLogger("pie:"+t.id),__isPie:!0}));return"function"==typeof t.received&&e.on("received",(function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return t.received.apply(e,n)})),"function"==typeof t.installed&&e.on("installed",(function(){return t.installed.apply(e)})),"function"==typeof t.uninstalled&&e.on("uninstalled",(function(){return t.uninstalled.apply(e)})),"function"==typeof t.enabled&&e.on("enabled",(function(){return t.enabled.apply(e)})),"function"==typeof t.disabled&&e.on("disabled",(function(){return t.disabled.apply(e)})),e}}])}));
//# sourceMappingURL=miraipie.bundle.js.map