(self["webpackChunkRaingad_IM"]=self["webpackChunkRaingad_IM"]||[]).push([[789],{3585:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return d}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"m-20"},[e("el-tabs",{attrs:{type:"border-card"}},[e("el-tab-pane",[e("span",{attrs:{slot:"label"},slot:"label"},[e("i",{staticClass:"el-icon-setting"}),t._v(" 基础设置")]),e("el-form",{ref:"sysInfo",staticStyle:{width:"600px"},attrs:{model:t.sysInfo,rules:t.rules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"系统名称",prop:"name"}},[e("el-input",{attrs:{placeholder:"请输入系统名称"},model:{value:t.sysInfo.name,callback:function(e){t.$set(t.sysInfo,"name",e)},expression:"sysInfo.name"}})],1),e("el-form-item",{attrs:{label:"系统描述",prop:"description"}},[e("el-input",{attrs:{placeholder:"请输入系统描述"},model:{value:t.sysInfo.description,callback:function(e){t.$set(t.sysInfo,"description",e)},expression:"sysInfo.description"}})],1),e("el-form-item",{attrs:{label:"系统LOGO",prop:"logo"}},[e("el-upload",{staticClass:"avatar-uploader",attrs:{headers:t.getToken,action:t.getUrl,"show-file-list":!1,"on-success":t.uploadSuccess,"on-change":t.change,"before-upload":t.beforeAvatarUpload}},[t.sysInfo.logo?e("img",{staticClass:"avatar",attrs:{src:t.sysInfo.logo}}):e("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),e("el-input",{staticStyle:{display:"none"},model:{value:t.sysInfo.logo,callback:function(e){t.$set(t.sysInfo,"logo",e)},expression:"sysInfo.logo"}})],1),e("el-form-item",{attrs:{label:"注册方式",prop:"regtype"}},[e("el-radio-group",{model:{value:t.sysInfo.regtype,callback:function(e){t.$set(t.sysInfo,"regtype",e)},expression:"sysInfo.regtype"}},[e("el-radio",{attrs:{label:"1",border:""}},[t._v("开启注册")]),e("el-radio",{attrs:{label:"2",border:""}},[t._v("邀请注册")])],1),e("div",{directives:[{name:"show",rawName:"v-show",value:2==t.sysInfo.regtype,expression:"sysInfo.regtype==2"}],staticClass:"mt-15"},[e("el-input",{staticClass:"input-with-select",model:{value:t.inviteUrl,callback:function(e){t.inviteUrl=e},expression:"inviteUrl"}},[e("el-button",{attrs:{slot:"append"},on:{click:t.copyUrl},slot:"append"},[t._v("复制链接")])],1),e("div",{staticClass:"mt-15"},[e("span",{staticClass:"c-999 f-12 mr-10"},[t._v("邀请链接有效期:48小时")]),t._v(" "),e("el-button",{on:{click:t.resetInviteUrl}},[t._v("重新生成")])],1),e("vue-qr",{ref:"qrCode",attrs:{text:t.inviteUrl,width:"200",height:"200",logoSrc:t.sysInfo.logo}})],1)],1),e("el-form-item",{attrs:{label:"注册时间间隔",prop:"registerInterval"}},[e("el-input-number",{staticClass:"ml-10",attrs:{min:0,step:60},model:{value:t.sysInfo.registerInterval,callback:function(e){t.$set(t.sysInfo,"registerInterval",e)},expression:"sysInfo.registerInterval"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("秒,0表示不限制,防止用户无限注册,仅限单IP")])],1),e("el-form-item",{attrs:{label:"注册认证",prop:"regauth"}},[e("el-radio-group",{model:{value:t.sysInfo.regauth,callback:function(e){t.$set(t.sysInfo,"regauth",e)},expression:"sysInfo.regauth"}},[e("el-radio",{attrs:{label:"0",border:""}},[t._v("关闭")]),e("el-radio",{attrs:{label:"1",border:""}},[t._v("手机号")]),e("el-radio",{attrs:{label:"2",border:""}},[t._v("邮箱")]),e("el-radio",{attrs:{label:"3",border:""}},[t._v("手机号+邮箱")])],1)],1),e("el-form-item",{attrs:{label:"开启IP定位",prop:"ipregion"}},[e("el-radio-group",{model:{value:t.sysInfo.ipregion,callback:function(e){t.$set(t.sysInfo,"ipregion",e)},expression:"sysInfo.ipregion"}},[e("el-radio",{attrs:{label:"0",border:""}},[t._v("关闭")]),e("el-radio",{attrs:{label:"1",border:""}},[t._v("开启")])],1)],1),e("el-form-item",{attrs:{label:"多端同时登录",prop:"multipleLogin"}},[e("el-radio-group",{model:{value:t.sysInfo.multipleLogin,callback:function(e){t.$set(t.sysInfo,"multipleLogin",e)},expression:"sysInfo.multipleLogin"}},[e("el-radio",{attrs:{label:"0",border:""}},[t._v("关闭")]),e("el-radio",{attrs:{label:"1",border:""}},[t._v("开启")])],1)],1),e("el-form-item",{attrs:{label:"运行模式",prop:"runMode"}},[e("el-radio-group",{model:{value:t.sysInfo.runMode,callback:function(e){t.$set(t.sysInfo,"runMode",e)},expression:"sysInfo.runMode"}},[e("el-radio",{attrs:{label:"1",border:""}},[t._v("企业模式")]),e("el-radio",{attrs:{label:"2",border:""}},[t._v("社交模式")])],1)],1),e("el-form-item",{directives:[{name:"show",rawName:"v-show",value:1==t.sysInfo.runMode,expression:"sysInfo.runMode==1"}],attrs:{label:"自由改名",prop:"diyName"}},[e("el-radio-group",{model:{value:t.sysInfo.diyName,callback:function(e){t.$set(t.sysInfo,"diyName",e)},expression:"sysInfo.diyName"}},[e("el-radio",{attrs:{label:"0",border:""}},[t._v("关闭")]),e("el-radio",{attrs:{label:"1",border:""}},[t._v("开启")])],1),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("企业模式下默认不允许自由改名,开启后生效")])],1),e("el-form-item",{attrs:{label:"系统状态",prop:"state"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.sysInfo.state,callback:function(e){t.$set(t.sysInfo,"state",e)},expression:"sysInfo.state"}}),e("div",{directives:[{name:"show",rawName:"v-show",value:0==t.sysInfo.state,expression:"sysInfo.state==0"}]},[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("关闭提示语")]),e("el-input",{attrs:{placeholder:"请输入系统关闭后的提示语",type:"textarea"},model:{value:t.sysInfo.closeTips,callback:function(e){t.$set(t.sysInfo,"closeTips",e)},expression:"sysInfo.closeTips"}})],1)],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("sysInfo")}}},[t._v("保存")])],1)],1)],1),e("el-tab-pane",[e("span",{attrs:{slot:"label"},slot:"label"},[e("i",{staticClass:"el-icon-chat-line-square"}),t._v(" 聊天设置")]),e("el-form",{ref:"chatInfo",staticClass:"demo-chatInfo",attrs:{model:t.chatInfo,rules:t.chatRules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"允许用户私聊",prop:"simpleChat"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.simpleChat,callback:function(e){t.$set(t.chatInfo,"simpleChat",e)},expression:"chatInfo.simpleChat"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("关闭后,用户将无法私聊")])],1),e("el-form-item",{attrs:{label:"允许用户建群",prop:"groupChat"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.groupChat,callback:function(e){t.$set(t.chatInfo,"groupChat",e)},expression:"chatInfo.groupChat"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("关闭后,用户将无法创建群聊")])],1),e("el-form-item",{attrs:{label:"群聊最多人数",prop:"groupUserMax"}},[e("el-input-number",{staticClass:"ml-10",attrs:{min:0,max:1e3},model:{value:t.chatInfo.groupUserMax,callback:function(e){t.$set(t.chatInfo,"groupUserMax",e)},expression:"chatInfo.groupUserMax"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("人,0表示不限制,不建议超过300人")])],1),e("el-form-item",{attrs:{label:"开启在线状态",prop:"online"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.online,callback:function(e){t.$set(t.chatInfo,"online",e)},expression:"chatInfo.online"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("开启后,用户可以看到联系人的在线状态")])],1),e("el-form-item",{attrs:{label:"消息发送频率",prop:"sendInterval"}},[e("el-input-number",{staticClass:"ml-10",attrs:{min:0,max:1e3},model:{value:t.chatInfo.sendInterval,callback:function(e){t.$set(t.chatInfo,"sendInterval",e)},expression:"chatInfo.sendInterval"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("秒,0表示不限制,防止用户刷消息")])],1),e("el-form-item",{attrs:{label:"消息撤回时间",prop:"redoTime"}},[e("el-input-number",{staticClass:"ml-10",attrs:{min:0,max:86400},model:{value:t.chatInfo.redoTime,callback:function(e){t.$set(t.chatInfo,"redoTime",e)},expression:"chatInfo.redoTime"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("秒,0表示不支持撤回")])],1),e("el-form-item",{attrs:{label:"消息双向删除",prop:"dbDelMsg"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.dbDelMsg,callback:function(e){t.$set(t.chatInfo,"dbDelMsg",e)},expression:"chatInfo.dbDelMsg"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("开启后,用户删除消息会删除双方,仅限删除自己发送的")])],1),e("el-form-item",{attrs:{label:"消息自动清理",prop:"msgClear"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.msgClear,callback:function(e){t.$set(t.chatInfo,"msgClear",e)},expression:"chatInfo.msgClear"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("开启后,将会自动删除系统内的聊天记录")]),e("div",{directives:[{name:"show",rawName:"v-show",value:1==t.chatInfo.msgClear,expression:"chatInfo.msgClear==1"}]},[e("span",{staticClass:"c-999 f-12"},[t._v("消息最大保留天数")]),e("el-input-number",{staticClass:"ml-10",attrs:{min:0,max:1e3},model:{value:t.chatInfo.msgClearDay,callback:function(e){t.$set(t.chatInfo,"msgClearDay",e)},expression:"chatInfo.msgClearDay"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("系统在每日凌晨2点自动清理该天数以前的消息")])],1)],1),e("el-form-item",{attrs:{label:"自动添加客服",prop:"autoAddUser"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.autoAddUser.status,callback:function(e){t.$set(t.chatInfo.autoAddUser,"status",e)},expression:"chatInfo.autoAddUser.status"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("开启后,用户注册之后自动设置为专属客服。")]),e("div",{directives:[{name:"show",rawName:"v-show",value:"1"==t.chatInfo.autoAddUser.status,expression:"chatInfo.autoAddUser.status=='1'"}],staticClass:"mt-10"},[e("div",{staticClass:"lz-flex"},[e("span",{staticClass:"c-999 f-12"},[t._v("客服人员:")]),e("user-select",{attrs:{width:"300px"},on:{change:t.changeUser},model:{value:t.chatInfo.autoAddUser.user_items,callback:function(e){t.$set(t.chatInfo.autoAddUser,"user_items",e)},expression:"chatInfo.autoAddUser.user_items"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("如果选择多个则循环设置")])],1),e("div",{staticClass:"mt-10"},[e("span",{staticClass:"c-999 f-12"},[t._v("欢迎语")]),e("el-input",{staticClass:"ml-10",staticStyle:{width:"300px"},attrs:{type:"text"},model:{value:t.chatInfo.autoAddUser.welcome,callback:function(e){t.$set(t.chatInfo.autoAddUser,"welcome",e)},expression:"chatInfo.autoAddUser.welcome"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("通过客服自动发送给新注册的人员")])],1)])],1),e("el-form-item",{attrs:{label:"自动加入群聊",prop:"autoAddGroup"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.autoAddGroup.status,callback:function(e){t.$set(t.chatInfo.autoAddGroup,"status",e)},expression:"chatInfo.autoAddGroup.status"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("开启后,用户注册之后自动加入群聊。")]),e("div",{directives:[{name:"show",rawName:"v-show",value:"1"==t.chatInfo.autoAddGroup.status,expression:"chatInfo.autoAddGroup.status=='1'"}]},[e("div",{staticClass:"mt-10"},[e("span",{staticClass:"c-999 f-12"},[t._v("群聊名称")]),e("el-input",{staticClass:"ml-10",staticStyle:{width:"180px"},attrs:{type:"text",placeholder:"请输入群聊名称"},model:{value:t.chatInfo.autoAddGroup.name,callback:function(e){t.$set(t.chatInfo.autoAddGroup,"name",e)},expression:"chatInfo.autoAddGroup.name"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("自动生成群聊名称")])],1),e("div",{staticClass:"lz-flex mt-10"},[e("span",{staticClass:"c-999 f-12"},[t._v("默认群主:")]),e("user-select",{attrs:{width:"180px",radio:!0},on:{change:t.changeOwner},model:{value:t.chatInfo.autoAddGroup.owner_uid,callback:function(e){t.$set(t.chatInfo.autoAddGroup,"owner_uid",e)},expression:"chatInfo.autoAddGroup.owner_uid"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("选择后将自动设置为默认群主")])],1),e("div",{staticClass:"mt-10"},[e("span",{staticClass:"c-999 f-12"},[t._v("群聊成员上限:")]),e("el-input-number",{attrs:{min:5,max:1e3},model:{value:t.chatInfo.autoAddGroup.userMax,callback:function(e){t.$set(t.chatInfo.autoAddGroup,"userMax",e)},expression:"chatInfo.autoAddGroup.userMax"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("达到上限后自动创建新的群聊")])],1)])],1),e("el-form-item",{attrs:{label:"音视频通话",prop:"webrtc"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.chatInfo.webrtc,callback:function(e){t.$set(t.chatInfo,"webrtc",e)},expression:"chatInfo.webrtc"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("开启后,可以进行音视频通话,仅支持1对1音视频")]),e("div",{directives:[{name:"show",rawName:"v-show",value:1==t.chatInfo.webrtc,expression:"chatInfo.webrtc==1"}]},[e("div",{staticClass:"mt-15"},[e("span",{staticClass:"c-999 f-12"},[t._v("turn服务器")]),e("el-input",{staticClass:"ml-10",staticStyle:{width:"300px"},attrs:{type:"text",placeholder:"请输入stun服务器"},model:{value:t.chatInfo.stun,callback:function(e){t.$set(t.chatInfo,"stun",e)},expression:"chatInfo.stun"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("音视频通话需要有Stun服务器才可以进行,请加`turn:`协议头")])],1),e("div",{staticClass:"mt-15"},[e("span",{staticClass:"c-999 f-12"},[t._v("turn用户名")]),e("el-input",{staticClass:"ml-10",staticStyle:{width:"300px"},attrs:{type:"text",placeholder:"请输入stun用户名"},model:{value:t.chatInfo.stunUser,callback:function(e){t.$set(t.chatInfo,"stunUser",e)},expression:"chatInfo.stunUser"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("如果是公开的则可以不填写")])],1),e("div",{staticClass:"mt-15"},[e("span",{staticClass:"c-999 f-12"},[t._v("turn密码")]),e("el-input",{staticClass:"ml-10",staticStyle:{width:"300px"},attrs:{type:"text",placeholder:"请输入stun服务器密码"},model:{value:t.chatInfo.stunPass,callback:function(e){t.$set(t.chatInfo,"stunPass",e)},expression:"chatInfo.stunPass"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("如果是公开的则可以不填写")])],1)])],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("chatInfo")}}},[t._v("保存")])],1)],1)],1),e("el-tab-pane",[e("span",{attrs:{slot:"label"},slot:"label"},[e("i",{staticClass:"el-icon-message"}),t._v(" 邮件短信设置")]),e("el-alert",{staticClass:"mb-20",attrs:{title:"系统支持短信验证码,请到项目:[根目录/config/sms.php] 中配置短信开放平台的参数,支持阿里云、腾讯云、七牛云、又拍云、Ucloud和华为云。",type:"warning"}}),e("el-form",{ref:"smtp",staticStyle:{width:"500px"},attrs:{model:t.smtp,rules:t.smtpRules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"邮件服务器",prop:"host"}},[e("el-input",{attrs:{placeholder:"请输入邮件服务器,如:smtp.mail.qq.com"},model:{value:t.smtp.host,callback:function(e){t.$set(t.smtp,"host",e)},expression:"smtp.host"}})],1),e("el-form-item",{attrs:{label:"端口号",prop:"port"}},[e("el-input-number",{attrs:{min:0,max:99999},model:{value:t.smtp.port,callback:function(e){t.$set(t.smtp,"port",e)},expression:"smtp.port"}})],1),e("el-form-item",{attrs:{label:"加密方式",prop:"security"}},[e("el-radio-group",{model:{value:t.smtp.security,callback:function(e){t.$set(t.smtp,"security",e)},expression:"smtp.security"}},[e("el-radio",{attrs:{label:"ssl",border:""}},[t._v("SSL")]),e("el-radio",{attrs:{label:"tls",border:""}},[t._v("TLS")])],1)],1),e("el-form-item",{attrs:{label:"发件人邮箱",prop:"addr"}},[e("el-input",{attrs:{placeholder:"请输入发件人的邮箱"},model:{value:t.smtp.addr,callback:function(e){t.$set(t.smtp,"addr",e)},expression:"smtp.addr"}})],1),e("el-form-item",{attrs:{label:"发件人密码",prop:"pass"}},[e("el-input",{attrs:{"show-password":"",placeholder:"请输入发件人的密码"},model:{value:t.smtp.pass,callback:function(e){t.$set(t.smtp,"pass",e)},expression:"smtp.pass"}})],1),e("el-form-item",{attrs:{label:"发件人签名",prop:"sign"}},[e("el-input",{attrs:{placeholder:"请输入发件人签名"},model:{value:t.smtp.sign,callback:function(e){t.$set(t.smtp,"sign",e)},expression:"smtp.sign"}})],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("smtp")}}},[t._v("保存")])],1),e("el-form-item",{attrs:{label:"测试邮件"}},[e("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入邮件地址"},model:{value:t.textEmail,callback:function(e){t.textEmail=e},expression:"textEmail"}},[e("el-button",{attrs:{slot:"append",icon:"el-icon-s-promotion",loading:t.loadding},on:{click:t.sendEmail},slot:"append"},[t._v("发送")])],1)],1)],1)],1),e("el-tab-pane",[e("span",{attrs:{slot:"label"},slot:"label"},[e("i",{staticClass:"el-icon-upload"}),t._v(" 文件上传设置")]),e("div",{staticClass:"mb-20"},[e("el-alert",{attrs:{title:"一旦设置了储存位置,就不能再进行更改,否则之前的文件或者图片加载就会出错!此修改会变更环境变量中的参数,请慎重操作!",type:"warning","show-icon":"",closable:!1}})],1),e("el-form",{ref:"fileUpload",staticStyle:{width:"600px"},attrs:{model:t.fileUpload,rules:t.fileRules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"储存位置",prop:"disk"}},[e("el-radio-group",{model:{value:t.fileUpload.disk,callback:function(e){t.$set(t.fileUpload,"disk",e)},expression:"fileUpload.disk"}},[e("el-radio",{attrs:{label:"local",border:""}},[t._v("本地")]),e("el-radio",{attrs:{label:"aliyun",border:""}},[t._v("阿里云")]),e("el-radio",{attrs:{label:"qiniu",border:""}},[t._v("七牛云")]),e("el-radio",{attrs:{label:"qcloud",border:""}},[t._v("腾讯云")])],1)],1),e("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"aliyun"==t.fileUpload.disk,expression:"fileUpload.disk=='aliyun'"}],attrs:{label:"阿里云配置"}},[e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("accessId")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入阿里云OSS平台的accessId"},model:{value:t.fileUpload.aliyun.accessId,callback:function(e){t.$set(t.fileUpload.aliyun,"accessId",e)},expression:"fileUpload.aliyun.accessId"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("accessSecret")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入阿里云OSS平台的accessSecret"},model:{value:t.fileUpload.aliyun.accessSecret,callback:function(e){t.$set(t.fileUpload.aliyun,"accessSecret",e)},expression:"fileUpload.aliyun.accessSecret"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("endpoint")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入阿里云OSS平台的endpoint"},model:{value:t.fileUpload.aliyun.endpoint,callback:function(e){t.$set(t.fileUpload.aliyun,"endpoint",e)},expression:"fileUpload.aliyun.endpoint"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("bucket")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入阿里云OSS平台的bucket"},model:{value:t.fileUpload.aliyun.bucket,callback:function(e){t.$set(t.fileUpload.aliyun,"bucket",e)},expression:"fileUpload.aliyun.bucket"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("url")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入阿里云OSS平台的域名"},model:{value:t.fileUpload.aliyun.url,callback:function(e){t.$set(t.fileUpload.aliyun,"url",e)},expression:"fileUpload.aliyun.url"}})],1)]),e("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"qiniu"==t.fileUpload.disk,expression:"fileUpload.disk=='qiniu'"}],attrs:{label:"七牛云配置"}},[e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("accessKey")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入七牛云平台的accessKey"},model:{value:t.fileUpload.qiniu.accessKey,callback:function(e){t.$set(t.fileUpload.qiniu,"accessKey",e)},expression:"fileUpload.qiniu.accessKey"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("secretKey")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入七牛云平台的secretKey"},model:{value:t.fileUpload.qiniu.secretKey,callback:function(e){t.$set(t.fileUpload.qiniu,"secretKey",e)},expression:"fileUpload.qiniu.secretKey"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("bucket")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入七牛云平台的bucket"},model:{value:t.fileUpload.qiniu.bucket,callback:function(e){t.$set(t.fileUpload.qiniu,"bucket",e)},expression:"fileUpload.qiniu.bucket"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("url")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入七牛云平台的域名"},model:{value:t.fileUpload.qiniu.url,callback:function(e){t.$set(t.fileUpload.qiniu,"url",e)},expression:"fileUpload.qiniu.url"}})],1)]),e("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"qcloud"==t.fileUpload.disk,expression:"fileUpload.disk=='qcloud'"}],attrs:{label:"腾讯云配置"}},[e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("appId")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入腾讯云平台的appId"},model:{value:t.fileUpload.qcloud.appId,callback:function(e){t.$set(t.fileUpload.qcloud,"appId",e)},expression:"fileUpload.qcloud.appId"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("secretId")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入腾讯云平台的secretId"},model:{value:t.fileUpload.qcloud.secretId,callback:function(e){t.$set(t.fileUpload.qcloud,"secretId",e)},expression:"fileUpload.qcloud.secretId"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("secretKey")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入腾讯云平台的secretKey"},model:{value:t.fileUpload.qcloud.secretKey,callback:function(e){t.$set(t.fileUpload.qcloud,"secretKey",e)},expression:"fileUpload.qcloud.secretKey"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("region")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入腾讯云平台的region"},model:{value:t.fileUpload.qcloud.region,callback:function(e){t.$set(t.fileUpload.qcloud,"region",e)},expression:"fileUpload.qcloud.region"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("bucket")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入腾讯云平台的bucket"},model:{value:t.fileUpload.qcloud.bucket,callback:function(e){t.$set(t.fileUpload.qcloud,"bucket",e)},expression:"fileUpload.qcloud.bucket"}})],1),e("div",[e("span",{staticClass:"mr-10 c-999 f-12"},[t._v("cdn")]),t._v(" "),e("el-input",{attrs:{placeholder:"请输入腾讯云平台的域名"},model:{value:t.fileUpload.qcloud.cdn,callback:function(e){t.$set(t.fileUpload.qcloud,"cdn",e)},expression:"fileUpload.qcloud.cdn"}})],1)]),e("el-form-item",{attrs:{label:"文件预览地址",prop:"preview"}},[e("el-input",{attrs:{placeholder:"请输入文件预览的地址,若无则使用默认预览工具"},model:{value:t.fileUpload.preview,callback:function(e){t.$set(t.fileUpload,"preview",e)},expression:"fileUpload.preview"}})],1),e("el-form-item",{attrs:{label:"文件大小限制",prop:"size"}},[e("el-input-number",{attrs:{min:0,max:500,label:""},model:{value:t.fileUpload.size,callback:function(e){t.$set(t.fileUpload,"size",e)},expression:"fileUpload.size"}}),t._v(" "),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("MB")])],1),e("el-form-item",{attrs:{label:"文件格式限制",prop:"fileExt"}},[e("el-select",{staticStyle:{width:"480px"},attrs:{multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"请输入允许上传的文件格式"},model:{value:t.fileUpload.fileExt,callback:function(e){t.$set(t.fileUpload,"fileExt",e)},expression:"fileUpload.fileExt"}},t._l(t.options,(function(t,r){return e("el-option",{key:r,attrs:{label:t,value:t}})})),1)],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("fileUpload")}}},[t._v("保存")])],1)],1)],1),e("el-tab-pane",[e("span",{attrs:{slot:"label"},slot:"label"},[e("i",{staticClass:"el-icon-discover"}),t._v(" 探索设置")]),e("el-alert",{staticClass:"mb-15",attrs:{"show-icon":"",closable:!1,title:"应用内的链接一定要是 '/' 开头,外部URL需要带协议头,以 '/' 结尾;图标、名称、链接为必填项,如果没填写则无法保存。该功能只对移动端有效!",type:"warning"}}),e("el-form",{ref:"compass",attrs:{model:t.compass,rules:t.compassRules,"label-width":"120px"}},[e("el-form-item",{attrs:{label:"开启探索"}},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.compass.status,callback:function(e){t.$set(t.compass,"status",e)},expression:"compass.status"}}),e("span",{staticClass:"ml-10 c-999 f-12"},[t._v("关闭后,不显示探索页面")])],1),e("el-form-item",{attrs:{label:"展示模式"}},[e("el-radio-group",{model:{value:t.compass.mode,callback:function(e){t.$set(t.compass,"mode",e)},expression:"compass.mode"}},[e("el-radio",{attrs:{label:"1",border:""}},[t._v("列表模式")]),e("el-radio",{attrs:{label:"2",border:""}},[t._v("宫格模式")])],1)],1),e("el-form-item",{attrs:{label:"应用列表"}},[e("div",{staticClass:"lz-flex lz-align-items-center lz-align-content-center"},[e("div",{staticClass:"ml-10",staticStyle:{width:"60px"}},[t._v("图标")]),e("div",{staticStyle:{width:"130px"}},[t._v("名称")]),e("div",{staticStyle:{width:"130px"}},[t._v("类型")]),e("div",{staticStyle:{width:"310px"}},[t._v("链接")]),e("div",{staticStyle:{width:"80px"}},[t._v("排序")]),e("div",{staticStyle:{width:"60px"}},[t._v("状态")]),e("div",{staticStyle:{width:"60px"}},[t._v("操作")])])]),t._l(t.compass.list,(function(r,n){return e("el-form-item",{key:n,attrs:{prop:"list"}},[e("div",{staticClass:"lz-flex lz-align-items-center lz-align-content-center"},[e("el-upload",{staticClass:"avatar-uploader mr-10",staticStyle:{width:"50px",height:"50px"},attrs:{headers:t.getToken,action:t.getUrl,"show-file-list":!1,"on-success":t.iconUploadSuccess.bind(null,n)}},[r.icon?e("img",{staticClass:"avatar",staticStyle:{width:"50px",height:"50px"},attrs:{src:r.icon}}):e("i",{staticClass:"el-icon-plus avatar-uploader-icon",staticStyle:{width:"50px",height:"50px","line-height":"50px"}}),e("el-input",{staticStyle:{display:"none"},model:{value:r.icon,callback:function(e){t.$set(r,"icon",e)},expression:"item.icon"}})],1),e("el-input",{staticClass:"mr-10",staticStyle:{width:"120px"},model:{value:r.name,callback:function(e){t.$set(r,"name",e)},expression:"item.name"}}),e("el-select",{staticClass:"mr-10",staticStyle:{width:"120px"},attrs:{placeholder:"请选择应用类型"},model:{value:r.type,callback:function(e){t.$set(r,"type",e)},expression:"item.type"}},[e("el-option",{attrs:{label:"应用内",value:"1"}}),e("el-option",{attrs:{label:"外部URL",value:"2"}})],1),e("el-input",{staticClass:"mr-10",staticStyle:{width:"300px"},model:{value:r.url,callback:function(e){t.$set(r,"url",e)},expression:"item.url"}}),e("el-input",{staticClass:"mr-10",staticStyle:{width:"80px"},model:{value:r.order,callback:function(e){t.$set(r,"order",e)},expression:"item.order"}}),e("el-switch",{staticStyle:{width:"60px"},attrs:{"active-value":"1","inactive-value":"0"},model:{value:r.status,callback:function(e){t.$set(r,"status",e)},expression:"item.status"}}),e("el-button",{attrs:{type:"danger",icon:"el-icon-minus",circle:""},on:{click:function(e){return t.delAppItem(r)}}})],1)])})),e("el-form-item",[e("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.addAppItem}},[t._v("添加应用")])],1),e("el-form-item",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitForm("compass")}}},[t._v("保存")])],1)],2)],1)],1)],1)},o=[],i=(r(7658),r(4462)),a=r.n(i),s=r(8867),l=r.n(s),c=r(6647),u={components:{VueQr:l(),userSelect:c.Z},data(){return{loadding:!1,sysInfo:{name:"",description:"",logo:"",regtype:"1",registerInterval:0,regauth:"2",ipregion:"1",runMode:"1",diyName:"0",state:!0,closeTips:"",multipleLogin:"0"},chatInfo:{simpleChat:!0,groupChat:!0,groupUserMax:0,online:!0,msgClear:!0,msgClearDay:0,webrtc:!0,stun:"",stunUser:"",stunPass:"",sendInterval:"",redoTime:120,dbDelMsg:!1,autoAddGroup:{status:0,userMax:"",owner_uid:"",owner_info:[],name:""},autoAddUser:{status:0,user_ids:[],user_items:[]}},smtp:{host:"",port:465,security:"ssl",addr:"",pass:"",sign:""},compass:{status:"1",mode:"1",list:[]},fileUpload:{disk:"local",aliyun:{accessId:"",accessSecret:"",endpoint:"",bucket:"",url:""},qiniu:{accessKey:"",secretKey:"",bucket:"",url:""},qcloud:{appId:"",secretId:"",secretKey:"",region:"",bucket:"",cdn:""},preview:"",size:0,fileExt:""},options:["jpg","png"],inviteUrl:"",textEmail:"",rules:{name:[{required:!0,message:"请输入系统名称",trigger:"blur"},{min:2,max:32,message:"长度在 2 到 32 个字符",trigger:"blur"}],description:[{required:!0,message:"请输入系统描述",trigger:"blur"}]},chatRules:{groupUserMax:[{required:!0,message:"请输入群组人数上限",trigger:"blur"}],msgClearDay:[{required:!0,message:"请输入消息保存天数",trigger:"blur"}]},smtpRules:{host:[{required:!0,pattern:"^[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}$",message:"请输入SMTP服务器地址",trigger:"blur"}],port:[{required:!0,type:"number",message:"请输入SMTP服务器端口",trigger:"blur"}],addr:[{required:!0,type:"email",message:"请输入SMTP邮箱",trigger:["blur","change"]}],pass:[{required:!0,message:"请输入SMTP邮箱密码",trigger:"blur"}]},fileRules:{size:[{required:!0,type:"number",message:"请输入文件大小限制",trigger:"blur"}],fileExt:[{required:!0,message:"请输入文件格式限制",trigger:"blur"}]},compassRules:{compassMode:[{required:!0,message:"请选择展示模式",trigger:"blur"}]}}},computed:{getToken(){const t=a().get("authToken");return{Authorization:t}},getUrl(){return window.BASE_URL+"/common/upload/uploadImage"}},mounted(){this.initConfig(),this.resetInviteUrl()},methods:{initConfig(){this.$api.configApi.getAllConfig({}).then((t=>{0==t.code&&t.data.forEach((t=>{switch(t.name){case"sysInfo":t.value&&(this.sysInfo=Object.assign(this.sysInfo,t.value));break;case"chatInfo":t.value&&(this.chatInfo=Object.assign(this.chatInfo,t.value));break;case"smtp":t.value&&(this.smtp=Object.assign(this.smtp,t.value));break;case"fileUpload":t.value&&(this.fileUpload=Object.assign(this.fileUpload,t.value));break;case"compass":t.value&&(this.compass=Object.assign(this.compass,t.value));break}}))}))},submitForm(t){this.$refs[t].validate((e=>{if(!e)return console.log("error submit!!"),!1;var r={};switch(r.name=t,t){case"sysInfo":r.value=this.sysInfo;break;case"chatInfo":r.value=this.chatInfo;break;case"smtp":r.value=this.smtp;break;case"fileUpload":r.value=this.fileUpload;break;case"compass":let t=this.compass,e=t.list.filter((t=>""!=t.name&&""!=t.icon&&""!=t.url));t.list=e,r.value=t;break}this.$api.configApi.setConfig(r).then((t=>{0==t.code&&this.$message({message:t.msg,type:"success"})}))}))},resetForm(t){this.$refs[t].resetFields()},uploadSuccess(t,e){this.sysInfo.logo=t.data},iconUploadSuccess(t,e,r){this.compass.list[t].icon=e.data},beforeAvatarUpload(t){},change(t,e){},copyUrl(){this.$clipboard(this.inviteUrl),this.$message({message:"复制成功",type:"success"})},resetInviteUrl(){this.$api.configApi.getInviteLink({}).then((t=>{0==t.code&&(this.inviteUrl=t.data)}))},sendEmail(){this.textEmail?(this.loadding=!0,this.$confirm("确定发送测试邮件吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{this.$api.configApi.sendTestEmail({email:this.textEmail}).then((t=>{this.loadding=!1,this.textEmail="",0==t.code&&this.$message({message:t.msg,type:"success"})}))})).catch((()=>{this.loadding=!1}))):this.$message({message:"请输入邮箱地址",type:"warning"})},addAppItem(){let t=this.compass.list;t.push({id:1,url:"",icon:"",name:"",type:"2",badge:0,order:0,status:"1"}),this.compass.list=t},delAppItem(t){var e=this.compass.list.indexOf(t);-1!==e&&this.compass.list.splice(e,1)},changeUser(t,e){this.chatInfo.autoAddUser.user_ids=t,this.chatInfo.autoAddUser.user_items=e},changeOwner(t,e){this.chatInfo.autoAddGroup.owner_uid=t,this.chatInfo.autoAddGroup.owner_info=e}}},f=u,h=r(1001),p=(0,h.Z)(f,n,o,!1,null,"5a260d74",null),d=p.exports},8867:function(t,e,r){r(7658),r(541),r(3408),r(4590),r(2801),function(e,r){t.exports=r()}(0,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist/",r(r.s=13)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function r(t,e){for(var r=0;r65536?(a[0]=240|(1835008&s)>>>18,a[1]=128|(258048&s)>>>12,a[2]=128|(4032&s)>>>6,a[3]=128|63&s):s>2048?(a[0]=224|(61440&s)>>>12,a[1]=128|(4032&s)>>>6,a[2]=128|63&s):s>128?(a[0]=192|(1984&s)>>>6,a[1]=128|63&s):a[0]=s,r.push(a)}this.parsedData=Array.prototype.concat.apply([],r),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}return a()(t,[{key:"getLength",value:function(){return this.parsedData.length}},{key:"write",value:function(t){for(var e=0,r=this.parsedData.length;e0&&void 0!==arguments[0]?arguments[0]:-1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.L;o()(this,t),this.moduleCount=0,this.dataList=[],this.typeNumber=e,this.errorCorrectLevel=r,this.moduleCount=0,this.dataList=[]}return a()(t,[{key:"addData",value:function(t){if(this.typeNumber<=0)this.typeNumber=function(t,e){for(var r=1,n=s(t),o=0,i=y.length;oy.length)throw new Error("Too long data");return r}(t,this.errorCorrectLevel);else{if(this.typeNumber>40)throw new Error("Invalid QR version: ".concat(this.typeNumber));if(!function(t,e,r){var n=s(e),o=t-1,i=0;switch(r){case u.L:i=y[o][0];break;case u.M:i=y[o][1];break;case u.Q:i=y[o][2];break;case u.H:i=y[o][3]}return n<=i}(this.typeNumber,t,this.errorCorrectLevel))throw new Error("Data is too long for QR version: ".concat(this.typeNumber))}var e=new l(t);this.dataList.push(e),this.dataCache=void 0}},{key:"isDark",value:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error("".concat(t,",").concat(e));return this.modules[t][e]}},{key:"getModuleCount",value:function(){return this.moduleCount}},{key:"make",value:function(){this.makeImpl(!1,this.getBestMaskPattern())}},{key:"makeImpl",value:function(e,r){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=t.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)}},{key:"setupPositionProbePattern",value:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(this.modules[t+r][e+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)}},{key:"getBestMaskPattern",value:function(){if(Number.isInteger(this.maskPattern)&&Object.values(h).includes(this.maskPattern))return this.maskPattern;for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=p.getLostPoint(this);(0==r||t>n)&&(t=n,e=r)}return e}},{key:"setupTimingPattern",value:function(){for(var t=8;t>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(r=0;r<18;r++)n=!t&&1==(e>>r&1),this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},{key:"setupTypeInfo",value:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=p.getBCHTypeInfo(r),o=0;o<15;o++){var i=!t&&1==(n>>o&1);o<6?this.modules[o][8]=i:o<8?this.modules[o+1][8]=i:this.modules[this.moduleCount-15+o][8]=i}for(o=0;o<15;o++)i=!t&&1==(n>>o&1),o<8?this.modules[8][this.moduleCount-o-1]=i:o<9?this.modules[8][15-o-1+1]=i:this.modules[8][15-o-1]=i;this.modules[this.moduleCount-8][8]=!t}},{key:"mapData",value:function(t,e){for(var r=-1,n=this.moduleCount-1,o=7,i=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[n][a-s]){var l=!1;i>>o&1)),p.getMask(e,n,a-s)&&(l=!l),this.modules[n][a-s]=l,-1==--o&&(i++,o=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}}],[{key:"createData",value:function(e,r,n){for(var o=m.getRSBlocks(e,r),i=new v,a=0;a8*l)throw new Error("code length overflow. (".concat(i.getLengthInBits(),">").concat(8*l,")"));for(i.getLengthInBits()+4<=8*l&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*l||(i.put(t.PAD0,8),i.getLengthInBits()>=8*l));)i.put(t.PAD1,8);return t.createBytes(i,o)}},{key:"createBytes",value:function(t,e){for(var r=0,n=0,o=0,i=new Array(e.length),a=new Array(e.length),s=0;s=0?h.get(d):0}}var m=0;for(u=0;u=0;)r^=t.G15<=0;)r^=t.G18<>>=1;return e}},{key:"getPatternPosition",value:function(e){return t.PATTERN_POSITION_TABLE[e-1]}},{key:"getMask",value:function(t,e,r){switch(t){case h.PATTERN000:return(e+r)%2==0;case h.PATTERN001:return e%2==0;case h.PATTERN010:return r%3==0;case h.PATTERN011:return(e+r)%3==0;case h.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case h.PATTERN101:return e*r%2+e*r%3==0;case h.PATTERN110:return(e*r%2+e*r%3)%2==0;case h.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:".concat(t))}}},{key:"getErrorCorrectPolynomial",value:function(t){for(var e=new g([1],0),r=0;r5&&(r+=3+i-5)}for(n=0;n=256;)e-=255;return t.EXP_TABLE[e]}}]),t}();d.EXP_TABLE=new Array(256),d.LOG_TABLE=new Array(256),d._constructor=function(){for(var t=0;t<8;t++)d.EXP_TABLE[t]=1<>>7-t%8&1)}},{key:"put",value:function(t,e){for(var r=0;r>>e-r-1&1))}},{key:"getLengthInBits",value:function(){return this.length}},{key:"putBit",value:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}]),t}(),y=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]},function(t,e,r){"use strict";(function(t){r.d(e,"b",(function(){return l})),r.d(e,"a",(function(){return c}));var n=r(2),o=r.n(n);function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function a(t,e){for(var r,n="",o=0,i=-1,a=0,s=0;s<=t.length;++s){if(s2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var s={resolve:function(){for(var e,r="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=t.cwd()),s=e),i(s),0!==s.length&&(r=s+"/"+r,n=47===s.charCodeAt(0))}return r=a(r,!n),n?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=a(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e0&&(void 0===t?t=r:t+="/"+r)}return void 0===t?".":s.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=s.resolve(t))===(e=s.resolve(e)))return"";for(var r=1;rc){if(47===e.charCodeAt(a+f))return e.slice(a+f+1);if(0===f)return e.slice(a+f)}else o>c&&(47===t.charCodeAt(r+f)?u=f:0===f&&(u=0));break}var h=t.charCodeAt(r+f);if(h!==e.charCodeAt(a+f))break;47===h&&(u=f)}var p="";for(f=r+u+1;f<=n;++f)f!==n&&47!==t.charCodeAt(f)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(a+u):(a+=u,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,o=!0,a=t.length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!o){n=a;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var r,n=0,o=-1,a=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,l=-1;for(r=t.length-1;r>=0;--r){var c=t.charCodeAt(r);if(47===c){if(!a){n=r+1;break}}else-1===l&&(a=!1,l=r+1),s>=0&&(c===e.charCodeAt(s)?-1==--s&&(o=r):(s=-1,o=l))}return n===o?o=l:-1===o&&(o=t.length),t.slice(n,o)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!a){n=r+1;break}}else-1===o&&(a=!1,o=r+1);return-1===o?"":t.slice(n,o)},extname:function(t){i(t);for(var e=-1,r=0,n=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(47!==l)-1===n&&(o=!1,n=s+1),46===l?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!o){r=s+1;break}}return-1===e||-1===n||0===a||1===a&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!==o()(t))throw new TypeError('The "pathObject" argument must be of type Object. Received type '+o()(t));return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+t+n:n}("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=t.charCodeAt(0),o=47===n;o?(e.root="/",r=1):r=0;for(var a=-1,s=0,l=-1,c=!0,u=t.length-1,f=0;u>=r;--u)if(47!==(n=t.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===n?-1===a?a=u:1!==f&&(f=1):-1!==a&&(f=-1);else if(!c){s=u+1;break}return-1===a||-1===l||0===f||1===f&&a===l-1&&a===s+1?-1!==l&&(e.base=e.name=0===s&&o?t.slice(1,l):t.slice(s,l)):(0===s&&o?(e.name=t.slice(1,a),e.base=t.slice(1,l)):(e.name=t.slice(s,a),e.base=t.slice(s,l)),e.ext=t.slice(a,l)),s>0?e.dir=t.slice(0,s-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s;var l=s.extname,c=s.basename}).call(this,r(19))},function(t,e){function r(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,l,"next",t)}function l(t){r(a,o,i,s,l,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";r.d(e,"b",(function(){return b})),r.d(e,"a",(function(){return x}));const n=(t,e,r={},o=r)=>{if(Array.isArray(e))e.forEach((e=>n(t,e,r,o)));else if("function"==typeof e)e(t,r,o,n);else{const i=Object.keys(e)[0];Array.isArray(e[i])?(o[i]={},n(t,e[i],r,o[i])):o[i]=e[i](t,r,o,n)}return r},o=(t,e)=>(r,n,o,i)=>{e(r,n,o)&&i(r,t,n,o)},i=(t=0)=>e=>e.data[e.pos+t],a=t=>e=>e.data.subarray(e.pos,e.pos+=t),s=t=>e=>e.data.subarray(e.pos,e.pos+t),l=t=>e=>Array.from(a(t)(e)).map((t=>String.fromCharCode(t))).join(""),c=t=>e=>{const r=a(2)(e);return t?(r[1]<<8)+r[0]:(r[0]<<8)+r[1]},u=(t,e)=>(r,n,o)=>{const i="function"==typeof e?e(r,n,o):e,s=a(t),l=new Array(i);for(var c=0;ce=>{const r=(t=>t.data[t.pos++])(e),n=new Array(8);for(var o=0;o<8;o++)n[7-o]=!!(r&1<{const o=t[r];return o.length?e[r]=((t,e,r)=>{for(var n=0,o=0;o{const e=[],r=t.data.length;for(var n=0,o=(t=>t.data[t.pos++])(t);0!==o&&o;o=(t=>t.data[t.pos++])(t)){if(t.pos+o>=r){const o=r-t.pos;e.push(a(o)(t)),n+=o;break}e.push(a(o)(t)),n+=o}const i=new Uint8Array(n);for(var s=0,l=0;lt.data[t.pos++]},{extras:f({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:c(!0)},{transparentColorIndex:t=>t.data[t.pos++]},{terminator:t=>t.data[t.pos++]}]},(t=>{var e=s(2)(t);return 33===e[0]&&249===e[1]})),d=o({image:[{code:t=>t.data[t.pos++]},{descriptor:[{left:c(!0)},{top:c(!0)},{width:c(!0)},{height:c(!0)},{lct:f({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},o({lct:u(3,((t,e,r)=>Math.pow(2,r.descriptor.lct.size+1)))},((t,e,r)=>r.descriptor.lct.exists)),{data:[{minCodeSize:t=>t.data[t.pos++]},h]}]},(t=>44===i()(t))),g=o({text:[{codes:a(2)},{blockSize:t=>t.data[t.pos++]},{preData:(t,e,r)=>a(r.text.blockSize)(t)},h]},(t=>{var e=s(2)(t);return 33===e[0]&&1===e[1]})),m=o({application:[{codes:a(2)},{blockSize:t=>t.data[t.pos++]},{id:(t,e,r)=>l(r.blockSize)(t)},h]},(t=>{var e=s(2)(t);return 33===e[0]&&255===e[1]})),v=o({comment:[{codes:a(2)},h]},(t=>{var e=s(2)(t);return 33===e[0]&&254===e[1]}));var y=[{header:[{signature:l(3)},{version:l(3)}]},{lsd:[{width:c(!0)},{height:c(!0)},{gct:f({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:t=>t.data[t.pos++]},{pixelAspectRatio:t=>t.data[t.pos++]}]},o({gct:u(3,((t,e)=>Math.pow(2,e.lsd.gct.size+1)))},((t,e)=>e.lsd.gct.exists)),{frames:((t,e)=>(r,n,o,i)=>{const a=[];let s=r.pos;for(;e(r,n,o);){const e={};if(i(r,t,n,e),r.pos===s)break;s=r.pos,a.push(e)}return a})([p,m,v,d,g],(t=>{var e=i()(t);return 33===e||44===e}))}],b=function(t){var e=new Uint8Array(t);return n({data:e,pos:0},y)},w=function(t,e,r){if(t.image){var n=t.image,o=n.descriptor.width*n.descriptor.height,i=function(t,e,r){var n,o,i,a,s,l,c,u,f,h,p,d,g,m,v,y,b=r,w=new Array(r),x=new Array(4096),C=new Array(4096),_=new Array(4097);for(s=1+(o=1<<(h=t)),n=o+2,c=-1,i=(1<<(a=h+1))-1,u=0;u>=a,d-=a,u>n||u==s)break;if(u==o){i=(1<<(a=h+1))-1,n=o+2,c=-1;continue}if(-1==c){_[m++]=C[u],c=u,g=u;continue}for(l=u,u==n&&(_[m++]=g,u=c);u>o;)_[m++]=C[u],u=x[u];g=255&C[u],_[m++]=g,n<4096&&(x[n]=c,C[n]=g,0==(++n&i)&&n<4096&&(a++,i+=n)),c=l}m--,w[v++]=_[m],f++}for(f=v;f1)throw new Error("dotScale should be in range (0, 1].");r.components.data.scale=r.dotScale,r.components.timing.scale=r.dotScale,r.components.alignment.scale=r.dotScale}this.options=r,this.canvas=new m(t.size,t.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new p.a(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}return l()(e,[{key:"draw",value:function(){var t=this;return new Promise((function(e){return t._draw().then(e)}))}},{key:"_clear",value:function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"_draw",value:function(){var r,n,o,i,a,s,l,c,f,y,w,x,C,_,k,I,A,E,T;return g(this,void 0,void 0,u.a.mark((function g(){var S,P,U,B,R,L,D,M,O,N,$,j,q,z,F,G,Y,K,H,Q,X,V,J,Z,W,tt,et,rt,nt,ot,it,at,st,lt,ct,ut,ft,ht,pt,dt,gt,mt,vt,yt,bt,wt,xt,Ct,_t,kt,It,At,Et,Tt,St,Pt,Ut,Bt,Rt,Lt,Dt,Mt,Ot,Nt,$t,jt,qt,zt,Ft,Gt,Yt,Kt;return u.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(S=null===(r=this.qrCode)||void 0===r?void 0:r.moduleCount,P=this.options.size,((U=this.options.margin)<0||2*U>=P)&&(U=0),B=Math.ceil(U),R=P-2*U,L=this.options.whiteMargin,D=this.options.backgroundDimming,M=Math.ceil(R/S),$=new m(N=(O=M*S)+2*B,N),j=$.getContext("2d"),this._clear(),j.save(),j.translate(B,B),q=new m(N,N),z=q.getContext("2d"),F=null,G=[],!this.options.gifBackground){u.next=47;break}if(Y=Object(h.b)(this.options.gifBackground),F=Y,G=Object(h.a)(Y,!0),!this.options.autoColor){u.next=45;break}K=0,H=0,Q=0,X=0,V=0;case 28:if(!(V200||J[1]>200||J[2]>200)){u.next=32;break}return u.abrupt("continue",38);case 32:if(0!==J[0]||0!==J[1]||0!==J[2]){u.next=34;break}return u.abrupt("continue",38);case 34:X++,K+=J[0],H+=J[1],Q+=J[2];case 38:V++,u.next=28;break;case 41:K=~~(K/X),H=~~(H/X),Q=~~(Q/X),this.options.colorDark="rgb(".concat(K,",").concat(H,",").concat(Q,")");case 45:u.next=61;break;case 47:if(!this.options.backgroundImage){u.next=58;break}return u.next=50,v(this.options.backgroundImage);case 50:Z=u.sent,this.options.autoColor&&(W=e._getAverageRGB(Z),this.options.colorDark="rgb(".concat(W.r,",").concat(W.g,",").concat(W.b,")")),z.drawImage(Z,0,0,Z.width,Z.height,0,0,N,N),z.rect(0,0,N,N),z.fillStyle=D,z.fill(),u.next=61;break;case 58:z.rect(0,0,N,N),z.fillStyle=this.options.colorLight,z.fill();case 61:for(tt=p.c.getPatternPosition(this.qrCode.typeNumber),et=(null===(o=null===(n=this.options.components)||void 0===n?void 0:n.data)||void 0===o?void 0:o.scale)||.4,rt=.5*(1-et),nt=0;nt=8&&ot<=S-8||6==ot&&nt>=8&&nt<=S-8,st=ot<8&&(nt<8||nt>=S-8)||ot>=S-8&&nt<8||at,lt=1;lt=tt[lt]-2&&nt<=tt[lt]+2&&ot>=tt[lt]-2&&ot<=tt[lt]+2;ct=ot*M+(st?0:rt*M),ut=nt*M+(st?0:rt*M),j.strokeStyle=it?this.options.colorDark:this.options.colorLight,j.lineWidth=.5,j.fillStyle=it?this.options.colorDark:this.options.colorLight,0===tt.length?st||j.fillRect(ct,ut,(st?1:et)*M,(st?1:et)*M):(ft=ot=S-4-5&&nt=S-4-5,st||ft||j.fillRect(ct,ut,(st?1:et)*M,(st?1:et)*M))}if(ht=tt[tt.length-1],pt=this.options.colorLight,j.fillStyle=pt,j.fillRect(0,0,8*M,8*M),j.fillRect(0,(S-8)*M,8*M,8*M),j.fillRect((S-8)*M,0,8*M,8*M),(null===(a=null===(i=this.options.components)||void 0===i?void 0:i.timing)||void 0===a?void 0:a.protectors)&&(j.fillRect(8*M,6*M,(S-8-8)*M,M),j.fillRect(6*M,8*M,M,(S-8-8)*M)),(null===(l=null===(s=this.options.components)||void 0===s?void 0:s.cornerAlignment)||void 0===l?void 0:l.protectors)&&e._drawAlignProtector(j,ht,ht,M),!(null===(f=null===(c=this.options.components)||void 0===c?void 0:c.alignment)||void 0===f?void 0:f.protectors)){u.next=99;break}dt=0;case 75:if(!(dt=1)&&(Pt=.2),Ut<0&&(Ut=0),Bt<0&&(Bt=0),Dt=Lt=.5*(N-(Rt=O*Pt)),j.restore(),j.fillStyle=this.options.logoBackgroundColor,j.save(),e._prepareRoundedCornerClip(j,Lt-Ut,Dt-Ut,Rt+2*Ut,Rt+2*Ut,Bt+Ut),j.clip(),Mt=j.globalCompositeOperation,j.globalCompositeOperation="destination-out",j.fill(),j.globalCompositeOperation=Mt,j.restore(),j.save(),e._prepareRoundedCornerClip(j,Lt,Dt,Rt,Rt,Bt),j.clip(),j.drawImage(St,Lt,Dt,Rt,Rt),j.restore(),j.save(),j.translate(B,B);case 179:if(!F){u.next=191;break}if(G.forEach((function(t){Ot||((Ot=new d.a(P,P)).setDelay(t.delay),Ot.setRepeat(0));var e=t.dims,r=e.width,n=e.height;Nt||(Nt=new m(r,n),($t=Nt.getContext("2d")).rect(0,0,Nt.width,Nt.height),$t.fillStyle="#ffffff",$t.fill()),jt&&zt&&r===jt.width&&n===jt.height||(jt=new m(r,n),qt=jt.getContext("2d"),zt=qt.createImageData(r,n)),zt.data.set(t.patch),qt.putImageData(zt,0,0),$t.drawImage(jt.getContext("2d").canvas,t.dims.left,t.dims.top);var o=new m(N,N),i=o.getContext("2d");i.drawImage(Nt.getContext("2d").canvas,0,0,N,N),i.rect(0,0,N,N),i.fillStyle=D,i.fill(),i.drawImage($.getContext("2d").canvas,0,0,N,N);var a=new m(P,P),s=a.getContext("2d");s.drawImage(o.getContext("2d").canvas,0,0,P,P),Ot.addFrame(s.getImageData(0,0,a.width,a.height).data)})),Ot){u.next=183;break}throw new Error("No frames.");case 183:if(Ot.finish(),!b(this.canvas)){u.next=188;break}return Ft=Ot.stream().toFlattenUint8Array(),Gt=Ft.reduce((function(t,e){return t+String.fromCharCode(e)}),""),u.abrupt("return",Promise.resolve("data:image/gif;base64,".concat(window.btoa(Gt))));case 188:return u.abrupt("return",Promise.resolve(t.from(Ot.stream().toFlattenUint8Array())));case 191:if(z.drawImage($.getContext("2d").canvas,0,0,N,N),j.drawImage(q.getContext("2d").canvas,-B,-B,N,N),Yt=new m(P,P),Yt.getContext("2d").drawImage($.getContext("2d").canvas,0,0,P,P),this.canvas=Yt,Kt=this.options.gifBackground?"gif":"png",!b(this.canvas)){u.next=200;break}return u.abrupt("return",Promise.resolve(this.canvas.toDataURL(Kt)));case 200:return u.abrupt("return",Promise.resolve(this.canvas.toBuffer(Kt)));case 201:case"end":return u.stop()}}),g,this)})))}}],[{key:"_prepareRoundedCornerClip",value:function(t,e,r,n,o,i){t.beginPath(),t.moveTo(e,r),t.arcTo(e+n,r,e+n,r+o,i),t.arcTo(e+n,r+o,e,r+o,i),t.arcTo(e,r+o,e,r,i),t.arcTo(e,r,e+n,r,i),t.closePath()}},{key:"_getAverageRGB",value:function(t){var e,r,n={r:0,g:0,b:0},o=-4,i={r:0,g:0,b:0},a=0;r=t.naturalHeight||t.height,e=t.naturalWidth||t.width;var s,l=new m(e,r).getContext("2d");if(!l)return n;l.drawImage(t,0,0);try{s=l.getImageData(0,0,e,r)}catch(t){return n}for(;(o+=20)200||s.data[o+1]>200||s.data[o+2]>200||(++a,i.r+=s.data[o],i.g+=s.data[o+1],i.b+=s.data[o+2]);return i.r=~~(i.r/a),i.g=~~(i.g/a),i.b=~~(i.b/a),i}},{key:"_drawDot",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;t.fillRect((e+o)*n,(r+o)*n,i*n,i*n)}},{key:"_drawAlignProtector",value:function(t,e,r,n){t.clearRect((e-2)*n,(r-2)*n,5*n,5*n),t.fillRect((e-2)*n,(r-2)*n,5*n,5*n)}},{key:"_drawAlign",value:function(t,r,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,c=t.fillStyle;t.fillStyle=s,new Array(4).fill(0).map((function(s,l){e._drawDot(t,r-2+l,n-2,o,i,a),e._drawDot(t,r+2,n-2+l,o,i,a),e._drawDot(t,r+2-l,n+2,o,i,a),e._drawDot(t,r-2,n+2-l,o,i,a)})),e._drawDot(t,r,n,o,i,a),l||(t.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map((function(s,l){e._drawDot(t,r-1+l,n-1,o,i,a),e._drawDot(t,r+1,n-1+l,o,i,a),e._drawDot(t,r+1-l,n+1,o,i,a),e._drawDot(t,r-1,n+1-l,o,i,a)}))),t.fillStyle=c}}]),e}();function b(t){try{return t instanceof HTMLElement}catch(e){return"object"===o()(t)&&1===t.nodeType&&"object"===o()(t.style)&&"object"===o()(t.ownerDocument)}}y.CorrectLevel=p.b,y.defaultComponentOptions={data:{scale:.4},timing:{scale:.5,protectors:!1},alignment:{scale:.5,protectors:!1},cornerAlignment:{scale:.5,protectors:!0}},y.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"rgba(255, 255, 255, 0.6)",correctLevel:p.b.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:y.defaultComponentOptions,autoColor:!0,logoBackgroundColor:"#ffffff",backgroundColor:"#ffffff"}}).call(this,r(15).Buffer)},function(t,e,r){"use strict";var n=r(11);const{asBuffer:o,asDownload:i,asZipDownload:a,atScale:s,options:l}=n.a,c=Symbol.for("toDataURL"),{CanvasRenderingContext2D:u,CanvasGradient:f,CanvasPattern:h,Image:p,ImageData:d,Path2D:g,DOMMatrix:m,DOMRect:v,DOMPoint:y}=window,b={Canvas:class{constructor(t,e){let r=document.createElement("canvas"),n=[];for(var[u,f]of(Object.defineProperty(r,"async",{value:!0,writable:!1,enumerable:!0}),Object.entries({png:()=>o(r,"image/png"),jpg:()=>o(r,"image/jpeg"),pages:()=>n.concat(r).map((t=>t.getContext("2d")))})))Object.defineProperty(r,u,{get:f});return Object.assign(r,{width:t,height:e,newPage(...t){var{width:e,height:o}=r,i=Object.assign(document.createElement("canvas"),{width:e,height:o});i.getContext("2d").drawImage(r,0,0),n.push(i);var[e,o]=t.length?t:[e,o];return Object.assign(r,{width:e,height:o}).getContext("2d")},saveAs(t,e){e="number"==typeof e?{quality:e}:e;let r=l(this.pages,{filename:t,...e}),{pattern:n,padding:o,mime:c,quality:u,matte:f,density:h,archive:p}=r,d=s(r.pages,h);return null==o?i(d[0],c,u,f,t):a(d,c,u,f,p,n,o)},toBuffer(t="png",e={}){e="number"==typeof e?{quality:e}:e;let r=l(this.pages,{extension:t,...e}),{mime:n,quality:i,matte:a,pages:c,density:u}=r,f=s(c,u,a)[0];return o(f,n,i,a)},[c]:r.toDataURL.bind(r),toDataURL(t="png",e={}){e="number"==typeof e?{quality:e}:e;let n=l(this.pages,{extension:t,...e}),{mime:o,quality:i,matte:a,pages:u,density:f}=n,h=s(u,f,a)[0],p=h[h===r?c:"toDataURL"](o,i);return Promise.resolve(p)}})}},loadImage:t=>new Promise(((e,r)=>Object.assign(new p,{crossOrigin:"Anonymous",onload:e,onerror:r,src:t}))),CanvasRenderingContext2D:u,CanvasGradient:f,CanvasPattern:h,Image:p,ImageData:d,Path2D:g,DOMMatrix:m,DOMRect:v,DOMPoint:y};e.a=b},function(t,e,r){"use strict";(function(t){var n=r(5);class o{constructor(){let e=void 0===t,r="image/png",n="image/jpeg",o="application/pdf",i="image/svg+xml";Object.assign(this,{toMime:this.toMime.bind(this),fromMime:this.fromMime.bind(this),expected:e?'"png", "jpg", or "webp"':'"png", "jpg", "pdf", or "svg"',formats:e?{png:r,jpg:n,jpeg:"image/jpeg",webp:"image/webp"}:{png:r,jpg:n,jpeg:"image/jpeg",pdf:o,svg:i},mimes:e?{[r]:"png",[n]:"jpg","image/webp":"webp"}:{[r]:"png",[n]:"jpg",[o]:"pdf",[i]:"svg"}})}toMime(t){return this.formats[(t||"").replace(/^\./,"").toLowerCase()]}fromMime(t){return this.mimes[t]}}class i{static for(t){return(new i).append(t).get()}constructor(){this.crc=-1}get(){return~this.crc}append(t){for(var e=0|this.crc,r=this.table,n=0,o=0|t.length;n>>8^r[255&(e^t[n])];return this.crc=e,this}}function a(t){let e=new Uint8Array(t),r=new DataView(e.buffer),n={array:e,view:r,size:t,set8:(t,e)=>(r.setUint8(t,e),n),set16:(t,e)=>(r.setUint16(t,e,!0),n),set32:(t,e)=>(r.setUint32(t,e,!0),n),bytes:(t,r)=>(e.set(r,t),n)};return n}i.prototype.table=(()=>{var t,e,r,n=[];for(t=0;t<256;t++){for(r=t,e=0;e<8;e++)r=1&r?r>>>1^3988292384:r>>>1;n[t]=r}return n})();class s{constructor(t){let e=new Date;Object.assign(this,{directory:t,offset:0,files:[],time:(e.getHours()<<6|e.getMinutes())<<5|e.getSeconds()/2,date:(e.getFullYear()-1980<<4|e.getMonth()+1)<<5|e.getDate()}),this.add(t)}async add(t,e){let r=!e,n=s.encoder.encode(`${this.directory}/${r?"":t}`),o=new Uint8Array(r?0:await e.arrayBuffer()),l=30+n.length,c=l+o.length,{offset:u}=this,f=a(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,i.for(o)).set32(14,o.length).set32(18,o.length).set16(22,n.length);u+=l;let h=a(l+o.length+16).set32(0,67324752).bytes(4,f.array).bytes(30,n).bytes(l,o);u+=o.length,h.set32(c,134695760).bytes(c+4,f.array.slice(10,22)),u+=16,this.files.push({offset:u,folder:r,name:n,header:f,payload:h}),this.offset=u}toBuffer(){let t=this.files.reduce(((t,{name:e})=>46+e.length+t),0),e=a(t+22),r=0;for(var{offset:n,name:o,header:i,folder:s}of this.files)e.set32(r,33639248).set16(r+4,20).bytes(r+6,i.array).set8(r+38,s?16:0).set32(r+42,n).bytes(r+46,o),r+=46+o.length;e.set32(r,101010256).set16(r+8,this.files.length).set16(r+10,this.files.length).set32(r+12,t).set32(r+16,this.offset);let l=new Uint8Array(this.offset+e.size),c=0;for(var{payload:u}of this.files)l.set(u.array,c),c+=u.size;return l.set(e.array,c),l}get blob(){return new Blob([this.toBuffer()],{type:"application/zip"})}}s.encoder=new TextEncoder;const l=(t,e,r,n)=>{if(n){let{width:e,height:r}=t,o=Object.assign(document.createElement("canvas"),{width:e,height:r}),i=o.getContext("2d");i.fillStyle=n,i.fillRect(0,0,e,r),i.drawImage(t,0,0),t=o}return new Promise(((n,o)=>t.toBlob(n,e,r)))},c=(t,e)=>{const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.setAttribute("download",t),void 0===n.download&&n.setAttribute("target","_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n),setTimeout((()=>window.URL.revokeObjectURL(r)),100)},u={asBuffer:(...t)=>l(...t).then((t=>t.arrayBuffer())),asDownload:async(t,e,r,n,o)=>{c(o,await l(t,e,r,n))},asZipDownload:async(t,e,r,o,i,a,u)=>{let f=Object(n.a)(i,".zip")||"archive",h=new s(f);await Promise.all(t.map((async(t,n)=>{let i=(t=>a.replace("{}",String(t+1).padStart(u,"0")))(n);await h.add(i,await l(t,e,r,o))}))),c(f+".zip",h.blob)},atScale:(t,e,r)=>t.map((t=>{if(1==e&&!r)return t.canvas;let n=document.createElement("canvas"),o=n.getContext("2d"),i=t.canvas?t.canvas:t;return n.width=i.width*e,n.height=i.height*e,r&&(o.fillStyle=r,o.fillRect(0,0,n.width,n.height)),o.scale(e,e),o.drawImage(i,0,0),n})),options:function(t,{filename:e="",extension:r="",format:i,page:a,quality:s,matte:l,density:c,outline:u,archive:f}={}){var{fromMime:h,toMime:p,expected:d}=new o,g=(f=f||"canvas",i||r.replace(/@\d+x$/i,"")||Object(n.b)(e)),m=(i=h(p(g)||g),p(i)),v=t.length;if(!g)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!i)throw new Error(`Unsupported file format "${g}" (expected ${d})`);if(!v)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let y,b,w=e.replace(/{(\d*)}/g,((t,e)=>(b=!0,e=parseInt(e,10),y=isFinite(e)?e:isFinite(y)?y:-1,"{}"))),x=a>0?a-1:a<0?v+a:void 0;if(isFinite(x)&&x<0||x>=v)throw new RangeError(1==v?`Canvas only has a ‘page 1’ (${x} is out of bounds)`:`Canvas has pages 1–${v} (${x} is out of bounds)`);if(t=isFinite(x)?[t[x]]:b||"pdf"==i?t:t.slice(-1),void 0===s)s=.92;else if("number"!=typeof s||!isFinite(s)||s<0||s>1)throw new TypeError("The quality option must be an number in the 0.0–1.0 range");if(void 0===c){let t=(r||Object(n.a)(e,g)).match(/@(\d+)x$/i);c=t?parseInt(t[1],10):1}else if("number"!=typeof c||!Number.isInteger(c)||c<1)throw new TypeError("The density option must be a non-negative integer");return void 0===u?u=!0:"svg"==i&&(u=!!u),{filename:e,pattern:w,format:i,mime:m,pages:t,padding:y,quality:s,matte:l,density:c,outline:u,archive:f}}};e.a=u}).call(this,r(8))},function(t,e,r){"use strict";var n=function(t,e){var r,n,o,i,a;function s(t,e,n,o,i){r[e][0]-=t*(r[e][0]-n)/1024,r[e][1]-=t*(r[e][1]-o)/1024,r[e][2]-=t*(r[e][2]-i)/1024}function l(t,e,n,o,i){for(var s,l,c=Math.abs(e-t),u=Math.min(e+t,256),f=e+1,h=e-1,p=1;fc;)l=a[p++],fc&&((s=r[h--])[0]-=l*(s[0]-n)/(1<<18),s[1]-=l*(s[1]-o)/(1<<18),s[2]-=l*(s[2]-i)/(1<<18))}function c(t,e,n){var a,s,l,c,u,f=~(1<<31),h=f,p=-1,d=p;for(a=0;a<256;a++)s=r[a],(l=Math.abs(s[0]-t)+Math.abs(s[1]-e)+Math.abs(s[2]-n))>12))>10,i[a]-=u,o[a]+=u<<10;return i[p]+=64,o[p]-=65536,d}this.buildColormap=function(){!function(){var t,e;for(r=[],n=new Int32Array(256),o=new Int32Array(256),i=new Int32Array(256),a=new Int32Array(32),t=0;t<256;t++)e=(t<<12)/256,r[t]=new Float64Array([e,e,e,0]),i[t]=256,o[t]=0}(),function(){var r,n,o,i,u,f,h=t.length,p=30+(e-1)/3,d=h/(3*e),g=~~(d/100),m=1024,v=2048,y=v>>6;for(y<=1&&(y=0),r=0;r=h&&(b-=h),0===g&&(g=1),++r%g==0)for(m-=m/p,(y=(v-=v/30)>>6)<=1&&(y=0),f=0;f>=4,r[t][1]>>=4,r[t][2]>>=4,r[t][3]=t}(),function(){var t,e,o,i,a,s,l=0,c=0;for(t=0;t<256;t++){for(a=t,s=(o=r[t])[1],e=t+1;e<256;e++)(i=r[e])[1]>1,e=l+1;e>1,e=l+1;e<256;e++)n[e]=255}()},this.getColormap=function(){for(var t=[],e=[],n=0;n<256;n++)e[r[n][3]]=n;for(var o=0,i=0;i<256;i++){var a=e[i];t[o++]=r[a][0],t[o++]=r[a][1],t[o++]=r[a][2]}return t},this.lookupRGB=function(t,e,o){for(var i,a,s,l=1e3,c=-1,u=n[e],f=u-1;u<256||f>=0;)u<256&&((s=(a=r[u])[1]-e)>=l?u=256:(u++,s<0&&(s=-s),(i=a[0]-t)<0&&(i=-i),(s+=i)=0&&((s=e-(a=r[f])[1])>=l?f=-1:(f--,s<0&&(s=-s),(i=a[0]-t)<0&&(i=-i),(s+=i)=254&&k(e)}function C(t){_(5003),b=c+2,w=!0,E(c,t)}function _(t){for(var e=0;e0&&(t.writeByte(a),t.writeBytes(g,0,a),a=0)}function I(t){return(1<0?i|=t<=8;)x(255&i,e),i>>=8,y-=8;if((b>s||w)&&(w?(s=I(p=l),w=!1):(++p,s=12==p?4096:I(p))),t==u){for(;y>0;)x(255&i,e),i>>=8,y-=8;k(e)}}this.encode=function(r){r.writeByte(d),f=t*e,h=0,function(t,e){var r,n,o,i,f,h;for(w=!1,s=I(p=l=t),u=1+(c=1<=0){f=5003-o,0===o&&(f=1);do{if((o-=f)<0&&(o+=5003),m[o]===r){i=v[o];continue t}}while(m[o]>=0)}E(i,e),i=n,b<4096?(v[o]=b++,m[o]=r):C(e)}else i=v[o];E(i,e),E(u,e)}(d+1,r),r.writeByte(0)}};function a(){this.page=-1,this.pages=[],this.newPage()}a.pageSize=4096,a.charMap={};for(var s=0;s<256;s++)a.charMap[s]=String.fromCharCode(s);function l(t,e){this.width=~~t,this.height=~~e,this.transparent=null,this.transIndex=0,this.repeat=-1,this.delay=0,this.image=null,this.pixels=null,this.indexedPixels=null,this.colorDepth=null,this.colorTab=null,this.neuQuant=null,this.usedEntry=new Array,this.palSize=7,this.dispose=-1,this.firstFrame=!0,this.sample=10,this.dither=!1,this.globalPalette=!1,this.out=new a}a.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(a.pageSize),this.cursor=0},a.prototype.getData=function(){for(var t="",e=0;e=a.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=t},a.prototype.writeUTFBytes=function(t){for(var e=t.length,r=0;r=0&&(this.dispose=t)},l.prototype.setRepeat=function(t){this.repeat=t},l.prototype.setTransparent=function(t){this.transparent=t},l.prototype.addFrame=function(t){this.image=t,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),!0===this.globalPalette&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.globalPalette||this.writePalette(),this.writePixels(),this.firstFrame=!1},l.prototype.finish=function(){this.out.writeByte(59)},l.prototype.setQuality=function(t){t<1&&(t=1),this.sample=t},l.prototype.setDither=function(t){!0===t&&(t="FloydSteinberg"),this.dither=t},l.prototype.setGlobalPalette=function(t){this.globalPalette=t},l.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette},l.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")},l.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new n(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),null!==this.dither.match(/-serpentine/)):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,null!==this.transparent&&(this.transIndex=this.findClosest(this.transparent,!0))},l.prototype.indexPixels=function(t){var e=this.pixels.length/3;this.indexedPixels=new Uint8Array(e);for(var r=0,n=0;n=0&&x+u=0&&C+c>16,(65280&t)>>8,255&t,e)},l.prototype.findClosestRGB=function(t,e,r,n){if(null===this.colorTab)return-1;if(this.neuQuant&&!n)return this.neuQuant.lookupRGB(t,e,r);for(var o=0,i=16777216,a=this.colorTab.length,s=0,l=0;s=0&&(e=7&this.dispose),e<<=2,this.out.writeByte(0|e|t),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},l.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},l.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},l.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},l.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var t=768-this.colorTab.length,e=0;e>8&255)},l.prototype.writePixels=function(){new i(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this.out)},l.prototype.stream=function(){return this.out},e.a=l},function(t,e,r){t.exports=r(20)},function(t,e,r){var n=r(2).default;function o(){"use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,i=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,i=Object.create(o.prototype),a=new A(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=_(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=h(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,a),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p={};function d(){}function g(){}function m(){}var v={};u(v,s,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(E([])));b&&b!==r&&i.call(b,s)&&(v=b);var w=m.prototype=d.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){var r;this._invoke=function(o,a){function s(){return new e((function(r,s){!function r(o,a,s,l){var c=h(t[o],t,a);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,l)}),(function(t){r("throw",t,s,l)})):e.resolve(f).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,l)}))}l(c.arg)}(o,a,r,s)}))}return r=r?r.then(s,s):s()}}function _(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function E(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=r(16),o=r(17),i=r(18);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return j(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return T(this,e,r);case"base64":return I(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,o);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,o){var i,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var u=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,h=0;ho&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function I(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(i=t[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,o,i){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function D(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||D(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function O(t,e,r,n,i){return i||D(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,r){return c(null,t,e,r)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,r){return function(t,e,r,n){return u(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},l.allocUnsafe=function(t){return f(null,t)},l.allocUnsafeSlow=function(t){return f(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},l.prototype.compare=function(t,e,r,n,o){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(i,a),c=this.slice(n,o),u=t.slice(e,r),f=0;fo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return x(this,t,e,r);case"latin1":case"binary":return C(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)n+=this[t+--e]*o;return n},l.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},l.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=0,a=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);B(this,t,e,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return O(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return O(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(8))},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),a=n[0],s=n[1],l=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),u=0,f=s>0?a-4:a;for(r=0;r>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===s&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,l[u++]=255&e),1===s&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,s=r-o;as?s:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var o,i,a=[],s=e;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ e.read=function(t,e,r,n,o){var i,a,s=8*o-n-1,l=(1<>1,u=-7,f=r?o-1:0,h=r?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-u)-1,p>>=-u,u+=s;u>0;i=256*i+t[e+f],f+=h,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+t[e+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),i-=c}return(p?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,s,l,c=8*i-o-1,u=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(e*l-1)*Math.pow(2,o),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=255&s,p+=d,s/=256,o-=8);for(a=a<0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,c=[],u=!1,f=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):f=-1,c.length&&p())}function p(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++f1)for(var r=1;r