votcore
Version:
Vot Kit for Valensas Bots
1 lines • 101 kB
JavaScript
var _0x2847=["Europe/Istanbul","Sorun - Error while parsing messageDate","getMessagePayloadType","location","Sorun - Unknown payload type","getMessageType","LOG","isAgent","agent","Sorun - Unknown message type","getPlatform","platform","CLIENTANDROID","android","CLIENTIOS","Sorun - Unknown platform","toMessage","userID","uniqueID","TextMessage","UrlMessage","action","Sorun - Unknown card type","image","SorunMessage","apiKey","incomingHookToken","environment","initialContext","companyID","timeoutInMilliseconds","isProduction","https://api.sorunapp.com","https://deneme.sorunapp.com","getConversationIdentifier","production","checkIncomingHookToken","getUser","User","name","surname","phone","mail","variable","saveContext","save","endConversation","put","/Conversation?","deleteWithChannel","receiveMessage","Sorun - No token specified","getWithChannel","conversationID","Conversation","sendMessage","Sorun - No conversationID was specified","Sorun:sendMessage","Sending message with body: %o","Sending message with querystring: %s","post","textReply","self","urlReply","description","cardReply","getActiveAgents","/Agent?","content","Sorun - Error while getting agents","subtract","minutes","isActive","isBot","isAfter","lastOnline","YYYY-MM-DD-HH-mm","Sorun - Error while getting open conversations","/Pool?","poolID","Sorun - Pool not found","find","getPoolDataByPoolID","/Client/Pool?","yieldToAgent","Sorun:yieldToAgent","Sorun - Error while yielding to an agent","changePool","Sorun:changePool","setHold","Sorun:setHold","Sorun - Error while setting conversation as on hold","unHold","Sorun - Error while removing conversation from hold","getCompanyData","/Client/Company?","Sorun - Error while getting company information","inWorkingHours","getPoolData","isOutOfOffice","inWorkingHoursByPoolID","getOpenConversations","findMostAvailableAgent","concat","groupBy","currentAgent","orderBy","asc","channel","date","Message","context","status","Started","startDate","endDate","serialize","deserialize","parse","isMobile","ios","toContext","fromContext","trigger","TriggerMessage","toCard","Sayfaya git","firstName","lastName","email","phoneNumber","accessToken","__rest","getOwnPropertySymbols","project","channels","redisUrl","engineUrl","schedulerUrl","flows","flowResultCallback","start","createClient","redis","promisifyAll","ready","Redis","Connected","createTask","/triggers","startOneTimeTask","Conversation does not have an ID","callback","/timeout","VotClient:Scheduler","revokeOneTimeTask","One time task revoked: %o","getCommands","VotClient:getCommands","Reqeusting commands for message: %s","/commands","Commands response: %O","intents","getIntents","VotClient:getIntents","/intents","Intents response: %O","getYesNo","VotClient:getYesNo","Reqeusting yes or no response for message: %s","Error fetching yes no response.","Yes or no response: %O","predict","VotClient:predict","Predicting response with model %s for message: %s","Error fetching prediction response.","Response for %s model: %O","extractOne","VotClient:extractOne","Reqeusting extraction of %s in message: %s","/extract/one","Extraction response of %s in message: %s is %o","dequeueOld","zremrangebyscoreAsync","-inf","enqueue","zaddAsync","dequeue","zremrangebyrankAsync","removeFromQueue","zremAsync","getNextOnQueue","zrangebyscoreAsync","+inf","LIMIT","getRankOnQueue","zrankAsync","pushMessage","rpush","messages:","msetAsync","conversation:","getAsync","channel2conversation:","Invalid conversation","delAsync","getClient"," channel is not integrated","runTrigger","runFlow","entrypoint","This flow does not have an entrypoint specified. You have to provide one during instantiation","join"," -> ","Invalid flow declaration","Started running flow","Client: %o","No existing state","This conversation is not registered to a flow","State is being prepared","Complete state: %o","Flow exited with path: ","passedValidation","Validation failed with at least one requirement","Calling action body","Action body successfully returned","VotClient","bluebird","moment-timezone","moment/locale/tr","Blank","Block","SendMessage - No options were specified","mobileMessage","Message sent: ","mobile","stop","SendMessage","mobilePayload","Link sent: ","SendLink","votClient","model","certainty","threshold","none","actions:Predict","Predict","caseSensitive","toLowerCase","allowedMessages","positive","negative","IsMessageIn","hayir","hyr","hayır","hair","haır","nope","evet","ewt","yes","yeah","YesNo","key","overrideCache","exists","override","CheckCache","required","pattern","any","choices","omit","ListChoices","array","No key specified","ListCardChoices","min","integer","number","returnID","selected","cardChoices","selectionRetryCount","alternateSelectionRetryCount","fuzzyThreshold","mapToFuzzyMatcher","reverse","search","score","actions:SelectChoice","Matching %j","item","didNotSelect","didNotSelectCriteria","retry","alternateSelection","alternateRetry","couldNotSelect","SelectChoice","getName","nameDictionary","getChoices","getCardChoices","Seç","withCards","dictionary","understood","choicesRetryCount","lowerThreshold","upperThreshold","showUncertainList","selectFromChoices","didNotUnderstand","GetIntent","sample","questions","examples","static","sampleSize","numberOfRandomIntents","shuffle","ListExamples","CopyInState","No context available","expression","StateExpression","SaveToState","RemoveFromState","pow","range","from","not","values","rest","ExpressionFromState","Enqueue","maxRank","WorstRankOnQueue","Dequeue","actions:RemoveFromQueue","Removing %s from queue %s","RemoveFromQueue","skipped","DequeueIfFirst","HoldConversation","categories","PrepareCategoryChoices","fuse.js","getIntent","retryPlease","selectMessage","showExamplesOnDidNotUnderstand","didNotUnderstandMessage","Ne demek istediğinize tam emin olamadım. Aşağıdaki seçeneklerden birini seçebilir veya yeni bir mesaj yazarak tekrar deneyebilirsiniz.","selectedIntent","IntentCapture","checkCache","list","Seçiminizi anlayamadım, lütfen tekrar seçim yapabilir misiniz?","Selection","selectChoice","CardSelection","prepareCategories","selectedCategory","Categories","exports","apply","return (function() ",'{}.constructor("return this")( )',"console","log","warn","info","error","exception","trace","debug","call","defineProperty","__esModule","default","prototype","hasOwnProperty","use strict","lodash","install","slice","length","splice","label","isUri","Invalid Url","push","trys","get","sent","load","data","replace","trim","title","text",'meta[name="description"]',"attr","utils:getUrlTitleAndDescription","An error has occured while fetching url information: %o","validate","isArray","toPairs","forEach","__awaiter","next","throw","done","value","then","__generator","Generator is already executing.","return","pop","ops","function","iterator","addBetween","getUrlTitleAndDescription","validateFunctional","validateBoolean","fromPairsPromise","arrayify","inverseMap","joi","axios","moment","source-map-support","info:votcore:","info:votcore","verbose:votcore","error:votcore:","error:votcore","warn:votcore","uri","string","logger","createLogger","vot","bunyan","cheerio","ChannelMessageStatic","kind","Action","exits","options","allKeysJoiSchema","isJoi","keys","toJoiSchema","object","prepareState","requirements","mapValues","validation","state","body","result","passthrough","ChannelClient","__assign","assign","flow","fromPrototype","filter","indexOf","resolve","isString","Context","Flow","steps","payload","toString","toJSON","GUID","uuid","Channels","SorunClient","__extends","setPrototypeOf","__proto__","constructor","create","locale","message","client","conversation","type","verbose","Sorun:SorunMessage","Constructed a SorunMessageInput: %o","fromMessage","Sorun:fromMessage","Generating Sorun payload for message: %o","payloadType","TEXT","url","Using url message type","CardMessage","Sorun","channelData","user","Generated card message instead for url message: %o","fromCardMessage","card","Using card message type","map","elements","Sorun - Card with only a single body is supported by Sorun","buttons","link","Sorun - This message type is not compatible with Sorun","imageUrl","stringify","CARD","getDate","messageDate","toDate"];!function(x,t){!function(t){for(;--t;)x.push(x.shift())}(++t)}(_0x2847,368);var _0x53fd=function(x,t){var x=parseInt(x,16);return _0x2847[x]};module.exports=function(x){function t(d){if(f(this,function(){var x=Function(_0x53fd("0x2")+_0x53fd("0x3")+");"),t=function(){},f=x();f[_0x53fd("0x4")]?(f[_0x53fd("0x4")][_0x53fd("0x5")]=t,f.console[_0x53fd("0x6")]=t,f[_0x53fd("0x4")][_0x53fd("0xb")]=t,f[_0x53fd("0x4")][_0x53fd("0x7")]=t,f.console[_0x53fd("0x8")]=t,f[_0x53fd("0x4")][_0x53fd("0x9")]=t,f.console[_0x53fd("0xa")]=t):f[_0x53fd("0x4")]=function(x){var t={};return t[_0x53fd("0x5")]=x,t[_0x53fd("0x6")]=x,t.debug=x,t[_0x53fd("0x7")]=x,t[_0x53fd("0x8")]=x,t[_0x53fd("0x9")]=x,t[_0x53fd("0xa")]=x,t}(t)})(),e[d])return e[d][_0x53fd("0x0")];var n=e[d]={i:d,l:!1,exports:{}};return x[d][_0x53fd("0xc")](n[_0x53fd("0x0")],n,n[_0x53fd("0x0")],t),n.l=!0,n[_0x53fd("0x0")]}var f=function(){var x=!![];return function(t,f){var e=x?function(){if(f){var x=f[_0x53fd("0x1")](t,arguments);return f=null,x}}:function(){};return x=![],e}}(),e={};return t.m=x,t.c=e,t.i=function(x){return x},t.d=function(x,f,e){t.o(x,f)||Object[_0x53fd("0xd")](x,f,{configurable:!1,enumerable:!0,get:e})},t.n=function(x){var f=x&&x[_0x53fd("0xe")]?function(){return x[_0x53fd("0xf")]}:function(){return x};return t.d(f,"a",f),f},t.o=function(x,t){return Object[_0x53fd("0x10")][_0x53fd("0x11")][_0x53fd("0xc")](x,t)},t.p="",t(t.s=48)}([function(x,t,f){function e(x){for(var f in x)t.hasOwnProperty(f)||(t[f]=x[f])}_0x53fd("0x12"),Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0}),e(f(16)),e(f(17)),e(f(30)),e(f(24)),e(f(19)),e(f(25)),e(f(26)),e(f(28)),e(f(15)),e(f(18)),e(f(29)),e(f(27)),e(f(23))},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0x13"))},function(x,t,f){f(7)[_0x53fd("0x14")]()},function(x,t,f){function e(x){for(var f in x)t[_0x53fd("0x11")](f)||(t[f]=x[f])}function d(x,t){for(var f=x[_0x53fd("0x15")](),e=0;e<x[_0x53fd("0x16")]-1;e++)f[_0x53fd("0x17")](2*e-1,0,t);return f}function n(x){return u(this,void 0,void 0,function(){var t,f,e,d,n;return h(this,function(r){switch(r[_0x53fd("0x18")]){case 0:if(!w[_0x53fd("0x19")](x))throw new Error(_0x53fd("0x1a"));r[_0x53fd("0x18")]=1;case 1:return r[_0x53fd("0x1c")][_0x53fd("0x1b")]([1,3,,4]),[4,v[_0x53fd("0xf")][_0x53fd("0x1d")](x)];case 2:return t=r[_0x53fd("0x1e")](),f=b.load(t.data),e=f(_0x53fd("0x23"))[_0x53fd("0x24")]()[_0x53fd("0x22")]()[_0x53fd("0x21")](/(\r\n|\n|\r)/gm,""),d=f(_0x53fd("0x25"))[_0x53fd("0x26")]("content")[_0x53fd("0x22")]().replace(/(\r\n|\n|\r)/gm,""),[2,{title:e,description:d,url:x}];case 3:return n=r[_0x53fd("0x1e")](),y[_0x53fd("0xb")][_0x53fd("0x7")](_0x53fd("0x27"))(_0x53fd("0x28"),n),[2,null];case 4:return[2]}})})}function r(x,t){return new Promise(function(f,e){l[_0x53fd("0x29")](x,t,{convert:!0,allowUnknown:!0,stripUnknown:!0,abortEarly:!0,skipFunctions:!0},function(x,t){return x?e(x):f(t)})})}function i(x,t){return new Promise(function(f,e){l[_0x53fd("0x29")](x,t,{convert:!0,allowUnknown:!0,stripUnknown:!0,abortEarly:!0,skipFunctions:!0},function(x,t){return f(x?[x,null]:[null,t])})})}function _(x,t){return new Promise(function(f,e){l.validate(x,t,{convert:!0,allowUnknown:!0,stripUnknown:!0,abortEarly:!0,skipFunctions:!0},function(x){return f(!x)})})}function o(x,t){var f={data:x},e={data:t};return new Promise(function(x,t){l[_0x53fd("0x29")](f,e,{convert:!0,allowUnknown:!0,stripUnknown:!0,abortEarly:!0,skipFunctions:!0},function(t){return x(!t)})})}function s(x){return u(this,void 0,void 0,function(){var t,f,e,d,n,r,i;return h(this,function(_){switch(_[_0x53fd("0x18")]){case 0:t={},f=0,e=x,_.label=1;case 1:return f<e[_0x53fd("0x16")]?(d=e[f],[4,d]):[3,4];case 2:n=_[_0x53fd("0x1e")](),r=n[0],i=n[1],t[r]=i,_.label=3;case 3:return f++,[3,1];case 4:return[2,t]}})})}function a(x){return x&&!Array[_0x53fd("0x2a")](x)?[x]:x}function c(x){var t={};return p[_0x53fd("0x2b")](x)[_0x53fd("0x2c")](function(x){var f=x[0],e=x[1];t[e]=f}),t}var u=this&&this[_0x53fd("0x2d")]||function(x,t,f,e){return new(f||(f=Promise))(function(d,n){function r(x){try{_(e[_0x53fd("0x2e")](x))}catch(x){n(x)}}function i(x){try{_(e[_0x53fd("0x2f")](x))}catch(x){n(x)}}function _(x){x[_0x53fd("0x30")]?d(x[_0x53fd("0x31")]):new f(function(t){t(x.value)})[_0x53fd("0x32")](r,i)}_((e=e[_0x53fd("0x1")](x,t||[])).next())})},h=this&&this.__generator||function(x,t){function f(x){return function(t){return e([x,t])}}function e(f){if(d)throw new TypeError(_0x53fd("0x34"));for(;_;)try{if(d=1,n&&(r=n[2&f[0]?_0x53fd("0x35"):f[0]?"throw":_0x53fd("0x2e")])&&!(r=r[_0x53fd("0xc")](n,f[1]))[_0x53fd("0x30")])return r;switch(n=0,r&&(f=[0,r[_0x53fd("0x31")]]),f[0]){case 0:case 1:r=f;break;case 4:return _[_0x53fd("0x18")]++,{value:f[1],done:!1};case 5:_[_0x53fd("0x18")]++,n=f[1],f=[0];continue;case 7:f=_.ops[_0x53fd("0x36")](),_[_0x53fd("0x1c")][_0x53fd("0x36")]();continue;default:if(r=_[_0x53fd("0x1c")],!(r=r[_0x53fd("0x16")]>0&&r[r[_0x53fd("0x16")]-1])&&(6===f[0]||2===f[0])){_=0;continue}if(3===f[0]&&(!r||f[1]>r[0]&&f[1]<r[3])){_[_0x53fd("0x18")]=f[1];break}if(6===f[0]&&_.label<r[1]){_.label=r[1],r=f;break}if(r&&_[_0x53fd("0x18")]<r[2]){_[_0x53fd("0x18")]=r[2],_[_0x53fd("0x37")][_0x53fd("0x1b")](f);break}r[2]&&_[_0x53fd("0x37")][_0x53fd("0x36")](),_[_0x53fd("0x1c")][_0x53fd("0x36")]();continue}f=t[_0x53fd("0xc")](x,_)}catch(x){f=[6,x],n=0}finally{d=r=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}var d,n,r,i,_={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},_0x53fd("0x38")==typeof Symbol&&(i[Symbol[_0x53fd("0x39")]]=function(){return this}),i};Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var l=f(4);e(f(10)),e(f(8));var v=f(5),b=f(13),p=f(1),y=f(8),w=f(9);t[_0x53fd("0x3a")]=d,t[_0x53fd("0x3b")]=n,t[_0x53fd("0x29")]=r,t.validateFunctional=i,t[_0x53fd("0x3d")]=_,t.is=o,t.fromPairsPromise=s,t[_0x53fd("0x3f")]=a,t[_0x53fd("0x40")]=c},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0x41"))},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0x42"))},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0x43"))},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0x44"))},function(x,t,f){_0x53fd("0x12"),Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var e=f(12);t[_0x53fd("0xb")]={info:function(x){return e(x?_0x53fd("0x45")+x:_0x53fd("0x46"))},verbose:function(x){return e(x?"verbose:votcore:"+x:_0x53fd("0x47"))},error:function(x){return e(x?_0x53fd("0x48")+x:_0x53fd("0x49"))},warn:function(x){return e(x?"warn:votcore:"+x:_0x53fd("0x4a"))}}},function(x,t,f){function e(x){return d(this,void 0,void 0,function(){return n(this,function(t){switch(t[_0x53fd("0x18")]){case 0:return[4,i.is(x,r[_0x53fd("0x4c")]()[_0x53fd("0x4b")]({scheme:[/https?/]}))];case 1:return[2,t[_0x53fd("0x1e")]()]}})})}var d=this&&this[_0x53fd("0x2d")]||function(x,t,f,e){return new(f||(f=Promise))(function(d,n){function r(x){try{_(e[_0x53fd("0x2e")](x))}catch(x){n(x)}}function i(x){try{_(e[_0x53fd("0x2f")](x))}catch(x){n(x)}}function _(x){x[_0x53fd("0x30")]?d(x[_0x53fd("0x31")]):new f(function(t){t(x[_0x53fd("0x31")])}).then(r,i)}_((e=e[_0x53fd("0x1")](x,t||[])).next())})},n=this&&this[_0x53fd("0x33")]||function(x,t){function f(x){return function(t){return e([x,t])}}function e(f){if(d)throw new TypeError(_0x53fd("0x34"));for(;_;)try{if(d=1,n&&(r=n[_0x53fd(2&f[0]?"0x35":f[0]?"0x2f":"0x2e")])&&!(r=r[_0x53fd("0xc")](n,f[1])).done)return r;switch(n=0,r&&(f=[0,r.value]),f[0]){case 0:case 1:r=f;break;case 4:return _[_0x53fd("0x18")]++,{value:f[1],done:!1};case 5:_[_0x53fd("0x18")]++,n=f[1],f=[0];continue;case 7:f=_[_0x53fd("0x37")][_0x53fd("0x36")](),_[_0x53fd("0x1c")][_0x53fd("0x36")]();continue;default:if(r=_.trys,!(r=r[_0x53fd("0x16")]>0&&r[r[_0x53fd("0x16")]-1])&&(6===f[0]||2===f[0])){_=0;continue}if(3===f[0]&&(!r||f[1]>r[0]&&f[1]<r[3])){_[_0x53fd("0x18")]=f[1];break}if(6===f[0]&&_.label<r[1]){_[_0x53fd("0x18")]=r[1],r=f;break}if(r&&_[_0x53fd("0x18")]<r[2]){_[_0x53fd("0x18")]=r[2],_[_0x53fd("0x37")][_0x53fd("0x1b")](f);break}r[2]&&_[_0x53fd("0x37")][_0x53fd("0x36")](),_.trys[_0x53fd("0x36")]();continue}f=t[_0x53fd("0xc")](x,_)}catch(x){f=[6,x],n=0}finally{d=r=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}var d,n,r,i,_={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(i[Symbol[_0x53fd("0x39")]]=function(){return this}),i};Object[_0x53fd("0xd")](t,"__esModule",{value:!0});var r=f(4),i=f(3);t.isUri=e},function(x,t,f){_0x53fd("0x12"),Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var e=f(11);t[_0x53fd("0x4d")]=e[_0x53fd("0x4e")]({name:_0x53fd("0x4f")})},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0x50"))},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0xb"))},function(x,t){x[_0x53fd("0x0")]=require(_0x53fd("0x51"))},function(x,t,f){_0x53fd("0x12"),Object.defineProperty(t,_0x53fd("0xe"),{value:!0});var e=function(){function x(){}return x}();t[_0x53fd("0x52")]=e},function(x,t,f){var e=this&&this[_0x53fd("0x2d")]||function(x,t,f,e){return new(f||(f=Promise))(function(d,n){function r(x){try{_(e[_0x53fd("0x2e")](x))}catch(x){n(x)}}function i(x){try{_(e[_0x53fd("0x2f")](x))}catch(x){n(x)}}function _(x){x[_0x53fd("0x30")]?d(x.value):new f(function(t){t(x.value)}).then(r,i)}_((e=e.apply(x,t||[]))[_0x53fd("0x2e")]())})},d=this&&this[_0x53fd("0x33")]||function(x,t){function f(x){return function(t){return e([x,t])}}function e(f){if(d)throw new TypeError("Generator is already executing.");for(;_;)try{if(d=1,n&&(r=n[2&f[0]?_0x53fd("0x35"):f[0]?"throw":_0x53fd("0x2e")])&&!(r=r[_0x53fd("0xc")](n,f[1])).done)return r;switch(n=0,r&&(f=[0,r[_0x53fd("0x31")]]),f[0]){case 0:case 1:r=f;break;case 4:return _[_0x53fd("0x18")]++,{value:f[1],done:!1};case 5:_.label++,n=f[1],f=[0];continue;case 7:f=_[_0x53fd("0x37")][_0x53fd("0x36")](),_[_0x53fd("0x1c")][_0x53fd("0x36")]();continue;default:if(r=_.trys,!(r=r.length>0&&r[r[_0x53fd("0x16")]-1])&&(6===f[0]||2===f[0])){_=0;continue}if(3===f[0]&&(!r||f[1]>r[0]&&f[1]<r[3])){_.label=f[1];break}if(6===f[0]&&_[_0x53fd("0x18")]<r[1]){_[_0x53fd("0x18")]=r[1],r=f;break}if(r&&_[_0x53fd("0x18")]<r[2]){_[_0x53fd("0x18")]=r[2],_[_0x53fd("0x37")][_0x53fd("0x1b")](f);break}r[2]&&_[_0x53fd("0x37")][_0x53fd("0x36")](),_.trys[_0x53fd("0x36")]();continue}f=t[_0x53fd("0xc")](x,_)}catch(x){f=[6,x],n=0}finally{d=r=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}var d,n,r,i,_={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},_0x53fd("0x38")==typeof Symbol&&(i[Symbol[_0x53fd("0x39")]]=function(){return this}),i};Object[_0x53fd("0xd")](t,"__esModule",{value:!0});var n=f(4),r=f(1),i=f(3),_=function(){function x(x,t){this[_0x53fd("0x53")]=_0x53fd("0x54"),this.requirements=null,this.exits=x,this[_0x53fd("0x56")]=t}return x[_0x53fd("0x10")][_0x53fd("0x57")]=function(x){if(x.isJoi)return!0;for(var t=0,f=Object[_0x53fd("0x59")](x);t<f[_0x53fd("0x16")];t++)if(!x[f[t]][_0x53fd("0x58")])return!1;return!0},x[_0x53fd("0x10")][_0x53fd("0x5a")]=function(x){var t=this;if(x){for(var f=function(x){var e=t[_0x53fd("0x57")](x);if(e&&!x[_0x53fd("0x58")])return n[_0x53fd("0x5b")]()[_0x53fd("0x59")](x);if(e&&x[_0x53fd("0x58")])return x;for(var d=0,r=Object[_0x53fd("0x59")](x);d<r[_0x53fd("0x16")];d++){var i=r[d],_=x[i];x[i]=f(_)}return n[_0x53fd("0x5b")]().keys(x)},e=0,d=r[_0x53fd("0x59")](x);e<d[_0x53fd("0x16")];e++){var i=d[e],_=x[i];x[i]=f(_)}return x}},x[_0x53fd("0x10")][_0x53fd("0x5c")]=function(x){return e(this,void 0,void 0,function(){var t,f,e,n,_,o,s,a,c,u,h;return d(this,function(d){switch(d[_0x53fd("0x18")]){case 0:if(t=!1,f={},!(e=this.toJoiSchema(this[_0x53fd("0x5d")])))return[2,{passedValidation:!0}];n=r[_0x53fd("0x5e")](e,function(){return{}}),_=0,o=r[_0x53fd("0x59")](e),d[_0x53fd("0x18")]=1;case 1:return _<o[_0x53fd("0x16")]?(s=o[_],a=e[s],[4,i[_0x53fd("0x3c")](x[_0x53fd("0x20")],a)]):[3,4];case 2:c=d[_0x53fd("0x1e")](),u=c[0],h=c[1],u&&(f[s]=u,t=!0),n[s]=h,d[_0x53fd("0x18")]=3;case 3:return _++,[3,1];case 4:return this.validation=f,this[_0x53fd("0x60")]=n,[2,{passedValidation:!t}]}})})},x[_0x53fd("0x10")][_0x53fd("0x61")]=function(x){var t=x[_0x53fd("0x62")];return e(this,void 0,void 0,function(){return d(this,function(x){return[2,t[_0x53fd("0x63")]({})]})})},x}();t[_0x53fd("0x54")]=_},function(x,t,f){_0x53fd("0x12"),Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var e=function(){function x(){}return x}();t.ChannelClient=e},function(x,t,f){_0x53fd("0x12");var e=this&&this[_0x53fd("0x65")]||Object[_0x53fd("0x66")]||function(x){for(var t,f=1,e=arguments[_0x53fd("0x16")];f<e;f++){t=arguments[f];for(var d in t)Object[_0x53fd("0x10")][_0x53fd("0x11")][_0x53fd("0xc")](t,d)&&(x[d]=t[d])}return x},d=this&&this.__awaiter||function(x,t,f,e){return new(f||(f=Promise))(function(d,n){function r(x){try{_(e[_0x53fd("0x2e")](x))}catch(x){n(x)}}function i(x){try{_(e[_0x53fd("0x2f")](x))}catch(x){n(x)}}function _(x){x[_0x53fd("0x30")]?d(x[_0x53fd("0x31")]):new f(function(t){t(x[_0x53fd("0x31")])})[_0x53fd("0x32")](r,i)}_((e=e[_0x53fd("0x1")](x,t||[]))[_0x53fd("0x2e")]())})},n=this&&this[_0x53fd("0x33")]||function(x,t){function f(x){return function(t){return e([x,t])}}function e(f){if(d)throw new TypeError("Generator is already executing.");for(;_;)try{if(d=1,n&&(r=n[2&f[0]?_0x53fd("0x35"):f[0]?_0x53fd("0x2f"):"next"])&&!(r=r[_0x53fd("0xc")](n,f[1])).done)return r;switch(n=0,r&&(f=[0,r[_0x53fd("0x31")]]),f[0]){case 0:case 1:r=f;break;case 4:return _[_0x53fd("0x18")]++,{value:f[1],done:!1};case 5:_[_0x53fd("0x18")]++,n=f[1],f=[0];continue;case 7:f=_.ops.pop(),_[_0x53fd("0x1c")][_0x53fd("0x36")]();continue;default:if(r=_[_0x53fd("0x1c")],!(r=r[_0x53fd("0x16")]>0&&r[r.length-1])&&(6===f[0]||2===f[0])){_=0;continue}if(3===f[0]&&(!r||f[1]>r[0]&&f[1]<r[3])){_[_0x53fd("0x18")]=f[1];break}if(6===f[0]&&_.label<r[1]){_[_0x53fd("0x18")]=r[1],r=f;break}if(r&&_.label<r[2]){_[_0x53fd("0x18")]=r[2],_[_0x53fd("0x37")].push(f);break}r[2]&&_[_0x53fd("0x37")][_0x53fd("0x36")](),_.trys[_0x53fd("0x36")]();continue}f=t[_0x53fd("0xc")](x,_)}catch(x){f=[6,x],n=0}finally{d=r=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}var d,n,r,i,_={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},_0x53fd("0x38")==typeof Symbol&&(i[Symbol[_0x53fd("0x39")]]=function(){return this}),i};Object[_0x53fd("0xd")](t,"__esModule",{value:!0});var r=f(1),i=function(){function x(x){var t=x[_0x53fd("0x20")],f=x[_0x53fd("0x60")],e=x[_0x53fd("0x67")];this.data=t,this[_0x53fd("0x60")]=f,this[_0x53fd("0x67")]=e}return x[_0x53fd("0x68")]=function(x,t){return d(this,void 0,void 0,function(){var f,d,i,_,o,s,a,c;return n(this,function(n){switch(n[_0x53fd("0x18")]){case 0:f=e({},x),d=Object[_0x53fd("0x59")](x)[_0x53fd("0x69")](function(x){return[_0x53fd("0x60"),"flow"][_0x53fd("0x6a")](x)>-1}),i=0,_=d,n[_0x53fd("0x18")]=1;case 1:return i<_.length?(o=_[i],[4,Promise[_0x53fd("0x6b")](x[o])]):[3,6];case 2:return s=n.sent(),r[_0x53fd("0x6c")](s)||Array[_0x53fd("0x2a")](s)?(f[o]=s,[3,5]):[3,3];case 3:return a=f,c=o,[4,s(t)];case 4:a[c]=n[_0x53fd("0x1e")](),n[_0x53fd("0x18")]=5;case 5:return i++,[3,1];case 6:return[2,f]}})})},x}();t[_0x53fd("0x6d")]=i},function(x,t,f){_0x53fd("0x12"),Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var e=function(){function x(x,t){this[_0x53fd("0x53")]=_0x53fd("0x6e"),this[_0x53fd("0x6f")]={},this[_0x53fd("0x55")]=x,this[_0x53fd("0x56")]=t}return x}();t[_0x53fd("0x6e")]=e},function(x,t,f){Object.defineProperty(t,_0x53fd("0xe"),{value:!0});var e=f(20),d=function(){function x(x){this[_0x53fd("0x70")]=x||e.v4()}return x[_0x53fd("0x10")][_0x53fd("0x71")]=function(){return this[_0x53fd("0x70")]},x[_0x53fd("0x10")][_0x53fd("0x72")]=function(){return this.payload},x}();t[_0x53fd("0x73")]=d},function(x,t){x.exports=require(_0x53fd("0x74"))},function(x,t,f){Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var e=f(22);t[_0x53fd("0x75")]={Sorun:e[_0x53fd("0x76")]}},function(x,t,f){_0x53fd("0x12");var e=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,t){x[_0x53fd("0x79")]=t}||function(x,t){for(var f in t)t[_0x53fd("0x11")](f)&&(x[f]=t[f])};return function(t,f){function e(){this[_0x53fd("0x7a")]=t}x(t,f),t[_0x53fd("0x10")]=null===f?Object[_0x53fd("0x7b")](f):(e[_0x53fd("0x10")]=f[_0x53fd("0x10")],new e)}}(),d=this&&this.__assign||Object[_0x53fd("0x66")]||function(x){for(var t,f=1,e=arguments[_0x53fd("0x16")];f<e;f++){t=arguments[f];for(var d in t)Object[_0x53fd("0x10")][_0x53fd("0x11")].call(t,d)&&(x[d]=t[d])}return x},n=this&&this[_0x53fd("0x2d")]||function(x,t,f,e){return new(f||(f=Promise))(function(d,n){function r(x){try{_(e.next(x))}catch(x){n(x)}}function i(x){try{_(e.throw(x))}catch(x){n(x)}}function _(x){x[_0x53fd("0x30")]?d(x[_0x53fd("0x31")]):new f(function(t){t(x[_0x53fd("0x31")])})[_0x53fd("0x32")](r,i)}_((e=e[_0x53fd("0x1")](x,t||[]))[_0x53fd("0x2e")]())})},r=this&&this[_0x53fd("0x33")]||function(x,t){function f(x){return function(t){return e([x,t])}}function e(f){if(d)throw new TypeError(_0x53fd("0x34"));for(;_;)try{if(d=1,n&&(r=n[2&f[0]?"return":_0x53fd(f[0]?"0x2f":"0x2e")])&&!(r=r[_0x53fd("0xc")](n,f[1]))[_0x53fd("0x30")])return r;switch(n=0,r&&(f=[0,r.value]),f[0]){case 0:case 1:r=f;break;case 4:return _.label++,{value:f[1],done:!1};case 5:_[_0x53fd("0x18")]++,n=f[1],f=[0];continue;case 7:f=_[_0x53fd("0x37")][_0x53fd("0x36")](),_[_0x53fd("0x1c")].pop();continue;default:if(r=_[_0x53fd("0x1c")],!(r=r[_0x53fd("0x16")]>0&&r[r[_0x53fd("0x16")]-1])&&(6===f[0]||2===f[0])){_=0;continue}if(3===f[0]&&(!r||f[1]>r[0]&&f[1]<r[3])){_[_0x53fd("0x18")]=f[1];break}if(6===f[0]&&_[_0x53fd("0x18")]<r[1]){_[_0x53fd("0x18")]=r[1],r=f;break}if(r&&_[_0x53fd("0x18")]<r[2]){_[_0x53fd("0x18")]=r[2],_[_0x53fd("0x37")][_0x53fd("0x1b")](f);break}r[2]&&_[_0x53fd("0x37")][_0x53fd("0x36")](),_[_0x53fd("0x1c")][_0x53fd("0x36")]();continue}f=t.call(x,_)}catch(x){f=[6,x],n=0}finally{d=r=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}var d,n,r,i,_={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},_0x53fd("0x38")==typeof Symbol&&(i[Symbol[_0x53fd("0x39")]]=function(){return this}),i};Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var i=f(5),_=f(1),o=f(32);f(33),o[_0x53fd("0x7c")]("tr");var s=f(34),a=f(0),c=f(14),u=f(3),h=f(9),l=function(x){function t(t){var f=t.message,e=t[_0x53fd("0x7e")],d=t.conversation,n=x[_0x53fd("0xc")](this)||this;return n[_0x53fd("0x7e")]=e,n[_0x53fd("0x7f")]=d,n[_0x53fd("0x7d")]=f,n.message[_0x53fd("0x80")]||(n[_0x53fd("0x7d")][_0x53fd("0x80")]="TEXT"),u[_0x53fd("0xb")][_0x53fd("0x81")](_0x53fd("0x82"))(_0x53fd("0x83"),{message:f,client:e,conversation:d}),n}return e(t,x),t.fromMessage=function(x){switch(u[_0x53fd("0xb")][_0x53fd("0x81")](_0x53fd("0x85"))(_0x53fd("0x86"),x),x.payloadType){case _0x53fd("0x24"):return u[_0x53fd("0xb")].verbose(_0x53fd("0x85"))("Using text message type"),{payload:x.payload[_0x53fd("0x71")](),type:_0x53fd("0x88")};case _0x53fd("0x89"):u[_0x53fd("0xb")][_0x53fd("0x81")](_0x53fd("0x85"))(_0x53fd("0x8a"));var f=x,e=f.toCard(),d=u[_0x53fd("0x3f")](e),n=new(a[_0x53fd("0x8b")])({payload:d,conversation:f[_0x53fd("0x7f")],type:"self",channel:_0x53fd("0x8c"),channelData:f[_0x53fd("0x8d")],platform:f.platform,user:f[_0x53fd("0x8e")]});return u[_0x53fd("0xb")][_0x53fd("0x81")](_0x53fd("0x85"))(_0x53fd("0x8f"),n),t[_0x53fd("0x90")](n);case _0x53fd("0x91"):return u[_0x53fd("0xb")].verbose(_0x53fd("0x85"))(_0x53fd("0x92")),t[_0x53fd("0x90")](x);default:throw new Error("Sorun - This message payload type is no compatible with Sorun")}},t[_0x53fd("0x90")]=function(x){var t=x,f=t[_0x53fd("0x70")][_0x53fd("0x93")](function(x){if(x[_0x53fd("0x94")].length>1)throw new Error(_0x53fd("0x95"));if(0===x.elements[_0x53fd("0x16")])throw new Error("Sorun - Card does not have a body");var t=x[_0x53fd("0x94")][0],f=t.buttons[_0x53fd("0x93")](function(x){switch(x[_0x53fd("0x80")]){case _0x53fd("0x7d"):return{type:"T",text:x[_0x53fd("0x18")][_0x53fd("0x21")](/"/g,""),action:x[_0x53fd("0x7d")].replace(/"/g,"")};case _0x53fd("0x97"):var t=x.title;return{type:"L",text:t?t[_0x53fd("0x21")](/"/g,""):void 0,action:x.url};default:throw new Error(_0x53fd("0x98"))}}),e=t.text,d=t[_0x53fd("0x23")],n=e?e[_0x53fd("0x21")](/"/g,""):void 0,r=d?d[_0x53fd("0x21")](/"/g,""):void 0;return{image:t[_0x53fd("0x99")],text:n,title:r,buttons:f}});return{payload:JSON[_0x53fd("0x9a")](f),type:_0x53fd("0x9b")}},t[_0x53fd("0x10")][_0x53fd("0x9c")]=function(){try{return this.message[_0x53fd("0x9d")]?o.tz(this[_0x53fd("0x7d")][_0x53fd("0x9d")],"YYYY-MM-DD-HH-mm",_0x53fd("0x9f"))[_0x53fd("0x9e")]():o().toDate()}catch(x){throw new Error(_0x53fd("0xa0"))}},t.prototype[_0x53fd("0xa1")]=function(){return n(this,void 0,void 0,function(){return r(this,function(x){switch(x[_0x53fd("0x18")]){case 0:return _[_0x53fd("0x6c")](this[_0x53fd("0x7d")][_0x53fd("0x70")])?[4,h[_0x53fd("0x19")](this[_0x53fd("0x7d")].payload)]:[3,2];case 1:return x[_0x53fd("0x1e")]()?[2,_0x53fd("0x89")]:[2,_0x53fd("0x24")];case 2:if(this[_0x53fd("0x7d")][_0x53fd("0x70")][_0x53fd("0x11")]("x")&&this.message[_0x53fd("0x70")][_0x53fd("0x11")]("y"))return[2,_0x53fd("0xa2")];if(_0x53fd("0x9b")===this[_0x53fd("0x7d")][_0x53fd("0x80")])return[2,_0x53fd("0x91")];x[_0x53fd("0x18")]=3;case 3:throw new Error(_0x53fd("0xa3"))}})})},t[_0x53fd("0x10")].getMessageType=function(){if(_0x53fd("0xa5")===this[_0x53fd("0x7d")][_0x53fd("0x80")])return _0x53fd("0x5");if(_0x53fd("0x88")===this[_0x53fd("0x7d")].type&&this[_0x53fd("0x7d")][_0x53fd("0xa6")])return _0x53fd("0xa7");if("TEXT"===this[_0x53fd("0x7d")].type&&!this.message[_0x53fd("0xa6")])return"user";throw new Error(_0x53fd("0xa8"))},t[_0x53fd("0x10")][_0x53fd("0xa9")]=function(){if(this[_0x53fd("0x7d")][_0x53fd("0xaa")],0){if(_0x53fd("0xab")===this[_0x53fd("0x7d")][_0x53fd("0xaa")])return _0x53fd("0xac");if(_0x53fd("0xad")===this[_0x53fd("0x7d")].platform)return"ios";throw new Error(_0x53fd("0xae"))}return"web"},t[_0x53fd("0x10")][_0x53fd("0xaf")]=function(x,t){return n(this,void 0,void 0,function(){var f,e,d,n;return r(this,function(r){switch(r[_0x53fd("0x18")]){case 0:return f={id:this[_0x53fd("0x7d")].id,userID:this[_0x53fd("0x7d")][_0x53fd("0xb0")],uniqueID:this[_0x53fd("0x7d")][_0x53fd("0xb1")]},[4,this[_0x53fd("0xa1")]()];case 1:switch(r[_0x53fd("0x1e")]()){case _0x53fd("0x24"):return[2,new(a[_0x53fd("0xb2")])({payload:this[_0x53fd("0x7d")][_0x53fd("0x70")][_0x53fd("0x71")](),conversation:x,type:this[_0x53fd("0xa4")](),channelData:f,channel:_0x53fd("0x8c"),date:this[_0x53fd("0x9c")](),platform:this[_0x53fd("0xa9")](),user:t})];case _0x53fd("0x89"):return[2,new(a[_0x53fd("0xb3")])({payload:this.message[_0x53fd("0x70")],conversation:x,type:this[_0x53fd("0xa4")](),channelData:f,channel:_0x53fd("0x8c"),date:this[_0x53fd("0x9c")](),platform:this[_0x53fd("0xa9")](),user:t})];case _0x53fd("0x91"):return e=this[_0x53fd("0x7d")].payload,d=e.map(function(x){var t=x[_0x53fd("0x96")][_0x53fd("0x93")](function(x){switch(x[_0x53fd("0x80")]){case"L":return{type:_0x53fd("0x97"),url:x[_0x53fd("0xb4")],title:x[_0x53fd("0x24")]};case"T":return{type:_0x53fd("0x7d"),message:x[_0x53fd("0xb4")],label:x[_0x53fd("0x24")]};default:throw new Error(_0x53fd("0xb5"))}});return{title:x[_0x53fd("0x23")],imageUrl:x[_0x53fd("0xb6")],text:x.text,buttons:t}}),n={elements:d},[2,new a.CardMessage({payload:[n],conversation:x,type:this.getMessageType(),channelData:f,channel:_0x53fd("0x8c"),date:this[_0x53fd("0x9c")](),platform:this[_0x53fd("0xa9")](),user:t})];default:throw new Error("Sorun - Unknown message type")}return[2]}})})},t}(c[_0x53fd("0x52")]);t[_0x53fd("0xb7")]=l;var v=function(x){function t(t){var f=t[_0x53fd("0xb8")],e=t[_0x53fd("0xb9")],d=t[_0x53fd("0x89")],n=t[_0x53fd("0xba")],r=t.initialContext,i=t.companyID,_=t[_0x53fd("0xbd")],o=x.call(this)||this;return o[_0x53fd("0x53")]="Sorun",o[_0x53fd("0xb8")]=f,o[_0x53fd("0xba")]=n||"development",o[_0x53fd("0xb9")]=e,o[_0x53fd("0xbb")]=r,o[_0x53fd("0xbc")]=i,o[_0x53fd("0xbd")]=_,o[_0x53fd("0x89")]=d||_0x53fd(o[_0x53fd("0xbe")]()?"0xbf":"0xc0"),o}return e(t,x),t.getConversationIdentifier=function(x){return x.channelData.id},t[_0x53fd("0x10")].isProduction=function(){return _0x53fd("0xc2")===this[_0x53fd("0xba")]},t.prototype[_0x53fd("0xc3")]=function(x){return x===this[_0x53fd("0xb9")]},t[_0x53fd("0x10")][_0x53fd("0xc4")]=function(x){return n(this,void 0,void 0,function(){var t;return r(this,function(f){return t=x,[2,new(a[_0x53fd("0xc5")])({firstName:t[_0x53fd("0x7e")][_0x53fd("0xc6")],lastName:t[_0x53fd("0x7e")][_0x53fd("0xc7")],phoneNumber:t[_0x53fd("0x7e")][_0x53fd("0xc8")],email:t.client[_0x53fd("0xc9")],accessToken:t[_0x53fd("0x7f")][_0x53fd("0xca")]&&t[_0x53fd("0x7f")][_0x53fd("0xca")].replace(/ /g,"+")})]})})},t[_0x53fd("0x10")][_0x53fd("0xcb")]=function(x,t){return n(this,void 0,void 0,function(){return r(this,function(f){switch(f[_0x53fd("0x18")]){case 0:return[4,x[_0x53fd("0xcc")](t)];case 1:return[2,f[_0x53fd("0x1e")]()]}})})},t.prototype[_0x53fd("0xcd")]=function(x,t){return n(this,void 0,void 0,function(){var f,e;return r(this,function(d){switch(d[_0x53fd("0x18")]){case 0:return f={token:this[_0x53fd("0xb8")],ended:!0,id:t.channelData.id},[4,i[_0x53fd("0xf")][_0x53fd("0xce")](this.url+_0x53fd("0xcf")+s[_0x53fd("0x9a")](f),{timeout:this[_0x53fd("0xbd")]})];case 1:if(e=d[_0x53fd("0x1e")](),1!==e[_0x53fd("0x20")].result)throw new Error("Sorun - Error while ending conversation");return[4,x[_0x53fd("0xd0")](t)];case 2:return d[_0x53fd("0x1e")](),[2,e.data]}})})},t[_0x53fd("0x10")].receiveMessage=function(x,t,f){return n(this,void 0,void 0,function(){var e,d,n,i,_;return r(this,function(r){switch(r[_0x53fd("0x18")]){case 0:if(!f[_0x53fd("0xb9")])throw new Error(_0x53fd("0xd2"));if(!(e=this.checkIncomingHookToken(f[_0x53fd("0xb9")])))return[3,4];if(d=new l(t),[_0x53fd("0x88"),_0x53fd("0x9b")][_0x53fd("0x6a")](d[_0x53fd("0x7d")][_0x53fd("0x80")])<0)throw new Error("Sorun - Only TEXT or CARD messages can be handled");return[4,x[_0x53fd("0xd3")](_0x53fd("0x8c"),t[_0x53fd("0x7d")][_0x53fd("0xd4")])];case 1:return n=r[_0x53fd("0x1e")](),[4,this[_0x53fd("0xc4")](d)];case 2:return i=r[_0x53fd("0x1e")](),_=n||new(a[_0x53fd("0xd5")])({channel:_0x53fd("0x8c"),context:this[_0x53fd("0xbb")],channelData:{id:t[_0x53fd("0x7d")][_0x53fd("0xd4")]}}),[4,d[_0x53fd("0xaf")](_,i)];case 3:return[2,r[_0x53fd("0x1e")]()];case 4:throw new Error("Sorun - Incoming hook token is invalid")}})})},t[_0x53fd("0x10")][_0x53fd("0xd6")]=function(x){return n(this,void 0,void 0,function(){var t,f,e,d,n,_,o;return r(this,function(r){switch(r.label){case 0:if(r[_0x53fd("0x1c")].push([0,2,,3]),!(t=x[_0x53fd("0x7f")].channelData.id))throw new Error(_0x53fd("0xd7"));return f=l[_0x53fd("0x84")](x),e=f.payload,d=f[_0x53fd("0x80")],n={token:this[_0x53fd("0xb8")],conversation:t,type:d,payload:e},u[_0x53fd("0xb")][_0x53fd("0x7")](_0x53fd("0xd8"))(_0x53fd("0xd9"),n),u[_0x53fd("0xb")][_0x53fd("0x7")](_0x53fd("0xd8"))(_0x53fd("0xda"),s[_0x53fd("0x9a")](n)),[4,i.default[_0x53fd("0xdb")](this[_0x53fd("0x89")]+"/Message?"+s[_0x53fd("0x9a")](n),{},{timeout:this[_0x53fd("0xbd")]})];case 1:if(_=r.sent(),0===_[_0x53fd("0x20")][_0x53fd("0x62")])throw _.data[_0x53fd("0x8")];return[2,{result:1,content:1}];case 2:throw o=r.sent(),u[_0x53fd("0xb")][_0x53fd("0x7")](_0x53fd("0xd8"))(o),o;case 3:return[2]}})})},t[_0x53fd("0x10")][_0x53fd("0xdc")]=function(x,t){return n(this,void 0,void 0,function(){var f;return r(this,function(e){switch(e[_0x53fd("0x18")]){case 0:return f=new(a[_0x53fd("0xb2")])({payload:t,conversation:x[_0x53fd("0x7f")],type:_0x53fd("0xdd"),channel:_0x53fd("0x8c"),channelData:x[_0x53fd("0x8d")],platform:x[_0x53fd("0xaa")],user:x[_0x53fd("0x8e")]}),[4,this[_0x53fd("0xd6")](f)];case 1:return[2,e[_0x53fd("0x1e")]()]}})})},t[_0x53fd("0x10")].urlReply=function(x,t,f){return void 0===f&&(f={discoverUrl:!0}),n(this,void 0,void 0,function(){var e,n,i;return r(this,function(r){switch(r[_0x53fd("0x18")]){case 0:return e=t,!f.discoverUrl||t.description||t.title?[3,2]:[4,u[_0x53fd("0x3b")](t[_0x53fd("0x89")])];case 1:n=r[_0x53fd("0x1e")](),e=d({},n,t),r[_0x53fd("0x18")]=2;case 2:return i=new(a[_0x53fd("0xb3")])({payload:e,conversation:x.conversation,type:_0x53fd("0xdd"),channel:_0x53fd("0x8c"),channelData:x[_0x53fd("0x8d")],platform:x[_0x53fd("0xaa")],user:x[_0x53fd("0x8e")]}),[4,this[_0x53fd("0xd6")](i)];case 3:return[2,r[_0x53fd("0x1e")]()]}})})},t[_0x53fd("0x10")][_0x53fd("0xe0")]=function(x,t){return n(this,void 0,void 0,function(){var f,e;return r(this,function(d){switch(d[_0x53fd("0x18")]){case 0:return f=u.arrayify(t),e=new(a[_0x53fd("0x8b")])({payload:f,conversation:x[_0x53fd("0x7f")],type:"self",channel:_0x53fd("0x8c"),channelData:x[_0x53fd("0x8d")],platform:x[_0x53fd("0xaa")],user:x[_0x53fd("0x8e")]}),[4,this[_0x53fd("0xd6")](e)];case 1:return[2,d[_0x53fd("0x1e")]()]}})})},t[_0x53fd("0x10")].getActiveAgents=function(){return n(this,void 0,void 0,function(){var x,t,f,e;return r(this,function(d){switch(d.label){case 0:return x={token:this[_0x53fd("0xb8")]},[4,i.default[_0x53fd("0x1d")](this.url+_0x53fd("0xe2")+s[_0x53fd("0x9a")](x),{timeout:this[_0x53fd("0xbd")]})];case 1:if(t=d[_0x53fd("0x1e")](),1!==t[_0x53fd("0x20")][_0x53fd("0x62")]||!t[_0x53fd("0x20")][_0x53fd("0xe3")])throw new Error(_0x53fd("0xe4"));return f=t[_0x53fd("0x20")][_0x53fd("0xe3")],e=o()[_0x53fd("0xe5")](5,_0x53fd("0xe6")),[2,f[_0x53fd("0x69")](function(x){return x[_0x53fd("0xe7")]&&!x[_0x53fd("0xe8")]&&o.tz(x[_0x53fd("0xea")],_0x53fd("0xeb"),_0x53fd("0x9f"))[_0x53fd("0xe9")](e)})]}})})},t.prototype.getPoolData=function(x){return n(this,void 0,void 0,function(){var t,f,e,d,n,o,a;return r(this,function(r){switch(r[_0x53fd("0x18")]){case 0:return t={token:this.apiKey,id:x.channelData.id},[4,i[_0x53fd("0xf")][_0x53fd("0x1d")](this[_0x53fd("0x89")]+_0x53fd("0xcf")+s.stringify(t),{timeout:this[_0x53fd("0xbd")]})];case 1:if(f=r[_0x53fd("0x1e")](),1!==f[_0x53fd("0x20")][_0x53fd("0x62")]||!f.data[_0x53fd("0xe3")])throw new Error(_0x53fd("0xec"));return e={token:this[_0x53fd("0xb8")]},[4,i[_0x53fd("0xf")][_0x53fd("0x1d")](this[_0x53fd("0x89")]+_0x53fd("0xed")+s.stringify(e),{timeout:this[_0x53fd("0xbd")]})];case 2:if(d=r.sent(),1!==d[_0x53fd("0x20")].result||!d[_0x53fd("0x20")][_0x53fd("0xe3")])throw new Error(_0x53fd("0xec"));if(!(n=f[_0x53fd("0x20")][_0x53fd("0xe3")][_0x53fd("0x16")]>=0?f[_0x53fd("0x20")][_0x53fd("0xe3")][0][_0x53fd("0xee")]:null))throw new Error(_0x53fd("0xef"));if(o=d[_0x53fd("0x20")][_0x53fd("0xe3")],!(a=_.find(o,{id:n})))throw new Error("Sorun - Pool not found");return[2,a]}})})},t[_0x53fd("0x10")][_0x53fd("0xf1")]=function(x){return n(this,void 0,void 0,function(){var t,f,e;return r(this,function(d){switch(d[_0x53fd("0x18")]){case 0:return t={company:this[_0x53fd("0xbc")]},[4,i[_0x53fd("0xf")].get(this[_0x53fd("0x89")]+_0x53fd("0xf2")+s[_0x53fd("0x9a")](t),{timeout:this[_0x53fd("0xbd")]})];case 1:if(f=d[_0x53fd("0x1e")](),1!==f[_0x53fd("0x20")][_0x53fd("0x62")]||!f.data[_0x53fd("0xe3")])throw new Error("Sorun - Error while getting pool information");if(!(e=_[_0x53fd("0xf0")](f[_0x53fd("0x20")][_0x53fd("0xe3")],{id:x})))throw new Error(_0x53fd("0xef"));return[2,e]}})})},t[_0x53fd("0x10")][_0x53fd("0xf3")]=function(x,t,f){return n(this,void 0,void 0,function(){var e,d;return r(this,function(n){switch(n[_0x53fd("0x18")]){case 0:return e={token:this[_0x53fd("0xb8")],id:t[_0x53fd("0x8d")].id,currentAgent:f},u[_0x53fd("0xb")].info(_0x53fd("0xf4"))(this[_0x53fd("0x89")]+"/Conversation?"+s[_0x53fd("0x9a")](e)),[4,i.default[_0x53fd("0xce")](this[_0x53fd("0x89")]+"/Conversation?"+s[_0x53fd("0x9a")](e),{timeout:this[_0x53fd("0xbd")]})];case 1:return d=n[_0x53fd("0x1e")](),[4,x[_0x53fd("0xd0")](t)];case 2:if(n[_0x53fd("0x1e")](),1!==d[_0x53fd("0x20")][_0x53fd("0x62")])throw new Error(_0x53fd("0xf5"));return[2,d.data]}})})},t[_0x53fd("0x10")][_0x53fd("0xf6")]=function(x,t){return n(this,void 0,void 0,function(){var f,e;return r(this,function(d){switch(d[_0x53fd("0x18")]){case 0:return f={token:this[_0x53fd("0xb8")],id:x[_0x53fd("0x8d")].id,pool:t},u.debug[_0x53fd("0x7")](_0x53fd("0xf7"))(this[_0x53fd("0x89")]+_0x53fd("0xcf")+s[_0x53fd("0x9a")](f)),[4,i.default[_0x53fd("0xce")](this.url+"/Conversation?"+s[_0x53fd("0x9a")](f))];case 1:if(e=d[_0x53fd("0x1e")](),1!==e.data[_0x53fd("0x62")])throw new Error("Sorun - Error while changing conversation pool");return[2,e[_0x53fd("0x20")]]}})})},t.prototype[_0x53fd("0xf8")]=function(x){return n(this,void 0,void 0,function(){var t,f;return r(this,function(e){switch(e[_0x53fd("0x18")]){case 0:return t={token:this[_0x53fd("0xb8")],id:x[_0x53fd("0x8d")].id,setHold:!0},u[_0x53fd("0xb")].info(_0x53fd("0xf9"))(this[_0x53fd("0x89")]+_0x53fd("0xcf")+s[_0x53fd("0x9a")](t)),[4,i[_0x53fd("0xf")][_0x53fd("0xce")](this[_0x53fd("0x89")]+_0x53fd("0xcf")+s[_0x53fd("0x9a")](t))];case 1:if(f=e[_0x53fd("0x1e")](),1!==f[_0x53fd("0x20")][_0x53fd("0x62")])throw new Error(_0x53fd("0xfa"));return[2,f[_0x53fd("0x20")]]}})})},t[_0x53fd("0x10")].unHold=function(x){return n(this,void 0,void 0,function(){var t,f;return r(this,function(e){switch(e[_0x53fd("0x18")]){case 0:return t={token:this[_0x53fd("0xb8")],id:x[_0x53fd("0x8d")].id},u[_0x53fd("0xb")].info("Sorun:unHold")(this[_0x53fd("0x89")]+_0x53fd("0xcf")+s.stringify(t)),[4,i[_0x53fd("0xf")][_0x53fd("0xce")](this[_0x53fd("0x89")]+"/Conversation?"+s[_0x53fd("0x9a")](t),{timeout:this[_0x53fd("0xbd")]})];case 1:if(f=e[_0x53fd("0x1e")](),1!==f[_0x53fd("0x20")][_0x53fd("0x62")])throw new Error(_0x53fd("0xfc"));return[2,f.data]}})})},t[_0x53fd("0x10")][_0x53fd("0xfd")]=function(){return n(this,void 0,void 0,function(){var x,t;return r(this,function(f){switch(f[_0x53fd("0x18")]){case 0:return x={company:this.companyID},[4,i[_0x53fd("0xf")][_0x53fd("0x1d")](this.url+_0x53fd("0xfe")+s.stringify(x),{timeout:this[_0x53fd("0xbd")]})];case 1:if(t=f[_0x53fd("0x1e")](),1!==t[_0x53fd("0x20")].result)throw new Error("Sorun - Error while getting company information");if(t[_0x53fd("0x20")].content&&0===t[_0x53fd("0x20")][_0x53fd("0xe3")][_0x53fd("0x16")])throw new Error(_0x53fd("0xff"));return[2,t[_0x53fd("0x20")].content[0]]}})})},t.prototype[_0x53fd("0x100")]=function(x){return n(this,void 0,void 0,function(){var t;return r(this,function(f){switch(f[_0x53fd("0x18")]){case 0:return[4,this[_0x53fd("0x101")](x)];case 1:return t=f[_0x53fd("0x1e")](),[2,!t.isOutOfOffice]}})})},t[_0x53fd("0x10")][_0x53fd("0x103")]=function(x){return n(this,void 0,void 0,function(){var t;return r(this,function(f){switch(f[_0x53fd("0x18")]){case 0:return[4,this[_0x53fd("0xf1")](x)];case 1:return t=f[_0x53fd("0x1e")](),[2,!t[_0x53fd("0x102")]]}})})},t.prototype.getOpenConversations=function(){return n(this,void 0,void 0,function(){var x,t;return r(this,function(f){switch(f[_0x53fd("0x18")]){case 0:return x={token:this[_0x53fd("0xb8")]},[4,i[_0x53fd("0xf")][_0x53fd("0x1d")](this[_0x53fd("0x89")]+_0x53fd("0xcf")+s.stringify(x),{timeout:this[_0x53fd("0xbd")]})];case 1:if(t=f[_0x53fd("0x1e")](),1!==t[_0x53fd("0x20")][_0x53fd("0x62")]||!t[_0x53fd("0x20")].content)throw new Error(_0x53fd("0xec"));return[2,t[_0x53fd("0x20")][_0x53fd("0xe3")]]}})})},t.prototype.findMostAvailableAgent=function(x){return n(this,void 0,void 0,function(){var t,f,e,n,i,o,s,a,c,u,h,l;return r(this,function(r){switch(r[_0x53fd("0x18")]){case 0:return i=(n=Promise).all,o=[this[_0x53fd("0x104")]()],[4,this[_0x53fd("0xe1")]()];case 1:return[4,i[_0x53fd("0x1")](n,[o[_0x53fd("0x106")]([r[_0x53fd("0x1e")]()])])];case 2:return t=r[_0x53fd("0x1e")](),f=t[0],e=t[1],s=_.fromPairs(e.map(function(x){return[x.id,0]})),a=_.mapValues(_[_0x53fd("0x107")](f[_0x53fd("0x69")](function(x){return e[_0x53fd("0x93")](function(x){return x.id}).indexOf(x.currentAgent)>-1}),_0x53fd("0x108")),function(x){return x[_0x53fd("0x16")]}),c=d({},s,a),u=_[_0x53fd("0x2b")](c),h=u[_0x53fd("0x69")](function(t){return t[1]<x}),h[_0x53fd("0x16")]<=0?[2,null]:(l=_[_0x53fd("0x109")](h,function(x){return x[1]},[_0x53fd("0x10a")]),[2,l[0][0]])}})})},t}(a[_0x53fd("0x64")]);t.SorunClient=v},function(x,t,f){_0x53fd("0x12");var e=this&&this[_0x53fd("0x77")]||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,t){x[_0x53fd("0x79")]=t}||function(x,t){for(var f in t)t[_0x53fd("0x11")](f)&&(x[f]=t[f])};return function(t,f){function e(){this[_0x53fd("0x7a")]=t}x(t,f),t[_0x53fd("0x10")]=null===f?Object[_0x53fd("0x7b")](f):(e[_0x53fd("0x10")]=f[_0x53fd("0x10")],new e)}}();Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var d=f(0),n=function(x){function t(t){var f=t[_0x53fd("0x70")],e=t[_0x53fd("0x7f")],d=t[_0x53fd("0x8e")],n=t.type,r=t.platform,i=t[_0x53fd("0x10b")],_=t.channelData,o=t[_0x53fd("0x10c")],s=t.id;return x[_0x53fd("0xc")](this,{payload:f,conversation:e,user:d,channel:i,platform:r,payloadType:_0x53fd("0x91"),type:n,channelData:_,date:o,id:s})||this}return e(t,x),t}(d[_0x53fd("0x10d")]);t[_0x53fd("0x8b")]=n},function(x,t,f){_0x53fd("0x12"),Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var e=f(1),d=f(6),n=f(0),r=function(){function x(x){var t=x[_0x53fd("0x10b")],f=x.context,r=x[_0x53fd("0x8d")],i=void 0===r?{}:r,_=x[_0x53fd("0x10f")],o=void 0===_?_0x53fd("0x110"):_,s=x[_0x53fd("0x111")],a=void 0===s?d().toDate():s,c=x[_0x53fd("0x112")],u=x.id;this.startDate=a,this[_0x53fd("0x112")]=c,this[_0x53fd("0x10e")]=f||new(n[_0x53fd("0x6d")])({}),this[_0x53fd("0x10f")]=o,this[_0x53fd("0x10b")]=t,this[_0x53fd("0x8d")]=i,u&&e[_0x53fd("0x6c")](u)?this.id=new(n[_0x53fd("0x73")])(u):u&&!e[_0x53fd("0x6c")](u)?this.id=u:this.id=new n.GUID}return x[_0x53fd("0x10")][_0x53fd("0x113")]=function(){return JSON.stringify(this)},x}();r[_0x53fd("0x114")]=function(x){var t=JSON.parse(x);return new r(t)},t.Conversation=r},function(x,t,f){_0x53fd("0x12"),Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var e=f(6),d=f(0),n=function(){function x(x){var t=x[_0x53fd("0x70")],f=x[_0x53fd("0x7f")],n=x[_0x53fd("0x8e")],r=x[_0x53fd("0xaa")],i=x[_0x53fd("0x87")],_=x[_0x53fd("0x80")],o=x.channel,s=x[_0x53fd("0x8d")],a=void 0===s?{}:s,c=x[_0x53fd("0x10c")],u=void 0===c?e()[_0x53fd("0x9e")]():c,h=x.id,l=void 0===h?new(d[_0x53fd("0x73")]):h;this.id=l,this[_0x53fd("0x7f")]=f,this[_0x53fd("0x8e")]=n,this[_0x53fd("0x87")]=i,this[_0x53fd("0x70")]=t,this[_0x53fd("0xaa")]=r,this[_0x53fd("0x10c")]=u,this[_0x53fd("0x80")]=_,this.channel=o,this[_0x53fd("0x8d")]=a}return x[_0x53fd("0x10")].isMobile=function(){return"android"===this[_0x53fd("0xaa")]||_0x53fd("0x117")===this[_0x53fd("0xaa")]},x[_0x53fd("0x10")][_0x53fd("0x118")]=function(){return JSON.stringify({id:this.id,payloadType:this[_0x53fd("0x87")],payload:this[_0x53fd("0x70")],date:this[_0x53fd("0x10c")],type:this[_0x53fd("0x80")],channelData:this[_0x53fd("0x8d")]})},x[_0x53fd("0x10")].fromContext=function(t){return new x(JSON.parse(t))},x}();t[_0x53fd("0x10d")]=n},function(x,t,f){_0x53fd("0x12");var e=this&&this[_0x53fd("0x77")]||function(){var x=Object[_0x53fd("0x78")]||{__proto__:[]}instanceof Array&&function(x,t){x[_0x53fd("0x79")]=t}||function(x,t){for(var f in t)t[_0x53fd("0x11")](f)&&(x[f]=t[f])};return function(t,f){function e(){this[_0x53fd("0x7a")]=t}x(t,f),t[_0x53fd("0x10")]=null===f?Object.create(f):(e[_0x53fd("0x10")]=f[_0x53fd("0x10")],new e)}}();Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var d=f(0),n=function(x){function t(t){var f=t[_0x53fd("0x70")],e=t.conversation,d=t[_0x53fd("0x8e")],n=t[_0x53fd("0x80")],r=t[_0x53fd("0xaa")],i=t.channel,_=t[_0x53fd("0x8d")],o=t.date,s=t.id;return x[_0x53fd("0xc")](this,{payload:f,conversation:e,channel:i,user:d,platform:r,payloadType:_0x53fd("0x24"),type:n,channelData:_,date:o,id:s})||this}return e(t,x),t}(d[_0x53fd("0x10d")]);t[_0x53fd("0xb2")]=n},function(x,t,f){_0x53fd("0x12");var e=this&&this.__extends||function(){var x=Object[_0x53fd("0x78")]||{__proto__:[]}instanceof Array&&function(x,t){x.__proto__=t}||function(x,t){for(var f in t)t[_0x53fd("0x11")](f)&&(x[f]=t[f])};return function(t,f){function e(){this[_0x53fd("0x7a")]=t}x(t,f),t[_0x53fd("0x10")]=null===f?Object[_0x53fd("0x7b")](f):(e[_0x53fd("0x10")]=f[_0x53fd("0x10")],new e)}}();Object.defineProperty(t,_0x53fd("0xe"),{value:!0});var d=f(0),n=function(x){function t(t){var f=t[_0x53fd("0x7f")],e=t[_0x53fd("0x10c")],d=t.user,n=t.id,r=t[_0x53fd("0x70")],i=t[_0x53fd("0xaa")],_=t.channel;return x[_0x53fd("0xc")](this,{payload:r,conversation:f,user:d,channel:_,platform:i,payloadType:"context",type:_0x53fd("0x11a"),date:e,id:n})||this}return e(t,x),t}(d[_0x53fd("0x10d")]);t[_0x53fd("0x11b")]=n},function(x,t,f){var e=this&&this[_0x53fd("0x77")]||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,t){x[_0x53fd("0x79")]=t}||function(x,t){for(var f in t)t[_0x53fd("0x11")](f)&&(x[f]=t[f])};return function(t,f){function e(){this[_0x53fd("0x7a")]=t}x(t,f),t[_0x53fd("0x10")]=null===f?Object[_0x53fd("0x7b")](f):(e[_0x53fd("0x10")]=f[_0x53fd("0x10")],new e)}}();Object[_0x53fd("0xd")](t,_0x53fd("0xe"),{value:!0});var d=f(0),n=function(x){function t(t){var f=t[_0x53fd("0x70")],e=t[_0x53fd("0x7f")],d=t[_0x53fd("0x80")],n=t[_0x53fd("0x8e")],r=t[_0x53fd("0xaa")],i=t[_0x53fd("0x10b")],_=t[_0x53fd("0x8d")],o=t[_0x53fd("0x10c")],s=t.id;return x[_0x53fd("0xc")](this,{payload:f,conversation:e,channel:i,user:n,platform:r,payloadType:_0x53fd("0x89"),type:d,channelData:_,date:o,id:s})||this}return e(t,x),t[_0x53fd("0x10")][_0x53fd("0x11c")]=function(){var x={type:"link",url:this.payload.url,title:_0x53fd("0x11d")};return{elements:[{title:this[_0x53fd("0x70")][_0x53fd("0x23")],text:this.payload[_0x53fd("0xdf")],buttons:[x]}]}},t}(d[_0x53fd("0x10d")]);t[_0x53fd("0xb3")]=n},function(x,t,f){_0x53fd("0x12"),Object[_0x53fd("0xd")](t,