UNPKG

votcore

Version:

Vot Kit for Valensas Bots

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