UNPKG

tweeter-client

Version:
6 lines 57.3 kB
#!/usr/bin/env node /*! *** Tweeter Client 4.24.0 *** Copyright © 2020, Jaid <jaid.jsx@gmail.com> (https://github.com/Jaid) *** @license MIT !*/!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=97)}([function(t,e){t.exports=require("@hapi/joi")},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return F}));var r=n(80),o=n.n(r),i=n(81),s=n.n(i),a=n(0),u=n.n(a),c=n(82),f=n.n(c),l=n(17),p=n.n(l),h=n(83),d=n.n(h),y=n(7),g=n.n(y),b=n(84),v=n.n(b),w=n(33),x=n(34),m=n(35),_=n(6),j=n(14);class F extends _.a{constructor(...t){super(...t),this.twit=null}async start(){this.options.text&&(this.template=x.a.compile(this.options.text,{noEscape:!0})),this.twit=new v.a({...j.default.credentials.appCredentials,...s()(this.user,["access_token","access_token_secret"])});const t={};if(this.options.track&&(t.track=this.options.track),this.options.language&&(t.language=this.options.language),this.stream=this.twit.stream("statuses/filter",t),this.stream.on("tweet",this.onTweet.bind(this)),this.options.testTweet){const t=await this.getTweetById(this.options.testTweet);this.logger.info(`Testing tweet: twitter.com/${t.user.screen_name}/status/${t.id_str}`),await this.onTweet(t)}}async pauseStream(t){this.stream.stop(),await f()(t),this.stream.start()}async onTweet(t){if(!(t.retweeted_status||this.user.id===t.user.id_str||this.options.ignoreSiblings&&j.default.getUserById(t.user.id_str))){if(Object(w.a)(t),this.logger.debug(`@${t.user.screen_name}: ${t.flattenedText}`),!this.options.includeReplies&&t.in_reply_to_status_id)return void this.logger.debug("This is a reply, skipping");if(this.options.filter){const e=p()(this.options.filter);for(const n of e){const e=d()(n,"ensureRegex");if(e.discardRegex&&g()(e.discardRegex).test(t.flattenedText))return void this.logger.debug(`Positive test for ${e.discardRegex}, skipping`);if(e.ensureRegex&&!g()(e.ensureRegex).test(t.flattenedText))return void this.logger.debug(`Negative test for ${e.discardRegex}, skipping`)}}if(this.shouldHandleTweet){let e;try{e=await this.shouldHandleTweet(t)}catch(t){return void console.error(t)}if(!e)return void this.logger.debug("Skipped by shouldHandleTweet")}if(await this.handleTweet(t),this.options.timeBetweenActions){const t=Object(m.a)(this.options.timeBetweenActions);this.pauseStream(t)}}}async handleTweet(t){if(this.options.reaction){const e={tweet:t};if("tweet"===this.options.reaction&&this.template){const t=this.template(e);await this.post(t)}if("retweet"===this.options.reaction)if(this.template){const n=this.template(e);await this.retweet(t,n)}else await this.retweet(t);if("like"===this.options.reaction&&await this.like(t),"likeDelayed"===this.options.reaction&&this.likeDelayed(t),"reply"===this.options.reaction){const n=this.template(e);await this.reply(t,n)}}}async like(t){return this.dry?void this.logger.info(`Like ${t.shortLink}`):void await this.twit.post("favorites/create",{id:t.id_str})}likeDelayed(t){const e=this;setTimeout(()=>{e.like(t)},o()(5e3,12e4))}async reply(t,e){return this.dry?void this.logger.info(`Reply to ${t.shortLink}: ${e}`):void await this.twit.post("statuses/update",{in_reply_to_status_id:t.id_str,status:this.options.text})}async retweet(t,e){if(this.dry)this.logger.info(`Retweet ${t.shortLink}`);else{if(e)return await this.post(`${e}\n${t.link}`);await this.twit.post(`statuses/retweet/${t.id_str}`)}}}F.baseSchema={includeReplies:u.a.boolean().default(!0),ignoreSiblings:u.a.boolean().default(!0),language:u.a.any(),filter:u.a.any(),testTweet:u.a.string(),track:u.a.any(),timeBetweenActions:[u.a.string(),u.a.number()]},F.schema={...F.baseSchema,text:u.a.string(),reaction:u.a.any()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(28),o=n.n(r),i=n(74),s=n.n(i);const a=new o.a({name:"Tweeter Client",version:"4.24.0",gotLogLevel:"info",useGot:!0,configSetup:{defaults:s(),secretKeys:["apiKey"]}}),u=(a.logger,a.config);e.b=a},function(t,e){t.exports=require("has-content")},function(t,e,n){var r=n(56),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){t.exports=require("jimp")},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(29),o=n.n(r),i=n(17),s=n.n(i),a=n(30),u=n.n(a),c=n(53),f=n.n(c),l=n(10),p=n.n(l),h=n(75),d=n.n(h),y=n(2),g=n(14);let b=1;class v{constructor(t,e,n,r,o){this.handle=t,this.dry=e,this.logger=n,this.tweeterType=r,this.index=b,this.options=o,b++;for(const[t,e]of Object.entries(this.options))this.logger.debug(`${t}: ${JSON.stringify(e)}`)}static initStatic(){const t=g.default.core.got;v.apiGot=t.extend({method:"POST",prefixUrl:`${y.a.apiProtocol}://${y.a.apiHost}`,port:y.a.apiPort,hooks:{init:[t=>{t.json||(t.json={}),Object.assign(t.json,{apiUser:y.a.apiUser,apiKey:y.a.apiKey})}]}})}async post(t,e){try{if(this.logger.info("[Tweeter #%s] @%s: %s",this.index,this.handle,u()(t)),e&&this.logger.debug(`Media length: ${s()(e).map(t=>t.length).join(", ")}`),this.dry)return;const n=await v.apiGot.post("tweet",{json:{text:t,media:e,handle:this.handle}}).json();return this.logger.debug("Tweet result: [%s %s] %s",n.statusCode,n.statusMessage,n.body),n}catch(t){this.logger.error("[Tweeter #%s] Could not send tweet: %s",this.index,t)}}async postMedia(t){await this.post("",t)}async getTweetById(t){return(await this.twit.get("statuses/show",{id:t,include_entities:!0,trim_user:!1,include_ext_alt_text:!0})).data}getDataFolder(){return f.a.join(g.default.core.appFolder,"data",this.user.handle.toLowerCase(),this.tweeterType)}async initDatabase(t){const e=this.getDataFolder();await o.a.ensureDir(e);const n=f.a.join(e,"database.sqlite");this.database=new p.a({dialect:"sqlite",storage:n});for(const[e,n]of Object.entries(t)){const t=d()(n.schema);n.default.init(t,{modelName:e,sequelize:this.database,...n.modelOptions})}await this.database.sync()}}v.apiGot=null},function(t,e){t.exports=require("regex-parser")},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){t.exports=require("sequelize")},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r=n(115),o=n(118);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return c}));var r=n(0),o=n.n(r),i=n(10),s=n.n(i),a=n(35),u=n(1);class c extends u.default{async start(t){await super.start(),this.TargetAction=c.createTargetActionModel(),await this.initDatabase({TargetAction:this.TargetAction,...t})}async registerTargetActionFromId(t,e){await this.database.models.TargetAction.create({targetUserId:t,payload:e})}async registerTargetActionFromTweet(t,e){await this.database.models.TargetAction.create({targetUserId:t.user.id_str,targetUserHandle:t.user.screen_name,payload:e})}async shouldHandleTweet(t){if(this.options.userCooldown){const e=Object(a.a)(this.options.userCooldown);if(await this.database.models.TargetAction.findOne({where:{targetUserId:t.user.id_str,createdAt:{[i.Op.gt]:Date.now()-e}}}))return this.logger.debug(`Recently made a tweet for @${t.user.screen_name}, cooling down before making another`),!1}return!0}}c.createTargetActionModel=()=>{class t extends s.a.Model{}return{default:t,schema:{targetUserId:{type:s.a.STRING(64),allowNull:!1},targetUserHandle:s.a.STRING(64),payload:s.a.JSON},modelOptions:{updatedAt:!1}}},c.baseSchema={...u.default.baseSchema,userCooldown:o.a.string().default("1h")}},function(t,e,n){"use strict";n.r(e);var r=n(17),o=n.n(r),i=n(3),s=n(28),a=n(6),u=n(76),c=n.n(u);const f={},l=n(99);for(const t of l.keys()){const e=t.match(/[/\\](?<name>.+?)[/\\]index\.js$/).groups.name,n=c()(e);f[n]={id:n,Type:l(t).default}}var p=f;class h extends s.JaidCorePlugin{constructor(...t){super(...t),this.tweeters=[],this.credentials=null}setCoreReference(t){this.core=t}getUserByHandle(t){return this.credentials.users[t.toLowerCase()]}getUserById(t){return Object.values(this.credentials.users).find(e=>e.id===t)}async init(){a.a.initStatic(),this.credentials=await a.a.apiGot("credentials").json();const t=o()(this.core.config.tweeters);if(Object(i.isEmpty)(t))this.log("No tweeters configured!");else{for(const{type:e,handle:n,dry:r,...o}of t){const t=p[e];if(!t)return void this.logger.warn(`Unknown tweeter type ${e}`);const i=t.Type;let s=o;if(i.schema){const t=i.schema.validate(o);if(t.error)throw this.logger.warn(`Invalid configuration for tweeter type ${e}`),this.logger.warn(t.error.message),new Error(t.error.message);s=t.value}const a=new i(n,r,this.logger,t.id,s);if(!n)throw new Error(`Tweeter #${a.index} does not have a handle`);if(a.user=this.getUserByHandle(n),!a.user)throw new Error(`Did not receive info for handle ${n} from server`);this.tweeters.push(a),this.log("Registered tweeter #%s (%s) for @%s",a.index,e,n)}for(const t of this.tweeters){var e;await(null===(e=t.start)||void 0===e?void 0:e.call(t))}}}}e.default=new h},function(t,e,n){var r=n(18),o=n(102),i=n(103),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?o(t):i(t)}},function(t,e,n){var r=n(9),o=n(108),i=n(109),s=n(133);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(s(t))}},function(t,e){t.exports=require("ensure-array")},function(t,e,n){var r=n(4).Symbol;t.exports=r},function(t,e,n){var r=n(41),o=n(60);t.exports=function(t,e,n,i){var s=!n;n||(n={});for(var a=-1,u=e.length;++a<u;){var c=e[a],f=i?i(n[c],t[c],c,n,t):void 0;void 0===f&&(f=t[c]),s?o(n,c,f):r(n,c,f)}return n}},function(t,e,n){"use strict";var r=n(78),o=n.n(r),i=n(7),s=n.n(i),a=n(79),u=n.n(a);e.a=(t,e)=>{let n;return n=e?s()(`/^[\\da-z${o()(e)}]+$/i`):/^[\da-z]+$/i,n.test(u()(t))}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&e>t}},function(t,e,n){var r=n(15),o=n(11);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(12)(Object,"create");t.exports=r},function(t,e,n){var r=n(123),o=n(124),i=n(125),s=n(126),a=n(127);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=s,u.prototype.set=a,t.exports=u},function(t,e,n){var r=n(36);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(129);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(22);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e){t.exports=require("jaid-core")},function(t,e){t.exports=require("@absolunet/fsp")},function(t,e){t.exports=require("flatten-multiline")},function(t,e){t.exports=require("got")},function(t,e,n){"use strict";var r=n(5),o=n.n(r),i=n(77),s=n.n(i);e.a=async t=>{const e=await o.a.read(t),n=e.getWidth(),r=e.getHeight(),i=new Uint8ClampedArray(n*r*4);for(let t=0;r>t;t++)for(let r=0;n>r;r++){const s=o.a.intToRGBA(e.getPixelColor(r,t));i[4*(t*n+r)+0]=s.r,i[4*(t*n+r)+1]=s.g,i[4*(t*n+r)+2]=s.b,i[4*(t*n+r)+3]=s.a}return s()(i,n,r)}},function(t,e,n){"use strict";var r=n(30),o=n.n(r),i=n(3),s=n.n(i);e.a=t=>{var e;t.fullText=(null===(e=t.extended_tweet)||void 0===e?void 0:e.full_text)||t.text,t.flattenedText=o()(t.fullText),t.shortLink=`twitter.com/${t.user.screen_name}/status/${t.id_str}`,t.link=`https://${t.shortLink}`,t.authorTitle=s()(t.user.name)&&!t.user.name.includes("@")?t.user.name:t.user.screen_name}},function(t,e,n){"use strict";var r=n(54),o=n.n(r),i=n(85);n.n(i).a.registerHelpers(o.a),e.a=o.a},function(t,e,n){"use strict";var r=n(86),o=n.n(r);e.a=t=>/[a-z]/i.test(t)?o()(t,"ms"):1e3*t},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(55),o=n(38);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&9007199254740991>=t}},function(t,e,n){var r=n(112),o=n(128),i=n(130),s=n(131),a=n(132);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=s,u.prototype.set=a,t.exports=u},function(t,e,n){var r=n(12)(n(4),"Map");t.exports=r},function(t,e,n){var r=n(60),o=n(36),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var s=t[e];i.call(t,e)&&o(s,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(139),o=n(11),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return o(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=u},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},function(t,e,n){var r=n(63),o=n(164),i=n(37);t.exports=function(t){return i(t)?r(t):o(t)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(56),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===o&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=a}).call(this,n(45)(t))},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(172),o=n(67),i=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(t){return null==t?[]:(t=Object(t),r(s(t),(function(e){return i.call(t,e)})))}:o;t.exports=a},function(t,e,n){var r=n(65)(Object.getPrototypeOf,Object);t.exports=r},function(t,e,n){var r=n(175),o=n(40),i=n(176),s=n(71),a=n(177),u=n(15),c=n(58),f=c(r),l=c(o),p=c(i),h=c(s),d=c(a),y=u;(r&&"[object DataView]"!=y(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=y(new o)||i&&"[object Promise]"!=y(i.resolve())||s&&"[object Set]"!=y(new s)||a&&"[object WeakMap]"!=y(new a))&&(y=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case h:return"[object Set]";case d:return"[object WeakMap]"}return e}),t.exports=y},function(t,e,n){var r=n(180);t.exports=function(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}},function(t,e){t.exports=require("path")},function(t,e){t.exports=require("handlebars")},function(t,e,n){var r=n(15),o=n(8);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e){var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n},function(t,e,n){var r=n(16),o=n(27);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&i>n;)t=t[o(e[n++])];return n&&n==i?t:void 0}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},function(t,e,n){var r=n(61);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e,n){var r=n(12),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){var r=n(140),o=n(143),i=n(145);t.exports=function(t){return i(o(t,void 0,r),t+"")}},function(t,e,n){var r=n(160),o=n(42),i=n(9),s=n(64),a=n(21),u=n(162),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),f=!n&&o(t),l=!n&&!f&&s(t),p=!n&&!f&&!l&&u(t),h=n||f||l||p,d=h?r(t.length,String):[],y=d.length;for(var g in t)!e&&!c.call(t,g)||h&&("length"==g||l&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,y))||d.push(g);return d}},function(t,e,n){(function(t){var r=n(4),o=n(161),i=e&&!e.nodeType&&e,s=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===i?r.Buffer:void 0,u=(a?a.isBuffer:void 0)||o;t.exports=u}).call(this,n(45)(t))},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(63),o=n(167),i=n(37);t.exports=function(t){return i(t)?r(t,!0):o(t)}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(43),o=n(50),i=n(49),s=n(67),a=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,i(t)),t=o(t);return e}:s;t.exports=a},function(t,e,n){var r=n(43),o=n(9);t.exports=function(t,e,n){var i=e(t);return o(t)?i:r(i,n(t))}},function(t,e,n){var r=n(69),o=n(68),i=n(66);t.exports=function(t){return r(t,i,o)}},function(t,e,n){var r=n(12)(n(4),"Set");t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e){t.exports=require("yargs")},function(t,e){t.exports={apiHost:"localhost",apiProtocol:"http",apiPort:80,tweeters:[],apiUser:"jaid"}},function(t,e){t.exports=require("sort-keys")},function(t,e){t.exports=require("camelcase")},function(t,e){t.exports=require("jsqr")},function(t,e){t.exports=require("escape-string-regexp")},function(t,e){t.exports=require("remove-accents")},function(t,e,n){var r=n(100),o=n(101),i=n(104),s=parseFloat,a=Math.min,u=Math.random;t.exports=function(t,e,n){if(n&&"boolean"!=typeof n&&o(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=i(t),void 0===e?(e=t,t=0):e=i(e)),t>e){var c=t;t=e,e=c}if(n||t%1||e%1){var f=u();return a(t+f*(e-t+s("1e-"+((f+"").length-1))),e)}return r(t,e)}},function(t,e,n){var r=n(106),o=n(62)((function(t,e){return null==t?{}:r(t,e)}));t.exports=o},function(t,e){t.exports=require("delay")},function(t,e){t.exports=require("ensure-object")},function(t,e){t.exports=require("twit")},function(t,e){t.exports=require("just-handlebars-helpers")},function(t,e){t.exports=require("timestring")},function(t,e,n){var r=n(59),o=n(151),i=n(191),s=n(16),a=n(19),u=n(195),c=n(62),f=n(70),l=c((function(t,e){var n={};if(null==t)return n;var c=!1;e=r(e,(function(e){return e=s(e,t),c||(c=e.length>1),e})),a(t,f(t),n),c&&(n=o(n,7,u));for(var l=e.length;l--;)i(n,e[l]);return n}));t.exports=l},function(t,e){t.exports=require("dead-by-daylight")},function(t,e){t.exports=require("humanize-list")},function(t,e){t.exports=require("node-schedule")},function(t,e){t.exports=require("pick-random")},function(t,e){t.exports=require("render-dead-by-daylight-build")},function(t,e,n){var r=n(199);t.exports=function(t){return t&&t.length?r(t):[]}},function(t,e){t.exports=require("data-urls")},function(t,e){t.exports=require("execall")},function(t,e){t.exports=require("qrcode")},function(t,e,n){"use strict";n.r(e);var r=n(73),o=n.n(r),i=n(2);function s(t){var e;(null===i.b||void 0===i.b||null===(e=i.b.logger)||void 0===e?void 0:e.error)?i.b.logger.error(t):console.error(t)}process.on("unhandledRejection",t=>{s(t?`Unhandled promise rejection: ${(null==t?void 0:t.message)||t}`:"Unhandled promise rejection"),(null==t?void 0:t.stack)&&s(t.stack)}),o.a.scriptName("tweeter-client").version("4.24.0").command("$0","Creates tweets.",{},(function(){(async function(){const t={},e=n(98);for(const n of e.keys()){const{pluginName:r}=n.match(/[/\\](?<pluginName>.+?)[/\\]index\.js$/).groups;t[r]=e(n).default}await i.b.init(t)})().catch(t=>{s("Core process crashed"),s(t),process.exit(1)})})).argv},function(t,e,n){var r={"./main/index.js":14};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=98},function(t,e,n){var r={"./AnimalCrossingQrCodes/index.js":214,"./AnswerMentions/index.js":150,"./DeadByDaylightBuild/index.js":215,"./LikeMentions/index.js":197,"./PokemonGoQrCodes/index.js":198,"./Reaction/index.js":1,"./ReactionWithCooldown/index.js":13,"./Spelling/index.js":212,"./Test/index.js":213};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id=99},function(t,e){var n=Math.floor,r=Math.random;t.exports=function(t,e){return t+n(r()*(e-t+1))}},function(t,e,n){var r=n(36),o=n(37),i=n(21),s=n(8);t.exports=function(t,e,n){if(!s(n))return!1;var a=typeof e;return!!("number"==a?o(n)&&i(e,n.length):"string"==a&&e in n)&&r(n[e],t)}},function(t,e,n){var r=n(18),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=s.call(t);return r&&(e?t[a]=n:delete t[a]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(105);t.exports=function(t){return t?(t=r(t))===1/0||t===-1/0?17976931348623157e292*(0>t?-1:1):t==t?t:0:0===t?t:0}},function(t,e,n){var r=n(8),o=n(22),i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(/^\s+|\s+$/g,"");var n=s.test(t);return n||a.test(t)?u(t.slice(2),n?2:8):i.test(t)?NaN:+t}},function(t,e,n){var r=n(107),o=n(136);t.exports=function(t,e){return r(t,e,(function(e,n){return o(t,n)}))}},function(t,e,n){var r=n(57),o=n(135),i=n(16);t.exports=function(t,e,n){for(var s=-1,a=e.length,u={};++s<a;){var c=e[s],f=r(t,c);n(f,c)&&o(u,i(c,t),f)}return u}},function(t,e,n){var r=n(9),o=n(22),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||s.test(t)||!i.test(t)||null!=e&&t in Object(e)}},function(t,e,n){var r=n(110)((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,(function(t,n,r,o){e.push(r?o.replace(/\\(\\)?/g,"$1"):n||t)})),e}));t.exports=r},function(t,e,n){var r=n(111);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(39);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},function(t,e,n){var r=n(113),o=n(24),i=n(40);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(114),o=n(119),i=n(120),s=n(121),a=n(122);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=s,u.prototype.set=a,t.exports=u},function(t,e,n){var r=n(23);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e,n){var r=n(55),o=n(116),i=n(8),s=n(58),a=Function.prototype,u=Object.prototype,c=a.toString,f=u.hasOwnProperty,l=RegExp("^"+c.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?l:/^\[object .+?Constructor\]$/).test(s(t))}},function(t,e,n){var r,o=n(117),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(4)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(23),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(23),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var r=n(23);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(25),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return n>=0&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(25);t.exports=function(t){var e=this.__data__,n=r(e,t);return 0>n?void 0:e[n][1]}},function(t,e,n){var r=n(25);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(25);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return 0>o?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(26);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(26);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(26);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(26);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var r=n(134);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(18),o=n(59),i=n(9),s=n(22),a=r?r.prototype:void 0,u=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(s(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e,n){var r=n(41),o=n(16),i=n(21),s=n(8),a=n(27);t.exports=function(t,e,n,u){if(!s(t))return t;for(var c=-1,f=(e=o(e,t)).length,l=f-1,p=t;null!=p&&++c<f;){var h=a(e[c]),d=n;if(c!=l){var y=p[h];void 0===(d=u?u(y,h,p):void 0)&&(d=s(y)?y:i(e[c+1])?[]:{})}r(p,h,d),p=p[h]}return t}},function(t,e,n){var r=n(137),o=n(138);t.exports=function(t,e){return null!=t&&o(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(16),o=n(42),i=n(9),s=n(21),a=n(38),u=n(27);t.exports=function(t,e,n){for(var c=-1,f=(e=r(e,t)).length,l=!1;++c<f;){var p=u(e[c]);if(!(l=null!=t&&n(t,p)))break;t=t[p]}return l||++c!=f?l:!!(f=null==t?0:t.length)&&a(f)&&s(p,f)&&(i(t)||o(t))}},function(t,e,n){var r=n(15),o=n(11);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},function(t,e,n){var r=n(141);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},function(t,e,n){var r=n(43),o=n(142);t.exports=function t(e,n,i,s,a){var u=-1,c=e.length;for(i||(i=o),a||(a=[]);++u<c;){var f=e[u];n>0&&i(f)?n>1?t(f,n-1,i,s,a):r(a,f):s||(a[a.length]=f)}return a}},function(t,e,n){var r=n(18),o=n(42),i=n(9),s=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(s&&t&&t[s])}},function(t,e,n){var r=n(144),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,s=-1,a=o(i.length-e,0),u=Array(a);++s<a;)u[s]=i[e+s];s=-1;for(var c=Array(e+1);++s<e;)c[s]=i[s];return c[e]=n(u),r(t,this,c)}}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(146),o=n(149)(r);t.exports=o},function(t,e,n){var r=n(147),o=n(61),i=n(148),s=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=s},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){t.exports=function(t){return t}},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return u}));var r=n(87),o=n.n(r),i=n(0),s=n.n(i),a=n(1);class u extends a.default{async start(){this.options.track=`@${this.options.handle}`,await super.start()}}u.schema=s.a.object().keys({...o()(a.default.schema,"track")})},function(t,e,n){var r=n(152),o=n(158),i=n(41),s=n(159),a=n(166),u=n(169),c=n(170),f=n(171),l=n(173),p=n(174),h=n(70),d=n(51),y=n(178),g=n(179),b=n(185),v=n(9),w=n(64),x=n(187),m=n(8),_=n(189),j=n(44),F={};F["[object Arguments]"]=F["[object Array]"]=F["[object ArrayBuffer]"]=F["[object DataView]"]=F["[object Boolean]"]=F["[object Date]"]=F["[object Float32Array]"]=F["[object Float64Array]"]=F["[object Int8Array]"]=F["[object Int16Array]"]=F["[object Int32Array]"]=F["[object Map]"]=F["[object Number]"]=F["[object Object]"]=F["[object RegExp]"]=F["[object Set]"]=F["[object String]"]=F["[object Symbol]"]=F["[object Uint8Array]"]=F["[object Uint8ClampedArray]"]=F["[object Uint16Array]"]=F["[object Uint32Array]"]=!0,F["[object Error]"]=F["[object Function]"]=F["[object WeakMap]"]=!1,t.exports=function t(e,n,A,B,k,T){var O,D=1&n,C=2&n,I=4&n;if(A&&(O=k?A(e,B,k,T):A(e)),void 0!==O)return O;if(!m(e))return e;var U=v(e);if(U){if(O=y(e),!D)return c(e,O)}else{var L=d(e),S="[object Function]"==L||"[object GeneratorFunction]"==L;if(w(e))return u(e,D);if("[object Object]"==L||"[object Arguments]"==L||S&&!k){if(O=C||S?{}:b(e),!D)return C?l(e,a(O,e)):f(e,s(O,e))}else{if(!F[L])return k?e:{};O=g(e,L,D)}}T||(T=new r);var $=T.get(e);if($)return $;T.set(e,O),_(e)?e.forEach((function(r){O.add(t(r,n,A,r,e,T))})):x(e)&&e.forEach((function(r,o){O.set(o,t(r,n,A,o,e,T))}));var E=I?C?h:p:C?keysIn:j,P=U?void 0:E(e);return o(P||e,(function(r,o){P&&(r=e[o=r]),i(O,o,t(r,n,A,o,e,T))})),O}},function(t,e,n){var r=n(24),o=n(153),i=n(154),s=n(155),a=n(156),u=n(157);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=s,c.prototype.has=a,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(24);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(24),o=n(40),i=n(39);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||199>s.length)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(t,e),this.size=n.size,this}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},function(t,e,n){var r=n(19),o=n(44);t.exports=function(t,e){return t&&r(e,o(e),t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(163),o=n(46),i=n(47),s=i&&i.isTypedArray,a=s?o(s):r;t.exports=a},function(t,e,n){var r=n(15),o=n(38),i=n(11),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!s[r(t)]}},function(t,e,n){var r=n(48),o=n(165),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(65)(Object.keys,Object);t.exports=r},function(t,e,n){var r=n(19),o=n(66);t.exports=function(t,e){return t&&r(e,o(e),t)}},function(t,e,n){var r=n(8),o=n(48),i=n(168),s=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=o(t),n=[];for(var a in t)("constructor"!=a||!e&&s.call(t,a))&&n.push(a);return n}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},function(t,e,n){(function(t){var r=n(4),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===o?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=a?a(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(45)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},function(t,e,n){var r=n(19),o=n(49);t.exports=function(t,e){return r(t,o(t),e)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}},function(t,e,n){var r=n(19),o=n(68);t.exports=function(t,e){return r(t,o(t),e)}},function(t,e,n){var r=n(69),o=n(49),i=n(44);t.exports=function(t){return r(t,i,o)}},function(t,e,n){var r=n(12)(n(4),"DataView");t.exports=r},function(t,e,n){var r=n(12)(n(4),"Promise");t.exports=r},function(t,e,n){var r=n(12)(n(4),"WeakMap");t.exports=r},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},function(t,e,n){var r=n(52),o=n(181),i=n(182),s=n(183),a=n(184);t.exports=function(t,e,n){var u=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new u(+t);case"[object DataView]":return o(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(t,n);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(t);case"[object RegExp]":return i(t);case"[object Set]":return new u;case"[object Symbol]":return s(t)}}},function(t,e,n){var r=n(4).Uint8Array;t.exports=r},function(t,e,n){var r=n(52);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},function(t,e){var n=/\w*$/;t.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},function(t,e,n){var r=n(18),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;t.exports=function(t){return i?Object(i.call(t)):{}}},function(t,e,n){var r=n(52);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},function(t,e,n){var r=n(186),o=n(50),i=n(48);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:r(o(t))}},function(t,e,n){var r=n(8),o=Object.create,i=function(){function t(){}return function(e){if(!r(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();t.exports=i},function(t,e,n){var r=n(188),o=n(46),i=n(47),s=i&&i.isMap,a=s?o(s):r;t.exports=a},function(t,e,n){var r=n(51),o=n(11);t.exports=function(t){return o(t)&&"[object Map]"==r(t)}},function(t,e,n){var r=n(190),o=n(46),i=n(47),s=i&&i.isSet,a=s?o(s):r;t.exports=a},function(t,e,n){var r=n(51),o=n(11);t.exports=function(t){return o(t)&&"[object Set]"==r(t)}},function(t,e,n){var r=n(16),o=n(192),i=n(193),s=n(27);t.exports=function(t,e){return e=r(e,t),null==(t=i(t,e))||delete t[s(o(e))]}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(57),o=n(194);t.exports=function(t,e){return 2>e.length?t:r(t,o(e,0,-1))}},function(t,e){t.exports=function(t,e,n){var r=-1,o=t.length;0>e&&(e=-e>o?0:o+e),0>(n=n>o?o:n)&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}},function(t,e,n){var r=n(196);t.exports=function(t){return r(t)?void 0:t}},function(t,e,n){var r=n(15),o=n(50),i=n(11),s=Function.prototype,a=Object.prototype,u=s.toString,c=a.hasOwnProperty,f=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=r(t))return!1;var e=o(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==f}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return s}));var r=n(0),o=n.n(r),i=n(1);class s extends i.default{async start(){this.options.track=`@${this.options.handle}`,await super.start()}async handleTweet(t){this.likeDelayed(t)}}s.schema=o.a.object().keys({...i.default.baseSchema})},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return _}));var r=n(93),o=n.n(r),i=n(0),s=n.n(i),a=n(94),u=n.n(a),c=n(95),f=n.n(c),l=n(31),p=n.n(l),h=n(3),d=n.n(h),y=n(5),g=n.n(y),b=n(96),v=n.n(b),w=n(32),x=n(20),m=n(13);class _ extends m.default{async shouldHandleTweet(t){var e;const n=[];if(d()(null===(e=t.extended_entities)||void 0===e?void 0:e.media))for(const e of t.extended_entities.media){if("photo"!==e.type)continue;const r=await p()(e.media_url).buffer(),o=await Object(w.a)(r);null!=o&&o.data&&/^\d{12}$/.test(o.data)&&(n.push(o.data),t.hasQrCode=!0)}if(!t.hasQrCode){const e=f()(/((?:\d{4}[ -]?){2}\d{4})(\D|$)/g,t.flattenedText);for(const t of e){const e=t.subMatches[0].replace(/[ -]/g,"");n.push(e)}}return!Object(h.isEmpty)(n)&&(t.codes=o()(n),t.codesFormatted=t.codes.map(t=>`${t.slice(0,4)} ${t.slice(4,8)} ${t.slice(8,12)}`),t.codesString=t.codesFormatted.join("\n"),d()(t.user.location)&&(Object(x.a)(t.user.location," -,")?t.playerLocation=t.user.location:this.logger.debug(`Discarding Twitter user location: ${t.user.location}`)),this.options.ignoreWithoutLocation&&!t.playerLocation?(this.logger.debug("Ignoring tweet, because author does not have a meaningful location set"),!1):!!await super.shouldHandleTweet(t))}async handleTweet(t){if(this.options.like&&this.likeDelayed(t),t.hasQrCode)return void await this.retweet(t);const e=this.template({tweet:t}),n=t.codes,r=async t=>{const e=await v.a.toDataURL(t,{errorCorrectionLevel:"L",scale:32}),n=u()(e).body,r=await g.a.create(n);return r.background(4294967295),r.contain(1920,1080),r.getBase64Async(g.a.MIME_PNG)},o=Array(n.length);for(let t=0;t<=n.length-1;t++)o[t]=r(n[t]);const i=await Promise.all(o),s=await this.post(`${e}\n${t.link}`,i);await this.registerTargetActionFromTweet(t,{myTweetId:s.tweet.id_str,originalTweetId:t.id_str,codes:t.codes})}}_.schema=s.a.object().keys({...m.default.baseSchema,like:s.a.bool(),ignoreWithoutLocation:s.a.bool(),text:s.a.string().required()})},function(t,e,n){var r=n(200),o=n(203),i=n(208),s=n(209),a=n(210),u=n(72);t.exports=function(t,e,n){var c=-1,f=o,l=t.length,p=!0,h=[],d=h;if(n)p=!1,f=i;else if(200>l)d=e?[]:h;else{var y=e?null:a(t);if(y)return u(y);p=!1,f=s,d=new r}t:for(;++c<l;){var g=t[c],b=e?e(g):g;if(g=n||0!==g?g:0,p&&b==b){for(var v=d.length;v--;)if(d[v]===b)continue t;e&&d.push(b),h.push(g)}else f(d,b,n)||(d!==h&&d.push(b),h.push(g))}return h}},function(t,e,n){var r=n(39),o=n(201),i=n(202);function s(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}s.prototype.add=s.prototype.push=o,s.prototype.has=i,t.exports=s},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(204);t.exports=function(t,e){return!(null==t||!t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(205),o=n(206),i=n(207);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},function(t,e){t.exports=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(71),o=n(211),i=n(72),s=r&&1/i(new r([,-0]))[1]==1/0?function(t){return new r(t)}:o;t.exports=s},function(t,e){t.exports=function(){}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return c}));var r=n(0),o=n.n(r),i=n(7),s=n.n(i),a=n(33),u=n(13);class c extends u.default{async start(){await super.start(),this.checkQuotesRegex=s()(`/["„“'‚‘]${this.options.track}["„“'‚‘]/i`),this.checkLeadingLettersRegex=s()(`/\\w${this.options.track}/i`),this.checkTrailingLettersRegex=s()(`/${this.options.track}\\w/i`)}async shouldHandleTweet(t){return this.checkLeadingLettersRegex.test(t.flattenedText)?(this.logger.debug("Found leading letters, skipping (assuming false positive)"),!1):this.checkTrailingLettersRegex.test(t.flattenedText)?(this.logger.debug("Found trailing letters, skipping (assuming false positive)"),!1):!!await super.shouldHandleTweet(t)}async handleTweet(t){if(this.options.like&&this.likeDelayed(t),this.options.ignoreTypoReferences&&t.in_reply_to_status_id_str){const e=await this.getTweetById(t.in_reply_to_status_id_str);Object(a.a)(e);const n=e.fullText.toLowerCase(),r=this.options.track.toLowerCase();if(n.includes(r))return void this.logger.debug(`Will not make a tweet assuming author @${t.user.screen_name} copied the typo from parent tweet`)}if(this.checkQuotesRegex.test(t.flattenedText))return void this.logger.debug(`Will not make a tweet assuming author @${t.user.screen_name} is not dumb`);const e=await this.database.models.TargetAction.count({where:{targetUserId:t.user.id_str}});if(this.options.maximumCorrectionsPerUser&&e>=this.options.maximumCorrectionsPerUser)return void this.logger.debug(`Not correcting @${t.user.screen_name}, because user has already been corrected ${e} times`);const n=this.template({tweet:t,previousCountForThisUser:e}),r=await this.retweet(t,n);(null==r?void 0:r.tweet)&&await this.registerTargetActionFromTweet(t,{myTweetId:r.tweet.id_str,originalTweetId:t.id_str})}}c.schema=o.a.object().keys({...u.default.baseSchema,like:o.a.bool(),text:o.a.string().required(),ignoreTypoReferences:o.a.bool().default(!0),maximumCorrectionsPerUser:o.a.number().default(3)})},function(t,e,n){"use strict";n.r(e);var r=n(6);e.default=class extends r.a{async start(){this.post(`Tweeter Client v4.24.0, ${Date.now()}`)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y}));var r=n(0),o=n.n(r),i=n(31),s=n.n(i),a=n(3);function u(t,e=0,n=9e3){var r=Math.min;let o=BigInt("144066263297769815596495629667062367629");const i=BigInt("309485009821345068724781371");if("string"==typeof t){const s=r(e+n,t.length);for(let n=e;s>n;n++)o^=BigInt(t.charCodeAt(n)),o=BigInt.asUintN(128,o*i)}else if(t instanceof Uint8Array){const s=r(e+n,t.byteLength);for(let n=e;s>n;n++)o^=BigInt(t[n]),o=BigInt.asUintN(128,o*i)}else if(t instanceof ArrayBuffer){const s=new Uint8Array(t),a=r(e+n,s.byteLength);for(let t=e;a>t;t++)o^=BigInt(s[t]),o=BigInt.asUintN(128,o*i)}return`0000000000000000000000000000000${o.toString(16)}`.slice(-32)}class c{constructor(t=null){if(this.b=null,t instanceof ArrayBuffer){this.b=new ArrayBuffer(t.byteLength>620?2160:620),this.dataView=new DataView(this.b,0,this.b.byteLength),this.dataBytes=new Uint8Array(this.b,0,this.b.byteLength);const e=new Uint8Array(t,0,t.byteLength);for(let n=0;n<t.byteLength&&n<this.b.byteLength;++n)this.dataBytes[n]=e[n]}if(t instanceof Uint8Array){this.b=new ArrayBuffer(t.byteLength>620?2160:620),this.dataView=new DataView(this.b,0,this.b.byteLength),this.dataBytes=new Uint8Array(this.b,0,this.b.byteLength);for(let e=0;e<t.byteLength&&e<this.b.byteLength;++e)this.dataBytes[e]=t[e]}if("string"==typeof t&&t.length>=620){this.b=new ArrayBuffer(t.length>620?2160:620),this.dataView=new DataView(this.b,0,this.b.byteLength),this.dataBytes=new Uint8Array(this.b,0,this.b.byteLength);for(let e=0;e<t.length&&e<this.b.byteLength;++e)this.dataBytes[e]=t.charCodeAt(e)}if(null===this.b){let e=9;"number"==typeof t&&(e=t),this.b=new ArrayBuffer(c.bytesForType(e)),this.dataView=new DataView(this.b,0,this.b.byteLength),this.dataBytes=new Uint8Array(this.b,0,this.b.byteLength),this.title="Empty",this.creator=["Unknown",0],this.town=["Unknown",0],this.unknown_a=12569,this.setDefaultPalette(),this.unknown_b=204,this.unknown_c=10,this.patternType=e}this.currMask=c.typeInfo[this.patternType]?c.typeInfo[this.patternType].mask:null}utf16_decode(t,e){let n="";for(let r=0;e>r;r+=2){const e=this.dataView.getUint16(t+r,!0);if(0===e)return n;n+=String.fromCharCode(e)}return n}utf16_encode(t,e,n){for(let r=0;e/2>r;r++)r<n.length?this.dataView.setUint16(t+2*r,n.charCodeAt(r),!0):this.dataView.setUint16(t+2*r,0,!0)}toString(){let t="";const e=Math.min(this.byteLength,this.b.byteLength);for(let n=0;e>n;n++)t+=String.fromCharCode(this.dataBytes[n]);return t}toJson(){return{title:this.title,author:this.creator,authorTitle:this.creator[0]?this.creator[0]:null,town:this.town,townTitle:this.town[0]?this.town[0]:null,unknown:{a:this.unknown_a,b:this.unknown_b,c:this.unknown_c,d:this.unknown_d},textureSize:this.width,patternType:this.patternType,patternTypeTitle:c.getTypeStr(this.patternType),byteLength:this.byteLength}}toPixels(t){let e=0;for(let n=108;n<this.b.byteLength&&e<t.byteLength;n++)t[e++]=15&this.dataBytes[n],t[e++]=15&this.dataBytes[n]>>4;if(this.currMask)for(let e=0;e<t.byteLength;e++)this.currMask[e>>5]&1<<(31&e)&&(t[e]=252)}fromPixels(t){let e=0;for(let n=108;n<this.b.byteLength;n++)this.dataBytes[n]=(15&t[e])+((15&t[e+1])<<4),e+=2}getPalette(t){return 0>t||t>14?0:this.dataBytes[88+t]}setPalette(t,e){0>t||t>14||(this.dataBytes[88+t]=e)}set title(t){this.utf16_encode(0,40,t)}get title(){return this.utf16_decode(0,40)}set creator(t){return Array.isArray(t)&&2===t.length?(this.creator=t[0],void(this.creator=t[1])):("string"==typeof t&&this.utf16_encode(44,18,t),void("number"==typeof t&&this.dataView.setUint16(42,t,!0)))}get creator(){return[this.utf16_decode(44,18),this.dataView.getUint16(42,!0),this.dataBytes[68]?"Male":"Female"]}set town(t){return Array.isArray(t)&&2===t.length?(this.town=t[0],void(this.town=t[1])):("string"==typeof t&&this.utf16_encode(66,18,t),void("number"==typeof t&&this.dataView.setUint16(64,t,!0)))}get town(){return[this.utf16_decode(66,18),this.dataView.getUint16(64,!0)]}set unknown_a(t){this.dataView.setUint16(86,t,!0)}get unknown_a(){return this.dataView.getUint16(86,!0)}setDefaultPalette(){for(let t=0;15>t;t++)this.dataBytes[88+t]=16*t+15}set unknown_b(t){this.dataBytes[103]=t}get unknown_b(){return this.dataBytes[103]}set unknown_c(t){this.dataBytes[104]=t}get unknown_c(){return this.dataBytes[104]}set patternType(t){if(this.width!==c.widthForType(t)){const e=new ArrayBuffer(c.widthForType(t)>32?2160:620),n=new DataView(e),r=new Uint8Array(e);for(let t=0;t<e.byteLength&&t<this.b.byteLength;++t)r[t]=this.dataBytes[t];this.dataView=n,this.dataBytes=r,this.b=e}this.dataBytes[105]=t,this.currMask=c.typeInfo[this.patternType]?c.typeInfo[this.patternType].mask:null}get patternType(){return this.dataBytes[105]}static getTypeStr(t){return c.typeInfo[t]&&c.typeInfo[t].name?c.typeInfo[t].name:"Unimplemented pattern type"}set unknown_d(t){this.dataView.setUint16(106,t,!0)}get unknown_d(){return this.dataView.getUint16(106,!0)}get width(){return c.typeInfo[this.dataBytes[105]]?c.typeInfo[this.dataBytes[105]].size:32}get height(){return c.typeInfo[this.dataBytes[105]]?c.typeInfo[this.dataBytes[105]].size:32}get byteLength(){return this.width>32?2160:620}pixelHash(){return u(this.b,88,this.width>32?2068:532)}fullHash(){return u(this.b,0,this.byteLength)}fixIssues(){this.creator[1]||(this.creator=60598),this.town[1]||(this.town=50500),this.dataBytes[84]=0,this.dataBytes[85]=0,this.dataBytes[62]>1&&(this.dataBytes[62]=0),this.dataBytes[63]=0,this.dataBytes[40]=0,this.dataBytes[41]=0}static widthForType(t){return c.typeInfo[t].size}static bytesForType(t){return this.widthForType(t)>32?2160:620}}c.paletteColors=["#FFEEFF","#FF99AA","#EE5599","#FF66AA","#FF0066","#BB4477","#CC0055","#990033","#552233","","","","","","","#FFFFFF","#FFBBCC","#FF7777","#DD3210","#FF5544","#FF0000","#CC6666","#BB4444","#BB0000","#882222","","","","","","","#EEEEEE","#DDCDBB","#FFCD66","#DD6622","#FFAA22","#FF6600","#BB8855","#DD4400","#BB4400","#663210","","","","","","","#DDDDDD","#FFEEDD","#FFDDCC","#FFCDAA","#FFBB88","#FFAA88","#DD8866","#BB6644","#995533","#884422","","","","","","","#CCCDCC","#FFCDFF","#EE88FF","#CC66DD","#BB88CC","#CC00FF","#996699","#8800AA","#550077","#330044","","","","","","","#BBBBBB","#FFBBFF","#FF99FF","#DD22BB","#FF55EE","#FF00CC","#885577","#BB009