From 75ac9a7bedaba2902ed5679df86a3e94c0d91191 Mon Sep 17 00:00:00 2001 From: Anderson de Oliveira Date: Mon, 22 Jan 2018 21:55:04 -0300 Subject: [PATCH] rebuild libs, also, changes due to updates --- lib/core.js | 2 +- lib/ext/types/StringSearch.js | 2 +- lib/ui.js | 2 +- package.json | 2 +- rollup.config.ts | 7 +++---- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/core.js b/lib/core.js index 37311cf..6487446 100644 --- a/lib/core.js +++ b/lib/core.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.YveBot=e()}(this,function(){"use strict";function t(t,e){function n(){this.constructor=t}rt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function e(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})}function n(t,e){function n(n){return function(u){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(i=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(i=i.call(o,n[1])).done)return i;switch(o=0,i&&(n=[0,i.value]),n[0]){case 0:case 1:i=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]-1&&t%1==0&&t<=ee}function w(t){return null!=t&&x(t.length)&&!a(t)}function j(t,e,n){var o=t[e];me.call(t,e)&&r(o,n)&&(void 0!==n||e in t)||v(t,e,n)}function O(t,e){return!!(e=null==e?_e:e)&&("number"==typeof t||xe.test(t))&&t>-1&&t%1==0&&t1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(u=t.length>3&&"function"==typeof u?(i--,u):void 0,a&&function(t,e,n){if(!s(n))return!1;var o=typeof e;return!!("number"==o?w(n)&&O(e,n.length):"string"==o&&e in n)&&r(n[e],t)}(n[0],n[1],a)&&(u=i<3?void 0:u,i=1),e=Object(e);++oo?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r-1}function X(t,e,n){for(var r=-1,o=null==t?0:t.length;++r=on){var c=e?null:rn(t);if(c)return et(c);u=!1,o=tt,a=new J}else a=e?[]:s;t:for(;++r-1},i.prototype.set=function(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var ut="object"==typeof global&&global&&global.Object===Object&&global,st="object"==typeof self&&self&&self.Object===Object&&self,at=ut||st||Function("return this")(),ct=at.Symbol,ft=Object.prototype,lt=ft.hasOwnProperty,pt=ft.toString,ht=ct?ct.toStringTag:void 0,dt=Object.prototype.toString,vt="[object Null]",yt="[object Undefined]",gt=ct?ct.toStringTag:void 0,bt="[object AsyncFunction]",mt="[object Function]",_t="[object GeneratorFunction]",xt="[object Proxy]",wt=at["__core-js_shared__"],jt=function(){var t=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ot=Function.prototype.toString,At=/^\[object .+?Constructor\]$/,Et=Function.prototype,Pt=Object.prototype,It=Et.toString,St=Pt.hasOwnProperty,Rt=RegExp("^"+It.call(St).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zt=f(at,"Map"),Tt=f(Object,"create"),Ft="__lodash_hash_undefined__",kt=Object.prototype.hasOwnProperty,Ct=Object.prototype.hasOwnProperty,Mt="__lodash_hash_undefined__";l.prototype.clear=function(){this.__data__=Tt?Tt(null):{},this.size=0},l.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},l.prototype.get=function(t){var e=this.__data__;if(Tt){var n=e[t];return n===Ft?void 0:n}return kt.call(e,t)?e[t]:void 0},l.prototype.has=function(t){var e=this.__data__;return Tt?void 0!==e[t]:Ct.call(e,t)},l.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Tt&&void 0===e?Mt:e,this},h.prototype.clear=function(){this.size=0,this.__data__={hash:new l,map:new(zt||i),string:new l}},h.prototype.delete=function(t){var e=p(this,t).delete(t);return this.size-=e?1:0,e},h.prototype.get=function(t){return p(this,t).get(t)},h.prototype.has=function(t){return p(this,t).has(t)},h.prototype.set=function(t,e){var n=p(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Lt=200;d.prototype.clear=function(){this.__data__=new i,this.size=0},d.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},d.prototype.get=function(t){return this.__data__.get(t)},d.prototype.has=function(t){return this.__data__.has(t)},d.prototype.set=function(t,e){var n=this.__data__;if(n instanceof i){var r=n.__data__;if(!zt||r.length0){if(++e>=Ee)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Ae),Re=F(function(t,e,n){R(t,e,n)}),ze=function(){function t(t){this._moduleName=t}return t.prototype.define=function(t,e,n){var r=this,o=!(n&&n.override);if("string"!=typeof t)Object.keys(t).forEach(function(n){r.define(n,t[n],e)});else if(o&&t in this){var i=typeof this;console.warn("You can't redefine \""+t+'" in '+i+". Force it using { override: true } in options argument.")}else this[t]=e;return this},t.prototype.extend=function(t,e,n,r){var o=this[e];return this.define(t,Re({},o,n),r)},t.prototype.defineExtension=function(){for(var t=this,e=[],n=0;n=0},$e={includes:function(t,e){return t instanceof RegExp?$e.regex(t,e):!!Ne(t)&&e.toLowerCase().indexOf(String(t).toLowerCase())>=0},equals:function(t,e){return!!Ne(t)&&e.toLowerCase()===String(t).toLowerCase()},regex:function(t,e){return t.test(e)},function:function(t,e){return t(e)}},Be=function(e){function n(){var t=e.call(this,"listeners")||this;return t.define($e),t}return t(n,e),n}(ze),Ue="[object Symbol]",We=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ve=/^\w*$/,qe="Expected a function";W.Cache=h;var De=500,Ge=/^\./,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/\\(\\)?/g,He=function(t){var e=W(t,function(t){return n.size===De&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return Ge.test(t)&&e.push(""),t.replace(Ye,function(t,n,r,o){e.push(r?o.replace(Ze,"$1"):n||t)}),e}),Je=1/0,Ke=ct?ct.prototype:void 0,Qe=Ke?Ke.toString:void 0,Xe=1/0,tn=function(){function t(t){this.bot=t,this.reset()}return t.prototype.output=function(){var t=this.get("output");return Object.assign({},t)},t.prototype.set=function(t,e){this.data=Y(this.data,t,e),this.bot.dispatch("storeChanged",this.data)},t.prototype.get=function(t){return t?function(t,e,n){var r=null==t?void 0:G(t,e);return void 0===r?n:r}(this.data,t):this.data},t.prototype.unset=function(t){var e=this.data;H(e,t),this.data=e,this.bot.dispatch("storeChanged",this.data)},t.prototype.reset=function(){this.data={currentIdx:0,output:{},waitingForAnswer:!1}},t.prototype.replace=function(t){this.reset(),this.data=Re({},this.data,t)},t}(),en="__lodash_hash_undefined__";J.prototype.add=J.prototype.push=function(t){return this.__data__.set(t,en),this},J.prototype.has=function(t){return this.__data__.has(t)};var nn=f(at,"Set"),rn=nn&&1/et(new nn([,-0]))[1]==1/0?function(t){return new nn(t)}:function(){},on=200,un={Any:{},Passive:{},PassiveLoop:{},String:{executors:[{transform:function(t){return e(void 0,void 0,void 0,function(){return n(this,function(e){return[2,String(t)]})})}}]},Number:{executors:[{transform:function(t){return e(void 0,void 0,void 0,function(){return n(this,function(e){return[2,Number(t)]})})},validators:[{number:!0,warning:"Invalid number"}]}]},SingleChoice:{executors:[{transform:function(t,r){return e(void 0,void 0,void 0,function(){var e;return n(this,function(n){return(e=M(r.options,t))?[2,void 0===e.value?e.label:e.value]:[2,void 0]})})},validators:[{function:function(t,e){return!!M(e.options,t)},warning:"Unknown option"}]}]},MultipleChoice:{executors:[{transform:function(t,r){return e(void 0,void 0,void 0,function(){var e,o;return n(this,function(n){return t instanceof Array?e=t:(o=[],r.options.forEach(function(t){o.push(String(t.value||t.label)),t.synonyms&&(o=o.concat(t.synonyms))}),e=function(t,e){return e.filter(function(e){return t.toLowerCase().indexOf(e.toLowerCase())>=0})}(String(t),o)),[2,nt(e.map(function(t){var e=M(r.options,t);if(e)return void 0===e.value?e.label:e.value}).filter(function(t){return void 0!==t}))]})})},validators:[{function:function(t,e){var n=L(t),r=e.options.map(function(t){return String(t.value||t.label)});return n.every(function(t){return r.some(function(e){return C(t,e)})})},warning:"Unknown options"}]}]}},sn=function(e){function n(){var t=e.call(this,"types")||this;return t.define(un),t}return t(n,e),n}(ze),an=function(t){return/^\d+$/.test(t)},cn=function(t){return an(t)?Number(t):t.length},fn={required:{validate:function(t,e){return Boolean((e||"").trim())===t},warning:"This is required"},email:{validate:function(t,e){return function(t){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}(e)===t},warning:"Invalid email format"},regex:{validate:function(t,e){return new RegExp(t).test(e)},warning:"Invalid answer format"},minWords:{validate:function(t,e){return e.split(" ").length>=t},warning:function(t){return"This answer must have at least "+t+" words"}},maxWords:{validate:function(t,e){return e.split(" ").length<=t},warning:function(t){return"This answer must have a maximum "+t+" words"}},min:{validate:function(t,e){return cn(e)>=t},warning:function(t){return"This answer length must be min "+t}},max:{validate:function(t,e){return cn(e)<=t},warning:function(t){return"This answer length must be max "+t}},lenght:{validate:function(t,e){return cn(e)===t},warning:function(t){return"It must have lenght "+t}},string:{validate:function(t,e){return Boolean(!an(e)&&"string"==typeof e)===t},warning:"It must be a string"},number:{validate:function(t,e){return an(e)===t},warning:"It must be a number"},function:{validate:function(t,e,n,r){return t(e,n,r)},warning:"Error on execute a validator function"}},ln=function(e){function n(){var t=e.call(this,"validators")||this;return t.define(fn),t}return t(n,e),n}(ze),pn=function(){function t(t,e){this.sessionId="session",this.options=Object.assign({},{enableWaitForSleep:!0,timePerChar:40},e),this.rules=function(t){var e=[];return t.forEach(function(t){if("string"!=typeof t&&"rules"in t&&"flow"in t){var n=t;e=e.concat(n.rules.map(function(e){return Object.assign({},k(e),{flow:t.flow})}))}else e.push(k(t))}),e}(t),this.handlers={},this.store=new tn(this),this.controller=new ke(this),this.options.context&&this.store.set("context",this.options.context),this.on("error",function(t){throw t})}return Object.defineProperty(t.prototype,"context",{get:function(){return this.store.get("context")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"types",{get:function(){return t.types},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actions",{get:function(){return t.actions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listeners",{get:function(){return t.listeners},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"executors",{get:function(){return t.executors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validators",{get:function(){return t.validators},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exceptions",{get:function(){return t.exceptions},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){return!(["error"].indexOf(t)>=0)&&t in this.handlers?this.handlers[t].push(e):this.handlers[t]=[e],this},t.prototype.listen=function(t){var e=this;return this.on("listen",function(n,r){t.every(function(t){var o=function(t){var e=t.passive;return ot({},t,{passive:e||!1})}(t),i=!o.passive&&["Passive","PassiveLoop"].indexOf(r.type)<0,u=!r.passive;if(!o.next||i||u)return!0;var s=Object.keys(o).filter(function(t){return"next"!==t&&t in e.listeners})[0];if(s){if(e.listeners[s](o[s],n))return e.store.set("waitingForAnswer",!1),e.controller.jumpByName(o.next),!1}return!0})}),this},t.prototype.start=function(){return this.dispatch("start"),this.controller.run(),this},t.prototype.end=function(){return this.dispatch("end",this.store.output()),this},t.prototype.talk=function(t,e){var n=Object.assign({},this.options.rule,e||{});return this.controller.sendMessage(t,n),this},t.prototype.hear=function(t){return this.controller.receiveMessage(t),this.dispatch("reply",t),this},t.prototype.dispatch=function(t){for(var e=this,n=[],r=1;r0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1},a.prototype.set=function(t,e){var n=this.__data__,r=u(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var c="object"==typeof global&&global&&global.Object===Object&&global,f="object"==typeof self&&self&&self.Object===Object&&self,l=c||f||Function("return this")(),p=l.Symbol,h=Object.prototype,v=h.hasOwnProperty,d=h.toString,y=p?p.toStringTag:void 0;var g=Object.prototype.toString;var b="[object Null]",m="[object Undefined]",_=p?p.toStringTag:void 0;function x(t){return null==t?void 0===t?m:b:_&&_ in Object(t)?function(t){var e=v.call(t,y),n=t[y];try{t[y]=void 0;var r=!0}catch(t){}var o=d.call(t);return r&&(e?t[y]=n:delete t[y]),o}(t):(e=t,g.call(e));var e}function w(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var j="[object AsyncFunction]",O="[object Function]",A="[object GeneratorFunction]",E="[object Proxy]";function P(t){if(!w(t))return!1;var e=x(t);return e==O||e==A||e==j||e==E}var I,S=l["__core-js_shared__"],R=(I=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var z=Function.prototype.toString;var T=/^\[object .+?Constructor\]$/,F=Function.prototype,k=Object.prototype,C=F.toString,M=k.hasOwnProperty,L=RegExp("^"+C.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function N(t){return!(!w(t)||R&&R in t)&&(P(t)?L:T).test(function(t){if(null!=t){try{return z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function $(t,e){var n,r=null==(n=t)?void 0:n[e];return N(r)?r:void 0}var B=$(l,"Map"),U=$(Object,"create");var W="__lodash_hash_undefined__",V=Object.prototype.hasOwnProperty;var q=Object.prototype.hasOwnProperty;var D="__lodash_hash_undefined__";function G(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=jt}function At(t){return null!=t&&Ot(t.length)&&!P(t)}var Et="object"==typeof exports&&exports&&!exports.nodeType&&exports,Pt=Et&&"object"==typeof module&&module&&!module.nodeType&&module,It=Pt&&Pt.exports===Et?l.Buffer:void 0,St=(It?It.isBuffer:void 0)||function(){return!1},Rt="[object Object]",zt=Function.prototype,Tt=Object.prototype,Ft=zt.toString,kt=Tt.hasOwnProperty,Ct=Ft.call(Object);var Mt={};Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=!0,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=!1;var Lt,Nt="object"==typeof exports&&exports&&!exports.nodeType&&exports,$t=Nt&&"object"==typeof module&&module&&!module.nodeType&&module,Bt=$t&&$t.exports===Nt&&c.process,Ut=function(){try{return Bt&&Bt.binding&&Bt.binding("util")}catch(t){}}(),Wt=Ut&&Ut.isTypedArray,Vt=Wt?(Lt=Wt,function(t){return Lt(t)}):function(t){return dt(t)&&Ot(t.length)&&!!Mt[x(t)]},qt=Object.prototype.hasOwnProperty;function Dt(t,e,n){var r=t[e];qt.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||Q(t,e,n)}var Gt=9007199254740991,Yt=/^(?:0|[1-9]\d*)$/;function Zt(t,e){return!!(e=null==e?Gt:e)&&("number"==typeof t||Yt.test(t))&&t>-1&&t%1==0&&t0){if(++fe>=ue)return arguments[0]}else fe=0;return ce.apply(void 0,arguments)});function he(t,e){return pe((n=t,o=re,r=oe(void 0===(r=e)?n.length-1:r,0),function(){for(var t=arguments,e=-1,i=oe(t.length-r,0),u=Array(i);++e1?e[r-1]:void 0,u=r>2?e[2]:void 0;for(o=ve.length>3&&"function"==typeof o?(r--,o):void 0,u&&function(t,e,n){if(!w(n))return!1;var r=typeof e;return!!("number"==r?At(n)&&Zt(e,n.length):"string"==r&&e in n)&&i(n[e],t)}(e[0],e[1],u)&&(o=r<3?void 0:o,r=1),t=Object(t);++n=0},ze={includes:function(t,e){return t instanceof RegExp?ze.regex(t,e):!!Re(t)&&e.toLowerCase().indexOf(String(t).toLowerCase())>=0},equals:function(t,e){return!!Re(t)&&e.toLowerCase()===String(t).toLowerCase()},regex:function(t,e){return t.test(e)},function:function(t,e){return t(e)}},Te=function(t){function n(){var e=t.call(this,"listeners")||this;return e.define(ze),e}return e(n,t),n}(ye),Fe="[object Symbol]";function ke(t){return"symbol"==typeof t||dt(t)&&x(t)==Fe}var Ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Me=/^\w*$/;var Le="Expected a function";function Ne(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Le);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var u=t.apply(this,r);return n.cache=i.set(o,u)||i,u};return n.cache=new(Ne.Cache||Z),n}Ne.Cache=Z;var $e=500;var Be,Ue,We=/^\./,Ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qe=/\\(\\)?/g,De=(Be=Ne(function(t){var e=[];return We.test(t)&&e.push(""),t.replace(Ve,function(t,n,r,o){e.push(r?o.replace(qe,"$1"):n||t)}),e},function(t){return Ue.size===$e&&Ue.clear(),t}),Ue=Be.cache,Be);var Ge=1/0,Ye=p?p.prototype:void 0,Ze=Ye?Ye.toString:void 0;function He(t){if("string"==typeof t)return t;if(wt(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++no?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r-1)}function cn(t,e,n){for(var r=-1,o=null==t?0:t.length;++r=vn){var c=e?null:hn(t);if(c)return pn(c);u=!1,o=fn,a=new un}else a=e?[]:s;t:for(;++r=0})),[2,dn(n.map(function(t){var n=xe(e.options,t);if(n)return void 0===n.value?n.label:n.value}).filter(function(t){return void 0!==t}))]})})},validators:[{function:function(t,e){var n=we(t),r=e.options.map(function(t){return String(t.value||t.label)});return n.every(function(t){return r.some(function(e){return _e(t,e)})})},warning:"Unknown options"}]}]}},gn=function(t){function n(){var e=t.call(this,"types")||this;return e.define(yn),e}return e(n,t),n}(ye),bn=function(t){return/^\d+$/.test(t)},mn=function(t){return bn(t)?Number(t):t.length},_n={required:{validate:function(t,e){return Boolean((e||"").trim())===t},warning:"This is required"},email:{validate:function(t,e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)===t},warning:"Invalid email format"},regex:{validate:function(t,e){return new RegExp(t).test(e)},warning:"Invalid answer format"},minWords:{validate:function(t,e){return e.split(" ").length>=t},warning:function(t){return"This answer must have at least "+t+" words"}},maxWords:{validate:function(t,e){return e.split(" ").length<=t},warning:function(t){return"This answer must have a maximum "+t+" words"}},min:{validate:function(t,e){return mn(e)>=t},warning:function(t){return"This answer length must be min "+t}},max:{validate:function(t,e){return mn(e)<=t},warning:function(t){return"This answer length must be max "+t}},lenght:{validate:function(t,e){return mn(e)===t},warning:function(t){return"It must have lenght "+t}},string:{validate:function(t,e){return Boolean(!bn(e)&&"string"==typeof e)===t},warning:"It must be a string"},number:{validate:function(t,e){return bn(e)===t},warning:"It must be a number"},function:{validate:function(t,e,n,r){return t(e,n,r)},warning:"Error on execute a validator function"}},xn=function(t){function n(){var e=t.call(this,"validators")||this;return e.define(_n),e}return e(n,t),n}(ye),wn=function(){function t(t,e){var n;this.sessionId="session",this.options=Object.assign({},{enableWaitForSleep:!0,timePerChar:40},e),this.rules=(n=[],t.forEach(function(t){if("string"!=typeof t&&"rules"in t&&"flow"in t){var e=t;n=n.concat(e.rules.map(function(e){return Object.assign({},me(e),{flow:t.flow})}))}else n.push(me(t))}),n),this.handlers={},this.store=new rn(this),this.controller=new Ae(this),this.options.context&&this.store.set("context",this.options.context),this.on("error",function(t){throw t})}return Object.defineProperty(t.prototype,"context",{get:function(){return this.store.get("context")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"types",{get:function(){return t.types},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actions",{get:function(){return t.actions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listeners",{get:function(){return t.listeners},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"executors",{get:function(){return t.executors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validators",{get:function(){return t.validators},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exceptions",{get:function(){return t.exceptions},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){return!(["error"].indexOf(t)>=0)&&t in this.handlers?this.handlers[t].push(e):this.handlers[t]=[e],this},t.prototype.listen=function(t){var e=this;return this.on("listen",function(r,o){t.every(function(t){var i,u,s=(u=(i=t).passive,n({},i,{passive:u||!1})),a=!s.passive&&["Passive","PassiveLoop"].indexOf(o.type)<0,c=!o.passive;if(!s.next||a||c)return!0;var f=Object.keys(s).filter(function(t){return"next"!==t&&t in e.listeners})[0];if(f&&e.listeners[f](s[f],r))return e.store.set("waitingForAnswer",!1),e.controller.jumpByName(s.next),!1;return!0})}),this},t.prototype.start=function(){return this.dispatch("start"),this.controller.run(),this},t.prototype.end=function(){return this.dispatch("end",this.store.output()),this},t.prototype.talk=function(t,e){var n=Object.assign({},this.options.rule,e||{});return this.controller.sendMessage(t,n),this},t.prototype.hear=function(t){return this.controller.receiveMessage(t),this.dispatch("reply",t),this},t.prototype.dispatch=function(t){for(var e=this,n=[],r=1;r0&&u[u.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]0&&i[i.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]-1&&t%1==0&&t<=ne}function _(t){return null!=t&&x(t.length)&&!a(t)}function j(t,e,n){var o=t[e];we.call(t,e)&&r(o,n)&&(void 0!==n||e in t)||v(t,e,n)}function O(t,e){return!!(e=null==e?xe:e)&&("number"==typeof t||_e.test(t))&&t>-1&&t%1==0&&t1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(u=t.length>3&&"function"==typeof u?(i--,u):void 0,a&&function(t,e,n){if(!s(n))return!1;var o=typeof e;return!!("number"==o?_(n)&&O(e,n.length):"string"==o&&e in n)&&r(n[e],t)}(n[0],n[1],a)&&(u=i<3?void 0:u,i=1),e=Object(e);++oo?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r-1}function X(t,e,n){for(var r=-1,o=null==t?0:t.length;++r=un){var c=e?null:on(t);if(c)return et(c);u=!1,o=tt,a=new J}else a=e?[]:s;t:for(;++r-1},i.prototype.set=function(t,e){var n=this.__data__,r=o(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var st="object"==typeof global&&global&&global.Object===Object&&global,at="object"==typeof self&&self&&self.Object===Object&&self,ct=st||at||Function("return this")(),lt=ct.Symbol,ft=Object.prototype,pt=ft.hasOwnProperty,ht=ft.toString,dt=lt?lt.toStringTag:void 0,vt=Object.prototype.toString,yt="[object Null]",bt="[object Undefined]",gt=lt?lt.toStringTag:void 0,mt="[object AsyncFunction]",wt="[object Function]",xt="[object GeneratorFunction]",_t="[object Proxy]",jt=ct["__core-js_shared__"],Ot=function(){var t=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Et=Function.prototype.toString,Ct=/^\[object .+?Constructor\]$/,It=Function.prototype,St=Object.prototype,At=It.toString,Tt=St.hasOwnProperty,Pt=RegExp("^"+At.call(Tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mt=l(ct,"Map"),Ft=l(Object,"create"),Ut="__lodash_hash_undefined__",Rt=Object.prototype.hasOwnProperty,Bt=Object.prototype.hasOwnProperty,Lt="__lodash_hash_undefined__";f.prototype.clear=function(){this.__data__=Ft?Ft(null):{},this.size=0},f.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},f.prototype.get=function(t){var e=this.__data__;if(Ft){var n=e[t];return n===Ut?void 0:n}return Rt.call(e,t)?e[t]:void 0},f.prototype.has=function(t){var e=this.__data__;return Ft?void 0!==e[t]:Bt.call(e,t)},f.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ft&&void 0===e?Lt:e,this},h.prototype.clear=function(){this.size=0,this.__data__={hash:new f,map:new(Mt||i),string:new f}},h.prototype.delete=function(t){var e=p(this,t).delete(t);return this.size-=e?1:0,e},h.prototype.get=function(t){return p(this,t).get(t)},h.prototype.has=function(t){return p(this,t).has(t)},h.prototype.set=function(t,e){var n=p(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Nt=200;d.prototype.clear=function(){this.__data__=new i,this.size=0},d.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},d.prototype.get=function(t){return this.__data__.get(t)},d.prototype.has=function(t){return this.__data__.has(t)},d.prototype.set=function(t,e){var n=this.__data__;if(n instanceof i){var r=n.__data__;if(!Mt||r.length0){if(++e>=Ie)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Ce),Pe=F(function(t,e,n){T(t,e,n)}),Me=function(){function t(t){this._moduleName=t}return t.prototype.define=function(t,e,n){var r=this,o=!(n&&n.override);if("string"!=typeof t)Object.keys(t).forEach(function(n){r.define(n,t[n],e)});else if(o&&t in this){var i=typeof this;console.warn("You can't redefine \""+t+'" in '+i+". Force it using { override: true } in options argument.")}else this[t]=e;return this},t.prototype.extend=function(t,e,n,r){var o=this[e];return this.define(t,Pe({},o,n),r)},t.prototype.defineExtension=function(){for(var t=this,e=[],n=0;n=0},ze={includes:function(t,e){return t instanceof RegExp?ze.regex(t,e):!!ke(t)&&e.toLowerCase().indexOf(String(t).toLowerCase())>=0},equals:function(t,e){return!!ke(t)&&e.toLowerCase()===String(t).toLowerCase()},regex:function(t,e){return t.test(e)},function:function(t,e){return t(e)}},De=function(e){function n(){var t=e.call(this,"listeners")||this;return t.define(ze),t}return t(n,e),n}(Me),$e="[object Symbol]",He=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,We=/^\w*$/,qe="Expected a function";$.Cache=h;var Ve=500,Ge=/^\./,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/\\(\\)?/g,Je=function(t){var e=$(t,function(t){return n.size===Ve&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return Ge.test(t)&&e.push(""),t.replace(Ye,function(t,n,r,o){e.push(r?o.replace(Ze,"$1"):n||t)}),e}),Ke=1/0,Qe=lt?lt.prototype:void 0,Xe=Qe?Qe.toString:void 0,tn=1/0,en=function(){function t(t){this.bot=t,this.reset()}return t.prototype.output=function(){var t=this.get("output");return Object.assign({},t)},t.prototype.set=function(t,e){this.data=G(this.data,t,e),this.bot.dispatch("storeChanged",this.data)},t.prototype.get=function(t){return t?function(t,e,n){var r=null==t?void 0:V(t,e);return void 0===r?n:r}(this.data,t):this.data},t.prototype.unset=function(t){var e=this.data;Z(e,t),this.data=e,this.bot.dispatch("storeChanged",this.data)},t.prototype.reset=function(){this.data={currentIdx:0,output:{},waitingForAnswer:!1}},t.prototype.replace=function(t){this.reset(),this.data=Pe({},this.data,t)},t}(),nn="__lodash_hash_undefined__";J.prototype.add=J.prototype.push=function(t){return this.__data__.set(t,nn),this},J.prototype.has=function(t){return this.__data__.has(t)};var rn=l(ct,"Set"),on=rn&&1/et(new rn([,-0]))[1]==1/0?function(t){return new rn(t)}:function(){},un=200,sn=window,an={Any:{},Passive:{},PassiveLoop:{},String:{executors:[{transform:function(t){return e(sn,void 0,void 0,function(){return n(this,function(e){return[2,String(t)]})})}}]},Number:{executors:[{transform:function(t){return e(sn,void 0,void 0,function(){return n(this,function(e){return[2,Number(t)]})})},validators:[{number:!0,warning:"Invalid number"}]}]},SingleChoice:{executors:[{transform:function(t,r){return e(sn,void 0,void 0,function(){var e;return n(this,function(n){return(e=B(r.options,t))?[2,void 0===e.value?e.label:e.value]:[2,void 0]})})},validators:[{function:function(t,e){return!!B(e.options,t)},warning:"Unknown option"}]}]},MultipleChoice:{executors:[{transform:function(t,r){return e(sn,void 0,void 0,function(){var e,o;return n(this,function(n){return t instanceof Array?e=t:(o=[],r.options.forEach(function(t){o.push(String(t.value||t.label)),t.synonyms&&(o=o.concat(t.synonyms))}),e=function(t,e){return e.filter(function(e){return t.toLowerCase().indexOf(e.toLowerCase())>=0})}(String(t),o)),[2,nt(e.map(function(t){var e=B(r.options,t);if(e)return void 0===e.value?e.label:e.value}).filter(function(t){return void 0!==t}))]})})},validators:[{function:function(t,e){var n=L(t),r=e.options.map(function(t){return String(t.value||t.label)});return n.every(function(t){return r.some(function(e){return R(t,e)})})},warning:"Unknown options"}]}]}},cn=function(e){function n(){var t=e.call(this,"types")||this;return t.define(an),t}return t(n,e),n}(Me),ln=function(t){return/^\d+$/.test(t)},fn=function(t){return ln(t)?Number(t):t.length},pn={required:{validate:function(t,e){return Boolean((e||"").trim())===t},warning:"This is required"},email:{validate:function(t,e){return function(t){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}(e)===t},warning:"Invalid email format"},regex:{validate:function(t,e){return new RegExp(t).test(e)},warning:"Invalid answer format"},minWords:{validate:function(t,e){return e.split(" ").length>=t},warning:function(t){return"This answer must have at least "+t+" words"}},maxWords:{validate:function(t,e){return e.split(" ").length<=t},warning:function(t){return"This answer must have a maximum "+t+" words"}},min:{validate:function(t,e){return fn(e)>=t},warning:function(t){return"This answer length must be min "+t}},max:{validate:function(t,e){return fn(e)<=t},warning:function(t){return"This answer length must be max "+t}},lenght:{validate:function(t,e){return fn(e)===t},warning:function(t){return"It must have lenght "+t}},string:{validate:function(t,e){return Boolean(!ln(e)&&"string"==typeof e)===t},warning:"It must be a string"},number:{validate:function(t,e){return ln(e)===t},warning:"It must be a number"},function:{validate:function(t,e,n,r){return t(e,n,r)},warning:"Error on execute a validator function"}},hn=function(e){function n(){var t=e.call(this,"validators")||this;return t.define(pn),t}return t(n,e),n}(Me),dn=function(){function t(t,e){this.sessionId="session",this.options=Object.assign({},{enableWaitForSleep:!0,timePerChar:40},e),this.rules=function(t){var e=[];return t.forEach(function(t){if("string"!=typeof t&&"rules"in t&&"flow"in t){var n=t;e=e.concat(n.rules.map(function(e){return Object.assign({},U(e),{flow:t.flow})}))}else e.push(U(t))}),e}(t),this.handlers={},this.store=new en(this),this.controller=new Re(this),this.options.context&&this.store.set("context",this.options.context),this.on("error",function(t){throw t})}return Object.defineProperty(t.prototype,"context",{get:function(){return this.store.get("context")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"types",{get:function(){return t.types},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actions",{get:function(){return t.actions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listeners",{get:function(){return t.listeners},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"executors",{get:function(){return t.executors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validators",{get:function(){return t.validators},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exceptions",{get:function(){return t.exceptions},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){return!(["error"].indexOf(t)>=0)&&t in this.handlers?this.handlers[t].push(e):this.handlers[t]=[e],this},t.prototype.listen=function(t){var e=this;return this.on("listen",function(n,r){t.every(function(t){var o=function(t){var e=t.passive;return it({},t,{passive:e||!1})}(t),i=!o.passive&&["Passive","PassiveLoop"].indexOf(r.type)<0,u=!r.passive;if(!o.next||i||u)return!0;var s=Object.keys(o).filter(function(t){return"next"!==t&&t in e.listeners})[0];if(s){if(e.listeners[s](o[s],n))return e.store.set("waitingForAnswer",!1),e.controller.jumpByName(o.next),!1}return!0})}),this},t.prototype.start=function(){return this.dispatch("start"),this.controller.run(),this},t.prototype.end=function(){return this.dispatch("end",this.store.output()),this},t.prototype.talk=function(t,e){var n=Object.assign({},this.options.rule,e||{});return this.controller.sendMessage(t,n),this},t.prototype.hear=function(t){return this.controller.receiveMessage(t),this.dispatch("reply",t),this},t.prototype.dispatch=function(t){for(var e=this,n=[],r=1;r0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1},u.prototype.set=function(t,e){var n=this.__data__,r=s(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var c="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,f=c||l||Function("return this")(),p=f.Symbol,h=Object.prototype,d=h.hasOwnProperty,v=h.toString,y=p?p.toStringTag:void 0;var b=Object.prototype.toString;var g="[object Null]",m="[object Undefined]",w=p?p.toStringTag:void 0;function x(t){return null==t?void 0===t?m:g:w&&w in Object(t)?function(t){var e=d.call(t,y),n=t[y];try{t[y]=void 0;var r=!0}catch(t){}var o=v.call(t);return r&&(e?t[y]=n:delete t[y]),o}(t):(e=t,b.call(e));var e}function _(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var j="[object AsyncFunction]",O="[object Function]",E="[object GeneratorFunction]",C="[object Proxy]";function I(t){if(!_(t))return!1;var e=x(t);return e==O||e==E||e==j||e==C}var S,A=f["__core-js_shared__"],T=(S=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"";var P=Function.prototype.toString;var M=/^\[object .+?Constructor\]$/,F=Function.prototype,U=Object.prototype,R=F.toString,B=U.hasOwnProperty,L=RegExp("^"+R.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function N(t){return!(!_(t)||T&&T in t)&&(I(t)?L:M).test(function(t){if(null!=t){try{return P.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function k(t,e){var n,r=null==(n=t)?void 0:n[e];return N(r)?r:void 0}var z=k(f,"Map"),D=k(Object,"create");var $="__lodash_hash_undefined__",H=Object.prototype.hasOwnProperty;var W=Object.prototype.hasOwnProperty;var q="__lodash_hash_undefined__";function V(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=jt}function Et(t){return null!=t&&Ot(t.length)&&!I(t)}var Ct="object"==typeof exports&&exports&&!exports.nodeType&&exports,It=Ct&&"object"==typeof module&&module&&!module.nodeType&&module,St=It&&It.exports===Ct?f.Buffer:void 0,At=(St?St.isBuffer:void 0)||function(){return!1},Tt="[object Object]",Pt=Function.prototype,Mt=Object.prototype,Ft=Pt.toString,Ut=Mt.hasOwnProperty,Rt=Ft.call(Object);var Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;var Lt,Nt="object"==typeof exports&&exports&&!exports.nodeType&&exports,kt=Nt&&"object"==typeof module&&module&&!module.nodeType&&module,zt=kt&&kt.exports===Nt&&c.process,Dt=function(){try{return zt&&zt.binding&&zt.binding("util")}catch(t){}}(),$t=Dt&&Dt.isTypedArray,Ht=$t?(Lt=$t,function(t){return Lt(t)}):function(t){return vt(t)&&Ot(t.length)&&!!Bt[x(t)]},Wt=Object.prototype.hasOwnProperty;function qt(t,e,n){var r=t[e];Wt.call(t,e)&&i(r,n)&&(void 0!==n||e in t)||Q(t,e,n)}var Vt=9007199254740991,Gt=/^(?:0|[1-9]\d*)$/;function Yt(t,e){return!!(e=null==e?Vt:e)&&("number"==typeof t||Gt.test(t))&&t>-1&&t%1==0&&t0){if(++le>=se)return arguments[0]}else le=0;return ce.apply(void 0,arguments)});function he(t,e){return pe((n=t,o=re,r=oe(void 0===(r=e)?n.length-1:r,0),function(){for(var t=arguments,e=-1,i=oe(t.length-r,0),s=Array(i);++e1?e[r-1]:void 0,s=r>2?e[2]:void 0;for(o=de.length>3&&"function"==typeof o?(r--,o):void 0,s&&function(t,e,n){if(!_(n))return!1;var r=typeof e;return!!("number"==r?Et(n)&&Yt(e,n.length):"string"==r&&e in n)&&i(n[e],t)}(e[0],e[1],s)&&(o=r<3?void 0:o,r=1),t=Object(t);++n=0},Pe={includes:function(t,e){return t instanceof RegExp?Pe.regex(t,e):!!Te(t)&&e.toLowerCase().indexOf(String(t).toLowerCase())>=0},equals:function(t,e){return!!Te(t)&&e.toLowerCase()===String(t).toLowerCase()},regex:function(t,e){return t.test(e)},function:function(t,e){return t(e)}},Me=function(t){function n(){var e=t.call(this,"listeners")||this;return e.define(Pe),e}return e(n,t),n}(ye),Fe="[object Symbol]";function Ue(t){return"symbol"==typeof t||vt(t)&&x(t)==Fe}var Re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/;var Le="Expected a function";function Ne(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Le);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Ne.Cache||Y),n}Ne.Cache=Y;var ke=500;var ze,De,$e=/^\./,He=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,We=/\\(\\)?/g,qe=(ze=Ne(function(t){var e=[];return $e.test(t)&&e.push(""),t.replace(He,function(t,n,r,o){e.push(r?o.replace(We,"$1"):n||t)}),e},function(t){return De.size===ke&&De.clear(),t}),De=ze.cache,ze);var Ve=1/0,Ge=p?p.prototype:void 0,Ye=Ge?Ge.toString:void 0;function Ze(t){if("string"==typeof t)return t;if(_t(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++no?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r-1)}function cn(t,e,n){for(var r=-1,o=null==t?0:t.length;++r=dn){var c=e?null:hn(t);if(c)return pn(c);s=!1,o=ln,u=new sn}else u=e?[]:a;t:for(;++r=0})),[2,vn(n.map(function(t){var n=xe(e.options,t);if(n)return void 0===n.value?n.label:n.value}).filter(function(t){return void 0!==t}))]})})},validators:[{function:function(t,e){var n=_e(t),r=e.options.map(function(t){return String(t.value||t.label)});return n.every(function(t){return r.some(function(e){return we(t,e)})})},warning:"Unknown options"}]}]}},gn=function(t){function n(){var e=t.call(this,"types")||this;return e.define(bn),e}return e(n,t),n}(ye),mn=function(t){return/^\d+$/.test(t)},wn=function(t){return mn(t)?Number(t):t.length},xn={required:{validate:function(t,e){return Boolean((e||"").trim())===t},warning:"This is required"},email:{validate:function(t,e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)===t},warning:"Invalid email format"},regex:{validate:function(t,e){return new RegExp(t).test(e)},warning:"Invalid answer format"},minWords:{validate:function(t,e){return e.split(" ").length>=t},warning:function(t){return"This answer must have at least "+t+" words"}},maxWords:{validate:function(t,e){return e.split(" ").length<=t},warning:function(t){return"This answer must have a maximum "+t+" words"}},min:{validate:function(t,e){return wn(e)>=t},warning:function(t){return"This answer length must be min "+t}},max:{validate:function(t,e){return wn(e)<=t},warning:function(t){return"This answer length must be max "+t}},lenght:{validate:function(t,e){return wn(e)===t},warning:function(t){return"It must have lenght "+t}},string:{validate:function(t,e){return Boolean(!mn(e)&&"string"==typeof e)===t},warning:"It must be a string"},number:{validate:function(t,e){return mn(e)===t},warning:"It must be a number"},function:{validate:function(t,e,n,r){return t(e,n,r)},warning:"Error on execute a validator function"}},_n=function(t){function n(){var e=t.call(this,"validators")||this;return e.define(xn),e}return e(n,t),n}(ye),jn=function(){function t(t,e){var n;this.sessionId="session",this.options=Object.assign({},{enableWaitForSleep:!0,timePerChar:40},e),this.rules=(n=[],t.forEach(function(t){if("string"!=typeof t&&"rules"in t&&"flow"in t){var e=t;n=n.concat(e.rules.map(function(e){return Object.assign({},me(e),{flow:t.flow})}))}else n.push(me(t))}),n),this.handlers={},this.store=new rn(this),this.controller=new Ee(this),this.options.context&&this.store.set("context",this.options.context),this.on("error",function(t){throw t})}return Object.defineProperty(t.prototype,"context",{get:function(){return this.store.get("context")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"types",{get:function(){return t.types},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actions",{get:function(){return t.actions},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listeners",{get:function(){return t.listeners},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"executors",{get:function(){return t.executors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validators",{get:function(){return t.validators},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exceptions",{get:function(){return t.exceptions},enumerable:!0,configurable:!0}),t.prototype.on=function(t,e){return!(["error"].indexOf(t)>=0)&&t in this.handlers?this.handlers[t].push(e):this.handlers[t]=[e],this},t.prototype.listen=function(t){var e=this;return this.on("listen",function(r,o){t.every(function(t){var i,s,a=(s=(i=t).passive,n({},i,{passive:s||!1})),u=!a.passive&&["Passive","PassiveLoop"].indexOf(o.type)<0,c=!o.passive;if(!a.next||u||c)return!0;var l=Object.keys(a).filter(function(t){return"next"!==t&&t in e.listeners})[0];if(l&&e.listeners[l](a[l],r))return e.store.set("waitingForAnswer",!1),e.controller.jumpByName(a.next),!1;return!0})}),this},t.prototype.start=function(){return this.dispatch("start"),this.controller.run(),this},t.prototype.end=function(){return this.dispatch("end",this.store.output()),this},t.prototype.talk=function(t,e){var n=Object.assign({},this.options.rule,e||{});return this.controller.sendMessage(t,n),this},t.prototype.hear=function(t){return this.controller.receiveMessage(t),this.dispatch("reply",t),this},t.prototype.dispatch=function(t){for(var e=this,n=[],r=1;r { 'isomorphic-unfetch', ], - globals: { - [src]: 'YveBot', - }, - output: { file: `lib/ext/types/${eType}.js`, format: 'umd', @@ -86,6 +82,9 @@ const typeExtensions = typeFiles.map((eType) => { paths: { [src]: '../../core', }, + globals: { + [src]: 'YveBot', + }, }, onwarn,