From 49c46f0614cec98a5e17ae6530950e9d148c600c Mon Sep 17 00:00:00 2001 From: Alphabiz-Team Date: Tue, 8 Aug 2023 10:38:28 +0000 Subject: [PATCH] 4d89bb0 test library key: trigger by schedule --- dist/electron/UnPackaged/version.json | 8 ++++---- dist/spa/index.html | 2 +- dist/spa/js/{app.13f8c0eb.js => app.1f78b1c9.js} | 2 +- dist/spa/version.json | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename dist/spa/js/{app.13f8c0eb.js => app.1f78b1c9.js} (99%) diff --git a/dist/electron/UnPackaged/version.json b/dist/electron/UnPackaged/version.json index 15911dd2..0b28fe34 100644 --- a/dist/electron/UnPackaged/version.json +++ b/dist/electron/UnPackaged/version.json @@ -1,8 +1,8 @@ { "packageVer": "0.2.4", "channel": "internal", - "buildTime": "202308081821", - "buildCommit": "c8725f94", - "sourceCommit": "c8725f94", - "version": "0.2.5-internal-202308081821" + "buildTime": "202308081829", + "buildCommit": "4d89bb06", + "sourceCommit": "4d89bb06", + "version": "0.2.5-internal-202308081829" } \ No newline at end of file diff --git a/dist/spa/index.html b/dist/spa/index.html index f8edf47d..5867eea1 100644 --- a/dist/spa/index.html +++ b/dist/spa/index.html @@ -8,4 +8,4 @@ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} window.gtag = gtag - }
\ No newline at end of file + }
\ No newline at end of file diff --git a/dist/spa/js/app.13f8c0eb.js b/dist/spa/js/app.1f78b1c9.js similarity index 99% rename from dist/spa/js/app.13f8c0eb.js rename to dist/spa/js/app.1f78b1c9.js index c4787fd5..bdc4415e 100644 --- a/dist/spa/js/app.13f8c0eb.js +++ b/dist/spa/js/app.1f78b1c9.js @@ -1 +1 @@ -(function(e){function t(t){for(var o,a,r=t[0],l=t[1],c=t[2],d=0,u=[];de+" --- |"),"| ")+"\n";return n+o+e.reduce(((e,t)=>e+t.reduce(((e,t,n)=>n?`${e} \`${t}\` |`:`| ${t} |`),"")+"\n"),"")}function _(e,t){return`
${e}\n\n${t}\n
\n\n`}function f({type:e,text:t,version:n,devInfo:o}){const a=o?_("System info",m(o)):"";return`**Issue type**: ${e}\n\n**Describe the bug**:\n\n${t}\n\n`+(n?`---\n\n**App version**: \`${n}\`\n\n`:"")+(a||"(User disabled submitting system info)")}var g=n("47fc");const b=async()=>{if(Object(p["a"])()){const e=await(await Promise.resolve().then(n.bind(null,"a368"))).Device.getInfo();return[["Key","Value"],["Mode","Mobile(Capacitor)"],["Platform",e.platform],["OS",e.operatingSystem+" "+e.osVersion],["Model",e.model],["Manufacturer",e.manufacturer],["Webview version",e.webViewVersion],["isVirtual",e.isVirtual]]}if(!Object(h["default"])()){const e=Object(g["a"])();return[["Key","Value"],["Mode","Web"],["OS",e.os+" "+e.osVersion],["Browser",e.browser+" "+e.browserVersion],["Mobile",e.mobile?"Yes":"No"],["Platform",navigator.platform||"Unknown"],["User-Agent",navigator.userAgent]]}const{ipcRenderer:e}=await Promise.resolve().then(n.t.bind(null,"b052",7));return new Promise((t=>{e.once("dev-info",((e,n)=>{t([["Key","Value"],["Mode","Electron"],["OS",n.osPlatform?n.osPlatform+" "+n.osRelease:"Unknown"],["OS kernel",n.osVer||"Unknown"],["Electron version",n.electronVer||"Unknown"],["Chrome version",n.chromeVer||"Unknown"],["Node version",n.nodeVer||"Unknown"]])})),e.send("dev-info")}))};async function y({type:e,category:t,title:n,details:o,withDevInfo:a=!1}={}){const s=a?await b():null,r=f({type:e,text:o,version:Object(i["a"])("version"),devInfo:s});return{title:`[${t||e}] ${n}`,body:r}}n("dc89"),n("2425");var v=n("d710");const{github:w}=v["update"],k=`https://github.com/${w.username}/${w.repo}/`;function C({title:e,body:t}){const n=new URL("issues/new",k);return n.searchParams.set("title",e),n.searchParams.set("body",t),n.toString()}var $,S=n("aa9c"),x=n("623f"),T=n.n(x);const I="https://twitter.com/intent/tweet?text=",P=v["twitterAccount"].trim()+" ";function O(e){return S["a"].parseTweet(P+e).weightedLength}const q=(null===T.a||void 0===T.a||null===($=T.a.defaults)||void 0===$?void 0:$.maxWeightedTweetLength)||280;function E(e){return O(e)<=q}function A(e){return e.substring(0,S["a"].parseTweet(e).displayRangeEnd-4)+"..."}function D(e){let t=P+e;return E(e)||(t=A(t)),`${I}${encodeURIComponent(t)}`}var N={props:{show:Boolean},data(){return{title:"",details:"",withDevInfo:!0,target:"github",type:{value:"Twitter",label:this.$t("tweet_us")},typeOptions:[{value:"Twitter",label:this.$t("tweet_us")},{value:"Bug report",label:this.$t("report_a_bug")},{value:"Feature request",label:this.$t("request_a_new_feature")}],category:{value:"",label:this.$t("select_a_category")},categoryOptions:[{value:"",label:this.$t("select_a_category")},{value:"Download",label:this.$t("download_or_upload")},{value:"Player",label:this.$t("player")},{value:"Account",label:this.$t("account")},{value:"Credits",label:this.$t("credits")},{value:"Settings",label:this.$t("settings")},{value:"Others",label:this.$t("others")}]}},computed:{isTwitter(){return"Twitter"===this.type.value},descRules(){return this.isTwitter?[e=>E(e)||this.$t("tweet_too_long")]:[]},twitterLength(){return this.isTwitter?O(this.details):0},restChars(){return q-this.twitterLength},twitterHint(){return this.restChars<0?this.$t("delete_characters",[Math.abs(this.restChars)]):this.$t("rest_characters",[this.restChars])},disableSubmit(){return this.isTwitter?this.restChars<0||!this.details.trim():!this.title.trim()}},methods:{submitTwitter(){E(this.details)&&(window.open(D(this.details),"_blank"),this.close())},async submitGithub(){const e=await y({type:this.type.value,category:this.category.value,title:this.title,details:this.details,withDevInfo:this.withDevInfo});let t;switch(this.target){case"github":t=C(e);break}t&&(window.open(t,"_blank"),this.close())},close(){this.$emit("close")},submit(){return this.isTwitter?this.submitTwitter():this.submitGithub()}}},L=N,j=(n("9e98"),n("2b5f")),R=n("b2aa"),U=n("e586"),F=n("d7c7"),M=n("a4ac"),B=n("0e45"),Q=n("7498"),W=n("1043"),z=n("09a4"),H=n.n(z),V=Object(j["a"])(L,d,u,!1,null,null,null),G=V.exports;H()(V,"components",{QDialog:R["a"],QCard:U["a"],QCardSection:F["a"],QSelect:M["a"],QInput:B["a"],QCheckbox:Q["a"],QBtn:W["a"]});var K=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{staticClass:"diagnotic",attrs:{value:e.show,"content-class":"fullscreen-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:e.close}},[n("q-card",{staticClass:"diagnotic-main"},[n("q-card-section",{staticClass:"flex items-center",class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-weight-bolder"},[e._v(e._s(e.$t("network_diagnotic")))]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"},{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",flat:"",round:""}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-section",{staticClass:"row items-center no-wrap full-width",class:{"q-pt-none":!e.screen$xs}},[n("div",{staticClass:"q-mr-md"},[e.isChecking?n("q-avatar",[n("q-circular-progress",{staticStyle:{"margin-left":"-8px"},attrs:{indeterminate:"",color:"positive",size:"md"}})],1):e.isChecked?n("q-avatar",{attrs:{size:"lg",icon:e.isNetworkError?"close":"done",color:e.isNetworkError?"negative":"positive","text-color":e.isNetworkError?"negative":"positive"}}):n("q-avatar",{attrs:{size:"lg",icon:"construction",color:"general","text-color":"general"}})],1),n("div",[e._v(e._s(e.networkStatus))]),n("div",{staticClass:"col-grow row items-center justify-end"},[n("q-btn",{staticStyle:{width:"128px"},attrs:{"no-wrap":"","no-caps":"",unelevated:"",size:"0.8rem",color:"primary",label:e.$t("diagnotic"),disabled:e.isChecking},on:{click:e.checkNetwork}})],1)]),n("q-card-section",{staticClass:"q-px-none q-pt-none"},[e.isOffline?n("div",{staticClass:"offline"},[e._v(e._s(e.$t("offline")))]):n("div",{staticClass:"logs"},[n("q-item",{class:{disabled:"-"===e.dnsStatus.avgTime||e.dnsStatus.isError}},[n("q-item-section",{attrs:{avatar:""}},[e.dnsStatus.isChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):"-"===e.dnsStatus.avgTime?n("q-avatar",{attrs:{size:"lg",icon:"dns",color:"general","text-color":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:e.dnsStatus.isError?"close":"done",color:e.dnsStatus.isError?"negative":"general","text-color":e.dnsStatus.isError?"negative":"general"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("dns_look_up")))]),e.dnsStatus.isError?n("span",{staticClass:"text-red"},[e._v(e._s(e.$t("error")))]):"-"!==e.dnsStatus.avgTime?n("span",{staticClass:"text-primary"},[e._v(e._s(e.dnsStatus.avgTime+" ms"))]):e._e()],1)],1),n("q-expansion-item",{staticClass:"full-width aws",attrs:{disable:!e.awsStatus.length},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isAwsChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.awsStatus.length?n("q-avatar",{attrs:{size:"lg",icon:e.isAwsError?"close":"done",color:e.isAwsError?"negative":"general","text-color":e.isAwsError?"negative":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:"account_circle",color:"general","text-color":"general"}})],1),n("q-item-section",[e._v(e._s(e.$t("aws_service")))])]},proxy:!0}])},[n("div",{staticClass:"aws-results q-py-md q-px-lg"},e._l(e.awsStatus,(function(t){return n("div",{key:t.name,staticClass:"aws-result"},[n("span",{staticClass:"result-name"},[e._v(e._s(t.name))]),e._v(" -\n "),n("span",{staticClass:"time",class:t.avgTime?"text-primary":"text-red"},[e._v(e._s(t.avgTime?e.$t("online"):e.$t("offline")))])])})),0)]),n("q-expansion-item",{staticClass:"full-width public-ping",attrs:{disable:!e.publicPingStatus.length},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isPublicChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.publicPingStatus.length?n("q-avatar",{attrs:{size:"lg",icon:e.isPublicError?"close":"done",color:e.isPublicError?"negative":"general","text-color":e.isPublicError?"negative":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:"public",color:"general","text-color":"general"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("network_pings")))]),n("small",{staticClass:"q-ml-sm",class:e.isPublicError?"text-red":"text-primary"},[e._v(e._s(e.publicPing))])],1)]},proxy:!0}])},[n("div",{staticClass:"ping-results q-px-lg q-py-md"},e._l(e.publicPingStatus,(function(t){return n("div",{key:t.name,staticClass:"ping-result"},[n("span",{staticClass:"result-name"},[e._v(e._s(t.url))]),e._v(" -\n "),n("span",{staticClass:"time",class:t.alive?"text-primary":"text-red"},[e._v(e._s("-"!==t.avgTime?t.avgTime+"ms":e.$t("not_found"))+" ("+e._s(t.packetLoss)+"% "+e._s(e.$t("packet_loss"))+")")])])})),0)]),n("q-expansion-item",{staticClass:"full-width public-ping",attrs:{disable:!e.privatePingStatus.length},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isPrivateChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.privatePingStatus.length?n("q-avatar",{attrs:{size:"lg",icon:e.isPrivateError?"close":"done",color:e.isPrivateError?"negative":"general","text-color":e.isPrivateError?"negative":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:"star",color:"general","text-color":"general"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("official_site")))])],1)]},proxy:!0}])},[n("div",{staticClass:"ping-results q-px-lg q-py-md"},e._l(e.privatePingStatus,(function(t){return n("div",{key:t.name,staticClass:"ping-result"},[n("span",{staticClass:"result-name"},[e._v(e._s(t.url))]),e._v(" -\n "),n("span",{staticClass:"time",class:t.alive?"text-primary":"text-red"},[e._v(e._s("-"!==t.avgTime?t.avgTime+"ms":e.$t("not_found"))+" ("+e._s(t.packetLoss)+"% "+e._s(e.$t("packet_loss"))+")")])])})),0)]),n("q-expansion-item",{staticClass:"full-width",attrs:{disable:e.trackerStatus.success.length+e.trackerStatus.fail.length===0},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isDownloading?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.isDownloadInit?n("q-avatar",{attrs:{size:"lg",icon:"lan",color:"general","text-color":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:e.isDownloadError?"close":"done",color:e.isDownloadError?"negative":"general","text-color":e.isDownloadError?"negative":"general"}})],1),n("q-item-section",[e._v(e._s(e.$t("download_test")))])]},proxy:!0}])},[n("div",{staticClass:"download-results q-px-lg q-py-md"},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showTrackerResult,expression:"showTrackerResult"}],staticClass:"trackers"},[n("span",{staticClass:"result-name"},[e._v("Trackers")]),e._v("\n - "+e._s(e.trackerStatus.success.length)+" "+e._s(e.$t("connected"))+"\n ")]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showTorrentResult,expression:"showTorrentResult"}],staticClass:"torrent"},[n("span",{staticClass:"result-name"},[e._v(e._s(e.$t("test_task",["6.9 MB"])))]),n("span",[e._v(" - ")]),e.torrentStatus.isError?n("span",{staticClass:"text-red"},[e._v(e._s(e.$t("download_failed")))]):-1===e.torrentStatus.time?n("span",{staticClass:"text-normal"},[e._v(e._s(e.$t("downloading"))+"...")]):n("span",{staticClass:"text-primary"},[e._v(e._s(e.$t("second_spend",[e.torrentStatus.time])))])])])])],1)]),n("q-card-actions",{directives:[{name:"show",rawName:"v-show",value:!e.screen$xs,expression:"!screen$xs"}],staticClass:"q-px-md q-pb-md q-pt-none",attrs:{align:"right"}},[n("q-btn",{attrs:{unelevated:"",label:e.$t("close")},on:{click:e.close}})],1)],1)],1)},Y=[],J=n("d7df"),X={props:{show:Boolean},data(){return{isChecked:!1,isChecking:!1,isOnline:!1,networkStatus:this.$t("click_to_check"),dnsStatus:{isChecking:!1,isError:!1,results:[],avgTime:"-"},isPrivateChecking:!1,isPrivateError:!1,privatePingStatus:[],isPublicChecking:!1,isPublicError:!1,publicPing:"",publicPingStatus:[],isAwsChecking:!1,isAwsError:!1,awsStatus:[],trackerStatus:{success:[],fail:[],isChecking:!1,isError:!1},torrentStatus:{isChecking:!1,isError:!1,time:-1}}},computed:{isOffline(){return this.isChecked&&!this.isOnline},showPrivateResult(){return this.privatePingStatus.isChecking||"-"!==this.privatePingStatus.avgTime},isDownloading(){return this.trackerStatus.isChecking||this.torrentStatus.isChecking},isDownloadError(){return this.trackerStatus.isError||this.torrentStatus.isError},isDownloadInit(){return!this.isDownloadError&&!this.trackerStatus.isError&&-1===this.torrentStatus.time},showTrackerResult(){return this.trackerStatus.isChecking||this.trackerStatus.isError||!!this.trackerStatus.success.length},showTorrentResult(){return this.torrentStatus.isChecking||this.torrentStatus.isError||this.torrentStatus.time>-1},isNetworkError(){return this.isChecked&&(!this.isOnline||this.isDownloadError||this.dnsStatus.isError||this.isAwsError||this.privatePingStatus.some((e=>!e.alive))||this.publicPingStatus.every((e=>!e.alive)))}},methods:{initCheck(){this.isChecking=!0,this.dnsStatus={isChecking:!0,isError:!1,results:[],avgTime:"-"},this.isPrivateChecking=!1,this.isPrivateError=!1,this.privatePingStatus=[],this.isPublicChecking=!0,this.publicPing="",this.publicPingStatus=[],this.isPublicError=!1,this.isAwsChecking=!0,this.isAwsError=!1,this.awsStatus=[],this.trackerStatus={success:[],fail:[],isChecking:!0,isError:!1},this.torrentStatus={isChecking:!0,isError:!1,time:-1},this.networkStatus=this.$t("checking")+"..."},checkNetwork(){this.initCheck(),console.log("check"),J["a"].emit("check-network")},onCheckResult(e){switch(e.type){case"isOnline":this.isOnline=e.result;break;case"dnsCheckResult":this.dnsStatus.isChecking=!1,e.result.fail.length?this.dnsStatus.isError=!0:this.dnsStatus.isError=!1,this.dnsStatus.results.splice(0),this.dnsStatus.results.push(...e.result.success,...e.result.fail),this.dnsStatus.avgTime=e.result.avgTime;break;case"publicPingResult":this.isPublicChecking=!0,this.publicPingStatus.push(e.result),e.result.alive||(this.isPublicError=!0);break;case"publicPingEnd":this.isPublicChecking=!1,this.publicPing=e.result;break;case"privatePingResult":this.isPrivateChecking=!0,this.privatePingStatus.push(e.result),e.result.alive||(this.isPrivateError=!0);break;case"privatePingEnd":this.isPrivateChecking=!1;break;case"pingAwsEnd":this.isAwsChecking=!1,this.awsStatus.splice(0),this.awsStatus.push(...e.successServices,...e.errorServices),this.isAwsError=e.error;break;case"trackerCheckResult":"connected"===e.result.result?this.trackerStatus.success.push(e.result.url):this.trackerStatus.fail.push(e.result.url);break;case"trackerCheckEnd":this.trackerStatus.isChecking=!1,this.trackerStatus.success.splice(0),this.trackerStatus.success.push(...e.result.success),this.trackerStatus.fail.splice(0),this.trackerStatus.fail.push(...e.result.fail),e.result.success.length||(this.trackerStatus.isError=!0);break;case"torrentCheckResult":this.torrentStatus.isChecking=!1,this.torrentStatus.isError=e.result.error,this.torrentStatus.time=e.result.time;break}},onCheckEnd(e){console.log("end",e),"isOnline"in e&&(this.isOnline=e.isOnline),this.isChecking=!1,this.isChecked=!0,this.networkStatus=this.$t("click_to_check_again")},close(){this.$emit("close")}},mounted(){J["a"].on("check-network-end",this.onCheckEnd),J["a"].on("check-network-result",this.onCheckResult)},beforeDestroy(){J["a"].off("check-network-end",this.onCheckEnd),J["a"].off("check-network-result",this.onCheckResult)}},Z=X,ee=(n("88f5"),n("990e")),te=n("fc38"),ne=n("9f3e"),oe=n("64e7"),ae=n("b329"),se=n("25fb"),ie=n("79e0"),re=n("5bbd"),le=n("59ba"),ce=n("a431"),de=Object(j["a"])(Z,K,Y,!1,null,"8fee9c62",null),ue=de.exports;H()(de,"components",{QDialog:R["a"],QCard:U["a"],QCardSection:F["a"],QSpace:ee["a"],QBtn:W["a"],QSeparator:te["a"],QAvatar:ne["a"],QCircularProgress:oe["a"],QItem:ae["a"],QItemSection:se["a"],QItemLabel:ie["a"],QExpansionItem:re["a"],QCardActions:le["a"]}),H()(de,"directives",{ClosePopup:ce["a"]});var he=n("9f21");const{github:pe}=v["update"],me=l.a.renderer();var _e={name:"AboutDialog",mixins:[he["a"]],components:{Feedback:G,NetworkDiagnotic:ue},data(){return{displayName:v["displayName"],isElectron:me,isCapacitor:Object(p["a"])(),iconClickTime:0,dialogVisible:!1,appVersion:Object(i["a"])("version"),loading:!1,primaryIcon:"developer/assets/icon-256.png",showFeedback:!1,showNetworkDiagnotic:!1}},created(){s["Bus"].$on("CALL_ABOUT",(()=>{this.dialogVisible=!0})),s["Bus"].$on("CALL_NETWORK_DIAGNOSTIC",(()=>{this.toggleNetworkDiagnotic(!0)})),me&&Promise.resolve().then(n.t.bind(null,"b052",7)).then((({ipcRenderer:e})=>{e.on("about-dialog",(()=>{this.dialogVisible=!0}))}))},computed:{isAlphabizExperimental(){return"Alphabiz"===v["displayName"]&&(this.appVersion.includes("internal")||this.appVersion.includes("nightly"))}},methods:{close(){this.dialogVisible=!1},browserRelease(){const e=`https://github.com/${pe.username}/${pe.repo}/releases`;me?Promise.resolve().then(n.t.bind(null,"b052",7)).then((t=>{t.ipcRenderer.send("to_browserurl",e)})):window.open(e,"_blank")},clickIcon(){this.iconClickTime+=1,setTimeout((()=>{this.iconClickTime-=1}),3e3),5===this.iconClickTime&&(console.log("enable!"),me?(n("b052").ipcRenderer.send("enable_devtools"),c["a"].dispatch("fetchSettings")):c["a"].dispatch("set",{disableDevTools:!1}).then((()=>{c["a"].dispatch("fetchSettings")})),this.$q.notify("DevTools is enabled"))},toggleFeedback(e){console.log("toggle",e),this.showFeedback=e},toggleNetworkDiagnotic(e){this.showNetworkDiagnotic=e}}},fe=_e,ge=(n("3c8a"),n("9767")),be=n("4101"),ye=Object(j["a"])(fe,o,a,!1,null,"e4afc3b8",null);t["a"]=ye.exports;H()(ye,"components",{QDialog:R["a"],QCard:U["a"],QCardSection:F["a"],QSpace:ee["a"],QBtn:W["a"],QSeparator:te["a"],QImg:ge["a"],QColor:be["a"]})},"030c":function(e,t,n){"use strict";n("ca31")},"0336":function(e,t,n){},"053d":function(e,t,n){},"058f":function(e,t,n){},"0598":function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"default",(function(){return a}));const o=Boolean((()=>"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||"undefined"!==typeof e&&"object"===typeof e.versions&&e.versions.electron||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.includes("Electron"))());function a(){return o}}.call(this,n("28d0"))},"06cd":function(e,t,n){"use strict";n("326b")},"06e8":function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c}));n("d4b5"),n("de6c"),n("7996");var o=n("e75b");const a=new o["a"].Rest("ABDevRest"),s=e=>{let t,n,o,s;const i=()=>!1!==s,r=e=>{t=e.query_type,n=e.query_params||{},o=[],s=void 0},l=()=>a.post("/credit/transaction/query",{query_type:t,query_params:JSON.stringify(n),next_token:s}).then((e=>{var t;o.push(...e.items),s=null!==(t=e.nextToken)&&void 0!==t&&t}));return e&&r(e),{reset:r,getData:()=>o,hasNext:i,fetch:l}},i=o["a"].GQL,r={enable:async e=>await i.enableUserListener(e),disable:async()=>{i.removeUserListener("credits"),i.disableUserListener()},addHandler:(e,t)=>{i.addUserListener("credits",(n=>{void 0!==n[e]&&t(n[e])}))},addHandlers:(e,t)=>{i.addUserListener("credits",(t=>{Object.entries(t).forEach((([t,n])=>{e[t]&&e[t](n)}))}),t)}},l={state:"disabled",resolver:null,async enable({rootState:e,rootGetters:t,dispatch:n}){const o=()=>e.account.sub,a=()=>t.transactions.expenses,s=e=>n("CREDIT_PAY_DATA_CANCEL",{transactionId:e.id}),i=e=>t=>{const n=2592e5;if("PAYDATA"!==t.category)return!1;if(t.payerId!==o())return!1;if("PENDING"!==t.status)return!1;const a=e.getTime()-new Date(t.createdAt).getTime();return!(a<=n)},r=async()=>{const e=a(),t=e.filter(i(new Date));for(const n of t)console.log("TxnCancellation:",n.id),await s(n)};c.state="idle";const l=3e5;while(!["stopping","disabled"].includes(c.state)){let e=l;if("idle"===c.state){c.state="processing";const t=(new Date).getTime();if(await r(),["stopping","disabled"].includes(c.state))break;const n=(new Date).getTime();e-=Math.max(0,Math.min(l,n-t))}if(e&&(c.state="waiting",await new Promise((t=>setTimeout(t,e))),["stopping","disabled"].includes(c.state)))break;c.state="idle"}console.error("TxnCancellation resolver"),c.resolver?c.resolver():console.error("resolver not found")},async disable(){if(["stopping","disabled"].includes(c.state))return;if(["waiting"].includes(c.state))return void(c.state="disabled");const e=new Promise((e=>{c.resolver=()=>{e(),c.resolver=null}}));c.state="stopping",await e,c.state="disabled"}},c=new Proxy(l,{get(e,t,n){return Reflect.get(e,t,n)},set(e,t,n,o){return"state"===t&&console.log("TxnCancellation:",n),Reflect.set(e,t,n,o)}})},"071f":function(e,t,n){"use strict";n("25b9")},"072b":function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"h",(function(){return m})),n.d(t,"b",(function(){return _})),n.d(t,"g",(function(){return f})),n.d(t,"f",(function(){return g}));n("de6c");const o="`~!@#$%^&*()\\-_=+[\\]\\\\;',./{}|:\"<>?",a=(e,t)=>{const n=new RegExp(`^[${t.join("")}]*$`);return n.test(e)},s=(e,t=1,n=1/0)=>void 0!==e&&("string"===typeof e&&0===e.length||e.length>=t&&e.length<=n),i=e=>!/\s\s/.test(e),r=e=>/[0-9]/g.test(e),l=(e,t)=>void 0===e||("string"===typeof e&&0===e.length||new RegExp(`^[^${t.join("")}]`).test(e)),c=(e,t)=>void 0===e||("string"===typeof e&&0===e.length||new RegExp(`[^${t.join("")}]$`).test(e)),d=function(e){const t=["0-9","A-Z","a-z","一-龥","\\s","_"];if(!a(e,t))return this.$t("account_field_only_chinese_alphanumeric_space_underline");const[n,o]=[2,15];return s(e,n,o)?l(e,["0-9","\\s"])?c(e,["\\s"])?!!i(e)||this.$t("account_field_without_repeat_space"):this.$t("account_field_suffix_without_space"):this.$t("account_field_prefix_without_number_space"):this.$t("account_field_range",[n,o])},u=function(e){const t=["0-9","A-Z","a-z",o];if(!a(e,t))return this.$t("account_field_only_alphanumeric_and_symbol");const[n,i]=[8,20];return s(e,n,i)?r(e)?void 0:this.$t("account_field_must_have_number_characters"):this.$t("account_field_range",[n,i])},h=function(e){if(!/^([a-zA-Z]|[0-9])(\w|-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(e))return this.$t("account_invalid_email_format")},p=function(e){if(!a(e,["0-9"]))return this.$t("account_field_phone_number");const[t,n]=[3,11];return s(e,t,n)?void 0:this.$t("account_field_range",[t,n])},m=function(e){return a(e,["0-9"])&&s(e,6,6)?void 0:this.$t("account_field_verification_code")},_=function(e){const t=["0-9","A-Z","a-z"];if(!a(e,t))return this.$t("account_field_invitation_code")},f=function(e){const t=["0-9","a-f","-"];return a(e,t)&&"8-4-4-4-12"===e.split("-").map((e=>e.length)).join("-")||this.$t("tip_invalid_receiver")},g=function(e){return/^((\d{1,3}(\.\d{1,3})?)|(1000(\.0{1,3})?))$/.test(e)?[""+parseFloat(e)===e,parseFloat(e)<=1e3,parseFloat(e)>=.001,parseInt(1e3*parseFloat(e))===1e3*parseFloat(e)].some((e=>!e))?this.$t("tip_invalid_amount"):void 0:this.$t("tip_invalid_amount")}},"0742":function(e,t,n){},"076e":function(e,t,n){"use strict";n("de6c");const o={oauth_stage:{authorize:["Authorizing","授权中...","授權中..."],logging_in:["Logging in","登陆中...","登入中..."],connecting:["Connecting","关联中...","關聯中..."]},oauth_connect:{connect_to:["Connect to {provider}","关联 {provider} 账号","關聯 {provider} 賬號"],notify:{connected:["{provider} connected","已关联 {provider} 账号","已關聯 {provider} 賬號"]}},oauth_disconnect:{disconnect:["Disconnect {provider}","解除 {provider} 账号关联","解除 {provider} 賬號關聯"],notify:{disconnected:["{provider} disconnected","已解除 {provider} 账号关联","已解除 {provider} 賬號關聯"]}},oauth_login:{sign_in_with:["Sign in with {provider}","通过 {provider} 登录","通過 {provider} 登錄"],notify:{signed_in:["Signed in","登录成功","登錄成功"]}},oauth_error:{can_not_login_unconnected_account:["Can not log in to an unconnected {provider} account","无法登录未关联的 {provider} 账号","無法登錄未關聯的 {provider} 賬號"],oauth_account_has_been_connected:["The {provider} account has been connected","该 {provider} 账号已建立关联","該 {provider} 賬號已建立關聯"]},oauth_unset:["unset","未关联","未關聯"]},a=e=>{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};t["a"]={messages:a(o)}},"0885":function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return g})),n.d(t,"a",(function(){return b}));n("7a76"),n("de6c");var o=n("3387"),a=n("f680"),s=n("5584"),i=n("d310"),r=n("1926"),l=n("d7df"),c=n("84f6"),d=n("d558");const u={started:[],toVerify:{},toSubmit:{},toFinish:{},toPause:{}},h={},p=1e7,m="\n background-color: rgb(90,90,90);\n color: white;\n padding: 1px 5px;\n border-radius: 8px;\n border: 2px solid rgb(161,161,161);\n",_=()=>{const t={set:t=>e.notified_credit_not_enough_amount=t,get:()=>!!e.notified_credit_not_enough_amount};t.get()||(t.set(!0),a["a"].create({group:"credit_not_enough_amount",message:r["b"].t("credit_not_enough_amount"),type:"negative",position:"bottom-right",timeout:6e3,actions:[{icon:"close",color:"negative",handler:()=>t.set(!1)}]}))};function f(e,t){h[e]=t}function g(e,t=!1){t?(console.log("restart transaction",e),l["a"].emit("restart_payment",e)):l["a"].emit("credit_payment_created",e),u.started.push(e.id)}async function b(e,t=!1,n){console.log("Create payment",e,t);const{infoHash:o,remoteSubId:s,payed:i}=e,l=Date.now().toString();try{const c=await n.dp$request(s,i,{infoHash:o,timestamp:l});g({...e,id:c}),t||a["a"].create(r["b"].t("success"))}catch(c){if(console.log("dp$request failed",c.message),"credit_not_enough_amount"===c.message)return void _();t||a["a"].create(c.message||c)}}function y(e){e.$watch("dp$incomeStatusMapper",((e,t)=>{Object(o["isEqual"])(e,t)||e.PENDING&&e.PENDING.forEach((e=>{u.toVerify[e]&&u.toVerify[e](),u.toSubmit[e]&&u.toSubmit[e]()}))})),e.$watch("dp$expenseStatusMapper",((t,n)=>{Object(o["isEqual"])(t,n)||(t.PENDING&&t.PENDING.forEach((t=>{if(u.started.includes(t))return;const n=e.dp$expenseTxnDict[t],o=JSON.parse(n.meta);console.log("dp$restart from StatusMapper"),g({infoHash:o.infoHash,remoteSubId:n.payeeId,payed:n.amount,autoRenew:!!h[o.infoHash],id:n.id},!0)})),t.COMPLETED&&t.COMPLETED.forEach((e=>{u.toFinish[e]&&u.toFinish[e]()})))})),l["a"].on("verify_payment",(t=>{if(console.log("onVerify",t),void 0===u.toVerify[t.id]){const n=async()=>{u.toVerify[t.id]=!1;const n=e.dp$incomeTxnDict[t.id],o=e=>{throw new Error(`DataPayment(${t.id}) Verify failed: ${e}`)};n.amount!==t.payed&&o("mismatched amount"),l["a"].emit("payment_verified",t)};u.toVerify[t.id]=n}const n=e.dp$incomeStatusMapper.PENDING;n&&n.includes(t.id)&&(u.toVerify[t.id]&&u.toVerify[t.id](),delete u.toVerify[t.id])})),l["a"].on("torrent_metadata",(t=>{var n;l["a"].emit("save_torrent_file",t),f(t,!0);const o=e.dp$expenseHashMapper[t];if(!o)return;const a=null===(n=e.dp$expenseStatusMapper.PENDING)||void 0===n?void 0:n.filter((e=>o.includes(e)));a&&a.length&&a.forEach((n=>{const o=e.dp$expenseTxnDict[n];console.log("dp$restart from resumeAccelerate"),g({infoHash:t,remoteSubId:o.payeeId,payed:o.amount,autoRenew:h[t],id:o.id},!0)}))})),l["a"].on("request_renew",(t=>{var o;const{subId:a,infoHash:s,peerId:r}=t,l=Object(i["isElectron"])()||Object(d["a"])()?c["a"].allTasks.find((e=>e.infoHash===s)):n("c620").getTaskInstance();if(!l||l.paused||l.done||!l.connections)return;const u=null===(o=l.connections)||void 0===o?void 0:o.find((e=>e.subId===a));if(!u)return;if(!u.hasResource)return void console.log("Remote peer does not have resource. Skip renew.",a,s,r);const h=e.dp$expenseHashMapper[s]||[],m=e.dp$expenseStatusMapper.PENDING||[],_=(null===m||void 0===m?void 0:m.filter((e=>h.includes(e))))||[];if(_.length>10)return console.log("too many pending payments",_);const g=_.filter((t=>{if(!e.dp$expenseTxnDict)return!1;if(e.dp$expenseTxnDict[t]){const n=e.dp$expenseTxnDict[t];return"PENDING"===n.status&&n.payeeId===a}return!1}));if(g.length>3)return console.log(`Too many pending payments for remote subId ${t.subId}`,_);const y=l.length-l.recieved;let v=t.payCount||10;y{console.log("payment completed",t),void 0===u.toSubmit[t.transactionId]&&(u.toSubmit[t.transactionId]=async()=>{u.toSubmit[t.transactionId]=!1,await e.dp$submit(t.transactionId),l["a"].emit("finish_payment",t)});const n=e.dp$incomeStatusMapper.PENDING;n&&n.includes(t.transactionId)&&u.toSubmit[t.transactionId]&&u.toSubmit[t.transactionId]()})),l["a"].on("payment_finished",(t=>{console.log("Finished",t.id),void 0===u.toFinish[t.id]&&(u.toFinish[t.id]=async()=>{u.toFinish[t.id]=!1;try{await e.dp$confirm(t.id);const n=e.dp$expenseTxnDict[t.id];l["a"].emit("payment_closed",{id:n.id,infoHash:JSON.parse(n.meta).infoHash,remoteSub:n.payeeId})}catch(n){console.error("dp$toFinish failed:",n.message)}});const n=e.dp$expenseStatusMapper.COMPLETED;n&&n.includes(t.id)&&u.toFinish[t.id]&&u.toFinish[t.id]();const o=e.dp$expenseStatusMapper.PENDING;o&&o.includes(t.id)&&u.toFinish[t.id]&&u.toFinish[t.id]()})),l["a"].on("request-provident-payment",(async e=>{console.log("%cRequest provident payment",m,e);try{await s["a"].dispatch("CREDIT_PF_DEPOSIT",{amount:e.count,meta:{infoHash:e.infoHash,timestamp:Date.now().toString()}})}catch(t){"credit_not_enough_amount"===t.message&&_()}}))}t["b"]=y}).call(this,n("0ee4"))},"0925":function(e,t,n){"use strict";function o(e){return{Github:"fab fa-github",Twitter:"fab fa-twitter",Google:"fab fa-google"}[e]}function a({title:e,providerName:t}){const n=(n,a)=>({title:this.$t(e,{provider:t}),ok:!1,cancel:a.cancel,banner:{avatar:o(t),title:this.$t(`oauth_stage.${n}`,{provider:t})}});let a;const s={updateStage:(e,s)=>{a?a.update({banner:{avatar:o(t),title:this.$t(`oauth_stage.${e}`,{provider:t})}}):a=this.$alphabiz.dialog(n(e,s))},hide:()=>{var e;null===(e=a)||void 0===e||e.hide()}};return s}t["a"]={getIcon:o,useOAuthFlowDialog:a}},"0928":function(e,t,n){"use strict";n("7405")},"09e8":function(e,t,n){"use strict";n("d4b5");var o=n("5584");class a{constructor(e){Object.defineProperty(this,"_data",{get(){return e}});const t=()=>{const t=["id","status","payerId","payeeId","amount","meta"],n={};return t.forEach((e=>n[e]=this[e])),Object.defineProperty(n,"_data",{get(){return e}}),n};return t()}get id(){return null}get status(){return null}get payerId(){return null}get payeeId(){return null}get amount(){return null}get meta(){return null}}class s{constructor(e){this.name=e}dp$address(){}dp$credit(){}dp$incomeTxnList(){}dp$expenseTxnList(){}dp$incomeTxnListToday(){}async dp$request(e,t,n){}async dp$cancel(e){}async dp$submit(e,t){}async dp$confirm(e,t){}}n("de6c");const i=(...e)=>{let t,n,o;"string"===typeof e[0]?(t={warn:[{bgc:"rgb(250,211,138)",color:"black"},{bgc:"rgb(155,123,53)",color:"white"}]}[e[0]],n=e[1],o=e.slice(2)):(t=[{bgc:"gainsboro",color:"black"},{bgc:"grey",color:"white"}],n=e[0],o=e.slice(1));const a=e=>`background-color: ${e.bgc}; color: ${e.color}; padding: 2px 12px;`,s=Array.from(n,((e,o)=>{let s=a(t[(o+1)%2]);return 0===o?s+=" border-top-left-radius: 8px; border-bottom-left-radius: 8px;":o===n.length-1&&(s+=" border-top-right-radius: 8px; border-bottom-right-radius: 8px;"),s})),i=n.map((e=>`%c${e}`)).join("");console.log(i,...s,...o)};class r{constructor({parallelCount:e}={}){this.queue=[],this.started=!1,this.parallelCount=e||1}append(...e){return this.queue.push(...e),this}async start(){if(!this.started){this.started=!0;while(this.started)if(this.queue.length>0){const e=this.queue.splice(0,this.parallelCount),t=e=>new Promise((t=>{const n=e();n&&n.then&&n.catch?n.then(t):t()}));await Promise.all(e.map(t))}else await this.wait(3e3)}}stop(){this.started=!1}async wait(e){await new Promise((t=>setTimeout(t,e)))}async promise(e){let t;if(await new Promise((n=>{this.append((()=>e().then(n,(e=>t=e))))})),t)throw t}}const l=async(e,t)=>{let n=0;const o=Math.floor(1e3*Math.random()),a=e=>{if(n+=1,!["Invalid transaction: status should be PENDING","Invalid transaction: status should be PENDING or COMPLETED","Transaction cancelled, please refer cancellation reasons for specific reasons [None, ConditionalCheckFailed]","Transaction cancelled, please refer cancellation reasons for specific reasons [None, ValidationError]"].includes(e.message)){if("Network Error"===e.message)return i("warn",["dp$retry",o,e.code],e.message),!0;if(["Transaction cancelled, please refer cancellation reasons for specific reasons [None, TransactionConflict]"].includes(e.message))return i("warn",["dp$retry",o,"TransactionConflict",e.code],e.message),!0;if(n{if(!a(t))return;const n=Math.floor(1e3*Math.random());return new Promise((e=>setTimeout(e,n))).then(e).catch(s)},r=await e().catch(s);return r};class c extends s{constructor(){super("amplify"),this.asyncQueue=new r({parallelCount:1}),this.asyncQueue.start().then((()=>{console.log("dp$asyncQueue: stop")}))}dp$address(){return o["a"].state.account.sub}dp$credit(){return o["a"].state.credits.credit}dp$incomeTxnList(){const e=o["a"].getters.transactions.income.filter((e=>"PAYDATA"===e.category));return e}dp$expenseTxnList(){const e=o["a"].getters.transactions.expenses.filter((e=>"PAYDATA"===e.category));return e}dp$incomeTxnListToday(){const e=o["a"].getters.incomeTodayTransactions.filter((e=>"PAYDATA"===e.category));return e}async dp$request(e,t,n){let a;const s=async()=>{a=await o["a"].dispatch("CREDIT_PAY_DATA_REQUEST",{receiverSub:e,amount:t,meta:n})};return await l(s,5),a.id}async dp$cancel(e){const t=async()=>{await o["a"].dispatch("CREDIT_PAY_DATA_FINISH",{transactionId:e})};await l(t,5)}async dp$submit(e,t){const n=async()=>{t?console.warn("dp$warn: abandoned is not supported for amplify mode."):await o["a"].dispatch("CREDIT_PAY_DATA_COMPLETED",{transactionId:e})};await l(n,5)}async dp$confirm(e,t){const n=async()=>{t?console.warn("dp$warn: failed is not supported for amplify mode."):await o["a"].dispatch("CREDIT_PAY_DATA_FINISH",{transactionId:e})};await l(n,5)}}var d=n("7ca3"),u=n.n(d);n("7a76");class h extends a{__parseStatus(e){const t={0:"PENDING",1:"FINISH",3:"FINISH",4:"COMPLETED",5:"FINISH",6:"FAILED"},n=t[e];if(!n)throw new Error("Unexpected state",e);return n}get id(){return[this._data.publisher,this._data.performer,this._data.index].join("::")}get status(){return this.__parseStatus(this._data.state)}get payerId(){return this._data.publisher}get payeeId(){return this._data.performer}get amount(){return parseInt(this._data.amount)}get meta(){return this._data.meta_data}}const p=async(e,t)=>{let n=0;const o=Math.floor(1e3*Math.random()),a=e=>{if(n+=1,i("warn",["retryHandler"],e.message),"Out of gas"===e.message)throw i("warn",["dp$retry",o,"failed"],e.message),e;if("invalid transaction: INSUFFICIENT_BALANCE_FOR_TRANSACTION_FEE"===e.message)throw i("warn",["dp$retry",o,"failed"],e.message),e;if("Network Error"===e.message)return i("warn",["dp$retry",o,e.code],e.message),!0;if("invalid transaction: SEQUENCE_NUMBER_TOO_OLD"===e.message)return i("warn",["dp$retry",o,n,e.code],e.message),!0;if("transaction is rejected: InvalidUpdate - Transaction already in mempool"===e.message)return i("warn",["dp$retry",o,n],e.message),!0;if(e.is_move_error){if("1031"===e.code)return void i("warn",["dp$retry",o,"skip",e.code],"txn status was deactivated");if("1281"===e.code)return void i("warn",["dp$retry",o,"skip",e.code],"txn status has been changed");throw i("warn",["dp$retry",o,"failed",e.code],e.message),e}if(n{if(!a(t))return;const n=Math.floor(1e3*Math.random());return new Promise((e=>setTimeout(e,n))).then(e).catch(s)},r=await e().catch(s);return r};let m;class _ extends s{constructor(){super("blockchain"),m=window.$blockchain}dp$address(){return m.$store.account.address}dp$credit(){return m.$store.wallet.balance.TestCoin}dp$incomeTxnList(){const e=Object.values(m.$store.DataProviding.txnDict).filter(_.incomeFilter);return e.map((e=>new h(e)))}dp$expenseTxnList(){const e=Object.values(m.$store.DataProviding.txnDict).filter(_.expensesFilter);return e.map((e=>new h(e)))}dp$incomeTxnListToday(){const e=Object.values(m.$store.DataProviding.txnDict).filter(_.incomeFilter);return e.map((e=>new h(e)))}async dp$request(e,t,n){const o=async()=>{const o=await m.$store.DataProviding.publishDataProvidingTxn({address:e,amount:t,meta:JSON.stringify(n)}),a=o.getTaskId(),s=[a.publisher,a.performer,a.index].join("::");return s};return await p(o,5)}async dp$cancel(e){const t=async()=>{const t=await m.$store.DataProviding.cancelDataProvidingTxn({txnKey:e});console.log("postTxnCancel >>",t)};await p(t,5)}async dp$submit(e,t){const n=async()=>{const n=await m.$store.DataProviding.submitDataProvidingTxn({txnKey:e,abandoned:t});console.log("postTxnComplete >>",n)};await p(n,5)}async dp$confirm(e,t){const n=async()=>{const n=await m.$store.DataProviding.confirmDataProvidingTxn({txnKey:e,failed:t});console.log("postTxnFinish >>",n)};await p(n,5)}}function f(){const e={},t={},n=b.call(this,{dp$incomeTxnList:"dp$incomeTxnDict",dp$expenseTxnList:"dp$expenseTxnDict"}),o=y.call(this,{dp$incomeStatusMapper:e=>e.status,dp$incomeHashMapper:e=>{if(!e.meta)return;let n=t[e.id];if(void 0!==n)return n.infoHash;try{n=JSON.parse(e.meta)}catch{n={},console.warn("failed to parse txn meta")}return t[e.id]=n,n.infoHash}}),a=y.call(this,{dp$expenseStatusMapper:e=>e.status,dp$expenseHashMapper:e=>{if(!e.meta)return;let n=t[e.id];if(void 0!==n)return n.infoHash;try{n=JSON.parse(e.meta)}catch{n={},console.warn("failed to parse txn meta")}return t[e.id]=n,n.infoHash}});e.updateIncomeData=()=>{n.dp$incomeTxnList(),o("dp$incomeTxnList")},e.updateExpenseData=()=>{n.dp$expenseTxnList(),a("dp$expenseTxnList")};const s=g.call(this,"dp$incomeTxnDict"),i=g.call(this,"dp$expenseTxnDict");e.logIncomeStatus=(e,t)=>s(e,t),e.logExpenseStatus=(e,t)=>i(e,t),this.dp$utils=e}function g(e){const t=(t,n)=>this[e][t]&&i(["dp$status",n||"[payment]","=>",this[e][t].status],t);return(n,o)=>{if(n&&this[e]){if(o)for(const e of Object.keys(o))if(o[e]&&n[e])for(const a of o[e])n[e].includes(a)||t(a,e);if(n.PENDING)for(const e of n.PENDING)o&&o.PENDING&&o.PENDING.includes(e)||t(e)}}}function b(e){const t=(e,t)=>this[e]=t,n=(e,n)=>{const o={};for(const t of this[e])o[t.id]=t;t(n,o)};return Object.entries(e).reduce(((e,[t,o])=>({...e,[t]:()=>n(t,o)})),{})}function y(e){return t=>{const n={};for(const[a,s]of Object.entries(e)){const e={};for(const n of this[t]){const t=s(n);e[t]||(e[t]=[]),e[t].push(n.id)}n[a]=e}const o=(e,t)=>this[e]=t;Object.entries(n).forEach((e=>o(...e)))}}u()(_,"incomeFilter",(e=>m.$store.account.account.address().toShortString()===e.performer)),u()(_,"expensesFilter",(e=>m.$store.account.account.address().toShortString()===e.publisher));const v=[c,_];t["a"]={data(){var e;const t=null!==(e=localStorage.getItem("dataPaymentMixin.mode"))&&void 0!==e?e:"amplify";localStorage.setItem("dataPaymentMixin.mode",t);const n=v.reduce(((e,t)=>{const n=new t;return e[n.name]=n,e}),{});return f.apply(this),{dp$mode:t,dp$interfaces:n,dp$incomeTxnDict:{},dp$incomeStatusMapper:{},dp$incomeHashMapper:{},dp$expenseTxnDict:{},dp$expenseStatusMapper:{},dp$expenseHashMapper:{},dp$source:this}},watch:{dp$mode(e){i(["dp$mode",e]),localStorage.setItem("dataPaymentMixin.mode",e)},dp$incomeTxnList(){this.dp$utils.updateIncomeData()},dp$expenseTxnList(){this.dp$utils.updateExpenseData()}},computed:{dp$credit(){return this.dp$interfaces[this.dp$mode].dp$credit()},dp$address(){return this.dp$interfaces[this.dp$mode].dp$address()},dp$incomeTxnList(){return this.dp$interfaces[this.dp$mode].dp$incomeTxnList()},dp$expenseTxnList(){return this.dp$interfaces[this.dp$mode].dp$expenseTxnList()},dp$incomeTxnListToday(){return this.dp$interfaces[this.dp$mode].dp$incomeTxnListToday()}},methods:{async dp$request(e,t,n){i(["dp$post","request","waiting..."]);const o=await this.dp$interfaces[this.dp$mode].dp$request(e,t,n);return i(["dp$post","request","done"],o),o},async dp$cancel(e){i(["dp$post","cancel","waiting..."],e);const t=await this.dp$interfaces[this.dp$mode].dp$cancel(e);return i(["dp$post","cancel","done"],e),t},async dp$submit(e,t=!1){const n=t?"abandoned":"provided";i(["dp$post","submit",n,"waiting..."],e);const o=await this.dp$interfaces[this.dp$mode].dp$submit(e,t);return i(["dp$post","submit",n,"done"],e),o},async dp$confirm(e,t=!1){const n=t?"failed":"succeeded";i(["dp$post","confirm",n,"waiting..."],e);try{const o=await this.dp$interfaces[this.dp$mode].dp$confirm(e,t);return i(["dp$post","confirm",n,"done"],e),o}catch(a){var o;if(console.warn("Error when confirming transaction",e,a),null!==(o=a.message)&&void 0!==o&&o.includes("payee does not exist")){const t=JSON.parse(localStorage.getItem("_transactions_missing_payee_")||"[]");t.push(e),localStorage.setItem("_transactions_missing_payee_",JSON.stringify(t))}}},__dp$notify__(){const e="amplify"===this.dp$mode?"blockchain":"amplify";this.$q.notify({group:"dp$mode_warning",message:`Current Data Payment Mode: "${this.dp$mode}"`,type:"warning",position:"bottom",timeout:0,actions:[{noCaps:!0,color:"black",label:`Switch to ${e}`,handler:()=>{this.dp$mode=e,location.reload(),n("d310").isElectron()&&n("b052").ipcRenderer.send("reload-webtorrent-window")}},{noCaps:!0,color:"black",label:"Close"}]})}},created(){this.dp$utils.updateIncomeData(),this.dp$utils.updateExpenseData()}}},"0c2f":function(e,t,n){},"0c70":function(e,t,n){},"0c7a":function(e,t,n){},"0cdb":function(e,t,n){"use strict";n.r(t),n.d(t,"notifyGeneralUpdate",(function(){return o})),n.d(t,"notifyMessage",(function(){return a})),n.d(t,"transfer",(function(){return s})),n.d(t,"notifyCreditChange",(function(){return i})),n.d(t,"generalCommand",(function(){return r})),n.d(t,"createUser",(function(){return l})),n.d(t,"updateUser",(function(){return c})),n.d(t,"deleteUser",(function(){return d})),n.d(t,"createInvitation",(function(){return u})),n.d(t,"updateInvitation",(function(){return h})),n.d(t,"deleteInvitation",(function(){return p})),n.d(t,"createMessageTimer",(function(){return m})),n.d(t,"updateMessageTimer",(function(){return _})),n.d(t,"deleteMessageTimer",(function(){return f})),n.d(t,"createTransaction",(function(){return g})),n.d(t,"updateTransaction",(function(){return b})),n.d(t,"deleteTransaction",(function(){return y})),n.d(t,"createTask",(function(){return v})),n.d(t,"updateTask",(function(){return w})),n.d(t,"deleteTask",(function(){return k})),n.d(t,"createProvidentFund",(function(){return C})),n.d(t,"updateProvidentFund",(function(){return $})),n.d(t,"deleteProvidentFund",(function(){return S}));const o="\n mutation NotifyGeneralUpdate(\n $id: String!\n $channel: String!\n $data: String!\n ) {\n notifyGeneralUpdate(id: $id, channel: $channel, data: $data) {\n id\n channel\n data\n }\n }\n",a="\n mutation NotifyMessage($channel: String!, $data: String!) {\n notifyMessage(channel: $channel, data: $data) {\n channel\n data\n }\n }\n",s="\n mutation Transfer(\n $receiver: String!\n $amount: Int!\n $category: Category!\n $meta: String\n ) {\n transfer(\n receiver: $receiver\n amount: $amount\n category: $category\n meta: $meta\n )\n }\n",i="\n mutation NotifyCreditChange($ownerId: String!, $amount: Int!) {\n notifyCreditChange(ownerId: $ownerId, amount: $amount) {\n ownerId\n amount\n }\n }\n",r="\n mutation GeneralCommand($input: String) {\n generalCommand(input: $input)\n }\n",l="\n mutation CreateUser(\n $input: CreateUserInput!\n $condition: ModelUserConditionInput\n ) {\n createUser(input: $input, condition: $condition) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",c="\n mutation UpdateUser(\n $input: UpdateUserInput!\n $condition: ModelUserConditionInput\n ) {\n updateUser(input: $input, condition: $condition) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",d="\n mutation DeleteUser(\n $input: DeleteUserInput!\n $condition: ModelUserConditionInput\n ) {\n deleteUser(input: $input, condition: $condition) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",u="\n mutation CreateInvitation(\n $input: CreateInvitationInput!\n $condition: ModelInvitationConditionInput\n ) {\n createInvitation(input: $input, condition: $condition) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",h="\n mutation UpdateInvitation(\n $input: UpdateInvitationInput!\n $condition: ModelInvitationConditionInput\n ) {\n updateInvitation(input: $input, condition: $condition) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",p="\n mutation DeleteInvitation(\n $input: DeleteInvitationInput!\n $condition: ModelInvitationConditionInput\n ) {\n deleteInvitation(input: $input, condition: $condition) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",m="\n mutation CreateMessageTimer(\n $input: CreateMessageTimerInput!\n $condition: ModelMessageTimerConditionInput\n ) {\n createMessageTimer(input: $input, condition: $condition) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",_="\n mutation UpdateMessageTimer(\n $input: UpdateMessageTimerInput!\n $condition: ModelMessageTimerConditionInput\n ) {\n updateMessageTimer(input: $input, condition: $condition) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",f="\n mutation DeleteMessageTimer(\n $input: DeleteMessageTimerInput!\n $condition: ModelMessageTimerConditionInput\n ) {\n deleteMessageTimer(input: $input, condition: $condition) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",g="\n mutation CreateTransaction(\n $input: CreateTransactionInput!\n $condition: ModelTransactionConditionInput\n ) {\n createTransaction(input: $input, condition: $condition) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",b="\n mutation UpdateTransaction(\n $input: UpdateTransactionInput!\n $condition: ModelTransactionConditionInput\n ) {\n updateTransaction(input: $input, condition: $condition) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",y="\n mutation DeleteTransaction(\n $input: DeleteTransactionInput!\n $condition: ModelTransactionConditionInput\n ) {\n deleteTransaction(input: $input, condition: $condition) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",v="\n mutation CreateTask(\n $input: CreateTaskInput!\n $condition: ModelTaskConditionInput\n ) {\n createTask(input: $input, condition: $condition) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",w="\n mutation UpdateTask(\n $input: UpdateTaskInput!\n $condition: ModelTaskConditionInput\n ) {\n updateTask(input: $input, condition: $condition) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",k="\n mutation DeleteTask(\n $input: DeleteTaskInput!\n $condition: ModelTaskConditionInput\n ) {\n deleteTask(input: $input, condition: $condition) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",C="\n mutation CreateProvidentFund(\n $input: CreateProvidentFundInput!\n $condition: ModelProvidentFundConditionInput\n ) {\n createProvidentFund(input: $input, condition: $condition) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",$="\n mutation UpdateProvidentFund(\n $input: UpdateProvidentFundInput!\n $condition: ModelProvidentFundConditionInput\n ) {\n updateProvidentFund(input: $input, condition: $condition) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",S="\n mutation DeleteProvidentFund(\n $input: DeleteProvidentFundInput!\n $condition: ModelProvidentFundConditionInput\n ) {\n deleteProvidentFund(input: $input, condition: $condition) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n"},"0d10":function(e,t,n){},"0f0c":function(e,t,n){"use strict";n("61af"),n("a3fc");const o=e=>{{const t=n("ae46");return t[e]}};t["a"]=o},"0f74":function(e,t,n){},1:function(e,t,n){e.exports=n("e7ec")},10:function(e,t){},"10e1":function(e,t,n){},11:function(e,t){},12:function(e,t){},1278:function(e,t,n){},13:function(e,t){},1357:function(e,t,n){"use strict";n("5960")},14:function(e,t){},15:function(e,t){},"15eb":function(e,t,n){"use strict";(function(e,o){n("de6c"),n("a1c1"),n("d4b5");var a=n("7d96"),s=n("d310"),i=n("4d52"),r=n("e75b"),l=n("c5a5");t["a"]=({Vue:t,app:c,router:d})=>{if(t.use(a["a"],{useComponent:{i18n:c.i18n}}),o.handleAbBlockchain=({url:t,action:n,actionArgs:o})=>{if(t){const a={type:"03",prefix:"ab-blockchain"},s={encode:t=>e.from(t,"utf-8").toString("base64"),decode:t=>e.from(t,"base64").toString("utf-8")},i=e=>{if(!e.startsWith(`${a.prefix}://`))return null;const[t,n]=e.replace(`${a.prefix}://`,"").split("/"),o=JSON.parse(s.decode(n));return{action:t,actionArgs:o}},r=i(t);n=r.action,o=r.actionArgs}if(console.log("ab-blockchain$",n,o),"Blockchain"===d.currentRoute.name){const e=d.currentRoute.matched.find((e=>"Blockchain"===e.name)),t=e.instances.default;t.handleAction(n,o)}else d.push({name:"Blockchain",params:{action:n,action_args:o}})},Object(s["isElectron"])()){const{ipcRenderer:e}=n("b052");e.on(`${i["a"].config.prefix}-action`,((e,t,n)=>{o.handleAbBlockchain({action:t,actionArgs:n})}))}Object.defineProperty(o.$blockchain.wallet,"fundAccountWithFaucet",{configurable:!0,get(){return async({address:e,amount:t})=>{const n=new r["a"].Rest("ABDevRest"),o=await n.post("/development/blockchain/fundAccountWithFaucet",{amount:t,address:e,testToken:"XWZWQFZOZ3"});return o}}}),o.$blockchain.$store.wallet.createCollectionLink=async()=>{const t=async(t,n)=>{const o=(t,n)=>{const o={type:"03",prefix:"ab-blockchain"},a={encode:t=>e.from(t,"utf-8").toString("base64"),decode:t=>e.from(t,"base64").toString("utf-8")},s=a.encode(JSON.stringify(n));return`${o.prefix}://${[t,s].join("/")}`},a=o(t,n);console.log("internalUrl",a);const s=await Object(l["a"])(a);return s},{account:n}=o.$blockchain.$store;await n.assertAccountAccessible();const a=n.address,s=await t("transfer",{to_address:a});return s}}}).call(this,n("eb72").Buffer,n("0ee4"))},16:function(e,t){},17:function(e,t){},1738:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));n("0c26");var o=n("e757"),a=n("47fc"),s=n("d710"),i=n.n(s);const r={MEASUREMENT_ID:"G-9NE14P89WD",STREAM_ID:"4617180072",API_SECRET:"r7q0lwYuQeSimEJ5JnVFuQ"},l=new o["a"](r.MEASUREMENT_ID,r.API_SECRET);function c(){var e;const t=Object(a["a"])(),{packageFormat:o,version:s}=l(),r=s.split("-").reduce(((e,t,n)=>({...e,[["version","channel"][n]]:t})),{});return{app_name:i.a.name,app_type:"website",app_env:"production",app_format:null!==o&&void 0!==o?o:"unknown",app_version:r.version,app_channel:null!==(e=r.channel)&&void 0!==e?e:"stable",app_screen:t.screen,app_os:t.os,app_os_version:t.osVersion,app_arch:t.arch};function l(){return n("ae46")}}t["b"]=(t,{app:n,router:o})=>{(e&&e.env.TEST_EMAIL_DOMAIN||(document.cookie||"").split(";").map((e=>e.trim())).includes("TestEnv=true"))&&(console.log("DISABLE GOOGLE ANALYTICS"),l.disable()),l.config(),setTimeout((async()=>{const e=c();console.log("[GA] App Data",e),await l.send("analytics_test_app_data",e)}),1e4);let a=Date.now();l.send("app_launch",{timestamp:a}),o.afterEach(((e,t)=>{if("/"===t.path||e.path===t.path)return;const n=Date.now(),o=n-a;a=n,l.send("app_route",{to:e.path,from:t.path,stayTime:o})})),t.prototype.$ga=l,console.log("Init Google Analytics")}}).call(this,n("28d0"))},1761:function(e,t,n){"use strict";n("5d03")},18:function(e,t){},19:function(e,t){},1926:function(e,t,n){"use strict";n.d(t,"b",(function(){return ee}));n("a1c1"),n("de6c"),n("d4b5"),n("dc89"),n("2425"),n("7a76");var o=n("ff9b"),a=n("4d79"),s=n("d710"),i=n.n(s);const r=i.a.displayName;var l={repeat_add:"任务已添加,请勿重复添加",upload:"上传",download:"下载",delete:"删除",delete_task:"删除任务",delete_confirm_message:"是否删除该任务? 此操作不可恢复",also_delete_files:"同时删除文件",default_delete_files:"删除任务时默认删除已下载的文件",not_now:"暂不处理",delete_autoupload_confirm:"此任务文件位于自动上传文件夹, 删除任务将同时删除对应文件",delete_anyway:"仍要删除",upload_too_many_files:"上传文件过多",ask_if_unlimit_upload_amount:"自动上传文件夹包含过多文件. 是否取消上传数量限制? *此操作可能造成性能问题",disable_limitation:"取消限制",not_length:"暂不支持,多文件操作,请配合",download_torrent:"下载该任务",upload_torrent:"上传该任务",files:"文件",file:"文件",folder:"文件夹",start_all:"全部开始",pause_all:"全部暂停",remove_all:"全部移除",upload_all:"全部上传",clear_history:"清除历史",pause_all_finish_payments:"此操作将完成所有已支付的订单.",accelerating:"加速中",link_task:"链接任务",torrent_task:"文件任务",ok:"好的",cancel:"取消",download_directory_position:"下载目录位置",torrent_file:"任务文件",magnetic_link_incorrect:"链接格式不正确",delete_fail:"删除失败",pause:"暂停",paused:"已暂停",stop_torrent:"结束任务",seed:"上传",resume:"继续",downloading:"下载中",downloaded:"下载完成",uploading:"上传中",auto_uploading:"自动上传中",uploaded:"上传完成",pending:"等待其他任务完成",no_downloading_task:"没有下载中任务",remove_all_downloading_tasks:"是否移除所有下载中任务?",remove_all_upload_tasks:"是否移除所有上传任务?",remove_autoupload_files:"移除所有自动上传任务",remove_all_history:"是否移除历史下载记录?",verifying:"验证文件",waiting_for_verify:"等待验证文件",seeding:"上传中",completed:"已完成",status:"状态",task_name:"任务名",size:"大小",progress:"进度",sort:"排序",ascending:"升序",descending:"降序",file_loading:"文件加载中",loading:"加载中",unknown_status:"未知",play_while_downloading:"边下边播",upload_or_play:"上传 / 播放",play:"播放",ask_if_upload_file:"是否上传文件?",ask_if_upload_or_play:"是否上传/播放文件?",torrent_error:"添加任务时遇到错误:",no_peers:"多次尝试后仍未能与Peers建立连接",torrent_exists:"任务已存在",show_origin_torrent:"显示原始任务文件或链接",show_directory:"打开文件所在位置",task_num:"任务数",total_upload_speed:"上传速度",total_download_speed:"下载速度",path_missing:"Error: 找不到文件位置",origin_not_found:"获取任务信息失败",text_copied:"链接已复制到剪贴板",copy_magnet_uri:"复制链接地址",copy_download_uri:"复制下载链接",copy_share_uri:"复制社交分享链接",uri_copied:"链接已复制至剪贴板",uri_copy_failed:"复制链接失败",more:"更多",toggle_list_mode:"切换显示模式",comment:"评论",operations:"操作",open_directory:"打开所在文件夹",remaining:"剩余时间",created_time:"创建时间",used_time:"用时",completed_time:"完成时间",yesterday:"昨天",before_yesterday:"前天",earlier:"更早之前",miss_file:"文件缺失",delete_miss_file_task:"{0} 有部分文件缺失.",common_peer:"普通用户",ab_peer:`${r} 用户`,ab_peer_verified:`${r} 注册用户`,ab_peer_available:`${r} peer 可用`,alphabiz_accelerating:`${r} 加速中`,income:"收入",income_info:"收入(今天/总计)",total_income_info:"收入: {0}(今天) / {1}(总计)",login_to_see_income:"登陆以查看收入统计",credit_cost:"积分支出",downloaded_by_payment:"付费下载量",file_not_found:"无法找到本地文件",no_task:"无任务",no_matched_task:"无法找到匹配的任务",space_not_enough:"磁盘空间不足",need_more_space:"需要 {0} 磁盘空间, 磁盘剩余空间为 {1} ({2} 为保留空间). 任务已暂停. 媒体库预加载已禁用. 您可以在[设置 - 进阶设置]中重新启用.",seeders:"做种",last_update:"最后更新",connecting:"连接中",connected:"已连接",request_timed_out:"请求超时",connection_failed:"连接失败",invalid_download_url:"下载链接错误",download_link:"下载链接",empty_files:"文件夹中没有文件",duplicate_task:"重复任务",duplicate_tracker:"重复 tracker",this_task_not_ready:"此任务尚未就绪,暂停该任务将直接移除它",some_task_not_ready:"部分任务尚未就绪,暂停这些任务将直接移除它们",failed_to_delete_files:"删除文件失败",failed_to_delete_files_desc:"无法删除部分任务文件,可能需要手动删除",unknown_error:"未知错误: {0}",more_files_are_not_shown:"(出于性能考虑,{0} 个文件未显示)",no_available_file:"没有可用的文件,请等待任务就绪",service_worker_error:"无法加载 ServiceWorker。您的浏览器可能不支持此特性,或者 ServiceWorker 尚未就绪。请刷新页面后重试。",add_task_first:"请先添加任务",player_task_time:"播放器准备时间过长,请检查任务是否就绪",web_mode_hint:`${r} Web 仅支持 WebRTC 种子。下载 ${r} 桌面版以获得最佳体验。`,web_mode_task_hint:"点击下方链接创建任务。Web 模式同时仅可创建一个任务。",save_to_local:"保存到本地",save_as_zip:"保存为 ZIP",creating_save_file:"正在创建文件...",upload_as_one_directory:"作为一个文件夹上传",upload_as_single_files:"作为单独的文件上传",web_mode_upload_single:"Web 模式下只能上传单个文件",download_success:"下载成功",download_fail:"下载失败",wait_for_downloaded_to_share:"请等待下载完成后进行分享。",download_with_cellular:"使用数据流量下载",download_with_cellular_desc:"您正在使用数据流量,下载时运营商可能会收取额外的费用。",download_with_cellular_confirm:"仍然使用数据流量"},c={language:"语言",appearance:"外观",darkModeSystem:"跟随系统",darkModeLight:"明亮",darkModeDark:"黑暗",basic_setting:"基础设置",hideMenu:"隐藏菜单栏(仅支持Windows和Linux)",autoHide:"自动隐藏窗口",start:"启动",autoStart:"开机自动启动",restore:"恢复上次退出时窗口的大小和位置",autoStartUnfinished:"自动开始未完成的任务",default_download_path:"默认下载路径",download_directory:"下载目录",upload_directory:"上传目录",enable_auto_upload:"允许自动上传",unlimit_upload_amount:"不限制上传数量",unlimit_upload_warning:"允许同时上传大量文件. 此选项可能导致性能问题",transport_setting:"传输设置",upload_limit:"上传限速",download_limit:"下载限速",payed_user_share_rate:"付费用户上传比例",unlimited:"不限速",limit_input_error:"限速需为正数",BT_setting:"下载任务设置",saveLinkSeed:"保存链接元数据为任务文件",autoDownload:"自动开始下载链接任务、任务文件",continuousSeeding:"持续上传,直到手动停止",seedSharingRate:"分享率",seedTime:"上传时间(分钟)",task_manage:"任务管理",maximumDownloadNum:"同时下载的最大任务数",maximumConnectionsNum:"每个服务器最大的连接数",range_error:"范围需在{0}-{1}之间",random:"随机",breakpointContinuation:"断点续传",automaticSkip:"新建任务后自动跳转到下载页面",afterNotification:"下载完成后通知",deleteConfirm:"删除任务前无需确认",submit:"保存并应用",discard:"放弃",reset:"重置",reset_all_settings:"重置所有设置?",preferences_resetted:"偏好设置已重置",traditional_chinese:"繁體中文",japanese:"日本語",english:"English",chinese:"简体中文",advancedSettings:"进阶设置",autoUpdate:"自动更新",autoCheckUpdate:"自动检查更新",proxy:"代理",useProxyService:"使用代理服务器",trackerService:"Tracker服务器",recommendUse:"推荐使用",autoUpdateTrackerServiceList:"每天自动更新Tracker服务器列表",manualUpdateTracker:"手动更新",manualUpdateSuccess:" Tracker服务器更新成功",manualUpdateFail:"更新以下Tracker服务器失败:",listenPort:"监听端口",BTlistenPort:"数据传输端口",DHTlistenPort:"分布式哈希通讯端口",protocols:"兼容以下协议",setDefaultClientForFollowingProtocols:"设置本软件为以下兼容协议的默认客户端",magnetUrl:"磁力链接",video_file:"视频文件",audio_file:"音频文件",security:"安全性",impersonateUserAgent:"模拟用户代理(UA)",RPCauthorizationkey:"RPC授权密钥",viewDocument:"查看说明文档",developer:"开发者",applicationLogPath:"应用日志路径",downloadSessionPath:"下载会话路径",resetDownloadSessionRecord:"重置下载会话记录",restoreInitialSettings:"恢复初始设置",preferences_set_successfully:"偏好设置成功!",preferences_set_fail:"偏好设置失败!",change_not_save:"修改未保存",discard_all_changes:"是否放弃所有更改?",stay_in_page:"留在此页",disk_usage:"保留磁盘空间",pause_if_less_space:"剩余空间小于此值时暂停并提醒(MB)",default_video_player:"默认视频播放器",video_cache_time:"边下边播缓存时间",minutes:"分钟",system_default:"系统默认",media_player:"媒体播放器",library_film_rate:"可见影片分级",library_show_explore:"显示[探索]页面",library_setting:"媒体库设置",library_sync_setting:"媒体库同步设置",keychain_sync_status:"密钥同步状态",sync_with_aws:"使用 Amazon Web Services 同步密钥",backup_to_local:"保存为本地文件",enable_sync_with_aws:"启用 AWS 同步",disable_sync_with_aws:"禁用 AWS 同步",disable_sync_with_aws_desc:"此操作将移除保存在云端的密钥,请确保已将密钥保存至本地。",input_independent_password:"输入独立密码",change_independent_password:"修改独立密码",password_error:"密码错误",password_invalid:"密码格式错误",key_existed:"密钥已存在",key_not_found:"密钥不存在",library_recommend:"媒体库推荐",show_all_channels:"在媒体库推荐页显示所有频道",not_logged_in:"尚未登录",login_to_continue:"登陆以继续",mnemonic_code:"助记词",wordlist:"单词表",restore_code:"从助记词恢复",generate_code:"生成助记词",export_mnemonic_code:"导出助记词",import_mnemonic_code:"导入助记词",print:"打印",save_as_txt:"保存为 txt",save_as_pdf:"保存为 pdf",from_file:"从文件导入",not_valid_mnemonic_code:"助记词格式错误",cannot_parse_code_as_key:"无法将此助记词解析为密钥",import_key_hint:"是否确认导入此密钥?此操作将覆盖旧的密钥。",import_key_confirm:"确认导入",library_preload:"媒体库任务预加载",show_preload:"显示预加载任务",set_download:"设置下载文件夹",set_download_desc:"macOS App Store 版本默认保存位置为应用内部沙盒,在应用卸载时会一并删除。为了保留下载文件,您需要手动选择下载位置。"},d={home:"主页",home_caption:"下载/上传媒体文件",library:"媒体库",library_caption:"探索媒体资源",player:"播放器",player_caption:"视频播放",credits:"信用積分",credits_caption:"检查账户积分余额",account:"用户",account_caption:"个人用户配置",settings:"设置",settings_caption:"所有设置项",development:"开发者",development_caption:"应用开发者模式",basic:"主要设置",basic_caption:"主要的设置项",advanced:"进阶设置",advanced_caption:"进阶的设置项",blockchain:"钱包",blockchain_caption:"去中心化钱包",internal_notice:"内部版本声明",release_notes:"发行说明",terms_and_conditions:"条款和章程",license_and_listen_notices:"许可和监听开源说明",close:"关闭",success:"成功",fail:"失败"},u={credits:"信用积分",pay:"支付积分",pay_with_credit:"支付积分加速下载, 预计需要{0}积分",pay_with_credit_payed:"正在加速下载, 预计还需要{0}积分",create_payment:"创建积分订单",pay_target:"支付对象",pay_for_torrent:"为 {0} 支付",your_subid:"用户 subId",your_credits:"当前余额",pay_point_for_data:"支付{0}积分以加速{1}数据",auto_renew:"允许自动续费",transaction_details:"订单明细",transaction_id:"订单编号",transaction_payer:"付款人",transaction_payee:"收款人",transaction_category:"类型",transaction_changed_amount:"变动金额",transaction_meta:"其他数据",transaction_status:"订单状态",transaction_creation_time:"订单创建时间",receipt_code:"收款码",transfer_amount:"转账金额",code_the_receipt_code:"复制下方收款码给付款人",fill_the_receipt_code:"通过填入收款人提供的收款码进行转账",income:"收入",expense:"支出",copied:"已复制",transfer:"转账",receive:"收款",copy:"复制",withdraw_fund:"提取基金",category_paydata_payer:"数据支付",category_paydata_payee:"数据收入",category_transfer:"个人转账",category_bonus:"系统奖励",category_recharge:"充值",status_pending:"等待中",status_completed:"已传完",status_finish:"已完成",status_failed:"已失效",tip_invalid_receiver:"无效的收款码",tip_invalid_amount:"金额应为 0-1000 范围内的数(最小精度为0.001)",credit_get_more:"获得更多积分",credit_no_data:"无可用数据",credit_loading:"加载中",credit_not_enough_amount:"积分不足",credit_amount_not_enough:"积分不足",credit_payee_not_exist:"收款人不存在",credit_invalid_amount:"输入金额不合法",credit_can_not_transfer_to_yourself:"不能向自己转账",credit_latest:"最新日期",credit_error_network:"网络出现异常,请稍后重试","payer credit amount is not enough":"积分不足","payee does not exist":"收款人不存在"},h={account_email_invalid_address:"无效的电子邮件地址",account_email_invalid_domain:"无效的电子邮件域",account_email_unknown_status:"未知的邮件发送状态",account_email_unavailable_address:"邮件地址不可用",account_email_suppressed_address:"邮件地址被禁用",account_loading:"加载中...",account_is_required:"不能为空",account_sign_in_your_account:"登录账户",account_username:"用户名",account_username_email_phone:"手机号码或电子邮箱",account_password:"密码",account_new_password:"新密码",account_re_enter_password:"再次输入密码",account_password_not_equal:"输入的两个密码不同。",account_new_password_same:"新密码与原密码相同",account_forgot_your_password:"忘记密码了?",account_reset_password:"重置密码",account_sign_in:"登录",account_signed_in:"登录成功",account_sign_up:"注册",account_find_your_account:"找寻你的账户",account_enter_your_username:"输入你的手机号码或电子邮箱",account_search:"查找",account_email_sent_tip:"一封附带验证码的电子邮件已发送到您的邮箱:",account_phone_sent_tip:"一封附带验证码的短信已发送到您的手机:",account_email_phone_sent_tip:"附带验证码的电子邮件和手机短信已分别发送到您的邮箱和手机:",account_software_token_tip:"您的账户已启用安全令牌。要完成登录,请打开或查看您的设备并输入验证码",account_reset_your_password:"重置账户密码",account_verification_code:"验证码",account_resend_code:"重发验证码",account_code_has_been_resent:"验证码已发送",account_password_has_been_reset:"密码已重置",account_submit:"提交",account_sign_up_your_account:"注册账户",account_fill_required_fields:"填写下方的必填项。",account_fill_optional_fields:"填写下方的选填项。",account_email:"邮箱",account_invitation:"邀请",account_invitation_code:"邀请码",account_i_accept:"我接受",account_license_terms:"服务许可条款",account_next:"下一步",account_you_need_to_accept_license_terms:"请先勾选我接受服务许可条款",account_verify_fill_optional_fields:"验证身份与可选项",account_nickname:"昵称",account_gender:"性别",account_male:"男",account_female:"女",account_not_say:"不透露",account_birthday:"生日",account_phone_number:"手机号码",account_locale:"地区",account_tip_verified:"验证通过,正在登陆...",account_verified:"已验证",account_unverified:"未验证",account_signed_up:"注册成功",account_verify_your_identity:"验证您的身份",account_finish:"完成",account_signed_out:"注销成功",account_change_password:"修改密码",account_change_email:"修改电子邮箱",account_change_phone_number:"修改手机号码",account_sign_out:"注销",account_current_password:"当前密码",account_re_enter_new_password:"再次输入新密码",account_personal_information:"个人信息",account_edit:"编辑",account_reset:"重置",account_greeting:"你好,",account_cancel:"取消",account_not_set:"未设置",account_change:"修改",account_setting:"设置",account_copy_code:"复制代码",account_account_setting:"账户设置",account_task_page:"积分任务",account_setting_caption:"管理你的账户信息",account_security:"安全",account_want_to_join:"登录更精彩",account_sign_in_now:"点击登录",account_changed:"已更改",account_clipboard_with_invitation_code:"已复制邀请码",account_clipboard_with_code:"已复制代码",account_invitation_code_dialog_tip:"你将通过短信或电子邮件的方式发送邀请码:",account_available:"可用",account_invited:"已邀请",account_used:"已使用",account_invitation_code_sent:"邀请码已发送",account_invitation_channel_required:"至少需要填写一项邀请途径",account_no_verification_code:"无法收到验证码?",account_no_phone_number:"没有手机号码?",account_sign_up_by_email:"通过邮箱注册",account_no_email:"没有邮箱?",account_sign_up_by_phone_number:"通过手机注册",account_no_totp:"没有安全令牌?",account_tip_no_totp:"若沒有安全令牌請先設定安全令牌",account_setup_totp:"设置安全令牌",account_contact_information:"联系方式",account_delete_account:"删除账户",account_deleted:"已删除",account_can_not_mfa:"无法进行二级验证?",account_set_mfa_type:"更改二级验证",account_disable_mfa:"关闭二级验证",account_disabled_mfa:"已关闭二级验证",account_sms_mfa:"手机短信验证",account_totp_mfa:"安全令牌验证",account_totp:"安全令牌",account_not_recommend:"不推荐",account_oauth_sign_in_with:"通过 {provider} 登录",account_sign_in_failed:"登录失败",account_tip_oath_sign_up:"当前{provider}账户所对应的邮箱:{email}尚未创建账户",account_tip_confirm_delete_account:"输入当前账户密码以确认要删除当前账户。(账户删除后将无法恢复)",account_tip_config_mfa:"您可以通过手机短信或安全令牌为账户设置二级验证",account_error_can_not_enable_mfa:"您必须同时绑定邮箱和手机号码,才可以启用二级验证",account_tip_can_not_enable_sms_mfa:"您必须同时绑定邮箱和手机号码,才可以启用短信验证",account_tip_can_not_enable_totp_mfa:"您必须同时绑定邮箱和手机号码,才可以启用安全令牌",account_tip_setup_totp:"使用Authenticator等应用,扫描下方的二维码或手动复制代码来添加安全令牌",account_tip_verify_totp:"验证您的安全令牌",account_link_your_social_account:"绑定您的社交账号",account_unlink_your_social_account:"解除社交账号绑定",account_tip_confirm_link:"确定将当前账号与您的 {provider} 账号进行绑定吗?",account_tip_confirm_unlink:"确定解除您已绑定的 {provider} 账号吗?",account_tip_linking:"正在绑定...",account_tip_unlinking:"解除绑定中...",account_linked:"已绑定",account_unlinked:"已解除绑定",account_error_can_not_link_to_the_linked_account:"当前社交帐号已与其他账号绑定",account_error_can_not_link_to_the_mismatched_email:"当前账号与社交帐号邮箱地址不一致",account_error_can_not_link_before_email_verified:"未绑定邮箱的账户无法绑定社交帐户",account_tip_confirm_verify_email_phone:"是否向当前账户的email和手机号码发送验证码以验证您的身份?",account_tip_confirm_verify_phone:"是否向当前手机号码发送验证码以验证您的身份?",account_error_1_message_60_seconds:"每60秒只能发送一条短信或邮件,需再等待 {delta} 秒",account_error_10_messages_per_day:"每部手机或电子邮件24小时内只能发送10条信息",account_error_network:"网络出现异常,请稍后重试","Network Error":"网络出现异常,请稍后重试",account_error_user_not_exist:"用户不存在",account_error_incorrect_username_or_password:"用户名或密码错误",account_error_incorrect_original_password:"原密码错误",account_error_incorrect_password:"密码错误",account_error_username_not_found:"找不到该用户名的账户",account_error_can_not_reset_for_no_verified:"账户未进行邮箱验证,无法重置密码",account_error_invalid_verification_code:"验证码错误,请重试",account_error_expired_verification_code:"验证码过期,请重试",account_error_password_not_long_enough:"密码长度不能小于8位",account_error_attempt_limit_exceeded:"尝试次数过多,请稍后重试",account_error_password_attempts_exceeded:"超过密码尝试次数",account_error_invalid_phone_number_format:"手机号码格式不正确",account_error_no_cell_phone_prefix:"请选择手机号前缀",account_error_username_already_exists:"该用户名已存在",account_error_you_need_to_accept_license_terms:"请勾选我接受服务许可条款",account_error_inactive_code:"该邀请码已失效",account_error_non_existent_code:"该邀请码不存在",account_error_unexpected:"未知错误",account_error_can_not_change_email_before_phone_bound:"绑定手机号码前无法更改邮箱",account_error_can_not_change_email_before_unbound_social_account:"解除社交帐户绑定前无法更改邮箱",account_error_can_not_change_phone_before_email_bound:"绑定邮箱前无法更改手机号码",account_error_can_not_change_email_phone_with_mfa_enabled:"关闭二级验证前无法更改邮箱或手机号码",account_error_same_email:"新的邮箱不能与原邮箱相同",account_error_same_phone:"新手机号码不能与原手机号码相同",account_error_email_not_exists:"该邮箱不存在",account_error_email_already_exists:"该邮箱已有账户绑定",account_error_phone_already_exists:"该手机号码已有账户绑定",account_error_mfa_token_mismatch:"安全令牌错误",account_error_recaptcha_not_loaded:"网络出现异常,请重连网络后重启应用重试",account_error_recaptcha_validation_failed:"未通过ReCaptcha验证,请重连网络后重启应用重试",account_error_sign_in_in_progress:"等待登录尝试已在进行中",account_field_range:"字符个数应在{0}-{1}的范围中",account_field_only_alphanumeric:"仅支持字母和数字",account_field_only_alphanumeric_and_symbol:"仅支持字母数字和符号",account_field_only_chinese_alphanumeric_space_underline:"仅支持中英文数字空格下划线",account_field_prefix_without_number_space:"首个字符不能为数字或空格",account_field_suffix_without_space:"不能以空格结尾",account_field_without_repeat_space:"不能连续使用多个空格",account_field_can_not_only_alphanumeric:"不可仅为字母或数字",account_field_must_have_number_characters:"必须包含数字",account_field_verification_code:"验证码必须是六位数数字",account_field_invitation_code:"邀请码必须是字母和数字",account_field_phone_number:"手机号码格式不正确",account_invalid_email_format:"邮箱格式不正确",account_sign_out_confirm:"是否确认注销? 注销后将停止所有任务",account_sign_out_anyway:"仍要注销",account_signing_out:"正在注销...",account_request_save_settings:"设置未保存。在注销前请先保存修改。",invalid_password_format:"密码格式错误",invalid_password_format_same:"新密码与原密码相同",error_password:"密码错误",keychain_setting:"密钥管理",setting_description:"云端储存:将密钥数据保存到云端。\n修改密码:修改媒体库密钥的密码。\n助记词:一种生成和恢复密钥的替代方法。\n导入本地密钥:将本地保存的密钥导入媒体库。\n导出密钥:将当前媒体库数据保存到本地或云端。\n备份密钥到云端:将当前媒体库数据更新到云端进行备份。",refresh_status:"更新状态",confirm_import_key:"确认导入密钥",confirm_update_cloud_key:"你在云端已有密钥,更新密钥将覆盖原有的密钥,确认更新存储在云端的密钥吗",export_key_with_cloud:"输入您所设置的独立密码导出存储在云端的媒体库密钥,并通过解锁密码锁定密钥文件",store_cloud_key_prompt_password:"输入独立密码以存储媒体库密钥到云端",update_cloud_key_prompt_password:"设置独立密码以加密媒体库密钥并更新到云端",enable_cloud_storage_prompt_password:"为存储在云端的密钥设置密码,通过该密码可以从云上取回密钥",input_unlock_password:"设置解锁密码",export_local_prompt_password:"请设置一个解锁密码,该密码用于加密您的密钥文件。我们不会保存此密码,因此若您丢失该密码,密钥文件将无法解锁",require_unlock_password:"该密钥文件已被锁定,请输入解锁密码",require_independent_password:"输入独立密码以获取存储在云端的密钥",import_local_prompt_password:"该密钥文件已被锁定,请输入解锁密码",select_encrypt_mode:"选择加密模式",input_independent_password:"输入独立密码",update_cloud_key:"更新存储在云端的密钥",backup_to_cloud:"将媒体库密钥备份到云端",save_local:"将媒体库密钥保存为本地加密文件",create_new_key:"创建新的媒体库密钥",creating_lib_key:"正在创建媒体库密钥...",loading_lib_key:"正在载入媒体库密钥...",failed_to_create_lib_key:"创建媒体库密钥失败",failed_to_load_lib_key:"载入媒体库密钥失败",import_local_key:"导入本地密钥",import_lib_key_from_local:"从本地导入媒体库密钥",import_from_cloud:"从云端导入媒体库密钥",create_or_import_key:"创建或导入媒体库密钥",create_or_import_key_desc:"媒体库密钥用于与去中心化数据库同步内容。",store_your_lib_key:"存储你的媒体库密钥",export_cloud_key:"导出云端密钥",export_current_key:"导出当前密钥",change_password:"修改密码",enable_cloud_storage:"启用云端存储",disable_cloud_storage:"关闭云端存储",disable_cloud_storage_desc:"关闭云端存储将移除保存在云端的密钥,请确保已将密钥保存在本地",sync_at:"同步于:{time}",keychain_sync_status:"密钥同步状态",cloud_storage_enabled:"使用 {storage} 同步密钥",cloud_storage_disabled:"未启用云端存储",saved_locally:"已保存于本地",export_key:"导出密钥文件",cloud_independent_password:"云端独立密码",key_file_unlock_password:"密钥文件解锁密码",re_enter_unlock_password:"再次输入解锁密码",independent_password_not_enabled:"当前密码为 Alphabiz 账户密码(未设置独立密码)",use_cognito_hash:"使用 Alphabiz 账户密码",use_independent_password:"使用独立密码",keychain_lib:"媒体库密钥",loading_keychain_state:"加载密钥中...",backing_up:"备份中...",backup_current_key:"备份当前密钥到云端",cloud_lib_key_not_existed:"云端媒体库密钥不存在",open_keychain_file:"打开密钥文件",confirm_open_abk:"是否打开ABK文件",use_the_key:"使用该密钥",backup_the_key:"备份该密钥到云端",keychain_data_does_not_exist:"密钥数据不存在","timeout of 0ms exceeded":"网络出现异常,请稍后重试",XhrError:"网络出现异常,请稍后重试"},p={add_subtitles:"添加字幕",open_file:"打开文件...",advanced_options:"高级选项",title:"标题",location:"位置",subtitle_file:"字幕文件",unsupported_subtitle_type:"The file type of {0} is not a supported subtitle type",not_default_player:"默认视频播放器未设置",this_is_an_audio_file:"这是一个音频文件",the_added_subtitle_already_exists:"添加的字幕已存在",stop_stream_player:"因任务被暂停或删除,流媒体播放被终止",stop_player:"因文件被删除,播放被终止",playing_timeout_hint:"等待超时,请检查任务",autoplay_hint:"自动播放功能可能受浏览器限制,若未开始播放,请手动点击播放器以播放",remove_playing_confirm:"{0} 正在播放中,删除任务将停止播放。是否仍要删除?",subtitle:"字幕",setting:"设置",loading:"加载中",unknown_media:"未知媒体",settings_button_visible:"按钮显示",settings_setting:"设置",settings_playback_rate:"倍速",settings_subtitle:"字幕",settings_pip:"画中画",settings_fullscreen:"全屏",settings_subtitle_options:"字幕选项",settings_normal:"常规",settings_italic:"斜体",settings_lighter:"纤细",settings_bolder:"粗体",settings_small:"较小",settings_large:"较大"},m=n("8097");const _=i.a.displayName;var f={lib_index:"主页",lib_edit:"编辑",lib_publish:"发布",lib_explore:"探索",lib_following:"关注",lib_favorite:"本地收藏",lib_local_favorites:"本地收藏",lib_channel:"频道",lib_submit:"提交",lib_from_network:"使用去中心化数据库,所有数据来源于网络",welcome_to_lib:`欢迎使用 ${_} 媒体库`,register_or_login:"注册/登陆",lib_recommend:"推荐",lib_recommend_desc:`欢迎使用 ${_} 媒体库!本媒体库使用去中心化的数据库,所有数据来源于网络。在开始前,请先关注一些推荐频道。`,follow_any_channel_to_continue:"关注任意频道以继续",follow_channels_and_continue:"关注 {0} 个频道并继续",show_more_for_me:"为我展示更多",no_more_recommend:"没有更多推荐",key:"密钥",create_key:"生成密钥",save_key:"保存密钥",save_key_file:"是否将密钥保存为文件?",import_key:"导入密钥",import:"导入",invalid_key:"密钥格式错误",back_to_top:"回到顶部",search_for_channel:"搜索频道 ID",search_channel_no_result:"找不到 ID 为 {0} 的频道",please_input_channel_id:"请输入频道 ID",welcome_help_text:"\n 这是一个去中心化的媒体库,您需要为此创建一个专用账户,\n 我们将自动为您生成一套密钥。如果您已经拥有密钥了,\n 也可以在此导入密钥".replace(/\s/g,""),welcome_key_text:"\n 当您成功创建账号后,请点击右下角的【保存密钥】按钮导出\n 您的密钥。一旦您丢失密钥,对应的账号将无法找回。".replace(/\s/g,""),redirect_to_recommend:"您似乎没有关注任何频道,即将前往探索页。",channel:"频道",follow:"关注",unfollow:"取消关注",following:"关注中",share:"分享",block:"屏蔽",unblock:"取消屏蔽",blocked:"已屏蔽",block_channel:"屏蔽此频道",block_channel_confirm:"屏蔽频道后,频道的所有内容将从时间线上移除。您可以在账户设置中管理屏蔽列表。",block_creator:"屏蔽此频道的创作者",unblock_creator:"取消屏蔽此频道的创作者",block_creator_confirm:"屏蔽创作者后,该创作者的所有频道将从时间线上移除。您可以在账户设置中管理屏蔽列表",share_url_copied:"分享链接已复制至剪贴板",unfollow_confirm:"是否取消关注?此频道的所有推文将从你的时间线上移除。",follow_failed_hint:"操作仍在后台进行中,请耐心等待。如长时间未完成修改请尝试重启应用。",follow_time:"关注时间",update_time:"更新时间",search:"搜索",type:"类型",added:"已添加",click_to_task:"点击前往对应任务",lib_already_added:"您已添加此视频",description:"描述",poster:"海报",channel_poster:"频道海报",preview:"预览",creator:"创作者",creator_detail:"创作者详情",loading_creator:"正在加载创作者信息",wait_for_creator_loaded:"请等待创作者信息加载完成。",follower:"关注者",followers:"关注者",follower_list:"关注者列表",user:"用户",channel_title:"频道标题",channel_id:"频道 ID",post_title:"推文标题",post_id:"推文 ID",import_data_from_excel:"从 Excel 导入数据",set_excel_keys:"设置excel键",excel_import_succeded:"Excel 导入成功",excel_import_success_msg:"可添加 {0} 条新项目, {1} 条信息不完整及 {2} 条重复项已忽略",cannot_find_channel:"找不到指定频道",cannot_find_posts:"找不到指定视频",add_channel:"添加频道",add_post:"添加推文",edit_channel:"编辑频道",channel_setting:"频道设置",edit_post:"编辑推文",edit_posts:"编辑推文",channel_detail:"频道详情",remove:"移除",remove_channel:"移除频道",remove_channel_confirm:"是否确认移除频道?此操作不可恢复。",remove_post:"移除推文",remove_post_confirm:"是否确认移除推文?此操作不可恢复",preview_mode:"预览模式",preview_mode_desc:"这是频道的预览模式,所有分级的影片均为可见状态。",edit_user_profile:"编辑用户资料",name:"昵称",avatar:"头像",no_following:"没有已关注的频道。点击前往",no_recommend:"没有可推荐的频道。点击前往",first_recomment_msg:"如果您是初次使用,加载时间可能较长",invalid_image:"图片异常",image_not_reachable:"此图片URL不可用",channel_not_found:"找不到频道",cannot_get_channel_info:"无法获取指定的频道信息。该频道可能已被创作者删除而不再可见。",validate_error:"验证错误",validate_user_name_no_space:"用户名不可包含空格",validate_url_no_space:"URL 不可包含空格",validate_user_name_length:"用户名应为 {0}-{1} 字符",validate_user_desc_length:"用户描述不可多于 {0} 字符",validate_user_avatar_url:"用户头像应为链接且不多于2048字符",validate_channel_title_length:"频道标题应为1-100字符",validate_channel_desc_length:"频道描述应为10-300字符",validate_channel_image_url:"频道预览图应为链接且不多于2048字符",validate_post_title_length:"推文标题应为1-100字符",validate_post_desc_length:"推文描述应为10-300字符",validate_post_image_url:"海报应为链接且不多于2048字符",validate_post_url:`${_} 链接格式错误`,validate_post_url_length:`${_} 链接不可多于2048字符`,film_rate:"影片分级",set_film_rate:"设置影片分级",select_a_rate_before_enter:"您需要设置一个影片分级才可进入媒体库。",library_available_rate:"媒体库可用影片分级",rate_g:"G(大众级)",rate_g_desc:"所有年龄皆可观赏\n此类影片不含或仅含少量会让家长在让儿童观赏时感到被冒犯的内容,无需家长陪同。",rate_pg:"PG(建议家长指导)",rate_pg_desc:"一些内容可能不适合儿童观看\n此类影片包含部分家长可能认为不适合儿童的内容,因此建议家长可同时进行指导。",rate_pg_13:"PG-13(家长特别留意)",rate_pg_13_desc:"一些内容可能不适合13岁以下儿童观看\n此类影片有部分内容对13岁以下儿童不适宜,需要有父母陪同观看。此类影片动作暴力适当,含有少量血腥场面及不雅用语,但也包含可能令人情绪不安的情节。",rate_r:"R(限制级)",rate_r_desc:"未满十七岁人士必须由家长或成年监护人陪同\n此类影片中常有大量血腥暴力、惊悚恐怖、裸露性爱或吸毒场景,且有大量性暗示及不雅用语/ 冒犯性言论等,17岁以下人士必须由父母或者监护陪伴才能观看。",rate_nc_17:"NC-17(只准成人观看)",rate_nc_17_desc:"17岁或以下人士不得观赏\n此类影片其中常有清楚的性爱场面,大量的吸毒或暴力镜头以及脏话等,因此仅适合成人观赏。",set_as_private:"设为私有",hide_in_explore:"在浏览页隐藏此频道",hidden:"已隐藏",select_a_rate:"请选择一个影片分级",select_from_tasks:"从上传任务中选择",import_from_magnet:`从${Object(m["a"])()?"链接":"磁力链接(magnet:?...)"}导入`,input_magnet_url:"输入链接",task_title:"任务标题",set_title:"设为标题",add_to_local_favorites:"添加到本地收藏",remove_from_local_favorites:"从本地收藏中移除",removed_favorite:"已移除收藏",import_or_export_favorites:"导入/导出收藏",export_local_favorites:"导出收藏文件作为备份",import_favorites_file:"导入备份的收藏",not_a_favorite_file:"此文件并非收藏备份",connection_status:"连接状态",gun_server_list:"缓存节点",custom_nodes:"自定义缓存节点",custom_nodes_hint:"缓存节点将在重启软件后应用",wait_for_reboot:"即将重启软件...({seconds}s)",reboot_now:"立即重启",reboot_later:"稍后重启",peer_list:"节点列表",server:"节点 URL",peer:"节点",peer_id:"节点 ID",connection:"连接",data_source:"数据源",sync:"同步",syncing:"同步中",sync_completed:"同步完成",got_all_post:"已获取全部推文",placeholder_channel_title:"频道名称",placeholder_channel_desc:"关于此频道的描述",placeholder_post_title:"电影名称 (年份)",placeholder_post_desc:"关于此电影的描述",private_channel:"私有频道",creator_blocked:"已屏蔽创作者",go_to_library:"前往媒体库?",go_to_library_channel_msg:"是否前往媒体库频道 {0}?",magnet_does_not_have_name:"此链接不包含任务名,请输入推文标题后重试。",no_available_post:"无可见推文",following_channel_no_post:"已关注的频道中不含可见的推文。此问题可能由网络错误引起。如果您已关注带有推文的频道,这些推文将在稍后加载完成。",share_to_library:"分享到媒体库",quick_start:"快速开始",quick_start_desc:"选择一个任务或文件快速创建推文",select_file:"选择文件...",select_folder:"选择文件夹...",post_options:"推文选项",channel_options:"频道选项",create_new_channel:"创建新频道",use_existed_channel:"使用已存在的频道",select_existed_channel:"选择一个频道",uploaded_by:"{title} (由 {name} 上传)",created_by:"{title} (由 {name} 创建)",creating_new_channel:"正在创建新频道...",created_new_channel:"新频道已创建",creating_new_post:"正在创建新推文...",created_new_post:"新推文已创建",create_new_post:"创建推文",quick_start_timeout:"{0}超时。此问题可能由网络错误引起。请稍后再试。",file_too_large:"文件过大",file_too_large_msg:"此文件的大小超过了 4GB ({size}),上传此文件可能需要较长的准备时间,是否仍要上传?",resolving_folder_files:"正在解析文件夹内容...",folder_too_large:"文件夹过大",folder_too_large_msg:"文件夹中的文件大小超过 4GB ({size} 总大小),上传此文件夹可能需要较长的准备时间,是否仍要上传?",creating_new_task:"正在创建新任务...",cannot_create_task:"创建任务异常",cannot_create_task_msg:"创建任务时产生了未知错误。任务可能已被创建,请查看上传列表以确定上传状态。",cannot_get_task_name:"无法获取任务名,请输入推文标题后重试",remove_old_task:"删除旧任务",remove_old_task_desc:"Web 模式仅允许创建一个任务,是否删除旧任务?",subtitle_list:"字幕列表",optional:"可选",with_subtitle:"含有{language}字幕",add_subtitle_url:"添加字幕下载链接",maximumSubtitleNum_limit:"字幕数量已达到最大",cannot_add_subtitle:"添加字幕失败",cannot_add_subtitle_msg:"没有选择字幕语言或下载链接无效。",support_subtitle_type:"仅支持srt,vtt格式的字幕。",recommend_opensubtitles:"建议使用www.opensubtitles.org的字幕下载链接或id。",take_down:"下架",serious_violation:"严重违规",copyright_disputes:"版权争议",adults_only:"成人内容",takedown_reason:"下架理由",takedown_mode:"下架模式",admins:"管理员",takedown_user:"下架此创作者",takedown_channel:"下架此频道",takedown_post:"下架此推文",select_takedown_reason:"选择下架理由",takedown_invalid_reason:"下架理由错误",takedown_invalid_user_id:"用户ID错误。ID应为87位字符",takedown_invalid_channel_id:"频道ID错误。ID应为20位字符",takedown_invalid_post_id:"推文ID错误。ID应为20位字符",takedown_management:"下架管理",users:"用户",channels:"频道",posts:"推文",you:"你",preset:"预设",admin:"管理员",committee:"委员会",about_takedown_mode:"模式说明:\n预设:在github添加,所有内容都会移除。\n管理员:任一管理员投票后即会移除。\n委员会:超过半数管理员投票后才会移除。",cannot_edit_preset:"无法编辑此行,因为它是预设内容",cannot_edit_not_vote:"无法编辑此行,因为你未为其投票",remove_vote:"移除你的下架投票",post_preload_failed:"无法预载此推文。下载链接可能已过期,因此无法立即播放。",about_cache_node:"关于缓存节点",edit_cache_node:"编辑缓存节点",create_cache_node:"创建缓存节点",about_cache_node_desc:`${_} 使用 gun 服务器作为缓存节点,您可以在进阶设置中编辑自定义节点。`,learn_how_to_deploy_gun:"查看如何建立自定义节点",library_setting:"媒体库设置",block_list_manage:"屏蔽列表管理",blocked_users:"已屏蔽的用户",blocked_channels:"已屏蔽的频道",unblock_user:"解除用户屏蔽",unblock_channel:"解除频道屏蔽",no_blocked_user:"没有已屏蔽的用户",no_blocked_channel:"没有已屏蔽的频道",field_required:"{0} 不能为空"};const g=i.a.displayName,b={unsupported_in_browser:"此功能暂不支持浏览器模式",client:"客户端",warning:"警告",enable:"启用",disable:"禁用",auto:"自动",encrypt_connection:"加密连接",encrypted_connection:"已加密的连接",non_encrypted_connection:"未加密的连接",connected_wires_not_disconnect:"已存在的连接不会被断开",audio:"音频",video:"视频",image:"图片",subtitle:"字幕",zip:"压缩文件",text:"文本",unknown:"未知",add:"添加",undo:"撤销",backup:"备份",not_default_app:`${g}不是你的默认应用. 是否设置默认应用?`,dont_show_again:"不再提示",go_to_settings:"前往设置",about_alphabiz:`关于 ${g}`,update_channel:"更新通道",last_check_at:"上次检查更新时间",check_for_update:"检查更新",checking_for_update:"检查更新中...",no_update_available:"没有可用更新",update_available:"更新可用",update_now:"现在更新",update_later:"以后更新",click_to_update:"点击[现在更新]按钮以开始下载更新",update_failed:"更新失败",update_failed_message:"在更新时遇到了一个错误: ",check_shasum_failed:"安装包完整性检查失败",downloading_update:"更新下载中...",ready_to_update:"准备更新",restart_to_update:`更新下载已完成. ${g} 将在数秒后退出以安装更新`,already_latest:"当前版本({0})已是最新",update_timeout:"更新超时",no_available_release:"没有可用的版本",no_available_installer:"没有可用的安装包",feedback:"反馈",select_a_type:"选择一个类型",category:"分类",select_a_category:"选择一个分类",title:"标题",require_title:"请提供标题",describe_your_problem:"描述您遇到的问题",report_a_bug:"报告一个错误(bug)",request_a_new_feature:"请求一个新功能",download_or_upload:"下载/上传",others:"其他",submit_with_system_info:"提交时附带系统信息",submit_feedback:"提交反馈",tweet_us:"发送Twitter",tweet_too_long:"Tweet过长",delete_characters:"请删除{0}个字符",rest_characters:"还能输入{0}个字符",update_alphabiz:`更新 ${g}`,current_version:"当前版本",cancel_update:"取消更新",slow_download_speed:"下载过于缓慢",slow_download_speed_caption:"当前更新包下载过于缓慢,请检查网络状态",update_canceled:"更新已取消",current_version_release_time:"当前版本发布时间",expired_app:`${g} 过期`,version_out_of_date:"版本过旧",have_to_update:`${g} 版本过旧,部分接口或协议已失效。您需要升级 ${g} 才可继续使用。`,exit_alphabiz:`退出 ${g}`,exit_and_update:"退出并应用更新",new_version_hint:"新版本可用",no_new_version:"没有可用的新版本",current_is_latest:"当前版本已是最新版",click_to_check_update:"点击 [检查更新] 按钮以检查更新",download_latest_version_from_website:"请前往官网下载最新版本",to_the_website:"前往官网",network_diagnotic:"网络诊断",diagnotic:"诊断",click_to_check:"点击开始检查",click_to_check_again:"点击再次检查",checking:"检查中",online:"在线",offline:"离线",dns_look_up:"域名解析",error:"错误",aws_service:"AWS 服务",network_pings:"网络 Ping",not_found:"未找到",packet_loss:"丢包率",official_site:"官方网站",download_test:"下载测试",connected:"已连接",test_task:"测试任务 ({0})",download_failed:"下载失败",second_spend:"用时 {0} 秒",open_default_player_failed:"打开默认播放器失败",copied_to_clipboard:"已复制到剪贴板",go_to:"前往",region_not_available:"地区不可用",region_not_available_message:"抱歉,此应用在您的地区不可用。本应用将在{0}秒后退出",confirm:"确认",no_available_result:"无可用结果"};var y={...f,...l,...c,...d,...h,...u,...p,...b};const v=i.a.displayName;var w={repeat_add:"The task has been added, Please do not add it again",upload:"Upload",download:"Download",delete:"Delete",delete_task:"Delete task",delete_confirm_message:"Delete this task? This is irrevocable",also_delete_files:"Also delete files",default_delete_files:"Default delete downloaded files after remove task",not_now:"Not now",delete_autoupload_confirm:"This task contains file you put in auto-upload directory. Delete this task will also delete the file.",delete_anyway:"Delete anyway",upload_too_many_files:"Upload too many files",ask_if_unlimit_upload_amount:"The auto-upload directory contains too many files. Do you want to disable the upload amount limitation? *This may cause performance problem",disable_limitation:"Disable limitation",not_length:"Multi file operation is not supported at present, Please cooperate",download_torrent:"Download file",upload_torrent:"Upload file",files:"Files",file:"File",folder:"Folder",start_all:"Start all",pause_all:"Pause all",remove_all:"Remove all",upload_all:"Upload all",clear_history:"Clear history",pause_all_finish_payments:"This will finish all payments.",accelerating:"Accelerating",link_task:"Link task",torrent_task:"File task",ok:"OK",cancel:"Cancel",download_directory_position:"Download directory position",torrent_file:"task file",magnetic_link_incorrect:"The link format is incorrect",delete_fail:"Delete fail",pause:"Pause",paused:"Paused",stop_torrent:"Stop",seed:"Seed",resume:"Resume",downloading:"Downloading",downloaded:"Downloaded",uploading:"Uploading",auto_uploading:"Auto uploading",uploaded:"Uploaded",pending:"Waiting for other tasks",verifying:"Verifying",waiting_for_verify:"Waiting for verify",seeding:"Seeding",completed:"Completed",status:"Status",task_name:"Task name",size:"Size",progress:"Progress",sort:"Sort",ascending:"Ascending",descending:"Descending",file_loading:"Loading file...",loading:"Loading",unknown_status:"Unknown",play_while_downloading:"Play...",upload_or_play:"Upload / Play",play:"Play",ask_if_upload_file:"Upload file?",ask_if_upload_or_play:"Upload or play file?",torrent_error:"Error when adding task:",no_peers:"Retry for more than {0} times and no peer is available",torrent_exists:"Task already exists.",show_origin_torrent:"Get original task file or url",show_directory:"Open directory of this torrent",task_num:"Tasks",total_upload_speed:"Upload speed",total_download_speed:"Download speed",path_missing:"Error: cannot find torrent path",origin_not_found:"Cannot find origin task info.",text_copied:"Magnum url is copied to your clipboard",copy_magnet_uri:`Copy ${Object(m["a"])()?"link":"magnet:?"} URI`,copy_download_uri:"Copy download URI",copy_share_uri:"Copy share URI",uri_copied:"URI is successfully copied to your clipboard",uri_copy_failed:"Failed to copy uri",more:"More...",toggle_list_mode:"Toggle list mode",comment:"comment",operations:"Operations",open_directory:"Open directory",no_downloading_task:"No downloading task",remove_all_downloading_tasks:"Remove all downloading tasks?",remove_all_upload_tasks:"Remove all upload tasks?",remove_autoupload_files:"Remove auto-upload files",remove_all_history:"Remove all history?",remaining:"Remaining",created_time:"Created time",used_time:"Used time",completed_time:"Completed time",yesterday:"Yesterday",before_yesterday:"{empty}",earlier:"Earlier",miss_file:"Some files are missing",delete_miss_file_task:"There are fome files missing in {0}.",common_peer:"Common peer",ab_peer:`${v} peer`,ab_peer_verified:`Verified ${v} peer`,ab_peer_available:`${v} peer(s) available`,alphabiz_accelerating:`${v} accelerating`,income:"Income",income_info:"Income(today/total)",total_income_info:"Income: {0}(today) / {1}(total)",login_to_see_income:"Login to see income statistics",credit_cost:"Credit costs",downloaded_by_payment:"Downloaded by Payments",file_not_found:"Cannot find this file in local",no_task:"No task",no_matched_task:"No matched task",space_not_enough:"Disk space not enough",need_more_space:"Need {0} more space but current disk has {1} free ({2} reserved). Tasks are paused. Library preload is disabled. You can re-enable it in [Settings - Advanced].",seeders:"Seeders",last_update:"Last update",connecting:"Connecting",connected:"Connected",request_timed_out:"Request timed out",connection_failed:"Connection failed",invalid_download_url:"Invalid download URL",download_link:"download link",empty_files:"No files in directory",duplicate_task:"Duplicate task",duplicate_tracker:"Duplicate tracker",this_task_not_ready:"This task is not ready. Pause this task will directly remove it.",some_task_not_ready:"Some tasks are not ready. Pause these tasks will directly remove them.",failed_to_delete_files:"Failed to delete files",failed_to_delete_files_desc:"Failed to delete some files of the task. You may need to delete them manually",unknown_error:"Unknown error: {0}",more_files_are_not_shown:"({0} more files are not shown for performance reason)",no_available_file:"No available file. Please wait for task ready.",service_worker_error:"Cannot load ServiceWorker for playing. Your browser may not support this feature, or the ServiceWorker is not activated. You may need to reload this page and try again.",add_task_first:"You need to add task first.",player_task_time:"Player takes too many seconds preparing for play. There may be something wrong with the task.",web_mode_hint:`The web mode of ${v} only supports WebRTC peers. For best experience, please download ${v} Desktop App.`,web_mode_task_hint:"Click buttons below to add a task. You can only add one task at one time.",save_to_local:"Save to local",save_as_zip:"Save as ZIP",creating_save_file:"Creating save file...",upload_as_one_directory:"Upload as one directory",upload_as_single_files:"Upload as single files",web_mode_upload_single:"You can only upload a single file in web mode",download_success:"Download successfully",download_fail:"Download failed",wait_for_downloaded_to_share:"Please wait for task downloaded before sharing.",download_with_cellular:"Download tasks using cellular",download_with_cellular_desc:"You are using cellular network. Download tasks with cellular may take additional fees by your carrier.",download_with_cellular_confirm:"Still download with cellular"},k={language:"Language",appearance:"Appearance",darkModeSystem:"System",darkModeLight:"Light",darkModeDark:"Dark",basic_setting:"Basic",hideMenu:"Hide App Menu (Windows & Linux Only)",autoHide:"Auto Hide Window",autoStart:"Open at login",restore:"Keep size and position of the window when exit",autoStartUnfinished:"Automatically resume all unfinished tasks",default_download_path:"Default Path",download_directory:"Download Directory",upload_directory:"Upload Directory",enable_auto_upload:"Enable auto upload",unlimit_upload_amount:"Unlimit upload amount",unlimit_upload_warning:"Allow upload large amount of files. This may cause performance problem",start:"Startup",transport_setting:"Transmission",upload_limit:"Upload limit",download_limit:"Download limit",payed_user_share_rate:"Payed user share rate",unlimited:"Unlimited",limit_input_error:"Limit number should be positive",BT_setting:"Task Settings",saveLinkSeed:"Save link as task file",autoDownload:"Automatically download link and content",continuousSeeding:"Keep seeding until stop it manually",seedSharingRate:"Seed Ratio",seedTime:"Seed Time (minutes)",task_manage:"Task Management",maximumDownloadNum:"Maximum active tasks",maximumConnectionsNum:"Maximum connection per server",range_error:"Range should between {0} and {1}",random:"Random",breakpointContinuation:"Continue",automaticSkip:"Automatically show downloading after adding task",afterNotification:"Notification after download is complete",deleteConfirm:"No confirmation is required before deleting task",submit:"Save & Apply",discard:"Discard",reset:"Reset",reset_all_settings:"Reset all settings?",preferences_resetted:"Preferences resetted",traditional_chinese:"繁體中文",japanese:"日本語",english:"English",chinese:"简体中文",advancedSettings:"Advanced",autoUpdate:"Auto Update",autoCheckUpdate:"Automatically check for update",proxy:"Proxy",useProxyService:"Enable Proxy",trackerService:"Tracker Servers",recommendUse:"Recommended",autoUpdateTrackerServiceList:"Update tracker list every day automatically",manualUpdateTracker:"Manual update",manualUpdateSuccess:"Successfully update tracker servers",manualUpdateFail:"Failed to update from:",listenPort:"Listen Ports",BTlistenPort:"Data Transmission Port",DHTlistenPort:"Distributed Hash Port",protocols:"Compatible Protocols",setDefaultClientForFollowingProtocols:"Set as the default client for the following protocols",magnetUrl:"Magnet",video_file:"Video file",audio_file:"Audio file",security:"Security",impersonateUserAgent:"Mock User-Agent",RPCauthorizationkey:"RPC Secret",viewDocument:"View RPC Secret Manual",developer:"Developer",applicationLogPath:"App log path",downloadSessionPath:"Download session path",resetDownloadSessionRecord:"Reset download session",restoreInitialSettings:"Factory Reset",preferences_set_successfully:"Save preferences successfully!",preferences_set_fail:"Save preferences fail!",change_not_save:"Changes not save",discard_all_changes:"Discard all changes and leave?",stay_in_page:"Stay in page",disk_usage:"Disk usage",pause_if_less_space:"Pause and notify if space is less than (MB)",default_video_player:"Default video player",video_cache_time:"Stream play cache",minutes:"minutes",system_default:"System Default",media_player:"Media Player",library_film_rate:"Available film rate",library_show_explore:"Show [Explore] page",library_setting:"Library setting",library_sync_setting:"Library sync setting",keychain_sync_status:"Keychain sync status",sync_with_aws:"Sync Keychain with Amazon Web Services",backup_to_local:"Backup to local file",enable_sync_with_aws:"Enable sync with AWS",disable_sync_with_aws:"Disable sync with AWS",disable_sync_with_aws_desc:"This will remove saved key in server. Please ensure you have already export your key.",input_independent_password:"Input independent password",change_independent_password:"Change independent password",password_error:"Password error",password_invalid:"Password invalid",key_existed:"Key existed",key_not_found:"Key not found",library_recommend:"Library recommend",show_all_channels:"Show all channels in library recommend page",not_logged_in:"Not logged in",login_to_continue:"Login to continue",mnemonic_code:"Mnemonic code",wordlist:"Wordlist",restore_code:"Restore from code",generate_code:"Generate code",export_mnemonic_code:"Export mnemonic code",import_mnemonic_code:"Import mnemonic code",print:"Print",save_as_txt:"Save as txt",save_as_pdf:"Save as pdf",from_file:"From file",not_valid_mnemonic_code:"This is not a valid mnemonic code",cannot_parse_code_as_key:"Cannot parse this mnemonic code as library key",import_key_hint:"Are you sure to import this key? This will recover your old key in library.",import_key_confirm:"Yes, import it.",library_preload:"Preload tasks from library",show_preload:"Show preload tasks",set_download:"Set download directory",set_download_desc:"For macOS App Store version, the default download directory is in App's sandbox, and will be deleted after app uninstalled. If you want to keep your download files, you need to select a different download directory manually."};const C=i.a.displayName;var $={home:"Home",home_caption:"Download/Upload and Media Files",library:"Library",library_caption:"Explore media resources",player:"Player",player_caption:"Media Player",credits:"Credits",credits_caption:"Check Account Balance",account:"Account",account_caption:"Sign In/Sign Up/Management",settings:"Settings",settings_caption:"Settings for App, Player, Account",development:"Development",development_caption:"Developer Mode for Internal Use",basic:"Basic",basic_caption:"Basic Settings",advanced:"Advanced",advanced_caption:"Advanced Settings",blockchain:"Wallet",blockchain_caption:`${C} Decentralized Wallet`,internal_notice:"Internal Release Notice",release_notes:"Release notes",terms_and_conditions:"Terms and Conditions",license_and_listen_notices:"License and Listen Open Source Notices",close:"Close",success:"Success",fail:"Fail"},S={credits:"Credits",pay:"Pay",pay_with_credit:"Pay for download accelerating. Needs about {0} credit",pay_with_credit_payed:"Accelerating. Still needs about {0} credit",create_payment:"Create Payment",pay_target:"Target",pay_for_torrent:"Pay for {0}",your_subid:"Your subId",your_credits:"Your credits",pay_point_for_data:"Pay {0} point for {1} data",auto_renew:"Enable auto renew",transaction_details:"Transaction Details",transaction_id:"Id",transaction_payer:"Payer",transaction_payee:"Payee",transaction_category:"Category",transaction_changed_amount:"Changed Amount",transaction_meta:"Meta",transaction_status:"Status",transaction_creation_time:"Creation Time",receipt_code:"Receipt Code",transfer_amount:"Transfer Amount",code_the_receipt_code:"Copy the receipt code below to the payer",fill_the_receipt_code:"Transfer by filling in the payment code provided by the payee",income:"Income",expense:"Expense",copied:"Copied",transfer:"Transfer",receive:"Receive",copy:"Copy",withdraw_fund:"Withdraw Fund",category_paydata_payer:"Cost of data",category_paydata_payee:"Income of data",category_transfer:"Transfer",category_bonus:"Bonus",category_recharge:"Recharge",status_pending:"pending",status_completed:"completed",status_finish:"finish",status_failed:"failed",tip_invalid_receiver:"Invalid receiver code",tip_invalid_amount:"Credit amount should be an float in the range 0-1000 (Minimum precision is 0.001)",credit_get_more:"Get more credits",credit_no_data:"No data available",credit_loading:"Loading...",credit_not_enough_amount:"Not enough credits",credit_amount_not_enough:"Not enough credits",credit_payee_not_exist:"Payee does not exist",credit_invalid_amount:"Invalid credit amount",credit_can_not_transfer_to_yourself:"Can not transfer to yourself",credit_latest:"Latest",credit_error_network:"There is a problem with the network, please try again later","payer credit amount is not enough":"Not enough credits","payee does not exist":"Payee does not exist"},x={account_email_invalid_address:"Invalid email address",account_email_invalid_domain:"Invalid email domain",account_email_unknown_status:"Unknown email delivery status",account_email_unavailable_address:"Unavailable email address",account_email_suppressed_address:"Suppressed email address",account_loading:"Loading...",account_is_required:" is required",account_sign_in_your_account:"Sign in",account_username:"Username",account_username_email_phone:"Phone number or email",account_password:"Password",account_new_password:"New password",account_re_enter_password:"Re-enter password",account_password_not_equal:"Two passwords are not equal",account_new_password_same:"The password is the same as the original password",account_forgot_your_password:"Forgot your password? ",account_reset_password:"Reset password",account_sign_in:"Sign in",account_signed_in:"Signed in",account_sign_up:"Sign up",account_find_your_account:"Find your account",account_enter_your_username:"Enter your phone number or email",account_search:"Search",account_email_sent_tip:"An email with a verification code has been sent to your email: ",account_phone_sent_tip:"A SMS with a verification code has been sent to your phone: ",account_email_phone_sent_tip:"Email and SMS with verification code have been sent to your email and phone respectively:",account_software_token_tip:"MFA is enabled for your account. To finish signing in, please turn on or view your device and type the TOTP",account_reset_your_password:"Reset your password",account_verification_code:"Verification code",account_resend_code:"Resend code",account_code_has_been_resent:"Verification code has been resent",account_password_has_been_reset:"Password has been reset",account_submit:"Submit",account_sign_up_your_account:"Sign up your account",account_fill_required_fields:"Fill in the required fields below.",account_fill_optional_fields:"Fill in the optional fields below.",account_email:"Email",account_invitation:"Invitation",account_invitation_code:"Invitation code",account_i_accept:"I accept ",account_license_terms:"the license and terms",account_next:"Next",account_you_need_to_accept_license_terms:"You need to accept the license and terms first.",account_verify_fill_optional_fields:"Verify and fill in optional fields.",account_nickname:"Nickname",account_gender:"Gender",account_male:"Male",account_female:"Female",account_not_say:"Not say",account_birthday:"Birthday",account_phone_number:"Phone number",account_locale:"Locale",account_tip_verified:"Verified, Signing in...",account_verified:"verified",account_unverified:"unverified",account_signed_up:"Signed up",account_verify_your_identity:"Verify your identity",account_finish:"Finish",account_signed_out:"Signed out",account_change_password:"Change password",account_change_email:"Change email",account_change_phone_number:"Change phone number",account_sign_out:"Sign out",account_current_password:"Current password",account_re_enter_new_password:"Re-enter new password",account_personal_information:"Information",account_edit:"edit",account_reset:"reset",account_greeting:"Hello,",account_cancel:"Cancel",account_change:"change",account_not_set:"not set",account_setting:"setting",account_copy_code:"copy the code",account_account_setting:"Account",account_task_page:"Credit task",account_setting_caption:"Change Password / Edit Information",account_security:"Security",account_want_to_join:"Want to Join?",account_sign_in_now:"Sign in",account_changed:"Changed",account_clipboard_with_invitation_code:"Invitation code copied",account_clipboard_with_code:"The Code copied",account_invitation_code_dialog_tip:"You will send your friend an email or text message with an invitation code:",account_available:"available",account_invited:"invited",account_used:"used",account_invitation_code_sent:"Invitation code has been sent",account_invitation_channel_required:"Fill in at least one invitation channel",account_no_verification_code:"Can not receive verification code? ",account_no_phone_number:"No phone number? ",account_sign_up_by_email:"Sign up by email",account_no_email:"No email? ",account_sign_up_by_phone_number:"Sign up by phone number",account_no_totp:"No TOTP? ",account_tip_no_totp:"If there is no TOTP, please setup TOTP first",account_setup_totp:"Setup TOTP",account_contact_information:"Contact information",account_delete_account:"Delete account",account_deleted:"Deleted",account_can_not_mfa:"MFA in trouble? ",account_set_mfa_type:"Config MFA",account_disable_mfa:"Disable MFA",account_disabled_mfa:"Disabled MFA",account_sms_mfa:"SMS MFA",account_totp_mfa:"TOTP MFA",account_totp:"TOTP",account_not_recommend:"Not Recommend",account_oauth_sign_in_with:"Sign in with {provider}",account_sign_in_failed:"Failed to sign in",account_tip_oath_sign_up:"The email corresponding to the current {provider} account: {email} has not yet created an account",account_tip_confirm_delete_account:"Enter the current account password to confirm that you want to delete the current account.(Deleted accounts cannot be restored)",account_tip_config_mfa:"You can choose to use SMS or time-based one-time password (TOTP) as secondary authentication",account_error_can_not_enable_mfa:"You must bind your email address and mobile phone number to enable MFA",account_tip_can_not_enable_sms_mfa:"You must bind your email address and mobile phone number to enable SMS MFA",account_tip_can_not_enable_totp_mfa:"You must bind your email address and mobile phone number to enable TOTP MFA",account_tip_setup_totp:"Use apps such as Authenticator to scan the QR code below or copy the code manually to add a security token",account_tip_verify_totp:"Verify your TOTP",account_link_your_social_account:"Bind your social account",account_unlink_your_social_account:"Unbind social account",account_tip_confirm_link:"Are you sure you want to bind the current account to your {provider} account?",account_tip_confirm_unlink:"Are you sure to cancel your bound {provider} account?",account_tip_linking:"binding...",account_tip_unlinking:"Unbinding...",account_linked:"Bound",account_unlinked:"Unbound",account_error_can_not_link_to_the_linked_account:"The current social account is bound to another account",account_error_can_not_link_to_the_mismatched_email:"The current account and the social account email address are inconsistent",account_error_can_not_link_before_email_verified:"The social account cannot be linked because the current account is not bound to a verified email",account_tip_confirm_verify_email_phone:"Whether to send a verification code to the current account's email and phone number to verify your identity?",account_tip_confirm_verify_phone:"Whether to send a verification code to the current phone number to verify your identity?",account_error_1_message_60_seconds:"Only one SMS or email can be sent every 60 seconds, wait another {delta} seconds",account_error_10_messages_per_day:"Each mobile phone or email can only send 10 messages within 24 hours",account_error_network:"There is a problem with the network, please try again later","Network Error":"There is a problem with the network, please try again later",account_error_user_not_exist:"User does not exist",account_error_incorrect_username_or_password:"Incorrect username or password",account_error_incorrect_original_password:"Incorrect original password",account_error_incorrect_password:"Incorrect password",account_error_username_not_found:"Username not found",account_error_can_not_reset_for_no_verified:"Can not reset password for the unverified account",account_error_invalid_verification_code:"Incorrect verification code, please try again",account_error_expired_verification_code:"Verification code expired, please try again",account_error_password_not_long_enough:"Password is not long enough",account_error_attempt_limit_exceeded:"Attempt limit exceeded, please try after some time.",account_error_password_attempts_exceeded:"Password attempts exceeded.",account_error_invalid_phone_number_format:"Invalid phone number format",account_error_no_cell_phone_prefix:"Please select the prefix for the phone number",account_error_username_already_exists:"The username already exists",account_error_you_need_to_accept_license_terms:"You need to accept the license and terms first",account_error_inactive_code:"The invitation code is not an activated code",account_error_non_existent_code:"The invitation code is non-existent",account_error_unexpected:"Unexpected Error",account_error_can_not_change_email_before_phone_bound:"The email cannot be changed before the phone number is bound",account_error_can_not_change_email_before_unbound_social_account:"The email cannot be changed before unbinding the social account",account_error_can_not_change_phone_before_email_bound:"The phone number cannot be changed before the email is bound",account_error_can_not_change_email_phone_with_mfa_enabled:"Cannot change email or mobile phone number before disable MFA",account_error_same_email:"The new email address cannot be the same as the original email address",account_error_same_phone:"The new phone number cannot be the same as the original phone number",account_error_email_not_exists:"Email address does not exist",account_error_email_already_exists:"An account with the given email already exists.",account_error_phone_already_exists:"An account with the given phone number already exists.",account_error_mfa_token_mismatch:"Software Token Code mismatch",account_error_recaptcha_not_loaded:"There is a problem with the network. Please reconnect the network and restart the application to try again.",account_error_recaptcha_validation_failed:"ReCAPTCHA validation failed. Please reconnect the network and restart the application to try again.",account_error_sign_in_in_progress:"Pending sign-in attempt already in progress",account_field_range:"Limit input of {0}-{1} characters",account_field_only_alphanumeric:"Only supports alphanumeric",account_field_only_alphanumeric_and_symbol:"Only supports alphanumeric and symbols",account_field_only_chinese_alphanumeric_space_underline:"Only supports alphanumeric, space, underscore",account_field_prefix_without_number_space:"The first character cannot be a number or a space",account_field_suffix_without_space:"Cannot end with a space",account_field_without_repeat_space:"Cannot use multiple spaces in a row",account_field_can_not_only_alphanumeric:"You can't just use letters or numbers",account_field_must_have_number_characters:"Must have number characters",account_field_verification_code:"Verification code must be six digits",account_field_invitation_code:"Invitation code must be alphanumeric",account_field_phone_number:"Invalid phone number format",account_invalid_email_format:"Invalid email format",account_sign_out_confirm:"Are you sure to sign out? This will stop all tasks.",account_sign_out_anyway:"Sign out anyway",account_signing_out:"Signing out...",account_request_save_settings:"Settings are not saved. You need to save changes before sign out.",invalid_password_format:"Invalid password format",invalid_password_format_same:"The password is the same as the original password",error_password:"Password error",keychain_setting:"Keychain",setting_description:"Cloud storage: Save key data to the cloud.\nChange password: Change the password for the media library key.\nMnemonic: an alternative method for generating and restoring keys.\nImport Local Key: Import the locally saved key into the media library.\nExport Key: Saves the current media library data to the local or cloud.\nBackup key to cloud: Update the current media library data to the cloud for backup.",refresh_status:"Update Status",confirm_import_key:"Confirm import key",confirm_update_cloud_key:"You already have a key in the cloud. Updating the key will overwrite the original key. Are you sure you want to update the key stored in the cloud",export_key_with_cloud:"Enter the independent password you set to export the library key stored in the cloud, and lock the key file by the unlock password",store_cloud_key_prompt_password:"Enter an independent password to store the library key in the cloud",update_cloud_key_prompt_password:"Set an independent password to encrypt the library key then update it to the cloud",enable_cloud_storage_prompt_password:"Set a password for the key stored in the cloud, through which you can retrieve the key from the cloud",input_unlock_password:"Set unlock password",export_local_prompt_password:"Pleasse set an unlock password to encrypt your key file. We will not save this password for you, so if you loss your password, you will be not able to unlock your library key",require_unlock_password:"The key file is locked, please enter the unlock password",require_independent_password:"Enter the independent password to get the key stored in the cloud",import_local_prompt_password:"The key file is locked, please enter the unlock password",select_encrypt_mode:"Select encryption mode",input_independent_password:"Enter independent password",update_cloud_key:"Update the key stored in the cloud",backup_to_cloud:"Backup the library key to the cloud",save_local:"Save the library key as local encrypted file",create_new_key:"Create a new library key",creating_lib_key:"Creating library key...",loading_lib_key:"Loading library key...",failed_to_create_lib_key:"Failed to create library key",failed_to_load_lib_key:"Failed to load library key",import_local_key:"Import key locally",import_lib_key_from_local:"Import a library key Locally",import_from_cloud:"Import the library key from the cloud",create_or_import_key:"Create or import library key",create_or_import_key_desc:"Library key is an independent key used to fetch and publish contents with decentralized database.",store_your_lib_key:"Store your library key",export_cloud_key:"Export Key from Cloud",export_current_key:"Export Current Key",change_password:"Change Password",enable_cloud_storage:"Enable cloud storage",disable_cloud_storage:"Disable cloud storage",disable_cloud_storage_desc:"Disable cloud storage will remove the key saved in the cloud, please ensure the key is saved locally",sync_at:"Sync at: {time}",keychain_sync_status:"Keychain Sync Status",cloud_storage_enabled:"Sync Keychain with {storage}",cloud_storage_disabled:"Cloud storage disabled",saved_locally:"Saved locally",export_key:"Export key file",cloud_independent_password:"Cloud independent password",key_file_unlock_password:"Key file unlock password",re_enter_unlock_password:"Re-enter unlock password",independent_password_not_enabled:"The current password is the Alphabiz account password (no independent password is set)",use_cognito_hash:"Use Alphabiz account password",use_independent_password:"Use independent password",keychain_lib:"library key",loading_keychain_state:"Loading keychain...",backing_up:"Backing up...",backup_current_key:"Backup current key to Cloud",cloud_lib_key_not_existed:"library key does not exist in Cloud",open_keychain_file:"Open Keychain File",confirm_open_abk:"Do you want to open the ABK file",use_the_key:"Use the key",backup_the_key:"Backup the key to the cloud",keychain_data_does_not_exist:"Keychain data does not exist","timeout of 0ms exceeded":"There is a problem with the network, please try again later",XhrError:"There is a problem with the network, please try again later"},T={add_subtitles:"Add Subtitles",open_file:"Open File...",advanced_options:"Advanced options",title:"title",location:"location",subtitle_file:"subtitle file",unsupported_subtitle_type:"The file type of {0} is not a supported subtitle type",not_default_player:"The default video player is not set",this_is_an_audio_file:"This is an audio file",the_added_subtitle_already_exists:"The added subtitle already exists",stop_stream_player:"The streaming media was terminated because the task was paused or deleted",stop_player:"The player was terminated because the file was deleted",playing_timeout_hint:"Wait times out. Please check the task",autoplay_hint:"Autoplay may blocked by your browser. If the player is not playing, try click the screen to continue",remove_playing_confirm:"{0} is still playing, remove it will stop the player. Are you sure to remove it?",subtitle:"Subtitle",setting:"Setting",loading:"Loading",unknown_media:"Unknown Media",settings_button_visible:"Button Visible",settings_setting:"Setting",settings_playback_rate:"Playback Rate",settings_subtitle:"Subtitle",settings_pip:"PiP",settings_fullscreen:"Fullscreen",settings_subtitle_options:"Subtitle Options",settings_normal:"Normal",settings_italic:"Italic",settings_lighter:"Lighter",settings_bolder:"Bolder",settings_small:"Small",settings_large:"Large"};const I=i.a.displayName;var P={lib_index:"Home",lib_edit:"Publish",lib_publish:"Publish",lib_explore:"Explore",lib_following:"Following",lib_favorite:"Local Favorites",lib_local_favorites:"Local Favorites",lib_channel:"Channel",lib_submit:"Submit",lib_from_network:"Using decentralized database from network",welcome_to_lib:`Welcome to ${I} Media Library`,register_or_login:"Register/Login",lib_recommend:"Recommend",lib_recommend_desc:`Welcome to ${I} Library! This library uses decentralized database from network. To start using it, you need to follow some channels.`,follow_any_channel_to_continue:"Follow any channel to continue",follow_channels_and_continue:"Follow {0} channels and continue",show_more_for_me:"Show more for me",no_more_recommend:"No more recommend",key:"Key",create_key:"Create key",save_key:"Save key",save_key_file:"Do you want to save your key as file?",import_key:"Import key",import:"Import",invalid_key:"Invalid key",back_to_top:"Back to top",search_for_channel:"Search for channel ID",search_channel_no_result:"Cannot find channel with ID {0}",please_input_channel_id:"Please input channel ID",welcome_help_text:"\n This is a decentralized media library. You need\n to create an account for this database. We will\n generate a personal key for you automatically.\n If you have already had a key, you can also import\n it here.",welcome_key_text:"\n Once you logged in, please click [SAVE KEY] button\n in the right-bottom corner to save your private key.\n If you loss your key, you may not able to login again.",redirect_to_recommend:"It seems you had not followed any channel. Redirecting to [Explore] page.",channel:"Channel",follow:"Follow",unfollow:"Unfollow",following:"Following",share:"Share",unfollow_confirm:"Are you sure to unfollow this channel? All posts of this channel in your timeline will be removed.",follow_failed_hint:"Operation is still pending in background. If the operation is not applied for a long time, please restart app and try again.",block:"Block",unblock:"Unblock",blocked:"Blocked",block_channel:"Block this channel",block_channel_confirm:"Block channel will remove it from your timeline. You can manage your block list in account setting.",block_creator:"Block the creator of this channel",unblock_creator:"Unblock the creator of this channel",block_creator_confirm:"Block creator will remove all channels created by this creator from your timeline. You can manage your block list in account setting.",share_url_copied:"Share URL is copied to your clipboard",follow_time:"Follow time",update_time:"Update time",search:"Search",type:"Type",added:"Added",click_to_task:"Click to go to task",lib_already_added:"You have already added this video",description:"Description",poster:"Poster",channel_poster:"Channel poster",preview:"Preview",creator:"Creator",creator_detail:"Creator detail",loading_creator:"Loading creator info",wait_for_creator_loaded:"Please wait for creator info loaded.",follower:"Follower",followers:"Followers",follower_list:"Follower list",user:"User",channel_title:"Channel title",channel_id:"Channel ID",post_title:"Post title",post_id:"Post ID",import_data_from_excel:"Import data from excel",set_excel_keys:"Set excel keys",excel_import_succeded:"Excel import succeded",excel_import_success_msg:"{0} rows are ready to add, {1} invalid and {2} duplicated items are ignored",cannot_find_channel:"Cannot find channel",cannot_find_posts:"Cannot find posts",add_channel:"Add channel",add_post:"Add post",edit_channel:"Edit channel",channel_setting:"Channel setting",edit_post:"Edit post",edit_posts:"Edit posts",channel_detail:"Channel detail",remove:"Remove",remove_channel:"Remove channel",remove_channel_confirm:"Are you sure to remove this post? This cannot be recovered.",remove_post:"Remove post",remove_post_confirm:"Are you sure to remove this channel? This cannot be recovered.",preview_mode:"Preview Mode",preview_mode_desc:"This is a preview of your channel. All rates of films are shown here.",edit_user_profile:"Edit user profile",name:"Nickname",avatar:"Avatar",no_following:"No following channels. Click to goto",no_recommend:"No recommend channels. Click to goto",first_recomment_msg:"It may take a while if this is the first time app launched.",invalid_image:"Invalid image",image_not_reachable:"This image url is not reachable.",channel_not_found:"Channel not found",cannot_get_channel_info:"Cannot get channel info. This channel may be removed by its creator and no longer available.",validate_error:"Validate error",validate_user_name_no_space:"User name should not contain spaces",validate_url_no_space:"URL should not contain spaces",validate_user_name_length:"User name should have length between {0} and {1}",validate_user_desc_length:"User description should not be more than {0} characters",validate_user_avatar_url:"User avatar should be url with less than 2048 characters",validate_channel_title_length:"Channel title should have length between 1 and 100",validate_channel_desc_length:"Channel description should have length between 10 and 300",validate_channel_image_url:"Channel preview should be url with less than 2048 characters",validate_post_title_length:"Post title should have length between 1 and 100",validate_post_desc_length:"Post description should have length between 10 and 300",validate_post_image_url:"Poster should be url with less than 2048 characters",validate_post_url:`Invalid ${I} URL`,validate_post_url_length:`${I} URL should not be more than 2048 characters`,film_rate:"Film rate",set_film_rate:"Set film rate",select_a_rate_before_enter:"You need to select a film rate before enter media library.",library_available_rate:"Library available film rate",rate_g:"G – General Audiences",rate_g_desc:"All ages admitted. Nothing that would offend parents for viewing by children.",rate_pg:"PG – Parental Guidance Suggested",rate_pg_desc:'Some material may not be suitable for children. Parents urged to give "parental guidance". May contain some material parents might not like for their young children.',rate_pg_13:"PG-13 – Parents Strongly Cautioned",rate_pg_13_desc:"Some material may be inappropriate for children under 13. Parents are urged to be cautious. Some material may be inappropriate for pre-teenagers.",rate_r:"R – Restricted",rate_r_desc:"Under 17 requires accompanying parent or adult guardian. Contains some adult material. Parents are urged to learn more about the film before taking their young children with them.",rate_nc_17:"NC-17 – Adults Only",rate_nc_17_desc:"No One 17 and Under Admitted. Clearly adult. Children are not admitted.",set_as_private:"Set as private",hide_in_explore:"Hide this channel in explore page",hidden:"Hidden",select_a_rate:"Please select a film rate",select_from_tasks:"Select from tasks",import_from_magnet:`Import from ${Object(m["a"])()?"link":"magnet:?"}...`,input_magnet_url:`Input ${Object(m["a"])()?"link":"magnet:?"} url`,task_title:"Task title",set_title:"Set title",add_to_local_favorites:"Add to local favorites",remove_from_local_favorites:"Remove from local favorites",removed_favorite:"Removed favorite ",import_or_export_favorites:"Import/Export Favorites",export_local_favorites:"Export local favorites as backup",import_favorites_file:"Import favorites file",not_a_favorite_file:"This file is not a favorite backup file",connection_status:"Connection Status",gun_server_list:"Cache Nodes",custom_nodes:"Custom cache nodes",custom_nodes_hint:"Custom cache nodes will be applied after app relaunch",wait_for_reboot:"Waiting for reboot...({seconds}s)",reboot_now:"Reboot now",reboot_later:"Reboot later",peer_list:"Direct Nodes",server:"Node URL",peer:"Peer",peer_id:"Node ID",connection:"Connection",data_source:"Data Source",sync:"Sync",syncing:"Syncing",sync_completed:"Sync completed",got_all_post:"You have already got all posts",placeholder_channel_title:"Your Channel Name",placeholder_channel_desc:"Description about this channel",placeholder_post_title:"Movie Name (Year)",placeholder_post_desc:"Description about this movie",private_channel:"Private channel",creator_blocked:"Creator blocked",go_to_library:"Go to library?",go_to_library_channel_msg:"Do you want to go to the library channel {0}?",magnet_does_not_have_name:`This ${Object(m["a"])()?"link":"magnet:?"} url does not have a name, you need to add a post title first.`,no_available_post:"No available post",following_channel_no_post:"All your following channels do not have available post. This may caused by network error. If you have already followed some channels, the posts may be loaded later.",share_to_library:"Share to library",quick_start:"Quick start",quick_start_desc:"Start creating a post with a task or file",select_file:"Select file...",select_folder:"Select folder...",post_options:"Post options",channel_options:"Channel options",create_new_channel:"Create new channel",use_existed_channel:"Use existed channel",select_existed_channel:"Select existed channel",uploaded_by:"{title} uploaded by {name}",created_by:"{title} created by {name}",creating_new_channel:"Creating new channel...",created_new_channel:"New channel created",creating_new_post:"Creating new post...",created_new_post:"New post created",create_new_post:"Create new post",quick_start_timeout:"{0} timeout. This may be caused by network error. Please try again later.",file_too_large:"File too large",file_too_large_msg:"This file is larger than 4GB ({size}) and may take a long time preparing task. Are you sure to continue?",resolving_folder_files:"Resolving folder files...",folder_too_large:"Folder too large",folder_too_large_msg:"The files in this folder are larger than 4GB ({size} total) and may take a long time preparing task. Are you sure to upload?",creating_new_task:"Creating new task...",cannot_create_task:"Cannot create task",cannot_create_task_msg:"This may cause by some error. If the task is created correctly, you can check for task list later.",cannot_get_task_name:"Cannot get task name. You need to input one first.",remove_old_task:"Remove old task",remove_old_task_desc:"Web mode can only create one task at once. Do you want to remove old task?",subtitle_list:"Subtitle list",optional:"optional",with_subtitle:"With {language} subtitles",maximumSubtitleNum_limit:"The number of subtitles has reached its maximum",add_subtitle_url:"Add subtitle download link",cannot_add_subtitle:"Failed to add subtitles",cannot_add_subtitle_msg:"Subtitle language not selected or invalid download link.",support_subtitle_type:"Only subtitles in srt and vtt format are supported.",recommend_opensubtitles:"It is recommended to use the subtitle download link or id at www.opensubtitles.org.",take_down:"Take down",serious_violation:"Serious Violation",copyright_disputes:"Copyright Disputes",adults_only:"Adults Only",takedown_reason:"Takedown reason",takedown_mode:"Takedown mode",admins:"Admins",takedown_user:"Takedown this creator",takedown_channel:"Takedown this channel",takedown_post:"Takedown this post",select_takedown_reason:"Select takedown reason",takedown_invalid_reason:"Invalid takedown reason",takedown_invalid_user_id:"Invalid user id. Id should include 87 characters",takedown_invalid_channel_id:"Invalid channel id. ID should include 20 characters",takedown_invalid_post_id:"Invalid post id. ID should include 20 characters",takedown_management:"Take down management",users:"Users",channels:"Channels",posts:"Posts",you:"You",preset:"Preset",admin:"Admin",committee:"Committee",about_takedown_mode:"About takedown mode:\nPreset: Configured in github repository. All of them will be removed from library.\nAdmin: Any one of admins votes for will be removed.\nCommittee: At least half of admins vote for will be removed.",cannot_edit_preset:"You cannot edit this row since it is a preset row",cannot_edit_not_vote:"You cannot edit this row since you have not voted for it",remove_vote:"Remove your vote",post_preload_failed:"Failed to preload this post. The download link may be out-of-date, so this post cannot be played immediately.",about_cache_node:"About cache node",edit_cache_node:"Edit cache node",create_cache_node:"Create cache node",about_cache_node_desc:`${i.a.displayName} uses gun server as cache node. You can edit custom nodes in advance setting`,learn_how_to_deploy_gun:"Learn how to deploy your own gun server",library_setting:"Library setting",block_list_manage:"Block list manage",blocked_users:"Blocked users",blocked_channels:"Blocked channels",unblock_user:"Unblock user",unblock_channel:"Unblock channel",no_blocked_user:"No blocked user",no_blocked_channel:"No blocked channel",field_required:"{0} is required"};const O=i.a.displayName,q={unsupported_in_browser:"Not supported in browser mode yet",client:"Client",warning:"Warning",enable:"Enable",disable:"Disable",auto:"Auto",encrypt_connection:"Encrypt connection",encrypted_connection:"Encrypted connection",non_encrypted_connection:"Non-encrypted connection",connected_wires_not_disconnect:"Connected wires will not be disconnected",audio:"audio",video:"video",image:"image",subtitle:"subtitle",zip:"zip",text:"text",unknown:"unknown",add:"Add",undo:"Undo",backup:"Backup",not_default_app:`${O} is not your default app for torrent and media, do you want to set as default?`,dont_show_again:"Don't show again",go_to_settings:"Go to settings",about_alphabiz:`About ${O}`,last_check_at:"Last check at",update_channel:"Update channel",check_for_update:"Check for update",checking_for_update:"Checking for update...",no_update_available:"No update available",update_available:"Update available",update_now:"Update now",update_later:"Update later",click_to_update:"Click UPDATE NOW button to download and update",update_failed:"Update failed",update_failed_message:"An error occured while updating: ",check_shasum_failed:"Failed to check integrity for installer",downloading_update:"Downloading update...",ready_to_update:"Ready to update",restart_to_update:`Update is downloaded. ${O} will exit to update for a few moment.`,already_latest:"Current version({0}) is already latest",update_timeout:"Update timeout",no_available_release:"No available release",no_available_installer:"No available installer",feedback:"Feedback",select_a_type:"Select a type",category:"Category",select_a_category:"Select a category",title:"Title",require_title:"Title is required",describe_your_problem:"Describe your problem",report_a_bug:"Report a bug",request_a_new_feature:"Request a new feature",download_or_upload:"Download/Upload",others:"Others",submit_with_system_info:"Submit with system info",submit_feedback:"Submit feedback",tweet_us:"Tweet us",tweet_too_long:"Tweet is too long",delete_characters:"Please delete at least {0} character(s)",rest_characters:"You can input {0} more character(s)",update_alphabiz:`Update ${O}`,current_version:"Current version",cancel_update:"Cancel update",slow_download_speed:"Download too slow",slow_download_speed_caption:"The installer download is too slow now. Please check the network status",update_canceled:"Update canceled",current_version_release_time:"Release time of current version",expired_app:`${O} Expired`,version_out_of_date:"Version out of date",have_to_update:`The version of ${O} is out of date. Some protocols or APIs are deprecated. You have to update ${O} before continue.`,exit_alphabiz:`Exit ${O}`,exit_and_update:"Exit and apply update",new_version_hint:"New version is available",no_new_version:"No new version available",current_is_latest:"Current version is already latest",click_to_check_update:"Click [CHECK FOR UPDATE] button to check for update",download_latest_version_from_website:"Please visit the official website to download the latest version",to_the_website:"To the website",network_diagnotic:"Network Diagnotic",diagnotic:"Diagnotic",click_to_check:"Click to check",click_to_check_again:"Click to check again",checking:"Checking",online:"Online",offline:"Offline",dns_look_up:"DNS look up",error:"Error",aws_service:"AWS Service",network_pings:"Network Ping",not_found:"Not Found",packet_loss:"Packet(s) loss",official_site:"Official Site",download_test:"Download Test",connected:"Connected",test_task:"Test Task {0}",download_failed:"Download failed",second_spend:"{0} s spend",open_default_player_failed:"Failed to open the default player",copied_to_clipboard:"Copied to clipboard",go_to:"Go to",region_not_available:"Region not available",region_not_available_message:"Sorry! Your region is not available to use this app. This app will quit after {0} seconds",confirm:"Confirm",no_available_result:"No available result"};var E={...P,...w,...k,...$,...x,...S,...T,...q};const A=i.a.displayName;var D={repeat_add:"任務已添加,請勿重複添加",upload:"上傳",download:"下載",delete:"刪除",delete_task:"刪除任務",delete_confirm_message:"是否刪除該任務? 此操作不可恢復",also_delete_files:"同時刪除文檔",default_delete_files:"刪除任務時默認刪除已下載的文件",not_now:"暫不處理",delete_autoupload_confirm:"此任務檔位於自動上傳資料夾, 刪除任務將同時刪除對應檔",delete_anyway:"仍要刪除",upload_too_many_files:"上傳檔過多",ask_if_unlimit_upload_amount:"自動上傳資料夾包含過多檔. 是否取消上傳數量限制? *此操作可能造成性能問題",disable_limitation:"取消限制",not_length:"暫不支持,多檔操作,請配合",download_torrent:"下載該任務",upload_torrent:"上傳該任務",files:"文件",file:"文件",folder:"資料夾",start_all:"全部開始",pause_all:"全部暫停",remove_all:"全部移除",upload_all:"全部上傳",clear_history:"清除歷史",pause_all_finish_payments:"此操作將完成所有已支付的訂單.",accelerating:"加速中",link_task:"連結任務",torrent_task:"文件任務",ok:"好的",cancel:"取消",download_directory_position:"下載目錄位置",torrent_file:"任務檔",magnetic_link_incorrect:"連結格式不正確",delete_fail:"刪除失敗",pause:"暫停",paused:"已暫停",stop_torrent:"結束任務",seed:"上傳",resume:"繼續",downloading:"下載中",downloaded:"下載完成",uploading:"上傳中",auto_uploading:"自動上傳中",uploaded:"上傳完成",pending:"等待其他任務完成",no_downloading_task:"沒有下載中任務",remove_all_downloading_tasks:"是否移除所有下載中任務?",remove_all_upload_tasks:"是否移除所有上傳任務?",remove_autoupload_files:"移除所有自動上傳任務",remove_all_history:"是否移除歷史下載記錄?",verifying:"驗證文件",waiting_for_verify:"等待驗證文件",seeding:"上傳中",completed:"已完成",status:"狀態",task_name:"任務名",size:"大小",progress:"進度",sort:"排序",ascending:"昇冪",descending:"降冪",file_loading:"檔載入中",loading:"載入中",unknown_status:"未知",play_while_downloading:"邊下邊播",upload_or_play:"上傳 / 播放",play:"播放",ask_if_upload_file:"是否上傳檔?",ask_if_upload_or_play:"是否上傳/播放檔?",torrent_error:"添加任務時遇到錯誤:",no_peers:"多次嘗試後仍未能與Peers建立連接",torrent_exists:"任務已存在",show_origin_torrent:"顯示原始任務檔或連結",show_directory:"打開文件所在位置",task_num:"任務數",total_upload_speed:"上傳速度",total_download_speed:"下載速度",path_missing:"Error: 找不到檔位置",origin_not_found:"獲取任務資訊失敗",text_copied:"連結已複製到剪貼板",copy_magnet_uri:"複製連結位址",copy_download_uri:"複製下載連結",copy_share_uri:"複製社交分享連結",uri_copied:"連結已複製至剪貼板",uri_copy_failed:"複製連結失敗",more:"更多",toggle_list_mode:"切換顯示模式",comment:"評論",operations:"操作",open_directory:"打開所在資料夾",remaining:"剩餘時間",created_time:"創建時間",used_time:"用時",completed_time:"完成時間",yesterday:"昨天",before_yesterday:"前天",earlier:"更早之前",miss_file:"文件缺失",delete_miss_file_task:"{0} 有部分檔缺失.",common_peer:"普通用戶",ab_peer:`${A} 用戶`,ab_peer_verified:`${A} 註冊用戶`,ab_peer_available:`${A} peer 可用`,alphabiz_accelerating:`${A} 加速中`,income:"收入",income_info:"收入(今天/總計)",total_income_info:"收入: {0}(今天) / {1}(總計)",login_to_see_income:"登陸以查看收入統計",credit_cost:"積分支出",downloaded_by_payment:"付費下載量",file_not_found:"無法找到本地檔",no_task:"無任務",no_matched_task:"無法找到匹配的任務",space_not_enough:"磁盤空間不足",need_more_space:"需要 {0} 磁盤空間, 磁盤空間僅剩 {1}, ({2} 為保留空間). 所有任務已暫停. 媒體庫預加載已禁用. 您可以在[設置 - 進階設置]中重新啟用.",seeders:"做種",last_update:"最後更新",connecting:"連接中",connected:"已連接",request_timed_out:"請求超時",connection_failed:"連接失敗",invalid_download_url:"下載鏈接錯誤",download_link:"下载鏈接",empty_files:"目錄中沒有文檔",duplicate_task:"重複任務",duplicate_tracker:"重複 tracker",this_task_not_ready:"此任務尚未就緒,暫停任務將直接刪除該任務",some_task_not_ready:"部分任務尚未就緒,暫停這些任務將直接刪除它們",failed_to_delete_files:"刪除文件失敗",failed_to_delete_files_desc:"無法刪除部分任務文件,可能需要手動刪除",unknown_error:"未知錯誤: {0}",more_files_are_not_shown:"(出於性能考慮,{0} 個文件未顯示",no_available_file:"没有可用的文件,请等待任務就绪",service_worker_error:"無法加載 ServiceWorker。您的瀏覽器可能不支援此特性,或 ServiceWorker 尚未就緒。請刷新頁面後再試",add_task_first:"請先添加任務",player_task_time:"播放器等待時間過長,請檢查任務是否就緒 ",web_mode_hint:`${A} Web 僅支援 WebRTC 種子。下載 ${A} 桌面版以獲得最佳體驗。`,web_mode_task_hint:"點擊下方按鈕創建任務。Web 模式下僅可同時創建一個任務。",save_to_local:"保存到本地",save_as_zip:"保存為 ZIP",creating_save_file:"正在創建文件...",upload_as_one_directory:"作為一個文件夾上傳",upload_as_single_files:"作為單獨的文件上傳",web_mode_upload_single:"Web 模式下只能上傳單個文件",download_success:"下載成功",download_fail:"下載失敗",wait_for_downloaded_to_share:"請等待下載完成後再分享。",download_with_cellular:"使用蜂窩數據下載",download_with_cellular_desc:"您正在使用蜂窩數據,下載時營運商可能會收取額外的費用。",download_with_cellular_confirm:"仍然使用蜂窩數據下載"},N={language:"語言",appearance:"外觀",darkModeSystem:"跟隨系統",darkModeLight:"明亮",darkModeDark:"黑暗",basic_setting:"基礎設置",hideMenu:"隱藏功能表欄(僅支援Windows和Linux)",autoHide:"自動隱藏視窗",start:"啟動",autoStart:"開機自動啟動",restore:"恢復上次退出時視窗的大小和位置",autoStartUnfinished:"自動開始未完成的任務",default_download_path:"預設下載路徑",download_directory:"下載目錄",upload_directory:"上傳目錄",enable_auto_upload:"允許自動上傳",unlimit_upload_amount:"不限制上傳數量",unlimit_upload_warning:"允許同時上傳大量檔案,此選項可能導致性能問題",transport_setting:"傳輸設置",upload_limit:"上傳限速",download_limit:"下載限速",payed_user_share_rate:"付費用戶上傳比例",unlimited:"不限速",limit_input_error:"限速需為正數",BT_setting:"下載任務設置",saveLinkSeed:"保存鏈接元數據為任務檔",autoDownload:"自動開始下載鏈接任務、任務檔",continuousSeeding:"持續上傳,直到手動停止",seedSharingRate:"分享率",seedTime:"上傳時間(分鐘)",task_manage:"任務管理",maximumDownloadNum:"同時下載的最大任務數",maximumConnectionsNum:"每個伺服器最大的連接數",range_error:"範圍需在{0}-{1}之間",random:"隨機",breakpointContinuation:"斷點續傳",automaticSkip:"新建任務後自動跳轉到下載頁面",afterNotification:"下載完成後通知",deleteConfirm:"刪除任務前無需確認",submit:"保存並應用",discard:"放棄",reset:"重置",reset_all_settings:"重置所有設置?",preferences_resetted:"偏好設置已重置",traditional_chinese:"繁體中文",japanese:"日本語",english:"English",chinese:"簡體中文",advancedSettings:"進階設置",autoUpdate:"自動更新",autoCheckUpdate:"自動檢查更新",proxy:"代理",useProxyService:"使用代理伺服器",trackerService:"Tracker伺服器",recommendUse:"推薦使用",autoUpdateTrackerServiceList:"每天自動更新Tracker伺服器列表",manualUpdateTracker:"手動更新",manualUpdateSuccess:"Tracker伺服器更新成功",manualUpdateFail:"更新以下Tracker伺服器失敗:",listenPort:"監聽埠",BTlistenPort:"數據傳輸埠",DHTlistenPort:"分散式哈希通訊埠",protocols:"兼容以下協定",setDefaultClientForFollowingProtocols:"設置本軟體為以下相容協定的預設用戶端",magnetUrl:"磁力連結",video_file:"視頻檔",audio_file:"音訊檔",security:"安全性",impersonateUserAgent:"模擬使用者代理(UA)",RPCauthorizationkey:"RPC授權密鑰",viewDocument:"查看說明文檔",developer:"開發者",applicationLogPath:"應用日誌路徑",downloadSessionPath:"下載會話路徑",resetDownloadSessionRecord:"重置下載會話記錄",restoreInitialSettings:"恢復初始設置",preferences_set_successfully:"偏好設置成功!",preferences_set_fail:"偏好設置失敗!",change_not_save:"修改未保存",discard_all_changes:"是否放棄所有更改?",stay_in_page:"留在此頁",disk_usage:"保留磁盘空間",pause_if_less_space:"剩餘空間小於此值時暫停並提醒(MB)",default_video_player:"默認視頻播放機",video_cache_time:"邊下邊播緩存時間",minutes:"分鐘",system_default:"系統預設",media_player:"媒體播放機",library_film_rate:"可見影片分級",library_show_explore:"顯示[探索]頁面",library_setting:"媒體庫設置",library_sync_setting:"媒體庫同步設置",keychain_sync_status:"金鑰同步狀態",sync_with_aws:"使用 Amazon Web Services 同步密鑰",backup_to_local:"保存為本地檔",enable_sync_with_aws:"啟用 AWS 同步",disable_sync_with_aws:"禁用 AWS 同步",disable_sync_with_aws_desc:"此操作將移除儲存在雲端的金鑰,請確保已將密鑰保存至本地。 ",input_independent_password:"輸入獨立密碼",change_independent_password:"修改獨立密碼",password_error:"密碼錯誤",password_invalid:"密碼格式錯誤",key_existed:"金鑰已存在",key_not_found:"金鑰不存在",library_recommend:"媒體庫推薦",show_all_channels:"在媒體庫推薦頁顯示所有頻道",not_logged_in:"尚未登錄",login_to_continue:"登陸以繼續",mnemonic_code:"助記詞",wordlist:"單詞表",restore_code:"從助記詞恢復",generate_code:"生成助記詞",export_mnemonic_code:"導出助記詞",import_mnemonic_code:"導入助記詞",print:"列印",save_as_txt:"保存為 txt",save_as_pdf:"保存為 pdf",from_file:"從文件導入",not_valid_mnemonic_code:"助記詞格式錯誤",cannot_parse_code_as_key:"無法將此助記詞解析為密鑰",import_key_hint:"是否確認導入此金鑰? 此操作將覆蓋舊的金鑰。 ",import_key_confirm:"確認導入",library_preload:"媒體庫任務預加載",show_preload:"顯示預加載任務",set_download:"設置下載文件夾",set_download_desc:"macOS App Store 版本默認保存位置為應用沙盒,在應用卸載時會一併刪除。為了保留下載文件,您需要手動選擇保存位置。"},L={home:"主頁",home_caption:"下載/上傳媒體文件",library:"媒體庫",library_caption:"探索媒體資源",player:"播放器",player_caption:"視頻播放",credits:"信用積分",credits_caption:"檢查賬戶積分餘額",account:"用戶",account_caption:"個人用戶配置",settings:"設置",settings_caption:"所有設置項",development:"開發者",development_caption:"應用開發者模式",basic:"主要設置",basic_caption:"主要設置項",advanced:"進階設置",advanced_caption:"進階的設置項",blockchain:"錢包",blockchain_caption:"去中心化錢包",internal_notice:"內部版本聲明",release_notes:"發行説明",terms_and_conditions:"條款和章程",license_and_listen_notices:"許可和監聽開源説明",close:"關閉",success:"成功",fail:"失敗"},j={credits:"信用積分",pay:"支付積分",pay_with_credit:"支付積分加速下載, 預計需要{0}積分",pay_with_credit_payed:"正在加速下載, 預計還需要{0}積分",create_payment:"創建積分訂單",pay_target:"支付對象",pay_for_torrent:"為 {0} 支付",your_subid:"用戶 subId",your_credits:"當前餘額",pay_point_for_data:"支付{0}積分以加速{1}數據",auto_renew:"允許自動續費",transaction_details:"訂單明細",transaction_id:"訂單編號",transaction_payer:"付款人",transaction_payee:"收款人",transaction_category:"類型",transaction_changed_amount:"變動金額",transaction_meta:"其他數據",transaction_status:"訂單狀態",transaction_creation_time:"訂單創建時間",receipt_code:"收款碼",transfer_amount:"轉賬金額",code_the_receipt_code:"複製下方收款碼給付款人",fill_the_receipt_code:"通過填入收款人提供的收款碼進行轉賬",income:"收入",expense:"支出",copied:"已複製",transfer:"轉賬",receive:"收款",copy:"複製",withdraw_fund:"選取基金",category_paydata_payer:"數據支付",category_paydata_payee:"數據收入",category_transfer:"個人轉賬",category_bonus:"系統獎勵",category_recharge:"充值",status_pending:"等待中",status_completed:"已傳完",status_finish:"已完成",status_failed:"已失效",tip_invalid_receiver:"無效的收款碼",tip_invalid_amount:"金額應為 0-1000 範圍內的數(最小精度為0.001)",credit_get_more:"獲得更多積分",credit_no_data:"無可用數據",credit_loading:"加載中",credit_not_enough_amount:"积分不足",credit_amount_not_enough:"积分不足",credit_payee_not_exist:"收款人不存在",credit_invalid_amount:"输入金额不合法",credit_can_not_transfer_to_yourself:"不能向自己转账",credit_latest:"最新日期",credit_error_network:"網絡出現異常,請稍後重試","payer credit amount is not enough":"积分不足","payee does not exist":"收款人不存在"},R={account_email_invalid_address:"無效的電子郵寄地址",account_email_invalid_domain:"無效的電子郵件域",account_email_unknown_status:"未知的郵件發送狀態",account_email_unavailable_address:"郵寄地址不可用",account_email_suppressed_address:"郵寄地址被禁用",account_loading:"加載中...",account_is_required:"不能為空",account_sign_in_your_account:"登錄賬戶",account_username:"用戶名",account_username_email_phone:"手機號碼或電子郵箱",account_password:"密碼",account_new_password:"新密碼",account_re_enter_password:"再次輸入密碼",account_password_not_equal:"輸入的兩個密碼不同。",account_new_password_same:"新密碼與原密碼相同",account_forgot_your_password:"忘記密碼了?",account_reset_password:"重置密碼",account_sign_in:"登錄",account_signed_in:"登錄成功",account_sign_up:"註冊",account_find_your_account:"找尋你的賬戶",account_enter_your_username:"輸入你的手機號碼或電子郵箱",account_search:"查找",account_email_sent_tip:"一封附帶驗證碼的電子郵件已發送到您的郵箱:",account_phone_sent_tip:"一封附帶驗證碼的短信已發送到您的手機:",account_email_phone_sent_tip:"附帶驗證碼的電子郵件和手機短信已分別發送到您的郵箱和手機:",account_software_token_tip:"您的賬戶已啟用安全令牌。要完成登錄,請打開或查看您的設備並輸入驗證碼",account_reset_your_password:"重置賬戶密碼",account_verification_code:"驗證碼",account_resend_code:"重發驗證碼",account_code_has_been_resent:"驗證碼已發送",account_password_has_been_reset:"密碼已重置",account_submit:"提交",account_sign_up_your_account:"註冊賬戶",account_fill_required_fields:"填寫下方的必填項。",account_fill_optional_fields:"填寫下方的選填項。",account_email:"郵箱",account_invitation:"邀請",account_invitation_code:"邀請碼",account_i_accept:"我接受",account_license_terms:"服務許可條款",account_next:"下一步",account_you_need_to_accept_license_terms:"請先勾選我接受服務許可條款",account_verify_fill_optional_fields:"驗證身份與可選項",account_nickname:"暱稱",account_gender:"性別",account_male:"男",account_female:"女",account_not_say:"不透露",account_birthday:"生日",account_phone_number:"手機號碼",account_locale:"地區",account_tip_verified:"驗證通過,正在登陸…",account_verified:"已驗證",account_unverified:"未驗證",account_signed_up:"註冊成功",account_verify_your_identity:"驗證您的身份",account_finish:"完成",account_signed_out:"註銷成功",account_change_password:"修改密碼",account_change_email:"修改電子郵箱",account_change_phone_number:"修改手機號碼",account_sign_out:"註銷",account_current_password:"當前密碼",account_re_enter_new_password:"再次輸入新密碼",account_personal_information:"個人資訊",account_edit:"編輯",account_reset:"重置",account_greeting:"你好,",account_cancel:"取消",account_change:"更改",account_not_set:"未設置",account_setting:"設置",account_copy_code:"複製程式碼",account_account_setting:"賬戶設置",account_task_page:"積分任務",account_setting_caption:"管理你的賬戶信息",account_security:"安全",account_want_to_join:"登錄更精彩",account_sign_in_now:"點擊登錄",account_changed:"已更改",account_clipboard_with_invitation_code:"已復制邀請碼",account_clipboard_with_code:"已復制程式碼",account_invitation_code_dialog_tip:"你將通過短信或電子郵件的方式發送邀請碼:",account_available:"可用",account_invited:"已邀請",account_used:"已使用",account_invitation_code_sent:"邀請碼已發送",account_invitation_channel_required:"至少需要填寫一項邀請途徑",account_no_verification_code:"無法收到驗證碼?",account_no_phone_number:"沒有手機號碼?",account_sign_up_by_email:"通過郵箱註冊",account_no_email:"沒有郵箱?",account_sign_up_by_phone_number:"通過手機註冊",account_no_totp:"沒有安全令牌?",account_tip_no_totp:"若沒有安全令牌请先設置安全令牌",account_setup_totp:"設置安全令牌",account_contact_information:"聯繫方式",account_delete_account:"删除帳戶",account_deleted:"已删除",account_can_not_mfa:"無法進行二級驗證?",account_set_mfa_type:"更改二級驗證",account_disable_mfa:"關閉二級驗證",account_disabled_mfa:"已關閉二級驗證",account_sms_mfa:"手機短信驗證",account_totp_mfa:"安全令牌驗證",account_totp:"安全令牌",account_not_recommend:"不推薦",account_oauth_sign_in_with:"通過 {provider} 登錄",account_sign_in_failed:"登錄失敗",account_tip_oath_sign_up:"当前{provider}账户所对应的邮箱:{email}尚未创建账户",account_tip_confirm_delete_account:"输入当前账户密码以确认要删除当前账户。(账户删除后将无法恢复)",account_tip_config_mfa:"您可以通過手機短信或安全令牌為賬戶設置二級驗證",account_error_can_not_enable_mfa:"您必須同時綁定郵箱和手機號碼,才可以啟用二級驗證",account_tip_can_not_enable_sms_mfa:"您必須同時綁定郵箱和手機號碼,才可以啟用短信驗證",account_tip_can_not_enable_totp_mfa:"您必須同時綁定郵箱和手機號碼,才可以啟用安全令牌",account_tip_setup_totp:"使用Authenticator等應用,掃描下方的二維碼或手動複製代碼來添加安全令牌",account_tip_verify_totp:"驗證您的安全令牌",account_link_your_social_account:"綁定您的社交賬號",account_unlink_your_social_account:"解除社交賬號綁定",account_tip_confirm_link:"確定將當前賬號與您的 {provider} 賬號進行綁定嗎?",account_tip_confirm_unlink:"確定解除您已綁定的 {provider} 賬號嗎?",account_tip_linking:"正在綁定...",account_tip_unlinking:"解除綁定中...",account_linked:"已綁定",account_unlinked:"已解除綁定",account_error_can_not_link_to_the_linked_account:"當前社交帳號已與其他賬號綁定",account_error_can_not_link_to_the_mismatched_email:"當前賬號與社交帳號郵箱地址不一致",account_error_can_not_link_before_email_verified:"未綁定郵箱的賬戶無法綁定社交帳戶",account_tip_confirm_verify_email_phone:"是否向當前賬戶的email和手機號碼發送驗證碼以驗證您的身份?",account_tip_confirm_verify_phone:"是否向當前手機號碼發送驗證碼以驗證您的身份?",account_error_1_message_60_seconds:"每60秒只能發送一條簡訊或郵件,需再等待 {delta} 秒",account_error_10_messages_per_day:"每部手機或電子郵件24小時內只能發送10條資訊",account_error_network:"網絡出現異常,請稍後重試","Network Error":"網絡出現異常,請稍後重試",account_error_user_not_exist:"用戶不存在",account_error_incorrect_username_or_password:"用戶名或密碼錯誤",account_error_incorrect_original_password:"原密碼錯誤",account_error_incorrect_password:"密碼錯誤",account_error_username_not_found:"找不到該用戶名的賬戶",account_error_can_not_reset_for_no_verified:"賬戶未進行郵箱驗證,無法重置密碼",account_error_invalid_verification_code:"驗證碼錯誤,請重試",account_error_expired_verification_code:"驗證碼過期,請重試",account_error_password_not_long_enough:"密碼長度不能小於8位",account_error_attempt_limit_exceeded:"嘗試次數過多,請稍後重試",account_error_password_attempts_exceeded:"超過密碼嘗試次數",account_error_invalid_phone_number_format:"手機號碼格式不正確",account_error_no_cell_phone_prefix:"請選擇手機號前綴",account_error_username_already_exists:"該用戶名已存在",account_error_you_need_to_accept_license_terms:"請勾選我接受服務許可條款",account_error_inactive_code:"該邀請碼已失效",account_error_non_existent_code:"該邀請碼不存在",account_error_unexpected:"未知錯誤",account_error_can_not_change_email_before_phone_bound:"綁定手機號碼前無法更改郵箱",account_error_can_not_change_email_before_unbound_social_account:"解除社交帳戶綁定前無法更改郵箱",account_error_can_not_change_phone_before_email_bound:"綁定郵箱前無法更改手機號碼",account_error_can_not_change_email_phone_with_mfa_enabled:"關閉二級驗證前無法更改郵箱或手機號碼",account_error_same_email:"新的郵箱不能與原郵箱相同",account_error_same_phone:"新手機號碼不能與原手機號碼相同",account_error_email_not_exists:"該郵箱不存在",account_error_email_already_exists:"該郵箱已有帳戶綁定",account_error_phone_already_exists:"該手機號碼已有帳戶綁定",account_error_mfa_token_mismatch:"安全令牌錯誤",account_error_recaptcha_not_loaded:"網絡出現異常,請重連網絡後重啓應用重試",account_error_recaptcha_validation_failed:"未通過ReCaptcha驗證,請重連網絡後重啓應用重試",account_error_sign_in_in_progress:"等待登錄嘗試已在進行中",account_field_range:"字符個數應在{0}-{1}的範圍中",account_field_only_alphanumeric:"僅支持字母和數字",account_field_only_alphanumeric_and_symbol:"僅支持字母數字和符號",account_field_only_chinese_alphanumeric_space_underline:"僅支持中英文數字空格下劃線",account_field_prefix_without_number_space:"首個字符不能為數字或空格",account_field_suffix_without_space:"不能以空格結尾",account_field_without_repeat_space:"不能連續使用多個空格",account_field_can_not_only_alphanumeric:"不可僅為字母或數字",account_field_must_have_number_characters:"必須包含數字",account_field_verification_code:"驗證碼必須是六位數數字",account_field_invitation_code:"邀請碼必須是字母和數字",account_field_phone_number:"手機號碼格式不正確",account_invalid_email_format:"郵箱格式不正確",account_sign_out_confirm:"是否確認註銷? 註銷後將停止所有任務.",account_sign_out_anyway:"仍要註銷",account_signing_out:"正在註銷...",account_request_save_settings:"設置未保存。在註銷前請先保存修改。",invalid_password_format:"密碼格式錯誤",invalid_password_format_same:"新密碼與原密碼相同",error_password:"密碼錯誤",keychain_setting:"密鑰管理",setting_description:"雲端儲存:將金鑰數據保存到雲端。\n修改密碼:修改媒體庫金鑰的密碼。\n助記詞:一種生成和恢復金鑰的替代方法。\n導入本地金鑰:將本地保存的金鑰導入媒體庫。\n匯出金鑰:將當前媒體庫數據保存到本地或雲端。\n備份金鑰到雲端:將當前媒體庫數據更新到雲端進行備份。",refresh_status:"更新狀態",confirm_import_key:"確認導入金鑰",confirm_update_cloud_key:"你在雲端已有金鑰,更新金鑰將覆蓋原有的金鑰,確認更新存儲在雲端的金鑰嗎",export_key_with_cloud:"輸入您所設定的獨立密碼匯出存儲在雲端的媒體庫金鑰,並通過解鎖密碼鎖定密鑰文件",store_cloud_key_prompt_password:"輸入獨立密碼以存儲媒體庫金鑰到雲端",update_cloud_key_prompt_password:"設定獨立密碼以加密媒體庫金鑰並更新到雲端",enable_cloud_storage_prompt_password:"為存儲在雲端的金鑰設置密碼,通過該密碼可以從雲上取回金鑰",input_unlock_password:"設定解鎖密碼",export_local_prompt_password:"請設定一個解鎖密碼,該密碼用於加密您的密鑰文件。我們不會保存此密碼,因此若您丟失該密碼,密鑰文件將無法解鎖。",require_unlock_password:"該密鑰文件已被鎖定,請輸入解鎖密碼",require_independent_password:"輸入獨立密碼以獲取存儲在雲端的金鑰",import_local_prompt_password:"該密鑰文件已被鎖定,請輸入解鎖密碼",select_encrypt_mode:"選擇加密模式",input_independent_password:"輸入獨立秘碼",update_cloud_key:"更新存儲在雲端的金鑰",backup_to_cloud:"將媒體庫金鑰備份到雲端",save_local:"將媒體庫金鑰保存為本地加密檔",create_new_key:"創建新的媒體庫金鑰",creating_lib_key:"正在創建媒體庫金鑰...",loading_lib_key:"正在載入媒體庫金鑰...",failed_to_create_lib_key:"創建媒體庫金鑰失敗",failed_to_load_lib_key:"載入媒體庫金鑰失敗",import_local_key:"導入本地金鑰",import_lib_key_from_local:"從本地導入媒體庫金鑰",import_from_cloud:"從雲端導入媒體庫金鑰",create_or_import_key:"創建或導入媒體庫金鑰",create_or_import_key_desc:"媒體庫金鑰用於与去中心化數據庫同步內容。",store_your_lib_key:"存儲你的媒體庫金鑰",export_cloud_key:"導出雲端密鑰",export_current_key:"導出當前密鑰",change_password:"修改密碼",enable_cloud_storage:"啟用雲端存儲",disable_cloud_storage:"關閉雲端存儲",disable_cloud_storage_desc:"關閉雲端存儲將移除保存在雲端的密鑰,請確保已將密鑰保存在本地",sync_at:"同步於:{time}",keychain_sync_status:"密鑰同步狀態",cloud_storage_enabled:"使用 {storage} 同步密鑰",cloud_storage_disabled:"未啟用雲端存儲",saved_locally:"已保存於本地",export_key:"導出密鑰文件",cloud_independent_password:"雲端獨立密碼",key_file_unlock_password:"密鑰文件解鎖密碼",re_enter_unlock_password:"再次輸入解鎖密碼",independent_password_not_enabled:"當前密碼為 Alphabiz 帳戶密碼(未設定獨立密碼)",use_cognito_hash:"使用 Alphabiz 賬戶密碼",use_independent_password:"使用獨立密碼",keychain_lib:"媒體庫金鑰",loading_keychain_state:"加載密鑰中...",backing_up:"備份中...",backup_current_key:"備份當前金鑰到雲端",cloud_lib_key_not_existed:"雲端媒體庫金鑰不存在",open_keychain_file:"打開金鑰檔案",confirm_open_abk:"是否打開ABK檔案",use_the_key:"使用該金鑰",backup_the_key:"備份該金鑰到雲端",keychain_data_does_not_exist:"金鑰數據不存在","timeout of 0ms exceeded":"網絡出現異常,請稍後重試",XhrError:"網絡出現異常,請稍後重試"},U={add_subtitles:"添加字幕",open_file:"打開文件...",advanced_options:"高級選項",title:"標題",location:"位置",subtitle_file:"字幕文件",unsupported_subtitle_type:"The file type of {0} is not a supported subtitle type",not_default_player:"默認視頻播放器未設置",this_is_an_audio_file:"這是一個音頻文件",the_added_subtitle_already_exists:"添加的字幕已存在",stop_stream_player:"因任務被暫停或刪除,流媒體播放被終止",stop_player:"因文件被删除,播放被终止",playing_timeout_hint:"等待超時,請檢查任務",autoplay_hint:"自動播放功能可能受瀏覽器限制,若未開始播放,請手動點擊播放器以播放",remove_playing_confirm:"{0} 正在播放中,刪除任務將停止播放。是否仍要刪除?",subtitle:"字幕",setting:"設定",loading:"加載中",unknown_media:"未知媒體",settings_button_visible:"按鈕顯示",settings_setting:"設定",settings_playback_rate:"倍速",settings_subtitle:"字幕",settings_pip:"畫中畫",settings_fullscreen:"全屏",settings_subtitle_options:"字幕选项",settings_normal:"常規",settings_italic:"斜體",settings_lighter:"纖細",settings_bolder:"粗體",settings_small:"較小",settings_large:"較大"};const F=i.a.displayName;var M={lib_index:"主頁",lib_edit:"編輯",lib_publish:"發佈",lib_explore:"探索",lib_following:"關注",lib_favorite:"本地收藏",lib_local_favorites:"本地收藏",lib_channel:"頻道",lib_submit:"提交",lib_from_network:"使用去中心化資料庫,所有數據來源於網路",welcome_to_lib:`歡迎使用 ${F} 媒體庫`,register_or_login:"註冊/登陸",lib_recommend:"推薦",lib_recommend_desc:`歡迎使用 ${F} 媒體庫! 本媒體庫使用去中心化的資料庫,所有數據來源於網路。 在開始前,請先關注一些推薦頻道。`,follow_any_channel_to_continue:"關注任意頻道以繼續",follow_channels_and_continue:"關注 {0} 個頻道並繼續",show_more_for_me:"為我展示更多",no_more_recommend:"沒有更多推薦",key:"金鑰",create_key:"生成金鑰",save_key:"保存金鑰",save_key_file:"是否將金鑰保存為檔案?",import_key:"匯入金鑰",import:"導入",invalid_key:"金鑰格式錯誤",back_to_top:"回到頂部",search_for_channel:"搜索頻道 ID",search_channel_no_result:"找不到 ID 為 {0} 的頻道",please_input_channel_id:"請輸入頻道 ID",welcome_help_text:"\n 這是一個去中心化的媒體庫,您需要為此創建一個專用帳戶,\n 我們將自動為您生成一套金鑰。 如果您已經擁有金鑰了,\n也可以在此導入金鑰".replace(/\s/g,""),welcome_key_text:"\n 當您成功創建帳號后,請點擊右下角的【保存金鑰】按鈕匯出\n您的金鑰。 一旦您丟失金鑰,對應的帳號將無法找回。 ".replace(/\s/g,""),redirect_to_recommend:"您似乎沒有關注任何頻道,即將前往探索頁。 ",channel:"頻道",follow:"關注",unfollow:"取消關注",following:"關注中",share:"分享",block:"遮罩",unblock:"取消遮罩",blocked:"已遮罩",block_channel:"遮罩此頻道",block_channel_confirm:"遮罩頻道後,頻道的所有內容將從時間線上移除。 您可以在帳戶設定中管理遮罩清單。 ",block_creator:"遮罩此頻道的創作者",unblock_creator:"取消遮罩此頻道的創作者",block_creator_confirm:"遮罩創作者後,該創作者的所有頻道將從時間線上移除。 您可以在賬戶設置中管理遮罩清單",share_url_copied:"分享鏈接已複製至剪貼板",unfollow_confirm:"是否取消關注? 此頻道的所有推文將從你的時間線上移除。 ",follow_failed_hint:"操作仍在後台進行中,請耐心等待。如長時間未完成修改請嘗試重啟應用。 ",follow_time:"關注時間",update_time:"更新時間",search:"搜索",type:"類型",added:"已添加",click_to_task:"點擊前往對應任務",lib_already_added:"您已添加此視頻",description:"描述",poster:"海報",channel_poster:"頻道海報",preview:"預覽",creator:"創作者",creator_detail:"創作者詳情",loading_creator:"正在載入創作者資訊",wait_for_creator_loaded:"請等待創作者資訊載入完成。 ",follower:"關注者",followers:"關注者",follower_list:"關注者清單",user:"使用者",channel_title:"頻道標題",channel_id:"頻道 ID",post_title:"推文標題",post_id:"推文 ID",import_data_from_excel:"從 Excel 導入資料",set_excel_keys:"設置excel鍵",excel_import_succeded:"Excel 導入成功",excel_import_success_msg:"可添加 {0} 條新專案, {1} 條資訊不完整及 {2} 條重複項已忽略",cannot_find_channel:"找不到指定頻道",cannot_find_posts:"找不到指定視頻",add_channel:"添加頻道",add_post:"添加推文",edit_channel:"編輯頻道",channel_setting:"頻道設置",edit_post:"編輯推文",edit_posts:"編輯推文",channel_detail:"頻道詳情",remove:"移除",remove_channel:"移除頻道",remove_channel_confirm:"是否確認移除頻道? 此操作不可恢復。 ",remove_post:"移除推文",remove_post_confirm:"是否確認移除推文? 此操作不可恢復",preview_mode:"預覽模式",preview_mode_desc:"這是頻道的預覽模式,所有分級的影片均為可見狀態。 ",edit_user_profile:"編輯使用者資料",name:"昵稱",avatar:"頭像",no_following:"沒有已關注的頻道。 點擊前往",no_recommend:"沒有可推薦的頻道。 點擊前往",first_recomment_msg:"如果您是初次使用,載入時間可能較長",invalid_image:"圖片異常",image_not_reachable:"此圖片URL不可用",channel_not_found:"找不到頻道",cannot_get_channel_info:"無法獲取指定的頻道資訊。 該頻道可能已被創作者刪除而不再可見。 ",validate_error:"驗證錯誤",validate_user_name_no_space:"使用者名不可包含空格",validate_url_no_space:"URL 不可包含空格",validate_user_name_length:"使用者名應為 {0}-{1} 字元",validate_user_desc_length:"使用者描述不可多於 {0} 字元",validate_user_avatar_url:"使用者頭像應為連結且不多於2048字元",validate_channel_title_length:"頻道標題應為1-100字元",validate_channel_desc_length:"頻道描述應為10-300字元",validate_channel_image_url:"頻道預覽圖應為連結且不多於2048字元",validate_post_title_length:"推文標題應為1-100字元",validate_post_desc_length:"推文描述應為10-300字元",validate_post_image_url:"海報應為連結且不多於2048字元",validate_post_url:`${F} 連結格式錯誤`,validate_post_url_length:`${F} 連結不可多於2048字元`,film_rate:"影片分級",set_film_rate:"設置影片分級",select_a_rate_before_enter:"您需要設置一個影片分級才可進入媒體庫。 ",library_available_rate:"媒體庫可用影片分級",rate_g:"G(大眾級)",rate_g_desc:"所有年齡皆可觀賞\n此類影片不含或僅含少量會讓家長在讓兒童觀賞時感到被冒犯的內容,無需家長陪同。 ",rate_pg:"PG(建議家長指導)",rate_pg_desc:"一些內容可能不適合兒童觀看\n此類影片包含部分家長可能認為不適合兒童的內容,因此建議家長可同時進行指導。 ",rate_pg_13:"PG-13(家長特別留意)",rate_pg_13_desc:"一些內容可能不適合13歲以下兒童觀看\n此類影片有部分內容對 13歲以下兒童不適宜,需要有父母陪同觀看。 此類影片動作暴力適當,含有少量血腥場面及不雅用語,但也包含可能令人情緒不安的情節。 ",rate_r:"R(限制級)",rate_r_desc:"未滿十七歲人士必須由家長或成年監護人陪同\n此類影片中常有大量血腥暴力、驚悚恐怖、裸露性愛或吸毒場景, 且有大量性暗示及不雅用語/ 冒犯性言論等,17歲以下人士必須由父母或者監護陪伴才能觀看。 ",rate_nc_17:"NC-17(只准成人觀看)",rate_nc_17_desc:"17歲或以下人士不得觀賞\n此類影片其中常有清楚的性愛場面,大量的吸毒或暴力鏡頭以及髒話等,因此僅適合成人觀賞。 ",set_as_private:"設為私有",hide_in_explore:"在瀏覽頁隱藏此頻道",hidden:"已隱藏",select_a_rate:"請選擇一個影片分級",select_from_tasks:"從上傳任務中選擇",import_from_magnet:`從${Object(m["a"])()?"連結":"磁力連結(magnet:?...)"}導入`,input_magnet_url:"輸入連結",task_title:"任務標題",set_title:"設為標題",add_to_local_favorites:"添加到本地收藏",remove_from_local_favorites:"從本地收藏中移除",removed_favorite:"已移除收藏",import_or_export_favorites:"導入/匯出收藏",export_local_favorites:"匯出收藏文件作為備份",import_favorites_file:"導入備份的收藏",not_a_favorite_file:"此文件並非收藏備份",connection_status:"連接狀態",gun_server_list:"緩存節點",custom_nodes:"客製化緩存節點",custom_nodes_hint:"緩存節點將在重啟軟體後應用",wait_for_reboot:"即將重啟軟體...({seconds}s)",reboot_now:"立即重啟",reboot_later:"稍後重啟",peer_list:"節點清單",server:"節點 URL",peer:"節點",peer_id:"節點 ID",connection:"連接",data_source:"數據源",sync:"同步",syncing:"同步中",sync_completed:"同步完成",got_all_post:"已獲取全部推文",placeholder_channel_title:"頻道名稱",placeholder_channel_desc:"關於此頻道的描述",placeholder_post_title:"電影名稱 (年份)",placeholder_post_desc:"關於此電影的描述",private_channel:"私有頻道",creator_blocked:"已遮罩創作者",go_to_library:"前往媒體庫?",go_to_library_channel_msg:"是否前往媒體庫頻道 {0}?",magnet_does_not_have_name:"此連結不包含任務名,請輸入推文標題后重試。 ",no_available_post:"無可見推文",following_channel_no_post:"已關注的頻道中不含可見的推文。 此問題可能由網路錯誤引起。 如果您已關注帶有推文的頻道,這些推文將在稍後載入完成。 ",share_to_library:"分享到媒體庫",quick_start:"快速開始",quick_start_desc:"選擇一個任務或檔快速創建推文",select_file:"選擇檔...",select_folder:"選擇資料夾...",post_options:"推文選項",channel_options:"頻道選項",create_new_channel:"創建新頻道",use_existed_channel:"使用已存在的頻道",select_existed_channel:"選擇一個頻道",uploaded_by:"{title} (由 {name} 上傳)",created_by:"{title} (由 {name} 创建)",creating_new_channel:"正在創建新頻道...",created_new_channel:"新頻道已創建",creating_new_post:"正在創建新推文...",created_new_post:"新推文已創建",create_new_post:"創建推文",quick_start_timeout:"{0}超時。此問題可能由網路異常引起。請稍後再試。",file_too_large:"文件過大",file_too_large_msg:"此檔的大小超過了 4GB ({size}),上傳此檔可能需要較長的準備時間,是否仍要上傳? ",resolving_folder_files:"正在解析文件夾內容...",folder_too_large:"資料夾過大",folder_too_large_msg:"資料夾中的檔大小超過 4GB ({size} 總大小),上傳此資料夾可能需要較長的準備時間,是否仍要上傳? ",creating_new_task:"正在創建新任務...",cannot_create_task:"創建任務異常",cannot_create_task_msg:"創建任務時產生了未知錯誤。 任務可能已被創建,請查看上傳清單以確定上傳狀態。 ",cannot_get_task_name:"無法獲取任務名,請輸入推文標題后重試",remove_old_task:"刪除舊任務",remove_old_task_desc:"Web 模式僅允許創建一個任務,是否刪除舊任務? ",subtitle_list:"字幕清單",optional:"可選",with_subtitle:"含有{language}字幕",add_subtitle_url:"添加字幕下載連結",maximumSubtitleNum_limit:"字幕數量已達到最大",cannot_add_subtitle:"添加字幕失敗",cannot_add_subtitle_msg:"沒有選擇字幕語言或下載鏈接無效。",support_subtitle_type:"僅支援srt,vtt格式的字幕。",recommend_opensubtitles:"建議使用www.opensubtitles.org的字幕下載鏈接或id。",take_down:"下架",serious_violation:"嚴重違規",copyright_disputes:"版權爭議",adults_only:"成人內容",takedown_reason:"下架原因",takedown_mode:"下架模式",admins:"管理員",takedown_user:"下架此創作者",takedown_channel:"下架此頻道",takedown_post:"下架此推文",select_takedown_reason:"選擇下架原因",takedown_invalid_reason:"下架原因錯誤",takedown_invalid_user_id:"用戶ID錯誤。ID應為87位字符",takedown_invalid_channel_id:"頻道ID錯誤。ID應為20位字符",takedown_invalid_post_id:"推文ID錯誤。ID應為20位字符",takedown_management:"下架管理",users:"用戶",channels:"頻道",posts:"推文",you:"你",preset:"預設",admin:"管理員",committee:"委員會",about_takedown_mode:"模式說明:\n預設:在github添加,所有內容都會從媒體庫移除。\n管理員:任一管理員投票後即會移除。\n委員會:超過半數管理員投票後才會移除。",cannot_edit_preset:"無法編輯此行,因為它是預設內容",cannot_edit_not_vote:"無法編輯此行,因為你未為其投票",remove_vote:"移除你的下架投票",post_preload_failed:"無法預載此推文。下載連結可能已過期,因此無法立即播放。",about_cache_node:"關於緩存節點",edit_cache_node:"編輯緩存節點",create_cache_node:"創建緩存節點",about_cache_node_desc:`${F} 使用 gun 伺服器作為緩存節點,您可以在進階設置中編輯自定義節點。`,learn_how_to_deploy_gun:"查看如何建立自定義節點",library_setting:"媒體庫設置",block_list_manage:"屏蔽列表管理",blocked_users:"已屏蔽的用戶",blocked_channels:"已屏蔽的頻道",unblock_user:"解除用戶屏蔽",unblock_channel:"解除頻道屏蔽",no_blocked_user:"沒有已屏蔽的用戶",no_blocked_channel:"沒有已屏蔽的頻道",field_required:"{0} 不能為空"};const B=i.a.displayName,Q={unsupported_in_browser:"此功能暫不支援瀏覽器模式",client:"客戶端",warning:"警告",enable:"啟用",disable:"禁用",auto:"自動",encrypt_connection:"加密傳輸",encrypted_connection:"已加密的連結",non_encrypted_connection:"未加密的連結",connected_wires_not_disconnect:"已存在的連結不會被斷開",audio:"音頻",video:"視頻",image:"圖片",subtitle:"字幕",zip:"壓縮文件",text:"文本",unknown:"未知",add:"添加",undo:"撤銷",backup:"備份",not_default_app:`${B}不是你的默認應用, 是否設置默認應用?`,dont_show_again:"不再提示",go_to_settings:"前往設置",about_alphabiz:`關於 ${B}`,update_channel:"更新通道",last_check_at:"上次檢查更新時間",check_for_update:"檢查更新",checking_for_update:"檢查更新中...",no_update_available:"沒有可用更新",update_available:"更新可用",update_now:"現在更新",update_later:"以後更新",click_to_update:"點擊[現在更新]按鈕以開始下載更新",update_failed:"更新失敗",update_failed_message:"在更新時遇到了一個錯誤: ",check_shasum_failed:"安裝包完整性檢查失敗",downloading_update:"更新下載中...",ready_to_update:"準備更新",restart_to_update:`更新下載已完成. ${B} 將在數秒後退出以應用更新`,already_latest:"當前版本({0})已是最新",update_timeout:"更新超時",no_available_release:"沒有可能的版本",no_available_installer:"沒有可用的安裝包",feedback:"反饋",select_a_type:"選擇一個類型",category:"分類",select_a_category:"選擇一個分類",title:"標題",require_title:"請提供標題",describe_your_problem:"描述您遇到的問題",report_a_bug:"報告一個錯誤(bug)",request_a_new_feature:"請求一個新功能",download_or_upload:"下載/上傳",others:"其他",submit_with_system_info:"提交時附加系統信息",submit_feedback:"提交反饋",tweet_us:"發送Twitter",tweet_too_long:"Tweet過長",delete_characters:"請刪除{0}個字符",rest_characters:"還能輸入{0}個字符",update_alphabiz:`更新 ${B}`,current_version:"當前版本",cancel_update:"取消更新",slow_download_speed:"下載過於緩慢",slow_download_speed_caption:"當前更新包下載過於緩慢,請檢查網絡狀態",update_canceled:"更新已取消",current_version_release_time:"當前版本發佈時間",expired_app:`${B} 過期`,version_out_of_date:"版本過舊",have_to_update:`${B} 版本過舊,部分接口或協議已失效。您需要升級 ${B} 才可繼續使用。`,exit_alphabiz:`退出 ${B}`,exit_and_update:"退出並應用更新",new_version_hint:"新版本可用",no_new_version:"沒有可用的新版本",current_is_latest:"當前版本已是最新版",click_to_check_update:"點擊 [檢查更新] 按鈕以檢查更新",download_latest_version_from_website:"請前往官網下載最新版本",to_the_website:"前往官網",network_diagnotic:"網路診斷",diagnotic:"診斷",click_to_check:"點擊以開始檢查",click_to_check_again:"點擊以再次檢查",checking:"檢查中",online:"在線",offline:"離線",dns_look_up:"域名解析",error:"錯誤",aws_service:"AWS 服務",network_pings:"網路 Ping",not_found:"未找到",packet_loss:"丟包率",official_site:"官方網站",download_test:"下載測試",connected:"已連結",test_task:"測試任務 ({0})",download_failed:"下載失敗",second_spend:"用時 {0} 秒",open_default_player_failed:"打開默認播放器失敗",copied_to_clipboard:"已複製到剪貼板",go_to:"前往",region_not_available:"地區不可用",region_not_available_message:"抱歉,此應用在您的地區不可用。本應用將在{0}秒後退出。",confirm:"確認",no_available_result:"無可用結果"};var W={...M,...D,...N,...L,...R,...j,...U,...Q};const z={"zh-CN":y,"en-US":E,"zh-TW":W},H={"en-US":{M:{month:"short"},YM:{year:"numeric",month:"short"},YMD:{year:"numeric",month:"short",day:"numeric"},Hms:{hour:"numeric",minute:"numeric",second:"numeric"},MDHms:{month:"short",day:"numeric",hour:"numeric",minute:"numeric"},YMDHms:{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"}},"zh-CN":{M:{month:"short"},YM:{year:"numeric",month:"short"},YMD:{year:"numeric",month:"short",day:"numeric"},Hms:{hour:"numeric",minute:"numeric",second:"numeric"},MDHms:{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0},YMDHms:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}},"zh-TW":{M:{month:"short"},YM:{year:"numeric",month:"short"},YMD:{year:"numeric",month:"short",day:"numeric"},Hms:{hour:"numeric",minute:"numeric",second:"numeric"},MDHms:{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0},YMDHms:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}}};var V=n("fe2c"),G=n("d884"),K=n("9ad5"),Y=n.n(K),J=n("5584");const X=G["a"].map((({value:e})=>e));V["b"].registerHooks(["beforeRouteLeave","beforeRouteEnter"]),o["a"].use(a["a"]);const Z="undefined"===typeof navigator?"en-US":G["a"].find((({value:e})=>e===navigator.language))?navigator.language:"en-US";console.log(`[i18n] Default locale: ${Z}`);const ee=new a["a"]({locale:Z,fallbackLocale:"en-US",dateTimeFormats:H,messages:z,silentTranslationWarn:!0}),te={externals:"_i18n_externals_",locale:"_i18n_locale_",trans:"_i18n_translations_",dtf:"_i18n_datetime_"},ne=(e,t,n)=>{if(!e||!e.value)return console.warn(`Failed to add locale ${e}: 'value' is required but not found.`);if("object"!==typeof t||null===t)return console.warn(`Cannot add locale ${e.value}: 'translations' must be object.`);const a=G["a"].findIndex((t=>t.value===e.value));-1!==a?(console.warn(`Add duplicate language ${e.value} will replace it with new configs`),o["a"].set(G["a"],a,e)):o["a"].set(G["a"],G["a"].length,e);const s=e.value;for(const o in t)t[o].match(/\${(.+?)}/)&&(t[o]=t[o].replace(/\${(.+?)}/g,((e,t)=>t in i.a&&"string"===typeof i.a[t]?i.a[t]:e)));o["a"].set(z,s,t),"object"===typeof n&&o["a"].set(H,s,n),console.log("Successfully add new locale",e);const r=[...new Set(JSON.parse(localStorage.getItem(te.externals)||"[]"))];if(r.some((e=>e===s))||r.push(s),localStorage.setItem(te.externals,JSON.stringify(r)),localStorage.setItem(te.locale+s,JSON.stringify(e)),localStorage.setItem(te.trans+s,JSON.stringify(t)),n?localStorage.setItem(te.dtf+s,JSON.stringify(n)):localStorage.removeItem(te.dtf+s),ee&&"en-US"===ee.locale){const e=navigator.languages.map((e=>{const t=e.split("-");if(t.length<=2)return e;const n=t[0],o=t.pop();return[n,o].join("-")}));if(!e.includes(s))return console.log(`User prefer languages ${e.join(",")} does not includes ${s}`);console.log(`Automatically set locale to ${s}`),ee.locale=s,J["a"].dispatch("set",{language:s})}},oe=e=>{const t=G["a"].find((t=>t.value===e));if(-1===t)return console.warn(`Failed to remove locale ${e}: not found`);ee&&ee.locale===e&&(ee.locale="en-US"),G["a"].splice(t,1),o["a"].delete(z,e),o["a"].delete(H,e),console.log("Successfully remove locale",e);const n=JSON.parse(localStorage.getItem(te.externals)||"[]");n.includes(e)&&(n.splice(n.indexOf(e),1),localStorage.setItem(te.externals,JSON.stringify(n))),localStorage.removeItem(te.locale+e),localStorage.removeItem(te.trans+e),localStorage.removeItem(te.dtf+e)},ae=async()=>{const e=console.log.bind(console,"[Remote External I18n]");if(!i.a.externalI18n)return e("No external i18n url availabel");try{const t=e=>{let t=i.a.externalI18n;return t.endsWith("/")||(t+="/"),new URL(e,t).href};e(t("locales"));const{data:n}=await Y.a.get(t("locales"));if("string"!==typeof n)throw new Error(`Locale ${n} is not string`);e(`Fetch locales: ${n}`);const o=n.split("\n").map((t=>{const[n,...o]=t.replace(/#.*$/,"").split(" ");let a=o&&o.join(" ");return a||(a=n),n?{value:n,label:a}:(e(`No available locale in ${t}`),null)})).filter((e=>e));if(!o.length)return e(`No available external i18n from ${i.a.externalI18n}`);const a=o.map((async n=>{try{const{data:e}=await Y.a.get(t(`${n.value}/translations.json`)),{data:o}=await Y.a.get(t(`${n.value}/dateTimeFormat.json`)).catch((()=>({})));ne(n,e,o)}catch(o){e(`Failed to get ${n.label} ${n.value} from ${i.a.externalI18n}`)}}));if(await Promise.all(a),!ee)return;for(const s in ee.messages)X.includes(s)||o.find((e=>e.value===s))||(e("Remove locale since external locales file deleted it",s),oe(s))}catch(t){e(`Failed to get locales from ${i.a.externalI18n} since ${t.message||t}`)}},se=()=>{const e=localStorage.getItem(te.externals);if(!e)return console.log("No external i18n available");const t=JSON.parse(e);for(const o of t){const e=localStorage.getItem(te.locale+o),t=localStorage.getItem(te.trans+o),a=localStorage.getItem(te.dtf+o);if(e&&t)try{ne(JSON.parse(e),JSON.parse(t),a?JSON.parse(a):null)}catch(n){console.warn(`Failed to add locale ${o}:`,n.message)}else console.warn(`Failed to get local files for ${o}`,e,t)}};t["a"]=e=>{const{app:t}=e;t.i18n=ee,new(o["a"].extend({i18n:ee}))({beforeCreate(){const e=this.$q.notify;this.$q.notify=t=>{const n=e=>{try{const t=ee.messages[ee.locale];return Object.keys(t).includes(e)}catch(t){return console.log("Faild @ boot -> i18n",e,ee.locale,t),!1}};let o;return"string"===typeof t?o=e(n(t)?this.$t(t):t):(n(t.message)&&(t.message=this.$t(t.message,t.i18nData),delete t.i18nData),o=e(t)),o}},created(){se(),ae(),this.$watch((()=>ee.locale),(()=>{if(!ee.messages[ee.locale]){if(ee.locale===ee.fallbackLocale)return console.warn(`Failed to set locale to default[${ee.fallbackLocale}]`);ee.locale=ee.fallbackLocale}}))}})}},"19f3":function(e,t,n){},"1af1":function(e,t){const n={};e.exports=n},"1b99":function(e,t,n){"use strict";n("244a")},"1cda":function(e,t,n){"use strict";n("058f")},"1da1":function(e,t,n){},"1ef4":function(e,t,n){"use strict";(function(e){n("de6c"),n("a1c1");var o=n("fb31"),a=n.n(o);function s(t){return e.from(t,"utf-8").toString("hex")}function i(t){return e.from(t,"hex").toString("utf-8")}t["a"]={fromObject(e){const{protocolType:t,name:n,hash:o,data:s}=e,r=s.type||"channel";if("02"!==t)return null;const l=a.a.shortProtocol;return`${l}-library://${r}/${decodeURIComponent(n)}/${i(o)}`},toObject(e){if(console.log("lib toObj",e),!e.startsWith(a.a.shortProtocol+"-library://"))return null;const[t,n,o]=e.replace(a.a.shortProtocol+"-library://","").split("/"),i={};return"channel"!==t&&(i.type=t),{protocolType:"02",name:encodeURIComponent(n),hash:s(o),data:i}}}}).call(this,n("eb72").Buffer)},2:function(e,t){},20:function(e,t){},21:function(e,t){},"212e":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("de6c");var o=n("229c");function a(e){const t={};return n(),a((()=>{s({handleBatchItem(e){console.log("Analytics.send.batchItem:",e)},handleEndpoint:(e,t)=>{console.log(`Analytics.send: Endpoint(${e})`,t)},handleEvent:(t,n)=>{console.log(`Analytics.send: Event<${n.EventType}>(${t})`,n);const o=e.eventHandlers[n.EventType];o&&o(n,t)}})})),o["a"].$debug=function(){console.log("Analytics$debug:",{_config:o["a"]._config,pinpoint:t.pinpoint,pinpointClient:t.pinpointClient})},o["a"].$context=t,window.Analytics=o["a"],t;function n(){const e=o["a"]._pluggables.find((e=>"AWSPinpoint"===e.getProviderName()));Object.assign(t,{pinpoint:e})}function a(e){Object.defineProperty(t.pinpoint,"pinpointClient",{get(){return t.pinpointClient},set(n){t.pinpointClient=n,e(n)}})}function s({handleEndpoint:e,handleEvent:n,handleBatchItem:o}){const a=t.pinpointClient.send;t.pinpointClient.send=async function(){var s;const i=arguments[0].input;i.EndpointId&&e(i.EndpointId,i.EndpointRequest);const r=await t.pinpoint._config.endpointId,l=null===(s=i.EventsRequest)||void 0===s?void 0:s.BatchItem;if(l&&o(l),l&&l[r]){const{Endpoint:e,Events:t}=l[r];Object.entries(t).forEach((([e,t])=>{n(e,t)}))}return await a.apply(this,arguments)}}}},2163:function(e,t,n){"use strict";n("e836")},22:function(e,t){},2214:function(e,t,n){"use strict";n("0d10")},23:function(e,t){},2377:function(e,t,n){"use strict";n("d7f6")},24:function(e,t){},"244a":function(e,t,n){},25:function(e,t){},"25b9":function(e,t,n){},26:function(e,t){},27:function(e,t){},28:function(e,t){},"28c4":function(e,t,n){"use strict";n("df2b")},29:function(e,t){},"2b49":function(e,t,n){"use strict";var o=n("e74d");const a=()=>"electron"===o["a"]._config.oauth.app_env?"_blank":"_self";var s=e=>{const t=window.open(e,a());return t?Promise.resolve(t):Promise.reject()},i=e=>{let t="",n=e;const o="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(;n>0;--n)t+=o[Math.round(Math.random()*(o.length-1))];return t},r=(n("a1c1"),n("98fd")),l=n.n(r),c=n("b858"),d=n.n(c),u=e=>l()(e).toString(d.a).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");t["a"]={urlOpener:s,generateState:i,generateChallenge:u}},"2cab":function(e,t,n){"use strict";n("4d62")},"2cfd":function(e,t,n){},"2d55":function(e,t,n){},"2e22":function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return f}));n("de6c"),n("f18a");var o=n("5584"),a=n("d310"),s=(n("c49d"),n("36a1")),i=n("1926");const r=e=>new Promise((t=>{const n=setInterval((()=>{const o=e();void 0!==o&&(clearInterval(n),t(o))}),1e3)})),l={data(){return{previewImage:null}},computed:{showPreview:{set(e){this.previewImage=e||null},get(){return!!this.previewImage}}}},c={methods:{async initFilmRate(){const e=e=>{const t=new Date(e);if(!t||!t.valueOf())return;const n=Date.now();return t.setFullYear(t.getFullYear()+7),t.valueOf(){const e={type:"radio",model:"G"};e.items=[{label:i["b"].t("rate_g"),value:"G",tooltip:i["b"].t("rate_g_desc")},{label:i["b"].t("rate_pg"),value:"PG",tooltip:i["b"].t("rate_pg_desc")},{label:i["b"].t("rate_pg_13"),value:"PG-13",tooltip:i["b"].t("rate_pg_13_desc")},{label:i["b"].t("rate_r"),value:"R",tooltip:i["b"].t("rate_r_desc")},{label:i["b"].t("rate_nc_17"),value:"NC-17",tooltip:i["b"].t("rate_nc_17_desc")}];const t=this.$alphabiz.dialog({title:i["b"].t("set_film_rate"),message:i["b"].t("select_a_rate_before_enter"),options:e,ok:i["b"].t("ok")}),n=await t.promise("ok");if(n)return n.option},s=e=>{if(o["a"].dispatch("updateSettings",{libraryRate:e}),Object(a["isElectron"])()){const{ipcRenderer:t}=n("b052");t.send("set_settings",{libraryRate:e})}localStorage.setItem("set-film-rate",e)};if(localStorage.getItem("set-film-rate"))return;const l=await r((()=>{if(o["a"].getters.accountUserInfo&&o["a"].getters.accountUserInfo.sub)return o["a"].getters.accountUserInfo.birthday||null}));let c=e(l);c||(c=await t()),s(c)}},async activated(){await this.initFilmRate()}},d=(...e)=>console.tag.blue("Channel",...e),u=(...e)=>console.tag.blue("Post",...e),h={data(){return{loader$loadedChannels:{}}},created(){this.$watch("followingChannels",(e=>{let t=!1;Object.keys(this.loader$loadedChannels).forEach((n=>{e.some((e=>e.id===n))||(delete this.loader$loadedChannels[n],t=!0)})),t&&(this.loader$loadedChannels=Object.assign({},this.loader$loadedChannels))}),{immediate:!0,deep:!0})},computed:{loader$toLoadChannels(){const e=this.followingChannels;return console.log(e),e.filter((e=>!(!e.title||!e.id)&&!this.loader$loadedChannels[e.id])).reduce(((e,t)=>(e[t.id]=t,e)),{})}},methods:{async loader$enableChannelsLoader({onLoaded:e},t){const n=async({onChannelLoaded:e,onChannelUpdated:t})=>{const n=Object.values(this.loader$toLoadChannels);await Promise.all(n.map((async n=>{await new Promise((e=>setTimeout(e,Math.round(2e3*Math.random()))));const o=await s["a"].getChannelPostIds(n.id,!0);if(!this.loaderEnabled)return;const a=this.loader$loadedChannels[n.id];a?a.ids=o:this.loader$loadedChannels[n.id]={channel:n,ids:o},this.loader$loadedChannels=Object.assign({},this.loader$loadedChannels),await(a?t:e)(n.id)})))},o=()=>({toLoadCount:Object.keys(this.loader$toLoadChannels).length,loadedCount:Object.keys(this.loader$loadedChannels).length}),a=e=>new Promise((t=>setTimeout(t,e)));let i=!0;while(this.loaderEnabled){const s=o();if(!s.toLoadCount){if(i){e(!0),i=!1;continue}await a(t);continue}if(await n({onChannelLoaded:async e=>{if(!this.loaderEnabled)return;const{loadedCount:t,toLoadCount:n}=o(),a=`${t}/${t+n}`;d("onLoaded",a).log(e)},onChannelUpdated:async e=>{this.loaderEnabled&&d("onUpdated").log(e)}}),!this.loaderEnabled)break;const r=o();r.toLoadCount||(e(i),i=!1,await a(t))}}}},p={data(){return{loader$loadedPosts:{}}},computed:{loader$toLoadPosts(){return Object.values(this.loader$loadedChannels).map((({channel:e,ids:t})=>t.map((t=>({id:t,channelId:e.id}))))).flat(1).reduce(((e,t)=>(this.loader$loadedPosts[t.id]||(e[t.id]=t),e)),{})},loader$toLoadPostIdListSorted(){const e=(e,t)=>e&&t?e.localeCompare(t):0;return Object.values(this.loader$loadedChannels).map((({ids:e})=>e.filter((e=>!this.loader$loadedPosts[e])))).flat(1).sort(e)}},methods:{async loader$loadPosts({count:e},{onPostsLoaded:t}){const n=async e=>{const{id:t,channelId:n}=e,o=this.loader$loadedChannels[n].channel,a=await s["a"].getPostById(n,t,!0);return a?(a.channel=o,a):null},o=e=>this.loader$toLoadPostIdListSorted.length?this.loader$toLoadPostIdListSorted.slice(0,e).map((e=>this.loader$toLoadPosts[e])):null,a=o(e);if(!a)return;const i=await Promise.all(a.map((async e=>{const t=await n(e);return t?{success:!0,post:t}:{success:!1,target:e}}))),r=i.filter((e=>e.success)).map((e=>e.post));return r.length&&(r.forEach((e=>{this.loader$loadedPosts[e.id]=e})),this.loader$loadedPosts=Object.assign({},this.loader$loadedPosts),await t(r)),i},async loader$loadPostsNext({count:e}={}){if(!Object.keys(this.loader$toLoadPosts).length)return;if("loaded"!==this.loaderState)return;this.loaderState="fetching",await new Promise((e=>setTimeout(e,1e3)));const t=async()=>{const e=()=>({toLoadCount:Object.keys(this.loader$toLoadPosts).length,loadedCount:Object.keys(this.loader$loadedPosts).length}),{loadedCount:t,toLoadCount:n}=e(),o=`${t}/${t+n}`;u("onLoaded",o).log()};await this.loader$loadPosts({count:e},{onPostsLoaded:t}),this.loaderState="loaded"},async loader$initPostLoader({initialCount:e}={},{onPostsLoaded:t}={}){var n;null!==(n=e)&&void 0!==n||(e=24),t=async()=>{const e=()=>({toLoadCount:Object.keys(this.loader$toLoadPosts).length,loadedCount:Object.keys(this.loader$loadedPosts).length}),{loadedCount:t,toLoadCount:n}=e(),o=`${t}/${t+n}`;u("onLoaded",o).log()};const o=e=>new Promise((t=>setTimeout(t,e))),a=()=>({toLoadCount:Object.keys(this.loader$toLoadPosts).length,loadedCount:Object.keys(this.loader$loadedPosts).length}),s=()=>{const{toLoadCount:t,loadedCount:n}=a();return n&&(0===t||n>=e)};let i=!0;while(!s())await this.loader$loadPosts({count:10},{onPostsLoaded:t}),i?i=!1:await o(Math.round(3e3*Math.random()));u().log("loaded")}}},m={mixins:[h,p],data(){return{loaderState:"stopped"}},computed:{loaderEnabled(){return["loading","fetching","loaded","timeout"].includes(this.loaderState)}},created(){this.$watch("loaderState",((e,t)=>{const n={red:["timeout"]},o=Object.keys(n).find((t=>n[t].includes(e))),a=console.tag[o||"blue"]("State"),s={loading:"loading...",timeout:"timeout, maybe network error",fetching:"fetching next post slice",loaded:()=>{const e={loading:"loaded",timeout:"loaded but timeout"};return e[t]}};let i=s[e];"function"===typeof i&&(i=i()),i?a.log(i):a.log()}))},methods:{async enableLoader(){const e=e=>new Promise((t=>setTimeout(t,e))),t=async(t,n,o)=>{let a,s=!1;return await Promise.race([t.then((e=>{s=!0,a=e})),e(n).then((()=>{s||o&&(a=o())}))]),a};if(this.loaderEnabled)return;this.loaderState="loading";const n=6e4,o=async()=>{await new Promise((e=>this.loader$enableChannelsLoader({onLoaded:t=>{d().log(t?"loaded":"updated"),e(!0)}},1e4))),await this.loader$initPostLoader()},a=e=>{this.loaderEnabled&&(this.loaderState=e?"timeout":"loaded")};await t((async()=>{await o(),a(!1)})(),n,(()=>{a(!0)}))},async disableLoader(){this.loaderEnabled&&(this.loaderState="stopped")}}},_={methods:{loader$dialog(){const e=this.$alphabiz.dialog({title:i["b"].t("no_available_post"),message:i["b"].t("following_channel_no_post"),cancel:i["b"].t("cancel"),ok:i["b"].t("lib_explore")});return e.promise("ok").then((e=>{e&&(o["a"].getters.settings.libraryShowExplore||o["a"].dispatch("set",{libraryShowExplore:!0}),this.$root.$emit("navigate-to","/library/explore"),this.$router.push("/library/explore"))})),e}}},f={mixins:[m,_],computed:{loadedPosts(){return this.loader$loadedPosts}},created(){let e;this.$watch("loaderState",(t=>{if("timeout"===t);else{if(!e)return;try{e.hide()}catch(n){}finally{e=null}}}))},async activated(){const e=()=>{const e=Object.values(this.loader$loadedChannels).map((({ids:e})=>e)).flat(1),t=Object.keys(this.loader$loadedPosts).filter((t=>!e.includes(t)));t.forEach((e=>{delete this.loader$loadedPosts[e]})),t.length&&(this.loader$loadedPosts=Object.assign({},this.loader$loadedPosts))};e(),await s["a"].whenReady,this.enableLoader()},deactivated(){this.disableLoader()}}},"2e34":function(e,t,n){"use strict";n("3e69")},"2e69":function(e,t,n){"use strict";n("30c9")},3:function(e,t){},30:function(e,t){},3061:function(e,t,n){"use strict";n("aa59")},"30c9":function(e,t,n){},31:function(e,t){},32:function(e,t){},"326b":function(e,t,n){},33:function(e,t){},3334:function(e,t,n){"use strict";n.r(t),n.d(t,"getCurrentUser",(function(){return o})),n.d(t,"getCurrentExpenses",(function(){return a})),n.d(t,"getCurrentIncome",(function(){return s})),n.d(t,"getTransactionById",(function(){return i})),n.d(t,"getUser",(function(){return r})),n.d(t,"listUsers",(function(){return l})),n.d(t,"getInvitation",(function(){return c})),n.d(t,"listInvitations",(function(){return d})),n.d(t,"queryInvitationsByInviterId",(function(){return u})),n.d(t,"getMessageTimer",(function(){return h})),n.d(t,"listMessageTimers",(function(){return p})),n.d(t,"getTransaction",(function(){return m})),n.d(t,"listTransactions",(function(){return _})),n.d(t,"queryTransactionsByPayerId",(function(){return f})),n.d(t,"queryTransactionsByPayeeId",(function(){return g})),n.d(t,"getTask",(function(){return b})),n.d(t,"listTasks",(function(){return y})),n.d(t,"queryTasksByMember",(function(){return v})),n.d(t,"queryTaskByCategory",(function(){return w})),n.d(t,"getProvidentFund",(function(){return k})),n.d(t,"listProvidentFunds",(function(){return C}));const o="\n query GetCurrentUser {\n getCurrentUser {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",a="\n query GetCurrentExpenses($nextToken: String, $params: String) {\n getCurrentExpenses(nextToken: $nextToken, params: $params) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",s="\n query GetCurrentIncome($nextToken: String, $params: String) {\n getCurrentIncome(nextToken: $nextToken, params: $params) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",i="\n query GetTransactionById($id: String) {\n getTransactionById(id: $id) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",r="\n query GetUser($id: ID!) {\n getUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",l="\n query ListUsers(\n $filter: ModelUserFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listUsers(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n credit\n username\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n",c="\n query GetInvitation($id: ID!) {\n getInvitation(id: $id) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",d="\n query ListInvitations(\n $filter: ModelInvitationFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listInvitations(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n",u="\n query QueryInvitationsByInviterId(\n $inviterId: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelInvitationFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryInvitationsByInviterId(\n inviterId: $inviterId\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n",h="\n query GetMessageTimer($id: ID!) {\n getMessageTimer(id: $id) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",p="\n query ListMessageTimers(\n $filter: ModelMessageTimerFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listMessageTimers(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n times\n updatedAt\n createdAt\n }\n nextToken\n }\n }\n",m="\n query GetTransaction($id: ID!) {\n getTransaction(id: $id) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",_="\n query ListTransactions(\n $filter: ModelTransactionFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listTransactions(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",f="\n query QueryTransactionsByPayerId(\n $payerId: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTransactionFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTransactionsByPayerId(\n payerId: $payerId\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",g="\n query QueryTransactionsByPayeeId(\n $payeeId: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTransactionFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTransactionsByPayeeId(\n payeeId: $payeeId\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",b="\n query GetTask($id: ID!) {\n getTask(id: $id) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",y="\n query ListTasks(\n $filter: ModelTaskFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listTasks(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",v="\n query QueryTasksByMember(\n $member: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTaskFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTasksByMember(\n member: $member\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",w="\n query QueryTaskByCategory(\n $category: TaskCategory\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTaskFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTaskByCategory(\n category: $category\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",k="\n query GetProvidentFund($id: ID!) {\n getProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",C="\n query ListProvidentFunds(\n $filter: ModelProvidentFundFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listProvidentFunds(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n amount\n updatedAt\n createdAt\n }\n nextToken\n }\n }\n"},3361:function(e,t,n){},34:function(e,t){},3408:function(e,t,n){"use strict";n("8306")},35:function(e,t){},36:function(e,t){},3669:function(e,t,n){"use strict";n("c7ce")},"36a1":function(e,t,n){"use strict";n.d(t,"a",(function(){return V}));var o=n("ff9b"),a=n("2d62"),s=n("d7df"),i=n("5515"),r=n("f680"),l=n("5584"),c=n("1926"),d=n("c49d"),u=n("3aea"),h=(n("d4b5"),n("de6c"),n("0598")),p=n("9ad5"),m=n.n(p),_=n("a3fc"),f=n("61af"),g=n("d710"),b=n.n(g);const{github:y}=g["update"],v=e=>g["takedown"].admins.includes(e),w="Serious Violation",k="Copyright Disputes",C="Adults Only",$=()=>{const e=Object(h["default"])()?require("developer/take-down.json"):n("9445");return e},S=$(),x=()=>{if(!Object(h["default"])())return null;const{app:e}=n("3be9"),t=e.getPath("userData");if(!t)return null;const o=Object(_["resolve"])(t,"config/take-down.json");return Object(f["existsSync"])(o)?JSON.parse(Object(f["readFileSync"])(o)):null},T=async()=>{const e=`https://raw.githubusercontent.com/${y.username}/${y.repo}/${y.branch}/developer/take-down.json`,{data:t}=await m.a.get(e).catch((()=>({data:null})));return t},I=async()=>{let e=await T();if(console.log("get from remote",e),Object(h["default"])()&&e){const{app:t}=n("3be9"),o=t.getPath("userData");if(!o)return;const a=Object(_["resolve"])(o,"config/take-down.json");Object(f["writeFileSync"])(a,JSON.stringify(e,null,2))}if(e||(e=x(),console.log("get from saved",e)),e&&"object"===typeof e)for(const t in S)S[t].splice(0,S[t].length,...e[t])},P=()=>S,O={users:[],channels:[],posts:[]};let q=!1;const E=()=>O,A=()=>{if(q)return;q=!0;const{admins:e,mode:t}=g["takedown"],n="admin"===t?0:Math.ceil(e.length/2+.5),o=[],s=()=>{console.log("update extra list",o);const e={users:[],channels:[],posts:[]};o.forEach((({id:o,admins:a,reason:s})=>{const[i,r]=o.split("|");if(!i||!r||!e[i])return;const l={id:r,reason:s,admins:a,mode:t,minCount:n};e[i].find((e=>e.id===r))||e[i].push(l)}));for(const t in e)O[t].splice(0,O[t].length,...e[t])},i=()=>{s()},r=(e="",t={})=>{for(const a in t){const s=t[a],i=o.find((e=>e.id===a));if(i)s&&[w,k,C].includes(s)?i.admins.includes(e)||i.admins.push(e):i.admins.includes(e)&&(i.admins.splice(i.admins.indexOf(e),1),0===i.admins.length&&o.splice(o.indexOf(i),1));else{if(!s)continue;if(![w,k,C].includes(s))continue;o.push({id:a,admins:[e],reason:s,minCount:n})}}i()};e.forEach((e=>{console.log("add admin",e),a["v"].user(e).get("takedowns").on((t=>{r(e,t)}))}))};n("7a76"),n("0c26");var D=n("0f0c"),N=n("8097"),L=async()=>{const e=j();console.tag.orange("recommends","urls").log(e);const{data:t,url:n}=await new Promise((async t=>{for(const n of e){const e=await R(n);if(e){t({data:e,url:n});break}}}));return console.tag.orange("recommends","got").log({url:n,data:t}),t};function j(){const e={version:Object(D["a"])("version"),buildTime:Object(D["a"])("buildTime")},t=(()=>{try{return"web"===e.version.split("-")[1]}catch{return!1}})(),n=[`${g["homepage"]}/recommends/v${e.version}.txt`,`${g["homepage"]}/recommends/v${e.version.split("-")[0]}.txt`,`${g["homepage"]}/recommends/recommends.txt`,"recommends.txt"];return t?n.splice(1,2):Object(N["a"])()&&n.unshift(`${g["homepage"]}/recommends/store/v${e.version}.txt`,`${g["homepage"]}/recommends/store/v${e.version.split("-")[0]}.txt`,`${g["homepage"]}/recommends/store/recommends.txt`),Array.from(new Set(n))}async function R(e){const t=async()=>{const t=await fetch(e);if(!t.ok||200!==t.status)return console.tag.orange("recommends","fetch").warn(t.statusText),null;try{const e=await t.text();return U(e)}catch{return null}},n=async o=>{try{return o.count&&console.tag.orange("recommends","fetch:retry",o.count).log(e),await t()}catch(a){if(a instanceof TypeError)return await new Promise((e=>setTimeout(e,1e3))),o.count+=1,await n(o);throw a}};return await n({count:0})}function U(e){if("string"!==typeof e)throw console.tag.orange("recommends","parse").error("Cannot parse data as string",e),new Error("Cannot parse data as string");const t=e.split("\n").map((e=>{var t;return null===(t=e.trim().split(" "))||void 0===t?void 0:t[0]})).filter((e=>e.match(/^[a-z0-9]{20}$/)));return t}var F=n("1738"),M=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};let B=Date.now();s["a"].on("library-db",(e=>M(void 0,void 0,void 0,(function*(){e&&(setTimeout((()=>Object(i["b"])(e)),3e3),setTimeout((()=>Object(i["b"])(e)),3e4),setTimeout((()=>Object(i["b"])(e)),6e4))})))),s["a"].emit("library-db");let Q=!1;Object.defineProperty(globalThis,"verb",{get(){return Q},set(e){Q=e}}),Object.defineProperty(globalThis,"eventBus",{get(){return a["i"]}});const W=["G","PG","PG-13","R","NC-17"];let z=()=>{},H=null;const V=new o["a"]({data(){return{user:null,ownedChannels:[],ownedChannelInstances:[],ownedChannelMap:new Map,followingChannels:[],showRecommend:!1,recommendPage:0,recommendIdList:[],allChannelList:[],online:!1,onlineStatus:"connecting",gunPeers:[],channelFollowerCount:{},libStatus:"init",whenReady:new Promise((e=>{let t=!1;z=()=>{t||(t=!0,F["a"].send("library_init",{cost:Date.now()-B}),e())}})),search:{text:"",option:{label:"",value:""},options:[]},currentCreator:{name:"",description:"",avatar:"",id:"",channels:[]},currentUserFromGun:null,userData:{},takedownList:{users:[],channels:[],posts:[]},takedownExtraList:{users:[],channels:[],posts:[]},isLibAdmin:!1,isFirstRegister:!1}},computed:{allowAdults(){return"NC-17"===l["a"].state.setting.libraryRate},username(){return this.userData&&"string"===typeof this.userData.name?this.userData.name:"("+c["b"].t("loading")+")"},bannedUsers(){const e=[];return[this.takedownList,this.takedownExtraList].forEach((t=>{t.users.forEach((({id:t,reason:n,mode:o,admins:a,minCount:s})=>{"committee"===o&&a.length{t.channels.forEach((({id:t,reason:n,mode:o,admins:a,minCount:s})=>{"committee"===o&&a.length{t.posts.forEach((({id:t,reason:n,mode:o,admins:a,minCount:s})=>{"committee"===o&&a.length{if(t.id){if(e.includes(t.id))return!1;if(e.push(t.id),this.isBannedChannel(t))return!1}return t.title&&(t.creator||t.soul)}))},nonBlockFollowingChannels(){const{blockChannels:e,blockUsers:t}=this.userData;return e&&t?this.followingChannels.filter((n=>!(!n.id||!n.title)&&(!e.includes(n.id)&&!t.includes(n.creator)))):[]},isLoggedIn(){return!!this.user&&("ready"===this.libStatus&&!(!this.user.is||!this.user.is.pub))},sortedChannel(){return this.channelList},filteredChannels(){if(console.log("trigger filter channel"),"channel"!==this.search.option.label)return this.sortedChannel;const e=this.search.text;return this.sortedChannel.filter((t=>{var n;return!!t&&(t.title.toLowerCase().includes(e)||(null===(n=t.id)||void 0===n?void 0:n.includes(e)))}))},recommendChannels(){const e=5,t=this.filteredChannels.length,n=Math.ceil(t/e);while(this.recommendPage>n)this.recommendPage-=n;const o=[],a=this.recommendPage*e;for(let s=0;s<5;s++){const e=a+s;this.filteredChannels[e]&&!this.followingChannels.some((t=>t.id===this.filteredChannels[e].id))&&o.push(this.filteredChannels[e])}return o},addedPostMap(){const e=Object.create(null);for(const t in l["a"].getters.abKeys){const n=l["a"].getters.abKeys[t];n.forEach((n=>{e[n.key]={type:t,infoHash:n.infoHash,playFile:n.playFile}}))}return e}},methods:{register(e,t,n){return M(this,void 0,void 0,(function*(){this.isFirstRegister=!0,yield this.logout();const o=yield Object(a["z"])(e,t,n);return Object(i["c"])(),o}))},login(e){return M(this,void 0,void 0,(function*(){return this.isLibAdmin=!1,this.isLoggedIn?(console.log("should logged out",this.user),Object(a["x"])(),yield new Promise((e=>setTimeout(e,1e3))),this.user=null,console.log("relogin"),this.login(e)):(setTimeout((()=>{!this.followingChannels.length&&this.isLoggedIn&&this.updateFollow()}),1e4),Object(a["w"])(e))}))},logout(){return M(this,void 0,void 0,(function*(){this.isLibAdmin=!1,Object(a["x"])(),yield new Promise((e=>setTimeout(e,1e3))),this.user=null,this.userData={blockChannels:[],blockUsers:[]},this.followingChannels=[],this.ownedChannels=[]}))},prepareData(){var e;return M(this,void 0,void 0,(function*(){if(console.log("prepare data"),this.updateRecommends(),this.user=Object(a["u"])(),this.userData=Object(a["t"])().data,!this.user._||!this.user._.sea)throw new Error("User is not logged in");localStorage.setItem(`library-pair@${a["e"]}`,JSON.stringify(this.user._.sea)),this.isLibAdmin=v(null===(e=this.user.is)||void 0===e?void 0:e.pub),this.$emit("logged-in"),this.libStatus="fetch",yield this.getAllChannels(),this.updateOwn(),console.time("> lib: get private data"),yield this.updateFollow(),console.timeEnd("> lib: get private data"),this.libStatus="ready",z(),A(),this.takedownList=P(),this.takedownExtraList=E(),console.log("Takedown list:",this.takedownList)}))},isBannedChannel(e){return!!this.bannedUsers.includes(e.creator)||!!this.bannedChannels.includes(e.id)},isBannedPost(e){return!!this.bannedPosts.includes(e.id)},isValidRate(e){const t=l["a"].getters.settings.libraryRate,n=W.indexOf(e),o=W.indexOf(t);return n<=o},getAllChannels(){return M(this,void 0,void 0,(function*(){return H||(H=new Promise((e=>M(this,void 0,void 0,(function*(){const t=yield Object(a["k"])();if(t===this.allChannelList)return e();Object(d["a"])("get channel list",t,t.length),this.$set(this,"allChannelList",t),e()})))),H)}))},getRandomChannels(e,t){const n=this.followingChannels.map((e=>e.id)),o=(0===this.recommendIdList.length?this.channelList:this.recommendIdList.map((e=>this.channelList.find((t=>t.id===e))))).filter((e=>e&&!n.includes(e.id))),a=o.filter((e=>!e.hidden&&(!Array.isArray(t)||!t.includes(e.id))));if(0===a.length&&l["a"].getters.settings.libraryShowAllChannels){const e=this.channelList.filter((e=>!e.hidden&&(!!this.recommendIdList.includes(e.id)&&(!Array.isArray(t)||!t.includes(e.id)))));e.length&&a.push(...e)}if(a.length<=e)return a;for(let s=a.length-1;s>0;s--){const e=Math.floor(Math.random()*(s+1));[a[s],a[e]]=[a[e],a[s]]}if(b.a.library.recommends){const e=navigator.language,t=b.a.library.recommends[e]||b.a.library.recommends.default;if(t.length)for(let n=0;n(Object(d["a"])("Created new channel",e.id,e),V.allChannelList.find((t=>!!t.id&&t.id===e.id))||e.id&&V.allChannelList.push(e),setTimeout((()=>{Object(a["j"])(e.id).then((e=>{Object(i["c"])()}))}),1e3),e)))):null}))},editChannel(e,t){return M(this,void 0,void 0,(function*(){const n=yield Object(a["f"])(e,t);return Object(i["c"])(),n}))},removeChannel(e){return M(this,void 0,void 0,(function*(){const t=yield Object(a["A"])(e).then((t=>(Object(d["a"])("Removed",t,e),setTimeout((()=>Object(a["A"])(e)),1e3),t)));return Object(i["c"])(),t}))},createPost(e,t){return M(this,void 0,void 0,(function*(){if(!this.isLoggedIn)return null;const n=yield Object(a["b"])(t,e);return Object(i["c"])(),V.getChannelPosts(t,!1).then((t=>{t.find((t=>!!t.id&&t.id===e.id))||e.id&&t.push(e)})),n}))},addPosts(e,t){return M(this,void 0,void 0,(function*(){const n=yield Object(a["c"])(t,e);return Object(i["c"])(),n}))},editPost(e,t,n){return M(this,void 0,void 0,(function*(){const o=yield Object(a["g"])(e,t,n);return Object(i["c"])(),o}))},removePost(e,t){return M(this,void 0,void 0,(function*(){const n=yield Object(a["B"])(t,e);return Object(i["c"])(),n}))},getChannelById(e){return Object(a["l"])(e)},getChannelPosts(e,t){return M(this,void 0,void 0,(function*(){return Object(a["o"])(e,t||!1)}))},getChannelPostIds(e,t){return M(this,void 0,void 0,(function*(){return Object(a["q"])(e,t||!1)}))},getPostById(e,t,n){return M(this,void 0,void 0,(function*(){return Object(a["p"])(e,t,n)}))},followChannel(e){return M(this,void 0,void 0,(function*(){Object(d["a"])("lib: follow",e);const t=yield Promise.race([new Promise((t=>{setTimeout((()=>{this.followingChannels.some((t=>t.id===e))?t(null):Object(a["j"])(e).then(t)}),1500)})),Object(a["j"])(e)]);return this.isFirstRegister=!1,Object(i["c"])(),t}))},unfollowChannel(e){return M(this,void 0,void 0,(function*(){Object(d["a"])("lib: unfollow",e);const t=yield Object(a["E"])(e);return Object(i["c"])(),t}))},blockChannel(e){return Object(a["d"])("channel",e)},blockUser(e){return Object(a["d"])("user",e)},unblockChannel(e){return Object(a["D"])("channel",e)},unblockUser(e){return Object(a["D"])("user",e)},takedown(e,t,n){return M(this,void 0,void 0,(function*(){const o=yield Object(a["C"])(e,t,n);return console.log("Takedown result",o),o}))},setSearchOption(e){this.search.options=e,this.search.text="",e.length&&(this.search.option=e[0])},todo(e){r["a"].create(`Incomplete. info: ${e}`)}},created(){setTimeout((()=>{this.getAllChannels(),this.updateRecommends()}),2e3),I();const e=new Set;console.log("[lib] created"),Object(d["b"])((t=>{e.has(t)||Object(i["a"])(t)}));const t=new Set;setInterval((()=>{var e,n;const o=Object.values(a["v"]._.opt.peers);let s=!1;if(o.length){for(const t of o)if((null===(e=null===t||void 0===t?void 0:t.wire)||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&(this.online=!0,this.onlineStatus="connected",s=!0),t.wire instanceof WebSocket){const e={type:"ws",url:t.url,status:(null===(n=t.wire)||void 0===n?void 0:n.readyState)||0},o=this.gunPeers.findIndex((t=>t.url===e.url));-1!==o?this.$set(this.gunPeers,o,e):this.gunPeers.push(e)}this.gunPeers.forEach((e=>{"wrtc"!==e.type&&(o.find((t=>t.url===e.url||t.id===e.url))||this.$set(e,"status",WebSocket.CLOSED))}))}else this.online=!1,"connected"===this.onlineStatus&&(this.onlineStatus="reconnecting");Object.values(i["d"]).forEach((e=>{var t;const n={closed:WebSocket.CLOSED,connected:WebSocket.OPEN,connecting:WebSocket.CONNECTING,disconnected:WebSocket.CLOSED,failed:WebSocket.CLOSED,new:WebSocket.CONNECTING}[e.connectionState];n===WebSocket.OPEN&&(s=!0);const o={type:"wrtc",url:e.id,from:e._from,status:n,statusText:e.connectionState,label:Object(u["f"])((null===(t=e.remoteDescription)||void 0===t?void 0:t.sdp)||""),syncState:e.syncState,remoteSyncState:e.remoteSyncState,downloaded:e.downloaded,downloadSpeed:e.downloadSpeed,uploaded:e.uploaded,uploadSpeed:e.uploadSpeed},a=this.gunPeers.findIndex((e=>e.url===o.url));-1!==a?this.$set(this.gunPeers,a,o):this.gunPeers.push(o)}));for(let a=0;a0},attrs:{rounded:"",color:"primary",icon:e.selected.length?"star":void 0,label:e.selected.length?e.$t("follow_channels_and_continue",[e.selected.length]):e.$t("follow_any_channel_to_continue"),disable:!e.selected.length},on:{click:e.onFollow}}),n("q-btn",{staticClass:"action-btn q-px-sm q-mr-xl",attrs:{rounded:"",color:"primary",icon:"refresh",label:e.$t("show_more_for_me")},on:{click:e.loadMore}})],1)],2)])},a=[],s=(n("de6c"),n("fb31")),i=n.n(s),r=n("36a1"),l={name:"LibraryRecommend",props:{fullscreen:Boolean},data(){return{initTimer:null,badImage:[],recommends:[],selected:[],lib:r["a"]}},computed:{autoSelectIds(){const e=navigator.language,t=i.a.library.recommends;return t[e]?t[e]:t.default},followings(){return r["a"].followingChannels.map((e=>e.id))},filteredRecommends(){const e=r["a"].recommendIdList.length?this.recommends.filter((e=>r["a"].recommendIdList.includes(e.id))):this.recommends;if(!r["a"].userData)return e;const{blockChannels:t,blockUsers:n}=r["a"].userData;return t&&n?e.filter(((o,a)=>e.findIndex((e=>e.id===o.id))===a&&!t.includes(o.id)&&!n.includes(o.creator))):e}},watch:{filteredRecommends(e){if(this.autoSelectIds.length)for(const t of this.autoSelectIds)!this.selected.includes(t)&&e.find((e=>e.id===t))&&this.selected.push(t)}},methods:{async initRecommends(){this.getRecommends(),this.$root.$emit("navigate-to"),this.$nextTick((()=>{if(this.autoSelectIds.length)for(const e of this.autoSelectIds)!this.selected.includes(e)&&this.filteredRecommends.find((t=>t.id===e))&&this.selected.push(e)}))},getRecommends(){const e=this.lib.getRandomChannels(5);this.recommends.splice(0,5,...e),0===e.length&&setTimeout((()=>{this.getRecommends()}),2e3)},loadMore(){const e=this.lib.getRandomChannels(6,this.recommends.map((e=>e.id)));if(!e.length)return this.$q.dialog({message:this.$t("no_more_recommend"),ok:this.$t("ok")});this.recommends.push(...e),this.$nextTick((()=>{if(this.autoSelectIds.length)for(const t of this.autoSelectIds)!this.selected.includes(t)&&e.find((e=>e.id===t))&&this.selected.push(t)}))},select(e){this.selected.includes(e)?this.selected.splice(this.selected.indexOf(e),1):this.selected.push(e)},onFollow(){for(const e of this.selected)r["a"].followChannel(e);this.selected.splice(0),this.autoSelectIds.length&&setTimeout((()=>{for(const e of this.autoSelectIds)!this.selected.includes(e)&&this.filteredRecommends.find((t=>t.id===e))&&this.selected.push(e)}),5e3)},onImageError(e){this.badImage.push(e)},onImageLoaded(e){-1!==this.badImage.indexOf(e)&&this.badImage.splice(this.badImage.indexOf(e),1)}},mounted(){const e=()=>{var t;"signedIn"===(null===(t=this.$store.state.account)||void 0===t?void 0:t.authState)?this.initTimer=setTimeout((()=>{this.initRecommends()}),500):this.initTimer=setTimeout(e,1e3)};e()},beforeDestroy(){clearTimeout(this.initTimer)}},c=l,d=(n("7895"),n("2b5f")),u=n("e586"),h=n("d7c7"),p=n("f106"),m=n("1043"),_=n("4101"),f=n("09a4"),g=n.n(f),b=Object(d["a"])(c,o,a,!1,null,"0d732dc4",null);t["a"]=b.exports;g()(b,"components",{QCard:u["a"],QCardSection:h["a"],QIcon:p["a"],QBtn:m["a"],QColor:_["a"]})},37:function(e,t){},"38d2":function(e,t,n){},"39df":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"development-container",class:{large:e.isElectron}},[n("q-card",{attrs:{flat:"",square:""}},[n("q-tabs",{attrs:{align:"left","no-caps":"","narrow-indicator":""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},e._l(e.tabs,(function(t){return n("q-tab",e._b({key:t.name},"q-tab",t,!1))})),1),n("q-separator"),n("q-tab-panels",{staticClass:"panels",attrs:{animated:""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},[n("q-tab-panel",{attrs:{name:"BasicPanel"}},[n("BasicPanel")],1),n("q-tab-panel",{attrs:{name:"accountInfo"}},[n("account-tab-panel")],1),n("q-tab-panel",{attrs:{name:"amplify"}},[n("amplify-tab-panel")],1),n("q-tab-panel",{attrs:{name:"devInfo"}},[n("dev-info-tab-panel")],1),n("q-tab-panel",{attrs:{name:"capacitorTest"}},[n("CapacitorTest")],1),n("q-tab-panel",{attrs:{name:"urlConvert"}},[n("url-convert")],1),n("q-tab-panel",{attrs:{name:"libraryData"}},[n("library-data")],1),n("q-tab-panel",{attrs:{name:"libraryPreload"}},[n("LibraryPreload")],1),n("q-tab-panel",{attrs:{name:"payment_mode"}},[n("payment-mode")],1),n("q-tab-panel",{attrs:{name:"theme_panel"}},[n("ThemeTabPanel")],1)],1)],1)],1)},a=[],s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"panel"},e._l(e.handlersData,(function(t){var o=t[0],a=t[1];return n("q-btn",e._b({key:o.key,attrs:{"no-caps":"",unelevated:""},on:{click:a}},"q-btn",o,!1))})),1),n("q-separator"),n("q-card-section",[n("div",{staticClass:"text-h6 text-bold"},[e._v("Dynamic Config")]),n("div",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(JSON.stringify(e.d$cfg,null,2)))])]),n("q-separator"),n("q-card-section")],1)},i=[],r=(n("de6c"),n("a1c1"),n("91ab")),l=n("d310");const c=n("d310").isElectron();var d={name:"BasicPanel",data(){return{handlers:[[{color:"positive",icon:"bug_report"},this.openWebtorrentDevTools],[{color:"positive",icon:"refresh"},this.reloadWebTorrent],[{color:"negative",icon:"delete_forever"},this.delete_config],[{color:"negative",icon:"delete"},this.clearBlockchainConfig],this.getUsersLanguage,this.getVueLocale,this.getLocale]}},computed:{handlersData(){return this.handlers.map((e=>Array.isArray(e)?e:[{},e])).map((([e,t])=>{e=Object.assign({key:t.name.substring(6),label:Object(r["a"])(t.name.substring(6)).replace(/-/g," "),color:"general",textColor:e.color||"general"},e);const n=async()=>{const e=t();e&&e.then&&await e};return[e,n]}))}},methods:{delete_config(){this.$q.electron.ipcRenderer.invoke("deleteConfig").then((e=>{this.$q.notify(e)}))},getLocale(){this.$q.notify(this.$q.lang.getLocale())},getVueLocale(){this.$q.notify(this.$i18n.locale)},getUsersLanguage(){l["localConfigs"].getSettingsItem("language").then((e=>{this.$q.notify({message:e,position:"bottom-right",type:"positive",timeout:3e3})})).catch((()=>{this.$q.notify({message:"未获取到数据项",position:"bottom-right",type:"negative",timeout:3e3})}))},openWebtorrentDevTools(){if(c)return n("b052").ipcRenderer.send("open-webtorrent-devtools")},reloadWebTorrent(){c&&(n("b052").ipcRenderer.send("reload-webtorrent-window"),this.$q.notify("WebTorrent window is reloaded"))},async clearBlockchainConfig(){await new Promise((e=>setTimeout(e,2e3))),await window.$blockchain.$store.account.deleteCurrentAccount(),localStorage.removeItem("blockchain.network");const e=window.$blockchain.network.getNetworkConfig();window.$blockchain.network.updateNetworkConfig(e),location.reload()}}},u=d,h=(n("bc42"),n("2b5f")),p=n("1043"),m=n("fc38"),_=n("d7c7"),f=n("09a4"),g=n.n(f),b=Object(h["a"])(u,s,i,!1,null,"60f74c22",null),y=b.exports;g()(b,"components",{QBtn:p["a"],QSeparator:m["a"],QCardSection:_["a"]});var v=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticStyle:{margin:"-4px"}},e._l(e.$account.$test,(function(t,o){return n("q-btn",{key:o,staticClass:"q-ma-xs",attrs:{unelevated:"",color:"general","text-color":"general","no-caps":"",label:o,disable:!!e.test$loadingState,loading:e.test$loadingState===o},on:{click:function(n){return e.test$withLoadingState(o,t)}}})})),1),n("q-separator",{staticStyle:{margin:"16px -16px"}}),n("div",{staticClass:"q-ma-sm"},[n("q-checkbox",{attrs:{label:"isTestEnv"},model:{value:e.isTest,callback:function(t){e.isTest=t},expression:"isTest"}})],1),n("h4",[e._v(e._s(e.$store.state.account.authState))]),"signedIn"===e.$store.state.account.authState?n("div",{staticClass:"row",staticStyle:{margin:"-4px"}},[e._l(e.$store.getters.accountUserInfo,(function(t,o){return[Array.isArray(t)?[n("div",{key:o,staticClass:"col-12 col-lg-6 q-pa-xs"},[n("q-card",{staticClass:"overflow-hidden",attrs:{flat:"",bordered:""}},[Array.isArray(t)?n("q-expansion-item",{attrs:{"content-inset-level":.4,label:o}},e._l(t,(function(t,o){return n("div",{key:o},[e._v(e._s(t)+"\n ")])})),0):e._e()],1)],1)]:[n("div",{key:o,staticClass:"col-6 col-sm-3 col-lg-2 q-pa-xs"},[n("q-card",{staticClass:"overflow-hidden q-px-md q-py-sm",staticStyle:{"min-height":"66px"},attrs:{flat:"",bordered:""}},[n("div",{staticClass:"text-capitalize",staticStyle:{"font-size":"0.8rem",opacity:"0.8"}},[e._v(e._s(o)+"\n ")]),n("div",{staticClass:"text-weight-bold text-no-wrap ellipsis"},[e._v(e._s(t))])])],1)]]}))],2):e._e(),"signedIn"===e.$store.state.account.authState?[n("q-separator",{staticStyle:{margin:"16px -16px"}}),n("div",{staticClass:"q-mb-sm"},[n("q-input",{staticStyle:{"max-width":"300px"},attrs:{label:"TestToken",dense:"",outlined:""},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.testToken,callback:function(t){e.testToken=t},expression:"testToken"}})],1),n("div",[n("alphabiz-button",{attrs:{label:"Add Credits 100","on-click":e.addCredits}})],1)]:e._e()],2)},w=[],k=n("e75b");const C=new k["a"].Rest("ABDevRest");var $={name:"AccountTabPanel",data(){return{test$loadingState:null,testToken:""}},computed:{isTest:{get(){return this.$root.isTestEnv},set(e){this.$root.isTestEnv=e}}},methods:{async test$withLoadingState(e,t){try{this.test$loadingState=e,await t()}finally{this.test$loadingState=null}},async addCredits(){try{const e=await C.post("/development/addCredits",{testToken:this.testToken});console.log(e)}catch(e){this.$q.notify({message:e.message,type:"negative",position:"bottom-right",timeout:5e3})}}}},S=$,x=n("7498"),T=n("e586"),I=n("5bbd"),P=n("0e45"),O=Object(h["a"])(S,v,w,!1,null,"2975ce9d",null),q=O.exports;g()(O,"components",{QBtn:p["a"],QSeparator:m["a"],QCheckbox:x["a"],QCard:T["a"],QExpansionItem:I["a"],QInput:P["a"]});var E=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{margin:"-12px"}},[n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"dispatch public event"},on:{click:e.dispatchPublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"send public event"},on:{click:e.sendPublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"subscribe public event"},on:{click:e.subscribePublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"unsubscribe public event"},on:{click:e.unsubscribePublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"dispatch public event [legacy]"},on:{click:e.dispatchPublicEventLegacy}}),n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"rest_dev"},on:{click:e.restDev}}),n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"regInfo"},on:{click:e.regInfo}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"dialog"},on:{click:e.dialog}}),n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"analytics:trigger_event"},on:{click:e.triggerAnalyticsEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"analytics:updateEndpoint"},on:{click:e.updateEndpoint}})],1)},A=[],D=(n("d4b5"),n("61af")),N=n.n(D),L=n("bbac"),j=n("229c");const R=new k["a"].Rest("ABDevRest"),U={mounted(){j["a"].$debug()},methods:{async updateEndpoint(){const e=await j["a"].updateEndpoint({attributes:{foo:"bar"},immediate:!0});console.log("updateEndpoint:",e)},async triggerAnalyticsEvent(){console.log("triggerAnalyticsEvent:","sending");const e=await j["a"].record({immediate:!0,name:"test_analytics",attributes:{source:"triggerAnalyticsEvent"},metrics:{foobar:Math.floor(1e3*Math.random())}});console.log("triggerAnalyticsEvent:","sent",e)}}};var F={name:"AmplifyTabPanel",mixins:[U],data(){return{currentLoadingState:!1}},methods:{async dispatchPublicEvent(){const e=await R.postGuest("/development/dispatchPublicEvent",{id:"9865c315-e778-4de3-8045-1af79eba7fb4",channel:"foo_channel",data:JSON.stringify({a:213123,b:"lorem-server"})});console.log(e)},async dispatchPublicEventLegacy(){const e=await R.postGuest("/development/dispatchPublicEvent",{id:"*",channel:"foo_channel-legacy",legacy:!0,data:JSON.stringify({a:213123,b:"lorem-server-legacy"})});console.log(e)},async sendPublicEvent(){},async subscribePublicEvent(){},async unsubscribePublicEvent(){},async dialog(){const e=this.$alphabiz.dialog({title:"Tel",prompts:{tel:{type:"tel",model:{countryCode:null,prefixCode:null,phoneNumber:""}}}}),t=await e.promise("ok");console.log(t)},async restDev(){const e=async e=>{e.click();const t=new Promise((t=>{let n=!1;setTimeout((()=>{const e=document.activeElement;e.addEventListener("focus",(()=>{console.log("file$onFocus: Start",e),setTimeout((()=>{console.log("file$onFocus: End",n),!1===n&&t(null)}),400)}),{once:!0})}),200),e.addEventListener("change",(async o=>{var a,s;console.log("file$onChange");const i=null===o||void 0===o||null===(a=o.target)||void 0===a||null===(s=a.files)||void 0===s?void 0:s[0];i&&(n=!0,t(i)),e.value=null}),{once:!0})}));return await t},t=()=>{const e=document.createElement("input");return e.style.display="none",e.type="file",e.accept=".abk",e},n=t(),o=await e(n);if(!o)return;const a=this.$root.$children[0];console.log(o.path),a.lib$openABK(o.path)},async regInfo(){let e=null;const t=[],n=()=>R.post("/development/admin/query",{token:"asdasdasd",type:"reg_info",pagination_token:e});while(e||null===e)await n().then((({data:n})=>{e=n.PaginationToken,t.push(...n.Users),console.log(`queried ${t.length} (+${n.Users.length})`,n.PaginationToken)}));console.log("save users",t);const o=async e=>{const t=e=>{const t={};return t.username=e.Username,t.user_status=e.UserStatus,t.user_create_date=e.UserCreateDate,t.user_last_modified_date=e.UserLastModifiedDate,e.Attributes.forEach((({Name:e,Value:n})=>{t[`attr_${e}`]=n})),t},n=e.map(t),o=(()=>{let e=[];return n.forEach((t=>{const n=Object.keys(t);n.length>e.length&&(e=n)})),e=e.map((e=>({header:e,key:e}))),e})();console.log("columns",o);const a=n.map((e=>{const t=[];return o.forEach((n=>{var o;t.push(null!==(o=e[n.key])&&void 0!==o?o:"null")})),t})),s=await new Promise(((e,t)=>{Object(L["stringify"])(a,{header:!0,columns:o},((n,o)=>{n?t(n):e(o)}))}));return s};o(t).then((e=>{console.log("csv saving...",e),N.a.writeFileSync("./users.csv",e),console.log("done")}))}}},M=F,B=Object(h["a"])(M,E,A,!1,null,null,null),Q=B.exports;g()(B,"components",{QSeparator:m["a"],QBtn:p["a"]});var W=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.devInfo.torrentStore?n("div",{staticClass:"full-width"},[e._v("Torrent Config Store:\n "),n("alphabiz-button",{staticClass:"dev-info-action q-ml-md",attrs:{label:"Open"},on:{click:function(t){return e.open(e.devInfo.torrentStore)}}}),n("alphabiz-button",{staticClass:"dev-info-action q-ml-sm",attrs:{label:"Reset"},on:{click:e.resetTorrent}}),n("pre",[e._v(e._s(e.devInfo.torrentStore))])],1):e._e(),e.devInfo.settingStore?n("div",{staticClass:"full-width"},[e._v("Setting Config Store:\n "),n("alphabiz-button",{staticClass:"dev-info-action q-ml-md",attrs:{label:"Open"},on:{click:function(t){return e.open(e.devInfo.settingStore)}}}),n("alphabiz-button",{staticClass:"dev-info-action q-ml-sm",attrs:{label:"Reset"},on:{click:e.resetSetting}}),n("pre",[e._v(e._s(e.devInfo.settingStore))])],1):e._e(),e._v("\n We are using\n "),e.devInfo.electronVer?n("div",{staticClass:"full-width"},[e._v("Electron "+e._s(e.devInfo.electronVer)+"\n ")]):e._e(),e.devInfo.chromeVer?n("div",{staticClass:"full-width"},[e._v("Chrome "+e._s(e.devInfo.chromeVer)+"\n ")]):e._e(),e.devInfo.nodeVer?n("div",{staticClass:"full-width"},[e._v("Node "+e._s(e.devInfo.nodeVer)+"\n ")]):e._e(),n("div",[e._v("Quasar "+e._s(e.$q.version))]),n("div",[e._v("Vue "+e._s(e.vueVersion))]),n("div",[e._v(" "+e._s(e.$q.platform))]),e.devInfo.isCapacitor?n("div",{staticClass:"is-capacitor"},[e._v("[ Capacitor(Mobile) Mode ]")]):e._e(),e.devInfo.processArgv?n("div",{staticClass:"full-width"},[e._v("Process Argv "+e._s(e.devInfo.processArgv))]):e._e(),n("div",{staticClass:"full-width"},[e._v("Platform info: "+e._s(e.devInfo.platformInfo))]),n("div",{staticClass:"full-width"},[e._v("Location href: "+e._s(e.devInfo.locationHref))]),n("q-btn",{attrs:{color:"primary",icon:"aod",label:"capacitor test"},on:{click:e.testCapacitor}})],1)},z=[],H=n("ff9b"),V=n("908d"),G=n("d7df"),K=n("d558");const Y=n("d310").isElectron(),J=Y?n("b052").ipcRenderer:null;var X={name:"DevInfoTabPanel",data(){return console.log("PLATFORM",V["b"].is,location),{io:G["a"],devInfo:{torrentStore:"",settingStore:"",platformInfo:V["b"].is,locationHref:location.href,isCapacitor:Object(K["a"])()}}},methods:{open(e){this.io.emit("show_torrent_file",e)},resetTorrent(){Y&&J.send("reset-torrent")},resetSetting(){this.$store.dispatch("resetSettings").then((e=>{this.$i18n.locale=e.language,this.$q.notify("Reset success")}))},testCapacitor(){fetch("http://localhost:25742",{mode:"cors"}).then((e=>e.json())).then((e=>{console.log("CAPACITOR test success",e),this.$q.dialog({html:!0,message:"
"+JSON.stringify(e,null,2)+"
",ok:!0})})).catch((e=>{console.log("CAPACITOR test failed",e),console.log(e.message),console.log(e.stack),this.$q.dialog({message:e.message||e,ok:!0})}))}},mounted(){Y&&(J.on("dev-info",((e,t)=>{t.torrentStore&&(this.devInfo.torrentStore=t.torrentStore),t.settingStore&&(this.devInfo.settingStore=t.settingStore),t.electronVer&&(this.devInfo.electronVer=t.electronVer),t.chromeVer&&(this.devInfo.chromeVer=t.chromeVer),t.nodeVer&&(this.devInfo.nodeVer=t.nodeVer),t.argv&&(this.devInfo.processArgv=t.argv)})),J.send("dev-info")),this.io.off("notify",this.notify),this.io.on("notify",this.notify)},computed:{vueVersion(){return H["a"].version}}},Z=X,ee=(n("3fc8"),Object(h["a"])(Z,W,z,!1,null,"39f109b1",null)),te=ee.exports;g()(ee,"components",{QBtn:p["a"]});var ne=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._v("\n Alphabiz URL Convert\n "),n("q-input",{staticClass:"q-my-md",attrs:{type:"text",label:"source url"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.url,callback:function(t){e.url=t},expression:"url"}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Convert"},on:{click:e.convert}})],1)},oe=[],ae=n("c5a5"),se={name:"DevInfoTabPanel",data(){return{url:""}},methods:{convert(){Object(ae["a"])(this.url).then((e=>{this.url=e})).catch((e=>{console.error(e)}))}}},ie=se,re=Object(h["a"])(ie,ne,oe,!1,null,"19fc1694",null),le=re.exports;g()(re,"components",{QInput:P["a"],QBtn:p["a"]});var ce=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-data"},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"input-file",accept:".json"},on:{change:e.onFileChange}}),n("div",{staticClass:"text-h6 q-py-md"},[e._v("Media Library Database")]),n("div",{staticClass:"current-lib-status"},[e._v("There are "+e._s(e.entriesCount)+" entries in library")]),n("q-btn",{attrs:{color:"primary",icon:"save",label:"Export"},on:{click:e.saveDb}}),n("FileSelector",{on:{select:e.onFileChange}},[n("q-btn",{staticClass:"q-ml-md",attrs:{color:"primary",icon:"upload_file",label:"Import"}})],1),n("br"),n("q-btn",{staticClass:"q-mt-md",attrs:{color:"primary",icon:"bug_report",label:"Library Debug Log"},on:{click:function(t){e.showDebugLog=!0}}}),n("q-dialog",{model:{value:e.showDebugLog,callback:function(t){e.showDebugLog=t},expression:"showDebugLog"}},[n("q-card",{staticStyle:{"max-width":"80%"}},[n("q-card-section",[n("DebugLog")],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",color:"primary",icon:"close",label:"Close"}})],1)],1)],1)],1)},de=[],ue=n("2d62"),he=n("3aea"),pe=n("5515"),me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"debug-logs row col-12 q-pa-md"},[n("p",{staticClass:"col-12 q-mt-none",staticStyle:{"font-size":"24px"}},[e._v("Debug pannel")]),n("div",{staticClass:"peers col-6 q-pa-sm",staticStyle:{border:"1px solid gainsboro"}},e._l(e.peers,(function(t){return n("div",{key:t.url,staticClass:"peer"},[n("div",{staticClass:"status"},[n("q-badge",{attrs:{label:t.type}}),n("span",{directives:[{name:"show",rawName:"v-show",value:"wrtc"!==t.type,expression:"peer.type !== 'wrtc'"}],class:"connected"===t.status?"text-green":"text-grey"},[e._v("\n [ "+e._s(t.status)+" ]\n ")]),t.from?n("span",{staticClass:"text-green"},[e._v("[ "+e._s(t.from)+" ]")]):e._e(),n("span",[e._v(e._s(t.url))]),t.remoteSyncState?n("q-icon",{attrs:{color:"primary",name:t.stateIcon}},[n("q-tooltip",[n("span",[e._v("Local sync state: "+e._s(t.syncState))]),n("br"),n("span",[e._v("Remote sync state: "+e._s(t.remoteSyncState))])])],1):e._e()],1)])})),0),n("div",{staticClass:"logs col q-px-sm"},[e._v("\n --info--\n "),n("div",{staticClass:"user"},[e._v("User "+e._s(e.userInfo))]),n("div",{staticClass:"channels"},[e._v("Channels("+e._s(e.channels.length)+"): [\n "),e._l(e.channels,(function(t){return n("div",{key:t.id,staticClass:"channel q-ml-sm"},[e._v("\n "+e._s(t.title)+"\n "),n("span",{staticClass:"text-grey"},[e._v("UID: "+e._s(t.id))])])})),e._v("\n ]\n ")],2)])])},_e=[],fe=n("36a1"),ge={data(){return{lib:fe["a"]}},computed:{peers(){const e=[];return this.lib.gunPeers.forEach((t=>{let n="";switch(t.status){case WebSocket.CONNECTING:n="connecting";break;case WebSocket.OPEN:n="connected";break;case WebSocket.CLOSED:n="closed";break;case WebSocket.CLOSING:n="closing";break}let o="arrow_downward";"completed"===t.remoteSyncState?o="completed"===t.syncState?"done_all":"arrow_upward":"completed"!==t.syncState&&(o="sync"),e.push({from:t.from,url:t.label||t.url,type:t.type,syncState:t.syncState,remoteSyncState:t.remoteSyncState,stateIcon:o,status:n})})),e},userInfo(){var e;const t=this.lib.user;return`UID: ${null===t||void 0===t||null===(e=t.is)||void 0===e?void 0:e.pub}`},channels(){return this.lib.channelList.map((e=>({title:e.title,id:e.id})))}}},be=ge,ye=(n("28c4"),n("90c4")),ve=n("f106"),we=n("cf25"),ke=Object(h["a"])(be,me,_e,!1,null,null,null),Ce=ke.exports;g()(ke,"components",{QBadge:ye["a"],QIcon:ve["a"],QTooltip:we["a"]});var $e=n("d710"),Se=n.n($e),xe=n("9a50"),Te={components:{DebugLog:Ce,FileSelector:xe["a"]},name:"LibraryData",data(){return{entriesCount:Object.keys(ue["v"]._.graph).length,showDebugLog:!1,countInterval:null}},methods:{parseLib(){},saveDb(){Object(he["h"])(JSON.stringify({timestamp:Date.now(),graph:ue["v"]._.graph}),`${Se.a.name}-library-${Date.now()}.json`)},importDb(){this.$refs.fileSelector.click()},put(e){Object(pe["b"])(e),this.$q.notify(`Successfully import ${Object.keys(e).length} entries`)},onFileChange(e){e&&Object(he["g"])(e).then((e=>{const t=JSON.parse(e);if(!t.graph)return this.$q.notify(`This JSON file is not an ${Se.a.name} library db`);Date.now()-t.timestamp>6048e5?this.$q.dialog({title:"DB file too old",message:"This database file is created long time ago and may not be latest. Latest version of data will overwrite this db. Still import it?",ok:"Import anyway",cancel:"No",persistent:!0}).onOk((()=>{this.put(t.graph)})):console.log("Loaded db")}))}},created(){clearInterval(this.countInterval),this.countInterval=setInterval((()=>{this.entriesCount=Object.keys(ue["v"]._.graph).length}),1e3)},beforeDestroy(){clearInterval(this.countInterval)}},Ie=Te,Pe=n("b2aa"),Oe=n("59ba"),qe=n("a431"),Ee=Object(h["a"])(Ie,ce,de,!1,null,"0442e706",null),Ae=Ee.exports;g()(Ee,"components",{QBtn:p["a"],QDialog:Pe["a"],QCard:T["a"],QCardSection:_["a"],QCardActions:Oe["a"]}),g()(Ee,"directives",{ClosePopup:qe["a"]});var De=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v("\n Payment Mode\n ")]),n("q-toggle",{model:{value:e.dp$toggle,callback:function(t){e.dp$toggle=t},expression:"dp$toggle"}},[n("q-badge",{staticClass:"q-py-xs q-px-sm q-mx-xs",attrs:{"text-color":e.paymentColor,color:e.paymentColor}},[e._v("\n "+e._s(e.paymentLabel)+"\n ")])],1)],1),n("q-field",{staticClass:"q-my-xs",staticStyle:{width:"640px"},attrs:{label:"Current Address",outlined:"","stack-label":"",dense:""},scopedSlots:e._u([{key:"control",fn:function(){return[n("div",{staticClass:"self-center full-width no-outline",attrs:{tabindex:"0"}},[e._v(e._s(e.dp$address))])]},proxy:!0}])}),n("q-field",{staticClass:"q-my-xs",staticStyle:{width:"640px"},attrs:{label:"Current Credits",outlined:"","stack-label":"",dense:""},scopedSlots:e._u([{key:"control",fn:function(){return[n("div",{staticClass:"self-center full-width no-outline",attrs:{tabindex:"0"}},[e._v(e._s(e.dp$credit))])]},proxy:!0}])}),n("q-list",{staticClass:"q-my-md rounded-borders overflow-hidden non-selectable",staticStyle:{width:"640px",border:"1px solid rgba(127,127,127,0.35)"}},[n("q-item",{directives:[{name:"ripple",rawName:"v-ripple",value:!this.dp$toggle,expression:"!this.dp$toggle"}],attrs:{tag:"label",disable:!this.dp$toggle}},[n("q-item-section",{attrs:{avatar:""}},[n("q-checkbox",{attrs:{value:e.leftDrawer.showCreditPage,disable:!this.dp$toggle,val:"teal",color:"teal"},on:{input:function(t){return e.leftDrawer.showCreditPage=t}}})],1),n("q-item-section",[n("q-item-label",[e._v("Amplify Credits Page")]),n("q-item-label",{attrs:{caption:""}},[e._v("\n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem debitis distinctio dolor, doloribus ex harum\n ipsa ipsum molestias nihil, nisi non nulla numquam placeat possimus quae rem sapiente sunt voluptatum.\n ")])],1)],1),n("q-item",{directives:[{name:"ripple",rawName:"v-ripple",value:this.dp$toggle,expression:"this.dp$toggle"}],attrs:{tag:"label",disable:this.dp$toggle}},[n("q-item-section",{attrs:{avatar:""}},[n("q-checkbox",{attrs:{value:e.leftDrawer.showBlockchainPage,disable:this.dp$toggle,val:"orange",color:"orange"},on:{input:function(t){return e.leftDrawer.showBlockchainPage=t}}})],1),n("q-item-section",[n("q-item-label",[e._v("Blockchain Account Page")]),n("q-item-label",{attrs:{caption:""}},[e._v("\n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem debitis distinctio dolor, doloribus ex harum\n ipsa ipsum molestias nihil, nisi non nulla numquam placeat possimus quae rem sapiente sunt voluptatum.\n ")])],1)],1)],1),!e.dp$toggle&&e.$store.state.credits.providentFund?n("q-toggle",{model:{value:e.pf$toggle,callback:function(t){e.pf$toggle=t},expression:"pf$toggle"}},[n("q-badge",{staticClass:"q-py-xs q-px-sm q-mx-xs",attrs:{"text-color":"general",color:"general"}},[e._v("\n ProvidentFund: "+e._s(e.$store.state.credits.providentFund.enable?"Enabled":"Disabled")+"\n ")])],1):e._e()],1)},Ne=[],Le=n("09e8");const je={computed:{pf$toggle:{get(){const e=this.$store.state.credits.providentFund;if(!e){const e=localStorage.getItem("credit.providentFund");return!e||JSON.parse(e).enable}return e.enable},set(e){const t=(()=>{let e=localStorage.getItem("credit.providentFund");return e?JSON.parse(e):(e={enable:!0,poolId:"12345678-1234-1234-1234-123456790ab"},e)})();t.enable=e,localStorage.setItem("credit.providentFund",JSON.stringify(t)),this.$store.commit("CREDIT_UPDATE",{"providentFund.enable":e})}}}};var Re={name:"PaymentMode",mixins:[Le["a"],je],data(){return{changed:!1}},watch:{dp$toggle(e){e?(this.leftDrawer.showCreditPage=!1,this.leftDrawer.showBlockchainPage=!0):(this.leftDrawer.showCreditPage=!0,this.leftDrawer.showBlockchainPage=!1),this.changed=!this.changed,this.changed&&this.showRestartDialog()}},computed:{dp$toggle:{get(){return this.dp$mode?"blockchain"===this.dp$mode:"blockchain"===localStorage.getItem("dataPaymentMixin.mode")},set(e){this.dp$mode=e?"blockchain":"amplify"}},leftDrawer(){const e=this.$route.matched.find((e=>"MainLayout"===e.name)).instances.default;return e.$refs.leftDrawer},paymentLabel(){return this.dp$toggle?"Blockchain-based Service":"Managed Service (Amplify)"},paymentColor(){return this.dp$toggle?"accent":"positive"}},methods:{showRestartDialog(){this.$q.dialog({title:"Change Payment Mode",message:"you should restart application",ok:"Restart",cancel:"Undo"}).onOk((async()=>{n("d310").isElectron()&&n("b052").ipcRenderer.send("reload-webtorrent-window"),await this.$router.push({name:"Index"}),location.reload()})).onCancel((()=>{this.dp$toggle=!this.dp$toggle}))}}},Ue=Re,Fe=n("03bd"),Me=n("b121"),Be=n("e7c2"),Qe=n("b329"),We=n("25fb"),ze=n("79e0"),He=n("719b"),Ve=Object(h["a"])(Ue,De,Ne,!1,null,"34cd40b6",null),Ge=Ve.exports;g()(Ve,"components",{QToggle:Fe["a"],QBadge:ye["a"],QField:Me["a"],QList:Be["a"],QItem:Qe["a"],QItemSection:We["a"],QCheckbox:x["a"],QItemLabel:ze["a"]}),g()(Ve,"directives",{Ripple:He["a"]});var Ke=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-preload"},[n("q-checkbox",{staticClass:"q-mr-lg",attrs:{value:e.libraryPreload,label:"Enable preload"},on:{input:e.changePreload}}),n("q-checkbox",{directives:[{name:"show",rawName:"v-show",value:e.libraryPreload,expression:"libraryPreload"}],attrs:{value:e.showPreload,label:"Show preload tasks"},on:{input:e.changeShowPreload}}),n("div",{staticClass:"preload-tasks"},e._l(e.preloadTasks,(function(t,o){return n("div",{key:t.abUrl,staticClass:"preload-task q-ma-xs"},[n("div",{staticClass:"task-name q-mr-xs"},[e._v(e._s(o+1)+". "+e._s(t.postTitle||t.torrent&&(t.torrent.postTitle||t.torrent.name)||t.abUrl))]),n("span",{staticClass:"status"},[e._v("Status:\n "),t.failed?n("span",{staticClass:"status-text text-red"},[e._v("Failed")]):t.torrentPath?n("span",{staticClass:"status-text",class:2===t.torrent.preloadStatus?"text-green":""},[e._v("\n "+e._s(2===t.torrent.preloadStatus?"Downloaded":"Downloading")+"\n ")]):n("span",{staticClass:"status-text text-grey"},[e._v("Loading")])]),t.torrent&&2===t.torrent.preloadStatus?n("span",{staticClass:"q-ml-sm"},[n("span",{staticClass:"downloaded"},[e._v("Preload size:")]),n("span",{staticClass:"downloaded-size q-mx-xs"},[e._v(e._s(e.byteToLarger(t.torrent.downloaded)))]),n("q-btn",{attrs:{color:"general","no-caps":"",flat:"",dense:"",size:"xs"},on:{click:function(n){return e.showLocal(t.torrent)}}},[n("q-icon",{attrs:{name:"open_in_new",size:"14px"}}),n("span",{staticClass:"label",staticStyle:{"font-size":"14px"}},[e._v("Local files")])],1)],1):e._e()])})),0)],1)},Ye=[],Je=n("5584"),Xe=n("6422"),Ze={name:"LibraryPreload",data(){return{libraryPreload:Je["a"].state.setting.libraryPreload,showPreload:Je["a"].state.setting.showPreload,preloadTasks:[]}},methods:{byteToLarger(e){return Object(Xe["a"])(e,{gb:!1,byte:!1})},async changePreload(){console.log("change preload"),await Je["a"].dispatch("set",{libraryPreload:!this.libraryPreload}),await Je["a"].dispatch("fetchSettings"),this.libraryPreload=Je["a"].state.setting.libraryPreload},async changeShowPreload(){console.log("change showPreload"),await Je["a"].dispatch("set",{showPreload:!this.showPreload}),await Je["a"].dispatch("fetchSettings"),this.showPreload=Je["a"].state.setting.showPreload},onPreloadTasks(e){this.preloadTasks=e},showLocal(e){G["a"].emit("show_torrent_file",e.path)}},mounted(){console.log("on mounted"),G["a"].on("preload-tasks",this.onPreloadTasks)},beforeDestroy(){console.log("on before destroy"),G["a"].off("preload-tasks",this.onPreloadTasks)}},et=Ze,tt=(n("f817"),Object(h["a"])(et,Ke,Ye,!1,null,"6f92a449",null)),nt=tt.exports;g()(tt,"components",{QCheckbox:x["a"],QBtn:p["a"],QIcon:ve["a"]});var ot=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"capacitor-test"},[n("q-input",{attrs:{value:e.forceLogin,type:"checkbox",label:"Force Login"},on:{change:e.changeForceLogin}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Network Check"},on:{click:e.checkNetwork}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Homedir Check"},on:{click:e.checkHomedir}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Write to clipboard"},on:{click:e.writeClipboard}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Copy from clipboard"},on:{click:e.readClipboard}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Crypto"},on:{click:e.checkCrypto}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Simulate wifi/cellular"},on:{click:e.changeNetworkType}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"ReadFile"},on:{click:e.checkReadFile}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"WriteFile"},on:{click:e.checkWriteFile}}),n("div",[n("q-input",{attrs:{type:"text",label:"Filepath"},model:{value:e.filepath,callback:function(t){e.filepath=t},expression:"filepath"}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Get file uri"},on:{click:e.getFileUri}})],1),n("div",[n("FollowButton",{attrs:{id:"test",disableFollow:!1}}),n("FileSelector",{on:{select:e.onSelectFile}},[n("q-btn",{attrs:{color:"primary",icon:"folder",label:"File"}})],1)],1),n("div",{staticClass:"debug-logs"},e._l(e.logs,(function(t,o){return n("div",{key:o,staticClass:"log"},[n("span",{staticClass:"log-type"},[e._v(e._s(t.type))]),n("span",{staticClass:"log-value"},[e._v(e._s(t.value))])])})),0)],1)},at=[],st=n("aa8a"),it=n("c033"),rt=n("a368"),lt=n("a749"),ct={name:"CapacitorCheck",data(){return{logs:[],filepath:"",forceLogin:Je["a"].state.setting.forceLogin,connectionType:"wifi"}},components:{FollowButton:it["a"],FileSelector:xe["a"]},methods:{log(e,t,...n){this.logs||(this.logs=[]),this.logs.unshift({type:e,value:t}),n.length&&this.logs.unshift({type:e,value:n})},changeForceLogin(e){const t=!this.forceLogin;console.log("vla",e.target.value,this.forceLogin,t),this.forceLogin=t,Je["a"].dispatch("set",{forceLogin:t})},checkHomedir(){G["a"].once("homedir",(e=>this.log("Homedir",e))),G["a"].emit("get-homedir")},checkNetwork(){G["a"].emit("check-network")},onCheckProgress(e){console.log("network check progress",e),this.log(e.type,JSON.stringify(e.result))},onCheckEnd(e){console.log("network check end",e),this.log("isOnline",e.isOnline)},writeClipboard(){const e=Math.random().toString();this.log("Rand string",e),Object(st["b"])(e).then((()=>{this.log("Success",e)})).catch((e=>{this.log("Error",e)}))},async readClipboard(){const e=await Object(st["a"])();e?this.log("Read",e):this.log("Error",e)},onSelectFile(e){this.log("Select file",e,null===e||void 0===e?void 0:e.name,null===e||void 0===e?void 0:e.path,null===e||void 0===e?void 0:e.size)},checkCrypto(){const e=window.crypto;console.log(e),console.log(e.subtle),this.log("subtle",e.subtle),e.subtle&&this.log("digest",typeof e.subtle.digest)},async changeNetworkType(){const e="wifi"===this.connectionType?"cellular":"wifi";Object(lt["a"])({connected:!0,connectionType:e}),await new Promise(setTimeout);const t=await rt["Network"].getStatus();this.connectionType=t.connectionType,this.log("Network status",t)},async checkReadFile(){const e=await rt["Filesystem"].readFile({path:"some-file.txt",directory:rt["Directory"].Documents,encoding:rt["Encoding"].UTF8});this.log("Read",e)},async checkWriteFile(){const e=Math.floor(5e4*Math.random())+12e3;await rt["Filesystem"].writeFile({path:"some-file.txt",data:e.toString(),directory:rt["Directory"].Documents,encoding:rt["Encoding"].UTF8}),this.log("Write",e)},async getFileUri(){this.log("Raw",this.filepath);const e=await rt["Filesystem"].getUri({path:this.filepath});this.log("URI result",e)}},mounted(){G["a"].on("check-network-result",this.onCheckProgress),G["a"].on("check-network-end",this.onCheckEnd),Object(K["a"])()&&rt["Network"].getStatus().then((e=>{this.connectionType=e.connectionType}))},beforeDestroy(){console.log("unmount check"),G["a"].off("check-network-result",this.onCheckProgress),G["a"].off("check-network-end",this.onCheckEnd)},watch:{forceLogin(e){console.log("change",e)}}},dt=ct,ut=(n("b1d8"),Object(h["a"])(dt,ot,at,!1,null,"a7504d8e",null)),ht=ut.exports;g()(ut,"components",{QInput:P["a"],QBtn:p["a"]});var pt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:!e.floating,expression:"!floating"}]},[n("ThemeEditor",{attrs:{inner:!0},on:{show:e.handleShow}})],1)},mt=[],_t={name:"ThemeTabPanel",data(){return{floating:this.$theme.hasFloatingEditor()}},methods:{handleShow(){this.floating=!0,this.$theme.showFloatingEditor({onClose:()=>{this.floating=!1}})}}},ft=_t,gt=Object(h["a"])(ft,pt,mt,!1,null,null,null),bt=gt.exports,yt={name:"Development",components:{BasicPanel:y,ThemeTabPanel:bt,PaymentMode:Ge,AccountTabPanel:q,AmplifyTabPanel:Q,DevInfoTabPanel:te,UrlConvert:le,LibraryData:Ae,LibraryPreload:nt,CapacitorTest:ht},data(){const e=[{name:"BasicPanel",icon:"developer_mode",label:"BasicPanel"},{name:"accountInfo",icon:"account_circle",label:"Account Info"},{name:"amplify",icon:"developer_board",label:"Amplify"},{name:"capacitorTest",icon:"app_settings_alt",label:"Capacitor test"},{name:"devInfo",icon:"info",label:"Dev Info"},{name:"urlConvert",icon:"link",label:"Alphabiz URL Convert"},{name:"libraryData",icon:"video_library",label:"Library"},{name:"libraryPreload",icon:"cloud_download",label:"Library Preload"},{name:"payment_mode",icon:"account_balance_wallet",label:"Payment Mode"},{name:"theme_panel",icon:"palette",label:"Theme Panel"}];return{tabs:e,currentTab:e[0].name,isElectron:Object(l["isElectron"])()}}},vt=yt,wt=(n("5bb9"),n("74cb")),kt=n("ec78"),Ct=n("917f"),$t=n("c72d"),St=Object(h["a"])(vt,o,a,!1,null,null,null);t["default"]=St.exports;g()(St,"components",{QCard:T["a"],QTabs:wt["a"],QTab:kt["a"],QSeparator:m["a"],QTabPanels:Ct["a"],QTabPanel:$t["a"]})},"3a211":function(e,t,n){"use strict";n("10e1")},"3a62":function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"audio-info-container"},[n("p",{staticClass:"info"},[e._v(e._s(e.$t("this_is_an_audio_file")))]),n("img",{attrs:{src:e.icon,alt:"favicon",width:"100px"}})])])},a=[],s={name:"AudioInfo",components:{},props:{show:{type:Boolean}},data(){return{icon:"developer/assets/icon-256.png"}},created(){},mounted(){},computed:{},methods:{}},i=s,r=(n("eb21"),n("2b5f")),l=Object(r["a"])(i,o,a,!1,null,"d5366250",null);t["a"]=l.exports},"3aea":function(e,t,n){"use strict";n.d(t,"h",(function(){return c})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return u})),n.d(t,"e",(function(){return h})),n.d(t,"b",(function(){return _})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return g})),n.d(t,"a",(function(){return b}));var o=n("5584"),a=n("d710"),s=n.n(a),i=n("36a1"),r=n("d558"),l=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};function c(e,t){return l(this,void 0,void 0,(function*(){if(Object(r["a"])()){const{Filesystem:o,Directory:a,Encoding:s,Share:i}=yield Promise.resolve().then(n.bind(null,"a368")),r=yield o.writeFile({path:t,data:e,directory:a.Cache,encoding:s.UTF8});return r.uri?(console.log("Save file result",r),(yield i.canShare()).value&&i.share({files:[r.uri],dialogTitle:"Save"}),r):console.log("Failed to save",t)}const o=new Blob([e]),a=document.createElement("a"),s=URL.createObjectURL(o);a.href=s,a.download=t,document.body.appendChild(a),a.click(),setTimeout((function(){document.body.removeChild(a),window.URL.revokeObjectURL(s)}),0)}))}function d(e){return e?new Promise((t=>{const n=new FileReader;n.onload=e=>{var n;t(null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsText(e)})):Promise.resolve("")}function u(e){var t;const n=(null===(t=e.match(/c=IN\sIP\d\s([^\r]+)/))||void 0===t?void 0:t[1])||"",a=e.match(/m=application\s(\d+)\s(\S+)/),s=(null===a||void 0===a?void 0:a[1])||"0",i=(null===a||void 0===a?void 0:a[2])||"unknown type";return o["a"].getters.isDevMode?`${n}:${s} (${i})`:`${n.substring(0,4)+"*"} (${i})`}function h(e){var t;return(null===(t=e.match(/c=IN\sIP\d\s([^\r]+)/))||void 0===t?void 0:t[1])||""}const p=["?","|","*","!",":",'"',":","<",">","/","/"],m=["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"];function _(e){let t=e.replace(/\s*\/\s*/g,"_").replace(/\s*\\\s*/g,"_").replace(/(\s|\.)+$/,"");for(const o of m)while(t.startsWith(o))t=t.replace(o,"");const n=t.split("");for(let o=0;ot.id===e));if(!t)return null;const n=["id","title","soul"].map((e=>{const n=t[e];return e+"="+encodeURIComponent(n)})).join("&");return`/library/channel?${n}`}function g(e){if(!e.startsWith(`${s.a.shortProtocol}`))return null;const[t,n,o]=e.replace(`${s.a.shortProtocol}-library://`,"").split("/");return t&&n&&o?{type:t,title:n,id:o}:null}function b(e){return e?e.replace(/ /g," ").trim():""}},"3b4b":function(e,t,n){"use strict";n("9c3b")},"3c15":function(e,t,n){"use strict";n("eec3")},"3c8a":function(e,t,n){"use strict";n("6755")},"3d18":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return f}));n("de6c"),n("a1c1");const o=n("c577"),a=n("61af"),{exec:s,spawn:i}=n("61af"),r="win32"===e.platform,l="darwin"===e.platform,c=new Map([["VLC Player",{win:"vlc.exe",winRegistry:["VLC.mp4","PlayWithVLC"],drawin:"VLC.app"}],["GOM Player",{win:"GOM.exe",drawin:"GOM Player.app"}],["PotPlayer",{win:"PotPlayerMini64.exe"}],["Kodi",{win:"kodi.exe",drawin:"Kodi.app"}],["KMPlayer",{win:"KMPlayer64.exe",drawin:"KMPlayer.app"}],["SMPlayer",{win:"smplayer.exe",drawin:"SMPlayer.app"}],["MediaMonkey",{win:"MediaMonkey.exe"}],["AllPlayer",{win:"ALLPlayer.exe"}],["5KPlayer",{win:"5KPlayer.exe",drawin:"5KPlayer.app"}],["MPC-HC",{win:"mpc-hc64.exe"}]]),d=async()=>new Promise((e=>{const t=[];if(r){const n={label:"Media Player",value:"Media Player"},s=u();s&&t.push(n);const i=new o({hive:o.HKCU,key:"\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Compatibility Assistant\\Store"});i.values(((n,o)=>{if(n)return e(!1);for(let e=0;e{n.win&&new RegExp(n.win).test(o[e].name)&&(a.existsSync(o[e].name)?t.push({label:s,value:s}):console.log("player file does not exist"))}));e(t)}))}else l?a.readdir("/Applications/",((n,o)=>{if(n)return console.error(`error: ${n}`),e(!1);c.forEach(((e,n)=>{e.drawin&&new RegExp(e.drawin).test(o)&&t.push({label:n,value:n})})),e(t)})):e(!1)})),u=()=>{const t=e.arch;let n;return n="x64"===t?"C:\\Program Files\\Windows Media Player\\wmplayer.exe":"C:\\Program Files(x86)\\Windows Media Player\\wmplayer.exe",a.existsSync(n)?n:""},h=async e=>new Promise((t=>{if(r){if("Media Player"===e){const e=u();return t(e||!1)}const n=new o({hive:o.HKCU,key:"\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Compatibility Assistant\\Store"});n.values(((n,o)=>{if(n)return t(!1);if(!c.get(e))return t(!1);const s=c.get(e).win;for(let e=0;e{let n;if(r){if(!c.get(e))return;const o=c.get(e).winRegistry;if(!o)return;if("VLC Player"===e){const e=t.slice(2+(t.lastIndexOf(".")-1>>>0));o[0]=`VLC.${e}`,n=[...o]}}return n},m=async e=>new Promise((t=>{if(!e)return t(!1);if(r){const n=new o({hive:o.HKLM,key:`\\SOFTWARE\\Classes\\${e[0]}\\shell\\${e[1]}\\command`});n.values(((e,n)=>{if(e)return t(!1);const o=n[0].value.match(/-(?:-\w+)+/gm);t(o)}))}})),_=async(e,t,n)=>new Promise((o=>{let a,s;r?(a=e,s=n?[...n,t.replace("/","\\")]:[t.replace("/","\\")]):(a="open",s=["-a",e,t]),console.log("openPlayer:",a,s);const l=i(a,[...s]);l.on("error",(e=>{o(!1),console.log(`子进程错误,错误码 ${e}`)})),l.unref(),o(!0)})),f=async(e,t)=>{if("System Default"===e){const{shell:e}=n("b052");return e.openPath(t).catch((e=>{console.log("openPath err",e)}))}const o=await h(e);let a=!1;if(o){const n=p(e,t);let s;n&&(s=await m(n)),a=await _(o,t,s),console.log("openPlayer:"+a)}return a}}).call(this,n("28d0"))},"3d7e":function(e,t,n){"use strict";n("b36a")},"3e69":function(e,t,n){},"3fc8":function(e,t,n){"use strict";n("0c2f")},4:function(e,t){},4027:function(e,t,n){"use strict";(function(e){var o=n("7ca3"),a=n.n(o),s=(n("de6c"),n("a1c1"),n("d4b5"),n("c581")),i=n("af04"),r=n("c228"),l=n("072b");const c=Object.values((()=>{const e={};Object.values(r["a"]).forEach((t=>{t.phones.forEach((n=>{const[o,a]=n.split("-");e[n]={value:n,label:`${t.name} (+${o})`,emoji:t.emoji,prefixCode:o,countryCode:a,normalizedName:t.normalizedName,nativeName:t.name}}))}));const t=Object.keys(e).sort(((t,n)=>{const o=parseInt(e[t].prefixCode),a=parseInt(e[n].prefixCode);return o===a?1===o?"US"===e[t].countryCode?-1:"US"===e[n].countryCode?1:0:0:o>a?1:-1}));return t.reduce(((t,n)=>(t[n]=e[n],t)),{})})());class d extends s["b"]{static createConfigs(e){return{GENERAL:["",{type:"text",icon:"account_box",label:"account_username_email_phone"}],PHONE_NUMBER:[["86","","CN"],{type:"tel",icon:"phone",label:"account_phone_number",rules:[l["e"].bind(e)]}]}}constructor(e){super(...d.createConfigs(e).GENERAL),this.currentMode="GENERAL",this.configs=d.createConfigs(e)}setMode(e,t){if(this.currentMode===e)return this;this.currentMode=e;const n=this.configs[e];return this.model=n[0],this.attrs=n[1],t&&this.updateModel(t),this}}class u extends s["a"]{constructor(e,t){if(super({username:new d(e)}),this.assumeData=u.storage.getAssumeData(),!this.assumeData){var n;const e=null!==(n=r["b"][t])&&void 0!==n?n:r["b"]["en-us"],[o,a]=e.phones[0].split("-");this.assumeData={prefix:o,code:a}}this.assume=!1}get formData(){const e=super.formData;if(!e.username)return e;let t=e.username;return(()=>{this.assume=!1,Array.isArray(t)?(u.storage.setAssumeData({prefix:t[0],code:t[2]}),this.assumeData=u.storage.getAssumeData(),t="+"+t[0]+t[1]):!t.startsWith("+")&&/^[0-9]*$|^$/g.test(t)&&(/^00/.test(this.model)?t=t.replace(/^00/,"+"):(this.assume=!0,t="+"+this.assumeData.prefix+t))})(),e.username=t,e}turnToPhoneNumberMode(){if("GENERAL"!==this.currentMode)return;this.assume=!1;const e=this.items.username.value,{prefix:t,code:n}=this.assumeData;this.items.username.setMode("PHONE_NUMBER",[t,e,n])}backToGeneralMode(){if("GENERAL"===this.currentMode)return;const[e,t]=this.items.username.value;console.log("Remove prefix",e,t),this.assume=!1,this.items.username.setMode("GENERAL",t)}get currentMode(){return this.items.username.currentMode}}a()(u,"storage",{setAssumeData(e){window.localStorage.setItem("sign_in_assume_data",JSON.stringify(e))},getAssumeData(){const e=window.localStorage.getItem("sign_in_assume_data");return e?JSON.parse(e):null}}),t["a"]={name:"ForgotPassword",props:{scope:Object},data(){const e=e=>e===this.submitForm.items.password.model||"account_password_not_equal";return{resendInterval:null,resendTimer:0,progress:0,searchForm:new u(this,this.$q.lang.getLocale().toLowerCase()),submitForm:new s["a"]({code:new s["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[l["h"].bind(this)]}),password:new s["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[l["d"].bind(this)]}),reEnterPassword:new s["b"]("",{type:"password",icon:"lock",label:"account_re_enter_password",rules:[l["d"].bind(this),e]})})}},watch:{progress(e){e<0&&this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut")},resendTimer(e,t){0===t&&(this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=setInterval((()=>{0!==this.resendTimer?this.resendTimer-=1:(clearInterval(this.resendInterval),this.resendInterval=null)}),1e3))}},computed:{verifyDescription(){return this.$store.state.account.verification?{email:`${this.$t("account_email_sent_tip")}${this.$store.state.account.verification.destination}`,phone_number:`${this.$t("account_phone_sent_tip")}${this.$store.state.account.verification.destination}`}[this.$store.state.account.verification.type]:this.$t("account_tip_verified")}},methods:{handleCancel(){0===e&&"PHONE_NUMBER"===this.searchForm.currentMode?this.form.backToGeneralMode():this.progress-=1},async handleSearch(){try{const e=this.searchForm.formData;await this.$store.dispatch("ACCOUNT_FORGOT_PASSWORD_SEND",e.username),this.resendTimer=60,0===this.progress?this.progress+=1:i["a"].showPositive("code_has_been_resent")}catch(e){i["a"].showNegative(e.message),this.searchForm.assume&&this.searchForm.turnToPhoneNumberMode()}},async handleSubmit(){try{const e=this.submitForm.formData;await this.$store.dispatch("ACCOUNT_FORGOT_PASSWORD_SUBMIT",e),i["a"].showPositive("password_has_been_reset"),this.progress=-1}catch(e){i["a"].showNegative(e.message)}},onInput(e){const t=this.searchForm.items.username.currentMode;let n=this.searchForm.items.username.model;if("GENERAL"===t){if(Array.isArray(n)&&(n=n[1]||""),n&&/^\d+$/g.test(n)&&this.searchForm.turnToPhoneNumberMode(),n&&/^\+\d+$/.test(n)){const e=n.substring(1),t=c.find((t=>e.startsWith(t.prefixCode)));if(t){const{prefixCode:n,countryCode:o}=t,a=e.replace(n,""),s=[n,a,o];this.searchForm.turnToPhoneNumberMode(),this.$nextTick((()=>{console.log("To Phone With",s),this.searchForm.items.username.updateModel(s)}))}else console.log(`Cannot find ${e} as prefix`)}}else"PHONE_NUMBER"===t&&(n=this.searchForm.items.username.model[1]||"",(n.includes("@")||n.startsWith("+"))&&this.searchForm.backToGeneralMode())},onPressBack(){const e=this.searchForm.items.username.model;if(Array.isArray(e)){const t=e[1]||"";this.$nextTick((()=>{this.searchForm.items.username.updateModel(t)}))}this.searchForm.backToGeneralMode()}},beforeDestroy(){this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=null}}}).call(this,n("28d0"))},"41c7":function(e,t){e.exports={mode:"committee",admins:["FQi3UfsB5zY7SSfLMPdl9Fdh7_EeM4og0ZGivp4tfJU.yXhvCAmmUz1Pw9-Iwhf9hpo9-H4WDHwezzRAGE5Oipk","an_id_of_admin","an_id_of_other_admin"]}},4544:function(e,t,n){},"46a2":function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],attrs:{id:"video-splash"}},[n("div",{staticClass:"loading"},[n("q-circular-progress",{staticClass:"q-ma-md",attrs:{indeterminate:"",size:"24px",color:"warning"}}),n("p",[e._v(e._s(e.videoLoadingHint))])],1)])])},a=[],s={name:"VideoSplash",props:{show:{type:Boolean},videoLoadingHint:{type:String}},data(){return{}},created(){},mounted(){},computed:{},methods:{}},i=s,r=(n("e0e1"),n("2b5f")),l=n("64e7"),c=n("09a4"),d=n.n(c),u=Object(r["a"])(i,o,a,!1,null,"bcdd35fc",null);t["a"]=u.exports;d()(u,"components",{QCircularProgress:l["a"]})},"472b":function(e,t,n){"use strict";n("6e85")},"47fc":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));n("a1c1");const o=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"macOS",r:/Mac OS X/},{s:"UNIX",r:/UNIX/}];let a="unknown",s=()=>{};const i=new Promise((e=>s=e));function r(){const e="Unknown";let t=e;if(screen){const e=screen.width||"",n=screen.height||"";t=e+" x "+n}const n=navigator.appVersion,s=navigator.userAgent;let r,l,c,d=navigator.appName,u=""+parseFloat(navigator.appVersion),h=parseInt(navigator.appVersion,10);-1!==(l=s.indexOf("Opera"))&&(d="Opera",u=s.substring(l+6),-1!==(l=s.indexOf("Version"))&&(u=s.substring(l+8))),-1!==(l=s.indexOf("Electron"))?(d="Electron",u=s.substring(l+9)):-1!==(l=s.indexOf("OPR"))?(d="Opera",u=s.substring(l+4)):-1!==(l=s.indexOf("Edge"))?(d="Microsoft Legacy Edge",u=s.substring(l+5)):-1!==(l=s.indexOf("Edg"))?(d="Microsoft Edge",u=s.substring(l+4)):-1!==(l=s.indexOf("MSIE"))?(d="Microsoft Internet Explorer",u=s.substring(l+5)):-1!==(l=s.indexOf("Chrome"))?(d="Chrome",u=s.substring(l+7)):-1!==(l=s.indexOf("Safari"))?(d="Safari",u=s.substring(l+7),-1!==(l=s.indexOf("Version"))&&(u=s.substring(l+8))):-1!==(l=s.indexOf("Firefox"))?(d="Firefox",u=s.substring(l+8)):-1!==s.indexOf("Trident/")?(d="Microsoft Internet Explorer",u=s.substring(s.indexOf("rv:")+3)):(r=s.lastIndexOf(" ")+1)<(l=s.lastIndexOf("/"))&&(d=s.substring(r,l),u=s.substring(l+1),d.toLowerCase()===d.toUpperCase()&&(d=navigator.appName)),-1!==(c=u.indexOf(";"))&&(u=u.substring(0,c)),-1!==(c=u.indexOf(" "))&&(u=u.substring(0,c)),-1!==(c=u.indexOf(")"))&&(u=u.substring(0,c)),h=parseInt(""+u,10),isNaN(h)&&(u=""+parseFloat(navigator.appVersion),h=parseInt(navigator.appVersion,10));const p=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(n),m=navigator.cookieEnabled;let _=e;for(const a in o){const e=o[a];if(e.r.test(s)){_=e.s;break}}let f=e;switch(/Windows/.test(_)&&(f=/Windows (.*)/.exec(_)[1],_="Windows"),_){case"macOS":case"Android":f=/(?:Android|Mac OS|Mac OS X|MacIntel) ([._\d]+)/.exec(s)[1],f=f.replace(/_/g,".");break;case"iOS":f=/OS (\d+)_(\d+)_?(\d+)?/.exec(n),f=f[1]+"."+f[2]+"."+(f[3]||0);break}console.log("getSystemInfo");const g={screen:t,os:_,browser:d,osVersion:f,browserVersion:u,browserMajorVersion:h,mobile:p,cookies:m,arch:a};return i.then((()=>{g.arch=a})),g}"userAgentData"in navigator&&(console.log("Init userAgentData"),navigator.userAgentData.getHighEntropyValues(["architecture","bitness"]).then((({architecture:e,bitness:t})=>{console.log("Navigator userAgentData",e,t),"string"===typeof e&&(a=e),"string"===typeof t&&(a.includes("arm")?a+=t:a+="_"+t),s(a)})))},"4b8c":function(e,t,n){"use strict";n("80f4")},"4d52":function(e,t,n){"use strict";(function(e){n("d4b5"),n("de6c"),n("a1c1"),n("7a76");var o=n("fb31");const a={type:"03",prefix:o["shortProtocol"]+"-blockchain"},s={encode:t=>e.from(t,"utf-8").toString("hex"),decode:t=>e.from(t,"hex").toString("utf-8")},i={encode:t=>e.from(t,"utf-8").toString("base64"),decode:t=>e.from(t,"base64").toString("utf-8")},r={stringifyProtocolObject(e){const t=JSON.parse(s.decode(e.hash)),n=e.data,o={to_address:t.to_address,coin_type:n.coin_type,amount:n.amount,expiration:n.expiration},a=i.encode(JSON.stringify(o));return[t.action,a].join("/")},parseProtocolObject(e){const t=`Transfer to ${e.to_address.substr(2,10)}`,n=JSON.stringify({action:"transfer",to_address:e.to_address}),o={};return["coin_type","amount","expiration"].forEach((t=>{o[t]=e[t]})),{name:t,id:n,data:o}}},l={transfer:r},c=e=>{if(!e.startsWith(`${a.prefix}://`))return null;const[t,n]=e.replace(`${a.prefix}://`,"").split("/");if(!l[t])throw new Error("Unexpected action: "+t);const o=JSON.parse(i.decode(n));return{action:t,actionArgs:o}},d=(e,t)=>{const n=i.encode(JSON.stringify(t));return`${a.prefix}://${[e,n].join("/")}`};t["a"]={config:a,parseAction:c,stringifyAction:d,fromObject(e){if(e.protocolType!==a.type)return null;const{action:t}=JSON.parse(s.decode(e.hash));if(!l[t])throw new Error("Unexpected action: "+t);return`${a.prefix}://${l[t].stringifyProtocolObject(e)}`},toObject(e){const{action:t,actionArgs:n}=c(e),{name:o,id:i,data:r}=l[t].parseProtocolObject(n);return{protocolType:a.type,name:encodeURIComponent(o),hash:s.encode(i),data:r}}}}).call(this,n("eb72").Buffer)},"4d62":function(e,t,n){},"4d89":function(e,t,n){"use strict";n("c294")},"4dbc":function(e,t,n){"use strict";n("fe8f")},"4eaf":function(e,t,n){},"4ec4":function(e,t,n){"use strict";n("cb96")},"4fd2":function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return d}));n("de6c"),n("a1c1");const o=n("d310").isElectron(),a=new Map,s=e=>{if(!o)return!1;if("string"!==typeof e)return!1;if(a.has(e))return a.get(e);const t=n("61af");return!!t.existsSync(e)&&(a.set(e,t.statSync(e).isDirectory()),a.get(e))},i=["mp3","wav","aac","flac","m4a","wma"],r=["mp4","mkv","flv","avi","mov","wmv","rmvb","flv","webm"],l=e=>i.includes(e),c=e=>r.includes(e);function d(e){const t=e.replace(/\.downloading$/,"").match(/\.[^.]+?$/);if(!t)return!1;const n=t[0].slice(1);if(!n.length)return!1;const o=i.includes(n.toLowerCase())||r.includes(n.toLowerCase());return!!o&&!s(e)}},5:function(e,t){},"508e":function(e,t){const n=["udp://open.tracker.cl:1337/announce","udp://tracker.opentrackr.org:1337/announce","udp://9.rarbg.com:2810/announce","udp://tracker.openbittorrent.com:6969/announce","udp://exodus.desync.com:6969/announce","udp://www.torrent.eu.org:451/announce","udp://tracker1.bt.moack.co.kr:80/announce","udp://tracker.zerobytes.xyz:1337/announce","udp://tracker.torrent.eu.org:451/announce","udp://tracker.theoks.net:6969/announce","udp://tracker.srv00.com:6969/announce","udp://tracker.pomf.se:80/announce","udp://tracker.ololosh.space:6969/announce","udp://tracker.monitorit4.me:6969/announce","udp://tracker.moeking.me:6969/announce","udp://tracker.lelux.fi:6969/announce","udp://tracker.jordan.im:6969/announce","udp://tracker-udp.gbitt.info:80/announce","udp://retracker.sevstar.net:2710/announce","udp://retracker.netbynet.ru:2710/announce","udp://186.10.181.71:1337/announce","udp://93.158.213.92:1337/announce","udp://151.80.120.113:2810/announce","udp://45.154.253.6:6969/announce","udp://208.83.20.20:6969/announce","udp://91.216.110.52:451/announce","udp://156.234.201.18:80/announce","udp://62.210.217.207:1337/announce","udp://89.234.156.205:451/announce","udp://209.141.59.16:6969/announce","udp://62.109.31.95:6969/announce","udp://65.108.63.133:80/announce","udp://93.104.214.40:6969/announce","udp://163.172.170.127:6969/announce","udp://95.217.161.135:6969/announce","udp://213.108.105.23:6969/announce","udp://109.72.83.209:80/announce","udp://78.30.254.12:2710/announce","udp://212.1.226.176:2710/announce","udp://tracker.leechers-paradise.org:6969","udp://tracker.coppersurfer.tk:6969","udp://tracker.opentrackr.org:1337","udp://explodie.org:6969","udp://tracker.empire-js.us:1337","wss://tracker.btorrent.xyz","wss://tracker.openwebtorrent.com"],o=e=>n.indexOf(e),a=e=>n[e];e.exports={getTrackerById:a,getIdByTracker:o,trackerList:n}},"50de":function(e,t,n){"use strict";n("bba7")},"512b":function(e,t,n){},"525c":function(e,t,n){},"536e":function(e,t,n){"use strict";n("a5d3")},5415:function(e,t,n){"use strict";n("512b")},5515:function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return v}));n("de6c"),n("d4b5"),n("4db2"),n("a1c1");var o=n("2d62"),a=n("d7df"),s=n("d710"),i=n("ddf9"),r=n("c49d");const l=window.requestIdleCallback?window.requestIdleCallback:e=>setTimeout(e,100),c=(e="",t={})=>{if(e.startsWith("ab-")||e.startsWith(s["appName"].toLowerCase()))return!1;if(!e.startsWith("~"))return!0;if(e.startsWith("~@"))return 42!==e.length;const n=e.split("/");if(1===n.length){const[e,o]=n[0].split(".");if(!e||!o)return!0;if(e.length<40||o.length<40)return!0;const a=Object.keys(t);return a.some((e=>!["_","alias","auth","pub","epub","profile","follow","channels","blockChannels","blockUsers","takedowns"].includes(e)))}const o=n[1];if(!["follow","profile","channels","takedowns"].includes(o))return!0;const a=n[2]?[n[2]]:Object.keys(t);return"profile"===o?a.some((e=>!["_","#",">","avatar","description","name","id","blockChannels","blockUsers"].includes(e))):"follow"===o?a.some((e=>!(!e.match(/[^.]{43}\.[^.]{43}/)||e.includes("channels")))):Object.values(t).some((e=>"string"===typeof e&&e.includes("data:image")))},d=(e,t)=>{for(const i in t){const e=t[i];if("string"===typeof e&&e.includes("data:image"))return[]}const n=[],o=t._;if(!o||!o["#"]||!o[">"])return[];let a={[e]:{_:{"#":o["#"],">":{}}}},s=0;for(const i in t){if("_"===i)continue;const r=t[i];if("string"===typeof r&&r.includes("data:image"))return[];a[e][i]=r,s+=(JSON.stringify(r).length||0)+i.length,a[e]._[">"][i]=o[">"][i],s>1e4&&(n.push(a),s=0,a={[e]:{_:{"#":o["#"],">":{}}}})}return Object.keys(a).length&&n.push(a),n},u=(e,t,n)=>{if(e[t]){const o=e[t];e[t]=(...e)=>{o(...e),n(...e)}}else e[t]=n},h={timer:null,pending:!1,last:Date.now(),lastSize:0},p=async()=>{if(h.pending)return;const e=o["v"]._.graph;console.time("saveGraph"),h.pending=!0,h.last=Date.now();const t=Object.keys(e);if(h.lastSize>t.length)return console.log("Skip saving library");h.lastSize=t.length,console.log("start sending splice graph",t.length);let n=Object.create(null);a["a"].emit("save-library-db-start");for(const o of t){const t=e[o];if(!t)continue;if(c(o,t))continue;n[o]=t;const s=JSON.stringify(n);s.length>5e4&&(await new Promise((e=>l((()=>{a["a"].emit("save-library-db-partial",n),e()})))),n=Object.create(null))}Object.keys(n).length&&a["a"].emit("save-library-db-partial",n),l((()=>{a["a"].emit("save-library-db-end"),h.pending=!1,h.last=Date.now(),Object(r["a"])("Save partials",(new Date).toLocaleString()),console.timeEnd("saveGraph")}))},m=()=>{if(clearTimeout(h.timer),Date.now()-h.last>6e5)return p();h.timer=setTimeout(p,6e4)},_={};Object.defineProperty(window,"wrtcPeers",{get(){return _}}),Object.defineProperty(window,"saveGraph",{get(){return m}});let f=null;const g=async e=>{const t=f;return f=new Promise((n=>{const o=()=>{const t=e();t instanceof Promise?t.then(n):l((()=>n(t)))};t instanceof Promise?t.then(o):o()})),f};function b(t){const n=Object(i["a"])()?2:5;if(Object.keys(_).length>n)return Object(r["d"])(),void(t._destroy&&t._destroy(null,(()=>{})));const a=t.wire;if(!a)return;const s=o["v"]._.root;if(t.syncState="waiting",t.remoteSyncState="waiting",_[t.id]&&"open"===_[t.id].wire.readyState)return;_[t.id]=t;let l=!1;t.downloaded=0,t.uploaded=0,t.downloadSpeed=0,t.uploadSpeed=0;const h={time:Date.now(),downloaded:0,uploaded:0},p=setInterval((()=>{if(l)return clearInterval(p);const e=Date.now(),n=e-h.time;t.downloadSpeed=Math.floor((t.downloaded-h.downloaded)/n*1e3),t.uploadSpeed=Math.floor((t.uploaded-h.uploaded)/n*1e3),h.time=e,h.downloaded=t.downloaded,h.uploaded=t.uploaded}),1e3),f=async(e="")=>(a.bufferedAmount>a.bufferedAmountLowThreshold&&await new Promise((e=>{a.onbufferedamountlow=e})),g((()=>{"open"===a.readyState?(t.uploaded+=e.length,a.send(e)):l=!0}))),b=()=>{if(!s.graph)return setTimeout(b,5e3);let e=-1;for(const n in s.graph){var t;const o=s.graph[n],a=null===o||void 0===o||null===(t=o._)||void 0===t?void 0:t[">"];a&&a>e&&(e=a)}f("ABINFO"+JSON.stringify({timestamp:e}))};b(),t.lastUpdate=-1,t.syncTimer=null;const y=async()=>{if(l)return;if(t.syncTimer&&clearTimeout(t.syncTimer),!s.graph)return void(t.syncTimer=setTimeout(y,5e3));t.syncState="syncing";const e=Object.keys(s.graph);for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}let n=Object.create(null);const o=Date.now();let i=0,u=0;for(const m of e){if("open"!==a.readyState){"connecting"!==a.readyState&&(delete _[t.id],l=!0,t.close(),t._destroy&&t._destroy(null,(()=>{})),Object.keys(_).length<5&&Object(r["c"])());break}i++;const e=s.graph[m];if(!e)continue;if(e._&&e._[">"]){const n=Object.values(e._[">"]);if(n.every((e=>e5e4){const t=d(m,e);if(!t.length)continue;window.verb&&Object(r["a"])("SPLICES",t,JSON.stringify(e).length);for(const e of t)await f("ABSYNC"+JSON.stringify(e)),u++;continue}n[m]=e;const o="ABSYNC"+JSON.stringify(n);if(o.length>5e4&&(await f(o),u++,n=Object.create(null)),l)return}Object.keys(n).length&&u++,u&&(t.lastUpdate=o,m(),Object(r["a"])("Synced",i,"items to",t.id));const h=Object.keys(n).length?JSON.stringify(n):"{}",p="ABSYNC!"+h;"open"===a.readyState&&f(p),t.syncState="completed",t.syncTimer=setTimeout(y,1e4)};return u(a,"onclose",(function(){l=!0,delete _[t.id],clearTimeout(t.syncTimer),Object.keys(_).length<5&&Object(r["c"])()})),u(a,"onerror",(function(){l=!0,delete _[t.id],clearTimeout(t.syncTimer),Object.keys(_).length<5&&Object(r["c"])()})),u(a,"onmessage",(function(n){if(!n)return;let a=n.data;if("string"!==typeof a&&(a instanceof ArrayBuffer?a=e.from(a).toString("utf-8"):(Object(r["a"])("unknown data",typeof a,a),a=a.toString())),a)if(a.startsWith("ABSYNC")){t.downloaded+=a.length,a.startsWith("ABSYNC!")?(t.remoteSyncState="completed",m()):t.remoteSyncState="syncing";try{if("ABSYNC!{}"===a)return;const e=JSON.parse(a.replace(/ABSYNC(!?)/,"")),t={put:e,_:function(){},$:o["v"]};g((()=>s.on.put(t)))}catch(i){Object(r["a"])("put error",i,a)}}else if(a.startsWith("ABINFO")){const e=JSON.parse(a.substring(6));e.timestamp&&(t.lastUpdate=e.timestamp,y())}})),u(t,"ondatachannel",(function(e){const t=e.channel;t.onmessage=a.onmessage,t.onopen=a.onopen,t.onclose=a.onclose})),t}function y(e){if(_[e.id])return;const t=e._pc;return t.id=e.id,t.wire=e._channel,t._from="tracker",e.on("error",(e=>window.verb&&Object(r["a"])("peer error",e))),t._destroy=()=>{e._destroy&&e._destroy(null,(()=>{}))},b(t)}async function v(e){let t=Object.create(null),n=0;const a=Object.keys(e);for(const s of a)if(n++,t[s]=e[s],n>300||n===a.length){const e={...t},s={put:e,_:function(){},$:o["v"]};if(await g((()=>o["v"]._.root.on.put(s))),n===a.length){for(const e in _)_[e].lastUpdate=-1;Object(r["a"])(`Put ${a.length} items from local db`)}else await new Promise((e=>l(e)));t=Object.create(null)}}o["v"]._.opt.onWrtcPeer=function(e){return e._from="gun",b(e)},t["a"]=y,setInterval((()=>{Object.keys(_).length>=5||o["v"]._.opt&&"function"===typeof o["v"]._.opt.announce&&o["v"]._.opt.announce()}),6e4)}).call(this,n("eb72").Buffer)},5584:function(e,t,n){"use strict";(function(e){var o=n("ff9b"),a=n("358c"),s=n("79e7"),i=n("d310"),r=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};o["a"].use(a["a"]);const l=new a["a"].Store({modules:s["a"],strict:!1});t["a"]=l,Object.defineProperty(e,"vuex",{get(){return l}});const c=e=>["us"].includes(e.toLowerCase());if(Object(i["isElectron"])()){const{ipcRenderer:t}=n("b052");t.on("app-init",(()=>r(void 0,void 0,void 0,(function*(){const t=e["require"]("geoip-country"),n=yield(yield fetch("https://api.ipify.org")).text(),o=t.lookup(n);o&&(console.log("Init user with ip",n,o),c(o.country)&&(console.log(`User country: ${o.country}. Enable secure.'`),l.dispatch("set",{secureOption:"enable"})))}))))}}).call(this,n("0ee4"))},"55e6":function(e,t,n){"use strict";n("0336")},5653:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return y}));n("de6c"),n("a1c1"),n("dc89"),n("2425"),n("d4b5");var o=n("eb7a"),a=n("d6ab"),s=n("5fc6"),i=n("4fd2"),r=n("3d18"),l=n("5584"),c=n("e3c7"),d=n("46a2"),u=n("3a62"),h=n("00dd"),p=n("d710"),m=n.n(p),_=n("908d"),f=n("d558");const g=n("d310").isElectron();window.videojs=o["default"],n("4b37"),n("94ce"),n("63f2");const b=m.a.fileName,y={toggleSplash(){},updatePlayer(){}};t["a"]={name:"Player",inject:["rootApp","io"],components:{VideoSplash:d["a"],AudioInfo:u["a"],AdvancedOptions:h["a"]},data(){return{player:null,playerOptions:{fill:!1,autoplay:!0,responsive:!0,fluid:!0,preload:"auto",controls:!0,controlBar:{volumePanel:{inline:!1}}},subsBtn:null,progress:[],fileName:"",playerLang:"",playerCacheTime:0,showSplash:!1,videoLoadingHint:"",showAdvancedOptions:!1,isUpdateSubtitle:"",isAudio:!1,isPause:!1}},created(){this.initVideoComponent(),this.playerLang=l["a"].state.setting.language,this.playerCacheTime=l["a"].state.setting.videoCacheTime,window.addEventListener("error",(e=>{console.log("Uncaught global error",e.message,"\nThis has no effect to app and can be ignore")})),g&&(c["ipcRenderer"].once("ask-for-player",(()=>{this.$q.notify({message:this.$t("not_default_player"),actions:[{label:this.$t("dont_show_again"),textColor:"warning",handler:()=>{l["a"].dispatch("set",{dontAskForPlayer:!0})}},{label:this.$t("go_to_settings"),textColor:"warning",handler:()=>{this.$router.push("/basicSetting")}}]}),l["a"].dispatch("set",{dontAskForPlayer:!0})})),this.$root.$on("pause-player-before-close",(()=>{this.player&&(this.isPause=!0,l["a"].state.video.currentVideo.pipStatus&&this.player&&this.player.exitPictureInPicture(),l["a"].state.video.currentVideo.status&&this.player&&this.player.pause())})));for(const e in y)"function"===typeof this[e]&&(y[e]=(...t)=>this[e](...t))},mounted(){console.log("player mounted"),this.loadPlayer(!0)},async activated(){if(this.playerLang!==l["a"].state.setting.language&&(this.playerLang=l["a"].state.setting.language,this.languageChange()),this.playerCacheTime!==l["a"].state.setting.videoCacheTime){console.log("videoCacheTime change",l["a"].state.setting.videoCacheTime),this.playerCacheTime=l["a"].state.setting.videoCacheTime;const e=this.updateCacheRate(l["a"].state.setting.videoCacheTime);if(e){this.updateSrc(l["a"].state.video.currentVideo.url,{clearSubtitle:!1,clearProgress:!1}),this.player.currentTime(l["a"].state.video.currentVideo.currentTime);const e=l["a"].state.video.currentVideo.currentTime/this.player.duration(),t=document.querySelector(".vjs-play-progress");t&&setTimeout((()=>{t.style.width=100*e+"%"}),500)}}if(g||Object(f["a"])()){if(l["a"].state.video.currentVideo.remotePlay){this.isUpdateSubtitle="",this.isPause=!1,this.loadPlayer(!0),this.toggleSplash(!0),this.player.bigPlayButton.hide();const t=setTimeout((()=>{this.videoLoadingHint=this.$t("playing_timeout_hint")}),18e4);c["ipcRenderer"].send("get-stream-address"),c["ipcRenderer"].once("stream-address",((n,o)=>{console.log("got stream address",o),this.toggleSplash(!1),clearTimeout(t);let{address:a,filepath:s}=o;console.log("Stream play, try update player.src",o,"address",a,"filepath",s),s||(s="win32"===e.platform?decodeURI(a).replace("play:///","").replace(/\//g,"\\"):decodeURI(a).replace("play://","")),l["a"].dispatch("currentVideoUrl",a),l["a"].dispatch("currentVideoPath",s),l["a"].dispatch("currentVideoCurrentTime",0);try{this.updateSrc(a),this.isPause?(setTimeout((()=>{this.player.pause()}),1e3),this.isPause=!1):this.player.play(),this.player.readyState()&&l["a"].dispatch("resetRemotePlay"),this.clearOldSubtitle(),this.addSubtitle(s),this.changeSubtitleForLang()}catch(n){console.log("src err",n),l["a"].dispatch("resetRemotePlay")}}))}l["a"].state.video.currentVideo.url||l["a"].state.video.currentVideo.infoHash||this.loadPlayer(!0),c["ipcRenderer"].on("pause-player",(()=>{this.player&&(this.isPause=!0,l["a"].state.video.currentVideo.pipStatus&&this.player&&this.player.exitPictureInPicture(),l["a"].state.video.currentVideo.status&&this.player&&this.player.pause())}))}else l["a"].state.video.currentVideo.url!==this.player.src()&&console.log("url changed",l["a"].state.video.currentVideo.url,this.player.src());this.io.on("server_progress",(e=>{var t;if("/player"!==this.$router.currentRoute.path)return;if(!this.player&&!this.player.readyState())return;if(null===(t=l["a"].state.video.currentVideo)||void 0===t||!t.url)return;const n=e.find((e=>{var t;return null===(t=l["a"].state.video.currentVideo)||void 0===t?void 0:t.url.includes(e.name)}));if(n&&n.progress){const e=[],t=n.progress.length;let o=n.progress[0],a=1;for(let s=1;s{this.isUpdateSubtitle||(this.isUpdateSubtitle=e,console.log("update_subtitleList!!!",e,"path:",l["a"].state.video.currentVideo.path,t))})),this.io.on("clear_player",(e=>{const t=l["a"].state.video.currentVideo.url;if(l["a"].state.video.currentVideo.infoHash!==e.infoHash)return;const n=/^http/gm.test(t),o=/^play:\/\//gm.test(t);o&&"paused"===e.status||(n||o)&&(console.log("is",n,o),l["a"].state.video.currentVideo.pipStatus&&this.player.exitPictureInPicture(),l["a"].dispatch("resetPlayer"),this.$destroy(),setTimeout((()=>{console.log("timeout",n,o),this.$router.push("/player");try{this.loadPlayer(!0)}catch(e){console.log("Failed to force load player. This will not go wrong.",e.message||e)}n&&this.$q.notify(this.$t("stop_stream_player")),o&&this.$q.notify(this.$t("stop_player"))}),500))}))},beforeDestroy(){this&&this.player&&this.player.dispose()},computed:{lang(){const e=l["a"].state.setting.language?l["a"].state.setting.language:"en-US";return this.player&&this.player.language(e),e},settings(){const e=l["a"].state.setting;return{defaultVideoPlayer:e.defaultVideoPlayer,language:e.language}},advancedOpt(){let e=l["a"].state.video.currentVideo.path;const t=l["a"].state.video.currentVideo.url;t&&t.startsWith("play://")&&(e=decodeURI(t).replace("play:///",""));const n=e?e.replace(/^.*[\\\/]/,""):this.fileName;return[{name:this.$t("title"),value:decodeURIComponent(n).replace("\\","")},{name:this.$t("location"),value:e},{name:this.$t("subtitle_file"),value:l["a"].state.video.currentVideo.subtitleList}]}},watch:{"$store.state.video.currentVideo.updatePlayer"(e,t){console.log("watch updatePlayer:",e),e&&e!==t&&(console.log("need update player"),l["a"].dispatch("updatePlayer",!1),this.updatePlayer(l["a"].state.video.currentVideo.url))}},methods:{toggleSplash(e,t=""){this.showSplash=e,this.videoLoadingHint=t},toggleAudio(e){this.isAudio=e},toggleAdvancedOptions(e){this.showAdvancedOptions=e},openFile(){console.log("click",this.$refs.file),this.$refs.file.click()},bigPlayBtnOpenFile(){const e=document.querySelector("#my-video video").src;console.log("bigPlayBtn",e),e?this.player.play():this.openFile()},async languageChange(){this.player&&(this.player.language(this.lang),this.updateComponentText(),l["a"].state.video.currentVideo.url&&await this.loadPlayer(!0))},manualAddFile(e){console.log("Open Media File: "+e.target.files[0]),0!==e.target.files.length&&(e.target.files[0].path&&l["a"].dispatch("currentVideoPath",e.target.files[0].path),this.updatePlayer(e.target.files[0]),setTimeout((()=>{this.$refs.file.value=null}),500))},async manualAddSubtitle(e){const t=e.target.files;if(!t.length)return;const n=t[0],o=this.player.textTracks(),a=await this.addSubtitle(n,n.name);console.log("manualAddSubtitle",n,n.name,a);let s=-1;setTimeout((()=>{for(let e=0;e`,this.updateTitle=function(e){this.el_.innerHTML=``}}})),o["default"].registerComponent("SubsButton",o["default"].extend(e,{constructor:function(){e.apply(this,arguments);const t=arguments[1];this._text=t.text||"Add subtitles...",this.el_.innerHTML=``,this.updateTitle=function(e){this.el_.innerHTML=``}}})),o["default"].registerComponent("AddSubButton",o["default"].extend(t,{constructor:function(){t.apply(this,arguments);const e=arguments[1];this._text=e.text||"Add subtitles...",this.el_.innerHTML+=`${this._text}`}})),o["default"].registerComponent("AdvancedOptionsButton",o["default"].extend(e,{constructor:function(){e.apply(this,arguments);const t=arguments[1];this._text=t.text||"Advanced Options",this.el_.innerHTML=``,this.updateTitle=function(e){this.el_.innerHTML=``}}}));const n=o["default"].getComponent("SeekBar");n.prototype.getPercent=function(){const e=this.player_.currentTime(),t=e/this.player_.duration();return t>=1?1:t},n.prototype.handleMouseMove=function(e){let t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t),this.update()}},addControlBarComponent(){const e=this.player.controlBar.addChild("FileButton",{text:this.$t("open_file")},1),t=_["b"].is.mobile?"touchend":"click";e.on(t,this.openFile),this.subsBtn=this.player.controlBar.addChild("SubsButton",{text:this.$t("add_subtitles")+"..."},14),this.subsBtn.on(t,(()=>this.$refs.subtitle.click()));const n=this.player.controlBar.addChild("AdvancedOptionsButton",{text:this.$t("advanced_options")},16);n.on(t,(()=>{this.player.isFullscreen()&&this.player.exitFullscreen(),this.toggleAdvancedOptions(!0)}))},updateComponentText(){const e=this.player.controlBar.getChild("FileButton");e.updateTitle(this.$t("open_file")),this.subsBtn.updateTitle(this.$t("add_subtitles")+"...");const t=this.player.controlBar.getChild("AdvancedOptionsButton");t.updateTitle(this.$t("advanced_options"))},loadPlayer(e=!1){let t=()=>{};const n=new Promise((e=>{t=e}));if(!o["default"].getPlayer("my-video")||e){if(e){Object(o["default"])("my-video")&&(Object(o["default"])("my-video").isInPictureInPicture()&&Object(o["default"])("my-video").exitPictureInPicture(),Object(o["default"])("my-video").dispose());const e=document.querySelector("#video-container");e&&(e.innerHTML='')}try{this.player=Object(o["default"])("my-video",this.playerOptions,(()=>t()))}catch(a){console.log("loadPlayer error",a);const e=a.message;e.includes("The element or ID supplied is not valid.")&&(l["a"].dispatch("resetPlayer"),this.$destroy())}if(this.player.on("ready",(async()=>{l["a"].dispatch("updateVideoStatus",!1)})),this.player.on("canplay",(async()=>{l["a"].dispatch("resetRemotePlay");const e=(g?l["a"].state.video.currentVideo.path:this.fileName||l["a"].state.video.currentVideo.url).split(".").pop();if(this.toggleAudio(Object(i["b"])(e)),this.isUpdateSubtitle&&l["a"].state.video.currentVideo.infoHash===this.isUpdateSubtitle&&l["a"].state.video.currentVideo.path&&(await this.addSubtitle(l["a"].state.video.currentVideo.path),this.changeSubtitleForLang(),this.isUpdateSubtitle=""),!l["a"].state.video.currentVideo.url){const e=document.querySelector("#my-video video").src;l["a"].dispatch("currentVideoUrl",e);const t=e.split("/"),n=t[t.length-1];"undefined"!==typeof n&&(this.fileName=n),this.loadPlayer(!0),setTimeout((()=>this.player.play()),500)}setTimeout((()=>{!1===l["a"].state.video.currentVideo.status&&this.player.paused()&&this.player.bigPlayButton.show()}),700)})),this.player.on("play",(async()=>{if(this.settings.defaultVideoPlayer!==b&&l["a"].state.video.currentVideo.url.startsWith("play://")&&l["a"].state.video.currentVideo.infoHash){this.player.pause(),this.player.exitPictureInPicture();const e=l["a"].state.video.currentVideo.path;return console.log("player will pause,open default player,"+e),await Object(r["b"])(this.settings.defaultVideoPlayer,e),l["a"].dispatch("resetPlayer"),this.loadPlayer(!0)}this.player.bigPlayButton.hide(),l["a"].dispatch("updateVideoStatus",!0)})),this.player.on("pause",(()=>{4===this.player.readyState()&&this.player.bigPlayButton.show(),l["a"].dispatch("updateVideoStatus",!1)})),this.player.on("seeked",(()=>{setTimeout((()=>{const e=document.querySelector(".vjs-load-progress"),t=document.querySelector(".vjs-play-progress");e.style.width=t.style.width}),200)})),this.player.on("waiting",(()=>{const e=document.querySelector("#my-video video");e&&(e.style.backgroundColor="black")})),this.player.on("loadedmetadata",(()=>{const e=l["a"].state.video.currentVideo.url;if(!e||!/^http/gm.test(e))return;if(!/wait=0$/gm.test(e)||0===l["a"].state.setting.videoCacheTime)return;const t=this.updateCacheRate(l["a"].state.setting.videoCacheTime);console.log("loadedmetadata!",t),t&&(this.updateSrc(e,{clearSubtitle:!1,clearProgress:!1}),this.player.currentTime(l["a"].state.video.currentVideo.currentTime))})),this.player.on("leavepictureinpicture",(()=>{this.player&&this.player.bigPlayButton.hide(),l["a"].dispatch("updateVideoPIPStatus",!1),setTimeout((()=>{try{this.player.paused()?this.player.bigPlayButton.show():this.$router.push("/player")}catch(a){console.log("Failed to check pause status, but nothing will go wrong with this.",a.message||a)}}),500)})),this.player.on("enterpictureinpicture",(()=>{l["a"].dispatch("updateVideoPIPStatus",!0),this.player.paused()||setTimeout((()=>this.player.play()),500)})),this.player.on("timeupdate",(()=>{l["a"].dispatch("currentVideoCurrentTime",this.player.currentTime())})),this.player.on("error",(()=>{this.toggleSplash(!1),console.log("player error event!",this.player.error_.message);const e=this.player.languages()[this.player.language()],t=e&&e[this.player.error_.message]||this.player.error_.message;if(4!==this.player.error_.code||g||Object(f["a"])())this.$q.notify(t);else{const e='open_in_new',n=`${this.$t("download")} ${b} Desktop${e}`,o=`${n}`,a=this.$q.notify({html:!0,message:`${t}${o}`,actions:[{label:this.$t("close"),color:"green",handler(){a()}}],timeout:0})}l["a"].dispatch("resetPlayer"),this.$q.loading.hide(),this.loadPlayer(!0)})),l["a"].state.video.currentVideo.url&&!l["a"].state.video.currentVideo.remotePlay){this.player&&this.player.bigPlayButton.hide();const e=l["a"].state.video.currentVideo.subtitleList,t=l["a"].state.video.currentVideo.status,n=l["a"].state.video.currentVideo.updatePlayer;if(this.updateSrc(l["a"].state.video.currentVideo.url),this.player.currentTime(n?0:l["a"].state.video.currentVideo.currentTime),console.log("loadplayer(force) status",n,t,e,this.player),!n&&!t&&!/^https:\/\/localhost:8080\/webtorrent/gm.test(l["a"].state.video.currentVideo.url)){const e=()=>{this.player.pause(),this.player.off("play",e)};this.player.on("play",e)}"undefined"!==typeof e&&e.length?this.restoreSub(e):this.addSubtitle(l["a"].state.video.currentVideo.path),l["a"].dispatch("updatePlayer",!1)}return _["b"].is.mobile?this.player.bigPlayButton.on("touchend",this.bigPlayBtnOpenFile):this.player.bigPlayButton.on("click",this.bigPlayBtnOpenFile),this.addControlBarComponent(),l["a"].dispatch("updateVideoPIPStatus",!1),n}this.player=o["default"].getPlayer("my-video")},async updatePlayer(e){if(!e)return;this.player||await this.loadPlayer(!0);const t="string"===typeof e?e:URL.createObjectURL(e);console.log("update Player",e,t),this.fileName=e.name,l["a"].dispatch("currentVideoUrl",t);try{this.updateSrc(t)}catch(n){console.debug("updateSrc error",n.message||n),await this.loadPlayer(!0)}l["a"].dispatch("resetInfoHash"),this.clearOldSubtitle(),l["a"].state.video.currentVideo.path?await this.addSubtitle(l["a"].state.video.currentVideo.path):await this.addSubtitle(e,e.name),this.changeSubtitleForLang()},updateSrc(e,t={clearSubtitle:!0,clearProgress:!0}){this.toggleAudio(!1),t.clearProgress&&this.clearProgress(),t.clearSubtitle&&l["a"].dispatch("currentVideoSubtitleList",[]),e.startsWith("play://")&&(e+=`?infoHash=${l["a"].state.video.currentVideo.infoHash}`),console.log("updateSrc()",e),this.player.src([{src:e,type:"video/mp4"}])},updateCacheRate(e){if(!this.player.duration())return;const t=60*e/this.player.duration(),n=l["a"].state.video.currentVideo.url;return!!n&&(l["a"].dispatch("currentVideoUrl",n.replace(/wait=.*/gm,`wait=${t}`)),!0)},updateProgress(e){if(e){let t=document.querySelector("#download-progress");if(!t){const e=document.querySelector(".vjs-progress-holder");if(!e)return;t=e.appendChild(document.createElement("div")),t.id="download-progress"}const n=e=>{let t=0;for(let n=0;n1?t+e[n].length:t+1,e[n].rate=t;return e},o=n(e);t.style.background=o.reduce(((e,t)=>e+`, ${t.color} 0%, ${t.color} ${t.rate}%`),"linear-gradient(90deg")+")"}},clearProgress(){let e=document.querySelector("#download-progress");if(!e){const t=document.querySelector(".vjs-progress-holder");if(!t)return;e=t.appendChild(document.createElement("div")),e.id="download-progress"}e.style.background=""},async addSubtitle(e,t){var n;console.log("sub",e,t);let o=e;if("string"===typeof e){if(e.startsWith("blob:"))return;o=e.startsWith("play://")?Object(s["a"])(decodeURI(e.replace("play:///",""))):Object(s["a"])(e)}t||(t=(null===(n=o)||void 0===n?void 0:n.name)||"");const i=t.match(/\.[^.]+$/);if(!i)return;const r=i[0].toLowerCase();console.log("addSubtitle sub",o,t);let l=!1,c=!1;if(g)[".ass"].includes(r)?console.log("add .ass sub"):await Promise.all(Object(a["a"])(o).map((e=>new Promise((n=>{setTimeout((()=>{c=this.isRepeatSubtitle(e.label,e.path),"number"!==typeof c&&(this.player.addRemoteTextTrack({kind:"captions",label:e.label||t,src:e.src},!0),this.updateSubtitleList(e.label||t,{path:e.path}),l=!0),n()}))})))));else{if(console.log("web addSubtitle"),![".srt",".vtt"].includes(r))return;c=this.isRepeatSubtitle(t),"number"!==typeof c&&await new Promise((e=>{const n=new FileReader;n.readAsText(o),n.onload=n=>{const o=".vtt"===r?n.target.result:Object(a["b"])(n.target.result);console.log(n.target.result),this.player.addRemoteTextTrack({src:URL.createObjectURL(new Blob([o])),kind:"captions",label:t},!0),this.updateSubtitleList(t),l=!0,e()}}))}if(l&&this.subsBtn){this.subsBtn.addClass("hidden"),this.listenSubsCapsMenuItem();const e=this.player.textTracks();e&&e[0]&&(e[0].mode="showing",this.updateSubtitleList(e[0].label,{isShow:!0})),this.appendAddSubBtn()}return c},isRepeatSubtitle(e,t){const n=l["a"].state.video.currentVideo.subtitleList;let o=!1;for(let a=0;a{n[a].label===e&&(o=a),n[a].isShow=!1})),"number"===typeof t.index?n[t.index].isShow=!0:-1!==o&&(n[o].isShow=!0)}else n.push({label:e,path:t.path,isShow:t.isShow});l["a"].dispatch("currentVideoSubtitleList",n)},listenSubsCapsMenuItem(){const e=this.player.controlBar.subsCapsButton,t=e.menu.children();t.forEach(((e,t)=>{if("SubsCapsMenuItem"===e.constructor.name){const n=_["b"].is.mobile?"touchend":"click";e.on(n,(()=>{this.updateSubtitleList(e.track.label,{index:t-2,isShow:!0})}))}}))},clearOldSubtitle(){if(!this.subsBtn)return;this.subsBtn.removeClass("hidden");const e=this.player.remoteTextTracks();for(let t=e.length-1;t>=0;t--)this.player.removeRemoteTextTrack(e[t])},async restoreSub(e){let t;console.log("restoreSub",e),l["a"].dispatch("currentVideoSubtitleList",[]);for(const n in e){if(!e[n].path)return;await this.addSubtitle(e[n].path),e[n].isShow&&(t=n)}if("string"===typeof t){const e=this.player.textTracks();for(let t=0;t{const t=this.player.controlBar.subsCapsButton,n=t.menu.children();if(!n)return;if(n.some((e=>"AddSubButton"===e.name_)))return;const o=t.menu.addChild("AddSubButton",{text:e.$t("add_subtitles")+"..."},2);o.addClass("add-sub-btn");const a=_["b"].is.mobile?"touchend":"click";o.on(a,(()=>{this.$refs.subtitle.click()}))}),1e3)}}}}).call(this,n("28d0"))},"571b":function(e,t,n){},"586d":function(e,t,n){"use strict";n.r(t),n.d(t,"onGeneralUpdate",(function(){return o})),n.d(t,"onMessage",(function(){return a})),n.d(t,"onUpdateUserFromId",(function(){return s})),n.d(t,"onCreditChange",(function(){return i})),n.d(t,"onUpdateExpensesFromId",(function(){return r})),n.d(t,"onUpdateIncomeFromId",(function(){return l})),n.d(t,"onCreateUser",(function(){return c})),n.d(t,"onUpdateUser",(function(){return d})),n.d(t,"onDeleteUser",(function(){return u})),n.d(t,"onCreateInvitation",(function(){return h})),n.d(t,"onUpdateInvitation",(function(){return p})),n.d(t,"onDeleteInvitation",(function(){return m})),n.d(t,"onCreateMessageTimer",(function(){return _})),n.d(t,"onUpdateMessageTimer",(function(){return f})),n.d(t,"onDeleteMessageTimer",(function(){return g})),n.d(t,"onCreateTransaction",(function(){return b})),n.d(t,"onUpdateTransaction",(function(){return y})),n.d(t,"onDeleteTransaction",(function(){return v})),n.d(t,"onCreateTask",(function(){return w})),n.d(t,"onUpdateTask",(function(){return k})),n.d(t,"onDeleteTask",(function(){return C})),n.d(t,"onCreateProvidentFund",(function(){return $})),n.d(t,"onUpdateProvidentFund",(function(){return S})),n.d(t,"onDeleteProvidentFund",(function(){return x}));const o="\n subscription OnGeneralUpdate($id: String!) {\n onGeneralUpdate(id: $id) {\n id\n channel\n data\n }\n }\n",a="\n subscription OnMessage($channel: String!, $params: String) {\n onMessage(channel: $channel, params: $params) {\n channel\n data\n }\n }\n",s="\n subscription OnUpdateUserFromId($id: String!) {\n onUpdateUserFromId(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",i="\n subscription OnCreditChange($ownerId: String!) {\n onCreditChange(ownerId: $ownerId) {\n ownerId\n amount\n }\n }\n",r="\n subscription OnUpdateExpensesFromId($payerId: String!) {\n onUpdateExpensesFromId(payerId: $payerId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",l="\n subscription OnUpdateIncomeFromId($payeeId: String!) {\n onUpdateIncomeFromId(payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",c="\n subscription OnCreateUser($id: String) {\n onCreateUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",d="\n subscription OnUpdateUser($id: String) {\n onUpdateUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",u="\n subscription OnDeleteUser($id: String) {\n onDeleteUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",h="\n subscription OnCreateInvitation($inviterId: String) {\n onCreateInvitation(inviterId: $inviterId) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",p="\n subscription OnUpdateInvitation($inviterId: String) {\n onUpdateInvitation(inviterId: $inviterId) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",m="\n subscription OnDeleteInvitation($inviterId: String) {\n onDeleteInvitation(inviterId: $inviterId) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",_="\n subscription OnCreateMessageTimer {\n onCreateMessageTimer {\n id\n times\n updatedAt\n createdAt\n }\n }\n",f="\n subscription OnUpdateMessageTimer {\n onUpdateMessageTimer {\n id\n times\n updatedAt\n createdAt\n }\n }\n",g="\n subscription OnDeleteMessageTimer {\n onDeleteMessageTimer {\n id\n times\n updatedAt\n createdAt\n }\n }\n",b="\n subscription OnCreateTransaction($payerId: String, $payeeId: String) {\n onCreateTransaction(payerId: $payerId, payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",y="\n subscription OnUpdateTransaction($payerId: String, $payeeId: String) {\n onUpdateTransaction(payerId: $payerId, payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",v="\n subscription OnDeleteTransaction($payerId: String, $payeeId: String) {\n onDeleteTransaction(payerId: $payerId, payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",w="\n subscription OnCreateTask {\n onCreateTask {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",k="\n subscription OnUpdateTask {\n onUpdateTask {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",C="\n subscription OnDeleteTask {\n onDeleteTask {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",$="\n subscription OnCreateProvidentFund($id: String) {\n onCreateProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",S="\n subscription OnUpdateProvidentFund($id: String) {\n onUpdateProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",x="\n subscription OnDeleteProvidentFund($id: String) {\n onDeleteProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n"},5960:function(e,t,n){},5984:function(e,t,n){},"5a2f":function(e,t,n){"use strict";n("7447")},"5ab7":function(e,t,n){"use strict";n("3361")},"5bb9":function(e,t,n){"use strict";n("cf6e")},"5ccc":function(e,t,n){},"5d03":function(e,t,n){},"5e65":function(e,t,n){},"5e6d":function(e,t,n){},"5e87":function(e,t,n){"use strict";n("8fd4")},"5e95":function(e,t,n){"use strict";n("0c7a")},"5fa3":function(e,t,n){"use strict";(function(e){var o=n("e75b"),a=n("9572"),s=n("e74d"),i=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const r=new o["a"].Rest("ABDevRest"),l={currentRoute:"/library",user:{id:"",name:"",description:"",avatar:""},userLoggedIn:!1,keychainState:{keychainData:{},unset:!0,hash:"",timestamps:{metadata:0},lib:null},followQueue:[]},c={updateRoute(e,t){e.currentRoute=t},setUser(e,t){e.user=t},setKeychainState(e,t){Object.assign(e.keychainState,t)},addFollowQueue(e,t){e.followQueue.includes(t)||e.followQueue.push(t)},removeFollowQueue(e,t){while(e.followQueue.includes(t))e.followQueue.splice(e.followQueue.indexOf(t),1)}},d=()=>i(void 0,void 0,void 0,(function*(){const e=()=>i(void 0,void 0,void 0,(function*(){const t=yield s["a"].currentUserInfo();return t&&t.attributes?t.attributes:yield e()}));return yield e()})),u={syncKeychainState({state:e,commit:t}){return i(this,void 0,void 0,(function*(){const n=()=>i(this,void 0,void 0,(function*(){const e=yield d();let{"custom:key_metadata":t,"custom:key_lib":n}=e;return t=t?JSON.parse(t):{unset:!0,timestamps:{}},{metadata:t,lib:n}})),o=yield n();if(o){const e=e=>{if(!e.lib)return null;if(e.lib.startsWith("{"))return JSON.parse(e.lib);throw new Error("Failed to parseLib")};t("setKeychainState",{keychainData:o,unset:o.metadata.unset,hash:o.metadata.hash||"",timestamps:o.metadata.timestamps||{},lib:e(o)})}return e.keychainState}))},changeKeychainPassword(e,{oldPassword:t,password:n}){return i(this,void 0,void 0,(function*(){if(!t&&!n)throw Error("Invalid arguments");let e;t||(e="from_cognito"),n||(e="to_cognito"),yield r.post("/keychain/changePassword",{password:t?a["a"].digestPassword(t):void 0,newPassword:n?a["a"].digestPassword(n):void 0,type:e})}))},getKeychainCloud({state:e,commit:t,dispatch:n},{password:o,mode:s,keyName:l}){return i(this,void 0,void 0,(function*(){const e=()=>i(this,void 0,void 0,(function*(){if(!["lib"].includes(l))throw new Error("invalid_keychain_keyname");const e=yield d().then((e=>!!e[`custom:key_${l}`]));if(!e)throw new Error("keychain_data_does_not_exist")}));yield e();const t=yield(()=>i(this,void 0,void 0,(function*(){if("cognito_hash"===s){const e=yield n("syncKeychainState");if(!e.unset)throw new Error("invalid_keychain_mode");if(!e.hash)throw new Error("cognito_hash_not_found");return e.hash}if("independent_password"===s){if(!o)throw new Error("keychain_password_not_found");return a["a"].digestPassword(o)}throw new Error("invalid_keychain_mode")})))(),c=yield r.post("/keychain/getKeychain",{password:t,keyName:l});if(!c)throw new Error("password_error");if(["epriv","epub","priv","pub"].some((e=>!c[e])))throw new Error("invalid_key");return console.log("getKeychainFromCloud:",c),c}))},createKeychainCloud({state:e,commit:t,dispatch:n},{keyObj:o,password:s,mode:l,keyName:c}){return i(this,void 0,void 0,(function*(){const e=()=>i(this,void 0,void 0,(function*(){if(!["lib"].includes(c))throw new Error("invalid_keychain_keyname");const e=yield d().then((e=>!!e[`custom:key_${c}`]));if(e)throw new Error("keychain_data_existed")}));yield e();const t=yield(()=>i(this,void 0,void 0,(function*(){if("cognito_hash"===l){const e=yield n("syncKeychainState");if(!e.unset)throw new Error("invalid_keychain_mode");if(!e.hash)throw new Error("cognito_hash_not_found");return e.hash}if("independent_password"===l){if(!s)throw new Error("keychain_password_not_found");return a["a"].digestPassword(s)}throw new Error("invalid_keychain_mode")})))();yield r.post("/keychain/enableLibKey",Object.assign(Object.assign(Object.assign({},"cognito_hash"===l?{}:{password:t}),"cognito_hash"===l?{type:"cognito"}:{}),{keyName:c,keyData:JSON.stringify(o)})).catch(console.log)}))},updateKeychainCloud({state:e,commit:t,dispatch:n},{keyObj:o,password:s,mode:l,keyName:c}){return i(this,void 0,void 0,(function*(){const e=()=>i(this,void 0,void 0,(function*(){if(!["lib"].includes(c))throw new Error("invalid_keychain_keyname");const e=yield d().then((e=>!!e[`custom:key_${c}`]));if(!e)throw new Error("keychain_data_does_not_exist")}));yield e();const t=yield(()=>i(this,void 0,void 0,(function*(){if("cognito_hash"===l){const e=yield n("syncKeychainState");if(!e.hash)throw new Error("cognito_hash_not_found");return e.hash}if("independent_password"===l){if(!s)throw new Error("keychain_password_not_found");return a["a"].digestPassword(s)}throw new Error("invalid_keychain_mode")})))();yield r.post("/keychain/updateKeychain",Object.assign(Object.assign(Object.assign({},"cognito_hash"===l?{}:{password:t}),"cognito_hash"===l?{type:"cognito"}:{}),{keyName:c,keyData:JSON.stringify(o)}))}))},disableKeychainCloud(e){return i(this,void 0,void 0,(function*(){yield r.post("/keychain/disableKeychain")}))}};Object.defineProperty("undefined"===typeof window?e:window,"rest",{get(){return r}});const h={libraryRoute(e){return e.currentRoute},libraryUser(){return l.user},keychainState(){return l.keychainState},followQueue(e){return e.followQueue}},p={namespaced:!1,state:l,mutations:c,actions:u,getters:h};t["a"]=p}).call(this,n("0ee4"))},"5fc6":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));const o=n("d310").isElectron();function a(e){if(!o||"string"!==typeof e)return e;const t=n("a3fc"),a=t.basename(e);return{name:a,path:e}}},6:function(e,t){},"603c":function(e,t,n){},"61a1":function(e,t,n){"use strict";n.d(t,"b",(function(){return Ss}));var o=n("ff9b"),a=n("fe87"),s=(n("de6c"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-container",class:{larger:!e.isElectron}},[n("q-toolbar",{staticClass:"library-header q-py-sm flex",staticStyle:{"flex-wrap":"nowrap","max-height":"57px"}},[e.lib.search.options.length?[e.$q.screen.xs?n("q-btn",{attrs:{unelevated:"",round:"",icon:"search"}},[n("q-menu",[n("q-card",{staticClass:"q-pa-md"},[n("q-select",{staticClass:"q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("type"),options:e.lib.search.options},model:{value:e.lib.search.option,callback:function(t){e.$set(e.lib.search,"option",t)},expression:"lib.search.option"}}),n("q-input",{attrs:{outlined:"",dense:"",type:"text",label:e.$t("search")},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.lib.search.text,callback:function(t){e.$set(e.lib.search,"text",t)},expression:"lib.search.text"}})],1)],1)],1):n("q-input",{staticStyle:{width:"320px"},attrs:{outlined:"",dense:"",type:"text",label:e.$t("search")},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"before",fn:function(){return[n("q-select",{staticStyle:{"min-width":"120px"},attrs:{dense:"",outlined:"",label:e.$t("type"),options:e.lib.search.options},model:{value:e.lib.search.option,callback:function(t){e.$set(e.lib.search,"option",t)},expression:"lib.search.option"}})]},proxy:!0},{key:"append",fn:function(){return[n("q-icon",{attrs:{name:"search"}})]},proxy:!0}],null,!1,311008788),model:{value:e.lib.search.text,callback:function(t){e.$set(e.lib.search,"text",t)},expression:"lib.search.text"}})]:e._e(),n("q-space"),n("div",{staticClass:"header-bar-status text-grey q-my-sm q-ml-xs flex no-wrap items-center text-right overflow-hidden"},[n("div",{staticClass:"from-network-hint",staticStyle:{"flex-shrink":"1"}},[e._v(e._s(e.$t("lib_from_network")))]),n("q-badge",{staticClass:"connection-status cursor-pointer q-ml-xs",attrs:{"text-color":"white",color:e.statusColor},on:{click:function(t){e.peerDialog=!0}}},[e.lib.online?n("q-icon",{staticClass:"status-icon",attrs:{name:"flash_on"}}):e._e(),n("span",{staticClass:"status-label"},[e._v(e._s(e.statusLabel))])],1)],1)],2),n("div",{staticClass:"library-view"},[n("transition",{attrs:{name:"slide",mode:"out-in"}},[n("keep-alive",{attrs:{exclude:"LibraryChannel,LibraryRecommend"}},[e.isLoggedIn?e.showRecommend?n("Recommend"):n("router-view"):n("Login")],1)],1)],1),n("ConnectionStatus",{model:{value:e.peerDialog,callback:function(t){e.peerDialog=t},expression:"peerDialog"}})],1)}),i=[],r=(n("a1c1"),n("36a1")),l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"login-container"},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"input-file",accept:".abk"},on:{change:e.onFileChange}}),n("q-dialog",{model:{value:e.showImport,callback:function(t){e.showImport=t},expression:"showImport"}},[n("q-card",[n("q-card-section",[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("import_key")))]),n("q-input",{staticStyle:{width:"480px"},attrs:{type:"text",label:e.$t("key")},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.userKey,callback:function(t){e.userKey=t},expression:"userKey"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{attrs:{flat:"",label:e.$t("import"),color:"primary"},on:{click:e.importKey}})],1)],1)],1),n("Loading",{attrs:{value:!0}})],1)},c=[],d=(n("e39c"),n("5584")),u=n("35f4"),h=n("3aea"),p=n("2d62"),m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.showLoading,expression:"showLoading"}],staticClass:"non-selectable",class:["absolute-top-left","full-width","full-height"].concat(["column","justify-center","items-center"],["bg-page","text-page"])},[n("div",{staticClass:"items-center"},[n("q-spinner",{attrs:{size:"4rem",color:"secondary"}}),n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))]),n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("first_recomment_msg")))])])},_=[],f=n("a449");const g=()=>{let e;return{data(){return{keychainLoadingState:!1,keychain:f["a"]}},watch:{"keychain.loading"(t){e&&clearTimeout(e),t?e=setTimeout((()=>{this.keychainLoadingState=!0}),500):this.keychainLoadingState=!1}}}};var b={name:"Loading",mixins:[g()],props:{value:Boolean},computed:{showLoading(){const e="signedOut"===this.$store.state.account.authState;return this.value&&!this.keychainLoadingState&&!e}},methods:{onChange(){this.$emit("change",!this.value)}}},y=b,v=(n("9fe7"),n("2b5f")),w=n("53ef"),k=n("09a4"),C=n.n(k),$=Object(v["a"])(y,m,_,!1,null,"1f47903d",null),S=$.exports;C()($,"components",{QSpinner:w["a"]});const x=Object(u["a"])("abcdefg",5),T=Object(u["a"])("0123456789abcdef",40);var I={data(){return{username:"",password:"",nickname:"",description:"",avatar:"",userKey:"",showImport:!1}},components:{Loading:S},computed:{showLoading(){const e=this.$store.state.account.authState;return null===e}},methods:{validate(){if(!this.nickname){const e=d["a"].getters.accountUserInfo.nickname;this.nickname=e||this.username.substring(0,12)}return!0},showImportDialog(){this.$refs.fileSelector.click()},onFileChange(e){var t,n;null!==e&&void 0!==e&&null!==(t=e.target)&&void 0!==t&&null!==(n=t.files)&&void 0!==n&&n[0]&&Object(h["g"])(e.target.files[0]).then((e=>{if(!e)return this.$q.notify("Cannot read key pair from this file");this.userKey=e,this.importKey()}))},onReset(){this.username=x()+T(35),this.password=T(),this.nickname="",this.description=""},async onSubmit(){const e=this.validate();if("string"===typeof e)return this.$q.dialog({message:e});console.log(this.username,this.password,this.nickname),r["a"].register(this.username,this.password,{name:this.nickname,description:this.description,avatar:this.avatar}).then((()=>{const e=Object(p["t"])();if(console.log(e,r["a"].user),e._&&e._.sea){const t=e._.sea,{epub:n,pub:o,epriv:a,priv:s}=t;if(!n||!o||!a||!s)return;const i=[n,o,a,s].join(":");this.$q.dialog({title:this.$t("save_key"),message:this.$t("save_key_file"),ok:this.$t("save_key"),cancel:this.$t("cancel")}).onOk((()=>{var t,n;Object(h["h"])(i,`${(null===(t=e.data)||void 0===t?void 0:t.name)||(null===(n=r["a"].userData)||void 0===n?void 0:n.name)||"user"}.abk`)})).onDismiss((()=>{r["a"].prepareData()}))}}))},autoCreate(){this.onReset(),this.onSubmit()},importKey(){if(r["a"].isLoggedIn)return;console.log(this.userKey);const[e,t,n,o]=this.userKey.split(":");if(!e||!t||!n||!o)return this.$q.notify(this.$t("invalid_key"));r["a"].login({epub:e,pub:t,epriv:n,priv:o}).then(r["a"].prepareData)}},created(){this.onReset(),r["a"].$on("logged-in",(()=>{const e=[this.username,this.password].join(":");console.log("Logged in",e),this.$emit("login")}))}},P=I,O=(n("86d7"),n("1043")),q=n("b2aa"),E=n("e586"),A=n("d7c7"),D=n("0e45"),N=n("59ba"),L=Object(v["a"])(P,l,c,!1,null,"6a9c1d57",null),j=L.exports;C()(L,"components",{QBtn:O["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QInput:D["a"],QCardActions:N["a"]});var R=n("36a5"),U=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.value,"content-class":"fullscreen-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:function(t){return e.$emit("input",t)}}},[n("q-card",{staticClass:"peer-dialog-card"},[n("q-card-section",{staticClass:"row items-center",class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-bold peers-title"},[e._v(e._s(e.$t("connection_status")))]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"},{name:"close-popup",rawName:"v-close-popup"}],attrs:{unelevated:"",round:"",icon:"close"}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}],staticClass:"q-mb-sm"}),n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"scroll-area gun-server-list"},[n("div",{staticClass:"servers-title q-ml-sm q-mb-sm row items-center"},[n("div",{staticClass:"text-h6 q-mr-sm"},[e._v(e._s(e.$t("gun_server_list")))]),n("q-btn",{attrs:{flat:"",unelevated:"",rounded:"",dense:"",icon:"help_outline"},on:{click:e.showServerHelp}},[n("q-tooltip",[e._v(e._s(e.$t("about_cache_node")))])],1),n("q-space"),n("q-btn",{attrs:{unelevated:"",round:"",icon:"add"},on:{click:e.createCacheNode}},[n("q-tooltip",[e._v(e._s(e.$t("create_cache_node")))])],1),n("q-btn",{attrs:{unelevated:"",round:"",icon:"edit"},on:{click:e.editCacheNode}},[n("q-tooltip",[e._v(e._s(e.$t("edit_cache_node")))])],1)],1),n("q-markup-table",{attrs:{flat:"",bordered:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("status")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("server")))])])]),n("tbody",e._l(e.wsPeers,(function(t){return n("tr",{key:t.url},[n("td",{staticClass:"text-left",class:"text-"+e.statusColorMap[t.status]},[e._v(e._s(e.statusTextMap[t.status]))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.url))])])})),0)])],1)]),n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"scroll-area wrtc-peer-list"},[n("div",{staticClass:"peers-title q-ml-sm q-mb-sm text-h6"},[e._v(e._s(e.$t("peer_list")))]),n("q-markup-table",{attrs:{flat:"",bordered:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"}),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("peer_id")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("connection")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("data_source")))]),n("th",{staticClass:"text-center",attrs:{colspan:"2"}},[e._v(e._s(e.$t("download")))]),n("th",{staticClass:"text-center",attrs:{colspan:"2"}},[e._v(e._s(e.$t("upload")))])])]),n("tbody",[e.wrtcPeers&&Object.keys(e.wrtcPeers).length?e._l(e.wrtcPeers,(function(t){return n("tr",{key:t.url},[n("td",{staticClass:"text-left"},[n("q-icon",{attrs:{name:e.getPeerStatusIcon(t),color:"primary"}},[n("q-tooltip",[e._v(e._s(e.getPeerStatusTooltip(t)))])],1)],1),n("td",{staticClass:"text-left"},[e._v(e._s(e.getPeerId(t)))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.label))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.from))]),n("td",{staticClass:"text-right"},[e._v(e._s(e.byteToLarger(t.downloaded)))]),n("td",{staticClass:"text-left"},[e._v(e._s(e.byteToLarger(t.downloadSpeed))+" / s")]),n("td",{staticClass:"text-right"},[e._v(e._s(e.byteToLarger(t.uploaded)))]),n("td",{staticClass:"text-left"},[e._v(e._s(e.byteToLarger(t.uploadSpeed))+" / s")])])})):n("tr",{staticClass:"q-pa-md"},[n("td",{staticClass:"full-width text-center",attrs:{colspan:"8"}},[e._v("\n "+e._s(e.$t("credit_no_data"))+"\n ")])])],2)])],1)])],1)],1)},F=[],M=n("6422"),B={name:"LibraryConnectionStatus",props:{value:Boolean},data(){return{}},computed:{statusTextMap(){return{[WebSocket.CLOSED]:this.$t("offline"),[WebSocket.OPEN]:this.$t("connected"),[WebSocket.CONNECTING]:this.$t("connecting"),[WebSocket.CLOSING]:this.$t("offline")}},statusColorMap(){return{[WebSocket.CLOSED]:"red",[WebSocket.OPEN]:"green",[WebSocket.CONNECTING]:"none",[WebSocket.CLOSING]:"red"}},wsPeers(){return r["a"].gunPeers.filter((e=>"ws"===e.type))},wrtcPeers(){return r["a"].gunPeers.filter((e=>"wrtc"===e.type))}},methods:{getPeerId(e){if("tracker"!==e.from)return e.url;let t=parseInt(e.url.substring(20),16),n="",o=0;while(t>0)o=t%62,t=Math.floor(t/62),n+=o<36?o.toString(36):(o-26).toString(36).toUpperCase();return n.substring(0,9)},getPeerStatusIcon(e){return"syncing"===e.syncState?"syncing"===e.remoteSyncState?"import_export":"arrow_upward":"syncing"===e.remoteSyncState?"arrow_downward":"completed"===e.syncState?"completed"===e.remoteSyncState?"done_all":"done":"settings_ethernet"},getPeerStatusTooltip(e){return"syncing"===e.syncState?"syncing"===e.remoteSyncState?this.$t("syncing"):this.$t("uploading"):"syncing"===e.remoteSyncState?this.$t("downloading"):"completed"===e.syncState?"completed"===e.remoteSyncState?this.$t("sync_completed"):this.$t("uploaded"):this.$t("connecting")},byteToLarger(e){return Object(M["a"])(e,{byte:!1,gb:!1})},showServerHelp(){this.$alphabiz.dialog({title:this.$t("about_cache_node"),message:this.$t("about_cache_node_desc"),cancel:!0,ok:{label:this.$t("go_to_settings"),handler:e=>{this.$emit("input",!1),setTimeout((()=>{this.$router.push("/advanceSetting?highlight=custom-nodes")}),300),e.hide()}}})},async createCacheNode(){window.open("https://alpha.biz/blog/how-to-deploy-a-gun-server/","_blank")},editCacheNode(){setTimeout((()=>{this.$router.push("/advanceSetting?highlight=custom-nodes")}),300)}}},Q=B,W=(n("9f3a"),n("990e")),z=n("fc38"),H=n("cf25"),V=n("3714"),G=n("f106"),K=n("a431"),Y=Object(v["a"])(Q,U,F,!1,null,"54be07de",null),J=Y.exports;C()(Y,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSpace:W["a"],QBtn:O["a"],QSeparator:z["a"],QTooltip:H["a"],QMarkupTable:V["a"],QIcon:G["a"]}),C()(Y,"directives",{ClosePopup:K["a"]});var X=n("d7df"),Z=n("d310"),ee=n("3fd2"),te=n.n(ee),ne=(n("d4b5"),n("0598")),oe=n("f680"),ae=n("1926");console.log("===",ae["b"]);const se={_store:null,store:{favorites:[],ids:[]},_preNotify:null,_init(){if(Object(ne["default"])()){const e=n("f4b7");this._store=new e({name:"favorite",defaults:{favorites:[]}}),this.store=this._store.store}else{const e="ab-local-favorites",t=localStorage.getItem(e);this.store=t?JSON.parse(t):{favorites:[],ids:[]};const n=this.store;this._store={get(e){return console.log("get",e,n),n[e]},set(t,o){console.log("set",t,o,n),n[t]=o,localStorage.setItem(e,JSON.stringify(n))},clear(){console.log("clear"),localStorage.removeItem(e),se._init()}}}this.store.ids=this.store.favorites.map((e=>e.id))},set(e){for(const t of e)this.add(t)},add(e){if(this.store.ids.find((t=>t===e.id)))return;e.timestamp||(e.timestamp=Date.now());let t=0;for(const n of this.store.favorites){if(!(n.timestamp>e.timestamp))break;t++}this.store.favorites.splice(t,0,e),this.store.ids.splice(t,0,e.id),this._store.set("favorites",this.store.favorites)},remove(e,t){const n="string"===typeof e?e:e.id,o=this.store.ids.findIndex((e=>e===n));if(-1===o)return;const[a]=this.store.favorites.splice(o,1);if(this.store.ids.splice(o,1),this._store.set("favorites",this.store.favorites),!a)return;const s=oe["a"].create({message:ae["b"].t("removed_favorite")+a.title,group:!1,actions:[{label:ae["b"].t("undo"),handler(){se.add(a),t&&t(a)}}]});this._preNotify&&this._preNotify(),this._preNotify=s},list(){return this.store.favorites.sort(((e,t)=>t.timestamp-e.timestamp))},isFavorite(e){return this.store.ids.includes(e)},clear(){this._store.clear(),this.store.favorites.splice(0),this.store.ids.splice(0),this._store.set("favorites",this.store.favorites)}};se._init();var ie=se,re={name:"Library",mixins:[f["d"]],components:{Login:j,Recommend:R["a"],ConnectionStatus:J},data(){return{breadcrumbs:[{label:this.$t("library"),icon:"video_library",to:"/library"}],peerDialog:!1,isElectron:Object(Z["isElectron"])(),lib:r["a"]}},computed:{showRecommend(){return!!r["a"].isLoggedIn&&(!this.isVisitable(this.$route.fullPath)&&(r["a"].followingChannels.length?!r["a"].nonBlockFollowingChannels.length&&"ready"===r["a"].libStatus:!r["a"].isFirstRegister))},currentView(){const e=this.$route.path.replace(/^\//,"").split("/");return e},hasWrtcPeers(){return r["a"].gunPeers.filter((e=>"wrtc"===e.type)).length},statusColor(){if(this.hasWrtcPeers)return"green";if(!r["a"].online)return"red";switch(r["a"].onlineStatus){case"connected":return"green";case"connecting":return"yellow";case"reconnecting":return"yellow";default:return"red"}},statusLabel(){if(this.hasWrtcPeers)return this.$t("connected");if(!r["a"].online)return this.$t("offline");switch(r["a"].onlineStatus){case"connected":return this.$t("connected");case"connecting":return this.$t("connecting");case"reconnecting":return this.$t("connecting");default:return this.$t("unknown")}},isLoggedIn(){return this.lib.isLoggedIn}},methods:{isVisitable(e){return e.startsWith("/library/edit")||e.includes("preview=1")||e.includes("fromLink=1")||e.startsWith("/library/takedown")},getIcon(e){switch(e){case"following":return"star";case"explore":return"travel_explore";case"edit":return"edit_note"}return"list"}},beforeCreate(){if(te.a.mas()){const e=localStorage.getItem("__mas_library_user__");e||(console.log("clear store since no old user"),ie.clear()),r["a"].whenReady.then((()=>{var t;r["a"].user&&null!==(t=r["a"].user.is)&&void 0!==t&&t.pub&&(e&&e!==r["a"].user.is.pub&&(console.log("clear store since user changed",e,r["a"].user.is.pub),ie.clear()),localStorage.setItem("__mas_library_user__",r["a"].user.is.pub))}))}},mounted(){X["a"].on("open-library",(e=>{console.log("open library url:",e);const t=Object(h["d"])(e);if(!t||!t.id)return;let n=0;const o=()=>{const e=Object(h["c"])(t.id);e?(console.log("go library",e),this.$root.$emit("navigate-to"),this.$router.push(e+"&fromLink=1"),setTimeout((()=>this.$root.$emit("navigate-to",e)))):(console.log("cannot get id from channel list",t.id,e),n||this.$q.notify(this.$t("loading")),n++<5?setTimeout(o,2e3):this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}))};r["a"].whenReady.then(o)}))},watch:{"lib.libStatus":{handler(e){"ready"===e&&console.log("> library ready <")},immediate:!0},showRecommend(e){if(e){if(console.log("Show recommend. Redirect to library index"),"/library"===this.$route.path)return;this.$router.replace("/library")}}},beforeRouteUpdate(e,t,n){if(!e.path.startsWith("/library"))return n();const o=()=>!r["a"].isLoggedIn||!r["a"].nonBlockFollowingChannels.length&&"ready"===r["a"].libStatus;if(o()){if("/library/"===e.path||"/library"===e.path)return this.$root.$emit("navigate-to"),n(),void setTimeout((()=>{this.$root.$emit("navigate-to")}));if(this.isVisitable(e.fullPath))return this.$root.$emit("navigate-to"),n(),void setTimeout((()=>{this.$root.$emit("navigate-to",e.path)}));n()}else n()}},le=re,ce=(n("899b5"),n("7285"),n("99c4")),de=n("a829"),ue=n("a4ac"),he=n("90c4"),pe=n("c6f0"),me=Object(v["a"])(le,s,i,!1,null,"203f2a72",null),_e=me.exports;C()(me,"components",{QToolbar:ce["a"],QBtn:O["a"],QMenu:de["a"],QCard:E["a"],QSelect:ue["a"],QInput:D["a"],QIcon:G["a"],QSpace:W["a"],QBadge:he["a"],QBreadcrumbs:pe["a"]});var fe=n("d558"),ge=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-explore"},[n("div",{staticClass:"library-inner-container"},[n("VirtualScrollGrid",{staticClass:"library-grid",attrs:{virtualScrollSliceRow:30,itemWidth:560,itemHeight:473,gutter:8,itemsSize:e.searchFilteredPosts.length,itemsFn:function(t,n){return e.itemsFn(t,n-t)}},on:{"virtual-scroll":function(t){var n=t.from;return e.scrollIndex=n||0}},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("PostCard",{key:o.id,attrs:{followable:"",post:o,disableFollow:e.loadingNext},on:{preview:e.showPreviewImage,follow:e.follow,"to-channel":e.toChannelPage}})]}},{key:"after",fn:function(t){var o=t.mod,a=t.column;return[n("div",{directives:[{name:"intersection",rawName:"v-intersection",value:function(t){return e.shouldLoading(t,Math.max(Math.ceil(10/a),2)*a+(o?a-o:0))},expression:"(entry) => shouldLoading(entry, (Math.max(Math.ceil(10 / column), 2) * column) + (mod ? column - mod : 0))"}],staticClass:"rounded-borders bg-page column justify-center items-center",class:e.searchFilteredPosts.length?"q-mb-sm q-pa-md":"",style:e.searchFilteredPosts.length?{}:{height:"calc(100vh - var(--header-height) - var(--appbar-height) - 8px - env(safe-area-inset-bottom) - env(safe-area-inset-top))"}},[e.searchFilteredPosts.length||e.loadingPosts||!e.loadedAll?e.loadedAll&&!e.loadingPosts?n("div",[n("q-icon",{attrs:{name:"check_circle_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("got_all_post")))])],1):[n("div",[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))])]:n("div",[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)],2)]}}])}),e._e()],1),e._e(),n("BackToTop",{attrs:{show:e.scrollIndex>0||e.showBackToTop},on:{click:e.handleBackToTop}}),n("SearchChannel",{directives:[{name:"show",rawName:"v-show",value:!e.loadingPosts||e.filteredPosts.length,expression:"!loadingPosts || filteredPosts.length"}],attrs:{higher:e.scrollIndex>0||e.showBackToTop}}),e.allPosts.length||e.loadingPosts?e._e():n("div",{staticClass:"no-data"},[n("q-btn",{staticClass:"no-data-btn",attrs:{round:"",color:"primary",icon:"arrow_forward",size:"24px"},on:{click:e.goToFollowing}},[n("q-tooltip",[e._v(e._s(e.$t("no_recommend"))+" "+e._s(e.$t("lib_following")))])],1)],1),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1),n("Loading",{attrs:{value:e.loadingPosts&&!e.filteredPosts.length}})],1)},be=[],ye=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{directives:[{name:"intersection",rawName:"v-intersection",value:{handler:e.triggerPreload,threshold:0},expression:"{ handler: triggerPreload, threshold: 0 }"}],staticClass:"post-card overflow-hidden relative-position column no-wrap",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.24)",border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"},on:{mouseenter:function(){return e.onCardHover(!0)},mouseleave:function(){return e.onCardHover(!1)}}},[n("img",{staticClass:"absolute-top-left",staticStyle:{filter:"blur(24px)",transform:"scale(1.25)",opacity:"0.08"},attrs:{src:e.post.image,loading:"lazy"},on:{click:e.popupImage,error:e.onImageError,load:e.onImageLoaded}}),e.post.channel?n("div",[e.hideChannel?e._e():n("q-card-section",{staticClass:"post-channel-info no-wrap overflow-hidden row items-center"},[n("div",{staticClass:"channel cursor-pointer row items-center no-wrap",on:{click:e.toChannelPage}},[n("q-avatar",{staticClass:"shadow-2",staticStyle:{background:"#282828"},attrs:{size:"18"}},[e.isLoadedChannelImage?n("img",{attrs:{src:e.post.channel.image},on:{error:e.onChannelAvatarError,load:e.onChannelAvatarLoaded}}):e._e(),e.isLoadedChannelImage?e._e():n("q-icon",{staticStyle:{color:"#ccc"},attrs:{name:"subscriptions",size:"30px"}})],1),n("div",{staticClass:"channel-title q-ml-md ellipsis-2-lines",attrs:{title:e.post.channel.title}},[e._v("\n "+e._s(e.post.channel.title||e.$t("loading"))+"\n ")]),e.post.channel.hidden?n("span",{staticClass:"hidden-info text-grey q-ml-xs"},[e._v("("+e._s(e.$t("private_channel"))+")")]):e._e()],1),n("q-space"),n("FollowButton",{attrs:{id:e.post.channel.id,disableFollow:e.disableFollow}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:!e.hideChannel,expression:"!hideChannel"}],staticStyle:{margin:"0 -4px"}})],1):e._e(),n("q-card-section",{staticClass:"post-info q-pa-none overflow-hidden",class:e.$q.screen.width>=790?["row","no-wrap","justify-start","items-stretch"]:["column","no-wrap","justify-start","items-center"],style:{maxHeight:e.$q.screen.width>=790?"calc(16px * 2 + 360px)":"unset",flexGrow:1}},[n("div",{staticClass:"image",class:e.$q.screen.width>=790?["q-pa-md"]:["q-pa-sm"]},[n("div",{staticClass:"image-container row justify-center items-center"},[e.allowClickImage?n("img",{attrs:{src:e.post.image,loading:"lazy"},on:{click:e.popupImage,error:e.onImageError,load:e.onImageLoaded}}):e._e(),e.allowClickImage?e._e():n("q-icon",{attrs:{size:"80px",name:"video_file",color:"general"}})],1)]),n("div",{staticClass:"overflow-hidden full-width flex-grow column no-wrap q-pb-md",style:{marginLeft:e.$q.screen.width>=790?"-8px !important":"0"}},[n("div",{staticClass:"desc-main q-pa-sm"},[n("div",{staticClass:"text-bold desc-title row overflow-hidden full-width no-wrap items-center"},[n("div",{staticClass:"post-title q-mr-sm overflow-hidden",attrs:{title:e.post.title}},[n("div",{staticClass:"text-no-wrap ellipsis"},[e._v(e._s(e.post.title))])]),n("q-space"),n("q-btn",{staticClass:"favorite-icon block",attrs:{dense:"",flat:"",color:"primary","text-color":"primary",round:"",icon:e.isFavorite?"star":"star_border"},on:{click:e.setFavorite}},[n("q-tooltip",[e._v(e._s(e.isFavorite?e.$t("remove_from_local_favorites"):e.$t("add_to_local_favorites")))])],1),e.post.channel?n("q-btn",{staticClass:"block",attrs:{dense:"",flat:"",round:"",icon:"more_vert"}},[n("q-menu",[n("q-list",{staticStyle:{"min-width":"100px"}},[n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.follow}},[n("q-item-section",[e._v("\n "+e._s(e.followable?e.$t("follow"):e.$t("unfollow"))+"\n "+e._s(e.shortChannelTitle)+"\n ")])],1),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.share}},[n("q-item-section",[e._v("\n "+e._s(e.$t("share"))+"\n "+e._s(e.shortChannelTitle)+"\n ")])],1),n("q-separator"),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.blockChannel}},[n("q-item-section",[e._v("\n "+e._s(e.isBlocked?e.$t("unblock"):e.$t("block"))+"\n "+e._s(e.shortChannelTitle)+"\n ")])],1),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.blockUser}},[n("q-item-section",[e._v(e._s(e.isBlockedUser?e.$t("unblock_creator"):e.$t("block_creator")))])],1),e.lib.isLibAdmin?[n("q-separator"),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.takedownPost}},[n("q-item-section",[e._v(e._s(e.$t("takedown_post")))])],1)]:e._e()],2)],1)],1):e._e()],1),n("div",{staticClass:"text-subtitle2 q-mt-xs text-grey desc-time"},[n("span",[e._v(e._s(new Date(e.post.timestamp).toLocaleString()))]),n("q-badge",{staticClass:"q-ml-md bg-primary text-primary"},[e._v("\n "+e._s(e.post.rate||"G")+"\n "),n("q-tooltip",e._l(e.getRateText(e.post.rate).split("\n"),(function(t,o){return n("div",{key:o,staticClass:"rate-tip"},[e._v(e._s(t)+"\n ")])})),0)],1),e.subtitleLang?n("q-btn",{staticClass:"q-ml-sm",attrs:{dense:"",flat:"",size:"xs"}},[n("q-icon",{staticStyle:{"font-size":"22px"},attrs:{name:"subtitles"}}),n("q-tooltip",[e._v(e._s(e.$t("with_subtitle",{language:e.subtitleLang})))])],1):e._e()],1)]),n("div",{staticClass:"overflow-auto q-pa-sm",staticStyle:{"flex-grow":"1","flex-shrink":"1"}},[n("div",{staticClass:"full-width overflow-hidden"},e._l((e.post.description||"").split("\n"),(function(t,o){return n("div",{key:o,staticClass:"desc-para"},[e._v(e._s(t)+"\n ")])})),0)]),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.hideButtons,expression:"!hideButtons"}],staticClass:"text-center post-buttons q-pt-sm"},[e.post.abUrl||e.backAbUrl?n("div",{staticClass:"download-btns"},[e.addedStatus?n("q-btn",{staticClass:"q-px-sm",attrs:{unelevated:"",dense:"",flat:"",ripple:!1,label:"downloading"===e.addedStatus?e.$t("downloading"):e.$t("completed"),icon:"downloading"===e.addedStatus?"download":"done","text-color":"primary",color:"primary"},on:{click:e.toTaskInfo}},[n("q-tooltip",[e._v(e._s(e.$t("lib_already_added"))),n("br"),e._v(e._s(e.$t("click_to_task")))])],1):n("q-btn",{staticClass:"q-px-sm",attrs:{unelevated:"",dense:"","text-color":"primary",color:"primary",label:e.$t("download"),icon:"download"},on:{click:e.download}}),e.playFile||e.preloadFailed?!e.playFile&&e.preloadFailed?n("q-btn",{staticClass:"q-ml-sm q-px-sm cursor-inherit",attrs:{unelevated:"",dense:"",flat:"",ripple:!1,label:e.$t("play_while_downloading"),icon:"ondemand_video","text-color":"primary",color:"primary"}},[n("q-tooltip",[e._v(e._s(e.$t("post_preload_failed")))])],1):n("q-btn",{staticClass:"q-ml-sm q-px-sm",attrs:{unelevated:"",dense:"",label:e.$t("play"),icon:"play_arrow","text-color":"primary",color:"primary"},on:{click:e.play}}):n("q-btn",{staticClass:"q-ml-sm q-px-sm",attrs:{unelevated:"",dense:"",label:e.$t("play_while_downloading"),icon:"ondemand_video","text-color":"primary",color:"primary"},on:{click:e.triggerPlay}})],1):n("div",{staticClass:"no-ab-url"},[n("q-btn",{attrs:{unelevated:"",dense:"",disable:"",label:e.$t("loading")}})],1)])])]),e.screen$xs?n("div",{staticClass:"dialog-actions"},[n("q-separator"),n("q-card-section",{staticClass:"flex q-py-sm"},[n("q-space"),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",label:e.$t("cancel"),color:"general","text-color":"general",unelevated:""}})],1)],1):e._e()],1)},ve=[],we=n("a11f"),ke=n("fc3a"),Ce=n("c5a5");n("0c26");const{languages:$e}=n("1c53"),Se="https://www.opensubtitles.org/subtitleserve/sub/";function xe(){const e=["en","zh","es","fr","de","ru","pt"],t=[],n=[];return Object.entries($e).forEach((([o,a])=>{const s={label:`${a.native}(${o})`,value:o,name:a.name};e.includes(o)?n.push(s):t.push(s)})),[...n,...t]}function Te(e){let t="";for(const n of e)(n.lang||n.url)&&(t&&(t+="%%%"),t=t+n.lang+"%%"+n.url);return t}function Ie(e){const t=[];if(!e||""===e)return t;let n;n=e.includes("%%%")?e.split("%%%"):[e];for(const o of n){const e=o.split("%%");t.push({lang:e[0],url:e[1]})}return t}function Pe(e){let t=e,n="";if(!Array.isArray(e)&&"string"!==typeof e)return n;"string"===typeof e&&(t=Ie(e));for(const o of t)n.includes(o.lang)||(n&&(n+="、"),n+=o.lang);return n}async function Oe(e){const t=n("9ad5");let o=e.trim();return/^\d+$/.test(o)&&(o=`${Se}${o}`),console.log(`requestSubtitleUrl: [${o}]`),!!o.startsWith("http")&&new Promise((e=>{t({method:"get",url:o,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"},responseType:"stream"}).then((t=>{console.log("succ",t.status),e(!0)})).catch((t=>{var n,o;console.log("err",(null===(n=t.response)||void 0===n?void 0:n.status)||t.response||t),429===(null===(o=t.response)||void 0===o?void 0:o.status)&&e(!0),e(!1)}))}))}function qe(e){return/^\d+$/.test(e)}function Ee(e){return qe(e)?Se+e:e}var Ae=n("c033"),De=n("d710"),Ne=n.n(De);const Le=o["a"].observable([]);X["a"].on("preload-failed",(e=>{console.log("preload failed",e),Le.includes(e)||(Le.push(e),console.log(Le))})),X["a"].on("preload-done",(e=>{console.log("preload done",e),Le.includes(e)&&Le.splice(Le.indexOf(e),1)}));const je="requestIdleCallback"in window?requestIdleCallback:e=>setTimeout(e,100);async function Re({url:e,postTitle:t}){if(!Le.includes(e))return new Promise((n=>{je((()=>{X["a"].emit("preload-task",{url:e,postTitle:t}),n()}))}))}const Ue=document.querySelector("#q-app"),Fe=e=>new Promise((t=>setTimeout(t,e)));var Me={name:"PostCard",inject:["rootApp","io"],components:{FollowButton:Ae["a"]},props:{post:{type:Object,required:!0},hideChannel:{type:Boolean},hideButtons:{type:Boolean},disableFollow:{type:Boolean}},data(){return{scrollRoot:Ue,postCardHover:!1,allowClickImage:!0,animating:!1,followBtnHover:!1,pending:!1,favoriteNotifyFns:[],backAbUrl:"",isLoadedChannelImage:!0,isFavorite:ie.isFavorite(this.post.id),lib:r["a"],preloadTriggered:!1,notAvailable:Le}},computed:{followable(){return!r["a"].followingChannels.find((e=>{var t;return e.id===(null===(t=this.post.channel)||void 0===t?void 0:t.id)}))},isBlocked(){var e,t;return null===(e=r["a"].userData.blockChannels)||void 0===e?void 0:e.includes(null===(t=this.post.channel)||void 0===t?void 0:t.id)},isBlockedUser(){var e,t;return null===(e=r["a"].userData.blockUsers)||void 0===e?void 0:e.includes(null===(t=this.post.channel)||void 0===t?void 0:t.creator)},followBtnLabel(){return this.followable?this.$t("follow"):this.followBtnHover?this.$t("unfollow"):this.$t("following")},abKey(){const e=this.post.abUrl||this.backAbUrl;return e?Object(we["a"])(e.includes("://")?e:decodeURIComponent(e)):""},addedStatus(){var e;return(null===(e=r["a"].addedPostMap[this.abKey])||void 0===e?void 0:e.type)||!1},shortChannelTitle(){return this.post.channel&&this.post.channel.title?this.post.channel.title.length>12?this.post.channel.title.substring(0,10)+"...":this.post.channel.title:""},playFile(){var e;return null===(e=r["a"].addedPostMap[this.abKey])||void 0===e?void 0:e.playFile},settings(){var e,t;const n=(null===(e=this.post)||void 0===e||null===(t=e._)||void 0===t?void 0:t["#"])||this.post.soul,o=d["a"].state.setting,a={downloadDirectory:o.downloadDirectory,uploadSpeed:o.uploadSpeed,downloadSpeed:o.downloadSpeed,maximumDownloadNum:o.maximumDownloadNum,maximumConnectionsNum:o.maximumConnectionsNum,payedUserShareRadix:o.payedUserShareRadix,trackers:o.trackerList||[],postTitle:Object(h["b"])(this.post.title)};return n&&(a.fromPost=n),a},subtitleLang(){return Pe(this.post.subtitleList)},preloadFailed(){return this.notAvailable.includes(this.post.abUrl||this.backAbUrl)}},methods:{onCardHover(e){this.postCardHover=e},getRateText(e="G"){switch(e){case"G":return this.$t("rate_g_desc");case"PG":return this.$t("rate_pg_desc");case"PG-13":return this.$t("rate_pg_13_desc");case"R":return this.$t("rate_r_desc");case"NC-17":return this.$t("rate_nc_17_desc")}return this.$t("rate_g_desc")},confirm(e,t={ok:"",cancel:"",message:""}){const n={title:e,ok:t.ok||this.$t("ok"),cancel:t.cancel||this.$t("cancel")};return t.message&&(n.message=t.message),new Promise((e=>{this.$q.dialog(n).onOk((()=>e(!0))).onDismiss((()=>e(!1)))}))},popupImage(){console.log("popup",this.allowClickImage),this.allowClickImage&&this.$emit("preview",this.post.image)},async playAnimation(e,t="#downloading"){if(this.animating)return;this.animating=!0;const n=document.querySelector(t),o=n?n.getBoundingClientRect():{x:0,y:e.clientY,width:0,height:0},a={left:e.clientX-36+"px",top:e.clientY-36+"px"},s={left:o.x+o.width/3-36+"px",top:o.y+o.height/2-36+"px"},i=document.createElement("i");i.classList.add("q-icon","material-icons","text-primary"),i.innerHTML="video_file",i.style.position="absolute",i.style.fontSize="72px",i.style.left=a.left,i.style.top=a.top,i.style.opacity=0,i.style.transform="scale(2.5)",i.style.transition="0.4s ease",document.body.appendChild(i),await Fe(0),i.style.opacity=1,i.style.transform="scale(1)",await Fe(500),i.style.transition="1s ease",i.style.left=s.left,i.style.top=s.top,i.style.transform="scale(0.5)",i.style.opacity=0,await Fe(600),this.animating=!1,document.body.removeChild(i)},async triggerPlay(e){if(!d["a"].getters.accountUserInfo||!d["a"].getters.accountUserInfo.sub)return this.$q.dialog({message:this.$t("login_to_continue"),ok:this.$t("ok")});const t=this.post.abUrl||this.backAbUrl,o=t.includes(":")?t:decodeURIComponent(t);if("string"!==typeof o||!o.startsWith(Ne.a.shortProtocol+"://")&&!o.startsWith(Ne.a.protocol+"://")&&!o.startsWith("magnet:"))return this.$q.notify(this.$t("invalid_download_url")+": "+o);if(!Object(Z["isElectron"])()&&!Object(fe["a"])()){const e=n("c620").wtClient;if(e.torrents[0]){const t=n("7d7c").default;if(this.addedStatus)return t();const o=await this.confirm(this.$t("remove_old_task")+"?",{message:this.$t("remove_old_task_desc")});if(!o)return;e.torrents[0]&&await new Promise((t=>{e.torrents[0].destroy(t)}))}}this.playAnimation(e,"#drawer-player"),await Fe(600);const a=o.startsWith(Ne.a.shortProtocol+"://")?o.replace(Ne.a.shortProtocol+"://",`${Ne.a.protocol}://${encodeURIComponent(this.post.title)}/`):o;if(this.io.emit("download-and-play",{type:"magnet",url:a,token:a,subtitleList:Ie(this.post.subtitleList),...this.settings}),Object(Z["isElectron"])()||Object(fe["a"])()){var s;const e=await Object(Ce["a"])(a);if(!e)return;const t=null===(s=e.match(/([0-9a-fA-F]{40})/))||void 0===s?void 0:s[1];t&&d["a"].dispatch("remotePlay",t)}else{const{default:e}=n("7d7c"),{wtClient:t}=n("c620"),o=setInterval((()=>{t.torrents.length&&(clearInterval(o),e())}),100)}},async download(e){if(!d["a"].getters.accountUserInfo||!d["a"].getters.accountUserInfo.sub)return this.$q.dialog({message:this.$t("login_to_continue"),ok:this.$t("ok")});const t=this.post.abUrl||this.backAbUrl,o=t.includes(":")?t:decodeURIComponent(t);if("string"!==typeof o||!o.startsWith(Ne.a.shortProtocol+"://")&&!o.startsWith(Ne.a.protocol+"://")&&!o.startsWith("magnet:"))return this.$q.notify(this.$t("invalid_download_url")+": "+o);const a=o.startsWith(Ne.a.shortProtocol+"://")?o.replace(Ne.a.shortProtocol+"://",`${Ne.a.protocol}://${encodeURIComponent(this.post.title)}/`):o;console.log(a),console.group("subtitle"),console.log(this.post.subtitleList),console.table(Ie(this.post.subtitleList)),console.groupEnd();const s={type:"url",url:a,token:a,subtitleList:Ie(this.post.subtitleList),...this.settings};if(!Object(Z["isElectron"])()){const e=n("c620").wtClient;if(e.torrents[0]){const t=n("7d7c").default;if(this.addedStatus)return t();const o=await this.confirm(this.$t("remove_old_task"),{message:this.$t("remove_old_task_desc")});if(!o)return;e.torrents[0]&&await new Promise((t=>{e.torrents[0].destroy(t)}))}}this.io.emit("download_torrent",s),this.playAnimation(e,Object(Z["isElectron"])()?"#downloading":"#task-management")},checkChannel(){var e;const t=null===(e=this.post.channel)||void 0===e?void 0:e.id,n=r["a"].channelList.find((e=>e.id===t));return!(!t||!n)||(this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}),!1)},async follow(){if(this.pending)return;if(!this.checkChannel())return;const e=this.post.channel.id,t=!r["a"].followingChannels.find((t=>t&&t.id===e));if(!t){const e=await new Promise((e=>{this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>e(!1))).onDismiss((()=>e(!0)))}));if(e)return}this.pending=!0,setTimeout((()=>{!r["a"].followingChannels.find((t=>t.id===e))===t&&(console.log("follow failed!",e,t),t?r["a"].followChannel(e):r["a"].unfollowChannel(e)),this.pending=!1}),2e3),console.log("follow click",t),t?r["a"].followChannel(e):r["a"].unfollowChannel(e)},async share(){if(!this.checkChannel())return;const e=`${Ne.a.shortProtocol}-library://channel/${Object(h["b"])(this.post.channel.title)}/${this.post.channel.id}`;console.log("share",e);const t=await Object(Ce["a"])(e);if(console.log("converted url"),!t)return this.$q.notify(this.$t("uri_copy_failed"));Object(ke["a"])(t).then((()=>{this.$q.notify(this.$t("copied"))}))},async blockChannel(){if(!this.checkChannel())return;if(console.log("block channel",this.post.channel.id,this.isBlocked),this.isBlocked)return r["a"].unblockChannel(this.post.channel.id).then((e=>{console.log("unblock channel result",e)}));const e=await this.confirm(this.$t("block_channel"),{message:this.$t("block_channel_confirm"),ok:this.$t("block")});e&&r["a"].blockChannel(this.post.channel.id).then((e=>{console.log("block channel result",e)}))},async blockUser(){var e;if(console.log("block user",null===(e=this.post.channel)||void 0===e?void 0:e.creator,this.isBlockedUser),!this.post.channel||!this.post.channel.creator)return;if(this.isBlockedUser)return r["a"].unblockUser(this.post.channel.creator).then((e=>{console.log("unblock user result",e)}));const t=await this.confirm(this.$t("block_creator"),{message:this.$t("block_creator_confirm"),ok:this.$t("block")});t&&r["a"].blockUser(this.post.channel.creator).then((e=>{console.log("block user result",e)}))},toChannelPage(){this.checkChannel()&&this.$emit("to-channel",this.post.channel)},toTaskInfo(){var e;const t=null===(e=this.post.channel)||void 0===e?void 0:e.soul;let n=`/downloader?currentTab=${this.addedStatus}&abKey=${this.abKey}`;t&&(n+=`&channel=${encodeURIComponent(t)}`),this.post.id&&(n+=`&postId=${this.post.id}`),t&&this.post.id&&(n+=`&soul=${encodeURIComponent(t+"/posts/"+this.post.id)}`),console.log("to",this.abKey,this.addedStatus,t,this.post.id),console.log(n),this.$router.push(n)},setFavorite(){const e=this.post.id;var t,n,o,a,s,i,r,l,c,d,u,h,p,m,_;this.isFavorite?ie.remove({id:e},(()=>{this.isFavorite=ie.isFavorite(e)})):ie.add({id:this.post.id,title:this.post.title,description:this.post.description,image:this.post.image,abUrl:this.post.abUrl||this.backAbUrl,soul:null===(t=this.post)||void 0===t||null===(n=t._)||void 0===n?void 0:n["#"],subtitleList:this.post.subtitleList,channel:{id:null===(o=this.post)||void 0===o||null===(a=o.channel)||void 0===a?void 0:a.id,title:null===(s=this.post)||void 0===s||null===(i=s.channel)||void 0===i?void 0:i.title,description:null===(r=this.post)||void 0===r||null===(l=r.channel)||void 0===l?void 0:l.description,image:null===(c=this.post)||void 0===c||null===(d=c.channel)||void 0===d?void 0:d.image,soul:null===(u=this.post)||void 0===u||null===(h=u.channel)||void 0===h||null===(p=h._)||void 0===p?void 0:p["#"],creator:null===(m=this.post)||void 0===m||null===(_=m.channel)||void 0===_?void 0:_.creator}});this.isFavorite=ie.isFavorite(e)},play(){if(!Object(Z["isElectron"])()&&!Object(fe["a"])()&&this.addedStatus){const e=n("7d7c").default;return e()}const{infoHash:e,playFile:t}=r["a"].addedPostMap[this.abKey]||{};console.log("play",e,t);const o=t.path||t;d["a"].dispatch("remotePlay",e),X["a"].emit("play-torrent",{infoHash:e,filepath:o})},onChannelAvatarError(){this.isLoadedChannelImage=!1},takedownPost(){if(!r["a"].isLibAdmin||!this.post.id)return;if(20!==this.post.id.length)return this.$q.notify("Cannot parse post id");const e=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:e[0].value,type:"radio",items:e},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((e=>{console.log(e),["Serious Violation","Copyright Disputes","Adults Only"].includes(e)&&r["a"].takedown("post",this.post.id,e).then((()=>{this.$q.notify(this.$t("success"))}))}))},onChannelAvatarLoaded(e){e.target.src===this.post.channel.image&&(this.isLoadedChannelImage=!0)},onImageError(){this.allowClickImage=!1},onImageLoaded(e){e.target.src===this.post.image&&(this.allowClickImage=!0)},triggerPreload({isIntersecting:e}){if(e&&!this.preloadTriggered&&this.settings.postTitle)return this.preloadFailed?console.log("skip preload failed",this.settings.postTitle):this.addedStatus?console.log("skip added",this.settings.postTitle):void((this.post.abUrl||this.backAbUrl)&&(console.log(`Scroll into view ${this.settings.postTitle}`),this.preloadTriggered=!0,Re({url:this.post.abUrl||this.backAbUrl,postTitle:this.settings.postTitle})))}},activated(){var e,t;this.post.abUrl||(console.log("no aburl",{...this.post}),null!==(e=this.post)&&void 0!==e&&null!==(t=e.channel)&&void 0!==t&&t.soul&&this.post.id&&p["v"].get(this.post.channel.soul+"/posts/"+this.post.id).on(((e,t,n,o)=>{e&&e.abUrl&&(console.log("Get abUrl for",this.post.id,e.abUrl),this.backAbUrl=e.abUrl,o.off())})));this.isFavorite=ie.isFavorite(this.post.id)}},Be=Me,Qe=(n("89d2"),n("9f3e")),We=n("e7c2"),ze=n("b329"),He=n("25fb"),Ve=n("bcaf"),Ge=n("fa4f"),Ke=Object(v["a"])(Be,ye,ve,!1,null,"1374bed6",null),Ye=Ke.exports;C()(Ke,"components",{QCard:E["a"],QCardSection:A["a"],QAvatar:Qe["a"],QIcon:G["a"],QSpace:W["a"],QSeparator:z["a"],QBtn:O["a"],QTooltip:H["a"],QMenu:de["a"],QList:We["a"],QItem:ze["a"],QItemSection:He["a"],QBadge:he["a"],QDialog:q["a"],QVirtualScroll:Ve["a"]}),C()(Ke,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var Je=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page-sticky",{staticClass:"back-to-top",attrs:{position:"bottom-right"}},[n("transition",{attrs:{name:"animate"}},[n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"back-btn q-ma-xs",class:{hide:e.hide},attrs:{fab:"","no-wrap":"",size:"18px",color:"primary","text-color":"primary",icon:"publish"},on:{click:e.onClick}},[n("div",{staticClass:"fab-inner-text"},[e._v("\n "+e._s(e.$t("back_to_top"))+"\n ")])])],1)],1)},Xe=[],Ze={name:"BackToTop",props:{show:Boolean},data(){return{hide:!1,hovered:!1}},methods:{onClick(){this.$emit("click")}},activated(){this.hide=!0,setTimeout((()=>{this.hide=!1}),300)},deactivated(){this.hide=!0}},et=Ze,tt=(n("3408"),n("84f9")),nt=Object(v["a"])(et,Je,Xe,!1,null,"ec8a50cc",null),ot=nt.exports;C()(nt,"components",{QPageSticky:tt["a"],QBtn:O["a"]});var at=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"search-channel"},[n("div",{staticClass:"fixed-bottom-right show-search-channel",class:{higher:e.higher}},[n("q-btn",{staticClass:"channel-search-btn q-ma-xs",class:{hide:e.hide},attrs:{fab:"","no-wrap":"",size:"18px",color:"primary","text-color":"primary",icon:"library_add"},on:{click:function(t){e.showDialog=!0}}},[n("div",{staticClass:"fab-inner-text"},[e._v(e._s(e.$t("search")))])])],1),n("q-dialog",{attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{hide:e.clearInput},model:{value:e.showDialog,callback:function(t){e.showDialog=t},expression:"showDialog"}},[n("q-card",{staticClass:"search-dialog overflow-hidden"},[n("q-card-section",{staticClass:"flex items-center q-py-sm"},[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v(e._s(e.$t("search_for_channel")))]),n("q-space"),n("q-btn",{attrs:{flat:"",round:"",icon:"close"},on:{click:function(t){e.showDialog=!1}}})],1),n("q-card-section",{staticClass:"column items-stretch q-pt-none",staticStyle:{overflow:"visible"}},[n("div",{staticClass:"search-textfield"},[n("q-input",{attrs:{type:"text",outlined:"",dense:"",autofocus:"",label:this.$t("channel")+" ID",placeholder:"%abcd1234"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search.apply(null,arguments)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{color:"primary",name:"search"},on:{click:e.search}})]},proxy:!0}]),model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}})],1),n("q-scroll-area",{staticClass:"items-center",staticStyle:{height:"calc(100vh - 256px)",margin:"4px auto 0",width:"100%"}},[n("div",{staticClass:"search-results full-width flex justify-center items-stretch"},[e._l(e.searchResults,(function(t){return n("ChannelCard",e._b({key:t.id,attrs:{followable:!e.lib.followingChannels.find((function(e){return e.id===t.id}))},on:{detail:e.detail,follow:e.follow}},"ChannelCard",t,!1))})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i")],2)])],1)],1)],1)],1)},st=[],it=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"channel-card column relative-position overflow-hidden rounded-borders",style:{border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"},attrs:{flat:""}},[n("q-img",{staticClass:"channel-image absolute-top-left full-height",staticStyle:{filter:"blur(24px) saturate(1.5)",opacity:"0.2",transform:"scale(1.25)"},attrs:{src:e.image,ratio:1,"placeholder-src":"platform-assets/windows/icon/Wide310x150Logo.scale-240.png"}}),n("div",{staticClass:"image-container overflow-hidden",staticStyle:{"border-top-left-radius":"4px!important","border-top-right-radius":"4px!important"}},[n("q-img",{staticClass:"channel-image cursor-pointer",attrs:{contain:"",src:e.image,ratio:1},on:{click:e.detail,error:e.onImageError},scopedSlots:e._u([{key:"error",fn:function(){return[n("div",{staticClass:"absolute-bottom"},[n("div",{staticClass:"text-h6 ellipsis-3-lines overflow-hidden"},[n("q-icon",{attrs:{name:"video_library"}}),e._v("\n "+e._s(e.title)+"\n ")],1)]),n("q-tooltip",[e._v(e._s(e.editable?e.$t("edit_posts"):e.$t("channel_detail")))])]},proxy:!0}])},[e.image&&e.isHaveImage?e._e():n("q-icon",{staticClass:"absolute-center",staticStyle:{color:"#ccc"},attrs:{size:"90px",name:"subscriptions"}}),n("div",{staticClass:"absolute-bottom"},[n("div",{staticClass:"text-h6 ellipsis-3-lines overflow-hidden"},[e._v("\n "+e._s(e.title)+"\n ")])]),n("q-tooltip",[e._v(e._s(e.editable?e.$t("edit_posts"):e.$t("channel_detail")))])],1)],1),n("q-card-section",{staticClass:"q-py-none",staticStyle:{overflow:"visible"}},[n("div",{staticClass:"q-pa-none row",staticStyle:{margin:"0 -16px"}},[n("div",{staticClass:"q-py-sm q-px-sm q-pl-md",attrs:{"data-cy":"channel-ID"}},[e._v("ID: "+e._s(e.id))]),n("q-space"),n("q-btn",{staticClass:"q-py-xs q-px-sm",attrs:{unelevated:"",icon:"content_copy",size:"xs",dense:""},on:{click:e.copyId}}),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-py-xs q-px-sm",attrs:{unelevated:"",icon:"block",size:"xs",dense:""},on:{click:e.takedown}},[n("q-tooltip",[e._v(e._s(e.$t("takedown_channel")))])],1):e._e()],1),n("div",{staticClass:"q-px-md channel-desc",staticStyle:{margin:"0 -16px"}},[e._v(e._s(e.description))]),n("div",{staticClass:"channel-tags",staticStyle:{margin:"4px -4px 0"}},[e.isBlocked?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"negative","text-color":"negative"}},[e._v(e._s(e.$t("blocked")))]):e._e(),e.hidden?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"general","text-color":"general"}},[e._v(e._s(e.$t("private_channel")))]):e._e()],1)]),n("q-space"),e.hideFollow?n("q-card-actions",[e.editable?n("q-btn",{attrs:{flat:"",icon:"delete",color:"negative"},on:{click:function(t){return t.stopPropagation(),e.remove.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("remove_channel"))+"\n ")])],1):e._e(),n("q-space"),e.editable?n("q-btn",{attrs:{flat:"",icon:"edit"},on:{click:function(t){return t.stopPropagation(),e.detail.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("edit_channel"))+"\n ")])],1):e._e(),e.editable?n("q-btn",{attrs:{flat:"",icon:"find_in_page"},on:{click:function(t){return t.stopPropagation(),e.preview.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("preview"))+"\n ")])],1):e._e(),e.editable?n("q-btn",{attrs:{flat:"",icon:"settings"},on:{click:function(t){return t.stopPropagation(),e.edit.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("channel_setting"))+"\n ")])],1):e._e()],1):n("q-card-actions",{staticClass:"flex justify-center items-center"},[n("FollowButton",{staticClass:"q-my-sm",attrs:{id:e.id}})],1)],1)},rt=[],lt=n("aa8a"),ct={name:"ChannelCard",components:{FollowButton:Ae["a"]},data(){return{isHaveImage:!0,lib:r["a"]}},props:{title:{type:String,required:!0},description:{type:String,required:!0},image:{type:String,required:!0},id:{type:String,default:""},soul:{type:String,default:""},hidden:{type:Boolean},editable:{type:Boolean},hideFollow:{type:Boolean},followable:{type:Boolean}},watch:{image(e,t){e&&e!==t&&(this.isHaveImage=!0)}},computed:{isBlocked(){return r["a"].userData.blockChannels.includes(this.id)}},methods:{copyId(){Object(lt["b"])(this.id).then((()=>{this.$q.notify(this.$t("copied_to_clipboard"))}))},edit(){this.editable&&this.$emit("edit",this.id)},detail(){this.$emit("detail",this.id)},onImageError(){this.isHaveImage=!1},preview(){this.$emit("preview",this.id)},follow(){this.$emit("follow",this.id)},remove(){this.$emit("remove-channel",this.id)},takedown(){if(!r["a"].isLibAdmin||!this.id)return;if(20!==this.id.length)return this.$q.notify("Cannot parse post id");const e=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:e[0].value,type:"radio",items:e},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((e=>{console.log(e),["Serious Violation","Copyright Disputes","Adults Only"].includes(e)&&r["a"].takedown("channel",this.id,e).then((()=>{this.$q.notify(this.$t("success"))}))}))}}},dt=ct,ut=(n("4b8c"),n("9767")),ht=Object(v["a"])(dt,it,rt,!1,null,"37cd58ed",null),pt=ht.exports;C()(ht,"components",{QCard:E["a"],QImg:ut["a"],QIcon:G["a"],QTooltip:H["a"],QCardSection:A["a"],QSpace:W["a"],QBtn:O["a"],QBadge:he["a"],QCardActions:N["a"]});var mt={name:"SearchChannel",props:{higher:Boolean},components:{ChannelCard:pt},data(){return{hide:!1,showDialog:!1,searchText:"",searchResults:[],lib:r["a"]}},methods:{clearInput(){this.searchText="",this.searchResults=[]},search(){if(console.log("search",this.searchText),!this.searchText||!this.searchText.trim())return this.$q.dialog({message:this.$t("please_input_channel_id"),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}});const e=this.searchText.trim().replace(/^%/,""),t=r["a"].channelList.filter((t=>!!(t&&t.title&&t.id)&&(t.hidden?t.id===e:t.id.includes(e))));this.searchResults=t,t.length||this.$q.dialog({message:this.$t("search_channel_no_result",[e]),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}})},follow(e){const t=!r["a"].followingChannels.find((t=>t.id===e));if(t)return r["a"].followChannel(e);this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)}))},detail(e){const t=r["a"].allChannelList.find((t=>t.id===e&&t.title&&t.creator));if(!t)return this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}});console.log("find ch",t);const n=["id","title"].map((e=>{const n=t[e];return e+"="+encodeURIComponent(n)})).join("&"),o=`/library/channel?${n}`;this.$root.$emit("navigate-to",o),this.$router.push(o)}},activated(){this.hide=!0,setTimeout((()=>{this.hide=!1}),300)},deactivated(){this.hide=!0,this.clearInput()}},_t=mt,ft=(n("6792"),n("c782")),gt=Object(v["a"])(_t,at,st,!1,null,"1c919252",null),bt=gt.exports;C()(gt,"components",{QBtn:O["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSpace:W["a"],QInput:D["a"],QIcon:G["a"],QScrollArea:ft["a"]});var yt=n("c49d");const vt={data(){return{isActive:!1,searchText:"",lib:r["a"]}},activated(){this.isActive=!0,this.searchText=r["a"].search.text.trim()},deactivated(){this.isActive=!1},watch:{"lib.search.text"(e){this.isActive&&(this.searchText=e.trim())}}};var wt=function(e){const t=function(){return"index"===e||"explore"===e?this.searchFilteredPosts:"favorite"===e?this.filteredFavorites:void 0},n=async function(){this.loader$loadPostsNext?await this.loader$loadPostsNext({count:6}):this.loadNext&&await this.loadNext()};return{data(){return{pagination:{descending:!0,page:1,rowsPerPage:6}}},computed:{tableData:t,pagesNumber(){return Math.ceil(this.tableData.length/this.pagination.rowsPerPage)},currentPageNumber(){return this.pagination.page}},watch:{async currentPageNumber(e){const t=this.$el.querySelector(".library-table>.q-table__grid-content");if(t.scrollTop=0,e===this.pagesNumber)try{this.loading=!0,console.log("query"),await n.call(this)}catch(o){this.$q.notify({type:"negative",position:"bottom-right",message:o.message})}finally{this.loading=!1}}}}};let kt=null;var Ct={data(){return{showBackToTop:!1,scrollContentSelector:".virtual-scroll-grid-wrapper"}},methods:{handleBackToTop(){if(this.showBackToTop){const e=this.$el.querySelector(this.scrollContentSelector);if(!e)return;e.scrollTop=0}else{if(!this.$refs.vscroll)return;this.$refs.vscroll.scrollTo(0,"start")}}},mounted(){const e=this.$el.querySelector(this.scrollContentSelector),t=()=>{this.showBackToTop=e.scrollTop>0};e&&(e.addEventListener("scroll",t),kt=()=>e.removeEventListener("scroll",t))},beforeDestroy(){kt&&kt()}},$t={name:"LibraryExplore",components:{PostCard:Ye,BackToTop:ot,SearchChannel:bt,Loading:S},mixins:[vt,wt("explore"),Ct],data(){return{isElectron:Object(Z["isElectron"])(),active:!1,showPreview:!1,previewImage:"",loadingPosts:!1,loadTimer:null,allPosts:[],loadingNext:!1,loadedAll:!0,loadedChannels:[],loadedPostIds:[],scrollIndex:0,loadingIntersecting:!1,loadStartTime:Date.now(),lib:r["a"]}},computed:{nonFollowingChannels(){const e=this.lib.followingChannels.map((e=>e.id)),t=this.lib.userData.blockChannels,n=this.lib.userData.blockUsers;return this.lib.channelList.filter((o=>!t.includes(null===o||void 0===o?void 0:o.id)&&(!n.includes(null===o||void 0===o?void 0:o.creator)&&!e.includes(null===o||void 0===o?void 0:o.id)))).filter((e=>e))},filteredPosts(){return this.allPosts.filter((e=>e.title&&e.timestamp)).filter((e=>r["a"].isValidRate(e.rate||"G")))},searchFilteredPosts(){const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{switch(t){case"channel":return e.channel.title;case"channelID":return e.channel.id;default:return e.title}},o=o=>{var a,s;if(!o||!o.title)return!1;if(!e)return!0;const i=Object(h["a"])(null===(a=n(o))||void 0===a?void 0:a.toLowerCase());return"channelID"===t&&e===i||(null===(s=o.channel)||void 0===s||!s.hidden)&&i.includes(e)};console.time("filter");const a=this.filteredPosts.filter(o);return console.timeEnd("filter"),a},allPostToFetch(){const e=[];return this.loadedChannels.forEach((({channel:t,ids:n})=>{n.forEach((n=>{this.loadedPostIds.includes(n)||e.push({channel:t,postId:n})}))})),e}},methods:{onScroll(e){this.scrollIndex=e.index},itemsFn(e=0,t=5){return Object(yt["a"])("vitem",e,t),this.searchFilteredPosts.slice(e,e+t)},shouldLoading(e,t){this.loadingIntersecting=e.isIntersecting,e.isIntersecting&&this.loadNext(t)},async loadNext(e=24){if(!this.active)return!1;if(this.loadingNext)return;this.loadingNext=!0,this.allPostToFetch.sort(((e,t)=>e.postId&&t.postId?e.postId.localeCompare(t.postId):0));const t=this.allPostToFetch.slice(0,e);if(Object(yt["a"])("Load Next",t),!t.length)return this.loadingNext=!1,this.loadedAll=!0,void setTimeout((()=>{Object(yt["a"])("try load more"),this.loadPostList()}),3e3);this.loadedAll=!1;const n=await Promise.all(t.map((async({channel:e,postId:t},n)=>(await new Promise((e=>setTimeout(e,Math.floor(Math.random()*n*500)))),{channel:e,post:await r["a"].getPostById(e.id,t,!0)}))));Object(yt["a"])("fetch results",n),n.forEach((({channel:e,post:t})=>{var n;t&&"object"===typeof t&&(e.hidden&&e.creator!==(null===(n=r["a"].user.is)||void 0===n?void 0:n.pub)||(t.channel=e,this.allPosts.push(t)))})),this.loadedPostIds.push(...t.map((e=>e.postId))),this.loadingNext=!1,setTimeout((()=>{Object(yt["a"])("should load next",this.loadingIntersecting),this.loadingIntersecting&&this.loadNext()}),200)},loadPostList(){if(!this.active)return;if(this.loadStartTime+15e3e.id===this.loadedChannels[t].channel.id))||this.loadedChannels.splice(t--,1);const e=this.nonFollowingChannels.filter((e=>!(!e.title||!e.id)&&!this.loadedChannels.find((t=>t.channel.id===e.id))));Promise.all(e.map((async(e,t)=>r["a"].getChannelPostIds(e.id,!0).then((t=>{const n=this.loadedChannels.find((t=>t.channel.id===e.id));if(Object(yt["a"])("[Explore] get channel post ids",e.id,t,!n),n?t.forEach((e=>{n.ids.includes(e)||n.ids.push(e)})):this.loadedChannels.push({channel:e,ids:t}),this.active&&!this.allPosts.length){if(this.loadedChannels.length<7&&this.nonFollowingChannels.length>2)return;this.loadNext()}}))))).then((()=>{if(this.allPosts.length)this.loadingPosts=!1;else{if(!this.active)return;setTimeout((()=>{this.loadingPosts=!1,this.allPosts.length||this.loadPostList()}),2e3)}this.active&&this.loadingIntersecting&&this.loadNext()}))},prune(){const e=this.nonFollowingChannels.map((e=>e.id));for(let o=0;o(t.ids&&e.push(...t.ids),e)),[]);for(let o=0;othis.allPosts[o].id===e));e.includes(null===(n=this.allPosts[o].channel)||void 0===n?void 0:n.id)&&t.includes(this.allPosts[o].id)||(this.allPosts.splice(o--,1),-1!==a&&this.loadedPostIds.splice(a,1))}for(let o=0;oe.id===this.loadedPostIds[o]))||this.loadedPostIds.splice(o--,1)},showPreviewImage(e){this.previewImage=e,this.showPreview=!0},toChannelPage(e){Object(yt["a"])("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&"),n=`/library/channel?${t}`;this.$root.$emit("navigate-to",n),this.$router.push(n)},follow(e){this.lib.followChannel(e).then((t=>{Object(yt["a"])("followed",e,t)}))},goToFollowing(){this.$router.push("/library/following")},setSearch(){this.lib.setSearchOption([{label:this.$t("post_title"),value:"post"},{label:this.$t("channel_title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},activated(){this.active=!0,this.prune(),this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/explore"),this.loadStartTime=Date.now(),this.loadPostList();const e=this;"explore"in window||Object.defineProperty(window,"explore",{get(){return e.loadedChannels}})},deactivated(){this.active=!1},mounted(){this.loadPostList(),this.setSearch()},watch:{nonFollowingChannels(e,t){if(e.length!==t.length){for(let t=0;te.id===this.loadedChannels[t].channel.id))||this.loadedChannels.splice(t--,1);this.loadPostList()}},"lib.search.text"(e){this.isActive&&(this.searchText=e)},"searchFilteredPosts.length"(e,t){t||!e||this.active||(console.log("change length"),this.$router.push("/library/explore"))},searchText(e){e&&this.active&&this.handleBackToTop()}},beforeRouteEnter(e,t,n){n((e=>{t.path.startsWith("/library")&&e.setSearch()}))},beforeRouteLeave(e,t,n){clearTimeout(this.loadTimer),n()}},St=$t,xt=(n("6580"),n("7027")),Tt=n("8a98"),It=n("526f"),Pt=n("d919"),Ot=n("32d0"),qt=n("f065"),Et=Object(v["a"])(St,ge,be,!1,null,"872ead0c",null),At=Et.exports;C()(Et,"components",{QIcon:G["a"],QSpinnerIos:xt["a"],QTable:Tt["a"],QLinearProgress:It["a"],QSeparator:z["a"],QPagination:Pt["a"],QVirtualScroll:Ve["a"],QBtn:O["a"],QTooltip:H["a"],QInnerLoading:Ot["a"],QSpinnerGears:qt["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QCardActions:N["a"]}),C()(Et,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var Dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"scrollEl",staticClass:"library-following row justify-center",class:{web:!e.isElectron}},[e._l(e.filteredChannels,(function(t){return n("ChannelCard",{key:t.id,attrs:{id:t.id,title:t.title,description:t.description,image:t.image,soul:t.soul,hidden:t.hidden,followers:e.lib.channelFollowerCount[t.id],followable:!1,blocked:e.blockMap[t.id]},on:{detail:e.showChannelDetail,follow:e.unfollow}})})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),e.followings.length?e._e():n("div",{staticClass:"no-data"},[n("q-btn",{staticClass:"no-data-btn",attrs:{round:"",color:"primary","text-color":"primary",icon:"arrow_forward",size:"24px"},on:{click:e.goToExplore}},[n("q-tooltip",[e._v(e._s(e.$t("no_following"))+" "+e._s(e.$t("lib_explore")))])],1)],1),n("BackToTop",{attrs:{show:e.scrollOffset>0},on:{click:e.scrollTop}}),n("SearchChannel",{attrs:{higher:e.scrollOffset>0}})],2)},Nt=[],Lt=n("018b"),jt={name:"LibraryFollowing",components:{ChannelCard:pt,SearchChannel:bt,BackToTop:ot},mixins:[vt],data(){return{isElectron:Object(Z["isElectron"])(),scrollOffset:0,lib:r["a"]}},computed:{followings(){return this.lib.followingChannels.filter((e=>!r["a"].isBannedChannel(e)&&(e.title&&e.id)))},blockMap(){const e={};return r["a"].userData&&r["a"].userData.blockChannels?(this.followings.forEach((t=>{(r["a"].userData.blockChannels.includes(t.id)||r["a"].userData.blockUsers.includes(t.creator))&&(e[t.id]=!0)})),e):e},filteredChannels(){const e=this.searchText.toLowerCase();if(!e)return this.followings;const t=r["a"].search.option.value,n=e=>{switch(t){case"channelID":return e.id;default:return e.title}},o=t=>{const o=n(t);return Object(h["a"])(null===o||void 0===o?void 0:o.toLowerCase()).includes(e)};return this.followings.filter(o)}},methods:{scrollTop(){this.$refs.scrollEl.scrollTo(0,0)},showChannelDetail(e){const t=this.followings.find((t=>t.id===e));console.log("to",t);const n=["id","title"].map((e=>{const n=t[e];return encodeURIComponent(e)+"="+encodeURIComponent(n)})).join("&"),o=`/library/channel?${n}`;this.$root.$emit("navigate-to",o),this.$router.push(o)},unfollow(e){this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)}))},goToExplore(){this.$root.$emit("navigate-to"),this.$router.push("/library/explore")},setSearch(){this.lib.setSearchOption([{label:this.$t("title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},activated(){this.setSearch(),this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/following"),this.$refs&&this.$refs.scrollEl&&this.$refs.scrollEl.scrollTo(0,this.scrollOffset)},mounted(){this.setSearch(),this.$refs&&this.$refs.scrollEl&&this.$refs.scrollEl.addEventListener("scroll",Object(Lt["a"])((()=>{this.scrollOffset=this.$refs.scrollEl.scrollTop})))},watch:{searchText(e){e&&this.active&&this.scrollTop()}}},Rt=jt,Ut=(n("3d7e"),Object(v["a"])(Rt,Dt,Nt,!1,null,"0a6f4e44",null)),Ft=Ut.exports;C()(Ut,"components",{QBtn:O["a"],QTooltip:H["a"]});var Mt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"scrollEl",staticClass:"local-favorite",class:{web:!e.isElectron}},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"input-file",accept:".json"},on:{change:e.onFileChange}}),n("div",{staticClass:"library-inner-container"},[n("VirtualScrollGrid",{staticClass:"library-grid",attrs:{virtualScrollSliceRow:30,itemWidth:560,itemHeight:473,gutter:8,itemsSize:e.filteredFavorites.length,itemsFn:function(t,n){return e.filteredFavorites.slice(t,n)}},on:{"virtual-scroll":function(t){var n=t.from;return e.scrollIndex=n||0}},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("PostCard",{key:o.id,attrs:{post:o,followable:!e.lib.followingChannels.some((function(e){return e.id===o.channel.id}))},on:{follow:e.onFollow,preview:e.preview,"to-channel":e.toChannelPage}})]}},{key:"after",fn:function(){return[n("div",{staticClass:"rounded-borders bg-page column justify-center items-center",class:e.filteredFavorites.length?"q-mb-sm q-pa-md":"",style:e.filteredFavorites.length?{}:{height:"calc(100vh - var(--header-height) - var(--appbar-height) - 8px)"}},[e.filteredFavorites.length?e._e():n("div",[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)])]},proxy:!0}])}),e._e()],1),e._e(),n("BackToTop",{attrs:{show:e.scrollIndex>0||e.showBackToTop},on:{click:e.handleBackToTop}}),n("div",{staticClass:"fixed-bottom-right save-or-load",class:{higher:e.scrollIndex>0||e.showBackToTop}},[n("q-btn",{staticClass:"backup-btn q-ma-xs",class:{hide:e.hideBtn},attrs:{fab:"","no-wrap":"",size:"18px",color:"primary",icon:"source"},on:{click:e.saveOrLoad}},[n("div",{staticClass:"fab-inner-text"},[e._v(e._s(e.$t("backup")))])])],1),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1),n("q-dialog",{model:{value:e.showDialog,callback:function(t){e.showDialog=t},expression:"showDialog"}},[n("q-card",[n("q-card-section",{staticClass:"row"},[n("div",{staticClass:"text-h6 col-12"},[e._v(e._s(e.$t("import_or_export_favorites")))]),n("div",{staticClass:"col-12"},[e._v("\n Total: "+e._s(e.favorites.length)+"\n ")]),n("div",{staticClass:"btns col-12 text-right q-mt-md"},[n("q-btn",{attrs:{color:"primary",flat:"",icon:"save",label:e.$t("export_local_favorites")},on:{click:e.exportData}}),n("FileSelector",{attrs:{accept:{name:"JSON",extensions:["json"]}},on:{select:e.onFileChange}},[n("q-btn",{staticClass:"q-ml-md",attrs:{color:"primary",flat:"",icon:"add",label:e.$t("import_favorites_file")}})],1)],1)])],1)],1)],1)},Bt=[],Qt=n("9a50"),Wt={name:"LibraryFavorite",components:{PostCard:Ye,BackToTop:ot,FileSelector:Qt["a"]},mixins:[vt,wt("favorite"),Ct],data(){return{isElectron:Object(Z["isElectron"])(),hideBtn:!1,favorites:ie.list(),scrollIndex:0,showPreview:!1,previewImage:"",showDialog:!1,lib:r["a"]}},computed:{filteredFavorites(){const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{var n;switch(t){case"channel":return null===(n=e.channel)||void 0===n?void 0:n.title;case"postID":return e.id;case"postDesc":return e.description;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(e)};return this.favorites.filter(o)}},methods:{onScroll(e){this.scrollIndex=e.index},preview(e){this.previewImage=e,this.showPreview=!0},remove(e){return ie.remove(e)},saveOrLoad(){this.showDialog=!0},exportData(){Object(h["h"])(JSON.stringify({favorites:this.favorites}),"favorites.json"),this.showDialog=!1},importData(){console.log(this.$refs.fileSelector),this.$refs.fileSelector.value="",this.$refs.fileSelector.click()},onFileChange(e){e&&Object(h["g"])(e).then((e=>{if(!e)return this.$q.notify("Cannot read data from this file");const t=JSON.parse(e);if(!t.favorites||!Array.isArray(t.favorites))return this.$q.notify(this.$t("not_a_favorite_file"));ie.set(t.favorites),this.showDialog=!1}))},onFollow(e){if(r["a"].followingChannels.some((t=>t.id===e||t.soul===e)))return console.log("unfollow"),r["a"].unfollowChannel(e).then(console.log);console.log("follow"),r["a"].followChannel(e).then(console.log)},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&"),n=`/library/channel?${t}`;this.$root.$emit("navigate-to",n),this.$router.push(n)},setSearch(){this.lib.setSearchOption([{label:this.$t("post_title"),value:"postTitle"},{label:this.$t("description"),value:"postDesc"},{label:this.$t("channel_title"),value:"channel"}])}},activated(){this.setSearch(),this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/favorite"),this.hideBtn=!0,setTimeout((()=>{this.hideBtn=!1}),300)},deactivated(){this.hideBtn=!0},watch:{searchText(e){e&&this.active&&this.handleBackToTop()}}},zt=Wt,Ht=(n("2377"),Object(v["a"])(zt,Mt,Bt,!1,null,"c0faef30",null)),Vt=Ht.exports;C()(Ht,"components",{QIcon:G["a"],QTable:Tt["a"],QLinearProgress:It["a"],QSpinnerIos:xt["a"],QSeparator:z["a"],QPagination:Pt["a"],QVirtualScroll:Ve["a"],QBtn:O["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QCardActions:N["a"]}),C()(Ht,"directives",{ClosePopup:K["a"]});var Gt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"edit-container"},[n("div",{ref:"scrollArea",staticClass:"edit-main flex items-stretch justify-center"},[n("div",{staticClass:"add-channel rounded-borders bg-general q-ma-sm flex justify-center items-center column",staticStyle:{"min-height":"290px"}},[n("div",{staticClass:"add-channel-panel relative-position"},[n("q-btn",{directives:[{name:"intersection",rawName:"v-intersection",value:e.intersect,expression:"intersect"}],staticClass:"add-channel-btn block absolute-left",attrs:{round:"",unelevated:"",color:"primary","text-color":"primary",icon:"add_circle_outline",size:"24px"},on:{click:e.add}},[n("q-tooltip",[e._v(e._s(e.$t("add_channel")))])],1),n("q-btn",{staticClass:"quick-start block absolute-right",attrs:{round:"",unelevated:"",color:"primary","text-color":"primary",icon:"add_circle",size:"24px"},on:{click:function(t){e.showQuickStart=!0}}},[n("q-tooltip",[e._v(e._s(e.$t("quick_start_desc")))])],1)],1)]),e._l(e.filteredChannels,(function(t){return n("ChannelCard",{key:t.id,attrs:{title:t.title,description:t.description,image:t.image,id:t.id,soul:t.soul,hidden:t.hidden,followers:e.lib.channelFollowerCount[t.id],editable:!0,hideFollow:""},on:{edit:e.edit,detail:e.showChannelDetail,preview:e.showPreview,"remove-channel":e.removeChannel}})})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("ChannelEdit",{attrs:{title:e.modeTitle,show:e.showEdit,channel:e.edittingChannel,rules:{validateChannelTitle:e.validateChannelTitle,validateChannelDesc:e.validateChannelDesc,validateChannelImage:e.validateChannelImage}},on:{close:function(t){e.showEdit=!1},submit:e.submit}}),n("PostEdit",{attrs:{title:e.postModeTitle,show:e.showPostEdit,post:e.edittingPost,rules:{validatePostTitle:e.validatePostTitle,validatePostDesc:e.validatePostDesc,validatePostImage:e.validatePostImage,validatePostUrl:e.validatePostUrl}},on:{close:function(t){e.showPostEdit=!1},submit:e.submitPost}}),n("QuickStart",{attrs:{show:e.showQuickStart},on:{input:function(t){return e.showQuickStart=t}}})],2),n("BackToTop",{attrs:{show:e.showBackToTop},on:{click:e.scrollTop}}),n("q-dialog",{attrs:{"full-width":"",position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showPostList,callback:function(t){e.showPostList=t},expression:"showPostList"}},[n("PostList",{attrs:{channel:e.listChannel,rules:{validatePostTitle:e.validatePostTitle,validatePostDesc:e.validatePostDesc,validatePostImage:e.validatePostImage,validatePostUrl:e.validatePostUrl},editable:!0},on:{edit:e.showPostEditor,add:e.showPostAdd,"remove-post":e.removePost}})],1)],1)},Kt=[],Yt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.show,"content-class":"fullscreen-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:e.close}},[e.channel?n("q-card",{staticClass:"column no-wrap"},[n("q-card-section",{class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v(e._s(e.title))])]),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-section",{staticClass:"column q-pb-none",class:e.screen$xs?"q-pt-md":"q-pt-none",staticStyle:{width:"560px","max-width":"100%","flex-grow":"1"}},[n("q-input",{attrs:{outlined:"",dense:"","stack-label":"",label:e.$t("channel_title"),rules:[e.rules.validateChannelTitle],placeholder:e.$t("placeholder_channel_title"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.channelTitle,callback:function(t){e.channelTitle=t},expression:"channelTitle"}}),n("q-input",{staticClass:"q-mt-sm",attrs:{outlined:"",dense:"","stack-label":"",label:e.$t("description"),rules:[e.rules.validateChannelDesc],placeholder:e.$t("placeholder_channel_desc"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}}),n("ImageWithPreview",{staticClass:"q-mt-sm",attrs:{label:e.$t("poster"),rules:[e.rules.validateChannelImage]},on:{state:e.updateImageState},model:{value:e.image,callback:function(t){e.image=t},expression:"image"}}),n("q-toggle",{staticStyle:{"margin-top":"-8px"},attrs:{color:"green"},model:{value:e.hidden,callback:function(t){e.hidden=t},expression:"hidden"}},[n("span",[e._v(e._s(e.$t("set_as_private")))]),n("q-tooltip",[e._v(e._s(e.$t("hide_in_explore")))])],1)],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-actions",{staticClass:"q-px-md",class:e.screen$xs?"q-py-sm":"q-py-md",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"q-px-md",attrs:{unelevated:"",color:"general","text-color":"general",label:e.$t("cancel")}}),n("q-btn",{staticClass:"q-px-md",attrs:{unelevated:"",color:"primary","text-color":"primary",label:e.$t("lib_submit")},on:{click:e.submit}})],1)],1):e._e()],1)},Jt=[],Xt=n("d534"),Zt={name:"ChannelEdit",components:{ImageWithPreview:Xt["a"]},props:{show:Boolean,channel:Object,title:String,rules:{validateChannelTitle:Function,validateChannelDesc:Function,validateChannelImage:Function}},data(){const e=[{label:this.$t("channel_title"),key:"title",rules:[this.rules.validateChannelTitle],value:""},{label:this.$t("description"),key:"description",rules:[this.rules.validateChannelDesc],value:""},{label:this.$t("preview")+"(url)",key:"image",rules:[this.rules.validateChannelImage],value:""}];return{inputs:e,channelTitle:"",description:"",image:"",isImageLoaded:!1,hidden:!1}},methods:{close(){this.$emit("close")},updateImageState(e){console.log("img state changed",e),this.isImageLoaded=1===e},submit(){if(this.image&&!this.isImageLoaded)return this.$q.dialog({title:this.$t("invalid_image"),message:this.$t("image_not_reachable"),ok:this.$t("ok")});this.$emit("submit",{title:this.channelTitle,description:this.description,image:this.image,hidden:this.hidden})}},watch:{show(e){e&&this.channel?(this.channelTitle=this.channel.title,this.description=this.channel.description,this.image=this.channel.image,this.channel.hidden?this.hidden=!0:this.hidden=!1):(this.channelTitle="",this.description="",this.image="",this.hidden=!1)}}},en=Zt,tn=n("03bd"),nn=Object(v["a"])(en,Yt,Jt,!1,null,"01839ef4",null),on=nn.exports;C()(nn,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSeparator:z["a"],QInput:D["a"],QToggle:tn["a"],QTooltip:H["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(nn,"directives",{ClosePopup:K["a"]});var an=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.show,persistent:"",position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{input:e.close}},[e.post?n("q-card",{staticClass:"column no-wrap"},[n("q-card-section",{class:[e.screen$xs?"q-py-sm":"q-py-md"]},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.title))])]),n("q-card-section",{staticClass:"row q-pt-none justify-start items-start"},[n("div",{staticClass:"full-width title-input-container"},[n("q-input",{staticClass:"full-width q-mt-xs",attrs:{"bottom-slots":"","stack-label":"",outlined:"",dense:"",label:e.$t("post_title"),rules:[e.rules.validatePostTitle],placeholder:e.$t("placeholder_post_title"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"hint",fn:function(){return[n("div",{directives:[{name:"show",rawName:"v-show",value:e.titleFromTask,expression:"titleFromTask"}],staticClass:"full-width"},[n("span",{staticClass:"task-prefix"},[e._v(e._s(e.$t("task_title"))+":")]),n("span",{staticClass:"title-from-task q-ml-xs text-grey"},[e._v(e._s(e.titleFromTask))]),n("span",{staticClass:"cursor-pointer q-ml-sm set-title",on:{click:e.setTitleFromTask}},[e._v(e._s(e.$t("set_title")))])])]},proxy:!0}],null,!1,1210891792),model:{value:e.postTitle,callback:function(t){e.postTitle=t},expression:"postTitle"}})],1),n("q-input",{staticClass:"full-width q-mt-xs",attrs:{"stack-label":"",outlined:"",dense:"",label:e.$t("description"),rules:[e.rules.validatePostDesc],placeholder:e.$t("placeholder_post_desc"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}}),n("ImageWithPreview",{staticClass:"q-mt-xs",attrs:{label:e.$t("poster"),rules:[e.rules.validatePostImage]},on:{state:e.updateImageState},model:{value:e.image,callback:function(t){e.image=t},expression:"image"}}),n("div",{staticClass:"full-width row col-12"},[n("q-input",{staticClass:"col-7 q-pr-md",attrs:{outlined:"",dense:"",label:e.appName+" URL",rules:[e.rules.validatePostUrl],debounce:500},on:{input:e.inputUrl},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.abUrl,callback:function(t){e.abUrl=t},expression:"abUrl"}}),n("q-select",{staticClass:"col-5",attrs:{outlined:"",dense:"","bottom-slots":"","menu-anchor":"bottom right","menu-self":"top end","menu-offset":[0,0],"popup-content-style":"height: 320px !important","use-input":"",label:e.$t("select_from_tasks"),options:e.taskOptions},on:{input:e.selectTask,filter:e.filterOptions},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"hint",fn:function(){return[n("div",{staticClass:"from-magnet",on:{click:function(t){t.stopPropagation(),t.preventDefault(),e.showMagnetInput=!0}}},[e._v("\n "+e._s(e.$t("import_from_magnet"))+"\n ")])]},proxy:!0}],null,!1,1979668889),model:{value:e.abSelect,callback:function(t){e.abSelect=t},expression:"abSelect"}})],1),n("q-select",{staticClass:"q-mt-sm",staticStyle:{width:"100%"},attrs:{outlined:"",dense:"",options:e.rateOptions,label:e.$t("film_rate")},model:{value:e.rate,callback:function(t){e.rate=t},expression:"rate"}}),n("q-markup-table",{staticClass:"q-mt-lg full-width",attrs:{bordered:"",flat:"",dense:"","no-data-label":"I didn't find anything for you"}},[n("thead",[n("tr",[n("th",{attrs:{colspan:"3"}},[n("div",{staticClass:"flex items-center full-width"},[n("div",[e._v(e._s(e.$t("subtitle_list"))+" ("+e._s(e.$t("optional"))+")")]),n("q-btn",{staticClass:"q-ml-sm",attrs:{flat:"",round:"",icon:"help_outline",size:"0.7rem"}},[n("q-tooltip",[e._v(e._s(e.$t("support_subtitle_type"))),n("br"),e._v(e._s(e.$t("recommend_opensubtitles")))])],1),n("q-btn",{staticClass:"q-mx-xs",attrs:{flat:"",round:"",icon:"add",size:"0.7rem"},on:{click:function(t){return e.editSubtitle()}}},[n("q-tooltip",[e._v(e._s(e.$t("add_subtitles")))])],1)],1)])]),e.subtitleList.length?n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("language")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("download_link")))]),n("th",{staticClass:"text-center"})]):e._e()]),n("tbody",e._l(e.subtitleList,(function(t,o){return n("tr",{key:o},[n("td",{staticClass:"text-left"},[e._v(e._s(t.lang))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.url))]),n("td",{staticClass:"text-center"},[n("q-btn",{attrs:{icon:"edit",round:"",flat:"",size:"0.5rem"},on:{click:function(t){return e.editSubtitle(o)}}},[n("q-tooltip",[e._v(e._s(e.$t("lib_edit")))])],1),n("q-btn",{attrs:{icon:"close",color:"red",round:"",flat:"",size:"0.5rem"},on:{click:function(t){return e.modifySubtitleList(o)}}},[n("q-tooltip",[e._v(e._s(e.$t("delete")))])],1)],1)])})),0)])],1),n("q-space"),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("cancel")}}),n("q-btn",{attrs:{flat:"",label:e.$t("lib_submit"),color:"primary"},on:{click:e.submit}})],1)],1):e._e(),n("q-dialog",{ref:"addSubtitleDialog",on:{hide:function(t){e.subtitle={}}},model:{value:e.showSubtitleInput,callback:function(t){e.showSubtitleInput=t},expression:"showSubtitleInput"}},[n("q-card",{staticStyle:{width:"480px"}},[n("q-card-section",[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("add_subtitle_url")))])]),n("q-card-section",{staticClass:"q-pt-none full-width"},[n("q-select",{staticStyle:{width:"200px"},attrs:{dense:"",outlined:"","emit-value":"",label:e.$t("language"),options:e.languageOptions},model:{value:e.subtitle.lang,callback:function(t){e.$set(e.subtitle,"lang",t)},expression:"subtitle.lang"}}),n("q-input",{staticClass:"q-mt-sm",attrs:{label:e.$t("download_link"),outlined:"",dense:"",type:"text",placeholder:"https://www.opensubtitles.org/.../subtitleserve/sub/..."},model:{value:e.subtitle.url,callback:function(t){e.$set(e.subtitle,"url",t)},expression:"subtitle.url"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",color:"primary"}}),n("q-btn",{attrs:{flat:"",icon:"done",loading:e.loading,disable:e.loading},on:{click:function(t){return e.modifySubtitleList(e.subtitle.index,e.subtitle)}},scopedSlots:e._u([{key:"loading",fn:function(){return[n("q-spinner")]},proxy:!0}])})],1)],1)],1),n("q-dialog",{on:{hide:function(t){e.magnetInput=""}},model:{value:e.showMagnetInput,callback:function(t){e.showMagnetInput=t},expression:"showMagnetInput"}},[n("q-card",{staticStyle:{width:"480px"}},[n("q-card-section",{staticClass:"full-width"},[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("input_magnet_url")))]),n("q-input",{attrs:{type:"text"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.magnetInput,callback:function(t){e.magnetInput=t},expression:"magnetInput"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",color:"primary"}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"done"},on:{click:e.fromMagnet}})],1)],1)],1)],1)},sn=[],rn={name:"PostEdit",components:{ImageWithPreview:Xt["a"]},props:{show:Boolean,post:Object,title:String,rules:{validatePostTitle:Function,validatePostDesc:Function,validatePostImage:Function,validatePostUrl:Function}},data(){const e=Ne.a.displayName;return{appName:e,postTitle:"",titleFromTask:"",description:"",image:"",isImageLoaded:!1,abUrl:"",abSelect:null,magnetInput:"",showMagnetInput:!1,rate:{label:this.$t("film_rate"),value:""},showSubtitleInput:!1,loading:!1,subtitle:{},languageOptions:xe(),subtitleList:[],taskOptions:[]}},computed:{rateOptions(){return[{label:this.$t("rate_g"),value:"G"},{label:this.$t("rate_pg"),value:"PG"},{label:this.$t("rate_pg_13"),value:"PG-13"},{label:this.$t("rate_r"),value:"R"},{label:this.$t("rate_nc_17"),value:"NC-17"}]},uploadingTasks(){return d["a"].getters.uploading.filter((e=>!!e.title||(console.log("PostEdit.uploadingTasks:",e),!1))).map((e=>{var t;const n=e.title.length>28?e.title.substring(0,24)+"...":e.title;return{label:n,title:e.title,value:(null===(t=e.abUrl.split("&"))||void 0===t?void 0:t[0])||e.abUrl}}))}},methods:{filterOptions(e,t){console.log("filter",e);const n=e.toLowerCase();t((()=>{this.taskOptions=this.uploadingTasks.filter((e=>e.label.toLowerCase().includes(n)))}))},close(){this.$emit("close")},setTitleFromTask(){this.postTitle=this.titleFromTask,this.titleFromTask=""},inputUrl(e){this.abSelect&&e!==this.abSelect.value&&(this.abSelect=null,this.titleFromTask="")},selectTask(e){this.abUrl=e.value,this.postTitle?this.titleFromTask=e.title:this.postTitle=e.title},updateImageState(e){console.log("img state changed",e),this.isImageLoaded=1===e},async fromMagnet(){if("string"!==typeof this.magnetInput||!this.magnetInput)return;if(!this.magnetInput.startsWith("magnet"))return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});let e=this.magnetInput;if(!e.includes("dn=")){if(!this.postTitle)return this.$q.dialog({message:this.$t("magnet_does_not_have_name"),ok:this.$t("ok")});e+=`&dn=${encodeURIComponent(this.postTitle)}`}const t=await Object(Ce["a"])(e);if(!t)return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});this.abUrl=t},editSubtitle(e){if(this.loading=!1,"number"===typeof e)this.subtitle=JSON.parse(JSON.stringify(this.subtitleList[e])),this.subtitle.index=e;else{if(this.subtitleList.length>=5)return this.$q.notify(this.$t("maximumSubtitleNum_limit"));this.subtitle={index:this.subtitleList.length}}this.showSubtitleInput=!0},async modifySubtitleList(e,t){if(console.log("modifySubtitleList",e),this.loading=!0,t&&"number"===typeof t.index){if(!t.lang||!t.url||""===t.lang)return this.loading=!1,this.$q.dialog({title:this.$t("cannot_add_subtitle"),message:this.$t("cannot_add_subtitle_msg")+this.$t("recommend_opensubtitles"),ok:this.$t("ok")});const n=await Oe(this.subtitle.url);if(this.loading=!1,!n)return this.$q.dialog({title:this.$t("cannot_add_subtitle"),message:this.$t("invalid_download_url"),ok:this.$t("ok")});this.subtitleList[e]=t}else this.subtitleList.splice(e,1);this.$refs.addSubtitleDialog.hide()},async checkSubtitleUrl(){if(!/https:\/\/www\.opensubtitles\.org.*\/subtitleserve\/sub\/\d+$/gm.test(this.subtitle.url)&&!/^\d+$/.test(this.subtitle.url))return this.$t("invalid_download_url");const e=await Oe(this.subtitle.url);return e?void 0:this.$t("invalid_download_url")},submit(){if(this.image&&!this.isImageLoaded)return this.$q.dialog({title:this.$t("invalid_image"),message:this.$t("image_not_reachable"),ok:this.$t("ok")});this.$emit("submit",{title:this.postTitle.trim(),description:this.description.trim(),image:this.image.trim(),rate:this.rate.value,abUrl:this.abUrl.trim(),subtitleList:Te(this.subtitleList).trim()})}},watch:{show(e){if(e&&this.post){if(this.postTitle=this.post.title,this.description=this.post.description,this.image=this.post.image,this.abUrl=this.post.abUrl.includes(":")?this.post.abUrl:decodeURIComponent(this.post.abUrl),this.post.rate){const e=this.rateOptions.find((e=>e.value===this.post.rate));e&&(this.rate={...e})}else this.rate={label:this.$t("film_rate"),value:""};this.subtitleList=Ie(this.post.subtitleList)}else this.postTitle="",this.description="",this.image="",this.abUrl="",this.titleFromTask="",this.abSelect=null,this.rate={label:this.$t("film_rate"),value:""},this.subtitleList=[]}}},ln=rn,cn=(n("1761"),n("4101")),dn=Object(v["a"])(ln,an,sn,!1,null,"48adc3b5",null),un=dn.exports;C()(dn,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QInput:D["a"],QSelect:ue["a"],QMarkupTable:V["a"],QBtn:O["a"],QTooltip:H["a"],QSpace:W["a"],QCardActions:N["a"],QSpinner:w["a"],QColor:cn["a"]}),C()(dn,"directives",{ClosePopup:K["a"]});var hn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"post-list-card column no-wrap overflow-hidden relative-position"},[n("q-card-section",{staticClass:"flex items-center bg-page",class:[e.screen$xs?"q-py-sm":"q-py-md"]},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.channel.title))]),n("q-space"),e.editable?n("q-btn",{staticClass:"q-mx-xs",attrs:{"fab-mini":"",flat:"",icon:"add"},on:{click:e.add}},[n("q-tooltip",[e._v(e._s(e.$t("add_post")))])],1):e._e(),e.editable?n("q-btn",{staticClass:"q-mx-xs",attrs:{"fab-mini":"",flat:"",icon:"file_open"},on:{click:function(t){e.showImport=!0}}},[n("q-tooltip",[e._v(e._s(e.$t("import_data_from_excel")))])],1):e._e(),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"q-ml-xs",attrs:{"fab-mini":"",flat:"",icon:"close"}})],1),n("q-card-section",{staticClass:"q-py-sm q-pb-none"},[n("div",{staticClass:"description"},[e._v(e._s(e.channel.description))])]),n("q-separator"),n("q-card-section",{staticClass:"q-pa-none",staticStyle:{"flex-grow":"1","flex-shrink":"1","overflow-y":"scroll"}},[n("q-markup-table",{attrs:{square:"",flat:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("poster")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("title")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("description")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("film_rate")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("created_time")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("operations")))])])]),n("tbody",{staticClass:"post-table"},e._l(e.sortedPosts,(function(t,o){return n("tr",{key:o},[n("td",{staticClass:"text-left"},[n("img",{attrs:{src:t.image,loading:"lazy",width:"64px"}})]),n("td",{staticClass:"text-left post-title"},[e._v(e._s(t.title))]),n("td",{staticClass:"text-left post-desc",staticStyle:{"min-width":"240px"}},[e._v(e._s(t.description))]),n("td",{staticClass:"text-center"},[e._v(e._s(t.rate))]),n("td",{staticClass:"text-center"},[e._v(e._s(e.stampToString(t.timestamp)))]),n("td",{staticClass:"text-center"},[e.editable?n("q-btn",{attrs:{icon:"edit",round:"",flat:""},on:{click:function(n){return e.edit(t)}}},[n("q-tooltip",[e._v(e._s(e.$t("lib_edit")))])],1):e._e(),e.editable?n("q-btn",{attrs:{icon:"close",color:"red",round:"",flat:""},on:{click:function(n){return e.deletePost(t)}}},[n("q-tooltip",[e._v(e._s(e.$t("delete")))])],1):e._e()],1)])})),0)])],1),n("q-dialog",{attrs:{"content-class":"fullscreen-dialog excel-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:e.importDialogChange},model:{value:e.showImport,callback:function(t){e.showImport=t},expression:"showImport"}},[e.excelFile?n("Excel",{attrs:{file:e.excelFile,channelId:e.channel.id,channelPosts:e.posts,propKeys:e.excelProps,rules:e.rules}}):n("q-card",{staticClass:"import-entry"},[n("q-card-section",{staticClass:"row items-center no-wrap q-py-sm"},[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v(e._s(e.$t("import_data_from_excel")))]),n("q-space"),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",round:""}})],1),n("q-card-section",{staticClass:"row items-center q-pt-none excel-import-dialog"},[n("div",{staticClass:"prop-settings col-12"},[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("set_excel_keys")))]),e._l(e.excelProps,(function(t,o){return n("q-input",{key:o,staticClass:"q-my-sm",attrs:{outlined:"",dense:"",label:t.label},model:{value:t.tableKey,callback:function(n){e.$set(t,"tableKey",n)},expression:"conf.tableKey"}})}))],2),n("q-file",{staticClass:"col-12",attrs:{outlined:"",dense:"",label:e.$t("open_file"),accept:".xls,.xlsx"},model:{value:e.excelFile,callback:function(t){e.excelFile=t},expression:"excelFile"}})],1)],1)],1),n("q-inner-loading",{staticClass:"q-pt-xl",attrs:{showing:e.showLoading,label:e.$t("loading")}},[n("q-spinner-gears",{attrs:{size:"50px",color:"primary"}}),n("div",{staticClass:"text-center"},[e._v(e._s(e.$t("lib_from_network")))])],1)],1)},pn=[],mn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-excel"},[n("q-card",{staticClass:"excel-card"},[n("q-card-section",{staticClass:"excel-main"},[n("div",{staticClass:"text-h6"},[e._v("Excel")]),n("q-markup-table",[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("title")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("description")))]),n("th",{staticClass:"text-left"},[e._v("Url")]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("poster")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("film_rate")))]),n("th",{staticClass:"operation"})])]),n("tbody",{staticClass:"post-table"},e._l(e.posts,(function(t,o){return n("tr",{key:t.title},[n("td",{staticClass:"text-left post-title",attrs:{title:t.title}},[e._v(e._s(t.title))]),n("td",{staticClass:"text-left post-desc"},[e._v(e._s(t.description))]),n("td",{staticClass:"text-left post-url",attrs:{title:t.abUrl}},[e._v(e._s(t.abUrl))]),n("td",{staticClass:"text-left post-img"},[n("img",{attrs:{src:t.image,width:"24px",loading:"lazy"}})]),n("td",{staticClass:"text-left post-rating"},[e._v(e._s(t.rate))]),n("td",{staticClass:"text-left post-options"},[n("q-btn",{attrs:{dense:"",flat:"",icon:"close",color:"red"},on:{click:function(t){return e.removePost(o)}}},[n("q-tooltip",[e._v(e._s(e.$t("remove")))])],1)],1)])})),0)])],1),n("q-card-actions",{staticClass:"excel-actions q-pb-xs",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",dense:"",label:e.$t("cancel")}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",dense:"",color:"primary",label:e.$t("lib_submit")},on:{click:e.submit}})],1)],1)],1)},_n=[],fn=n("8b4c"),gn={name:"LibraryExcel",props:{file:{type:File,default:()=>null},channelId:{type:String,default:""},channelPosts:{type:Array,default:()=>[]},rules:{validatePostTitle:Function,validatePostDesc:Function,validatePostImage:Function,validatePostUrl:Function},propKeys:{type:Array,default:()=>[{key:"title",label:(void 0).$t("title"),tableKey:"IMDb Rating"},{key:"abUrl",label:"Alphabiz URL",tableKey:"AB-S"},{key:"description",label:(void 0).$t("description"),tableKey:"描述"},{key:"image",label:(void 0).$t("poster"),tableKey:"海报"},{key:"rate",label:(void 0).$t("film_rate"),tableKey:"分级"}]}},data(){return{posts:[]}},methods:{removePost(e){this.posts.splice(e,1)},readFile(e){return new Promise(((t,n)=>{const o=new FileReader;o.onload=e=>{const o=e.target.result;try{const e=fn["read"](o);t(e)}catch(e){n(e)}},o.onerror=e=>n(e),o.readAsArrayBuffer(e)}))},async parseXlsx(){console.log("parse xlsx",this.file,fn);const e=await this.readFile(this.file);console.log(e),this.$q.loading.show(),this.posts=[];let t=0,n=0,o=0;for(const a in e.Sheets){const s=e.Sheets[a],i=fn["utils"].sheet_to_json(s);console.log("Parsed",i),i.length&&await i.reduce((async(e,a)=>{await e,await new Promise((e=>setTimeout(e)));const s={};for(const n of this.propKeys){if(!a[n.tableKey]||!a[n.tableKey].length)return console.log("[Excel] Failed",n,n.tableKey,a[n.tableKey]),t++;s[n.key]=a[n.tableKey]}if(this.channelPosts.some((e=>e.title===s.title||e.abUrl===s.abUrl)))return console.log("[Excel] Skip existed",s,this.channelPosts.find((e=>e.title===s.title||e.abUrl===s.abUrl))),n++;if(s.abUrl&&s.abUrl.startsWith("magnet"))try{s.abUrl=await Object(Ce["a"])(s.abUrl)}catch(i){console.log("cannot convert abUrl",s.abUrl,i)}if(s.description=s.description.substring(0,299),[this.rules.validatePostTitle(s.title),this.rules.validatePostDesc(s.description),this.rules.validatePostImage(s.image),this.rules.validatePostUrl(s.abUrl)].some((e=>"string"===typeof e)))return console.log("[Excel] Validate error",[s.title,this.rules.validatePostTitle(s.title),s.description,this.rules.validatePostDesc(s.description),s.image,this.rules.validatePostImage(s.image),s.abUrl,this.rules.validatePostUrl(s.abUrl)]),o++;this.posts.push(s)}),Promise.resolve())}this.$q.loading.hide(),this.$q.dialog({title:this.$t("excel_import_succeded"),message:this.$t("excel_import_success_msg",[this.posts.length,t,n,o])})},submit(){return console.log(this.channelId,r["a"],this.posts),this.channelId?this.posts.length?void r["a"].addPosts(this.posts,this.channelId).then(((...e)=>{console.log("add posts",...e)})):this.$q.notify(this.$t("cannot_find_posts")):this.$q.notify(this.$t("cannot_find_channel"))}},watch:{file(e){console.log("file:",e)}},mounted(){console.log("excel mounted"),this.parseXlsx()},activated(){console.log("excel activated")}},bn=gn,yn=(n("5415"),Object(v["a"])(bn,mn,_n,!1,null,"27719a2e",null)),vn=yn.exports;C()(yn,"components",{QCard:E["a"],QCardSection:A["a"],QMarkupTable:V["a"],QBtn:O["a"],QTooltip:H["a"],QCardActions:N["a"]}),C()(yn,"directives",{ClosePopup:K["a"]});const wn=e=>("00"+e).slice(-2);var kn={props:{channel:Object,editable:Boolean,rules:{validatePostTitle:Function,validatePostDesc:Function,validatePostImage:Function,validatePostUrl:Function}},components:{Excel:vn},data(){const e=Ne.a.name;return{appName:e,showLoading:!1,showImport:!1,excelFile:null,posts:[],excelProps:[{key:"title",label:this.$t("title"),tableKey:"IMDb Rating"},{key:"abUrl",label:`${Ne.a.displayName} URL`,tableKey:"AB-S"},{key:"description",label:this.$t("description"),tableKey:this.$t("description")},{key:"image",label:this.$t("poster"),tableKey:this.$t("poster")},{key:"rate",label:this.$t("film_rate"),tableKey:this.$t("film_rate")}]}},inject:["rootApp"],computed:{sortedPosts(){return[...this.posts].sort(((e,t)=>t.timestamp-e.timestamp))}},methods:{loadPosts(){this.showLoading=!0,console.log("load posts",this.channel.id,this.channel),Object(p["o"])(this.channel.id,!this.editable).then((e=>{this.posts=e,console.log("Got posts",e),this.showLoading=!1}))},edit(e){console.log("edit",e,this.channel),this.$emit("edit",e,this.channel)},add(){this.$emit("add",this.channel)},deletePost(e){this.$emit("remove-post",e.id,this.channel.id)},download(e){this.rootApp.promptDownload(e.abUrl,!0)},stampToString(e){if(isNaN(e))return console.log("stamp is not number",e),"-";const t=new Date(e);return isNaN(t.getFullYear())?(console.log("date is invalid",e,t),"-"):[t.getFullYear(),...[t.getMonth()+1,t.getDate()].map(wn)].join("-")+" "+[t.getHours(),t.getMinutes(),t.getSeconds()].map(wn).join(":")},importDialogChange(e){e||(this.excelFile=null)}},mounted(){console.log("mounted",this.channel),this.loadPosts()},beforeDestroy(){console.log("destroyed",this.channel),this.channel&&this.channel.id&&Object(p["y"])(this.channel.id)}},Cn=kn,$n=(n("5e95"),n("3927")),Sn=Object(v["a"])(Cn,hn,pn,!1,null,"1e291392",null),xn=Sn.exports;C()(Sn,"components",{QCard:E["a"],QCardSection:A["a"],QSpace:W["a"],QBtn:O["a"],QTooltip:H["a"],QSeparator:z["a"],QMarkupTable:V["a"],QDialog:q["a"],QInput:D["a"],QFile:$n["a"],QInnerLoading:Ot["a"],QSpinnerGears:qt["a"],QColor:cn["a"]}),C()(Sn,"directives",{ClosePopup:K["a"]});var Tn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.show,persistent:"",position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{input:e.changeShow}},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",id:"file-selector"},on:{change:e.onFileChange}}),n("input",{ref:"folderSelector",staticStyle:{display:"none"},attrs:{type:"file",webkitdirectory:"",id:"folder-selector"},on:{change:e.onFolderChange}}),n("q-card",{staticClass:"card-container"},[n("q-card-section",{staticClass:"card-header non-selectable",class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-weight-bold q-my-none"},[e._v(e._s(e.$t("quick_start")))])]),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("div",{staticClass:"card-content"},[n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"from-file-or-task flex items-start justify-start q-mb-lg"},[e.isCapacitor?e._e():n("div",{staticClass:"from-file-or-folder q-mt-md col-grow"},[n("q-btn",{staticClass:"full-width",class:{"q-mt-sm":!e.isElectron},attrs:{unelevated:"",dense:e.isElectron,color:"primary","text-color":"primary",label:e.$t("select_file")},on:{click:function(){return e.$refs.fileSelector.click()}}}),e.isElectron?n("q-btn",{staticClass:"full-width q-mt-sm",attrs:{unelevated:"",dense:"",color:"primary","text-color":"primary",label:e.$t("select_folder")},on:{click:function(){return e.$refs.folderSelector.click()}}}):e._e()],1),n("q-select",{staticClass:"col-grow q-mt-md from-upload-task",class:e.isCapacitor?"q-ml-none":"q-ml-sm",attrs:{outlined:"",dense:"","bottom-slots":"","use-input":"","menu-anchor":"bottom right","menu-self":"top end","menu-offset":[0,0],"popup-content-style":"height: 320px !important",behavior:"menu",label:e.$t("select_from_tasks"),options:e.taskOptions},on:{input:e.selectTask,filter:e.filterOptions},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"hint",fn:function(){return[n("div",{staticClass:"from-magnet text-primary cursor-pointer non-selectable",on:{click:function(t){t.stopPropagation(),t.preventDefault(),e.showMagnetInput=!0}}},[e._v("\n "+e._s(e.$t("import_from_magnet"))+"\n ")])]},proxy:!0}]),model:{value:e.abSelect,callback:function(t){e.abSelect=t},expression:"abSelect"}})],1),n("div",{staticClass:"post-inputs"},[n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("post_title"),rules:[e.rules.validatePostTitle]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.postTitle,callback:function(t){e.postTitle=t},expression:"postTitle"}}),n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("placeholder_post_desc"),rules:[e.rules.validatePostDesc]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.postDescription,callback:function(t){e.postDescription=t},expression:"postDescription"}}),n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.appName+" "+e.$t("download_link"),rules:[e.rules.validatePostUrl]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.abUrl,callback:function(t){e.abUrl=t},expression:"abUrl"}}),n("ImageWithPreview",{staticClass:"q-mb-sm",attrs:{label:e.$t("poster"),rules:[e.rules.validatePostImage]},on:{state:e.updatePostImageState},model:{value:e.postImage,callback:function(t){e.postImage=t},expression:"postImage"}}),n("q-select",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",options:e.rateOptions,label:e.$t("film_rate")},model:{value:e.rate,callback:function(t){e.rate=t},expression:"rate"}})],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("div",{staticClass:"channel-option non-selectable"},[n("label",{staticClass:"text-bold q-mr-sm",staticStyle:{"font-size":"1.125rem"}},[e._v(e._s(e.$t("channel_options")))]),n("q-radio",{attrs:{val:!0,label:e.$t("create_new_channel")},model:{value:e.createChannel,callback:function(t){e.createChannel=t},expression:"createChannel"}}),n("q-radio",{attrs:{val:!1,label:e.$t("use_existed_channel")},model:{value:e.createChannel,callback:function(t){e.createChannel=t},expression:"createChannel"}})],1),e.createChannel?n("div",{staticClass:"channel-inputs"},[n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("channel_title"),rules:[e.rules.validateChannelTitle]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.channelTitle,callback:function(t){e.channelTitle=t},expression:"channelTitle"}}),n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("placeholder_channel_desc"),rules:[e.rules.validateChannelDesc]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.channelDescription,callback:function(t){e.channelDescription=t},expression:"channelDescription"}}),n("ImageWithPreview",{attrs:{label:e.$t("channel_poster"),rules:[e.rules.validateChannelImage]},on:{state:e.updateChannelImageState},model:{value:e.channelImage,callback:function(t){e.channelImage=t},expression:"channelImage"}})],1):n("div",{staticClass:"channel-select"},[n("q-select",{staticClass:"full-width",attrs:{outlined:"","bottom-slots":"","use-input":"",dense:"","popup-content-style":"max-height: 320px !important","menu-anchor":"bottom right","menu-self":"top end","menu-offset":[0,0],"data-cy":"select-direct",behavior:"menu",label:e.$t("select_existed_channel"),options:e.channelOptions},on:{filter:e.filterChannels},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"option",fn:function(t){return[n("q-item",e._g(e._b({},"q-item",t.itemProps,!1),t.itemEvents),[n("q-item-section",[n("q-item-label",[n("span",{staticClass:"label"},[e._v(e._s(t.opt.label))]),n("small",{staticClass:"text-grey q-ml-sm"},[e._v(e._s(t.opt.caption))])])],1)],1)]}}]),model:{value:e.selectedChannel,callback:function(t){e.selectedChannel=t},expression:"selectedChannel"}})],1)])],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-actions",{staticClass:"card-footer",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("cancel")}}),n("q-btn",{attrs:{unelevated:"",label:e.$t("lib_submit"),disable:!e.submitReady,"text-color":"primary",color:"primary"},on:{click:e.submit}})],1)],1),n("q-dialog",{attrs:{value:!!e.progressText,persistent:""}},[n("q-card",{staticClass:"progress-card"},[n("q-card-section",[n("div",{staticClass:"text q-pa-md"},[e._v(e._s(e.progressText))])])],1)],1),n("q-dialog",{on:{hide:function(t){e.magnetInput=""}},model:{value:e.showMagnetInput,callback:function(t){e.showMagnetInput=t},expression:"showMagnetInput"}},[n("q-card",{staticStyle:{width:"480px"}},[n("q-card-section",{staticClass:"full-width"},[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("input_magnet_url")))]),n("q-input",{attrs:{type:"text",autofocus:""},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.magnetInput,callback:function(t){e.magnetInput=t},expression:"magnetInput"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close"}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"done",color:"primary","text-color":"primary"},on:{click:e.fromMagnet}})],1)],1)],1)],1)},In=[],Pn=(n("4db2"),n("c976"),n("4d8f"),n("f991"),n("63b1"),n("84f6")),On=n("a3fc"),qn=n.n(On);function En(e){if(!Array.isArray(e)||!e[0])return"";let t=Object(On["dirname"])(e[0]);for(let n=1;n1)t=Object(On["dirname"])(t);return t}var An=n("8a63");const Dn=4e9,Nn=e=>new Promise((t=>setTimeout(t,e))),Ln=()=>{const e=new Uint8Array(12);return crypto.getRandomValues(e),e.reduce(((e,t)=>{const n=t.toString(16).padStart(2,"0");return e+n}),"")};var jn={components:{ImageWithPreview:Xt["a"]},name:"QuickStart",props:{show:Boolean,preset:{required:!1,default:null}},data(){const e=[{label:this.$t("rate_g"),value:"G"},{label:this.$t("rate_pg"),value:"PG"},{label:this.$t("rate_pg_13"),value:"PG-13"},{label:this.$t("rate_r"),value:"R"},{label:this.$t("rate_nc_17"),value:"NC-17"}],t={validateChannelTitle(e){return e.length>0&&e.length<100||ae["b"].t("validate_channel_title_length")},validateChannelDesc(e){return e.length>9&&e.length<301||ae["b"].t("validate_channel_desc_length")},validateChannelImage(e){return!e||(e.match(/\s/)?ae["b"].t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https://"))&&e.length<2048||ae["b"].t("validate_channel_image_url"))},validatePostTitle(e){return e.length>0&&e.length<100||ae["b"].t("validate_post_title_length")},validatePostDesc(e){return e.length>9&&e.length<301||ae["b"].t("validate_post_desc_length")},validatePostImage(e){return!e||(e.match(/\s/)?ae["b"].t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https"))&&e.length<2048||ae["b"].t("validate_post_image_url"))},validatePostUrl(e){if(!e.startsWith(Ne.a.shortProtocol+"://")&&!e.startsWith(Ne.a.protocol+"://"))return ae["b"].t("validate_post_url");const t=Object(we["a"])(e);return 28!==t.length?ae["b"].t("validate_post_url"):e.length<2048||ae["b"].t("validate_post_url_length")}},n=Ne.a.displayName;return{appName:n,rules:t,progressText:"",postTitle:"",titleFromTask:"",postDescription:"",postImage:"",isPostImageLoaded:!1,channelTitle:"",channelDescription:"",channelImage:"",isChannelImageLoaded:!1,abUrl:"",abSelect:null,rateOptions:e,magnetInput:"",showMagnetInput:!1,createChannel:!0,rate:e[0],taskOptions:[],channelFilterInput:"",selectedChannel:{label:"",title:"",id:""},isElectron:Object(Z["isElectron"])(),isCapacitor:Object(fe["a"])()}},computed:{username(){return r["a"].userData.name?r["a"].userData.name:d["a"].getters.accountUserInfo.nickname?d["a"].getters.accountUserInfo.nickname:r["a"].user.name||"-"},uploadingTasks(){return Pn["a"].taskList.uploading.map((e=>this.getTaskOption(e)))},channelOptions(){return r["a"].ownedChannels.filter((e=>!!e.id&&e.title.toLowerCase().includes(this.channelFilterInput))).filter((e=>r["a"].channelList.some((t=>e.id===t.id)))).map((e=>{const t=e.title.length>48?e.title.substring(0,44)+"...":e.title;return{label:t,title:e.title,caption:"%"+e.id,id:e.id}}))},submitReady(){if(this.channelImage&&!this.isChannelImageLoaded)return!1;if(this.channelImage&&!0!==this.rules.validateChannelImage(this.channelImage))return!1;if(this.postImage&&!this.isPostImageLoaded)return!1;if(this.postImage&&!0!==this.rules.validatePostImage(this.postImage))return!1;if(!this.rate)return!1;if(this.createChannel){if([this.rules.validateChannelTitle(this.channelTitle),this.rules.validateChannelDesc(this.channelDescription)].some((e=>!0!==e)))return!1}else if(!this.selectedChannel.id)return!1;return!![this.rules.validatePostTitle(this.postTitle),this.rules.validatePostDesc(this.postDescription),this.rules.validatePostUrl(this.abUrl)].every((e=>!0===e))}},methods:{todo(){this.$q.notify("TODO: This is not impl")},changeShow(e){this.$emit("input",e)},clear(){var e;const t={progressText:"",postTitle:"",titleFromTask:"",postDescription:"",postImage:"",isPostImageLoaded:!1,channelTitle:"",channelDescription:"",channelImage:"",isChannelImageLoaded:!1,abUrl:"",abSelect:null,magnetInput:"",showMagnetInput:!1,createChannel:!0,rate:this.rateOptions[0],taskOptions:[],channelFilterInput:"",selectedChannel:{label:"",title:"",id:""}};null!==(e=this.channelOptions)&&void 0!==e&&e.length&&(t.createChannel=!1,t.selectedChannel=this.channelOptions[0]);for(const n in t)this.$set(this,n,t[n])},getTaskOption(e){var t;const n=e.postTitle||e.name||e.infoHash,o=n.length>36?n.substring(0,32)+"...":n;let a=Object(M["g"])(e.progress||1);if(e.ready)a="100.00%";else if(e.verifyStatus){const{current:t,total:n}=e.verifyStatus,o=t/n,s=Object(M["g"])(o);isNaN(o)||(a=s)}const s=(null===(t=e.alphabizURI.split("&"))||void 0===t?void 0:t[0])||e.alphabizURI,i=Ne.a.shortProtocol+"://"+s.split("/").pop();return{label:e.ready?o:o+` (${a})`,title:n,progress:a,value:i,ready:e.ready}},filterOptions(e,t){const n=e.toLowerCase();t((()=>{this.taskOptions=this.uploadingTasks.filter((e=>e.title.toLowerCase().includes(n)))}))},selectTask(e){this.abUrl=e.value,this.postTitle?this.titleFromTask=e.title:this.postTitle=e.title,this.postDescription||(this.postDescription=this.$t("uploaded_by",{title:e.title,name:this.username}))},filterChannels(e,t){const n=e.toLowerCase();t((()=>{this.channelFilterInput=n}))},updatePostImageState(e){this.isPostImageLoaded=1===e},updateChannelImageState(e){this.isChannelImageLoaded=1===e},showProgress(e,...t){console.log(this.$t("progress")+":",e,...t),this.progressText=e},async createNewChannel(){const e=await r["a"].createChannel(this.channelTitle.trim(),this.channelDescription.trim(),this.channelImage.trim());return console.log("Channel created",e),e},async submit(){let e=!1,t=null;const n=async n=>(clearTimeout(t),t=setTimeout((()=>{e=!0,this.$q.dialog({message:this.$t("quick_start_timeout",[n]),ok:this.$t("ok")})}),11e3),new Promise((e=>setTimeout(e,1e4))));let o=this.selectedChannel.id;if(this.createChannel){this.showProgress(this.$t("creating_new_channel")),await Nn(1e3);const a=await Promise.race([this.createNewChannel(),n(this.$t("create_new_channel"))]);if(clearTimeout(t),console.log(a),e||!a)return this.showProgress("");this.showProgress(this.$t("created_new_channel"),a),await Nn(1e3),o=a.id}this.showProgress(this.$t("creating_new_post")),await Nn(1e3);const a=await Promise.race([r["a"].createPost({title:this.postTitle.trim(),description:this.postDescription.trim(),image:this.postImage.trim(),rate:this.rate.value,abUrl:this.abUrl.trim()},o),n(this.$t("create_new_post"))]);if(e||!a)return this.showProgress("");clearTimeout(t),this.showProgress(this.$t("created_new_post"),a),await Nn(2e3),this.showProgress(""),await Nn(500),this.$emit("input",!1),this.$q.dialog({message:this.$t("success"),ok:this.$t("ok")})},async askForConfirm(e,t){return new Promise((n=>{this.$q.dialog({title:e,message:t,ok:this.$t("ok"),cancel:this.$t("cancel")}).onOk((()=>n(!0))).onCancel((()=>n(!1)))}))},calcFileSize(e){return e.reduce(((e,t)=>e+t.size),0)},async onFileChange(e){var t,o;const a=null===e||void 0===e||null===(t=e.target)||void 0===t||null===(o=t.files)||void 0===o?void 0:o[0];if(a){if(console.log("file selected",a),e.target.value=null,a.size>Dn){const e=await this.askForConfirm(this.$t("file_too_large"),this.$t("file_too_large_msg",{size:Object(M["a"])(a.size)}));if(!e)return}if(Object(Z["isElectron"])())this.createTask(a.path);else{const e=n("c620").wtClient;if(e.torrents.length){const t=await this.askForConfirm(this.$t("remove_old_task"),this.$t("remove_old_task_desc"));if(!t)return;e.torrents[0].destroy(),e.torrents.splice(0)}this.createTask(a)}}},async onFolderChange(e){var t,n,o;console.log("onFolderChange",e),(null===e||void 0===e||null===(t=e.target)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>100&&(this.showProgress(this.$t("resolving_folder_files")),await Nn(100));const a=[...null===e||void 0===e||null===(o=e.target)||void 0===o?void 0:o.files];if(!a)return;console.log("folder selected",a),e.target.value=null;const s=this.calcFileSize(a),i=En(a.map((e=>e.path)));if(this.showProgress(""),await Nn(50),s>Dn){const e=await this.askForConfirm(this.$t("folder_too_large"),this.$t("folder_too_large_msg",{size:Object(M["a"])(s)}));if(!e)return}console.log("TOTAL:",s),console.log("Create task with folder",i),this.createTask(i)},async createTask(e){const t=Ln();this.showProgress(this.$t("creating_new_task")),Object(Z["isElectron"])()?Object(An["g"])(e,t):X["a"].emit("wt-add",e,{token:t});const n=()=>{const e=setInterval((()=>{const n=Pn["a"].taskList.uploading.find((e=>e.token===t)),o=()=>{this.showProgress(""),this.selectTask(this.getTaskOption(n))};if(n.ready&&n.alphabizURI)return clearInterval(e),void o();if(!n.verifyStatus)return this.showProgress(this.$t("loading")+"... (0%)");const a=Object(M["g"])(n.verifyStatus.current/n.verifyStatus.total);this.showProgress(this.$t("loading")+`... (${a})`),n.verifyStatus.current>=n.verifyStatus.total&&n.alphabizURI&&(clearInterval(e),setTimeout(o,1e3))}),1e3)},o=Date.now(),a=setInterval((()=>{const e=Pn["a"].taskList.uploading.find((e=>e.token===t));if(e)clearInterval(a),n();else if(Date.now()-o>3e3)return clearInterval(a),this.showProgress(""),this.askForConfirm(this.$t("cannot_create_task"),this.$t("cannot_create_task_msg"))}),500)},async fromMagnet(){if("string"!==typeof this.magnetInput||!this.magnetInput)return;if(!this.magnetInput.startsWith("magnet"))return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});let e=this.magnetInput;if(!e.includes("dn=")){if(!this.postTitle)return this.$q.dialog({message:this.$t("magnet_does_not_have_name"),ok:this.$t("ok")});e+=`&dn=${encodeURIComponent(this.postTitle)}`}const t=await Object(Ce["a"])(e);if(!t)return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});const n=e.split("&").find((e=>e.startsWith("dn="))),o=n?decodeURIComponent(n.substring(3)):this.postTitle;if(!o)return this.$q.dialog({title:this.$t("cannot_get_task_name"),ok:this.$t("ok")});this.selectTask({value:t,label:o,title:o})}},watch:{show(e){e&&this.$nextTick((()=>{this.clear(),this.preset&&this.selectTask(this.getTaskOption(this.preset))}))}}},Rn=jn,Un=(n("50de"),n("2b77")),Fn=n("79e0"),Mn=Object(v["a"])(Rn,Tn,In,!1,null,"7e12c2f2",null),Bn=Mn.exports;C()(Mn,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSeparator:z["a"],QBtn:O["a"],QSelect:ue["a"],QInput:D["a"],QRadio:Un["a"],QItem:ze["a"],QItemSection:He["a"],QItemLabel:Fn["a"],QCardActions:N["a"]}),C()(Mn,"directives",{ClosePopup:K["a"]});var Qn={name:"EditMain",components:{ChannelCard:pt,ChannelEdit:on,PostEdit:un,PostList:xn,BackToTop:ot,QuickStart:Bn},mixins:[vt],data(){return{current:null,showEdit:!1,edittingChannel:null,mode:"edit",currentId:"",listChannelId:"",edittingPost:null,edittingPostId:"",edittingPostChannelId:"",showPostList:!1,showPostEdit:!1,showBackToTop:!1,showQuickStart:!1,postMode:"edit",lib:r["a"]}},computed:{modeTitle(){return"add"===this.mode?this.$t("add_channel"):this.$t("channel_setting")},postModeTitle(){return"add"===this.postMode?this.$t("add_post"):this.$t("edit_post")},ownedChannels(){return this.lib.ownedChannels.filter((e=>r["a"].channelList.some((t=>t.id===e.id))))},filteredChannels(){const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{switch(t){case"channelID":return e.id;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(e)};return this.ownedChannels.filter(o)},ownedChannelInstances(){return this.lib.ownedChannelInstances},editTitle(){return"edit"===this.mode?this.$t("edit_channel"):this.$t("add_channel")},editPostTitle(){return"edit"===this.postMode?this.$t("edit_post"):this.$t("add_post")},listChannel(){const e=r["a"].ownedChannels.find((e=>e.id===this.listChannelId));return e||{}}},methods:{intersect(e){this.showBackToTop=!e.isIntersecting},scrollTop(){this.$refs.scrollArea.scrollTop=0},edit(e){const t=this.ownedChannels.find((t=>t.id===e));t&&(this.edittingChannel=t,this.currentId=e,this.mode="edit",this.showEdit=!0)},add(){this.edittingChannel={title:"",description:"",image:""},this.mode="add",this.showEdit=!0},validateChannelTitle(e){return e.length>0&&e.length<100||this.$t("validate_channel_title_length")},validateChannelDesc(e){return e.length>9&&e.length<301||this.$t("validate_channel_desc_length")},validateChannelImage(e){return!e||(e.match(/\s/)?this.$t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https://"))&&e.length<2048||this.$t("validate_channel_image_url"))},validateChannel(e){return[this.validateChannelTitle(e.title),this.validateChannelDesc(e.description),this.validateChannelImage(e.image)]},editChannel(e){console.log(e,this.currentId);const t=this.validateChannel(e);t.every((e=>!0===e))?(r["a"].editChannel(this.currentId,e).catch((e=>{console.error(e),this.$q.notify(this.$t("Network Error"))})),this.showEdit=!1):this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},addChannel(e){console.log(e);const t=this.validateChannel(e);if(t.every((e=>!0===e))){const t=this.lib.createChannel(e.title,e.description,e.image,e.hidden);console.log(t),this.showEdit=!1,t.then(console.log)}else this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},submit(e){return"edit"===this.mode?this.editChannel(e):this.addChannel(e)},showPostEditor(e,t){console.log("show",e,t),this.postMode="edit",this.edittingPostId=e.id,this.edittingPostChannelId=t.id,this.edittingPost={...e},this.showPostEdit=!0},showPostAdd(){this.postMode="add",this.edittingPost={title:"",description:"",image:"",abUrl:""},this.showPostEdit=!0},validatePostTitle(e){return e.length>0&&e.length<100||this.$t("validate_post_title_length")},validatePostDesc(e){return e.length>9&&e.length<301||this.$t("validate_post_desc_length")},validatePostImage(e){return!e||(e.match(/\s/)?this.$t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https"))&&e.length<2048||this.$t("validate_post_image_url"))},validatePostUrl(e){if(!e.startsWith(Ne.a.shortProtocol+"://")&&!e.startsWith(Ne.a.protocol+"://"))return this.$t("validate_post_url");const t=Object(we["a"])(e);return 28!==t.length?this.$t("validate_post_url"):e.length<2048||this.$t("validate_post_url_length")},validatePost(e){return e.rate?[this.validatePostTitle(e.title),this.validatePostDesc(e.description),this.validateChannelImage(e.image),this.validatePostUrl(e.abUrl)]:[this.$t("select_a_rate")]},editPost(e){const t=this.validatePost(e);t.every((e=>!0===e))?(console.log("edit",e,this.edittingPostChannelId,this.edittingPostId),r["a"].editPost(this.edittingPostChannelId,this.edittingPostId,e),this.showPostEdit=!1):this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},addPost(e){const t=this.validatePost(e);t.every((e=>!0===e))?(console.log("new post to add",e),r["a"].createPost(e,this.edittingPostChannelId),this.showPostEdit=!1):this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},submitPost(e){return"edit"===this.postMode?this.editPost(e):this.addPost(e)},removePost(e,t){console.log("remove post",e,t),this.$q.dialog({title:this.$t("remove_post"),message:this.$t("remove_post_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"gray",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{r["a"].removePost(e,t)}))},removeChannel(e){console.log("remove channel by id:",e),this.$q.dialog({title:this.$t("remove_channel"),message:this.$t("remove_channel_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"gray",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{r["a"].removeChannel(e)}))},showChannelDetail(e){this.listChannelId=e,this.edittingPostChannelId=e,this.showPostList=!0},showPreview(e){const t=r["a"].channelList.find((t=>t.id===e));if(!t)return;const n=["id","title","soul"].map((e=>{const n=t[e];return n?encodeURIComponent(e)+"="+encodeURIComponent(n):""})).filter((e=>e)).join("&"),o=`/library/channel?${n}&fromEdit=1&preview=1`;this.$root.$emit("navigate-to",o),this.$router.push(o)},setSearch(){this.lib.setSearchOption([{label:this.$t("title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},beforeRouteEnter(e,t,n){n((e=>{t.path.startsWith("/library")&&e.setSearch()}))},mounted(){this.setSearch()},activated(){this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/edit")},watch:{searchText(e){e&&this.active&&this.scrollTop()}}},Wn=Qn,zn=(n("61dc"),Object(v["a"])(Wn,Gt,Kt,!1,null,"755ddde0",null)),Hn=zn.exports;C()(zn,"components",{QBtn:O["a"],QTooltip:H["a"],QDialog:q["a"],QColor:cn["a"]}),C()(zn,"directives",{Intersection:Ge["a"]});var Vn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"channel-page"},[n("q-virtual-scroll",{ref:"vscroll",staticClass:"posts",staticStyle:{height:"calc(100vh - 130px - env(safe-area-inset-bottom) - env(safe-area-inset-top))",padding:"0"},attrs:{separator:"",items:e.filteredPosts,"virtual-scroll-slice-size":10,"virtual-scroll-item-size":385,"virtual-scroll-sticky-size-end":16,"virtual-scroll-sticky-size-start":560},on:{"virtual-scroll":e.onScroll},scopedSlots:e._u([{key:"before",fn:function(){return[e.isPreview?n("q-card",{staticClass:"channel-preview-hint",attrs:{id:"channel-preview-hint"}},[n("q-card-section",[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("preview_mode")))]),n("div",{staticClass:"text-subtitle2"},[e._v(e._s(e.$t("preview_mode_desc")))])])],1):e._e(),n("div",{staticClass:"full-width flex justify-center",class:e.screen$xs?["q-pt-sm"]:["q-pt-md"]},[e.channel&&e.channel.id?n("ChannelHeader",{staticClass:"col-grow",class:[e.screen$xs?"q-ml-sm q-mr-xs":"q-mx-md"],attrs:{channel:e.channel},on:{scrollTop:e.scrollTop,intersect:e.intersect}}):e._e()],1)]},proxy:!0},{key:"default",fn:function(t){var o=t.item,a=t.index;return[n("PostCard",{key:a,attrs:{hideChannel:"",post:o},on:{preview:e.preview}})]}},{key:"after",fn:function(){return[n("div",{staticClass:"flex justify-center items-center",class:e.filteredPosts.length?["q-py-xl"]:["full-height"],style:{marginTop:e.filteredPosts.length?"-16px":"0"}},[e.filteredPosts.length?[n("q-icon",{attrs:{name:"check_circle_outline",size:"1.2rem"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("got_all_post")))])]:[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])]],2)]},proxy:!0}])}),n("BackToTop",{attrs:{show:e.scrollIndex>0&&!e.isIntersecting},on:{click:e.scrollTop}}),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1),n("Loading",{attrs:{value:e.loadingPost}})],1)},Gn=[],Kn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"channel-header relative-position overflow-hidden",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.24)",border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"}},[n("q-card-section",{staticStyle:{height:"140px"}},[n("div",{staticClass:"absolute-top-left bg-black full-width full-height overflow-hidden"},[n("img",{staticStyle:{filter:"brightness(0.7)"},attrs:{src:e.channel.image,width:"100%"},on:{error:e.onImageError}}),n("div",{staticClass:"absolute-top-left full-width full-height",staticStyle:{"box-shadow":"inset 0 0 50px rgba(0,0,0,0.8)"}})])]),n("q-card-section",{staticClass:"q-py-none q-pr-none q-mb-md flex no-wrap items-start bg-transparent relative-position",staticStyle:{height:"calc(60px + 4px)"}},[n("q-avatar",{staticClass:"q-ml-xs bg-black",staticStyle:{transform:"translateY(-50%)"},attrs:{size:"120px"}},[e.isLoadChannelImage?n("img",{attrs:{src:e.channel.image},on:{error:e.onChannelImageError,load:e.onChannelImageLoaded}}):e._e(),e.isLoadChannelImage?e._e():n("q-icon",{staticStyle:{color:"#ccc"},attrs:{name:"subscriptions",size:"65px"}})],1),n("div",{staticClass:"q-px-md overflow-hidden full-height full-width flex items-center justify-start"},[n("q-badge",{staticClass:"block q-py-xs cursor-pointer non-selectable",attrs:{color:"general","text-color":"general"},on:{click:function(t){e.showFollowers=!0}}},[n("div",{staticClass:"header-channel-info"},[n("span",{staticClass:"text-weight-bolder"},[e._v(e._s(e.followerCount))]),e._v(" "),n("span",[e._v(e._s(e.$t("followers")))])])]),n("q-space"),n("FollowButton",{attrs:{id:e.channel.id}})],1)],1),n("q-card-section",{staticClass:"q-pt-none column items-stretch",staticStyle:{width:"fit-content","max-width":"100%"}},[n("div",{staticClass:"flex items-center no-wrap overflow-hidden full-width"},[n("div",{staticClass:"channel-title text-h6 text-weight-bold ellipsis col-shrink",attrs:{title:e.channel.title}},[e._v(e._s(e.channel.title))]),n("q-space"),n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"content_copy",size:"xs",dense:""},on:{click:function(t){return e.copy(e.channel.id)}}},[n("q-tooltip",[n("span",[e._v(e._s(e.$t("channel")+" ID: "))]),n("span",[e._v("%"+e._s(e.channel.id))])])],1),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-ml-xs q-pa-xs",attrs:{unelevated:"",dense:"",color:"general","text-color":"general",icon:"block",size:"xs"},on:{click:e.takedownChannel}},[n("q-tooltip",[e._v(e._s(e.$t("takedown_channel")))])],1):e._e()],1),n("div",{staticClass:"flex items-center no-wrap overflow-hidden full-width"},[n("div",{staticClass:"creator-title cursor-pointer ellipsis col-shrink",staticStyle:{"font-size":"0.9rem"},on:{click:e.gotoCreator}},[e._v("\n "+e._s(e.$t("creator"))+": "),n("span",[e._v(e._s(e.creator.name))])]),n("q-space"),e.creator.id?n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"content_copy",size:"xs",dense:""},on:{click:function(t){return e.copy(e.creator.id)}}},[n("q-tooltip",[n("span",[e._v(e._s(e.$t("creator")+" ID: "))]),n("span",[e._v("@"+e._s(e.creator.id))])])],1):e._e(),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-ml-xs q-pa-xs",attrs:{unelevated:"",dense:"",color:"general","text-color":"general",icon:"block",size:"xs"},on:{click:e.takedownCreator}},[n("q-tooltip",[e._v(e._s(e.$t("takedown_user")))])],1):e._e()],1)]),n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"header-description"},[e._v("\n "+e._s(e.channel.description)+"\n ")]),n("div",{staticClass:"header-badges q-mt-sm non-selectable",staticStyle:{height:"min-content"}},[n("div",{staticClass:"overflow-hidden",staticStyle:{margin:"-4px"}},[e.channel.hidden?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"general","text-color":"general",label:e.$t("private_channel")}}):e._e(),e.isBlocked?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"negative","text-color":"negative",label:e.$t("blocked")}}):e._e(),e.isBlockedCreator?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"negative","text-color":"negative",label:e.$t("creator_blocked")}}):e._e()],1)])]),n("div",{staticClass:"absolute-top-right q-ma-sm flex"},[n("q-btn",{directives:[{name:"intersection",rawName:"v-intersection",value:function(t){return e.$emit("intersect",t)},expression:"e => $emit('intersect', e)"}],attrs:{unelevated:"",round:"",icon:"share","text-color":"white"},on:{click:e.copyShareLink}},[n("q-tooltip",[e._v(e._s(e.$t("share")))])],1)],1),n("q-dialog",{attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showFollowers,callback:function(t){e.showFollowers=t},expression:"showFollowers"}},[n("q-card",{staticClass:"column overflow-hidden no-wrap",style:{minWidth:e.screen$xs?void 0:"560px",maxHeight:e.screen$xs?void 0:"calc(100vh - 120px)"}},[n("q-card-section",{staticClass:"row items-center q-py-sm"},[n("div",{staticClass:"text-h6 follower-title"},[e._v(e._s(e.$t("follower"))+" - "+e._s(e.channel.title))]),n("q-space"),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",round:""}})],1),n("q-separator"),n("q-card-section",{staticClass:"row items-center q-pa-none",staticStyle:{"min-width":"400px","flex-grow":"1","flex-shrink":"1","overflow-y":"auto"}},[n("q-markup-table",{staticStyle:{width:"100%"},attrs:{dense:"",flat:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("user")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("follow_time")))])])]),n("tbody",e._l(e.followers,(function(t){return n("tr",{key:t.id},[n("td",{staticClass:"text-left"},[e._v(e._s(t.user))]),n("td",{staticClass:"text-right"},[e._v(e._s(t.time))])])})),0)])],1)],1)],1)],1)},Yn=[],Jn=(n("7a76"),{components:{FollowButton:Ae["a"]},name:"ChannelHeader",props:{channel:{type:Object,required:!0}},data(){return{creator:{name:this.$t("loading"),id:"",avatar:"",description:""},followBtnHovered:!1,pending:!1,showFollowers:!1,offFollower:null,isLoadChannelImage:!0,followers:[],lib:r["a"]}},computed:{currentCreator(){return r["a"].currentCreator},isBlocked(){return!(!r["a"].userData||!r["a"].userData.blockChannels)&&r["a"].userData.blockChannels.includes(this.channel.id)},isBlockedCreator(){return!(!r["a"].userData||!r["a"].userData.blockUsers)&&r["a"].userData.blockUsers.includes(this.channel.creator)},followable(){return!r["a"].followingChannels.find((e=>e.id===this.channel.id))},followBtnLabel(){return this.followable?this.$t("follow"):this.followBtnHovered?this.$t("unfollow"):this.$t("following")},followerCount(){let e=this.followers.length;return e<1e3?e.toString():(e=Math.floor(e/1e3),e<1e3?e.toString()+"K+":(e=Math.floor(e/1e3),e<1e3?e.toString()+"M+":(e=Math.floor(e/1e3),e.toString()+"B+")))}},methods:{loadCreator(){this.channel.creator.id!==this.creator.id&&(this.creator={name:this.$t("loading"),id:"",avatar:"",description:""}),r["a"].getUserProfile(this.channel.creator).then((e=>{this.creator=e}))},loadFollowers(){p["v"].get(`${p["e"]}/channels:follower/${this.channel.id}`).on(((e,t,n,o)=>{this.offFollower=()=>o.off();const a=Object.values(e);for(let s=0;se.id===s)),i={id:s,user:n,timestamp:o,time:new Date(o).toLocaleString()};-1!==a?this.followers.splice(a,1,i):this.followers.push(i)}}))},copy(e){Object(lt["b"])(e).then((()=>{this.$q.notify(this.$t("copied_to_clipboard"))}))},async copyShareLink(){const e=`${Ne.a.shortProtocol}-library://channel/${Object(h["b"])(this.channel.title)}/${this.channel.id}`,t=await Object(Ce["a"])(e);if(!t)return this.$q.notify(this.$t("uri_copy_failed"));Object(lt["b"])(t).then((()=>{this.$q.notify(this.$t("share_url_copied"))}))},async follow(){if(this.pending)return;const e=this.channel.id;if(!e)return;if(!r["a"].allChannelList.some((t=>t.id===e)))return this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:!0});const t=this.followable;if(!t){const e=await new Promise((e=>{this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>e(!1))).onDismiss((()=>e(!0)))}));if(e)return}this.pending=!0,setTimeout((()=>{!r["a"].followingChannels.find((t=>t.id===e))===t&&(console.log("follow failed!",e,t),t&&r["a"].followChannel(e))}),2e3),t?r["a"].followChannel(e):r["a"].unfollowChannel(e)},gotoCreator(){if(console.log("goto creator",this.currentCreator),!this.currentCreator||!this.currentCreator.name)return this.$q.dialog({title:this.$t("loading_creator"),message:this.$t("wait_for_creator_loaded"),ok:this.$t("ok")});const e=`/library/creator?fromChannel=1&name=${encodeURIComponent(this.currentCreator.name)}`;this.$router.push(e).then((t=>{t instanceof Error||this.$root.$emit("navigate-to",e)}))},takedown(e,t){const n=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:n[0].value,type:"radio",items:n},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((n=>{console.log(n),["Serious Violation","Copyright Disputes","Adults Only"].includes(n)&&r["a"].takedown(e,t,n).then((()=>{this.$q.notify(this.$t("success"))}))}))},takedownCreator(){if(!r["a"].currentCreator||!r["a"].currentCreator.id)return this.$q.notify("Please wait for creator loaded");this.takedown("user",r["a"].currentCreator.id)},takedownChannel(){if(!this.channel.id)return this.$q.notify("Cannot get channel id");this.takedown("channel",this.channel.id)},onImageError(e){e.target.src="developer/platform-assets/linux/512x512.png"},onChannelImageError(){this.isLoadChannelImage=!1},onChannelImageLoaded(e){e.target.src===this.channel.image&&(this.isLoadChannelImage=!0)}},mounted(){this.loadCreator(),this.loadFollowers(),this.$nextTick((()=>{this.$emit("scrollTop")}))},activated(){this.loadCreator(),"function"===typeof this.offFollower&&(this.offFollower(),this.loadFollowers(),this.$nextTick((()=>{this.$emit("scrollTop")})))},beforeDestroy(){"function"===typeof this.offFollower&&this.offFollower()},watch:{followable(){this.pending=!1},currentCreator(){this.loadCreator()},channel(e,t){e&&e.image!==t.image&&(this.isLoadChannelImage=!0)}}}),Xn=Jn,Zn=(n("ec6d"),Object(v["a"])(Xn,Kn,Yn,!1,null,"1d2daf92",null)),eo=Zn.exports;C()(Zn,"components",{QCard:E["a"],QCardSection:A["a"],QAvatar:Qe["a"],QIcon:G["a"],QBadge:he["a"],QSpace:W["a"],QBtn:O["a"],QTooltip:H["a"],QDialog:q["a"],QSeparator:z["a"],QMarkupTable:V["a"],QColor:cn["a"]}),C()(Zn,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var to={name:"LibraryChannel",components:{ChannelHeader:eo,PostCard:Ye,Loading:S,BackToTop:ot},data(){return{channel:{id:""},posts:[],showPreview:!1,loadingPost:!1,previewImage:"",channelFollowers:[],currentId:"",scrollIndex:0,isIntersecting:!1,isChecking:!1,isPreview:!1,showLoading:!1,lib:r["a"]}},computed:{isDev(){return d["a"].getters.isDevMode},isFollowed(){return r["a"].followingChannels.some((e=>e.id===this.channel.id))},isBlocked(){return!(!r["a"].userData||!r["a"].userData.blockChannels)&&(r["a"].userData.blockChannels.includes(this.channel.id)||r["a"].userData.blockUsers.includes(this.channel.creator))},channelPosts(){const e=Object.assign({},this.channel);return this.posts.map((t=>({...t,rate:t.rate||"G",channel:e}))).sort(((e,t)=>t.timestamp-e.timestamp))},filteredPosts(){const e=r["a"].search.text.toLowerCase(),t=r["a"].search.option.value,n=e=>{switch(t){case"description":return e.description;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(Object(h["a"])(e))};return this.channelPosts.filter((e=>!!this.isPreview||!r["a"].isBannedPost(e)&&r["a"].isValidRate(e.rate))).filter(o)}},methods:{intersect(e){this.isIntersecting=e.isIntersecting},onAvatarError(e){e.target.src="developer/platform-assets/linux/512x512.png"},onScroll(e){this.scrollIndex=e.index},scrollTop(){this.$refs.vscroll.scrollTo(0,"start")},loadChannelPosts(){console.log(this.$route.query);const e=this.lib.allChannelList.find((e=>e.id===this.$route.query.id||e.soul===this.$route.query.soul));if(console.log("load channel",e),e){var t,n;if(this.channel=e,this.loadingPost=!0,this.channel.creator||this.channel.soul)r["a"].setCreator(this.channel.creator||(null===(t=this.channel.soul)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n[0]));this.posts=[],r["a"].getChannelPosts(e.id,!0).then((e=>{console.log("Channel posts",e),this.posts=e.sort(((e,t)=>{const n=t.timestamp-e.timestamp;return 0===n?e.title.match(/^\d+/)&&t.title.match(/^\d+/)?parseInt(t.title)-parseInt(e.title):t.title.localeCompare(e.title):n}));const t=Date.now(),n=setInterval((()=>{(this.posts.length||Date.now()-t>5e3)&&(this.loadingPost=!1,clearInterval(n))}),1e3)}))}else{if(this.posts=[],console.log(this.$route.path),"library/channel"!==this.$route.path)return;this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),persistent:!0,ok:this.$t("lib_index")}).onOk((()=>{this.currentId="",this.$root.$emit("navigate-to"),this.$router.push("/library")}))}},loadChannelFollowers(){const e=[];p["v"].get(`${p["e"]}/channels:follower/${this.channel.id}`).on((t=>{if(!t)return;const n=Object.values(t);for(let o=0;oe.id===o));-1!==i?e.splice(i,1,{id:o,user:s,timestamp:a}):e.push({id:o,user:s,timestamp:a})}})),this.channelFollowers=e.sort(((e,t)=>t.timestamp-e.timestamp))},async copyShare(){const e=`ab-library://channel/${Object(h["b"])(this.channel.title)}/${this.channel.id}`;if(console.log("share",e),Object(Z["isElectron"])()){const t=await Object(Ce["a"])(e);if(!t)return this.$q.notify(this.$t("uri_copy_failed"));Object(lt["b"])(t).then((()=>{this.$q.notify(this.$t("copied"))}))}},onFollow(){const e=this.channel.id;console.log("follow",e),r["a"].followingChannels.map((e=>e.id)).includes(e)?this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)})):r["a"].followChannel(e)},preview(e){this.previewImage=e,this.showPreview=!0},gotoCreator(){if(!r["a"].currentCreator||!r["a"].currentCreator.name)return this.$q.dialog({title:"Loading creator",message:"Please wait for creator info loaded",ok:!0});const e=`/library/creator?fromChannel=1&name=${encodeURIComponent(r["a"].currentCreator.name)}`;this.$root.$emit("navigate-to",e),this.$router.push(e)},checkAndReload(){console.log("check and reload"),this.isChecking||(this.isChecking=!0,setTimeout((()=>{this.isChecking=!1}),1e3),this.currentId===this.$route.query.id&&this.channelPosts.length||(console.log("load channel posts"),p["v"].get(`${p["e"]}/channels:follower/${this.currentId}`).off(),this.channel={},this.posts=[],this.currentId=this.$route.query.id,this.loadChannelPosts(),this.loadChannelFollowers()),this.$route.query.preview?this.isPreview=!0:this.isPreview=!1)},setSearch(){this.lib.setSearchOption([{label:this.$t("post_title"),value:"post"},{label:this.$t("description"),value:"description"}])}},mounted(){this.setSearch(),this.checkAndReload()},watch:{"$route.query.id"(e){e&&(console.log("query id check"),this.checkAndReload())},searchText(e){e&&this.active&&this.scrollTop()}},beforeDestroy(){p["v"].get(`${p["e"]}/channels:follower/${this.channel.id}`).off()}},no=to,oo=(n("b16a"),Object(v["a"])(no,Vn,Gn,!1,null,"fb451ef2",null)),ao=oo.exports;C()(oo,"components",{QVirtualScroll:Ve["a"],QCard:E["a"],QCardSection:A["a"],QIcon:G["a"],QDialog:q["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(oo,"directives",{ClosePopup:K["a"]});var so=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.lib.currentCreator?n("div",{ref:"scrollArea",staticClass:"library-creator q-pa-md q-pb-lg"},[n("q-card",{staticClass:"creator-info relative-position overflow-hidden q-mb-sm",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.48)",border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"}},[n("q-card-section",{directives:[{name:"intersection",rawName:"v-intersection",value:e.intersect,expression:"intersect"}],staticStyle:{height:"140px"}},[n("div",{staticClass:"absolute-top-left bg-black full-width full-height overflow-hidden"},[n("img",{staticStyle:{filter:"brightness(0.7)"},attrs:{src:e.profile.avatar,width:"100%"},on:{error:e.onAvatarError}}),n("div",{staticClass:"absolute-top-left full-width full-height",staticStyle:{"box-shadow":"inset 0 0 50px rgba(0,0,0,0.8)"}})])]),n("q-card-section",{staticClass:"q-py-none q-mb-md q-pr-none flex no-wrap items-start bg-transparent relative-position",staticStyle:{height:"calc(60px + 4px)"}},[n("q-avatar",{staticClass:"q-ml-xs bg-black creator-avatar",attrs:{size:"120px"}},[e.isLoadCreatorAvatar?n("img",{attrs:{src:e.profile.avatar},on:{error:e.onCreatorAvatarError,load:e.onCreatorAvatarLoaded}}):e._e(),e.isLoadCreatorAvatar?e._e():n("q-icon",{staticStyle:{color:"#ccc"},attrs:{name:"account_circle",size:"90px"}})],1),n("div",{staticClass:"q-px-md overflow-hidden full-height full-width flex items-center justify-start"})],1),n("q-card-section",{staticClass:"q-pt-none column items-start overflow-hidden full-width"},[n("div",{staticClass:"channel-title text-h6 text-weight-bold ellipsis",staticStyle:{"max-width":"100%"},attrs:{title:e.profile.name}},[e._v("\n "+e._s(e.profile.name)+"\n ")]),e.profile.id?n("div",{staticClass:"flex items-center no-wrap overflow-hidden",staticStyle:{width:"fit-content","max-width":"100%"}},[n("div",{staticClass:"creator-id ellipsis col-shrink",staticStyle:{"font-size":"0.9rem"}},[n("span",[e._v("@"+e._s(e.profile.id))])]),n("q-space"),n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"content_copy",size:"xs",dense:""},on:{click:e.copyCreatorId}},[n("q-tooltip",[n("span",[e._v(e._s("ID: "))]),n("span",[e._v("@"+e._s(e.profile.id))])])],1),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"block",size:"xs",dense:""},on:{click:e.takedownCreator}},[n("q-tooltip",[n("span",[e._v(e._s(e.$t("takedown_user")))])])],1):e._e()],1):e._e()]),e.profile.description?n("q-card-section",{staticClass:"q-pt-none creator-section overflow-hidden"},[n("div",{staticClass:"creator-description q-mb-sm scroll-y"},[e._v(e._s(e.profile.description))])]):e._e()],1),n("div",{staticClass:"creator-flex-layout flex justify-center"},[e.filteredChannels.length?[e._l(e.filteredChannels,(function(t){return n("ChannelCard",{key:t.id,attrs:{id:t.id,title:t.title,description:t.description,image:t.image,soul:t.soul,hidden:t.hidden,followable:!e.followedIds.includes(t.id)},on:{takedown:e.takedownChannel,detail:e.showChannelDetail,follow:e.onFollow}})})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i")]:n("div",{staticClass:"empty-placeholder full-width text-center text-subtitle1"},[n("q-icon",{attrs:{name:"help_outline"}}),n("span",{staticClass:"empty-hint q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)],2),n("BackToTop",{attrs:{show:e.showBackToTop},on:{click:e.scrollTop}})],1):e._e()},io=[],ro={name:"LibraryCreator",components:{ChannelCard:pt,BackToTop:ot},mixins:[vt],data(){return{profile:{name:this.$t("loading"),id:"",avatar:"",description:""},showBackToTop:!1,isLoadCreatorAvatar:!0,lib:r["a"]}},computed:{filteredChannels(){const e=this.searchText.toLowerCase(),t=this.lib.search.option.value,n=e=>{switch(t){case"channelID":return e.id;default:return e.title}},o=o=>{var a;const s=Object(h["a"])(null===(a=n(o))||void 0===a?void 0:a.toLowerCase());return"channelID"===t&&s===e||!(o.hidden&&!r["a"].followingChannels.find((e=>e.id===o.id)))&&s.includes(e)};return this.lib.currentCreator.channels.filter((e=>r["a"].channelList.some((t=>t.id===e.id)))).filter(o)},followedIds(){return r["a"].followingChannels.map((e=>e.id))}},watch:{profile(e,t){if(e&&e.avatar!==t.avatar&&(this.isLoadCreatorAvatar=!0),e&&e.name){const t=`/library/creator?fromChannel=1&name=${encodeURIComponent(e.name)}`;this.$root.$emit("update-path",t)}},searchText(e){e&&this.active&&this.scrollTop()}},methods:{intersect(e){this.showBackToTop=!e.isIntersecting},scrollTop(){this.$refs.scrollArea.scrollTop=0},loadProfile(){this.profile={name:this.$t("loading"),id:"",avatar:"",description:""},r["a"].getUserProfile(r["a"].currentCreator.id).then((e=>{this.profile=e}))},onAvatarError(e){e.target.src="developer/platform-assets/linux/512x512.png"},onCreatorAvatarError(){this.isLoadCreatorAvatar=!1},onCreatorAvatarLoaded(e){e.target.src===this.profile.avatar&&(this.isLoadCreatorAvatar=!0)},showChannelDetail(e){const t=Object(h["c"])(e);console.log(t),this.$root.$emit("navigate-to",t),this.$router.push(t)},copyCreatorId(){Object(lt["b"])(this.profile.id).then((()=>{this.$q.notify(this.$t("copied"))}))},takedown(e,t){const n=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:n[0].value,type:"radio",items:n},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((n=>{["Serious Violation","Copyright Disputes","Adults Only"].includes(n)&&r["a"].takedown(e,t,n).then((()=>{this.$q.notify(this.$t("success"))}))}))},takedownCreator(){if(!r["a"].currentCreator.id)return this.$q.notify("Please wait for creator loaded");this.takedown("user",r["a"].currentCreator.id)},takedownChannel(e){if(!e||20!==e.length)return this.$q.notify("Cannot parse channel id");this.takedown("channel",e)},onFollow(e){console.log("follow",e),this.followedIds.includes(e)?this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)})):r["a"].followChannel(e)},setSearch(){this.lib.setSearchOption([{label:this.$t("channel_title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},beforeRouteEnter(e,t,n){n((e=>{t.path.startsWith("/library")&&(e.setSearch(),r["a"].setCreator(r["a"].currentCreator.id))}))},mounted(){this.setSearch()},activated(){this.loadProfile()}},lo=ro,co=(n("878c"),Object(v["a"])(lo,so,io,!1,null,"5975beaa",null)),uo=co.exports;C()(co,"components",{QCard:E["a"],QCardSection:A["a"],QAvatar:Qe["a"],QIcon:G["a"],QSpace:W["a"],QBtn:O["a"],QTooltip:H["a"],QColor:cn["a"]}),C()(co,"directives",{Intersection:Ge["a"]});var ho=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"take-down"},[n("div",{staticClass:"text-h6"},[e._v("\n "+e._s(e.$t("takedown_management"))+"\n "),n("q-icon",{attrs:{name:"help"}},[n("q-tooltip",e._l(e.$t("about_takedown_mode").split("\n"),(function(t){return n("div",{key:t,staticStyle:{"font-size":"14px"}},[e._v(e._s(t))])})),0)],1)],1),n("div",{staticClass:"take-down-lists"},e._l(e.takedownList,(function(t){var o=t.type,a=t.label,s=t.list,i=t.model;return n("q-table",{key:o,staticStyle:{"max-height":"400px"},attrs:{flat:"",dense:"",title:a,data:s,columns:e.columns,"row-key":"name","virtual-scroll":"","rows-per-page-options":[0]},scopedSlots:e._u([{key:"top-row",fn:function(){return[n("q-tr",{staticClass:"takedown-row add"},[n("q-td",{staticClass:"takedown-id"},[n("q-input",{attrs:{placeholder:e.$t(o)+" ID",dense:""},model:{value:i.id,callback:function(t){e.$set(i,"id",t)},expression:"model.id"}})],1),n("q-td",{staticClass:"takedown-reason"},[n("q-select",{attrs:{options:e.reasonOptions,label:e.$t("takedown_reason"),dense:""},model:{value:i.reason,callback:function(t){e.$set(i,"reason",t)},expression:"model.reason"}})],1),n("q-td",[e._v(e._s(e.$t(e.mode)))]),n("q-td",{staticClass:"takedown-admin"},[e._v("("+e._s(e.$t("you"))+")")]),n("q-td",{staticClass:"text-center"},[n("q-btn",{attrs:{flat:"",dense:"",color:"primary",icon:"add"},on:{click:function(t){return e.addTakedown(o)}}})],1)],1)]},proxy:!0},{key:"body",fn:function(t){var a=t.row;return[n("q-tr",{key:a.id,staticClass:"takedown-row"},[n("q-td",{key:"id",staticClass:"takedown-id",attrs:{title:a.id}},[n("q-btn",{staticClass:"q-mr-sm",attrs:{flat:"",dense:"",color:"general",icon:"content_copy",size:"xs"},on:{click:function(t){return e.copy(a.id)}}},[n("q-tooltip",[e._v(e._s(e.$t("copy"))+" ID")])],1),n("span",[e._v(e._s(a.id))])],1),n("q-td",{key:"reason",staticClass:"takedown-reason"},[e._v(e._s(a.reasonLabel))]),n("q-td",{key:"by",staticClass:"takedown-by"},[e._v(e._s(e.$t(a.by)))]),n("q-td",{key:"admins",staticClass:"takedown-admins"},[a.admins?n("div",[n("span",{staticClass:"voted-count",class:{"text-primary":a.selfVoted}},[n("span",[e._v(e._s(a.admins.length)+" voted")]),a.selfVoted?n("q-tooltip",[e._v("You have voted")]):e._e()],1),"committee"===a.by?n("span",{staticClass:"total-count",class:{"text-primary":a.admins.length>=a.minCount}},[e._v("\n / "+e._s(a.minCount)+" needs to takedown\n ")]):e._e()]):n("div",[e._v("-")])]),n("q-td",{key:"operations",staticClass:"takedown-operations text-center"},[n("q-btn",{attrs:{flat:"",dense:"",size:"xs",color:a.selfVoted?"negative":"positive",icon:a.selfVoted?"close":"add"},on:{click:function(t){return e.changeVote(o,a)}}}),"preset"===a.by?n("q-tooltip",[e._v(e._s(e.$t("cannot_edit_preset")))]):a.selfVoted?n("q-tooltip",[e._v(e._s(e.$t("remove_vote")))]):n("q-tooltip",[e._v(e._s(e.$t("add_vote")))])],1)],1)]}}],null,!0)})})),1)])},po=[],mo=n("41c7"),_o=n.n(mo);const fo=["Serious Violation","Copyright Disputes","Adults Only"];var go={name:"TakeDown",data(){return{mode:_o.a.mode,columns:[{name:"id",label:"ID",field:"id",align:"left",sortable:!0},{name:"reason",label:this.$t("takedown_reason"),field:"reason",align:"left",sortable:!0},{name:"by",label:this.$t("takedown_mode"),field:"by",align:"left",sortable:!0},{name:"admins",label:this.$t("admins"),field:"admins",align:"left",sortable:!1},{name:"operations",label:this.$t("operations"),field:"operations",align:"center",sortable:!1}],reasonOptions:[{label:this.$t("serious_violation"),value:"Serious Violation"},{label:this.$t("copyright_disputes"),value:"Copyright Disputes"},{label:this.$t("adults_only"),value:"Adults Only"}],user:{id:"",reason:{label:this.$t("serious_violation"),value:"Serious Violation"}},channel:{id:"",reason:{label:this.$t("serious_violation"),value:"Serious Violation"}},post:{id:"",reason:{label:this.$t("serious_violation"),value:"Serious Violation"}},lib:r["a"]}},computed:{uid(){return r["a"].user&&r["a"].user.is?r["a"].user.is.pub:""},takedownUsers(){const e=r["a"].takedownList.users,t=r["a"].takedownExtraList.users,n=[];return e.forEach((({id:e,reason:t})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),by:"preset",disable:!0})})),t.forEach((({id:e,reason:t,admins:o,minCount:a})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),admins:o,minCount:a,selfVoted:o.includes(this.uid),by:_o.a.mode,disable:!o.includes(this.uid)})})),n},takedownChannels(){const e=r["a"].takedownList.channels,t=r["a"].takedownExtraList.channels,n=[];return e.forEach((({id:e,reason:t})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),by:"preset",disable:!0})})),t.forEach((({id:e,reason:t,admins:o,minCount:a})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),admins:o,minCount:a,selfVoted:o.includes(this.uid),by:_o.a.mode,disable:!o.includes(this.uid)})})),n},takedownPosts(){const e=r["a"].takedownList.posts,t=r["a"].takedownExtraList.posts,n=[];return e.forEach((({id:e,reason:t})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),by:"preset",disable:!0})})),t.forEach((({id:e,reason:t,admins:o,minCount:a})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),admins:o,minCount:a,selfVoted:o.includes(this.uid),by:_o.a.mode,disable:!o.includes(this.uid)})})),n},takedownList(){return[{type:"user",label:this.$t("users"),model:this.user,list:this.takedownUsers},{type:"channel",label:this.$t("channels"),model:this.channel,list:this.takedownChannels},{type:"post",label:this.$t("posts"),model:this.post,list:this.takedownPosts}]}},methods:{takedownUser(){return 87!==this.user.id.length||this.user.id.split(".").some((e=>43!==e.length))?this.$q.notify(this.$t("takedown_invalid_user_id")):fo.includes(this.user.reason.value)?(console.log("takedown user",this.user.id,this.user.reason.value),void r["a"].takedown("user",this.user.id,this.user.reason.value).then(console.log)):this.$q.notify(this.$t("takedown_invalid_reason"))},takedownChannel(){const e=this.channel.id;return 20!==e.length?this.$q.notify(this.$t("takedown_invalid_channel_id")):fo.includes(this.channel.reason.value)?void r["a"].takedown("channel",e,this.channel.reason.value):this.$q.notify(this.$t("takedown_invalid_reason"))},takedownPost(){const e=this.post.id;return 20!==e.length?this.$q.notify(this.$t("takedown_invalid_post_id")):fo.includes(this.post.reason.value)?void r["a"].takedown("post",e,this.post.reason.value):this.$q.notify(this.$t("takedown_invalid_reason"))},untakedownUser(e){r["a"].takedown("user",e,"None")},addTakedown(e){return console.log("add",e),"user"===e?this.takedownUser():"channel"===e?this.takedownChannel():"post"===e?this.takedownPost():void 0},removeTakedown(e,t){return console.log("untakedown",e,t),"user"===e?this.untakedownUser(t):"channel"===e?r["a"].takedown("channel",t,"None"):"post"===e?r["a"].takedown("post",t,"None"):void 0},changeVote(e,t){return"preset"===t.by?console.log(t):t.selfVoted?this.removeTakedown(e,t.id):void r["a"].takedown(e,t.id,t.reason).then(console.log)},copy(e){Object(lt["b"])(e).then((()=>{this.$q.notify(this.$t("copied"))}))}},activated(){this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/takedown"),this.lib.setSearchOption([])}},bo=go,yo=(n("a44b"),n("85c4")),vo=n("236f"),wo=Object(v["a"])(bo,ho,po,!1,null,"888fffa4",null),ko=wo.exports;C()(wo,"components",{QIcon:G["a"],QTooltip:H["a"],QTable:Tt["a"],QTr:yo["a"],QTd:vo["a"],QInput:D["a"],QSelect:ue["a"],QBtn:O["a"],QColor:cn["a"]});var Co=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-index"},[n("div",{staticClass:"library-inner-container"},[n("VirtualScrollGrid",{staticClass:"library-grid",attrs:{virtualScrollSliceRow:30,itemWidth:560,itemHeight:473,gutter:8,itemsSize:e.searchFilteredPosts.length,itemsFn:function(t,n){return e.itemsFn(t,n-t)}},on:{"virtual-scroll":function(t){var n=t.from;return e.scrollIndex=n||0}},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("PostCard",{key:o.id,attrs:{post:o},on:{preview:function(t){return e.showPreview=t},follow:e.unfollow,"to-channel":e.toChannelPage}})]}},{key:"after",fn:function(t){var o=t.column,a=t.mod;return[n("div",{directives:[{name:"intersection",rawName:"v-intersection",value:function(t){return e.fetchNext(t,Math.max(Math.ceil(10/o),2)*o+(a?o-a:0))},expression:"(entry) => fetchNext(entry, (Math.max(Math.ceil(10 / column), 2) * column) + (mod ? column - mod : 0))"}],staticClass:"rounded-borders bg-page column justify-center items-center",class:e.searchFilteredPosts.length?"q-mb-sm q-pa-md":"",style:e.searchFilteredPosts.length?{}:{height:"calc(100vh - var(--header-height) - var(--appbar-height) - 8px)"}},["loaded"!==e.loaderState||e.searchFilteredPosts.length?"loaded"===e.loaderState?n("div",[n("q-icon",{attrs:{name:"check_circle_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("got_all_post")))])],1):e.searchFilteredPosts.length?n("div",{staticClass:"column items-center"},[n("div",{staticClass:"flex"},[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))])]):[n("div",[n("q-spinner",{attrs:{size:"4rem",color:"secondary"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))]),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("first_recomment_msg")))])]:n("div",[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)],2)]}}])}),e._e()],1),e._e(),n("BackToTop",{attrs:{show:e.scrollIndex>0||e.showBackToTop},on:{click:e.handleBackToTop}}),n("SearchChannel",{attrs:{higher:e.scrollIndex>0||e.showBackToTop}}),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1)],1)},$o=[],So=n("2e22"),xo={name:"LibraryIndex",components:{PostCard:Ye,SearchChannel:bt,BackToTop:ot},mixins:[So["c"],So["a"],So["b"],vt,wt("index"),Ct],data(){return{isElectron:Object(Z["isElectron"])(),active:!1,scrollIndex:0,lib:r["a"]}},computed:{followingChannels(){var e,t;const n=(null===(e=r["a"].userData)||void 0===e?void 0:e.blockChannels)||[],o=(null===(t=r["a"].userData)||void 0===t?void 0:t.blockUsers)||[];return r["a"].followingChannels.filter((e=>!r["a"].isBannedChannel(e)&&(!n.includes(e.id)&&!o.includes(e.creator))))},filteredPosts(){return Object.values(this.loadedPosts).filter((e=>e.title&&e.timestamp)).filter((e=>!r["a"].isBannedPost(e))).filter((e=>r["a"].isValidRate(e.rate||"G")))},searchFilteredPosts(){console.log("search index");const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{var n;switch(t){case"channel":return null===(n=e.channel)||void 0===n?void 0:n.title;case"channelID":return e.channel.id;case"description":return e.description;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(Object(h["a"])(e))};return this.filteredPosts.filter(o)}},methods:{async fetchNext({isIntersecting:e},t=10){e&&await this.loader$loadPostsNext({count:t})},itemsFn(e=0,t=5){return this.searchFilteredPosts.slice(e,e+t)},async unfollow(e){const t=this.$alphabiz.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}),n=await t.promise("ok");if(!n)return;const o=await r["a"].unfollowChannel(e);console.log("unfollowed",e,o)},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&"),n=`/library/channel?${t}`;this.$root.$emit("navigate-to",n),this.$router.push(n)}},async activated(){this.active=!0;const e=()=>{this.lib.setSearchOption([{label:this.$t("post_title"),value:"post"},{label:this.$t("description"),value:"description"},{label:this.$t("channel_title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])};this.$root.$emit("navigate-to"),e()},deactivated(){this.active=!1},watch:{"searchFilteredPosts.length"(e,t){t||!e||this.active||this.$router.push("/library")},searchText(e){e&&this.active&&this.handleBackToTop()}}},To=xo,Io=(n("1b99"),Object(v["a"])(To,Co,$o,!1,null,null,null)),Po=Io.exports;C()(Io,"components",{QIcon:G["a"],QSpinner:w["a"],QSpinnerIos:xt["a"],QTable:Tt["a"],QLinearProgress:It["a"],QSeparator:z["a"],QPagination:Pt["a"],QVirtualScroll:Ve["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(Io,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var Oo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page",[n("div",{staticClass:"container full-width"},[n("div",{staticClass:"sticky-bar q-py-sm bg-page text-page q-header--bordered"},[n("q-toolbar",{staticClass:"sticky-bar-toolbar"},[e._l([{tabName:"downloading",label:"start_all",color:"primary",disable:e.isAllStarted,handleClick:e.downloadAll},{tabName:"downloading",label:"pause_all",color:"general",disable:e.isAllPaused,handleClick:e.requestPauseAllDownloading},{tabName:"downloading",label:"remove_all",color:"negative",disable:0===e.currentList.length,handleClick:e.removeAllDownloading},{tabName:"uploading",label:"pause_all",color:"general",disable:e.isAllPaused,handleClick:e.pauseAllUploading},{tabName:"uploading",label:"remove_all",color:"negative",disable:0===e.currentList.length,handleClick:e.removeAllUploading},{tabName:"downloaded",label:"clear_history",color:"general",disable:0===e.currentList.length,handleClick:e.clearAll}],(function(t,o){return n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:e.currentTab===t.tabName,expression:"currentTab === buttonData.tabName"}],key:o,style:"negative"===t.color?{marginLeft:"16px"}:{},attrs:{color:t.color,icon:t.icon,label:e.$t(t.label),value:t.disable,dense:e.screen$xs},on:{click:function(n){return e.ensureLogin(t.handleClick)}}})})),n("q-space"),n("div",{staticClass:"right-buttons"},[n("q-space"),n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:!(e.showSearchText||e.searchText.length),expression:"!(showSearchText || searchText.length)"}],attrs:{"button-type":"icon",icon:"search"},on:{click:function(t){return e.toggleSearchText(!0)}}}),n("q-input",{directives:[{name:"show",rawName:"v-show",value:e.showSearchText||e.searchText.length,expression:"showSearchText || searchText.length"}],ref:"searchInput",attrs:{outlined:"",dense:"",type:"text",debounce:"300"},on:{blur:function(t){return e.toggleSearchText(!1)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer text-red",attrs:{name:"close"},on:{click:e.clearSearch}})]},proxy:!0}]),model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}}),n("alphabiz-button",{attrs:{"button-type":"icon",icon:"list"===e.listMode?"view_list":"view_agenda"},on:{click:e.changeListMode}},[n("q-tooltip",[e._v(e._s(e.$t("toggle_list_mode")))])],1),n("SortMenu",{on:{changeSortSequence:e.changeSortSequence,changeSortOption:e.changeSortOption}})],1)],2),"downloading"===e.currentTab?n("q-toolbar",{staticClass:"sticky-bar-toolbar",staticStyle:{"min-height":"unset"}},[n("q-linear-progress",{staticStyle:{"flex-shrink":"1","max-width":"calc(100% - 110px)"},attrs:{value:e.downloadingProgress.value,rounded:"",size:"20px"}},[n("div",{staticClass:"absolute-full flex flex-center text-general"},[n("span",{staticStyle:{"font-size":"0.9rem"}},[e._v(e._s(e.downloadingProgress.label))])])]),n("div",{staticClass:"download-speed"},[e._v(e._s(e.totalDownloadSpeed))])],1):e._e(),"uploading"===e.currentTab?n("q-toolbar",{staticClass:"sticky-bar-toolbar",staticStyle:{"min-height":"unset"}},[n("div",[e._v(e._s(e.totalIncomeInfo))]),n("q-space"),n("div",[e._v(e._s(e.$t("total_upload_speed"))+": "+e._s(e.totalUploadSpeed))])],1):e._e()],1),n("q-tab-panels",{staticClass:"torrent-list bg-transparent",class:{"torrent-list-large":"downloaded"!==e.currentTab},model:{value:e.displayTab,callback:function(t){e.displayTab=t},expression:"displayTab"}},e._l(e.displayList,(function(t){return n("q-tab-panel",{key:"panel_"+t.label,staticClass:"q-pa-none",attrs:{name:t.key}},[n(e.listComponent,{key:"task-list-"+t.label,tag:"component",attrs:{list:t,tab:e.currentTab,incomes:e.incomes,noDataMessage:e.noDataMessage},on:{pauseTorrent:e.pauseTorrent,resumeTorrent:e.resumeTorrent,deleteTorrent:e.deleteTorrent,play:e.play,showOriginTorrent:e.showOriginTorrent,showDirectory:e.showDirectory,setThrottleGroup:e.setThrottleGroup,shareFile:e.shareFile,saveTorrentFile:e.saveTorrentFile,showPaymentPannel:e.showPaymentPannel,showDetail:e.showDetail,showAbPanel:e.showAbPanel,showPostInfo:e.showPostInfo,showQuickStart:e.showQuickStart}})],1)})),1),n("q-page-sticky",{staticClass:"action-container",attrs:{position:"bottom-right",offset:[16,16]}},e._l({download:{tabName:"downloading",icon:"add",handleClick:function(){return e.showMagnetDialog("download")}},upload:{tabName:"uploading",icon:"cloud_upload",handleClick:function(){return e.showMagnetDialog("upload")}},upload_all:{tabName:"downloaded",icon:"cloud_upload",handleClick:e.uploadAll}},(function(t,o){return n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:e.currentTab===t.tabName,expression:"currentTab === buttonData.tabName"}],key:o,staticClass:"q-ma-xs action-button",attrs:{color:"primary",icon:t.icon,label:e.$t(o),"button-type":"fab"},on:{click:function(n){return e.ensureLogin(t.handleClick)}}})})),1)],1),n("q-dialog",{staticClass:"channel-post",attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showChannelPost,callback:function(t){e.showChannelPost=t},expression:"showChannelPost"}},[e.channelPost?n("PostCard",{attrs:{post:e.channelPost,followable:e.channelFollowable,hideButtons:""},on:{"to-channel":e.toChannelPage}}):e._e()],1),n("TorrentPayment",e._b({attrs:{show:e.showPayment,dp$source:e.dp$source,autoRenew:e.autoRenew},on:{change:function(t){return e.showPayment=t},createPayment:e.createPayment,setAutoRenew:e.setAutoRenew}},"TorrentPayment",e.paymentData,!1)),n("TableListDetail",{attrs:{show:e.showTorrentDetail,torrent:e.torrentDetail},on:{close:e.hideDetail,showDirectory:e.showDirectory,showPaymentPannel:e.showPaymentPannel,play:e.play,shareFile:e.shareFile}}),n("AlphabizPanel",{attrs:{dp$source:e.dp$source,show:e.showAlphabizPanel,torrent:e.alphabizTorrent,paymentSize:e.paymentSize},on:{close:e.hideAbPanel,createPayment:e.createPayment,setAutoRenew:e.setAutoRenew}}),n("QuickStart",{attrs:{show:e.showQuickStartDialog,preset:e.quickStartTask},on:{input:e.hideQuickStartDialog}})],1)},qo=[],Eo=n("61af"),Ao=n.n(Eo),Do=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-virtual-scroll",{key:"torrent-list-"+e.list.label,ref:"listIns",class:[e.screen$xs?"q-pt-sm":"q-pt-md",e.isPortrait?"portrait":"landscape"],style:"max-height:"+e.viewHeight,attrs:{items:e.list.list,"virtual-scroll-item-size":178},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("q-item",{key:e.list.label+"-"+o.infoHash,staticClass:"fit",class:[e.screen$xs?"q-px-sm":"q-px-md"],attrs:{dense:""}},[n("card-item",{attrs:{torrent:o,highlight:o.infoHash&&o.infoHash===e.highlightItem.infoHash},on:{pauseTorrent:e.emitEvent["pauseTorrent"],resumeTorrent:e.emitEvent["resumeTorrent"],deleteTorrent:e.emitEvent["deleteTorrent"],play:e.emitEvent["play"],showOriginTorrent:e.emitEvent["showOriginTorrent"],showDirectory:e.emitEvent["showDirectory"],setThrottleGroup:e.emitEvent["setThrottleGroup"],saveTorrentFile:e.emitEvent["saveTorrentFile"],showPaymentPannel:e.emitEvent["showPaymentPannel"],showDetail:e.emitEvent["showDetail"],showAbPanel:e.emitEvent["showAbPanel"],showPostInfo:e.emitEvent["showPostInfo"],showQuickStart:e.emitEvent["showQuickStart"],saveFile:e.emitEvent["shareFile"]}})],1)]}},{key:"after",fn:function(){return[e.list.list.length?e._e():n("div",{staticClass:"full-width text-center text-subtitle1"},[n("q-icon",{attrs:{name:"help_outline"}}),e._v("\n "+e._s(e.noDataMessage)+"\n ")],1),n("div",{directives:[{name:"show",rawName:"v-show",value:e.list.list.length,expression:"list.list.length"}],staticClass:"q-py-xl"})]},proxy:!0}])})},No=[],Lo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"100%"}},[n("q-card",{staticClass:"torrent-item",class:[e.screen$xs?"q-mb-sm":"q-mb-md"],attrs:{flat:"",bordered:""}},[n("q-card-section",{class:{highlight:e.highlight}},[n("div",{staticClass:"row justify-between items-center"},[n("div",{staticClass:"torrent-info title q-mb-xs"},[n("p",{staticClass:"torrent-name"},[e.isReady?e._e():n("q-circular-progress",{directives:[{name:"show",rawName:"v-show",value:!e.torrent.paused&&!e.torrent.pending,expression:"!torrent.paused && !torrent.pending"}],staticClass:"torrent-loading",attrs:{indeterminate:"",size:"24px",color:"primary"}}),n("span",[e._v(e._s(e.displayName))]),e.torrent.isAutoUpload?n("q-icon",{staticClass:"q-ml-md",attrs:{name:"drive_folder_upload"}},[n("q-tooltip",[e._v(e._s(e.$t("auto_uploading")))])],1):e._e()],1)]),n("alphabiz-button",{staticClass:"absolute-top-right q-mt-sm q-mr-md",attrs:{size:"md","button-type":"icon",icon:"more_horiz"},on:{click:e.showDetail}},[n("q-tooltip",[e._v(e._s(e.$t("more")))])],1)],1),n("div",{staticClass:"torrent-info"},[n("div",{staticClass:"operations"},[n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:!e.torrent.isAutoUpload&&!(e.torrent.paused&&e.torrent.missFile),expression:"!torrent.isAutoUpload && !(torrent.paused && torrent.missFile)"}],attrs:{color:"general",value:e.locked,icon:e.actionIcon,label:e.torrentAction,disabled:e.isProcessingUpload},on:{click:e.switchStateTorrent}}),e.isReady&&e.playable?n("alphabiz-button",{attrs:{color:"general",icon:"smart_display",label:e.torrent.done||e.torrent.isSeeding?e.$t("play"):e.$t("play_while_downloading")}},[n("q-menu",{attrs:{"max-height":"200px"}},[n("q-list",{staticStyle:{"min-width":"100px"}},e._l(e.playableFiles,(function(t,o){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:o,staticClass:"playable-items",attrs:{clickable:!t.missing,disable:t.missing},on:{click:function(n){return e.play(t.path,e.torrent.infoHash)}}},[n("q-linear-progress",{directives:[{name:"show",rawName:"v-show",value:1!==t.progress||t.isSeeding,expression:"item.progress !== 1 || item.isSeeding"}],staticClass:"progress-background",attrs:{stripe:"",value:t.progress}}),n("q-item-section",[n("p",{staticClass:"q-ma-none"},[n("q-icon",{staticClass:"q-mr-xs",attrs:{name:"play_arrow"}}),e._v("\n "+e._s(t.name)+"\n "),t.missing?n("q-icon",{attrs:{name:"error",color:"primary"}}):1===t.progress?n("q-icon",{attrs:{name:"done",color:"primary"}}):e._e(),t.missing?n("q-tooltip",[e._v(e._s(e.$t("file_not_found")))]):e._e(),1!==t.progress||e.isElectron?e._e():n("q-btn",{staticClass:"save-to-local-btn",attrs:{flat:"",dense:"",color:"primary",size:"sm",icon:e.isCapacitor?"ios_share":"save"},on:{click:function(n){return n.stopPropagation(),n.preventDefault(),e.saveFile(t)}}},[n("q-tooltip",[e._v(e._s(e.$t("save_to_local")))])],1)],1)])],1)})),1)],1)],1):n("alphabiz-button",{attrs:{color:"general",icon:"file_open",label:e.$t("open_file")},on:{click:e.openFile}}),e.isElectron||e.isCapacitor?n("alphabiz-button",{attrs:{color:"general",icon:e.isElectron?"folder":"ios_share",label:e.isElectron?e.$t("open_directory"):e.$t("share")},on:{click:e.showDirectory}}):e._e(),e.torrent.fromPost?n("alphabiz-button",{attrs:{icon:"video_library",label:e.$t("library")},on:{click:e.showPostInfo}}):e._e(),1!==e.torrent.progress&&!e.torrent.upload||e.torrent.paused?e._e():n("alphabiz-button",{attrs:{icon:"present_to_all",label:e.$t("share_to_library"),disabled:e.isProcessingUpload},on:{click:e.showQuickStart}}),e.isElectron||e.isCapacitor||!e.torrent.done?e._e():n("alphabiz-button",{attrs:{label:e.$t("save_as_zip"),icon:"folder_zip"},on:{click:e.saveZip}}),n("alphabiz-button",{attrs:{color:"negative",icon:"close",label:e.$t("delete"),disabled:e.isProcessingUpload},on:{click:e.deleteTorrent}}),n("q-space"),e.showAbButton?n("alphabiz-button",{attrs:{color:"accent",icon:e.isPayed?"flash_auto":"flash_on"},on:{click:e.openAbPanel}},[n("q-tooltip",[e._v(e._s(e.isPayed?e.$t("alphabiz_accelerating"):e.$t("ab_peer_available")))])],1):e._e()],1),e.torrent.upload||e.torrent.isSeeding?e._e():n("q-linear-progress",{staticClass:"q-mt-md",attrs:{value:e.torrent.done?1:e.torrent.progress,size:"18px",rounded:""}},[n("div",{staticClass:"progress-text flex flex-center absolute-full"},[e._v(e._s(e.progress||"0%"))])]),n("p",{staticClass:"text q-mb-xs bottom-status"},[e.statusText?n("span",{staticClass:"hint status-text"},[n("small",[e._v(e._s(e.statusText))]),n("br")]):e._e(),n("span",{staticStyle:{"margin-right":"10px"}},[e._v(e._s(this.$t("status"))+": "+e._s(e.torrentStatus))]),n("span",[e.torrent.paused||e.torrent.done||e.torrent.pending||e.torrent.isSeeding?e._e():n("span",{staticClass:"q-mr-sm"},[e._v("\n "+e._s(e.downloadSpeed)+"\n ")]),e.torrent.upload?e._e():n("span",{staticStyle:{"margin-right":"10px"}},[e.torrent.done?e._e():n("span",[e._v("↓ "+e._s(e.downloaded)+" /")]),e._v("\n "+e._s(e.total))])]),n("span",[e.torrent.paused||e.torrent.pending?e._e():n("span",{staticClass:"q-mr-sm"},[e._v("\n "+e._s(e.uploadSpeed)+"\n ")]),n("span",{staticStyle:{"margin-right":"10px"}},[e._v("↑ "+e._s(e.uploaded))])])]),n("p",{staticClass:"text timers q-mt-xs bottom-status"},[e.torrent.timeRemaining&&e.torrent.download?n("span",{staticClass:"remaining q-mr-md"},[e._v(e._s(e.$t("remaining"))+": "+e._s(e.remaining))]):e._e(),e.createdTime?n("span",[e._v(e._s(e.$t("created_time")+": "+e.createdTime))]):e._e(),e.completedTime?n("span",[e._v(e._s(e.$t("completed_time")+": "+e.completedTime))]):e._e(),e.usedTime?n("span",[e._v(e._s(e.$t("used_time")+": "+e.usedTime))]):e._e()])],1)])],1)],1)},jo=[],Ro=n("4fd2"),Uo=n("908d"),Fo={name:"CardItem",inject:["io"],props:{torrent:{type:Object,required:!0},statusText:String,highlight:Boolean},data(){return{levelOptions:[{label:" Low ",value:"low"},{label:" Middle ",value:"mid"},{label:" High ",value:"high"}],locked:!1,loading:!1,isElectron:Object(Z["isElectron"])(),isCapacitor:Object(fe["a"])()}},computed:{isDevMode(){return d["a"].getters.isDevMode},isProcessingUpload(){return!(!this.torrent.isSeeding&&!this.torrent.done||this.torrent.length)},torrentAction(){return this.torrent.paused?this.torrent.done||1===this.torrent.progress||this.torrent.isSeeding?this.$t("seed"):this.$t("resume"):this.torrent.isSeeding?this.$t("stop_torrent"):this.$t("pause")},actionIcon(){return this.torrent.paused?this.torrent.done||this.torrent.isSeeding?"cloud_upload":"play_arrow":this.torrent.isSeeding?"stop":"pause"},isReady(){return this.torrent&&this.torrent.name&&this.torrent.length},downloadSpeed(){return this.byteToLargerSize(this.torrent.downloadSpeed,{fix:1})+"/s"},downloaded(){return this.byteToLargerSize(this.torrent.downloaded)},uploadSpeed(){return this.byteToLargerSize(this.torrent.uploadSpeed,{fix:1})+"/s"},uploaded(){return this.byteToLargerSize(this.torrent.uploaded)},total(){return this.byteToLargerSize(this.torrent.length)},remaining(){return!this.torrent.timeRemaining||this.torrent.paused?"-":this.msToTime(this.torrent.timeRemaining)},createdTime(){return this.torrent.createdTime?new Date(this.torrent.createdTime).toLocaleString(this.$i18n.locale,{hour12:!1}):""},completedTime(){return this.torrent.completedTime&&this.torrent.done?new Date(this.torrent.completedTime).toLocaleString(this.$i18n.locale,{hour12:!1}):""},usedTime(){return this.torrent.usedTime?this.msToTime(this.torrent.usedTime):""},torrentStatus(){if(this.torrent.missFile)return this.$t("miss_file");if(this.torrent.isSeeding||this.torrent.done){if(!this.torrent.length){if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);return this.$t("loading")+` (${o})`}return this.$t("loading")}return this.torrent.paused?this.$t("downloaded"):this.$t("uploading")}if(this.paused)return this.$t("paused");if(this.torrent.paused)return this.torrent.done||this.torrent.isSeeding?this.$t("completed"):this.$t("paused");if(this.torrent.isSeeding)return this.$t("seeding");if(this.torrent.upload)return this.$t("uploading");if(this.torrent.pending)return this.$t("pending");if(this.torrent.waiting)return this.$t("waiting_for_verify");if(!this.torrent.ready){if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);if(!isNaN(n))return this.$t("loading")+` (${o})`}return this.$t("loading")}return this.torrent.download?this.torrent.done?this.$t("downloaded"):this.$t("downloading"):this.$t("unknown_status")},displayName(){let e=this.torrent.postTitle||this.torrent.name||this.torrent.origin||this.torrent.token;if(!e||"string"!==typeof e){if(!(e&&e instanceof File))return this.$t("loading");e=e.name}if(e.includes("&dn")){const t=(e+"&").match(/&dn=(.*?)&/);if(t&&t[1])return t[1]}const t=e.match(/btih:([^&]*)/);if(t&&t[1])return t[1];const n=Uo["b"].is.win?"\\":"/";if(e.includes(n)){const t=e.replace(new RegExp(n+"$"),"").match(new RegExp(`([^${n}]*$)`));if(t&&t[1])return t[1]}return e},progress(){return Object(M["g"])(this.torrent.progress)},abPeers(){return this.torrent.connections?this.torrent.connections.filter((e=>!(!this.torrent.hasMetadata&&!e.hasMeta)&&(!!e.hasResource&&(e.isAbPeer&&e.subId&&e.subId!==d["a"].getters.accountUserInfo.sub)))):[]},showAbButton(){return!this.torrent.done&&!this.torrent.isSeeding&&(this.isDevMode&&this.abPeers.length)},payedConnections(){return this.abPeers.filter((e=>"high"===e.remoteGroup))},isPayed(){return this.payedConnections.length},showAbPeerHint(){return this.abPeers.length},connectedPeers(){const e={};for(const t of this.abPeers){const n=t.subId||t.id;e[n]?e[n].isAbPeer|=t.isAbPeer:(e[n]=t,e[n].addresses=[]),e[n].addresses.includes(t.address)||e[n].addresses.push(t.address)}return Object.values(e).sort(((e,t)=>e.id.localeCompare?e.id.localeCompare(t.id):0))},playableFiles(){return this.torrent.files.filter((e=>Object(Ro["a"])(e.name)))},playable(){return this.playableFiles.length}},methods:{byteToLargerSize(e,t={}){return Object(M["a"])(e,{byte:!1,gb:!0,...t})},msToTime(e){const t=Math.floor(e/1e3),n=t%60,o=(t-n)/60;if(isNaN(n))return"-";if(o>60){const e=o%60,t=(o-e)/60;return t>24?"> 24h":`${t}:${("0"+e).slice(-2)}:${("0"+n).slice(-2)}`}return`${("0"+o).slice(-2)}:${("0"+n).slice(-2)}`},deleteTorrent(){this.$emit("deleteTorrent",this.torrent)},switchStateTorrent(){if(!this.locked)if(this.locked=!0,this.torrent.isSeeding?setTimeout((()=>{this.locked=!1}),2e3):setTimeout((()=>{this.locked=!1}),1e3),this.torrent.paused)this.$emit("resumeTorrent",this.torrent);else{if(!this.torrent.infoHash)return this.$q.dialog({message:this.$t("this_task_not_ready"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{this.io.emit("delete_torrent",this.torrent.token,!1)}));this.$emit("pauseTorrent",this.torrent.infoHash)}},openAbPanel(){console.log("open"),this.$emit("showAbPanel",this.torrent)},showDetail(){this.$emit("showDetail",this.torrent)},setThrottleGroup(e,t,n){this.$emit("setThrottleGroup",{infoHash:this.torrent.infoHash,id:e,subId:t,level:n})},saveTorrentFile(){this.$emit("saveTorrentFile",this.torrent.infoHash)},play(e,t){this.$emit("play",e,t)},copyMagnetURI(){let e=this.torrent.alphabizURI||this.torrent.magnetURI;e||(e="magnet:?xt=urn:btih:"+this.torrent.infoHash,this.torrent.name&&(e+="&dn="+encodeURIComponent(this.torrent.name))),Object(lt["b"])(e),this.$q.notify(this.$t("text_copied"))},showPostInfo(){this.$emit("showPostInfo",this.torrent.fromPost)},showOriginTorrent(){this.$emit("showOriginTorrent",this.torrent)},openFile(){1===this.torrent.files.length?this.io.emit("open-external-file",this.torrent.files[0].path,this.torrent.infoHash):this.showDirectory()},showDirectory(){this.$emit("showDirectory",this.torrent)},showPaymentPannel(e){this.$emit("showPaymentPannel",{infoHash:this.torrent.infoHash,torrentName:this.torrent.name,peerId:e.id,address:e.address,remoteUser:e.user,remoteSubId:e.subId})},showQuickStart(){this.$emit("showQuickStart",this.torrent)},saveFile(e){if(this.isCapacitor)return this.$emit("saveFile",e.path);this.$emit("saveFile",e)},saveZip(){this.$emit("saveZip")}},watch:{torrentStatus(e,t){t!==e&&this.$emit("sortByStatus")}},mounted(){this.loading=this.torrent.loading}},Mo=Fo,Bo=(n("1357"),n("64e7")),Qo=n("834d"),Wo=Object(v["a"])(Mo,Lo,jo,!1,null,"3671d32d",null),zo=Wo.exports;C()(Wo,"components",{QCard:E["a"],QCardSection:A["a"],QCircularProgress:Bo["a"],QIcon:G["a"],QTooltip:H["a"],QMenu:de["a"],QList:We["a"],QItem:ze["a"],QLinearProgress:It["a"],QItemSection:He["a"],QBtn:O["a"],QSpace:W["a"],QColor:cn["a"],QBtnToggle:Qo["a"]}),C()(Wo,"directives",{ClosePopup:K["a"]});var Ho={name:"CardList",props:{list:Object,noDataMessage:String},data(){const e=this;return{isElectron:Object(Z["isElectron"])(),safeArea:"env(safe-area-inset-bottom) - env(safe-area-inset-top)",emitEvent:new Proxy({},{get(t,n){return(...t)=>{e.$emit(n,...t)}}}),highlightItem:{}}},computed:{viewHeight(){const e=(this.list.key.startsWith("downloaded")?150:180)+(this.isPortrait||this.isElectron?0:-30);return`calc(100vh - ${this.safeArea} - ${e}px);`}},components:{CardItem:zo},methods:{findTaskIndex(e,t){for(const n in this.list.list){const o=this.list.list[n];if(t&&o.fromPost===t)return console.log("found item by soul",t),parseInt(n);if(Object(we["a"])(o.alphabizURI)===e)return console.log("found",e,o.alphabizURI,n),parseInt(n)}return-1}},activated(){if(this.highlightItem={infoHash:-1},this.$route.query&&this.$route.query.abKey){const e=Date.now(),t=setInterval((()=>{if(!this.$route.path.startsWith("/downloader"))return clearInterval(t),console.log("User exit before loaded");if(this.$refs.listIns){var n;if(Date.now()-e<1e3)return;clearInterval(t);const o=null===(n=this.$route.query.abKey)||void 0===n?void 0:n.replace(/\s/g,"+"),a=this.findTaskIndex(o,this.$route.query.soul);if(-1===a)return console.log("Cannot find abKey",o);const s=this.list.list[a];console.log("scroll to",a,s),this.highlightItem=s,this.$refs.listIns.scrollTo(a,"center"),clearInterval(t),setTimeout((()=>{this.highlightItem===s&&(this.highlightItem={infoHash:-1})}),2500)}}),200)}}},Vo=Ho,Go=(n("536e"),Object(v["a"])(Vo,Do,No,!1,null,"0dd405a4",null)),Ko=Go.exports;C()(Go,"components",{QVirtualScroll:Ve["a"],QItem:ze["a"],QIcon:G["a"]});var Yo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-table",{ref:"tableIns",staticClass:"list bg-page text-page",class:{xs:e.isPortrait,electron:e.isElectron},attrs:{data:e.list.list,columns:e.columns,"row-key":"name",dense:"",flat:"","virtual-scroll":"","hide-bottom":!!e.list.list.length,"rows-per-page-options":[0],"visible-columns":e.visibleColumns,"no-data-label":e.noDataMessage},nativeOn:{mousemove:function(t){return e.onDrag(t)},touchmove:function(t){return e.onDrag(t)},mouseleave:function(t){return e.onDragEnd.apply(null,arguments)},mouseup:function(t){return e.onDragEnd.apply(null,arguments)},touchend:function(t){return e.onDragEnd.apply(null,arguments)},touchcancel:function(t){return e.onDragEnd.apply(null,arguments)}},scopedSlots:e._u([{key:"header",fn:function(t){return[n("q-tr",{attrs:{props:t}},e._l(t.cols,(function(o){return n("q-th",{key:o.name,staticClass:"thead",attrs:{props:t}},[n("span",{staticClass:"text-ellipsis"},[e._v(e._s(o.label))]),"options"!==o.name?n("span",{staticClass:"thead-draggable",on:{mousedown:function(t){return e.onDragStart(o,t)},mouseup:e.onDragEnd,touchstart:function(t){return e.onDragStart(o,t)},touchmove:function(t){return e.onDrag(t)},touchend:e.onDragEnd,touchcancel:e.onDragEnd}}):e._e()])})),1)]}},{key:"body",fn:function(t){return[n("ListItem",{key:t.row.infoHash,attrs:{torrent:t.row,visibleColumns:e.visibleColumns,showCols:e.showCols,incomes:e.taskIncomes[t.row.infoHash],colWidth:e.colWidthText,highlight:t.row.infoHash&&t.row.infoHash===e.highlightItem.infoHash},on:{pauseTorrent:e.emitEvent["pauseTorrent"],resumeTorrent:e.emitEvent["resumeTorrent"],deleteTorrent:e.emitEvent["deleteTorrent"],play:e.emitEvent["play"],showOriginTorrent:e.emitEvent["showOriginTorrent"],showDirectory:e.emitEvent["showDirectory"],setThrottleGroup:e.emitEvent["setThrottleGroup"],saveTorrentFile:e.emitEvent["saveTorrentFile"],showPaymentPannel:e.emitEvent["showPaymentPannel"],showDetail:e.emitEvent["showDetail"],showAbPanel:e.emitEvent["showAbPanel"],showPostInfo:e.emitEvent["showPostInfo"],showQuickStart:e.emitEvent["showQuickStart"]}})]}},{key:"bottom-row",fn:function(){return[n("div",{directives:[{name:"show",rawName:"v-show",value:e.list.list.length,expression:"list.list.length"}],staticClass:"q-py-xl"})]},proxy:!0},{key:"no-data",fn:function(){return[n("div",{staticClass:"full-width text-center text-subtitle1"},[n("q-icon",{attrs:{name:"help_outline"}}),e._v("\n "+e._s(e.noDataMessage)+"\n ")],1)]},proxy:!0}])})},Jo=[],Xo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-tr",{key:e.torrent.infoHash||e.torrent.origin,staticClass:"list-item-tr",class:{highlight:e.highlight}},[n("q-td",{key:"name",staticClass:"no-select task-name",style:e.colWidth.name,on:{dblclick:e.onDoubleClick}},[n("IconWithTooltip",e._b({staticClass:"q-mr-xs name-icon"},"IconWithTooltip",e.taskIcon,!1)),n("div",{staticClass:"name-info"},[n("span",{staticClass:"torrent-name",attrs:{title:e.displayName}},[e._v(e._s(e.displayName))]),n("br"),e._m(0),n("span",{staticClass:"text-grey"},[e._v(e._s(e.downloadStatus))])],1)],1),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["remaining"],expression:"showCols['remaining']"}],key:"remaining",style:e.colWidth.remaining},[e._v(e._s(e.remaining))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["completedTime"],expression:"showCols['completedTime']"}],key:"completedTime",style:e.colWidth.completedTime},[e._v(e._s(e.completedTime))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["progress"],expression:"showCols['progress']"}],key:"progress",style:e.colWidth.progress},[n("q-linear-progress",{attrs:{value:e.torrent.progress,size:"20px",rounded:""}},[n("div",{staticClass:"absolute-full flex flex-center text-general"},[n("span",{staticStyle:{"font-size":"0.9rem"}},[e._v(e._s(e.progress||"0%"))])])])],1),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["uploadSpeed"],expression:"showCols['uploadSpeed']"}],key:"uploadSpeed",style:e.colWidth.uploadSpeed},[e._v(e._s(e.uploadSpeed))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["downloadSpeed"],expression:"showCols['downloadSpeed']"}],key:"downloadSpeed",staticClass:"download-speed",style:e.colWidth.downloadSpeed},[n("span",{attrs:{title:e.downloadSpeed}},[e._v(e._s(e.downloadSpeed))]),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.showAbButton,expression:"showAbButton"}],staticClass:"text-primary float-right",attrs:{flat:"",dense:"",size:"sm"},on:{click:e.openAbPanel}},[n("IconWithTooltip",{attrs:{icon:e.isPayed?"flash_auto":"flash_on",tooltip:e.isPayed?e.$t("alphabiz_accelerating"):e.$t("ab_peer_available")}})],1)],1),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["incomeInfo"],expression:"showCols['incomeInfo']"}],key:"incomeInfo",staticClass:"text-right",style:e.colWidth.incomeInfo},[e._v(e._s(e.incomeInfo))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.visibleColumns.includes("options"),expression:"visibleColumns.includes('options')"}],key:"options",staticClass:"option-btns",style:e.colWidth.options,attrs:{"auto-width":""}},[n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.torrent.isAutoUpload&&!e.torrent.missFile,expression:"!torrent.isAutoUpload && !torrent.missFile"}],attrs:{flat:"",dense:"",size:"sm",disable:e.locked||e.isProcessingUpload},on:{click:e.toggleStatus}},[n("IconWithTooltip",{attrs:{icon:e.actionIcon,tooltip:e.taskAction,clickable:""}})],1),n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.onDoubleClick}},[n("IconWithTooltip",{attrs:{icon:e.playable?"smart_display":"file_open",tooltip:e.$t("open_file"),clickable:""}})],1),e._m(1),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.torrent.fromPost,expression:"torrent.fromPost"}],attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showPostInfo}},[n("IconWithTooltip",{attrs:{icon:"video_library",tooltip:e.$t("library"),clickable:""}})],1),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:(1===e.torrent.progress||e.torrent.upload)&&!e.torrent.paused,expression:"(torrent.progress === 1 || torrent.upload) && !torrent.paused"}],attrs:{flat:"",dense:"",size:"sm",disabled:e.isProcessingUpload},on:{click:e.showQuickStart}},[n("IconWithTooltip",{attrs:{icon:"present_to_all",tooltip:e.$t("share_to_library"),clickable:""}})],1),e._m(2),n("q-btn",{staticClass:"text-red",attrs:{flat:"",dense:"",size:"sm",disabled:e.isProcessingUpload},on:{click:e.deleteTorrent}},[n("IconWithTooltip",{attrs:{icon:"close",tooltip:e.$t("delete"),clickable:""}})],1)],1)],1)},Zo=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("IconWithTooltip",{directives:[{name:"show",rawName:"v-show",value:e.torrent.isAutoUpload,expression:"torrent.isAutoUpload"}],staticClass:"q-mr-xs text-primary",attrs:{tooltip:e.$t("auto_uploading"),icon:"cloud_upload"}})},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showDirectory}},[n("IconWithTooltip",{attrs:{icon:"folder",tooltip:e.$t("open_directory"),clickable:""}})],1)},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showDetail}},[n("IconWithTooltip",{attrs:{icon:"more_horiz",tooltip:e.$t("more"),clickable:""}})],1)}],ea=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-icon",{class:{"cursor-pointer":e.clickable},attrs:{name:e.icon,size:e.size},on:{click:e.emitClick}},[e.tooltip?n("q-tooltip",[e._v("\n "+e._s(e.tooltip)+"\n ")]):e._e()],1)},ta=[],na={name:"IconWithTooltip",props:{icon:{type:String,require:!0},tooltip:{type:String,default:""},clickable:{type:Boolean,default:!1},size:{type:String,default:""}},methods:{emitClick(){this.$emit("click")}}},oa=na,aa=Object(v["a"])(oa,ea,ta,!1,null,null,null),sa=aa.exports;C()(aa,"components",{QIcon:G["a"],QTooltip:H["a"]});var ia={name:"ListItem",props:{torrent:{type:Object,required:!0},visibleColumns:{type:Array,required:!0},showCols:{type:Object,required:!0},incomes:{type:Object,default:()=>({})},colWidth:{type:Object,default:()=>({})},highlight:Boolean},inject:["io"],components:{IconWithTooltip:sa},data(){return{locked:!1}},computed:{isDevMode(){return d["a"].getters.isDevMode},isProcessingUpload(){return!(!this.torrent.isSeeding&&!this.torrent.done||this.torrent.length)},displayName(){const e=this.torrent.postTitle||this.torrent.name||this.torrent.origin||this.torrent.token;if(!e)return"";if(e.includes("&dn")){const t=(e+"&").match(/&dn=(.*?)&/);if(t&&t[1])return t[1]}const t=e.match(/btih:([^&]*)/);if(t&&t[1])return t[1];const n=Uo["b"].is.win;if(e.includes(n)){const t=e.replace(new RegExp(n+"$"),"").match(new RegExp(`([^${n}]*$)`));if(t&&t[1])return t[1]}return e},isReady(){return this.torrent&&this.torrent.name&&this.torrent.ready},taskIcon(){const e=this.torrent,t=e.files?e.files:[],n=Object(M["c"])(t.map((e=>e.path||e)));return{icon:n.icon,tooltip:this.$t(n.tooltip)}},downloadStatus(){if(this.torrent.missFile)return this.$t("miss_file");if(this.torrent.isSeeding||this.torrent.done){if(!this.torrent.length){if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);if(!isNaN(n))return this.$t("loading")+` (${o})`}return this.$t("loading")}return Object(M["a"])(this.torrent.length)}return this.isReady||this.torrent.paused||this.torrent.length?this.torrent.done||this.torrent.downloaded===this.torrent.length?Object(M["a"])(this.torrent.length):`${Object(M["a"])(this.torrent.downloaded)}/${Object(M["a"])(this.torrent.length)}`:"-"},remaining(){return this.torrent.paused||this.torrent.pending?"-":Object(M["e"])(this.torrent.timeRemaining)},completedTime(){const e=(...e)=>this.$t(...e);return this.torrent.completedTime?Object(M["f"])(this.torrent.completedTime,e,null===this||void 0===this?void 0:this.$i18n.locale):Object(M["f"])(this.torrent.createdTime,e,null===this||void 0===this?void 0:this.$i18n.locale)},progress(){return Object(M["g"])(this.torrent.progress)},downloadSpeed(){if(this.torrent.paused)return this.$t("paused");if(this.torrent.pending)return this.$t("pending");if(!this.torrent.ready){if(!this.torrent.hasMetadata)return this.$t("loading");if(this.torrent.waiting)return this.$t("waiting_for_verify");if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);if(!isNaN(n))return this.$t("verifying")+` (${o})`}return this.$t("verifying")}return Object(M["a"])(this.torrent.downloadSpeed,{byte:!1,gb:!1,fix:1})+"/s"},incomeInfo(){return[Number(((this.incomes.today||0)/1e3).toFixed(3)),Number(((this.incomes.total||0)/1e3).toFixed(3))].join(" / ")},uploadSpeed(){return this.torrent.ready?Object(M["a"])(this.torrent.uploadSpeed,{byte:!1,gb:!1,fix:1})+"/s":"-/s"},taskAction(){return this.torrent.paused?this.torrent.done||this.torrent.isSeeding?this.$t("seed"):this.$t("resume"):this.torrent.isSeeding?this.$t("stop_torrent"):this.$t("pause")},actionIcon(){return this.torrent.paused?this.torrent.done||this.torrent.isSeeding?"cloud_upload":"play_arrow":this.torrent.isSeeding?"stop":"pause"},playableFiles(){var e;return(null===(e=this.torrent.files)||void 0===e?void 0:e.filter((e=>Object(Ro["a"])(e.name))))||[]},playable(){return this.playableFiles.length},abPeers(){return this.torrent.connections?this.torrent.connections.filter((e=>!(!this.torrent.hasMetadata&&!e.hasMeta)&&(!!e.hasResource&&(e.isAbPeer&&e.subId&&e.subId!==d["a"].getters.accountUserInfo.sub)))):[]},showAbButton(){return this.isDevMode&&this.abPeers.length},isPayed(){return this.abPeers.some((e=>"high"===e.remoteGroup))}},methods:{shouldShow(e){return this.visibleColumns.includes(e)},onDoubleClick(){this.playable?this.$emit("play",this.playableFiles[0].path,this.torrent.infoHash):this.torrent.files&&this.torrent.files.length?this.openFile():this.$q.notify(this.$t("no_available_file"))},toggleStatus(){if(!this.locked)if(this.locked=!0,this.torrent.isSeeding?setTimeout((()=>{this.locked=!1}),2e3):setTimeout((()=>{this.locked=!1}),1e3),this.torrent.paused)this.$emit("resumeTorrent",this.torrent);else{if(!this.torrent.infoHash)return this.$q.dialog({message:this.$t("this_task_not_ready"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{this.io.emit("delete_torrent",this.torrent.token,!1)}));this.$emit("pauseTorrent",this.torrent.infoHash||this.torrent.token)}},deleteTorrent(){this.$emit("deleteTorrent",this.torrent)},openFile(){1===this.torrent.files.length?this.io.emit("open-external-file",this.torrent.files[0].path,this.torrent.infoHash):this.showDirectory()},showDirectory(){this.$emit("showDirectory",this.torrent)},showDetail(){this.$emit("showDetail",this.torrent)},showPostInfo(){this.$emit("showPostInfo",this.torrent.fromPost)},openAbPanel(){this.$emit("showAbPanel",this.torrent)},showQuickStart(){this.$emit("showQuickStart",this.torrent)}}},ra=ia,la=(n("bd3b"),Object(v["a"])(ra,Xo,Zo,!1,null,null,null)),ca=la.exports;C()(la,"components",{QTr:yo["a"],QTd:vo["a"],QLinearProgress:It["a"],QBtn:O["a"],QColor:cn["a"]});var da=n("ed1a"),ua={name:"TableList",props:{list:{type:Object,required:!0},tab:{type:String,default:"downloading"},incomes:{type:Object,default:()=>({})},noDataMessage:{type:String,default:()=>""}},components:{ListItem:ca},data(){const e=this;let t={name:250,remaining:80,completedTime:80,progress:120,downloadSpeed:150,uploadSpeed:100,incomeInfo:120,options:165};return localStorage.getItem("table-col-width")||localStorage.setItem("table-col-width",JSON.stringify(t)),t=JSON.parse(localStorage.getItem("table-col-width")),{isElectron:Object(Z["isElectron"])(),emitEvent:new Proxy({},{get(t,n){return(...t)=>{e.$emit(n,...t)}}}),defaultColumns:{downloading:["name","remaining","progress","downloadSpeed","options"],uploading:["name","completedTime","uploadSpeed","incomeInfo","options"],downloaded:["name","completedTime","options"]},dragData:{start:!1,col:"",pageX:0,pageY:0},highlightItem:{},colWidth:t}},computed:{columns(){return[{name:"name",required:!0,label:this.$t("task_name"),align:"left",headerStyle:this.colWidthText.name+";padding-left: 48px; max-width: calc(100% - 48px);"},{name:"remaining",label:this.$t("remaining"),align:"left",headerStyle:this.colWidthText.remaining+"; max-width: calc(100% - 8px)"},{name:"completedTime",label:this.$t("completed_time"),align:"left",headerStyle:this.colWidthText.completedTime+"; max-width: calc(100% - 8px)"},{name:"progress",label:this.$t("progress"),align:"left",headerStyle:this.colWidthText.progress+"; max-width: calc(100% - 8px)"},{name:"downloadSpeed",label:this.$t("total_download_speed"),align:"left",headerStyle:this.colWidthText.downloadSpeed+"; max-width: calc(100% - 8px)"},{name:"uploadSpeed",label:this.$t("total_upload_speed"),align:"left",headerStyle:this.colWidthText.uploadSpeed+"; max-width: calc(100% - 8px)"},{name:"incomeInfo",label:this.$t("income_info"),align:"right",headerStyle:this.colWidthText.incomeInfo+"; max-width: calc(100% - 8px)"},{name:"options",label:this.$t("operations"),align:"left"}]},visibleColumns(){switch(this.tab){case"downloading":return this.defaultColumns.downloading;case"uploading":return 2!==this.$store.state.credits.isModuleInit?this.defaultColumns.uploading.filter((e=>"incomeInfo"!==e)):this.defaultColumns.uploading;case"downloaded":return this.defaultColumns.downloaded}return this.defaultColumns.downloading},showCols(){const e={};for(const t of this.visibleColumns)e[t]=!0;return e},colWidthText(){const e={};for(const t in this.colWidth){const n=this.colWidth[t];e[t]=`width: ${n}px; min-width: ${n}px; max-width: ${n}px;`}return e},tableList(){var e,t;return(null===(e=this.list)||void 0===e||null===(t=e.list)||void 0===t?void 0:t.map((e=>({name:e.name}))))||[]},taskIncomes(){const{todayTaskIncome:e,allTaskIncome:t}=this.incomes,n={};for(const o in t)n[o]||(n[o]={today:0,total:0}),n[o].total+=t[o],e[o]&&(n[o].today+=e[o]);return n}},methods:{onDragStart(e,t){this.dragData.pageX=t.pageX,this.dragData.pageY=t.pageY,this.dragData.start=!0,this.dragData.col=e.name,document.body.style.cursor="col-resize"},onDragEnd(){this.dragData.start&&(this.dragData.start=!1,document.body.style.cursor="",localStorage.setItem("table-col-width",JSON.stringify(this.colWidth)))},onDrag(e){if(!this.dragData.start)return;const t=this.dragData.pageX-e.pageX;this.dragData.pageX=e.pageX,this.colWidth[this.dragData.col]&&(this.colWidth[this.dragData.col]-=t,this.colWidth[this.dragData.col]<80&&(this.colWidth[this.dragData.col]=80))},onResize(){console.log("table resize"),this.$refs.tableIns.resetVirtualScroll()},findTaskIndex(e,t){for(const n in this.list.list){const o=this.list.list[n];if(t&&o.fromPost===t)return console.log("found item by soul",t),parseInt(n);if(Object(we["a"])(o.alphabizURI)===e)return console.log("found",e,o.alphabizURI,n),parseInt(n)}return-1}},created(){this.onDrag=Object(da["a"])(this.onDrag,1e3/60),this.onResize=Object(da["a"])(this.onResize)},beforeDestroy(){window.removeEventListener("resize",this.onResize)},mounted(){window.addEventListener("resize",this.onResize),console.log("table created",this.$route.query)},activated(){if(this.highlightItem={infoHash:-1},this.$route.query&&this.$route.query.abKey){const e=Date.now(),t=setInterval((()=>{if(!this.$route.path.startsWith("/downloader"))return clearInterval(t),console.log("User exit before loaded");if(this.$refs.tableIns){var n;if(Date.now()-e<1e3)return;const o=null===(n=this.$route.query.abKey)||void 0===n?void 0:n.replace(/\s/g,"+"),a=this.findTaskIndex(o,this.$route.query.soul);if(-1===a)return console.log("Cannot find abKey",o);const s=this.list.list[a];console.log("scroll to",a,s),this.highlightItem=s,this.$refs.tableIns.scrollTo(a,"center"),clearInterval(t),setTimeout((()=>{this.highlightItem===s&&(this.highlightItem={infoHash:-1})}),2500)}}),200)}}},ha=ua,pa=(n("cdb7"),n("c1f8")),ma=Object(v["a"])(ha,Yo,Jo,!1,null,null,null),_a=ma.exports;C()(ma,"components",{QTable:Tt["a"],QTr:yo["a"],QTh:pa["a"],QIcon:G["a"],QColor:cn["a"]});var fa=function(){var e=this,t=this,n=t.$createElement,o=t._self._c||n;return o("q-dialog",{attrs:{value:t.show},on:{input:function(t){return e.$emit("change",t)},"before-hide":function(){return e.disable=!1}}},[o("q-card",{staticClass:"info"},[o("q-card-section",[o("div",{staticClass:"text-h6"},[t._v(t._s(t.$t("create_payment")))]),o("div",{staticClass:"infohash"},[t._v(t._s(t.$t("pay_for_torrent",[t.torrentName])))]),o("small",{staticClass:"infohash text-secondary"},[t._v("infoHash: "+t._s(t.infoHash))]),o("div",{staticClass:"peer-info"},[t._v(t._s(t.$t("pay_target"))+":\n "),o("div",{staticClass:"q-ml-sm remote"},[t._v("SubId: "+t._s(t.remoteSubId))]),o("div",{staticClass:"peer-address q-ml-md"},[t._v("Address: "+t._s(t.address))]),o("div",{staticClass:"peer-id q-ml-md"},[t._v("PeerId: "+t._s(t.peerId))])]),o("div",{staticClass:"space q-my-md"}),o("div",{staticClass:"user-info"},[o("div",{staticClass:"sub-id"},[t._v(t._s(t.$t("your_subid"))+": "+t._s(t.subId))]),o("div",{staticClass:"credit-count"},[t._v(t._s(t.$t("your_credits"))+": "+t._s(t.credit))])]),o("div",{staticClass:"actions"},[o("q-btn",{attrs:{"no-caps":"",label:t.$t("pay_point_for_data",[2,"20MB"]),disable:t.disable,loading:t.disable},on:{click:function(e){return t.pay(2)}}}),o("q-btn",{attrs:{"no-caps":"",label:t.$t("pay_point_for_data",[10,"100MB"]),disable:t.disable,loading:t.disable},on:{click:function(e){return t.pay(10)}}}),o("br"),o("q-toggle",{attrs:{value:t.enableAutoRenew,label:t.$t("auto_renew"),"left-label":""},on:{input:t.setAutoRenew}})],1)])],1)],1)},ga=[],ba={name:"TorrentPayment",props:{dp$source:Object,infoHash:{type:String,default:""},torrentName:{type:String,default:""},peerId:{type:String,default:""},address:{type:String,default:""},remoteUser:{type:String,default:""},remoteSubId:{type:String,default:""},show:{type:Boolean,default:!1},autoRenew:{type:Object,default:()=>({})}},data(){return{disable:!1,sentTransactions:new Set,pendingTransactions:new Map}},computed:{credit(){return this.dp$source.dp$credit},userId(){return this.$store.state.account.username},subId(){return this.dp$source.dp$address},enableAutoRenew(){return this.autoRenew&&this.autoRenew[this.infoHash]||!1},income(){return this.dp$source.dp$incomeTxnList},expenses(){return this.dp$source.dp$expenseTxnList}},methods:{setAutoRenew(e){this.$emit("setAutoRenew",this.infoHash,e)},pay(e=1){if(!this.infoHash.length||!this.peerId.length||!this.remoteSubId.length)return this.$q.notify("Info missing");this.disable=!0,console.log("dp$ create payment from","TorrentPayment::pay"),this.$emit("createPayment",{infoHash:this.infoHash,peerId:this.peerId,remoteSubId:this.remoteSubId,payed:e,autoRenew:this.enableAutoRenew})}}},ya=ba,va=Object(v["a"])(ya,fa,ga,!1,null,null,null),wa=va.exports;C()(va,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QBtn:O["a"],QToggle:tn["a"]});var ka=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.torrent?n("q-dialog",{staticClass:"detail-dialog",attrs:{value:e.show,position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{input:e.closeDialog}},[n("q-card",{staticClass:"detail-dialog",class:e.isCapacitor?"capacitor":""},[n("q-card-section",{staticClass:"flex items-center no-wrap",class:e.screen$xs?"q-py-sm":"q-py-md"},[e.torrent.fromPost?n("q-icon",{staticClass:"q-mr-xs text-primary",attrs:{name:"video_library"}},[n("q-tooltip",[e._v("\n "+e._s(e.$t("library"))+"\n ")])],1):e._e(),n("div",{staticClass:"text-h6 ellipsis",attrs:{title:e.torrent.postTitle||e.torrent.name}},[e._v("\n "+e._s(e.torrent.postTitle||e.torrent.name)+"\n ")]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"},{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",flat:"",round:"","data-cy":"moreCard-closeBtn"}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-section",{class:e.screen$xs?"q-pt-md":"q-pt-none"},[n("q-input",{attrs:{readonly:"",label:e.$t("download")+" URL",outlined:"",dense:""},scopedSlots:e._u([{key:"append",fn:function(){return[n("IconWithTooltip",{attrs:{icon:"content_copy",tooltip:e.$t("copy_download_uri"),clickable:!0},on:{click:e.copyMagnetURI}}),n("IconWithTooltip",{attrs:{icon:"share",tooltip:e.$t("copy_share_uri"),clickable:!0},on:{click:e.copyShortURI}})]},proxy:!0}],null,!1,2307292726),model:{value:e.downloadURI,callback:function(t){e.downloadURI=t},expression:"downloadURI"}})],1),e.fileTree.length?n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"title"},[e.isElectron||e.isCapacitor?n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showDirectory}},[n("IconWithTooltip",{attrs:{icon:"folder_open",tooltip:e.$t("open_directory"),clickable:""}})],1):e._e(),e._v("\n "+e._s(e.$t("files"))+":\n ")],1),n("q-tree",{staticClass:"no-select file-tree",attrs:{nodes:e.fileTree,"node-key":"label",dense:"","no-connectors":""},scopedSlots:e._u([{key:"default-header",fn:function(t){return[n("q-item",{staticClass:"text full-width q-py-none q-px-xs no-margin vertical-middle",class:{"no-path":!t.node.path},attrs:{dense:"",clickable:!t.node.children},on:{dblclick:function(n){return e.onDblClick(t.node)}}},[!t.node.children&&t.node.path?n("IconWithTooltip",e._b({staticClass:"q-mt-xs q-mr-xs"},"IconWithTooltip",e.getFileIcon(t.node.path),!1)):t.node.path?n("IconWithTooltip",{staticClass:"q-mt-xs q-mr-xs",attrs:{icon:"folder"}}):e._e(),e.isCapacitor&&t.node.done&&t.node.fullPath?n("IconWithTooltip",{staticClass:"q-mt-xs q-mr-xs",attrs:{icon:"ios_share",label:e.$t("open_file")},on:{click:function(n){return e.shareFile(t.node)}}}):e._e(),t.node.progress?n("span",{staticClass:"file-progress"},[e._v(e._s(t.node.progress))]):e._e(),n("span",{staticClass:"file-name"},[e._v("‎"+e._s(t.node.label))])],1)]}}],null,!1,3668704012)})],1):e._e(),e.torrent.subtitleList&&e.torrent.subtitleList.length?n("q-card-section",{staticClass:"q-pt-none"},[n("q-expansion-item",{attrs:{"expand-separator":"",icon:"subtitles",label:e.$t("subtitle")+" ("+e.torrent.subtitleList.length+")",value:!0}},[n("q-markup-table",{staticClass:"subtitleList-table q-px-sm",attrs:{flat:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-center",staticStyle:{"padding-left":"20px"}},[e._v(e._s(e.$t("language")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("download_link")))]),n("th")])]),n("tbody",e._l(e.torrent.subtitleList,(function(t,o){return n("tr",{key:o},[n("td",{staticClass:"text-center",staticStyle:{"padding-left":"20px"},attrs:{title:t.lang}},[e._v(e._s(t.lang))]),n("td",{staticClass:"text-left url ellipsis",attrs:{title:e.getSubtitleUrl(t.url)}},[e._v(e._s(e.getSubtitleUrl(t.url)))]),n("td",{staticClass:"text-center"},[n("q-btn",{attrs:{icon:"content_copy",size:"xs",dense:"",flat:""},on:{click:function(n){return e.copySubtitleURL(t.url)}}},[n("q-tooltip",[e._v(e._s(e.$t("copy_download_uri")))])],1),e.isElectron?n("q-btn",{attrs:{icon:"file_download",size:"xs",dense:"",flat:""},on:{click:function(n){return e.downloadSubtitleURL(t.url)}}},[n("q-tooltip",[e._v(e._s(e.$t("download_link")))])],1):e._e()],1)])})),0)])],1)],1):e._e(),n("q-card-section",{staticClass:"q-pt-none peers"},[n("q-expansion-item",{attrs:{"expand-separator":"",icon:"people",label:"Peers ("+e.connectedPeers.length+")",value:!0}},[n("q-markup-table",{staticClass:"peer-table q-px-sm",attrs:{flat:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-center"}),n("th",{staticClass:"text-left ip",staticStyle:{"padding-left":"32px"}},[e._v("Peer")]),e.isDevMode?n("th",{staticClass:"text-left client"},[e._v(e._s(e.$t("client")))]):e._e(),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("total_download_speed")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("total_upload_speed")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("progress")))])])]),n("tbody",e._l(e.connectedPeers,(function(t){return n("PeerInfo",{key:t.id,attrs:{peer:t},on:{showPaymentPannel:e.showPaymentPannel}})})),1)])],1)],1),e.isDevMode?n("q-card-section",{staticClass:"q-pt-none"},[n("q-expansion-item",{directives:[{name:"show",rawName:"v-show",value:e.trackerList.length,expression:"trackerList.length"}],attrs:{icon:"dns",label:"Trackers ("+e.trackerList.length+")"}},[e.isElectron?n("div",{staticClass:"row justify-end q-pa-sm"},[n("q-input",{staticClass:"col",attrs:{dense:"",type:"text",label:"Tracker URL"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.newTrackerUrl,callback:function(t){e.newTrackerUrl=t},expression:"newTrackerUrl"}}),n("q-btn",{attrs:{dense:"",color:"primary q-mx-sm q-px-sm",icon:"add",label:e.$t("add")},on:{click:e.addTracker}})],1):e._e(),n("q-markup-table",{staticClass:"tracker-table q-px-sm",attrs:{flat:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left",staticStyle:{"padding-left":"40px"}},[e._v("URL")]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("status")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("last_update")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("seeders")))]),n("th",{staticClass:"text-center"},[e._v("Peers")]),e.isElectron?n("th"):e._e()])]),n("tbody",e._l(e.trackerList,(function(t){return n("tr",{key:t.url},[n("td",{staticClass:"text-left url",attrs:{title:t.displayUrl+(t.isIpv6?" (IPv6)":"")}},[t.isIpv6?n("IconWithTooltip",{staticStyle:{color:"#4697ec"},attrs:{icon:"looks_6",tooltip:"IPv6",size:"xs"}}):n("q-icon",{attrs:{name:"looks_4",color:"grey",size:"xs"}}),e._v("\n "+e._s(t.displayUrl)+"\n ")],1),n("td",{staticClass:"text-left status",attrs:{title:t.status}},[e._v(e._s(t.status))]),n("td",{staticClass:"text-right"},[e._v(e._s(t.time))]),n("td",{staticClass:"text-center"},[e._v(e._s(t.complete))]),n("td",{staticClass:"text-center"},[e._v(e._s(t.incomplete))]),e.isElectron?n("td",{staticClass:"text-center"},[n("q-btn",{attrs:{color:"red",icon:"close",size:"xs",dense:"",flat:""},on:{click:function(n){return e.removeTracker(t.url)}}})],1):e._e()])})),0)])],1)],1):e._e()],1)],1):e._e()},Ca=[],$a=(n("dc69"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("tr",[n("td",{staticClass:"status text-center"},[e.peer.isAbPeer?"high"===e.peer.level?n("q-icon",{attrs:{name:"done_all"}},[n("q-tooltip",[e._v(e._s(e.$t("ab_peer_verified")))])],1):n("q-icon",{attrs:{name:"done"}},[n("q-tooltip",[e._v(e._s(e.$t("ab_peer")))])],1):n("q-icon",{attrs:{name:"remove"}},[n("q-tooltip",[e._v(e._s(e.$t("common_peer")))])],1)],1),n("td",{staticClass:"addresses"},e._l(e.peer.addresses,(function(t){return n("div",{key:e.peer.id+"_"+t,staticClass:"self-center not-outline address"},[n("q-icon",{attrs:{name:e.peer.secure?"lock":"lock_open",size:"xs",color:e.peer.secure?"green":"grey"}},[n("q-tooltip",[e._v(e._s(e.peer.secure?e.$t("encrypted_connection"):e.$t("non_encrypted_connection")))])],1),n("span",{staticClass:"country-flag q-ml-sm",attrs:{title:e.country}},[e._v(e._s(e.countryFlag))]),e.isDevMode?n("span",{staticClass:"q-ml-xs"},[e._v(e._s(t))]):n("span",{staticClass:"q-ml-xs"},[e._v(e._s(t?t.substring(0,4)+"*":"-"))])],1)})),0),e.isDevMode?n("td",{staticClass:"client text-left",class:{"text-primary":"Alphabiz"===e.peerClient},attrs:{title:e.peerClient}},[e._v(e._s(e.peerClient))]):e._e(),n("td",{staticClass:"text-right",class:{"text-primary":e.peer.downloadSpeed}},[e._v(e._s(e.downloadSpeed)+" / s")]),n("td",{staticClass:"text-right",class:{"text-primary":e.peer.uploadSpeed}},[e._v(e._s(e.uploadSpeed)+" / s")]),n("td",{staticClass:"progress text-right"},[e._v(e._s(e.peerProgress))])])}),Sa=[],xa=n("c791"),Ta=xa["a"],Ia=(n("2e69"),Object(v["a"])(Ta,$a,Sa,!1,null,"4676c095",null)),Pa=Ia.exports;C()(Ia,"components",{QIcon:G["a"],QTooltip:H["a"]});var Oa={props:{show:{type:Boolean,default:!1},torrent:{type:Object,required:!0}},data(){const e=Object(ne["default"])()?n("b052").ipcRenderer:{};return{newTrackerUrl:"",isCapacitor:Object(fe["a"])(),isElectron:Object(ne["default"])(),ipcRenderer:e}},components:{IconWithTooltip:sa,PeerInfo:Pa},inject:["io"],computed:{isDevMode(){return d["a"].getters.isDevMode},fileCount(){if(!this.torrent)return 0;const e=this.torrent.files||this.torrent.file||[];return e&&e.length?e.length:0},fileTree(){if(!this.torrent)return[];const e=this.torrent.files&&this.torrent.files.map?this.torrent.files.map((e=>e.path)):this.torrent.file||[];if(!e||!e.length)return[];const t=this.fileCount>21?e.slice(e.length-20):e,n=Object(M["b"])(t,this.torrent.files);return n?(this.fileCount>21&&n.children&&n.children.push({label:this.$t("more_files_are_not_shown",[this.fileCount-20])}),[n]):[]},downloadURI(){return this.torrent.alphabizURI?this.torrent.alphabizURI:this.torrent.magnetURI},trackerList(){if(!this.torrent.trackerList)return[];const e=this.torrent.trackerList.map((e=>{const t=this.trackerStatus(e.message||e.status),n=e.info||{complete:"-",incomplete:"-"},o=new Date(e.timestamp),a=[o.getHours(),o.getMinutes(),o.getSeconds()].map((e=>("00"+e).slice(-2))).join(":");return{url:e.url,displayUrl:e.url.replace("@6",""),status:t,time:a,isIpv6:e.isIpv6,...n}})).reverse();return Object(ne["default"])()?e:e.filter((e=>{var t;return null===(t=e.url)||void 0===t?void 0:t.startsWith("ws")}))},connectedPeers(){if(!this.torrent||!this.torrent.connections)return[];const e={};for(const o of this.torrent.connections){const t=o.id;e[t]||(e[t]={...o},e[t].addresses=[],e[t].uploadSpeed=0,e[t].downloadSpeed=0,e[t].downloaded=0),e[t].addresses.includes(o.address)||e[t].addresses.push(o.address),e[t].uploadSpeed+=o.uploadSpeed,e[t].downloadSpeed+=o.downloadSpeed,e[t].downloaded+=o.downloaded,e[t].isAbPeer|=o.isAbPeer,e[t].isPayed|="high"===o.remoteGroup,e[t].secure|=o.secure}const t=[],n=Object.values(e).sort(((e,t)=>{var n;return null!==(n=e.id)&&void 0!==n&&n.localeCompare?e.id.localeCompare(t.id):0})).filter((e=>!!e.id&&(!t.includes(e.id)&&(t.push(e.id),!0))));return n}},methods:{getFileIcon(e){const t=Object(M["c"])([e]);return{icon:t.icon,tooltip:this.$t(t.tooltip)}},closeDialog(){this.$emit("close")},copyToClipboard(e){Object(lt["b"])(e).then((()=>{this.$q.notify(this.$t("uri_copied"))})).catch((()=>{this.$q.notify(this.$t("uri_copy_failed"))}))},copyMagnetURI(){this.copyToClipboard(this.downloadURI)},copyShortURI(){if(!this.torrent.alphabizURI)return;const e=this.torrent.alphabizURI.match(/[^:/]\/([^&/]+)&/);e&&e[1]&&this.copyToClipboard(Ne.a.shortProtocol+"://"+e[1])},copySubtitleURL(e){console.log("copySubtitleURL",this.torrent),this.copyToClipboard(Ee(e))},downloadSubtitleURL(e){this.ipcRenderer.send("to_browserurl",Ee(e))},getSubtitleUrl(e){return Ee(e)},showPaymentPannel(e){this.$emit("showPaymentPannel",Object.assign({infoHash:this.torrent.infoHash,name:this.torrent.name},e))},showDirectory(){this.$emit("showDirectory",this.torrent)},onDblClick(e){console.log(e),e.children||(Object(Ro["a"])(e.label)?this.$emit("play",e.path,this.torrent.infoHash):e.path&&this.io.emit("open-external-file",e.path))},shareFile(e){this.$emit("shareFile",e.fullPath)},trackerStatus(e){const t=e.toLowerCase();return"connecting"===t?this.$t("connecting"):"updated"===t?this.$t("connected"):t.includes("timed out")?this.$t("request_timed_out"):t.includes("connection failed")?this.$t("connection_failed"):this.$t("unknown_error",[e])},addTracker(){console.log("add",this.newTrackerUrl,this.torrent.infoHash);const e=this.newTrackerUrl.trim();if(this.torrent.trackerList.find((t=>t.url===e)))return this.$q.notify(this.$t("duplicate_tracker"));this.isElectron&&this.ipcRenderer.send("add-tracker",{infoHash:this.torrent.infoHash,url:e}),this.newTrackerUrl=""},removeTracker(e){console.log("remove",e,this.torrent.infoHash),this.isElectron&&this.ipcRenderer.send("remove-tracker",{infoHash:this.torrent.infoHash,url:e})}}},qa=Oa,Ea=(n("860f"),n("348e")),Aa=n("5bbd"),Da=Object(v["a"])(qa,ka,Ca,!1,null,"560c4343",null),Na=Da.exports;C()(Da,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QIcon:G["a"],QTooltip:H["a"],QSpace:W["a"],QBtn:O["a"],QSeparator:z["a"],QInput:D["a"],QTree:Ea["a"],QItem:ze["a"],QExpansionItem:Aa["a"],QMarkupTable:V["a"]}),C()(Da,"directives",{ClosePopup:K["a"]});var La=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.showPanel},on:{input:e.close}},[n("q-card",[n("q-card-section",{staticClass:"row items-center"},[n("q-expansion-item",{staticStyle:{width:"400px"},attrs:{"expand-separator":"","default-opened":"",icon:"people",label:"Peers ("+e.abPeers.length+")",caption:"Alphabiz peer"}},[n("div",{staticClass:"total col-12 q-px-md q-ml-sm"},[n("span",[e._v(e._s(e.$t("credit_cost"))+": "+e._s(e.torrentExpensesNum))])]),e._l(e.abPeers,(function(t){return n("q-field",{key:t.id,attrs:{label:t.subId||t.id,"stack-label":"",borderless:"",readonly:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("div",{staticClass:"q-px-sm"})]},proxy:!0},{key:"control",fn:function(){return[e._l(t.addresses,(function(t,o){return n("div",{key:o+"-"+t,staticClass:"self-center full-width not-outline"},[e._v(" - "+e._s(t)+"\n ")])})),n("div",{staticClass:"text full-width q-mt-xs"},[n("span",{staticClass:"peer-speed q-ml-xs q-mr-lg",class:{"text-primary":"0.00 KB"!==t.uploadSpeed}},[e._v("↑ "+e._s(t.uploadSpeed)+" / s")]),t.isPayed?n("q-icon",{staticClass:"text-primary q-mx-xs cursor-pointer",attrs:{name:"bolt"}},[n("q-tooltip",[e._v(" "+e._s(e.$t("accelerating")))])],1):e._e(),n("span",{staticClass:"peer-speed q-mr-md",class:{"text-primary":"0.00 KB"!==t.downloadSpeed}},[e._v("↓ "+e._s(t.downloadSpeed)+" / s")]),n("span",{directives:[{name:"show",rawName:"v-show",value:t.downloaded,expression:"peer.downloaded"}],staticClass:"peer-downloaded text-primary"},[e._v(e._s(t.downloadedData))])],1)]},proxy:!0}],null,!0)})}))],2)],1),n("q-card-section",{staticClass:"q-py-none"},[n("div",{staticClass:"total text-center"},[e._v("\n "+e._s(e.$t("pay_with_credit_payed",[e.totalCredits]))+"\n ")])]),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("cancel")}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("ok")}})],1)],1)],1)},ja=[],Ra={props:{dp$source:Object,show:{type:Boolean,required:!0},torrent:{type:Object,required:!0},paymentSize:{type:Number,default:1e7}},computed:{torrentExpensesNum(){let e=0;if(this.dp$source.dp$expenseTxnDict&&this.dp$source.dp$expenseHashMapper){const t=this.dp$source.dp$expenseHashMapper[this.torrent.infoHash];if(console.log("torrentExpensesNum:","infoHash",this.torrent.infoHash),t)for(const n of t)e+=this.dp$source.dp$expenseTxnDict[n].amount}return Number((e/1e3).toFixed(3))},showPanel(){return this.show},totalCredits(){const e=this.torrent.length,t=e-this.torrent.downloaded,n=Number((t/1e10).toFixed(3));return n},abPeers(){if(!this.torrent||!this.torrent.connections)return[];const e=this.torrent.connections.filter((e=>e.isAbPeer&&e.hasResource&&e.subId!==d["a"].getters.accountUserInfo.sub)),t={};for(const n of e){const e=n.subId;e&&(t[e]?(t[e].isAbPeer|=n.isAbPeer,t[e].addresses.push(n.address),t[e].uploadSpeed+=n.uploadSpeed,t[e].downloadSpeed+=n.downloadSpeed,t[e].downloaded+=n.downloaded):(t[e]={...n},t[e].addresses=[n.address]))}return Object.values(t).sort(((e,t)=>e.id.localeCompare?e.id.localeCompare(t.id):0)).map((e=>(e.uploadSpeed=Object(M["a"])(e.uploadSpeed,{byte:!1,gb:!1}),e.downloadSpeed=Object(M["a"])(e.downloadSpeed,{byte:!1,gb:!1}),e.downloadedData=Object(M["a"])(e.downloaded,{byte:!0,gb:!0}),e.isPayed="high"===e.remoteGroup,e)))},payedConnections(){return this.abPeers.filter((e=>e.isPayed))},downloadedFromPayed(){return Object(M["a"])(this.payedConnections.reduce(((e,t)=>e+t.downloaded||0),0),{byte:!0,gb:!0})},hasPayed(){return this.payedConnections.length}},methods:{confirmPayment(){if(!this.abPeers.length)return;let e=10;const t=Math.floor(10*this.torrent.downloadSpeed/this.paymentSize);t>e&&(e=t);const n=this.torrent.length-this.torrent.downloaded;n{console.log("pay for",t),t.isPayed?console.log("skip high level peer",t):(console.log("dp$ create payment from","AlphabizPanel::confirmPayment"),this.$emit("createPayment",{infoHash:this.torrent.infoHash,remoteSubId:t.subId,payed:e,autoRenew:!0},!0))})),this.close()},close(){this.$emit("close")}}},Ua=Ra,Fa=n("b121"),Ma=Object(v["a"])(Ua,La,ja,!1,null,null,null),Ba=Ma.exports;C()(Ma,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QExpansionItem:Aa["a"],QField:Fa["a"],QIcon:G["a"],QTooltip:H["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(Ma,"directives",{ClosePopup:K["a"]});var Qa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("alphabiz-button",{attrs:{"button-type":"icon",icon:"sort"}},[n("q-tooltip",[e._v(e._s(e.$t("sort")))]),n("q-menu",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"}},[n("q-list",{attrs:{padding:""}},[n("q-item",{staticStyle:{"min-width":"240px"}},[n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("sort")))])],1),n("q-item-section",{attrs:{side:""}},[n("q-badge",{staticClass:"cursor-pointer non-selectable",attrs:{color:"general","text-color":"general"},on:{click:e.changeSortSequence}},[n("span",{staticClass:"q-ml-sm"},[e._v(e._s(1===e.sortSequence?e.$t("ascending"):e.$t("descending")))]),n("q-icon",{attrs:{size:"1.5rem",name:1===e.sortSequence?"arrow_drop_up":"arrow_drop_down"}})],1)],1)],1),n("q-separator"),e._l(e.options,(function(t){return n("q-item",{directives:[{name:"ripple",rawName:"v-ripple"}],key:t.value,attrs:{clickable:"",dense:"",tag:"label"}},[n("q-item-section",{attrs:{avatar:""}},[n("q-radio",{attrs:{val:t.value,color:"positive"},model:{value:e.sortOption,callback:function(t){e.sortOption=t},expression:"sortOption"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(t.label))])],1)],1)}))],2)],1)],1)},Wa=[],za={name:"DownloaderSortMenu",inject:["io"],data(){return{sortOption:"createdTime",sortSequence:1}},computed:{options(){switch(this.$route.query.currentTab){case"downloading":return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"},{label:this.$t("size"),value:"length"},{label:this.$t("total_download_speed"),value:"downloadSpeed"},{label:this.$t("progress"),value:"progress"},{label:this.$t("remaining"),value:"timeRemaining"},{label:this.$t("created_time"),value:"createdTime"},{label:this.$t("used_time"),value:"usedTime"}];case"uploading":return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"},{label:this.$t("size"),value:"length"},{label:this.$t("total_upload_speed"),value:"uploadSpeed"},{label:this.$t("created_time"),value:"createdTime"},{label:this.$t("completed_time"),value:"completedTime"},{label:this.$t("income"),value:"income"}];case"downloaded":return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"},{label:this.$t("size"),value:"length"},{label:this.$t("created_time"),value:"createdTime"},{label:this.$t("completed_time"),value:"completedTime"},{label:this.$t("used_time"),value:"usedTime"}]}return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"}]}},methods:{saveSortOptions(){localStorage.setItem("sortOptions_"+this.$route.query.currentTab,JSON.stringify({sortOption:this.sortOption,sortSequence:this.sortSequence}))},changeSortSequence(){this.sortSequence=-1*this.sortSequence,this.$emit("changeSortSequence",this.sortSequence),this.io.emit("set_sort_sequence",this.sortSequence),this.saveSortOptions()}},mounted(){const e=localStorage.getItem("sortOptions_"+this.$route.query.currentTab);if(e){const{sortOption:t,sortSequence:n}=JSON.parse(e);t&&(this.sortOption=t),n&&(this.sortSequence=n)}else this.sortOption="createdTime",this.sortSequence=1,this.saveSortOptions()},watch:{sortOption(e){this.$emit("changeSortOption",e),this.io.emit("set_sort_option",this.sortOption),this.saveSortOptions()},"$route.query.currentTab"(e,t){if(e===t||!e)return;const n=localStorage.getItem("sortOptions_"+e);if(n){const{sortOption:e,sortSequence:t}=JSON.parse(n);e&&(this.sortOption=e),t&&(this.sortSequence=t)}else this.sortOption="createdTime",this.sortSequence=1}}},Ha=za,Va=n("719b"),Ga=Object(v["a"])(Ha,Qa,Wa,!1,null,"b08e87f8",null),Ka=Ga.exports;C()(Ga,"components",{QTooltip:H["a"],QMenu:de["a"],QList:We["a"],QItem:ze["a"],QItemSection:He["a"],QItemLabel:Fn["a"],QBadge:he["a"],QIcon:G["a"],QSeparator:z["a"],QRadio:Un["a"]}),C()(Ga,"directives",{Ripple:Va["a"]});var Ya=n("0885"),Ja=n("a368");const Xa=n("d310").isElectron();var Za={name:"Downloader",inject:["rootApp","io","taskQueue","dp$source"],components:{CardList:Ko,TableList:_a,TableListDetail:Na,IconWithTooltip:sa,AlphabizPanel:Ba,TorrentPayment:wa,SortMenu:Ka,PostCard:Ye,QuickStart:Bn},data(){return{isMobile:Uo["b"].is.mobile||Object(fe["a"])(),currentTab:"downloading",loading:!1,listMode:localStorage.getItem("task-list-mode")||"list",searchText:"",showSearchText:!1,autoRenew:JSON.parse(localStorage.getItem("task-autorenew")||"{}"),sortOption:"createdTime",sortSequence:1,statusText:{},info:{downloadSpeed:0,uploadSpeed:0,progress:0,taskNum:0},showPayment:!1,showTorrentDetail:!1,torrentDetailInfoHash:"",paymentData:{infoHash:"",torrentName:"",peerId:"",address:"",remoteUser:"",remoteSubId:""},paymentSize:1e7,showAlphabizPanel:!1,abTorrentInfoHash:"",lib:r["a"],showChannelPost:!1,channelPost:null,showQuickStartDialog:!1,quickStartTask:null}},computed:{torrentList(){return Pn["a"].taskList},listComponent(){return"card"===this.listMode?"CardList":"TableList"},displayTab:{get(){return this.currentTab+"Torrents"},set(e){const t=e.replace(/Torrents$/,"");this.$router.push({path:this.$route.path,query:{...this.$route.query,currentTab:t}})}},displayList(){return[{key:"downloadingTorrents",label:this.$t("downloading"),open:!0,list:this.filterTorrent(this.downloadingTorrents||[])},{key:"uploadingTorrents",label:this.$t("uploading"),open:!1,list:this.filterTorrent(this.uploadingTorrents||[])},{key:"downloadedTorrents",label:this.$t("downloaded"),open:!1,list:this.filterTorrent(this.downloadedTorrents||[])}]},currentList(){switch(this.displayTab){case"downloadingTorrents":return this.displayList[0].list;case"uploadingTorrents":return this.displayList[1].list;default:return this.displayList[2].list}},isAllStarted(){return this.currentList.every((e=>!e.paused))},isAllPaused(){return this.currentList.every((e=>e.paused))},noDataMessage(){return this.searchText?this.$t("no_matched_task"):this.$t("no_task")},downloadingTorrents(){const e=this.sortTorrents(this.torrentList.downloading);return e},disableDownloadAll(){return this.loading||this.downloadingTorrents.every((e=>!e.paused))},disablePauseAllDownloading(){return this.loading||this.downloadingTorrents.every((e=>e.paused))},downloadingProgress(){const e=this.torrentList.totalDownloadProgress;return isNaN(e)||0===e&&0===this.downloadingNum?{value:0,label:this.$t("no_downloading_task")}:{value:e,label:Object(M["g"])(e)}},uploadingTorrents(){const e=this.sortTorrents(this.torrentList.uploading);return e},totalDownloadSpeed(){return this.torrentList.totalDownloadSpeed?Object(M["a"])(this.torrentList.totalDownloadSpeed,{byte:!1,gb:!1})+" / s":"0.00 KB / s"},totalUploadSpeed(){if(!this.uploadingTorrents)return"-";const e=this.torrentList.totalUploadSpeed;return Object(M["a"])(e,{byte:!1,gb:!1})+" / s"},downloadedTorrents(){return this.sortTorrents(this.torrentList.downloaded)},torrentItems(){return Pn["a"].allTasks},torrentDetail(){return this.torrentDetailInfoHash&&this.torrentItems.find((e=>e.infoHash===this.torrentDetailInfoHash))||{}},alphabizTorrent(){return this.abTorrentInfoHash&&this.torrentItems.find((e=>e.infoHash===this.abTorrentInfoHash))||{}},downloadingNum(){return this.downloadingTorrents.filter((e=>!e.paused&&!e.pending&&!(!e.download||1===e.progress))).length},incomes(){let e=0;const t={};for(const s of this.dp$source.dp$incomeTxnListToday){if(!s.meta||"FINISH"!==s.status)continue;e+=s.amount;const n=JSON.parse(s.meta);n.infoHash&&(t[n.infoHash]||(t[n.infoHash]=0),t[n.infoHash]+=s.amount)}let n=0;const o={},a=this.dp$source.dp$incomeStatusMapper.FINISH;if(a)for(const s of a){const e=this.dp$source.dp$incomeTxnDict[s];n+=e.amount;const t=JSON.parse(e.meta).infoHash;o[t]||(o[t]=0),o[t]+=e.amount}return{todayIncome:e,todayTaskIncome:t,allIncome:n,allTaskIncome:o}},totalIncomeInfo(){return 2!==d["a"].state.credits.isModuleInit?this.$t("login_to_see_income"):this.$t("total_income_info",[Number((this.incomes.todayIncome/1e3).toFixed(3)),Number((this.incomes.allIncome/1e3).toFixed(3))])},disableTasks(){return!!d["a"].getters.shouldDisableTasks||!!d["a"].getters.settings.forceLogin&&(!d["a"].getters.accountUserInfo||!d["a"].getters.accountUserInfo.sub)},channelFollowable(){return!!this.channelPost&&!r["a"].followingChannels.some((e=>{var t;return e&&e.id===(null===(t=this.channelPost.channel)||void 0===t?void 0:t.id)}))}},methods:{ensureLogin(e){if(this.disableTasks){if(!d["a"].state.account.authState)return;this.$amplify.showSignedOutDialog()}else"function"===typeof e&&e()},async setLoading(){this.loading=!0,await new Promise((e=>setTimeout(e,1e3))),this.loading=!1},toggleSearchText(e){this.showSearchText=e,e&&this.$nextTick((()=>{this.$refs.searchInput.focus()}))},filterTorrent(e){const t=this.searchText.toLowerCase(),n=e.filter((e=>e.name||e.postTitle?e.postTitle?e.postTitle.toLowerCase().includes(t):e.name.toLowerCase().includes(t):""===t));return n},clearSearch(){this.searchText="",this.$refs.searchInput.blur()},changeListMode(){"list"===this.listMode?this.listMode="card":this.listMode="list",localStorage.setItem("task-list-mode",this.listMode)},byteToLargerSize(e){return Object(M["a"])(e,{byte:!0,gb:!0})},getTorrentListName(e){let t="downloading";return e.isSeeding||e.uploading?t="uploading":e.pending?t="pending":1===e.progress||e.done?t="downloaded":e.paused&&(t="paused"),t},showMagnetDialog(e){this.$root.$emit("openTaskDialog",e)},showDetail(e){this.torrentDetailInfoHash=e.infoHash,this.showTorrentDetail=!0},hideDetail(){this.showTorrentDetail=!1,this.torrentDetailInfoHash=""},showAbPanel({infoHash:e}){this.abTorrentInfoHash=e,this.showAlphabizPanel=!0},async showPostInfo(e=""){if(console.log("show",e),!e||!e.includes("posts"))return this.$q.notify("Cannot find post");this.$q.loading.show();const t=e.replace(/\/posts\/([^/]+$)/,""),n=t.split("/").filter((e=>e)).pop(),o=e.split("/").filter((e=>e)).pop();let a=!1;setTimeout((()=>{a||(a=!0,this.$q.loading.hide(),this.$q.dialog({title:this.$t("error"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}))}),5e3);const s=await r["a"].getPostById(n,o,!0);if(console.log("show post",s),a)return;const i=await r["a"].getChannelById(n);if(console.log("show post channel",i),!a){if(a=!0,!s)return this.$q.loading.hide(),void this.$q.dialog({title:"Not Found",message:"Cannot found post info"});s.channel=i,this.channelPost=s,this.$q.loading.hide(),this.showChannelPost=!0}},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&");this.$router.push(`/library/channel?${t}`),setTimeout((()=>{this.$root.$emit("navigate-to",`/library/channel?${t}`)}),200)},hideAbPanel(){this.showAlphabizPanel=!1,this.abTorrentInfoHash=""},async shareFile(e){const t=await Ja["Share"].canShare();if(!t.value)return;const n=await Ja["Share"].share({files:["file://"+encodeURI(e)]}).catch((e=>{console.log(e)}));this.$q.notify("Result: "+n.activityType)},showOriginTorrent(e){let t=e.token||e.origin;if(e.isSeeding||e.upload?t=e.magnetURI:e.magnetPath&&(t=e.magnetPath),!t)return this.$q.notify("origin_not_found");Ao.a.existsSync(t)?this.io.emit("show_torrent_file",t):(t.startsWith("magnet")||(t="magnet:?xt=urn:btih:"+e.infoHash),e.name&&(t+="&dn="+encodeURIComponent(e.name)),Object(lt["b"])(t),this.$q.notify(this.$t("text_copied")))},async showDirectory(e){if(Object(fe["a"])()){if(1!==e.progress&&!e.done)return this.$q.notify(this.$t("wait_for_downloaded_to_share"));if((await Ja["Share"].canShare()).value){const t=e.files.map((e=>"file://"+e.path));console.log("Files",t,e.path);const n=En(t);console.log("pub",n),Ja["Share"].share({files:["file://"+encodeURI(n)],title:"Save"}).catch((e=>{console.log("Share error",e)}))}}if(!Ao.a.existsSync(e.path))return this.$q.notify(this.$t("path_missing"));if(e.files&&1===e.files.length&&Ao.a.existsSync(e.files[0].path))return this.io.emit("show_torrent_file",e.files[0].path);const t=qn.a.resolve(e.path,e.postTitle||e.name||"");if(!Ao.a.existsSync(t))return this.io.emit("show_torrent_file",e.path);this.io.emit("show_torrent_file",t)},setAutoRenew(e,t){return Object(Ya["c"])(e,t),this.$set(this.autoRenew,e,t)},showPaymentPannel(e){this.paymentData=e,this.showPayment=!0},changeSortOption(e){this.sortOption=e},changeSortSequence(e){this.sortSequence=e},sortTorrents(e){const t=this.sortOption,n=t;switch(n){case"income":{const t=this.incomes.allTaskIncome;return[...e].sort(((e,n)=>t[e.infoHash]?t[n.infoHash]?(t[e.infoHash]-t[n.infoHash])*this.sortSequence:-1:t[n.infoHash]?1:0))}default:return e}},async askForConfirm(e){return new Promise((t=>{this.$q.dialog({persistent:!0,message:e,ok:this.$t("confirm"),cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>t(!0))).onCancel((()=>t(!1)))}))},downloadAll(e=!1){if(console.log("download all!"),this.loading)return console.log("skip downloadAll since loading");this.setLoading(),Object(An["c"])(e)},async pauseAllDownloading(e=!1){if(!this.torrentList.downloading.length)return console.log("skip pause all downloading");console.log("pauseall"),this.setLoading(),Object(An["d"])(e)},requestPauseAllDownloading(){this.$q.dialog({title:this.$t("pause_all"),message:this.$t("pause_all_finish_payments"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("pause_all")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{this.pauseAllDownloading()}))},removeAllDownloading(){const e=[];d["a"].getters.settings.defaultDeleteFiles&&e.push("deleteFiles"),this.$q.dialog({title:this.$t("delete_task"),message:this.$t("remove_all_downloading_tasks"),options:{type:"checkbox",model:e,items:[{label:this.$t("also_delete_files"),value:"deleteFiles"}]},ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove_all")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("not_now")}}).onOk((async e=>{const t=e.includes("deleteFiles");if(t&&d["a"].state.video.currentVideo.infoHash){const e=this.downloadingTorrents.find((e=>e.infoHash===d["a"].state.video.currentVideo.infoHash));if(e){const t=this.$t("remove_playing_confirm",[e.name]),n=await this.askForConfirm(t);if(!n)return;this.io.emit("trigger_clear_player",e.infoHash)}}this.setLoading(),this.io.emit("delete_all","download",t);for(const n of this.downloadingTorrents)this.io.emit("delete_torrent",n.infoHash,t);d["a"].dispatch("updateSettings",{defaultDeleteFiles:t})}))},pauseAllUploading(e=!1){this.torrentList.uploading.length&&(this.setLoading(),Object(An["e"])(e))},removeAllUploading(){const e=[];d["a"].getters.settings.defaultDeleteFiles&&e.push("deleteFiles"),this.$q.dialog({title:this.$t("delete_task"),message:this.$t("remove_all_upload_tasks"),options:{type:"checkbox",model:e,items:[{label:this.$t("also_delete_files"),value:"deleteFiles"},{label:this.$t("remove_autoupload_files"),value:"deleteAutoUpload"}]},ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove_all")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("not_now")}}).onOk((async e=>{const t=e.includes("deleteFiles"),n=e.includes("deleteAutoUpload");if(t&&d["a"].state.video.currentVideo.remotePlay&&d["a"].state.video.currentVideo.infoHash){const e=this.uploadingTorrents.find((e=>e.infoHash===d["a"].state.video.currentVideo.infoHash));if(e){var o,a,s;const t=this.$t("remove_playing_confirm",[e.name]),n=await this.askForConfirm(t);if(!n)return;console.log(null===(o=this.$refs.videoJsPlayer)||void 0===o?void 0:o.player),null===(a=this.$refs.videoJsPlayer)||void 0===a||null===(s=a.player)||void 0===s||s.stop(),this.io.emit("trigger_clear_player",e.infoHash)}}this.setLoading(),this.io.emit("delete_all","upload",t,n),d["a"].dispatch("updateSettings",{defaultDeleteFiles:t})}))},async uploadAll(e=!1){const t=Object(An["h"])(e);if(console.log("rest",t),t<=this.downloadedTorrents.length)return void console.log("Skip watch: nothing to upload");this.loading=!0;let n=null;const o=new Promise((e=>n=e)),a=this.$watch("downloadedTorrents",(e=>{e.length<=t&&(a(),this.loading=!1,console.log("upload done"),n())}));return setTimeout((()=>{this.loading&&(this.loading=!1,a(),n())}),5e3),o},pauseTorrent(e){this.setLoading(),Object(An["f"])(e,this)},resumeTorrent(e){e&&this.ensureLogin((()=>{this.setLoading(),console.log("resume",e),this.io.emit("resume_torrent",e)}))},deleteTorrent(e){this.ensureLogin((async()=>{if(e.infoHash&&d["a"].state.video.currentVideo.remotePlay&&e.infoHash===d["a"].state.video.currentVideo.infoHash){const t=this.$t("remove_playing_confirm",[e.name]),n=await this.askForConfirm(t);if(n){const t=await Pn["a"].deleteTask(e);if(!t)return;this.io.emit("trigger_clear_player",e.infoHash)}}else Pn["a"].deleteTask(e)}))},clearAll(){this.ensureLogin((()=>{this.$q.dialog({title:this.$t("clear_history"),message:this.$t("remove_all_history"),ok:this.$t("remove_all"),cancel:this.$t("not_now")}).onOk((()=>{this.setLoading();for(const e of this.downloadedTorrents)this.io.emit("delete_torrent",e.infoHash)}))}))},startPayment(e,t=!1){Object(Ya["d"])(e,t)},async createPayment(e,t=!1){await Object(Ya["a"])(e,t,this),t||(this.showPayment=!1)},setThrottleGroup(e){this.io.emit("set_throttle_group",e)},saveTorrentFile(e){this.io.emit("save_torrent_file",e)},play(e,t){(Xa||Object(fe["a"])())&&(console.log("run play():"+t+", "+e),d["a"].dispatch("remotePlay",t),this.io.emit("play-torrent",{infoHash:t,filepath:e}))},showQuickStart(e){this.quickStartTask=e,this.showQuickStartDialog=!0},hideQuickStartDialog(){this.showQuickStartDialog=!1,this.quickStartTask=null}},created(){this.io.on("client_info",(e=>{this.info=e}))},mounted(){if(Object.keys(this.autoRenew).length)for(const e in this.autoRenew)Object(Ya["c"])(e,this.autoRenew[e])},beforeRouteEnter(e,t,n){if(console.log("before enter",e,t),"/downloader"!==e.path)return n();console.log("is downloader"),e.query.currentTab?(console.log("current tab:",e.query.currentTab),n((t=>{t.currentTab=e.query.currentTab}))):(console.log("not current tab",e.query),n({path:e.path,query:{...e.query,currentTab:"downloading"}}))},beforeRouteUpdate(e,t,n){console.log("before update",e,t),this.currentTab=e.query.currentTab,n()},watch:{autoRenew(e){localStorage.setItem("task-autorenew",JSON.stringify(e))}}},es=Za,ts=(n("7297"),n("b2b4"),n("9b72")),ns=n("832a"),os=n("917f"),as=n("c72d"),ss=Object(v["a"])(es,Oo,qo,!1,null,"540e1290",null),is=ss.exports;C()(ss,"components",{QPage:ts["a"],QHeader:ns["a"],QToolbar:ce["a"],QSpace:W["a"],QBtn:O["a"],QInput:D["a"],QIcon:G["a"],QTooltip:H["a"],QLinearProgress:It["a"],QTabPanels:os["a"],QTabPanel:as["a"],QPageSticky:tt["a"],QDialog:q["a"]});var rs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page",[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"file"},on:{change:e.onFileChange}}),n("div",{staticClass:"container full-width"},[n("div",{staticClass:"sticky-bar q-py-sm bg-page text-page q-header--bordered"},[n("q-toolbar",{staticClass:"sticky-bar-toolbar",staticStyle:{"min-height":"unset"}},[n("span",[e._v("\n "+e._s(e.$t("web_mode_hint"))+"\n "),n("a",{staticClass:"doc-link",attrs:{href:"https://alpha.biz",target:"_blank"}},[e._v("\n "+e._s(e.$t("go_to"))+" alpha.biz\n "),n("q-icon",{attrs:{name:"open_in_new"}})],1)])])],1),n("div",{staticClass:"task-container"},[e.task.magnetURI||e.task.origin||e.task.isSeeding?n("CardItem",{attrs:{torrent:e.task},on:{pauseTorrent:e.pauseTorrent,resumeTorrent:e.resumeTorrent,deleteTorrent:e.deleteTorrent,play:e.play,showPaymentPannel:e.showPaymentPannel,showDetail:e.showDetail,showAbPanel:e.showAbPanel,showPostInfo:e.showPostInfo,showQuickStart:e.showQuickStart,saveFile:e.saveFile,saveZip:e.saveZip}}):n("div",{staticClass:"no-task"},[n("div",{staticClass:"add-hints"},[e._v("\n "+e._s(e.$t("web_mode_task_hint"))+"\n ")]),n("q-btn",{staticClass:"add-button",attrs:{color:"primary",icon:"add",size:"lg"},on:{click:e.showDownload}},[n("q-tooltip",[e._v(e._s(e.$t("download")))])],1),n("q-btn",{staticClass:"add-button q-ml-md",attrs:{color:"primary",icon:"cloud_upload",size:"lg"},on:{click:e.showUpload}},[n("q-tooltip",[e._v(e._s(e.$t("upload")))])],1)],1)],1)]),n("q-dialog",{model:{value:e.showInput,callback:function(t){e.showInput=t},expression:"showInput"}},[n("q-card",{staticClass:"url-input"},[n("q-card-section",[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("download")))]),n("q-input",{attrs:{type:"text",label:"Task URL"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.taskUrl,callback:function(t){e.taskUrl=t},expression:"taskUrl"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:"Cancel",color:"primary"}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{color:"primary",icon:"add",label:e.$t("add")},on:{click:e.addTask}})],1)],1)],1),n("q-dialog",{staticClass:"channel-post",attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showChannelPost,callback:function(t){e.showChannelPost=t},expression:"showChannelPost"}},[e.channelPost?n("PostCard",{attrs:{post:e.channelPost,followable:e.channelFollowable,hideButtons:""},on:{"to-channel":e.toChannelPage}}):e._e()],1),n("TableListDetail",{attrs:{show:e.showTaskDetail,torrent:e.task,paymentSize:10},on:{close:e.hideDetail}}),n("AlphabizPanel",{attrs:{dp$source:e.dp$source,show:e.showAlphabizPanel,torrent:e.task,paymentSize:10},on:{close:e.hideAbPanel}}),n("QuickStart",{attrs:{show:e.showQuickStartDialog,preset:e.task},on:{input:e.hideQuickStartDialog}})],1)},ls=[],cs=(n("f200"),n("09e8")),ds=n("7d7c"),us=(n("dc89"),n("2425"),n("3cc3")),hs=n.n(us);const ps=(e,t)=>{const n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=e,document.body.appendChild(o),o.click(),setTimeout((()=>{URL.revokeObjectURL(n),o.remove()}),3e4)};async function ms(e){return new Promise((t=>{e.getBlob(((n,o)=>{if(n)throw n;ps(e.name,o),t()}))}))}async function _s(e){if(!e.done)return;const t=Object(On["basename"])(e.name,Object(On["extname"])(e.name))+".zip",n=new hs.a,o=e.files;await Promise.all(o.map((e=>new Promise(((t,o)=>{e.getBlob(((a,s)=>{if(a)return o(a);n.file(e.path,s),t()}))}))))),o.length>1&&n.folder(e.postTitle||e.name);const a=await n.generateAsync({type:"blob"});return ps(t,a)}var fs=n("c620"),gs={components:{CardItem:zo,TableListDetail:Na,AlphabizPanel:Ba,QuickStart:Bn,PostCard:Ye},mixins:[cs["a"]],name:"Downloader",data(){return{locked:!1,showInput:!1,showTaskDetail:!1,showAlphabizPanel:!1,showQuickStartDialog:!1,showChannelPost:!1,channelPost:null,taskUrl:"",task:{}}},computed:{isReady(){return this.task.name&&this.task.length},displayName(){return this.task.postTitle?this.task.postTitle:this.task.name?this.task.name:this.$t("loading")},taskAction(){return this.task.paused?this.task.done?this.$t("upload"):this.$t("resume"):this.task.isSeeding?this.$t("stop_torrent"):this.$t("pause")},channelFollowable(){return!!this.channelPost&&!r["a"].followingChannels.some((e=>{var t;return e&&e.id===(null===(t=this.channelPost.channel)||void 0===t?void 0:t.id)}))}},methods:{async showDownload(){this.taskUrl="",this.showInput=!0,await this.$nextTick();const e=await Object(lt["a"])();if(e&&"string"===typeof e){const t=e.trim();if([De["protocol"],De["shortProtocol"],"magnet"].some((e=>t.startsWith(e+":")))){const e=t.startsWith("magnet")?t:await Object(Ce["a"])(t);if(!e||!e.startsWith("magnet"))return;this.taskUrl=t}}},async showUpload(){this.$refs.fileSelector.click()},showDetail(){this.showTaskDetail=!0},hideDetail(){this.showTaskDetail=!1},switchState(){console.log("on switch state")},addTask(){X["a"].emit("wt-add",this.taskUrl)},deleteTorrent(){this.$q.dialog({title:this.$t("delete_task"),message:this.$t("delete_confirm_message"),cancel:{color:"primary",flat:!0,label:this.$t("not_now")},ok:{color:"red",flat:!0,label:this.$t("delete")}}).onOk((()=>{X["a"].emit("wt-delete",this.task.infoHash),this.task={}}))},pauseTorrent(){X["a"].emit("wt-pause",this.task.infoHash),this.task.paused=!0},resumeTorrent(){this.task&&this.task.magnetURI&&(this.task.paused=!1,X["a"].emit("wt-resume",this.task.infoHash))},play(e){console.log("onplay",e),Object(ds["default"])(e)},showPaymentPannel(){},showAbPanel(){this.showAlphabizPanel=!0},hideAbPanel(){this.showAlphabizPanel=!1},async showPostInfo(e=""){if(console.log("show",e),!e||!e.includes("posts"))return this.$q.notify("Cannot find post");this.$q.loading.show();const t=e.replace(/\/posts\/([^/]+$)/,""),n=t.split("/").filter((e=>e)).pop(),o=e.split("/").filter((e=>e)).pop();let a=!1;setTimeout((()=>{a||(a=!0,this.$q.loading.hide(),this.$q.dialog({title:this.$t("error"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}))}),5e3);const s=await r["a"].getPostById(n,o,!0);if(console.log("show post",s),a)return;const i=await r["a"].getChannelById(n);if(console.log("show post channel",i),!a){if(a=!0,!s)return this.$q.loading.hide(),void this.$q.dialog({title:"Not Found",message:"Cannot found post info"});s.channel=i,this.channelPost=s,this.$q.loading.hide(),this.showChannelPost=!0}},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&");this.$router.push(`/library/channel?${t}`),setTimeout((()=>{this.$root.$emit("navigate-to",`/library/channel?${t}`)}),200)},onFileChange(e){const t=e.target;t&&t.files&&t.files.length&&(console.log("To upload",t.files[0]),X["a"].emit("wt-add",t.files[0])),t.value=null},showQuickStart(){this.showQuickStartDialog=!0},hideQuickStartDialog(){this.showQuickStartDialog=!1},saveFile(e){const t=fs["wtClient"].torrents[0];if(!t||!t.files)return;const n=t.files.find((t=>t.path===e.path))||t.files.find((t=>t.name===e.name));if(!n)return;const o=this.$q.dialog({title:this.$t("creating_save_file"),persistent:!0,ok:!1});setTimeout((()=>{ms(n).catch((e=>{console.error(e),e.message&&this.$q.notify(e.message)})).finally((()=>o.hide()))}))},saveZip(){const e=this.$q.dialog({message:this.$t("creating_save_file"),persistent:!0,ok:!1});setTimeout((()=>{_s(fs["wtClient"].torrents[0]).catch((e=>{console.error(e),e.message&&this.$q.notify(e.message)})).finally((()=>e.hide()))}))}},created(){console.log("[wt] created"),X["a"].on("weberror",((...e)=>this.$q.notify(...e))),X["a"].on("wt-task",(e=>{this.task=Array.isArray(e)?e[0]:e}))}},bs=gs,ys=(n("5ab7"),Object(v["a"])(bs,rs,ls,!1,null,"71beeddd",null)),vs=ys.exports;C()(ys,"components",{QPage:ts["a"],QHeader:ns["a"],QToolbar:ce["a"],QIcon:G["a"],QBtn:O["a"],QTooltip:H["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QInput:D["a"],QCardActions:N["a"]}),C()(ys,"directives",{ClosePopup:K["a"]});const ws=[{name:"MainLayout",path:"/",redirect:"/library",component:()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,"2cae")),children:[{name:"Library",path:"/library",component:_e,children:[{name:"LibraryExplore",path:"explore",component:At},{name:"LibraryFollowing",path:"following",component:Ft},{name:"LibraryFavorites",path:"favorite",component:Vt},{name:"LibraryEdit",path:"edit",component:Hn},{name:"LibraryChannel",path:"channel",component:ao},{name:"LibraryCreator",path:"creator",component:uo},{name:"LibraryTakeDown",path:"takedown",component:ko},{name:"LibraryIndex",path:"",component:Po}]},{name:"Downloader",path:"/downloader",component:Object(Z["isElectron"])()||Object(fe["a"])()?is:vs},{name:"Player",path:"/player",component:()=>n.e(8).then(n.bind(null,"d8f8"))},{name:"Credits",path:"/credits",component:()=>n.e(6).then(n.bind(null,"316f"))},{name:"Blockchain",path:"/blockchain",component:()=>n.e(9).then(n.bind(null,"4b4f"))},{name:"AccountSettings",path:"/account/settings",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"6b91"))},{name:"BasicSetting",path:"/basicSetting",component:()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,"9ff7"))},{name:"AdvanceSetting",path:"/advanceSetting",component:()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,"154e"))},{name:"Development",path:"/development",component:()=>Promise.resolve().then(n.bind(null,"39df"))}]},{name:"Error",path:"*",component:()=>n.e(10).then(n.bind(null,"183d"))}];var ks=ws;o["a"].use(a["a"]);const Cs=a["a"].prototype.push;a["a"].prototype.push=function(e){return Cs.call(this,e).catch((e=>e))};let $s=null;function Ss(){return $s}t["a"]=function(){const e=new a["a"]({scrollBehavior:()=>({x:0,y:0}),routes:ks,mode:"history",base:"/"});return $s=e,e}},"61dc":function(e,t,n){"use strict";n("d34c")},6422:function(e,t,n){"use strict";n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return i})),n.d(t,"g",(function(){return r})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return h})),n.d(t,"f",(function(){return _}));n("a1c1"),n("de6c");var o=n("4fd2");const a=(e,t="0",n=2)=>(t.repeat(n)+e).slice(-n),s=e=>{if("number"!==typeof e)return"-";const t=Math.floor(e/1e3),n=t%60,o=(t-n)/60;if(isNaN(n))return"-";if(o<60)return`00:${a(o)}:${a(n)}`;const s=o%60,i=(o-s)/60;return i>23?"> 24h":`${a(i)}:${a(s)}:${a(n)}`},i=(e,{byte:t=!0,gb:n=!0,fix:o=2}={})=>{if("number"!==typeof e)return"-";if(e<1e3&&t)return e.toFixed(2)+" Byte";const a=e/1e3;if(isNaN(a))return t?"0 Byte":"0 KB";if(a<1e3)return a.toFixed(o)+" KB";const s=a/1e3;if(s<1e3||!n)return s.toFixed(o)+" MB";const i=s/1e3;return i.toFixed(o)+" GB"},r=e=>"number"!==typeof e?"0%":1===e?"100.00%":e>.9999?"99.99%":(100*e).toFixed(2)+"%",l=e=>{const t={icon:"insert_drive_file",tooltip:"unknown"};if(0===e.length)return t;if(e.length>1)return{icon:"folder",tooltip:"folder"};const n=e[0].match(/\.[^.]+?$/);if(!n)return t;const a=n[0].substring(1);return Object(o["b"])(a)?{icon:"audio_file",tooltip:"audio"}:Object(o["c"])(a)?{icon:"video_file",tooltip:"video"}:["ass","vtt","srt"].includes(a)?{icon:"subtitles",tooltip:"subtitle"}:["jpg","jpeg","png","bmp","gif","webp"].includes(a)?{icon:"image",tooltip:"image"}:["zip","rar","gzip","gz","tar"].includes(a)?{icon:"folder_zip",tooltip:"zip"}:["txt","text"].includes(a)?{icon:"description",tooltip:"text"}:t},c=()=>navigator.userAgent.includes("Windows NT"),d=/(\/private)?\/var\/mobile\/Containers\/Data\/Application\/[a-zA-Z0-9-]+\/Documents\//,u=e=>e.match(d)?e.replace(d,""):e,h=(e,t=[],n=!1)=>{const o=c()||n?"\\":"/",a=e.map((e=>e.split(o))),s={};for(const r of a){let e=s;for(const t of r)e[t]||(e[t]={}),e=e[t]}let i=s,l=null,d="";try{do{const e=Object.keys(i)[0];d=d+e+o,l=i,i=i[e]}while(1===Object.keys(i).length)}catch(m){return null}d=d.split(o).slice(0,-1).join(o);const h={[d]:l[Object.keys(l)[0]]},p=(e,n="")=>{const a=Object.keys(e)[0],s=n?n+o+a:a,i=e[a];if(i&&Object.keys(i).length>0)return{label:u(a),path:u(s),fullPath:s,children:Object.keys(i).map((e=>p({[e]:i[e]},s)))};const l=t.find((e=>e.path===s)),c=u(a),d=c.length>52?c.slice(0,4)+"..."+c.slice(-40):c;return{progress:l?r(l.progress):"-",done:1===l.progress,label:d,fullPath:s,path:s}};return p(h)},p=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),m=e=>[e.getFullYear(),e.getMonth()+1,e.getDate()].map((e=>a(e))).join("-"),_=(e,t,n=navigator.language)=>{if(!e)return"-";const o=new Date(e),a=new Date;return p(o,a)?o.toLocaleTimeString(n):(a.setDate(a.getDate()-1),p(o,a)?t?t("yesterday"):"yesterday":(a.setDate(a.getDate()-1),p(o,a)?t?t("before_yesterday",{empty:m(o)}):"before yesterday":m(o)))}},6545:function(e,t,n){},6580:function(e,t,n){"use strict";n("0c70")},6755:function(e,t,n){},6792:function(e,t,n){"use strict";n("b031")},"67b6":function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{ref:"dialog",attrs:{persistent:!0,"content-class":{"markdown-dialog":!0,"fullscreen-dialog":e.fullscreen},position:e.fullscreen?"bottom":"standard"},on:{hide:function(t){return e.$emit("hide")}}},[n("q-card",{staticClass:"overflow-hidden column no-wrap",staticStyle:{"min-width":"320px","max-width":"720px","min-height":"calc(320px - 64px)","max-height":"calc(100vh - 64px)"},style:{paddingTop:(e.fullscreen&&e.$q.platform.is.electron?30:0)+"px"}},[n("q-card-section",{staticClass:"non-selectable flex justify-start items-center",class:{"q-py-sm":e.fullscreen}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.title))]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.screen$xs,expression:"!screen$xs"}],attrs:{"fab-mini":"",icon:e.isFullscreen?"fullscreen_exit":"fullscreen",unelevated:""},on:{click:function(t){e.isFullscreen=!e.isFullscreen}}}),n("q-btn",{attrs:{"fab-mini":"",icon:"close",unelevated:""},on:{click:e.hide}})],1),n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:Object.keys(e.contents).length>1,expression:"Object.keys(contents).length > 1"}],staticClass:"q-py-none",staticStyle:{"margin-top":"-8px"}},[n("q-tabs",{staticStyle:{margin:"0 -16px"},attrs:{dense:"",align:"left","no-caps":"","narrow-indicator":""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},[e._l(e.contents,(function(e,t){return[n("q-tab",{key:t,attrs:{ripple:!1,name:t,label:e.label}})]}))],2)],1),n("q-separator"),n("q-card-section",{staticClass:"q-pa-none scroll-y",staticStyle:{"max-height":"100%"}},[n("q-tab-panels",{attrs:{animated:""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},[e._l(e.contents,(function(t,o){return[n("q-tab-panel",{key:o,staticClass:"markdown-content",attrs:{name:o},domProps:{innerHTML:e._s(t.markdown)}})]}))],2)],1)],1)],1)},a=[],s=(n("de6c"),n("8e03")),i=n.n(s);const r={methods:{show(){this.$refs.dialog.show()},hide(){this.$refs.dialog.hide()}}},l={data(){return{isFullscreen:!1}},computed:{fullscreen(){return this.screen$xs||this.isFullscreen}}};var c={name:"MarkdownDialog",mixins:[r,l],props:{title:String,markdown:[Array,Object]},data(){return{currentTab:null}},computed:{contents(){const e=new i.a("commonmark");if(Array.isArray(this.markdown))return{content:{label:"content",markdown:e.render(this.markdown.join("\n"))}};const t={};return Object.entries(this.markdown).forEach((([n,o])=>{t[n]={label:o.label,markdown:e.render(o.markdown.join("\n"))}})),t}},created(){this.currentTab=Object.keys(this.contents)[0]}},d=c,u=(n("2cab"),n("2b5f")),h=n("b2aa"),p=n("e586"),m=n("d7c7"),_=n("990e"),f=n("1043"),g=n("74cb"),b=n("ec78"),y=n("fc38"),v=n("917f"),w=n("c72d"),k=n("09a4"),C=n.n(k),$=Object(u["a"])(d,o,a,!1,null,null,null),S=$.exports;C()($,"components",{QDialog:h["a"],QCard:p["a"],QCardSection:m["a"],QSpace:_["a"],QBtn:f["a"],QTabs:g["a"],QTab:b["a"],QSeparator:y["a"],QTabPanels:v["a"],QTabPanel:w["a"]});t["b"]={methods:{createMarkdownDialog({title:e,markdown:t}){return this.$q.dialog({component:S,title:e,markdown:t})}}};function x({title:e,markdown:t}){return this.$q.dialog({component:S,title:e,markdown:t})}},"6ce4":function(e,t,n){},"6e85":function(e,t,n){},7:function(e,t){},7285:function(e,t,n){"use strict";n("c066")},7297:function(e,t,n){"use strict";n("a5fe")},7405:function(e,t,n){},7447:function(e,t,n){},7471:function(e,t,n){"use strict";(function(e){var o=n("3fd2"),a=n.n(o);let s;if(a.a.main())s=n("9e8c"),Object.defineProperty(e,"lzma",{get(){return s}});else if(a.a.renderer())s=require("lzma-native"),Object.defineProperty(e,"lzma",{get(){return s}});else{const t=n("6ca2").LZMA;s=new t,Object.defineProperty("undefined"===typeof window?e:window,"lzma",{get(){return s}})}t["a"]=s}).call(this,n("0ee4"))},7686:function(e,t,n){},"76ec":function(e,t,n){"use strict";t["a"]=[" GNU GENERAL PUBLIC LICENSE"," Version 2, June 1991",""," Copyright (C) 1989, 1991 Free Software Foundation, Inc.,"," 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"," Everyone is permitted to copy and distribute verbatim copies"," of this license document, but changing it is not allowed.",""," Preamble",""," The licenses for most software are designed to take away your","freedom to share and change it. By contrast, the GNU General Public","License is intended to guarantee your freedom to share and change free","software--to make sure the software is free for all its users. This","General Public License applies to most of the Free Software","Foundation's software and to any other program whose authors commit to","using it. (Some other Free Software Foundation software is covered by","the GNU Lesser General Public License instead.) You can apply it to","your programs, too.",""," When we speak of free software, we are referring to freedom, not","price. Our General Public Licenses are designed to make sure that you","have the freedom to distribute copies of free software (and charge for","this service if you wish), that you receive source code or can get it","if you want it, that you can change the software or use pieces of it","in new free programs; and that you know you can do these things.",""," To protect your rights, we need to make restrictions that forbid","anyone to deny you these rights or to ask you to surrender the rights.","These restrictions translate to certain responsibilities for you if you","distribute copies of the software, or if you modify it.",""," For example, if you distribute copies of such a program, whether","gratis or for a fee, you must give the recipients all the rights that","you have. You must make sure that they, too, receive or can get the","source code. And you must show them these terms so they know their","rights.",""," We protect your rights with two steps: (1) copyright the software, and","(2) offer you this license which gives you legal permission to copy,","distribute and/or modify the software.",""," Also, for each author's protection and ours, we want to make certain","that everyone understands that there is no warranty for this free","software. If the software is modified by someone else and passed on, we","want its recipients to know that what they have is not the original, so","that any problems introduced by others will not reflect on the original","authors' reputations.",""," Finally, any free program is threatened constantly by software","patents. We wish to avoid the danger that redistributors of a free","program will individually obtain patent licenses, in effect making the","program proprietary. To prevent this, we have made it clear that any","patent must be licensed for everyone's free use or not licensed at all.",""," The precise terms and conditions for copying, distribution and","modification follow.",""," GNU GENERAL PUBLIC LICENSE"," TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION",""," 0. This License applies to any program or other work which contains","a notice placed by the copyright holder saying it may be distributed",'under the terms of this General Public License. The "Program", below,','refers to any such program or work, and a "work based on the Program"',"means either the Program or any derivative work under copyright law:","that is to say, a work containing the Program or a portion of it,","either verbatim or with modifications and/or translated into another","language. (Hereinafter, translation is included without limitation in",'the term "modification".) Each licensee is addressed as "you".',"","Activities other than copying, distribution and modification are not","covered by this License; they are outside its scope. The act of","running the Program is not restricted, and the output from the Program","is covered only if its contents constitute a work based on the","Program (independent of having been made by running the Program).","Whether that is true depends on what the Program does.",""," 1. You may copy and distribute verbatim copies of the Program's","source code as you receive it, in any medium, provided that you","conspicuously and appropriately publish on each copy an appropriate","copyright notice and disclaimer of warranty; keep intact all the","notices that refer to this License and to the absence of any warranty;","and give any other recipients of the Program a copy of this License","along with the Program.","","You may charge a fee for the physical act of transferring a copy, and","you may at your option offer warranty protection in exchange for a fee.",""," 2. You may modify your copy or copies of the Program or any portion","of it, thus forming a work based on the Program, and copy and","distribute such modifications or work under the terms of Section 1","above, provided that you also meet all of these conditions:",""," a) You must cause the modified files to carry prominent notices"," stating that you changed the files and the date of any change.",""," b) You must cause any work that you distribute or publish, that in"," whole or in part contains or is derived from the Program or any"," part thereof, to be licensed as a whole at no charge to all third"," parties under the terms of this License.",""," c) If the modified program normally reads commands interactively"," when run, you must cause it, when started running for such"," interactive use in the most ordinary way, to print or display an"," announcement including an appropriate copyright notice and a"," notice that there is no warranty (or else, saying that you provide"," a warranty) and that users may redistribute the program under"," these conditions, and telling the user how to view a copy of this"," License. (Exception: if the Program itself is interactive but"," does not normally print such an announcement, your work based on"," the Program is not required to print an announcement.)","","These requirements apply to the modified work as a whole. If","identifiable sections of that work are not derived from the Program,","and can be reasonably considered independent and separate works in","themselves, then this License, and its terms, do not apply to those","sections when you distribute them as separate works. But when you","distribute the same sections as part of a whole which is a work based","on the Program, the distribution of the whole must be on the terms of","this License, whose permissions for other licensees extend to the","entire whole, and thus to each and every part regardless of who wrote it.","","Thus, it is not the intent of this section to claim rights or contest","your rights to work written entirely by you; rather, the intent is to","exercise the right to control the distribution of derivative or","collective works based on the Program.","","In addition, mere aggregation of another work not based on the Program","with the Program (or with a work based on the Program) on a volume of","a storage or distribution medium does not bring the other work under","the scope of this License.",""," 3. You may copy and distribute the Program (or a work based on it,","under Section 2) in object code or executable form under the terms of","Sections 1 and 2 above provided that you also do one of the following:",""," a) Accompany it with the complete corresponding machine-readable"," source code, which must be distributed under the terms of Sections"," 1 and 2 above on a medium customarily used for software interchange; or,",""," b) Accompany it with a written offer, valid for at least three"," years, to give any third party, for a charge no more than your"," cost of physically performing source distribution, a complete"," machine-readable copy of the corresponding source code, to be"," distributed under the terms of Sections 1 and 2 above on a medium"," customarily used for software interchange; or,",""," c) Accompany it with the information you received as to the offer"," to distribute corresponding source code. (This alternative is"," allowed only for noncommercial distribution and only if you"," received the program in object code or executable form with such"," an offer, in accord with Subsection b above.)","","The source code for a work means the preferred form of the work for","making modifications to it. For an executable work, complete source","code means all the source code for all modules it contains, plus any","associated interface definition files, plus the scripts used to","control compilation and installation of the executable. However, as a","special exception, the source code distributed need not include","anything that is normally distributed (in either source or binary","form) with the major components (compiler, kernel, and so on) of the","operating system on which the executable runs, unless that component","itself accompanies the executable.","","If distribution of executable or object code is made by offering","access to copy from a designated place, then offering equivalent","access to copy the source code from the same place counts as","distribution of the source code, even though third parties are not","compelled to copy the source along with the object code.",""," 4. You may not copy, modify, sublicense, or distribute the Program","except as expressly provided under this License. Any attempt","otherwise to copy, modify, sublicense or distribute the Program is","void, and will automatically terminate your rights under this License.","However, parties who have received copies, or rights, from you under","this License will not have their licenses terminated so long as such","parties remain in full compliance.",""," 5. You are not required to accept this License, since you have not","signed it. However, nothing else grants you permission to modify or","distribute the Program or its derivative works. These actions are","prohibited by law if you do not accept this License. Therefore, by","modifying or distributing the Program (or any work based on the","Program), you indicate your acceptance of this License to do so, and","all its terms and conditions for copying, distributing or modifying","the Program or works based on it.",""," 6. Each time you redistribute the Program (or any work based on the","Program), the recipient automatically receives a license from the","original licensor to copy, distribute or modify the Program subject to","these terms and conditions. You may not impose any further","restrictions on the recipients' exercise of the rights granted herein.","You are not responsible for enforcing compliance by third parties to","this License.",""," 7. If, as a consequence of a court judgment or allegation of patent","infringement or for any other reason (not limited to patent issues),","conditions are imposed on you (whether by court order, agreement or","otherwise) that contradict the conditions of this License, they do not","excuse you from the conditions of this License. If you cannot","distribute so as to satisfy simultaneously your obligations under this","License and any other pertinent obligations, then as a consequence you","may not distribute the Program at all. For example, if a patent","license would not permit royalty-free redistribution of the Program by","all those who receive copies directly or indirectly through you, then","the only way you could satisfy both it and this License would be to","refrain entirely from distribution of the Program.","","If any portion of this section is held invalid or unenforceable under","any particular circumstance, the balance of the section is intended to","apply and the section as a whole is intended to apply in other","circumstances.","","It is not the purpose of this section to induce you to infringe any","patents or other property right claims or to contest validity of any","such claims; this section has the sole purpose of protecting the","integrity of the free software distribution system, which is","implemented by public license practices. Many people have made","generous contributions to the wide range of software distributed","through that system in reliance on consistent application of that","system; it is up to the author/donor to decide if he or she is willing","to distribute software through any other system and a licensee cannot","impose that choice.","","This section is intended to make thoroughly clear what is believed to","be a consequence of the rest of this License.",""," 8. If the distribution and/or use of the Program is restricted in","certain countries either by patents or by copyrighted interfaces, the","original copyright holder who places the Program under this License","may add an explicit geographical distribution limitation excluding","those countries, so that distribution is permitted only in or among","countries not thus excluded. In such case, this License incorporates","the limitation as if written in the body of this License.",""," 9. The Free Software Foundation may publish revised and/or new versions","of the General Public License from time to time. Such new versions will","be similar in spirit to the present version, but may differ in detail to","address new problems or concerns.","","Each version is given a distinguishing version number. If the Program",'specifies a version number of this License which applies to it and "any','later version", you have the option of following the terms and conditions',"either of that version or of any later version published by the Free","Software Foundation. If the Program does not specify a version number of","this License, you may choose any version ever published by the Free Software","Foundation.",""," 10. If you wish to incorporate parts of the Program into other free","programs whose distribution conditions are different, write to the author","to ask for permission. For software which is copyrighted by the Free","Software Foundation, write to the Free Software Foundation; we sometimes","make exceptions for this. Our decision will be guided by the two goals","of preserving the free status of all derivatives of our free software and","of promoting the sharing and reuse of software generally.",""," NO WARRANTY",""," 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY","FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN","OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES",'PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED',"OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF","MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS","TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE","PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,","REPAIR OR CORRECTION.",""," 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING","WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR","REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,","INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING","OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED","TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY","YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER","PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE","POSSIBILITY OF SUCH DAMAGES.",""," END OF TERMS AND CONDITIONS",""," How to Apply These Terms to Your New Programs",""," If you develop a new program, and you want it to be of the greatest","possible use to the public, the best way to achieve this is to make it","free software which everyone can redistribute and change under these terms.",""," To do so, attach the following notices to the program. It is safest","to attach them to the start of each source file to most effectively","convey the exclusion of warranty; and each file should have at least",'the "copyright" line and a pointer to where the full notice is found.',""," "," Copyright (C) ",""," This program is free software; you can redistribute it and/or modify"," it under the terms of the GNU General Public License as published by"," the Free Software Foundation; either version 2 of the License, or"," (at your option) any later version.",""," This program is distributed in the hope that it will be useful,"," but WITHOUT ANY WARRANTY; without even the implied warranty of"," MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"," GNU General Public License for more details.",""," You should have received a copy of the GNU General Public License along"," with this program; if not, write to the Free Software Foundation, Inc.,"," 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.","","Also add information on how to contact you by electronic and paper mail.","","If the program is interactive, make it output a short notice like this","when it starts in an interactive mode:",""," Gnomovision version 69, Copyright (C) year name of author"," Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'."," This is free software, and you are welcome to redistribute it"," under certain conditions; type `show c' for details.","","The hypothetical commands `show w' and `show c' should show the appropriate","parts of the General Public License. Of course, the commands you use may","be called something other than `show w' and `show c'; they could even be","mouse-clicks or menu items--whatever suits your program.","","You should also get your employer (if you work as a programmer) or your",'school, if any, to sign a "copyright disclaimer" for the program, if',"necessary. Here is a sample; alter the names:",""," Yoyodyne, Inc., hereby disclaims all copyright interest in the program"," `Gnomovision' (which makes passes at compilers) written by James Hacker.",""," , 1 April 1989"," Ty Coon, President of Vice","","This General Public License does not permit incorporating your program into","proprietary programs. If your program is a subroutine library, you may","consider it more useful to permit linking proprietary applications with the","library. If this is what you want to do, use the GNU Lesser General","Public License instead of this License.",""]},7895:function(e,t,n){"use strict";n("ae24")},"79e7":function(e,t,n){"use strict";var o=n("ff9b"),a=(n("de6c"),n("3387")),s=n.n(a);function i(e,t,n){const s=n?e=>e[n]:e=>e;for(const r of t){const t=e.findIndex((e=>s(e)===s(r)));-1===t?e.push(r):"object"===typeof r?Array.isArray(r)?i(e[t],r):Object(a["isEqual"])(e[t],r)||o["a"].set(e,t,r):o["a"].set(e,t,r)}for(let o=0;os(t)===s(e[o])))||e.splice(o--,1);return e}const r={tasksCount:{downloading:0,uploading:0,downloaded:0},abKeys:{},uploadingTasks:[],shouldDisableTasks:!1,uploadingLoading:!1,updatingTaskList:!1},l=new o["a"]({data(){return{downloading:[],uploading:[],downloaded:[],totalDownloadSpeed:0,totalUploadSpeed:0,totalDownloadProgress:0}}}),c={DOWNLOADER_UPDATE_DOWNLOADING_TASK_COUNT(e,t){e.tasksCount.downloading=t},DOWNLOADER_UPDATE_UPLOADING_TASK_COUNT(e,t){e.tasksCount.uploading=t},DOWNLOADER_UPDATE_DOWNLOADED_TASK_COUNT(e,t){e.tasksCount.downloaded=t},DOWNLOADER_SET_UPLOADING_LOADING(e,t){e.uploadingLoading=t},updateTaskCount(e,t){Object.assign(e.tasksCount,t)},changeDisableTasks(e,t){e.shouldDisableTasks=t},updateABKeys(e,t){for(const n in t){const o=t[n],a=e.abKeys[n];a?e.abKeys[n]=[...i(a,o,"key")]:e.abKeys=t}},updateUploading(e,t){console.log("updateUploading",t),i(e.uploadingTasks,t,"abUrl")},setUpdatingTasks(e,t){e.updatingTaskList=t},updateTaskInfo(e,t){o["a"].set(l,t.type,t.info)},updateTasks(e,t){const{uploadingTasks:n,tasksCount:o,abKeyObj:a}=t;i(e.uploadingTasks,n,"abUrl");for(const s in o)e.tasksCount[s]=o[s];for(const s in a){const t=a[s],n=e.abKeys[s];n?i(n,t,"key"):e.abKeys=a}}},d={},u={taskCount(e){return e.tasksCount},getDownloadingTaskCount(e){return e.tasksCount.downloading},getUploadingTaskCount(e){return e.tasksCount.uploading},getDownloadedTaskCount(e){return e.tasksCount.downloaded},shouldDisableTasks(e){return e.shouldDisableTasks},isUploadingLoading(e){return e.uploadingLoading},abKeys(e){return e.abKeys},uploading(e){return e.uploadingTasks},tasks(){return l.$data},allTasks(){return[...l.downloading,...l.uploading,...l.downloaded]}},h={namespaced:!1,state:r,mutations:c,actions:d,getters:u};var p=h,m=n("d310"),_=n("8a63"),f=n("9efe"),g=n("e74d"),b=n("e75b"),y=n("d7df"),v=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const w=new b["a"].Rest("ABDevRest"),k=()=>v(void 0,void 0,void 0,(function*(){const e=window.$blockchain.$store.account;if(yield e.initCurrentAccount(),e.account)return;const t=yield e.createNewAccount();yield t.confirm(),yield e.recoveryAccount({key:t.toPrivateKeyObject().privateKeyHex}),console.log("The blockchain account has been created automatically: ",t)})),C=()=>v(void 0,void 0,void 0,(function*(){"blockchain"===localStorage.getItem("dataPaymentMixin.mode")&&(yield k())})),$=e=>{var t,n;return{sub:e.attributes.sub,username:e.username,signingTime:e.attributes["custom:signing_time"],signingIpAddress:e.attributes["custom:signing_ip_address"],lastLoginTime:e.attributes["custom:last_login_time"],lastIpAddress:e.attributes["custom:last_ip_address"],accountLevel:e.attributes["custom:account_level"],msgLocale:e.attributes["custom:msg_locale"],nickname:e.attributes.nickname,gender:e.attributes.gender,birthday:e.attributes.birthdate,locale:e.attributes.locale,email:e.attributes.email,phoneNumber:e.attributes.phone_number,phoneNumberCountryCode:e.attributes["custom:phone_number_code"],emailVerified:e.attributes.email_verified,phoneNumberVerified:e.attributes.phone_number_verified,invitationCode:null===(t=e.dynamo_attrs)||void 0===t?void 0:t.invitation_code,identities:JSON.parse(null!==(n=e.attributes.identities)&&void 0!==n?n:"[]")}},S=["sub","username","email","emailVerified","phoneNumber","phoneNumberCountryCode","phoneNumberVerified","signingTime","signingIpAddress","lastLoginTime","lastIpAddress","accountLevel","msgLocale","invitationCode","identities"],x=["nickname","gender","birthday","locale"],T=Object.assign(Object.assign({authState:null},[...S,...x].reduce(((e,t)=>(e[t]=void 0,e)),{})),{verification:null,preferredMFA:null}),I={ACCOUNT_UPDATE_INFO(e,t){Object.keys(t).forEach((n=>{const o=n;if(void 0!==t[o])e[o]=t[o];else{const t={gender:"notSay",locale:"notSay"};e[o]=t[o]||""}}))},ACCOUNT_CLEAR_INFO(e){[...S,...x].forEach((t=>{e[t]=void 0}))},ACCOUNT_UPDATE_STATE(e,t){if(e.verification&&["forgotPassword","signUpConfirm","signInConfirm","signUp"].includes(e.authState)&&(e.verification=null),e.authState=t,m["Bus"].$emit("update-authstate",t),"signedIn"!==e.authState)return console.log("Skip not sign in",t);console.log("authState:",e.authState),y["a"].emit("user_login","store - account_update_state"),Object(_["a"])()},ACCOUNT_UPDATE_VERIFICATION(e,t){t?(e.verification||(e.verification={}),Object.assign(e.verification,t)):e.verification=null},ACCOUNT_SET_MFA_TYPE(e,t){e.preferredMFA=t}},P={ACCOUNT_UPDATE_INFO({commit:e}){return v(this,void 0,void 0,(function*(){const t=yield Object(f["f"])();return e("ACCOUNT_UPDATE_INFO",$(t)),g["a"].currentAuthenticatedUser().then((e=>g["a"].getPreferredMFA(e))).then((t=>e("ACCOUNT_SET_MFA_TYPE",t))),{message:"success"}}))},ACCOUNT_REDIRECT_TO_INDEX({dispatch:e,commit:t,state:n}){return v(this,void 0,void 0,(function*(){const o=()=>v(this,void 0,void 0,(function*(){yield Promise.all([C(),e("CREDIT_INIT_DATA")]),t("ACCOUNT_UPDATE_STATE","signedIn")})),a=()=>v(this,void 0,void 0,(function*(){yield Promise.all([e("CREDIT_CLEAR_DATA")]),t("ACCOUNT_UPDATE_STATE","signedOut")}));try{const t=yield Object(f["e"])(!1).catch((e=>(console.warn("debug#859: fetchAuthUser"),console.log(e),null)));if(!t)return yield a();yield e("ACCOUNT_UPDATE_INFO"),"signedIn"!==n.authState?yield o():(console.warn("debug#859: state.authState"),console.log(n.authState))}catch(s){console.error('failed to "ACCOUNT_REDIRECT_TO_INDEX"'),console.warn("debug#859: state.authState"),console.log(s),yield a()}}))},ACCOUNT_SIGN_IN({commit:e,dispatch:t},{username:n,password:o}){return v(this,void 0,void 0,(function*(){const a=yield Object(f["l"])(n,o).catch((e=>e));if(a){if("SMS_MFA"===a.message)throw e("ACCOUNT_UPDATE_VERIFICATION",{username:n,password:o,type:"phone_number",mfaType:a.message,destination:a.destination,user:a.user}),a;if("SOFTWARE_TOKEN_MFA"===a.message)throw e("ACCOUNT_UPDATE_VERIFICATION",{username:n,password:o,type:"software_token",mfaType:a.message,user:a.user}),a;if("UserNotConfirmedException"===a.code){e("ACCOUNT_UPDATE_VERIFICATION",{username:n,password:o});const s=yield t("ACCOUNT_SIGN_UP_VERIFICATION_CODE_RESEND");throw"success"===s.message?new Error(a.code):s}throw a}return e("ACCOUNT_CLEAR_INFO"),yield t("ACCOUNT_UPDATE_INFO"),yield Promise.all([C(),t("CREDIT_INIT_DATA")]),{message:"success"}}))},ACCOUNT_SIGN_OUT({commit:e,dispatch:t}){return v(this,void 0,void 0,(function*(){yield Object(f["n"])(),e("ACCOUNT_UPDATE_STATE","signedOut"),e("ACCOUNT_CLEAR_INFO"),yield t("CREDIT_CLEAR_DATA")}))},ACCOUNT_DELETE_USER({commit:e,dispatch:t},{password:n}){return v(this,void 0,void 0,(function*(){yield Object(f["x"])(n),yield Object(f["d"])(),yield Object(f["n"])(),e("ACCOUNT_UPDATE_STATE","signedOut"),e("ACCOUNT_CLEAR_INFO"),yield t("CREDIT_CLEAR_DATA")}))},ACCOUNT_SET_MFA_TYPE({dispatch:e,commit:t,state:n},o){return v(this,void 0,void 0,(function*(){if(!["SMS_MFA","TOTP","SOFTWARE_TOKEN_MFA","NOMFA"].includes(o))throw new Error("Illegal mfa type");const e=yield g["a"].currentAuthenticatedUser();yield g["a"].setPreferredMFA(e,o);const n=yield g["a"].getPreferredMFA(e);t("ACCOUNT_SET_MFA_TYPE",n)}))},ACCOUNT_MFA_RESEND({dispatch:e,commit:t,state:n}){return v(this,void 0,void 0,(function*(){const o=n.verification.username,a=n.verification.password,s=yield e("ACCOUNT_SIGN_IN",{username:o,password:a}).catch((e=>e));if(!s)throw new Error("Unexpected Error");"SMS_MFA"===s.message?t("ACCOUNT_UPDATE_VERIFICATION",{username:o,password:a,type:"phone_number",mfaType:s.message,destination:s.destination,user:s.user}):"SOFTWARE_TOKEN_MFA"===s.message&&t("ACCOUNT_UPDATE_VERIFICATION",{username:o,password:a,type:"software_token",mfaType:s.message,user:s.user})}))},ACCOUNT_MFA_SUBMIT({state:e,commit:t,dispatch:n},o){return v(this,void 0,void 0,(function*(){const a=e.verification.user,s=e.verification.mfaType;yield Object(f["m"])(a,s,o),t("ACCOUNT_CLEAR_INFO"),yield n("ACCOUNT_UPDATE_INFO"),yield n("CREDIT_INIT_DATA")}))},ACCOUNT_CHANGE_ATTRIBUTES({dispatch:e},t){return v(this,void 0,void 0,(function*(){yield Object(f["b"])(t),yield e("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_UNLINK_OAUTH({dispatch:e,state:t},n){return v(this,void 0,void 0,(function*(){if(t.identities.length<=0)throw new Error("Not oauth provider existed");const o=t.identities.find((e=>e.providerName===n));if(!o)throw new Error("Can not found oauth provider: "+n);yield Object(f["r"])(n,o.userId),yield e("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_PASSWORD({commit:e},{oldPassword:t,newPassword:n}){return v(this,void 0,void 0,(function*(){const e=yield g["a"].currentAuthenticatedUser();yield w.post("/account/changePassword",{username:e.getUsername(),AccessToken:e.signInUserSession.getAccessToken().getJwtToken(),PreviousPassword:t,ProposedPassword:n})}))},ACCOUNT_FORGOT_PASSWORD_SEND({state:e,commit:t,rootGetters:n},o){return v(this,void 0,void 0,(function*(){const e=n.settings.language,a=yield Object(f["g"])(o,{msgLocale:`${e}:F`});return t("ACCOUNT_UPDATE_VERIFICATION",{username:o,type:a.CodeDeliveryDetails.AttributeName,destination:a.CodeDeliveryDetails.Destination}),{message:"success"}}))},ACCOUNT_FORGOT_PASSWORD_SUBMIT({commit:e,state:t},{code:n,password:o}){return v(this,void 0,void 0,(function*(){yield w.postGuest("/account/forgotPasswordSubmit",{ClientId:g["a"].userPool.getClientId(),ConfirmationCode:n,Password:o,Username:t.verification.username})}))},ACCOUNT_SIGN_UP_NECESSARY({rootGetters:e,commit:t},n){return v(this,void 0,void 0,(function*(){if(!n.email&&!n.phoneNumber)throw new Error("Email or Phone Number must be fill when signing up.");const o=e.settings.language;n.msgLocale=`${o}:${n.email?"E":"P"}`;const a=yield Object(f["o"])(n);return t("ACCOUNT_UPDATE_VERIFICATION",{username:a.user.username,password:n.password,type:a.codeDeliveryDetails.AttributeName,destination:{email:n.email,phone_number:n.phoneNumber}[a.codeDeliveryDetails.AttributeName]}),{message:"success"}}))},ACCOUNT_SIGN_UP_VERIFICATION_CODE_RESEND({state:e,commit:t}){return v(this,void 0,void 0,(function*(){const t=e.verification.username;yield Object(f["i"])(t);return{message:"success"}}))},ACCOUNT_SIGN_UP_VERIFICATION_CODE_SUBMIT({commit:e,state:t},{code:n,optAttrs:o}){return v(this,void 0,void 0,(function*(){try{yield Object(f["c"])(t.verification.username,n,o)}catch(e){if(console.warn("ACCOUNT_SIGN_UP_VERIFICATION_CODE_SUBMIT",e),e instanceof Error&&!["User cannot be confirmed. Current status is CONFIRMED","User is already confirmed"].includes(e.message))throw e}return{message:"success"}}))},ACCOUNT_INVITE_CODE({commit:e,dispatch:t},{code:n,contactEmail:o,contactPhone:a}){return v(this,void 0,void 0,(function*(){return yield Object(f["h"])(n,o,a),yield t("ACCOUNT_UPDATE_INFO"),{message:"success"}}))},ACCOUNT_CHANGE_EMAIL_SEND({rootGetters:e,dispatch:t},n){return v(this,void 0,void 0,(function*(){const o=e.settings.language;return T.msgLocale===`${o}:E`||(yield Object(f["k"])(o,"E")),n&&n===T.email?yield Object(f["t"])("email"):yield Object(f["u"])("email",n),yield t("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_EMAIL_SUBMIT({dispatch:e},t){return v(this,void 0,void 0,(function*(){return yield Object(f["v"])("email",t),yield e("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_PHONE_NUMBER_SEND({rootGetters:e,state:t,dispatch:n},{phoneNumber:o,phoneNumberCountryCode:a}){return v(this,void 0,void 0,(function*(){const s=e.settings.language;return t.msgLocale===`${s}:P`||(yield Object(f["k"])(s,"P")),o&&a&&o===t.phoneNumber&&a===t.phoneNumberCountryCode?yield Object(f["t"])("phone_number"):yield Object(f["u"])("phone_number",o,a),yield n("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_PHONE_NUMBER_SUBMIT({dispatch:e},t){return v(this,void 0,void 0,(function*(){return yield Object(f["v"])("phone_number",t),yield e("ACCOUNT_UPDATE_INFO")}))}},O={accountUserInfo(e,t){const n={};return Object.assign(n,t.accountUserOptionalInfo),n.preferredMFA=e.preferredMFA,Object.assign(n,t.accountUserReadonlyInfo),n},accountUserReadonlyInfo(){return S.reduce(((e,t)=>(e[t]=T[t],e)),{})},accountUserOptionalInfo(e){return x.reduce(((t,n)=>(t[n]=e[n],t)),{})}},q={namespaced:!1,state:T,mutations:I,actions:P,getters:O};var E=q,A=n("06e8"),D=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const N=new b["a"].Rest("ABDevRest"),L={Mutations:{CREDIT_SET_INIT_STATE:"CREDIT_SET_INIT_STATE",CREDIT_CLEAR_DATA:"CREDIT_CLEAR_DATA",CREDIT_UPDATE:"CREDIT_UPDATE",CREDIT_UPDATE_TXN:"CREDIT_UPDATE_TXN",CREDIT_CLEAR_TRANSACTION:"CREDIT_CLEAR_TRANSACTION",CREDIT_UPDATE_USER:"CREDIT_UPDATE_USER",CREDIT_UPDATE_EXPENSES:"CREDIT_UPDATE_EXPENSES",CREDIT_UPDATE_INCOME_TODAY:"CREDIT_UPDATE_INCOME_TODAY",CREDIT_UPDATE_TOKEN:"CREDIT_UPDATE_TOKEN",CREDIT_UPDATE_INCOME:"CREDIT_UPDATE_INCOME"},Actions:{CREDIT_INIT_DATA:"CREDIT_INIT_DATA",CREDIT_CLEAR_DATA:"CREDIT_CLEAR_DATA",CREDIT_TRANSFER:"CREDIT_TRANSFER",CREDIT_FETCH_TRANSACTION:"CREDIT_FETCH_TRANSACTION",CREDIT_CLEAR_TRANSACTION:"CREDIT_CLEAR_TRANSACTION"}},j=["credit"];var R,U;(function(e){e["TRANSFER"]="TRANSFER",e["PAYDATA"]="PAYDATA",e["RECHARGE"]="RECHARGE",e["BONUS"]="BONUS"})(R||(R={})),function(e){e["PENDING"]="PENDING",e["FAILED"]="FAILED",e["FINISH"]="FINISH",e["COMPLETED"]="COMPLETED"}(U||(U={}));const F=Object.assign({isModuleInit:0,incomeTransactions:[],expensesTransactions:[],incomeTodayTransactions:[],providentFund:null},j.reduce(((e,t)=>(e[t]=void 0,e)),{})),M={CREDIT_SET_INIT_STATE(e,t){e.isModuleInit=t},CREDIT_CLEAR_DATA(e){e.providentFund=null,j.forEach((t=>e[t]=void 0)),e.expensesTransactions=[],e.incomeTransactions=[],e.incomeTodayTransactions=[]},CREDIT_UPDATE(e,t){const n=e=>{const t={};for(const[n,o]of Object.entries(e)){let e=t;if(-1===n.indexOf("."))e[n]=o;else{const t=n.split(".");for(let n=0;nObject.keys(e).forEach((n=>{void 0!==t[n]&&(e[n]=t[n])}));let o=e.incomeTransactions.find((e=>e.id===t.id));if(o){if(n(o,t),o=e.incomeTodayTransactions.find((e=>e.id===t.id)),!o)return;n(o,t)}else{if(o=e.expensesTransactions.find((e=>e.id===t.id)),!o)return;n(o,t)}},CREDIT_UPDATE_USER(e,t){for(const[n,o]of Object.entries(t))j.includes(n)&&(e[n]=o)},CREDIT_UPDATE_INCOME(e,t){e.incomeTransactions=t},CREDIT_UPDATE_EXPENSES(e,t){e.expensesTransactions=t},CREDIT_UPDATE_INCOME_TODAY(e,t){e.incomeTodayTransactions=t}},B={CREDIT_TRANSFER({dispatch:e},{receiverSub:t,amount:n,meta:o}){return D(this,void 0,void 0,(function*(){const e=()=>{if(n=Number.parseInt(n),n>1e6)throw new Error("amount_too_large");if(n>F.credit)throw new Error("credit_not_enough_amount");if(o&&"object"!==typeof o)throw new Error("invalid_meta");o=JSON.stringify(o||{})};return e(),yield N.post("/credit/transfer",{receiverSub:t,amount:n,meta:o})}))},CREDIT_PAY_DATA_REQUEST({dispatch:e,state:t},{receiverSub:n,amount:o,meta:a}){return D(this,void 0,void 0,(function*(){if(o=Math.min(Number.parseInt(o),1e6),o>=t.credit)throw new Error("credit_not_enough_amount");return yield N.post("/dataProviding/request",{receiverSub:n,amount:o,meta:JSON.stringify(a)})}))},CREDIT_PAY_DATA_COMPLETED({dispatch:e},{transactionId:t}){return D(this,void 0,void 0,(function*(){return yield N.post("/dataProviding/complete",{transactionId:t})}))},CREDIT_PAY_DATA_FINISH({dispatch:e,rootState:t},{transactionId:n}){return D(this,void 0,void 0,(function*(){const e=window.localStorage.getItem("transaction_to_finish"),o=e?JSON.parse(e):{},a=o[t.account.sub]||[],s=a.map(((e,t)=>()=>D(this,void 0,void 0,(function*(){try{yield N.post("/dataProviding/finish",{transactionId:e}),delete a[t]}catch(n){n instanceof Error&&"Network Error"!==n.message&&delete a[t]}}))));s.push((()=>D(this,void 0,void 0,(function*(){try{yield N.post("/dataProviding/finish",{transactionId:n})}catch(e){if(!(e instanceof Error&&"Network Error"===e.message))throw e;a.push(n)}}))));try{yield Promise.all(s.map((e=>e())))}finally{o[t.account.sub]=a.filter((e=>null!==e)),window.localStorage.setItem("transaction_to_finish",JSON.stringify(o))}}))},CREDIT_PAY_DATA_CANCEL({dispatch:e},{transactionId:t}){return D(this,void 0,void 0,(function*(){return yield N.post("/dataProviding/cancel",{transactionId:t})}))},CREDIT_PF_DEPOSIT({commit:e,state:t},{amount:n,meta:o}){return D(this,void 0,void 0,(function*(){if(!t.providentFund||!1===t.providentFund.enable)return;const e=()=>{if(n=Number.parseInt(n),n>1e6)throw new Error("amount_too_large");if(n>=t.credit)throw new Error("credit_not_enough_amount");if(o&&"object"!==typeof o)throw new Error("invalid_meta");o=JSON.stringify(o||{})};return e(),yield N.post("/providentFund/deposit",{amount:n,meta:o})}))},CREDIT_PF_WITHDRAW(){return D(this,void 0,void 0,(function*(){return yield N.post("/providentFund/withdraw")}))},CREDIT_INIT_DATA({state:e,commit:t,dispatch:n,rootState:o,rootGetters:a}){return D(this,void 0,void 0,(function*(){if(e.isModuleInit)return;t(L.Mutations.CREDIT_SET_INIT_STATE,1),yield A["b"].enable(o.account.sub);const s=()=>D(this,void 0,void 0,(function*(){const e=b["a"].GQL.AwsApiGraphQL.injectAllOperations({}),n=()=>D(this,void 0,void 0,(function*(){const n=yield e.getUser(o.account.sub);t(L.Mutations.CREDIT_UPDATE,{credit:n.credit})})),a=()=>D(this,void 0,void 0,(function*(){const n=(()=>{let e=localStorage.getItem("credit.providentFund");return e?JSON.parse(e):(e={enable:!0,poolId:"12345678-1234-1234-1234-123456790ab"},localStorage.setItem("credit.providentFund",JSON.stringify(e)),e)})(),a=yield e.getProvidentFund(o.account.sub);n.value=(null===a||void 0===a?void 0:a.amount)||0,t(L.Mutations.CREDIT_UPDATE,{providentFund:n})}));yield Promise.all([n(),a()]);const s=e=>new Promise((t=>{const n=Object(A["c"])({query_type:"income"});(()=>{D(this,void 0,void 0,(function*(){while(n.hasNext())yield n.fetch(),e(n.getData());t()}))})()})),i=e=>new Promise((t=>{const n=Object(A["c"])({query_type:"expense"});(()=>{D(this,void 0,void 0,(function*(){while(n.hasNext())yield n.fetch(),e(n.getData());t()}))})()})),r=e=>new Promise((t=>{const n=()=>{const e=864e5,t=new Date,n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),o=new Date(n.getTime()+e);return[n,o]},[o,a]=n(),s=Object(A["c"])({query_type:"income",query_params:{createdAt:{oldest:o.toISOString(),latest:a.toISOString()}}});(()=>{D(this,void 0,void 0,(function*(){while(s.hasNext())yield s.fetch(),e(s.getData());t()}))})()}));Promise.all([s((e=>t(L.Mutations.CREDIT_UPDATE,{incomeTransactions:Object.values(e)}))),i((e=>t(L.Mutations.CREDIT_UPDATE,{expensesTransactions:Object.values(e)}))),r((e=>t(L.Mutations.CREDIT_UPDATE,{incomeTodayTransactions:Object.values(e)})))])}));yield s(),A["b"].addHandlers({credit_changed:n=>{var o;return t(L.Mutations.CREDIT_UPDATE,{credit:(null!==(o=e.credit)&&void 0!==o?o:0)+n})},dp_expense_txn:n=>{const o=e.expensesTransactions.find((e=>e.id===n.id));o?t(L.Mutations.CREDIT_UPDATE_TXN,n):t(L.Mutations.CREDIT_UPDATE,{expensesTransactions:[...e.expensesTransactions,n]})},dp_income_txn:n=>{const o=e.incomeTransactions.find((e=>e.id===n.id));o?t(L.Mutations.CREDIT_UPDATE_TXN,n):t(L.Mutations.CREDIT_UPDATE,{incomeTransactions:[...e.incomeTransactions,n]});const a=()=>{const e=864e5,t=new Date,n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),o=new Date(n.getTime()+e);return[n,o]},[s,i]=a();if(s.getTime()new Date(n.createdAt).getTime()){const o=e.incomeTodayTransactions.find((e=>e.id===n.id));o?t(L.Mutations.CREDIT_UPDATE_TXN,n):t(L.Mutations.CREDIT_UPDATE,{incomeTodayTransactions:[...e.incomeTodayTransactions,n]})}},pf_value_changed:n=>{var o,a;return t(L.Mutations.CREDIT_UPDATE,{"providentFund.value":(null!==(a=null===(o=e.providentFund)||void 0===o?void 0:o.value)&&void 0!==a?a:0)+n})},pf_deposit_txn:n=>t(L.Mutations.CREDIT_UPDATE,{expensesTransactions:[...e.expensesTransactions,n]}),pf_withdraw_txn:n=>t(L.Mutations.CREDIT_UPDATE,{incomeTransactions:[...e.incomeTransactions,n]})},s),A["a"].enable({rootState:o,rootGetters:a,dispatch:n}),t(L.Mutations.CREDIT_SET_INIT_STATE,2)}))},CREDIT_CLEAR_DATA({commit:e,state:t}){return D(this,void 0,void 0,(function*(){2===t.isModuleInit&&(e(L.Mutations.CREDIT_SET_INIT_STATE,1),yield A["b"].disable(),yield A["a"].disable(),e(L.Mutations.CREDIT_CLEAR_DATA),e(L.Mutations.CREDIT_SET_INIT_STATE,0),console.log("credit data cleared"))}))}},Q={transactions(e){const{incomeTransactions:t,expensesTransactions:n}=e;return{income:t,expenses:n}},incomeTodayTransactions(e){return e.incomeTodayTransactions}},W={namespaced:!1,state:F,mutations:M,actions:B,getters:Q};var z=W,H=n("508e"),V=n.n(H),G=n("fb31"),K=n.n(G),Y={hideMenu:!0,autoHide:!1,language:"en-US",darkMode:"system",defaultVideoPlayer:K.a.fileName,videoCacheTime:1,autoLaunch:!1,restore:!0,autoStartUnfinished:!0,seedSharingRate:!0,seedTime:!1,maximumDownloadNum:5,maximumConnectionsNum:20,saveLinkSeed:!1,unlimited:!0,continuousSeeding:!0,breakpointContinuation:!1,autoJumpToDownload:!0,notifyAfterDownloaded:!1,deleteConfirm:!1,defaultDeleteFiles:!1,uploadSpeed:-1,downloadSpeed:-1,payedUserShareRate:.7,downloadDirectory:"",autoUpload:!1,uploadDirectory:"",unlimitUploadAmount:!1,autoCheckUpdate:!0,useProxyService:!0,trackerSource:[{value:"https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt",label:"ngosang_best",cdn:!1},{value:"https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best_ip.txt",label:"ngosang_best_ip",cdn:!1}],trackerList:V.a.trackerList,autoUpdateTrackerServiceList:!0,trackerLastUpdateTime:"",listenPort:!1,BTlistenPort:21303,DHTlistenPort:26701,secureOption:"auto",bindMagnetUrl:!1,bindTorrentFile:!1,bindVideoFile:!1,bindVideoExts:{mp4:!1,mkv:!1,avi:!1,mov:!1,wmv:!1,rmvb:!1,flv:!1,webm:!1},bindAudioExts:{mp3:!1,wav:!1,aac:!1,flac:!1,m4a:!1,wma:!1},bindAudioFile:!1,dontAskForAssociate:!1,dontAskForPlayer:!1,userAgent:"",RPCauthorizationkey:"",versionChannel:"stable",githubPAT:"",lastUpdateCheckTime:Date.now(),disableDevTools:!0,minDiskSpace:512e6,autoDownload:!0,forceLogin:!0,libraryShowExplore:"remote",libraryRate:"G",libraryShowAllChannels:!1,libraryPreload:!0,showPreload:!1,downloadWithCellular:!1},J=n("3fd2"),X=n.n(J),Z=n("0f0c"),ee=n("908d"),te=n("d558"),ne=n("d710"),oe=n.n(ne),ae=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const se=Object(Z["a"])("version"),ie=!se.match(/(internal|web)-dev$/),re=X.a.renderer(),le=`${oe.a.name}_settings`,ce=_e(),de={UPDATE_SETTINGS(e,t){Object.assign(e,t),localStorage.setItem(le,JSON.stringify(e))}},ue={updateSettings({commit:e},t){e("UPDATE_SETTINGS",t)},fetchSettings({dispatch:e}){return ae(this,void 0,void 0,(function*(){if(Object(te["a"])())return new Promise((t=>{const n=localStorage.getItem(le),a={};a&&(Object.assign(a,JSON.parse(n)),t(JSON.parse(n))),y["a"].once("fetch-settings",(n=>ae(this,void 0,void 0,(function*(){yield e("updateSettings",n),console.log("Fetch from server");for(const e in n)o["a"].set(a,e,n[e]);t(a)})))),y["a"].emit("fetch-settings")}));if(!re){const t=localStorage.getItem(le),n=_e();return t||(ee["b"].is.capacitor&&(n.forceLogin=!1),console.log("\n\n\n\n\n\n\n\n\n\n\n\nset web settings:",n)),yield e("updateSettings",n),n}const t=yield Promise.resolve().then(n.t.bind(null,"b052",7)).then((e=>e.ipcRenderer.invoke("get-app-settings")));return yield e("updateSettings",t),t}))},set({dispatch:e,state:t},o){return ae(this,void 0,void 0,(function*(){if(Object(a["isEmpty"])(o))return;if(yield e("updateSettings",o),!re)return y["a"].emit("updateSettings",o);const{ipcRenderer:t}=yield Promise.resolve().then(n.t.bind(null,"b052",7));console.log("set settings");const s=new Promise((e=>{t.once("set_settings_success",((t,n)=>{e(n)}))}));return t.send("set_settings",o),s}))},resetSettings({commit:e,dispatch:t}){if(re)return new Promise((t=>ae(this,void 0,void 0,(function*(){const{ipcRenderer:o}=yield Promise.resolve().then(n.t.bind(null,"b052",7));o.once("reset_settings",((n,o)=>{console.log(o),e("UPDATE_SETTINGS",o),t(o)})),o.send("reset_settings")}))));{const t=Object(a["cloneDeep"])(Y);return e("UPDATE_SETTINGGS",t),t}}},he={settings(e){return e},isDevMode(e){return!e.disableDevTools||!ie}},pe={namespaced:!1,state:ce,mutations:de,actions:ue,getters:he};var me=pe;function _e(){const e=Object(a["cloneDeep"])(Y),t=`${oe.a.name}_settings`,n="undefined"===typeof localStorage?null:localStorage.getItem(t);if(n){const t=JSON.parse(n);Object.assign(e,t)}return e}const fe={currentVideo:{pipStatus:!1,updatePlayer:!1,url:"",path:"",currentTime:0}},ge={CURRENT_VIDEO_URL_MUTATION(e,t){e.currentVideo.url=t},CURRENT_VIDEO_PATH_MUTATION(e,t){e.currentVideo.path=t},CURRENT_VIDEO_SUBTITLE_LIST_MUTATION(e,t){e.currentVideo.subtitleList=t},CURRENT_VIDEO_CURRENT_TIME_MUTATION(e,t){e.currentVideo.currentTime=t},UPDATE_VIDEO_STATUS_MUTATION(e,t){e.currentVideo.status=t},UPDATE_VIDEO_PIP_STATUS_MUTATION(e,t){e.currentVideo.pipStatus=t},UPDATE_VIDEO_UPDATE_PLAYER_MUTATION(e,t){e.currentVideo.updatePlayer=t},SET_REMOTE_PLAY(e,t){e.currentVideo.infoHash=t,e.currentVideo.remotePlay=!0},RESET_INFOHASH(e){e.currentVideo.infoHash=""},RESET_REMOTE_PLAY(e){e.currentVideo.remotePlay=!1},RESET_PLAYER(){fe.currentVideo={pipStatus:!1,updatePlayer:!1,url:"",path:"",currentTime:0,subtitleList:[]}}},be={currentVideoUrl({commit:e},t){e("CURRENT_VIDEO_URL_MUTATION",t)},currentVideoPath({commit:e},t){e("CURRENT_VIDEO_PATH_MUTATION",t)},currentVideoSubtitleList({commit:e},t){e("CURRENT_VIDEO_SUBTITLE_LIST_MUTATION",t)},currentVideoCurrentTime({commit:e},t){e("CURRENT_VIDEO_CURRENT_TIME_MUTATION",t)},updateVideoStatus({commit:e},t){e("UPDATE_VIDEO_STATUS_MUTATION",t)},updateVideoPIPStatus({commit:e},t){e("UPDATE_VIDEO_PIP_STATUS_MUTATION",t)},updatePlayer({commit:e},t){e("UPDATE_VIDEO_UPDATE_PLAYER_MUTATION",t)},remotePlay({commit:e},t){e("SET_REMOTE_PLAY",t)},resetInfoHash({commit:e}){e("RESET_INFOHASH")},resetRemotePlay({commit:e}){e("RESET_REMOTE_PLAY")},resetPlayer({commit:e}){e("RESET_PLAYER")}},ye={video(){return fe.currentVideo.url}},ve={namespaced:!1,state:fe,mutations:ge,actions:be,getters:ye};var we=ve,ke=n("5fa3");t["a"]={downloader:p,account:E,credits:z,setting:me,video:we,library:ke["a"]}},"7ad0":function(e,t,n){},"7d7c":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return C}));n("a1c1"),n("7a76");var o=n("c620"),a=n("f680"),s=n("61a1"),i=n("1926"),r=n("5584"),l=n("eb7a"),c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page",{staticStyle:{position:"relative"}},[n("input",{ref:"file",staticStyle:{display:"none"},attrs:{id:"media-file-upload",type:"file","data-cy":"file-input"},on:{input:e.manualAddFile}}),n("input",{ref:"subtitle",staticStyle:{display:"none"},attrs:{type:"file",accept:".srt,.vtt"},on:{input:e.manualAddSubtitle}}),n("div",{attrs:{id:"video-container",lang:e.lang}},[n("video",{ref:"video",staticClass:"video-js vjs-default-skin vjs-16-9 vjs-big-play-centered vjs-fluid",staticStyle:{height:"100%"},attrs:{crossorigin:"anonymous",id:"my-video"}})]),n("audio-info",{attrs:{show:e.isAudio}}),n("video-splash",{attrs:{show:e.showSplash,videoLoadingHint:e.videoLoadingHint}}),n("advanced-options",{attrs:{show:e.showAdvancedOptions,advancedOptions:e.advancedOpt},on:{close:function(){return e.toggleAdvancedOptions(!1)}}})],1)},d=[],u=n("5653"),h=u["a"],p=(n("803a"),n("2b5f")),m=n("9b72"),_=n("f106"),f=n("09a4"),g=n.n(f),b=Object(p["a"])(h,c,d,!1,null,null,null);b.exports;g()(b,"components",{QPage:m["a"],QIcon:_["a"]});var y=n("6422");const v=()=>{const e=l["default"].getAllPlayers();return Array.isArray(e)?e[0]:null},w=()=>{const e=()=>(o["wtClient"].torrents[0]&&o["wtClient"].torrents[0].files&&o["wtClient"].torrents[0].files.forEach((e=>{e._serviceWorker&&"activated"===e._serviceWorker.state||(e._serviceWorker=o["wtClient"].serviceWorker)})),!0);if(o["wtClient"].serviceWorker&&"activated"===o["wtClient"].serviceWorker.state){if("activated"===o["wtClient"].serviceWorker.state)return e();o["wtClient"].serviceWorker=null}if(!navigator.serviceWorker||!navigator.serviceWorker.controller)return!1;const t=navigator.serviceWorker.controller;return"activated"===t.state&&(o["wtClient"].loadWorker(t),e())};let k=null;function C(e){if("string"===typeof e&&e.startsWith("/webtorrent/")&&(e=e.replace("/webtorrent/","")),u["b"].toggleSplash(!1),!w())return void a["a"].create(i["b"].t("service_worker_error"));if(!o["wtClient"].torrents[0])return void a["a"].create(i["b"].t("add_task_first"));let t=!1;const n=Date.now();Object(s["b"])().push({name:"Player",params:{action:{type:"play_remote"}}}),k&&clearInterval(k),u["b"].toggleSplash(!0,i["b"].t("loading")),k=setInterval((async()=>{if(t)return;if(Date.now()-n>3e4&&!o["wtClient"].torrents[0].ready)return u["b"].toggleSplash(!1),a["a"].create(i["b"].t("player_task_time")),void clearInterval(k);if(o["wtClient"].torrents[0]&&!o["wtClient"].torrents[0].files[0])return void u["b"].toggleSplash(!0,i["b"].t("loading"));{const e=o["wtClient"].torrents[0].files[0],t=Object(y["a"])(e.downloaded||0),n=Object(y["a"])(e.length||0),a=`(${t}/${n})`;if(u["b"].toggleSplash(!0,i["b"].t("downloading")+"... "+a),o["wtClient"].torrents[0].pieces[e._startPiece]||o["wtClient"].torrents[0].pieces[e._startPiece+1])return void console.log("Wait for first two pieces downloaded")}const s=document.querySelector("#my-video video");if(!s)return;try{const n=v();if(e||(e=o["wtClient"].torrents[0].files[0].path),4===n.readyState()){const t=`${location.origin}/webtorrent/${o["wtClient"].torrents[0].infoHash}/${encodeURI(e)}`;if(console.log(t,n.src(),t===n.src()),n.src()!==t)throw n.hasStarted(!1),new Error("Reset since src changed");return console.log(n.readyState(),"ready"),n.setAttribute("muted",!0),n.setAttribute("playsInline",!0),n.setAttribute("autoplay",!1),u["b"].toggleSplash(!1),void clearInterval(k)}if(t)return}catch(c){console.log("cannot get vjs",c)}if(t)return;const l=o["wtClient"].torrents[0].files.find((t=>e===t.path));if(s.setAttribute("playsInline",!0),s.setAttribute("muted",!0),s.setAttribute("autoplay",!1),l){console.log("Play file",e,l);const t=`${location.origin}/webtorrent/${o["wtClient"].torrents[0].infoHash}/${encodeURI(l.path||l.name)}`;r["a"].commit("CURRENT_VIDEO_URL_MUTATION",t),r["a"].commit("UPDATE_VIDEO_UPDATE_PLAYER_MUTATION",!0),setTimeout((()=>{const e=v();e&&4===e.readyState()&&e.paused()&&a["a"].create(i["b"].t("autoplay_hint"))}),3e3)}else{const e=o["wtClient"].torrents[0].files[0];console.log("Cannot find same file. Use files[0]",e.path);const t=`${location.origin}/webtorrent/${o["wtClient"].torrents[0].infoHash}/${encodeURI(e.path||e.name)}`;r["a"].commit("CURRENT_VIDEO_URL_MUTATION",t),r["a"].commit("UPDATE_VIDEO_UPDATE_PLAYER_MUTATION",!0),setTimeout((()=>{const e=v();e&&4===e.readyState()&&e.paused()&&a["a"].create(i["b"].t("autoplay_hint"))}),3e3)}u["b"].toggleSplash(!1),t=!0}),1e3)}},8:function(e,t){},"803a":function(e,t,n){"use strict";n("525c")},8097:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("3fd2"),a=n.n(o),s=n("0f0c"),i=n("d558");function r(){if(Object(i["a"])())return!0;const e=Object(s["a"])("packageFormat");return a.a.mas()||a.a.windowsStore()||e&&"snap"===e}},"80cf":function(e,t,n){"use strict";var o=n("eb7a"),a=n("d7df"),s=n("5584"),i=n("1926"),r=n("61a1"),l=n("8750"),c=n("f680"),d=n("3d18");console.log("utils io CLIENT"),console.log("-utils io CLIENT"),a["a"].on("warning",(e=>{c["a"].create({message:e})})),a["a"].on("client_error",(e=>{c["a"].create({message:e})})),a["a"].on("request_unlimit_upload",(()=>{const e=Object(r["b"])();e&&"/settings"!==e.currentRoute.path&&"/advancedSettings"!==e.currentRoute.path&&l["a"].create({title:i["b"].t("upload_too_many_files"),message:i["b"].t("ask_if_unlimit_upload_amount"),ok:i["b"].t("disable_limitation"),cancel:i["b"].t("not_now")}).onOk((()=>{a["a"].emit("unlimit_upload_amount")}))})),a["a"].on("torrent_error",(({token:e,message:t})=>{const n=Object(r["b"])();n&&"/"===n.currentRoute.path&&c["a"].create({message:i["b"].t("torrent_error"),caption:[i["b"].t(t),e].join("\n"),multiLine:!0,timeout:0,closeBtn:i["b"].t("close")})})),a["a"].on("torrent_seed_error",((e,t)=>{e.missFile&&(console.log(e,t),l["a"].create({title:i["b"].t("miss_file"),message:i["b"].t("delete_miss_file_task",[e.name]),ok:i["b"].t("delete_task"),cancel:i["b"].t("cancel")}).onOk((()=>{a["a"].emit("delete_torrent",e.infoHash)})))})),a["a"].on("delete-files-failed",((e,t)=>{console.log("delete failed",e,t),l["a"].create({title:i["b"].t("failed_to_delete_files"),message:i["b"].t("failed_to_delete_files")})})),a["a"].on("autoupload-start",(()=>{s["a"].commit("DOWNLOADER_SET_UPLOADING_LOADING",!0)})),a["a"].on("autoupload-complete",(()=>{s["a"].commit("DOWNLOADER_SET_UPLOADING_LOADING",!1)})),a["a"].on("torrent_exists",(e=>(console.log("exist",e),c["a"].create(i["b"].t("torrent_exists")+e)))),a["a"].on("stop-server",(()=>{s["a"].dispatch("resetRemotePlay"),s["a"].state.video.currentVideo.shouldReset=!0})),a["a"].on("open-default-player",(async e=>{s["a"].dispatch("resetRemotePlay"),s["a"].dispatch("resetInfoHash"),s["a"].dispatch("currentVideoUrl",""),s["a"].dispatch("currentVideoPath",""),console.log("open-default-player:"+e);const t=o["default"].getPlayer("my-video"),n=s["a"].state.video.currentVideo.pipStatus;if(t&&n)try{console.log("跳转默认播放器,关闭画中画"),t.exitPictureInPicture()}catch(r){}const a=await Object(d["b"])(s["a"].getters.settings.defaultVideoPlayer,e);!0!==a&&""!==a&&c["a"].create(i["b"].t("open_default_player_failed"))})),a["a"].on("jump-to-player",(()=>{const e=Object(r["b"])();e&&e.push({name:"Player",params:{action:{type:"play_remote"}}})})),a["a"].on("finish_all_payments_by_infohash",(e=>{if("string"!==typeof e)return console.log(`No info hash to finish ${e}`);const t=s["a"].getters.accountUserInfo.sub;if(!t)return console.log(`Cannot find sub id from ${s["a"].getters.accountUserInfo}`);const n=s["a"].state.credits.expensesTransactions.filter((n=>n.payerId===t&&"FINISH"!==n.status&&n.meta.includes(e)));console.log("Will finish",n),a["a"].emit("finish_all_payments",n)}))},"80f4":function(e,t,n){},8162:function(e,t,n){},"81a4":function(e,t,n){},"81e0":function(e,t,n){n("7a76"),n("0c26"),n("de6c");const o=e=>{const t=`Failed to validate app config: ${e}`,n=new Error(t);throw n.stack=n.stack.trim().split("\n")[0],n},a=["application.manifest","application.reference","batfile","blob","cerfile","chm.file","cmdfile","comfile","cplfile","dllfile","drvfile","exefile","explorer.assocactionid.burnselection","explorer.assocactionid.closesession","explorer.assocactionid.erasedisc","explorer.assocactionid.zipselection","explorer.assocprotocol.search-ms","explorer.burnselection","explorer.closesession","explorer.erasedisc","explorer.zipselection","file","fonfile","hlpfile","htafile","inffile","insfile","internetshortcut","jsefile","lnkfile","microsoft.powershellscript .1","ms-accountpictureprovider","ms-appdata","ms-appx","ms-autoplay","msi.package","msi.patch","ms-windows-store","ocxfile","piffile","regfile","scrfile","scriptletfile","shbfile","shcmdfile","shsfile","smb","sysfile","ttffile","unknown","usertileprovider","vbefile","vbsfile","windows.gadget","wsffile","wsfile","wshfile"];e.exports=function(e){e&&"object"===typeof e||o("config is not an object");for(const t of["name","displayName","author","developer","description","publisher","homepage","upgradeCode","protocol","shortProtocol"])t in e&&"string"===typeof e[t]||o(`config.${t} must be string`);e.name.match(/^[a-zA-Z0-9.\-+]{3,}/)||o("config.name should contain at least 3 characters"),e.protocol.match(/^[a-z][a-z0-9.\-+]{2,}/)||o("config.protocol should contain at least 3 characters, start with lower-case letter(a-z) and not include upper-case letters"),a.includes(e.protocol)&&o(`The protocol "${e.protocol}" is not available since it is reserved by Windows Store`),e.shortProtocol.match(/^[a-z][a-z0-9.\-+]{1,}/)||o("config.shortProtocol should contain at least 2 characters, start with lower-case letter(a-z) and not include upper-case letters"),a.includes(e.shortProtocol)&&o(`The protocol "${e.shortProtocol}" is not available since it is reserved by Windows Store`),e.name.toLowerCase()===e.shortProtocol&&o("config.shortProtocol should not be same as config.name"),e.protocol===e.shortProtocol&&o("config.shortProtocol should not be same as config.protocol"),e.protocol===e.shortProtocol&&o("config.shortProtocol should not be same as app name"),e.register&&"object"===typeof e.register||o("config.register should be object"),"whitelist"===e.register.mode&&(Array.isArray(e.register.list)&&0!==e.register.list.length||o('config.register.list should be array with at least one country code since register mode is "whitelist"'))}},8306:function(e,t,n){},8460:function(e,t,n){"use strict";n("91fe")},"848e":function(e,t,n){},"84cb":function(e,t,n){"use strict";n("afe1")},"84f6":function(e,t,n){"use strict";n("de6c"),n("a1c1");var o=n("ff9b"),a=n("d7df"),s=n("5584"),i=n("8750"),r=n("1926"),l=n("0885"),c=n("a11f"),d=n("4fd2");const u=e=>new Promise((t=>{const n=window.requestIdleCallback?window.requestIdleCallback:e=>setTimeout(e,100);n((()=>{t(e())}))})),h=new o["a"]({data(){return{taskList:{downloading:[],uploading:[],downloaded:[],totalDownloadSpeed:0,totalUploadSpeed:0,totalDownloadProgress:0},updatingTaskList:!1,lastUpdateTime:Date.now()}},computed:{allTasks(){return[...this.taskList.downloading,...this.taskList.uploading,...this.taskList.downloaded]}},methods:{async updateTaskList(e){if(this.updatingTaskList)console.log("Skip updating task list since busy");else{this.updatingTaskList=!0,await this.$nextTick();const t={},n=[],o={};for(const a in e){const s=e[a];if(!Array.isArray(s)){this.taskList[a]=s;continue}await u((()=>{s.forEach((e=>{Array.isArray(e.files)&&e.files.forEach((e=>{e.path.endsWith(".downloading")&&(e.path=e.path.replace(/\.downloading$/,"")),e.name.endsWith(".downloading")&&(e.name=e.name.replace(/\.downloading$/,""))}))})),this.taskList[a]=s})),t[a]=s.length;const i=[];s.forEach((e=>{"uploading"===a&&n.push({title:e.postTitle||e.name,abUrl:e.alphabizURI});const t={};if(e.infoHash){var o;t.start=(new Date).getTime(),t.getABKey=(new Date).getTime();const n=Object(c["a"])(e.alphabizURI||e.magnetURI||e.infoHash);t.playFile=(new Date).getTime();const a=null===(o=e.files)||void 0===o?void 0:o.find((e=>1===e.progress&&Object(d["a"])(e.path)));i.push({key:n,infoHash:e.infoHash,...a?{playFile:a}:{}}),t.end=(new Date).getTime()}})),o[a]=i}Object.freeze(e),s["a"].commit("updateTasks",{tasksCount:t,uploadingTasks:n,abKeyObj:o}),await this.$nextTick(),this.updatingTaskList=!1}},deleteTask(e){const t=[];return s["a"].getters.settings.defaultDeleteFiles&&t.push("deleteFiles"),console.log("to del",e),new Promise((n=>{if(e.isAutoUpload)return i["a"].create({title:r["b"].t("delete")+" "+(e.postTitle||e.name),message:r["b"].t("delete_autoupload_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:r["b"].t("delete_anyway")},cancel:{textColor:"grey",color:"unset",flat:!0,label:r["b"].t("not_now")}}).onOk((()=>{console.log("Delete autoupload file",e),a["a"].emit("delete_torrent",e.infoHash,!0),n(!0)})).onCancel((()=>{n(!1)}));if(e.missAllFile)return a["a"].emit("delete_torrent",e.infoHash,!0),n(!0);const o=e.postTitle||e.name||e.origin||e.infoHash||"",c=o.length>20?o.substring(0,18)+"...":o;i["a"].create({title:r["b"].t("delete")+" "+c,style:"white-space:pre-wrap;word-break:break-all",message:r["b"].t("delete_confirm_message"),options:{type:"checkbox",model:t,items:[{label:r["b"].t("also_delete_files"),value:"deleteFiles"}]},ok:{textColor:"red",color:"unset",flat:!0,label:r["b"].t("delete")},cancel:{textColor:"grey",color:"unset",flat:!0,label:r["b"].t("not_now")}}).onOk((t=>{a["a"].emit("delete_torrent",e.infoHash||e.token,t.includes("deleteFiles")),s["a"].dispatch("set",{defaultDeleteFiles:t.includes("deleteFiles")}),Object(l["c"])(e.infoHash,!1),n(!0)})).onCancel((()=>{n(!1)}))}))},onDeleteTask(e){for(const t in this.taskList){const n=h[t];if(!Array.isArray(n))continue;const o=n.findIndex((t=>t.infoHash===e));-1!==o&&n.splice(o,1)}}}});t["a"]=h},"860f":function(e,t,n){"use strict";n("4544")},"86d7":function(e,t,n){"use strict";n("6545")},"878c":function(e,t,n){"use strict";n("9e9b")},"88f5":function(e,t,n){"use strict";n("0f74")},"899b5":function(e,t,n){"use strict";n("81a4")},"89d2":function(e,t,n){"use strict";n("95db")},"8a63":function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"f",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return _})),n.d(t,"e",(function(){return f})),n.d(t,"g",(function(){return g})),n.d(t,"h",(function(){return b})),n.d(t,"a",(function(){return y}));n("a1c1"),n("7a76");var o=n("d7df"),a=n("5584"),s=n("1926"),i=n("8750"),r=n("f680"),l=n("84f6"),c=n("d310"),d=n("d558");setTimeout((()=>{o["a"].on("torrent_list",(e=>{l["a"].updateTaskList(e)})),o["a"].on("torrent_delete",(e=>{console.log("deleted",e),l["a"].onDeleteTask(e)})),o["a"].on("torrent_error",(e=>{console.log("torrent error",e);const t=e.torrent||{},n=t.postTitle||t.name||t.infoHash||e.token;r["a"].create({message:s["b"].t("torrent_error")+" "+n,caption:s["b"].t(e.message),group:e.message})}))}),1e3);const u=()=>{const e=a["a"].getters.settings;return{downloadDirectory:e.downloadDirectory,uploadSpeed:e.uploadSpeed,downloadSpeed:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,payedUserShareRadix:e.payedUserShareRadix,trackers:e.trackerList||[],saveLinkSeed:e.saveLinkSeed,defaultVideoPlayer:e.defaultVideoPlayer}};function h(e,t){const n="string"===typeof t?t:(null===t||void 0===t?void 0:t.path)||(null===t||void 0===t?void 0:t[0].path);if(!n)return;let a=0;const s=n.startsWith("ab://")?n.replace(/^ab:\/\//,(()=>"alphabiz://alphabiz-task-"+a++)):n;o["a"].emit("download_torrent",{type:e,url:s,file:s,token:crypto.randomUUID(),...u()})}function p(e,t){console.log("pause torrent",e);const n=l["a"].taskList.downloaded.find((t=>t.infoHash===e));if(!n)return o["a"].emit("pause_torrent",e);const a=e=>{var n,o;const a=t.dp$expenseHashMapper[e];if(!a)return;const s=null===(n=t.dp$expenseStatusMapper.PENDING)||void 0===n?void 0:n.filter((e=>a.includes(e))),i=null===(o=t.dp$expenseStatusMapper.COMPLETED)||void 0===o?void 0:o.filter((e=>a.includes(e)));s&&s.forEach((e=>{console.log("dp$cancel from pauseTorrent",e),t.dp$cancel(e).catch((t=>{console.log("dp$cancel failed:",e,t.code,t.message)}))})),i&&i.forEach((e=>{console.log("dp$confirm from pauseTorrent",e),t.dp$confirm(e)}))};return i["a"].create({title:s["b"].t("pause"),message:s["b"].t("pause_all_finish_payments"),ok:{textColor:"red",color:"unset",flat:!0,label:s["b"].t("pause")},cancel:{textColor:"grey",color:"unset",flat:!0,label:s["b"].t("cancel")}}).onOk((()=>{try{a(e)}catch(t){console.log("dp$pause failed:",t.message)}o["a"].emit("pause_torrent",e)}))}function m(e=!1){if(e&&!a["a"].getters.settings.autoStartUnfinished&&!Object(d["a"])())return console.log("Skip auto download all");const t=l["a"].taskList.downloading.filter((t=>(!e||!t.pausedByUser)&&t.paused)).sort(((e,t)=>{const n=e.createdTime-t.createdTime;return isNaN(n)?0:n}));return console.log("[DownloadAll] resume",t),o["a"].emit("resume-all",t),new Promise((e=>{o["a"].once("resume-all",e)}))}function _(e=!1){o["a"].emit("pause_all",e),setTimeout((()=>{o["a"].emit("pause_all",e)}))}function f(e=!1){const t=l["a"].taskList.uploading;if(!t.length)return;const n=t.filter((e=>!e.infoHash&&!e.isPreload&&!e.files));if(n.length)return e&&(n.forEach((e=>{o["a"].emit("delete_torrent",e.token,!1)})),setTimeout((()=>o["a"].emit("pause_all_uploading",e)),1e3)),i["a"].create({message:s["b"].t("some_task_not_ready"),ok:{textColor:"red",color:"unset",flat:!0,label:s["b"].t("remove")},cancel:{textColor:"grey",color:"unset",flat:!0,label:s["b"].t("cancel")}}).onOk((()=>{n.forEach((e=>{e.infoHash||o["a"].emit("delete_torrent",e.token,!1)})),setTimeout((()=>o["a"].emit("pause_all_uploading",e)),1e3)}));o["a"].emit("pause_all_uploading",e)}function g(e,t){const n=Array.isArray(e)?e:[e],a=n.map((e=>e?"string"===typeof e?e:"string"===typeof e.path?e.path:null:null)).filter((e=>e));if(!a.length&&Object(c["isElectron"])())throw new Error(`Cannot upload file ${e}: cannot get file path`);o["a"].emit("seed_torrent",{file:a,token:t||crypto.randomUUID(),...u()})}function b(e=!1){if(!l["a"].taskList.downloaded)return 0;const t=l["a"].taskList.downloaded.filter((t=>(!e||!t.pausedByUser)&&(!t.missAllFile&&!t.missFile)));if(!t.length)return console.log("skip upload all since nothing to upload"),l["a"].taskList.downloaded.length;const n=l["a"].taskList.downloaded.length-t.length;return o["a"].emit("seed_torrents",t),n}async function y(){a["a"].getters.settings.autoStartUnfinished?"signedIn"===a["a"].state.account.authState?(console.log("prepare download all"),await m(!0),b(!0)):console.log("User is not logged in",a["a"].getters.accountUserInfo.authState):console.log("User disabled auto restart")}},"8dc9":function(e,t,n){},"8f79":function(e,t,n){},"8fd4":function(e,t,n){},9:function(e,t){},"91fe":function(e,t,n){},9344:function(e,t,n){"use strict";n("1278")},9369:function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return c}));n("7a76"),n("de6c"),n("f200");var o=n("5584"),a=n("36a1"),s=n("072b");function i(e){return!!e||this.$t("account_is_required")}function r(e){return s["d"].call(this,e)}function l(e){return this.$alphabiz.dialog({progress:null===e||void 0===e||e,ok:!1})}async function c(e,t={}){const{mode:n,password:a,keyName:s}=t,i=await o["a"].dispatch("syncKeychainState");i[s]?await o["a"].dispatch("updateKeychainCloud",{keyName:s,mode:n,password:a,keyObj:e}):await o["a"].dispatch("createKeychainCloud",{keyName:s,mode:n,password:a,keyObj:e}),await o["a"].dispatch("syncKeychainState")}async function d(e,t){const n=async()=>{var e;if(!a["a"].user||null===(e=a["a"].user._)||void 0===e||!e.sea)throw new Error("current_lib_key_does_not_exist");const t=a["a"].user._.sea;if(["epriv","epub","priv","pub"].some((e=>!t[e])))throw new Error("invalid_key");return t},s={lib:await n()},i=Object.keys(s).map((n=>c.call(this,s[n],{mode:e,password:t,keyName:n})));await Promise.all(i),await o["a"].dispatch("syncKeychainState")}t["b"]={beforeCreate(){if(!["StatusBanner","ChangePassword"].includes(this.$options.name))throw new Error(`Unsupported Component: ${this.$options.name}`)},methods:{async keychain$changePassword(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=async e=>{const t={oldPassword:{type:"password",model:"",label:this.$t("account_current_password"),rules:[i.bind(this),r.bind(this)]},password:{type:"password",model:"",label:this.$t("account_new_password"),rules:[i.bind(this),r.bind(this),e=>t.oldPassword.model!==e||this.$t("invalid_password_format_same")]},reEnterPassword:{type:"password",model:"",label:this.$t("account_re_enter_password"),rules:[e=>t.password.model===e||this.$t("account_password_not_equal")]}},n=this.$alphabiz.dialog({title:this.$t("change_password"),message:o["a"].getters.keychainState.unset?this.$t("independent_password_not_enabled"):void 0,cancel:!0,prompts:t,ok:t=>t.dialog$useLoadingState("ok",(async()=>{const{prompts:n}=t.dialog$arguments();await e(t,n.oldPassword,n.password)}))});await n.promise()};await n((async(n,a,s)=>{try{await o["a"].dispatch("changeKeychainPassword",{oldPassword:a,password:s}),await o["a"].dispatch("syncKeychainState"),t(),n.hide()}catch(i){e(i.message)}}))},async keychain$enableCloudStorage(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=()=>{try{var t;if(!a["a"].user||null===(t=a["a"].user._)||void 0===t||!t.sea)throw new Error("Please login first")}catch(n){e(n.message)}};n();const s=l.call(this,this.$t("loading_keychain_state")),c=await o["a"].dispatch("syncKeychainState").finally(s.hide),u=async e=>{const t={password:{type:"password",label:this.$t("account_password"),model:"",rules:[i.bind(this),r.bind(this)]},reEnterPassword:{type:"password",model:"",label:this.$t("account_re_enter_password"),rules:[e=>t.password.model===e||this.$t("account_password_not_equal")]}},n=this.$alphabiz.dialog({title:this.$t("input_independent_password"),prompts:t,cancel:!0,ok:t=>t.dialog$useLoadingState("ok",(()=>e(t,t.dialog$arguments().prompts.password)))});await n.promise()};if(c.hash&&c.unset){const n=async e=>{const t={};t.use_cognito_hash={color:"primary",textColor:"primary",label:this.$t("use_cognito_hash"),handler:t=>t.dialog$useLoadingState("use_cognito_hash",(()=>e(t,"cognito_hash")))},t.use_independent_password={label:this.$t("use_independent_password"),handler:t=>t.dialog$useLoadingState("use_independent_password",(()=>e(t,"independent_password")))};const n=this.$alphabiz.dialog({title:this.$t("enable_cloud_storage"),message:this.$t("enable_cloud_storage_prompt_password"),cancel:!0,ok:!1,actions:t});await n.promise()};await n((async(n,o)=>{if("independent_password"===o)await u((async(a,s)=>{try{await d.call(this,o,s),t(),a.hide(),n.hide()}catch(i){e(i.message)}}));else if("cognito_hash"===o)try{await d.call(this,o,void 0),t(),n.hide()}catch(a){e(a.message)}}))}else await u((async(n,o)=>{try{await d.call(this,"independent_password",o),t(),n.hide()}catch(a){e(a.message)}}))},async keychain$disableCloudStorage(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=async e=>{let t=5;const n=()=>({label:t?`${this.$t("disable_cloud_storage")} (${t})`:this.$t("disable_cloud_storage"),disable:!!t,color:"negative",textColor:"negative",handler:t=>t.dialog$useLoadingState("ok",e)}),o=this.$alphabiz.dialog({title:this.$t("disable_cloud_storage"),message:this.$t("disable_cloud_storage_desc"),cancel:!0,ok:n()}),a=setInterval((()=>{t>0?t-=1:clearInterval(a),o.update({ok:n()})}),1e3);await o.promise()};await n((async n=>{try{await new Promise((e=>setTimeout(e,1e3))),await o["a"].dispatch("disableKeychainCloud"),await o["a"].dispatch("syncKeychainState"),t(),n.hide()}catch(a){e(a.message)}}))}}}},"937c":function(e,t){e.exports={remote:{url:"https://alpha.biz/app/remote_config"},local:{type:"local",version:"default:v1",oauth:{enable:!1,providers:["Github","Twitter"]},library:{show_explore:!1},update:{enable:!1}}}},"93e8":function(e,t,n){"use strict";n("981d")},9445:function(e){e.exports=JSON.parse('{"users":[{"_comment":"You should use pubkey as id here. See take-down.js for more info.","id":"a_pubkey_of_user","reason":"Serious Violation"}],"channels":[{"id":"an_id_of_channel","reason":"Copyright Disputes"}],"posts":[{"id":"an_id_of_post","reason":"Adults Only"}]}')},9572:function(e,t,n){"use strict";(function(e){n("7a76"),n("d4b5"),n("de6c");var o=n("02fe"),a=n.n(o);const s=({encryptor:t,decryptor:n,randomHex:o,pbkdf2:a})=>{const s=e=>{if(64!==e.length)throw new Error("Invalid password length")},i=(n,o)=>{const s=a(o.password,o.salt,1e3,32);return t(n,s,e.from(o.iv,"hex"))},r=(t,o)=>{const s=a(o.password,o.salt,1e3,32);return n(t,s,e.from(o.iv,"hex"))},l=(e,t)=>{s(t);const n=o(),a=o(),r=i(e,{password:t,iv:n,salt:a});return JSON.stringify({encrypted:r,salt:a,iv:n})},c=(e,t)=>{s(t);const n=JSON.parse(e),o=r(n.encrypted,{password:t,salt:n.salt,iv:n.iv});if(!o)throw new Error("password_error");return o},d=(e,t,n)=>{s(t),s(n);const o=c(e,t);return l(o,n)};return{encryptKey:l,decryptKey:c,changePassword:d}},i=s({encryptor:(e,t,n)=>{const o=a.a.AES.encrypt(e,a.a.enc.Hex.parse(t.toString("hex")),{iv:a.a.enc.Hex.parse(n.toString("hex")),mode:a.a.mode.CBC,padding:a.a.pad.Pkcs7});return o.ciphertext.toString()},decryptor:(e,t,n)=>{try{const o=a.a.AES.decrypt(a.a.enc.Base64.stringify(a.a.enc.Hex.parse(e)),a.a.enc.Hex.parse(t.toString("hex")),{iv:a.a.enc.Hex.parse(n.toString("hex")),mode:a.a.mode.CBC,padding:a.a.pad.Pkcs7});return a.a.enc.Utf8.stringify(o)}catch(o){return console.error(o.message),null}},pbkdf2:(e,t,n,o)=>a.a.enc.Hex.stringify(a.a.PBKDF2(e,t,{hasher:a.a.algo.SHA512,keySize:2*o/8,iterations:n})),randomHex:()=>a.a.enc.Hex.stringify(a.a.lib.WordArray.random(16))}),r=e=>a.a.SHA256(e).toString();t["a"]={encryptLibKeyObj:async(e,t)=>{if(!t||"string"!==typeof t)throw new Error("invalid_password");if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");const{epub:n,pub:o,epriv:a,priv:s}=e,l=[n,o,a,s].join(":");return i.encryptKey(l,r(t))},decryptLibKeyObj:async(e,t)=>{if(!t||"string"!==typeof t)throw new Error("invalid_password");const n=i.decryptKey(e,r(t)),[o,a,s,l]=n.split(":"),c={epub:o,pub:a,epriv:s,priv:l};if(["epriv","epub","priv","pub"].some((e=>!c[e])))throw new Error("invalid_key");return c},changePassword:async(e,t,n)=>{if(!t||"string"!==typeof t)throw new Error("invalid_password");if(!n||"string"!==typeof n)throw new Error("invalid_password");return i.changePassword(e,r(t),r(n))},digestPassword:e=>{if(!e||"string"!==typeof e)throw new Error("invalid_password");return r(e)}}}).call(this,n("eb72").Buffer)},"95db":function(e,t,n){},"981d":function(e,t,n){},9856:function(e,t,n){"use strict";(function(e,o){n("de6c"),n("dc89"),n("2425"),n("a1c1"),n("1af1");var a=n("025c"),s=n("4fd2"),i=n("d7df"),r=n("6422"),l=n("0f0c"),c=n("07e8"),d=n("ce6c"),u=n("5584"),h=n("c62a6"),p=n("36a1"),m=(n("80cf"),n("f039")),_=n("8a63"),f=n("0885"),g=n("09e8"),b=n("84f6"),y=n("feef"),v=n("61af"),w=n.n(v),k=n("9efe"),C=n("a449"),$=n("c5a5"),S=n("d710"),x=n.n(S),T=(n("a749"),n("b71d")),I=n("9f21"),P=n("2e22");console.log("import io CLIENT"),console.log("-import io CLIENT");const{displayName:O,protocol:q,shortProtocol:E}=x.a,A=n("d310").isElectron();A||console.warn("Warning: Torrent downloader is not impl in browser mode now");const D=()=>{const t=async function(t){console.log("[mixinBlockchainUrl] on paste",t,t.clipboardData.getData("text"));const n=t.clipboardData.getData("text");if(![q,E].some((e=>n.startsWith(e))))return;t.preventDefault();const o=await Object($["a"])(n);o.startsWith("ab-blockchain:")&&e.handleAbBlockchain({url:o})};let n;return{mounted(){n=t.bind(this),document.body.addEventListener("paste",n)},beforeDestroy(){document.body.removeEventListener("paste",n)}}},N={mixins:[I["a"]],created(){this.$amplify.addOnAuthStateChangedListener((()=>{const e=Object(l["a"])("version");o.env.JEST_TEST||-1===e.indexOf("dev")&&"Alphabiz"===O&&(e.includes("internal")||e.includes("nightly"))&&setTimeout(this.showInternalNotice.bind(this),100)}),{once:!0})}};let L=null;t["a"]={name:"App",provide(){return{rootApp:this,io:i["a"],lib:p["a"],autoRenew:this.autoRenew,path:this.path,taskQueue:this.taskQueue,dp$source:this.dp$source}},components:{GlobalRecommend:T["a"],AboutDialog:a["a"],TaskDialog:y["a"],ApplicationBar:d["a"]},mixins:[g["a"],C["b"],D(),N],data(){return{isElectron:A,isTestEnv:!1,path:"/library",settings:null,taskQueue:[]}},computed:{shouldQueueTask(){return!!u["a"].getters.settings.forceLogin&&(!u["a"].getters.accountUserInfo||!u["a"].getters.accountUserInfo.sub)},downloadingTorrents(){return b["a"].taskList.downloading}},methods:{async resolveQueue(){if(0===this.taskQueue.length)return;const e=[],t=[],n=[];let o=null;while(this.taskQueue.length){const a=this.taskQueue.shift();switch(a.type){case"download":a.file.startsWith("file://")?n.push(a.file):t.push(a.file);break;case"upload":e.push(a.files);break;case"uploadOrPlay":o=a.file;break}}console.log(e,t,n,o);for(const a of[...new Set(e)])await this.promptUpload(a);t.length&&await this.promptDownload([...new Set(t)].join("\n")),n.length&&await this.promptDownload([...new Set(n)].join("\n")),o&&this.promptUploadOrPlay(o)},promptDownload(e,t=!1){if(console.log(e,t),!A)return;const n=e.startsWith("magnet")||e.startsWith(q)||e.startsWith(E)||e.startsWith("file://")?e:"file://"+e;if(e.startsWith("file://")&&!w.a.existsSync(e))return;if(this.shouldQueueTask)return console.log("queue download",e,t),void this.taskQueue.push({type:"download",file:n,isMagnet:t});let o=null;const a=new Promise((e=>{o=e})),s=new DataTransfer;s.setData("text/plain",n);const i=new ClipboardEvent("paste",{clipboardData:s});return console.log("dispatch paste event"),i._ab_payload_=n,i._is_magnet_=t,i._onClose=o,console.log("dispatch event"),document.body.dispatchEvent(i),a},promptUpload(e){if(this.shouldQueueTask)return console.log("queue upload",e),void this.taskQueue.push({type:"upload",files:e});let t=null;const o=new Promise((e=>{t=e}));if(console.log("upload",e),!A){const a=()=>{i["a"].emit("wt-add",e[0]),t&&t()},s=n("c620").wtClient;return s.torrents.length?this.$q.dialog({message:this.$t("remove_old_task_desc"),ok:this.$t("remove_old_task"),cancel:this.$t("cancel")}).onOk((()=>{s.torrents[0]?(s.torrents[0].destroy(),s.torrents.splice(0),a()):a()})).onCancel(t):this.$q.dialog({message:this.$t("upload_torrent"),ok:this.$t("upload")}).onOk(a).onCancel(t),o}const a=e.map((e=>e.path||e)),s=a.map((e=>`
${e}
`)).join(""),r={html:!0,style:"white-space:pre-wrap;word-break:break-all",title:this.$t("upload"),message:this.$t("ask_if_upload_file")+"
"+s,ok:this.$t("upload"),cancel:this.$t("cancel")};return a.length>1&&(r.options={type:"radio",model:"single",items:[{label:this.$t("upload_as_single_files"),value:"single"},{label:this.$t("upload_as_one_directory"),value:"directory"}]}),this.$q.dialog(r).onOk((e=>{if(console.log("upload files",e,a),"single"===e)return a.forEach((e=>{i["a"].emit("seed_torrent",{file:[e],token:e,settings:{...this.settings},trackers:u["a"].getters.settings.trackerList||[]})})),void(t&&t());const n=1===a.length?a[0]:"";i["a"].emit("seed_torrent",{file:a,token:n,settings:{...this.settings},trackers:u["a"].getters.settings.trackerList||[]}),t&&t()})).onCancel((()=>{t&&t()})),o},promptUploadOrPlay(e){if(this.shouldQueueTask)return console.log("queue uploadOrPlay",e),void this.taskQueue.push({type:"uploadOrPlay",file:e});console.log(e),this.$q.dialog({title:this.$t("upload_or_play"),message:this.$t("ask_if_upload_or_play"),options:{type:"checkbox",model:[],items:[{label:this.$t("play"),value:"play"},{label:this.$t("upload"),value:"upload"}]},ok:this.$t("ok"),cancel:this.$t("cancel")}).onOk((t=>{if(t&&(t.includes("upload")&&i["a"].emit("seed_torrent",{file:[e.path||e],token:Math.random().toString().substring(2),settings:{...this.settings},trackers:u["a"].getters.settings.trackerList||[]}),t.includes("play"))){const t={};if("string"===typeof e){const n={src:"play:///"+encodeURI(e)};console.log("play source"),t.action={type:"play_source",source:n}}else console.log("play file"),t.action={type:"play_file",file:e};this.$router.push({name:"Player",query:{rand:Math.random()},params:t})}}))},getPublicVersion(e){return Object(l["a"])(e)},async onDrop(e){const t=e.dataTransfer.getData("text");if(console.log("drop",e,t),!t&&(!e.dataTransfer.files||!e.dataTransfer.files[0]))return;e.preventDefault();const n=[...e.dataTransfer.files];console.log(n);const o=t&&!n.length;if(await Object(m["a"])(e,n,t),A&&n.length){const e=n.some((e=>!w.a.existsSync(null===e||void 0===e?void 0:e.path)));if(e)return this.$q.notify(this.$t("file_not_found"))}if(o)return this.promptDownload(t,!0);if(1===n.length){var a,i,r,l;if(Object(s["a"])((null===(a=n[0])||void 0===a?void 0:a.path)||""))return this.promptUploadOrPlay(n[0]);if(null!==(i=n[0])&&void 0!==i&&null!==(r=i.path)&&void 0!==r&&r.endsWith(".torrent"))return this.promptDownload(null===(l=n[0])||void 0===l?void 0:l.path)}if(n.length>=1){if(!A&&(n.length>1||!n[0].size))return this.$q.dialog({message:this.$t("web_mode_upload_single"),ok:this.$t("ok")});this.promptUpload([...n])}},showDisabled(){const e=this.$q.dialog({persistent:!0,title:this.$t("region_not_available"),message:this.$t("region_not_available_message",[30]),ok:!1,cancel:!1,style:"z-index: 9999"}),t=Date.now();setInterval((()=>{const o=Math.floor((Date.now()-t)/1e3),a=30-o;e.update({persistent:!0,title:this.$t("region_not_available"),message:this.$t("region_not_available_message",[a<0?0:a]),ok:!1,cancel:!1,style:"z-index: 9999"}),a<0&&n("b052").ipcRenderer.send("exit-app")}),1e3)},resolveUnfinishPayments(){clearTimeout(L),L=setTimeout((()=>{const e=JSON.parse(localStorage.getItem("_transactions_missing_payee_")||"[]"),t=u["a"].state.credits.expensesTransactions.filter((t=>"FINISH"!==t.status&&"FAILED"!==t.status&&!e.includes(t.id)));if(!t.length)return console.log("No out-of-date unfinish payments");const n=new Date;n.setDate(n.getDate()-3);const o=t.filter((e=>{const t=new Date(e.createdAt);return t{this.dp$confirm(e.id)}))}),1e4)}},beforeCreate(){if(!this.$route.path.startsWith("/library")){if(new URL(location.href).pathname.startsWith("/oauth_redirect"))return;setTimeout((()=>{console.log(this.$route.path),"/library"!==this.$route.path?this.$router.replace("/library"):console.log("Currently in library page")}),1e3)}if(A){const e=n("b052").ipcRenderer;e.once("redirect-log",((e,t)=>{n.e(11).then(n.bind(null,"44cf")).then((({default:e})=>{console.log("Should redirect to",t),e(t)}))}))}},created(){function t(e){for(const t of e){const e=this.dp$expenseHashMapper[t.infoHash];if(e)for(const t of e){const e=this.dp$expenseTxnDict[t];"PENDING"===e.status?this.dp$cancel(e.id):"COMPLETED"===e.status&&(console.log("dp$confirm from pauseAllDownloading"),this.dp$confirm(e.id))}}}if(k["a"].enable.call(this),Object(f["b"])(this),h["a"].$on("request-sign-out",(()=>{console.log("request sign out");const e=this.$alphabiz.dialog({title:this.$t("account_sign_out"),message:this.$t("account_sign_out_confirm"),ok:this.$t("account_sign_out_anyway"),cancel:this.$t("cancel")}).onOk((async()=>{i["a"].emit("user_logout"),e.hide();const n=this.$q.dialog({progress:!0,message:this.$t("account_signing_out"),persistent:!0,ok:!1});t(u["a"].getters.tasks.downloading),await Object(_["d"])(!0),await Object(_["e"])(!0),n.hide(),h["a"].$emit("confirm-sign-out")}))})),u["a"].dispatch("fetchSettings").then((e=>{e.language&&(this.settings=e,console.log(e.language,this.$route.path),this.$i18n.locale=e.language,c["a"].set({system:"auto",light:!1,dark:!0}[e.darkMode]),i["a"].emit("update_torrent_settings",{uploadLimit:e.uploadSpeed,downloadLimit:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,highLevelRadix:e.payedUserShareRadix,dhtPort:e.DHTlistenPort,torrentPort:e.BTlistenPort}))})),A){(async()=>{console.log("Get client geoip");const t=e["require"]("geoip-country"),n=await fetch("https://api.ipify.org").then((e=>e.text()),(e=>{console.log("Failed to get geo for",e.message)}));if(!n)return;const o=t.lookup(n);if(!o)return console.log("Failed to get geo for",n);const a=o.country,s=x.a;"blacklist"===s.register.mode&&s.register.list.includes(a)?(console.log(a,"is in black list",s.register.list),this.showDisabled()):"whitelist"!==s.register.mode||s.register.list.includes(a)?console.log("Geo",a,s.register.list,"available in mode",s.register.mode):(console.log(a,"is not in white list",s.register.list),this.showDisabled())})(),document.body.style.overflowY="hidden";const t=n("b052").ipcRenderer;t.on("open-file",((e,...t)=>{if(0!==t.length){if(1===t.length){const e=t[0];if(e.endsWith(".torrent")||e.startsWith(q+"://")||e.startsWith("magnet"))return this.promptDownload(e);if(e.startsWith(E+"://"))return this.promptDownload(e,!0);if(Object(s["a"])(e))return this.promptUploadOrPlay(e);if(e.endsWith(".abk"))return this.lib$openABK(e)}return this.promptUpload(t)}})),t.on("ask-for-associate",(()=>{this.$q.notify({message:this.$t("not_default_app"),actions:[{label:this.$t("dont_show_again"),handler:()=>u["a"].dispatch("set",{dontAskForAssociate:!0})},{label:this.$t("go_to_settings"),handler:()=>this.$router.push("/advanceSetting#bind-ports")}]})})),t.on("need-more-space",((e,{need:t,free:n})=>{Object(_["d"])(!0),u["a"].dispatch("set",{libraryPreload:!1}).then((()=>{u["a"].dispatch("fetchSettings")})),this.$q.dialog({title:this.$t("space_not_enough"),message:this.$t("need_more_space",[Object(r["a"])(t),Object(r["a"])(n),Object(r["a"])(u["a"].getters.settings.minDiskSpace)]),ok:this.$t("ok")})})),t.on("main-process-error",((e,t)=>{console.error("Main process throws error:",t.stack)})),i["a"].once("first_launch",(async()=>{const e=Object(l["a"])("version"),t=localStorage.getItem(`first-launch_${x.a.name}`);if(t===e)return console.log("[First Launch Check] Not first launch");await p["a"].whenReady,await P["a"].methods.initFilmRate(),await new Promise((e=>setTimeout(e,5e3))),this.$q.dialog({title:this.$t("set_download"),message:this.$t("set_download_desc"),ok:this.$t("go_to_settings"),cancel:this.$t("not_now")}).onOk((()=>{this.$router.replace("/basicSetting?highlight=download-directory")})).onDismiss((()=>{console.log("Dismiss"),localStorage.setItem(`first-launch_${x.a.name}`,e)}))})),setTimeout((()=>{t.send("main-window-ready")}),2e3)}},mounted(){u["a"].getters.accountUserInfo&&u["a"].getters.accountUserInfo.sub||i["a"].emit("user_logout"),(o&&o.env.TEST_EMAIL_DOMAIN||document.cookie.includes("TestEnv"))&&(this.isTestEnv=!0,A?(n("b052").ipcRenderer.send("enable_devtools"),u["a"].dispatch("fetchSettings")):u["a"].dispatch("set",{disableDevTools:!1}).then((()=>{u["a"].dispatch("fetchSettings")}))),["dragleave","drop","dragenter","dragover"].forEach((e=>{document.getElementById("q-app").addEventListener(e,(e=>{e.preventDefault()}))})),h["a"].$on("update-authstate",(e=>{"signedIn"===e&&(console.log("Signed in. Resolve queue."),this.resolveQueue())})),document.body.addEventListener("drop",this.onDrop)},beforeDestroy(){document.body.removeEventListener("drop",this.onDrop)},watch:{isTestEnv(e){window.isTestEnv=e},"$store.state.credits.expensesTransactions"(){this.resolveUnfinishPayments()},"$store.state.account.authState"(e,t){if("signedOut"!==e||t&&"signedIn"!==t||(this.$route.path.includes("/library")&&(this.$root.$emit("navigate-to"),this.$router.push("/library")),u["a"].getters.settings.forceLogin&&this.$amplify.showSignedOutDialog()),"signedIn"===e){if(console.log('dp$address: io.emit("set_user")',this.dp$address),i["a"].emit("set_user",{user:u["a"].state.account.nickname,sub:this.dp$address}),p["a"].whenReady.then((()=>{console.log("all ready",this.taskQueue)})),u["a"].getters.shouldDisableTasks)return;i["a"].emit("user_login")}},downloadingTorrents(e,t){if("Player"!==this.$route.name&&!this.$route.path.startsWith("/library")&&e.length>t.length){const n=t.map((e=>e.origin||e.infoHash));let o=!1;for(const t of e){const e=t.origin||t.infoHash;if(!n.includes(e)){if(t.fromPost)return;o=!0}}if(o){const e="/downloader?currentTab=downloading";if(this.$router.currentRoute.fullPath===e)return;this.$router.push(e)}}}}}}).call(this,n("0ee4"),n("28d0"))},9910:function(e,t,n){},9992:function(e,t,n){"use strict";n("603c")},"9a08":function(e,t,n){"use strict";t["a"]=["# Terms of Service TESTING","","## 1. Introduction","",'Welcome to Use Alphabiz App (the "App"). The App is operated by Alphabiz Team ("Alphabiz" or "we"). This document – the terms of service – is an agreement between you, the beloved user, and Alphabiz. It\'s referred to as the "Terms" or the "Agreement".',"These Terms govern your use of the App and this App only. The Terms neither relate to any other Alphabiz application, service or property nor your use of any other Alphabiz application, service or property. For example, these Terms don't govern your use of Alphabiz App.","","## 2. Agreement to the Terms","","Terms of service agreements are contracts. That means that this Agreement is a contract between you and Alphabiz for the limited purpose of laying out what our respective rights and obligations are with respect to Alphabiz App.","If there's something in these Terms you don't agree with or don't understand, please don't use the App. By accessing or using the App, you signal your agreement with and consent to the Terms. By accessing or using any Application or Service you also represent that you have the legal authority to accept the Terms on behalf of yourself and any party you represent in connection with your use of any Application or Service.","","Unless otherwise agreed to in writing with Alphabiz, your use of any Application or Service will always be subject to, at a minimum, the terms and conditions set out in this document.","","## 3. DISCLAIMER OF WARRANTIES","","TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, ALPHABIZ OFFERS THE APP ON AN AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE APPLICATIONS OR SERVICES, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. ALPHABIZ DOES NOT WARRANT THAT THE FUNCTIONS OR CONTENT CONTAINED ON THE APPLICATION OR SERVICES WILL BE ERROR-FREE, THAT DEFECTS WILL BE CORRECTED, OR THAT ALPHABIZ'S SERVERS ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS. ALPHABIZ DOES NOT WARRANT OR MAKE ANY REPRESENTATION REGARDING USE OR THE RESULT OF USE OF THE CONTENT IN TERMS OF ACCURACY, RELIABILITY, OR OTHERWISE.","","## 4. LIMITATION OF LIABILITY","",'EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW AND THEN ONLY TO THAT EXTENT, IN NO EVENT WILL ALPHABIZ, ITS EMPLOYEES, OFFICERS, DIRECTORS, AFFILIATES OR AGENTS ("THE ALPHABIZ PARTIES") BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY INCIDENTAL, DIRECT, INDIRECT, PUNITIVE, ACTUAL, CONSEQUENTIAL, SPECIAL, EXEMPLARY OR OTHER DAMAGES, INCLUDING WITHOUT LIMITATION, LOSS OF REVENUE OR INCOME, LOST PROFITS, PAIN AND SUFFERING, EMOTIONAL DISTRESS, COST OF SUBSTITUTE GOODS OR SERVICES, OR SIMILAR DAMAGES SUFFERED OR INCURRED BY YOU OR ANY THIRD PARTY THAT ARISE IN CONNECTION WITH THE APPLICATIONS OR SERVICES (OR THE TERMINATION THEREOF FOR ANY REASON), EVEN IF THE ALPHABIZ PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.',"","THE ALPHABIZ PARTIES SHALL NOT BE RESPONSIBLE OR LIABLE WHATSOEVER IN ANY MANNER FOR ANY CONTENT POSTED ON THE APP (INCLUDING CLAIMS OF INFRINGEMENT RELATING TO CONTENT POSTED ON THE APPLICATIONS OR SERVICES, FOR YOUR USE OF THE APPLICATIONS AND SERVICES, OR FOR THE CONDUCT OF THIRD PARTIES WHETHER ON THE APPLICATIONS, IN CONNECTION WITH THE SERVICES OR OTHERWISE RELATING TO THE APPLICATIONS OR SERVICES.","","## 5. Reservation of Rights and Ownership","",'Tan Shuai (the "Founder" of Alphabiz) reserves all rights in and to the App, including without limitation all rights in and to the App\'s name, logo, trademark, domain name, and other intellectual property rights.',"","The App is protected by copyright and other intellectual property laws and treaties around the world. Founder owns the title, copyright and other intellectual property rights in the App. The App is licensed, not sold.","","## 6. Indemnification for breach of the Terms","","You agree to indemnify and hold harmless the Alphabiz Parties (defined above) from and against any and all loss, expenses, damages, and costs, including without limitation reasonable attorneys fees, resulting, whether directly or indirectly, from your violation of the Terms.","","## 7. Termination of this Agreement","","These Terms will continue to apply until terminated by the parties in writing, though your right to access and use the App terminates automatically upon your breach of any of these Terms.","The disclaimer of warranties, the limitation of liability and the jurisdiction and applicable law provisions shall survive any termination. The license grants mentioned herein shall continue in effect subject to the terms of the applicable license. Your warranties and indemnification obligations shall survive any termination for one year.","","## 8. Miscellaneous Terms","","If any term or part of the Terms is held to be invalid or unenforceable by any law or regulation or final determination of a competent court or tribunal, that provision will be deemed severable and will not affect the validity and enforceability of any remaining provisions.","","The parties agree that no joint venture, partnership, employment, or agency relationship exists between you and Alphabiz as a result of these Terms or your use of the App.","","These Terms constitute the entire agreement between you and Alphabiz relating to the App and supersede all prior, contemporaneous and future communications (with the exception of future amendments to the Terms as made available by Alphabiz from time to time) between you and Alphabiz. A printed version of the Terms and of any notice given in electronic form shall be admissible in judicial or administrative proceedings based on or relating to the Terms to the same extent and subject to the same conditions as other business documents and records originally generating and maintained in printed form.",""]},"9a50":function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"file-selector",on:{click:e.onClick,touch:e.onClick}},[n("input",{ref:"fileSelector",staticClass:"file-selector-input",attrs:{type:"file",name:"fileSelector",webkitdirectory:e.directory,accept:e.accept?"."+e.accept.extensions[0]:"*"},on:{change:e.onSelect}}),e._t("default",(function(){return[n("q-btn",{attrs:{color:"primary",icon:"folder_open",label:e.$t("select_file")}})]}))],2)},a=[],s=(n("de6c"),n("0598")),i=n("d558"),r=n("a3fc"),l={name:"FileSelector",props:{directory:Boolean,accept:{type:Object,required:!1}},data(){return{isElectron:Object(s["default"])(),isCapacitor:Object(i["a"])()}},mounted(){console.log("File selector mounted")},methods:{getFileContent(e){const t=n("61af").readFileSync(e,{encoding:"binary"});return t},buildFile(e){if(this.directory||n("61af").statSync(e).isDirectory())return n("61af").statSync(e).isDirectory()?{path:e,name:e}:{path:e,name:Object(r["dirname"])(e)};const t=[this.getFileContent(e)],o=Object(r["basename"])(e),a=n("ea33").lookup(Object(r["extname"])(e));return console.log("buf",t,e),console.log(o,a),new File(t,o,{type:a})},async selectDirectory(){if(!this.isElectron)return this.$refs.fileSelector.click();console.log("select directory");const{ipcRenderer:e}=await Promise.resolve().then(n.t.bind(null,"b052",7));e.once("select_file_or_directory",((e,t)=>{const n=t&&!t.canceled&&Array.isArray(t.filePaths)&&t.filePaths.length?t.filePaths.map((e=>this.buildFile(e))):null;this.$emit("select",n)})),e.send("select_file_or_directory",[])},async selectFile(){console.log("click select file",this.$refs.fileSelector);const e=this.$refs.fileSelector;return e.click()},onClick(){if(console.log("onclick",this.$refs.fileSelector),this.directory)return this.selectDirectory();this.selectFile()},onSelect(e){var t,n,o;console.log("on select files",null===(t=e.target)||void 0===t?void 0:t.files);const a=null===(n=e.target)||void 0===n||null===(o=n.files)||void 0===o?void 0:o[0];this.$emit("select",a)}}},c=l,d=(n("f157"),n("2b5f")),u=n("1043"),h=n("09a4"),p=n.n(h),m=Object(d["a"])(c,o,a,!1,null,"a5acd74c",null);t["a"]=m.exports;p()(m,"components",{QBtn:u["a"]})},"9be9":function(e,t,n){},"9c3b":function(e,t,n){},"9d1e":function(e,t,n){},"9e98":function(e,t,n){"use strict";n("2cfd")},"9e9b":function(e,t,n){},"9efe":function(e,t,n){"use strict";n.d(t,"e",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"l",(function(){return _})),n.d(t,"m",(function(){return f})),n.d(t,"o",(function(){return g})),n.d(t,"n",(function(){return b})),n.d(t,"b",(function(){return y})),n.d(t,"x",(function(){return v})),n.d(t,"g",(function(){return w})),n.d(t,"i",(function(){return k})),n.d(t,"c",(function(){return C})),n.d(t,"h",(function(){return $})),n.d(t,"t",(function(){return S})),n.d(t,"u",(function(){return x})),n.d(t,"v",(function(){return T})),n.d(t,"d",(function(){return I})),n.d(t,"p",(function(){return P})),n.d(t,"q",(function(){return O})),n.d(t,"r",(function(){return q})),n.d(t,"j",(function(){return E})),n.d(t,"w",(function(){return A})),n.d(t,"k",(function(){return D})),n.d(t,"a",(function(){return N})),n.d(t,"s",(function(){return L}));n("de6c"),n("7a76"),n("d4b5"),n("f200"),n("dc69"),n("0c26"),n("a1c1");var o=n("e74d"),a=n("67cf"),s=n("35f4"),i=n("e75b"),r=n("9572"),l=n("ff9b");const c=new i["a"].Rest("ABDevRest"),d=Object(s["a"])("1234567890abcdefghijklmnopqrstuvwxyz",20),u=e=>(e.email&&(e.email=e.email.toLowerCase()),{username:e.username,password:e.password,attributes:{...e.msgLocale?{"custom:msg_locale":e.msgLocale}:{},...e.email?{email:e.email}:{},...e.phoneNumber?{phone_number:e.phoneNumber}:{},...e.phoneNumberCountryCode?{"custom:phone_number_code":e.phoneNumberCountryCode}:{},...e.keyMetadata?{"custom:key_metadata":e.keyMetadata}:{}},clientMetadata:{oauthSignUp:e.oauthSignUp||"false",...e.invitationCode?{invitationCode:e.invitationCode}:{},...e.oauthData?{oauthData:e.oauthData}:{},...e.appClient?{"custom:app_client":e.appClient}:{},...e.signUpIpAddress?{"custom:signing_ip_address":e.signUpIpAddress}:{},...e.os?{"custom:os":e.os}:{}}}),h=e=>{e.email&&(e.email=e.email.toLowerCase());const t={email:"email",phoneNumber:"phone_number",phoneNumberCountryCode:"custom:phone_number_code",msgLocale:"custom:msg_locale",emailVerified:"email_verified",phoneNumberVerified:"phone_number_verified",app_client:"custom:app_client",os:"custom:os",nickname:"nickname",gender:"gender",birthday:"birthdate",locale:"locale"},n={};return Object.entries(t).forEach((([t,o])=>{void 0!==e[t]&&(n[o]=e[t])})),n};async function p(e=!0){const t=await o["a"].currentAuthenticatedUser().catch((e=>{throw new Error(e)}));if(!t||0===Object.keys(t).length)throw new Error("No authed user");return e||(t.dynamo_attrs={},t.dynamo_attrs.invitation_code=[]),t}async function m(){const e=await o["a"].currentUserInfo();if(!e||0===Object.keys(e).length)throw new Error("No user info");return e.dynamo_attrs={},e.dynamo_attrs.invitation_code=[],e}async function _(e,t){e=e.toLowerCase();let n=await o["a"].signIn(e,t,{});if("SMS_MFA"===n.challengeName){const e=new Error(n.challengeName);throw e.destination=n.challengeParam.CODE_DELIVERY_DESTINATION,e.user=n,e}if("SOFTWARE_TOKEN_MFA"===n.challengeName){const e=new Error(n.challengeName);throw e.user=n,e}if("CUSTOM_CHALLENGE"===n.challengeName){const e=await l["a"].prototype.$recaptcha("login");if(n=await o["a"].sendCustomChallengeAnswer(n,e),!n)throw new Error("Network Error")}c.post("/account/postSignIn",{keychainMetadataHash:r["a"].digestPassword(t)}).catch((e=>{console.error(e.message)}))}async function f(e,t,n){return o["a"].confirmSignIn(e,n,t)}async function g(e){e.username=d().toLowerCase();const t=await o["a"].signUp(u(e));return await c.postGuest("/account/postSignUp",{sub:t.userSub,username:e.username,keychainMetadataHash:r["a"].digestPassword(e.password),isTestEnv:window.isTestEnv,invitationCode:e.invitationCode}),t}async function b(){return await o["a"].signOut().catch((e=>{console.log("SignOut catch >>",e)}))}async function y(e){const t=await p(),n=await o["a"].updateUserAttributes(t,h(e));if("SUCCESS"!==n)throw new Error("Change attributes failed")}async function v(e){const t=await p(),n=await o["a"].changePassword(t,e,e).catch((e=>{throw"Incorrect username or password."===e.message?new Error("Incorrect password"):e}));return"SUCCESS"===n}function w(e,t={}){return e=e.toLowerCase(),o["a"].forgotPassword(e,t)}function k(e){return e=e.toLowerCase(),o["a"].resendSignUp(e)}async function C(e,t,n={},a={oauthSignUp:"false"}){e=e.toLowerCase();const s={optionalAttributes:JSON.stringify(h(n)),...a},i=await o["a"].confirmSignUp(e,t,{clientMetadata:s});if("SUCCESS"!==i)throw new Error(JSON.stringify(i));return i}async function $(e,t,n){t&&(t=t.toLowerCase()),await c.post("/invitation/deliverCode",{id:e,email:t,phone:n})}async function S(e){await o["a"].verifyCurrentUserAttribute(e)}async function x(e,...t){const n={email:{email:t[0].toLowerCase()},phone_number:{phoneNumber:t[0],phoneNumberCountryCode:t[1]}}[e];await c.post("/account/setVerifyAttr",n)}async function T(e,t){const n=await o["a"].verifyCurrentUserAttributeSubmit(e,t);await c.post("/account/postVerifyAttr",{success:"SUCCESS"===n})}async function I(){await c.post("/admin/deleteAccount")}async function P(){const e=await o["a"].currentAuthenticatedUser();return await o["a"].setupTOTP(e)}async function O(e){const t=await o["a"].currentAuthenticatedUser();await o["a"].verifyTotpToken(t,e)}async function q(e,t){o["a"].signOutOAuth(),await c.postGuest("/account/unlinkProvider",{providerName:e,providerUserId:t})}async function E(e,t){e=e.toLowerCase();const n=await c.postGuest("/account/verifyForDisableMFA",{username:e,metadata:t}),o=n.email.Destination,a=n.phoneNumber.Destination;return{email:{destination:o},phoneNumber:{destination:a}}}async function A(e,t,n){e=e.toLowerCase(),await c.postGuest("/account/verifySubmitForDisableMFA",{username:e,emailCode:t,phoneCode:n})}async function D(e,t){await y({msgLocale:`${e}:${t}`})}const N={data:{hash:void 0},record(e){if(!e)throw new Error("invalid password");N.data.hash=r["a"].digestPassword(e)},enable(){const e=async()=>{const e=async()=>{let e=await o["a"].currentUserInfo().then((e=>{var t;return null===e||void 0===e||null===(t=e.attributes)||void 0===t?void 0:t["custom:key_metadata"]}));return e=e?JSON.parse(e):{unset:!0,timestamps:{}},e},t=await e();t.hash?console.tag.green("Polyfill","config_password_hash","cancelled").log("cognito_hash_existed"):N.data.hash?(console.tag.green("Polyfill","config_password_hash","start").log(t),t.hash=N.data.hash,await o["a"].updateUserAttributes(await o["a"].currentAuthenticatedUser(),{"custom:key_metadata":JSON.stringify(t)}),console.tag.green("Polyfill","config_password_hash","done").log(t)):console.tag.green("Polyfill","config_password_hash","cancelled").log("local_hash_not_found")};this.$amplify.addOnAuthStateChangedListener((async t=>{"signedIn"===t&&await e()}))}};function L(){const e=n(["\n subscription OnMessage($channel: String!) {\n onMessage(channel: $channel) {\n channel\n data\n }\n }\n "]);return t;function t(t){const n=e("onMessage",{channel:`DeliveryStatus::${t}`},{authMode:"API_KEY"}),o=new Promise(((e,t)=>{n.on((n=>{const o=JSON.parse(n.data);console.log("promiseDeliveryStatus >",o),"Bounce"===o.type?t(a(o.data[0])):"Delivery"===o.type&&e(o)}))})).finally((()=>{n.off()}));return o.off=()=>n.off(),o;function a(e){var t;const n={"5.1.1":"Bad destination mailbox address","5.4.4":"Invalid domain","5.3.0":"Other or undefined mailbox status"};let o=n[e.status];return e.diagnosticCode.startsWith("smtp; 550 Mailbox unavailable or access denied")?o="Mailbox unavailable":e.diagnosticCode.indexOf("it is on the suppression list for your account.")&&(o="Suppressed email address"),new Error(null!==(t=o)&&void 0!==t?t:e.diagnosticCode)}}function n(e=[]){const t=n(e);return(e,n,{authMode:o,authToken:s}={})=>{if(!t[e])throw new Error(`Operation not found: ${e}`);const i=a["a"].graphql({query:t[e],variables:n,authMode:null!==o&&void 0!==o?o:void 0,authToken:null!==s&&void 0!==s?s:void 0});i.name=e;const r=(e,t)=>console.error(e[0].message,{errors:e,provider:t});let l;const c={on(e,t=r){return l&&l.unsubscribe(),l=i.subscribe({next:({provider:t,value:n})=>{var o;return e(null===(o=n.data)||void 0===o?void 0:o[i.name],t)},error:({provider:e,error:n})=>t(n.errors,e)}),c},off(){return l&&(l.unsubscribe(),l=null),c}};return c};function n(e=[]){return e.reduce(((e,n)=>(e[t(n)]=n,e)),{});function t(e){const t=e.trim().match(/^[\w]+[ \f\r\t\n]+[\w]+/)[0].split(" ").reverse()[0],n=t.replace(t.charAt(0),t.charAt(0).toLowerCase());return n}}}}},"9f21":function(e,t,n){"use strict";var o=n("67b6"),a=["# INTERNAL DEMO ONLY","","1. Your license permits use the Software only for your internal demonstration, test, or evaluation purposes. ","","2. Licensee acknowledges that the Software is confidential in nature and constitutes a trade secret belonging to Licensor.","","3. Public disclosure or distribution of the Software is prohibited.","","4. Note that the Software disables itself on the “time-out” date identified on the SOFTWARE packaging.","",""],s=n("76ec"),i=n("9a08");t["a"]={mixins:[o["b"]],methods:{showInternalNotice(){this.createMarkdownDialog({title:this.$t("internal_notice"),markdown:{internal:{label:"Internal",markdown:a}}})},showLicenseTermsNotice(){this.createMarkdownDialog({title:this.$t("account_license_terms"),markdown:{license:{label:"License",markdown:s["a"]},terms:{label:"Terms",markdown:i["a"]}}})}}}},"9f3a":function(e,t,n){"use strict";n("4eaf")},"9f42":function(e,t,n){},"9fe7":function(e,t,n){"use strict";n("9be9")},a11f:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));n("de6c"),n("a1c1");var o=n("d710"),a=n.n(o);const s=new Map;function i(t){if(s.has(t))return s.get(t);if("string"!==typeof t)return t;let n=t;var o;if(t.startsWith(a.a.protocol))n=null===(o=t.match(/[^/]\/([^&/]+)/))||void 0===o?void 0:o[1];else if(t.startsWith(a.a.shortProtocol))n=t.replace(a.a.shortProtocol+"://","");else if(t.match(/([0-9a-fA-F]{40})/)){var i;n=null===(i=t.match(/([0-9a-fA-F]{40})/))||void 0===i?void 0:i[1],n&&(n=e.from("01"+n,"hex").toString("base64").replace(/\//g,"_"))}const r=n||t;return s.set(t,r),r}}).call(this,n("eb72").Buffer)},a1cd:function(e,t,n){"use strict";n("de6c"),n("a1c1"),n("0c26");const o=n("a3fc"),{resolve:a}=o,{networkInterfaces:s}=n("800b"),i=e=>{if(!e.ready)return[];const t=e.pieces.length,n=t+128-t%128,o=n/128,a=[];let s=1,i=0;for(let r=0;r=o&&(a.push(s),s=1,i=0);return a},r=e=>{const t=i(e),n=[];let o=0,a=0;for(let s=0;s=8&&(n.push(a),o=0,a=0);return n},l=(e,t)=>{const n=e.pieceLength,o=e.length,a=Math.ceil(o/n),s=t.peerPieces;if(!s.buffer)return{progress:0,buffer:null};let i=0;for(const r of s.buffer){const e=r.toString(2).split("").filter((e=>"1"===e)).length;i+=e}return{progress:i/a,has:i,length:o}},c=["infoHash","name","paused","length","downloaded","uploaded","ready","waiting","progress","isSeeding","upload","token","completed","origin","path","pending","fromPost","postTitle","file","magnetURI","alphabizURI","isAutoUpload","isUploadByFiles","createdTime","completedTime","usedTime"],d=(e,t,n)=>{const a={};var s;(c.forEach((t=>{a[t]=e[t]})),!a.infoHash&&e.magnetURI)&&(a.infoHash=null===(s=e.magnetURI.toLowerCase().match(/:([0-9a-fA-F]{40})/))||void 0===s?void 0:s[1]);if(a.done=e.downloaded>=e.length,a.download=1!==e.progress&&!e.upload,a.upload=e.upload,a.recieved=e.received,a.files=e.files?e.files.map((t=>({name:t.name,path:o.resolve(e.path||"",t.path||t.name),progress:t.progress>0?t.progress:0}))).filter((e=>!e.name.match(/^_____padding_file_(.*)____$/))):[],e.timeRemaining&&(a.timeRemaining=e.timeRemaining),e.metadata&&(a.hasMetadata=!0),e.numPeers&&(a.peersNum=e.numPeers),e.subtitleList&&e.subtitleList.length&&(a.subtitleList=e.subtitleList),"undefined"===typeof t||!n)return a;const i=r(e);e.byteMap&&!i.some(((t,n)=>e.byteMap[n]!==t))||(e.byteMap=i,e.emit("byte-map-change")),a.byteMap=e.byteMap,e.trackerMap?a.trackerList=[...e.trackerMap.values()].map((e=>{const t={...e};return t.url.includes("@6")?t.isIpv6=!0:t.isIpv6=t.url.startsWith("ws")&&t.url.includes("ipv6"),t})).filter((({url:t,status:n})=>{if("error"!==n)return!0;let o=t;t.includes("@6")?o=t.replace("@6",""):o+="@6";const a=e.trackerMap.get(o);return!a||"error"===a.status})):a.trackerList=[];const d=e.client;return a.connections=e.wires.map((o=>{let a=o.remoteAddress;if(!a){const t=e._peers[o.peerId];if(!t||"webrtc"!==t.type)return null;{var s,i,r,c,u;const e=null===(s=t.conn)||void 0===s||null===(i=s._pc)||void 0===i||null===(r=i.currentRemoteDescription)||void 0===r||null===(c=r.sdp)||void 0===c||null===(u=c.match(/c=IN\sIP\d\s(.*)/))||void 0===u?void 0:u[1];if(!e)return o.destroy(),null;a=e}}let h="low";o._uploadThrottle._group===d.throttleGroups.mid&&(h="mid"),o._uploadThrottle._group===d.throttleGroups.high&&(h="high");let p=0,m=0;if(n.has(o._debugId)){const e=n.get(o._debugId);p=(o.downloaded-e.downloaded)/t,p<0&&(p=0),m=(o.uploaded-e.uploaded)/t,m<0&&(m=0)}n.set(o._debugId,{downloaded:o.downloaded,uploaded:o.uploaded});let _=!1;e.byteMap&&o.remote_byte_map&&(_=e.byteMap.some(((e,t)=>{try{const n=e.toString(2).padStart(8,"0"),a=o.remote_byte_map[t].toString(2).padStart(8,"0");for(let e=0;ee)),a.connections.sort(((e,t)=>e.address&&e.address.localeCompare?e.address.localeCompare(t.address):0)),e.verifyStatus&&(a.verifyStatus=e.verifyStatus),e.pieces&&(a.verifiedPieces=e.pieces.reduce(((e,t,n)=>{if(null===t){const t=e[e.length-1];Array.isArray(t)?t[1]===n-1?t[1]=n:e.push(n):t===n-1?e[e.length-1]=[t,n]:e.push(n)}return e}),[])),a},u=()=>{const e=s(),t=new Set;for(const n in e){const o=e[n];o.forEach((e=>{t.add(e.address)}))}return[...t]},h=e=>"string"===typeof e&&e.includes("(")?e.substring(0,e.indexOf("(")).trim():e,p=(e,t)=>{if(!e.discovery||!e.discovery.tracker)return;const n=e.discovery.tracker;if(!n._trackers.find((e=>e.announceUrl===t))&&n._createTracker)try{const e=[4];t.startsWith("http")&&e.push(6);for(const o of e){const e=n._createTracker(t,o);e&&(n._trackers.push(e),e.setInterval(),e.announce(n._defaultAnnounceOpts()))}}catch(o){console.error("addTracker error",o)}},m=(e,t,n)=>{if(!e.discovery||!e.discovery.tracker)return n();const o=e.discovery.tracker._trackers,a=o.findIndex((e=>e.announceUrl===t));if(-1===a)return n();const s=o[a];s&&s.destroy?s.destroy(((...e)=>{const a=o.findIndex((e=>e.announceUrl===t));-1!==a&&o.splice(a,1),"function"===typeof n&&n(...e)})):n()};function _(e){const{appendFile:t}=n("61af"),{format:o}=n("38c2"),s=(...e)=>`[${(new Date).toLocaleString()}] ${o(...e)}\n`,i=a(e,"webtorrent.log.log"),r=a(e,"webtorrent.warn.log"),l=a(e,"webtorrent.error.log"),c=function(e){return{...e,log(...n){t(i,s(...n),(()=>{})),e.log.apply(e,n)},warn(...n){t(r,s(...n),(()=>{})),e.warn.apply(e,n)},error(...n){t(l,s(...n),(()=>{})),e.error.apply(e,n)}}}(window.console);window.console=c}t["a"]={useRedirectLogs:_,torrentToJson:d,getLocalIPList:u,getPieceMap:i,parseTrackerWarning:h,addTracker:p,removeTracker:m}},a368:function(e,t,n){"use strict";n.r(t);var o=n("00e9");n.d(t,"Clipboard",(function(){return o["a"]}));var a=n("b46e");n.d(t,"Share",(function(){return a["a"]}));var s=n("b009");n.d(t,"Filesystem",(function(){return s["c"]})),n.d(t,"Directory",(function(){return s["a"]})),n.d(t,"Encoding",(function(){return s["b"]}));var i=n("5c0a");n.d(t,"Device",(function(){return i["a"]}));var r=n("79b7");n.d(t,"App",(function(){return r["a"]}));var l=n("c03e");n.d(t,"Network",(function(){return l["a"]}));var c=n("67d7");n.d(t,"Capacitor",(function(){return c["a"]}))},a449:function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"d",(function(){return B})),n.d(t,"c",(function(){return Q})),n.d(t,"b",(function(){return W}));n("de6c"),n("f200"),n("7a76"),n("a1c1");var o=n("36a1"),a=n("5584"),s=n("35f4"),i=n("2d62"),r=(n("dc89"),n("2425"),n("d558"));const l=e=>e?new Promise((t=>{const n=new FileReader;n.onload=e=>{var n;t(null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsText(e)})):Promise.resolve(""),c=async e=>{e.click();const t=new Promise((t=>{let n=!1;setTimeout((()=>{const e=document.activeElement;e.addEventListener("focus",(()=>{console.log("file$onFocus: Start",e),setTimeout((()=>{console.log("file$onFocus: End",n),!1===n&&t(null)}),400)}),{once:!0})}),200),e.addEventListener("change",(async o=>{var a,s;console.log("file$onChange");const i=null===o||void 0===o||null===(a=o.target)||void 0===a||null===(s=a.files)||void 0===s?void 0:s[0];i&&(n=!0,t(i)),e.value=null}),{once:!0})}));return await t},d=()=>{const e=document.createElement("input");return e.style.display="none",e.type="file",e.accept=".abk",e};var u={methods:{async $readFile(){const e=d(),t=await c(e);console.log("file$selected",t);const n=await l(t);return n},async $writeFile(e,t){if(Object(r["a"])()){const{Share:o,Filesystem:a,Directory:s}=await Promise.resolve().then(n.bind(null,"a368")),{value:i}=await o.canShare();if(!i)return;const{uri:r}=await a.writeFile({data:t,path:e,directory:s.Documents}).catch((()=>({})));return o.share({title:e,files:[r.startsWith("file://")?r:"file://"+r]}).catch((e=>{console.log(e)}))}const o=URL.createObjectURL(new Blob([t])),a=document.createElement("a");a.href=o,a.download=e,a.click(),setTimeout((()=>window.URL.revokeObjectURL(o)),0)}}},h=n("9572"),p=n("02fe"),m=n.n(p),_=n("9369"),f=n("d710"),g=n.n(f),b=n("ff9b");const y=n("d310").isElectron();y||console.warn("Warning: Torrent downloader is not impl in browser mode now");const v=Object(s["a"])("abcdefg",5),w=Object(s["a"])("0123456789abcdef",40),k=async(e,t=5)=>{let n=0;while(n=t)throw console.log("Failed at running",e),o;console.log("Retry #"+n++,e)}},C=!0,$=(...e)=>{if(!C)return;const[t,...n]=e;console.tag.green(...t).log(...n)},S=new b["a"]({data(){return{loading:!1}},methods:{setLoading(e){this.loading=e}}});function x(e){return this.$alphabiz.dialog({progress:null===e||void 0===e||e,ok:!1})}async function T(){let e=5;const t=await new Promise((async t=>{const n=this.$alphabiz.dialog({title:this.$t("store_your_lib_key"),message:this.$t("confirm_update_cloud_key"),ok:{color:"negative",textColor:"negative",disable:!!e,label:`${this.$t("ok")} (${e})`},cancel:!0}),o=Date.now(),a=setInterval((()=>{const t=Math.floor((Date.now()-o)/1e3);e=5-t,0===e&&clearInterval(a),n.update({ok:{color:"negative",textColor:"negative",disable:!!e,label:e?`${this.$t("ok")} (${e})`:this.$t("ok")}})}),1e3);t(!!await n.promise())}));return t}async function I(e,t={}){const n={password:{type:"password",model:"",rules:[_["c"].bind(this),_["d"].bind(this)]}},o=this.$alphabiz.dialog({title:this.$t("input_independent_password"),cancel:!0,prompts:n,ok:t=>t.dialog$useLoadingState("ok",(async()=>{await e(t,t.dialog$arguments().prompts.password)})),...t});await o.promise()}async function P(e,t={}){const n={password:{type:"password",label:this.$t("account_password"),model:"",rules:[_["c"].bind(this),_["d"].bind(this)]},reEnterPassword:{type:"password",model:"",label:this.$t("account_re_enter_password"),rules:[e=>n.password.model===e||this.$t("account_password_not_equal")]}},o=this.$alphabiz.dialog({cancel:!0,prompts:n,ok:t=>t.dialog$useLoadingState("ok",(()=>e(t,t.dialog$arguments().prompts.password))),...t});await o.promise()}async function O(e,{delay:t,timeout:n,messages:{processing:o,failed:a}}){const s=x.call(this,o),i=e=>new Promise((t=>setTimeout(t,e))),r=e=>new Promise((t=>{let n=e;const i=Date.now(),r=setInterval((()=>{const l=Math.floor((Date.now()-i)/1e3);n=e-l,n>0?s.update({progress:`${o} ${n}s`}):(clearInterval(r),s.update({progress:a}),t())}),1e3)}));let l,c=!1;return await Promise.race([i(t).then((()=>r(Math.round(n/1e3)))),e().then((e=>{c=!0,l=e}))]).finally((()=>{i(c?0:1e3).then((()=>s.hide()))})),l}async function q(e={}){const t="lib",{mode:n,password:o}=e,s=await a["a"].dispatch("getKeychainCloud",{keyName:t,mode:n,password:o});if(["epriv","epub","priv","pub"].some((e=>!s[e])))throw new Error("invalid_key");return s}async function E(e,t={}){if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");const n="lib",{mode:o,password:a}=t;await Object(_["a"])(e,{mode:o,password:a,keyName:n})}async function A(e,t={}){var n;let o;if(t.dataStr?o=t.dataStr:($(["requireKeyObjLocal","$readFile","start"]),o=await this.$readFile(),$(["requireKeyObjLocal","$readFile","done"],o)),!o)return;if(!o.startsWith("eyJ"))throw console.warn("legacy version or invalid key file"),new Error("invalid_key");const a=async e=>{const t={encode:e=>m.a.enc.Base64.stringify(m.a.enc.Utf8.parse(e)),decode:e=>m.a.enc.Utf8.stringify(m.a.enc.Base64.parse(e))},n=await h["a"].decryptLibKeyObj(t.decode(o),e).catch((()=>{}));if(!n||"object"!==typeof n)throw new Error("error_password");if(["epriv","epub","priv","pub"].some((e=>!n[e])))throw new Error("invalid_key");return n};await I.call(this,(async(t,n)=>{const o=await a(n).catch((e=>(this.$q.notify({message:this.$t(e.message),type:"negative",position:"bottom-right"}),null)));$(["requireKeyObjLocal","decrypted"],o),o&&await e(o).finally((()=>t.hide()))}),{title:null!==(n=t.title)&&void 0!==n?n:this.$t("input_unlock_password"),message:this.$t("require_unlock_password")})}async function D(e,t={}){if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");const{password:n}=t,o={encode:e=>m.a.enc.Base64.stringify(m.a.enc.Utf8.parse(e)),decode:e=>m.a.enc.Utf8.stringify(m.a.enc.Base64.parse(e))},a=await h["a"].encryptLibKeyObj(e,n).catch((()=>null));if(!a)throw new Error("error_password");const s=Math.floor(Date.now()/1e3);await this.$writeFile(`${g.a.displayName.replace(/\s/g,"_")}-libkey-${s}.abk`,o.encode(a))}async function N(){const e=async()=>{try{$(["createKeyObj","1"],"ensure logout"),await o["a"].logout();const e=v()+w(35),t=w(),n=e.substring(0,12);$(["createKeyObj","2"],"register"),await k((async()=>{await o["a"].register(e,t,{name:n,description:"",avatar:""})}));const a=e=>{var t;if(null===e||void 0===e||null===(t=e._)||void 0===t||!t.sea)throw new Error("current_lib_key_does_not_exist");const n=e._.sea;if(["epriv","epub","priv","pub"].some((e=>!n[e])))throw new Error("invalid_key");return n},s=a(Object(i["t"])());return $(["createKeyObj","3","created"],s),s}catch(e){throw console.error(e),new Error("failed to create lib key obj")}finally{$(["createKeyObj","4"],"logout"),await o["a"].logout()}};return await O.call(this,e,{delay:1e4,timeout:15e3,messages:{processing:this.$t("creating_lib_key"),failed:this.$t("failed_to_create_lib_key")}})}async function L(){var e;if(!o["a"].user||null===(e=o["a"].user._)||void 0===e||!e.sea)throw new Error("current_lib_key_does_not_exist");const t=o["a"].user._.sea;if(["epriv","epub","priv","pub"].some((e=>!t[e])))throw new Error("invalid_key");return t}async function j(e,t=!0){const n=async()=>{if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");return $(["loadKeyObj"],"lib.login"),await k((async()=>{await o["a"].logout(),await o["a"].login(e)})),$(["loadKeyObj"],"lib.prepareData"),await o["a"].prepareData(),!0};return t?await O.call(this,n,{delay:1e4,timeout:6e4,messages:{processing:this.$t("loading_lib_key"),failed:this.$t("failed_to_load_lib_key")}}):await n()}async function R(){localStorage.removeItem(`library-pair@${i["e"]}`),await o["a"].logout()}async function U(e){const t=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"});let n=!1;const o=x.call(this,this.$t("loading_keychain_state"));await new Promise((e=>setTimeout(e,1e3)));const a=await this.$store.dispatch("syncKeychainState").catch((e=>(t(e.message),null)));if(!a)return o.hide(),n;const s=!(null===a||void 0===a||!a.lib),i=!!a.hash;a.unset&&a.hash;if(s){let e=5;const t=await new Promise((async t=>{const n=this.$alphabiz.dialog({title:this.$t("store_your_lib_key"),message:this.$t("confirm_update_cloud_key"),ok:{color:"negative",textColor:"negative",disable:!!e,label:`${this.$t("ok")} (${e})`},cancel:!0}),o=Date.now(),a=setInterval((()=>{const t=Math.floor((Date.now()-o)/1e3);e=5-t,0===e&&clearInterval(a),n.update({ok:{color:"negative",textColor:"negative",disable:!!e,label:e?`${this.$t("ok")} (${e})`:this.$t("ok")}})}),1e3);t(!!await n.promise())}));if(!t)return o.hide(),n}if(i)try{o.update({progress:this.$t("backing_up")}),await E.call(this,e,{mode:"cognito_hash",password:void 0}),n=!0}catch(r){t(r.message)}finally{o.hide()}else{o.hide();const a=async(o,a)=>{try{await E.call(this,e,{mode:"independent_password",password:a}),n=!0,o.hide()}catch(r){t(r.message)}},i=s?I:P,l=s?{message:this.$t("update_cloud_key_prompt_password")}:{message:this.$t("store_cloud_key_prompt_password")};await i.call(this,a,l)}return n}async function F(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=async t=>{let n=null;const o={label:this.$t("import_from_cloud"),value:"import_from_cloud",disable:!0,desc:this.$t("loading_keychain_state")},a=e=>e.dialog$useLoadingState("ok",(()=>(n&&n(),t(e,e.dialog$arguments().option)))),s={type:"radio",model:"import_from_cloud",items:[o,{label:this.$t("import_lib_key_from_local"),value:"import_from_local"},{label:this.$t("create_new_key"),value:"create_new_key"}]},i=this.$alphabiz.dialog({title:this.$t("create_or_import_key"),message:this.$t("create_or_import_key_desc"),options:s,ok:a});function r(e){const t=e=>{o.label=e?`${this.$t("import_from_cloud")} (${e}s)`:this.$t("import_from_cloud"),i.update({options:Object.assign({},s)})};let n=null;const a=new Promise((o=>{let a=e,s=setInterval((()=>{if(a<=0)return n(!0);t(a),a-=1}),1e3);n=e=>{s&&clearInterval(s),s=null,o(e)}}));return a.then((e=>{if(t(),e)return i.vm.handleOk()})),()=>n(!1)}await this.$store.dispatch("syncKeychainState").then((e=>{e.lib?(o.disable=!1,o.desc=this.$t("sync_at",{time:this.$d(e.timestamps.lib,"YMDHms")}),s.model="import_from_cloud"):(o.disable=!0,o.desc=this.$t("cloud_storage_disabled"),s.model="import_from_local"),i.update({options:Object.assign({},s)})})).catch((t=>e(t.message))),o.disable||(n=r.call(this,6),this.$watch((()=>i.vm.dialog$arguments().option),(()=>n()))),await i.promise()};await n((async(n,o)=>{$(["select",o]);const a=async e=>{const o=await j.call(this,e);o&&(t(),n.hide())};if("create_new_key"===o){const t=await N.call(this);if(!t)return;let n=!1;const i=async t=>{const a=async t=>{const n={type:"radio",model:"backup_to_cloud",items:[{label:this.$t("save_local"),value:"save_local"},{label:this.$t("backup_to_cloud"),value:"backup_to_cloud",desc:this.$t("loading_keychain_state")}]},o=this.$alphabiz.dialog({title:this.$t("store_your_lib_key"),cancel:!0,options:n,ok:e=>e.dialog$useLoadingState("ok",(()=>t(e,e.dialog$arguments().option)))});await this.$store.dispatch("syncKeychainState").then((e=>{const t=!(null===e||void 0===e||!e.lib);e.unset&&e.hash;n.items[1].desc=t?this.$t("update_cloud_key"):this.$t("enable_cloud_storage"),o.update({options:Object.assign({},n)})})).catch((t=>e(t.message))),await o.promise()};await a((async(a,s)=>{if($([o,s]),"save_local"===s)await P.call(this,(async(o,s)=>{try{await D.call(this,t,{password:s}),n=!0,o.hide(),a.hide()}catch(i){e(i.message)}}),{title:this.$t("input_unlock_password"),message:this.$t("export_local_prompt_password")});else if("backup_to_cloud"===s){if(n=await U.call(this,t),!n)return;a.hide()}}))};if(await i(t),!n)return;try{$([o,"stored"]),await a(t)}catch(s){e(s.message)}}else if("import_from_local"===o)await A.call(this,a);else if("import_from_cloud"===o){$([o,"syncKeychainState"]);const t=await this.$store.dispatch("syncKeychainState").catch((t=>(e(t.message),null)));if(null===t||void 0===t||!t.lib)return $([o,"cloud_lib_key_not_existed"]),void e("cloud_lib_key_not_existed");if(t.unset&&t.hash){$([o,"use_cognito_hash"]);try{const e=await q.call(this,{mode:"cognito_hash",password:void 0});await a(e)}catch(s){e(s.message)}return}$([o,"use_independent_password"]),await I.call(this,(async(t,n)=>{try{const e=await q.call(this,{mode:"independent_password",password:n});await a(e),t.hide()}catch(s){e(s.message)}}),{message:this.$t("require_independent_password")})}}))}async function M(){try{const e=await this.$store.dispatch("syncKeychainState");if(null!==e&&void 0!==e&&e.lib)return!1;const t=await N.call(this);if(!t)throw new Error("failed_to_create_keyObj");const n=await U.call(this,t);if(!n)throw new Error("failed_to_store_keyObj");const o=await j.call(this,t);if(!o)throw new Error("failed_to_load_keyObj");return!0}catch(e){return $(["lib$auto_create","cancel"],e.message),!1}}const B={mixins:[u],created(){this.$amplify.addOnAuthStateChangedListener((async e=>{if("signedIn"!==e)return;S.setLoading(!0);const t=()=>{const e=localStorage.getItem(`library-pair@${i["e"]}`);if(!e)return;const t=JSON.parse(e);return["epriv","epub","priv","pub"].some((e=>!t[e]))?void 0:t},n=t();if(n)await j.call(this,n,!1);else{const e=await M.call(this);e||await F.call(this)}S.setLoading(!1)})),this.$amplify.addOnAuthStateChangedListener((async e=>{"signedOut"===e&&await R.call(this)}))}},Q={mixins:[u],beforeCreate(){if("KeychainItem"!==this.$options.name&&"MnemonicCode"!==this.$options.name)throw new Error(`Unsupported Component: ${this.$options.name}`)},methods:{async lib$exportCurrentKey(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=await L.call(this).catch((t=>(e(t.message),null)));if(!t)return;await P.call(this,(async(n,o)=>{await D.call(this,t,{password:o}).then((()=>n.hide()),(t=>e(t.message)))}),{title:this.$t("input_unlock_password"),message:this.$t("export_local_prompt_password")})},async importKeyObject(e){const t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"});return j.call(this,e).then(t)},async lib$importLocalKey(){const e=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"});await A.call(this,(async t=>{await j.call(this,t),e()}))},async lib$backupCurrentKey(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=await L.call(this).catch((t=>(e(t.message),null)));if(!n)return;const o=x.call(this,this.$t("loading_keychain_state"));await a["a"].dispatch("syncKeychainState").then((async a=>{const s=await T.call(this);if(s)if(a.hash&&a.unset){o.update({progress:this.$t("backing_up")});try{await E.call(this,n,{mode:"cognito_hash",password:void 0}),t()}catch(i){e(i.message)}finally{o.hide()}}else{o.hide();const a=e=>P.call(this,e,{title:this.$t("input_independent_password"),message:this.$t("update_cloud_key_prompt_password")});await a((async(o,a)=>{try{await E.call(this,n,{mode:"independent_password",password:a}),t(),o.hide()}catch(i){e(i.message)}}))}else o.hide()}),(t=>{e(t.message),o.hide()}))},async lib$exportCloudKey(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=x.call(this,this.$t("loading_keychain_state")),n=await a["a"].dispatch("syncKeychainState").catch((t=>(e(t.message),null))).finally(t.hide);if(!n)return;const o=async e=>{let t=this.$t("export_key_with_cloud"),o={unlockPassword:{type:"password",model:"",label:this.$t("key_file_unlock_password"),rules:[_["c"].bind(this),_["d"].bind(this)]},reEnterPassword:{type:"password",model:"",label:this.$t("re_enter_unlock_password"),rules:[e=>o.unlockPassword.model===e||this.$t("account_password_not_equal")]}};const a=n.unset&&n.hash;a?t+=`; ${this.$t("independent_password_not_enabled")}`:o={password:{type:"password",model:"",label:this.$t("cloud_independent_password"),rules:[_["c"].bind(this),_["d"].bind(this)]},...o};const s=this.$alphabiz.dialog({title:this.$t("export_key"),message:t,prompts:o,cancel:!0,ok:t=>t.dialog$useLoadingState("ok",(async()=>{const{prompts:n}=t.dialog$arguments();await e(t,n.password||"",n.unlockPassword,a?"cognito_hash":"independent_password")}))});await s.promise()};await o((async(t,n,o,a)=>{try{const e=await q.call(this,{mode:a,password:n});await D.call(this,e,{password:o}),t.hide()}catch(s){e(s.message)}}))}}},W={methods:{async lib$openABK(e){const t=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),o=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"});if(!y)return;const a=n("b052").ipcRenderer;[".abk"].some((t=>e.endsWith(t)))&&(e=await a.invoke("read-abk",e));const s=async()=>{const n=async()=>{const t=this.$alphabiz.dialog({title:this.$t("open_keychain_file"),message:this.$t("confirm_open_abk",{filename:e}),cancel:!0});return!!await t.promise()};await n()&&await A.call(this,(async e=>{$(["lib$openABK","keyObj"],e);const n=async e=>{const n={type:"radio",model:"use_the_key",items:[{value:"use_the_key",label:this.$t("use_the_key")},{value:"backup_the_key",label:this.$t("backup_the_key"),desc:this.$t("loading_keychain_state")}]},o=this.$alphabiz.dialog({title:this.$t("open_keychain_file"),options:n,cancel:!0,ok:t=>t.dialog$useLoadingState("ok",(()=>e(t,t.dialog$arguments().option)))});await this.$store.dispatch("syncKeychainState").then((e=>{const t=!(null===e||void 0===e||!e.lib);e.unset&&e.hash;n.items[1].desc=t?this.$t("update_cloud_key"):this.$t("enable_cloud_storage"),o.update({options:Object.assign({},n)})})).catch((e=>t(e.message))),await o.promise()};await n((async(n,a)=>{$(["lib$openABK","selectAction"],a);try{if("use_the_key"===a)await j.call(this,e);else if("backup_the_key"===a){const t=await U.call(this,e);if(!t)return}o(),n.hide()}catch(s){t(s.message)}}))}),{title:this.$t("open_keychain_file"),dataStr:e})};"signedIn"===this.$store.state.account.authState?($(["lib$openABK","hot boot"]),await s()):($(["lib$openABK","cold boot"]),this.$amplify.addOnAuthStateChangedListener((async e=>{"signedIn"===e&&await s()}),{once:!0}))}}}},a44b:function(e,t,n){"use strict";n("c5fa")},a51a:function(e,t){e.exports={github:{username:"tanshuai",repo:"alphabiz",branch:"main",internalRepo:"alphabiz-app"},bucketUrl:"https://s3.amazonaws.com/internal.alpha.biz",s3DownloadUrl:"https://d2v5t3td4po4es.cloudfront.net/releases/"}},a5d3:function(e,t,n){},a5fe:function(e,t,n){},a749:function(e,t,n){"use strict";var o=n("8750"),a=n("a368"),s=n("8a63"),i=n("5584"),r=n("1926"),l=n("d558");const c=e=>{if(Object(l["a"])()){if(!e.connected)return console.log("Network offline");if("cellular"===e.connectionType){if(i["a"].getters.settings.downloadWithCellular)return console.log("User allowed download with cellular");Object(s["d"])(!0),Object(s["e"])(!0),o["a"].create({title:r["b"].t("download_with_cellular"),message:r["b"].t("download_with_cellular_desc"),ok:r["b"].t("download_with_cellular_confirm"),cancel:r["b"].t("pause_all")}).onOk((()=>{i["a"].dispatch("set",{downloadWithCellular:!0}).then((()=>{i["a"].dispatch("fetchSettings"),Object(s["c"])(!0),Object(s["h"])(!0)}))}))}else e.connectionType}},d=async()=>{a["Network"].addListener("networkStatusChange",(e=>{c(e)}));const e=await a["Network"].getStatus();c(e)};d(),t["a"]=c},a75f:function(e,t,n){},aa59:function(e,t,n){},aa8a:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));var o=n("fc3a"),a=n("a368"),s=n("d558");async function i(){if(Object(s["a"])()){const{value:e,type:t}=await a["Clipboard"].read();return t.startsWith("text")||"url"===t?e:""}return navigator.clipboard.readText()}async function r(e){return Object(s["a"])()?a["Clipboard"].write({string:e}):Object(o["a"])(e)}},abc6:function(e,t,n){"use strict";(function(e){n("a1c1"),n("0c26"),n("de6c"),n("f200"),n("7a76");var o=n("7471"),a=n("ec793"),s=n("1ef4"),i=n("4d52"),r=n("508e"),l=n.n(r),c=n("fb31"),d=n.n(c);const u=d.a.protocol,h=d.a.shortProtocol,p=e=>encodeURIComponent(e.trim().replace(/\s+/g," ")),m=async(t,n)=>{const a=p(n||t.name||`${u}_task`),s=e.from(t.protocolType+t.hash,"hex").toString("base64").replace(/\//g,"_"),i=a.replace(/\s/g,"+").replace(/_/g,"+d;").replace(/\//g,"_").replace(/&/g,"+amp;")+"/"+s,r=[],l=[];for(const e of t.trackers||[])"number"===typeof e?r.push(e.toString(16)):l.push(e);let c=r.map((e=>("0000"+e).slice(-4))).join("");l.length&&(c=c+"&tr="+l.join("&"));for(const e in t.data)Array.isArray(t.data[e])?c=c+"&"+e+"="+t.data[e].join(""):"string"===typeof t.data[e]&&(c=c+"&"+e+"="+t.data[e]);const d=(await o["a"].compress(c,9)).toString("base64");return c=e.from(c).toString("base64"),c.length>1.1*d.length&&(c=d),c.length?u+"://"+i+"&"+c.replace(/\//g,"_"):u+"://"+i},_=async t=>{if(console.log("toObject",t),!t.startsWith(`${u}://`))return null;const n=t.replace(`${u}://`,"").replace(/\/+$/,"").split("&");n.length>2&&console.error("str is invalid alphabiz uri");const[a,s]=n,i=a.lastIndexOf("/");if(-1===i)return null;const r=a.substring(0,i).replace(/\+amp;/g,"&").replace(/_/g,"/").replace(/\+d;/g,"_").replace(/\+/g," ")||"",c=a.substring(i+1),d=e.from(c.replace(/_/g,"/"),"base64").toString("hex");console.log(d,c,s);const h=d.substring(0,2),p=d.substring(2);let m="";try{const t=e.from(s.replace(/_/g,"/"),"base64");console.log("buffer",t);const n=await o["a"].decompress(t);n&&(m=n.toString("base64"))}catch(v){console.log("LZMA decompress failed.",v.message),m=s||""}const _=e.from(m,"base64").toString().split("&"),[f,...g]=_,b=[];if(f.includes("="))g.unshift(f);else for(let e=0;e{if(!f.length)return g.clear(),void(b=!1);const e=f.shift();if(!e||!g.has(e))return y();b=!0;const t=g.get(e);g.delete(e),m(a["a"].toObject(t.url),t.name).then((e=>{"function"===typeof t.cb&&t.cb(null,e),Array.isArray(t.cb)&&t.cb.forEach((t=>{"function"===typeof t&&t(null,e)}))})).catch((e=>{console.error(e),t.cb(e)})).finally((()=>{b=!1,y()}))},v=async(e,t)=>{const{hash:n,url:o,name:a}=e;if(!o)return console.log("error encoding",e),t(new Error(n),o);if(o.startsWith("magnet")){const e=Date.now();if(f.includes(n)){const o=g.get(n);if(o){if(e-o.timestamp<5)return void(Array.isArray(o.cb)?o.cb.push(t):o.cb=[o.cb,t]);"function"===typeof o.cb?o.cb(new Error(`Cannot encode ${o.url}`)):Array.isArray(o.cb)&&o.cb.forEach((e=>{"function"===typeof e&&e(new Error(`Cannot encode ${o.url}`))})),g.delete(n)}else f.splice(f.indexOf(n),1)}return g.set(n,{url:o,timestamp:e,name:a,cb:t}),f.push(n),void(b||y())}if(o.startsWith(h+"-library")){const e=await m(s["a"].toObject(o));return t(null,e)}if(o.startsWith(i["a"].config.prefix)){const e=await m(i["a"].toObject(o));return t(null,e)}return console.log("error encoding",e),t(new Error(n),o)},w=async e=>{const t=await _(e.startsWith(h+":")?e.replace(`${h}://`,`${u}://-/`):e);switch(t.protocolType){case"01":return a["a"].fromObject(t);case"02":return s["a"].fromObject(t);case i["a"].config.type:return i["a"].fromObject(t)}throw console.log(t),new Error(`Unsupported protocol type ${t.protocolType}`)};t["a"]={encode:v,decode:w}}).call(this,n("eb72").Buffer)},ac09:function(e,t,n){"use strict";n("8dc9")},ac84:function(e,t,n){},ae24:function(e,t,n){},ae46:function(e){e.exports=JSON.parse('{"packageVer":"0.2.4","channel":"web","buildTime":"202308081821","buildCommit":"c8725f94","sourceCommit":"c8725f94","version":"0.2.5-web"}')},aecb:function(e,t,n){"use strict";(function(e){n("a1c1"),n("de6c"),n("0c26");var o=n("61af"),a=n.n(o),s=n("a3fc"),i=n.n(s),r=n("9a50"),l=n("5584"),c=n("d310"),d=n("d7df"),u=n("c5a5"),h=n("3aea"),p=n("d710"),m=n("d558"),_=n("aa8a"),f=n("36a1"),g=n("a368"),b=n("908d");const y=Object(c["isElectron"])()?n("b052").ipcRenderer:{};t["a"]={name:"TaskDialog",inject:["taskQueue"],components:{FileSelector:r["a"]},data(){const e=l["a"].getters.settings,t={downloadDirectory:e.downloadDirectory,uploadSpeed:e.uploadSpeed,downloadSpeed:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,payedUserShareRadix:e.payedUserShareRadix,trackers:e.trackerList||[],saveLinkSeed:e.saveLinkSeed,defaultVideoPlayer:e.defaultVideoPlayer};return{isElectron:Object(c["isElectron"])(),isCapacitor:Object(m["a"])(),value:!1,tab:"url",mode:"download",currentTab:"url",setAsDefault:!1,input:"",inputFile:null,onMagnetCloseCallbacks:[],settings:t,libraryDialog:null}},computed:{disableTasks(){return!!l["a"].getters.shouldDisableTasks||!!l["a"].getters.settings.forceLogin&&(!l["a"].getters.accountUserInfo||!l["a"].getters.accountUserInfo.sub)}},methods:{updateSettings(){const e=l["a"].getters.settings;this.settings={downloadDirectory:e.downloadDirectory,uploadSpeed:e.uploadSpeed,downloadSpeed:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,payedUserShareRadix:e.payedUserShareRadix,trackers:e.trackerList||[],saveLinkSeed:e.saveLinkSeed,defaultVideoPlayer:e.defaultVideoPlayer}},show(e,t){"string"===typeof e&&["download","upload"].includes(e)&&(this.mode=e),"string"===typeof t?(this.input=t,this.inputFile=null,this.tab="url"):"object"===typeof t&&null!==t?(this.input="",this.inputFile=t,this.tab="file",console.log("File",t)):(this.input="",this.inputFile=null),this.value=!0,this.$nextTick((()=>{this.updateSettings()}))},hide(){this.value=!1},toggle(){this.value=!this.value},selectFolder(){var e;if(!Object(c["isElectron"])())return null===(e=this.$refs.folderSelector)||void 0===e?void 0:e.click();const t="download"===this.mode?[{name:"Torrent",extensions:["torrent"]}]:[];y.once("select_file_or_directory",((e,t)=>{if(t&&!t.canceled&&t.filePaths&&t.filePaths.length){const e=a.a.statSync(t.filePaths[0])?t.filePaths[0]:i.a.basename(t.filePaths[0]);this.inputFile=[{path:e,name:e}],console.log("select folder",this.inputFile)}else console.log("skip select folder",t)})).send("select_file_or_directory",t)},onFileSelected(e){console.log("Select",e),Array.isArray(e)?this.inputFile=e:e instanceof File?this.inputFile=[e]:console.log("Invalid file",e)},onFolderSelected(e){if(!Array.isArray(e)||!e.length)return console.log("not files");console.log("Select",e),this.inputFile=e},selectSavePath(){Object(c["isElectron"])()&&y.once("select_directory",((e,t)=>{if(!t||t.canceled||!t.filePaths)return;const n=t.filePaths[0];n&&(this.settings.downloadDirectory=n,this.setAsDefault&&l["a"].dispatch("set",{downloadDirectory:n}))})).send("select_directory")},downloadTorrent(){const e=this.inputFile&&(this.inputFile.path||this.inputFile[0].path);let t=this.input;if(t.includes(p["shortProtocol"]+"://")){let e=0;t=t.replace(new RegExp(`${p["shortProtocol"]}://`,"g"),(()=>e++?`${p["protocol"]}://${p["protocol"]}task-${e}/`:`${p["protocol"]}://${p["protocol"]}task/`))}if("url"===this.tab&&!["magnet",p["protocol"],p["shortProtocol"]].some((e=>t.startsWith(e+":"))))return this.$q.notify(this.$t("invalid_download_url"));d["a"].emit("download_torrent",{type:this.tab,url:t,file:e,token:"url"===this.tab?t:e||t,...this.settings}),this.value=!1,this.input=""},async uploadTorrent(){console.log("Upload torrent",this.inputFile);const t=this.inputFile;if(console.log("n",t.name),Object(m["a"])()&&b["b"].is.ios){const n=Date.now(),o=this.$q.dialog({message:this.$t("open_file")+"...",persistent:!0,ok:!1,cancel:!1}),a=i.a.join("Uploads",t.name);console.log("Delete"),await g["Filesystem"].mkdir({directory:g["Directory"].Documents,path:i.a.dirname(a),recursive:!0}),await g["Filesystem"].deleteFile({path:a,directory:g["Directory"].Documents});let s=0;console.log("Start writing",a);const r=new FileReader,l=1e7;let c=0,u=c+l;const h=async n=>{const i=n;s+=i.byteLength,await g["Filesystem"].appendFile({path:a,directory:g["Directory"].Documents,data:e.from(n).toString("base64")}),o.update({message:this.$t("open_file")+`... (${(s/t.size*100).toFixed(2)}%)`}),c+=l,u+=l,c{if(c>=t.size)return console.log("done");const e=t.slice(c,u);r.readAsArrayBuffer(e)};r.onload=()=>{const e=r.result;h(e)},r.onerror=()=>{console.log("error",r.error.code,r.error.toString(),r.readyState,r.DONE),console.log("codes",r.error.NOT_FOUND_ERR,r.error.SECURITY_ERR,r.error.ABORT_ERR),console.log("file",t.name,t.size),console.log("Cost",Date.now()-n),m()};const m=()=>{o.hide(),this.value=!1,setTimeout((()=>{this.$q.dialog({message:this.$t("file_too_large"),ok:this.$t("ok")})}),500)},_=async()=>{console.log("Cost",Date.now()-n),console.log("Finish writing file",t.name);const{uri:e}=await g["Filesystem"].getUri({path:a,directory:g["Directory"].Documents});console.log("saved",decodeURI(e.replace("file://",""))),d["a"].emit("seed_torrent",{file:[decodeURI(e.replace("file://",""))],token:t.name,...this.settings}),this.value=!1,setTimeout((()=>{o.hide()}),1e3)};return p()}const n=this.inputFile.path?[this.inputFile.path]:this.inputFile.map((e=>e.path));d["a"].emit("seed_torrent",{file:n,token:n[0],...this.settings}),this.value=!1},submit(){(""!==this.input||this.inputFile)&&("download"===this.mode?this.downloadTorrent():this.uploadTorrent())},onPasteFile(e,t){console.log("on paste file",e);const n=decodeURI(e.replace(/^file:\/\//,""));if(!a.a.existsSync(n))return console.log("Not exists");const o=n.includes("/")?n.split("/").filter((e=>e)).pop():n;e.endsWith(".torrent")?this.show("download",[t||{path:n,name:o}]):this.$q.dialog({html:!0,title:this.$t("upload"),message:this.$t(`ask_if_upload_file
${n}
`),ok:this.$t("upload"),cancel:this.$t("cancel")}).onOk((()=>{d["a"].emit("seed_torrent",{file:[n],token:n,settings:this.settings})}))},onPasteUrl(e){if(!e.startsWith(p["protocol"]+"://$"))return e.startsWith("magnet:")||e.startsWith(p["protocol"]+":")||e.startsWith(p["shortProtocol"]+":")?void this.show("download",e):console.log("error not magnet",e)},onPasteLibraryUrl(e){if(this.libraryDialog)return;if(!e.startsWith(p["shortProtocol"]+"-library"))return;const[t,n,o]=e.replace(new RegExp(`^${p["shortProtocol"]}-library://`),"").split("/");let a=0;const s=()=>{const i=Object(h["c"])(o);if(!i)return a||this.$q.notify(this.$t("loading")),a++<5?setTimeout(s,2e3):(console.log("cannot parse",e),void this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}));"channel"===t&&(this.libraryDialog=this.$q.dialog({title:this.$t("go_to_library"),message:this.$t("go_to_library_channel_msg",[decodeURIComponent(n||o)]),ok:this.$t("ok"),cancel:this.$t("cancel")}).onOk((()=>{this.$root.$emit("navigate-to"),this.$router.push(i+"&fromLink=1"),setTimeout((()=>this.$root.$emit("navigate-to",i))),this.libraryDialog=null})).onDismiss((()=>{this.libraryDialog=null})))};f["a"].whenReady.then(s)},async onPaste(e){if(!Object(c["isElectron"])()&&!Object(m["a"])())return;if(this.value)return;const t=e._ab_payload_;console.log(t);const n=t||e.clipboardData.getData("text")||e.clipboardData.files;if(console.log("onPaste",n),"object"===typeof n&&n.path&&this.onPasteFile(n.path,n),this.disableTasks)return console.log("wait for login to continue",n),this.taskQueue.push({type:"download",file:n});if("function"===typeof e._onClose&&this.onMagnetCloseCallbacks.push(e._onClose),n.startsWith("file://"))return this.onPasteFile(n),e.preventDefault();if(n.startsWith("magnet:"))return this.onPasteUrl(n),e.preventDefault();if([p["protocol"],p["shortProtocol"]].some((e=>n.startsWith(e+":")))){const t=await Object(u["a"])(n);return t.startsWith("magnet:")?this.onPasteUrl(n):t.startsWith(p["shortProtocol"]+"-library")?this.onPasteLibraryUrl(t):console.warn("unknown url:",t),e.preventDefault()}}},mounted(){this.$root.$off("openTaskDialog"),this.$root.$off("closeTaskDialog"),this.$root.$on("openTaskDialog",((...e)=>{console.log("open task",...e),this.show(...e)})),this.$root.$on("closeTaskDialog",(()=>this.hide())),document.body.addEventListener("paste",this.onPaste)},watch:{value(e){if(e&&"download"===this.mode){if(this.input||this.inputFile&&"file"===this.tab)return;const e=async e=>{if(!e)return;const t=e.trim();if(["magnet",p["protocol"],p["shortProtocol"]].some((e=>t.startsWith(e+":")))){const e=t.startsWith("magnet")?t:await Object(u["a"])(t);if(!e||!e.startsWith("magnet"))return;this.tab="url",this.input=t}};Object(_["a"])().then(e).catch((()=>{console.log("cannot read clipboard")}))}const t=this.onMagnetCloseCallbacks.splice(0);t.forEach((e=>{"function"===typeof e&&e()})),this.input="",this.inputFile=null}}}}).call(this,n("eb72").Buffer)},af04:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("7ca3"),a=n.n(o),s=(n("a1c1"),n("0c26"),n("f680")),i=n("1926"),r=n("d310");class l{static showRaw(e,t){s["a"].create({message:e,type:t,position:"bottom-right",timeout:5e3})}static show(e,t,n){const o="account_",a=o+e.replace(/ /g,"_"),r=i["b"].t(a,n);s["a"].create({message:r,type:t,position:"bottom-right",timeout:5e3})}static showPositive(e){this.show(e,"positive")}static showNegative(e){let t;e=e.replace("PreSignUp failed with error ",""),e=e.replace("CustomMessage failed with error ",""),e=e.replace("VerifyAuthChallengeResponse failed with error ",""),"."===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),0===e.indexOf("Cognito received the following error from Amazon SES when attempting to send email:")?e="error_email_not_exists":["Member must satisfy regular expression pattern: [0-9]+","Member must have length greater than or equal to 6","Member must have length less than or equal to 6"].findIndex((t=>e.indexOf(t)>=0))>=0&&(e="error_mfa_token_mismatch"),e.indexOf("$recaptcha")>=0&&(e="Recaptcha Validation Failed"),"No user info"===e&&(e="Network Error"),"XhrError"===e&&(e="Network Error");const n="data::",o=e.lastIndexOf(n);if(o>=0){t=e.substring(o+n.length),e=e.substring(0,o).trim();try{t=JSON.parse(t)}catch{}}if("error_1_message_60_seconds"===this.ERROR_EVENTS[e]){const e=new Date(t.time).getTime()+6e4-(new Date).getTime();t={delta:Math.min(Math.max(Math.ceil(e/1e3),1),60)}}else if("error_10_messages_per_day"===this.ERROR_EVENTS[e]){const e=new Date(t.time).getTime()+864e5;t={date:e}}const a=!Object.keys(this.ERROR_EVENTS).includes(e);if(a)this.showRaw(e,"negative",t);else{const n=this.ERROR_EVENTS[e];if("error_network"===n)return void c();this.show(n,"negative",t)}}}function c(){s["a"].create({icon:"wifi_tethering_error",multiLine:!0,message:i["b"].t("account_error_network"),type:"negative",position:"bottom-right",timeout:5e3,actions:[{noCaps:!0,label:i["b"].t("network_diagnotic"),color:"white",handler:()=>{r["Bus"].$emit("CALL_NETWORK_DIAGNOSTIC")}}]})}a()(l,"ERROR_EVENTS",{"Bad destination mailbox address":"email_invalid_address","Invalid domain":"email_invalid_domain","Other or undefined mailbox status":"email_unknown_status","Mailbox unavailable":"email_unavailable_address","Suppressed email address":"email_suppressed_address","Invalid code provided, please request a code again":"account_error_invalid_verification_code","Network error":"error_network","Network Error":"error_network","timeout of 0ms exceeded":"error_network","User does not exist":"error_user_not_exist","Incorrect username or password":"error_incorrect_username_or_password","Username/client id combination not found":"error_username_not_found","Cannot reset password for the user as there is no registered/verified email or phone_number":"error_can_not_reset_for_no_verified","Invalid verification code provided, please try again":"error_invalid_verification_code","Password did not conform with policy: Password not long enough":"error_password_not_long_enough","Attempt limit exceeded, please try after some time":"error_attempt_limit_exceeded","Invalid phone number format":"error_invalid_phone_number_format","User already exists":"error_username_already_exists","Incorrect password":"error_incorrect_password",you_need_to_accept_license_terms:"error_you_need_to_accept_license_terms",incorrect_original_password:"error_incorrect_original_password",unexpected_error:"error_unexpected",invitation_channel_required:"invitation_channel_required",invitation_no_code:"invitation_no_code",can_not_change_email:"error_can_not_change_email_before_phone_bound",can_not_change_phone:"error_can_not_change_phone_before_email_bound",can_not_change_email_phone_with_mfa_enabled:"error_can_not_change_email_phone_with_mfa_enabled",error_same_email:"error_same_email",error_same_phone:"error_same_phone","the code is not an activated code":"error_inactive_code","the code has been used":"error_inactive_code","the code is non-existent":"error_non_existent_code","An account with the given email already exists":"error_email_already_exists","An account with the given phone number already exists":"error_phone_already_exists","Email or phone number is required":"error_email_or_phone_required",error_email_not_exists:"error_email_not_exists",LINKED_ACCOUNT:"error_can_not_link_to_the_linked_account",MISMATCHED_EMAIL:"error_can_not_link_to_the_mismatched_email",error_can_not_link_before_email_verified:"error_can_not_link_before_email_verified",error_can_not_change_email_before_unbound_social_account:"error_can_not_change_email_before_unbound_social_account","Invalid code or auth state for the user":"error_invalid_verification_code","Invalid session for the user, session is expired":"error_expired_verification_code","Invalid session for the user, session can only be used once":"error_expired_verification_code",error_recaptcha_not_loaded:"error_recaptcha_not_loaded","Only 1 message can be sent every 60 seconds":"error_1_message_60_seconds","Only 10 messages can be sent per day":"error_10_messages_per_day",sign_in_failed:"sign_in_failed","Recaptcha Validation Failed":"error_recaptcha_validation_failed","reCAPTCHA verification error":"error_recaptcha_validation_failed","Pending sign-in attempt already in progress":"error_sign_in_in_progress","Invalid code received for user":"error_mfa_token_mismatch","Code mismatch and fail enable Software Token MFA":"error_mfa_token_mismatch","Your software token has already been used once":"error_mfa_token_mismatch","Code mismatch":"error_mfa_token_mismatch",error_mfa_token_mismatch:"error_mfa_token_mismatch",error_can_not_enable_mfa:"error_can_not_enable_mfa","Password attempts exceeded":"error_password_attempts_exceeded"})},afe1:function(e,t,n){},b031:function(e,t,n){},b16a:function(e,t,n){"use strict";n("6ce4")},b1d8:function(e,t,n){"use strict";n("5984")},b2b4:function(e,t,n){"use strict";n("0742")},b34a:function(e,t,n){"use strict";(function(e){n("0c26"),n("de6c"),n("e39c");var o=n("212e"),a=n("229c"),s=n("d710"),i=n.n(s);n("36f2");function r(){var e;const{packageFormat:t,version:o}=s(),a=o.split("-").reduce(((e,t,n)=>({...e,[["version","channel"][n]]:t})),{});return{app_name:i.a.name,app_type:"website",app_env:"production",app_format:null!==t&&void 0!==t?t:"unknown",app_version:a.version,app_channel:null!==(e=a.channel)&&void 0!==e?e:"stable"};function s(){return n("ae46")}}async function l(){const e=await fetch("https://ipinfo.io/json?token=69cbd72732f325").then((e=>e.json())).catch((()=>null));if(!e)return!1;console.log("Analytics.location:",e);const t={country:e.country};await a["a"].updateEndpoint({location:t})}async function c(e){e.router.app.addOnAuthStateChangedListener((async t=>{"signedIn"===t&&await a["a"].updateEndpoint({userId:e.store.state.account.sub})}))}t["a"]=async(t,{app:n})=>{if(Object(o["a"])({eventHandlers:{"_userauth.sign_up":(e,t)=>{},"_userauth.sign_in":(e,t)=>{},"_userauth.sign_out":(e,t)=>{}}}),e&&e.env.TEST_EMAIL_DOMAIN||(document.cookie||"").split(";").map((e=>e.trim())).includes("TestEnv=true"))return void a["a"].configure({disabled:!0});const s=r();console.log("Analytics.app_data:",s),a["a"].configure({AWSPinpoint:{endpoint:{attributes:{...Object.entries(s).reduce(((e,[t,n])=>({...e,[t]:[n]})),{})},metrics:void 0}}}),await Promise.all([l(),c(n)])}}).call(this,n("28d0"))},b36a:function(e,t,n){},b37d:function(e,t,n){var o,a;n("de6c"),n("7996");class s{constructor(e,t,{first:n,last:o,odd:a,even:s}={}){this.name=e,this.style=t,this.first=null!==n&&void 0!==n?n:{},this.last=null!==o&&void 0!==o?o:{},this.odd=null!==a&&void 0!==a?a:{},this.even=null!==s&&void 0!==s?s:{}}withTagStyle(e){const t=e.map(((t,n)=>{const o={};return Object.assign(o,this.style,(n+1)%2===0?this.even:this.odd,0===n?this.first:{},n===e.length-1?this.last:{}),Object.entries(o).map((e=>e.join(": "))).join("; ")}));return[e.map((e=>`%c${e}`)).join(""),t]}}const i=Object.entries({neutral:[["rgb(146,146,146)","white"],["rgb(207,207,207)","black"]],red:[["rgb(232,126,126)","black"],["rgb(255,194,194)","black"]],orange:[["rgb(255,175,118)","black"],["rgb(255,215,196)","black"]],green:[["rgb(87,168,102)","white"],["rgb(200,246,213)","black"]],purple:[["rgb(125,114,253)","white"],["rgb(200,184,255)","black"]],blue:[["rgb(57,145,208)","white"],["rgb(184,215,255)","black"]],yellow:[["rgb(238,194,62)","black"],["rgb(255,238,158)","black"]],black:[["rgb(60,60,60)","white"],["rgb(90,90,90)","white"]]}).reduce(((e,[t,n])=>({...e,[t]:new s(t,{padding:"2px 6px","font-size":"0.7rem"},{odd:{background:n[0][0],color:n[0][1]},even:{background:n[1][0],color:n[1][1]},first:{"padding-left":"10px","border-top-left-radius":"8px","border-bottom-left-radius":"8px"},last:{"padding-right":"10px","border-top-right-radius":"8px","border-bottom-right-radius":"8px","margin-right":"4px"}})})),{});function r(e,t){const n=["log","warn","error","debug","group"],o=new Proxy(e,{get(e,a,s){if("context"===a)return t;if("tag"===a)return l(o,i.neutral);if(n.includes(a)){let e="";const n=[];t.tag_params.forEach((({name:t,tags:o})=>{const a=i[t].withTagStyle(o);e+=a[0],n.push(...a[1])}));const o=Reflect.get(console,a,s);return(...t)=>o(e,...n,...t)}return Reflect.get(e,a,s)}});return o}function l(e,t){const n=function(...n){const o=e!==console?e.context:{message:"",styles:[],tag_params:[]};return o.tag_params.push({name:t.name,tags:n}),r(e,o)};return Object.defineProperties(n,Object.keys(i).reduce(((t,n)=>({...t,[n]:{get(){return l(e,i[n])}}})),{})),n}null!==(a=(o=console).tag)&&void 0!==a||(o.tag=l(console,i.neutral))},b389:function(e,t,n){"use strict";n("a75f")},b3f7:function(e,t,n){(function(t){const o="Alphabiz",a={name:o,displayName:o,fileName:o,appId:"com.zeeis.alphabiz",snapName:o.toLowerCase(),author:`${o} Team `,developer:`${o} Team`,appIdentifier:"org.zeeis.alphabiz",description:`${o} Blockchain Cryptocurrency Application`,appxPackageIdentityName:o,publisher:"CN=zeeis",publisherDisplayName:`${o} Team`,homepage:"https://alpha.biz",webEditionUrl:"https://web.alpha.biz",upgradeCode:"4d8a65aa-fc5b-421c-94ab-cb722ef737e2",protocol:o.toLowerCase(),shortProtocol:"ab",versionsUrl:"https://raw.githubusercontent.com/tanshuai/alphabiz/main/versions.json",twitterAccount:"@alphabiz_app",register:{mode:"none",list:[]},library:{recommends:{default:["fxpebrsi9ij5pzinwdky","cut44dbbfxjpqka39qix"],"zh-CN":["vs52l0yqtqqpqtw33ycx","cut44dbbfxjpqka39qix"]}},update:n("a51a"),takedown:n("41c7"),theme:{color:{primary:"#d1994b",secondary:"#f3ce90",accent:"#fbbb4a"},cornerLogoStyle:{left:"-72px",top:"-92px",height:"245px"}},dynamicConfig:n("937c"),microsoftStoreProductId:"9PBCCV3MHK04",communities:[{enable:!0,url:"https://github.com/tanshuai/alphabiz",icon:"https://github.githubassets.com/favicons/favicon.svg"}],externalI18n:"https://raw.githubusercontent.com/tanshuai/alphabiz/main/i18n"};console.log("INIT APP CONFIG"),t._app_config_=a,t.LIBDB_NAME=a.name,e.exports=a,n("81e0")(a)}).call(this,n("0ee4"))},b4bc:function(e,t,n){},b65b:function(e,t,n){"use strict";(function(e){var o=n("076e"),a=n("bdb1");t["a"]={name:"ABOAuthEntry",i18n:o["a"],data(){let e={Github:{name:"Github",icon:"fab fa-github"},Twitter:{name:"Twitter",icon:"fab fa-twitter"}};return{hide:!1,loadingState:null,providers:e}},computed:{providersEnabled(){return Object.keys(this.providers).filter((e=>this.d$cfg.oauth.providers.includes(e))).reduce(((e,t)=>({...e,[t]:this.providers[t]})),{})}},methods:{async handleClick(e){try{this.loadingState=e.name,await a["a"].login.call(this,e.name)}finally{this.loadingState=null}}}}}).call(this,n("28d0"))},b71d:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"global-recommend-page"},[n("LibraryRecommend",{attrs:{fullscreen:""}})],1)},a=[],s=n("5584"),i=n("36a1"),r=n("36a5"),l={name:"GlobalRecommend",components:{LibraryRecommend:r["a"]},data(){return{selected:[]}},computed:{show(){const e="signedIn"===s["a"].state.account.authState;return!!e&&(!!i["a"].isLoggedIn&&i["a"].isFirstRegister)}},methods:{},mounted(){}},c=l,d=(n("3669"),n("2b5f")),u=Object(d["a"])(c,o,a,!1,null,"67462de2",null);t["a"]=u.exports},bba7:function(e,t,n){},bbb8:function(e,t,n){"use strict";n("8162")},bc42:function(e,t,n){"use strict";n("2d55")},bd3b:function(e,t,n){"use strict";n("5ccc")},bdb1:function(e,t,n){"use strict";n("f200");var o=n("0925");async function a(e,{initial_stage:t="authorize",initial_params:n}={}){const{updateStage:a,hide:s}=o["a"].useOAuthFlowDialog.call(this,{title:"oauth_login.sign_in_with",providerName:e}),i=this.$account.core.createOAuthFlow({initial_stage:t,initial_params:n,stage_restrict:{authorize:["logging_in"],logging_in:[]},handlers:{authorize:()=>{a("authorize",i),this.$account.core.requestOAuthAction({provider:e,action:"login"})},logging_in:()=>(a("logging_in",i),!0),succeed:async()=>{await this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX"),this.$q.notify({message:this.$t("oauth_login.notify.signed_in"),type:"positive",position:"bottom-right",timeout:5e3})}}});await i.promise().catch((t=>{const n=t.message.startsWith("oauth_error")?this.$t(t.message,{provider:e}):t.message;this.$q.notify({message:n,type:"negative",position:"bottom-right",timeout:5e3})})).finally(s)}var s=a;async function i(e,{initial_stage:t="authorize",initial_params:n}={}){const{updateStage:a,hide:s}=o["a"].useOAuthFlowDialog.call(this,{title:"oauth_connect.connect_to",providerName:e}),i=this.$account.core.createOAuthFlow({initial_stage:t,initial_params:n,stage_restrict:{authorize:["connecting"],connecting:[]},handlers:{authorize:()=>{a("authorize",i),this.$account.core.requestOAuthAction({provider:e,action:"connect"})},connecting:()=>(a("connecting",i),!0),succeed:async()=>{this.$q.notify({message:this.$t("oauth_connect.notify.connected",{provider:e}),type:"positive",position:"bottom-right",timeout:5e3})}}});await i.promise().catch((t=>{const n=t.message.startsWith("oauth_error")?this.$t(t.message,{provider:e}):t.message;this.$q.notify({message:n,type:"negative",position:"bottom-right",timeout:5e3})})).finally(s)}var r=i;t["a"]={login:s,connect:r}},c033:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"relative-position follow-btn btn",class:{hovered:e.hovered,followable:e.followable,pending:e.pending,disableFollow:e.disableFollow},on:{mouseover:function(t){e.hovered=!0},mouseleave:function(t){e.hovered=!1},click:e.onClick}},[e.pending?n("q-spinner-dots",{attrs:{size:"18px",thickness:5}}):n("span",{staticClass:"follow-btn-label"},[e._v(e._s(e.followBtnLabel))])],1)},a=[],s=n("5584"),i=n("36a1"),r={name:"LibraryFollowButton",props:{id:String,disableFollow:Boolean},data(){return{hovered:!1}},computed:{pending(){return s["a"].getters.followQueue.includes(this.id)},followable(){return!i["a"].followingChannels.find((e=>e.id===this.id))},followBtnLabel(){return this.followable?this.$t("follow"):this.hovered?this.$t("unfollow"):this.$t("following")}},methods:{async onClick(){if(this.pending)return;if(this.disableFollow)return this.$q.notify("Please wait for loaded");const e=this.id;if(!e)return;if(!i["a"].channelList.some((t=>t.id===e)))return this.$q.dialog({title:this.$t("cannot_find_channel"),message:this.$t("cannot_get_channel_info"),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}});const t=!!this.followable;if(!t){const e=await new Promise((e=>{this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("unfollow")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>e(!1))).onCancel((()=>e(!0)))}));if(e)return}s["a"].commit("addFollowQueue",e),(t=>{let n=0,o=0,a=0;const r=()=>{clearInterval(o),clearTimeout(n),a&&a(),s["a"].commit("removeFollowQueue",e)};o=setInterval((()=>{this.followable===t?(console.log("Failed to toggle follow",e,t,this.followable),t?i["a"].followChannel(e):i["a"].unfollowChannel(e)):r()}),2e3),a=this.$watch("followable",(e=>{e!==t&&r()})),n=setTimeout((()=>{this.followable===t&&this.$q.notify(this.$t("follow_failed_hint"))}),1e4)})(t),t?i["a"].followChannel(e):i["a"].unfollowChannel(e)}}},l=r,c=(n("93e8"),n("2b5f")),d=n("2a5f"),u=n("4101"),h=n("719b"),p=n("09a4"),m=n.n(p),_=Object(c["a"])(l,o,a,!1,null,"711b4078",null);t["a"]=_.exports;m()(_,"components",{QSpinnerDots:d["a"],QColor:u["a"]}),m()(_,"directives",{Ripple:h["a"]})},c036:function(e,t,n){"use strict";n("b4bc")},c066:function(e,t,n){},c228:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));n("a1c1");var o=n("1c53");(()=>{const e=e=>/^(?!(_|[0-9])+$)(([A-Z0-9]|_)+$)/.test(e),t=e=>/^(?!(_|[0-9])+$)(([a-z0-9]|_)+$)/.test(e),n=e=>/^([A-Z])([A-Za-z0-9]+$)$/.test(e),o=e=>/^([a-z])([A-Za-z0-9]+$)$/.test(e),a=t=>e(t)?t.toLowerCase():o(t)?t.replace(/([A-Z])/g,"_$1").toLowerCase():n(t)?t.replace(/([A-Z])/g,"_$1").toLowerCase().substr(1):t.toLowerCase(),s=e=>t(e)?e.toUpperCase():o(e)?e.replace(/([A-Z])/g,"_$1").toUpperCase():n(e)?e.replace(/([A-Z])/g,"_$1").toUpperCase().substr(1):e.toUpperCase(),i=o=>n(o)?o[0].toLowerCase()+o.substr(1):t(o)?o.replace(/_(\w)/g,((e,t)=>t.toUpperCase())):e(o)?o.toLowerCase().replace(/_(\w)/g,((e,t)=>t.toUpperCase())):o,r=e=>o(e)?e[0].toUpperCase()+e.substr(1):(()=>(e=i(e),e=e[0].toUpperCase()+e.substr(1),e))()})();const a=Object.keys(o["countries"]).reduce(((e,t)=>{const n=o["countries"][t];return e[t]={code:t,name:n.native,normalizedName:n.name,emoji:"TW"===t?"🇼🇫":n.emoji,phones:n.phone.split(",").map((e=>e+"-"+t)),languages:n.languages.map((e=>(e+"-"+t).toLowerCase()))},e}),{}),s=Object.keys(a).reduce(((e,t)=>{const{languages:n,name:o,emoji:s,phones:i}=a[t];return n.forEach((n=>{e[n]={code:t,name:o,emoji:s,phones:i,language:n}})),e}),{})}).call(this,n("28d0"))},c294:function(e,t,n){},c49d:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return p})),n.d(t,"d",(function(){return g})),n.d(t,"c",(function(){return b}));n("de6c"),n("a1c1"),n("4db2"),n("c976"),n("4d8f"),n("f991"),n("63b1");var o=n("5584"),a=n("c248"),s=n.n(a),i=n("5515"),r=n("3aea");const l="59243e4a83edb6386ebb99d6d395df1ca5750162",c=[...new Set(o["a"].getters.settings.trackerList.filter((e=>e.startsWith("ws"))).concat("wss://tracker.files.fm:7073/announce","wss://spacetradersapi-chatbox.herokuapp.com:443/announce","ws://tracker.files.fm:7072/announce","wss://tracker.magnetoo.io/announce","wss://qot.abiir.top:443/announce","wss://tracker.dnlab.net:443/announce"))];for(const t of["wss://tracker.btorrent.xyz/announce","wss://tracker.openwebtorrent.com/announce"])c.includes(t)||c.push(t);const d="\n background-color: rgb(137,241,163);\n color: black;\n padding: 1px 5px;\n border-radius: 8px;\n border: 2px solid rgb(87,168,102);\n";let u=function(e,...t){if(o["a"].getters.isDevMode)return console.log("%c%s",d,e,...t)};o["a"].watch(((e,t)=>t.isDevMode),(e=>{u=e?console.log.bind(console,"%c%s",d):function(){}}),{immediate:!0});const h=[];function p(e){h.push(e)}u("Init","tracker-peer with trackers",c);const m=()=>"function"===typeof crypto.randomUUID?crypto.randomUUID().replace("-","").substring(0,12):"function"===typeof crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(6))].map((e=>e.toString(16).padStart(2,"0"))).join(""):new Array(12).fill().map((()=>Math.floor(16*Math.random()).toString(16))).join(""),_=e.from("-AB0000-"+m());u("peerId",_.toString("hex"));const f=new s.a({infoHash:l,peerId:_,port:8765,intervalMs:3e4,announce:[...c],dht:!0,dhtPort:2e4,tracker:{announce:[...c],getAnnounceOpts:()=>{const e={uploaded:1024,downloaded:1024,left:1024};return e}}}),g=()=>{if(!f.tracker)return u("No tracker",f);f.tracker.stop()},b=()=>{if(!f.tracker)return u("No tracker",f);f.tracker.start()},y=e=>{const t=Object.values(i["d"]).map((e=>{var t;return Object(r["e"])((null===(t=e.remoteDescription)||void 0===t?void 0:t.sdp)||"")}));try{const n=e.remoteAddress;n&&t.includes(n)&&u("Duplicate peer",n)}catch(n){return u("Duplicate peer",n,e),e.destroy()}h.forEach((t=>t(e)))};f.on("peer",(e=>{"object"===typeof e&&(e._pc&&e._channel?y(e):setTimeout((()=>{e._pc&&e._channel?y(e):e.destroy()}),2e3))})),f.on("dhtAnnounce",((...e)=>{u("dhtAnnounce",...e)}))}).call(this,n("eb72").Buffer)},c581:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return d})),n.d(t,"a",(function(){return u}));var o=n("7ca3"),a=n.n(o),s=(n("de6c"),n("c228"));class i{static without(...e){const t=`^(${e.map((e=>`(?!${e})`)).join("")}.)*$`;return new RegExp(t,"g")}static withoutOnly(...e){const t="^"+e.map((e=>`(?!${e}+$)`)).join("");return new RegExp(t,"g")}static prefixWithout(...e){const t="^"+e.map((e=>`(?!${e})`)).join("");return new RegExp(t,"g")}static suffixWithout(...e){const t=`(??");class r{static _test(e,t){const n=e.test(t);return e.lastIndex=0,n}static _testAll(e,t){const n=e.map((e=>this._test(e,t)));return!n.includes(!1)}}a()(r,"Username",[e=>r._test(i.content("0-9","A-Z","a-z"),e)||"account_field_only_alphanumeric",e=>r._test(i.range(4,16),e)||["account_field_range",[4,16]],e=>r._test(i.prefixWithout("[0-9]"),e)||"account_field_prefix_without_number_space"]),a()(r,"Password",[e=>r._test(i.content("0-9","A-Z","a-z",i.CHARACTERS),e)||"account_field_only_alphanumeric_and_symbol",e=>r._test(i.range(8,20),e)||["account_field_range",[8,20]],e=>r._test(/[0-9]/g,e)||"account_field_must_have_number_characters"]),a()(r,"PhoneNumber",[e=>r._test(i.content("0-9"),e)||"account_field_phone_number",e=>r._test(i.range(3,11),e)||["account_field_range",[3,11]]]),a()(r,"Nickname",[e=>r._test(i.content("0-9","A-Z","a-z","一-龥","\\s","_"),e)||"account_field_only_chinese_alphanumeric_space_underline",e=>r._test(i.range(2,15),e)||["account_field_range",[2,15]],e=>r._test(i.prefixWithout("[0-9]","[\\s]"),e)||"account_field_prefix_without_number_space",e=>r._test(i.suffixWithout("\\s"),e)||"account_field_suffix_without_space",e=>r._test(i.WITHOUT_REPEAT_SPACE,e)||"account_field_without_repeat_space"]),a()(r,"VerificationCode",[e=>r._testAll([i.content("0-9"),i.range(6)],e)||"account_field_verification_code"]),a()(r,"InvitationCode",[e=>r._test(i.content("0-9","A-Z","a-z"),e)||"account_field_invitation_code"]),a()(r,"TransferReceiver",[e=>{const t="tip_invalid_receiver",n=r._test(i.content("0-9","a-f","-"),e);if(!n)return t;const o=e.split("-");return 5!==o.length?t:"8-4-4-4-12"===o.map((e=>e.length)).join("-")||t}]),a()(r,"TransferAmount",[e=>r._test(i.content("0-9","."),e)||"tip_invalid_amount",e=>""+parseFloat(e)===e||"tip_invalid_amount",e=>parseFloat(e)<=1e3||"tip_invalid_amount",e=>parseFloat(e)>=.001||"tip_invalid_amount",e=>parseInt(1e3*parseFloat(e))===1e3*parseFloat(e)||"tip_invalid_amount"]);class l{constructor(e,t,n){this._model=t,this.defValue=this._model2value((()=>t?"object"!==typeof t?t:Array.isArray(t)?[...t]:{...t}:t)()),this.type=e,this.attrs=n||{}}get model(){return this._model}set model(e){this._model=e}get bound(){return this.attrs}_model2value(e){return e}_value2model(e){return e}updateModel(e){this.model=this._value2model(e)}get value(){return this._model2value(this.model)}clear(){this.updateModel(this.defValue)}}class c extends l{constructor(e,t){super("input",e,t)}}class d extends l{static get LOCALE_OPTIONS(){const e=Object.keys(s["a"]).sort(((e,t)=>(e=s["a"][e].normalizedName[0],t=s["a"][t].normalizedName[0],et?1:0))).map((e=>({value:e,emoji:s["a"][e].emoji,label:s["a"][e].name,normalizedName:s["a"][e].normalizedName})));return e}constructor(e,t,n){super("select",e,{...n||{},options:t})}}class u{constructor(e){this.items=e}updateModel(e){return Object.keys(this.items).forEach((t=>{void 0!==e[t]&&this.items[t].updateModel(e[t])})),this}get formData(){const e={};for(const[t,n]of Object.entries(this.items))e[t]=n.value;return e}setDefault(){return this}clearData(){return Object.values(this.items).forEach((e=>e.clear())),this}get length(){return Object.keys(this.items).length}}},c5a5:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));n("a1c1");var o=n("abc6"),a=n("d710");async function s(e){if(e.startsWith(a["protocol"]+"://")||e.startsWith(a["shortProtocol"]+"://")){const t=e.startsWith(a["protocol"]+"://")?e:e.replace(a["shortProtocol"]+"://",a["protocol"]+":///"),n=await o["a"].decode(t);return n}return new Promise(((t,n)=>{o["a"].encode({hash:e,url:e},((e,o)=>{e?n(e):t(o)}))}))}},c5fa:function(e,t,n){},c620:function(e,t,n){"use strict";n.r(t),function(e,o){n.d(t,"wtClient",(function(){return x})),n.d(t,"getTaskInstance",(function(){return I}));n("4db2"),n("c976"),n("4d8f"),n("f991"),n("63b1"),n("de6c"),n("a1c1");var a=n("4649"),s=n.n(a),i=n("0559"),r=n("0f0c"),l=n("c5a5"),c=n("a1cd"),d=n("edfe"),u=n("e3c7"),h=n("5584"),p=n("e38b"),m=n.n(p),_=n("84f6"),f=n("8750"),g=n("1926"),b=n("d558"),y=n("0598");const v=t=>"undefined"!==typeof crypto?e.from(crypto.getRandomValues(new Uint8Array(t))):n("548f").randomBytes(t);class w extends Map{set(e,t){if("object"!==typeof t)return console.error("Not an object",t);super.set(e,Object.assign({url:e},t,{timestamp:Date.now()}))}}const{torrentToJson:k}=c["a"],C=n("08ee").announceList.map((e=>e[0])).filter((e=>e.startsWith("wss"))).concat("wss://tracker.btorrent.xyz/announce","wss://tracker.openwebtorrent.com/announce","wss://tracker.files.fm:7073/announce","wss://spacetradersapi-chatbox.herokuapp.com:443/announce","ws://tracker.files.fm:7072/announce","wss://tracker.magnetoo.io/announce","wss://qot.abiir.top:443/announce","wss://tracker.dnlab.net:443/announce"),$=Object(r["a"])("version").replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),S=e.from(`-WW${$}-${v(9).toString("base64")}`),x=new s.a({peerId:S,maxConns:20,store:m.a});let T=null;const I=()=>T;if(!Object(b["a"])()&&!Object(y["default"])()){setInterval((()=>{var e;if(!x.torrents[0])return;const t=x.torrents[0];t.paused||t.done||1===t.progress||null!==(e=t.discovery)&&void 0!==e&&e.tracker&&t.discovery.tracker.update()}),15e3),u["ioServer"].on("updateSettings",(e=>{if(console.log("updateSettings",e),"downloadSpeed"in e){const t=e.downloadSpeed;t>0?x.throttleDownload(t):x.throttleDownload(0)}if("uploadSpeed"in e){const t=e.uploadSpeed;t>0?x.throttleUpload(t):x.throttleUpload(0)}"secureOption"in e&&(console.log("set secure",i["setSecure"]),Object(i["setSecure"])(e.secureOption))})),Object.defineProperty("undefined"===typeof window?o:window,"client",{get(){return x}});const e=()=>"undefined"!==typeof navigator&&!!navigator.serviceWorker;e()?(console.log("registering sw"),navigator.serviceWorker.register("webtorrent.worker.js").then((()=>{const e=()=>{const e=navigator.serviceWorker.controller;e&&"activated"===e.state&&(console.log("[ ServiceWorker ] Change controller",e),x.loadWorker(e))};navigator.serviceWorker.controller&&navigator.serviceWorker.controller.addEventListener("statechange",e),navigator.serviceWorker.addEventListener("controllerchange",(()=>{e(),navigator.serviceWorker.controller.addEventListener("statechange",e)})),console.log("register",navigator.serviceWorker.controller),e()})).catch((e=>{console.error("Error registering sw",e)}))):"undefined"!==typeof navigator&&navigator.serviceWorker&&navigator.serviceWorker.controller&&"activated"===navigator.serviceWorker.controller.state&&x.loadWorker(navigator.serviceWorker.controller);const t=new Map;let n=Date.now(),a=1e3;const s=()=>({downloading:[],uploading:[],downloaded:[]}),r=()=>{const e=Date.now();if(a=(e-n)/1e3,n=e,x.torrents[0]){const e=x.torrents[0];e.done||"number"!==typeof e.usedTime||(e.usedTime+=1e3);const n=k(e,a,t);if(t.has(n.infoHash)&&e.ready){const o=t.get(n.infoHash);0===o.downloaded?n.downloadSpeed=0:n.downloadSpeed=Math.floor((e.downloaded-o.downloaded)/a),0===o.uploaded?n.uploadSpeed=0:n.uploadSpeed=Math.floor((e.uploaded-o.uploaded)/a),n.downloadSpeed<0&&(n.downloadSpeed=0),n.uploadSpeed<0&&(n.uploadSpeed=0),t.set(n.infoHash,{downloaded:e.downloaded,uploaded:e.uploaded})}else n.downloadSpeed=0,n.uploadSpeed=0,t.set(n.infoHash,{downloaded:0,uploaded:0});u["ioServer"].emit("wt-task",n),T=n;const o=s();n.done&&!n.isSeeding&&n.paused?o.downloaded=[n]:n.done||n.isSeeding?o.uploading=[n]:o.downloading=[n],_["a"].updateTaskList(o)}else T=null,h["a"].commit("updateABKeys",s())};setInterval(r,1e3),x.on("error",(e=>{console.warn("webtorrent error",e)})),x.on("ready",(()=>{console.log("[webtorrent]","ready"),Object(d["b"])(x)}));const p=(e,t)=>{if(console.log("onWire",e),e.use(Object(d["a"])(x,t)),"webrtc"===e.type){console.log("onwire",e.remoteAddress,e.peerId);const n=()=>{var o,a,s,i,r;if(e.remoteAddress)return;const l=t._peers[e.peerId];if(!l)return setTimeout(n,1e3);const c=null===(o=l.conn)||void 0===o||null===(a=o._pc)||void 0===a||null===(s=a.currentRemoteDescription)||void 0===s||null===(i=s.sdp)||void 0===i||null===(r=i.match(/c=IN\sIP\d\s(.*)/))||void 0===r?void 0:r[1];if(!c)return setTimeout(n,1e3);e.remoteAddress=c};n()}},m=(e,t)=>{const n="string"===typeof e?x.get(e):e;n&&n.trackerMap&&(n.trackerMap.set(t,{status:"connecting"}),c["a"].addTracker(n,t))},b=(e,t={})=>{e.pending=!1,e.removeAllListeners(),e.setMaxListeners(0),console.log("Add listeners to",e.infoHash||e.token||t.magnetURI),e.on("error",(e=>{console.warn("[wt] error",e)})),e.on("infoHash",(e=>{console.log("got infoHash",e),u["ioServer"].emit("wt-infoHash",e)})),e.on("wire",(t=>p(t,e))),e.on("metadata",(()=>{console.log("Got metadata",e),Object(l["a"])(e.magnetURI).then((t=>{console.log(t),e.alphabizURI=t}))})),e.on("discovery",(()=>{if(console.log("start discovery"),e.trackerMap=new w,e.discovery._announce.forEach((t=>{if(console.log("Discovered",t),e.trackerMap.set(t,{status:"connecting"}),!t.startsWith("ws")){if(t.match(/(\d{1,3}\.){3}\d{1,3}/))return;e.trackerMap.set(t+"@6",{status:"connecting"})}})),e.discovery.tracker.on("warning",((t,n,o)=>{n&&(6===o&&(n+="@6"),e.trackerMap.set(n,{status:"error",message:c["a"].parseTrackerWarning(t.message)}))})),e.discovery.tracker.on("update",((t,n,o)=>{if(console.log("tracker update",n,t),!n)return console.warn("No emitted url",t);6===o&&(n+="@6"),e.trackerMap.set(n,{status:"updated",info:t})})),t.customTrackers)for(const n of t.customTrackers)m(e,n)}))},y=(e,t)=>{h["a"].getters.settings.downloadSpeed>0&&x.throttleDownload(h["a"].getters.settings.downloadSpeed),h["a"].getters.settings.uploadSpeed>0&&x.throttleUpload(h["a"].getters.settings.uploadSpeed);const n=t||{};if(n.announce=n.announce||C,x.torrents&&x.torrents.length)return u["ioServer"].emit("weberror","already_downloading");(e instanceof File||e instanceof FileList)&&console.log("should seed");const o=e instanceof File||e instanceof FileList?x.seed(e,n):x.add(e,n);return o.token=n.token||e,o.origin=n.token||e,o.createdTime=n.createdTime||Date.now(),o.usedTime=n.usedTime||0,n.fromPost&&(o.fromPost=n.fromPost),n.postTitle&&(o.postTitle=n.postTitle),n.name&&(o.name=n.name),b(o,n),r(),o};u["ioServer"].on("wt-add",(async(e,t)=>{if("string"===typeof e&&(e.startsWith("alphabiz:")||e.startsWith("ab:")))return y(await Object(l["a"])(e),t);y(e,t)})),u["ioServer"].on("download_torrent",(async e=>{if(console.log("web download",e),!e.url)return u["ioServer"].emit("weberror","not_supported_in_web_mode");try{const t=await Object(l["a"])(e.url);console.log("converted",t),y(t,{...e,url:t})}catch(t){u["ioServer"].emit("weberror",t.message||t)}})),u["ioServer"].on("wt-pause",(e=>{const t=x.get(e);if(console.log("pause",e,t),!t)return u["ioServer"].emit("weberror","torrent_not_exist");t.paused=!0,t.pause(),t.discovery.tracker.stop();while(t.wires.length){const e=[...t.wires];e.forEach((e=>e.destroy()))}})),u["ioServer"].on("wt-resume",(e=>{const t=x.get(e);if(!t)return u["ioServer"].emit("weberror","torrent_not_exist");t.paused=!1,t.resume(),t.discovery.tracker.start()})),u["ioServer"].on("pause_all",(()=>{x.torrents.forEach((e=>e.destroy((()=>{u["ioServer"].emit("wt-pause",e)}))))})),u["ioServer"].on("wt-delete",(e=>{const t=x.get(e);if(!t)return u["ioServer"].emit("weberror","torrent_not_exist");t.destroy((()=>{u["ioServer"].emit("torrent_deleted",t)}))}));let v=null;const $=({infoHash:e,filepath:t})=>{console.log("[web] Play",e,t);const n=x.get(e);return n?n.ready?(v=n.createServer(),void v.listen(0,(()=>{const t=v.address().port,o={token:n.token,port:t};u["ioServer"].emit("play-server-ready",o);const a=()=>{var t;const o=(null===(t=n.files)||void 0===t?void 0:t.map((e=>{const t=[];for(let o=e._startPiece;oclearInterval(s)))}))):setTimeout((()=>{$({infoHash:e,filepath:t})}),2e3):u["ioServer"].emit("weberror","torrent_not_exist")};u["ioServer"].on("wt-play",$);const S=()=>{v&&(v.destroy&&v.destroy(),v=null,console.log("Destroyed server"))};u["ioServer"].on("wt-stop-server",S),u["ioServer"].on("set_user",(e=>{u["ioServer"].emit("set-user",null,e)})),"undefined"!==typeof document&&document.body.addEventListener("paste",(async e=>{const t=e.clipboardData.files.length?e.clipboardData.files:e.clipboardData.getData("text");let n=t;if(t instanceof FileList){if(t.length>1)return f["a"].create({message:g["b"].t("web_mode_upload_single"),ok:g["b"].t("ok")});if(!t[0].size)return f["a"].create({message:g["b"].t("web_mode_upload_single"),ok:g["b"].t("ok")});n=t[0]}if("string"===typeof n){if((n.startsWith("ab://")||n.startsWith("alphabiz://"))&&(n=await Object(l["a"])(n).catch((()=>"")),!n.startsWith("magnet")))return f["a"].create({message:g["b"].t("invalid_download_url"),ok:g["b"].t("ok")});if(!n.startsWith("magnet"))return}const o=()=>{y(n)};x.torrents[0]?f["a"].create({message:g["b"].t("remove_old_task_desc"),ok:g["b"].t("remove_old_task"),cancel:g["b"].t("cancel")}).onOk((()=>{x.torrents[0].destroy(),x.torrents.splice(0),o()})):f["a"].create({message:g["b"].t("add")+" "+(n.name||t),ok:g["b"].t("add"),cancel:g["b"].t("cancel")}).onOk(o)})),console.log("Init webtorrent events")}}.call(this,n("eb72").Buffer,n("0ee4"))},c62a6:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("ff9b");const a=new o["a"]({data(){return{taskQueue:[]}}})},c791:function(e,t,n){"use strict";(function(e,o){n("a1c1");var a=n("1c53"),s=n.n(a),i=n("ff11"),r=n.n(i),l=n("6422"),c=n("d310"),d=n("5584");let u=null;Object(c["isElectron"])()&&(u=e["require"]("geoip-country")),t["a"]={props:{peer:{type:Object,required:!0}},computed:{isDevMode(){return d["a"].getters.isDevMode},country(){const e=this.peer.addresses[0];if(!e)return"";try{const t=u.lookup(e);return t&&t.country?t.country:""}catch(t){return""}},countryFlag(){return this.country?s.a.getEmojiFlag(this.country):""},uploadSpeed(){return Object(l["a"])(this.peer.uploadSpeed,{byte:!1,gb:!1,fix:1})},downloadSpeed(){return Object(l["a"])(this.peer.downloadSpeed,{byte:!1,gb:!1,fix:1})},peerClient(){if(!this.peer.id)return"-";const e=o.from(this.peer.id,"hex").toString("ascii");try{const t=r()(e.replace("-AB","-WD")),n=this.peer.isAbPeer?"(Alphabiz)WebTorrent":t.client;return"unknown"===n?this.$t("unknown"):t.version?n+" "+t.version:n}catch(t){return this.$t("unknown")}},peerProgress(){if("number"!==typeof this.peer.progress)return"-";const e=Number((100*this.peer.progress).toFixed(1));return e+"%"}},methods:{showPaymentPannel(){this.$emit("showPaymentPannel",{peerId:this.peer.id,address:this.peer.address,remoteUser:this.peer.user,remoteSubId:this.peer.subId})}}}}).call(this,n("0ee4"),n("eb72").Buffer)},c7ce:function(e,t,n){},c905:function(e,t,n){"use strict";n("9d1e")},ca31:function(e,t,n){},cb96:function(e,t,n){},cc0c:function(e,t,n){"use strict";n("1da1")},cdb7:function(e,t,n){"use strict";n("7ad0")},ce6c:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.showAppBar?n("q-bar",{staticClass:"application-bar app-draggable"},["mac"===e.env?[n("div",{staticClass:"full-height q-pt-xs col-grow",staticStyle:{"margin-left":"0","margin-right":"-8px"}},[n("div",{staticClass:"full-height"})]),n("div",{staticClass:"absolute-left full-width full-height row flex-center"},[n("div",{staticClass:"text-weight-bold non-selectable"},[e._v(e._s(e.appName))])])]:e._e(),["win","linux"].includes(e.env)?[n("q-img",{staticClass:"application-bar-icon",attrs:{src:e.abIcon,width:"18px",height:"18px"}}),n("div",{staticClass:"application-bar-title q-ml-md q-pr-md non-selectable",staticStyle:{"font-size":"0.8rem"}},[e._v("\n "+e._s(e.appName)+"\n ")]),n("div",{staticClass:"full-height q-pt-xs col-grow",staticStyle:{"margin-left":"0","margin-right":"-8px"}},[n("div",{staticClass:"full-height"})]),n("q-space"),n("div",{staticClass:"full-height flex-center row app-no-draggable",staticStyle:{"pointer-events":"visible","margin-right":"-12px"}},[n("q-btn",{staticClass:"window-control-button",attrs:{unelevated:""},on:{click:e.minimize}},[n("svg",{attrs:{version:"1.1",role:"presentation",width:"12",height:"12",viewBox:"0 0 12 12"}},[n("g",{attrs:{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1"}},[n("line",{attrs:{x1:"1",y1:"6",x2:"11",y2:"6",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}})])])]),n("q-btn",{staticClass:"window-control-button",attrs:{unelevated:""},on:{click:e.maximize}},[n("svg",{attrs:{version:"1.1",role:"presentation",width:"12",height:"12",viewBox:"0 0 12 12"}},[n("g",{attrs:{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1"}},[n("polyline",{attrs:{points:"5.5 1.5 10.5 1.5 10.5 6.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}}),n("polyline",{attrs:{points:"1.5 5.5 1.5 10.5 6.5 10.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}})])])]),n("q-btn",{staticClass:"window-control-button window-close-button",attrs:{unelevated:""},on:{click:e.close}},[n("svg",{attrs:{version:"1.1",role:"presentation",width:"12",height:"12",viewBox:"0 0 12 12"}},[n("g",{attrs:{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1"}},[n("line",{attrs:{x1:"1.5",y1:"1.5",x2:"10.5",y2:"10.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}}),n("line",{attrs:{x1:"10.5",y1:"1.5",x2:"1.5",y2:"10.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}})])])])],1)]:e._e()],2):e._e()},a=[],s=(n("de6c"),n("d710"));const i=n("d310").isElectron();var r={name:"ApplicationBar",data(){return{appName:s["appName"],showAppBar:i,showMenu:!1,abIcon:"developer/assets/icon-256.png",env:null,windowControl:null}},created(){if(!i)return;Promise.resolve().then(n.t.bind(null,"b052",7)).then((({ipcRenderer:e})=>{this.windowControl=t=>e.sendSync("app_window_control",t)}));const e=navigator.userAgent.toLowerCase(),t=/macintosh|mac os x/i.test(e);this.env=t?"mac":"win"},methods:{minimize(){this.windowControl("minimize")},maximize(){this.windowControl(this.windowControl("isMaximized")?"unmaximize":"maximize")},close(){this.windowControl("close")}}},l=r,c=(n("ac09"),n("2b5f")),d=n("85af"),u=n("1043"),h=n("9767"),p=n("990e"),m=n("8a98"),_=n("09a4"),f=n.n(_),g=Object(c["a"])(l,o,a,!1,null,null,null);t["a"]=g.exports;f()(g,"components",{QBar:d["a"],QBtn:u["a"],QImg:h["a"],QSpace:p["a"],QTable:m["a"]})},cf6e:function(e,t,n){},d176:function(e,t,n){},d1a4:function(e,t,n){"use strict";(function(e){n("de6c"),n("dc89"),n("2425"),n("a1c1");var o=n("e74d"),a=n("2b49");t["a"]=(e,{app:t,app_config:n},a)=>{s(o["a"],a,n),i(e,a,n.protocol,t)};const s=(e,t,{protocol:n,web_url:o})=>{t.$logger.tags("AuthWrapper");e._oAuthHandler._urlOpener=(e,t)=>a["a"].urlOpener(e),e.__proto__._handleAuthResponse=()=>{},e.__proto__.oAuthSignOutRedirect=function(t,n){const o=async()=>{const t=e._oAuthHandler._config.domain,n=e._oAuthHandler._cognitoClientId,o=e._oAuthHandler._config.redirectSignIn,a=`https://${t}/logout?${Object.entries({client_id:n,logout_uri:encodeURIComponent(o)}).map((e=>e.join("="))).join("&")}`;await e._oAuthHandler._urlOpener(a,o)};o(),t()};const s=(()=>({isLocalhost:Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)),isElectron:r()}))(),i=s.isElectron?2:s.isLocalhost?0:1,l=["http://localhost:8080/oauth/",`https://web.alpha.biz/oauth_redirect/${n}/${encodeURIComponent(o)}/`,`https://web.alpha.biz/oauth_redirect/${n}/app/`][i],c=l;Object.assign(e._config.oauth,{app_env:s.isElectron?"electron":"web",redirectSignIn:l,redirectSignOut:c}),Object.assign(e._oAuthHandler._config,{app_env:s.isElectron?"electron":"web",redirectSignIn:l,redirectSignOut:c})},i=(e,t,o,a)=>{if(r()){const{ipcRenderer:e}=n("b052");e.on("oauth_event",((e,t)=>{t.startsWith(`${o}://$oauth/v2/`)&&s(t,"electron")}))}else if("/oauth/v2/"===new URL(location.href).pathname){const t=t=>{e.prototype.$amplify.addOnAuthStateChangedListener((()=>{setTimeout((()=>{s(t,"web")}),2e3)}),{once:!0})};t(location.href),a.router.replace("/")}function s(e,n){t.core.handleOAuthActionResponse(e,n)}};function r(){return"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||"undefined"!==typeof e&&"object"===typeof e.version&&e.version.electron||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.includes("Electron")}}).call(this,n("28d0"))},d1e4:function(e,t,n){"use strict";n("eaf6")},d2e8:function(e,t,n){"use strict";n("053d")},d310:function(e,t,n){"use strict";n.r(t),n.d(t,"localConfigs",(function(){return r})),n.d(t,"deepClone",(function(){return c})),n.d(t,"Bus",(function(){return d["a"]})),n.d(t,"isElectron",(function(){return u["default"]})),n.d(t,"torrentToJson",(function(){return _}));n("de6c");var o=n("3fd2"),a=n.n(o);const s=a.a.renderer(),i=e=>new Promise(((t,o)=>{if(!s)return o(!1),!1;s&&Promise.resolve().then(n.t.bind(null,"b052",7)).then((n=>n.ipcRenderer.invoke("get-app-settings").then((n=>{n[e]?t(n[e]):o(!1)})).catch(o)))}));var r={getSettingsItem:i};function l(e){if(!e||"object"!==typeof e)return e;const t=arguments[1]||new WeakMap;if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};t.set(e,n);for(const o in e)Object.hasOwnProperty.call(e,o)&&(n[o]=l(e[o],t));return n}var c=l,d=n("c62a6"),u=n("0598");const h=n("a3fc"),p=["infoHash","name","paused","progress","length","downloaded","downloadSpeed","uploaded","uploadSpeed","recieved","ready","token","origin","path","pending"],m=(e,t)=>{const n={};return p.forEach((t=>{n[t]=e[t]})),n.done=e.downloaded>=e.length,n.download=!t,n.upload=e.upload,n.files=e.files?e.files.map((t=>({name:t.name,path:h.resolve(e.path,t.path),progress:t.progress||0}))):[],n};var _=m},d34c:function(e,t,n){},d534:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"image-with-preview full-width"},[n("q-input",{staticClass:"full-width",attrs:{outlined:"","stack-label":"",value:e.value,label:e.label,rules:e.rules,placeholder:"https://example.org/path/to/image.jpg",debounce:500},on:{input:e.emitSrc},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"after",fn:function(){return[n("div",{staticClass:"image-container"},[n("img",{staticClass:"preview-image",class:e.state,attrs:{src:e.realSrc},on:{error:e.emitError,load:e.emitSuccess}}),"error"===e.state?n("q-icon",{attrs:{name:"close",size:"56px",color:"red"}},[n("q-tooltip",[e._v(e._s(e.$t("invalid_image")))])],1):e._e(),"loading"===e.state?n("q-icon",{attrs:{name:"image",size:"56px",color:"green"}},[n("q-tooltip",[e._v(e._s(e.$t("poster")))])],1):e._e()],1)]},proxy:!0}])})],1)},a=[],s={props:{value:String,label:String,rules:{type:Array,default:()=>[]}},data(){return{state:"loading"}},computed:{realSrc(){let e=this.value||"";if(!e.startsWith("http"))return"";while(e.startsWith("http%3A%2F%2F"))e=decodeURIComponent(e),console.log("decode",this.value,e);while(e.startsWith("https%3A%2F%2F"))e=decodeURIComponent(e),console.log("decode",this.value,e);return e}},methods:{emitSrc(e){this.$emit("input",e)},emitError(){""!==this.value&&(this.$emit("state",2),this.state="error")},emitSuccess(){this.$emit("state",1),this.state="loaded"}},watch:{value(){console.log("src change"),this.$emit("state",0),this.state="loading"}}},i=s,r=(n("c905"),n("2b5f")),l=n("0e45"),c=n("f106"),d=n("cf25"),u=n("09a4"),h=n.n(u),p=Object(r["a"])(i,o,a,!1,null,"70ea5328",null);t["a"]=p.exports;h()(p,"components",{QInput:l["a"],QIcon:c["a"],QTooltip:d["a"]})},d558:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var o=n("800b");const a=Boolean((()=>{var t;if("undefined"===typeof window)return"mobile"in e.versions||"android"===Object(o["platform"])()||"ios"===Object(o["platform"])()||e.argv.includes("--dev")||e.argv.includes("--capacitor")||void 0;const{Platform:a}=n("d247");return(null===(t=a.is)||void 0===t?void 0:t.capacitor)||void 0})());function s(){return a}}).call(this,n("28d0"))},d6ab:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return h}));n("de6c"),n("dc89"),n("2425"),n("a1c1");const o=n("61af"),a=n("a3fc"),s=n("17de"),i=n("5c0c");function r(e){const t=e.path||e;if(console.log(t),!o.existsSync(t)&&!o.existsSync(t+".downloading"))return[];const n=a.dirname(e.path),s=a.extname(e.path),i=e.name.substring(0,e.name.lastIndexOf("."));console.log(n,i,s);const r=d(n,i),h=c(n,r),p=u(n,i),m=l(n,p);return[...h,...m]}function l(e,t){const n=[];try{t.forEach(((t,r,l)=>{l[r]=e+"/"+t;const c=o.readFileSync(l[r]),d=i.decode(c,s.detect(c)).replace(/^{[\\0-9A-Za-z&]*}/gm,""),u=1===(t.match(/\./g)||[]).length?t:a.extname(t.substring(0,t.lastIndexOf("."))).substring(1)+".srt";n.push({src:URL.createObjectURL(new Blob([h(d)])),label:u,path:e+"\\"+t})}))}catch(r){console.log(r)}return console.log(n),n}function c(e,t){const n=[];try{t.forEach(((t,r,l)=>{l[r]=e+"/"+t;const c=o.readFileSync(l[r]),d=s.analyse(c);console.log("encoding",d);const u=i.decode(c,s.detect(c)).replace(/^{[\\0-9A-Za-z&]*}/gm,""),h=1===(t.match(/\./g)||[]).length?t:a.extname(t.substring(0,t.lastIndexOf("."))).substring(1)+".vtt";n.push({src:URL.createObjectURL(new Blob([u])),label:h,path:e+"\\"+t})}))}catch(r){console.log(r)}return console.log(n),n}function d(e,t){let n;try{n=o.readdirSync(e),n=n.filter((e=>e.startsWith(t)&&e.endsWith(".vtt")))}catch(a){console.log(a)}return n}function u(e,t){let n;try{n=o.readdirSync(e),n=n.filter((e=>e.startsWith(t)&&e.endsWith(".srt")))}catch(a){console.log(a)}return n}function h(e){var t=e.replace(/\r+/g,"");t=t.replace(/^\s+|\s+$/g,"");var n=t.split("\n\n"),o="";if(n.length>0){o+="WEBVTT\n\n";for(var a=0;a3){for(var o=3;o\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);return s?(t+=s[1]+":"+s[2]+":"+s[3]+"."+s[4]+" --\x3e "+s[5]+":"+s[6]+":"+s[7]+"."+s[8]+"\n",a+=1,n[a]&&(t+=n[a]+"\n\n"),t):""}},d710:function(e,t,n){(function(t){const o=n("b3f7"),{default:a}=n("0598");if(a())if(this.require)try{const n=this["require"]("developer/app");console.log("Init from node_modules",t),n.appName=n.name,e.exports={default:n,appName:n.name,...n}}catch(s){console.log(">> Cannot require /developer/app from build. Use dev");const t=this["require"]("../../developer/app");t.appName=t.name,console.log("APP name:",t.appName),e.exports={default:t,appName:t.name,...t}}else{const t=a()?require("developer/app"):o;t.appName=t.displayName,console.log("APP name:",t.appName),e.exports={default:t,appName:t.displayName,...t}}else e.exports={appName:o.name,...o}}).call(this,n("28d0"))},d7df:function(e,t,n){"use strict";n("de6c"),n("d4b5");var o=n("d310"),a=n("e3c7"),s=n("d558"),i=n("9ad5"),r=n.n(i),l=n("a368"),c=n("8a63"),d=n("f680"),u=n("1926");const h=Object(s["a"])(),p=e=>"requestAnimationFrame"in window?requestAnimationFrame(e):setTimeout(e,20),m=[],_=new Map,f=new Map,g={on(e,t){Object(o["isElectron"])()||h?(_.has(e)||_.set(e,[]),_.get(e).push(t),f.has(e)&&(f.get(e).forEach((e=>{t(...e)})),f.delete(e)),h&&"check-network-result"===e&&console.log("Listen on",e,t)):a["ipcRenderer"].on(e,t)},once(e,t){const n=(...o)=>{t(...o),this.off(e,n)};return this.on(e,n)},emit(e,...t){h?m.push({name:e,data:t}):Object(o["isElectron"])()?a["ipcRenderer"].send("_io_send",{name:e,data:t}):a["ipcRenderer"].send(e,...t)},off(e,t){console.log("Off",e);const n=_.get(e);if(!n)return;if(!t)return n.splice(0);const o=n.indexOf(t);-1!==o&&n.splice(t,1)},clear(){console.log("io client clear");for(const e of _.values())e.splice(0)}};if(Object(o["isElectron"])()){const e={resolve:null,async execute(){if(e.resolve)return;const t=new Promise((t=>e.resolve=t));a["ipcRenderer"].send("_io_fetch"),await t,e.resolve=null}},t=async()=>{await e.execute(),setTimeout((()=>p(t)),500)};p(t),a["ipcRenderer"].on("_io_response",(async(t,n)=>{var o;if(!n||!n.length)return null===(o=e.resolve)||void 0===o?void 0:o.call(e);await n.reduce((async(e,{name:t,data:n})=>{await e;const o=JSON.parse(n),a=_.get(t);if(a)a.map((e=>{try{e(...o)}catch(n){console.error(`Error when emitting io event [${t}] ${n}`)}}));else{f.has(t)||f.set(t,[]);const e=f.get(t);e.push(o),e.length>10&&e.splice(0,e.length-10)}}),Promise.resolve()),"function"===typeof e.resolve&&e.resolve()}))}if(h&&"object"===typeof window){const e=(e,t)=>{e.startsWith("ipc")&&(console.log("Got ipc event",e,t),t.unshift(null));const n=e.startsWith("ipc:")?e.substring(4):e,o=_.get(n);if("check-network-result"===n&&console.log("pre",n,o,_.size),_.has(n))o&&o.forEach((e=>e(...t)));else if(f.has(n)){const e=f.get(n);e.push(t),e.length>10&&(e.splice(0,e.length-10),"check-network-result"===n&&console.log("Remove",n,_.size))}else f.set(n,[t])};let t=0;const n=()=>{l["Filesystem"].readFile({path:"service_port",directory:l["Directory"].Documents,encoding:l["Encoding"].UTF8}).then((({data:e})=>{if(!isNaN(parseInt(e))){if(t===parseInt(e))return;t=parseInt(e),console.log("Set port to",t)}}))};n(),setInterval(n,1e4);const o=new Set,a=async()=>{if(!t)return setTimeout(a,500);try{let a=!0,s=()=>{};setTimeout((()=>{a&&(s=d["a"].create({message:u["b"].t("connecting")+"...",position:"bottom-right"}))}),1200);const i=t=>{t&&Array.isArray(t.events)&&t.events.forEach((({name:t,data:n})=>e(t,n)))},l=m.splice(0).map((e=>{const t=JSON.stringify(e).length;if(t>3e6){const t="partials:"+e.name;if(o.has(t))return;o.add(t);let n=0;const a=async e=>{const{data:t}=await r.a.post("http://localhost:3000",{events:[e]},{withCredentials:!1,timeout:5e3}).catch((()=>({})));return i(t),n++,await new Promise((e=>setTimeout(e,100)))};return e.data.reduce((async(e,n,o)=>{if(await e,"object"!==typeof n||JSON.stringify(n).length<3e6)await a({name:t,index:o,data:n}),await new Promise(p);else{let e=Array.isArray(n)?[]:{},s=0;for(const i in n)e[i]=n[i],s+=JSON.stringify(n[i]).length,s>3e6&&(await a({name:t,index:o,data:e}),e=Array.isArray(n)?[]:{},s=0,await new Promise(p));(Array.isArray(n)?e.length:Object.keys(e).length)&&await a({name:t,index:o,data:e})}await new Promise(p)}),Promise.resolve()).then((async()=>{await a({name:t,index:-1}),console.log(`Finished splicing ${t} with ${n} pieces`),o.delete(t)})),null}return e})).filter((e=>e));l.length||l.push("__empty__"),await l.reduce((async(e,o)=>{if(await e,!o)return;const{data:a}=await r.a.post(`http://localhost:${t}`,{events:"__empty__"===o?[]:[o]},{withCredentials:!1,timeout:2e3}).catch((e=>(console.log(`Failed to fetch events. Error: ${e.message||e}`),console.log(m),n(),{})));i(a)}),Promise.resolve()).catch(n),a=!1,s()}catch(s){console.log("Poll error",s)}setTimeout(a,500)};a(),l["App"].addListener("resume",(()=>{console.log("App resume"),setTimeout((()=>{Object(c["c"])(!0)}),500)})),l["App"].addListener("pause",(()=>{console.log("App pause"),Object(c["d"])(!0)})),l["Network"].addListener("networkStatusChange",(e=>{console.log("Network connection type changed to",e.connectionType)}))}t["a"]=g},d7f6:function(e,t,n){},d884:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n("5584");const o=[{value:"en-US",label:"English"},{value:"zh-CN",label:"简体中文"},{value:"zh-TW",label:"繁體中文"}]},ddf9:function(e,t,n){"use strict";function o(){const e=navigator.userAgent.toLowerCase();return e.includes("android")||e.includes("ios")||e.includes("iphone")}n.d(t,"a",(function(){return o}))},df2b:function(e,t,n){},e0e1:function(e,t,n){"use strict";n("571b")},e3c7:function(e,t,n){"use strict";n.r(t),n.d(t,"ipcEvent",(function(){return l})),n.d(t,"ioEvent",(function(){return c})),n.d(t,"ioServer",(function(){return h})),n.d(t,"ipcRenderer",(function(){return p}));n("de6c");var o=n("bd50"),a=n.n(o),s=n("d310"),i=n("d558"),r=n("d7df");const l=new a.a,c=new a.a,d=Object(s["isElectron"])()?n("b052").ipcRenderer:Object(i["a"])()?{on(e,t){r["a"].on("ipc:"+e,t)},once(e,t){r["a"].once(e,t)},off(e,t){r["a"].off("ipc:"+e,t)},send(e,...t){console.log("ipcSend",e),r["a"].emit("ipc:"+e,...t)}}:{on(e,t){l.on(e,((...e)=>{t(...e)}))},send(e,...t){c.emit(e,...t)}},u=new Map,h={on(e,t){const n=u.has(t)?u.get(t):(...e)=>{t(...e)};u.has(t)||u.set(t,n),c.on(e,n)},emit(e,...t){l.emit(e,...t)},off(e,t){if(!t)return c.off(e);const n=u.get(t)||t;return n?c.off(e,n):void 0}},p=d;console.log("Init api server"),Object(s["isElectron"])()||Object(i["a"])()||(console.log("isElectron",Object(s["isElectron"])()),console.log("isCapacitor",Object(i["a"])()),n("c620"),n("ecef"))},e757:function(e,t,n){"use strict";n("a1c1"),n("f200");var o=n("35f4"),a=n("d710"),s=n.n(a),i=n("0f0c"),r=(n("d4b5"),n("5584"));const l=({measurementId:e,apiSecret:t,clientId:n,name:o,params:a})=>{var s;const i=null===(s=r["a"].state.account)||void 0===s?void 0:s.sub;console.log("Measure",n,i,o,a);const l={client_id:n,events:[{name:o,params:a}]};return i&&(l.user_id=i),fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${e}&api_secret=${t}`,{method:"POST",body:JSON.stringify(l)})};var c=l;const d=Object(o["a"])("0123456789abcdef"),u=d(20),h={session_token:u,appName:s.a.displayName,version:Object(i["a"])("version"),channel:Object(i["a"])("channel"),packageFormat:Object(i["a"])("packageFormat")||"unknown"};class p{constructor(e,t){this.customParams={},this.trackingID=e,this.apiSecret=t,this.uaId=e.replace("G-","UA-").replace(/.$/,(e=>"-"+e)),console.log("Set UniversalAnalytics ID to",this.uaId),this.disabled=!1}config(){this.disabled||(gtag("js",new Date),gtag("config",this.trackingID))}set(e,t){this.disabled||(null!==t?this.customParams[e]=t:delete this.customParams[e])}async get(e){}async getClientId(){return new Promise((e=>gtag("get",this.uaId,"client_id",(t=>{console.log("CLIENT_ID",t),e(t)}))))}async send(e,t={}){if(this.disabled)return;const n=Object.assign({},t,h);return new Promise((async t=>{if(console.log("[GA] send",e,n),location.protocol.startsWith("https"))gtag("event",e,Object.assign(n,{event_callback:()=>{t()}}));else{console.log("Use measurement protocol");const o=await this.getClientId();console.log("Start measure with",o),c({measurementId:this.trackingID,apiSecret:this.apiSecret,clientId:o,name:e,params:n}).then((t=>{console.log("Finish measure",e),204!==t.status&&console.warn(`Warning: expect response code 204 but got ${t.status}: ${t.statusText||"(empty)"}`)})).catch((e=>{console.log("Error sending measure",e)})).finally(t)}}))}disable(){this.disabled=!0}enable(){this.disabled=!1}}t["a"]=p},e75b:function(e,t,n){"use strict";n("7a76"),n("de6c");var o=n("67cf"),a=n("e74d");class s{constructor(e){this.apiName=e}async __call__(e,t,n){const a=await o["a"][e](this.apiName,t,n).catch((e=>{if(e.response&&e.response.data)return e.response.data;throw e}));if(a.stack){const e=new Error(a.message);throw e.name=a.name,e.stack=a.stack,e}return a}async __post__(e,t,n){t||(t={}),"string"===typeof e&&(e=e.split("/").filter((e=>""!==e)));const o=n?["authorized"]:[];o.push(...e);const a=n?{Authorization:n}:{};return await this.__call__("post",`/${o.join("/")}`,{body:t,headers:{...a}})}async postGuest(e,t){return await this.__post__(e,t)}async post(e,t,n){if(!n){const e=await a["a"].currentSession();n=e.getIdToken().getJwtToken()}return await this.__post__(e,t,n)}}n("dc69"),n("0c26"),n("a1c1"),n("f18a");var i=n("3334"),r=n("0cdb"),l=n("586d");const c={};class d{static appendOperation(e){const t=e.trim().match(/^[\w]+[ \f\r\t\n]+[\w]+/)[0].split(" ").reverse()[0],n=t.replace(t.charAt(0),t.charAt(0).toLowerCase());return c[n]=e,this}static appendOperations(e){return Array.isArray(e)?e.forEach(this.appendOperation):Object.entries(e).forEach((([e,t])=>{c[e]=t})),this}static createObservable(e,...t){const n=this.__getOperation(e),a=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));let s;a(n).forEach(((e,n)=>{const o=t[n];void 0!==o&&(s||(s={}),s[e]=o)}));const i=o["a"].graphql({query:n,variables:s});return i.name=e,i}static subscribe(e,t,n=console.error){return e.subscribe({next:({provider:n,value:o})=>{var a;return t(null===(a=o.data)||void 0===a?void 0:a[e.name],n)},error:({provider:e,error:t})=>n(t.errors,e)})}static __getOperation(e){if(!c[e])throw new Error("operation not found");return c[e]}static async execute(e,t){const n=this.__getOperation(e),a=await o["a"].graphql({query:n,variables:t});if(a.errors)throw new Error(a.errors[0].message);return a.data[e]}static injectAllOperations(e){const t=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));return Object.entries(c).forEach((([n,o])=>{e[n]=async(...e)=>{let a;return t(o).forEach(((t,n)=>{const o=e[n];void 0!==o&&(a||(a={}),a[t]=o)})),await this.execute(n,a)}})),e}}class u extends d{static async subscribeWithRetry(e,t,n,o){const a=(...e)=>console.tag.purple("GQL","websocket",...e),{times:s,duration:i,onFetchData:r,onUpdateSubscriber:l}={times:-1,duration:1e4,onFetchData:()=>{},onUpdateSubscriber:()=>{throw new Error("Your should config onUpdateSubscriber for the subscribeWithRetry method")},...o};let c=!0,d=0;const h=new Error("The number of retries exceeds the maximum"),p=e=>new Promise((t=>setTimeout(t,e))),m=async e=>{if(c=!0,s>0&&d>s)return console.warn(h),void a().log("failed to reconnect",h);const t=Math.min(i,1e3*Math.pow(2,d));a().log("connect close: ",`waiting for reconnect (${t}ms)`),await p(t),c?(d+=1,a().log(`Attempt to reconnect (${d})`),await e(),d=0,a().log("reconnected")):a(["GQL","Websocket","enableRetry === false"],c)},_=async()=>{const n=e=>{e.some((e=>["Connection closed","Timeout disconnect"].includes(e.message)))?a(["GQL","Websocket"],"Connect Error :171"):a(["GQL","Websocket"],"Connect Error :168",e),m(_)};try{d>=0&&r&&await r();const o=u.subscribe(e,t,n),a=o.unsubscribe;o.unsubscribe=function(){return c=!1,a.apply(this)},await l(o)}catch(o){a(["GQL","Websocket"],"Connect Error :191",o),await m(_)}};await _()}}class h{static createSyncDataSubscriber(e,t,n,o=console.error){return new h(e,t,o,n)}constructor(e,t,n,o){this.observable=e,this.onUpdate=t,this.onError=n,this.onFetchData=o,this.subscriber=null}async enable(){const e=e=>{this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=e};await u.subscribeWithRetry(this.observable,this.onUpdate,this.onError,{times:-1,duration:3e4,onUpdateSubscriber:e,onFetchData:this.onFetchData})}disable(){this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=null}}class p{constructor(){this.id=null,this.observable=null,this.subscriber=null,this.listeners={}}async enable(e){this.disable(),this.id=e,this.observable=u.createObservable("onGeneralUpdate",this.id);const t=e=>{const{channel:t,data:n}=e;if(!this.listeners[t])return;let o;try{o=JSON.parse(n)}catch(a){o=n}this.listeners[t].forEach((e=>e(o)))},n=async()=>{const e=Object.values(this.listeners).map((e=>e.map((e=>e.fetchData)))).flat(1).filter((e=>void 0!==e));return await Promise.all(e.map((e=>e())))};this.subscriber=h.createSyncDataSubscriber(this.observable,t,n),await this.subscriber.enable()}disable(){this.listeners={},this.subscriber&&(this.subscriber.disable(),this.subscriber=null),this.observable=null,this.id=null}addListener(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t),n&&t.fetchData!==n&&(t.fetchData=n)}removeListener(e,t){const n=t||"string"===typeof e?e:void 0;t=t||"string"!==typeof e?t:void 0,n&&!this.listeners[n]||(n&&t?this.listeners[n]=this.listeners[n].filter((e=>e!==t)):n&&!t?this.listeners[n]=void 0:Object.keys(this.listeners).forEach((e=>{this.listeners[e].includes(t)&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)))})))}}u.appendOperations(i),u.appendOperations(r),u.appendOperations(l);const m=new p,_=new p;var f={AwsApiGraphQL:u,createSyncDataSubscriber:h.createSyncDataSubscriber.bind(h),enableUserListener:async e=>await m.enable(e),disableUserListener:()=>m.disable(),addUserListener:(e,t,n)=>m.addListener(e,t,n),removeUserListener:(e,t)=>m.removeListener(e,t),enablePublicListener:async()=>await _.enable("*"),disablePublicListener:()=>_.disable(),addPublicListener:(e,t,n)=>_.addListener(e,t,n),removePublicListener:(e,t)=>_.removeListener(e,t)};t["a"]={Rest:s,GQL:f}},e7ec:function(e,t,n){"use strict";n.r(t);var o={};n.r(o),n.d(o,"createParams",(function(){return Yh})),n.d(o,"eventHandler",(function(){return Jh}));var a={};n.r(a),n.d(a,"createParams",(function(){return Zh})),n.d(a,"eventHandler",(function(){return ep}));var s={};n.r(s),n.d(s,"SubscribeGithubRepo",(function(){return dm}));n("a1c1"),n("04a1"),n("b576"),n("6b06"),n("0ecc"),n("9910"),n("19f3");var i=n("ff9b"),r=n("2c24"),l=n("b14a"),c=n("1dbb"),d=n("f680"),u=n("8750"),h=n("20c1");i["a"].use(c["a"],{config:{screen:{bodyClasses:!0},notify:{},dark:"auto"},lang:r["a"],iconSet:l["a"],plugins:{Notify:d["a"],Dialog:u["a"],Loading:h["a"]}});var p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"relative-position",attrs:{id:"q-app"}},[n("GlobalRecommend"),n("application-bar"),n("q-scroll-area",{staticClass:"main-area"},[n("router-view"),n("AboutDialog"),n("TaskDialog")],1)],1)},m=[],_=n("9856"),f=_["a"],g=(n("0928"),n("2b5f")),b=n("c782"),y=n("b2aa"),v=n("e586"),w=n("09a4"),k=n.n(w),C=Object(g["a"])(f,p,m,!1,null,null,null),$=C.exports;k()(C,"components",{QScrollArea:b["a"],QDialog:y["a"],QCard:v["a"]});var S=n("5584"),x=n("61a1"),T=async function(){const e="function"===typeof S["a"]?await Object(S["a"])({Vue:i["a"]}):S["a"],t="function"===typeof x["a"]?await Object(x["a"])({Vue:i["a"],store:e}):x["a"];e.$router=t;const n={router:t,store:e,render:e=>e($),el:"#q-app"};return{app:n,store:e,router:t}},I=(n("de6c"),n("91ab")),P=n("f4eb"),O=n.n(P);function q(e){return O()(e).luminosity()<.4?O()("white").fade(.1).string():O()("black").fade(.3).string()}function E(e){return O()(e).luminosity()<.4?O()(e).saturate(.3).darken(.5).string():O()(e).desaturate(.3).darken(.5).string()}function A(e,t){const n=e=>{const n=O()(t).isDark()?4:3;return O()(e).contrast(O()(t))>=n};if(n(e))return e;const o=O()(e).isDark();let a=O()(e);return a=o?a.mix(O()("white"),.3):a.mix(O()("black"),.3),n(a.string())||(a=a.saturate(.6)),a.string()}function D(e,t=!1){const n={color_page:"#fcfcfc",color_page_darken:"#1f1f1f"};return A(e,t?n.color_page_darken:n.color_page)}var N={invokeTextColor:q,invokeDarkenColor:E,invokeOnPageColor:D};let L;const j={mixins:[],render(e){const t=[];return this._injectVars(t),this._injectRules(t),e("style",{attrs:{type:"text/css","data-ab-theme":""}},t.join("\n"))},methods:{_injectVars(e){Object.keys(this.vars$root).length&&e.push(`:root {\n ${Object.entries(this.vars$root).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`),Object.keys(this.vars$light).length&&e.push(`.body--light {\n ${Object.entries(this.vars$light).map((e=>" "+e.join(": ")+";")).join("\n")}\n}`),Object.keys(this.vars$dark).length&&e.push(`.body--dark {\n ${Object.entries(this.vars$dark).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)},_injectRules(e){Object.entries(this.rules$root).forEach((([t,n])=>{e.push(`${t} {\n ${Object.entries(n).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)})),Object.entries(this.rules$light).forEach((([t,n])=>{e.push(`.body--light ${t} {\n ${Object.entries(n).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)})),Object.entries(this.rules$dark).forEach((([t,n])=>{e.push(`.body--dark ${t} {\n ${Object.entries(n).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)}))},setVars(e,t=null){const n=null===t?"vars$root":t?"vars$dark":"vars$light";this[n]=Object.assign({},this[n],Object.entries(e).reduce(((e,[t,n])=>({...e,[`--${Object(I["a"])(t)}`]:n})),{}))},setRules(e,t=null){const n=null===t?"rules$root":t?"rules$dark":"rules$light";this[n]=Object.assign({},this[n],Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:Object.entries(n).reduce(((e,[t,n])=>({...e,[Object(I["a"])(t)]:n})),{})})),{}))}},data(){return{vars$root:{},vars$light:{},vars$dark:{},rules$root:{},rules$light:{},rules$dark:{}}}};function R(){return L||(L=document.createElement("style"),document.head.appendChild(L)),L}let U;var F=e=>U||(j.mixins.push({created(){this.setupTheme(e)},methods:{setupTheme(e){Object.entries(e).forEach((([e,t])=>{this.setVars({[`q_color_${e}`]:t,[`q_color_on_${e}`]:N.invokeTextColor(t),[`q_color_txt_${e}`]:N.invokeOnPageColor(t,!1)},!1),this.setVars({[`q_color_${e}`]:N.invokeDarkenColor(t),[`q_color_on_${e}`]:N.invokeTextColor(N.invokeDarkenColor(t)),[`q_color_txt_${e}`]:N.invokeOnPageColor(N.invokeDarkenColor(t),!0)},!0)}));const t=e=>this.setRules({[`.bg-${e}`]:{backgroundColor:`var(--q-color-${e}) !important`,color:`var(--q-color-on-${e})`},[`.text-${e}`]:{color:`var(--q-color-txt-${e}) !important`},[`.bg-${e} .text-${e}`]:{color:`var(--q-color-on-${e}) !important`},[`.bg-${e}.text-${e}`]:{color:`var(--q-color-on-${e}) !important`}});Object.keys(e).forEach(t)}}}),U=new i["a"](j),U.$mount(R()),{updateTheme(e){var t;null===(t=U)||void 0===t||t.setupTheme(e)}}),M=n("d710"),B=n.n(M),Q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{directives:[{name:"touch-pan",rawName:"v-touch-pan.prevent.mouse",value:e.handlePan,expression:"handlePan",modifiers:{prevent:!0,mouse:!0}}],ref:"card",staticClass:"overflow-hidden",staticStyle:{"max-width":"360px"},style:e.floatingStyle,attrs:{flat:e.inner,bordered:e.inner}},[n("q-card-section",{staticClass:"q-py-xs flex relative-position bg-primary text-primary"},[n("div",[e._v("Theme Editor")]),n("q-space"),e.inner?n("q-btn",{staticClass:"absolute-right",staticStyle:{width:"32px!important","border-radius":"0!important"},attrs:{size:"xs",icon:"open_in_new",flat:""},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},click:function(t){return e.$emit("show")}}}):e._e(),e.inner?e._e():n("q-btn",{staticClass:"absolute-right",staticStyle:{width:"32px!important","border-radius":"0!important"},attrs:{size:"xs",icon:"close",flat:""},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},click:function(t){return e.$emit("close")}}})],1),n("q-separator"),n("q-card-section",{staticClass:"q-py-xs"},e._l(e.currentColors,(function(t,o){return n("InputColor",{key:o,attrs:{label:o,value:t},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},input:function(t){return e.updateColor(o,t)}}})})),1),n("q-separator"),n("q-card-section",{staticClass:"q-pa-sm flex"},[n("q-space"),n("q-btn",{staticClass:"q-mx-xs",attrs:{label:"Reset",unelevated:"",color:"general","text-color":"general","no-caps":""},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},click:e.reset}})],1)],1)},W=[],z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-input",{staticClass:"q-my-sm",attrs:{label:e.label,value:e.value,outlined:"",dense:"",readonly:""},on:{input:function(t){return e.$emit("input",t)}},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("q-icon",{staticClass:"rounded-borders cursor-pointer",style:{backgroundColor:e.value,color:e.textColor,width:"32px",height:"32px",marginLeft:"-8px"},attrs:{name:"colorize"}},[n("q-popup-proxy",{attrs:{cover:"","transition-show":"scale","transition-hide":"scale"}},[n("q-color",{attrs:{value:e.value},on:{input:function(t){return e.$emit("input",t)}}})],1)],1)]},proxy:!0},{key:"after",fn:function(){return[n("div",{staticClass:"flex items-center full-height",staticStyle:{margin:"-4px -8px -4px -2px"}},[n("div",{staticClass:"rounded-borders q-mx-xs",style:{backgroundColor:e.value,color:e.ColorUtils.invokeTextColor(e.value),width:"40px",height:"40px"}}),n("div",{staticClass:"rounded-borders q-mx-xs",style:{backgroundColor:e.ColorUtils.invokeDarkenColor(e.value),color:e.ColorUtils.invokeTextColor(e.ColorUtils.invokeDarkenColor(e.value)),width:"40px",height:"40px"}})])]},proxy:!0}])})},H=[],V={name:"InputColor",props:{label:String,value:String},data(){return{ColorUtils:N}},computed:{textColor(){return N.invokeTextColor(this.value)}}},G=V,K=n("0e45"),Y=n("f106"),J=n("ff50"),X=n("4101"),Z=Object(g["a"])(G,z,H,!1,null,"30ed6541",null),ee=Z.exports;k()(Z,"components",{QInput:K["a"],QIcon:Y["a"],QPopupProxy:J["a"],QColor:X["a"]});let te=null;const ne={data(){return{floating$info:null,floating$size:null}},computed:{floatingStyle(){var e,t,n,o;if(this.inner)return{};const a={};this.floating$info?Object.assign(a,{x:this.floating$info.position.left,y:this.floating$info.position.top}):this.floating$size?Object.assign(a,{x:document.body.clientWidth/2-this.floating$size.width/2,y:document.body.clientHeight/2-this.floating$size.height/2}):Object.assign(a,{x:0,y:0});const s=8;return a.y=Math.max(s,Math.min(a.y,document.body.clientHeight-s-(null!==(e=null===(t=this.floating$size)||void 0===t?void 0:t.height)&&void 0!==e?e:0))),a.x=Math.max(s,Math.min(a.x,document.body.clientWidth-s-(null!==(n=null===(o=this.floating$size)||void 0===o?void 0:o.width)&&void 0!==n?n:0))),{position:"fixed",top:a.y+"px",left:a.x+"px"}}},mounted(){const{width:e,height:t}=getComputedStyle(this.$refs.card.$el),n=e=>parseInt(e.endsWith("px")?e.slice(0,e.length-2):e);this.floating$size={width:n(e),height:n(t)}},methods:{handlePan(e){if(!this.inner){if(this.floating$info=this.floating$info||{},e.isFirst){const e=e=>parseInt(e.endsWith("px")?e.slice(0,e.length-2):e),{top:t,left:n}=getComputedStyle(this.$refs.card.$el);Object.assign(this.floating$info,{from:{x:e(n),y:e(t)}})}else e.isFinal;Object.assign(this.floating$info,{position:{top:this.floating$info.from.y+e.offset.y,left:this.floating$info.from.x+e.offset.x}}),this.floating$info=Object.assign({},this.floating$info)}}}},oe={data(){return te=te||Object.assign({},this.$theme.getCurrentTheme()),{currentColors:te}},methods:{updateColor(e,t){this.currentColors[e]=t,this.$theme.updateTheme({[e]:t})},reset(){Object.assign(this.currentColors,this.$theme.getCurrentTheme()),this.$theme.updateTheme(this.currentColors)}}};var ae={name:"ThemeEditor",mixins:[ne,oe],components:{InputColor:ee},props:{inner:Boolean}},se=ae,ie=n("d7c7"),re=n("990e"),le=n("1043"),ce=n("fc38"),de=n("3a21"),ue=Object(g["a"])(se,Q,W,!1,null,null,null),he=ue.exports;let pe;k()(ue,"components",{QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QBtn:le["a"],QSeparator:ce["a"]}),k()(ue,"directives",{TouchPan:de["a"]});var me=({Vue:e})=>{e.component("ThemeEditor",he);let t=B.a.theme.color;const n=F(t);e.prototype.$theme={showFloatingEditor:_e,hideFloatingEditor:fe,hasFloatingEditor:()=>!!pe,updateTheme:e=>n.updateTheme(e),getCurrentTheme:()=>t}};function _e({onClose:e}={}){if(pe)return;const t=document.createElement("div");document.body.appendChild(t),pe=new i["a"]({render(t){return t("ThemeEditor",{ref:"editor",on:{close:()=>{fe(),null===e||void 0===e||e()}}})}}).$mount(t)}function fe(){pe&&(pe.$destroy(),pe.$el.remove(),pe=null)}n("f200"),n("d4b5"),n("7a76"),n("dc69"),n("0c26"),n("b37d");var ge=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",e._g({class:["icon","text"].includes(e.buttonType)?"bg-transparent":void 0,attrs:{"no-wrap":"","no-caps":e.noCaps,size:e.size,loading:e.loading,disable:e.value||e.loading,percentage:e.percentage,type:e.type,icon:e.icon,fab:["fab"].includes(e.buttonType),unelevated:!["fab","elevated"].includes(e.buttonType),dense:e.dense,round:["icon"].includes(e.buttonType),label:["icon"].includes(e.buttonType)?void 0:e.label,color:["icon","text"].includes(e.buttonType)?void 0:e.color,textColor:["general","primary","secondary","accent","positive","negative"].includes(e.color)?e.color:""},scopedSlots:e._u([{key:"loading",fn:function(){return[n("q-spinner")]},proxy:!0}])},Object.assign({},"button"===e.type?{click:e.handleButton}:{})),[e._t("default")],2)},be=[],ye={name:"AlphabizButton",props:{buttonType:{type:String,default:"filled"},color:{type:String,default:"general"},size:{type:String,default:"md"},noCaps:{type:Boolean,default:!1},icon:{type:String,default:void 0},dense:Boolean,label:{type:String,default:void 0},value:{type:Boolean,default:!1},immediate:{type:Boolean,default(){return!!this.onClick}},type:{type:String,default:"button"},onClick:{type:Function,default:void 0},timeout:{type:Object,default:void 0},onAnimationEnd:{type:Function,default:void 0}},data(){return{loading:!1,percentage:100,interval:null}},methods:{async handleButton(e){if(this.onClick)if(this.immediate)this.onClick(e);else try{await this.startLoading(this.onClick,e)}finally{await this.stopLoading()}else this.$emit("click",e)},async startLoading(e,...t){this.$emit("input",!0),this.loading=!0,await new Promise((e=>setTimeout(e,800)));const n=this.timeout?this.timerWrapper(e):e;await n(...t)},async stopLoading(){this.shutdownTimer(),this.timeout&&await new Promise((e=>setTimeout(e,1e3))),this.onAnimationEnd&&this.onAnimationEnd(),this.loading=!1,this.$emit("input",!1)},async startTimer(e,t){const n=100,o=Math.max(100,t/100),a=Math.max(1,Math.floor(o)/t*n);return this.percentage=e,await new Promise(((e,t)=>{const n=()=>{this.percentage=Math.max(0,Math.min(100,this.percentage+a)),this.percentage<100||(this.shutdownTimer(),t(new Error("Timeout")))};this.interval=setInterval(n,o)}))},shutdownTimer(){this.percentage=100,null!==this.interval&&(clearInterval(this.interval),this.interval=null)},timerWrapper(e){const{onTimeout:t,duration:n}=this.timeout;return async(...o)=>{let a;try{a=await Promise.race([this.startTimer(0,n),e(...o)]),this.shutdownTimer()}catch(s){if("Timeout"!==s.message)throw s;t&&t()}return a}}},beforeDestroy(){this.shutdownTimer()}},ve=ye,we=(n("c036"),n("53ef")),ke=Object(g["a"])(ve,ge,be,!1,null,null,null),Ce=ke.exports;k()(ke,"components",{QBtn:le["a"],QSpinner:we["a"]});var $e=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-select",e._g({ref:"select",staticClass:"alphabiz-select",attrs:{dense:"",outlined:"",behavior:"menu",options:e.optionsCpt,readonly:e.readonly,autofocus:e.autofocus,value:e.model,"option-label":e.selectLabelFn,label:e.label,"use-input":Boolean(e.filter),"input-debounce":"0","input-style":e.enableFilter?"":"display:none"},on:{input:e.handleInput,keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.pressEnter.apply(null,arguments)}},scopedSlots:e._u([{key:"no-option",fn:function(){return[n("q-item",[n("q-item-section",{staticClass:"text-grey"},[e._v("\n No results\n ")])],1)]},proxy:!0},e.model&&(e.model.icon||e.model.emoji)?{key:"prepend",fn:function(){return[e.model.icon?n("q-icon",{attrs:{name:e.model.icon}}):e.model.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(e.model.emoji))]):e._e()]},proxy:!0}:null,{key:"option",fn:function(t){var o=t.itemProps,a=t.itemEvents,s=t.opt;return[n("q-item",e._g(e._b({staticClass:"overflow-hidden-x",style:e.itemStyle},"q-item",o,!1),a),[s.icon||s.emoji?n("q-item-section",{staticStyle:{"margin-left":"-4px","margin-right":"-22px"},attrs:{avatar:""}},[s.icon?n("q-icon",{attrs:{name:s.icon}}):s.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(s.emoji))]):e._e()],1):e._e(),n("q-item-section",{staticStyle:{"margin-left":"-4px"}},[n("q-item-label",{domProps:{innerHTML:e._s(s.label)}})],1)],1)]}}],null,!0)},Object.assign({},e.filter?{"popup-show":e.onPopupShow,filter:e.filterFn,"popup-hide":e.onPopupHide}:{})))},Se=[],xe={name:"AlphabizSelect",props:{readonly:Boolean,autofocus:Boolean,options:Array,value:[Object,Function,Number,String,Boolean],label:String,itemMaxWidth:{type:String,default:void 0},itemMinWidth:{type:String,default:void 0},selectLabelFn:{type:Function,default:e=>e?e.label:()=>""},align:[Element,Boolean],filter:{type:Function,default:void 0}},data(){return{enableFilter:!1,filterValue:""}},computed:{optionsCpt(){const e=e=>{const t={};if("object"===typeof e)for(const[n,o]of Object.entries(e))"label"===n?t.label=(()=>e.label?"function"===typeof e.label?e.label(e.value):e.label:""+e.value)():t[n]=o;else t.value=e,t.label=e;return t},t=this.options.map(e);if(this.filter&&this.enableFilter){const e=e=>""===this.filterValue||this.filter(this.filterValue,e);return t.filter(e)}return t},model(){if(this.enableFilter)return null;{const e=this.optionsCpt.find((e=>e.value===this.value));if(e)return e;throw new Error("invalid alphabiz-select value: "+this.value)}},itemStyle(){const e={};if(this.align){const t="boolean"===typeof this.align?this.$el:this.align,{width:n}=getComputedStyle(t);e.width=n}return this.itemMinWidth&&(e.minWidth=this.itemMinWidth),this.itemMaxWidth&&(e.maxWidth=this.itemMaxWidth),e}},methods:{handleInput(e){e&&this.$emit("input",e.value)},filterFn(e,t){t((()=>{this.filterValue=e}))},onPopupShow(){this.filterValue="",this.enableFilter=!0,this.$nextTick((()=>{const e=this.$refs.select.$el.getElementsByTagName("input")[0];e.focus()}))},onPopupHide(){this.enableFilter=!1,this.filterValue=""},pressEnter(){this.filter&&(this.optionsCpt.length>0&&this.handleInput(this.optionsCpt[0]),this.enableFilter=!1,this.filterValue="",this.$nextTick((()=>{const e=this.$refs.select.$el.getElementsByTagName("input")[0];e.blur()})))}}},Te=xe,Ie=(n("9344"),n("a4ac")),Pe=n("b329"),Oe=n("25fb"),qe=n("79e0"),Ee=n("b121"),Ae=Object(g["a"])(Te,$e,Se,!1,null,null,null),De=Ae.exports;k()(Ae,"components",{QSelect:Ie["a"],QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QItemLabel:qe["a"],QField:Ee["a"]});var Ne=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"wrapper",staticClass:"virtual-scroll-grid-wrapper",on:{scroll:e.handleScroll}},[e._e(),n("div",{ref:"before",staticClass:"virtual-scroll-grid__before"},[e._t("before",null,null,e.getSlotContext())],2),n("div",{ref:"grid",staticClass:"virtual-scroll-grid"},[e._l(e.items,(function(t,n){return e._t("default",null,null,Object.assign(e.getSlotContext(),{item:t,index:e.virtual.from+n}))}))],2),n("div",{ref:"after",staticClass:"virtual-scroll-grid__after"},[e._t("after",null,null,e.getSlotContext())],2)])},Le=[],je=n("3387");const Re={data(){return{grid:{container_width:void 0,column:void 0,scroll_top:void 0},virtual:{enable:!0,from:0,to:0},go$observer:null,update_enable:!0}},methods:{vs$calc(){const e=this.$refs.wrapper,t=this.$refs.before,n=this.$refs.grid,o=e.clientHeight,a=e.scrollTop,s=t.offsetHeight,i=n.clientWidth,r=this.itemWidth+this.gutter,l=this.itemHeight+this.gutter,c=Math.max(1,Math.floor((i-this.gutter)/r)),d=Math.floor((i-c*r)/2);let u=0;u+=this.gutter/2,u+=s;const h=Math.max(0,Math.floor((a-u)/l)),p=h*c,m=a-u-h*l,_=Math.ceil((o+m)/l),f=p+_*c,g=Math.min(f,this.itemsSize),b=_+(f>this.itemsSize?-1:0),y=g-p,v=this.itemsSize%c,w=Math.ceil((this.itemsSize-g)/c);let k,C,$,S;if(this.virtual.enable){const e=Math.max(0,h-this.virtualScrollSliceRow),t=Math.max(0,w-this.virtualScrollSliceRow);k=e*l,C=t*l;let n=t*c;n&&v&&(n-=c-v),$=0+e*c,S=this.itemsSize-n}else k=0,C=0,$=0,S=this.itemsSize;return{wrapper:e,grid:n,scroll_top:a,column:c,padding:d,scroll_row_top:h,scope_from:p,scope_to:g,scope_row:b,scope_count:y,scope_mod:v,scroll_row_bottom:w,virtual_padding_top:k,virtual_padding_bottom:C,virtual_from:$,virtual_to:S}},vs$update2(){const{wrapper:e,grid:t,scroll_top:n,column:o,padding:a,scroll_row_top:s,scope_from:i,scope_to:r,scope_row:l,scope_count:c,scope_mod:d,scroll_row_bottom:u,virtual_padding_top:h,virtual_padding_bottom:p,virtual_from:m,virtual_to:_}=this.vs$calc(),f=([e,t])=>this.grid[e]===t||(this.grid[e]=t),g=([e,t])=>this.grid[e]===t||(this.grid[e]=t);Object.entries({scroll_top:n,column:o}).map(f),this.grid._padding!==a&&(this.grid._padding=a,e.style.setProperty("--virtual-scroll-grid-padding",`${a}px`)),Object.entries({scroll_row_top:s,scope_from:i,scope_to:r,scope_row:l,scope_count:c,scope_mod:d,scroll_row_bottom:u}).map(g);const b=0;(this.virtual.to-r<=b||i-this.virtual.from<=b)&&(this.virtual._virtual_padding_top!==h&&(this.virtual._virtual_padding_top=h,t.style.setProperty("--virtual-scroll-offset-top",`${h}px`)),this.virtual._virtual_padding_bottom!==p&&(this.virtual._virtual_padding_bottom=p,t.style.setProperty("--virtual-scroll-offset-bottom",`${p}px`)),this.virtual.from!==m&&(this.virtual.from=m),this.virtual.to!==_&&(this.virtual.to=_))},vs$update(e){const t=()=>{const e=this.$refs.wrapper,t=this.$refs.before,n=this.$refs.grid,o=e.clientHeight,a=e.scrollTop,s=t.offsetHeight,i=n.clientWidth,r=this.itemWidth+this.gutter,l=this.itemHeight+this.gutter;return{wrapper:e,before:t,grid:n,wrapper_height:o,scroll_top:a,before_height:s,grid_width:i,width_per_item:r,height_per_item:l}},n={on_measure:({grid_width:e,width_per_item:t})=>{const n=Math.max(1,Math.floor((e-this.gutter)/t)),o=Math.floor((e-n*t)/2);return{column:n,padding:o}},on_update:({wrapper:e,column:t,padding:n,scroll_top:o})=>{this.grid.scroll_top=o,this.grid.column=t,e.style.setProperty("--virtual-scroll-grid-padding",`${n}px`)}},o={on_measure:({scroll_top:e,height_per_item:t,wrapper_height:n,before_height:o,column:a})=>{let s=0;s+=this.gutter/2,s+=o;const i=Math.max(0,Math.floor((e-s)/t)),r=i*a,l=e-s-i*t,c=Math.ceil((n+l)/t),d=r+c*a,u=Math.min(d,this.itemsSize),h=c+(d>this.itemsSize?-1:0),p=u-r,m=this.itemsSize%a,_=Math.ceil((this.itemsSize-u)/a);return{scroll_row_top:i,scope_from:r,scope_to:u,scope_row:h,scope_count:p,scope_mod:m,scroll_row_bottom:_}},on_update:e=>{this.grid.scroll_row_top=e.scroll_row_top,this.grid.scope_from=e.scope_from,this.grid.scope_to=e.scope_to,this.grid.scope_row=e.scope_row,this.grid.scope_count=e.scope_count,this.grid.scope_mod=e.scope_mod,this.grid.scroll_row_bottom=e.scroll_row_bottom}},a={on_measure:({scroll_row_top:e,scroll_row_bottom:t,height_per_item:n,column:o,scope_mod:a})=>{if(!this.virtual.enable)return{virtual_padding_top:0,virtual_padding_bottom:0,virtual_from:0,virtual_to:this.itemsSize};e=Math.max(0,e-this.virtualScrollSliceRow),t=Math.max(0,t-this.virtualScrollSliceRow);const s=e*n,i=t*n;let r=t*o;r&&a&&(r-=o-a);const l=0+e*o,c=this.itemsSize-r;return{virtual_padding_top:s,virtual_padding_bottom:i,virtual_from:l,virtual_to:c}},on_update:({grid:e,virtual_padding_top:t,virtual_padding_bottom:n,virtual_from:o,virtual_to:a})=>{e.style.setProperty("--virtual-scroll-offset-top",`${t}px`),e.style.setProperty("--virtual-scroll-offset-bottom",`${n}px`),this.virtual.padding_top=t,this.virtual.padding_bottom=n,this.virtual.from=o,this.virtual.to=a}},s={update_rect:n,update_grid:o,update_virtual:a};e||(e=Object.keys(s));const i=t();i&&(e.forEach((e=>{s[e]&&Object.assign(i,s[e].on_measure(i))})),e.forEach((e=>{s[e]&&s[e].on_update(i)})))},scrollTo(e){this.$refs.wrapper.scrollTop=e}},activated(){this.grid.scroll_top&&this.scrollTo(this.grid.scroll_top),this.update_enable=!0},deactivated(){this.update_enable=!1},mounted(){const e=this.vs$update2,t=Object(je["debounce"])((()=>e.call(this)),!0===this.$q.platform.is.ios?120:35,{trailing:!0});this.vs$update=(n,o)=>{this.update_enable&&(o?t.call(this):e.call(this))};const n=this.$refs.wrapper;this.$watch("gutter",(()=>{n.style.setProperty("--virtual-scroll-grid-gutter",`${this.gutter}px`)}),{immediate:!0}),this.$watch("itemWidth",(()=>{n.style.setProperty("--virtual-scroll-grid-item-width",`${this.itemWidth}px`)}),{immediate:!0}),this.$watch("itemHeight",(()=>{n.style.setProperty("--virtual-scroll-grid-item-height",`${this.itemHeight}px`)}),{immediate:!0}),this.go$observer=new ResizeObserver((()=>this.vs$update("go$observer"))),this.go$observer.observe(this.$refs.grid);const o=["gutter","itemsSize","virtualScrollSliceRow","itemWidth","itemHeight"];this.$watch((()=>o.reduce(((e,t)=>({...e,[t]:this[t]})),{})),(()=>this.vs$update("watcher")))},beforeUnmount(){this.go$observer.disconnect()}};var Ue={name:"VirtualScrollGrid",mixins:[Re],props:{virtualScrollSliceRow:{type:Number,default:30},itemWidth:Number,itemHeight:Number,gutter:{type:Number,default:16},itemsSize:Number,itemsFn:Function},data(){return{items:[]}},methods:{getSlotContext(){return{column:this.grid.column,mod:this.grid.scope_mod,virtual:this.virtual,grid:this.grid}},handleScroll(...e){this.vs$update("scroll",!0),this.$emit("scroll",...e),this.$emit("virtual-scroll",{from:this.virtual.from,to:this.virtual.to})}},mounted(){let e=!0;this.$watch((()=>(e&&(e=!1,this.vs$update("item_init")),this.itemsFn(this.virtual.from,this.virtual.to))),(e=>{this.items=e}),{immediate:!0})}},Fe=Ue,Me=(n("06cd"),Object(g["a"])(Fe,Ne,Le,!1,null,null,null)),Be=Me.exports,Qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{ref:"dialog",attrs:{"no-shake":"","content-class":{"fullscreen-dialog":!e.progress},persistent:!0,position:e.screen$xs&&!e.progress?"bottom":"standard"},on:{hide:function(t){return e.$emit("hide")},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.handleEsc.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleEnter.apply(null,arguments)}]}},[n("q-card",{staticClass:"column",style:{position:"relative",minWidth:e.title||e.showActions?"320px":void 0,maxWidth:"400px",maxHeight:"calc(100vh - 64px)"}},[e.title?n("q-card-section",{staticClass:"q-px-md q-pb-none",style:{paddingTop:"20px"}},[e.title?n("div",{staticClass:"text-h6 text-weight-bold non-selectable"},[e._v("\n "+e._s(e.title)+"\n ")]):e._e()]):e._e(),e.message?[n("q-card-section",{staticClass:"q-pb-none"},[n("div",{staticStyle:{"white-space":"pre-line"}},[e._v(e._s(e.message))])])]:e._e(),n("DialogBanner",{attrs:{banner:e.banner}}),n("DialogProgress",{attrs:{progress:e.progress}}),n("DialogList",{attrs:{list:e.list}}),n("DialogOption",{attrs:{options:e.options},on:{registerArgument:e.dialog$registerArgument,setValid:e.dialog$setValid}}),n("DialogPrompts",{attrs:{prompts:e.prompts},on:{registerArgument:e.dialog$registerArgument,setValid:e.dialog$setValid}}),e.showActions?n("q-card-actions",{staticClass:"q-px-md q-py-md",attrs:{vertical:""}},e._l(e.buttonAttrs,(function(t,o){return n("q-btn",e._g(e._b({directives:[{name:"show",rawName:"v-show",value:t.show,expression:"attrs.show"}],key:o,on:{keydown:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;t.stopPropagation()}}},"q-btn",t.props,!1),t.event))})),1):e._e()],2)],1)},We=[],ze={data(){return{dialog$validResults:{}}},computed:{dialog$validResult(){const e=Object.values(this.dialog$validResults).find((e=>!0!==e));return e||!0}},methods:{dialog$setValid(e,t){this.dialog$validResults={...this.dialog$validResults,[e]:t}}}},He={data(){return{dialog$argumentGetters:{}}},methods:{dialog$arguments(){const e=Object.keys(this.dialog$argumentGetters).reduce(((e,t)=>(e[t]=this.dialog$argumentGetters[t](this),e)),{});return e},dialog$registerArgument(e,t){this.dialog$argumentGetters[e]=t}}},Ve={data(){return{loadingState:null}},methods:{async dialog$useLoadingState(e,t){let n;try{this.loadingState=e;const o=t(this);n=o.then?await o:o}finally{this.loadingState=null}return n}}},Ge={methods:{dialog$buttonObject(e,t){if(!1===t)return null;const n={color:"general",textColor:"general",label:this.$t(e)},o={};return Object.assign(o,n),"object"===typeof t&&(Object.assign(o,t),"function"===typeof t.label&&(o.label=t.label()),"function"===typeof t.disable&&(o.disable=t.disable())),"function"===typeof t&&(o.handler=t.bind(this)),"string"===typeof t&&(o.label=t),o},async dialog$buttonHandler(e,t){if(!e)return;const n=e.handler;try{if(n){const e=n(this);e&&e.then&&await e}else t&&t()}catch(o){this.$emit("error",o)}},dialog$buttonAttrs(e,t,n){if(!t)return{show:!1};const o={noCaps:!0,noWrap:!0,unelevated:!0};return Object.assign(o,t),o.loading=this.loadingState===e||t.loading,o.disable=!!this.loadingState||t.disable,{show:!!t,props:o,event:{click:n}}}}},Ke={props:{actions:Object},computed:{dialog$actionButtons(){return this.actions?Object.keys(this.actions).reduce(((e,t)=>(e[t]=this.dialog$buttonObject(t,this.actions[t]),e)),{}):null},dialog$actionHandlers(){return this.actions?Object.keys(this.actions).reduce(((e,t)=>(e[t]=()=>this.dialog$buttonHandler(this.dialog$actionButtons[t]),e)),{}):null}}},Ye={props:{ok:{type:[Boolean,String,Function,Object],default:!0},cancel:{type:[Boolean,String,Function,Object],default:!1}},computed:{buttonOk(){const e=this.dialog$buttonObject("ok",this.ok);return e?(e.disable||(e.disable=!0!==this.dialog$validResult),e):e},buttonCancel(){return this.dialog$buttonObject("cancel",this.cancel)}},methods:{async handleOk(){await this.dialog$buttonHandler(this.buttonOk,(()=>{this.emitOk(this.dialog$arguments()),this.hide()}))},async handleCancel(){await this.dialog$buttonHandler(this.buttonCancel,(()=>{this.hide()}))}}},Je=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.banner?n("q-card-section",{staticClass:"q-pb-none overflow-hidden"},[n("q-banner",{staticClass:"bg-general text-general rounded-borders",scopedSlots:e._u([e.objectBanner.avatar?{key:"avatar",fn:function(){return[n("div",{staticClass:"flex items-center",staticStyle:{height:"40px"}},["loading"===e.objectBanner.avatar?n("q-spinner-ios",{staticStyle:{margin:"0.275rem"},attrs:{size:"1.2rem",color:"general"}}):n("q-icon",{attrs:{size:"1.75rem",name:e.objectBanner.avatar}})],1)]},proxy:!0}:null,{key:"default",fn:function(){return[e.objectBanner.title?n("div",{staticClass:"text-bold"},[e._v("\n "+e._s(e.objectBanner.title)+"\n ")]):e._e(),n("div",{staticClass:"ellipsis-3-lines"},[e._v(e._s(e.objectBanner.message))])]},proxy:!0}],null,!0)})],1):e._e()},Xe=[],Ze={name:"DialogBanner",props:{banner:[String,Object]},computed:{objectBanner(){return this.banner?"string"===typeof this.banner?{message:this.banner}:this.banner:null}}},et=Ze,tt=n("0051"),nt=n("7027"),ot=Object(g["a"])(et,Je,Xe,!1,null,null,null),at=ot.exports;k()(ot,"components",{QCardSection:ie["a"],QBanner:tt["a"],QSpinnerIos:nt["a"],QIcon:Y["a"]});var st=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.progress?n("q-card-section",{staticClass:"q-pb-md flex justify-center items-center"},[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),"boolean"!==typeof e.progress?n("div",{staticClass:"q-ml-sm"},["string"===typeof e.progress?[e._v("\n "+e._s(e.progress)+"\n ")]:[n("div",[e._v(e._s(e.progress.title))]),e.progress.caption?n("div",[e._v(e._s(e.progress.caption))]):e._e()]],2):e._e()],1):e._e()},it=[],rt={name:"DialogProgress",props:{progress:[Boolean,String,Object]}},lt=rt,ct=Object(g["a"])(lt,st,it,!1,null,"c513ce1e",null),dt=ct.exports;k()(ct,"components",{QCardSection:ie["a"],QSpinnerIos:nt["a"]});var ut=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.list?n("q-card-section",{staticClass:"q-pb-none"},[n("q-list",{staticClass:"rounded-borders full-width column items-stretch",attrs:{bordered:"",separator:""}},e._l(e.list.items,(function(t,o){return n("q-item",{key:t.key||o,staticClass:"overflow-hidden"},[n("q-item-section",[n("q-item-label",{staticClass:"ellipsis"},[e._v(e._s(t.label))]),t.caption?n("q-item-label",{staticClass:"ellipsis-3-lines",attrs:{caption:""}},[e._v(e._s(t.caption))]):e._e()],1)],1)})),1)],1):e._e()},ht=[],pt={name:"DialogList",props:{list:Object}},mt=pt,_t=n("e7c2"),ft=Object(g["a"])(mt,ut,ht,!1,null,"18c77b6c",null),gt=ft.exports;k()(ft,"components",{QCardSection:ie["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"]});var bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.modelOptions?n("q-card-section",{staticClass:"q-pb-none"},[n("q-option-group",{staticClass:"dialog-option-group",attrs:{options:e.modelOptions.items,type:e.modelOptions.type||"radio"},scopedSlots:e._u([{key:"label",fn:function(t){var o=t.label,a=t.desc,s=t.tooltip;return[n("q-item",{staticClass:"q-pl-xs q-pr-none non-selectable"},[n("q-item-section",[n("q-item-label",[e._v(e._s(o))]),a?n("q-item-label",{staticClass:"ellipsis",attrs:{caption:""}},[e._v(e._s(a))]):e._e()],1),s?n("q-tooltip",{attrs:{"max-width":"320px",anchor:"bottom middle",self:"top middle","transition-show":"jump-down","transition-hide":"jump-up","transition-duration":0,delay:600}},[n("span",{staticStyle:{"font-size":"0.8rem"}},[e._v(e._s(s))])]):e._e()],1)]}}],null,!1,3266841923),model:{value:e.modelOptions.model,callback:function(t){e.$set(e.modelOptions,"model",t)},expression:"modelOptions.model"}})],1):e._e()},yt=[],vt={name:"DialogOption",props:{options:Object},data(){return{modelOptions:this.options}},computed:{validatedResult(){const e=this.modelOptions.items.find((e=>e.value===this.modelOptions.model));return e?!e.disable||"disabled_option_item":"option_item_not_found"}},beforeMount(){this.modelOptions&&(this.$emit("registerArgument","option",(()=>this.modelOptions.model)),this.$watch("validatedResult",(e=>{this.$emit("setValid","option",e)}),{immediate:!0}))}},wt=vt,kt=(n("030c"),n("8128")),Ct=n("cf25"),$t=n("2b77"),St=Object(g["a"])(wt,bt,yt,!1,null,null,null),xt=St.exports;k()(St,"components",{QCardSection:ie["a"],QOptionGroup:kt["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"],QTooltip:Ct["a"],QRadio:$t["a"]});var Tt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.modelPrompts?n("q-card-section",{staticClass:"q-pb-none"},[e._l(e.modelPrompts,(function(t){return["tel"===t.type?n("DialogPromptTel",{key:t.key,staticClass:"q-my-sm",attrs:{rules:t.rules||void 0},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"prompt.model"}}):n("q-input",{key:t.key,staticClass:"q-my-sm",attrs:{type:"password"!==t.type?t.type:t.hidden?"password":"text",label:t.label,rules:t.rules||void 0,outlined:"",dense:"",autofocus:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[t.icon&&"tel"!==t.type?n("q-icon",{attrs:{name:t.icon}}):e._e()]},proxy:!0},void 0!==t.hidden?{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:t.hidden?"visibility_off":"visibility"},on:{click:function(e){t.hidden=!t.hidden}}})]},proxy:!0}:null],null,!0),model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"prompt.model"}})]}))],2):e._e()},It=[],Pt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("TelInput",{attrs:{"error-message":e.errorMessage},on:{setNotSay:e.setNotSay},scopedSlots:e._u([{key:"selector",fn:function(){return[n("TelSelector",{model:{value:e.selectedOption,callback:function(t){e.selectedOption=t},expression:"selectedOption"}})]},proxy:!0},e.selectedOption.prefixCode?{key:"prefix-code",fn:function(){return[e._v("\n +"+e._s(e.selectedOption.prefixCode)+"\n ")]},proxy:!0}:null],null,!0),model:{value:e.inputValue,callback:function(t){e.inputValue=t},expression:"inputValue"}})},Ot=[],qt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-input",{staticClass:"dialog-prompt-tel",attrs:{outlined:"",dense:"",autofocus:"",type:"tel",value:e.value,error:!!e.errorMessage,"error-message":e.errorMessage},on:{input:function(t){return e.$emit("input",t)},keydown:function(t){if(!t.type.indexOf("key")&&8!==t.keyCode)return null;0===e.value.length&&e.$emit("setNotSay")}},scopedSlots:e._u([{key:"before",fn:function(){return[e._t("selector")]},proxy:!0},{key:"prepend",fn:function(){return[e.$slots["prefix-code"]?n("div",{staticClass:"non-selectable",style:e.prefixCodeStyle},[e._t("prefix-code")],2):e._e()]},proxy:!0}],null,!0)})},Et=[];const At={data(){return{prefixCodeStyle:{padding:"6px 0",fontSize:"14px",fontWeight:"400",letterSpacing:"0.00937em",lineHeight:"28px"}}}};var Dt={name:"TelInput",mixins:[At],props:{value:String,errorMessage:String}},Nt=Dt,Lt=(n("0102"),Object(g["a"])(Nt,qt,Et,!1,null,null,null)),jt=Lt.exports;k()(Lt,"components",{QInput:K["a"],QField:Ee["a"]});var Rt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-select",e._g(e._b({attrs:{dense:"",outlined:"",behavior:"menu",options:e.prefixOptions,"option-label":function(){return""},"menu-offset":[0,4],"menu-self":"bottom start","menu-anchor":"top left","transition-show":"jump-down","transition-hide":"jump-up"},scopedSlots:e._u([{key:"no-option",fn:function(){return[n("q-item",{staticClass:"non-selectable",style:e.noOptionStyle},[n("q-item-section",{staticClass:"text-grey"},[e._v("\n No results\n ")])],1)]},proxy:!0},{key:"prepend",fn:function(){return[n("div",{staticClass:"non-selectable",style:e.emojiStyle},[e._v(e._s(e.emoji))])]},proxy:!0},{key:"option",fn:function(t){var o=t.itemProps,a=t.itemEvents,s=t.opt;return[n("q-item",e._g(e._b({staticClass:"overflow-hidden-x non-selectable",style:e.optionStyle},"q-item",o,!1),a),[s.emoji?n("q-item-section",{staticStyle:{"margin-left":"-4px","margin-right":"-22px"},attrs:{avatar:""}},[n("div",{style:e.emojiStyle},[e._v(e._s(s.emoji))])]):e._e(),n("q-item-section",{staticStyle:{"margin-left":"-4px"}},[n("q-item-label",{domProps:{innerHTML:e._s("not_say"===s.label?e.$t("account_not_say"):s.label)}})],1)],1)]}}]),model:{value:e.prefixModel,callback:function(t){e.prefixModel=t},expression:"prefixModel"}},"q-select",e.filterProps,!1),e.filterEvents))},Ut=[],Ft=n("1c53");const Mt=(()=>{const e={TW:e=>{"TW"===e.country_code&&(e.emoji="🇼🇫")}},t=[];return Object.entries(Ft["countries"]).forEach((([n,o])=>{const a={country_code:n,name:o.name,name_native:o.native,emoji:o.emoji,phone_list:o.phone.split(","),language_list:o.languages};e.TW(a),t.push(a)})),t})(),Bt=(()=>{const e=[];return Mt.forEach((t=>{t.phone_list.forEach((n=>{const o={id:`${t.country_code}-${n}`,country_emoji:t.emoji,country_name:t.name,country_name_native:t.name_native,country_code:t.country_code,phone_number_code:n};e.push(o)}))})),e})(),Qt=(()=>{const e={US:(e,t)=>{if("1"===e.phone_number_code)return"US"===e.country_code?-1:"US"===t.country_code?1:0}},t=(t,n)=>{const o=parseInt(t.phone_number_code),a=parseInt(n.phone_number_code);if(o!==a)return o>a?1:-1;let s;return Object.values(e).some((e=>(s=e(t,n),void 0!==s))),void 0===s?0:s},n=Bt.sort(t);return n})(),Wt=Qt.reduce(((e,t)=>(e[t.id]=t,e)),{}),zt={value:"not_say",label:"not_say",emoji:"🇼🇫"},Ht=(()=>{const e=Object.values(Wt).map((e=>({value:e.id,label:`${e.country_name_native} (+${e.phone_number_code})`,emoji:e.country_emoji})));return e.unshift(zt),e})(),Vt=e=>e===zt.value?zt:Wt[e],Gt=e=>{const t=e.startsWith("+"),n=/^00/.test(e);let o=null,a=null,s=e;return t?Object.values(Wt).find((t=>{const n=`+${t.phone_number_code}`;return!!e.startsWith(n)&&(s=e.substr(n.length),o=t.country_code,a=t.phone_number_code,!0)})):n&&Object.values(Wt).find((t=>{const n=`00${t.phone_number_code}`;return!!e.startsWith(n)&&(s=e.substr(n.length),o=t.country_code,a=t.phone_number_code,!0)})),{countryCode:o,prefixCode:a,phoneNumber:s}},Kt={data(){return{emojiStyle:{fontFamily:"Noto Color Emoji",fontSize:"1.22rem",color:"#000"}}}},Yt={data(){const e={getInputEl:()=>this.$parent.$parent.$el,observer:new ResizeObserver((()=>{const e=this.mixin$OptionsStyle.getInputEl(),{width:t}=getComputedStyle(e);this.optionStyle={width:`calc(${t} - 8px)`},this.noOptionStyle={width:t}}))};return{mixin$OptionsStyle:e,optionStyle:{},noOptionStyle:{}}},mounted(){this.mixin$OptionsStyle.observer.observe(this.mixin$OptionsStyle.getInputEl())},beforeDestroy(){this.mixin$OptionsStyle.observer.unobserve(this.mixin$OptionsStyle.getInputEl())}},Jt={data(){return{isPopupShow:!1,filter:null}},computed:{filterProps(){return{useInput:!0,inputDebounce:"0",inputStyle:this.isPopupShow?void 0:"display:none"}},filterEvents(){return{"popup-show":this.onPopupShow.bind(this),filter:this.onFilter.bind(this),"popup-hide":this.onPopupHide.bind(this)}}},methods:{onFilter(e,t){t((()=>{this.filter=t=>{if(!e)return!0;if("not_say"===t)return!1;const n=Vt(t),o=[n.country_code,n.country_name,n.country_name_native,n.phone_number_code];return o.some((t=>t.toLowerCase().includes(e.toLowerCase())))}}))},onPopupShow(){this.isPopupShow=!0,this.$nextTick((()=>{const e=this.$el.getElementsByTagName("input")[0];e.focus()}))},onPopupHide(){this.isPopupShow=!1,this.filter=null,this.mixin$OptionsStyle.getInputEl().focus()}}};var Xt={name:"TelSelector",mixins:[Kt,Yt,Jt],props:{value:Object},data(){return{countryCode:null,prefixCode:null}},computed:{prefixOptions(){let e=Object.assign([],Ht);return this.filter&&(e=e.filter((e=>this.filter(e.value)))),e},prefixModel:{get(){const{countryCode:e,prefixCode:t}=this.value;return e&&t?`${e}-${t}`:"not_say"},set(e){var t,n;const o=null!==e&&void 0!==e&&e.value?Vt(e.value):{};this.$emit("input",{countryCode:null!==(t=o.country_code)&&void 0!==t?t:null,prefixCode:null!==(n=o.phone_number_code)&&void 0!==n?n:null})}},emoji(){const e=Vt(this.prefixModel);return e.emoji||e.country_emoji}}},Zt=Xt,en=(n("3a211"),Object(g["a"])(Zt,Rt,Ut,!1,null,null,null)),tn=en.exports;k()(en,"components",{QSelect:Ie["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"]});const nn={watch:{selectedOption(e,t){const n=e=>!(e.countryCode&&e.prefixCode);n(e)&&!n(t)&&(this.inputValue="")}},methods:{setNotSay(){this.selectedOption={countryCode:null,prefixCode:null}}}},on={data(){return{errorMessage:void 0}},watch:{value(e){const t=e=>{let t;return this.rules.find((n=>(t=n(e),t&&!0!==t))),!0===t?void 0:t},n=t(e.phoneNumber);n?this.errorMessage=n:e.phoneNumber&&!e.prefixCode?this.errorMessage=this.$t("account_error_invalid_phone_number_format"):this.errorMessage=void 0}}};var an={name:"DialogPromptTel",mixins:[nn,on],props:{value:{type:Object,required:!0},rules:Array},components:{TelInput:jt,TelSelector:tn},computed:{selectedOption:{get(){return{countryCode:this.value.countryCode,prefixCode:this.value.prefixCode}},set(e){this.$emit("input",{prefixCode:e.prefixCode,countryCode:e.countryCode,phoneNumber:this.value.phoneNumber})}},inputValue:{get(){return this.value.phoneNumber},set(e){const{prefixCode:t,countryCode:n,phoneNumber:o}=Gt(e);this.$emit("input",{prefixCode:t||this.value.prefixCode,countryCode:n||this.value.countryCode,phoneNumber:o})}}}},sn=an,rn=Object(g["a"])(sn,Pt,Ot,!1,null,null,null),ln=rn.exports,cn={name:"DialogPrompts",components:{DialogPromptTel:ln},props:{prompts:Object},data(){const e=this.prompts?Object.keys(this.prompts).map((e=>{const t=this.prompts[e];return t.key=e,"password"===t.type&&(t.hidden=!0),t})):null;return{modelPrompts:e}},computed:{validatedResult(){let e;return this.modelPrompts&&this.modelPrompts.filter((e=>!!e.rules)).find((t=>t.rules.some((n=>{const o="tel"===t.type?[t.model.phoneNumber,t.model.prefixCode]:[t.model],a=n(...o);return!0!==a&&(e=a),!!e})))),e=e||!0,e}},watch:{validatedResult(e){this.$emit("setValid","prompts",e)}},beforeMount(){if(this.modelPrompts){const e=()=>this.modelPrompts.reduce(((e,t)=>(e[t.key]=t.model,e)),{});this.$emit("registerArgument","prompts",e),this.$emit("setValid","prompts",this.validatedResult)}}},dn=cn,un=Object(g["a"])(dn,Tt,It,!1,null,"21114862",null),hn=un.exports;k()(un,"components",{QCardSection:ie["a"],QInput:K["a"],QIcon:Y["a"]});const pn={methods:{handleEsc(){const e="cancel";if(!this.buttonAttrs[e])return;const t=this.buttonAttrs[e];!t.show||t.props.disable||t.props.loading||t.event.click()},handleEnter(){const e="ok";if(!this.buttonAttrs[e])return;const t=this.buttonAttrs[e];!t.show||t.props.disable||t.props.loading||t.event.click()}}},mn={props:{contextCallback:Function},created(){this.contextCallback&&this.contextCallback(this)}},_n=e=>({props:e.reduce(((e,t)=>Object.assign(e,t.props)),{})}),fn={name:"ABDialog",components:{DialogBanner:at,DialogProgress:dt,DialogList:gt,DialogOption:xt,DialogPrompts:hn},mixins:[pn,mn,ze,He,Ve,Ge,Ke,Ye,_n([at,dt,gt,xt,hn])],props:{title:String,message:String},computed:{showActions(){return this.buttonAttrs&&Object.values(this.buttonAttrs).some((e=>!1!==e.show))},buttonAttrs(){const e=this.dialog$actionButtons?Object.keys(this.dialog$actionButtons).reduce(((e,t)=>(e[t]=[this.dialog$actionButtons[t],this.dialog$actionHandlers[t]],e)),{}):{},t={ok:[this.buttonOk,this.handleOk],...e,cancel:[this.buttonCancel,this.handleCancel]};return Object.keys(t).reduce(((e,n)=>(e[n]=this.dialog$buttonAttrs(n,...t[n]),e)),{})}},methods:{show(){this.$refs.dialog.show()},emitOk(e){this.$emit("ok",e)},hide(){this.$refs.dialog.hide()}}};var gn=fn,bn=gn,yn=n("59ba"),vn=Object(g["a"])(bn,Qe,We,!1,null,null,null),wn=vn.exports;k()(vn,"components",{QDialog:y["a"],QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QCardActions:yn["a"],QBtn:le["a"]});var kn=e=>{e.component("ABDialog",wn),Object.defineProperty(e.prototype,"$alphabiz",{get(){const e={};return e.dialog=e=>Cn.call(this,e),e}})};function Cn(e){const t={},n={};Object.assign(n,e),n.component=wn,n.contextCallback=e=>t.vm=e,t.dialog=this.$q.dialog(n),t.dialog.vm=t.vm;const o=e=>{e.promise=t=>new Promise(((n,o)=>{if(e.vm.$on("error",o),t){if("cancel"===t){let t=!1;e.onCancel((()=>t=!0)).onDismiss((()=>n(t)))}else if("ok"===t){let t;e.onOk((e=>e&&(t=e))).onDismiss((()=>n(t)))}}else e.onDismiss(n)}))};return o(t.dialog),t.dialog}var $n=n("bf73"),Sn=n.n($n),xn=n("d310"),Tn=n("3fd2"),In=n.n(Tn);function Pn(e){e.directive("show$cfg",On())}function On(){const e=(e,t,n)=>{const o=n.componentInstance.d$cfg,a=[t.arg,...Object.keys(t.modifiers||{})];let s=a.reduce(((e,t)=>e[t]),o);s=void 0===t.value?s:t.value===s,e.style.display=s?e._cfg$show.display:"none"};return{bind(t,n,o){t._cfg$show={display:t.style.display},e(t,n,o)},update(t,n,o){e(t,n,o)},unbind(e){e.style.display=e._cfg$show.display,delete e._cfg$show}}}var qn=n("0f0c"),En=n("d558"),An=(n("908d"),function(e,{getLocalConfig:t,getRemoteConfigUrl:n}){const o=jn(),{config:a,loadRemoteConfig:s}=Dn({localConfig:t(),remoteConfigUrls:i(n())});function i(e){const t=[`/${o.version}.json`,`/${o.version.split("-")[0]}.json`,"/default.json"];return t.map((t=>e+t))}function r(e,t){const n=new e({data(){return{config:t}}});e.mixin({computed:{d$cfg(){return n.config}}}),Pn(e)}s((e=>{In.a.mas()&&Nn(e.config,{update:{enable:!1}})})),r(e,a)});function Dn(e){const{localConfig:t,remoteConfigUrls:n}=e,o=Nn({},t);let a;o.remoteLoaded=!1,Object.defineProperties(o,{onRemoteConfigLoaded:{value:new Promise((e=>a=e)),configurable:!1,writable:!1,enumerable:!1}});const s=async e=>{const t=await i(n),{config:s}=t;return s.remoteLoaded=!0,await e(t),Nn(o,s),a(t),t};return{config:o,loadRemoteConfig:s};async function i(e){console.log("get from urls",e);const t=[];t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("sources").log(e)));const n=await new Promise((async n=>{let a={},s=null;for(const i of e)try{a=await o(i),s=i;break}catch{t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("not found").log(i)))}s?t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("got").log(s,a))):t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("remote config not found").log())),n({url:s,config:a})}));return console.tag.orange("DynamicConfig","Remote").group(""),t.forEach((e=>e())),console.groupEnd(),n;async function o(e){return await Ln((()=>fetch(e).then((e=>e.json()))),{onRetry(e){console.tag("getRemoteConfig").log("retry",e.count)}})}}}function Nn(e,t){const n=e=>!!e&&"object"===typeof e&&!Array.isArray(e);return Object.entries(t).forEach((([t,o])=>{var a;n(o)?(e[t]=null!==(a=e[t])&&void 0!==a?a:{},Nn(e[t],o)):e[t]=o})),e}async function Ln(e,{onRetry:t}={}){const n=async o=>{try{return o.count&&await(null===t||void 0===t?void 0:t(o)),await e()}catch(a){if(a instanceof TypeError){if(await new Promise((e=>setTimeout(e,1e3))),o.count+=1,o.count>=30)throw a;return await n(o)}throw a}};return await n({count:0})}function jn(){const e={version:Object(qn["a"])("version"),buildTime:Object(qn["a"])("buildTime")};return e.web=(()=>{try{return"web"===e.version.split("-")[1]}catch{return!1}})(),e.store=(()=>{const e=Object(qn["a"])("packageFormat");return Object(En["a"])()?"capacitor":In.a.mas()?"mac":In.a.windowsStore()?"microsoft":!(!e||"snap"!==e)&&"linux"})(),e}var Rn=e=>{},Un=n("67cf"),Fn=n("eb7a");n("f18a"),n("dc89"),n("2425"),n("7996");const Mn=(...e)=>console.tag.red("VideoJs","player",...e),Bn={Video:{opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",webm:"video/webm",flv:"video/x-flv","3gp":"video/3gpp",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",avi:"video/x-msvideo"},Image:{jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Audio:{m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav"}},Qn=(Bn.Video,Bn.Audio,Bn.Image,{mkv:["video/webm","video/mp4"],avi:["video/mp4"]}),Wn={MEDIA_ERR_ABORTED:1,MEDIA_ERR_CUSTOM:0,MEDIA_ERR_DECODE:3,MEDIA_ERR_ENCRYPTED:5,MEDIA_ERR_NETWORK:2,MEDIA_ERR_SRC_NOT_SUPPORTED:4};var zn=[Hn(),Kn({volume:ao},{setVolume:_o}),Kn({isFullscreen:oo},{setFullscreen:mo}),Kn({isPiP:no},{setPiP:po}),Kn({playbackRate:to},{setPlaybackRate:ho}),Kn({poster:eo},{setPoster:co}),Vn(),Gn()];function Hn(){const e={id:Yn,currentTime:Jn,buffered:Zn,duration:Xn,isPaused:so,isMuted:io},t={play:ro,pause:lo,seek:uo,mute:fo,stop:go,destroy:bo,ctl$on:n,ctl$emit:o};return Kn(e,t);function n(e,t){this.on(`controller::${e}`,t)}function o(e){this.trigger(`controller::${e}`)}}function Vn(){return Kn({isWaiting:n,currentSources:e,loadingState:t},{setSource:o});function e(){const e=()=>{const e=this.currentSources();return e.filter((e=>!!e.src&&!!e.type))};return this.$set(e,["setSource$start","setSource$end","stop$"]),e()}function t(){const e=e=>{if(!e)return!1;if("setSource$start"===e)return!0;if(["setSource$end","error"].includes(e)){const e=this.error();return!!e&&{type:Object.keys(Wn).find((t=>Wn[t]===e.code)),message:e.message}}};return this.$set(e,["setSource$start","setSource$end","error","stop$"]),e()}function n(){let e=null;return this.on("waiting",(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.$set(!0)}),100)})),this.on("canplay",(()=>{e&&clearTimeout(e),this.$set(!1)})),this.on("stop$",(()=>{e&&clearTimeout(e),this.$set(!1)})),!1}async function o(...e){const t=e[e.length-1];t instanceof AbortSignal&&e.splice(e.length-1);const n=t instanceof AbortSignal?t:(new AbortController).signal;let o=!1;n.onabort=()=>{o=!0};try{this.trigger("setSource$start"),await new Promise(((t,s)=>{this.ready((()=>{if(o||n.aborted)return console.log("setSource Aborted",n.reason),s("Aborted");console.log("Not aborted",o,n,e[0]),this.one("loadedmetadata",t),this.one("error",s);const i=e.map(a).flat(1);Mn().tag("setSource","sources").log(i),this.src(i)}))}))}finally{this.trigger("setSource$end")}function a(e){var t;const n=[];let o,a;if("object"===typeof e){var s;o=e,a=null!==(s=l(o))&&void 0!==s?s:"mp4"}else{if("string"!==typeof e)return e;var i;o={src:e},a=null!==(i=l(o))&&void 0!==i?i:"mp4",Object.assign(o,{type:`video/${a}`})}o.type&&n.push(o);const r=null!==(t=Bn.Video[a])&&void 0!==t?t:Bn.Video.mp4;return n.some((e=>e.type===r))||d({type:r}),c(a).forEach((e=>d({type:e}))),n;function l(e){if(e.src&&-1!==e.src.lastIndexOf(".")){const t=new URL(e.src);return t.pathname.slice(t.pathname.lastIndexOf(".")+1)}if(e.type){const t=Object.keys(Bn.Video).find((t=>Bn.Video[t]===e.type));if(t)return t}if(e.filename){const t=e.filename.replace(/\\/g,"/").split("/").reverse()[0];if(-1!==t.lastIndexOf("."))return t.slice(t.lastIndexOf(".")+1)}return null}function c(e){if(!Qn[e])return[];const t=Object.values(n).map((e=>e.type));return Qn[e].filter((e=>!t.includes(e)))}function d(e){const t=e=>Object.assign(Object.entries(o).reduce(((e,[t,n])=>({...e,[t]:n})),{}),e),a=t(e);n.push(a)}}}}function Gn(){return Kn({track:e},{enableTrack:t,disableTrack:n,addTrack:o,removeTrack:a,setTrackOffset:s});function e(){const e=t.call(this);return this.on("track$enable",(()=>{const e=a.call(this),t=e.find((e=>"showing"===e.mode));if(!t)throw new Error("Enabled track not founded");const n=this.$state.track;n.currentTrack=o.call(this,t),n.enable=!0})),this.on("track$disable",(()=>{const e=this.$state.track;e.enable=!1})),this.on("track$add",(()=>n.call(this))),this.on("track$remove",(()=>{n.call(this)})),this.on("stop$",(()=>{var e;n.call(this);const t=this.$state.track;null===(e=t.currentTrack)||void 0===e||e.disable(),t.currentTrack=null,t.enable=!1})),e;function t(){const e={};return e.tracks=a.call(this).map((e=>e.id)),e.offset=0,e.currentTrack=null,e.enable=!1,e}function n(){const e=a.call(this),t=this.$state.track;t.tracks=e.map((e=>e.id))}function o(e){const t=()=>{const e=this.$state.track,o=e.currentTrack;if(!o)return this.off("texttrackchange",t);e.currentTrack.text=n.call(o.get(),e.offset)};return o(t),this.on("texttrackchange",t),{id:e.id,text:n.call(e,0),get:()=>e,disable:()=>{this.off("texttrackchange",t)}};function n(e){if(!this.loaded_)return null;if(0===this.cues.length)return null;const t=this.tech_.currentTime$org()+e,n=[];for(let o=0,a=this.cues.length;o=t&&n.push(e)}return n.map((e=>e.text)).join("")}function o(t){const n=e.tech_;e.tech_.__modified__||(e.tech_=new Proxy(n,{get(e,n,o){return"__modified__"===n||("currentTime$org"===n?Reflect.get(e,"currentTime",o):("currentTime"===n&&t(),Reflect.get(e,n,o)))},set(e,t,n,o){return Reflect.set(e,t,n,o)}}))}}function a(){var e;return Array.from(null!==(e=this.remoteTextTracks())&&void 0!==e?e:[]).filter((e=>"captions"===e.kind))}}function t(e){var t;const n=this.$state.track;if(!e){if(n.enable)return;if(n.currentTrack)e=n.currentTrack.id;else{if(!(n.tracks&&n.tracks.length>0))return;e=n.tracks[0]}}const o=Array.from(null!==(t=this.remoteTextTracks())&&void 0!==t?t:[]).filter((e=>"captions"===e.kind)),a=o.some((t=>t.id===e));if(!a)throw new Error("Track not founded: "+e);o.forEach((t=>{t.mode=t.id===e?"showing":"disabled"})),this.trigger("track$enable")}function n(){var e;const t=this.$state.track;if(!t.currentTrack)return;const n=Array.from(null!==(e=this.remoteTextTracks())&&void 0!==e?e:[]).filter((e=>"captions"===e.kind));n.forEach((e=>e.mode="disabled")),this.trigger("track$disable")}function o({id:e,src:t}){const n=this.$state.track;if(n.tracks.includes(e))return;const o={id:e,src:t,kind:"captions",mode:"disabled"};this.addRemoteTextTrack(o,!0),this.trigger("track$add")}function a(e=null){var o,a;const s=this.$state.track,i=Array.from(null!==(o=this.remoteTextTracks())&&void 0!==o?o:[]).filter((e=>"captions"===e.kind));let r,l=[];if(e){if(!s.tracks.includes(e))return;r=s.currentTrack.id===e,l.push(e)}else r=!0,l.push(...s.tracks);r&&(n.call(this),s.currentTrack.disable(),s.currentTrack=null),l.forEach(d.bind(this));const c=Array.from(null!==(a=this.remoteTextTracks())&&void 0!==a?a:[]).filter((e=>"captions"===e.kind));if(this.trigger("track$remove"),c.length&&r){const e=c[0];console.log("Select first track after remove current",e),t.call(this,e.id)}function d(e){const t=i.find((t=>t.id===e));t&&this.removeRemoteTextTrack(t)}}function s(e){const t=this.$state.track;t.offset=e,this.trigger("texttrackchange")}}function Kn(e={},t={}){return{states:e,controls:t}}function Yn(){return this.id()}function Jn(){const e=()=>this.currentTime();return this.$set(e,["timeupdate","stop$"]),e()}function Xn(){const e=()=>this.duration()||0;return this.$set(e,["durationchange","stop$"]),e()}function Zn(){const e=()=>{const e=this.buffered(),t=[];for(let n=0;nthis.poster();return this.$set(e,["posterchange","stop$"]),e()}function to(){const e=()=>this.playbackRate();return this.$set(e,["ratechange"]),e()}function no(){const e=()=>this.isInPictureInPicture();return this.$set(e,[["enterpictureinpicture","leavepictureinpicture"]]),e()}function oo(){const e=()=>this.isFullscreen();return this.$set(e,["fullscreenchange"]),e()}function ao(){const e=()=>this.volume();return this.$set(e,["volumechange"]),e()}function so(){const e=()=>this.paused();return this.$set(e,["play","pause","loadstart","loadeddata","stop$"]),e()}function io(){const e=()=>this.muted();return this.$set(e,["mute$"]),e()}function ro(){console.log("PLAY",this.play,this.muted,this),this.play()}async function lo(){this.pause(),await yo((()=>this.paused()))}function co(e){this.poster(e)}function uo(e){this.currentTime(e)}function ho(e){this.playbackRate(e)}function po(e){try{e?this.requestPictureInPicture():this.exitPictureInPicture()}catch(t){console.log("Failed to toggle PiP",e,(null===t||void 0===t?void 0:t.message)||t)}}function mo(e){e?this.requestFullscreen():this.exitFullscreen()}function _o(e){fo.call(this,!1),this.volume(e)}function fo(e){this.muted(e),this.trigger("mute$")}async function go(){async function e(){this.reset(),await yo((()=>{const e=this.currentSources().filter((e=>!!e.src&&!!e.type));return e<=0}))}this.isInPictureInPicture()&&this.exitPictureInPicture(),await lo.call(this),await e.call(this),this.trigger("stop$")}function bo(){this.isInPictureInPicture()&&this.exitPictureInPicture(),this.reset(),this.dispose()}function yo(e,t=100){let n=null;return new Promise((o=>{n=setInterval((()=>{e.call(this)&&(clearInterval(n),n=null,o())}),t)}))}var vo=e=>{const t=e.reduce(((e,t)=>({...e,...t.states})),{}),n=Object.keys(t),o=Object.entries(t);return{data(){return{states:{}}},created(){this.$watch((()=>this.instance),(e=>{if(!this.instance)return void(this.states=n.map((e=>[e,null])).reduce(((e,[t,n])=>({...e,[t]:n})),{}));const t=o.map((([t,n])=>{const o=ko({player:e,states:wo.call(this),name:t});return[t,n.call(o)]})).reduce(((e,[t,n])=>({...e,[t]:n})),{});this.states=t}),{immediate:!0})}}};function wo(){const e=this;return new Proxy({},{get(t,n,o){return e.states[n]},set(t,n,o,a){return e.states=Object.assign({},e.states,{[n]:o}),!0}})}function ko({player:e,states:t,name:n}){return new Proxy(e,{get(o,a,s){return"$state"===a?t:"$set"===a?(o,a)=>{a?a.forEach((a=>e.on(a,(()=>t[n]=o(a))))):t[n]=o}:Reflect.get(o,a,s)}})}var Co=e=>{const t=e.reduce(((e,t)=>({...e,...t.controls})),{}),n=e=>function(...t){return this.instance?e.apply($o({player:this.instance,states:this.states}),t):null};return{methods:Object.entries(t).map((([e,t])=>[e,n(t)])).reduce(((e,[t,n])=>({...e,[t]:n})),{})}};function $o({player:e,states:t}){return new Proxy(e,{get(e,n,o){return"$state"===n?t:Reflect.get(e,n,o)}})}function So(e={controls:!1,autoplay:!1,preload:"auto",playbackRates:[.5,1,1.5,2]},t=zn){return new i["a"]({data(){let e,t=new Promise((t=>e=t));return t.resolve=e,{instance:null,promiseReady:t}},mixins:[vo(t),Co(t)],methods:{async initialize(t){if(this.instance)throw new Error("Failed to initialize player.");const n=Object(Fn["default"])(t,e);await new Promise((e=>n.one("ready",e))),this.instance=n,this.promiseReady.resolve()}}})}var xo={data(){return{}},methods:{createPlayer:So}},To=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player relative-position"},[n("video",{ref:"videoRef",staticClass:"video-js",attrs:{playsinline:"true","webkit-playsinline":"true",tabindex:"-1"}}),n("Controller",{attrs:{player:e.player},scopedSlots:e._u([{key:"header",fn:function(){return[e._t("header")]},proxy:!0},{key:"footer",fn:function(){return[e._t("footer")]},proxy:!0}],null,!0)})],1)},Io=[],Po=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ControllerLayout",{attrs:{player:e.player},on:{hotkey$focus:e.hotkey$focus},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.showController;return[n("Subtitle",{style:o?{paddingTop:"58px",paddingBottom:"60px"}:{},attrs:{player:e.player,dense:o}}),n("Center",{ref:"centerRef",attrs:{player:e.player}}),n("Header",{directives:[{name:"show",rawName:"v-show",value:o,expression:"showController"}],attrs:{player:e.player},scopedSlots:e._u([{key:"right",fn:function(){return[e._t("header"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{icon:"file_open",unelevated:"",round:"",size:"0.8rem"},on:{click:e.handleOpenLocalVideo}}),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!0,expression:"true"}],attrs:{icon:"settings",unelevated:"",round:"",size:"0.8rem"},on:{click:e.handleOpenSetting}}),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{icon:"more_vert",unelevated:"",round:"",size:"0.8rem"}})]},proxy:!0}],null,!0)}),n("Footer",{directives:[{name:"show",rawName:"v-show",value:o,expression:"showController"}],attrs:{player:e.player},scopedSlots:e._u([{key:"right",fn:function(){return[e._t("footer"),n("VolumeButton",{attrs:{player:e.player}}),n("PlaybackRateButton",{attrs:{player:e.player}}),n("SubtitleButton",{attrs:{player:e.player}}),n("PipButton",{attrs:{player:e.player}}),n("FullscreenButton",{attrs:{player:e.player}})]},proxy:!0}],null,!0)}),n("Setting",{ref:"settingRef",attrs:{player:e.player}})]}}])})},Oo=[],qo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"video-js-player__controller absolute-full relative-position",on:{click:e.onVideoClick,dblclick:e.onVideoDoubleClick}},e.mouseEvents),[e.isAudio?n("div",{staticClass:"is-audio-hint absolute-center"},[n("img",{staticClass:"q-mt-xl",attrs:{src:"developer/assets/icon-256.png",alt:""}}),n("p",{staticClass:"text-center text-h5",staticStyle:{"line-height":"24px"}},[n("i",{staticClass:"material-icons",staticStyle:{"vertical-align":"top"}},[e._v("audiotrack")]),e._v("\n "+e._s(e.$t("audio_file"))+"\n ")])]):e._e(),e._t("default",null,null,{showController:e.showController})],2)},Eo=[],Ao=n("4fd2"),Do={props:{player:Object},mixins:[No(),Lo()],computed:{isAudio(){var e,t,n;const o=null===(e=this.player)||void 0===e||null===(t=e.states)||void 0===t||null===(n=t.currentSources)||void 0===n?void 0:n[0];if(!o||!o.filename)return!1;const a=o.filename.replace(/\.downloading$/,"").match(/\.[^.]+?$/);if(!a||!a[0])return!1;const s=a[0].slice(1);return Object(Ao["b"])(s)}},methods:{onVideoClick(e){const t=e=>e.classList.contains("video-js-player__controller");if(!t(e.target))return;const{isPaused:n,loadingState:o,currentSources:a}=this.player.states;"object"!==typeof o&&a&&0!==a.length&&(n?this.player.play():this.player.pause())},onVideoDoubleClick(e){const t=e=>e.classList.contains("video-js-player__controller");t(e.target)&&this.player&&this.player.setFullscreen(!this.player.states.isFullscreen)}}};function No(){return{data(){return{toggle:!1,playerReady:!1}},created(){this.$watch((()=>{var e,t;return null!==(e=null===(t=this.player)||void 0===t?void 0:t.instance)&&void 0!==e?e:null}),(e=>{e&&e.ready((()=>this.playerReady=!0))}),{immediate:!0})},computed:{showController:{get(){return this.toggle&&this.playerReady},set(e){this.toggle=e}}}}}function Lo(){const e=e=>e.classList.contains("video-js-player__controller");let t=null;return{computed:{mouseEvents(){return{mouseover:o.bind(this),mousemove:a.bind(this),mouseenter:e=>n.call(this,e,!0),mouseleave:e=>n.call(this,e,!1)}}},watch:{showController(){this.$emit("hotkey$focus")}}};function n(e,t){if(t)this.showController=t;else{if(0!==e.which)return;this.showController=t}}function o(n){if(!e(n.target))return clearTimeout(t);t&&clearTimeout(t),t=setTimeout((()=>{this.showController=!1,t=null}),3e3)}function a(n){e(n.target)&&(this.showController=!0,t&&clearTimeout(t),t=setTimeout((()=>{this.showController=!1,t=null}),3e3))}}var jo=Do,Ro=(n("4dbc"),Object(g["a"])(jo,qo,Eo,!1,null,null,null)),Uo=Ro.exports,Fo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-full flex items-stretch no-pointer-events--children non-selectable"},[n("div",{staticClass:"full-width full-height flex items-stretch"},[n("div",{staticClass:"full-width full-height relative-position column justify-end items-center"},[n("div",{staticClass:"relative-position",style:{"min-height":e.subtitlePanelMinHeight+"px"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.trackEnabled&&!!e.currentText,expression:"trackEnabled && !!currentText"}],staticClass:"video-js-player__subtitle",class:[e.player.states.isFullscreen?"fullscreen-subtitle":""]},[e._v("\n "+e._s(e.currentText)+"\n ")])])])])])},Mo=[],Bo={mixins:[Qo()],props:{player:Object,dense:Boolean},computed:{trackEnabled(){var e,t;return null!==(e=null===(t=this.player.states.track)||void 0===t?void 0:t.enable)&&void 0!==e&&e},currentText(){var e,t;return null===(e=this.player.states.track)||void 0===e||null===(t=e.currentTrack)||void 0===t?void 0:t.text},subtitlePanelMinHeight(){var e,t,n,o;const a=null!==(e=null===(t=this.player$rects)||void 0===t?void 0:t.container.height)&&void 0!==e?e:0,s=null!==(n=null===(o=this.player$rects)||void 0===o?void 0:o.video.height)&&void 0!==n?n:0;return Math.max(0,Math.round((a-s)/2))}}};function Qo(){let e;return{data(){return{player$rects:{container:{},video:{}}}},mounted(){const t=this.$el;e&&e.disconnect(),e=new ResizeObserver((()=>n.call(this,t))),e.observe(t,{}),setTimeout((()=>n.call(this,t)),200)},beforeDestroy(){e&&e.disconnect()}};function t(e){return e&&e.endsWith("px")?parseInt(e.slice(0,e.length-2)):0}function n(e){const n=e.querySelector("div"),o=e.parentElement.parentElement.querySelector(".video-js>video"),a=getComputedStyle(n),s=getComputedStyle(o);this.player$rects.container.width=t(a.width),this.player$rects.container.height=t(a.height),this.player$rects.video.width=t(s.width),this.player$rects.video.height=t(s.height),this.player$rects=Object.assign({},this.player$rects)}}var Wo=Bo,zo=(n("d2e8"),Object(g["a"])(Wo,Fo,Mo,!1,null,null,null)),Ho=zo.exports;k()(zo,"components",{QItem:Pe["a"]});var Vo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-center"},[e.dialogData?n("DialogPanel",{attrs:{icon:e.dialogData.icon,message:e.dialogData.message}}):e.playerError?n("ErrorPanel",{attrs:{player:e.player}}):e.playerLoading?n("LoadingPanel",{attrs:{player:e.player}}):e.emptySource?n("OpenButton",{attrs:{player:e.player}}):e.player.states.isPaused?n("PlayButton",{attrs:{player:e.player}}):e._e()],1)},Go=[],Ko=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CenterPanel",{scopedSlots:e._u([e.icon?{key:"avatar",fn:function(){return[n("q-icon",{staticStyle:{opacity:"0.8"},attrs:{size:"2.4rem",name:e.icon}})]},proxy:!0}:null,{key:"default",fn:function(){return[n("div",{staticClass:"ellipsis-2-lines text-bold",staticStyle:{"font-size":"1rem","min-width":"100px",opacity:"0.8"}},[e._v("\n "+e._s(e.message)+"\n ")]),e.caption?n("div",{staticClass:"ellipsis-3-lines",staticStyle:{opacity:"0.8"}},[e._v("\n "+e._s(e.caption)+"\n ")]):e._e()]},proxy:!0}],null,!0)})},Yo=[],Jo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"controller:panel overflow-hidden",staticStyle:{"border-radius":"16px"}},[n("q-card-section",{staticClass:"text-center q-pa-md"},[e.$slots.avatar?n("div",{staticClass:"q-ma-sm"},[e._t("avatar")],2):e._e(),n("div",{staticClass:"q-ma-sm"},[e._t("default")],2),e.$slots.action?n("div",{staticClass:"q-mb-xs"},[e._t("action")],2):e._e()])],1)},Xo=[],Zo={},ea=Zo,ta=(n("9992"),Object(g["a"])(ea,Jo,Xo,!1,null,"18dfdf92",null)),na=ta.exports;k()(ta,"components",{QCard:v["a"],QCardSection:ie["a"]});var oa={components:{CenterPanel:na},name:"DialogPanel",props:{icon:String,message:String,caption:String,handleOk:Function}},aa=oa,sa=Object(g["a"])(aa,Ko,Yo,!1,null,null,null),ia=sa.exports;k()(sa,"components",{QIcon:Y["a"],QBtn:le["a"]});var ra=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CenterPanel",{staticClass:"non-selectable",staticStyle:{"max-height":"200px","max-width":"600px"},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("q-icon",{staticStyle:{opacity:"0.8"},attrs:{size:"2.4rem",name:"error"}})]},proxy:!0},{key:"default",fn:function(){return[n("div",{staticClass:"ellipsis-2-lines text-bold",staticStyle:{"font-size":"1rem","min-width":"100px",opacity:"0.8"}},[e._v("\n "+e._s(e.playerError.type)+"\n ")]),n("div",{staticClass:"ellipsis-3-lines",staticStyle:{opacity:"0.8"}},[e._v("\n "+e._s(e.playerError.message)+"\n ")])]},proxy:!0},{key:"action",fn:function(){return[n("q-btn",{staticClass:"q-mt-sm",staticStyle:{"min-width":"64px","background-color":"rgba(256,256,256,0.1)"},attrs:{label:e.$t("ok"),"no-caps":"",flat:"",rounded:""},on:{click:e.handleOk}})]},proxy:!0}])})},la=[],ca={components:{CenterPanel:na},props:{player:Object},computed:{playerError(){var e,t;const n=this.player.states.loadingState;if(!n||"boolean"===typeof n)return null;const o=null===(e=this.player)||void 0===e||null===(t=e.instance)||void 0===t?void 0:t.languages_,a=this.$i18n.locale.toLowerCase(),s=e=>o&&o[a]&&o[a][e]||e;return{type:s(n.type),message:s(n.message)}}},methods:{async handleOk(){await this.player.stop()}}},da=ca,ua=Object(g["a"])(da,ra,la,!1,null,"90e33b2e",null),ha=ua.exports;k()(ua,"components",{QIcon:Y["a"],QBtn:le["a"]});var pa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CenterPanel",{staticClass:"non-selectable",staticStyle:{"max-height":"180px"},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("q-spinner-ios",{staticStyle:{opacity:"0.8"},attrs:{size:"2.4rem"}})]},proxy:!0},{key:"default",fn:function(){return[n("div",{staticClass:"ellipsis-2-lines",staticStyle:{"min-width":"100px",opacity:"0.8"}},[e._v("\n "+e._s(e.$t("loading"))+"\n "),e.isRemotePlay?n("span",[e._v("("+e._s(e.remoteProgress)+")")]):n("span",[e._v("...")])]),e.isRemotePlay?n("div",{staticClass:"remote-status"},[e._v("\n "+e._s(e.remoteDownloaded)+" ( "+e._s(e.remoteDownloadSpeed)+" )\n ")]):e._e()]},proxy:!0}])})},ma=[],_a=n("84f6"),fa=n("6422"),ga={components:{CenterPanel:na},props:{player:Object},computed:{remoteInfoHash(){var e;return null===(e=S["a"].state.video.currentVideo)||void 0===e?void 0:e.infoHash},isRemotePlay(){return!!this.remoteInfoHash&&S["a"].state.video.currentVideo.remotePlay},remoteTask(){return this.isRemotePlay?_a["a"].taskList.downloading.find((e=>e.infoHash===this.remoteInfoHash)):null},remoteProgress(){return this.isRemotePlay&&this.remoteTask?Object(fa["g"])(this.remoteTask.progress):""},remoteDownloadSpeed(){return this.isRemotePlay&&this.remoteTask?Object(fa["a"])(this.remoteTask.downloadSpeed,{byte:!1,gb:!1,fix:1})+"/s":""},remoteDownloaded(){return this.isRemotePlay&&this.remoteTask?Object(fa["a"])(this.remoteTask.downloaded,{byte:!1}):""}}},ba=ga,ya=Object(g["a"])(ba,pa,ma,!1,null,"0ff02c0c",null),va=ya.exports;k()(ya,"components",{QSpinnerIos:nt["a"]});var wa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn",{staticClass:"text-white controller:panel",attrs:{size:"2rem",icon:"file_open",unelevated:"",round:""},on:{click:e.openFile}}),n("input",{staticStyle:{display:"none"},attrs:{type:"file","data-cy":"file-input"},on:{input:e.loadVideo}})],1)},ka=[];function Ca({accept:e}){const t=document.createElement("input");return Object.assign(t.style,{position:"fixed",top:"0",left:"0",width:"0",height:"0"}),t.type="file",t.accept=Array.isArray(e)?e.join(","):e,t}function $a(e){return e?new Promise((t=>{const n=new FileReader;n.onload=e=>{var n,o;return t(null!==(n=null===(o=e.target)||void 0===o?void 0:o.result)&&void 0!==n?n:"")},n.readAsText(e)})):""}async function Sa(e){const t=document.activeElement;try{document.body.appendChild(e),e.focus(),e.click()}finally{document.body.removeChild(e),t.focus()}const n=await o(e);return console.log("result"),console.tag("file").debug("result",n),n||null;async function o(e){var t,n;const o=await new Promise((t=>e.addEventListener("change",t,{once:!0}))),a=null===o||void 0===o||null===(t=o.target)||void 0===t||null===(n=t.files)||void 0===n?void 0:n[0];return console.tag("file").debug("change",a),e.value=null,a}}function xa(){return{readTextFile:$a,async selectFile({accept:e}={}){const t=Ca({accept:null!==e&&void 0!==e?e:"*"});return Sa(t)}}}var Ta=Ia;function Ia(){const{selectFile:e}=xa(),t={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m3u8:"application/x-mpegURL",mpd:"application/dash+xml"};return async()=>{console.log("selectFile");const n=await e({accept:Array.from(new Set([...Object.values(t),...Object.keys(t).map((e=>`.${e}`))]))});return console.log("file",n),n?{src:URL.createObjectURL(n),type:n.type,file:n}:null}}const Pa=Ta();var Oa={props:{player:Object},methods:{async openFile(){console.log("Open file");const e=await Pa();if(console.log("select local source",e),!e)return;await this.player.setSource(e);const{currentSources:t,loadingState:n}=this.player.states;console.log("Dispatch remotePlay reset"),S["a"].dispatch("resetRemotePlay"),!t||t.length<=0||n||(this.player.ctl$emit("openFile"),this.player.play())},async loadVideo(e){if(console.log("Load video",e),e.target.files[0]){const t={src:URL.createObjectURL(e.target.files[0]),type:e.target.files[0].type,file:e.target.files[0]};console.log("Source",t),await this.player.setSource(t);const{currentSources:n,loadingState:o}=this.player.states;if(console.log(this.player.states),!n||n.length<=0)return;if(o)return;this.player.play()}}}},qa=Oa,Ea=Object(g["a"])(qa,wa,ka,!1,null,"4dd2a6d6",null),Aa=Ea.exports;k()(Ea,"components",{QBtn:le["a"]});var Da=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{staticClass:"text-white controller:panel",attrs:{ripple:!1,size:"2rem",icon:e.icon,disable:e.disable,unelevated:"",round:""},on:{click:e.handlePlay}})},Na=[],La={props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t},icon(){return this.player.states.isPaused?"play_arrow":"pause"}},methods:{handlePlay(){this.player.states.isPaused?this.player.play():this.player.pause()}}},ja=La,Ra=Object(g["a"])(ja,Da,Na,!1,null,"0e8525b1",null),Ua=Ra.exports;k()(Ra,"components",{QBtn:le["a"]});var Fa={mixins:[Ma()],components:{DialogPanel:ia,ErrorPanel:ha,LoadingPanel:va,OpenButton:Aa,PlayButton:Ua},data(){return{interval:null}},props:{player:Object},computed:{playerError(){const e=this.player.states.loadingState;return e&&"boolean"!==typeof e?e:null},playerLoading(){const{loadingState:e,isWaiting:t}=this.player.states;return!0===e||!!t},emptySource(){const e=this.player.states.currentSources;return!e||e.length<=0}},mounted(){clearInterval(this.interval)},beforeDestroy(){clearInterval(this.interval)}};function Ma(){let e=null;function t(){e&&clearTimeout(e),e=null,this.dialog$data.icon=null,this.dialog$data.message=null}return{data(){return{dialog$data:{icon:null,message:null}}},computed:{dialogData(){const{icon:e,message:t}=this.dialog$data;if(!t)return null;const n={};return n.icon=e,n.message=t,n}},methods:{createDialog({icon:n,message:o,timeout:a}){return e&&clearTimeout(e),e=null,this.dialog$data.icon=n,this.dialog$data.message=o,a&&(e=setTimeout(t.bind(this),a)),t.bind(this)}}}}var Ba=Fa,Qa=Object(g["a"])(Ba,Vo,Go,!1,null,null,null),Wa=Qa.exports,za=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-top relative-position",staticStyle:{"min-height":"56px"}},[n("div",{staticClass:"controller-top absolute-full overflow-hidden"}),n("div",{staticClass:"relative-position flex no-wrap items-center text-white q-px-md q-pb-sm non-selectable",staticStyle:{"z-index":"1","padding-top":"10px"}},[e.info?[n("q-icon",{staticClass:"q-ml-sm q-mr-sm",attrs:{name:"movie",size:"1.5rem"}}),n("div",{staticClass:"q-my-xs q-mx-sm col-shrink"},[n("div",{staticClass:"text-bold",staticStyle:{"font-size":"0.9rem","line-height":"1.2"}},[e._v(e._s(e.info.title))]),e.info.caption?n("div",{staticClass:"ellipsis",staticStyle:{"max-width":"200px",opacity:"0.6","font-size":"0.7rem","line-height":"1"}},[e._v(e._s(e.info.caption)+"\n ")]):e._e()])]:e._e(),n("q-space"),e._t("right")],2)])},Ha=[],Va={props:{player:Object},computed:{info(){var e,t;const n=null!==(e=null===(t=this.player.states.currentSources)||void 0===t?void 0:t[0])&&void 0!==e?e:null;if(!n)return null;if(n.filename){const e=n.filename.replace(/\\/g,"/").split("/").reverse()[0];return{title:e.slice(0,e.lastIndexOf(".")),caption:n.filename}}return n.file?{title:n.file.name.slice(0,n.file.name.lastIndexOf(".")),caption:n.file.path}:{title:this.$t("unknown_media"),caption:n.src}}}},Ga=Va,Ka=Object(g["a"])(Ga,za,Ha,!1,null,"2ead7b1a",null),Ya=Ka.exports;k()(Ka,"components",{QIcon:Y["a"],QSpace:re["a"]});var Ja=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-bottom relative-position"},[n("div",{staticClass:"controller-bottom full-height full-width absolute-top-left overflow-hidden"}),n("div",{staticClass:"relative-position flex items-center text-white q-px-md q-pb-sm non-selectable no-wrap",staticStyle:{"padding-top":"12px"}},[n("PlayButton",{attrs:{player:e.player}}),n("StopButton",{attrs:{player:e.player}}),n("div",{staticClass:"q-mx-sm q-my-sm text-bold ellipsis",style:{opacity:e.disable?.7:1}},[e._v(e._s(e.timeLabel))]),n("q-space"),e._t("right")],2),n("ProgressBar",{attrs:{player:e.player}})],1)},Xa=[],Za=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player__progress-bar absolute-top q-px-md no-pointer-events",class:e.disable?["video-js-player__progress-bar-disable"]:[]},[n("q-slider",{staticClass:"video-js-player__progress-bar-slider all-pointer-events",attrs:{"disable-keydown":"",min:0,max:1e3*e.duration,"track-color":"transparent","thumb-color":"primary","thumb-size":"12px",dark:"",label:"",dense:"","label-value":e.progressLabel,disable:e.disable},nativeOn:{click:function(t){return e.onClick.apply(null,arguments)}},model:{value:e.progress,callback:function(t){e.progress=t},expression:"progress"}}),e._m(0),e._l(e.player.states.buffered,(function(t,o){var a=t[0],s=t[1];return n("div",{key:o,staticClass:"video-js-player__progress-bar-buffered absolute-top q-px-md"},[n("BufferProgress",{staticStyle:{opacity:"1"},attrs:{start:a/e.player.states.duration||0,end:s/e.player.states.duration||0}})],1)}))],2)},es=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player__progress-bar-buffered absolute-top q-px-md"},[n("div",{staticClass:"video-js-player__progress-bar-buffered-bg"})])}];function ts(){const e=e=>{const t=e-Math.floor(e),n=e-t,o=Math.floor(n/3600),a=Math.floor((n-60*o*60)/60),s=n-(60*o*60+60*a);return(o?[o,a,s]:[a,s]).map((e=>(""+e).padStart(2,"0"))).join(":")};let t=0;return{computed:{progress:{get(){return 1e3*this.player.states.currentTime},set(e){this.player.seek(e/1e3)}},animationSpeed(){const e=Math.abs(this.progress-t);return t=this.progress,e>300?0:e},duration(){return this.player.states.duration},progressLabel(){return e(this.progress/1e3)},durationLabel(){return e(this.duration)}}}}var ns=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player__buffer-progress relative-position full-width"},[n("div",{staticClass:"absolute full-height",staticStyle:{"border-radius":"4px"},style:{width:100*(e.end-e.start)+"%",left:100*e.start+"%"}})])},os=[],as={props:{start:Number,end:Number}},ss=as,is=(n("d1e4"),Object(g["a"])(ss,ns,os,!1,null,"4e25daec",null)),rs=is.exports,ls={mixins:[ts()],components:{BufferProgress:rs},props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t}},methods:{onClick(){console.log("[Ctrl] onProgressBarClick"),this.$emit("click"),setTimeout((()=>{this.$el.blur(),document.body.click(),console.log("[Ctrl] Blur")}),200)}}},cs=ls,ds=(n("84cb"),n("f9b5")),us=Object(g["a"])(cs,Za,es,!1,null,null,null),hs=us.exports;k()(us,"components",{QSlider:ds["a"]});var ps=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:e.icon,unelevated:"",round:"",disable:e.disable},on:{click:e.handlePlay}})},ms=[],_s={props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t},icon(){return this.player.states.isPaused?"play_arrow":"pause"}},methods:{handlePlay(){this.player.states.isPaused?this.player.play():this.player.pause()}}},fs=_s,gs=Object(g["a"])(fs,ps,ms,!1,null,null,null),bs=gs.exports;k()(gs,"components",{QBtn:le["a"]});var ys=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:"stop",unelevated:"",round:"",disable:e.disable},on:{click:e.handleStop}})},vs=[],ws={props:{player:Object},computed:{disable(){const{currentSources:e}=this.player.states;return!e||e.length<=0}},methods:{async handleStop(){this.player.states.isPiP&&this.player.setPiP(!1),this.player.states.isFullscreen&&this.player.setFullscreen(!1),S["a"].dispatch("resetRemotePlay"),await this.player.stop()}}},ks=ws,Cs=Object(g["a"])(ks,ys,vs,!1,null,null,null),$s=Cs.exports;k()(Cs,"components",{QBtn:le["a"]});var Ss={mixins:[ts()],components:{PlayButton:bs,StopButton:$s,ProgressBar:hs},props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t},timeLabel(){const e=e=>{const t=Math.round(e),n=Math.floor(t/3600),o=Math.floor((t-60*n*60)/60),a=t-(60*n*60+60*o);return(n?[n,o,a]:[o,a]).map((e=>(""+e).padStart(2,"0"))).join(":")};return`${e(this.player.states.currentTime)} / ${e(this.player.states.duration)}`}}},xs=Ss,Ts=n("526f"),Is=Object(g["a"])(xs,Ja,Xa,!1,null,null,null),Ps=Is.exports;k()(Is,"components",{QLinearProgress:Ts["a"],QSpace:re["a"]});var Os=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ControllerPage",{attrs:{title:e.$t("settings"),icon:"settings"},model:{value:e.showSetting,callback:function(t){e.showSetting=t},expression:"showSetting"}},[n("q-list",{staticClass:"video-js-player__setting-list",attrs:{dark:"",bordered:"",separator:""}},[n("q-item-label",{staticClass:"q-mx-md q-mt-md",staticStyle:{"font-size":"1.1rem"}},[e._v(e._s(e.$t("settings_subtitle_options")))]),n("SubtitleOptions")],1)],1)},qs=[],Es=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.value?n("div",{staticClass:"non-selectable absolute-full video-js-player__page",staticStyle:{"z-index":"1000"}},[n("div",{staticClass:"bg-transparent full-width"},[n("q-toolbar",{staticStyle:{height:"56px"}},[e.icon?n("q-icon",{staticClass:"q-ml-sm",attrs:{name:e.icon,size:"1.5rem"}}):e._e(),n("q-toolbar-title",{staticClass:"text-bold",staticStyle:{"font-size":"1rem","line-height":"1.2"}},[e._v(e._s(e.title))]),n("q-space"),n("q-btn",{attrs:{flat:"",round:"",icon:"close"},on:{click:function(){return e.$emit("input",!1)}}})],1),n("q-separator",{staticStyle:{"background-color":"rgba(256,256,256,0.2)"},attrs:{size:"0.8px"}})],1),n("q-page",{attrs:{padding:""}},[e._t("default")],2)],1):e._e()},As=[],Ds={props:{icon:String,title:String,value:Boolean}},Ns=Ds,Ls=(n("5a2f"),n("99c4")),js=n("75a3"),Rs=n("9b72"),Us=Object(g["a"])(Ns,Es,As,!1,null,null,null),Fs=Us.exports;k()(Us,"components",{QToolbar:Ls["a"],QIcon:Y["a"],QToolbarTitle:js["a"],QSpace:re["a"],QBtn:le["a"],QSeparator:ce["a"],QPage:Rs["a"]});var Ms=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-item",{staticClass:"overflow-hidden"},[n("q-item-section",{attrs:{side:""}},[n("div",{staticClass:"column",staticStyle:{"align-items":"stretch",gap:"8px"}},[n("q-btn-toggle",{staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.fontSizeOptions,"toggle-color":"primary"},model:{value:e.fontSize,callback:function(t){e.fontSize=t},expression:"fontSize"}}),n("q-btn-toggle",{staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.fontStyleOptions,"toggle-color":"primary"},model:{value:e.fontStyle,callback:function(t){e.fontStyle=t},expression:"fontStyle"}}),n("q-btn-toggle",{staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.fontWeightOptions,"toggle-color":"primary"},model:{value:e.fontWeight,callback:function(t){e.fontWeight=t},expression:"fontWeight"}})],1)]),n("q-item-section",{staticClass:"bg-grey-9 flex justify-center items-center overflow-hidden relative-position",staticStyle:{padding:"8px","border-radius":"8px"}},[n("div",{staticClass:"absolute-top-right"},[n("q-btn-toggle",{staticClass:"q-ma-xs lorem-ipsum",staticStyle:{"background-color":"rgba(50, 50, 50, 0.6)","border-radius":"4px"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.loremIpsumOptions,"toggle-color":"primary"},model:{value:e.loremIpsumType,callback:function(t){e.loremIpsumType=t},expression:"loremIpsumType"}})],1),n("div",{staticClass:"video-js-player__subtitle ellipsis overflow-hidden col-shrink"},[e._v(e._s(e.loremIpsum))])])],1)},Bs=[],Qs={mixins:[Ws()],name:"SubtitleOptions",inject:["player$settings"],computed:{fontSize:{get(){return this.player$settings.subtitle.size},set(e){this.player$settings.subtitle.size=e}},fontStyle:{get(){return this.player$settings.subtitle.style},set(e){this.player$settings.subtitle.style=e}},fontWeight:{get(){return this.player$settings.subtitle.weight},set(e){this.player$settings.subtitle.weight=e}},fontSizeOptions(){return[{label:this.$t("settings_small"),value:1},{label:this.$t("settings_normal"),value:1.25},{label:this.$t("settings_large"),value:1.7}]},fontStyleOptions(){return[{label:this.$t("settings_normal"),value:"normal"},{label:this.$t("settings_italic"),value:"italic"}]},fontWeightOptions(){return[{label:this.$t("settings_lighter"),value:"lighter"},{label:this.$t("settings_normal"),value:"normal"},{label:this.$t("settings_bolder"),value:"bold"}]}}};function Ws(){const e={EN:"Lorem ipsum dolor sit amet, consectetur adipisicing elit.","简":"朝菌不知晦朔,蟪蛄不知春秋。","繁":"天地不仁,以萬物為芻狗。 聖人不仁,以百姓為芻狗。"};return{data(){return{loremIpsumType:"EN"}},computed:{loremIpsum(){var t;return null!==(t=e[this.loremIpsumType])&&void 0!==t?t:e.EN},loremIpsumOptions(){return Object.keys(e).map((e=>({label:e,value:e})))}}}}var zs=Qs,Hs=(n("3061"),n("834d")),Vs=n("96d7"),Gs=Object(g["a"])(zs,Ms,Bs,!1,null,null,null),Ks=Gs.exports;k()(Gs,"components",{QItem:Pe["a"],QItemSection:Oe["a"],QBtnToggle:Hs["a"],QBtnGroup:Vs["a"],QBtn:le["a"]});var Ys={components:{ControllerPage:Fs,SubtitleOptions:Ks},props:{player:Object},data(){return{dev:!1,showSetting:!1}},methods:{show(){this.showSetting=!0}}},Js=Ys,Xs=(n("071f"),Object(g["a"])(Js,Os,qs,!1,null,null,null)),Zs=Xs.exports;k()(Xs,"components",{QList:_t["a"],QItemLabel:qe["a"],QItem:Pe["a"]});var ei=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"relative-position column items-center"},e.mouseEvents),[n("q-btn",{attrs:{size:"0.8rem",icon:e.icon,unelevated:"",round:""},on:{click:e.handleMute}}),n("transition",{attrs:{name:"q-transition--scale"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showVolumeCard,expression:"showVolumeCard"}],staticClass:"video-js-player__controller-menu controller-popup__transition absolute",staticStyle:{bottom:"44px !important","z-index":"10"}},[n("q-card",{staticClass:"controller-popup",staticStyle:{"border-radius":"12px",height:"140px",padding:"6px!important"}},[n("div",{staticClass:"absolute-bottom q-mb-md text-center text-bold"},[e._v(e._s(e.volume))]),n("q-slider",{staticClass:"video-js-player__volume-slider",staticStyle:{height:"100%"},attrs:{vertical:"",reverse:"","track-size":"40px","thumb-size":"0","track-color":"transparent",min:0,max:100,step:10},model:{value:e.volume,callback:function(t){e.volume=t},expression:"volume"}})],1)],1)])],1)},ti=[];function ni(e,t){return{computed:{mouseEvents(){let n=null;const o=o=>{n&&clearTimeout(n),n=setTimeout((()=>{this[e]=o,n=null}),t)},a=e=>e.classList.contains("video-js-player__controller"),s=(t,n)=>{if(n)this[e]=n;else{if(0!==t.which)return;o(n)}},i=e=>{if(!a(e.target))return clearTimeout(n);o(!1)},r=t=>{if(!a(t.target))return clearTimeout(n);this[e]=!0,o(!1)};return{mouseover:e=>i.call(this,e),mousemove:e=>r.call(this,e),mouseenter:e=>s.call(this,e,!0),mouseleave:e=>s.call(this,e,!1)}}}}}var oi={mixins:[ni("showVolumeCard",100)],props:{player:Object},data(){return{showVolumeCard:!1}},computed:{volume:{get(){return this.player.states.isMuted?0:Math.round(100*this.player.states.volume)},set(e){this.player.setVolume(e/100)}},icon(){return this.player.states.isMuted?"volume_off":"volume_up"}},methods:{handleMute(){this.player.mute(!this.player.states.isMuted)}}},ai=oi,si=(n("f77d"),n("85c4")),ii=Object(g["a"])(ai,ei,ti,!1,null,null,null),ri=ii.exports;k()(ii,"components",{QBtn:le["a"],QTr:si["a"],QCard:v["a"],QSlider:ds["a"]});var li=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"relative-position column items-center"},e.mouseEvents),[n("q-btn",{attrs:{size:"0.8rem",unelevated:"",round:"",icon:"speed"},on:{click:function(t){e.showPlaybackRateCard=!e.showPlaybackRateCard}}}),n("transition",{attrs:{name:"q-transition--scale"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showPlaybackRateCard,expression:"showPlaybackRateCard"}],staticClass:"controller-popup__transition video-js-player__controller-menu absolute",staticStyle:{bottom:"44px !important","z-index":"10"}},[n("q-card",{staticClass:"controller-popup",staticStyle:{"border-radius":"12px",padding:"6px!important"},attrs:{dark:""}},[n("q-btn-toggle",{staticClass:"column video-js-player__controller-btn-toggle",attrs:{"toggle-color":"active",ripple:!1,options:e.playbackRates},model:{value:e.playbackRate,callback:function(t){e.playbackRate=t},expression:"playbackRate"}})],1)],1)])],1)},ci=[],di={mixins:[ni("showPlaybackRateCard",100)],props:{player:Object},data(){return{showPlaybackRateCard:!1}},computed:{playbackRate:{get(){var e;return null!==(e=this.player.states.playbackRate)&&void 0!==e?e:1},set(e){this.player.setPlaybackRate(e)}},playbackRates(){return[{label:"X2.0",value:2},{label:"X1.5",value:1.5},{label:"X1.0",value:1},{label:"X0.5",value:.5}]},playbackRateLabel(){return this.playbackRates.find((e=>e.value===this.playbackRate)).label}}},ui=di,hi=(n("5e87"),Object(g["a"])(ui,li,ci,!1,null,null,null)),pi=hi.exports;k()(hi,"components",{QBtn:le["a"],QTr:si["a"],QCard:v["a"],QBtnToggle:Hs["a"]});var mi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"relative-position column items-center"},e.mouseEvents),[n("q-btn",{attrs:{disable:e.disableShowSubtitleCard,size:"0.8rem",unelevated:"",round:"",icon:e.trackEnabled?"subtitles":"subtitles_off"},on:{click:function(){return e.showSubtitleCard=!e.showSubtitleCard}}}),n("transition",{attrs:{name:"q-transition--scale"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showSubtitleCard,expression:"showSubtitleCard"}],staticClass:"controller-popup__transition video-js-player__controller-menu absolute",staticStyle:{bottom:"44px !important","z-index":"10"}},[n("q-card",{staticClass:"controller-popup",staticStyle:{"min-width":"200px","border-radius":"12px",padding:"6px!important"},attrs:{dark:""}},[n("div",{staticClass:"row items-center justify-start no-wrap"},[n("div",{staticClass:"text-bold q-ml-sm q-mr-xs ellipsis",staticStyle:{"font-size":"0.8rem",transform:"translateY(0.1rem)"}},[e._v("\n "+e._s(e.$t("subtitle"))+"\n ")]),n("q-space"),n("div",{staticClass:"q-mr-xs overflow-hidden row items-stretch no-wrap",staticStyle:{"background-color":"rgba(256,256,256,0.1)","border-radius":"999px"}},[n("q-btn",{staticStyle:{"min-height":"3em","min-width":"3em","border-radius":"0"},attrs:{icon:"fast_rewind",unelevated:"",size:"0.6rem",padding:"0 6px 0 10px"},on:{click:function(){return e.handleTrackOffset(!1)}}}),n("q-btn",{staticStyle:{"min-height":"3em","min-width":"3em","border-radius":"0"},attrs:{icon:"fast_forward",unelevated:"",size:"0.6rem",padding:"0 10px 0 6px"},on:{click:function(){return e.handleTrackOffset(!0)}}})],1),n("q-btn",{staticClass:"q-mr-xs",style:{backgroundColor:e.trackEnabled?"var(--q-color-primary)":"rgba(256,256,256,0.1)"},attrs:{icon:e.trackEnabled?"subtitles":"subtitles_off",round:"",unelevated:"",size:"0.6rem"},on:{click:function(){return(e.trackEnabled?e.handleDisableTrack:e.handleEnableTrack)()}}}),n("q-btn",{staticClass:"q-mr-xs",staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{icon:"add",round:"",unelevated:"",size:"0.6rem"},on:{click:e.handleAddTrack}})],1),e.tracksLoaded&&e.tracksLoaded.length?n("q-list",{staticClass:"q-mt-xs video-js-player__controller-list",staticStyle:{"min-width":"180px","max-width":"200px","font-size":"0.8rem","max-height":"240px","overflow-y":"auto"}},e._l(e.tracksLoaded,(function(t){return n("q-item",{key:t.id,staticStyle:{"padding-right":"0"},attrs:{dense:"",clickable:"",disable:!e.trackEnabled},on:{click:function(){return!t.active&&e.handleEnableTrack(t.id)}}},[n("q-item-section",{staticClass:"q-pr-sm",staticStyle:{"min-width":"24px"},attrs:{avatar:""}},[n("q-badge",{attrs:{rounded:"",color:t.active?e.trackEnabled?"primary":"grey":"transparent"}})],1),n("q-item-section",[n("q-item-label",{staticClass:"ellipsis"},[e._v(e._s(t.label))])],1),n("q-item-section",{staticStyle:{color:"inherit","padding-left":"4px"},attrs:{side:""}},[n("q-btn",{staticClass:"q-mr-xs",attrs:{icon:"clear",round:"",unelevated:"",size:"0.6rem",disable:!e.trackEnabled},on:{click:function(n){return e.handleRemoveTrack(t.id)}}})],1)],1)})),1):e._e()],1)],1)])],1)},_i=[],fi=gi;function gi(){const{selectFile:e,readTextFile:t}=xa(),n={vtt:"text/vtt",srt:"text/srt"};return async()=>{const o=await e({accept:Array.from(new Set([...Object.values(n),...Object.keys(n).map((e=>`.${e}`))]))});if(!o)return null;let a=await t(o);return a?(o.name.endsWith(".srt")&&(a=bi(a)),{src:URL.createObjectURL(new Blob([a])),id:o.name}):null}}function bi(e){var t=e.replace(/\r+/g,"");t=t.replace(/^\s+|\s+$/g,"");var n=t.split("\n\n"),o="";if(n.length>0){o+="WEBVTT\n\n";for(var a=0;a3){for(var o=3;o\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);return s?(t+=s[1]+":"+s[2]+":"+s[3]+"."+s[4]+" --\x3e "+s[5]+":"+s[6]+":"+s[7]+"."+s[8]+"\n",a+=1,n[a]&&(t+=n[a]+"\n\n"),t):""}}const yi=fi();var vi={mixins:[ni("showSubtitleCard",100)],props:{player:Object},data(){return{showSubtitleCard$inner:!1}},computed:{disableShowSubtitleCard(){const{currentSources:e}=this.player.states;return!e||e.length<=0},showSubtitleCard:{get(){return this.showSubtitleCard$inner&&!this.disableShowSubtitleCard},set(e){this.showSubtitleCard$inner=e}},trackEnabled(){var e,t;return null!==(e=null===(t=this.player.states.track)||void 0===t?void 0:t.enable)&&void 0!==e&&e},tracksLoaded(){var e,t,n;const o=this.player.states.track;if(!o)return[];const a=null!==(e=o.tracks)&&void 0!==e?e:[],s=null!==(t=null===(n=o.currentTrack)||void 0===n?void 0:n.id)&&void 0!==t?t:null;return a.map((e=>({id:e,label:e,active:e===s})))}},methods:{async handleAddTrack(){const e=await yi();e&&(this.player.addTrack(e),this.player.enableTrack(e.id))},async handleRemoveTrack(e){console.log("Remove track",e),this.player.removeTrack(e)},handleEnableTrack(e=null){const t=this.player.states.track;t&&this.player.enableTrack(e)},handleDisableTrack(){const e=this.player.states.track;e&&e.enable&&this.player.disableTrack()},handleTrackOffset(e){this.player.setTrackOffset(this.player.states.track.offset+(e?.5:-.5))}}},wi=vi,ki=(n("cc0c"),n("90c4")),Ci=Object(g["a"])(wi,mi,_i,!1,null,null,null),$i=Ci.exports;k()(Ci,"components",{QBtn:le["a"],QTr:si["a"],QCard:v["a"],QSpace:re["a"],QColor:X["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QBadge:ki["a"],QItemLabel:qe["a"]});var Si=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:"picture_in_picture_alt",unelevated:"",round:"",disable:e.disable},on:{click:e.handler}})},xi=[],Ti={props:{player:Object},computed:{disable(){const{currentSources:e}=this.player.states;return!e||e.length<=0}},methods:{handler(){this.player.setPiP(!this.player.states.isPiP)}}},Ii=Ti,Pi=Object(g["a"])(Ii,Si,xi,!1,null,null,null),Oi=Pi.exports;k()(Pi,"components",{QBtn:le["a"]});var qi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:e.icon,unelevated:"",round:""},on:{click:e.handler}})},Ei=[],Ai={props:{player:Object},computed:{icon(){return this.player.states.isFullscreen?"fullscreen_exit":"fullscreen"}},methods:{handler(){this.player.setFullscreen(!this.player.states.isFullscreen)}}},Di=Ai,Ni=Object(g["a"])(Di,qi,Ei,!1,null,null,null),Li=Ni.exports;k()(Ni,"components",{QBtn:le["a"]});const ji=e=>{const t=e-Math.floor(e),n=e-t,o=Math.floor(n/3600),a=Math.floor((n-60*o*60)/60),s=n-(60*o*60+60*a);return(o?[o,a,s]:[a,s]).map((e=>(""+e).padStart(2,"0"))).join(":")};var Ri=()=>{const e=5,t=.1;return{mixins:[Ui(),ts()],mounted(){this.hotkey$bind([32,179],"play_switch",(()=>{const{currentSources:e,loadingState:t}=this.player.states;!e||e.length<=0||t||(this.player.states.isPaused?this.player.play():this.player.pause())})),this.hotkey$bind(70,"fullscreen_switch",(()=>{this.player.setFullscreen(!this.player.states.isFullscreen)})),this.hotkey$bind([39,176],"forward",(()=>{console.log("[Ctrl] fwd");const{currentSources:t,loadingState:o}=this.player.states;if(!t||t.length<=0)return;if(o)return;const a=this.player.states,s=Math.max(0,Math.min(a.currentTime+e,a.duration-.001));this.player.seek(s),n.call(this,{icon:"fast_forward",message:`${ji(s)} / ${this.durationLabel}`})})),this.hotkey$bind([37,177],"rewind",(()=>{console.log("[Ctrl] bwd");const{currentSources:t,loadingState:o}=this.player.states;if(!t||t.length<=0)return;if(o)return;const a=this.player.states,s=Math.max(0,Math.min(a.currentTime-e,a.duration-.001));this.player.seek(s),n.call(this,{icon:"fast_rewind",message:`${ji(s)} / ${this.durationLabel}`})})),this.hotkey$bind(38,"volume_up",(()=>{const e=Math.max(0,Math.min(this.player.states.volume+t,1));this.player.setVolume(e)})),this.hotkey$bind(40,"volume_down",(()=>{const e=Math.max(0,Math.min(this.player.states.volume-t,1));this.player.setVolume(e)})),this.hotkey$bind(190,"track_offset_forward",(()=>{this.player.setTrackOffset(this.player.states.track.offset+.5)})),this.hotkey$bind(188,"track_offset_backward",(()=>{this.player.setTrackOffset(this.player.states.track.offset-.5)})),this.$watch((()=>{var e;return null===(e=this.player.states.track)||void 0===e?void 0:e.offset}),((e,t)=>{void 0!==t&&n.call(this,{icon:"subtitles",message:`${e>0?"+":""}${-1===e.toString().indexOf(".")?e+".0":e}s`})})),this.$watch((()=>this.player.states.volume),((e,t)=>{null!==t&&n.call(this,{icon:"volume_up",message:`${Math.round(100*e)}%`})}))}};function n({icon:e,message:t}){this.$refs.centerRef.createDialog({icon:e,message:t,timeout:1e3})}};function Ui(){const e={};let t;const n=[],o={};return{async mounted(){await this.player.promisePlayerReady,e.player=this.$el.parentNode,e.container=e.player.querySelector(".video-js-player>.video-js"),e.controller=this.$el,e.video=e.player.querySelector(".video-js-player>.video-js>video.vjs-tech"),e.controller.hasAttribute("tabIndex")||e.controller.setAttribute("tabIndex","-1"),e.controller.style.outline="none",t=s.bind(this),document.body.addEventListener("keydown",t)},beforeUnmount(){document.body.removeEventListener("keydown",t)},methods:{hotkey$bind:a,hotkey$focus(){const t=document.activeElement;t===e.player||t===e.container||t===e.controller||t===e.video||e.controller.contains(t)||e.container.focus()}}};function a(e,...t){const a={matcher:null,callback:null};function s(){return"function"===typeof e?e:"number"===typeof e?t=>t.which===e:Array.isArray(e)?t=>e.includes(t.which):null}function i(){let e,n;return 2===t.length?(e=t[0],n=t[1]):"function"===typeof t[0]?(e=null,n=t[0]):(e=t[0],n=null),e&&n&&(o[e]=n),e?()=>o[e]():n?()=>n():null}a.matcher=s(),a.callback=i(),a.matcher&&a.callback&&n.unshift(a)}async function s(t){const o=document.activeElement;if(o===e.player||o===e.container||o===e.controller||o===e.video||o===document.body||e.controller.contains(o)){const e=n.find((e=>e.matcher(t)));if(!e)return console.log("[Ctrl] No hotkey",t);console.log("[Ctrl]",e),await e.callback()}}}const Fi=Ta();var Mi={mixins:[Ri(),Bi()],components:{ControllerLayout:Uo,Subtitle:Ho,Center:Wa,Header:Ya,Footer:Ps,Setting:Zs,VolumeButton:ri,PlaybackRateButton:pi,SubtitleButton:$i,PipButton:Oi,FullscreenButton:Li},props:{player:Object},methods:{handleOpenSetting(){this.player.pause(),this.$refs.settingRef.show()},async handleOpenLocalVideo(){console.log("handleOpenLocal");const e=await Fi();if(console.log("source",e),!e)return;await this.player.setSource(e),console.log(this.player.states);const{currentSources:t,loadingState:n}=this.player.states;!t||t.length<=0||n||(console.log(this.player,this.player.play),this.player.play())}}};function Bi(){return{provide(){return{player$settings:this.player$settings}},data(){return{player$settings:{subtitle:{style:"normal",weight:"normal",size:1.25}}}},mounted(){this.$watch((()=>this.player$settings.subtitle.size),(e=>{this.$el.style.setProperty("--subtitle-size",`${e}rem`)}),{immediate:!0}),this.$watch((()=>this.player$settings.subtitle.style),(e=>{this.$el.style.setProperty("--subtitle-style",e)}),{immediate:!0}),this.$watch((()=>this.player$settings.subtitle.weight),(e=>{this.$el.style.setProperty("--subtitle-weight",e)}),{immediate:!0})}}}var Qi=Mi,Wi=Object(g["a"])(Qi,Po,Oo,!1,null,null,null),zi=Wi.exports;k()(Wi,"components",{QBtn:le["a"]});var Hi={name:"VideoJsPlayer",components:{Controller:zi},data(){return{player:null}},mixins:[Vi(),Gi(),Ki()]};function Vi(){const e=e=>e&&e.destroy();return{created(){this.player=this.$videoJs.createPlayer();const e=this.player.play.bind(this);this.player.play=(...t)=>{console.log("[Trigger play]",this.player,this.player.states),e(...t),this.$emit("player-play"),this.player.mute(this.player.states.isMuted)}},mounted(){this.$watch((()=>this.player),(async(n,o)=>{e(o),n&&(await n.initialize(this.$refs.videoRef),t.call(this))}),{immediate:!0})},beforeDestroy(){e(this.player)}};function t(){const e=["openFile"];e.forEach((e=>this.player.ctl$on(e,(()=>this.$emit(e)))))}}function Gi(){return{created(){const e=()=>{var e,t;return null!==(e=null===(t=this.player)||void 0===t?void 0:t.instance)&&void 0!==e?e:null};this.$watch(e,(e=>{if(!e)return;const t=e.contentEl();if(!t)return;const n=t.nextElementSibling;n&&t.appendChild(n)}),{immediate:!0})}}}function Ki(){return{methods:{async setSource(...e){await this.player.promiseReady,await this.player.setSource(...e)}}}}var Yi=Hi,Ji=(n("2163"),Object(g["a"])(Yi,To,Io,!1,null,null,null)),Xi=Ji.exports;window.videojs=Fn["default"],n("94ce"),n("63f2"),n("2079");var Zi=(e,t)=>{const n=new e(xo);e.prototype.$videoJs=n,e.component("VideoJsPlayer",Xi)},er=e=>{const{Vue:t}=e;t.component("AlphabizButton",Ce),t.component("AlphabizSelect",De),t.component("VirtualScrollGrid",Be),t.use(kn),t.use(tr,e),t.config.errorHandler=function(e){throw e},t.use(nr),t.use(Rn,{}),t.use(An,{getLocalConfig:()=>B.a.dynamicConfig.local,getRemoteConfigUrl:()=>B.a.dynamicConfig.remote.url}),t.mixin({computed:{screen$xs(){return this.$q.screen.height<=600||this.$q.screen.width<=600},isPortrait(){return this.$q.screen.height>this.$q.screen.width}}}),t.use(Zi,{})};function tr(e,{store:t}){const o=(...e)=>console.tag.orange("VersionControl",...e),a=()=>t.getters.settings.versionChannel,s=e=>{{const t=n("ae46");return t[e]}},i=e=>{const[t,n,o]=e.split("-");return{version:t,channel:null!==n&&void 0!==n?n:"stable",build:o}},r=e=>{const t=Array.from(e),n=[4,2,2,2,2].reduce(((e,n,o)=>(e[o]=t.splice(0,n).join(""),e)),[]);return new Date(n.splice(0,3).join("-")+" "+n.join(":"))},l=async({wait:e,timeout:t})=>{const n=B.a.versionsUrl,a=async()=>{try{return await(await fetch(n)).json()}catch{return null}},s=async(e,{onTimeout:t,timeout:n})=>{let o,a=!1;return await Promise.race([e.then((e=>{a=!0,o=e})),new Promise((e=>setTimeout(e,n))).then((()=>{a||t&&(o=t())}))]),o},i=(e,{onFailed:t,wait:n})=>{let o=!1;const a=async()=>{let a=await e();while(!a&&!o){if(await new Promise((e=>setTimeout(e,n))),o)break;if(a=await e(),o)break;a||t()}return a},s=a();return s.cancel=()=>o=!0,s},r=i((async()=>await a()),{onFailed(){o().tag("retry").log("retry to fetch versionsInfo")},wait:e}),l=await s(r,{timeout:t,onTimeout(){return o().tag.red("failed").log("failed to fetch versionsInfo"),null}}).finally(r.cancel);return l},c=31536e6,d=1e4,u=new e({data(){return{currentVersion:i(s("version")),buildTime:r(s("buildTime")),versionsInfo:void 0}},computed:{versionState(){if(!Object(xn["isElectron"])())return"active";if(void 0===this.versionsInfo)return"pending";if(this.versionsInfo){const e=i(this.versionsInfo.min[a()]),t=Sn.a.gt([e.version,e.build].filter((e=>!!e)).join("-"),[this.currentVersion.version,this.currentVersion.build].filter((e=>!!e)).join("-"));return t?"force_update":"active"}{const e=new Date-this.buildTime;return e>=c?"force_exit":"active"}}},created(){this.$watch("currentVersion",(e=>{o("currentVersion").log(JSON.parse(JSON.stringify(e)))}),{immediate:!0}),this.$watch("versionsInfo",(e=>{o("versionsInfo").log(e?JSON.parse(JSON.stringify(null!==e&&void 0!==e?e:{})):e)}),{immediate:!0}),this.$watch("versionState",(e=>{o("versionState").log(e)}),{immediate:!0});const e=3e3;l({wait:e,timeout:d}).then((e=>this.versionsInfo=e))}});e.mixin({computed:{vc$versionState(){return u.versionState},vc$buildTime(){return u.buildTime}}})}function nr(e){function t(){let e=0;document.addEventListener("touchstart",(e=>{e.touches.length>1&&e.preventDefault()})),document.addEventListener("touchend",(t=>{const n=(new Date).getTime();n-e<=300&&t.preventDefault(),e=n}),!1),document.addEventListener("gesturestart",(e=>e.preventDefault())),document.addEventListener("dblclick",(e=>e.preventDefault()))}function n(){const e=window.innerHeight;document.documentElement.style.setProperty("--viewport-height",`${e}px`)}window.addEventListener("DOMContentLoaded",t),window.addEventListener("resize",n),window.addEventListener("DOMContentLoaded",n)}var or=n("1926");const ar={account_error_network:["Network error","Network Error"],account_error_attempt_limit_exceeded:["Attempt limit exceeded, please try after some time"],account_error_incorrect_username_or_password:["User does not exist","Incorrect username or password"],account_error_username_not_found:["Username/client id combination not found."],account_error_can_not_reset_for_no_verified:["Cannot reset password for the user as there is no registered/verified email or phone_number"],account_error_invalid_verification_code:["Invalid verification code provided, please try again"],account_error_password_not_long_enough:["Password did not conform with policy: Password not long enough"],account_error_invalid_phone_number_format:["Invalid phone number format"],account_error_no_cell_phone_prefix:["Please select the prefix for the phone number"],account_error_username_already_exists:["User already exists"],account_error_incorrect_password:["Incorrect password"],account_error_you_need_to_accept_license_terms:["you_need_to_accept_license_terms"],account_error_incorrect_original_password:["incorrect_original_password"]},sr={match:e=>Object.values(ar).some((t=>Array.isArray(t)?t.includes(e.message):"object"===typeof t&&Object.keys(t).includes(e.message))),execute(e,t){const n=Object.keys(ar).find((t=>ar[t].some((t=>t.includes(e.message)))));t.$q.notify({message:n,type:"negative",position:"bottom-right",timeout:5e3})}};var ir=[sr],rr=n("b34a"),lr=n("1738"),cr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",e._g(e._b({style:{minWidth:e.minWidth},attrs:{size:"md",align:"around","no-wrap":"",percentage:e.percentage,disable:e.value||e.loading,loading:e.loading,type:e.type,unelevated:!e.shadow,icon:e.icon,label:e.label,color:e.primary?"primary":e.transparent?"transparent":"general","text-color":e.primary?"primary":"general"},scopedSlots:e._u([{key:"loading",fn:function(){return[n("q-spinner",{attrs:{color:e.primary?"primary":"general"}})]},proxy:!0}])},"q-btn",Object.assign({},e.bound),!1),Object.assign({},"button"===e.type?{click:e.handleButton}:{})),[e._t("default")],2)},dr=[],ur={name:"AmplifyButton",props:{primary:Boolean,immediate:Boolean,shadow:{type:Boolean,default:!1},transparent:{type:Boolean,default:!1},minWidth:{type:String,default:"128px"},value:{type:Boolean,default:!1},timeout:{type:Object,default:void 0},icon:{type:String,default:void 0},label:{type:String,default(){return this.icon?void 0:"button"}},type:{type:String,default:"button"},onClick:{type:Function,default:void 0},onAnimationEnd:{type:Function,default:void 0},bound:{type:Object,default(){return{}}}},data(){return{loading:!1,percentage:100,interval:null}},methods:{async handleButton(e){if(this.onClick)if(this.immediate)this.onClick(e);else try{await this.startLoading(this.onClick,e)}finally{await this.stopLoading()}},async startLoading(e,...t){this.$emit("input",!0),this.loading=!0,await new Promise((e=>setTimeout(e,800)));const n=this.timeout?this.timerWrapper(e):e;await n(...t)},async stopLoading(){this.shutdownTimer(),this.timeout&&await new Promise((e=>setTimeout(e,1e3))),this.onAnimationEnd&&this.onAnimationEnd(),this.loading=!1,this.$emit("input",!1)},async startTimer(e,t){const n=100,o=Math.max(100,t/100),a=Math.max(1,Math.floor(o)/t*n);return this.percentage=e,await new Promise(((e,t)=>{const n=()=>{this.percentage=Math.max(0,Math.min(100,this.percentage+a)),this.percentage<100||(this.shutdownTimer(),t(new Error("Timeout")))};this.interval=setInterval(n,o)}))},shutdownTimer(){this.percentage=100,null!==this.interval&&(clearInterval(this.interval),this.interval=null)},timerWrapper(e){const{onTimeout:t,duration:n}=this.timeout;return async(...o)=>{let a;try{a=await Promise.race([this.startTimer(0,n),e(...o)]),this.shutdownTimer()}catch(s){if("Timeout"!==s.message)throw s;t()}return a}}},beforeDestroy(){this.shutdownTimer()}},hr=ur,pr=(n("3c15"),Object(g["a"])(hr,cr,dr,!1,null,"6fc70cc6",null)),mr=pr.exports;k()(pr,"components",{QBtn:le["a"],QSpinner:we["a"]});var _r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{style:Object.assign({},{minWidth:e.minWidth},e.maxWidth?{maxWidth:e.maxWidth}:{},{paddingBottom:e.screen$xs?"calc(44px + 8px)":"8px"}),attrs:{flat:"",bordered:e.bordered}},[e.showCancelCorner?n("amplify-button",{ref:"cornerCancelButton",staticClass:"self-start",staticStyle:{height:"48px"},attrs:{immediate:!0,transparent:!0,icon:"arrow_back","on-click":e.onCancel,"min-width":"64px"},model:{value:e.disable,callback:function(t){e.disable=t},expression:"disable"}}):e._e(),n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:e.showTitle,expression:"showTitle"}],staticClass:"q-py-sm",class:e.screen$xs?"q-px-sm":"q-px-md"},[n("div",{staticClass:"text-h6 text-weight-bold q-py-sm non-selectable"},[e._v(e._s(e.title))])]),n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:e.showDescription,expression:"showDescription"}],staticClass:"q-pt-none q-pb-sm amplify-card-description",class:e.screen$xs?"q-px-sm":"q-px-md"},[e._t("description",null,{disable:e.disable,setDisable:function(t){return e.disable=t}})],2),n("q-form",{directives:[{name:"show",rawName:"v-show",value:e.showForm,expression:"showForm"}],staticClass:"col-grow",on:{submit:e.handleSubmit}},[n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:e.showContent,expression:"showContent"}],staticClass:"col-grow q-pt-none amplify-card-form",class:e.screen$xs?"q-px-sm":"q-px-md"},[e._t("default",null,{disable:e.disable,setDisable:function(t){return e.disable=t}})],2),n("q-card-actions",{directives:[{name:"show",rawName:"v-show",value:e.showCardActions,expression:"showCardActions"}],staticClass:"q-pt-md q-pb-sm amplify-card-actions",class:e.screen$xs?"q-px-sm":"q-px-md",attrs:{align:"stretch",vertical:""}},[e._t("options",null,{disable:e.disable,setDisable:function(t){return e.disable=t}}),e.showSubmitButton?n("amplify-button",{ref:"submitButton",attrs:{primary:!e.noPrimary,type:"submit",timeout:e.timeout,label:e.submitLabel,"on-click":e.onSubmit,"on-animation-end":e.afterSubmit},model:{value:e.disable,callback:function(t){e.disable=t},expression:"disable"}}):e._e(),e.showCancelButton?n("amplify-button",{ref:"cancelButton",attrs:{immediate:"",label:e.cancelLabel,"on-click":e.onCancel},model:{value:e.disable,callback:function(t){e.disable=t},expression:"disable"}}):e._e(),e._t("actions",null,{disable:e.disable,setDisable:function(t){return e.disable=t}})],2)],1)],1)},fr=[],gr=(n("e39c"),{name:"AmplifyCard",props:{title:{type:String,default:void 0},bordered:{type:Boolean,default:!1},minWidth:{type:String,default:"320px"},maxWidth:{type:String,default:void 0},cancelable:{type:Boolean,default:!0},cornerCancel:{type:Boolean,default:!1},submitLabel:{type:String,default(){return this.$t("account_submit")}},cancelLabel:{type:String,default(){return this.$t("account_cancel")}},timeout:{type:Object,default:void 0},onSubmit:{type:Function,default:void 0},onCancel:{type:Function,default:void 0},afterSubmit:{type:Function,default:void 0},noPrimary:Boolean,hideDescription:Boolean,hideOptions:Boolean,hideActions:Boolean},data(){return{disable:!1}},methods:{async handleSubmit(e){await this.$refs.submitButton.handleButton(e)},handleKeydownEsc(){if(this.disable)return;if(!this.showCancelButton&&!this.showCancelCorner)return;const e=this.showCancelButton?"cancelButton":"cornerCancelButton";this.$refs[e].handleButton(null)}},computed:{showCancelCorner(){return this.cancelable&&this.cornerCancel},showTitle(){return!!this.title},showDescription(){return!this.hideDescription&&(!!this.$slots.description||!!this.$scopedSlots.description)},showContent(){return!!this.$slots.default||!!this.$scopedSlots.default},showOptions(){return!this.hideOptions&&(!!this.$slots.options||!!this.$scopedSlots.options)},showActions(){return!this.hideActions&&(!!this.$slots.actions||!!this.$scopedSlots.actions)},showSubmitButton(){return!!this.onSubmit},showCancelButton(){return this.cancelable&&!this.cornerCancel},showForm(){return this.showContent||this.showCardActions},showCardActions(){return this.showOptions||this.showSubmitButton||this.showCancelButton||this.showActions}}}),br=gr,yr=(n("0251"),n("1117")),vr=Object(g["a"])(br,_r,fr,!1,null,null,null),wr=vr.exports;k()(vr,"components",{QCard:v["a"],QCardSection:ie["a"],QForm:yr["a"],QCardActions:yn["a"]});var kr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{"no-shake":"",value:e.value,persistent:"","content-class":{"background-blur":e.blur,"background-mask":e.mask,"fullscreen-dialog":!0}},on:{input:function(t){return e.$emit("input",t)}}},[e.single?n("amplify-card",e._b({attrs:{"hide-description":!e.showDescription,"hide-options":!e.showOptions,"hide-actions":!e.showActions},scopedSlots:e._u([{key:"description",fn:function(t){return[e.showDescription?e._t("description",null,null,t):e._e()]}},{key:"default",fn:function(t){return[e.showContent?e._t("default",null,null,t):e._e()]}},{key:"options",fn:function(t){return[e.showOptions?e._t("options",null,null,t):e._e()]}},{key:"actions",fn:function(t){return[e.showActions?e._t("actions",null,null,t):e._e()]}}],null,!0)},"amplify-card",e.cardProps,!1)):[e._t("default",null,{cardProps:e.cardProps,handleSubmit:e.handleSubmit,handleCancel:e.handleCancel})]],2)},Cr=[],$r={name:"AmplifyDialog",props:{value:Boolean,blur:Boolean,mask:Boolean,single:{type:Boolean,default:!0},title:{type:String,default:void 0},minWidth:{type:String,default:void 0},maxWidth:{type:String,default:void 0},cancelable:{type:Boolean,default:!0},cornerCancel:{type:Boolean,default:!1},submitLabel:{type:String,default(){return this.$t("account_submit")}},cancelLabel:{type:String,default(){return this.$t("account_cancel")}},timeout:{type:Object,default:void 0},onSubmit:{type:Function,default:void 0},onCancel:{type:Function,default:void 0},onClear:{type:Function,default:void 0}},data(){return{disable:!1,close:!1}},watch:{value(e){!e&&this.onClear&&setTimeout((()=>this.onClear()),1e3)}},computed:{cardProps(){const e={};return e.title=this.title,e.minWidth=this.minWidth,e.maxWidth=this.maxWidth,e.cancelable=this.cancelable,e.cornerCancel=this.cornerCancel,e.submitLabel=this.submitLabel,e.cancelLabel=this.cancelLabel,e.timeout=this.timeout,this.onSubmit&&(e.onSubmit=()=>this.handleSubmit(this.onSubmit)),this.cancelable&&(e.onCancel=()=>this.handleCancel(this.onCancel)),e.afterSubmit=()=>this.handleAfterSubmit(),e},showDescription(){return!!this.$slots.description||!!this.$scopedSlots.description},showContent(){return!!this.$slots.default||!!this.$scopedSlots.default},showOptions(){return!!this.$slots.options||!!this.$scopedSlots.options},showActions(){return!!this.$slots.actions||!!this.$scopedSlots.actions}},methods:{async handleSubmit(e){e?this.close=await e():this.closeDialog()},async handleCancel(e){if(e){const t=await e();t&&this.closeDialog()}else this.closeDialog()},handleAfterSubmit(){this.close&&(this.close=!1,this.closeDialog())},closeDialog(){this.$emit("input",!1)}}},Sr=$r,xr=(n("4d89"),Object(g["a"])(Sr,kr,Cr,!1,null,null,null)),Tr=xr.exports;k()(xr,"components",{QDialog:y["a"]});var Ir=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-select",e._g({ref:"select",staticClass:"amplify-select",attrs:{dense:"",outlined:"",behavior:"menu",options:e.optionsCpt,readonly:e.readonly,autofocus:e.autofocus,value:e.model,"option-label":e.selectLabelFn,"use-input":Boolean(e.filter),"input-debounce":"0","popup-content-style":e.popupWidth,"input-style":e.enableFilter?"":"display:none","virtual-scroll-item-size":"48",hint:e.hint},on:{input:e.handleInput,keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.pressEnter.apply(null,arguments)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"no-option",fn:function(){return[n("q-item",[n("q-item-section",{staticClass:"text-grey"},[e._v("\n "+e._s(e.$t("no_available_result"))+"\n ")])],1)]},proxy:!0},e.model&&(e.model.icon||e.model.emoji)?{key:"prepend",fn:function(){return[e.model.icon?n("q-icon",{attrs:{name:e.model.icon}}):e.model.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(e.model.emoji))]):e._e()]},proxy:!0}:null,{key:"option",fn:function(t){var o=t.itemProps,a=t.itemEvents,s=t.opt;return[n("q-item",e._g(e._b({staticClass:"overflow-hidden-x",style:e.itemStyle},"q-item",o,!1),a),[s.icon||s.emoji?n("q-item-section",{staticStyle:{"margin-left":"-4px","margin-right":"-22px"},attrs:{avatar:""}},[s.icon?n("q-icon",{attrs:{name:s.icon}}):s.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(s.emoji))]):e._e()],1):e._e(),n("q-item-section",{staticStyle:{"margin-left":"-4px"}},[n("q-item-label",{domProps:{innerHTML:e._s(s.label)}})],1)],1)]}},e.hint?{key:"hint",fn:function(){return[e._v(e._s(e.hint))]},proxy:!0}:null],null,!0)},Object.assign({},e.filter?{"popup-show":e.onPopupShow,filter:e.filterFn,"popup-hide":e.onPopupHide}:{})))},Pr=[],Or={name:"AmplifySelect",props:{readonly:Boolean,autofocus:Boolean,options:Array,value:[Object,Function,Number,String],itemMaxWidth:{type:String,default:void 0},itemMinWidth:{type:String,default:void 0},selectLabelFn:{type:Function,default:e=>e?e.label:()=>""},align:[Element,Boolean],filter:{type:Function,default:void 0},hint:String},data(){return{enableFilter:!1,filterValue:"",inputWidth:"280"}},computed:{optionsCpt(){const e=e=>{const t={};if("object"===typeof e)for(const[n,o]of Object.entries(e))"label"===n?t.label=(()=>e.label?"function"===typeof e.label?e.label(e.value):e.label:""+e.value)():t[n]=o;else t.value=e,t.label=e;return t},t=this.options.map(e);if(this.filter&&this.enableFilter){const e=e=>""===this.filterValue||this.filter(this.filterValue,e);return t.filter(e)}return t},model(){if(this.enableFilter)return null;{const e=this.optionsCpt.find((e=>e.value===this.value));if(e)return e;throw new Error("invalid amplify-select value: "+this.value)}},itemStyle(){const e={};if(this.align){const t="boolean"===typeof this.align?this.$el:this.align,{width:n}=getComputedStyle(t);e.width=n}return this.itemMinWidth&&(e.minWidth=this.itemMinWidth),this.itemMaxWidth&&(e.maxWidth=this.itemMaxWidth),e},popupWidth(){return this.inputWidth>292?`width: ${1*this.inputWidth+50}px`:`width: ${this.inputWidth-4}px`}},methods:{handleInput(e){e&&this.$emit("input",e.value)},filterFn(e,t){t((()=>{this.filterValue=e}))},onPopupShow(){this.filterValue="",this.enableFilter=!0;const e=this.$el.firstChild;e.style.width="84.36px",this.$emit("popup-show"),this.$nextTick((()=>{this.$refs.select&&this.$refs.select.showPopup()}))},onPopupHide(){this.enableFilter=!1,this.filterValue="";const e=this.$el.nextSibling,t=this.$el.firstChild;e&&(e.style.display=""),t&&(t.style.width="84.36px"),this.$emit("popup-hide")},pressEnter(){this.filter&&(this.optionsCpt.length>0&&this.handleInput(this.optionsCpt[0]),this.enableFilter=!1,this.filterValue="",this.$nextTick((()=>{const e=this.$refs.select.$el.getElementsByTagName("input")[0];e.blur()})))},getInputWidth(){this.$nextTick((()=>{const e=this.$el.firstChild.offsetParent.childNodes[0];this.inputWidth=e.clientWidth}))}},updated(){this.getInputWidth()}},qr=Or,Er=(n("bbb8"),Object(g["a"])(qr,Ir,Pr,!1,null,null,null)),Ar=Er.exports;k()(Er,"components",{QSelect:Ie["a"],QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QInput:K["a"],QItemLabel:qe["a"],QField:Ee["a"]});var Dr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"amplify-input-wrapper"},[e.isTel&&e.phoneNumberPrefixValue?n("amplify-select",{ref:"select",staticClass:"amplify-input-select",class:{focus:e.focusSelect},attrs:{options:e.phoneNumberPrefixOptions,selectLabelFn:function(){return""},readonly:e.readonly,autofocus:!1,align:e.$el,filter:e.phoneNumberPrefixFilter},on:{"popup-show":function(t){return e.selectFocus(!0)},"popup-hide":function(t){return e.selectFocus(!1)}},model:{value:e.phoneNumberPrefixValue,callback:function(t){e.phoneNumberPrefixValue=t},expression:"phoneNumberPrefixValue"}}):e._e(),n("q-input",{directives:[{name:"show",rawName:"v-show",value:!e.focusSelect,expression:"!focusSelect"}],ref:"input",staticClass:"amplify-input",class:{"amplify-tel-input":e.isTel},attrs:{"lazy-rules":"ondemand",spellcheck:"false",dense:"",outlined:"",readonly:e.readonly,autofocus:e.autofocus,value:e.isTel?e.value[1]:e.value,type:"password"===e.type?e.hidePassword?"password":"text":e.type,label:!e.isTel&&e.label?e.label:void 0,rules:e.rulesCpt,min:e.rangeCpt[0],max:e.rangeCpt[1],"error-message":e.errorMessage,error:Boolean(e.errorMessage),hint:e.hint},on:{input:e.handleInput,keydown:function(t){return t.type.indexOf("key")||8===t.keyCode?e.onPressBack.apply(null,arguments):null},focus:function(t){return e.inputFocus(!0)},blur:function(t){return e.inputFocus(!1)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"prepend",fn:function(){return[e.isTel&&e.value[0]&&e.prefixStart?n("div",{staticClass:"amplify-input-phone-number-prefix"},[e._v("\n +"+e._s(e.value[0])+"\n ")]):e._e(),e.icon&&!e.isTel?n("q-icon",{attrs:{name:e.icon}}):e._e()]},proxy:!0},"password"===e.type?{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}:null],null,!0)})],1)},Nr=[],Lr=n("c228");const jr=(()=>{const e={};Object.values(Lr["a"]).forEach((t=>{t.phones.forEach((n=>{const[o,a]=n.split("-");e[n]={value:n,label:`${t.name} (+${o})`,emoji:t.emoji,prefixCode:o,countryCode:a,normalizedName:t.normalizedName,nativeName:t.name}}))}));const t=Object.keys(e).sort(((t,n)=>{const o=parseInt(e[t].prefixCode),a=parseInt(e[n].prefixCode);return o===a?1===o?"US"===e[t].countryCode?-1:"US"===e[n].countryCode?1:0:0:o>a?1:-1}));return t.reduce(((t,n)=>(t[n]=e[n],t)),{})})();var Rr={name:"AmplifyInput",props:{value:[String,Array],readonly:Boolean,autofocus:Boolean,required:{type:[Boolean,String],default:!1},type:{type:String,default:"text"},label:String,icon:String,rules:Array,range:Array,mask:String,errorMessage:String,hint:String},data(){return{focusSelect:!1,hidePassword:!0,prefixStart:!0}},computed:{isTel(){return"tel"===this.type},rulesCpt(){const e=e=>this.requiredRule(e),t=this.rules?this.rules.map((e=>t=>{const n=e(t);return"string"===typeof n?this.$t(n):"object"===typeof n&&Array.isArray(n)?this.$t(...n):n})):null,n=[...this.required?[e]:[],...t||[]];return this.isTel&&n.push((e=>this.phoneNumberRule(e))),n},rangeCpt(){const e={date:["1900-01-01","2099-12-31"]},t=e[this.type]||[void 0,void 0];return this.range&&([void 0,null].includes(this.range[0])||(t[0]=this.range[0]),[void 0,null].includes(this.range[1])||(t[1]=this.range[1])),t},phoneNumberNotSay(){if(this.isTel)return{value:"notSay",label:"notSay",emoji:"🇼🇫"}},phoneNumberPrefixOptions(){if(!this.isTel)return;const e=Object.values(jr);return e.unshift(this.phoneNumberNotSay),e},phoneNumberPrefixValue:{get(){if(!this.isTel)return;const e=this.value[0],t=this.value[2];return e&&t?`${e}-${t}`:this.phoneNumberNotSay.value},set(e){if(this.isTel)if(e&&e!==this.phoneNumberNotSay.value){const{prefixCode:t,countryCode:n}=jr[e];let o=this.value[1];o.startsWith("+")&&(o=o.substr(1)),o.startsWith("00")&&(o=o.substr(2)),this.$emit("input",[t,o,n]),localStorage.setItem("def_tel_prefix",`${n}-${t}`)}else this.$emit("input",["",this.value[1],""])}}},methods:{selectFocus(e){this.focusSelect=e},inputFocus(e){var t,n,o,a,s,i;(console.log("On focus input",e),e)?null===(t=this.$refs.select)||void 0===t||null===(n=t.$el)||void 0===n||null===(o=n.classList)||void 0===o||o.add("q-field--highlighted","q-field--focus"):null===(a=this.$refs.select)||void 0===a||null===(s=a.$el)||void 0===s||null===(i=s.classList)||void 0===i||i.remove("q-field--highlighted","q-field--focus")},handleInput(e){this.$refs.input.resetValidation(),this.isTel?this.handlePhoneNumberInput(e):this.$emit("input",e)},requiredRule(e){if(this.isTel)return this.phoneNumberRequiredRule(e);if(e&&e.length>0)return!0;const t="string"===typeof this.required?this.required:this.label;return`${t}${this.$t("account_is_required")}`},phoneNumberRequiredRule(e){const t=e[1];if(t)return!0;{const e="string"===typeof this.required?this.required:this.label;return`${e}${this.$t("account_is_required")}`}},phoneNumberRule(e){const t=e[1];return this.phoneNumberPrefixValue===this.phoneNumberNotSay.value&&t?this.$t("account_error_no_cell_phone_prefix"):(this.phoneNumberPrefixValue===this.phoneNumberNotSay.value||t||(this.phoneNumberPrefixValue=this.phoneNumberNotSay.value),!0)},phoneNumberPrefixFilter(e,t){const n=["normalizedName","nativeName","value"];return n.find((n=>!!t[n]&&t[n].toLowerCase().indexOf(e.toLowerCase())>=0))},handlePhoneNumberInput(e){const t=()=>{if(!e)return this.phoneNumberNotSay;const t=e.startsWith("+"),n=e.startsWith("00"),o=t?"+":n?"00":Array.isArray(this.value)&&this.value[0]?"__":"";return this.phoneNumberPrefixOptions.find((({prefixCode:t})=>e.startsWith(`${o}${t}`)))||null},n=t();if(void 0===n||null===n)this.$emit("input",[this.value[0],e,this.value[2]]);else if(n===this.phoneNumberNotSay)this.$emit("input",[this.value[0],e,this.value[2]]);else{const{prefixCode:t,countryCode:o}=jr[n.value];let a=e;if(a.startsWith("+")&&(a=a.substr(1)),a.startsWith("00")&&(a=a.substr(2)),a.startsWith(t)&&(a=a.substr(t.length)),this.$emit("input",[t,a,o]),!t||!o)return;localStorage.setItem("def_tel_prefix",`${o}-${t}`)}},onPressBack(e){const t=e.target;if(console.log("press back",JSON.stringify(this.value),t.selectionStart,t.selectionEnd),"email"===t.type)return console.log("Default behavior for email");const n=t.selectionDirection,o=t.selectionStart,a=t.selectionEnd,s=o===a?o-1:o,i=s<0?0:s;if(this.$nextTick((async()=>{await this.$nextTick();try{t.setSelectionRange(i,i,n)}catch(e){console.log(e.message)}})),e.preventDefault(),e.stopPropagation(),this.isTel)this.value[1]=this.value[1].substring(0,o===a?o-1:o)+this.value[1].substring(a),this.handlePhoneNumberInput(this.value[1]);else{const e=this.value.substring(0,o===a?o-1:o)+this.value.substring(a);this.$emit("input",e)}0===o&&0===a&&this.isTel&&this.$emit("onPressBack"),this.isTel&&0===a&&0===this.value[1].length&&this.$emit("input",["","",""])}},updated(){this.prefixStart=!0}},Ur=Rr,Fr=(n("2214"),Object(g["a"])(Ur,Dr,Nr,!1,null,null,null)),Mr=Fr.exports;function Br(e){e.component("AmplifyButton",mr),e.component("AmplifyCard",wr),e.component("AmplifyDialog",Tr),e.component("AmplifySelect",Ar),e.component("AmplifyInput",Mr)}k()(Fr,"components",{QInput:K["a"],QIcon:Y["a"],QField:Ee["a"]});var Qr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"amplify-dialog-groups"},[n("SignedOutDialog",{ref:"signedOut"})],1)},Wr=[],zr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"amplify-signed-out-dialog"},[n("amplify-dialog",{attrs:{single:!1,cornerCancel:!0,"min-width":"320px","max-width":"320px","on-clear":e.onClear,blur:!0,mask:!1},scopedSlots:e._u([{key:"default",fn:function(t){return["test"===e.currentCard?n("OAuth",e._g({ref:"test",attrs:{scope:t}},e.cardEvents)):"oauth"===e.currentCard?n("OAuth",e._g({ref:"oauth",attrs:{scope:t}},e.cardEvents)):"disableMFA"===e.currentCard?n("DisableMFA",e._g({attrs:{scope:t}},e.cardEvents)):"signedOut"===e.$store.state.account.authState?n("SignIn",e._g({attrs:{scope:t}},e.cardEvents)):"forgotPassword"===e.$store.state.account.authState?n("ForgotPassword",e._g({attrs:{scope:t}},e.cardEvents)):"signUp"===e.$store.state.account.authState?n("SignUp",e._g({attrs:{scope:t}},e.cardEvents)):"signInConfirm"===e.$store.state.account.authState?n("SignInConfirm",e._g({attrs:{scope:t}},e.cardEvents)):e._e()]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("div",{directives:[{name:"show",rawName:"v-show",value:e.value,expression:"value"}],staticClass:"signed-out-actions rounded-borders bg-general text-general row items-center q-py-xs q-px-sm shadow-1"},[e.$store.getters.settings.disableDevTools?e._e():n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.showDevDialog,expression:"!showDevDialog"}],attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"developer_mode"},on:{click:e.handleDevClick}},[n("q-tooltip",[e._v(e._s(e.$t("development")))]),n("q-dialog",{attrs:{"transition-show":"slide-up","transition-hide":"slide-down"},model:{value:e.showDevDialog,callback:function(t){e.showDevDialog=t},expression:"showDevDialog"}},[n("div",{staticClass:"development-dialog"},[n("div",{staticClass:"q-px-md q-py-sm flex items-center"},[n("div",{staticClass:"text-h6 text-bold"},[e._v("Development Panel")]),n("q-space"),n("q-btn",{attrs:{"fab-mini":"",unelevated:"",icon:"close"},on:{click:function(t){e.showDevDialog=!1}}})],1),n("q-separator"),n("div",{staticClass:"scroll-y"},[n("Development")],1)],1)])],1),n("q-btn",{attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"language"}},[n("q-tooltip",[e._v(e._s(e.language))]),n("q-menu",{attrs:{"transition-show":"jump-up","transition-hide":"jump-down"}},[n("q-list",e._l(e.languageOptions,(function(t){return n("q-item",{directives:[{name:"ripple",rawName:"v-ripple"},{name:"close-popup",rawName:"v-close-popup"}],key:t.value,attrs:{clickable:"",tag:"label"},on:{click:function(){return e.language=t.value}}},[n("q-item-section",{staticStyle:{width:"120px"}},[n("q-item-label",[e._v(e._s(t.label))])],1)],1)})),1)],1)],1),n("q-btn",{attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"info"},on:{click:e.showAboutDialog}},[n("q-tooltip",[e._v(e._s(e.$t("feedback")+"/"+e.$t("diagnotic")))])],1)],1)],1)},Hr=[],Vr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit(e.handleSignIn)},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_sign_in_your_account"),"submit-label":e.$t("account_sign_in"),timeout:e.timeout,"no-primary":"",cancelable:"PHONE_NUMBER"===this.form.currentMode},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.disable;return[n("div",{staticClass:"column q-col-gutter-xs"},e._l(e.form.items,(function(t,a){return n("amplify-input",e._b({key:a,ref:"sign",refInFor:!0,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{input:function(t){return e.signInChangeRules()},onPressBack:e.onPressBack},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),1),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v(e._s(e.$t("account_forgot_your_password"))),n("a",{staticClass:"underscore text-primary q-ml-xs cursor-pointer",attrs:{disabled:o||e.oauthLoading},on:{click:function(t){!o&&!e.oauthLoading&&e.handleResetPassword()}}},[e._v(e._s(e.$t("account_reset_password")))])])]}},{key:"actions",fn:function(t){var o=t.disable;return[n("amplify-button",{staticStyle:{"margin-top":"8px"},attrs:{immediate:"",primary:"",value:o,"on-click":function(){return e.$store.commit("ACCOUNT_UPDATE_STATE","signUp")},label:e.$t("account_sign_up")}}),n("ABOAuthEntry",{directives:[{name:"show",rawName:"v-show",value:e.d$cfg.oauth.enable&&!e.isMas,expression:"d$cfg.oauth.enable && !isMas"}]})]}}])},"amplify-card",e.scope.cardProps,!1))},Gr=[],Kr=n("7ca3"),Yr=n.n(Kr),Jr=n("c581"),Xr=n("af04"),Zr=n("9efe"),el=n("072b");class tl extends Jr["b"]{static createConfigs(e){return{GENERAL:["",{type:"text",icon:"account_box",label:"account_username_email_phone"}],SINGIN:[["86","","CN"],{type:"tel",label:"account_username_email_phone",rules:[el["e"].bind(e)]}]}}constructor(e){super(...tl.createConfigs(e).GENERAL),this.currentMode="GENERAL",this.configs=tl.createConfigs(e)}setMode(e,t){if(this.currentMode===e)return this;this.currentMode=e;const n=this.configs[e];return this.model=n[0],this.attrs=n[1],t&&this.updateModel(t),this}}class nl extends Jr["a"]{constructor(e,t){if(super({username:new tl(e),password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password"})}),this.assumeData=nl.storage.getAssumeData(),!this.assumeData){var n;const e=null!==(n=Lr["b"][t])&&void 0!==n?n:Lr["b"]["en-us"],[o,a]=e.phones[0].split("-");this.assumeData={prefix:o,code:a}}this.assume=!1}get formData(){const e=super.formData;if(!e.username)return e;let t=e.username;return(()=>{this.assume=!1,Array.isArray(t)?(nl.storage.setAssumeData({prefix:t[0],code:t[2]}),this.assumeData=nl.storage.getAssumeData(),t="+"+t[0]+t[1]):!t.startsWith("+")&&/^[0-9]*$|^$/g.test(t)&&(/^00/.test(this.model)?t=t.replace(/^00/,"+"):(this.assume=!0,t="+"+this.assumeData.prefix+t))})(),e.username=t,e}turnToPhoneNumberMode(){if("GENERAL"!==this.currentMode)return;this.assume=!1;const e=this.items.username.value,{prefix:t,code:n}=this.assumeData;this.items.username.setMode("PHONE_NUMBER",[t,e,n]),this.items.password.clear()}backToGeneralMode(){if("GENERAL"===this.currentMode)return;const e=this.formData.username;this.assume=!1,this.items.username.setMode("GENERAL",e),this.items.password.clear()}get currentMode(){return this.items.username.currentMode}}Yr()(nl,"storage",{setAssumeData(e){window.localStorage.setItem("sign_in_assume_data",JSON.stringify(e))},getAssumeData(){const e=window.localStorage.getItem("sign_in_assume_data");return e?JSON.parse(e):null}});var ol={name:"SignIn",props:{scope:Object},data(){return{isMas:In.a.mas(),timeout:{duration:6e4,onTimeout:this.handleTimeout},oauthStatus:null,form:new nl(this,this.$q.lang.getLocale().toLowerCase()),oauthProviders:["Facebook","Google","Github"],signUpMode:"email",prefix:"",countryCode:"",checkPrefix:[[],[]]}},computed:{oauthLoading(){return null!==this.oauthStatus}},methods:{handleResetPassword(){this.$store.commit("ACCOUNT_UPDATE_STATE","forgotPassword")},async handleSignIn(){try{const e=this.form.formData,t=e=>e.indexOf(" ")<0;if(!t(e.username))throw new Error("Incorrect username or password.");return await this.$store.dispatch("ACCOUNT_SIGN_IN",e),Zr["a"].record.call(this,e.password),this.$store.commit("ACCOUNT_UPDATE_STATE","signedIn"),Xr["a"].showPositive("signed_in"),!0}catch(t){const n=t.message;if("SMS_MFA"===n||"SOFTWARE_TOKEN_MFA"===n)this.$store.commit("ACCOUNT_UPDATE_STATE","signInConfirm");else if("User does not exist."===n)Xr["a"].showNegative("Incorrect username or password."),this.form.assume&&this.form.turnToPhoneNumberMode();else{var e;t.message||(console.log("=====================> error SignIn::handleSignIn <====================="),console.log(t),console.log("=====================> error SignIn::handleSignIn <=====================")),Xr["a"].showNegative(null!==(e=t.message)&&void 0!==e?e:t)}}},async handleCancel(){if("PHONE_NUMBER"!==this.form.currentMode)return!0;this.form.backToGeneralMode()},handleOAuthSignIn(e){this.$emit("setCurrentCard","oauth",(t=>t.setStatus("pending",e)))},handleTimeout(){Xr["a"].showNegative("Network error")},signInChangeRules(){if("email"===this.signUpMode&&(this.vm=this.form.items.username.model?this.form.items.username.model:"",Array.isArray(this.vm)&&(this.vm=this.vm[1]||""),this.vm&&/^[0-9]*$/g.test(this.vm)&&(console.log("toPhone",this.vm),this.toPhone()),this.vm.startsWith("+"))){const e=this.vm.substr(1),t=this.checkPrefix[0].indexOf(e),n=this.vm.length;if(-1!==t&&(this.form.items.username.model="1"===e?[e,"","US"]:[e,"",this.checkPrefix[1][t]],localStorage.setItem("def_tel_prefix",`${this.form.items.username.model[2]}-${e}`),this.form.items.username.attrs.type="tel",this.signUpMode="phoneNumber"),n>4&&/^[0-9]*$/g.test(e))for(const[o,a]of this.checkPrefix[0].entries())if(e.startsWith(a)){const t=a.length,n=e.substr(t);this.form.items.username.model="1"!==a?[a,n,this.checkPrefix[1][o]]:[a,n,"US"],localStorage.setItem("def_tel_prefix",`${this.form.items.username.model[2]}-${a}`),this.form.items.username.attrs.type="tel",this.signUpMode="phoneNumber";break}}if("phoneNumber"===this.signUpMode){this.vm=this.form.items.username.model[1]?this.form.items.username.model[1]:"";const e=this.form.items.username.model[2];-1===this.vm.indexOf("@")&&e&&!this.vm.startsWith("+")||(console.log("country",e),this.toEmail()),/^[0-9]*$/g.test(this.vm)||(console.log("not vm",JSON.stringify(this.vm)),this.toEmail())}},toPhone(){console.log("fn:toPhone"),this.form.items.username.model=[this.prefix,this.vm,this.countryCode],this.form.items.username.attrs.type="tel",this.signUpMode="phoneNumber"},toEmail(){console.log("fn:toEmail",this.vm,typeof this.vm),this.$nextTick((()=>{this.form.items.username.attrs.type="text",this.form.items.username.model=this.vm,console.log(this.form.items.username.model),this.signUpMode="email"}))},defPrefix(){const e=localStorage.getItem("def_tel_prefix");if(e){const t=e.split("-");this.prefix=t[1],this.countryCode=t[0]}else{const e=(this.$i18n.locale||navigator.language||"").toLowerCase(),t=Object.values(Lr["a"]).find((t=>t.languages.includes(e)));if(t&&t.phones&&t.phones.length){console.log("[Init Prefix] Init with phone",t.phones[0]);const e=t.phones[0].split("-");this.prefix=e[0],this.countryCode=e[1]}else console.log("[Init Prefix] Cannot find language config for",e,t),this.prefix="1",this.countryCode="US"}},prefixArr(){const e=[];Object.values(Lr["a"]).forEach((t=>{const n=t.phones[0].split("-");e.push(n)})),e.sort(((e,t)=>{const n=parseInt(e[0]),o=parseInt(t[0]);return n-o})),e.forEach((e=>{this.checkPrefix[0].push(e[0]),this.checkPrefix[1].push(e[1])}))},onPressBack(){this.toEmail(),console.log(this.form)},getSelection(){const e=this.$refs.sign[0];return e.$el.firstChild.clientWidth}},mounted(){this.defPrefix(),this.prefixArr()}},al=ol,sl=(n("fc65"),Object(g["a"])(al,Vr,Gr,!1,null,"6e4f640d",null)),il=sl.exports,rl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit([e.handleNecessary,e.handleOptional][e.progress])},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_sign_up_your_account")+" ("+(e.progress+1)+"/2)","submit-label":e.$t(["account_next","account_finish"][e.progress])},scopedSlots:e._u([{key:"description",fn:function(){return[e._v("\n "+e._s([e.$t("account_fill_required_fields"),e.description][e.progress])+"\n ")]},proxy:!0},{key:"default",fn:function(t){var o=t.disable,a=t.setDisable;return[0===e.progress?[n("div",{staticClass:"column q-col-gutter-xs"},[e._l({email:e.necessaryEmailForm,phoneNumber:e.necessaryPhoneNumberForm}[e.signUpMode].items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{onPressBack:function(n){return e.onPressBack(t)}},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v("\n "+e._s(e.$t({phoneNumber:"account_no_phone_number",email:"account_no_email"}[e.signUpMode]))),n("a",{staticClass:"underscore select-none text-primary cursor-pointer",attrs:{disabled:o},on:{click:function(t){o||e.handleSwitchMode()}}},[e._v(e._s(e.$t({phoneNumber:"account_sign_up_by_email",email:"account_sign_up_by_phone_number"}[e.signUpMode])))])])],2)]:1===e.progress?[e._l(e.verificationForm.items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{onPressBack:function(n){return e.onPressBack(t)}},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),n("div",[n("amplify-button",{staticClass:"q-mb-sm q-mt-xs",attrs:{value:o||e.resendTimer>0,"min-width":"100%",label:e.$t("account_resend_code")+(e.resendTimer>0?" ("+e.resendTimer+"s)":""),"on-click":e.handleResend},on:{input:a}}),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v("\n "+e._s(e.$t("account_no_verification_code"))),n("a",{staticClass:"underscore select-none text-primary cursor-pointer",attrs:{disabled:o},on:{click:function(t){o||e.handleSwitchMode()}}},[e._v(e._s(e.$t({phoneNumber:"account_sign_up_by_email",email:"account_sign_up_by_phone_number"}[e.signUpMode])))])])],1),n("div",[e._v("\n "+e._s(e.$t("account_fill_optional_fields"))+"\n "),e._l(e.optionsForm.items,(function(t,a){return["input"===t.type?n("amplify-input",e._b({key:a,staticClass:"q-mb-sm",attrs:{label:e.$t(t.bound.label),readonly:o,hint:"("+e.$t("optional")+")"},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1)):"select"===t.type?n("amplify-select",e._b({key:a,staticClass:"q-mb-sm",attrs:{readonly:o,hint:"("+e.$t("optional")+")",align:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-select",t.bound,!1)):e._e()]}))],2)]:e._e()]}},0===e.progress?{key:"options",fn:function(t){var o=t.disable;return[n("div",{staticClass:"col-grow q-mb-sm row items-center",staticStyle:{"margin-top":"-8px"}},[n("q-checkbox",{attrs:{disable:o,label:e.$t("account_i_accept")},model:{value:e.accept,callback:function(t){e.accept=t},expression:"accept"}}),n("div",{staticClass:"underscore select-none cursor-pointer text-primary",on:{click:function(){return o||e.handleShowLicense()}}},[e._v(e._s(e.$t("account_license_terms"))+"\n ")])],1)]}}:null],null,!0)},"amplify-card",e.scope.cardProps,!1))},ll=[],cl=n("9f21");function dl(e){const t=e.appVersion,n=e.userAgent;let o="unknown",a="";const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var i in s){var r=s[i];if(r.r.test(n)){o=r.s;break}}switch(/Windows/.test(o)&&(a=/Windows (.*)/.exec(o)[1],o="Windows"),o){case"Mac OS":case"Mac OS X":case"Android":a=/([\\.\\_\d]+)/.exec(n.substring(/(Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/.exec(n).index||12))[1];break;case"iOS":a=/OS (\d+)_(\d+)_?(\d+)?/.exec(t),a=a[1]+"."+a[2]+"."+(0|a[3]);break}return o+(a?" "+a:"")}class ul extends Jr["a"]{constructor(e){super({email:new Jr["b"]("",{type:"email",icon:"email",label:"account_email",rules:[el["a"].bind(e)]}),password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[el["d"].bind(e)]})})}}class hl extends Jr["a"]{constructor(e){super({phoneNumber:new Jr["b"](["86","","CN"],{type:"tel",icon:"phone",label:"account_phone_number",rules:[el["e"].bind(e)]}),password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[el["d"].bind(e)]})})}setDefault(e){var t;const n=null!==(t=Lr["b"][e])&&void 0!==t?t:Lr["b"]["en-us"],[o,a]=n.phones[0].split("-"),s=this.items.phoneNumber;return s.updateModel([o,s.value[1],a]),this}}class pl extends Jr["a"]{constructor(e){const t=[{value:"notSay",emoji:"🇼🇫",label:e.$t("account_not_say")},...Jr["c"].LOCALE_OPTIONS],n=(e,t)=>!!t.normalizedName&&(t.normalizedName.toLowerCase().indexOf(e.toLowerCase())>=0||t.label.toLowerCase().indexOf(e.toLowerCase())>=0);super({nickname:new Jr["b"]("",{type:"text",icon:"emoji_emotions",label:"account_nickname",rules:[el["c"].bind(e)]}),gender:new Jr["c"]("notSay",[{value:"notSay",icon:"elevator",label:e.$t("account_not_say")},{value:"female",icon:"female",label:e.$t("account_female")},{value:"male",icon:"male",label:e.$t("account_male")}]),birthday:new Jr["b"]("",{type:"date",icon:"cake"}),locale:new Jr["c"]("notSay",t,{filter:n})})}}var ml={name:"SignUp",mixins:[cl["a"]],props:{scope:Object},data(){return{resendInterval:null,resendTimer:0,progress:0,necessaryEmailForm:new ul(this),necessaryPhoneNumberForm:new hl(this).setDefault(this.$q.lang.getLocale().toLowerCase()),signUpMode:"phoneNumber",invitationForm:new Jr["a"]({invitationCode:new Jr["b"]("",{type:"text",icon:"verified",label:"account_invitation_code",rules:[el["b"].bind(this)]})}),accept:!1,verificationForm:new Jr["a"]({code:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})}),optionsForm:new pl(this),signUpIpAddress:"",defPrefix:[]}},computed:{description(){return this.$store.state.account.verification?{email:`${this.$t("account_email_sent_tip")}${this.$store.state.account.verification.destination}`,phone_number:`${this.$t("account_phone_sent_tip")}${this.$store.state.account.verification.destination}`}[this.$store.state.account.verification.type]:this.$t("account_tip_verified")}},watch:{signUpMode(e){const t=()=>{this.necessaryPhoneNumberForm.clearData().setDefault(this.$q.lang.getLocale().toLowerCase())},n=()=>{this.necessaryEmailForm.clearData()};({email:t,phoneNumber:n})[e]()},progress(e){e<0&&this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut")},resendTimer(e,t){0===t&&(this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=setInterval((()=>{0!==this.resendTimer?this.resendTimer-=1:(clearInterval(this.resendInterval),this.resendInterval=null)}),1e3))}},methods:{handleCancel(){this.progress=-1},async handleNecessary(){if(this.accept)try{if(Object(xn["isElectron"])()){const e=await fetch("https://api.ipify.org").then((e=>e.text()),(e=>{console.log("SignUp - Failed to get geo for",e.message)}));this.signUpIpAddress=e||""}const e=this.__getNecessaryPayload(),t=(()=>{const n=Object(Zr["s"])();if(e.email){const a=o(3e4),s=n(e.email);return Promise.race([s,a]).catch((e=>{console.log("sign up error >",e),Xr["a"].showNegative(e.message)})).finally((()=>{t.off(),a.cancel()})),s}{const e=Promise.resolve();return e.off=()=>{},e}function o(e){let t;const n=new Promise((n=>{t=()=>{clearTimeout(o),n(!1)};const o=setTimeout((()=>{n(!0)}),e)}));return n.cancel=t,n}})();await this.$store.dispatch("ACCOUNT_SIGN_UP_NECESSARY",e).catch((e=>{throw t.off(),e})),this.resendTimer=60,this.progress+=1}catch(e){Xr["a"].showNegative(e.message)}else Xr["a"].showNegative("you_need_to_accept_license_terms")},async handleOptional(){try{const{code:e}=this.verificationForm.formData;await this.$store.dispatch("ACCOUNT_SIGN_UP_VERIFICATION_CODE_SUBMIT",{code:e,optAttrs:{app_client:JSON.stringify({name:B.a.name,version:Object(qn["a"])("version")}),os:dl(navigator)||"unknown",...this.optionsForm.formData}}),await new Promise((e=>setTimeout(e,3e3))),Xr["a"].showPositive("signed_up")}catch(e){return Xr["a"].showNegative(e.message),!1}try{const e=this.$store.state.account.verification.username,t=this.$store.state.account.verification.password;return await this.$store.dispatch("ACCOUNT_SIGN_IN",{username:e,password:t}),this.$store.commit("ACCOUNT_UPDATE_VERIFICATION",null),this.$store.commit("ACCOUNT_UPDATE_STATE","signedIn"),!0}catch(e){this.$emit("setCurrentCard","signedOut"),Xr["a"].showNegative(e.message)}},async handleResend(){try{await this.$store.dispatch("ACCOUNT_SIGN_UP_VERIFICATION_CODE_RESEND"),Xr["a"].showPositive("code_has_been_resent")}catch(e){Xr["a"].showNegative(e.message)}finally{this.resendTimer=60}},handleSwitchMode(){1===this.progress&&(this.$store.commit("ACCOUNT_UPDATE_VERIFICATION",null),this.progress=0),this.signUpMode="email"===this.signUpMode?"phoneNumber":"email"},handleShowLicense(){this.showLicenseTermsNotice(!1)},async copyCode(){await navigator.clipboard.writeText("5EPD12NW3F"),this.$q("Test Invitation Code copied")},__getNecessaryPayload(){const e={email:this.necessaryEmailForm,phoneNumber:this.necessaryPhoneNumberForm}[this.signUpMode],t=e.formData,{invitationCode:n}=this.invitationForm.formData,{email:o,phoneNumber:a,password:s}=t,i={};return"email"===this.signUpMode?i.email=o:"phoneNumber"===this.signUpMode&&(i.phoneNumber="+"+a[0]+a[1],i.phoneNumberCountryCode=a[2]),i.password=s,i.invitationCode=n,i.appClient=JSON.stringify({name:B.a.name,version:Object(qn["a"])("version")}),i.signUpIpAddress=this.signUpIpAddress,i.os=dl(navigator)||"unknown",i},onPressBack(e){if(!e)return;const{attrs:t,model:n}=e;t&&"tel"===t.type&&Array.isArray(n)&&(console.log("isTel",n),this.$set(n,0,""),this.$set(n,2,""))}},mounted(){const e=localStorage.getItem("def_tel_prefix");if(e){const t=e.split("-");this.defPrefix=[t[1],"",t[0]],this.necessaryPhoneNumberForm.items.phoneNumber.model=[...this.defPrefix]}},beforeDestroy(){this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=null}},_l=ml,fl=(n("472b"),n("7498")),gl=Object(g["a"])(_l,rl,ll,!1,null,"dbc17096",null),bl=gl.exports;k()(gl,"components",{QCheckbox:fl["a"]});var yl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit([e.handleSearch,e.handleSubmit][e.progress])},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t(["account_find_your_account","account_reset_your_password"][e.progress]),"submit-label":e.$t(["account_search","account_submit"][e.progress])},scopedSlots:e._u([{key:"description",fn:function(){return[e._v("\n "+e._s([e.$t("account_enter_your_username"),e.verifyDescription][e.progress])+"\n ")]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return[n("div",{staticClass:"column q-col-gutter-xs"},e._l([e.searchForm,e.submitForm][e.progress].items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{input:e.onInput,onPressBack:e.onPressBack},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),1)]}},1===e.progress?{key:"actions",fn:function(t){var o=t.disable,a=t.setDisable;return[n("amplify-button",{attrs:{value:o||e.resendTimer>0,label:e.$t("account_resend_code")+(e.resendTimer>0?" ("+e.resendTimer+"s)":""),"on-click":e.handleSearch},on:{input:a}})]}}:null],null,!0)},"amplify-card",e.scope.cardProps,!1))},vl=[],wl=n("4027"),kl=wl["a"],Cl=Object(g["a"])(kl,yl,vl,!1,null,null,null),$l=Cl.exports,Sl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit(e.handleVerify)},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_verify_your_identity"),"submit-label":e.$t("account_next"),timeout:e.timeout},scopedSlots:e._u([{key:"description",fn:function(){return[e._v("\n "+e._s(e.verifyDescription)+"\n ")]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return[e._l(e.form.items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v(e._s(e.$t("account_can_not_mfa"))),n("a",{staticClass:"underscore text-primary q-ml-xs cursor-pointer",attrs:{disabled:o},on:{click:e.handleDisableMFA}},[e._v(e._s(e.$t("account_disable_mfa")))])])]}}])},"amplify-card",e.scope.cardProps,!1))},xl=[],Tl={name:"SignInConfirm",props:{scope:Object},data(){return{timeout:{duration:6e4,onTimeout:this.handleTimeout},form:new Jr["a"]({code:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})})}},computed:{verifyDescription(){return this.$store.state.account.verification?{email:`${this.$t("account_email_sent_tip")}${this.$store.state.account.verification.destination}`,phone_number:`${this.$t("account_phone_sent_tip")}${this.$store.state.account.verification.destination}`,software_token:`${this.$t("account_software_token_tip")}`}[this.$store.state.account.verification.type]:this.$t("account_tip_verified")}},methods:{async handleVerify(){try{const{code:e}=this.form.formData;return await this.$store.dispatch("ACCOUNT_MFA_SUBMIT",e),this.$store.commit("ACCOUNT_UPDATE_STATE","signedIn"),Xr["a"].showPositive("signed_in"),!0}catch(e){Xr["a"].showNegative(e.message),e.message.startsWith("Invalid session for the user")&&this.handleCancel()}},handleDisableMFA(){this.$emit("setCurrentCard","disableMFA")},handleTimeout(){Xr["a"].showNegative("Network Error")},handleCancel(){this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut")}}},Il=Tl,Pl=(n("2e34"),Object(g["a"])(Il,Sl,xl,!1,null,"654a46b2",null)),Ol=Pl.exports,ql=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit([e.handleSend,e.handleSubmit][e.progress])},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_disable_mfa"),"submit-label":e.$t("account_next")},scopedSlots:e._u([{key:"description",fn:function(){return[0===e.progress?n("div",[e._v(e._s(e.$t("account_tip_confirm_verify_email_phone")))]):1===e.progress&&e.verificationData?n("div",[e._v(e._s(e.$t("account_email_phone_sent_tip"))+"\n "),n("div",[e._v(e._s(e.verificationData.email.destination))]),n("div",[e._v(e._s(e.verificationData.phoneNumber.destination))])]):e._e()]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return[1===e.progress?e._l(e.form.items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})):e._e()]}}])},"amplify-card",e.scope.cardProps,!1))},El=[],Al={name:"DisableMFA",props:{scope:Object},data(){return{progress:0,verificationData:null,form:new Jr["a"]({emailCode:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]}),phoneCode:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})})}},watch:{progress(e){e<0&&(this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut"),this.$emit("setCurrentCard",null))}},methods:{async handleSend(){try{const{user:{username:e}}=this.$store.state.account.verification,t=`${this.$store.getters.settings.language}:D`;this.verificationData=await Object(Zr["j"])(e,{msgLocale:t}),this.progress+=1}catch(e){Xr["a"].showNegative(e.message)}},async handleSubmit(){try{const{user:{username:e}}=this.$store.state.account.verification,{emailCode:t,phoneCode:n}=this.form.formData;await Object(Zr["w"])(e,t,n),this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut"),Xr["a"].showPositive("disabled_mfa"),this.progress=-1}catch(e){Xr["a"].showNegative(e.message)}},handleCancel(){this.progress=-1}}},Dl=Al,Nl=Object(g["a"])(Dl,ql,El,!1,null,null,null),Ll=Nl.exports,jl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"corner-cancel":!1,"cancel-label":e.$t("account_cancel"),"submit-label":e.$t(["account_next","account_finish"][e.signUpProgress]),"on-submit":"loading"===e.currentTemplate?void 0:"signUp"===e.currentTemplate?function(){return e.scope.handleSubmit([e.handleSignUp,e.handleVerify][e.signUpProgress])}:void e.currentTemplate,"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_oauth_sign_in_with",{provider:e.provider})},scopedSlots:e._u([{key:"description",fn:function(){return["loading"===e.currentTemplate?[n("div",{staticClass:"text-center text-weight-bold text-subtitle1 q-mt-md"},[n("q-spinner",{staticClass:"q-mr-xs q-mb-xs",attrs:{size:"1.25em"}}),n("span",{staticClass:"q-pr-lg"},[e._v(e._s(e.$t("account_loading")))])],1)]:"signUp"===e.currentTemplate?[e.data?n("div",[0===e.signUpProgress?n("div",[e._v("\n "+e._s(e.$t("account_tip_oath_sign_up",{provider:e.data.providerName,email:e.data.providerInfo.email}))+"\n ")]):1===e.signUpProgress?n("div",[e._v("\n "+e._s(e.$t("account_email_sent_tip"))+e._s(e.data.providerInfo.email)+"\n ")]):e._e()]):e._e()]:e._e()]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return["signUp"===e.currentTemplate?e._l([e.signUpForm,e.verificationForm][e.signUpProgress].items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})):e._e()]}}])},"amplify-card",e.scope.cardProps,!1))},Rl=[],Ul=n("e74d"),Fl={name:"OAuth",props:{scope:Object},data(){return{provider:null,status:null,data:null,signUpProgress:0,signUpUsername:null,signUpForm:new Jr["a"]({password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[el["d"].bind(this)]}),invitationCode:new Jr["b"]("",{type:"text",icon:"verified",label:"account_invitation_code",rules:[el["b"].bind(this)]})}),verificationForm:new Jr["a"]({code:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})})}},computed:{currentTemplate(){return"confirm"===this.status?"confirm":"signUp"===this.status?"signUp":["pending","requesting","success"].includes(this.status)?"loading":void 0}},watch:{status(e){if(!e)return;const t={pending:()=>this.handlePending(),requesting:()=>this.handleRequesting(),success:()=>this.handleSuccess(),signUp:()=>{},confirm:()=>{}};t[e]&&t[e]()}},methods:{async copyCode(){await navigator.clipboard.writeText("5EPD12NW3F"),this.$q("Test Invitation Code copied")},setStatus(e,t,n){t&&(this.provider=t),n&&(this.data=n),this.status=e},handleCancel(){this.provider=null,this.status=null,this.data=null,this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut"),this.$emit("setCurrentCard",null)},async handleSuccess(){await this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX"),this.provider=null,this.status=null,this.data=null,"signedIn"===this.$store.state.account.authState?(this.$emit("closeDialog"),Xr["a"].showPositive("signed_in")):(this.$emit("setCurrentCard",null),Xr["a"].showNegative("sign_in_failed"))},handlePending(){Ul["a"].launchOAuth("signedOut",{provider:this.provider})},handleRequesting(){},async handleSignUp(){try{const e={oauthSignUp:"true",oauthData:JSON.stringify({providerName:this.data.providerName,providerUserId:this.data.providerUserId}),email:this.data.providerInfo.email},t=await Object(Zr["o"])({...e,...this.signUpForm.formData});this.signUpUsername=t.user.username,this.signUpProgress=1}catch(e){Xr["a"].showNegative(e.message),this.handleCancel()}},async handleVerify(){try{const e={oauthSignUp:"true",oauthData:JSON.stringify({providerName:this.data.providerName,providerUserId:this.data.providerUserId})},{code:t}=this.verificationForm.formData;await Object(Zr["c"])(this.signUpUsername,t,{},e),this.setStatus("pending")}catch(e){Xr["a"].showNegative(e.message),this.handleCancel()}},async handleConfirm(){}}},Ml=Fl,Bl=Object(g["a"])(Ml,jl,Rl,!1,null,"6bc0e027",null),Ql=Bl.exports;k()(Bl,"components",{QSpinner:we["a"]});var Wl=n("d884"),zl=n("39df"),Hl={name:"SignedOutDialog",components:{OAuth:Ql,DisableMFA:Ll,SignInConfirm:Ol,SignIn:il,ForgotPassword:$l,SignUp:bl,Development:zl["default"]},data(){return{showDevDialog:!1,currentCard:null,value:!1,languageOptions:Wl["a"]}},computed:{cardEvents(){return{setCurrentCard:this.setCurrentCard,closeDialog:()=>this.value=!1}},_currentCard(){if(this.currentCard)return this.currentCard;const e=["signedOut","forgotPassword","signUp","signInConfirm"];return e.includes(this.$store.state.account.authState)?this.$store.state.account.authState:null},language:{get(){const e=S["a"].getters.settings.language,t=this.languageOptions.find((t=>t.value===e));return t?t.label:e},set(e){const t=e.value||e;if("string"===typeof t&&(S["a"].dispatch("updateSettings",{language:t}),this.$i18n.locale=t,Object(xn["isElectron"])())){const{ipcRenderer:e}=n("b052");e.send("change-app-i18n",t),e.send("set_settings",{language:t})}}}},watch:{_currentCard(e){null===e&&!1!==this.value&&(this.value=!1)}},methods:{showAboutDialog(){xn["Bus"].$emit("CALL_ABOUT")},handleDevClick(){this.showDevDialog=!this.showDevDialog},setCurrentCard(e,t){this.currentCard=e,t&&e&&this.$nextTick((()=>t(this.$refs[e]))),t&&!e&&this.$nextTick((()=>t(null)))},async onClear(){this.currentCard=null,console.log("SignedOut Dialog Close: AuthState =>",this.$store.state.account.authState)},show(e){this.value=e}}},Vl=Hl,Gl=(n("1cda"),n("a829")),Kl=n("719b"),Yl=n("a431"),Jl=Object(g["a"])(Vl,zr,Hr,!1,null,null,null),Xl=Jl.exports;k()(Jl,"components",{QBtn:le["a"],QTooltip:Ct["a"],QDialog:y["a"],QSpace:re["a"],QSeparator:ce["a"],QMenu:Gl["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"],QColor:X["a"]}),k()(Jl,"directives",{Ripple:Kl["a"],ClosePopup:Yl["a"]});const Zl={watch:{"$store.state.account.authState"(e,t){this.$ga.send("auth_state_change",{from:t,to:e}),t?("signedIn"===e||"signedOut"===e&&"signedIn"===t)&&this.$emit("auth_state_changed",e):this.$emit("auth_state_changed",e)}},methods:{addOnAuthStateChangedListener(e,{once:t}={}){const n=(...o)=>{t&&this.$off("auth_state_changed",n),e(...o)};return this.$on("auth_state_changed",n),()=>this.$off("auth_state_changed",n)}}},ec={name:"AmplifyDialogGroups",components:{SignedOutDialog:Xl},mixins:[Zl],mounted(){new URL(location.href).pathname.startsWith("/oauth_redirect")||this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX")},methods:{showSignedOut(){this.$refs.signedOut.show(!0)}}};let tc;const nc={install(e,{app:t}){const n="amplify-dialog-groups";if(!document.getElementById(n)){const e=document.createElement("div");e.id=n,document.body.appendChild(e)}const{i18n:o,router:a,store:s}=t;tc=new(e.extend({i18n:o,router:a,store:s,...ec}))({propsData:{}}).$mount("#"+n)},create$amplify(){return{showSignedOutDialog:()=>tc.showSignedOut(),addOnAuthStateChangedListener:(e,t)=>tc.addOnAuthStateChangedListener(e,t)}}};var oc=ec,ac=oc,sc=Object(g["a"])(ac,Qr,Wr,!1,null,null,null);sc.exports;const ic={async install(e,{app:t}){Br(e);const n=[nc];Promise.all(n.map((n=>n.install(e,{app:t})))),Object.defineProperty(e.prototype,"$amplify",{get(){const e={},t=t=>{for(const[n,o]of Object.entries(t))e[n]=o};return n.forEach((e=>t(e.create$amplify.apply(this)))),e}})}},rc={aws_project_region:"us-east-1",aws_mobile_analytics_app_id:"4f8fe8282ebf40e4a390c2171e3e45df",aws_mobile_analytics_app_region:"us-east-1",aws_appsync_graphqlEndpoint:"https://ye6kerar5bb65jpjrhlum4gu7q.appsync-api.us-east-1.amazonaws.com/graphql",aws_appsync_region:"us-east-1",aws_appsync_authenticationType:"AMAZON_COGNITO_USER_POOLS",aws_appsync_apiKey:"da2-o7saok2xsbby5nqi2womjyd5ie",aws_cloud_logic_custom:[{name:"ABDevRest",endpoint:"https://6xf9ehebfj.execute-api.us-east-1.amazonaws.com/dev",region:"us-east-1"}],aws_cognito_identity_pool_id:"us-east-1:425781a9-0178-4dbd-b103-1d2e5e210d1a",aws_cognito_region:"us-east-1",aws_user_pools_id:"us-east-1_NbEkBdIqw",aws_user_pools_web_client_id:"1o6c32oh82hjqvd8hfora67lap",oauth:{domain:"ab-domain-dev.auth.us-east-1.amazoncognito.com",scope:["phone","email","openid","profile","aws.cognito.signin.user.admin"],redirectSignIn:"http://localhost:8080/",redirectSignOut:"http://localhost:8080/",responseType:"code"},federationTarget:"COGNITO_USER_POOLS",aws_cognito_login_mechanisms:["EMAIL","PREFERRED_USERNAME","PHONE_NUMBER"],aws_cognito_signup_attributes:[],aws_cognito_mfa_configuration:"OFF",aws_cognito_mfa_types:["SMS"],aws_cognito_password_protection_settings:{passwordPolicyMinLength:8,passwordPolicyCharacters:["REQUIRES_NUMBERS"]},aws_cognito_verification_mechanisms:["EMAIL"],aws_cognito_username_attributes:[],aws_cognito_social_providers:[]};var lc=rc,cc=n("3334"),dc=n("0cdb"),uc=n("586d");class hc{constructor(){this.events={}}$on(e,t){return this.events[e]=this.events[e]||[],this.events[e].includes(t)||this.events[e].push(t),()=>this.$off(e,t)}$once(e,t){return t.once=!0,this.$on(e,t)}$off(e,t){if(t){if(!this.events[e])return;if(!this.events[e].includes(t))return;const n=this.events[e].indexOf(t);this.events[e].splice(n,1)}else this.events[e]=[]}async $emit(e,...t){if(!this.events[e])return;const n=[].concat(this.events[e]);let o=0;while(o{const o=a[(t+1)%2],s=[`background-color: ${o.bgc}`,`color: ${o.color}`];return s.push("padding: 2px 12px"),0===t&&s.push("border-top-left-radius: 8px","border-bottom-left-radius: 8px"),t===n.length-1&&s.push("border-top-right-radius: 8px","border-bottom-right-radius: 8px"),s.join("; ")})),i=n.map((e=>`%c${e}`)).join("");console[o](i,...s,...t)},_c={log:{type:"log"},warn:{type:"warn"},error:{type:"error"},red:{styles:[{bgc:"rgb(248,160,160)",color:"black"},{bgc:"rgb(134,12,12)",color:"white"}]},orange:{styles:[{bgc:"rgb(248,191,160)",color:"black"},{bgc:"rgb(175,81,6)",color:"white"}]},green:{styles:[{bgc:"rgb(160,248,161)",color:"black"},{bgc:"rgb(35,154,17)",color:"white"}]},purple:{styles:[{bgc:"rgb(200,184,255)",color:"black"},{bgc:"rgb(44,31,162)",color:"white"}]},blue:{styles:[{bgc:"rgb(184,215,255)",color:"black"},{bgc:"rgb(31,107,162)",color:"white"}]},tags:e=>(...t)=>(e.options.tags=e.options.tags||[],e.options.tags.push(...t),fc(e))},fc=e=>new Proxy(e,{get(e,t,n){if("options"===t)return e.options||void 0;if(!Object.keys(_c).includes(t))return;const o=(...e)=>mc(o.options,...e);return o.options={},Object.assign(o.options,JSON.parse(JSON.stringify(e.options||{}))),"function"===typeof _c[t]?_c[t](o):(Object.assign(o.options,_c[t]),fc(o))}}),gc=fc(mc);Object.defineProperties(mc,Object.keys(_c).reduce(((e,t)=>(e[t]={get(){return gc[t]}},e)),{}));var bc=mc;const yc={};class vc{static appendOperation(e){const t=e.trim().match(/^[\w]+[ \f\r\t\n]+[\w]+/)[0].split(" ").reverse()[0],n=t.replace(t.charAt(0),t.charAt(0).toLowerCase());return yc[n]=e,this}static appendOperations(e){return Array.isArray(e)?e.forEach(this.appendOperation):Object.entries(e).forEach((([e,t])=>{yc[e]=t})),this}static createObservable(e,...t){const n=this.__getOperation(e),o=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));let a;o(n).forEach(((e,n)=>{const o=t[n];void 0!==o&&(a||(a={}),a[e]=o)}));const s=Un["a"].graphql({query:n,variables:a});return s.name=e,s}static subscribe(e,t,n=console.error){return e.subscribe({next:({provider:n,value:o})=>{var a;return t(null===(a=o.data)||void 0===a?void 0:a[e.name],n)},error:({provider:e,error:t})=>n(t.errors,e)})}static __getOperation(e){if(!yc[e])throw new Error("operation not found");return yc[e]}static async execute(e,t){const n=this.__getOperation(e),o=await Un["a"].graphql({query:n,variables:t});if(o.errors)throw new Error(o.errors[0].message);return o.data[e]}static injectAllOperations(e){const t=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));return Object.entries(yc).forEach((([n,o])=>{e[n]=async(...e)=>{let a;return t(o).forEach(((t,n)=>{const o=e[n];void 0!==o&&(a||(a={}),a[t]=o)})),await this.execute(n,a)}})),e}}class wc extends vc{static async subscribeWithRetry(e,t,n,o){const a=(...e)=>{let t,n,o;"string"===typeof e[0]?(t={warn:[{bgc:"rgb(250,211,138)",color:"black"},{bgc:"rgb(155,123,53)",color:"white"}]}[e[0]],n=e[1],o=e.slice(2)):(t=[{bgc:"rgb(166,138,250)",color:"black"},{bgc:"rgb(44,31,162)",color:"white"}],n=e[0],o=e.slice(1));const a=e=>`background-color: ${e.bgc}; color: ${e.color}; padding: 2px 12px;`,s=Array.from(n,((e,o)=>{let s=a(t[(o+1)%2]);return 0===o?s+=" border-top-left-radius: 8px; border-bottom-left-radius: 8px;":o===n.length-1&&(s+=" border-top-right-radius: 8px; border-bottom-right-radius: 8px;"),s})),i=n.map((e=>`%c${e}`)).join("");console.log(i,...s,...o)},{times:s,duration:i,onFetchData:r,onUpdateSubscriber:l}={times:-1,duration:1e4,onFetchData:()=>{},onUpdateSubscriber:()=>{throw new Error("Your should config onUpdateSubscriber for the subscribeWithRetry method")},...o};let c=!0,d=0;const u=new Error("The number of retries exceeds the maximum"),h=e=>new Promise((t=>setTimeout(t,e))),p=async e=>{if(c=!0,s>0&&d>s)return console.warn(u),void a(["GQL","Websocket"],"failed to reconnect",u);const t=Math.min(i,1e3*Math.pow(2,d));a(["GQL","Websocket"],"connect close: ",`waiting for reconnect (${t}ms)`),await h(t),c?(d+=1,a(["GQL","Websocket"],`Attempt to reconnect (${d})`),await e(),d=0,a(["GQL","Websocket"],"reconnected")):a(["GQL","Websocket","enableRetry === false"],c)},m=async()=>{const n=(e,t)=>{const n=["AppSync Realtime subscription init error: No current user"],o=["Connection closed","Timeout disconnect"];e.some((e=>n.includes(e.message)))?a(["GQL","Websocket"],"Skip",e):(e.some((e=>o.includes(e.message)))?a(["GQL","Websocket"],"Connect Error"):a(["GQL","Websocket"],"Connect Error: 179",e),p(m))};try{d>=0&&r&&await r();const o=wc.subscribe(e,t,n),a=o.unsubscribe;o.unsubscribe=function(){return c=!1,a.apply(this)},await l(o)}catch(o){a(["GQL","Websocket"],"Connect Error :191",o),await p(m)}};await m()}}class kc{static createSyncDataSubscriber(e,t,n,o=console.error){return new kc(e,t,o,n)}constructor(e,t,n,o){this.observable=e,this.onUpdate=t,this.onError=n,this.onFetchData=o,this.subscriber=null}async enable(){const e=e=>{this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=e};await wc.subscribeWithRetry(this.observable,this.onUpdate,this.onError,{times:-1,duration:3e4,onUpdateSubscriber:e,onFetchData:this.onFetchData})}disable(){this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=null}}class Cc{constructor(){this.id=null,this.observable=null,this.subscriber=null,this.listeners={}}async enable(e){this.disable(),this.id=e,this.observable=wc.createObservable("onGeneralUpdate",this.id);const t=e=>{const{channel:t,data:n}=e;if(!this.listeners[t])return;let o;try{o=JSON.parse(n)}catch(a){o=n}this.listeners[t].forEach((e=>e(o)))},n=async()=>{const e=Object.values(this.listeners).map((e=>e.map((e=>e.fetchData)))).flat(1).filter((e=>void 0!==e));return await Promise.all(e.map((e=>e())))};this.subscriber=kc.createSyncDataSubscriber(this.observable,t,n),await this.subscriber.enable()}disable(){this.listeners={},this.subscriber&&(this.subscriber.disable(),this.subscriber=null),this.observable=null,this.id=null}addListener(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t),n&&t.fetchData!==n&&(t.fetchData=n)}removeListener(e,t){const n=t||"string"===typeof e?e:void 0;t=t||"string"!==typeof e?t:void 0,n&&!this.listeners[n]||(n&&t?this.listeners[n]=this.listeners[n].filter((e=>e!==t)):n&&!t?this.listeners[n]=void 0:Object.keys(this.listeners).forEach((e=>{this.listeners[e].includes(t)&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)))})))}}const $c=new Cc,Sc=new Cc;var xc={config({queries:e,mutations:t,subscriptions:n}){wc.appendOperations(e),wc.appendOperations(t),wc.appendOperations(n)},enableUserListener:async e=>await $c.enable(e),disableUserListener:()=>$c.disable(),addUserListener:(e,t,n)=>$c.addListener(e,t,n),removeUserListener:(e,t)=>$c.removeListener(e,t),enablePublicListener:async()=>await Sc.enable("*"),disablePublicListener:()=>Sc.disable(),addPublicListener:(e,t,n)=>Sc.addListener(e,t,n),removePublicListener:(e,t)=>Sc.removeListener(e,t)};class Tc{constructor(e){this.apiName=e}async __call__(e,t,n){const o=await Un["a"][e](this.apiName,t,n).catch((e=>{if(e.response&&e.response.data)return e.response.data;throw e}));if(o.stack){const e=new Error(o.message);throw e.name=o.name,e.stack=o.stack,e}return o}async __post__(e,t,n){t||(t={}),"string"===typeof e&&(e=e.split("/").filter((e=>""!==e)));const o=n?["authorized"]:[];o.push(...e);const a=n?{Authorization:n}:{};return await this.__call__("post",`/${o.join("/")}`,{body:t,headers:{...a}})}async postGuest(e,t){return await this.__post__(e,t)}async post(e,t,n){if(!n){const e=await Ul["a"].currentSession();n=e.getIdToken().getJwtToken()}return await this.__post__(e,t,n)}get endpoint(){return Un["a"]._options.aws_cloud_logic_custom.find((e=>e.name===this.apiName)).endpoint}}const Ic=new Tc("ABDevRest");var Pc=function(e,t){return u["a"].create({component:{render(n){return n(y["a"],{ref:"dialog",props:{persistent:!0},on:{hide:()=>this.$emit("hide")}},[n(e,t)])},methods:{show(){this.$refs.dialog.show()},hide(){this.$refs.dialog.hide()}}}})},Oc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{directives:[{name:"touch-pan",rawName:"v-touch-pan.prevent.mouse",value:e.handleTouchPan,expression:"handleTouchPan",modifiers:{prevent:!0,mouse:!0}}],ref:"card",staticClass:"fixed",staticStyle:{"min-width":"280px"},style:{left:this.left+"px",top:this.top+"px"}},[n("q-card-section",{staticClass:"q-py-none q-pr-none flex"},[n("div",[e._v("Floating")]),n("q-space"),n("q-btn",{staticStyle:{width:"32px","border-radius":"0"},attrs:{icon:"close",flat:"",size:"xs"},on:{click:function(t){return e.$emit("close")}}})],1),n("q-separator"),n("q-card-section",{staticClass:"q-pa-none"},[e._t("default")],2)],1)},qc=[];const Ec={data(){return{observer:null,containerRect:null,contentRect:null}},mounted(){let e=!0;this.observer=new ResizeObserver((t=>{for(const e of t)e.target===document.body?this.containerRect=e.contentRect:e.target===this.$refs.card.$el&&(this.contentRect=e.contentRect);e&&(e=!1,this.left=(this.containerRect.width-this.contentRect.width)/2,this.top=(this.containerRect.height-this.contentRect.height)/2),this.updatePosition(this.left,this.top)})),this.observer.observe(document.body),this.observer.observe(this.$refs.card.$el)},beforeDestroy(){this.observer.unobserve(document.body),this.observer.unobserve(this.$refs.card.$el)}};var Ac={name:"Floating",mixins:[Ec],data(){return{left:0,top:0}},methods:{handleTouchPan({delta:e}){this.containerRect&&this.contentRect&&this.updatePosition(this.left+e.x,this.top+e.y)},updatePosition(e,t){const n=8;this.left=Math.max(n,Math.min(e,this.containerRect.width-this.contentRect.width-n)),this.top=Math.max(n,Math.min(t,this.containerRect.height-this.contentRect.height-n))}}},Dc=Ac,Nc=Object(g["a"])(Dc,Oc,qc,!1,null,"286e971c",null),Lc=Nc.exports;k()(Nc,"components",{QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QBtn:le["a"],QSeparator:ce["a"]}),k()(Nc,"directives",{TouchPan:de["a"]});var jc=e=>t=>{let n;n=e.utils.createVueInstance({render(e){const o=()=>{n.$destroy(),n.$el.remove(),n=null};return e(Lc,{on:{close:o}},[e(t)])}},!0);const o=document.createElement("div");return document.body.append(o),n.$mount(o),n},Rc={negative(e){return d["a"].create({type:"negative",message:e,position:"bottom-right",timeout:5e3})},positive(e){return d["a"].create({type:"positive",message:e,position:"bottom-right",timeout:5e3})}};const Uc=e=>t=>{Object.entries(t).forEach((([t,n])=>{e.core[t]||(e.core[t]=n.bind(e))}))},Fc=({Vue:e,app:t})=>(n,o=!1)=>{if(o){const{i18n:o,router:a,store:s}=t;return new(e.extend({i18n:o,router:a,store:s}))(n)}return new e(n)},Mc=e=>{const t=new Map;return n=>{const o=(n,o)=>{Object.defineProperty(e.view,n,{get(){return t.has(n)?t.get(n):o.bind(e)},set(e){if(void 0===e||null===e){var o;if(!t.has(n))return;const e=t.get(n);t.delete(n),null===(o=e.view$destroy)||void 0===o||o.call(e)}else t.set(n,e)}})};Object.entries(n).forEach((([e,t])=>o(e,t)))}},Bc=new hc,Qc=bc.orange.tags("Account"),Wc={config:({queries:e,mutations:t,subscriptions:n})=>xc.config({queries:e,mutations:t,subscriptions:n}),enable:()=>xc.enablePublicListener(),disable:()=>xc.disablePublicListener(),addListener:(...e)=>xc.addPublicListener(...e),removeListener:(...e)=>xc.removePublicListener(...e)};var zc=(e,{app:t},n)=>({injectToCore:Uc(n),createVueInstance:Fc({Vue:e,app:t}),injectToView:Mc(n),emit:(...e)=>Bc.$emit(...e),on:(...e)=>Bc.$on(...e),off:(...e)=>Bc.$off(...e),once:(...e)=>Bc.$once(...e),logger:Qc,ABDevRest:Ic,sync:Wc,showInDialog:Pc,showInFloating:jc(n),notify:Rc});class Hc{static create(e,t){const n=new this(e);return Object.assign(n,t)}constructor(e){this.NAME=e}onCreateCore(e,t,n){return{}}onConfigure(e,t,n){}onCreateStoreMixin(e,t,n){return{}}onRegisterView(e,t,n){return{}}}class Vc{constructor(e){this.NAME=e,this[e]={}}get context(){return this[this.NAME]}onConfigure(e){Object.assign(this.context,{config:{},utils:null,core:{},store:null,view:{}}),window.$alphabiz=window.$alphabiz||{},window.$alphabiz[this.NAME]=window.$alphabiz[this.NAME]||this.context}onInstallUtils(e,t){Object.assign(this.context,{utils:zc(e,t,this.context)}),Object.assign(this.context,{$emit:this.context.utils.emit,$on:this.context.utils.on,$once:this.context.utils.once,$off:this.context.utils.off,$logger:this.context.utils.logger})}useExtensions(e,t,n){const o=(e,t)=>t instanceof Hc?t:Hc.create(e,t),a=Object.entries(e).map((([e,t])=>o(e,t))),s={mixins:[]},i=[e=>this.context.utils.injectToCore(e.onCreateCore(t,n,this.context)),e=>e.onConfigure(t,n,this.context),e=>s.mixins.push(e.onCreateStoreMixin(t,n,this.context)),e=>this.context.utils.injectToView(e.onRegisterView(t,n,this.context))];i.forEach((e=>a.forEach(e))),this.context.store=this.context.utils.createVueInstance(s,!0)}exportAsVuePlugin(){const e=e=>{const t=this.context;Object.defineProperty(e.prototype,this.NAME,{get(){const e=this,n=["$test"],o=new Proxy(t,{get(t,o,a){if(!n.includes(o))return Reflect.get(t,o,a);const s=Reflect.get(t,o,a);return Object.keys(s).reduce(((t,n)=>({...t,[n]:s[n].bind(e)})),{})}});return o}})};return(t,n)=>{this.onConfigure(),e(t),this.onInstallUtils(t,n),this.useExtensions(n.extensions,t,n)}}}var Gc={createExtension:Hc.create.bind(Hc),PluginInstaller:e=>new Vc(e)};let Kc=!1;var Yc={async signInPage(){const e=(e,t)=>{this.$account.view.SignInPage._isVue?this.$account.view.SignInPage.updateCard(e,t):this.$account.view.SignInPage({card:e,props:t})};Kc?await e("SignInCard",{}):(Kc=!0,this.$watch((()=>this.$account.store.authState),(async t=>{"pending"===t?(await e("LoadingCard",{title:"auth_state.pending"}),await new Promise((e=>setTimeout(e,1e3))),await this.$account.store.tryToSignInCurrentAccount()):"signed_out"===t&&await e("SignInCard",{})}),{immediate:!0}))}},Jc=n("35f4"),Xc=n("02fe"),Zc=n.n(Xc);async function ed({email:e,phone_number:t,phone_number_code:n,password:o},{language:a}){const s={username:Object(Jc["a"])("1234567890abcdefghijklmnopqrstuvwxyz",20)().toLowerCase(),password:o,attributes:{},clientMetadata:{}},i=()=>{if(e)Object.assign(s.attributes,{email:e});else{if(!t)throw new Error("Invalid signup params");Object.assign(s.attributes,{phone_number:t,"custom:phone_number_code":n})}Object.assign(s.attributes,{"custom:msg_locale":`${a}:${s.attributes.email?"E":"P"}`})},r=()=>{Object.assign(s.clientMetadata,{})};i(),r();const{userSub:l,user:c,codeDeliveryDetails:{DeliveryMedium:d,AttributeName:u,Destination:h}}=await Ul["a"].signUp(s),{ABDevRest:p}=this.utils;return await p.postGuest("/account/postSignUp",{sub:l,username:s.username,keychainMetadataHash:Zc.a.SHA256(o).toString(),isTestEnv:window.isTestEnv,invitationCode:s.clientMetadata.invitationCode}),{userSub:l,user:c,codeDeliveryDetails:{DeliveryMedium:d,AttributeName:u,Destination:h}}}async function td(e){const{CodeDeliveryDetails:{DeliveryMedium:t,AttributeName:n,Destination:o}}=await Ul["a"].resendSignUp(e);return{codeDeliveryDetails:{DeliveryMedium:t,AttributeName:n,Destination:o}}}async function nd(e,t,{nickname:n,gender:o,birthday:a,locale:s}){const i={};Object.assign(i,{optionalAttributes:JSON.stringify({nickname:n,gender:o,birthday:a,locale:s})}),Object.assign(i,{}),await Ul["a"].confirmSignUp(e,t,{clientMetadata:i})}async function od(e){const{ABDevRest:t}=this.utils,n=await Ul["a"].currentAuthenticatedUser();await Ul["a"].changePassword(n,e,e),await t.post("/admin/deleteAccount")}var ad={signUp:ed,signUpResend:td,signUpConfirm:nd,deleteAccount:od};async function sd(){const e=await Ul["a"].currentAuthenticatedUser();return e?0===Object.keys(e).length?null:e:null}async function id(e,t,{handleConfirm:n}){const o=async()=>{let o;e=e.toLowerCase();try{const n={};await this.$emit("signIn.createClientMetadata",n),o=await Ul["a"].signIn(e,t,n)}catch(a){if("UserNotConfirmedException"===a.code)return await n();throw a}if(o.challengeName){const n={};await this.$emit("signIn.createChallengeHandlers",n);const a=n[o.challengeName];if(!a)throw new Error("Unexpected challenge: "+o.challengeName);return await a(e,t,o)}return!0},a=await o();if(a){const{ABDevRest:e}=this.utils;await e.post("/account/postSignIn",{keychainMetadataHash:Zc.a.SHA256(t).toString()})}return a}var rd={signIn:id,getCurrentAuthedUser:sd};async function ld(){await Ul["a"].signOut()}var cd={signOut:ld};async function dd(e,t){const{ABDevRest:n}=this.utils,o=await Ul["a"].currentAuthenticatedUser();await n.post("/account/changePassword",{username:o.getUsername(),AccessToken:o.signInUserSession.getAccessToken().getJwtToken(),PreviousPassword:e,ProposedPassword:t})}async function ud(e,{language:t}){e=e.toLowerCase();const n={msgLocale:`${t}:F`},{CodeDeliveryDetails:{AttributeName:o,Destination:a}}=await Ul["a"].forgotPassword(e,n);return{codeDeliveryDetails:{AttributeName:o,Destination:a}}}async function hd(e,{code:t,password:n}){const{ABDevRest:o}=this.utils;await o.postGuest("/account/forgotPasswordSubmit",{ClientId:Ul["a"].userPool.getClientId(),ConfirmationCode:t,Password:n,Username:e})}async function pd(e){const t=await Ul["a"].currentAuthenticatedUser(),n=["nickname","gender","birthday","locale"];await Ul["a"].updateUserAttributes(t,n.reduce(((t,n)=>{const o=e[n];return void 0!==o&&(t[n]=o),t}),{}))}var md={changePassword:dd,forgotPasswordSend:ud,forgotPasswordSubmit:hd,changeAttributes:pd};let _d=null;async function fd(e,t){const n=`${e}:${t}`;if(_d===n)return;const o=await Ul["a"].currentAuthenticatedUser();await Ul["a"].updateUserAttributes(o,{"custom:msg_locale":n}),_d=n}async function gd(e,{language:t}){await fd(t,{email:"E",phone_number:"P"}[e]),await Ul["a"].verifyCurrentUserAttribute(e)}async function bd(e,t){const{ABDevRest:n}=this.utils,o=await Ul["a"].verifyCurrentUserAttributeSubmit(e,t);await n.post("/account/postVerifyAttr",{success:"SUCCESS"===o})}async function yd(e,{language:t}){const{ABDevRest:n}=this.utils;e=e.toLowerCase();const o=await Ul["a"].currentAuthenticatedUser();e===o.attributes.email?await gd("email",{language:t}):(await fd(t,"E"),await n.post("/account/setVerifyAttr",{email:e}))}async function vd(e,t,{language:n}){const{ABDevRest:o}=this.utils,a=await Ul["a"].currentAuthenticatedUser();e&&t&&e===a.attributes.phone_number&&t===a.attributes["custom:phone_number_code"]?await gd("phone_number",{language:n}):(await fd(n,"P"),await o.post("/account/setVerifyAttr",{phone_number:{phoneNumber:e,phoneNumberCountryCode:t}}))}async function wd(e){return await bd("email",e)}async function kd(e){return await bd("phone_number",e)}var Cd={verifyFieldSend:gd,verifyFieldSubmit:bd,changeEmailSend:yd,changeEmailSubmit:wd,changePhoneNumberSend:vd,changePhoneNumberSubmit:kd},$d=n("bbb3"),Sd=(e,t,n)=>{$d["default"].configure({...t.awsconfig,aws_cognito_mfa_configuration:"OPTIONAL",aws_cognito_mfa_types:["SMS"]}),Ul["a"].configure({authenticationFlowType:"CUSTOM_AUTH"}),n.utils.sync.config(t.gql)};function xd(){return this.$store.getters.settings.language}const Td={created(){this.$account.$on("authState.authorized",(async()=>{await this.$account.view.SignInPage.updateCard("LoadingCard",{title:"auth_state.authorized"}),await this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX")}))}},Id={async onSignIn(){["pending","signed_out"].includes(this.authState)&&(this.authState="authorized",await this.$account.$emit("authState.authorized")),this.authState="signed_in",await this.$account.$emit("authState.signedIn")},async onSignOut(){"signed_in"===this.authState&&(this.authState="sign_out",await this.$account.$emit("authState.signOut")),this.authState="signed_out",await this.$account.$emit("authState.signedOut")}};var Pd={mixins:[Td],data(){return{authState:"pending"}},methods:{async signIn(e,t){const n=await this.$account.core.signIn(e,t,{handleConfirm:()=>{throw new Error("UserNotConfirmedException")}});if(n){const e=await this.$account.core.getCurrentAuthedUser();await Id.onSignIn.call(this,e)}return n},async signOut(){await this.$account.core.signOut(),await Id.onSignOut.call(this)},async deleteAccount(e){await this.$account.core.deleteAccount(e),await this.signOut()},async tryToSignInCurrentAccount(){const e=["The user is not authenticated"];let t;try{if(t=await this.$account.core.getCurrentAuthedUser(),!t)throw"user is null"}catch(n){if(e.includes(n))return void await Id.onSignOut.call(this);throw this.$account.$logger.tags("SignInFlow","pending","rejected").warn(n,typeof n),n}await Id.onSignIn.call(this,t)}}},Od={methods:{async signUp({email:e,phone_number:t,phone_number_code:n,password:o},{requireConfirm:a}){const s=await this.$account.core.signUp({email:e,phone_number:t,phone_number_code:n,password:o},{language:xd.call(this)}),i=await a({data:s,resend:async()=>{await this.$account.core.signUpResend(s.user.getUsername())},callback:async(e,t)=>{await this.$account.core.signUpConfirm(s.user.getUsername(),e,t)}});return i}}},qd={methods:{async forgotPassword(e,{requireCode:t}){const n=await this.$account.core.forgotPasswordSend(e,{language:xd.call(this)}),o=await t({data:n,callback:async(t,n)=>{await this.$account.core.forgotPasswordSubmit(e,{code:t,password:n})}});return o},async changePassword(e,t){await this.$account.core.changePassword(e,t)}}},Ed={methods:{async changeEmail(e,{requireCode:t}){const n=async()=>{const t=xd.call(this);await this.$account.core.changeEmailSend(e,{language:t})};await n(),await t({resend:async()=>{await n()},callback:async e=>{await this.$account.core.changeEmailSubmit(e)}})},async changePhoneNumber({phone_number:e,phone_number_code:t},{requireCode:n}){const o=async()=>{const n=xd.call(this);await this.$account.core.changePhoneNumberSend(e,t,{language:n})};await o(),await n({resend:async()=>{await o()},callback:async e=>{await this.$account.core.changePhoneNumberSubmit(e)}})}}},Ad=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-modal-page"},[n("transition",{attrs:{name:"fade"}},[e.showContent?n("Backdrop"):e._e()],1),e.$scopedSlots.corner?n("div",{staticClass:"container",staticStyle:{"z-index":"7000"}},[n("transition",{attrs:{name:"slide-right"}},[e.showContent?n("Corner",[e._t("corner")],2):e._e()],1)],1):e._e(),n("div",{staticClass:"container flex justify-center items-center",staticStyle:{"z-index":"6000"}},[n("transition",{attrs:{name:"scale"}},[e.showContent?e._t("default"):e._e()],2)],1)],1)},Dd=[],Nd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-backdrop",class:[e.backdropType]})},Ld=[];const jd={mounted(){const e="dialog-backdrop-disabled";document.body.classList.contains(e)||document.body.classList.add(e)},beforeDestroy(){const e="dialog-backdrop-disabled";document.body.classList.contains(e)&&document.body.classList.remove(e)}};var Rd={name:"Backdrop",mixins:[jd],data(){return{backdropType:"shadow"}}},Ud=Rd,Fd=(n("55e6"),Object(g["a"])(Ud,Nd,Ld,!1,null,null,null)),Md=Fd.exports;k()(Fd,"components",{QDialog:y["a"]});var Bd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bg-page text-page absolute-bottom-right shadow-1 rounded-borders q-ma-sm q-py-xs q-px-sm"},[e._t("default")],2)},Qd=[],Wd={name:"Corner"},zd=Wd,Hd=Object(g["a"])(zd,Bd,Qd,!1,null,"4cc4e2b0",null),Vd=Hd.exports;const Gd=300,Kd={data(){return{showContent:!1}},mounted(){this.show()},methods:{async hide(){this.showContent=!1,await new Promise((e=>setTimeout(e,Gd)))},async show(){this.showContent=!0,await new Promise((e=>setTimeout(e,Gd)))}}};var Yd={name:"ModalLayout",mixins:[Kd],components:{Backdrop:Md,Corner:Vd}},Jd=Yd,Xd=(n("4ec4"),Object(g["a"])(Jd,Ad,Dd,!1,null,null,null)),Zd=Xd.exports,eu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-center items-center"},[e._t("default"),n("q-btn",{attrs:{round:"","no-caps":"",size:"0.75rem",unelevated:"",icon:"close"},on:{click:function(){return e.$account.view.SignInPage=null}}})],2)},tu=[],nu={name:"Corner"},ou=nu,au=Object(g["a"])(ou,eu,tu,!1,null,null,null),su=au.exports;k()(au,"components",{QBtn:le["a"]});var iu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",[n("q-card-section",{staticClass:"flex justify-center items-center"},[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),n("div",{staticClass:"q-ml-sm"},[e._v(" "+e._s(e.title)+" ")])],1)],1)},ru=[],lu={name:"LoadingCard",props:{title:String}},cu=lu,du=Object(g["a"])(cu,iu,ru,!1,null,"598e682e",null),uu=du.exports;k()(du,"components",{QCard:v["a"],QCardSection:ie["a"],QSpinnerIos:nt["a"]});var hu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"non-selectable q-pt-lg"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("sign_in.sign_in")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{label:e.$t("field.username"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.username,callback:function(t){e.username=t},expression:"username"}}),n("q-input",{staticClass:"q-my-sm",attrs:{label:e.$t("field.password"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false",type:e.hidePassword?"password":"text"},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}]),model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.forgot_your_password"))),n("a",{staticClass:"underscore text-primary q-ml-xs cursor-pointer",on:{click:function(){return e.$account.view.SignInPage.updateCard("ResetPasswordCard")}}},[e._v(e._s(e.$t("tip.reset_password")))])])]),n("q-card-section",{staticClass:"non-selectable column items-stretch"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"general","text-color":"general",label:e.$t("action.sign_in")},on:{click:e.handleSignIn}},"q-btn",e.loadingProps("sign_in"),!1)),n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.sign_up")},on:{click:function(){return e.$account.view.SignInPage.updateCard("SignUpCard",{initialSignUpMode:"email"})}}},"q-btn",e.loadingProps("sign_up"),!1)),n("ABOAuthEntry")],1)],1)},pu=[];const mu={sign_in:{sign_in:["Sign In","登录账户","登錄賬戶"]},sign_up:{sign_up:["Sign Up","注册账户","註冊賬戶"],verify:["Identify verification","身份验证","身份驗證"]},reset_password:{find_your_account:["Find your account","找寻你的账户","找尋你的賬戶"],enter_your_username:["Enter your phone number or email","输入你的手机号码或电子邮箱","輸入你的手機號碼或電子郵箱"]},field:{username:["Phone number or email","手机号码或电子邮箱","手機號碼或電子郵箱"],email:["Email","邮箱","郵箱"],phone_number:["Phone Number","手机号码","手機號碼"],password:["Password","密码","密碼"],verification_code:["Verification code","验证码","驗證碼"],license_terms:["the license and terms","服务许可条款","服務許可條款"]},tip:{forgot_your_password:["Forgot your password? ","忘记密码了?","忘記密碼了?"],reset_password:["Reset password","重置密码","重置密碼"],no_email:["No email? ","没有邮箱?","沒有郵箱?"],sign_up_by_email:["Sign up by email","通过邮箱注册","通過郵箱註冊"],no_phone_number:["No phone number? ","没有手机号码?","沒有手機號碼?"],sign_up_by_phone_number:["Sign up by phone number","通过手机注册","通過手機註冊"],sms_sent:["A SMS with a verification code has been sent to your phone: {phone_number}","一封附带验证码的短信已发送到您的手机:{phone_number}","一封附帶驗證碼的短信已發送到您的手機:{phone_number}"],email_sent:["An email with a verification code has been sent to your email address: {email}","一封附带验证码的电子邮件已发送到您的邮箱:{email}","一封附帶驗證碼的電子郵件已發送到您的郵箱:{email}"],can_not_get_code:["Can not get verification code? ","无法获取验证码?","無法獲取驗證碼?"]},action:{resend_code:["Resend code","重发验证码","重發驗證碼"],finish:["Finish","完成","完成"],continue:["Continue","下一步","繼續"],i_accept:["I accept ","我接受","我接受"],sign_in:["Sign In","登录","登錄"],sign_up:["Sign Up","注册","註冊"],search:["Search","查找","查找"]}},_u=e=>{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};var fu={messages:_u(mu)};const gu={data(){return{hidePassword:!0}}},bu={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var yu={name:"SignInCard",i18n:fu,mixins:[bu,gu],props:{initial_username:String,initial_password:String},created(){this.initial_username&&(this.username=this.initial_username),this.initial_password&&(this.password=this.initial_password)},mounted(){this.password&&this.username&&this.handleSignIn()},data(){return{username:null,password:null}},methods:{async handleSignIn(){await this.withLoadingWrapper("sign_in",(async()=>{await this.$account.store.signIn(this.username,this.password)}))}}},vu=yu,wu=Object(g["a"])(vu,hu,pu,!1,null,null,null),ku=wu.exports;k()(wu,"components",{QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QBtn:le["a"],QInput:K["a"],QIcon:Y["a"]});var Cu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$account.view.SignInPage.updateCard("SignInCard")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("sign_up.sign_up")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-pt-none"},["email"===e.signUpMode?[n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.email"),rules:[function(){return!0}],dense:"",spellcheck:"false"},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}}),n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.password"),rules:[function(){return!0}],dense:"",spellcheck:"false",type:e.hidePassword?"password":"text"},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}],null,!1,176215e3),model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.no_email"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs cursor-pointer",on:{click:function(t){e.signUpMode="phone_number"}}},[e._v(e._s(e.$t("tip.sign_up_by_phone_number")))])])]:"phone_number"===e.signUpMode?[n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.phone_number"),rules:[function(){return!0}],dense:"",spellcheck:"false"},model:{value:e.phone_number,callback:function(t){e.phone_number=t},expression:"phone_number"}}),n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.password"),rules:[function(){return!0}],dense:"",spellcheck:"false",type:e.hidePassword?"password":"text"},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}]),model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.no_phone_number"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs cursor-pointer",on:{click:function(t){e.signUpMode="email"}}},[e._v(e._s(e.$t("tip.sign_up_by_email")))])])]:e._e()],2),n("q-card-section",{staticClass:"q-py-none row items-center non-selectable"},[n("q-checkbox",{staticStyle:{"margin-left":"-8px"},attrs:{label:e.$t("action.i_accept")},model:{value:e.accept,callback:function(t){e.accept=t},expression:"accept"}}),n("div",{staticClass:"q-ml-xs underscore select-none cursor-pointer text-primary",on:{click:e.showLicenseTerms}},[e._v("\n "+e._s(e.$t("field.license_terms"))+"\n ")])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.continue")},on:{click:function(t){return e.withLoadingWrapper("sign_up",e.handleSignUp)}}},"q-btn",e.loadingProps("sign_up"),!1))],1)],1)},$u=[],Su=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("sign_up.verify")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.description))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.verification_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},scopedSlots:e._u([{key:"after",fn:function(){return[n("q-btn",e._b({staticClass:"full-height",staticStyle:{"min-width":"120px"},attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"general","text-color":"general",label:e.$t("action.resend_code")},on:{click:function(t){return e.withLoadingWrapper("resend",e.handleResend)}}},"q-btn",e.loadingProps("resend"),!1))]},proxy:!0}]),model:{value:e.verification_code,callback:function(t){e.verification_code=t},expression:"verification_code"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.can_not_get_code"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs",style:e.loadingState?{pointerEvents:"none",cursor:"not-allowed"}:{cursor:"pointer"},on:{click:function(){return e.$emit("switchMode","email"===e.signUpMode?"phone_number":"email")}}},[e._v(e._s("email"===e.signUpMode?e.$t("tip.sign_up_by_phone_number"):e.$t("tip.sign_up_by_email")))])])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.finish")},on:{click:function(t){return e.withLoadingWrapper("confirm",e.handleConfirm)}}},"q-btn",e.loadingProps("confirm"),!1))],1)],1)},xu=[];const Tu={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}},Iu={data(){return{showAttributes:!1,attributes:{nickname:null,gender:"not_say",birthday:null,locale:"not_say"}}}};var Pu={name:"SignUpConfirmCard",i18n:fu,mixins:[Tu,Iu],props:{signUpMode:String,resend:Function,confirm:Function},data(){return{verification_code:null}},computed:{description(){return"email"===this.signUpMode?this.$t("tip.email_sent",{email:"email"}):"phone_number"===this.signUpMode?this.$t("tip.sms_sent",{phone_number:"phone_number"}):void 0}},methods:{async handleResend(){try{await this.resend()}catch(e){}},async handleConfirm(){try{const e=Object.entries(this.attributes).reduce(((e,[t,n])=>n?{...e,[t]:n}:e),{});return await this.confirm(this.verification_code,e)}catch(e){}}}},Ou=Pu,qu=n("03bd"),Eu=n("abe8"),Au=Object(g["a"])(Ou,Su,xu,!1,null,null,null),Du=Au.exports;k()(Au,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QToggle:qu["a"],QTooltip:Ct["a"],QInput:K["a"],QSlideTransition:Eu["a"]});const Nu={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}},Lu={data(){return{hidePassword:!0}}},ju={data(){return{confirmDialog:null}},beforeDestroy(){this.confirmDialog&&this.confirmDialog.hide()},methods:{showConfirmDialog({data:e,resend:t,confirm:n}){this.confirmDialog||(this.confirmDialog=this.$account.utils.showInDialog(Du,{props:{signUpMode:this.signUpMode,resend:t,confirm:async(...e)=>{await n(...e),this.confirmDialog.hide()}},on:{back:()=>{this.confirmDialog.hide(),this.$account.view.SignInPage.updateCard("SignInCard")},switchMode:e=>{this.confirmDialog.hide(),this.signUpMode=e}}}),this.confirmDialog.onDismiss((()=>this.confirmDialog=null)))}}};var Ru={name:"SignUpCard",i18n:fu,mixins:[Nu,ju,Lu],props:{initialSignUpMode:String},data(){return{signUpMode:"email",email:null,phone_number:null,password:null,accept:!1}},created(){this.signUpMode=this.initialSignUpMode},methods:{showLicenseTerms(){this.$account.$emit("signUp.showLicenseTerms")},async handleSignUp(){const e={email:{email:this.email},phone_number:{phone_number:this.phone_number,phone_number_code:this.phone_number_code}}[this.signUpMode];Object.assign(e,{password:this.password});const t=await this.$account.store.signUp(e,{requireConfirm:this.handleSignUpConfirm.bind(this)});t&&this.$account.view.SignInPage.updateCard("SignInCard",{initial_username:{email:this.email,phone_number:this.phone_number}[this.signUpMode],initial_password:this.password})},async handleSignUpConfirm({data:e,resend:t,callback:n}){let o=!1;return this.showConfirmDialog({data:e,resend:t,confirm:async(e,t)=>{await n(e,t),o=!0}}),await new Promise((e=>this.confirmDialog.onDismiss(e))),o}}},Uu=Ru,Fu=Object(g["a"])(Uu,Cu,$u,!1,null,null,null),Mu=Fu.exports;k()(Fu,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"],QIcon:Y["a"],QCheckbox:fl["a"]}),k()(Fu,"directives",{ClosePopup:Yl["a"]});var Bu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$account.view.SignInPage.updateCard("SignInCard")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("reset_password.find_your_account")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("reset_password.enter_your_username"))+" ")])])]),n("q-card-section",{staticClass:"q-py-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{label:e.$t("field.username"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.username,callback:function(t){e.username=t},expression:"username"}})],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",{staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.search")},on:{click:e.handleResetPassword}})],1)],1)},Qu=[];const Wu={data(){return{hidePassword:!0}}};var zu={name:"ResetPasswordCard",mixins:[Wu],i18n:fu,data(){return{username:null}},methods:{handleResetPassword(){}}},Hu=zu,Vu=Object(g["a"])(Hu,Bu,Qu,!1,null,null,null),Gu=Vu.exports;k()(Vu,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var Ku=async function({card:e,props:t,events:n}){const o={},a={cards:o,corner:su};this.$on("createSignInPage",Xu),await this.$emit("createSignInPage",a);const s=Yu("SignInPage",{cards:o,card:e,props:t,events:n,corner:a.corner}),i=this.utils.createVueInstance(s,!0);return i.$mount(Ju("alphabiz-sign-in-page")),i};function Yu(e,{cards:t,card:n,props:o,events:a,corner:s}){const i={beforeCreate(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)},created(){this.$account.view[e]=this},beforeDestroy(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)},methods:{async view$destroy(){await this.$refs.layout.hide(),this.$destroy(),this.$el.remove()}}};return{name:e,mixins:[i],render:r,data(){return{card:n,props:o||{},events:a||{}}},methods:{updateCard(e,t={},n={}){this.card=e,this.props=t,this.events=n}}};function r(e){return e(Zd,{ref:"layout",scopedSlots:{corner:()=>e(s),default:()=>e(t[this.card],{props:this.props,on:this.events})}})}}function Ju(e){return document.getElementById(e)||(()=>{const t=document.createElement("div");return t.id=e,document.body.appendChild(t),t})()}function Xu({cards:e}){Object.assign(e,{LoadingCard:uu,SignInCard:ku,SignUpCard:Mu,ResetPasswordCard:Gu})}n("d176");var Zu={SignInPage:Ku},eh={onCreateCore(e,t,n){return{...ad,...rd,...cd,...md,...Cd}},onConfigure(e,t,n){Sd(e,t,n)},onCreateStoreMixin(e,t,n){return{mixins:[Pd,Od,qd,Ed]}},onRegisterView(e,t,n){return n.$on("authState.signedIn",(()=>n.view.SignInPage=null)),{...Zu}}},th=n("a071"),nh={onCreateCore(e,t,n){return{}},onConfigure(e,t,n){const o=n;o.$on("signIn.createChallengeHandlers",(t=>{t.CUSTOM_CHALLENGE=async(t,n,o)=>{const a=await e.prototype.$recaptcha("login");if(o=await Ul["a"].sendCustomChallengeAnswer(o,a),!o)throw new Error("Network Error");return!0}}));const a=o.$logger.tags("ReCaptcha"),s=async({offLine:e,onLine:t},n)=>{await new Promise((t=>{if(navigator.onLine)t();else{const o=setInterval((()=>{navigator.onLine?(clearInterval(o),t()):e()}),n)}})),t()};s({offLine(){a.log("network offline, retry...")},onLine(){e.use(th["VueReCaptcha"],{siteKey:"6LeQxGkdAAAAAEU4CVmCtybi8FkBPoX4oy1UnN7Q",loaderOptions:{useRecaptchaNet:!0,autoHideBadge:!0,explicitRenderParameters:{badge:"bottomright"}}}),a.log("loaded")}},3e3)},onCreateStoreMixin(e,t,n){return{}},onRegisterView(e,t,n){return{}}};async function oh(){const e=await Ul["a"].currentAuthenticatedUser();return await Ul["a"].getPreferredMFA(e)}async function ah(e){if(!["SMS_MFA","TOTP","SOFTWARE_TOKEN_MFA","NOMFA"].includes(e))throw new Error("invalid_mfa_type");const t=await Ul["a"].currentAuthenticatedUser();await Ul["a"].setPreferredMFA(t,e)}async function sh(){const e=await Ul["a"].currentAuthenticatedUser();return await Ul["a"].setupTOTP(e)}async function ih(e){const t=await Ul["a"].currentAuthenticatedUser();await Ul["a"].verifyTotpToken(t,e)}async function rh(e,{language:t}){const{ABDevRest:n}=this.utils;e=e.toLowerCase();const o=`${t}:D`,{email:a,phoneNumber:s}=await n.postGuest("/account/verifyForDisableMFA",{username:e,metadata:{msgLocale:o}});return{email:{destination:a.Destination},phoneNumber:{destination:s.Destination}}}async function lh(e,{emailCode:t,phoneCode:n}){const{ABDevRest:o}=this.utils;e=e.toLowerCase(),await o.postGuest("/account/verifySubmitForDisableMFA",{username:e,emailCode:t,phoneCode:n})}var ch={setupTOTP:sh,verifyTotpToken:ih,getMFA:oh,changeMFA:ah,disableMFASend:rh,disableMFASubmit:lh};function dh(){return this.$store.getters.settings.language}const uh=async function(e){const t=()=>this.$account.core.verifyFieldSend("phone_number",{language:dh.call(this)});await t();const n=await e({resend:()=>t(),callback:async e=>{await this.$account.core.verifyFieldSubmit("phone_number",e)}});return n},hh=async function(e){const t=await e({setup:()=>this.$account.core.setupTOTP(),callback:async e=>{await this.$account.core.verifyTotpToken(e)}});return t};var ph={methods:{async setNoMfa({requireCodeFromSMS:e,requireCodeFromOTP:t}){const n=this.$account.core.getMFA();if("NOMFA"===n)return!0;let o=!1;if("SMS_MFA"===n)o=await uh.call(this,e);else{if("SOFTWARE_TOKEN_MFA"!==n)throw new Error("invalid_mfa_type");o=await hh.call(this,t)}return!!o&&(await this.$account.core.changeMFA("NOMFA"),!0)},async setSmsMfa({requireCodeFromSMS:e}){const t=this.$account.core.getMFA();if("SMS_MFA"===t)return!0;const n=await uh.call(this,e);return!!n&&(await this.$account.core.changeMFA("SMS_MFA"),!0)},async setOtpMfa({requireCodeFromOTP:e}){const t=this.$account.core.getMFA();if("SOFTWARE_TOKEN_MFA"===t)return!0;const n=await hh.call(this,e);return!!n&&(await this.$account.core.changeMFA("SOFTWARE_TOKEN_MFA"),!0)},async disableMfa(e){const t=await this.$account.core.disableMFASend(e,{language:dh.call(this)});let n=!1;return await this.$account.$emit("disableMfa.requireCodes",{data:t,submit:async({emailCode:t,phoneCode:o})=>{await this.$account.core.disableMFASubmit(e,{emailCode:t,phoneCode:o}),n=!0}}),n}},created(){const e=async(e,t,n)=>{let o=!1;return await this.$account.$emit("signIn.requireCodeFromSMS",{username:n.username,resend:async()=>{n=await Ul["a"].signIn(e,t)},submit:async e=>{await Ul["a"].confirmSignIn(n,e,"SMS_MFA"),o=!0}}),o},t=async(e,t,n)=>{let o=!1;return await this.$account.$emit("signIn.requireCodeFromOTP",{username:n.username,submit:async e=>{await Ul["a"].confirmSignIn(n,e,"SOFTWARE_TOKEN_MFA"),o=!0}}),o};this.$account.$on("signIn.createChallengeHandlers",(n=>Object.assign(n,{SMS_MFA:e,SOFTWARE_TOKEN_MFA:t})))}},mh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("verify_your_identity")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("tip.sms_sent",{phone_number:"phone_number"})))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.verification_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},scopedSlots:e._u([{key:"after",fn:function(){return[n("q-btn",e._b({staticClass:"full-height",staticStyle:{"min-width":"120px"},attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"general","text-color":"general",label:e.$t("action.resend_code")},on:{click:function(t){return e.withLoadingWrapper("resend",e.handleResend)}}},"q-btn",e.loadingProps("resend"),!1))]},proxy:!0}]),model:{value:e.verification_code,callback:function(t){e.verification_code=t},expression:"verification_code"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.can_not_mfa"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs",style:e.loadingState?{pointerEvents:"none",cursor:"not-allowed"}:{cursor:"pointer"},on:{click:e.handleDisableMFA}},[e._v(e._s(e.$t("action.disable_mfa")))])])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.submit")},on:{click:function(t){return e.withLoadingWrapper("submit",e.handleSubmit)}}},"q-btn",e.loadingProps("submit"),!1))],1)],1)},_h=[];const fh={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var gh={name:"RequireCodeFromSMS",mixins:[fh],props:{username:String,resend:Function,submit:Function},data(){return{verification_code:null}},methods:{async handleDisableMFA(){try{this.$emit("back"),this.$account.view.SignInPage.updateCard("LoadingCard",{title:this.$t("disable_mfa.loading")}),await this.$account.store.disableMfa(this.username)}catch(e){}finally{this.$account.view.SignInPage.updateCard("SignInCard")}},async handleResend(){try{await this.resend()}catch(e){}},async handleSubmit(){try{return await this.submit(this.verification_code),void this.$emit("back")}catch(e){}}}},bh=gh,yh=Object(g["a"])(bh,mh,_h,!1,null,null,null),vh=yh.exports;k()(yh,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var wh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("verify_your_identity")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("tip.require_otp")))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.verification_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.verification_code,callback:function(t){e.verification_code=t},expression:"verification_code"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.can_not_mfa"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs",style:e.loadingState?{pointerEvents:"none",cursor:"not-allowed"}:{cursor:"pointer"},on:{click:function(t){return e.withLoadingWrapper("disable",e.handleDisableMFA)}}},[e._v(e._s(e.$t("action.disable_mfa")))])])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.submit")},on:{click:function(t){return e.withLoadingWrapper("submit",e.handleSubmit)}}},"q-btn",e.loadingProps("submit"),!1))],1)],1)},kh=[];const Ch={verify_your_identity:["Verify your identity","验证您的身份","驗證您的身份"],disable_mfa:{title:["Disable MFA","关闭二级验证","關閉二級驗證"],loading:["Loading...","加载中...","加載中..."]},action:{submit:["Submit","提交","提交"],resend_code:["Resend code","重发验证码","重發驗證碼"],disable_mfa:["Disable MFA","关闭二级验证","關閉二級驗證"]},field:{verification_code:["Verification code","验证码","驗證碼"],email_code:["Email Code","邮箱验证码","郵箱驗證碼"],sms_code:["SMS Code","短信验证码","簡訊驗證碼"]},tip:{require_otp:["MFA is enabled for your account. To finish signing in, please turn on your device and type the TOTP","您的账户已启用安全令牌。要完成登录,请查看您的设备并输入验证码","您的賬戶已啟用安全令牌。要完成登錄,請查看您的設備並輸入驗證碼"],sms_sent:["A SMS with a verification code has been sent to your phone: {phone_number}","一封附带验证码的短信已发送到您的手机:{phone_number}","一封附帶驗證碼的短信已發送到您的手機:{phone_number}"],can_not_mfa:["MFA in trouble? ","无法进行二级验证?","無法進行二級驗證?"],verify_identity_by_codes:["Enter the email verification code and SMS verification code to verify your identity","输入邮件验证码与短信验证码以验证您的身份","輸入郵件驗證碼與簡訊驗證碼以驗證您的身份"]}},$h=e=>{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};var Sh={messages:$h(Ch)};const xh={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var Th={name:"RequireCodeFromOTP",i18n:Sh,mixins:[xh],props:{username:String,submit:Function},data(){return{verification_code:null}},methods:{async handleDisableMFA(){try{this.$emit("back"),this.$account.view.SignInPage.updateCard("LoadingCard",{title:this.$t("disable_mfa.loading")}),await this.$account.store.disableMfa(this.username)}catch(e){}finally{this.$account.view.SignInPage.updateCard("SignInCard")}},async handleSubmit(){try{await this.submit(this.verification_code),this.$emit("back")}catch(e){}}}},Ih=Th,Ph=Object(g["a"])(Ih,wh,kh,!1,null,null,null),Oh=Ph.exports;k()(Ph,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var qh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("disable_mfa.title")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("tip.verify_identity_by_codes")))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.email_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.email_code,callback:function(t){e.email_code=t},expression:"email_code"}}),n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.sms_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.sms_code,callback:function(t){e.sms_code=t},expression:"sms_code"}})],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.submit")},on:{click:function(t){return e.withLoadingWrapper("submit",e.handleSubmit)}}},"q-btn",e.loadingProps("submit"),!1))],1)],1)},Eh=[];const Ah={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var Dh={name:"RequireCodesForDisableMFA",mixins:[Ah],props:{submit:Function},data(){return{email_code:null,sms_code:null}},methods:{async handleSubmit(){try{await this.submit({emailCode:this.email_code,phoneCode:this.sms_code}),this.$emit("back")}catch(e){}}}},Nh=Dh,Lh=Object(g["a"])(Nh,qh,Eh,!1,null,null,null),jh=Lh.exports;k()(Lh,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var Rh={async RequireCodeFromSMS({username:e,resend:t,submit:n}={}){const o=this.utils.showInDialog(vh,{props:{username:e,resend:t,submit:n},on:{back(){o.hide()}}});await new Promise(o.onDismiss)},async RequireCodeFromOTP({username:e,submit:t}){const n=this.utils.showInDialog(Oh,{props:{username:e,submit:t},on:{back(){n.hide()}}});await new Promise(n.onDismiss)},async RequireCodesForDisableMFA({data:e,submit:t}){return await new Promise((e=>{this.view.SignInPage.updateCard("RequireCodesForDisableMFA",{submit:t},{back:e})}))}};const Uh=({cards:e})=>Object.assign(e,{RequireCodesForDisableMFA:jh});var Fh={onCreateCore(e,t,n){return{...ch}},onConfigure(e,t,n){},onCreateStoreMixin(e,t,n){return{...ph}},onRegisterView(e,t,n){return n.$on("createSignInPage",Uh),n.$on("signIn.requireCodeFromSMS",((...e)=>n.view.RequireCodeFromSMS(...e))),n.$on("signIn.requireCodeFromOTP",((...e)=>n.view.RequireCodeFromOTP(...e))),n.$on("disableMfa.requireCodes",((...e)=>n.view.RequireCodesForDisableMFA(...e))),{...Rh}}},Mh={onCreateCore(e,t,n){async function o({code:e,email:t,phone:n}){const{ABDevRest:o}=this.utils;t&&(t=t.toLowerCase()),await o.post("/invitation/deliverCode",{id:e,email:t,phone:n})}async function a(){const{ABDevRest:e}=this.utils,t=await e.post("/invitation/getCodes");return t}return{inviteCode:o,getInvitationCodes:a}},onConfigure(e,t,n){},onCreateStoreMixin(e,t,n){return{}},onRegisterView(e,t,n){return{}}},Bh={setState:e=>{window.sessionStorage.setItem("oauth_state",e)},getState:()=>{const e=window.sessionStorage.getItem("oauth_state");return window.sessionStorage.removeItem("oauth_state"),e},setPKCE:e=>{window.sessionStorage.setItem("ouath_pkce_key",e)},getPKCE:()=>{const e=window.sessionStorage.getItem("ouath_pkce_key");return window.sessionStorage.removeItem("ouath_pkce_key"),e},clearAll:()=>{window.sessionStorage.removeItem("ouath_pkce_key"),window.sessionStorage.removeItem("oauth_state")}},Qh={encode(e){return e.split("").map((e=>e.charCodeAt(0).toString(16).padStart(2,"0"))).join("")},decode(e){return e.match(/.{2}/g).map((e=>String.fromCharCode(parseInt(e,16)))).join("")}},Wh=n("36f2");const zh="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var Hh=(e,t,n)=>{Wh["a"].dispatch("auth",{event:e,data:t,message:n},"Auth",zh)},Vh={urlSafe:Qh,oauthStorage:Bh,dispatchAuthEvent:Hh},Gh=n("2b49"),Kh={async pending(e,t={}){let n=!1;return await this.$emit("handleOAuthEvent",e,{...t,next:e=>n=e}),n},cancelled(e){return this.$emit("handleOAuthEvent","cancelled",e)},succeed(e){return this.$emit("handleOAuthEvent","succeed",e)},failed(e,t){return"string"===typeof e&&(e=new Error(e)),this.$emit("handleOAuthEvent","failed",t,e)}};function Yh(){const e=Gh["a"].generateState(128);Vh.oauthStorage.setPKCE(e);const t=Gh["a"].generateChallenge(e),n="S256";return{code_challenge:t,code_challenge_method:n}}async function Jh({event:e,provider_sub:t}){if("account_linked"===e){const e="oauth_account_has_been_connected";await Kh.failed.call(this,["oauth_error",e].join("."))}else if("account_unlinked"===e){const e=await Kh.pending.call(this,"connecting");if(!e)return;const n=Vh.oauthStorage.getState(),o=Vh.oauthStorage.getPKCE(),{ABDevRest:a}=this.utils;await a.post("/oauth/connect",{state:n,provider_sub:t,code_verifier:o}),await Kh.succeed.call(this)}}var Xh=n("d830");function Zh(){const e=Gh["a"].generateState(128);Vh.oauthStorage.setPKCE(e);const t=Gh["a"].generateChallenge(e),n="S256";return{code_challenge:t,code_challenge_method:n}}async function ep({event:e,state:t,provider:n}){if("account_linked"===e){const e=await Kh.pending.call(this,"logging_in");if(!e)return;if(t!==Vh.oauthStorage.getState())return;const o=Vh.oauthStorage.getPKCE(),{ABDevRest:a}=this.utils,{provider_sub:s}=n,i={state:t,provider_sub:s,code_verifier:o},r=await a.postGuest("/oauth/tokens",i);await tp.call(Ul["a"],r),await Kh.succeed.call(this)}else if("account_unlinked"===e){const e="can_not_login_unconnected_account";await Kh.failed.call(this,["oauth_error",e].join("."))}}async function tp({IdToken:e,AccessToken:t,RefreshToken:n}){const o=new Xh["h"]({IdToken:new Xh["c"]({IdToken:e}),RefreshToken:new Xh["d"]({RefreshToken:n}),AccessToken:new Xh["b"]({AccessToken:t})});let a;this._config.identityPoolId&&(a=await this.Credentials.set(o,"session"));const s=this.createCognitoUser(o.getIdToken().decodePayload()["cognito:username"]);return s.setSignInUserSession(o),{currentUser:s,credentials:a}}const np={connect:o,login:a};function op({provider:e,action:t}){const n=this,{ABDevRest:o}=this.utils,a=n.$logger.tags("OAuthAction","Request"),s=Gh["a"].generateState(32);Vh.oauthStorage.setState(s);const i=Object.entries({state:s,action:t,identity_provider:e,redirect_uri:`${Ul["a"]._oAuthHandler._config.redirectSignIn}v2/`,...np[t].createParams.call(this)||{}}).map((e=>e.map(encodeURIComponent).join("="))).join("&"),r=`${o.endpoint}/oauth/request`,l=`${r}?${i}`;a.log(l),Gh["a"].urlOpener(l)}async function ap(e,t="electron"){const n=this,o=n.$logger.tags("OAuthAction","Response"),a=Array.from(new URL(e).searchParams.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{}),{action:s,identity_provider:i}=a;if(!s)return;const r=JSON.parse(a.data);if("web"===t){const e=n.$on("handleOAuthEvent",((t,o,a)=>{var r,l;e(),null===(r=(l=n.view).OAuthFlowRestored)||void 0===r||r.call(l,{action:s,identity_provider:i},{stage:t,data:o,error:a})}))}o.tags(s,i).log(r),await np[s].eventHandler.call(this,r)}function sp({initial_stage:e,initial_params:t,stage_restrict:n,handlers:o}){const a=this,s=["cancelled","failed","succeed"];let i,r=null,l=null;const c=e=>i!==e&&(!s.includes(i)&&(!!s.includes(e)||!!n[e]&&!!n[i].includes(e))),d=()=>new Promise((async(n,d)=>{const u=async(e,t,r)=>{if(a.$logger.tags("OAuthEvent",e).log(...r?[r.message,t]:[t]),i=e,s.includes(i)){var c;null===(c=l)||void 0===c||c(),"failed"===i?(o[i]&&await o[i](r,t),d(r)):(o[i]&&await o[i](t),n())}else{if(!o[i])return;const e=await o[i](t);null===t||void 0===t||t.next(e)}};await u(e,...t||[]),l=a.$on("handleOAuthEvent",(async(e,t,n)=>{c(e)&&await u(e,t,n)})),r=e=>u("cancelled",e)}));return{cancel:e=>r(e),promise:()=>d().finally((()=>{var e;return null===(e=l)||void 0===e?void 0:e()}))}}async function ip(){const{ABDevRest:e}=this.utils,t=await e.post("/oauth/providers");return t}async function rp(e){const{ABDevRest:t}=this.utils;await t.post("/oauth/disconnect",{provider_sub:e})}var lp={queryOAuthProviders:ip,disconnectOAuthProvider:rp,createOAuthFlow:sp,handleOAuthActionResponse:ap,requestOAuthAction:op},cp=n("d1a4"),dp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"overflow-hidden full-width",style:{display:e.hide?"none":"unset"}},[n("q-separator",{staticClass:"q-my-sm",attrs:{color:"general"}}),n("div",{staticClass:"column items-stretch",staticStyle:{margin:"-4px"}},e._l(e.providersEnabled,(function(t,o){return n("q-btn",{key:o,staticClass:"q-ma-xs",attrs:{loading:e.loadingState===o,disable:!!e.loadingState,"no-caps":"","no-wrap":"",icon:t.icon,label:e.$t("oauth_login.sign_in_with",{provider:t.name}),unelevated:"",color:"general","text-color":"general"},on:{click:function(){return e.handleClick(t)}}})})),1)],1)},up=[],hp=n("b65b"),pp=hp["a"],mp=Object(g["a"])(pp,dp,up,!1,null,"391ab58c",null),_p=mp.exports;k()(mp,"components",{QSeparator:ce["a"],QBtn:le["a"]});var fp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-list",{staticClass:"rounded-borders",attrs:{bordered:"",separator:""}},e._l(e.providerItems,(function(t,o){return n("q-item",{key:o,staticClass:"q-pa-md"},[n("q-item-section",{staticStyle:{"min-width":"unset"},attrs:{avatar:""}},[n("q-icon",{staticStyle:{opacity:"0.7"},attrs:{size:"1.75rem",name:t.icon}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(t.providerName))]),t.providerUserId?n("q-item-label",{attrs:{caption:""}},[e._v(e._s(t.providerUserId))]):e._e()],1),Object.keys(t.handlers).length?n("q-item-section",{attrs:{side:""}},[1===Object.keys(t.handlers).length?[n("q-btn",{staticStyle:{margin:"-8px -8px -8px 0"},attrs:{disable:e.loadingState!==t.providerName&&!!e.loadingState,loading:e.loadingState===t.providerName,icon:Object.values(t.handlers)[0].icon,flat:"",round:""},on:{click:function(){return Object.values(t.handlers)[0].click()}}},[n("q-tooltip",{ref:"tooltip",refInFor:!0},[e._v(e._s(Object.values(t.handlers)[0].label))])],1)]:[n("q-btn",{staticStyle:{margin:"-8px -8px -8px 0"},attrs:{disable:e.loadingState!==t.providerName&&!!e.loadingState,loading:e.loadingState===t.providerName,icon:"more_vert",flat:"",round:""}},[n("q-menu",{attrs:{"touch-position":"","auto-close":"","transition-show":"jump-down","transition-hide":"jump-up"}},[n("q-list",{staticStyle:{"min-width":"180px"}},[e._l(t.handlers,(function(t,o){return[n("q-item",{key:o,attrs:{clickable:""},on:{click:function(){return t.click()}}},[n("q-item-section",{staticStyle:{"min-width":"unset"},attrs:{avatar:""}},[n("q-icon",{staticStyle:{opacity:"0.7"},attrs:{size:"1.5rem",name:t.icon}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(t.label))])],1)],1)]}))],2)],1)],1)]],2):e._e()],1)})),1)},gp=[],bp=n("0925"),yp=n("bdb1"),vp=n("076e"),wp={name:"OAuthManager",i18n:vp["a"],data(){return{loadingState:null,loaded:!1,providers:[]}},mounted(){this.queryOAuthProviders().then((()=>this.loaded=!0))},methods:{async queryOAuthProviders(){this.providers=await this.$account.core.queryOAuthProviders()},async disconnectOAuthProvider(e,t){const n=[e,t].join("_");await this.$account.core.disconnectOAuthProvider(n),await this.queryOAuthProviders(),this.$q.notify({message:this.$t("oauth_disconnect.notify.disconnected",{provider:e}),type:"positive",position:"bottom-right",timeout:5e3})}},computed:{providerItems(){const e=(e,t)=>{const n=t=>async()=>{try{this.loadingState=e,await t()}finally{this.loadingState=null}},o={};return t?o.disconnect={icon:"delete",label:this.$t("oauth_disconnect.disconnect",{provider:e}),click:n((()=>this.disconnectOAuthProvider(e,t)))}:o.connect={icon:"add",label:this.$t("oauth_connect.connect_to",{provider:e}),click:n((async()=>{await yp["a"].connect.call(this,e),await this.queryOAuthProviders()}))},o},t=["Github","Twitter"].filter((e=>this.d$cfg.oauth.providers.includes(e))).map((e=>{var t;return{providerName:e,providerUserId:null===(t=this.providers.find((t=>t.provider_name===e)))||void 0===t?void 0:t.provider_sub.slice(e.length+1)}}));return[...t.map((({providerName:t,providerUserId:n})=>({icon:bp["a"].getIcon(t),providerName:t,providerUserId:n||this.$t("oauth_unset"),handlers:e(t,n)})))]}}},kp=wp,Cp=Object(g["a"])(kp,fp,gp,!1,null,null,null),$p=Cp.exports;k()(Cp,"components",{QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QItemLabel:qe["a"],QBtn:le["a"],QTooltip:Ct["a"],QMenu:Gl["a"]});var Sp={OAuthFlowRestored({action:e,identity_provider:t},{stage:n,data:o,error:a}){this.$logger.tags("OAuthFlowRestored",e,n).log(o);const s="OAuthFlowRestored";return this.utils.createVueInstance({i18n:vp["a"],beforeCreate(){const e=this.$account.view[s];e instanceof Function||this.destroy()},created(){var i;this.$account.view[s]=this,null===(i=yp["a"][e])||void 0===i||i.call(this,t,{initial_stage:n,initial_params:[o,a]}).finally((()=>{this.destroy()}))},beforeDestroy(){const e=this.$account.view[s];e instanceof Function||(this.$account.view[s]=null)},methods:{destroy(){this.$account.view[s]=null}}},!0)}},xp={onCreateCore(e,t,n){return{...lp}},onConfigure(e,t,o){Object(cp["a"])(e,t,o);const a=t.app.router;a.addRoute({path:"/oauth_redirect/:app_name/:redirect_to/v2",component:()=>n.e(7).then(n.bind(null,"4dfe"))});const s=e=>t=>{const n=e.split("/").slice(1),o=t.split("/").slice(1),a={};if(n.length===o.length){for(let e=0;e{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};var Wp={messages:Qp(Bp)},zp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-item",{staticClass:"q-pa-md"},[n("q-item-section",{staticStyle:{"min-width":"unset"},attrs:{avatar:""}},[n("q-icon",{staticStyle:{opacity:"0.7"},attrs:{size:"2.8rem",name:e.icon}})],1),n("q-item-section",[n("q-item-label",[n("span",{staticClass:"text-bold non-selectable",staticStyle:{"font-size":"1rem"}},[e._v(e._s(e.title))])]),e.member?n("q-item-label",{attrs:{caption:""}},[e._v("\n "+e._s(e.member)+"\n ")]):e._e(),n("div",{staticClass:"q-mt-sm non-selectable"},[n("div",{staticStyle:{margin:"-4px"}},e._l(e.stages,(function(t){return n("TaskItemStage",{key:t.index,attrs:{status:e.status,stage:t,current_stage:e.current_stage}})})),1)])],1)],1)},Hp=[],Vp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-menu",e._b({attrs:{"auto-close":"","transition-show":"jump-down","transition-hide":"jump-up"}},"q-menu",e.dropdown?{fit:!0,anchor:"bottom left",self:"top left"}:{touchPosition:!0},!1),[n("q-list",{staticStyle:{"min-width":"200px"}},e._l(e.actions,(function(t,o){return n("q-item",{key:o,attrs:{clickable:""},on:{click:t.handler}},[n("q-item-section",[n("q-item-label",[e._v(e._s(t.label))])],1)],1)})),1)],1)},Gp=[],Kp={name:"ActionMenu",props:{actions:Object,dropdown:{type:Boolean,default:!1}}},Yp=Kp,Jp=Object(g["a"])(Yp,Vp,Gp,!1,null,"336359cc",null),Xp=Jp.exports;k()(Jp,"components",{QMenu:Gl["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"]});var Zp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-chip",{attrs:{clickable:!0,color:e.stage.color,"text-color":e.stage.color,"icon-right":e.stage.icon,outline:e.stage.index!==e.current_stage}},[n("div",[e._v(e._s(e.stage.index+1)+". "+e._s(e.stage.label))]),n("q-menu",{attrs:{"transition-show":"jump-down","transition-hide":"jump-down",touchPosition:!1}},[n("q-card",{staticClass:"overflow-hidden non-selectable",staticStyle:{"min-width":"200px","max-width":"320px","max-height":"480px"}},[n("q-card-section",[n("div",{staticClass:"flex items-center no-wrap"},[n("div",{staticClass:"text-h6 text-weight-bold ellipsis"},[e._v(e._s(e.stage.label))]),n("q-badge",{staticClass:"q-ml-xs",attrs:{color:e.stage.color,"text-color":e.stage.color}},[n("div",[e._v(e._s(e.stage.status))])])],1),e.stage.subtitle?n("div",{staticClass:"text-caption"},[e._v(e._s(e.stage.subtitle))]):e._e()]),n("q-card-section",{staticClass:"q-pt-none"},[n("div",[e._v(e._s(e.stage.desc))])]),e.stage.actions&&e.stage.actions.length?n("q-card-section",{staticClass:"q-pt-none column items-end q-pb-sm"},e._l(e.stage.actions,(function(t,o){return n("q-btn",e._b({key:o,staticClass:"q-mb-xs",attrs:{unelevated:"",loading:e.loadingState==="action_"+o},on:{click:function(){return e.loadingWrapper(o,t.handler)}}},"q-btn",t,!1))})),1):e._e()],1)],1)],1)},em=[],tm={name:"TaskItemStage",i18n:Wp,data(){return{loadingState:null}},props:{status:String,stage:Object,current_stage:Number},methods:{async loadingWrapper(e,t){try{this.loadingState=`action_${e}`,await t()}finally{this.loadingState=null}}}},nm=tm,om=n("da23"),am=Object(g["a"])(nm,Zp,em,!1,null,"02a3e274",null),sm=am.exports;k()(am,"components",{QChip:om["a"],QMenu:Gl["a"],QCard:v["a"],QCardSection:ie["a"],QBadge:ki["a"],QIcon:Y["a"],QBtn:le["a"]});var im={name:"TaskItem",i18n:Wp,components:{ActionMenu:Xp,TaskItemStage:sm},props:{id:String,category:String,icon:String,title:String,current_stage:Number,status:String,member:String,stages:Array}},rm=im,lm=Object(g["a"])(rm,zp,Hp,!1,null,null,null),cm=lm.exports;k()(lm,"components",{QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QItemLabel:qe["a"],QBtn:le["a"]});const dm=function(e){const t={id:"SubscribeGithubRepo",category:"SubscribeGithubRepo",icon:"fab fa-github",title:this.$t("task_github_subscribe_repo.title"),current_stage:0,status:"enabled",member:null,stages:[]},n=(e,t)=>this.$t(`task_github_subscribe_repo.task_stage.${e}`,t);if(t.stages.push({index:0,label:n("connect_to_github.label"),desc:n("connect_to_github.desc")},{index:1,label:n("subscribe_repo.label"),desc:n("subscribe_repo.desc")},{index:2,label:n("subscribe_repo_for.label",{month:1}),desc:n("subscribe_repo_for.desc",{month:1})},{index:3,label:n("subscribe_repo_for.label",{month:3}),desc:n("subscribe_repo_for.desc",{month:3})}),e){const n=JSON.parse(e.metadata);Object.assign(t,{id:e.id,current_stage:n.stage+1,member:e.member,status:e.status})}return t.stages.forEach(((n,o)=>{const a=o===t.current_stage,s=ot.current_stage,r=s?"done":i?null:{succeed:"done",cancelled:"close",failed:"error"}[t.status]||"more_horiz",l=s?"positive":i?"general":{succeed:"positive",cancelled:"negative",failed:"negative"}[t.status]||"positive",c=this.$t("task_panel.stage_status."+(s?"completed":i?"not_started":"in_progress"));if(Object.assign(n,{icon:r,color:l,status:c}),n.actions=n.actions||[],0===o&&n.actions.push({disable:!a,label:this.$t("task_github_subscribe_repo.task_action.go_to_connect"),handler:()=>{this.$router.push({name:"AccountSettings"})}}),1!==o||s||n.actions.push({disable:!a,label:this.$t("task_github_subscribe_repo.task_action.go_to_subscribe"),handler:()=>{const e="https://github.com/tanshuai/alphabiz";window.open(e,"_blank")}}),[2,3].includes(o)&&t.current_stage>1){const t=JSON.parse(e.metadata);n.subtitle=this.$t("task_github_subscribe_repo.subscribed_at",{time:this.$d(new Date(t.subscribed_at),"YMD"),days:Math.max(0,Math.floor((new Date-new Date(t.subscribed_at))/864e5*10)/10)})}if([1,2,3].includes(o)){var d;const t=JSON.parse(null!==(d=null===e||void 0===e?void 0:e.metadata)&&void 0!==d?d:"{}"),s=a&&(2===o?new Date-new Date(t.subscribed_at)>2592e6:3!==o||new Date-new Date(t.subscribed_at)>7776e6),i={disable:!s,label:this.$t("task_github_subscribe_repo.task_action.get_bonus"),handler:async()=>{try{const t=await this.$account.core.updateGithubTask(e.member);await this.updateTaskList(),console.log(t,e)}catch(t){this.$q.notify({type:"negative",position:"bottom-right",message:t.message})}}};n.actions.push(i)}})),t};var um={name:"index",i18n:Wp,components:{TaskItem:cm},data(){return{loadingState:null,taskList:null}},computed:{taskItems(){const e=[];return this.taskList.forEach((t=>{s[t.category]&&"cancelled"!==t.status&&e.push(s[t.category].call(this,t))})),e.some((e=>"SubscribeGithubRepo"===e.category))||e.push(dm.call(this)),e}},mounted(){this.reloadTaskList()},methods:{async reloadTaskList(){const e=async()=>{try{const e=await this.$account.core.queryTaskList();this.taskList=e}catch(e){throw e}};try{this.loadingState="loading",await e()}finally{this.loadingState=null}},async updateTaskList(){try{const e=await this.$account.core.queryTaskList();this.taskList=e}catch(e){this.$q.notify({type:"negative",position:"bottom-right",message:e.message})}}}},hm=um,pm=Object(g["a"])(hm,Fp,Mp,!1,null,null,null),mm=pm.exports;k()(pm,"components",{QPage:Rs["a"],QBtn:le["a"],QSpinnerIos:nt["a"],QIcon:Y["a"],QList:_t["a"]});var _m={name:"TaskPage",i18n:Wp,components:{Layout:Up,TaskCard:mm}},fm=_m,gm=Object(g["a"])(fm,Op,qp,!1,null,null,null),bm=gm.exports;function ym(e){const t={persistent:!0,transitionShow:"slide-up",transitionHide:"slide-down"};let n;const o=u["a"].create({component:{render(a){return a(y["a"],{ref:"dialog",props:t,on:{hide:()=>this.$emit("hide")}},[a(Object.assign({},e,{mixins:[...e.mixins||[],{beforeCreate(){n=this},methods:{closePopup(){o.hide()}}}]}))])},methods:{show(){this.$refs.dialog.show()},hide(){this.$refs.dialog.hide()}}}});return new Proxy({},{get(e,t){return o[t]?Reflect.get(o,t):Reflect.get(n,t)},set(e,t,a){return o[t]?Reflect.set(o,t,a):Reflect.set(n,t,a)}})}k()(gm,"components",{QToolbar:Ls["a"],QToolbarTitle:js["a"],QBtn:le["a"]}),k()(gm,"directives",{ClosePopup:Yl["a"]});const vm=function(e){return{beforeCreate(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)},created(){this.$account.view[e]=this},beforeDestroy(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)}}};let wm=null;var km={TaskPage(){wm=wm||vm(bm.name),bm.mixins=Array.from(new Set((bm.mixins||[]).concat(wm)));ym(bm)}},Cm={onCreateCore(e,t,n){return{...Pp}},onConfigure(e,t,n){},onCreateStoreMixin(e,t,n){return{}},onRegisterView(e,t,n){return e.component("TaskCard",mm),{...km}}};const $m=Gc.PluginInstaller("$account");Object.assign($m.context,{$test:Yc});var Sm=$m.exportAsVuePlugin();const xm={Auth:eh,ReCaptcha:nh,MFA:Fh,Invitation:Mh,OAuth:xp,Task:Cm};var Tm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-center items-center"},[n("q-btn",{attrs:{round:"","no-caps":"",size:"0.75rem",flat:"",color:"negative","text-color":"negative",icon:"close"},on:{click:function(){return e.$account.view.SignInPage=null}}}),e.$store.getters.settings.disableDevTools?e._e():n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.showDevDialog,expression:"!showDevDialog"}],attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"developer_mode"},on:{click:function(t){e.showDevDialog=!e.showDevDialog}}},[n("q-tooltip",[e._v(e._s(e.$t("development")))]),n("q-dialog",{attrs:{"transition-show":"slide-up","transition-hide":"slide-down"},model:{value:e.showDevDialog,callback:function(t){e.showDevDialog=t},expression:"showDevDialog"}},[n("div",{staticClass:"development-dialog"},[n("div",{staticClass:"flex items-center",staticStyle:{padding:"4px 12px"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v("Development Panel")]),n("q-space"),n("q-btn",{attrs:{"fab-mini":"",flat:"",icon:"close"},on:{click:function(t){e.showDevDialog=!1}}})],1),n("q-separator"),n("div",{staticClass:"scroll-y"},[n("Development")],1)],1)])],1),n("q-btn",{attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"language"}},[n("q-tooltip",[e._v(e._s(e.language))]),n("q-menu",{attrs:{"transition-show":"jump-up","transition-hide":"jump-down"}},[n("q-list",e._l(e.languageOptions,(function(t){return n("q-item",{directives:[{name:"ripple",rawName:"v-ripple"},{name:"close-popup",rawName:"v-close-popup"}],key:t.value,attrs:{clickable:"",tag:"label"},on:{click:function(){return e.language=t.value}}},[n("q-item-section",{staticStyle:{width:"120px"}},[n("q-item-label",[e._v(e._s(t.label))])],1)],1)})),1)],1)],1),n("q-btn",{attrs:{flat:"","no-caps":"",size:"0.75rem",round:"",icon:"info"},on:{click:e.showAboutDialog}},[n("q-tooltip",[e._v(e._s(e.$t("feedback")+"/"+e.$t("diagnotic")))])],1)],1)},Im=[];const Pm={components:{Development:zl["default"]},data(){return{showDevDialog:!1}}},Om={data(){return{languageOptions:Wl["a"]}},computed:{language:{get(){const e=S["a"].getters.settings.language,t=this.languageOptions.find((t=>t.value===e));return t?t.label:e},set(e){const t=e.value||e;if("string"===typeof t&&(S["a"].dispatch("updateSettings",{language:t}),this.$i18n.locale=t,Object(xn["isElectron"])())){const{ipcRenderer:e}=n("b052");e.send("change-app-i18n",t),e.send("set_settings",{language:t})}}}}};var qm={name:"Corner",mixins:[Om,Pm],methods:{showAboutDialog(){xn["Bus"].$emit("CALL_ABOUT")}}},Em=qm,Am=(n("8460"),Object(g["a"])(Em,Tm,Im,!1,null,null,null)),Dm=Am.exports;k()(Am,"components",{QBtn:le["a"],QTooltip:Ct["a"],QDialog:y["a"],QSpace:re["a"],QSeparator:ce["a"],QMenu:Gl["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"],QColor:X["a"]}),k()(Am,"directives",{Ripple:Kl["a"],ClosePopup:Yl["a"]});var Nm=n("67b6"),Lm=n("76ec"),jm=n("9a08"),Rm=async({Vue:e,app:t,router:n})=>{Um(e,[...ir]),e.use(ic,{app:t}),e.use(Sm,{app:t,app_config:{protocol:B.a.protocol,web_url:B.a.webEditionUrl},awsconfig:lc,extensions:xm,gql:{queries:cc,mutations:dc,subscriptions:uc}}),e.use(rr["a"],{app:t}),e.use(lr["b"],{app:t,router:n});const o=e.prototype.$account;o.$on("createSignInPage",(e=>{e.corner=Dm})),o.$on("signUp.showLicenseTerms",(()=>{return e.call(o.view.SignInPage);function e(){Nm["a"].call(this,{title:this.$t("account_license_terms"),markdown:{license:{label:"License",markdown:Lm["a"]},terms:{label:"Terms",markdown:jm["a"]}}})}}))};function Um(e,t){var n;const o=null===(n=e.config)||void 0===n?void 0:n.errorHandler;e.config.errorHandler=function(){const e=t.filter((e=>e.match(...arguments)));if(e.length>0)e.forEach((e=>e.execute(...arguments)));else{if(!o)throw arguments[0];o.apply(this,arguments)}}}var Fm=n("15eb");const Mm="/";async function Bm(){const{app:e,store:t,router:n}=await T();let o=!1;const a=e=>{o=!0;const t=Object(e)===e?n.resolve(e).route.fullPath:e;window.location.href=t},s=window.location.href.replace(window.location.origin,""),r=[me,er,or["a"],Rm,Fm["a"]];for(let c=0;!1===o&&c{const t="magnet:?xt=urn:btih:"+e.hash+"&dn="+(encodeURIComponent(e.name)||e.origin||e.hash).replace(`${o["protocol"]}:///`,"");let n="";if(e.trackers&&(n+=e.trackers.filter((e=>e.length)).map((e=>`&tr=${encodeURIComponent(e)}`)).join("")),e.data)for(const o in e.data){var a;null!==(a=e.data[o])&&void 0!==a&&a.length&&(n+=e.data[o].map((e=>`&${o}=${encodeURIComponent(e)}`)).join(""))}return t+n},r=e=>{var t;const n=new URL(e);if("magnet:"!==n.protocol)throw new Error("Input is not a magnet uri");const o=n.searchParams.get("xt"),a=null===(t=o.match(/[^:]+$/))||void 0===t?void 0:t[0];if(!a)throw new Error("Cannot parse magnet infoHash");const i=n.searchParams.get("dn")||"",r=n.searchParams.getAll("tr").map((e=>{const t=s.a.getIdByTracker(e);return-1!==t?t:e})),l={};return n.searchParams.forEach(((e,t)=>{["xt","dn","tr"].includes(t)||(l[t]||(l[t]=[]),l[t].push(e))})),{protocolType:"01",hash:a,name:i,trackers:r,data:l}};t["a"]={fromObject:i,toObject:r}},ecef:function(e,t,n){"use strict";n.r(t);var o=n("e3c7"),a=n("8a63");o["ioServer"].on("some_api",(()=>{})),o["ipcRenderer"].on("some-api",(()=>{})),o["ioServer"].on("request-provident-payment",(e=>{o["ioServer"].emit("request-provident-payment",e)})),o["ioServer"].on("credit_payment_created",(e=>{o["ioServer"].emit("payment-info",e)})),o["ioServer"].on("restart_payment",(e=>{o["ioServer"].emit("restart-payment",e)})),o["ioServer"].on("payment_verified",(e=>{o["ioServer"].emit("payment-verified",e)})),o["ioServer"].on("webtorrent-request-renew",(e=>{o["ioServer"].emit("request_renew",e)})),o["ioServer"].on("webtorrent-payment-finished",(e=>{o["ioServer"].emit("payment_finished",e)})),o["ioServer"].on("webtorrent-finish-all-payments",(e=>{if(null===e||void 0===e||!e.connections)return console.log("skip unknown tr",e,null===e||void 0===e?void 0:e.connections);const t=e.connections;t.forEach((e=>{e.transactions&&e.transactions.forEach((e=>{console.log("Finish pending",e),o["ioServer"].emit("payment_finished",{id:e})}))}))})),o["ioServer"].on("webtorrent-set-throttle",(e=>{0!==e.code&&o["ioServer"].emit("client_error",e.message)})),o["ioServer"].on("webtorrent-verify-payment",(e=>{o["ioServer"].emit("verify_payment",e)})),o["ioServer"].on("webtorrent-payment-completed",(e=>{o["ioServer"].emit("payment_completed",e)})),o["ioServer"].on("complete_payment",(e=>{o["ioServer"].emit("complete-payment",e)})),o["ioServer"].on("finish_payment",(e=>{o["ioServer"].emit("finish-payment",e)})),o["ioServer"].on("payment_closed",(e=>{o["ioServer"].emit("close-payment",e)})),o["ioServer"].on("set-throttle-group",(e=>{o["ioServer"].emit("set-throttle-group",{...e,peerId:null===e||void 0===e?void 0:e.id})})),o["ioServer"].on("download-and-play",(e=>{console.log("should download and play",e),Object(a["b"])("download",e.url)}))},edfe:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return C})),n.d(t,"a",(function(){return x}));n("de6c"),n("d4b5"),n("7a76");const{EventEmitter:o}=n("bf30"),a=n("3fd2"),{ipcRenderer:s}=a.renderer()?n("b052"):n("e3c7"),i=n("8b5b"),r=1e7,l=1,c=new Map,d=new Map,u=new Map,h=new Map,p=new Map,m=new Map,_=new Map,f=new Map,g=(e,t)=>{_.has(e)||_.set(e,0),f.has(e)||f.set(e,0);const n=_.get(e)+t;_.set(e,n);const o=Math.floor(n/1e8),a=o-f.get(e);a>0&&(console.log("Request provident payment for",e,"count:",a),s.send("request-provident-payment",{infoHash:e,count:10*a}),f.set(e,o))},b=[],y=new Map,v="undefined"!==typeof localStorage?localStorage.getItem("userInfo"):null,w=v?JSON.parse(v):{user:"",sub:""};console.log("Init user",w);let k=null;const C=e=>{k=e,k.userInfo=w,k.on("request-renew",(e=>s.send("webtorrent-request-renew",e))),k.on("verify-payment",(e=>s.send("webtorrent-verify-payment",e)))};s.on("set-user",((e,t)=>{t||(t=e),console.log("set user",t),w.user=t.user,w.sub=t.sub,"undefined"!==typeof localStorage&&localStorage.setItem("userInfo",JSON.stringify(w)),k.torrents.forEach((e=>{e.wires.forEach((e=>{e._is_alphabiz_peer_&&e.alphabiz_protocol&&e.alphabiz_protocol._sendUserInfo()}))}))}));const $=(e,t)=>{t||(t=e),console.log("Payment info",t);const n=k.get(t.infoHash);if(t.payedSize=t.payed*r/l,u.set(t.id,t),!n||!n.wires.length){if(b.some((e=>e.id===t.id)))return;return b.push(t)}for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.remoteSubId){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._send({ab_payment:JSON.stringify({infoHash:t.infoHash,peerId:t.peerId,subId:w.sub,payed:t.payed,autoRenew:!0,id:t.id})})}};s.on("payment-info",$),s.on("restart-payment",$),s.on("payment-verified",((e,t)=>{t||(t=e);const n=k.get(t.infoHash);if(!n||!n.wires.length)return console.log("tr not found");for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.subId){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._onPaymentVerified({infoHash:t.infoHash,peerId:t.peerId,subId:w.sub,payed:t.payed,autoRenew:!0,id:t.id})}})),s.on("finish-payment",((e,t)=>{const n=k.get(t.infoHash);if(!n||!n.wires.length)return console.log("finish: tr not found");for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.remoteSub){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._send({ab_payment_finish:t.transactionId}),o.transactions&&o.transactions.includes(t.transactionId)&&o.transactions.splice(o.transactions.indexOf(t.transactionId),1)}})),s.on("close-payment",((e,t)=>{t||(t=e);const n=k.get(t.infoHash);if(!n||!n.wires.length)return console.log("close: tr not found");for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.remoteSub){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._send({ab_payment_close:JSON.stringify({infoHash:t.infoHash,id:t.id})})}}));const S=e=>{if(console.log("To remove",e),!e||!e.infoHash)return;const t=e.infoHash,n=y.get(t);for(let o=0;o{const a="alphabiz_protocol";class _ extends o{constructor(e){super(),this._wire=e,this._peerId=null,this._infoHash=n.infoHash,this.isSeeding=n.isSeeding,this.download=n.download,this._user=w.user||"",this._subId=w.sub||"",this.remoteSub="",this.uniqueId="",this._wire._setThrottleGroup=e=>this._setThrottleGroup(e),this.maxUploadSpeed=1e6,this._wire.maxUploadSpeed=1e6,this._initUpload(),this._initDownload()}onHandshake(e,t){this._infoHash=e,this._peerId=t,this._sendUserInfo()}_sendUserInfo(){this._user=w.user||"",this._subId=w.sub||"",this._send({ab_peer:"_ab_"+this._peerId,ab_user:this._user,ab_sub:this._subId,ab_has_meta:n.metadata?1:0}),n.metadata||n.once("metadata",(()=>{this._send({ab_has_meta:1})}))}onExtendedHandshake(e){e.m&&e.m[a]||console.error("Client does not support",a)}_sendByteMap(){n.byteMap&&this._send({ab_byte_map:JSON.stringify(n.byteMap)})}_initDownload(){const t=this._wire,n=n=>{if(Math.random()>.99&&e.memoryUsage().rss/1e9>3&&e.exit(1),this.isSeeding)return;if(!this.remoteSub||!this.uniqueId)return void g(this._infoHash,n);p.get(this.uniqueId)||p.set(this.uniqueId,t.downloaded||0);const o=p.get(this.uniqueId);p.set(this.uniqueId,o+n)};t.on("download",n)}_initUpload(){const e=this._wire,t=t=>{if(!this.remoteSub||!this.uniqueId)return;if(this.remoteSub===this._subId)return;const n=c.get(this.uniqueId)-t;if(isNaN(n))return;const o=y.get(this._infoHash);if(o&&o.length&&(o[0].payedSize-=t,o[0].payedSize<0)){const e=o.shift();s.send("webtorrent-payment-completed",{transactionId:e.id,infoHash:this._infoHash,remoteSub:this.remoteSub})}const a=e.uploadSpeed?e.uploadSpeed():1e6;a>this.maxUploadSpeed&&(this.maxUploadSpeed=1e6*Math.ceil(a/1e6),this._wire.maxUploadSpeed=this.maxUploadSpeed);const i=m.get(this.uniqueId)||[],r=i.reduce(((e,t)=>e+(t.maxUploadSpeed||1e6)),0)||this.maxUploadSpeed;if(d.get(this.uniqueId)&&n<5*r){d.set(this.uniqueId,!1);const e=Math.ceil(r/1e6);console.log("[[wt-ext]] _send ab_renew left < 5*speed",e),this.renew(e<10?10:e)}if(n<=0){if(this._setThrottleGroup("mid"),c.set(this.uniqueId,0),d.get(this.uniqueId)||!d.has(this.uniqueId)){const e=Math.ceil(r/1e6);d.set(this.uniqueId,!1),console.log("[[wt-ext]] _send ab_renew from left<=0",e),this.renew(e<10?10:e)}}else this._setThrottleGroup("high"),c.set(this.uniqueId,n)};e.on("upload",t);const o=()=>{this._wire.transactions&&(s.send("webtorrent-task-done",{infoHash:n.infoHash,name:n.name,payments:this._wire.transactions}),this._send({ab_task_done:this._wire.transactions.join("$")}))},a=()=>this._sendByteMap();e.on("close",(()=>{n.off("done",o),n.off("byte-map-change",a);const t=m.get(this.uniqueId);t&&t.includes(e)&&(console.log("remove same wire"),t.splice(t.indexOf(e),1))})),n.on("done",o),n.on("byte-map-change",a)}_onAbPeer(e,t,o){if(!e.startsWith("_ab_"))return;if(this._remotePeerId=e.substring(4),this._wire._is_alphabiz_peer_=!0,this._wire.ab_peer=e,this._wire.remoteUser=t,this._wire.remoteSub=o,this._wire.transactions=[],this.remoteSub=o,this.uniqueId=o+"#"+this._infoHash,m.has(this.uniqueId)){const e=m.get(this.uniqueId);e.includes(this._wire)||e.push(this._wire)}else m.set(this.uniqueId,[this._wire]);if(h.has(this.uniqueId)||h.set(this.uniqueId,0),h.get(this.uniqueId)>this._wire.downloaded&&h.set(this.uniqueId,this._wire.downloaded),n._has_alphabiz_user_=!0,n.emit("ab_peer",e),this._subId===this.remoteSub)return console.log("[wt-ab-peer] Connected to self"),this._sendByteMap(),void this._setThrottleGroup("high");if(o&&c.get(this.uniqueId)>0?this._onPaymentVerified({infoHash:n.infoHash,subId:o,autoRenew:!0,payed:0},!0):(this._setThrottleGroup("mid"),this.isSeeding&&!c.get(this.uniqueId)&&(this._sendByteMap(),setTimeout((()=>{this.renew()}),1e3))),b.length)for(let n=0;n{this._wire&&!this._wire.destroyed||clearInterval(a),this.isSeeding||"mid"!==this._wire.remoteGroup||this.isSeeding||this._onRenew(this.remoteSub,10)}),5e3)}renew(e=10){this._subId!==this.remoteSub?this._subId?this._send({ab_renew:this._subId,ab_count:e}):console.warn("Cannot get subId"):console.log("[wt-renew] Remote account is same as local")}_setThrottleGroup(e){const n=this._wire._uploadThrottle;if(n&&n._group){if(!t.throttleGroups[e])throw new Error("level_not_found");n._group!==t.throttleGroups[e]&&(console.log("[[wt-ext]] _setThrottleGroup",e),d.set(this.uniqueId,!0),"mid"===e&&n._group===t.throttleGroups.high&&(console.log("Peer dropped back to mid. Send renew request",this._subId,this._infoHash),this.renew(),setTimeout((()=>{n._group!==t.throttleGroups.high&&(console.log("Peer is still in mid. Send renew request",this._subId,this._infoHash),this.renew())}),5e3)),n._group._removeThrottle(n),t.throttleGroups[e]._addThrottle(n),n._group=t.throttleGroups[e],console.log("[[wt-ext]] _send ab_speed_group: ",e),this._send({ab_speed_group:e}))}}_onSpeedGroup(e){console.log("[[wt-ext]] _onSpeedGroup",e),this._wire.remoteGroup=e}_onPaymentReceived(e){t.emit("verify-payment",e)}_onPaymentVerified({infoHash:e,payed:t,id:o}){const a=this.remoteSub;if(console.log("payment verified"),!a||!this.uniqueId)return;if(this._setThrottleGroup("high"),d.set(this.uniqueId,!0),!o||u.has(o))return;const s=t*r/l;if(u.set(o,{infoHash:e,payed:t,autoRenew:!0,id:o,payedSize:s}),e!==n.infoHash)return;if(isNaN(s))return;c.has(this.uniqueId)||c.set(this.uniqueId,0);const i=c.get(this.uniqueId);c.set(this.uniqueId,i+s),y.has(e)||y.set(e,[]);const h=y.get(e);h.push({infoHash:e,subId:a,payedSize:s,id:o,startPosition:this._wire.recieved}),this._send({ab_payment_accepted:o})}_onPaymentAccepted(e){this._wire.transactions.push(e)}_onPaymentCompleted(e){console.log("Completed",e,this.remoteSub),s.send("webtorrent-payment-completed",{transactionId:e,remoteSub:this.remoteSub,infoHash:this._infoHash}),this._wire.transactions.includes(e)&&this._wire.transactions.splice(this._wire.transactions.indexOf(e),1)}_onTaskDone(e){const t=e.split("$").filter((e=>e.length));if(console.log("Remote task done"),t.length)for(const n of t)this._onPaymentCompleted(n);c.delete(this.remoteSub,this._infoHash)}_onPaymentFinished(e){console.log("Finished",e);const t=u.get(e);if(t){const o=p.get(this.uniqueId)||0;h.has(this.uniqueId)||h.set(this.uniqueId,0);const a=h.get(this.uniqueId),i=o-a;i>.9*t.payedSize||n.done||n.downloaded>=.9*n.length?(s.send("webtorrent-payment-finished",{id:e,remoteSub:this.remoteSub,infoHash:this._infoHash}),h.set(this.uniqueId,a+(i>t.payedSize?t.payedSize:i)),console.log(`Payment ${e} is finished. Payed for ${t.payedSize}. Received ${i}. Done: ${n.done}`),console.log("Update prev-download",a,h.get(this.uniqueId))):(console.log(`Payment ${e} is marked as not-finished. Payed for ${t.payedSize}. Received ${i}`),console.log(`Prev: ${a}. Downloaded: ${o}`))}else s.send("webtorrent-payment-finished",{id:e,remoteSub:this.remoteSub,infoHash:this._infoHash})}_onPaymentClosed(e){console.log("Close",e),S(e)}_onRenew(e,n=10){const o=n&&parseInt(n)?parseInt(n):10;console.log("[[wt-ext]] _onRenew",e,this._remotePeerId,o),t.emit("request-renew",{infoHash:this._infoHash,peerId:this._remotePeerId,payCount:o,subId:e})}onMessage(e){let t;try{t=i.decode(e)}catch(o){return void console.error("cannot decode buf",e)}if(t.ab_has_meta&&(this._wire.remote_has_meta=!0),t.ab_byte_map&&(this._wire.remote_byte_map=JSON.parse(t.ab_byte_map.toString())),t.ab_peer)return this._onAbPeer(t.ab_peer.toString(),t.ab_user&&t.ab_user.toString(),t.ab_sub&&t.ab_sub.toString());if(t.ab_speed_group)return this._onSpeedGroup(t.ab_speed_group.toString());if(t.ab_payment){const e=JSON.parse(t.ab_payment.toString());return console.log("Protocol payment",e),this._onPaymentReceived(e)}return t.ab_payment_completed?this._onPaymentCompleted(t.ab_payment_completed.toString()):t.ab_payment_accepted?this._onPaymentAccepted(t.ab_payment_accepted.toString()):t.ab_payment_finish?this._onPaymentFinished(t.ab_payment_finish.toString()):t.ab_payment_close?this._onPaymentClosed(JSON.parse(t.ab_payment_close.toString())):t.ab_task_done?this._onTaskDone(t.ab_task_done.toString()):t.ab_renew?this._onRenew(t.ab_renew.toString(),null===(n=t.ab_count)||void 0===n?void 0:n.toString()):void 0;var n}_send(e){const t=Object.entries(this._wire.extendedMapping).find((e=>e[1]===a)),n=t&&t[0];n>=0&&this._wire.extended(Number(n),i.encode(e))}onClose(){console.log("onClose",this._wire);this._wire.recieved}}return _.prototype.name=a,_}}).call(this,n("28d0"))},ee3d:function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="ee3d"},eec3:function(e,t,n){},f039:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("0598");async function a(e,t,a){var s,i;if(console.log("drop",e,e.path,(null===e||void 0===e||null===(s=e.path)||void 0===s?void 0:s[0])===document.body),e&&e.path&&(null===e||void 0===e||null===(i=e.path)||void 0===i?void 0:i[0])===document.body)return void console.log("Drop to body");const r=a&&!t.length;if(r&&!a.match(/^(magnet)|(alphabiz):/))return;const l=!r&&t.length>1,c=!r&&!l&&Object(o["default"])()&&n("61af").existsSync(t[0].path)?n("61af").statSync(t[0].path).isDirectory():!n("a3fc").extname(t[0].path),d=r?"link":l?"file_copy":c?"folder":"insert_drive_file",u=document.createElement("i");u.classList="q-icon material-icons",u.appendChild(document.createTextNode(d)),u.style=`position: fixed; font-size: 36px; transition-duration: 0.5s; opacity: 1;left: ${e.clientX-18}px; top: ${e.clientY-18}px`;const h=document.body.appendChild(u);return new Promise((e=>{setTimeout((()=>{h.style.transform="translateY(24px)"}),50),setTimeout((()=>{h.style.transform+=" scale(4)",h.style.opacity=0,e()}),200),setTimeout((()=>{document.body.removeChild(h)}),1e3)}))}},f157:function(e,t,n){"use strict";n("848e")},f77d:function(e,t,n){"use strict";n("7686")},f817:function(e,t,n){"use strict";n("9f42")},fb31:function(e,t,n){(function(t){const{isElectron:o}=n("d310");if(o())if(this.require)try{const n=this["require"]("developer/app");console.log("Init from node_modules",t),n.appName=n.name,e.exports={default:n,appName:n.name,...n}}catch(a){console.log(">> Cannot require /developer/app from build. Use dev");const t=this["require"]("../../developer/app");t.appName=t.name,console.log("APP name:",t.appName),e.exports={default:t,appName:t.name,...t}}else{const t=o()?require("developer/app"):n("b3f7");t.appName=t.name,console.log("APP name:",t.appName,"production",!0),e.exports={default:t,appName:t.name,...t}}else{const t=n("b3f7");e.exports={appName:t.name,...t}}}).call(this,n("28d0"))},fc65:function(e,t,n){"use strict";n("ac84")},fe8f:function(e,t,n){},feef:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("q-card",{staticStyle:{width:"400px","max-width":"80vw","overflow-x":"hidden"}},[n("q-card-section",["download"===e.mode?n("q-tabs",{staticClass:"text-primary",attrs:{"no-caps":""},model:{value:e.tab,callback:function(t){e.tab=t},expression:"tab"}},[n("q-tab",{attrs:{name:"url",label:this.$t("link_task")}}),n("q-tab",{attrs:{name:"file",label:this.$t("torrent_task")}})],1):n("div",{staticClass:"upload-title text-primary text-center q-mt-sm q-mb-md text-subtitle2"},[e._v("\n "+e._s(e.$t("upload"))+"\n ")])],1),n("q-card-section",{staticClass:"q-pt-none"},["url"===e.tab&&"download"===e.mode?n("q-input",{staticClass:"url-input q-py-sm",attrs:{dense:"",type:"textarea","input-style":"white-space:nowrap"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.input,callback:function(t){e.input=t},expression:"input"}}):e._e(),"file"===e.tab||"upload"===e.mode?n("q-input",{attrs:{readonly:"",type:"text",label:e.$t("file"),value:e.inputFile&&e.inputFile[0]&&e.inputFile[0].name||""}}):e._e(),n("div",{staticClass:"file-selectors"},["file"===e.tab||"upload"===e.mode?n("FileSelector",{attrs:{accept:"download"===e.mode?{extensions:["torrent"]}:null},on:{select:e.onFileSelected}},[n("q-btn",{attrs:{size:"md",unelevated:"","no-caps":"",icon:"note_add",label:e.$t("select_file")}})],1):e._e(),"upload"===e.mode&&e.isElectron?n("FileSelector",{attrs:{directory:""},on:{select:e.onFolderSelected}},[n("q-btn",{attrs:{size:"md",unelevated:"","no-caps":"",icon:"create_new_folder",label:e.$t("select_folder")}})],1):e._e()],1),e.isElectron?n("div",{staticClass:"configuration-variable q-pt-sm"},[n("q-input",{directives:[{name:"show",rawName:"v-show",value:"download"===e.mode&&e.isElectron,expression:"mode === 'download' && isElectron"}],staticStyle:{width:"100%"},attrs:{label:this.$t("download_directory_position")},on:{click:e.selectSavePath},model:{value:e.settings.downloadDirectory,callback:function(t){e.$set(e.settings,"downloadDirectory",t)},expression:"settings.downloadDirectory"}})],1):e._e()],1),n("q-card-actions",{staticClass:"text-primary",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:this.$t("cancel")}}),n("q-btn",{attrs:{flat:"",label:"download"===e.mode?this.$t("download"):this.$t("upload")},on:{click:e.submit}})],1)],1)],1)},a=[],s=n("aecb"),i=s["a"],r=(n("b389"),n("2b5f")),l=n("b2aa"),c=n("e586"),d=n("d7c7"),u=n("74cb"),h=n("ec78"),p=n("0e45"),m=n("3927"),_=n("1043"),f=n("59ba"),g=n("a431"),b=n("09a4"),y=n.n(b),v=Object(r["a"])(i,o,a,!1,null,"a418da6e",null);t["a"]=v.exports;y()(v,"components",{QDialog:l["a"],QCard:c["a"],QCardSection:d["a"],QTabs:u["a"],QTab:h["a"],QInput:p["a"],QFile:m["a"],QBtn:_["a"],QCardActions:f["a"]}),y()(v,"directives",{ClosePopup:g["a"]})}}); \ No newline at end of file +(function(e){function t(t){for(var o,a,r=t[0],l=t[1],c=t[2],d=0,u=[];de+" --- |"),"| ")+"\n";return n+o+e.reduce(((e,t)=>e+t.reduce(((e,t,n)=>n?`${e} \`${t}\` |`:`| ${t} |`),"")+"\n"),"")}function _(e,t){return`
${e}\n\n${t}\n
\n\n`}function f({type:e,text:t,version:n,devInfo:o}){const a=o?_("System info",m(o)):"";return`**Issue type**: ${e}\n\n**Describe the bug**:\n\n${t}\n\n`+(n?`---\n\n**App version**: \`${n}\`\n\n`:"")+(a||"(User disabled submitting system info)")}var g=n("47fc");const b=async()=>{if(Object(p["a"])()){const e=await(await Promise.resolve().then(n.bind(null,"a368"))).Device.getInfo();return[["Key","Value"],["Mode","Mobile(Capacitor)"],["Platform",e.platform],["OS",e.operatingSystem+" "+e.osVersion],["Model",e.model],["Manufacturer",e.manufacturer],["Webview version",e.webViewVersion],["isVirtual",e.isVirtual]]}if(!Object(h["default"])()){const e=Object(g["a"])();return[["Key","Value"],["Mode","Web"],["OS",e.os+" "+e.osVersion],["Browser",e.browser+" "+e.browserVersion],["Mobile",e.mobile?"Yes":"No"],["Platform",navigator.platform||"Unknown"],["User-Agent",navigator.userAgent]]}const{ipcRenderer:e}=await Promise.resolve().then(n.t.bind(null,"b052",7));return new Promise((t=>{e.once("dev-info",((e,n)=>{t([["Key","Value"],["Mode","Electron"],["OS",n.osPlatform?n.osPlatform+" "+n.osRelease:"Unknown"],["OS kernel",n.osVer||"Unknown"],["Electron version",n.electronVer||"Unknown"],["Chrome version",n.chromeVer||"Unknown"],["Node version",n.nodeVer||"Unknown"]])})),e.send("dev-info")}))};async function y({type:e,category:t,title:n,details:o,withDevInfo:a=!1}={}){const s=a?await b():null,r=f({type:e,text:o,version:Object(i["a"])("version"),devInfo:s});return{title:`[${t||e}] ${n}`,body:r}}n("dc89"),n("2425");var v=n("d710");const{github:w}=v["update"],k=`https://github.com/${w.username}/${w.repo}/`;function C({title:e,body:t}){const n=new URL("issues/new",k);return n.searchParams.set("title",e),n.searchParams.set("body",t),n.toString()}var $,S=n("aa9c"),x=n("623f"),T=n.n(x);const I="https://twitter.com/intent/tweet?text=",P=v["twitterAccount"].trim()+" ";function O(e){return S["a"].parseTweet(P+e).weightedLength}const q=(null===T.a||void 0===T.a||null===($=T.a.defaults)||void 0===$?void 0:$.maxWeightedTweetLength)||280;function E(e){return O(e)<=q}function A(e){return e.substring(0,S["a"].parseTweet(e).displayRangeEnd-4)+"..."}function D(e){let t=P+e;return E(e)||(t=A(t)),`${I}${encodeURIComponent(t)}`}var N={props:{show:Boolean},data(){return{title:"",details:"",withDevInfo:!0,target:"github",type:{value:"Twitter",label:this.$t("tweet_us")},typeOptions:[{value:"Twitter",label:this.$t("tweet_us")},{value:"Bug report",label:this.$t("report_a_bug")},{value:"Feature request",label:this.$t("request_a_new_feature")}],category:{value:"",label:this.$t("select_a_category")},categoryOptions:[{value:"",label:this.$t("select_a_category")},{value:"Download",label:this.$t("download_or_upload")},{value:"Player",label:this.$t("player")},{value:"Account",label:this.$t("account")},{value:"Credits",label:this.$t("credits")},{value:"Settings",label:this.$t("settings")},{value:"Others",label:this.$t("others")}]}},computed:{isTwitter(){return"Twitter"===this.type.value},descRules(){return this.isTwitter?[e=>E(e)||this.$t("tweet_too_long")]:[]},twitterLength(){return this.isTwitter?O(this.details):0},restChars(){return q-this.twitterLength},twitterHint(){return this.restChars<0?this.$t("delete_characters",[Math.abs(this.restChars)]):this.$t("rest_characters",[this.restChars])},disableSubmit(){return this.isTwitter?this.restChars<0||!this.details.trim():!this.title.trim()}},methods:{submitTwitter(){E(this.details)&&(window.open(D(this.details),"_blank"),this.close())},async submitGithub(){const e=await y({type:this.type.value,category:this.category.value,title:this.title,details:this.details,withDevInfo:this.withDevInfo});let t;switch(this.target){case"github":t=C(e);break}t&&(window.open(t,"_blank"),this.close())},close(){this.$emit("close")},submit(){return this.isTwitter?this.submitTwitter():this.submitGithub()}}},L=N,j=(n("9e98"),n("2b5f")),R=n("b2aa"),U=n("e586"),F=n("d7c7"),M=n("a4ac"),B=n("0e45"),Q=n("7498"),W=n("1043"),z=n("09a4"),H=n.n(z),V=Object(j["a"])(L,d,u,!1,null,null,null),G=V.exports;H()(V,"components",{QDialog:R["a"],QCard:U["a"],QCardSection:F["a"],QSelect:M["a"],QInput:B["a"],QCheckbox:Q["a"],QBtn:W["a"]});var K=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{staticClass:"diagnotic",attrs:{value:e.show,"content-class":"fullscreen-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:e.close}},[n("q-card",{staticClass:"diagnotic-main"},[n("q-card-section",{staticClass:"flex items-center",class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-weight-bolder"},[e._v(e._s(e.$t("network_diagnotic")))]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"},{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",flat:"",round:""}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-section",{staticClass:"row items-center no-wrap full-width",class:{"q-pt-none":!e.screen$xs}},[n("div",{staticClass:"q-mr-md"},[e.isChecking?n("q-avatar",[n("q-circular-progress",{staticStyle:{"margin-left":"-8px"},attrs:{indeterminate:"",color:"positive",size:"md"}})],1):e.isChecked?n("q-avatar",{attrs:{size:"lg",icon:e.isNetworkError?"close":"done",color:e.isNetworkError?"negative":"positive","text-color":e.isNetworkError?"negative":"positive"}}):n("q-avatar",{attrs:{size:"lg",icon:"construction",color:"general","text-color":"general"}})],1),n("div",[e._v(e._s(e.networkStatus))]),n("div",{staticClass:"col-grow row items-center justify-end"},[n("q-btn",{staticStyle:{width:"128px"},attrs:{"no-wrap":"","no-caps":"",unelevated:"",size:"0.8rem",color:"primary",label:e.$t("diagnotic"),disabled:e.isChecking},on:{click:e.checkNetwork}})],1)]),n("q-card-section",{staticClass:"q-px-none q-pt-none"},[e.isOffline?n("div",{staticClass:"offline"},[e._v(e._s(e.$t("offline")))]):n("div",{staticClass:"logs"},[n("q-item",{class:{disabled:"-"===e.dnsStatus.avgTime||e.dnsStatus.isError}},[n("q-item-section",{attrs:{avatar:""}},[e.dnsStatus.isChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):"-"===e.dnsStatus.avgTime?n("q-avatar",{attrs:{size:"lg",icon:"dns",color:"general","text-color":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:e.dnsStatus.isError?"close":"done",color:e.dnsStatus.isError?"negative":"general","text-color":e.dnsStatus.isError?"negative":"general"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("dns_look_up")))]),e.dnsStatus.isError?n("span",{staticClass:"text-red"},[e._v(e._s(e.$t("error")))]):"-"!==e.dnsStatus.avgTime?n("span",{staticClass:"text-primary"},[e._v(e._s(e.dnsStatus.avgTime+" ms"))]):e._e()],1)],1),n("q-expansion-item",{staticClass:"full-width aws",attrs:{disable:!e.awsStatus.length},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isAwsChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.awsStatus.length?n("q-avatar",{attrs:{size:"lg",icon:e.isAwsError?"close":"done",color:e.isAwsError?"negative":"general","text-color":e.isAwsError?"negative":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:"account_circle",color:"general","text-color":"general"}})],1),n("q-item-section",[e._v(e._s(e.$t("aws_service")))])]},proxy:!0}])},[n("div",{staticClass:"aws-results q-py-md q-px-lg"},e._l(e.awsStatus,(function(t){return n("div",{key:t.name,staticClass:"aws-result"},[n("span",{staticClass:"result-name"},[e._v(e._s(t.name))]),e._v(" -\n "),n("span",{staticClass:"time",class:t.avgTime?"text-primary":"text-red"},[e._v(e._s(t.avgTime?e.$t("online"):e.$t("offline")))])])})),0)]),n("q-expansion-item",{staticClass:"full-width public-ping",attrs:{disable:!e.publicPingStatus.length},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isPublicChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.publicPingStatus.length?n("q-avatar",{attrs:{size:"lg",icon:e.isPublicError?"close":"done",color:e.isPublicError?"negative":"general","text-color":e.isPublicError?"negative":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:"public",color:"general","text-color":"general"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("network_pings")))]),n("small",{staticClass:"q-ml-sm",class:e.isPublicError?"text-red":"text-primary"},[e._v(e._s(e.publicPing))])],1)]},proxy:!0}])},[n("div",{staticClass:"ping-results q-px-lg q-py-md"},e._l(e.publicPingStatus,(function(t){return n("div",{key:t.name,staticClass:"ping-result"},[n("span",{staticClass:"result-name"},[e._v(e._s(t.url))]),e._v(" -\n "),n("span",{staticClass:"time",class:t.alive?"text-primary":"text-red"},[e._v(e._s("-"!==t.avgTime?t.avgTime+"ms":e.$t("not_found"))+" ("+e._s(t.packetLoss)+"% "+e._s(e.$t("packet_loss"))+")")])])})),0)]),n("q-expansion-item",{staticClass:"full-width public-ping",attrs:{disable:!e.privatePingStatus.length},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isPrivateChecking?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.privatePingStatus.length?n("q-avatar",{attrs:{size:"lg",icon:e.isPrivateError?"close":"done",color:e.isPrivateError?"negative":"general","text-color":e.isPrivateError?"negative":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:"star",color:"general","text-color":"general"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("official_site")))])],1)]},proxy:!0}])},[n("div",{staticClass:"ping-results q-px-lg q-py-md"},e._l(e.privatePingStatus,(function(t){return n("div",{key:t.name,staticClass:"ping-result"},[n("span",{staticClass:"result-name"},[e._v(e._s(t.url))]),e._v(" -\n "),n("span",{staticClass:"time",class:t.alive?"text-primary":"text-red"},[e._v(e._s("-"!==t.avgTime?t.avgTime+"ms":e.$t("not_found"))+" ("+e._s(t.packetLoss)+"% "+e._s(e.$t("packet_loss"))+")")])])})),0)]),n("q-expansion-item",{staticClass:"full-width",attrs:{disable:e.trackerStatus.success.length+e.trackerStatus.fail.length===0},scopedSlots:e._u([{key:"header",fn:function(){return[n("q-item-section",{attrs:{avatar:""}},[e.isDownloading?n("q-avatar",[n("q-circular-progress",{attrs:{indeterminate:""}})],1):e.isDownloadInit?n("q-avatar",{attrs:{size:"lg",icon:"lan",color:"general","text-color":"general"}}):n("q-avatar",{attrs:{size:"lg",icon:e.isDownloadError?"close":"done",color:e.isDownloadError?"negative":"general","text-color":e.isDownloadError?"negative":"general"}})],1),n("q-item-section",[e._v(e._s(e.$t("download_test")))])]},proxy:!0}])},[n("div",{staticClass:"download-results q-px-lg q-py-md"},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showTrackerResult,expression:"showTrackerResult"}],staticClass:"trackers"},[n("span",{staticClass:"result-name"},[e._v("Trackers")]),e._v("\n - "+e._s(e.trackerStatus.success.length)+" "+e._s(e.$t("connected"))+"\n ")]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showTorrentResult,expression:"showTorrentResult"}],staticClass:"torrent"},[n("span",{staticClass:"result-name"},[e._v(e._s(e.$t("test_task",["6.9 MB"])))]),n("span",[e._v(" - ")]),e.torrentStatus.isError?n("span",{staticClass:"text-red"},[e._v(e._s(e.$t("download_failed")))]):-1===e.torrentStatus.time?n("span",{staticClass:"text-normal"},[e._v(e._s(e.$t("downloading"))+"...")]):n("span",{staticClass:"text-primary"},[e._v(e._s(e.$t("second_spend",[e.torrentStatus.time])))])])])])],1)]),n("q-card-actions",{directives:[{name:"show",rawName:"v-show",value:!e.screen$xs,expression:"!screen$xs"}],staticClass:"q-px-md q-pb-md q-pt-none",attrs:{align:"right"}},[n("q-btn",{attrs:{unelevated:"",label:e.$t("close")},on:{click:e.close}})],1)],1)],1)},Y=[],J=n("d7df"),X={props:{show:Boolean},data(){return{isChecked:!1,isChecking:!1,isOnline:!1,networkStatus:this.$t("click_to_check"),dnsStatus:{isChecking:!1,isError:!1,results:[],avgTime:"-"},isPrivateChecking:!1,isPrivateError:!1,privatePingStatus:[],isPublicChecking:!1,isPublicError:!1,publicPing:"",publicPingStatus:[],isAwsChecking:!1,isAwsError:!1,awsStatus:[],trackerStatus:{success:[],fail:[],isChecking:!1,isError:!1},torrentStatus:{isChecking:!1,isError:!1,time:-1}}},computed:{isOffline(){return this.isChecked&&!this.isOnline},showPrivateResult(){return this.privatePingStatus.isChecking||"-"!==this.privatePingStatus.avgTime},isDownloading(){return this.trackerStatus.isChecking||this.torrentStatus.isChecking},isDownloadError(){return this.trackerStatus.isError||this.torrentStatus.isError},isDownloadInit(){return!this.isDownloadError&&!this.trackerStatus.isError&&-1===this.torrentStatus.time},showTrackerResult(){return this.trackerStatus.isChecking||this.trackerStatus.isError||!!this.trackerStatus.success.length},showTorrentResult(){return this.torrentStatus.isChecking||this.torrentStatus.isError||this.torrentStatus.time>-1},isNetworkError(){return this.isChecked&&(!this.isOnline||this.isDownloadError||this.dnsStatus.isError||this.isAwsError||this.privatePingStatus.some((e=>!e.alive))||this.publicPingStatus.every((e=>!e.alive)))}},methods:{initCheck(){this.isChecking=!0,this.dnsStatus={isChecking:!0,isError:!1,results:[],avgTime:"-"},this.isPrivateChecking=!1,this.isPrivateError=!1,this.privatePingStatus=[],this.isPublicChecking=!0,this.publicPing="",this.publicPingStatus=[],this.isPublicError=!1,this.isAwsChecking=!0,this.isAwsError=!1,this.awsStatus=[],this.trackerStatus={success:[],fail:[],isChecking:!0,isError:!1},this.torrentStatus={isChecking:!0,isError:!1,time:-1},this.networkStatus=this.$t("checking")+"..."},checkNetwork(){this.initCheck(),console.log("check"),J["a"].emit("check-network")},onCheckResult(e){switch(e.type){case"isOnline":this.isOnline=e.result;break;case"dnsCheckResult":this.dnsStatus.isChecking=!1,e.result.fail.length?this.dnsStatus.isError=!0:this.dnsStatus.isError=!1,this.dnsStatus.results.splice(0),this.dnsStatus.results.push(...e.result.success,...e.result.fail),this.dnsStatus.avgTime=e.result.avgTime;break;case"publicPingResult":this.isPublicChecking=!0,this.publicPingStatus.push(e.result),e.result.alive||(this.isPublicError=!0);break;case"publicPingEnd":this.isPublicChecking=!1,this.publicPing=e.result;break;case"privatePingResult":this.isPrivateChecking=!0,this.privatePingStatus.push(e.result),e.result.alive||(this.isPrivateError=!0);break;case"privatePingEnd":this.isPrivateChecking=!1;break;case"pingAwsEnd":this.isAwsChecking=!1,this.awsStatus.splice(0),this.awsStatus.push(...e.successServices,...e.errorServices),this.isAwsError=e.error;break;case"trackerCheckResult":"connected"===e.result.result?this.trackerStatus.success.push(e.result.url):this.trackerStatus.fail.push(e.result.url);break;case"trackerCheckEnd":this.trackerStatus.isChecking=!1,this.trackerStatus.success.splice(0),this.trackerStatus.success.push(...e.result.success),this.trackerStatus.fail.splice(0),this.trackerStatus.fail.push(...e.result.fail),e.result.success.length||(this.trackerStatus.isError=!0);break;case"torrentCheckResult":this.torrentStatus.isChecking=!1,this.torrentStatus.isError=e.result.error,this.torrentStatus.time=e.result.time;break}},onCheckEnd(e){console.log("end",e),"isOnline"in e&&(this.isOnline=e.isOnline),this.isChecking=!1,this.isChecked=!0,this.networkStatus=this.$t("click_to_check_again")},close(){this.$emit("close")}},mounted(){J["a"].on("check-network-end",this.onCheckEnd),J["a"].on("check-network-result",this.onCheckResult)},beforeDestroy(){J["a"].off("check-network-end",this.onCheckEnd),J["a"].off("check-network-result",this.onCheckResult)}},Z=X,ee=(n("88f5"),n("990e")),te=n("fc38"),ne=n("9f3e"),oe=n("64e7"),ae=n("b329"),se=n("25fb"),ie=n("79e0"),re=n("5bbd"),le=n("59ba"),ce=n("a431"),de=Object(j["a"])(Z,K,Y,!1,null,"8fee9c62",null),ue=de.exports;H()(de,"components",{QDialog:R["a"],QCard:U["a"],QCardSection:F["a"],QSpace:ee["a"],QBtn:W["a"],QSeparator:te["a"],QAvatar:ne["a"],QCircularProgress:oe["a"],QItem:ae["a"],QItemSection:se["a"],QItemLabel:ie["a"],QExpansionItem:re["a"],QCardActions:le["a"]}),H()(de,"directives",{ClosePopup:ce["a"]});var he=n("9f21");const{github:pe}=v["update"],me=l.a.renderer();var _e={name:"AboutDialog",mixins:[he["a"]],components:{Feedback:G,NetworkDiagnotic:ue},data(){return{displayName:v["displayName"],isElectron:me,isCapacitor:Object(p["a"])(),iconClickTime:0,dialogVisible:!1,appVersion:Object(i["a"])("version"),loading:!1,primaryIcon:"developer/assets/icon-256.png",showFeedback:!1,showNetworkDiagnotic:!1}},created(){s["Bus"].$on("CALL_ABOUT",(()=>{this.dialogVisible=!0})),s["Bus"].$on("CALL_NETWORK_DIAGNOSTIC",(()=>{this.toggleNetworkDiagnotic(!0)})),me&&Promise.resolve().then(n.t.bind(null,"b052",7)).then((({ipcRenderer:e})=>{e.on("about-dialog",(()=>{this.dialogVisible=!0}))}))},computed:{isAlphabizExperimental(){return"Alphabiz"===v["displayName"]&&(this.appVersion.includes("internal")||this.appVersion.includes("nightly"))}},methods:{close(){this.dialogVisible=!1},browserRelease(){const e=`https://github.com/${pe.username}/${pe.repo}/releases`;me?Promise.resolve().then(n.t.bind(null,"b052",7)).then((t=>{t.ipcRenderer.send("to_browserurl",e)})):window.open(e,"_blank")},clickIcon(){this.iconClickTime+=1,setTimeout((()=>{this.iconClickTime-=1}),3e3),5===this.iconClickTime&&(console.log("enable!"),me?(n("b052").ipcRenderer.send("enable_devtools"),c["a"].dispatch("fetchSettings")):c["a"].dispatch("set",{disableDevTools:!1}).then((()=>{c["a"].dispatch("fetchSettings")})),this.$q.notify("DevTools is enabled"))},toggleFeedback(e){console.log("toggle",e),this.showFeedback=e},toggleNetworkDiagnotic(e){this.showNetworkDiagnotic=e}}},fe=_e,ge=(n("3c8a"),n("9767")),be=n("4101"),ye=Object(j["a"])(fe,o,a,!1,null,"e4afc3b8",null);t["a"]=ye.exports;H()(ye,"components",{QDialog:R["a"],QCard:U["a"],QCardSection:F["a"],QSpace:ee["a"],QBtn:W["a"],QSeparator:te["a"],QImg:ge["a"],QColor:be["a"]})},"030c":function(e,t,n){"use strict";n("ca31")},"0336":function(e,t,n){},"053d":function(e,t,n){},"058f":function(e,t,n){},"0598":function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"default",(function(){return a}));const o=Boolean((()=>"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||"undefined"!==typeof e&&"object"===typeof e.versions&&e.versions.electron||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.includes("Electron"))());function a(){return o}}.call(this,n("28d0"))},"06cd":function(e,t,n){"use strict";n("326b")},"06e8":function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c}));n("d4b5"),n("de6c"),n("7996");var o=n("e75b");const a=new o["a"].Rest("ABDevRest"),s=e=>{let t,n,o,s;const i=()=>!1!==s,r=e=>{t=e.query_type,n=e.query_params||{},o=[],s=void 0},l=()=>a.post("/credit/transaction/query",{query_type:t,query_params:JSON.stringify(n),next_token:s}).then((e=>{var t;o.push(...e.items),s=null!==(t=e.nextToken)&&void 0!==t&&t}));return e&&r(e),{reset:r,getData:()=>o,hasNext:i,fetch:l}},i=o["a"].GQL,r={enable:async e=>await i.enableUserListener(e),disable:async()=>{i.removeUserListener("credits"),i.disableUserListener()},addHandler:(e,t)=>{i.addUserListener("credits",(n=>{void 0!==n[e]&&t(n[e])}))},addHandlers:(e,t)=>{i.addUserListener("credits",(t=>{Object.entries(t).forEach((([t,n])=>{e[t]&&e[t](n)}))}),t)}},l={state:"disabled",resolver:null,async enable({rootState:e,rootGetters:t,dispatch:n}){const o=()=>e.account.sub,a=()=>t.transactions.expenses,s=e=>n("CREDIT_PAY_DATA_CANCEL",{transactionId:e.id}),i=e=>t=>{const n=2592e5;if("PAYDATA"!==t.category)return!1;if(t.payerId!==o())return!1;if("PENDING"!==t.status)return!1;const a=e.getTime()-new Date(t.createdAt).getTime();return!(a<=n)},r=async()=>{const e=a(),t=e.filter(i(new Date));for(const n of t)console.log("TxnCancellation:",n.id),await s(n)};c.state="idle";const l=3e5;while(!["stopping","disabled"].includes(c.state)){let e=l;if("idle"===c.state){c.state="processing";const t=(new Date).getTime();if(await r(),["stopping","disabled"].includes(c.state))break;const n=(new Date).getTime();e-=Math.max(0,Math.min(l,n-t))}if(e&&(c.state="waiting",await new Promise((t=>setTimeout(t,e))),["stopping","disabled"].includes(c.state)))break;c.state="idle"}console.error("TxnCancellation resolver"),c.resolver?c.resolver():console.error("resolver not found")},async disable(){if(["stopping","disabled"].includes(c.state))return;if(["waiting"].includes(c.state))return void(c.state="disabled");const e=new Promise((e=>{c.resolver=()=>{e(),c.resolver=null}}));c.state="stopping",await e,c.state="disabled"}},c=new Proxy(l,{get(e,t,n){return Reflect.get(e,t,n)},set(e,t,n,o){return"state"===t&&console.log("TxnCancellation:",n),Reflect.set(e,t,n,o)}})},"071f":function(e,t,n){"use strict";n("25b9")},"072b":function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"h",(function(){return m})),n.d(t,"b",(function(){return _})),n.d(t,"g",(function(){return f})),n.d(t,"f",(function(){return g}));n("de6c");const o="`~!@#$%^&*()\\-_=+[\\]\\\\;',./{}|:\"<>?",a=(e,t)=>{const n=new RegExp(`^[${t.join("")}]*$`);return n.test(e)},s=(e,t=1,n=1/0)=>void 0!==e&&("string"===typeof e&&0===e.length||e.length>=t&&e.length<=n),i=e=>!/\s\s/.test(e),r=e=>/[0-9]/g.test(e),l=(e,t)=>void 0===e||("string"===typeof e&&0===e.length||new RegExp(`^[^${t.join("")}]`).test(e)),c=(e,t)=>void 0===e||("string"===typeof e&&0===e.length||new RegExp(`[^${t.join("")}]$`).test(e)),d=function(e){const t=["0-9","A-Z","a-z","一-龥","\\s","_"];if(!a(e,t))return this.$t("account_field_only_chinese_alphanumeric_space_underline");const[n,o]=[2,15];return s(e,n,o)?l(e,["0-9","\\s"])?c(e,["\\s"])?!!i(e)||this.$t("account_field_without_repeat_space"):this.$t("account_field_suffix_without_space"):this.$t("account_field_prefix_without_number_space"):this.$t("account_field_range",[n,o])},u=function(e){const t=["0-9","A-Z","a-z",o];if(!a(e,t))return this.$t("account_field_only_alphanumeric_and_symbol");const[n,i]=[8,20];return s(e,n,i)?r(e)?void 0:this.$t("account_field_must_have_number_characters"):this.$t("account_field_range",[n,i])},h=function(e){if(!/^([a-zA-Z]|[0-9])(\w|-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(e))return this.$t("account_invalid_email_format")},p=function(e){if(!a(e,["0-9"]))return this.$t("account_field_phone_number");const[t,n]=[3,11];return s(e,t,n)?void 0:this.$t("account_field_range",[t,n])},m=function(e){return a(e,["0-9"])&&s(e,6,6)?void 0:this.$t("account_field_verification_code")},_=function(e){const t=["0-9","A-Z","a-z"];if(!a(e,t))return this.$t("account_field_invitation_code")},f=function(e){const t=["0-9","a-f","-"];return a(e,t)&&"8-4-4-4-12"===e.split("-").map((e=>e.length)).join("-")||this.$t("tip_invalid_receiver")},g=function(e){return/^((\d{1,3}(\.\d{1,3})?)|(1000(\.0{1,3})?))$/.test(e)?[""+parseFloat(e)===e,parseFloat(e)<=1e3,parseFloat(e)>=.001,parseInt(1e3*parseFloat(e))===1e3*parseFloat(e)].some((e=>!e))?this.$t("tip_invalid_amount"):void 0:this.$t("tip_invalid_amount")}},"0742":function(e,t,n){},"076e":function(e,t,n){"use strict";n("de6c");const o={oauth_stage:{authorize:["Authorizing","授权中...","授權中..."],logging_in:["Logging in","登陆中...","登入中..."],connecting:["Connecting","关联中...","關聯中..."]},oauth_connect:{connect_to:["Connect to {provider}","关联 {provider} 账号","關聯 {provider} 賬號"],notify:{connected:["{provider} connected","已关联 {provider} 账号","已關聯 {provider} 賬號"]}},oauth_disconnect:{disconnect:["Disconnect {provider}","解除 {provider} 账号关联","解除 {provider} 賬號關聯"],notify:{disconnected:["{provider} disconnected","已解除 {provider} 账号关联","已解除 {provider} 賬號關聯"]}},oauth_login:{sign_in_with:["Sign in with {provider}","通过 {provider} 登录","通過 {provider} 登錄"],notify:{signed_in:["Signed in","登录成功","登錄成功"]}},oauth_error:{can_not_login_unconnected_account:["Can not log in to an unconnected {provider} account","无法登录未关联的 {provider} 账号","無法登錄未關聯的 {provider} 賬號"],oauth_account_has_been_connected:["The {provider} account has been connected","该 {provider} 账号已建立关联","該 {provider} 賬號已建立關聯"]},oauth_unset:["unset","未关联","未關聯"]},a=e=>{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};t["a"]={messages:a(o)}},"0885":function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return g})),n.d(t,"a",(function(){return b}));n("7a76"),n("de6c");var o=n("3387"),a=n("f680"),s=n("5584"),i=n("d310"),r=n("1926"),l=n("d7df"),c=n("84f6"),d=n("d558");const u={started:[],toVerify:{},toSubmit:{},toFinish:{},toPause:{}},h={},p=1e7,m="\n background-color: rgb(90,90,90);\n color: white;\n padding: 1px 5px;\n border-radius: 8px;\n border: 2px solid rgb(161,161,161);\n",_=()=>{const t={set:t=>e.notified_credit_not_enough_amount=t,get:()=>!!e.notified_credit_not_enough_amount};t.get()||(t.set(!0),a["a"].create({group:"credit_not_enough_amount",message:r["b"].t("credit_not_enough_amount"),type:"negative",position:"bottom-right",timeout:6e3,actions:[{icon:"close",color:"negative",handler:()=>t.set(!1)}]}))};function f(e,t){h[e]=t}function g(e,t=!1){t?(console.log("restart transaction",e),l["a"].emit("restart_payment",e)):l["a"].emit("credit_payment_created",e),u.started.push(e.id)}async function b(e,t=!1,n){console.log("Create payment",e,t);const{infoHash:o,remoteSubId:s,payed:i}=e,l=Date.now().toString();try{const c=await n.dp$request(s,i,{infoHash:o,timestamp:l});g({...e,id:c}),t||a["a"].create(r["b"].t("success"))}catch(c){if(console.log("dp$request failed",c.message),"credit_not_enough_amount"===c.message)return void _();t||a["a"].create(c.message||c)}}function y(e){e.$watch("dp$incomeStatusMapper",((e,t)=>{Object(o["isEqual"])(e,t)||e.PENDING&&e.PENDING.forEach((e=>{u.toVerify[e]&&u.toVerify[e](),u.toSubmit[e]&&u.toSubmit[e]()}))})),e.$watch("dp$expenseStatusMapper",((t,n)=>{Object(o["isEqual"])(t,n)||(t.PENDING&&t.PENDING.forEach((t=>{if(u.started.includes(t))return;const n=e.dp$expenseTxnDict[t],o=JSON.parse(n.meta);console.log("dp$restart from StatusMapper"),g({infoHash:o.infoHash,remoteSubId:n.payeeId,payed:n.amount,autoRenew:!!h[o.infoHash],id:n.id},!0)})),t.COMPLETED&&t.COMPLETED.forEach((e=>{u.toFinish[e]&&u.toFinish[e]()})))})),l["a"].on("verify_payment",(t=>{if(console.log("onVerify",t),void 0===u.toVerify[t.id]){const n=async()=>{u.toVerify[t.id]=!1;const n=e.dp$incomeTxnDict[t.id],o=e=>{throw new Error(`DataPayment(${t.id}) Verify failed: ${e}`)};n.amount!==t.payed&&o("mismatched amount"),l["a"].emit("payment_verified",t)};u.toVerify[t.id]=n}const n=e.dp$incomeStatusMapper.PENDING;n&&n.includes(t.id)&&(u.toVerify[t.id]&&u.toVerify[t.id](),delete u.toVerify[t.id])})),l["a"].on("torrent_metadata",(t=>{var n;l["a"].emit("save_torrent_file",t),f(t,!0);const o=e.dp$expenseHashMapper[t];if(!o)return;const a=null===(n=e.dp$expenseStatusMapper.PENDING)||void 0===n?void 0:n.filter((e=>o.includes(e)));a&&a.length&&a.forEach((n=>{const o=e.dp$expenseTxnDict[n];console.log("dp$restart from resumeAccelerate"),g({infoHash:t,remoteSubId:o.payeeId,payed:o.amount,autoRenew:h[t],id:o.id},!0)}))})),l["a"].on("request_renew",(t=>{var o;const{subId:a,infoHash:s,peerId:r}=t,l=Object(i["isElectron"])()||Object(d["a"])()?c["a"].allTasks.find((e=>e.infoHash===s)):n("c620").getTaskInstance();if(!l||l.paused||l.done||!l.connections)return;const u=null===(o=l.connections)||void 0===o?void 0:o.find((e=>e.subId===a));if(!u)return;if(!u.hasResource)return void console.log("Remote peer does not have resource. Skip renew.",a,s,r);const h=e.dp$expenseHashMapper[s]||[],m=e.dp$expenseStatusMapper.PENDING||[],_=(null===m||void 0===m?void 0:m.filter((e=>h.includes(e))))||[];if(_.length>10)return console.log("too many pending payments",_);const g=_.filter((t=>{if(!e.dp$expenseTxnDict)return!1;if(e.dp$expenseTxnDict[t]){const n=e.dp$expenseTxnDict[t];return"PENDING"===n.status&&n.payeeId===a}return!1}));if(g.length>3)return console.log(`Too many pending payments for remote subId ${t.subId}`,_);const y=l.length-l.recieved;let v=t.payCount||10;y{console.log("payment completed",t),void 0===u.toSubmit[t.transactionId]&&(u.toSubmit[t.transactionId]=async()=>{u.toSubmit[t.transactionId]=!1,await e.dp$submit(t.transactionId),l["a"].emit("finish_payment",t)});const n=e.dp$incomeStatusMapper.PENDING;n&&n.includes(t.transactionId)&&u.toSubmit[t.transactionId]&&u.toSubmit[t.transactionId]()})),l["a"].on("payment_finished",(t=>{console.log("Finished",t.id),void 0===u.toFinish[t.id]&&(u.toFinish[t.id]=async()=>{u.toFinish[t.id]=!1;try{await e.dp$confirm(t.id);const n=e.dp$expenseTxnDict[t.id];l["a"].emit("payment_closed",{id:n.id,infoHash:JSON.parse(n.meta).infoHash,remoteSub:n.payeeId})}catch(n){console.error("dp$toFinish failed:",n.message)}});const n=e.dp$expenseStatusMapper.COMPLETED;n&&n.includes(t.id)&&u.toFinish[t.id]&&u.toFinish[t.id]();const o=e.dp$expenseStatusMapper.PENDING;o&&o.includes(t.id)&&u.toFinish[t.id]&&u.toFinish[t.id]()})),l["a"].on("request-provident-payment",(async e=>{console.log("%cRequest provident payment",m,e);try{await s["a"].dispatch("CREDIT_PF_DEPOSIT",{amount:e.count,meta:{infoHash:e.infoHash,timestamp:Date.now().toString()}})}catch(t){"credit_not_enough_amount"===t.message&&_()}}))}t["b"]=y}).call(this,n("0ee4"))},"0925":function(e,t,n){"use strict";function o(e){return{Github:"fab fa-github",Twitter:"fab fa-twitter",Google:"fab fa-google"}[e]}function a({title:e,providerName:t}){const n=(n,a)=>({title:this.$t(e,{provider:t}),ok:!1,cancel:a.cancel,banner:{avatar:o(t),title:this.$t(`oauth_stage.${n}`,{provider:t})}});let a;const s={updateStage:(e,s)=>{a?a.update({banner:{avatar:o(t),title:this.$t(`oauth_stage.${e}`,{provider:t})}}):a=this.$alphabiz.dialog(n(e,s))},hide:()=>{var e;null===(e=a)||void 0===e||e.hide()}};return s}t["a"]={getIcon:o,useOAuthFlowDialog:a}},"0928":function(e,t,n){"use strict";n("7405")},"09e8":function(e,t,n){"use strict";n("d4b5");var o=n("5584");class a{constructor(e){Object.defineProperty(this,"_data",{get(){return e}});const t=()=>{const t=["id","status","payerId","payeeId","amount","meta"],n={};return t.forEach((e=>n[e]=this[e])),Object.defineProperty(n,"_data",{get(){return e}}),n};return t()}get id(){return null}get status(){return null}get payerId(){return null}get payeeId(){return null}get amount(){return null}get meta(){return null}}class s{constructor(e){this.name=e}dp$address(){}dp$credit(){}dp$incomeTxnList(){}dp$expenseTxnList(){}dp$incomeTxnListToday(){}async dp$request(e,t,n){}async dp$cancel(e){}async dp$submit(e,t){}async dp$confirm(e,t){}}n("de6c");const i=(...e)=>{let t,n,o;"string"===typeof e[0]?(t={warn:[{bgc:"rgb(250,211,138)",color:"black"},{bgc:"rgb(155,123,53)",color:"white"}]}[e[0]],n=e[1],o=e.slice(2)):(t=[{bgc:"gainsboro",color:"black"},{bgc:"grey",color:"white"}],n=e[0],o=e.slice(1));const a=e=>`background-color: ${e.bgc}; color: ${e.color}; padding: 2px 12px;`,s=Array.from(n,((e,o)=>{let s=a(t[(o+1)%2]);return 0===o?s+=" border-top-left-radius: 8px; border-bottom-left-radius: 8px;":o===n.length-1&&(s+=" border-top-right-radius: 8px; border-bottom-right-radius: 8px;"),s})),i=n.map((e=>`%c${e}`)).join("");console.log(i,...s,...o)};class r{constructor({parallelCount:e}={}){this.queue=[],this.started=!1,this.parallelCount=e||1}append(...e){return this.queue.push(...e),this}async start(){if(!this.started){this.started=!0;while(this.started)if(this.queue.length>0){const e=this.queue.splice(0,this.parallelCount),t=e=>new Promise((t=>{const n=e();n&&n.then&&n.catch?n.then(t):t()}));await Promise.all(e.map(t))}else await this.wait(3e3)}}stop(){this.started=!1}async wait(e){await new Promise((t=>setTimeout(t,e)))}async promise(e){let t;if(await new Promise((n=>{this.append((()=>e().then(n,(e=>t=e))))})),t)throw t}}const l=async(e,t)=>{let n=0;const o=Math.floor(1e3*Math.random()),a=e=>{if(n+=1,!["Invalid transaction: status should be PENDING","Invalid transaction: status should be PENDING or COMPLETED","Transaction cancelled, please refer cancellation reasons for specific reasons [None, ConditionalCheckFailed]","Transaction cancelled, please refer cancellation reasons for specific reasons [None, ValidationError]"].includes(e.message)){if("Network Error"===e.message)return i("warn",["dp$retry",o,e.code],e.message),!0;if(["Transaction cancelled, please refer cancellation reasons for specific reasons [None, TransactionConflict]"].includes(e.message))return i("warn",["dp$retry",o,"TransactionConflict",e.code],e.message),!0;if(n{if(!a(t))return;const n=Math.floor(1e3*Math.random());return new Promise((e=>setTimeout(e,n))).then(e).catch(s)},r=await e().catch(s);return r};class c extends s{constructor(){super("amplify"),this.asyncQueue=new r({parallelCount:1}),this.asyncQueue.start().then((()=>{console.log("dp$asyncQueue: stop")}))}dp$address(){return o["a"].state.account.sub}dp$credit(){return o["a"].state.credits.credit}dp$incomeTxnList(){const e=o["a"].getters.transactions.income.filter((e=>"PAYDATA"===e.category));return e}dp$expenseTxnList(){const e=o["a"].getters.transactions.expenses.filter((e=>"PAYDATA"===e.category));return e}dp$incomeTxnListToday(){const e=o["a"].getters.incomeTodayTransactions.filter((e=>"PAYDATA"===e.category));return e}async dp$request(e,t,n){let a;const s=async()=>{a=await o["a"].dispatch("CREDIT_PAY_DATA_REQUEST",{receiverSub:e,amount:t,meta:n})};return await l(s,5),a.id}async dp$cancel(e){const t=async()=>{await o["a"].dispatch("CREDIT_PAY_DATA_FINISH",{transactionId:e})};await l(t,5)}async dp$submit(e,t){const n=async()=>{t?console.warn("dp$warn: abandoned is not supported for amplify mode."):await o["a"].dispatch("CREDIT_PAY_DATA_COMPLETED",{transactionId:e})};await l(n,5)}async dp$confirm(e,t){const n=async()=>{t?console.warn("dp$warn: failed is not supported for amplify mode."):await o["a"].dispatch("CREDIT_PAY_DATA_FINISH",{transactionId:e})};await l(n,5)}}var d=n("7ca3"),u=n.n(d);n("7a76");class h extends a{__parseStatus(e){const t={0:"PENDING",1:"FINISH",3:"FINISH",4:"COMPLETED",5:"FINISH",6:"FAILED"},n=t[e];if(!n)throw new Error("Unexpected state",e);return n}get id(){return[this._data.publisher,this._data.performer,this._data.index].join("::")}get status(){return this.__parseStatus(this._data.state)}get payerId(){return this._data.publisher}get payeeId(){return this._data.performer}get amount(){return parseInt(this._data.amount)}get meta(){return this._data.meta_data}}const p=async(e,t)=>{let n=0;const o=Math.floor(1e3*Math.random()),a=e=>{if(n+=1,i("warn",["retryHandler"],e.message),"Out of gas"===e.message)throw i("warn",["dp$retry",o,"failed"],e.message),e;if("invalid transaction: INSUFFICIENT_BALANCE_FOR_TRANSACTION_FEE"===e.message)throw i("warn",["dp$retry",o,"failed"],e.message),e;if("Network Error"===e.message)return i("warn",["dp$retry",o,e.code],e.message),!0;if("invalid transaction: SEQUENCE_NUMBER_TOO_OLD"===e.message)return i("warn",["dp$retry",o,n,e.code],e.message),!0;if("transaction is rejected: InvalidUpdate - Transaction already in mempool"===e.message)return i("warn",["dp$retry",o,n],e.message),!0;if(e.is_move_error){if("1031"===e.code)return void i("warn",["dp$retry",o,"skip",e.code],"txn status was deactivated");if("1281"===e.code)return void i("warn",["dp$retry",o,"skip",e.code],"txn status has been changed");throw i("warn",["dp$retry",o,"failed",e.code],e.message),e}if(n{if(!a(t))return;const n=Math.floor(1e3*Math.random());return new Promise((e=>setTimeout(e,n))).then(e).catch(s)},r=await e().catch(s);return r};let m;class _ extends s{constructor(){super("blockchain"),m=window.$blockchain}dp$address(){return m.$store.account.address}dp$credit(){return m.$store.wallet.balance.TestCoin}dp$incomeTxnList(){const e=Object.values(m.$store.DataProviding.txnDict).filter(_.incomeFilter);return e.map((e=>new h(e)))}dp$expenseTxnList(){const e=Object.values(m.$store.DataProviding.txnDict).filter(_.expensesFilter);return e.map((e=>new h(e)))}dp$incomeTxnListToday(){const e=Object.values(m.$store.DataProviding.txnDict).filter(_.incomeFilter);return e.map((e=>new h(e)))}async dp$request(e,t,n){const o=async()=>{const o=await m.$store.DataProviding.publishDataProvidingTxn({address:e,amount:t,meta:JSON.stringify(n)}),a=o.getTaskId(),s=[a.publisher,a.performer,a.index].join("::");return s};return await p(o,5)}async dp$cancel(e){const t=async()=>{const t=await m.$store.DataProviding.cancelDataProvidingTxn({txnKey:e});console.log("postTxnCancel >>",t)};await p(t,5)}async dp$submit(e,t){const n=async()=>{const n=await m.$store.DataProviding.submitDataProvidingTxn({txnKey:e,abandoned:t});console.log("postTxnComplete >>",n)};await p(n,5)}async dp$confirm(e,t){const n=async()=>{const n=await m.$store.DataProviding.confirmDataProvidingTxn({txnKey:e,failed:t});console.log("postTxnFinish >>",n)};await p(n,5)}}function f(){const e={},t={},n=b.call(this,{dp$incomeTxnList:"dp$incomeTxnDict",dp$expenseTxnList:"dp$expenseTxnDict"}),o=y.call(this,{dp$incomeStatusMapper:e=>e.status,dp$incomeHashMapper:e=>{if(!e.meta)return;let n=t[e.id];if(void 0!==n)return n.infoHash;try{n=JSON.parse(e.meta)}catch{n={},console.warn("failed to parse txn meta")}return t[e.id]=n,n.infoHash}}),a=y.call(this,{dp$expenseStatusMapper:e=>e.status,dp$expenseHashMapper:e=>{if(!e.meta)return;let n=t[e.id];if(void 0!==n)return n.infoHash;try{n=JSON.parse(e.meta)}catch{n={},console.warn("failed to parse txn meta")}return t[e.id]=n,n.infoHash}});e.updateIncomeData=()=>{n.dp$incomeTxnList(),o("dp$incomeTxnList")},e.updateExpenseData=()=>{n.dp$expenseTxnList(),a("dp$expenseTxnList")};const s=g.call(this,"dp$incomeTxnDict"),i=g.call(this,"dp$expenseTxnDict");e.logIncomeStatus=(e,t)=>s(e,t),e.logExpenseStatus=(e,t)=>i(e,t),this.dp$utils=e}function g(e){const t=(t,n)=>this[e][t]&&i(["dp$status",n||"[payment]","=>",this[e][t].status],t);return(n,o)=>{if(n&&this[e]){if(o)for(const e of Object.keys(o))if(o[e]&&n[e])for(const a of o[e])n[e].includes(a)||t(a,e);if(n.PENDING)for(const e of n.PENDING)o&&o.PENDING&&o.PENDING.includes(e)||t(e)}}}function b(e){const t=(e,t)=>this[e]=t,n=(e,n)=>{const o={};for(const t of this[e])o[t.id]=t;t(n,o)};return Object.entries(e).reduce(((e,[t,o])=>({...e,[t]:()=>n(t,o)})),{})}function y(e){return t=>{const n={};for(const[a,s]of Object.entries(e)){const e={};for(const n of this[t]){const t=s(n);e[t]||(e[t]=[]),e[t].push(n.id)}n[a]=e}const o=(e,t)=>this[e]=t;Object.entries(n).forEach((e=>o(...e)))}}u()(_,"incomeFilter",(e=>m.$store.account.account.address().toShortString()===e.performer)),u()(_,"expensesFilter",(e=>m.$store.account.account.address().toShortString()===e.publisher));const v=[c,_];t["a"]={data(){var e;const t=null!==(e=localStorage.getItem("dataPaymentMixin.mode"))&&void 0!==e?e:"amplify";localStorage.setItem("dataPaymentMixin.mode",t);const n=v.reduce(((e,t)=>{const n=new t;return e[n.name]=n,e}),{});return f.apply(this),{dp$mode:t,dp$interfaces:n,dp$incomeTxnDict:{},dp$incomeStatusMapper:{},dp$incomeHashMapper:{},dp$expenseTxnDict:{},dp$expenseStatusMapper:{},dp$expenseHashMapper:{},dp$source:this}},watch:{dp$mode(e){i(["dp$mode",e]),localStorage.setItem("dataPaymentMixin.mode",e)},dp$incomeTxnList(){this.dp$utils.updateIncomeData()},dp$expenseTxnList(){this.dp$utils.updateExpenseData()}},computed:{dp$credit(){return this.dp$interfaces[this.dp$mode].dp$credit()},dp$address(){return this.dp$interfaces[this.dp$mode].dp$address()},dp$incomeTxnList(){return this.dp$interfaces[this.dp$mode].dp$incomeTxnList()},dp$expenseTxnList(){return this.dp$interfaces[this.dp$mode].dp$expenseTxnList()},dp$incomeTxnListToday(){return this.dp$interfaces[this.dp$mode].dp$incomeTxnListToday()}},methods:{async dp$request(e,t,n){i(["dp$post","request","waiting..."]);const o=await this.dp$interfaces[this.dp$mode].dp$request(e,t,n);return i(["dp$post","request","done"],o),o},async dp$cancel(e){i(["dp$post","cancel","waiting..."],e);const t=await this.dp$interfaces[this.dp$mode].dp$cancel(e);return i(["dp$post","cancel","done"],e),t},async dp$submit(e,t=!1){const n=t?"abandoned":"provided";i(["dp$post","submit",n,"waiting..."],e);const o=await this.dp$interfaces[this.dp$mode].dp$submit(e,t);return i(["dp$post","submit",n,"done"],e),o},async dp$confirm(e,t=!1){const n=t?"failed":"succeeded";i(["dp$post","confirm",n,"waiting..."],e);try{const o=await this.dp$interfaces[this.dp$mode].dp$confirm(e,t);return i(["dp$post","confirm",n,"done"],e),o}catch(a){var o;if(console.warn("Error when confirming transaction",e,a),null!==(o=a.message)&&void 0!==o&&o.includes("payee does not exist")){const t=JSON.parse(localStorage.getItem("_transactions_missing_payee_")||"[]");t.push(e),localStorage.setItem("_transactions_missing_payee_",JSON.stringify(t))}}},__dp$notify__(){const e="amplify"===this.dp$mode?"blockchain":"amplify";this.$q.notify({group:"dp$mode_warning",message:`Current Data Payment Mode: "${this.dp$mode}"`,type:"warning",position:"bottom",timeout:0,actions:[{noCaps:!0,color:"black",label:`Switch to ${e}`,handler:()=>{this.dp$mode=e,location.reload(),n("d310").isElectron()&&n("b052").ipcRenderer.send("reload-webtorrent-window")}},{noCaps:!0,color:"black",label:"Close"}]})}},created(){this.dp$utils.updateIncomeData(),this.dp$utils.updateExpenseData()}}},"0c2f":function(e,t,n){},"0c70":function(e,t,n){},"0c7a":function(e,t,n){},"0cdb":function(e,t,n){"use strict";n.r(t),n.d(t,"notifyGeneralUpdate",(function(){return o})),n.d(t,"notifyMessage",(function(){return a})),n.d(t,"transfer",(function(){return s})),n.d(t,"notifyCreditChange",(function(){return i})),n.d(t,"generalCommand",(function(){return r})),n.d(t,"createUser",(function(){return l})),n.d(t,"updateUser",(function(){return c})),n.d(t,"deleteUser",(function(){return d})),n.d(t,"createInvitation",(function(){return u})),n.d(t,"updateInvitation",(function(){return h})),n.d(t,"deleteInvitation",(function(){return p})),n.d(t,"createMessageTimer",(function(){return m})),n.d(t,"updateMessageTimer",(function(){return _})),n.d(t,"deleteMessageTimer",(function(){return f})),n.d(t,"createTransaction",(function(){return g})),n.d(t,"updateTransaction",(function(){return b})),n.d(t,"deleteTransaction",(function(){return y})),n.d(t,"createTask",(function(){return v})),n.d(t,"updateTask",(function(){return w})),n.d(t,"deleteTask",(function(){return k})),n.d(t,"createProvidentFund",(function(){return C})),n.d(t,"updateProvidentFund",(function(){return $})),n.d(t,"deleteProvidentFund",(function(){return S}));const o="\n mutation NotifyGeneralUpdate(\n $id: String!\n $channel: String!\n $data: String!\n ) {\n notifyGeneralUpdate(id: $id, channel: $channel, data: $data) {\n id\n channel\n data\n }\n }\n",a="\n mutation NotifyMessage($channel: String!, $data: String!) {\n notifyMessage(channel: $channel, data: $data) {\n channel\n data\n }\n }\n",s="\n mutation Transfer(\n $receiver: String!\n $amount: Int!\n $category: Category!\n $meta: String\n ) {\n transfer(\n receiver: $receiver\n amount: $amount\n category: $category\n meta: $meta\n )\n }\n",i="\n mutation NotifyCreditChange($ownerId: String!, $amount: Int!) {\n notifyCreditChange(ownerId: $ownerId, amount: $amount) {\n ownerId\n amount\n }\n }\n",r="\n mutation GeneralCommand($input: String) {\n generalCommand(input: $input)\n }\n",l="\n mutation CreateUser(\n $input: CreateUserInput!\n $condition: ModelUserConditionInput\n ) {\n createUser(input: $input, condition: $condition) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",c="\n mutation UpdateUser(\n $input: UpdateUserInput!\n $condition: ModelUserConditionInput\n ) {\n updateUser(input: $input, condition: $condition) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",d="\n mutation DeleteUser(\n $input: DeleteUserInput!\n $condition: ModelUserConditionInput\n ) {\n deleteUser(input: $input, condition: $condition) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",u="\n mutation CreateInvitation(\n $input: CreateInvitationInput!\n $condition: ModelInvitationConditionInput\n ) {\n createInvitation(input: $input, condition: $condition) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",h="\n mutation UpdateInvitation(\n $input: UpdateInvitationInput!\n $condition: ModelInvitationConditionInput\n ) {\n updateInvitation(input: $input, condition: $condition) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",p="\n mutation DeleteInvitation(\n $input: DeleteInvitationInput!\n $condition: ModelInvitationConditionInput\n ) {\n deleteInvitation(input: $input, condition: $condition) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",m="\n mutation CreateMessageTimer(\n $input: CreateMessageTimerInput!\n $condition: ModelMessageTimerConditionInput\n ) {\n createMessageTimer(input: $input, condition: $condition) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",_="\n mutation UpdateMessageTimer(\n $input: UpdateMessageTimerInput!\n $condition: ModelMessageTimerConditionInput\n ) {\n updateMessageTimer(input: $input, condition: $condition) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",f="\n mutation DeleteMessageTimer(\n $input: DeleteMessageTimerInput!\n $condition: ModelMessageTimerConditionInput\n ) {\n deleteMessageTimer(input: $input, condition: $condition) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",g="\n mutation CreateTransaction(\n $input: CreateTransactionInput!\n $condition: ModelTransactionConditionInput\n ) {\n createTransaction(input: $input, condition: $condition) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",b="\n mutation UpdateTransaction(\n $input: UpdateTransactionInput!\n $condition: ModelTransactionConditionInput\n ) {\n updateTransaction(input: $input, condition: $condition) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",y="\n mutation DeleteTransaction(\n $input: DeleteTransactionInput!\n $condition: ModelTransactionConditionInput\n ) {\n deleteTransaction(input: $input, condition: $condition) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",v="\n mutation CreateTask(\n $input: CreateTaskInput!\n $condition: ModelTaskConditionInput\n ) {\n createTask(input: $input, condition: $condition) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",w="\n mutation UpdateTask(\n $input: UpdateTaskInput!\n $condition: ModelTaskConditionInput\n ) {\n updateTask(input: $input, condition: $condition) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",k="\n mutation DeleteTask(\n $input: DeleteTaskInput!\n $condition: ModelTaskConditionInput\n ) {\n deleteTask(input: $input, condition: $condition) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",C="\n mutation CreateProvidentFund(\n $input: CreateProvidentFundInput!\n $condition: ModelProvidentFundConditionInput\n ) {\n createProvidentFund(input: $input, condition: $condition) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",$="\n mutation UpdateProvidentFund(\n $input: UpdateProvidentFundInput!\n $condition: ModelProvidentFundConditionInput\n ) {\n updateProvidentFund(input: $input, condition: $condition) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",S="\n mutation DeleteProvidentFund(\n $input: DeleteProvidentFundInput!\n $condition: ModelProvidentFundConditionInput\n ) {\n deleteProvidentFund(input: $input, condition: $condition) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n"},"0d10":function(e,t,n){},"0f0c":function(e,t,n){"use strict";n("61af"),n("a3fc");const o=e=>{{const t=n("ae46");return t[e]}};t["a"]=o},"0f74":function(e,t,n){},1:function(e,t,n){e.exports=n("e7ec")},10:function(e,t){},"10e1":function(e,t,n){},11:function(e,t){},12:function(e,t){},1278:function(e,t,n){},13:function(e,t){},1357:function(e,t,n){"use strict";n("5960")},14:function(e,t){},15:function(e,t){},"15eb":function(e,t,n){"use strict";(function(e,o){n("de6c"),n("a1c1"),n("d4b5");var a=n("7d96"),s=n("d310"),i=n("4d52"),r=n("e75b"),l=n("c5a5");t["a"]=({Vue:t,app:c,router:d})=>{if(t.use(a["a"],{useComponent:{i18n:c.i18n}}),o.handleAbBlockchain=({url:t,action:n,actionArgs:o})=>{if(t){const a={type:"03",prefix:"ab-blockchain"},s={encode:t=>e.from(t,"utf-8").toString("base64"),decode:t=>e.from(t,"base64").toString("utf-8")},i=e=>{if(!e.startsWith(`${a.prefix}://`))return null;const[t,n]=e.replace(`${a.prefix}://`,"").split("/"),o=JSON.parse(s.decode(n));return{action:t,actionArgs:o}},r=i(t);n=r.action,o=r.actionArgs}if(console.log("ab-blockchain$",n,o),"Blockchain"===d.currentRoute.name){const e=d.currentRoute.matched.find((e=>"Blockchain"===e.name)),t=e.instances.default;t.handleAction(n,o)}else d.push({name:"Blockchain",params:{action:n,action_args:o}})},Object(s["isElectron"])()){const{ipcRenderer:e}=n("b052");e.on(`${i["a"].config.prefix}-action`,((e,t,n)=>{o.handleAbBlockchain({action:t,actionArgs:n})}))}Object.defineProperty(o.$blockchain.wallet,"fundAccountWithFaucet",{configurable:!0,get(){return async({address:e,amount:t})=>{const n=new r["a"].Rest("ABDevRest"),o=await n.post("/development/blockchain/fundAccountWithFaucet",{amount:t,address:e,testToken:"XWZWQFZOZ3"});return o}}}),o.$blockchain.$store.wallet.createCollectionLink=async()=>{const t=async(t,n)=>{const o=(t,n)=>{const o={type:"03",prefix:"ab-blockchain"},a={encode:t=>e.from(t,"utf-8").toString("base64"),decode:t=>e.from(t,"base64").toString("utf-8")},s=a.encode(JSON.stringify(n));return`${o.prefix}://${[t,s].join("/")}`},a=o(t,n);console.log("internalUrl",a);const s=await Object(l["a"])(a);return s},{account:n}=o.$blockchain.$store;await n.assertAccountAccessible();const a=n.address,s=await t("transfer",{to_address:a});return s}}}).call(this,n("eb72").Buffer,n("0ee4"))},16:function(e,t){},17:function(e,t){},1738:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));n("0c26");var o=n("e757"),a=n("47fc"),s=n("d710"),i=n.n(s);const r={MEASUREMENT_ID:"G-9NE14P89WD",STREAM_ID:"4617180072",API_SECRET:"r7q0lwYuQeSimEJ5JnVFuQ"},l=new o["a"](r.MEASUREMENT_ID,r.API_SECRET);function c(){var e;const t=Object(a["a"])(),{packageFormat:o,version:s}=l(),r=s.split("-").reduce(((e,t,n)=>({...e,[["version","channel"][n]]:t})),{});return{app_name:i.a.name,app_type:"website",app_env:"production",app_format:null!==o&&void 0!==o?o:"unknown",app_version:r.version,app_channel:null!==(e=r.channel)&&void 0!==e?e:"stable",app_screen:t.screen,app_os:t.os,app_os_version:t.osVersion,app_arch:t.arch};function l(){return n("ae46")}}t["b"]=(t,{app:n,router:o})=>{(e&&e.env.TEST_EMAIL_DOMAIN||(document.cookie||"").split(";").map((e=>e.trim())).includes("TestEnv=true"))&&(console.log("DISABLE GOOGLE ANALYTICS"),l.disable()),l.config(),setTimeout((async()=>{const e=c();console.log("[GA] App Data",e),await l.send("analytics_test_app_data",e)}),1e4);let a=Date.now();l.send("app_launch",{timestamp:a}),o.afterEach(((e,t)=>{if("/"===t.path||e.path===t.path)return;const n=Date.now(),o=n-a;a=n,l.send("app_route",{to:e.path,from:t.path,stayTime:o})})),t.prototype.$ga=l,console.log("Init Google Analytics")}}).call(this,n("28d0"))},1761:function(e,t,n){"use strict";n("5d03")},18:function(e,t){},19:function(e,t){},1926:function(e,t,n){"use strict";n.d(t,"b",(function(){return ee}));n("a1c1"),n("de6c"),n("d4b5"),n("dc89"),n("2425"),n("7a76");var o=n("ff9b"),a=n("4d79"),s=n("d710"),i=n.n(s);const r=i.a.displayName;var l={repeat_add:"任务已添加,请勿重复添加",upload:"上传",download:"下载",delete:"删除",delete_task:"删除任务",delete_confirm_message:"是否删除该任务? 此操作不可恢复",also_delete_files:"同时删除文件",default_delete_files:"删除任务时默认删除已下载的文件",not_now:"暂不处理",delete_autoupload_confirm:"此任务文件位于自动上传文件夹, 删除任务将同时删除对应文件",delete_anyway:"仍要删除",upload_too_many_files:"上传文件过多",ask_if_unlimit_upload_amount:"自动上传文件夹包含过多文件. 是否取消上传数量限制? *此操作可能造成性能问题",disable_limitation:"取消限制",not_length:"暂不支持,多文件操作,请配合",download_torrent:"下载该任务",upload_torrent:"上传该任务",files:"文件",file:"文件",folder:"文件夹",start_all:"全部开始",pause_all:"全部暂停",remove_all:"全部移除",upload_all:"全部上传",clear_history:"清除历史",pause_all_finish_payments:"此操作将完成所有已支付的订单.",accelerating:"加速中",link_task:"链接任务",torrent_task:"文件任务",ok:"好的",cancel:"取消",download_directory_position:"下载目录位置",torrent_file:"任务文件",magnetic_link_incorrect:"链接格式不正确",delete_fail:"删除失败",pause:"暂停",paused:"已暂停",stop_torrent:"结束任务",seed:"上传",resume:"继续",downloading:"下载中",downloaded:"下载完成",uploading:"上传中",auto_uploading:"自动上传中",uploaded:"上传完成",pending:"等待其他任务完成",no_downloading_task:"没有下载中任务",remove_all_downloading_tasks:"是否移除所有下载中任务?",remove_all_upload_tasks:"是否移除所有上传任务?",remove_autoupload_files:"移除所有自动上传任务",remove_all_history:"是否移除历史下载记录?",verifying:"验证文件",waiting_for_verify:"等待验证文件",seeding:"上传中",completed:"已完成",status:"状态",task_name:"任务名",size:"大小",progress:"进度",sort:"排序",ascending:"升序",descending:"降序",file_loading:"文件加载中",loading:"加载中",unknown_status:"未知",play_while_downloading:"边下边播",upload_or_play:"上传 / 播放",play:"播放",ask_if_upload_file:"是否上传文件?",ask_if_upload_or_play:"是否上传/播放文件?",torrent_error:"添加任务时遇到错误:",no_peers:"多次尝试后仍未能与Peers建立连接",torrent_exists:"任务已存在",show_origin_torrent:"显示原始任务文件或链接",show_directory:"打开文件所在位置",task_num:"任务数",total_upload_speed:"上传速度",total_download_speed:"下载速度",path_missing:"Error: 找不到文件位置",origin_not_found:"获取任务信息失败",text_copied:"链接已复制到剪贴板",copy_magnet_uri:"复制链接地址",copy_download_uri:"复制下载链接",copy_share_uri:"复制社交分享链接",uri_copied:"链接已复制至剪贴板",uri_copy_failed:"复制链接失败",more:"更多",toggle_list_mode:"切换显示模式",comment:"评论",operations:"操作",open_directory:"打开所在文件夹",remaining:"剩余时间",created_time:"创建时间",used_time:"用时",completed_time:"完成时间",yesterday:"昨天",before_yesterday:"前天",earlier:"更早之前",miss_file:"文件缺失",delete_miss_file_task:"{0} 有部分文件缺失.",common_peer:"普通用户",ab_peer:`${r} 用户`,ab_peer_verified:`${r} 注册用户`,ab_peer_available:`${r} peer 可用`,alphabiz_accelerating:`${r} 加速中`,income:"收入",income_info:"收入(今天/总计)",total_income_info:"收入: {0}(今天) / {1}(总计)",login_to_see_income:"登陆以查看收入统计",credit_cost:"积分支出",downloaded_by_payment:"付费下载量",file_not_found:"无法找到本地文件",no_task:"无任务",no_matched_task:"无法找到匹配的任务",space_not_enough:"磁盘空间不足",need_more_space:"需要 {0} 磁盘空间, 磁盘剩余空间为 {1} ({2} 为保留空间). 任务已暂停. 媒体库预加载已禁用. 您可以在[设置 - 进阶设置]中重新启用.",seeders:"做种",last_update:"最后更新",connecting:"连接中",connected:"已连接",request_timed_out:"请求超时",connection_failed:"连接失败",invalid_download_url:"下载链接错误",download_link:"下载链接",empty_files:"文件夹中没有文件",duplicate_task:"重复任务",duplicate_tracker:"重复 tracker",this_task_not_ready:"此任务尚未就绪,暂停该任务将直接移除它",some_task_not_ready:"部分任务尚未就绪,暂停这些任务将直接移除它们",failed_to_delete_files:"删除文件失败",failed_to_delete_files_desc:"无法删除部分任务文件,可能需要手动删除",unknown_error:"未知错误: {0}",more_files_are_not_shown:"(出于性能考虑,{0} 个文件未显示)",no_available_file:"没有可用的文件,请等待任务就绪",service_worker_error:"无法加载 ServiceWorker。您的浏览器可能不支持此特性,或者 ServiceWorker 尚未就绪。请刷新页面后重试。",add_task_first:"请先添加任务",player_task_time:"播放器准备时间过长,请检查任务是否就绪",web_mode_hint:`${r} Web 仅支持 WebRTC 种子。下载 ${r} 桌面版以获得最佳体验。`,web_mode_task_hint:"点击下方链接创建任务。Web 模式同时仅可创建一个任务。",save_to_local:"保存到本地",save_as_zip:"保存为 ZIP",creating_save_file:"正在创建文件...",upload_as_one_directory:"作为一个文件夹上传",upload_as_single_files:"作为单独的文件上传",web_mode_upload_single:"Web 模式下只能上传单个文件",download_success:"下载成功",download_fail:"下载失败",wait_for_downloaded_to_share:"请等待下载完成后进行分享。",download_with_cellular:"使用数据流量下载",download_with_cellular_desc:"您正在使用数据流量,下载时运营商可能会收取额外的费用。",download_with_cellular_confirm:"仍然使用数据流量"},c={language:"语言",appearance:"外观",darkModeSystem:"跟随系统",darkModeLight:"明亮",darkModeDark:"黑暗",basic_setting:"基础设置",hideMenu:"隐藏菜单栏(仅支持Windows和Linux)",autoHide:"自动隐藏窗口",start:"启动",autoStart:"开机自动启动",restore:"恢复上次退出时窗口的大小和位置",autoStartUnfinished:"自动开始未完成的任务",default_download_path:"默认下载路径",download_directory:"下载目录",upload_directory:"上传目录",enable_auto_upload:"允许自动上传",unlimit_upload_amount:"不限制上传数量",unlimit_upload_warning:"允许同时上传大量文件. 此选项可能导致性能问题",transport_setting:"传输设置",upload_limit:"上传限速",download_limit:"下载限速",payed_user_share_rate:"付费用户上传比例",unlimited:"不限速",limit_input_error:"限速需为正数",BT_setting:"下载任务设置",saveLinkSeed:"保存链接元数据为任务文件",autoDownload:"自动开始下载链接任务、任务文件",continuousSeeding:"持续上传,直到手动停止",seedSharingRate:"分享率",seedTime:"上传时间(分钟)",task_manage:"任务管理",maximumDownloadNum:"同时下载的最大任务数",maximumConnectionsNum:"每个服务器最大的连接数",range_error:"范围需在{0}-{1}之间",random:"随机",breakpointContinuation:"断点续传",automaticSkip:"新建任务后自动跳转到下载页面",afterNotification:"下载完成后通知",deleteConfirm:"删除任务前无需确认",submit:"保存并应用",discard:"放弃",reset:"重置",reset_all_settings:"重置所有设置?",preferences_resetted:"偏好设置已重置",traditional_chinese:"繁體中文",japanese:"日本語",english:"English",chinese:"简体中文",advancedSettings:"进阶设置",autoUpdate:"自动更新",autoCheckUpdate:"自动检查更新",proxy:"代理",useProxyService:"使用代理服务器",trackerService:"Tracker服务器",recommendUse:"推荐使用",autoUpdateTrackerServiceList:"每天自动更新Tracker服务器列表",manualUpdateTracker:"手动更新",manualUpdateSuccess:" Tracker服务器更新成功",manualUpdateFail:"更新以下Tracker服务器失败:",listenPort:"监听端口",BTlistenPort:"数据传输端口",DHTlistenPort:"分布式哈希通讯端口",protocols:"兼容以下协议",setDefaultClientForFollowingProtocols:"设置本软件为以下兼容协议的默认客户端",magnetUrl:"磁力链接",video_file:"视频文件",audio_file:"音频文件",security:"安全性",impersonateUserAgent:"模拟用户代理(UA)",RPCauthorizationkey:"RPC授权密钥",viewDocument:"查看说明文档",developer:"开发者",applicationLogPath:"应用日志路径",downloadSessionPath:"下载会话路径",resetDownloadSessionRecord:"重置下载会话记录",restoreInitialSettings:"恢复初始设置",preferences_set_successfully:"偏好设置成功!",preferences_set_fail:"偏好设置失败!",change_not_save:"修改未保存",discard_all_changes:"是否放弃所有更改?",stay_in_page:"留在此页",disk_usage:"保留磁盘空间",pause_if_less_space:"剩余空间小于此值时暂停并提醒(MB)",default_video_player:"默认视频播放器",video_cache_time:"边下边播缓存时间",minutes:"分钟",system_default:"系统默认",media_player:"媒体播放器",library_film_rate:"可见影片分级",library_show_explore:"显示[探索]页面",library_setting:"媒体库设置",library_sync_setting:"媒体库同步设置",keychain_sync_status:"密钥同步状态",sync_with_aws:"使用 Amazon Web Services 同步密钥",backup_to_local:"保存为本地文件",enable_sync_with_aws:"启用 AWS 同步",disable_sync_with_aws:"禁用 AWS 同步",disable_sync_with_aws_desc:"此操作将移除保存在云端的密钥,请确保已将密钥保存至本地。",input_independent_password:"输入独立密码",change_independent_password:"修改独立密码",password_error:"密码错误",password_invalid:"密码格式错误",key_existed:"密钥已存在",key_not_found:"密钥不存在",library_recommend:"媒体库推荐",show_all_channels:"在媒体库推荐页显示所有频道",not_logged_in:"尚未登录",login_to_continue:"登陆以继续",mnemonic_code:"助记词",wordlist:"单词表",restore_code:"从助记词恢复",generate_code:"生成助记词",export_mnemonic_code:"导出助记词",import_mnemonic_code:"导入助记词",print:"打印",save_as_txt:"保存为 txt",save_as_pdf:"保存为 pdf",from_file:"从文件导入",not_valid_mnemonic_code:"助记词格式错误",cannot_parse_code_as_key:"无法将此助记词解析为密钥",import_key_hint:"是否确认导入此密钥?此操作将覆盖旧的密钥。",import_key_confirm:"确认导入",library_preload:"媒体库任务预加载",show_preload:"显示预加载任务",set_download:"设置下载文件夹",set_download_desc:"macOS App Store 版本默认保存位置为应用内部沙盒,在应用卸载时会一并删除。为了保留下载文件,您需要手动选择下载位置。"},d={home:"主页",home_caption:"下载/上传媒体文件",library:"媒体库",library_caption:"探索媒体资源",player:"播放器",player_caption:"视频播放",credits:"信用積分",credits_caption:"检查账户积分余额",account:"用户",account_caption:"个人用户配置",settings:"设置",settings_caption:"所有设置项",development:"开发者",development_caption:"应用开发者模式",basic:"主要设置",basic_caption:"主要的设置项",advanced:"进阶设置",advanced_caption:"进阶的设置项",blockchain:"钱包",blockchain_caption:"去中心化钱包",internal_notice:"内部版本声明",release_notes:"发行说明",terms_and_conditions:"条款和章程",license_and_listen_notices:"许可和监听开源说明",close:"关闭",success:"成功",fail:"失败"},u={credits:"信用积分",pay:"支付积分",pay_with_credit:"支付积分加速下载, 预计需要{0}积分",pay_with_credit_payed:"正在加速下载, 预计还需要{0}积分",create_payment:"创建积分订单",pay_target:"支付对象",pay_for_torrent:"为 {0} 支付",your_subid:"用户 subId",your_credits:"当前余额",pay_point_for_data:"支付{0}积分以加速{1}数据",auto_renew:"允许自动续费",transaction_details:"订单明细",transaction_id:"订单编号",transaction_payer:"付款人",transaction_payee:"收款人",transaction_category:"类型",transaction_changed_amount:"变动金额",transaction_meta:"其他数据",transaction_status:"订单状态",transaction_creation_time:"订单创建时间",receipt_code:"收款码",transfer_amount:"转账金额",code_the_receipt_code:"复制下方收款码给付款人",fill_the_receipt_code:"通过填入收款人提供的收款码进行转账",income:"收入",expense:"支出",copied:"已复制",transfer:"转账",receive:"收款",copy:"复制",withdraw_fund:"提取基金",category_paydata_payer:"数据支付",category_paydata_payee:"数据收入",category_transfer:"个人转账",category_bonus:"系统奖励",category_recharge:"充值",status_pending:"等待中",status_completed:"已传完",status_finish:"已完成",status_failed:"已失效",tip_invalid_receiver:"无效的收款码",tip_invalid_amount:"金额应为 0-1000 范围内的数(最小精度为0.001)",credit_get_more:"获得更多积分",credit_no_data:"无可用数据",credit_loading:"加载中",credit_not_enough_amount:"积分不足",credit_amount_not_enough:"积分不足",credit_payee_not_exist:"收款人不存在",credit_invalid_amount:"输入金额不合法",credit_can_not_transfer_to_yourself:"不能向自己转账",credit_latest:"最新日期",credit_error_network:"网络出现异常,请稍后重试","payer credit amount is not enough":"积分不足","payee does not exist":"收款人不存在"},h={account_email_invalid_address:"无效的电子邮件地址",account_email_invalid_domain:"无效的电子邮件域",account_email_unknown_status:"未知的邮件发送状态",account_email_unavailable_address:"邮件地址不可用",account_email_suppressed_address:"邮件地址被禁用",account_loading:"加载中...",account_is_required:"不能为空",account_sign_in_your_account:"登录账户",account_username:"用户名",account_username_email_phone:"手机号码或电子邮箱",account_password:"密码",account_new_password:"新密码",account_re_enter_password:"再次输入密码",account_password_not_equal:"输入的两个密码不同。",account_new_password_same:"新密码与原密码相同",account_forgot_your_password:"忘记密码了?",account_reset_password:"重置密码",account_sign_in:"登录",account_signed_in:"登录成功",account_sign_up:"注册",account_find_your_account:"找寻你的账户",account_enter_your_username:"输入你的手机号码或电子邮箱",account_search:"查找",account_email_sent_tip:"一封附带验证码的电子邮件已发送到您的邮箱:",account_phone_sent_tip:"一封附带验证码的短信已发送到您的手机:",account_email_phone_sent_tip:"附带验证码的电子邮件和手机短信已分别发送到您的邮箱和手机:",account_software_token_tip:"您的账户已启用安全令牌。要完成登录,请打开或查看您的设备并输入验证码",account_reset_your_password:"重置账户密码",account_verification_code:"验证码",account_resend_code:"重发验证码",account_code_has_been_resent:"验证码已发送",account_password_has_been_reset:"密码已重置",account_submit:"提交",account_sign_up_your_account:"注册账户",account_fill_required_fields:"填写下方的必填项。",account_fill_optional_fields:"填写下方的选填项。",account_email:"邮箱",account_invitation:"邀请",account_invitation_code:"邀请码",account_i_accept:"我接受",account_license_terms:"服务许可条款",account_next:"下一步",account_you_need_to_accept_license_terms:"请先勾选我接受服务许可条款",account_verify_fill_optional_fields:"验证身份与可选项",account_nickname:"昵称",account_gender:"性别",account_male:"男",account_female:"女",account_not_say:"不透露",account_birthday:"生日",account_phone_number:"手机号码",account_locale:"地区",account_tip_verified:"验证通过,正在登陆...",account_verified:"已验证",account_unverified:"未验证",account_signed_up:"注册成功",account_verify_your_identity:"验证您的身份",account_finish:"完成",account_signed_out:"注销成功",account_change_password:"修改密码",account_change_email:"修改电子邮箱",account_change_phone_number:"修改手机号码",account_sign_out:"注销",account_current_password:"当前密码",account_re_enter_new_password:"再次输入新密码",account_personal_information:"个人信息",account_edit:"编辑",account_reset:"重置",account_greeting:"你好,",account_cancel:"取消",account_not_set:"未设置",account_change:"修改",account_setting:"设置",account_copy_code:"复制代码",account_account_setting:"账户设置",account_task_page:"积分任务",account_setting_caption:"管理你的账户信息",account_security:"安全",account_want_to_join:"登录更精彩",account_sign_in_now:"点击登录",account_changed:"已更改",account_clipboard_with_invitation_code:"已复制邀请码",account_clipboard_with_code:"已复制代码",account_invitation_code_dialog_tip:"你将通过短信或电子邮件的方式发送邀请码:",account_available:"可用",account_invited:"已邀请",account_used:"已使用",account_invitation_code_sent:"邀请码已发送",account_invitation_channel_required:"至少需要填写一项邀请途径",account_no_verification_code:"无法收到验证码?",account_no_phone_number:"没有手机号码?",account_sign_up_by_email:"通过邮箱注册",account_no_email:"没有邮箱?",account_sign_up_by_phone_number:"通过手机注册",account_no_totp:"没有安全令牌?",account_tip_no_totp:"若沒有安全令牌請先設定安全令牌",account_setup_totp:"设置安全令牌",account_contact_information:"联系方式",account_delete_account:"删除账户",account_deleted:"已删除",account_can_not_mfa:"无法进行二级验证?",account_set_mfa_type:"更改二级验证",account_disable_mfa:"关闭二级验证",account_disabled_mfa:"已关闭二级验证",account_sms_mfa:"手机短信验证",account_totp_mfa:"安全令牌验证",account_totp:"安全令牌",account_not_recommend:"不推荐",account_oauth_sign_in_with:"通过 {provider} 登录",account_sign_in_failed:"登录失败",account_tip_oath_sign_up:"当前{provider}账户所对应的邮箱:{email}尚未创建账户",account_tip_confirm_delete_account:"输入当前账户密码以确认要删除当前账户。(账户删除后将无法恢复)",account_tip_config_mfa:"您可以通过手机短信或安全令牌为账户设置二级验证",account_error_can_not_enable_mfa:"您必须同时绑定邮箱和手机号码,才可以启用二级验证",account_tip_can_not_enable_sms_mfa:"您必须同时绑定邮箱和手机号码,才可以启用短信验证",account_tip_can_not_enable_totp_mfa:"您必须同时绑定邮箱和手机号码,才可以启用安全令牌",account_tip_setup_totp:"使用Authenticator等应用,扫描下方的二维码或手动复制代码来添加安全令牌",account_tip_verify_totp:"验证您的安全令牌",account_link_your_social_account:"绑定您的社交账号",account_unlink_your_social_account:"解除社交账号绑定",account_tip_confirm_link:"确定将当前账号与您的 {provider} 账号进行绑定吗?",account_tip_confirm_unlink:"确定解除您已绑定的 {provider} 账号吗?",account_tip_linking:"正在绑定...",account_tip_unlinking:"解除绑定中...",account_linked:"已绑定",account_unlinked:"已解除绑定",account_error_can_not_link_to_the_linked_account:"当前社交帐号已与其他账号绑定",account_error_can_not_link_to_the_mismatched_email:"当前账号与社交帐号邮箱地址不一致",account_error_can_not_link_before_email_verified:"未绑定邮箱的账户无法绑定社交帐户",account_tip_confirm_verify_email_phone:"是否向当前账户的email和手机号码发送验证码以验证您的身份?",account_tip_confirm_verify_phone:"是否向当前手机号码发送验证码以验证您的身份?",account_error_1_message_60_seconds:"每60秒只能发送一条短信或邮件,需再等待 {delta} 秒",account_error_10_messages_per_day:"每部手机或电子邮件24小时内只能发送10条信息",account_error_network:"网络出现异常,请稍后重试","Network Error":"网络出现异常,请稍后重试",account_error_user_not_exist:"用户不存在",account_error_incorrect_username_or_password:"用户名或密码错误",account_error_incorrect_original_password:"原密码错误",account_error_incorrect_password:"密码错误",account_error_username_not_found:"找不到该用户名的账户",account_error_can_not_reset_for_no_verified:"账户未进行邮箱验证,无法重置密码",account_error_invalid_verification_code:"验证码错误,请重试",account_error_expired_verification_code:"验证码过期,请重试",account_error_password_not_long_enough:"密码长度不能小于8位",account_error_attempt_limit_exceeded:"尝试次数过多,请稍后重试",account_error_password_attempts_exceeded:"超过密码尝试次数",account_error_invalid_phone_number_format:"手机号码格式不正确",account_error_no_cell_phone_prefix:"请选择手机号前缀",account_error_username_already_exists:"该用户名已存在",account_error_you_need_to_accept_license_terms:"请勾选我接受服务许可条款",account_error_inactive_code:"该邀请码已失效",account_error_non_existent_code:"该邀请码不存在",account_error_unexpected:"未知错误",account_error_can_not_change_email_before_phone_bound:"绑定手机号码前无法更改邮箱",account_error_can_not_change_email_before_unbound_social_account:"解除社交帐户绑定前无法更改邮箱",account_error_can_not_change_phone_before_email_bound:"绑定邮箱前无法更改手机号码",account_error_can_not_change_email_phone_with_mfa_enabled:"关闭二级验证前无法更改邮箱或手机号码",account_error_same_email:"新的邮箱不能与原邮箱相同",account_error_same_phone:"新手机号码不能与原手机号码相同",account_error_email_not_exists:"该邮箱不存在",account_error_email_already_exists:"该邮箱已有账户绑定",account_error_phone_already_exists:"该手机号码已有账户绑定",account_error_mfa_token_mismatch:"安全令牌错误",account_error_recaptcha_not_loaded:"网络出现异常,请重连网络后重启应用重试",account_error_recaptcha_validation_failed:"未通过ReCaptcha验证,请重连网络后重启应用重试",account_error_sign_in_in_progress:"等待登录尝试已在进行中",account_field_range:"字符个数应在{0}-{1}的范围中",account_field_only_alphanumeric:"仅支持字母和数字",account_field_only_alphanumeric_and_symbol:"仅支持字母数字和符号",account_field_only_chinese_alphanumeric_space_underline:"仅支持中英文数字空格下划线",account_field_prefix_without_number_space:"首个字符不能为数字或空格",account_field_suffix_without_space:"不能以空格结尾",account_field_without_repeat_space:"不能连续使用多个空格",account_field_can_not_only_alphanumeric:"不可仅为字母或数字",account_field_must_have_number_characters:"必须包含数字",account_field_verification_code:"验证码必须是六位数数字",account_field_invitation_code:"邀请码必须是字母和数字",account_field_phone_number:"手机号码格式不正确",account_invalid_email_format:"邮箱格式不正确",account_sign_out_confirm:"是否确认注销? 注销后将停止所有任务",account_sign_out_anyway:"仍要注销",account_signing_out:"正在注销...",account_request_save_settings:"设置未保存。在注销前请先保存修改。",invalid_password_format:"密码格式错误",invalid_password_format_same:"新密码与原密码相同",error_password:"密码错误",keychain_setting:"密钥管理",setting_description:"云端储存:将密钥数据保存到云端。\n修改密码:修改媒体库密钥的密码。\n助记词:一种生成和恢复密钥的替代方法。\n导入本地密钥:将本地保存的密钥导入媒体库。\n导出密钥:将当前媒体库数据保存到本地或云端。\n备份密钥到云端:将当前媒体库数据更新到云端进行备份。",refresh_status:"更新状态",confirm_import_key:"确认导入密钥",confirm_update_cloud_key:"你在云端已有密钥,更新密钥将覆盖原有的密钥,确认更新存储在云端的密钥吗",export_key_with_cloud:"输入您所设置的独立密码导出存储在云端的媒体库密钥,并通过解锁密码锁定密钥文件",store_cloud_key_prompt_password:"输入独立密码以存储媒体库密钥到云端",update_cloud_key_prompt_password:"设置独立密码以加密媒体库密钥并更新到云端",enable_cloud_storage_prompt_password:"为存储在云端的密钥设置密码,通过该密码可以从云上取回密钥",input_unlock_password:"设置解锁密码",export_local_prompt_password:"请设置一个解锁密码,该密码用于加密您的密钥文件。我们不会保存此密码,因此若您丢失该密码,密钥文件将无法解锁",require_unlock_password:"该密钥文件已被锁定,请输入解锁密码",require_independent_password:"输入独立密码以获取存储在云端的密钥",import_local_prompt_password:"该密钥文件已被锁定,请输入解锁密码",select_encrypt_mode:"选择加密模式",input_independent_password:"输入独立密码",update_cloud_key:"更新存储在云端的密钥",backup_to_cloud:"将媒体库密钥备份到云端",save_local:"将媒体库密钥保存为本地加密文件",create_new_key:"创建新的媒体库密钥",creating_lib_key:"正在创建媒体库密钥...",loading_lib_key:"正在载入媒体库密钥...",failed_to_create_lib_key:"创建媒体库密钥失败",failed_to_load_lib_key:"载入媒体库密钥失败",import_local_key:"导入本地密钥",import_lib_key_from_local:"从本地导入媒体库密钥",import_from_cloud:"从云端导入媒体库密钥",create_or_import_key:"创建或导入媒体库密钥",create_or_import_key_desc:"媒体库密钥用于与去中心化数据库同步内容。",store_your_lib_key:"存储你的媒体库密钥",export_cloud_key:"导出云端密钥",export_current_key:"导出当前密钥",change_password:"修改密码",enable_cloud_storage:"启用云端存储",disable_cloud_storage:"关闭云端存储",disable_cloud_storage_desc:"关闭云端存储将移除保存在云端的密钥,请确保已将密钥保存在本地",sync_at:"同步于:{time}",keychain_sync_status:"密钥同步状态",cloud_storage_enabled:"使用 {storage} 同步密钥",cloud_storage_disabled:"未启用云端存储",saved_locally:"已保存于本地",export_key:"导出密钥文件",cloud_independent_password:"云端独立密码",key_file_unlock_password:"密钥文件解锁密码",re_enter_unlock_password:"再次输入解锁密码",independent_password_not_enabled:"当前密码为 Alphabiz 账户密码(未设置独立密码)",use_cognito_hash:"使用 Alphabiz 账户密码",use_independent_password:"使用独立密码",keychain_lib:"媒体库密钥",loading_keychain_state:"加载密钥中...",backing_up:"备份中...",backup_current_key:"备份当前密钥到云端",cloud_lib_key_not_existed:"云端媒体库密钥不存在",open_keychain_file:"打开密钥文件",confirm_open_abk:"是否打开ABK文件",use_the_key:"使用该密钥",backup_the_key:"备份该密钥到云端",keychain_data_does_not_exist:"密钥数据不存在","timeout of 0ms exceeded":"网络出现异常,请稍后重试",XhrError:"网络出现异常,请稍后重试"},p={add_subtitles:"添加字幕",open_file:"打开文件...",advanced_options:"高级选项",title:"标题",location:"位置",subtitle_file:"字幕文件",unsupported_subtitle_type:"The file type of {0} is not a supported subtitle type",not_default_player:"默认视频播放器未设置",this_is_an_audio_file:"这是一个音频文件",the_added_subtitle_already_exists:"添加的字幕已存在",stop_stream_player:"因任务被暂停或删除,流媒体播放被终止",stop_player:"因文件被删除,播放被终止",playing_timeout_hint:"等待超时,请检查任务",autoplay_hint:"自动播放功能可能受浏览器限制,若未开始播放,请手动点击播放器以播放",remove_playing_confirm:"{0} 正在播放中,删除任务将停止播放。是否仍要删除?",subtitle:"字幕",setting:"设置",loading:"加载中",unknown_media:"未知媒体",settings_button_visible:"按钮显示",settings_setting:"设置",settings_playback_rate:"倍速",settings_subtitle:"字幕",settings_pip:"画中画",settings_fullscreen:"全屏",settings_subtitle_options:"字幕选项",settings_normal:"常规",settings_italic:"斜体",settings_lighter:"纤细",settings_bolder:"粗体",settings_small:"较小",settings_large:"较大"},m=n("8097");const _=i.a.displayName;var f={lib_index:"主页",lib_edit:"编辑",lib_publish:"发布",lib_explore:"探索",lib_following:"关注",lib_favorite:"本地收藏",lib_local_favorites:"本地收藏",lib_channel:"频道",lib_submit:"提交",lib_from_network:"使用去中心化数据库,所有数据来源于网络",welcome_to_lib:`欢迎使用 ${_} 媒体库`,register_or_login:"注册/登陆",lib_recommend:"推荐",lib_recommend_desc:`欢迎使用 ${_} 媒体库!本媒体库使用去中心化的数据库,所有数据来源于网络。在开始前,请先关注一些推荐频道。`,follow_any_channel_to_continue:"关注任意频道以继续",follow_channels_and_continue:"关注 {0} 个频道并继续",show_more_for_me:"为我展示更多",no_more_recommend:"没有更多推荐",key:"密钥",create_key:"生成密钥",save_key:"保存密钥",save_key_file:"是否将密钥保存为文件?",import_key:"导入密钥",import:"导入",invalid_key:"密钥格式错误",back_to_top:"回到顶部",search_for_channel:"搜索频道 ID",search_channel_no_result:"找不到 ID 为 {0} 的频道",please_input_channel_id:"请输入频道 ID",welcome_help_text:"\n 这是一个去中心化的媒体库,您需要为此创建一个专用账户,\n 我们将自动为您生成一套密钥。如果您已经拥有密钥了,\n 也可以在此导入密钥".replace(/\s/g,""),welcome_key_text:"\n 当您成功创建账号后,请点击右下角的【保存密钥】按钮导出\n 您的密钥。一旦您丢失密钥,对应的账号将无法找回。".replace(/\s/g,""),redirect_to_recommend:"您似乎没有关注任何频道,即将前往探索页。",channel:"频道",follow:"关注",unfollow:"取消关注",following:"关注中",share:"分享",block:"屏蔽",unblock:"取消屏蔽",blocked:"已屏蔽",block_channel:"屏蔽此频道",block_channel_confirm:"屏蔽频道后,频道的所有内容将从时间线上移除。您可以在账户设置中管理屏蔽列表。",block_creator:"屏蔽此频道的创作者",unblock_creator:"取消屏蔽此频道的创作者",block_creator_confirm:"屏蔽创作者后,该创作者的所有频道将从时间线上移除。您可以在账户设置中管理屏蔽列表",share_url_copied:"分享链接已复制至剪贴板",unfollow_confirm:"是否取消关注?此频道的所有推文将从你的时间线上移除。",follow_failed_hint:"操作仍在后台进行中,请耐心等待。如长时间未完成修改请尝试重启应用。",follow_time:"关注时间",update_time:"更新时间",search:"搜索",type:"类型",added:"已添加",click_to_task:"点击前往对应任务",lib_already_added:"您已添加此视频",description:"描述",poster:"海报",channel_poster:"频道海报",preview:"预览",creator:"创作者",creator_detail:"创作者详情",loading_creator:"正在加载创作者信息",wait_for_creator_loaded:"请等待创作者信息加载完成。",follower:"关注者",followers:"关注者",follower_list:"关注者列表",user:"用户",channel_title:"频道标题",channel_id:"频道 ID",post_title:"推文标题",post_id:"推文 ID",import_data_from_excel:"从 Excel 导入数据",set_excel_keys:"设置excel键",excel_import_succeded:"Excel 导入成功",excel_import_success_msg:"可添加 {0} 条新项目, {1} 条信息不完整及 {2} 条重复项已忽略",cannot_find_channel:"找不到指定频道",cannot_find_posts:"找不到指定视频",add_channel:"添加频道",add_post:"添加推文",edit_channel:"编辑频道",channel_setting:"频道设置",edit_post:"编辑推文",edit_posts:"编辑推文",channel_detail:"频道详情",remove:"移除",remove_channel:"移除频道",remove_channel_confirm:"是否确认移除频道?此操作不可恢复。",remove_post:"移除推文",remove_post_confirm:"是否确认移除推文?此操作不可恢复",preview_mode:"预览模式",preview_mode_desc:"这是频道的预览模式,所有分级的影片均为可见状态。",edit_user_profile:"编辑用户资料",name:"昵称",avatar:"头像",no_following:"没有已关注的频道。点击前往",no_recommend:"没有可推荐的频道。点击前往",first_recomment_msg:"如果您是初次使用,加载时间可能较长",invalid_image:"图片异常",image_not_reachable:"此图片URL不可用",channel_not_found:"找不到频道",cannot_get_channel_info:"无法获取指定的频道信息。该频道可能已被创作者删除而不再可见。",validate_error:"验证错误",validate_user_name_no_space:"用户名不可包含空格",validate_url_no_space:"URL 不可包含空格",validate_user_name_length:"用户名应为 {0}-{1} 字符",validate_user_desc_length:"用户描述不可多于 {0} 字符",validate_user_avatar_url:"用户头像应为链接且不多于2048字符",validate_channel_title_length:"频道标题应为1-100字符",validate_channel_desc_length:"频道描述应为10-300字符",validate_channel_image_url:"频道预览图应为链接且不多于2048字符",validate_post_title_length:"推文标题应为1-100字符",validate_post_desc_length:"推文描述应为10-300字符",validate_post_image_url:"海报应为链接且不多于2048字符",validate_post_url:`${_} 链接格式错误`,validate_post_url_length:`${_} 链接不可多于2048字符`,film_rate:"影片分级",set_film_rate:"设置影片分级",select_a_rate_before_enter:"您需要设置一个影片分级才可进入媒体库。",library_available_rate:"媒体库可用影片分级",rate_g:"G(大众级)",rate_g_desc:"所有年龄皆可观赏\n此类影片不含或仅含少量会让家长在让儿童观赏时感到被冒犯的内容,无需家长陪同。",rate_pg:"PG(建议家长指导)",rate_pg_desc:"一些内容可能不适合儿童观看\n此类影片包含部分家长可能认为不适合儿童的内容,因此建议家长可同时进行指导。",rate_pg_13:"PG-13(家长特别留意)",rate_pg_13_desc:"一些内容可能不适合13岁以下儿童观看\n此类影片有部分内容对13岁以下儿童不适宜,需要有父母陪同观看。此类影片动作暴力适当,含有少量血腥场面及不雅用语,但也包含可能令人情绪不安的情节。",rate_r:"R(限制级)",rate_r_desc:"未满十七岁人士必须由家长或成年监护人陪同\n此类影片中常有大量血腥暴力、惊悚恐怖、裸露性爱或吸毒场景,且有大量性暗示及不雅用语/ 冒犯性言论等,17岁以下人士必须由父母或者监护陪伴才能观看。",rate_nc_17:"NC-17(只准成人观看)",rate_nc_17_desc:"17岁或以下人士不得观赏\n此类影片其中常有清楚的性爱场面,大量的吸毒或暴力镜头以及脏话等,因此仅适合成人观赏。",set_as_private:"设为私有",hide_in_explore:"在浏览页隐藏此频道",hidden:"已隐藏",select_a_rate:"请选择一个影片分级",select_from_tasks:"从上传任务中选择",import_from_magnet:`从${Object(m["a"])()?"链接":"磁力链接(magnet:?...)"}导入`,input_magnet_url:"输入链接",task_title:"任务标题",set_title:"设为标题",add_to_local_favorites:"添加到本地收藏",remove_from_local_favorites:"从本地收藏中移除",removed_favorite:"已移除收藏",import_or_export_favorites:"导入/导出收藏",export_local_favorites:"导出收藏文件作为备份",import_favorites_file:"导入备份的收藏",not_a_favorite_file:"此文件并非收藏备份",connection_status:"连接状态",gun_server_list:"缓存节点",custom_nodes:"自定义缓存节点",custom_nodes_hint:"缓存节点将在重启软件后应用",wait_for_reboot:"即将重启软件...({seconds}s)",reboot_now:"立即重启",reboot_later:"稍后重启",peer_list:"节点列表",server:"节点 URL",peer:"节点",peer_id:"节点 ID",connection:"连接",data_source:"数据源",sync:"同步",syncing:"同步中",sync_completed:"同步完成",got_all_post:"已获取全部推文",placeholder_channel_title:"频道名称",placeholder_channel_desc:"关于此频道的描述",placeholder_post_title:"电影名称 (年份)",placeholder_post_desc:"关于此电影的描述",private_channel:"私有频道",creator_blocked:"已屏蔽创作者",go_to_library:"前往媒体库?",go_to_library_channel_msg:"是否前往媒体库频道 {0}?",magnet_does_not_have_name:"此链接不包含任务名,请输入推文标题后重试。",no_available_post:"无可见推文",following_channel_no_post:"已关注的频道中不含可见的推文。此问题可能由网络错误引起。如果您已关注带有推文的频道,这些推文将在稍后加载完成。",share_to_library:"分享到媒体库",quick_start:"快速开始",quick_start_desc:"选择一个任务或文件快速创建推文",select_file:"选择文件...",select_folder:"选择文件夹...",post_options:"推文选项",channel_options:"频道选项",create_new_channel:"创建新频道",use_existed_channel:"使用已存在的频道",select_existed_channel:"选择一个频道",uploaded_by:"{title} (由 {name} 上传)",created_by:"{title} (由 {name} 创建)",creating_new_channel:"正在创建新频道...",created_new_channel:"新频道已创建",creating_new_post:"正在创建新推文...",created_new_post:"新推文已创建",create_new_post:"创建推文",quick_start_timeout:"{0}超时。此问题可能由网络错误引起。请稍后再试。",file_too_large:"文件过大",file_too_large_msg:"此文件的大小超过了 4GB ({size}),上传此文件可能需要较长的准备时间,是否仍要上传?",resolving_folder_files:"正在解析文件夹内容...",folder_too_large:"文件夹过大",folder_too_large_msg:"文件夹中的文件大小超过 4GB ({size} 总大小),上传此文件夹可能需要较长的准备时间,是否仍要上传?",creating_new_task:"正在创建新任务...",cannot_create_task:"创建任务异常",cannot_create_task_msg:"创建任务时产生了未知错误。任务可能已被创建,请查看上传列表以确定上传状态。",cannot_get_task_name:"无法获取任务名,请输入推文标题后重试",remove_old_task:"删除旧任务",remove_old_task_desc:"Web 模式仅允许创建一个任务,是否删除旧任务?",subtitle_list:"字幕列表",optional:"可选",with_subtitle:"含有{language}字幕",add_subtitle_url:"添加字幕下载链接",maximumSubtitleNum_limit:"字幕数量已达到最大",cannot_add_subtitle:"添加字幕失败",cannot_add_subtitle_msg:"没有选择字幕语言或下载链接无效。",support_subtitle_type:"仅支持srt,vtt格式的字幕。",recommend_opensubtitles:"建议使用www.opensubtitles.org的字幕下载链接或id。",take_down:"下架",serious_violation:"严重违规",copyright_disputes:"版权争议",adults_only:"成人内容",takedown_reason:"下架理由",takedown_mode:"下架模式",admins:"管理员",takedown_user:"下架此创作者",takedown_channel:"下架此频道",takedown_post:"下架此推文",select_takedown_reason:"选择下架理由",takedown_invalid_reason:"下架理由错误",takedown_invalid_user_id:"用户ID错误。ID应为87位字符",takedown_invalid_channel_id:"频道ID错误。ID应为20位字符",takedown_invalid_post_id:"推文ID错误。ID应为20位字符",takedown_management:"下架管理",users:"用户",channels:"频道",posts:"推文",you:"你",preset:"预设",admin:"管理员",committee:"委员会",about_takedown_mode:"模式说明:\n预设:在github添加,所有内容都会移除。\n管理员:任一管理员投票后即会移除。\n委员会:超过半数管理员投票后才会移除。",cannot_edit_preset:"无法编辑此行,因为它是预设内容",cannot_edit_not_vote:"无法编辑此行,因为你未为其投票",remove_vote:"移除你的下架投票",post_preload_failed:"无法预载此推文。下载链接可能已过期,因此无法立即播放。",about_cache_node:"关于缓存节点",edit_cache_node:"编辑缓存节点",create_cache_node:"创建缓存节点",about_cache_node_desc:`${_} 使用 gun 服务器作为缓存节点,您可以在进阶设置中编辑自定义节点。`,learn_how_to_deploy_gun:"查看如何建立自定义节点",library_setting:"媒体库设置",block_list_manage:"屏蔽列表管理",blocked_users:"已屏蔽的用户",blocked_channels:"已屏蔽的频道",unblock_user:"解除用户屏蔽",unblock_channel:"解除频道屏蔽",no_blocked_user:"没有已屏蔽的用户",no_blocked_channel:"没有已屏蔽的频道",field_required:"{0} 不能为空"};const g=i.a.displayName,b={unsupported_in_browser:"此功能暂不支持浏览器模式",client:"客户端",warning:"警告",enable:"启用",disable:"禁用",auto:"自动",encrypt_connection:"加密连接",encrypted_connection:"已加密的连接",non_encrypted_connection:"未加密的连接",connected_wires_not_disconnect:"已存在的连接不会被断开",audio:"音频",video:"视频",image:"图片",subtitle:"字幕",zip:"压缩文件",text:"文本",unknown:"未知",add:"添加",undo:"撤销",backup:"备份",not_default_app:`${g}不是你的默认应用. 是否设置默认应用?`,dont_show_again:"不再提示",go_to_settings:"前往设置",about_alphabiz:`关于 ${g}`,update_channel:"更新通道",last_check_at:"上次检查更新时间",check_for_update:"检查更新",checking_for_update:"检查更新中...",no_update_available:"没有可用更新",update_available:"更新可用",update_now:"现在更新",update_later:"以后更新",click_to_update:"点击[现在更新]按钮以开始下载更新",update_failed:"更新失败",update_failed_message:"在更新时遇到了一个错误: ",check_shasum_failed:"安装包完整性检查失败",downloading_update:"更新下载中...",ready_to_update:"准备更新",restart_to_update:`更新下载已完成. ${g} 将在数秒后退出以安装更新`,already_latest:"当前版本({0})已是最新",update_timeout:"更新超时",no_available_release:"没有可用的版本",no_available_installer:"没有可用的安装包",feedback:"反馈",select_a_type:"选择一个类型",category:"分类",select_a_category:"选择一个分类",title:"标题",require_title:"请提供标题",describe_your_problem:"描述您遇到的问题",report_a_bug:"报告一个错误(bug)",request_a_new_feature:"请求一个新功能",download_or_upload:"下载/上传",others:"其他",submit_with_system_info:"提交时附带系统信息",submit_feedback:"提交反馈",tweet_us:"发送Twitter",tweet_too_long:"Tweet过长",delete_characters:"请删除{0}个字符",rest_characters:"还能输入{0}个字符",update_alphabiz:`更新 ${g}`,current_version:"当前版本",cancel_update:"取消更新",slow_download_speed:"下载过于缓慢",slow_download_speed_caption:"当前更新包下载过于缓慢,请检查网络状态",update_canceled:"更新已取消",current_version_release_time:"当前版本发布时间",expired_app:`${g} 过期`,version_out_of_date:"版本过旧",have_to_update:`${g} 版本过旧,部分接口或协议已失效。您需要升级 ${g} 才可继续使用。`,exit_alphabiz:`退出 ${g}`,exit_and_update:"退出并应用更新",new_version_hint:"新版本可用",no_new_version:"没有可用的新版本",current_is_latest:"当前版本已是最新版",click_to_check_update:"点击 [检查更新] 按钮以检查更新",download_latest_version_from_website:"请前往官网下载最新版本",to_the_website:"前往官网",network_diagnotic:"网络诊断",diagnotic:"诊断",click_to_check:"点击开始检查",click_to_check_again:"点击再次检查",checking:"检查中",online:"在线",offline:"离线",dns_look_up:"域名解析",error:"错误",aws_service:"AWS 服务",network_pings:"网络 Ping",not_found:"未找到",packet_loss:"丢包率",official_site:"官方网站",download_test:"下载测试",connected:"已连接",test_task:"测试任务 ({0})",download_failed:"下载失败",second_spend:"用时 {0} 秒",open_default_player_failed:"打开默认播放器失败",copied_to_clipboard:"已复制到剪贴板",go_to:"前往",region_not_available:"地区不可用",region_not_available_message:"抱歉,此应用在您的地区不可用。本应用将在{0}秒后退出",confirm:"确认",no_available_result:"无可用结果"};var y={...f,...l,...c,...d,...h,...u,...p,...b};const v=i.a.displayName;var w={repeat_add:"The task has been added, Please do not add it again",upload:"Upload",download:"Download",delete:"Delete",delete_task:"Delete task",delete_confirm_message:"Delete this task? This is irrevocable",also_delete_files:"Also delete files",default_delete_files:"Default delete downloaded files after remove task",not_now:"Not now",delete_autoupload_confirm:"This task contains file you put in auto-upload directory. Delete this task will also delete the file.",delete_anyway:"Delete anyway",upload_too_many_files:"Upload too many files",ask_if_unlimit_upload_amount:"The auto-upload directory contains too many files. Do you want to disable the upload amount limitation? *This may cause performance problem",disable_limitation:"Disable limitation",not_length:"Multi file operation is not supported at present, Please cooperate",download_torrent:"Download file",upload_torrent:"Upload file",files:"Files",file:"File",folder:"Folder",start_all:"Start all",pause_all:"Pause all",remove_all:"Remove all",upload_all:"Upload all",clear_history:"Clear history",pause_all_finish_payments:"This will finish all payments.",accelerating:"Accelerating",link_task:"Link task",torrent_task:"File task",ok:"OK",cancel:"Cancel",download_directory_position:"Download directory position",torrent_file:"task file",magnetic_link_incorrect:"The link format is incorrect",delete_fail:"Delete fail",pause:"Pause",paused:"Paused",stop_torrent:"Stop",seed:"Seed",resume:"Resume",downloading:"Downloading",downloaded:"Downloaded",uploading:"Uploading",auto_uploading:"Auto uploading",uploaded:"Uploaded",pending:"Waiting for other tasks",verifying:"Verifying",waiting_for_verify:"Waiting for verify",seeding:"Seeding",completed:"Completed",status:"Status",task_name:"Task name",size:"Size",progress:"Progress",sort:"Sort",ascending:"Ascending",descending:"Descending",file_loading:"Loading file...",loading:"Loading",unknown_status:"Unknown",play_while_downloading:"Play...",upload_or_play:"Upload / Play",play:"Play",ask_if_upload_file:"Upload file?",ask_if_upload_or_play:"Upload or play file?",torrent_error:"Error when adding task:",no_peers:"Retry for more than {0} times and no peer is available",torrent_exists:"Task already exists.",show_origin_torrent:"Get original task file or url",show_directory:"Open directory of this torrent",task_num:"Tasks",total_upload_speed:"Upload speed",total_download_speed:"Download speed",path_missing:"Error: cannot find torrent path",origin_not_found:"Cannot find origin task info.",text_copied:"Magnum url is copied to your clipboard",copy_magnet_uri:`Copy ${Object(m["a"])()?"link":"magnet:?"} URI`,copy_download_uri:"Copy download URI",copy_share_uri:"Copy share URI",uri_copied:"URI is successfully copied to your clipboard",uri_copy_failed:"Failed to copy uri",more:"More...",toggle_list_mode:"Toggle list mode",comment:"comment",operations:"Operations",open_directory:"Open directory",no_downloading_task:"No downloading task",remove_all_downloading_tasks:"Remove all downloading tasks?",remove_all_upload_tasks:"Remove all upload tasks?",remove_autoupload_files:"Remove auto-upload files",remove_all_history:"Remove all history?",remaining:"Remaining",created_time:"Created time",used_time:"Used time",completed_time:"Completed time",yesterday:"Yesterday",before_yesterday:"{empty}",earlier:"Earlier",miss_file:"Some files are missing",delete_miss_file_task:"There are fome files missing in {0}.",common_peer:"Common peer",ab_peer:`${v} peer`,ab_peer_verified:`Verified ${v} peer`,ab_peer_available:`${v} peer(s) available`,alphabiz_accelerating:`${v} accelerating`,income:"Income",income_info:"Income(today/total)",total_income_info:"Income: {0}(today) / {1}(total)",login_to_see_income:"Login to see income statistics",credit_cost:"Credit costs",downloaded_by_payment:"Downloaded by Payments",file_not_found:"Cannot find this file in local",no_task:"No task",no_matched_task:"No matched task",space_not_enough:"Disk space not enough",need_more_space:"Need {0} more space but current disk has {1} free ({2} reserved). Tasks are paused. Library preload is disabled. You can re-enable it in [Settings - Advanced].",seeders:"Seeders",last_update:"Last update",connecting:"Connecting",connected:"Connected",request_timed_out:"Request timed out",connection_failed:"Connection failed",invalid_download_url:"Invalid download URL",download_link:"download link",empty_files:"No files in directory",duplicate_task:"Duplicate task",duplicate_tracker:"Duplicate tracker",this_task_not_ready:"This task is not ready. Pause this task will directly remove it.",some_task_not_ready:"Some tasks are not ready. Pause these tasks will directly remove them.",failed_to_delete_files:"Failed to delete files",failed_to_delete_files_desc:"Failed to delete some files of the task. You may need to delete them manually",unknown_error:"Unknown error: {0}",more_files_are_not_shown:"({0} more files are not shown for performance reason)",no_available_file:"No available file. Please wait for task ready.",service_worker_error:"Cannot load ServiceWorker for playing. Your browser may not support this feature, or the ServiceWorker is not activated. You may need to reload this page and try again.",add_task_first:"You need to add task first.",player_task_time:"Player takes too many seconds preparing for play. There may be something wrong with the task.",web_mode_hint:`The web mode of ${v} only supports WebRTC peers. For best experience, please download ${v} Desktop App.`,web_mode_task_hint:"Click buttons below to add a task. You can only add one task at one time.",save_to_local:"Save to local",save_as_zip:"Save as ZIP",creating_save_file:"Creating save file...",upload_as_one_directory:"Upload as one directory",upload_as_single_files:"Upload as single files",web_mode_upload_single:"You can only upload a single file in web mode",download_success:"Download successfully",download_fail:"Download failed",wait_for_downloaded_to_share:"Please wait for task downloaded before sharing.",download_with_cellular:"Download tasks using cellular",download_with_cellular_desc:"You are using cellular network. Download tasks with cellular may take additional fees by your carrier.",download_with_cellular_confirm:"Still download with cellular"},k={language:"Language",appearance:"Appearance",darkModeSystem:"System",darkModeLight:"Light",darkModeDark:"Dark",basic_setting:"Basic",hideMenu:"Hide App Menu (Windows & Linux Only)",autoHide:"Auto Hide Window",autoStart:"Open at login",restore:"Keep size and position of the window when exit",autoStartUnfinished:"Automatically resume all unfinished tasks",default_download_path:"Default Path",download_directory:"Download Directory",upload_directory:"Upload Directory",enable_auto_upload:"Enable auto upload",unlimit_upload_amount:"Unlimit upload amount",unlimit_upload_warning:"Allow upload large amount of files. This may cause performance problem",start:"Startup",transport_setting:"Transmission",upload_limit:"Upload limit",download_limit:"Download limit",payed_user_share_rate:"Payed user share rate",unlimited:"Unlimited",limit_input_error:"Limit number should be positive",BT_setting:"Task Settings",saveLinkSeed:"Save link as task file",autoDownload:"Automatically download link and content",continuousSeeding:"Keep seeding until stop it manually",seedSharingRate:"Seed Ratio",seedTime:"Seed Time (minutes)",task_manage:"Task Management",maximumDownloadNum:"Maximum active tasks",maximumConnectionsNum:"Maximum connection per server",range_error:"Range should between {0} and {1}",random:"Random",breakpointContinuation:"Continue",automaticSkip:"Automatically show downloading after adding task",afterNotification:"Notification after download is complete",deleteConfirm:"No confirmation is required before deleting task",submit:"Save & Apply",discard:"Discard",reset:"Reset",reset_all_settings:"Reset all settings?",preferences_resetted:"Preferences resetted",traditional_chinese:"繁體中文",japanese:"日本語",english:"English",chinese:"简体中文",advancedSettings:"Advanced",autoUpdate:"Auto Update",autoCheckUpdate:"Automatically check for update",proxy:"Proxy",useProxyService:"Enable Proxy",trackerService:"Tracker Servers",recommendUse:"Recommended",autoUpdateTrackerServiceList:"Update tracker list every day automatically",manualUpdateTracker:"Manual update",manualUpdateSuccess:"Successfully update tracker servers",manualUpdateFail:"Failed to update from:",listenPort:"Listen Ports",BTlistenPort:"Data Transmission Port",DHTlistenPort:"Distributed Hash Port",protocols:"Compatible Protocols",setDefaultClientForFollowingProtocols:"Set as the default client for the following protocols",magnetUrl:"Magnet",video_file:"Video file",audio_file:"Audio file",security:"Security",impersonateUserAgent:"Mock User-Agent",RPCauthorizationkey:"RPC Secret",viewDocument:"View RPC Secret Manual",developer:"Developer",applicationLogPath:"App log path",downloadSessionPath:"Download session path",resetDownloadSessionRecord:"Reset download session",restoreInitialSettings:"Factory Reset",preferences_set_successfully:"Save preferences successfully!",preferences_set_fail:"Save preferences fail!",change_not_save:"Changes not save",discard_all_changes:"Discard all changes and leave?",stay_in_page:"Stay in page",disk_usage:"Disk usage",pause_if_less_space:"Pause and notify if space is less than (MB)",default_video_player:"Default video player",video_cache_time:"Stream play cache",minutes:"minutes",system_default:"System Default",media_player:"Media Player",library_film_rate:"Available film rate",library_show_explore:"Show [Explore] page",library_setting:"Library setting",library_sync_setting:"Library sync setting",keychain_sync_status:"Keychain sync status",sync_with_aws:"Sync Keychain with Amazon Web Services",backup_to_local:"Backup to local file",enable_sync_with_aws:"Enable sync with AWS",disable_sync_with_aws:"Disable sync with AWS",disable_sync_with_aws_desc:"This will remove saved key in server. Please ensure you have already export your key.",input_independent_password:"Input independent password",change_independent_password:"Change independent password",password_error:"Password error",password_invalid:"Password invalid",key_existed:"Key existed",key_not_found:"Key not found",library_recommend:"Library recommend",show_all_channels:"Show all channels in library recommend page",not_logged_in:"Not logged in",login_to_continue:"Login to continue",mnemonic_code:"Mnemonic code",wordlist:"Wordlist",restore_code:"Restore from code",generate_code:"Generate code",export_mnemonic_code:"Export mnemonic code",import_mnemonic_code:"Import mnemonic code",print:"Print",save_as_txt:"Save as txt",save_as_pdf:"Save as pdf",from_file:"From file",not_valid_mnemonic_code:"This is not a valid mnemonic code",cannot_parse_code_as_key:"Cannot parse this mnemonic code as library key",import_key_hint:"Are you sure to import this key? This will recover your old key in library.",import_key_confirm:"Yes, import it.",library_preload:"Preload tasks from library",show_preload:"Show preload tasks",set_download:"Set download directory",set_download_desc:"For macOS App Store version, the default download directory is in App's sandbox, and will be deleted after app uninstalled. If you want to keep your download files, you need to select a different download directory manually."};const C=i.a.displayName;var $={home:"Home",home_caption:"Download/Upload and Media Files",library:"Library",library_caption:"Explore media resources",player:"Player",player_caption:"Media Player",credits:"Credits",credits_caption:"Check Account Balance",account:"Account",account_caption:"Sign In/Sign Up/Management",settings:"Settings",settings_caption:"Settings for App, Player, Account",development:"Development",development_caption:"Developer Mode for Internal Use",basic:"Basic",basic_caption:"Basic Settings",advanced:"Advanced",advanced_caption:"Advanced Settings",blockchain:"Wallet",blockchain_caption:`${C} Decentralized Wallet`,internal_notice:"Internal Release Notice",release_notes:"Release notes",terms_and_conditions:"Terms and Conditions",license_and_listen_notices:"License and Listen Open Source Notices",close:"Close",success:"Success",fail:"Fail"},S={credits:"Credits",pay:"Pay",pay_with_credit:"Pay for download accelerating. Needs about {0} credit",pay_with_credit_payed:"Accelerating. Still needs about {0} credit",create_payment:"Create Payment",pay_target:"Target",pay_for_torrent:"Pay for {0}",your_subid:"Your subId",your_credits:"Your credits",pay_point_for_data:"Pay {0} point for {1} data",auto_renew:"Enable auto renew",transaction_details:"Transaction Details",transaction_id:"Id",transaction_payer:"Payer",transaction_payee:"Payee",transaction_category:"Category",transaction_changed_amount:"Changed Amount",transaction_meta:"Meta",transaction_status:"Status",transaction_creation_time:"Creation Time",receipt_code:"Receipt Code",transfer_amount:"Transfer Amount",code_the_receipt_code:"Copy the receipt code below to the payer",fill_the_receipt_code:"Transfer by filling in the payment code provided by the payee",income:"Income",expense:"Expense",copied:"Copied",transfer:"Transfer",receive:"Receive",copy:"Copy",withdraw_fund:"Withdraw Fund",category_paydata_payer:"Cost of data",category_paydata_payee:"Income of data",category_transfer:"Transfer",category_bonus:"Bonus",category_recharge:"Recharge",status_pending:"pending",status_completed:"completed",status_finish:"finish",status_failed:"failed",tip_invalid_receiver:"Invalid receiver code",tip_invalid_amount:"Credit amount should be an float in the range 0-1000 (Minimum precision is 0.001)",credit_get_more:"Get more credits",credit_no_data:"No data available",credit_loading:"Loading...",credit_not_enough_amount:"Not enough credits",credit_amount_not_enough:"Not enough credits",credit_payee_not_exist:"Payee does not exist",credit_invalid_amount:"Invalid credit amount",credit_can_not_transfer_to_yourself:"Can not transfer to yourself",credit_latest:"Latest",credit_error_network:"There is a problem with the network, please try again later","payer credit amount is not enough":"Not enough credits","payee does not exist":"Payee does not exist"},x={account_email_invalid_address:"Invalid email address",account_email_invalid_domain:"Invalid email domain",account_email_unknown_status:"Unknown email delivery status",account_email_unavailable_address:"Unavailable email address",account_email_suppressed_address:"Suppressed email address",account_loading:"Loading...",account_is_required:" is required",account_sign_in_your_account:"Sign in",account_username:"Username",account_username_email_phone:"Phone number or email",account_password:"Password",account_new_password:"New password",account_re_enter_password:"Re-enter password",account_password_not_equal:"Two passwords are not equal",account_new_password_same:"The password is the same as the original password",account_forgot_your_password:"Forgot your password? ",account_reset_password:"Reset password",account_sign_in:"Sign in",account_signed_in:"Signed in",account_sign_up:"Sign up",account_find_your_account:"Find your account",account_enter_your_username:"Enter your phone number or email",account_search:"Search",account_email_sent_tip:"An email with a verification code has been sent to your email: ",account_phone_sent_tip:"A SMS with a verification code has been sent to your phone: ",account_email_phone_sent_tip:"Email and SMS with verification code have been sent to your email and phone respectively:",account_software_token_tip:"MFA is enabled for your account. To finish signing in, please turn on or view your device and type the TOTP",account_reset_your_password:"Reset your password",account_verification_code:"Verification code",account_resend_code:"Resend code",account_code_has_been_resent:"Verification code has been resent",account_password_has_been_reset:"Password has been reset",account_submit:"Submit",account_sign_up_your_account:"Sign up your account",account_fill_required_fields:"Fill in the required fields below.",account_fill_optional_fields:"Fill in the optional fields below.",account_email:"Email",account_invitation:"Invitation",account_invitation_code:"Invitation code",account_i_accept:"I accept ",account_license_terms:"the license and terms",account_next:"Next",account_you_need_to_accept_license_terms:"You need to accept the license and terms first.",account_verify_fill_optional_fields:"Verify and fill in optional fields.",account_nickname:"Nickname",account_gender:"Gender",account_male:"Male",account_female:"Female",account_not_say:"Not say",account_birthday:"Birthday",account_phone_number:"Phone number",account_locale:"Locale",account_tip_verified:"Verified, Signing in...",account_verified:"verified",account_unverified:"unverified",account_signed_up:"Signed up",account_verify_your_identity:"Verify your identity",account_finish:"Finish",account_signed_out:"Signed out",account_change_password:"Change password",account_change_email:"Change email",account_change_phone_number:"Change phone number",account_sign_out:"Sign out",account_current_password:"Current password",account_re_enter_new_password:"Re-enter new password",account_personal_information:"Information",account_edit:"edit",account_reset:"reset",account_greeting:"Hello,",account_cancel:"Cancel",account_change:"change",account_not_set:"not set",account_setting:"setting",account_copy_code:"copy the code",account_account_setting:"Account",account_task_page:"Credit task",account_setting_caption:"Change Password / Edit Information",account_security:"Security",account_want_to_join:"Want to Join?",account_sign_in_now:"Sign in",account_changed:"Changed",account_clipboard_with_invitation_code:"Invitation code copied",account_clipboard_with_code:"The Code copied",account_invitation_code_dialog_tip:"You will send your friend an email or text message with an invitation code:",account_available:"available",account_invited:"invited",account_used:"used",account_invitation_code_sent:"Invitation code has been sent",account_invitation_channel_required:"Fill in at least one invitation channel",account_no_verification_code:"Can not receive verification code? ",account_no_phone_number:"No phone number? ",account_sign_up_by_email:"Sign up by email",account_no_email:"No email? ",account_sign_up_by_phone_number:"Sign up by phone number",account_no_totp:"No TOTP? ",account_tip_no_totp:"If there is no TOTP, please setup TOTP first",account_setup_totp:"Setup TOTP",account_contact_information:"Contact information",account_delete_account:"Delete account",account_deleted:"Deleted",account_can_not_mfa:"MFA in trouble? ",account_set_mfa_type:"Config MFA",account_disable_mfa:"Disable MFA",account_disabled_mfa:"Disabled MFA",account_sms_mfa:"SMS MFA",account_totp_mfa:"TOTP MFA",account_totp:"TOTP",account_not_recommend:"Not Recommend",account_oauth_sign_in_with:"Sign in with {provider}",account_sign_in_failed:"Failed to sign in",account_tip_oath_sign_up:"The email corresponding to the current {provider} account: {email} has not yet created an account",account_tip_confirm_delete_account:"Enter the current account password to confirm that you want to delete the current account.(Deleted accounts cannot be restored)",account_tip_config_mfa:"You can choose to use SMS or time-based one-time password (TOTP) as secondary authentication",account_error_can_not_enable_mfa:"You must bind your email address and mobile phone number to enable MFA",account_tip_can_not_enable_sms_mfa:"You must bind your email address and mobile phone number to enable SMS MFA",account_tip_can_not_enable_totp_mfa:"You must bind your email address and mobile phone number to enable TOTP MFA",account_tip_setup_totp:"Use apps such as Authenticator to scan the QR code below or copy the code manually to add a security token",account_tip_verify_totp:"Verify your TOTP",account_link_your_social_account:"Bind your social account",account_unlink_your_social_account:"Unbind social account",account_tip_confirm_link:"Are you sure you want to bind the current account to your {provider} account?",account_tip_confirm_unlink:"Are you sure to cancel your bound {provider} account?",account_tip_linking:"binding...",account_tip_unlinking:"Unbinding...",account_linked:"Bound",account_unlinked:"Unbound",account_error_can_not_link_to_the_linked_account:"The current social account is bound to another account",account_error_can_not_link_to_the_mismatched_email:"The current account and the social account email address are inconsistent",account_error_can_not_link_before_email_verified:"The social account cannot be linked because the current account is not bound to a verified email",account_tip_confirm_verify_email_phone:"Whether to send a verification code to the current account's email and phone number to verify your identity?",account_tip_confirm_verify_phone:"Whether to send a verification code to the current phone number to verify your identity?",account_error_1_message_60_seconds:"Only one SMS or email can be sent every 60 seconds, wait another {delta} seconds",account_error_10_messages_per_day:"Each mobile phone or email can only send 10 messages within 24 hours",account_error_network:"There is a problem with the network, please try again later","Network Error":"There is a problem with the network, please try again later",account_error_user_not_exist:"User does not exist",account_error_incorrect_username_or_password:"Incorrect username or password",account_error_incorrect_original_password:"Incorrect original password",account_error_incorrect_password:"Incorrect password",account_error_username_not_found:"Username not found",account_error_can_not_reset_for_no_verified:"Can not reset password for the unverified account",account_error_invalid_verification_code:"Incorrect verification code, please try again",account_error_expired_verification_code:"Verification code expired, please try again",account_error_password_not_long_enough:"Password is not long enough",account_error_attempt_limit_exceeded:"Attempt limit exceeded, please try after some time.",account_error_password_attempts_exceeded:"Password attempts exceeded.",account_error_invalid_phone_number_format:"Invalid phone number format",account_error_no_cell_phone_prefix:"Please select the prefix for the phone number",account_error_username_already_exists:"The username already exists",account_error_you_need_to_accept_license_terms:"You need to accept the license and terms first",account_error_inactive_code:"The invitation code is not an activated code",account_error_non_existent_code:"The invitation code is non-existent",account_error_unexpected:"Unexpected Error",account_error_can_not_change_email_before_phone_bound:"The email cannot be changed before the phone number is bound",account_error_can_not_change_email_before_unbound_social_account:"The email cannot be changed before unbinding the social account",account_error_can_not_change_phone_before_email_bound:"The phone number cannot be changed before the email is bound",account_error_can_not_change_email_phone_with_mfa_enabled:"Cannot change email or mobile phone number before disable MFA",account_error_same_email:"The new email address cannot be the same as the original email address",account_error_same_phone:"The new phone number cannot be the same as the original phone number",account_error_email_not_exists:"Email address does not exist",account_error_email_already_exists:"An account with the given email already exists.",account_error_phone_already_exists:"An account with the given phone number already exists.",account_error_mfa_token_mismatch:"Software Token Code mismatch",account_error_recaptcha_not_loaded:"There is a problem with the network. Please reconnect the network and restart the application to try again.",account_error_recaptcha_validation_failed:"ReCAPTCHA validation failed. Please reconnect the network and restart the application to try again.",account_error_sign_in_in_progress:"Pending sign-in attempt already in progress",account_field_range:"Limit input of {0}-{1} characters",account_field_only_alphanumeric:"Only supports alphanumeric",account_field_only_alphanumeric_and_symbol:"Only supports alphanumeric and symbols",account_field_only_chinese_alphanumeric_space_underline:"Only supports alphanumeric, space, underscore",account_field_prefix_without_number_space:"The first character cannot be a number or a space",account_field_suffix_without_space:"Cannot end with a space",account_field_without_repeat_space:"Cannot use multiple spaces in a row",account_field_can_not_only_alphanumeric:"You can't just use letters or numbers",account_field_must_have_number_characters:"Must have number characters",account_field_verification_code:"Verification code must be six digits",account_field_invitation_code:"Invitation code must be alphanumeric",account_field_phone_number:"Invalid phone number format",account_invalid_email_format:"Invalid email format",account_sign_out_confirm:"Are you sure to sign out? This will stop all tasks.",account_sign_out_anyway:"Sign out anyway",account_signing_out:"Signing out...",account_request_save_settings:"Settings are not saved. You need to save changes before sign out.",invalid_password_format:"Invalid password format",invalid_password_format_same:"The password is the same as the original password",error_password:"Password error",keychain_setting:"Keychain",setting_description:"Cloud storage: Save key data to the cloud.\nChange password: Change the password for the media library key.\nMnemonic: an alternative method for generating and restoring keys.\nImport Local Key: Import the locally saved key into the media library.\nExport Key: Saves the current media library data to the local or cloud.\nBackup key to cloud: Update the current media library data to the cloud for backup.",refresh_status:"Update Status",confirm_import_key:"Confirm import key",confirm_update_cloud_key:"You already have a key in the cloud. Updating the key will overwrite the original key. Are you sure you want to update the key stored in the cloud",export_key_with_cloud:"Enter the independent password you set to export the library key stored in the cloud, and lock the key file by the unlock password",store_cloud_key_prompt_password:"Enter an independent password to store the library key in the cloud",update_cloud_key_prompt_password:"Set an independent password to encrypt the library key then update it to the cloud",enable_cloud_storage_prompt_password:"Set a password for the key stored in the cloud, through which you can retrieve the key from the cloud",input_unlock_password:"Set unlock password",export_local_prompt_password:"Pleasse set an unlock password to encrypt your key file. We will not save this password for you, so if you loss your password, you will be not able to unlock your library key",require_unlock_password:"The key file is locked, please enter the unlock password",require_independent_password:"Enter the independent password to get the key stored in the cloud",import_local_prompt_password:"The key file is locked, please enter the unlock password",select_encrypt_mode:"Select encryption mode",input_independent_password:"Enter independent password",update_cloud_key:"Update the key stored in the cloud",backup_to_cloud:"Backup the library key to the cloud",save_local:"Save the library key as local encrypted file",create_new_key:"Create a new library key",creating_lib_key:"Creating library key...",loading_lib_key:"Loading library key...",failed_to_create_lib_key:"Failed to create library key",failed_to_load_lib_key:"Failed to load library key",import_local_key:"Import key locally",import_lib_key_from_local:"Import a library key Locally",import_from_cloud:"Import the library key from the cloud",create_or_import_key:"Create or import library key",create_or_import_key_desc:"Library key is an independent key used to fetch and publish contents with decentralized database.",store_your_lib_key:"Store your library key",export_cloud_key:"Export Key from Cloud",export_current_key:"Export Current Key",change_password:"Change Password",enable_cloud_storage:"Enable cloud storage",disable_cloud_storage:"Disable cloud storage",disable_cloud_storage_desc:"Disable cloud storage will remove the key saved in the cloud, please ensure the key is saved locally",sync_at:"Sync at: {time}",keychain_sync_status:"Keychain Sync Status",cloud_storage_enabled:"Sync Keychain with {storage}",cloud_storage_disabled:"Cloud storage disabled",saved_locally:"Saved locally",export_key:"Export key file",cloud_independent_password:"Cloud independent password",key_file_unlock_password:"Key file unlock password",re_enter_unlock_password:"Re-enter unlock password",independent_password_not_enabled:"The current password is the Alphabiz account password (no independent password is set)",use_cognito_hash:"Use Alphabiz account password",use_independent_password:"Use independent password",keychain_lib:"library key",loading_keychain_state:"Loading keychain...",backing_up:"Backing up...",backup_current_key:"Backup current key to Cloud",cloud_lib_key_not_existed:"library key does not exist in Cloud",open_keychain_file:"Open Keychain File",confirm_open_abk:"Do you want to open the ABK file",use_the_key:"Use the key",backup_the_key:"Backup the key to the cloud",keychain_data_does_not_exist:"Keychain data does not exist","timeout of 0ms exceeded":"There is a problem with the network, please try again later",XhrError:"There is a problem with the network, please try again later"},T={add_subtitles:"Add Subtitles",open_file:"Open File...",advanced_options:"Advanced options",title:"title",location:"location",subtitle_file:"subtitle file",unsupported_subtitle_type:"The file type of {0} is not a supported subtitle type",not_default_player:"The default video player is not set",this_is_an_audio_file:"This is an audio file",the_added_subtitle_already_exists:"The added subtitle already exists",stop_stream_player:"The streaming media was terminated because the task was paused or deleted",stop_player:"The player was terminated because the file was deleted",playing_timeout_hint:"Wait times out. Please check the task",autoplay_hint:"Autoplay may blocked by your browser. If the player is not playing, try click the screen to continue",remove_playing_confirm:"{0} is still playing, remove it will stop the player. Are you sure to remove it?",subtitle:"Subtitle",setting:"Setting",loading:"Loading",unknown_media:"Unknown Media",settings_button_visible:"Button Visible",settings_setting:"Setting",settings_playback_rate:"Playback Rate",settings_subtitle:"Subtitle",settings_pip:"PiP",settings_fullscreen:"Fullscreen",settings_subtitle_options:"Subtitle Options",settings_normal:"Normal",settings_italic:"Italic",settings_lighter:"Lighter",settings_bolder:"Bolder",settings_small:"Small",settings_large:"Large"};const I=i.a.displayName;var P={lib_index:"Home",lib_edit:"Publish",lib_publish:"Publish",lib_explore:"Explore",lib_following:"Following",lib_favorite:"Local Favorites",lib_local_favorites:"Local Favorites",lib_channel:"Channel",lib_submit:"Submit",lib_from_network:"Using decentralized database from network",welcome_to_lib:`Welcome to ${I} Media Library`,register_or_login:"Register/Login",lib_recommend:"Recommend",lib_recommend_desc:`Welcome to ${I} Library! This library uses decentralized database from network. To start using it, you need to follow some channels.`,follow_any_channel_to_continue:"Follow any channel to continue",follow_channels_and_continue:"Follow {0} channels and continue",show_more_for_me:"Show more for me",no_more_recommend:"No more recommend",key:"Key",create_key:"Create key",save_key:"Save key",save_key_file:"Do you want to save your key as file?",import_key:"Import key",import:"Import",invalid_key:"Invalid key",back_to_top:"Back to top",search_for_channel:"Search for channel ID",search_channel_no_result:"Cannot find channel with ID {0}",please_input_channel_id:"Please input channel ID",welcome_help_text:"\n This is a decentralized media library. You need\n to create an account for this database. We will\n generate a personal key for you automatically.\n If you have already had a key, you can also import\n it here.",welcome_key_text:"\n Once you logged in, please click [SAVE KEY] button\n in the right-bottom corner to save your private key.\n If you loss your key, you may not able to login again.",redirect_to_recommend:"It seems you had not followed any channel. Redirecting to [Explore] page.",channel:"Channel",follow:"Follow",unfollow:"Unfollow",following:"Following",share:"Share",unfollow_confirm:"Are you sure to unfollow this channel? All posts of this channel in your timeline will be removed.",follow_failed_hint:"Operation is still pending in background. If the operation is not applied for a long time, please restart app and try again.",block:"Block",unblock:"Unblock",blocked:"Blocked",block_channel:"Block this channel",block_channel_confirm:"Block channel will remove it from your timeline. You can manage your block list in account setting.",block_creator:"Block the creator of this channel",unblock_creator:"Unblock the creator of this channel",block_creator_confirm:"Block creator will remove all channels created by this creator from your timeline. You can manage your block list in account setting.",share_url_copied:"Share URL is copied to your clipboard",follow_time:"Follow time",update_time:"Update time",search:"Search",type:"Type",added:"Added",click_to_task:"Click to go to task",lib_already_added:"You have already added this video",description:"Description",poster:"Poster",channel_poster:"Channel poster",preview:"Preview",creator:"Creator",creator_detail:"Creator detail",loading_creator:"Loading creator info",wait_for_creator_loaded:"Please wait for creator info loaded.",follower:"Follower",followers:"Followers",follower_list:"Follower list",user:"User",channel_title:"Channel title",channel_id:"Channel ID",post_title:"Post title",post_id:"Post ID",import_data_from_excel:"Import data from excel",set_excel_keys:"Set excel keys",excel_import_succeded:"Excel import succeded",excel_import_success_msg:"{0} rows are ready to add, {1} invalid and {2} duplicated items are ignored",cannot_find_channel:"Cannot find channel",cannot_find_posts:"Cannot find posts",add_channel:"Add channel",add_post:"Add post",edit_channel:"Edit channel",channel_setting:"Channel setting",edit_post:"Edit post",edit_posts:"Edit posts",channel_detail:"Channel detail",remove:"Remove",remove_channel:"Remove channel",remove_channel_confirm:"Are you sure to remove this post? This cannot be recovered.",remove_post:"Remove post",remove_post_confirm:"Are you sure to remove this channel? This cannot be recovered.",preview_mode:"Preview Mode",preview_mode_desc:"This is a preview of your channel. All rates of films are shown here.",edit_user_profile:"Edit user profile",name:"Nickname",avatar:"Avatar",no_following:"No following channels. Click to goto",no_recommend:"No recommend channels. Click to goto",first_recomment_msg:"It may take a while if this is the first time app launched.",invalid_image:"Invalid image",image_not_reachable:"This image url is not reachable.",channel_not_found:"Channel not found",cannot_get_channel_info:"Cannot get channel info. This channel may be removed by its creator and no longer available.",validate_error:"Validate error",validate_user_name_no_space:"User name should not contain spaces",validate_url_no_space:"URL should not contain spaces",validate_user_name_length:"User name should have length between {0} and {1}",validate_user_desc_length:"User description should not be more than {0} characters",validate_user_avatar_url:"User avatar should be url with less than 2048 characters",validate_channel_title_length:"Channel title should have length between 1 and 100",validate_channel_desc_length:"Channel description should have length between 10 and 300",validate_channel_image_url:"Channel preview should be url with less than 2048 characters",validate_post_title_length:"Post title should have length between 1 and 100",validate_post_desc_length:"Post description should have length between 10 and 300",validate_post_image_url:"Poster should be url with less than 2048 characters",validate_post_url:`Invalid ${I} URL`,validate_post_url_length:`${I} URL should not be more than 2048 characters`,film_rate:"Film rate",set_film_rate:"Set film rate",select_a_rate_before_enter:"You need to select a film rate before enter media library.",library_available_rate:"Library available film rate",rate_g:"G – General Audiences",rate_g_desc:"All ages admitted. Nothing that would offend parents for viewing by children.",rate_pg:"PG – Parental Guidance Suggested",rate_pg_desc:'Some material may not be suitable for children. Parents urged to give "parental guidance". May contain some material parents might not like for their young children.',rate_pg_13:"PG-13 – Parents Strongly Cautioned",rate_pg_13_desc:"Some material may be inappropriate for children under 13. Parents are urged to be cautious. Some material may be inappropriate for pre-teenagers.",rate_r:"R – Restricted",rate_r_desc:"Under 17 requires accompanying parent or adult guardian. Contains some adult material. Parents are urged to learn more about the film before taking their young children with them.",rate_nc_17:"NC-17 – Adults Only",rate_nc_17_desc:"No One 17 and Under Admitted. Clearly adult. Children are not admitted.",set_as_private:"Set as private",hide_in_explore:"Hide this channel in explore page",hidden:"Hidden",select_a_rate:"Please select a film rate",select_from_tasks:"Select from tasks",import_from_magnet:`Import from ${Object(m["a"])()?"link":"magnet:?"}...`,input_magnet_url:`Input ${Object(m["a"])()?"link":"magnet:?"} url`,task_title:"Task title",set_title:"Set title",add_to_local_favorites:"Add to local favorites",remove_from_local_favorites:"Remove from local favorites",removed_favorite:"Removed favorite ",import_or_export_favorites:"Import/Export Favorites",export_local_favorites:"Export local favorites as backup",import_favorites_file:"Import favorites file",not_a_favorite_file:"This file is not a favorite backup file",connection_status:"Connection Status",gun_server_list:"Cache Nodes",custom_nodes:"Custom cache nodes",custom_nodes_hint:"Custom cache nodes will be applied after app relaunch",wait_for_reboot:"Waiting for reboot...({seconds}s)",reboot_now:"Reboot now",reboot_later:"Reboot later",peer_list:"Direct Nodes",server:"Node URL",peer:"Peer",peer_id:"Node ID",connection:"Connection",data_source:"Data Source",sync:"Sync",syncing:"Syncing",sync_completed:"Sync completed",got_all_post:"You have already got all posts",placeholder_channel_title:"Your Channel Name",placeholder_channel_desc:"Description about this channel",placeholder_post_title:"Movie Name (Year)",placeholder_post_desc:"Description about this movie",private_channel:"Private channel",creator_blocked:"Creator blocked",go_to_library:"Go to library?",go_to_library_channel_msg:"Do you want to go to the library channel {0}?",magnet_does_not_have_name:`This ${Object(m["a"])()?"link":"magnet:?"} url does not have a name, you need to add a post title first.`,no_available_post:"No available post",following_channel_no_post:"All your following channels do not have available post. This may caused by network error. If you have already followed some channels, the posts may be loaded later.",share_to_library:"Share to library",quick_start:"Quick start",quick_start_desc:"Start creating a post with a task or file",select_file:"Select file...",select_folder:"Select folder...",post_options:"Post options",channel_options:"Channel options",create_new_channel:"Create new channel",use_existed_channel:"Use existed channel",select_existed_channel:"Select existed channel",uploaded_by:"{title} uploaded by {name}",created_by:"{title} created by {name}",creating_new_channel:"Creating new channel...",created_new_channel:"New channel created",creating_new_post:"Creating new post...",created_new_post:"New post created",create_new_post:"Create new post",quick_start_timeout:"{0} timeout. This may be caused by network error. Please try again later.",file_too_large:"File too large",file_too_large_msg:"This file is larger than 4GB ({size}) and may take a long time preparing task. Are you sure to continue?",resolving_folder_files:"Resolving folder files...",folder_too_large:"Folder too large",folder_too_large_msg:"The files in this folder are larger than 4GB ({size} total) and may take a long time preparing task. Are you sure to upload?",creating_new_task:"Creating new task...",cannot_create_task:"Cannot create task",cannot_create_task_msg:"This may cause by some error. If the task is created correctly, you can check for task list later.",cannot_get_task_name:"Cannot get task name. You need to input one first.",remove_old_task:"Remove old task",remove_old_task_desc:"Web mode can only create one task at once. Do you want to remove old task?",subtitle_list:"Subtitle list",optional:"optional",with_subtitle:"With {language} subtitles",maximumSubtitleNum_limit:"The number of subtitles has reached its maximum",add_subtitle_url:"Add subtitle download link",cannot_add_subtitle:"Failed to add subtitles",cannot_add_subtitle_msg:"Subtitle language not selected or invalid download link.",support_subtitle_type:"Only subtitles in srt and vtt format are supported.",recommend_opensubtitles:"It is recommended to use the subtitle download link or id at www.opensubtitles.org.",take_down:"Take down",serious_violation:"Serious Violation",copyright_disputes:"Copyright Disputes",adults_only:"Adults Only",takedown_reason:"Takedown reason",takedown_mode:"Takedown mode",admins:"Admins",takedown_user:"Takedown this creator",takedown_channel:"Takedown this channel",takedown_post:"Takedown this post",select_takedown_reason:"Select takedown reason",takedown_invalid_reason:"Invalid takedown reason",takedown_invalid_user_id:"Invalid user id. Id should include 87 characters",takedown_invalid_channel_id:"Invalid channel id. ID should include 20 characters",takedown_invalid_post_id:"Invalid post id. ID should include 20 characters",takedown_management:"Take down management",users:"Users",channels:"Channels",posts:"Posts",you:"You",preset:"Preset",admin:"Admin",committee:"Committee",about_takedown_mode:"About takedown mode:\nPreset: Configured in github repository. All of them will be removed from library.\nAdmin: Any one of admins votes for will be removed.\nCommittee: At least half of admins vote for will be removed.",cannot_edit_preset:"You cannot edit this row since it is a preset row",cannot_edit_not_vote:"You cannot edit this row since you have not voted for it",remove_vote:"Remove your vote",post_preload_failed:"Failed to preload this post. The download link may be out-of-date, so this post cannot be played immediately.",about_cache_node:"About cache node",edit_cache_node:"Edit cache node",create_cache_node:"Create cache node",about_cache_node_desc:`${i.a.displayName} uses gun server as cache node. You can edit custom nodes in advance setting`,learn_how_to_deploy_gun:"Learn how to deploy your own gun server",library_setting:"Library setting",block_list_manage:"Block list manage",blocked_users:"Blocked users",blocked_channels:"Blocked channels",unblock_user:"Unblock user",unblock_channel:"Unblock channel",no_blocked_user:"No blocked user",no_blocked_channel:"No blocked channel",field_required:"{0} is required"};const O=i.a.displayName,q={unsupported_in_browser:"Not supported in browser mode yet",client:"Client",warning:"Warning",enable:"Enable",disable:"Disable",auto:"Auto",encrypt_connection:"Encrypt connection",encrypted_connection:"Encrypted connection",non_encrypted_connection:"Non-encrypted connection",connected_wires_not_disconnect:"Connected wires will not be disconnected",audio:"audio",video:"video",image:"image",subtitle:"subtitle",zip:"zip",text:"text",unknown:"unknown",add:"Add",undo:"Undo",backup:"Backup",not_default_app:`${O} is not your default app for torrent and media, do you want to set as default?`,dont_show_again:"Don't show again",go_to_settings:"Go to settings",about_alphabiz:`About ${O}`,last_check_at:"Last check at",update_channel:"Update channel",check_for_update:"Check for update",checking_for_update:"Checking for update...",no_update_available:"No update available",update_available:"Update available",update_now:"Update now",update_later:"Update later",click_to_update:"Click UPDATE NOW button to download and update",update_failed:"Update failed",update_failed_message:"An error occured while updating: ",check_shasum_failed:"Failed to check integrity for installer",downloading_update:"Downloading update...",ready_to_update:"Ready to update",restart_to_update:`Update is downloaded. ${O} will exit to update for a few moment.`,already_latest:"Current version({0}) is already latest",update_timeout:"Update timeout",no_available_release:"No available release",no_available_installer:"No available installer",feedback:"Feedback",select_a_type:"Select a type",category:"Category",select_a_category:"Select a category",title:"Title",require_title:"Title is required",describe_your_problem:"Describe your problem",report_a_bug:"Report a bug",request_a_new_feature:"Request a new feature",download_or_upload:"Download/Upload",others:"Others",submit_with_system_info:"Submit with system info",submit_feedback:"Submit feedback",tweet_us:"Tweet us",tweet_too_long:"Tweet is too long",delete_characters:"Please delete at least {0} character(s)",rest_characters:"You can input {0} more character(s)",update_alphabiz:`Update ${O}`,current_version:"Current version",cancel_update:"Cancel update",slow_download_speed:"Download too slow",slow_download_speed_caption:"The installer download is too slow now. Please check the network status",update_canceled:"Update canceled",current_version_release_time:"Release time of current version",expired_app:`${O} Expired`,version_out_of_date:"Version out of date",have_to_update:`The version of ${O} is out of date. Some protocols or APIs are deprecated. You have to update ${O} before continue.`,exit_alphabiz:`Exit ${O}`,exit_and_update:"Exit and apply update",new_version_hint:"New version is available",no_new_version:"No new version available",current_is_latest:"Current version is already latest",click_to_check_update:"Click [CHECK FOR UPDATE] button to check for update",download_latest_version_from_website:"Please visit the official website to download the latest version",to_the_website:"To the website",network_diagnotic:"Network Diagnotic",diagnotic:"Diagnotic",click_to_check:"Click to check",click_to_check_again:"Click to check again",checking:"Checking",online:"Online",offline:"Offline",dns_look_up:"DNS look up",error:"Error",aws_service:"AWS Service",network_pings:"Network Ping",not_found:"Not Found",packet_loss:"Packet(s) loss",official_site:"Official Site",download_test:"Download Test",connected:"Connected",test_task:"Test Task {0}",download_failed:"Download failed",second_spend:"{0} s spend",open_default_player_failed:"Failed to open the default player",copied_to_clipboard:"Copied to clipboard",go_to:"Go to",region_not_available:"Region not available",region_not_available_message:"Sorry! Your region is not available to use this app. This app will quit after {0} seconds",confirm:"Confirm",no_available_result:"No available result"};var E={...P,...w,...k,...$,...x,...S,...T,...q};const A=i.a.displayName;var D={repeat_add:"任務已添加,請勿重複添加",upload:"上傳",download:"下載",delete:"刪除",delete_task:"刪除任務",delete_confirm_message:"是否刪除該任務? 此操作不可恢復",also_delete_files:"同時刪除文檔",default_delete_files:"刪除任務時默認刪除已下載的文件",not_now:"暫不處理",delete_autoupload_confirm:"此任務檔位於自動上傳資料夾, 刪除任務將同時刪除對應檔",delete_anyway:"仍要刪除",upload_too_many_files:"上傳檔過多",ask_if_unlimit_upload_amount:"自動上傳資料夾包含過多檔. 是否取消上傳數量限制? *此操作可能造成性能問題",disable_limitation:"取消限制",not_length:"暫不支持,多檔操作,請配合",download_torrent:"下載該任務",upload_torrent:"上傳該任務",files:"文件",file:"文件",folder:"資料夾",start_all:"全部開始",pause_all:"全部暫停",remove_all:"全部移除",upload_all:"全部上傳",clear_history:"清除歷史",pause_all_finish_payments:"此操作將完成所有已支付的訂單.",accelerating:"加速中",link_task:"連結任務",torrent_task:"文件任務",ok:"好的",cancel:"取消",download_directory_position:"下載目錄位置",torrent_file:"任務檔",magnetic_link_incorrect:"連結格式不正確",delete_fail:"刪除失敗",pause:"暫停",paused:"已暫停",stop_torrent:"結束任務",seed:"上傳",resume:"繼續",downloading:"下載中",downloaded:"下載完成",uploading:"上傳中",auto_uploading:"自動上傳中",uploaded:"上傳完成",pending:"等待其他任務完成",no_downloading_task:"沒有下載中任務",remove_all_downloading_tasks:"是否移除所有下載中任務?",remove_all_upload_tasks:"是否移除所有上傳任務?",remove_autoupload_files:"移除所有自動上傳任務",remove_all_history:"是否移除歷史下載記錄?",verifying:"驗證文件",waiting_for_verify:"等待驗證文件",seeding:"上傳中",completed:"已完成",status:"狀態",task_name:"任務名",size:"大小",progress:"進度",sort:"排序",ascending:"昇冪",descending:"降冪",file_loading:"檔載入中",loading:"載入中",unknown_status:"未知",play_while_downloading:"邊下邊播",upload_or_play:"上傳 / 播放",play:"播放",ask_if_upload_file:"是否上傳檔?",ask_if_upload_or_play:"是否上傳/播放檔?",torrent_error:"添加任務時遇到錯誤:",no_peers:"多次嘗試後仍未能與Peers建立連接",torrent_exists:"任務已存在",show_origin_torrent:"顯示原始任務檔或連結",show_directory:"打開文件所在位置",task_num:"任務數",total_upload_speed:"上傳速度",total_download_speed:"下載速度",path_missing:"Error: 找不到檔位置",origin_not_found:"獲取任務資訊失敗",text_copied:"連結已複製到剪貼板",copy_magnet_uri:"複製連結位址",copy_download_uri:"複製下載連結",copy_share_uri:"複製社交分享連結",uri_copied:"連結已複製至剪貼板",uri_copy_failed:"複製連結失敗",more:"更多",toggle_list_mode:"切換顯示模式",comment:"評論",operations:"操作",open_directory:"打開所在資料夾",remaining:"剩餘時間",created_time:"創建時間",used_time:"用時",completed_time:"完成時間",yesterday:"昨天",before_yesterday:"前天",earlier:"更早之前",miss_file:"文件缺失",delete_miss_file_task:"{0} 有部分檔缺失.",common_peer:"普通用戶",ab_peer:`${A} 用戶`,ab_peer_verified:`${A} 註冊用戶`,ab_peer_available:`${A} peer 可用`,alphabiz_accelerating:`${A} 加速中`,income:"收入",income_info:"收入(今天/總計)",total_income_info:"收入: {0}(今天) / {1}(總計)",login_to_see_income:"登陸以查看收入統計",credit_cost:"積分支出",downloaded_by_payment:"付費下載量",file_not_found:"無法找到本地檔",no_task:"無任務",no_matched_task:"無法找到匹配的任務",space_not_enough:"磁盤空間不足",need_more_space:"需要 {0} 磁盤空間, 磁盤空間僅剩 {1}, ({2} 為保留空間). 所有任務已暫停. 媒體庫預加載已禁用. 您可以在[設置 - 進階設置]中重新啟用.",seeders:"做種",last_update:"最後更新",connecting:"連接中",connected:"已連接",request_timed_out:"請求超時",connection_failed:"連接失敗",invalid_download_url:"下載鏈接錯誤",download_link:"下载鏈接",empty_files:"目錄中沒有文檔",duplicate_task:"重複任務",duplicate_tracker:"重複 tracker",this_task_not_ready:"此任務尚未就緒,暫停任務將直接刪除該任務",some_task_not_ready:"部分任務尚未就緒,暫停這些任務將直接刪除它們",failed_to_delete_files:"刪除文件失敗",failed_to_delete_files_desc:"無法刪除部分任務文件,可能需要手動刪除",unknown_error:"未知錯誤: {0}",more_files_are_not_shown:"(出於性能考慮,{0} 個文件未顯示",no_available_file:"没有可用的文件,请等待任務就绪",service_worker_error:"無法加載 ServiceWorker。您的瀏覽器可能不支援此特性,或 ServiceWorker 尚未就緒。請刷新頁面後再試",add_task_first:"請先添加任務",player_task_time:"播放器等待時間過長,請檢查任務是否就緒 ",web_mode_hint:`${A} Web 僅支援 WebRTC 種子。下載 ${A} 桌面版以獲得最佳體驗。`,web_mode_task_hint:"點擊下方按鈕創建任務。Web 模式下僅可同時創建一個任務。",save_to_local:"保存到本地",save_as_zip:"保存為 ZIP",creating_save_file:"正在創建文件...",upload_as_one_directory:"作為一個文件夾上傳",upload_as_single_files:"作為單獨的文件上傳",web_mode_upload_single:"Web 模式下只能上傳單個文件",download_success:"下載成功",download_fail:"下載失敗",wait_for_downloaded_to_share:"請等待下載完成後再分享。",download_with_cellular:"使用蜂窩數據下載",download_with_cellular_desc:"您正在使用蜂窩數據,下載時營運商可能會收取額外的費用。",download_with_cellular_confirm:"仍然使用蜂窩數據下載"},N={language:"語言",appearance:"外觀",darkModeSystem:"跟隨系統",darkModeLight:"明亮",darkModeDark:"黑暗",basic_setting:"基礎設置",hideMenu:"隱藏功能表欄(僅支援Windows和Linux)",autoHide:"自動隱藏視窗",start:"啟動",autoStart:"開機自動啟動",restore:"恢復上次退出時視窗的大小和位置",autoStartUnfinished:"自動開始未完成的任務",default_download_path:"預設下載路徑",download_directory:"下載目錄",upload_directory:"上傳目錄",enable_auto_upload:"允許自動上傳",unlimit_upload_amount:"不限制上傳數量",unlimit_upload_warning:"允許同時上傳大量檔案,此選項可能導致性能問題",transport_setting:"傳輸設置",upload_limit:"上傳限速",download_limit:"下載限速",payed_user_share_rate:"付費用戶上傳比例",unlimited:"不限速",limit_input_error:"限速需為正數",BT_setting:"下載任務設置",saveLinkSeed:"保存鏈接元數據為任務檔",autoDownload:"自動開始下載鏈接任務、任務檔",continuousSeeding:"持續上傳,直到手動停止",seedSharingRate:"分享率",seedTime:"上傳時間(分鐘)",task_manage:"任務管理",maximumDownloadNum:"同時下載的最大任務數",maximumConnectionsNum:"每個伺服器最大的連接數",range_error:"範圍需在{0}-{1}之間",random:"隨機",breakpointContinuation:"斷點續傳",automaticSkip:"新建任務後自動跳轉到下載頁面",afterNotification:"下載完成後通知",deleteConfirm:"刪除任務前無需確認",submit:"保存並應用",discard:"放棄",reset:"重置",reset_all_settings:"重置所有設置?",preferences_resetted:"偏好設置已重置",traditional_chinese:"繁體中文",japanese:"日本語",english:"English",chinese:"簡體中文",advancedSettings:"進階設置",autoUpdate:"自動更新",autoCheckUpdate:"自動檢查更新",proxy:"代理",useProxyService:"使用代理伺服器",trackerService:"Tracker伺服器",recommendUse:"推薦使用",autoUpdateTrackerServiceList:"每天自動更新Tracker伺服器列表",manualUpdateTracker:"手動更新",manualUpdateSuccess:"Tracker伺服器更新成功",manualUpdateFail:"更新以下Tracker伺服器失敗:",listenPort:"監聽埠",BTlistenPort:"數據傳輸埠",DHTlistenPort:"分散式哈希通訊埠",protocols:"兼容以下協定",setDefaultClientForFollowingProtocols:"設置本軟體為以下相容協定的預設用戶端",magnetUrl:"磁力連結",video_file:"視頻檔",audio_file:"音訊檔",security:"安全性",impersonateUserAgent:"模擬使用者代理(UA)",RPCauthorizationkey:"RPC授權密鑰",viewDocument:"查看說明文檔",developer:"開發者",applicationLogPath:"應用日誌路徑",downloadSessionPath:"下載會話路徑",resetDownloadSessionRecord:"重置下載會話記錄",restoreInitialSettings:"恢復初始設置",preferences_set_successfully:"偏好設置成功!",preferences_set_fail:"偏好設置失敗!",change_not_save:"修改未保存",discard_all_changes:"是否放棄所有更改?",stay_in_page:"留在此頁",disk_usage:"保留磁盘空間",pause_if_less_space:"剩餘空間小於此值時暫停並提醒(MB)",default_video_player:"默認視頻播放機",video_cache_time:"邊下邊播緩存時間",minutes:"分鐘",system_default:"系統預設",media_player:"媒體播放機",library_film_rate:"可見影片分級",library_show_explore:"顯示[探索]頁面",library_setting:"媒體庫設置",library_sync_setting:"媒體庫同步設置",keychain_sync_status:"金鑰同步狀態",sync_with_aws:"使用 Amazon Web Services 同步密鑰",backup_to_local:"保存為本地檔",enable_sync_with_aws:"啟用 AWS 同步",disable_sync_with_aws:"禁用 AWS 同步",disable_sync_with_aws_desc:"此操作將移除儲存在雲端的金鑰,請確保已將密鑰保存至本地。 ",input_independent_password:"輸入獨立密碼",change_independent_password:"修改獨立密碼",password_error:"密碼錯誤",password_invalid:"密碼格式錯誤",key_existed:"金鑰已存在",key_not_found:"金鑰不存在",library_recommend:"媒體庫推薦",show_all_channels:"在媒體庫推薦頁顯示所有頻道",not_logged_in:"尚未登錄",login_to_continue:"登陸以繼續",mnemonic_code:"助記詞",wordlist:"單詞表",restore_code:"從助記詞恢復",generate_code:"生成助記詞",export_mnemonic_code:"導出助記詞",import_mnemonic_code:"導入助記詞",print:"列印",save_as_txt:"保存為 txt",save_as_pdf:"保存為 pdf",from_file:"從文件導入",not_valid_mnemonic_code:"助記詞格式錯誤",cannot_parse_code_as_key:"無法將此助記詞解析為密鑰",import_key_hint:"是否確認導入此金鑰? 此操作將覆蓋舊的金鑰。 ",import_key_confirm:"確認導入",library_preload:"媒體庫任務預加載",show_preload:"顯示預加載任務",set_download:"設置下載文件夾",set_download_desc:"macOS App Store 版本默認保存位置為應用沙盒,在應用卸載時會一併刪除。為了保留下載文件,您需要手動選擇保存位置。"},L={home:"主頁",home_caption:"下載/上傳媒體文件",library:"媒體庫",library_caption:"探索媒體資源",player:"播放器",player_caption:"視頻播放",credits:"信用積分",credits_caption:"檢查賬戶積分餘額",account:"用戶",account_caption:"個人用戶配置",settings:"設置",settings_caption:"所有設置項",development:"開發者",development_caption:"應用開發者模式",basic:"主要設置",basic_caption:"主要設置項",advanced:"進階設置",advanced_caption:"進階的設置項",blockchain:"錢包",blockchain_caption:"去中心化錢包",internal_notice:"內部版本聲明",release_notes:"發行説明",terms_and_conditions:"條款和章程",license_and_listen_notices:"許可和監聽開源説明",close:"關閉",success:"成功",fail:"失敗"},j={credits:"信用積分",pay:"支付積分",pay_with_credit:"支付積分加速下載, 預計需要{0}積分",pay_with_credit_payed:"正在加速下載, 預計還需要{0}積分",create_payment:"創建積分訂單",pay_target:"支付對象",pay_for_torrent:"為 {0} 支付",your_subid:"用戶 subId",your_credits:"當前餘額",pay_point_for_data:"支付{0}積分以加速{1}數據",auto_renew:"允許自動續費",transaction_details:"訂單明細",transaction_id:"訂單編號",transaction_payer:"付款人",transaction_payee:"收款人",transaction_category:"類型",transaction_changed_amount:"變動金額",transaction_meta:"其他數據",transaction_status:"訂單狀態",transaction_creation_time:"訂單創建時間",receipt_code:"收款碼",transfer_amount:"轉賬金額",code_the_receipt_code:"複製下方收款碼給付款人",fill_the_receipt_code:"通過填入收款人提供的收款碼進行轉賬",income:"收入",expense:"支出",copied:"已複製",transfer:"轉賬",receive:"收款",copy:"複製",withdraw_fund:"選取基金",category_paydata_payer:"數據支付",category_paydata_payee:"數據收入",category_transfer:"個人轉賬",category_bonus:"系統獎勵",category_recharge:"充值",status_pending:"等待中",status_completed:"已傳完",status_finish:"已完成",status_failed:"已失效",tip_invalid_receiver:"無效的收款碼",tip_invalid_amount:"金額應為 0-1000 範圍內的數(最小精度為0.001)",credit_get_more:"獲得更多積分",credit_no_data:"無可用數據",credit_loading:"加載中",credit_not_enough_amount:"积分不足",credit_amount_not_enough:"积分不足",credit_payee_not_exist:"收款人不存在",credit_invalid_amount:"输入金额不合法",credit_can_not_transfer_to_yourself:"不能向自己转账",credit_latest:"最新日期",credit_error_network:"網絡出現異常,請稍後重試","payer credit amount is not enough":"积分不足","payee does not exist":"收款人不存在"},R={account_email_invalid_address:"無效的電子郵寄地址",account_email_invalid_domain:"無效的電子郵件域",account_email_unknown_status:"未知的郵件發送狀態",account_email_unavailable_address:"郵寄地址不可用",account_email_suppressed_address:"郵寄地址被禁用",account_loading:"加載中...",account_is_required:"不能為空",account_sign_in_your_account:"登錄賬戶",account_username:"用戶名",account_username_email_phone:"手機號碼或電子郵箱",account_password:"密碼",account_new_password:"新密碼",account_re_enter_password:"再次輸入密碼",account_password_not_equal:"輸入的兩個密碼不同。",account_new_password_same:"新密碼與原密碼相同",account_forgot_your_password:"忘記密碼了?",account_reset_password:"重置密碼",account_sign_in:"登錄",account_signed_in:"登錄成功",account_sign_up:"註冊",account_find_your_account:"找尋你的賬戶",account_enter_your_username:"輸入你的手機號碼或電子郵箱",account_search:"查找",account_email_sent_tip:"一封附帶驗證碼的電子郵件已發送到您的郵箱:",account_phone_sent_tip:"一封附帶驗證碼的短信已發送到您的手機:",account_email_phone_sent_tip:"附帶驗證碼的電子郵件和手機短信已分別發送到您的郵箱和手機:",account_software_token_tip:"您的賬戶已啟用安全令牌。要完成登錄,請打開或查看您的設備並輸入驗證碼",account_reset_your_password:"重置賬戶密碼",account_verification_code:"驗證碼",account_resend_code:"重發驗證碼",account_code_has_been_resent:"驗證碼已發送",account_password_has_been_reset:"密碼已重置",account_submit:"提交",account_sign_up_your_account:"註冊賬戶",account_fill_required_fields:"填寫下方的必填項。",account_fill_optional_fields:"填寫下方的選填項。",account_email:"郵箱",account_invitation:"邀請",account_invitation_code:"邀請碼",account_i_accept:"我接受",account_license_terms:"服務許可條款",account_next:"下一步",account_you_need_to_accept_license_terms:"請先勾選我接受服務許可條款",account_verify_fill_optional_fields:"驗證身份與可選項",account_nickname:"暱稱",account_gender:"性別",account_male:"男",account_female:"女",account_not_say:"不透露",account_birthday:"生日",account_phone_number:"手機號碼",account_locale:"地區",account_tip_verified:"驗證通過,正在登陸…",account_verified:"已驗證",account_unverified:"未驗證",account_signed_up:"註冊成功",account_verify_your_identity:"驗證您的身份",account_finish:"完成",account_signed_out:"註銷成功",account_change_password:"修改密碼",account_change_email:"修改電子郵箱",account_change_phone_number:"修改手機號碼",account_sign_out:"註銷",account_current_password:"當前密碼",account_re_enter_new_password:"再次輸入新密碼",account_personal_information:"個人資訊",account_edit:"編輯",account_reset:"重置",account_greeting:"你好,",account_cancel:"取消",account_change:"更改",account_not_set:"未設置",account_setting:"設置",account_copy_code:"複製程式碼",account_account_setting:"賬戶設置",account_task_page:"積分任務",account_setting_caption:"管理你的賬戶信息",account_security:"安全",account_want_to_join:"登錄更精彩",account_sign_in_now:"點擊登錄",account_changed:"已更改",account_clipboard_with_invitation_code:"已復制邀請碼",account_clipboard_with_code:"已復制程式碼",account_invitation_code_dialog_tip:"你將通過短信或電子郵件的方式發送邀請碼:",account_available:"可用",account_invited:"已邀請",account_used:"已使用",account_invitation_code_sent:"邀請碼已發送",account_invitation_channel_required:"至少需要填寫一項邀請途徑",account_no_verification_code:"無法收到驗證碼?",account_no_phone_number:"沒有手機號碼?",account_sign_up_by_email:"通過郵箱註冊",account_no_email:"沒有郵箱?",account_sign_up_by_phone_number:"通過手機註冊",account_no_totp:"沒有安全令牌?",account_tip_no_totp:"若沒有安全令牌请先設置安全令牌",account_setup_totp:"設置安全令牌",account_contact_information:"聯繫方式",account_delete_account:"删除帳戶",account_deleted:"已删除",account_can_not_mfa:"無法進行二級驗證?",account_set_mfa_type:"更改二級驗證",account_disable_mfa:"關閉二級驗證",account_disabled_mfa:"已關閉二級驗證",account_sms_mfa:"手機短信驗證",account_totp_mfa:"安全令牌驗證",account_totp:"安全令牌",account_not_recommend:"不推薦",account_oauth_sign_in_with:"通過 {provider} 登錄",account_sign_in_failed:"登錄失敗",account_tip_oath_sign_up:"当前{provider}账户所对应的邮箱:{email}尚未创建账户",account_tip_confirm_delete_account:"输入当前账户密码以确认要删除当前账户。(账户删除后将无法恢复)",account_tip_config_mfa:"您可以通過手機短信或安全令牌為賬戶設置二級驗證",account_error_can_not_enable_mfa:"您必須同時綁定郵箱和手機號碼,才可以啟用二級驗證",account_tip_can_not_enable_sms_mfa:"您必須同時綁定郵箱和手機號碼,才可以啟用短信驗證",account_tip_can_not_enable_totp_mfa:"您必須同時綁定郵箱和手機號碼,才可以啟用安全令牌",account_tip_setup_totp:"使用Authenticator等應用,掃描下方的二維碼或手動複製代碼來添加安全令牌",account_tip_verify_totp:"驗證您的安全令牌",account_link_your_social_account:"綁定您的社交賬號",account_unlink_your_social_account:"解除社交賬號綁定",account_tip_confirm_link:"確定將當前賬號與您的 {provider} 賬號進行綁定嗎?",account_tip_confirm_unlink:"確定解除您已綁定的 {provider} 賬號嗎?",account_tip_linking:"正在綁定...",account_tip_unlinking:"解除綁定中...",account_linked:"已綁定",account_unlinked:"已解除綁定",account_error_can_not_link_to_the_linked_account:"當前社交帳號已與其他賬號綁定",account_error_can_not_link_to_the_mismatched_email:"當前賬號與社交帳號郵箱地址不一致",account_error_can_not_link_before_email_verified:"未綁定郵箱的賬戶無法綁定社交帳戶",account_tip_confirm_verify_email_phone:"是否向當前賬戶的email和手機號碼發送驗證碼以驗證您的身份?",account_tip_confirm_verify_phone:"是否向當前手機號碼發送驗證碼以驗證您的身份?",account_error_1_message_60_seconds:"每60秒只能發送一條簡訊或郵件,需再等待 {delta} 秒",account_error_10_messages_per_day:"每部手機或電子郵件24小時內只能發送10條資訊",account_error_network:"網絡出現異常,請稍後重試","Network Error":"網絡出現異常,請稍後重試",account_error_user_not_exist:"用戶不存在",account_error_incorrect_username_or_password:"用戶名或密碼錯誤",account_error_incorrect_original_password:"原密碼錯誤",account_error_incorrect_password:"密碼錯誤",account_error_username_not_found:"找不到該用戶名的賬戶",account_error_can_not_reset_for_no_verified:"賬戶未進行郵箱驗證,無法重置密碼",account_error_invalid_verification_code:"驗證碼錯誤,請重試",account_error_expired_verification_code:"驗證碼過期,請重試",account_error_password_not_long_enough:"密碼長度不能小於8位",account_error_attempt_limit_exceeded:"嘗試次數過多,請稍後重試",account_error_password_attempts_exceeded:"超過密碼嘗試次數",account_error_invalid_phone_number_format:"手機號碼格式不正確",account_error_no_cell_phone_prefix:"請選擇手機號前綴",account_error_username_already_exists:"該用戶名已存在",account_error_you_need_to_accept_license_terms:"請勾選我接受服務許可條款",account_error_inactive_code:"該邀請碼已失效",account_error_non_existent_code:"該邀請碼不存在",account_error_unexpected:"未知錯誤",account_error_can_not_change_email_before_phone_bound:"綁定手機號碼前無法更改郵箱",account_error_can_not_change_email_before_unbound_social_account:"解除社交帳戶綁定前無法更改郵箱",account_error_can_not_change_phone_before_email_bound:"綁定郵箱前無法更改手機號碼",account_error_can_not_change_email_phone_with_mfa_enabled:"關閉二級驗證前無法更改郵箱或手機號碼",account_error_same_email:"新的郵箱不能與原郵箱相同",account_error_same_phone:"新手機號碼不能與原手機號碼相同",account_error_email_not_exists:"該郵箱不存在",account_error_email_already_exists:"該郵箱已有帳戶綁定",account_error_phone_already_exists:"該手機號碼已有帳戶綁定",account_error_mfa_token_mismatch:"安全令牌錯誤",account_error_recaptcha_not_loaded:"網絡出現異常,請重連網絡後重啓應用重試",account_error_recaptcha_validation_failed:"未通過ReCaptcha驗證,請重連網絡後重啓應用重試",account_error_sign_in_in_progress:"等待登錄嘗試已在進行中",account_field_range:"字符個數應在{0}-{1}的範圍中",account_field_only_alphanumeric:"僅支持字母和數字",account_field_only_alphanumeric_and_symbol:"僅支持字母數字和符號",account_field_only_chinese_alphanumeric_space_underline:"僅支持中英文數字空格下劃線",account_field_prefix_without_number_space:"首個字符不能為數字或空格",account_field_suffix_without_space:"不能以空格結尾",account_field_without_repeat_space:"不能連續使用多個空格",account_field_can_not_only_alphanumeric:"不可僅為字母或數字",account_field_must_have_number_characters:"必須包含數字",account_field_verification_code:"驗證碼必須是六位數數字",account_field_invitation_code:"邀請碼必須是字母和數字",account_field_phone_number:"手機號碼格式不正確",account_invalid_email_format:"郵箱格式不正確",account_sign_out_confirm:"是否確認註銷? 註銷後將停止所有任務.",account_sign_out_anyway:"仍要註銷",account_signing_out:"正在註銷...",account_request_save_settings:"設置未保存。在註銷前請先保存修改。",invalid_password_format:"密碼格式錯誤",invalid_password_format_same:"新密碼與原密碼相同",error_password:"密碼錯誤",keychain_setting:"密鑰管理",setting_description:"雲端儲存:將金鑰數據保存到雲端。\n修改密碼:修改媒體庫金鑰的密碼。\n助記詞:一種生成和恢復金鑰的替代方法。\n導入本地金鑰:將本地保存的金鑰導入媒體庫。\n匯出金鑰:將當前媒體庫數據保存到本地或雲端。\n備份金鑰到雲端:將當前媒體庫數據更新到雲端進行備份。",refresh_status:"更新狀態",confirm_import_key:"確認導入金鑰",confirm_update_cloud_key:"你在雲端已有金鑰,更新金鑰將覆蓋原有的金鑰,確認更新存儲在雲端的金鑰嗎",export_key_with_cloud:"輸入您所設定的獨立密碼匯出存儲在雲端的媒體庫金鑰,並通過解鎖密碼鎖定密鑰文件",store_cloud_key_prompt_password:"輸入獨立密碼以存儲媒體庫金鑰到雲端",update_cloud_key_prompt_password:"設定獨立密碼以加密媒體庫金鑰並更新到雲端",enable_cloud_storage_prompt_password:"為存儲在雲端的金鑰設置密碼,通過該密碼可以從雲上取回金鑰",input_unlock_password:"設定解鎖密碼",export_local_prompt_password:"請設定一個解鎖密碼,該密碼用於加密您的密鑰文件。我們不會保存此密碼,因此若您丟失該密碼,密鑰文件將無法解鎖。",require_unlock_password:"該密鑰文件已被鎖定,請輸入解鎖密碼",require_independent_password:"輸入獨立密碼以獲取存儲在雲端的金鑰",import_local_prompt_password:"該密鑰文件已被鎖定,請輸入解鎖密碼",select_encrypt_mode:"選擇加密模式",input_independent_password:"輸入獨立秘碼",update_cloud_key:"更新存儲在雲端的金鑰",backup_to_cloud:"將媒體庫金鑰備份到雲端",save_local:"將媒體庫金鑰保存為本地加密檔",create_new_key:"創建新的媒體庫金鑰",creating_lib_key:"正在創建媒體庫金鑰...",loading_lib_key:"正在載入媒體庫金鑰...",failed_to_create_lib_key:"創建媒體庫金鑰失敗",failed_to_load_lib_key:"載入媒體庫金鑰失敗",import_local_key:"導入本地金鑰",import_lib_key_from_local:"從本地導入媒體庫金鑰",import_from_cloud:"從雲端導入媒體庫金鑰",create_or_import_key:"創建或導入媒體庫金鑰",create_or_import_key_desc:"媒體庫金鑰用於与去中心化數據庫同步內容。",store_your_lib_key:"存儲你的媒體庫金鑰",export_cloud_key:"導出雲端密鑰",export_current_key:"導出當前密鑰",change_password:"修改密碼",enable_cloud_storage:"啟用雲端存儲",disable_cloud_storage:"關閉雲端存儲",disable_cloud_storage_desc:"關閉雲端存儲將移除保存在雲端的密鑰,請確保已將密鑰保存在本地",sync_at:"同步於:{time}",keychain_sync_status:"密鑰同步狀態",cloud_storage_enabled:"使用 {storage} 同步密鑰",cloud_storage_disabled:"未啟用雲端存儲",saved_locally:"已保存於本地",export_key:"導出密鑰文件",cloud_independent_password:"雲端獨立密碼",key_file_unlock_password:"密鑰文件解鎖密碼",re_enter_unlock_password:"再次輸入解鎖密碼",independent_password_not_enabled:"當前密碼為 Alphabiz 帳戶密碼(未設定獨立密碼)",use_cognito_hash:"使用 Alphabiz 賬戶密碼",use_independent_password:"使用獨立密碼",keychain_lib:"媒體庫金鑰",loading_keychain_state:"加載密鑰中...",backing_up:"備份中...",backup_current_key:"備份當前金鑰到雲端",cloud_lib_key_not_existed:"雲端媒體庫金鑰不存在",open_keychain_file:"打開金鑰檔案",confirm_open_abk:"是否打開ABK檔案",use_the_key:"使用該金鑰",backup_the_key:"備份該金鑰到雲端",keychain_data_does_not_exist:"金鑰數據不存在","timeout of 0ms exceeded":"網絡出現異常,請稍後重試",XhrError:"網絡出現異常,請稍後重試"},U={add_subtitles:"添加字幕",open_file:"打開文件...",advanced_options:"高級選項",title:"標題",location:"位置",subtitle_file:"字幕文件",unsupported_subtitle_type:"The file type of {0} is not a supported subtitle type",not_default_player:"默認視頻播放器未設置",this_is_an_audio_file:"這是一個音頻文件",the_added_subtitle_already_exists:"添加的字幕已存在",stop_stream_player:"因任務被暫停或刪除,流媒體播放被終止",stop_player:"因文件被删除,播放被终止",playing_timeout_hint:"等待超時,請檢查任務",autoplay_hint:"自動播放功能可能受瀏覽器限制,若未開始播放,請手動點擊播放器以播放",remove_playing_confirm:"{0} 正在播放中,刪除任務將停止播放。是否仍要刪除?",subtitle:"字幕",setting:"設定",loading:"加載中",unknown_media:"未知媒體",settings_button_visible:"按鈕顯示",settings_setting:"設定",settings_playback_rate:"倍速",settings_subtitle:"字幕",settings_pip:"畫中畫",settings_fullscreen:"全屏",settings_subtitle_options:"字幕选项",settings_normal:"常規",settings_italic:"斜體",settings_lighter:"纖細",settings_bolder:"粗體",settings_small:"較小",settings_large:"較大"};const F=i.a.displayName;var M={lib_index:"主頁",lib_edit:"編輯",lib_publish:"發佈",lib_explore:"探索",lib_following:"關注",lib_favorite:"本地收藏",lib_local_favorites:"本地收藏",lib_channel:"頻道",lib_submit:"提交",lib_from_network:"使用去中心化資料庫,所有數據來源於網路",welcome_to_lib:`歡迎使用 ${F} 媒體庫`,register_or_login:"註冊/登陸",lib_recommend:"推薦",lib_recommend_desc:`歡迎使用 ${F} 媒體庫! 本媒體庫使用去中心化的資料庫,所有數據來源於網路。 在開始前,請先關注一些推薦頻道。`,follow_any_channel_to_continue:"關注任意頻道以繼續",follow_channels_and_continue:"關注 {0} 個頻道並繼續",show_more_for_me:"為我展示更多",no_more_recommend:"沒有更多推薦",key:"金鑰",create_key:"生成金鑰",save_key:"保存金鑰",save_key_file:"是否將金鑰保存為檔案?",import_key:"匯入金鑰",import:"導入",invalid_key:"金鑰格式錯誤",back_to_top:"回到頂部",search_for_channel:"搜索頻道 ID",search_channel_no_result:"找不到 ID 為 {0} 的頻道",please_input_channel_id:"請輸入頻道 ID",welcome_help_text:"\n 這是一個去中心化的媒體庫,您需要為此創建一個專用帳戶,\n 我們將自動為您生成一套金鑰。 如果您已經擁有金鑰了,\n也可以在此導入金鑰".replace(/\s/g,""),welcome_key_text:"\n 當您成功創建帳號后,請點擊右下角的【保存金鑰】按鈕匯出\n您的金鑰。 一旦您丟失金鑰,對應的帳號將無法找回。 ".replace(/\s/g,""),redirect_to_recommend:"您似乎沒有關注任何頻道,即將前往探索頁。 ",channel:"頻道",follow:"關注",unfollow:"取消關注",following:"關注中",share:"分享",block:"遮罩",unblock:"取消遮罩",blocked:"已遮罩",block_channel:"遮罩此頻道",block_channel_confirm:"遮罩頻道後,頻道的所有內容將從時間線上移除。 您可以在帳戶設定中管理遮罩清單。 ",block_creator:"遮罩此頻道的創作者",unblock_creator:"取消遮罩此頻道的創作者",block_creator_confirm:"遮罩創作者後,該創作者的所有頻道將從時間線上移除。 您可以在賬戶設置中管理遮罩清單",share_url_copied:"分享鏈接已複製至剪貼板",unfollow_confirm:"是否取消關注? 此頻道的所有推文將從你的時間線上移除。 ",follow_failed_hint:"操作仍在後台進行中,請耐心等待。如長時間未完成修改請嘗試重啟應用。 ",follow_time:"關注時間",update_time:"更新時間",search:"搜索",type:"類型",added:"已添加",click_to_task:"點擊前往對應任務",lib_already_added:"您已添加此視頻",description:"描述",poster:"海報",channel_poster:"頻道海報",preview:"預覽",creator:"創作者",creator_detail:"創作者詳情",loading_creator:"正在載入創作者資訊",wait_for_creator_loaded:"請等待創作者資訊載入完成。 ",follower:"關注者",followers:"關注者",follower_list:"關注者清單",user:"使用者",channel_title:"頻道標題",channel_id:"頻道 ID",post_title:"推文標題",post_id:"推文 ID",import_data_from_excel:"從 Excel 導入資料",set_excel_keys:"設置excel鍵",excel_import_succeded:"Excel 導入成功",excel_import_success_msg:"可添加 {0} 條新專案, {1} 條資訊不完整及 {2} 條重複項已忽略",cannot_find_channel:"找不到指定頻道",cannot_find_posts:"找不到指定視頻",add_channel:"添加頻道",add_post:"添加推文",edit_channel:"編輯頻道",channel_setting:"頻道設置",edit_post:"編輯推文",edit_posts:"編輯推文",channel_detail:"頻道詳情",remove:"移除",remove_channel:"移除頻道",remove_channel_confirm:"是否確認移除頻道? 此操作不可恢復。 ",remove_post:"移除推文",remove_post_confirm:"是否確認移除推文? 此操作不可恢復",preview_mode:"預覽模式",preview_mode_desc:"這是頻道的預覽模式,所有分級的影片均為可見狀態。 ",edit_user_profile:"編輯使用者資料",name:"昵稱",avatar:"頭像",no_following:"沒有已關注的頻道。 點擊前往",no_recommend:"沒有可推薦的頻道。 點擊前往",first_recomment_msg:"如果您是初次使用,載入時間可能較長",invalid_image:"圖片異常",image_not_reachable:"此圖片URL不可用",channel_not_found:"找不到頻道",cannot_get_channel_info:"無法獲取指定的頻道資訊。 該頻道可能已被創作者刪除而不再可見。 ",validate_error:"驗證錯誤",validate_user_name_no_space:"使用者名不可包含空格",validate_url_no_space:"URL 不可包含空格",validate_user_name_length:"使用者名應為 {0}-{1} 字元",validate_user_desc_length:"使用者描述不可多於 {0} 字元",validate_user_avatar_url:"使用者頭像應為連結且不多於2048字元",validate_channel_title_length:"頻道標題應為1-100字元",validate_channel_desc_length:"頻道描述應為10-300字元",validate_channel_image_url:"頻道預覽圖應為連結且不多於2048字元",validate_post_title_length:"推文標題應為1-100字元",validate_post_desc_length:"推文描述應為10-300字元",validate_post_image_url:"海報應為連結且不多於2048字元",validate_post_url:`${F} 連結格式錯誤`,validate_post_url_length:`${F} 連結不可多於2048字元`,film_rate:"影片分級",set_film_rate:"設置影片分級",select_a_rate_before_enter:"您需要設置一個影片分級才可進入媒體庫。 ",library_available_rate:"媒體庫可用影片分級",rate_g:"G(大眾級)",rate_g_desc:"所有年齡皆可觀賞\n此類影片不含或僅含少量會讓家長在讓兒童觀賞時感到被冒犯的內容,無需家長陪同。 ",rate_pg:"PG(建議家長指導)",rate_pg_desc:"一些內容可能不適合兒童觀看\n此類影片包含部分家長可能認為不適合兒童的內容,因此建議家長可同時進行指導。 ",rate_pg_13:"PG-13(家長特別留意)",rate_pg_13_desc:"一些內容可能不適合13歲以下兒童觀看\n此類影片有部分內容對 13歲以下兒童不適宜,需要有父母陪同觀看。 此類影片動作暴力適當,含有少量血腥場面及不雅用語,但也包含可能令人情緒不安的情節。 ",rate_r:"R(限制級)",rate_r_desc:"未滿十七歲人士必須由家長或成年監護人陪同\n此類影片中常有大量血腥暴力、驚悚恐怖、裸露性愛或吸毒場景, 且有大量性暗示及不雅用語/ 冒犯性言論等,17歲以下人士必須由父母或者監護陪伴才能觀看。 ",rate_nc_17:"NC-17(只准成人觀看)",rate_nc_17_desc:"17歲或以下人士不得觀賞\n此類影片其中常有清楚的性愛場面,大量的吸毒或暴力鏡頭以及髒話等,因此僅適合成人觀賞。 ",set_as_private:"設為私有",hide_in_explore:"在瀏覽頁隱藏此頻道",hidden:"已隱藏",select_a_rate:"請選擇一個影片分級",select_from_tasks:"從上傳任務中選擇",import_from_magnet:`從${Object(m["a"])()?"連結":"磁力連結(magnet:?...)"}導入`,input_magnet_url:"輸入連結",task_title:"任務標題",set_title:"設為標題",add_to_local_favorites:"添加到本地收藏",remove_from_local_favorites:"從本地收藏中移除",removed_favorite:"已移除收藏",import_or_export_favorites:"導入/匯出收藏",export_local_favorites:"匯出收藏文件作為備份",import_favorites_file:"導入備份的收藏",not_a_favorite_file:"此文件並非收藏備份",connection_status:"連接狀態",gun_server_list:"緩存節點",custom_nodes:"客製化緩存節點",custom_nodes_hint:"緩存節點將在重啟軟體後應用",wait_for_reboot:"即將重啟軟體...({seconds}s)",reboot_now:"立即重啟",reboot_later:"稍後重啟",peer_list:"節點清單",server:"節點 URL",peer:"節點",peer_id:"節點 ID",connection:"連接",data_source:"數據源",sync:"同步",syncing:"同步中",sync_completed:"同步完成",got_all_post:"已獲取全部推文",placeholder_channel_title:"頻道名稱",placeholder_channel_desc:"關於此頻道的描述",placeholder_post_title:"電影名稱 (年份)",placeholder_post_desc:"關於此電影的描述",private_channel:"私有頻道",creator_blocked:"已遮罩創作者",go_to_library:"前往媒體庫?",go_to_library_channel_msg:"是否前往媒體庫頻道 {0}?",magnet_does_not_have_name:"此連結不包含任務名,請輸入推文標題后重試。 ",no_available_post:"無可見推文",following_channel_no_post:"已關注的頻道中不含可見的推文。 此問題可能由網路錯誤引起。 如果您已關注帶有推文的頻道,這些推文將在稍後載入完成。 ",share_to_library:"分享到媒體庫",quick_start:"快速開始",quick_start_desc:"選擇一個任務或檔快速創建推文",select_file:"選擇檔...",select_folder:"選擇資料夾...",post_options:"推文選項",channel_options:"頻道選項",create_new_channel:"創建新頻道",use_existed_channel:"使用已存在的頻道",select_existed_channel:"選擇一個頻道",uploaded_by:"{title} (由 {name} 上傳)",created_by:"{title} (由 {name} 创建)",creating_new_channel:"正在創建新頻道...",created_new_channel:"新頻道已創建",creating_new_post:"正在創建新推文...",created_new_post:"新推文已創建",create_new_post:"創建推文",quick_start_timeout:"{0}超時。此問題可能由網路異常引起。請稍後再試。",file_too_large:"文件過大",file_too_large_msg:"此檔的大小超過了 4GB ({size}),上傳此檔可能需要較長的準備時間,是否仍要上傳? ",resolving_folder_files:"正在解析文件夾內容...",folder_too_large:"資料夾過大",folder_too_large_msg:"資料夾中的檔大小超過 4GB ({size} 總大小),上傳此資料夾可能需要較長的準備時間,是否仍要上傳? ",creating_new_task:"正在創建新任務...",cannot_create_task:"創建任務異常",cannot_create_task_msg:"創建任務時產生了未知錯誤。 任務可能已被創建,請查看上傳清單以確定上傳狀態。 ",cannot_get_task_name:"無法獲取任務名,請輸入推文標題后重試",remove_old_task:"刪除舊任務",remove_old_task_desc:"Web 模式僅允許創建一個任務,是否刪除舊任務? ",subtitle_list:"字幕清單",optional:"可選",with_subtitle:"含有{language}字幕",add_subtitle_url:"添加字幕下載連結",maximumSubtitleNum_limit:"字幕數量已達到最大",cannot_add_subtitle:"添加字幕失敗",cannot_add_subtitle_msg:"沒有選擇字幕語言或下載鏈接無效。",support_subtitle_type:"僅支援srt,vtt格式的字幕。",recommend_opensubtitles:"建議使用www.opensubtitles.org的字幕下載鏈接或id。",take_down:"下架",serious_violation:"嚴重違規",copyright_disputes:"版權爭議",adults_only:"成人內容",takedown_reason:"下架原因",takedown_mode:"下架模式",admins:"管理員",takedown_user:"下架此創作者",takedown_channel:"下架此頻道",takedown_post:"下架此推文",select_takedown_reason:"選擇下架原因",takedown_invalid_reason:"下架原因錯誤",takedown_invalid_user_id:"用戶ID錯誤。ID應為87位字符",takedown_invalid_channel_id:"頻道ID錯誤。ID應為20位字符",takedown_invalid_post_id:"推文ID錯誤。ID應為20位字符",takedown_management:"下架管理",users:"用戶",channels:"頻道",posts:"推文",you:"你",preset:"預設",admin:"管理員",committee:"委員會",about_takedown_mode:"模式說明:\n預設:在github添加,所有內容都會從媒體庫移除。\n管理員:任一管理員投票後即會移除。\n委員會:超過半數管理員投票後才會移除。",cannot_edit_preset:"無法編輯此行,因為它是預設內容",cannot_edit_not_vote:"無法編輯此行,因為你未為其投票",remove_vote:"移除你的下架投票",post_preload_failed:"無法預載此推文。下載連結可能已過期,因此無法立即播放。",about_cache_node:"關於緩存節點",edit_cache_node:"編輯緩存節點",create_cache_node:"創建緩存節點",about_cache_node_desc:`${F} 使用 gun 伺服器作為緩存節點,您可以在進階設置中編輯自定義節點。`,learn_how_to_deploy_gun:"查看如何建立自定義節點",library_setting:"媒體庫設置",block_list_manage:"屏蔽列表管理",blocked_users:"已屏蔽的用戶",blocked_channels:"已屏蔽的頻道",unblock_user:"解除用戶屏蔽",unblock_channel:"解除頻道屏蔽",no_blocked_user:"沒有已屏蔽的用戶",no_blocked_channel:"沒有已屏蔽的頻道",field_required:"{0} 不能為空"};const B=i.a.displayName,Q={unsupported_in_browser:"此功能暫不支援瀏覽器模式",client:"客戶端",warning:"警告",enable:"啟用",disable:"禁用",auto:"自動",encrypt_connection:"加密傳輸",encrypted_connection:"已加密的連結",non_encrypted_connection:"未加密的連結",connected_wires_not_disconnect:"已存在的連結不會被斷開",audio:"音頻",video:"視頻",image:"圖片",subtitle:"字幕",zip:"壓縮文件",text:"文本",unknown:"未知",add:"添加",undo:"撤銷",backup:"備份",not_default_app:`${B}不是你的默認應用, 是否設置默認應用?`,dont_show_again:"不再提示",go_to_settings:"前往設置",about_alphabiz:`關於 ${B}`,update_channel:"更新通道",last_check_at:"上次檢查更新時間",check_for_update:"檢查更新",checking_for_update:"檢查更新中...",no_update_available:"沒有可用更新",update_available:"更新可用",update_now:"現在更新",update_later:"以後更新",click_to_update:"點擊[現在更新]按鈕以開始下載更新",update_failed:"更新失敗",update_failed_message:"在更新時遇到了一個錯誤: ",check_shasum_failed:"安裝包完整性檢查失敗",downloading_update:"更新下載中...",ready_to_update:"準備更新",restart_to_update:`更新下載已完成. ${B} 將在數秒後退出以應用更新`,already_latest:"當前版本({0})已是最新",update_timeout:"更新超時",no_available_release:"沒有可能的版本",no_available_installer:"沒有可用的安裝包",feedback:"反饋",select_a_type:"選擇一個類型",category:"分類",select_a_category:"選擇一個分類",title:"標題",require_title:"請提供標題",describe_your_problem:"描述您遇到的問題",report_a_bug:"報告一個錯誤(bug)",request_a_new_feature:"請求一個新功能",download_or_upload:"下載/上傳",others:"其他",submit_with_system_info:"提交時附加系統信息",submit_feedback:"提交反饋",tweet_us:"發送Twitter",tweet_too_long:"Tweet過長",delete_characters:"請刪除{0}個字符",rest_characters:"還能輸入{0}個字符",update_alphabiz:`更新 ${B}`,current_version:"當前版本",cancel_update:"取消更新",slow_download_speed:"下載過於緩慢",slow_download_speed_caption:"當前更新包下載過於緩慢,請檢查網絡狀態",update_canceled:"更新已取消",current_version_release_time:"當前版本發佈時間",expired_app:`${B} 過期`,version_out_of_date:"版本過舊",have_to_update:`${B} 版本過舊,部分接口或協議已失效。您需要升級 ${B} 才可繼續使用。`,exit_alphabiz:`退出 ${B}`,exit_and_update:"退出並應用更新",new_version_hint:"新版本可用",no_new_version:"沒有可用的新版本",current_is_latest:"當前版本已是最新版",click_to_check_update:"點擊 [檢查更新] 按鈕以檢查更新",download_latest_version_from_website:"請前往官網下載最新版本",to_the_website:"前往官網",network_diagnotic:"網路診斷",diagnotic:"診斷",click_to_check:"點擊以開始檢查",click_to_check_again:"點擊以再次檢查",checking:"檢查中",online:"在線",offline:"離線",dns_look_up:"域名解析",error:"錯誤",aws_service:"AWS 服務",network_pings:"網路 Ping",not_found:"未找到",packet_loss:"丟包率",official_site:"官方網站",download_test:"下載測試",connected:"已連結",test_task:"測試任務 ({0})",download_failed:"下載失敗",second_spend:"用時 {0} 秒",open_default_player_failed:"打開默認播放器失敗",copied_to_clipboard:"已複製到剪貼板",go_to:"前往",region_not_available:"地區不可用",region_not_available_message:"抱歉,此應用在您的地區不可用。本應用將在{0}秒後退出。",confirm:"確認",no_available_result:"無可用結果"};var W={...M,...D,...N,...L,...R,...j,...U,...Q};const z={"zh-CN":y,"en-US":E,"zh-TW":W},H={"en-US":{M:{month:"short"},YM:{year:"numeric",month:"short"},YMD:{year:"numeric",month:"short",day:"numeric"},Hms:{hour:"numeric",minute:"numeric",second:"numeric"},MDHms:{month:"short",day:"numeric",hour:"numeric",minute:"numeric"},YMDHms:{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"}},"zh-CN":{M:{month:"short"},YM:{year:"numeric",month:"short"},YMD:{year:"numeric",month:"short",day:"numeric"},Hms:{hour:"numeric",minute:"numeric",second:"numeric"},MDHms:{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0},YMDHms:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}},"zh-TW":{M:{month:"short"},YM:{year:"numeric",month:"short"},YMD:{year:"numeric",month:"short",day:"numeric"},Hms:{hour:"numeric",minute:"numeric",second:"numeric"},MDHms:{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0},YMDHms:{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}}};var V=n("fe2c"),G=n("d884"),K=n("9ad5"),Y=n.n(K),J=n("5584");const X=G["a"].map((({value:e})=>e));V["b"].registerHooks(["beforeRouteLeave","beforeRouteEnter"]),o["a"].use(a["a"]);const Z="undefined"===typeof navigator?"en-US":G["a"].find((({value:e})=>e===navigator.language))?navigator.language:"en-US";console.log(`[i18n] Default locale: ${Z}`);const ee=new a["a"]({locale:Z,fallbackLocale:"en-US",dateTimeFormats:H,messages:z,silentTranslationWarn:!0}),te={externals:"_i18n_externals_",locale:"_i18n_locale_",trans:"_i18n_translations_",dtf:"_i18n_datetime_"},ne=(e,t,n)=>{if(!e||!e.value)return console.warn(`Failed to add locale ${e}: 'value' is required but not found.`);if("object"!==typeof t||null===t)return console.warn(`Cannot add locale ${e.value}: 'translations' must be object.`);const a=G["a"].findIndex((t=>t.value===e.value));-1!==a?(console.warn(`Add duplicate language ${e.value} will replace it with new configs`),o["a"].set(G["a"],a,e)):o["a"].set(G["a"],G["a"].length,e);const s=e.value;for(const o in t)t[o].match(/\${(.+?)}/)&&(t[o]=t[o].replace(/\${(.+?)}/g,((e,t)=>t in i.a&&"string"===typeof i.a[t]?i.a[t]:e)));o["a"].set(z,s,t),"object"===typeof n&&o["a"].set(H,s,n),console.log("Successfully add new locale",e);const r=[...new Set(JSON.parse(localStorage.getItem(te.externals)||"[]"))];if(r.some((e=>e===s))||r.push(s),localStorage.setItem(te.externals,JSON.stringify(r)),localStorage.setItem(te.locale+s,JSON.stringify(e)),localStorage.setItem(te.trans+s,JSON.stringify(t)),n?localStorage.setItem(te.dtf+s,JSON.stringify(n)):localStorage.removeItem(te.dtf+s),ee&&"en-US"===ee.locale){const e=navigator.languages.map((e=>{const t=e.split("-");if(t.length<=2)return e;const n=t[0],o=t.pop();return[n,o].join("-")}));if(!e.includes(s))return console.log(`User prefer languages ${e.join(",")} does not includes ${s}`);console.log(`Automatically set locale to ${s}`),ee.locale=s,J["a"].dispatch("set",{language:s})}},oe=e=>{const t=G["a"].find((t=>t.value===e));if(-1===t)return console.warn(`Failed to remove locale ${e}: not found`);ee&&ee.locale===e&&(ee.locale="en-US"),G["a"].splice(t,1),o["a"].delete(z,e),o["a"].delete(H,e),console.log("Successfully remove locale",e);const n=JSON.parse(localStorage.getItem(te.externals)||"[]");n.includes(e)&&(n.splice(n.indexOf(e),1),localStorage.setItem(te.externals,JSON.stringify(n))),localStorage.removeItem(te.locale+e),localStorage.removeItem(te.trans+e),localStorage.removeItem(te.dtf+e)},ae=async()=>{const e=console.log.bind(console,"[Remote External I18n]");if(!i.a.externalI18n)return e("No external i18n url availabel");try{const t=e=>{let t=i.a.externalI18n;return t.endsWith("/")||(t+="/"),new URL(e,t).href};e(t("locales"));const{data:n}=await Y.a.get(t("locales"));if("string"!==typeof n)throw new Error(`Locale ${n} is not string`);e(`Fetch locales: ${n}`);const o=n.split("\n").map((t=>{const[n,...o]=t.replace(/#.*$/,"").split(" ");let a=o&&o.join(" ");return a||(a=n),n?{value:n,label:a}:(e(`No available locale in ${t}`),null)})).filter((e=>e));if(!o.length)return e(`No available external i18n from ${i.a.externalI18n}`);const a=o.map((async n=>{try{const{data:e}=await Y.a.get(t(`${n.value}/translations.json`)),{data:o}=await Y.a.get(t(`${n.value}/dateTimeFormat.json`)).catch((()=>({})));ne(n,e,o)}catch(o){e(`Failed to get ${n.label} ${n.value} from ${i.a.externalI18n}`)}}));if(await Promise.all(a),!ee)return;for(const s in ee.messages)X.includes(s)||o.find((e=>e.value===s))||(e("Remove locale since external locales file deleted it",s),oe(s))}catch(t){e(`Failed to get locales from ${i.a.externalI18n} since ${t.message||t}`)}},se=()=>{const e=localStorage.getItem(te.externals);if(!e)return console.log("No external i18n available");const t=JSON.parse(e);for(const o of t){const e=localStorage.getItem(te.locale+o),t=localStorage.getItem(te.trans+o),a=localStorage.getItem(te.dtf+o);if(e&&t)try{ne(JSON.parse(e),JSON.parse(t),a?JSON.parse(a):null)}catch(n){console.warn(`Failed to add locale ${o}:`,n.message)}else console.warn(`Failed to get local files for ${o}`,e,t)}};t["a"]=e=>{const{app:t}=e;t.i18n=ee,new(o["a"].extend({i18n:ee}))({beforeCreate(){const e=this.$q.notify;this.$q.notify=t=>{const n=e=>{try{const t=ee.messages[ee.locale];return Object.keys(t).includes(e)}catch(t){return console.log("Faild @ boot -> i18n",e,ee.locale,t),!1}};let o;return"string"===typeof t?o=e(n(t)?this.$t(t):t):(n(t.message)&&(t.message=this.$t(t.message,t.i18nData),delete t.i18nData),o=e(t)),o}},created(){se(),ae(),this.$watch((()=>ee.locale),(()=>{if(!ee.messages[ee.locale]){if(ee.locale===ee.fallbackLocale)return console.warn(`Failed to set locale to default[${ee.fallbackLocale}]`);ee.locale=ee.fallbackLocale}}))}})}},"19f3":function(e,t,n){},"1af1":function(e,t){const n={};e.exports=n},"1b99":function(e,t,n){"use strict";n("244a")},"1cda":function(e,t,n){"use strict";n("058f")},"1da1":function(e,t,n){},"1ef4":function(e,t,n){"use strict";(function(e){n("de6c"),n("a1c1");var o=n("fb31"),a=n.n(o);function s(t){return e.from(t,"utf-8").toString("hex")}function i(t){return e.from(t,"hex").toString("utf-8")}t["a"]={fromObject(e){const{protocolType:t,name:n,hash:o,data:s}=e,r=s.type||"channel";if("02"!==t)return null;const l=a.a.shortProtocol;return`${l}-library://${r}/${decodeURIComponent(n)}/${i(o)}`},toObject(e){if(console.log("lib toObj",e),!e.startsWith(a.a.shortProtocol+"-library://"))return null;const[t,n,o]=e.replace(a.a.shortProtocol+"-library://","").split("/"),i={};return"channel"!==t&&(i.type=t),{protocolType:"02",name:encodeURIComponent(n),hash:s(o),data:i}}}}).call(this,n("eb72").Buffer)},2:function(e,t){},20:function(e,t){},21:function(e,t){},"212e":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("de6c");var o=n("229c");function a(e){const t={};return n(),a((()=>{s({handleBatchItem(e){console.log("Analytics.send.batchItem:",e)},handleEndpoint:(e,t)=>{console.log(`Analytics.send: Endpoint(${e})`,t)},handleEvent:(t,n)=>{console.log(`Analytics.send: Event<${n.EventType}>(${t})`,n);const o=e.eventHandlers[n.EventType];o&&o(n,t)}})})),o["a"].$debug=function(){console.log("Analytics$debug:",{_config:o["a"]._config,pinpoint:t.pinpoint,pinpointClient:t.pinpointClient})},o["a"].$context=t,window.Analytics=o["a"],t;function n(){const e=o["a"]._pluggables.find((e=>"AWSPinpoint"===e.getProviderName()));Object.assign(t,{pinpoint:e})}function a(e){Object.defineProperty(t.pinpoint,"pinpointClient",{get(){return t.pinpointClient},set(n){t.pinpointClient=n,e(n)}})}function s({handleEndpoint:e,handleEvent:n,handleBatchItem:o}){const a=t.pinpointClient.send;t.pinpointClient.send=async function(){var s;const i=arguments[0].input;i.EndpointId&&e(i.EndpointId,i.EndpointRequest);const r=await t.pinpoint._config.endpointId,l=null===(s=i.EventsRequest)||void 0===s?void 0:s.BatchItem;if(l&&o(l),l&&l[r]){const{Endpoint:e,Events:t}=l[r];Object.entries(t).forEach((([e,t])=>{n(e,t)}))}return await a.apply(this,arguments)}}}},2163:function(e,t,n){"use strict";n("e836")},22:function(e,t){},2214:function(e,t,n){"use strict";n("0d10")},23:function(e,t){},2377:function(e,t,n){"use strict";n("d7f6")},24:function(e,t){},"244a":function(e,t,n){},25:function(e,t){},"25b9":function(e,t,n){},26:function(e,t){},27:function(e,t){},28:function(e,t){},"28c4":function(e,t,n){"use strict";n("df2b")},29:function(e,t){},"2b49":function(e,t,n){"use strict";var o=n("e74d");const a=()=>"electron"===o["a"]._config.oauth.app_env?"_blank":"_self";var s=e=>{const t=window.open(e,a());return t?Promise.resolve(t):Promise.reject()},i=e=>{let t="",n=e;const o="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(;n>0;--n)t+=o[Math.round(Math.random()*(o.length-1))];return t},r=(n("a1c1"),n("98fd")),l=n.n(r),c=n("b858"),d=n.n(c),u=e=>l()(e).toString(d.a).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");t["a"]={urlOpener:s,generateState:i,generateChallenge:u}},"2cab":function(e,t,n){"use strict";n("4d62")},"2cfd":function(e,t,n){},"2d55":function(e,t,n){},"2e22":function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return f}));n("de6c"),n("f18a");var o=n("5584"),a=n("d310"),s=(n("c49d"),n("36a1")),i=n("1926");const r=e=>new Promise((t=>{const n=setInterval((()=>{const o=e();void 0!==o&&(clearInterval(n),t(o))}),1e3)})),l={data(){return{previewImage:null}},computed:{showPreview:{set(e){this.previewImage=e||null},get(){return!!this.previewImage}}}},c={methods:{async initFilmRate(){const e=e=>{const t=new Date(e);if(!t||!t.valueOf())return;const n=Date.now();return t.setFullYear(t.getFullYear()+7),t.valueOf(){const e={type:"radio",model:"G"};e.items=[{label:i["b"].t("rate_g"),value:"G",tooltip:i["b"].t("rate_g_desc")},{label:i["b"].t("rate_pg"),value:"PG",tooltip:i["b"].t("rate_pg_desc")},{label:i["b"].t("rate_pg_13"),value:"PG-13",tooltip:i["b"].t("rate_pg_13_desc")},{label:i["b"].t("rate_r"),value:"R",tooltip:i["b"].t("rate_r_desc")},{label:i["b"].t("rate_nc_17"),value:"NC-17",tooltip:i["b"].t("rate_nc_17_desc")}];const t=this.$alphabiz.dialog({title:i["b"].t("set_film_rate"),message:i["b"].t("select_a_rate_before_enter"),options:e,ok:i["b"].t("ok")}),n=await t.promise("ok");if(n)return n.option},s=e=>{if(o["a"].dispatch("updateSettings",{libraryRate:e}),Object(a["isElectron"])()){const{ipcRenderer:t}=n("b052");t.send("set_settings",{libraryRate:e})}localStorage.setItem("set-film-rate",e)};if(localStorage.getItem("set-film-rate"))return;const l=await r((()=>{if(o["a"].getters.accountUserInfo&&o["a"].getters.accountUserInfo.sub)return o["a"].getters.accountUserInfo.birthday||null}));let c=e(l);c||(c=await t()),s(c)}},async activated(){await this.initFilmRate()}},d=(...e)=>console.tag.blue("Channel",...e),u=(...e)=>console.tag.blue("Post",...e),h={data(){return{loader$loadedChannels:{}}},created(){this.$watch("followingChannels",(e=>{let t=!1;Object.keys(this.loader$loadedChannels).forEach((n=>{e.some((e=>e.id===n))||(delete this.loader$loadedChannels[n],t=!0)})),t&&(this.loader$loadedChannels=Object.assign({},this.loader$loadedChannels))}),{immediate:!0,deep:!0})},computed:{loader$toLoadChannels(){const e=this.followingChannels;return console.log(e),e.filter((e=>!(!e.title||!e.id)&&!this.loader$loadedChannels[e.id])).reduce(((e,t)=>(e[t.id]=t,e)),{})}},methods:{async loader$enableChannelsLoader({onLoaded:e},t){const n=async({onChannelLoaded:e,onChannelUpdated:t})=>{const n=Object.values(this.loader$toLoadChannels);await Promise.all(n.map((async n=>{await new Promise((e=>setTimeout(e,Math.round(2e3*Math.random()))));const o=await s["a"].getChannelPostIds(n.id,!0);if(!this.loaderEnabled)return;const a=this.loader$loadedChannels[n.id];a?a.ids=o:this.loader$loadedChannels[n.id]={channel:n,ids:o},this.loader$loadedChannels=Object.assign({},this.loader$loadedChannels),await(a?t:e)(n.id)})))},o=()=>({toLoadCount:Object.keys(this.loader$toLoadChannels).length,loadedCount:Object.keys(this.loader$loadedChannels).length}),a=e=>new Promise((t=>setTimeout(t,e)));let i=!0;while(this.loaderEnabled){const s=o();if(!s.toLoadCount){if(i){e(!0),i=!1;continue}await a(t);continue}if(await n({onChannelLoaded:async e=>{if(!this.loaderEnabled)return;const{loadedCount:t,toLoadCount:n}=o(),a=`${t}/${t+n}`;d("onLoaded",a).log(e)},onChannelUpdated:async e=>{this.loaderEnabled&&d("onUpdated").log(e)}}),!this.loaderEnabled)break;const r=o();r.toLoadCount||(e(i),i=!1,await a(t))}}}},p={data(){return{loader$loadedPosts:{}}},computed:{loader$toLoadPosts(){return Object.values(this.loader$loadedChannels).map((({channel:e,ids:t})=>t.map((t=>({id:t,channelId:e.id}))))).flat(1).reduce(((e,t)=>(this.loader$loadedPosts[t.id]||(e[t.id]=t),e)),{})},loader$toLoadPostIdListSorted(){const e=(e,t)=>e&&t?e.localeCompare(t):0;return Object.values(this.loader$loadedChannels).map((({ids:e})=>e.filter((e=>!this.loader$loadedPosts[e])))).flat(1).sort(e)}},methods:{async loader$loadPosts({count:e},{onPostsLoaded:t}){const n=async e=>{const{id:t,channelId:n}=e,o=this.loader$loadedChannels[n].channel,a=await s["a"].getPostById(n,t,!0);return a?(a.channel=o,a):null},o=e=>this.loader$toLoadPostIdListSorted.length?this.loader$toLoadPostIdListSorted.slice(0,e).map((e=>this.loader$toLoadPosts[e])):null,a=o(e);if(!a)return;const i=await Promise.all(a.map((async e=>{const t=await n(e);return t?{success:!0,post:t}:{success:!1,target:e}}))),r=i.filter((e=>e.success)).map((e=>e.post));return r.length&&(r.forEach((e=>{this.loader$loadedPosts[e.id]=e})),this.loader$loadedPosts=Object.assign({},this.loader$loadedPosts),await t(r)),i},async loader$loadPostsNext({count:e}={}){if(!Object.keys(this.loader$toLoadPosts).length)return;if("loaded"!==this.loaderState)return;this.loaderState="fetching",await new Promise((e=>setTimeout(e,1e3)));const t=async()=>{const e=()=>({toLoadCount:Object.keys(this.loader$toLoadPosts).length,loadedCount:Object.keys(this.loader$loadedPosts).length}),{loadedCount:t,toLoadCount:n}=e(),o=`${t}/${t+n}`;u("onLoaded",o).log()};await this.loader$loadPosts({count:e},{onPostsLoaded:t}),this.loaderState="loaded"},async loader$initPostLoader({initialCount:e}={},{onPostsLoaded:t}={}){var n;null!==(n=e)&&void 0!==n||(e=24),t=async()=>{const e=()=>({toLoadCount:Object.keys(this.loader$toLoadPosts).length,loadedCount:Object.keys(this.loader$loadedPosts).length}),{loadedCount:t,toLoadCount:n}=e(),o=`${t}/${t+n}`;u("onLoaded",o).log()};const o=e=>new Promise((t=>setTimeout(t,e))),a=()=>({toLoadCount:Object.keys(this.loader$toLoadPosts).length,loadedCount:Object.keys(this.loader$loadedPosts).length}),s=()=>{const{toLoadCount:t,loadedCount:n}=a();return n&&(0===t||n>=e)};let i=!0;while(!s())await this.loader$loadPosts({count:10},{onPostsLoaded:t}),i?i=!1:await o(Math.round(3e3*Math.random()));u().log("loaded")}}},m={mixins:[h,p],data(){return{loaderState:"stopped"}},computed:{loaderEnabled(){return["loading","fetching","loaded","timeout"].includes(this.loaderState)}},created(){this.$watch("loaderState",((e,t)=>{const n={red:["timeout"]},o=Object.keys(n).find((t=>n[t].includes(e))),a=console.tag[o||"blue"]("State"),s={loading:"loading...",timeout:"timeout, maybe network error",fetching:"fetching next post slice",loaded:()=>{const e={loading:"loaded",timeout:"loaded but timeout"};return e[t]}};let i=s[e];"function"===typeof i&&(i=i()),i?a.log(i):a.log()}))},methods:{async enableLoader(){const e=e=>new Promise((t=>setTimeout(t,e))),t=async(t,n,o)=>{let a,s=!1;return await Promise.race([t.then((e=>{s=!0,a=e})),e(n).then((()=>{s||o&&(a=o())}))]),a};if(this.loaderEnabled)return;this.loaderState="loading";const n=6e4,o=async()=>{await new Promise((e=>this.loader$enableChannelsLoader({onLoaded:t=>{d().log(t?"loaded":"updated"),e(!0)}},1e4))),await this.loader$initPostLoader()},a=e=>{this.loaderEnabled&&(this.loaderState=e?"timeout":"loaded")};await t((async()=>{await o(),a(!1)})(),n,(()=>{a(!0)}))},async disableLoader(){this.loaderEnabled&&(this.loaderState="stopped")}}},_={methods:{loader$dialog(){const e=this.$alphabiz.dialog({title:i["b"].t("no_available_post"),message:i["b"].t("following_channel_no_post"),cancel:i["b"].t("cancel"),ok:i["b"].t("lib_explore")});return e.promise("ok").then((e=>{e&&(o["a"].getters.settings.libraryShowExplore||o["a"].dispatch("set",{libraryShowExplore:!0}),this.$root.$emit("navigate-to","/library/explore"),this.$router.push("/library/explore"))})),e}}},f={mixins:[m,_],computed:{loadedPosts(){return this.loader$loadedPosts}},created(){let e;this.$watch("loaderState",(t=>{if("timeout"===t);else{if(!e)return;try{e.hide()}catch(n){}finally{e=null}}}))},async activated(){const e=()=>{const e=Object.values(this.loader$loadedChannels).map((({ids:e})=>e)).flat(1),t=Object.keys(this.loader$loadedPosts).filter((t=>!e.includes(t)));t.forEach((e=>{delete this.loader$loadedPosts[e]})),t.length&&(this.loader$loadedPosts=Object.assign({},this.loader$loadedPosts))};e(),await s["a"].whenReady,this.enableLoader()},deactivated(){this.disableLoader()}}},"2e34":function(e,t,n){"use strict";n("3e69")},"2e69":function(e,t,n){"use strict";n("30c9")},3:function(e,t){},30:function(e,t){},3061:function(e,t,n){"use strict";n("aa59")},"30c9":function(e,t,n){},31:function(e,t){},32:function(e,t){},"326b":function(e,t,n){},33:function(e,t){},3334:function(e,t,n){"use strict";n.r(t),n.d(t,"getCurrentUser",(function(){return o})),n.d(t,"getCurrentExpenses",(function(){return a})),n.d(t,"getCurrentIncome",(function(){return s})),n.d(t,"getTransactionById",(function(){return i})),n.d(t,"getUser",(function(){return r})),n.d(t,"listUsers",(function(){return l})),n.d(t,"getInvitation",(function(){return c})),n.d(t,"listInvitations",(function(){return d})),n.d(t,"queryInvitationsByInviterId",(function(){return u})),n.d(t,"getMessageTimer",(function(){return h})),n.d(t,"listMessageTimers",(function(){return p})),n.d(t,"getTransaction",(function(){return m})),n.d(t,"listTransactions",(function(){return _})),n.d(t,"queryTransactionsByPayerId",(function(){return f})),n.d(t,"queryTransactionsByPayeeId",(function(){return g})),n.d(t,"getTask",(function(){return b})),n.d(t,"listTasks",(function(){return y})),n.d(t,"queryTasksByMember",(function(){return v})),n.d(t,"queryTaskByCategory",(function(){return w})),n.d(t,"getProvidentFund",(function(){return k})),n.d(t,"listProvidentFunds",(function(){return C}));const o="\n query GetCurrentUser {\n getCurrentUser {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",a="\n query GetCurrentExpenses($nextToken: String, $params: String) {\n getCurrentExpenses(nextToken: $nextToken, params: $params) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",s="\n query GetCurrentIncome($nextToken: String, $params: String) {\n getCurrentIncome(nextToken: $nextToken, params: $params) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",i="\n query GetTransactionById($id: String) {\n getTransactionById(id: $id) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",r="\n query GetUser($id: ID!) {\n getUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",l="\n query ListUsers(\n $filter: ModelUserFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listUsers(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n credit\n username\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n",c="\n query GetInvitation($id: ID!) {\n getInvitation(id: $id) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",d="\n query ListInvitations(\n $filter: ModelInvitationFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listInvitations(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n",u="\n query QueryInvitationsByInviterId(\n $inviterId: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelInvitationFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryInvitationsByInviterId(\n inviterId: $inviterId\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n",h="\n query GetMessageTimer($id: ID!) {\n getMessageTimer(id: $id) {\n id\n times\n updatedAt\n createdAt\n }\n }\n",p="\n query ListMessageTimers(\n $filter: ModelMessageTimerFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listMessageTimers(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n times\n updatedAt\n createdAt\n }\n nextToken\n }\n }\n",m="\n query GetTransaction($id: ID!) {\n getTransaction(id: $id) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",_="\n query ListTransactions(\n $filter: ModelTransactionFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listTransactions(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",f="\n query QueryTransactionsByPayerId(\n $payerId: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTransactionFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTransactionsByPayerId(\n payerId: $payerId\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",g="\n query QueryTransactionsByPayeeId(\n $payeeId: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTransactionFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTransactionsByPayeeId(\n payeeId: $payeeId\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",b="\n query GetTask($id: ID!) {\n getTask(id: $id) {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",y="\n query ListTasks(\n $filter: ModelTaskFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listTasks(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",v="\n query QueryTasksByMember(\n $member: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTaskFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTasksByMember(\n member: $member\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",w="\n query QueryTaskByCategory(\n $category: TaskCategory\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelTaskFilterInput\n $limit: Int\n $nextToken: String\n ) {\n queryTaskByCategory(\n category: $category\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n nextToken\n }\n }\n",k="\n query GetProvidentFund($id: ID!) {\n getProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",C="\n query ListProvidentFunds(\n $filter: ModelProvidentFundFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listProvidentFunds(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n amount\n updatedAt\n createdAt\n }\n nextToken\n }\n }\n"},3361:function(e,t,n){},34:function(e,t){},3408:function(e,t,n){"use strict";n("8306")},35:function(e,t){},36:function(e,t){},3669:function(e,t,n){"use strict";n("c7ce")},"36a1":function(e,t,n){"use strict";n.d(t,"a",(function(){return V}));var o=n("ff9b"),a=n("2d62"),s=n("d7df"),i=n("5515"),r=n("f680"),l=n("5584"),c=n("1926"),d=n("c49d"),u=n("3aea"),h=(n("d4b5"),n("de6c"),n("0598")),p=n("9ad5"),m=n.n(p),_=n("a3fc"),f=n("61af"),g=n("d710"),b=n.n(g);const{github:y}=g["update"],v=e=>g["takedown"].admins.includes(e),w="Serious Violation",k="Copyright Disputes",C="Adults Only",$=()=>{const e=Object(h["default"])()?require("developer/take-down.json"):n("9445");return e},S=$(),x=()=>{if(!Object(h["default"])())return null;const{app:e}=n("3be9"),t=e.getPath("userData");if(!t)return null;const o=Object(_["resolve"])(t,"config/take-down.json");return Object(f["existsSync"])(o)?JSON.parse(Object(f["readFileSync"])(o)):null},T=async()=>{const e=`https://raw.githubusercontent.com/${y.username}/${y.repo}/${y.branch}/developer/take-down.json`,{data:t}=await m.a.get(e).catch((()=>({data:null})));return t},I=async()=>{let e=await T();if(console.log("get from remote",e),Object(h["default"])()&&e){const{app:t}=n("3be9"),o=t.getPath("userData");if(!o)return;const a=Object(_["resolve"])(o,"config/take-down.json");Object(f["writeFileSync"])(a,JSON.stringify(e,null,2))}if(e||(e=x(),console.log("get from saved",e)),e&&"object"===typeof e)for(const t in S)S[t].splice(0,S[t].length,...e[t])},P=()=>S,O={users:[],channels:[],posts:[]};let q=!1;const E=()=>O,A=()=>{if(q)return;q=!0;const{admins:e,mode:t}=g["takedown"],n="admin"===t?0:Math.ceil(e.length/2+.5),o=[],s=()=>{console.log("update extra list",o);const e={users:[],channels:[],posts:[]};o.forEach((({id:o,admins:a,reason:s})=>{const[i,r]=o.split("|");if(!i||!r||!e[i])return;const l={id:r,reason:s,admins:a,mode:t,minCount:n};e[i].find((e=>e.id===r))||e[i].push(l)}));for(const t in e)O[t].splice(0,O[t].length,...e[t])},i=()=>{s()},r=(e="",t={})=>{for(const a in t){const s=t[a],i=o.find((e=>e.id===a));if(i)s&&[w,k,C].includes(s)?i.admins.includes(e)||i.admins.push(e):i.admins.includes(e)&&(i.admins.splice(i.admins.indexOf(e),1),0===i.admins.length&&o.splice(o.indexOf(i),1));else{if(!s)continue;if(![w,k,C].includes(s))continue;o.push({id:a,admins:[e],reason:s,minCount:n})}}i()};e.forEach((e=>{console.log("add admin",e),a["v"].user(e).get("takedowns").on((t=>{r(e,t)}))}))};n("7a76"),n("0c26");var D=n("0f0c"),N=n("8097"),L=async()=>{const e=j();console.tag.orange("recommends","urls").log(e);const{data:t,url:n}=await new Promise((async t=>{for(const n of e){const e=await R(n);if(e){t({data:e,url:n});break}}}));return console.tag.orange("recommends","got").log({url:n,data:t}),t};function j(){const e={version:Object(D["a"])("version"),buildTime:Object(D["a"])("buildTime")},t=(()=>{try{return"web"===e.version.split("-")[1]}catch{return!1}})(),n=[`${g["homepage"]}/recommends/v${e.version}.txt`,`${g["homepage"]}/recommends/v${e.version.split("-")[0]}.txt`,`${g["homepage"]}/recommends/recommends.txt`,"recommends.txt"];return t?n.splice(1,2):Object(N["a"])()&&n.unshift(`${g["homepage"]}/recommends/store/v${e.version}.txt`,`${g["homepage"]}/recommends/store/v${e.version.split("-")[0]}.txt`,`${g["homepage"]}/recommends/store/recommends.txt`),Array.from(new Set(n))}async function R(e){const t=async()=>{const t=await fetch(e);if(!t.ok||200!==t.status)return console.tag.orange("recommends","fetch").warn(t.statusText),null;try{const e=await t.text();return U(e)}catch{return null}},n=async o=>{try{return o.count&&console.tag.orange("recommends","fetch:retry",o.count).log(e),await t()}catch(a){if(a instanceof TypeError)return await new Promise((e=>setTimeout(e,1e3))),o.count+=1,await n(o);throw a}};return await n({count:0})}function U(e){if("string"!==typeof e)throw console.tag.orange("recommends","parse").error("Cannot parse data as string",e),new Error("Cannot parse data as string");const t=e.split("\n").map((e=>{var t;return null===(t=e.trim().split(" "))||void 0===t?void 0:t[0]})).filter((e=>e.match(/^[a-z0-9]{20}$/)));return t}var F=n("1738"),M=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};let B=Date.now();s["a"].on("library-db",(e=>M(void 0,void 0,void 0,(function*(){e&&(setTimeout((()=>Object(i["b"])(e)),3e3),setTimeout((()=>Object(i["b"])(e)),3e4),setTimeout((()=>Object(i["b"])(e)),6e4))})))),s["a"].emit("library-db");let Q=!1;Object.defineProperty(globalThis,"verb",{get(){return Q},set(e){Q=e}}),Object.defineProperty(globalThis,"eventBus",{get(){return a["i"]}});const W=["G","PG","PG-13","R","NC-17"];let z=()=>{},H=null;const V=new o["a"]({data(){return{user:null,ownedChannels:[],ownedChannelInstances:[],ownedChannelMap:new Map,followingChannels:[],showRecommend:!1,recommendPage:0,recommendIdList:[],allChannelList:[],online:!1,onlineStatus:"connecting",gunPeers:[],channelFollowerCount:{},libStatus:"init",whenReady:new Promise((e=>{let t=!1;z=()=>{t||(t=!0,F["a"].send("library_init",{cost:Date.now()-B}),e())}})),search:{text:"",option:{label:"",value:""},options:[]},currentCreator:{name:"",description:"",avatar:"",id:"",channels:[]},currentUserFromGun:null,userData:{},takedownList:{users:[],channels:[],posts:[]},takedownExtraList:{users:[],channels:[],posts:[]},isLibAdmin:!1,isFirstRegister:!1}},computed:{allowAdults(){return"NC-17"===l["a"].state.setting.libraryRate},username(){return this.userData&&"string"===typeof this.userData.name?this.userData.name:"("+c["b"].t("loading")+")"},bannedUsers(){const e=[];return[this.takedownList,this.takedownExtraList].forEach((t=>{t.users.forEach((({id:t,reason:n,mode:o,admins:a,minCount:s})=>{"committee"===o&&a.length{t.channels.forEach((({id:t,reason:n,mode:o,admins:a,minCount:s})=>{"committee"===o&&a.length{t.posts.forEach((({id:t,reason:n,mode:o,admins:a,minCount:s})=>{"committee"===o&&a.length{if(t.id){if(e.includes(t.id))return!1;if(e.push(t.id),this.isBannedChannel(t))return!1}return t.title&&(t.creator||t.soul)}))},nonBlockFollowingChannels(){const{blockChannels:e,blockUsers:t}=this.userData;return e&&t?this.followingChannels.filter((n=>!(!n.id||!n.title)&&(!e.includes(n.id)&&!t.includes(n.creator)))):[]},isLoggedIn(){return!!this.user&&("ready"===this.libStatus&&!(!this.user.is||!this.user.is.pub))},sortedChannel(){return this.channelList},filteredChannels(){if(console.log("trigger filter channel"),"channel"!==this.search.option.label)return this.sortedChannel;const e=this.search.text;return this.sortedChannel.filter((t=>{var n;return!!t&&(t.title.toLowerCase().includes(e)||(null===(n=t.id)||void 0===n?void 0:n.includes(e)))}))},recommendChannels(){const e=5,t=this.filteredChannels.length,n=Math.ceil(t/e);while(this.recommendPage>n)this.recommendPage-=n;const o=[],a=this.recommendPage*e;for(let s=0;s<5;s++){const e=a+s;this.filteredChannels[e]&&!this.followingChannels.some((t=>t.id===this.filteredChannels[e].id))&&o.push(this.filteredChannels[e])}return o},addedPostMap(){const e=Object.create(null);for(const t in l["a"].getters.abKeys){const n=l["a"].getters.abKeys[t];n.forEach((n=>{e[n.key]={type:t,infoHash:n.infoHash,playFile:n.playFile}}))}return e}},methods:{register(e,t,n){return M(this,void 0,void 0,(function*(){this.isFirstRegister=!0,yield this.logout();const o=yield Object(a["z"])(e,t,n);return Object(i["c"])(),o}))},login(e){return M(this,void 0,void 0,(function*(){return this.isLibAdmin=!1,this.isLoggedIn?(console.log("should logged out",this.user),Object(a["x"])(),yield new Promise((e=>setTimeout(e,1e3))),this.user=null,console.log("relogin"),this.login(e)):(setTimeout((()=>{!this.followingChannels.length&&this.isLoggedIn&&this.updateFollow()}),1e4),Object(a["w"])(e))}))},logout(){return M(this,void 0,void 0,(function*(){this.isLibAdmin=!1,Object(a["x"])(),yield new Promise((e=>setTimeout(e,1e3))),this.user=null,this.userData={blockChannels:[],blockUsers:[]},this.followingChannels=[],this.ownedChannels=[]}))},prepareData(){var e;return M(this,void 0,void 0,(function*(){if(console.log("prepare data"),this.updateRecommends(),this.user=Object(a["u"])(),this.userData=Object(a["t"])().data,!this.user._||!this.user._.sea)throw new Error("User is not logged in");localStorage.setItem(`library-pair@${a["e"]}`,JSON.stringify(this.user._.sea)),this.isLibAdmin=v(null===(e=this.user.is)||void 0===e?void 0:e.pub),this.$emit("logged-in"),this.libStatus="fetch",yield this.getAllChannels(),this.updateOwn(),console.time("> lib: get private data"),yield this.updateFollow(),console.timeEnd("> lib: get private data"),this.libStatus="ready",z(),A(),this.takedownList=P(),this.takedownExtraList=E(),console.log("Takedown list:",this.takedownList)}))},isBannedChannel(e){return!!this.bannedUsers.includes(e.creator)||!!this.bannedChannels.includes(e.id)},isBannedPost(e){return!!this.bannedPosts.includes(e.id)},isValidRate(e){const t=l["a"].getters.settings.libraryRate,n=W.indexOf(e),o=W.indexOf(t);return n<=o},getAllChannels(){return M(this,void 0,void 0,(function*(){return H||(H=new Promise((e=>M(this,void 0,void 0,(function*(){const t=yield Object(a["k"])();if(t===this.allChannelList)return e();Object(d["a"])("get channel list",t,t.length),this.$set(this,"allChannelList",t),e()})))),H)}))},getRandomChannels(e,t){const n=this.followingChannels.map((e=>e.id)),o=(0===this.recommendIdList.length?this.channelList:this.recommendIdList.map((e=>this.channelList.find((t=>t.id===e))))).filter((e=>e&&!n.includes(e.id))),a=o.filter((e=>!e.hidden&&(!Array.isArray(t)||!t.includes(e.id))));if(0===a.length&&l["a"].getters.settings.libraryShowAllChannels){const e=this.channelList.filter((e=>!e.hidden&&(!!this.recommendIdList.includes(e.id)&&(!Array.isArray(t)||!t.includes(e.id)))));e.length&&a.push(...e)}if(a.length<=e)return a;for(let s=a.length-1;s>0;s--){const e=Math.floor(Math.random()*(s+1));[a[s],a[e]]=[a[e],a[s]]}if(b.a.library.recommends){const e=navigator.language,t=b.a.library.recommends[e]||b.a.library.recommends.default;if(t.length)for(let n=0;n(Object(d["a"])("Created new channel",e.id,e),V.allChannelList.find((t=>!!t.id&&t.id===e.id))||e.id&&V.allChannelList.push(e),setTimeout((()=>{Object(a["j"])(e.id).then((e=>{Object(i["c"])()}))}),1e3),e)))):null}))},editChannel(e,t){return M(this,void 0,void 0,(function*(){const n=yield Object(a["f"])(e,t);return Object(i["c"])(),n}))},removeChannel(e){return M(this,void 0,void 0,(function*(){const t=yield Object(a["A"])(e).then((t=>(Object(d["a"])("Removed",t,e),setTimeout((()=>Object(a["A"])(e)),1e3),t)));return Object(i["c"])(),t}))},createPost(e,t){return M(this,void 0,void 0,(function*(){if(!this.isLoggedIn)return null;const n=yield Object(a["b"])(t,e);return Object(i["c"])(),V.getChannelPosts(t,!1).then((t=>{t.find((t=>!!t.id&&t.id===e.id))||e.id&&t.push(e)})),n}))},addPosts(e,t){return M(this,void 0,void 0,(function*(){const n=yield Object(a["c"])(t,e);return Object(i["c"])(),n}))},editPost(e,t,n){return M(this,void 0,void 0,(function*(){const o=yield Object(a["g"])(e,t,n);return Object(i["c"])(),o}))},removePost(e,t){return M(this,void 0,void 0,(function*(){const n=yield Object(a["B"])(t,e);return Object(i["c"])(),n}))},getChannelById(e){return Object(a["l"])(e)},getChannelPosts(e,t){return M(this,void 0,void 0,(function*(){return Object(a["o"])(e,t||!1)}))},getChannelPostIds(e,t){return M(this,void 0,void 0,(function*(){return Object(a["q"])(e,t||!1)}))},getPostById(e,t,n){return M(this,void 0,void 0,(function*(){return Object(a["p"])(e,t,n)}))},followChannel(e){return M(this,void 0,void 0,(function*(){Object(d["a"])("lib: follow",e);const t=yield Promise.race([new Promise((t=>{setTimeout((()=>{this.followingChannels.some((t=>t.id===e))?t(null):Object(a["j"])(e).then(t)}),1500)})),Object(a["j"])(e)]);return this.isFirstRegister=!1,Object(i["c"])(),t}))},unfollowChannel(e){return M(this,void 0,void 0,(function*(){Object(d["a"])("lib: unfollow",e);const t=yield Object(a["E"])(e);return Object(i["c"])(),t}))},blockChannel(e){return Object(a["d"])("channel",e)},blockUser(e){return Object(a["d"])("user",e)},unblockChannel(e){return Object(a["D"])("channel",e)},unblockUser(e){return Object(a["D"])("user",e)},takedown(e,t,n){return M(this,void 0,void 0,(function*(){const o=yield Object(a["C"])(e,t,n);return console.log("Takedown result",o),o}))},setSearchOption(e){this.search.options=e,this.search.text="",e.length&&(this.search.option=e[0])},todo(e){r["a"].create(`Incomplete. info: ${e}`)}},created(){setTimeout((()=>{this.getAllChannels(),this.updateRecommends()}),2e3),I();const e=new Set;console.log("[lib] created"),Object(d["b"])((t=>{e.has(t)||Object(i["a"])(t)}));const t=new Set;setInterval((()=>{var e,n;const o=Object.values(a["v"]._.opt.peers);let s=!1;if(o.length){for(const t of o)if((null===(e=null===t||void 0===t?void 0:t.wire)||void 0===e?void 0:e.readyState)===WebSocket.OPEN&&(this.online=!0,this.onlineStatus="connected",s=!0),t.wire instanceof WebSocket){const e={type:"ws",url:t.url,status:(null===(n=t.wire)||void 0===n?void 0:n.readyState)||0},o=this.gunPeers.findIndex((t=>t.url===e.url));-1!==o?this.$set(this.gunPeers,o,e):this.gunPeers.push(e)}this.gunPeers.forEach((e=>{"wrtc"!==e.type&&(o.find((t=>t.url===e.url||t.id===e.url))||this.$set(e,"status",WebSocket.CLOSED))}))}else this.online=!1,"connected"===this.onlineStatus&&(this.onlineStatus="reconnecting");Object.values(i["d"]).forEach((e=>{var t;const n={closed:WebSocket.CLOSED,connected:WebSocket.OPEN,connecting:WebSocket.CONNECTING,disconnected:WebSocket.CLOSED,failed:WebSocket.CLOSED,new:WebSocket.CONNECTING}[e.connectionState];n===WebSocket.OPEN&&(s=!0);const o={type:"wrtc",url:e.id,from:e._from,status:n,statusText:e.connectionState,label:Object(u["f"])((null===(t=e.remoteDescription)||void 0===t?void 0:t.sdp)||""),syncState:e.syncState,remoteSyncState:e.remoteSyncState,downloaded:e.downloaded,downloadSpeed:e.downloadSpeed,uploaded:e.uploaded,uploadSpeed:e.uploadSpeed},a=this.gunPeers.findIndex((e=>e.url===o.url));-1!==a?this.$set(this.gunPeers,a,o):this.gunPeers.push(o)}));for(let a=0;a0},attrs:{rounded:"",color:"primary",icon:e.selected.length?"star":void 0,label:e.selected.length?e.$t("follow_channels_and_continue",[e.selected.length]):e.$t("follow_any_channel_to_continue"),disable:!e.selected.length},on:{click:e.onFollow}}),n("q-btn",{staticClass:"action-btn q-px-sm q-mr-xl",attrs:{rounded:"",color:"primary",icon:"refresh",label:e.$t("show_more_for_me")},on:{click:e.loadMore}})],1)],2)])},a=[],s=(n("de6c"),n("fb31")),i=n.n(s),r=n("36a1"),l={name:"LibraryRecommend",props:{fullscreen:Boolean},data(){return{initTimer:null,badImage:[],recommends:[],selected:[],lib:r["a"]}},computed:{autoSelectIds(){const e=navigator.language,t=i.a.library.recommends;return t[e]?t[e]:t.default},followings(){return r["a"].followingChannels.map((e=>e.id))},filteredRecommends(){const e=r["a"].recommendIdList.length?this.recommends.filter((e=>r["a"].recommendIdList.includes(e.id))):this.recommends;if(!r["a"].userData)return e;const{blockChannels:t,blockUsers:n}=r["a"].userData;return t&&n?e.filter(((o,a)=>e.findIndex((e=>e.id===o.id))===a&&!t.includes(o.id)&&!n.includes(o.creator))):e}},watch:{filteredRecommends(e){if(this.autoSelectIds.length)for(const t of this.autoSelectIds)!this.selected.includes(t)&&e.find((e=>e.id===t))&&this.selected.push(t)}},methods:{async initRecommends(){this.getRecommends(),this.$root.$emit("navigate-to"),this.$nextTick((()=>{if(this.autoSelectIds.length)for(const e of this.autoSelectIds)!this.selected.includes(e)&&this.filteredRecommends.find((t=>t.id===e))&&this.selected.push(e)}))},getRecommends(){const e=this.lib.getRandomChannels(5);this.recommends.splice(0,5,...e),0===e.length&&setTimeout((()=>{this.getRecommends()}),2e3)},loadMore(){const e=this.lib.getRandomChannels(6,this.recommends.map((e=>e.id)));if(!e.length)return this.$q.dialog({message:this.$t("no_more_recommend"),ok:this.$t("ok")});this.recommends.push(...e),this.$nextTick((()=>{if(this.autoSelectIds.length)for(const t of this.autoSelectIds)!this.selected.includes(t)&&e.find((e=>e.id===t))&&this.selected.push(t)}))},select(e){this.selected.includes(e)?this.selected.splice(this.selected.indexOf(e),1):this.selected.push(e)},onFollow(){for(const e of this.selected)r["a"].followChannel(e);this.selected.splice(0),this.autoSelectIds.length&&setTimeout((()=>{for(const e of this.autoSelectIds)!this.selected.includes(e)&&this.filteredRecommends.find((t=>t.id===e))&&this.selected.push(e)}),5e3)},onImageError(e){this.badImage.push(e)},onImageLoaded(e){-1!==this.badImage.indexOf(e)&&this.badImage.splice(this.badImage.indexOf(e),1)}},mounted(){const e=()=>{var t;"signedIn"===(null===(t=this.$store.state.account)||void 0===t?void 0:t.authState)?this.initTimer=setTimeout((()=>{this.initRecommends()}),500):this.initTimer=setTimeout(e,1e3)};e()},beforeDestroy(){clearTimeout(this.initTimer)}},c=l,d=(n("7895"),n("2b5f")),u=n("e586"),h=n("d7c7"),p=n("f106"),m=n("1043"),_=n("4101"),f=n("09a4"),g=n.n(f),b=Object(d["a"])(c,o,a,!1,null,"0d732dc4",null);t["a"]=b.exports;g()(b,"components",{QCard:u["a"],QCardSection:h["a"],QIcon:p["a"],QBtn:m["a"],QColor:_["a"]})},37:function(e,t){},"38d2":function(e,t,n){},"39df":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"development-container",class:{large:e.isElectron}},[n("q-card",{attrs:{flat:"",square:""}},[n("q-tabs",{attrs:{align:"left","no-caps":"","narrow-indicator":""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},e._l(e.tabs,(function(t){return n("q-tab",e._b({key:t.name},"q-tab",t,!1))})),1),n("q-separator"),n("q-tab-panels",{staticClass:"panels",attrs:{animated:""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},[n("q-tab-panel",{attrs:{name:"BasicPanel"}},[n("BasicPanel")],1),n("q-tab-panel",{attrs:{name:"accountInfo"}},[n("account-tab-panel")],1),n("q-tab-panel",{attrs:{name:"amplify"}},[n("amplify-tab-panel")],1),n("q-tab-panel",{attrs:{name:"devInfo"}},[n("dev-info-tab-panel")],1),n("q-tab-panel",{attrs:{name:"capacitorTest"}},[n("CapacitorTest")],1),n("q-tab-panel",{attrs:{name:"urlConvert"}},[n("url-convert")],1),n("q-tab-panel",{attrs:{name:"libraryData"}},[n("library-data")],1),n("q-tab-panel",{attrs:{name:"libraryPreload"}},[n("LibraryPreload")],1),n("q-tab-panel",{attrs:{name:"payment_mode"}},[n("payment-mode")],1),n("q-tab-panel",{attrs:{name:"theme_panel"}},[n("ThemeTabPanel")],1)],1)],1)],1)},a=[],s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"panel"},e._l(e.handlersData,(function(t){var o=t[0],a=t[1];return n("q-btn",e._b({key:o.key,attrs:{"no-caps":"",unelevated:""},on:{click:a}},"q-btn",o,!1))})),1),n("q-separator"),n("q-card-section",[n("div",{staticClass:"text-h6 text-bold"},[e._v("Dynamic Config")]),n("div",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(JSON.stringify(e.d$cfg,null,2)))])]),n("q-separator"),n("q-card-section")],1)},i=[],r=(n("de6c"),n("a1c1"),n("91ab")),l=n("d310");const c=n("d310").isElectron();var d={name:"BasicPanel",data(){return{handlers:[[{color:"positive",icon:"bug_report"},this.openWebtorrentDevTools],[{color:"positive",icon:"refresh"},this.reloadWebTorrent],[{color:"negative",icon:"delete_forever"},this.delete_config],[{color:"negative",icon:"delete"},this.clearBlockchainConfig],this.getUsersLanguage,this.getVueLocale,this.getLocale]}},computed:{handlersData(){return this.handlers.map((e=>Array.isArray(e)?e:[{},e])).map((([e,t])=>{e=Object.assign({key:t.name.substring(6),label:Object(r["a"])(t.name.substring(6)).replace(/-/g," "),color:"general",textColor:e.color||"general"},e);const n=async()=>{const e=t();e&&e.then&&await e};return[e,n]}))}},methods:{delete_config(){this.$q.electron.ipcRenderer.invoke("deleteConfig").then((e=>{this.$q.notify(e)}))},getLocale(){this.$q.notify(this.$q.lang.getLocale())},getVueLocale(){this.$q.notify(this.$i18n.locale)},getUsersLanguage(){l["localConfigs"].getSettingsItem("language").then((e=>{this.$q.notify({message:e,position:"bottom-right",type:"positive",timeout:3e3})})).catch((()=>{this.$q.notify({message:"未获取到数据项",position:"bottom-right",type:"negative",timeout:3e3})}))},openWebtorrentDevTools(){if(c)return n("b052").ipcRenderer.send("open-webtorrent-devtools")},reloadWebTorrent(){c&&(n("b052").ipcRenderer.send("reload-webtorrent-window"),this.$q.notify("WebTorrent window is reloaded"))},async clearBlockchainConfig(){await new Promise((e=>setTimeout(e,2e3))),await window.$blockchain.$store.account.deleteCurrentAccount(),localStorage.removeItem("blockchain.network");const e=window.$blockchain.network.getNetworkConfig();window.$blockchain.network.updateNetworkConfig(e),location.reload()}}},u=d,h=(n("bc42"),n("2b5f")),p=n("1043"),m=n("fc38"),_=n("d7c7"),f=n("09a4"),g=n.n(f),b=Object(h["a"])(u,s,i,!1,null,"60f74c22",null),y=b.exports;g()(b,"components",{QBtn:p["a"],QSeparator:m["a"],QCardSection:_["a"]});var v=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticStyle:{margin:"-4px"}},e._l(e.$account.$test,(function(t,o){return n("q-btn",{key:o,staticClass:"q-ma-xs",attrs:{unelevated:"",color:"general","text-color":"general","no-caps":"",label:o,disable:!!e.test$loadingState,loading:e.test$loadingState===o},on:{click:function(n){return e.test$withLoadingState(o,t)}}})})),1),n("q-separator",{staticStyle:{margin:"16px -16px"}}),n("div",{staticClass:"q-ma-sm"},[n("q-checkbox",{attrs:{label:"isTestEnv"},model:{value:e.isTest,callback:function(t){e.isTest=t},expression:"isTest"}})],1),n("h4",[e._v(e._s(e.$store.state.account.authState))]),"signedIn"===e.$store.state.account.authState?n("div",{staticClass:"row",staticStyle:{margin:"-4px"}},[e._l(e.$store.getters.accountUserInfo,(function(t,o){return[Array.isArray(t)?[n("div",{key:o,staticClass:"col-12 col-lg-6 q-pa-xs"},[n("q-card",{staticClass:"overflow-hidden",attrs:{flat:"",bordered:""}},[Array.isArray(t)?n("q-expansion-item",{attrs:{"content-inset-level":.4,label:o}},e._l(t,(function(t,o){return n("div",{key:o},[e._v(e._s(t)+"\n ")])})),0):e._e()],1)],1)]:[n("div",{key:o,staticClass:"col-6 col-sm-3 col-lg-2 q-pa-xs"},[n("q-card",{staticClass:"overflow-hidden q-px-md q-py-sm",staticStyle:{"min-height":"66px"},attrs:{flat:"",bordered:""}},[n("div",{staticClass:"text-capitalize",staticStyle:{"font-size":"0.8rem",opacity:"0.8"}},[e._v(e._s(o)+"\n ")]),n("div",{staticClass:"text-weight-bold text-no-wrap ellipsis"},[e._v(e._s(t))])])],1)]]}))],2):e._e(),"signedIn"===e.$store.state.account.authState?[n("q-separator",{staticStyle:{margin:"16px -16px"}}),n("div",{staticClass:"q-mb-sm"},[n("q-input",{staticStyle:{"max-width":"300px"},attrs:{label:"TestToken",dense:"",outlined:""},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.testToken,callback:function(t){e.testToken=t},expression:"testToken"}})],1),n("div",[n("alphabiz-button",{attrs:{label:"Add Credits 100","on-click":e.addCredits}})],1)]:e._e()],2)},w=[],k=n("e75b");const C=new k["a"].Rest("ABDevRest");var $={name:"AccountTabPanel",data(){return{test$loadingState:null,testToken:""}},computed:{isTest:{get(){return this.$root.isTestEnv},set(e){this.$root.isTestEnv=e}}},methods:{async test$withLoadingState(e,t){try{this.test$loadingState=e,await t()}finally{this.test$loadingState=null}},async addCredits(){try{const e=await C.post("/development/addCredits",{testToken:this.testToken});console.log(e)}catch(e){this.$q.notify({message:e.message,type:"negative",position:"bottom-right",timeout:5e3})}}}},S=$,x=n("7498"),T=n("e586"),I=n("5bbd"),P=n("0e45"),O=Object(h["a"])(S,v,w,!1,null,"2975ce9d",null),q=O.exports;g()(O,"components",{QBtn:p["a"],QSeparator:m["a"],QCheckbox:x["a"],QCard:T["a"],QExpansionItem:I["a"],QInput:P["a"]});var E=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{margin:"-12px"}},[n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"dispatch public event"},on:{click:e.dispatchPublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"send public event"},on:{click:e.sendPublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"subscribe public event"},on:{click:e.subscribePublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"unsubscribe public event"},on:{click:e.unsubscribePublicEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"dispatch public event [legacy]"},on:{click:e.dispatchPublicEventLegacy}}),n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"rest_dev"},on:{click:e.restDev}}),n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"regInfo"},on:{click:e.regInfo}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"dialog"},on:{click:e.dialog}}),n("q-separator",{staticClass:"q-my-xs",attrs:{color:"general"}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"analytics:trigger_event"},on:{click:e.triggerAnalyticsEvent}}),n("q-btn",{attrs:{flat:"","no-caps":"",label:"analytics:updateEndpoint"},on:{click:e.updateEndpoint}})],1)},A=[],D=(n("d4b5"),n("61af")),N=n.n(D),L=n("bbac"),j=n("229c");const R=new k["a"].Rest("ABDevRest"),U={mounted(){j["a"].$debug()},methods:{async updateEndpoint(){const e=await j["a"].updateEndpoint({attributes:{foo:"bar"},immediate:!0});console.log("updateEndpoint:",e)},async triggerAnalyticsEvent(){console.log("triggerAnalyticsEvent:","sending");const e=await j["a"].record({immediate:!0,name:"test_analytics",attributes:{source:"triggerAnalyticsEvent"},metrics:{foobar:Math.floor(1e3*Math.random())}});console.log("triggerAnalyticsEvent:","sent",e)}}};var F={name:"AmplifyTabPanel",mixins:[U],data(){return{currentLoadingState:!1}},methods:{async dispatchPublicEvent(){const e=await R.postGuest("/development/dispatchPublicEvent",{id:"9865c315-e778-4de3-8045-1af79eba7fb4",channel:"foo_channel",data:JSON.stringify({a:213123,b:"lorem-server"})});console.log(e)},async dispatchPublicEventLegacy(){const e=await R.postGuest("/development/dispatchPublicEvent",{id:"*",channel:"foo_channel-legacy",legacy:!0,data:JSON.stringify({a:213123,b:"lorem-server-legacy"})});console.log(e)},async sendPublicEvent(){},async subscribePublicEvent(){},async unsubscribePublicEvent(){},async dialog(){const e=this.$alphabiz.dialog({title:"Tel",prompts:{tel:{type:"tel",model:{countryCode:null,prefixCode:null,phoneNumber:""}}}}),t=await e.promise("ok");console.log(t)},async restDev(){const e=async e=>{e.click();const t=new Promise((t=>{let n=!1;setTimeout((()=>{const e=document.activeElement;e.addEventListener("focus",(()=>{console.log("file$onFocus: Start",e),setTimeout((()=>{console.log("file$onFocus: End",n),!1===n&&t(null)}),400)}),{once:!0})}),200),e.addEventListener("change",(async o=>{var a,s;console.log("file$onChange");const i=null===o||void 0===o||null===(a=o.target)||void 0===a||null===(s=a.files)||void 0===s?void 0:s[0];i&&(n=!0,t(i)),e.value=null}),{once:!0})}));return await t},t=()=>{const e=document.createElement("input");return e.style.display="none",e.type="file",e.accept=".abk",e},n=t(),o=await e(n);if(!o)return;const a=this.$root.$children[0];console.log(o.path),a.lib$openABK(o.path)},async regInfo(){let e=null;const t=[],n=()=>R.post("/development/admin/query",{token:"asdasdasd",type:"reg_info",pagination_token:e});while(e||null===e)await n().then((({data:n})=>{e=n.PaginationToken,t.push(...n.Users),console.log(`queried ${t.length} (+${n.Users.length})`,n.PaginationToken)}));console.log("save users",t);const o=async e=>{const t=e=>{const t={};return t.username=e.Username,t.user_status=e.UserStatus,t.user_create_date=e.UserCreateDate,t.user_last_modified_date=e.UserLastModifiedDate,e.Attributes.forEach((({Name:e,Value:n})=>{t[`attr_${e}`]=n})),t},n=e.map(t),o=(()=>{let e=[];return n.forEach((t=>{const n=Object.keys(t);n.length>e.length&&(e=n)})),e=e.map((e=>({header:e,key:e}))),e})();console.log("columns",o);const a=n.map((e=>{const t=[];return o.forEach((n=>{var o;t.push(null!==(o=e[n.key])&&void 0!==o?o:"null")})),t})),s=await new Promise(((e,t)=>{Object(L["stringify"])(a,{header:!0,columns:o},((n,o)=>{n?t(n):e(o)}))}));return s};o(t).then((e=>{console.log("csv saving...",e),N.a.writeFileSync("./users.csv",e),console.log("done")}))}}},M=F,B=Object(h["a"])(M,E,A,!1,null,null,null),Q=B.exports;g()(B,"components",{QSeparator:m["a"],QBtn:p["a"]});var W=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.devInfo.torrentStore?n("div",{staticClass:"full-width"},[e._v("Torrent Config Store:\n "),n("alphabiz-button",{staticClass:"dev-info-action q-ml-md",attrs:{label:"Open"},on:{click:function(t){return e.open(e.devInfo.torrentStore)}}}),n("alphabiz-button",{staticClass:"dev-info-action q-ml-sm",attrs:{label:"Reset"},on:{click:e.resetTorrent}}),n("pre",[e._v(e._s(e.devInfo.torrentStore))])],1):e._e(),e.devInfo.settingStore?n("div",{staticClass:"full-width"},[e._v("Setting Config Store:\n "),n("alphabiz-button",{staticClass:"dev-info-action q-ml-md",attrs:{label:"Open"},on:{click:function(t){return e.open(e.devInfo.settingStore)}}}),n("alphabiz-button",{staticClass:"dev-info-action q-ml-sm",attrs:{label:"Reset"},on:{click:e.resetSetting}}),n("pre",[e._v(e._s(e.devInfo.settingStore))])],1):e._e(),e._v("\n We are using\n "),e.devInfo.electronVer?n("div",{staticClass:"full-width"},[e._v("Electron "+e._s(e.devInfo.electronVer)+"\n ")]):e._e(),e.devInfo.chromeVer?n("div",{staticClass:"full-width"},[e._v("Chrome "+e._s(e.devInfo.chromeVer)+"\n ")]):e._e(),e.devInfo.nodeVer?n("div",{staticClass:"full-width"},[e._v("Node "+e._s(e.devInfo.nodeVer)+"\n ")]):e._e(),n("div",[e._v("Quasar "+e._s(e.$q.version))]),n("div",[e._v("Vue "+e._s(e.vueVersion))]),n("div",[e._v(" "+e._s(e.$q.platform))]),e.devInfo.isCapacitor?n("div",{staticClass:"is-capacitor"},[e._v("[ Capacitor(Mobile) Mode ]")]):e._e(),e.devInfo.processArgv?n("div",{staticClass:"full-width"},[e._v("Process Argv "+e._s(e.devInfo.processArgv))]):e._e(),n("div",{staticClass:"full-width"},[e._v("Platform info: "+e._s(e.devInfo.platformInfo))]),n("div",{staticClass:"full-width"},[e._v("Location href: "+e._s(e.devInfo.locationHref))]),n("q-btn",{attrs:{color:"primary",icon:"aod",label:"capacitor test"},on:{click:e.testCapacitor}})],1)},z=[],H=n("ff9b"),V=n("908d"),G=n("d7df"),K=n("d558");const Y=n("d310").isElectron(),J=Y?n("b052").ipcRenderer:null;var X={name:"DevInfoTabPanel",data(){return console.log("PLATFORM",V["b"].is,location),{io:G["a"],devInfo:{torrentStore:"",settingStore:"",platformInfo:V["b"].is,locationHref:location.href,isCapacitor:Object(K["a"])()}}},methods:{open(e){this.io.emit("show_torrent_file",e)},resetTorrent(){Y&&J.send("reset-torrent")},resetSetting(){this.$store.dispatch("resetSettings").then((e=>{this.$i18n.locale=e.language,this.$q.notify("Reset success")}))},testCapacitor(){fetch("http://localhost:25742",{mode:"cors"}).then((e=>e.json())).then((e=>{console.log("CAPACITOR test success",e),this.$q.dialog({html:!0,message:"
"+JSON.stringify(e,null,2)+"
",ok:!0})})).catch((e=>{console.log("CAPACITOR test failed",e),console.log(e.message),console.log(e.stack),this.$q.dialog({message:e.message||e,ok:!0})}))}},mounted(){Y&&(J.on("dev-info",((e,t)=>{t.torrentStore&&(this.devInfo.torrentStore=t.torrentStore),t.settingStore&&(this.devInfo.settingStore=t.settingStore),t.electronVer&&(this.devInfo.electronVer=t.electronVer),t.chromeVer&&(this.devInfo.chromeVer=t.chromeVer),t.nodeVer&&(this.devInfo.nodeVer=t.nodeVer),t.argv&&(this.devInfo.processArgv=t.argv)})),J.send("dev-info")),this.io.off("notify",this.notify),this.io.on("notify",this.notify)},computed:{vueVersion(){return H["a"].version}}},Z=X,ee=(n("3fc8"),Object(h["a"])(Z,W,z,!1,null,"39f109b1",null)),te=ee.exports;g()(ee,"components",{QBtn:p["a"]});var ne=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._v("\n Alphabiz URL Convert\n "),n("q-input",{staticClass:"q-my-md",attrs:{type:"text",label:"source url"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.url,callback:function(t){e.url=t},expression:"url"}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Convert"},on:{click:e.convert}})],1)},oe=[],ae=n("c5a5"),se={name:"DevInfoTabPanel",data(){return{url:""}},methods:{convert(){Object(ae["a"])(this.url).then((e=>{this.url=e})).catch((e=>{console.error(e)}))}}},ie=se,re=Object(h["a"])(ie,ne,oe,!1,null,"19fc1694",null),le=re.exports;g()(re,"components",{QInput:P["a"],QBtn:p["a"]});var ce=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-data"},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"input-file",accept:".json"},on:{change:e.onFileChange}}),n("div",{staticClass:"text-h6 q-py-md"},[e._v("Media Library Database")]),n("div",{staticClass:"current-lib-status"},[e._v("There are "+e._s(e.entriesCount)+" entries in library")]),n("q-btn",{attrs:{color:"primary",icon:"save",label:"Export"},on:{click:e.saveDb}}),n("FileSelector",{on:{select:e.onFileChange}},[n("q-btn",{staticClass:"q-ml-md",attrs:{color:"primary",icon:"upload_file",label:"Import"}})],1),n("br"),n("q-btn",{staticClass:"q-mt-md",attrs:{color:"primary",icon:"bug_report",label:"Library Debug Log"},on:{click:function(t){e.showDebugLog=!0}}}),n("q-dialog",{model:{value:e.showDebugLog,callback:function(t){e.showDebugLog=t},expression:"showDebugLog"}},[n("q-card",{staticStyle:{"max-width":"80%"}},[n("q-card-section",[n("DebugLog")],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",color:"primary",icon:"close",label:"Close"}})],1)],1)],1)],1)},de=[],ue=n("2d62"),he=n("3aea"),pe=n("5515"),me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"debug-logs row col-12 q-pa-md"},[n("p",{staticClass:"col-12 q-mt-none",staticStyle:{"font-size":"24px"}},[e._v("Debug pannel")]),n("div",{staticClass:"peers col-6 q-pa-sm",staticStyle:{border:"1px solid gainsboro"}},e._l(e.peers,(function(t){return n("div",{key:t.url,staticClass:"peer"},[n("div",{staticClass:"status"},[n("q-badge",{attrs:{label:t.type}}),n("span",{directives:[{name:"show",rawName:"v-show",value:"wrtc"!==t.type,expression:"peer.type !== 'wrtc'"}],class:"connected"===t.status?"text-green":"text-grey"},[e._v("\n [ "+e._s(t.status)+" ]\n ")]),t.from?n("span",{staticClass:"text-green"},[e._v("[ "+e._s(t.from)+" ]")]):e._e(),n("span",[e._v(e._s(t.url))]),t.remoteSyncState?n("q-icon",{attrs:{color:"primary",name:t.stateIcon}},[n("q-tooltip",[n("span",[e._v("Local sync state: "+e._s(t.syncState))]),n("br"),n("span",[e._v("Remote sync state: "+e._s(t.remoteSyncState))])])],1):e._e()],1)])})),0),n("div",{staticClass:"logs col q-px-sm"},[e._v("\n --info--\n "),n("div",{staticClass:"user"},[e._v("User "+e._s(e.userInfo))]),n("div",{staticClass:"channels"},[e._v("Channels("+e._s(e.channels.length)+"): [\n "),e._l(e.channels,(function(t){return n("div",{key:t.id,staticClass:"channel q-ml-sm"},[e._v("\n "+e._s(t.title)+"\n "),n("span",{staticClass:"text-grey"},[e._v("UID: "+e._s(t.id))])])})),e._v("\n ]\n ")],2)])])},_e=[],fe=n("36a1"),ge={data(){return{lib:fe["a"]}},computed:{peers(){const e=[];return this.lib.gunPeers.forEach((t=>{let n="";switch(t.status){case WebSocket.CONNECTING:n="connecting";break;case WebSocket.OPEN:n="connected";break;case WebSocket.CLOSED:n="closed";break;case WebSocket.CLOSING:n="closing";break}let o="arrow_downward";"completed"===t.remoteSyncState?o="completed"===t.syncState?"done_all":"arrow_upward":"completed"!==t.syncState&&(o="sync"),e.push({from:t.from,url:t.label||t.url,type:t.type,syncState:t.syncState,remoteSyncState:t.remoteSyncState,stateIcon:o,status:n})})),e},userInfo(){var e;const t=this.lib.user;return`UID: ${null===t||void 0===t||null===(e=t.is)||void 0===e?void 0:e.pub}`},channels(){return this.lib.channelList.map((e=>({title:e.title,id:e.id})))}}},be=ge,ye=(n("28c4"),n("90c4")),ve=n("f106"),we=n("cf25"),ke=Object(h["a"])(be,me,_e,!1,null,null,null),Ce=ke.exports;g()(ke,"components",{QBadge:ye["a"],QIcon:ve["a"],QTooltip:we["a"]});var $e=n("d710"),Se=n.n($e),xe=n("9a50"),Te={components:{DebugLog:Ce,FileSelector:xe["a"]},name:"LibraryData",data(){return{entriesCount:Object.keys(ue["v"]._.graph).length,showDebugLog:!1,countInterval:null}},methods:{parseLib(){},saveDb(){Object(he["h"])(JSON.stringify({timestamp:Date.now(),graph:ue["v"]._.graph}),`${Se.a.name}-library-${Date.now()}.json`)},importDb(){this.$refs.fileSelector.click()},put(e){Object(pe["b"])(e),this.$q.notify(`Successfully import ${Object.keys(e).length} entries`)},onFileChange(e){e&&Object(he["g"])(e).then((e=>{const t=JSON.parse(e);if(!t.graph)return this.$q.notify(`This JSON file is not an ${Se.a.name} library db`);Date.now()-t.timestamp>6048e5?this.$q.dialog({title:"DB file too old",message:"This database file is created long time ago and may not be latest. Latest version of data will overwrite this db. Still import it?",ok:"Import anyway",cancel:"No",persistent:!0}).onOk((()=>{this.put(t.graph)})):console.log("Loaded db")}))}},created(){clearInterval(this.countInterval),this.countInterval=setInterval((()=>{this.entriesCount=Object.keys(ue["v"]._.graph).length}),1e3)},beforeDestroy(){clearInterval(this.countInterval)}},Ie=Te,Pe=n("b2aa"),Oe=n("59ba"),qe=n("a431"),Ee=Object(h["a"])(Ie,ce,de,!1,null,"0442e706",null),Ae=Ee.exports;g()(Ee,"components",{QBtn:p["a"],QDialog:Pe["a"],QCard:T["a"],QCardSection:_["a"],QCardActions:Oe["a"]}),g()(Ee,"directives",{ClosePopup:qe["a"]});var De=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v("\n Payment Mode\n ")]),n("q-toggle",{model:{value:e.dp$toggle,callback:function(t){e.dp$toggle=t},expression:"dp$toggle"}},[n("q-badge",{staticClass:"q-py-xs q-px-sm q-mx-xs",attrs:{"text-color":e.paymentColor,color:e.paymentColor}},[e._v("\n "+e._s(e.paymentLabel)+"\n ")])],1)],1),n("q-field",{staticClass:"q-my-xs",staticStyle:{width:"640px"},attrs:{label:"Current Address",outlined:"","stack-label":"",dense:""},scopedSlots:e._u([{key:"control",fn:function(){return[n("div",{staticClass:"self-center full-width no-outline",attrs:{tabindex:"0"}},[e._v(e._s(e.dp$address))])]},proxy:!0}])}),n("q-field",{staticClass:"q-my-xs",staticStyle:{width:"640px"},attrs:{label:"Current Credits",outlined:"","stack-label":"",dense:""},scopedSlots:e._u([{key:"control",fn:function(){return[n("div",{staticClass:"self-center full-width no-outline",attrs:{tabindex:"0"}},[e._v(e._s(e.dp$credit))])]},proxy:!0}])}),n("q-list",{staticClass:"q-my-md rounded-borders overflow-hidden non-selectable",staticStyle:{width:"640px",border:"1px solid rgba(127,127,127,0.35)"}},[n("q-item",{directives:[{name:"ripple",rawName:"v-ripple",value:!this.dp$toggle,expression:"!this.dp$toggle"}],attrs:{tag:"label",disable:!this.dp$toggle}},[n("q-item-section",{attrs:{avatar:""}},[n("q-checkbox",{attrs:{value:e.leftDrawer.showCreditPage,disable:!this.dp$toggle,val:"teal",color:"teal"},on:{input:function(t){return e.leftDrawer.showCreditPage=t}}})],1),n("q-item-section",[n("q-item-label",[e._v("Amplify Credits Page")]),n("q-item-label",{attrs:{caption:""}},[e._v("\n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem debitis distinctio dolor, doloribus ex harum\n ipsa ipsum molestias nihil, nisi non nulla numquam placeat possimus quae rem sapiente sunt voluptatum.\n ")])],1)],1),n("q-item",{directives:[{name:"ripple",rawName:"v-ripple",value:this.dp$toggle,expression:"this.dp$toggle"}],attrs:{tag:"label",disable:this.dp$toggle}},[n("q-item-section",{attrs:{avatar:""}},[n("q-checkbox",{attrs:{value:e.leftDrawer.showBlockchainPage,disable:this.dp$toggle,val:"orange",color:"orange"},on:{input:function(t){return e.leftDrawer.showBlockchainPage=t}}})],1),n("q-item-section",[n("q-item-label",[e._v("Blockchain Account Page")]),n("q-item-label",{attrs:{caption:""}},[e._v("\n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Autem debitis distinctio dolor, doloribus ex harum\n ipsa ipsum molestias nihil, nisi non nulla numquam placeat possimus quae rem sapiente sunt voluptatum.\n ")])],1)],1)],1),!e.dp$toggle&&e.$store.state.credits.providentFund?n("q-toggle",{model:{value:e.pf$toggle,callback:function(t){e.pf$toggle=t},expression:"pf$toggle"}},[n("q-badge",{staticClass:"q-py-xs q-px-sm q-mx-xs",attrs:{"text-color":"general",color:"general"}},[e._v("\n ProvidentFund: "+e._s(e.$store.state.credits.providentFund.enable?"Enabled":"Disabled")+"\n ")])],1):e._e()],1)},Ne=[],Le=n("09e8");const je={computed:{pf$toggle:{get(){const e=this.$store.state.credits.providentFund;if(!e){const e=localStorage.getItem("credit.providentFund");return!e||JSON.parse(e).enable}return e.enable},set(e){const t=(()=>{let e=localStorage.getItem("credit.providentFund");return e?JSON.parse(e):(e={enable:!0,poolId:"12345678-1234-1234-1234-123456790ab"},e)})();t.enable=e,localStorage.setItem("credit.providentFund",JSON.stringify(t)),this.$store.commit("CREDIT_UPDATE",{"providentFund.enable":e})}}}};var Re={name:"PaymentMode",mixins:[Le["a"],je],data(){return{changed:!1}},watch:{dp$toggle(e){e?(this.leftDrawer.showCreditPage=!1,this.leftDrawer.showBlockchainPage=!0):(this.leftDrawer.showCreditPage=!0,this.leftDrawer.showBlockchainPage=!1),this.changed=!this.changed,this.changed&&this.showRestartDialog()}},computed:{dp$toggle:{get(){return this.dp$mode?"blockchain"===this.dp$mode:"blockchain"===localStorage.getItem("dataPaymentMixin.mode")},set(e){this.dp$mode=e?"blockchain":"amplify"}},leftDrawer(){const e=this.$route.matched.find((e=>"MainLayout"===e.name)).instances.default;return e.$refs.leftDrawer},paymentLabel(){return this.dp$toggle?"Blockchain-based Service":"Managed Service (Amplify)"},paymentColor(){return this.dp$toggle?"accent":"positive"}},methods:{showRestartDialog(){this.$q.dialog({title:"Change Payment Mode",message:"you should restart application",ok:"Restart",cancel:"Undo"}).onOk((async()=>{n("d310").isElectron()&&n("b052").ipcRenderer.send("reload-webtorrent-window"),await this.$router.push({name:"Index"}),location.reload()})).onCancel((()=>{this.dp$toggle=!this.dp$toggle}))}}},Ue=Re,Fe=n("03bd"),Me=n("b121"),Be=n("e7c2"),Qe=n("b329"),We=n("25fb"),ze=n("79e0"),He=n("719b"),Ve=Object(h["a"])(Ue,De,Ne,!1,null,"34cd40b6",null),Ge=Ve.exports;g()(Ve,"components",{QToggle:Fe["a"],QBadge:ye["a"],QField:Me["a"],QList:Be["a"],QItem:Qe["a"],QItemSection:We["a"],QCheckbox:x["a"],QItemLabel:ze["a"]}),g()(Ve,"directives",{Ripple:He["a"]});var Ke=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-preload"},[n("q-checkbox",{staticClass:"q-mr-lg",attrs:{value:e.libraryPreload,label:"Enable preload"},on:{input:e.changePreload}}),n("q-checkbox",{directives:[{name:"show",rawName:"v-show",value:e.libraryPreload,expression:"libraryPreload"}],attrs:{value:e.showPreload,label:"Show preload tasks"},on:{input:e.changeShowPreload}}),n("div",{staticClass:"preload-tasks"},e._l(e.preloadTasks,(function(t,o){return n("div",{key:t.abUrl,staticClass:"preload-task q-ma-xs"},[n("div",{staticClass:"task-name q-mr-xs"},[e._v(e._s(o+1)+". "+e._s(t.postTitle||t.torrent&&(t.torrent.postTitle||t.torrent.name)||t.abUrl))]),n("span",{staticClass:"status"},[e._v("Status:\n "),t.failed?n("span",{staticClass:"status-text text-red"},[e._v("Failed")]):t.torrentPath?n("span",{staticClass:"status-text",class:2===t.torrent.preloadStatus?"text-green":""},[e._v("\n "+e._s(2===t.torrent.preloadStatus?"Downloaded":"Downloading")+"\n ")]):n("span",{staticClass:"status-text text-grey"},[e._v("Loading")])]),t.torrent&&2===t.torrent.preloadStatus?n("span",{staticClass:"q-ml-sm"},[n("span",{staticClass:"downloaded"},[e._v("Preload size:")]),n("span",{staticClass:"downloaded-size q-mx-xs"},[e._v(e._s(e.byteToLarger(t.torrent.downloaded)))]),n("q-btn",{attrs:{color:"general","no-caps":"",flat:"",dense:"",size:"xs"},on:{click:function(n){return e.showLocal(t.torrent)}}},[n("q-icon",{attrs:{name:"open_in_new",size:"14px"}}),n("span",{staticClass:"label",staticStyle:{"font-size":"14px"}},[e._v("Local files")])],1)],1):e._e()])})),0)],1)},Ye=[],Je=n("5584"),Xe=n("6422"),Ze={name:"LibraryPreload",data(){return{libraryPreload:Je["a"].state.setting.libraryPreload,showPreload:Je["a"].state.setting.showPreload,preloadTasks:[]}},methods:{byteToLarger(e){return Object(Xe["a"])(e,{gb:!1,byte:!1})},async changePreload(){console.log("change preload"),await Je["a"].dispatch("set",{libraryPreload:!this.libraryPreload}),await Je["a"].dispatch("fetchSettings"),this.libraryPreload=Je["a"].state.setting.libraryPreload},async changeShowPreload(){console.log("change showPreload"),await Je["a"].dispatch("set",{showPreload:!this.showPreload}),await Je["a"].dispatch("fetchSettings"),this.showPreload=Je["a"].state.setting.showPreload},onPreloadTasks(e){this.preloadTasks=e},showLocal(e){G["a"].emit("show_torrent_file",e.path)}},mounted(){console.log("on mounted"),G["a"].on("preload-tasks",this.onPreloadTasks)},beforeDestroy(){console.log("on before destroy"),G["a"].off("preload-tasks",this.onPreloadTasks)}},et=Ze,tt=(n("f817"),Object(h["a"])(et,Ke,Ye,!1,null,"6f92a449",null)),nt=tt.exports;g()(tt,"components",{QCheckbox:x["a"],QBtn:p["a"],QIcon:ve["a"]});var ot=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"capacitor-test"},[n("q-input",{attrs:{value:e.forceLogin,type:"checkbox",label:"Force Login"},on:{change:e.changeForceLogin}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Network Check"},on:{click:e.checkNetwork}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Homedir Check"},on:{click:e.checkHomedir}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Write to clipboard"},on:{click:e.writeClipboard}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Copy from clipboard"},on:{click:e.readClipboard}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Crypto"},on:{click:e.checkCrypto}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Simulate wifi/cellular"},on:{click:e.changeNetworkType}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"ReadFile"},on:{click:e.checkReadFile}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"WriteFile"},on:{click:e.checkWriteFile}}),n("div",[n("q-input",{attrs:{type:"text",label:"Filepath"},model:{value:e.filepath,callback:function(t){e.filepath=t},expression:"filepath"}}),n("q-btn",{attrs:{color:"primary",icon:"check",label:"Get file uri"},on:{click:e.getFileUri}})],1),n("div",[n("FollowButton",{attrs:{id:"test",disableFollow:!1}}),n("FileSelector",{on:{select:e.onSelectFile}},[n("q-btn",{attrs:{color:"primary",icon:"folder",label:"File"}})],1)],1),n("div",{staticClass:"debug-logs"},e._l(e.logs,(function(t,o){return n("div",{key:o,staticClass:"log"},[n("span",{staticClass:"log-type"},[e._v(e._s(t.type))]),n("span",{staticClass:"log-value"},[e._v(e._s(t.value))])])})),0)],1)},at=[],st=n("aa8a"),it=n("c033"),rt=n("a368"),lt=n("a749"),ct={name:"CapacitorCheck",data(){return{logs:[],filepath:"",forceLogin:Je["a"].state.setting.forceLogin,connectionType:"wifi"}},components:{FollowButton:it["a"],FileSelector:xe["a"]},methods:{log(e,t,...n){this.logs||(this.logs=[]),this.logs.unshift({type:e,value:t}),n.length&&this.logs.unshift({type:e,value:n})},changeForceLogin(e){const t=!this.forceLogin;console.log("vla",e.target.value,this.forceLogin,t),this.forceLogin=t,Je["a"].dispatch("set",{forceLogin:t})},checkHomedir(){G["a"].once("homedir",(e=>this.log("Homedir",e))),G["a"].emit("get-homedir")},checkNetwork(){G["a"].emit("check-network")},onCheckProgress(e){console.log("network check progress",e),this.log(e.type,JSON.stringify(e.result))},onCheckEnd(e){console.log("network check end",e),this.log("isOnline",e.isOnline)},writeClipboard(){const e=Math.random().toString();this.log("Rand string",e),Object(st["b"])(e).then((()=>{this.log("Success",e)})).catch((e=>{this.log("Error",e)}))},async readClipboard(){const e=await Object(st["a"])();e?this.log("Read",e):this.log("Error",e)},onSelectFile(e){this.log("Select file",e,null===e||void 0===e?void 0:e.name,null===e||void 0===e?void 0:e.path,null===e||void 0===e?void 0:e.size)},checkCrypto(){const e=window.crypto;console.log(e),console.log(e.subtle),this.log("subtle",e.subtle),e.subtle&&this.log("digest",typeof e.subtle.digest)},async changeNetworkType(){const e="wifi"===this.connectionType?"cellular":"wifi";Object(lt["a"])({connected:!0,connectionType:e}),await new Promise(setTimeout);const t=await rt["Network"].getStatus();this.connectionType=t.connectionType,this.log("Network status",t)},async checkReadFile(){const e=await rt["Filesystem"].readFile({path:"some-file.txt",directory:rt["Directory"].Documents,encoding:rt["Encoding"].UTF8});this.log("Read",e)},async checkWriteFile(){const e=Math.floor(5e4*Math.random())+12e3;await rt["Filesystem"].writeFile({path:"some-file.txt",data:e.toString(),directory:rt["Directory"].Documents,encoding:rt["Encoding"].UTF8}),this.log("Write",e)},async getFileUri(){this.log("Raw",this.filepath);const e=await rt["Filesystem"].getUri({path:this.filepath});this.log("URI result",e)}},mounted(){G["a"].on("check-network-result",this.onCheckProgress),G["a"].on("check-network-end",this.onCheckEnd),Object(K["a"])()&&rt["Network"].getStatus().then((e=>{this.connectionType=e.connectionType}))},beforeDestroy(){console.log("unmount check"),G["a"].off("check-network-result",this.onCheckProgress),G["a"].off("check-network-end",this.onCheckEnd)},watch:{forceLogin(e){console.log("change",e)}}},dt=ct,ut=(n("b1d8"),Object(h["a"])(dt,ot,at,!1,null,"a7504d8e",null)),ht=ut.exports;g()(ut,"components",{QInput:P["a"],QBtn:p["a"]});var pt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:!e.floating,expression:"!floating"}]},[n("ThemeEditor",{attrs:{inner:!0},on:{show:e.handleShow}})],1)},mt=[],_t={name:"ThemeTabPanel",data(){return{floating:this.$theme.hasFloatingEditor()}},methods:{handleShow(){this.floating=!0,this.$theme.showFloatingEditor({onClose:()=>{this.floating=!1}})}}},ft=_t,gt=Object(h["a"])(ft,pt,mt,!1,null,null,null),bt=gt.exports,yt={name:"Development",components:{BasicPanel:y,ThemeTabPanel:bt,PaymentMode:Ge,AccountTabPanel:q,AmplifyTabPanel:Q,DevInfoTabPanel:te,UrlConvert:le,LibraryData:Ae,LibraryPreload:nt,CapacitorTest:ht},data(){const e=[{name:"BasicPanel",icon:"developer_mode",label:"BasicPanel"},{name:"accountInfo",icon:"account_circle",label:"Account Info"},{name:"amplify",icon:"developer_board",label:"Amplify"},{name:"capacitorTest",icon:"app_settings_alt",label:"Capacitor test"},{name:"devInfo",icon:"info",label:"Dev Info"},{name:"urlConvert",icon:"link",label:"Alphabiz URL Convert"},{name:"libraryData",icon:"video_library",label:"Library"},{name:"libraryPreload",icon:"cloud_download",label:"Library Preload"},{name:"payment_mode",icon:"account_balance_wallet",label:"Payment Mode"},{name:"theme_panel",icon:"palette",label:"Theme Panel"}];return{tabs:e,currentTab:e[0].name,isElectron:Object(l["isElectron"])()}}},vt=yt,wt=(n("5bb9"),n("74cb")),kt=n("ec78"),Ct=n("917f"),$t=n("c72d"),St=Object(h["a"])(vt,o,a,!1,null,null,null);t["default"]=St.exports;g()(St,"components",{QCard:T["a"],QTabs:wt["a"],QTab:kt["a"],QSeparator:m["a"],QTabPanels:Ct["a"],QTabPanel:$t["a"]})},"3a211":function(e,t,n){"use strict";n("10e1")},"3a62":function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"audio-info-container"},[n("p",{staticClass:"info"},[e._v(e._s(e.$t("this_is_an_audio_file")))]),n("img",{attrs:{src:e.icon,alt:"favicon",width:"100px"}})])])},a=[],s={name:"AudioInfo",components:{},props:{show:{type:Boolean}},data(){return{icon:"developer/assets/icon-256.png"}},created(){},mounted(){},computed:{},methods:{}},i=s,r=(n("eb21"),n("2b5f")),l=Object(r["a"])(i,o,a,!1,null,"d5366250",null);t["a"]=l.exports},"3aea":function(e,t,n){"use strict";n.d(t,"h",(function(){return c})),n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return u})),n.d(t,"e",(function(){return h})),n.d(t,"b",(function(){return _})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return g})),n.d(t,"a",(function(){return b}));var o=n("5584"),a=n("d710"),s=n.n(a),i=n("36a1"),r=n("d558"),l=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};function c(e,t){return l(this,void 0,void 0,(function*(){if(Object(r["a"])()){const{Filesystem:o,Directory:a,Encoding:s,Share:i}=yield Promise.resolve().then(n.bind(null,"a368")),r=yield o.writeFile({path:t,data:e,directory:a.Cache,encoding:s.UTF8});return r.uri?(console.log("Save file result",r),(yield i.canShare()).value&&i.share({files:[r.uri],dialogTitle:"Save"}),r):console.log("Failed to save",t)}const o=new Blob([e]),a=document.createElement("a"),s=URL.createObjectURL(o);a.href=s,a.download=t,document.body.appendChild(a),a.click(),setTimeout((function(){document.body.removeChild(a),window.URL.revokeObjectURL(s)}),0)}))}function d(e){return e?new Promise((t=>{const n=new FileReader;n.onload=e=>{var n;t(null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsText(e)})):Promise.resolve("")}function u(e){var t;const n=(null===(t=e.match(/c=IN\sIP\d\s([^\r]+)/))||void 0===t?void 0:t[1])||"",a=e.match(/m=application\s(\d+)\s(\S+)/),s=(null===a||void 0===a?void 0:a[1])||"0",i=(null===a||void 0===a?void 0:a[2])||"unknown type";return o["a"].getters.isDevMode?`${n}:${s} (${i})`:`${n.substring(0,4)+"*"} (${i})`}function h(e){var t;return(null===(t=e.match(/c=IN\sIP\d\s([^\r]+)/))||void 0===t?void 0:t[1])||""}const p=["?","|","*","!",":",'"',":","<",">","/","/"],m=["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"];function _(e){let t=e.replace(/\s*\/\s*/g,"_").replace(/\s*\\\s*/g,"_").replace(/(\s|\.)+$/,"");for(const o of m)while(t.startsWith(o))t=t.replace(o,"");const n=t.split("");for(let o=0;ot.id===e));if(!t)return null;const n=["id","title","soul"].map((e=>{const n=t[e];return e+"="+encodeURIComponent(n)})).join("&");return`/library/channel?${n}`}function g(e){if(!e.startsWith(`${s.a.shortProtocol}`))return null;const[t,n,o]=e.replace(`${s.a.shortProtocol}-library://`,"").split("/");return t&&n&&o?{type:t,title:n,id:o}:null}function b(e){return e?e.replace(/ /g," ").trim():""}},"3b4b":function(e,t,n){"use strict";n("9c3b")},"3c15":function(e,t,n){"use strict";n("eec3")},"3c8a":function(e,t,n){"use strict";n("6755")},"3d18":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return f}));n("de6c"),n("a1c1");const o=n("c577"),a=n("61af"),{exec:s,spawn:i}=n("61af"),r="win32"===e.platform,l="darwin"===e.platform,c=new Map([["VLC Player",{win:"vlc.exe",winRegistry:["VLC.mp4","PlayWithVLC"],drawin:"VLC.app"}],["GOM Player",{win:"GOM.exe",drawin:"GOM Player.app"}],["PotPlayer",{win:"PotPlayerMini64.exe"}],["Kodi",{win:"kodi.exe",drawin:"Kodi.app"}],["KMPlayer",{win:"KMPlayer64.exe",drawin:"KMPlayer.app"}],["SMPlayer",{win:"smplayer.exe",drawin:"SMPlayer.app"}],["MediaMonkey",{win:"MediaMonkey.exe"}],["AllPlayer",{win:"ALLPlayer.exe"}],["5KPlayer",{win:"5KPlayer.exe",drawin:"5KPlayer.app"}],["MPC-HC",{win:"mpc-hc64.exe"}]]),d=async()=>new Promise((e=>{const t=[];if(r){const n={label:"Media Player",value:"Media Player"},s=u();s&&t.push(n);const i=new o({hive:o.HKCU,key:"\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Compatibility Assistant\\Store"});i.values(((n,o)=>{if(n)return e(!1);for(let e=0;e{n.win&&new RegExp(n.win).test(o[e].name)&&(a.existsSync(o[e].name)?t.push({label:s,value:s}):console.log("player file does not exist"))}));e(t)}))}else l?a.readdir("/Applications/",((n,o)=>{if(n)return console.error(`error: ${n}`),e(!1);c.forEach(((e,n)=>{e.drawin&&new RegExp(e.drawin).test(o)&&t.push({label:n,value:n})})),e(t)})):e(!1)})),u=()=>{const t=e.arch;let n;return n="x64"===t?"C:\\Program Files\\Windows Media Player\\wmplayer.exe":"C:\\Program Files(x86)\\Windows Media Player\\wmplayer.exe",a.existsSync(n)?n:""},h=async e=>new Promise((t=>{if(r){if("Media Player"===e){const e=u();return t(e||!1)}const n=new o({hive:o.HKCU,key:"\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Compatibility Assistant\\Store"});n.values(((n,o)=>{if(n)return t(!1);if(!c.get(e))return t(!1);const s=c.get(e).win;for(let e=0;e{let n;if(r){if(!c.get(e))return;const o=c.get(e).winRegistry;if(!o)return;if("VLC Player"===e){const e=t.slice(2+(t.lastIndexOf(".")-1>>>0));o[0]=`VLC.${e}`,n=[...o]}}return n},m=async e=>new Promise((t=>{if(!e)return t(!1);if(r){const n=new o({hive:o.HKLM,key:`\\SOFTWARE\\Classes\\${e[0]}\\shell\\${e[1]}\\command`});n.values(((e,n)=>{if(e)return t(!1);const o=n[0].value.match(/-(?:-\w+)+/gm);t(o)}))}})),_=async(e,t,n)=>new Promise((o=>{let a,s;r?(a=e,s=n?[...n,t.replace("/","\\")]:[t.replace("/","\\")]):(a="open",s=["-a",e,t]),console.log("openPlayer:",a,s);const l=i(a,[...s]);l.on("error",(e=>{o(!1),console.log(`子进程错误,错误码 ${e}`)})),l.unref(),o(!0)})),f=async(e,t)=>{if("System Default"===e){const{shell:e}=n("b052");return e.openPath(t).catch((e=>{console.log("openPath err",e)}))}const o=await h(e);let a=!1;if(o){const n=p(e,t);let s;n&&(s=await m(n)),a=await _(o,t,s),console.log("openPlayer:"+a)}return a}}).call(this,n("28d0"))},"3d7e":function(e,t,n){"use strict";n("b36a")},"3e69":function(e,t,n){},"3fc8":function(e,t,n){"use strict";n("0c2f")},4:function(e,t){},4027:function(e,t,n){"use strict";(function(e){var o=n("7ca3"),a=n.n(o),s=(n("de6c"),n("a1c1"),n("d4b5"),n("c581")),i=n("af04"),r=n("c228"),l=n("072b");const c=Object.values((()=>{const e={};Object.values(r["a"]).forEach((t=>{t.phones.forEach((n=>{const[o,a]=n.split("-");e[n]={value:n,label:`${t.name} (+${o})`,emoji:t.emoji,prefixCode:o,countryCode:a,normalizedName:t.normalizedName,nativeName:t.name}}))}));const t=Object.keys(e).sort(((t,n)=>{const o=parseInt(e[t].prefixCode),a=parseInt(e[n].prefixCode);return o===a?1===o?"US"===e[t].countryCode?-1:"US"===e[n].countryCode?1:0:0:o>a?1:-1}));return t.reduce(((t,n)=>(t[n]=e[n],t)),{})})());class d extends s["b"]{static createConfigs(e){return{GENERAL:["",{type:"text",icon:"account_box",label:"account_username_email_phone"}],PHONE_NUMBER:[["86","","CN"],{type:"tel",icon:"phone",label:"account_phone_number",rules:[l["e"].bind(e)]}]}}constructor(e){super(...d.createConfigs(e).GENERAL),this.currentMode="GENERAL",this.configs=d.createConfigs(e)}setMode(e,t){if(this.currentMode===e)return this;this.currentMode=e;const n=this.configs[e];return this.model=n[0],this.attrs=n[1],t&&this.updateModel(t),this}}class u extends s["a"]{constructor(e,t){if(super({username:new d(e)}),this.assumeData=u.storage.getAssumeData(),!this.assumeData){var n;const e=null!==(n=r["b"][t])&&void 0!==n?n:r["b"]["en-us"],[o,a]=e.phones[0].split("-");this.assumeData={prefix:o,code:a}}this.assume=!1}get formData(){const e=super.formData;if(!e.username)return e;let t=e.username;return(()=>{this.assume=!1,Array.isArray(t)?(u.storage.setAssumeData({prefix:t[0],code:t[2]}),this.assumeData=u.storage.getAssumeData(),t="+"+t[0]+t[1]):!t.startsWith("+")&&/^[0-9]*$|^$/g.test(t)&&(/^00/.test(this.model)?t=t.replace(/^00/,"+"):(this.assume=!0,t="+"+this.assumeData.prefix+t))})(),e.username=t,e}turnToPhoneNumberMode(){if("GENERAL"!==this.currentMode)return;this.assume=!1;const e=this.items.username.value,{prefix:t,code:n}=this.assumeData;this.items.username.setMode("PHONE_NUMBER",[t,e,n])}backToGeneralMode(){if("GENERAL"===this.currentMode)return;const[e,t]=this.items.username.value;console.log("Remove prefix",e,t),this.assume=!1,this.items.username.setMode("GENERAL",t)}get currentMode(){return this.items.username.currentMode}}a()(u,"storage",{setAssumeData(e){window.localStorage.setItem("sign_in_assume_data",JSON.stringify(e))},getAssumeData(){const e=window.localStorage.getItem("sign_in_assume_data");return e?JSON.parse(e):null}}),t["a"]={name:"ForgotPassword",props:{scope:Object},data(){const e=e=>e===this.submitForm.items.password.model||"account_password_not_equal";return{resendInterval:null,resendTimer:0,progress:0,searchForm:new u(this,this.$q.lang.getLocale().toLowerCase()),submitForm:new s["a"]({code:new s["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[l["h"].bind(this)]}),password:new s["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[l["d"].bind(this)]}),reEnterPassword:new s["b"]("",{type:"password",icon:"lock",label:"account_re_enter_password",rules:[l["d"].bind(this),e]})})}},watch:{progress(e){e<0&&this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut")},resendTimer(e,t){0===t&&(this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=setInterval((()=>{0!==this.resendTimer?this.resendTimer-=1:(clearInterval(this.resendInterval),this.resendInterval=null)}),1e3))}},computed:{verifyDescription(){return this.$store.state.account.verification?{email:`${this.$t("account_email_sent_tip")}${this.$store.state.account.verification.destination}`,phone_number:`${this.$t("account_phone_sent_tip")}${this.$store.state.account.verification.destination}`}[this.$store.state.account.verification.type]:this.$t("account_tip_verified")}},methods:{handleCancel(){0===e&&"PHONE_NUMBER"===this.searchForm.currentMode?this.form.backToGeneralMode():this.progress-=1},async handleSearch(){try{const e=this.searchForm.formData;await this.$store.dispatch("ACCOUNT_FORGOT_PASSWORD_SEND",e.username),this.resendTimer=60,0===this.progress?this.progress+=1:i["a"].showPositive("code_has_been_resent")}catch(e){i["a"].showNegative(e.message),this.searchForm.assume&&this.searchForm.turnToPhoneNumberMode()}},async handleSubmit(){try{const e=this.submitForm.formData;await this.$store.dispatch("ACCOUNT_FORGOT_PASSWORD_SUBMIT",e),i["a"].showPositive("password_has_been_reset"),this.progress=-1}catch(e){i["a"].showNegative(e.message)}},onInput(e){const t=this.searchForm.items.username.currentMode;let n=this.searchForm.items.username.model;if("GENERAL"===t){if(Array.isArray(n)&&(n=n[1]||""),n&&/^\d+$/g.test(n)&&this.searchForm.turnToPhoneNumberMode(),n&&/^\+\d+$/.test(n)){const e=n.substring(1),t=c.find((t=>e.startsWith(t.prefixCode)));if(t){const{prefixCode:n,countryCode:o}=t,a=e.replace(n,""),s=[n,a,o];this.searchForm.turnToPhoneNumberMode(),this.$nextTick((()=>{console.log("To Phone With",s),this.searchForm.items.username.updateModel(s)}))}else console.log(`Cannot find ${e} as prefix`)}}else"PHONE_NUMBER"===t&&(n=this.searchForm.items.username.model[1]||"",(n.includes("@")||n.startsWith("+"))&&this.searchForm.backToGeneralMode())},onPressBack(){const e=this.searchForm.items.username.model;if(Array.isArray(e)){const t=e[1]||"";this.$nextTick((()=>{this.searchForm.items.username.updateModel(t)}))}this.searchForm.backToGeneralMode()}},beforeDestroy(){this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=null}}}).call(this,n("28d0"))},"41c7":function(e,t){e.exports={mode:"committee",admins:["FQi3UfsB5zY7SSfLMPdl9Fdh7_EeM4og0ZGivp4tfJU.yXhvCAmmUz1Pw9-Iwhf9hpo9-H4WDHwezzRAGE5Oipk","an_id_of_admin","an_id_of_other_admin"]}},4544:function(e,t,n){},"46a2":function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],attrs:{id:"video-splash"}},[n("div",{staticClass:"loading"},[n("q-circular-progress",{staticClass:"q-ma-md",attrs:{indeterminate:"",size:"24px",color:"warning"}}),n("p",[e._v(e._s(e.videoLoadingHint))])],1)])])},a=[],s={name:"VideoSplash",props:{show:{type:Boolean},videoLoadingHint:{type:String}},data(){return{}},created(){},mounted(){},computed:{},methods:{}},i=s,r=(n("e0e1"),n("2b5f")),l=n("64e7"),c=n("09a4"),d=n.n(c),u=Object(r["a"])(i,o,a,!1,null,"bcdd35fc",null);t["a"]=u.exports;d()(u,"components",{QCircularProgress:l["a"]})},"472b":function(e,t,n){"use strict";n("6e85")},"47fc":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));n("a1c1");const o=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"macOS",r:/Mac OS X/},{s:"UNIX",r:/UNIX/}];let a="unknown",s=()=>{};const i=new Promise((e=>s=e));function r(){const e="Unknown";let t=e;if(screen){const e=screen.width||"",n=screen.height||"";t=e+" x "+n}const n=navigator.appVersion,s=navigator.userAgent;let r,l,c,d=navigator.appName,u=""+parseFloat(navigator.appVersion),h=parseInt(navigator.appVersion,10);-1!==(l=s.indexOf("Opera"))&&(d="Opera",u=s.substring(l+6),-1!==(l=s.indexOf("Version"))&&(u=s.substring(l+8))),-1!==(l=s.indexOf("Electron"))?(d="Electron",u=s.substring(l+9)):-1!==(l=s.indexOf("OPR"))?(d="Opera",u=s.substring(l+4)):-1!==(l=s.indexOf("Edge"))?(d="Microsoft Legacy Edge",u=s.substring(l+5)):-1!==(l=s.indexOf("Edg"))?(d="Microsoft Edge",u=s.substring(l+4)):-1!==(l=s.indexOf("MSIE"))?(d="Microsoft Internet Explorer",u=s.substring(l+5)):-1!==(l=s.indexOf("Chrome"))?(d="Chrome",u=s.substring(l+7)):-1!==(l=s.indexOf("Safari"))?(d="Safari",u=s.substring(l+7),-1!==(l=s.indexOf("Version"))&&(u=s.substring(l+8))):-1!==(l=s.indexOf("Firefox"))?(d="Firefox",u=s.substring(l+8)):-1!==s.indexOf("Trident/")?(d="Microsoft Internet Explorer",u=s.substring(s.indexOf("rv:")+3)):(r=s.lastIndexOf(" ")+1)<(l=s.lastIndexOf("/"))&&(d=s.substring(r,l),u=s.substring(l+1),d.toLowerCase()===d.toUpperCase()&&(d=navigator.appName)),-1!==(c=u.indexOf(";"))&&(u=u.substring(0,c)),-1!==(c=u.indexOf(" "))&&(u=u.substring(0,c)),-1!==(c=u.indexOf(")"))&&(u=u.substring(0,c)),h=parseInt(""+u,10),isNaN(h)&&(u=""+parseFloat(navigator.appVersion),h=parseInt(navigator.appVersion,10));const p=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(n),m=navigator.cookieEnabled;let _=e;for(const a in o){const e=o[a];if(e.r.test(s)){_=e.s;break}}let f=e;switch(/Windows/.test(_)&&(f=/Windows (.*)/.exec(_)[1],_="Windows"),_){case"macOS":case"Android":f=/(?:Android|Mac OS|Mac OS X|MacIntel) ([._\d]+)/.exec(s)[1],f=f.replace(/_/g,".");break;case"iOS":f=/OS (\d+)_(\d+)_?(\d+)?/.exec(n),f=f[1]+"."+f[2]+"."+(f[3]||0);break}console.log("getSystemInfo");const g={screen:t,os:_,browser:d,osVersion:f,browserVersion:u,browserMajorVersion:h,mobile:p,cookies:m,arch:a};return i.then((()=>{g.arch=a})),g}"userAgentData"in navigator&&(console.log("Init userAgentData"),navigator.userAgentData.getHighEntropyValues(["architecture","bitness"]).then((({architecture:e,bitness:t})=>{console.log("Navigator userAgentData",e,t),"string"===typeof e&&(a=e),"string"===typeof t&&(a.includes("arm")?a+=t:a+="_"+t),s(a)})))},"4b8c":function(e,t,n){"use strict";n("80f4")},"4d52":function(e,t,n){"use strict";(function(e){n("d4b5"),n("de6c"),n("a1c1"),n("7a76");var o=n("fb31");const a={type:"03",prefix:o["shortProtocol"]+"-blockchain"},s={encode:t=>e.from(t,"utf-8").toString("hex"),decode:t=>e.from(t,"hex").toString("utf-8")},i={encode:t=>e.from(t,"utf-8").toString("base64"),decode:t=>e.from(t,"base64").toString("utf-8")},r={stringifyProtocolObject(e){const t=JSON.parse(s.decode(e.hash)),n=e.data,o={to_address:t.to_address,coin_type:n.coin_type,amount:n.amount,expiration:n.expiration},a=i.encode(JSON.stringify(o));return[t.action,a].join("/")},parseProtocolObject(e){const t=`Transfer to ${e.to_address.substr(2,10)}`,n=JSON.stringify({action:"transfer",to_address:e.to_address}),o={};return["coin_type","amount","expiration"].forEach((t=>{o[t]=e[t]})),{name:t,id:n,data:o}}},l={transfer:r},c=e=>{if(!e.startsWith(`${a.prefix}://`))return null;const[t,n]=e.replace(`${a.prefix}://`,"").split("/");if(!l[t])throw new Error("Unexpected action: "+t);const o=JSON.parse(i.decode(n));return{action:t,actionArgs:o}},d=(e,t)=>{const n=i.encode(JSON.stringify(t));return`${a.prefix}://${[e,n].join("/")}`};t["a"]={config:a,parseAction:c,stringifyAction:d,fromObject(e){if(e.protocolType!==a.type)return null;const{action:t}=JSON.parse(s.decode(e.hash));if(!l[t])throw new Error("Unexpected action: "+t);return`${a.prefix}://${l[t].stringifyProtocolObject(e)}`},toObject(e){const{action:t,actionArgs:n}=c(e),{name:o,id:i,data:r}=l[t].parseProtocolObject(n);return{protocolType:a.type,name:encodeURIComponent(o),hash:s.encode(i),data:r}}}}).call(this,n("eb72").Buffer)},"4d62":function(e,t,n){},"4d89":function(e,t,n){"use strict";n("c294")},"4dbc":function(e,t,n){"use strict";n("fe8f")},"4eaf":function(e,t,n){},"4ec4":function(e,t,n){"use strict";n("cb96")},"4fd2":function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return d}));n("de6c"),n("a1c1");const o=n("d310").isElectron(),a=new Map,s=e=>{if(!o)return!1;if("string"!==typeof e)return!1;if(a.has(e))return a.get(e);const t=n("61af");return!!t.existsSync(e)&&(a.set(e,t.statSync(e).isDirectory()),a.get(e))},i=["mp3","wav","aac","flac","m4a","wma"],r=["mp4","mkv","flv","avi","mov","wmv","rmvb","flv","webm"],l=e=>i.includes(e),c=e=>r.includes(e);function d(e){const t=e.replace(/\.downloading$/,"").match(/\.[^.]+?$/);if(!t)return!1;const n=t[0].slice(1);if(!n.length)return!1;const o=i.includes(n.toLowerCase())||r.includes(n.toLowerCase());return!!o&&!s(e)}},5:function(e,t){},"508e":function(e,t){const n=["udp://open.tracker.cl:1337/announce","udp://tracker.opentrackr.org:1337/announce","udp://9.rarbg.com:2810/announce","udp://tracker.openbittorrent.com:6969/announce","udp://exodus.desync.com:6969/announce","udp://www.torrent.eu.org:451/announce","udp://tracker1.bt.moack.co.kr:80/announce","udp://tracker.zerobytes.xyz:1337/announce","udp://tracker.torrent.eu.org:451/announce","udp://tracker.theoks.net:6969/announce","udp://tracker.srv00.com:6969/announce","udp://tracker.pomf.se:80/announce","udp://tracker.ololosh.space:6969/announce","udp://tracker.monitorit4.me:6969/announce","udp://tracker.moeking.me:6969/announce","udp://tracker.lelux.fi:6969/announce","udp://tracker.jordan.im:6969/announce","udp://tracker-udp.gbitt.info:80/announce","udp://retracker.sevstar.net:2710/announce","udp://retracker.netbynet.ru:2710/announce","udp://186.10.181.71:1337/announce","udp://93.158.213.92:1337/announce","udp://151.80.120.113:2810/announce","udp://45.154.253.6:6969/announce","udp://208.83.20.20:6969/announce","udp://91.216.110.52:451/announce","udp://156.234.201.18:80/announce","udp://62.210.217.207:1337/announce","udp://89.234.156.205:451/announce","udp://209.141.59.16:6969/announce","udp://62.109.31.95:6969/announce","udp://65.108.63.133:80/announce","udp://93.104.214.40:6969/announce","udp://163.172.170.127:6969/announce","udp://95.217.161.135:6969/announce","udp://213.108.105.23:6969/announce","udp://109.72.83.209:80/announce","udp://78.30.254.12:2710/announce","udp://212.1.226.176:2710/announce","udp://tracker.leechers-paradise.org:6969","udp://tracker.coppersurfer.tk:6969","udp://tracker.opentrackr.org:1337","udp://explodie.org:6969","udp://tracker.empire-js.us:1337","wss://tracker.btorrent.xyz","wss://tracker.openwebtorrent.com"],o=e=>n.indexOf(e),a=e=>n[e];e.exports={getTrackerById:a,getIdByTracker:o,trackerList:n}},"50de":function(e,t,n){"use strict";n("bba7")},"512b":function(e,t,n){},"525c":function(e,t,n){},"536e":function(e,t,n){"use strict";n("a5d3")},5415:function(e,t,n){"use strict";n("512b")},5515:function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return v}));n("de6c"),n("d4b5"),n("4db2"),n("a1c1");var o=n("2d62"),a=n("d7df"),s=n("d710"),i=n("ddf9"),r=n("c49d");const l=window.requestIdleCallback?window.requestIdleCallback:e=>setTimeout(e,100),c=(e="",t={})=>{if(e.startsWith("ab-")||e.startsWith(s["appName"].toLowerCase()))return!1;if(!e.startsWith("~"))return!0;if(e.startsWith("~@"))return 42!==e.length;const n=e.split("/");if(1===n.length){const[e,o]=n[0].split(".");if(!e||!o)return!0;if(e.length<40||o.length<40)return!0;const a=Object.keys(t);return a.some((e=>!["_","alias","auth","pub","epub","profile","follow","channels","blockChannels","blockUsers","takedowns"].includes(e)))}const o=n[1];if(!["follow","profile","channels","takedowns"].includes(o))return!0;const a=n[2]?[n[2]]:Object.keys(t);return"profile"===o?a.some((e=>!["_","#",">","avatar","description","name","id","blockChannels","blockUsers"].includes(e))):"follow"===o?a.some((e=>!(!e.match(/[^.]{43}\.[^.]{43}/)||e.includes("channels")))):Object.values(t).some((e=>"string"===typeof e&&e.includes("data:image")))},d=(e,t)=>{for(const i in t){const e=t[i];if("string"===typeof e&&e.includes("data:image"))return[]}const n=[],o=t._;if(!o||!o["#"]||!o[">"])return[];let a={[e]:{_:{"#":o["#"],">":{}}}},s=0;for(const i in t){if("_"===i)continue;const r=t[i];if("string"===typeof r&&r.includes("data:image"))return[];a[e][i]=r,s+=(JSON.stringify(r).length||0)+i.length,a[e]._[">"][i]=o[">"][i],s>1e4&&(n.push(a),s=0,a={[e]:{_:{"#":o["#"],">":{}}}})}return Object.keys(a).length&&n.push(a),n},u=(e,t,n)=>{if(e[t]){const o=e[t];e[t]=(...e)=>{o(...e),n(...e)}}else e[t]=n},h={timer:null,pending:!1,last:Date.now(),lastSize:0},p=async()=>{if(h.pending)return;const e=o["v"]._.graph;console.time("saveGraph"),h.pending=!0,h.last=Date.now();const t=Object.keys(e);if(h.lastSize>t.length)return console.log("Skip saving library");h.lastSize=t.length,console.log("start sending splice graph",t.length);let n=Object.create(null);a["a"].emit("save-library-db-start");for(const o of t){const t=e[o];if(!t)continue;if(c(o,t))continue;n[o]=t;const s=JSON.stringify(n);s.length>5e4&&(await new Promise((e=>l((()=>{a["a"].emit("save-library-db-partial",n),e()})))),n=Object.create(null))}Object.keys(n).length&&a["a"].emit("save-library-db-partial",n),l((()=>{a["a"].emit("save-library-db-end"),h.pending=!1,h.last=Date.now(),Object(r["a"])("Save partials",(new Date).toLocaleString()),console.timeEnd("saveGraph")}))},m=()=>{if(clearTimeout(h.timer),Date.now()-h.last>6e5)return p();h.timer=setTimeout(p,6e4)},_={};Object.defineProperty(window,"wrtcPeers",{get(){return _}}),Object.defineProperty(window,"saveGraph",{get(){return m}});let f=null;const g=async e=>{const t=f;return f=new Promise((n=>{const o=()=>{const t=e();t instanceof Promise?t.then(n):l((()=>n(t)))};t instanceof Promise?t.then(o):o()})),f};function b(t){const n=Object(i["a"])()?2:5;if(Object.keys(_).length>n)return Object(r["d"])(),void(t._destroy&&t._destroy(null,(()=>{})));const a=t.wire;if(!a)return;const s=o["v"]._.root;if(t.syncState="waiting",t.remoteSyncState="waiting",_[t.id]&&"open"===_[t.id].wire.readyState)return;_[t.id]=t;let l=!1;t.downloaded=0,t.uploaded=0,t.downloadSpeed=0,t.uploadSpeed=0;const h={time:Date.now(),downloaded:0,uploaded:0},p=setInterval((()=>{if(l)return clearInterval(p);const e=Date.now(),n=e-h.time;t.downloadSpeed=Math.floor((t.downloaded-h.downloaded)/n*1e3),t.uploadSpeed=Math.floor((t.uploaded-h.uploaded)/n*1e3),h.time=e,h.downloaded=t.downloaded,h.uploaded=t.uploaded}),1e3),f=async(e="")=>(a.bufferedAmount>a.bufferedAmountLowThreshold&&await new Promise((e=>{a.onbufferedamountlow=e})),g((()=>{"open"===a.readyState?(t.uploaded+=e.length,a.send(e)):l=!0}))),b=()=>{if(!s.graph)return setTimeout(b,5e3);let e=-1;for(const n in s.graph){var t;const o=s.graph[n],a=null===o||void 0===o||null===(t=o._)||void 0===t?void 0:t[">"];a&&a>e&&(e=a)}f("ABINFO"+JSON.stringify({timestamp:e}))};b(),t.lastUpdate=-1,t.syncTimer=null;const y=async()=>{if(l)return;if(t.syncTimer&&clearTimeout(t.syncTimer),!s.graph)return void(t.syncTimer=setTimeout(y,5e3));t.syncState="syncing";const e=Object.keys(s.graph);for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}let n=Object.create(null);const o=Date.now();let i=0,u=0;for(const m of e){if("open"!==a.readyState){"connecting"!==a.readyState&&(delete _[t.id],l=!0,t.close(),t._destroy&&t._destroy(null,(()=>{})),Object.keys(_).length<5&&Object(r["c"])());break}i++;const e=s.graph[m];if(!e)continue;if(e._&&e._[">"]){const n=Object.values(e._[">"]);if(n.every((e=>e5e4){const t=d(m,e);if(!t.length)continue;window.verb&&Object(r["a"])("SPLICES",t,JSON.stringify(e).length);for(const e of t)await f("ABSYNC"+JSON.stringify(e)),u++;continue}n[m]=e;const o="ABSYNC"+JSON.stringify(n);if(o.length>5e4&&(await f(o),u++,n=Object.create(null)),l)return}Object.keys(n).length&&u++,u&&(t.lastUpdate=o,m(),Object(r["a"])("Synced",i,"items to",t.id));const h=Object.keys(n).length?JSON.stringify(n):"{}",p="ABSYNC!"+h;"open"===a.readyState&&f(p),t.syncState="completed",t.syncTimer=setTimeout(y,1e4)};return u(a,"onclose",(function(){l=!0,delete _[t.id],clearTimeout(t.syncTimer),Object.keys(_).length<5&&Object(r["c"])()})),u(a,"onerror",(function(){l=!0,delete _[t.id],clearTimeout(t.syncTimer),Object.keys(_).length<5&&Object(r["c"])()})),u(a,"onmessage",(function(n){if(!n)return;let a=n.data;if("string"!==typeof a&&(a instanceof ArrayBuffer?a=e.from(a).toString("utf-8"):(Object(r["a"])("unknown data",typeof a,a),a=a.toString())),a)if(a.startsWith("ABSYNC")){t.downloaded+=a.length,a.startsWith("ABSYNC!")?(t.remoteSyncState="completed",m()):t.remoteSyncState="syncing";try{if("ABSYNC!{}"===a)return;const e=JSON.parse(a.replace(/ABSYNC(!?)/,"")),t={put:e,_:function(){},$:o["v"]};g((()=>s.on.put(t)))}catch(i){Object(r["a"])("put error",i,a)}}else if(a.startsWith("ABINFO")){const e=JSON.parse(a.substring(6));e.timestamp&&(t.lastUpdate=e.timestamp,y())}})),u(t,"ondatachannel",(function(e){const t=e.channel;t.onmessage=a.onmessage,t.onopen=a.onopen,t.onclose=a.onclose})),t}function y(e){if(_[e.id])return;const t=e._pc;return t.id=e.id,t.wire=e._channel,t._from="tracker",e.on("error",(e=>window.verb&&Object(r["a"])("peer error",e))),t._destroy=()=>{e._destroy&&e._destroy(null,(()=>{}))},b(t)}async function v(e){let t=Object.create(null),n=0;const a=Object.keys(e);for(const s of a)if(n++,t[s]=e[s],n>300||n===a.length){const e={...t},s={put:e,_:function(){},$:o["v"]};if(await g((()=>o["v"]._.root.on.put(s))),n===a.length){for(const e in _)_[e].lastUpdate=-1;Object(r["a"])(`Put ${a.length} items from local db`)}else await new Promise((e=>l(e)));t=Object.create(null)}}o["v"]._.opt.onWrtcPeer=function(e){return e._from="gun",b(e)},t["a"]=y,setInterval((()=>{Object.keys(_).length>=5||o["v"]._.opt&&"function"===typeof o["v"]._.opt.announce&&o["v"]._.opt.announce()}),6e4)}).call(this,n("eb72").Buffer)},5584:function(e,t,n){"use strict";(function(e){var o=n("ff9b"),a=n("358c"),s=n("79e7"),i=n("d310"),r=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};o["a"].use(a["a"]);const l=new a["a"].Store({modules:s["a"],strict:!1});t["a"]=l,Object.defineProperty(e,"vuex",{get(){return l}});const c=e=>["us"].includes(e.toLowerCase());if(Object(i["isElectron"])()){const{ipcRenderer:t}=n("b052");t.on("app-init",(()=>r(void 0,void 0,void 0,(function*(){const t=e["require"]("geoip-country"),n=yield(yield fetch("https://api.ipify.org")).text(),o=t.lookup(n);o&&(console.log("Init user with ip",n,o),c(o.country)&&(console.log(`User country: ${o.country}. Enable secure.'`),l.dispatch("set",{secureOption:"enable"})))}))))}}).call(this,n("0ee4"))},"55e6":function(e,t,n){"use strict";n("0336")},5653:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return y}));n("de6c"),n("a1c1"),n("dc89"),n("2425"),n("d4b5");var o=n("eb7a"),a=n("d6ab"),s=n("5fc6"),i=n("4fd2"),r=n("3d18"),l=n("5584"),c=n("e3c7"),d=n("46a2"),u=n("3a62"),h=n("00dd"),p=n("d710"),m=n.n(p),_=n("908d"),f=n("d558");const g=n("d310").isElectron();window.videojs=o["default"],n("4b37"),n("94ce"),n("63f2");const b=m.a.fileName,y={toggleSplash(){},updatePlayer(){}};t["a"]={name:"Player",inject:["rootApp","io"],components:{VideoSplash:d["a"],AudioInfo:u["a"],AdvancedOptions:h["a"]},data(){return{player:null,playerOptions:{fill:!1,autoplay:!0,responsive:!0,fluid:!0,preload:"auto",controls:!0,controlBar:{volumePanel:{inline:!1}}},subsBtn:null,progress:[],fileName:"",playerLang:"",playerCacheTime:0,showSplash:!1,videoLoadingHint:"",showAdvancedOptions:!1,isUpdateSubtitle:"",isAudio:!1,isPause:!1}},created(){this.initVideoComponent(),this.playerLang=l["a"].state.setting.language,this.playerCacheTime=l["a"].state.setting.videoCacheTime,window.addEventListener("error",(e=>{console.log("Uncaught global error",e.message,"\nThis has no effect to app and can be ignore")})),g&&(c["ipcRenderer"].once("ask-for-player",(()=>{this.$q.notify({message:this.$t("not_default_player"),actions:[{label:this.$t("dont_show_again"),textColor:"warning",handler:()=>{l["a"].dispatch("set",{dontAskForPlayer:!0})}},{label:this.$t("go_to_settings"),textColor:"warning",handler:()=>{this.$router.push("/basicSetting")}}]}),l["a"].dispatch("set",{dontAskForPlayer:!0})})),this.$root.$on("pause-player-before-close",(()=>{this.player&&(this.isPause=!0,l["a"].state.video.currentVideo.pipStatus&&this.player&&this.player.exitPictureInPicture(),l["a"].state.video.currentVideo.status&&this.player&&this.player.pause())})));for(const e in y)"function"===typeof this[e]&&(y[e]=(...t)=>this[e](...t))},mounted(){console.log("player mounted"),this.loadPlayer(!0)},async activated(){if(this.playerLang!==l["a"].state.setting.language&&(this.playerLang=l["a"].state.setting.language,this.languageChange()),this.playerCacheTime!==l["a"].state.setting.videoCacheTime){console.log("videoCacheTime change",l["a"].state.setting.videoCacheTime),this.playerCacheTime=l["a"].state.setting.videoCacheTime;const e=this.updateCacheRate(l["a"].state.setting.videoCacheTime);if(e){this.updateSrc(l["a"].state.video.currentVideo.url,{clearSubtitle:!1,clearProgress:!1}),this.player.currentTime(l["a"].state.video.currentVideo.currentTime);const e=l["a"].state.video.currentVideo.currentTime/this.player.duration(),t=document.querySelector(".vjs-play-progress");t&&setTimeout((()=>{t.style.width=100*e+"%"}),500)}}if(g||Object(f["a"])()){if(l["a"].state.video.currentVideo.remotePlay){this.isUpdateSubtitle="",this.isPause=!1,this.loadPlayer(!0),this.toggleSplash(!0),this.player.bigPlayButton.hide();const t=setTimeout((()=>{this.videoLoadingHint=this.$t("playing_timeout_hint")}),18e4);c["ipcRenderer"].send("get-stream-address"),c["ipcRenderer"].once("stream-address",((n,o)=>{console.log("got stream address",o),this.toggleSplash(!1),clearTimeout(t);let{address:a,filepath:s}=o;console.log("Stream play, try update player.src",o,"address",a,"filepath",s),s||(s="win32"===e.platform?decodeURI(a).replace("play:///","").replace(/\//g,"\\"):decodeURI(a).replace("play://","")),l["a"].dispatch("currentVideoUrl",a),l["a"].dispatch("currentVideoPath",s),l["a"].dispatch("currentVideoCurrentTime",0);try{this.updateSrc(a),this.isPause?(setTimeout((()=>{this.player.pause()}),1e3),this.isPause=!1):this.player.play(),this.player.readyState()&&l["a"].dispatch("resetRemotePlay"),this.clearOldSubtitle(),this.addSubtitle(s),this.changeSubtitleForLang()}catch(n){console.log("src err",n),l["a"].dispatch("resetRemotePlay")}}))}l["a"].state.video.currentVideo.url||l["a"].state.video.currentVideo.infoHash||this.loadPlayer(!0),c["ipcRenderer"].on("pause-player",(()=>{this.player&&(this.isPause=!0,l["a"].state.video.currentVideo.pipStatus&&this.player&&this.player.exitPictureInPicture(),l["a"].state.video.currentVideo.status&&this.player&&this.player.pause())}))}else l["a"].state.video.currentVideo.url!==this.player.src()&&console.log("url changed",l["a"].state.video.currentVideo.url,this.player.src());this.io.on("server_progress",(e=>{var t;if("/player"!==this.$router.currentRoute.path)return;if(!this.player&&!this.player.readyState())return;if(null===(t=l["a"].state.video.currentVideo)||void 0===t||!t.url)return;const n=e.find((e=>{var t;return null===(t=l["a"].state.video.currentVideo)||void 0===t?void 0:t.url.includes(e.name)}));if(n&&n.progress){const e=[],t=n.progress.length;let o=n.progress[0],a=1;for(let s=1;s{this.isUpdateSubtitle||(this.isUpdateSubtitle=e,console.log("update_subtitleList!!!",e,"path:",l["a"].state.video.currentVideo.path,t))})),this.io.on("clear_player",(e=>{const t=l["a"].state.video.currentVideo.url;if(l["a"].state.video.currentVideo.infoHash!==e.infoHash)return;const n=/^http/gm.test(t),o=/^play:\/\//gm.test(t);o&&"paused"===e.status||(n||o)&&(console.log("is",n,o),l["a"].state.video.currentVideo.pipStatus&&this.player.exitPictureInPicture(),l["a"].dispatch("resetPlayer"),this.$destroy(),setTimeout((()=>{console.log("timeout",n,o),this.$router.push("/player");try{this.loadPlayer(!0)}catch(e){console.log("Failed to force load player. This will not go wrong.",e.message||e)}n&&this.$q.notify(this.$t("stop_stream_player")),o&&this.$q.notify(this.$t("stop_player"))}),500))}))},beforeDestroy(){this&&this.player&&this.player.dispose()},computed:{lang(){const e=l["a"].state.setting.language?l["a"].state.setting.language:"en-US";return this.player&&this.player.language(e),e},settings(){const e=l["a"].state.setting;return{defaultVideoPlayer:e.defaultVideoPlayer,language:e.language}},advancedOpt(){let e=l["a"].state.video.currentVideo.path;const t=l["a"].state.video.currentVideo.url;t&&t.startsWith("play://")&&(e=decodeURI(t).replace("play:///",""));const n=e?e.replace(/^.*[\\\/]/,""):this.fileName;return[{name:this.$t("title"),value:decodeURIComponent(n).replace("\\","")},{name:this.$t("location"),value:e},{name:this.$t("subtitle_file"),value:l["a"].state.video.currentVideo.subtitleList}]}},watch:{"$store.state.video.currentVideo.updatePlayer"(e,t){console.log("watch updatePlayer:",e),e&&e!==t&&(console.log("need update player"),l["a"].dispatch("updatePlayer",!1),this.updatePlayer(l["a"].state.video.currentVideo.url))}},methods:{toggleSplash(e,t=""){this.showSplash=e,this.videoLoadingHint=t},toggleAudio(e){this.isAudio=e},toggleAdvancedOptions(e){this.showAdvancedOptions=e},openFile(){console.log("click",this.$refs.file),this.$refs.file.click()},bigPlayBtnOpenFile(){const e=document.querySelector("#my-video video").src;console.log("bigPlayBtn",e),e?this.player.play():this.openFile()},async languageChange(){this.player&&(this.player.language(this.lang),this.updateComponentText(),l["a"].state.video.currentVideo.url&&await this.loadPlayer(!0))},manualAddFile(e){console.log("Open Media File: "+e.target.files[0]),0!==e.target.files.length&&(e.target.files[0].path&&l["a"].dispatch("currentVideoPath",e.target.files[0].path),this.updatePlayer(e.target.files[0]),setTimeout((()=>{this.$refs.file.value=null}),500))},async manualAddSubtitle(e){const t=e.target.files;if(!t.length)return;const n=t[0],o=this.player.textTracks(),a=await this.addSubtitle(n,n.name);console.log("manualAddSubtitle",n,n.name,a);let s=-1;setTimeout((()=>{for(let e=0;e`,this.updateTitle=function(e){this.el_.innerHTML=``}}})),o["default"].registerComponent("SubsButton",o["default"].extend(e,{constructor:function(){e.apply(this,arguments);const t=arguments[1];this._text=t.text||"Add subtitles...",this.el_.innerHTML=``,this.updateTitle=function(e){this.el_.innerHTML=``}}})),o["default"].registerComponent("AddSubButton",o["default"].extend(t,{constructor:function(){t.apply(this,arguments);const e=arguments[1];this._text=e.text||"Add subtitles...",this.el_.innerHTML+=`${this._text}`}})),o["default"].registerComponent("AdvancedOptionsButton",o["default"].extend(e,{constructor:function(){e.apply(this,arguments);const t=arguments[1];this._text=t.text||"Advanced Options",this.el_.innerHTML=``,this.updateTitle=function(e){this.el_.innerHTML=``}}}));const n=o["default"].getComponent("SeekBar");n.prototype.getPercent=function(){const e=this.player_.currentTime(),t=e/this.player_.duration();return t>=1?1:t},n.prototype.handleMouseMove=function(e){let t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t),this.update()}},addControlBarComponent(){const e=this.player.controlBar.addChild("FileButton",{text:this.$t("open_file")},1),t=_["b"].is.mobile?"touchend":"click";e.on(t,this.openFile),this.subsBtn=this.player.controlBar.addChild("SubsButton",{text:this.$t("add_subtitles")+"..."},14),this.subsBtn.on(t,(()=>this.$refs.subtitle.click()));const n=this.player.controlBar.addChild("AdvancedOptionsButton",{text:this.$t("advanced_options")},16);n.on(t,(()=>{this.player.isFullscreen()&&this.player.exitFullscreen(),this.toggleAdvancedOptions(!0)}))},updateComponentText(){const e=this.player.controlBar.getChild("FileButton");e.updateTitle(this.$t("open_file")),this.subsBtn.updateTitle(this.$t("add_subtitles")+"...");const t=this.player.controlBar.getChild("AdvancedOptionsButton");t.updateTitle(this.$t("advanced_options"))},loadPlayer(e=!1){let t=()=>{};const n=new Promise((e=>{t=e}));if(!o["default"].getPlayer("my-video")||e){if(e){Object(o["default"])("my-video")&&(Object(o["default"])("my-video").isInPictureInPicture()&&Object(o["default"])("my-video").exitPictureInPicture(),Object(o["default"])("my-video").dispose());const e=document.querySelector("#video-container");e&&(e.innerHTML='')}try{this.player=Object(o["default"])("my-video",this.playerOptions,(()=>t()))}catch(a){console.log("loadPlayer error",a);const e=a.message;e.includes("The element or ID supplied is not valid.")&&(l["a"].dispatch("resetPlayer"),this.$destroy())}if(this.player.on("ready",(async()=>{l["a"].dispatch("updateVideoStatus",!1)})),this.player.on("canplay",(async()=>{l["a"].dispatch("resetRemotePlay");const e=(g?l["a"].state.video.currentVideo.path:this.fileName||l["a"].state.video.currentVideo.url).split(".").pop();if(this.toggleAudio(Object(i["b"])(e)),this.isUpdateSubtitle&&l["a"].state.video.currentVideo.infoHash===this.isUpdateSubtitle&&l["a"].state.video.currentVideo.path&&(await this.addSubtitle(l["a"].state.video.currentVideo.path),this.changeSubtitleForLang(),this.isUpdateSubtitle=""),!l["a"].state.video.currentVideo.url){const e=document.querySelector("#my-video video").src;l["a"].dispatch("currentVideoUrl",e);const t=e.split("/"),n=t[t.length-1];"undefined"!==typeof n&&(this.fileName=n),this.loadPlayer(!0),setTimeout((()=>this.player.play()),500)}setTimeout((()=>{!1===l["a"].state.video.currentVideo.status&&this.player.paused()&&this.player.bigPlayButton.show()}),700)})),this.player.on("play",(async()=>{if(this.settings.defaultVideoPlayer!==b&&l["a"].state.video.currentVideo.url.startsWith("play://")&&l["a"].state.video.currentVideo.infoHash){this.player.pause(),this.player.exitPictureInPicture();const e=l["a"].state.video.currentVideo.path;return console.log("player will pause,open default player,"+e),await Object(r["b"])(this.settings.defaultVideoPlayer,e),l["a"].dispatch("resetPlayer"),this.loadPlayer(!0)}this.player.bigPlayButton.hide(),l["a"].dispatch("updateVideoStatus",!0)})),this.player.on("pause",(()=>{4===this.player.readyState()&&this.player.bigPlayButton.show(),l["a"].dispatch("updateVideoStatus",!1)})),this.player.on("seeked",(()=>{setTimeout((()=>{const e=document.querySelector(".vjs-load-progress"),t=document.querySelector(".vjs-play-progress");e.style.width=t.style.width}),200)})),this.player.on("waiting",(()=>{const e=document.querySelector("#my-video video");e&&(e.style.backgroundColor="black")})),this.player.on("loadedmetadata",(()=>{const e=l["a"].state.video.currentVideo.url;if(!e||!/^http/gm.test(e))return;if(!/wait=0$/gm.test(e)||0===l["a"].state.setting.videoCacheTime)return;const t=this.updateCacheRate(l["a"].state.setting.videoCacheTime);console.log("loadedmetadata!",t),t&&(this.updateSrc(e,{clearSubtitle:!1,clearProgress:!1}),this.player.currentTime(l["a"].state.video.currentVideo.currentTime))})),this.player.on("leavepictureinpicture",(()=>{this.player&&this.player.bigPlayButton.hide(),l["a"].dispatch("updateVideoPIPStatus",!1),setTimeout((()=>{try{this.player.paused()?this.player.bigPlayButton.show():this.$router.push("/player")}catch(a){console.log("Failed to check pause status, but nothing will go wrong with this.",a.message||a)}}),500)})),this.player.on("enterpictureinpicture",(()=>{l["a"].dispatch("updateVideoPIPStatus",!0),this.player.paused()||setTimeout((()=>this.player.play()),500)})),this.player.on("timeupdate",(()=>{l["a"].dispatch("currentVideoCurrentTime",this.player.currentTime())})),this.player.on("error",(()=>{this.toggleSplash(!1),console.log("player error event!",this.player.error_.message);const e=this.player.languages()[this.player.language()],t=e&&e[this.player.error_.message]||this.player.error_.message;if(4!==this.player.error_.code||g||Object(f["a"])())this.$q.notify(t);else{const e='open_in_new',n=`${this.$t("download")} ${b} Desktop${e}`,o=`${n}`,a=this.$q.notify({html:!0,message:`${t}${o}`,actions:[{label:this.$t("close"),color:"green",handler(){a()}}],timeout:0})}l["a"].dispatch("resetPlayer"),this.$q.loading.hide(),this.loadPlayer(!0)})),l["a"].state.video.currentVideo.url&&!l["a"].state.video.currentVideo.remotePlay){this.player&&this.player.bigPlayButton.hide();const e=l["a"].state.video.currentVideo.subtitleList,t=l["a"].state.video.currentVideo.status,n=l["a"].state.video.currentVideo.updatePlayer;if(this.updateSrc(l["a"].state.video.currentVideo.url),this.player.currentTime(n?0:l["a"].state.video.currentVideo.currentTime),console.log("loadplayer(force) status",n,t,e,this.player),!n&&!t&&!/^https:\/\/localhost:8080\/webtorrent/gm.test(l["a"].state.video.currentVideo.url)){const e=()=>{this.player.pause(),this.player.off("play",e)};this.player.on("play",e)}"undefined"!==typeof e&&e.length?this.restoreSub(e):this.addSubtitle(l["a"].state.video.currentVideo.path),l["a"].dispatch("updatePlayer",!1)}return _["b"].is.mobile?this.player.bigPlayButton.on("touchend",this.bigPlayBtnOpenFile):this.player.bigPlayButton.on("click",this.bigPlayBtnOpenFile),this.addControlBarComponent(),l["a"].dispatch("updateVideoPIPStatus",!1),n}this.player=o["default"].getPlayer("my-video")},async updatePlayer(e){if(!e)return;this.player||await this.loadPlayer(!0);const t="string"===typeof e?e:URL.createObjectURL(e);console.log("update Player",e,t),this.fileName=e.name,l["a"].dispatch("currentVideoUrl",t);try{this.updateSrc(t)}catch(n){console.debug("updateSrc error",n.message||n),await this.loadPlayer(!0)}l["a"].dispatch("resetInfoHash"),this.clearOldSubtitle(),l["a"].state.video.currentVideo.path?await this.addSubtitle(l["a"].state.video.currentVideo.path):await this.addSubtitle(e,e.name),this.changeSubtitleForLang()},updateSrc(e,t={clearSubtitle:!0,clearProgress:!0}){this.toggleAudio(!1),t.clearProgress&&this.clearProgress(),t.clearSubtitle&&l["a"].dispatch("currentVideoSubtitleList",[]),e.startsWith("play://")&&(e+=`?infoHash=${l["a"].state.video.currentVideo.infoHash}`),console.log("updateSrc()",e),this.player.src([{src:e,type:"video/mp4"}])},updateCacheRate(e){if(!this.player.duration())return;const t=60*e/this.player.duration(),n=l["a"].state.video.currentVideo.url;return!!n&&(l["a"].dispatch("currentVideoUrl",n.replace(/wait=.*/gm,`wait=${t}`)),!0)},updateProgress(e){if(e){let t=document.querySelector("#download-progress");if(!t){const e=document.querySelector(".vjs-progress-holder");if(!e)return;t=e.appendChild(document.createElement("div")),t.id="download-progress"}const n=e=>{let t=0;for(let n=0;n1?t+e[n].length:t+1,e[n].rate=t;return e},o=n(e);t.style.background=o.reduce(((e,t)=>e+`, ${t.color} 0%, ${t.color} ${t.rate}%`),"linear-gradient(90deg")+")"}},clearProgress(){let e=document.querySelector("#download-progress");if(!e){const t=document.querySelector(".vjs-progress-holder");if(!t)return;e=t.appendChild(document.createElement("div")),e.id="download-progress"}e.style.background=""},async addSubtitle(e,t){var n;console.log("sub",e,t);let o=e;if("string"===typeof e){if(e.startsWith("blob:"))return;o=e.startsWith("play://")?Object(s["a"])(decodeURI(e.replace("play:///",""))):Object(s["a"])(e)}t||(t=(null===(n=o)||void 0===n?void 0:n.name)||"");const i=t.match(/\.[^.]+$/);if(!i)return;const r=i[0].toLowerCase();console.log("addSubtitle sub",o,t);let l=!1,c=!1;if(g)[".ass"].includes(r)?console.log("add .ass sub"):await Promise.all(Object(a["a"])(o).map((e=>new Promise((n=>{setTimeout((()=>{c=this.isRepeatSubtitle(e.label,e.path),"number"!==typeof c&&(this.player.addRemoteTextTrack({kind:"captions",label:e.label||t,src:e.src},!0),this.updateSubtitleList(e.label||t,{path:e.path}),l=!0),n()}))})))));else{if(console.log("web addSubtitle"),![".srt",".vtt"].includes(r))return;c=this.isRepeatSubtitle(t),"number"!==typeof c&&await new Promise((e=>{const n=new FileReader;n.readAsText(o),n.onload=n=>{const o=".vtt"===r?n.target.result:Object(a["b"])(n.target.result);console.log(n.target.result),this.player.addRemoteTextTrack({src:URL.createObjectURL(new Blob([o])),kind:"captions",label:t},!0),this.updateSubtitleList(t),l=!0,e()}}))}if(l&&this.subsBtn){this.subsBtn.addClass("hidden"),this.listenSubsCapsMenuItem();const e=this.player.textTracks();e&&e[0]&&(e[0].mode="showing",this.updateSubtitleList(e[0].label,{isShow:!0})),this.appendAddSubBtn()}return c},isRepeatSubtitle(e,t){const n=l["a"].state.video.currentVideo.subtitleList;let o=!1;for(let a=0;a{n[a].label===e&&(o=a),n[a].isShow=!1})),"number"===typeof t.index?n[t.index].isShow=!0:-1!==o&&(n[o].isShow=!0)}else n.push({label:e,path:t.path,isShow:t.isShow});l["a"].dispatch("currentVideoSubtitleList",n)},listenSubsCapsMenuItem(){const e=this.player.controlBar.subsCapsButton,t=e.menu.children();t.forEach(((e,t)=>{if("SubsCapsMenuItem"===e.constructor.name){const n=_["b"].is.mobile?"touchend":"click";e.on(n,(()=>{this.updateSubtitleList(e.track.label,{index:t-2,isShow:!0})}))}}))},clearOldSubtitle(){if(!this.subsBtn)return;this.subsBtn.removeClass("hidden");const e=this.player.remoteTextTracks();for(let t=e.length-1;t>=0;t--)this.player.removeRemoteTextTrack(e[t])},async restoreSub(e){let t;console.log("restoreSub",e),l["a"].dispatch("currentVideoSubtitleList",[]);for(const n in e){if(!e[n].path)return;await this.addSubtitle(e[n].path),e[n].isShow&&(t=n)}if("string"===typeof t){const e=this.player.textTracks();for(let t=0;t{const t=this.player.controlBar.subsCapsButton,n=t.menu.children();if(!n)return;if(n.some((e=>"AddSubButton"===e.name_)))return;const o=t.menu.addChild("AddSubButton",{text:e.$t("add_subtitles")+"..."},2);o.addClass("add-sub-btn");const a=_["b"].is.mobile?"touchend":"click";o.on(a,(()=>{this.$refs.subtitle.click()}))}),1e3)}}}}).call(this,n("28d0"))},"571b":function(e,t,n){},"586d":function(e,t,n){"use strict";n.r(t),n.d(t,"onGeneralUpdate",(function(){return o})),n.d(t,"onMessage",(function(){return a})),n.d(t,"onUpdateUserFromId",(function(){return s})),n.d(t,"onCreditChange",(function(){return i})),n.d(t,"onUpdateExpensesFromId",(function(){return r})),n.d(t,"onUpdateIncomeFromId",(function(){return l})),n.d(t,"onCreateUser",(function(){return c})),n.d(t,"onUpdateUser",(function(){return d})),n.d(t,"onDeleteUser",(function(){return u})),n.d(t,"onCreateInvitation",(function(){return h})),n.d(t,"onUpdateInvitation",(function(){return p})),n.d(t,"onDeleteInvitation",(function(){return m})),n.d(t,"onCreateMessageTimer",(function(){return _})),n.d(t,"onUpdateMessageTimer",(function(){return f})),n.d(t,"onDeleteMessageTimer",(function(){return g})),n.d(t,"onCreateTransaction",(function(){return b})),n.d(t,"onUpdateTransaction",(function(){return y})),n.d(t,"onDeleteTransaction",(function(){return v})),n.d(t,"onCreateTask",(function(){return w})),n.d(t,"onUpdateTask",(function(){return k})),n.d(t,"onDeleteTask",(function(){return C})),n.d(t,"onCreateProvidentFund",(function(){return $})),n.d(t,"onUpdateProvidentFund",(function(){return S})),n.d(t,"onDeleteProvidentFund",(function(){return x}));const o="\n subscription OnGeneralUpdate($id: String!) {\n onGeneralUpdate(id: $id) {\n id\n channel\n data\n }\n }\n",a="\n subscription OnMessage($channel: String!, $params: String) {\n onMessage(channel: $channel, params: $params) {\n channel\n data\n }\n }\n",s="\n subscription OnUpdateUserFromId($id: String!) {\n onUpdateUserFromId(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",i="\n subscription OnCreditChange($ownerId: String!) {\n onCreditChange(ownerId: $ownerId) {\n ownerId\n amount\n }\n }\n",r="\n subscription OnUpdateExpensesFromId($payerId: String!) {\n onUpdateExpensesFromId(payerId: $payerId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",l="\n subscription OnUpdateIncomeFromId($payeeId: String!) {\n onUpdateIncomeFromId(payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",c="\n subscription OnCreateUser($id: String) {\n onCreateUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",d="\n subscription OnUpdateUser($id: String) {\n onUpdateUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",u="\n subscription OnDeleteUser($id: String) {\n onDeleteUser(id: $id) {\n id\n credit\n username\n createdAt\n updatedAt\n }\n }\n",h="\n subscription OnCreateInvitation($inviterId: String) {\n onCreateInvitation(inviterId: $inviterId) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",p="\n subscription OnUpdateInvitation($inviterId: String) {\n onUpdateInvitation(inviterId: $inviterId) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",m="\n subscription OnDeleteInvitation($inviterId: String) {\n onDeleteInvitation(inviterId: $inviterId) {\n id\n inviterId\n inviteeId\n status\n email\n phone\n createdAt\n updatedAt\n }\n }\n",_="\n subscription OnCreateMessageTimer {\n onCreateMessageTimer {\n id\n times\n updatedAt\n createdAt\n }\n }\n",f="\n subscription OnUpdateMessageTimer {\n onUpdateMessageTimer {\n id\n times\n updatedAt\n createdAt\n }\n }\n",g="\n subscription OnDeleteMessageTimer {\n onDeleteMessageTimer {\n id\n times\n updatedAt\n createdAt\n }\n }\n",b="\n subscription OnCreateTransaction($payerId: String, $payeeId: String) {\n onCreateTransaction(payerId: $payerId, payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",y="\n subscription OnUpdateTransaction($payerId: String, $payeeId: String) {\n onUpdateTransaction(payerId: $payerId, payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",v="\n subscription OnDeleteTransaction($payerId: String, $payeeId: String) {\n onDeleteTransaction(payerId: $payerId, payeeId: $payeeId) {\n id\n payerId\n payeeId\n amount\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",w="\n subscription OnCreateTask {\n onCreateTask {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",k="\n subscription OnUpdateTask {\n onUpdateTask {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",C="\n subscription OnDeleteTask {\n onDeleteTask {\n id\n member\n status\n category\n createdAt\n meta\n updatedAt\n }\n }\n",$="\n subscription OnCreateProvidentFund($id: String) {\n onCreateProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",S="\n subscription OnUpdateProvidentFund($id: String) {\n onUpdateProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n",x="\n subscription OnDeleteProvidentFund($id: String) {\n onDeleteProvidentFund(id: $id) {\n id\n amount\n updatedAt\n createdAt\n }\n }\n"},5960:function(e,t,n){},5984:function(e,t,n){},"5a2f":function(e,t,n){"use strict";n("7447")},"5ab7":function(e,t,n){"use strict";n("3361")},"5bb9":function(e,t,n){"use strict";n("cf6e")},"5ccc":function(e,t,n){},"5d03":function(e,t,n){},"5e65":function(e,t,n){},"5e6d":function(e,t,n){},"5e87":function(e,t,n){"use strict";n("8fd4")},"5e95":function(e,t,n){"use strict";n("0c7a")},"5fa3":function(e,t,n){"use strict";(function(e){var o=n("e75b"),a=n("9572"),s=n("e74d"),i=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const r=new o["a"].Rest("ABDevRest"),l={currentRoute:"/library",user:{id:"",name:"",description:"",avatar:""},userLoggedIn:!1,keychainState:{keychainData:{},unset:!0,hash:"",timestamps:{metadata:0},lib:null},followQueue:[]},c={updateRoute(e,t){e.currentRoute=t},setUser(e,t){e.user=t},setKeychainState(e,t){Object.assign(e.keychainState,t)},addFollowQueue(e,t){e.followQueue.includes(t)||e.followQueue.push(t)},removeFollowQueue(e,t){while(e.followQueue.includes(t))e.followQueue.splice(e.followQueue.indexOf(t),1)}},d=()=>i(void 0,void 0,void 0,(function*(){const e=()=>i(void 0,void 0,void 0,(function*(){const t=yield s["a"].currentUserInfo();return t&&t.attributes?t.attributes:yield e()}));return yield e()})),u={syncKeychainState({state:e,commit:t}){return i(this,void 0,void 0,(function*(){const n=()=>i(this,void 0,void 0,(function*(){const e=yield d();let{"custom:key_metadata":t,"custom:key_lib":n}=e;return t=t?JSON.parse(t):{unset:!0,timestamps:{}},{metadata:t,lib:n}})),o=yield n();if(o){const e=e=>{if(!e.lib)return null;if(e.lib.startsWith("{"))return JSON.parse(e.lib);throw new Error("Failed to parseLib")};t("setKeychainState",{keychainData:o,unset:o.metadata.unset,hash:o.metadata.hash||"",timestamps:o.metadata.timestamps||{},lib:e(o)})}return e.keychainState}))},changeKeychainPassword(e,{oldPassword:t,password:n}){return i(this,void 0,void 0,(function*(){if(!t&&!n)throw Error("Invalid arguments");let e;t||(e="from_cognito"),n||(e="to_cognito"),yield r.post("/keychain/changePassword",{password:t?a["a"].digestPassword(t):void 0,newPassword:n?a["a"].digestPassword(n):void 0,type:e})}))},getKeychainCloud({state:e,commit:t,dispatch:n},{password:o,mode:s,keyName:l}){return i(this,void 0,void 0,(function*(){const e=()=>i(this,void 0,void 0,(function*(){if(!["lib"].includes(l))throw new Error("invalid_keychain_keyname");const e=yield d().then((e=>!!e[`custom:key_${l}`]));if(!e)throw new Error("keychain_data_does_not_exist")}));yield e();const t=yield(()=>i(this,void 0,void 0,(function*(){if("cognito_hash"===s){const e=yield n("syncKeychainState");if(!e.unset)throw new Error("invalid_keychain_mode");if(!e.hash)throw new Error("cognito_hash_not_found");return e.hash}if("independent_password"===s){if(!o)throw new Error("keychain_password_not_found");return a["a"].digestPassword(o)}throw new Error("invalid_keychain_mode")})))(),c=yield r.post("/keychain/getKeychain",{password:t,keyName:l});if(!c)throw new Error("password_error");if(["epriv","epub","priv","pub"].some((e=>!c[e])))throw new Error("invalid_key");return console.log("getKeychainFromCloud:",c),c}))},createKeychainCloud({state:e,commit:t,dispatch:n},{keyObj:o,password:s,mode:l,keyName:c}){return i(this,void 0,void 0,(function*(){const e=()=>i(this,void 0,void 0,(function*(){if(!["lib"].includes(c))throw new Error("invalid_keychain_keyname");const e=yield d().then((e=>!!e[`custom:key_${c}`]));if(e)throw new Error("keychain_data_existed")}));yield e();const t=yield(()=>i(this,void 0,void 0,(function*(){if("cognito_hash"===l){const e=yield n("syncKeychainState");if(!e.unset)throw new Error("invalid_keychain_mode");if(!e.hash)throw new Error("cognito_hash_not_found");return e.hash}if("independent_password"===l){if(!s)throw new Error("keychain_password_not_found");return a["a"].digestPassword(s)}throw new Error("invalid_keychain_mode")})))();yield r.post("/keychain/enableLibKey",Object.assign(Object.assign(Object.assign({},"cognito_hash"===l?{}:{password:t}),"cognito_hash"===l?{type:"cognito"}:{}),{keyName:c,keyData:JSON.stringify(o)})).catch(console.log)}))},updateKeychainCloud({state:e,commit:t,dispatch:n},{keyObj:o,password:s,mode:l,keyName:c}){return i(this,void 0,void 0,(function*(){const e=()=>i(this,void 0,void 0,(function*(){if(!["lib"].includes(c))throw new Error("invalid_keychain_keyname");const e=yield d().then((e=>!!e[`custom:key_${c}`]));if(!e)throw new Error("keychain_data_does_not_exist")}));yield e();const t=yield(()=>i(this,void 0,void 0,(function*(){if("cognito_hash"===l){const e=yield n("syncKeychainState");if(!e.hash)throw new Error("cognito_hash_not_found");return e.hash}if("independent_password"===l){if(!s)throw new Error("keychain_password_not_found");return a["a"].digestPassword(s)}throw new Error("invalid_keychain_mode")})))();yield r.post("/keychain/updateKeychain",Object.assign(Object.assign(Object.assign({},"cognito_hash"===l?{}:{password:t}),"cognito_hash"===l?{type:"cognito"}:{}),{keyName:c,keyData:JSON.stringify(o)}))}))},disableKeychainCloud(e){return i(this,void 0,void 0,(function*(){yield r.post("/keychain/disableKeychain")}))}};Object.defineProperty("undefined"===typeof window?e:window,"rest",{get(){return r}});const h={libraryRoute(e){return e.currentRoute},libraryUser(){return l.user},keychainState(){return l.keychainState},followQueue(e){return e.followQueue}},p={namespaced:!1,state:l,mutations:c,actions:u,getters:h};t["a"]=p}).call(this,n("0ee4"))},"5fc6":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));const o=n("d310").isElectron();function a(e){if(!o||"string"!==typeof e)return e;const t=n("a3fc"),a=t.basename(e);return{name:a,path:e}}},6:function(e,t){},"603c":function(e,t,n){},"61a1":function(e,t,n){"use strict";n.d(t,"b",(function(){return Ss}));var o=n("ff9b"),a=n("fe87"),s=(n("de6c"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-container",class:{larger:!e.isElectron}},[n("q-toolbar",{staticClass:"library-header q-py-sm flex",staticStyle:{"flex-wrap":"nowrap","max-height":"57px"}},[e.lib.search.options.length?[e.$q.screen.xs?n("q-btn",{attrs:{unelevated:"",round:"",icon:"search"}},[n("q-menu",[n("q-card",{staticClass:"q-pa-md"},[n("q-select",{staticClass:"q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("type"),options:e.lib.search.options},model:{value:e.lib.search.option,callback:function(t){e.$set(e.lib.search,"option",t)},expression:"lib.search.option"}}),n("q-input",{attrs:{outlined:"",dense:"",type:"text",label:e.$t("search")},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.lib.search.text,callback:function(t){e.$set(e.lib.search,"text",t)},expression:"lib.search.text"}})],1)],1)],1):n("q-input",{staticStyle:{width:"320px"},attrs:{outlined:"",dense:"",type:"text",label:e.$t("search")},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"before",fn:function(){return[n("q-select",{staticStyle:{"min-width":"120px"},attrs:{dense:"",outlined:"",label:e.$t("type"),options:e.lib.search.options},model:{value:e.lib.search.option,callback:function(t){e.$set(e.lib.search,"option",t)},expression:"lib.search.option"}})]},proxy:!0},{key:"append",fn:function(){return[n("q-icon",{attrs:{name:"search"}})]},proxy:!0}],null,!1,311008788),model:{value:e.lib.search.text,callback:function(t){e.$set(e.lib.search,"text",t)},expression:"lib.search.text"}})]:e._e(),n("q-space"),n("div",{staticClass:"header-bar-status text-grey q-my-sm q-ml-xs flex no-wrap items-center text-right overflow-hidden"},[n("div",{staticClass:"from-network-hint",staticStyle:{"flex-shrink":"1"}},[e._v(e._s(e.$t("lib_from_network")))]),n("q-badge",{staticClass:"connection-status cursor-pointer q-ml-xs",attrs:{"text-color":"white",color:e.statusColor},on:{click:function(t){e.peerDialog=!0}}},[e.lib.online?n("q-icon",{staticClass:"status-icon",attrs:{name:"flash_on"}}):e._e(),n("span",{staticClass:"status-label"},[e._v(e._s(e.statusLabel))])],1)],1)],2),n("div",{staticClass:"library-view"},[n("transition",{attrs:{name:"slide",mode:"out-in"}},[n("keep-alive",{attrs:{exclude:"LibraryChannel,LibraryRecommend"}},[e.isLoggedIn?e.showRecommend?n("Recommend"):n("router-view"):n("Login")],1)],1)],1),n("ConnectionStatus",{model:{value:e.peerDialog,callback:function(t){e.peerDialog=t},expression:"peerDialog"}})],1)}),i=[],r=(n("a1c1"),n("36a1")),l=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"login-container"},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"input-file",accept:".abk"},on:{change:e.onFileChange}}),n("q-dialog",{model:{value:e.showImport,callback:function(t){e.showImport=t},expression:"showImport"}},[n("q-card",[n("q-card-section",[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("import_key")))]),n("q-input",{staticStyle:{width:"480px"},attrs:{type:"text",label:e.$t("key")},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.userKey,callback:function(t){e.userKey=t},expression:"userKey"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{attrs:{flat:"",label:e.$t("import"),color:"primary"},on:{click:e.importKey}})],1)],1)],1),n("Loading",{attrs:{value:!0}})],1)},c=[],d=(n("e39c"),n("5584")),u=n("35f4"),h=n("3aea"),p=n("2d62"),m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.showLoading,expression:"showLoading"}],staticClass:"non-selectable",class:["absolute-top-left","full-width","full-height"].concat(["column","justify-center","items-center"],["bg-page","text-page"])},[n("div",{staticClass:"items-center"},[n("q-spinner",{attrs:{size:"4rem",color:"secondary"}}),n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))]),n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("first_recomment_msg")))])])},_=[],f=n("a449");const g=()=>{let e;return{data(){return{keychainLoadingState:!1,keychain:f["a"]}},watch:{"keychain.loading"(t){e&&clearTimeout(e),t?e=setTimeout((()=>{this.keychainLoadingState=!0}),500):this.keychainLoadingState=!1}}}};var b={name:"Loading",mixins:[g()],props:{value:Boolean},computed:{showLoading(){const e="signedOut"===this.$store.state.account.authState;return this.value&&!this.keychainLoadingState&&!e}},methods:{onChange(){this.$emit("change",!this.value)}}},y=b,v=(n("9fe7"),n("2b5f")),w=n("53ef"),k=n("09a4"),C=n.n(k),$=Object(v["a"])(y,m,_,!1,null,"1f47903d",null),S=$.exports;C()($,"components",{QSpinner:w["a"]});const x=Object(u["a"])("abcdefg",5),T=Object(u["a"])("0123456789abcdef",40);var I={data(){return{username:"",password:"",nickname:"",description:"",avatar:"",userKey:"",showImport:!1}},components:{Loading:S},computed:{showLoading(){const e=this.$store.state.account.authState;return null===e}},methods:{validate(){if(!this.nickname){const e=d["a"].getters.accountUserInfo.nickname;this.nickname=e||this.username.substring(0,12)}return!0},showImportDialog(){this.$refs.fileSelector.click()},onFileChange(e){var t,n;null!==e&&void 0!==e&&null!==(t=e.target)&&void 0!==t&&null!==(n=t.files)&&void 0!==n&&n[0]&&Object(h["g"])(e.target.files[0]).then((e=>{if(!e)return this.$q.notify("Cannot read key pair from this file");this.userKey=e,this.importKey()}))},onReset(){this.username=x()+T(35),this.password=T(),this.nickname="",this.description=""},async onSubmit(){const e=this.validate();if("string"===typeof e)return this.$q.dialog({message:e});console.log(this.username,this.password,this.nickname),r["a"].register(this.username,this.password,{name:this.nickname,description:this.description,avatar:this.avatar}).then((()=>{const e=Object(p["t"])();if(console.log(e,r["a"].user),e._&&e._.sea){const t=e._.sea,{epub:n,pub:o,epriv:a,priv:s}=t;if(!n||!o||!a||!s)return;const i=[n,o,a,s].join(":");this.$q.dialog({title:this.$t("save_key"),message:this.$t("save_key_file"),ok:this.$t("save_key"),cancel:this.$t("cancel")}).onOk((()=>{var t,n;Object(h["h"])(i,`${(null===(t=e.data)||void 0===t?void 0:t.name)||(null===(n=r["a"].userData)||void 0===n?void 0:n.name)||"user"}.abk`)})).onDismiss((()=>{r["a"].prepareData()}))}}))},autoCreate(){this.onReset(),this.onSubmit()},importKey(){if(r["a"].isLoggedIn)return;console.log(this.userKey);const[e,t,n,o]=this.userKey.split(":");if(!e||!t||!n||!o)return this.$q.notify(this.$t("invalid_key"));r["a"].login({epub:e,pub:t,epriv:n,priv:o}).then(r["a"].prepareData)}},created(){this.onReset(),r["a"].$on("logged-in",(()=>{const e=[this.username,this.password].join(":");console.log("Logged in",e),this.$emit("login")}))}},P=I,O=(n("86d7"),n("1043")),q=n("b2aa"),E=n("e586"),A=n("d7c7"),D=n("0e45"),N=n("59ba"),L=Object(v["a"])(P,l,c,!1,null,"6a9c1d57",null),j=L.exports;C()(L,"components",{QBtn:O["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QInput:D["a"],QCardActions:N["a"]});var R=n("36a5"),U=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.value,"content-class":"fullscreen-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:function(t){return e.$emit("input",t)}}},[n("q-card",{staticClass:"peer-dialog-card"},[n("q-card-section",{staticClass:"row items-center",class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-bold peers-title"},[e._v(e._s(e.$t("connection_status")))]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"},{name:"close-popup",rawName:"v-close-popup"}],attrs:{unelevated:"",round:"",icon:"close"}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}],staticClass:"q-mb-sm"}),n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"scroll-area gun-server-list"},[n("div",{staticClass:"servers-title q-ml-sm q-mb-sm row items-center"},[n("div",{staticClass:"text-h6 q-mr-sm"},[e._v(e._s(e.$t("gun_server_list")))]),n("q-btn",{attrs:{flat:"",unelevated:"",rounded:"",dense:"",icon:"help_outline"},on:{click:e.showServerHelp}},[n("q-tooltip",[e._v(e._s(e.$t("about_cache_node")))])],1),n("q-space"),n("q-btn",{attrs:{unelevated:"",round:"",icon:"add"},on:{click:e.createCacheNode}},[n("q-tooltip",[e._v(e._s(e.$t("create_cache_node")))])],1),n("q-btn",{attrs:{unelevated:"",round:"",icon:"edit"},on:{click:e.editCacheNode}},[n("q-tooltip",[e._v(e._s(e.$t("edit_cache_node")))])],1)],1),n("q-markup-table",{attrs:{flat:"",bordered:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("status")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("server")))])])]),n("tbody",e._l(e.wsPeers,(function(t){return n("tr",{key:t.url},[n("td",{staticClass:"text-left",class:"text-"+e.statusColorMap[t.status]},[e._v(e._s(e.statusTextMap[t.status]))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.url))])])})),0)])],1)]),n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"scroll-area wrtc-peer-list"},[n("div",{staticClass:"peers-title q-ml-sm q-mb-sm text-h6"},[e._v(e._s(e.$t("peer_list")))]),n("q-markup-table",{attrs:{flat:"",bordered:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"}),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("peer_id")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("connection")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("data_source")))]),n("th",{staticClass:"text-center",attrs:{colspan:"2"}},[e._v(e._s(e.$t("download")))]),n("th",{staticClass:"text-center",attrs:{colspan:"2"}},[e._v(e._s(e.$t("upload")))])])]),n("tbody",[e.wrtcPeers&&Object.keys(e.wrtcPeers).length?e._l(e.wrtcPeers,(function(t){return n("tr",{key:t.url},[n("td",{staticClass:"text-left"},[n("q-icon",{attrs:{name:e.getPeerStatusIcon(t),color:"primary"}},[n("q-tooltip",[e._v(e._s(e.getPeerStatusTooltip(t)))])],1)],1),n("td",{staticClass:"text-left"},[e._v(e._s(e.getPeerId(t)))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.label))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.from))]),n("td",{staticClass:"text-right"},[e._v(e._s(e.byteToLarger(t.downloaded)))]),n("td",{staticClass:"text-left"},[e._v(e._s(e.byteToLarger(t.downloadSpeed))+" / s")]),n("td",{staticClass:"text-right"},[e._v(e._s(e.byteToLarger(t.uploaded)))]),n("td",{staticClass:"text-left"},[e._v(e._s(e.byteToLarger(t.uploadSpeed))+" / s")])])})):n("tr",{staticClass:"q-pa-md"},[n("td",{staticClass:"full-width text-center",attrs:{colspan:"8"}},[e._v("\n "+e._s(e.$t("credit_no_data"))+"\n ")])])],2)])],1)])],1)],1)},F=[],M=n("6422"),B={name:"LibraryConnectionStatus",props:{value:Boolean},data(){return{}},computed:{statusTextMap(){return{[WebSocket.CLOSED]:this.$t("offline"),[WebSocket.OPEN]:this.$t("connected"),[WebSocket.CONNECTING]:this.$t("connecting"),[WebSocket.CLOSING]:this.$t("offline")}},statusColorMap(){return{[WebSocket.CLOSED]:"red",[WebSocket.OPEN]:"green",[WebSocket.CONNECTING]:"none",[WebSocket.CLOSING]:"red"}},wsPeers(){return r["a"].gunPeers.filter((e=>"ws"===e.type))},wrtcPeers(){return r["a"].gunPeers.filter((e=>"wrtc"===e.type))}},methods:{getPeerId(e){if("tracker"!==e.from)return e.url;let t=parseInt(e.url.substring(20),16),n="",o=0;while(t>0)o=t%62,t=Math.floor(t/62),n+=o<36?o.toString(36):(o-26).toString(36).toUpperCase();return n.substring(0,9)},getPeerStatusIcon(e){return"syncing"===e.syncState?"syncing"===e.remoteSyncState?"import_export":"arrow_upward":"syncing"===e.remoteSyncState?"arrow_downward":"completed"===e.syncState?"completed"===e.remoteSyncState?"done_all":"done":"settings_ethernet"},getPeerStatusTooltip(e){return"syncing"===e.syncState?"syncing"===e.remoteSyncState?this.$t("syncing"):this.$t("uploading"):"syncing"===e.remoteSyncState?this.$t("downloading"):"completed"===e.syncState?"completed"===e.remoteSyncState?this.$t("sync_completed"):this.$t("uploaded"):this.$t("connecting")},byteToLarger(e){return Object(M["a"])(e,{byte:!1,gb:!1})},showServerHelp(){this.$alphabiz.dialog({title:this.$t("about_cache_node"),message:this.$t("about_cache_node_desc"),cancel:!0,ok:{label:this.$t("go_to_settings"),handler:e=>{this.$emit("input",!1),setTimeout((()=>{this.$router.push("/advanceSetting?highlight=custom-nodes")}),300),e.hide()}}})},async createCacheNode(){window.open("https://alpha.biz/blog/how-to-deploy-a-gun-server/","_blank")},editCacheNode(){setTimeout((()=>{this.$router.push("/advanceSetting?highlight=custom-nodes")}),300)}}},Q=B,W=(n("9f3a"),n("990e")),z=n("fc38"),H=n("cf25"),V=n("3714"),G=n("f106"),K=n("a431"),Y=Object(v["a"])(Q,U,F,!1,null,"54be07de",null),J=Y.exports;C()(Y,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSpace:W["a"],QBtn:O["a"],QSeparator:z["a"],QTooltip:H["a"],QMarkupTable:V["a"],QIcon:G["a"]}),C()(Y,"directives",{ClosePopup:K["a"]});var X=n("d7df"),Z=n("d310"),ee=n("3fd2"),te=n.n(ee),ne=(n("d4b5"),n("0598")),oe=n("f680"),ae=n("1926");console.log("===",ae["b"]);const se={_store:null,store:{favorites:[],ids:[]},_preNotify:null,_init(){if(Object(ne["default"])()){const e=n("f4b7");this._store=new e({name:"favorite",defaults:{favorites:[]}}),this.store=this._store.store}else{const e="ab-local-favorites",t=localStorage.getItem(e);this.store=t?JSON.parse(t):{favorites:[],ids:[]};const n=this.store;this._store={get(e){return console.log("get",e,n),n[e]},set(t,o){console.log("set",t,o,n),n[t]=o,localStorage.setItem(e,JSON.stringify(n))},clear(){console.log("clear"),localStorage.removeItem(e),se._init()}}}this.store.ids=this.store.favorites.map((e=>e.id))},set(e){for(const t of e)this.add(t)},add(e){if(this.store.ids.find((t=>t===e.id)))return;e.timestamp||(e.timestamp=Date.now());let t=0;for(const n of this.store.favorites){if(!(n.timestamp>e.timestamp))break;t++}this.store.favorites.splice(t,0,e),this.store.ids.splice(t,0,e.id),this._store.set("favorites",this.store.favorites)},remove(e,t){const n="string"===typeof e?e:e.id,o=this.store.ids.findIndex((e=>e===n));if(-1===o)return;const[a]=this.store.favorites.splice(o,1);if(this.store.ids.splice(o,1),this._store.set("favorites",this.store.favorites),!a)return;const s=oe["a"].create({message:ae["b"].t("removed_favorite")+a.title,group:!1,actions:[{label:ae["b"].t("undo"),handler(){se.add(a),t&&t(a)}}]});this._preNotify&&this._preNotify(),this._preNotify=s},list(){return this.store.favorites.sort(((e,t)=>t.timestamp-e.timestamp))},isFavorite(e){return this.store.ids.includes(e)},clear(){this._store.clear(),this.store.favorites.splice(0),this.store.ids.splice(0),this._store.set("favorites",this.store.favorites)}};se._init();var ie=se,re={name:"Library",mixins:[f["d"]],components:{Login:j,Recommend:R["a"],ConnectionStatus:J},data(){return{breadcrumbs:[{label:this.$t("library"),icon:"video_library",to:"/library"}],peerDialog:!1,isElectron:Object(Z["isElectron"])(),lib:r["a"]}},computed:{showRecommend(){return!!r["a"].isLoggedIn&&(!this.isVisitable(this.$route.fullPath)&&(r["a"].followingChannels.length?!r["a"].nonBlockFollowingChannels.length&&"ready"===r["a"].libStatus:!r["a"].isFirstRegister))},currentView(){const e=this.$route.path.replace(/^\//,"").split("/");return e},hasWrtcPeers(){return r["a"].gunPeers.filter((e=>"wrtc"===e.type)).length},statusColor(){if(this.hasWrtcPeers)return"green";if(!r["a"].online)return"red";switch(r["a"].onlineStatus){case"connected":return"green";case"connecting":return"yellow";case"reconnecting":return"yellow";default:return"red"}},statusLabel(){if(this.hasWrtcPeers)return this.$t("connected");if(!r["a"].online)return this.$t("offline");switch(r["a"].onlineStatus){case"connected":return this.$t("connected");case"connecting":return this.$t("connecting");case"reconnecting":return this.$t("connecting");default:return this.$t("unknown")}},isLoggedIn(){return this.lib.isLoggedIn}},methods:{isVisitable(e){return e.startsWith("/library/edit")||e.includes("preview=1")||e.includes("fromLink=1")||e.startsWith("/library/takedown")},getIcon(e){switch(e){case"following":return"star";case"explore":return"travel_explore";case"edit":return"edit_note"}return"list"}},beforeCreate(){if(te.a.mas()){const e=localStorage.getItem("__mas_library_user__");e||(console.log("clear store since no old user"),ie.clear()),r["a"].whenReady.then((()=>{var t;r["a"].user&&null!==(t=r["a"].user.is)&&void 0!==t&&t.pub&&(e&&e!==r["a"].user.is.pub&&(console.log("clear store since user changed",e,r["a"].user.is.pub),ie.clear()),localStorage.setItem("__mas_library_user__",r["a"].user.is.pub))}))}},mounted(){X["a"].on("open-library",(e=>{console.log("open library url:",e);const t=Object(h["d"])(e);if(!t||!t.id)return;let n=0;const o=()=>{const e=Object(h["c"])(t.id);e?(console.log("go library",e),this.$root.$emit("navigate-to"),this.$router.push(e+"&fromLink=1"),setTimeout((()=>this.$root.$emit("navigate-to",e)))):(console.log("cannot get id from channel list",t.id,e),n||this.$q.notify(this.$t("loading")),n++<5?setTimeout(o,2e3):this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}))};r["a"].whenReady.then(o)}))},watch:{"lib.libStatus":{handler(e){"ready"===e&&console.log("> library ready <")},immediate:!0},showRecommend(e){if(e){if(console.log("Show recommend. Redirect to library index"),"/library"===this.$route.path)return;this.$router.replace("/library")}}},beforeRouteUpdate(e,t,n){if(!e.path.startsWith("/library"))return n();const o=()=>!r["a"].isLoggedIn||!r["a"].nonBlockFollowingChannels.length&&"ready"===r["a"].libStatus;if(o()){if("/library/"===e.path||"/library"===e.path)return this.$root.$emit("navigate-to"),n(),void setTimeout((()=>{this.$root.$emit("navigate-to")}));if(this.isVisitable(e.fullPath))return this.$root.$emit("navigate-to"),n(),void setTimeout((()=>{this.$root.$emit("navigate-to",e.path)}));n()}else n()}},le=re,ce=(n("899b5"),n("7285"),n("99c4")),de=n("a829"),ue=n("a4ac"),he=n("90c4"),pe=n("c6f0"),me=Object(v["a"])(le,s,i,!1,null,"203f2a72",null),_e=me.exports;C()(me,"components",{QToolbar:ce["a"],QBtn:O["a"],QMenu:de["a"],QCard:E["a"],QSelect:ue["a"],QInput:D["a"],QIcon:G["a"],QSpace:W["a"],QBadge:he["a"],QBreadcrumbs:pe["a"]});var fe=n("d558"),ge=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-explore"},[n("div",{staticClass:"library-inner-container"},[n("VirtualScrollGrid",{staticClass:"library-grid",attrs:{virtualScrollSliceRow:30,itemWidth:560,itemHeight:473,gutter:8,itemsSize:e.searchFilteredPosts.length,itemsFn:function(t,n){return e.itemsFn(t,n-t)}},on:{"virtual-scroll":function(t){var n=t.from;return e.scrollIndex=n||0}},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("PostCard",{key:o.id,attrs:{followable:"",post:o,disableFollow:e.loadingNext},on:{preview:e.showPreviewImage,follow:e.follow,"to-channel":e.toChannelPage}})]}},{key:"after",fn:function(t){var o=t.mod,a=t.column;return[n("div",{directives:[{name:"intersection",rawName:"v-intersection",value:function(t){return e.shouldLoading(t,Math.max(Math.ceil(10/a),2)*a+(o?a-o:0))},expression:"(entry) => shouldLoading(entry, (Math.max(Math.ceil(10 / column), 2) * column) + (mod ? column - mod : 0))"}],staticClass:"rounded-borders bg-page column justify-center items-center",class:e.searchFilteredPosts.length?"q-mb-sm q-pa-md":"",style:e.searchFilteredPosts.length?{}:{height:"calc(100vh - var(--header-height) - var(--appbar-height) - 8px - env(safe-area-inset-bottom) - env(safe-area-inset-top))"}},[e.searchFilteredPosts.length||e.loadingPosts||!e.loadedAll?e.loadedAll&&!e.loadingPosts?n("div",[n("q-icon",{attrs:{name:"check_circle_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("got_all_post")))])],1):[n("div",[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))])]:n("div",[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)],2)]}}])}),e._e()],1),e._e(),n("BackToTop",{attrs:{show:e.scrollIndex>0||e.showBackToTop},on:{click:e.handleBackToTop}}),n("SearchChannel",{directives:[{name:"show",rawName:"v-show",value:!e.loadingPosts||e.filteredPosts.length,expression:"!loadingPosts || filteredPosts.length"}],attrs:{higher:e.scrollIndex>0||e.showBackToTop}}),e.allPosts.length||e.loadingPosts?e._e():n("div",{staticClass:"no-data"},[n("q-btn",{staticClass:"no-data-btn",attrs:{round:"",color:"primary",icon:"arrow_forward",size:"24px"},on:{click:e.goToFollowing}},[n("q-tooltip",[e._v(e._s(e.$t("no_recommend"))+" "+e._s(e.$t("lib_following")))])],1)],1),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1),n("Loading",{attrs:{value:e.loadingPosts&&!e.filteredPosts.length}})],1)},be=[],ye=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{directives:[{name:"intersection",rawName:"v-intersection",value:{handler:e.triggerPreload,threshold:0},expression:"{ handler: triggerPreload, threshold: 0 }"}],staticClass:"post-card overflow-hidden relative-position column no-wrap",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.24)",border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"},on:{mouseenter:function(){return e.onCardHover(!0)},mouseleave:function(){return e.onCardHover(!1)}}},[n("img",{staticClass:"absolute-top-left",staticStyle:{filter:"blur(24px)",transform:"scale(1.25)",opacity:"0.08"},attrs:{src:e.post.image,loading:"lazy"},on:{click:e.popupImage,error:e.onImageError,load:e.onImageLoaded}}),e.post.channel?n("div",[e.hideChannel?e._e():n("q-card-section",{staticClass:"post-channel-info no-wrap overflow-hidden row items-center"},[n("div",{staticClass:"channel cursor-pointer row items-center no-wrap",on:{click:e.toChannelPage}},[n("q-avatar",{staticClass:"shadow-2",staticStyle:{background:"#282828"},attrs:{size:"18"}},[e.isLoadedChannelImage?n("img",{attrs:{src:e.post.channel.image},on:{error:e.onChannelAvatarError,load:e.onChannelAvatarLoaded}}):e._e(),e.isLoadedChannelImage?e._e():n("q-icon",{staticStyle:{color:"#ccc"},attrs:{name:"subscriptions",size:"30px"}})],1),n("div",{staticClass:"channel-title q-ml-md ellipsis-2-lines",attrs:{title:e.post.channel.title}},[e._v("\n "+e._s(e.post.channel.title||e.$t("loading"))+"\n ")]),e.post.channel.hidden?n("span",{staticClass:"hidden-info text-grey q-ml-xs"},[e._v("("+e._s(e.$t("private_channel"))+")")]):e._e()],1),n("q-space"),n("FollowButton",{attrs:{id:e.post.channel.id,disableFollow:e.disableFollow}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:!e.hideChannel,expression:"!hideChannel"}],staticStyle:{margin:"0 -4px"}})],1):e._e(),n("q-card-section",{staticClass:"post-info q-pa-none overflow-hidden",class:e.$q.screen.width>=790?["row","no-wrap","justify-start","items-stretch"]:["column","no-wrap","justify-start","items-center"],style:{maxHeight:e.$q.screen.width>=790?"calc(16px * 2 + 360px)":"unset",flexGrow:1}},[n("div",{staticClass:"image",class:e.$q.screen.width>=790?["q-pa-md"]:["q-pa-sm"]},[n("div",{staticClass:"image-container row justify-center items-center"},[e.allowClickImage?n("img",{attrs:{src:e.post.image,loading:"lazy"},on:{click:e.popupImage,error:e.onImageError,load:e.onImageLoaded}}):e._e(),e.allowClickImage?e._e():n("q-icon",{attrs:{size:"80px",name:"video_file",color:"general"}})],1)]),n("div",{staticClass:"overflow-hidden full-width flex-grow column no-wrap q-pb-md",style:{marginLeft:e.$q.screen.width>=790?"-8px !important":"0"}},[n("div",{staticClass:"desc-main q-pa-sm"},[n("div",{staticClass:"text-bold desc-title row overflow-hidden full-width no-wrap items-center"},[n("div",{staticClass:"post-title q-mr-sm overflow-hidden",attrs:{title:e.post.title}},[n("div",{staticClass:"text-no-wrap ellipsis"},[e._v(e._s(e.post.title))])]),n("q-space"),n("q-btn",{staticClass:"favorite-icon block",attrs:{dense:"",flat:"",color:"primary","text-color":"primary",round:"",icon:e.isFavorite?"star":"star_border"},on:{click:e.setFavorite}},[n("q-tooltip",[e._v(e._s(e.isFavorite?e.$t("remove_from_local_favorites"):e.$t("add_to_local_favorites")))])],1),e.post.channel?n("q-btn",{staticClass:"block",attrs:{dense:"",flat:"",round:"",icon:"more_vert"}},[n("q-menu",[n("q-list",{staticStyle:{"min-width":"100px"}},[n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.follow}},[n("q-item-section",[e._v("\n "+e._s(e.followable?e.$t("follow"):e.$t("unfollow"))+"\n "+e._s(e.shortChannelTitle)+"\n ")])],1),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.share}},[n("q-item-section",[e._v("\n "+e._s(e.$t("share"))+"\n "+e._s(e.shortChannelTitle)+"\n ")])],1),n("q-separator"),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.blockChannel}},[n("q-item-section",[e._v("\n "+e._s(e.isBlocked?e.$t("unblock"):e.$t("block"))+"\n "+e._s(e.shortChannelTitle)+"\n ")])],1),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.blockUser}},[n("q-item-section",[e._v(e._s(e.isBlockedUser?e.$t("unblock_creator"):e.$t("block_creator")))])],1),e.lib.isLibAdmin?[n("q-separator"),n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{clickable:""},on:{click:e.takedownPost}},[n("q-item-section",[e._v(e._s(e.$t("takedown_post")))])],1)]:e._e()],2)],1)],1):e._e()],1),n("div",{staticClass:"text-subtitle2 q-mt-xs text-grey desc-time"},[n("span",[e._v(e._s(new Date(e.post.timestamp).toLocaleString()))]),n("q-badge",{staticClass:"q-ml-md bg-primary text-primary"},[e._v("\n "+e._s(e.post.rate||"G")+"\n "),n("q-tooltip",e._l(e.getRateText(e.post.rate).split("\n"),(function(t,o){return n("div",{key:o,staticClass:"rate-tip"},[e._v(e._s(t)+"\n ")])})),0)],1),e.subtitleLang?n("q-btn",{staticClass:"q-ml-sm",attrs:{dense:"",flat:"",size:"xs"}},[n("q-icon",{staticStyle:{"font-size":"22px"},attrs:{name:"subtitles"}}),n("q-tooltip",[e._v(e._s(e.$t("with_subtitle",{language:e.subtitleLang})))])],1):e._e()],1)]),n("div",{staticClass:"overflow-auto q-pa-sm",staticStyle:{"flex-grow":"1","flex-shrink":"1"}},[n("div",{staticClass:"full-width overflow-hidden"},e._l((e.post.description||"").split("\n"),(function(t,o){return n("div",{key:o,staticClass:"desc-para"},[e._v(e._s(t)+"\n ")])})),0)]),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.hideButtons,expression:"!hideButtons"}],staticClass:"text-center post-buttons q-pt-sm"},[e.post.abUrl||e.backAbUrl?n("div",{staticClass:"download-btns"},[e.addedStatus?n("q-btn",{staticClass:"q-px-sm",attrs:{unelevated:"",dense:"",flat:"",ripple:!1,label:"downloading"===e.addedStatus?e.$t("downloading"):e.$t("completed"),icon:"downloading"===e.addedStatus?"download":"done","text-color":"primary",color:"primary"},on:{click:e.toTaskInfo}},[n("q-tooltip",[e._v(e._s(e.$t("lib_already_added"))),n("br"),e._v(e._s(e.$t("click_to_task")))])],1):n("q-btn",{staticClass:"q-px-sm",attrs:{unelevated:"",dense:"","text-color":"primary",color:"primary",label:e.$t("download"),icon:"download"},on:{click:e.download}}),e.playFile||e.preloadFailed?!e.playFile&&e.preloadFailed?n("q-btn",{staticClass:"q-ml-sm q-px-sm cursor-inherit",attrs:{unelevated:"",dense:"",flat:"",ripple:!1,label:e.$t("play_while_downloading"),icon:"ondemand_video","text-color":"primary",color:"primary"}},[n("q-tooltip",[e._v(e._s(e.$t("post_preload_failed")))])],1):n("q-btn",{staticClass:"q-ml-sm q-px-sm",attrs:{unelevated:"",dense:"",label:e.$t("play"),icon:"play_arrow","text-color":"primary",color:"primary"},on:{click:e.play}}):n("q-btn",{staticClass:"q-ml-sm q-px-sm",attrs:{unelevated:"",dense:"",label:e.$t("play_while_downloading"),icon:"ondemand_video","text-color":"primary",color:"primary"},on:{click:e.triggerPlay}})],1):n("div",{staticClass:"no-ab-url"},[n("q-btn",{attrs:{unelevated:"",dense:"",disable:"",label:e.$t("loading")}})],1)])])]),e.screen$xs?n("div",{staticClass:"dialog-actions"},[n("q-separator"),n("q-card-section",{staticClass:"flex q-py-sm"},[n("q-space"),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",label:e.$t("cancel"),color:"general","text-color":"general",unelevated:""}})],1)],1):e._e()],1)},ve=[],we=n("a11f"),ke=n("fc3a"),Ce=n("c5a5");n("0c26");const{languages:$e}=n("1c53"),Se="https://www.opensubtitles.org/subtitleserve/sub/";function xe(){const e=["en","zh","es","fr","de","ru","pt"],t=[],n=[];return Object.entries($e).forEach((([o,a])=>{const s={label:`${a.native}(${o})`,value:o,name:a.name};e.includes(o)?n.push(s):t.push(s)})),[...n,...t]}function Te(e){let t="";for(const n of e)(n.lang||n.url)&&(t&&(t+="%%%"),t=t+n.lang+"%%"+n.url);return t}function Ie(e){const t=[];if(!e||""===e)return t;let n;n=e.includes("%%%")?e.split("%%%"):[e];for(const o of n){const e=o.split("%%");t.push({lang:e[0],url:e[1]})}return t}function Pe(e){let t=e,n="";if(!Array.isArray(e)&&"string"!==typeof e)return n;"string"===typeof e&&(t=Ie(e));for(const o of t)n.includes(o.lang)||(n&&(n+="、"),n+=o.lang);return n}async function Oe(e){const t=n("9ad5");let o=e.trim();return/^\d+$/.test(o)&&(o=`${Se}${o}`),console.log(`requestSubtitleUrl: [${o}]`),!!o.startsWith("http")&&new Promise((e=>{t({method:"get",url:o,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"},responseType:"stream"}).then((t=>{console.log("succ",t.status),e(!0)})).catch((t=>{var n,o;console.log("err",(null===(n=t.response)||void 0===n?void 0:n.status)||t.response||t),429===(null===(o=t.response)||void 0===o?void 0:o.status)&&e(!0),e(!1)}))}))}function qe(e){return/^\d+$/.test(e)}function Ee(e){return qe(e)?Se+e:e}var Ae=n("c033"),De=n("d710"),Ne=n.n(De);const Le=o["a"].observable([]);X["a"].on("preload-failed",(e=>{console.log("preload failed",e),Le.includes(e)||(Le.push(e),console.log(Le))})),X["a"].on("preload-done",(e=>{console.log("preload done",e),Le.includes(e)&&Le.splice(Le.indexOf(e),1)}));const je="requestIdleCallback"in window?requestIdleCallback:e=>setTimeout(e,100);async function Re({url:e,postTitle:t}){if(!Le.includes(e))return new Promise((n=>{je((()=>{X["a"].emit("preload-task",{url:e,postTitle:t}),n()}))}))}const Ue=document.querySelector("#q-app"),Fe=e=>new Promise((t=>setTimeout(t,e)));var Me={name:"PostCard",inject:["rootApp","io"],components:{FollowButton:Ae["a"]},props:{post:{type:Object,required:!0},hideChannel:{type:Boolean},hideButtons:{type:Boolean},disableFollow:{type:Boolean}},data(){return{scrollRoot:Ue,postCardHover:!1,allowClickImage:!0,animating:!1,followBtnHover:!1,pending:!1,favoriteNotifyFns:[],backAbUrl:"",isLoadedChannelImage:!0,isFavorite:ie.isFavorite(this.post.id),lib:r["a"],preloadTriggered:!1,notAvailable:Le}},computed:{followable(){return!r["a"].followingChannels.find((e=>{var t;return e.id===(null===(t=this.post.channel)||void 0===t?void 0:t.id)}))},isBlocked(){var e,t;return null===(e=r["a"].userData.blockChannels)||void 0===e?void 0:e.includes(null===(t=this.post.channel)||void 0===t?void 0:t.id)},isBlockedUser(){var e,t;return null===(e=r["a"].userData.blockUsers)||void 0===e?void 0:e.includes(null===(t=this.post.channel)||void 0===t?void 0:t.creator)},followBtnLabel(){return this.followable?this.$t("follow"):this.followBtnHover?this.$t("unfollow"):this.$t("following")},abKey(){const e=this.post.abUrl||this.backAbUrl;return e?Object(we["a"])(e.includes("://")?e:decodeURIComponent(e)):""},addedStatus(){var e;return(null===(e=r["a"].addedPostMap[this.abKey])||void 0===e?void 0:e.type)||!1},shortChannelTitle(){return this.post.channel&&this.post.channel.title?this.post.channel.title.length>12?this.post.channel.title.substring(0,10)+"...":this.post.channel.title:""},playFile(){var e;return null===(e=r["a"].addedPostMap[this.abKey])||void 0===e?void 0:e.playFile},settings(){var e,t;const n=(null===(e=this.post)||void 0===e||null===(t=e._)||void 0===t?void 0:t["#"])||this.post.soul,o=d["a"].state.setting,a={downloadDirectory:o.downloadDirectory,uploadSpeed:o.uploadSpeed,downloadSpeed:o.downloadSpeed,maximumDownloadNum:o.maximumDownloadNum,maximumConnectionsNum:o.maximumConnectionsNum,payedUserShareRadix:o.payedUserShareRadix,trackers:o.trackerList||[],postTitle:Object(h["b"])(this.post.title)};return n&&(a.fromPost=n),a},subtitleLang(){return Pe(this.post.subtitleList)},preloadFailed(){return this.notAvailable.includes(this.post.abUrl||this.backAbUrl)}},methods:{onCardHover(e){this.postCardHover=e},getRateText(e="G"){switch(e){case"G":return this.$t("rate_g_desc");case"PG":return this.$t("rate_pg_desc");case"PG-13":return this.$t("rate_pg_13_desc");case"R":return this.$t("rate_r_desc");case"NC-17":return this.$t("rate_nc_17_desc")}return this.$t("rate_g_desc")},confirm(e,t={ok:"",cancel:"",message:""}){const n={title:e,ok:t.ok||this.$t("ok"),cancel:t.cancel||this.$t("cancel")};return t.message&&(n.message=t.message),new Promise((e=>{this.$q.dialog(n).onOk((()=>e(!0))).onDismiss((()=>e(!1)))}))},popupImage(){console.log("popup",this.allowClickImage),this.allowClickImage&&this.$emit("preview",this.post.image)},async playAnimation(e,t="#downloading"){if(this.animating)return;this.animating=!0;const n=document.querySelector(t),o=n?n.getBoundingClientRect():{x:0,y:e.clientY,width:0,height:0},a={left:e.clientX-36+"px",top:e.clientY-36+"px"},s={left:o.x+o.width/3-36+"px",top:o.y+o.height/2-36+"px"},i=document.createElement("i");i.classList.add("q-icon","material-icons","text-primary"),i.innerHTML="video_file",i.style.position="absolute",i.style.fontSize="72px",i.style.left=a.left,i.style.top=a.top,i.style.opacity=0,i.style.transform="scale(2.5)",i.style.transition="0.4s ease",document.body.appendChild(i),await Fe(0),i.style.opacity=1,i.style.transform="scale(1)",await Fe(500),i.style.transition="1s ease",i.style.left=s.left,i.style.top=s.top,i.style.transform="scale(0.5)",i.style.opacity=0,await Fe(600),this.animating=!1,document.body.removeChild(i)},async triggerPlay(e){if(!d["a"].getters.accountUserInfo||!d["a"].getters.accountUserInfo.sub)return this.$q.dialog({message:this.$t("login_to_continue"),ok:this.$t("ok")});const t=this.post.abUrl||this.backAbUrl,o=t.includes(":")?t:decodeURIComponent(t);if("string"!==typeof o||!o.startsWith(Ne.a.shortProtocol+"://")&&!o.startsWith(Ne.a.protocol+"://")&&!o.startsWith("magnet:"))return this.$q.notify(this.$t("invalid_download_url")+": "+o);if(!Object(Z["isElectron"])()&&!Object(fe["a"])()){const e=n("c620").wtClient;if(e.torrents[0]){const t=n("7d7c").default;if(this.addedStatus)return t();const o=await this.confirm(this.$t("remove_old_task")+"?",{message:this.$t("remove_old_task_desc")});if(!o)return;e.torrents[0]&&await new Promise((t=>{e.torrents[0].destroy(t)}))}}this.playAnimation(e,"#drawer-player"),await Fe(600);const a=o.startsWith(Ne.a.shortProtocol+"://")?o.replace(Ne.a.shortProtocol+"://",`${Ne.a.protocol}://${encodeURIComponent(this.post.title)}/`):o;if(this.io.emit("download-and-play",{type:"magnet",url:a,token:a,subtitleList:Ie(this.post.subtitleList),...this.settings}),Object(Z["isElectron"])()||Object(fe["a"])()){var s;const e=await Object(Ce["a"])(a);if(!e)return;const t=null===(s=e.match(/([0-9a-fA-F]{40})/))||void 0===s?void 0:s[1];t&&d["a"].dispatch("remotePlay",t)}else{const{default:e}=n("7d7c"),{wtClient:t}=n("c620"),o=setInterval((()=>{t.torrents.length&&(clearInterval(o),e())}),100)}},async download(e){if(!d["a"].getters.accountUserInfo||!d["a"].getters.accountUserInfo.sub)return this.$q.dialog({message:this.$t("login_to_continue"),ok:this.$t("ok")});const t=this.post.abUrl||this.backAbUrl,o=t.includes(":")?t:decodeURIComponent(t);if("string"!==typeof o||!o.startsWith(Ne.a.shortProtocol+"://")&&!o.startsWith(Ne.a.protocol+"://")&&!o.startsWith("magnet:"))return this.$q.notify(this.$t("invalid_download_url")+": "+o);const a=o.startsWith(Ne.a.shortProtocol+"://")?o.replace(Ne.a.shortProtocol+"://",`${Ne.a.protocol}://${encodeURIComponent(this.post.title)}/`):o;console.log(a),console.group("subtitle"),console.log(this.post.subtitleList),console.table(Ie(this.post.subtitleList)),console.groupEnd();const s={type:"url",url:a,token:a,subtitleList:Ie(this.post.subtitleList),...this.settings};if(!Object(Z["isElectron"])()){const e=n("c620").wtClient;if(e.torrents[0]){const t=n("7d7c").default;if(this.addedStatus)return t();const o=await this.confirm(this.$t("remove_old_task"),{message:this.$t("remove_old_task_desc")});if(!o)return;e.torrents[0]&&await new Promise((t=>{e.torrents[0].destroy(t)}))}}this.io.emit("download_torrent",s),this.playAnimation(e,Object(Z["isElectron"])()?"#downloading":"#task-management")},checkChannel(){var e;const t=null===(e=this.post.channel)||void 0===e?void 0:e.id,n=r["a"].channelList.find((e=>e.id===t));return!(!t||!n)||(this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}),!1)},async follow(){if(this.pending)return;if(!this.checkChannel())return;const e=this.post.channel.id,t=!r["a"].followingChannels.find((t=>t&&t.id===e));if(!t){const e=await new Promise((e=>{this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>e(!1))).onDismiss((()=>e(!0)))}));if(e)return}this.pending=!0,setTimeout((()=>{!r["a"].followingChannels.find((t=>t.id===e))===t&&(console.log("follow failed!",e,t),t?r["a"].followChannel(e):r["a"].unfollowChannel(e)),this.pending=!1}),2e3),console.log("follow click",t),t?r["a"].followChannel(e):r["a"].unfollowChannel(e)},async share(){if(!this.checkChannel())return;const e=`${Ne.a.shortProtocol}-library://channel/${Object(h["b"])(this.post.channel.title)}/${this.post.channel.id}`;console.log("share",e);const t=await Object(Ce["a"])(e);if(console.log("converted url"),!t)return this.$q.notify(this.$t("uri_copy_failed"));Object(ke["a"])(t).then((()=>{this.$q.notify(this.$t("copied"))}))},async blockChannel(){if(!this.checkChannel())return;if(console.log("block channel",this.post.channel.id,this.isBlocked),this.isBlocked)return r["a"].unblockChannel(this.post.channel.id).then((e=>{console.log("unblock channel result",e)}));const e=await this.confirm(this.$t("block_channel"),{message:this.$t("block_channel_confirm"),ok:this.$t("block")});e&&r["a"].blockChannel(this.post.channel.id).then((e=>{console.log("block channel result",e)}))},async blockUser(){var e;if(console.log("block user",null===(e=this.post.channel)||void 0===e?void 0:e.creator,this.isBlockedUser),!this.post.channel||!this.post.channel.creator)return;if(this.isBlockedUser)return r["a"].unblockUser(this.post.channel.creator).then((e=>{console.log("unblock user result",e)}));const t=await this.confirm(this.$t("block_creator"),{message:this.$t("block_creator_confirm"),ok:this.$t("block")});t&&r["a"].blockUser(this.post.channel.creator).then((e=>{console.log("block user result",e)}))},toChannelPage(){this.checkChannel()&&this.$emit("to-channel",this.post.channel)},toTaskInfo(){var e;const t=null===(e=this.post.channel)||void 0===e?void 0:e.soul;let n=`/downloader?currentTab=${this.addedStatus}&abKey=${this.abKey}`;t&&(n+=`&channel=${encodeURIComponent(t)}`),this.post.id&&(n+=`&postId=${this.post.id}`),t&&this.post.id&&(n+=`&soul=${encodeURIComponent(t+"/posts/"+this.post.id)}`),console.log("to",this.abKey,this.addedStatus,t,this.post.id),console.log(n),this.$router.push(n)},setFavorite(){const e=this.post.id;var t,n,o,a,s,i,r,l,c,d,u,h,p,m,_;this.isFavorite?ie.remove({id:e},(()=>{this.isFavorite=ie.isFavorite(e)})):ie.add({id:this.post.id,title:this.post.title,description:this.post.description,image:this.post.image,abUrl:this.post.abUrl||this.backAbUrl,soul:null===(t=this.post)||void 0===t||null===(n=t._)||void 0===n?void 0:n["#"],subtitleList:this.post.subtitleList,channel:{id:null===(o=this.post)||void 0===o||null===(a=o.channel)||void 0===a?void 0:a.id,title:null===(s=this.post)||void 0===s||null===(i=s.channel)||void 0===i?void 0:i.title,description:null===(r=this.post)||void 0===r||null===(l=r.channel)||void 0===l?void 0:l.description,image:null===(c=this.post)||void 0===c||null===(d=c.channel)||void 0===d?void 0:d.image,soul:null===(u=this.post)||void 0===u||null===(h=u.channel)||void 0===h||null===(p=h._)||void 0===p?void 0:p["#"],creator:null===(m=this.post)||void 0===m||null===(_=m.channel)||void 0===_?void 0:_.creator}});this.isFavorite=ie.isFavorite(e)},play(){if(!Object(Z["isElectron"])()&&!Object(fe["a"])()&&this.addedStatus){const e=n("7d7c").default;return e()}const{infoHash:e,playFile:t}=r["a"].addedPostMap[this.abKey]||{};console.log("play",e,t);const o=t.path||t;d["a"].dispatch("remotePlay",e),X["a"].emit("play-torrent",{infoHash:e,filepath:o})},onChannelAvatarError(){this.isLoadedChannelImage=!1},takedownPost(){if(!r["a"].isLibAdmin||!this.post.id)return;if(20!==this.post.id.length)return this.$q.notify("Cannot parse post id");const e=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:e[0].value,type:"radio",items:e},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((e=>{console.log(e),["Serious Violation","Copyright Disputes","Adults Only"].includes(e)&&r["a"].takedown("post",this.post.id,e).then((()=>{this.$q.notify(this.$t("success"))}))}))},onChannelAvatarLoaded(e){e.target.src===this.post.channel.image&&(this.isLoadedChannelImage=!0)},onImageError(){this.allowClickImage=!1},onImageLoaded(e){e.target.src===this.post.image&&(this.allowClickImage=!0)},triggerPreload({isIntersecting:e}){if(e&&!this.preloadTriggered&&this.settings.postTitle)return this.preloadFailed?console.log("skip preload failed",this.settings.postTitle):this.addedStatus?console.log("skip added",this.settings.postTitle):void((this.post.abUrl||this.backAbUrl)&&(console.log(`Scroll into view ${this.settings.postTitle}`),this.preloadTriggered=!0,Re({url:this.post.abUrl||this.backAbUrl,postTitle:this.settings.postTitle})))}},activated(){var e,t;this.post.abUrl||(console.log("no aburl",{...this.post}),null!==(e=this.post)&&void 0!==e&&null!==(t=e.channel)&&void 0!==t&&t.soul&&this.post.id&&p["v"].get(this.post.channel.soul+"/posts/"+this.post.id).on(((e,t,n,o)=>{e&&e.abUrl&&(console.log("Get abUrl for",this.post.id,e.abUrl),this.backAbUrl=e.abUrl,o.off())})));this.isFavorite=ie.isFavorite(this.post.id)}},Be=Me,Qe=(n("89d2"),n("9f3e")),We=n("e7c2"),ze=n("b329"),He=n("25fb"),Ve=n("bcaf"),Ge=n("fa4f"),Ke=Object(v["a"])(Be,ye,ve,!1,null,"1374bed6",null),Ye=Ke.exports;C()(Ke,"components",{QCard:E["a"],QCardSection:A["a"],QAvatar:Qe["a"],QIcon:G["a"],QSpace:W["a"],QSeparator:z["a"],QBtn:O["a"],QTooltip:H["a"],QMenu:de["a"],QList:We["a"],QItem:ze["a"],QItemSection:He["a"],QBadge:he["a"],QDialog:q["a"],QVirtualScroll:Ve["a"]}),C()(Ke,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var Je=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page-sticky",{staticClass:"back-to-top",attrs:{position:"bottom-right"}},[n("transition",{attrs:{name:"animate"}},[n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"back-btn q-ma-xs",class:{hide:e.hide},attrs:{fab:"","no-wrap":"",size:"18px",color:"primary","text-color":"primary",icon:"publish"},on:{click:e.onClick}},[n("div",{staticClass:"fab-inner-text"},[e._v("\n "+e._s(e.$t("back_to_top"))+"\n ")])])],1)],1)},Xe=[],Ze={name:"BackToTop",props:{show:Boolean},data(){return{hide:!1,hovered:!1}},methods:{onClick(){this.$emit("click")}},activated(){this.hide=!0,setTimeout((()=>{this.hide=!1}),300)},deactivated(){this.hide=!0}},et=Ze,tt=(n("3408"),n("84f9")),nt=Object(v["a"])(et,Je,Xe,!1,null,"ec8a50cc",null),ot=nt.exports;C()(nt,"components",{QPageSticky:tt["a"],QBtn:O["a"]});var at=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"search-channel"},[n("div",{staticClass:"fixed-bottom-right show-search-channel",class:{higher:e.higher}},[n("q-btn",{staticClass:"channel-search-btn q-ma-xs",class:{hide:e.hide},attrs:{fab:"","no-wrap":"",size:"18px",color:"primary","text-color":"primary",icon:"library_add"},on:{click:function(t){e.showDialog=!0}}},[n("div",{staticClass:"fab-inner-text"},[e._v(e._s(e.$t("search")))])])],1),n("q-dialog",{attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{hide:e.clearInput},model:{value:e.showDialog,callback:function(t){e.showDialog=t},expression:"showDialog"}},[n("q-card",{staticClass:"search-dialog overflow-hidden"},[n("q-card-section",{staticClass:"flex items-center q-py-sm"},[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v(e._s(e.$t("search_for_channel")))]),n("q-space"),n("q-btn",{attrs:{flat:"",round:"",icon:"close"},on:{click:function(t){e.showDialog=!1}}})],1),n("q-card-section",{staticClass:"column items-stretch q-pt-none",staticStyle:{overflow:"visible"}},[n("div",{staticClass:"search-textfield"},[n("q-input",{attrs:{type:"text",outlined:"",dense:"",autofocus:"",label:this.$t("channel")+" ID",placeholder:"%abcd1234"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search.apply(null,arguments)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{color:"primary",name:"search"},on:{click:e.search}})]},proxy:!0}]),model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}})],1),n("q-scroll-area",{staticClass:"items-center",staticStyle:{height:"calc(100vh - 256px)",margin:"4px auto 0",width:"100%"}},[n("div",{staticClass:"search-results full-width flex justify-center items-stretch"},[e._l(e.searchResults,(function(t){return n("ChannelCard",e._b({key:t.id,attrs:{followable:!e.lib.followingChannels.find((function(e){return e.id===t.id}))},on:{detail:e.detail,follow:e.follow}},"ChannelCard",t,!1))})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i")],2)])],1)],1)],1)],1)},st=[],it=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"channel-card column relative-position overflow-hidden rounded-borders",style:{border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"},attrs:{flat:""}},[n("q-img",{staticClass:"channel-image absolute-top-left full-height",staticStyle:{filter:"blur(24px) saturate(1.5)",opacity:"0.2",transform:"scale(1.25)"},attrs:{src:e.image,ratio:1,"placeholder-src":"platform-assets/windows/icon/Wide310x150Logo.scale-240.png"}}),n("div",{staticClass:"image-container overflow-hidden",staticStyle:{"border-top-left-radius":"4px!important","border-top-right-radius":"4px!important"}},[n("q-img",{staticClass:"channel-image cursor-pointer",attrs:{contain:"",src:e.image,ratio:1},on:{click:e.detail,error:e.onImageError},scopedSlots:e._u([{key:"error",fn:function(){return[n("div",{staticClass:"absolute-bottom"},[n("div",{staticClass:"text-h6 ellipsis-3-lines overflow-hidden"},[n("q-icon",{attrs:{name:"video_library"}}),e._v("\n "+e._s(e.title)+"\n ")],1)]),n("q-tooltip",[e._v(e._s(e.editable?e.$t("edit_posts"):e.$t("channel_detail")))])]},proxy:!0}])},[e.image&&e.isHaveImage?e._e():n("q-icon",{staticClass:"absolute-center",staticStyle:{color:"#ccc"},attrs:{size:"90px",name:"subscriptions"}}),n("div",{staticClass:"absolute-bottom"},[n("div",{staticClass:"text-h6 ellipsis-3-lines overflow-hidden"},[e._v("\n "+e._s(e.title)+"\n ")])]),n("q-tooltip",[e._v(e._s(e.editable?e.$t("edit_posts"):e.$t("channel_detail")))])],1)],1),n("q-card-section",{staticClass:"q-py-none",staticStyle:{overflow:"visible"}},[n("div",{staticClass:"q-pa-none row",staticStyle:{margin:"0 -16px"}},[n("div",{staticClass:"q-py-sm q-px-sm q-pl-md",attrs:{"data-cy":"channel-ID"}},[e._v("ID: "+e._s(e.id))]),n("q-space"),n("q-btn",{staticClass:"q-py-xs q-px-sm",attrs:{unelevated:"",icon:"content_copy",size:"xs",dense:""},on:{click:e.copyId}}),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-py-xs q-px-sm",attrs:{unelevated:"",icon:"block",size:"xs",dense:""},on:{click:e.takedown}},[n("q-tooltip",[e._v(e._s(e.$t("takedown_channel")))])],1):e._e()],1),n("div",{staticClass:"q-px-md channel-desc",staticStyle:{margin:"0 -16px"}},[e._v(e._s(e.description))]),n("div",{staticClass:"channel-tags",staticStyle:{margin:"4px -4px 0"}},[e.isBlocked?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"negative","text-color":"negative"}},[e._v(e._s(e.$t("blocked")))]):e._e(),e.hidden?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"general","text-color":"general"}},[e._v(e._s(e.$t("private_channel")))]):e._e()],1)]),n("q-space"),e.hideFollow?n("q-card-actions",[e.editable?n("q-btn",{attrs:{flat:"",icon:"delete",color:"negative"},on:{click:function(t){return t.stopPropagation(),e.remove.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("remove_channel"))+"\n ")])],1):e._e(),n("q-space"),e.editable?n("q-btn",{attrs:{flat:"",icon:"edit"},on:{click:function(t){return t.stopPropagation(),e.detail.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("edit_channel"))+"\n ")])],1):e._e(),e.editable?n("q-btn",{attrs:{flat:"",icon:"find_in_page"},on:{click:function(t){return t.stopPropagation(),e.preview.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("preview"))+"\n ")])],1):e._e(),e.editable?n("q-btn",{attrs:{flat:"",icon:"settings"},on:{click:function(t){return t.stopPropagation(),e.edit.apply(null,arguments)}}},[n("q-tooltip",{attrs:{anchor:"top middle",self:"bottom middle",offset:[10,10]}},[e._v(e._s(e.$t("channel_setting"))+"\n ")])],1):e._e()],1):n("q-card-actions",{staticClass:"flex justify-center items-center"},[n("FollowButton",{staticClass:"q-my-sm",attrs:{id:e.id}})],1)],1)},rt=[],lt=n("aa8a"),ct={name:"ChannelCard",components:{FollowButton:Ae["a"]},data(){return{isHaveImage:!0,lib:r["a"]}},props:{title:{type:String,required:!0},description:{type:String,required:!0},image:{type:String,required:!0},id:{type:String,default:""},soul:{type:String,default:""},hidden:{type:Boolean},editable:{type:Boolean},hideFollow:{type:Boolean},followable:{type:Boolean}},watch:{image(e,t){e&&e!==t&&(this.isHaveImage=!0)}},computed:{isBlocked(){return r["a"].userData.blockChannels.includes(this.id)}},methods:{copyId(){Object(lt["b"])(this.id).then((()=>{this.$q.notify(this.$t("copied_to_clipboard"))}))},edit(){this.editable&&this.$emit("edit",this.id)},detail(){this.$emit("detail",this.id)},onImageError(){this.isHaveImage=!1},preview(){this.$emit("preview",this.id)},follow(){this.$emit("follow",this.id)},remove(){this.$emit("remove-channel",this.id)},takedown(){if(!r["a"].isLibAdmin||!this.id)return;if(20!==this.id.length)return this.$q.notify("Cannot parse post id");const e=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:e[0].value,type:"radio",items:e},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((e=>{console.log(e),["Serious Violation","Copyright Disputes","Adults Only"].includes(e)&&r["a"].takedown("channel",this.id,e).then((()=>{this.$q.notify(this.$t("success"))}))}))}}},dt=ct,ut=(n("4b8c"),n("9767")),ht=Object(v["a"])(dt,it,rt,!1,null,"37cd58ed",null),pt=ht.exports;C()(ht,"components",{QCard:E["a"],QImg:ut["a"],QIcon:G["a"],QTooltip:H["a"],QCardSection:A["a"],QSpace:W["a"],QBtn:O["a"],QBadge:he["a"],QCardActions:N["a"]});var mt={name:"SearchChannel",props:{higher:Boolean},components:{ChannelCard:pt},data(){return{hide:!1,showDialog:!1,searchText:"",searchResults:[],lib:r["a"]}},methods:{clearInput(){this.searchText="",this.searchResults=[]},search(){if(console.log("search",this.searchText),!this.searchText||!this.searchText.trim())return this.$q.dialog({message:this.$t("please_input_channel_id"),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}});const e=this.searchText.trim().replace(/^%/,""),t=r["a"].channelList.filter((t=>!!(t&&t.title&&t.id)&&(t.hidden?t.id===e:t.id.includes(e))));this.searchResults=t,t.length||this.$q.dialog({message:this.$t("search_channel_no_result",[e]),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}})},follow(e){const t=!r["a"].followingChannels.find((t=>t.id===e));if(t)return r["a"].followChannel(e);this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)}))},detail(e){const t=r["a"].allChannelList.find((t=>t.id===e&&t.title&&t.creator));if(!t)return this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}});console.log("find ch",t);const n=["id","title"].map((e=>{const n=t[e];return e+"="+encodeURIComponent(n)})).join("&"),o=`/library/channel?${n}`;this.$root.$emit("navigate-to",o),this.$router.push(o)}},activated(){this.hide=!0,setTimeout((()=>{this.hide=!1}),300)},deactivated(){this.hide=!0,this.clearInput()}},_t=mt,ft=(n("6792"),n("c782")),gt=Object(v["a"])(_t,at,st,!1,null,"1c919252",null),bt=gt.exports;C()(gt,"components",{QBtn:O["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSpace:W["a"],QInput:D["a"],QIcon:G["a"],QScrollArea:ft["a"]});var yt=n("c49d");const vt={data(){return{isActive:!1,searchText:"",lib:r["a"]}},activated(){this.isActive=!0,this.searchText=r["a"].search.text.trim()},deactivated(){this.isActive=!1},watch:{"lib.search.text"(e){this.isActive&&(this.searchText=e.trim())}}};var wt=function(e){const t=function(){return"index"===e||"explore"===e?this.searchFilteredPosts:"favorite"===e?this.filteredFavorites:void 0},n=async function(){this.loader$loadPostsNext?await this.loader$loadPostsNext({count:6}):this.loadNext&&await this.loadNext()};return{data(){return{pagination:{descending:!0,page:1,rowsPerPage:6}}},computed:{tableData:t,pagesNumber(){return Math.ceil(this.tableData.length/this.pagination.rowsPerPage)},currentPageNumber(){return this.pagination.page}},watch:{async currentPageNumber(e){const t=this.$el.querySelector(".library-table>.q-table__grid-content");if(t.scrollTop=0,e===this.pagesNumber)try{this.loading=!0,console.log("query"),await n.call(this)}catch(o){this.$q.notify({type:"negative",position:"bottom-right",message:o.message})}finally{this.loading=!1}}}}};let kt=null;var Ct={data(){return{showBackToTop:!1,scrollContentSelector:".virtual-scroll-grid-wrapper"}},methods:{handleBackToTop(){if(this.showBackToTop){const e=this.$el.querySelector(this.scrollContentSelector);if(!e)return;e.scrollTop=0}else{if(!this.$refs.vscroll)return;this.$refs.vscroll.scrollTo(0,"start")}}},mounted(){const e=this.$el.querySelector(this.scrollContentSelector),t=()=>{this.showBackToTop=e.scrollTop>0};e&&(e.addEventListener("scroll",t),kt=()=>e.removeEventListener("scroll",t))},beforeDestroy(){kt&&kt()}},$t={name:"LibraryExplore",components:{PostCard:Ye,BackToTop:ot,SearchChannel:bt,Loading:S},mixins:[vt,wt("explore"),Ct],data(){return{isElectron:Object(Z["isElectron"])(),active:!1,showPreview:!1,previewImage:"",loadingPosts:!1,loadTimer:null,allPosts:[],loadingNext:!1,loadedAll:!0,loadedChannels:[],loadedPostIds:[],scrollIndex:0,loadingIntersecting:!1,loadStartTime:Date.now(),lib:r["a"]}},computed:{nonFollowingChannels(){const e=this.lib.followingChannels.map((e=>e.id)),t=this.lib.userData.blockChannels,n=this.lib.userData.blockUsers;return this.lib.channelList.filter((o=>!t.includes(null===o||void 0===o?void 0:o.id)&&(!n.includes(null===o||void 0===o?void 0:o.creator)&&!e.includes(null===o||void 0===o?void 0:o.id)))).filter((e=>e))},filteredPosts(){return this.allPosts.filter((e=>e.title&&e.timestamp)).filter((e=>r["a"].isValidRate(e.rate||"G")))},searchFilteredPosts(){const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{switch(t){case"channel":return e.channel.title;case"channelID":return e.channel.id;default:return e.title}},o=o=>{var a,s;if(!o||!o.title)return!1;if(!e)return!0;const i=Object(h["a"])(null===(a=n(o))||void 0===a?void 0:a.toLowerCase());return"channelID"===t&&e===i||(null===(s=o.channel)||void 0===s||!s.hidden)&&i.includes(e)};console.time("filter");const a=this.filteredPosts.filter(o);return console.timeEnd("filter"),a},allPostToFetch(){const e=[];return this.loadedChannels.forEach((({channel:t,ids:n})=>{n.forEach((n=>{this.loadedPostIds.includes(n)||e.push({channel:t,postId:n})}))})),e}},methods:{onScroll(e){this.scrollIndex=e.index},itemsFn(e=0,t=5){return Object(yt["a"])("vitem",e,t),this.searchFilteredPosts.slice(e,e+t)},shouldLoading(e,t){this.loadingIntersecting=e.isIntersecting,e.isIntersecting&&this.loadNext(t)},async loadNext(e=24){if(!this.active)return!1;if(this.loadingNext)return;this.loadingNext=!0,this.allPostToFetch.sort(((e,t)=>e.postId&&t.postId?e.postId.localeCompare(t.postId):0));const t=this.allPostToFetch.slice(0,e);if(Object(yt["a"])("Load Next",t),!t.length)return this.loadingNext=!1,this.loadedAll=!0,void setTimeout((()=>{Object(yt["a"])("try load more"),this.loadPostList()}),3e3);this.loadedAll=!1;const n=await Promise.all(t.map((async({channel:e,postId:t},n)=>(await new Promise((e=>setTimeout(e,Math.floor(Math.random()*n*500)))),{channel:e,post:await r["a"].getPostById(e.id,t,!0)}))));Object(yt["a"])("fetch results",n),n.forEach((({channel:e,post:t})=>{var n;t&&"object"===typeof t&&(e.hidden&&e.creator!==(null===(n=r["a"].user.is)||void 0===n?void 0:n.pub)||(t.channel=e,this.allPosts.push(t)))})),this.loadedPostIds.push(...t.map((e=>e.postId))),this.loadingNext=!1,setTimeout((()=>{Object(yt["a"])("should load next",this.loadingIntersecting),this.loadingIntersecting&&this.loadNext()}),200)},loadPostList(){if(!this.active)return;if(this.loadStartTime+15e3e.id===this.loadedChannels[t].channel.id))||this.loadedChannels.splice(t--,1);const e=this.nonFollowingChannels.filter((e=>!(!e.title||!e.id)&&!this.loadedChannels.find((t=>t.channel.id===e.id))));Promise.all(e.map((async(e,t)=>r["a"].getChannelPostIds(e.id,!0).then((t=>{const n=this.loadedChannels.find((t=>t.channel.id===e.id));if(Object(yt["a"])("[Explore] get channel post ids",e.id,t,!n),n?t.forEach((e=>{n.ids.includes(e)||n.ids.push(e)})):this.loadedChannels.push({channel:e,ids:t}),this.active&&!this.allPosts.length){if(this.loadedChannels.length<7&&this.nonFollowingChannels.length>2)return;this.loadNext()}}))))).then((()=>{if(this.allPosts.length)this.loadingPosts=!1;else{if(!this.active)return;setTimeout((()=>{this.loadingPosts=!1,this.allPosts.length||this.loadPostList()}),2e3)}this.active&&this.loadingIntersecting&&this.loadNext()}))},prune(){const e=this.nonFollowingChannels.map((e=>e.id));for(let o=0;o(t.ids&&e.push(...t.ids),e)),[]);for(let o=0;othis.allPosts[o].id===e));e.includes(null===(n=this.allPosts[o].channel)||void 0===n?void 0:n.id)&&t.includes(this.allPosts[o].id)||(this.allPosts.splice(o--,1),-1!==a&&this.loadedPostIds.splice(a,1))}for(let o=0;oe.id===this.loadedPostIds[o]))||this.loadedPostIds.splice(o--,1)},showPreviewImage(e){this.previewImage=e,this.showPreview=!0},toChannelPage(e){Object(yt["a"])("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&"),n=`/library/channel?${t}`;this.$root.$emit("navigate-to",n),this.$router.push(n)},follow(e){this.lib.followChannel(e).then((t=>{Object(yt["a"])("followed",e,t)}))},goToFollowing(){this.$router.push("/library/following")},setSearch(){this.lib.setSearchOption([{label:this.$t("post_title"),value:"post"},{label:this.$t("channel_title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},activated(){this.active=!0,this.prune(),this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/explore"),this.loadStartTime=Date.now(),this.loadPostList();const e=this;"explore"in window||Object.defineProperty(window,"explore",{get(){return e.loadedChannels}})},deactivated(){this.active=!1},mounted(){this.loadPostList(),this.setSearch()},watch:{nonFollowingChannels(e,t){if(e.length!==t.length){for(let t=0;te.id===this.loadedChannels[t].channel.id))||this.loadedChannels.splice(t--,1);this.loadPostList()}},"lib.search.text"(e){this.isActive&&(this.searchText=e)},"searchFilteredPosts.length"(e,t){t||!e||this.active||(console.log("change length"),this.$router.push("/library/explore"))},searchText(e){e&&this.active&&this.handleBackToTop()}},beforeRouteEnter(e,t,n){n((e=>{t.path.startsWith("/library")&&e.setSearch()}))},beforeRouteLeave(e,t,n){clearTimeout(this.loadTimer),n()}},St=$t,xt=(n("6580"),n("7027")),Tt=n("8a98"),It=n("526f"),Pt=n("d919"),Ot=n("32d0"),qt=n("f065"),Et=Object(v["a"])(St,ge,be,!1,null,"872ead0c",null),At=Et.exports;C()(Et,"components",{QIcon:G["a"],QSpinnerIos:xt["a"],QTable:Tt["a"],QLinearProgress:It["a"],QSeparator:z["a"],QPagination:Pt["a"],QVirtualScroll:Ve["a"],QBtn:O["a"],QTooltip:H["a"],QInnerLoading:Ot["a"],QSpinnerGears:qt["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QCardActions:N["a"]}),C()(Et,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var Dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"scrollEl",staticClass:"library-following row justify-center",class:{web:!e.isElectron}},[e._l(e.filteredChannels,(function(t){return n("ChannelCard",{key:t.id,attrs:{id:t.id,title:t.title,description:t.description,image:t.image,soul:t.soul,hidden:t.hidden,followers:e.lib.channelFollowerCount[t.id],followable:!1,blocked:e.blockMap[t.id]},on:{detail:e.showChannelDetail,follow:e.unfollow}})})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),e.followings.length?e._e():n("div",{staticClass:"no-data"},[n("q-btn",{staticClass:"no-data-btn",attrs:{round:"",color:"primary","text-color":"primary",icon:"arrow_forward",size:"24px"},on:{click:e.goToExplore}},[n("q-tooltip",[e._v(e._s(e.$t("no_following"))+" "+e._s(e.$t("lib_explore")))])],1)],1),n("BackToTop",{attrs:{show:e.scrollOffset>0},on:{click:e.scrollTop}}),n("SearchChannel",{attrs:{higher:e.scrollOffset>0}})],2)},Nt=[],Lt=n("018b"),jt={name:"LibraryFollowing",components:{ChannelCard:pt,SearchChannel:bt,BackToTop:ot},mixins:[vt],data(){return{isElectron:Object(Z["isElectron"])(),scrollOffset:0,lib:r["a"]}},computed:{followings(){return this.lib.followingChannels.filter((e=>!r["a"].isBannedChannel(e)&&(e.title&&e.id)))},blockMap(){const e={};return r["a"].userData&&r["a"].userData.blockChannels?(this.followings.forEach((t=>{(r["a"].userData.blockChannels.includes(t.id)||r["a"].userData.blockUsers.includes(t.creator))&&(e[t.id]=!0)})),e):e},filteredChannels(){const e=this.searchText.toLowerCase();if(!e)return this.followings;const t=r["a"].search.option.value,n=e=>{switch(t){case"channelID":return e.id;default:return e.title}},o=t=>{const o=n(t);return Object(h["a"])(null===o||void 0===o?void 0:o.toLowerCase()).includes(e)};return this.followings.filter(o)}},methods:{scrollTop(){this.$refs.scrollEl.scrollTo(0,0)},showChannelDetail(e){const t=this.followings.find((t=>t.id===e));console.log("to",t);const n=["id","title"].map((e=>{const n=t[e];return encodeURIComponent(e)+"="+encodeURIComponent(n)})).join("&"),o=`/library/channel?${n}`;this.$root.$emit("navigate-to",o),this.$router.push(o)},unfollow(e){this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)}))},goToExplore(){this.$root.$emit("navigate-to"),this.$router.push("/library/explore")},setSearch(){this.lib.setSearchOption([{label:this.$t("title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},activated(){this.setSearch(),this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/following"),this.$refs&&this.$refs.scrollEl&&this.$refs.scrollEl.scrollTo(0,this.scrollOffset)},mounted(){this.setSearch(),this.$refs&&this.$refs.scrollEl&&this.$refs.scrollEl.addEventListener("scroll",Object(Lt["a"])((()=>{this.scrollOffset=this.$refs.scrollEl.scrollTop})))},watch:{searchText(e){e&&this.active&&this.scrollTop()}}},Rt=jt,Ut=(n("3d7e"),Object(v["a"])(Rt,Dt,Nt,!1,null,"0a6f4e44",null)),Ft=Ut.exports;C()(Ut,"components",{QBtn:O["a"],QTooltip:H["a"]});var Mt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"scrollEl",staticClass:"local-favorite",class:{web:!e.isElectron}},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"input-file",accept:".json"},on:{change:e.onFileChange}}),n("div",{staticClass:"library-inner-container"},[n("VirtualScrollGrid",{staticClass:"library-grid",attrs:{virtualScrollSliceRow:30,itemWidth:560,itemHeight:473,gutter:8,itemsSize:e.filteredFavorites.length,itemsFn:function(t,n){return e.filteredFavorites.slice(t,n)}},on:{"virtual-scroll":function(t){var n=t.from;return e.scrollIndex=n||0}},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("PostCard",{key:o.id,attrs:{post:o,followable:!e.lib.followingChannels.some((function(e){return e.id===o.channel.id}))},on:{follow:e.onFollow,preview:e.preview,"to-channel":e.toChannelPage}})]}},{key:"after",fn:function(){return[n("div",{staticClass:"rounded-borders bg-page column justify-center items-center",class:e.filteredFavorites.length?"q-mb-sm q-pa-md":"",style:e.filteredFavorites.length?{}:{height:"calc(100vh - var(--header-height) - var(--appbar-height) - 8px)"}},[e.filteredFavorites.length?e._e():n("div",[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)])]},proxy:!0}])}),e._e()],1),e._e(),n("BackToTop",{attrs:{show:e.scrollIndex>0||e.showBackToTop},on:{click:e.handleBackToTop}}),n("div",{staticClass:"fixed-bottom-right save-or-load",class:{higher:e.scrollIndex>0||e.showBackToTop}},[n("q-btn",{staticClass:"backup-btn q-ma-xs",class:{hide:e.hideBtn},attrs:{fab:"","no-wrap":"",size:"18px",color:"primary",icon:"source"},on:{click:e.saveOrLoad}},[n("div",{staticClass:"fab-inner-text"},[e._v(e._s(e.$t("backup")))])])],1),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1),n("q-dialog",{model:{value:e.showDialog,callback:function(t){e.showDialog=t},expression:"showDialog"}},[n("q-card",[n("q-card-section",{staticClass:"row"},[n("div",{staticClass:"text-h6 col-12"},[e._v(e._s(e.$t("import_or_export_favorites")))]),n("div",{staticClass:"col-12"},[e._v("\n Total: "+e._s(e.favorites.length)+"\n ")]),n("div",{staticClass:"btns col-12 text-right q-mt-md"},[n("q-btn",{attrs:{color:"primary",flat:"",icon:"save",label:e.$t("export_local_favorites")},on:{click:e.exportData}}),n("FileSelector",{attrs:{accept:{name:"JSON",extensions:["json"]}},on:{select:e.onFileChange}},[n("q-btn",{staticClass:"q-ml-md",attrs:{color:"primary",flat:"",icon:"add",label:e.$t("import_favorites_file")}})],1)],1)])],1)],1)],1)},Bt=[],Qt=n("9a50"),Wt={name:"LibraryFavorite",components:{PostCard:Ye,BackToTop:ot,FileSelector:Qt["a"]},mixins:[vt,wt("favorite"),Ct],data(){return{isElectron:Object(Z["isElectron"])(),hideBtn:!1,favorites:ie.list(),scrollIndex:0,showPreview:!1,previewImage:"",showDialog:!1,lib:r["a"]}},computed:{filteredFavorites(){const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{var n;switch(t){case"channel":return null===(n=e.channel)||void 0===n?void 0:n.title;case"postID":return e.id;case"postDesc":return e.description;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(e)};return this.favorites.filter(o)}},methods:{onScroll(e){this.scrollIndex=e.index},preview(e){this.previewImage=e,this.showPreview=!0},remove(e){return ie.remove(e)},saveOrLoad(){this.showDialog=!0},exportData(){Object(h["h"])(JSON.stringify({favorites:this.favorites}),"favorites.json"),this.showDialog=!1},importData(){console.log(this.$refs.fileSelector),this.$refs.fileSelector.value="",this.$refs.fileSelector.click()},onFileChange(e){e&&Object(h["g"])(e).then((e=>{if(!e)return this.$q.notify("Cannot read data from this file");const t=JSON.parse(e);if(!t.favorites||!Array.isArray(t.favorites))return this.$q.notify(this.$t("not_a_favorite_file"));ie.set(t.favorites),this.showDialog=!1}))},onFollow(e){if(r["a"].followingChannels.some((t=>t.id===e||t.soul===e)))return console.log("unfollow"),r["a"].unfollowChannel(e).then(console.log);console.log("follow"),r["a"].followChannel(e).then(console.log)},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&"),n=`/library/channel?${t}`;this.$root.$emit("navigate-to",n),this.$router.push(n)},setSearch(){this.lib.setSearchOption([{label:this.$t("post_title"),value:"postTitle"},{label:this.$t("description"),value:"postDesc"},{label:this.$t("channel_title"),value:"channel"}])}},activated(){this.setSearch(),this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/favorite"),this.hideBtn=!0,setTimeout((()=>{this.hideBtn=!1}),300)},deactivated(){this.hideBtn=!0},watch:{searchText(e){e&&this.active&&this.handleBackToTop()}}},zt=Wt,Ht=(n("2377"),Object(v["a"])(zt,Mt,Bt,!1,null,"c0faef30",null)),Vt=Ht.exports;C()(Ht,"components",{QIcon:G["a"],QTable:Tt["a"],QLinearProgress:It["a"],QSpinnerIos:xt["a"],QSeparator:z["a"],QPagination:Pt["a"],QVirtualScroll:Ve["a"],QBtn:O["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QCardActions:N["a"]}),C()(Ht,"directives",{ClosePopup:K["a"]});var Gt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"edit-container"},[n("div",{ref:"scrollArea",staticClass:"edit-main flex items-stretch justify-center"},[n("div",{staticClass:"add-channel rounded-borders bg-general q-ma-sm flex justify-center items-center column",staticStyle:{"min-height":"290px"}},[n("div",{staticClass:"add-channel-panel relative-position"},[n("q-btn",{directives:[{name:"intersection",rawName:"v-intersection",value:e.intersect,expression:"intersect"}],staticClass:"add-channel-btn block absolute-left",attrs:{round:"",unelevated:"",color:"primary","text-color":"primary",icon:"add_circle_outline",size:"24px"},on:{click:e.add}},[n("q-tooltip",[e._v(e._s(e.$t("add_channel")))])],1),n("q-btn",{staticClass:"quick-start block absolute-right",attrs:{round:"",unelevated:"",color:"primary","text-color":"primary",icon:"add_circle",size:"24px"},on:{click:function(t){e.showQuickStart=!0}}},[n("q-tooltip",[e._v(e._s(e.$t("quick_start_desc")))])],1)],1)]),e._l(e.filteredChannels,(function(t){return n("ChannelCard",{key:t.id,attrs:{title:t.title,description:t.description,image:t.image,id:t.id,soul:t.soul,hidden:t.hidden,followers:e.lib.channelFollowerCount[t.id],editable:!0,hideFollow:""},on:{edit:e.edit,detail:e.showChannelDetail,preview:e.showPreview,"remove-channel":e.removeChannel}})})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("ChannelEdit",{attrs:{title:e.modeTitle,show:e.showEdit,channel:e.edittingChannel,rules:{validateChannelTitle:e.validateChannelTitle,validateChannelDesc:e.validateChannelDesc,validateChannelImage:e.validateChannelImage}},on:{close:function(t){e.showEdit=!1},submit:e.submit}}),n("PostEdit",{attrs:{title:e.postModeTitle,show:e.showPostEdit,post:e.edittingPost,rules:{validatePostTitle:e.validatePostTitle,validatePostDesc:e.validatePostDesc,validatePostImage:e.validatePostImage,validatePostUrl:e.validatePostUrl}},on:{close:function(t){e.showPostEdit=!1},submit:e.submitPost}}),n("QuickStart",{attrs:{show:e.showQuickStart},on:{input:function(t){return e.showQuickStart=t}}})],2),n("BackToTop",{attrs:{show:e.showBackToTop},on:{click:e.scrollTop}}),n("q-dialog",{attrs:{"full-width":"",position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showPostList,callback:function(t){e.showPostList=t},expression:"showPostList"}},[n("PostList",{attrs:{channel:e.listChannel,rules:{validatePostTitle:e.validatePostTitle,validatePostDesc:e.validatePostDesc,validatePostImage:e.validatePostImage,validatePostUrl:e.validatePostUrl},editable:!0},on:{edit:e.showPostEditor,add:e.showPostAdd,"remove-post":e.removePost}})],1)],1)},Kt=[],Yt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.show,"content-class":"fullscreen-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:e.close}},[e.channel?n("q-card",{staticClass:"column no-wrap"},[n("q-card-section",{class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v(e._s(e.title))])]),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-section",{staticClass:"column q-pb-none",class:e.screen$xs?"q-pt-md":"q-pt-none",staticStyle:{width:"560px","max-width":"100%","flex-grow":"1"}},[n("q-input",{attrs:{outlined:"",dense:"","stack-label":"",label:e.$t("channel_title"),rules:[e.rules.validateChannelTitle],placeholder:e.$t("placeholder_channel_title"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.channelTitle,callback:function(t){e.channelTitle=t},expression:"channelTitle"}}),n("q-input",{staticClass:"q-mt-sm",attrs:{outlined:"",dense:"","stack-label":"",label:e.$t("description"),rules:[e.rules.validateChannelDesc],placeholder:e.$t("placeholder_channel_desc"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}}),n("ImageWithPreview",{staticClass:"q-mt-sm",attrs:{label:e.$t("poster"),rules:[e.rules.validateChannelImage]},on:{state:e.updateImageState},model:{value:e.image,callback:function(t){e.image=t},expression:"image"}}),n("q-toggle",{staticStyle:{"margin-top":"-8px"},attrs:{color:"green"},model:{value:e.hidden,callback:function(t){e.hidden=t},expression:"hidden"}},[n("span",[e._v(e._s(e.$t("set_as_private")))]),n("q-tooltip",[e._v(e._s(e.$t("hide_in_explore")))])],1)],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-actions",{staticClass:"q-px-md",class:e.screen$xs?"q-py-sm":"q-py-md",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"q-px-md",attrs:{unelevated:"",color:"general","text-color":"general",label:e.$t("cancel")}}),n("q-btn",{staticClass:"q-px-md",attrs:{unelevated:"",color:"primary","text-color":"primary",label:e.$t("lib_submit")},on:{click:e.submit}})],1)],1):e._e()],1)},Jt=[],Xt=n("d534"),Zt={name:"ChannelEdit",components:{ImageWithPreview:Xt["a"]},props:{show:Boolean,channel:Object,title:String,rules:{validateChannelTitle:Function,validateChannelDesc:Function,validateChannelImage:Function}},data(){const e=[{label:this.$t("channel_title"),key:"title",rules:[this.rules.validateChannelTitle],value:""},{label:this.$t("description"),key:"description",rules:[this.rules.validateChannelDesc],value:""},{label:this.$t("preview")+"(url)",key:"image",rules:[this.rules.validateChannelImage],value:""}];return{inputs:e,channelTitle:"",description:"",image:"",isImageLoaded:!1,hidden:!1}},methods:{close(){this.$emit("close")},updateImageState(e){console.log("img state changed",e),this.isImageLoaded=1===e},submit(){if(this.image&&!this.isImageLoaded)return this.$q.dialog({title:this.$t("invalid_image"),message:this.$t("image_not_reachable"),ok:this.$t("ok")});this.$emit("submit",{title:this.channelTitle,description:this.description,image:this.image,hidden:this.hidden})}},watch:{show(e){e&&this.channel?(this.channelTitle=this.channel.title,this.description=this.channel.description,this.image=this.channel.image,this.channel.hidden?this.hidden=!0:this.hidden=!1):(this.channelTitle="",this.description="",this.image="",this.hidden=!1)}}},en=Zt,tn=n("03bd"),nn=Object(v["a"])(en,Yt,Jt,!1,null,"01839ef4",null),on=nn.exports;C()(nn,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSeparator:z["a"],QInput:D["a"],QToggle:tn["a"],QTooltip:H["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(nn,"directives",{ClosePopup:K["a"]});var an=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.show,persistent:"",position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{input:e.close}},[e.post?n("q-card",{staticClass:"column no-wrap"},[n("q-card-section",{class:[e.screen$xs?"q-py-sm":"q-py-md"]},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.title))])]),n("q-card-section",{staticClass:"row q-pt-none justify-start items-start"},[n("div",{staticClass:"full-width title-input-container"},[n("q-input",{staticClass:"full-width q-mt-xs",attrs:{"bottom-slots":"","stack-label":"",outlined:"",dense:"",label:e.$t("post_title"),rules:[e.rules.validatePostTitle],placeholder:e.$t("placeholder_post_title"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"hint",fn:function(){return[n("div",{directives:[{name:"show",rawName:"v-show",value:e.titleFromTask,expression:"titleFromTask"}],staticClass:"full-width"},[n("span",{staticClass:"task-prefix"},[e._v(e._s(e.$t("task_title"))+":")]),n("span",{staticClass:"title-from-task q-ml-xs text-grey"},[e._v(e._s(e.titleFromTask))]),n("span",{staticClass:"cursor-pointer q-ml-sm set-title",on:{click:e.setTitleFromTask}},[e._v(e._s(e.$t("set_title")))])])]},proxy:!0}],null,!1,1210891792),model:{value:e.postTitle,callback:function(t){e.postTitle=t},expression:"postTitle"}})],1),n("q-input",{staticClass:"full-width q-mt-xs",attrs:{"stack-label":"",outlined:"",dense:"",label:e.$t("description"),rules:[e.rules.validatePostDesc],placeholder:e.$t("placeholder_post_desc"),debounce:500},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.description,callback:function(t){e.description=t},expression:"description"}}),n("ImageWithPreview",{staticClass:"q-mt-xs",attrs:{label:e.$t("poster"),rules:[e.rules.validatePostImage]},on:{state:e.updateImageState},model:{value:e.image,callback:function(t){e.image=t},expression:"image"}}),n("div",{staticClass:"full-width row col-12"},[n("q-input",{staticClass:"col-7 q-pr-md",attrs:{outlined:"",dense:"",label:e.appName+" URL",rules:[e.rules.validatePostUrl],debounce:500},on:{input:e.inputUrl},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.abUrl,callback:function(t){e.abUrl=t},expression:"abUrl"}}),n("q-select",{staticClass:"col-5",attrs:{outlined:"",dense:"","bottom-slots":"","menu-anchor":"bottom right","menu-self":"top end","menu-offset":[0,0],"popup-content-style":"height: 320px !important","use-input":"",label:e.$t("select_from_tasks"),options:e.taskOptions},on:{input:e.selectTask,filter:e.filterOptions},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"hint",fn:function(){return[n("div",{staticClass:"from-magnet",on:{click:function(t){t.stopPropagation(),t.preventDefault(),e.showMagnetInput=!0}}},[e._v("\n "+e._s(e.$t("import_from_magnet"))+"\n ")])]},proxy:!0}],null,!1,1979668889),model:{value:e.abSelect,callback:function(t){e.abSelect=t},expression:"abSelect"}})],1),n("q-select",{staticClass:"q-mt-sm",staticStyle:{width:"100%"},attrs:{outlined:"",dense:"",options:e.rateOptions,label:e.$t("film_rate")},model:{value:e.rate,callback:function(t){e.rate=t},expression:"rate"}}),n("q-markup-table",{staticClass:"q-mt-lg full-width",attrs:{bordered:"",flat:"",dense:"","no-data-label":"I didn't find anything for you"}},[n("thead",[n("tr",[n("th",{attrs:{colspan:"3"}},[n("div",{staticClass:"flex items-center full-width"},[n("div",[e._v(e._s(e.$t("subtitle_list"))+" ("+e._s(e.$t("optional"))+")")]),n("q-btn",{staticClass:"q-ml-sm",attrs:{flat:"",round:"",icon:"help_outline",size:"0.7rem"}},[n("q-tooltip",[e._v(e._s(e.$t("support_subtitle_type"))),n("br"),e._v(e._s(e.$t("recommend_opensubtitles")))])],1),n("q-btn",{staticClass:"q-mx-xs",attrs:{flat:"",round:"",icon:"add",size:"0.7rem"},on:{click:function(t){return e.editSubtitle()}}},[n("q-tooltip",[e._v(e._s(e.$t("add_subtitles")))])],1)],1)])]),e.subtitleList.length?n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("language")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("download_link")))]),n("th",{staticClass:"text-center"})]):e._e()]),n("tbody",e._l(e.subtitleList,(function(t,o){return n("tr",{key:o},[n("td",{staticClass:"text-left"},[e._v(e._s(t.lang))]),n("td",{staticClass:"text-left"},[e._v(e._s(t.url))]),n("td",{staticClass:"text-center"},[n("q-btn",{attrs:{icon:"edit",round:"",flat:"",size:"0.5rem"},on:{click:function(t){return e.editSubtitle(o)}}},[n("q-tooltip",[e._v(e._s(e.$t("lib_edit")))])],1),n("q-btn",{attrs:{icon:"close",color:"red",round:"",flat:"",size:"0.5rem"},on:{click:function(t){return e.modifySubtitleList(o)}}},[n("q-tooltip",[e._v(e._s(e.$t("delete")))])],1)],1)])})),0)])],1),n("q-space"),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("cancel")}}),n("q-btn",{attrs:{flat:"",label:e.$t("lib_submit"),color:"primary"},on:{click:e.submit}})],1)],1):e._e(),n("q-dialog",{ref:"addSubtitleDialog",on:{hide:function(t){e.subtitle={}}},model:{value:e.showSubtitleInput,callback:function(t){e.showSubtitleInput=t},expression:"showSubtitleInput"}},[n("q-card",{staticStyle:{width:"480px"}},[n("q-card-section",[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("add_subtitle_url")))])]),n("q-card-section",{staticClass:"q-pt-none full-width"},[n("q-select",{staticStyle:{width:"200px"},attrs:{dense:"",outlined:"","emit-value":"",label:e.$t("language"),options:e.languageOptions},model:{value:e.subtitle.lang,callback:function(t){e.$set(e.subtitle,"lang",t)},expression:"subtitle.lang"}}),n("q-input",{staticClass:"q-mt-sm",attrs:{label:e.$t("download_link"),outlined:"",dense:"",type:"text",placeholder:"https://www.opensubtitles.org/.../subtitleserve/sub/..."},model:{value:e.subtitle.url,callback:function(t){e.$set(e.subtitle,"url",t)},expression:"subtitle.url"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",color:"primary"}}),n("q-btn",{attrs:{flat:"",icon:"done",loading:e.loading,disable:e.loading},on:{click:function(t){return e.modifySubtitleList(e.subtitle.index,e.subtitle)}},scopedSlots:e._u([{key:"loading",fn:function(){return[n("q-spinner")]},proxy:!0}])})],1)],1)],1),n("q-dialog",{on:{hide:function(t){e.magnetInput=""}},model:{value:e.showMagnetInput,callback:function(t){e.showMagnetInput=t},expression:"showMagnetInput"}},[n("q-card",{staticStyle:{width:"480px"}},[n("q-card-section",{staticClass:"full-width"},[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("input_magnet_url")))]),n("q-input",{attrs:{type:"text"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.magnetInput,callback:function(t){e.magnetInput=t},expression:"magnetInput"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",color:"primary"}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"done"},on:{click:e.fromMagnet}})],1)],1)],1)],1)},sn=[],rn={name:"PostEdit",components:{ImageWithPreview:Xt["a"]},props:{show:Boolean,post:Object,title:String,rules:{validatePostTitle:Function,validatePostDesc:Function,validatePostImage:Function,validatePostUrl:Function}},data(){const e=Ne.a.displayName;return{appName:e,postTitle:"",titleFromTask:"",description:"",image:"",isImageLoaded:!1,abUrl:"",abSelect:null,magnetInput:"",showMagnetInput:!1,rate:{label:this.$t("film_rate"),value:""},showSubtitleInput:!1,loading:!1,subtitle:{},languageOptions:xe(),subtitleList:[],taskOptions:[]}},computed:{rateOptions(){return[{label:this.$t("rate_g"),value:"G"},{label:this.$t("rate_pg"),value:"PG"},{label:this.$t("rate_pg_13"),value:"PG-13"},{label:this.$t("rate_r"),value:"R"},{label:this.$t("rate_nc_17"),value:"NC-17"}]},uploadingTasks(){return d["a"].getters.uploading.filter((e=>!!e.title||(console.log("PostEdit.uploadingTasks:",e),!1))).map((e=>{var t;const n=e.title.length>28?e.title.substring(0,24)+"...":e.title;return{label:n,title:e.title,value:(null===(t=e.abUrl.split("&"))||void 0===t?void 0:t[0])||e.abUrl}}))}},methods:{filterOptions(e,t){console.log("filter",e);const n=e.toLowerCase();t((()=>{this.taskOptions=this.uploadingTasks.filter((e=>e.label.toLowerCase().includes(n)))}))},close(){this.$emit("close")},setTitleFromTask(){this.postTitle=this.titleFromTask,this.titleFromTask=""},inputUrl(e){this.abSelect&&e!==this.abSelect.value&&(this.abSelect=null,this.titleFromTask="")},selectTask(e){this.abUrl=e.value,this.postTitle?this.titleFromTask=e.title:this.postTitle=e.title},updateImageState(e){console.log("img state changed",e),this.isImageLoaded=1===e},async fromMagnet(){if("string"!==typeof this.magnetInput||!this.magnetInput)return;if(!this.magnetInput.startsWith("magnet"))return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});let e=this.magnetInput;if(!e.includes("dn=")){if(!this.postTitle)return this.$q.dialog({message:this.$t("magnet_does_not_have_name"),ok:this.$t("ok")});e+=`&dn=${encodeURIComponent(this.postTitle)}`}const t=await Object(Ce["a"])(e);if(!t)return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});this.abUrl=t},editSubtitle(e){if(this.loading=!1,"number"===typeof e)this.subtitle=JSON.parse(JSON.stringify(this.subtitleList[e])),this.subtitle.index=e;else{if(this.subtitleList.length>=5)return this.$q.notify(this.$t("maximumSubtitleNum_limit"));this.subtitle={index:this.subtitleList.length}}this.showSubtitleInput=!0},async modifySubtitleList(e,t){if(console.log("modifySubtitleList",e),this.loading=!0,t&&"number"===typeof t.index){if(!t.lang||!t.url||""===t.lang)return this.loading=!1,this.$q.dialog({title:this.$t("cannot_add_subtitle"),message:this.$t("cannot_add_subtitle_msg")+this.$t("recommend_opensubtitles"),ok:this.$t("ok")});const n=await Oe(this.subtitle.url);if(this.loading=!1,!n)return this.$q.dialog({title:this.$t("cannot_add_subtitle"),message:this.$t("invalid_download_url"),ok:this.$t("ok")});this.subtitleList[e]=t}else this.subtitleList.splice(e,1);this.$refs.addSubtitleDialog.hide()},async checkSubtitleUrl(){if(!/https:\/\/www\.opensubtitles\.org.*\/subtitleserve\/sub\/\d+$/gm.test(this.subtitle.url)&&!/^\d+$/.test(this.subtitle.url))return this.$t("invalid_download_url");const e=await Oe(this.subtitle.url);return e?void 0:this.$t("invalid_download_url")},submit(){if(this.image&&!this.isImageLoaded)return this.$q.dialog({title:this.$t("invalid_image"),message:this.$t("image_not_reachable"),ok:this.$t("ok")});this.$emit("submit",{title:this.postTitle.trim(),description:this.description.trim(),image:this.image.trim(),rate:this.rate.value,abUrl:this.abUrl.trim(),subtitleList:Te(this.subtitleList).trim()})}},watch:{show(e){if(e&&this.post){if(this.postTitle=this.post.title,this.description=this.post.description,this.image=this.post.image,this.abUrl=this.post.abUrl.includes(":")?this.post.abUrl:decodeURIComponent(this.post.abUrl),this.post.rate){const e=this.rateOptions.find((e=>e.value===this.post.rate));e&&(this.rate={...e})}else this.rate={label:this.$t("film_rate"),value:""};this.subtitleList=Ie(this.post.subtitleList)}else this.postTitle="",this.description="",this.image="",this.abUrl="",this.titleFromTask="",this.abSelect=null,this.rate={label:this.$t("film_rate"),value:""},this.subtitleList=[]}}},ln=rn,cn=(n("1761"),n("4101")),dn=Object(v["a"])(ln,an,sn,!1,null,"48adc3b5",null),un=dn.exports;C()(dn,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QInput:D["a"],QSelect:ue["a"],QMarkupTable:V["a"],QBtn:O["a"],QTooltip:H["a"],QSpace:W["a"],QCardActions:N["a"],QSpinner:w["a"],QColor:cn["a"]}),C()(dn,"directives",{ClosePopup:K["a"]});var hn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"post-list-card column no-wrap overflow-hidden relative-position"},[n("q-card-section",{staticClass:"flex items-center bg-page",class:[e.screen$xs?"q-py-sm":"q-py-md"]},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.channel.title))]),n("q-space"),e.editable?n("q-btn",{staticClass:"q-mx-xs",attrs:{"fab-mini":"",flat:"",icon:"add"},on:{click:e.add}},[n("q-tooltip",[e._v(e._s(e.$t("add_post")))])],1):e._e(),e.editable?n("q-btn",{staticClass:"q-mx-xs",attrs:{"fab-mini":"",flat:"",icon:"file_open"},on:{click:function(t){e.showImport=!0}}},[n("q-tooltip",[e._v(e._s(e.$t("import_data_from_excel")))])],1):e._e(),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],staticClass:"q-ml-xs",attrs:{"fab-mini":"",flat:"",icon:"close"}})],1),n("q-card-section",{staticClass:"q-py-sm q-pb-none"},[n("div",{staticClass:"description"},[e._v(e._s(e.channel.description))])]),n("q-separator"),n("q-card-section",{staticClass:"q-pa-none",staticStyle:{"flex-grow":"1","flex-shrink":"1","overflow-y":"scroll"}},[n("q-markup-table",{attrs:{square:"",flat:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("poster")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("title")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("description")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("film_rate")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("created_time")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("operations")))])])]),n("tbody",{staticClass:"post-table"},e._l(e.sortedPosts,(function(t,o){return n("tr",{key:o},[n("td",{staticClass:"text-left"},[n("img",{attrs:{src:t.image,loading:"lazy",width:"64px"}})]),n("td",{staticClass:"text-left post-title"},[e._v(e._s(t.title))]),n("td",{staticClass:"text-left post-desc",staticStyle:{"min-width":"240px"}},[e._v(e._s(t.description))]),n("td",{staticClass:"text-center"},[e._v(e._s(t.rate))]),n("td",{staticClass:"text-center"},[e._v(e._s(e.stampToString(t.timestamp)))]),n("td",{staticClass:"text-center"},[e.editable?n("q-btn",{attrs:{icon:"edit",round:"",flat:""},on:{click:function(n){return e.edit(t)}}},[n("q-tooltip",[e._v(e._s(e.$t("lib_edit")))])],1):e._e(),e.editable?n("q-btn",{attrs:{icon:"close",color:"red",round:"",flat:""},on:{click:function(n){return e.deletePost(t)}}},[n("q-tooltip",[e._v(e._s(e.$t("delete")))])],1):e._e()],1)])})),0)])],1),n("q-dialog",{attrs:{"content-class":"fullscreen-dialog excel-dialog",position:e.screen$xs?"bottom":"standard"},on:{input:e.importDialogChange},model:{value:e.showImport,callback:function(t){e.showImport=t},expression:"showImport"}},[e.excelFile?n("Excel",{attrs:{file:e.excelFile,channelId:e.channel.id,channelPosts:e.posts,propKeys:e.excelProps,rules:e.rules}}):n("q-card",{staticClass:"import-entry"},[n("q-card-section",{staticClass:"row items-center no-wrap q-py-sm"},[n("div",{staticClass:"text-h6 text-weight-bold"},[e._v(e._s(e.$t("import_data_from_excel")))]),n("q-space"),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",round:""}})],1),n("q-card-section",{staticClass:"row items-center q-pt-none excel-import-dialog"},[n("div",{staticClass:"prop-settings col-12"},[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("set_excel_keys")))]),e._l(e.excelProps,(function(t,o){return n("q-input",{key:o,staticClass:"q-my-sm",attrs:{outlined:"",dense:"",label:t.label},model:{value:t.tableKey,callback:function(n){e.$set(t,"tableKey",n)},expression:"conf.tableKey"}})}))],2),n("q-file",{staticClass:"col-12",attrs:{outlined:"",dense:"",label:e.$t("open_file"),accept:".xls,.xlsx"},model:{value:e.excelFile,callback:function(t){e.excelFile=t},expression:"excelFile"}})],1)],1)],1),n("q-inner-loading",{staticClass:"q-pt-xl",attrs:{showing:e.showLoading,label:e.$t("loading")}},[n("q-spinner-gears",{attrs:{size:"50px",color:"primary"}}),n("div",{staticClass:"text-center"},[e._v(e._s(e.$t("lib_from_network")))])],1)],1)},pn=[],mn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-excel"},[n("q-card",{staticClass:"excel-card"},[n("q-card-section",{staticClass:"excel-main"},[n("div",{staticClass:"text-h6"},[e._v("Excel")]),n("q-markup-table",[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("title")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("description")))]),n("th",{staticClass:"text-left"},[e._v("Url")]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("poster")))]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("film_rate")))]),n("th",{staticClass:"operation"})])]),n("tbody",{staticClass:"post-table"},e._l(e.posts,(function(t,o){return n("tr",{key:t.title},[n("td",{staticClass:"text-left post-title",attrs:{title:t.title}},[e._v(e._s(t.title))]),n("td",{staticClass:"text-left post-desc"},[e._v(e._s(t.description))]),n("td",{staticClass:"text-left post-url",attrs:{title:t.abUrl}},[e._v(e._s(t.abUrl))]),n("td",{staticClass:"text-left post-img"},[n("img",{attrs:{src:t.image,width:"24px",loading:"lazy"}})]),n("td",{staticClass:"text-left post-rating"},[e._v(e._s(t.rate))]),n("td",{staticClass:"text-left post-options"},[n("q-btn",{attrs:{dense:"",flat:"",icon:"close",color:"red"},on:{click:function(t){return e.removePost(o)}}},[n("q-tooltip",[e._v(e._s(e.$t("remove")))])],1)],1)])})),0)])],1),n("q-card-actions",{staticClass:"excel-actions q-pb-xs",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",dense:"",label:e.$t("cancel")}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",dense:"",color:"primary",label:e.$t("lib_submit")},on:{click:e.submit}})],1)],1)],1)},_n=[],fn=n("8b4c"),gn={name:"LibraryExcel",props:{file:{type:File,default:()=>null},channelId:{type:String,default:""},channelPosts:{type:Array,default:()=>[]},rules:{validatePostTitle:Function,validatePostDesc:Function,validatePostImage:Function,validatePostUrl:Function},propKeys:{type:Array,default:()=>[{key:"title",label:(void 0).$t("title"),tableKey:"IMDb Rating"},{key:"abUrl",label:"Alphabiz URL",tableKey:"AB-S"},{key:"description",label:(void 0).$t("description"),tableKey:"描述"},{key:"image",label:(void 0).$t("poster"),tableKey:"海报"},{key:"rate",label:(void 0).$t("film_rate"),tableKey:"分级"}]}},data(){return{posts:[]}},methods:{removePost(e){this.posts.splice(e,1)},readFile(e){return new Promise(((t,n)=>{const o=new FileReader;o.onload=e=>{const o=e.target.result;try{const e=fn["read"](o);t(e)}catch(e){n(e)}},o.onerror=e=>n(e),o.readAsArrayBuffer(e)}))},async parseXlsx(){console.log("parse xlsx",this.file,fn);const e=await this.readFile(this.file);console.log(e),this.$q.loading.show(),this.posts=[];let t=0,n=0,o=0;for(const a in e.Sheets){const s=e.Sheets[a],i=fn["utils"].sheet_to_json(s);console.log("Parsed",i),i.length&&await i.reduce((async(e,a)=>{await e,await new Promise((e=>setTimeout(e)));const s={};for(const n of this.propKeys){if(!a[n.tableKey]||!a[n.tableKey].length)return console.log("[Excel] Failed",n,n.tableKey,a[n.tableKey]),t++;s[n.key]=a[n.tableKey]}if(this.channelPosts.some((e=>e.title===s.title||e.abUrl===s.abUrl)))return console.log("[Excel] Skip existed",s,this.channelPosts.find((e=>e.title===s.title||e.abUrl===s.abUrl))),n++;if(s.abUrl&&s.abUrl.startsWith("magnet"))try{s.abUrl=await Object(Ce["a"])(s.abUrl)}catch(i){console.log("cannot convert abUrl",s.abUrl,i)}if(s.description=s.description.substring(0,299),[this.rules.validatePostTitle(s.title),this.rules.validatePostDesc(s.description),this.rules.validatePostImage(s.image),this.rules.validatePostUrl(s.abUrl)].some((e=>"string"===typeof e)))return console.log("[Excel] Validate error",[s.title,this.rules.validatePostTitle(s.title),s.description,this.rules.validatePostDesc(s.description),s.image,this.rules.validatePostImage(s.image),s.abUrl,this.rules.validatePostUrl(s.abUrl)]),o++;this.posts.push(s)}),Promise.resolve())}this.$q.loading.hide(),this.$q.dialog({title:this.$t("excel_import_succeded"),message:this.$t("excel_import_success_msg",[this.posts.length,t,n,o])})},submit(){return console.log(this.channelId,r["a"],this.posts),this.channelId?this.posts.length?void r["a"].addPosts(this.posts,this.channelId).then(((...e)=>{console.log("add posts",...e)})):this.$q.notify(this.$t("cannot_find_posts")):this.$q.notify(this.$t("cannot_find_channel"))}},watch:{file(e){console.log("file:",e)}},mounted(){console.log("excel mounted"),this.parseXlsx()},activated(){console.log("excel activated")}},bn=gn,yn=(n("5415"),Object(v["a"])(bn,mn,_n,!1,null,"27719a2e",null)),vn=yn.exports;C()(yn,"components",{QCard:E["a"],QCardSection:A["a"],QMarkupTable:V["a"],QBtn:O["a"],QTooltip:H["a"],QCardActions:N["a"]}),C()(yn,"directives",{ClosePopup:K["a"]});const wn=e=>("00"+e).slice(-2);var kn={props:{channel:Object,editable:Boolean,rules:{validatePostTitle:Function,validatePostDesc:Function,validatePostImage:Function,validatePostUrl:Function}},components:{Excel:vn},data(){const e=Ne.a.name;return{appName:e,showLoading:!1,showImport:!1,excelFile:null,posts:[],excelProps:[{key:"title",label:this.$t("title"),tableKey:"IMDb Rating"},{key:"abUrl",label:`${Ne.a.displayName} URL`,tableKey:"AB-S"},{key:"description",label:this.$t("description"),tableKey:this.$t("description")},{key:"image",label:this.$t("poster"),tableKey:this.$t("poster")},{key:"rate",label:this.$t("film_rate"),tableKey:this.$t("film_rate")}]}},inject:["rootApp"],computed:{sortedPosts(){return[...this.posts].sort(((e,t)=>t.timestamp-e.timestamp))}},methods:{loadPosts(){this.showLoading=!0,console.log("load posts",this.channel.id,this.channel),Object(p["o"])(this.channel.id,!this.editable).then((e=>{this.posts=e,console.log("Got posts",e),this.showLoading=!1}))},edit(e){console.log("edit",e,this.channel),this.$emit("edit",e,this.channel)},add(){this.$emit("add",this.channel)},deletePost(e){this.$emit("remove-post",e.id,this.channel.id)},download(e){this.rootApp.promptDownload(e.abUrl,!0)},stampToString(e){if(isNaN(e))return console.log("stamp is not number",e),"-";const t=new Date(e);return isNaN(t.getFullYear())?(console.log("date is invalid",e,t),"-"):[t.getFullYear(),...[t.getMonth()+1,t.getDate()].map(wn)].join("-")+" "+[t.getHours(),t.getMinutes(),t.getSeconds()].map(wn).join(":")},importDialogChange(e){e||(this.excelFile=null)}},mounted(){console.log("mounted",this.channel),this.loadPosts()},beforeDestroy(){console.log("destroyed",this.channel),this.channel&&this.channel.id&&Object(p["y"])(this.channel.id)}},Cn=kn,$n=(n("5e95"),n("3927")),Sn=Object(v["a"])(Cn,hn,pn,!1,null,"1e291392",null),xn=Sn.exports;C()(Sn,"components",{QCard:E["a"],QCardSection:A["a"],QSpace:W["a"],QBtn:O["a"],QTooltip:H["a"],QSeparator:z["a"],QMarkupTable:V["a"],QDialog:q["a"],QInput:D["a"],QFile:$n["a"],QInnerLoading:Ot["a"],QSpinnerGears:qt["a"],QColor:cn["a"]}),C()(Sn,"directives",{ClosePopup:K["a"]});var Tn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.show,persistent:"",position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{input:e.changeShow}},[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",id:"file-selector"},on:{change:e.onFileChange}}),n("input",{ref:"folderSelector",staticStyle:{display:"none"},attrs:{type:"file",webkitdirectory:"",id:"folder-selector"},on:{change:e.onFolderChange}}),n("q-card",{staticClass:"card-container"},[n("q-card-section",{staticClass:"card-header non-selectable",class:{"q-py-sm":e.screen$xs}},[n("div",{staticClass:"text-h6 text-weight-bold q-my-none"},[e._v(e._s(e.$t("quick_start")))])]),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("div",{staticClass:"card-content"},[n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"from-file-or-task flex items-start justify-start q-mb-lg"},[e.isCapacitor?e._e():n("div",{staticClass:"from-file-or-folder q-mt-md col-grow"},[n("q-btn",{staticClass:"full-width",class:{"q-mt-sm":!e.isElectron},attrs:{unelevated:"",dense:e.isElectron,color:"primary","text-color":"primary",label:e.$t("select_file")},on:{click:function(){return e.$refs.fileSelector.click()}}}),e.isElectron?n("q-btn",{staticClass:"full-width q-mt-sm",attrs:{unelevated:"",dense:"",color:"primary","text-color":"primary",label:e.$t("select_folder")},on:{click:function(){return e.$refs.folderSelector.click()}}}):e._e()],1),n("q-select",{staticClass:"col-grow q-mt-md from-upload-task",class:e.isCapacitor?"q-ml-none":"q-ml-sm",attrs:{outlined:"",dense:"","bottom-slots":"","use-input":"","menu-anchor":"bottom right","menu-self":"top end","menu-offset":[0,0],"popup-content-style":"height: 320px !important",behavior:"menu",label:e.$t("select_from_tasks"),options:e.taskOptions},on:{input:e.selectTask,filter:e.filterOptions},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"hint",fn:function(){return[n("div",{staticClass:"from-magnet text-primary cursor-pointer non-selectable",on:{click:function(t){t.stopPropagation(),t.preventDefault(),e.showMagnetInput=!0}}},[e._v("\n "+e._s(e.$t("import_from_magnet"))+"\n ")])]},proxy:!0}]),model:{value:e.abSelect,callback:function(t){e.abSelect=t},expression:"abSelect"}})],1),n("div",{staticClass:"post-inputs"},[n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("post_title"),rules:[e.rules.validatePostTitle]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.postTitle,callback:function(t){e.postTitle=t},expression:"postTitle"}}),n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("placeholder_post_desc"),rules:[e.rules.validatePostDesc]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.postDescription,callback:function(t){e.postDescription=t},expression:"postDescription"}}),n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.appName+" "+e.$t("download_link"),rules:[e.rules.validatePostUrl]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.abUrl,callback:function(t){e.abUrl=t},expression:"abUrl"}}),n("ImageWithPreview",{staticClass:"q-mb-sm",attrs:{label:e.$t("poster"),rules:[e.rules.validatePostImage]},on:{state:e.updatePostImageState},model:{value:e.postImage,callback:function(t){e.postImage=t},expression:"postImage"}}),n("q-select",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",options:e.rateOptions,label:e.$t("film_rate")},model:{value:e.rate,callback:function(t){e.rate=t},expression:"rate"}})],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("div",{staticClass:"channel-option non-selectable"},[n("label",{staticClass:"text-bold q-mr-sm",staticStyle:{"font-size":"1.125rem"}},[e._v(e._s(e.$t("channel_options")))]),n("q-radio",{attrs:{val:!0,label:e.$t("create_new_channel")},model:{value:e.createChannel,callback:function(t){e.createChannel=t},expression:"createChannel"}}),n("q-radio",{attrs:{val:!1,label:e.$t("use_existed_channel")},model:{value:e.createChannel,callback:function(t){e.createChannel=t},expression:"createChannel"}})],1),e.createChannel?n("div",{staticClass:"channel-inputs"},[n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("channel_title"),rules:[e.rules.validateChannelTitle]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.channelTitle,callback:function(t){e.channelTitle=t},expression:"channelTitle"}}),n("q-input",{staticClass:"full-width q-mb-sm",attrs:{dense:"",outlined:"",label:e.$t("placeholder_channel_desc"),rules:[e.rules.validateChannelDesc]},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.channelDescription,callback:function(t){e.channelDescription=t},expression:"channelDescription"}}),n("ImageWithPreview",{attrs:{label:e.$t("channel_poster"),rules:[e.rules.validateChannelImage]},on:{state:e.updateChannelImageState},model:{value:e.channelImage,callback:function(t){e.channelImage=t},expression:"channelImage"}})],1):n("div",{staticClass:"channel-select"},[n("q-select",{staticClass:"full-width",attrs:{outlined:"","bottom-slots":"","use-input":"",dense:"","popup-content-style":"max-height: 320px !important","menu-anchor":"bottom right","menu-self":"top end","menu-offset":[0,0],"data-cy":"select-direct",behavior:"menu",label:e.$t("select_existed_channel"),options:e.channelOptions},on:{filter:e.filterChannels},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"option",fn:function(t){return[n("q-item",e._g(e._b({},"q-item",t.itemProps,!1),t.itemEvents),[n("q-item-section",[n("q-item-label",[n("span",{staticClass:"label"},[e._v(e._s(t.opt.label))]),n("small",{staticClass:"text-grey q-ml-sm"},[e._v(e._s(t.opt.caption))])])],1)],1)]}}]),model:{value:e.selectedChannel,callback:function(t){e.selectedChannel=t},expression:"selectedChannel"}})],1)])],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-actions",{staticClass:"card-footer",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("cancel")}}),n("q-btn",{attrs:{unelevated:"",label:e.$t("lib_submit"),disable:!e.submitReady,"text-color":"primary",color:"primary"},on:{click:e.submit}})],1)],1),n("q-dialog",{attrs:{value:!!e.progressText,persistent:""}},[n("q-card",{staticClass:"progress-card"},[n("q-card-section",[n("div",{staticClass:"text q-pa-md"},[e._v(e._s(e.progressText))])])],1)],1),n("q-dialog",{on:{hide:function(t){e.magnetInput=""}},model:{value:e.showMagnetInput,callback:function(t){e.showMagnetInput=t},expression:"showMagnetInput"}},[n("q-card",{staticStyle:{width:"480px"}},[n("q-card-section",{staticClass:"full-width"},[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("input_magnet_url")))]),n("q-input",{attrs:{type:"text",autofocus:""},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.magnetInput,callback:function(t){e.magnetInput=t},expression:"magnetInput"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close"}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"done",color:"primary","text-color":"primary"},on:{click:e.fromMagnet}})],1)],1)],1)],1)},In=[],Pn=(n("4db2"),n("c976"),n("4d8f"),n("f991"),n("63b1"),n("84f6")),On=n("a3fc"),qn=n.n(On);function En(e){if(!Array.isArray(e)||!e[0])return"";let t=Object(On["dirname"])(e[0]);for(let n=1;n1)t=Object(On["dirname"])(t);return t}var An=n("8a63");const Dn=4e9,Nn=e=>new Promise((t=>setTimeout(t,e))),Ln=()=>{const e=new Uint8Array(12);return crypto.getRandomValues(e),e.reduce(((e,t)=>{const n=t.toString(16).padStart(2,"0");return e+n}),"")};var jn={components:{ImageWithPreview:Xt["a"]},name:"QuickStart",props:{show:Boolean,preset:{required:!1,default:null}},data(){const e=[{label:this.$t("rate_g"),value:"G"},{label:this.$t("rate_pg"),value:"PG"},{label:this.$t("rate_pg_13"),value:"PG-13"},{label:this.$t("rate_r"),value:"R"},{label:this.$t("rate_nc_17"),value:"NC-17"}],t={validateChannelTitle(e){return e.length>0&&e.length<100||ae["b"].t("validate_channel_title_length")},validateChannelDesc(e){return e.length>9&&e.length<301||ae["b"].t("validate_channel_desc_length")},validateChannelImage(e){return!e||(e.match(/\s/)?ae["b"].t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https://"))&&e.length<2048||ae["b"].t("validate_channel_image_url"))},validatePostTitle(e){return e.length>0&&e.length<100||ae["b"].t("validate_post_title_length")},validatePostDesc(e){return e.length>9&&e.length<301||ae["b"].t("validate_post_desc_length")},validatePostImage(e){return!e||(e.match(/\s/)?ae["b"].t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https"))&&e.length<2048||ae["b"].t("validate_post_image_url"))},validatePostUrl(e){if(!e.startsWith(Ne.a.shortProtocol+"://")&&!e.startsWith(Ne.a.protocol+"://"))return ae["b"].t("validate_post_url");const t=Object(we["a"])(e);return 28!==t.length?ae["b"].t("validate_post_url"):e.length<2048||ae["b"].t("validate_post_url_length")}},n=Ne.a.displayName;return{appName:n,rules:t,progressText:"",postTitle:"",titleFromTask:"",postDescription:"",postImage:"",isPostImageLoaded:!1,channelTitle:"",channelDescription:"",channelImage:"",isChannelImageLoaded:!1,abUrl:"",abSelect:null,rateOptions:e,magnetInput:"",showMagnetInput:!1,createChannel:!0,rate:e[0],taskOptions:[],channelFilterInput:"",selectedChannel:{label:"",title:"",id:""},isElectron:Object(Z["isElectron"])(),isCapacitor:Object(fe["a"])()}},computed:{username(){return r["a"].userData.name?r["a"].userData.name:d["a"].getters.accountUserInfo.nickname?d["a"].getters.accountUserInfo.nickname:r["a"].user.name||"-"},uploadingTasks(){return Pn["a"].taskList.uploading.map((e=>this.getTaskOption(e)))},channelOptions(){return r["a"].ownedChannels.filter((e=>!!e.id&&e.title.toLowerCase().includes(this.channelFilterInput))).filter((e=>r["a"].channelList.some((t=>e.id===t.id)))).map((e=>{const t=e.title.length>48?e.title.substring(0,44)+"...":e.title;return{label:t,title:e.title,caption:"%"+e.id,id:e.id}}))},submitReady(){if(this.channelImage&&!this.isChannelImageLoaded)return!1;if(this.channelImage&&!0!==this.rules.validateChannelImage(this.channelImage))return!1;if(this.postImage&&!this.isPostImageLoaded)return!1;if(this.postImage&&!0!==this.rules.validatePostImage(this.postImage))return!1;if(!this.rate)return!1;if(this.createChannel){if([this.rules.validateChannelTitle(this.channelTitle),this.rules.validateChannelDesc(this.channelDescription)].some((e=>!0!==e)))return!1}else if(!this.selectedChannel.id)return!1;return!![this.rules.validatePostTitle(this.postTitle),this.rules.validatePostDesc(this.postDescription),this.rules.validatePostUrl(this.abUrl)].every((e=>!0===e))}},methods:{todo(){this.$q.notify("TODO: This is not impl")},changeShow(e){this.$emit("input",e)},clear(){var e;const t={progressText:"",postTitle:"",titleFromTask:"",postDescription:"",postImage:"",isPostImageLoaded:!1,channelTitle:"",channelDescription:"",channelImage:"",isChannelImageLoaded:!1,abUrl:"",abSelect:null,magnetInput:"",showMagnetInput:!1,createChannel:!0,rate:this.rateOptions[0],taskOptions:[],channelFilterInput:"",selectedChannel:{label:"",title:"",id:""}};null!==(e=this.channelOptions)&&void 0!==e&&e.length&&(t.createChannel=!1,t.selectedChannel=this.channelOptions[0]);for(const n in t)this.$set(this,n,t[n])},getTaskOption(e){var t;const n=e.postTitle||e.name||e.infoHash,o=n.length>36?n.substring(0,32)+"...":n;let a=Object(M["g"])(e.progress||1);if(e.ready)a="100.00%";else if(e.verifyStatus){const{current:t,total:n}=e.verifyStatus,o=t/n,s=Object(M["g"])(o);isNaN(o)||(a=s)}const s=(null===(t=e.alphabizURI.split("&"))||void 0===t?void 0:t[0])||e.alphabizURI,i=Ne.a.shortProtocol+"://"+s.split("/").pop();return{label:e.ready?o:o+` (${a})`,title:n,progress:a,value:i,ready:e.ready}},filterOptions(e,t){const n=e.toLowerCase();t((()=>{this.taskOptions=this.uploadingTasks.filter((e=>e.title.toLowerCase().includes(n)))}))},selectTask(e){this.abUrl=e.value,this.postTitle?this.titleFromTask=e.title:this.postTitle=e.title,this.postDescription||(this.postDescription=this.$t("uploaded_by",{title:e.title,name:this.username}))},filterChannels(e,t){const n=e.toLowerCase();t((()=>{this.channelFilterInput=n}))},updatePostImageState(e){this.isPostImageLoaded=1===e},updateChannelImageState(e){this.isChannelImageLoaded=1===e},showProgress(e,...t){console.log(this.$t("progress")+":",e,...t),this.progressText=e},async createNewChannel(){const e=await r["a"].createChannel(this.channelTitle.trim(),this.channelDescription.trim(),this.channelImage.trim());return console.log("Channel created",e),e},async submit(){let e=!1,t=null;const n=async n=>(clearTimeout(t),t=setTimeout((()=>{e=!0,this.$q.dialog({message:this.$t("quick_start_timeout",[n]),ok:this.$t("ok")})}),11e3),new Promise((e=>setTimeout(e,1e4))));let o=this.selectedChannel.id;if(this.createChannel){this.showProgress(this.$t("creating_new_channel")),await Nn(1e3);const a=await Promise.race([this.createNewChannel(),n(this.$t("create_new_channel"))]);if(clearTimeout(t),console.log(a),e||!a)return this.showProgress("");this.showProgress(this.$t("created_new_channel"),a),await Nn(1e3),o=a.id}this.showProgress(this.$t("creating_new_post")),await Nn(1e3);const a=await Promise.race([r["a"].createPost({title:this.postTitle.trim(),description:this.postDescription.trim(),image:this.postImage.trim(),rate:this.rate.value,abUrl:this.abUrl.trim()},o),n(this.$t("create_new_post"))]);if(e||!a)return this.showProgress("");clearTimeout(t),this.showProgress(this.$t("created_new_post"),a),await Nn(2e3),this.showProgress(""),await Nn(500),this.$emit("input",!1),this.$q.dialog({message:this.$t("success"),ok:this.$t("ok")})},async askForConfirm(e,t){return new Promise((n=>{this.$q.dialog({title:e,message:t,ok:this.$t("ok"),cancel:this.$t("cancel")}).onOk((()=>n(!0))).onCancel((()=>n(!1)))}))},calcFileSize(e){return e.reduce(((e,t)=>e+t.size),0)},async onFileChange(e){var t,o;const a=null===e||void 0===e||null===(t=e.target)||void 0===t||null===(o=t.files)||void 0===o?void 0:o[0];if(a){if(console.log("file selected",a),e.target.value=null,a.size>Dn){const e=await this.askForConfirm(this.$t("file_too_large"),this.$t("file_too_large_msg",{size:Object(M["a"])(a.size)}));if(!e)return}if(Object(Z["isElectron"])())this.createTask(a.path);else{const e=n("c620").wtClient;if(e.torrents.length){const t=await this.askForConfirm(this.$t("remove_old_task"),this.$t("remove_old_task_desc"));if(!t)return;e.torrents[0].destroy(),e.torrents.splice(0)}this.createTask(a)}}},async onFolderChange(e){var t,n,o;console.log("onFolderChange",e),(null===e||void 0===e||null===(t=e.target)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>100&&(this.showProgress(this.$t("resolving_folder_files")),await Nn(100));const a=[...null===e||void 0===e||null===(o=e.target)||void 0===o?void 0:o.files];if(!a)return;console.log("folder selected",a),e.target.value=null;const s=this.calcFileSize(a),i=En(a.map((e=>e.path)));if(this.showProgress(""),await Nn(50),s>Dn){const e=await this.askForConfirm(this.$t("folder_too_large"),this.$t("folder_too_large_msg",{size:Object(M["a"])(s)}));if(!e)return}console.log("TOTAL:",s),console.log("Create task with folder",i),this.createTask(i)},async createTask(e){const t=Ln();this.showProgress(this.$t("creating_new_task")),Object(Z["isElectron"])()?Object(An["g"])(e,t):X["a"].emit("wt-add",e,{token:t});const n=()=>{const e=setInterval((()=>{const n=Pn["a"].taskList.uploading.find((e=>e.token===t)),o=()=>{this.showProgress(""),this.selectTask(this.getTaskOption(n))};if(n.ready&&n.alphabizURI)return clearInterval(e),void o();if(!n.verifyStatus)return this.showProgress(this.$t("loading")+"... (0%)");const a=Object(M["g"])(n.verifyStatus.current/n.verifyStatus.total);this.showProgress(this.$t("loading")+`... (${a})`),n.verifyStatus.current>=n.verifyStatus.total&&n.alphabizURI&&(clearInterval(e),setTimeout(o,1e3))}),1e3)},o=Date.now(),a=setInterval((()=>{const e=Pn["a"].taskList.uploading.find((e=>e.token===t));if(e)clearInterval(a),n();else if(Date.now()-o>3e3)return clearInterval(a),this.showProgress(""),this.askForConfirm(this.$t("cannot_create_task"),this.$t("cannot_create_task_msg"))}),500)},async fromMagnet(){if("string"!==typeof this.magnetInput||!this.magnetInput)return;if(!this.magnetInput.startsWith("magnet"))return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});let e=this.magnetInput;if(!e.includes("dn=")){if(!this.postTitle)return this.$q.dialog({message:this.$t("magnet_does_not_have_name"),ok:this.$t("ok")});e+=`&dn=${encodeURIComponent(this.postTitle)}`}const t=await Object(Ce["a"])(e);if(!t)return this.$q.dialog({title:this.$t("invalid_download_url"),ok:this.$t("ok")});const n=e.split("&").find((e=>e.startsWith("dn="))),o=n?decodeURIComponent(n.substring(3)):this.postTitle;if(!o)return this.$q.dialog({title:this.$t("cannot_get_task_name"),ok:this.$t("ok")});this.selectTask({value:t,label:o,title:o})}},watch:{show(e){e&&this.$nextTick((()=>{this.clear(),this.preset&&this.selectTask(this.getTaskOption(this.preset))}))}}},Rn=jn,Un=(n("50de"),n("2b77")),Fn=n("79e0"),Mn=Object(v["a"])(Rn,Tn,In,!1,null,"7e12c2f2",null),Bn=Mn.exports;C()(Mn,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QSeparator:z["a"],QBtn:O["a"],QSelect:ue["a"],QInput:D["a"],QRadio:Un["a"],QItem:ze["a"],QItemSection:He["a"],QItemLabel:Fn["a"],QCardActions:N["a"]}),C()(Mn,"directives",{ClosePopup:K["a"]});var Qn={name:"EditMain",components:{ChannelCard:pt,ChannelEdit:on,PostEdit:un,PostList:xn,BackToTop:ot,QuickStart:Bn},mixins:[vt],data(){return{current:null,showEdit:!1,edittingChannel:null,mode:"edit",currentId:"",listChannelId:"",edittingPost:null,edittingPostId:"",edittingPostChannelId:"",showPostList:!1,showPostEdit:!1,showBackToTop:!1,showQuickStart:!1,postMode:"edit",lib:r["a"]}},computed:{modeTitle(){return"add"===this.mode?this.$t("add_channel"):this.$t("channel_setting")},postModeTitle(){return"add"===this.postMode?this.$t("add_post"):this.$t("edit_post")},ownedChannels(){return this.lib.ownedChannels.filter((e=>r["a"].channelList.some((t=>t.id===e.id))))},filteredChannels(){const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{switch(t){case"channelID":return e.id;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(e)};return this.ownedChannels.filter(o)},ownedChannelInstances(){return this.lib.ownedChannelInstances},editTitle(){return"edit"===this.mode?this.$t("edit_channel"):this.$t("add_channel")},editPostTitle(){return"edit"===this.postMode?this.$t("edit_post"):this.$t("add_post")},listChannel(){const e=r["a"].ownedChannels.find((e=>e.id===this.listChannelId));return e||{}}},methods:{intersect(e){this.showBackToTop=!e.isIntersecting},scrollTop(){this.$refs.scrollArea.scrollTop=0},edit(e){const t=this.ownedChannels.find((t=>t.id===e));t&&(this.edittingChannel=t,this.currentId=e,this.mode="edit",this.showEdit=!0)},add(){this.edittingChannel={title:"",description:"",image:""},this.mode="add",this.showEdit=!0},validateChannelTitle(e){return e.length>0&&e.length<100||this.$t("validate_channel_title_length")},validateChannelDesc(e){return e.length>9&&e.length<301||this.$t("validate_channel_desc_length")},validateChannelImage(e){return!e||(e.match(/\s/)?this.$t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https://"))&&e.length<2048||this.$t("validate_channel_image_url"))},validateChannel(e){return[this.validateChannelTitle(e.title),this.validateChannelDesc(e.description),this.validateChannelImage(e.image)]},editChannel(e){console.log(e,this.currentId);const t=this.validateChannel(e);t.every((e=>!0===e))?(r["a"].editChannel(this.currentId,e).catch((e=>{console.error(e),this.$q.notify(this.$t("Network Error"))})),this.showEdit=!1):this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},addChannel(e){console.log(e);const t=this.validateChannel(e);if(t.every((e=>!0===e))){const t=this.lib.createChannel(e.title,e.description,e.image,e.hidden);console.log(t),this.showEdit=!1,t.then(console.log)}else this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},submit(e){return"edit"===this.mode?this.editChannel(e):this.addChannel(e)},showPostEditor(e,t){console.log("show",e,t),this.postMode="edit",this.edittingPostId=e.id,this.edittingPostChannelId=t.id,this.edittingPost={...e},this.showPostEdit=!0},showPostAdd(){this.postMode="add",this.edittingPost={title:"",description:"",image:"",abUrl:""},this.showPostEdit=!0},validatePostTitle(e){return e.length>0&&e.length<100||this.$t("validate_post_title_length")},validatePostDesc(e){return e.length>9&&e.length<301||this.$t("validate_post_desc_length")},validatePostImage(e){return!e||(e.match(/\s/)?this.$t("validate_url_no_space"):(e.startsWith("http://")||e.startsWith("https"))&&e.length<2048||this.$t("validate_post_image_url"))},validatePostUrl(e){if(!e.startsWith(Ne.a.shortProtocol+"://")&&!e.startsWith(Ne.a.protocol+"://"))return this.$t("validate_post_url");const t=Object(we["a"])(e);return 28!==t.length?this.$t("validate_post_url"):e.length<2048||this.$t("validate_post_url_length")},validatePost(e){return e.rate?[this.validatePostTitle(e.title),this.validatePostDesc(e.description),this.validateChannelImage(e.image),this.validatePostUrl(e.abUrl)]:[this.$t("select_a_rate")]},editPost(e){const t=this.validatePost(e);t.every((e=>!0===e))?(console.log("edit",e,this.edittingPostChannelId,this.edittingPostId),r["a"].editPost(this.edittingPostChannelId,this.edittingPostId,e),this.showPostEdit=!1):this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},addPost(e){const t=this.validatePost(e);t.every((e=>!0===e))?(console.log("new post to add",e),r["a"].createPost(e,this.edittingPostChannelId),this.showPostEdit=!1):this.$q.dialog({title:this.$t("validate_error"),message:t.filter((e=>!0!==e)).join("; "),ok:this.$t("ok")})},submitPost(e){return"edit"===this.postMode?this.editPost(e):this.addPost(e)},removePost(e,t){console.log("remove post",e,t),this.$q.dialog({title:this.$t("remove_post"),message:this.$t("remove_post_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"gray",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{r["a"].removePost(e,t)}))},removeChannel(e){console.log("remove channel by id:",e),this.$q.dialog({title:this.$t("remove_channel"),message:this.$t("remove_channel_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"gray",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{r["a"].removeChannel(e)}))},showChannelDetail(e){this.listChannelId=e,this.edittingPostChannelId=e,this.showPostList=!0},showPreview(e){const t=r["a"].channelList.find((t=>t.id===e));if(!t)return;const n=["id","title","soul"].map((e=>{const n=t[e];return n?encodeURIComponent(e)+"="+encodeURIComponent(n):""})).filter((e=>e)).join("&"),o=`/library/channel?${n}&fromEdit=1&preview=1`;this.$root.$emit("navigate-to",o),this.$router.push(o)},setSearch(){this.lib.setSearchOption([{label:this.$t("title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},beforeRouteEnter(e,t,n){n((e=>{t.path.startsWith("/library")&&e.setSearch()}))},mounted(){this.setSearch()},activated(){this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/edit")},watch:{searchText(e){e&&this.active&&this.scrollTop()}}},Wn=Qn,zn=(n("61dc"),Object(v["a"])(Wn,Gt,Kt,!1,null,"755ddde0",null)),Hn=zn.exports;C()(zn,"components",{QBtn:O["a"],QTooltip:H["a"],QDialog:q["a"],QColor:cn["a"]}),C()(zn,"directives",{Intersection:Ge["a"]});var Vn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"channel-page"},[n("q-virtual-scroll",{ref:"vscroll",staticClass:"posts",staticStyle:{height:"calc(100vh - 130px - env(safe-area-inset-bottom) - env(safe-area-inset-top))",padding:"0"},attrs:{separator:"",items:e.filteredPosts,"virtual-scroll-slice-size":10,"virtual-scroll-item-size":385,"virtual-scroll-sticky-size-end":16,"virtual-scroll-sticky-size-start":560},on:{"virtual-scroll":e.onScroll},scopedSlots:e._u([{key:"before",fn:function(){return[e.isPreview?n("q-card",{staticClass:"channel-preview-hint",attrs:{id:"channel-preview-hint"}},[n("q-card-section",[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("preview_mode")))]),n("div",{staticClass:"text-subtitle2"},[e._v(e._s(e.$t("preview_mode_desc")))])])],1):e._e(),n("div",{staticClass:"full-width flex justify-center",class:e.screen$xs?["q-pt-sm"]:["q-pt-md"]},[e.channel&&e.channel.id?n("ChannelHeader",{staticClass:"col-grow",class:[e.screen$xs?"q-ml-sm q-mr-xs":"q-mx-md"],attrs:{channel:e.channel},on:{scrollTop:e.scrollTop,intersect:e.intersect}}):e._e()],1)]},proxy:!0},{key:"default",fn:function(t){var o=t.item,a=t.index;return[n("PostCard",{key:a,attrs:{hideChannel:"",post:o},on:{preview:e.preview}})]}},{key:"after",fn:function(){return[n("div",{staticClass:"flex justify-center items-center",class:e.filteredPosts.length?["q-py-xl"]:["full-height"],style:{marginTop:e.filteredPosts.length?"-16px":"0"}},[e.filteredPosts.length?[n("q-icon",{attrs:{name:"check_circle_outline",size:"1.2rem"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("got_all_post")))])]:[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])]],2)]},proxy:!0}])}),n("BackToTop",{attrs:{show:e.scrollIndex>0&&!e.isIntersecting},on:{click:e.scrollTop}}),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1),n("Loading",{attrs:{value:e.loadingPost}})],1)},Gn=[],Kn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"channel-header relative-position overflow-hidden",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.24)",border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"}},[n("q-card-section",{staticStyle:{height:"140px"}},[n("div",{staticClass:"absolute-top-left bg-black full-width full-height overflow-hidden"},[n("img",{staticStyle:{filter:"brightness(0.7)"},attrs:{src:e.channel.image,width:"100%"},on:{error:e.onImageError}}),n("div",{staticClass:"absolute-top-left full-width full-height",staticStyle:{"box-shadow":"inset 0 0 50px rgba(0,0,0,0.8)"}})])]),n("q-card-section",{staticClass:"q-py-none q-pr-none q-mb-md flex no-wrap items-start bg-transparent relative-position",staticStyle:{height:"calc(60px + 4px)"}},[n("q-avatar",{staticClass:"q-ml-xs bg-black",staticStyle:{transform:"translateY(-50%)"},attrs:{size:"120px"}},[e.isLoadChannelImage?n("img",{attrs:{src:e.channel.image},on:{error:e.onChannelImageError,load:e.onChannelImageLoaded}}):e._e(),e.isLoadChannelImage?e._e():n("q-icon",{staticStyle:{color:"#ccc"},attrs:{name:"subscriptions",size:"65px"}})],1),n("div",{staticClass:"q-px-md overflow-hidden full-height full-width flex items-center justify-start"},[n("q-badge",{staticClass:"block q-py-xs cursor-pointer non-selectable",attrs:{color:"general","text-color":"general"},on:{click:function(t){e.showFollowers=!0}}},[n("div",{staticClass:"header-channel-info"},[n("span",{staticClass:"text-weight-bolder"},[e._v(e._s(e.followerCount))]),e._v(" "),n("span",[e._v(e._s(e.$t("followers")))])])]),n("q-space"),n("FollowButton",{attrs:{id:e.channel.id}})],1)],1),n("q-card-section",{staticClass:"q-pt-none column items-stretch",staticStyle:{width:"fit-content","max-width":"100%"}},[n("div",{staticClass:"flex items-center no-wrap overflow-hidden full-width"},[n("div",{staticClass:"channel-title text-h6 text-weight-bold ellipsis col-shrink",attrs:{title:e.channel.title}},[e._v(e._s(e.channel.title))]),n("q-space"),n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"content_copy",size:"xs",dense:""},on:{click:function(t){return e.copy(e.channel.id)}}},[n("q-tooltip",[n("span",[e._v(e._s(e.$t("channel")+" ID: "))]),n("span",[e._v("%"+e._s(e.channel.id))])])],1),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-ml-xs q-pa-xs",attrs:{unelevated:"",dense:"",color:"general","text-color":"general",icon:"block",size:"xs"},on:{click:e.takedownChannel}},[n("q-tooltip",[e._v(e._s(e.$t("takedown_channel")))])],1):e._e()],1),n("div",{staticClass:"flex items-center no-wrap overflow-hidden full-width"},[n("div",{staticClass:"creator-title cursor-pointer ellipsis col-shrink",staticStyle:{"font-size":"0.9rem"},on:{click:e.gotoCreator}},[e._v("\n "+e._s(e.$t("creator"))+": "),n("span",[e._v(e._s(e.creator.name))])]),n("q-space"),e.creator.id?n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"content_copy",size:"xs",dense:""},on:{click:function(t){return e.copy(e.creator.id)}}},[n("q-tooltip",[n("span",[e._v(e._s(e.$t("creator")+" ID: "))]),n("span",[e._v("@"+e._s(e.creator.id))])])],1):e._e(),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-ml-xs q-pa-xs",attrs:{unelevated:"",dense:"",color:"general","text-color":"general",icon:"block",size:"xs"},on:{click:e.takedownCreator}},[n("q-tooltip",[e._v(e._s(e.$t("takedown_user")))])],1):e._e()],1)]),n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"header-description"},[e._v("\n "+e._s(e.channel.description)+"\n ")]),n("div",{staticClass:"header-badges q-mt-sm non-selectable",staticStyle:{height:"min-content"}},[n("div",{staticClass:"overflow-hidden",staticStyle:{margin:"-4px"}},[e.channel.hidden?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"general","text-color":"general",label:e.$t("private_channel")}}):e._e(),e.isBlocked?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"negative","text-color":"negative",label:e.$t("blocked")}}):e._e(),e.isBlockedCreator?n("q-badge",{staticClass:"q-ma-xs q-py-xs",attrs:{color:"negative","text-color":"negative",label:e.$t("creator_blocked")}}):e._e()],1)])]),n("div",{staticClass:"absolute-top-right q-ma-sm flex"},[n("q-btn",{directives:[{name:"intersection",rawName:"v-intersection",value:function(t){return e.$emit("intersect",t)},expression:"e => $emit('intersect', e)"}],attrs:{unelevated:"",round:"",icon:"share","text-color":"white"},on:{click:e.copyShareLink}},[n("q-tooltip",[e._v(e._s(e.$t("share")))])],1)],1),n("q-dialog",{attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showFollowers,callback:function(t){e.showFollowers=t},expression:"showFollowers"}},[n("q-card",{staticClass:"column overflow-hidden no-wrap",style:{minWidth:e.screen$xs?void 0:"560px",maxHeight:e.screen$xs?void 0:"calc(100vh - 120px)"}},[n("q-card-section",{staticClass:"row items-center q-py-sm"},[n("div",{staticClass:"text-h6 follower-title"},[e._v(e._s(e.$t("follower"))+" - "+e._s(e.channel.title))]),n("q-space"),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",icon:"close",round:""}})],1),n("q-separator"),n("q-card-section",{staticClass:"row items-center q-pa-none",staticStyle:{"min-width":"400px","flex-grow":"1","flex-shrink":"1","overflow-y":"auto"}},[n("q-markup-table",{staticStyle:{width:"100%"},attrs:{dense:"",flat:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("user")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("follow_time")))])])]),n("tbody",e._l(e.followers,(function(t){return n("tr",{key:t.id},[n("td",{staticClass:"text-left"},[e._v(e._s(t.user))]),n("td",{staticClass:"text-right"},[e._v(e._s(t.time))])])})),0)])],1)],1)],1)],1)},Yn=[],Jn=(n("7a76"),{components:{FollowButton:Ae["a"]},name:"ChannelHeader",props:{channel:{type:Object,required:!0}},data(){return{creator:{name:this.$t("loading"),id:"",avatar:"",description:""},followBtnHovered:!1,pending:!1,showFollowers:!1,offFollower:null,isLoadChannelImage:!0,followers:[],lib:r["a"]}},computed:{currentCreator(){return r["a"].currentCreator},isBlocked(){return!(!r["a"].userData||!r["a"].userData.blockChannels)&&r["a"].userData.blockChannels.includes(this.channel.id)},isBlockedCreator(){return!(!r["a"].userData||!r["a"].userData.blockUsers)&&r["a"].userData.blockUsers.includes(this.channel.creator)},followable(){return!r["a"].followingChannels.find((e=>e.id===this.channel.id))},followBtnLabel(){return this.followable?this.$t("follow"):this.followBtnHovered?this.$t("unfollow"):this.$t("following")},followerCount(){let e=this.followers.length;return e<1e3?e.toString():(e=Math.floor(e/1e3),e<1e3?e.toString()+"K+":(e=Math.floor(e/1e3),e<1e3?e.toString()+"M+":(e=Math.floor(e/1e3),e.toString()+"B+")))}},methods:{loadCreator(){this.channel.creator.id!==this.creator.id&&(this.creator={name:this.$t("loading"),id:"",avatar:"",description:""}),r["a"].getUserProfile(this.channel.creator).then((e=>{this.creator=e}))},loadFollowers(){p["v"].get(`${p["e"]}/channels:follower/${this.channel.id}`).on(((e,t,n,o)=>{this.offFollower=()=>o.off();const a=Object.values(e);for(let s=0;se.id===s)),i={id:s,user:n,timestamp:o,time:new Date(o).toLocaleString()};-1!==a?this.followers.splice(a,1,i):this.followers.push(i)}}))},copy(e){Object(lt["b"])(e).then((()=>{this.$q.notify(this.$t("copied_to_clipboard"))}))},async copyShareLink(){const e=`${Ne.a.shortProtocol}-library://channel/${Object(h["b"])(this.channel.title)}/${this.channel.id}`,t=await Object(Ce["a"])(e);if(!t)return this.$q.notify(this.$t("uri_copy_failed"));Object(lt["b"])(t).then((()=>{this.$q.notify(this.$t("share_url_copied"))}))},async follow(){if(this.pending)return;const e=this.channel.id;if(!e)return;if(!r["a"].allChannelList.some((t=>t.id===e)))return this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:!0});const t=this.followable;if(!t){const e=await new Promise((e=>{this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>e(!1))).onDismiss((()=>e(!0)))}));if(e)return}this.pending=!0,setTimeout((()=>{!r["a"].followingChannels.find((t=>t.id===e))===t&&(console.log("follow failed!",e,t),t&&r["a"].followChannel(e))}),2e3),t?r["a"].followChannel(e):r["a"].unfollowChannel(e)},gotoCreator(){if(console.log("goto creator",this.currentCreator),!this.currentCreator||!this.currentCreator.name)return this.$q.dialog({title:this.$t("loading_creator"),message:this.$t("wait_for_creator_loaded"),ok:this.$t("ok")});const e=`/library/creator?fromChannel=1&name=${encodeURIComponent(this.currentCreator.name)}`;this.$router.push(e).then((t=>{t instanceof Error||this.$root.$emit("navigate-to",e)}))},takedown(e,t){const n=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:n[0].value,type:"radio",items:n},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((n=>{console.log(n),["Serious Violation","Copyright Disputes","Adults Only"].includes(n)&&r["a"].takedown(e,t,n).then((()=>{this.$q.notify(this.$t("success"))}))}))},takedownCreator(){if(!r["a"].currentCreator||!r["a"].currentCreator.id)return this.$q.notify("Please wait for creator loaded");this.takedown("user",r["a"].currentCreator.id)},takedownChannel(){if(!this.channel.id)return this.$q.notify("Cannot get channel id");this.takedown("channel",this.channel.id)},onImageError(e){e.target.src="developer/platform-assets/linux/512x512.png"},onChannelImageError(){this.isLoadChannelImage=!1},onChannelImageLoaded(e){e.target.src===this.channel.image&&(this.isLoadChannelImage=!0)}},mounted(){this.loadCreator(),this.loadFollowers(),this.$nextTick((()=>{this.$emit("scrollTop")}))},activated(){this.loadCreator(),"function"===typeof this.offFollower&&(this.offFollower(),this.loadFollowers(),this.$nextTick((()=>{this.$emit("scrollTop")})))},beforeDestroy(){"function"===typeof this.offFollower&&this.offFollower()},watch:{followable(){this.pending=!1},currentCreator(){this.loadCreator()},channel(e,t){e&&e.image!==t.image&&(this.isLoadChannelImage=!0)}}}),Xn=Jn,Zn=(n("ec6d"),Object(v["a"])(Xn,Kn,Yn,!1,null,"1d2daf92",null)),eo=Zn.exports;C()(Zn,"components",{QCard:E["a"],QCardSection:A["a"],QAvatar:Qe["a"],QIcon:G["a"],QBadge:he["a"],QSpace:W["a"],QBtn:O["a"],QTooltip:H["a"],QDialog:q["a"],QSeparator:z["a"],QMarkupTable:V["a"],QColor:cn["a"]}),C()(Zn,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var to={name:"LibraryChannel",components:{ChannelHeader:eo,PostCard:Ye,Loading:S,BackToTop:ot},data(){return{channel:{id:""},posts:[],showPreview:!1,loadingPost:!1,previewImage:"",channelFollowers:[],currentId:"",scrollIndex:0,isIntersecting:!1,isChecking:!1,isPreview:!1,showLoading:!1,lib:r["a"]}},computed:{isDev(){return d["a"].getters.isDevMode},isFollowed(){return r["a"].followingChannels.some((e=>e.id===this.channel.id))},isBlocked(){return!(!r["a"].userData||!r["a"].userData.blockChannels)&&(r["a"].userData.blockChannels.includes(this.channel.id)||r["a"].userData.blockUsers.includes(this.channel.creator))},channelPosts(){const e=Object.assign({},this.channel);return this.posts.map((t=>({...t,rate:t.rate||"G",channel:e}))).sort(((e,t)=>t.timestamp-e.timestamp))},filteredPosts(){const e=r["a"].search.text.toLowerCase(),t=r["a"].search.option.value,n=e=>{switch(t){case"description":return e.description;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(Object(h["a"])(e))};return this.channelPosts.filter((e=>!!this.isPreview||!r["a"].isBannedPost(e)&&r["a"].isValidRate(e.rate))).filter(o)}},methods:{intersect(e){this.isIntersecting=e.isIntersecting},onAvatarError(e){e.target.src="developer/platform-assets/linux/512x512.png"},onScroll(e){this.scrollIndex=e.index},scrollTop(){this.$refs.vscroll.scrollTo(0,"start")},loadChannelPosts(){console.log(this.$route.query);const e=this.lib.allChannelList.find((e=>e.id===this.$route.query.id||e.soul===this.$route.query.soul));if(console.log("load channel",e),e){var t,n;if(this.channel=e,this.loadingPost=!0,this.channel.creator||this.channel.soul)r["a"].setCreator(this.channel.creator||(null===(t=this.channel.soul)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n[0]));this.posts=[],r["a"].getChannelPosts(e.id,!0).then((e=>{console.log("Channel posts",e),this.posts=e.sort(((e,t)=>{const n=t.timestamp-e.timestamp;return 0===n?e.title.match(/^\d+/)&&t.title.match(/^\d+/)?parseInt(t.title)-parseInt(e.title):t.title.localeCompare(e.title):n}));const t=Date.now(),n=setInterval((()=>{(this.posts.length||Date.now()-t>5e3)&&(this.loadingPost=!1,clearInterval(n))}),1e3)}))}else{if(this.posts=[],console.log(this.$route.path),"library/channel"!==this.$route.path)return;this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),persistent:!0,ok:this.$t("lib_index")}).onOk((()=>{this.currentId="",this.$root.$emit("navigate-to"),this.$router.push("/library")}))}},loadChannelFollowers(){const e=[];p["v"].get(`${p["e"]}/channels:follower/${this.channel.id}`).on((t=>{if(!t)return;const n=Object.values(t);for(let o=0;oe.id===o));-1!==i?e.splice(i,1,{id:o,user:s,timestamp:a}):e.push({id:o,user:s,timestamp:a})}})),this.channelFollowers=e.sort(((e,t)=>t.timestamp-e.timestamp))},async copyShare(){const e=`ab-library://channel/${Object(h["b"])(this.channel.title)}/${this.channel.id}`;if(console.log("share",e),Object(Z["isElectron"])()){const t=await Object(Ce["a"])(e);if(!t)return this.$q.notify(this.$t("uri_copy_failed"));Object(lt["b"])(t).then((()=>{this.$q.notify(this.$t("copied"))}))}},onFollow(){const e=this.channel.id;console.log("follow",e),r["a"].followingChannels.map((e=>e.id)).includes(e)?this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)})):r["a"].followChannel(e)},preview(e){this.previewImage=e,this.showPreview=!0},gotoCreator(){if(!r["a"].currentCreator||!r["a"].currentCreator.name)return this.$q.dialog({title:"Loading creator",message:"Please wait for creator info loaded",ok:!0});const e=`/library/creator?fromChannel=1&name=${encodeURIComponent(r["a"].currentCreator.name)}`;this.$root.$emit("navigate-to",e),this.$router.push(e)},checkAndReload(){console.log("check and reload"),this.isChecking||(this.isChecking=!0,setTimeout((()=>{this.isChecking=!1}),1e3),this.currentId===this.$route.query.id&&this.channelPosts.length||(console.log("load channel posts"),p["v"].get(`${p["e"]}/channels:follower/${this.currentId}`).off(),this.channel={},this.posts=[],this.currentId=this.$route.query.id,this.loadChannelPosts(),this.loadChannelFollowers()),this.$route.query.preview?this.isPreview=!0:this.isPreview=!1)},setSearch(){this.lib.setSearchOption([{label:this.$t("post_title"),value:"post"},{label:this.$t("description"),value:"description"}])}},mounted(){this.setSearch(),this.checkAndReload()},watch:{"$route.query.id"(e){e&&(console.log("query id check"),this.checkAndReload())},searchText(e){e&&this.active&&this.scrollTop()}},beforeDestroy(){p["v"].get(`${p["e"]}/channels:follower/${this.channel.id}`).off()}},no=to,oo=(n("b16a"),Object(v["a"])(no,Vn,Gn,!1,null,"fb451ef2",null)),ao=oo.exports;C()(oo,"components",{QVirtualScroll:Ve["a"],QCard:E["a"],QCardSection:A["a"],QIcon:G["a"],QDialog:q["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(oo,"directives",{ClosePopup:K["a"]});var so=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.lib.currentCreator?n("div",{ref:"scrollArea",staticClass:"library-creator q-pa-md q-pb-lg"},[n("q-card",{staticClass:"creator-info relative-position overflow-hidden q-mb-sm",style:{boxShadow:"0 1px 2px rgba(0, 0, 0, 0.48)",border:e.$q.dark.isActive?"1px solid rgba(255,255,255,0.24)":"none"}},[n("q-card-section",{directives:[{name:"intersection",rawName:"v-intersection",value:e.intersect,expression:"intersect"}],staticStyle:{height:"140px"}},[n("div",{staticClass:"absolute-top-left bg-black full-width full-height overflow-hidden"},[n("img",{staticStyle:{filter:"brightness(0.7)"},attrs:{src:e.profile.avatar,width:"100%"},on:{error:e.onAvatarError}}),n("div",{staticClass:"absolute-top-left full-width full-height",staticStyle:{"box-shadow":"inset 0 0 50px rgba(0,0,0,0.8)"}})])]),n("q-card-section",{staticClass:"q-py-none q-mb-md q-pr-none flex no-wrap items-start bg-transparent relative-position",staticStyle:{height:"calc(60px + 4px)"}},[n("q-avatar",{staticClass:"q-ml-xs bg-black creator-avatar",attrs:{size:"120px"}},[e.isLoadCreatorAvatar?n("img",{attrs:{src:e.profile.avatar},on:{error:e.onCreatorAvatarError,load:e.onCreatorAvatarLoaded}}):e._e(),e.isLoadCreatorAvatar?e._e():n("q-icon",{staticStyle:{color:"#ccc"},attrs:{name:"account_circle",size:"90px"}})],1),n("div",{staticClass:"q-px-md overflow-hidden full-height full-width flex items-center justify-start"})],1),n("q-card-section",{staticClass:"q-pt-none column items-start overflow-hidden full-width"},[n("div",{staticClass:"channel-title text-h6 text-weight-bold ellipsis",staticStyle:{"max-width":"100%"},attrs:{title:e.profile.name}},[e._v("\n "+e._s(e.profile.name)+"\n ")]),e.profile.id?n("div",{staticClass:"flex items-center no-wrap overflow-hidden",staticStyle:{width:"fit-content","max-width":"100%"}},[n("div",{staticClass:"creator-id ellipsis col-shrink",staticStyle:{"font-size":"0.9rem"}},[n("span",[e._v("@"+e._s(e.profile.id))])]),n("q-space"),n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"content_copy",size:"xs",dense:""},on:{click:e.copyCreatorId}},[n("q-tooltip",[n("span",[e._v(e._s("ID: "))]),n("span",[e._v("@"+e._s(e.profile.id))])])],1),e.lib.isLibAdmin?n("q-btn",{staticClass:"q-ml-sm q-pa-xs",attrs:{unelevated:"",color:"general","text-color":"general",icon:"block",size:"xs",dense:""},on:{click:e.takedownCreator}},[n("q-tooltip",[n("span",[e._v(e._s(e.$t("takedown_user")))])])],1):e._e()],1):e._e()]),e.profile.description?n("q-card-section",{staticClass:"q-pt-none creator-section overflow-hidden"},[n("div",{staticClass:"creator-description q-mb-sm scroll-y"},[e._v(e._s(e.profile.description))])]):e._e()],1),n("div",{staticClass:"creator-flex-layout flex justify-center"},[e.filteredChannels.length?[e._l(e.filteredChannels,(function(t){return n("ChannelCard",{key:t.id,attrs:{id:t.id,title:t.title,description:t.description,image:t.image,soul:t.soul,hidden:t.hidden,followable:!e.followedIds.includes(t.id)},on:{takedown:e.takedownChannel,detail:e.showChannelDetail,follow:e.onFollow}})})),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i"),n("i")]:n("div",{staticClass:"empty-placeholder full-width text-center text-subtitle1"},[n("q-icon",{attrs:{name:"help_outline"}}),n("span",{staticClass:"empty-hint q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)],2),n("BackToTop",{attrs:{show:e.showBackToTop},on:{click:e.scrollTop}})],1):e._e()},io=[],ro={name:"LibraryCreator",components:{ChannelCard:pt,BackToTop:ot},mixins:[vt],data(){return{profile:{name:this.$t("loading"),id:"",avatar:"",description:""},showBackToTop:!1,isLoadCreatorAvatar:!0,lib:r["a"]}},computed:{filteredChannels(){const e=this.searchText.toLowerCase(),t=this.lib.search.option.value,n=e=>{switch(t){case"channelID":return e.id;default:return e.title}},o=o=>{var a;const s=Object(h["a"])(null===(a=n(o))||void 0===a?void 0:a.toLowerCase());return"channelID"===t&&s===e||!(o.hidden&&!r["a"].followingChannels.find((e=>e.id===o.id)))&&s.includes(e)};return this.lib.currentCreator.channels.filter((e=>r["a"].channelList.some((t=>t.id===e.id)))).filter(o)},followedIds(){return r["a"].followingChannels.map((e=>e.id))}},watch:{profile(e,t){if(e&&e.avatar!==t.avatar&&(this.isLoadCreatorAvatar=!0),e&&e.name){const t=`/library/creator?fromChannel=1&name=${encodeURIComponent(e.name)}`;this.$root.$emit("update-path",t)}},searchText(e){e&&this.active&&this.scrollTop()}},methods:{intersect(e){this.showBackToTop=!e.isIntersecting},scrollTop(){this.$refs.scrollArea.scrollTop=0},loadProfile(){this.profile={name:this.$t("loading"),id:"",avatar:"",description:""},r["a"].getUserProfile(r["a"].currentCreator.id).then((e=>{this.profile=e}))},onAvatarError(e){e.target.src="developer/platform-assets/linux/512x512.png"},onCreatorAvatarError(){this.isLoadCreatorAvatar=!1},onCreatorAvatarLoaded(e){e.target.src===this.profile.avatar&&(this.isLoadCreatorAvatar=!0)},showChannelDetail(e){const t=Object(h["c"])(e);console.log(t),this.$root.$emit("navigate-to",t),this.$router.push(t)},copyCreatorId(){Object(lt["b"])(this.profile.id).then((()=>{this.$q.notify(this.$t("copied"))}))},takedown(e,t){const n=[{value:"Serious Violation",label:this.$t("serious_violation")},{value:"Copyright Disputes",label:this.$t("copyright_disputes")},{value:"Adults Only",label:this.$t("adults_only")}];this.$q.dialog({options:{model:n[0].value,type:"radio",items:n},message:this.$t("select_takedown_reason"),ok:this.$t("take_down"),cancel:this.$t("cancel")}).onOk((n=>{["Serious Violation","Copyright Disputes","Adults Only"].includes(n)&&r["a"].takedown(e,t,n).then((()=>{this.$q.notify(this.$t("success"))}))}))},takedownCreator(){if(!r["a"].currentCreator.id)return this.$q.notify("Please wait for creator loaded");this.takedown("user",r["a"].currentCreator.id)},takedownChannel(e){if(!e||20!==e.length)return this.$q.notify("Cannot parse channel id");this.takedown("channel",e)},onFollow(e){console.log("follow",e),this.followedIds.includes(e)?this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}).onOk((()=>{r["a"].unfollowChannel(e)})):r["a"].followChannel(e)},setSearch(){this.lib.setSearchOption([{label:this.$t("channel_title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])}},beforeRouteEnter(e,t,n){n((e=>{t.path.startsWith("/library")&&(e.setSearch(),r["a"].setCreator(r["a"].currentCreator.id))}))},mounted(){this.setSearch()},activated(){this.loadProfile()}},lo=ro,co=(n("878c"),Object(v["a"])(lo,so,io,!1,null,"5975beaa",null)),uo=co.exports;C()(co,"components",{QCard:E["a"],QCardSection:A["a"],QAvatar:Qe["a"],QIcon:G["a"],QSpace:W["a"],QBtn:O["a"],QTooltip:H["a"],QColor:cn["a"]}),C()(co,"directives",{Intersection:Ge["a"]});var ho=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"take-down"},[n("div",{staticClass:"text-h6"},[e._v("\n "+e._s(e.$t("takedown_management"))+"\n "),n("q-icon",{attrs:{name:"help"}},[n("q-tooltip",e._l(e.$t("about_takedown_mode").split("\n"),(function(t){return n("div",{key:t,staticStyle:{"font-size":"14px"}},[e._v(e._s(t))])})),0)],1)],1),n("div",{staticClass:"take-down-lists"},e._l(e.takedownList,(function(t){var o=t.type,a=t.label,s=t.list,i=t.model;return n("q-table",{key:o,staticStyle:{"max-height":"400px"},attrs:{flat:"",dense:"",title:a,data:s,columns:e.columns,"row-key":"name","virtual-scroll":"","rows-per-page-options":[0]},scopedSlots:e._u([{key:"top-row",fn:function(){return[n("q-tr",{staticClass:"takedown-row add"},[n("q-td",{staticClass:"takedown-id"},[n("q-input",{attrs:{placeholder:e.$t(o)+" ID",dense:""},model:{value:i.id,callback:function(t){e.$set(i,"id",t)},expression:"model.id"}})],1),n("q-td",{staticClass:"takedown-reason"},[n("q-select",{attrs:{options:e.reasonOptions,label:e.$t("takedown_reason"),dense:""},model:{value:i.reason,callback:function(t){e.$set(i,"reason",t)},expression:"model.reason"}})],1),n("q-td",[e._v(e._s(e.$t(e.mode)))]),n("q-td",{staticClass:"takedown-admin"},[e._v("("+e._s(e.$t("you"))+")")]),n("q-td",{staticClass:"text-center"},[n("q-btn",{attrs:{flat:"",dense:"",color:"primary",icon:"add"},on:{click:function(t){return e.addTakedown(o)}}})],1)],1)]},proxy:!0},{key:"body",fn:function(t){var a=t.row;return[n("q-tr",{key:a.id,staticClass:"takedown-row"},[n("q-td",{key:"id",staticClass:"takedown-id",attrs:{title:a.id}},[n("q-btn",{staticClass:"q-mr-sm",attrs:{flat:"",dense:"",color:"general",icon:"content_copy",size:"xs"},on:{click:function(t){return e.copy(a.id)}}},[n("q-tooltip",[e._v(e._s(e.$t("copy"))+" ID")])],1),n("span",[e._v(e._s(a.id))])],1),n("q-td",{key:"reason",staticClass:"takedown-reason"},[e._v(e._s(a.reasonLabel))]),n("q-td",{key:"by",staticClass:"takedown-by"},[e._v(e._s(e.$t(a.by)))]),n("q-td",{key:"admins",staticClass:"takedown-admins"},[a.admins?n("div",[n("span",{staticClass:"voted-count",class:{"text-primary":a.selfVoted}},[n("span",[e._v(e._s(a.admins.length)+" voted")]),a.selfVoted?n("q-tooltip",[e._v("You have voted")]):e._e()],1),"committee"===a.by?n("span",{staticClass:"total-count",class:{"text-primary":a.admins.length>=a.minCount}},[e._v("\n / "+e._s(a.minCount)+" needs to takedown\n ")]):e._e()]):n("div",[e._v("-")])]),n("q-td",{key:"operations",staticClass:"takedown-operations text-center"},[n("q-btn",{attrs:{flat:"",dense:"",size:"xs",color:a.selfVoted?"negative":"positive",icon:a.selfVoted?"close":"add"},on:{click:function(t){return e.changeVote(o,a)}}}),"preset"===a.by?n("q-tooltip",[e._v(e._s(e.$t("cannot_edit_preset")))]):a.selfVoted?n("q-tooltip",[e._v(e._s(e.$t("remove_vote")))]):n("q-tooltip",[e._v(e._s(e.$t("add_vote")))])],1)],1)]}}],null,!0)})})),1)])},po=[],mo=n("41c7"),_o=n.n(mo);const fo=["Serious Violation","Copyright Disputes","Adults Only"];var go={name:"TakeDown",data(){return{mode:_o.a.mode,columns:[{name:"id",label:"ID",field:"id",align:"left",sortable:!0},{name:"reason",label:this.$t("takedown_reason"),field:"reason",align:"left",sortable:!0},{name:"by",label:this.$t("takedown_mode"),field:"by",align:"left",sortable:!0},{name:"admins",label:this.$t("admins"),field:"admins",align:"left",sortable:!1},{name:"operations",label:this.$t("operations"),field:"operations",align:"center",sortable:!1}],reasonOptions:[{label:this.$t("serious_violation"),value:"Serious Violation"},{label:this.$t("copyright_disputes"),value:"Copyright Disputes"},{label:this.$t("adults_only"),value:"Adults Only"}],user:{id:"",reason:{label:this.$t("serious_violation"),value:"Serious Violation"}},channel:{id:"",reason:{label:this.$t("serious_violation"),value:"Serious Violation"}},post:{id:"",reason:{label:this.$t("serious_violation"),value:"Serious Violation"}},lib:r["a"]}},computed:{uid(){return r["a"].user&&r["a"].user.is?r["a"].user.is.pub:""},takedownUsers(){const e=r["a"].takedownList.users,t=r["a"].takedownExtraList.users,n=[];return e.forEach((({id:e,reason:t})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),by:"preset",disable:!0})})),t.forEach((({id:e,reason:t,admins:o,minCount:a})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),admins:o,minCount:a,selfVoted:o.includes(this.uid),by:_o.a.mode,disable:!o.includes(this.uid)})})),n},takedownChannels(){const e=r["a"].takedownList.channels,t=r["a"].takedownExtraList.channels,n=[];return e.forEach((({id:e,reason:t})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),by:"preset",disable:!0})})),t.forEach((({id:e,reason:t,admins:o,minCount:a})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),admins:o,minCount:a,selfVoted:o.includes(this.uid),by:_o.a.mode,disable:!o.includes(this.uid)})})),n},takedownPosts(){const e=r["a"].takedownList.posts,t=r["a"].takedownExtraList.posts,n=[];return e.forEach((({id:e,reason:t})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),by:"preset",disable:!0})})),t.forEach((({id:e,reason:t,admins:o,minCount:a})=>{n.push({id:e,reason:t,reasonLabel:this.$t(t.replace(/\s/g,"_").toLowerCase()),admins:o,minCount:a,selfVoted:o.includes(this.uid),by:_o.a.mode,disable:!o.includes(this.uid)})})),n},takedownList(){return[{type:"user",label:this.$t("users"),model:this.user,list:this.takedownUsers},{type:"channel",label:this.$t("channels"),model:this.channel,list:this.takedownChannels},{type:"post",label:this.$t("posts"),model:this.post,list:this.takedownPosts}]}},methods:{takedownUser(){return 87!==this.user.id.length||this.user.id.split(".").some((e=>43!==e.length))?this.$q.notify(this.$t("takedown_invalid_user_id")):fo.includes(this.user.reason.value)?(console.log("takedown user",this.user.id,this.user.reason.value),void r["a"].takedown("user",this.user.id,this.user.reason.value).then(console.log)):this.$q.notify(this.$t("takedown_invalid_reason"))},takedownChannel(){const e=this.channel.id;return 20!==e.length?this.$q.notify(this.$t("takedown_invalid_channel_id")):fo.includes(this.channel.reason.value)?void r["a"].takedown("channel",e,this.channel.reason.value):this.$q.notify(this.$t("takedown_invalid_reason"))},takedownPost(){const e=this.post.id;return 20!==e.length?this.$q.notify(this.$t("takedown_invalid_post_id")):fo.includes(this.post.reason.value)?void r["a"].takedown("post",e,this.post.reason.value):this.$q.notify(this.$t("takedown_invalid_reason"))},untakedownUser(e){r["a"].takedown("user",e,"None")},addTakedown(e){return console.log("add",e),"user"===e?this.takedownUser():"channel"===e?this.takedownChannel():"post"===e?this.takedownPost():void 0},removeTakedown(e,t){return console.log("untakedown",e,t),"user"===e?this.untakedownUser(t):"channel"===e?r["a"].takedown("channel",t,"None"):"post"===e?r["a"].takedown("post",t,"None"):void 0},changeVote(e,t){return"preset"===t.by?console.log(t):t.selfVoted?this.removeTakedown(e,t.id):void r["a"].takedown(e,t.id,t.reason).then(console.log)},copy(e){Object(lt["b"])(e).then((()=>{this.$q.notify(this.$t("copied"))}))}},activated(){this.$root.$emit("navigate-to"),this.$root.$emit("navigate-to","/library/takedown"),this.lib.setSearchOption([])}},bo=go,yo=(n("a44b"),n("85c4")),vo=n("236f"),wo=Object(v["a"])(bo,ho,po,!1,null,"888fffa4",null),ko=wo.exports;C()(wo,"components",{QIcon:G["a"],QTooltip:H["a"],QTable:Tt["a"],QTr:yo["a"],QTd:vo["a"],QInput:D["a"],QSelect:ue["a"],QBtn:O["a"],QColor:cn["a"]});var Co=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"library-index"},[n("div",{staticClass:"library-inner-container"},[n("VirtualScrollGrid",{staticClass:"library-grid",attrs:{virtualScrollSliceRow:30,itemWidth:560,itemHeight:473,gutter:8,itemsSize:e.searchFilteredPosts.length,itemsFn:function(t,n){return e.itemsFn(t,n-t)}},on:{"virtual-scroll":function(t){var n=t.from;return e.scrollIndex=n||0}},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("PostCard",{key:o.id,attrs:{post:o},on:{preview:function(t){return e.showPreview=t},follow:e.unfollow,"to-channel":e.toChannelPage}})]}},{key:"after",fn:function(t){var o=t.column,a=t.mod;return[n("div",{directives:[{name:"intersection",rawName:"v-intersection",value:function(t){return e.fetchNext(t,Math.max(Math.ceil(10/o),2)*o+(a?o-a:0))},expression:"(entry) => fetchNext(entry, (Math.max(Math.ceil(10 / column), 2) * column) + (mod ? column - mod : 0))"}],staticClass:"rounded-borders bg-page column justify-center items-center",class:e.searchFilteredPosts.length?"q-mb-sm q-pa-md":"",style:e.searchFilteredPosts.length?{}:{height:"calc(100vh - var(--header-height) - var(--appbar-height) - 8px)"}},["loaded"!==e.loaderState||e.searchFilteredPosts.length?"loaded"===e.loaderState?n("div",[n("q-icon",{attrs:{name:"check_circle_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("got_all_post")))])],1):e.searchFilteredPosts.length?n("div",{staticClass:"column items-center"},[n("div",{staticClass:"flex"},[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))])]):[n("div",[n("q-spinner",{attrs:{size:"4rem",color:"secondary"}}),n("div",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("loading"))+"...")])],1),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("lib_from_network")))]),e.searchFilteredPosts.length?e._e():n("div",{staticClass:"q-mt-sm"},[e._v(e._s(e.$t("first_recomment_msg")))])]:n("div",[n("q-icon",{attrs:{name:"error_outline",size:"1.2rem"}}),n("span",{staticClass:"q-ml-sm"},[e._v(e._s(e.$t("credit_no_data")))])],1)],2)]}}])}),e._e()],1),e._e(),n("BackToTop",{attrs:{show:e.scrollIndex>0||e.showBackToTop},on:{click:e.handleBackToTop}}),n("SearchChannel",{attrs:{higher:e.scrollIndex>0||e.showBackToTop}}),n("q-dialog",{model:{value:e.showPreview,callback:function(t){e.showPreview=t},expression:"showPreview"}},[n("q-card",{staticClass:"image-preview-card"},[n("q-card-section",{staticClass:"q-pa-none"},[n("img",{staticClass:"preview-image",attrs:{src:e.previewImage}})]),n("q-card-actions",{staticClass:"q-pa-none",staticStyle:{position:"absolute",bottom:"0",right:"0"},attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",padding:"none",size:"20px",icon:"close",color:"grey"}})],1)],1)],1)],1)},$o=[],So=n("2e22"),xo={name:"LibraryIndex",components:{PostCard:Ye,SearchChannel:bt,BackToTop:ot},mixins:[So["c"],So["a"],So["b"],vt,wt("index"),Ct],data(){return{isElectron:Object(Z["isElectron"])(),active:!1,scrollIndex:0,lib:r["a"]}},computed:{followingChannels(){var e,t;const n=(null===(e=r["a"].userData)||void 0===e?void 0:e.blockChannels)||[],o=(null===(t=r["a"].userData)||void 0===t?void 0:t.blockUsers)||[];return r["a"].followingChannels.filter((e=>!r["a"].isBannedChannel(e)&&(!n.includes(e.id)&&!o.includes(e.creator))))},filteredPosts(){return Object.values(this.loadedPosts).filter((e=>e.title&&e.timestamp)).filter((e=>!r["a"].isBannedPost(e))).filter((e=>r["a"].isValidRate(e.rate||"G")))},searchFilteredPosts(){console.log("search index");const e=this.searchText.toLowerCase(),t=r["a"].search.option.value,n=e=>{var n;switch(t){case"channel":return null===(n=e.channel)||void 0===n?void 0:n.title;case"channelID":return e.channel.id;case"description":return e.description;default:return e.title}},o=t=>{var o;return Object(h["a"])(null===(o=n(t))||void 0===o?void 0:o.toLowerCase()).includes(Object(h["a"])(e))};return this.filteredPosts.filter(o)}},methods:{async fetchNext({isIntersecting:e},t=10){e&&await this.loader$loadPostsNext({count:t})},itemsFn(e=0,t=5){return this.searchFilteredPosts.slice(e,e+t)},async unfollow(e){const t=this.$alphabiz.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:this.$t("unfollow"),cancel:this.$t("cancel")}),n=await t.promise("ok");if(!n)return;const o=await r["a"].unfollowChannel(e);console.log("unfollowed",e,o)},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&"),n=`/library/channel?${t}`;this.$root.$emit("navigate-to",n),this.$router.push(n)}},async activated(){this.active=!0;const e=()=>{this.lib.setSearchOption([{label:this.$t("post_title"),value:"post"},{label:this.$t("description"),value:"description"},{label:this.$t("channel_title"),value:"channel"},{label:this.$t("channel_id"),value:"channelID"}])};this.$root.$emit("navigate-to"),e()},deactivated(){this.active=!1},watch:{"searchFilteredPosts.length"(e,t){t||!e||this.active||this.$router.push("/library")},searchText(e){e&&this.active&&this.handleBackToTop()}}},To=xo,Io=(n("1b99"),Object(v["a"])(To,Co,$o,!1,null,null,null)),Po=Io.exports;C()(Io,"components",{QIcon:G["a"],QSpinner:w["a"],QSpinnerIos:xt["a"],QTable:Tt["a"],QLinearProgress:It["a"],QSeparator:z["a"],QPagination:Pt["a"],QVirtualScroll:Ve["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(Io,"directives",{Intersection:Ge["a"],ClosePopup:K["a"]});var Oo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page",[n("div",{staticClass:"container full-width"},[n("div",{staticClass:"sticky-bar q-py-sm bg-page text-page q-header--bordered"},[n("q-toolbar",{staticClass:"sticky-bar-toolbar"},[e._l([{tabName:"downloading",label:"start_all",color:"primary",disable:e.isAllStarted,handleClick:e.downloadAll},{tabName:"downloading",label:"pause_all",color:"general",disable:e.isAllPaused,handleClick:e.requestPauseAllDownloading},{tabName:"downloading",label:"remove_all",color:"negative",disable:0===e.currentList.length,handleClick:e.removeAllDownloading},{tabName:"uploading",label:"pause_all",color:"general",disable:e.isAllPaused,handleClick:e.pauseAllUploading},{tabName:"uploading",label:"remove_all",color:"negative",disable:0===e.currentList.length,handleClick:e.removeAllUploading},{tabName:"downloaded",label:"clear_history",color:"general",disable:0===e.currentList.length,handleClick:e.clearAll}],(function(t,o){return n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:e.currentTab===t.tabName,expression:"currentTab === buttonData.tabName"}],key:o,style:"negative"===t.color?{marginLeft:"16px"}:{},attrs:{color:t.color,icon:t.icon,label:e.$t(t.label),value:t.disable,dense:e.screen$xs},on:{click:function(n){return e.ensureLogin(t.handleClick)}}})})),n("q-space"),n("div",{staticClass:"right-buttons"},[n("q-space"),n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:!(e.showSearchText||e.searchText.length),expression:"!(showSearchText || searchText.length)"}],attrs:{"button-type":"icon",icon:"search"},on:{click:function(t){return e.toggleSearchText(!0)}}}),n("q-input",{directives:[{name:"show",rawName:"v-show",value:e.showSearchText||e.searchText.length,expression:"showSearchText || searchText.length"}],ref:"searchInput",attrs:{outlined:"",dense:"",type:"text",debounce:"300"},on:{blur:function(t){return e.toggleSearchText(!1)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer text-red",attrs:{name:"close"},on:{click:e.clearSearch}})]},proxy:!0}]),model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}}),n("alphabiz-button",{attrs:{"button-type":"icon",icon:"list"===e.listMode?"view_list":"view_agenda"},on:{click:e.changeListMode}},[n("q-tooltip",[e._v(e._s(e.$t("toggle_list_mode")))])],1),n("SortMenu",{on:{changeSortSequence:e.changeSortSequence,changeSortOption:e.changeSortOption}})],1)],2),"downloading"===e.currentTab?n("q-toolbar",{staticClass:"sticky-bar-toolbar",staticStyle:{"min-height":"unset"}},[n("q-linear-progress",{staticStyle:{"flex-shrink":"1","max-width":"calc(100% - 110px)"},attrs:{value:e.downloadingProgress.value,rounded:"",size:"20px"}},[n("div",{staticClass:"absolute-full flex flex-center text-general"},[n("span",{staticStyle:{"font-size":"0.9rem"}},[e._v(e._s(e.downloadingProgress.label))])])]),n("div",{staticClass:"download-speed"},[e._v(e._s(e.totalDownloadSpeed))])],1):e._e(),"uploading"===e.currentTab?n("q-toolbar",{staticClass:"sticky-bar-toolbar",staticStyle:{"min-height":"unset"}},[n("div",[e._v(e._s(e.totalIncomeInfo))]),n("q-space"),n("div",[e._v(e._s(e.$t("total_upload_speed"))+": "+e._s(e.totalUploadSpeed))])],1):e._e()],1),n("q-tab-panels",{staticClass:"torrent-list bg-transparent",class:{"torrent-list-large":"downloaded"!==e.currentTab},model:{value:e.displayTab,callback:function(t){e.displayTab=t},expression:"displayTab"}},e._l(e.displayList,(function(t){return n("q-tab-panel",{key:"panel_"+t.label,staticClass:"q-pa-none",attrs:{name:t.key}},[n(e.listComponent,{key:"task-list-"+t.label,tag:"component",attrs:{list:t,tab:e.currentTab,incomes:e.incomes,noDataMessage:e.noDataMessage},on:{pauseTorrent:e.pauseTorrent,resumeTorrent:e.resumeTorrent,deleteTorrent:e.deleteTorrent,play:e.play,showOriginTorrent:e.showOriginTorrent,showDirectory:e.showDirectory,setThrottleGroup:e.setThrottleGroup,shareFile:e.shareFile,saveTorrentFile:e.saveTorrentFile,showPaymentPannel:e.showPaymentPannel,showDetail:e.showDetail,showAbPanel:e.showAbPanel,showPostInfo:e.showPostInfo,showQuickStart:e.showQuickStart}})],1)})),1),n("q-page-sticky",{staticClass:"action-container",attrs:{position:"bottom-right",offset:[16,16]}},e._l({download:{tabName:"downloading",icon:"add",handleClick:function(){return e.showMagnetDialog("download")}},upload:{tabName:"uploading",icon:"cloud_upload",handleClick:function(){return e.showMagnetDialog("upload")}},upload_all:{tabName:"downloaded",icon:"cloud_upload",handleClick:e.uploadAll}},(function(t,o){return n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:e.currentTab===t.tabName,expression:"currentTab === buttonData.tabName"}],key:o,staticClass:"q-ma-xs action-button",attrs:{color:"primary",icon:t.icon,label:e.$t(o),"button-type":"fab"},on:{click:function(n){return e.ensureLogin(t.handleClick)}}})})),1)],1),n("q-dialog",{staticClass:"channel-post",attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showChannelPost,callback:function(t){e.showChannelPost=t},expression:"showChannelPost"}},[e.channelPost?n("PostCard",{attrs:{post:e.channelPost,followable:e.channelFollowable,hideButtons:""},on:{"to-channel":e.toChannelPage}}):e._e()],1),n("TorrentPayment",e._b({attrs:{show:e.showPayment,dp$source:e.dp$source,autoRenew:e.autoRenew},on:{change:function(t){return e.showPayment=t},createPayment:e.createPayment,setAutoRenew:e.setAutoRenew}},"TorrentPayment",e.paymentData,!1)),n("TableListDetail",{attrs:{show:e.showTorrentDetail,torrent:e.torrentDetail},on:{close:e.hideDetail,showDirectory:e.showDirectory,showPaymentPannel:e.showPaymentPannel,play:e.play,shareFile:e.shareFile}}),n("AlphabizPanel",{attrs:{dp$source:e.dp$source,show:e.showAlphabizPanel,torrent:e.alphabizTorrent,paymentSize:e.paymentSize},on:{close:e.hideAbPanel,createPayment:e.createPayment,setAutoRenew:e.setAutoRenew}}),n("QuickStart",{attrs:{show:e.showQuickStartDialog,preset:e.quickStartTask},on:{input:e.hideQuickStartDialog}})],1)},qo=[],Eo=n("61af"),Ao=n.n(Eo),Do=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-virtual-scroll",{key:"torrent-list-"+e.list.label,ref:"listIns",class:[e.screen$xs?"q-pt-sm":"q-pt-md",e.isPortrait?"portrait":"landscape"],style:"max-height:"+e.viewHeight,attrs:{items:e.list.list,"virtual-scroll-item-size":178},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.item;return[n("q-item",{key:e.list.label+"-"+o.infoHash,staticClass:"fit",class:[e.screen$xs?"q-px-sm":"q-px-md"],attrs:{dense:""}},[n("card-item",{attrs:{torrent:o,highlight:o.infoHash&&o.infoHash===e.highlightItem.infoHash},on:{pauseTorrent:e.emitEvent["pauseTorrent"],resumeTorrent:e.emitEvent["resumeTorrent"],deleteTorrent:e.emitEvent["deleteTorrent"],play:e.emitEvent["play"],showOriginTorrent:e.emitEvent["showOriginTorrent"],showDirectory:e.emitEvent["showDirectory"],setThrottleGroup:e.emitEvent["setThrottleGroup"],saveTorrentFile:e.emitEvent["saveTorrentFile"],showPaymentPannel:e.emitEvent["showPaymentPannel"],showDetail:e.emitEvent["showDetail"],showAbPanel:e.emitEvent["showAbPanel"],showPostInfo:e.emitEvent["showPostInfo"],showQuickStart:e.emitEvent["showQuickStart"],saveFile:e.emitEvent["shareFile"]}})],1)]}},{key:"after",fn:function(){return[e.list.list.length?e._e():n("div",{staticClass:"full-width text-center text-subtitle1"},[n("q-icon",{attrs:{name:"help_outline"}}),e._v("\n "+e._s(e.noDataMessage)+"\n ")],1),n("div",{directives:[{name:"show",rawName:"v-show",value:e.list.list.length,expression:"list.list.length"}],staticClass:"q-py-xl"})]},proxy:!0}])})},No=[],Lo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"100%"}},[n("q-card",{staticClass:"torrent-item",class:[e.screen$xs?"q-mb-sm":"q-mb-md"],attrs:{flat:"",bordered:""}},[n("q-card-section",{class:{highlight:e.highlight}},[n("div",{staticClass:"row justify-between items-center"},[n("div",{staticClass:"torrent-info title q-mb-xs"},[n("p",{staticClass:"torrent-name"},[e.isReady?e._e():n("q-circular-progress",{directives:[{name:"show",rawName:"v-show",value:!e.torrent.paused&&!e.torrent.pending,expression:"!torrent.paused && !torrent.pending"}],staticClass:"torrent-loading",attrs:{indeterminate:"",size:"24px",color:"primary"}}),n("span",[e._v(e._s(e.displayName))]),e.torrent.isAutoUpload?n("q-icon",{staticClass:"q-ml-md",attrs:{name:"drive_folder_upload"}},[n("q-tooltip",[e._v(e._s(e.$t("auto_uploading")))])],1):e._e()],1)]),n("alphabiz-button",{staticClass:"absolute-top-right q-mt-sm q-mr-md",attrs:{size:"md","button-type":"icon",icon:"more_horiz"},on:{click:e.showDetail}},[n("q-tooltip",[e._v(e._s(e.$t("more")))])],1)],1),n("div",{staticClass:"torrent-info"},[n("div",{staticClass:"operations"},[n("alphabiz-button",{directives:[{name:"show",rawName:"v-show",value:!e.torrent.isAutoUpload&&!(e.torrent.paused&&e.torrent.missFile),expression:"!torrent.isAutoUpload && !(torrent.paused && torrent.missFile)"}],attrs:{color:"general",value:e.locked,icon:e.actionIcon,label:e.torrentAction,disabled:e.isProcessingUpload},on:{click:e.switchStateTorrent}}),e.isReady&&e.playable?n("alphabiz-button",{attrs:{color:"general",icon:"smart_display",label:e.torrent.done||e.torrent.isSeeding?e.$t("play"):e.$t("play_while_downloading")}},[n("q-menu",{attrs:{"max-height":"200px"}},[n("q-list",{staticStyle:{"min-width":"100px"}},e._l(e.playableFiles,(function(t,o){return n("q-item",{directives:[{name:"close-popup",rawName:"v-close-popup"}],key:o,staticClass:"playable-items",attrs:{clickable:!t.missing,disable:t.missing},on:{click:function(n){return e.play(t.path,e.torrent.infoHash)}}},[n("q-linear-progress",{directives:[{name:"show",rawName:"v-show",value:1!==t.progress||t.isSeeding,expression:"item.progress !== 1 || item.isSeeding"}],staticClass:"progress-background",attrs:{stripe:"",value:t.progress}}),n("q-item-section",[n("p",{staticClass:"q-ma-none"},[n("q-icon",{staticClass:"q-mr-xs",attrs:{name:"play_arrow"}}),e._v("\n "+e._s(t.name)+"\n "),t.missing?n("q-icon",{attrs:{name:"error",color:"primary"}}):1===t.progress?n("q-icon",{attrs:{name:"done",color:"primary"}}):e._e(),t.missing?n("q-tooltip",[e._v(e._s(e.$t("file_not_found")))]):e._e(),1!==t.progress||e.isElectron?e._e():n("q-btn",{staticClass:"save-to-local-btn",attrs:{flat:"",dense:"",color:"primary",size:"sm",icon:e.isCapacitor?"ios_share":"save"},on:{click:function(n){return n.stopPropagation(),n.preventDefault(),e.saveFile(t)}}},[n("q-tooltip",[e._v(e._s(e.$t("save_to_local")))])],1)],1)])],1)})),1)],1)],1):n("alphabiz-button",{attrs:{color:"general",icon:"file_open",label:e.$t("open_file")},on:{click:e.openFile}}),e.isElectron||e.isCapacitor?n("alphabiz-button",{attrs:{color:"general",icon:e.isElectron?"folder":"ios_share",label:e.isElectron?e.$t("open_directory"):e.$t("share")},on:{click:e.showDirectory}}):e._e(),e.torrent.fromPost?n("alphabiz-button",{attrs:{icon:"video_library",label:e.$t("library")},on:{click:e.showPostInfo}}):e._e(),1!==e.torrent.progress&&!e.torrent.upload||e.torrent.paused?e._e():n("alphabiz-button",{attrs:{icon:"present_to_all",label:e.$t("share_to_library"),disabled:e.isProcessingUpload},on:{click:e.showQuickStart}}),e.isElectron||e.isCapacitor||!e.torrent.done?e._e():n("alphabiz-button",{attrs:{label:e.$t("save_as_zip"),icon:"folder_zip"},on:{click:e.saveZip}}),n("alphabiz-button",{attrs:{color:"negative",icon:"close",label:e.$t("delete"),disabled:e.isProcessingUpload},on:{click:e.deleteTorrent}}),n("q-space"),e.showAbButton?n("alphabiz-button",{attrs:{color:"accent",icon:e.isPayed?"flash_auto":"flash_on"},on:{click:e.openAbPanel}},[n("q-tooltip",[e._v(e._s(e.isPayed?e.$t("alphabiz_accelerating"):e.$t("ab_peer_available")))])],1):e._e()],1),e.torrent.upload||e.torrent.isSeeding?e._e():n("q-linear-progress",{staticClass:"q-mt-md",attrs:{value:e.torrent.done?1:e.torrent.progress,size:"18px",rounded:""}},[n("div",{staticClass:"progress-text flex flex-center absolute-full"},[e._v(e._s(e.progress||"0%"))])]),n("p",{staticClass:"text q-mb-xs bottom-status"},[e.statusText?n("span",{staticClass:"hint status-text"},[n("small",[e._v(e._s(e.statusText))]),n("br")]):e._e(),n("span",{staticStyle:{"margin-right":"10px"}},[e._v(e._s(this.$t("status"))+": "+e._s(e.torrentStatus))]),n("span",[e.torrent.paused||e.torrent.done||e.torrent.pending||e.torrent.isSeeding?e._e():n("span",{staticClass:"q-mr-sm"},[e._v("\n "+e._s(e.downloadSpeed)+"\n ")]),e.torrent.upload?e._e():n("span",{staticStyle:{"margin-right":"10px"}},[e.torrent.done?e._e():n("span",[e._v("↓ "+e._s(e.downloaded)+" /")]),e._v("\n "+e._s(e.total))])]),n("span",[e.torrent.paused||e.torrent.pending?e._e():n("span",{staticClass:"q-mr-sm"},[e._v("\n "+e._s(e.uploadSpeed)+"\n ")]),n("span",{staticStyle:{"margin-right":"10px"}},[e._v("↑ "+e._s(e.uploaded))])])]),n("p",{staticClass:"text timers q-mt-xs bottom-status"},[e.torrent.timeRemaining&&e.torrent.download?n("span",{staticClass:"remaining q-mr-md"},[e._v(e._s(e.$t("remaining"))+": "+e._s(e.remaining))]):e._e(),e.createdTime?n("span",[e._v(e._s(e.$t("created_time")+": "+e.createdTime))]):e._e(),e.completedTime?n("span",[e._v(e._s(e.$t("completed_time")+": "+e.completedTime))]):e._e(),e.usedTime?n("span",[e._v(e._s(e.$t("used_time")+": "+e.usedTime))]):e._e()])],1)])],1)],1)},jo=[],Ro=n("4fd2"),Uo=n("908d"),Fo={name:"CardItem",inject:["io"],props:{torrent:{type:Object,required:!0},statusText:String,highlight:Boolean},data(){return{levelOptions:[{label:" Low ",value:"low"},{label:" Middle ",value:"mid"},{label:" High ",value:"high"}],locked:!1,loading:!1,isElectron:Object(Z["isElectron"])(),isCapacitor:Object(fe["a"])()}},computed:{isDevMode(){return d["a"].getters.isDevMode},isProcessingUpload(){return!(!this.torrent.isSeeding&&!this.torrent.done||this.torrent.length)},torrentAction(){return this.torrent.paused?this.torrent.done||1===this.torrent.progress||this.torrent.isSeeding?this.$t("seed"):this.$t("resume"):this.torrent.isSeeding?this.$t("stop_torrent"):this.$t("pause")},actionIcon(){return this.torrent.paused?this.torrent.done||this.torrent.isSeeding?"cloud_upload":"play_arrow":this.torrent.isSeeding?"stop":"pause"},isReady(){return this.torrent&&this.torrent.name&&this.torrent.length},downloadSpeed(){return this.byteToLargerSize(this.torrent.downloadSpeed,{fix:1})+"/s"},downloaded(){return this.byteToLargerSize(this.torrent.downloaded)},uploadSpeed(){return this.byteToLargerSize(this.torrent.uploadSpeed,{fix:1})+"/s"},uploaded(){return this.byteToLargerSize(this.torrent.uploaded)},total(){return this.byteToLargerSize(this.torrent.length)},remaining(){return!this.torrent.timeRemaining||this.torrent.paused?"-":this.msToTime(this.torrent.timeRemaining)},createdTime(){return this.torrent.createdTime?new Date(this.torrent.createdTime).toLocaleString(this.$i18n.locale,{hour12:!1}):""},completedTime(){return this.torrent.completedTime&&this.torrent.done?new Date(this.torrent.completedTime).toLocaleString(this.$i18n.locale,{hour12:!1}):""},usedTime(){return this.torrent.usedTime?this.msToTime(this.torrent.usedTime):""},torrentStatus(){if(this.torrent.missFile)return this.$t("miss_file");if(this.torrent.isSeeding||this.torrent.done){if(!this.torrent.length){if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);return this.$t("loading")+` (${o})`}return this.$t("loading")}return this.torrent.paused?this.$t("downloaded"):this.$t("uploading")}if(this.paused)return this.$t("paused");if(this.torrent.paused)return this.torrent.done||this.torrent.isSeeding?this.$t("completed"):this.$t("paused");if(this.torrent.isSeeding)return this.$t("seeding");if(this.torrent.upload)return this.$t("uploading");if(this.torrent.pending)return this.$t("pending");if(this.torrent.waiting)return this.$t("waiting_for_verify");if(!this.torrent.ready){if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);if(!isNaN(n))return this.$t("loading")+` (${o})`}return this.$t("loading")}return this.torrent.download?this.torrent.done?this.$t("downloaded"):this.$t("downloading"):this.$t("unknown_status")},displayName(){let e=this.torrent.postTitle||this.torrent.name||this.torrent.origin||this.torrent.token;if(!e||"string"!==typeof e){if(!(e&&e instanceof File))return this.$t("loading");e=e.name}if(e.includes("&dn")){const t=(e+"&").match(/&dn=(.*?)&/);if(t&&t[1])return t[1]}const t=e.match(/btih:([^&]*)/);if(t&&t[1])return t[1];const n=Uo["b"].is.win?"\\":"/";if(e.includes(n)){const t=e.replace(new RegExp(n+"$"),"").match(new RegExp(`([^${n}]*$)`));if(t&&t[1])return t[1]}return e},progress(){return Object(M["g"])(this.torrent.progress)},abPeers(){return this.torrent.connections?this.torrent.connections.filter((e=>!(!this.torrent.hasMetadata&&!e.hasMeta)&&(!!e.hasResource&&(e.isAbPeer&&e.subId&&e.subId!==d["a"].getters.accountUserInfo.sub)))):[]},showAbButton(){return!this.torrent.done&&!this.torrent.isSeeding&&(this.isDevMode&&this.abPeers.length)},payedConnections(){return this.abPeers.filter((e=>"high"===e.remoteGroup))},isPayed(){return this.payedConnections.length},showAbPeerHint(){return this.abPeers.length},connectedPeers(){const e={};for(const t of this.abPeers){const n=t.subId||t.id;e[n]?e[n].isAbPeer|=t.isAbPeer:(e[n]=t,e[n].addresses=[]),e[n].addresses.includes(t.address)||e[n].addresses.push(t.address)}return Object.values(e).sort(((e,t)=>e.id.localeCompare?e.id.localeCompare(t.id):0))},playableFiles(){return this.torrent.files.filter((e=>Object(Ro["a"])(e.name)))},playable(){return this.playableFiles.length}},methods:{byteToLargerSize(e,t={}){return Object(M["a"])(e,{byte:!1,gb:!0,...t})},msToTime(e){const t=Math.floor(e/1e3),n=t%60,o=(t-n)/60;if(isNaN(n))return"-";if(o>60){const e=o%60,t=(o-e)/60;return t>24?"> 24h":`${t}:${("0"+e).slice(-2)}:${("0"+n).slice(-2)}`}return`${("0"+o).slice(-2)}:${("0"+n).slice(-2)}`},deleteTorrent(){this.$emit("deleteTorrent",this.torrent)},switchStateTorrent(){if(!this.locked)if(this.locked=!0,this.torrent.isSeeding?setTimeout((()=>{this.locked=!1}),2e3):setTimeout((()=>{this.locked=!1}),1e3),this.torrent.paused)this.$emit("resumeTorrent",this.torrent);else{if(!this.torrent.infoHash)return this.$q.dialog({message:this.$t("this_task_not_ready"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{this.io.emit("delete_torrent",this.torrent.token,!1)}));this.$emit("pauseTorrent",this.torrent.infoHash)}},openAbPanel(){console.log("open"),this.$emit("showAbPanel",this.torrent)},showDetail(){this.$emit("showDetail",this.torrent)},setThrottleGroup(e,t,n){this.$emit("setThrottleGroup",{infoHash:this.torrent.infoHash,id:e,subId:t,level:n})},saveTorrentFile(){this.$emit("saveTorrentFile",this.torrent.infoHash)},play(e,t){this.$emit("play",e,t)},copyMagnetURI(){let e=this.torrent.alphabizURI||this.torrent.magnetURI;e||(e="magnet:?xt=urn:btih:"+this.torrent.infoHash,this.torrent.name&&(e+="&dn="+encodeURIComponent(this.torrent.name))),Object(lt["b"])(e),this.$q.notify(this.$t("text_copied"))},showPostInfo(){this.$emit("showPostInfo",this.torrent.fromPost)},showOriginTorrent(){this.$emit("showOriginTorrent",this.torrent)},openFile(){1===this.torrent.files.length?this.io.emit("open-external-file",this.torrent.files[0].path,this.torrent.infoHash):this.showDirectory()},showDirectory(){this.$emit("showDirectory",this.torrent)},showPaymentPannel(e){this.$emit("showPaymentPannel",{infoHash:this.torrent.infoHash,torrentName:this.torrent.name,peerId:e.id,address:e.address,remoteUser:e.user,remoteSubId:e.subId})},showQuickStart(){this.$emit("showQuickStart",this.torrent)},saveFile(e){if(this.isCapacitor)return this.$emit("saveFile",e.path);this.$emit("saveFile",e)},saveZip(){this.$emit("saveZip")}},watch:{torrentStatus(e,t){t!==e&&this.$emit("sortByStatus")}},mounted(){this.loading=this.torrent.loading}},Mo=Fo,Bo=(n("1357"),n("64e7")),Qo=n("834d"),Wo=Object(v["a"])(Mo,Lo,jo,!1,null,"3671d32d",null),zo=Wo.exports;C()(Wo,"components",{QCard:E["a"],QCardSection:A["a"],QCircularProgress:Bo["a"],QIcon:G["a"],QTooltip:H["a"],QMenu:de["a"],QList:We["a"],QItem:ze["a"],QLinearProgress:It["a"],QItemSection:He["a"],QBtn:O["a"],QSpace:W["a"],QColor:cn["a"],QBtnToggle:Qo["a"]}),C()(Wo,"directives",{ClosePopup:K["a"]});var Ho={name:"CardList",props:{list:Object,noDataMessage:String},data(){const e=this;return{isElectron:Object(Z["isElectron"])(),safeArea:"env(safe-area-inset-bottom) - env(safe-area-inset-top)",emitEvent:new Proxy({},{get(t,n){return(...t)=>{e.$emit(n,...t)}}}),highlightItem:{}}},computed:{viewHeight(){const e=(this.list.key.startsWith("downloaded")?150:180)+(this.isPortrait||this.isElectron?0:-30);return`calc(100vh - ${this.safeArea} - ${e}px);`}},components:{CardItem:zo},methods:{findTaskIndex(e,t){for(const n in this.list.list){const o=this.list.list[n];if(t&&o.fromPost===t)return console.log("found item by soul",t),parseInt(n);if(Object(we["a"])(o.alphabizURI)===e)return console.log("found",e,o.alphabizURI,n),parseInt(n)}return-1}},activated(){if(this.highlightItem={infoHash:-1},this.$route.query&&this.$route.query.abKey){const e=Date.now(),t=setInterval((()=>{if(!this.$route.path.startsWith("/downloader"))return clearInterval(t),console.log("User exit before loaded");if(this.$refs.listIns){var n;if(Date.now()-e<1e3)return;clearInterval(t);const o=null===(n=this.$route.query.abKey)||void 0===n?void 0:n.replace(/\s/g,"+"),a=this.findTaskIndex(o,this.$route.query.soul);if(-1===a)return console.log("Cannot find abKey",o);const s=this.list.list[a];console.log("scroll to",a,s),this.highlightItem=s,this.$refs.listIns.scrollTo(a,"center"),clearInterval(t),setTimeout((()=>{this.highlightItem===s&&(this.highlightItem={infoHash:-1})}),2500)}}),200)}}},Vo=Ho,Go=(n("536e"),Object(v["a"])(Vo,Do,No,!1,null,"0dd405a4",null)),Ko=Go.exports;C()(Go,"components",{QVirtualScroll:Ve["a"],QItem:ze["a"],QIcon:G["a"]});var Yo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-table",{ref:"tableIns",staticClass:"list bg-page text-page",class:{xs:e.isPortrait,electron:e.isElectron},attrs:{data:e.list.list,columns:e.columns,"row-key":"name",dense:"",flat:"","virtual-scroll":"","hide-bottom":!!e.list.list.length,"rows-per-page-options":[0],"visible-columns":e.visibleColumns,"no-data-label":e.noDataMessage},nativeOn:{mousemove:function(t){return e.onDrag(t)},touchmove:function(t){return e.onDrag(t)},mouseleave:function(t){return e.onDragEnd.apply(null,arguments)},mouseup:function(t){return e.onDragEnd.apply(null,arguments)},touchend:function(t){return e.onDragEnd.apply(null,arguments)},touchcancel:function(t){return e.onDragEnd.apply(null,arguments)}},scopedSlots:e._u([{key:"header",fn:function(t){return[n("q-tr",{attrs:{props:t}},e._l(t.cols,(function(o){return n("q-th",{key:o.name,staticClass:"thead",attrs:{props:t}},[n("span",{staticClass:"text-ellipsis"},[e._v(e._s(o.label))]),"options"!==o.name?n("span",{staticClass:"thead-draggable",on:{mousedown:function(t){return e.onDragStart(o,t)},mouseup:e.onDragEnd,touchstart:function(t){return e.onDragStart(o,t)},touchmove:function(t){return e.onDrag(t)},touchend:e.onDragEnd,touchcancel:e.onDragEnd}}):e._e()])})),1)]}},{key:"body",fn:function(t){return[n("ListItem",{key:t.row.infoHash,attrs:{torrent:t.row,visibleColumns:e.visibleColumns,showCols:e.showCols,incomes:e.taskIncomes[t.row.infoHash],colWidth:e.colWidthText,highlight:t.row.infoHash&&t.row.infoHash===e.highlightItem.infoHash},on:{pauseTorrent:e.emitEvent["pauseTorrent"],resumeTorrent:e.emitEvent["resumeTorrent"],deleteTorrent:e.emitEvent["deleteTorrent"],play:e.emitEvent["play"],showOriginTorrent:e.emitEvent["showOriginTorrent"],showDirectory:e.emitEvent["showDirectory"],setThrottleGroup:e.emitEvent["setThrottleGroup"],saveTorrentFile:e.emitEvent["saveTorrentFile"],showPaymentPannel:e.emitEvent["showPaymentPannel"],showDetail:e.emitEvent["showDetail"],showAbPanel:e.emitEvent["showAbPanel"],showPostInfo:e.emitEvent["showPostInfo"],showQuickStart:e.emitEvent["showQuickStart"]}})]}},{key:"bottom-row",fn:function(){return[n("div",{directives:[{name:"show",rawName:"v-show",value:e.list.list.length,expression:"list.list.length"}],staticClass:"q-py-xl"})]},proxy:!0},{key:"no-data",fn:function(){return[n("div",{staticClass:"full-width text-center text-subtitle1"},[n("q-icon",{attrs:{name:"help_outline"}}),e._v("\n "+e._s(e.noDataMessage)+"\n ")],1)]},proxy:!0}])})},Jo=[],Xo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-tr",{key:e.torrent.infoHash||e.torrent.origin,staticClass:"list-item-tr",class:{highlight:e.highlight}},[n("q-td",{key:"name",staticClass:"no-select task-name",style:e.colWidth.name,on:{dblclick:e.onDoubleClick}},[n("IconWithTooltip",e._b({staticClass:"q-mr-xs name-icon"},"IconWithTooltip",e.taskIcon,!1)),n("div",{staticClass:"name-info"},[n("span",{staticClass:"torrent-name",attrs:{title:e.displayName}},[e._v(e._s(e.displayName))]),n("br"),e._m(0),n("span",{staticClass:"text-grey"},[e._v(e._s(e.downloadStatus))])],1)],1),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["remaining"],expression:"showCols['remaining']"}],key:"remaining",style:e.colWidth.remaining},[e._v(e._s(e.remaining))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["completedTime"],expression:"showCols['completedTime']"}],key:"completedTime",style:e.colWidth.completedTime},[e._v(e._s(e.completedTime))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["progress"],expression:"showCols['progress']"}],key:"progress",style:e.colWidth.progress},[n("q-linear-progress",{attrs:{value:e.torrent.progress,size:"20px",rounded:""}},[n("div",{staticClass:"absolute-full flex flex-center text-general"},[n("span",{staticStyle:{"font-size":"0.9rem"}},[e._v(e._s(e.progress||"0%"))])])])],1),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["uploadSpeed"],expression:"showCols['uploadSpeed']"}],key:"uploadSpeed",style:e.colWidth.uploadSpeed},[e._v(e._s(e.uploadSpeed))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["downloadSpeed"],expression:"showCols['downloadSpeed']"}],key:"downloadSpeed",staticClass:"download-speed",style:e.colWidth.downloadSpeed},[n("span",{attrs:{title:e.downloadSpeed}},[e._v(e._s(e.downloadSpeed))]),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.showAbButton,expression:"showAbButton"}],staticClass:"text-primary float-right",attrs:{flat:"",dense:"",size:"sm"},on:{click:e.openAbPanel}},[n("IconWithTooltip",{attrs:{icon:e.isPayed?"flash_auto":"flash_on",tooltip:e.isPayed?e.$t("alphabiz_accelerating"):e.$t("ab_peer_available")}})],1)],1),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.showCols["incomeInfo"],expression:"showCols['incomeInfo']"}],key:"incomeInfo",staticClass:"text-right",style:e.colWidth.incomeInfo},[e._v(e._s(e.incomeInfo))]),n("q-td",{directives:[{name:"show",rawName:"v-show",value:e.visibleColumns.includes("options"),expression:"visibleColumns.includes('options')"}],key:"options",staticClass:"option-btns",style:e.colWidth.options,attrs:{"auto-width":""}},[n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.torrent.isAutoUpload&&!e.torrent.missFile,expression:"!torrent.isAutoUpload && !torrent.missFile"}],attrs:{flat:"",dense:"",size:"sm",disable:e.locked||e.isProcessingUpload},on:{click:e.toggleStatus}},[n("IconWithTooltip",{attrs:{icon:e.actionIcon,tooltip:e.taskAction,clickable:""}})],1),n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.onDoubleClick}},[n("IconWithTooltip",{attrs:{icon:e.playable?"smart_display":"file_open",tooltip:e.$t("open_file"),clickable:""}})],1),e._m(1),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.torrent.fromPost,expression:"torrent.fromPost"}],attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showPostInfo}},[n("IconWithTooltip",{attrs:{icon:"video_library",tooltip:e.$t("library"),clickable:""}})],1),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:(1===e.torrent.progress||e.torrent.upload)&&!e.torrent.paused,expression:"(torrent.progress === 1 || torrent.upload) && !torrent.paused"}],attrs:{flat:"",dense:"",size:"sm",disabled:e.isProcessingUpload},on:{click:e.showQuickStart}},[n("IconWithTooltip",{attrs:{icon:"present_to_all",tooltip:e.$t("share_to_library"),clickable:""}})],1),e._m(2),n("q-btn",{staticClass:"text-red",attrs:{flat:"",dense:"",size:"sm",disabled:e.isProcessingUpload},on:{click:e.deleteTorrent}},[n("IconWithTooltip",{attrs:{icon:"close",tooltip:e.$t("delete"),clickable:""}})],1)],1)],1)},Zo=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("IconWithTooltip",{directives:[{name:"show",rawName:"v-show",value:e.torrent.isAutoUpload,expression:"torrent.isAutoUpload"}],staticClass:"q-mr-xs text-primary",attrs:{tooltip:e.$t("auto_uploading"),icon:"cloud_upload"}})},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showDirectory}},[n("IconWithTooltip",{attrs:{icon:"folder",tooltip:e.$t("open_directory"),clickable:""}})],1)},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showDetail}},[n("IconWithTooltip",{attrs:{icon:"more_horiz",tooltip:e.$t("more"),clickable:""}})],1)}],ea=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-icon",{class:{"cursor-pointer":e.clickable},attrs:{name:e.icon,size:e.size},on:{click:e.emitClick}},[e.tooltip?n("q-tooltip",[e._v("\n "+e._s(e.tooltip)+"\n ")]):e._e()],1)},ta=[],na={name:"IconWithTooltip",props:{icon:{type:String,require:!0},tooltip:{type:String,default:""},clickable:{type:Boolean,default:!1},size:{type:String,default:""}},methods:{emitClick(){this.$emit("click")}}},oa=na,aa=Object(v["a"])(oa,ea,ta,!1,null,null,null),sa=aa.exports;C()(aa,"components",{QIcon:G["a"],QTooltip:H["a"]});var ia={name:"ListItem",props:{torrent:{type:Object,required:!0},visibleColumns:{type:Array,required:!0},showCols:{type:Object,required:!0},incomes:{type:Object,default:()=>({})},colWidth:{type:Object,default:()=>({})},highlight:Boolean},inject:["io"],components:{IconWithTooltip:sa},data(){return{locked:!1}},computed:{isDevMode(){return d["a"].getters.isDevMode},isProcessingUpload(){return!(!this.torrent.isSeeding&&!this.torrent.done||this.torrent.length)},displayName(){const e=this.torrent.postTitle||this.torrent.name||this.torrent.origin||this.torrent.token;if(!e)return"";if(e.includes("&dn")){const t=(e+"&").match(/&dn=(.*?)&/);if(t&&t[1])return t[1]}const t=e.match(/btih:([^&]*)/);if(t&&t[1])return t[1];const n=Uo["b"].is.win;if(e.includes(n)){const t=e.replace(new RegExp(n+"$"),"").match(new RegExp(`([^${n}]*$)`));if(t&&t[1])return t[1]}return e},isReady(){return this.torrent&&this.torrent.name&&this.torrent.ready},taskIcon(){const e=this.torrent,t=e.files?e.files:[],n=Object(M["c"])(t.map((e=>e.path||e)));return{icon:n.icon,tooltip:this.$t(n.tooltip)}},downloadStatus(){if(this.torrent.missFile)return this.$t("miss_file");if(this.torrent.isSeeding||this.torrent.done){if(!this.torrent.length){if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);if(!isNaN(n))return this.$t("loading")+` (${o})`}return this.$t("loading")}return Object(M["a"])(this.torrent.length)}return this.isReady||this.torrent.paused||this.torrent.length?this.torrent.done||this.torrent.downloaded===this.torrent.length?Object(M["a"])(this.torrent.length):`${Object(M["a"])(this.torrent.downloaded)}/${Object(M["a"])(this.torrent.length)}`:"-"},remaining(){return this.torrent.paused||this.torrent.pending?"-":Object(M["e"])(this.torrent.timeRemaining)},completedTime(){const e=(...e)=>this.$t(...e);return this.torrent.completedTime?Object(M["f"])(this.torrent.completedTime,e,null===this||void 0===this?void 0:this.$i18n.locale):Object(M["f"])(this.torrent.createdTime,e,null===this||void 0===this?void 0:this.$i18n.locale)},progress(){return Object(M["g"])(this.torrent.progress)},downloadSpeed(){if(this.torrent.paused)return this.$t("paused");if(this.torrent.pending)return this.$t("pending");if(!this.torrent.ready){if(!this.torrent.hasMetadata)return this.$t("loading");if(this.torrent.waiting)return this.$t("waiting_for_verify");if(this.torrent.verifyStatus){const{current:e,total:t}=this.torrent.verifyStatus,n=e/t,o=Object(M["g"])(n);if(!isNaN(n))return this.$t("verifying")+` (${o})`}return this.$t("verifying")}return Object(M["a"])(this.torrent.downloadSpeed,{byte:!1,gb:!1,fix:1})+"/s"},incomeInfo(){return[Number(((this.incomes.today||0)/1e3).toFixed(3)),Number(((this.incomes.total||0)/1e3).toFixed(3))].join(" / ")},uploadSpeed(){return this.torrent.ready?Object(M["a"])(this.torrent.uploadSpeed,{byte:!1,gb:!1,fix:1})+"/s":"-/s"},taskAction(){return this.torrent.paused?this.torrent.done||this.torrent.isSeeding?this.$t("seed"):this.$t("resume"):this.torrent.isSeeding?this.$t("stop_torrent"):this.$t("pause")},actionIcon(){return this.torrent.paused?this.torrent.done||this.torrent.isSeeding?"cloud_upload":"play_arrow":this.torrent.isSeeding?"stop":"pause"},playableFiles(){var e;return(null===(e=this.torrent.files)||void 0===e?void 0:e.filter((e=>Object(Ro["a"])(e.name))))||[]},playable(){return this.playableFiles.length},abPeers(){return this.torrent.connections?this.torrent.connections.filter((e=>!(!this.torrent.hasMetadata&&!e.hasMeta)&&(!!e.hasResource&&(e.isAbPeer&&e.subId&&e.subId!==d["a"].getters.accountUserInfo.sub)))):[]},showAbButton(){return this.isDevMode&&this.abPeers.length},isPayed(){return this.abPeers.some((e=>"high"===e.remoteGroup))}},methods:{shouldShow(e){return this.visibleColumns.includes(e)},onDoubleClick(){this.playable?this.$emit("play",this.playableFiles[0].path,this.torrent.infoHash):this.torrent.files&&this.torrent.files.length?this.openFile():this.$q.notify(this.$t("no_available_file"))},toggleStatus(){if(!this.locked)if(this.locked=!0,this.torrent.isSeeding?setTimeout((()=>{this.locked=!1}),2e3):setTimeout((()=>{this.locked=!1}),1e3),this.torrent.paused)this.$emit("resumeTorrent",this.torrent);else{if(!this.torrent.infoHash)return this.$q.dialog({message:this.$t("this_task_not_ready"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{this.io.emit("delete_torrent",this.torrent.token,!1)}));this.$emit("pauseTorrent",this.torrent.infoHash||this.torrent.token)}},deleteTorrent(){this.$emit("deleteTorrent",this.torrent)},openFile(){1===this.torrent.files.length?this.io.emit("open-external-file",this.torrent.files[0].path,this.torrent.infoHash):this.showDirectory()},showDirectory(){this.$emit("showDirectory",this.torrent)},showDetail(){this.$emit("showDetail",this.torrent)},showPostInfo(){this.$emit("showPostInfo",this.torrent.fromPost)},openAbPanel(){this.$emit("showAbPanel",this.torrent)},showQuickStart(){this.$emit("showQuickStart",this.torrent)}}},ra=ia,la=(n("bd3b"),Object(v["a"])(ra,Xo,Zo,!1,null,null,null)),ca=la.exports;C()(la,"components",{QTr:yo["a"],QTd:vo["a"],QLinearProgress:It["a"],QBtn:O["a"],QColor:cn["a"]});var da=n("ed1a"),ua={name:"TableList",props:{list:{type:Object,required:!0},tab:{type:String,default:"downloading"},incomes:{type:Object,default:()=>({})},noDataMessage:{type:String,default:()=>""}},components:{ListItem:ca},data(){const e=this;let t={name:250,remaining:80,completedTime:80,progress:120,downloadSpeed:150,uploadSpeed:100,incomeInfo:120,options:165};return localStorage.getItem("table-col-width")||localStorage.setItem("table-col-width",JSON.stringify(t)),t=JSON.parse(localStorage.getItem("table-col-width")),{isElectron:Object(Z["isElectron"])(),emitEvent:new Proxy({},{get(t,n){return(...t)=>{e.$emit(n,...t)}}}),defaultColumns:{downloading:["name","remaining","progress","downloadSpeed","options"],uploading:["name","completedTime","uploadSpeed","incomeInfo","options"],downloaded:["name","completedTime","options"]},dragData:{start:!1,col:"",pageX:0,pageY:0},highlightItem:{},colWidth:t}},computed:{columns(){return[{name:"name",required:!0,label:this.$t("task_name"),align:"left",headerStyle:this.colWidthText.name+";padding-left: 48px; max-width: calc(100% - 48px);"},{name:"remaining",label:this.$t("remaining"),align:"left",headerStyle:this.colWidthText.remaining+"; max-width: calc(100% - 8px)"},{name:"completedTime",label:this.$t("completed_time"),align:"left",headerStyle:this.colWidthText.completedTime+"; max-width: calc(100% - 8px)"},{name:"progress",label:this.$t("progress"),align:"left",headerStyle:this.colWidthText.progress+"; max-width: calc(100% - 8px)"},{name:"downloadSpeed",label:this.$t("total_download_speed"),align:"left",headerStyle:this.colWidthText.downloadSpeed+"; max-width: calc(100% - 8px)"},{name:"uploadSpeed",label:this.$t("total_upload_speed"),align:"left",headerStyle:this.colWidthText.uploadSpeed+"; max-width: calc(100% - 8px)"},{name:"incomeInfo",label:this.$t("income_info"),align:"right",headerStyle:this.colWidthText.incomeInfo+"; max-width: calc(100% - 8px)"},{name:"options",label:this.$t("operations"),align:"left"}]},visibleColumns(){switch(this.tab){case"downloading":return this.defaultColumns.downloading;case"uploading":return 2!==this.$store.state.credits.isModuleInit?this.defaultColumns.uploading.filter((e=>"incomeInfo"!==e)):this.defaultColumns.uploading;case"downloaded":return this.defaultColumns.downloaded}return this.defaultColumns.downloading},showCols(){const e={};for(const t of this.visibleColumns)e[t]=!0;return e},colWidthText(){const e={};for(const t in this.colWidth){const n=this.colWidth[t];e[t]=`width: ${n}px; min-width: ${n}px; max-width: ${n}px;`}return e},tableList(){var e,t;return(null===(e=this.list)||void 0===e||null===(t=e.list)||void 0===t?void 0:t.map((e=>({name:e.name}))))||[]},taskIncomes(){const{todayTaskIncome:e,allTaskIncome:t}=this.incomes,n={};for(const o in t)n[o]||(n[o]={today:0,total:0}),n[o].total+=t[o],e[o]&&(n[o].today+=e[o]);return n}},methods:{onDragStart(e,t){this.dragData.pageX=t.pageX,this.dragData.pageY=t.pageY,this.dragData.start=!0,this.dragData.col=e.name,document.body.style.cursor="col-resize"},onDragEnd(){this.dragData.start&&(this.dragData.start=!1,document.body.style.cursor="",localStorage.setItem("table-col-width",JSON.stringify(this.colWidth)))},onDrag(e){if(!this.dragData.start)return;const t=this.dragData.pageX-e.pageX;this.dragData.pageX=e.pageX,this.colWidth[this.dragData.col]&&(this.colWidth[this.dragData.col]-=t,this.colWidth[this.dragData.col]<80&&(this.colWidth[this.dragData.col]=80))},onResize(){console.log("table resize"),this.$refs.tableIns.resetVirtualScroll()},findTaskIndex(e,t){for(const n in this.list.list){const o=this.list.list[n];if(t&&o.fromPost===t)return console.log("found item by soul",t),parseInt(n);if(Object(we["a"])(o.alphabizURI)===e)return console.log("found",e,o.alphabizURI,n),parseInt(n)}return-1}},created(){this.onDrag=Object(da["a"])(this.onDrag,1e3/60),this.onResize=Object(da["a"])(this.onResize)},beforeDestroy(){window.removeEventListener("resize",this.onResize)},mounted(){window.addEventListener("resize",this.onResize),console.log("table created",this.$route.query)},activated(){if(this.highlightItem={infoHash:-1},this.$route.query&&this.$route.query.abKey){const e=Date.now(),t=setInterval((()=>{if(!this.$route.path.startsWith("/downloader"))return clearInterval(t),console.log("User exit before loaded");if(this.$refs.tableIns){var n;if(Date.now()-e<1e3)return;const o=null===(n=this.$route.query.abKey)||void 0===n?void 0:n.replace(/\s/g,"+"),a=this.findTaskIndex(o,this.$route.query.soul);if(-1===a)return console.log("Cannot find abKey",o);const s=this.list.list[a];console.log("scroll to",a,s),this.highlightItem=s,this.$refs.tableIns.scrollTo(a,"center"),clearInterval(t),setTimeout((()=>{this.highlightItem===s&&(this.highlightItem={infoHash:-1})}),2500)}}),200)}}},ha=ua,pa=(n("cdb7"),n("c1f8")),ma=Object(v["a"])(ha,Yo,Jo,!1,null,null,null),_a=ma.exports;C()(ma,"components",{QTable:Tt["a"],QTr:yo["a"],QTh:pa["a"],QIcon:G["a"],QColor:cn["a"]});var fa=function(){var e=this,t=this,n=t.$createElement,o=t._self._c||n;return o("q-dialog",{attrs:{value:t.show},on:{input:function(t){return e.$emit("change",t)},"before-hide":function(){return e.disable=!1}}},[o("q-card",{staticClass:"info"},[o("q-card-section",[o("div",{staticClass:"text-h6"},[t._v(t._s(t.$t("create_payment")))]),o("div",{staticClass:"infohash"},[t._v(t._s(t.$t("pay_for_torrent",[t.torrentName])))]),o("small",{staticClass:"infohash text-secondary"},[t._v("infoHash: "+t._s(t.infoHash))]),o("div",{staticClass:"peer-info"},[t._v(t._s(t.$t("pay_target"))+":\n "),o("div",{staticClass:"q-ml-sm remote"},[t._v("SubId: "+t._s(t.remoteSubId))]),o("div",{staticClass:"peer-address q-ml-md"},[t._v("Address: "+t._s(t.address))]),o("div",{staticClass:"peer-id q-ml-md"},[t._v("PeerId: "+t._s(t.peerId))])]),o("div",{staticClass:"space q-my-md"}),o("div",{staticClass:"user-info"},[o("div",{staticClass:"sub-id"},[t._v(t._s(t.$t("your_subid"))+": "+t._s(t.subId))]),o("div",{staticClass:"credit-count"},[t._v(t._s(t.$t("your_credits"))+": "+t._s(t.credit))])]),o("div",{staticClass:"actions"},[o("q-btn",{attrs:{"no-caps":"",label:t.$t("pay_point_for_data",[2,"20MB"]),disable:t.disable,loading:t.disable},on:{click:function(e){return t.pay(2)}}}),o("q-btn",{attrs:{"no-caps":"",label:t.$t("pay_point_for_data",[10,"100MB"]),disable:t.disable,loading:t.disable},on:{click:function(e){return t.pay(10)}}}),o("br"),o("q-toggle",{attrs:{value:t.enableAutoRenew,label:t.$t("auto_renew"),"left-label":""},on:{input:t.setAutoRenew}})],1)])],1)],1)},ga=[],ba={name:"TorrentPayment",props:{dp$source:Object,infoHash:{type:String,default:""},torrentName:{type:String,default:""},peerId:{type:String,default:""},address:{type:String,default:""},remoteUser:{type:String,default:""},remoteSubId:{type:String,default:""},show:{type:Boolean,default:!1},autoRenew:{type:Object,default:()=>({})}},data(){return{disable:!1,sentTransactions:new Set,pendingTransactions:new Map}},computed:{credit(){return this.dp$source.dp$credit},userId(){return this.$store.state.account.username},subId(){return this.dp$source.dp$address},enableAutoRenew(){return this.autoRenew&&this.autoRenew[this.infoHash]||!1},income(){return this.dp$source.dp$incomeTxnList},expenses(){return this.dp$source.dp$expenseTxnList}},methods:{setAutoRenew(e){this.$emit("setAutoRenew",this.infoHash,e)},pay(e=1){if(!this.infoHash.length||!this.peerId.length||!this.remoteSubId.length)return this.$q.notify("Info missing");this.disable=!0,console.log("dp$ create payment from","TorrentPayment::pay"),this.$emit("createPayment",{infoHash:this.infoHash,peerId:this.peerId,remoteSubId:this.remoteSubId,payed:e,autoRenew:this.enableAutoRenew})}}},ya=ba,va=Object(v["a"])(ya,fa,ga,!1,null,null,null),wa=va.exports;C()(va,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QBtn:O["a"],QToggle:tn["a"]});var ka=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.torrent?n("q-dialog",{staticClass:"detail-dialog",attrs:{value:e.show,position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},on:{input:e.closeDialog}},[n("q-card",{staticClass:"detail-dialog",class:e.isCapacitor?"capacitor":""},[n("q-card-section",{staticClass:"flex items-center no-wrap",class:e.screen$xs?"q-py-sm":"q-py-md"},[e.torrent.fromPost?n("q-icon",{staticClass:"q-mr-xs text-primary",attrs:{name:"video_library"}},[n("q-tooltip",[e._v("\n "+e._s(e.$t("library"))+"\n ")])],1):e._e(),n("div",{staticClass:"text-h6 ellipsis",attrs:{title:e.torrent.postTitle||e.torrent.name}},[e._v("\n "+e._s(e.torrent.postTitle||e.torrent.name)+"\n ")]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"},{name:"close-popup",rawName:"v-close-popup"}],attrs:{icon:"close",flat:"",round:"","data-cy":"moreCard-closeBtn"}})],1),n("q-separator",{directives:[{name:"show",rawName:"v-show",value:e.screen$xs,expression:"screen$xs"}]}),n("q-card-section",{class:e.screen$xs?"q-pt-md":"q-pt-none"},[n("q-input",{attrs:{readonly:"",label:e.$t("download")+" URL",outlined:"",dense:""},scopedSlots:e._u([{key:"append",fn:function(){return[n("IconWithTooltip",{attrs:{icon:"content_copy",tooltip:e.$t("copy_download_uri"),clickable:!0},on:{click:e.copyMagnetURI}}),n("IconWithTooltip",{attrs:{icon:"share",tooltip:e.$t("copy_share_uri"),clickable:!0},on:{click:e.copyShortURI}})]},proxy:!0}],null,!1,2307292726),model:{value:e.downloadURI,callback:function(t){e.downloadURI=t},expression:"downloadURI"}})],1),e.fileTree.length?n("q-card-section",{staticClass:"q-pt-none"},[n("div",{staticClass:"title"},[e.isElectron||e.isCapacitor?n("q-btn",{attrs:{flat:"",dense:"",size:"sm"},on:{click:e.showDirectory}},[n("IconWithTooltip",{attrs:{icon:"folder_open",tooltip:e.$t("open_directory"),clickable:""}})],1):e._e(),e._v("\n "+e._s(e.$t("files"))+":\n ")],1),n("q-tree",{staticClass:"no-select file-tree",attrs:{nodes:e.fileTree,"node-key":"label",dense:"","no-connectors":""},scopedSlots:e._u([{key:"default-header",fn:function(t){return[n("q-item",{staticClass:"text full-width q-py-none q-px-xs no-margin vertical-middle",class:{"no-path":!t.node.path},attrs:{dense:"",clickable:!t.node.children},on:{dblclick:function(n){return e.onDblClick(t.node)}}},[!t.node.children&&t.node.path?n("IconWithTooltip",e._b({staticClass:"q-mt-xs q-mr-xs"},"IconWithTooltip",e.getFileIcon(t.node.path),!1)):t.node.path?n("IconWithTooltip",{staticClass:"q-mt-xs q-mr-xs",attrs:{icon:"folder"}}):e._e(),e.isCapacitor&&t.node.done&&t.node.fullPath?n("IconWithTooltip",{staticClass:"q-mt-xs q-mr-xs",attrs:{icon:"ios_share",label:e.$t("open_file")},on:{click:function(n){return e.shareFile(t.node)}}}):e._e(),t.node.progress?n("span",{staticClass:"file-progress"},[e._v(e._s(t.node.progress))]):e._e(),n("span",{staticClass:"file-name"},[e._v("‎"+e._s(t.node.label))])],1)]}}],null,!1,3668704012)})],1):e._e(),e.torrent.subtitleList&&e.torrent.subtitleList.length?n("q-card-section",{staticClass:"q-pt-none"},[n("q-expansion-item",{attrs:{"expand-separator":"",icon:"subtitles",label:e.$t("subtitle")+" ("+e.torrent.subtitleList.length+")",value:!0}},[n("q-markup-table",{staticClass:"subtitleList-table q-px-sm",attrs:{flat:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-center",staticStyle:{"padding-left":"20px"}},[e._v(e._s(e.$t("language")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("download_link")))]),n("th")])]),n("tbody",e._l(e.torrent.subtitleList,(function(t,o){return n("tr",{key:o},[n("td",{staticClass:"text-center",staticStyle:{"padding-left":"20px"},attrs:{title:t.lang}},[e._v(e._s(t.lang))]),n("td",{staticClass:"text-left url ellipsis",attrs:{title:e.getSubtitleUrl(t.url)}},[e._v(e._s(e.getSubtitleUrl(t.url)))]),n("td",{staticClass:"text-center"},[n("q-btn",{attrs:{icon:"content_copy",size:"xs",dense:"",flat:""},on:{click:function(n){return e.copySubtitleURL(t.url)}}},[n("q-tooltip",[e._v(e._s(e.$t("copy_download_uri")))])],1),e.isElectron?n("q-btn",{attrs:{icon:"file_download",size:"xs",dense:"",flat:""},on:{click:function(n){return e.downloadSubtitleURL(t.url)}}},[n("q-tooltip",[e._v(e._s(e.$t("download_link")))])],1):e._e()],1)])})),0)])],1)],1):e._e(),n("q-card-section",{staticClass:"q-pt-none peers"},[n("q-expansion-item",{attrs:{"expand-separator":"",icon:"people",label:"Peers ("+e.connectedPeers.length+")",value:!0}},[n("q-markup-table",{staticClass:"peer-table q-px-sm",attrs:{flat:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-center"}),n("th",{staticClass:"text-left ip",staticStyle:{"padding-left":"32px"}},[e._v("Peer")]),e.isDevMode?n("th",{staticClass:"text-left client"},[e._v(e._s(e.$t("client")))]):e._e(),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("total_download_speed")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("total_upload_speed")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("progress")))])])]),n("tbody",e._l(e.connectedPeers,(function(t){return n("PeerInfo",{key:t.id,attrs:{peer:t},on:{showPaymentPannel:e.showPaymentPannel}})})),1)])],1)],1),e.isDevMode?n("q-card-section",{staticClass:"q-pt-none"},[n("q-expansion-item",{directives:[{name:"show",rawName:"v-show",value:e.trackerList.length,expression:"trackerList.length"}],attrs:{icon:"dns",label:"Trackers ("+e.trackerList.length+")"}},[e.isElectron?n("div",{staticClass:"row justify-end q-pa-sm"},[n("q-input",{staticClass:"col",attrs:{dense:"",type:"text",label:"Tracker URL"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.newTrackerUrl,callback:function(t){e.newTrackerUrl=t},expression:"newTrackerUrl"}}),n("q-btn",{attrs:{dense:"",color:"primary q-mx-sm q-px-sm",icon:"add",label:e.$t("add")},on:{click:e.addTracker}})],1):e._e(),n("q-markup-table",{staticClass:"tracker-table q-px-sm",attrs:{flat:"",dense:""}},[n("thead",[n("tr",[n("th",{staticClass:"text-left",staticStyle:{"padding-left":"40px"}},[e._v("URL")]),n("th",{staticClass:"text-left"},[e._v(e._s(e.$t("status")))]),n("th",{staticClass:"text-right"},[e._v(e._s(e.$t("last_update")))]),n("th",{staticClass:"text-center"},[e._v(e._s(e.$t("seeders")))]),n("th",{staticClass:"text-center"},[e._v("Peers")]),e.isElectron?n("th"):e._e()])]),n("tbody",e._l(e.trackerList,(function(t){return n("tr",{key:t.url},[n("td",{staticClass:"text-left url",attrs:{title:t.displayUrl+(t.isIpv6?" (IPv6)":"")}},[t.isIpv6?n("IconWithTooltip",{staticStyle:{color:"#4697ec"},attrs:{icon:"looks_6",tooltip:"IPv6",size:"xs"}}):n("q-icon",{attrs:{name:"looks_4",color:"grey",size:"xs"}}),e._v("\n "+e._s(t.displayUrl)+"\n ")],1),n("td",{staticClass:"text-left status",attrs:{title:t.status}},[e._v(e._s(t.status))]),n("td",{staticClass:"text-right"},[e._v(e._s(t.time))]),n("td",{staticClass:"text-center"},[e._v(e._s(t.complete))]),n("td",{staticClass:"text-center"},[e._v(e._s(t.incomplete))]),e.isElectron?n("td",{staticClass:"text-center"},[n("q-btn",{attrs:{color:"red",icon:"close",size:"xs",dense:"",flat:""},on:{click:function(n){return e.removeTracker(t.url)}}})],1):e._e()])})),0)])],1)],1):e._e()],1)],1):e._e()},Ca=[],$a=(n("dc69"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("tr",[n("td",{staticClass:"status text-center"},[e.peer.isAbPeer?"high"===e.peer.level?n("q-icon",{attrs:{name:"done_all"}},[n("q-tooltip",[e._v(e._s(e.$t("ab_peer_verified")))])],1):n("q-icon",{attrs:{name:"done"}},[n("q-tooltip",[e._v(e._s(e.$t("ab_peer")))])],1):n("q-icon",{attrs:{name:"remove"}},[n("q-tooltip",[e._v(e._s(e.$t("common_peer")))])],1)],1),n("td",{staticClass:"addresses"},e._l(e.peer.addresses,(function(t){return n("div",{key:e.peer.id+"_"+t,staticClass:"self-center not-outline address"},[n("q-icon",{attrs:{name:e.peer.secure?"lock":"lock_open",size:"xs",color:e.peer.secure?"green":"grey"}},[n("q-tooltip",[e._v(e._s(e.peer.secure?e.$t("encrypted_connection"):e.$t("non_encrypted_connection")))])],1),n("span",{staticClass:"country-flag q-ml-sm",attrs:{title:e.country}},[e._v(e._s(e.countryFlag))]),e.isDevMode?n("span",{staticClass:"q-ml-xs"},[e._v(e._s(t))]):n("span",{staticClass:"q-ml-xs"},[e._v(e._s(t?t.substring(0,4)+"*":"-"))])],1)})),0),e.isDevMode?n("td",{staticClass:"client text-left",class:{"text-primary":"Alphabiz"===e.peerClient},attrs:{title:e.peerClient}},[e._v(e._s(e.peerClient))]):e._e(),n("td",{staticClass:"text-right",class:{"text-primary":e.peer.downloadSpeed}},[e._v(e._s(e.downloadSpeed)+" / s")]),n("td",{staticClass:"text-right",class:{"text-primary":e.peer.uploadSpeed}},[e._v(e._s(e.uploadSpeed)+" / s")]),n("td",{staticClass:"progress text-right"},[e._v(e._s(e.peerProgress))])])}),Sa=[],xa=n("c791"),Ta=xa["a"],Ia=(n("2e69"),Object(v["a"])(Ta,$a,Sa,!1,null,"4676c095",null)),Pa=Ia.exports;C()(Ia,"components",{QIcon:G["a"],QTooltip:H["a"]});var Oa={props:{show:{type:Boolean,default:!1},torrent:{type:Object,required:!0}},data(){const e=Object(ne["default"])()?n("b052").ipcRenderer:{};return{newTrackerUrl:"",isCapacitor:Object(fe["a"])(),isElectron:Object(ne["default"])(),ipcRenderer:e}},components:{IconWithTooltip:sa,PeerInfo:Pa},inject:["io"],computed:{isDevMode(){return d["a"].getters.isDevMode},fileCount(){if(!this.torrent)return 0;const e=this.torrent.files||this.torrent.file||[];return e&&e.length?e.length:0},fileTree(){if(!this.torrent)return[];const e=this.torrent.files&&this.torrent.files.map?this.torrent.files.map((e=>e.path)):this.torrent.file||[];if(!e||!e.length)return[];const t=this.fileCount>21?e.slice(e.length-20):e,n=Object(M["b"])(t,this.torrent.files);return n?(this.fileCount>21&&n.children&&n.children.push({label:this.$t("more_files_are_not_shown",[this.fileCount-20])}),[n]):[]},downloadURI(){return this.torrent.alphabizURI?this.torrent.alphabizURI:this.torrent.magnetURI},trackerList(){if(!this.torrent.trackerList)return[];const e=this.torrent.trackerList.map((e=>{const t=this.trackerStatus(e.message||e.status),n=e.info||{complete:"-",incomplete:"-"},o=new Date(e.timestamp),a=[o.getHours(),o.getMinutes(),o.getSeconds()].map((e=>("00"+e).slice(-2))).join(":");return{url:e.url,displayUrl:e.url.replace("@6",""),status:t,time:a,isIpv6:e.isIpv6,...n}})).reverse();return Object(ne["default"])()?e:e.filter((e=>{var t;return null===(t=e.url)||void 0===t?void 0:t.startsWith("ws")}))},connectedPeers(){if(!this.torrent||!this.torrent.connections)return[];const e={};for(const o of this.torrent.connections){const t=o.id;e[t]||(e[t]={...o},e[t].addresses=[],e[t].uploadSpeed=0,e[t].downloadSpeed=0,e[t].downloaded=0),e[t].addresses.includes(o.address)||e[t].addresses.push(o.address),e[t].uploadSpeed+=o.uploadSpeed,e[t].downloadSpeed+=o.downloadSpeed,e[t].downloaded+=o.downloaded,e[t].isAbPeer|=o.isAbPeer,e[t].isPayed|="high"===o.remoteGroup,e[t].secure|=o.secure}const t=[],n=Object.values(e).sort(((e,t)=>{var n;return null!==(n=e.id)&&void 0!==n&&n.localeCompare?e.id.localeCompare(t.id):0})).filter((e=>!!e.id&&(!t.includes(e.id)&&(t.push(e.id),!0))));return n}},methods:{getFileIcon(e){const t=Object(M["c"])([e]);return{icon:t.icon,tooltip:this.$t(t.tooltip)}},closeDialog(){this.$emit("close")},copyToClipboard(e){Object(lt["b"])(e).then((()=>{this.$q.notify(this.$t("uri_copied"))})).catch((()=>{this.$q.notify(this.$t("uri_copy_failed"))}))},copyMagnetURI(){this.copyToClipboard(this.downloadURI)},copyShortURI(){if(!this.torrent.alphabizURI)return;const e=this.torrent.alphabizURI.match(/[^:/]\/([^&/]+)&/);e&&e[1]&&this.copyToClipboard(Ne.a.shortProtocol+"://"+e[1])},copySubtitleURL(e){console.log("copySubtitleURL",this.torrent),this.copyToClipboard(Ee(e))},downloadSubtitleURL(e){this.ipcRenderer.send("to_browserurl",Ee(e))},getSubtitleUrl(e){return Ee(e)},showPaymentPannel(e){this.$emit("showPaymentPannel",Object.assign({infoHash:this.torrent.infoHash,name:this.torrent.name},e))},showDirectory(){this.$emit("showDirectory",this.torrent)},onDblClick(e){console.log(e),e.children||(Object(Ro["a"])(e.label)?this.$emit("play",e.path,this.torrent.infoHash):e.path&&this.io.emit("open-external-file",e.path))},shareFile(e){this.$emit("shareFile",e.fullPath)},trackerStatus(e){const t=e.toLowerCase();return"connecting"===t?this.$t("connecting"):"updated"===t?this.$t("connected"):t.includes("timed out")?this.$t("request_timed_out"):t.includes("connection failed")?this.$t("connection_failed"):this.$t("unknown_error",[e])},addTracker(){console.log("add",this.newTrackerUrl,this.torrent.infoHash);const e=this.newTrackerUrl.trim();if(this.torrent.trackerList.find((t=>t.url===e)))return this.$q.notify(this.$t("duplicate_tracker"));this.isElectron&&this.ipcRenderer.send("add-tracker",{infoHash:this.torrent.infoHash,url:e}),this.newTrackerUrl=""},removeTracker(e){console.log("remove",e,this.torrent.infoHash),this.isElectron&&this.ipcRenderer.send("remove-tracker",{infoHash:this.torrent.infoHash,url:e})}}},qa=Oa,Ea=(n("860f"),n("348e")),Aa=n("5bbd"),Da=Object(v["a"])(qa,ka,Ca,!1,null,"560c4343",null),Na=Da.exports;C()(Da,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QIcon:G["a"],QTooltip:H["a"],QSpace:W["a"],QBtn:O["a"],QSeparator:z["a"],QInput:D["a"],QTree:Ea["a"],QItem:ze["a"],QExpansionItem:Aa["a"],QMarkupTable:V["a"]}),C()(Da,"directives",{ClosePopup:K["a"]});var La=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{value:e.showPanel},on:{input:e.close}},[n("q-card",[n("q-card-section",{staticClass:"row items-center"},[n("q-expansion-item",{staticStyle:{width:"400px"},attrs:{"expand-separator":"","default-opened":"",icon:"people",label:"Peers ("+e.abPeers.length+")",caption:"Alphabiz peer"}},[n("div",{staticClass:"total col-12 q-px-md q-ml-sm"},[n("span",[e._v(e._s(e.$t("credit_cost"))+": "+e._s(e.torrentExpensesNum))])]),e._l(e.abPeers,(function(t){return n("q-field",{key:t.id,attrs:{label:t.subId||t.id,"stack-label":"",borderless:"",readonly:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("div",{staticClass:"q-px-sm"})]},proxy:!0},{key:"control",fn:function(){return[e._l(t.addresses,(function(t,o){return n("div",{key:o+"-"+t,staticClass:"self-center full-width not-outline"},[e._v(" - "+e._s(t)+"\n ")])})),n("div",{staticClass:"text full-width q-mt-xs"},[n("span",{staticClass:"peer-speed q-ml-xs q-mr-lg",class:{"text-primary":"0.00 KB"!==t.uploadSpeed}},[e._v("↑ "+e._s(t.uploadSpeed)+" / s")]),t.isPayed?n("q-icon",{staticClass:"text-primary q-mx-xs cursor-pointer",attrs:{name:"bolt"}},[n("q-tooltip",[e._v(" "+e._s(e.$t("accelerating")))])],1):e._e(),n("span",{staticClass:"peer-speed q-mr-md",class:{"text-primary":"0.00 KB"!==t.downloadSpeed}},[e._v("↓ "+e._s(t.downloadSpeed)+" / s")]),n("span",{directives:[{name:"show",rawName:"v-show",value:t.downloaded,expression:"peer.downloaded"}],staticClass:"peer-downloaded text-primary"},[e._v(e._s(t.downloadedData))])],1)]},proxy:!0}],null,!0)})}))],2)],1),n("q-card-section",{staticClass:"q-py-none"},[n("div",{staticClass:"total text-center"},[e._v("\n "+e._s(e.$t("pay_with_credit_payed",[e.totalCredits]))+"\n ")])]),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("cancel")}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:e.$t("ok")}})],1)],1)],1)},ja=[],Ra={props:{dp$source:Object,show:{type:Boolean,required:!0},torrent:{type:Object,required:!0},paymentSize:{type:Number,default:1e7}},computed:{torrentExpensesNum(){let e=0;if(this.dp$source.dp$expenseTxnDict&&this.dp$source.dp$expenseHashMapper){const t=this.dp$source.dp$expenseHashMapper[this.torrent.infoHash];if(console.log("torrentExpensesNum:","infoHash",this.torrent.infoHash),t)for(const n of t)e+=this.dp$source.dp$expenseTxnDict[n].amount}return Number((e/1e3).toFixed(3))},showPanel(){return this.show},totalCredits(){const e=this.torrent.length,t=e-this.torrent.downloaded,n=Number((t/1e10).toFixed(3));return n},abPeers(){if(!this.torrent||!this.torrent.connections)return[];const e=this.torrent.connections.filter((e=>e.isAbPeer&&e.hasResource&&e.subId!==d["a"].getters.accountUserInfo.sub)),t={};for(const n of e){const e=n.subId;e&&(t[e]?(t[e].isAbPeer|=n.isAbPeer,t[e].addresses.push(n.address),t[e].uploadSpeed+=n.uploadSpeed,t[e].downloadSpeed+=n.downloadSpeed,t[e].downloaded+=n.downloaded):(t[e]={...n},t[e].addresses=[n.address]))}return Object.values(t).sort(((e,t)=>e.id.localeCompare?e.id.localeCompare(t.id):0)).map((e=>(e.uploadSpeed=Object(M["a"])(e.uploadSpeed,{byte:!1,gb:!1}),e.downloadSpeed=Object(M["a"])(e.downloadSpeed,{byte:!1,gb:!1}),e.downloadedData=Object(M["a"])(e.downloaded,{byte:!0,gb:!0}),e.isPayed="high"===e.remoteGroup,e)))},payedConnections(){return this.abPeers.filter((e=>e.isPayed))},downloadedFromPayed(){return Object(M["a"])(this.payedConnections.reduce(((e,t)=>e+t.downloaded||0),0),{byte:!0,gb:!0})},hasPayed(){return this.payedConnections.length}},methods:{confirmPayment(){if(!this.abPeers.length)return;let e=10;const t=Math.floor(10*this.torrent.downloadSpeed/this.paymentSize);t>e&&(e=t);const n=this.torrent.length-this.torrent.downloaded;n{console.log("pay for",t),t.isPayed?console.log("skip high level peer",t):(console.log("dp$ create payment from","AlphabizPanel::confirmPayment"),this.$emit("createPayment",{infoHash:this.torrent.infoHash,remoteSubId:t.subId,payed:e,autoRenew:!0},!0))})),this.close()},close(){this.$emit("close")}}},Ua=Ra,Fa=n("b121"),Ma=Object(v["a"])(Ua,La,ja,!1,null,null,null),Ba=Ma.exports;C()(Ma,"components",{QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QExpansionItem:Aa["a"],QField:Fa["a"],QIcon:G["a"],QTooltip:H["a"],QCardActions:N["a"],QBtn:O["a"]}),C()(Ma,"directives",{ClosePopup:K["a"]});var Qa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("alphabiz-button",{attrs:{"button-type":"icon",icon:"sort"}},[n("q-tooltip",[e._v(e._s(e.$t("sort")))]),n("q-menu",{attrs:{"transition-show":"jump-down","transition-hide":"jump-up"}},[n("q-list",{attrs:{padding:""}},[n("q-item",{staticStyle:{"min-width":"240px"}},[n("q-item-section",[n("q-item-label",[e._v(e._s(e.$t("sort")))])],1),n("q-item-section",{attrs:{side:""}},[n("q-badge",{staticClass:"cursor-pointer non-selectable",attrs:{color:"general","text-color":"general"},on:{click:e.changeSortSequence}},[n("span",{staticClass:"q-ml-sm"},[e._v(e._s(1===e.sortSequence?e.$t("ascending"):e.$t("descending")))]),n("q-icon",{attrs:{size:"1.5rem",name:1===e.sortSequence?"arrow_drop_up":"arrow_drop_down"}})],1)],1)],1),n("q-separator"),e._l(e.options,(function(t){return n("q-item",{directives:[{name:"ripple",rawName:"v-ripple"}],key:t.value,attrs:{clickable:"",dense:"",tag:"label"}},[n("q-item-section",{attrs:{avatar:""}},[n("q-radio",{attrs:{val:t.value,color:"positive"},model:{value:e.sortOption,callback:function(t){e.sortOption=t},expression:"sortOption"}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(t.label))])],1)],1)}))],2)],1)],1)},Wa=[],za={name:"DownloaderSortMenu",inject:["io"],data(){return{sortOption:"createdTime",sortSequence:1}},computed:{options(){switch(this.$route.query.currentTab){case"downloading":return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"},{label:this.$t("size"),value:"length"},{label:this.$t("total_download_speed"),value:"downloadSpeed"},{label:this.$t("progress"),value:"progress"},{label:this.$t("remaining"),value:"timeRemaining"},{label:this.$t("created_time"),value:"createdTime"},{label:this.$t("used_time"),value:"usedTime"}];case"uploading":return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"},{label:this.$t("size"),value:"length"},{label:this.$t("total_upload_speed"),value:"uploadSpeed"},{label:this.$t("created_time"),value:"createdTime"},{label:this.$t("completed_time"),value:"completedTime"},{label:this.$t("income"),value:"income"}];case"downloaded":return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"},{label:this.$t("size"),value:"length"},{label:this.$t("created_time"),value:"createdTime"},{label:this.$t("completed_time"),value:"completedTime"},{label:this.$t("used_time"),value:"usedTime"}]}return[{label:this.$t("status"),value:"status"},{label:this.$t("task_name"),value:"name"}]}},methods:{saveSortOptions(){localStorage.setItem("sortOptions_"+this.$route.query.currentTab,JSON.stringify({sortOption:this.sortOption,sortSequence:this.sortSequence}))},changeSortSequence(){this.sortSequence=-1*this.sortSequence,this.$emit("changeSortSequence",this.sortSequence),this.io.emit("set_sort_sequence",this.sortSequence),this.saveSortOptions()}},mounted(){const e=localStorage.getItem("sortOptions_"+this.$route.query.currentTab);if(e){const{sortOption:t,sortSequence:n}=JSON.parse(e);t&&(this.sortOption=t),n&&(this.sortSequence=n)}else this.sortOption="createdTime",this.sortSequence=1,this.saveSortOptions()},watch:{sortOption(e){this.$emit("changeSortOption",e),this.io.emit("set_sort_option",this.sortOption),this.saveSortOptions()},"$route.query.currentTab"(e,t){if(e===t||!e)return;const n=localStorage.getItem("sortOptions_"+e);if(n){const{sortOption:e,sortSequence:t}=JSON.parse(n);e&&(this.sortOption=e),t&&(this.sortSequence=t)}else this.sortOption="createdTime",this.sortSequence=1}}},Ha=za,Va=n("719b"),Ga=Object(v["a"])(Ha,Qa,Wa,!1,null,"b08e87f8",null),Ka=Ga.exports;C()(Ga,"components",{QTooltip:H["a"],QMenu:de["a"],QList:We["a"],QItem:ze["a"],QItemSection:He["a"],QItemLabel:Fn["a"],QBadge:he["a"],QIcon:G["a"],QSeparator:z["a"],QRadio:Un["a"]}),C()(Ga,"directives",{Ripple:Va["a"]});var Ya=n("0885"),Ja=n("a368");const Xa=n("d310").isElectron();var Za={name:"Downloader",inject:["rootApp","io","taskQueue","dp$source"],components:{CardList:Ko,TableList:_a,TableListDetail:Na,IconWithTooltip:sa,AlphabizPanel:Ba,TorrentPayment:wa,SortMenu:Ka,PostCard:Ye,QuickStart:Bn},data(){return{isMobile:Uo["b"].is.mobile||Object(fe["a"])(),currentTab:"downloading",loading:!1,listMode:localStorage.getItem("task-list-mode")||"list",searchText:"",showSearchText:!1,autoRenew:JSON.parse(localStorage.getItem("task-autorenew")||"{}"),sortOption:"createdTime",sortSequence:1,statusText:{},info:{downloadSpeed:0,uploadSpeed:0,progress:0,taskNum:0},showPayment:!1,showTorrentDetail:!1,torrentDetailInfoHash:"",paymentData:{infoHash:"",torrentName:"",peerId:"",address:"",remoteUser:"",remoteSubId:""},paymentSize:1e7,showAlphabizPanel:!1,abTorrentInfoHash:"",lib:r["a"],showChannelPost:!1,channelPost:null,showQuickStartDialog:!1,quickStartTask:null}},computed:{torrentList(){return Pn["a"].taskList},listComponent(){return"card"===this.listMode?"CardList":"TableList"},displayTab:{get(){return this.currentTab+"Torrents"},set(e){const t=e.replace(/Torrents$/,"");this.$router.push({path:this.$route.path,query:{...this.$route.query,currentTab:t}})}},displayList(){return[{key:"downloadingTorrents",label:this.$t("downloading"),open:!0,list:this.filterTorrent(this.downloadingTorrents||[])},{key:"uploadingTorrents",label:this.$t("uploading"),open:!1,list:this.filterTorrent(this.uploadingTorrents||[])},{key:"downloadedTorrents",label:this.$t("downloaded"),open:!1,list:this.filterTorrent(this.downloadedTorrents||[])}]},currentList(){switch(this.displayTab){case"downloadingTorrents":return this.displayList[0].list;case"uploadingTorrents":return this.displayList[1].list;default:return this.displayList[2].list}},isAllStarted(){return this.currentList.every((e=>!e.paused))},isAllPaused(){return this.currentList.every((e=>e.paused))},noDataMessage(){return this.searchText?this.$t("no_matched_task"):this.$t("no_task")},downloadingTorrents(){const e=this.sortTorrents(this.torrentList.downloading);return e},disableDownloadAll(){return this.loading||this.downloadingTorrents.every((e=>!e.paused))},disablePauseAllDownloading(){return this.loading||this.downloadingTorrents.every((e=>e.paused))},downloadingProgress(){const e=this.torrentList.totalDownloadProgress;return isNaN(e)||0===e&&0===this.downloadingNum?{value:0,label:this.$t("no_downloading_task")}:{value:e,label:Object(M["g"])(e)}},uploadingTorrents(){const e=this.sortTorrents(this.torrentList.uploading);return e},totalDownloadSpeed(){return this.torrentList.totalDownloadSpeed?Object(M["a"])(this.torrentList.totalDownloadSpeed,{byte:!1,gb:!1})+" / s":"0.00 KB / s"},totalUploadSpeed(){if(!this.uploadingTorrents)return"-";const e=this.torrentList.totalUploadSpeed;return Object(M["a"])(e,{byte:!1,gb:!1})+" / s"},downloadedTorrents(){return this.sortTorrents(this.torrentList.downloaded)},torrentItems(){return Pn["a"].allTasks},torrentDetail(){return this.torrentDetailInfoHash&&this.torrentItems.find((e=>e.infoHash===this.torrentDetailInfoHash))||{}},alphabizTorrent(){return this.abTorrentInfoHash&&this.torrentItems.find((e=>e.infoHash===this.abTorrentInfoHash))||{}},downloadingNum(){return this.downloadingTorrents.filter((e=>!e.paused&&!e.pending&&!(!e.download||1===e.progress))).length},incomes(){let e=0;const t={};for(const s of this.dp$source.dp$incomeTxnListToday){if(!s.meta||"FINISH"!==s.status)continue;e+=s.amount;const n=JSON.parse(s.meta);n.infoHash&&(t[n.infoHash]||(t[n.infoHash]=0),t[n.infoHash]+=s.amount)}let n=0;const o={},a=this.dp$source.dp$incomeStatusMapper.FINISH;if(a)for(const s of a){const e=this.dp$source.dp$incomeTxnDict[s];n+=e.amount;const t=JSON.parse(e.meta).infoHash;o[t]||(o[t]=0),o[t]+=e.amount}return{todayIncome:e,todayTaskIncome:t,allIncome:n,allTaskIncome:o}},totalIncomeInfo(){return 2!==d["a"].state.credits.isModuleInit?this.$t("login_to_see_income"):this.$t("total_income_info",[Number((this.incomes.todayIncome/1e3).toFixed(3)),Number((this.incomes.allIncome/1e3).toFixed(3))])},disableTasks(){return!!d["a"].getters.shouldDisableTasks||!!d["a"].getters.settings.forceLogin&&(!d["a"].getters.accountUserInfo||!d["a"].getters.accountUserInfo.sub)},channelFollowable(){return!!this.channelPost&&!r["a"].followingChannels.some((e=>{var t;return e&&e.id===(null===(t=this.channelPost.channel)||void 0===t?void 0:t.id)}))}},methods:{ensureLogin(e){if(this.disableTasks){if(!d["a"].state.account.authState)return;this.$amplify.showSignedOutDialog()}else"function"===typeof e&&e()},async setLoading(){this.loading=!0,await new Promise((e=>setTimeout(e,1e3))),this.loading=!1},toggleSearchText(e){this.showSearchText=e,e&&this.$nextTick((()=>{this.$refs.searchInput.focus()}))},filterTorrent(e){const t=this.searchText.toLowerCase(),n=e.filter((e=>e.name||e.postTitle?e.postTitle?e.postTitle.toLowerCase().includes(t):e.name.toLowerCase().includes(t):""===t));return n},clearSearch(){this.searchText="",this.$refs.searchInput.blur()},changeListMode(){"list"===this.listMode?this.listMode="card":this.listMode="list",localStorage.setItem("task-list-mode",this.listMode)},byteToLargerSize(e){return Object(M["a"])(e,{byte:!0,gb:!0})},getTorrentListName(e){let t="downloading";return e.isSeeding||e.uploading?t="uploading":e.pending?t="pending":1===e.progress||e.done?t="downloaded":e.paused&&(t="paused"),t},showMagnetDialog(e){this.$root.$emit("openTaskDialog",e)},showDetail(e){this.torrentDetailInfoHash=e.infoHash,this.showTorrentDetail=!0},hideDetail(){this.showTorrentDetail=!1,this.torrentDetailInfoHash=""},showAbPanel({infoHash:e}){this.abTorrentInfoHash=e,this.showAlphabizPanel=!0},async showPostInfo(e=""){if(console.log("show",e),!e||!e.includes("posts"))return this.$q.notify("Cannot find post");this.$q.loading.show();const t=e.replace(/\/posts\/([^/]+$)/,""),n=t.split("/").filter((e=>e)).pop(),o=e.split("/").filter((e=>e)).pop();let a=!1;setTimeout((()=>{a||(a=!0,this.$q.loading.hide(),this.$q.dialog({title:this.$t("error"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}))}),5e3);const s=await r["a"].getPostById(n,o,!0);if(console.log("show post",s),a)return;const i=await r["a"].getChannelById(n);if(console.log("show post channel",i),!a){if(a=!0,!s)return this.$q.loading.hide(),void this.$q.dialog({title:"Not Found",message:"Cannot found post info"});s.channel=i,this.channelPost=s,this.$q.loading.hide(),this.showChannelPost=!0}},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&");this.$router.push(`/library/channel?${t}`),setTimeout((()=>{this.$root.$emit("navigate-to",`/library/channel?${t}`)}),200)},hideAbPanel(){this.showAlphabizPanel=!1,this.abTorrentInfoHash=""},async shareFile(e){const t=await Ja["Share"].canShare();if(!t.value)return;const n=await Ja["Share"].share({files:["file://"+encodeURI(e)]}).catch((e=>{console.log(e)}));this.$q.notify("Result: "+n.activityType)},showOriginTorrent(e){let t=e.token||e.origin;if(e.isSeeding||e.upload?t=e.magnetURI:e.magnetPath&&(t=e.magnetPath),!t)return this.$q.notify("origin_not_found");Ao.a.existsSync(t)?this.io.emit("show_torrent_file",t):(t.startsWith("magnet")||(t="magnet:?xt=urn:btih:"+e.infoHash),e.name&&(t+="&dn="+encodeURIComponent(e.name)),Object(lt["b"])(t),this.$q.notify(this.$t("text_copied")))},async showDirectory(e){if(Object(fe["a"])()){if(1!==e.progress&&!e.done)return this.$q.notify(this.$t("wait_for_downloaded_to_share"));if((await Ja["Share"].canShare()).value){const t=e.files.map((e=>"file://"+e.path));console.log("Files",t,e.path);const n=En(t);console.log("pub",n),Ja["Share"].share({files:["file://"+encodeURI(n)],title:"Save"}).catch((e=>{console.log("Share error",e)}))}}if(!Ao.a.existsSync(e.path))return this.$q.notify(this.$t("path_missing"));if(e.files&&1===e.files.length&&Ao.a.existsSync(e.files[0].path))return this.io.emit("show_torrent_file",e.files[0].path);const t=qn.a.resolve(e.path,e.postTitle||e.name||"");if(!Ao.a.existsSync(t))return this.io.emit("show_torrent_file",e.path);this.io.emit("show_torrent_file",t)},setAutoRenew(e,t){return Object(Ya["c"])(e,t),this.$set(this.autoRenew,e,t)},showPaymentPannel(e){this.paymentData=e,this.showPayment=!0},changeSortOption(e){this.sortOption=e},changeSortSequence(e){this.sortSequence=e},sortTorrents(e){const t=this.sortOption,n=t;switch(n){case"income":{const t=this.incomes.allTaskIncome;return[...e].sort(((e,n)=>t[e.infoHash]?t[n.infoHash]?(t[e.infoHash]-t[n.infoHash])*this.sortSequence:-1:t[n.infoHash]?1:0))}default:return e}},async askForConfirm(e){return new Promise((t=>{this.$q.dialog({persistent:!0,message:e,ok:this.$t("confirm"),cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>t(!0))).onCancel((()=>t(!1)))}))},downloadAll(e=!1){if(console.log("download all!"),this.loading)return console.log("skip downloadAll since loading");this.setLoading(),Object(An["c"])(e)},async pauseAllDownloading(e=!1){if(!this.torrentList.downloading.length)return console.log("skip pause all downloading");console.log("pauseall"),this.setLoading(),Object(An["d"])(e)},requestPauseAllDownloading(){this.$q.dialog({title:this.$t("pause_all"),message:this.$t("pause_all_finish_payments"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("pause_all")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>{this.pauseAllDownloading()}))},removeAllDownloading(){const e=[];d["a"].getters.settings.defaultDeleteFiles&&e.push("deleteFiles"),this.$q.dialog({title:this.$t("delete_task"),message:this.$t("remove_all_downloading_tasks"),options:{type:"checkbox",model:e,items:[{label:this.$t("also_delete_files"),value:"deleteFiles"}]},ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove_all")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("not_now")}}).onOk((async e=>{const t=e.includes("deleteFiles");if(t&&d["a"].state.video.currentVideo.infoHash){const e=this.downloadingTorrents.find((e=>e.infoHash===d["a"].state.video.currentVideo.infoHash));if(e){const t=this.$t("remove_playing_confirm",[e.name]),n=await this.askForConfirm(t);if(!n)return;this.io.emit("trigger_clear_player",e.infoHash)}}this.setLoading(),this.io.emit("delete_all","download",t);for(const n of this.downloadingTorrents)this.io.emit("delete_torrent",n.infoHash,t);d["a"].dispatch("updateSettings",{defaultDeleteFiles:t})}))},pauseAllUploading(e=!1){this.torrentList.uploading.length&&(this.setLoading(),Object(An["e"])(e))},removeAllUploading(){const e=[];d["a"].getters.settings.defaultDeleteFiles&&e.push("deleteFiles"),this.$q.dialog({title:this.$t("delete_task"),message:this.$t("remove_all_upload_tasks"),options:{type:"checkbox",model:e,items:[{label:this.$t("also_delete_files"),value:"deleteFiles"},{label:this.$t("remove_autoupload_files"),value:"deleteAutoUpload"}]},ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("remove_all")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("not_now")}}).onOk((async e=>{const t=e.includes("deleteFiles"),n=e.includes("deleteAutoUpload");if(t&&d["a"].state.video.currentVideo.remotePlay&&d["a"].state.video.currentVideo.infoHash){const e=this.uploadingTorrents.find((e=>e.infoHash===d["a"].state.video.currentVideo.infoHash));if(e){var o,a,s;const t=this.$t("remove_playing_confirm",[e.name]),n=await this.askForConfirm(t);if(!n)return;console.log(null===(o=this.$refs.videoJsPlayer)||void 0===o?void 0:o.player),null===(a=this.$refs.videoJsPlayer)||void 0===a||null===(s=a.player)||void 0===s||s.stop(),this.io.emit("trigger_clear_player",e.infoHash)}}this.setLoading(),this.io.emit("delete_all","upload",t,n),d["a"].dispatch("updateSettings",{defaultDeleteFiles:t})}))},async uploadAll(e=!1){const t=Object(An["h"])(e);if(console.log("rest",t),t<=this.downloadedTorrents.length)return void console.log("Skip watch: nothing to upload");this.loading=!0;let n=null;const o=new Promise((e=>n=e)),a=this.$watch("downloadedTorrents",(e=>{e.length<=t&&(a(),this.loading=!1,console.log("upload done"),n())}));return setTimeout((()=>{this.loading&&(this.loading=!1,a(),n())}),5e3),o},pauseTorrent(e){this.setLoading(),Object(An["f"])(e,this)},resumeTorrent(e){e&&this.ensureLogin((()=>{this.setLoading(),console.log("resume",e),this.io.emit("resume_torrent",e)}))},deleteTorrent(e){this.ensureLogin((async()=>{if(e.infoHash&&d["a"].state.video.currentVideo.remotePlay&&e.infoHash===d["a"].state.video.currentVideo.infoHash){const t=this.$t("remove_playing_confirm",[e.name]),n=await this.askForConfirm(t);if(n){const t=await Pn["a"].deleteTask(e);if(!t)return;this.io.emit("trigger_clear_player",e.infoHash)}}else Pn["a"].deleteTask(e)}))},clearAll(){this.ensureLogin((()=>{this.$q.dialog({title:this.$t("clear_history"),message:this.$t("remove_all_history"),ok:this.$t("remove_all"),cancel:this.$t("not_now")}).onOk((()=>{this.setLoading();for(const e of this.downloadedTorrents)this.io.emit("delete_torrent",e.infoHash)}))}))},startPayment(e,t=!1){Object(Ya["d"])(e,t)},async createPayment(e,t=!1){await Object(Ya["a"])(e,t,this),t||(this.showPayment=!1)},setThrottleGroup(e){this.io.emit("set_throttle_group",e)},saveTorrentFile(e){this.io.emit("save_torrent_file",e)},play(e,t){(Xa||Object(fe["a"])())&&(console.log("run play():"+t+", "+e),d["a"].dispatch("remotePlay",t),this.io.emit("play-torrent",{infoHash:t,filepath:e}))},showQuickStart(e){this.quickStartTask=e,this.showQuickStartDialog=!0},hideQuickStartDialog(){this.showQuickStartDialog=!1,this.quickStartTask=null}},created(){this.io.on("client_info",(e=>{this.info=e}))},mounted(){if(Object.keys(this.autoRenew).length)for(const e in this.autoRenew)Object(Ya["c"])(e,this.autoRenew[e])},beforeRouteEnter(e,t,n){if(console.log("before enter",e,t),"/downloader"!==e.path)return n();console.log("is downloader"),e.query.currentTab?(console.log("current tab:",e.query.currentTab),n((t=>{t.currentTab=e.query.currentTab}))):(console.log("not current tab",e.query),n({path:e.path,query:{...e.query,currentTab:"downloading"}}))},beforeRouteUpdate(e,t,n){console.log("before update",e,t),this.currentTab=e.query.currentTab,n()},watch:{autoRenew(e){localStorage.setItem("task-autorenew",JSON.stringify(e))}}},es=Za,ts=(n("7297"),n("b2b4"),n("9b72")),ns=n("832a"),os=n("917f"),as=n("c72d"),ss=Object(v["a"])(es,Oo,qo,!1,null,"540e1290",null),is=ss.exports;C()(ss,"components",{QPage:ts["a"],QHeader:ns["a"],QToolbar:ce["a"],QSpace:W["a"],QBtn:O["a"],QInput:D["a"],QIcon:G["a"],QTooltip:H["a"],QLinearProgress:It["a"],QTabPanels:os["a"],QTabPanel:as["a"],QPageSticky:tt["a"],QDialog:q["a"]});var rs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page",[n("input",{ref:"fileSelector",staticStyle:{display:"none"},attrs:{type:"file",name:"file"},on:{change:e.onFileChange}}),n("div",{staticClass:"container full-width"},[n("div",{staticClass:"sticky-bar q-py-sm bg-page text-page q-header--bordered"},[n("q-toolbar",{staticClass:"sticky-bar-toolbar",staticStyle:{"min-height":"unset"}},[n("span",[e._v("\n "+e._s(e.$t("web_mode_hint"))+"\n "),n("a",{staticClass:"doc-link",attrs:{href:"https://alpha.biz",target:"_blank"}},[e._v("\n "+e._s(e.$t("go_to"))+" alpha.biz\n "),n("q-icon",{attrs:{name:"open_in_new"}})],1)])])],1),n("div",{staticClass:"task-container"},[e.task.magnetURI||e.task.origin||e.task.isSeeding?n("CardItem",{attrs:{torrent:e.task},on:{pauseTorrent:e.pauseTorrent,resumeTorrent:e.resumeTorrent,deleteTorrent:e.deleteTorrent,play:e.play,showPaymentPannel:e.showPaymentPannel,showDetail:e.showDetail,showAbPanel:e.showAbPanel,showPostInfo:e.showPostInfo,showQuickStart:e.showQuickStart,saveFile:e.saveFile,saveZip:e.saveZip}}):n("div",{staticClass:"no-task"},[n("div",{staticClass:"add-hints"},[e._v("\n "+e._s(e.$t("web_mode_task_hint"))+"\n ")]),n("q-btn",{staticClass:"add-button",attrs:{color:"primary",icon:"add",size:"lg"},on:{click:e.showDownload}},[n("q-tooltip",[e._v(e._s(e.$t("download")))])],1),n("q-btn",{staticClass:"add-button q-ml-md",attrs:{color:"primary",icon:"cloud_upload",size:"lg"},on:{click:e.showUpload}},[n("q-tooltip",[e._v(e._s(e.$t("upload")))])],1)],1)],1)]),n("q-dialog",{model:{value:e.showInput,callback:function(t){e.showInput=t},expression:"showInput"}},[n("q-card",{staticClass:"url-input"},[n("q-card-section",[n("div",{staticClass:"text-h6"},[e._v(e._s(e.$t("download")))]),n("q-input",{attrs:{type:"text",label:"Task URL"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.taskUrl,callback:function(t){e.taskUrl=t},expression:"taskUrl"}})],1),n("q-card-actions",{attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:"Cancel",color:"primary"}}),n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{color:"primary",icon:"add",label:e.$t("add")},on:{click:e.addTask}})],1)],1)],1),n("q-dialog",{staticClass:"channel-post",attrs:{position:e.screen$xs?"bottom":"standard","content-class":"fullscreen-dialog"},model:{value:e.showChannelPost,callback:function(t){e.showChannelPost=t},expression:"showChannelPost"}},[e.channelPost?n("PostCard",{attrs:{post:e.channelPost,followable:e.channelFollowable,hideButtons:""},on:{"to-channel":e.toChannelPage}}):e._e()],1),n("TableListDetail",{attrs:{show:e.showTaskDetail,torrent:e.task,paymentSize:10},on:{close:e.hideDetail}}),n("AlphabizPanel",{attrs:{dp$source:e.dp$source,show:e.showAlphabizPanel,torrent:e.task,paymentSize:10},on:{close:e.hideAbPanel}}),n("QuickStart",{attrs:{show:e.showQuickStartDialog,preset:e.task},on:{input:e.hideQuickStartDialog}})],1)},ls=[],cs=(n("f200"),n("09e8")),ds=n("7d7c"),us=(n("dc89"),n("2425"),n("3cc3")),hs=n.n(us);const ps=(e,t)=>{const n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=e,document.body.appendChild(o),o.click(),setTimeout((()=>{URL.revokeObjectURL(n),o.remove()}),3e4)};async function ms(e){return new Promise((t=>{e.getBlob(((n,o)=>{if(n)throw n;ps(e.name,o),t()}))}))}async function _s(e){if(!e.done)return;const t=Object(On["basename"])(e.name,Object(On["extname"])(e.name))+".zip",n=new hs.a,o=e.files;await Promise.all(o.map((e=>new Promise(((t,o)=>{e.getBlob(((a,s)=>{if(a)return o(a);n.file(e.path,s),t()}))}))))),o.length>1&&n.folder(e.postTitle||e.name);const a=await n.generateAsync({type:"blob"});return ps(t,a)}var fs=n("c620"),gs={components:{CardItem:zo,TableListDetail:Na,AlphabizPanel:Ba,QuickStart:Bn,PostCard:Ye},mixins:[cs["a"]],name:"Downloader",data(){return{locked:!1,showInput:!1,showTaskDetail:!1,showAlphabizPanel:!1,showQuickStartDialog:!1,showChannelPost:!1,channelPost:null,taskUrl:"",task:{}}},computed:{isReady(){return this.task.name&&this.task.length},displayName(){return this.task.postTitle?this.task.postTitle:this.task.name?this.task.name:this.$t("loading")},taskAction(){return this.task.paused?this.task.done?this.$t("upload"):this.$t("resume"):this.task.isSeeding?this.$t("stop_torrent"):this.$t("pause")},channelFollowable(){return!!this.channelPost&&!r["a"].followingChannels.some((e=>{var t;return e&&e.id===(null===(t=this.channelPost.channel)||void 0===t?void 0:t.id)}))}},methods:{async showDownload(){this.taskUrl="",this.showInput=!0,await this.$nextTick();const e=await Object(lt["a"])();if(e&&"string"===typeof e){const t=e.trim();if([De["protocol"],De["shortProtocol"],"magnet"].some((e=>t.startsWith(e+":")))){const e=t.startsWith("magnet")?t:await Object(Ce["a"])(t);if(!e||!e.startsWith("magnet"))return;this.taskUrl=t}}},async showUpload(){this.$refs.fileSelector.click()},showDetail(){this.showTaskDetail=!0},hideDetail(){this.showTaskDetail=!1},switchState(){console.log("on switch state")},addTask(){X["a"].emit("wt-add",this.taskUrl)},deleteTorrent(){this.$q.dialog({title:this.$t("delete_task"),message:this.$t("delete_confirm_message"),cancel:{color:"primary",flat:!0,label:this.$t("not_now")},ok:{color:"red",flat:!0,label:this.$t("delete")}}).onOk((()=>{X["a"].emit("wt-delete",this.task.infoHash),this.task={}}))},pauseTorrent(){X["a"].emit("wt-pause",this.task.infoHash),this.task.paused=!0},resumeTorrent(){this.task&&this.task.magnetURI&&(this.task.paused=!1,X["a"].emit("wt-resume",this.task.infoHash))},play(e){console.log("onplay",e),Object(ds["default"])(e)},showPaymentPannel(){},showAbPanel(){this.showAlphabizPanel=!0},hideAbPanel(){this.showAlphabizPanel=!1},async showPostInfo(e=""){if(console.log("show",e),!e||!e.includes("posts"))return this.$q.notify("Cannot find post");this.$q.loading.show();const t=e.replace(/\/posts\/([^/]+$)/,""),n=t.split("/").filter((e=>e)).pop(),o=e.split("/").filter((e=>e)).pop();let a=!1;setTimeout((()=>{a||(a=!0,this.$q.loading.hide(),this.$q.dialog({title:this.$t("error"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}))}),5e3);const s=await r["a"].getPostById(n,o,!0);if(console.log("show post",s),a)return;const i=await r["a"].getChannelById(n);if(console.log("show post channel",i),!a){if(a=!0,!s)return this.$q.loading.hide(),void this.$q.dialog({title:"Not Found",message:"Cannot found post info"});s.channel=i,this.channelPost=s,this.$q.loading.hide(),this.showChannelPost=!0}},toChannelPage(e){console.log("to",e);const t=["id","title"].map((t=>{const n=e[t];return encodeURIComponent(t)+"="+encodeURIComponent(n)})).join("&");this.$router.push(`/library/channel?${t}`),setTimeout((()=>{this.$root.$emit("navigate-to",`/library/channel?${t}`)}),200)},onFileChange(e){const t=e.target;t&&t.files&&t.files.length&&(console.log("To upload",t.files[0]),X["a"].emit("wt-add",t.files[0])),t.value=null},showQuickStart(){this.showQuickStartDialog=!0},hideQuickStartDialog(){this.showQuickStartDialog=!1},saveFile(e){const t=fs["wtClient"].torrents[0];if(!t||!t.files)return;const n=t.files.find((t=>t.path===e.path))||t.files.find((t=>t.name===e.name));if(!n)return;const o=this.$q.dialog({title:this.$t("creating_save_file"),persistent:!0,ok:!1});setTimeout((()=>{ms(n).catch((e=>{console.error(e),e.message&&this.$q.notify(e.message)})).finally((()=>o.hide()))}))},saveZip(){const e=this.$q.dialog({message:this.$t("creating_save_file"),persistent:!0,ok:!1});setTimeout((()=>{_s(fs["wtClient"].torrents[0]).catch((e=>{console.error(e),e.message&&this.$q.notify(e.message)})).finally((()=>e.hide()))}))}},created(){console.log("[wt] created"),X["a"].on("weberror",((...e)=>this.$q.notify(...e))),X["a"].on("wt-task",(e=>{this.task=Array.isArray(e)?e[0]:e}))}},bs=gs,ys=(n("5ab7"),Object(v["a"])(bs,rs,ls,!1,null,"71beeddd",null)),vs=ys.exports;C()(ys,"components",{QPage:ts["a"],QHeader:ns["a"],QToolbar:ce["a"],QIcon:G["a"],QBtn:O["a"],QTooltip:H["a"],QDialog:q["a"],QCard:E["a"],QCardSection:A["a"],QInput:D["a"],QCardActions:N["a"]}),C()(ys,"directives",{ClosePopup:K["a"]});const ws=[{name:"MainLayout",path:"/",redirect:"/library",component:()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,"2cae")),children:[{name:"Library",path:"/library",component:_e,children:[{name:"LibraryExplore",path:"explore",component:At},{name:"LibraryFollowing",path:"following",component:Ft},{name:"LibraryFavorites",path:"favorite",component:Vt},{name:"LibraryEdit",path:"edit",component:Hn},{name:"LibraryChannel",path:"channel",component:ao},{name:"LibraryCreator",path:"creator",component:uo},{name:"LibraryTakeDown",path:"takedown",component:ko},{name:"LibraryIndex",path:"",component:Po}]},{name:"Downloader",path:"/downloader",component:Object(Z["isElectron"])()||Object(fe["a"])()?is:vs},{name:"Player",path:"/player",component:()=>n.e(8).then(n.bind(null,"d8f8"))},{name:"Credits",path:"/credits",component:()=>n.e(6).then(n.bind(null,"316f"))},{name:"Blockchain",path:"/blockchain",component:()=>n.e(9).then(n.bind(null,"4b4f"))},{name:"AccountSettings",path:"/account/settings",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"6b91"))},{name:"BasicSetting",path:"/basicSetting",component:()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,"9ff7"))},{name:"AdvanceSetting",path:"/advanceSetting",component:()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,"154e"))},{name:"Development",path:"/development",component:()=>Promise.resolve().then(n.bind(null,"39df"))}]},{name:"Error",path:"*",component:()=>n.e(10).then(n.bind(null,"183d"))}];var ks=ws;o["a"].use(a["a"]);const Cs=a["a"].prototype.push;a["a"].prototype.push=function(e){return Cs.call(this,e).catch((e=>e))};let $s=null;function Ss(){return $s}t["a"]=function(){const e=new a["a"]({scrollBehavior:()=>({x:0,y:0}),routes:ks,mode:"history",base:"/"});return $s=e,e}},"61dc":function(e,t,n){"use strict";n("d34c")},6422:function(e,t,n){"use strict";n.d(t,"e",(function(){return s})),n.d(t,"a",(function(){return i})),n.d(t,"g",(function(){return r})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return h})),n.d(t,"f",(function(){return _}));n("a1c1"),n("de6c");var o=n("4fd2");const a=(e,t="0",n=2)=>(t.repeat(n)+e).slice(-n),s=e=>{if("number"!==typeof e)return"-";const t=Math.floor(e/1e3),n=t%60,o=(t-n)/60;if(isNaN(n))return"-";if(o<60)return`00:${a(o)}:${a(n)}`;const s=o%60,i=(o-s)/60;return i>23?"> 24h":`${a(i)}:${a(s)}:${a(n)}`},i=(e,{byte:t=!0,gb:n=!0,fix:o=2}={})=>{if("number"!==typeof e)return"-";if(e<1e3&&t)return e.toFixed(2)+" Byte";const a=e/1e3;if(isNaN(a))return t?"0 Byte":"0 KB";if(a<1e3)return a.toFixed(o)+" KB";const s=a/1e3;if(s<1e3||!n)return s.toFixed(o)+" MB";const i=s/1e3;return i.toFixed(o)+" GB"},r=e=>"number"!==typeof e?"0%":1===e?"100.00%":e>.9999?"99.99%":(100*e).toFixed(2)+"%",l=e=>{const t={icon:"insert_drive_file",tooltip:"unknown"};if(0===e.length)return t;if(e.length>1)return{icon:"folder",tooltip:"folder"};const n=e[0].match(/\.[^.]+?$/);if(!n)return t;const a=n[0].substring(1);return Object(o["b"])(a)?{icon:"audio_file",tooltip:"audio"}:Object(o["c"])(a)?{icon:"video_file",tooltip:"video"}:["ass","vtt","srt"].includes(a)?{icon:"subtitles",tooltip:"subtitle"}:["jpg","jpeg","png","bmp","gif","webp"].includes(a)?{icon:"image",tooltip:"image"}:["zip","rar","gzip","gz","tar"].includes(a)?{icon:"folder_zip",tooltip:"zip"}:["txt","text"].includes(a)?{icon:"description",tooltip:"text"}:t},c=()=>navigator.userAgent.includes("Windows NT"),d=/(\/private)?\/var\/mobile\/Containers\/Data\/Application\/[a-zA-Z0-9-]+\/Documents\//,u=e=>e.match(d)?e.replace(d,""):e,h=(e,t=[],n=!1)=>{const o=c()||n?"\\":"/",a=e.map((e=>e.split(o))),s={};for(const r of a){let e=s;for(const t of r)e[t]||(e[t]={}),e=e[t]}let i=s,l=null,d="";try{do{const e=Object.keys(i)[0];d=d+e+o,l=i,i=i[e]}while(1===Object.keys(i).length)}catch(m){return null}d=d.split(o).slice(0,-1).join(o);const h={[d]:l[Object.keys(l)[0]]},p=(e,n="")=>{const a=Object.keys(e)[0],s=n?n+o+a:a,i=e[a];if(i&&Object.keys(i).length>0)return{label:u(a),path:u(s),fullPath:s,children:Object.keys(i).map((e=>p({[e]:i[e]},s)))};const l=t.find((e=>e.path===s)),c=u(a),d=c.length>52?c.slice(0,4)+"..."+c.slice(-40):c;return{progress:l?r(l.progress):"-",done:1===l.progress,label:d,fullPath:s,path:s}};return p(h)},p=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),m=e=>[e.getFullYear(),e.getMonth()+1,e.getDate()].map((e=>a(e))).join("-"),_=(e,t,n=navigator.language)=>{if(!e)return"-";const o=new Date(e),a=new Date;return p(o,a)?o.toLocaleTimeString(n):(a.setDate(a.getDate()-1),p(o,a)?t?t("yesterday"):"yesterday":(a.setDate(a.getDate()-1),p(o,a)?t?t("before_yesterday",{empty:m(o)}):"before yesterday":m(o)))}},6545:function(e,t,n){},6580:function(e,t,n){"use strict";n("0c70")},6755:function(e,t,n){},6792:function(e,t,n){"use strict";n("b031")},"67b6":function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{ref:"dialog",attrs:{persistent:!0,"content-class":{"markdown-dialog":!0,"fullscreen-dialog":e.fullscreen},position:e.fullscreen?"bottom":"standard"},on:{hide:function(t){return e.$emit("hide")}}},[n("q-card",{staticClass:"overflow-hidden column no-wrap",staticStyle:{"min-width":"320px","max-width":"720px","min-height":"calc(320px - 64px)","max-height":"calc(100vh - 64px)"},style:{paddingTop:(e.fullscreen&&e.$q.platform.is.electron?30:0)+"px"}},[n("q-card-section",{staticClass:"non-selectable flex justify-start items-center",class:{"q-py-sm":e.fullscreen}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.title))]),n("q-space"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.screen$xs,expression:"!screen$xs"}],attrs:{"fab-mini":"",icon:e.isFullscreen?"fullscreen_exit":"fullscreen",unelevated:""},on:{click:function(t){e.isFullscreen=!e.isFullscreen}}}),n("q-btn",{attrs:{"fab-mini":"",icon:"close",unelevated:""},on:{click:e.hide}})],1),n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:Object.keys(e.contents).length>1,expression:"Object.keys(contents).length > 1"}],staticClass:"q-py-none",staticStyle:{"margin-top":"-8px"}},[n("q-tabs",{staticStyle:{margin:"0 -16px"},attrs:{dense:"",align:"left","no-caps":"","narrow-indicator":""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},[e._l(e.contents,(function(e,t){return[n("q-tab",{key:t,attrs:{ripple:!1,name:t,label:e.label}})]}))],2)],1),n("q-separator"),n("q-card-section",{staticClass:"q-pa-none scroll-y",staticStyle:{"max-height":"100%"}},[n("q-tab-panels",{attrs:{animated:""},model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},[e._l(e.contents,(function(t,o){return[n("q-tab-panel",{key:o,staticClass:"markdown-content",attrs:{name:o},domProps:{innerHTML:e._s(t.markdown)}})]}))],2)],1)],1)],1)},a=[],s=(n("de6c"),n("8e03")),i=n.n(s);const r={methods:{show(){this.$refs.dialog.show()},hide(){this.$refs.dialog.hide()}}},l={data(){return{isFullscreen:!1}},computed:{fullscreen(){return this.screen$xs||this.isFullscreen}}};var c={name:"MarkdownDialog",mixins:[r,l],props:{title:String,markdown:[Array,Object]},data(){return{currentTab:null}},computed:{contents(){const e=new i.a("commonmark");if(Array.isArray(this.markdown))return{content:{label:"content",markdown:e.render(this.markdown.join("\n"))}};const t={};return Object.entries(this.markdown).forEach((([n,o])=>{t[n]={label:o.label,markdown:e.render(o.markdown.join("\n"))}})),t}},created(){this.currentTab=Object.keys(this.contents)[0]}},d=c,u=(n("2cab"),n("2b5f")),h=n("b2aa"),p=n("e586"),m=n("d7c7"),_=n("990e"),f=n("1043"),g=n("74cb"),b=n("ec78"),y=n("fc38"),v=n("917f"),w=n("c72d"),k=n("09a4"),C=n.n(k),$=Object(u["a"])(d,o,a,!1,null,null,null),S=$.exports;C()($,"components",{QDialog:h["a"],QCard:p["a"],QCardSection:m["a"],QSpace:_["a"],QBtn:f["a"],QTabs:g["a"],QTab:b["a"],QSeparator:y["a"],QTabPanels:v["a"],QTabPanel:w["a"]});t["b"]={methods:{createMarkdownDialog({title:e,markdown:t}){return this.$q.dialog({component:S,title:e,markdown:t})}}};function x({title:e,markdown:t}){return this.$q.dialog({component:S,title:e,markdown:t})}},"6ce4":function(e,t,n){},"6e85":function(e,t,n){},7:function(e,t){},7285:function(e,t,n){"use strict";n("c066")},7297:function(e,t,n){"use strict";n("a5fe")},7405:function(e,t,n){},7447:function(e,t,n){},7471:function(e,t,n){"use strict";(function(e){var o=n("3fd2"),a=n.n(o);let s;if(a.a.main())s=n("9e8c"),Object.defineProperty(e,"lzma",{get(){return s}});else if(a.a.renderer())s=require("lzma-native"),Object.defineProperty(e,"lzma",{get(){return s}});else{const t=n("6ca2").LZMA;s=new t,Object.defineProperty("undefined"===typeof window?e:window,"lzma",{get(){return s}})}t["a"]=s}).call(this,n("0ee4"))},7686:function(e,t,n){},"76ec":function(e,t,n){"use strict";t["a"]=[" GNU GENERAL PUBLIC LICENSE"," Version 2, June 1991",""," Copyright (C) 1989, 1991 Free Software Foundation, Inc.,"," 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"," Everyone is permitted to copy and distribute verbatim copies"," of this license document, but changing it is not allowed.",""," Preamble",""," The licenses for most software are designed to take away your","freedom to share and change it. By contrast, the GNU General Public","License is intended to guarantee your freedom to share and change free","software--to make sure the software is free for all its users. This","General Public License applies to most of the Free Software","Foundation's software and to any other program whose authors commit to","using it. (Some other Free Software Foundation software is covered by","the GNU Lesser General Public License instead.) You can apply it to","your programs, too.",""," When we speak of free software, we are referring to freedom, not","price. Our General Public Licenses are designed to make sure that you","have the freedom to distribute copies of free software (and charge for","this service if you wish), that you receive source code or can get it","if you want it, that you can change the software or use pieces of it","in new free programs; and that you know you can do these things.",""," To protect your rights, we need to make restrictions that forbid","anyone to deny you these rights or to ask you to surrender the rights.","These restrictions translate to certain responsibilities for you if you","distribute copies of the software, or if you modify it.",""," For example, if you distribute copies of such a program, whether","gratis or for a fee, you must give the recipients all the rights that","you have. You must make sure that they, too, receive or can get the","source code. And you must show them these terms so they know their","rights.",""," We protect your rights with two steps: (1) copyright the software, and","(2) offer you this license which gives you legal permission to copy,","distribute and/or modify the software.",""," Also, for each author's protection and ours, we want to make certain","that everyone understands that there is no warranty for this free","software. If the software is modified by someone else and passed on, we","want its recipients to know that what they have is not the original, so","that any problems introduced by others will not reflect on the original","authors' reputations.",""," Finally, any free program is threatened constantly by software","patents. We wish to avoid the danger that redistributors of a free","program will individually obtain patent licenses, in effect making the","program proprietary. To prevent this, we have made it clear that any","patent must be licensed for everyone's free use or not licensed at all.",""," The precise terms and conditions for copying, distribution and","modification follow.",""," GNU GENERAL PUBLIC LICENSE"," TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION",""," 0. This License applies to any program or other work which contains","a notice placed by the copyright holder saying it may be distributed",'under the terms of this General Public License. The "Program", below,','refers to any such program or work, and a "work based on the Program"',"means either the Program or any derivative work under copyright law:","that is to say, a work containing the Program or a portion of it,","either verbatim or with modifications and/or translated into another","language. (Hereinafter, translation is included without limitation in",'the term "modification".) Each licensee is addressed as "you".',"","Activities other than copying, distribution and modification are not","covered by this License; they are outside its scope. The act of","running the Program is not restricted, and the output from the Program","is covered only if its contents constitute a work based on the","Program (independent of having been made by running the Program).","Whether that is true depends on what the Program does.",""," 1. You may copy and distribute verbatim copies of the Program's","source code as you receive it, in any medium, provided that you","conspicuously and appropriately publish on each copy an appropriate","copyright notice and disclaimer of warranty; keep intact all the","notices that refer to this License and to the absence of any warranty;","and give any other recipients of the Program a copy of this License","along with the Program.","","You may charge a fee for the physical act of transferring a copy, and","you may at your option offer warranty protection in exchange for a fee.",""," 2. You may modify your copy or copies of the Program or any portion","of it, thus forming a work based on the Program, and copy and","distribute such modifications or work under the terms of Section 1","above, provided that you also meet all of these conditions:",""," a) You must cause the modified files to carry prominent notices"," stating that you changed the files and the date of any change.",""," b) You must cause any work that you distribute or publish, that in"," whole or in part contains or is derived from the Program or any"," part thereof, to be licensed as a whole at no charge to all third"," parties under the terms of this License.",""," c) If the modified program normally reads commands interactively"," when run, you must cause it, when started running for such"," interactive use in the most ordinary way, to print or display an"," announcement including an appropriate copyright notice and a"," notice that there is no warranty (or else, saying that you provide"," a warranty) and that users may redistribute the program under"," these conditions, and telling the user how to view a copy of this"," License. (Exception: if the Program itself is interactive but"," does not normally print such an announcement, your work based on"," the Program is not required to print an announcement.)","","These requirements apply to the modified work as a whole. If","identifiable sections of that work are not derived from the Program,","and can be reasonably considered independent and separate works in","themselves, then this License, and its terms, do not apply to those","sections when you distribute them as separate works. But when you","distribute the same sections as part of a whole which is a work based","on the Program, the distribution of the whole must be on the terms of","this License, whose permissions for other licensees extend to the","entire whole, and thus to each and every part regardless of who wrote it.","","Thus, it is not the intent of this section to claim rights or contest","your rights to work written entirely by you; rather, the intent is to","exercise the right to control the distribution of derivative or","collective works based on the Program.","","In addition, mere aggregation of another work not based on the Program","with the Program (or with a work based on the Program) on a volume of","a storage or distribution medium does not bring the other work under","the scope of this License.",""," 3. You may copy and distribute the Program (or a work based on it,","under Section 2) in object code or executable form under the terms of","Sections 1 and 2 above provided that you also do one of the following:",""," a) Accompany it with the complete corresponding machine-readable"," source code, which must be distributed under the terms of Sections"," 1 and 2 above on a medium customarily used for software interchange; or,",""," b) Accompany it with a written offer, valid for at least three"," years, to give any third party, for a charge no more than your"," cost of physically performing source distribution, a complete"," machine-readable copy of the corresponding source code, to be"," distributed under the terms of Sections 1 and 2 above on a medium"," customarily used for software interchange; or,",""," c) Accompany it with the information you received as to the offer"," to distribute corresponding source code. (This alternative is"," allowed only for noncommercial distribution and only if you"," received the program in object code or executable form with such"," an offer, in accord with Subsection b above.)","","The source code for a work means the preferred form of the work for","making modifications to it. For an executable work, complete source","code means all the source code for all modules it contains, plus any","associated interface definition files, plus the scripts used to","control compilation and installation of the executable. However, as a","special exception, the source code distributed need not include","anything that is normally distributed (in either source or binary","form) with the major components (compiler, kernel, and so on) of the","operating system on which the executable runs, unless that component","itself accompanies the executable.","","If distribution of executable or object code is made by offering","access to copy from a designated place, then offering equivalent","access to copy the source code from the same place counts as","distribution of the source code, even though third parties are not","compelled to copy the source along with the object code.",""," 4. You may not copy, modify, sublicense, or distribute the Program","except as expressly provided under this License. Any attempt","otherwise to copy, modify, sublicense or distribute the Program is","void, and will automatically terminate your rights under this License.","However, parties who have received copies, or rights, from you under","this License will not have their licenses terminated so long as such","parties remain in full compliance.",""," 5. You are not required to accept this License, since you have not","signed it. However, nothing else grants you permission to modify or","distribute the Program or its derivative works. These actions are","prohibited by law if you do not accept this License. Therefore, by","modifying or distributing the Program (or any work based on the","Program), you indicate your acceptance of this License to do so, and","all its terms and conditions for copying, distributing or modifying","the Program or works based on it.",""," 6. Each time you redistribute the Program (or any work based on the","Program), the recipient automatically receives a license from the","original licensor to copy, distribute or modify the Program subject to","these terms and conditions. You may not impose any further","restrictions on the recipients' exercise of the rights granted herein.","You are not responsible for enforcing compliance by third parties to","this License.",""," 7. If, as a consequence of a court judgment or allegation of patent","infringement or for any other reason (not limited to patent issues),","conditions are imposed on you (whether by court order, agreement or","otherwise) that contradict the conditions of this License, they do not","excuse you from the conditions of this License. If you cannot","distribute so as to satisfy simultaneously your obligations under this","License and any other pertinent obligations, then as a consequence you","may not distribute the Program at all. For example, if a patent","license would not permit royalty-free redistribution of the Program by","all those who receive copies directly or indirectly through you, then","the only way you could satisfy both it and this License would be to","refrain entirely from distribution of the Program.","","If any portion of this section is held invalid or unenforceable under","any particular circumstance, the balance of the section is intended to","apply and the section as a whole is intended to apply in other","circumstances.","","It is not the purpose of this section to induce you to infringe any","patents or other property right claims or to contest validity of any","such claims; this section has the sole purpose of protecting the","integrity of the free software distribution system, which is","implemented by public license practices. Many people have made","generous contributions to the wide range of software distributed","through that system in reliance on consistent application of that","system; it is up to the author/donor to decide if he or she is willing","to distribute software through any other system and a licensee cannot","impose that choice.","","This section is intended to make thoroughly clear what is believed to","be a consequence of the rest of this License.",""," 8. If the distribution and/or use of the Program is restricted in","certain countries either by patents or by copyrighted interfaces, the","original copyright holder who places the Program under this License","may add an explicit geographical distribution limitation excluding","those countries, so that distribution is permitted only in or among","countries not thus excluded. In such case, this License incorporates","the limitation as if written in the body of this License.",""," 9. The Free Software Foundation may publish revised and/or new versions","of the General Public License from time to time. Such new versions will","be similar in spirit to the present version, but may differ in detail to","address new problems or concerns.","","Each version is given a distinguishing version number. If the Program",'specifies a version number of this License which applies to it and "any','later version", you have the option of following the terms and conditions',"either of that version or of any later version published by the Free","Software Foundation. If the Program does not specify a version number of","this License, you may choose any version ever published by the Free Software","Foundation.",""," 10. If you wish to incorporate parts of the Program into other free","programs whose distribution conditions are different, write to the author","to ask for permission. For software which is copyrighted by the Free","Software Foundation, write to the Free Software Foundation; we sometimes","make exceptions for this. Our decision will be guided by the two goals","of preserving the free status of all derivatives of our free software and","of promoting the sharing and reuse of software generally.",""," NO WARRANTY",""," 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY","FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN","OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES",'PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED',"OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF","MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS","TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE","PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,","REPAIR OR CORRECTION.",""," 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING","WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR","REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,","INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING","OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED","TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY","YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER","PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE","POSSIBILITY OF SUCH DAMAGES.",""," END OF TERMS AND CONDITIONS",""," How to Apply These Terms to Your New Programs",""," If you develop a new program, and you want it to be of the greatest","possible use to the public, the best way to achieve this is to make it","free software which everyone can redistribute and change under these terms.",""," To do so, attach the following notices to the program. It is safest","to attach them to the start of each source file to most effectively","convey the exclusion of warranty; and each file should have at least",'the "copyright" line and a pointer to where the full notice is found.',""," "," Copyright (C) ",""," This program is free software; you can redistribute it and/or modify"," it under the terms of the GNU General Public License as published by"," the Free Software Foundation; either version 2 of the License, or"," (at your option) any later version.",""," This program is distributed in the hope that it will be useful,"," but WITHOUT ANY WARRANTY; without even the implied warranty of"," MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"," GNU General Public License for more details.",""," You should have received a copy of the GNU General Public License along"," with this program; if not, write to the Free Software Foundation, Inc.,"," 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.","","Also add information on how to contact you by electronic and paper mail.","","If the program is interactive, make it output a short notice like this","when it starts in an interactive mode:",""," Gnomovision version 69, Copyright (C) year name of author"," Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'."," This is free software, and you are welcome to redistribute it"," under certain conditions; type `show c' for details.","","The hypothetical commands `show w' and `show c' should show the appropriate","parts of the General Public License. Of course, the commands you use may","be called something other than `show w' and `show c'; they could even be","mouse-clicks or menu items--whatever suits your program.","","You should also get your employer (if you work as a programmer) or your",'school, if any, to sign a "copyright disclaimer" for the program, if',"necessary. Here is a sample; alter the names:",""," Yoyodyne, Inc., hereby disclaims all copyright interest in the program"," `Gnomovision' (which makes passes at compilers) written by James Hacker.",""," , 1 April 1989"," Ty Coon, President of Vice","","This General Public License does not permit incorporating your program into","proprietary programs. If your program is a subroutine library, you may","consider it more useful to permit linking proprietary applications with the","library. If this is what you want to do, use the GNU Lesser General","Public License instead of this License.",""]},7895:function(e,t,n){"use strict";n("ae24")},"79e7":function(e,t,n){"use strict";var o=n("ff9b"),a=(n("de6c"),n("3387")),s=n.n(a);function i(e,t,n){const s=n?e=>e[n]:e=>e;for(const r of t){const t=e.findIndex((e=>s(e)===s(r)));-1===t?e.push(r):"object"===typeof r?Array.isArray(r)?i(e[t],r):Object(a["isEqual"])(e[t],r)||o["a"].set(e,t,r):o["a"].set(e,t,r)}for(let o=0;os(t)===s(e[o])))||e.splice(o--,1);return e}const r={tasksCount:{downloading:0,uploading:0,downloaded:0},abKeys:{},uploadingTasks:[],shouldDisableTasks:!1,uploadingLoading:!1,updatingTaskList:!1},l=new o["a"]({data(){return{downloading:[],uploading:[],downloaded:[],totalDownloadSpeed:0,totalUploadSpeed:0,totalDownloadProgress:0}}}),c={DOWNLOADER_UPDATE_DOWNLOADING_TASK_COUNT(e,t){e.tasksCount.downloading=t},DOWNLOADER_UPDATE_UPLOADING_TASK_COUNT(e,t){e.tasksCount.uploading=t},DOWNLOADER_UPDATE_DOWNLOADED_TASK_COUNT(e,t){e.tasksCount.downloaded=t},DOWNLOADER_SET_UPLOADING_LOADING(e,t){e.uploadingLoading=t},updateTaskCount(e,t){Object.assign(e.tasksCount,t)},changeDisableTasks(e,t){e.shouldDisableTasks=t},updateABKeys(e,t){for(const n in t){const o=t[n],a=e.abKeys[n];a?e.abKeys[n]=[...i(a,o,"key")]:e.abKeys=t}},updateUploading(e,t){console.log("updateUploading",t),i(e.uploadingTasks,t,"abUrl")},setUpdatingTasks(e,t){e.updatingTaskList=t},updateTaskInfo(e,t){o["a"].set(l,t.type,t.info)},updateTasks(e,t){const{uploadingTasks:n,tasksCount:o,abKeyObj:a}=t;i(e.uploadingTasks,n,"abUrl");for(const s in o)e.tasksCount[s]=o[s];for(const s in a){const t=a[s],n=e.abKeys[s];n?i(n,t,"key"):e.abKeys=a}}},d={},u={taskCount(e){return e.tasksCount},getDownloadingTaskCount(e){return e.tasksCount.downloading},getUploadingTaskCount(e){return e.tasksCount.uploading},getDownloadedTaskCount(e){return e.tasksCount.downloaded},shouldDisableTasks(e){return e.shouldDisableTasks},isUploadingLoading(e){return e.uploadingLoading},abKeys(e){return e.abKeys},uploading(e){return e.uploadingTasks},tasks(){return l.$data},allTasks(){return[...l.downloading,...l.uploading,...l.downloaded]}},h={namespaced:!1,state:r,mutations:c,actions:d,getters:u};var p=h,m=n("d310"),_=n("8a63"),f=n("9efe"),g=n("e74d"),b=n("e75b"),y=n("d7df"),v=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const w=new b["a"].Rest("ABDevRest"),k=()=>v(void 0,void 0,void 0,(function*(){const e=window.$blockchain.$store.account;if(yield e.initCurrentAccount(),e.account)return;const t=yield e.createNewAccount();yield t.confirm(),yield e.recoveryAccount({key:t.toPrivateKeyObject().privateKeyHex}),console.log("The blockchain account has been created automatically: ",t)})),C=()=>v(void 0,void 0,void 0,(function*(){"blockchain"===localStorage.getItem("dataPaymentMixin.mode")&&(yield k())})),$=e=>{var t,n;return{sub:e.attributes.sub,username:e.username,signingTime:e.attributes["custom:signing_time"],signingIpAddress:e.attributes["custom:signing_ip_address"],lastLoginTime:e.attributes["custom:last_login_time"],lastIpAddress:e.attributes["custom:last_ip_address"],accountLevel:e.attributes["custom:account_level"],msgLocale:e.attributes["custom:msg_locale"],nickname:e.attributes.nickname,gender:e.attributes.gender,birthday:e.attributes.birthdate,locale:e.attributes.locale,email:e.attributes.email,phoneNumber:e.attributes.phone_number,phoneNumberCountryCode:e.attributes["custom:phone_number_code"],emailVerified:e.attributes.email_verified,phoneNumberVerified:e.attributes.phone_number_verified,invitationCode:null===(t=e.dynamo_attrs)||void 0===t?void 0:t.invitation_code,identities:JSON.parse(null!==(n=e.attributes.identities)&&void 0!==n?n:"[]")}},S=["sub","username","email","emailVerified","phoneNumber","phoneNumberCountryCode","phoneNumberVerified","signingTime","signingIpAddress","lastLoginTime","lastIpAddress","accountLevel","msgLocale","invitationCode","identities"],x=["nickname","gender","birthday","locale"],T=Object.assign(Object.assign({authState:null},[...S,...x].reduce(((e,t)=>(e[t]=void 0,e)),{})),{verification:null,preferredMFA:null}),I={ACCOUNT_UPDATE_INFO(e,t){Object.keys(t).forEach((n=>{const o=n;if(void 0!==t[o])e[o]=t[o];else{const t={gender:"notSay",locale:"notSay"};e[o]=t[o]||""}}))},ACCOUNT_CLEAR_INFO(e){[...S,...x].forEach((t=>{e[t]=void 0}))},ACCOUNT_UPDATE_STATE(e,t){if(e.verification&&["forgotPassword","signUpConfirm","signInConfirm","signUp"].includes(e.authState)&&(e.verification=null),e.authState=t,m["Bus"].$emit("update-authstate",t),"signedIn"!==e.authState)return console.log("Skip not sign in",t);console.log("authState:",e.authState),y["a"].emit("user_login","store - account_update_state"),Object(_["a"])()},ACCOUNT_UPDATE_VERIFICATION(e,t){t?(e.verification||(e.verification={}),Object.assign(e.verification,t)):e.verification=null},ACCOUNT_SET_MFA_TYPE(e,t){e.preferredMFA=t}},P={ACCOUNT_UPDATE_INFO({commit:e}){return v(this,void 0,void 0,(function*(){const t=yield Object(f["f"])();return e("ACCOUNT_UPDATE_INFO",$(t)),g["a"].currentAuthenticatedUser().then((e=>g["a"].getPreferredMFA(e))).then((t=>e("ACCOUNT_SET_MFA_TYPE",t))),{message:"success"}}))},ACCOUNT_REDIRECT_TO_INDEX({dispatch:e,commit:t,state:n}){return v(this,void 0,void 0,(function*(){const o=()=>v(this,void 0,void 0,(function*(){yield Promise.all([C(),e("CREDIT_INIT_DATA")]),t("ACCOUNT_UPDATE_STATE","signedIn")})),a=()=>v(this,void 0,void 0,(function*(){yield Promise.all([e("CREDIT_CLEAR_DATA")]),t("ACCOUNT_UPDATE_STATE","signedOut")}));try{const t=yield Object(f["e"])(!1).catch((e=>(console.warn("debug#859: fetchAuthUser"),console.log(e),null)));if(!t)return yield a();yield e("ACCOUNT_UPDATE_INFO"),"signedIn"!==n.authState?yield o():(console.warn("debug#859: state.authState"),console.log(n.authState))}catch(s){console.error('failed to "ACCOUNT_REDIRECT_TO_INDEX"'),console.warn("debug#859: state.authState"),console.log(s),yield a()}}))},ACCOUNT_SIGN_IN({commit:e,dispatch:t},{username:n,password:o}){return v(this,void 0,void 0,(function*(){const a=yield Object(f["l"])(n,o).catch((e=>e));if(a){if("SMS_MFA"===a.message)throw e("ACCOUNT_UPDATE_VERIFICATION",{username:n,password:o,type:"phone_number",mfaType:a.message,destination:a.destination,user:a.user}),a;if("SOFTWARE_TOKEN_MFA"===a.message)throw e("ACCOUNT_UPDATE_VERIFICATION",{username:n,password:o,type:"software_token",mfaType:a.message,user:a.user}),a;if("UserNotConfirmedException"===a.code){e("ACCOUNT_UPDATE_VERIFICATION",{username:n,password:o});const s=yield t("ACCOUNT_SIGN_UP_VERIFICATION_CODE_RESEND");throw"success"===s.message?new Error(a.code):s}throw a}return e("ACCOUNT_CLEAR_INFO"),yield t("ACCOUNT_UPDATE_INFO"),yield Promise.all([C(),t("CREDIT_INIT_DATA")]),{message:"success"}}))},ACCOUNT_SIGN_OUT({commit:e,dispatch:t}){return v(this,void 0,void 0,(function*(){yield Object(f["n"])(),e("ACCOUNT_UPDATE_STATE","signedOut"),e("ACCOUNT_CLEAR_INFO"),yield t("CREDIT_CLEAR_DATA")}))},ACCOUNT_DELETE_USER({commit:e,dispatch:t},{password:n}){return v(this,void 0,void 0,(function*(){yield Object(f["x"])(n),yield Object(f["d"])(),yield Object(f["n"])(),e("ACCOUNT_UPDATE_STATE","signedOut"),e("ACCOUNT_CLEAR_INFO"),yield t("CREDIT_CLEAR_DATA")}))},ACCOUNT_SET_MFA_TYPE({dispatch:e,commit:t,state:n},o){return v(this,void 0,void 0,(function*(){if(!["SMS_MFA","TOTP","SOFTWARE_TOKEN_MFA","NOMFA"].includes(o))throw new Error("Illegal mfa type");const e=yield g["a"].currentAuthenticatedUser();yield g["a"].setPreferredMFA(e,o);const n=yield g["a"].getPreferredMFA(e);t("ACCOUNT_SET_MFA_TYPE",n)}))},ACCOUNT_MFA_RESEND({dispatch:e,commit:t,state:n}){return v(this,void 0,void 0,(function*(){const o=n.verification.username,a=n.verification.password,s=yield e("ACCOUNT_SIGN_IN",{username:o,password:a}).catch((e=>e));if(!s)throw new Error("Unexpected Error");"SMS_MFA"===s.message?t("ACCOUNT_UPDATE_VERIFICATION",{username:o,password:a,type:"phone_number",mfaType:s.message,destination:s.destination,user:s.user}):"SOFTWARE_TOKEN_MFA"===s.message&&t("ACCOUNT_UPDATE_VERIFICATION",{username:o,password:a,type:"software_token",mfaType:s.message,user:s.user})}))},ACCOUNT_MFA_SUBMIT({state:e,commit:t,dispatch:n},o){return v(this,void 0,void 0,(function*(){const a=e.verification.user,s=e.verification.mfaType;yield Object(f["m"])(a,s,o),t("ACCOUNT_CLEAR_INFO"),yield n("ACCOUNT_UPDATE_INFO"),yield n("CREDIT_INIT_DATA")}))},ACCOUNT_CHANGE_ATTRIBUTES({dispatch:e},t){return v(this,void 0,void 0,(function*(){yield Object(f["b"])(t),yield e("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_UNLINK_OAUTH({dispatch:e,state:t},n){return v(this,void 0,void 0,(function*(){if(t.identities.length<=0)throw new Error("Not oauth provider existed");const o=t.identities.find((e=>e.providerName===n));if(!o)throw new Error("Can not found oauth provider: "+n);yield Object(f["r"])(n,o.userId),yield e("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_PASSWORD({commit:e},{oldPassword:t,newPassword:n}){return v(this,void 0,void 0,(function*(){const e=yield g["a"].currentAuthenticatedUser();yield w.post("/account/changePassword",{username:e.getUsername(),AccessToken:e.signInUserSession.getAccessToken().getJwtToken(),PreviousPassword:t,ProposedPassword:n})}))},ACCOUNT_FORGOT_PASSWORD_SEND({state:e,commit:t,rootGetters:n},o){return v(this,void 0,void 0,(function*(){const e=n.settings.language,a=yield Object(f["g"])(o,{msgLocale:`${e}:F`});return t("ACCOUNT_UPDATE_VERIFICATION",{username:o,type:a.CodeDeliveryDetails.AttributeName,destination:a.CodeDeliveryDetails.Destination}),{message:"success"}}))},ACCOUNT_FORGOT_PASSWORD_SUBMIT({commit:e,state:t},{code:n,password:o}){return v(this,void 0,void 0,(function*(){yield w.postGuest("/account/forgotPasswordSubmit",{ClientId:g["a"].userPool.getClientId(),ConfirmationCode:n,Password:o,Username:t.verification.username})}))},ACCOUNT_SIGN_UP_NECESSARY({rootGetters:e,commit:t},n){return v(this,void 0,void 0,(function*(){if(!n.email&&!n.phoneNumber)throw new Error("Email or Phone Number must be fill when signing up.");const o=e.settings.language;n.msgLocale=`${o}:${n.email?"E":"P"}`;const a=yield Object(f["o"])(n);return t("ACCOUNT_UPDATE_VERIFICATION",{username:a.user.username,password:n.password,type:a.codeDeliveryDetails.AttributeName,destination:{email:n.email,phone_number:n.phoneNumber}[a.codeDeliveryDetails.AttributeName]}),{message:"success"}}))},ACCOUNT_SIGN_UP_VERIFICATION_CODE_RESEND({state:e,commit:t}){return v(this,void 0,void 0,(function*(){const t=e.verification.username;yield Object(f["i"])(t);return{message:"success"}}))},ACCOUNT_SIGN_UP_VERIFICATION_CODE_SUBMIT({commit:e,state:t},{code:n,optAttrs:o}){return v(this,void 0,void 0,(function*(){try{yield Object(f["c"])(t.verification.username,n,o)}catch(e){if(console.warn("ACCOUNT_SIGN_UP_VERIFICATION_CODE_SUBMIT",e),e instanceof Error&&!["User cannot be confirmed. Current status is CONFIRMED","User is already confirmed"].includes(e.message))throw e}return{message:"success"}}))},ACCOUNT_INVITE_CODE({commit:e,dispatch:t},{code:n,contactEmail:o,contactPhone:a}){return v(this,void 0,void 0,(function*(){return yield Object(f["h"])(n,o,a),yield t("ACCOUNT_UPDATE_INFO"),{message:"success"}}))},ACCOUNT_CHANGE_EMAIL_SEND({rootGetters:e,dispatch:t},n){return v(this,void 0,void 0,(function*(){const o=e.settings.language;return T.msgLocale===`${o}:E`||(yield Object(f["k"])(o,"E")),n&&n===T.email?yield Object(f["t"])("email"):yield Object(f["u"])("email",n),yield t("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_EMAIL_SUBMIT({dispatch:e},t){return v(this,void 0,void 0,(function*(){return yield Object(f["v"])("email",t),yield e("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_PHONE_NUMBER_SEND({rootGetters:e,state:t,dispatch:n},{phoneNumber:o,phoneNumberCountryCode:a}){return v(this,void 0,void 0,(function*(){const s=e.settings.language;return t.msgLocale===`${s}:P`||(yield Object(f["k"])(s,"P")),o&&a&&o===t.phoneNumber&&a===t.phoneNumberCountryCode?yield Object(f["t"])("phone_number"):yield Object(f["u"])("phone_number",o,a),yield n("ACCOUNT_UPDATE_INFO")}))},ACCOUNT_CHANGE_PHONE_NUMBER_SUBMIT({dispatch:e},t){return v(this,void 0,void 0,(function*(){return yield Object(f["v"])("phone_number",t),yield e("ACCOUNT_UPDATE_INFO")}))}},O={accountUserInfo(e,t){const n={};return Object.assign(n,t.accountUserOptionalInfo),n.preferredMFA=e.preferredMFA,Object.assign(n,t.accountUserReadonlyInfo),n},accountUserReadonlyInfo(){return S.reduce(((e,t)=>(e[t]=T[t],e)),{})},accountUserOptionalInfo(e){return x.reduce(((t,n)=>(t[n]=e[n],t)),{})}},q={namespaced:!1,state:T,mutations:I,actions:P,getters:O};var E=q,A=n("06e8"),D=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const N=new b["a"].Rest("ABDevRest"),L={Mutations:{CREDIT_SET_INIT_STATE:"CREDIT_SET_INIT_STATE",CREDIT_CLEAR_DATA:"CREDIT_CLEAR_DATA",CREDIT_UPDATE:"CREDIT_UPDATE",CREDIT_UPDATE_TXN:"CREDIT_UPDATE_TXN",CREDIT_CLEAR_TRANSACTION:"CREDIT_CLEAR_TRANSACTION",CREDIT_UPDATE_USER:"CREDIT_UPDATE_USER",CREDIT_UPDATE_EXPENSES:"CREDIT_UPDATE_EXPENSES",CREDIT_UPDATE_INCOME_TODAY:"CREDIT_UPDATE_INCOME_TODAY",CREDIT_UPDATE_TOKEN:"CREDIT_UPDATE_TOKEN",CREDIT_UPDATE_INCOME:"CREDIT_UPDATE_INCOME"},Actions:{CREDIT_INIT_DATA:"CREDIT_INIT_DATA",CREDIT_CLEAR_DATA:"CREDIT_CLEAR_DATA",CREDIT_TRANSFER:"CREDIT_TRANSFER",CREDIT_FETCH_TRANSACTION:"CREDIT_FETCH_TRANSACTION",CREDIT_CLEAR_TRANSACTION:"CREDIT_CLEAR_TRANSACTION"}},j=["credit"];var R,U;(function(e){e["TRANSFER"]="TRANSFER",e["PAYDATA"]="PAYDATA",e["RECHARGE"]="RECHARGE",e["BONUS"]="BONUS"})(R||(R={})),function(e){e["PENDING"]="PENDING",e["FAILED"]="FAILED",e["FINISH"]="FINISH",e["COMPLETED"]="COMPLETED"}(U||(U={}));const F=Object.assign({isModuleInit:0,incomeTransactions:[],expensesTransactions:[],incomeTodayTransactions:[],providentFund:null},j.reduce(((e,t)=>(e[t]=void 0,e)),{})),M={CREDIT_SET_INIT_STATE(e,t){e.isModuleInit=t},CREDIT_CLEAR_DATA(e){e.providentFund=null,j.forEach((t=>e[t]=void 0)),e.expensesTransactions=[],e.incomeTransactions=[],e.incomeTodayTransactions=[]},CREDIT_UPDATE(e,t){const n=e=>{const t={};for(const[n,o]of Object.entries(e)){let e=t;if(-1===n.indexOf("."))e[n]=o;else{const t=n.split(".");for(let n=0;nObject.keys(e).forEach((n=>{void 0!==t[n]&&(e[n]=t[n])}));let o=e.incomeTransactions.find((e=>e.id===t.id));if(o){if(n(o,t),o=e.incomeTodayTransactions.find((e=>e.id===t.id)),!o)return;n(o,t)}else{if(o=e.expensesTransactions.find((e=>e.id===t.id)),!o)return;n(o,t)}},CREDIT_UPDATE_USER(e,t){for(const[n,o]of Object.entries(t))j.includes(n)&&(e[n]=o)},CREDIT_UPDATE_INCOME(e,t){e.incomeTransactions=t},CREDIT_UPDATE_EXPENSES(e,t){e.expensesTransactions=t},CREDIT_UPDATE_INCOME_TODAY(e,t){e.incomeTodayTransactions=t}},B={CREDIT_TRANSFER({dispatch:e},{receiverSub:t,amount:n,meta:o}){return D(this,void 0,void 0,(function*(){const e=()=>{if(n=Number.parseInt(n),n>1e6)throw new Error("amount_too_large");if(n>F.credit)throw new Error("credit_not_enough_amount");if(o&&"object"!==typeof o)throw new Error("invalid_meta");o=JSON.stringify(o||{})};return e(),yield N.post("/credit/transfer",{receiverSub:t,amount:n,meta:o})}))},CREDIT_PAY_DATA_REQUEST({dispatch:e,state:t},{receiverSub:n,amount:o,meta:a}){return D(this,void 0,void 0,(function*(){if(o=Math.min(Number.parseInt(o),1e6),o>=t.credit)throw new Error("credit_not_enough_amount");return yield N.post("/dataProviding/request",{receiverSub:n,amount:o,meta:JSON.stringify(a)})}))},CREDIT_PAY_DATA_COMPLETED({dispatch:e},{transactionId:t}){return D(this,void 0,void 0,(function*(){return yield N.post("/dataProviding/complete",{transactionId:t})}))},CREDIT_PAY_DATA_FINISH({dispatch:e,rootState:t},{transactionId:n}){return D(this,void 0,void 0,(function*(){const e=window.localStorage.getItem("transaction_to_finish"),o=e?JSON.parse(e):{},a=o[t.account.sub]||[],s=a.map(((e,t)=>()=>D(this,void 0,void 0,(function*(){try{yield N.post("/dataProviding/finish",{transactionId:e}),delete a[t]}catch(n){n instanceof Error&&"Network Error"!==n.message&&delete a[t]}}))));s.push((()=>D(this,void 0,void 0,(function*(){try{yield N.post("/dataProviding/finish",{transactionId:n})}catch(e){if(!(e instanceof Error&&"Network Error"===e.message))throw e;a.push(n)}}))));try{yield Promise.all(s.map((e=>e())))}finally{o[t.account.sub]=a.filter((e=>null!==e)),window.localStorage.setItem("transaction_to_finish",JSON.stringify(o))}}))},CREDIT_PAY_DATA_CANCEL({dispatch:e},{transactionId:t}){return D(this,void 0,void 0,(function*(){return yield N.post("/dataProviding/cancel",{transactionId:t})}))},CREDIT_PF_DEPOSIT({commit:e,state:t},{amount:n,meta:o}){return D(this,void 0,void 0,(function*(){if(!t.providentFund||!1===t.providentFund.enable)return;const e=()=>{if(n=Number.parseInt(n),n>1e6)throw new Error("amount_too_large");if(n>=t.credit)throw new Error("credit_not_enough_amount");if(o&&"object"!==typeof o)throw new Error("invalid_meta");o=JSON.stringify(o||{})};return e(),yield N.post("/providentFund/deposit",{amount:n,meta:o})}))},CREDIT_PF_WITHDRAW(){return D(this,void 0,void 0,(function*(){return yield N.post("/providentFund/withdraw")}))},CREDIT_INIT_DATA({state:e,commit:t,dispatch:n,rootState:o,rootGetters:a}){return D(this,void 0,void 0,(function*(){if(e.isModuleInit)return;t(L.Mutations.CREDIT_SET_INIT_STATE,1),yield A["b"].enable(o.account.sub);const s=()=>D(this,void 0,void 0,(function*(){const e=b["a"].GQL.AwsApiGraphQL.injectAllOperations({}),n=()=>D(this,void 0,void 0,(function*(){const n=yield e.getUser(o.account.sub);t(L.Mutations.CREDIT_UPDATE,{credit:n.credit})})),a=()=>D(this,void 0,void 0,(function*(){const n=(()=>{let e=localStorage.getItem("credit.providentFund");return e?JSON.parse(e):(e={enable:!0,poolId:"12345678-1234-1234-1234-123456790ab"},localStorage.setItem("credit.providentFund",JSON.stringify(e)),e)})(),a=yield e.getProvidentFund(o.account.sub);n.value=(null===a||void 0===a?void 0:a.amount)||0,t(L.Mutations.CREDIT_UPDATE,{providentFund:n})}));yield Promise.all([n(),a()]);const s=e=>new Promise((t=>{const n=Object(A["c"])({query_type:"income"});(()=>{D(this,void 0,void 0,(function*(){while(n.hasNext())yield n.fetch(),e(n.getData());t()}))})()})),i=e=>new Promise((t=>{const n=Object(A["c"])({query_type:"expense"});(()=>{D(this,void 0,void 0,(function*(){while(n.hasNext())yield n.fetch(),e(n.getData());t()}))})()})),r=e=>new Promise((t=>{const n=()=>{const e=864e5,t=new Date,n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),o=new Date(n.getTime()+e);return[n,o]},[o,a]=n(),s=Object(A["c"])({query_type:"income",query_params:{createdAt:{oldest:o.toISOString(),latest:a.toISOString()}}});(()=>{D(this,void 0,void 0,(function*(){while(s.hasNext())yield s.fetch(),e(s.getData());t()}))})()}));Promise.all([s((e=>t(L.Mutations.CREDIT_UPDATE,{incomeTransactions:Object.values(e)}))),i((e=>t(L.Mutations.CREDIT_UPDATE,{expensesTransactions:Object.values(e)}))),r((e=>t(L.Mutations.CREDIT_UPDATE,{incomeTodayTransactions:Object.values(e)})))])}));yield s(),A["b"].addHandlers({credit_changed:n=>{var o;return t(L.Mutations.CREDIT_UPDATE,{credit:(null!==(o=e.credit)&&void 0!==o?o:0)+n})},dp_expense_txn:n=>{const o=e.expensesTransactions.find((e=>e.id===n.id));o?t(L.Mutations.CREDIT_UPDATE_TXN,n):t(L.Mutations.CREDIT_UPDATE,{expensesTransactions:[...e.expensesTransactions,n]})},dp_income_txn:n=>{const o=e.incomeTransactions.find((e=>e.id===n.id));o?t(L.Mutations.CREDIT_UPDATE_TXN,n):t(L.Mutations.CREDIT_UPDATE,{incomeTransactions:[...e.incomeTransactions,n]});const a=()=>{const e=864e5,t=new Date,n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),o=new Date(n.getTime()+e);return[n,o]},[s,i]=a();if(s.getTime()new Date(n.createdAt).getTime()){const o=e.incomeTodayTransactions.find((e=>e.id===n.id));o?t(L.Mutations.CREDIT_UPDATE_TXN,n):t(L.Mutations.CREDIT_UPDATE,{incomeTodayTransactions:[...e.incomeTodayTransactions,n]})}},pf_value_changed:n=>{var o,a;return t(L.Mutations.CREDIT_UPDATE,{"providentFund.value":(null!==(a=null===(o=e.providentFund)||void 0===o?void 0:o.value)&&void 0!==a?a:0)+n})},pf_deposit_txn:n=>t(L.Mutations.CREDIT_UPDATE,{expensesTransactions:[...e.expensesTransactions,n]}),pf_withdraw_txn:n=>t(L.Mutations.CREDIT_UPDATE,{incomeTransactions:[...e.incomeTransactions,n]})},s),A["a"].enable({rootState:o,rootGetters:a,dispatch:n}),t(L.Mutations.CREDIT_SET_INIT_STATE,2)}))},CREDIT_CLEAR_DATA({commit:e,state:t}){return D(this,void 0,void 0,(function*(){2===t.isModuleInit&&(e(L.Mutations.CREDIT_SET_INIT_STATE,1),yield A["b"].disable(),yield A["a"].disable(),e(L.Mutations.CREDIT_CLEAR_DATA),e(L.Mutations.CREDIT_SET_INIT_STATE,0),console.log("credit data cleared"))}))}},Q={transactions(e){const{incomeTransactions:t,expensesTransactions:n}=e;return{income:t,expenses:n}},incomeTodayTransactions(e){return e.incomeTodayTransactions}},W={namespaced:!1,state:F,mutations:M,actions:B,getters:Q};var z=W,H=n("508e"),V=n.n(H),G=n("fb31"),K=n.n(G),Y={hideMenu:!0,autoHide:!1,language:"en-US",darkMode:"system",defaultVideoPlayer:K.a.fileName,videoCacheTime:1,autoLaunch:!1,restore:!0,autoStartUnfinished:!0,seedSharingRate:!0,seedTime:!1,maximumDownloadNum:5,maximumConnectionsNum:20,saveLinkSeed:!1,unlimited:!0,continuousSeeding:!0,breakpointContinuation:!1,autoJumpToDownload:!0,notifyAfterDownloaded:!1,deleteConfirm:!1,defaultDeleteFiles:!1,uploadSpeed:-1,downloadSpeed:-1,payedUserShareRate:.7,downloadDirectory:"",autoUpload:!1,uploadDirectory:"",unlimitUploadAmount:!1,autoCheckUpdate:!0,useProxyService:!0,trackerSource:[{value:"https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt",label:"ngosang_best",cdn:!1},{value:"https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best_ip.txt",label:"ngosang_best_ip",cdn:!1}],trackerList:V.a.trackerList,autoUpdateTrackerServiceList:!0,trackerLastUpdateTime:"",listenPort:!1,BTlistenPort:21303,DHTlistenPort:26701,secureOption:"auto",bindMagnetUrl:!1,bindTorrentFile:!1,bindVideoFile:!1,bindVideoExts:{mp4:!1,mkv:!1,avi:!1,mov:!1,wmv:!1,rmvb:!1,flv:!1,webm:!1},bindAudioExts:{mp3:!1,wav:!1,aac:!1,flac:!1,m4a:!1,wma:!1},bindAudioFile:!1,dontAskForAssociate:!1,dontAskForPlayer:!1,userAgent:"",RPCauthorizationkey:"",versionChannel:"stable",githubPAT:"",lastUpdateCheckTime:Date.now(),disableDevTools:!0,minDiskSpace:512e6,autoDownload:!0,forceLogin:!0,libraryShowExplore:"remote",libraryRate:"G",libraryShowAllChannels:!1,libraryPreload:!0,showPreload:!1,downloadWithCellular:!1},J=n("3fd2"),X=n.n(J),Z=n("0f0c"),ee=n("908d"),te=n("d558"),ne=n("d710"),oe=n.n(ne),ae=function(e,t,n,o){function a(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function i(e){try{l(o.next(e))}catch(t){s(t)}}function r(e){try{l(o["throw"](e))}catch(t){s(t)}}function l(e){e.done?n(e.value):a(e.value).then(i,r)}l((o=o.apply(e,t||[])).next())}))};const se=Object(Z["a"])("version"),ie=!se.match(/(internal|web)-dev$/),re=X.a.renderer(),le=`${oe.a.name}_settings`,ce=_e(),de={UPDATE_SETTINGS(e,t){Object.assign(e,t),localStorage.setItem(le,JSON.stringify(e))}},ue={updateSettings({commit:e},t){e("UPDATE_SETTINGS",t)},fetchSettings({dispatch:e}){return ae(this,void 0,void 0,(function*(){if(Object(te["a"])())return new Promise((t=>{const n=localStorage.getItem(le),a={};a&&(Object.assign(a,JSON.parse(n)),t(JSON.parse(n))),y["a"].once("fetch-settings",(n=>ae(this,void 0,void 0,(function*(){yield e("updateSettings",n),console.log("Fetch from server");for(const e in n)o["a"].set(a,e,n[e]);t(a)})))),y["a"].emit("fetch-settings")}));if(!re){const t=localStorage.getItem(le),n=_e();return t||(ee["b"].is.capacitor&&(n.forceLogin=!1),console.log("\n\n\n\n\n\n\n\n\n\n\n\nset web settings:",n)),yield e("updateSettings",n),n}const t=yield Promise.resolve().then(n.t.bind(null,"b052",7)).then((e=>e.ipcRenderer.invoke("get-app-settings")));return yield e("updateSettings",t),t}))},set({dispatch:e,state:t},o){return ae(this,void 0,void 0,(function*(){if(Object(a["isEmpty"])(o))return;if(yield e("updateSettings",o),!re)return y["a"].emit("updateSettings",o);const{ipcRenderer:t}=yield Promise.resolve().then(n.t.bind(null,"b052",7));console.log("set settings");const s=new Promise((e=>{t.once("set_settings_success",((t,n)=>{e(n)}))}));return t.send("set_settings",o),s}))},resetSettings({commit:e,dispatch:t}){if(re)return new Promise((t=>ae(this,void 0,void 0,(function*(){const{ipcRenderer:o}=yield Promise.resolve().then(n.t.bind(null,"b052",7));o.once("reset_settings",((n,o)=>{console.log(o),e("UPDATE_SETTINGS",o),t(o)})),o.send("reset_settings")}))));{const t=Object(a["cloneDeep"])(Y);return e("UPDATE_SETTINGGS",t),t}}},he={settings(e){return e},isDevMode(e){return!e.disableDevTools||!ie}},pe={namespaced:!1,state:ce,mutations:de,actions:ue,getters:he};var me=pe;function _e(){const e=Object(a["cloneDeep"])(Y),t=`${oe.a.name}_settings`,n="undefined"===typeof localStorage?null:localStorage.getItem(t);if(n){const t=JSON.parse(n);Object.assign(e,t)}return e}const fe={currentVideo:{pipStatus:!1,updatePlayer:!1,url:"",path:"",currentTime:0}},ge={CURRENT_VIDEO_URL_MUTATION(e,t){e.currentVideo.url=t},CURRENT_VIDEO_PATH_MUTATION(e,t){e.currentVideo.path=t},CURRENT_VIDEO_SUBTITLE_LIST_MUTATION(e,t){e.currentVideo.subtitleList=t},CURRENT_VIDEO_CURRENT_TIME_MUTATION(e,t){e.currentVideo.currentTime=t},UPDATE_VIDEO_STATUS_MUTATION(e,t){e.currentVideo.status=t},UPDATE_VIDEO_PIP_STATUS_MUTATION(e,t){e.currentVideo.pipStatus=t},UPDATE_VIDEO_UPDATE_PLAYER_MUTATION(e,t){e.currentVideo.updatePlayer=t},SET_REMOTE_PLAY(e,t){e.currentVideo.infoHash=t,e.currentVideo.remotePlay=!0},RESET_INFOHASH(e){e.currentVideo.infoHash=""},RESET_REMOTE_PLAY(e){e.currentVideo.remotePlay=!1},RESET_PLAYER(){fe.currentVideo={pipStatus:!1,updatePlayer:!1,url:"",path:"",currentTime:0,subtitleList:[]}}},be={currentVideoUrl({commit:e},t){e("CURRENT_VIDEO_URL_MUTATION",t)},currentVideoPath({commit:e},t){e("CURRENT_VIDEO_PATH_MUTATION",t)},currentVideoSubtitleList({commit:e},t){e("CURRENT_VIDEO_SUBTITLE_LIST_MUTATION",t)},currentVideoCurrentTime({commit:e},t){e("CURRENT_VIDEO_CURRENT_TIME_MUTATION",t)},updateVideoStatus({commit:e},t){e("UPDATE_VIDEO_STATUS_MUTATION",t)},updateVideoPIPStatus({commit:e},t){e("UPDATE_VIDEO_PIP_STATUS_MUTATION",t)},updatePlayer({commit:e},t){e("UPDATE_VIDEO_UPDATE_PLAYER_MUTATION",t)},remotePlay({commit:e},t){e("SET_REMOTE_PLAY",t)},resetInfoHash({commit:e}){e("RESET_INFOHASH")},resetRemotePlay({commit:e}){e("RESET_REMOTE_PLAY")},resetPlayer({commit:e}){e("RESET_PLAYER")}},ye={video(){return fe.currentVideo.url}},ve={namespaced:!1,state:fe,mutations:ge,actions:be,getters:ye};var we=ve,ke=n("5fa3");t["a"]={downloader:p,account:E,credits:z,setting:me,video:we,library:ke["a"]}},"7ad0":function(e,t,n){},"7d7c":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return C}));n("a1c1"),n("7a76");var o=n("c620"),a=n("f680"),s=n("61a1"),i=n("1926"),r=n("5584"),l=n("eb7a"),c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-page",{staticStyle:{position:"relative"}},[n("input",{ref:"file",staticStyle:{display:"none"},attrs:{id:"media-file-upload",type:"file","data-cy":"file-input"},on:{input:e.manualAddFile}}),n("input",{ref:"subtitle",staticStyle:{display:"none"},attrs:{type:"file",accept:".srt,.vtt"},on:{input:e.manualAddSubtitle}}),n("div",{attrs:{id:"video-container",lang:e.lang}},[n("video",{ref:"video",staticClass:"video-js vjs-default-skin vjs-16-9 vjs-big-play-centered vjs-fluid",staticStyle:{height:"100%"},attrs:{crossorigin:"anonymous",id:"my-video"}})]),n("audio-info",{attrs:{show:e.isAudio}}),n("video-splash",{attrs:{show:e.showSplash,videoLoadingHint:e.videoLoadingHint}}),n("advanced-options",{attrs:{show:e.showAdvancedOptions,advancedOptions:e.advancedOpt},on:{close:function(){return e.toggleAdvancedOptions(!1)}}})],1)},d=[],u=n("5653"),h=u["a"],p=(n("803a"),n("2b5f")),m=n("9b72"),_=n("f106"),f=n("09a4"),g=n.n(f),b=Object(p["a"])(h,c,d,!1,null,null,null);b.exports;g()(b,"components",{QPage:m["a"],QIcon:_["a"]});var y=n("6422");const v=()=>{const e=l["default"].getAllPlayers();return Array.isArray(e)?e[0]:null},w=()=>{const e=()=>(o["wtClient"].torrents[0]&&o["wtClient"].torrents[0].files&&o["wtClient"].torrents[0].files.forEach((e=>{e._serviceWorker&&"activated"===e._serviceWorker.state||(e._serviceWorker=o["wtClient"].serviceWorker)})),!0);if(o["wtClient"].serviceWorker&&"activated"===o["wtClient"].serviceWorker.state){if("activated"===o["wtClient"].serviceWorker.state)return e();o["wtClient"].serviceWorker=null}if(!navigator.serviceWorker||!navigator.serviceWorker.controller)return!1;const t=navigator.serviceWorker.controller;return"activated"===t.state&&(o["wtClient"].loadWorker(t),e())};let k=null;function C(e){if("string"===typeof e&&e.startsWith("/webtorrent/")&&(e=e.replace("/webtorrent/","")),u["b"].toggleSplash(!1),!w())return void a["a"].create(i["b"].t("service_worker_error"));if(!o["wtClient"].torrents[0])return void a["a"].create(i["b"].t("add_task_first"));let t=!1;const n=Date.now();Object(s["b"])().push({name:"Player",params:{action:{type:"play_remote"}}}),k&&clearInterval(k),u["b"].toggleSplash(!0,i["b"].t("loading")),k=setInterval((async()=>{if(t)return;if(Date.now()-n>3e4&&!o["wtClient"].torrents[0].ready)return u["b"].toggleSplash(!1),a["a"].create(i["b"].t("player_task_time")),void clearInterval(k);if(o["wtClient"].torrents[0]&&!o["wtClient"].torrents[0].files[0])return void u["b"].toggleSplash(!0,i["b"].t("loading"));{const e=o["wtClient"].torrents[0].files[0],t=Object(y["a"])(e.downloaded||0),n=Object(y["a"])(e.length||0),a=`(${t}/${n})`;if(u["b"].toggleSplash(!0,i["b"].t("downloading")+"... "+a),o["wtClient"].torrents[0].pieces[e._startPiece]||o["wtClient"].torrents[0].pieces[e._startPiece+1])return void console.log("Wait for first two pieces downloaded")}const s=document.querySelector("#my-video video");if(!s)return;try{const n=v();if(e||(e=o["wtClient"].torrents[0].files[0].path),4===n.readyState()){const t=`${location.origin}/webtorrent/${o["wtClient"].torrents[0].infoHash}/${encodeURI(e)}`;if(console.log(t,n.src(),t===n.src()),n.src()!==t)throw n.hasStarted(!1),new Error("Reset since src changed");return console.log(n.readyState(),"ready"),n.setAttribute("muted",!0),n.setAttribute("playsInline",!0),n.setAttribute("autoplay",!1),u["b"].toggleSplash(!1),void clearInterval(k)}if(t)return}catch(c){console.log("cannot get vjs",c)}if(t)return;const l=o["wtClient"].torrents[0].files.find((t=>e===t.path));if(s.setAttribute("playsInline",!0),s.setAttribute("muted",!0),s.setAttribute("autoplay",!1),l){console.log("Play file",e,l);const t=`${location.origin}/webtorrent/${o["wtClient"].torrents[0].infoHash}/${encodeURI(l.path||l.name)}`;r["a"].commit("CURRENT_VIDEO_URL_MUTATION",t),r["a"].commit("UPDATE_VIDEO_UPDATE_PLAYER_MUTATION",!0),setTimeout((()=>{const e=v();e&&4===e.readyState()&&e.paused()&&a["a"].create(i["b"].t("autoplay_hint"))}),3e3)}else{const e=o["wtClient"].torrents[0].files[0];console.log("Cannot find same file. Use files[0]",e.path);const t=`${location.origin}/webtorrent/${o["wtClient"].torrents[0].infoHash}/${encodeURI(e.path||e.name)}`;r["a"].commit("CURRENT_VIDEO_URL_MUTATION",t),r["a"].commit("UPDATE_VIDEO_UPDATE_PLAYER_MUTATION",!0),setTimeout((()=>{const e=v();e&&4===e.readyState()&&e.paused()&&a["a"].create(i["b"].t("autoplay_hint"))}),3e3)}u["b"].toggleSplash(!1),t=!0}),1e3)}},8:function(e,t){},"803a":function(e,t,n){"use strict";n("525c")},8097:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n("3fd2"),a=n.n(o),s=n("0f0c"),i=n("d558");function r(){if(Object(i["a"])())return!0;const e=Object(s["a"])("packageFormat");return a.a.mas()||a.a.windowsStore()||e&&"snap"===e}},"80cf":function(e,t,n){"use strict";var o=n("eb7a"),a=n("d7df"),s=n("5584"),i=n("1926"),r=n("61a1"),l=n("8750"),c=n("f680"),d=n("3d18");console.log("utils io CLIENT"),console.log("-utils io CLIENT"),a["a"].on("warning",(e=>{c["a"].create({message:e})})),a["a"].on("client_error",(e=>{c["a"].create({message:e})})),a["a"].on("request_unlimit_upload",(()=>{const e=Object(r["b"])();e&&"/settings"!==e.currentRoute.path&&"/advancedSettings"!==e.currentRoute.path&&l["a"].create({title:i["b"].t("upload_too_many_files"),message:i["b"].t("ask_if_unlimit_upload_amount"),ok:i["b"].t("disable_limitation"),cancel:i["b"].t("not_now")}).onOk((()=>{a["a"].emit("unlimit_upload_amount")}))})),a["a"].on("torrent_error",(({token:e,message:t})=>{const n=Object(r["b"])();n&&"/"===n.currentRoute.path&&c["a"].create({message:i["b"].t("torrent_error"),caption:[i["b"].t(t),e].join("\n"),multiLine:!0,timeout:0,closeBtn:i["b"].t("close")})})),a["a"].on("torrent_seed_error",((e,t)=>{e.missFile&&(console.log(e,t),l["a"].create({title:i["b"].t("miss_file"),message:i["b"].t("delete_miss_file_task",[e.name]),ok:i["b"].t("delete_task"),cancel:i["b"].t("cancel")}).onOk((()=>{a["a"].emit("delete_torrent",e.infoHash)})))})),a["a"].on("delete-files-failed",((e,t)=>{console.log("delete failed",e,t),l["a"].create({title:i["b"].t("failed_to_delete_files"),message:i["b"].t("failed_to_delete_files")})})),a["a"].on("autoupload-start",(()=>{s["a"].commit("DOWNLOADER_SET_UPLOADING_LOADING",!0)})),a["a"].on("autoupload-complete",(()=>{s["a"].commit("DOWNLOADER_SET_UPLOADING_LOADING",!1)})),a["a"].on("torrent_exists",(e=>(console.log("exist",e),c["a"].create(i["b"].t("torrent_exists")+e)))),a["a"].on("stop-server",(()=>{s["a"].dispatch("resetRemotePlay"),s["a"].state.video.currentVideo.shouldReset=!0})),a["a"].on("open-default-player",(async e=>{s["a"].dispatch("resetRemotePlay"),s["a"].dispatch("resetInfoHash"),s["a"].dispatch("currentVideoUrl",""),s["a"].dispatch("currentVideoPath",""),console.log("open-default-player:"+e);const t=o["default"].getPlayer("my-video"),n=s["a"].state.video.currentVideo.pipStatus;if(t&&n)try{console.log("跳转默认播放器,关闭画中画"),t.exitPictureInPicture()}catch(r){}const a=await Object(d["b"])(s["a"].getters.settings.defaultVideoPlayer,e);!0!==a&&""!==a&&c["a"].create(i["b"].t("open_default_player_failed"))})),a["a"].on("jump-to-player",(()=>{const e=Object(r["b"])();e&&e.push({name:"Player",params:{action:{type:"play_remote"}}})})),a["a"].on("finish_all_payments_by_infohash",(e=>{if("string"!==typeof e)return console.log(`No info hash to finish ${e}`);const t=s["a"].getters.accountUserInfo.sub;if(!t)return console.log(`Cannot find sub id from ${s["a"].getters.accountUserInfo}`);const n=s["a"].state.credits.expensesTransactions.filter((n=>n.payerId===t&&"FINISH"!==n.status&&n.meta.includes(e)));console.log("Will finish",n),a["a"].emit("finish_all_payments",n)}))},"80f4":function(e,t,n){},8162:function(e,t,n){},"81a4":function(e,t,n){},"81e0":function(e,t,n){n("7a76"),n("0c26"),n("de6c");const o=e=>{const t=`Failed to validate app config: ${e}`,n=new Error(t);throw n.stack=n.stack.trim().split("\n")[0],n},a=["application.manifest","application.reference","batfile","blob","cerfile","chm.file","cmdfile","comfile","cplfile","dllfile","drvfile","exefile","explorer.assocactionid.burnselection","explorer.assocactionid.closesession","explorer.assocactionid.erasedisc","explorer.assocactionid.zipselection","explorer.assocprotocol.search-ms","explorer.burnselection","explorer.closesession","explorer.erasedisc","explorer.zipselection","file","fonfile","hlpfile","htafile","inffile","insfile","internetshortcut","jsefile","lnkfile","microsoft.powershellscript .1","ms-accountpictureprovider","ms-appdata","ms-appx","ms-autoplay","msi.package","msi.patch","ms-windows-store","ocxfile","piffile","regfile","scrfile","scriptletfile","shbfile","shcmdfile","shsfile","smb","sysfile","ttffile","unknown","usertileprovider","vbefile","vbsfile","windows.gadget","wsffile","wsfile","wshfile"];e.exports=function(e){e&&"object"===typeof e||o("config is not an object");for(const t of["name","displayName","author","developer","description","publisher","homepage","upgradeCode","protocol","shortProtocol"])t in e&&"string"===typeof e[t]||o(`config.${t} must be string`);e.name.match(/^[a-zA-Z0-9.\-+]{3,}/)||o("config.name should contain at least 3 characters"),e.protocol.match(/^[a-z][a-z0-9.\-+]{2,}/)||o("config.protocol should contain at least 3 characters, start with lower-case letter(a-z) and not include upper-case letters"),a.includes(e.protocol)&&o(`The protocol "${e.protocol}" is not available since it is reserved by Windows Store`),e.shortProtocol.match(/^[a-z][a-z0-9.\-+]{1,}/)||o("config.shortProtocol should contain at least 2 characters, start with lower-case letter(a-z) and not include upper-case letters"),a.includes(e.shortProtocol)&&o(`The protocol "${e.shortProtocol}" is not available since it is reserved by Windows Store`),e.name.toLowerCase()===e.shortProtocol&&o("config.shortProtocol should not be same as config.name"),e.protocol===e.shortProtocol&&o("config.shortProtocol should not be same as config.protocol"),e.protocol===e.shortProtocol&&o("config.shortProtocol should not be same as app name"),e.register&&"object"===typeof e.register||o("config.register should be object"),"whitelist"===e.register.mode&&(Array.isArray(e.register.list)&&0!==e.register.list.length||o('config.register.list should be array with at least one country code since register mode is "whitelist"'))}},8306:function(e,t,n){},8460:function(e,t,n){"use strict";n("91fe")},"848e":function(e,t,n){},"84cb":function(e,t,n){"use strict";n("afe1")},"84f6":function(e,t,n){"use strict";n("de6c"),n("a1c1");var o=n("ff9b"),a=n("d7df"),s=n("5584"),i=n("8750"),r=n("1926"),l=n("0885"),c=n("a11f"),d=n("4fd2");const u=e=>new Promise((t=>{const n=window.requestIdleCallback?window.requestIdleCallback:e=>setTimeout(e,100);n((()=>{t(e())}))})),h=new o["a"]({data(){return{taskList:{downloading:[],uploading:[],downloaded:[],totalDownloadSpeed:0,totalUploadSpeed:0,totalDownloadProgress:0},updatingTaskList:!1,lastUpdateTime:Date.now()}},computed:{allTasks(){return[...this.taskList.downloading,...this.taskList.uploading,...this.taskList.downloaded]}},methods:{async updateTaskList(e){if(this.updatingTaskList)console.log("Skip updating task list since busy");else{this.updatingTaskList=!0,await this.$nextTick();const t={},n=[],o={};for(const a in e){const s=e[a];if(!Array.isArray(s)){this.taskList[a]=s;continue}await u((()=>{s.forEach((e=>{Array.isArray(e.files)&&e.files.forEach((e=>{e.path.endsWith(".downloading")&&(e.path=e.path.replace(/\.downloading$/,"")),e.name.endsWith(".downloading")&&(e.name=e.name.replace(/\.downloading$/,""))}))})),this.taskList[a]=s})),t[a]=s.length;const i=[];s.forEach((e=>{"uploading"===a&&n.push({title:e.postTitle||e.name,abUrl:e.alphabizURI});const t={};if(e.infoHash){var o;t.start=(new Date).getTime(),t.getABKey=(new Date).getTime();const n=Object(c["a"])(e.alphabizURI||e.magnetURI||e.infoHash);t.playFile=(new Date).getTime();const a=null===(o=e.files)||void 0===o?void 0:o.find((e=>1===e.progress&&Object(d["a"])(e.path)));i.push({key:n,infoHash:e.infoHash,...a?{playFile:a}:{}}),t.end=(new Date).getTime()}})),o[a]=i}Object.freeze(e),s["a"].commit("updateTasks",{tasksCount:t,uploadingTasks:n,abKeyObj:o}),await this.$nextTick(),this.updatingTaskList=!1}},deleteTask(e){const t=[];return s["a"].getters.settings.defaultDeleteFiles&&t.push("deleteFiles"),console.log("to del",e),new Promise((n=>{if(e.isAutoUpload)return i["a"].create({title:r["b"].t("delete")+" "+(e.postTitle||e.name),message:r["b"].t("delete_autoupload_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:r["b"].t("delete_anyway")},cancel:{textColor:"grey",color:"unset",flat:!0,label:r["b"].t("not_now")}}).onOk((()=>{console.log("Delete autoupload file",e),a["a"].emit("delete_torrent",e.infoHash,!0),n(!0)})).onCancel((()=>{n(!1)}));if(e.missAllFile)return a["a"].emit("delete_torrent",e.infoHash,!0),n(!0);const o=e.postTitle||e.name||e.origin||e.infoHash||"",c=o.length>20?o.substring(0,18)+"...":o;i["a"].create({title:r["b"].t("delete")+" "+c,style:"white-space:pre-wrap;word-break:break-all",message:r["b"].t("delete_confirm_message"),options:{type:"checkbox",model:t,items:[{label:r["b"].t("also_delete_files"),value:"deleteFiles"}]},ok:{textColor:"red",color:"unset",flat:!0,label:r["b"].t("delete")},cancel:{textColor:"grey",color:"unset",flat:!0,label:r["b"].t("not_now")}}).onOk((t=>{a["a"].emit("delete_torrent",e.infoHash||e.token,t.includes("deleteFiles")),s["a"].dispatch("set",{defaultDeleteFiles:t.includes("deleteFiles")}),Object(l["c"])(e.infoHash,!1),n(!0)})).onCancel((()=>{n(!1)}))}))},onDeleteTask(e){for(const t in this.taskList){const n=h[t];if(!Array.isArray(n))continue;const o=n.findIndex((t=>t.infoHash===e));-1!==o&&n.splice(o,1)}}}});t["a"]=h},"860f":function(e,t,n){"use strict";n("4544")},"86d7":function(e,t,n){"use strict";n("6545")},"878c":function(e,t,n){"use strict";n("9e9b")},"88f5":function(e,t,n){"use strict";n("0f74")},"899b5":function(e,t,n){"use strict";n("81a4")},"89d2":function(e,t,n){"use strict";n("95db")},"8a63":function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"f",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return _})),n.d(t,"e",(function(){return f})),n.d(t,"g",(function(){return g})),n.d(t,"h",(function(){return b})),n.d(t,"a",(function(){return y}));n("a1c1"),n("7a76");var o=n("d7df"),a=n("5584"),s=n("1926"),i=n("8750"),r=n("f680"),l=n("84f6"),c=n("d310"),d=n("d558");setTimeout((()=>{o["a"].on("torrent_list",(e=>{l["a"].updateTaskList(e)})),o["a"].on("torrent_delete",(e=>{console.log("deleted",e),l["a"].onDeleteTask(e)})),o["a"].on("torrent_error",(e=>{console.log("torrent error",e);const t=e.torrent||{},n=t.postTitle||t.name||t.infoHash||e.token;r["a"].create({message:s["b"].t("torrent_error")+" "+n,caption:s["b"].t(e.message),group:e.message})}))}),1e3);const u=()=>{const e=a["a"].getters.settings;return{downloadDirectory:e.downloadDirectory,uploadSpeed:e.uploadSpeed,downloadSpeed:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,payedUserShareRadix:e.payedUserShareRadix,trackers:e.trackerList||[],saveLinkSeed:e.saveLinkSeed,defaultVideoPlayer:e.defaultVideoPlayer}};function h(e,t){const n="string"===typeof t?t:(null===t||void 0===t?void 0:t.path)||(null===t||void 0===t?void 0:t[0].path);if(!n)return;let a=0;const s=n.startsWith("ab://")?n.replace(/^ab:\/\//,(()=>"alphabiz://alphabiz-task-"+a++)):n;o["a"].emit("download_torrent",{type:e,url:s,file:s,token:crypto.randomUUID(),...u()})}function p(e,t){console.log("pause torrent",e);const n=l["a"].taskList.downloaded.find((t=>t.infoHash===e));if(!n)return o["a"].emit("pause_torrent",e);const a=e=>{var n,o;const a=t.dp$expenseHashMapper[e];if(!a)return;const s=null===(n=t.dp$expenseStatusMapper.PENDING)||void 0===n?void 0:n.filter((e=>a.includes(e))),i=null===(o=t.dp$expenseStatusMapper.COMPLETED)||void 0===o?void 0:o.filter((e=>a.includes(e)));s&&s.forEach((e=>{console.log("dp$cancel from pauseTorrent",e),t.dp$cancel(e).catch((t=>{console.log("dp$cancel failed:",e,t.code,t.message)}))})),i&&i.forEach((e=>{console.log("dp$confirm from pauseTorrent",e),t.dp$confirm(e)}))};return i["a"].create({title:s["b"].t("pause"),message:s["b"].t("pause_all_finish_payments"),ok:{textColor:"red",color:"unset",flat:!0,label:s["b"].t("pause")},cancel:{textColor:"grey",color:"unset",flat:!0,label:s["b"].t("cancel")}}).onOk((()=>{try{a(e)}catch(t){console.log("dp$pause failed:",t.message)}o["a"].emit("pause_torrent",e)}))}function m(e=!1){if(e&&!a["a"].getters.settings.autoStartUnfinished&&!Object(d["a"])())return console.log("Skip auto download all");const t=l["a"].taskList.downloading.filter((t=>(!e||!t.pausedByUser)&&t.paused)).sort(((e,t)=>{const n=e.createdTime-t.createdTime;return isNaN(n)?0:n}));return console.log("[DownloadAll] resume",t),o["a"].emit("resume-all",t),new Promise((e=>{o["a"].once("resume-all",e)}))}function _(e=!1){o["a"].emit("pause_all",e),setTimeout((()=>{o["a"].emit("pause_all",e)}))}function f(e=!1){const t=l["a"].taskList.uploading;if(!t.length)return;const n=t.filter((e=>!e.infoHash&&!e.isPreload&&!e.files));if(n.length)return e&&(n.forEach((e=>{o["a"].emit("delete_torrent",e.token,!1)})),setTimeout((()=>o["a"].emit("pause_all_uploading",e)),1e3)),i["a"].create({message:s["b"].t("some_task_not_ready"),ok:{textColor:"red",color:"unset",flat:!0,label:s["b"].t("remove")},cancel:{textColor:"grey",color:"unset",flat:!0,label:s["b"].t("cancel")}}).onOk((()=>{n.forEach((e=>{e.infoHash||o["a"].emit("delete_torrent",e.token,!1)})),setTimeout((()=>o["a"].emit("pause_all_uploading",e)),1e3)}));o["a"].emit("pause_all_uploading",e)}function g(e,t){const n=Array.isArray(e)?e:[e],a=n.map((e=>e?"string"===typeof e?e:"string"===typeof e.path?e.path:null:null)).filter((e=>e));if(!a.length&&Object(c["isElectron"])())throw new Error(`Cannot upload file ${e}: cannot get file path`);o["a"].emit("seed_torrent",{file:a,token:t||crypto.randomUUID(),...u()})}function b(e=!1){if(!l["a"].taskList.downloaded)return 0;const t=l["a"].taskList.downloaded.filter((t=>(!e||!t.pausedByUser)&&(!t.missAllFile&&!t.missFile)));if(!t.length)return console.log("skip upload all since nothing to upload"),l["a"].taskList.downloaded.length;const n=l["a"].taskList.downloaded.length-t.length;return o["a"].emit("seed_torrents",t),n}async function y(){a["a"].getters.settings.autoStartUnfinished?"signedIn"===a["a"].state.account.authState?(console.log("prepare download all"),await m(!0),b(!0)):console.log("User is not logged in",a["a"].getters.accountUserInfo.authState):console.log("User disabled auto restart")}},"8dc9":function(e,t,n){},"8f79":function(e,t,n){},"8fd4":function(e,t,n){},9:function(e,t){},"91fe":function(e,t,n){},9344:function(e,t,n){"use strict";n("1278")},9369:function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return c}));n("7a76"),n("de6c"),n("f200");var o=n("5584"),a=n("36a1"),s=n("072b");function i(e){return!!e||this.$t("account_is_required")}function r(e){return s["d"].call(this,e)}function l(e){return this.$alphabiz.dialog({progress:null===e||void 0===e||e,ok:!1})}async function c(e,t={}){const{mode:n,password:a,keyName:s}=t,i=await o["a"].dispatch("syncKeychainState");i[s]?await o["a"].dispatch("updateKeychainCloud",{keyName:s,mode:n,password:a,keyObj:e}):await o["a"].dispatch("createKeychainCloud",{keyName:s,mode:n,password:a,keyObj:e}),await o["a"].dispatch("syncKeychainState")}async function d(e,t){const n=async()=>{var e;if(!a["a"].user||null===(e=a["a"].user._)||void 0===e||!e.sea)throw new Error("current_lib_key_does_not_exist");const t=a["a"].user._.sea;if(["epriv","epub","priv","pub"].some((e=>!t[e])))throw new Error("invalid_key");return t},s={lib:await n()},i=Object.keys(s).map((n=>c.call(this,s[n],{mode:e,password:t,keyName:n})));await Promise.all(i),await o["a"].dispatch("syncKeychainState")}t["b"]={beforeCreate(){if(!["StatusBanner","ChangePassword"].includes(this.$options.name))throw new Error(`Unsupported Component: ${this.$options.name}`)},methods:{async keychain$changePassword(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=async e=>{const t={oldPassword:{type:"password",model:"",label:this.$t("account_current_password"),rules:[i.bind(this),r.bind(this)]},password:{type:"password",model:"",label:this.$t("account_new_password"),rules:[i.bind(this),r.bind(this),e=>t.oldPassword.model!==e||this.$t("invalid_password_format_same")]},reEnterPassword:{type:"password",model:"",label:this.$t("account_re_enter_password"),rules:[e=>t.password.model===e||this.$t("account_password_not_equal")]}},n=this.$alphabiz.dialog({title:this.$t("change_password"),message:o["a"].getters.keychainState.unset?this.$t("independent_password_not_enabled"):void 0,cancel:!0,prompts:t,ok:t=>t.dialog$useLoadingState("ok",(async()=>{const{prompts:n}=t.dialog$arguments();await e(t,n.oldPassword,n.password)}))});await n.promise()};await n((async(n,a,s)=>{try{await o["a"].dispatch("changeKeychainPassword",{oldPassword:a,password:s}),await o["a"].dispatch("syncKeychainState"),t(),n.hide()}catch(i){e(i.message)}}))},async keychain$enableCloudStorage(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=()=>{try{var t;if(!a["a"].user||null===(t=a["a"].user._)||void 0===t||!t.sea)throw new Error("Please login first")}catch(n){e(n.message)}};n();const s=l.call(this,this.$t("loading_keychain_state")),c=await o["a"].dispatch("syncKeychainState").finally(s.hide),u=async e=>{const t={password:{type:"password",label:this.$t("account_password"),model:"",rules:[i.bind(this),r.bind(this)]},reEnterPassword:{type:"password",model:"",label:this.$t("account_re_enter_password"),rules:[e=>t.password.model===e||this.$t("account_password_not_equal")]}},n=this.$alphabiz.dialog({title:this.$t("input_independent_password"),prompts:t,cancel:!0,ok:t=>t.dialog$useLoadingState("ok",(()=>e(t,t.dialog$arguments().prompts.password)))});await n.promise()};if(c.hash&&c.unset){const n=async e=>{const t={};t.use_cognito_hash={color:"primary",textColor:"primary",label:this.$t("use_cognito_hash"),handler:t=>t.dialog$useLoadingState("use_cognito_hash",(()=>e(t,"cognito_hash")))},t.use_independent_password={label:this.$t("use_independent_password"),handler:t=>t.dialog$useLoadingState("use_independent_password",(()=>e(t,"independent_password")))};const n=this.$alphabiz.dialog({title:this.$t("enable_cloud_storage"),message:this.$t("enable_cloud_storage_prompt_password"),cancel:!0,ok:!1,actions:t});await n.promise()};await n((async(n,o)=>{if("independent_password"===o)await u((async(a,s)=>{try{await d.call(this,o,s),t(),a.hide(),n.hide()}catch(i){e(i.message)}}));else if("cognito_hash"===o)try{await d.call(this,o,void 0),t(),n.hide()}catch(a){e(a.message)}}))}else await u((async(n,o)=>{try{await d.call(this,"independent_password",o),t(),n.hide()}catch(a){e(a.message)}}))},async keychain$disableCloudStorage(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=async e=>{let t=5;const n=()=>({label:t?`${this.$t("disable_cloud_storage")} (${t})`:this.$t("disable_cloud_storage"),disable:!!t,color:"negative",textColor:"negative",handler:t=>t.dialog$useLoadingState("ok",e)}),o=this.$alphabiz.dialog({title:this.$t("disable_cloud_storage"),message:this.$t("disable_cloud_storage_desc"),cancel:!0,ok:n()}),a=setInterval((()=>{t>0?t-=1:clearInterval(a),o.update({ok:n()})}),1e3);await o.promise()};await n((async n=>{try{await new Promise((e=>setTimeout(e,1e3))),await o["a"].dispatch("disableKeychainCloud"),await o["a"].dispatch("syncKeychainState"),t(),n.hide()}catch(a){e(a.message)}}))}}}},"937c":function(e,t){e.exports={remote:{url:"https://alpha.biz/app/remote_config"},local:{type:"local",version:"default:v1",oauth:{enable:!1,providers:["Github","Twitter"]},library:{show_explore:!1},update:{enable:!1}}}},"93e8":function(e,t,n){"use strict";n("981d")},9445:function(e){e.exports=JSON.parse('{"users":[{"_comment":"You should use pubkey as id here. See take-down.js for more info.","id":"a_pubkey_of_user","reason":"Serious Violation"}],"channels":[{"id":"an_id_of_channel","reason":"Copyright Disputes"}],"posts":[{"id":"an_id_of_post","reason":"Adults Only"}]}')},9572:function(e,t,n){"use strict";(function(e){n("7a76"),n("d4b5"),n("de6c");var o=n("02fe"),a=n.n(o);const s=({encryptor:t,decryptor:n,randomHex:o,pbkdf2:a})=>{const s=e=>{if(64!==e.length)throw new Error("Invalid password length")},i=(n,o)=>{const s=a(o.password,o.salt,1e3,32);return t(n,s,e.from(o.iv,"hex"))},r=(t,o)=>{const s=a(o.password,o.salt,1e3,32);return n(t,s,e.from(o.iv,"hex"))},l=(e,t)=>{s(t);const n=o(),a=o(),r=i(e,{password:t,iv:n,salt:a});return JSON.stringify({encrypted:r,salt:a,iv:n})},c=(e,t)=>{s(t);const n=JSON.parse(e),o=r(n.encrypted,{password:t,salt:n.salt,iv:n.iv});if(!o)throw new Error("password_error");return o},d=(e,t,n)=>{s(t),s(n);const o=c(e,t);return l(o,n)};return{encryptKey:l,decryptKey:c,changePassword:d}},i=s({encryptor:(e,t,n)=>{const o=a.a.AES.encrypt(e,a.a.enc.Hex.parse(t.toString("hex")),{iv:a.a.enc.Hex.parse(n.toString("hex")),mode:a.a.mode.CBC,padding:a.a.pad.Pkcs7});return o.ciphertext.toString()},decryptor:(e,t,n)=>{try{const o=a.a.AES.decrypt(a.a.enc.Base64.stringify(a.a.enc.Hex.parse(e)),a.a.enc.Hex.parse(t.toString("hex")),{iv:a.a.enc.Hex.parse(n.toString("hex")),mode:a.a.mode.CBC,padding:a.a.pad.Pkcs7});return a.a.enc.Utf8.stringify(o)}catch(o){return console.error(o.message),null}},pbkdf2:(e,t,n,o)=>a.a.enc.Hex.stringify(a.a.PBKDF2(e,t,{hasher:a.a.algo.SHA512,keySize:2*o/8,iterations:n})),randomHex:()=>a.a.enc.Hex.stringify(a.a.lib.WordArray.random(16))}),r=e=>a.a.SHA256(e).toString();t["a"]={encryptLibKeyObj:async(e,t)=>{if(!t||"string"!==typeof t)throw new Error("invalid_password");if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");const{epub:n,pub:o,epriv:a,priv:s}=e,l=[n,o,a,s].join(":");return i.encryptKey(l,r(t))},decryptLibKeyObj:async(e,t)=>{if(!t||"string"!==typeof t)throw new Error("invalid_password");const n=i.decryptKey(e,r(t)),[o,a,s,l]=n.split(":"),c={epub:o,pub:a,epriv:s,priv:l};if(["epriv","epub","priv","pub"].some((e=>!c[e])))throw new Error("invalid_key");return c},changePassword:async(e,t,n)=>{if(!t||"string"!==typeof t)throw new Error("invalid_password");if(!n||"string"!==typeof n)throw new Error("invalid_password");return i.changePassword(e,r(t),r(n))},digestPassword:e=>{if(!e||"string"!==typeof e)throw new Error("invalid_password");return r(e)}}}).call(this,n("eb72").Buffer)},"95db":function(e,t,n){},"981d":function(e,t,n){},9856:function(e,t,n){"use strict";(function(e,o){n("de6c"),n("dc89"),n("2425"),n("a1c1"),n("1af1");var a=n("025c"),s=n("4fd2"),i=n("d7df"),r=n("6422"),l=n("0f0c"),c=n("07e8"),d=n("ce6c"),u=n("5584"),h=n("c62a6"),p=n("36a1"),m=(n("80cf"),n("f039")),_=n("8a63"),f=n("0885"),g=n("09e8"),b=n("84f6"),y=n("feef"),v=n("61af"),w=n.n(v),k=n("9efe"),C=n("a449"),$=n("c5a5"),S=n("d710"),x=n.n(S),T=(n("a749"),n("b71d")),I=n("9f21"),P=n("2e22");console.log("import io CLIENT"),console.log("-import io CLIENT");const{displayName:O,protocol:q,shortProtocol:E}=x.a,A=n("d310").isElectron();A||console.warn("Warning: Torrent downloader is not impl in browser mode now");const D=()=>{const t=async function(t){console.log("[mixinBlockchainUrl] on paste",t,t.clipboardData.getData("text"));const n=t.clipboardData.getData("text");if(![q,E].some((e=>n.startsWith(e))))return;t.preventDefault();const o=await Object($["a"])(n);o.startsWith("ab-blockchain:")&&e.handleAbBlockchain({url:o})};let n;return{mounted(){n=t.bind(this),document.body.addEventListener("paste",n)},beforeDestroy(){document.body.removeEventListener("paste",n)}}},N={mixins:[I["a"]],created(){this.$amplify.addOnAuthStateChangedListener((()=>{const e=Object(l["a"])("version");o.env.JEST_TEST||-1===e.indexOf("dev")&&"Alphabiz"===O&&(e.includes("internal")||e.includes("nightly"))&&setTimeout(this.showInternalNotice.bind(this),100)}),{once:!0})}};let L=null;t["a"]={name:"App",provide(){return{rootApp:this,io:i["a"],lib:p["a"],autoRenew:this.autoRenew,path:this.path,taskQueue:this.taskQueue,dp$source:this.dp$source}},components:{GlobalRecommend:T["a"],AboutDialog:a["a"],TaskDialog:y["a"],ApplicationBar:d["a"]},mixins:[g["a"],C["b"],D(),N],data(){return{isElectron:A,isTestEnv:!1,path:"/library",settings:null,taskQueue:[]}},computed:{shouldQueueTask(){return!!u["a"].getters.settings.forceLogin&&(!u["a"].getters.accountUserInfo||!u["a"].getters.accountUserInfo.sub)},downloadingTorrents(){return b["a"].taskList.downloading}},methods:{async resolveQueue(){if(0===this.taskQueue.length)return;const e=[],t=[],n=[];let o=null;while(this.taskQueue.length){const a=this.taskQueue.shift();switch(a.type){case"download":a.file.startsWith("file://")?n.push(a.file):t.push(a.file);break;case"upload":e.push(a.files);break;case"uploadOrPlay":o=a.file;break}}console.log(e,t,n,o);for(const a of[...new Set(e)])await this.promptUpload(a);t.length&&await this.promptDownload([...new Set(t)].join("\n")),n.length&&await this.promptDownload([...new Set(n)].join("\n")),o&&this.promptUploadOrPlay(o)},promptDownload(e,t=!1){if(console.log(e,t),!A)return;const n=e.startsWith("magnet")||e.startsWith(q)||e.startsWith(E)||e.startsWith("file://")?e:"file://"+e;if(e.startsWith("file://")&&!w.a.existsSync(e))return;if(this.shouldQueueTask)return console.log("queue download",e,t),void this.taskQueue.push({type:"download",file:n,isMagnet:t});let o=null;const a=new Promise((e=>{o=e})),s=new DataTransfer;s.setData("text/plain",n);const i=new ClipboardEvent("paste",{clipboardData:s});return console.log("dispatch paste event"),i._ab_payload_=n,i._is_magnet_=t,i._onClose=o,console.log("dispatch event"),document.body.dispatchEvent(i),a},promptUpload(e){if(this.shouldQueueTask)return console.log("queue upload",e),void this.taskQueue.push({type:"upload",files:e});let t=null;const o=new Promise((e=>{t=e}));if(console.log("upload",e),!A){const a=()=>{i["a"].emit("wt-add",e[0]),t&&t()},s=n("c620").wtClient;return s.torrents.length?this.$q.dialog({message:this.$t("remove_old_task_desc"),ok:this.$t("remove_old_task"),cancel:this.$t("cancel")}).onOk((()=>{s.torrents[0]?(s.torrents[0].destroy(),s.torrents.splice(0),a()):a()})).onCancel(t):this.$q.dialog({message:this.$t("upload_torrent"),ok:this.$t("upload")}).onOk(a).onCancel(t),o}const a=e.map((e=>e.path||e)),s=a.map((e=>`
${e}
`)).join(""),r={html:!0,style:"white-space:pre-wrap;word-break:break-all",title:this.$t("upload"),message:this.$t("ask_if_upload_file")+"
"+s,ok:this.$t("upload"),cancel:this.$t("cancel")};return a.length>1&&(r.options={type:"radio",model:"single",items:[{label:this.$t("upload_as_single_files"),value:"single"},{label:this.$t("upload_as_one_directory"),value:"directory"}]}),this.$q.dialog(r).onOk((e=>{if(console.log("upload files",e,a),"single"===e)return a.forEach((e=>{i["a"].emit("seed_torrent",{file:[e],token:e,settings:{...this.settings},trackers:u["a"].getters.settings.trackerList||[]})})),void(t&&t());const n=1===a.length?a[0]:"";i["a"].emit("seed_torrent",{file:a,token:n,settings:{...this.settings},trackers:u["a"].getters.settings.trackerList||[]}),t&&t()})).onCancel((()=>{t&&t()})),o},promptUploadOrPlay(e){if(this.shouldQueueTask)return console.log("queue uploadOrPlay",e),void this.taskQueue.push({type:"uploadOrPlay",file:e});console.log(e),this.$q.dialog({title:this.$t("upload_or_play"),message:this.$t("ask_if_upload_or_play"),options:{type:"checkbox",model:[],items:[{label:this.$t("play"),value:"play"},{label:this.$t("upload"),value:"upload"}]},ok:this.$t("ok"),cancel:this.$t("cancel")}).onOk((t=>{if(t&&(t.includes("upload")&&i["a"].emit("seed_torrent",{file:[e.path||e],token:Math.random().toString().substring(2),settings:{...this.settings},trackers:u["a"].getters.settings.trackerList||[]}),t.includes("play"))){const t={};if("string"===typeof e){const n={src:"play:///"+encodeURI(e)};console.log("play source"),t.action={type:"play_source",source:n}}else console.log("play file"),t.action={type:"play_file",file:e};this.$router.push({name:"Player",query:{rand:Math.random()},params:t})}}))},getPublicVersion(e){return Object(l["a"])(e)},async onDrop(e){const t=e.dataTransfer.getData("text");if(console.log("drop",e,t),!t&&(!e.dataTransfer.files||!e.dataTransfer.files[0]))return;e.preventDefault();const n=[...e.dataTransfer.files];console.log(n);const o=t&&!n.length;if(await Object(m["a"])(e,n,t),A&&n.length){const e=n.some((e=>!w.a.existsSync(null===e||void 0===e?void 0:e.path)));if(e)return this.$q.notify(this.$t("file_not_found"))}if(o)return this.promptDownload(t,!0);if(1===n.length){var a,i,r,l;if(Object(s["a"])((null===(a=n[0])||void 0===a?void 0:a.path)||""))return this.promptUploadOrPlay(n[0]);if(null!==(i=n[0])&&void 0!==i&&null!==(r=i.path)&&void 0!==r&&r.endsWith(".torrent"))return this.promptDownload(null===(l=n[0])||void 0===l?void 0:l.path)}if(n.length>=1){if(!A&&(n.length>1||!n[0].size))return this.$q.dialog({message:this.$t("web_mode_upload_single"),ok:this.$t("ok")});this.promptUpload([...n])}},showDisabled(){const e=this.$q.dialog({persistent:!0,title:this.$t("region_not_available"),message:this.$t("region_not_available_message",[30]),ok:!1,cancel:!1,style:"z-index: 9999"}),t=Date.now();setInterval((()=>{const o=Math.floor((Date.now()-t)/1e3),a=30-o;e.update({persistent:!0,title:this.$t("region_not_available"),message:this.$t("region_not_available_message",[a<0?0:a]),ok:!1,cancel:!1,style:"z-index: 9999"}),a<0&&n("b052").ipcRenderer.send("exit-app")}),1e3)},resolveUnfinishPayments(){clearTimeout(L),L=setTimeout((()=>{const e=JSON.parse(localStorage.getItem("_transactions_missing_payee_")||"[]"),t=u["a"].state.credits.expensesTransactions.filter((t=>"FINISH"!==t.status&&"FAILED"!==t.status&&!e.includes(t.id)));if(!t.length)return console.log("No out-of-date unfinish payments");const n=new Date;n.setDate(n.getDate()-3);const o=t.filter((e=>{const t=new Date(e.createdAt);return t{this.dp$confirm(e.id)}))}),1e4)}},beforeCreate(){if(!this.$route.path.startsWith("/library")){if(new URL(location.href).pathname.startsWith("/oauth_redirect"))return;setTimeout((()=>{console.log(this.$route.path),"/library"!==this.$route.path?this.$router.replace("/library"):console.log("Currently in library page")}),1e3)}if(A){const e=n("b052").ipcRenderer;e.once("redirect-log",((e,t)=>{n.e(11).then(n.bind(null,"44cf")).then((({default:e})=>{console.log("Should redirect to",t),e(t)}))}))}},created(){function t(e){for(const t of e){const e=this.dp$expenseHashMapper[t.infoHash];if(e)for(const t of e){const e=this.dp$expenseTxnDict[t];"PENDING"===e.status?this.dp$cancel(e.id):"COMPLETED"===e.status&&(console.log("dp$confirm from pauseAllDownloading"),this.dp$confirm(e.id))}}}if(k["a"].enable.call(this),Object(f["b"])(this),h["a"].$on("request-sign-out",(()=>{console.log("request sign out");const e=this.$alphabiz.dialog({title:this.$t("account_sign_out"),message:this.$t("account_sign_out_confirm"),ok:this.$t("account_sign_out_anyway"),cancel:this.$t("cancel")}).onOk((async()=>{i["a"].emit("user_logout"),e.hide();const n=this.$q.dialog({progress:!0,message:this.$t("account_signing_out"),persistent:!0,ok:!1});t(u["a"].getters.tasks.downloading),await Object(_["d"])(!0),await Object(_["e"])(!0),n.hide(),h["a"].$emit("confirm-sign-out")}))})),u["a"].dispatch("fetchSettings").then((e=>{e.language&&(this.settings=e,console.log(e.language,this.$route.path),this.$i18n.locale=e.language,c["a"].set({system:"auto",light:!1,dark:!0}[e.darkMode]),i["a"].emit("update_torrent_settings",{uploadLimit:e.uploadSpeed,downloadLimit:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,highLevelRadix:e.payedUserShareRadix,dhtPort:e.DHTlistenPort,torrentPort:e.BTlistenPort}))})),A){(async()=>{console.log("Get client geoip");const t=e["require"]("geoip-country"),n=await fetch("https://api.ipify.org").then((e=>e.text()),(e=>{console.log("Failed to get geo for",e.message)}));if(!n)return;const o=t.lookup(n);if(!o)return console.log("Failed to get geo for",n);const a=o.country,s=x.a;"blacklist"===s.register.mode&&s.register.list.includes(a)?(console.log(a,"is in black list",s.register.list),this.showDisabled()):"whitelist"!==s.register.mode||s.register.list.includes(a)?console.log("Geo",a,s.register.list,"available in mode",s.register.mode):(console.log(a,"is not in white list",s.register.list),this.showDisabled())})(),document.body.style.overflowY="hidden";const t=n("b052").ipcRenderer;t.on("open-file",((e,...t)=>{if(0!==t.length){if(1===t.length){const e=t[0];if(e.endsWith(".torrent")||e.startsWith(q+"://")||e.startsWith("magnet"))return this.promptDownload(e);if(e.startsWith(E+"://"))return this.promptDownload(e,!0);if(Object(s["a"])(e))return this.promptUploadOrPlay(e);if(e.endsWith(".abk"))return this.lib$openABK(e)}return this.promptUpload(t)}})),t.on("ask-for-associate",(()=>{this.$q.notify({message:this.$t("not_default_app"),actions:[{label:this.$t("dont_show_again"),handler:()=>u["a"].dispatch("set",{dontAskForAssociate:!0})},{label:this.$t("go_to_settings"),handler:()=>this.$router.push("/advanceSetting#bind-ports")}]})})),t.on("need-more-space",((e,{need:t,free:n})=>{Object(_["d"])(!0),u["a"].dispatch("set",{libraryPreload:!1}).then((()=>{u["a"].dispatch("fetchSettings")})),this.$q.dialog({title:this.$t("space_not_enough"),message:this.$t("need_more_space",[Object(r["a"])(t),Object(r["a"])(n),Object(r["a"])(u["a"].getters.settings.minDiskSpace)]),ok:this.$t("ok")})})),t.on("main-process-error",((e,t)=>{console.error("Main process throws error:",t.stack)})),i["a"].once("first_launch",(async()=>{const e=Object(l["a"])("version"),t=localStorage.getItem(`first-launch_${x.a.name}`);if(t===e)return console.log("[First Launch Check] Not first launch");await p["a"].whenReady,await P["a"].methods.initFilmRate(),await new Promise((e=>setTimeout(e,5e3))),this.$q.dialog({title:this.$t("set_download"),message:this.$t("set_download_desc"),ok:this.$t("go_to_settings"),cancel:this.$t("not_now")}).onOk((()=>{this.$router.replace("/basicSetting?highlight=download-directory")})).onDismiss((()=>{console.log("Dismiss"),localStorage.setItem(`first-launch_${x.a.name}`,e)}))})),setTimeout((()=>{t.send("main-window-ready")}),2e3)}},mounted(){u["a"].getters.accountUserInfo&&u["a"].getters.accountUserInfo.sub||i["a"].emit("user_logout"),(o&&o.env.TEST_EMAIL_DOMAIN||document.cookie.includes("TestEnv"))&&(this.isTestEnv=!0,A?(n("b052").ipcRenderer.send("enable_devtools"),u["a"].dispatch("fetchSettings")):u["a"].dispatch("set",{disableDevTools:!1}).then((()=>{u["a"].dispatch("fetchSettings")}))),["dragleave","drop","dragenter","dragover"].forEach((e=>{document.getElementById("q-app").addEventListener(e,(e=>{e.preventDefault()}))})),h["a"].$on("update-authstate",(e=>{"signedIn"===e&&(console.log("Signed in. Resolve queue."),this.resolveQueue())})),document.body.addEventListener("drop",this.onDrop)},beforeDestroy(){document.body.removeEventListener("drop",this.onDrop)},watch:{isTestEnv(e){window.isTestEnv=e},"$store.state.credits.expensesTransactions"(){this.resolveUnfinishPayments()},"$store.state.account.authState"(e,t){if("signedOut"!==e||t&&"signedIn"!==t||(this.$route.path.includes("/library")&&(this.$root.$emit("navigate-to"),this.$router.push("/library")),u["a"].getters.settings.forceLogin&&this.$amplify.showSignedOutDialog()),"signedIn"===e){if(console.log('dp$address: io.emit("set_user")',this.dp$address),i["a"].emit("set_user",{user:u["a"].state.account.nickname,sub:this.dp$address}),p["a"].whenReady.then((()=>{console.log("all ready",this.taskQueue)})),u["a"].getters.shouldDisableTasks)return;i["a"].emit("user_login")}},downloadingTorrents(e,t){if("Player"!==this.$route.name&&!this.$route.path.startsWith("/library")&&e.length>t.length){const n=t.map((e=>e.origin||e.infoHash));let o=!1;for(const t of e){const e=t.origin||t.infoHash;if(!n.includes(e)){if(t.fromPost)return;o=!0}}if(o){const e="/downloader?currentTab=downloading";if(this.$router.currentRoute.fullPath===e)return;this.$router.push(e)}}}}}}).call(this,n("0ee4"),n("28d0"))},9910:function(e,t,n){},9992:function(e,t,n){"use strict";n("603c")},"9a08":function(e,t,n){"use strict";t["a"]=["# Terms of Service TESTING","","## 1. Introduction","",'Welcome to Use Alphabiz App (the "App"). The App is operated by Alphabiz Team ("Alphabiz" or "we"). This document – the terms of service – is an agreement between you, the beloved user, and Alphabiz. It\'s referred to as the "Terms" or the "Agreement".',"These Terms govern your use of the App and this App only. The Terms neither relate to any other Alphabiz application, service or property nor your use of any other Alphabiz application, service or property. For example, these Terms don't govern your use of Alphabiz App.","","## 2. Agreement to the Terms","","Terms of service agreements are contracts. That means that this Agreement is a contract between you and Alphabiz for the limited purpose of laying out what our respective rights and obligations are with respect to Alphabiz App.","If there's something in these Terms you don't agree with or don't understand, please don't use the App. By accessing or using the App, you signal your agreement with and consent to the Terms. By accessing or using any Application or Service you also represent that you have the legal authority to accept the Terms on behalf of yourself and any party you represent in connection with your use of any Application or Service.","","Unless otherwise agreed to in writing with Alphabiz, your use of any Application or Service will always be subject to, at a minimum, the terms and conditions set out in this document.","","## 3. DISCLAIMER OF WARRANTIES","","TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, ALPHABIZ OFFERS THE APP ON AN AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE APPLICATIONS OR SERVICES, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. ALPHABIZ DOES NOT WARRANT THAT THE FUNCTIONS OR CONTENT CONTAINED ON THE APPLICATION OR SERVICES WILL BE ERROR-FREE, THAT DEFECTS WILL BE CORRECTED, OR THAT ALPHABIZ'S SERVERS ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS. ALPHABIZ DOES NOT WARRANT OR MAKE ANY REPRESENTATION REGARDING USE OR THE RESULT OF USE OF THE CONTENT IN TERMS OF ACCURACY, RELIABILITY, OR OTHERWISE.","","## 4. LIMITATION OF LIABILITY","",'EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW AND THEN ONLY TO THAT EXTENT, IN NO EVENT WILL ALPHABIZ, ITS EMPLOYEES, OFFICERS, DIRECTORS, AFFILIATES OR AGENTS ("THE ALPHABIZ PARTIES") BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY INCIDENTAL, DIRECT, INDIRECT, PUNITIVE, ACTUAL, CONSEQUENTIAL, SPECIAL, EXEMPLARY OR OTHER DAMAGES, INCLUDING WITHOUT LIMITATION, LOSS OF REVENUE OR INCOME, LOST PROFITS, PAIN AND SUFFERING, EMOTIONAL DISTRESS, COST OF SUBSTITUTE GOODS OR SERVICES, OR SIMILAR DAMAGES SUFFERED OR INCURRED BY YOU OR ANY THIRD PARTY THAT ARISE IN CONNECTION WITH THE APPLICATIONS OR SERVICES (OR THE TERMINATION THEREOF FOR ANY REASON), EVEN IF THE ALPHABIZ PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.',"","THE ALPHABIZ PARTIES SHALL NOT BE RESPONSIBLE OR LIABLE WHATSOEVER IN ANY MANNER FOR ANY CONTENT POSTED ON THE APP (INCLUDING CLAIMS OF INFRINGEMENT RELATING TO CONTENT POSTED ON THE APPLICATIONS OR SERVICES, FOR YOUR USE OF THE APPLICATIONS AND SERVICES, OR FOR THE CONDUCT OF THIRD PARTIES WHETHER ON THE APPLICATIONS, IN CONNECTION WITH THE SERVICES OR OTHERWISE RELATING TO THE APPLICATIONS OR SERVICES.","","## 5. Reservation of Rights and Ownership","",'Tan Shuai (the "Founder" of Alphabiz) reserves all rights in and to the App, including without limitation all rights in and to the App\'s name, logo, trademark, domain name, and other intellectual property rights.',"","The App is protected by copyright and other intellectual property laws and treaties around the world. Founder owns the title, copyright and other intellectual property rights in the App. The App is licensed, not sold.","","## 6. Indemnification for breach of the Terms","","You agree to indemnify and hold harmless the Alphabiz Parties (defined above) from and against any and all loss, expenses, damages, and costs, including without limitation reasonable attorneys fees, resulting, whether directly or indirectly, from your violation of the Terms.","","## 7. Termination of this Agreement","","These Terms will continue to apply until terminated by the parties in writing, though your right to access and use the App terminates automatically upon your breach of any of these Terms.","The disclaimer of warranties, the limitation of liability and the jurisdiction and applicable law provisions shall survive any termination. The license grants mentioned herein shall continue in effect subject to the terms of the applicable license. Your warranties and indemnification obligations shall survive any termination for one year.","","## 8. Miscellaneous Terms","","If any term or part of the Terms is held to be invalid or unenforceable by any law or regulation or final determination of a competent court or tribunal, that provision will be deemed severable and will not affect the validity and enforceability of any remaining provisions.","","The parties agree that no joint venture, partnership, employment, or agency relationship exists between you and Alphabiz as a result of these Terms or your use of the App.","","These Terms constitute the entire agreement between you and Alphabiz relating to the App and supersede all prior, contemporaneous and future communications (with the exception of future amendments to the Terms as made available by Alphabiz from time to time) between you and Alphabiz. A printed version of the Terms and of any notice given in electronic form shall be admissible in judicial or administrative proceedings based on or relating to the Terms to the same extent and subject to the same conditions as other business documents and records originally generating and maintained in printed form.",""]},"9a50":function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"file-selector",on:{click:e.onClick,touch:e.onClick}},[n("input",{ref:"fileSelector",staticClass:"file-selector-input",attrs:{type:"file",name:"fileSelector",webkitdirectory:e.directory,accept:e.accept?"."+e.accept.extensions[0]:"*"},on:{change:e.onSelect}}),e._t("default",(function(){return[n("q-btn",{attrs:{color:"primary",icon:"folder_open",label:e.$t("select_file")}})]}))],2)},a=[],s=(n("de6c"),n("0598")),i=n("d558"),r=n("a3fc"),l={name:"FileSelector",props:{directory:Boolean,accept:{type:Object,required:!1}},data(){return{isElectron:Object(s["default"])(),isCapacitor:Object(i["a"])()}},mounted(){console.log("File selector mounted")},methods:{getFileContent(e){const t=n("61af").readFileSync(e,{encoding:"binary"});return t},buildFile(e){if(this.directory||n("61af").statSync(e).isDirectory())return n("61af").statSync(e).isDirectory()?{path:e,name:e}:{path:e,name:Object(r["dirname"])(e)};const t=[this.getFileContent(e)],o=Object(r["basename"])(e),a=n("ea33").lookup(Object(r["extname"])(e));return console.log("buf",t,e),console.log(o,a),new File(t,o,{type:a})},async selectDirectory(){if(!this.isElectron)return this.$refs.fileSelector.click();console.log("select directory");const{ipcRenderer:e}=await Promise.resolve().then(n.t.bind(null,"b052",7));e.once("select_file_or_directory",((e,t)=>{const n=t&&!t.canceled&&Array.isArray(t.filePaths)&&t.filePaths.length?t.filePaths.map((e=>this.buildFile(e))):null;this.$emit("select",n)})),e.send("select_file_or_directory",[])},async selectFile(){console.log("click select file",this.$refs.fileSelector);const e=this.$refs.fileSelector;return e.click()},onClick(){if(console.log("onclick",this.$refs.fileSelector),this.directory)return this.selectDirectory();this.selectFile()},onSelect(e){var t,n,o;console.log("on select files",null===(t=e.target)||void 0===t?void 0:t.files);const a=null===(n=e.target)||void 0===n||null===(o=n.files)||void 0===o?void 0:o[0];this.$emit("select",a)}}},c=l,d=(n("f157"),n("2b5f")),u=n("1043"),h=n("09a4"),p=n.n(h),m=Object(d["a"])(c,o,a,!1,null,"a5acd74c",null);t["a"]=m.exports;p()(m,"components",{QBtn:u["a"]})},"9be9":function(e,t,n){},"9c3b":function(e,t,n){},"9d1e":function(e,t,n){},"9e98":function(e,t,n){"use strict";n("2cfd")},"9e9b":function(e,t,n){},"9efe":function(e,t,n){"use strict";n.d(t,"e",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"l",(function(){return _})),n.d(t,"m",(function(){return f})),n.d(t,"o",(function(){return g})),n.d(t,"n",(function(){return b})),n.d(t,"b",(function(){return y})),n.d(t,"x",(function(){return v})),n.d(t,"g",(function(){return w})),n.d(t,"i",(function(){return k})),n.d(t,"c",(function(){return C})),n.d(t,"h",(function(){return $})),n.d(t,"t",(function(){return S})),n.d(t,"u",(function(){return x})),n.d(t,"v",(function(){return T})),n.d(t,"d",(function(){return I})),n.d(t,"p",(function(){return P})),n.d(t,"q",(function(){return O})),n.d(t,"r",(function(){return q})),n.d(t,"j",(function(){return E})),n.d(t,"w",(function(){return A})),n.d(t,"k",(function(){return D})),n.d(t,"a",(function(){return N})),n.d(t,"s",(function(){return L}));n("de6c"),n("7a76"),n("d4b5"),n("f200"),n("dc69"),n("0c26"),n("a1c1");var o=n("e74d"),a=n("67cf"),s=n("35f4"),i=n("e75b"),r=n("9572"),l=n("ff9b");const c=new i["a"].Rest("ABDevRest"),d=Object(s["a"])("1234567890abcdefghijklmnopqrstuvwxyz",20),u=e=>(e.email&&(e.email=e.email.toLowerCase()),{username:e.username,password:e.password,attributes:{...e.msgLocale?{"custom:msg_locale":e.msgLocale}:{},...e.email?{email:e.email}:{},...e.phoneNumber?{phone_number:e.phoneNumber}:{},...e.phoneNumberCountryCode?{"custom:phone_number_code":e.phoneNumberCountryCode}:{},...e.keyMetadata?{"custom:key_metadata":e.keyMetadata}:{}},clientMetadata:{oauthSignUp:e.oauthSignUp||"false",...e.invitationCode?{invitationCode:e.invitationCode}:{},...e.oauthData?{oauthData:e.oauthData}:{},...e.appClient?{"custom:app_client":e.appClient}:{},...e.signUpIpAddress?{"custom:signing_ip_address":e.signUpIpAddress}:{},...e.os?{"custom:os":e.os}:{}}}),h=e=>{e.email&&(e.email=e.email.toLowerCase());const t={email:"email",phoneNumber:"phone_number",phoneNumberCountryCode:"custom:phone_number_code",msgLocale:"custom:msg_locale",emailVerified:"email_verified",phoneNumberVerified:"phone_number_verified",app_client:"custom:app_client",os:"custom:os",nickname:"nickname",gender:"gender",birthday:"birthdate",locale:"locale"},n={};return Object.entries(t).forEach((([t,o])=>{void 0!==e[t]&&(n[o]=e[t])})),n};async function p(e=!0){const t=await o["a"].currentAuthenticatedUser().catch((e=>{throw new Error(e)}));if(!t||0===Object.keys(t).length)throw new Error("No authed user");return e||(t.dynamo_attrs={},t.dynamo_attrs.invitation_code=[]),t}async function m(){const e=await o["a"].currentUserInfo();if(!e||0===Object.keys(e).length)throw new Error("No user info");return e.dynamo_attrs={},e.dynamo_attrs.invitation_code=[],e}async function _(e,t){e=e.toLowerCase();let n=await o["a"].signIn(e,t,{});if("SMS_MFA"===n.challengeName){const e=new Error(n.challengeName);throw e.destination=n.challengeParam.CODE_DELIVERY_DESTINATION,e.user=n,e}if("SOFTWARE_TOKEN_MFA"===n.challengeName){const e=new Error(n.challengeName);throw e.user=n,e}if("CUSTOM_CHALLENGE"===n.challengeName){const e=await l["a"].prototype.$recaptcha("login");if(n=await o["a"].sendCustomChallengeAnswer(n,e),!n)throw new Error("Network Error")}c.post("/account/postSignIn",{keychainMetadataHash:r["a"].digestPassword(t)}).catch((e=>{console.error(e.message)}))}async function f(e,t,n){return o["a"].confirmSignIn(e,n,t)}async function g(e){e.username=d().toLowerCase();const t=await o["a"].signUp(u(e));return await c.postGuest("/account/postSignUp",{sub:t.userSub,username:e.username,keychainMetadataHash:r["a"].digestPassword(e.password),isTestEnv:window.isTestEnv,invitationCode:e.invitationCode}),t}async function b(){return await o["a"].signOut().catch((e=>{console.log("SignOut catch >>",e)}))}async function y(e){const t=await p(),n=await o["a"].updateUserAttributes(t,h(e));if("SUCCESS"!==n)throw new Error("Change attributes failed")}async function v(e){const t=await p(),n=await o["a"].changePassword(t,e,e).catch((e=>{throw"Incorrect username or password."===e.message?new Error("Incorrect password"):e}));return"SUCCESS"===n}function w(e,t={}){return e=e.toLowerCase(),o["a"].forgotPassword(e,t)}function k(e){return e=e.toLowerCase(),o["a"].resendSignUp(e)}async function C(e,t,n={},a={oauthSignUp:"false"}){e=e.toLowerCase();const s={optionalAttributes:JSON.stringify(h(n)),...a},i=await o["a"].confirmSignUp(e,t,{clientMetadata:s});if("SUCCESS"!==i)throw new Error(JSON.stringify(i));return i}async function $(e,t,n){t&&(t=t.toLowerCase()),await c.post("/invitation/deliverCode",{id:e,email:t,phone:n})}async function S(e){await o["a"].verifyCurrentUserAttribute(e)}async function x(e,...t){const n={email:{email:t[0].toLowerCase()},phone_number:{phoneNumber:t[0],phoneNumberCountryCode:t[1]}}[e];await c.post("/account/setVerifyAttr",n)}async function T(e,t){const n=await o["a"].verifyCurrentUserAttributeSubmit(e,t);await c.post("/account/postVerifyAttr",{success:"SUCCESS"===n})}async function I(){await c.post("/admin/deleteAccount")}async function P(){const e=await o["a"].currentAuthenticatedUser();return await o["a"].setupTOTP(e)}async function O(e){const t=await o["a"].currentAuthenticatedUser();await o["a"].verifyTotpToken(t,e)}async function q(e,t){o["a"].signOutOAuth(),await c.postGuest("/account/unlinkProvider",{providerName:e,providerUserId:t})}async function E(e,t){e=e.toLowerCase();const n=await c.postGuest("/account/verifyForDisableMFA",{username:e,metadata:t}),o=n.email.Destination,a=n.phoneNumber.Destination;return{email:{destination:o},phoneNumber:{destination:a}}}async function A(e,t,n){e=e.toLowerCase(),await c.postGuest("/account/verifySubmitForDisableMFA",{username:e,emailCode:t,phoneCode:n})}async function D(e,t){await y({msgLocale:`${e}:${t}`})}const N={data:{hash:void 0},record(e){if(!e)throw new Error("invalid password");N.data.hash=r["a"].digestPassword(e)},enable(){const e=async()=>{const e=async()=>{let e=await o["a"].currentUserInfo().then((e=>{var t;return null===e||void 0===e||null===(t=e.attributes)||void 0===t?void 0:t["custom:key_metadata"]}));return e=e?JSON.parse(e):{unset:!0,timestamps:{}},e},t=await e();t.hash?console.tag.green("Polyfill","config_password_hash","cancelled").log("cognito_hash_existed"):N.data.hash?(console.tag.green("Polyfill","config_password_hash","start").log(t),t.hash=N.data.hash,await o["a"].updateUserAttributes(await o["a"].currentAuthenticatedUser(),{"custom:key_metadata":JSON.stringify(t)}),console.tag.green("Polyfill","config_password_hash","done").log(t)):console.tag.green("Polyfill","config_password_hash","cancelled").log("local_hash_not_found")};this.$amplify.addOnAuthStateChangedListener((async t=>{"signedIn"===t&&await e()}))}};function L(){const e=n(["\n subscription OnMessage($channel: String!) {\n onMessage(channel: $channel) {\n channel\n data\n }\n }\n "]);return t;function t(t){const n=e("onMessage",{channel:`DeliveryStatus::${t}`},{authMode:"API_KEY"}),o=new Promise(((e,t)=>{n.on((n=>{const o=JSON.parse(n.data);console.log("promiseDeliveryStatus >",o),"Bounce"===o.type?t(a(o.data[0])):"Delivery"===o.type&&e(o)}))})).finally((()=>{n.off()}));return o.off=()=>n.off(),o;function a(e){var t;const n={"5.1.1":"Bad destination mailbox address","5.4.4":"Invalid domain","5.3.0":"Other or undefined mailbox status"};let o=n[e.status];return e.diagnosticCode.startsWith("smtp; 550 Mailbox unavailable or access denied")?o="Mailbox unavailable":e.diagnosticCode.indexOf("it is on the suppression list for your account.")&&(o="Suppressed email address"),new Error(null!==(t=o)&&void 0!==t?t:e.diagnosticCode)}}function n(e=[]){const t=n(e);return(e,n,{authMode:o,authToken:s}={})=>{if(!t[e])throw new Error(`Operation not found: ${e}`);const i=a["a"].graphql({query:t[e],variables:n,authMode:null!==o&&void 0!==o?o:void 0,authToken:null!==s&&void 0!==s?s:void 0});i.name=e;const r=(e,t)=>console.error(e[0].message,{errors:e,provider:t});let l;const c={on(e,t=r){return l&&l.unsubscribe(),l=i.subscribe({next:({provider:t,value:n})=>{var o;return e(null===(o=n.data)||void 0===o?void 0:o[i.name],t)},error:({provider:e,error:n})=>t(n.errors,e)}),c},off(){return l&&(l.unsubscribe(),l=null),c}};return c};function n(e=[]){return e.reduce(((e,n)=>(e[t(n)]=n,e)),{});function t(e){const t=e.trim().match(/^[\w]+[ \f\r\t\n]+[\w]+/)[0].split(" ").reverse()[0],n=t.replace(t.charAt(0),t.charAt(0).toLowerCase());return n}}}}},"9f21":function(e,t,n){"use strict";var o=n("67b6"),a=["# INTERNAL DEMO ONLY","","1. Your license permits use the Software only for your internal demonstration, test, or evaluation purposes. ","","2. Licensee acknowledges that the Software is confidential in nature and constitutes a trade secret belonging to Licensor.","","3. Public disclosure or distribution of the Software is prohibited.","","4. Note that the Software disables itself on the “time-out” date identified on the SOFTWARE packaging.","",""],s=n("76ec"),i=n("9a08");t["a"]={mixins:[o["b"]],methods:{showInternalNotice(){this.createMarkdownDialog({title:this.$t("internal_notice"),markdown:{internal:{label:"Internal",markdown:a}}})},showLicenseTermsNotice(){this.createMarkdownDialog({title:this.$t("account_license_terms"),markdown:{license:{label:"License",markdown:s["a"]},terms:{label:"Terms",markdown:i["a"]}}})}}}},"9f3a":function(e,t,n){"use strict";n("4eaf")},"9f42":function(e,t,n){},"9fe7":function(e,t,n){"use strict";n("9be9")},a11f:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));n("de6c"),n("a1c1");var o=n("d710"),a=n.n(o);const s=new Map;function i(t){if(s.has(t))return s.get(t);if("string"!==typeof t)return t;let n=t;var o;if(t.startsWith(a.a.protocol))n=null===(o=t.match(/[^/]\/([^&/]+)/))||void 0===o?void 0:o[1];else if(t.startsWith(a.a.shortProtocol))n=t.replace(a.a.shortProtocol+"://","");else if(t.match(/([0-9a-fA-F]{40})/)){var i;n=null===(i=t.match(/([0-9a-fA-F]{40})/))||void 0===i?void 0:i[1],n&&(n=e.from("01"+n,"hex").toString("base64").replace(/\//g,"_"))}const r=n||t;return s.set(t,r),r}}).call(this,n("eb72").Buffer)},a1cd:function(e,t,n){"use strict";n("de6c"),n("a1c1"),n("0c26");const o=n("a3fc"),{resolve:a}=o,{networkInterfaces:s}=n("800b"),i=e=>{if(!e.ready)return[];const t=e.pieces.length,n=t+128-t%128,o=n/128,a=[];let s=1,i=0;for(let r=0;r=o&&(a.push(s),s=1,i=0);return a},r=e=>{const t=i(e),n=[];let o=0,a=0;for(let s=0;s=8&&(n.push(a),o=0,a=0);return n},l=(e,t)=>{const n=e.pieceLength,o=e.length,a=Math.ceil(o/n),s=t.peerPieces;if(!s.buffer)return{progress:0,buffer:null};let i=0;for(const r of s.buffer){const e=r.toString(2).split("").filter((e=>"1"===e)).length;i+=e}return{progress:i/a,has:i,length:o}},c=["infoHash","name","paused","length","downloaded","uploaded","ready","waiting","progress","isSeeding","upload","token","completed","origin","path","pending","fromPost","postTitle","file","magnetURI","alphabizURI","isAutoUpload","isUploadByFiles","createdTime","completedTime","usedTime"],d=(e,t,n)=>{const a={};var s;(c.forEach((t=>{a[t]=e[t]})),!a.infoHash&&e.magnetURI)&&(a.infoHash=null===(s=e.magnetURI.toLowerCase().match(/:([0-9a-fA-F]{40})/))||void 0===s?void 0:s[1]);if(a.done=e.downloaded>=e.length,a.download=1!==e.progress&&!e.upload,a.upload=e.upload,a.recieved=e.received,a.files=e.files?e.files.map((t=>({name:t.name,path:o.resolve(e.path||"",t.path||t.name),progress:t.progress>0?t.progress:0}))).filter((e=>!e.name.match(/^_____padding_file_(.*)____$/))):[],e.timeRemaining&&(a.timeRemaining=e.timeRemaining),e.metadata&&(a.hasMetadata=!0),e.numPeers&&(a.peersNum=e.numPeers),e.subtitleList&&e.subtitleList.length&&(a.subtitleList=e.subtitleList),"undefined"===typeof t||!n)return a;const i=r(e);e.byteMap&&!i.some(((t,n)=>e.byteMap[n]!==t))||(e.byteMap=i,e.emit("byte-map-change")),a.byteMap=e.byteMap,e.trackerMap?a.trackerList=[...e.trackerMap.values()].map((e=>{const t={...e};return t.url.includes("@6")?t.isIpv6=!0:t.isIpv6=t.url.startsWith("ws")&&t.url.includes("ipv6"),t})).filter((({url:t,status:n})=>{if("error"!==n)return!0;let o=t;t.includes("@6")?o=t.replace("@6",""):o+="@6";const a=e.trackerMap.get(o);return!a||"error"===a.status})):a.trackerList=[];const d=e.client;return a.connections=e.wires.map((o=>{let a=o.remoteAddress;if(!a){const t=e._peers[o.peerId];if(!t||"webrtc"!==t.type)return null;{var s,i,r,c,u;const e=null===(s=t.conn)||void 0===s||null===(i=s._pc)||void 0===i||null===(r=i.currentRemoteDescription)||void 0===r||null===(c=r.sdp)||void 0===c||null===(u=c.match(/c=IN\sIP\d\s(.*)/))||void 0===u?void 0:u[1];if(!e)return o.destroy(),null;a=e}}let h="low";o._uploadThrottle._group===d.throttleGroups.mid&&(h="mid"),o._uploadThrottle._group===d.throttleGroups.high&&(h="high");let p=0,m=0;if(n.has(o._debugId)){const e=n.get(o._debugId);p=(o.downloaded-e.downloaded)/t,p<0&&(p=0),m=(o.uploaded-e.uploaded)/t,m<0&&(m=0)}n.set(o._debugId,{downloaded:o.downloaded,uploaded:o.uploaded});let _=!1;e.byteMap&&o.remote_byte_map&&(_=e.byteMap.some(((e,t)=>{try{const n=e.toString(2).padStart(8,"0"),a=o.remote_byte_map[t].toString(2).padStart(8,"0");for(let e=0;ee)),a.connections.sort(((e,t)=>e.address&&e.address.localeCompare?e.address.localeCompare(t.address):0)),e.verifyStatus&&(a.verifyStatus=e.verifyStatus),e.pieces&&(a.verifiedPieces=e.pieces.reduce(((e,t,n)=>{if(null===t){const t=e[e.length-1];Array.isArray(t)?t[1]===n-1?t[1]=n:e.push(n):t===n-1?e[e.length-1]=[t,n]:e.push(n)}return e}),[])),a},u=()=>{const e=s(),t=new Set;for(const n in e){const o=e[n];o.forEach((e=>{t.add(e.address)}))}return[...t]},h=e=>"string"===typeof e&&e.includes("(")?e.substring(0,e.indexOf("(")).trim():e,p=(e,t)=>{if(!e.discovery||!e.discovery.tracker)return;const n=e.discovery.tracker;if(!n._trackers.find((e=>e.announceUrl===t))&&n._createTracker)try{const e=[4];t.startsWith("http")&&e.push(6);for(const o of e){const e=n._createTracker(t,o);e&&(n._trackers.push(e),e.setInterval(),e.announce(n._defaultAnnounceOpts()))}}catch(o){console.error("addTracker error",o)}},m=(e,t,n)=>{if(!e.discovery||!e.discovery.tracker)return n();const o=e.discovery.tracker._trackers,a=o.findIndex((e=>e.announceUrl===t));if(-1===a)return n();const s=o[a];s&&s.destroy?s.destroy(((...e)=>{const a=o.findIndex((e=>e.announceUrl===t));-1!==a&&o.splice(a,1),"function"===typeof n&&n(...e)})):n()};function _(e){const{appendFile:t}=n("61af"),{format:o}=n("38c2"),s=(...e)=>`[${(new Date).toLocaleString()}] ${o(...e)}\n`,i=a(e,"webtorrent.log.log"),r=a(e,"webtorrent.warn.log"),l=a(e,"webtorrent.error.log"),c=function(e){return{...e,log(...n){t(i,s(...n),(()=>{})),e.log.apply(e,n)},warn(...n){t(r,s(...n),(()=>{})),e.warn.apply(e,n)},error(...n){t(l,s(...n),(()=>{})),e.error.apply(e,n)}}}(window.console);window.console=c}t["a"]={useRedirectLogs:_,torrentToJson:d,getLocalIPList:u,getPieceMap:i,parseTrackerWarning:h,addTracker:p,removeTracker:m}},a368:function(e,t,n){"use strict";n.r(t);var o=n("00e9");n.d(t,"Clipboard",(function(){return o["a"]}));var a=n("b46e");n.d(t,"Share",(function(){return a["a"]}));var s=n("b009");n.d(t,"Filesystem",(function(){return s["c"]})),n.d(t,"Directory",(function(){return s["a"]})),n.d(t,"Encoding",(function(){return s["b"]}));var i=n("5c0a");n.d(t,"Device",(function(){return i["a"]}));var r=n("79b7");n.d(t,"App",(function(){return r["a"]}));var l=n("c03e");n.d(t,"Network",(function(){return l["a"]}));var c=n("67d7");n.d(t,"Capacitor",(function(){return c["a"]}))},a449:function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"d",(function(){return B})),n.d(t,"c",(function(){return Q})),n.d(t,"b",(function(){return W}));n("de6c"),n("f200"),n("7a76"),n("a1c1");var o=n("36a1"),a=n("5584"),s=n("35f4"),i=n("2d62"),r=(n("dc89"),n("2425"),n("d558"));const l=e=>e?new Promise((t=>{const n=new FileReader;n.onload=e=>{var n;t(null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsText(e)})):Promise.resolve(""),c=async e=>{e.click();const t=new Promise((t=>{let n=!1;setTimeout((()=>{const e=document.activeElement;e.addEventListener("focus",(()=>{console.log("file$onFocus: Start",e),setTimeout((()=>{console.log("file$onFocus: End",n),!1===n&&t(null)}),400)}),{once:!0})}),200),e.addEventListener("change",(async o=>{var a,s;console.log("file$onChange");const i=null===o||void 0===o||null===(a=o.target)||void 0===a||null===(s=a.files)||void 0===s?void 0:s[0];i&&(n=!0,t(i)),e.value=null}),{once:!0})}));return await t},d=()=>{const e=document.createElement("input");return e.style.display="none",e.type="file",e.accept=".abk",e};var u={methods:{async $readFile(){const e=d(),t=await c(e);console.log("file$selected",t);const n=await l(t);return n},async $writeFile(e,t){if(Object(r["a"])()){const{Share:o,Filesystem:a,Directory:s}=await Promise.resolve().then(n.bind(null,"a368")),{value:i}=await o.canShare();if(!i)return;const{uri:r}=await a.writeFile({data:t,path:e,directory:s.Documents}).catch((()=>({})));return o.share({title:e,files:[r.startsWith("file://")?r:"file://"+r]}).catch((e=>{console.log(e)}))}const o=URL.createObjectURL(new Blob([t])),a=document.createElement("a");a.href=o,a.download=e,a.click(),setTimeout((()=>window.URL.revokeObjectURL(o)),0)}}},h=n("9572"),p=n("02fe"),m=n.n(p),_=n("9369"),f=n("d710"),g=n.n(f),b=n("ff9b");const y=n("d310").isElectron();y||console.warn("Warning: Torrent downloader is not impl in browser mode now");const v=Object(s["a"])("abcdefg",5),w=Object(s["a"])("0123456789abcdef",40),k=async(e,t=5)=>{let n=0;while(n=t)throw console.log("Failed at running",e),o;console.log("Retry #"+n++,e)}},C=!0,$=(...e)=>{if(!C)return;const[t,...n]=e;console.tag.green(...t).log(...n)},S=new b["a"]({data(){return{loading:!1}},methods:{setLoading(e){this.loading=e}}});function x(e){return this.$alphabiz.dialog({progress:null===e||void 0===e||e,ok:!1})}async function T(){let e=5;const t=await new Promise((async t=>{const n=this.$alphabiz.dialog({title:this.$t("store_your_lib_key"),message:this.$t("confirm_update_cloud_key"),ok:{color:"negative",textColor:"negative",disable:!!e,label:`${this.$t("ok")} (${e})`},cancel:!0}),o=Date.now(),a=setInterval((()=>{const t=Math.floor((Date.now()-o)/1e3);e=5-t,0===e&&clearInterval(a),n.update({ok:{color:"negative",textColor:"negative",disable:!!e,label:e?`${this.$t("ok")} (${e})`:this.$t("ok")}})}),1e3);t(!!await n.promise())}));return t}async function I(e,t={}){const n={password:{type:"password",model:"",rules:[_["c"].bind(this),_["d"].bind(this)]}},o=this.$alphabiz.dialog({title:this.$t("input_independent_password"),cancel:!0,prompts:n,ok:t=>t.dialog$useLoadingState("ok",(async()=>{await e(t,t.dialog$arguments().prompts.password)})),...t});await o.promise()}async function P(e,t={}){const n={password:{type:"password",label:this.$t("account_password"),model:"",rules:[_["c"].bind(this),_["d"].bind(this)]},reEnterPassword:{type:"password",model:"",label:this.$t("account_re_enter_password"),rules:[e=>n.password.model===e||this.$t("account_password_not_equal")]}},o=this.$alphabiz.dialog({cancel:!0,prompts:n,ok:t=>t.dialog$useLoadingState("ok",(()=>e(t,t.dialog$arguments().prompts.password))),...t});await o.promise()}async function O(e,{delay:t,timeout:n,messages:{processing:o,failed:a}}){const s=x.call(this,o),i=e=>new Promise((t=>setTimeout(t,e))),r=e=>new Promise((t=>{let n=e;const i=Date.now(),r=setInterval((()=>{const l=Math.floor((Date.now()-i)/1e3);n=e-l,n>0?s.update({progress:`${o} ${n}s`}):(clearInterval(r),s.update({progress:a}),t())}),1e3)}));let l,c=!1;return await Promise.race([i(t).then((()=>r(Math.round(n/1e3)))),e().then((e=>{c=!0,l=e}))]).finally((()=>{i(c?0:1e3).then((()=>s.hide()))})),l}async function q(e={}){const t="lib",{mode:n,password:o}=e,s=await a["a"].dispatch("getKeychainCloud",{keyName:t,mode:n,password:o});if(["epriv","epub","priv","pub"].some((e=>!s[e])))throw new Error("invalid_key");return s}async function E(e,t={}){if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");const n="lib",{mode:o,password:a}=t;await Object(_["a"])(e,{mode:o,password:a,keyName:n})}async function A(e,t={}){var n;let o;if(t.dataStr?o=t.dataStr:($(["requireKeyObjLocal","$readFile","start"]),o=await this.$readFile(),$(["requireKeyObjLocal","$readFile","done"],o)),!o)return;if(!o.startsWith("eyJ"))throw console.warn("legacy version or invalid key file"),new Error("invalid_key");const a=async e=>{const t={encode:e=>m.a.enc.Base64.stringify(m.a.enc.Utf8.parse(e)),decode:e=>m.a.enc.Utf8.stringify(m.a.enc.Base64.parse(e))},n=await h["a"].decryptLibKeyObj(t.decode(o),e).catch((()=>{}));if(!n||"object"!==typeof n)throw new Error("error_password");if(["epriv","epub","priv","pub"].some((e=>!n[e])))throw new Error("invalid_key");return n};await I.call(this,(async(t,n)=>{const o=await a(n).catch((e=>(this.$q.notify({message:this.$t(e.message),type:"negative",position:"bottom-right"}),null)));$(["requireKeyObjLocal","decrypted"],o),o&&await e(o).finally((()=>t.hide()))}),{title:null!==(n=t.title)&&void 0!==n?n:this.$t("input_unlock_password"),message:this.$t("require_unlock_password")})}async function D(e,t={}){if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");const{password:n}=t,o={encode:e=>m.a.enc.Base64.stringify(m.a.enc.Utf8.parse(e)),decode:e=>m.a.enc.Utf8.stringify(m.a.enc.Base64.parse(e))},a=await h["a"].encryptLibKeyObj(e,n).catch((()=>null));if(!a)throw new Error("error_password");const s=Math.floor(Date.now()/1e3);await this.$writeFile(`${g.a.displayName.replace(/\s/g,"_")}-libkey-${s}.abk`,o.encode(a))}async function N(){const e=async()=>{try{$(["createKeyObj","1"],"ensure logout"),await o["a"].logout();const e=v()+w(35),t=w(),n=e.substring(0,12);$(["createKeyObj","2"],"register"),await k((async()=>{await o["a"].register(e,t,{name:n,description:"",avatar:""})}));const a=e=>{var t;if(null===e||void 0===e||null===(t=e._)||void 0===t||!t.sea)throw new Error("current_lib_key_does_not_exist");const n=e._.sea;if(["epriv","epub","priv","pub"].some((e=>!n[e])))throw new Error("invalid_key");return n},s=a(Object(i["t"])());return $(["createKeyObj","3","created"],s),s}catch(e){throw console.error(e),new Error("failed to create lib key obj")}finally{$(["createKeyObj","4"],"logout"),await o["a"].logout()}};return await O.call(this,e,{delay:1e4,timeout:15e3,messages:{processing:this.$t("creating_lib_key"),failed:this.$t("failed_to_create_lib_key")}})}async function L(){var e;if(!o["a"].user||null===(e=o["a"].user._)||void 0===e||!e.sea)throw new Error("current_lib_key_does_not_exist");const t=o["a"].user._.sea;if(["epriv","epub","priv","pub"].some((e=>!t[e])))throw new Error("invalid_key");return t}async function j(e,t=!0){const n=async()=>{if(["epriv","epub","priv","pub"].some((t=>!e[t])))throw new Error("invalid_key");return $(["loadKeyObj"],"lib.login"),await k((async()=>{await o["a"].logout(),await o["a"].login(e)})),$(["loadKeyObj"],"lib.prepareData"),await o["a"].prepareData(),!0};return t?await O.call(this,n,{delay:1e4,timeout:6e4,messages:{processing:this.$t("loading_lib_key"),failed:this.$t("failed_to_load_lib_key")}}):await n()}async function R(){localStorage.removeItem(`library-pair@${i["e"]}`),await o["a"].logout()}async function U(e){const t=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"});let n=!1;const o=x.call(this,this.$t("loading_keychain_state"));await new Promise((e=>setTimeout(e,1e3)));const a=await this.$store.dispatch("syncKeychainState").catch((e=>(t(e.message),null)));if(!a)return o.hide(),n;const s=!(null===a||void 0===a||!a.lib),i=!!a.hash;a.unset&&a.hash;if(s){let e=5;const t=await new Promise((async t=>{const n=this.$alphabiz.dialog({title:this.$t("store_your_lib_key"),message:this.$t("confirm_update_cloud_key"),ok:{color:"negative",textColor:"negative",disable:!!e,label:`${this.$t("ok")} (${e})`},cancel:!0}),o=Date.now(),a=setInterval((()=>{const t=Math.floor((Date.now()-o)/1e3);e=5-t,0===e&&clearInterval(a),n.update({ok:{color:"negative",textColor:"negative",disable:!!e,label:e?`${this.$t("ok")} (${e})`:this.$t("ok")}})}),1e3);t(!!await n.promise())}));if(!t)return o.hide(),n}if(i)try{o.update({progress:this.$t("backing_up")}),await E.call(this,e,{mode:"cognito_hash",password:void 0}),n=!0}catch(r){t(r.message)}finally{o.hide()}else{o.hide();const a=async(o,a)=>{try{await E.call(this,e,{mode:"independent_password",password:a}),n=!0,o.hide()}catch(r){t(r.message)}},i=s?I:P,l=s?{message:this.$t("update_cloud_key_prompt_password")}:{message:this.$t("store_cloud_key_prompt_password")};await i.call(this,a,l)}return n}async function F(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=async t=>{let n=null;const o={label:this.$t("import_from_cloud"),value:"import_from_cloud",disable:!0,desc:this.$t("loading_keychain_state")},a=e=>e.dialog$useLoadingState("ok",(()=>(n&&n(),t(e,e.dialog$arguments().option)))),s={type:"radio",model:"import_from_cloud",items:[o,{label:this.$t("import_lib_key_from_local"),value:"import_from_local"},{label:this.$t("create_new_key"),value:"create_new_key"}]},i=this.$alphabiz.dialog({title:this.$t("create_or_import_key"),message:this.$t("create_or_import_key_desc"),options:s,ok:a});function r(e){const t=e=>{o.label=e?`${this.$t("import_from_cloud")} (${e}s)`:this.$t("import_from_cloud"),i.update({options:Object.assign({},s)})};let n=null;const a=new Promise((o=>{let a=e,s=setInterval((()=>{if(a<=0)return n(!0);t(a),a-=1}),1e3);n=e=>{s&&clearInterval(s),s=null,o(e)}}));return a.then((e=>{if(t(),e)return i.vm.handleOk()})),()=>n(!1)}await this.$store.dispatch("syncKeychainState").then((e=>{e.lib?(o.disable=!1,o.desc=this.$t("sync_at",{time:this.$d(e.timestamps.lib,"YMDHms")}),s.model="import_from_cloud"):(o.disable=!0,o.desc=this.$t("cloud_storage_disabled"),s.model="import_from_local"),i.update({options:Object.assign({},s)})})).catch((t=>e(t.message))),o.disable||(n=r.call(this,6),this.$watch((()=>i.vm.dialog$arguments().option),(()=>n()))),await i.promise()};await n((async(n,o)=>{$(["select",o]);const a=async e=>{const o=await j.call(this,e);o&&(t(),n.hide())};if("create_new_key"===o){const t=await N.call(this);if(!t)return;let n=!1;const i=async t=>{const a=async t=>{const n={type:"radio",model:"backup_to_cloud",items:[{label:this.$t("save_local"),value:"save_local"},{label:this.$t("backup_to_cloud"),value:"backup_to_cloud",desc:this.$t("loading_keychain_state")}]},o=this.$alphabiz.dialog({title:this.$t("store_your_lib_key"),cancel:!0,options:n,ok:e=>e.dialog$useLoadingState("ok",(()=>t(e,e.dialog$arguments().option)))});await this.$store.dispatch("syncKeychainState").then((e=>{const t=!(null===e||void 0===e||!e.lib);e.unset&&e.hash;n.items[1].desc=t?this.$t("update_cloud_key"):this.$t("enable_cloud_storage"),o.update({options:Object.assign({},n)})})).catch((t=>e(t.message))),await o.promise()};await a((async(a,s)=>{if($([o,s]),"save_local"===s)await P.call(this,(async(o,s)=>{try{await D.call(this,t,{password:s}),n=!0,o.hide(),a.hide()}catch(i){e(i.message)}}),{title:this.$t("input_unlock_password"),message:this.$t("export_local_prompt_password")});else if("backup_to_cloud"===s){if(n=await U.call(this,t),!n)return;a.hide()}}))};if(await i(t),!n)return;try{$([o,"stored"]),await a(t)}catch(s){e(s.message)}}else if("import_from_local"===o)await A.call(this,a);else if("import_from_cloud"===o){$([o,"syncKeychainState"]);const t=await this.$store.dispatch("syncKeychainState").catch((t=>(e(t.message),null)));if(null===t||void 0===t||!t.lib)return $([o,"cloud_lib_key_not_existed"]),void e("cloud_lib_key_not_existed");if(t.unset&&t.hash){$([o,"use_cognito_hash"]);try{const e=await q.call(this,{mode:"cognito_hash",password:void 0});await a(e)}catch(s){e(s.message)}return}$([o,"use_independent_password"]),await I.call(this,(async(t,n)=>{try{const e=await q.call(this,{mode:"independent_password",password:n});await a(e),t.hide()}catch(s){e(s.message)}}),{message:this.$t("require_independent_password")})}}))}async function M(){try{const e=await this.$store.dispatch("syncKeychainState");if(null!==e&&void 0!==e&&e.lib)return!1;const t=await N.call(this);if(!t)throw new Error("failed_to_create_keyObj");const n=await U.call(this,t);if(!n)throw new Error("failed_to_store_keyObj");const o=await j.call(this,t);if(!o)throw new Error("failed_to_load_keyObj");return!0}catch(e){return $(["lib$auto_create","cancel"],e.message),!1}}const B={mixins:[u],created(){this.$amplify.addOnAuthStateChangedListener((async e=>{if("signedIn"!==e)return;S.setLoading(!0);const t=()=>{const e=localStorage.getItem(`library-pair@${i["e"]}`);if(!e)return;const t=JSON.parse(e);return["epriv","epub","priv","pub"].some((e=>!t[e]))?void 0:t},n=t();if(n)await j.call(this,n,!1);else{const e=await M.call(this);e||await F.call(this)}S.setLoading(!1)})),this.$amplify.addOnAuthStateChangedListener((async e=>{"signedOut"===e&&await R.call(this)}))}},Q={mixins:[u],beforeCreate(){if("KeychainItem"!==this.$options.name&&"MnemonicCode"!==this.$options.name)throw new Error(`Unsupported Component: ${this.$options.name}`)},methods:{async lib$exportCurrentKey(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=await L.call(this).catch((t=>(e(t.message),null)));if(!t)return;await P.call(this,(async(n,o)=>{await D.call(this,t,{password:o}).then((()=>n.hide()),(t=>e(t.message)))}),{title:this.$t("input_unlock_password"),message:this.$t("export_local_prompt_password")})},async importKeyObject(e){const t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"});return j.call(this,e).then(t)},async lib$importLocalKey(){const e=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"});await A.call(this,(async t=>{await j.call(this,t),e()}))},async lib$backupCurrentKey(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"}),n=await L.call(this).catch((t=>(e(t.message),null)));if(!n)return;const o=x.call(this,this.$t("loading_keychain_state"));await a["a"].dispatch("syncKeychainState").then((async a=>{const s=await T.call(this);if(s)if(a.hash&&a.unset){o.update({progress:this.$t("backing_up")});try{await E.call(this,n,{mode:"cognito_hash",password:void 0}),t()}catch(i){e(i.message)}finally{o.hide()}}else{o.hide();const a=e=>P.call(this,e,{title:this.$t("input_independent_password"),message:this.$t("update_cloud_key_prompt_password")});await a((async(o,a)=>{try{await E.call(this,n,{mode:"independent_password",password:a}),t(),o.hide()}catch(i){e(i.message)}}))}else o.hide()}),(t=>{e(t.message),o.hide()}))},async lib$exportCloudKey(){const e=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),t=x.call(this,this.$t("loading_keychain_state")),n=await a["a"].dispatch("syncKeychainState").catch((t=>(e(t.message),null))).finally(t.hide);if(!n)return;const o=async e=>{let t=this.$t("export_key_with_cloud"),o={unlockPassword:{type:"password",model:"",label:this.$t("key_file_unlock_password"),rules:[_["c"].bind(this),_["d"].bind(this)]},reEnterPassword:{type:"password",model:"",label:this.$t("re_enter_unlock_password"),rules:[e=>o.unlockPassword.model===e||this.$t("account_password_not_equal")]}};const a=n.unset&&n.hash;a?t+=`; ${this.$t("independent_password_not_enabled")}`:o={password:{type:"password",model:"",label:this.$t("cloud_independent_password"),rules:[_["c"].bind(this),_["d"].bind(this)]},...o};const s=this.$alphabiz.dialog({title:this.$t("export_key"),message:t,prompts:o,cancel:!0,ok:t=>t.dialog$useLoadingState("ok",(async()=>{const{prompts:n}=t.dialog$arguments();await e(t,n.password||"",n.unlockPassword,a?"cognito_hash":"independent_password")}))});await s.promise()};await o((async(t,n,o,a)=>{try{const e=await q.call(this,{mode:a,password:n});await D.call(this,e,{password:o}),t.hide()}catch(s){e(s.message)}}))}}},W={methods:{async lib$openABK(e){const t=e=>this.$q.notify({message:this.$t(e),type:"negative",position:"bottom-right"}),o=()=>this.$q.notify({message:this.$t("success"),type:"positive",position:"bottom-right"});if(!y)return;const a=n("b052").ipcRenderer;[".abk"].some((t=>e.endsWith(t)))&&(e=await a.invoke("read-abk",e));const s=async()=>{const n=async()=>{const t=this.$alphabiz.dialog({title:this.$t("open_keychain_file"),message:this.$t("confirm_open_abk",{filename:e}),cancel:!0});return!!await t.promise()};await n()&&await A.call(this,(async e=>{$(["lib$openABK","keyObj"],e);const n=async e=>{const n={type:"radio",model:"use_the_key",items:[{value:"use_the_key",label:this.$t("use_the_key")},{value:"backup_the_key",label:this.$t("backup_the_key"),desc:this.$t("loading_keychain_state")}]},o=this.$alphabiz.dialog({title:this.$t("open_keychain_file"),options:n,cancel:!0,ok:t=>t.dialog$useLoadingState("ok",(()=>e(t,t.dialog$arguments().option)))});await this.$store.dispatch("syncKeychainState").then((e=>{const t=!(null===e||void 0===e||!e.lib);e.unset&&e.hash;n.items[1].desc=t?this.$t("update_cloud_key"):this.$t("enable_cloud_storage"),o.update({options:Object.assign({},n)})})).catch((e=>t(e.message))),await o.promise()};await n((async(n,a)=>{$(["lib$openABK","selectAction"],a);try{if("use_the_key"===a)await j.call(this,e);else if("backup_the_key"===a){const t=await U.call(this,e);if(!t)return}o(),n.hide()}catch(s){t(s.message)}}))}),{title:this.$t("open_keychain_file"),dataStr:e})};"signedIn"===this.$store.state.account.authState?($(["lib$openABK","hot boot"]),await s()):($(["lib$openABK","cold boot"]),this.$amplify.addOnAuthStateChangedListener((async e=>{"signedIn"===e&&await s()}),{once:!0}))}}}},a44b:function(e,t,n){"use strict";n("c5fa")},a51a:function(e,t){e.exports={github:{username:"tanshuai",repo:"alphabiz",branch:"main",internalRepo:"alphabiz-app"},bucketUrl:"https://s3.amazonaws.com/internal.alpha.biz",s3DownloadUrl:"https://d2v5t3td4po4es.cloudfront.net/releases/"}},a5d3:function(e,t,n){},a5fe:function(e,t,n){},a749:function(e,t,n){"use strict";var o=n("8750"),a=n("a368"),s=n("8a63"),i=n("5584"),r=n("1926"),l=n("d558");const c=e=>{if(Object(l["a"])()){if(!e.connected)return console.log("Network offline");if("cellular"===e.connectionType){if(i["a"].getters.settings.downloadWithCellular)return console.log("User allowed download with cellular");Object(s["d"])(!0),Object(s["e"])(!0),o["a"].create({title:r["b"].t("download_with_cellular"),message:r["b"].t("download_with_cellular_desc"),ok:r["b"].t("download_with_cellular_confirm"),cancel:r["b"].t("pause_all")}).onOk((()=>{i["a"].dispatch("set",{downloadWithCellular:!0}).then((()=>{i["a"].dispatch("fetchSettings"),Object(s["c"])(!0),Object(s["h"])(!0)}))}))}else e.connectionType}},d=async()=>{a["Network"].addListener("networkStatusChange",(e=>{c(e)}));const e=await a["Network"].getStatus();c(e)};d(),t["a"]=c},a75f:function(e,t,n){},aa59:function(e,t,n){},aa8a:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r}));var o=n("fc3a"),a=n("a368"),s=n("d558");async function i(){if(Object(s["a"])()){const{value:e,type:t}=await a["Clipboard"].read();return t.startsWith("text")||"url"===t?e:""}return navigator.clipboard.readText()}async function r(e){return Object(s["a"])()?a["Clipboard"].write({string:e}):Object(o["a"])(e)}},abc6:function(e,t,n){"use strict";(function(e){n("a1c1"),n("0c26"),n("de6c"),n("f200"),n("7a76");var o=n("7471"),a=n("ec793"),s=n("1ef4"),i=n("4d52"),r=n("508e"),l=n.n(r),c=n("fb31"),d=n.n(c);const u=d.a.protocol,h=d.a.shortProtocol,p=e=>encodeURIComponent(e.trim().replace(/\s+/g," ")),m=async(t,n)=>{const a=p(n||t.name||`${u}_task`),s=e.from(t.protocolType+t.hash,"hex").toString("base64").replace(/\//g,"_"),i=a.replace(/\s/g,"+").replace(/_/g,"+d;").replace(/\//g,"_").replace(/&/g,"+amp;")+"/"+s,r=[],l=[];for(const e of t.trackers||[])"number"===typeof e?r.push(e.toString(16)):l.push(e);let c=r.map((e=>("0000"+e).slice(-4))).join("");l.length&&(c=c+"&tr="+l.join("&"));for(const e in t.data)Array.isArray(t.data[e])?c=c+"&"+e+"="+t.data[e].join(""):"string"===typeof t.data[e]&&(c=c+"&"+e+"="+t.data[e]);const d=(await o["a"].compress(c,9)).toString("base64");return c=e.from(c).toString("base64"),c.length>1.1*d.length&&(c=d),c.length?u+"://"+i+"&"+c.replace(/\//g,"_"):u+"://"+i},_=async t=>{if(console.log("toObject",t),!t.startsWith(`${u}://`))return null;const n=t.replace(`${u}://`,"").replace(/\/+$/,"").split("&");n.length>2&&console.error("str is invalid alphabiz uri");const[a,s]=n,i=a.lastIndexOf("/");if(-1===i)return null;const r=a.substring(0,i).replace(/\+amp;/g,"&").replace(/_/g,"/").replace(/\+d;/g,"_").replace(/\+/g," ")||"",c=a.substring(i+1),d=e.from(c.replace(/_/g,"/"),"base64").toString("hex");console.log(d,c,s);const h=d.substring(0,2),p=d.substring(2);let m="";try{const t=e.from(s.replace(/_/g,"/"),"base64");console.log("buffer",t);const n=await o["a"].decompress(t);n&&(m=n.toString("base64"))}catch(v){console.log("LZMA decompress failed.",v.message),m=s||""}const _=e.from(m,"base64").toString().split("&"),[f,...g]=_,b=[];if(f.includes("="))g.unshift(f);else for(let e=0;e{if(!f.length)return g.clear(),void(b=!1);const e=f.shift();if(!e||!g.has(e))return y();b=!0;const t=g.get(e);g.delete(e),m(a["a"].toObject(t.url),t.name).then((e=>{"function"===typeof t.cb&&t.cb(null,e),Array.isArray(t.cb)&&t.cb.forEach((t=>{"function"===typeof t&&t(null,e)}))})).catch((e=>{console.error(e),t.cb(e)})).finally((()=>{b=!1,y()}))},v=async(e,t)=>{const{hash:n,url:o,name:a}=e;if(!o)return console.log("error encoding",e),t(new Error(n),o);if(o.startsWith("magnet")){const e=Date.now();if(f.includes(n)){const o=g.get(n);if(o){if(e-o.timestamp<5)return void(Array.isArray(o.cb)?o.cb.push(t):o.cb=[o.cb,t]);"function"===typeof o.cb?o.cb(new Error(`Cannot encode ${o.url}`)):Array.isArray(o.cb)&&o.cb.forEach((e=>{"function"===typeof e&&e(new Error(`Cannot encode ${o.url}`))})),g.delete(n)}else f.splice(f.indexOf(n),1)}return g.set(n,{url:o,timestamp:e,name:a,cb:t}),f.push(n),void(b||y())}if(o.startsWith(h+"-library")){const e=await m(s["a"].toObject(o));return t(null,e)}if(o.startsWith(i["a"].config.prefix)){const e=await m(i["a"].toObject(o));return t(null,e)}return console.log("error encoding",e),t(new Error(n),o)},w=async e=>{const t=await _(e.startsWith(h+":")?e.replace(`${h}://`,`${u}://-/`):e);switch(t.protocolType){case"01":return a["a"].fromObject(t);case"02":return s["a"].fromObject(t);case i["a"].config.type:return i["a"].fromObject(t)}throw console.log(t),new Error(`Unsupported protocol type ${t.protocolType}`)};t["a"]={encode:v,decode:w}}).call(this,n("eb72").Buffer)},ac09:function(e,t,n){"use strict";n("8dc9")},ac84:function(e,t,n){},ae24:function(e,t,n){},ae46:function(e){e.exports=JSON.parse('{"packageVer":"0.2.4","channel":"web","buildTime":"202308081829","buildCommit":"4d89bb06","sourceCommit":"4d89bb06","version":"0.2.5-web"}')},aecb:function(e,t,n){"use strict";(function(e){n("a1c1"),n("de6c"),n("0c26");var o=n("61af"),a=n.n(o),s=n("a3fc"),i=n.n(s),r=n("9a50"),l=n("5584"),c=n("d310"),d=n("d7df"),u=n("c5a5"),h=n("3aea"),p=n("d710"),m=n("d558"),_=n("aa8a"),f=n("36a1"),g=n("a368"),b=n("908d");const y=Object(c["isElectron"])()?n("b052").ipcRenderer:{};t["a"]={name:"TaskDialog",inject:["taskQueue"],components:{FileSelector:r["a"]},data(){const e=l["a"].getters.settings,t={downloadDirectory:e.downloadDirectory,uploadSpeed:e.uploadSpeed,downloadSpeed:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,payedUserShareRadix:e.payedUserShareRadix,trackers:e.trackerList||[],saveLinkSeed:e.saveLinkSeed,defaultVideoPlayer:e.defaultVideoPlayer};return{isElectron:Object(c["isElectron"])(),isCapacitor:Object(m["a"])(),value:!1,tab:"url",mode:"download",currentTab:"url",setAsDefault:!1,input:"",inputFile:null,onMagnetCloseCallbacks:[],settings:t,libraryDialog:null}},computed:{disableTasks(){return!!l["a"].getters.shouldDisableTasks||!!l["a"].getters.settings.forceLogin&&(!l["a"].getters.accountUserInfo||!l["a"].getters.accountUserInfo.sub)}},methods:{updateSettings(){const e=l["a"].getters.settings;this.settings={downloadDirectory:e.downloadDirectory,uploadSpeed:e.uploadSpeed,downloadSpeed:e.downloadSpeed,maximumDownloadNum:e.maximumDownloadNum,maximumConnectionsNum:e.maximumConnectionsNum,payedUserShareRadix:e.payedUserShareRadix,trackers:e.trackerList||[],saveLinkSeed:e.saveLinkSeed,defaultVideoPlayer:e.defaultVideoPlayer}},show(e,t){"string"===typeof e&&["download","upload"].includes(e)&&(this.mode=e),"string"===typeof t?(this.input=t,this.inputFile=null,this.tab="url"):"object"===typeof t&&null!==t?(this.input="",this.inputFile=t,this.tab="file",console.log("File",t)):(this.input="",this.inputFile=null),this.value=!0,this.$nextTick((()=>{this.updateSettings()}))},hide(){this.value=!1},toggle(){this.value=!this.value},selectFolder(){var e;if(!Object(c["isElectron"])())return null===(e=this.$refs.folderSelector)||void 0===e?void 0:e.click();const t="download"===this.mode?[{name:"Torrent",extensions:["torrent"]}]:[];y.once("select_file_or_directory",((e,t)=>{if(t&&!t.canceled&&t.filePaths&&t.filePaths.length){const e=a.a.statSync(t.filePaths[0])?t.filePaths[0]:i.a.basename(t.filePaths[0]);this.inputFile=[{path:e,name:e}],console.log("select folder",this.inputFile)}else console.log("skip select folder",t)})).send("select_file_or_directory",t)},onFileSelected(e){console.log("Select",e),Array.isArray(e)?this.inputFile=e:e instanceof File?this.inputFile=[e]:console.log("Invalid file",e)},onFolderSelected(e){if(!Array.isArray(e)||!e.length)return console.log("not files");console.log("Select",e),this.inputFile=e},selectSavePath(){Object(c["isElectron"])()&&y.once("select_directory",((e,t)=>{if(!t||t.canceled||!t.filePaths)return;const n=t.filePaths[0];n&&(this.settings.downloadDirectory=n,this.setAsDefault&&l["a"].dispatch("set",{downloadDirectory:n}))})).send("select_directory")},downloadTorrent(){const e=this.inputFile&&(this.inputFile.path||this.inputFile[0].path);let t=this.input;if(t.includes(p["shortProtocol"]+"://")){let e=0;t=t.replace(new RegExp(`${p["shortProtocol"]}://`,"g"),(()=>e++?`${p["protocol"]}://${p["protocol"]}task-${e}/`:`${p["protocol"]}://${p["protocol"]}task/`))}if("url"===this.tab&&!["magnet",p["protocol"],p["shortProtocol"]].some((e=>t.startsWith(e+":"))))return this.$q.notify(this.$t("invalid_download_url"));d["a"].emit("download_torrent",{type:this.tab,url:t,file:e,token:"url"===this.tab?t:e||t,...this.settings}),this.value=!1,this.input=""},async uploadTorrent(){console.log("Upload torrent",this.inputFile);const t=this.inputFile;if(console.log("n",t.name),Object(m["a"])()&&b["b"].is.ios){const n=Date.now(),o=this.$q.dialog({message:this.$t("open_file")+"...",persistent:!0,ok:!1,cancel:!1}),a=i.a.join("Uploads",t.name);console.log("Delete"),await g["Filesystem"].mkdir({directory:g["Directory"].Documents,path:i.a.dirname(a),recursive:!0}),await g["Filesystem"].deleteFile({path:a,directory:g["Directory"].Documents});let s=0;console.log("Start writing",a);const r=new FileReader,l=1e7;let c=0,u=c+l;const h=async n=>{const i=n;s+=i.byteLength,await g["Filesystem"].appendFile({path:a,directory:g["Directory"].Documents,data:e.from(n).toString("base64")}),o.update({message:this.$t("open_file")+`... (${(s/t.size*100).toFixed(2)}%)`}),c+=l,u+=l,c{if(c>=t.size)return console.log("done");const e=t.slice(c,u);r.readAsArrayBuffer(e)};r.onload=()=>{const e=r.result;h(e)},r.onerror=()=>{console.log("error",r.error.code,r.error.toString(),r.readyState,r.DONE),console.log("codes",r.error.NOT_FOUND_ERR,r.error.SECURITY_ERR,r.error.ABORT_ERR),console.log("file",t.name,t.size),console.log("Cost",Date.now()-n),m()};const m=()=>{o.hide(),this.value=!1,setTimeout((()=>{this.$q.dialog({message:this.$t("file_too_large"),ok:this.$t("ok")})}),500)},_=async()=>{console.log("Cost",Date.now()-n),console.log("Finish writing file",t.name);const{uri:e}=await g["Filesystem"].getUri({path:a,directory:g["Directory"].Documents});console.log("saved",decodeURI(e.replace("file://",""))),d["a"].emit("seed_torrent",{file:[decodeURI(e.replace("file://",""))],token:t.name,...this.settings}),this.value=!1,setTimeout((()=>{o.hide()}),1e3)};return p()}const n=this.inputFile.path?[this.inputFile.path]:this.inputFile.map((e=>e.path));d["a"].emit("seed_torrent",{file:n,token:n[0],...this.settings}),this.value=!1},submit(){(""!==this.input||this.inputFile)&&("download"===this.mode?this.downloadTorrent():this.uploadTorrent())},onPasteFile(e,t){console.log("on paste file",e);const n=decodeURI(e.replace(/^file:\/\//,""));if(!a.a.existsSync(n))return console.log("Not exists");const o=n.includes("/")?n.split("/").filter((e=>e)).pop():n;e.endsWith(".torrent")?this.show("download",[t||{path:n,name:o}]):this.$q.dialog({html:!0,title:this.$t("upload"),message:this.$t(`ask_if_upload_file
${n}
`),ok:this.$t("upload"),cancel:this.$t("cancel")}).onOk((()=>{d["a"].emit("seed_torrent",{file:[n],token:n,settings:this.settings})}))},onPasteUrl(e){if(!e.startsWith(p["protocol"]+"://$"))return e.startsWith("magnet:")||e.startsWith(p["protocol"]+":")||e.startsWith(p["shortProtocol"]+":")?void this.show("download",e):console.log("error not magnet",e)},onPasteLibraryUrl(e){if(this.libraryDialog)return;if(!e.startsWith(p["shortProtocol"]+"-library"))return;const[t,n,o]=e.replace(new RegExp(`^${p["shortProtocol"]}-library://`),"").split("/");let a=0;const s=()=>{const i=Object(h["c"])(o);if(!i)return a||this.$q.notify(this.$t("loading")),a++<5?setTimeout(s,2e3):(console.log("cannot parse",e),void this.$q.dialog({title:this.$t("channel_not_found"),message:this.$t("cannot_get_channel_info"),ok:this.$t("ok")}));"channel"===t&&(this.libraryDialog=this.$q.dialog({title:this.$t("go_to_library"),message:this.$t("go_to_library_channel_msg",[decodeURIComponent(n||o)]),ok:this.$t("ok"),cancel:this.$t("cancel")}).onOk((()=>{this.$root.$emit("navigate-to"),this.$router.push(i+"&fromLink=1"),setTimeout((()=>this.$root.$emit("navigate-to",i))),this.libraryDialog=null})).onDismiss((()=>{this.libraryDialog=null})))};f["a"].whenReady.then(s)},async onPaste(e){if(!Object(c["isElectron"])()&&!Object(m["a"])())return;if(this.value)return;const t=e._ab_payload_;console.log(t);const n=t||e.clipboardData.getData("text")||e.clipboardData.files;if(console.log("onPaste",n),"object"===typeof n&&n.path&&this.onPasteFile(n.path,n),this.disableTasks)return console.log("wait for login to continue",n),this.taskQueue.push({type:"download",file:n});if("function"===typeof e._onClose&&this.onMagnetCloseCallbacks.push(e._onClose),n.startsWith("file://"))return this.onPasteFile(n),e.preventDefault();if(n.startsWith("magnet:"))return this.onPasteUrl(n),e.preventDefault();if([p["protocol"],p["shortProtocol"]].some((e=>n.startsWith(e+":")))){const t=await Object(u["a"])(n);return t.startsWith("magnet:")?this.onPasteUrl(n):t.startsWith(p["shortProtocol"]+"-library")?this.onPasteLibraryUrl(t):console.warn("unknown url:",t),e.preventDefault()}}},mounted(){this.$root.$off("openTaskDialog"),this.$root.$off("closeTaskDialog"),this.$root.$on("openTaskDialog",((...e)=>{console.log("open task",...e),this.show(...e)})),this.$root.$on("closeTaskDialog",(()=>this.hide())),document.body.addEventListener("paste",this.onPaste)},watch:{value(e){if(e&&"download"===this.mode){if(this.input||this.inputFile&&"file"===this.tab)return;const e=async e=>{if(!e)return;const t=e.trim();if(["magnet",p["protocol"],p["shortProtocol"]].some((e=>t.startsWith(e+":")))){const e=t.startsWith("magnet")?t:await Object(u["a"])(t);if(!e||!e.startsWith("magnet"))return;this.tab="url",this.input=t}};Object(_["a"])().then(e).catch((()=>{console.log("cannot read clipboard")}))}const t=this.onMagnetCloseCallbacks.splice(0);t.forEach((e=>{"function"===typeof e&&e()})),this.input="",this.inputFile=null}}}}).call(this,n("eb72").Buffer)},af04:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("7ca3"),a=n.n(o),s=(n("a1c1"),n("0c26"),n("f680")),i=n("1926"),r=n("d310");class l{static showRaw(e,t){s["a"].create({message:e,type:t,position:"bottom-right",timeout:5e3})}static show(e,t,n){const o="account_",a=o+e.replace(/ /g,"_"),r=i["b"].t(a,n);s["a"].create({message:r,type:t,position:"bottom-right",timeout:5e3})}static showPositive(e){this.show(e,"positive")}static showNegative(e){let t;e=e.replace("PreSignUp failed with error ",""),e=e.replace("CustomMessage failed with error ",""),e=e.replace("VerifyAuthChallengeResponse failed with error ",""),"."===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),0===e.indexOf("Cognito received the following error from Amazon SES when attempting to send email:")?e="error_email_not_exists":["Member must satisfy regular expression pattern: [0-9]+","Member must have length greater than or equal to 6","Member must have length less than or equal to 6"].findIndex((t=>e.indexOf(t)>=0))>=0&&(e="error_mfa_token_mismatch"),e.indexOf("$recaptcha")>=0&&(e="Recaptcha Validation Failed"),"No user info"===e&&(e="Network Error"),"XhrError"===e&&(e="Network Error");const n="data::",o=e.lastIndexOf(n);if(o>=0){t=e.substring(o+n.length),e=e.substring(0,o).trim();try{t=JSON.parse(t)}catch{}}if("error_1_message_60_seconds"===this.ERROR_EVENTS[e]){const e=new Date(t.time).getTime()+6e4-(new Date).getTime();t={delta:Math.min(Math.max(Math.ceil(e/1e3),1),60)}}else if("error_10_messages_per_day"===this.ERROR_EVENTS[e]){const e=new Date(t.time).getTime()+864e5;t={date:e}}const a=!Object.keys(this.ERROR_EVENTS).includes(e);if(a)this.showRaw(e,"negative",t);else{const n=this.ERROR_EVENTS[e];if("error_network"===n)return void c();this.show(n,"negative",t)}}}function c(){s["a"].create({icon:"wifi_tethering_error",multiLine:!0,message:i["b"].t("account_error_network"),type:"negative",position:"bottom-right",timeout:5e3,actions:[{noCaps:!0,label:i["b"].t("network_diagnotic"),color:"white",handler:()=>{r["Bus"].$emit("CALL_NETWORK_DIAGNOSTIC")}}]})}a()(l,"ERROR_EVENTS",{"Bad destination mailbox address":"email_invalid_address","Invalid domain":"email_invalid_domain","Other or undefined mailbox status":"email_unknown_status","Mailbox unavailable":"email_unavailable_address","Suppressed email address":"email_suppressed_address","Invalid code provided, please request a code again":"account_error_invalid_verification_code","Network error":"error_network","Network Error":"error_network","timeout of 0ms exceeded":"error_network","User does not exist":"error_user_not_exist","Incorrect username or password":"error_incorrect_username_or_password","Username/client id combination not found":"error_username_not_found","Cannot reset password for the user as there is no registered/verified email or phone_number":"error_can_not_reset_for_no_verified","Invalid verification code provided, please try again":"error_invalid_verification_code","Password did not conform with policy: Password not long enough":"error_password_not_long_enough","Attempt limit exceeded, please try after some time":"error_attempt_limit_exceeded","Invalid phone number format":"error_invalid_phone_number_format","User already exists":"error_username_already_exists","Incorrect password":"error_incorrect_password",you_need_to_accept_license_terms:"error_you_need_to_accept_license_terms",incorrect_original_password:"error_incorrect_original_password",unexpected_error:"error_unexpected",invitation_channel_required:"invitation_channel_required",invitation_no_code:"invitation_no_code",can_not_change_email:"error_can_not_change_email_before_phone_bound",can_not_change_phone:"error_can_not_change_phone_before_email_bound",can_not_change_email_phone_with_mfa_enabled:"error_can_not_change_email_phone_with_mfa_enabled",error_same_email:"error_same_email",error_same_phone:"error_same_phone","the code is not an activated code":"error_inactive_code","the code has been used":"error_inactive_code","the code is non-existent":"error_non_existent_code","An account with the given email already exists":"error_email_already_exists","An account with the given phone number already exists":"error_phone_already_exists","Email or phone number is required":"error_email_or_phone_required",error_email_not_exists:"error_email_not_exists",LINKED_ACCOUNT:"error_can_not_link_to_the_linked_account",MISMATCHED_EMAIL:"error_can_not_link_to_the_mismatched_email",error_can_not_link_before_email_verified:"error_can_not_link_before_email_verified",error_can_not_change_email_before_unbound_social_account:"error_can_not_change_email_before_unbound_social_account","Invalid code or auth state for the user":"error_invalid_verification_code","Invalid session for the user, session is expired":"error_expired_verification_code","Invalid session for the user, session can only be used once":"error_expired_verification_code",error_recaptcha_not_loaded:"error_recaptcha_not_loaded","Only 1 message can be sent every 60 seconds":"error_1_message_60_seconds","Only 10 messages can be sent per day":"error_10_messages_per_day",sign_in_failed:"sign_in_failed","Recaptcha Validation Failed":"error_recaptcha_validation_failed","reCAPTCHA verification error":"error_recaptcha_validation_failed","Pending sign-in attempt already in progress":"error_sign_in_in_progress","Invalid code received for user":"error_mfa_token_mismatch","Code mismatch and fail enable Software Token MFA":"error_mfa_token_mismatch","Your software token has already been used once":"error_mfa_token_mismatch","Code mismatch":"error_mfa_token_mismatch",error_mfa_token_mismatch:"error_mfa_token_mismatch",error_can_not_enable_mfa:"error_can_not_enable_mfa","Password attempts exceeded":"error_password_attempts_exceeded"})},afe1:function(e,t,n){},b031:function(e,t,n){},b16a:function(e,t,n){"use strict";n("6ce4")},b1d8:function(e,t,n){"use strict";n("5984")},b2b4:function(e,t,n){"use strict";n("0742")},b34a:function(e,t,n){"use strict";(function(e){n("0c26"),n("de6c"),n("e39c");var o=n("212e"),a=n("229c"),s=n("d710"),i=n.n(s);n("36f2");function r(){var e;const{packageFormat:t,version:o}=s(),a=o.split("-").reduce(((e,t,n)=>({...e,[["version","channel"][n]]:t})),{});return{app_name:i.a.name,app_type:"website",app_env:"production",app_format:null!==t&&void 0!==t?t:"unknown",app_version:a.version,app_channel:null!==(e=a.channel)&&void 0!==e?e:"stable"};function s(){return n("ae46")}}async function l(){const e=await fetch("https://ipinfo.io/json?token=69cbd72732f325").then((e=>e.json())).catch((()=>null));if(!e)return!1;console.log("Analytics.location:",e);const t={country:e.country};await a["a"].updateEndpoint({location:t})}async function c(e){e.router.app.addOnAuthStateChangedListener((async t=>{"signedIn"===t&&await a["a"].updateEndpoint({userId:e.store.state.account.sub})}))}t["a"]=async(t,{app:n})=>{if(Object(o["a"])({eventHandlers:{"_userauth.sign_up":(e,t)=>{},"_userauth.sign_in":(e,t)=>{},"_userauth.sign_out":(e,t)=>{}}}),e&&e.env.TEST_EMAIL_DOMAIN||(document.cookie||"").split(";").map((e=>e.trim())).includes("TestEnv=true"))return void a["a"].configure({disabled:!0});const s=r();console.log("Analytics.app_data:",s),a["a"].configure({AWSPinpoint:{endpoint:{attributes:{...Object.entries(s).reduce(((e,[t,n])=>({...e,[t]:[n]})),{})},metrics:void 0}}}),await Promise.all([l(),c(n)])}}).call(this,n("28d0"))},b36a:function(e,t,n){},b37d:function(e,t,n){var o,a;n("de6c"),n("7996");class s{constructor(e,t,{first:n,last:o,odd:a,even:s}={}){this.name=e,this.style=t,this.first=null!==n&&void 0!==n?n:{},this.last=null!==o&&void 0!==o?o:{},this.odd=null!==a&&void 0!==a?a:{},this.even=null!==s&&void 0!==s?s:{}}withTagStyle(e){const t=e.map(((t,n)=>{const o={};return Object.assign(o,this.style,(n+1)%2===0?this.even:this.odd,0===n?this.first:{},n===e.length-1?this.last:{}),Object.entries(o).map((e=>e.join(": "))).join("; ")}));return[e.map((e=>`%c${e}`)).join(""),t]}}const i=Object.entries({neutral:[["rgb(146,146,146)","white"],["rgb(207,207,207)","black"]],red:[["rgb(232,126,126)","black"],["rgb(255,194,194)","black"]],orange:[["rgb(255,175,118)","black"],["rgb(255,215,196)","black"]],green:[["rgb(87,168,102)","white"],["rgb(200,246,213)","black"]],purple:[["rgb(125,114,253)","white"],["rgb(200,184,255)","black"]],blue:[["rgb(57,145,208)","white"],["rgb(184,215,255)","black"]],yellow:[["rgb(238,194,62)","black"],["rgb(255,238,158)","black"]],black:[["rgb(60,60,60)","white"],["rgb(90,90,90)","white"]]}).reduce(((e,[t,n])=>({...e,[t]:new s(t,{padding:"2px 6px","font-size":"0.7rem"},{odd:{background:n[0][0],color:n[0][1]},even:{background:n[1][0],color:n[1][1]},first:{"padding-left":"10px","border-top-left-radius":"8px","border-bottom-left-radius":"8px"},last:{"padding-right":"10px","border-top-right-radius":"8px","border-bottom-right-radius":"8px","margin-right":"4px"}})})),{});function r(e,t){const n=["log","warn","error","debug","group"],o=new Proxy(e,{get(e,a,s){if("context"===a)return t;if("tag"===a)return l(o,i.neutral);if(n.includes(a)){let e="";const n=[];t.tag_params.forEach((({name:t,tags:o})=>{const a=i[t].withTagStyle(o);e+=a[0],n.push(...a[1])}));const o=Reflect.get(console,a,s);return(...t)=>o(e,...n,...t)}return Reflect.get(e,a,s)}});return o}function l(e,t){const n=function(...n){const o=e!==console?e.context:{message:"",styles:[],tag_params:[]};return o.tag_params.push({name:t.name,tags:n}),r(e,o)};return Object.defineProperties(n,Object.keys(i).reduce(((t,n)=>({...t,[n]:{get(){return l(e,i[n])}}})),{})),n}null!==(a=(o=console).tag)&&void 0!==a||(o.tag=l(console,i.neutral))},b389:function(e,t,n){"use strict";n("a75f")},b3f7:function(e,t,n){(function(t){const o="Alphabiz",a={name:o,displayName:o,fileName:o,appId:"com.zeeis.alphabiz",snapName:o.toLowerCase(),author:`${o} Team `,developer:`${o} Team`,appIdentifier:"org.zeeis.alphabiz",description:`${o} Blockchain Cryptocurrency Application`,appxPackageIdentityName:o,publisher:"CN=zeeis",publisherDisplayName:`${o} Team`,homepage:"https://alpha.biz",webEditionUrl:"https://web.alpha.biz",upgradeCode:"4d8a65aa-fc5b-421c-94ab-cb722ef737e2",protocol:o.toLowerCase(),shortProtocol:"ab",versionsUrl:"https://raw.githubusercontent.com/tanshuai/alphabiz/main/versions.json",twitterAccount:"@alphabiz_app",register:{mode:"none",list:[]},library:{recommends:{default:["fxpebrsi9ij5pzinwdky","cut44dbbfxjpqka39qix"],"zh-CN":["vs52l0yqtqqpqtw33ycx","cut44dbbfxjpqka39qix"]}},update:n("a51a"),takedown:n("41c7"),theme:{color:{primary:"#d1994b",secondary:"#f3ce90",accent:"#fbbb4a"},cornerLogoStyle:{left:"-72px",top:"-92px",height:"245px"}},dynamicConfig:n("937c"),microsoftStoreProductId:"9PBCCV3MHK04",communities:[{enable:!0,url:"https://github.com/tanshuai/alphabiz",icon:"https://github.githubassets.com/favicons/favicon.svg"}],externalI18n:"https://raw.githubusercontent.com/tanshuai/alphabiz/main/i18n"};console.log("INIT APP CONFIG"),t._app_config_=a,t.LIBDB_NAME=a.name,e.exports=a,n("81e0")(a)}).call(this,n("0ee4"))},b4bc:function(e,t,n){},b65b:function(e,t,n){"use strict";(function(e){var o=n("076e"),a=n("bdb1");t["a"]={name:"ABOAuthEntry",i18n:o["a"],data(){let e={Github:{name:"Github",icon:"fab fa-github"},Twitter:{name:"Twitter",icon:"fab fa-twitter"}};return{hide:!1,loadingState:null,providers:e}},computed:{providersEnabled(){return Object.keys(this.providers).filter((e=>this.d$cfg.oauth.providers.includes(e))).reduce(((e,t)=>({...e,[t]:this.providers[t]})),{})}},methods:{async handleClick(e){try{this.loadingState=e.name,await a["a"].login.call(this,e.name)}finally{this.loadingState=null}}}}}).call(this,n("28d0"))},b71d:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"global-recommend-page"},[n("LibraryRecommend",{attrs:{fullscreen:""}})],1)},a=[],s=n("5584"),i=n("36a1"),r=n("36a5"),l={name:"GlobalRecommend",components:{LibraryRecommend:r["a"]},data(){return{selected:[]}},computed:{show(){const e="signedIn"===s["a"].state.account.authState;return!!e&&(!!i["a"].isLoggedIn&&i["a"].isFirstRegister)}},methods:{},mounted(){}},c=l,d=(n("3669"),n("2b5f")),u=Object(d["a"])(c,o,a,!1,null,"67462de2",null);t["a"]=u.exports},bba7:function(e,t,n){},bbb8:function(e,t,n){"use strict";n("8162")},bc42:function(e,t,n){"use strict";n("2d55")},bd3b:function(e,t,n){"use strict";n("5ccc")},bdb1:function(e,t,n){"use strict";n("f200");var o=n("0925");async function a(e,{initial_stage:t="authorize",initial_params:n}={}){const{updateStage:a,hide:s}=o["a"].useOAuthFlowDialog.call(this,{title:"oauth_login.sign_in_with",providerName:e}),i=this.$account.core.createOAuthFlow({initial_stage:t,initial_params:n,stage_restrict:{authorize:["logging_in"],logging_in:[]},handlers:{authorize:()=>{a("authorize",i),this.$account.core.requestOAuthAction({provider:e,action:"login"})},logging_in:()=>(a("logging_in",i),!0),succeed:async()=>{await this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX"),this.$q.notify({message:this.$t("oauth_login.notify.signed_in"),type:"positive",position:"bottom-right",timeout:5e3})}}});await i.promise().catch((t=>{const n=t.message.startsWith("oauth_error")?this.$t(t.message,{provider:e}):t.message;this.$q.notify({message:n,type:"negative",position:"bottom-right",timeout:5e3})})).finally(s)}var s=a;async function i(e,{initial_stage:t="authorize",initial_params:n}={}){const{updateStage:a,hide:s}=o["a"].useOAuthFlowDialog.call(this,{title:"oauth_connect.connect_to",providerName:e}),i=this.$account.core.createOAuthFlow({initial_stage:t,initial_params:n,stage_restrict:{authorize:["connecting"],connecting:[]},handlers:{authorize:()=>{a("authorize",i),this.$account.core.requestOAuthAction({provider:e,action:"connect"})},connecting:()=>(a("connecting",i),!0),succeed:async()=>{this.$q.notify({message:this.$t("oauth_connect.notify.connected",{provider:e}),type:"positive",position:"bottom-right",timeout:5e3})}}});await i.promise().catch((t=>{const n=t.message.startsWith("oauth_error")?this.$t(t.message,{provider:e}):t.message;this.$q.notify({message:n,type:"negative",position:"bottom-right",timeout:5e3})})).finally(s)}var r=i;t["a"]={login:s,connect:r}},c033:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"ripple",rawName:"v-ripple"}],staticClass:"relative-position follow-btn btn",class:{hovered:e.hovered,followable:e.followable,pending:e.pending,disableFollow:e.disableFollow},on:{mouseover:function(t){e.hovered=!0},mouseleave:function(t){e.hovered=!1},click:e.onClick}},[e.pending?n("q-spinner-dots",{attrs:{size:"18px",thickness:5}}):n("span",{staticClass:"follow-btn-label"},[e._v(e._s(e.followBtnLabel))])],1)},a=[],s=n("5584"),i=n("36a1"),r={name:"LibraryFollowButton",props:{id:String,disableFollow:Boolean},data(){return{hovered:!1}},computed:{pending(){return s["a"].getters.followQueue.includes(this.id)},followable(){return!i["a"].followingChannels.find((e=>e.id===this.id))},followBtnLabel(){return this.followable?this.$t("follow"):this.hovered?this.$t("unfollow"):this.$t("following")}},methods:{async onClick(){if(this.pending)return;if(this.disableFollow)return this.$q.notify("Please wait for loaded");const e=this.id;if(!e)return;if(!i["a"].channelList.some((t=>t.id===e)))return this.$q.dialog({title:this.$t("cannot_find_channel"),message:this.$t("cannot_get_channel_info"),ok:{textColor:"primary",color:"unset",flat:!0,label:this.$t("ok")}});const t=!!this.followable;if(!t){const e=await new Promise((e=>{this.$q.dialog({title:this.$t("unfollow"),message:this.$t("unfollow_confirm"),ok:{textColor:"red",color:"unset",flat:!0,label:this.$t("unfollow")},cancel:{textColor:"grey",color:"unset",flat:!0,label:this.$t("cancel")}}).onOk((()=>e(!1))).onCancel((()=>e(!0)))}));if(e)return}s["a"].commit("addFollowQueue",e),(t=>{let n=0,o=0,a=0;const r=()=>{clearInterval(o),clearTimeout(n),a&&a(),s["a"].commit("removeFollowQueue",e)};o=setInterval((()=>{this.followable===t?(console.log("Failed to toggle follow",e,t,this.followable),t?i["a"].followChannel(e):i["a"].unfollowChannel(e)):r()}),2e3),a=this.$watch("followable",(e=>{e!==t&&r()})),n=setTimeout((()=>{this.followable===t&&this.$q.notify(this.$t("follow_failed_hint"))}),1e4)})(t),t?i["a"].followChannel(e):i["a"].unfollowChannel(e)}}},l=r,c=(n("93e8"),n("2b5f")),d=n("2a5f"),u=n("4101"),h=n("719b"),p=n("09a4"),m=n.n(p),_=Object(c["a"])(l,o,a,!1,null,"711b4078",null);t["a"]=_.exports;m()(_,"components",{QSpinnerDots:d["a"],QColor:u["a"]}),m()(_,"directives",{Ripple:h["a"]})},c036:function(e,t,n){"use strict";n("b4bc")},c066:function(e,t,n){},c228:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));n("a1c1");var o=n("1c53");(()=>{const e=e=>/^(?!(_|[0-9])+$)(([A-Z0-9]|_)+$)/.test(e),t=e=>/^(?!(_|[0-9])+$)(([a-z0-9]|_)+$)/.test(e),n=e=>/^([A-Z])([A-Za-z0-9]+$)$/.test(e),o=e=>/^([a-z])([A-Za-z0-9]+$)$/.test(e),a=t=>e(t)?t.toLowerCase():o(t)?t.replace(/([A-Z])/g,"_$1").toLowerCase():n(t)?t.replace(/([A-Z])/g,"_$1").toLowerCase().substr(1):t.toLowerCase(),s=e=>t(e)?e.toUpperCase():o(e)?e.replace(/([A-Z])/g,"_$1").toUpperCase():n(e)?e.replace(/([A-Z])/g,"_$1").toUpperCase().substr(1):e.toUpperCase(),i=o=>n(o)?o[0].toLowerCase()+o.substr(1):t(o)?o.replace(/_(\w)/g,((e,t)=>t.toUpperCase())):e(o)?o.toLowerCase().replace(/_(\w)/g,((e,t)=>t.toUpperCase())):o,r=e=>o(e)?e[0].toUpperCase()+e.substr(1):(()=>(e=i(e),e=e[0].toUpperCase()+e.substr(1),e))()})();const a=Object.keys(o["countries"]).reduce(((e,t)=>{const n=o["countries"][t];return e[t]={code:t,name:n.native,normalizedName:n.name,emoji:"TW"===t?"🇼🇫":n.emoji,phones:n.phone.split(",").map((e=>e+"-"+t)),languages:n.languages.map((e=>(e+"-"+t).toLowerCase()))},e}),{}),s=Object.keys(a).reduce(((e,t)=>{const{languages:n,name:o,emoji:s,phones:i}=a[t];return n.forEach((n=>{e[n]={code:t,name:o,emoji:s,phones:i,language:n}})),e}),{})}).call(this,n("28d0"))},c294:function(e,t,n){},c49d:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return p})),n.d(t,"d",(function(){return g})),n.d(t,"c",(function(){return b}));n("de6c"),n("a1c1"),n("4db2"),n("c976"),n("4d8f"),n("f991"),n("63b1");var o=n("5584"),a=n("c248"),s=n.n(a),i=n("5515"),r=n("3aea");const l="59243e4a83edb6386ebb99d6d395df1ca5750162",c=[...new Set(o["a"].getters.settings.trackerList.filter((e=>e.startsWith("ws"))).concat("wss://tracker.files.fm:7073/announce","wss://spacetradersapi-chatbox.herokuapp.com:443/announce","ws://tracker.files.fm:7072/announce","wss://tracker.magnetoo.io/announce","wss://qot.abiir.top:443/announce","wss://tracker.dnlab.net:443/announce"))];for(const t of["wss://tracker.btorrent.xyz/announce","wss://tracker.openwebtorrent.com/announce"])c.includes(t)||c.push(t);const d="\n background-color: rgb(137,241,163);\n color: black;\n padding: 1px 5px;\n border-radius: 8px;\n border: 2px solid rgb(87,168,102);\n";let u=function(e,...t){if(o["a"].getters.isDevMode)return console.log("%c%s",d,e,...t)};o["a"].watch(((e,t)=>t.isDevMode),(e=>{u=e?console.log.bind(console,"%c%s",d):function(){}}),{immediate:!0});const h=[];function p(e){h.push(e)}u("Init","tracker-peer with trackers",c);const m=()=>"function"===typeof crypto.randomUUID?crypto.randomUUID().replace("-","").substring(0,12):"function"===typeof crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(6))].map((e=>e.toString(16).padStart(2,"0"))).join(""):new Array(12).fill().map((()=>Math.floor(16*Math.random()).toString(16))).join(""),_=e.from("-AB0000-"+m());u("peerId",_.toString("hex"));const f=new s.a({infoHash:l,peerId:_,port:8765,intervalMs:3e4,announce:[...c],dht:!0,dhtPort:2e4,tracker:{announce:[...c],getAnnounceOpts:()=>{const e={uploaded:1024,downloaded:1024,left:1024};return e}}}),g=()=>{if(!f.tracker)return u("No tracker",f);f.tracker.stop()},b=()=>{if(!f.tracker)return u("No tracker",f);f.tracker.start()},y=e=>{const t=Object.values(i["d"]).map((e=>{var t;return Object(r["e"])((null===(t=e.remoteDescription)||void 0===t?void 0:t.sdp)||"")}));try{const n=e.remoteAddress;n&&t.includes(n)&&u("Duplicate peer",n)}catch(n){return u("Duplicate peer",n,e),e.destroy()}h.forEach((t=>t(e)))};f.on("peer",(e=>{"object"===typeof e&&(e._pc&&e._channel?y(e):setTimeout((()=>{e._pc&&e._channel?y(e):e.destroy()}),2e3))})),f.on("dhtAnnounce",((...e)=>{u("dhtAnnounce",...e)}))}).call(this,n("eb72").Buffer)},c581:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return d})),n.d(t,"a",(function(){return u}));var o=n("7ca3"),a=n.n(o),s=(n("de6c"),n("c228"));class i{static without(...e){const t=`^(${e.map((e=>`(?!${e})`)).join("")}.)*$`;return new RegExp(t,"g")}static withoutOnly(...e){const t="^"+e.map((e=>`(?!${e}+$)`)).join("");return new RegExp(t,"g")}static prefixWithout(...e){const t="^"+e.map((e=>`(?!${e})`)).join("");return new RegExp(t,"g")}static suffixWithout(...e){const t=`(??");class r{static _test(e,t){const n=e.test(t);return e.lastIndex=0,n}static _testAll(e,t){const n=e.map((e=>this._test(e,t)));return!n.includes(!1)}}a()(r,"Username",[e=>r._test(i.content("0-9","A-Z","a-z"),e)||"account_field_only_alphanumeric",e=>r._test(i.range(4,16),e)||["account_field_range",[4,16]],e=>r._test(i.prefixWithout("[0-9]"),e)||"account_field_prefix_without_number_space"]),a()(r,"Password",[e=>r._test(i.content("0-9","A-Z","a-z",i.CHARACTERS),e)||"account_field_only_alphanumeric_and_symbol",e=>r._test(i.range(8,20),e)||["account_field_range",[8,20]],e=>r._test(/[0-9]/g,e)||"account_field_must_have_number_characters"]),a()(r,"PhoneNumber",[e=>r._test(i.content("0-9"),e)||"account_field_phone_number",e=>r._test(i.range(3,11),e)||["account_field_range",[3,11]]]),a()(r,"Nickname",[e=>r._test(i.content("0-9","A-Z","a-z","一-龥","\\s","_"),e)||"account_field_only_chinese_alphanumeric_space_underline",e=>r._test(i.range(2,15),e)||["account_field_range",[2,15]],e=>r._test(i.prefixWithout("[0-9]","[\\s]"),e)||"account_field_prefix_without_number_space",e=>r._test(i.suffixWithout("\\s"),e)||"account_field_suffix_without_space",e=>r._test(i.WITHOUT_REPEAT_SPACE,e)||"account_field_without_repeat_space"]),a()(r,"VerificationCode",[e=>r._testAll([i.content("0-9"),i.range(6)],e)||"account_field_verification_code"]),a()(r,"InvitationCode",[e=>r._test(i.content("0-9","A-Z","a-z"),e)||"account_field_invitation_code"]),a()(r,"TransferReceiver",[e=>{const t="tip_invalid_receiver",n=r._test(i.content("0-9","a-f","-"),e);if(!n)return t;const o=e.split("-");return 5!==o.length?t:"8-4-4-4-12"===o.map((e=>e.length)).join("-")||t}]),a()(r,"TransferAmount",[e=>r._test(i.content("0-9","."),e)||"tip_invalid_amount",e=>""+parseFloat(e)===e||"tip_invalid_amount",e=>parseFloat(e)<=1e3||"tip_invalid_amount",e=>parseFloat(e)>=.001||"tip_invalid_amount",e=>parseInt(1e3*parseFloat(e))===1e3*parseFloat(e)||"tip_invalid_amount"]);class l{constructor(e,t,n){this._model=t,this.defValue=this._model2value((()=>t?"object"!==typeof t?t:Array.isArray(t)?[...t]:{...t}:t)()),this.type=e,this.attrs=n||{}}get model(){return this._model}set model(e){this._model=e}get bound(){return this.attrs}_model2value(e){return e}_value2model(e){return e}updateModel(e){this.model=this._value2model(e)}get value(){return this._model2value(this.model)}clear(){this.updateModel(this.defValue)}}class c extends l{constructor(e,t){super("input",e,t)}}class d extends l{static get LOCALE_OPTIONS(){const e=Object.keys(s["a"]).sort(((e,t)=>(e=s["a"][e].normalizedName[0],t=s["a"][t].normalizedName[0],et?1:0))).map((e=>({value:e,emoji:s["a"][e].emoji,label:s["a"][e].name,normalizedName:s["a"][e].normalizedName})));return e}constructor(e,t,n){super("select",e,{...n||{},options:t})}}class u{constructor(e){this.items=e}updateModel(e){return Object.keys(this.items).forEach((t=>{void 0!==e[t]&&this.items[t].updateModel(e[t])})),this}get formData(){const e={};for(const[t,n]of Object.entries(this.items))e[t]=n.value;return e}setDefault(){return this}clearData(){return Object.values(this.items).forEach((e=>e.clear())),this}get length(){return Object.keys(this.items).length}}},c5a5:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));n("a1c1");var o=n("abc6"),a=n("d710");async function s(e){if(e.startsWith(a["protocol"]+"://")||e.startsWith(a["shortProtocol"]+"://")){const t=e.startsWith(a["protocol"]+"://")?e:e.replace(a["shortProtocol"]+"://",a["protocol"]+":///"),n=await o["a"].decode(t);return n}return new Promise(((t,n)=>{o["a"].encode({hash:e,url:e},((e,o)=>{e?n(e):t(o)}))}))}},c5fa:function(e,t,n){},c620:function(e,t,n){"use strict";n.r(t),function(e,o){n.d(t,"wtClient",(function(){return x})),n.d(t,"getTaskInstance",(function(){return I}));n("4db2"),n("c976"),n("4d8f"),n("f991"),n("63b1"),n("de6c"),n("a1c1");var a=n("4649"),s=n.n(a),i=n("0559"),r=n("0f0c"),l=n("c5a5"),c=n("a1cd"),d=n("edfe"),u=n("e3c7"),h=n("5584"),p=n("e38b"),m=n.n(p),_=n("84f6"),f=n("8750"),g=n("1926"),b=n("d558"),y=n("0598");const v=t=>"undefined"!==typeof crypto?e.from(crypto.getRandomValues(new Uint8Array(t))):n("548f").randomBytes(t);class w extends Map{set(e,t){if("object"!==typeof t)return console.error("Not an object",t);super.set(e,Object.assign({url:e},t,{timestamp:Date.now()}))}}const{torrentToJson:k}=c["a"],C=n("08ee").announceList.map((e=>e[0])).filter((e=>e.startsWith("wss"))).concat("wss://tracker.btorrent.xyz/announce","wss://tracker.openwebtorrent.com/announce","wss://tracker.files.fm:7073/announce","wss://spacetradersapi-chatbox.herokuapp.com:443/announce","ws://tracker.files.fm:7072/announce","wss://tracker.magnetoo.io/announce","wss://qot.abiir.top:443/announce","wss://tracker.dnlab.net:443/announce"),$=Object(r["a"])("version").replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),S=e.from(`-WW${$}-${v(9).toString("base64")}`),x=new s.a({peerId:S,maxConns:20,store:m.a});let T=null;const I=()=>T;if(!Object(b["a"])()&&!Object(y["default"])()){setInterval((()=>{var e;if(!x.torrents[0])return;const t=x.torrents[0];t.paused||t.done||1===t.progress||null!==(e=t.discovery)&&void 0!==e&&e.tracker&&t.discovery.tracker.update()}),15e3),u["ioServer"].on("updateSettings",(e=>{if(console.log("updateSettings",e),"downloadSpeed"in e){const t=e.downloadSpeed;t>0?x.throttleDownload(t):x.throttleDownload(0)}if("uploadSpeed"in e){const t=e.uploadSpeed;t>0?x.throttleUpload(t):x.throttleUpload(0)}"secureOption"in e&&(console.log("set secure",i["setSecure"]),Object(i["setSecure"])(e.secureOption))})),Object.defineProperty("undefined"===typeof window?o:window,"client",{get(){return x}});const e=()=>"undefined"!==typeof navigator&&!!navigator.serviceWorker;e()?(console.log("registering sw"),navigator.serviceWorker.register("webtorrent.worker.js").then((()=>{const e=()=>{const e=navigator.serviceWorker.controller;e&&"activated"===e.state&&(console.log("[ ServiceWorker ] Change controller",e),x.loadWorker(e))};navigator.serviceWorker.controller&&navigator.serviceWorker.controller.addEventListener("statechange",e),navigator.serviceWorker.addEventListener("controllerchange",(()=>{e(),navigator.serviceWorker.controller.addEventListener("statechange",e)})),console.log("register",navigator.serviceWorker.controller),e()})).catch((e=>{console.error("Error registering sw",e)}))):"undefined"!==typeof navigator&&navigator.serviceWorker&&navigator.serviceWorker.controller&&"activated"===navigator.serviceWorker.controller.state&&x.loadWorker(navigator.serviceWorker.controller);const t=new Map;let n=Date.now(),a=1e3;const s=()=>({downloading:[],uploading:[],downloaded:[]}),r=()=>{const e=Date.now();if(a=(e-n)/1e3,n=e,x.torrents[0]){const e=x.torrents[0];e.done||"number"!==typeof e.usedTime||(e.usedTime+=1e3);const n=k(e,a,t);if(t.has(n.infoHash)&&e.ready){const o=t.get(n.infoHash);0===o.downloaded?n.downloadSpeed=0:n.downloadSpeed=Math.floor((e.downloaded-o.downloaded)/a),0===o.uploaded?n.uploadSpeed=0:n.uploadSpeed=Math.floor((e.uploaded-o.uploaded)/a),n.downloadSpeed<0&&(n.downloadSpeed=0),n.uploadSpeed<0&&(n.uploadSpeed=0),t.set(n.infoHash,{downloaded:e.downloaded,uploaded:e.uploaded})}else n.downloadSpeed=0,n.uploadSpeed=0,t.set(n.infoHash,{downloaded:0,uploaded:0});u["ioServer"].emit("wt-task",n),T=n;const o=s();n.done&&!n.isSeeding&&n.paused?o.downloaded=[n]:n.done||n.isSeeding?o.uploading=[n]:o.downloading=[n],_["a"].updateTaskList(o)}else T=null,h["a"].commit("updateABKeys",s())};setInterval(r,1e3),x.on("error",(e=>{console.warn("webtorrent error",e)})),x.on("ready",(()=>{console.log("[webtorrent]","ready"),Object(d["b"])(x)}));const p=(e,t)=>{if(console.log("onWire",e),e.use(Object(d["a"])(x,t)),"webrtc"===e.type){console.log("onwire",e.remoteAddress,e.peerId);const n=()=>{var o,a,s,i,r;if(e.remoteAddress)return;const l=t._peers[e.peerId];if(!l)return setTimeout(n,1e3);const c=null===(o=l.conn)||void 0===o||null===(a=o._pc)||void 0===a||null===(s=a.currentRemoteDescription)||void 0===s||null===(i=s.sdp)||void 0===i||null===(r=i.match(/c=IN\sIP\d\s(.*)/))||void 0===r?void 0:r[1];if(!c)return setTimeout(n,1e3);e.remoteAddress=c};n()}},m=(e,t)=>{const n="string"===typeof e?x.get(e):e;n&&n.trackerMap&&(n.trackerMap.set(t,{status:"connecting"}),c["a"].addTracker(n,t))},b=(e,t={})=>{e.pending=!1,e.removeAllListeners(),e.setMaxListeners(0),console.log("Add listeners to",e.infoHash||e.token||t.magnetURI),e.on("error",(e=>{console.warn("[wt] error",e)})),e.on("infoHash",(e=>{console.log("got infoHash",e),u["ioServer"].emit("wt-infoHash",e)})),e.on("wire",(t=>p(t,e))),e.on("metadata",(()=>{console.log("Got metadata",e),Object(l["a"])(e.magnetURI).then((t=>{console.log(t),e.alphabizURI=t}))})),e.on("discovery",(()=>{if(console.log("start discovery"),e.trackerMap=new w,e.discovery._announce.forEach((t=>{if(console.log("Discovered",t),e.trackerMap.set(t,{status:"connecting"}),!t.startsWith("ws")){if(t.match(/(\d{1,3}\.){3}\d{1,3}/))return;e.trackerMap.set(t+"@6",{status:"connecting"})}})),e.discovery.tracker.on("warning",((t,n,o)=>{n&&(6===o&&(n+="@6"),e.trackerMap.set(n,{status:"error",message:c["a"].parseTrackerWarning(t.message)}))})),e.discovery.tracker.on("update",((t,n,o)=>{if(console.log("tracker update",n,t),!n)return console.warn("No emitted url",t);6===o&&(n+="@6"),e.trackerMap.set(n,{status:"updated",info:t})})),t.customTrackers)for(const n of t.customTrackers)m(e,n)}))},y=(e,t)=>{h["a"].getters.settings.downloadSpeed>0&&x.throttleDownload(h["a"].getters.settings.downloadSpeed),h["a"].getters.settings.uploadSpeed>0&&x.throttleUpload(h["a"].getters.settings.uploadSpeed);const n=t||{};if(n.announce=n.announce||C,x.torrents&&x.torrents.length)return u["ioServer"].emit("weberror","already_downloading");(e instanceof File||e instanceof FileList)&&console.log("should seed");const o=e instanceof File||e instanceof FileList?x.seed(e,n):x.add(e,n);return o.token=n.token||e,o.origin=n.token||e,o.createdTime=n.createdTime||Date.now(),o.usedTime=n.usedTime||0,n.fromPost&&(o.fromPost=n.fromPost),n.postTitle&&(o.postTitle=n.postTitle),n.name&&(o.name=n.name),b(o,n),r(),o};u["ioServer"].on("wt-add",(async(e,t)=>{if("string"===typeof e&&(e.startsWith("alphabiz:")||e.startsWith("ab:")))return y(await Object(l["a"])(e),t);y(e,t)})),u["ioServer"].on("download_torrent",(async e=>{if(console.log("web download",e),!e.url)return u["ioServer"].emit("weberror","not_supported_in_web_mode");try{const t=await Object(l["a"])(e.url);console.log("converted",t),y(t,{...e,url:t})}catch(t){u["ioServer"].emit("weberror",t.message||t)}})),u["ioServer"].on("wt-pause",(e=>{const t=x.get(e);if(console.log("pause",e,t),!t)return u["ioServer"].emit("weberror","torrent_not_exist");t.paused=!0,t.pause(),t.discovery.tracker.stop();while(t.wires.length){const e=[...t.wires];e.forEach((e=>e.destroy()))}})),u["ioServer"].on("wt-resume",(e=>{const t=x.get(e);if(!t)return u["ioServer"].emit("weberror","torrent_not_exist");t.paused=!1,t.resume(),t.discovery.tracker.start()})),u["ioServer"].on("pause_all",(()=>{x.torrents.forEach((e=>e.destroy((()=>{u["ioServer"].emit("wt-pause",e)}))))})),u["ioServer"].on("wt-delete",(e=>{const t=x.get(e);if(!t)return u["ioServer"].emit("weberror","torrent_not_exist");t.destroy((()=>{u["ioServer"].emit("torrent_deleted",t)}))}));let v=null;const $=({infoHash:e,filepath:t})=>{console.log("[web] Play",e,t);const n=x.get(e);return n?n.ready?(v=n.createServer(),void v.listen(0,(()=>{const t=v.address().port,o={token:n.token,port:t};u["ioServer"].emit("play-server-ready",o);const a=()=>{var t;const o=(null===(t=n.files)||void 0===t?void 0:t.map((e=>{const t=[];for(let o=e._startPiece;oclearInterval(s)))}))):setTimeout((()=>{$({infoHash:e,filepath:t})}),2e3):u["ioServer"].emit("weberror","torrent_not_exist")};u["ioServer"].on("wt-play",$);const S=()=>{v&&(v.destroy&&v.destroy(),v=null,console.log("Destroyed server"))};u["ioServer"].on("wt-stop-server",S),u["ioServer"].on("set_user",(e=>{u["ioServer"].emit("set-user",null,e)})),"undefined"!==typeof document&&document.body.addEventListener("paste",(async e=>{const t=e.clipboardData.files.length?e.clipboardData.files:e.clipboardData.getData("text");let n=t;if(t instanceof FileList){if(t.length>1)return f["a"].create({message:g["b"].t("web_mode_upload_single"),ok:g["b"].t("ok")});if(!t[0].size)return f["a"].create({message:g["b"].t("web_mode_upload_single"),ok:g["b"].t("ok")});n=t[0]}if("string"===typeof n){if((n.startsWith("ab://")||n.startsWith("alphabiz://"))&&(n=await Object(l["a"])(n).catch((()=>"")),!n.startsWith("magnet")))return f["a"].create({message:g["b"].t("invalid_download_url"),ok:g["b"].t("ok")});if(!n.startsWith("magnet"))return}const o=()=>{y(n)};x.torrents[0]?f["a"].create({message:g["b"].t("remove_old_task_desc"),ok:g["b"].t("remove_old_task"),cancel:g["b"].t("cancel")}).onOk((()=>{x.torrents[0].destroy(),x.torrents.splice(0),o()})):f["a"].create({message:g["b"].t("add")+" "+(n.name||t),ok:g["b"].t("add"),cancel:g["b"].t("cancel")}).onOk(o)})),console.log("Init webtorrent events")}}.call(this,n("eb72").Buffer,n("0ee4"))},c62a6:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("ff9b");const a=new o["a"]({data(){return{taskQueue:[]}}})},c791:function(e,t,n){"use strict";(function(e,o){n("a1c1");var a=n("1c53"),s=n.n(a),i=n("ff11"),r=n.n(i),l=n("6422"),c=n("d310"),d=n("5584");let u=null;Object(c["isElectron"])()&&(u=e["require"]("geoip-country")),t["a"]={props:{peer:{type:Object,required:!0}},computed:{isDevMode(){return d["a"].getters.isDevMode},country(){const e=this.peer.addresses[0];if(!e)return"";try{const t=u.lookup(e);return t&&t.country?t.country:""}catch(t){return""}},countryFlag(){return this.country?s.a.getEmojiFlag(this.country):""},uploadSpeed(){return Object(l["a"])(this.peer.uploadSpeed,{byte:!1,gb:!1,fix:1})},downloadSpeed(){return Object(l["a"])(this.peer.downloadSpeed,{byte:!1,gb:!1,fix:1})},peerClient(){if(!this.peer.id)return"-";const e=o.from(this.peer.id,"hex").toString("ascii");try{const t=r()(e.replace("-AB","-WD")),n=this.peer.isAbPeer?"(Alphabiz)WebTorrent":t.client;return"unknown"===n?this.$t("unknown"):t.version?n+" "+t.version:n}catch(t){return this.$t("unknown")}},peerProgress(){if("number"!==typeof this.peer.progress)return"-";const e=Number((100*this.peer.progress).toFixed(1));return e+"%"}},methods:{showPaymentPannel(){this.$emit("showPaymentPannel",{peerId:this.peer.id,address:this.peer.address,remoteUser:this.peer.user,remoteSubId:this.peer.subId})}}}}).call(this,n("0ee4"),n("eb72").Buffer)},c7ce:function(e,t,n){},c905:function(e,t,n){"use strict";n("9d1e")},ca31:function(e,t,n){},cb96:function(e,t,n){},cc0c:function(e,t,n){"use strict";n("1da1")},cdb7:function(e,t,n){"use strict";n("7ad0")},ce6c:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.showAppBar?n("q-bar",{staticClass:"application-bar app-draggable"},["mac"===e.env?[n("div",{staticClass:"full-height q-pt-xs col-grow",staticStyle:{"margin-left":"0","margin-right":"-8px"}},[n("div",{staticClass:"full-height"})]),n("div",{staticClass:"absolute-left full-width full-height row flex-center"},[n("div",{staticClass:"text-weight-bold non-selectable"},[e._v(e._s(e.appName))])])]:e._e(),["win","linux"].includes(e.env)?[n("q-img",{staticClass:"application-bar-icon",attrs:{src:e.abIcon,width:"18px",height:"18px"}}),n("div",{staticClass:"application-bar-title q-ml-md q-pr-md non-selectable",staticStyle:{"font-size":"0.8rem"}},[e._v("\n "+e._s(e.appName)+"\n ")]),n("div",{staticClass:"full-height q-pt-xs col-grow",staticStyle:{"margin-left":"0","margin-right":"-8px"}},[n("div",{staticClass:"full-height"})]),n("q-space"),n("div",{staticClass:"full-height flex-center row app-no-draggable",staticStyle:{"pointer-events":"visible","margin-right":"-12px"}},[n("q-btn",{staticClass:"window-control-button",attrs:{unelevated:""},on:{click:e.minimize}},[n("svg",{attrs:{version:"1.1",role:"presentation",width:"12",height:"12",viewBox:"0 0 12 12"}},[n("g",{attrs:{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1"}},[n("line",{attrs:{x1:"1",y1:"6",x2:"11",y2:"6",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}})])])]),n("q-btn",{staticClass:"window-control-button",attrs:{unelevated:""},on:{click:e.maximize}},[n("svg",{attrs:{version:"1.1",role:"presentation",width:"12",height:"12",viewBox:"0 0 12 12"}},[n("g",{attrs:{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1"}},[n("polyline",{attrs:{points:"5.5 1.5 10.5 1.5 10.5 6.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}}),n("polyline",{attrs:{points:"1.5 5.5 1.5 10.5 6.5 10.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}})])])]),n("q-btn",{staticClass:"window-control-button window-close-button",attrs:{unelevated:""},on:{click:e.close}},[n("svg",{attrs:{version:"1.1",role:"presentation",width:"12",height:"12",viewBox:"0 0 12 12"}},[n("g",{attrs:{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1"}},[n("line",{attrs:{x1:"1.5",y1:"1.5",x2:"10.5",y2:"10.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}}),n("line",{attrs:{x1:"10.5",y1:"1.5",x2:"1.5",y2:"10.5",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}})])])])],1)]:e._e()],2):e._e()},a=[],s=(n("de6c"),n("d710"));const i=n("d310").isElectron();var r={name:"ApplicationBar",data(){return{appName:s["appName"],showAppBar:i,showMenu:!1,abIcon:"developer/assets/icon-256.png",env:null,windowControl:null}},created(){if(!i)return;Promise.resolve().then(n.t.bind(null,"b052",7)).then((({ipcRenderer:e})=>{this.windowControl=t=>e.sendSync("app_window_control",t)}));const e=navigator.userAgent.toLowerCase(),t=/macintosh|mac os x/i.test(e);this.env=t?"mac":"win"},methods:{minimize(){this.windowControl("minimize")},maximize(){this.windowControl(this.windowControl("isMaximized")?"unmaximize":"maximize")},close(){this.windowControl("close")}}},l=r,c=(n("ac09"),n("2b5f")),d=n("85af"),u=n("1043"),h=n("9767"),p=n("990e"),m=n("8a98"),_=n("09a4"),f=n.n(_),g=Object(c["a"])(l,o,a,!1,null,null,null);t["a"]=g.exports;f()(g,"components",{QBar:d["a"],QBtn:u["a"],QImg:h["a"],QSpace:p["a"],QTable:m["a"]})},cf6e:function(e,t,n){},d176:function(e,t,n){},d1a4:function(e,t,n){"use strict";(function(e){n("de6c"),n("dc89"),n("2425"),n("a1c1");var o=n("e74d"),a=n("2b49");t["a"]=(e,{app:t,app_config:n},a)=>{s(o["a"],a,n),i(e,a,n.protocol,t)};const s=(e,t,{protocol:n,web_url:o})=>{t.$logger.tags("AuthWrapper");e._oAuthHandler._urlOpener=(e,t)=>a["a"].urlOpener(e),e.__proto__._handleAuthResponse=()=>{},e.__proto__.oAuthSignOutRedirect=function(t,n){const o=async()=>{const t=e._oAuthHandler._config.domain,n=e._oAuthHandler._cognitoClientId,o=e._oAuthHandler._config.redirectSignIn,a=`https://${t}/logout?${Object.entries({client_id:n,logout_uri:encodeURIComponent(o)}).map((e=>e.join("="))).join("&")}`;await e._oAuthHandler._urlOpener(a,o)};o(),t()};const s=(()=>({isLocalhost:Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)),isElectron:r()}))(),i=s.isElectron?2:s.isLocalhost?0:1,l=["http://localhost:8080/oauth/",`https://web.alpha.biz/oauth_redirect/${n}/${encodeURIComponent(o)}/`,`https://web.alpha.biz/oauth_redirect/${n}/app/`][i],c=l;Object.assign(e._config.oauth,{app_env:s.isElectron?"electron":"web",redirectSignIn:l,redirectSignOut:c}),Object.assign(e._oAuthHandler._config,{app_env:s.isElectron?"electron":"web",redirectSignIn:l,redirectSignOut:c})},i=(e,t,o,a)=>{if(r()){const{ipcRenderer:e}=n("b052");e.on("oauth_event",((e,t)=>{t.startsWith(`${o}://$oauth/v2/`)&&s(t,"electron")}))}else if("/oauth/v2/"===new URL(location.href).pathname){const t=t=>{e.prototype.$amplify.addOnAuthStateChangedListener((()=>{setTimeout((()=>{s(t,"web")}),2e3)}),{once:!0})};t(location.href),a.router.replace("/")}function s(e,n){t.core.handleOAuthActionResponse(e,n)}};function r(){return"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||"undefined"!==typeof e&&"object"===typeof e.version&&e.version.electron||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.includes("Electron")}}).call(this,n("28d0"))},d1e4:function(e,t,n){"use strict";n("eaf6")},d2e8:function(e,t,n){"use strict";n("053d")},d310:function(e,t,n){"use strict";n.r(t),n.d(t,"localConfigs",(function(){return r})),n.d(t,"deepClone",(function(){return c})),n.d(t,"Bus",(function(){return d["a"]})),n.d(t,"isElectron",(function(){return u["default"]})),n.d(t,"torrentToJson",(function(){return _}));n("de6c");var o=n("3fd2"),a=n.n(o);const s=a.a.renderer(),i=e=>new Promise(((t,o)=>{if(!s)return o(!1),!1;s&&Promise.resolve().then(n.t.bind(null,"b052",7)).then((n=>n.ipcRenderer.invoke("get-app-settings").then((n=>{n[e]?t(n[e]):o(!1)})).catch(o)))}));var r={getSettingsItem:i};function l(e){if(!e||"object"!==typeof e)return e;const t=arguments[1]||new WeakMap;if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};t.set(e,n);for(const o in e)Object.hasOwnProperty.call(e,o)&&(n[o]=l(e[o],t));return n}var c=l,d=n("c62a6"),u=n("0598");const h=n("a3fc"),p=["infoHash","name","paused","progress","length","downloaded","downloadSpeed","uploaded","uploadSpeed","recieved","ready","token","origin","path","pending"],m=(e,t)=>{const n={};return p.forEach((t=>{n[t]=e[t]})),n.done=e.downloaded>=e.length,n.download=!t,n.upload=e.upload,n.files=e.files?e.files.map((t=>({name:t.name,path:h.resolve(e.path,t.path),progress:t.progress||0}))):[],n};var _=m},d34c:function(e,t,n){},d534:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"image-with-preview full-width"},[n("q-input",{staticClass:"full-width",attrs:{outlined:"","stack-label":"",value:e.value,label:e.label,rules:e.rules,placeholder:"https://example.org/path/to/image.jpg",debounce:500},on:{input:e.emitSrc},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"after",fn:function(){return[n("div",{staticClass:"image-container"},[n("img",{staticClass:"preview-image",class:e.state,attrs:{src:e.realSrc},on:{error:e.emitError,load:e.emitSuccess}}),"error"===e.state?n("q-icon",{attrs:{name:"close",size:"56px",color:"red"}},[n("q-tooltip",[e._v(e._s(e.$t("invalid_image")))])],1):e._e(),"loading"===e.state?n("q-icon",{attrs:{name:"image",size:"56px",color:"green"}},[n("q-tooltip",[e._v(e._s(e.$t("poster")))])],1):e._e()],1)]},proxy:!0}])})],1)},a=[],s={props:{value:String,label:String,rules:{type:Array,default:()=>[]}},data(){return{state:"loading"}},computed:{realSrc(){let e=this.value||"";if(!e.startsWith("http"))return"";while(e.startsWith("http%3A%2F%2F"))e=decodeURIComponent(e),console.log("decode",this.value,e);while(e.startsWith("https%3A%2F%2F"))e=decodeURIComponent(e),console.log("decode",this.value,e);return e}},methods:{emitSrc(e){this.$emit("input",e)},emitError(){""!==this.value&&(this.$emit("state",2),this.state="error")},emitSuccess(){this.$emit("state",1),this.state="loaded"}},watch:{value(){console.log("src change"),this.$emit("state",0),this.state="loading"}}},i=s,r=(n("c905"),n("2b5f")),l=n("0e45"),c=n("f106"),d=n("cf25"),u=n("09a4"),h=n.n(u),p=Object(r["a"])(i,o,a,!1,null,"70ea5328",null);t["a"]=p.exports;h()(p,"components",{QInput:l["a"],QIcon:c["a"],QTooltip:d["a"]})},d558:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return s}));var o=n("800b");const a=Boolean((()=>{var t;if("undefined"===typeof window)return"mobile"in e.versions||"android"===Object(o["platform"])()||"ios"===Object(o["platform"])()||e.argv.includes("--dev")||e.argv.includes("--capacitor")||void 0;const{Platform:a}=n("d247");return(null===(t=a.is)||void 0===t?void 0:t.capacitor)||void 0})());function s(){return a}}).call(this,n("28d0"))},d6ab:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return h}));n("de6c"),n("dc89"),n("2425"),n("a1c1");const o=n("61af"),a=n("a3fc"),s=n("17de"),i=n("5c0c");function r(e){const t=e.path||e;if(console.log(t),!o.existsSync(t)&&!o.existsSync(t+".downloading"))return[];const n=a.dirname(e.path),s=a.extname(e.path),i=e.name.substring(0,e.name.lastIndexOf("."));console.log(n,i,s);const r=d(n,i),h=c(n,r),p=u(n,i),m=l(n,p);return[...h,...m]}function l(e,t){const n=[];try{t.forEach(((t,r,l)=>{l[r]=e+"/"+t;const c=o.readFileSync(l[r]),d=i.decode(c,s.detect(c)).replace(/^{[\\0-9A-Za-z&]*}/gm,""),u=1===(t.match(/\./g)||[]).length?t:a.extname(t.substring(0,t.lastIndexOf("."))).substring(1)+".srt";n.push({src:URL.createObjectURL(new Blob([h(d)])),label:u,path:e+"\\"+t})}))}catch(r){console.log(r)}return console.log(n),n}function c(e,t){const n=[];try{t.forEach(((t,r,l)=>{l[r]=e+"/"+t;const c=o.readFileSync(l[r]),d=s.analyse(c);console.log("encoding",d);const u=i.decode(c,s.detect(c)).replace(/^{[\\0-9A-Za-z&]*}/gm,""),h=1===(t.match(/\./g)||[]).length?t:a.extname(t.substring(0,t.lastIndexOf("."))).substring(1)+".vtt";n.push({src:URL.createObjectURL(new Blob([u])),label:h,path:e+"\\"+t})}))}catch(r){console.log(r)}return console.log(n),n}function d(e,t){let n;try{n=o.readdirSync(e),n=n.filter((e=>e.startsWith(t)&&e.endsWith(".vtt")))}catch(a){console.log(a)}return n}function u(e,t){let n;try{n=o.readdirSync(e),n=n.filter((e=>e.startsWith(t)&&e.endsWith(".srt")))}catch(a){console.log(a)}return n}function h(e){var t=e.replace(/\r+/g,"");t=t.replace(/^\s+|\s+$/g,"");var n=t.split("\n\n"),o="";if(n.length>0){o+="WEBVTT\n\n";for(var a=0;a3){for(var o=3;o\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);return s?(t+=s[1]+":"+s[2]+":"+s[3]+"."+s[4]+" --\x3e "+s[5]+":"+s[6]+":"+s[7]+"."+s[8]+"\n",a+=1,n[a]&&(t+=n[a]+"\n\n"),t):""}},d710:function(e,t,n){(function(t){const o=n("b3f7"),{default:a}=n("0598");if(a())if(this.require)try{const n=this["require"]("developer/app");console.log("Init from node_modules",t),n.appName=n.name,e.exports={default:n,appName:n.name,...n}}catch(s){console.log(">> Cannot require /developer/app from build. Use dev");const t=this["require"]("../../developer/app");t.appName=t.name,console.log("APP name:",t.appName),e.exports={default:t,appName:t.name,...t}}else{const t=a()?require("developer/app"):o;t.appName=t.displayName,console.log("APP name:",t.appName),e.exports={default:t,appName:t.displayName,...t}}else e.exports={appName:o.name,...o}}).call(this,n("28d0"))},d7df:function(e,t,n){"use strict";n("de6c"),n("d4b5");var o=n("d310"),a=n("e3c7"),s=n("d558"),i=n("9ad5"),r=n.n(i),l=n("a368"),c=n("8a63"),d=n("f680"),u=n("1926");const h=Object(s["a"])(),p=e=>"requestAnimationFrame"in window?requestAnimationFrame(e):setTimeout(e,20),m=[],_=new Map,f=new Map,g={on(e,t){Object(o["isElectron"])()||h?(_.has(e)||_.set(e,[]),_.get(e).push(t),f.has(e)&&(f.get(e).forEach((e=>{t(...e)})),f.delete(e)),h&&"check-network-result"===e&&console.log("Listen on",e,t)):a["ipcRenderer"].on(e,t)},once(e,t){const n=(...o)=>{t(...o),this.off(e,n)};return this.on(e,n)},emit(e,...t){h?m.push({name:e,data:t}):Object(o["isElectron"])()?a["ipcRenderer"].send("_io_send",{name:e,data:t}):a["ipcRenderer"].send(e,...t)},off(e,t){console.log("Off",e);const n=_.get(e);if(!n)return;if(!t)return n.splice(0);const o=n.indexOf(t);-1!==o&&n.splice(t,1)},clear(){console.log("io client clear");for(const e of _.values())e.splice(0)}};if(Object(o["isElectron"])()){const e={resolve:null,async execute(){if(e.resolve)return;const t=new Promise((t=>e.resolve=t));a["ipcRenderer"].send("_io_fetch"),await t,e.resolve=null}},t=async()=>{await e.execute(),setTimeout((()=>p(t)),500)};p(t),a["ipcRenderer"].on("_io_response",(async(t,n)=>{var o;if(!n||!n.length)return null===(o=e.resolve)||void 0===o?void 0:o.call(e);await n.reduce((async(e,{name:t,data:n})=>{await e;const o=JSON.parse(n),a=_.get(t);if(a)a.map((e=>{try{e(...o)}catch(n){console.error(`Error when emitting io event [${t}] ${n}`)}}));else{f.has(t)||f.set(t,[]);const e=f.get(t);e.push(o),e.length>10&&e.splice(0,e.length-10)}}),Promise.resolve()),"function"===typeof e.resolve&&e.resolve()}))}if(h&&"object"===typeof window){const e=(e,t)=>{e.startsWith("ipc")&&(console.log("Got ipc event",e,t),t.unshift(null));const n=e.startsWith("ipc:")?e.substring(4):e,o=_.get(n);if("check-network-result"===n&&console.log("pre",n,o,_.size),_.has(n))o&&o.forEach((e=>e(...t)));else if(f.has(n)){const e=f.get(n);e.push(t),e.length>10&&(e.splice(0,e.length-10),"check-network-result"===n&&console.log("Remove",n,_.size))}else f.set(n,[t])};let t=0;const n=()=>{l["Filesystem"].readFile({path:"service_port",directory:l["Directory"].Documents,encoding:l["Encoding"].UTF8}).then((({data:e})=>{if(!isNaN(parseInt(e))){if(t===parseInt(e))return;t=parseInt(e),console.log("Set port to",t)}}))};n(),setInterval(n,1e4);const o=new Set,a=async()=>{if(!t)return setTimeout(a,500);try{let a=!0,s=()=>{};setTimeout((()=>{a&&(s=d["a"].create({message:u["b"].t("connecting")+"...",position:"bottom-right"}))}),1200);const i=t=>{t&&Array.isArray(t.events)&&t.events.forEach((({name:t,data:n})=>e(t,n)))},l=m.splice(0).map((e=>{const t=JSON.stringify(e).length;if(t>3e6){const t="partials:"+e.name;if(o.has(t))return;o.add(t);let n=0;const a=async e=>{const{data:t}=await r.a.post("http://localhost:3000",{events:[e]},{withCredentials:!1,timeout:5e3}).catch((()=>({})));return i(t),n++,await new Promise((e=>setTimeout(e,100)))};return e.data.reduce((async(e,n,o)=>{if(await e,"object"!==typeof n||JSON.stringify(n).length<3e6)await a({name:t,index:o,data:n}),await new Promise(p);else{let e=Array.isArray(n)?[]:{},s=0;for(const i in n)e[i]=n[i],s+=JSON.stringify(n[i]).length,s>3e6&&(await a({name:t,index:o,data:e}),e=Array.isArray(n)?[]:{},s=0,await new Promise(p));(Array.isArray(n)?e.length:Object.keys(e).length)&&await a({name:t,index:o,data:e})}await new Promise(p)}),Promise.resolve()).then((async()=>{await a({name:t,index:-1}),console.log(`Finished splicing ${t} with ${n} pieces`),o.delete(t)})),null}return e})).filter((e=>e));l.length||l.push("__empty__"),await l.reduce((async(e,o)=>{if(await e,!o)return;const{data:a}=await r.a.post(`http://localhost:${t}`,{events:"__empty__"===o?[]:[o]},{withCredentials:!1,timeout:2e3}).catch((e=>(console.log(`Failed to fetch events. Error: ${e.message||e}`),console.log(m),n(),{})));i(a)}),Promise.resolve()).catch(n),a=!1,s()}catch(s){console.log("Poll error",s)}setTimeout(a,500)};a(),l["App"].addListener("resume",(()=>{console.log("App resume"),setTimeout((()=>{Object(c["c"])(!0)}),500)})),l["App"].addListener("pause",(()=>{console.log("App pause"),Object(c["d"])(!0)})),l["Network"].addListener("networkStatusChange",(e=>{console.log("Network connection type changed to",e.connectionType)}))}t["a"]=g},d7f6:function(e,t,n){},d884:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n("5584");const o=[{value:"en-US",label:"English"},{value:"zh-CN",label:"简体中文"},{value:"zh-TW",label:"繁體中文"}]},ddf9:function(e,t,n){"use strict";function o(){const e=navigator.userAgent.toLowerCase();return e.includes("android")||e.includes("ios")||e.includes("iphone")}n.d(t,"a",(function(){return o}))},df2b:function(e,t,n){},e0e1:function(e,t,n){"use strict";n("571b")},e3c7:function(e,t,n){"use strict";n.r(t),n.d(t,"ipcEvent",(function(){return l})),n.d(t,"ioEvent",(function(){return c})),n.d(t,"ioServer",(function(){return h})),n.d(t,"ipcRenderer",(function(){return p}));n("de6c");var o=n("bd50"),a=n.n(o),s=n("d310"),i=n("d558"),r=n("d7df");const l=new a.a,c=new a.a,d=Object(s["isElectron"])()?n("b052").ipcRenderer:Object(i["a"])()?{on(e,t){r["a"].on("ipc:"+e,t)},once(e,t){r["a"].once(e,t)},off(e,t){r["a"].off("ipc:"+e,t)},send(e,...t){console.log("ipcSend",e),r["a"].emit("ipc:"+e,...t)}}:{on(e,t){l.on(e,((...e)=>{t(...e)}))},send(e,...t){c.emit(e,...t)}},u=new Map,h={on(e,t){const n=u.has(t)?u.get(t):(...e)=>{t(...e)};u.has(t)||u.set(t,n),c.on(e,n)},emit(e,...t){l.emit(e,...t)},off(e,t){if(!t)return c.off(e);const n=u.get(t)||t;return n?c.off(e,n):void 0}},p=d;console.log("Init api server"),Object(s["isElectron"])()||Object(i["a"])()||(console.log("isElectron",Object(s["isElectron"])()),console.log("isCapacitor",Object(i["a"])()),n("c620"),n("ecef"))},e757:function(e,t,n){"use strict";n("a1c1"),n("f200");var o=n("35f4"),a=n("d710"),s=n.n(a),i=n("0f0c"),r=(n("d4b5"),n("5584"));const l=({measurementId:e,apiSecret:t,clientId:n,name:o,params:a})=>{var s;const i=null===(s=r["a"].state.account)||void 0===s?void 0:s.sub;console.log("Measure",n,i,o,a);const l={client_id:n,events:[{name:o,params:a}]};return i&&(l.user_id=i),fetch(`https://www.google-analytics.com/mp/collect?measurement_id=${e}&api_secret=${t}`,{method:"POST",body:JSON.stringify(l)})};var c=l;const d=Object(o["a"])("0123456789abcdef"),u=d(20),h={session_token:u,appName:s.a.displayName,version:Object(i["a"])("version"),channel:Object(i["a"])("channel"),packageFormat:Object(i["a"])("packageFormat")||"unknown"};class p{constructor(e,t){this.customParams={},this.trackingID=e,this.apiSecret=t,this.uaId=e.replace("G-","UA-").replace(/.$/,(e=>"-"+e)),console.log("Set UniversalAnalytics ID to",this.uaId),this.disabled=!1}config(){this.disabled||(gtag("js",new Date),gtag("config",this.trackingID))}set(e,t){this.disabled||(null!==t?this.customParams[e]=t:delete this.customParams[e])}async get(e){}async getClientId(){return new Promise((e=>gtag("get",this.uaId,"client_id",(t=>{console.log("CLIENT_ID",t),e(t)}))))}async send(e,t={}){if(this.disabled)return;const n=Object.assign({},t,h);return new Promise((async t=>{if(console.log("[GA] send",e,n),location.protocol.startsWith("https"))gtag("event",e,Object.assign(n,{event_callback:()=>{t()}}));else{console.log("Use measurement protocol");const o=await this.getClientId();console.log("Start measure with",o),c({measurementId:this.trackingID,apiSecret:this.apiSecret,clientId:o,name:e,params:n}).then((t=>{console.log("Finish measure",e),204!==t.status&&console.warn(`Warning: expect response code 204 but got ${t.status}: ${t.statusText||"(empty)"}`)})).catch((e=>{console.log("Error sending measure",e)})).finally(t)}}))}disable(){this.disabled=!0}enable(){this.disabled=!1}}t["a"]=p},e75b:function(e,t,n){"use strict";n("7a76"),n("de6c");var o=n("67cf"),a=n("e74d");class s{constructor(e){this.apiName=e}async __call__(e,t,n){const a=await o["a"][e](this.apiName,t,n).catch((e=>{if(e.response&&e.response.data)return e.response.data;throw e}));if(a.stack){const e=new Error(a.message);throw e.name=a.name,e.stack=a.stack,e}return a}async __post__(e,t,n){t||(t={}),"string"===typeof e&&(e=e.split("/").filter((e=>""!==e)));const o=n?["authorized"]:[];o.push(...e);const a=n?{Authorization:n}:{};return await this.__call__("post",`/${o.join("/")}`,{body:t,headers:{...a}})}async postGuest(e,t){return await this.__post__(e,t)}async post(e,t,n){if(!n){const e=await a["a"].currentSession();n=e.getIdToken().getJwtToken()}return await this.__post__(e,t,n)}}n("dc69"),n("0c26"),n("a1c1"),n("f18a");var i=n("3334"),r=n("0cdb"),l=n("586d");const c={};class d{static appendOperation(e){const t=e.trim().match(/^[\w]+[ \f\r\t\n]+[\w]+/)[0].split(" ").reverse()[0],n=t.replace(t.charAt(0),t.charAt(0).toLowerCase());return c[n]=e,this}static appendOperations(e){return Array.isArray(e)?e.forEach(this.appendOperation):Object.entries(e).forEach((([e,t])=>{c[e]=t})),this}static createObservable(e,...t){const n=this.__getOperation(e),a=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));let s;a(n).forEach(((e,n)=>{const o=t[n];void 0!==o&&(s||(s={}),s[e]=o)}));const i=o["a"].graphql({query:n,variables:s});return i.name=e,i}static subscribe(e,t,n=console.error){return e.subscribe({next:({provider:n,value:o})=>{var a;return t(null===(a=o.data)||void 0===a?void 0:a[e.name],n)},error:({provider:e,error:t})=>n(t.errors,e)})}static __getOperation(e){if(!c[e])throw new Error("operation not found");return c[e]}static async execute(e,t){const n=this.__getOperation(e),a=await o["a"].graphql({query:n,variables:t});if(a.errors)throw new Error(a.errors[0].message);return a.data[e]}static injectAllOperations(e){const t=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));return Object.entries(c).forEach((([n,o])=>{e[n]=async(...e)=>{let a;return t(o).forEach(((t,n)=>{const o=e[n];void 0!==o&&(a||(a={}),a[t]=o)})),await this.execute(n,a)}})),e}}class u extends d{static async subscribeWithRetry(e,t,n,o){const a=(...e)=>console.tag.purple("GQL","websocket",...e),{times:s,duration:i,onFetchData:r,onUpdateSubscriber:l}={times:-1,duration:1e4,onFetchData:()=>{},onUpdateSubscriber:()=>{throw new Error("Your should config onUpdateSubscriber for the subscribeWithRetry method")},...o};let c=!0,d=0;const h=new Error("The number of retries exceeds the maximum"),p=e=>new Promise((t=>setTimeout(t,e))),m=async e=>{if(c=!0,s>0&&d>s)return console.warn(h),void a().log("failed to reconnect",h);const t=Math.min(i,1e3*Math.pow(2,d));a().log("connect close: ",`waiting for reconnect (${t}ms)`),await p(t),c?(d+=1,a().log(`Attempt to reconnect (${d})`),await e(),d=0,a().log("reconnected")):a(["GQL","Websocket","enableRetry === false"],c)},_=async()=>{const n=e=>{e.some((e=>["Connection closed","Timeout disconnect"].includes(e.message)))?a(["GQL","Websocket"],"Connect Error :171"):a(["GQL","Websocket"],"Connect Error :168",e),m(_)};try{d>=0&&r&&await r();const o=u.subscribe(e,t,n),a=o.unsubscribe;o.unsubscribe=function(){return c=!1,a.apply(this)},await l(o)}catch(o){a(["GQL","Websocket"],"Connect Error :191",o),await m(_)}};await _()}}class h{static createSyncDataSubscriber(e,t,n,o=console.error){return new h(e,t,o,n)}constructor(e,t,n,o){this.observable=e,this.onUpdate=t,this.onError=n,this.onFetchData=o,this.subscriber=null}async enable(){const e=e=>{this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=e};await u.subscribeWithRetry(this.observable,this.onUpdate,this.onError,{times:-1,duration:3e4,onUpdateSubscriber:e,onFetchData:this.onFetchData})}disable(){this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=null}}class p{constructor(){this.id=null,this.observable=null,this.subscriber=null,this.listeners={}}async enable(e){this.disable(),this.id=e,this.observable=u.createObservable("onGeneralUpdate",this.id);const t=e=>{const{channel:t,data:n}=e;if(!this.listeners[t])return;let o;try{o=JSON.parse(n)}catch(a){o=n}this.listeners[t].forEach((e=>e(o)))},n=async()=>{const e=Object.values(this.listeners).map((e=>e.map((e=>e.fetchData)))).flat(1).filter((e=>void 0!==e));return await Promise.all(e.map((e=>e())))};this.subscriber=h.createSyncDataSubscriber(this.observable,t,n),await this.subscriber.enable()}disable(){this.listeners={},this.subscriber&&(this.subscriber.disable(),this.subscriber=null),this.observable=null,this.id=null}addListener(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t),n&&t.fetchData!==n&&(t.fetchData=n)}removeListener(e,t){const n=t||"string"===typeof e?e:void 0;t=t||"string"!==typeof e?t:void 0,n&&!this.listeners[n]||(n&&t?this.listeners[n]=this.listeners[n].filter((e=>e!==t)):n&&!t?this.listeners[n]=void 0:Object.keys(this.listeners).forEach((e=>{this.listeners[e].includes(t)&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)))})))}}u.appendOperations(i),u.appendOperations(r),u.appendOperations(l);const m=new p,_=new p;var f={AwsApiGraphQL:u,createSyncDataSubscriber:h.createSyncDataSubscriber.bind(h),enableUserListener:async e=>await m.enable(e),disableUserListener:()=>m.disable(),addUserListener:(e,t,n)=>m.addListener(e,t,n),removeUserListener:(e,t)=>m.removeListener(e,t),enablePublicListener:async()=>await _.enable("*"),disablePublicListener:()=>_.disable(),addPublicListener:(e,t,n)=>_.addListener(e,t,n),removePublicListener:(e,t)=>_.removeListener(e,t)};t["a"]={Rest:s,GQL:f}},e7ec:function(e,t,n){"use strict";n.r(t);var o={};n.r(o),n.d(o,"createParams",(function(){return Yh})),n.d(o,"eventHandler",(function(){return Jh}));var a={};n.r(a),n.d(a,"createParams",(function(){return Zh})),n.d(a,"eventHandler",(function(){return ep}));var s={};n.r(s),n.d(s,"SubscribeGithubRepo",(function(){return dm}));n("a1c1"),n("04a1"),n("b576"),n("6b06"),n("0ecc"),n("9910"),n("19f3");var i=n("ff9b"),r=n("2c24"),l=n("b14a"),c=n("1dbb"),d=n("f680"),u=n("8750"),h=n("20c1");i["a"].use(c["a"],{config:{screen:{bodyClasses:!0},notify:{},dark:"auto"},lang:r["a"],iconSet:l["a"],plugins:{Notify:d["a"],Dialog:u["a"],Loading:h["a"]}});var p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"relative-position",attrs:{id:"q-app"}},[n("GlobalRecommend"),n("application-bar"),n("q-scroll-area",{staticClass:"main-area"},[n("router-view"),n("AboutDialog"),n("TaskDialog")],1)],1)},m=[],_=n("9856"),f=_["a"],g=(n("0928"),n("2b5f")),b=n("c782"),y=n("b2aa"),v=n("e586"),w=n("09a4"),k=n.n(w),C=Object(g["a"])(f,p,m,!1,null,null,null),$=C.exports;k()(C,"components",{QScrollArea:b["a"],QDialog:y["a"],QCard:v["a"]});var S=n("5584"),x=n("61a1"),T=async function(){const e="function"===typeof S["a"]?await Object(S["a"])({Vue:i["a"]}):S["a"],t="function"===typeof x["a"]?await Object(x["a"])({Vue:i["a"],store:e}):x["a"];e.$router=t;const n={router:t,store:e,render:e=>e($),el:"#q-app"};return{app:n,store:e,router:t}},I=(n("de6c"),n("91ab")),P=n("f4eb"),O=n.n(P);function q(e){return O()(e).luminosity()<.4?O()("white").fade(.1).string():O()("black").fade(.3).string()}function E(e){return O()(e).luminosity()<.4?O()(e).saturate(.3).darken(.5).string():O()(e).desaturate(.3).darken(.5).string()}function A(e,t){const n=e=>{const n=O()(t).isDark()?4:3;return O()(e).contrast(O()(t))>=n};if(n(e))return e;const o=O()(e).isDark();let a=O()(e);return a=o?a.mix(O()("white"),.3):a.mix(O()("black"),.3),n(a.string())||(a=a.saturate(.6)),a.string()}function D(e,t=!1){const n={color_page:"#fcfcfc",color_page_darken:"#1f1f1f"};return A(e,t?n.color_page_darken:n.color_page)}var N={invokeTextColor:q,invokeDarkenColor:E,invokeOnPageColor:D};let L;const j={mixins:[],render(e){const t=[];return this._injectVars(t),this._injectRules(t),e("style",{attrs:{type:"text/css","data-ab-theme":""}},t.join("\n"))},methods:{_injectVars(e){Object.keys(this.vars$root).length&&e.push(`:root {\n ${Object.entries(this.vars$root).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`),Object.keys(this.vars$light).length&&e.push(`.body--light {\n ${Object.entries(this.vars$light).map((e=>" "+e.join(": ")+";")).join("\n")}\n}`),Object.keys(this.vars$dark).length&&e.push(`.body--dark {\n ${Object.entries(this.vars$dark).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)},_injectRules(e){Object.entries(this.rules$root).forEach((([t,n])=>{e.push(`${t} {\n ${Object.entries(n).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)})),Object.entries(this.rules$light).forEach((([t,n])=>{e.push(`.body--light ${t} {\n ${Object.entries(n).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)})),Object.entries(this.rules$dark).forEach((([t,n])=>{e.push(`.body--dark ${t} {\n ${Object.entries(n).map((e=>" "+e.join(": ")+";")).join("\n")}\n }`)}))},setVars(e,t=null){const n=null===t?"vars$root":t?"vars$dark":"vars$light";this[n]=Object.assign({},this[n],Object.entries(e).reduce(((e,[t,n])=>({...e,[`--${Object(I["a"])(t)}`]:n})),{}))},setRules(e,t=null){const n=null===t?"rules$root":t?"rules$dark":"rules$light";this[n]=Object.assign({},this[n],Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:Object.entries(n).reduce(((e,[t,n])=>({...e,[Object(I["a"])(t)]:n})),{})})),{}))}},data(){return{vars$root:{},vars$light:{},vars$dark:{},rules$root:{},rules$light:{},rules$dark:{}}}};function R(){return L||(L=document.createElement("style"),document.head.appendChild(L)),L}let U;var F=e=>U||(j.mixins.push({created(){this.setupTheme(e)},methods:{setupTheme(e){Object.entries(e).forEach((([e,t])=>{this.setVars({[`q_color_${e}`]:t,[`q_color_on_${e}`]:N.invokeTextColor(t),[`q_color_txt_${e}`]:N.invokeOnPageColor(t,!1)},!1),this.setVars({[`q_color_${e}`]:N.invokeDarkenColor(t),[`q_color_on_${e}`]:N.invokeTextColor(N.invokeDarkenColor(t)),[`q_color_txt_${e}`]:N.invokeOnPageColor(N.invokeDarkenColor(t),!0)},!0)}));const t=e=>this.setRules({[`.bg-${e}`]:{backgroundColor:`var(--q-color-${e}) !important`,color:`var(--q-color-on-${e})`},[`.text-${e}`]:{color:`var(--q-color-txt-${e}) !important`},[`.bg-${e} .text-${e}`]:{color:`var(--q-color-on-${e}) !important`},[`.bg-${e}.text-${e}`]:{color:`var(--q-color-on-${e}) !important`}});Object.keys(e).forEach(t)}}}),U=new i["a"](j),U.$mount(R()),{updateTheme(e){var t;null===(t=U)||void 0===t||t.setupTheme(e)}}),M=n("d710"),B=n.n(M),Q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{directives:[{name:"touch-pan",rawName:"v-touch-pan.prevent.mouse",value:e.handlePan,expression:"handlePan",modifiers:{prevent:!0,mouse:!0}}],ref:"card",staticClass:"overflow-hidden",staticStyle:{"max-width":"360px"},style:e.floatingStyle,attrs:{flat:e.inner,bordered:e.inner}},[n("q-card-section",{staticClass:"q-py-xs flex relative-position bg-primary text-primary"},[n("div",[e._v("Theme Editor")]),n("q-space"),e.inner?n("q-btn",{staticClass:"absolute-right",staticStyle:{width:"32px!important","border-radius":"0!important"},attrs:{size:"xs",icon:"open_in_new",flat:""},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},click:function(t){return e.$emit("show")}}}):e._e(),e.inner?e._e():n("q-btn",{staticClass:"absolute-right",staticStyle:{width:"32px!important","border-radius":"0!important"},attrs:{size:"xs",icon:"close",flat:""},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},click:function(t){return e.$emit("close")}}})],1),n("q-separator"),n("q-card-section",{staticClass:"q-py-xs"},e._l(e.currentColors,(function(t,o){return n("InputColor",{key:o,attrs:{label:o,value:t},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},input:function(t){return e.updateColor(o,t)}}})})),1),n("q-separator"),n("q-card-section",{staticClass:"q-pa-sm flex"},[n("q-space"),n("q-btn",{staticClass:"q-mx-xs",attrs:{label:"Reset",unelevated:"",color:"general","text-color":"general","no-caps":""},on:{touchstart:function(e){e.stopPropagation()},mousedown:function(e){e.stopPropagation()},click:e.reset}})],1)],1)},W=[],z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-input",{staticClass:"q-my-sm",attrs:{label:e.label,value:e.value,outlined:"",dense:"",readonly:""},on:{input:function(t){return e.$emit("input",t)}},scopedSlots:e._u([{key:"prepend",fn:function(){return[n("q-icon",{staticClass:"rounded-borders cursor-pointer",style:{backgroundColor:e.value,color:e.textColor,width:"32px",height:"32px",marginLeft:"-8px"},attrs:{name:"colorize"}},[n("q-popup-proxy",{attrs:{cover:"","transition-show":"scale","transition-hide":"scale"}},[n("q-color",{attrs:{value:e.value},on:{input:function(t){return e.$emit("input",t)}}})],1)],1)]},proxy:!0},{key:"after",fn:function(){return[n("div",{staticClass:"flex items-center full-height",staticStyle:{margin:"-4px -8px -4px -2px"}},[n("div",{staticClass:"rounded-borders q-mx-xs",style:{backgroundColor:e.value,color:e.ColorUtils.invokeTextColor(e.value),width:"40px",height:"40px"}}),n("div",{staticClass:"rounded-borders q-mx-xs",style:{backgroundColor:e.ColorUtils.invokeDarkenColor(e.value),color:e.ColorUtils.invokeTextColor(e.ColorUtils.invokeDarkenColor(e.value)),width:"40px",height:"40px"}})])]},proxy:!0}])})},H=[],V={name:"InputColor",props:{label:String,value:String},data(){return{ColorUtils:N}},computed:{textColor(){return N.invokeTextColor(this.value)}}},G=V,K=n("0e45"),Y=n("f106"),J=n("ff50"),X=n("4101"),Z=Object(g["a"])(G,z,H,!1,null,"30ed6541",null),ee=Z.exports;k()(Z,"components",{QInput:K["a"],QIcon:Y["a"],QPopupProxy:J["a"],QColor:X["a"]});let te=null;const ne={data(){return{floating$info:null,floating$size:null}},computed:{floatingStyle(){var e,t,n,o;if(this.inner)return{};const a={};this.floating$info?Object.assign(a,{x:this.floating$info.position.left,y:this.floating$info.position.top}):this.floating$size?Object.assign(a,{x:document.body.clientWidth/2-this.floating$size.width/2,y:document.body.clientHeight/2-this.floating$size.height/2}):Object.assign(a,{x:0,y:0});const s=8;return a.y=Math.max(s,Math.min(a.y,document.body.clientHeight-s-(null!==(e=null===(t=this.floating$size)||void 0===t?void 0:t.height)&&void 0!==e?e:0))),a.x=Math.max(s,Math.min(a.x,document.body.clientWidth-s-(null!==(n=null===(o=this.floating$size)||void 0===o?void 0:o.width)&&void 0!==n?n:0))),{position:"fixed",top:a.y+"px",left:a.x+"px"}}},mounted(){const{width:e,height:t}=getComputedStyle(this.$refs.card.$el),n=e=>parseInt(e.endsWith("px")?e.slice(0,e.length-2):e);this.floating$size={width:n(e),height:n(t)}},methods:{handlePan(e){if(!this.inner){if(this.floating$info=this.floating$info||{},e.isFirst){const e=e=>parseInt(e.endsWith("px")?e.slice(0,e.length-2):e),{top:t,left:n}=getComputedStyle(this.$refs.card.$el);Object.assign(this.floating$info,{from:{x:e(n),y:e(t)}})}else e.isFinal;Object.assign(this.floating$info,{position:{top:this.floating$info.from.y+e.offset.y,left:this.floating$info.from.x+e.offset.x}}),this.floating$info=Object.assign({},this.floating$info)}}}},oe={data(){return te=te||Object.assign({},this.$theme.getCurrentTheme()),{currentColors:te}},methods:{updateColor(e,t){this.currentColors[e]=t,this.$theme.updateTheme({[e]:t})},reset(){Object.assign(this.currentColors,this.$theme.getCurrentTheme()),this.$theme.updateTheme(this.currentColors)}}};var ae={name:"ThemeEditor",mixins:[ne,oe],components:{InputColor:ee},props:{inner:Boolean}},se=ae,ie=n("d7c7"),re=n("990e"),le=n("1043"),ce=n("fc38"),de=n("3a21"),ue=Object(g["a"])(se,Q,W,!1,null,null,null),he=ue.exports;let pe;k()(ue,"components",{QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QBtn:le["a"],QSeparator:ce["a"]}),k()(ue,"directives",{TouchPan:de["a"]});var me=({Vue:e})=>{e.component("ThemeEditor",he);let t=B.a.theme.color;const n=F(t);e.prototype.$theme={showFloatingEditor:_e,hideFloatingEditor:fe,hasFloatingEditor:()=>!!pe,updateTheme:e=>n.updateTheme(e),getCurrentTheme:()=>t}};function _e({onClose:e}={}){if(pe)return;const t=document.createElement("div");document.body.appendChild(t),pe=new i["a"]({render(t){return t("ThemeEditor",{ref:"editor",on:{close:()=>{fe(),null===e||void 0===e||e()}}})}}).$mount(t)}function fe(){pe&&(pe.$destroy(),pe.$el.remove(),pe=null)}n("f200"),n("d4b5"),n("7a76"),n("dc69"),n("0c26"),n("b37d");var ge=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",e._g({class:["icon","text"].includes(e.buttonType)?"bg-transparent":void 0,attrs:{"no-wrap":"","no-caps":e.noCaps,size:e.size,loading:e.loading,disable:e.value||e.loading,percentage:e.percentage,type:e.type,icon:e.icon,fab:["fab"].includes(e.buttonType),unelevated:!["fab","elevated"].includes(e.buttonType),dense:e.dense,round:["icon"].includes(e.buttonType),label:["icon"].includes(e.buttonType)?void 0:e.label,color:["icon","text"].includes(e.buttonType)?void 0:e.color,textColor:["general","primary","secondary","accent","positive","negative"].includes(e.color)?e.color:""},scopedSlots:e._u([{key:"loading",fn:function(){return[n("q-spinner")]},proxy:!0}])},Object.assign({},"button"===e.type?{click:e.handleButton}:{})),[e._t("default")],2)},be=[],ye={name:"AlphabizButton",props:{buttonType:{type:String,default:"filled"},color:{type:String,default:"general"},size:{type:String,default:"md"},noCaps:{type:Boolean,default:!1},icon:{type:String,default:void 0},dense:Boolean,label:{type:String,default:void 0},value:{type:Boolean,default:!1},immediate:{type:Boolean,default(){return!!this.onClick}},type:{type:String,default:"button"},onClick:{type:Function,default:void 0},timeout:{type:Object,default:void 0},onAnimationEnd:{type:Function,default:void 0}},data(){return{loading:!1,percentage:100,interval:null}},methods:{async handleButton(e){if(this.onClick)if(this.immediate)this.onClick(e);else try{await this.startLoading(this.onClick,e)}finally{await this.stopLoading()}else this.$emit("click",e)},async startLoading(e,...t){this.$emit("input",!0),this.loading=!0,await new Promise((e=>setTimeout(e,800)));const n=this.timeout?this.timerWrapper(e):e;await n(...t)},async stopLoading(){this.shutdownTimer(),this.timeout&&await new Promise((e=>setTimeout(e,1e3))),this.onAnimationEnd&&this.onAnimationEnd(),this.loading=!1,this.$emit("input",!1)},async startTimer(e,t){const n=100,o=Math.max(100,t/100),a=Math.max(1,Math.floor(o)/t*n);return this.percentage=e,await new Promise(((e,t)=>{const n=()=>{this.percentage=Math.max(0,Math.min(100,this.percentage+a)),this.percentage<100||(this.shutdownTimer(),t(new Error("Timeout")))};this.interval=setInterval(n,o)}))},shutdownTimer(){this.percentage=100,null!==this.interval&&(clearInterval(this.interval),this.interval=null)},timerWrapper(e){const{onTimeout:t,duration:n}=this.timeout;return async(...o)=>{let a;try{a=await Promise.race([this.startTimer(0,n),e(...o)]),this.shutdownTimer()}catch(s){if("Timeout"!==s.message)throw s;t&&t()}return a}}},beforeDestroy(){this.shutdownTimer()}},ve=ye,we=(n("c036"),n("53ef")),ke=Object(g["a"])(ve,ge,be,!1,null,null,null),Ce=ke.exports;k()(ke,"components",{QBtn:le["a"],QSpinner:we["a"]});var $e=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-select",e._g({ref:"select",staticClass:"alphabiz-select",attrs:{dense:"",outlined:"",behavior:"menu",options:e.optionsCpt,readonly:e.readonly,autofocus:e.autofocus,value:e.model,"option-label":e.selectLabelFn,label:e.label,"use-input":Boolean(e.filter),"input-debounce":"0","input-style":e.enableFilter?"":"display:none"},on:{input:e.handleInput,keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.pressEnter.apply(null,arguments)}},scopedSlots:e._u([{key:"no-option",fn:function(){return[n("q-item",[n("q-item-section",{staticClass:"text-grey"},[e._v("\n No results\n ")])],1)]},proxy:!0},e.model&&(e.model.icon||e.model.emoji)?{key:"prepend",fn:function(){return[e.model.icon?n("q-icon",{attrs:{name:e.model.icon}}):e.model.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(e.model.emoji))]):e._e()]},proxy:!0}:null,{key:"option",fn:function(t){var o=t.itemProps,a=t.itemEvents,s=t.opt;return[n("q-item",e._g(e._b({staticClass:"overflow-hidden-x",style:e.itemStyle},"q-item",o,!1),a),[s.icon||s.emoji?n("q-item-section",{staticStyle:{"margin-left":"-4px","margin-right":"-22px"},attrs:{avatar:""}},[s.icon?n("q-icon",{attrs:{name:s.icon}}):s.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(s.emoji))]):e._e()],1):e._e(),n("q-item-section",{staticStyle:{"margin-left":"-4px"}},[n("q-item-label",{domProps:{innerHTML:e._s(s.label)}})],1)],1)]}}],null,!0)},Object.assign({},e.filter?{"popup-show":e.onPopupShow,filter:e.filterFn,"popup-hide":e.onPopupHide}:{})))},Se=[],xe={name:"AlphabizSelect",props:{readonly:Boolean,autofocus:Boolean,options:Array,value:[Object,Function,Number,String,Boolean],label:String,itemMaxWidth:{type:String,default:void 0},itemMinWidth:{type:String,default:void 0},selectLabelFn:{type:Function,default:e=>e?e.label:()=>""},align:[Element,Boolean],filter:{type:Function,default:void 0}},data(){return{enableFilter:!1,filterValue:""}},computed:{optionsCpt(){const e=e=>{const t={};if("object"===typeof e)for(const[n,o]of Object.entries(e))"label"===n?t.label=(()=>e.label?"function"===typeof e.label?e.label(e.value):e.label:""+e.value)():t[n]=o;else t.value=e,t.label=e;return t},t=this.options.map(e);if(this.filter&&this.enableFilter){const e=e=>""===this.filterValue||this.filter(this.filterValue,e);return t.filter(e)}return t},model(){if(this.enableFilter)return null;{const e=this.optionsCpt.find((e=>e.value===this.value));if(e)return e;throw new Error("invalid alphabiz-select value: "+this.value)}},itemStyle(){const e={};if(this.align){const t="boolean"===typeof this.align?this.$el:this.align,{width:n}=getComputedStyle(t);e.width=n}return this.itemMinWidth&&(e.minWidth=this.itemMinWidth),this.itemMaxWidth&&(e.maxWidth=this.itemMaxWidth),e}},methods:{handleInput(e){e&&this.$emit("input",e.value)},filterFn(e,t){t((()=>{this.filterValue=e}))},onPopupShow(){this.filterValue="",this.enableFilter=!0,this.$nextTick((()=>{const e=this.$refs.select.$el.getElementsByTagName("input")[0];e.focus()}))},onPopupHide(){this.enableFilter=!1,this.filterValue=""},pressEnter(){this.filter&&(this.optionsCpt.length>0&&this.handleInput(this.optionsCpt[0]),this.enableFilter=!1,this.filterValue="",this.$nextTick((()=>{const e=this.$refs.select.$el.getElementsByTagName("input")[0];e.blur()})))}}},Te=xe,Ie=(n("9344"),n("a4ac")),Pe=n("b329"),Oe=n("25fb"),qe=n("79e0"),Ee=n("b121"),Ae=Object(g["a"])(Te,$e,Se,!1,null,null,null),De=Ae.exports;k()(Ae,"components",{QSelect:Ie["a"],QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QItemLabel:qe["a"],QField:Ee["a"]});var Ne=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"wrapper",staticClass:"virtual-scroll-grid-wrapper",on:{scroll:e.handleScroll}},[e._e(),n("div",{ref:"before",staticClass:"virtual-scroll-grid__before"},[e._t("before",null,null,e.getSlotContext())],2),n("div",{ref:"grid",staticClass:"virtual-scroll-grid"},[e._l(e.items,(function(t,n){return e._t("default",null,null,Object.assign(e.getSlotContext(),{item:t,index:e.virtual.from+n}))}))],2),n("div",{ref:"after",staticClass:"virtual-scroll-grid__after"},[e._t("after",null,null,e.getSlotContext())],2)])},Le=[],je=n("3387");const Re={data(){return{grid:{container_width:void 0,column:void 0,scroll_top:void 0},virtual:{enable:!0,from:0,to:0},go$observer:null,update_enable:!0}},methods:{vs$calc(){const e=this.$refs.wrapper,t=this.$refs.before,n=this.$refs.grid,o=e.clientHeight,a=e.scrollTop,s=t.offsetHeight,i=n.clientWidth,r=this.itemWidth+this.gutter,l=this.itemHeight+this.gutter,c=Math.max(1,Math.floor((i-this.gutter)/r)),d=Math.floor((i-c*r)/2);let u=0;u+=this.gutter/2,u+=s;const h=Math.max(0,Math.floor((a-u)/l)),p=h*c,m=a-u-h*l,_=Math.ceil((o+m)/l),f=p+_*c,g=Math.min(f,this.itemsSize),b=_+(f>this.itemsSize?-1:0),y=g-p,v=this.itemsSize%c,w=Math.ceil((this.itemsSize-g)/c);let k,C,$,S;if(this.virtual.enable){const e=Math.max(0,h-this.virtualScrollSliceRow),t=Math.max(0,w-this.virtualScrollSliceRow);k=e*l,C=t*l;let n=t*c;n&&v&&(n-=c-v),$=0+e*c,S=this.itemsSize-n}else k=0,C=0,$=0,S=this.itemsSize;return{wrapper:e,grid:n,scroll_top:a,column:c,padding:d,scroll_row_top:h,scope_from:p,scope_to:g,scope_row:b,scope_count:y,scope_mod:v,scroll_row_bottom:w,virtual_padding_top:k,virtual_padding_bottom:C,virtual_from:$,virtual_to:S}},vs$update2(){const{wrapper:e,grid:t,scroll_top:n,column:o,padding:a,scroll_row_top:s,scope_from:i,scope_to:r,scope_row:l,scope_count:c,scope_mod:d,scroll_row_bottom:u,virtual_padding_top:h,virtual_padding_bottom:p,virtual_from:m,virtual_to:_}=this.vs$calc(),f=([e,t])=>this.grid[e]===t||(this.grid[e]=t),g=([e,t])=>this.grid[e]===t||(this.grid[e]=t);Object.entries({scroll_top:n,column:o}).map(f),this.grid._padding!==a&&(this.grid._padding=a,e.style.setProperty("--virtual-scroll-grid-padding",`${a}px`)),Object.entries({scroll_row_top:s,scope_from:i,scope_to:r,scope_row:l,scope_count:c,scope_mod:d,scroll_row_bottom:u}).map(g);const b=0;(this.virtual.to-r<=b||i-this.virtual.from<=b)&&(this.virtual._virtual_padding_top!==h&&(this.virtual._virtual_padding_top=h,t.style.setProperty("--virtual-scroll-offset-top",`${h}px`)),this.virtual._virtual_padding_bottom!==p&&(this.virtual._virtual_padding_bottom=p,t.style.setProperty("--virtual-scroll-offset-bottom",`${p}px`)),this.virtual.from!==m&&(this.virtual.from=m),this.virtual.to!==_&&(this.virtual.to=_))},vs$update(e){const t=()=>{const e=this.$refs.wrapper,t=this.$refs.before,n=this.$refs.grid,o=e.clientHeight,a=e.scrollTop,s=t.offsetHeight,i=n.clientWidth,r=this.itemWidth+this.gutter,l=this.itemHeight+this.gutter;return{wrapper:e,before:t,grid:n,wrapper_height:o,scroll_top:a,before_height:s,grid_width:i,width_per_item:r,height_per_item:l}},n={on_measure:({grid_width:e,width_per_item:t})=>{const n=Math.max(1,Math.floor((e-this.gutter)/t)),o=Math.floor((e-n*t)/2);return{column:n,padding:o}},on_update:({wrapper:e,column:t,padding:n,scroll_top:o})=>{this.grid.scroll_top=o,this.grid.column=t,e.style.setProperty("--virtual-scroll-grid-padding",`${n}px`)}},o={on_measure:({scroll_top:e,height_per_item:t,wrapper_height:n,before_height:o,column:a})=>{let s=0;s+=this.gutter/2,s+=o;const i=Math.max(0,Math.floor((e-s)/t)),r=i*a,l=e-s-i*t,c=Math.ceil((n+l)/t),d=r+c*a,u=Math.min(d,this.itemsSize),h=c+(d>this.itemsSize?-1:0),p=u-r,m=this.itemsSize%a,_=Math.ceil((this.itemsSize-u)/a);return{scroll_row_top:i,scope_from:r,scope_to:u,scope_row:h,scope_count:p,scope_mod:m,scroll_row_bottom:_}},on_update:e=>{this.grid.scroll_row_top=e.scroll_row_top,this.grid.scope_from=e.scope_from,this.grid.scope_to=e.scope_to,this.grid.scope_row=e.scope_row,this.grid.scope_count=e.scope_count,this.grid.scope_mod=e.scope_mod,this.grid.scroll_row_bottom=e.scroll_row_bottom}},a={on_measure:({scroll_row_top:e,scroll_row_bottom:t,height_per_item:n,column:o,scope_mod:a})=>{if(!this.virtual.enable)return{virtual_padding_top:0,virtual_padding_bottom:0,virtual_from:0,virtual_to:this.itemsSize};e=Math.max(0,e-this.virtualScrollSliceRow),t=Math.max(0,t-this.virtualScrollSliceRow);const s=e*n,i=t*n;let r=t*o;r&&a&&(r-=o-a);const l=0+e*o,c=this.itemsSize-r;return{virtual_padding_top:s,virtual_padding_bottom:i,virtual_from:l,virtual_to:c}},on_update:({grid:e,virtual_padding_top:t,virtual_padding_bottom:n,virtual_from:o,virtual_to:a})=>{e.style.setProperty("--virtual-scroll-offset-top",`${t}px`),e.style.setProperty("--virtual-scroll-offset-bottom",`${n}px`),this.virtual.padding_top=t,this.virtual.padding_bottom=n,this.virtual.from=o,this.virtual.to=a}},s={update_rect:n,update_grid:o,update_virtual:a};e||(e=Object.keys(s));const i=t();i&&(e.forEach((e=>{s[e]&&Object.assign(i,s[e].on_measure(i))})),e.forEach((e=>{s[e]&&s[e].on_update(i)})))},scrollTo(e){this.$refs.wrapper.scrollTop=e}},activated(){this.grid.scroll_top&&this.scrollTo(this.grid.scroll_top),this.update_enable=!0},deactivated(){this.update_enable=!1},mounted(){const e=this.vs$update2,t=Object(je["debounce"])((()=>e.call(this)),!0===this.$q.platform.is.ios?120:35,{trailing:!0});this.vs$update=(n,o)=>{this.update_enable&&(o?t.call(this):e.call(this))};const n=this.$refs.wrapper;this.$watch("gutter",(()=>{n.style.setProperty("--virtual-scroll-grid-gutter",`${this.gutter}px`)}),{immediate:!0}),this.$watch("itemWidth",(()=>{n.style.setProperty("--virtual-scroll-grid-item-width",`${this.itemWidth}px`)}),{immediate:!0}),this.$watch("itemHeight",(()=>{n.style.setProperty("--virtual-scroll-grid-item-height",`${this.itemHeight}px`)}),{immediate:!0}),this.go$observer=new ResizeObserver((()=>this.vs$update("go$observer"))),this.go$observer.observe(this.$refs.grid);const o=["gutter","itemsSize","virtualScrollSliceRow","itemWidth","itemHeight"];this.$watch((()=>o.reduce(((e,t)=>({...e,[t]:this[t]})),{})),(()=>this.vs$update("watcher")))},beforeUnmount(){this.go$observer.disconnect()}};var Ue={name:"VirtualScrollGrid",mixins:[Re],props:{virtualScrollSliceRow:{type:Number,default:30},itemWidth:Number,itemHeight:Number,gutter:{type:Number,default:16},itemsSize:Number,itemsFn:Function},data(){return{items:[]}},methods:{getSlotContext(){return{column:this.grid.column,mod:this.grid.scope_mod,virtual:this.virtual,grid:this.grid}},handleScroll(...e){this.vs$update("scroll",!0),this.$emit("scroll",...e),this.$emit("virtual-scroll",{from:this.virtual.from,to:this.virtual.to})}},mounted(){let e=!0;this.$watch((()=>(e&&(e=!1,this.vs$update("item_init")),this.itemsFn(this.virtual.from,this.virtual.to))),(e=>{this.items=e}),{immediate:!0})}},Fe=Ue,Me=(n("06cd"),Object(g["a"])(Fe,Ne,Le,!1,null,null,null)),Be=Me.exports,Qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{ref:"dialog",attrs:{"no-shake":"","content-class":{"fullscreen-dialog":!e.progress},persistent:!0,position:e.screen$xs&&!e.progress?"bottom":"standard"},on:{hide:function(t){return e.$emit("hide")},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.handleEsc.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleEnter.apply(null,arguments)}]}},[n("q-card",{staticClass:"column",style:{position:"relative",minWidth:e.title||e.showActions?"320px":void 0,maxWidth:"400px",maxHeight:"calc(100vh - 64px)"}},[e.title?n("q-card-section",{staticClass:"q-px-md q-pb-none",style:{paddingTop:"20px"}},[e.title?n("div",{staticClass:"text-h6 text-weight-bold non-selectable"},[e._v("\n "+e._s(e.title)+"\n ")]):e._e()]):e._e(),e.message?[n("q-card-section",{staticClass:"q-pb-none"},[n("div",{staticStyle:{"white-space":"pre-line"}},[e._v(e._s(e.message))])])]:e._e(),n("DialogBanner",{attrs:{banner:e.banner}}),n("DialogProgress",{attrs:{progress:e.progress}}),n("DialogList",{attrs:{list:e.list}}),n("DialogOption",{attrs:{options:e.options},on:{registerArgument:e.dialog$registerArgument,setValid:e.dialog$setValid}}),n("DialogPrompts",{attrs:{prompts:e.prompts},on:{registerArgument:e.dialog$registerArgument,setValid:e.dialog$setValid}}),e.showActions?n("q-card-actions",{staticClass:"q-px-md q-py-md",attrs:{vertical:""}},e._l(e.buttonAttrs,(function(t,o){return n("q-btn",e._g(e._b({directives:[{name:"show",rawName:"v-show",value:t.show,expression:"attrs.show"}],key:o,on:{keydown:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;t.stopPropagation()}}},"q-btn",t.props,!1),t.event))})),1):e._e()],2)],1)},We=[],ze={data(){return{dialog$validResults:{}}},computed:{dialog$validResult(){const e=Object.values(this.dialog$validResults).find((e=>!0!==e));return e||!0}},methods:{dialog$setValid(e,t){this.dialog$validResults={...this.dialog$validResults,[e]:t}}}},He={data(){return{dialog$argumentGetters:{}}},methods:{dialog$arguments(){const e=Object.keys(this.dialog$argumentGetters).reduce(((e,t)=>(e[t]=this.dialog$argumentGetters[t](this),e)),{});return e},dialog$registerArgument(e,t){this.dialog$argumentGetters[e]=t}}},Ve={data(){return{loadingState:null}},methods:{async dialog$useLoadingState(e,t){let n;try{this.loadingState=e;const o=t(this);n=o.then?await o:o}finally{this.loadingState=null}return n}}},Ge={methods:{dialog$buttonObject(e,t){if(!1===t)return null;const n={color:"general",textColor:"general",label:this.$t(e)},o={};return Object.assign(o,n),"object"===typeof t&&(Object.assign(o,t),"function"===typeof t.label&&(o.label=t.label()),"function"===typeof t.disable&&(o.disable=t.disable())),"function"===typeof t&&(o.handler=t.bind(this)),"string"===typeof t&&(o.label=t),o},async dialog$buttonHandler(e,t){if(!e)return;const n=e.handler;try{if(n){const e=n(this);e&&e.then&&await e}else t&&t()}catch(o){this.$emit("error",o)}},dialog$buttonAttrs(e,t,n){if(!t)return{show:!1};const o={noCaps:!0,noWrap:!0,unelevated:!0};return Object.assign(o,t),o.loading=this.loadingState===e||t.loading,o.disable=!!this.loadingState||t.disable,{show:!!t,props:o,event:{click:n}}}}},Ke={props:{actions:Object},computed:{dialog$actionButtons(){return this.actions?Object.keys(this.actions).reduce(((e,t)=>(e[t]=this.dialog$buttonObject(t,this.actions[t]),e)),{}):null},dialog$actionHandlers(){return this.actions?Object.keys(this.actions).reduce(((e,t)=>(e[t]=()=>this.dialog$buttonHandler(this.dialog$actionButtons[t]),e)),{}):null}}},Ye={props:{ok:{type:[Boolean,String,Function,Object],default:!0},cancel:{type:[Boolean,String,Function,Object],default:!1}},computed:{buttonOk(){const e=this.dialog$buttonObject("ok",this.ok);return e?(e.disable||(e.disable=!0!==this.dialog$validResult),e):e},buttonCancel(){return this.dialog$buttonObject("cancel",this.cancel)}},methods:{async handleOk(){await this.dialog$buttonHandler(this.buttonOk,(()=>{this.emitOk(this.dialog$arguments()),this.hide()}))},async handleCancel(){await this.dialog$buttonHandler(this.buttonCancel,(()=>{this.hide()}))}}},Je=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.banner?n("q-card-section",{staticClass:"q-pb-none overflow-hidden"},[n("q-banner",{staticClass:"bg-general text-general rounded-borders",scopedSlots:e._u([e.objectBanner.avatar?{key:"avatar",fn:function(){return[n("div",{staticClass:"flex items-center",staticStyle:{height:"40px"}},["loading"===e.objectBanner.avatar?n("q-spinner-ios",{staticStyle:{margin:"0.275rem"},attrs:{size:"1.2rem",color:"general"}}):n("q-icon",{attrs:{size:"1.75rem",name:e.objectBanner.avatar}})],1)]},proxy:!0}:null,{key:"default",fn:function(){return[e.objectBanner.title?n("div",{staticClass:"text-bold"},[e._v("\n "+e._s(e.objectBanner.title)+"\n ")]):e._e(),n("div",{staticClass:"ellipsis-3-lines"},[e._v(e._s(e.objectBanner.message))])]},proxy:!0}],null,!0)})],1):e._e()},Xe=[],Ze={name:"DialogBanner",props:{banner:[String,Object]},computed:{objectBanner(){return this.banner?"string"===typeof this.banner?{message:this.banner}:this.banner:null}}},et=Ze,tt=n("0051"),nt=n("7027"),ot=Object(g["a"])(et,Je,Xe,!1,null,null,null),at=ot.exports;k()(ot,"components",{QCardSection:ie["a"],QBanner:tt["a"],QSpinnerIos:nt["a"],QIcon:Y["a"]});var st=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.progress?n("q-card-section",{staticClass:"q-pb-md flex justify-center items-center"},[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),"boolean"!==typeof e.progress?n("div",{staticClass:"q-ml-sm"},["string"===typeof e.progress?[e._v("\n "+e._s(e.progress)+"\n ")]:[n("div",[e._v(e._s(e.progress.title))]),e.progress.caption?n("div",[e._v(e._s(e.progress.caption))]):e._e()]],2):e._e()],1):e._e()},it=[],rt={name:"DialogProgress",props:{progress:[Boolean,String,Object]}},lt=rt,ct=Object(g["a"])(lt,st,it,!1,null,"c513ce1e",null),dt=ct.exports;k()(ct,"components",{QCardSection:ie["a"],QSpinnerIos:nt["a"]});var ut=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.list?n("q-card-section",{staticClass:"q-pb-none"},[n("q-list",{staticClass:"rounded-borders full-width column items-stretch",attrs:{bordered:"",separator:""}},e._l(e.list.items,(function(t,o){return n("q-item",{key:t.key||o,staticClass:"overflow-hidden"},[n("q-item-section",[n("q-item-label",{staticClass:"ellipsis"},[e._v(e._s(t.label))]),t.caption?n("q-item-label",{staticClass:"ellipsis-3-lines",attrs:{caption:""}},[e._v(e._s(t.caption))]):e._e()],1)],1)})),1)],1):e._e()},ht=[],pt={name:"DialogList",props:{list:Object}},mt=pt,_t=n("e7c2"),ft=Object(g["a"])(mt,ut,ht,!1,null,"18c77b6c",null),gt=ft.exports;k()(ft,"components",{QCardSection:ie["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"]});var bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.modelOptions?n("q-card-section",{staticClass:"q-pb-none"},[n("q-option-group",{staticClass:"dialog-option-group",attrs:{options:e.modelOptions.items,type:e.modelOptions.type||"radio"},scopedSlots:e._u([{key:"label",fn:function(t){var o=t.label,a=t.desc,s=t.tooltip;return[n("q-item",{staticClass:"q-pl-xs q-pr-none non-selectable"},[n("q-item-section",[n("q-item-label",[e._v(e._s(o))]),a?n("q-item-label",{staticClass:"ellipsis",attrs:{caption:""}},[e._v(e._s(a))]):e._e()],1),s?n("q-tooltip",{attrs:{"max-width":"320px",anchor:"bottom middle",self:"top middle","transition-show":"jump-down","transition-hide":"jump-up","transition-duration":0,delay:600}},[n("span",{staticStyle:{"font-size":"0.8rem"}},[e._v(e._s(s))])]):e._e()],1)]}}],null,!1,3266841923),model:{value:e.modelOptions.model,callback:function(t){e.$set(e.modelOptions,"model",t)},expression:"modelOptions.model"}})],1):e._e()},yt=[],vt={name:"DialogOption",props:{options:Object},data(){return{modelOptions:this.options}},computed:{validatedResult(){const e=this.modelOptions.items.find((e=>e.value===this.modelOptions.model));return e?!e.disable||"disabled_option_item":"option_item_not_found"}},beforeMount(){this.modelOptions&&(this.$emit("registerArgument","option",(()=>this.modelOptions.model)),this.$watch("validatedResult",(e=>{this.$emit("setValid","option",e)}),{immediate:!0}))}},wt=vt,kt=(n("030c"),n("8128")),Ct=n("cf25"),$t=n("2b77"),St=Object(g["a"])(wt,bt,yt,!1,null,null,null),xt=St.exports;k()(St,"components",{QCardSection:ie["a"],QOptionGroup:kt["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"],QTooltip:Ct["a"],QRadio:$t["a"]});var Tt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.modelPrompts?n("q-card-section",{staticClass:"q-pb-none"},[e._l(e.modelPrompts,(function(t){return["tel"===t.type?n("DialogPromptTel",{key:t.key,staticClass:"q-my-sm",attrs:{rules:t.rules||void 0},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"prompt.model"}}):n("q-input",{key:t.key,staticClass:"q-my-sm",attrs:{type:"password"!==t.type?t.type:t.hidden?"password":"text",label:t.label,rules:t.rules||void 0,outlined:"",dense:"",autofocus:""},scopedSlots:e._u([{key:"prepend",fn:function(){return[t.icon&&"tel"!==t.type?n("q-icon",{attrs:{name:t.icon}}):e._e()]},proxy:!0},void 0!==t.hidden?{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:t.hidden?"visibility_off":"visibility"},on:{click:function(e){t.hidden=!t.hidden}}})]},proxy:!0}:null],null,!0),model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"prompt.model"}})]}))],2):e._e()},It=[],Pt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("TelInput",{attrs:{"error-message":e.errorMessage},on:{setNotSay:e.setNotSay},scopedSlots:e._u([{key:"selector",fn:function(){return[n("TelSelector",{model:{value:e.selectedOption,callback:function(t){e.selectedOption=t},expression:"selectedOption"}})]},proxy:!0},e.selectedOption.prefixCode?{key:"prefix-code",fn:function(){return[e._v("\n +"+e._s(e.selectedOption.prefixCode)+"\n ")]},proxy:!0}:null],null,!0),model:{value:e.inputValue,callback:function(t){e.inputValue=t},expression:"inputValue"}})},Ot=[],qt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-input",{staticClass:"dialog-prompt-tel",attrs:{outlined:"",dense:"",autofocus:"",type:"tel",value:e.value,error:!!e.errorMessage,"error-message":e.errorMessage},on:{input:function(t){return e.$emit("input",t)},keydown:function(t){if(!t.type.indexOf("key")&&8!==t.keyCode)return null;0===e.value.length&&e.$emit("setNotSay")}},scopedSlots:e._u([{key:"before",fn:function(){return[e._t("selector")]},proxy:!0},{key:"prepend",fn:function(){return[e.$slots["prefix-code"]?n("div",{staticClass:"non-selectable",style:e.prefixCodeStyle},[e._t("prefix-code")],2):e._e()]},proxy:!0}],null,!0)})},Et=[];const At={data(){return{prefixCodeStyle:{padding:"6px 0",fontSize:"14px",fontWeight:"400",letterSpacing:"0.00937em",lineHeight:"28px"}}}};var Dt={name:"TelInput",mixins:[At],props:{value:String,errorMessage:String}},Nt=Dt,Lt=(n("0102"),Object(g["a"])(Nt,qt,Et,!1,null,null,null)),jt=Lt.exports;k()(Lt,"components",{QInput:K["a"],QField:Ee["a"]});var Rt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-select",e._g(e._b({attrs:{dense:"",outlined:"",behavior:"menu",options:e.prefixOptions,"option-label":function(){return""},"menu-offset":[0,4],"menu-self":"bottom start","menu-anchor":"top left","transition-show":"jump-down","transition-hide":"jump-up"},scopedSlots:e._u([{key:"no-option",fn:function(){return[n("q-item",{staticClass:"non-selectable",style:e.noOptionStyle},[n("q-item-section",{staticClass:"text-grey"},[e._v("\n No results\n ")])],1)]},proxy:!0},{key:"prepend",fn:function(){return[n("div",{staticClass:"non-selectable",style:e.emojiStyle},[e._v(e._s(e.emoji))])]},proxy:!0},{key:"option",fn:function(t){var o=t.itemProps,a=t.itemEvents,s=t.opt;return[n("q-item",e._g(e._b({staticClass:"overflow-hidden-x non-selectable",style:e.optionStyle},"q-item",o,!1),a),[s.emoji?n("q-item-section",{staticStyle:{"margin-left":"-4px","margin-right":"-22px"},attrs:{avatar:""}},[n("div",{style:e.emojiStyle},[e._v(e._s(s.emoji))])]):e._e(),n("q-item-section",{staticStyle:{"margin-left":"-4px"}},[n("q-item-label",{domProps:{innerHTML:e._s("not_say"===s.label?e.$t("account_not_say"):s.label)}})],1)],1)]}}]),model:{value:e.prefixModel,callback:function(t){e.prefixModel=t},expression:"prefixModel"}},"q-select",e.filterProps,!1),e.filterEvents))},Ut=[],Ft=n("1c53");const Mt=(()=>{const e={TW:e=>{"TW"===e.country_code&&(e.emoji="🇼🇫")}},t=[];return Object.entries(Ft["countries"]).forEach((([n,o])=>{const a={country_code:n,name:o.name,name_native:o.native,emoji:o.emoji,phone_list:o.phone.split(","),language_list:o.languages};e.TW(a),t.push(a)})),t})(),Bt=(()=>{const e=[];return Mt.forEach((t=>{t.phone_list.forEach((n=>{const o={id:`${t.country_code}-${n}`,country_emoji:t.emoji,country_name:t.name,country_name_native:t.name_native,country_code:t.country_code,phone_number_code:n};e.push(o)}))})),e})(),Qt=(()=>{const e={US:(e,t)=>{if("1"===e.phone_number_code)return"US"===e.country_code?-1:"US"===t.country_code?1:0}},t=(t,n)=>{const o=parseInt(t.phone_number_code),a=parseInt(n.phone_number_code);if(o!==a)return o>a?1:-1;let s;return Object.values(e).some((e=>(s=e(t,n),void 0!==s))),void 0===s?0:s},n=Bt.sort(t);return n})(),Wt=Qt.reduce(((e,t)=>(e[t.id]=t,e)),{}),zt={value:"not_say",label:"not_say",emoji:"🇼🇫"},Ht=(()=>{const e=Object.values(Wt).map((e=>({value:e.id,label:`${e.country_name_native} (+${e.phone_number_code})`,emoji:e.country_emoji})));return e.unshift(zt),e})(),Vt=e=>e===zt.value?zt:Wt[e],Gt=e=>{const t=e.startsWith("+"),n=/^00/.test(e);let o=null,a=null,s=e;return t?Object.values(Wt).find((t=>{const n=`+${t.phone_number_code}`;return!!e.startsWith(n)&&(s=e.substr(n.length),o=t.country_code,a=t.phone_number_code,!0)})):n&&Object.values(Wt).find((t=>{const n=`00${t.phone_number_code}`;return!!e.startsWith(n)&&(s=e.substr(n.length),o=t.country_code,a=t.phone_number_code,!0)})),{countryCode:o,prefixCode:a,phoneNumber:s}},Kt={data(){return{emojiStyle:{fontFamily:"Noto Color Emoji",fontSize:"1.22rem",color:"#000"}}}},Yt={data(){const e={getInputEl:()=>this.$parent.$parent.$el,observer:new ResizeObserver((()=>{const e=this.mixin$OptionsStyle.getInputEl(),{width:t}=getComputedStyle(e);this.optionStyle={width:`calc(${t} - 8px)`},this.noOptionStyle={width:t}}))};return{mixin$OptionsStyle:e,optionStyle:{},noOptionStyle:{}}},mounted(){this.mixin$OptionsStyle.observer.observe(this.mixin$OptionsStyle.getInputEl())},beforeDestroy(){this.mixin$OptionsStyle.observer.unobserve(this.mixin$OptionsStyle.getInputEl())}},Jt={data(){return{isPopupShow:!1,filter:null}},computed:{filterProps(){return{useInput:!0,inputDebounce:"0",inputStyle:this.isPopupShow?void 0:"display:none"}},filterEvents(){return{"popup-show":this.onPopupShow.bind(this),filter:this.onFilter.bind(this),"popup-hide":this.onPopupHide.bind(this)}}},methods:{onFilter(e,t){t((()=>{this.filter=t=>{if(!e)return!0;if("not_say"===t)return!1;const n=Vt(t),o=[n.country_code,n.country_name,n.country_name_native,n.phone_number_code];return o.some((t=>t.toLowerCase().includes(e.toLowerCase())))}}))},onPopupShow(){this.isPopupShow=!0,this.$nextTick((()=>{const e=this.$el.getElementsByTagName("input")[0];e.focus()}))},onPopupHide(){this.isPopupShow=!1,this.filter=null,this.mixin$OptionsStyle.getInputEl().focus()}}};var Xt={name:"TelSelector",mixins:[Kt,Yt,Jt],props:{value:Object},data(){return{countryCode:null,prefixCode:null}},computed:{prefixOptions(){let e=Object.assign([],Ht);return this.filter&&(e=e.filter((e=>this.filter(e.value)))),e},prefixModel:{get(){const{countryCode:e,prefixCode:t}=this.value;return e&&t?`${e}-${t}`:"not_say"},set(e){var t,n;const o=null!==e&&void 0!==e&&e.value?Vt(e.value):{};this.$emit("input",{countryCode:null!==(t=o.country_code)&&void 0!==t?t:null,prefixCode:null!==(n=o.phone_number_code)&&void 0!==n?n:null})}},emoji(){const e=Vt(this.prefixModel);return e.emoji||e.country_emoji}}},Zt=Xt,en=(n("3a211"),Object(g["a"])(Zt,Rt,Ut,!1,null,null,null)),tn=en.exports;k()(en,"components",{QSelect:Ie["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"]});const nn={watch:{selectedOption(e,t){const n=e=>!(e.countryCode&&e.prefixCode);n(e)&&!n(t)&&(this.inputValue="")}},methods:{setNotSay(){this.selectedOption={countryCode:null,prefixCode:null}}}},on={data(){return{errorMessage:void 0}},watch:{value(e){const t=e=>{let t;return this.rules.find((n=>(t=n(e),t&&!0!==t))),!0===t?void 0:t},n=t(e.phoneNumber);n?this.errorMessage=n:e.phoneNumber&&!e.prefixCode?this.errorMessage=this.$t("account_error_invalid_phone_number_format"):this.errorMessage=void 0}}};var an={name:"DialogPromptTel",mixins:[nn,on],props:{value:{type:Object,required:!0},rules:Array},components:{TelInput:jt,TelSelector:tn},computed:{selectedOption:{get(){return{countryCode:this.value.countryCode,prefixCode:this.value.prefixCode}},set(e){this.$emit("input",{prefixCode:e.prefixCode,countryCode:e.countryCode,phoneNumber:this.value.phoneNumber})}},inputValue:{get(){return this.value.phoneNumber},set(e){const{prefixCode:t,countryCode:n,phoneNumber:o}=Gt(e);this.$emit("input",{prefixCode:t||this.value.prefixCode,countryCode:n||this.value.countryCode,phoneNumber:o})}}}},sn=an,rn=Object(g["a"])(sn,Pt,Ot,!1,null,null,null),ln=rn.exports,cn={name:"DialogPrompts",components:{DialogPromptTel:ln},props:{prompts:Object},data(){const e=this.prompts?Object.keys(this.prompts).map((e=>{const t=this.prompts[e];return t.key=e,"password"===t.type&&(t.hidden=!0),t})):null;return{modelPrompts:e}},computed:{validatedResult(){let e;return this.modelPrompts&&this.modelPrompts.filter((e=>!!e.rules)).find((t=>t.rules.some((n=>{const o="tel"===t.type?[t.model.phoneNumber,t.model.prefixCode]:[t.model],a=n(...o);return!0!==a&&(e=a),!!e})))),e=e||!0,e}},watch:{validatedResult(e){this.$emit("setValid","prompts",e)}},beforeMount(){if(this.modelPrompts){const e=()=>this.modelPrompts.reduce(((e,t)=>(e[t.key]=t.model,e)),{});this.$emit("registerArgument","prompts",e),this.$emit("setValid","prompts",this.validatedResult)}}},dn=cn,un=Object(g["a"])(dn,Tt,It,!1,null,"21114862",null),hn=un.exports;k()(un,"components",{QCardSection:ie["a"],QInput:K["a"],QIcon:Y["a"]});const pn={methods:{handleEsc(){const e="cancel";if(!this.buttonAttrs[e])return;const t=this.buttonAttrs[e];!t.show||t.props.disable||t.props.loading||t.event.click()},handleEnter(){const e="ok";if(!this.buttonAttrs[e])return;const t=this.buttonAttrs[e];!t.show||t.props.disable||t.props.loading||t.event.click()}}},mn={props:{contextCallback:Function},created(){this.contextCallback&&this.contextCallback(this)}},_n=e=>({props:e.reduce(((e,t)=>Object.assign(e,t.props)),{})}),fn={name:"ABDialog",components:{DialogBanner:at,DialogProgress:dt,DialogList:gt,DialogOption:xt,DialogPrompts:hn},mixins:[pn,mn,ze,He,Ve,Ge,Ke,Ye,_n([at,dt,gt,xt,hn])],props:{title:String,message:String},computed:{showActions(){return this.buttonAttrs&&Object.values(this.buttonAttrs).some((e=>!1!==e.show))},buttonAttrs(){const e=this.dialog$actionButtons?Object.keys(this.dialog$actionButtons).reduce(((e,t)=>(e[t]=[this.dialog$actionButtons[t],this.dialog$actionHandlers[t]],e)),{}):{},t={ok:[this.buttonOk,this.handleOk],...e,cancel:[this.buttonCancel,this.handleCancel]};return Object.keys(t).reduce(((e,n)=>(e[n]=this.dialog$buttonAttrs(n,...t[n]),e)),{})}},methods:{show(){this.$refs.dialog.show()},emitOk(e){this.$emit("ok",e)},hide(){this.$refs.dialog.hide()}}};var gn=fn,bn=gn,yn=n("59ba"),vn=Object(g["a"])(bn,Qe,We,!1,null,null,null),wn=vn.exports;k()(vn,"components",{QDialog:y["a"],QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QCardActions:yn["a"],QBtn:le["a"]});var kn=e=>{e.component("ABDialog",wn),Object.defineProperty(e.prototype,"$alphabiz",{get(){const e={};return e.dialog=e=>Cn.call(this,e),e}})};function Cn(e){const t={},n={};Object.assign(n,e),n.component=wn,n.contextCallback=e=>t.vm=e,t.dialog=this.$q.dialog(n),t.dialog.vm=t.vm;const o=e=>{e.promise=t=>new Promise(((n,o)=>{if(e.vm.$on("error",o),t){if("cancel"===t){let t=!1;e.onCancel((()=>t=!0)).onDismiss((()=>n(t)))}else if("ok"===t){let t;e.onOk((e=>e&&(t=e))).onDismiss((()=>n(t)))}}else e.onDismiss(n)}))};return o(t.dialog),t.dialog}var $n=n("bf73"),Sn=n.n($n),xn=n("d310"),Tn=n("3fd2"),In=n.n(Tn);function Pn(e){e.directive("show$cfg",On())}function On(){const e=(e,t,n)=>{const o=n.componentInstance.d$cfg,a=[t.arg,...Object.keys(t.modifiers||{})];let s=a.reduce(((e,t)=>e[t]),o);s=void 0===t.value?s:t.value===s,e.style.display=s?e._cfg$show.display:"none"};return{bind(t,n,o){t._cfg$show={display:t.style.display},e(t,n,o)},update(t,n,o){e(t,n,o)},unbind(e){e.style.display=e._cfg$show.display,delete e._cfg$show}}}var qn=n("0f0c"),En=n("d558"),An=(n("908d"),function(e,{getLocalConfig:t,getRemoteConfigUrl:n}){const o=jn(),{config:a,loadRemoteConfig:s}=Dn({localConfig:t(),remoteConfigUrls:i(n())});function i(e){const t=[`/${o.version}.json`,`/${o.version.split("-")[0]}.json`,"/default.json"];return t.map((t=>e+t))}function r(e,t){const n=new e({data(){return{config:t}}});e.mixin({computed:{d$cfg(){return n.config}}}),Pn(e)}s((e=>{In.a.mas()&&Nn(e.config,{update:{enable:!1}})})),r(e,a)});function Dn(e){const{localConfig:t,remoteConfigUrls:n}=e,o=Nn({},t);let a;o.remoteLoaded=!1,Object.defineProperties(o,{onRemoteConfigLoaded:{value:new Promise((e=>a=e)),configurable:!1,writable:!1,enumerable:!1}});const s=async e=>{const t=await i(n),{config:s}=t;return s.remoteLoaded=!0,await e(t),Nn(o,s),a(t),t};return{config:o,loadRemoteConfig:s};async function i(e){console.log("get from urls",e);const t=[];t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("sources").log(e)));const n=await new Promise((async n=>{let a={},s=null;for(const i of e)try{a=await o(i),s=i;break}catch{t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("not found").log(i)))}s?t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("got").log(s,a))):t.push((()=>console.tag.orange("DynamicConfig","Remote").tag("remote config not found").log())),n({url:s,config:a})}));return console.tag.orange("DynamicConfig","Remote").group(""),t.forEach((e=>e())),console.groupEnd(),n;async function o(e){return await Ln((()=>fetch(e).then((e=>e.json()))),{onRetry(e){console.tag("getRemoteConfig").log("retry",e.count)}})}}}function Nn(e,t){const n=e=>!!e&&"object"===typeof e&&!Array.isArray(e);return Object.entries(t).forEach((([t,o])=>{var a;n(o)?(e[t]=null!==(a=e[t])&&void 0!==a?a:{},Nn(e[t],o)):e[t]=o})),e}async function Ln(e,{onRetry:t}={}){const n=async o=>{try{return o.count&&await(null===t||void 0===t?void 0:t(o)),await e()}catch(a){if(a instanceof TypeError){if(await new Promise((e=>setTimeout(e,1e3))),o.count+=1,o.count>=30)throw a;return await n(o)}throw a}};return await n({count:0})}function jn(){const e={version:Object(qn["a"])("version"),buildTime:Object(qn["a"])("buildTime")};return e.web=(()=>{try{return"web"===e.version.split("-")[1]}catch{return!1}})(),e.store=(()=>{const e=Object(qn["a"])("packageFormat");return Object(En["a"])()?"capacitor":In.a.mas()?"mac":In.a.windowsStore()?"microsoft":!(!e||"snap"!==e)&&"linux"})(),e}var Rn=e=>{},Un=n("67cf"),Fn=n("eb7a");n("f18a"),n("dc89"),n("2425"),n("7996");const Mn=(...e)=>console.tag.red("VideoJs","player",...e),Bn={Video:{opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",webm:"video/webm",flv:"video/x-flv","3gp":"video/3gpp",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",avi:"video/x-msvideo"},Image:{jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Audio:{m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav"}},Qn=(Bn.Video,Bn.Audio,Bn.Image,{mkv:["video/webm","video/mp4"],avi:["video/mp4"]}),Wn={MEDIA_ERR_ABORTED:1,MEDIA_ERR_CUSTOM:0,MEDIA_ERR_DECODE:3,MEDIA_ERR_ENCRYPTED:5,MEDIA_ERR_NETWORK:2,MEDIA_ERR_SRC_NOT_SUPPORTED:4};var zn=[Hn(),Kn({volume:ao},{setVolume:_o}),Kn({isFullscreen:oo},{setFullscreen:mo}),Kn({isPiP:no},{setPiP:po}),Kn({playbackRate:to},{setPlaybackRate:ho}),Kn({poster:eo},{setPoster:co}),Vn(),Gn()];function Hn(){const e={id:Yn,currentTime:Jn,buffered:Zn,duration:Xn,isPaused:so,isMuted:io},t={play:ro,pause:lo,seek:uo,mute:fo,stop:go,destroy:bo,ctl$on:n,ctl$emit:o};return Kn(e,t);function n(e,t){this.on(`controller::${e}`,t)}function o(e){this.trigger(`controller::${e}`)}}function Vn(){return Kn({isWaiting:n,currentSources:e,loadingState:t},{setSource:o});function e(){const e=()=>{const e=this.currentSources();return e.filter((e=>!!e.src&&!!e.type))};return this.$set(e,["setSource$start","setSource$end","stop$"]),e()}function t(){const e=e=>{if(!e)return!1;if("setSource$start"===e)return!0;if(["setSource$end","error"].includes(e)){const e=this.error();return!!e&&{type:Object.keys(Wn).find((t=>Wn[t]===e.code)),message:e.message}}};return this.$set(e,["setSource$start","setSource$end","error","stop$"]),e()}function n(){let e=null;return this.on("waiting",(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.$set(!0)}),100)})),this.on("canplay",(()=>{e&&clearTimeout(e),this.$set(!1)})),this.on("stop$",(()=>{e&&clearTimeout(e),this.$set(!1)})),!1}async function o(...e){const t=e[e.length-1];t instanceof AbortSignal&&e.splice(e.length-1);const n=t instanceof AbortSignal?t:(new AbortController).signal;let o=!1;n.onabort=()=>{o=!0};try{this.trigger("setSource$start"),await new Promise(((t,s)=>{this.ready((()=>{if(o||n.aborted)return console.log("setSource Aborted",n.reason),s("Aborted");console.log("Not aborted",o,n,e[0]),this.one("loadedmetadata",t),this.one("error",s);const i=e.map(a).flat(1);Mn().tag("setSource","sources").log(i),this.src(i)}))}))}finally{this.trigger("setSource$end")}function a(e){var t;const n=[];let o,a;if("object"===typeof e){var s;o=e,a=null!==(s=l(o))&&void 0!==s?s:"mp4"}else{if("string"!==typeof e)return e;var i;o={src:e},a=null!==(i=l(o))&&void 0!==i?i:"mp4",Object.assign(o,{type:`video/${a}`})}o.type&&n.push(o);const r=null!==(t=Bn.Video[a])&&void 0!==t?t:Bn.Video.mp4;return n.some((e=>e.type===r))||d({type:r}),c(a).forEach((e=>d({type:e}))),n;function l(e){if(e.src&&-1!==e.src.lastIndexOf(".")){const t=new URL(e.src);return t.pathname.slice(t.pathname.lastIndexOf(".")+1)}if(e.type){const t=Object.keys(Bn.Video).find((t=>Bn.Video[t]===e.type));if(t)return t}if(e.filename){const t=e.filename.replace(/\\/g,"/").split("/").reverse()[0];if(-1!==t.lastIndexOf("."))return t.slice(t.lastIndexOf(".")+1)}return null}function c(e){if(!Qn[e])return[];const t=Object.values(n).map((e=>e.type));return Qn[e].filter((e=>!t.includes(e)))}function d(e){const t=e=>Object.assign(Object.entries(o).reduce(((e,[t,n])=>({...e,[t]:n})),{}),e),a=t(e);n.push(a)}}}}function Gn(){return Kn({track:e},{enableTrack:t,disableTrack:n,addTrack:o,removeTrack:a,setTrackOffset:s});function e(){const e=t.call(this);return this.on("track$enable",(()=>{const e=a.call(this),t=e.find((e=>"showing"===e.mode));if(!t)throw new Error("Enabled track not founded");const n=this.$state.track;n.currentTrack=o.call(this,t),n.enable=!0})),this.on("track$disable",(()=>{const e=this.$state.track;e.enable=!1})),this.on("track$add",(()=>n.call(this))),this.on("track$remove",(()=>{n.call(this)})),this.on("stop$",(()=>{var e;n.call(this);const t=this.$state.track;null===(e=t.currentTrack)||void 0===e||e.disable(),t.currentTrack=null,t.enable=!1})),e;function t(){const e={};return e.tracks=a.call(this).map((e=>e.id)),e.offset=0,e.currentTrack=null,e.enable=!1,e}function n(){const e=a.call(this),t=this.$state.track;t.tracks=e.map((e=>e.id))}function o(e){const t=()=>{const e=this.$state.track,o=e.currentTrack;if(!o)return this.off("texttrackchange",t);e.currentTrack.text=n.call(o.get(),e.offset)};return o(t),this.on("texttrackchange",t),{id:e.id,text:n.call(e,0),get:()=>e,disable:()=>{this.off("texttrackchange",t)}};function n(e){if(!this.loaded_)return null;if(0===this.cues.length)return null;const t=this.tech_.currentTime$org()+e,n=[];for(let o=0,a=this.cues.length;o=t&&n.push(e)}return n.map((e=>e.text)).join("")}function o(t){const n=e.tech_;e.tech_.__modified__||(e.tech_=new Proxy(n,{get(e,n,o){return"__modified__"===n||("currentTime$org"===n?Reflect.get(e,"currentTime",o):("currentTime"===n&&t(),Reflect.get(e,n,o)))},set(e,t,n,o){return Reflect.set(e,t,n,o)}}))}}function a(){var e;return Array.from(null!==(e=this.remoteTextTracks())&&void 0!==e?e:[]).filter((e=>"captions"===e.kind))}}function t(e){var t;const n=this.$state.track;if(!e){if(n.enable)return;if(n.currentTrack)e=n.currentTrack.id;else{if(!(n.tracks&&n.tracks.length>0))return;e=n.tracks[0]}}const o=Array.from(null!==(t=this.remoteTextTracks())&&void 0!==t?t:[]).filter((e=>"captions"===e.kind)),a=o.some((t=>t.id===e));if(!a)throw new Error("Track not founded: "+e);o.forEach((t=>{t.mode=t.id===e?"showing":"disabled"})),this.trigger("track$enable")}function n(){var e;const t=this.$state.track;if(!t.currentTrack)return;const n=Array.from(null!==(e=this.remoteTextTracks())&&void 0!==e?e:[]).filter((e=>"captions"===e.kind));n.forEach((e=>e.mode="disabled")),this.trigger("track$disable")}function o({id:e,src:t}){const n=this.$state.track;if(n.tracks.includes(e))return;const o={id:e,src:t,kind:"captions",mode:"disabled"};this.addRemoteTextTrack(o,!0),this.trigger("track$add")}function a(e=null){var o,a;const s=this.$state.track,i=Array.from(null!==(o=this.remoteTextTracks())&&void 0!==o?o:[]).filter((e=>"captions"===e.kind));let r,l=[];if(e){if(!s.tracks.includes(e))return;r=s.currentTrack.id===e,l.push(e)}else r=!0,l.push(...s.tracks);r&&(n.call(this),s.currentTrack.disable(),s.currentTrack=null),l.forEach(d.bind(this));const c=Array.from(null!==(a=this.remoteTextTracks())&&void 0!==a?a:[]).filter((e=>"captions"===e.kind));if(this.trigger("track$remove"),c.length&&r){const e=c[0];console.log("Select first track after remove current",e),t.call(this,e.id)}function d(e){const t=i.find((t=>t.id===e));t&&this.removeRemoteTextTrack(t)}}function s(e){const t=this.$state.track;t.offset=e,this.trigger("texttrackchange")}}function Kn(e={},t={}){return{states:e,controls:t}}function Yn(){return this.id()}function Jn(){const e=()=>this.currentTime();return this.$set(e,["timeupdate","stop$"]),e()}function Xn(){const e=()=>this.duration()||0;return this.$set(e,["durationchange","stop$"]),e()}function Zn(){const e=()=>{const e=this.buffered(),t=[];for(let n=0;nthis.poster();return this.$set(e,["posterchange","stop$"]),e()}function to(){const e=()=>this.playbackRate();return this.$set(e,["ratechange"]),e()}function no(){const e=()=>this.isInPictureInPicture();return this.$set(e,[["enterpictureinpicture","leavepictureinpicture"]]),e()}function oo(){const e=()=>this.isFullscreen();return this.$set(e,["fullscreenchange"]),e()}function ao(){const e=()=>this.volume();return this.$set(e,["volumechange"]),e()}function so(){const e=()=>this.paused();return this.$set(e,["play","pause","loadstart","loadeddata","stop$"]),e()}function io(){const e=()=>this.muted();return this.$set(e,["mute$"]),e()}function ro(){console.log("PLAY",this.play,this.muted,this),this.play()}async function lo(){this.pause(),await yo((()=>this.paused()))}function co(e){this.poster(e)}function uo(e){this.currentTime(e)}function ho(e){this.playbackRate(e)}function po(e){try{e?this.requestPictureInPicture():this.exitPictureInPicture()}catch(t){console.log("Failed to toggle PiP",e,(null===t||void 0===t?void 0:t.message)||t)}}function mo(e){e?this.requestFullscreen():this.exitFullscreen()}function _o(e){fo.call(this,!1),this.volume(e)}function fo(e){this.muted(e),this.trigger("mute$")}async function go(){async function e(){this.reset(),await yo((()=>{const e=this.currentSources().filter((e=>!!e.src&&!!e.type));return e<=0}))}this.isInPictureInPicture()&&this.exitPictureInPicture(),await lo.call(this),await e.call(this),this.trigger("stop$")}function bo(){this.isInPictureInPicture()&&this.exitPictureInPicture(),this.reset(),this.dispose()}function yo(e,t=100){let n=null;return new Promise((o=>{n=setInterval((()=>{e.call(this)&&(clearInterval(n),n=null,o())}),t)}))}var vo=e=>{const t=e.reduce(((e,t)=>({...e,...t.states})),{}),n=Object.keys(t),o=Object.entries(t);return{data(){return{states:{}}},created(){this.$watch((()=>this.instance),(e=>{if(!this.instance)return void(this.states=n.map((e=>[e,null])).reduce(((e,[t,n])=>({...e,[t]:n})),{}));const t=o.map((([t,n])=>{const o=ko({player:e,states:wo.call(this),name:t});return[t,n.call(o)]})).reduce(((e,[t,n])=>({...e,[t]:n})),{});this.states=t}),{immediate:!0})}}};function wo(){const e=this;return new Proxy({},{get(t,n,o){return e.states[n]},set(t,n,o,a){return e.states=Object.assign({},e.states,{[n]:o}),!0}})}function ko({player:e,states:t,name:n}){return new Proxy(e,{get(o,a,s){return"$state"===a?t:"$set"===a?(o,a)=>{a?a.forEach((a=>e.on(a,(()=>t[n]=o(a))))):t[n]=o}:Reflect.get(o,a,s)}})}var Co=e=>{const t=e.reduce(((e,t)=>({...e,...t.controls})),{}),n=e=>function(...t){return this.instance?e.apply($o({player:this.instance,states:this.states}),t):null};return{methods:Object.entries(t).map((([e,t])=>[e,n(t)])).reduce(((e,[t,n])=>({...e,[t]:n})),{})}};function $o({player:e,states:t}){return new Proxy(e,{get(e,n,o){return"$state"===n?t:Reflect.get(e,n,o)}})}function So(e={controls:!1,autoplay:!1,preload:"auto",playbackRates:[.5,1,1.5,2]},t=zn){return new i["a"]({data(){let e,t=new Promise((t=>e=t));return t.resolve=e,{instance:null,promiseReady:t}},mixins:[vo(t),Co(t)],methods:{async initialize(t){if(this.instance)throw new Error("Failed to initialize player.");const n=Object(Fn["default"])(t,e);await new Promise((e=>n.one("ready",e))),this.instance=n,this.promiseReady.resolve()}}})}var xo={data(){return{}},methods:{createPlayer:So}},To=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player relative-position"},[n("video",{ref:"videoRef",staticClass:"video-js",attrs:{playsinline:"true","webkit-playsinline":"true",tabindex:"-1"}}),n("Controller",{attrs:{player:e.player},scopedSlots:e._u([{key:"header",fn:function(){return[e._t("header")]},proxy:!0},{key:"footer",fn:function(){return[e._t("footer")]},proxy:!0}],null,!0)})],1)},Io=[],Po=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ControllerLayout",{attrs:{player:e.player},on:{hotkey$focus:e.hotkey$focus},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.showController;return[n("Subtitle",{style:o?{paddingTop:"58px",paddingBottom:"60px"}:{},attrs:{player:e.player,dense:o}}),n("Center",{ref:"centerRef",attrs:{player:e.player}}),n("Header",{directives:[{name:"show",rawName:"v-show",value:o,expression:"showController"}],attrs:{player:e.player},scopedSlots:e._u([{key:"right",fn:function(){return[e._t("header"),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{icon:"file_open",unelevated:"",round:"",size:"0.8rem"},on:{click:e.handleOpenLocalVideo}}),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!0,expression:"true"}],attrs:{icon:"settings",unelevated:"",round:"",size:"0.8rem"},on:{click:e.handleOpenSetting}}),n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{icon:"more_vert",unelevated:"",round:"",size:"0.8rem"}})]},proxy:!0}],null,!0)}),n("Footer",{directives:[{name:"show",rawName:"v-show",value:o,expression:"showController"}],attrs:{player:e.player},scopedSlots:e._u([{key:"right",fn:function(){return[e._t("footer"),n("VolumeButton",{attrs:{player:e.player}}),n("PlaybackRateButton",{attrs:{player:e.player}}),n("SubtitleButton",{attrs:{player:e.player}}),n("PipButton",{attrs:{player:e.player}}),n("FullscreenButton",{attrs:{player:e.player}})]},proxy:!0}],null,!0)}),n("Setting",{ref:"settingRef",attrs:{player:e.player}})]}}])})},Oo=[],qo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"video-js-player__controller absolute-full relative-position",on:{click:e.onVideoClick,dblclick:e.onVideoDoubleClick}},e.mouseEvents),[e.isAudio?n("div",{staticClass:"is-audio-hint absolute-center"},[n("img",{staticClass:"q-mt-xl",attrs:{src:"developer/assets/icon-256.png",alt:""}}),n("p",{staticClass:"text-center text-h5",staticStyle:{"line-height":"24px"}},[n("i",{staticClass:"material-icons",staticStyle:{"vertical-align":"top"}},[e._v("audiotrack")]),e._v("\n "+e._s(e.$t("audio_file"))+"\n ")])]):e._e(),e._t("default",null,null,{showController:e.showController})],2)},Eo=[],Ao=n("4fd2"),Do={props:{player:Object},mixins:[No(),Lo()],computed:{isAudio(){var e,t,n;const o=null===(e=this.player)||void 0===e||null===(t=e.states)||void 0===t||null===(n=t.currentSources)||void 0===n?void 0:n[0];if(!o||!o.filename)return!1;const a=o.filename.replace(/\.downloading$/,"").match(/\.[^.]+?$/);if(!a||!a[0])return!1;const s=a[0].slice(1);return Object(Ao["b"])(s)}},methods:{onVideoClick(e){const t=e=>e.classList.contains("video-js-player__controller");if(!t(e.target))return;const{isPaused:n,loadingState:o,currentSources:a}=this.player.states;"object"!==typeof o&&a&&0!==a.length&&(n?this.player.play():this.player.pause())},onVideoDoubleClick(e){const t=e=>e.classList.contains("video-js-player__controller");t(e.target)&&this.player&&this.player.setFullscreen(!this.player.states.isFullscreen)}}};function No(){return{data(){return{toggle:!1,playerReady:!1}},created(){this.$watch((()=>{var e,t;return null!==(e=null===(t=this.player)||void 0===t?void 0:t.instance)&&void 0!==e?e:null}),(e=>{e&&e.ready((()=>this.playerReady=!0))}),{immediate:!0})},computed:{showController:{get(){return this.toggle&&this.playerReady},set(e){this.toggle=e}}}}}function Lo(){const e=e=>e.classList.contains("video-js-player__controller");let t=null;return{computed:{mouseEvents(){return{mouseover:o.bind(this),mousemove:a.bind(this),mouseenter:e=>n.call(this,e,!0),mouseleave:e=>n.call(this,e,!1)}}},watch:{showController(){this.$emit("hotkey$focus")}}};function n(e,t){if(t)this.showController=t;else{if(0!==e.which)return;this.showController=t}}function o(n){if(!e(n.target))return clearTimeout(t);t&&clearTimeout(t),t=setTimeout((()=>{this.showController=!1,t=null}),3e3)}function a(n){e(n.target)&&(this.showController=!0,t&&clearTimeout(t),t=setTimeout((()=>{this.showController=!1,t=null}),3e3))}}var jo=Do,Ro=(n("4dbc"),Object(g["a"])(jo,qo,Eo,!1,null,null,null)),Uo=Ro.exports,Fo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-full flex items-stretch no-pointer-events--children non-selectable"},[n("div",{staticClass:"full-width full-height flex items-stretch"},[n("div",{staticClass:"full-width full-height relative-position column justify-end items-center"},[n("div",{staticClass:"relative-position",style:{"min-height":e.subtitlePanelMinHeight+"px"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.trackEnabled&&!!e.currentText,expression:"trackEnabled && !!currentText"}],staticClass:"video-js-player__subtitle",class:[e.player.states.isFullscreen?"fullscreen-subtitle":""]},[e._v("\n "+e._s(e.currentText)+"\n ")])])])])])},Mo=[],Bo={mixins:[Qo()],props:{player:Object,dense:Boolean},computed:{trackEnabled(){var e,t;return null!==(e=null===(t=this.player.states.track)||void 0===t?void 0:t.enable)&&void 0!==e&&e},currentText(){var e,t;return null===(e=this.player.states.track)||void 0===e||null===(t=e.currentTrack)||void 0===t?void 0:t.text},subtitlePanelMinHeight(){var e,t,n,o;const a=null!==(e=null===(t=this.player$rects)||void 0===t?void 0:t.container.height)&&void 0!==e?e:0,s=null!==(n=null===(o=this.player$rects)||void 0===o?void 0:o.video.height)&&void 0!==n?n:0;return Math.max(0,Math.round((a-s)/2))}}};function Qo(){let e;return{data(){return{player$rects:{container:{},video:{}}}},mounted(){const t=this.$el;e&&e.disconnect(),e=new ResizeObserver((()=>n.call(this,t))),e.observe(t,{}),setTimeout((()=>n.call(this,t)),200)},beforeDestroy(){e&&e.disconnect()}};function t(e){return e&&e.endsWith("px")?parseInt(e.slice(0,e.length-2)):0}function n(e){const n=e.querySelector("div"),o=e.parentElement.parentElement.querySelector(".video-js>video"),a=getComputedStyle(n),s=getComputedStyle(o);this.player$rects.container.width=t(a.width),this.player$rects.container.height=t(a.height),this.player$rects.video.width=t(s.width),this.player$rects.video.height=t(s.height),this.player$rects=Object.assign({},this.player$rects)}}var Wo=Bo,zo=(n("d2e8"),Object(g["a"])(Wo,Fo,Mo,!1,null,null,null)),Ho=zo.exports;k()(zo,"components",{QItem:Pe["a"]});var Vo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-center"},[e.dialogData?n("DialogPanel",{attrs:{icon:e.dialogData.icon,message:e.dialogData.message}}):e.playerError?n("ErrorPanel",{attrs:{player:e.player}}):e.playerLoading?n("LoadingPanel",{attrs:{player:e.player}}):e.emptySource?n("OpenButton",{attrs:{player:e.player}}):e.player.states.isPaused?n("PlayButton",{attrs:{player:e.player}}):e._e()],1)},Go=[],Ko=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CenterPanel",{scopedSlots:e._u([e.icon?{key:"avatar",fn:function(){return[n("q-icon",{staticStyle:{opacity:"0.8"},attrs:{size:"2.4rem",name:e.icon}})]},proxy:!0}:null,{key:"default",fn:function(){return[n("div",{staticClass:"ellipsis-2-lines text-bold",staticStyle:{"font-size":"1rem","min-width":"100px",opacity:"0.8"}},[e._v("\n "+e._s(e.message)+"\n ")]),e.caption?n("div",{staticClass:"ellipsis-3-lines",staticStyle:{opacity:"0.8"}},[e._v("\n "+e._s(e.caption)+"\n ")]):e._e()]},proxy:!0}],null,!0)})},Yo=[],Jo=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"controller:panel overflow-hidden",staticStyle:{"border-radius":"16px"}},[n("q-card-section",{staticClass:"text-center q-pa-md"},[e.$slots.avatar?n("div",{staticClass:"q-ma-sm"},[e._t("avatar")],2):e._e(),n("div",{staticClass:"q-ma-sm"},[e._t("default")],2),e.$slots.action?n("div",{staticClass:"q-mb-xs"},[e._t("action")],2):e._e()])],1)},Xo=[],Zo={},ea=Zo,ta=(n("9992"),Object(g["a"])(ea,Jo,Xo,!1,null,"18dfdf92",null)),na=ta.exports;k()(ta,"components",{QCard:v["a"],QCardSection:ie["a"]});var oa={components:{CenterPanel:na},name:"DialogPanel",props:{icon:String,message:String,caption:String,handleOk:Function}},aa=oa,sa=Object(g["a"])(aa,Ko,Yo,!1,null,null,null),ia=sa.exports;k()(sa,"components",{QIcon:Y["a"],QBtn:le["a"]});var ra=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CenterPanel",{staticClass:"non-selectable",staticStyle:{"max-height":"200px","max-width":"600px"},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("q-icon",{staticStyle:{opacity:"0.8"},attrs:{size:"2.4rem",name:"error"}})]},proxy:!0},{key:"default",fn:function(){return[n("div",{staticClass:"ellipsis-2-lines text-bold",staticStyle:{"font-size":"1rem","min-width":"100px",opacity:"0.8"}},[e._v("\n "+e._s(e.playerError.type)+"\n ")]),n("div",{staticClass:"ellipsis-3-lines",staticStyle:{opacity:"0.8"}},[e._v("\n "+e._s(e.playerError.message)+"\n ")])]},proxy:!0},{key:"action",fn:function(){return[n("q-btn",{staticClass:"q-mt-sm",staticStyle:{"min-width":"64px","background-color":"rgba(256,256,256,0.1)"},attrs:{label:e.$t("ok"),"no-caps":"",flat:"",rounded:""},on:{click:e.handleOk}})]},proxy:!0}])})},la=[],ca={components:{CenterPanel:na},props:{player:Object},computed:{playerError(){var e,t;const n=this.player.states.loadingState;if(!n||"boolean"===typeof n)return null;const o=null===(e=this.player)||void 0===e||null===(t=e.instance)||void 0===t?void 0:t.languages_,a=this.$i18n.locale.toLowerCase(),s=e=>o&&o[a]&&o[a][e]||e;return{type:s(n.type),message:s(n.message)}}},methods:{async handleOk(){await this.player.stop()}}},da=ca,ua=Object(g["a"])(da,ra,la,!1,null,"90e33b2e",null),ha=ua.exports;k()(ua,"components",{QIcon:Y["a"],QBtn:le["a"]});var pa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CenterPanel",{staticClass:"non-selectable",staticStyle:{"max-height":"180px"},scopedSlots:e._u([{key:"avatar",fn:function(){return[n("q-spinner-ios",{staticStyle:{opacity:"0.8"},attrs:{size:"2.4rem"}})]},proxy:!0},{key:"default",fn:function(){return[n("div",{staticClass:"ellipsis-2-lines",staticStyle:{"min-width":"100px",opacity:"0.8"}},[e._v("\n "+e._s(e.$t("loading"))+"\n "),e.isRemotePlay?n("span",[e._v("("+e._s(e.remoteProgress)+")")]):n("span",[e._v("...")])]),e.isRemotePlay?n("div",{staticClass:"remote-status"},[e._v("\n "+e._s(e.remoteDownloaded)+" ( "+e._s(e.remoteDownloadSpeed)+" )\n ")]):e._e()]},proxy:!0}])})},ma=[],_a=n("84f6"),fa=n("6422"),ga={components:{CenterPanel:na},props:{player:Object},computed:{remoteInfoHash(){var e;return null===(e=S["a"].state.video.currentVideo)||void 0===e?void 0:e.infoHash},isRemotePlay(){return!!this.remoteInfoHash&&S["a"].state.video.currentVideo.remotePlay},remoteTask(){return this.isRemotePlay?_a["a"].taskList.downloading.find((e=>e.infoHash===this.remoteInfoHash)):null},remoteProgress(){return this.isRemotePlay&&this.remoteTask?Object(fa["g"])(this.remoteTask.progress):""},remoteDownloadSpeed(){return this.isRemotePlay&&this.remoteTask?Object(fa["a"])(this.remoteTask.downloadSpeed,{byte:!1,gb:!1,fix:1})+"/s":""},remoteDownloaded(){return this.isRemotePlay&&this.remoteTask?Object(fa["a"])(this.remoteTask.downloaded,{byte:!1}):""}}},ba=ga,ya=Object(g["a"])(ba,pa,ma,!1,null,"0ff02c0c",null),va=ya.exports;k()(ya,"components",{QSpinnerIos:nt["a"]});var wa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("q-btn",{staticClass:"text-white controller:panel",attrs:{size:"2rem",icon:"file_open",unelevated:"",round:""},on:{click:e.openFile}}),n("input",{staticStyle:{display:"none"},attrs:{type:"file","data-cy":"file-input"},on:{input:e.loadVideo}})],1)},ka=[];function Ca({accept:e}){const t=document.createElement("input");return Object.assign(t.style,{position:"fixed",top:"0",left:"0",width:"0",height:"0"}),t.type="file",t.accept=Array.isArray(e)?e.join(","):e,t}function $a(e){return e?new Promise((t=>{const n=new FileReader;n.onload=e=>{var n,o;return t(null!==(n=null===(o=e.target)||void 0===o?void 0:o.result)&&void 0!==n?n:"")},n.readAsText(e)})):""}async function Sa(e){const t=document.activeElement;try{document.body.appendChild(e),e.focus(),e.click()}finally{document.body.removeChild(e),t.focus()}const n=await o(e);return console.log("result"),console.tag("file").debug("result",n),n||null;async function o(e){var t,n;const o=await new Promise((t=>e.addEventListener("change",t,{once:!0}))),a=null===o||void 0===o||null===(t=o.target)||void 0===t||null===(n=t.files)||void 0===n?void 0:n[0];return console.tag("file").debug("change",a),e.value=null,a}}function xa(){return{readTextFile:$a,async selectFile({accept:e}={}){const t=Ca({accept:null!==e&&void 0!==e?e:"*"});return Sa(t)}}}var Ta=Ia;function Ia(){const{selectFile:e}=xa(),t={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m3u8:"application/x-mpegURL",mpd:"application/dash+xml"};return async()=>{console.log("selectFile");const n=await e({accept:Array.from(new Set([...Object.values(t),...Object.keys(t).map((e=>`.${e}`))]))});return console.log("file",n),n?{src:URL.createObjectURL(n),type:n.type,file:n}:null}}const Pa=Ta();var Oa={props:{player:Object},methods:{async openFile(){console.log("Open file");const e=await Pa();if(console.log("select local source",e),!e)return;await this.player.setSource(e);const{currentSources:t,loadingState:n}=this.player.states;console.log("Dispatch remotePlay reset"),S["a"].dispatch("resetRemotePlay"),!t||t.length<=0||n||(this.player.ctl$emit("openFile"),this.player.play())},async loadVideo(e){if(console.log("Load video",e),e.target.files[0]){const t={src:URL.createObjectURL(e.target.files[0]),type:e.target.files[0].type,file:e.target.files[0]};console.log("Source",t),await this.player.setSource(t);const{currentSources:n,loadingState:o}=this.player.states;if(console.log(this.player.states),!n||n.length<=0)return;if(o)return;this.player.play()}}}},qa=Oa,Ea=Object(g["a"])(qa,wa,ka,!1,null,"4dd2a6d6",null),Aa=Ea.exports;k()(Ea,"components",{QBtn:le["a"]});var Da=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{staticClass:"text-white controller:panel",attrs:{ripple:!1,size:"2rem",icon:e.icon,disable:e.disable,unelevated:"",round:""},on:{click:e.handlePlay}})},Na=[],La={props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t},icon(){return this.player.states.isPaused?"play_arrow":"pause"}},methods:{handlePlay(){this.player.states.isPaused?this.player.play():this.player.pause()}}},ja=La,Ra=Object(g["a"])(ja,Da,Na,!1,null,"0e8525b1",null),Ua=Ra.exports;k()(Ra,"components",{QBtn:le["a"]});var Fa={mixins:[Ma()],components:{DialogPanel:ia,ErrorPanel:ha,LoadingPanel:va,OpenButton:Aa,PlayButton:Ua},data(){return{interval:null}},props:{player:Object},computed:{playerError(){const e=this.player.states.loadingState;return e&&"boolean"!==typeof e?e:null},playerLoading(){const{loadingState:e,isWaiting:t}=this.player.states;return!0===e||!!t},emptySource(){const e=this.player.states.currentSources;return!e||e.length<=0}},mounted(){clearInterval(this.interval)},beforeDestroy(){clearInterval(this.interval)}};function Ma(){let e=null;function t(){e&&clearTimeout(e),e=null,this.dialog$data.icon=null,this.dialog$data.message=null}return{data(){return{dialog$data:{icon:null,message:null}}},computed:{dialogData(){const{icon:e,message:t}=this.dialog$data;if(!t)return null;const n={};return n.icon=e,n.message=t,n}},methods:{createDialog({icon:n,message:o,timeout:a}){return e&&clearTimeout(e),e=null,this.dialog$data.icon=n,this.dialog$data.message=o,a&&(e=setTimeout(t.bind(this),a)),t.bind(this)}}}}var Ba=Fa,Qa=Object(g["a"])(Ba,Vo,Go,!1,null,null,null),Wa=Qa.exports,za=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-top relative-position",staticStyle:{"min-height":"56px"}},[n("div",{staticClass:"controller-top absolute-full overflow-hidden"}),n("div",{staticClass:"relative-position flex no-wrap items-center text-white q-px-md q-pb-sm non-selectable",staticStyle:{"z-index":"1","padding-top":"10px"}},[e.info?[n("q-icon",{staticClass:"q-ml-sm q-mr-sm",attrs:{name:"movie",size:"1.5rem"}}),n("div",{staticClass:"q-my-xs q-mx-sm col-shrink"},[n("div",{staticClass:"text-bold",staticStyle:{"font-size":"0.9rem","line-height":"1.2"}},[e._v(e._s(e.info.title))]),e.info.caption?n("div",{staticClass:"ellipsis",staticStyle:{"max-width":"200px",opacity:"0.6","font-size":"0.7rem","line-height":"1"}},[e._v(e._s(e.info.caption)+"\n ")]):e._e()])]:e._e(),n("q-space"),e._t("right")],2)])},Ha=[],Va={props:{player:Object},computed:{info(){var e,t;const n=null!==(e=null===(t=this.player.states.currentSources)||void 0===t?void 0:t[0])&&void 0!==e?e:null;if(!n)return null;if(n.filename){const e=n.filename.replace(/\\/g,"/").split("/").reverse()[0];return{title:e.slice(0,e.lastIndexOf(".")),caption:n.filename}}return n.file?{title:n.file.name.slice(0,n.file.name.lastIndexOf(".")),caption:n.file.path}:{title:this.$t("unknown_media"),caption:n.src}}}},Ga=Va,Ka=Object(g["a"])(Ga,za,Ha,!1,null,"2ead7b1a",null),Ya=Ka.exports;k()(Ka,"components",{QIcon:Y["a"],QSpace:re["a"]});var Ja=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"absolute-bottom relative-position"},[n("div",{staticClass:"controller-bottom full-height full-width absolute-top-left overflow-hidden"}),n("div",{staticClass:"relative-position flex items-center text-white q-px-md q-pb-sm non-selectable no-wrap",staticStyle:{"padding-top":"12px"}},[n("PlayButton",{attrs:{player:e.player}}),n("StopButton",{attrs:{player:e.player}}),n("div",{staticClass:"q-mx-sm q-my-sm text-bold ellipsis",style:{opacity:e.disable?.7:1}},[e._v(e._s(e.timeLabel))]),n("q-space"),e._t("right")],2),n("ProgressBar",{attrs:{player:e.player}})],1)},Xa=[],Za=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player__progress-bar absolute-top q-px-md no-pointer-events",class:e.disable?["video-js-player__progress-bar-disable"]:[]},[n("q-slider",{staticClass:"video-js-player__progress-bar-slider all-pointer-events",attrs:{"disable-keydown":"",min:0,max:1e3*e.duration,"track-color":"transparent","thumb-color":"primary","thumb-size":"12px",dark:"",label:"",dense:"","label-value":e.progressLabel,disable:e.disable},nativeOn:{click:function(t){return e.onClick.apply(null,arguments)}},model:{value:e.progress,callback:function(t){e.progress=t},expression:"progress"}}),e._m(0),e._l(e.player.states.buffered,(function(t,o){var a=t[0],s=t[1];return n("div",{key:o,staticClass:"video-js-player__progress-bar-buffered absolute-top q-px-md"},[n("BufferProgress",{staticStyle:{opacity:"1"},attrs:{start:a/e.player.states.duration||0,end:s/e.player.states.duration||0}})],1)}))],2)},es=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player__progress-bar-buffered absolute-top q-px-md"},[n("div",{staticClass:"video-js-player__progress-bar-buffered-bg"})])}];function ts(){const e=e=>{const t=e-Math.floor(e),n=e-t,o=Math.floor(n/3600),a=Math.floor((n-60*o*60)/60),s=n-(60*o*60+60*a);return(o?[o,a,s]:[a,s]).map((e=>(""+e).padStart(2,"0"))).join(":")};let t=0;return{computed:{progress:{get(){return 1e3*this.player.states.currentTime},set(e){this.player.seek(e/1e3)}},animationSpeed(){const e=Math.abs(this.progress-t);return t=this.progress,e>300?0:e},duration(){return this.player.states.duration},progressLabel(){return e(this.progress/1e3)},durationLabel(){return e(this.duration)}}}}var ns=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"video-js-player__buffer-progress relative-position full-width"},[n("div",{staticClass:"absolute full-height",staticStyle:{"border-radius":"4px"},style:{width:100*(e.end-e.start)+"%",left:100*e.start+"%"}})])},os=[],as={props:{start:Number,end:Number}},ss=as,is=(n("d1e4"),Object(g["a"])(ss,ns,os,!1,null,"4e25daec",null)),rs=is.exports,ls={mixins:[ts()],components:{BufferProgress:rs},props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t}},methods:{onClick(){console.log("[Ctrl] onProgressBarClick"),this.$emit("click"),setTimeout((()=>{this.$el.blur(),document.body.click(),console.log("[Ctrl] Blur")}),200)}}},cs=ls,ds=(n("84cb"),n("f9b5")),us=Object(g["a"])(cs,Za,es,!1,null,null,null),hs=us.exports;k()(us,"components",{QSlider:ds["a"]});var ps=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:e.icon,unelevated:"",round:"",disable:e.disable},on:{click:e.handlePlay}})},ms=[],_s={props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t},icon(){return this.player.states.isPaused?"play_arrow":"pause"}},methods:{handlePlay(){this.player.states.isPaused?this.player.play():this.player.pause()}}},fs=_s,gs=Object(g["a"])(fs,ps,ms,!1,null,null,null),bs=gs.exports;k()(gs,"components",{QBtn:le["a"]});var ys=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:"stop",unelevated:"",round:"",disable:e.disable},on:{click:e.handleStop}})},vs=[],ws={props:{player:Object},computed:{disable(){const{currentSources:e}=this.player.states;return!e||e.length<=0}},methods:{async handleStop(){this.player.states.isPiP&&this.player.setPiP(!1),this.player.states.isFullscreen&&this.player.setFullscreen(!1),S["a"].dispatch("resetRemotePlay"),await this.player.stop()}}},ks=ws,Cs=Object(g["a"])(ks,ys,vs,!1,null,null,null),$s=Cs.exports;k()(Cs,"components",{QBtn:le["a"]});var Ss={mixins:[ts()],components:{PlayButton:bs,StopButton:$s,ProgressBar:hs},props:{player:Object},computed:{disable(){const{currentSources:e,loadingState:t}=this.player.states;return!e||e.length<=0||!!t},timeLabel(){const e=e=>{const t=Math.round(e),n=Math.floor(t/3600),o=Math.floor((t-60*n*60)/60),a=t-(60*n*60+60*o);return(n?[n,o,a]:[o,a]).map((e=>(""+e).padStart(2,"0"))).join(":")};return`${e(this.player.states.currentTime)} / ${e(this.player.states.duration)}`}}},xs=Ss,Ts=n("526f"),Is=Object(g["a"])(xs,Ja,Xa,!1,null,null,null),Ps=Is.exports;k()(Is,"components",{QLinearProgress:Ts["a"],QSpace:re["a"]});var Os=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ControllerPage",{attrs:{title:e.$t("settings"),icon:"settings"},model:{value:e.showSetting,callback:function(t){e.showSetting=t},expression:"showSetting"}},[n("q-list",{staticClass:"video-js-player__setting-list",attrs:{dark:"",bordered:"",separator:""}},[n("q-item-label",{staticClass:"q-mx-md q-mt-md",staticStyle:{"font-size":"1.1rem"}},[e._v(e._s(e.$t("settings_subtitle_options")))]),n("SubtitleOptions")],1)],1)},qs=[],Es=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.value?n("div",{staticClass:"non-selectable absolute-full video-js-player__page",staticStyle:{"z-index":"1000"}},[n("div",{staticClass:"bg-transparent full-width"},[n("q-toolbar",{staticStyle:{height:"56px"}},[e.icon?n("q-icon",{staticClass:"q-ml-sm",attrs:{name:e.icon,size:"1.5rem"}}):e._e(),n("q-toolbar-title",{staticClass:"text-bold",staticStyle:{"font-size":"1rem","line-height":"1.2"}},[e._v(e._s(e.title))]),n("q-space"),n("q-btn",{attrs:{flat:"",round:"",icon:"close"},on:{click:function(){return e.$emit("input",!1)}}})],1),n("q-separator",{staticStyle:{"background-color":"rgba(256,256,256,0.2)"},attrs:{size:"0.8px"}})],1),n("q-page",{attrs:{padding:""}},[e._t("default")],2)],1):e._e()},As=[],Ds={props:{icon:String,title:String,value:Boolean}},Ns=Ds,Ls=(n("5a2f"),n("99c4")),js=n("75a3"),Rs=n("9b72"),Us=Object(g["a"])(Ns,Es,As,!1,null,null,null),Fs=Us.exports;k()(Us,"components",{QToolbar:Ls["a"],QIcon:Y["a"],QToolbarTitle:js["a"],QSpace:re["a"],QBtn:le["a"],QSeparator:ce["a"],QPage:Rs["a"]});var Ms=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-item",{staticClass:"overflow-hidden"},[n("q-item-section",{attrs:{side:""}},[n("div",{staticClass:"column",staticStyle:{"align-items":"stretch",gap:"8px"}},[n("q-btn-toggle",{staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.fontSizeOptions,"toggle-color":"primary"},model:{value:e.fontSize,callback:function(t){e.fontSize=t},expression:"fontSize"}}),n("q-btn-toggle",{staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.fontStyleOptions,"toggle-color":"primary"},model:{value:e.fontStyle,callback:function(t){e.fontStyle=t},expression:"fontStyle"}}),n("q-btn-toggle",{staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.fontWeightOptions,"toggle-color":"primary"},model:{value:e.fontWeight,callback:function(t){e.fontWeight=t},expression:"fontWeight"}})],1)]),n("q-item-section",{staticClass:"bg-grey-9 flex justify-center items-center overflow-hidden relative-position",staticStyle:{padding:"8px","border-radius":"8px"}},[n("div",{staticClass:"absolute-top-right"},[n("q-btn-toggle",{staticClass:"q-ma-xs lorem-ipsum",staticStyle:{"background-color":"rgba(50, 50, 50, 0.6)","border-radius":"4px"},attrs:{rounded:"",unelevated:"","no-caps":"",options:e.loremIpsumOptions,"toggle-color":"primary"},model:{value:e.loremIpsumType,callback:function(t){e.loremIpsumType=t},expression:"loremIpsumType"}})],1),n("div",{staticClass:"video-js-player__subtitle ellipsis overflow-hidden col-shrink"},[e._v(e._s(e.loremIpsum))])])],1)},Bs=[],Qs={mixins:[Ws()],name:"SubtitleOptions",inject:["player$settings"],computed:{fontSize:{get(){return this.player$settings.subtitle.size},set(e){this.player$settings.subtitle.size=e}},fontStyle:{get(){return this.player$settings.subtitle.style},set(e){this.player$settings.subtitle.style=e}},fontWeight:{get(){return this.player$settings.subtitle.weight},set(e){this.player$settings.subtitle.weight=e}},fontSizeOptions(){return[{label:this.$t("settings_small"),value:1},{label:this.$t("settings_normal"),value:1.25},{label:this.$t("settings_large"),value:1.7}]},fontStyleOptions(){return[{label:this.$t("settings_normal"),value:"normal"},{label:this.$t("settings_italic"),value:"italic"}]},fontWeightOptions(){return[{label:this.$t("settings_lighter"),value:"lighter"},{label:this.$t("settings_normal"),value:"normal"},{label:this.$t("settings_bolder"),value:"bold"}]}}};function Ws(){const e={EN:"Lorem ipsum dolor sit amet, consectetur adipisicing elit.","简":"朝菌不知晦朔,蟪蛄不知春秋。","繁":"天地不仁,以萬物為芻狗。 聖人不仁,以百姓為芻狗。"};return{data(){return{loremIpsumType:"EN"}},computed:{loremIpsum(){var t;return null!==(t=e[this.loremIpsumType])&&void 0!==t?t:e.EN},loremIpsumOptions(){return Object.keys(e).map((e=>({label:e,value:e})))}}}}var zs=Qs,Hs=(n("3061"),n("834d")),Vs=n("96d7"),Gs=Object(g["a"])(zs,Ms,Bs,!1,null,null,null),Ks=Gs.exports;k()(Gs,"components",{QItem:Pe["a"],QItemSection:Oe["a"],QBtnToggle:Hs["a"],QBtnGroup:Vs["a"],QBtn:le["a"]});var Ys={components:{ControllerPage:Fs,SubtitleOptions:Ks},props:{player:Object},data(){return{dev:!1,showSetting:!1}},methods:{show(){this.showSetting=!0}}},Js=Ys,Xs=(n("071f"),Object(g["a"])(Js,Os,qs,!1,null,null,null)),Zs=Xs.exports;k()(Xs,"components",{QList:_t["a"],QItemLabel:qe["a"],QItem:Pe["a"]});var ei=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"relative-position column items-center"},e.mouseEvents),[n("q-btn",{attrs:{size:"0.8rem",icon:e.icon,unelevated:"",round:""},on:{click:e.handleMute}}),n("transition",{attrs:{name:"q-transition--scale"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showVolumeCard,expression:"showVolumeCard"}],staticClass:"video-js-player__controller-menu controller-popup__transition absolute",staticStyle:{bottom:"44px !important","z-index":"10"}},[n("q-card",{staticClass:"controller-popup",staticStyle:{"border-radius":"12px",height:"140px",padding:"6px!important"}},[n("div",{staticClass:"absolute-bottom q-mb-md text-center text-bold"},[e._v(e._s(e.volume))]),n("q-slider",{staticClass:"video-js-player__volume-slider",staticStyle:{height:"100%"},attrs:{vertical:"",reverse:"","track-size":"40px","thumb-size":"0","track-color":"transparent",min:0,max:100,step:10},model:{value:e.volume,callback:function(t){e.volume=t},expression:"volume"}})],1)],1)])],1)},ti=[];function ni(e,t){return{computed:{mouseEvents(){let n=null;const o=o=>{n&&clearTimeout(n),n=setTimeout((()=>{this[e]=o,n=null}),t)},a=e=>e.classList.contains("video-js-player__controller"),s=(t,n)=>{if(n)this[e]=n;else{if(0!==t.which)return;o(n)}},i=e=>{if(!a(e.target))return clearTimeout(n);o(!1)},r=t=>{if(!a(t.target))return clearTimeout(n);this[e]=!0,o(!1)};return{mouseover:e=>i.call(this,e),mousemove:e=>r.call(this,e),mouseenter:e=>s.call(this,e,!0),mouseleave:e=>s.call(this,e,!1)}}}}}var oi={mixins:[ni("showVolumeCard",100)],props:{player:Object},data(){return{showVolumeCard:!1}},computed:{volume:{get(){return this.player.states.isMuted?0:Math.round(100*this.player.states.volume)},set(e){this.player.setVolume(e/100)}},icon(){return this.player.states.isMuted?"volume_off":"volume_up"}},methods:{handleMute(){this.player.mute(!this.player.states.isMuted)}}},ai=oi,si=(n("f77d"),n("85c4")),ii=Object(g["a"])(ai,ei,ti,!1,null,null,null),ri=ii.exports;k()(ii,"components",{QBtn:le["a"],QTr:si["a"],QCard:v["a"],QSlider:ds["a"]});var li=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"relative-position column items-center"},e.mouseEvents),[n("q-btn",{attrs:{size:"0.8rem",unelevated:"",round:"",icon:"speed"},on:{click:function(t){e.showPlaybackRateCard=!e.showPlaybackRateCard}}}),n("transition",{attrs:{name:"q-transition--scale"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showPlaybackRateCard,expression:"showPlaybackRateCard"}],staticClass:"controller-popup__transition video-js-player__controller-menu absolute",staticStyle:{bottom:"44px !important","z-index":"10"}},[n("q-card",{staticClass:"controller-popup",staticStyle:{"border-radius":"12px",padding:"6px!important"},attrs:{dark:""}},[n("q-btn-toggle",{staticClass:"column video-js-player__controller-btn-toggle",attrs:{"toggle-color":"active",ripple:!1,options:e.playbackRates},model:{value:e.playbackRate,callback:function(t){e.playbackRate=t},expression:"playbackRate"}})],1)],1)])],1)},ci=[],di={mixins:[ni("showPlaybackRateCard",100)],props:{player:Object},data(){return{showPlaybackRateCard:!1}},computed:{playbackRate:{get(){var e;return null!==(e=this.player.states.playbackRate)&&void 0!==e?e:1},set(e){this.player.setPlaybackRate(e)}},playbackRates(){return[{label:"X2.0",value:2},{label:"X1.5",value:1.5},{label:"X1.0",value:1},{label:"X0.5",value:.5}]},playbackRateLabel(){return this.playbackRates.find((e=>e.value===this.playbackRate)).label}}},ui=di,hi=(n("5e87"),Object(g["a"])(ui,li,ci,!1,null,null,null)),pi=hi.exports;k()(hi,"components",{QBtn:le["a"],QTr:si["a"],QCard:v["a"],QBtnToggle:Hs["a"]});var mi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g({staticClass:"relative-position column items-center"},e.mouseEvents),[n("q-btn",{attrs:{disable:e.disableShowSubtitleCard,size:"0.8rem",unelevated:"",round:"",icon:e.trackEnabled?"subtitles":"subtitles_off"},on:{click:function(){return e.showSubtitleCard=!e.showSubtitleCard}}}),n("transition",{attrs:{name:"q-transition--scale"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showSubtitleCard,expression:"showSubtitleCard"}],staticClass:"controller-popup__transition video-js-player__controller-menu absolute",staticStyle:{bottom:"44px !important","z-index":"10"}},[n("q-card",{staticClass:"controller-popup",staticStyle:{"min-width":"200px","border-radius":"12px",padding:"6px!important"},attrs:{dark:""}},[n("div",{staticClass:"row items-center justify-start no-wrap"},[n("div",{staticClass:"text-bold q-ml-sm q-mr-xs ellipsis",staticStyle:{"font-size":"0.8rem",transform:"translateY(0.1rem)"}},[e._v("\n "+e._s(e.$t("subtitle"))+"\n ")]),n("q-space"),n("div",{staticClass:"q-mr-xs overflow-hidden row items-stretch no-wrap",staticStyle:{"background-color":"rgba(256,256,256,0.1)","border-radius":"999px"}},[n("q-btn",{staticStyle:{"min-height":"3em","min-width":"3em","border-radius":"0"},attrs:{icon:"fast_rewind",unelevated:"",size:"0.6rem",padding:"0 6px 0 10px"},on:{click:function(){return e.handleTrackOffset(!1)}}}),n("q-btn",{staticStyle:{"min-height":"3em","min-width":"3em","border-radius":"0"},attrs:{icon:"fast_forward",unelevated:"",size:"0.6rem",padding:"0 10px 0 6px"},on:{click:function(){return e.handleTrackOffset(!0)}}})],1),n("q-btn",{staticClass:"q-mr-xs",style:{backgroundColor:e.trackEnabled?"var(--q-color-primary)":"rgba(256,256,256,0.1)"},attrs:{icon:e.trackEnabled?"subtitles":"subtitles_off",round:"",unelevated:"",size:"0.6rem"},on:{click:function(){return(e.trackEnabled?e.handleDisableTrack:e.handleEnableTrack)()}}}),n("q-btn",{staticClass:"q-mr-xs",staticStyle:{"background-color":"rgba(256,256,256,0.1)"},attrs:{icon:"add",round:"",unelevated:"",size:"0.6rem"},on:{click:e.handleAddTrack}})],1),e.tracksLoaded&&e.tracksLoaded.length?n("q-list",{staticClass:"q-mt-xs video-js-player__controller-list",staticStyle:{"min-width":"180px","max-width":"200px","font-size":"0.8rem","max-height":"240px","overflow-y":"auto"}},e._l(e.tracksLoaded,(function(t){return n("q-item",{key:t.id,staticStyle:{"padding-right":"0"},attrs:{dense:"",clickable:"",disable:!e.trackEnabled},on:{click:function(){return!t.active&&e.handleEnableTrack(t.id)}}},[n("q-item-section",{staticClass:"q-pr-sm",staticStyle:{"min-width":"24px"},attrs:{avatar:""}},[n("q-badge",{attrs:{rounded:"",color:t.active?e.trackEnabled?"primary":"grey":"transparent"}})],1),n("q-item-section",[n("q-item-label",{staticClass:"ellipsis"},[e._v(e._s(t.label))])],1),n("q-item-section",{staticStyle:{color:"inherit","padding-left":"4px"},attrs:{side:""}},[n("q-btn",{staticClass:"q-mr-xs",attrs:{icon:"clear",round:"",unelevated:"",size:"0.6rem",disable:!e.trackEnabled},on:{click:function(n){return e.handleRemoveTrack(t.id)}}})],1)],1)})),1):e._e()],1)],1)])],1)},_i=[],fi=gi;function gi(){const{selectFile:e,readTextFile:t}=xa(),n={vtt:"text/vtt",srt:"text/srt"};return async()=>{const o=await e({accept:Array.from(new Set([...Object.values(n),...Object.keys(n).map((e=>`.${e}`))]))});if(!o)return null;let a=await t(o);return a?(o.name.endsWith(".srt")&&(a=bi(a)),{src:URL.createObjectURL(new Blob([a])),id:o.name}):null}}function bi(e){var t=e.replace(/\r+/g,"");t=t.replace(/^\s+|\s+$/g,"");var n=t.split("\n\n"),o="";if(n.length>0){o+="WEBVTT\n\n";for(var a=0;a3){for(var o=3;o\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);return s?(t+=s[1]+":"+s[2]+":"+s[3]+"."+s[4]+" --\x3e "+s[5]+":"+s[6]+":"+s[7]+"."+s[8]+"\n",a+=1,n[a]&&(t+=n[a]+"\n\n"),t):""}}const yi=fi();var vi={mixins:[ni("showSubtitleCard",100)],props:{player:Object},data(){return{showSubtitleCard$inner:!1}},computed:{disableShowSubtitleCard(){const{currentSources:e}=this.player.states;return!e||e.length<=0},showSubtitleCard:{get(){return this.showSubtitleCard$inner&&!this.disableShowSubtitleCard},set(e){this.showSubtitleCard$inner=e}},trackEnabled(){var e,t;return null!==(e=null===(t=this.player.states.track)||void 0===t?void 0:t.enable)&&void 0!==e&&e},tracksLoaded(){var e,t,n;const o=this.player.states.track;if(!o)return[];const a=null!==(e=o.tracks)&&void 0!==e?e:[],s=null!==(t=null===(n=o.currentTrack)||void 0===n?void 0:n.id)&&void 0!==t?t:null;return a.map((e=>({id:e,label:e,active:e===s})))}},methods:{async handleAddTrack(){const e=await yi();e&&(this.player.addTrack(e),this.player.enableTrack(e.id))},async handleRemoveTrack(e){console.log("Remove track",e),this.player.removeTrack(e)},handleEnableTrack(e=null){const t=this.player.states.track;t&&this.player.enableTrack(e)},handleDisableTrack(){const e=this.player.states.track;e&&e.enable&&this.player.disableTrack()},handleTrackOffset(e){this.player.setTrackOffset(this.player.states.track.offset+(e?.5:-.5))}}},wi=vi,ki=(n("cc0c"),n("90c4")),Ci=Object(g["a"])(wi,mi,_i,!1,null,null,null),$i=Ci.exports;k()(Ci,"components",{QBtn:le["a"],QTr:si["a"],QCard:v["a"],QSpace:re["a"],QColor:X["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QBadge:ki["a"],QItemLabel:qe["a"]});var Si=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:"picture_in_picture_alt",unelevated:"",round:"",disable:e.disable},on:{click:e.handler}})},xi=[],Ti={props:{player:Object},computed:{disable(){const{currentSources:e}=this.player.states;return!e||e.length<=0}},methods:{handler(){this.player.setPiP(!this.player.states.isPiP)}}},Ii=Ti,Pi=Object(g["a"])(Ii,Si,xi,!1,null,null,null),Oi=Pi.exports;k()(Pi,"components",{QBtn:le["a"]});var qi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",{attrs:{size:"0.8rem",icon:e.icon,unelevated:"",round:""},on:{click:e.handler}})},Ei=[],Ai={props:{player:Object},computed:{icon(){return this.player.states.isFullscreen?"fullscreen_exit":"fullscreen"}},methods:{handler(){this.player.setFullscreen(!this.player.states.isFullscreen)}}},Di=Ai,Ni=Object(g["a"])(Di,qi,Ei,!1,null,null,null),Li=Ni.exports;k()(Ni,"components",{QBtn:le["a"]});const ji=e=>{const t=e-Math.floor(e),n=e-t,o=Math.floor(n/3600),a=Math.floor((n-60*o*60)/60),s=n-(60*o*60+60*a);return(o?[o,a,s]:[a,s]).map((e=>(""+e).padStart(2,"0"))).join(":")};var Ri=()=>{const e=5,t=.1;return{mixins:[Ui(),ts()],mounted(){this.hotkey$bind([32,179],"play_switch",(()=>{const{currentSources:e,loadingState:t}=this.player.states;!e||e.length<=0||t||(this.player.states.isPaused?this.player.play():this.player.pause())})),this.hotkey$bind(70,"fullscreen_switch",(()=>{this.player.setFullscreen(!this.player.states.isFullscreen)})),this.hotkey$bind([39,176],"forward",(()=>{console.log("[Ctrl] fwd");const{currentSources:t,loadingState:o}=this.player.states;if(!t||t.length<=0)return;if(o)return;const a=this.player.states,s=Math.max(0,Math.min(a.currentTime+e,a.duration-.001));this.player.seek(s),n.call(this,{icon:"fast_forward",message:`${ji(s)} / ${this.durationLabel}`})})),this.hotkey$bind([37,177],"rewind",(()=>{console.log("[Ctrl] bwd");const{currentSources:t,loadingState:o}=this.player.states;if(!t||t.length<=0)return;if(o)return;const a=this.player.states,s=Math.max(0,Math.min(a.currentTime-e,a.duration-.001));this.player.seek(s),n.call(this,{icon:"fast_rewind",message:`${ji(s)} / ${this.durationLabel}`})})),this.hotkey$bind(38,"volume_up",(()=>{const e=Math.max(0,Math.min(this.player.states.volume+t,1));this.player.setVolume(e)})),this.hotkey$bind(40,"volume_down",(()=>{const e=Math.max(0,Math.min(this.player.states.volume-t,1));this.player.setVolume(e)})),this.hotkey$bind(190,"track_offset_forward",(()=>{this.player.setTrackOffset(this.player.states.track.offset+.5)})),this.hotkey$bind(188,"track_offset_backward",(()=>{this.player.setTrackOffset(this.player.states.track.offset-.5)})),this.$watch((()=>{var e;return null===(e=this.player.states.track)||void 0===e?void 0:e.offset}),((e,t)=>{void 0!==t&&n.call(this,{icon:"subtitles",message:`${e>0?"+":""}${-1===e.toString().indexOf(".")?e+".0":e}s`})})),this.$watch((()=>this.player.states.volume),((e,t)=>{null!==t&&n.call(this,{icon:"volume_up",message:`${Math.round(100*e)}%`})}))}};function n({icon:e,message:t}){this.$refs.centerRef.createDialog({icon:e,message:t,timeout:1e3})}};function Ui(){const e={};let t;const n=[],o={};return{async mounted(){await this.player.promisePlayerReady,e.player=this.$el.parentNode,e.container=e.player.querySelector(".video-js-player>.video-js"),e.controller=this.$el,e.video=e.player.querySelector(".video-js-player>.video-js>video.vjs-tech"),e.controller.hasAttribute("tabIndex")||e.controller.setAttribute("tabIndex","-1"),e.controller.style.outline="none",t=s.bind(this),document.body.addEventListener("keydown",t)},beforeUnmount(){document.body.removeEventListener("keydown",t)},methods:{hotkey$bind:a,hotkey$focus(){const t=document.activeElement;t===e.player||t===e.container||t===e.controller||t===e.video||e.controller.contains(t)||e.container.focus()}}};function a(e,...t){const a={matcher:null,callback:null};function s(){return"function"===typeof e?e:"number"===typeof e?t=>t.which===e:Array.isArray(e)?t=>e.includes(t.which):null}function i(){let e,n;return 2===t.length?(e=t[0],n=t[1]):"function"===typeof t[0]?(e=null,n=t[0]):(e=t[0],n=null),e&&n&&(o[e]=n),e?()=>o[e]():n?()=>n():null}a.matcher=s(),a.callback=i(),a.matcher&&a.callback&&n.unshift(a)}async function s(t){const o=document.activeElement;if(o===e.player||o===e.container||o===e.controller||o===e.video||o===document.body||e.controller.contains(o)){const e=n.find((e=>e.matcher(t)));if(!e)return console.log("[Ctrl] No hotkey",t);console.log("[Ctrl]",e),await e.callback()}}}const Fi=Ta();var Mi={mixins:[Ri(),Bi()],components:{ControllerLayout:Uo,Subtitle:Ho,Center:Wa,Header:Ya,Footer:Ps,Setting:Zs,VolumeButton:ri,PlaybackRateButton:pi,SubtitleButton:$i,PipButton:Oi,FullscreenButton:Li},props:{player:Object},methods:{handleOpenSetting(){this.player.pause(),this.$refs.settingRef.show()},async handleOpenLocalVideo(){console.log("handleOpenLocal");const e=await Fi();if(console.log("source",e),!e)return;await this.player.setSource(e),console.log(this.player.states);const{currentSources:t,loadingState:n}=this.player.states;!t||t.length<=0||n||(console.log(this.player,this.player.play),this.player.play())}}};function Bi(){return{provide(){return{player$settings:this.player$settings}},data(){return{player$settings:{subtitle:{style:"normal",weight:"normal",size:1.25}}}},mounted(){this.$watch((()=>this.player$settings.subtitle.size),(e=>{this.$el.style.setProperty("--subtitle-size",`${e}rem`)}),{immediate:!0}),this.$watch((()=>this.player$settings.subtitle.style),(e=>{this.$el.style.setProperty("--subtitle-style",e)}),{immediate:!0}),this.$watch((()=>this.player$settings.subtitle.weight),(e=>{this.$el.style.setProperty("--subtitle-weight",e)}),{immediate:!0})}}}var Qi=Mi,Wi=Object(g["a"])(Qi,Po,Oo,!1,null,null,null),zi=Wi.exports;k()(Wi,"components",{QBtn:le["a"]});var Hi={name:"VideoJsPlayer",components:{Controller:zi},data(){return{player:null}},mixins:[Vi(),Gi(),Ki()]};function Vi(){const e=e=>e&&e.destroy();return{created(){this.player=this.$videoJs.createPlayer();const e=this.player.play.bind(this);this.player.play=(...t)=>{console.log("[Trigger play]",this.player,this.player.states),e(...t),this.$emit("player-play"),this.player.mute(this.player.states.isMuted)}},mounted(){this.$watch((()=>this.player),(async(n,o)=>{e(o),n&&(await n.initialize(this.$refs.videoRef),t.call(this))}),{immediate:!0})},beforeDestroy(){e(this.player)}};function t(){const e=["openFile"];e.forEach((e=>this.player.ctl$on(e,(()=>this.$emit(e)))))}}function Gi(){return{created(){const e=()=>{var e,t;return null!==(e=null===(t=this.player)||void 0===t?void 0:t.instance)&&void 0!==e?e:null};this.$watch(e,(e=>{if(!e)return;const t=e.contentEl();if(!t)return;const n=t.nextElementSibling;n&&t.appendChild(n)}),{immediate:!0})}}}function Ki(){return{methods:{async setSource(...e){await this.player.promiseReady,await this.player.setSource(...e)}}}}var Yi=Hi,Ji=(n("2163"),Object(g["a"])(Yi,To,Io,!1,null,null,null)),Xi=Ji.exports;window.videojs=Fn["default"],n("94ce"),n("63f2"),n("2079");var Zi=(e,t)=>{const n=new e(xo);e.prototype.$videoJs=n,e.component("VideoJsPlayer",Xi)},er=e=>{const{Vue:t}=e;t.component("AlphabizButton",Ce),t.component("AlphabizSelect",De),t.component("VirtualScrollGrid",Be),t.use(kn),t.use(tr,e),t.config.errorHandler=function(e){throw e},t.use(nr),t.use(Rn,{}),t.use(An,{getLocalConfig:()=>B.a.dynamicConfig.local,getRemoteConfigUrl:()=>B.a.dynamicConfig.remote.url}),t.mixin({computed:{screen$xs(){return this.$q.screen.height<=600||this.$q.screen.width<=600},isPortrait(){return this.$q.screen.height>this.$q.screen.width}}}),t.use(Zi,{})};function tr(e,{store:t}){const o=(...e)=>console.tag.orange("VersionControl",...e),a=()=>t.getters.settings.versionChannel,s=e=>{{const t=n("ae46");return t[e]}},i=e=>{const[t,n,o]=e.split("-");return{version:t,channel:null!==n&&void 0!==n?n:"stable",build:o}},r=e=>{const t=Array.from(e),n=[4,2,2,2,2].reduce(((e,n,o)=>(e[o]=t.splice(0,n).join(""),e)),[]);return new Date(n.splice(0,3).join("-")+" "+n.join(":"))},l=async({wait:e,timeout:t})=>{const n=B.a.versionsUrl,a=async()=>{try{return await(await fetch(n)).json()}catch{return null}},s=async(e,{onTimeout:t,timeout:n})=>{let o,a=!1;return await Promise.race([e.then((e=>{a=!0,o=e})),new Promise((e=>setTimeout(e,n))).then((()=>{a||t&&(o=t())}))]),o},i=(e,{onFailed:t,wait:n})=>{let o=!1;const a=async()=>{let a=await e();while(!a&&!o){if(await new Promise((e=>setTimeout(e,n))),o)break;if(a=await e(),o)break;a||t()}return a},s=a();return s.cancel=()=>o=!0,s},r=i((async()=>await a()),{onFailed(){o().tag("retry").log("retry to fetch versionsInfo")},wait:e}),l=await s(r,{timeout:t,onTimeout(){return o().tag.red("failed").log("failed to fetch versionsInfo"),null}}).finally(r.cancel);return l},c=31536e6,d=1e4,u=new e({data(){return{currentVersion:i(s("version")),buildTime:r(s("buildTime")),versionsInfo:void 0}},computed:{versionState(){if(!Object(xn["isElectron"])())return"active";if(void 0===this.versionsInfo)return"pending";if(this.versionsInfo){const e=i(this.versionsInfo.min[a()]),t=Sn.a.gt([e.version,e.build].filter((e=>!!e)).join("-"),[this.currentVersion.version,this.currentVersion.build].filter((e=>!!e)).join("-"));return t?"force_update":"active"}{const e=new Date-this.buildTime;return e>=c?"force_exit":"active"}}},created(){this.$watch("currentVersion",(e=>{o("currentVersion").log(JSON.parse(JSON.stringify(e)))}),{immediate:!0}),this.$watch("versionsInfo",(e=>{o("versionsInfo").log(e?JSON.parse(JSON.stringify(null!==e&&void 0!==e?e:{})):e)}),{immediate:!0}),this.$watch("versionState",(e=>{o("versionState").log(e)}),{immediate:!0});const e=3e3;l({wait:e,timeout:d}).then((e=>this.versionsInfo=e))}});e.mixin({computed:{vc$versionState(){return u.versionState},vc$buildTime(){return u.buildTime}}})}function nr(e){function t(){let e=0;document.addEventListener("touchstart",(e=>{e.touches.length>1&&e.preventDefault()})),document.addEventListener("touchend",(t=>{const n=(new Date).getTime();n-e<=300&&t.preventDefault(),e=n}),!1),document.addEventListener("gesturestart",(e=>e.preventDefault())),document.addEventListener("dblclick",(e=>e.preventDefault()))}function n(){const e=window.innerHeight;document.documentElement.style.setProperty("--viewport-height",`${e}px`)}window.addEventListener("DOMContentLoaded",t),window.addEventListener("resize",n),window.addEventListener("DOMContentLoaded",n)}var or=n("1926");const ar={account_error_network:["Network error","Network Error"],account_error_attempt_limit_exceeded:["Attempt limit exceeded, please try after some time"],account_error_incorrect_username_or_password:["User does not exist","Incorrect username or password"],account_error_username_not_found:["Username/client id combination not found."],account_error_can_not_reset_for_no_verified:["Cannot reset password for the user as there is no registered/verified email or phone_number"],account_error_invalid_verification_code:["Invalid verification code provided, please try again"],account_error_password_not_long_enough:["Password did not conform with policy: Password not long enough"],account_error_invalid_phone_number_format:["Invalid phone number format"],account_error_no_cell_phone_prefix:["Please select the prefix for the phone number"],account_error_username_already_exists:["User already exists"],account_error_incorrect_password:["Incorrect password"],account_error_you_need_to_accept_license_terms:["you_need_to_accept_license_terms"],account_error_incorrect_original_password:["incorrect_original_password"]},sr={match:e=>Object.values(ar).some((t=>Array.isArray(t)?t.includes(e.message):"object"===typeof t&&Object.keys(t).includes(e.message))),execute(e,t){const n=Object.keys(ar).find((t=>ar[t].some((t=>t.includes(e.message)))));t.$q.notify({message:n,type:"negative",position:"bottom-right",timeout:5e3})}};var ir=[sr],rr=n("b34a"),lr=n("1738"),cr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-btn",e._g(e._b({style:{minWidth:e.minWidth},attrs:{size:"md",align:"around","no-wrap":"",percentage:e.percentage,disable:e.value||e.loading,loading:e.loading,type:e.type,unelevated:!e.shadow,icon:e.icon,label:e.label,color:e.primary?"primary":e.transparent?"transparent":"general","text-color":e.primary?"primary":"general"},scopedSlots:e._u([{key:"loading",fn:function(){return[n("q-spinner",{attrs:{color:e.primary?"primary":"general"}})]},proxy:!0}])},"q-btn",Object.assign({},e.bound),!1),Object.assign({},"button"===e.type?{click:e.handleButton}:{})),[e._t("default")],2)},dr=[],ur={name:"AmplifyButton",props:{primary:Boolean,immediate:Boolean,shadow:{type:Boolean,default:!1},transparent:{type:Boolean,default:!1},minWidth:{type:String,default:"128px"},value:{type:Boolean,default:!1},timeout:{type:Object,default:void 0},icon:{type:String,default:void 0},label:{type:String,default(){return this.icon?void 0:"button"}},type:{type:String,default:"button"},onClick:{type:Function,default:void 0},onAnimationEnd:{type:Function,default:void 0},bound:{type:Object,default(){return{}}}},data(){return{loading:!1,percentage:100,interval:null}},methods:{async handleButton(e){if(this.onClick)if(this.immediate)this.onClick(e);else try{await this.startLoading(this.onClick,e)}finally{await this.stopLoading()}},async startLoading(e,...t){this.$emit("input",!0),this.loading=!0,await new Promise((e=>setTimeout(e,800)));const n=this.timeout?this.timerWrapper(e):e;await n(...t)},async stopLoading(){this.shutdownTimer(),this.timeout&&await new Promise((e=>setTimeout(e,1e3))),this.onAnimationEnd&&this.onAnimationEnd(),this.loading=!1,this.$emit("input",!1)},async startTimer(e,t){const n=100,o=Math.max(100,t/100),a=Math.max(1,Math.floor(o)/t*n);return this.percentage=e,await new Promise(((e,t)=>{const n=()=>{this.percentage=Math.max(0,Math.min(100,this.percentage+a)),this.percentage<100||(this.shutdownTimer(),t(new Error("Timeout")))};this.interval=setInterval(n,o)}))},shutdownTimer(){this.percentage=100,null!==this.interval&&(clearInterval(this.interval),this.interval=null)},timerWrapper(e){const{onTimeout:t,duration:n}=this.timeout;return async(...o)=>{let a;try{a=await Promise.race([this.startTimer(0,n),e(...o)]),this.shutdownTimer()}catch(s){if("Timeout"!==s.message)throw s;t()}return a}}},beforeDestroy(){this.shutdownTimer()}},hr=ur,pr=(n("3c15"),Object(g["a"])(hr,cr,dr,!1,null,"6fc70cc6",null)),mr=pr.exports;k()(pr,"components",{QBtn:le["a"],QSpinner:we["a"]});var _r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{style:Object.assign({},{minWidth:e.minWidth},e.maxWidth?{maxWidth:e.maxWidth}:{},{paddingBottom:e.screen$xs?"calc(44px + 8px)":"8px"}),attrs:{flat:"",bordered:e.bordered}},[e.showCancelCorner?n("amplify-button",{ref:"cornerCancelButton",staticClass:"self-start",staticStyle:{height:"48px"},attrs:{immediate:!0,transparent:!0,icon:"arrow_back","on-click":e.onCancel,"min-width":"64px"},model:{value:e.disable,callback:function(t){e.disable=t},expression:"disable"}}):e._e(),n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:e.showTitle,expression:"showTitle"}],staticClass:"q-py-sm",class:e.screen$xs?"q-px-sm":"q-px-md"},[n("div",{staticClass:"text-h6 text-weight-bold q-py-sm non-selectable"},[e._v(e._s(e.title))])]),n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:e.showDescription,expression:"showDescription"}],staticClass:"q-pt-none q-pb-sm amplify-card-description",class:e.screen$xs?"q-px-sm":"q-px-md"},[e._t("description",null,{disable:e.disable,setDisable:function(t){return e.disable=t}})],2),n("q-form",{directives:[{name:"show",rawName:"v-show",value:e.showForm,expression:"showForm"}],staticClass:"col-grow",on:{submit:e.handleSubmit}},[n("q-card-section",{directives:[{name:"show",rawName:"v-show",value:e.showContent,expression:"showContent"}],staticClass:"col-grow q-pt-none amplify-card-form",class:e.screen$xs?"q-px-sm":"q-px-md"},[e._t("default",null,{disable:e.disable,setDisable:function(t){return e.disable=t}})],2),n("q-card-actions",{directives:[{name:"show",rawName:"v-show",value:e.showCardActions,expression:"showCardActions"}],staticClass:"q-pt-md q-pb-sm amplify-card-actions",class:e.screen$xs?"q-px-sm":"q-px-md",attrs:{align:"stretch",vertical:""}},[e._t("options",null,{disable:e.disable,setDisable:function(t){return e.disable=t}}),e.showSubmitButton?n("amplify-button",{ref:"submitButton",attrs:{primary:!e.noPrimary,type:"submit",timeout:e.timeout,label:e.submitLabel,"on-click":e.onSubmit,"on-animation-end":e.afterSubmit},model:{value:e.disable,callback:function(t){e.disable=t},expression:"disable"}}):e._e(),e.showCancelButton?n("amplify-button",{ref:"cancelButton",attrs:{immediate:"",label:e.cancelLabel,"on-click":e.onCancel},model:{value:e.disable,callback:function(t){e.disable=t},expression:"disable"}}):e._e(),e._t("actions",null,{disable:e.disable,setDisable:function(t){return e.disable=t}})],2)],1)],1)},fr=[],gr=(n("e39c"),{name:"AmplifyCard",props:{title:{type:String,default:void 0},bordered:{type:Boolean,default:!1},minWidth:{type:String,default:"320px"},maxWidth:{type:String,default:void 0},cancelable:{type:Boolean,default:!0},cornerCancel:{type:Boolean,default:!1},submitLabel:{type:String,default(){return this.$t("account_submit")}},cancelLabel:{type:String,default(){return this.$t("account_cancel")}},timeout:{type:Object,default:void 0},onSubmit:{type:Function,default:void 0},onCancel:{type:Function,default:void 0},afterSubmit:{type:Function,default:void 0},noPrimary:Boolean,hideDescription:Boolean,hideOptions:Boolean,hideActions:Boolean},data(){return{disable:!1}},methods:{async handleSubmit(e){await this.$refs.submitButton.handleButton(e)},handleKeydownEsc(){if(this.disable)return;if(!this.showCancelButton&&!this.showCancelCorner)return;const e=this.showCancelButton?"cancelButton":"cornerCancelButton";this.$refs[e].handleButton(null)}},computed:{showCancelCorner(){return this.cancelable&&this.cornerCancel},showTitle(){return!!this.title},showDescription(){return!this.hideDescription&&(!!this.$slots.description||!!this.$scopedSlots.description)},showContent(){return!!this.$slots.default||!!this.$scopedSlots.default},showOptions(){return!this.hideOptions&&(!!this.$slots.options||!!this.$scopedSlots.options)},showActions(){return!this.hideActions&&(!!this.$slots.actions||!!this.$scopedSlots.actions)},showSubmitButton(){return!!this.onSubmit},showCancelButton(){return this.cancelable&&!this.cornerCancel},showForm(){return this.showContent||this.showCardActions},showCardActions(){return this.showOptions||this.showSubmitButton||this.showCancelButton||this.showActions}}}),br=gr,yr=(n("0251"),n("1117")),vr=Object(g["a"])(br,_r,fr,!1,null,null,null),wr=vr.exports;k()(vr,"components",{QCard:v["a"],QCardSection:ie["a"],QForm:yr["a"],QCardActions:yn["a"]});var kr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{attrs:{"no-shake":"",value:e.value,persistent:"","content-class":{"background-blur":e.blur,"background-mask":e.mask,"fullscreen-dialog":!0}},on:{input:function(t){return e.$emit("input",t)}}},[e.single?n("amplify-card",e._b({attrs:{"hide-description":!e.showDescription,"hide-options":!e.showOptions,"hide-actions":!e.showActions},scopedSlots:e._u([{key:"description",fn:function(t){return[e.showDescription?e._t("description",null,null,t):e._e()]}},{key:"default",fn:function(t){return[e.showContent?e._t("default",null,null,t):e._e()]}},{key:"options",fn:function(t){return[e.showOptions?e._t("options",null,null,t):e._e()]}},{key:"actions",fn:function(t){return[e.showActions?e._t("actions",null,null,t):e._e()]}}],null,!0)},"amplify-card",e.cardProps,!1)):[e._t("default",null,{cardProps:e.cardProps,handleSubmit:e.handleSubmit,handleCancel:e.handleCancel})]],2)},Cr=[],$r={name:"AmplifyDialog",props:{value:Boolean,blur:Boolean,mask:Boolean,single:{type:Boolean,default:!0},title:{type:String,default:void 0},minWidth:{type:String,default:void 0},maxWidth:{type:String,default:void 0},cancelable:{type:Boolean,default:!0},cornerCancel:{type:Boolean,default:!1},submitLabel:{type:String,default(){return this.$t("account_submit")}},cancelLabel:{type:String,default(){return this.$t("account_cancel")}},timeout:{type:Object,default:void 0},onSubmit:{type:Function,default:void 0},onCancel:{type:Function,default:void 0},onClear:{type:Function,default:void 0}},data(){return{disable:!1,close:!1}},watch:{value(e){!e&&this.onClear&&setTimeout((()=>this.onClear()),1e3)}},computed:{cardProps(){const e={};return e.title=this.title,e.minWidth=this.minWidth,e.maxWidth=this.maxWidth,e.cancelable=this.cancelable,e.cornerCancel=this.cornerCancel,e.submitLabel=this.submitLabel,e.cancelLabel=this.cancelLabel,e.timeout=this.timeout,this.onSubmit&&(e.onSubmit=()=>this.handleSubmit(this.onSubmit)),this.cancelable&&(e.onCancel=()=>this.handleCancel(this.onCancel)),e.afterSubmit=()=>this.handleAfterSubmit(),e},showDescription(){return!!this.$slots.description||!!this.$scopedSlots.description},showContent(){return!!this.$slots.default||!!this.$scopedSlots.default},showOptions(){return!!this.$slots.options||!!this.$scopedSlots.options},showActions(){return!!this.$slots.actions||!!this.$scopedSlots.actions}},methods:{async handleSubmit(e){e?this.close=await e():this.closeDialog()},async handleCancel(e){if(e){const t=await e();t&&this.closeDialog()}else this.closeDialog()},handleAfterSubmit(){this.close&&(this.close=!1,this.closeDialog())},closeDialog(){this.$emit("input",!1)}}},Sr=$r,xr=(n("4d89"),Object(g["a"])(Sr,kr,Cr,!1,null,null,null)),Tr=xr.exports;k()(xr,"components",{QDialog:y["a"]});var Ir=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-select",e._g({ref:"select",staticClass:"amplify-select",attrs:{dense:"",outlined:"",behavior:"menu",options:e.optionsCpt,readonly:e.readonly,autofocus:e.autofocus,value:e.model,"option-label":e.selectLabelFn,"use-input":Boolean(e.filter),"input-debounce":"0","popup-content-style":e.popupWidth,"input-style":e.enableFilter?"":"display:none","virtual-scroll-item-size":"48",hint:e.hint},on:{input:e.handleInput,keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.pressEnter.apply(null,arguments)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"no-option",fn:function(){return[n("q-item",[n("q-item-section",{staticClass:"text-grey"},[e._v("\n "+e._s(e.$t("no_available_result"))+"\n ")])],1)]},proxy:!0},e.model&&(e.model.icon||e.model.emoji)?{key:"prepend",fn:function(){return[e.model.icon?n("q-icon",{attrs:{name:e.model.icon}}):e.model.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(e.model.emoji))]):e._e()]},proxy:!0}:null,{key:"option",fn:function(t){var o=t.itemProps,a=t.itemEvents,s=t.opt;return[n("q-item",e._g(e._b({staticClass:"overflow-hidden-x",style:e.itemStyle},"q-item",o,!1),a),[s.icon||s.emoji?n("q-item-section",{staticStyle:{"margin-left":"-4px","margin-right":"-22px"},attrs:{avatar:""}},[s.icon?n("q-icon",{attrs:{name:s.icon}}):s.emoji?n("div",{staticClass:"option-flags"},[e._v(e._s(s.emoji))]):e._e()],1):e._e(),n("q-item-section",{staticStyle:{"margin-left":"-4px"}},[n("q-item-label",{domProps:{innerHTML:e._s(s.label)}})],1)],1)]}},e.hint?{key:"hint",fn:function(){return[e._v(e._s(e.hint))]},proxy:!0}:null],null,!0)},Object.assign({},e.filter?{"popup-show":e.onPopupShow,filter:e.filterFn,"popup-hide":e.onPopupHide}:{})))},Pr=[],Or={name:"AmplifySelect",props:{readonly:Boolean,autofocus:Boolean,options:Array,value:[Object,Function,Number,String],itemMaxWidth:{type:String,default:void 0},itemMinWidth:{type:String,default:void 0},selectLabelFn:{type:Function,default:e=>e?e.label:()=>""},align:[Element,Boolean],filter:{type:Function,default:void 0},hint:String},data(){return{enableFilter:!1,filterValue:"",inputWidth:"280"}},computed:{optionsCpt(){const e=e=>{const t={};if("object"===typeof e)for(const[n,o]of Object.entries(e))"label"===n?t.label=(()=>e.label?"function"===typeof e.label?e.label(e.value):e.label:""+e.value)():t[n]=o;else t.value=e,t.label=e;return t},t=this.options.map(e);if(this.filter&&this.enableFilter){const e=e=>""===this.filterValue||this.filter(this.filterValue,e);return t.filter(e)}return t},model(){if(this.enableFilter)return null;{const e=this.optionsCpt.find((e=>e.value===this.value));if(e)return e;throw new Error("invalid amplify-select value: "+this.value)}},itemStyle(){const e={};if(this.align){const t="boolean"===typeof this.align?this.$el:this.align,{width:n}=getComputedStyle(t);e.width=n}return this.itemMinWidth&&(e.minWidth=this.itemMinWidth),this.itemMaxWidth&&(e.maxWidth=this.itemMaxWidth),e},popupWidth(){return this.inputWidth>292?`width: ${1*this.inputWidth+50}px`:`width: ${this.inputWidth-4}px`}},methods:{handleInput(e){e&&this.$emit("input",e.value)},filterFn(e,t){t((()=>{this.filterValue=e}))},onPopupShow(){this.filterValue="",this.enableFilter=!0;const e=this.$el.firstChild;e.style.width="84.36px",this.$emit("popup-show"),this.$nextTick((()=>{this.$refs.select&&this.$refs.select.showPopup()}))},onPopupHide(){this.enableFilter=!1,this.filterValue="";const e=this.$el.nextSibling,t=this.$el.firstChild;e&&(e.style.display=""),t&&(t.style.width="84.36px"),this.$emit("popup-hide")},pressEnter(){this.filter&&(this.optionsCpt.length>0&&this.handleInput(this.optionsCpt[0]),this.enableFilter=!1,this.filterValue="",this.$nextTick((()=>{const e=this.$refs.select.$el.getElementsByTagName("input")[0];e.blur()})))},getInputWidth(){this.$nextTick((()=>{const e=this.$el.firstChild.offsetParent.childNodes[0];this.inputWidth=e.clientWidth}))}},updated(){this.getInputWidth()}},qr=Or,Er=(n("bbb8"),Object(g["a"])(qr,Ir,Pr,!1,null,null,null)),Ar=Er.exports;k()(Er,"components",{QSelect:Ie["a"],QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QInput:K["a"],QItemLabel:qe["a"],QField:Ee["a"]});var Dr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"amplify-input-wrapper"},[e.isTel&&e.phoneNumberPrefixValue?n("amplify-select",{ref:"select",staticClass:"amplify-input-select",class:{focus:e.focusSelect},attrs:{options:e.phoneNumberPrefixOptions,selectLabelFn:function(){return""},readonly:e.readonly,autofocus:!1,align:e.$el,filter:e.phoneNumberPrefixFilter},on:{"popup-show":function(t){return e.selectFocus(!0)},"popup-hide":function(t){return e.selectFocus(!1)}},model:{value:e.phoneNumberPrefixValue,callback:function(t){e.phoneNumberPrefixValue=t},expression:"phoneNumberPrefixValue"}}):e._e(),n("q-input",{directives:[{name:"show",rawName:"v-show",value:!e.focusSelect,expression:"!focusSelect"}],ref:"input",staticClass:"amplify-input",class:{"amplify-tel-input":e.isTel},attrs:{"lazy-rules":"ondemand",spellcheck:"false",dense:"",outlined:"",readonly:e.readonly,autofocus:e.autofocus,value:e.isTel?e.value[1]:e.value,type:"password"===e.type?e.hidePassword?"password":"text":e.type,label:!e.isTel&&e.label?e.label:void 0,rules:e.rulesCpt,min:e.rangeCpt[0],max:e.rangeCpt[1],"error-message":e.errorMessage,error:Boolean(e.errorMessage),hint:e.hint},on:{input:e.handleInput,keydown:function(t){return t.type.indexOf("key")||8===t.keyCode?e.onPressBack.apply(null,arguments):null},focus:function(t){return e.inputFocus(!0)},blur:function(t){return e.inputFocus(!1)}},nativeOn:{paste:function(e){e.stopPropagation()}},scopedSlots:e._u([{key:"prepend",fn:function(){return[e.isTel&&e.value[0]&&e.prefixStart?n("div",{staticClass:"amplify-input-phone-number-prefix"},[e._v("\n +"+e._s(e.value[0])+"\n ")]):e._e(),e.icon&&!e.isTel?n("q-icon",{attrs:{name:e.icon}}):e._e()]},proxy:!0},"password"===e.type?{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}:null],null,!0)})],1)},Nr=[],Lr=n("c228");const jr=(()=>{const e={};Object.values(Lr["a"]).forEach((t=>{t.phones.forEach((n=>{const[o,a]=n.split("-");e[n]={value:n,label:`${t.name} (+${o})`,emoji:t.emoji,prefixCode:o,countryCode:a,normalizedName:t.normalizedName,nativeName:t.name}}))}));const t=Object.keys(e).sort(((t,n)=>{const o=parseInt(e[t].prefixCode),a=parseInt(e[n].prefixCode);return o===a?1===o?"US"===e[t].countryCode?-1:"US"===e[n].countryCode?1:0:0:o>a?1:-1}));return t.reduce(((t,n)=>(t[n]=e[n],t)),{})})();var Rr={name:"AmplifyInput",props:{value:[String,Array],readonly:Boolean,autofocus:Boolean,required:{type:[Boolean,String],default:!1},type:{type:String,default:"text"},label:String,icon:String,rules:Array,range:Array,mask:String,errorMessage:String,hint:String},data(){return{focusSelect:!1,hidePassword:!0,prefixStart:!0}},computed:{isTel(){return"tel"===this.type},rulesCpt(){const e=e=>this.requiredRule(e),t=this.rules?this.rules.map((e=>t=>{const n=e(t);return"string"===typeof n?this.$t(n):"object"===typeof n&&Array.isArray(n)?this.$t(...n):n})):null,n=[...this.required?[e]:[],...t||[]];return this.isTel&&n.push((e=>this.phoneNumberRule(e))),n},rangeCpt(){const e={date:["1900-01-01","2099-12-31"]},t=e[this.type]||[void 0,void 0];return this.range&&([void 0,null].includes(this.range[0])||(t[0]=this.range[0]),[void 0,null].includes(this.range[1])||(t[1]=this.range[1])),t},phoneNumberNotSay(){if(this.isTel)return{value:"notSay",label:"notSay",emoji:"🇼🇫"}},phoneNumberPrefixOptions(){if(!this.isTel)return;const e=Object.values(jr);return e.unshift(this.phoneNumberNotSay),e},phoneNumberPrefixValue:{get(){if(!this.isTel)return;const e=this.value[0],t=this.value[2];return e&&t?`${e}-${t}`:this.phoneNumberNotSay.value},set(e){if(this.isTel)if(e&&e!==this.phoneNumberNotSay.value){const{prefixCode:t,countryCode:n}=jr[e];let o=this.value[1];o.startsWith("+")&&(o=o.substr(1)),o.startsWith("00")&&(o=o.substr(2)),this.$emit("input",[t,o,n]),localStorage.setItem("def_tel_prefix",`${n}-${t}`)}else this.$emit("input",["",this.value[1],""])}}},methods:{selectFocus(e){this.focusSelect=e},inputFocus(e){var t,n,o,a,s,i;(console.log("On focus input",e),e)?null===(t=this.$refs.select)||void 0===t||null===(n=t.$el)||void 0===n||null===(o=n.classList)||void 0===o||o.add("q-field--highlighted","q-field--focus"):null===(a=this.$refs.select)||void 0===a||null===(s=a.$el)||void 0===s||null===(i=s.classList)||void 0===i||i.remove("q-field--highlighted","q-field--focus")},handleInput(e){this.$refs.input.resetValidation(),this.isTel?this.handlePhoneNumberInput(e):this.$emit("input",e)},requiredRule(e){if(this.isTel)return this.phoneNumberRequiredRule(e);if(e&&e.length>0)return!0;const t="string"===typeof this.required?this.required:this.label;return`${t}${this.$t("account_is_required")}`},phoneNumberRequiredRule(e){const t=e[1];if(t)return!0;{const e="string"===typeof this.required?this.required:this.label;return`${e}${this.$t("account_is_required")}`}},phoneNumberRule(e){const t=e[1];return this.phoneNumberPrefixValue===this.phoneNumberNotSay.value&&t?this.$t("account_error_no_cell_phone_prefix"):(this.phoneNumberPrefixValue===this.phoneNumberNotSay.value||t||(this.phoneNumberPrefixValue=this.phoneNumberNotSay.value),!0)},phoneNumberPrefixFilter(e,t){const n=["normalizedName","nativeName","value"];return n.find((n=>!!t[n]&&t[n].toLowerCase().indexOf(e.toLowerCase())>=0))},handlePhoneNumberInput(e){const t=()=>{if(!e)return this.phoneNumberNotSay;const t=e.startsWith("+"),n=e.startsWith("00"),o=t?"+":n?"00":Array.isArray(this.value)&&this.value[0]?"__":"";return this.phoneNumberPrefixOptions.find((({prefixCode:t})=>e.startsWith(`${o}${t}`)))||null},n=t();if(void 0===n||null===n)this.$emit("input",[this.value[0],e,this.value[2]]);else if(n===this.phoneNumberNotSay)this.$emit("input",[this.value[0],e,this.value[2]]);else{const{prefixCode:t,countryCode:o}=jr[n.value];let a=e;if(a.startsWith("+")&&(a=a.substr(1)),a.startsWith("00")&&(a=a.substr(2)),a.startsWith(t)&&(a=a.substr(t.length)),this.$emit("input",[t,a,o]),!t||!o)return;localStorage.setItem("def_tel_prefix",`${o}-${t}`)}},onPressBack(e){const t=e.target;if(console.log("press back",JSON.stringify(this.value),t.selectionStart,t.selectionEnd),"email"===t.type)return console.log("Default behavior for email");const n=t.selectionDirection,o=t.selectionStart,a=t.selectionEnd,s=o===a?o-1:o,i=s<0?0:s;if(this.$nextTick((async()=>{await this.$nextTick();try{t.setSelectionRange(i,i,n)}catch(e){console.log(e.message)}})),e.preventDefault(),e.stopPropagation(),this.isTel)this.value[1]=this.value[1].substring(0,o===a?o-1:o)+this.value[1].substring(a),this.handlePhoneNumberInput(this.value[1]);else{const e=this.value.substring(0,o===a?o-1:o)+this.value.substring(a);this.$emit("input",e)}0===o&&0===a&&this.isTel&&this.$emit("onPressBack"),this.isTel&&0===a&&0===this.value[1].length&&this.$emit("input",["","",""])}},updated(){this.prefixStart=!0}},Ur=Rr,Fr=(n("2214"),Object(g["a"])(Ur,Dr,Nr,!1,null,null,null)),Mr=Fr.exports;function Br(e){e.component("AmplifyButton",mr),e.component("AmplifyCard",wr),e.component("AmplifyDialog",Tr),e.component("AmplifySelect",Ar),e.component("AmplifyInput",Mr)}k()(Fr,"components",{QInput:K["a"],QIcon:Y["a"],QField:Ee["a"]});var Qr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"amplify-dialog-groups"},[n("SignedOutDialog",{ref:"signedOut"})],1)},Wr=[],zr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"amplify-signed-out-dialog"},[n("amplify-dialog",{attrs:{single:!1,cornerCancel:!0,"min-width":"320px","max-width":"320px","on-clear":e.onClear,blur:!0,mask:!1},scopedSlots:e._u([{key:"default",fn:function(t){return["test"===e.currentCard?n("OAuth",e._g({ref:"test",attrs:{scope:t}},e.cardEvents)):"oauth"===e.currentCard?n("OAuth",e._g({ref:"oauth",attrs:{scope:t}},e.cardEvents)):"disableMFA"===e.currentCard?n("DisableMFA",e._g({attrs:{scope:t}},e.cardEvents)):"signedOut"===e.$store.state.account.authState?n("SignIn",e._g({attrs:{scope:t}},e.cardEvents)):"forgotPassword"===e.$store.state.account.authState?n("ForgotPassword",e._g({attrs:{scope:t}},e.cardEvents)):"signUp"===e.$store.state.account.authState?n("SignUp",e._g({attrs:{scope:t}},e.cardEvents)):"signInConfirm"===e.$store.state.account.authState?n("SignInConfirm",e._g({attrs:{scope:t}},e.cardEvents)):e._e()]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("div",{directives:[{name:"show",rawName:"v-show",value:e.value,expression:"value"}],staticClass:"signed-out-actions rounded-borders bg-general text-general row items-center q-py-xs q-px-sm shadow-1"},[e.$store.getters.settings.disableDevTools?e._e():n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.showDevDialog,expression:"!showDevDialog"}],attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"developer_mode"},on:{click:e.handleDevClick}},[n("q-tooltip",[e._v(e._s(e.$t("development")))]),n("q-dialog",{attrs:{"transition-show":"slide-up","transition-hide":"slide-down"},model:{value:e.showDevDialog,callback:function(t){e.showDevDialog=t},expression:"showDevDialog"}},[n("div",{staticClass:"development-dialog"},[n("div",{staticClass:"q-px-md q-py-sm flex items-center"},[n("div",{staticClass:"text-h6 text-bold"},[e._v("Development Panel")]),n("q-space"),n("q-btn",{attrs:{"fab-mini":"",unelevated:"",icon:"close"},on:{click:function(t){e.showDevDialog=!1}}})],1),n("q-separator"),n("div",{staticClass:"scroll-y"},[n("Development")],1)],1)])],1),n("q-btn",{attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"language"}},[n("q-tooltip",[e._v(e._s(e.language))]),n("q-menu",{attrs:{"transition-show":"jump-up","transition-hide":"jump-down"}},[n("q-list",e._l(e.languageOptions,(function(t){return n("q-item",{directives:[{name:"ripple",rawName:"v-ripple"},{name:"close-popup",rawName:"v-close-popup"}],key:t.value,attrs:{clickable:"",tag:"label"},on:{click:function(){return e.language=t.value}}},[n("q-item-section",{staticStyle:{width:"120px"}},[n("q-item-label",[e._v(e._s(t.label))])],1)],1)})),1)],1)],1),n("q-btn",{attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"info"},on:{click:e.showAboutDialog}},[n("q-tooltip",[e._v(e._s(e.$t("feedback")+"/"+e.$t("diagnotic")))])],1)],1)],1)},Hr=[],Vr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit(e.handleSignIn)},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_sign_in_your_account"),"submit-label":e.$t("account_sign_in"),timeout:e.timeout,"no-primary":"",cancelable:"PHONE_NUMBER"===this.form.currentMode},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.disable;return[n("div",{staticClass:"column q-col-gutter-xs"},e._l(e.form.items,(function(t,a){return n("amplify-input",e._b({key:a,ref:"sign",refInFor:!0,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{input:function(t){return e.signInChangeRules()},onPressBack:e.onPressBack},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),1),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v(e._s(e.$t("account_forgot_your_password"))),n("a",{staticClass:"underscore text-primary q-ml-xs cursor-pointer",attrs:{disabled:o||e.oauthLoading},on:{click:function(t){!o&&!e.oauthLoading&&e.handleResetPassword()}}},[e._v(e._s(e.$t("account_reset_password")))])])]}},{key:"actions",fn:function(t){var o=t.disable;return[n("amplify-button",{staticStyle:{"margin-top":"8px"},attrs:{immediate:"",primary:"",value:o,"on-click":function(){return e.$store.commit("ACCOUNT_UPDATE_STATE","signUp")},label:e.$t("account_sign_up")}}),n("ABOAuthEntry",{directives:[{name:"show",rawName:"v-show",value:e.d$cfg.oauth.enable&&!e.isMas,expression:"d$cfg.oauth.enable && !isMas"}]})]}}])},"amplify-card",e.scope.cardProps,!1))},Gr=[],Kr=n("7ca3"),Yr=n.n(Kr),Jr=n("c581"),Xr=n("af04"),Zr=n("9efe"),el=n("072b");class tl extends Jr["b"]{static createConfigs(e){return{GENERAL:["",{type:"text",icon:"account_box",label:"account_username_email_phone"}],SINGIN:[["86","","CN"],{type:"tel",label:"account_username_email_phone",rules:[el["e"].bind(e)]}]}}constructor(e){super(...tl.createConfigs(e).GENERAL),this.currentMode="GENERAL",this.configs=tl.createConfigs(e)}setMode(e,t){if(this.currentMode===e)return this;this.currentMode=e;const n=this.configs[e];return this.model=n[0],this.attrs=n[1],t&&this.updateModel(t),this}}class nl extends Jr["a"]{constructor(e,t){if(super({username:new tl(e),password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password"})}),this.assumeData=nl.storage.getAssumeData(),!this.assumeData){var n;const e=null!==(n=Lr["b"][t])&&void 0!==n?n:Lr["b"]["en-us"],[o,a]=e.phones[0].split("-");this.assumeData={prefix:o,code:a}}this.assume=!1}get formData(){const e=super.formData;if(!e.username)return e;let t=e.username;return(()=>{this.assume=!1,Array.isArray(t)?(nl.storage.setAssumeData({prefix:t[0],code:t[2]}),this.assumeData=nl.storage.getAssumeData(),t="+"+t[0]+t[1]):!t.startsWith("+")&&/^[0-9]*$|^$/g.test(t)&&(/^00/.test(this.model)?t=t.replace(/^00/,"+"):(this.assume=!0,t="+"+this.assumeData.prefix+t))})(),e.username=t,e}turnToPhoneNumberMode(){if("GENERAL"!==this.currentMode)return;this.assume=!1;const e=this.items.username.value,{prefix:t,code:n}=this.assumeData;this.items.username.setMode("PHONE_NUMBER",[t,e,n]),this.items.password.clear()}backToGeneralMode(){if("GENERAL"===this.currentMode)return;const e=this.formData.username;this.assume=!1,this.items.username.setMode("GENERAL",e),this.items.password.clear()}get currentMode(){return this.items.username.currentMode}}Yr()(nl,"storage",{setAssumeData(e){window.localStorage.setItem("sign_in_assume_data",JSON.stringify(e))},getAssumeData(){const e=window.localStorage.getItem("sign_in_assume_data");return e?JSON.parse(e):null}});var ol={name:"SignIn",props:{scope:Object},data(){return{isMas:In.a.mas(),timeout:{duration:6e4,onTimeout:this.handleTimeout},oauthStatus:null,form:new nl(this,this.$q.lang.getLocale().toLowerCase()),oauthProviders:["Facebook","Google","Github"],signUpMode:"email",prefix:"",countryCode:"",checkPrefix:[[],[]]}},computed:{oauthLoading(){return null!==this.oauthStatus}},methods:{handleResetPassword(){this.$store.commit("ACCOUNT_UPDATE_STATE","forgotPassword")},async handleSignIn(){try{const e=this.form.formData,t=e=>e.indexOf(" ")<0;if(!t(e.username))throw new Error("Incorrect username or password.");return await this.$store.dispatch("ACCOUNT_SIGN_IN",e),Zr["a"].record.call(this,e.password),this.$store.commit("ACCOUNT_UPDATE_STATE","signedIn"),Xr["a"].showPositive("signed_in"),!0}catch(t){const n=t.message;if("SMS_MFA"===n||"SOFTWARE_TOKEN_MFA"===n)this.$store.commit("ACCOUNT_UPDATE_STATE","signInConfirm");else if("User does not exist."===n)Xr["a"].showNegative("Incorrect username or password."),this.form.assume&&this.form.turnToPhoneNumberMode();else{var e;t.message||(console.log("=====================> error SignIn::handleSignIn <====================="),console.log(t),console.log("=====================> error SignIn::handleSignIn <=====================")),Xr["a"].showNegative(null!==(e=t.message)&&void 0!==e?e:t)}}},async handleCancel(){if("PHONE_NUMBER"!==this.form.currentMode)return!0;this.form.backToGeneralMode()},handleOAuthSignIn(e){this.$emit("setCurrentCard","oauth",(t=>t.setStatus("pending",e)))},handleTimeout(){Xr["a"].showNegative("Network error")},signInChangeRules(){if("email"===this.signUpMode&&(this.vm=this.form.items.username.model?this.form.items.username.model:"",Array.isArray(this.vm)&&(this.vm=this.vm[1]||""),this.vm&&/^[0-9]*$/g.test(this.vm)&&(console.log("toPhone",this.vm),this.toPhone()),this.vm.startsWith("+"))){const e=this.vm.substr(1),t=this.checkPrefix[0].indexOf(e),n=this.vm.length;if(-1!==t&&(this.form.items.username.model="1"===e?[e,"","US"]:[e,"",this.checkPrefix[1][t]],localStorage.setItem("def_tel_prefix",`${this.form.items.username.model[2]}-${e}`),this.form.items.username.attrs.type="tel",this.signUpMode="phoneNumber"),n>4&&/^[0-9]*$/g.test(e))for(const[o,a]of this.checkPrefix[0].entries())if(e.startsWith(a)){const t=a.length,n=e.substr(t);this.form.items.username.model="1"!==a?[a,n,this.checkPrefix[1][o]]:[a,n,"US"],localStorage.setItem("def_tel_prefix",`${this.form.items.username.model[2]}-${a}`),this.form.items.username.attrs.type="tel",this.signUpMode="phoneNumber";break}}if("phoneNumber"===this.signUpMode){this.vm=this.form.items.username.model[1]?this.form.items.username.model[1]:"";const e=this.form.items.username.model[2];-1===this.vm.indexOf("@")&&e&&!this.vm.startsWith("+")||(console.log("country",e),this.toEmail()),/^[0-9]*$/g.test(this.vm)||(console.log("not vm",JSON.stringify(this.vm)),this.toEmail())}},toPhone(){console.log("fn:toPhone"),this.form.items.username.model=[this.prefix,this.vm,this.countryCode],this.form.items.username.attrs.type="tel",this.signUpMode="phoneNumber"},toEmail(){console.log("fn:toEmail",this.vm,typeof this.vm),this.$nextTick((()=>{this.form.items.username.attrs.type="text",this.form.items.username.model=this.vm,console.log(this.form.items.username.model),this.signUpMode="email"}))},defPrefix(){const e=localStorage.getItem("def_tel_prefix");if(e){const t=e.split("-");this.prefix=t[1],this.countryCode=t[0]}else{const e=(this.$i18n.locale||navigator.language||"").toLowerCase(),t=Object.values(Lr["a"]).find((t=>t.languages.includes(e)));if(t&&t.phones&&t.phones.length){console.log("[Init Prefix] Init with phone",t.phones[0]);const e=t.phones[0].split("-");this.prefix=e[0],this.countryCode=e[1]}else console.log("[Init Prefix] Cannot find language config for",e,t),this.prefix="1",this.countryCode="US"}},prefixArr(){const e=[];Object.values(Lr["a"]).forEach((t=>{const n=t.phones[0].split("-");e.push(n)})),e.sort(((e,t)=>{const n=parseInt(e[0]),o=parseInt(t[0]);return n-o})),e.forEach((e=>{this.checkPrefix[0].push(e[0]),this.checkPrefix[1].push(e[1])}))},onPressBack(){this.toEmail(),console.log(this.form)},getSelection(){const e=this.$refs.sign[0];return e.$el.firstChild.clientWidth}},mounted(){this.defPrefix(),this.prefixArr()}},al=ol,sl=(n("fc65"),Object(g["a"])(al,Vr,Gr,!1,null,"6e4f640d",null)),il=sl.exports,rl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit([e.handleNecessary,e.handleOptional][e.progress])},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_sign_up_your_account")+" ("+(e.progress+1)+"/2)","submit-label":e.$t(["account_next","account_finish"][e.progress])},scopedSlots:e._u([{key:"description",fn:function(){return[e._v("\n "+e._s([e.$t("account_fill_required_fields"),e.description][e.progress])+"\n ")]},proxy:!0},{key:"default",fn:function(t){var o=t.disable,a=t.setDisable;return[0===e.progress?[n("div",{staticClass:"column q-col-gutter-xs"},[e._l({email:e.necessaryEmailForm,phoneNumber:e.necessaryPhoneNumberForm}[e.signUpMode].items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{onPressBack:function(n){return e.onPressBack(t)}},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v("\n "+e._s(e.$t({phoneNumber:"account_no_phone_number",email:"account_no_email"}[e.signUpMode]))),n("a",{staticClass:"underscore select-none text-primary cursor-pointer",attrs:{disabled:o},on:{click:function(t){o||e.handleSwitchMode()}}},[e._v(e._s(e.$t({phoneNumber:"account_sign_up_by_email",email:"account_sign_up_by_phone_number"}[e.signUpMode])))])])],2)]:1===e.progress?[e._l(e.verificationForm.items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{onPressBack:function(n){return e.onPressBack(t)}},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),n("div",[n("amplify-button",{staticClass:"q-mb-sm q-mt-xs",attrs:{value:o||e.resendTimer>0,"min-width":"100%",label:e.$t("account_resend_code")+(e.resendTimer>0?" ("+e.resendTimer+"s)":""),"on-click":e.handleResend},on:{input:a}}),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v("\n "+e._s(e.$t("account_no_verification_code"))),n("a",{staticClass:"underscore select-none text-primary cursor-pointer",attrs:{disabled:o},on:{click:function(t){o||e.handleSwitchMode()}}},[e._v(e._s(e.$t({phoneNumber:"account_sign_up_by_email",email:"account_sign_up_by_phone_number"}[e.signUpMode])))])])],1),n("div",[e._v("\n "+e._s(e.$t("account_fill_optional_fields"))+"\n "),e._l(e.optionsForm.items,(function(t,a){return["input"===t.type?n("amplify-input",e._b({key:a,staticClass:"q-mb-sm",attrs:{label:e.$t(t.bound.label),readonly:o,hint:"("+e.$t("optional")+")"},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1)):"select"===t.type?n("amplify-select",e._b({key:a,staticClass:"q-mb-sm",attrs:{readonly:o,hint:"("+e.$t("optional")+")",align:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-select",t.bound,!1)):e._e()]}))],2)]:e._e()]}},0===e.progress?{key:"options",fn:function(t){var o=t.disable;return[n("div",{staticClass:"col-grow q-mb-sm row items-center",staticStyle:{"margin-top":"-8px"}},[n("q-checkbox",{attrs:{disable:o,label:e.$t("account_i_accept")},model:{value:e.accept,callback:function(t){e.accept=t},expression:"accept"}}),n("div",{staticClass:"underscore select-none cursor-pointer text-primary",on:{click:function(){return o||e.handleShowLicense()}}},[e._v(e._s(e.$t("account_license_terms"))+"\n ")])],1)]}}:null],null,!0)},"amplify-card",e.scope.cardProps,!1))},ll=[],cl=n("9f21");function dl(e){const t=e.appVersion,n=e.userAgent;let o="unknown",a="";const s=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var i in s){var r=s[i];if(r.r.test(n)){o=r.s;break}}switch(/Windows/.test(o)&&(a=/Windows (.*)/.exec(o)[1],o="Windows"),o){case"Mac OS":case"Mac OS X":case"Android":a=/([\\.\\_\d]+)/.exec(n.substring(/(Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/.exec(n).index||12))[1];break;case"iOS":a=/OS (\d+)_(\d+)_?(\d+)?/.exec(t),a=a[1]+"."+a[2]+"."+(0|a[3]);break}return o+(a?" "+a:"")}class ul extends Jr["a"]{constructor(e){super({email:new Jr["b"]("",{type:"email",icon:"email",label:"account_email",rules:[el["a"].bind(e)]}),password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[el["d"].bind(e)]})})}}class hl extends Jr["a"]{constructor(e){super({phoneNumber:new Jr["b"](["86","","CN"],{type:"tel",icon:"phone",label:"account_phone_number",rules:[el["e"].bind(e)]}),password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[el["d"].bind(e)]})})}setDefault(e){var t;const n=null!==(t=Lr["b"][e])&&void 0!==t?t:Lr["b"]["en-us"],[o,a]=n.phones[0].split("-"),s=this.items.phoneNumber;return s.updateModel([o,s.value[1],a]),this}}class pl extends Jr["a"]{constructor(e){const t=[{value:"notSay",emoji:"🇼🇫",label:e.$t("account_not_say")},...Jr["c"].LOCALE_OPTIONS],n=(e,t)=>!!t.normalizedName&&(t.normalizedName.toLowerCase().indexOf(e.toLowerCase())>=0||t.label.toLowerCase().indexOf(e.toLowerCase())>=0);super({nickname:new Jr["b"]("",{type:"text",icon:"emoji_emotions",label:"account_nickname",rules:[el["c"].bind(e)]}),gender:new Jr["c"]("notSay",[{value:"notSay",icon:"elevator",label:e.$t("account_not_say")},{value:"female",icon:"female",label:e.$t("account_female")},{value:"male",icon:"male",label:e.$t("account_male")}]),birthday:new Jr["b"]("",{type:"date",icon:"cake"}),locale:new Jr["c"]("notSay",t,{filter:n})})}}var ml={name:"SignUp",mixins:[cl["a"]],props:{scope:Object},data(){return{resendInterval:null,resendTimer:0,progress:0,necessaryEmailForm:new ul(this),necessaryPhoneNumberForm:new hl(this).setDefault(this.$q.lang.getLocale().toLowerCase()),signUpMode:"phoneNumber",invitationForm:new Jr["a"]({invitationCode:new Jr["b"]("",{type:"text",icon:"verified",label:"account_invitation_code",rules:[el["b"].bind(this)]})}),accept:!1,verificationForm:new Jr["a"]({code:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})}),optionsForm:new pl(this),signUpIpAddress:"",defPrefix:[]}},computed:{description(){return this.$store.state.account.verification?{email:`${this.$t("account_email_sent_tip")}${this.$store.state.account.verification.destination}`,phone_number:`${this.$t("account_phone_sent_tip")}${this.$store.state.account.verification.destination}`}[this.$store.state.account.verification.type]:this.$t("account_tip_verified")}},watch:{signUpMode(e){const t=()=>{this.necessaryPhoneNumberForm.clearData().setDefault(this.$q.lang.getLocale().toLowerCase())},n=()=>{this.necessaryEmailForm.clearData()};({email:t,phoneNumber:n})[e]()},progress(e){e<0&&this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut")},resendTimer(e,t){0===t&&(this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=setInterval((()=>{0!==this.resendTimer?this.resendTimer-=1:(clearInterval(this.resendInterval),this.resendInterval=null)}),1e3))}},methods:{handleCancel(){this.progress=-1},async handleNecessary(){if(this.accept)try{if(Object(xn["isElectron"])()){const e=await fetch("https://api.ipify.org").then((e=>e.text()),(e=>{console.log("SignUp - Failed to get geo for",e.message)}));this.signUpIpAddress=e||""}const e=this.__getNecessaryPayload(),t=(()=>{const n=Object(Zr["s"])();if(e.email){const a=o(3e4),s=n(e.email);return Promise.race([s,a]).catch((e=>{console.log("sign up error >",e),Xr["a"].showNegative(e.message)})).finally((()=>{t.off(),a.cancel()})),s}{const e=Promise.resolve();return e.off=()=>{},e}function o(e){let t;const n=new Promise((n=>{t=()=>{clearTimeout(o),n(!1)};const o=setTimeout((()=>{n(!0)}),e)}));return n.cancel=t,n}})();await this.$store.dispatch("ACCOUNT_SIGN_UP_NECESSARY",e).catch((e=>{throw t.off(),e})),this.resendTimer=60,this.progress+=1}catch(e){Xr["a"].showNegative(e.message)}else Xr["a"].showNegative("you_need_to_accept_license_terms")},async handleOptional(){try{const{code:e}=this.verificationForm.formData;await this.$store.dispatch("ACCOUNT_SIGN_UP_VERIFICATION_CODE_SUBMIT",{code:e,optAttrs:{app_client:JSON.stringify({name:B.a.name,version:Object(qn["a"])("version")}),os:dl(navigator)||"unknown",...this.optionsForm.formData}}),await new Promise((e=>setTimeout(e,3e3))),Xr["a"].showPositive("signed_up")}catch(e){return Xr["a"].showNegative(e.message),!1}try{const e=this.$store.state.account.verification.username,t=this.$store.state.account.verification.password;return await this.$store.dispatch("ACCOUNT_SIGN_IN",{username:e,password:t}),this.$store.commit("ACCOUNT_UPDATE_VERIFICATION",null),this.$store.commit("ACCOUNT_UPDATE_STATE","signedIn"),!0}catch(e){this.$emit("setCurrentCard","signedOut"),Xr["a"].showNegative(e.message)}},async handleResend(){try{await this.$store.dispatch("ACCOUNT_SIGN_UP_VERIFICATION_CODE_RESEND"),Xr["a"].showPositive("code_has_been_resent")}catch(e){Xr["a"].showNegative(e.message)}finally{this.resendTimer=60}},handleSwitchMode(){1===this.progress&&(this.$store.commit("ACCOUNT_UPDATE_VERIFICATION",null),this.progress=0),this.signUpMode="email"===this.signUpMode?"phoneNumber":"email"},handleShowLicense(){this.showLicenseTermsNotice(!1)},async copyCode(){await navigator.clipboard.writeText("5EPD12NW3F"),this.$q("Test Invitation Code copied")},__getNecessaryPayload(){const e={email:this.necessaryEmailForm,phoneNumber:this.necessaryPhoneNumberForm}[this.signUpMode],t=e.formData,{invitationCode:n}=this.invitationForm.formData,{email:o,phoneNumber:a,password:s}=t,i={};return"email"===this.signUpMode?i.email=o:"phoneNumber"===this.signUpMode&&(i.phoneNumber="+"+a[0]+a[1],i.phoneNumberCountryCode=a[2]),i.password=s,i.invitationCode=n,i.appClient=JSON.stringify({name:B.a.name,version:Object(qn["a"])("version")}),i.signUpIpAddress=this.signUpIpAddress,i.os=dl(navigator)||"unknown",i},onPressBack(e){if(!e)return;const{attrs:t,model:n}=e;t&&"tel"===t.type&&Array.isArray(n)&&(console.log("isTel",n),this.$set(n,0,""),this.$set(n,2,""))}},mounted(){const e=localStorage.getItem("def_tel_prefix");if(e){const t=e.split("-");this.defPrefix=[t[1],"",t[0]],this.necessaryPhoneNumberForm.items.phoneNumber.model=[...this.defPrefix]}},beforeDestroy(){this.resendInterval&&clearInterval(this.resendInterval),this.resendInterval=null}},_l=ml,fl=(n("472b"),n("7498")),gl=Object(g["a"])(_l,rl,ll,!1,null,"dbc17096",null),bl=gl.exports;k()(gl,"components",{QCheckbox:fl["a"]});var yl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit([e.handleSearch,e.handleSubmit][e.progress])},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t(["account_find_your_account","account_reset_your_password"][e.progress]),"submit-label":e.$t(["account_search","account_submit"][e.progress])},scopedSlots:e._u([{key:"description",fn:function(){return[e._v("\n "+e._s([e.$t("account_enter_your_username"),e.verifyDescription][e.progress])+"\n ")]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return[n("div",{staticClass:"column q-col-gutter-xs"},e._l([e.searchForm,e.submitForm][e.progress].items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},on:{input:e.onInput,onPressBack:e.onPressBack},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),1)]}},1===e.progress?{key:"actions",fn:function(t){var o=t.disable,a=t.setDisable;return[n("amplify-button",{attrs:{value:o||e.resendTimer>0,label:e.$t("account_resend_code")+(e.resendTimer>0?" ("+e.resendTimer+"s)":""),"on-click":e.handleSearch},on:{input:a}})]}}:null],null,!0)},"amplify-card",e.scope.cardProps,!1))},vl=[],wl=n("4027"),kl=wl["a"],Cl=Object(g["a"])(kl,yl,vl,!1,null,null,null),$l=Cl.exports,Sl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit(e.handleVerify)},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_verify_your_identity"),"submit-label":e.$t("account_next"),timeout:e.timeout},scopedSlots:e._u([{key:"description",fn:function(){return[e._v("\n "+e._s(e.verifyDescription)+"\n ")]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return[e._l(e.form.items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})),n("p",{staticClass:"q-pl-sm q-pt-sm q-pb-none text-grey-7"},[e._v(e._s(e.$t("account_can_not_mfa"))),n("a",{staticClass:"underscore text-primary q-ml-xs cursor-pointer",attrs:{disabled:o},on:{click:e.handleDisableMFA}},[e._v(e._s(e.$t("account_disable_mfa")))])])]}}])},"amplify-card",e.scope.cardProps,!1))},xl=[],Tl={name:"SignInConfirm",props:{scope:Object},data(){return{timeout:{duration:6e4,onTimeout:this.handleTimeout},form:new Jr["a"]({code:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})})}},computed:{verifyDescription(){return this.$store.state.account.verification?{email:`${this.$t("account_email_sent_tip")}${this.$store.state.account.verification.destination}`,phone_number:`${this.$t("account_phone_sent_tip")}${this.$store.state.account.verification.destination}`,software_token:`${this.$t("account_software_token_tip")}`}[this.$store.state.account.verification.type]:this.$t("account_tip_verified")}},methods:{async handleVerify(){try{const{code:e}=this.form.formData;return await this.$store.dispatch("ACCOUNT_MFA_SUBMIT",e),this.$store.commit("ACCOUNT_UPDATE_STATE","signedIn"),Xr["a"].showPositive("signed_in"),!0}catch(e){Xr["a"].showNegative(e.message),e.message.startsWith("Invalid session for the user")&&this.handleCancel()}},handleDisableMFA(){this.$emit("setCurrentCard","disableMFA")},handleTimeout(){Xr["a"].showNegative("Network Error")},handleCancel(){this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut")}}},Il=Tl,Pl=(n("2e34"),Object(g["a"])(Il,Sl,xl,!1,null,"654a46b2",null)),Ol=Pl.exports,ql=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"on-submit":function(){return e.scope.handleSubmit([e.handleSend,e.handleSubmit][e.progress])},"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_disable_mfa"),"submit-label":e.$t("account_next")},scopedSlots:e._u([{key:"description",fn:function(){return[0===e.progress?n("div",[e._v(e._s(e.$t("account_tip_confirm_verify_email_phone")))]):1===e.progress&&e.verificationData?n("div",[e._v(e._s(e.$t("account_email_phone_sent_tip"))+"\n "),n("div",[e._v(e._s(e.verificationData.email.destination))]),n("div",[e._v(e._s(e.verificationData.phoneNumber.destination))])]):e._e()]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return[1===e.progress?e._l(e.form.items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})):e._e()]}}])},"amplify-card",e.scope.cardProps,!1))},El=[],Al={name:"DisableMFA",props:{scope:Object},data(){return{progress:0,verificationData:null,form:new Jr["a"]({emailCode:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]}),phoneCode:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})})}},watch:{progress(e){e<0&&(this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut"),this.$emit("setCurrentCard",null))}},methods:{async handleSend(){try{const{user:{username:e}}=this.$store.state.account.verification,t=`${this.$store.getters.settings.language}:D`;this.verificationData=await Object(Zr["j"])(e,{msgLocale:t}),this.progress+=1}catch(e){Xr["a"].showNegative(e.message)}},async handleSubmit(){try{const{user:{username:e}}=this.$store.state.account.verification,{emailCode:t,phoneCode:n}=this.form.formData;await Object(Zr["w"])(e,t,n),this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut"),Xr["a"].showPositive("disabled_mfa"),this.progress=-1}catch(e){Xr["a"].showNegative(e.message)}},handleCancel(){this.progress=-1}}},Dl=Al,Nl=Object(g["a"])(Dl,ql,El,!1,null,null,null),Ll=Nl.exports,jl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("amplify-card",e._b({attrs:{"corner-cancel":!1,"cancel-label":e.$t("account_cancel"),"submit-label":e.$t(["account_next","account_finish"][e.signUpProgress]),"on-submit":"loading"===e.currentTemplate?void 0:"signUp"===e.currentTemplate?function(){return e.scope.handleSubmit([e.handleSignUp,e.handleVerify][e.signUpProgress])}:void e.currentTemplate,"on-cancel":function(){return e.scope.handleCancel(e.handleCancel)},title:e.$t("account_oauth_sign_in_with",{provider:e.provider})},scopedSlots:e._u([{key:"description",fn:function(){return["loading"===e.currentTemplate?[n("div",{staticClass:"text-center text-weight-bold text-subtitle1 q-mt-md"},[n("q-spinner",{staticClass:"q-mr-xs q-mb-xs",attrs:{size:"1.25em"}}),n("span",{staticClass:"q-pr-lg"},[e._v(e._s(e.$t("account_loading")))])],1)]:"signUp"===e.currentTemplate?[e.data?n("div",[0===e.signUpProgress?n("div",[e._v("\n "+e._s(e.$t("account_tip_oath_sign_up",{provider:e.data.providerName,email:e.data.providerInfo.email}))+"\n ")]):1===e.signUpProgress?n("div",[e._v("\n "+e._s(e.$t("account_email_sent_tip"))+e._s(e.data.providerInfo.email)+"\n ")]):e._e()]):e._e()]:e._e()]},proxy:!0},{key:"default",fn:function(t){var o=t.disable;return["signUp"===e.currentTemplate?e._l([e.signUpForm,e.verificationForm][e.signUpProgress].items,(function(t,a){return n("amplify-input",e._b({key:a,attrs:{label:e.$t(t.bound.label),readonly:o,required:""},model:{value:t.model,callback:function(n){e.$set(t,"model",n)},expression:"item.model"}},"amplify-input",t.bound,!1))})):e._e()]}}])},"amplify-card",e.scope.cardProps,!1))},Rl=[],Ul=n("e74d"),Fl={name:"OAuth",props:{scope:Object},data(){return{provider:null,status:null,data:null,signUpProgress:0,signUpUsername:null,signUpForm:new Jr["a"]({password:new Jr["b"]("",{type:"password",icon:"lock",label:"account_password",rules:[el["d"].bind(this)]}),invitationCode:new Jr["b"]("",{type:"text",icon:"verified",label:"account_invitation_code",rules:[el["b"].bind(this)]})}),verificationForm:new Jr["a"]({code:new Jr["b"]("",{type:"text",icon:"shield",label:"account_verification_code",rules:[el["h"].bind(this)]})})}},computed:{currentTemplate(){return"confirm"===this.status?"confirm":"signUp"===this.status?"signUp":["pending","requesting","success"].includes(this.status)?"loading":void 0}},watch:{status(e){if(!e)return;const t={pending:()=>this.handlePending(),requesting:()=>this.handleRequesting(),success:()=>this.handleSuccess(),signUp:()=>{},confirm:()=>{}};t[e]&&t[e]()}},methods:{async copyCode(){await navigator.clipboard.writeText("5EPD12NW3F"),this.$q("Test Invitation Code copied")},setStatus(e,t,n){t&&(this.provider=t),n&&(this.data=n),this.status=e},handleCancel(){this.provider=null,this.status=null,this.data=null,this.$store.commit("ACCOUNT_UPDATE_STATE","signedOut"),this.$emit("setCurrentCard",null)},async handleSuccess(){await this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX"),this.provider=null,this.status=null,this.data=null,"signedIn"===this.$store.state.account.authState?(this.$emit("closeDialog"),Xr["a"].showPositive("signed_in")):(this.$emit("setCurrentCard",null),Xr["a"].showNegative("sign_in_failed"))},handlePending(){Ul["a"].launchOAuth("signedOut",{provider:this.provider})},handleRequesting(){},async handleSignUp(){try{const e={oauthSignUp:"true",oauthData:JSON.stringify({providerName:this.data.providerName,providerUserId:this.data.providerUserId}),email:this.data.providerInfo.email},t=await Object(Zr["o"])({...e,...this.signUpForm.formData});this.signUpUsername=t.user.username,this.signUpProgress=1}catch(e){Xr["a"].showNegative(e.message),this.handleCancel()}},async handleVerify(){try{const e={oauthSignUp:"true",oauthData:JSON.stringify({providerName:this.data.providerName,providerUserId:this.data.providerUserId})},{code:t}=this.verificationForm.formData;await Object(Zr["c"])(this.signUpUsername,t,{},e),this.setStatus("pending")}catch(e){Xr["a"].showNegative(e.message),this.handleCancel()}},async handleConfirm(){}}},Ml=Fl,Bl=Object(g["a"])(Ml,jl,Rl,!1,null,"6bc0e027",null),Ql=Bl.exports;k()(Bl,"components",{QSpinner:we["a"]});var Wl=n("d884"),zl=n("39df"),Hl={name:"SignedOutDialog",components:{OAuth:Ql,DisableMFA:Ll,SignInConfirm:Ol,SignIn:il,ForgotPassword:$l,SignUp:bl,Development:zl["default"]},data(){return{showDevDialog:!1,currentCard:null,value:!1,languageOptions:Wl["a"]}},computed:{cardEvents(){return{setCurrentCard:this.setCurrentCard,closeDialog:()=>this.value=!1}},_currentCard(){if(this.currentCard)return this.currentCard;const e=["signedOut","forgotPassword","signUp","signInConfirm"];return e.includes(this.$store.state.account.authState)?this.$store.state.account.authState:null},language:{get(){const e=S["a"].getters.settings.language,t=this.languageOptions.find((t=>t.value===e));return t?t.label:e},set(e){const t=e.value||e;if("string"===typeof t&&(S["a"].dispatch("updateSettings",{language:t}),this.$i18n.locale=t,Object(xn["isElectron"])())){const{ipcRenderer:e}=n("b052");e.send("change-app-i18n",t),e.send("set_settings",{language:t})}}}},watch:{_currentCard(e){null===e&&!1!==this.value&&(this.value=!1)}},methods:{showAboutDialog(){xn["Bus"].$emit("CALL_ABOUT")},handleDevClick(){this.showDevDialog=!this.showDevDialog},setCurrentCard(e,t){this.currentCard=e,t&&e&&this.$nextTick((()=>t(this.$refs[e]))),t&&!e&&this.$nextTick((()=>t(null)))},async onClear(){this.currentCard=null,console.log("SignedOut Dialog Close: AuthState =>",this.$store.state.account.authState)},show(e){this.value=e}}},Vl=Hl,Gl=(n("1cda"),n("a829")),Kl=n("719b"),Yl=n("a431"),Jl=Object(g["a"])(Vl,zr,Hr,!1,null,null,null),Xl=Jl.exports;k()(Jl,"components",{QBtn:le["a"],QTooltip:Ct["a"],QDialog:y["a"],QSpace:re["a"],QSeparator:ce["a"],QMenu:Gl["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"],QColor:X["a"]}),k()(Jl,"directives",{Ripple:Kl["a"],ClosePopup:Yl["a"]});const Zl={watch:{"$store.state.account.authState"(e,t){this.$ga.send("auth_state_change",{from:t,to:e}),t?("signedIn"===e||"signedOut"===e&&"signedIn"===t)&&this.$emit("auth_state_changed",e):this.$emit("auth_state_changed",e)}},methods:{addOnAuthStateChangedListener(e,{once:t}={}){const n=(...o)=>{t&&this.$off("auth_state_changed",n),e(...o)};return this.$on("auth_state_changed",n),()=>this.$off("auth_state_changed",n)}}},ec={name:"AmplifyDialogGroups",components:{SignedOutDialog:Xl},mixins:[Zl],mounted(){new URL(location.href).pathname.startsWith("/oauth_redirect")||this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX")},methods:{showSignedOut(){this.$refs.signedOut.show(!0)}}};let tc;const nc={install(e,{app:t}){const n="amplify-dialog-groups";if(!document.getElementById(n)){const e=document.createElement("div");e.id=n,document.body.appendChild(e)}const{i18n:o,router:a,store:s}=t;tc=new(e.extend({i18n:o,router:a,store:s,...ec}))({propsData:{}}).$mount("#"+n)},create$amplify(){return{showSignedOutDialog:()=>tc.showSignedOut(),addOnAuthStateChangedListener:(e,t)=>tc.addOnAuthStateChangedListener(e,t)}}};var oc=ec,ac=oc,sc=Object(g["a"])(ac,Qr,Wr,!1,null,null,null);sc.exports;const ic={async install(e,{app:t}){Br(e);const n=[nc];Promise.all(n.map((n=>n.install(e,{app:t})))),Object.defineProperty(e.prototype,"$amplify",{get(){const e={},t=t=>{for(const[n,o]of Object.entries(t))e[n]=o};return n.forEach((e=>t(e.create$amplify.apply(this)))),e}})}},rc={aws_project_region:"us-east-1",aws_mobile_analytics_app_id:"4f8fe8282ebf40e4a390c2171e3e45df",aws_mobile_analytics_app_region:"us-east-1",aws_appsync_graphqlEndpoint:"https://ye6kerar5bb65jpjrhlum4gu7q.appsync-api.us-east-1.amazonaws.com/graphql",aws_appsync_region:"us-east-1",aws_appsync_authenticationType:"AMAZON_COGNITO_USER_POOLS",aws_appsync_apiKey:"da2-o7saok2xsbby5nqi2womjyd5ie",aws_cloud_logic_custom:[{name:"ABDevRest",endpoint:"https://6xf9ehebfj.execute-api.us-east-1.amazonaws.com/dev",region:"us-east-1"}],aws_cognito_identity_pool_id:"us-east-1:425781a9-0178-4dbd-b103-1d2e5e210d1a",aws_cognito_region:"us-east-1",aws_user_pools_id:"us-east-1_NbEkBdIqw",aws_user_pools_web_client_id:"1o6c32oh82hjqvd8hfora67lap",oauth:{domain:"ab-domain-dev.auth.us-east-1.amazoncognito.com",scope:["phone","email","openid","profile","aws.cognito.signin.user.admin"],redirectSignIn:"http://localhost:8080/",redirectSignOut:"http://localhost:8080/",responseType:"code"},federationTarget:"COGNITO_USER_POOLS",aws_cognito_login_mechanisms:["EMAIL","PREFERRED_USERNAME","PHONE_NUMBER"],aws_cognito_signup_attributes:[],aws_cognito_mfa_configuration:"OFF",aws_cognito_mfa_types:["SMS"],aws_cognito_password_protection_settings:{passwordPolicyMinLength:8,passwordPolicyCharacters:["REQUIRES_NUMBERS"]},aws_cognito_verification_mechanisms:["EMAIL"],aws_cognito_username_attributes:[],aws_cognito_social_providers:[]};var lc=rc,cc=n("3334"),dc=n("0cdb"),uc=n("586d");class hc{constructor(){this.events={}}$on(e,t){return this.events[e]=this.events[e]||[],this.events[e].includes(t)||this.events[e].push(t),()=>this.$off(e,t)}$once(e,t){return t.once=!0,this.$on(e,t)}$off(e,t){if(t){if(!this.events[e])return;if(!this.events[e].includes(t))return;const n=this.events[e].indexOf(t);this.events[e].splice(n,1)}else this.events[e]=[]}async $emit(e,...t){if(!this.events[e])return;const n=[].concat(this.events[e]);let o=0;while(o{const o=a[(t+1)%2],s=[`background-color: ${o.bgc}`,`color: ${o.color}`];return s.push("padding: 2px 12px"),0===t&&s.push("border-top-left-radius: 8px","border-bottom-left-radius: 8px"),t===n.length-1&&s.push("border-top-right-radius: 8px","border-bottom-right-radius: 8px"),s.join("; ")})),i=n.map((e=>`%c${e}`)).join("");console[o](i,...s,...t)},_c={log:{type:"log"},warn:{type:"warn"},error:{type:"error"},red:{styles:[{bgc:"rgb(248,160,160)",color:"black"},{bgc:"rgb(134,12,12)",color:"white"}]},orange:{styles:[{bgc:"rgb(248,191,160)",color:"black"},{bgc:"rgb(175,81,6)",color:"white"}]},green:{styles:[{bgc:"rgb(160,248,161)",color:"black"},{bgc:"rgb(35,154,17)",color:"white"}]},purple:{styles:[{bgc:"rgb(200,184,255)",color:"black"},{bgc:"rgb(44,31,162)",color:"white"}]},blue:{styles:[{bgc:"rgb(184,215,255)",color:"black"},{bgc:"rgb(31,107,162)",color:"white"}]},tags:e=>(...t)=>(e.options.tags=e.options.tags||[],e.options.tags.push(...t),fc(e))},fc=e=>new Proxy(e,{get(e,t,n){if("options"===t)return e.options||void 0;if(!Object.keys(_c).includes(t))return;const o=(...e)=>mc(o.options,...e);return o.options={},Object.assign(o.options,JSON.parse(JSON.stringify(e.options||{}))),"function"===typeof _c[t]?_c[t](o):(Object.assign(o.options,_c[t]),fc(o))}}),gc=fc(mc);Object.defineProperties(mc,Object.keys(_c).reduce(((e,t)=>(e[t]={get(){return gc[t]}},e)),{}));var bc=mc;const yc={};class vc{static appendOperation(e){const t=e.trim().match(/^[\w]+[ \f\r\t\n]+[\w]+/)[0].split(" ").reverse()[0],n=t.replace(t.charAt(0),t.charAt(0).toLowerCase());return yc[n]=e,this}static appendOperations(e){return Array.isArray(e)?e.forEach(this.appendOperation):Object.entries(e).forEach((([e,t])=>{yc[e]=t})),this}static createObservable(e,...t){const n=this.__getOperation(e),o=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));let a;o(n).forEach(((e,n)=>{const o=t[n];void 0!==o&&(a||(a={}),a[e]=o)}));const s=Un["a"].graphql({query:n,variables:a});return s.name=e,s}static subscribe(e,t,n=console.error){return e.subscribe({next:({provider:n,value:o})=>{var a;return t(null===(a=o.data)||void 0===a?void 0:a[e.name],n)},error:({provider:e,error:t})=>n(t.errors,e)})}static __getOperation(e){if(!yc[e])throw new Error("operation not found");return yc[e]}static async execute(e,t){const n=this.__getOperation(e),o=await Un["a"].graphql({query:n,variables:t});if(o.errors)throw new Error(o.errors[0].message);return o.data[e]}static injectAllOperations(e){const t=e=>e.split("(")[1].split(")")[0].split("$").slice(1).map((e=>e.split(":")[0].trim()));return Object.entries(yc).forEach((([n,o])=>{e[n]=async(...e)=>{let a;return t(o).forEach(((t,n)=>{const o=e[n];void 0!==o&&(a||(a={}),a[t]=o)})),await this.execute(n,a)}})),e}}class wc extends vc{static async subscribeWithRetry(e,t,n,o){const a=(...e)=>{let t,n,o;"string"===typeof e[0]?(t={warn:[{bgc:"rgb(250,211,138)",color:"black"},{bgc:"rgb(155,123,53)",color:"white"}]}[e[0]],n=e[1],o=e.slice(2)):(t=[{bgc:"rgb(166,138,250)",color:"black"},{bgc:"rgb(44,31,162)",color:"white"}],n=e[0],o=e.slice(1));const a=e=>`background-color: ${e.bgc}; color: ${e.color}; padding: 2px 12px;`,s=Array.from(n,((e,o)=>{let s=a(t[(o+1)%2]);return 0===o?s+=" border-top-left-radius: 8px; border-bottom-left-radius: 8px;":o===n.length-1&&(s+=" border-top-right-radius: 8px; border-bottom-right-radius: 8px;"),s})),i=n.map((e=>`%c${e}`)).join("");console.log(i,...s,...o)},{times:s,duration:i,onFetchData:r,onUpdateSubscriber:l}={times:-1,duration:1e4,onFetchData:()=>{},onUpdateSubscriber:()=>{throw new Error("Your should config onUpdateSubscriber for the subscribeWithRetry method")},...o};let c=!0,d=0;const u=new Error("The number of retries exceeds the maximum"),h=e=>new Promise((t=>setTimeout(t,e))),p=async e=>{if(c=!0,s>0&&d>s)return console.warn(u),void a(["GQL","Websocket"],"failed to reconnect",u);const t=Math.min(i,1e3*Math.pow(2,d));a(["GQL","Websocket"],"connect close: ",`waiting for reconnect (${t}ms)`),await h(t),c?(d+=1,a(["GQL","Websocket"],`Attempt to reconnect (${d})`),await e(),d=0,a(["GQL","Websocket"],"reconnected")):a(["GQL","Websocket","enableRetry === false"],c)},m=async()=>{const n=(e,t)=>{const n=["AppSync Realtime subscription init error: No current user"],o=["Connection closed","Timeout disconnect"];e.some((e=>n.includes(e.message)))?a(["GQL","Websocket"],"Skip",e):(e.some((e=>o.includes(e.message)))?a(["GQL","Websocket"],"Connect Error"):a(["GQL","Websocket"],"Connect Error: 179",e),p(m))};try{d>=0&&r&&await r();const o=wc.subscribe(e,t,n),a=o.unsubscribe;o.unsubscribe=function(){return c=!1,a.apply(this)},await l(o)}catch(o){a(["GQL","Websocket"],"Connect Error :191",o),await p(m)}};await m()}}class kc{static createSyncDataSubscriber(e,t,n,o=console.error){return new kc(e,t,o,n)}constructor(e,t,n,o){this.observable=e,this.onUpdate=t,this.onError=n,this.onFetchData=o,this.subscriber=null}async enable(){const e=e=>{this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=e};await wc.subscribeWithRetry(this.observable,this.onUpdate,this.onError,{times:-1,duration:3e4,onUpdateSubscriber:e,onFetchData:this.onFetchData})}disable(){this.subscriber&&this.subscriber.unsubscribe(),this.subscriber=null}}class Cc{constructor(){this.id=null,this.observable=null,this.subscriber=null,this.listeners={}}async enable(e){this.disable(),this.id=e,this.observable=wc.createObservable("onGeneralUpdate",this.id);const t=e=>{const{channel:t,data:n}=e;if(!this.listeners[t])return;let o;try{o=JSON.parse(n)}catch(a){o=n}this.listeners[t].forEach((e=>e(o)))},n=async()=>{const e=Object.values(this.listeners).map((e=>e.map((e=>e.fetchData)))).flat(1).filter((e=>void 0!==e));return await Promise.all(e.map((e=>e())))};this.subscriber=kc.createSyncDataSubscriber(this.observable,t,n),await this.subscriber.enable()}disable(){this.listeners={},this.subscriber&&(this.subscriber.disable(),this.subscriber=null),this.observable=null,this.id=null}addListener(e,t,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t),n&&t.fetchData!==n&&(t.fetchData=n)}removeListener(e,t){const n=t||"string"===typeof e?e:void 0;t=t||"string"!==typeof e?t:void 0,n&&!this.listeners[n]||(n&&t?this.listeners[n]=this.listeners[n].filter((e=>e!==t)):n&&!t?this.listeners[n]=void 0:Object.keys(this.listeners).forEach((e=>{this.listeners[e].includes(t)&&(this.listeners[e]=this.listeners[e].filter((e=>e!==t)))})))}}const $c=new Cc,Sc=new Cc;var xc={config({queries:e,mutations:t,subscriptions:n}){wc.appendOperations(e),wc.appendOperations(t),wc.appendOperations(n)},enableUserListener:async e=>await $c.enable(e),disableUserListener:()=>$c.disable(),addUserListener:(e,t,n)=>$c.addListener(e,t,n),removeUserListener:(e,t)=>$c.removeListener(e,t),enablePublicListener:async()=>await Sc.enable("*"),disablePublicListener:()=>Sc.disable(),addPublicListener:(e,t,n)=>Sc.addListener(e,t,n),removePublicListener:(e,t)=>Sc.removeListener(e,t)};class Tc{constructor(e){this.apiName=e}async __call__(e,t,n){const o=await Un["a"][e](this.apiName,t,n).catch((e=>{if(e.response&&e.response.data)return e.response.data;throw e}));if(o.stack){const e=new Error(o.message);throw e.name=o.name,e.stack=o.stack,e}return o}async __post__(e,t,n){t||(t={}),"string"===typeof e&&(e=e.split("/").filter((e=>""!==e)));const o=n?["authorized"]:[];o.push(...e);const a=n?{Authorization:n}:{};return await this.__call__("post",`/${o.join("/")}`,{body:t,headers:{...a}})}async postGuest(e,t){return await this.__post__(e,t)}async post(e,t,n){if(!n){const e=await Ul["a"].currentSession();n=e.getIdToken().getJwtToken()}return await this.__post__(e,t,n)}get endpoint(){return Un["a"]._options.aws_cloud_logic_custom.find((e=>e.name===this.apiName)).endpoint}}const Ic=new Tc("ABDevRest");var Pc=function(e,t){return u["a"].create({component:{render(n){return n(y["a"],{ref:"dialog",props:{persistent:!0},on:{hide:()=>this.$emit("hide")}},[n(e,t)])},methods:{show(){this.$refs.dialog.show()},hide(){this.$refs.dialog.hide()}}}})},Oc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{directives:[{name:"touch-pan",rawName:"v-touch-pan.prevent.mouse",value:e.handleTouchPan,expression:"handleTouchPan",modifiers:{prevent:!0,mouse:!0}}],ref:"card",staticClass:"fixed",staticStyle:{"min-width":"280px"},style:{left:this.left+"px",top:this.top+"px"}},[n("q-card-section",{staticClass:"q-py-none q-pr-none flex"},[n("div",[e._v("Floating")]),n("q-space"),n("q-btn",{staticStyle:{width:"32px","border-radius":"0"},attrs:{icon:"close",flat:"",size:"xs"},on:{click:function(t){return e.$emit("close")}}})],1),n("q-separator"),n("q-card-section",{staticClass:"q-pa-none"},[e._t("default")],2)],1)},qc=[];const Ec={data(){return{observer:null,containerRect:null,contentRect:null}},mounted(){let e=!0;this.observer=new ResizeObserver((t=>{for(const e of t)e.target===document.body?this.containerRect=e.contentRect:e.target===this.$refs.card.$el&&(this.contentRect=e.contentRect);e&&(e=!1,this.left=(this.containerRect.width-this.contentRect.width)/2,this.top=(this.containerRect.height-this.contentRect.height)/2),this.updatePosition(this.left,this.top)})),this.observer.observe(document.body),this.observer.observe(this.$refs.card.$el)},beforeDestroy(){this.observer.unobserve(document.body),this.observer.unobserve(this.$refs.card.$el)}};var Ac={name:"Floating",mixins:[Ec],data(){return{left:0,top:0}},methods:{handleTouchPan({delta:e}){this.containerRect&&this.contentRect&&this.updatePosition(this.left+e.x,this.top+e.y)},updatePosition(e,t){const n=8;this.left=Math.max(n,Math.min(e,this.containerRect.width-this.contentRect.width-n)),this.top=Math.max(n,Math.min(t,this.containerRect.height-this.contentRect.height-n))}}},Dc=Ac,Nc=Object(g["a"])(Dc,Oc,qc,!1,null,"286e971c",null),Lc=Nc.exports;k()(Nc,"components",{QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QBtn:le["a"],QSeparator:ce["a"]}),k()(Nc,"directives",{TouchPan:de["a"]});var jc=e=>t=>{let n;n=e.utils.createVueInstance({render(e){const o=()=>{n.$destroy(),n.$el.remove(),n=null};return e(Lc,{on:{close:o}},[e(t)])}},!0);const o=document.createElement("div");return document.body.append(o),n.$mount(o),n},Rc={negative(e){return d["a"].create({type:"negative",message:e,position:"bottom-right",timeout:5e3})},positive(e){return d["a"].create({type:"positive",message:e,position:"bottom-right",timeout:5e3})}};const Uc=e=>t=>{Object.entries(t).forEach((([t,n])=>{e.core[t]||(e.core[t]=n.bind(e))}))},Fc=({Vue:e,app:t})=>(n,o=!1)=>{if(o){const{i18n:o,router:a,store:s}=t;return new(e.extend({i18n:o,router:a,store:s}))(n)}return new e(n)},Mc=e=>{const t=new Map;return n=>{const o=(n,o)=>{Object.defineProperty(e.view,n,{get(){return t.has(n)?t.get(n):o.bind(e)},set(e){if(void 0===e||null===e){var o;if(!t.has(n))return;const e=t.get(n);t.delete(n),null===(o=e.view$destroy)||void 0===o||o.call(e)}else t.set(n,e)}})};Object.entries(n).forEach((([e,t])=>o(e,t)))}},Bc=new hc,Qc=bc.orange.tags("Account"),Wc={config:({queries:e,mutations:t,subscriptions:n})=>xc.config({queries:e,mutations:t,subscriptions:n}),enable:()=>xc.enablePublicListener(),disable:()=>xc.disablePublicListener(),addListener:(...e)=>xc.addPublicListener(...e),removeListener:(...e)=>xc.removePublicListener(...e)};var zc=(e,{app:t},n)=>({injectToCore:Uc(n),createVueInstance:Fc({Vue:e,app:t}),injectToView:Mc(n),emit:(...e)=>Bc.$emit(...e),on:(...e)=>Bc.$on(...e),off:(...e)=>Bc.$off(...e),once:(...e)=>Bc.$once(...e),logger:Qc,ABDevRest:Ic,sync:Wc,showInDialog:Pc,showInFloating:jc(n),notify:Rc});class Hc{static create(e,t){const n=new this(e);return Object.assign(n,t)}constructor(e){this.NAME=e}onCreateCore(e,t,n){return{}}onConfigure(e,t,n){}onCreateStoreMixin(e,t,n){return{}}onRegisterView(e,t,n){return{}}}class Vc{constructor(e){this.NAME=e,this[e]={}}get context(){return this[this.NAME]}onConfigure(e){Object.assign(this.context,{config:{},utils:null,core:{},store:null,view:{}}),window.$alphabiz=window.$alphabiz||{},window.$alphabiz[this.NAME]=window.$alphabiz[this.NAME]||this.context}onInstallUtils(e,t){Object.assign(this.context,{utils:zc(e,t,this.context)}),Object.assign(this.context,{$emit:this.context.utils.emit,$on:this.context.utils.on,$once:this.context.utils.once,$off:this.context.utils.off,$logger:this.context.utils.logger})}useExtensions(e,t,n){const o=(e,t)=>t instanceof Hc?t:Hc.create(e,t),a=Object.entries(e).map((([e,t])=>o(e,t))),s={mixins:[]},i=[e=>this.context.utils.injectToCore(e.onCreateCore(t,n,this.context)),e=>e.onConfigure(t,n,this.context),e=>s.mixins.push(e.onCreateStoreMixin(t,n,this.context)),e=>this.context.utils.injectToView(e.onRegisterView(t,n,this.context))];i.forEach((e=>a.forEach(e))),this.context.store=this.context.utils.createVueInstance(s,!0)}exportAsVuePlugin(){const e=e=>{const t=this.context;Object.defineProperty(e.prototype,this.NAME,{get(){const e=this,n=["$test"],o=new Proxy(t,{get(t,o,a){if(!n.includes(o))return Reflect.get(t,o,a);const s=Reflect.get(t,o,a);return Object.keys(s).reduce(((t,n)=>({...t,[n]:s[n].bind(e)})),{})}});return o}})};return(t,n)=>{this.onConfigure(),e(t),this.onInstallUtils(t,n),this.useExtensions(n.extensions,t,n)}}}var Gc={createExtension:Hc.create.bind(Hc),PluginInstaller:e=>new Vc(e)};let Kc=!1;var Yc={async signInPage(){const e=(e,t)=>{this.$account.view.SignInPage._isVue?this.$account.view.SignInPage.updateCard(e,t):this.$account.view.SignInPage({card:e,props:t})};Kc?await e("SignInCard",{}):(Kc=!0,this.$watch((()=>this.$account.store.authState),(async t=>{"pending"===t?(await e("LoadingCard",{title:"auth_state.pending"}),await new Promise((e=>setTimeout(e,1e3))),await this.$account.store.tryToSignInCurrentAccount()):"signed_out"===t&&await e("SignInCard",{})}),{immediate:!0}))}},Jc=n("35f4"),Xc=n("02fe"),Zc=n.n(Xc);async function ed({email:e,phone_number:t,phone_number_code:n,password:o},{language:a}){const s={username:Object(Jc["a"])("1234567890abcdefghijklmnopqrstuvwxyz",20)().toLowerCase(),password:o,attributes:{},clientMetadata:{}},i=()=>{if(e)Object.assign(s.attributes,{email:e});else{if(!t)throw new Error("Invalid signup params");Object.assign(s.attributes,{phone_number:t,"custom:phone_number_code":n})}Object.assign(s.attributes,{"custom:msg_locale":`${a}:${s.attributes.email?"E":"P"}`})},r=()=>{Object.assign(s.clientMetadata,{})};i(),r();const{userSub:l,user:c,codeDeliveryDetails:{DeliveryMedium:d,AttributeName:u,Destination:h}}=await Ul["a"].signUp(s),{ABDevRest:p}=this.utils;return await p.postGuest("/account/postSignUp",{sub:l,username:s.username,keychainMetadataHash:Zc.a.SHA256(o).toString(),isTestEnv:window.isTestEnv,invitationCode:s.clientMetadata.invitationCode}),{userSub:l,user:c,codeDeliveryDetails:{DeliveryMedium:d,AttributeName:u,Destination:h}}}async function td(e){const{CodeDeliveryDetails:{DeliveryMedium:t,AttributeName:n,Destination:o}}=await Ul["a"].resendSignUp(e);return{codeDeliveryDetails:{DeliveryMedium:t,AttributeName:n,Destination:o}}}async function nd(e,t,{nickname:n,gender:o,birthday:a,locale:s}){const i={};Object.assign(i,{optionalAttributes:JSON.stringify({nickname:n,gender:o,birthday:a,locale:s})}),Object.assign(i,{}),await Ul["a"].confirmSignUp(e,t,{clientMetadata:i})}async function od(e){const{ABDevRest:t}=this.utils,n=await Ul["a"].currentAuthenticatedUser();await Ul["a"].changePassword(n,e,e),await t.post("/admin/deleteAccount")}var ad={signUp:ed,signUpResend:td,signUpConfirm:nd,deleteAccount:od};async function sd(){const e=await Ul["a"].currentAuthenticatedUser();return e?0===Object.keys(e).length?null:e:null}async function id(e,t,{handleConfirm:n}){const o=async()=>{let o;e=e.toLowerCase();try{const n={};await this.$emit("signIn.createClientMetadata",n),o=await Ul["a"].signIn(e,t,n)}catch(a){if("UserNotConfirmedException"===a.code)return await n();throw a}if(o.challengeName){const n={};await this.$emit("signIn.createChallengeHandlers",n);const a=n[o.challengeName];if(!a)throw new Error("Unexpected challenge: "+o.challengeName);return await a(e,t,o)}return!0},a=await o();if(a){const{ABDevRest:e}=this.utils;await e.post("/account/postSignIn",{keychainMetadataHash:Zc.a.SHA256(t).toString()})}return a}var rd={signIn:id,getCurrentAuthedUser:sd};async function ld(){await Ul["a"].signOut()}var cd={signOut:ld};async function dd(e,t){const{ABDevRest:n}=this.utils,o=await Ul["a"].currentAuthenticatedUser();await n.post("/account/changePassword",{username:o.getUsername(),AccessToken:o.signInUserSession.getAccessToken().getJwtToken(),PreviousPassword:e,ProposedPassword:t})}async function ud(e,{language:t}){e=e.toLowerCase();const n={msgLocale:`${t}:F`},{CodeDeliveryDetails:{AttributeName:o,Destination:a}}=await Ul["a"].forgotPassword(e,n);return{codeDeliveryDetails:{AttributeName:o,Destination:a}}}async function hd(e,{code:t,password:n}){const{ABDevRest:o}=this.utils;await o.postGuest("/account/forgotPasswordSubmit",{ClientId:Ul["a"].userPool.getClientId(),ConfirmationCode:t,Password:n,Username:e})}async function pd(e){const t=await Ul["a"].currentAuthenticatedUser(),n=["nickname","gender","birthday","locale"];await Ul["a"].updateUserAttributes(t,n.reduce(((t,n)=>{const o=e[n];return void 0!==o&&(t[n]=o),t}),{}))}var md={changePassword:dd,forgotPasswordSend:ud,forgotPasswordSubmit:hd,changeAttributes:pd};let _d=null;async function fd(e,t){const n=`${e}:${t}`;if(_d===n)return;const o=await Ul["a"].currentAuthenticatedUser();await Ul["a"].updateUserAttributes(o,{"custom:msg_locale":n}),_d=n}async function gd(e,{language:t}){await fd(t,{email:"E",phone_number:"P"}[e]),await Ul["a"].verifyCurrentUserAttribute(e)}async function bd(e,t){const{ABDevRest:n}=this.utils,o=await Ul["a"].verifyCurrentUserAttributeSubmit(e,t);await n.post("/account/postVerifyAttr",{success:"SUCCESS"===o})}async function yd(e,{language:t}){const{ABDevRest:n}=this.utils;e=e.toLowerCase();const o=await Ul["a"].currentAuthenticatedUser();e===o.attributes.email?await gd("email",{language:t}):(await fd(t,"E"),await n.post("/account/setVerifyAttr",{email:e}))}async function vd(e,t,{language:n}){const{ABDevRest:o}=this.utils,a=await Ul["a"].currentAuthenticatedUser();e&&t&&e===a.attributes.phone_number&&t===a.attributes["custom:phone_number_code"]?await gd("phone_number",{language:n}):(await fd(n,"P"),await o.post("/account/setVerifyAttr",{phone_number:{phoneNumber:e,phoneNumberCountryCode:t}}))}async function wd(e){return await bd("email",e)}async function kd(e){return await bd("phone_number",e)}var Cd={verifyFieldSend:gd,verifyFieldSubmit:bd,changeEmailSend:yd,changeEmailSubmit:wd,changePhoneNumberSend:vd,changePhoneNumberSubmit:kd},$d=n("bbb3"),Sd=(e,t,n)=>{$d["default"].configure({...t.awsconfig,aws_cognito_mfa_configuration:"OPTIONAL",aws_cognito_mfa_types:["SMS"]}),Ul["a"].configure({authenticationFlowType:"CUSTOM_AUTH"}),n.utils.sync.config(t.gql)};function xd(){return this.$store.getters.settings.language}const Td={created(){this.$account.$on("authState.authorized",(async()=>{await this.$account.view.SignInPage.updateCard("LoadingCard",{title:"auth_state.authorized"}),await this.$store.dispatch("ACCOUNT_REDIRECT_TO_INDEX")}))}},Id={async onSignIn(){["pending","signed_out"].includes(this.authState)&&(this.authState="authorized",await this.$account.$emit("authState.authorized")),this.authState="signed_in",await this.$account.$emit("authState.signedIn")},async onSignOut(){"signed_in"===this.authState&&(this.authState="sign_out",await this.$account.$emit("authState.signOut")),this.authState="signed_out",await this.$account.$emit("authState.signedOut")}};var Pd={mixins:[Td],data(){return{authState:"pending"}},methods:{async signIn(e,t){const n=await this.$account.core.signIn(e,t,{handleConfirm:()=>{throw new Error("UserNotConfirmedException")}});if(n){const e=await this.$account.core.getCurrentAuthedUser();await Id.onSignIn.call(this,e)}return n},async signOut(){await this.$account.core.signOut(),await Id.onSignOut.call(this)},async deleteAccount(e){await this.$account.core.deleteAccount(e),await this.signOut()},async tryToSignInCurrentAccount(){const e=["The user is not authenticated"];let t;try{if(t=await this.$account.core.getCurrentAuthedUser(),!t)throw"user is null"}catch(n){if(e.includes(n))return void await Id.onSignOut.call(this);throw this.$account.$logger.tags("SignInFlow","pending","rejected").warn(n,typeof n),n}await Id.onSignIn.call(this,t)}}},Od={methods:{async signUp({email:e,phone_number:t,phone_number_code:n,password:o},{requireConfirm:a}){const s=await this.$account.core.signUp({email:e,phone_number:t,phone_number_code:n,password:o},{language:xd.call(this)}),i=await a({data:s,resend:async()=>{await this.$account.core.signUpResend(s.user.getUsername())},callback:async(e,t)=>{await this.$account.core.signUpConfirm(s.user.getUsername(),e,t)}});return i}}},qd={methods:{async forgotPassword(e,{requireCode:t}){const n=await this.$account.core.forgotPasswordSend(e,{language:xd.call(this)}),o=await t({data:n,callback:async(t,n)=>{await this.$account.core.forgotPasswordSubmit(e,{code:t,password:n})}});return o},async changePassword(e,t){await this.$account.core.changePassword(e,t)}}},Ed={methods:{async changeEmail(e,{requireCode:t}){const n=async()=>{const t=xd.call(this);await this.$account.core.changeEmailSend(e,{language:t})};await n(),await t({resend:async()=>{await n()},callback:async e=>{await this.$account.core.changeEmailSubmit(e)}})},async changePhoneNumber({phone_number:e,phone_number_code:t},{requireCode:n}){const o=async()=>{const n=xd.call(this);await this.$account.core.changePhoneNumberSend(e,t,{language:n})};await o(),await n({resend:async()=>{await o()},callback:async e=>{await this.$account.core.changePhoneNumberSubmit(e)}})}}},Ad=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-modal-page"},[n("transition",{attrs:{name:"fade"}},[e.showContent?n("Backdrop"):e._e()],1),e.$scopedSlots.corner?n("div",{staticClass:"container",staticStyle:{"z-index":"7000"}},[n("transition",{attrs:{name:"slide-right"}},[e.showContent?n("Corner",[e._t("corner")],2):e._e()],1)],1):e._e(),n("div",{staticClass:"container flex justify-center items-center",staticStyle:{"z-index":"6000"}},[n("transition",{attrs:{name:"scale"}},[e.showContent?e._t("default"):e._e()],2)],1)],1)},Dd=[],Nd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ab-backdrop",class:[e.backdropType]})},Ld=[];const jd={mounted(){const e="dialog-backdrop-disabled";document.body.classList.contains(e)||document.body.classList.add(e)},beforeDestroy(){const e="dialog-backdrop-disabled";document.body.classList.contains(e)&&document.body.classList.remove(e)}};var Rd={name:"Backdrop",mixins:[jd],data(){return{backdropType:"shadow"}}},Ud=Rd,Fd=(n("55e6"),Object(g["a"])(Ud,Nd,Ld,!1,null,null,null)),Md=Fd.exports;k()(Fd,"components",{QDialog:y["a"]});var Bd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"bg-page text-page absolute-bottom-right shadow-1 rounded-borders q-ma-sm q-py-xs q-px-sm"},[e._t("default")],2)},Qd=[],Wd={name:"Corner"},zd=Wd,Hd=Object(g["a"])(zd,Bd,Qd,!1,null,"4cc4e2b0",null),Vd=Hd.exports;const Gd=300,Kd={data(){return{showContent:!1}},mounted(){this.show()},methods:{async hide(){this.showContent=!1,await new Promise((e=>setTimeout(e,Gd)))},async show(){this.showContent=!0,await new Promise((e=>setTimeout(e,Gd)))}}};var Yd={name:"ModalLayout",mixins:[Kd],components:{Backdrop:Md,Corner:Vd}},Jd=Yd,Xd=(n("4ec4"),Object(g["a"])(Jd,Ad,Dd,!1,null,null,null)),Zd=Xd.exports,eu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-center items-center"},[e._t("default"),n("q-btn",{attrs:{round:"","no-caps":"",size:"0.75rem",unelevated:"",icon:"close"},on:{click:function(){return e.$account.view.SignInPage=null}}})],2)},tu=[],nu={name:"Corner"},ou=nu,au=Object(g["a"])(ou,eu,tu,!1,null,null,null),su=au.exports;k()(au,"components",{QBtn:le["a"]});var iu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",[n("q-card-section",{staticClass:"flex justify-center items-center"},[n("q-spinner-ios",{attrs:{size:"1.2rem",color:"general"}}),n("div",{staticClass:"q-ml-sm"},[e._v(" "+e._s(e.title)+" ")])],1)],1)},ru=[],lu={name:"LoadingCard",props:{title:String}},cu=lu,du=Object(g["a"])(cu,iu,ru,!1,null,"598e682e",null),uu=du.exports;k()(du,"components",{QCard:v["a"],QCardSection:ie["a"],QSpinnerIos:nt["a"]});var hu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"non-selectable q-pt-lg"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("sign_in.sign_in")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{label:e.$t("field.username"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.username,callback:function(t){e.username=t},expression:"username"}}),n("q-input",{staticClass:"q-my-sm",attrs:{label:e.$t("field.password"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false",type:e.hidePassword?"password":"text"},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}]),model:{value:e.password,callback:function(t){e.password=t},expression:"password"}})],1),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.forgot_your_password"))),n("a",{staticClass:"underscore text-primary q-ml-xs cursor-pointer",on:{click:function(){return e.$account.view.SignInPage.updateCard("ResetPasswordCard")}}},[e._v(e._s(e.$t("tip.reset_password")))])])]),n("q-card-section",{staticClass:"non-selectable column items-stretch"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"general","text-color":"general",label:e.$t("action.sign_in")},on:{click:e.handleSignIn}},"q-btn",e.loadingProps("sign_in"),!1)),n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.sign_up")},on:{click:function(){return e.$account.view.SignInPage.updateCard("SignUpCard",{initialSignUpMode:"email"})}}},"q-btn",e.loadingProps("sign_up"),!1)),n("ABOAuthEntry")],1)],1)},pu=[];const mu={sign_in:{sign_in:["Sign In","登录账户","登錄賬戶"]},sign_up:{sign_up:["Sign Up","注册账户","註冊賬戶"],verify:["Identify verification","身份验证","身份驗證"]},reset_password:{find_your_account:["Find your account","找寻你的账户","找尋你的賬戶"],enter_your_username:["Enter your phone number or email","输入你的手机号码或电子邮箱","輸入你的手機號碼或電子郵箱"]},field:{username:["Phone number or email","手机号码或电子邮箱","手機號碼或電子郵箱"],email:["Email","邮箱","郵箱"],phone_number:["Phone Number","手机号码","手機號碼"],password:["Password","密码","密碼"],verification_code:["Verification code","验证码","驗證碼"],license_terms:["the license and terms","服务许可条款","服務許可條款"]},tip:{forgot_your_password:["Forgot your password? ","忘记密码了?","忘記密碼了?"],reset_password:["Reset password","重置密码","重置密碼"],no_email:["No email? ","没有邮箱?","沒有郵箱?"],sign_up_by_email:["Sign up by email","通过邮箱注册","通過郵箱註冊"],no_phone_number:["No phone number? ","没有手机号码?","沒有手機號碼?"],sign_up_by_phone_number:["Sign up by phone number","通过手机注册","通過手機註冊"],sms_sent:["A SMS with a verification code has been sent to your phone: {phone_number}","一封附带验证码的短信已发送到您的手机:{phone_number}","一封附帶驗證碼的短信已發送到您的手機:{phone_number}"],email_sent:["An email with a verification code has been sent to your email address: {email}","一封附带验证码的电子邮件已发送到您的邮箱:{email}","一封附帶驗證碼的電子郵件已發送到您的郵箱:{email}"],can_not_get_code:["Can not get verification code? ","无法获取验证码?","無法獲取驗證碼?"]},action:{resend_code:["Resend code","重发验证码","重發驗證碼"],finish:["Finish","完成","完成"],continue:["Continue","下一步","繼續"],i_accept:["I accept ","我接受","我接受"],sign_in:["Sign In","登录","登錄"],sign_up:["Sign Up","注册","註冊"],search:["Search","查找","查找"]}},_u=e=>{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};var fu={messages:_u(mu)};const gu={data(){return{hidePassword:!0}}},bu={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var yu={name:"SignInCard",i18n:fu,mixins:[bu,gu],props:{initial_username:String,initial_password:String},created(){this.initial_username&&(this.username=this.initial_username),this.initial_password&&(this.password=this.initial_password)},mounted(){this.password&&this.username&&this.handleSignIn()},data(){return{username:null,password:null}},methods:{async handleSignIn(){await this.withLoadingWrapper("sign_in",(async()=>{await this.$account.store.signIn(this.username,this.password)}))}}},vu=yu,wu=Object(g["a"])(vu,hu,pu,!1,null,null,null),ku=wu.exports;k()(wu,"components",{QCard:v["a"],QCardSection:ie["a"],QSpace:re["a"],QBtn:le["a"],QInput:K["a"],QIcon:Y["a"]});var Cu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$account.view.SignInPage.updateCard("SignInCard")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("sign_up.sign_up")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-pt-none"},["email"===e.signUpMode?[n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.email"),rules:[function(){return!0}],dense:"",spellcheck:"false"},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}}),n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.password"),rules:[function(){return!0}],dense:"",spellcheck:"false",type:e.hidePassword?"password":"text"},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}],null,!1,176215e3),model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.no_email"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs cursor-pointer",on:{click:function(t){e.signUpMode="phone_number"}}},[e._v(e._s(e.$t("tip.sign_up_by_phone_number")))])])]:"phone_number"===e.signUpMode?[n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.phone_number"),rules:[function(){return!0}],dense:"",spellcheck:"false"},model:{value:e.phone_number,callback:function(t){e.phone_number=t},expression:"phone_number"}}),n("q-input",{staticClass:"q-my-sm",attrs:{outlined:"",label:e.$t("field.password"),rules:[function(){return!0}],dense:"",spellcheck:"false",type:e.hidePassword?"password":"text"},scopedSlots:e._u([{key:"append",fn:function(){return[n("q-icon",{staticClass:"cursor-pointer",attrs:{name:e.hidePassword?"visibility_off":"visibility"},on:{click:function(t){e.hidePassword=!e.hidePassword}}})]},proxy:!0}]),model:{value:e.password,callback:function(t){e.password=t},expression:"password"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.no_phone_number"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs cursor-pointer",on:{click:function(t){e.signUpMode="email"}}},[e._v(e._s(e.$t("tip.sign_up_by_email")))])])]:e._e()],2),n("q-card-section",{staticClass:"q-py-none row items-center non-selectable"},[n("q-checkbox",{staticStyle:{"margin-left":"-8px"},attrs:{label:e.$t("action.i_accept")},model:{value:e.accept,callback:function(t){e.accept=t},expression:"accept"}}),n("div",{staticClass:"q-ml-xs underscore select-none cursor-pointer text-primary",on:{click:e.showLicenseTerms}},[e._v("\n "+e._s(e.$t("field.license_terms"))+"\n ")])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.continue")},on:{click:function(t){return e.withLoadingWrapper("sign_up",e.handleSignUp)}}},"q-btn",e.loadingProps("sign_up"),!1))],1)],1)},$u=[],Su=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("sign_up.verify")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.description))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.verification_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},scopedSlots:e._u([{key:"after",fn:function(){return[n("q-btn",e._b({staticClass:"full-height",staticStyle:{"min-width":"120px"},attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"general","text-color":"general",label:e.$t("action.resend_code")},on:{click:function(t){return e.withLoadingWrapper("resend",e.handleResend)}}},"q-btn",e.loadingProps("resend"),!1))]},proxy:!0}]),model:{value:e.verification_code,callback:function(t){e.verification_code=t},expression:"verification_code"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.can_not_get_code"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs",style:e.loadingState?{pointerEvents:"none",cursor:"not-allowed"}:{cursor:"pointer"},on:{click:function(){return e.$emit("switchMode","email"===e.signUpMode?"phone_number":"email")}}},[e._v(e._s("email"===e.signUpMode?e.$t("tip.sign_up_by_phone_number"):e.$t("tip.sign_up_by_email")))])])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.finish")},on:{click:function(t){return e.withLoadingWrapper("confirm",e.handleConfirm)}}},"q-btn",e.loadingProps("confirm"),!1))],1)],1)},xu=[];const Tu={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}},Iu={data(){return{showAttributes:!1,attributes:{nickname:null,gender:"not_say",birthday:null,locale:"not_say"}}}};var Pu={name:"SignUpConfirmCard",i18n:fu,mixins:[Tu,Iu],props:{signUpMode:String,resend:Function,confirm:Function},data(){return{verification_code:null}},computed:{description(){return"email"===this.signUpMode?this.$t("tip.email_sent",{email:"email"}):"phone_number"===this.signUpMode?this.$t("tip.sms_sent",{phone_number:"phone_number"}):void 0}},methods:{async handleResend(){try{await this.resend()}catch(e){}},async handleConfirm(){try{const e=Object.entries(this.attributes).reduce(((e,[t,n])=>n?{...e,[t]:n}:e),{});return await this.confirm(this.verification_code,e)}catch(e){}}}},Ou=Pu,qu=n("03bd"),Eu=n("abe8"),Au=Object(g["a"])(Ou,Su,xu,!1,null,null,null),Du=Au.exports;k()(Au,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QToggle:qu["a"],QTooltip:Ct["a"],QInput:K["a"],QSlideTransition:Eu["a"]});const Nu={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}},Lu={data(){return{hidePassword:!0}}},ju={data(){return{confirmDialog:null}},beforeDestroy(){this.confirmDialog&&this.confirmDialog.hide()},methods:{showConfirmDialog({data:e,resend:t,confirm:n}){this.confirmDialog||(this.confirmDialog=this.$account.utils.showInDialog(Du,{props:{signUpMode:this.signUpMode,resend:t,confirm:async(...e)=>{await n(...e),this.confirmDialog.hide()}},on:{back:()=>{this.confirmDialog.hide(),this.$account.view.SignInPage.updateCard("SignInCard")},switchMode:e=>{this.confirmDialog.hide(),this.signUpMode=e}}}),this.confirmDialog.onDismiss((()=>this.confirmDialog=null)))}}};var Ru={name:"SignUpCard",i18n:fu,mixins:[Nu,ju,Lu],props:{initialSignUpMode:String},data(){return{signUpMode:"email",email:null,phone_number:null,password:null,accept:!1}},created(){this.signUpMode=this.initialSignUpMode},methods:{showLicenseTerms(){this.$account.$emit("signUp.showLicenseTerms")},async handleSignUp(){const e={email:{email:this.email},phone_number:{phone_number:this.phone_number,phone_number_code:this.phone_number_code}}[this.signUpMode];Object.assign(e,{password:this.password});const t=await this.$account.store.signUp(e,{requireConfirm:this.handleSignUpConfirm.bind(this)});t&&this.$account.view.SignInPage.updateCard("SignInCard",{initial_username:{email:this.email,phone_number:this.phone_number}[this.signUpMode],initial_password:this.password})},async handleSignUpConfirm({data:e,resend:t,callback:n}){let o=!1;return this.showConfirmDialog({data:e,resend:t,confirm:async(e,t)=>{await n(e,t),o=!0}}),await new Promise((e=>this.confirmDialog.onDismiss(e))),o}}},Uu=Ru,Fu=Object(g["a"])(Uu,Cu,$u,!1,null,null,null),Mu=Fu.exports;k()(Fu,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"],QIcon:Y["a"],QCheckbox:fl["a"]}),k()(Fu,"directives",{ClosePopup:Yl["a"]});var Bu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$account.view.SignInPage.updateCard("SignInCard")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("reset_password.find_your_account")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("reset_password.enter_your_username"))+" ")])])]),n("q-card-section",{staticClass:"q-py-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{label:e.$t("field.username"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.username,callback:function(t){e.username=t},expression:"username"}})],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",{staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.search")},on:{click:e.handleResetPassword}})],1)],1)},Qu=[];const Wu={data(){return{hidePassword:!0}}};var zu={name:"ResetPasswordCard",mixins:[Wu],i18n:fu,data(){return{username:null}},methods:{handleResetPassword(){}}},Hu=zu,Vu=Object(g["a"])(Hu,Bu,Qu,!1,null,null,null),Gu=Vu.exports;k()(Vu,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var Ku=async function({card:e,props:t,events:n}){const o={},a={cards:o,corner:su};this.$on("createSignInPage",Xu),await this.$emit("createSignInPage",a);const s=Yu("SignInPage",{cards:o,card:e,props:t,events:n,corner:a.corner}),i=this.utils.createVueInstance(s,!0);return i.$mount(Ju("alphabiz-sign-in-page")),i};function Yu(e,{cards:t,card:n,props:o,events:a,corner:s}){const i={beforeCreate(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)},created(){this.$account.view[e]=this},beforeDestroy(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)},methods:{async view$destroy(){await this.$refs.layout.hide(),this.$destroy(),this.$el.remove()}}};return{name:e,mixins:[i],render:r,data(){return{card:n,props:o||{},events:a||{}}},methods:{updateCard(e,t={},n={}){this.card=e,this.props=t,this.events=n}}};function r(e){return e(Zd,{ref:"layout",scopedSlots:{corner:()=>e(s),default:()=>e(t[this.card],{props:this.props,on:this.events})}})}}function Ju(e){return document.getElementById(e)||(()=>{const t=document.createElement("div");return t.id=e,document.body.appendChild(t),t})()}function Xu({cards:e}){Object.assign(e,{LoadingCard:uu,SignInCard:ku,SignUpCard:Mu,ResetPasswordCard:Gu})}n("d176");var Zu={SignInPage:Ku},eh={onCreateCore(e,t,n){return{...ad,...rd,...cd,...md,...Cd}},onConfigure(e,t,n){Sd(e,t,n)},onCreateStoreMixin(e,t,n){return{mixins:[Pd,Od,qd,Ed]}},onRegisterView(e,t,n){return n.$on("authState.signedIn",(()=>n.view.SignInPage=null)),{...Zu}}},th=n("a071"),nh={onCreateCore(e,t,n){return{}},onConfigure(e,t,n){const o=n;o.$on("signIn.createChallengeHandlers",(t=>{t.CUSTOM_CHALLENGE=async(t,n,o)=>{const a=await e.prototype.$recaptcha("login");if(o=await Ul["a"].sendCustomChallengeAnswer(o,a),!o)throw new Error("Network Error");return!0}}));const a=o.$logger.tags("ReCaptcha"),s=async({offLine:e,onLine:t},n)=>{await new Promise((t=>{if(navigator.onLine)t();else{const o=setInterval((()=>{navigator.onLine?(clearInterval(o),t()):e()}),n)}})),t()};s({offLine(){a.log("network offline, retry...")},onLine(){e.use(th["VueReCaptcha"],{siteKey:"6LeQxGkdAAAAAEU4CVmCtybi8FkBPoX4oy1UnN7Q",loaderOptions:{useRecaptchaNet:!0,autoHideBadge:!0,explicitRenderParameters:{badge:"bottomright"}}}),a.log("loaded")}},3e3)},onCreateStoreMixin(e,t,n){return{}},onRegisterView(e,t,n){return{}}};async function oh(){const e=await Ul["a"].currentAuthenticatedUser();return await Ul["a"].getPreferredMFA(e)}async function ah(e){if(!["SMS_MFA","TOTP","SOFTWARE_TOKEN_MFA","NOMFA"].includes(e))throw new Error("invalid_mfa_type");const t=await Ul["a"].currentAuthenticatedUser();await Ul["a"].setPreferredMFA(t,e)}async function sh(){const e=await Ul["a"].currentAuthenticatedUser();return await Ul["a"].setupTOTP(e)}async function ih(e){const t=await Ul["a"].currentAuthenticatedUser();await Ul["a"].verifyTotpToken(t,e)}async function rh(e,{language:t}){const{ABDevRest:n}=this.utils;e=e.toLowerCase();const o=`${t}:D`,{email:a,phoneNumber:s}=await n.postGuest("/account/verifyForDisableMFA",{username:e,metadata:{msgLocale:o}});return{email:{destination:a.Destination},phoneNumber:{destination:s.Destination}}}async function lh(e,{emailCode:t,phoneCode:n}){const{ABDevRest:o}=this.utils;e=e.toLowerCase(),await o.postGuest("/account/verifySubmitForDisableMFA",{username:e,emailCode:t,phoneCode:n})}var ch={setupTOTP:sh,verifyTotpToken:ih,getMFA:oh,changeMFA:ah,disableMFASend:rh,disableMFASubmit:lh};function dh(){return this.$store.getters.settings.language}const uh=async function(e){const t=()=>this.$account.core.verifyFieldSend("phone_number",{language:dh.call(this)});await t();const n=await e({resend:()=>t(),callback:async e=>{await this.$account.core.verifyFieldSubmit("phone_number",e)}});return n},hh=async function(e){const t=await e({setup:()=>this.$account.core.setupTOTP(),callback:async e=>{await this.$account.core.verifyTotpToken(e)}});return t};var ph={methods:{async setNoMfa({requireCodeFromSMS:e,requireCodeFromOTP:t}){const n=this.$account.core.getMFA();if("NOMFA"===n)return!0;let o=!1;if("SMS_MFA"===n)o=await uh.call(this,e);else{if("SOFTWARE_TOKEN_MFA"!==n)throw new Error("invalid_mfa_type");o=await hh.call(this,t)}return!!o&&(await this.$account.core.changeMFA("NOMFA"),!0)},async setSmsMfa({requireCodeFromSMS:e}){const t=this.$account.core.getMFA();if("SMS_MFA"===t)return!0;const n=await uh.call(this,e);return!!n&&(await this.$account.core.changeMFA("SMS_MFA"),!0)},async setOtpMfa({requireCodeFromOTP:e}){const t=this.$account.core.getMFA();if("SOFTWARE_TOKEN_MFA"===t)return!0;const n=await hh.call(this,e);return!!n&&(await this.$account.core.changeMFA("SOFTWARE_TOKEN_MFA"),!0)},async disableMfa(e){const t=await this.$account.core.disableMFASend(e,{language:dh.call(this)});let n=!1;return await this.$account.$emit("disableMfa.requireCodes",{data:t,submit:async({emailCode:t,phoneCode:o})=>{await this.$account.core.disableMFASubmit(e,{emailCode:t,phoneCode:o}),n=!0}}),n}},created(){const e=async(e,t,n)=>{let o=!1;return await this.$account.$emit("signIn.requireCodeFromSMS",{username:n.username,resend:async()=>{n=await Ul["a"].signIn(e,t)},submit:async e=>{await Ul["a"].confirmSignIn(n,e,"SMS_MFA"),o=!0}}),o},t=async(e,t,n)=>{let o=!1;return await this.$account.$emit("signIn.requireCodeFromOTP",{username:n.username,submit:async e=>{await Ul["a"].confirmSignIn(n,e,"SOFTWARE_TOKEN_MFA"),o=!0}}),o};this.$account.$on("signIn.createChallengeHandlers",(n=>Object.assign(n,{SMS_MFA:e,SOFTWARE_TOKEN_MFA:t})))}},mh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("verify_your_identity")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("tip.sms_sent",{phone_number:"phone_number"})))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.verification_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},scopedSlots:e._u([{key:"after",fn:function(){return[n("q-btn",e._b({staticClass:"full-height",staticStyle:{"min-width":"120px"},attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"general","text-color":"general",label:e.$t("action.resend_code")},on:{click:function(t){return e.withLoadingWrapper("resend",e.handleResend)}}},"q-btn",e.loadingProps("resend"),!1))]},proxy:!0}]),model:{value:e.verification_code,callback:function(t){e.verification_code=t},expression:"verification_code"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.can_not_mfa"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs",style:e.loadingState?{pointerEvents:"none",cursor:"not-allowed"}:{cursor:"pointer"},on:{click:e.handleDisableMFA}},[e._v(e._s(e.$t("action.disable_mfa")))])])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.submit")},on:{click:function(t){return e.withLoadingWrapper("submit",e.handleSubmit)}}},"q-btn",e.loadingProps("submit"),!1))],1)],1)},_h=[];const fh={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var gh={name:"RequireCodeFromSMS",mixins:[fh],props:{username:String,resend:Function,submit:Function},data(){return{verification_code:null}},methods:{async handleDisableMFA(){try{this.$emit("back"),this.$account.view.SignInPage.updateCard("LoadingCard",{title:this.$t("disable_mfa.loading")}),await this.$account.store.disableMfa(this.username)}catch(e){}finally{this.$account.view.SignInPage.updateCard("SignInCard")}},async handleResend(){try{await this.resend()}catch(e){}},async handleSubmit(){try{return await this.submit(this.verification_code),void this.$emit("back")}catch(e){}}}},bh=gh,yh=Object(g["a"])(bh,mh,_h,!1,null,null,null),vh=yh.exports;k()(yh,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var wh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("verify_your_identity")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("tip.require_otp")))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.verification_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.verification_code,callback:function(t){e.verification_code=t},expression:"verification_code"}}),n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[e._v(e._s(e.$t("tip.can_not_mfa"))),n("a",{staticClass:"underscore select-none text-primary q-ml-xs",style:e.loadingState?{pointerEvents:"none",cursor:"not-allowed"}:{cursor:"pointer"},on:{click:function(t){return e.withLoadingWrapper("disable",e.handleDisableMFA)}}},[e._v(e._s(e.$t("action.disable_mfa")))])])],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.submit")},on:{click:function(t){return e.withLoadingWrapper("submit",e.handleSubmit)}}},"q-btn",e.loadingProps("submit"),!1))],1)],1)},kh=[];const Ch={verify_your_identity:["Verify your identity","验证您的身份","驗證您的身份"],disable_mfa:{title:["Disable MFA","关闭二级验证","關閉二級驗證"],loading:["Loading...","加载中...","加載中..."]},action:{submit:["Submit","提交","提交"],resend_code:["Resend code","重发验证码","重發驗證碼"],disable_mfa:["Disable MFA","关闭二级验证","關閉二級驗證"]},field:{verification_code:["Verification code","验证码","驗證碼"],email_code:["Email Code","邮箱验证码","郵箱驗證碼"],sms_code:["SMS Code","短信验证码","簡訊驗證碼"]},tip:{require_otp:["MFA is enabled for your account. To finish signing in, please turn on your device and type the TOTP","您的账户已启用安全令牌。要完成登录,请查看您的设备并输入验证码","您的賬戶已啟用安全令牌。要完成登錄,請查看您的設備並輸入驗證碼"],sms_sent:["A SMS with a verification code has been sent to your phone: {phone_number}","一封附带验证码的短信已发送到您的手机:{phone_number}","一封附帶驗證碼的短信已發送到您的手機:{phone_number}"],can_not_mfa:["MFA in trouble? ","无法进行二级验证?","無法進行二級驗證?"],verify_identity_by_codes:["Enter the email verification code and SMS verification code to verify your identity","输入邮件验证码与短信验证码以验证您的身份","輸入郵件驗證碼與簡訊驗證碼以驗證您的身份"]}},$h=e=>{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};var Sh={messages:$h(Ch)};const xh={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var Th={name:"RequireCodeFromOTP",i18n:Sh,mixins:[xh],props:{username:String,submit:Function},data(){return{verification_code:null}},methods:{async handleDisableMFA(){try{this.$emit("back"),this.$account.view.SignInPage.updateCard("LoadingCard",{title:this.$t("disable_mfa.loading")}),await this.$account.store.disableMfa(this.username)}catch(e){}finally{this.$account.view.SignInPage.updateCard("SignInCard")}},async handleSubmit(){try{await this.submit(this.verification_code),this.$emit("back")}catch(e){}}}},Ih=Th,Ph=Object(g["a"])(Ih,wh,kh,!1,null,null,null),Oh=Ph.exports;k()(Ph,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var qh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-card",{staticClass:"overflow-hidden column no-wrap absolute mobile-fullscreen",staticStyle:{"min-width":"360px","max-width":"480px"}},[n("q-card-section",{staticClass:"q-pa-none"},[n("q-btn",{staticStyle:{width:"56px",height:"48px"},attrs:{icon:"arrow_back",unelevated:""},on:{click:function(){return e.$emit("back")}}})],1),n("q-card-section",{staticClass:"non-selectable"},[n("div",{staticClass:"flex items-center",staticStyle:{margin:"-4px 0"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v(e._s(e.$t("disable_mfa.title")))]),n("q-space")],1)]),n("q-card-section",{staticClass:"q-py-none"},[n("p",{staticClass:"q-pl-xs q-mb-sm non-selectable"},[n("span",[e._v(e._s(e.$t("tip.verify_identity_by_codes")))])])]),n("q-card-section",{staticClass:"q-pt-none"},[n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.email_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.email_code,callback:function(t){e.email_code=t},expression:"email_code"}}),n("q-input",{staticClass:"q-my-sm",attrs:{disable:!!e.loadingState,label:e.$t("field.sms_code"),rules:[function(){return!0}],outlined:"",dense:"",spellcheck:"false"},model:{value:e.sms_code,callback:function(t){e.sms_code=t},expression:"sms_code"}})],1),n("q-card-section",{staticClass:"non-selectable column items-stretch q-pt-none"},[n("q-btn",e._b({staticClass:"q-my-xs",attrs:{unelevated:"","no-caps":"","no-wrap":"",color:"primary","text-color":"primary",label:e.$t("action.submit")},on:{click:function(t){return e.withLoadingWrapper("submit",e.handleSubmit)}}},"q-btn",e.loadingProps("submit"),!1))],1)],1)},Eh=[];const Ah={data(){return{loadingState:null}},methods:{loadingProps(e){return{loading:this.loadingState===e,disable:this.loadingState!==e&&!!this.loadingState}},async withLoadingWrapper(e,t){try{return this.loadingState=e,await t()}finally{this.loadingState=null}}}};var Dh={name:"RequireCodesForDisableMFA",mixins:[Ah],props:{submit:Function},data(){return{email_code:null,sms_code:null}},methods:{async handleSubmit(){try{await this.submit({emailCode:this.email_code,phoneCode:this.sms_code}),this.$emit("back")}catch(e){}}}},Nh=Dh,Lh=Object(g["a"])(Nh,qh,Eh,!1,null,null,null),jh=Lh.exports;k()(Lh,"components",{QCard:v["a"],QCardSection:ie["a"],QBtn:le["a"],QSpace:re["a"],QInput:K["a"]});var Rh={async RequireCodeFromSMS({username:e,resend:t,submit:n}={}){const o=this.utils.showInDialog(vh,{props:{username:e,resend:t,submit:n},on:{back(){o.hide()}}});await new Promise(o.onDismiss)},async RequireCodeFromOTP({username:e,submit:t}){const n=this.utils.showInDialog(Oh,{props:{username:e,submit:t},on:{back(){n.hide()}}});await new Promise(n.onDismiss)},async RequireCodesForDisableMFA({data:e,submit:t}){return await new Promise((e=>{this.view.SignInPage.updateCard("RequireCodesForDisableMFA",{submit:t},{back:e})}))}};const Uh=({cards:e})=>Object.assign(e,{RequireCodesForDisableMFA:jh});var Fh={onCreateCore(e,t,n){return{...ch}},onConfigure(e,t,n){},onCreateStoreMixin(e,t,n){return{...ph}},onRegisterView(e,t,n){return n.$on("createSignInPage",Uh),n.$on("signIn.requireCodeFromSMS",((...e)=>n.view.RequireCodeFromSMS(...e))),n.$on("signIn.requireCodeFromOTP",((...e)=>n.view.RequireCodeFromOTP(...e))),n.$on("disableMfa.requireCodes",((...e)=>n.view.RequireCodesForDisableMFA(...e))),{...Rh}}},Mh={onCreateCore(e,t,n){async function o({code:e,email:t,phone:n}){const{ABDevRest:o}=this.utils;t&&(t=t.toLowerCase()),await o.post("/invitation/deliverCode",{id:e,email:t,phone:n})}async function a(){const{ABDevRest:e}=this.utils,t=await e.post("/invitation/getCodes");return t}return{inviteCode:o,getInvitationCodes:a}},onConfigure(e,t,n){},onCreateStoreMixin(e,t,n){return{}},onRegisterView(e,t,n){return{}}},Bh={setState:e=>{window.sessionStorage.setItem("oauth_state",e)},getState:()=>{const e=window.sessionStorage.getItem("oauth_state");return window.sessionStorage.removeItem("oauth_state"),e},setPKCE:e=>{window.sessionStorage.setItem("ouath_pkce_key",e)},getPKCE:()=>{const e=window.sessionStorage.getItem("ouath_pkce_key");return window.sessionStorage.removeItem("ouath_pkce_key"),e},clearAll:()=>{window.sessionStorage.removeItem("ouath_pkce_key"),window.sessionStorage.removeItem("oauth_state")}},Qh={encode(e){return e.split("").map((e=>e.charCodeAt(0).toString(16).padStart(2,"0"))).join("")},decode(e){return e.match(/.{2}/g).map((e=>String.fromCharCode(parseInt(e,16)))).join("")}},Wh=n("36f2");const zh="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var Hh=(e,t,n)=>{Wh["a"].dispatch("auth",{event:e,data:t,message:n},"Auth",zh)},Vh={urlSafe:Qh,oauthStorage:Bh,dispatchAuthEvent:Hh},Gh=n("2b49"),Kh={async pending(e,t={}){let n=!1;return await this.$emit("handleOAuthEvent",e,{...t,next:e=>n=e}),n},cancelled(e){return this.$emit("handleOAuthEvent","cancelled",e)},succeed(e){return this.$emit("handleOAuthEvent","succeed",e)},failed(e,t){return"string"===typeof e&&(e=new Error(e)),this.$emit("handleOAuthEvent","failed",t,e)}};function Yh(){const e=Gh["a"].generateState(128);Vh.oauthStorage.setPKCE(e);const t=Gh["a"].generateChallenge(e),n="S256";return{code_challenge:t,code_challenge_method:n}}async function Jh({event:e,provider_sub:t}){if("account_linked"===e){const e="oauth_account_has_been_connected";await Kh.failed.call(this,["oauth_error",e].join("."))}else if("account_unlinked"===e){const e=await Kh.pending.call(this,"connecting");if(!e)return;const n=Vh.oauthStorage.getState(),o=Vh.oauthStorage.getPKCE(),{ABDevRest:a}=this.utils;await a.post("/oauth/connect",{state:n,provider_sub:t,code_verifier:o}),await Kh.succeed.call(this)}}var Xh=n("d830");function Zh(){const e=Gh["a"].generateState(128);Vh.oauthStorage.setPKCE(e);const t=Gh["a"].generateChallenge(e),n="S256";return{code_challenge:t,code_challenge_method:n}}async function ep({event:e,state:t,provider:n}){if("account_linked"===e){const e=await Kh.pending.call(this,"logging_in");if(!e)return;if(t!==Vh.oauthStorage.getState())return;const o=Vh.oauthStorage.getPKCE(),{ABDevRest:a}=this.utils,{provider_sub:s}=n,i={state:t,provider_sub:s,code_verifier:o},r=await a.postGuest("/oauth/tokens",i);await tp.call(Ul["a"],r),await Kh.succeed.call(this)}else if("account_unlinked"===e){const e="can_not_login_unconnected_account";await Kh.failed.call(this,["oauth_error",e].join("."))}}async function tp({IdToken:e,AccessToken:t,RefreshToken:n}){const o=new Xh["h"]({IdToken:new Xh["c"]({IdToken:e}),RefreshToken:new Xh["d"]({RefreshToken:n}),AccessToken:new Xh["b"]({AccessToken:t})});let a;this._config.identityPoolId&&(a=await this.Credentials.set(o,"session"));const s=this.createCognitoUser(o.getIdToken().decodePayload()["cognito:username"]);return s.setSignInUserSession(o),{currentUser:s,credentials:a}}const np={connect:o,login:a};function op({provider:e,action:t}){const n=this,{ABDevRest:o}=this.utils,a=n.$logger.tags("OAuthAction","Request"),s=Gh["a"].generateState(32);Vh.oauthStorage.setState(s);const i=Object.entries({state:s,action:t,identity_provider:e,redirect_uri:`${Ul["a"]._oAuthHandler._config.redirectSignIn}v2/`,...np[t].createParams.call(this)||{}}).map((e=>e.map(encodeURIComponent).join("="))).join("&"),r=`${o.endpoint}/oauth/request`,l=`${r}?${i}`;a.log(l),Gh["a"].urlOpener(l)}async function ap(e,t="electron"){const n=this,o=n.$logger.tags("OAuthAction","Response"),a=Array.from(new URL(e).searchParams.entries()).reduce(((e,[t,n])=>({...e,[t]:n})),{}),{action:s,identity_provider:i}=a;if(!s)return;const r=JSON.parse(a.data);if("web"===t){const e=n.$on("handleOAuthEvent",((t,o,a)=>{var r,l;e(),null===(r=(l=n.view).OAuthFlowRestored)||void 0===r||r.call(l,{action:s,identity_provider:i},{stage:t,data:o,error:a})}))}o.tags(s,i).log(r),await np[s].eventHandler.call(this,r)}function sp({initial_stage:e,initial_params:t,stage_restrict:n,handlers:o}){const a=this,s=["cancelled","failed","succeed"];let i,r=null,l=null;const c=e=>i!==e&&(!s.includes(i)&&(!!s.includes(e)||!!n[e]&&!!n[i].includes(e))),d=()=>new Promise((async(n,d)=>{const u=async(e,t,r)=>{if(a.$logger.tags("OAuthEvent",e).log(...r?[r.message,t]:[t]),i=e,s.includes(i)){var c;null===(c=l)||void 0===c||c(),"failed"===i?(o[i]&&await o[i](r,t),d(r)):(o[i]&&await o[i](t),n())}else{if(!o[i])return;const e=await o[i](t);null===t||void 0===t||t.next(e)}};await u(e,...t||[]),l=a.$on("handleOAuthEvent",(async(e,t,n)=>{c(e)&&await u(e,t,n)})),r=e=>u("cancelled",e)}));return{cancel:e=>r(e),promise:()=>d().finally((()=>{var e;return null===(e=l)||void 0===e?void 0:e()}))}}async function ip(){const{ABDevRest:e}=this.utils,t=await e.post("/oauth/providers");return t}async function rp(e){const{ABDevRest:t}=this.utils;await t.post("/oauth/disconnect",{provider_sub:e})}var lp={queryOAuthProviders:ip,disconnectOAuthProvider:rp,createOAuthFlow:sp,handleOAuthActionResponse:ap,requestOAuthAction:op},cp=n("d1a4"),dp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"overflow-hidden full-width",style:{display:e.hide?"none":"unset"}},[n("q-separator",{staticClass:"q-my-sm",attrs:{color:"general"}}),n("div",{staticClass:"column items-stretch",staticStyle:{margin:"-4px"}},e._l(e.providersEnabled,(function(t,o){return n("q-btn",{key:o,staticClass:"q-ma-xs",attrs:{loading:e.loadingState===o,disable:!!e.loadingState,"no-caps":"","no-wrap":"",icon:t.icon,label:e.$t("oauth_login.sign_in_with",{provider:t.name}),unelevated:"",color:"general","text-color":"general"},on:{click:function(){return e.handleClick(t)}}})})),1)],1)},up=[],hp=n("b65b"),pp=hp["a"],mp=Object(g["a"])(pp,dp,up,!1,null,"391ab58c",null),_p=mp.exports;k()(mp,"components",{QSeparator:ce["a"],QBtn:le["a"]});var fp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-list",{staticClass:"rounded-borders",attrs:{bordered:"",separator:""}},e._l(e.providerItems,(function(t,o){return n("q-item",{key:o,staticClass:"q-pa-md"},[n("q-item-section",{staticStyle:{"min-width":"unset"},attrs:{avatar:""}},[n("q-icon",{staticStyle:{opacity:"0.7"},attrs:{size:"1.75rem",name:t.icon}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(t.providerName))]),t.providerUserId?n("q-item-label",{attrs:{caption:""}},[e._v(e._s(t.providerUserId))]):e._e()],1),Object.keys(t.handlers).length?n("q-item-section",{attrs:{side:""}},[1===Object.keys(t.handlers).length?[n("q-btn",{staticStyle:{margin:"-8px -8px -8px 0"},attrs:{disable:e.loadingState!==t.providerName&&!!e.loadingState,loading:e.loadingState===t.providerName,icon:Object.values(t.handlers)[0].icon,flat:"",round:""},on:{click:function(){return Object.values(t.handlers)[0].click()}}},[n("q-tooltip",{ref:"tooltip",refInFor:!0},[e._v(e._s(Object.values(t.handlers)[0].label))])],1)]:[n("q-btn",{staticStyle:{margin:"-8px -8px -8px 0"},attrs:{disable:e.loadingState!==t.providerName&&!!e.loadingState,loading:e.loadingState===t.providerName,icon:"more_vert",flat:"",round:""}},[n("q-menu",{attrs:{"touch-position":"","auto-close":"","transition-show":"jump-down","transition-hide":"jump-up"}},[n("q-list",{staticStyle:{"min-width":"180px"}},[e._l(t.handlers,(function(t,o){return[n("q-item",{key:o,attrs:{clickable:""},on:{click:function(){return t.click()}}},[n("q-item-section",{staticStyle:{"min-width":"unset"},attrs:{avatar:""}},[n("q-icon",{staticStyle:{opacity:"0.7"},attrs:{size:"1.5rem",name:t.icon}})],1),n("q-item-section",[n("q-item-label",[e._v(e._s(t.label))])],1)],1)]}))],2)],1)],1)]],2):e._e()],1)})),1)},gp=[],bp=n("0925"),yp=n("bdb1"),vp=n("076e"),wp={name:"OAuthManager",i18n:vp["a"],data(){return{loadingState:null,loaded:!1,providers:[]}},mounted(){this.queryOAuthProviders().then((()=>this.loaded=!0))},methods:{async queryOAuthProviders(){this.providers=await this.$account.core.queryOAuthProviders()},async disconnectOAuthProvider(e,t){const n=[e,t].join("_");await this.$account.core.disconnectOAuthProvider(n),await this.queryOAuthProviders(),this.$q.notify({message:this.$t("oauth_disconnect.notify.disconnected",{provider:e}),type:"positive",position:"bottom-right",timeout:5e3})}},computed:{providerItems(){const e=(e,t)=>{const n=t=>async()=>{try{this.loadingState=e,await t()}finally{this.loadingState=null}},o={};return t?o.disconnect={icon:"delete",label:this.$t("oauth_disconnect.disconnect",{provider:e}),click:n((()=>this.disconnectOAuthProvider(e,t)))}:o.connect={icon:"add",label:this.$t("oauth_connect.connect_to",{provider:e}),click:n((async()=>{await yp["a"].connect.call(this,e),await this.queryOAuthProviders()}))},o},t=["Github","Twitter"].filter((e=>this.d$cfg.oauth.providers.includes(e))).map((e=>{var t;return{providerName:e,providerUserId:null===(t=this.providers.find((t=>t.provider_name===e)))||void 0===t?void 0:t.provider_sub.slice(e.length+1)}}));return[...t.map((({providerName:t,providerUserId:n})=>({icon:bp["a"].getIcon(t),providerName:t,providerUserId:n||this.$t("oauth_unset"),handlers:e(t,n)})))]}}},kp=wp,Cp=Object(g["a"])(kp,fp,gp,!1,null,null,null),$p=Cp.exports;k()(Cp,"components",{QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QItemLabel:qe["a"],QBtn:le["a"],QTooltip:Ct["a"],QMenu:Gl["a"]});var Sp={OAuthFlowRestored({action:e,identity_provider:t},{stage:n,data:o,error:a}){this.$logger.tags("OAuthFlowRestored",e,n).log(o);const s="OAuthFlowRestored";return this.utils.createVueInstance({i18n:vp["a"],beforeCreate(){const e=this.$account.view[s];e instanceof Function||this.destroy()},created(){var i;this.$account.view[s]=this,null===(i=yp["a"][e])||void 0===i||i.call(this,t,{initial_stage:n,initial_params:[o,a]}).finally((()=>{this.destroy()}))},beforeDestroy(){const e=this.$account.view[s];e instanceof Function||(this.$account.view[s]=null)},methods:{destroy(){this.$account.view[s]=null}}},!0)}},xp={onCreateCore(e,t,n){return{...lp}},onConfigure(e,t,o){Object(cp["a"])(e,t,o);const a=t.app.router;a.addRoute({path:"/oauth_redirect/:app_name/:redirect_to/v2",component:()=>n.e(7).then(n.bind(null,"4dfe"))});const s=e=>t=>{const n=e.split("/").slice(1),o=t.split("/").slice(1),a={};if(n.length===o.length){for(let e=0;e{const t={"en-US":{},"zh-CN":{},"zh-TW":{}},n=Object.keys(t),o=(e,o)=>{e.forEach(((e,a)=>{o.reduce(((t,n,a)=>(o.length-1===a?t[n]=e:t[n]=t[n]||{},t[n])),t[n[a]])}))},a=(e,t)=>{Object.entries(e).forEach((([e,n])=>{n&&"object"===typeof n&&(Array.isArray(n)?o(n,[...t,e]):a(n,[...t,e]))}))};return a(e,[]),t};var Wp={messages:Qp(Bp)},zp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-item",{staticClass:"q-pa-md"},[n("q-item-section",{staticStyle:{"min-width":"unset"},attrs:{avatar:""}},[n("q-icon",{staticStyle:{opacity:"0.7"},attrs:{size:"2.8rem",name:e.icon}})],1),n("q-item-section",[n("q-item-label",[n("span",{staticClass:"text-bold non-selectable",staticStyle:{"font-size":"1rem"}},[e._v(e._s(e.title))])]),e.member?n("q-item-label",{attrs:{caption:""}},[e._v("\n "+e._s(e.member)+"\n ")]):e._e(),n("div",{staticClass:"q-mt-sm non-selectable"},[n("div",{staticStyle:{margin:"-4px"}},e._l(e.stages,(function(t){return n("TaskItemStage",{key:t.index,attrs:{status:e.status,stage:t,current_stage:e.current_stage}})})),1)])],1)],1)},Hp=[],Vp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-menu",e._b({attrs:{"auto-close":"","transition-show":"jump-down","transition-hide":"jump-up"}},"q-menu",e.dropdown?{fit:!0,anchor:"bottom left",self:"top left"}:{touchPosition:!0},!1),[n("q-list",{staticStyle:{"min-width":"200px"}},e._l(e.actions,(function(t,o){return n("q-item",{key:o,attrs:{clickable:""},on:{click:t.handler}},[n("q-item-section",[n("q-item-label",[e._v(e._s(t.label))])],1)],1)})),1)],1)},Gp=[],Kp={name:"ActionMenu",props:{actions:Object,dropdown:{type:Boolean,default:!1}}},Yp=Kp,Jp=Object(g["a"])(Yp,Vp,Gp,!1,null,"336359cc",null),Xp=Jp.exports;k()(Jp,"components",{QMenu:Gl["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"]});var Zp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-chip",{attrs:{clickable:!0,color:e.stage.color,"text-color":e.stage.color,"icon-right":e.stage.icon,outline:e.stage.index!==e.current_stage}},[n("div",[e._v(e._s(e.stage.index+1)+". "+e._s(e.stage.label))]),n("q-menu",{attrs:{"transition-show":"jump-down","transition-hide":"jump-down",touchPosition:!1}},[n("q-card",{staticClass:"overflow-hidden non-selectable",staticStyle:{"min-width":"200px","max-width":"320px","max-height":"480px"}},[n("q-card-section",[n("div",{staticClass:"flex items-center no-wrap"},[n("div",{staticClass:"text-h6 text-weight-bold ellipsis"},[e._v(e._s(e.stage.label))]),n("q-badge",{staticClass:"q-ml-xs",attrs:{color:e.stage.color,"text-color":e.stage.color}},[n("div",[e._v(e._s(e.stage.status))])])],1),e.stage.subtitle?n("div",{staticClass:"text-caption"},[e._v(e._s(e.stage.subtitle))]):e._e()]),n("q-card-section",{staticClass:"q-pt-none"},[n("div",[e._v(e._s(e.stage.desc))])]),e.stage.actions&&e.stage.actions.length?n("q-card-section",{staticClass:"q-pt-none column items-end q-pb-sm"},e._l(e.stage.actions,(function(t,o){return n("q-btn",e._b({key:o,staticClass:"q-mb-xs",attrs:{unelevated:"",loading:e.loadingState==="action_"+o},on:{click:function(){return e.loadingWrapper(o,t.handler)}}},"q-btn",t,!1))})),1):e._e()],1)],1)],1)},em=[],tm={name:"TaskItemStage",i18n:Wp,data(){return{loadingState:null}},props:{status:String,stage:Object,current_stage:Number},methods:{async loadingWrapper(e,t){try{this.loadingState=`action_${e}`,await t()}finally{this.loadingState=null}}}},nm=tm,om=n("da23"),am=Object(g["a"])(nm,Zp,em,!1,null,"02a3e274",null),sm=am.exports;k()(am,"components",{QChip:om["a"],QMenu:Gl["a"],QCard:v["a"],QCardSection:ie["a"],QBadge:ki["a"],QIcon:Y["a"],QBtn:le["a"]});var im={name:"TaskItem",i18n:Wp,components:{ActionMenu:Xp,TaskItemStage:sm},props:{id:String,category:String,icon:String,title:String,current_stage:Number,status:String,member:String,stages:Array}},rm=im,lm=Object(g["a"])(rm,zp,Hp,!1,null,null,null),cm=lm.exports;k()(lm,"components",{QItem:Pe["a"],QItemSection:Oe["a"],QIcon:Y["a"],QItemLabel:qe["a"],QBtn:le["a"]});const dm=function(e){const t={id:"SubscribeGithubRepo",category:"SubscribeGithubRepo",icon:"fab fa-github",title:this.$t("task_github_subscribe_repo.title"),current_stage:0,status:"enabled",member:null,stages:[]},n=(e,t)=>this.$t(`task_github_subscribe_repo.task_stage.${e}`,t);if(t.stages.push({index:0,label:n("connect_to_github.label"),desc:n("connect_to_github.desc")},{index:1,label:n("subscribe_repo.label"),desc:n("subscribe_repo.desc")},{index:2,label:n("subscribe_repo_for.label",{month:1}),desc:n("subscribe_repo_for.desc",{month:1})},{index:3,label:n("subscribe_repo_for.label",{month:3}),desc:n("subscribe_repo_for.desc",{month:3})}),e){const n=JSON.parse(e.metadata);Object.assign(t,{id:e.id,current_stage:n.stage+1,member:e.member,status:e.status})}return t.stages.forEach(((n,o)=>{const a=o===t.current_stage,s=ot.current_stage,r=s?"done":i?null:{succeed:"done",cancelled:"close",failed:"error"}[t.status]||"more_horiz",l=s?"positive":i?"general":{succeed:"positive",cancelled:"negative",failed:"negative"}[t.status]||"positive",c=this.$t("task_panel.stage_status."+(s?"completed":i?"not_started":"in_progress"));if(Object.assign(n,{icon:r,color:l,status:c}),n.actions=n.actions||[],0===o&&n.actions.push({disable:!a,label:this.$t("task_github_subscribe_repo.task_action.go_to_connect"),handler:()=>{this.$router.push({name:"AccountSettings"})}}),1!==o||s||n.actions.push({disable:!a,label:this.$t("task_github_subscribe_repo.task_action.go_to_subscribe"),handler:()=>{const e="https://github.com/tanshuai/alphabiz";window.open(e,"_blank")}}),[2,3].includes(o)&&t.current_stage>1){const t=JSON.parse(e.metadata);n.subtitle=this.$t("task_github_subscribe_repo.subscribed_at",{time:this.$d(new Date(t.subscribed_at),"YMD"),days:Math.max(0,Math.floor((new Date-new Date(t.subscribed_at))/864e5*10)/10)})}if([1,2,3].includes(o)){var d;const t=JSON.parse(null!==(d=null===e||void 0===e?void 0:e.metadata)&&void 0!==d?d:"{}"),s=a&&(2===o?new Date-new Date(t.subscribed_at)>2592e6:3!==o||new Date-new Date(t.subscribed_at)>7776e6),i={disable:!s,label:this.$t("task_github_subscribe_repo.task_action.get_bonus"),handler:async()=>{try{const t=await this.$account.core.updateGithubTask(e.member);await this.updateTaskList(),console.log(t,e)}catch(t){this.$q.notify({type:"negative",position:"bottom-right",message:t.message})}}};n.actions.push(i)}})),t};var um={name:"index",i18n:Wp,components:{TaskItem:cm},data(){return{loadingState:null,taskList:null}},computed:{taskItems(){const e=[];return this.taskList.forEach((t=>{s[t.category]&&"cancelled"!==t.status&&e.push(s[t.category].call(this,t))})),e.some((e=>"SubscribeGithubRepo"===e.category))||e.push(dm.call(this)),e}},mounted(){this.reloadTaskList()},methods:{async reloadTaskList(){const e=async()=>{try{const e=await this.$account.core.queryTaskList();this.taskList=e}catch(e){throw e}};try{this.loadingState="loading",await e()}finally{this.loadingState=null}},async updateTaskList(){try{const e=await this.$account.core.queryTaskList();this.taskList=e}catch(e){this.$q.notify({type:"negative",position:"bottom-right",message:e.message})}}}},hm=um,pm=Object(g["a"])(hm,Fp,Mp,!1,null,null,null),mm=pm.exports;k()(pm,"components",{QPage:Rs["a"],QBtn:le["a"],QSpinnerIos:nt["a"],QIcon:Y["a"],QList:_t["a"]});var _m={name:"TaskPage",i18n:Wp,components:{Layout:Up,TaskCard:mm}},fm=_m,gm=Object(g["a"])(fm,Op,qp,!1,null,null,null),bm=gm.exports;function ym(e){const t={persistent:!0,transitionShow:"slide-up",transitionHide:"slide-down"};let n;const o=u["a"].create({component:{render(a){return a(y["a"],{ref:"dialog",props:t,on:{hide:()=>this.$emit("hide")}},[a(Object.assign({},e,{mixins:[...e.mixins||[],{beforeCreate(){n=this},methods:{closePopup(){o.hide()}}}]}))])},methods:{show(){this.$refs.dialog.show()},hide(){this.$refs.dialog.hide()}}}});return new Proxy({},{get(e,t){return o[t]?Reflect.get(o,t):Reflect.get(n,t)},set(e,t,a){return o[t]?Reflect.set(o,t,a):Reflect.set(n,t,a)}})}k()(gm,"components",{QToolbar:Ls["a"],QToolbarTitle:js["a"],QBtn:le["a"]}),k()(gm,"directives",{ClosePopup:Yl["a"]});const vm=function(e){return{beforeCreate(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)},created(){this.$account.view[e]=this},beforeDestroy(){const t=this.$account.view[e];t instanceof Function||(this.$account.view[e]=null)}}};let wm=null;var km={TaskPage(){wm=wm||vm(bm.name),bm.mixins=Array.from(new Set((bm.mixins||[]).concat(wm)));ym(bm)}},Cm={onCreateCore(e,t,n){return{...Pp}},onConfigure(e,t,n){},onCreateStoreMixin(e,t,n){return{}},onRegisterView(e,t,n){return e.component("TaskCard",mm),{...km}}};const $m=Gc.PluginInstaller("$account");Object.assign($m.context,{$test:Yc});var Sm=$m.exportAsVuePlugin();const xm={Auth:eh,ReCaptcha:nh,MFA:Fh,Invitation:Mh,OAuth:xp,Task:Cm};var Tm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex justify-center items-center"},[n("q-btn",{attrs:{round:"","no-caps":"",size:"0.75rem",flat:"",color:"negative","text-color":"negative",icon:"close"},on:{click:function(){return e.$account.view.SignInPage=null}}}),e.$store.getters.settings.disableDevTools?e._e():n("q-btn",{directives:[{name:"show",rawName:"v-show",value:!e.showDevDialog,expression:"!showDevDialog"}],attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"developer_mode"},on:{click:function(t){e.showDevDialog=!e.showDevDialog}}},[n("q-tooltip",[e._v(e._s(e.$t("development")))]),n("q-dialog",{attrs:{"transition-show":"slide-up","transition-hide":"slide-down"},model:{value:e.showDevDialog,callback:function(t){e.showDevDialog=t},expression:"showDevDialog"}},[n("div",{staticClass:"development-dialog"},[n("div",{staticClass:"flex items-center",staticStyle:{padding:"4px 12px"}},[n("div",{staticClass:"text-h6 text-bold"},[e._v("Development Panel")]),n("q-space"),n("q-btn",{attrs:{"fab-mini":"",flat:"",icon:"close"},on:{click:function(t){e.showDevDialog=!1}}})],1),n("q-separator"),n("div",{staticClass:"scroll-y"},[n("Development")],1)],1)])],1),n("q-btn",{attrs:{unelevated:"","no-caps":"",size:"0.75rem",round:"",icon:"language"}},[n("q-tooltip",[e._v(e._s(e.language))]),n("q-menu",{attrs:{"transition-show":"jump-up","transition-hide":"jump-down"}},[n("q-list",e._l(e.languageOptions,(function(t){return n("q-item",{directives:[{name:"ripple",rawName:"v-ripple"},{name:"close-popup",rawName:"v-close-popup"}],key:t.value,attrs:{clickable:"",tag:"label"},on:{click:function(){return e.language=t.value}}},[n("q-item-section",{staticStyle:{width:"120px"}},[n("q-item-label",[e._v(e._s(t.label))])],1)],1)})),1)],1)],1),n("q-btn",{attrs:{flat:"","no-caps":"",size:"0.75rem",round:"",icon:"info"},on:{click:e.showAboutDialog}},[n("q-tooltip",[e._v(e._s(e.$t("feedback")+"/"+e.$t("diagnotic")))])],1)],1)},Im=[];const Pm={components:{Development:zl["default"]},data(){return{showDevDialog:!1}}},Om={data(){return{languageOptions:Wl["a"]}},computed:{language:{get(){const e=S["a"].getters.settings.language,t=this.languageOptions.find((t=>t.value===e));return t?t.label:e},set(e){const t=e.value||e;if("string"===typeof t&&(S["a"].dispatch("updateSettings",{language:t}),this.$i18n.locale=t,Object(xn["isElectron"])())){const{ipcRenderer:e}=n("b052");e.send("change-app-i18n",t),e.send("set_settings",{language:t})}}}}};var qm={name:"Corner",mixins:[Om,Pm],methods:{showAboutDialog(){xn["Bus"].$emit("CALL_ABOUT")}}},Em=qm,Am=(n("8460"),Object(g["a"])(Em,Tm,Im,!1,null,null,null)),Dm=Am.exports;k()(Am,"components",{QBtn:le["a"],QTooltip:Ct["a"],QDialog:y["a"],QSpace:re["a"],QSeparator:ce["a"],QMenu:Gl["a"],QList:_t["a"],QItem:Pe["a"],QItemSection:Oe["a"],QItemLabel:qe["a"],QColor:X["a"]}),k()(Am,"directives",{Ripple:Kl["a"],ClosePopup:Yl["a"]});var Nm=n("67b6"),Lm=n("76ec"),jm=n("9a08"),Rm=async({Vue:e,app:t,router:n})=>{Um(e,[...ir]),e.use(ic,{app:t}),e.use(Sm,{app:t,app_config:{protocol:B.a.protocol,web_url:B.a.webEditionUrl},awsconfig:lc,extensions:xm,gql:{queries:cc,mutations:dc,subscriptions:uc}}),e.use(rr["a"],{app:t}),e.use(lr["b"],{app:t,router:n});const o=e.prototype.$account;o.$on("createSignInPage",(e=>{e.corner=Dm})),o.$on("signUp.showLicenseTerms",(()=>{return e.call(o.view.SignInPage);function e(){Nm["a"].call(this,{title:this.$t("account_license_terms"),markdown:{license:{label:"License",markdown:Lm["a"]},terms:{label:"Terms",markdown:jm["a"]}}})}}))};function Um(e,t){var n;const o=null===(n=e.config)||void 0===n?void 0:n.errorHandler;e.config.errorHandler=function(){const e=t.filter((e=>e.match(...arguments)));if(e.length>0)e.forEach((e=>e.execute(...arguments)));else{if(!o)throw arguments[0];o.apply(this,arguments)}}}var Fm=n("15eb");const Mm="/";async function Bm(){const{app:e,store:t,router:n}=await T();let o=!1;const a=e=>{o=!0;const t=Object(e)===e?n.resolve(e).route.fullPath:e;window.location.href=t},s=window.location.href.replace(window.location.origin,""),r=[me,er,or["a"],Rm,Fm["a"]];for(let c=0;!1===o&&c{const t="magnet:?xt=urn:btih:"+e.hash+"&dn="+(encodeURIComponent(e.name)||e.origin||e.hash).replace(`${o["protocol"]}:///`,"");let n="";if(e.trackers&&(n+=e.trackers.filter((e=>e.length)).map((e=>`&tr=${encodeURIComponent(e)}`)).join("")),e.data)for(const o in e.data){var a;null!==(a=e.data[o])&&void 0!==a&&a.length&&(n+=e.data[o].map((e=>`&${o}=${encodeURIComponent(e)}`)).join(""))}return t+n},r=e=>{var t;const n=new URL(e);if("magnet:"!==n.protocol)throw new Error("Input is not a magnet uri");const o=n.searchParams.get("xt"),a=null===(t=o.match(/[^:]+$/))||void 0===t?void 0:t[0];if(!a)throw new Error("Cannot parse magnet infoHash");const i=n.searchParams.get("dn")||"",r=n.searchParams.getAll("tr").map((e=>{const t=s.a.getIdByTracker(e);return-1!==t?t:e})),l={};return n.searchParams.forEach(((e,t)=>{["xt","dn","tr"].includes(t)||(l[t]||(l[t]=[]),l[t].push(e))})),{protocolType:"01",hash:a,name:i,trackers:r,data:l}};t["a"]={fromObject:i,toObject:r}},ecef:function(e,t,n){"use strict";n.r(t);var o=n("e3c7"),a=n("8a63");o["ioServer"].on("some_api",(()=>{})),o["ipcRenderer"].on("some-api",(()=>{})),o["ioServer"].on("request-provident-payment",(e=>{o["ioServer"].emit("request-provident-payment",e)})),o["ioServer"].on("credit_payment_created",(e=>{o["ioServer"].emit("payment-info",e)})),o["ioServer"].on("restart_payment",(e=>{o["ioServer"].emit("restart-payment",e)})),o["ioServer"].on("payment_verified",(e=>{o["ioServer"].emit("payment-verified",e)})),o["ioServer"].on("webtorrent-request-renew",(e=>{o["ioServer"].emit("request_renew",e)})),o["ioServer"].on("webtorrent-payment-finished",(e=>{o["ioServer"].emit("payment_finished",e)})),o["ioServer"].on("webtorrent-finish-all-payments",(e=>{if(null===e||void 0===e||!e.connections)return console.log("skip unknown tr",e,null===e||void 0===e?void 0:e.connections);const t=e.connections;t.forEach((e=>{e.transactions&&e.transactions.forEach((e=>{console.log("Finish pending",e),o["ioServer"].emit("payment_finished",{id:e})}))}))})),o["ioServer"].on("webtorrent-set-throttle",(e=>{0!==e.code&&o["ioServer"].emit("client_error",e.message)})),o["ioServer"].on("webtorrent-verify-payment",(e=>{o["ioServer"].emit("verify_payment",e)})),o["ioServer"].on("webtorrent-payment-completed",(e=>{o["ioServer"].emit("payment_completed",e)})),o["ioServer"].on("complete_payment",(e=>{o["ioServer"].emit("complete-payment",e)})),o["ioServer"].on("finish_payment",(e=>{o["ioServer"].emit("finish-payment",e)})),o["ioServer"].on("payment_closed",(e=>{o["ioServer"].emit("close-payment",e)})),o["ioServer"].on("set-throttle-group",(e=>{o["ioServer"].emit("set-throttle-group",{...e,peerId:null===e||void 0===e?void 0:e.id})})),o["ioServer"].on("download-and-play",(e=>{console.log("should download and play",e),Object(a["b"])("download",e.url)}))},edfe:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return C})),n.d(t,"a",(function(){return x}));n("de6c"),n("d4b5"),n("7a76");const{EventEmitter:o}=n("bf30"),a=n("3fd2"),{ipcRenderer:s}=a.renderer()?n("b052"):n("e3c7"),i=n("8b5b"),r=1e7,l=1,c=new Map,d=new Map,u=new Map,h=new Map,p=new Map,m=new Map,_=new Map,f=new Map,g=(e,t)=>{_.has(e)||_.set(e,0),f.has(e)||f.set(e,0);const n=_.get(e)+t;_.set(e,n);const o=Math.floor(n/1e8),a=o-f.get(e);a>0&&(console.log("Request provident payment for",e,"count:",a),s.send("request-provident-payment",{infoHash:e,count:10*a}),f.set(e,o))},b=[],y=new Map,v="undefined"!==typeof localStorage?localStorage.getItem("userInfo"):null,w=v?JSON.parse(v):{user:"",sub:""};console.log("Init user",w);let k=null;const C=e=>{k=e,k.userInfo=w,k.on("request-renew",(e=>s.send("webtorrent-request-renew",e))),k.on("verify-payment",(e=>s.send("webtorrent-verify-payment",e)))};s.on("set-user",((e,t)=>{t||(t=e),console.log("set user",t),w.user=t.user,w.sub=t.sub,"undefined"!==typeof localStorage&&localStorage.setItem("userInfo",JSON.stringify(w)),k.torrents.forEach((e=>{e.wires.forEach((e=>{e._is_alphabiz_peer_&&e.alphabiz_protocol&&e.alphabiz_protocol._sendUserInfo()}))}))}));const $=(e,t)=>{t||(t=e),console.log("Payment info",t);const n=k.get(t.infoHash);if(t.payedSize=t.payed*r/l,u.set(t.id,t),!n||!n.wires.length){if(b.some((e=>e.id===t.id)))return;return b.push(t)}for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.remoteSubId){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._send({ab_payment:JSON.stringify({infoHash:t.infoHash,peerId:t.peerId,subId:w.sub,payed:t.payed,autoRenew:!0,id:t.id})})}};s.on("payment-info",$),s.on("restart-payment",$),s.on("payment-verified",((e,t)=>{t||(t=e);const n=k.get(t.infoHash);if(!n||!n.wires.length)return console.log("tr not found");for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.subId){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._onPaymentVerified({infoHash:t.infoHash,peerId:t.peerId,subId:w.sub,payed:t.payed,autoRenew:!0,id:t.id})}})),s.on("finish-payment",((e,t)=>{const n=k.get(t.infoHash);if(!n||!n.wires.length)return console.log("finish: tr not found");for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.remoteSub){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._send({ab_payment_finish:t.transactionId}),o.transactions&&o.transactions.includes(t.transactionId)&&o.transactions.splice(o.transactions.indexOf(t.transactionId),1)}})),s.on("close-payment",((e,t)=>{t||(t=e);const n=k.get(t.infoHash);if(!n||!n.wires.length)return console.log("close: tr not found");for(const o of n.wires)if(o.remoteSub&&o.remoteSub===t.remoteSub){if(!o.alphabiz_protocol)continue;o.alphabiz_protocol._send({ab_payment_close:JSON.stringify({infoHash:t.infoHash,id:t.id})})}}));const S=e=>{if(console.log("To remove",e),!e||!e.infoHash)return;const t=e.infoHash,n=y.get(t);for(let o=0;o{const a="alphabiz_protocol";class _ extends o{constructor(e){super(),this._wire=e,this._peerId=null,this._infoHash=n.infoHash,this.isSeeding=n.isSeeding,this.download=n.download,this._user=w.user||"",this._subId=w.sub||"",this.remoteSub="",this.uniqueId="",this._wire._setThrottleGroup=e=>this._setThrottleGroup(e),this.maxUploadSpeed=1e6,this._wire.maxUploadSpeed=1e6,this._initUpload(),this._initDownload()}onHandshake(e,t){this._infoHash=e,this._peerId=t,this._sendUserInfo()}_sendUserInfo(){this._user=w.user||"",this._subId=w.sub||"",this._send({ab_peer:"_ab_"+this._peerId,ab_user:this._user,ab_sub:this._subId,ab_has_meta:n.metadata?1:0}),n.metadata||n.once("metadata",(()=>{this._send({ab_has_meta:1})}))}onExtendedHandshake(e){e.m&&e.m[a]||console.error("Client does not support",a)}_sendByteMap(){n.byteMap&&this._send({ab_byte_map:JSON.stringify(n.byteMap)})}_initDownload(){const t=this._wire,n=n=>{if(Math.random()>.99&&e.memoryUsage().rss/1e9>3&&e.exit(1),this.isSeeding)return;if(!this.remoteSub||!this.uniqueId)return void g(this._infoHash,n);p.get(this.uniqueId)||p.set(this.uniqueId,t.downloaded||0);const o=p.get(this.uniqueId);p.set(this.uniqueId,o+n)};t.on("download",n)}_initUpload(){const e=this._wire,t=t=>{if(!this.remoteSub||!this.uniqueId)return;if(this.remoteSub===this._subId)return;const n=c.get(this.uniqueId)-t;if(isNaN(n))return;const o=y.get(this._infoHash);if(o&&o.length&&(o[0].payedSize-=t,o[0].payedSize<0)){const e=o.shift();s.send("webtorrent-payment-completed",{transactionId:e.id,infoHash:this._infoHash,remoteSub:this.remoteSub})}const a=e.uploadSpeed?e.uploadSpeed():1e6;a>this.maxUploadSpeed&&(this.maxUploadSpeed=1e6*Math.ceil(a/1e6),this._wire.maxUploadSpeed=this.maxUploadSpeed);const i=m.get(this.uniqueId)||[],r=i.reduce(((e,t)=>e+(t.maxUploadSpeed||1e6)),0)||this.maxUploadSpeed;if(d.get(this.uniqueId)&&n<5*r){d.set(this.uniqueId,!1);const e=Math.ceil(r/1e6);console.log("[[wt-ext]] _send ab_renew left < 5*speed",e),this.renew(e<10?10:e)}if(n<=0){if(this._setThrottleGroup("mid"),c.set(this.uniqueId,0),d.get(this.uniqueId)||!d.has(this.uniqueId)){const e=Math.ceil(r/1e6);d.set(this.uniqueId,!1),console.log("[[wt-ext]] _send ab_renew from left<=0",e),this.renew(e<10?10:e)}}else this._setThrottleGroup("high"),c.set(this.uniqueId,n)};e.on("upload",t);const o=()=>{this._wire.transactions&&(s.send("webtorrent-task-done",{infoHash:n.infoHash,name:n.name,payments:this._wire.transactions}),this._send({ab_task_done:this._wire.transactions.join("$")}))},a=()=>this._sendByteMap();e.on("close",(()=>{n.off("done",o),n.off("byte-map-change",a);const t=m.get(this.uniqueId);t&&t.includes(e)&&(console.log("remove same wire"),t.splice(t.indexOf(e),1))})),n.on("done",o),n.on("byte-map-change",a)}_onAbPeer(e,t,o){if(!e.startsWith("_ab_"))return;if(this._remotePeerId=e.substring(4),this._wire._is_alphabiz_peer_=!0,this._wire.ab_peer=e,this._wire.remoteUser=t,this._wire.remoteSub=o,this._wire.transactions=[],this.remoteSub=o,this.uniqueId=o+"#"+this._infoHash,m.has(this.uniqueId)){const e=m.get(this.uniqueId);e.includes(this._wire)||e.push(this._wire)}else m.set(this.uniqueId,[this._wire]);if(h.has(this.uniqueId)||h.set(this.uniqueId,0),h.get(this.uniqueId)>this._wire.downloaded&&h.set(this.uniqueId,this._wire.downloaded),n._has_alphabiz_user_=!0,n.emit("ab_peer",e),this._subId===this.remoteSub)return console.log("[wt-ab-peer] Connected to self"),this._sendByteMap(),void this._setThrottleGroup("high");if(o&&c.get(this.uniqueId)>0?this._onPaymentVerified({infoHash:n.infoHash,subId:o,autoRenew:!0,payed:0},!0):(this._setThrottleGroup("mid"),this.isSeeding&&!c.get(this.uniqueId)&&(this._sendByteMap(),setTimeout((()=>{this.renew()}),1e3))),b.length)for(let n=0;n{this._wire&&!this._wire.destroyed||clearInterval(a),this.isSeeding||"mid"!==this._wire.remoteGroup||this.isSeeding||this._onRenew(this.remoteSub,10)}),5e3)}renew(e=10){this._subId!==this.remoteSub?this._subId?this._send({ab_renew:this._subId,ab_count:e}):console.warn("Cannot get subId"):console.log("[wt-renew] Remote account is same as local")}_setThrottleGroup(e){const n=this._wire._uploadThrottle;if(n&&n._group){if(!t.throttleGroups[e])throw new Error("level_not_found");n._group!==t.throttleGroups[e]&&(console.log("[[wt-ext]] _setThrottleGroup",e),d.set(this.uniqueId,!0),"mid"===e&&n._group===t.throttleGroups.high&&(console.log("Peer dropped back to mid. Send renew request",this._subId,this._infoHash),this.renew(),setTimeout((()=>{n._group!==t.throttleGroups.high&&(console.log("Peer is still in mid. Send renew request",this._subId,this._infoHash),this.renew())}),5e3)),n._group._removeThrottle(n),t.throttleGroups[e]._addThrottle(n),n._group=t.throttleGroups[e],console.log("[[wt-ext]] _send ab_speed_group: ",e),this._send({ab_speed_group:e}))}}_onSpeedGroup(e){console.log("[[wt-ext]] _onSpeedGroup",e),this._wire.remoteGroup=e}_onPaymentReceived(e){t.emit("verify-payment",e)}_onPaymentVerified({infoHash:e,payed:t,id:o}){const a=this.remoteSub;if(console.log("payment verified"),!a||!this.uniqueId)return;if(this._setThrottleGroup("high"),d.set(this.uniqueId,!0),!o||u.has(o))return;const s=t*r/l;if(u.set(o,{infoHash:e,payed:t,autoRenew:!0,id:o,payedSize:s}),e!==n.infoHash)return;if(isNaN(s))return;c.has(this.uniqueId)||c.set(this.uniqueId,0);const i=c.get(this.uniqueId);c.set(this.uniqueId,i+s),y.has(e)||y.set(e,[]);const h=y.get(e);h.push({infoHash:e,subId:a,payedSize:s,id:o,startPosition:this._wire.recieved}),this._send({ab_payment_accepted:o})}_onPaymentAccepted(e){this._wire.transactions.push(e)}_onPaymentCompleted(e){console.log("Completed",e,this.remoteSub),s.send("webtorrent-payment-completed",{transactionId:e,remoteSub:this.remoteSub,infoHash:this._infoHash}),this._wire.transactions.includes(e)&&this._wire.transactions.splice(this._wire.transactions.indexOf(e),1)}_onTaskDone(e){const t=e.split("$").filter((e=>e.length));if(console.log("Remote task done"),t.length)for(const n of t)this._onPaymentCompleted(n);c.delete(this.remoteSub,this._infoHash)}_onPaymentFinished(e){console.log("Finished",e);const t=u.get(e);if(t){const o=p.get(this.uniqueId)||0;h.has(this.uniqueId)||h.set(this.uniqueId,0);const a=h.get(this.uniqueId),i=o-a;i>.9*t.payedSize||n.done||n.downloaded>=.9*n.length?(s.send("webtorrent-payment-finished",{id:e,remoteSub:this.remoteSub,infoHash:this._infoHash}),h.set(this.uniqueId,a+(i>t.payedSize?t.payedSize:i)),console.log(`Payment ${e} is finished. Payed for ${t.payedSize}. Received ${i}. Done: ${n.done}`),console.log("Update prev-download",a,h.get(this.uniqueId))):(console.log(`Payment ${e} is marked as not-finished. Payed for ${t.payedSize}. Received ${i}`),console.log(`Prev: ${a}. Downloaded: ${o}`))}else s.send("webtorrent-payment-finished",{id:e,remoteSub:this.remoteSub,infoHash:this._infoHash})}_onPaymentClosed(e){console.log("Close",e),S(e)}_onRenew(e,n=10){const o=n&&parseInt(n)?parseInt(n):10;console.log("[[wt-ext]] _onRenew",e,this._remotePeerId,o),t.emit("request-renew",{infoHash:this._infoHash,peerId:this._remotePeerId,payCount:o,subId:e})}onMessage(e){let t;try{t=i.decode(e)}catch(o){return void console.error("cannot decode buf",e)}if(t.ab_has_meta&&(this._wire.remote_has_meta=!0),t.ab_byte_map&&(this._wire.remote_byte_map=JSON.parse(t.ab_byte_map.toString())),t.ab_peer)return this._onAbPeer(t.ab_peer.toString(),t.ab_user&&t.ab_user.toString(),t.ab_sub&&t.ab_sub.toString());if(t.ab_speed_group)return this._onSpeedGroup(t.ab_speed_group.toString());if(t.ab_payment){const e=JSON.parse(t.ab_payment.toString());return console.log("Protocol payment",e),this._onPaymentReceived(e)}return t.ab_payment_completed?this._onPaymentCompleted(t.ab_payment_completed.toString()):t.ab_payment_accepted?this._onPaymentAccepted(t.ab_payment_accepted.toString()):t.ab_payment_finish?this._onPaymentFinished(t.ab_payment_finish.toString()):t.ab_payment_close?this._onPaymentClosed(JSON.parse(t.ab_payment_close.toString())):t.ab_task_done?this._onTaskDone(t.ab_task_done.toString()):t.ab_renew?this._onRenew(t.ab_renew.toString(),null===(n=t.ab_count)||void 0===n?void 0:n.toString()):void 0;var n}_send(e){const t=Object.entries(this._wire.extendedMapping).find((e=>e[1]===a)),n=t&&t[0];n>=0&&this._wire.extended(Number(n),i.encode(e))}onClose(){console.log("onClose",this._wire);this._wire.recieved}}return _.prototype.name=a,_}}).call(this,n("28d0"))},ee3d:function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="ee3d"},eec3:function(e,t,n){},f039:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n("0598");async function a(e,t,a){var s,i;if(console.log("drop",e,e.path,(null===e||void 0===e||null===(s=e.path)||void 0===s?void 0:s[0])===document.body),e&&e.path&&(null===e||void 0===e||null===(i=e.path)||void 0===i?void 0:i[0])===document.body)return void console.log("Drop to body");const r=a&&!t.length;if(r&&!a.match(/^(magnet)|(alphabiz):/))return;const l=!r&&t.length>1,c=!r&&!l&&Object(o["default"])()&&n("61af").existsSync(t[0].path)?n("61af").statSync(t[0].path).isDirectory():!n("a3fc").extname(t[0].path),d=r?"link":l?"file_copy":c?"folder":"insert_drive_file",u=document.createElement("i");u.classList="q-icon material-icons",u.appendChild(document.createTextNode(d)),u.style=`position: fixed; font-size: 36px; transition-duration: 0.5s; opacity: 1;left: ${e.clientX-18}px; top: ${e.clientY-18}px`;const h=document.body.appendChild(u);return new Promise((e=>{setTimeout((()=>{h.style.transform="translateY(24px)"}),50),setTimeout((()=>{h.style.transform+=" scale(4)",h.style.opacity=0,e()}),200),setTimeout((()=>{document.body.removeChild(h)}),1e3)}))}},f157:function(e,t,n){"use strict";n("848e")},f77d:function(e,t,n){"use strict";n("7686")},f817:function(e,t,n){"use strict";n("9f42")},fb31:function(e,t,n){(function(t){const{isElectron:o}=n("d310");if(o())if(this.require)try{const n=this["require"]("developer/app");console.log("Init from node_modules",t),n.appName=n.name,e.exports={default:n,appName:n.name,...n}}catch(a){console.log(">> Cannot require /developer/app from build. Use dev");const t=this["require"]("../../developer/app");t.appName=t.name,console.log("APP name:",t.appName),e.exports={default:t,appName:t.name,...t}}else{const t=o()?require("developer/app"):n("b3f7");t.appName=t.name,console.log("APP name:",t.appName,"production",!0),e.exports={default:t,appName:t.name,...t}}else{const t=n("b3f7");e.exports={appName:t.name,...t}}}).call(this,n("28d0"))},fc65:function(e,t,n){"use strict";n("ac84")},fe8f:function(e,t,n){},feef:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("q-dialog",{model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("q-card",{staticStyle:{width:"400px","max-width":"80vw","overflow-x":"hidden"}},[n("q-card-section",["download"===e.mode?n("q-tabs",{staticClass:"text-primary",attrs:{"no-caps":""},model:{value:e.tab,callback:function(t){e.tab=t},expression:"tab"}},[n("q-tab",{attrs:{name:"url",label:this.$t("link_task")}}),n("q-tab",{attrs:{name:"file",label:this.$t("torrent_task")}})],1):n("div",{staticClass:"upload-title text-primary text-center q-mt-sm q-mb-md text-subtitle2"},[e._v("\n "+e._s(e.$t("upload"))+"\n ")])],1),n("q-card-section",{staticClass:"q-pt-none"},["url"===e.tab&&"download"===e.mode?n("q-input",{staticClass:"url-input q-py-sm",attrs:{dense:"",type:"textarea","input-style":"white-space:nowrap"},nativeOn:{paste:function(e){e.stopPropagation()}},model:{value:e.input,callback:function(t){e.input=t},expression:"input"}}):e._e(),"file"===e.tab||"upload"===e.mode?n("q-input",{attrs:{readonly:"",type:"text",label:e.$t("file"),value:e.inputFile&&e.inputFile[0]&&e.inputFile[0].name||""}}):e._e(),n("div",{staticClass:"file-selectors"},["file"===e.tab||"upload"===e.mode?n("FileSelector",{attrs:{accept:"download"===e.mode?{extensions:["torrent"]}:null},on:{select:e.onFileSelected}},[n("q-btn",{attrs:{size:"md",unelevated:"","no-caps":"",icon:"note_add",label:e.$t("select_file")}})],1):e._e(),"upload"===e.mode&&e.isElectron?n("FileSelector",{attrs:{directory:""},on:{select:e.onFolderSelected}},[n("q-btn",{attrs:{size:"md",unelevated:"","no-caps":"",icon:"create_new_folder",label:e.$t("select_folder")}})],1):e._e()],1),e.isElectron?n("div",{staticClass:"configuration-variable q-pt-sm"},[n("q-input",{directives:[{name:"show",rawName:"v-show",value:"download"===e.mode&&e.isElectron,expression:"mode === 'download' && isElectron"}],staticStyle:{width:"100%"},attrs:{label:this.$t("download_directory_position")},on:{click:e.selectSavePath},model:{value:e.settings.downloadDirectory,callback:function(t){e.$set(e.settings,"downloadDirectory",t)},expression:"settings.downloadDirectory"}})],1):e._e()],1),n("q-card-actions",{staticClass:"text-primary",attrs:{align:"right"}},[n("q-btn",{directives:[{name:"close-popup",rawName:"v-close-popup"}],attrs:{flat:"",label:this.$t("cancel")}}),n("q-btn",{attrs:{flat:"",label:"download"===e.mode?this.$t("download"):this.$t("upload")},on:{click:e.submit}})],1)],1)],1)},a=[],s=n("aecb"),i=s["a"],r=(n("b389"),n("2b5f")),l=n("b2aa"),c=n("e586"),d=n("d7c7"),u=n("74cb"),h=n("ec78"),p=n("0e45"),m=n("3927"),_=n("1043"),f=n("59ba"),g=n("a431"),b=n("09a4"),y=n.n(b),v=Object(r["a"])(i,o,a,!1,null,"a418da6e",null);t["a"]=v.exports;y()(v,"components",{QDialog:l["a"],QCard:c["a"],QCardSection:d["a"],QTabs:u["a"],QTab:h["a"],QInput:p["a"],QFile:m["a"],QBtn:_["a"],QCardActions:f["a"]}),y()(v,"directives",{ClosePopup:g["a"]})}}); \ No newline at end of file diff --git a/dist/spa/version.json b/dist/spa/version.json index 4675ce24..8ce77d91 100644 --- a/dist/spa/version.json +++ b/dist/spa/version.json @@ -1,8 +1,8 @@ { "packageVer": "0.2.4", "channel": "web", - "buildTime": "202308081821", - "buildCommit": "c8725f94", - "sourceCommit": "c8725f94", + "buildTime": "202308081829", + "buildCommit": "4d89bb06", + "sourceCommit": "4d89bb06", "version": "0.2.5-web" } \ No newline at end of file