From 0aeb8ef1823b3a6caa48de0ceee5f2f158bf4409 Mon Sep 17 00:00:00 2001
From: Jens Sogaard
Date: Wed, 7 Feb 2018 20:52:14 -0500
Subject: [PATCH 1/6] Added cf-robot-message logic. Tested formless, conditions
and chained messages.
---
dist/conversational-form.js | 52 +-
dist/conversational-form.min.js | 8 +-
gulp-tasks/scripts.js | 1 +
...evelopment-cf-robot-message--formless.html | 526 ++++++++++++++++++
src/development-cf-robot-message.html | 252 +++++++++
src/files/formless-test-data.json | 4 +
src/scripts/cf/ConversationalForm.ts | 3 +-
src/scripts/cf/form-tags/CfRobotMessageTag.ts | 19 +
src/scripts/cf/form-tags/Tag.ts | 10 +
src/scripts/cf/form-tags/TagGroup.ts | 5 +
src/scripts/cf/ui/chat/ChatResponse.ts | 11 +-
src/scripts/cf/ui/inputs/UserTextInput.ts | 6 +
...evelopment-cf-robot-message--formless.html | 526 ++++++++++++++++++
13 files changed, 1414 insertions(+), 9 deletions(-)
create mode 100644 src/development-cf-robot-message--formless.html
create mode 100644 src/development-cf-robot-message.html
create mode 100644 src/scripts/cf/form-tags/CfRobotMessageTag.ts
create mode 100644 src/scripts/development-cf-robot-message--formless.html
diff --git a/dist/conversational-form.js b/dist/conversational-form.js
index 49287eeff..b96b0e0af 100644
--- a/dist/conversational-form.js
+++ b/dist/conversational-form.js
@@ -1691,6 +1691,7 @@ var cf;
///
///
///
+///
///
///
///
@@ -1720,6 +1721,7 @@ var cf;
this.domElement.addEventListener("change", this.changeCallback, false);
// remove tabIndex from the dom element.. danger zone... should we or should we not...
this.domElement.tabIndex = -1;
+ this.skipUserInput = false;
// questions array
if (options.questions)
this.questions = options.questions;
@@ -1974,6 +1976,11 @@ var cf;
domElement: element
});
}
+ else if (element.tagName.toLowerCase() == "cf-robot-message") {
+ tag = new cf.CfRobotMessageTag({
+ domElement: element
+ });
+ }
return tag;
}
else {
@@ -2200,6 +2207,7 @@ var cf;
if (cf.ConversationalForm.illustrateAppFlow)
if (!cf.ConversationalForm.suppressLog)
console.log('Conversational Form > TagGroup registered:', this.elements[0].type, this);
+ this.skipUserInput = false;
}
Object.defineProperty(TagGroup.prototype, "required", {
get: function () {
@@ -2744,6 +2752,37 @@ var cf;
cf.OptionTag = OptionTag;
})(cf || (cf = {}));
+///
+var __extends = (this && this.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+// namespace
+var cf;
+(function (cf) {
+ // interface
+ // class
+ var CfRobotMessageTag = /** @class */ (function (_super) {
+ __extends(CfRobotMessageTag, _super);
+ function CfRobotMessageTag(options) {
+ var _this = _super.call(this, options) || this;
+ _this.skipUserInput = true;
+ return _this;
+ }
+ CfRobotMessageTag.prototype.dealloc = function () {
+ _super.prototype.dealloc.call(this);
+ };
+ return CfRobotMessageTag;
+ }(cf.Tag));
+ cf.CfRobotMessageTag = CfRobotMessageTag;
+})(cf || (cf = {}));
+
///
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
@@ -4235,6 +4274,9 @@ var cf;
if (this._currentTag.type == "text" || this._currentTag.type == "email") {
this.inputElement.value = this._currentTag.defaultValue.toString();
}
+ if (this._currentTag.skipUserInput === true) {
+ this.el.classList.add("hide-input");
+ }
if (cf.UserInputElement.hideUserInputOnNoneTextInput) {
// toggle userinput hide
if (this.controlElements.active) {
@@ -4495,7 +4537,7 @@ var __extends = (this && this.__extends) || (function () {
var cf;
(function (cf) {
cf.ChatResponseEvents = {
- USER_ANSWER_CLICKED: "cf-on-user-answer-clicked",
+ USER_ANSWER_CLICKED: "cf-on-user-answer-clicked"
};
// class
var ChatResponse = /** @class */ (function (_super) {
@@ -4688,6 +4730,11 @@ var cf;
_this.onReadyCallback();
// reset, as it can be called again
_this.onReadyCallback = null;
+ if (_this._tag.skipUserInput === true) {
+ setTimeout(function () {
+ _this._tag.flowManager.nextStep();
+ }, _this.uiOptions.robot.chainedResponseTime);
+ }
}, robotInitResponseTime + (chainedResponses.length * this.uiOptions.robot.chainedResponseTime));
}
else {
@@ -5369,6 +5416,7 @@ var cf;
///
///
///
+///
///
///
///
@@ -5495,7 +5543,7 @@ var cf;
// if tags are not defined then we will try and build some tags our selves..
if (!this.tags || this.tags.length == 0) {
this.tags = [];
- var fields = [].slice.call(this.formEl.querySelectorAll("input, select, button, textarea"), 0);
+ var fields = [].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"), 0);
for (var i = 0; i < fields.length; i++) {
var element = fields[i];
if (cf_1.Tag.isTagValid(element)) {
diff --git a/dist/conversational-form.min.js b/dist/conversational-form.min.js
index cdd198e4a..c14a1da30 100644
--- a/dist/conversational-form.min.js
+++ b/dist/conversational-form.min.js
@@ -1,4 +1,4 @@
-!function(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(t,this)}function o(t,e){for(;3===t._state;)t=t._value;if(0===t._state)return void t._deferreds.push(e);t._handled=!0,i._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?s:r)(e.promise,t._value);var i;try{i=n(t._value)}catch(t){return void r(e.promise,t)}s(e.promise,i)})}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if(e instanceof i)return t._state=3,t._value=e,void a(t);if("function"==typeof o)return void c(n(o,e),t)}t._state=1,t._value=e,a(t)}catch(e){r(t,e)}}function r(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e0||!!navigator.userAgent.match(/Trident.*rv\:11\./)},t.getValuesOfBars=function(t){var e=t.split("||");return e.length<=1&&(e=t.split("|")),e},t.setTransform=function(t,e){t.style["-webkit-transform"]=e,t.style["-moz-transform"]=e,t.style["-ms-transform"]=e,t.style.transform=e},t.extendObject=function(t,e){for(var n in e)e[n]&&e[n].constructor&&e[n].constructor===Object?(t[n]=t[n]||{},arguments.callee(t[n],e[n])):t[n]=e[n];return t},t.caniuse={fileReader:function(){return!!(window.File&&window.FileReader&&window.FileList&&window.Blob)}},t}();t.Helpers=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(t){void 0===t&&(t=null),this._cf=t,this.target=document.createDocumentFragment()}return Object.defineProperty(t.prototype,"cf",{get:function(){return this._cf},set:function(t){this._cf=t},enumerable:!0,configurable:!0}),t.prototype.addEventListener=function(t,e,n){return this.target.addEventListener(t,e,n)},t.prototype.dispatchEvent=function(t){return this.target.dispatchEvent(t)},t.prototype.removeEventListener=function(t,e,n){this.target.removeEventListener(t,e,n)},t}();t.EventDispatcher=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(){}return t.parseTag=function(t){var e=document.createElement(t.tag);e.setAttribute("cf-formless","");for(var n in t)"tag"!==n&&"children"!==n&&e.setAttribute(n,t[n]);return e},t.parseGroupTag=function(e){for(var n=t.parseTag(e),i=e.children,o=0;o0)for(var r=0;r ':"")+t.Helpers.getInnerTextOfElement(this.el)}else e=t.Helpers.getInnerTextOfElement(this.el);return e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"positionVector",{get:function(){return this._positionVector},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{set:function(t){this.el.tabIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"highlight",{get:function(){return this.el.classList.contains("highlight")},set:function(t){t?this.el.classList.add("highlight"):this.el.classList.remove("highlight")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"focus",{get:function(){return this._focus},set:function(t){this._focus=t,this._focus?this.el.focus():this.el.blur()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return!this.el.classList.contains("hide")},set:function(t){t?this.el.classList.remove("hide"):(this.el.classList.add("hide"),this.tabIndex=-1,this.highlight=!1)},enumerable:!0,configurable:!0}),n.prototype.onBlur=function(t){this._focus=!1},n.prototype.onFocus=function(e){this._focus=!0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.ON_FOCUS,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.ON_FOCUS,{detail:this.positionVector}))},n.prototype.hasImage=function(){return!1},n.prototype.calcPosition=function(){var t=parseInt(window.getComputedStyle(this.el).getPropertyValue("margin-right"),10);this._positionVector={height:this.el.offsetHeight,width:this.el.offsetWidth+t,x:this.el.offsetLeft,y:this.el.offsetTop,el:this},this._positionVector.centerX=this._positionVector.x+.5*this._positionVector.width,this._positionVector.centerY=this._positionVector.y+.5*this._positionVector.height},n.prototype.setData=function(t){this.referenceTag=t.referenceTag,e.prototype.setData.call(this,t)},n.prototype.animateIn=function(){clearTimeout(this.animateInTimer),this.el.classList.add("animate-in")},n.prototype.animateOut=function(){this.el.classList.add("animate-out")},n.prototype.onChoose=function(){t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.SUBMIT_VALUE,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.SUBMIT_VALUE,{detail:this}))},n.prototype.dealloc=function(){this.el.removeEventListener("blur",this.onBlurCallback,!1),this.onBlurCallback=null,this.el.removeEventListener("focus",this.onFocusCallback,!1),this.onFocusCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ControlElement=e}(cf||(cf={}));var cf;!function(t){t.ControlElementsEvents={ON_RESIZE:"cf-on-control-elements-resize",CHANGED:"cf-on-control-elements-changed"};var e=function(){function e(e){this.animateInFromReponseTimer=0,this.ignoreKeyboardInput=!1,this.rowIndex=-1,this.columnIndex=0,this.elementWidth=0,this.filterListNumberOfVisible=0,this.listWidth=0,this.el=e.el,this.eventTarget=e.eventTarget,this.cfReference=e.cfReference,this.list=this.el.getElementsByTagName("cf-list")[0],this.infoElement=e.infoEl,this.onScrollCallback=this.onScroll.bind(this),this.el.addEventListener("scroll",this.onScrollCallback,!1),this.onResizeCallback=this.onResize.bind(this),window.addEventListener("resize",this.onResizeCallback,!1),this.onElementFocusCallback=this.onElementFocus.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_FOCUS,this.onElementFocusCallback,!1),this.onElementLoadedCallback=this.onElementLoaded.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_LOADED,this.onElementLoadedCallback,!1),this.onChatReponsesUpdatedCallback=this.onChatReponsesUpdated.bind(this),this.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onUserInputKeyChangeCallback=this.onUserInputKeyChange.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,this.onUserInputKeyChangeCallback,!1),this.userInputUpdateCallback=this.onUserInputUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.listScrollController=new t.ScrollController({interactionListener:this.el,listToScroll:this.list,eventTarget:this.eventTarget,listNavButtons:this.el.getElementsByTagName("cf-list-button")})}return Object.defineProperty(e.prototype,"active",{get:function(){return this.elements&&this.elements.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focus",{get:function(){if(!this.elements)return!1;for(var t=this.getElements(),e=0;ethis.tableableRows[this.rowIndex].length-1&&(this.columnIndex=0),!0):(this.resetTabList(),!1)},e.prototype.updateRowIndex=function(t){var e=this.rowIndex;if(this.rowIndex+=t,this.tableableRows[this.rowIndex])for(var n=this.tableableRows[e]?this.tableableRows[e][this.columnIndex].positionVector.centerX:0,i=this.tableableRows[this.rowIndex],o=1e13,s=0;sMath.abs(n-r.positionVector.centerX)&&(o=Math.abs(n-r.positionVector.centerX),this.columnIndex=s)}},e.prototype.resetTabList=function(){this.rowIndex=-1,this.columnIndex=-1},e.prototype.onUserInputUpdate=function(t){if(this.el.classList.remove("animate-in"),this.infoElement.classList.remove("show"),this.elements)for(var e=this.getElements(),n=0;n1){for(var o=[],s=0;s0&&(o[0].highlight=!0)}},e.prototype.clickOnHighlighted=function(){for(var t=this.getElements(),e=0;e0){this.el.classList.contains("animate-in")||this.el.classList.add("animate-in");for(var e=0;e0&&"OptionsList"==this.elements[0].type?this.elements[0].elements:this.elements},e.prototype.buildTabableRows=function(){this.tableableRows=[],this.resetTabList();var t=this.getElements();if(this.el.classList.contains("two-row")){this.tableableRows[0]=[],this.tableableRows[1]=[];for(var e=0;e0)switch(this.elements[0].type){case"CheckboxButton":for(var n=0,i=[],o=0;o1)break}for(var o=0;o1&&(s.partOfSeveralChoices=!0),i.push(s.value)),e.controlElements.push(s)}e.text=t.Dictionary.parseAndGetMultiValueString(i);break;case"RadioButton":for(var o=0;o0;)this.elements.pop().dealloc();this.list.innerHTML="",this.onListChanged()},e.prototype.buildTags=function(e){var n=this;this.disabled=!1;this.el.parentNode.getElementsByTagName("ul")[0],this.el.parentNode.getElementsByTagName("ul")[1];this.clearTagsAndReset(),this.elements=[];for(var i=0;i0){var s=this.elements[this.elements.length-1];this.list.appendChild(s.el)}}var r=this.elements[0]&&"OptionsList"==this.elements[0].type;this.filterListNumberOfVisible=r?this.elements[0].elements.length:e.length,new Promise(function(t,e){return n.resize(t,e)}).then(function(){var e=n.list.offsetHeight,i={height:e};n.onListChanged(),t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.CONTROL_ELEMENTS_ADDED,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.CONTROL_ELEMENTS_ADDED,{detail:i}))})},e.prototype.onResize=function(t){this.resize()},e.prototype.resize=function(e,n){this.list.style.width="100%",this.el.classList.remove("resized"),this.el.classList.remove("one-row"),this.el.classList.remove("two-row"),this.elementWidth=0,this.listWidth=0;var i=this.getElements();if(i&&i.length>0){for(var o=[],s=[],r=!1,a=0;ac;h&&!r?(this.el.classList.add("two-row"),this.listWidth=Math.max(c,Math.round(o[Math.floor(o.length/2)]+50)),this.list.style.width=this.listWidth+"px"):this.el.classList.add("one-row");for(var a=0;ac;for(var u=i.slice(),p=u.sort(function(t,e){var n=t.positionVector.y>e.positionVector.y;return t.positionVector.x==e.positionVector.x?n?1:-1:t.positionVector.x0&&(this.xTarget+=(0-this.xTarget)*t.Helpers.lerp(e.accerlation,.3,.8)),this.xTargetthis.max&&(this.nextButton.classList.contains("active")||this.nextButton.classList.add("active"),this.nextButton.classList.contains("cf-gradient")||this.nextButton.classList.add("cf-gradient")),i<=this.max&&(this.nextButton.classList.contains("active")&&this.nextButton.classList.remove("active"),this.nextButton.classList.contains("cf-gradient")&&this.nextButton.classList.remove("cf-gradient"));var o=this.x;t.Helpers.setTransform(this.listToScroll,"translateX("+o+"px)"),(this.interacting||Math.abs(this.x-this.xTarget)>.02&&!this.interacting)&&(this.rAF=window.requestAnimationFrame(function(){return n.render()}))},e.prototype.setScroll=function(t,e){this.xTarget=this.visibleAreaWidth==this.listWidth?0:t,this.render()},e.prototype.pushDirection=function(t){this.inputAccerlationTarget+=5e3*t,this.render()},e.prototype.dealloc=function(){this.prevButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.nextButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.onListNavButtonsClickCallback=null,this.prevButton=null,this.nextButton=null,document.removeEventListener("mouseleave",this.documentLeaveCallback,!1),document.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.documentLeaveCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousedown"),this.onInteractStartCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.onInteractEndCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousemove"),this.onInteractMoveCallback,!1),this.documentLeaveCallback=null,this.onInteractStartCallback=null,this.onInteractEndCallback=null,this.onInteractMoveCallback=null},e.prototype.reset=function(){this.interacting=!1,this.startX=0,this.startXTarget=this.startX,this.inputAccerlation=0,this.x=0,this.xTarget=0,t.Helpers.setTransform(this.listToScroll,"translateX(0px)"),this.render(),this.prevButton.classList.remove("active"),this.nextButton.classList.remove("active")},e.prototype.resize=function(t,e){this.reset(),this.visibleAreaWidth=e,this.listWidth=Math.max(e,t),this.max=-1*(this.listWidth-this.visibleAreaWidth),this.render()},e.accerlation=.1,e}();t.ScrollController=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(t){this.data={"user-image":"https://cf-4053.kxcdn.com/conversational-form/human.png","entry-not-found":"Dictionary item not found.","awaiting-mic-permission":"Awaiting mic permission","user-audio-reponse-invalid":"I didn't get that, try again.","microphone-terminal-error":"Audio input not supported","input-placeholder":"Type your answer here ...","group-placeholder":"Type to filter list ...","input-placeholder-error":"Your input is not correct ...","input-placeholder-required":"Input is required ...","input-placeholder-file-error":"File upload failed ...","input-placeholder-file-size-error":"File size too big ...","input-no-filter":"No results found for {input-value} ","user-reponse-and":" and ","user-reponse-missing":"Missing input ...","user-reponse-missing-group":"Nothing selected ...",general:"General type1||General type2","icon-type-file":" "},this.robotData={"robot-image":"https://cf-4053.kxcdn.com/conversational-form/robot.png",input:"Please write some text.",text:"Please write some text.",checkbox:"Select as many as you want.",name:"What's your name?",
-email:"Need your e-mail.",password:"Please provide password",tel:"What's your phone number?",radio:"I need you to select one of these.",select:"Choose any of these options.",file:"Select a file to upload.",general:"General1||General2||General3.."},e.instance=this,t&&t.data&&(this.data=this.validateAndSetNewData(t.data,this.data)),t.userImage&&(this.data["user-image"]=t.userImage),t.robotImage&&(this.robotData["robot-image"]=t.robotImage),t&&t.robotData&&(this.robotData=this.validateAndSetNewData(t.robotData,this.robotData))}return e.get=function(n){var i=e.instance,o=i.data[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else o=i.data["entry-not-found"];return o},e.set=function(t,n,i){var o=e.instance,s="robot"==n?o.robotData:o.data;return s[t]=i,s[t]},e.getRobotResponse=function(n){var i=e.instance,o=i.robotData[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else{var r=t.Helpers.getValuesOfBars(i.robotData.general);o=r[Math.floor(Math.random()*r.length)]}return o},e.parseAndGetMultiValueString=function(t){for(var n="",i=0;i1&&i==t.length-2?e.get("user-reponse-and"):", ";n+=o+(i Tag registered:",this.type,this)),this.refresh()}return Object.defineProperty(Tag.prototype,"type",{get:function(){return this.domElement.getAttribute("type")||this.domElement.tagName.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"name",{get:function(){return this.domElement.getAttribute("name")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"id",{get:function(){return this.domElement.getAttribute("id")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"inputPlaceholder",{get:function(){return this._inputPlaceholder},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"formless",{get:function(){return cf.TagsParser.isElementFormless(this.domElement)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"label",{get:function(){return this.getLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"value",{get:function(){return this.domElement.value||this.initialDefaultValue},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"hasImage",{get:function(){return this.domElement.hasAttribute("cf-image")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"disabled",{get:function(){return!this.checkConditionalAndIsValid()||void 0!=this.domElement.getAttribute("disabled")&&null!=this.domElement.getAttribute("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"required",{get:function(){return!!this.domElement.getAttribute("required")||""==this.domElement.getAttribute("required")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"question",{get:function(){return this.questions&&0!=this.questions.length?this.questions[Math.floor(Math.random()*this.questions.length)]:cf.Dictionary.getRobotResponse(this.type)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"eventTarget",{set:function(t){this._eventTarget=t},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"errorMessage",{get:function(){return this.errorMessages||(this.domElement.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.getAttribute("cf-error")):this.domElement.parentNode&&this.domElement.parentNode.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.parentNode.getAttribute("cf-error")):this.required?this.errorMessages=[cf.Dictionary.get("input-placeholder-required")]:"file"==this.type?this.errorMessages=[cf.Dictionary.get("input-placeholder-file-error")]:this.errorMessages=[cf.Dictionary.get("input-placeholder-error")]),this.errorMessages[Math.floor(Math.random()*this.errorMessages.length)]},enumerable:!0,configurable:!0}),Tag.prototype.dealloc=function(){this.domElement.removeEventListener("change",this.changeCallback,!1),this.changeCallback=null,this.domElement=null,this.defaultValue=null,this.errorMessages=null,this.pattern=null,this._label=null,this.validationCallback=null,this.questions=null},Tag.testConditions=function(t,e){var n=function(e,n){return"object"==typeof n?n.test(e):t===n};if("string"==typeof t){for(var i=t,o=!1,s=0;s0},Tag.prototype.checkConditionalAndIsValid=function(){return!this.hasConditions()||this.flowManager.areConditionsInFlowFullfilled(this,this.conditionalTags)},Tag.prototype.setTagValueAndIsValid=function(t){var e=!0,n=t.text;this.pattern&&(e=this.pattern.test(n)),""==n&&this.required&&(e=!1);var i=parseInt(this.domElement.getAttribute("minlength"),10)||-1,o=parseInt(this.domElement.getAttribute("maxlength"),10)||-1;return-1!=i&&n.lengtho&&(e=!1),e&&"file"!=this.type&&(this.domElement.value=n),e},Tag.prototype.getLabel=function(){return this._label||this.findAndSetLabel(),this._label?this._label:cf.Dictionary.getRobotResponse(this.type)},Tag.prototype.findConditionalAttributes=function(){var t=this.domElement.attributes;if(t.length>0){this.conditionalTags=[];for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n&&n.name&&-1!==n.name.indexOf("cf-conditional")){for(var i=[],o=-1!==n.value.indexOf("||")?n.value.split("||"):n.value.split("&&"),s=0;s0&&(e=[t])}else if(e.length>0)for(var i=0;i TagGroup registered:",this.elements[0].type,this))}return Object.defineProperty(e.prototype,"required",{get:function(){for(var t=0;t0)return this.questions[Math.floor(Math.random()*this.questions.length)];if(this.elements[0]&&this.elements[0].question){return this.elements[0].question}return t.Dictionary.getRobotResponse(this.getGroupTagType())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeElements",{get:function(){return this._activeElements},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._values?this._values:[""]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){for(var t=0,e=0;e\n\t\t\t\t'+this.referenceTag.label+"\n\t\t\t\n\t\t\t"},n}(t.ControlElement);t.Button=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"RadioButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.el.hasAttribute("checked")&&"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.checked=!0,t.prototype.onClick.call(this,e)},e.prototype.getTemplate=function(){return'\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t"+this.referenceTag.label+" \n\t\t\t\t
\n\t\t\t \n\t\t\t"},e}(t.Button);t.RadioButton=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"CheckboxButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(t){this.checked=!this.checked},e.prototype.getTemplate=function(){var t=this.referenceTag.domElement.checked&&this.referenceTag.domElement.hasAttribute("checked");return'";return t+="",this.isMultiChoice&&(t+=" "),t+=this.referenceTag.label,t+="
",t+=" "},n}(t.Button);t.OptionButton=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(e){this.context=e.context,this.eventTarget=e.eventTarget,this.referenceTag=e.referenceTag,this.multiChoice=this.referenceTag.domElement.hasAttribute("multiple"),this.onOptionButtonClickCallback=this.onOptionButtonClick.bind(this),this.eventTarget.addEventListener(t.OptionButtonEvents.CLICK,this.onOptionButtonClickCallback,!1),this.createElements()}return Object.defineProperty(e.prototype,"type",{get:function(){return"OptionsList"},enumerable:!0,configurable:!0}),e.prototype.getValue=function(){for(var t=[],e=0;e0;)this.elements.pop().dealloc();this.elements=null},e}();t.OptionsList=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;if(i.maxFileSize=1e11,i.loading=!1,i.submitTimer=0,i._fileName="",i._readerResult="",!t.Helpers.caniuse.fileReader())throw new Error("Conversational Form Error: No FileReader available for client.");var o=i.referenceTag.domElement.getAttribute("cf-max-size")||i.referenceTag.domElement.getAttribute("max-size");if(o){var s=parseInt(o,10);i.maxFileSize=s}return i.progressBar=i.el.getElementsByTagName("cf-upload-file-progress-bar")[0],i.onDomElementChangeCallback=i.onDomElementChange.bind(i),i.referenceTag.domElement.addEventListener("change",i.onDomElementChangeCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.referenceTag.domElement.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"readerResult",{get:function(){return this._readerResult},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"files",{get:function(){return this._files},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fileName",{get:function(){return this._fileName},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return"UploadFileUI"},enumerable:!0,configurable:!0}),n.prototype.getFilesAsString=function(){var e=document.createElement("span");return e.innerHTML=t.Dictionary.get("icon-type-file")+this.fileName,e.outerHTML},n.prototype.onDomElementChange=function(e){var n=this;t.ConversationalForm.suppressLog||console.log("...onDomElementChange");var i=new FileReader;this._files=this.referenceTag.domElement.files,i.onerror=function(e){t.ConversationalForm.suppressLog||console.log("onerror",e)},i.onprogress=function(e){t.ConversationalForm.suppressLog||console.log("onprogress",e),n.progressBar.style.width=e.loaded/e.total*100+"%"},i.onabort=function(e){t.ConversationalForm.suppressLog||console.log("onabort",e)},i.onloadstart=function(e){var o=n.files[0],s=o?o.size:n.maxFileSize+1;if(s>n.maxFileSize){i.abort();var r={errorText:t.Dictionary.get("input-placeholder-file-size-error")};t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,r),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:r}))}else{n._fileName=o.name,n.loading=!0,n.animateIn();var a=Math.floor(Math.log(s)/Math.log(1024)),l=["b","kb","mb","gb"];a=Math.min(l.length-1,a);var c=1*Number((s/Math.pow(1024,a)).toFixed(2))+" "+l[a],h=o.name+" ("+c+")";n.el.getElementsByTagName("cf-upload-file-text")[0].innerHTML=h,n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.BUSY}))}},i.onload=function(e){n._readerResult=e.target.result,n.progressBar.classList.add("loaded"),n.submitTimer=setTimeout(function(){n.el.classList.remove("animate-in"),n.onChoose(),n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.READY}))},0)},i.readAsDataURL(this.files[0])},n.prototype.animateIn=function(){this.loading&&e.prototype.animateIn.call(this)},n.prototype.onClick=function(t){},n.prototype.triggerFileSelect=function(){this.referenceTag.domElement.click()},n.prototype.dealloc=function(){clearTimeout(this.submitTimer),this.progressBar=null,this.onDomElementChangeCallback&&(this.referenceTag.domElement.removeEventListener("change",this.onDomElementChangeCallback,!1),this.onDomElementChangeCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){"1"==this.referenceTag.value||this.referenceTag.domElement.hasAttribute("checked")
-;return"\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t\t"},n}(t.Button);t.UploadFileUI=e}(cf||(cf={}));var cf;!function(t){t.MicrophoneBridgeEvent={ERROR:"cf-microphone-bridge-error",TERMNIAL_ERROR:"cf-microphone-bridge-terminal-error"};var e=function(){function e(e){this.currentTextResponse="",this._hasUserMedia=!1,this.inputErrorCount=0,this.inputCurrentError="",this.el=e.el,this.button=e.button,this.eventTarget=e.eventTarget,this.microphoneObj=e.microphoneObj,this.flowUpdateCallback=this.onFlowUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1)}return Object.defineProperty(e.prototype,"hasUserMedia",{set:function(t){this._hasUserMedia=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{set:function(t){this.equalizer&&(this.equalizer.disabled=!t)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this.button.loading=!1,this.microphoneObj.cancelInput&&this.microphoneObj.cancelInput()},e.prototype.onFlowUpdate=function(){var t=this;if(this.currentTextResponse=null,this._hasUserMedia)this.microphoneObj.awaitingCallback||this.callInput();else{var e=!1;window.navigator.mediaDevices&&window.navigator.mediaDevices.enumerateDevices().then(function(n){n.forEach(function(t){e||""===t.label||(e=!0)}),e&&t.getUserMedia()})}},e.prototype.getUserMedia=function(){var e=this;try{void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(t){var e=navigator.getUserMedia||window.navigator.webkitGetUserMedia||window.navigator.mozGetUserMedia;return e?new Promise(function(n,i){e.call(navigator,t,n,i)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({audio:!0}).then(function(t){e.currentStream=t,t.getAudioTracks().length>0?(e.hasUserMedia=!0,e.setupEqualizer(),e.microphoneObj.awaitingCallback||e.callInput()):e.hasUserMedia=!1}).catch(function(n){e.hasUserMedia=!1,e.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))})}catch(e){this.hasUserMedia=!1,this.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))}},e.prototype.dealloc=function(){this.cancel(),this.promise=null,this.currentStream=null,this.equalizer&&this.equalizer.dealloc(),this.equalizer=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null},e.prototype.callInput=function(e){var n=this;void 0===e&&(e=0),this.button.loading=!0,this.equalizer&&(this.equalizer.disabled=!1),this.promise=new Promise(function(t,e){return n.microphoneObj.input(t,e,n.currentStream)}).then(function(e){if(n.promise=null,n.currentTextResponse=e.toString(),!n.currentTextResponse||""==n.currentTextResponse)return n.showError(t.Dictionary.get("user-audio-reponse-invalid")),void n.callInput();n.inputErrorCount=0,n.inputCurrentError="",n.button.loading=!1;var i={text:n.currentTextResponse};t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.SUBMIT,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:i}))}).catch(function(e){n.isErrorTerminal(e)?(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)):(n.inputCurrentError!=e&&(n.inputErrorCount=0,n.inputCurrentError=e),n.inputErrorCount++,n.inputErrorCount>2?n.showError(e):(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)))})},e.prototype.isErrorTerminal=function(t){return-1!==["network"].indexOf(t)},e.prototype.showError=function(e){var n={errorText:e};t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.USER_INPUT_INVALID,n),this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:n})),this.callInput()},e.prototype.setupEqualizer=function(){var t=this.el.getElementsByTagName("cf-icon-audio-eq")[0];n.supported&&t&&(this.equalizer=new n({stream:this.currentStream,elementToScale:t}))},e}();t.MicrophoneBridge=e;var n=function(){function t(t){var e=this;this.maxBorderWidth=0,this._disabled=!1,this.elementToScale=t.elementToScale,this.context=new AudioContext,this.analyser=this.context.createAnalyser(),this.mic=this.context.createMediaStreamSource(t.stream),this.javascriptNode=this.context.createScriptProcessor(2048,1,1),this.analyser.smoothingTimeConstant=.3,this.analyser.fftSize=1024,this.mic.connect(this.analyser),this.analyser.connect(this.javascriptNode),this.javascriptNode.connect(this.context.destination),this.javascriptNode.onaudioprocess=function(){e.onAudioProcess()}}return Object.defineProperty(t.prototype,"disabled",{set:function(t){this._disabled=t,this.elementToScale.style.borderWidth="0px"},enumerable:!0,configurable:!0}),t.prototype.onAudioProcess=function(){if(!this._disabled){var t=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(t);for(var e=0,n=t.length,i=0;i\n\t\t\t\t
\n\t\t\t\t \n\t\t\t';var i=n.firstChild||n.content.firstChild;this.mic=new t.MicrophoneBridge({el:i,button:this,eventTarget:this.eventTarget,microphoneObj:e}),this.el.appendChild(i)},e.prototype.reset=function(){this.mic&&!this.typing&&this.mic.callInput()},e.prototype.getTemplate=function(){return'\n\t\t\t\t\t\t\n\t\t\t\t\t '},e.prototype.onMicrophoneTerminalError=function(e){this.mic&&(this.mic.dealloc(),this.mic=null,this.el.removeChild(this.el.getElementsByClassName("cf-microphone")[0]),this.el.classList.remove("microphone-interface"),this.loading=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:{errorText:e.detail}})))},e.prototype.onClick=function(e){this.mic&&!this.typing?this.mic.callInput():this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputSubmitButtonEvents.CHANGE))},e.prototype.click=function(){this.el.click()},e.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,this.onMicrophoneTerminalErrorCallback,!1),this.onMicrophoneTerminalErrorCallback=null,this.mic&&this.mic.dealloc(),this.mic=null,this.el.removeEventListener("click",this.onClickCallback,!1),this.onClickCallback=null,this.el=null,this.eventTarget=null},e}();t.UserInputSubmitButton=e}(cf||(cf={}));var cf;!function(t){t.UserInputTypes={VOICE:"voice",VR_GESTURE:"vr-gesture",TEXT:"text"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i._disabled=!1,i._visible=!1,i.onChatReponsesUpdatedCallback=i.onChatReponsesUpdated.bind(i),i.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,i.onChatReponsesUpdatedCallback,!1),i.windowFocusCallback=i.windowFocus.bind(i),window.addEventListener("focus",i.windowFocusCallback,!1),i.inputInvalidCallback=i.inputInvalid.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_INVALID,i.inputInvalidCallback,!1),i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"currentTag",{get:function(){return this._currentTag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this._visible=t,!this.el.classList.contains("animate-in")&&t?setTimeout(function(){e.el.classList.add("animate-in")},0):this.el.classList.contains("animate-in")&&!t&&this.el.classList.remove("animate-in")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled!=t&&(this._disabled=t,t?this.el.setAttribute("disabled","disabled"):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var e=0,n=0,i=this.el;return t.Helpers.isInternetExlorer()?(e=i.offsetHeight,n=parseInt(i.currentStyle.marginTop,10)+parseInt(i.currentStyle.marginBottom,10),n*=2):(e=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("height"),10),n=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-bottom"))),e+n},enumerable:!0,configurable:!0}),n.prototype.onEnterOrSubmitButtonSubmit=function(t){void 0===t&&(t=null)},n.prototype.inputInvalid=function(t){},n.prototype.deactivate=function(){this.disabled=!0},n.prototype.reactivate=function(){this.disabled=!1},n.prototype.getFlowDTO=function(){},n.prototype.setFocusOnInput=function(){},n.prototype.onFlowStopped=function(){},n.prototype.reset=function(){},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onChatReponsesUpdatedCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_INVALID,this.inputInvalidCallback,!1),this.inputInvalidCallback=null,window.removeEventListener("focus",this.windowFocusCallback,!1),this.windowFocusCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,e.prototype.dealloc.call(this)},n.prototype.onFlowUpdate=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this._currentTag=e.detail.tag},n.prototype.windowFocus=function(t){},n.prototype.onChatReponsesUpdated=function(t){t.detail.currentResponse.isRobotResponse||(this.visible=!0,this.disabled=!1,this.setFocusOnInput())},n.ERROR_TIME=2e3,n.preventAutoFocus=!1,n.hideUserInputOnNoneTextInput=!1,n}(t.BasicElement);t.UserInputElement=e,t.UserInputEvents={SUBMIT:"cf-input-user-input-submit",KEY_CHANGE:"cf-input-key-change",CONTROL_ELEMENTS_ADDED:"cf-input-control-elements-added",HEIGHT_CHANGE:"cf-input-height-change",FOCUS:"cf-input-focus",BLUR:"cf-input-blur"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.errorTimer=0,i.initialInputHeight=0,i.shiftIsDown=!1,i._active=!1,i.cfReference=n.cfReference,i.eventTarget=n.eventTarget,i.inputElement=i.el.getElementsByTagName("textarea")[0],i.onInputFocusCallback=i.onInputFocus.bind(i),i.onInputBlurCallback=i.onInputBlur.bind(i),i.inputElement.addEventListener("focus",i.onInputFocusCallback,!1),i.inputElement.addEventListener("blur",i.onInputBlurCallback,!1),i.controlElements=new t.ControlElements({el:i.el.getElementsByTagName("cf-input-control-elements")[0],cfReference:i.cfReference,infoEl:i.el.getElementsByTagName("cf-info")[0],eventTarget:i.eventTarget}),i.keyUpCallback=i.onKeyUp.bind(i),document.addEventListener("keyup",i.keyUpCallback,!1),i.keyDownCallback=i.onKeyDown.bind(i),document.addEventListener("keydown",i.keyDownCallback,!1),i.onOriginalTagChangedCallback=i.onOriginalTagChanged.bind(i),i.eventTarget.addEventListener(t.TagEvents.ORIGINAL_ELEMENT_CHANGED,i.onOriginalTagChangedCallback,!1),i.onControlElementSubmitCallback=i.onControlElementSubmit.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.SUBMIT_VALUE,i.onControlElementSubmitCallback,!1),i.onControlElementProgressChangeCallback=i.onControlElementProgressChange.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.PROGRESS_CHANGE,i.onControlElementProgressChangeCallback,!1),i.onSubmitButtonChangeStateCallback=i.onSubmitButtonChangeState.bind(i),i.eventTarget.addEventListener(t.UserInputSubmitButtonEvents.CHANGE,i.onSubmitButtonChangeStateCallback,!1),i.submitButton=new t.UserInputSubmitButton({eventTarget:i.eventTarget}),i.el.appendChild(i.submitButton.el),n.microphoneInputObj&&(i.microphoneObj=n.microphoneInputObj,i.microphoneObj&&i.microphoneObj.init&&i.microphoneObj.init(),i.submitButton.addMicrophone(i.microphoneObj)),i}return __extends(n,e),Object.defineProperty(n.prototype,"active",{get:function(){return this.inputElement===document.activeElement||this._active},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{set:function(e){var n=this._disabled!=e;t.ConversationalForm.suppressLog||console.log("option hasChanged",e),n&&(this._disabled=e,e?(this.el.setAttribute("disabled","disabled"),this.inputElement.blur()):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),n.prototype.getInputValue=function(){var t=this.inputElement.value,e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML},n.prototype.getFlowDTO=function(){var t;return t=this.controlElements&&this.controlElements.active?this.controlElements.getDTO():{text:this.getInputValue()},t.tag||(t.tag=this.currentTag),t.input=this,t.tag=this.currentTag,t},n.prototype.reset=function(){this.controlElements&&this.controlElements.clearTagsAndReset()},n.prototype.deactivate=function(){e.prototype.deactivate.call(this),this.microphoneObj&&(this.submitButton.active=!1)},n.prototype.reactivate=function(){e.prototype.reactivate.call(this),this.microphoneObj&&!this.submitButton.typing&&(this.submitButton.loading=!0,this.submitButton.typing=!1,this.submitButton.active=!0)},n.prototype.onFlowStopped=function(){this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.controlElements&&this.controlElements.clearTagsAndReset(),this.disabled=!0},n.prototype.onOriginalTagChanged=function(t){this.currentTag==t.detail.tag&&this.onInputChange(),this.controlElements&&this.controlElements.active&&this.controlElements.updateStateOnElementsFromTag(t.detail.tag)},n.prototype.onInputChange=function(){if(this.active||this.controlElements.active){var e=Math.max(this.initialInputHeight,parseInt(this.inputElement.style.height,10));this.inputElement.style.height="0px",this.inputElement.style.height=(0===this.inputElement.scrollHeight?e:this.inputElement.scrollHeight)+"px",t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.HEIGHT_CHANGE),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.HEIGHT_CHANGE,{detail:this.inputElement.scrollHeight}))}},n.prototype.inputInvalid=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;this.inputElement.setAttribute("data-value",this.inputElement.value),this.inputElement.value="",this.el.setAttribute("error",""),this.disabled=!0,this.inputElement.setAttribute("placeholder",i.errorText||(this._currentTag?this._currentTag.errorMessage:"")),clearTimeout(this.errorTimer),this.submitButton.loading=!1,this.errorTimer=setTimeout(function(){n.disabled=!1,t.ConversationalForm.suppressLog||console.log("option, disabled 1"),n.el.removeAttribute("error"),n.inputElement.value=n.inputElement.getAttribute("data-value"),n.inputElement.setAttribute("data-value",""),n.setPlaceholder(),n.setFocusOnInput(),n.submitButton.reset(),n.controlElements&&n.controlElements.resetAfterErrorMessage()},t.UserInputElement.ERROR_TIME)},n.prototype.setPlaceholder=function(){this._currentTag?this._currentTag.inputPlaceholder?this.inputElement.setAttribute("placeholder",this._currentTag.inputPlaceholder):this.inputElement.setAttribute("placeholder","group"==this._currentTag.type?t.Dictionary.get("group-placeholder"):t.Dictionary.get("input-placeholder")):this.inputElement.setAttribute("placeholder",t.Dictionary.get("group-placeholder"))},n.prototype.checkForCorrectInputTag=function(){var t=this.inputElement.getAttribute("type"),e="password"==this._currentTag.type&&"password"!=t,n="password"!=this._currentTag.type&&"password"==t,i="email"==this._currentTag.type&&"email"!=t||"number"==this._currentTag.type&&"number"!=t;if(this.inputElement&&(e||n)&&(this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1)),e||i){var o=document.createElement("input");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){o.setAttribute(t.name,t.value)}),o.setAttribute("autocomplete","new-password"),this.inputElement.parentNode.replaceChild(o,this.inputElement),this.inputElement=o,"number"!==this._currentTag.type&&"email"!==this._currentTag.type||(this.inputElement.type=this._currentTag.type,o.setAttribute("type",this._currentTag.type))}else if(n){var s=document.createElement("textarea");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){s.setAttribute(t.name,t.value)}),this.inputElement.parentNode.replaceChild(s,this.inputElement),this.inputElement=s}this.inputElement&&(e||n)&&(this.inputElement.addEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.addEventListener("blur",this.onInputBlurCallback,!1)),0==this.initialInputHeight&&(this.initialInputHeight=this.inputElement.offsetHeight),this.setFocusOnInput()},n.prototype.onFlowUpdate=function(n){var i=this;e.prototype.onFlowUpdate.call(this,n),this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.el.setAttribute("tag-type",this._currentTag.type),this.checkForCorrectInputTag();var o=-1!==["password","number","email"].indexOf(this._currentTag.type);this.inputElement.setAttribute("type",o?this._currentTag.type:"input"),clearTimeout(this.errorTimer),this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),this.inputElement.value="",this.submitButton.loading=!1,this.setPlaceholder(),this.resetValue(),this.setFocusOnInput(),this.controlElements.reset(),"group"==this._currentTag.type?this.buildControlElements(this._currentTag.elements):this.buildControlElements([this._currentTag]),"text"!=this._currentTag.type&&"email"!=this._currentTag.type||(this.inputElement.value=this._currentTag.defaultValue.toString()),t.UserInputElement.hideUserInputOnNoneTextInput&&(this.controlElements.active?(this.el.classList.add("hide-input"),this.controlElements.focusFrom("bottom")):this.el.classList.remove("hide-input")),setTimeout(function(){i.onInputChange()},150)},n.prototype.onControlElementProgressChange=function(e){var n=e.detail;this.disabled=n==t.ControlElementProgressStates.BUSY,t.ConversationalForm.suppressLog||console.log("option, disabled 2")},n.prototype.buildControlElements=function(t){this.controlElements.buildTags(t)},n.prototype.onControlElementSubmit=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var n=e.detail;this.controlElements.updateStateOnElements(n),this.doSubmit()},n.prototype.onSubmitButtonChangeState=function(t){this.onEnterOrSubmitButtonSubmit(t)},n.prototype.isMetaKeyPressed=function(t){t.metaKey||[91,93].indexOf(t.keyCode)},n.prototype.onKeyDown=function(e){(this.active||this.controlElements.focus)&&(this.isControlElementsActiveAndUserInputHidden()||this.isMetaKeyPressed(e)||(e.keyCode==t.Dictionary.keyCodes.shift&&(this.shiftIsDown=!0),e.keyCode!=t.Dictionary.keyCodes.enter||e.shiftKey||e.preventDefault()))},n.prototype.isControlElementsActiveAndUserInputHidden=function(){return this.controlElements&&this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput},n.prototype.onKeyUp=function(e){if((this.active||this.isControlElementsActiveAndUserInputHidden()||this.controlElements.focus)&&!this.isMetaKeyPressed(e)){if(e.keyCode==t.Dictionary.keyCodes.shift)this.shiftIsDown=!1;else if(e.keyCode==t.Dictionary.keyCodes.up)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("bottom");else if(e.keyCode==t.Dictionary.keyCodes.down)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("top");else if(e.keyCode==t.Dictionary.keyCodes.tab){for(var n=!1,i=e.target.parentNode;null!=i;){if(i===this.cfReference.el){n=!0;break}i=i.parentNode}n||(e.preventDefault(),this.controlElements.active||this.setFocusOnInput())}if(!this.el.hasAttribute("disabled")){var o=this.getFlowDTO();if(e.keyCode==t.Dictionary.keyCodes.enter&&!e.shiftKey||e.keyCode==t.Dictionary.keyCodes.space)if(e.keyCode==t.Dictionary.keyCodes.enter&&this.active)e.preventDefault(),this.onEnterOrSubmitButtonSubmit();else if(e.keyCode==t.Dictionary.keyCodes.enter||e.keyCode==t.Dictionary.keyCodes.space){e.preventDefault();var s="group"==this._currentTag.type?this._currentTag.getGroupTagType():this._currentTag.type;if("select"==s||"checkbox"==s){var r=this._currentTag;"checkbox"==s||r.multipleChoice?(this.active||this.isControlElementsActiveAndUserInputHidden())&&e.keyCode==t.Dictionary.keyCodes.enter?this.submitButton.click():(this.active||this.controlElements.active||this.isControlElementsActiveAndUserInputHidden()||(this.resetValue(),this.setFocusOnInput()),this.dispatchKeyChange(o,e.keyCode)):this.dispatchKeyChange(o,e.keyCode)}else"group"==this._currentTag.type&&this.dispatchKeyChange(o,e.keyCode)}else e.keyCode==t.Dictionary.keyCodes.space&&document.activeElement&&this.dispatchKeyChange(o,e.keyCode);else e.keyCode!=t.Dictionary.keyCodes.shift&&e.keyCode!=t.Dictionary.keyCodes.tab&&this.dispatchKeyChange(o,e.keyCode);this.onInputChange()}}},n.prototype.dispatchKeyChange=function(e,n){this.submitButton.typing=e.text&&e.text.length>0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.KEY_CHANGE,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.KEY_CHANGE,{detail:{dto:e,keyCode:n,inputFieldActive:this.active}}))},n.prototype.windowFocus=function(t){e.prototype.windowFocus.call(this,t),this.setFocusOnInput()},n.prototype.onInputBlur=function(e){this._active=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.BLUR))},n.prototype.onInputFocus=function(e){this._active=!0,this.onInputChange(),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.FOCUS))},n.prototype.setFocusOnInput=function(){t.UserInputElement.preventAutoFocus||this.el.classList.contains("hide-input")||this.inputElement.focus()},n.prototype.onEnterOrSubmitButtonSubmit=function(e){void 0===e&&(e=null);var n=this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput;(this.active||n)&&this.controlElements.highlighted?this.controlElements.clickOnHighlighted():this._currentTag?"file"==this._currentTag.type&&e?this.controlElements.getElement(0).triggerFileSelect():this.doSubmit():this.eventTarget.cf.addUserChatResponse(this.inputElement.value)},n.prototype.doSubmit=function(){var e=this.getFlowDTO();this.submitButton.loading=!0,this.disabled=!0,this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.SUBMIT,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:e}))},n.prototype.resetValue=function(){this.inputElement.value="",this.onInputChange()},n.prototype.dealloc=function(){this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1),this.onInputBlurCallback=null,this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.onInputFocusCallback=null,document.removeEventListener("keydown",this.keyDownCallback,!1),this.keyDownCallback=null,document.removeEventListener("keyup",this.keyUpCallback,!1),this.keyUpCallback=null,this.eventTarget.removeEventListener(t.ControlElementEvents.SUBMIT_VALUE,this.onControlElementSubmitCallback,!1),this.onControlElementSubmitCallback=null,this.submitButton.el.removeEventListener(t.UserInputSubmitButtonEvents.CHANGE,this.onSubmitButtonChangeStateCallback,!1),this.onSubmitButtonChangeStateCallback=null,this.submitButton.dealloc(),this.submitButton=null,e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return this.customTemplate||'\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\n\t\t\t\t\n\n\t\t\t \n\t\t\t'},n}(t.UserInputElement);t.UserTextInput=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatResponseEvents={USER_ANSWER_CLICKED:"cf-on-user-answer-clicked"};var e=function(e){function n(t){var n=e.call(this,t)||this;return n.readyTimer=0,n.container=t.container,n.uiOptions=t.cfReference.uiOptions,n._tag=t.tag,n}return __extends(n,e),Object.defineProperty(n.prototype,"tag",{get:function(){return this._tag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"added",{get:function(){return!!this.el.parentNode.parentNode},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.el.classList.contains("disabled")},set:function(t){t?this.el.classList.add("disabled"):this.el.classList.remove("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this.el.offsetWidth,setTimeout(function(){return t?e.el.classList.add("show"):e.el.classList.remove("show")},100)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strippedSesponse",{get:function(){var t=this.response,e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},enumerable:!0,configurable:!0}),n.prototype.whenReady=function(t){this.onReadyCallback=t},n.prototype.setValue=function(e){void 0===e&&(e=null),this.visible||(this.visible=!0);this.el.hasAttribute("thinking");if(e){if(this.response=this.originalResponse=e.text,this.processResponseAndSetText(),this.responseLink&&!this.isRobotResponse&&this.responseLink.processResponseAndSetText(),e&&e.controlElements&&e.controlElements[0])switch(e.controlElements[0].type){case"UploadFileUI":this.textEl.classList.add("file-icon")}this.isRobotResponse||this.onClickCallback||(this.onClickCallback=this.onClick.bind(this),this.el.addEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1))}else this.setToThinking()},n.prototype.show=function(){this.visible=!0,this.disabled=!1,this.response?this.checkForEditMode():this.setToThinking()},n.prototype.updateThumbnail=function(t){var e=this.el.getElementsByTagName("thumb")[0];if(0===t.indexOf("text:")){var n=e.getElementsByTagName("span")[0];n.innerHTML=t.split("text:")[1],n.setAttribute("length",t.length.toString())}else this.image=t,e.style.backgroundImage='url("'+this.image+'")'},n.prototype.setLinkToOtherReponse=function(t){this.responseLink=t},n.prototype.processResponseAndSetText=function(){var t=this;if(this.originalResponse){var e=this.originalResponse;if(this._tag&&"password"==this._tag.type&&!this.isRobotResponse){for(var i="",o=0;o"+n+"
";var e=t.textEl.getElementsByTagName("p");e[e.length-1].offsetWidth,e[e.length-1].classList.add("show"),t.scrollTo()},l+(e+1)*h.uiOptions.robot.chainedResponseTime)}(u);this.readyTimer=setTimeout(function(){t.onReadyCallback&&t.onReadyCallback(),t.onReadyCallback=null},l+c.length*this.uiOptions.robot.chainedResponseTime)}else{this.tryClearThinking(),this.textEl.innerHTML=""+e+"
";var p=this.textEl.getElementsByTagName("p");p[p.length-1].offsetWidth,p[p.length-1].classList.add("show"),this.scrollTo()}this.parsedResponse=e,this.addSelf(),this.textEl.removeAttribute("value-added"),setTimeout(function(){t.textEl.setAttribute("value-added",""),t.el.classList.add("peak-thumb")},0),this.checkForEditMode(),this.response=e.split("&&").join(" ")}},n.prototype.scrollTo=function(){var t=this.el.offsetTop,e=this.el.offsetHeight;this.container.scrollTop=t+e+this.container.scrollTop},n.prototype.checkForEditMode=function(){this.isRobotResponse||this.el.hasAttribute("thinking")||(this.el.classList.add("can-edit"),this.disabled=!1)},
-n.prototype.tryClearThinking=function(){this.el.hasAttribute("thinking")&&(this.textEl.innerHTML="",this.el.removeAttribute("thinking"))},n.prototype.setToThinking=function(){(this.isRobotResponse&&0!==this.uiOptions.robot.robotResponseTime||!this.isRobotResponse&&this.cfReference.uiOptions.user.showThinking)&&(this.textEl.innerHTML=n.THINKING_MARKUP,this.el.classList.remove("can-edit"),this.el.setAttribute("thinking","")),(this.cfReference.uiOptions.user.showThinking||this.cfReference.uiOptions.user.showThumb)&&this.addSelf()},n.prototype.addSelf=function(){this.el.parentNode!=this.container&&this.container.appendChild(this.el)},n.prototype.onClick=function(e){this.setToThinking(),t.ConversationalForm.illustrateFlow(this,"dispatch",t.ChatResponseEvents.USER_ANSWER_CLICKED,e),this.eventTarget.dispatchEvent(new CustomEvent(t.ChatResponseEvents.USER_ANSWER_CLICKED,{detail:this._tag}))},n.prototype.setData=function(t){this.image=t.image,this.response=this.originalResponse=t.response,this.isRobotResponse=t.isRobotResponse,e.prototype.setData.call(this,t)},n.prototype.onElementCreated=function(){var t=this;this.textEl=this.el.getElementsByTagName("text")[0],this.updateThumbnail(this.image),this.isRobotResponse||null!=this.response?setTimeout(function(){t.setValue({text:t.response})},0):this.cfReference.uiOptions.user.showThumb&&this.el.classList.add("peak-thumb")},n.prototype.dealloc=function(){clearTimeout(this.readyTimer),this.container=null,this.uiOptions=null,this.onReadyCallback=null,this.onClickCallback&&(this.el.removeEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1),this.onClickCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return'\n\t\t\t\t \n\t\t\t\t \n\t\t\t '},n.THINKING_MARKUP=". . .
",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t \n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.71",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n0||!!navigator.userAgent.match(/Trident.*rv\:11\./)},t.getValuesOfBars=function(t){var e=t.split("||");return e.length<=1&&(e=t.split("|")),e},t.setTransform=function(t,e){t.style["-webkit-transform"]=e,t.style["-moz-transform"]=e,t.style["-ms-transform"]=e,t.style.transform=e},t.extendObject=function(t,e){for(var n in e)e[n]&&e[n].constructor&&e[n].constructor===Object?(t[n]=t[n]||{},arguments.callee(t[n],e[n])):t[n]=e[n];return t},t.caniuse={fileReader:function(){return!!(window.File&&window.FileReader&&window.FileList&&window.Blob)}},t}();t.Helpers=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(t){void 0===t&&(t=null),this._cf=t,this.target=document.createDocumentFragment()}return Object.defineProperty(t.prototype,"cf",{get:function(){return this._cf},set:function(t){this._cf=t},enumerable:!0,configurable:!0}),t.prototype.addEventListener=function(t,e,n){return this.target.addEventListener(t,e,n)},t.prototype.dispatchEvent=function(t){return this.target.dispatchEvent(t)},t.prototype.removeEventListener=function(t,e,n){this.target.removeEventListener(t,e,n)},t}();t.EventDispatcher=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(){}return t.parseTag=function(t){var e=document.createElement(t.tag);e.setAttribute("cf-formless","");for(var n in t)"tag"!==n&&"children"!==n&&e.setAttribute(n,t[n]);return e},t.parseGroupTag=function(e){for(var n=t.parseTag(e),i=e.children,o=0;o0)for(var r=0;r ':"")+t.Helpers.getInnerTextOfElement(this.el)}else e=t.Helpers.getInnerTextOfElement(this.el);return e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"positionVector",{get:function(){return this._positionVector},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{set:function(t){this.el.tabIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"highlight",{get:function(){return this.el.classList.contains("highlight")},set:function(t){t?this.el.classList.add("highlight"):this.el.classList.remove("highlight")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"focus",{get:function(){return this._focus},set:function(t){this._focus=t,this._focus?this.el.focus():this.el.blur()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return!this.el.classList.contains("hide")},set:function(t){t?this.el.classList.remove("hide"):(this.el.classList.add("hide"),this.tabIndex=-1,this.highlight=!1)},enumerable:!0,configurable:!0}),n.prototype.onBlur=function(t){this._focus=!1},n.prototype.onFocus=function(e){this._focus=!0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.ON_FOCUS,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.ON_FOCUS,{detail:this.positionVector}))},n.prototype.hasImage=function(){return!1},n.prototype.calcPosition=function(){var t=parseInt(window.getComputedStyle(this.el).getPropertyValue("margin-right"),10);this._positionVector={height:this.el.offsetHeight,width:this.el.offsetWidth+t,x:this.el.offsetLeft,y:this.el.offsetTop,el:this},this._positionVector.centerX=this._positionVector.x+.5*this._positionVector.width,this._positionVector.centerY=this._positionVector.y+.5*this._positionVector.height},n.prototype.setData=function(t){this.referenceTag=t.referenceTag,e.prototype.setData.call(this,t)},n.prototype.animateIn=function(){clearTimeout(this.animateInTimer),this.el.classList.add("animate-in")},n.prototype.animateOut=function(){this.el.classList.add("animate-out")},n.prototype.onChoose=function(){t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.SUBMIT_VALUE,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.SUBMIT_VALUE,{detail:this}))},n.prototype.dealloc=function(){this.el.removeEventListener("blur",this.onBlurCallback,!1),this.onBlurCallback=null,this.el.removeEventListener("focus",this.onFocusCallback,!1),this.onFocusCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ControlElement=e}(cf||(cf={}));var cf;!function(t){t.ControlElementsEvents={ON_RESIZE:"cf-on-control-elements-resize",CHANGED:"cf-on-control-elements-changed"};var e=function(){function e(e){this.animateInFromReponseTimer=0,this.ignoreKeyboardInput=!1,this.rowIndex=-1,this.columnIndex=0,this.elementWidth=0,this.filterListNumberOfVisible=0,this.listWidth=0,this.el=e.el,this.eventTarget=e.eventTarget,this.cfReference=e.cfReference,this.list=this.el.getElementsByTagName("cf-list")[0],this.infoElement=e.infoEl,this.onScrollCallback=this.onScroll.bind(this),this.el.addEventListener("scroll",this.onScrollCallback,!1),this.onResizeCallback=this.onResize.bind(this),window.addEventListener("resize",this.onResizeCallback,!1),this.onElementFocusCallback=this.onElementFocus.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_FOCUS,this.onElementFocusCallback,!1),this.onElementLoadedCallback=this.onElementLoaded.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_LOADED,this.onElementLoadedCallback,!1),this.onChatReponsesUpdatedCallback=this.onChatReponsesUpdated.bind(this),this.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onUserInputKeyChangeCallback=this.onUserInputKeyChange.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,this.onUserInputKeyChangeCallback,!1),this.userInputUpdateCallback=this.onUserInputUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.listScrollController=new t.ScrollController({interactionListener:this.el,listToScroll:this.list,eventTarget:this.eventTarget,listNavButtons:this.el.getElementsByTagName("cf-list-button")})}return Object.defineProperty(e.prototype,"active",{get:function(){return this.elements&&this.elements.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focus",{get:function(){if(!this.elements)return!1;for(var t=this.getElements(),e=0;ethis.tableableRows[this.rowIndex].length-1&&(this.columnIndex=0),!0):(this.resetTabList(),!1)},e.prototype.updateRowIndex=function(t){var e=this.rowIndex;if(this.rowIndex+=t,this.tableableRows[this.rowIndex])for(var n=this.tableableRows[e]?this.tableableRows[e][this.columnIndex].positionVector.centerX:0,i=this.tableableRows[this.rowIndex],o=1e13,s=0;sMath.abs(n-r.positionVector.centerX)&&(o=Math.abs(n-r.positionVector.centerX),this.columnIndex=s)}},e.prototype.resetTabList=function(){this.rowIndex=-1,this.columnIndex=-1},e.prototype.onUserInputUpdate=function(t){if(this.el.classList.remove("animate-in"),this.infoElement.classList.remove("show"),this.elements)for(var e=this.getElements(),n=0;n1){for(var o=[],s=0;s0&&(o[0].highlight=!0)}},e.prototype.clickOnHighlighted=function(){for(var t=this.getElements(),e=0;e0){this.el.classList.contains("animate-in")||this.el.classList.add("animate-in");for(var e=0;e0&&"OptionsList"==this.elements[0].type?this.elements[0].elements:this.elements},e.prototype.buildTabableRows=function(){this.tableableRows=[],this.resetTabList();var t=this.getElements();if(this.el.classList.contains("two-row")){this.tableableRows[0]=[],this.tableableRows[1]=[];for(var e=0;e0)switch(this.elements[0].type){case"CheckboxButton":for(var n=0,i=[],o=0;o1)break}for(var o=0;o1&&(s.partOfSeveralChoices=!0),i.push(s.value)),e.controlElements.push(s)}e.text=t.Dictionary.parseAndGetMultiValueString(i);break;case"RadioButton":for(var o=0;o0;)this.elements.pop().dealloc();this.list.innerHTML="",this.onListChanged()},e.prototype.buildTags=function(e){var n=this;this.disabled=!1;this.el.parentNode.getElementsByTagName("ul")[0],this.el.parentNode.getElementsByTagName("ul")[1];this.clearTagsAndReset(),this.elements=[];for(var i=0;i0){var s=this.elements[this.elements.length-1];this.list.appendChild(s.el)}}var r=this.elements[0]&&"OptionsList"==this.elements[0].type;this.filterListNumberOfVisible=r?this.elements[0].elements.length:e.length,new Promise(function(t,e){return n.resize(t,e)}).then(function(){var e=n.list.offsetHeight,i={height:e};n.onListChanged(),t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.CONTROL_ELEMENTS_ADDED,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.CONTROL_ELEMENTS_ADDED,{detail:i}))})},e.prototype.onResize=function(t){this.resize()},e.prototype.resize=function(e,n){this.list.style.width="100%",this.el.classList.remove("resized"),this.el.classList.remove("one-row"),this.el.classList.remove("two-row"),this.elementWidth=0,this.listWidth=0;var i=this.getElements();if(i&&i.length>0){for(var o=[],s=[],r=!1,a=0;ac;u&&!r?(this.el.classList.add("two-row"),this.listWidth=Math.max(c,Math.round(o[Math.floor(o.length/2)]+50)),this.list.style.width=this.listWidth+"px"):this.el.classList.add("one-row");for(var a=0;ac;for(var h=i.slice(),p=h.sort(function(t,e){var n=t.positionVector.y>e.positionVector.y;return t.positionVector.x==e.positionVector.x?n?1:-1:t.positionVector.x0&&(this.xTarget+=(0-this.xTarget)*t.Helpers.lerp(e.accerlation,.3,.8)),this.xTargetthis.max&&(this.nextButton.classList.contains("active")||this.nextButton.classList.add("active"),this.nextButton.classList.contains("cf-gradient")||this.nextButton.classList.add("cf-gradient")),i<=this.max&&(this.nextButton.classList.contains("active")&&this.nextButton.classList.remove("active"),this.nextButton.classList.contains("cf-gradient")&&this.nextButton.classList.remove("cf-gradient"));var o=this.x;t.Helpers.setTransform(this.listToScroll,"translateX("+o+"px)"),(this.interacting||Math.abs(this.x-this.xTarget)>.02&&!this.interacting)&&(this.rAF=window.requestAnimationFrame(function(){return n.render()}))},e.prototype.setScroll=function(t,e){this.xTarget=this.visibleAreaWidth==this.listWidth?0:t,this.render()},e.prototype.pushDirection=function(t){this.inputAccerlationTarget+=5e3*t,this.render()},e.prototype.dealloc=function(){this.prevButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.nextButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.onListNavButtonsClickCallback=null,this.prevButton=null,this.nextButton=null,document.removeEventListener("mouseleave",this.documentLeaveCallback,!1),document.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.documentLeaveCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousedown"),this.onInteractStartCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.onInteractEndCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousemove"),this.onInteractMoveCallback,!1),this.documentLeaveCallback=null,this.onInteractStartCallback=null,this.onInteractEndCallback=null,this.onInteractMoveCallback=null},e.prototype.reset=function(){this.interacting=!1,this.startX=0,this.startXTarget=this.startX,this.inputAccerlation=0,this.x=0,this.xTarget=0,t.Helpers.setTransform(this.listToScroll,"translateX(0px)"),this.render(),this.prevButton.classList.remove("active"),this.nextButton.classList.remove("active")},e.prototype.resize=function(t,e){this.reset(),this.visibleAreaWidth=e,this.listWidth=Math.max(e,t),this.max=-1*(this.listWidth-this.visibleAreaWidth),this.render()},e.accerlation=.1,e}();t.ScrollController=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(t){this.data={"user-image":"https://cf-4053.kxcdn.com/conversational-form/human.png","entry-not-found":"Dictionary item not found.","awaiting-mic-permission":"Awaiting mic permission","user-audio-reponse-invalid":"I didn't get that, try again.","microphone-terminal-error":"Audio input not supported","input-placeholder":"Type your answer here ...","group-placeholder":"Type to filter list ...","input-placeholder-error":"Your input is not correct ...","input-placeholder-required":"Input is required ...","input-placeholder-file-error":"File upload failed ...","input-placeholder-file-size-error":"File size too big ...","input-no-filter":"No results found for {input-value} ","user-reponse-and":" and ","user-reponse-missing":"Missing input ...","user-reponse-missing-group":"Nothing selected ...",general:"General type1||General type2","icon-type-file":" "},this.robotData={"robot-image":"https://cf-4053.kxcdn.com/conversational-form/robot.png",input:"Please write some text.",text:"Please write some text.",checkbox:"Select as many as you want.",name:"What's your name?",
+email:"Need your e-mail.",password:"Please provide password",tel:"What's your phone number?",radio:"I need you to select one of these.",select:"Choose any of these options.",file:"Select a file to upload.",general:"General1||General2||General3.."},e.instance=this,t&&t.data&&(this.data=this.validateAndSetNewData(t.data,this.data)),t.userImage&&(this.data["user-image"]=t.userImage),t.robotImage&&(this.robotData["robot-image"]=t.robotImage),t&&t.robotData&&(this.robotData=this.validateAndSetNewData(t.robotData,this.robotData))}return e.get=function(n){var i=e.instance,o=i.data[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else o=i.data["entry-not-found"];return o},e.set=function(t,n,i){var o=e.instance,s="robot"==n?o.robotData:o.data;return s[t]=i,s[t]},e.getRobotResponse=function(n){var i=e.instance,o=i.robotData[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else{var r=t.Helpers.getValuesOfBars(i.robotData.general);o=r[Math.floor(Math.random()*r.length)]}return o},e.parseAndGetMultiValueString=function(t){for(var n="",i=0;i1&&i==t.length-2?e.get("user-reponse-and"):", ";n+=o+(i Tag registered:",this.type,this)),this.refresh()}return Object.defineProperty(Tag.prototype,"type",{get:function(){return this.domElement.getAttribute("type")||this.domElement.tagName.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"name",{get:function(){return this.domElement.getAttribute("name")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"id",{get:function(){return this.domElement.getAttribute("id")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"inputPlaceholder",{get:function(){return this._inputPlaceholder},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"formless",{get:function(){return cf.TagsParser.isElementFormless(this.domElement)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"label",{get:function(){return this.getLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"value",{get:function(){return this.domElement.value||this.initialDefaultValue},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"hasImage",{get:function(){return this.domElement.hasAttribute("cf-image")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"disabled",{get:function(){return!this.checkConditionalAndIsValid()||void 0!=this.domElement.getAttribute("disabled")&&null!=this.domElement.getAttribute("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"required",{get:function(){return!!this.domElement.getAttribute("required")||""==this.domElement.getAttribute("required")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"question",{get:function(){return this.questions&&0!=this.questions.length?this.questions[Math.floor(Math.random()*this.questions.length)]:cf.Dictionary.getRobotResponse(this.type)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"eventTarget",{set:function(t){this._eventTarget=t},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"errorMessage",{get:function(){return this.errorMessages||(this.domElement.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.getAttribute("cf-error")):this.domElement.parentNode&&this.domElement.parentNode.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.parentNode.getAttribute("cf-error")):this.required?this.errorMessages=[cf.Dictionary.get("input-placeholder-required")]:"file"==this.type?this.errorMessages=[cf.Dictionary.get("input-placeholder-file-error")]:this.errorMessages=[cf.Dictionary.get("input-placeholder-error")]),this.errorMessages[Math.floor(Math.random()*this.errorMessages.length)]},enumerable:!0,configurable:!0}),Tag.prototype.dealloc=function(){this.domElement.removeEventListener("change",this.changeCallback,!1),this.changeCallback=null,this.domElement=null,this.defaultValue=null,this.errorMessages=null,this.pattern=null,this._label=null,this.validationCallback=null,this.questions=null},Tag.testConditions=function(t,e){var n=function(e,n){return"object"==typeof n?n.test(e):t===n};if("string"==typeof t){for(var i=t,o=!1,s=0;s0},Tag.prototype.checkConditionalAndIsValid=function(){return!this.hasConditions()||this.flowManager.areConditionsInFlowFullfilled(this,this.conditionalTags)},Tag.prototype.setTagValueAndIsValid=function(t){var e=!0,n=t.text;this.pattern&&(e=this.pattern.test(n)),""==n&&this.required&&(e=!1);var i=parseInt(this.domElement.getAttribute("minlength"),10)||-1,o=parseInt(this.domElement.getAttribute("maxlength"),10)||-1;return-1!=i&&n.lengtho&&(e=!1),e&&"file"!=this.type&&(this.domElement.value=n),e},Tag.prototype.getLabel=function(){return this._label||this.findAndSetLabel(),this._label?this._label:cf.Dictionary.getRobotResponse(this.type)},Tag.prototype.findConditionalAttributes=function(){var t=this.domElement.attributes;if(t.length>0){this.conditionalTags=[];for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n&&n.name&&-1!==n.name.indexOf("cf-conditional")){for(var i=[],o=-1!==n.value.indexOf("||")?n.value.split("||"):n.value.split("&&"),s=0;s0&&(e=[t])}else if(e.length>0)for(var i=0;i TagGroup registered:",this.elements[0].type,this)),this.skipUserInput=!1}return Object.defineProperty(e.prototype,"required",{get:function(){for(var t=0;t0)return this.questions[Math.floor(Math.random()*this.questions.length)];if(this.elements[0]&&this.elements[0].question){return this.elements[0].question}return t.Dictionary.getRobotResponse(this.getGroupTagType())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeElements",{get:function(){return this._activeElements},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._values?this._values:[""]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){for(var t=0,e=0;e\n\t\t\t\t'+this.referenceTag.label+"\n\t\t\t\n\t\t\t"},n}(t.ControlElement);t.Button=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"RadioButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.el.hasAttribute("checked")&&"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.checked=!0,t.prototype.onClick.call(this,e)},e.prototype.getTemplate=function(){return'\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t"+this.referenceTag.label+" \n\t\t\t\t
\n\t\t\t \n\t\t\t"},e}(t.Button);t.RadioButton=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"CheckboxButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(t){this.checked=!this.checked},e.prototype.getTemplate=function(){var t=this.referenceTag.domElement.checked&&this.referenceTag.domElement.hasAttribute("checked");return'";return t+="",this.isMultiChoice&&(t+=" "),t+=this.referenceTag.label,t+="
",t+=" "},n}(t.Button);t.OptionButton=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(e){this.context=e.context,this.eventTarget=e.eventTarget,this.referenceTag=e.referenceTag,this.multiChoice=this.referenceTag.domElement.hasAttribute("multiple"),this.onOptionButtonClickCallback=this.onOptionButtonClick.bind(this),this.eventTarget.addEventListener(t.OptionButtonEvents.CLICK,this.onOptionButtonClickCallback,!1),this.createElements()}return Object.defineProperty(e.prototype,"type",{get:function(){return"OptionsList"},enumerable:!0,configurable:!0}),e.prototype.getValue=function(){for(var t=[],e=0;e0;)this.elements.pop().dealloc();this.elements=null},e}();t.OptionsList=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;if(i.maxFileSize=1e11,i.loading=!1,i.submitTimer=0,i._fileName="",i._readerResult="",!t.Helpers.caniuse.fileReader())throw new Error("Conversational Form Error: No FileReader available for client.");var o=i.referenceTag.domElement.getAttribute("cf-max-size")||i.referenceTag.domElement.getAttribute("max-size");if(o){var s=parseInt(o,10);i.maxFileSize=s}return i.progressBar=i.el.getElementsByTagName("cf-upload-file-progress-bar")[0],i.onDomElementChangeCallback=i.onDomElementChange.bind(i),i.referenceTag.domElement.addEventListener("change",i.onDomElementChangeCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.referenceTag.domElement.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"readerResult",{get:function(){return this._readerResult},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"files",{get:function(){return this._files},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fileName",{get:function(){return this._fileName},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return"UploadFileUI"},enumerable:!0,configurable:!0}),n.prototype.getFilesAsString=function(){var e=document.createElement("span");return e.innerHTML=t.Dictionary.get("icon-type-file")+this.fileName,e.outerHTML},n.prototype.onDomElementChange=function(e){var n=this;t.ConversationalForm.suppressLog||console.log("...onDomElementChange");var i=new FileReader;this._files=this.referenceTag.domElement.files,i.onerror=function(e){t.ConversationalForm.suppressLog||console.log("onerror",e)},i.onprogress=function(e){t.ConversationalForm.suppressLog||console.log("onprogress",e),n.progressBar.style.width=e.loaded/e.total*100+"%"},i.onabort=function(e){t.ConversationalForm.suppressLog||console.log("onabort",e)},i.onloadstart=function(e){var o=n.files[0],s=o?o.size:n.maxFileSize+1;if(s>n.maxFileSize){i.abort();var r={errorText:t.Dictionary.get("input-placeholder-file-size-error")};t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,r),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:r}))}else{n._fileName=o.name,n.loading=!0,n.animateIn();var a=Math.floor(Math.log(s)/Math.log(1024)),l=["b","kb","mb","gb"];a=Math.min(l.length-1,a);var c=1*Number((s/Math.pow(1024,a)).toFixed(2))+" "+l[a],u=o.name+" ("+c+")";n.el.getElementsByTagName("cf-upload-file-text")[0].innerHTML=u,n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.BUSY}))}},i.onload=function(e){n._readerResult=e.target.result,n.progressBar.classList.add("loaded"),n.submitTimer=setTimeout(function(){n.el.classList.remove("animate-in"),n.onChoose(),
+n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.READY}))},0)},i.readAsDataURL(this.files[0])},n.prototype.animateIn=function(){this.loading&&e.prototype.animateIn.call(this)},n.prototype.onClick=function(t){},n.prototype.triggerFileSelect=function(){this.referenceTag.domElement.click()},n.prototype.dealloc=function(){clearTimeout(this.submitTimer),this.progressBar=null,this.onDomElementChangeCallback&&(this.referenceTag.domElement.removeEventListener("change",this.onDomElementChangeCallback,!1),this.onDomElementChangeCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){"1"==this.referenceTag.value||this.referenceTag.domElement.hasAttribute("checked");return"\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t\t"},n}(t.Button);t.UploadFileUI=e}(cf||(cf={}));var cf;!function(t){t.MicrophoneBridgeEvent={ERROR:"cf-microphone-bridge-error",TERMNIAL_ERROR:"cf-microphone-bridge-terminal-error"};var e=function(){function e(e){this.currentTextResponse="",this._hasUserMedia=!1,this.inputErrorCount=0,this.inputCurrentError="",this.el=e.el,this.button=e.button,this.eventTarget=e.eventTarget,this.microphoneObj=e.microphoneObj,this.flowUpdateCallback=this.onFlowUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1)}return Object.defineProperty(e.prototype,"hasUserMedia",{set:function(t){this._hasUserMedia=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{set:function(t){this.equalizer&&(this.equalizer.disabled=!t)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this.button.loading=!1,this.microphoneObj.cancelInput&&this.microphoneObj.cancelInput()},e.prototype.onFlowUpdate=function(){var t=this;if(this.currentTextResponse=null,this._hasUserMedia)this.microphoneObj.awaitingCallback||this.callInput();else{var e=!1;window.navigator.mediaDevices&&window.navigator.mediaDevices.enumerateDevices().then(function(n){n.forEach(function(t){e||""===t.label||(e=!0)}),e&&t.getUserMedia()})}},e.prototype.getUserMedia=function(){var e=this;try{void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(t){var e=navigator.getUserMedia||window.navigator.webkitGetUserMedia||window.navigator.mozGetUserMedia;return e?new Promise(function(n,i){e.call(navigator,t,n,i)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({audio:!0}).then(function(t){e.currentStream=t,t.getAudioTracks().length>0?(e.hasUserMedia=!0,e.setupEqualizer(),e.microphoneObj.awaitingCallback||e.callInput()):e.hasUserMedia=!1}).catch(function(n){e.hasUserMedia=!1,e.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))})}catch(e){this.hasUserMedia=!1,this.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))}},e.prototype.dealloc=function(){this.cancel(),this.promise=null,this.currentStream=null,this.equalizer&&this.equalizer.dealloc(),this.equalizer=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null},e.prototype.callInput=function(e){var n=this;void 0===e&&(e=0),this.button.loading=!0,this.equalizer&&(this.equalizer.disabled=!1),this.promise=new Promise(function(t,e){return n.microphoneObj.input(t,e,n.currentStream)}).then(function(e){if(n.promise=null,n.currentTextResponse=e.toString(),!n.currentTextResponse||""==n.currentTextResponse)return n.showError(t.Dictionary.get("user-audio-reponse-invalid")),void n.callInput();n.inputErrorCount=0,n.inputCurrentError="",n.button.loading=!1;var i={text:n.currentTextResponse};t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.SUBMIT,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:i}))}).catch(function(e){n.isErrorTerminal(e)?(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)):(n.inputCurrentError!=e&&(n.inputErrorCount=0,n.inputCurrentError=e),n.inputErrorCount++,n.inputErrorCount>2?n.showError(e):(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)))})},e.prototype.isErrorTerminal=function(t){return-1!==["network"].indexOf(t)},e.prototype.showError=function(e){var n={errorText:e};t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.USER_INPUT_INVALID,n),this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:n})),this.callInput()},e.prototype.setupEqualizer=function(){var t=this.el.getElementsByTagName("cf-icon-audio-eq")[0];n.supported&&t&&(this.equalizer=new n({stream:this.currentStream,elementToScale:t}))},e}();t.MicrophoneBridge=e;var n=function(){function t(t){var e=this;this.maxBorderWidth=0,this._disabled=!1,this.elementToScale=t.elementToScale,this.context=new AudioContext,this.analyser=this.context.createAnalyser(),this.mic=this.context.createMediaStreamSource(t.stream),this.javascriptNode=this.context.createScriptProcessor(2048,1,1),this.analyser.smoothingTimeConstant=.3,this.analyser.fftSize=1024,this.mic.connect(this.analyser),this.analyser.connect(this.javascriptNode),this.javascriptNode.connect(this.context.destination),this.javascriptNode.onaudioprocess=function(){e.onAudioProcess()}}return Object.defineProperty(t.prototype,"disabled",{set:function(t){this._disabled=t,this.elementToScale.style.borderWidth="0px"},enumerable:!0,configurable:!0}),t.prototype.onAudioProcess=function(){if(!this._disabled){var t=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(t);for(var e=0,n=t.length,i=0;i\n\t\t\t\t
\n\t\t\t\t \n\t\t\t';var i=n.firstChild||n.content.firstChild;this.mic=new t.MicrophoneBridge({el:i,button:this,eventTarget:this.eventTarget,microphoneObj:e}),this.el.appendChild(i)},e.prototype.reset=function(){this.mic&&!this.typing&&this.mic.callInput()},e.prototype.getTemplate=function(){return'\n\t\t\t\t\t\t\n\t\t\t\t\t '},e.prototype.onMicrophoneTerminalError=function(e){this.mic&&(this.mic.dealloc(),this.mic=null,this.el.removeChild(this.el.getElementsByClassName("cf-microphone")[0]),this.el.classList.remove("microphone-interface"),this.loading=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:{errorText:e.detail}})))},e.prototype.onClick=function(e){this.mic&&!this.typing?this.mic.callInput():this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputSubmitButtonEvents.CHANGE))},e.prototype.click=function(){this.el.click()},e.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,this.onMicrophoneTerminalErrorCallback,!1),this.onMicrophoneTerminalErrorCallback=null,this.mic&&this.mic.dealloc(),this.mic=null,this.el.removeEventListener("click",this.onClickCallback,!1),this.onClickCallback=null,this.el=null,this.eventTarget=null},e}();t.UserInputSubmitButton=e}(cf||(cf={}));var cf;!function(t){t.UserInputTypes={VOICE:"voice",VR_GESTURE:"vr-gesture",TEXT:"text"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i._disabled=!1,i._visible=!1,i.onChatReponsesUpdatedCallback=i.onChatReponsesUpdated.bind(i),i.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,i.onChatReponsesUpdatedCallback,!1),i.windowFocusCallback=i.windowFocus.bind(i),window.addEventListener("focus",i.windowFocusCallback,!1),i.inputInvalidCallback=i.inputInvalid.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_INVALID,i.inputInvalidCallback,!1),i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"currentTag",{get:function(){return this._currentTag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this._visible=t,!this.el.classList.contains("animate-in")&&t?setTimeout(function(){e.el.classList.add("animate-in")},0):this.el.classList.contains("animate-in")&&!t&&this.el.classList.remove("animate-in")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled!=t&&(this._disabled=t,t?this.el.setAttribute("disabled","disabled"):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var e=0,n=0,i=this.el;return t.Helpers.isInternetExlorer()?(e=i.offsetHeight,n=parseInt(i.currentStyle.marginTop,10)+parseInt(i.currentStyle.marginBottom,10),n*=2):(e=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("height"),10),n=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-bottom"))),e+n},enumerable:!0,configurable:!0}),n.prototype.onEnterOrSubmitButtonSubmit=function(t){void 0===t&&(t=null)},n.prototype.inputInvalid=function(t){},n.prototype.deactivate=function(){this.disabled=!0},n.prototype.reactivate=function(){this.disabled=!1},n.prototype.getFlowDTO=function(){},n.prototype.setFocusOnInput=function(){},n.prototype.onFlowStopped=function(){},n.prototype.reset=function(){},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onChatReponsesUpdatedCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_INVALID,this.inputInvalidCallback,!1),this.inputInvalidCallback=null,window.removeEventListener("focus",this.windowFocusCallback,!1),this.windowFocusCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,e.prototype.dealloc.call(this)},n.prototype.onFlowUpdate=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this._currentTag=e.detail.tag},n.prototype.windowFocus=function(t){},n.prototype.onChatReponsesUpdated=function(t){t.detail.currentResponse.isRobotResponse||(this.visible=!0,this.disabled=!1,this.setFocusOnInput())},n.ERROR_TIME=2e3,n.preventAutoFocus=!1,n.hideUserInputOnNoneTextInput=!1,n}(t.BasicElement);t.UserInputElement=e,t.UserInputEvents={SUBMIT:"cf-input-user-input-submit",KEY_CHANGE:"cf-input-key-change",CONTROL_ELEMENTS_ADDED:"cf-input-control-elements-added",HEIGHT_CHANGE:"cf-input-height-change",FOCUS:"cf-input-focus",BLUR:"cf-input-blur"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.errorTimer=0,i.initialInputHeight=0,i.shiftIsDown=!1,i._active=!1,i.cfReference=n.cfReference,i.eventTarget=n.eventTarget,i.inputElement=i.el.getElementsByTagName("textarea")[0],i.onInputFocusCallback=i.onInputFocus.bind(i),i.onInputBlurCallback=i.onInputBlur.bind(i),i.inputElement.addEventListener("focus",i.onInputFocusCallback,!1),i.inputElement.addEventListener("blur",i.onInputBlurCallback,!1),i.controlElements=new t.ControlElements({el:i.el.getElementsByTagName("cf-input-control-elements")[0],cfReference:i.cfReference,infoEl:i.el.getElementsByTagName("cf-info")[0],eventTarget:i.eventTarget}),i.keyUpCallback=i.onKeyUp.bind(i),document.addEventListener("keyup",i.keyUpCallback,!1),i.keyDownCallback=i.onKeyDown.bind(i),document.addEventListener("keydown",i.keyDownCallback,!1),i.onOriginalTagChangedCallback=i.onOriginalTagChanged.bind(i),i.eventTarget.addEventListener(t.TagEvents.ORIGINAL_ELEMENT_CHANGED,i.onOriginalTagChangedCallback,!1),i.onControlElementSubmitCallback=i.onControlElementSubmit.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.SUBMIT_VALUE,i.onControlElementSubmitCallback,!1),i.onControlElementProgressChangeCallback=i.onControlElementProgressChange.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.PROGRESS_CHANGE,i.onControlElementProgressChangeCallback,!1),i.onSubmitButtonChangeStateCallback=i.onSubmitButtonChangeState.bind(i),i.eventTarget.addEventListener(t.UserInputSubmitButtonEvents.CHANGE,i.onSubmitButtonChangeStateCallback,!1),i.submitButton=new t.UserInputSubmitButton({eventTarget:i.eventTarget}),i.el.appendChild(i.submitButton.el),n.microphoneInputObj&&(i.microphoneObj=n.microphoneInputObj,i.microphoneObj&&i.microphoneObj.init&&i.microphoneObj.init(),i.submitButton.addMicrophone(i.microphoneObj)),i}return __extends(n,e),Object.defineProperty(n.prototype,"active",{get:function(){return this.inputElement===document.activeElement||this._active},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{set:function(e){var n=this._disabled!=e;t.ConversationalForm.suppressLog||console.log("option hasChanged",e),n&&(this._disabled=e,e?(this.el.setAttribute("disabled","disabled"),this.inputElement.blur()):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),n.prototype.getInputValue=function(){var t=this.inputElement.value,e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML},n.prototype.getFlowDTO=function(){var t;return t=this.controlElements&&this.controlElements.active?this.controlElements.getDTO():{text:this.getInputValue()},t.tag||(t.tag=this.currentTag),t.input=this,t.tag=this.currentTag,t},n.prototype.reset=function(){this.controlElements&&this.controlElements.clearTagsAndReset()},n.prototype.deactivate=function(){e.prototype.deactivate.call(this),this.microphoneObj&&(this.submitButton.active=!1)},n.prototype.reactivate=function(){e.prototype.reactivate.call(this),this.microphoneObj&&!this.submitButton.typing&&(this.submitButton.loading=!0,this.submitButton.typing=!1,this.submitButton.active=!0)},n.prototype.onFlowStopped=function(){this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.controlElements&&this.controlElements.clearTagsAndReset(),this.disabled=!0},n.prototype.onOriginalTagChanged=function(t){this.currentTag==t.detail.tag&&this.onInputChange(),this.controlElements&&this.controlElements.active&&this.controlElements.updateStateOnElementsFromTag(t.detail.tag)},n.prototype.onInputChange=function(){if(this.active||this.controlElements.active){var e=Math.max(this.initialInputHeight,parseInt(this.inputElement.style.height,10));this.inputElement.style.height="0px",this.inputElement.style.height=(0===this.inputElement.scrollHeight?e:this.inputElement.scrollHeight)+"px",t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.HEIGHT_CHANGE),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.HEIGHT_CHANGE,{detail:this.inputElement.scrollHeight}))}},n.prototype.inputInvalid=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;this.inputElement.setAttribute("data-value",this.inputElement.value),this.inputElement.value="",this.el.setAttribute("error",""),this.disabled=!0,this.inputElement.setAttribute("placeholder",i.errorText||(this._currentTag?this._currentTag.errorMessage:"")),clearTimeout(this.errorTimer),this.submitButton.loading=!1,this.errorTimer=setTimeout(function(){n.disabled=!1,t.ConversationalForm.suppressLog||console.log("option, disabled 1"),n.el.removeAttribute("error"),n.inputElement.value=n.inputElement.getAttribute("data-value"),n.inputElement.setAttribute("data-value",""),n.setPlaceholder(),n.setFocusOnInput(),n.submitButton.reset(),n.controlElements&&n.controlElements.resetAfterErrorMessage()},t.UserInputElement.ERROR_TIME)},n.prototype.setPlaceholder=function(){this._currentTag?this._currentTag.inputPlaceholder?this.inputElement.setAttribute("placeholder",this._currentTag.inputPlaceholder):this.inputElement.setAttribute("placeholder","group"==this._currentTag.type?t.Dictionary.get("group-placeholder"):t.Dictionary.get("input-placeholder")):this.inputElement.setAttribute("placeholder",t.Dictionary.get("group-placeholder"))},n.prototype.checkForCorrectInputTag=function(){var t=this.inputElement.getAttribute("type"),e="password"==this._currentTag.type&&"password"!=t,n="password"!=this._currentTag.type&&"password"==t,i="email"==this._currentTag.type&&"email"!=t||"number"==this._currentTag.type&&"number"!=t;if(this.inputElement&&(e||n)&&(this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1)),e||i){var o=document.createElement("input");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){o.setAttribute(t.name,t.value)}),o.setAttribute("autocomplete","new-password"),this.inputElement.parentNode.replaceChild(o,this.inputElement),this.inputElement=o,"number"!==this._currentTag.type&&"email"!==this._currentTag.type||(this.inputElement.type=this._currentTag.type,o.setAttribute("type",this._currentTag.type))}else if(n){var s=document.createElement("textarea");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){s.setAttribute(t.name,t.value)}),this.inputElement.parentNode.replaceChild(s,this.inputElement),this.inputElement=s}this.inputElement&&(e||n)&&(this.inputElement.addEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.addEventListener("blur",this.onInputBlurCallback,!1)),0==this.initialInputHeight&&(this.initialInputHeight=this.inputElement.offsetHeight),this.setFocusOnInput()},n.prototype.onFlowUpdate=function(n){var i=this;e.prototype.onFlowUpdate.call(this,n),this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.el.setAttribute("tag-type",this._currentTag.type),this.checkForCorrectInputTag();var o=-1!==["password","number","email"].indexOf(this._currentTag.type);this.inputElement.setAttribute("type",o?this._currentTag.type:"input"),clearTimeout(this.errorTimer),this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),this.inputElement.value="",this.submitButton.loading=!1,this.setPlaceholder(),this.resetValue(),this.setFocusOnInput(),this.controlElements.reset(),"group"==this._currentTag.type?this.buildControlElements(this._currentTag.elements):this.buildControlElements([this._currentTag]),"text"!=this._currentTag.type&&"email"!=this._currentTag.type||(this.inputElement.value=this._currentTag.defaultValue.toString()),!0===this._currentTag.skipUserInput&&this.el.classList.add("hide-input"),t.UserInputElement.hideUserInputOnNoneTextInput&&(this.controlElements.active?(this.el.classList.add("hide-input"),this.controlElements.focusFrom("bottom")):this.el.classList.remove("hide-input")),setTimeout(function(){i.onInputChange()},150)},n.prototype.onControlElementProgressChange=function(e){var n=e.detail;this.disabled=n==t.ControlElementProgressStates.BUSY,t.ConversationalForm.suppressLog||console.log("option, disabled 2")},n.prototype.buildControlElements=function(t){this.controlElements.buildTags(t)},n.prototype.onControlElementSubmit=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var n=e.detail;this.controlElements.updateStateOnElements(n),this.doSubmit()},n.prototype.onSubmitButtonChangeState=function(t){this.onEnterOrSubmitButtonSubmit(t)},n.prototype.isMetaKeyPressed=function(t){t.metaKey||[91,93].indexOf(t.keyCode)},n.prototype.onKeyDown=function(e){(this.active||this.controlElements.focus)&&(this.isControlElementsActiveAndUserInputHidden()||this.isMetaKeyPressed(e)||(e.keyCode==t.Dictionary.keyCodes.shift&&(this.shiftIsDown=!0),e.keyCode!=t.Dictionary.keyCodes.enter||e.shiftKey||e.preventDefault()))},n.prototype.isControlElementsActiveAndUserInputHidden=function(){return this.controlElements&&this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput},n.prototype.onKeyUp=function(e){if((this.active||this.isControlElementsActiveAndUserInputHidden()||this.controlElements.focus)&&!this.isMetaKeyPressed(e)){if(e.keyCode==t.Dictionary.keyCodes.shift)this.shiftIsDown=!1;else if(e.keyCode==t.Dictionary.keyCodes.up)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("bottom");else if(e.keyCode==t.Dictionary.keyCodes.down)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("top");else if(e.keyCode==t.Dictionary.keyCodes.tab){for(var n=!1,i=e.target.parentNode;null!=i;){if(i===this.cfReference.el){n=!0;break}i=i.parentNode}n||(e.preventDefault(),this.controlElements.active||this.setFocusOnInput())}if(!this.el.hasAttribute("disabled")){var o=this.getFlowDTO();if(e.keyCode==t.Dictionary.keyCodes.enter&&!e.shiftKey||e.keyCode==t.Dictionary.keyCodes.space)if(e.keyCode==t.Dictionary.keyCodes.enter&&this.active)e.preventDefault(),this.onEnterOrSubmitButtonSubmit();else if(e.keyCode==t.Dictionary.keyCodes.enter||e.keyCode==t.Dictionary.keyCodes.space){e.preventDefault();var s="group"==this._currentTag.type?this._currentTag.getGroupTagType():this._currentTag.type;if("select"==s||"checkbox"==s){var r=this._currentTag;"checkbox"==s||r.multipleChoice?(this.active||this.isControlElementsActiveAndUserInputHidden())&&e.keyCode==t.Dictionary.keyCodes.enter?this.submitButton.click():(this.active||this.controlElements.active||this.isControlElementsActiveAndUserInputHidden()||(this.resetValue(),this.setFocusOnInput()),this.dispatchKeyChange(o,e.keyCode)):this.dispatchKeyChange(o,e.keyCode)}else"group"==this._currentTag.type&&this.dispatchKeyChange(o,e.keyCode)}else e.keyCode==t.Dictionary.keyCodes.space&&document.activeElement&&this.dispatchKeyChange(o,e.keyCode);else e.keyCode!=t.Dictionary.keyCodes.shift&&e.keyCode!=t.Dictionary.keyCodes.tab&&this.dispatchKeyChange(o,e.keyCode);this.onInputChange()}}},n.prototype.dispatchKeyChange=function(e,n){this.submitButton.typing=e.text&&e.text.length>0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.KEY_CHANGE,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.KEY_CHANGE,{detail:{dto:e,keyCode:n,inputFieldActive:this.active}}))},n.prototype.windowFocus=function(t){e.prototype.windowFocus.call(this,t),this.setFocusOnInput()},n.prototype.onInputBlur=function(e){this._active=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.BLUR))},n.prototype.onInputFocus=function(e){this._active=!0,this.onInputChange(),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.FOCUS))},n.prototype.setFocusOnInput=function(){t.UserInputElement.preventAutoFocus||this.el.classList.contains("hide-input")||this.inputElement.focus()},n.prototype.onEnterOrSubmitButtonSubmit=function(e){void 0===e&&(e=null);var n=this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput;(this.active||n)&&this.controlElements.highlighted?this.controlElements.clickOnHighlighted():this._currentTag?"file"==this._currentTag.type&&e?this.controlElements.getElement(0).triggerFileSelect():this.doSubmit():this.eventTarget.cf.addUserChatResponse(this.inputElement.value)},n.prototype.doSubmit=function(){var e=this.getFlowDTO();this.submitButton.loading=!0,this.disabled=!0,this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.SUBMIT,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:e}))},n.prototype.resetValue=function(){this.inputElement.value="",this.onInputChange()},n.prototype.dealloc=function(){this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1),this.onInputBlurCallback=null,this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.onInputFocusCallback=null,document.removeEventListener("keydown",this.keyDownCallback,!1),this.keyDownCallback=null,document.removeEventListener("keyup",this.keyUpCallback,!1),this.keyUpCallback=null,this.eventTarget.removeEventListener(t.ControlElementEvents.SUBMIT_VALUE,this.onControlElementSubmitCallback,!1),this.onControlElementSubmitCallback=null,this.submitButton.el.removeEventListener(t.UserInputSubmitButtonEvents.CHANGE,this.onSubmitButtonChangeStateCallback,!1),this.onSubmitButtonChangeStateCallback=null,this.submitButton.dealloc(),this.submitButton=null,e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return this.customTemplate||'\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\n\t\t\t\t\n\n\t\t\t \n\t\t\t'},n}(t.UserInputElement);t.UserTextInput=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatResponseEvents={USER_ANSWER_CLICKED:"cf-on-user-answer-clicked"};var e=function(e){function n(t){var n=e.call(this,t)||this;return n.readyTimer=0,n.container=t.container,n.uiOptions=t.cfReference.uiOptions,n._tag=t.tag,n}return __extends(n,e),Object.defineProperty(n.prototype,"tag",{get:function(){return this._tag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"added",{get:function(){return!!this.el.parentNode.parentNode},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.el.classList.contains("disabled")},set:function(t){t?this.el.classList.add("disabled"):this.el.classList.remove("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this.el.offsetWidth,setTimeout(function(){return t?e.el.classList.add("show"):e.el.classList.remove("show")},100)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strippedSesponse",{get:function(){var t=this.response,e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},enumerable:!0,configurable:!0}),n.prototype.whenReady=function(t){this.onReadyCallback=t},n.prototype.setValue=function(e){void 0===e&&(e=null),this.visible||(this.visible=!0);this.el.hasAttribute("thinking");if(e){if(this.response=this.originalResponse=e.text,this.processResponseAndSetText(),this.responseLink&&!this.isRobotResponse&&this.responseLink.processResponseAndSetText(),e&&e.controlElements&&e.controlElements[0])switch(e.controlElements[0].type){case"UploadFileUI":this.textEl.classList.add("file-icon")}this.isRobotResponse||this.onClickCallback||(this.onClickCallback=this.onClick.bind(this),this.el.addEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1))}else this.setToThinking()},n.prototype.show=function(){this.visible=!0,this.disabled=!1,this.response?this.checkForEditMode():this.setToThinking()},n.prototype.updateThumbnail=function(t){var e=this.el.getElementsByTagName("thumb")[0];if(0===t.indexOf("text:")){var n=e.getElementsByTagName("span")[0];n.innerHTML=t.split("text:")[1],n.setAttribute("length",t.length.toString())}else this.image=t,e.style.backgroundImage='url("'+this.image+'")'},n.prototype.setLinkToOtherReponse=function(t){this.responseLink=t},n.prototype.processResponseAndSetText=function(){var t=this;if(this.originalResponse){var e=this.originalResponse;if(this._tag&&"password"==this._tag.type&&!this.isRobotResponse){for(var i="",o=0;o"+n+"";var e=t.textEl.getElementsByTagName("p");e[e.length-1].offsetWidth,e[e.length-1].classList.add("show"),t.scrollTo()},l+(e+1)*u.uiOptions.robot.chainedResponseTime)}(h);this.readyTimer=setTimeout(function(){
+t.onReadyCallback&&t.onReadyCallback(),t.onReadyCallback=null,!0===t._tag.skipUserInput&&setTimeout(function(){t._tag.flowManager.nextStep()},t.uiOptions.robot.chainedResponseTime)},l+c.length*this.uiOptions.robot.chainedResponseTime)}else{this.tryClearThinking(),this.textEl.innerHTML=""+e+"
";var p=this.textEl.getElementsByTagName("p");p[p.length-1].offsetWidth,p[p.length-1].classList.add("show"),this.scrollTo()}this.parsedResponse=e,this.addSelf(),this.textEl.removeAttribute("value-added"),setTimeout(function(){t.textEl.setAttribute("value-added",""),t.el.classList.add("peak-thumb")},0),this.checkForEditMode(),this.response=e.split("&&").join(" ")}},n.prototype.scrollTo=function(){var t=this.el.offsetTop,e=this.el.offsetHeight;this.container.scrollTop=t+e+this.container.scrollTop},n.prototype.checkForEditMode=function(){this.isRobotResponse||this.el.hasAttribute("thinking")||(this.el.classList.add("can-edit"),this.disabled=!1)},n.prototype.tryClearThinking=function(){this.el.hasAttribute("thinking")&&(this.textEl.innerHTML="",this.el.removeAttribute("thinking"))},n.prototype.setToThinking=function(){(this.isRobotResponse&&0!==this.uiOptions.robot.robotResponseTime||!this.isRobotResponse&&this.cfReference.uiOptions.user.showThinking)&&(this.textEl.innerHTML=n.THINKING_MARKUP,this.el.classList.remove("can-edit"),this.el.setAttribute("thinking","")),(this.cfReference.uiOptions.user.showThinking||this.cfReference.uiOptions.user.showThumb)&&this.addSelf()},n.prototype.addSelf=function(){this.el.parentNode!=this.container&&this.container.appendChild(this.el)},n.prototype.onClick=function(e){this.setToThinking(),t.ConversationalForm.illustrateFlow(this,"dispatch",t.ChatResponseEvents.USER_ANSWER_CLICKED,e),this.eventTarget.dispatchEvent(new CustomEvent(t.ChatResponseEvents.USER_ANSWER_CLICKED,{detail:this._tag}))},n.prototype.setData=function(t){this.image=t.image,this.response=this.originalResponse=t.response,this.isRobotResponse=t.isRobotResponse,e.prototype.setData.call(this,t)},n.prototype.onElementCreated=function(){var t=this;this.textEl=this.el.getElementsByTagName("text")[0],this.updateThumbnail(this.image),this.isRobotResponse||null!=this.response?setTimeout(function(){t.setValue({text:t.response})},0):this.cfReference.uiOptions.user.showThumb&&this.el.classList.add("peak-thumb")},n.prototype.dealloc=function(){clearTimeout(this.readyTimer),this.container=null,this.uiOptions=null,this.onReadyCallback=null,this.onClickCallback&&(this.el.removeEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1),this.onClickCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return'\n\t\t\t\t \n\t\t\t\t \n\t\t\t '},n.THINKING_MARKUP=". . .
",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t \n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.71",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/development-cf-robot-message.html b/src/development-cf-robot-message.html
new file mode 100644
index 000000000..47e978726
--- /dev/null
+++ b/src/development-cf-robot-message.html
@@ -0,0 +1,252 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/files/formless-test-data.json b/src/files/formless-test-data.json
index 2e9de08c2..26f6e2251 100644
--- a/src/files/formless-test-data.json
+++ b/src/files/formless-test-data.json
@@ -6,6 +6,10 @@
"submitCallback": "window.onFormlessSubmited"
},
"tags": [
+ {
+ "tag": "cf-robot-message",
+ "cf-questions": "Så er der formless bajer"
+ },
{
"tag": "select",
"cf-input-placeholder": "Choose one of the above..",
diff --git a/src/scripts/cf/ConversationalForm.ts b/src/scripts/cf/ConversationalForm.ts
index d2824f122..b27bc4e72 100644
--- a/src/scripts/cf/ConversationalForm.ts
+++ b/src/scripts/cf/ConversationalForm.ts
@@ -3,6 +3,7 @@
///
///
///
+///
///
///
///
@@ -261,7 +262,7 @@ namespace cf {
if(!this.tags || this.tags.length == 0){
this.tags = [];
- let fields: Array = [].slice.call(this.formEl.querySelectorAll("input, select, button, textarea"), 0);
+ let fields: Array = [].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"), 0);
for (var i = 0; i < fields.length; i++) {
const element = fields[i];
diff --git a/src/scripts/cf/form-tags/CfRobotMessageTag.ts b/src/scripts/cf/form-tags/CfRobotMessageTag.ts
new file mode 100644
index 000000000..3f0828f4c
--- /dev/null
+++ b/src/scripts/cf/form-tags/CfRobotMessageTag.ts
@@ -0,0 +1,19 @@
+///
+
+// namespace
+namespace cf {
+ // interface
+
+ // class
+ export class CfRobotMessageTag extends Tag {
+ constructor(options: ITagOptions){
+ super(options);
+ this.skipUserInput = true;
+ }
+
+ public dealloc(){
+ super.dealloc();
+ }
+ }
+}
+
diff --git a/src/scripts/cf/form-tags/Tag.ts b/src/scripts/cf/form-tags/Tag.ts
index 8ca97a84a..cc12f5469 100644
--- a/src/scripts/cf/form-tags/Tag.ts
+++ b/src/scripts/cf/form-tags/Tag.ts
@@ -3,6 +3,7 @@
///
///
///
+///
///
///
///
@@ -40,6 +41,7 @@ namespace cf {
required: boolean;
defaultValue: string | number;
disabled: boolean;
+ skipUserInput: boolean;
eventTarget: EventDispatcher;
flowManager: FlowManager;
hasConditions():boolean;
@@ -89,6 +91,8 @@ namespace cf {
public initialDefaultValue: string | number;
public validationCallback?: (dto: FlowDTO, success: () => void, error: (optionalErrorMessage?: string) => void) => void; // can be set through cf-validation attribute, get's called from FlowManager
+ public skipUserInput: boolean; // Used by cf-robot-message which has no input and is just a robot message
+
public get type (): string{
return this.domElement.getAttribute("type") || this.domElement.tagName.toLowerCase();
}
@@ -174,6 +178,8 @@ namespace cf {
// remove tabIndex from the dom element.. danger zone... should we or should we not...
this.domElement.tabIndex = -1;
+ this.skipUserInput = false;
+
// questions array
if(options.questions)
this.questions = options.questions;
@@ -321,6 +327,10 @@ namespace cf {
tag = new OptionTag({
domElement: element
});
+ }else if(element.tagName.toLowerCase() == "cf-robot-message"){
+ tag = new CfRobotMessageTag({
+ domElement: element
+ });
}
return tag;
diff --git a/src/scripts/cf/form-tags/TagGroup.ts b/src/scripts/cf/form-tags/TagGroup.ts
index f55ea9f3a..8afb747b3 100644
--- a/src/scripts/cf/form-tags/TagGroup.ts
+++ b/src/scripts/cf/form-tags/TagGroup.ts
@@ -24,6 +24,7 @@ namespace cf {
dealloc():void;
required: boolean;
disabled: boolean;
+ skipUserInput: boolean;
flowManager: FlowManager;
inputPlaceholder?: string;
}
@@ -43,6 +44,8 @@ namespace cf {
private _fieldset: HTMLFieldSetElement;
protected _inputPlaceholder: string;
+ public skipUserInput: boolean;
+
// event target..
public defaultValue: string; // not getting set... as taggroup differs from tag
public elements: Array ;
@@ -152,6 +155,8 @@ namespace cf {
if(ConversationalForm.illustrateAppFlow)
if(!ConversationalForm.suppressLog) console.log('Conversational Form > TagGroup registered:', this.elements[0].type, this);
+
+ this.skipUserInput = false;
}
public dealloc(){
diff --git a/src/scripts/cf/ui/chat/ChatResponse.ts b/src/scripts/cf/ui/chat/ChatResponse.ts
index a3d90d1b3..4435093cb 100644
--- a/src/scripts/cf/ui/chat/ChatResponse.ts
+++ b/src/scripts/cf/ui/chat/ChatResponse.ts
@@ -16,7 +16,7 @@ namespace cf {
}
export const ChatResponseEvents = {
- USER_ANSWER_CLICKED: "cf-on-user-answer-clicked",
+ USER_ANSWER_CLICKED: "cf-on-user-answer-clicked"
}
// class
@@ -234,6 +234,13 @@ namespace cf {
// reset, as it can be called again
this.onReadyCallback = null;
+
+ if(this._tag.skipUserInput === true){
+ setTimeout(() =>{
+ this._tag.flowManager.nextStep()
+ },this.uiOptions.robot.chainedResponseTime);
+ }
+
}, robotInitResponseTime + (chainedResponses.length * this.uiOptions.robot.chainedResponseTime));
}else{
// user response, act normal
@@ -288,7 +295,7 @@ namespace cf {
}
private setToThinking(){
- const canShowThinking: boolean = (this.isRobotResponse && this.uiOptions.robot.robotResponseTime !== 0) || (!this.isRobotResponse && this.cfReference.uiOptions.user.showThinking);
+ const canShowThinking: boolean = (this.isRobotResponse && this.uiOptions.robot.robotResponseTime !== 0) || (!this.isRobotResponse && this.cfReference.uiOptions.user.showThinking && !this._tag.skipUserInput);
if(canShowThinking){
this.textEl.innerHTML = ChatResponse.THINKING_MARKUP;
this.el.classList.remove("can-edit");
diff --git a/src/scripts/cf/ui/inputs/UserTextInput.ts b/src/scripts/cf/ui/inputs/UserTextInput.ts
index 248b197d5..6e3900cfd 100644
--- a/src/scripts/cf/ui/inputs/UserTextInput.ts
+++ b/src/scripts/cf/ui/inputs/UserTextInput.ts
@@ -357,6 +357,12 @@ namespace cf {
this.inputElement.value = this._currentTag.defaultValue.toString();
}
+ if(this._currentTag.skipUserInput === true){
+ this.el.classList.add("hide-input");
+ } else {
+ this.el.classList.remove("hide-input");
+ }
+
if(UserInputElement.hideUserInputOnNoneTextInput){
// toggle userinput hide
if(this.controlElements.active){
diff --git a/src/scripts/development-cf-robot-message--formless.html b/src/scripts/development-cf-robot-message--formless.html
new file mode 100644
index 000000000..7ce88510b
--- /dev/null
+++ b/src/scripts/development-cf-robot-message--formless.html
@@ -0,0 +1,526 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 0bfc78e7bffecee212e085a11564c5183b8bc87f Mon Sep 17 00:00:00 2001
From: Jordi Tarrida
Date: Mon, 12 Feb 2018 10:51:48 +0100
Subject: [PATCH 2/6] changes in style files structure and add to variables
(fix #219)
---
.gitignore | 1 +
dist/conversational-form.css | 1131 +++++++----------
dist/conversational-form.min.css | 2 +-
gulp-tasks/styles.js | 52 +-
package.json | 3 +
src/styles/{cf/cf.scss => _cf-base.scss} | 0
src/styles/_cf-variables.scss | 46 +
src/styles/cf/_cf-variables.scss | 48 -
src/styles/main.scss | 23 +
src/styles/mixins/_cf-mixins.scss | 2 +-
.../{cf/ui/cf-info.scss => ui/_cf-info.scss} | 0
.../ui/cf-input.scss => ui/_cf-input.scss} | 0
.../_cf-list-button.scss} | 0
.../chat/_cf-chat-response.scss} | 0
.../cf-chat.scss => ui/chat/_cf-chat.scss} | 0
.../control-elements/_cf-button.scss} | 0
.../_cf-checkbox-button.scss} | 0
.../_cf-control-elements.scss} | 0
.../control-elements/_cf-options-list.scss} | 0
.../control-elements/_cf-radio-button.scss} | 0
.../control-elements/_cf-upload-file-ui.scss} | 0
21 files changed, 538 insertions(+), 770 deletions(-)
rename src/styles/{cf/cf.scss => _cf-base.scss} (100%)
create mode 100644 src/styles/_cf-variables.scss
delete mode 100644 src/styles/cf/_cf-variables.scss
create mode 100644 src/styles/main.scss
rename src/styles/{cf/ui/cf-info.scss => ui/_cf-info.scss} (100%)
rename src/styles/{cf/ui/cf-input.scss => ui/_cf-input.scss} (100%)
rename src/styles/{cf/ui/cf-list-button.scss => ui/_cf-list-button.scss} (100%)
rename src/styles/{cf/ui/chat/cf-chat-response.scss => ui/chat/_cf-chat-response.scss} (100%)
rename src/styles/{cf/ui/chat/cf-chat.scss => ui/chat/_cf-chat.scss} (100%)
rename src/styles/{cf/ui/control-elements/cf-button.scss => ui/control-elements/_cf-button.scss} (100%)
rename src/styles/{cf/ui/control-elements/cf-checkbox-button.scss => ui/control-elements/_cf-checkbox-button.scss} (100%)
rename src/styles/{cf/ui/control-elements/cf-control-elements.scss => ui/control-elements/_cf-control-elements.scss} (100%)
rename src/styles/{cf/ui/control-elements/cf-options-list.scss => ui/control-elements/_cf-options-list.scss} (100%)
rename src/styles/{cf/ui/control-elements/cf-radio-button.scss => ui/control-elements/_cf-radio-button.scss} (100%)
rename src/styles/{cf/ui/control-elements/cf-upload-file-ui.scss => ui/control-elements/_cf-upload-file-ui.scss} (100%)
diff --git a/.gitignore b/.gitignore
index a327b044c..284a66793 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
node_modules
bower_components
.vscode
+package-lock.json
/build
src/scripts/typings
docs/build/conversational-form-docs.css
diff --git a/dist/conversational-form.css b/dist/conversational-form.css
index 6c1060534..19f542e6b 100644
--- a/dist/conversational-form.css
+++ b/dist/conversational-form.css
@@ -1,3 +1,13 @@
+@charset "UTF-8";
+/*
+ Globals
+*/
+/*
+ Response
+*/
+/*
+ Input
+*/
/*
Globals
*/
@@ -63,15 +73,10 @@
height: auto;
overflow: hidden;
margin-bottom: auto;
- display: -webkit-box;
display: flex;
- -webkit-box-orient: vertical;
- -webkit-box-direction: normal;
- flex-flow: column nowrap;
- -webkit-box-pack: end;
- justify-content: flex-end;
- -webkit-box-align: baseline;
- align-items: baseline; }
+ flex-flow: column nowrap;
+ justify-content: flex-end;
+ align-items: baseline; }
.conversational-form--enable-animation .conversational-form {
transition: opacity 0.1875s cubic-bezier(0.215, 0.61, 0.355, 1); }
.conversational-form * {
@@ -81,7 +86,6 @@
.conversational-form--show {
opacity: 1; }
-@charset "UTF-8";
/*
Globals
*/
@@ -91,230 +95,28 @@
/*
Input
*/
-cf-input-control-elements {
- width: auto;
- height: auto;
- overflow: hidden;
- display: block;
- position: relative;
+cf-info {
+ position: absolute;
+ pointer-events: none;
z-index: 0;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- visibility: hidden;
- height: auto; }
- cf-input-control-elements .cf-button {
- margin-bottom: 10px;
- display: inline-block; }
- cf-input-control-elements .cf-button.hide {
- display: none; }
- cf-input-control-elements.resized {
- visibility: visible;
- height: auto; }
- cf-input-control-elements.one-row cf-list {
- height: auto; }
- cf-input-control-elements.one-row cf-list-button {
- opacity: 0; }
- cf-input-control-elements.two-row cf-list {
- white-space: normal;
- height: auto; }
-
-cf-list, cf-list-button {
- will-change: height; }
- .conversational-form--enable-animation cf-list, .conversational-form--enable-animation cf-list-button {
- transition: height 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
-
-cf-input[tag-type="file"] cf-list {
- cursor: default; }
-
-cf-list {
- display: block;
+ left: 2px;
+ top: 0px;
height: auto;
- cursor: move;
- white-space: nowrap; }
- cf-list.disabled {
- pointer-events: none; }
-
-/*
- Globals
-*/
-/*
- Response
-*/
-/*
- Input
-*/
-.cf-button {
- background: white;
- cursor: pointer;
- border: 1px solid rgba(13, 131, 255, 0.1);
- border-radius: calc(20px * 1.2);
- color: #409dff;
- line-height: 1;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
+ width: 100%;
+ text-overflow: ellipsis;
+ padding-right: 20px;
overflow: hidden;
- -webkit-transform: translateZ(0px);
- transform: translateZ(0px);
- -webkit-transform-origin: 0% 100%;
- transform-origin: 0% 100%;
- will-change: opacity, background;
- opacity: 0; }
- .cf-button > div {
- padding: 12px 24px; }
- .cf-button.has-image {
- max-width: 180px; }
- .cf-button > div {
- position: relative; }
- .conversational-form--enable-animation .cf-button {
- transition: opacity 0s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1); }
- .cf-button.animate-in {
- opacity: 1; }
- .conversational-form--enable-animation .cf-button.animate-in {
- transition-duration: 0.375s, 0.75s;
- transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1); }
- .conversational-form--enable-animation .cf-button.animate-in:nth-child(even) {
- transition-delay: 0.05s, 0s; }
- .conversational-form--enable-animation .cf-button.animate-in:nth-child(odd) {
- transition-delay: 0.15s, 0s; }
- .cf-button.animate-in.animate-out {
- -webkit-transform-origin: 75% 100%;
- transform-origin: 75% 100%;
- opacity: 0; }
- .cf-button:not(:last-child) {
- margin-right: 10px; }
- .cf-button:hover:not(.cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"], .cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"]), .cf-button:hover:not([checked="checked"]), .cf-button:focus:not(.cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"], .cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"]), .cf-button:focus:not([checked="checked"]) {
- background: rgba(13, 131, 255, 0.1); }
- .cf-button[selected="selected"]:not(:focus):not(:hover):not(.highlight), .cf-button[checked="checked"]:not(:focus):not(:hover):not(.highlight) {
- background: rgba(13, 131, 255, 0.1); }
- .cf-button[disabled="disabled"] {
- pointer-events: none; }
- .cf-button[disabled="disabled"].animate-in {
- opacity: 0.5; }
- .cf-button:active > div {
- opacity: 0.2; }
- .cf-button .cf-image {
- width: 100%;
- height: auto;
- will-change: opacity;
- transition: opacity 0.75s cubic-bezier(0.215, 0.61, 0.355, 1);
- opacity: 0; }
- .cf-button .cf-image.loaded {
- opacity: 1; }
-
-/*
- Globals
-*/
-/*
- Response
-*/
-/*
- Input
-*/
-cf-radio-button.cf-button:hover cf-radio, cf-radio-button.cf-button.highlight cf-radio, cf-radio-button.cf-button:focus cf-radio {
- background: #409dff; }
-
-cf-radio-button.cf-button.has-image cf-checkbox {
- margin-left: 0px; }
-
-cf-radio-button.cf-button cf-radio {
- display: block;
- float: left;
- width: 14px;
- height: 14px;
- border-radius: 50%;
- background: #e3f1ff;
- will-change: background;
- margin-right: 10px;
- margin-left: -10px;
- margin-top: -1px;
- position: relative; }
- .conversational-form--enable-animation cf-radio-button.cf-button cf-radio {
- transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
-
-cf-radio-button.cf-button[checked="checked"] cf-radio {
- background: #409dff;
- pointer-events: none; }
-
-/*
- Globals
-*/
-/*
- Response
-*/
-/*
- Input
-*/
-.cf-button.cf-checkbox-button:hover cf-checkbox, .cf-button.cf-checkbox-button.highlight cf-checkbox, .cf-button.cf-checkbox-button:focus cf-checkbox {
- background: #409dff; }
-
-.cf-button.cf-checkbox-button.no-text {
- padding: 12px 16px; }
- .cf-button.cf-checkbox-button.no-text cf-checkbox {
- margin-right: 0px;
- margin-left: 0px; }
-
-.cf-button.cf-checkbox-button.has-image cf-checkbox {
- margin-left: 0px; }
-
-.cf-button.cf-checkbox-button cf-checkbox {
- display: block;
- float: left;
- width: 14px;
- height: 14px;
- border-radius: 3px;
- background: #e3f1ff;
- will-change: background;
- margin-right: 10px;
- margin-left: -10px;
- margin-top: -1px;
- position: relative; }
- .conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox {
- transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
- .cf-button.cf-checkbox-button cf-checkbox:after {
- content: "";
- position: absolute;
- top: 2px;
- left: 1px;
- display: block;
- width: 13px;
- height: 10px;
- background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='13px' height='10px' viewBox='0 0 13 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-290.000000, -505.000000)' fill='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 216.000000)'%3e%3cg transform='translate(189.000000, 139.000000)'%3e%3cpolygon points='17.5 18.5 16 20 20 24 29 15.5 27.5 14 20 21'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
- background-size: 13px 10px;
- background-repeat: no-repeat;
- -webkit-transform-origin: 50% 50%;
- transform-origin: 50% 50%;
- will-change: transform;
- -webkit-transform: scale(0, 0);
- transform: scale(0, 0); }
- .conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox:after {
- transition: -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
-
-.cf-button.cf-checkbox-button[checked="checked"] cf-checkbox, .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox {
- background: rgba(227, 241, 255, 0); }
- .cf-button.cf-checkbox-button[checked="checked"] cf-checkbox:after, .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox:after {
- -webkit-transform: scale(1, 1);
- transform: scale(1, 1); }
- .conversational-form--enable-animation .cf-button.cf-checkbox-button[checked="checked"] cf-checkbox:after, .conversational-form--enable-animation .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox:after {
- transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
-
-/*
- Globals
-*/
-/*
- Response
-*/
-/*
- Input
-*/
-cf-options-list {
display: block;
- width: auto; }
+ transform: translateY(-115%);
+ color: #acb2b6;
+ opacity: 0;
+ will-change: opacity; }
+ cf-info.show {
+ opacity: 1; }
+ .conversational-form--enable-animation cf-info.show {
+ transition: opacity 0.75s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ cf-info strong {
+ font-weight: 900; }
/*
Globals
@@ -325,112 +127,24 @@ cf-options-list {
/*
Input
*/
-cf-upload-file-ui {
+cf-input {
display: block;
+ position: relative;
width: 100%;
- height: 45px;
- position: absolute;
- top: 0px;
- padding-right: 30px;
- color: #409dff;
- opacity: 0;
- -webkit-transform: translateY(20px) rotateX(30deg);
- transform: translateY(20px) rotateX(30deg);
- will-change: opacity, transform; }
- .conversational-form--enable-animation cf-upload-file-ui {
- transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
- cf-upload-file-ui.animate-in {
+ height: auto;
+ margin-bottom: 20px;
+ margin-top: 0px;
+ flex: 0 0 auto;
+ /*input {
+ padding: 5px 5px 5px 15px;
+ }*/ }
+ cf-input.animate-in input, cf-input.animate-in textarea {
+ transition-delay: 0s, 0s, 0s, 0.4s, 0.4s;
opacity: 1;
- -webkit-transform: translateY(0px) rotateX(0deg);
- transform: translateY(0px) rotateX(0deg); }
- .conversational-form--enable-animation cf-upload-file-ui.animate-in {
- transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1); }
-
-cf-upload-file-text {
- display: block;
- float: left;
- width: auto;
- height: 100%;
- padding-left: 40px;
- padding-right: 30px;
- padding-top: 17px;
- position: relative;
- color: currentColor;
- max-width: 50%;
- text-overflow: ellipsis;
- overflow: hidden; }
- cf-upload-file-text:before {
- content: "";
- display: inline-block;
- position: absolute;
- top: 17px;
- left: 23px;
- width: 10px;
- height: 14px;
- background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 10 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-756.000000, -549.000000)' fill='#0D83FF'%3e%3cg transform='translate(736.000000, 127.000000)'%3e%3cg transform='translate(0.000000, 406.000000)'%3e%3cpolygon points='20 16 26.0030799 16 30 19.99994 30 30 20 30'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
- background-repeat: no-repeat;
- background-size: 10px 14px; }
-
-cf-upload-file-progress {
- display: block;
- height: 100%;
- overflow: hidden;
- position: relative;
- padding-right: 30px; }
- cf-upload-file-progress:after {
- content: "";
- width: 100%;
- background: #f7f7f7;
- border-radius: 7px; }
- cf-upload-file-progress:after, cf-upload-file-progress cf-upload-file-progress-bar {
- display: block;
- height: 10px;
- position: absolute;
- top: 19px;
- z-index: 1; }
- cf-upload-file-progress cf-upload-file-progress-bar {
- width: 0%;
- will-change: width, border-radius;
- background: currentColor;
- z-index: 2;
- border-radius: 7px 0px 0px 7px; }
- .conversational-form--enable-animation cf-upload-file-progress cf-upload-file-progress-bar {
- transition: width 0.15s linear, border-radius 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
- cf-upload-file-progress cf-upload-file-progress-bar.loaded {
- border-radius: 7px 7px 7px 7px; }
-
-/*
- Globals
-*/
-/*
- Response
-*/
-/*
- Input
-*/
-cf-input {
- display: block;
- position: relative;
- width: 100%;
- height: auto;
- margin-bottom: 20px;
- margin-top: 0px;
- -webkit-box-flex: 0;
- flex: 0 0 auto;
- /*input {
- padding: 5px 5px 5px 15px;
- }*/ }
- cf-input.animate-in input, cf-input.animate-in textarea {
- transition-delay: 0s, 0s, 0s, 0.4s, 0.4s;
- opacity: 1;
- -webkit-transform: translateY(0px) rotateX(0deg);
- transform: translateY(0px) rotateX(0deg); }
+ transform: translateY(0px) rotateX(0deg); }
cf-input.animate-in cf-input-button.cf-input-button {
transition-delay: 0s, 0s 0.75s;
- -webkit-transform: scale(1, 1);
- transform: scale(1, 1); }
+ transform: scale(1, 1); }
cf-input input, cf-input textarea {
resize: none;
overflow: hidden;
@@ -459,16 +173,13 @@ cf-input {
background: white;
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.15);
opacity: 0;
- -webkit-transform: translateY(40px) rotateX(-40deg);
- transform: translateY(40px) rotateX(-40deg); }
+ transform: translateY(40px) rotateX(-40deg); }
cf-input input:-webkit-autofill, cf-input textarea:-webkit-autofill {
background-color: white; }
cf-input input:focus, cf-input input:active, cf-input textarea:focus, cf-input textarea:active {
box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.2); }
.conversational-form--enable-animation cf-input input, .conversational-form--enable-animation cf-input textarea {
- transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
- transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
- transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s; }
+ transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; }
cf-input input:hover::-webkit-input-placeholder, cf-input textarea:hover::-webkit-input-placeholder {
color: #768086; }
cf-input input:hover::-moz-input-placeholder, cf-input textarea:hover::-moz-input-placeholder {
@@ -531,18 +242,15 @@ cf-input {
border-radius: 50%;
border-left: 0;
border-top: 0;
- -webkit-animation: cf-spin 1s linear infinite;
- animation: cf-spin 1s linear infinite;
+ animation: cf-spin 1s linear infinite;
will-change: opacity; }
.conversational-form--enable-animation cf-input[tag-type="file"] cf-input-button.cf-input-button:after, .conversational-form--enable-animation cf-input cf-input-button.cf-input-button.loading:after {
transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
cf-input[tag-type="file"] cf-input-button.cf-input-button div.cf-icon-attachment {
- -webkit-transform: rotateX(0deg);
- transform: rotateX(0deg);
+ transform: rotateX(0deg);
opacity: 1; }
cf-input[tag-type="file"] cf-input-button.cf-input-button div.cf-icon-progress {
- -webkit-transform: rotateX(-90deg);
- transform: rotateX(-90deg);
+ transform: rotateX(-90deg);
opacity: 0; }
cf-input-button.cf-input-button {
@@ -557,48 +265,35 @@ cf-input-button.cf-input-button {
cursor: pointer;
border-radius: 50%;
will-change: background, border;
- -webkit-transform-origin: 50% 50%;
- transform-origin: 50% 50%;
- -webkit-transform: scale(0, 0);
- transform: scale(0, 0);
+ transform-origin: 50% 50%;
+ transform: scale(0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
border: 1px solid white; }
.conversational-form--enable-animation cf-input-button.cf-input-button {
- transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
- transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
- transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s; }
+ transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s; }
cf-input-button.cf-input-button .cf-input-icons.cf-microphone {
- -webkit-transform: scale(0, 0);
- transform: scale(0, 0);
+ transform: scale(0, 0);
pointer-events: none; }
cf-input-button.cf-input-button.microphone-interface .cf-input-icons {
- -webkit-transform-origin: 50% 50%;
- transform-origin: 50% 50%;
- -webkit-transform: scale(1, 1) rotateX(0deg) translateZ(0px);
- transform: scale(1, 1) rotateX(0deg) translateZ(0px);
- transition: -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ transform-origin: 50% 50%;
+ transform: scale(1, 1) rotateX(0deg) translateZ(0px);
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
cf-input-button.cf-input-button.microphone-interface .cf-input-icons:not(.cf-microphone) {
pointer-events: none;
- -webkit-transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
- transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px); }
+ transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px); }
cf-input-button.cf-input-button.microphone-interface .cf-input-icons.cf-microphone {
pointer-events: auto;
- -webkit-transform: scale(1, 1) rotateX(0deg) translateZ(0px);
- transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
+ transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) {
pointer-events: none; }
cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) .cf-microphone div.cf-icon-audio {
opacity: 1; }
cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons:not(.cf-microphone) {
pointer-events: auto;
- -webkit-transform: scale(1, 1) rotateX(0deg) translateZ(0px);
- transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
+ transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons.cf-microphone {
- -webkit-transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
- transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
+ transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
pointer-events: none; }
cf-input-button.cf-input-button .cf-input-icons {
position: absolute;
@@ -613,28 +308,22 @@ cf-input-button.cf-input-button {
z-index: 1;
background-repeat: no-repeat;
background-position: 50% 50%;
- -webkit-transform-origin: 50% 50%;
- transform-origin: 50% 50%;
+ transform-origin: 50% 50%;
will-change: transform, opacity; }
.conversational-form--enable-animation cf-input-button.cf-input-button .cf-input-icons > div {
- transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
cf-input-button.cf-input-button div.cf-icon-attachment {
- -webkit-transform: rotateX(90deg);
- transform: rotateX(90deg);
+ transform: rotateX(90deg);
opacity: 0;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
background-size: 12px 16px; }
cf-input-button.cf-input-button div.cf-icon-progress {
- -webkit-transform: rotateX(0deg);
- transform: rotateX(0deg);
+ transform: rotateX(0deg);
opacity: 1;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='#0D83FF'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
background-size: 30px 30px; }
cf-input-button.cf-input-button div.cf-icon-audio {
- -webkit-transform: rotateX(0deg);
- transform: rotateX(0deg);
+ transform: rotateX(0deg);
opacity: 1;
background-image: url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='#0D83FF' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e ");
background-size: 26px 26px; }
@@ -647,8 +336,7 @@ cf-input-button.cf-input-button {
opacity: 0; }
@media (min-width: 768px) {
cf-input-button.cf-input-button:hover .cf-icon-progress, cf-input-button.cf-input-button:focus .cf-icon-progress {
- -webkit-animation: cf-arrow-up 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
- animation: cf-arrow-up 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
+ animation: cf-arrow-up 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
/**
* Show submit button for groups when input is hidden
@@ -666,125 +354,37 @@ cf-input[tag-type="group"].hide-input cf-input-control-elements {
cf-input[error=""].hide-input cf-input-button .cf-icon-progress {
-webkit-filter: saturate(0);
filter: saturate(0);
- -webkit-animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
- animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
-
-@-webkit-keyframes shake {
- 10%, 90% {
- -webkit-transform: translate3d(-1px, 0, 0);
- transform: translate3d(-1px, 0, 0); }
- 20%, 80% {
- -webkit-transform: translate3d(1px, 0, 0);
- transform: translate3d(1px, 0, 0); }
- 30%, 50%, 70% {
- -webkit-transform: translate3d(-2px, 0, 0);
- transform: translate3d(-2px, 0, 0); }
- 40%, 60% {
- -webkit-transform: translate3d(2px, 0, 0);
- transform: translate3d(2px, 0, 0); } }
+ animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes shake {
10%, 90% {
- -webkit-transform: translate3d(-1px, 0, 0);
- transform: translate3d(-1px, 0, 0); }
+ transform: translate3d(-1px, 0, 0); }
20%, 80% {
- -webkit-transform: translate3d(1px, 0, 0);
- transform: translate3d(1px, 0, 0); }
+ transform: translate3d(1px, 0, 0); }
30%, 50%, 70% {
- -webkit-transform: translate3d(-2px, 0, 0);
- transform: translate3d(-2px, 0, 0); }
+ transform: translate3d(-2px, 0, 0); }
40%, 60% {
- -webkit-transform: translate3d(2px, 0, 0);
- transform: translate3d(2px, 0, 0); } }
-
-@-webkit-keyframes cf-spin {
- 0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg); }
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg); } }
+ transform: translate3d(2px, 0, 0); } }
@keyframes cf-spin {
0% {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg); }
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg); } }
-
-@-webkit-keyframes cf-arrow-up {
- 0% {
- -webkit-transform: translateY(0px);
- transform: translateY(0px); }
- 40% {
- -webkit-transform: translateY(-40px);
- transform: translateY(-40px); }
- 40.001% {
- -webkit-transform: translateY(40px);
- transform: translateY(40px); }
- 80% {
- -webkit-transform: translateY(-5px);
- transform: translateY(-5px); }
- 90% {
- -webkit-transform: translateY(2px);
- transform: translateY(2px); }
+ transform: rotate(0deg); }
100% {
- -webkit-transform: translateY(0px);
- transform: translateY(0px); } }
+ transform: rotate(360deg); } }
@keyframes cf-arrow-up {
0% {
- -webkit-transform: translateY(0px);
- transform: translateY(0px); }
+ transform: translateY(0px); }
40% {
- -webkit-transform: translateY(-40px);
- transform: translateY(-40px); }
+ transform: translateY(-40px); }
40.001% {
- -webkit-transform: translateY(40px);
- transform: translateY(40px); }
+ transform: translateY(40px); }
80% {
- -webkit-transform: translateY(-5px);
- transform: translateY(-5px); }
+ transform: translateY(-5px); }
90% {
- -webkit-transform: translateY(2px);
- transform: translateY(2px); }
+ transform: translateY(2px); }
100% {
- -webkit-transform: translateY(0px);
- transform: translateY(0px); } }
-
-/*
- Globals
-*/
-/*
- Response
-*/
-/*
- Input
-*/
-cf-info {
- position: absolute;
- pointer-events: none;
- z-index: 0;
- left: 2px;
- top: 0px;
- height: auto;
- width: 100%;
- text-overflow: ellipsis;
- padding-right: 20px;
- overflow: hidden;
- display: block;
- -webkit-transform: translateY(-115%);
- transform: translateY(-115%);
- color: #acb2b6;
- opacity: 0;
- will-change: opacity; }
- cf-info.show {
- opacity: 1; }
- .conversational-form--enable-animation cf-info.show {
- transition: opacity 0.75s cubic-bezier(0.215, 0.61, 0.355, 1); }
- cf-info strong {
- font-weight: 900; }
+ transform: translateY(0px); } }
/*
Globals
@@ -819,13 +419,11 @@ cf-list-button {
cf-list-button:hover:nth-child(1) {
background: linear-gradient(to left, rgba(255, 255, 255, 0) 0%, white 75%); }
cf-list-button:hover:nth-child(1):after {
- -webkit-animation: cf-arrow-left 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
- animation: cf-arrow-left 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); }
+ animation: cf-arrow-left 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); }
cf-list-button:hover:nth-child(2) {
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, white 75%); }
cf-list-button:hover:nth-child(2):after {
- -webkit-animation: cf-arrow-right 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
- animation: cf-arrow-right 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
+ animation: cf-arrow-right 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
cf-list-button.cf-gradient:before {
opacity: 1; }
cf-list-button.active {
@@ -870,110 +468,95 @@ cf-list-button {
.conversational-form--enable-animation cf-list-button:after {
transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
-@-webkit-keyframes cf-arrow-right {
- 0% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
- opacity: 1; }
- 40% {
- -webkit-transform: translateX(20px);
- transform: translateX(20px);
- opacity: 0; }
- 40.001% {
- -webkit-transform: translateX(-20px);
- transform: translateX(-20px);
- opacity: 0; }
- 80% {
- -webkit-transform: translateX(4px);
- transform: translateX(4px);
- opacity: 1; }
- 90% {
- -webkit-transform: translateX(-2px);
- transform: translateX(-2px);
- opacity: 1; }
- 100% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
- opacity: 1; } }
-
@keyframes cf-arrow-right {
0% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
- opacity: 1; }
- 40% {
- -webkit-transform: translateX(20px);
- transform: translateX(20px);
- opacity: 0; }
- 40.001% {
- -webkit-transform: translateX(-20px);
- transform: translateX(-20px);
- opacity: 0; }
- 80% {
- -webkit-transform: translateX(4px);
- transform: translateX(4px);
- opacity: 1; }
- 90% {
- -webkit-transform: translateX(-2px);
- transform: translateX(-2px);
- opacity: 1; }
- 100% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
- opacity: 1; } }
-
-@-webkit-keyframes cf-arrow-left {
- 0% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; }
40% {
- -webkit-transform: translateX(-20px);
- transform: translateX(-20px);
+ transform: translateX(20px);
opacity: 0; }
40.001% {
- -webkit-transform: translateX(20px);
- transform: translateX(20px);
+ transform: translateX(-20px);
opacity: 0; }
80% {
- -webkit-transform: translateX(-4px);
- transform: translateX(-4px);
+ transform: translateX(4px);
opacity: 1; }
90% {
- -webkit-transform: translateX(2px);
- transform: translateX(2px);
+ transform: translateX(-2px);
opacity: 1; }
100% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; } }
@keyframes cf-arrow-left {
0% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; }
40% {
- -webkit-transform: translateX(-20px);
- transform: translateX(-20px);
+ transform: translateX(-20px);
opacity: 0; }
40.001% {
- -webkit-transform: translateX(20px);
- transform: translateX(20px);
+ transform: translateX(20px);
opacity: 0; }
80% {
- -webkit-transform: translateX(-4px);
- transform: translateX(-4px);
+ transform: translateX(-4px);
opacity: 1; }
90% {
- -webkit-transform: translateX(2px);
- transform: translateX(2px);
+ transform: translateX(2px);
opacity: 1; }
100% {
- -webkit-transform: translateX(0px);
- transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; } }
+/*
+ Globals
+*/
+/*
+ Response
+*/
+/*
+ Input
+*/
+cf-chat {
+ display: block;
+ width: 100%;
+ height: auto;
+ min-height: 100%;
+ overflow: visible;
+ display: flex;
+ flex-flow: column nowrap;
+ justify-content: flex-end;
+ align-items: baseline;
+ margin-bottom: 20px; }
+ cf-chat scrollable {
+ display: block;
+ width: 100%;
+ height: auto;
+ max-height: 100%;
+ min-height: 40px;
+ overflow-y: auto;
+ padding-bottom: 20px;
+ padding-top: 40px; }
+ cf-chat scrollable::-webkit-scrollbar {
+ width: 4px;
+ height: 4px;
+ -webkit-appearance: none;
+ -webkit-border-radius: 100px; }
+ cf-chat scrollable::-webkit-scrollbar-track {
+ background: white;
+ -webkit-border-radius: 100px; }
+ cf-chat scrollable::-webkit-scrollbar-thumb:vertical {
+ background: #e3f1ff;
+ -webkit-border-radius: 100px; }
+ cf-chat scrollable::-webkit-scrollbar-thumb {
+ background: white;
+ border: none;
+ -webkit-border-radius: 100px; }
+ cf-chat scrollable::-webkit-scrollbar-thumb:vertical:active {
+ background: #7dbcff;
+ border: none;
+ -webkit-border-radius: 100px; }
+
/*
Globals
*/
@@ -1025,18 +608,15 @@ cf-chat-response {
left: auto;
right: 0px; }
cf-chat-response.user text {
- -webkit-transform-origin: 100% 0%;
- transform-origin: 100% 0%;
- -webkit-transform: translateY(-10px) translateX(-10px) scale(0.001, 0.001);
- transform: translateY(-10px) translateX(-10px) scale(0.001, 0.001); }
+ transform-origin: 100% 0%;
+ transform: translateY(-10px) translateX(-10px) scale(0.001, 0.001); }
cf-chat-response.user text > p {
background: #e3f1ff;
border-radius: 20px 0px 20px 20px;
margin-right: 0px;
margin-left: auto; }
cf-chat-response.user.peak-thumb thumb {
- -webkit-transform: scale(1, 1) translateY(0px);
- transform: scale(1, 1) translateY(0px);
+ transform: scale(1, 1) translateY(0px);
opacity: 1; }
.conversational-form--enable-animation cf-chat-response.user.peak-thumb thumb {
transition-delay: 0.2s, 0.2s, 0.2s; }
@@ -1059,10 +639,8 @@ cf-chat-response {
opacity: 0;
white-space: pre-wrap;
word-break: normal;
- -webkit-transform-origin: 0% 0%;
- transform-origin: 0% 0%;
- -webkit-transform: translateY(-10px) translateX(10px) scale(0.001, 0.001);
- transform: translateY(-10px) translateX(10px) scale(0.001, 0.001);
+ transform-origin: 0% 0%;
+ transform: translateY(-10px) translateX(10px) scale(0.001, 0.001);
will-change: transform, opacity, background;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
@@ -1070,14 +648,11 @@ cf-chat-response {
cf-chat-response text > div {
display: inline-block; }
cf-chat-response text thinking span:nth-child(1) {
- -webkit-animation-delay: 0.66667 s;
- animation-delay: 0.66667 s; }
+ animation-delay: 0.66667 s; }
cf-chat-response text thinking span:nth-child(2) {
- -webkit-animation-delay: 1.33333 s;
- animation-delay: 1.33333 s; }
+ animation-delay: 1.33333 s; }
cf-chat-response text thinking span:nth-child(3) {
- -webkit-animation-delay: 2 s;
- animation-delay: 2 s; }
+ animation-delay: 2 s; }
cf-chat-response text strong {
font-weight: 900; }
cf-chat-response text > p {
@@ -1109,8 +684,7 @@ cf-chat-response {
position: absolute;
top: 50%;
left: 20px;
- -webkit-transform: translateY(-50%);
- transform: translateY(-50%);
+ transform: translateY(-50%);
padding-right: 20px; }
cf-chat-response text thinking {
position: relative;
@@ -1120,19 +694,14 @@ cf-chat-response {
-ms-user-select: none;
user-select: none;
display: none;
- -webkit-transform-origin: 0% 50%;
- transform-origin: 0% 50%;
- -webkit-transform: scale(1.5);
- transform: scale(1.5); }
+ transform-origin: 0% 50%;
+ transform: scale(1.5); }
cf-chat-response text thinking span:nth-child(1) {
- -webkit-animation: dot-fade 1s linear 0.33333 s infinite;
- animation: dot-fade 1s linear 0.33333 s infinite; }
+ animation: dot-fade 1s linear 0.33333 s infinite; }
cf-chat-response text thinking span:nth-child(2) {
- -webkit-animation: dot-fade 1s linear 0.66667 s infinite;
- animation: dot-fade 1s linear 0.66667 s infinite; }
+ animation: dot-fade 1s linear 0.66667 s infinite; }
cf-chat-response text thinking span:nth-child(3) {
- -webkit-animation: dot-fade 1s linear 1 s infinite;
- animation: dot-fade 1s linear 1 s infinite; }
+ animation: dot-fade 1s linear 1 s infinite; }
cf-chat-response text svg.cf-icon-file {
width: 10px;
height: auto;
@@ -1153,15 +722,11 @@ cf-chat-response {
background-position: 50% 50%;
opacity: 0;
overflow: hidden;
- -webkit-transform-origin: 50% 50%;
- transform-origin: 50% 50%;
- -webkit-transform: scale(0.001, 0.001) translateY(50px);
- transform: scale(0.001, 0.001) translateY(50px);
+ transform-origin: 50% 50%;
+ transform: scale(0.001, 0.001) translateY(50px);
will-change: transform, opacity; }
.conversational-form--enable-animation cf-chat-response thumb {
- transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s;
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s;
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s; }
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s; }
cf-chat-response thumb > span {
display: block;
line-height: 24px;
@@ -1173,35 +738,21 @@ cf-chat-response {
cf-chat-response thumb > span[length="3"] {
font-size: 7.92px; }
cf-chat-response.show text {
- -webkit-transform: translateY(0px) translateX(0px) scale(1, 1);
- transform: translateY(0px) translateX(0px) scale(1, 1);
+ transform: translateY(0px) translateX(0px) scale(1, 1);
opacity: 1; }
.conversational-form--enable-animation cf-chat-response.show text {
- transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; }
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; }
.conversational-form--enable-animation cf-chat-response.show text {
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1);
transition-delay: 0.1875s, 0.1875s, 0s; }
cf-chat-response.show text[value-added] {
will-change: auto; }
cf-chat-response.show.robot thumb {
- -webkit-transform: scale(1, 1) translateY(0px);
- transform: scale(1, 1) translateY(0px);
+ transform: scale(1, 1) translateY(0px);
opacity: 1; }
.conversational-form--enable-animation cf-chat-response.show.robot thumb {
transition-delay: 0.2s, 0.2s, 0.2s; }
-@-webkit-keyframes dot-fade {
- 0% {
- opacity: 1; }
- 15.1111% {
- opacity: 0; }
- 33.333% {
- opacity: 1; }
- 100% {
- opacity: 1; } }
-
@keyframes dot-fade {
0% {
opacity: 1; }
@@ -1212,32 +763,15 @@ cf-chat-response {
100% {
opacity: 1; } }
-@-webkit-keyframes bounce {
- 0% {
- -webkit-transform: scale(1, 1);
- transform: scale(1, 1);
- opacity: 1; }
- 50% {
- -webkit-transform: scale(1.05, 1.05);
- transform: scale(1.05, 1.05);
- opacity: 0.85; }
- 100% {
- -webkit-transform: scale(1, 1);
- transform: scale(1, 1);
- opacity: 1; } }
-
@keyframes bounce {
0% {
- -webkit-transform: scale(1, 1);
- transform: scale(1, 1);
+ transform: scale(1, 1);
opacity: 1; }
50% {
- -webkit-transform: scale(1.05, 1.05);
- transform: scale(1.05, 1.05);
+ transform: scale(1.05, 1.05);
opacity: 0.85; }
100% {
- -webkit-transform: scale(1, 1);
- transform: scale(1, 1);
+ transform: scale(1, 1);
opacity: 1; } }
/*
@@ -1249,47 +783,300 @@ cf-chat-response {
/*
Input
*/
-cf-chat {
+cf-input-control-elements {
+ width: auto;
+ height: auto;
+ overflow: hidden;
+ display: block;
+ position: relative;
+ z-index: 0;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ visibility: hidden;
+ height: auto; }
+ cf-input-control-elements .cf-button {
+ margin-bottom: 10px;
+ display: inline-block; }
+ cf-input-control-elements .cf-button.hide {
+ display: none; }
+ cf-input-control-elements.resized {
+ visibility: visible;
+ height: auto; }
+ cf-input-control-elements.one-row cf-list {
+ height: auto; }
+ cf-input-control-elements.one-row cf-list-button {
+ opacity: 0; }
+ cf-input-control-elements.two-row cf-list {
+ white-space: normal;
+ height: auto; }
+
+cf-list, cf-list-button {
+ will-change: height; }
+ .conversational-form--enable-animation cf-list, .conversational-form--enable-animation cf-list-button {
+ transition: height 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+
+cf-input[tag-type="file"] cf-list {
+ cursor: default; }
+
+cf-list {
display: block;
- width: 100%;
height: auto;
- min-height: 100%;
- overflow: visible;
- display: -webkit-box;
- display: flex;
- -webkit-box-orient: vertical;
- -webkit-box-direction: normal;
- flex-flow: column nowrap;
- -webkit-box-pack: end;
- justify-content: flex-end;
- -webkit-box-align: baseline;
- align-items: baseline;
- margin-bottom: 20px; }
- cf-chat scrollable {
- display: block;
- width: 100%;
+ cursor: move;
+ white-space: nowrap; }
+ cf-list.disabled {
+ pointer-events: none; }
+
+/*
+ Globals
+*/
+/*
+ Response
+*/
+/*
+ Input
+*/
+.cf-button {
+ background: white;
+ cursor: pointer;
+ border: 1px solid rgba(13, 131, 255, 0.1);
+ border-radius: calc(20px * 1.2);
+ color: #409dff;
+ line-height: 1;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ overflow: hidden;
+ transform: translateZ(0px);
+ transform-origin: 0% 100%;
+ will-change: opacity, background;
+ opacity: 0; }
+ .cf-button > div {
+ padding: 12px 24px; }
+ .cf-button.has-image {
+ max-width: 180px; }
+ .cf-button > div {
+ position: relative; }
+ .conversational-form--enable-animation .cf-button {
+ transition: opacity 0s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ .cf-button.animate-in {
+ opacity: 1; }
+ .conversational-form--enable-animation .cf-button.animate-in {
+ transition-duration: 0.375s, 0.75s;
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1); }
+ .conversational-form--enable-animation .cf-button.animate-in:nth-child(even) {
+ transition-delay: 0.05s, 0s; }
+ .conversational-form--enable-animation .cf-button.animate-in:nth-child(odd) {
+ transition-delay: 0.15s, 0s; }
+ .cf-button.animate-in.animate-out {
+ transform-origin: 75% 100%;
+ opacity: 0; }
+ .cf-button:not(:last-child) {
+ margin-right: 10px; }
+ .cf-button:hover:not(.cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"], .cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"]), .cf-button:hover:not([checked="checked"]), .cf-button:focus:not(.cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"], .cf-button:hover[selected="selected"], .cf-button:focus[selected="selected"]), .cf-button:focus:not([checked="checked"]) {
+ background: rgba(13, 131, 255, 0.1); }
+ .cf-button[selected="selected"]:not(:focus):not(:hover):not(.highlight), .cf-button[checked="checked"]:not(:focus):not(:hover):not(.highlight) {
+ background: rgba(13, 131, 255, 0.1); }
+ .cf-button[disabled="disabled"] {
+ pointer-events: none; }
+ .cf-button[disabled="disabled"].animate-in {
+ opacity: 0.5; }
+ .cf-button:active > div {
+ opacity: 0.2; }
+ .cf-button .cf-image {
+ width: 100%;
height: auto;
- max-height: 100%;
- min-height: 40px;
- overflow-y: auto;
- padding-bottom: 20px;
- padding-top: 40px; }
- cf-chat scrollable::-webkit-scrollbar {
- width: 4px;
- height: 4px;
- -webkit-appearance: none;
- -webkit-border-radius: 100px; }
- cf-chat scrollable::-webkit-scrollbar-track {
- background: white;
- -webkit-border-radius: 100px; }
- cf-chat scrollable::-webkit-scrollbar-thumb:vertical {
- background: #e3f1ff;
- -webkit-border-radius: 100px; }
- cf-chat scrollable::-webkit-scrollbar-thumb {
- background: white;
- border: none;
- -webkit-border-radius: 100px; }
- cf-chat scrollable::-webkit-scrollbar-thumb:vertical:active {
- background: #7dbcff;
- border: none;
- -webkit-border-radius: 100px; }
+ will-change: opacity;
+ transition: opacity 0.75s cubic-bezier(0.215, 0.61, 0.355, 1);
+ opacity: 0; }
+ .cf-button .cf-image.loaded {
+ opacity: 1; }
+
+/*
+ Globals
+*/
+/*
+ Response
+*/
+/*
+ Input
+*/
+.cf-button.cf-checkbox-button:hover cf-checkbox, .cf-button.cf-checkbox-button.highlight cf-checkbox, .cf-button.cf-checkbox-button:focus cf-checkbox {
+ background: #409dff; }
+
+.cf-button.cf-checkbox-button.no-text {
+ padding: 12px 16px; }
+ .cf-button.cf-checkbox-button.no-text cf-checkbox {
+ margin-right: 0px;
+ margin-left: 0px; }
+
+.cf-button.cf-checkbox-button.has-image cf-checkbox {
+ margin-left: 0px; }
+
+.cf-button.cf-checkbox-button cf-checkbox {
+ display: block;
+ float: left;
+ width: 14px;
+ height: 14px;
+ border-radius: 3px;
+ background: #e3f1ff;
+ will-change: background;
+ margin-right: 10px;
+ margin-left: -10px;
+ margin-top: -1px;
+ position: relative; }
+ .conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox {
+ transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ .cf-button.cf-checkbox-button cf-checkbox:after {
+ content: "";
+ position: absolute;
+ top: 2px;
+ left: 1px;
+ display: block;
+ width: 13px;
+ height: 10px;
+ background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='13px' height='10px' viewBox='0 0 13 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-290.000000, -505.000000)' fill='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 216.000000)'%3e%3cg transform='translate(189.000000, 139.000000)'%3e%3cpolygon points='17.5 18.5 16 20 20 24 29 15.5 27.5 14 20 21'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
+ background-size: 13px 10px;
+ background-repeat: no-repeat;
+ transform-origin: 50% 50%;
+ will-change: transform;
+ transform: scale(0, 0); }
+ .conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox:after {
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+
+.cf-button.cf-checkbox-button[checked="checked"] cf-checkbox, .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox {
+ background: rgba(227, 241, 255, 0); }
+ .cf-button.cf-checkbox-button[checked="checked"] cf-checkbox:after, .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox:after {
+ transform: scale(1, 1); }
+ .conversational-form--enable-animation .cf-button.cf-checkbox-button[checked="checked"] cf-checkbox:after, .conversational-form--enable-animation .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox:after {
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
+
+/*
+ Globals
+*/
+/*
+ Response
+*/
+/*
+ Input
+*/
+cf-options-list {
+ display: block;
+ width: auto; }
+
+/*
+ Globals
+*/
+/*
+ Response
+*/
+/*
+ Input
+*/
+cf-radio-button.cf-button:hover cf-radio, cf-radio-button.cf-button.highlight cf-radio, cf-radio-button.cf-button:focus cf-radio {
+ background: #409dff; }
+
+cf-radio-button.cf-button.has-image cf-checkbox {
+ margin-left: 0px; }
+
+cf-radio-button.cf-button cf-radio {
+ display: block;
+ float: left;
+ width: 14px;
+ height: 14px;
+ border-radius: 50%;
+ background: #e3f1ff;
+ will-change: background;
+ margin-right: 10px;
+ margin-left: -10px;
+ margin-top: -1px;
+ position: relative; }
+ .conversational-form--enable-animation cf-radio-button.cf-button cf-radio {
+ transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+
+cf-radio-button.cf-button[checked="checked"] cf-radio {
+ background: #409dff;
+ pointer-events: none; }
+
+/*
+ Globals
+*/
+/*
+ Response
+*/
+/*
+ Input
+*/
+cf-upload-file-ui {
+ display: block;
+ width: 100%;
+ height: 45px;
+ position: absolute;
+ top: 0px;
+ padding-right: 30px;
+ color: #409dff;
+ opacity: 0;
+ transform: translateY(20px) rotateX(30deg);
+ will-change: opacity, transform; }
+ .conversational-form--enable-animation cf-upload-file-ui {
+ transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ cf-upload-file-ui.animate-in {
+ opacity: 1;
+ transform: translateY(0px) rotateX(0deg); }
+ .conversational-form--enable-animation cf-upload-file-ui.animate-in {
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1); }
+
+cf-upload-file-text {
+ display: block;
+ float: left;
+ width: auto;
+ height: 100%;
+ padding-left: 40px;
+ padding-right: 30px;
+ padding-top: 17px;
+ position: relative;
+ color: currentColor;
+ max-width: 50%;
+ text-overflow: ellipsis;
+ overflow: hidden; }
+ cf-upload-file-text:before {
+ content: "";
+ display: inline-block;
+ position: absolute;
+ top: 17px;
+ left: 23px;
+ width: 10px;
+ height: 14px;
+ background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 10 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-756.000000, -549.000000)' fill='#0D83FF'%3e%3cg transform='translate(736.000000, 127.000000)'%3e%3cg transform='translate(0.000000, 406.000000)'%3e%3cpolygon points='20 16 26.0030799 16 30 19.99994 30 30 20 30'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
+ background-repeat: no-repeat;
+ background-size: 10px 14px; }
+
+cf-upload-file-progress {
+ display: block;
+ height: 100%;
+ overflow: hidden;
+ position: relative;
+ padding-right: 30px; }
+ cf-upload-file-progress:after {
+ content: "";
+ width: 100%;
+ background: #f7f7f7;
+ border-radius: 7px; }
+ cf-upload-file-progress:after, cf-upload-file-progress cf-upload-file-progress-bar {
+ display: block;
+ height: 10px;
+ position: absolute;
+ top: 19px;
+ z-index: 1; }
+ cf-upload-file-progress cf-upload-file-progress-bar {
+ width: 0%;
+ will-change: width, border-radius;
+ background: currentColor;
+ z-index: 2;
+ border-radius: 7px 0px 0px 7px; }
+ .conversational-form--enable-animation cf-upload-file-progress cf-upload-file-progress-bar {
+ transition: width 0.15s linear, border-radius 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ cf-upload-file-progress cf-upload-file-progress-bar.loaded {
+ border-radius: 7px 7px 7px 7px; }
diff --git a/dist/conversational-form.min.css b/dist/conversational-form.min.css
index bbad9828c..9bfe7eb3e 100644
--- a/dist/conversational-form.min.css
+++ b/dist/conversational-form.min.css
@@ -1 +1 @@
-@charset "UTF-8";.conversational-form{visibility:visible!important;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;line-height:1.416666667;position:absolute;top:0;left:0;right:0;bottom:0;z-index:999;margin:auto;background:#fff;overflow:hidden;opacity:0;will-change:opacity}.conversational-form *,.conversational-form :after,.conversational-form :before{box-sizing:border-box;outline:0}.conversational-form:before{content:"";width:100%;height:50px;pointer-events:none;background:linear-gradient(to bottom,#fff 0,rgba(255,255,255,0) 100%);position:absolute;top:0;left:0;z-index:2}.conversational-form button{border:none;background:0 0;margin:0;padding:0;outline:0;-webkit-tap-highlight-color:transparent!important}.conversational-form menu{padding:0;margin:0}.conversational-form li,.conversational-form ol,.conversational-form ul{margin:0;padding:0}.conversational-form a,.conversational-form a:active,.conversational-form a:visited{color:currentColor}.conversational-form a,.conversational-form button{cursor:pointer}.conversational-form .conversational-form-inner{padding:0 20px;position:absolute;width:100%;min-height:100%;max-height:100%;bottom:0;height:auto;overflow:hidden;margin-bottom:auto;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-flow:column nowrap;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-align:baseline;align-items:baseline}.conversational-form--enable-animation .conversational-form{transition:opacity .1875s cubic-bezier(.215,.61,.355,1)}.conversational-form *{-webkit-tap-highlight-color:rgba(255,255,255,0);tap-highlight-color:rgba(255,255,255,0)}.conversational-form--show{opacity:1}cf-input-control-elements{width:auto;height:auto;overflow:hidden;display:block;position:relative;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;height:auto}cf-input-control-elements .cf-button{margin-bottom:10px;display:inline-block}cf-input-control-elements .cf-button.hide{display:none}cf-input-control-elements.resized{visibility:visible;height:auto}cf-input-control-elements.one-row cf-list{height:auto}cf-input-control-elements.one-row cf-list-button{opacity:0}cf-input-control-elements.two-row cf-list{white-space:normal;height:auto}cf-list,cf-list-button{will-change:height}.conversational-form--enable-animation cf-list,.conversational-form--enable-animation cf-list-button{transition:height 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-list{cursor:default}cf-list{display:block;height:auto;cursor:move;white-space:nowrap}cf-list.disabled{pointer-events:none}.cf-button{background:#fff;cursor:pointer;border:1px solid rgba(13,131,255,.1);border-radius:calc(20px * 1.2);color:#409dff;line-height:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transform-origin:0 100%;transform-origin:0 100%;will-change:opacity,background;opacity:0}.cf-button>div{padding:12px 24px}.cf-button.has-image{max-width:180px}.cf-button>div{position:relative}.conversational-form--enable-animation .cf-button{transition:opacity 0s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1)}.cf-button.animate-in{opacity:1}.conversational-form--enable-animation .cf-button.animate-in{transition-duration:375ms,.75s;transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}.conversational-form--enable-animation .cf-button.animate-in:nth-child(even){transition-delay:50ms,0s}.conversational-form--enable-animation .cf-button.animate-in:nth-child(odd){transition-delay:.15s,0s}.cf-button.animate-in.animate-out{-webkit-transform-origin:75% 100%;transform-origin:75% 100%;opacity:0}.cf-button:not(:last-child){margin-right:10px}.cf-button:focus:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:focus:not([checked=checked]),.cf-button:hover:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:hover:not([checked=checked]){background:rgba(13,131,255,.1)}.cf-button[checked=checked]:not(:focus):not(:hover):not(.highlight),.cf-button[selected=selected]:not(:focus):not(:hover):not(.highlight){background:rgba(13,131,255,.1)}.cf-button[disabled=disabled]{pointer-events:none}.cf-button[disabled=disabled].animate-in{opacity:.5}.cf-button:active>div{opacity:.2}.cf-button .cf-image{width:100%;height:auto;will-change:opacity;transition:opacity .75s cubic-bezier(.215,.61,.355,1);opacity:0}.cf-button .cf-image.loaded{opacity:1}cf-radio-button.cf-button.highlight cf-radio,cf-radio-button.cf-button:focus cf-radio,cf-radio-button.cf-button:hover cf-radio{background:#409dff}cf-radio-button.cf-button.has-image cf-checkbox{margin-left:0}cf-radio-button.cf-button cf-radio{display:block;float:left;width:14px;height:14px;border-radius:50%;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation cf-radio-button.cf-button cf-radio{transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-radio-button.cf-button[checked=checked] cf-radio{background:#409dff;pointer-events:none}.cf-button.cf-checkbox-button.highlight cf-checkbox,.cf-button.cf-checkbox-button:focus cf-checkbox,.cf-button.cf-checkbox-button:hover cf-checkbox{background:#409dff}.cf-button.cf-checkbox-button.no-text{padding:12px 16px}.cf-button.cf-checkbox-button.no-text cf-checkbox{margin-right:0;margin-left:0}.cf-button.cf-checkbox-button.has-image cf-checkbox{margin-left:0}.cf-button.cf-checkbox-button cf-checkbox{display:block;float:left;width:14px;height:14px;border-radius:3px;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox{transition:background 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button cf-checkbox:after{content:"";position:absolute;top:2px;left:1px;display:block;width:13px;height:10px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='13px' height='10px' viewBox='0 0 13 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-290.000000, -505.000000)' fill='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 216.000000)'%3e%3cg transform='translate(189.000000, 139.000000)'%3e%3cpolygon points='17.5 18.5 16 20 20 24 29 15.5 27.5 14 20 21'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:13px 10px;background-repeat:no-repeat;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;will-change:transform;-webkit-transform:scale(0,0);transform:scale(0,0)}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox:after{transition:-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox{background:rgba(227,241,255,0)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{-webkit-transform:scale(1,1);transform:scale(1,1)}.conversational-form--enable-animation .cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.conversational-form--enable-animation .cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{transition-timing-function:cubic-bezier(.215,.61,.355,1)}cf-options-list{display:block;width:auto}cf-upload-file-ui{display:block;width:100%;height:45px;position:absolute;top:0;padding-right:30px;color:#409dff;opacity:0;-webkit-transform:translateY(20px) rotateX(30deg);transform:translateY(20px) rotateX(30deg);will-change:opacity,transform}.conversational-form--enable-animation cf-upload-file-ui{transition:opacity 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:opacity 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.215,.61,.355,1);transition:opacity 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-ui.animate-in{opacity:1;-webkit-transform:translateY(0) rotateX(0);transform:translateY(0) rotateX(0)}.conversational-form--enable-animation cf-upload-file-ui.animate-in{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}cf-upload-file-text{display:block;float:left;width:auto;height:100%;padding-left:40px;padding-right:30px;padding-top:17px;position:relative;color:currentColor;max-width:50%;text-overflow:ellipsis;overflow:hidden}cf-upload-file-text:before{content:"";display:inline-block;position:absolute;top:17px;left:23px;width:10px;height:14px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 10 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-756.000000, -549.000000)' fill='#0D83FF'%3e%3cg transform='translate(736.000000, 127.000000)'%3e%3cg transform='translate(0.000000, 406.000000)'%3e%3cpolygon points='20 16 26.0030799 16 30 19.99994 30 30 20 30'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-repeat:no-repeat;background-size:10px 14px}cf-upload-file-progress{display:block;height:100%;overflow:hidden;position:relative;padding-right:30px}cf-upload-file-progress:after{content:"";width:100%;background:#f7f7f7;border-radius:7px}cf-upload-file-progress cf-upload-file-progress-bar,cf-upload-file-progress:after{display:block;height:10px;position:absolute;top:19px;z-index:1}cf-upload-file-progress cf-upload-file-progress-bar{width:0%;will-change:width,border-radius;background:currentColor;z-index:2;border-radius:7px 0 0 7px}.conversational-form--enable-animation cf-upload-file-progress cf-upload-file-progress-bar{transition:width .15s linear,border-radius 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-progress cf-upload-file-progress-bar.loaded{border-radius:7px 7px 7px 7px}cf-input{display:block;position:relative;width:100%;height:auto;margin-bottom:20px;margin-top:0;-webkit-box-flex:0;flex:0 0 auto}cf-input.animate-in input,cf-input.animate-in textarea{transition-delay:0s,0s,0s,.4s,.4s;opacity:1;-webkit-transform:translateY(0) rotateX(0);transform:translateY(0) rotateX(0)}cf-input.animate-in cf-input-button.cf-input-button{transition-delay:0s,0s .75s;-webkit-transform:scale(1,1);transform:scale(1,1)}cf-input input,cf-input textarea{resize:none;overflow:hidden;padding:calc((45px - 2px - 12px)/ 2) calc(45px - 6px) calc((45px - 2px - 12px)/ 2) 15px}cf-input input,cf-input textarea{outline:0;-webkit-appearance:none;-webkit-touch-callout:auto!important;-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important;border-radius:0;border:none;-webkit-appearance:none;position:relative;z-index:2;display:block;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;width:100%;height:45px;min-height:45px;color:#acb2b6;will-change:box-shadow,background,color,transform,opacity;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.15);opacity:0;-webkit-transform:translateY(40px) rotateX(-40deg);transform:translateY(40px) rotateX(-40deg)}cf-input input:-webkit-autofill,cf-input textarea:-webkit-autofill{background-color:#fff}cf-input input:active,cf-input input:focus,cf-input textarea:active,cf-input textarea:focus{box-shadow:0 0 30px rgba(0,0,0,.2)}.conversational-form--enable-animation cf-input input,.conversational-form--enable-animation cf-input textarea{transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s;transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s;transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s}cf-input input:hover::-webkit-input-placeholder,cf-input textarea:hover::-webkit-input-placeholder{color:#768086}cf-input input:hover::-moz-input-placeholder,cf-input textarea:hover::-moz-input-placeholder{color:#768086}cf-input input:hover:-moz-input-placeholder,cf-input textarea:hover:-moz-input-placeholder{color:#768086}cf-input input:hover:-ms-input-placeholder,cf-input textarea:hover:-ms-input-placeholder{color:#768086}cf-input input::-webkit-input-placeholder,cf-input textarea::-webkit-input-placeholder{color:currentColor}cf-input input::-moz-input-placeholder,cf-input textarea::-moz-input-placeholder{color:currentColor}cf-input input:-moz-input-placeholder,cf-input textarea:-moz-input-placeholder{color:currentColor}cf-input input:-ms-input-placeholder,cf-input textarea:-ms-input-placeholder{color:currentColor}cf-input.hide-input input,cf-input.hide-input textarea{display:none}cf-input.hide-input cf-input-button{display:none}cf-input[disabled=disabled]{pointer-events:none}cf-input[disabled=disabled] input,cf-input[disabled=disabled] textarea{background:rgba(247,247,247,.5)}cf-input[disabled=disabled] .cf-input-button{background:rgba(247,247,247,.75)}cf-input cf-icon-audio-eq{display:block;border:0 solid grey;border-color:#e3f1ff;width:100%;height:100%;border-radius:50%;z-index:0;position:absolute;top:0;left:0}cf-input[error]{pointer-events:none}cf-input[error] input,cf-input[error] textarea{background:#ffebe9;color:#fe8d84}cf-input[error] .cf-input-button{background:#ffebe9}cf-input[error] .cf-input-button svg polygon{fill:#fe8d84}cf-input[message] input,cf-input[message] textarea{background:#e3f1ff;color:#409dff}cf-input[message] .cf-input-button{background:#e3f1ff}cf-input[message] .cf-input-button svg polygon{fill:#409dff}cf-input cf-input-button.cf-input-button.loading:after,cf-input[tag-type=file] cf-input-button.cf-input-button:after{content:"";display:block;width:100%;height:100%;border:1px solid #b9bcbe;border-radius:50%;border-left:0;border-top:0;-webkit-animation:cf-spin 1s linear infinite;animation:cf-spin 1s linear infinite;will-change:opacity}.conversational-form--enable-animation cf-input cf-input-button.cf-input-button.loading:after,.conversational-form--enable-animation cf-input[tag-type=file] cf-input-button.cf-input-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-attachment{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-progress{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);opacity:0}cf-input-button.cf-input-button{width:29px;height:29px;background:0 0;position:absolute;overflow:hidden;right:8px;bottom:8px;z-index:3;cursor:pointer;border-radius:50%;will-change:background,border;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:scale(0,0);transform:scale(0,0);-webkit-backface-visibility:hidden;backface-visibility:hidden;border:1px solid #fff}.conversational-form--enable-animation cf-input-button.cf-input-button{transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s;transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s;transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s}cf-input-button.cf-input-button .cf-input-icons.cf-microphone{-webkit-transform:scale(0,0);transform:scale(0,0);pointer-events:none}cf-input-button.cf-input-button.microphone-interface .cf-input-icons{-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:scale(1,1) rotateX(0) translateZ(0);transform:scale(1,1) rotateX(0) translateZ(0);transition:-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons:not(.cf-microphone){pointer-events:none;-webkit-transform:scale(.25,.25) rotateX(90deg) translateZ(0);transform:scale(.25,.25) rotateX(90deg) translateZ(0)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons.cf-microphone{pointer-events:auto;-webkit-transform:scale(1,1) rotateX(0) translateZ(0);transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing){pointer-events:none}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) .cf-microphone div.cf-icon-audio{opacity:1}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons:not(.cf-microphone){pointer-events:auto;-webkit-transform:scale(1,1) rotateX(0) translateZ(0);transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons.cf-microphone{-webkit-transform:scale(.25,.25) rotateX(90deg) translateZ(0);transform:scale(.25,.25) rotateX(90deg) translateZ(0);pointer-events:none}cf-input-button.cf-input-button .cf-input-icons{position:absolute;z-index:1;pointer-events:none;width:100%;height:100%}cf-input-button.cf-input-button .cf-input-icons>div{width:100%;height:100%;position:absolute;z-index:1;background-repeat:no-repeat;background-position:50% 50%;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;will-change:transform,opacity}.conversational-form--enable-animation cf-input-button.cf-input-button .cf-input-icons>div{transition:opacity 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button div.cf-icon-attachment{-webkit-transform:rotateX(90deg);transform:rotateX(90deg);opacity:0;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:12px 16px}cf-input-button.cf-input-button div.cf-icon-progress{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='#0D83FF'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:30px 30px}cf-input-button.cf-input-button div.cf-icon-audio{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='#0D83FF' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e");background-size:26px 26px}cf-input-button.cf-input-button:active{opacity:.2}cf-input-button.cf-input-button:focus,cf-input-button.cf-input-button:hover{background:#e3f1ff;border:1px solid #fff}cf-input-button.cf-input-button:focus:after,cf-input-button.cf-input-button:hover:after{opacity:0}@media (min-width:768px){cf-input-button.cf-input-button:focus .cf-icon-progress,cf-input-button.cf-input-button:hover .cf-icon-progress{-webkit-animation:cf-arrow-up .75s cubic-bezier(.645,.045,.355,1);animation:cf-arrow-up .75s cubic-bezier(.645,.045,.355,1)}}cf-input[tag-type=group].hide-input cf-input-button{display:block;left:0;right:0;margin-left:auto;margin-right:auto}cf-input[tag-type=group].hide-input cf-input-control-elements{margin-bottom:45px}cf-input[error=""].hide-input cf-input-button .cf-icon-progress{-webkit-filter:saturate(0);filter:saturate(0);-webkit-animation:shake .6s cubic-bezier(.36,.07,.19,.97) both;animation:shake .6s cubic-bezier(.36,.07,.19,.97) both}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(1px,0,0);transform:translate3d(1px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}40%,60%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(1px,0,0);transform:translate3d(1px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}40%,60%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}}@-webkit-keyframes cf-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes cf-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cf-arrow-up{0%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-40px);transform:translateY(-40px)}40.001%{-webkit-transform:translateY(40px);transform:translateY(40px)}80%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}90%{-webkit-transform:translateY(2px);transform:translateY(2px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes cf-arrow-up{0%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-40px);transform:translateY(-40px)}40.001%{-webkit-transform:translateY(40px);transform:translateY(40px)}80%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}90%{-webkit-transform:translateY(2px);transform:translateY(2px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}cf-info{position:absolute;pointer-events:none;z-index:0;left:2px;top:0;height:auto;width:100%;text-overflow:ellipsis;padding-right:20px;overflow:hidden;display:block;-webkit-transform:translateY(-115%);transform:translateY(-115%);color:#acb2b6;opacity:0;will-change:opacity}cf-info.show{opacity:1}.conversational-form--enable-animation cf-info.show{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-info strong{font-weight:900}cf-input-control-elements.animate-in cf-list-button{opacity:1}cf-input-control-elements.hide-nav-buttons cf-list-button{pointer-events:none}cf-input-control-elements.hide-nav-buttons cf-list-button:after{opacity:0}cf-list-button{display:block;position:absolute;z-index:2;height:calc(100% - 16px);width:38px;cursor:pointer;opacity:0;pointer-events:none;will-change:opacity}.conversational-form--enable-animation cf-list-button{transition:opacity .75s cubic-bezier(.215,.61,.355,1) .5s}@media (min-width:768px){cf-list-button:hover:nth-child(1){background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(1):after{-webkit-animation:cf-arrow-left .75s cubic-bezier(.645,.045,.355,1);animation:cf-arrow-left .75s cubic-bezier(.645,.045,.355,1)}cf-list-button:hover:nth-child(2){background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(2):after{-webkit-animation:cf-arrow-right .75s cubic-bezier(.645,.045,.355,1);animation:cf-arrow-right .75s cubic-bezier(.645,.045,.355,1)}}cf-list-button.cf-gradient:before{opacity:1}cf-list-button.active{pointer-events:auto}cf-list-button.active:after{opacity:1}cf-list-button:active:after{visibility:hidden}cf-list-button:nth-child(1){left:0}cf-list-button:nth-child(1):before{background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(1):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)' %3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon transform='translate(29.000000, 54.000000) rotate(-180.000000) translate(-29.000000, -54.000000) ' points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:nth-child(2){right:0}cf-list-button:nth-child(2):before{background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(2):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)'%3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:before{content:"";display:block;width:100%;height:100%;opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:before{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-list-button:after{content:"";display:block;width:6px;height:10px;position:absolute;background-size:6px 10px;background-repeat:no-repeat;top:calc(50% - 5px);left:calc(50% - 3px);opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}@-webkit-keyframes cf-arrow-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}40.001%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}80%{-webkit-transform:translateX(4px);transform:translateX(4px);opacity:1}90%{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes cf-arrow-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}40.001%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}80%{-webkit-transform:translateX(4px);transform:translateX(4px);opacity:1}90%{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@-webkit-keyframes cf-arrow-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}40.001%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}80%{-webkit-transform:translateX(-4px);transform:translateX(-4px);opacity:1}90%{-webkit-transform:translateX(2px);transform:translateX(2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes cf-arrow-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}40.001%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}80%{-webkit-transform:translateX(-4px);transform:translateX(-4px);opacity:1}90%{-webkit-transform:translateX(2px);transform:translateX(2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}.conversational-form.done cf-chat-response{pointer-events:none}cf-chat-response{display:table;max-width:80%;min-width:120px;width:auto;position:relative;-webkit-backface-visibility:hidden;backface-visibility:hidden;padding-left:calc(24px + 10px);padding-top:16px;color:#acb2b6;margin-left:0;margin-right:auto;word-break:break-all}@media (min-width:768px){cf-chat-response{max-width:50%}}cf-chat-response.can-edit{cursor:pointer}cf-chat-response.can-edit:hover{color:#6a7379}cf-chat-response.can-edit:hover text>p{background:#fff}cf-chat-response.robot text>p{opacity:0;will-change:opacity;transition:opacity 375ms cubic-bezier(.215,.61,.355,1) .2s}cf-chat-response.robot text>p.show{opacity:1}cf-chat-response.user{margin-right:0;margin-left:auto;padding-left:0;padding-right:calc(24px + 10px);color:#409dff}cf-chat-response.user thumb{left:auto;right:0}cf-chat-response.user text{-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:translateY(-10px) translateX(-10px) scale(.001,.001);transform:translateY(-10px) translateX(-10px) scale(.001,.001)}cf-chat-response.user text>p{background:#e3f1ff;border-radius:20px 0 20px 20px;margin-right:0;margin-left:auto}cf-chat-response.user.peak-thumb thumb{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.user.peak-thumb thumb{transition-delay:.2s,.2s,.2s}cf-chat-response.disabled{pointer-events:none;color:#f0f1f2}cf-chat-response.disabled text{background:#fff}cf-chat-response[thinking] text thinking{display:block}cf-chat-response text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;overflow:hidden;position:relative;min-height:40px;opacity:0;white-space:pre-wrap;word-break:normal;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-10px) translateX(10px) scale(.001,.001);transform:translateY(-10px) translateX(10px) scale(.001,.001);will-change:transform,opacity,background;-webkit-backface-visibility:hidden;backface-visibility:hidden;height:auto}cf-chat-response text>div{display:inline-block}cf-chat-response text thinking span:nth-child(1){-webkit-animation-delay:.66667 s;animation-delay:.66667 s}cf-chat-response text thinking span:nth-child(2){-webkit-animation-delay:1.33333 s;animation-delay:1.33333 s}cf-chat-response text thinking span:nth-child(3){-webkit-animation-delay:2 s;animation-delay:2 s}cf-chat-response text strong{font-weight:900}cf-chat-response text>p{margin:0;padding:0;background:#f7f7f7;padding:12px 24px 12px 24px;display:table;border-radius:0 20px 20px 20px;transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-chat-response text>p:not(:only-child){border-radius:0 20px 20px 0}cf-chat-response text>p:not(:only-child):first-child{border-radius:20px 20px 20px 0}cf-chat-response text>p:not(:only-child):last-child{border-radius:0 20px 20px 20px}cf-chat-response text>p:not(:only-child):not(:first-child){margin-top:3px}cf-chat-response text>p>img{max-width:140px;padding-bottom:5px;width:100%;height:auto;display:block;margin-bottom:4px}cf-chat-response text:after{content:"";display:block;position:absolute;top:50%;left:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%);padding-right:20px}cf-chat-response text thinking{position:relative;display:table;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:none;-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(1.5);transform:scale(1.5)}cf-chat-response text thinking span:nth-child(1){-webkit-animation:dot-fade 1s linear .33333 s infinite;animation:dot-fade 1s linear .33333 s infinite}cf-chat-response text thinking span:nth-child(2){-webkit-animation:dot-fade 1s linear .66667 s infinite;animation:dot-fade 1s linear .66667 s infinite}cf-chat-response text thinking span:nth-child(3){-webkit-animation:dot-fade 1s linear 1 s infinite;animation:dot-fade 1s linear 1 s infinite}cf-chat-response text svg.cf-icon-file{width:10px;height:auto;display:inline-block;margin-right:7px}cf-chat-response text svg.cf-icon-file g{fill:#0d83ff}cf-chat-response thumb{position:absolute;top:0;left:0;display:block;width:24px;height:24px;border-radius:50%;background:0 0;background-size:cover;background-position:50% 50%;opacity:0;overflow:hidden;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:scale(.001,.001) translateY(50px);transform:scale(.001,.001) translateY(50px);will-change:transform,opacity}.conversational-form--enable-animation cf-chat-response thumb{transition:opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) .1875s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) .1875s,opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) .1875s,opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) .1875s}cf-chat-response thumb>span{display:block;line-height:24px;text-align:center;font-weight:700;font-size:9.6px}cf-chat-response thumb>span[length="1"]{font-size:19.2px}cf-chat-response thumb>span[length="3"]{font-size:7.92px}cf-chat-response.show text{-webkit-transform:translateY(0) translateX(0) scale(1,1);transform:translateY(0) translateX(0) scale(1,1);opacity:1}.conversational-form--enable-animation cf-chat-response.show text{transition:opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) 0s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) 0s}.conversational-form--enable-animation cf-chat-response.show text{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1);transition-delay:.1875s,.1875s,0s}cf-chat-response.show text[value-added]{will-change:auto}cf-chat-response.show.robot thumb{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.show.robot thumb{transition-delay:.2s,.2s,.2s}@-webkit-keyframes dot-fade{0%{opacity:1}15.1111%{opacity:0}33.333%{opacity:1}100%{opacity:1}}@keyframes dot-fade{0%{opacity:1}15.1111%{opacity:0}33.333%{opacity:1}100%{opacity:1}}@-webkit-keyframes bounce{0%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}50%{-webkit-transform:scale(1.05,1.05);transform:scale(1.05,1.05);opacity:.85}100%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}}@keyframes bounce{0%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}50%{-webkit-transform:scale(1.05,1.05);transform:scale(1.05,1.05);opacity:.85}100%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}}cf-chat{display:block;width:100%;height:auto;min-height:100%;overflow:visible;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-flow:column nowrap;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-align:baseline;align-items:baseline;margin-bottom:20px}cf-chat scrollable{display:block;width:100%;height:auto;max-height:100%;min-height:40px;overflow-y:auto;padding-bottom:20px;padding-top:40px}cf-chat scrollable::-webkit-scrollbar{width:4px;height:4px;-webkit-appearance:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-track{background:#fff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical{background:#e3f1ff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb{background:#fff;border:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical:active{background:#7dbcff;border:none;-webkit-border-radius:100px}
\ No newline at end of file
+@charset "UTF-8";.conversational-form{visibility:visible!important;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;line-height:1.416666667;position:absolute;top:0;left:0;right:0;bottom:0;z-index:999;margin:auto;background:#fff;overflow:hidden;opacity:0;will-change:opacity}.conversational-form *,.conversational-form :after,.conversational-form :before{box-sizing:border-box;outline:0}.conversational-form:before{content:"";width:100%;height:50px;pointer-events:none;background:linear-gradient(to bottom,#fff 0,rgba(255,255,255,0) 100%);position:absolute;top:0;left:0;z-index:2}.conversational-form button{border:none;background:0 0;margin:0;padding:0;outline:0;-webkit-tap-highlight-color:transparent!important}.conversational-form menu{padding:0;margin:0}.conversational-form li,.conversational-form ol,.conversational-form ul{margin:0;padding:0}.conversational-form a,.conversational-form a:active,.conversational-form a:visited{color:currentColor}.conversational-form a,.conversational-form button{cursor:pointer}.conversational-form .conversational-form-inner{padding:0 20px;position:absolute;width:100%;min-height:100%;max-height:100%;bottom:0;height:auto;overflow:hidden;margin-bottom:auto;display:flex;flex-flow:column nowrap;justify-content:flex-end;align-items:baseline}.conversational-form--enable-animation .conversational-form{transition:opacity .1875s cubic-bezier(.215,.61,.355,1)}.conversational-form *{-webkit-tap-highlight-color:rgba(255,255,255,0);tap-highlight-color:rgba(255,255,255,0)}.conversational-form--show{opacity:1}cf-info{position:absolute;pointer-events:none;z-index:0;left:2px;top:0;height:auto;width:100%;text-overflow:ellipsis;padding-right:20px;overflow:hidden;display:block;transform:translateY(-115%);color:#acb2b6;opacity:0;will-change:opacity}cf-info.show{opacity:1}.conversational-form--enable-animation cf-info.show{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-info strong{font-weight:900}cf-input{display:block;position:relative;width:100%;height:auto;margin-bottom:20px;margin-top:0;flex:0 0 auto}cf-input.animate-in input,cf-input.animate-in textarea{transition-delay:0s,0s,0s,.4s,.4s;opacity:1;transform:translateY(0) rotateX(0)}cf-input.animate-in cf-input-button.cf-input-button{transition-delay:0s,0s .75s;transform:scale(1,1)}cf-input input,cf-input textarea{resize:none;overflow:hidden;padding:calc((45px - 2px - 12px)/ 2) calc(45px - 6px) calc((45px - 2px - 12px)/ 2) 15px}cf-input input,cf-input textarea{outline:0;-webkit-appearance:none;-webkit-touch-callout:auto!important;-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important;border-radius:0;border:none;-webkit-appearance:none;position:relative;z-index:2;display:block;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;width:100%;height:45px;min-height:45px;color:#acb2b6;will-change:box-shadow,background,color,transform,opacity;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.15);opacity:0;transform:translateY(40px) rotateX(-40deg)}cf-input input:-webkit-autofill,cf-input textarea:-webkit-autofill{background-color:#fff}cf-input input:active,cf-input input:focus,cf-input textarea:active,cf-input textarea:focus{box-shadow:0 0 30px rgba(0,0,0,.2)}.conversational-form--enable-animation cf-input input,.conversational-form--enable-animation cf-input textarea{transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s}cf-input input:hover::-webkit-input-placeholder,cf-input textarea:hover::-webkit-input-placeholder{color:#768086}cf-input input:hover::-moz-input-placeholder,cf-input textarea:hover::-moz-input-placeholder{color:#768086}cf-input input:hover:-moz-input-placeholder,cf-input textarea:hover:-moz-input-placeholder{color:#768086}cf-input input:hover:-ms-input-placeholder,cf-input textarea:hover:-ms-input-placeholder{color:#768086}cf-input input::-webkit-input-placeholder,cf-input textarea::-webkit-input-placeholder{color:currentColor}cf-input input::-moz-input-placeholder,cf-input textarea::-moz-input-placeholder{color:currentColor}cf-input input:-moz-input-placeholder,cf-input textarea:-moz-input-placeholder{color:currentColor}cf-input input:-ms-input-placeholder,cf-input textarea:-ms-input-placeholder{color:currentColor}cf-input.hide-input input,cf-input.hide-input textarea{display:none}cf-input.hide-input cf-input-button{display:none}cf-input[disabled=disabled]{pointer-events:none}cf-input[disabled=disabled] input,cf-input[disabled=disabled] textarea{background:rgba(247,247,247,.5)}cf-input[disabled=disabled] .cf-input-button{background:rgba(247,247,247,.75)}cf-input cf-icon-audio-eq{display:block;border:0 solid grey;border-color:#e3f1ff;width:100%;height:100%;border-radius:50%;z-index:0;position:absolute;top:0;left:0}cf-input[error]{pointer-events:none}cf-input[error] input,cf-input[error] textarea{background:#ffebe9;color:#fe8d84}cf-input[error] .cf-input-button{background:#ffebe9}cf-input[error] .cf-input-button svg polygon{fill:#fe8d84}cf-input[message] input,cf-input[message] textarea{background:#e3f1ff;color:#409dff}cf-input[message] .cf-input-button{background:#e3f1ff}cf-input[message] .cf-input-button svg polygon{fill:#409dff}cf-input cf-input-button.cf-input-button.loading:after,cf-input[tag-type=file] cf-input-button.cf-input-button:after{content:"";display:block;width:100%;height:100%;border:1px solid #b9bcbe;border-radius:50%;border-left:0;border-top:0;animation:cf-spin 1s linear infinite;will-change:opacity}.conversational-form--enable-animation cf-input cf-input-button.cf-input-button.loading:after,.conversational-form--enable-animation cf-input[tag-type=file] cf-input-button.cf-input-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-attachment{transform:rotateX(0);opacity:1}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-progress{transform:rotateX(-90deg);opacity:0}cf-input-button.cf-input-button{width:29px;height:29px;background:0 0;position:absolute;overflow:hidden;right:8px;bottom:8px;z-index:3;cursor:pointer;border-radius:50%;will-change:background,border;transform-origin:50% 50%;transform:scale(0,0);-webkit-backface-visibility:hidden;backface-visibility:hidden;border:1px solid #fff}.conversational-form--enable-animation cf-input-button.cf-input-button{transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s}cf-input-button.cf-input-button .cf-input-icons.cf-microphone{transform:scale(0,0);pointer-events:none}cf-input-button.cf-input-button.microphone-interface .cf-input-icons{transform-origin:50% 50%;transform:scale(1,1) rotateX(0) translateZ(0);transition:transform 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons:not(.cf-microphone){pointer-events:none;transform:scale(.25,.25) rotateX(90deg) translateZ(0)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons.cf-microphone{pointer-events:auto;transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing){pointer-events:none}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) .cf-microphone div.cf-icon-audio{opacity:1}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons:not(.cf-microphone){pointer-events:auto;transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons.cf-microphone{transform:scale(.25,.25) rotateX(90deg) translateZ(0);pointer-events:none}cf-input-button.cf-input-button .cf-input-icons{position:absolute;z-index:1;pointer-events:none;width:100%;height:100%}cf-input-button.cf-input-button .cf-input-icons>div{width:100%;height:100%;position:absolute;z-index:1;background-repeat:no-repeat;background-position:50% 50%;transform-origin:50% 50%;will-change:transform,opacity}.conversational-form--enable-animation cf-input-button.cf-input-button .cf-input-icons>div{transition:transform 375ms cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button div.cf-icon-attachment{transform:rotateX(90deg);opacity:0;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:12px 16px}cf-input-button.cf-input-button div.cf-icon-progress{transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='#0D83FF'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:30px 30px}cf-input-button.cf-input-button div.cf-icon-audio{transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='#0D83FF' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e");background-size:26px 26px}cf-input-button.cf-input-button:active{opacity:.2}cf-input-button.cf-input-button:focus,cf-input-button.cf-input-button:hover{background:#e3f1ff;border:1px solid #fff}cf-input-button.cf-input-button:focus:after,cf-input-button.cf-input-button:hover:after{opacity:0}@media (min-width:768px){cf-input-button.cf-input-button:focus .cf-icon-progress,cf-input-button.cf-input-button:hover .cf-icon-progress{animation:cf-arrow-up .75s cubic-bezier(.645,.045,.355,1)}}cf-input[tag-type=group].hide-input cf-input-button{display:block;left:0;right:0;margin-left:auto;margin-right:auto}cf-input[tag-type=group].hide-input cf-input-control-elements{margin-bottom:45px}cf-input[error=""].hide-input cf-input-button .cf-icon-progress{-webkit-filter:saturate(0);filter:saturate(0);animation:shake .6s cubic-bezier(.36,.07,.19,.97) both}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}@keyframes cf-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes cf-arrow-up{0%{transform:translateY(0)}40%{transform:translateY(-40px)}40.001%{transform:translateY(40px)}80%{transform:translateY(-5px)}90%{transform:translateY(2px)}100%{transform:translateY(0)}}cf-input-control-elements.animate-in cf-list-button{opacity:1}cf-input-control-elements.hide-nav-buttons cf-list-button{pointer-events:none}cf-input-control-elements.hide-nav-buttons cf-list-button:after{opacity:0}cf-list-button{display:block;position:absolute;z-index:2;height:calc(100% - 16px);width:38px;cursor:pointer;opacity:0;pointer-events:none;will-change:opacity}.conversational-form--enable-animation cf-list-button{transition:opacity .75s cubic-bezier(.215,.61,.355,1) .5s}@media (min-width:768px){cf-list-button:hover:nth-child(1){background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(1):after{animation:cf-arrow-left .75s cubic-bezier(.645,.045,.355,1)}cf-list-button:hover:nth-child(2){background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(2):after{animation:cf-arrow-right .75s cubic-bezier(.645,.045,.355,1)}}cf-list-button.cf-gradient:before{opacity:1}cf-list-button.active{pointer-events:auto}cf-list-button.active:after{opacity:1}cf-list-button:active:after{visibility:hidden}cf-list-button:nth-child(1){left:0}cf-list-button:nth-child(1):before{background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(1):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)' %3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon transform='translate(29.000000, 54.000000) rotate(-180.000000) translate(-29.000000, -54.000000) ' points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:nth-child(2){right:0}cf-list-button:nth-child(2):before{background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(2):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)'%3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:before{content:"";display:block;width:100%;height:100%;opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:before{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-list-button:after{content:"";display:block;width:6px;height:10px;position:absolute;background-size:6px 10px;background-repeat:no-repeat;top:calc(50% - 5px);left:calc(50% - 3px);opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}@keyframes cf-arrow-right{0%{transform:translateX(0);opacity:1}40%{transform:translateX(20px);opacity:0}40.001%{transform:translateX(-20px);opacity:0}80%{transform:translateX(4px);opacity:1}90%{transform:translateX(-2px);opacity:1}100%{transform:translateX(0);opacity:1}}@keyframes cf-arrow-left{0%{transform:translateX(0);opacity:1}40%{transform:translateX(-20px);opacity:0}40.001%{transform:translateX(20px);opacity:0}80%{transform:translateX(-4px);opacity:1}90%{transform:translateX(2px);opacity:1}100%{transform:translateX(0);opacity:1}}cf-chat{display:block;width:100%;height:auto;min-height:100%;overflow:visible;display:flex;flex-flow:column nowrap;justify-content:flex-end;align-items:baseline;margin-bottom:20px}cf-chat scrollable{display:block;width:100%;height:auto;max-height:100%;min-height:40px;overflow-y:auto;padding-bottom:20px;padding-top:40px}cf-chat scrollable::-webkit-scrollbar{width:4px;height:4px;-webkit-appearance:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-track{background:#fff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical{background:#e3f1ff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb{background:#fff;border:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical:active{background:#7dbcff;border:none;-webkit-border-radius:100px}.conversational-form.done cf-chat-response{pointer-events:none}cf-chat-response{display:table;max-width:80%;min-width:120px;width:auto;position:relative;-webkit-backface-visibility:hidden;backface-visibility:hidden;padding-left:calc(24px + 10px);padding-top:16px;color:#acb2b6;margin-left:0;margin-right:auto;word-break:break-all}@media (min-width:768px){cf-chat-response{max-width:50%}}cf-chat-response.can-edit{cursor:pointer}cf-chat-response.can-edit:hover{color:#6a7379}cf-chat-response.can-edit:hover text>p{background:#fff}cf-chat-response.robot text>p{opacity:0;will-change:opacity;transition:opacity 375ms cubic-bezier(.215,.61,.355,1) .2s}cf-chat-response.robot text>p.show{opacity:1}cf-chat-response.user{margin-right:0;margin-left:auto;padding-left:0;padding-right:calc(24px + 10px);color:#409dff}cf-chat-response.user thumb{left:auto;right:0}cf-chat-response.user text{transform-origin:100% 0;transform:translateY(-10px) translateX(-10px) scale(.001,.001)}cf-chat-response.user text>p{background:#e3f1ff;border-radius:20px 0 20px 20px;margin-right:0;margin-left:auto}cf-chat-response.user.peak-thumb thumb{transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.user.peak-thumb thumb{transition-delay:.2s,.2s,.2s}cf-chat-response.disabled{pointer-events:none;color:#f0f1f2}cf-chat-response.disabled text{background:#fff}cf-chat-response[thinking] text thinking{display:block}cf-chat-response text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;overflow:hidden;position:relative;min-height:40px;opacity:0;white-space:pre-wrap;word-break:normal;transform-origin:0 0;transform:translateY(-10px) translateX(10px) scale(.001,.001);will-change:transform,opacity,background;-webkit-backface-visibility:hidden;backface-visibility:hidden;height:auto}cf-chat-response text>div{display:inline-block}cf-chat-response text thinking span:nth-child(1){animation-delay:.66667 s}cf-chat-response text thinking span:nth-child(2){animation-delay:1.33333 s}cf-chat-response text thinking span:nth-child(3){animation-delay:2 s}cf-chat-response text strong{font-weight:900}cf-chat-response text>p{margin:0;padding:0;background:#f7f7f7;padding:12px 24px 12px 24px;display:table;border-radius:0 20px 20px 20px;transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-chat-response text>p:not(:only-child){border-radius:0 20px 20px 0}cf-chat-response text>p:not(:only-child):first-child{border-radius:20px 20px 20px 0}cf-chat-response text>p:not(:only-child):last-child{border-radius:0 20px 20px 20px}cf-chat-response text>p:not(:only-child):not(:first-child){margin-top:3px}cf-chat-response text>p>img{max-width:140px;padding-bottom:5px;width:100%;height:auto;display:block;margin-bottom:4px}cf-chat-response text:after{content:"";display:block;position:absolute;top:50%;left:20px;transform:translateY(-50%);padding-right:20px}cf-chat-response text thinking{position:relative;display:table;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:none;transform-origin:0 50%;transform:scale(1.5)}cf-chat-response text thinking span:nth-child(1){animation:dot-fade 1s linear .33333 s infinite}cf-chat-response text thinking span:nth-child(2){animation:dot-fade 1s linear .66667 s infinite}cf-chat-response text thinking span:nth-child(3){animation:dot-fade 1s linear 1 s infinite}cf-chat-response text svg.cf-icon-file{width:10px;height:auto;display:inline-block;margin-right:7px}cf-chat-response text svg.cf-icon-file g{fill:#0d83ff}cf-chat-response thumb{position:absolute;top:0;left:0;display:block;width:24px;height:24px;border-radius:50%;background:0 0;background-size:cover;background-position:50% 50%;opacity:0;overflow:hidden;transform-origin:50% 50%;transform:scale(.001,.001) translateY(50px);will-change:transform,opacity}.conversational-form--enable-animation cf-chat-response thumb{transition:transform 375ms cubic-bezier(.215,.61,.355,1) .1875s,opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s}cf-chat-response thumb>span{display:block;line-height:24px;text-align:center;font-weight:700;font-size:9.6px}cf-chat-response thumb>span[length="1"]{font-size:19.2px}cf-chat-response thumb>span[length="3"]{font-size:7.92px}cf-chat-response.show text{transform:translateY(0) translateX(0) scale(1,1);opacity:1}.conversational-form--enable-animation cf-chat-response.show text{transition:transform 375ms cubic-bezier(.215,.61,.355,1) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s}.conversational-form--enable-animation cf-chat-response.show text{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1);transition-delay:.1875s,.1875s,0s}cf-chat-response.show text[value-added]{will-change:auto}cf-chat-response.show.robot thumb{transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.show.robot thumb{transition-delay:.2s,.2s,.2s}@keyframes dot-fade{0%{opacity:1}15.1111%{opacity:0}33.333%{opacity:1}100%{opacity:1}}@keyframes bounce{0%{transform:scale(1,1);opacity:1}50%{transform:scale(1.05,1.05);opacity:.85}100%{transform:scale(1,1);opacity:1}}cf-input-control-elements{width:auto;height:auto;overflow:hidden;display:block;position:relative;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;height:auto}cf-input-control-elements .cf-button{margin-bottom:10px;display:inline-block}cf-input-control-elements .cf-button.hide{display:none}cf-input-control-elements.resized{visibility:visible;height:auto}cf-input-control-elements.one-row cf-list{height:auto}cf-input-control-elements.one-row cf-list-button{opacity:0}cf-input-control-elements.two-row cf-list{white-space:normal;height:auto}cf-list,cf-list-button{will-change:height}.conversational-form--enable-animation cf-list,.conversational-form--enable-animation cf-list-button{transition:height 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-list{cursor:default}cf-list{display:block;height:auto;cursor:move;white-space:nowrap}cf-list.disabled{pointer-events:none}.cf-button{background:#fff;cursor:pointer;border:1px solid rgba(13,131,255,.1);border-radius:calc(20px * 1.2);color:#409dff;line-height:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;transform:translateZ(0);transform-origin:0 100%;will-change:opacity,background;opacity:0}.cf-button>div{padding:12px 24px}.cf-button.has-image{max-width:180px}.cf-button>div{position:relative}.conversational-form--enable-animation .cf-button{transition:opacity 0s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1)}.cf-button.animate-in{opacity:1}.conversational-form--enable-animation .cf-button.animate-in{transition-duration:375ms,.75s;transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}.conversational-form--enable-animation .cf-button.animate-in:nth-child(even){transition-delay:50ms,0s}.conversational-form--enable-animation .cf-button.animate-in:nth-child(odd){transition-delay:.15s,0s}.cf-button.animate-in.animate-out{transform-origin:75% 100%;opacity:0}.cf-button:not(:last-child){margin-right:10px}.cf-button:focus:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:focus:not([checked=checked]),.cf-button:hover:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:hover:not([checked=checked]){background:rgba(13,131,255,.1)}.cf-button[checked=checked]:not(:focus):not(:hover):not(.highlight),.cf-button[selected=selected]:not(:focus):not(:hover):not(.highlight){background:rgba(13,131,255,.1)}.cf-button[disabled=disabled]{pointer-events:none}.cf-button[disabled=disabled].animate-in{opacity:.5}.cf-button:active>div{opacity:.2}.cf-button .cf-image{width:100%;height:auto;will-change:opacity;transition:opacity .75s cubic-bezier(.215,.61,.355,1);opacity:0}.cf-button .cf-image.loaded{opacity:1}.cf-button.cf-checkbox-button.highlight cf-checkbox,.cf-button.cf-checkbox-button:focus cf-checkbox,.cf-button.cf-checkbox-button:hover cf-checkbox{background:#409dff}.cf-button.cf-checkbox-button.no-text{padding:12px 16px}.cf-button.cf-checkbox-button.no-text cf-checkbox{margin-right:0;margin-left:0}.cf-button.cf-checkbox-button.has-image cf-checkbox{margin-left:0}.cf-button.cf-checkbox-button cf-checkbox{display:block;float:left;width:14px;height:14px;border-radius:3px;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox{transition:background 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button cf-checkbox:after{content:"";position:absolute;top:2px;left:1px;display:block;width:13px;height:10px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='13px' height='10px' viewBox='0 0 13 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-290.000000, -505.000000)' fill='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 216.000000)'%3e%3cg transform='translate(189.000000, 139.000000)'%3e%3cpolygon points='17.5 18.5 16 20 20 24 29 15.5 27.5 14 20 21'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:13px 10px;background-repeat:no-repeat;transform-origin:50% 50%;will-change:transform;transform:scale(0,0)}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox:after{transition:transform 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox{background:rgba(227,241,255,0)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{transform:scale(1,1)}.conversational-form--enable-animation .cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.conversational-form--enable-animation .cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{transition-timing-function:cubic-bezier(.215,.61,.355,1)}cf-options-list{display:block;width:auto}cf-radio-button.cf-button.highlight cf-radio,cf-radio-button.cf-button:focus cf-radio,cf-radio-button.cf-button:hover cf-radio{background:#409dff}cf-radio-button.cf-button.has-image cf-checkbox{margin-left:0}cf-radio-button.cf-button cf-radio{display:block;float:left;width:14px;height:14px;border-radius:50%;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation cf-radio-button.cf-button cf-radio{transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-radio-button.cf-button[checked=checked] cf-radio{background:#409dff;pointer-events:none}cf-upload-file-ui{display:block;width:100%;height:45px;position:absolute;top:0;padding-right:30px;color:#409dff;opacity:0;transform:translateY(20px) rotateX(30deg);will-change:opacity,transform}.conversational-form--enable-animation cf-upload-file-ui{transition:opacity 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-ui.animate-in{opacity:1;transform:translateY(0) rotateX(0)}.conversational-form--enable-animation cf-upload-file-ui.animate-in{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}cf-upload-file-text{display:block;float:left;width:auto;height:100%;padding-left:40px;padding-right:30px;padding-top:17px;position:relative;color:currentColor;max-width:50%;text-overflow:ellipsis;overflow:hidden}cf-upload-file-text:before{content:"";display:inline-block;position:absolute;top:17px;left:23px;width:10px;height:14px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 10 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-756.000000, -549.000000)' fill='#0D83FF'%3e%3cg transform='translate(736.000000, 127.000000)'%3e%3cg transform='translate(0.000000, 406.000000)'%3e%3cpolygon points='20 16 26.0030799 16 30 19.99994 30 30 20 30'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-repeat:no-repeat;background-size:10px 14px}cf-upload-file-progress{display:block;height:100%;overflow:hidden;position:relative;padding-right:30px}cf-upload-file-progress:after{content:"";width:100%;background:#f7f7f7;border-radius:7px}cf-upload-file-progress cf-upload-file-progress-bar,cf-upload-file-progress:after{display:block;height:10px;position:absolute;top:19px;z-index:1}cf-upload-file-progress cf-upload-file-progress-bar{width:0%;will-change:width,border-radius;background:currentColor;z-index:2;border-radius:7px 0 0 7px}.conversational-form--enable-animation cf-upload-file-progress cf-upload-file-progress-bar{transition:width .15s linear,border-radius 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-progress cf-upload-file-progress-bar.loaded{border-radius:7px 7px 7px 7px}
\ No newline at end of file
diff --git a/gulp-tasks/styles.js b/gulp-tasks/styles.js
index fce0b4966..d6fa8e0da 100644
--- a/gulp-tasks/styles.js
+++ b/gulp-tasks/styles.js
@@ -25,51 +25,9 @@ function swallowError(error) {
* form style tasks
*/
-global.gulp.task('stylus-form', function() {
- var src = [
- global.srcFolder + "/styles/**/*.styl",
- "!" + global.srcFolder + "styles/mixins/_cf-mixins.styl",
- "!" + global.srcFolder + "/styles/**/_*-variables.styl"
- ]
- var dst = global.buildFolder;
-
- var stream = global.gulp.src(src)
- // .pipe(flatten()) // flatten folder structure
- .pipe(changed(dst, {
- extension: '.css'
- }))
- .pipe(stylus({
- use: [nib()],
- errors: true
- }))
- .on('error', swallowError)
- .pipe(global.gulp.dest(dst))
- .pipe(livereload())
- .pipe(notify("Stylus compiled."));
-
- return stream;
-});
-
-
global.gulp.task('sass-form-build', ['sass-form'], function(){
var src = [
- global.buildFolder + "cf/cf.css",
- global.buildFolder + "cf/ui/control-elements/cf-control-elements.css",
- global.buildFolder + "cf/ui/control-elements/cf-button.css",
- global.buildFolder + "cf/ui/control-elements/cf-radio-button.css",
- global.buildFolder + "cf/ui/control-elements/cf-checkbox-button.css",
- global.buildFolder + "cf/ui/control-elements/cf-options-list.css",
- global.buildFolder + "cf/ui/control-elements/cf-upload-file-ui.css",
- global.buildFolder + "cf/ui/cf-input.css",
- global.buildFolder + "cf/ui/cf-info.css",
- global.buildFolder + "cf/ui/cf-list-button.css",
- global.buildFolder + "cf/ui/chat/cf-chat-response.css",
- global.buildFolder + "cf/ui/chat/cf-chat.css",
-
- "!" + global.buildFolder + "conversational-form-docs.css",
- "!" + global.buildFolder + "conversational-form-docs.min.css",
- "!" + global.buildFolder + "conversational-form.css",
- "!" + global.distFolder + "conversational-form.min.css",
+ global.buildFolder + "main.css"
]
var stream = global.gulp.src(src)
@@ -78,7 +36,7 @@ global.gulp.task('sass-form-build', ['sass-form'], function(){
.pipe(cleanCSS())
.pipe(rename({suffix: '.min'}))
.pipe(global.gulp.dest(global.distFolder));
-
+
return stream;
});
@@ -88,12 +46,10 @@ global.gulp.task('sass-form-build', ['sass-form'], function(){
*/
global.gulp.task('sass-form', function () {
var src = [
- global.srcFolder + "/styles/**/*.scss",
- "!" + global.srcFolder + "styles/mixins/_cf-mixins.scss",
- "!" + global.srcFolder + "/styles/**/_*-variables.scss"
+ global.srcFolder + "/styles/main.scss"
]
var dst = global.buildFolder;
-
+
var stream = global.gulp.src(src)
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({ browsers: ['> 1%']}))
diff --git a/package.json b/package.json
index da3f2dbd9..c6c1fa6e9 100644
--- a/package.json
+++ b/package.json
@@ -28,5 +28,8 @@
"karma": "^1.7.0",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.4"
+ },
+ "dependencies": {
+ "gulp": "^3.9.1"
}
}
diff --git a/src/styles/cf/cf.scss b/src/styles/_cf-base.scss
similarity index 100%
rename from src/styles/cf/cf.scss
rename to src/styles/_cf-base.scss
diff --git a/src/styles/_cf-variables.scss b/src/styles/_cf-variables.scss
new file mode 100644
index 000000000..3e75180ac
--- /dev/null
+++ b/src/styles/_cf-variables.scss
@@ -0,0 +1,46 @@
+/*
+ Globals
+*/
+$cf-base-font-size: 12px !default; // Default is 12px. Positions and sizes will be relative to this size.
+
+$cf-color-background: #fff !default;
+$cf-color-primary: #0D83FF !default;
+$cf-color-secondary: #acb2b6 !default;
+$cf-color-error: #fe8d84 !default;
+
+$cf-font-family: 'Helvetica Neue','Neue Helvetica W01',Helvetica,Arial,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol',sans-serif !default;
+
+$cf-breakpoint-medium: relativeValue(768) !default;
+
+$cf-anim-time: 0.75s !default;
+$cf-ease-easeIn: cubic-bezier(0.550, 0.055, 0.675, 0.190) !default;
+$cf-ease-easeOut: cubic-bezier(0.215, 0.610, 0.355, 1.000) !default;
+$cf-ease-easeInOut: cubic-bezier(0.645, 0.045, 0.355, 1.000) !default;
+$cf-ease-easeOutBack: cubic-bezier(0.175, 0.885, 0.320, 1.275) !default;
+
+/*
+ Response
+*/
+$cf-chat-response-font-size: $cf-base-font-size !default;
+$cf-chat-response-border-radius: relativeValue(20px) !default;
+
+$cf-color-chat-response-default-text: $cf-color-secondary !default;
+$cf-color-chat-response-default-bg: darken($cf-color-background, 3%) !default;
+
+$cf-color-chat-response-user-text: lighten($cf-color-primary, 10%) !default;
+$cf-color-chat-response-user-bg: lighten($cf-color-primary, 42%) !default;
+
+$cf-avatar-area: relativeValue(24px) !default; //The width/height of Robot and Human image/icon.
+$cf-avatar-background: none !default;
+
+/*
+ Input
+*/
+$cf-color-input-text: $cf-color-secondary !default;
+$cf-input-field-height: relativeValue(45px) !default;
+$cf-input-field-border-radius: relativeValue(0) !default;
+$cf-input-submit-background: none !default;
+$cf-input-font-size: $cf-base-font-size !default;
+
+$cf-input-color-error-text: $cf-color-error !default;
+$cf-input-color-error-bg: lighten($cf-color-error, 20%) !default;
diff --git a/src/styles/cf/_cf-variables.scss b/src/styles/cf/_cf-variables.scss
deleted file mode 100644
index 1341dede1..000000000
--- a/src/styles/cf/_cf-variables.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-@import "../mixins/cf-mixins";
-
-/*
- Globals
-*/
-$cf-base-font-size: 12px; // Default is 12px. Positions and sizes will be relative to this size.
-
-$cf-color-background: #fff;
-$cf-color-primary: #0D83FF;
-$cf-color-secondary: #acb2b6;
-$cf-color-error: #fe8d84;
-
-$cf-font-family: 'Helvetica Neue','Neue Helvetica W01',Helvetica,Arial,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol',sans-serif;
-
-$cf-breakpoint-medium: relativeValue(768);
-
-$cf-anim-time: 0.75s;
-$cf-ease-easeIn: cubic-bezier(0.550, 0.055, 0.675, 0.190);
-$cf-ease-easeOut: cubic-bezier(0.215, 0.610, 0.355, 1.000);
-$cf-ease-easeInOut: cubic-bezier(0.645, 0.045, 0.355, 1.000);
-$cf-ease-easeOutBack: cubic-bezier(0.175, 0.885, 0.320, 1.275);
-
-/*
- Response
-*/
-$cf-chat-response-font-size: $cf-base-font-size;
-$cf-chat-response-border-radius: relativeValue(20px);
-
-$cf-color-chat-response-default-text: $cf-color-secondary;
-$cf-color-chat-response-default-bg: darken($cf-color-background, 3%);
-
-$cf-color-chat-response-user-text: lighten($cf-color-primary, 10%);
-$cf-color-chat-response-user-bg: lighten($cf-color-primary, 42%);
-
-$cf-avatar-area: relativeValue(24px); //The width/height of Robot and Human image/icon.
-$cf-avatar-background: none;
-
-/*
- Input
-*/
-$cf-color-input-text: $cf-color-secondary;
-$cf-input-field-height: relativeValue(45px);
-$cf-input-field-border-radius: relativeValue(0);
-$cf-input-submit-background: none;
-$cf-input-font-size: $cf-base-font-size;
-
-$cf-input-color-error-text: $cf-color-error;
-$cf-input-color-error-bg: lighten($cf-color-error, 20%);
diff --git a/src/styles/main.scss b/src/styles/main.scss
new file mode 100644
index 000000000..874ddaaab
--- /dev/null
+++ b/src/styles/main.scss
@@ -0,0 +1,23 @@
+// Variables and mixins
+@import "mixins/cf-mixins";
+@import "cf-variables";
+
+// Base styling
+@import "cf-base";
+
+// UI base elements
+@import "ui/cf-info";
+@import "ui/cf-input";
+@import "ui/cf-list-button";
+
+// UI chat elements
+@import "ui/chat/cf-chat";
+@import "ui/chat/cf-chat-response";
+
+// UI control elements
+@import "ui/control-elements/cf-control-elements";
+@import "ui/control-elements/cf-button";
+@import "ui/control-elements/cf-checkbox-button";
+@import "ui/control-elements/cf-options-list";
+@import "ui/control-elements/cf-radio-button";
+@import "ui/control-elements/cf-upload-file-ui";
diff --git a/src/styles/mixins/_cf-mixins.scss b/src/styles/mixins/_cf-mixins.scss
index 016e6bfb8..ddde0514b 100644
--- a/src/styles/mixins/_cf-mixins.scss
+++ b/src/styles/mixins/_cf-mixins.scss
@@ -1,6 +1,6 @@
@function relativeValue($pixels) {
$base-size: 12px;
-
+
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
diff --git a/src/styles/cf/ui/cf-info.scss b/src/styles/ui/_cf-info.scss
similarity index 100%
rename from src/styles/cf/ui/cf-info.scss
rename to src/styles/ui/_cf-info.scss
diff --git a/src/styles/cf/ui/cf-input.scss b/src/styles/ui/_cf-input.scss
similarity index 100%
rename from src/styles/cf/ui/cf-input.scss
rename to src/styles/ui/_cf-input.scss
diff --git a/src/styles/cf/ui/cf-list-button.scss b/src/styles/ui/_cf-list-button.scss
similarity index 100%
rename from src/styles/cf/ui/cf-list-button.scss
rename to src/styles/ui/_cf-list-button.scss
diff --git a/src/styles/cf/ui/chat/cf-chat-response.scss b/src/styles/ui/chat/_cf-chat-response.scss
similarity index 100%
rename from src/styles/cf/ui/chat/cf-chat-response.scss
rename to src/styles/ui/chat/_cf-chat-response.scss
diff --git a/src/styles/cf/ui/chat/cf-chat.scss b/src/styles/ui/chat/_cf-chat.scss
similarity index 100%
rename from src/styles/cf/ui/chat/cf-chat.scss
rename to src/styles/ui/chat/_cf-chat.scss
diff --git a/src/styles/cf/ui/control-elements/cf-button.scss b/src/styles/ui/control-elements/_cf-button.scss
similarity index 100%
rename from src/styles/cf/ui/control-elements/cf-button.scss
rename to src/styles/ui/control-elements/_cf-button.scss
diff --git a/src/styles/cf/ui/control-elements/cf-checkbox-button.scss b/src/styles/ui/control-elements/_cf-checkbox-button.scss
similarity index 100%
rename from src/styles/cf/ui/control-elements/cf-checkbox-button.scss
rename to src/styles/ui/control-elements/_cf-checkbox-button.scss
diff --git a/src/styles/cf/ui/control-elements/cf-control-elements.scss b/src/styles/ui/control-elements/_cf-control-elements.scss
similarity index 100%
rename from src/styles/cf/ui/control-elements/cf-control-elements.scss
rename to src/styles/ui/control-elements/_cf-control-elements.scss
diff --git a/src/styles/cf/ui/control-elements/cf-options-list.scss b/src/styles/ui/control-elements/_cf-options-list.scss
similarity index 100%
rename from src/styles/cf/ui/control-elements/cf-options-list.scss
rename to src/styles/ui/control-elements/_cf-options-list.scss
diff --git a/src/styles/cf/ui/control-elements/cf-radio-button.scss b/src/styles/ui/control-elements/_cf-radio-button.scss
similarity index 100%
rename from src/styles/cf/ui/control-elements/cf-radio-button.scss
rename to src/styles/ui/control-elements/_cf-radio-button.scss
diff --git a/src/styles/cf/ui/control-elements/cf-upload-file-ui.scss b/src/styles/ui/control-elements/_cf-upload-file-ui.scss
similarity index 100%
rename from src/styles/cf/ui/control-elements/cf-upload-file-ui.scss
rename to src/styles/ui/control-elements/_cf-upload-file-ui.scss
From 9841c674e57cf0ac868145997ce4c1c79f010c46 Mon Sep 17 00:00:00 2001
From: Jordi Tarrida
Date: Tue, 20 Feb 2018 15:47:45 +0100
Subject: [PATCH 3/6] fix .gitignore and package.json
---
.gitignore | 1 -
package.json | 3 ---
2 files changed, 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index 284a66793..a327b044c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,6 @@
node_modules
bower_components
.vscode
-package-lock.json
/build
src/scripts/typings
docs/build/conversational-form-docs.css
diff --git a/package.json b/package.json
index c6c1fa6e9..da3f2dbd9 100644
--- a/package.json
+++ b/package.json
@@ -28,8 +28,5 @@
"karma": "^1.7.0",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.4"
- },
- "dependencies": {
- "gulp": "^3.9.1"
}
}
From 1350a01ec7de91ece3c4031b5f61254ba4d79f66 Mon Sep 17 00:00:00 2001
From: Jordi Tarrida
Date: Wed, 21 Feb 2018 18:04:19 +0100
Subject: [PATCH 4/6] fix naming and src/development-*.html
---
gulp-tasks/styles.js | 2 +-
src/development-conditional-flow.html | 13 +------------
src/development-docs.html | 15 +--------------
src/development-formless.html | 13 +------------
src/development-submit-btn-issue-162.html | 13 +------------
src/development-voice-input-output.html | 13 +------------
src/development-voice-input.html | 13 +------------
.../{main.scss => conversational-form.scss} | 0
8 files changed, 7 insertions(+), 75 deletions(-)
rename src/styles/{main.scss => conversational-form.scss} (100%)
diff --git a/gulp-tasks/styles.js b/gulp-tasks/styles.js
index d6fa8e0da..41950c0c8 100644
--- a/gulp-tasks/styles.js
+++ b/gulp-tasks/styles.js
@@ -46,7 +46,7 @@ global.gulp.task('sass-form-build', ['sass-form'], function(){
*/
global.gulp.task('sass-form', function () {
var src = [
- global.srcFolder + "/styles/main.scss"
+ global.srcFolder + "/styles/conversational-form.scss"
]
var dst = global.buildFolder;
diff --git a/src/development-conditional-flow.html b/src/development-conditional-flow.html
index d9e411525..78ff4ff80 100644
--- a/src/development-conditional-flow.html
+++ b/src/development-conditional-flow.html
@@ -396,18 +396,7 @@
src="../build/cf/logic/FlowManager.js"
>
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/development-docs.html b/src/development-docs.html
index bf0dae1cd..ac2c1ed43 100644
--- a/src/development-docs.html
+++ b/src/development-docs.html
@@ -176,20 +176,7 @@
src="../build/cf/logic/FlowManager.js"
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/development-formless.html b/src/development-formless.html
index 3ecaf40e6..95a6787fd 100644
--- a/src/development-formless.html
+++ b/src/development-formless.html
@@ -240,18 +240,7 @@
src="../build/cf/logic/FlowManager.js"
>
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/development-submit-btn-issue-162.html b/src/development-submit-btn-issue-162.html
index 35e0bc538..45f19f5fb 100644
--- a/src/development-submit-btn-issue-162.html
+++ b/src/development-submit-btn-issue-162.html
@@ -176,18 +176,7 @@
src="../build/cf/logic/FlowManager.js"
>
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/development-voice-input-output.html b/src/development-voice-input-output.html
index bcca76a9c..3aa8cff57 100644
--- a/src/development-voice-input-output.html
+++ b/src/development-voice-input-output.html
@@ -249,18 +249,7 @@
src="../build/cf/logic/FlowManager.js"
>
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/development-voice-input.html b/src/development-voice-input.html
index d4ba2d672..2b07c0f0f 100644
--- a/src/development-voice-input.html
+++ b/src/development-voice-input.html
@@ -249,18 +249,7 @@
src="../build/cf/logic/FlowManager.js"
>
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/styles/main.scss b/src/styles/conversational-form.scss
similarity index 100%
rename from src/styles/main.scss
rename to src/styles/conversational-form.scss
From 3f4c30d4937b3639b4322a4ca2636c4a27d1ffe6 Mon Sep 17 00:00:00 2001
From: Jens Sogaard
Date: Wed, 28 Feb 2018 11:15:57 -0500
Subject: [PATCH 5/6] Added scss var for user input icon color.
---
dist/conversational-form.css | 406 ++++++++++++++----
dist/conversational-form.js | 5 +-
dist/conversational-form.min.css | 2 +-
dist/conversational-form.min.js | 4 +-
...evelopment-cf-robot-message--formless.html | 13 +-
src/development-cf-robot-message.html | 13 +-
src/styles/_cf-variables.scss | 1 +
src/styles/mixins/_cf-mixins.scss | 2 +-
src/styles/ui/_cf-input.scss | 8 +-
9 files changed, 329 insertions(+), 125 deletions(-)
diff --git a/dist/conversational-form.css b/dist/conversational-form.css
index 19f542e6b..68e58ed11 100644
--- a/dist/conversational-form.css
+++ b/dist/conversational-form.css
@@ -73,10 +73,15 @@
height: auto;
overflow: hidden;
margin-bottom: auto;
+ display: -webkit-box;
display: flex;
- flex-flow: column nowrap;
- justify-content: flex-end;
- align-items: baseline; }
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ flex-flow: column nowrap;
+ -webkit-box-pack: end;
+ justify-content: flex-end;
+ -webkit-box-align: baseline;
+ align-items: baseline; }
.conversational-form--enable-animation .conversational-form {
transition: opacity 0.1875s cubic-bezier(0.215, 0.61, 0.355, 1); }
.conversational-form * {
@@ -107,7 +112,8 @@ cf-info {
padding-right: 20px;
overflow: hidden;
display: block;
- transform: translateY(-115%);
+ -webkit-transform: translateY(-115%);
+ transform: translateY(-115%);
color: #acb2b6;
opacity: 0;
will-change: opacity; }
@@ -134,17 +140,20 @@ cf-input {
height: auto;
margin-bottom: 20px;
margin-top: 0px;
- flex: 0 0 auto;
+ -webkit-box-flex: 0;
+ flex: 0 0 auto;
/*input {
padding: 5px 5px 5px 15px;
}*/ }
cf-input.animate-in input, cf-input.animate-in textarea {
transition-delay: 0s, 0s, 0s, 0.4s, 0.4s;
opacity: 1;
- transform: translateY(0px) rotateX(0deg); }
+ -webkit-transform: translateY(0px) rotateX(0deg);
+ transform: translateY(0px) rotateX(0deg); }
cf-input.animate-in cf-input-button.cf-input-button {
transition-delay: 0s, 0s 0.75s;
- transform: scale(1, 1); }
+ -webkit-transform: scale(1, 1);
+ transform: scale(1, 1); }
cf-input input, cf-input textarea {
resize: none;
overflow: hidden;
@@ -173,13 +182,16 @@ cf-input {
background: white;
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.15);
opacity: 0;
- transform: translateY(40px) rotateX(-40deg); }
+ -webkit-transform: translateY(40px) rotateX(-40deg);
+ transform: translateY(40px) rotateX(-40deg); }
cf-input input:-webkit-autofill, cf-input textarea:-webkit-autofill {
background-color: white; }
cf-input input:focus, cf-input input:active, cf-input textarea:focus, cf-input textarea:active {
box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.2); }
.conversational-form--enable-animation cf-input input, .conversational-form--enable-animation cf-input textarea {
- transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; }
+ transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
+ transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
+ transition: box-shadow 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), background 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), color 0.75s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s; }
cf-input input:hover::-webkit-input-placeholder, cf-input textarea:hover::-webkit-input-placeholder {
color: #768086; }
cf-input input:hover::-moz-input-placeholder, cf-input textarea:hover::-moz-input-placeholder {
@@ -242,15 +254,18 @@ cf-input {
border-radius: 50%;
border-left: 0;
border-top: 0;
- animation: cf-spin 1s linear infinite;
+ -webkit-animation: cf-spin 1s linear infinite;
+ animation: cf-spin 1s linear infinite;
will-change: opacity; }
.conversational-form--enable-animation cf-input[tag-type="file"] cf-input-button.cf-input-button:after, .conversational-form--enable-animation cf-input cf-input-button.cf-input-button.loading:after {
transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
cf-input[tag-type="file"] cf-input-button.cf-input-button div.cf-icon-attachment {
- transform: rotateX(0deg);
+ -webkit-transform: rotateX(0deg);
+ transform: rotateX(0deg);
opacity: 1; }
cf-input[tag-type="file"] cf-input-button.cf-input-button div.cf-icon-progress {
- transform: rotateX(-90deg);
+ -webkit-transform: rotateX(-90deg);
+ transform: rotateX(-90deg);
opacity: 0; }
cf-input-button.cf-input-button {
@@ -265,35 +280,48 @@ cf-input-button.cf-input-button {
cursor: pointer;
border-radius: 50%;
will-change: background, border;
- transform-origin: 50% 50%;
- transform: scale(0, 0);
+ -webkit-transform-origin: 50% 50%;
+ transform-origin: 50% 50%;
+ -webkit-transform: scale(0, 0);
+ transform: scale(0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
border: 1px solid white; }
.conversational-form--enable-animation cf-input-button.cf-input-button {
- transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s; }
+ transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
+ transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s;
+ transition: background 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), border 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s, -webkit-transform 0.375s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0s; }
cf-input-button.cf-input-button .cf-input-icons.cf-microphone {
- transform: scale(0, 0);
+ -webkit-transform: scale(0, 0);
+ transform: scale(0, 0);
pointer-events: none; }
cf-input-button.cf-input-button.microphone-interface .cf-input-icons {
- transform-origin: 50% 50%;
- transform: scale(1, 1) rotateX(0deg) translateZ(0px);
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ -webkit-transform-origin: 50% 50%;
+ transform-origin: 50% 50%;
+ -webkit-transform: scale(1, 1) rotateX(0deg) translateZ(0px);
+ transform: scale(1, 1) rotateX(0deg) translateZ(0px);
+ transition: -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
cf-input-button.cf-input-button.microphone-interface .cf-input-icons:not(.cf-microphone) {
pointer-events: none;
- transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px); }
+ -webkit-transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
+ transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px); }
cf-input-button.cf-input-button.microphone-interface .cf-input-icons.cf-microphone {
pointer-events: auto;
- transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
+ -webkit-transform: scale(1, 1) rotateX(0deg) translateZ(0px);
+ transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) {
pointer-events: none; }
cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) .cf-microphone div.cf-icon-audio {
opacity: 1; }
cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons:not(.cf-microphone) {
pointer-events: auto;
- transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
+ -webkit-transform: scale(1, 1) rotateX(0deg) translateZ(0px);
+ transform: scale(1, 1) rotateX(0deg) translateZ(0px); }
cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons.cf-microphone {
- transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
+ -webkit-transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
+ transform: scale(0.25, 0.25) rotateX(90deg) translateZ(0px);
pointer-events: none; }
cf-input-button.cf-input-button .cf-input-icons {
position: absolute;
@@ -308,22 +336,28 @@ cf-input-button.cf-input-button {
z-index: 1;
background-repeat: no-repeat;
background-position: 50% 50%;
- transform-origin: 50% 50%;
+ -webkit-transform-origin: 50% 50%;
+ transform-origin: 50% 50%;
will-change: transform, opacity; }
.conversational-form--enable-animation cf-input-button.cf-input-button .cf-input-icons > div {
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
cf-input-button.cf-input-button div.cf-icon-attachment {
- transform: rotateX(90deg);
+ -webkit-transform: rotateX(90deg);
+ transform: rotateX(90deg);
opacity: 0;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
background-size: 12px 16px; }
cf-input-button.cf-input-button div.cf-icon-progress {
- transform: rotateX(0deg);
+ -webkit-transform: rotateX(0deg);
+ transform: rotateX(0deg);
opacity: 1;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='#0D83FF'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
background-size: 30px 30px; }
cf-input-button.cf-input-button div.cf-icon-audio {
- transform: rotateX(0deg);
+ -webkit-transform: rotateX(0deg);
+ transform: rotateX(0deg);
opacity: 1;
background-image: url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='#0D83FF' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e ");
background-size: 26px 26px; }
@@ -336,7 +370,8 @@ cf-input-button.cf-input-button {
opacity: 0; }
@media (min-width: 768px) {
cf-input-button.cf-input-button:hover .cf-icon-progress, cf-input-button.cf-input-button:focus .cf-icon-progress {
- animation: cf-arrow-up 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
+ -webkit-animation: cf-arrow-up 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
+ animation: cf-arrow-up 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
/**
* Show submit button for groups when input is hidden
@@ -354,37 +389,92 @@ cf-input[tag-type="group"].hide-input cf-input-control-elements {
cf-input[error=""].hide-input cf-input-button .cf-icon-progress {
-webkit-filter: saturate(0);
filter: saturate(0);
- animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
+ -webkit-animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
+ animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
+
+@-webkit-keyframes shake {
+ 10%, 90% {
+ -webkit-transform: translate3d(-1px, 0, 0);
+ transform: translate3d(-1px, 0, 0); }
+ 20%, 80% {
+ -webkit-transform: translate3d(1px, 0, 0);
+ transform: translate3d(1px, 0, 0); }
+ 30%, 50%, 70% {
+ -webkit-transform: translate3d(-2px, 0, 0);
+ transform: translate3d(-2px, 0, 0); }
+ 40%, 60% {
+ -webkit-transform: translate3d(2px, 0, 0);
+ transform: translate3d(2px, 0, 0); } }
@keyframes shake {
10%, 90% {
- transform: translate3d(-1px, 0, 0); }
+ -webkit-transform: translate3d(-1px, 0, 0);
+ transform: translate3d(-1px, 0, 0); }
20%, 80% {
- transform: translate3d(1px, 0, 0); }
+ -webkit-transform: translate3d(1px, 0, 0);
+ transform: translate3d(1px, 0, 0); }
30%, 50%, 70% {
- transform: translate3d(-2px, 0, 0); }
+ -webkit-transform: translate3d(-2px, 0, 0);
+ transform: translate3d(-2px, 0, 0); }
40%, 60% {
- transform: translate3d(2px, 0, 0); } }
+ -webkit-transform: translate3d(2px, 0, 0);
+ transform: translate3d(2px, 0, 0); } }
+
+@-webkit-keyframes cf-spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg); }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg); } }
@keyframes cf-spin {
0% {
- transform: rotate(0deg); }
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg); }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg); } }
+
+@-webkit-keyframes cf-arrow-up {
+ 0% {
+ -webkit-transform: translateY(0px);
+ transform: translateY(0px); }
+ 40% {
+ -webkit-transform: translateY(-40px);
+ transform: translateY(-40px); }
+ 40.001% {
+ -webkit-transform: translateY(40px);
+ transform: translateY(40px); }
+ 80% {
+ -webkit-transform: translateY(-5px);
+ transform: translateY(-5px); }
+ 90% {
+ -webkit-transform: translateY(2px);
+ transform: translateY(2px); }
100% {
- transform: rotate(360deg); } }
+ -webkit-transform: translateY(0px);
+ transform: translateY(0px); } }
@keyframes cf-arrow-up {
0% {
- transform: translateY(0px); }
+ -webkit-transform: translateY(0px);
+ transform: translateY(0px); }
40% {
- transform: translateY(-40px); }
+ -webkit-transform: translateY(-40px);
+ transform: translateY(-40px); }
40.001% {
- transform: translateY(40px); }
+ -webkit-transform: translateY(40px);
+ transform: translateY(40px); }
80% {
- transform: translateY(-5px); }
+ -webkit-transform: translateY(-5px);
+ transform: translateY(-5px); }
90% {
- transform: translateY(2px); }
+ -webkit-transform: translateY(2px);
+ transform: translateY(2px); }
100% {
- transform: translateY(0px); } }
+ -webkit-transform: translateY(0px);
+ transform: translateY(0px); } }
/*
Globals
@@ -419,11 +509,13 @@ cf-list-button {
cf-list-button:hover:nth-child(1) {
background: linear-gradient(to left, rgba(255, 255, 255, 0) 0%, white 75%); }
cf-list-button:hover:nth-child(1):after {
- animation: cf-arrow-left 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); }
+ -webkit-animation: cf-arrow-left 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
+ animation: cf-arrow-left 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); }
cf-list-button:hover:nth-child(2) {
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, white 75%); }
cf-list-button:hover:nth-child(2):after {
- animation: cf-arrow-right 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
+ -webkit-animation: cf-arrow-right 0.75s cubic-bezier(0.645, 0.045, 0.355, 1);
+ animation: cf-arrow-right 0.75s cubic-bezier(0.645, 0.045, 0.355, 1); } }
cf-list-button.cf-gradient:before {
opacity: 1; }
cf-list-button.active {
@@ -468,44 +560,108 @@ cf-list-button {
.conversational-form--enable-animation cf-list-button:after {
transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+@-webkit-keyframes cf-arrow-right {
+ 0% {
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
+ opacity: 1; }
+ 40% {
+ -webkit-transform: translateX(20px);
+ transform: translateX(20px);
+ opacity: 0; }
+ 40.001% {
+ -webkit-transform: translateX(-20px);
+ transform: translateX(-20px);
+ opacity: 0; }
+ 80% {
+ -webkit-transform: translateX(4px);
+ transform: translateX(4px);
+ opacity: 1; }
+ 90% {
+ -webkit-transform: translateX(-2px);
+ transform: translateX(-2px);
+ opacity: 1; }
+ 100% {
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
+ opacity: 1; } }
+
@keyframes cf-arrow-right {
0% {
- transform: translateX(0px);
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; }
40% {
- transform: translateX(20px);
+ -webkit-transform: translateX(20px);
+ transform: translateX(20px);
opacity: 0; }
40.001% {
- transform: translateX(-20px);
+ -webkit-transform: translateX(-20px);
+ transform: translateX(-20px);
opacity: 0; }
80% {
- transform: translateX(4px);
+ -webkit-transform: translateX(4px);
+ transform: translateX(4px);
opacity: 1; }
90% {
- transform: translateX(-2px);
+ -webkit-transform: translateX(-2px);
+ transform: translateX(-2px);
opacity: 1; }
100% {
- transform: translateX(0px);
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
+ opacity: 1; } }
+
+@-webkit-keyframes cf-arrow-left {
+ 0% {
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
+ opacity: 1; }
+ 40% {
+ -webkit-transform: translateX(-20px);
+ transform: translateX(-20px);
+ opacity: 0; }
+ 40.001% {
+ -webkit-transform: translateX(20px);
+ transform: translateX(20px);
+ opacity: 0; }
+ 80% {
+ -webkit-transform: translateX(-4px);
+ transform: translateX(-4px);
+ opacity: 1; }
+ 90% {
+ -webkit-transform: translateX(2px);
+ transform: translateX(2px);
+ opacity: 1; }
+ 100% {
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; } }
@keyframes cf-arrow-left {
0% {
- transform: translateX(0px);
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; }
40% {
- transform: translateX(-20px);
+ -webkit-transform: translateX(-20px);
+ transform: translateX(-20px);
opacity: 0; }
40.001% {
- transform: translateX(20px);
+ -webkit-transform: translateX(20px);
+ transform: translateX(20px);
opacity: 0; }
80% {
- transform: translateX(-4px);
+ -webkit-transform: translateX(-4px);
+ transform: translateX(-4px);
opacity: 1; }
90% {
- transform: translateX(2px);
+ -webkit-transform: translateX(2px);
+ transform: translateX(2px);
opacity: 1; }
100% {
- transform: translateX(0px);
+ -webkit-transform: translateX(0px);
+ transform: translateX(0px);
opacity: 1; } }
/*
@@ -523,10 +679,15 @@ cf-chat {
height: auto;
min-height: 100%;
overflow: visible;
+ display: -webkit-box;
display: flex;
- flex-flow: column nowrap;
- justify-content: flex-end;
- align-items: baseline;
+ -webkit-box-orient: vertical;
+ -webkit-box-direction: normal;
+ flex-flow: column nowrap;
+ -webkit-box-pack: end;
+ justify-content: flex-end;
+ -webkit-box-align: baseline;
+ align-items: baseline;
margin-bottom: 20px; }
cf-chat scrollable {
display: block;
@@ -608,15 +769,18 @@ cf-chat-response {
left: auto;
right: 0px; }
cf-chat-response.user text {
- transform-origin: 100% 0%;
- transform: translateY(-10px) translateX(-10px) scale(0.001, 0.001); }
+ -webkit-transform-origin: 100% 0%;
+ transform-origin: 100% 0%;
+ -webkit-transform: translateY(-10px) translateX(-10px) scale(0.001, 0.001);
+ transform: translateY(-10px) translateX(-10px) scale(0.001, 0.001); }
cf-chat-response.user text > p {
background: #e3f1ff;
border-radius: 20px 0px 20px 20px;
margin-right: 0px;
margin-left: auto; }
cf-chat-response.user.peak-thumb thumb {
- transform: scale(1, 1) translateY(0px);
+ -webkit-transform: scale(1, 1) translateY(0px);
+ transform: scale(1, 1) translateY(0px);
opacity: 1; }
.conversational-form--enable-animation cf-chat-response.user.peak-thumb thumb {
transition-delay: 0.2s, 0.2s, 0.2s; }
@@ -639,8 +803,10 @@ cf-chat-response {
opacity: 0;
white-space: pre-wrap;
word-break: normal;
- transform-origin: 0% 0%;
- transform: translateY(-10px) translateX(10px) scale(0.001, 0.001);
+ -webkit-transform-origin: 0% 0%;
+ transform-origin: 0% 0%;
+ -webkit-transform: translateY(-10px) translateX(10px) scale(0.001, 0.001);
+ transform: translateY(-10px) translateX(10px) scale(0.001, 0.001);
will-change: transform, opacity, background;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
@@ -648,11 +814,14 @@ cf-chat-response {
cf-chat-response text > div {
display: inline-block; }
cf-chat-response text thinking span:nth-child(1) {
- animation-delay: 0.66667 s; }
+ -webkit-animation-delay: 0.66667 s;
+ animation-delay: 0.66667 s; }
cf-chat-response text thinking span:nth-child(2) {
- animation-delay: 1.33333 s; }
+ -webkit-animation-delay: 1.33333 s;
+ animation-delay: 1.33333 s; }
cf-chat-response text thinking span:nth-child(3) {
- animation-delay: 2 s; }
+ -webkit-animation-delay: 2 s;
+ animation-delay: 2 s; }
cf-chat-response text strong {
font-weight: 900; }
cf-chat-response text > p {
@@ -684,7 +853,8 @@ cf-chat-response {
position: absolute;
top: 50%;
left: 20px;
- transform: translateY(-50%);
+ -webkit-transform: translateY(-50%);
+ transform: translateY(-50%);
padding-right: 20px; }
cf-chat-response text thinking {
position: relative;
@@ -694,14 +864,19 @@ cf-chat-response {
-ms-user-select: none;
user-select: none;
display: none;
- transform-origin: 0% 50%;
- transform: scale(1.5); }
+ -webkit-transform-origin: 0% 50%;
+ transform-origin: 0% 50%;
+ -webkit-transform: scale(1.5);
+ transform: scale(1.5); }
cf-chat-response text thinking span:nth-child(1) {
- animation: dot-fade 1s linear 0.33333 s infinite; }
+ -webkit-animation: dot-fade 1s linear 0.33333 s infinite;
+ animation: dot-fade 1s linear 0.33333 s infinite; }
cf-chat-response text thinking span:nth-child(2) {
- animation: dot-fade 1s linear 0.66667 s infinite; }
+ -webkit-animation: dot-fade 1s linear 0.66667 s infinite;
+ animation: dot-fade 1s linear 0.66667 s infinite; }
cf-chat-response text thinking span:nth-child(3) {
- animation: dot-fade 1s linear 1 s infinite; }
+ -webkit-animation: dot-fade 1s linear 1 s infinite;
+ animation: dot-fade 1s linear 1 s infinite; }
cf-chat-response text svg.cf-icon-file {
width: 10px;
height: auto;
@@ -722,11 +897,15 @@ cf-chat-response {
background-position: 50% 50%;
opacity: 0;
overflow: hidden;
- transform-origin: 50% 50%;
- transform: scale(0.001, 0.001) translateY(50px);
+ -webkit-transform-origin: 50% 50%;
+ transform-origin: 50% 50%;
+ -webkit-transform: scale(0.001, 0.001) translateY(50px);
+ transform: scale(0.001, 0.001) translateY(50px);
will-change: transform, opacity; }
.conversational-form--enable-animation cf-chat-response thumb {
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s; }
+ transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s;
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s;
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1875s; }
cf-chat-response thumb > span {
display: block;
line-height: 24px;
@@ -738,21 +917,35 @@ cf-chat-response {
cf-chat-response thumb > span[length="3"] {
font-size: 7.92px; }
cf-chat-response.show text {
- transform: translateY(0px) translateX(0px) scale(1, 1);
+ -webkit-transform: translateY(0px) translateX(0px) scale(1, 1);
+ transform: translateY(0px) translateX(0px) scale(1, 1);
opacity: 1; }
.conversational-form--enable-animation cf-chat-response.show text {
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; }
+ transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s, -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; }
.conversational-form--enable-animation cf-chat-response.show text {
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1);
transition-delay: 0.1875s, 0.1875s, 0s; }
cf-chat-response.show text[value-added] {
will-change: auto; }
cf-chat-response.show.robot thumb {
- transform: scale(1, 1) translateY(0px);
+ -webkit-transform: scale(1, 1) translateY(0px);
+ transform: scale(1, 1) translateY(0px);
opacity: 1; }
.conversational-form--enable-animation cf-chat-response.show.robot thumb {
transition-delay: 0.2s, 0.2s, 0.2s; }
+@-webkit-keyframes dot-fade {
+ 0% {
+ opacity: 1; }
+ 15.1111% {
+ opacity: 0; }
+ 33.333% {
+ opacity: 1; }
+ 100% {
+ opacity: 1; } }
+
@keyframes dot-fade {
0% {
opacity: 1; }
@@ -763,15 +956,32 @@ cf-chat-response {
100% {
opacity: 1; } }
+@-webkit-keyframes bounce {
+ 0% {
+ -webkit-transform: scale(1, 1);
+ transform: scale(1, 1);
+ opacity: 1; }
+ 50% {
+ -webkit-transform: scale(1.05, 1.05);
+ transform: scale(1.05, 1.05);
+ opacity: 0.85; }
+ 100% {
+ -webkit-transform: scale(1, 1);
+ transform: scale(1, 1);
+ opacity: 1; } }
+
@keyframes bounce {
0% {
- transform: scale(1, 1);
+ -webkit-transform: scale(1, 1);
+ transform: scale(1, 1);
opacity: 1; }
50% {
- transform: scale(1.05, 1.05);
+ -webkit-transform: scale(1.05, 1.05);
+ transform: scale(1.05, 1.05);
opacity: 0.85; }
100% {
- transform: scale(1, 1);
+ -webkit-transform: scale(1, 1);
+ transform: scale(1, 1);
opacity: 1; } }
/*
@@ -849,8 +1059,10 @@ cf-list {
-ms-user-select: none;
user-select: none;
overflow: hidden;
- transform: translateZ(0px);
- transform-origin: 0% 100%;
+ -webkit-transform: translateZ(0px);
+ transform: translateZ(0px);
+ -webkit-transform-origin: 0% 100%;
+ transform-origin: 0% 100%;
will-change: opacity, background;
opacity: 0; }
.cf-button > div {
@@ -871,7 +1083,8 @@ cf-list {
.conversational-form--enable-animation .cf-button.animate-in:nth-child(odd) {
transition-delay: 0.15s, 0s; }
.cf-button.animate-in.animate-out {
- transform-origin: 75% 100%;
+ -webkit-transform-origin: 75% 100%;
+ transform-origin: 75% 100%;
opacity: 0; }
.cf-button:not(:last-child) {
margin-right: 10px; }
@@ -940,16 +1153,21 @@ cf-list {
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='13px' height='10px' viewBox='0 0 13 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-290.000000, -505.000000)' fill='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 216.000000)'%3e%3cg transform='translate(189.000000, 139.000000)'%3e%3cpolygon points='17.5 18.5 16 20 20 24 29 15.5 27.5 14 20 21'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
background-size: 13px 10px;
background-repeat: no-repeat;
- transform-origin: 50% 50%;
+ -webkit-transform-origin: 50% 50%;
+ transform-origin: 50% 50%;
will-change: transform;
- transform: scale(0, 0); }
+ -webkit-transform: scale(0, 0);
+ transform: scale(0, 0); }
.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox:after {
- transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ transition: -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
.cf-button.cf-checkbox-button[checked="checked"] cf-checkbox, .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox {
background: rgba(227, 241, 255, 0); }
.cf-button.cf-checkbox-button[checked="checked"] cf-checkbox:after, .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox:after {
- transform: scale(1, 1); }
+ -webkit-transform: scale(1, 1);
+ transform: scale(1, 1); }
.conversational-form--enable-animation .cf-button.cf-checkbox-button[checked="checked"] cf-checkbox:after, .conversational-form--enable-animation .cf-button.cf-checkbox-button[selected="selected"] cf-checkbox:after {
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); }
@@ -1018,13 +1236,17 @@ cf-upload-file-ui {
padding-right: 30px;
color: #409dff;
opacity: 0;
- transform: translateY(20px) rotateX(30deg);
+ -webkit-transform: translateY(20px) rotateX(30deg);
+ transform: translateY(20px) rotateX(30deg);
will-change: opacity, transform; }
.conversational-form--enable-animation cf-upload-file-ui {
- transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
+ transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1);
+ transition: opacity 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1), -webkit-transform 0.375s cubic-bezier(0.215, 0.61, 0.355, 1); }
cf-upload-file-ui.animate-in {
opacity: 1;
- transform: translateY(0px) rotateX(0deg); }
+ -webkit-transform: translateY(0px) rotateX(0deg);
+ transform: translateY(0px) rotateX(0deg); }
.conversational-form--enable-animation cf-upload-file-ui.animate-in {
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1), cubic-bezier(0.215, 0.61, 0.355, 1); }
diff --git a/dist/conversational-form.js b/dist/conversational-form.js
index b96b0e0af..137c13a6e 100644
--- a/dist/conversational-form.js
+++ b/dist/conversational-form.js
@@ -4277,6 +4277,9 @@ var cf;
if (this._currentTag.skipUserInput === true) {
this.el.classList.add("hide-input");
}
+ else {
+ this.el.classList.remove("hide-input");
+ }
if (cf.UserInputElement.hideUserInputOnNoneTextInput) {
// toggle userinput hide
if (this.controlElements.active) {
@@ -4779,7 +4782,7 @@ var cf;
}
};
ChatResponse.prototype.setToThinking = function () {
- var canShowThinking = (this.isRobotResponse && this.uiOptions.robot.robotResponseTime !== 0) || (!this.isRobotResponse && this.cfReference.uiOptions.user.showThinking);
+ var canShowThinking = (this.isRobotResponse && this.uiOptions.robot.robotResponseTime !== 0) || (!this.isRobotResponse && this.cfReference.uiOptions.user.showThinking && !this._tag.skipUserInput);
if (canShowThinking) {
this.textEl.innerHTML = ChatResponse.THINKING_MARKUP;
this.el.classList.remove("can-edit");
diff --git a/dist/conversational-form.min.css b/dist/conversational-form.min.css
index 9bfe7eb3e..07148b984 100644
--- a/dist/conversational-form.min.css
+++ b/dist/conversational-form.min.css
@@ -1 +1 @@
-@charset "UTF-8";.conversational-form{visibility:visible!important;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;line-height:1.416666667;position:absolute;top:0;left:0;right:0;bottom:0;z-index:999;margin:auto;background:#fff;overflow:hidden;opacity:0;will-change:opacity}.conversational-form *,.conversational-form :after,.conversational-form :before{box-sizing:border-box;outline:0}.conversational-form:before{content:"";width:100%;height:50px;pointer-events:none;background:linear-gradient(to bottom,#fff 0,rgba(255,255,255,0) 100%);position:absolute;top:0;left:0;z-index:2}.conversational-form button{border:none;background:0 0;margin:0;padding:0;outline:0;-webkit-tap-highlight-color:transparent!important}.conversational-form menu{padding:0;margin:0}.conversational-form li,.conversational-form ol,.conversational-form ul{margin:0;padding:0}.conversational-form a,.conversational-form a:active,.conversational-form a:visited{color:currentColor}.conversational-form a,.conversational-form button{cursor:pointer}.conversational-form .conversational-form-inner{padding:0 20px;position:absolute;width:100%;min-height:100%;max-height:100%;bottom:0;height:auto;overflow:hidden;margin-bottom:auto;display:flex;flex-flow:column nowrap;justify-content:flex-end;align-items:baseline}.conversational-form--enable-animation .conversational-form{transition:opacity .1875s cubic-bezier(.215,.61,.355,1)}.conversational-form *{-webkit-tap-highlight-color:rgba(255,255,255,0);tap-highlight-color:rgba(255,255,255,0)}.conversational-form--show{opacity:1}cf-info{position:absolute;pointer-events:none;z-index:0;left:2px;top:0;height:auto;width:100%;text-overflow:ellipsis;padding-right:20px;overflow:hidden;display:block;transform:translateY(-115%);color:#acb2b6;opacity:0;will-change:opacity}cf-info.show{opacity:1}.conversational-form--enable-animation cf-info.show{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-info strong{font-weight:900}cf-input{display:block;position:relative;width:100%;height:auto;margin-bottom:20px;margin-top:0;flex:0 0 auto}cf-input.animate-in input,cf-input.animate-in textarea{transition-delay:0s,0s,0s,.4s,.4s;opacity:1;transform:translateY(0) rotateX(0)}cf-input.animate-in cf-input-button.cf-input-button{transition-delay:0s,0s .75s;transform:scale(1,1)}cf-input input,cf-input textarea{resize:none;overflow:hidden;padding:calc((45px - 2px - 12px)/ 2) calc(45px - 6px) calc((45px - 2px - 12px)/ 2) 15px}cf-input input,cf-input textarea{outline:0;-webkit-appearance:none;-webkit-touch-callout:auto!important;-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important;border-radius:0;border:none;-webkit-appearance:none;position:relative;z-index:2;display:block;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;width:100%;height:45px;min-height:45px;color:#acb2b6;will-change:box-shadow,background,color,transform,opacity;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.15);opacity:0;transform:translateY(40px) rotateX(-40deg)}cf-input input:-webkit-autofill,cf-input textarea:-webkit-autofill{background-color:#fff}cf-input input:active,cf-input input:focus,cf-input textarea:active,cf-input textarea:focus{box-shadow:0 0 30px rgba(0,0,0,.2)}.conversational-form--enable-animation cf-input input,.conversational-form--enable-animation cf-input textarea{transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s}cf-input input:hover::-webkit-input-placeholder,cf-input textarea:hover::-webkit-input-placeholder{color:#768086}cf-input input:hover::-moz-input-placeholder,cf-input textarea:hover::-moz-input-placeholder{color:#768086}cf-input input:hover:-moz-input-placeholder,cf-input textarea:hover:-moz-input-placeholder{color:#768086}cf-input input:hover:-ms-input-placeholder,cf-input textarea:hover:-ms-input-placeholder{color:#768086}cf-input input::-webkit-input-placeholder,cf-input textarea::-webkit-input-placeholder{color:currentColor}cf-input input::-moz-input-placeholder,cf-input textarea::-moz-input-placeholder{color:currentColor}cf-input input:-moz-input-placeholder,cf-input textarea:-moz-input-placeholder{color:currentColor}cf-input input:-ms-input-placeholder,cf-input textarea:-ms-input-placeholder{color:currentColor}cf-input.hide-input input,cf-input.hide-input textarea{display:none}cf-input.hide-input cf-input-button{display:none}cf-input[disabled=disabled]{pointer-events:none}cf-input[disabled=disabled] input,cf-input[disabled=disabled] textarea{background:rgba(247,247,247,.5)}cf-input[disabled=disabled] .cf-input-button{background:rgba(247,247,247,.75)}cf-input cf-icon-audio-eq{display:block;border:0 solid grey;border-color:#e3f1ff;width:100%;height:100%;border-radius:50%;z-index:0;position:absolute;top:0;left:0}cf-input[error]{pointer-events:none}cf-input[error] input,cf-input[error] textarea{background:#ffebe9;color:#fe8d84}cf-input[error] .cf-input-button{background:#ffebe9}cf-input[error] .cf-input-button svg polygon{fill:#fe8d84}cf-input[message] input,cf-input[message] textarea{background:#e3f1ff;color:#409dff}cf-input[message] .cf-input-button{background:#e3f1ff}cf-input[message] .cf-input-button svg polygon{fill:#409dff}cf-input cf-input-button.cf-input-button.loading:after,cf-input[tag-type=file] cf-input-button.cf-input-button:after{content:"";display:block;width:100%;height:100%;border:1px solid #b9bcbe;border-radius:50%;border-left:0;border-top:0;animation:cf-spin 1s linear infinite;will-change:opacity}.conversational-form--enable-animation cf-input cf-input-button.cf-input-button.loading:after,.conversational-form--enable-animation cf-input[tag-type=file] cf-input-button.cf-input-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-attachment{transform:rotateX(0);opacity:1}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-progress{transform:rotateX(-90deg);opacity:0}cf-input-button.cf-input-button{width:29px;height:29px;background:0 0;position:absolute;overflow:hidden;right:8px;bottom:8px;z-index:3;cursor:pointer;border-radius:50%;will-change:background,border;transform-origin:50% 50%;transform:scale(0,0);-webkit-backface-visibility:hidden;backface-visibility:hidden;border:1px solid #fff}.conversational-form--enable-animation cf-input-button.cf-input-button{transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s}cf-input-button.cf-input-button .cf-input-icons.cf-microphone{transform:scale(0,0);pointer-events:none}cf-input-button.cf-input-button.microphone-interface .cf-input-icons{transform-origin:50% 50%;transform:scale(1,1) rotateX(0) translateZ(0);transition:transform 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons:not(.cf-microphone){pointer-events:none;transform:scale(.25,.25) rotateX(90deg) translateZ(0)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons.cf-microphone{pointer-events:auto;transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing){pointer-events:none}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) .cf-microphone div.cf-icon-audio{opacity:1}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons:not(.cf-microphone){pointer-events:auto;transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons.cf-microphone{transform:scale(.25,.25) rotateX(90deg) translateZ(0);pointer-events:none}cf-input-button.cf-input-button .cf-input-icons{position:absolute;z-index:1;pointer-events:none;width:100%;height:100%}cf-input-button.cf-input-button .cf-input-icons>div{width:100%;height:100%;position:absolute;z-index:1;background-repeat:no-repeat;background-position:50% 50%;transform-origin:50% 50%;will-change:transform,opacity}.conversational-form--enable-animation cf-input-button.cf-input-button .cf-input-icons>div{transition:transform 375ms cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button div.cf-icon-attachment{transform:rotateX(90deg);opacity:0;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:12px 16px}cf-input-button.cf-input-button div.cf-icon-progress{transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='#0D83FF'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:30px 30px}cf-input-button.cf-input-button div.cf-icon-audio{transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='#0D83FF' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e");background-size:26px 26px}cf-input-button.cf-input-button:active{opacity:.2}cf-input-button.cf-input-button:focus,cf-input-button.cf-input-button:hover{background:#e3f1ff;border:1px solid #fff}cf-input-button.cf-input-button:focus:after,cf-input-button.cf-input-button:hover:after{opacity:0}@media (min-width:768px){cf-input-button.cf-input-button:focus .cf-icon-progress,cf-input-button.cf-input-button:hover .cf-icon-progress{animation:cf-arrow-up .75s cubic-bezier(.645,.045,.355,1)}}cf-input[tag-type=group].hide-input cf-input-button{display:block;left:0;right:0;margin-left:auto;margin-right:auto}cf-input[tag-type=group].hide-input cf-input-control-elements{margin-bottom:45px}cf-input[error=""].hide-input cf-input-button .cf-icon-progress{-webkit-filter:saturate(0);filter:saturate(0);animation:shake .6s cubic-bezier(.36,.07,.19,.97) both}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}@keyframes cf-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes cf-arrow-up{0%{transform:translateY(0)}40%{transform:translateY(-40px)}40.001%{transform:translateY(40px)}80%{transform:translateY(-5px)}90%{transform:translateY(2px)}100%{transform:translateY(0)}}cf-input-control-elements.animate-in cf-list-button{opacity:1}cf-input-control-elements.hide-nav-buttons cf-list-button{pointer-events:none}cf-input-control-elements.hide-nav-buttons cf-list-button:after{opacity:0}cf-list-button{display:block;position:absolute;z-index:2;height:calc(100% - 16px);width:38px;cursor:pointer;opacity:0;pointer-events:none;will-change:opacity}.conversational-form--enable-animation cf-list-button{transition:opacity .75s cubic-bezier(.215,.61,.355,1) .5s}@media (min-width:768px){cf-list-button:hover:nth-child(1){background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(1):after{animation:cf-arrow-left .75s cubic-bezier(.645,.045,.355,1)}cf-list-button:hover:nth-child(2){background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(2):after{animation:cf-arrow-right .75s cubic-bezier(.645,.045,.355,1)}}cf-list-button.cf-gradient:before{opacity:1}cf-list-button.active{pointer-events:auto}cf-list-button.active:after{opacity:1}cf-list-button:active:after{visibility:hidden}cf-list-button:nth-child(1){left:0}cf-list-button:nth-child(1):before{background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(1):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)' %3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon transform='translate(29.000000, 54.000000) rotate(-180.000000) translate(-29.000000, -54.000000) ' points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:nth-child(2){right:0}cf-list-button:nth-child(2):before{background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(2):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)'%3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:before{content:"";display:block;width:100%;height:100%;opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:before{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-list-button:after{content:"";display:block;width:6px;height:10px;position:absolute;background-size:6px 10px;background-repeat:no-repeat;top:calc(50% - 5px);left:calc(50% - 3px);opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}@keyframes cf-arrow-right{0%{transform:translateX(0);opacity:1}40%{transform:translateX(20px);opacity:0}40.001%{transform:translateX(-20px);opacity:0}80%{transform:translateX(4px);opacity:1}90%{transform:translateX(-2px);opacity:1}100%{transform:translateX(0);opacity:1}}@keyframes cf-arrow-left{0%{transform:translateX(0);opacity:1}40%{transform:translateX(-20px);opacity:0}40.001%{transform:translateX(20px);opacity:0}80%{transform:translateX(-4px);opacity:1}90%{transform:translateX(2px);opacity:1}100%{transform:translateX(0);opacity:1}}cf-chat{display:block;width:100%;height:auto;min-height:100%;overflow:visible;display:flex;flex-flow:column nowrap;justify-content:flex-end;align-items:baseline;margin-bottom:20px}cf-chat scrollable{display:block;width:100%;height:auto;max-height:100%;min-height:40px;overflow-y:auto;padding-bottom:20px;padding-top:40px}cf-chat scrollable::-webkit-scrollbar{width:4px;height:4px;-webkit-appearance:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-track{background:#fff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical{background:#e3f1ff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb{background:#fff;border:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical:active{background:#7dbcff;border:none;-webkit-border-radius:100px}.conversational-form.done cf-chat-response{pointer-events:none}cf-chat-response{display:table;max-width:80%;min-width:120px;width:auto;position:relative;-webkit-backface-visibility:hidden;backface-visibility:hidden;padding-left:calc(24px + 10px);padding-top:16px;color:#acb2b6;margin-left:0;margin-right:auto;word-break:break-all}@media (min-width:768px){cf-chat-response{max-width:50%}}cf-chat-response.can-edit{cursor:pointer}cf-chat-response.can-edit:hover{color:#6a7379}cf-chat-response.can-edit:hover text>p{background:#fff}cf-chat-response.robot text>p{opacity:0;will-change:opacity;transition:opacity 375ms cubic-bezier(.215,.61,.355,1) .2s}cf-chat-response.robot text>p.show{opacity:1}cf-chat-response.user{margin-right:0;margin-left:auto;padding-left:0;padding-right:calc(24px + 10px);color:#409dff}cf-chat-response.user thumb{left:auto;right:0}cf-chat-response.user text{transform-origin:100% 0;transform:translateY(-10px) translateX(-10px) scale(.001,.001)}cf-chat-response.user text>p{background:#e3f1ff;border-radius:20px 0 20px 20px;margin-right:0;margin-left:auto}cf-chat-response.user.peak-thumb thumb{transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.user.peak-thumb thumb{transition-delay:.2s,.2s,.2s}cf-chat-response.disabled{pointer-events:none;color:#f0f1f2}cf-chat-response.disabled text{background:#fff}cf-chat-response[thinking] text thinking{display:block}cf-chat-response text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;overflow:hidden;position:relative;min-height:40px;opacity:0;white-space:pre-wrap;word-break:normal;transform-origin:0 0;transform:translateY(-10px) translateX(10px) scale(.001,.001);will-change:transform,opacity,background;-webkit-backface-visibility:hidden;backface-visibility:hidden;height:auto}cf-chat-response text>div{display:inline-block}cf-chat-response text thinking span:nth-child(1){animation-delay:.66667 s}cf-chat-response text thinking span:nth-child(2){animation-delay:1.33333 s}cf-chat-response text thinking span:nth-child(3){animation-delay:2 s}cf-chat-response text strong{font-weight:900}cf-chat-response text>p{margin:0;padding:0;background:#f7f7f7;padding:12px 24px 12px 24px;display:table;border-radius:0 20px 20px 20px;transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-chat-response text>p:not(:only-child){border-radius:0 20px 20px 0}cf-chat-response text>p:not(:only-child):first-child{border-radius:20px 20px 20px 0}cf-chat-response text>p:not(:only-child):last-child{border-radius:0 20px 20px 20px}cf-chat-response text>p:not(:only-child):not(:first-child){margin-top:3px}cf-chat-response text>p>img{max-width:140px;padding-bottom:5px;width:100%;height:auto;display:block;margin-bottom:4px}cf-chat-response text:after{content:"";display:block;position:absolute;top:50%;left:20px;transform:translateY(-50%);padding-right:20px}cf-chat-response text thinking{position:relative;display:table;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:none;transform-origin:0 50%;transform:scale(1.5)}cf-chat-response text thinking span:nth-child(1){animation:dot-fade 1s linear .33333 s infinite}cf-chat-response text thinking span:nth-child(2){animation:dot-fade 1s linear .66667 s infinite}cf-chat-response text thinking span:nth-child(3){animation:dot-fade 1s linear 1 s infinite}cf-chat-response text svg.cf-icon-file{width:10px;height:auto;display:inline-block;margin-right:7px}cf-chat-response text svg.cf-icon-file g{fill:#0d83ff}cf-chat-response thumb{position:absolute;top:0;left:0;display:block;width:24px;height:24px;border-radius:50%;background:0 0;background-size:cover;background-position:50% 50%;opacity:0;overflow:hidden;transform-origin:50% 50%;transform:scale(.001,.001) translateY(50px);will-change:transform,opacity}.conversational-form--enable-animation cf-chat-response thumb{transition:transform 375ms cubic-bezier(.215,.61,.355,1) .1875s,opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s}cf-chat-response thumb>span{display:block;line-height:24px;text-align:center;font-weight:700;font-size:9.6px}cf-chat-response thumb>span[length="1"]{font-size:19.2px}cf-chat-response thumb>span[length="3"]{font-size:7.92px}cf-chat-response.show text{transform:translateY(0) translateX(0) scale(1,1);opacity:1}.conversational-form--enable-animation cf-chat-response.show text{transition:transform 375ms cubic-bezier(.215,.61,.355,1) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s}.conversational-form--enable-animation cf-chat-response.show text{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1);transition-delay:.1875s,.1875s,0s}cf-chat-response.show text[value-added]{will-change:auto}cf-chat-response.show.robot thumb{transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.show.robot thumb{transition-delay:.2s,.2s,.2s}@keyframes dot-fade{0%{opacity:1}15.1111%{opacity:0}33.333%{opacity:1}100%{opacity:1}}@keyframes bounce{0%{transform:scale(1,1);opacity:1}50%{transform:scale(1.05,1.05);opacity:.85}100%{transform:scale(1,1);opacity:1}}cf-input-control-elements{width:auto;height:auto;overflow:hidden;display:block;position:relative;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;height:auto}cf-input-control-elements .cf-button{margin-bottom:10px;display:inline-block}cf-input-control-elements .cf-button.hide{display:none}cf-input-control-elements.resized{visibility:visible;height:auto}cf-input-control-elements.one-row cf-list{height:auto}cf-input-control-elements.one-row cf-list-button{opacity:0}cf-input-control-elements.two-row cf-list{white-space:normal;height:auto}cf-list,cf-list-button{will-change:height}.conversational-form--enable-animation cf-list,.conversational-form--enable-animation cf-list-button{transition:height 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-list{cursor:default}cf-list{display:block;height:auto;cursor:move;white-space:nowrap}cf-list.disabled{pointer-events:none}.cf-button{background:#fff;cursor:pointer;border:1px solid rgba(13,131,255,.1);border-radius:calc(20px * 1.2);color:#409dff;line-height:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;transform:translateZ(0);transform-origin:0 100%;will-change:opacity,background;opacity:0}.cf-button>div{padding:12px 24px}.cf-button.has-image{max-width:180px}.cf-button>div{position:relative}.conversational-form--enable-animation .cf-button{transition:opacity 0s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1)}.cf-button.animate-in{opacity:1}.conversational-form--enable-animation .cf-button.animate-in{transition-duration:375ms,.75s;transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}.conversational-form--enable-animation .cf-button.animate-in:nth-child(even){transition-delay:50ms,0s}.conversational-form--enable-animation .cf-button.animate-in:nth-child(odd){transition-delay:.15s,0s}.cf-button.animate-in.animate-out{transform-origin:75% 100%;opacity:0}.cf-button:not(:last-child){margin-right:10px}.cf-button:focus:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:focus:not([checked=checked]),.cf-button:hover:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:hover:not([checked=checked]){background:rgba(13,131,255,.1)}.cf-button[checked=checked]:not(:focus):not(:hover):not(.highlight),.cf-button[selected=selected]:not(:focus):not(:hover):not(.highlight){background:rgba(13,131,255,.1)}.cf-button[disabled=disabled]{pointer-events:none}.cf-button[disabled=disabled].animate-in{opacity:.5}.cf-button:active>div{opacity:.2}.cf-button .cf-image{width:100%;height:auto;will-change:opacity;transition:opacity .75s cubic-bezier(.215,.61,.355,1);opacity:0}.cf-button .cf-image.loaded{opacity:1}.cf-button.cf-checkbox-button.highlight cf-checkbox,.cf-button.cf-checkbox-button:focus cf-checkbox,.cf-button.cf-checkbox-button:hover cf-checkbox{background:#409dff}.cf-button.cf-checkbox-button.no-text{padding:12px 16px}.cf-button.cf-checkbox-button.no-text cf-checkbox{margin-right:0;margin-left:0}.cf-button.cf-checkbox-button.has-image cf-checkbox{margin-left:0}.cf-button.cf-checkbox-button cf-checkbox{display:block;float:left;width:14px;height:14px;border-radius:3px;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox{transition:background 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button cf-checkbox:after{content:"";position:absolute;top:2px;left:1px;display:block;width:13px;height:10px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='13px' height='10px' viewBox='0 0 13 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-290.000000, -505.000000)' fill='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 216.000000)'%3e%3cg transform='translate(189.000000, 139.000000)'%3e%3cpolygon points='17.5 18.5 16 20 20 24 29 15.5 27.5 14 20 21'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:13px 10px;background-repeat:no-repeat;transform-origin:50% 50%;will-change:transform;transform:scale(0,0)}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox:after{transition:transform 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox{background:rgba(227,241,255,0)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{transform:scale(1,1)}.conversational-form--enable-animation .cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.conversational-form--enable-animation .cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{transition-timing-function:cubic-bezier(.215,.61,.355,1)}cf-options-list{display:block;width:auto}cf-radio-button.cf-button.highlight cf-radio,cf-radio-button.cf-button:focus cf-radio,cf-radio-button.cf-button:hover cf-radio{background:#409dff}cf-radio-button.cf-button.has-image cf-checkbox{margin-left:0}cf-radio-button.cf-button cf-radio{display:block;float:left;width:14px;height:14px;border-radius:50%;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation cf-radio-button.cf-button cf-radio{transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-radio-button.cf-button[checked=checked] cf-radio{background:#409dff;pointer-events:none}cf-upload-file-ui{display:block;width:100%;height:45px;position:absolute;top:0;padding-right:30px;color:#409dff;opacity:0;transform:translateY(20px) rotateX(30deg);will-change:opacity,transform}.conversational-form--enable-animation cf-upload-file-ui{transition:opacity 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-ui.animate-in{opacity:1;transform:translateY(0) rotateX(0)}.conversational-form--enable-animation cf-upload-file-ui.animate-in{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}cf-upload-file-text{display:block;float:left;width:auto;height:100%;padding-left:40px;padding-right:30px;padding-top:17px;position:relative;color:currentColor;max-width:50%;text-overflow:ellipsis;overflow:hidden}cf-upload-file-text:before{content:"";display:inline-block;position:absolute;top:17px;left:23px;width:10px;height:14px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 10 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-756.000000, -549.000000)' fill='#0D83FF'%3e%3cg transform='translate(736.000000, 127.000000)'%3e%3cg transform='translate(0.000000, 406.000000)'%3e%3cpolygon points='20 16 26.0030799 16 30 19.99994 30 30 20 30'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-repeat:no-repeat;background-size:10px 14px}cf-upload-file-progress{display:block;height:100%;overflow:hidden;position:relative;padding-right:30px}cf-upload-file-progress:after{content:"";width:100%;background:#f7f7f7;border-radius:7px}cf-upload-file-progress cf-upload-file-progress-bar,cf-upload-file-progress:after{display:block;height:10px;position:absolute;top:19px;z-index:1}cf-upload-file-progress cf-upload-file-progress-bar{width:0%;will-change:width,border-radius;background:currentColor;z-index:2;border-radius:7px 0 0 7px}.conversational-form--enable-animation cf-upload-file-progress cf-upload-file-progress-bar{transition:width .15s linear,border-radius 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-progress cf-upload-file-progress-bar.loaded{border-radius:7px 7px 7px 7px}
\ No newline at end of file
+@charset "UTF-8";.conversational-form{visibility:visible!important;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;line-height:1.416666667;position:absolute;top:0;left:0;right:0;bottom:0;z-index:999;margin:auto;background:#fff;overflow:hidden;opacity:0;will-change:opacity}.conversational-form *,.conversational-form :after,.conversational-form :before{box-sizing:border-box;outline:0}.conversational-form:before{content:"";width:100%;height:50px;pointer-events:none;background:linear-gradient(to bottom,#fff 0,rgba(255,255,255,0) 100%);position:absolute;top:0;left:0;z-index:2}.conversational-form button{border:none;background:0 0;margin:0;padding:0;outline:0;-webkit-tap-highlight-color:transparent!important}.conversational-form menu{padding:0;margin:0}.conversational-form li,.conversational-form ol,.conversational-form ul{margin:0;padding:0}.conversational-form a,.conversational-form a:active,.conversational-form a:visited{color:currentColor}.conversational-form a,.conversational-form button{cursor:pointer}.conversational-form .conversational-form-inner{padding:0 20px;position:absolute;width:100%;min-height:100%;max-height:100%;bottom:0;height:auto;overflow:hidden;margin-bottom:auto;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-flow:column nowrap;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-align:baseline;align-items:baseline}.conversational-form--enable-animation .conversational-form{transition:opacity .1875s cubic-bezier(.215,.61,.355,1)}.conversational-form *{-webkit-tap-highlight-color:rgba(255,255,255,0);tap-highlight-color:rgba(255,255,255,0)}.conversational-form--show{opacity:1}cf-info{position:absolute;pointer-events:none;z-index:0;left:2px;top:0;height:auto;width:100%;text-overflow:ellipsis;padding-right:20px;overflow:hidden;display:block;-webkit-transform:translateY(-115%);transform:translateY(-115%);color:#acb2b6;opacity:0;will-change:opacity}cf-info.show{opacity:1}.conversational-form--enable-animation cf-info.show{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-info strong{font-weight:900}cf-input{display:block;position:relative;width:100%;height:auto;margin-bottom:20px;margin-top:0;-webkit-box-flex:0;flex:0 0 auto}cf-input.animate-in input,cf-input.animate-in textarea{transition-delay:0s,0s,0s,.4s,.4s;opacity:1;-webkit-transform:translateY(0) rotateX(0);transform:translateY(0) rotateX(0)}cf-input.animate-in cf-input-button.cf-input-button{transition-delay:0s,0s .75s;-webkit-transform:scale(1,1);transform:scale(1,1)}cf-input input,cf-input textarea{resize:none;overflow:hidden;padding:calc((45px - 2px - 12px)/ 2) calc(45px - 6px) calc((45px - 2px - 12px)/ 2) 15px}cf-input input,cf-input textarea{outline:0;-webkit-appearance:none;-webkit-touch-callout:auto!important;-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important;border-radius:0;border:none;-webkit-appearance:none;position:relative;z-index:2;display:block;font-family:"Helvetica Neue","Neue Helvetica W01",Helvetica,Arial,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;font-size:12px;width:100%;height:45px;min-height:45px;color:#acb2b6;will-change:box-shadow,background,color,transform,opacity;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.15);opacity:0;-webkit-transform:translateY(40px) rotateX(-40deg);transform:translateY(40px) rotateX(-40deg)}cf-input input:-webkit-autofill,cf-input textarea:-webkit-autofill{background-color:#fff}cf-input input:active,cf-input input:focus,cf-input textarea:active,cf-input textarea:focus{box-shadow:0 0 30px rgba(0,0,0,.2)}.conversational-form--enable-animation cf-input input,.conversational-form--enable-animation cf-input textarea{transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s;transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s;transition:box-shadow .75s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1),color .75s cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s}cf-input input:hover::-webkit-input-placeholder,cf-input textarea:hover::-webkit-input-placeholder{color:#768086}cf-input input:hover::-moz-input-placeholder,cf-input textarea:hover::-moz-input-placeholder{color:#768086}cf-input input:hover:-moz-input-placeholder,cf-input textarea:hover:-moz-input-placeholder{color:#768086}cf-input input:hover:-ms-input-placeholder,cf-input textarea:hover:-ms-input-placeholder{color:#768086}cf-input input::-webkit-input-placeholder,cf-input textarea::-webkit-input-placeholder{color:currentColor}cf-input input::-moz-input-placeholder,cf-input textarea::-moz-input-placeholder{color:currentColor}cf-input input:-moz-input-placeholder,cf-input textarea:-moz-input-placeholder{color:currentColor}cf-input input:-ms-input-placeholder,cf-input textarea:-ms-input-placeholder{color:currentColor}cf-input.hide-input input,cf-input.hide-input textarea{display:none}cf-input.hide-input cf-input-button{display:none}cf-input[disabled=disabled]{pointer-events:none}cf-input[disabled=disabled] input,cf-input[disabled=disabled] textarea{background:rgba(247,247,247,.5)}cf-input[disabled=disabled] .cf-input-button{background:rgba(247,247,247,.75)}cf-input cf-icon-audio-eq{display:block;border:0 solid grey;border-color:#e3f1ff;width:100%;height:100%;border-radius:50%;z-index:0;position:absolute;top:0;left:0}cf-input[error]{pointer-events:none}cf-input[error] input,cf-input[error] textarea{background:#ffebe9;color:#fe8d84}cf-input[error] .cf-input-button{background:#ffebe9}cf-input[error] .cf-input-button svg polygon{fill:#fe8d84}cf-input[message] input,cf-input[message] textarea{background:#e3f1ff;color:#409dff}cf-input[message] .cf-input-button{background:#e3f1ff}cf-input[message] .cf-input-button svg polygon{fill:#409dff}cf-input cf-input-button.cf-input-button.loading:after,cf-input[tag-type=file] cf-input-button.cf-input-button:after{content:"";display:block;width:100%;height:100%;border:1px solid #b9bcbe;border-radius:50%;border-left:0;border-top:0;-webkit-animation:cf-spin 1s linear infinite;animation:cf-spin 1s linear infinite;will-change:opacity}.conversational-form--enable-animation cf-input cf-input-button.cf-input-button.loading:after,.conversational-form--enable-animation cf-input[tag-type=file] cf-input-button.cf-input-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-attachment{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}cf-input[tag-type=file] cf-input-button.cf-input-button div.cf-icon-progress{-webkit-transform:rotateX(-90deg);transform:rotateX(-90deg);opacity:0}cf-input-button.cf-input-button{width:29px;height:29px;background:0 0;position:absolute;overflow:hidden;right:8px;bottom:8px;z-index:3;cursor:pointer;border-radius:50%;will-change:background,border;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:scale(0,0);transform:scale(0,0);-webkit-backface-visibility:hidden;backface-visibility:hidden;border:1px solid #fff}.conversational-form--enable-animation cf-input-button.cf-input-button{transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s;transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s;transition:background 375ms cubic-bezier(.215,.61,.355,1),border 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s,-webkit-transform 375ms cubic-bezier(.175,.885,.32,1.275) 0s}cf-input-button.cf-input-button .cf-input-icons.cf-microphone{-webkit-transform:scale(0,0);transform:scale(0,0);pointer-events:none}cf-input-button.cf-input-button.microphone-interface .cf-input-icons{-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:scale(1,1) rotateX(0) translateZ(0);transform:scale(1,1) rotateX(0) translateZ(0);transition:-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons:not(.cf-microphone){pointer-events:none;-webkit-transform:scale(.25,.25) rotateX(90deg) translateZ(0);transform:scale(.25,.25) rotateX(90deg) translateZ(0)}cf-input-button.cf-input-button.microphone-interface .cf-input-icons.cf-microphone{pointer-events:auto;-webkit-transform:scale(1,1) rotateX(0) translateZ(0);transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing){pointer-events:none}cf-input-button.cf-input-button.microphone-interface.loading:not(.typing) .cf-microphone div.cf-icon-audio{opacity:1}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons:not(.cf-microphone){pointer-events:auto;-webkit-transform:scale(1,1) rotateX(0) translateZ(0);transform:scale(1,1) rotateX(0) translateZ(0)}cf-input-button.cf-input-button.microphone-interface.typing .cf-input-icons.cf-microphone{-webkit-transform:scale(.25,.25) rotateX(90deg) translateZ(0);transform:scale(.25,.25) rotateX(90deg) translateZ(0);pointer-events:none}cf-input-button.cf-input-button .cf-input-icons{position:absolute;z-index:1;pointer-events:none;width:100%;height:100%}cf-input-button.cf-input-button .cf-input-icons>div{width:100%;height:100%;position:absolute;z-index:1;background-repeat:no-repeat;background-position:50% 50%;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;will-change:transform,opacity}.conversational-form--enable-animation cf-input-button.cf-input-button .cf-input-icons>div{transition:opacity 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),opacity 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}cf-input-button.cf-input-button div.cf-icon-attachment{-webkit-transform:rotateX(90deg);transform:rotateX(90deg);opacity:0;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:12px 16px}cf-input-button.cf-input-button div.cf-icon-progress{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='#0D83FF'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:30px 30px}cf-input-button.cf-input-button div.cf-icon-audio{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1;background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='#0D83FF' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e");background-size:26px 26px}cf-input-button.cf-input-button:active{opacity:.2}cf-input-button.cf-input-button:focus,cf-input-button.cf-input-button:hover{background:#e3f1ff;border:1px solid #fff}cf-input-button.cf-input-button:focus:after,cf-input-button.cf-input-button:hover:after{opacity:0}@media (min-width:768px){cf-input-button.cf-input-button:focus .cf-icon-progress,cf-input-button.cf-input-button:hover .cf-icon-progress{-webkit-animation:cf-arrow-up .75s cubic-bezier(.645,.045,.355,1);animation:cf-arrow-up .75s cubic-bezier(.645,.045,.355,1)}}cf-input[tag-type=group].hide-input cf-input-button{display:block;left:0;right:0;margin-left:auto;margin-right:auto}cf-input[tag-type=group].hide-input cf-input-control-elements{margin-bottom:45px}cf-input[error=""].hide-input cf-input-button .cf-icon-progress{-webkit-filter:saturate(0);filter:saturate(0);-webkit-animation:shake .6s cubic-bezier(.36,.07,.19,.97) both;animation:shake .6s cubic-bezier(.36,.07,.19,.97) both}@-webkit-keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(1px,0,0);transform:translate3d(1px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}40%,60%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}}@keyframes shake{10%,90%{-webkit-transform:translate3d(-1px,0,0);transform:translate3d(-1px,0,0)}20%,80%{-webkit-transform:translate3d(1px,0,0);transform:translate3d(1px,0,0)}30%,50%,70%{-webkit-transform:translate3d(-2px,0,0);transform:translate3d(-2px,0,0)}40%,60%{-webkit-transform:translate3d(2px,0,0);transform:translate3d(2px,0,0)}}@-webkit-keyframes cf-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes cf-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes cf-arrow-up{0%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-40px);transform:translateY(-40px)}40.001%{-webkit-transform:translateY(40px);transform:translateY(40px)}80%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}90%{-webkit-transform:translateY(2px);transform:translateY(2px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes cf-arrow-up{0%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-40px);transform:translateY(-40px)}40.001%{-webkit-transform:translateY(40px);transform:translateY(40px)}80%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}90%{-webkit-transform:translateY(2px);transform:translateY(2px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}cf-input-control-elements.animate-in cf-list-button{opacity:1}cf-input-control-elements.hide-nav-buttons cf-list-button{pointer-events:none}cf-input-control-elements.hide-nav-buttons cf-list-button:after{opacity:0}cf-list-button{display:block;position:absolute;z-index:2;height:calc(100% - 16px);width:38px;cursor:pointer;opacity:0;pointer-events:none;will-change:opacity}.conversational-form--enable-animation cf-list-button{transition:opacity .75s cubic-bezier(.215,.61,.355,1) .5s}@media (min-width:768px){cf-list-button:hover:nth-child(1){background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(1):after{-webkit-animation:cf-arrow-left .75s cubic-bezier(.645,.045,.355,1);animation:cf-arrow-left .75s cubic-bezier(.645,.045,.355,1)}cf-list-button:hover:nth-child(2){background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 75%)}cf-list-button:hover:nth-child(2):after{-webkit-animation:cf-arrow-right .75s cubic-bezier(.645,.045,.355,1);animation:cf-arrow-right .75s cubic-bezier(.645,.045,.355,1)}}cf-list-button.cf-gradient:before{opacity:1}cf-list-button.active{pointer-events:auto}cf-list-button.active:after{opacity:1}cf-list-button:active:after{visibility:hidden}cf-list-button:nth-child(1){left:0}cf-list-button:nth-child(1):before{background:linear-gradient(to left,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(1):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)' %3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon transform='translate(29.000000, 54.000000) rotate(-180.000000) translate(-29.000000, -54.000000) ' points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:nth-child(2){right:0}cf-list-button:nth-child(2):before{background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%)}cf-list-button:nth-child(2):after{background-image:url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='UTF-8' standalone='no'?%3e%3csvg viewBox='0 0 6 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='#0D83FF' fill-rule='evenodd'%3e%3cg transform='translate(-1230.000000, -567.000000)'%3e%3cg transform='translate(738.000000, 178.000000)'%3e%3cg transform='translate(0.000000, 340.000000)'%3e%3cg transform='translate(466.000000, 0.000000)'%3e%3cpolygon points='26 50.1538462 27.125 49 32 54 27.125 59 26 57.8461538 29.75 54'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e")}cf-list-button:before{content:"";display:block;width:100%;height:100%;opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:before{transition:opacity .75s cubic-bezier(.215,.61,.355,1)}cf-list-button:after{content:"";display:block;width:6px;height:10px;position:absolute;background-size:6px 10px;background-repeat:no-repeat;top:calc(50% - 5px);left:calc(50% - 3px);opacity:0;will-change:opacity}.conversational-form--enable-animation cf-list-button:after{transition:opacity 375ms cubic-bezier(.215,.61,.355,1)}@-webkit-keyframes cf-arrow-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}40.001%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}80%{-webkit-transform:translateX(4px);transform:translateX(4px);opacity:1}90%{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes cf-arrow-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}40.001%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}80%{-webkit-transform:translateX(4px);transform:translateX(4px);opacity:1}90%{-webkit-transform:translateX(-2px);transform:translateX(-2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@-webkit-keyframes cf-arrow-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}40.001%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}80%{-webkit-transform:translateX(-4px);transform:translateX(-4px);opacity:1}90%{-webkit-transform:translateX(2px);transform:translateX(2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes cf-arrow-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}40%{-webkit-transform:translateX(-20px);transform:translateX(-20px);opacity:0}40.001%{-webkit-transform:translateX(20px);transform:translateX(20px);opacity:0}80%{-webkit-transform:translateX(-4px);transform:translateX(-4px);opacity:1}90%{-webkit-transform:translateX(2px);transform:translateX(2px);opacity:1}100%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}cf-chat{display:block;width:100%;height:auto;min-height:100%;overflow:visible;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-flow:column nowrap;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-align:baseline;align-items:baseline;margin-bottom:20px}cf-chat scrollable{display:block;width:100%;height:auto;max-height:100%;min-height:40px;overflow-y:auto;padding-bottom:20px;padding-top:40px}cf-chat scrollable::-webkit-scrollbar{width:4px;height:4px;-webkit-appearance:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-track{background:#fff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical{background:#e3f1ff;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb{background:#fff;border:none;-webkit-border-radius:100px}cf-chat scrollable::-webkit-scrollbar-thumb:vertical:active{background:#7dbcff;border:none;-webkit-border-radius:100px}.conversational-form.done cf-chat-response{pointer-events:none}cf-chat-response{display:table;max-width:80%;min-width:120px;width:auto;position:relative;-webkit-backface-visibility:hidden;backface-visibility:hidden;padding-left:calc(24px + 10px);padding-top:16px;color:#acb2b6;margin-left:0;margin-right:auto;word-break:break-all}@media (min-width:768px){cf-chat-response{max-width:50%}}cf-chat-response.can-edit{cursor:pointer}cf-chat-response.can-edit:hover{color:#6a7379}cf-chat-response.can-edit:hover text>p{background:#fff}cf-chat-response.robot text>p{opacity:0;will-change:opacity;transition:opacity 375ms cubic-bezier(.215,.61,.355,1) .2s}cf-chat-response.robot text>p.show{opacity:1}cf-chat-response.user{margin-right:0;margin-left:auto;padding-left:0;padding-right:calc(24px + 10px);color:#409dff}cf-chat-response.user thumb{left:auto;right:0}cf-chat-response.user text{-webkit-transform-origin:100% 0;transform-origin:100% 0;-webkit-transform:translateY(-10px) translateX(-10px) scale(.001,.001);transform:translateY(-10px) translateX(-10px) scale(.001,.001)}cf-chat-response.user text>p{background:#e3f1ff;border-radius:20px 0 20px 20px;margin-right:0;margin-left:auto}cf-chat-response.user.peak-thumb thumb{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.user.peak-thumb thumb{transition-delay:.2s,.2s,.2s}cf-chat-response.disabled{pointer-events:none;color:#f0f1f2}cf-chat-response.disabled text{background:#fff}cf-chat-response[thinking] text thinking{display:block}cf-chat-response text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:block;overflow:hidden;position:relative;min-height:40px;opacity:0;white-space:pre-wrap;word-break:normal;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateY(-10px) translateX(10px) scale(.001,.001);transform:translateY(-10px) translateX(10px) scale(.001,.001);will-change:transform,opacity,background;-webkit-backface-visibility:hidden;backface-visibility:hidden;height:auto}cf-chat-response text>div{display:inline-block}cf-chat-response text thinking span:nth-child(1){-webkit-animation-delay:.66667 s;animation-delay:.66667 s}cf-chat-response text thinking span:nth-child(2){-webkit-animation-delay:1.33333 s;animation-delay:1.33333 s}cf-chat-response text thinking span:nth-child(3){-webkit-animation-delay:2 s;animation-delay:2 s}cf-chat-response text strong{font-weight:900}cf-chat-response text>p{margin:0;padding:0;background:#f7f7f7;padding:12px 24px 12px 24px;display:table;border-radius:0 20px 20px 20px;transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-chat-response text>p:not(:only-child){border-radius:0 20px 20px 0}cf-chat-response text>p:not(:only-child):first-child{border-radius:20px 20px 20px 0}cf-chat-response text>p:not(:only-child):last-child{border-radius:0 20px 20px 20px}cf-chat-response text>p:not(:only-child):not(:first-child){margin-top:3px}cf-chat-response text>p>img{max-width:140px;padding-bottom:5px;width:100%;height:auto;display:block;margin-bottom:4px}cf-chat-response text:after{content:"";display:block;position:absolute;top:50%;left:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%);padding-right:20px}cf-chat-response text thinking{position:relative;display:table;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:none;-webkit-transform-origin:0 50%;transform-origin:0 50%;-webkit-transform:scale(1.5);transform:scale(1.5)}cf-chat-response text thinking span:nth-child(1){-webkit-animation:dot-fade 1s linear .33333 s infinite;animation:dot-fade 1s linear .33333 s infinite}cf-chat-response text thinking span:nth-child(2){-webkit-animation:dot-fade 1s linear .66667 s infinite;animation:dot-fade 1s linear .66667 s infinite}cf-chat-response text thinking span:nth-child(3){-webkit-animation:dot-fade 1s linear 1 s infinite;animation:dot-fade 1s linear 1 s infinite}cf-chat-response text svg.cf-icon-file{width:10px;height:auto;display:inline-block;margin-right:7px}cf-chat-response text svg.cf-icon-file g{fill:#0d83ff}cf-chat-response thumb{position:absolute;top:0;left:0;display:block;width:24px;height:24px;border-radius:50%;background:0 0;background-size:cover;background-position:50% 50%;opacity:0;overflow:hidden;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-transform:scale(.001,.001) translateY(50px);transform:scale(.001,.001) translateY(50px);will-change:transform,opacity}.conversational-form--enable-animation cf-chat-response thumb{transition:opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) .1875s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) .1875s,opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) .1875s,opacity 375ms cubic-bezier(.215,.61,.355,1) .1875s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) .1875s}cf-chat-response thumb>span{display:block;line-height:24px;text-align:center;font-weight:700;font-size:9.6px}cf-chat-response thumb>span[length="1"]{font-size:19.2px}cf-chat-response thumb>span[length="3"]{font-size:7.92px}cf-chat-response.show text{-webkit-transform:translateY(0) translateX(0) scale(1,1);transform:translateY(0) translateX(0) scale(1,1);opacity:1}.conversational-form--enable-animation cf-chat-response.show text{transition:opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) 0s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s;transition:transform 375ms cubic-bezier(.215,.61,.355,1) 0s,opacity 375ms cubic-bezier(.215,.61,.355,1) 0s,-webkit-transform 375ms cubic-bezier(.215,.61,.355,1) 0s}.conversational-form--enable-animation cf-chat-response.show text{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1);transition-delay:.1875s,.1875s,0s}cf-chat-response.show text[value-added]{will-change:auto}cf-chat-response.show.robot thumb{-webkit-transform:scale(1,1) translateY(0);transform:scale(1,1) translateY(0);opacity:1}.conversational-form--enable-animation cf-chat-response.show.robot thumb{transition-delay:.2s,.2s,.2s}@-webkit-keyframes dot-fade{0%{opacity:1}15.1111%{opacity:0}33.333%{opacity:1}100%{opacity:1}}@keyframes dot-fade{0%{opacity:1}15.1111%{opacity:0}33.333%{opacity:1}100%{opacity:1}}@-webkit-keyframes bounce{0%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}50%{-webkit-transform:scale(1.05,1.05);transform:scale(1.05,1.05);opacity:.85}100%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}}@keyframes bounce{0%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}50%{-webkit-transform:scale(1.05,1.05);transform:scale(1.05,1.05);opacity:.85}100%{-webkit-transform:scale(1,1);transform:scale(1,1);opacity:1}}cf-input-control-elements{width:auto;height:auto;overflow:hidden;display:block;position:relative;z-index:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;height:auto}cf-input-control-elements .cf-button{margin-bottom:10px;display:inline-block}cf-input-control-elements .cf-button.hide{display:none}cf-input-control-elements.resized{visibility:visible;height:auto}cf-input-control-elements.one-row cf-list{height:auto}cf-input-control-elements.one-row cf-list-button{opacity:0}cf-input-control-elements.two-row cf-list{white-space:normal;height:auto}cf-list,cf-list-button{will-change:height}.conversational-form--enable-animation cf-list,.conversational-form--enable-animation cf-list-button{transition:height 375ms cubic-bezier(.215,.61,.355,1)}cf-input[tag-type=file] cf-list{cursor:default}cf-list{display:block;height:auto;cursor:move;white-space:nowrap}cf-list.disabled{pointer-events:none}.cf-button{background:#fff;cursor:pointer;border:1px solid rgba(13,131,255,.1);border-radius:calc(20px * 1.2);color:#409dff;line-height:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transform-origin:0 100%;transform-origin:0 100%;will-change:opacity,background;opacity:0}.cf-button>div{padding:12px 24px}.cf-button.has-image{max-width:180px}.cf-button>div{position:relative}.conversational-form--enable-animation .cf-button{transition:opacity 0s cubic-bezier(.215,.61,.355,1),background .75s cubic-bezier(.215,.61,.355,1)}.cf-button.animate-in{opacity:1}.conversational-form--enable-animation .cf-button.animate-in{transition-duration:375ms,.75s;transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}.conversational-form--enable-animation .cf-button.animate-in:nth-child(even){transition-delay:50ms,0s}.conversational-form--enable-animation .cf-button.animate-in:nth-child(odd){transition-delay:.15s,0s}.cf-button.animate-in.animate-out{-webkit-transform-origin:75% 100%;transform-origin:75% 100%;opacity:0}.cf-button:not(:last-child){margin-right:10px}.cf-button:focus:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:focus:not([checked=checked]),.cf-button:hover:not(.cf-button:hover[selected=selected],.cf-button:focus[selected=selected],.cf-button:hover[selected=selected],.cf-button:focus[selected=selected]),.cf-button:hover:not([checked=checked]){background:rgba(13,131,255,.1)}.cf-button[checked=checked]:not(:focus):not(:hover):not(.highlight),.cf-button[selected=selected]:not(:focus):not(:hover):not(.highlight){background:rgba(13,131,255,.1)}.cf-button[disabled=disabled]{pointer-events:none}.cf-button[disabled=disabled].animate-in{opacity:.5}.cf-button:active>div{opacity:.2}.cf-button .cf-image{width:100%;height:auto;will-change:opacity;transition:opacity .75s cubic-bezier(.215,.61,.355,1);opacity:0}.cf-button .cf-image.loaded{opacity:1}.cf-button.cf-checkbox-button.highlight cf-checkbox,.cf-button.cf-checkbox-button:focus cf-checkbox,.cf-button.cf-checkbox-button:hover cf-checkbox{background:#409dff}.cf-button.cf-checkbox-button.no-text{padding:12px 16px}.cf-button.cf-checkbox-button.no-text cf-checkbox{margin-right:0;margin-left:0}.cf-button.cf-checkbox-button.has-image cf-checkbox{margin-left:0}.cf-button.cf-checkbox-button cf-checkbox{display:block;float:left;width:14px;height:14px;border-radius:3px;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox{transition:background 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button cf-checkbox:after{content:"";position:absolute;top:2px;left:1px;display:block;width:13px;height:10px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg width='13px' height='10px' viewBox='0 0 13 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-290.000000, -505.000000)' fill='#0D83FF'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 216.000000)'%3e%3cg transform='translate(189.000000, 139.000000)'%3e%3cpolygon points='17.5 18.5 16 20 20 24 29 15.5 27.5 14 20 21'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-size:13px 10px;background-repeat:no-repeat;-webkit-transform-origin:50% 50%;transform-origin:50% 50%;will-change:transform;-webkit-transform:scale(0,0);transform:scale(0,0)}.conversational-form--enable-animation .cf-button.cf-checkbox-button cf-checkbox:after{transition:-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1);transition:transform 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox{background:rgba(227,241,255,0)}.cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{-webkit-transform:scale(1,1);transform:scale(1,1)}.conversational-form--enable-animation .cf-button.cf-checkbox-button[checked=checked] cf-checkbox:after,.conversational-form--enable-animation .cf-button.cf-checkbox-button[selected=selected] cf-checkbox:after{transition-timing-function:cubic-bezier(.215,.61,.355,1)}cf-options-list{display:block;width:auto}cf-radio-button.cf-button.highlight cf-radio,cf-radio-button.cf-button:focus cf-radio,cf-radio-button.cf-button:hover cf-radio{background:#409dff}cf-radio-button.cf-button.has-image cf-checkbox{margin-left:0}cf-radio-button.cf-button cf-radio{display:block;float:left;width:14px;height:14px;border-radius:50%;background:#e3f1ff;will-change:background;margin-right:10px;margin-left:-10px;margin-top:-1px;position:relative}.conversational-form--enable-animation cf-radio-button.cf-button cf-radio{transition:background 375ms cubic-bezier(.215,.61,.355,1)}cf-radio-button.cf-button[checked=checked] cf-radio{background:#409dff;pointer-events:none}cf-upload-file-ui{display:block;width:100%;height:45px;position:absolute;top:0;padding-right:30px;color:#409dff;opacity:0;-webkit-transform:translateY(20px) rotateX(30deg);transform:translateY(20px) rotateX(30deg);will-change:opacity,transform}.conversational-form--enable-animation cf-upload-file-ui{transition:opacity 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1);transition:opacity 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.215,.61,.355,1);transition:opacity 375ms cubic-bezier(.215,.61,.355,1),transform 375ms cubic-bezier(.215,.61,.355,1),-webkit-transform 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-ui.animate-in{opacity:1;-webkit-transform:translateY(0) rotateX(0);transform:translateY(0) rotateX(0)}.conversational-form--enable-animation cf-upload-file-ui.animate-in{transition-timing-function:cubic-bezier(.215,.61,.355,1),cubic-bezier(.215,.61,.355,1)}cf-upload-file-text{display:block;float:left;width:auto;height:100%;padding-left:40px;padding-right:30px;padding-top:17px;position:relative;color:currentColor;max-width:50%;text-overflow:ellipsis;overflow:hidden}cf-upload-file-text:before{content:"";display:inline-block;position:absolute;top:17px;left:23px;width:10px;height:14px;background-image:url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 10 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-756.000000, -549.000000)' fill='#0D83FF'%3e%3cg transform='translate(736.000000, 127.000000)'%3e%3cg transform='translate(0.000000, 406.000000)'%3e%3cpolygon points='20 16 26.0030799 16 30 19.99994 30 30 20 30'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");background-repeat:no-repeat;background-size:10px 14px}cf-upload-file-progress{display:block;height:100%;overflow:hidden;position:relative;padding-right:30px}cf-upload-file-progress:after{content:"";width:100%;background:#f7f7f7;border-radius:7px}cf-upload-file-progress cf-upload-file-progress-bar,cf-upload-file-progress:after{display:block;height:10px;position:absolute;top:19px;z-index:1}cf-upload-file-progress cf-upload-file-progress-bar{width:0%;will-change:width,border-radius;background:currentColor;z-index:2;border-radius:7px 0 0 7px}.conversational-form--enable-animation cf-upload-file-progress cf-upload-file-progress-bar{transition:width .15s linear,border-radius 375ms cubic-bezier(.215,.61,.355,1)}cf-upload-file-progress cf-upload-file-progress-bar.loaded{border-radius:7px 7px 7px 7px}
\ No newline at end of file
diff --git a/dist/conversational-form.min.js b/dist/conversational-form.min.js
index c14a1da30..9970b6908 100644
--- a/dist/conversational-form.min.js
+++ b/dist/conversational-form.min.js
@@ -1,4 +1,4 @@
!function(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(t,this)}function o(t,e){for(;3===t._state;)t=t._value;if(0===t._state)return void t._deferreds.push(e);t._handled=!0,i._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?s:r)(e.promise,t._value);var i;try{i=n(t._value)}catch(t){return void r(e.promise,t)}s(e.promise,i)})}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if(e instanceof i)return t._state=3,t._value=e,void a(t);if("function"==typeof o)return void c(n(o,e),t)}t._state=1,t._value=e,a(t)}catch(e){r(t,e)}}function r(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e0||!!navigator.userAgent.match(/Trident.*rv\:11\./)},t.getValuesOfBars=function(t){var e=t.split("||");return e.length<=1&&(e=t.split("|")),e},t.setTransform=function(t,e){t.style["-webkit-transform"]=e,t.style["-moz-transform"]=e,t.style["-ms-transform"]=e,t.style.transform=e},t.extendObject=function(t,e){for(var n in e)e[n]&&e[n].constructor&&e[n].constructor===Object?(t[n]=t[n]||{},arguments.callee(t[n],e[n])):t[n]=e[n];return t},t.caniuse={fileReader:function(){return!!(window.File&&window.FileReader&&window.FileList&&window.Blob)}},t}();t.Helpers=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(t){void 0===t&&(t=null),this._cf=t,this.target=document.createDocumentFragment()}return Object.defineProperty(t.prototype,"cf",{get:function(){return this._cf},set:function(t){this._cf=t},enumerable:!0,configurable:!0}),t.prototype.addEventListener=function(t,e,n){return this.target.addEventListener(t,e,n)},t.prototype.dispatchEvent=function(t){return this.target.dispatchEvent(t)},t.prototype.removeEventListener=function(t,e,n){this.target.removeEventListener(t,e,n)},t}();t.EventDispatcher=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(){}return t.parseTag=function(t){var e=document.createElement(t.tag);e.setAttribute("cf-formless","");for(var n in t)"tag"!==n&&"children"!==n&&e.setAttribute(n,t[n]);return e},t.parseGroupTag=function(e){for(var n=t.parseTag(e),i=e.children,o=0;o0)for(var r=0;r ':"")+t.Helpers.getInnerTextOfElement(this.el)}else e=t.Helpers.getInnerTextOfElement(this.el);return e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"positionVector",{get:function(){return this._positionVector},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{set:function(t){this.el.tabIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"highlight",{get:function(){return this.el.classList.contains("highlight")},set:function(t){t?this.el.classList.add("highlight"):this.el.classList.remove("highlight")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"focus",{get:function(){return this._focus},set:function(t){this._focus=t,this._focus?this.el.focus():this.el.blur()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return!this.el.classList.contains("hide")},set:function(t){t?this.el.classList.remove("hide"):(this.el.classList.add("hide"),this.tabIndex=-1,this.highlight=!1)},enumerable:!0,configurable:!0}),n.prototype.onBlur=function(t){this._focus=!1},n.prototype.onFocus=function(e){this._focus=!0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.ON_FOCUS,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.ON_FOCUS,{detail:this.positionVector}))},n.prototype.hasImage=function(){return!1},n.prototype.calcPosition=function(){var t=parseInt(window.getComputedStyle(this.el).getPropertyValue("margin-right"),10);this._positionVector={height:this.el.offsetHeight,width:this.el.offsetWidth+t,x:this.el.offsetLeft,y:this.el.offsetTop,el:this},this._positionVector.centerX=this._positionVector.x+.5*this._positionVector.width,this._positionVector.centerY=this._positionVector.y+.5*this._positionVector.height},n.prototype.setData=function(t){this.referenceTag=t.referenceTag,e.prototype.setData.call(this,t)},n.prototype.animateIn=function(){clearTimeout(this.animateInTimer),this.el.classList.add("animate-in")},n.prototype.animateOut=function(){this.el.classList.add("animate-out")},n.prototype.onChoose=function(){t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.SUBMIT_VALUE,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.SUBMIT_VALUE,{detail:this}))},n.prototype.dealloc=function(){this.el.removeEventListener("blur",this.onBlurCallback,!1),this.onBlurCallback=null,this.el.removeEventListener("focus",this.onFocusCallback,!1),this.onFocusCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ControlElement=e}(cf||(cf={}));var cf;!function(t){t.ControlElementsEvents={ON_RESIZE:"cf-on-control-elements-resize",CHANGED:"cf-on-control-elements-changed"};var e=function(){function e(e){this.animateInFromReponseTimer=0,this.ignoreKeyboardInput=!1,this.rowIndex=-1,this.columnIndex=0,this.elementWidth=0,this.filterListNumberOfVisible=0,this.listWidth=0,this.el=e.el,this.eventTarget=e.eventTarget,this.cfReference=e.cfReference,this.list=this.el.getElementsByTagName("cf-list")[0],this.infoElement=e.infoEl,this.onScrollCallback=this.onScroll.bind(this),this.el.addEventListener("scroll",this.onScrollCallback,!1),this.onResizeCallback=this.onResize.bind(this),window.addEventListener("resize",this.onResizeCallback,!1),this.onElementFocusCallback=this.onElementFocus.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_FOCUS,this.onElementFocusCallback,!1),this.onElementLoadedCallback=this.onElementLoaded.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_LOADED,this.onElementLoadedCallback,!1),this.onChatReponsesUpdatedCallback=this.onChatReponsesUpdated.bind(this),this.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onUserInputKeyChangeCallback=this.onUserInputKeyChange.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,this.onUserInputKeyChangeCallback,!1),this.userInputUpdateCallback=this.onUserInputUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.listScrollController=new t.ScrollController({interactionListener:this.el,listToScroll:this.list,eventTarget:this.eventTarget,listNavButtons:this.el.getElementsByTagName("cf-list-button")})}return Object.defineProperty(e.prototype,"active",{get:function(){return this.elements&&this.elements.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focus",{get:function(){if(!this.elements)return!1;for(var t=this.getElements(),e=0;ethis.tableableRows[this.rowIndex].length-1&&(this.columnIndex=0),!0):(this.resetTabList(),!1)},e.prototype.updateRowIndex=function(t){var e=this.rowIndex;if(this.rowIndex+=t,this.tableableRows[this.rowIndex])for(var n=this.tableableRows[e]?this.tableableRows[e][this.columnIndex].positionVector.centerX:0,i=this.tableableRows[this.rowIndex],o=1e13,s=0;sMath.abs(n-r.positionVector.centerX)&&(o=Math.abs(n-r.positionVector.centerX),this.columnIndex=s)}},e.prototype.resetTabList=function(){this.rowIndex=-1,this.columnIndex=-1},e.prototype.onUserInputUpdate=function(t){if(this.el.classList.remove("animate-in"),this.infoElement.classList.remove("show"),this.elements)for(var e=this.getElements(),n=0;n1){for(var o=[],s=0;s0&&(o[0].highlight=!0)}},e.prototype.clickOnHighlighted=function(){for(var t=this.getElements(),e=0;e0){this.el.classList.contains("animate-in")||this.el.classList.add("animate-in");for(var e=0;e0&&"OptionsList"==this.elements[0].type?this.elements[0].elements:this.elements},e.prototype.buildTabableRows=function(){this.tableableRows=[],this.resetTabList();var t=this.getElements();if(this.el.classList.contains("two-row")){this.tableableRows[0]=[],this.tableableRows[1]=[];for(var e=0;e0)switch(this.elements[0].type){case"CheckboxButton":for(var n=0,i=[],o=0;o1)break}for(var o=0;o1&&(s.partOfSeveralChoices=!0),i.push(s.value)),e.controlElements.push(s)}e.text=t.Dictionary.parseAndGetMultiValueString(i);break;case"RadioButton":for(var o=0;o0;)this.elements.pop().dealloc();this.list.innerHTML="",this.onListChanged()},e.prototype.buildTags=function(e){var n=this;this.disabled=!1;this.el.parentNode.getElementsByTagName("ul")[0],this.el.parentNode.getElementsByTagName("ul")[1];this.clearTagsAndReset(),this.elements=[];for(var i=0;i0){var s=this.elements[this.elements.length-1];this.list.appendChild(s.el)}}var r=this.elements[0]&&"OptionsList"==this.elements[0].type;this.filterListNumberOfVisible=r?this.elements[0].elements.length:e.length,new Promise(function(t,e){return n.resize(t,e)}).then(function(){var e=n.list.offsetHeight,i={height:e};n.onListChanged(),t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.CONTROL_ELEMENTS_ADDED,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.CONTROL_ELEMENTS_ADDED,{detail:i}))})},e.prototype.onResize=function(t){this.resize()},e.prototype.resize=function(e,n){this.list.style.width="100%",this.el.classList.remove("resized"),this.el.classList.remove("one-row"),this.el.classList.remove("two-row"),this.elementWidth=0,this.listWidth=0;var i=this.getElements();if(i&&i.length>0){for(var o=[],s=[],r=!1,a=0;ac;u&&!r?(this.el.classList.add("two-row"),this.listWidth=Math.max(c,Math.round(o[Math.floor(o.length/2)]+50)),this.list.style.width=this.listWidth+"px"):this.el.classList.add("one-row");for(var a=0;ac;for(var h=i.slice(),p=h.sort(function(t,e){var n=t.positionVector.y>e.positionVector.y;return t.positionVector.x==e.positionVector.x?n?1:-1:t.positionVector.x0&&(this.xTarget+=(0-this.xTarget)*t.Helpers.lerp(e.accerlation,.3,.8)),this.xTargetthis.max&&(this.nextButton.classList.contains("active")||this.nextButton.classList.add("active"),this.nextButton.classList.contains("cf-gradient")||this.nextButton.classList.add("cf-gradient")),i<=this.max&&(this.nextButton.classList.contains("active")&&this.nextButton.classList.remove("active"),this.nextButton.classList.contains("cf-gradient")&&this.nextButton.classList.remove("cf-gradient"));var o=this.x;t.Helpers.setTransform(this.listToScroll,"translateX("+o+"px)"),(this.interacting||Math.abs(this.x-this.xTarget)>.02&&!this.interacting)&&(this.rAF=window.requestAnimationFrame(function(){return n.render()}))},e.prototype.setScroll=function(t,e){this.xTarget=this.visibleAreaWidth==this.listWidth?0:t,this.render()},e.prototype.pushDirection=function(t){this.inputAccerlationTarget+=5e3*t,this.render()},e.prototype.dealloc=function(){this.prevButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.nextButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.onListNavButtonsClickCallback=null,this.prevButton=null,this.nextButton=null,document.removeEventListener("mouseleave",this.documentLeaveCallback,!1),document.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.documentLeaveCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousedown"),this.onInteractStartCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.onInteractEndCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousemove"),this.onInteractMoveCallback,!1),this.documentLeaveCallback=null,this.onInteractStartCallback=null,this.onInteractEndCallback=null,this.onInteractMoveCallback=null},e.prototype.reset=function(){this.interacting=!1,this.startX=0,this.startXTarget=this.startX,this.inputAccerlation=0,this.x=0,this.xTarget=0,t.Helpers.setTransform(this.listToScroll,"translateX(0px)"),this.render(),this.prevButton.classList.remove("active"),this.nextButton.classList.remove("active")},e.prototype.resize=function(t,e){this.reset(),this.visibleAreaWidth=e,this.listWidth=Math.max(e,t),this.max=-1*(this.listWidth-this.visibleAreaWidth),this.render()},e.accerlation=.1,e}();t.ScrollController=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(t){this.data={"user-image":"https://cf-4053.kxcdn.com/conversational-form/human.png","entry-not-found":"Dictionary item not found.","awaiting-mic-permission":"Awaiting mic permission","user-audio-reponse-invalid":"I didn't get that, try again.","microphone-terminal-error":"Audio input not supported","input-placeholder":"Type your answer here ...","group-placeholder":"Type to filter list ...","input-placeholder-error":"Your input is not correct ...","input-placeholder-required":"Input is required ...","input-placeholder-file-error":"File upload failed ...","input-placeholder-file-size-error":"File size too big ...","input-no-filter":"No results found for {input-value} ","user-reponse-and":" and ","user-reponse-missing":"Missing input ...","user-reponse-missing-group":"Nothing selected ...",general:"General type1||General type2","icon-type-file":" "},this.robotData={"robot-image":"https://cf-4053.kxcdn.com/conversational-form/robot.png",input:"Please write some text.",text:"Please write some text.",checkbox:"Select as many as you want.",name:"What's your name?",
email:"Need your e-mail.",password:"Please provide password",tel:"What's your phone number?",radio:"I need you to select one of these.",select:"Choose any of these options.",file:"Select a file to upload.",general:"General1||General2||General3.."},e.instance=this,t&&t.data&&(this.data=this.validateAndSetNewData(t.data,this.data)),t.userImage&&(this.data["user-image"]=t.userImage),t.robotImage&&(this.robotData["robot-image"]=t.robotImage),t&&t.robotData&&(this.robotData=this.validateAndSetNewData(t.robotData,this.robotData))}return e.get=function(n){var i=e.instance,o=i.data[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else o=i.data["entry-not-found"];return o},e.set=function(t,n,i){var o=e.instance,s="robot"==n?o.robotData:o.data;return s[t]=i,s[t]},e.getRobotResponse=function(n){var i=e.instance,o=i.robotData[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else{var r=t.Helpers.getValuesOfBars(i.robotData.general);o=r[Math.floor(Math.random()*r.length)]}return o},e.parseAndGetMultiValueString=function(t){for(var n="",i=0;i1&&i==t.length-2?e.get("user-reponse-and"):", ";n+=o+(i Tag registered:",this.type,this)),this.refresh()}return Object.defineProperty(Tag.prototype,"type",{get:function(){return this.domElement.getAttribute("type")||this.domElement.tagName.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"name",{get:function(){return this.domElement.getAttribute("name")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"id",{get:function(){return this.domElement.getAttribute("id")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"inputPlaceholder",{get:function(){return this._inputPlaceholder},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"formless",{get:function(){return cf.TagsParser.isElementFormless(this.domElement)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"label",{get:function(){return this.getLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"value",{get:function(){return this.domElement.value||this.initialDefaultValue},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"hasImage",{get:function(){return this.domElement.hasAttribute("cf-image")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"disabled",{get:function(){return!this.checkConditionalAndIsValid()||void 0!=this.domElement.getAttribute("disabled")&&null!=this.domElement.getAttribute("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"required",{get:function(){return!!this.domElement.getAttribute("required")||""==this.domElement.getAttribute("required")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"question",{get:function(){return this.questions&&0!=this.questions.length?this.questions[Math.floor(Math.random()*this.questions.length)]:cf.Dictionary.getRobotResponse(this.type)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"eventTarget",{set:function(t){this._eventTarget=t},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"errorMessage",{get:function(){return this.errorMessages||(this.domElement.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.getAttribute("cf-error")):this.domElement.parentNode&&this.domElement.parentNode.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.parentNode.getAttribute("cf-error")):this.required?this.errorMessages=[cf.Dictionary.get("input-placeholder-required")]:"file"==this.type?this.errorMessages=[cf.Dictionary.get("input-placeholder-file-error")]:this.errorMessages=[cf.Dictionary.get("input-placeholder-error")]),this.errorMessages[Math.floor(Math.random()*this.errorMessages.length)]},enumerable:!0,configurable:!0}),Tag.prototype.dealloc=function(){this.domElement.removeEventListener("change",this.changeCallback,!1),this.changeCallback=null,this.domElement=null,this.defaultValue=null,this.errorMessages=null,this.pattern=null,this._label=null,this.validationCallback=null,this.questions=null},Tag.testConditions=function(t,e){var n=function(e,n){return"object"==typeof n?n.test(e):t===n};if("string"==typeof t){for(var i=t,o=!1,s=0;s0},Tag.prototype.checkConditionalAndIsValid=function(){return!this.hasConditions()||this.flowManager.areConditionsInFlowFullfilled(this,this.conditionalTags)},Tag.prototype.setTagValueAndIsValid=function(t){var e=!0,n=t.text;this.pattern&&(e=this.pattern.test(n)),""==n&&this.required&&(e=!1);var i=parseInt(this.domElement.getAttribute("minlength"),10)||-1,o=parseInt(this.domElement.getAttribute("maxlength"),10)||-1;return-1!=i&&n.lengtho&&(e=!1),e&&"file"!=this.type&&(this.domElement.value=n),e},Tag.prototype.getLabel=function(){return this._label||this.findAndSetLabel(),this._label?this._label:cf.Dictionary.getRobotResponse(this.type)},Tag.prototype.findConditionalAttributes=function(){var t=this.domElement.attributes;if(t.length>0){this.conditionalTags=[];for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n&&n.name&&-1!==n.name.indexOf("cf-conditional")){for(var i=[],o=-1!==n.value.indexOf("||")?n.value.split("||"):n.value.split("&&"),s=0;s0&&(e=[t])}else if(e.length>0)for(var i=0;i TagGroup registered:",this.elements[0].type,this)),this.skipUserInput=!1}return Object.defineProperty(e.prototype,"required",{get:function(){for(var t=0;t0)return this.questions[Math.floor(Math.random()*this.questions.length)];if(this.elements[0]&&this.elements[0].question){return this.elements[0].question}return t.Dictionary.getRobotResponse(this.getGroupTagType())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeElements",{get:function(){return this._activeElements},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._values?this._values:[""]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){for(var t=0,e=0;e\n\t\t\t\t'+this.referenceTag.label+"\n\t\t\t\n\t\t\t"},n}(t.ControlElement);t.Button=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"RadioButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.el.hasAttribute("checked")&&"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.checked=!0,t.prototype.onClick.call(this,e)},e.prototype.getTemplate=function(){return'\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t"+this.referenceTag.label+" \n\t\t\t\t
\n\t\t\t \n\t\t\t"},e}(t.Button);t.RadioButton=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"CheckboxButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(t){this.checked=!this.checked},e.prototype.getTemplate=function(){var t=this.referenceTag.domElement.checked&&this.referenceTag.domElement.hasAttribute("checked");return'";return t+="",this.isMultiChoice&&(t+=" "),t+=this.referenceTag.label,t+="
",t+=" "},n}(t.Button);t.OptionButton=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(e){this.context=e.context,this.eventTarget=e.eventTarget,this.referenceTag=e.referenceTag,this.multiChoice=this.referenceTag.domElement.hasAttribute("multiple"),this.onOptionButtonClickCallback=this.onOptionButtonClick.bind(this),this.eventTarget.addEventListener(t.OptionButtonEvents.CLICK,this.onOptionButtonClickCallback,!1),this.createElements()}return Object.defineProperty(e.prototype,"type",{get:function(){return"OptionsList"},enumerable:!0,configurable:!0}),e.prototype.getValue=function(){for(var t=[],e=0;e0;)this.elements.pop().dealloc();this.elements=null},e}();t.OptionsList=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;if(i.maxFileSize=1e11,i.loading=!1,i.submitTimer=0,i._fileName="",i._readerResult="",!t.Helpers.caniuse.fileReader())throw new Error("Conversational Form Error: No FileReader available for client.");var o=i.referenceTag.domElement.getAttribute("cf-max-size")||i.referenceTag.domElement.getAttribute("max-size");if(o){var s=parseInt(o,10);i.maxFileSize=s}return i.progressBar=i.el.getElementsByTagName("cf-upload-file-progress-bar")[0],i.onDomElementChangeCallback=i.onDomElementChange.bind(i),i.referenceTag.domElement.addEventListener("change",i.onDomElementChangeCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.referenceTag.domElement.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"readerResult",{get:function(){return this._readerResult},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"files",{get:function(){return this._files},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fileName",{get:function(){return this._fileName},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return"UploadFileUI"},enumerable:!0,configurable:!0}),n.prototype.getFilesAsString=function(){var e=document.createElement("span");return e.innerHTML=t.Dictionary.get("icon-type-file")+this.fileName,e.outerHTML},n.prototype.onDomElementChange=function(e){var n=this;t.ConversationalForm.suppressLog||console.log("...onDomElementChange");var i=new FileReader;this._files=this.referenceTag.domElement.files,i.onerror=function(e){t.ConversationalForm.suppressLog||console.log("onerror",e)},i.onprogress=function(e){t.ConversationalForm.suppressLog||console.log("onprogress",e),n.progressBar.style.width=e.loaded/e.total*100+"%"},i.onabort=function(e){t.ConversationalForm.suppressLog||console.log("onabort",e)},i.onloadstart=function(e){var o=n.files[0],s=o?o.size:n.maxFileSize+1;if(s>n.maxFileSize){i.abort();var r={errorText:t.Dictionary.get("input-placeholder-file-size-error")};t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,r),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:r}))}else{n._fileName=o.name,n.loading=!0,n.animateIn();var a=Math.floor(Math.log(s)/Math.log(1024)),l=["b","kb","mb","gb"];a=Math.min(l.length-1,a);var c=1*Number((s/Math.pow(1024,a)).toFixed(2))+" "+l[a],u=o.name+" ("+c+")";n.el.getElementsByTagName("cf-upload-file-text")[0].innerHTML=u,n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.BUSY}))}},i.onload=function(e){n._readerResult=e.target.result,n.progressBar.classList.add("loaded"),n.submitTimer=setTimeout(function(){n.el.classList.remove("animate-in"),n.onChoose(),
-n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.READY}))},0)},i.readAsDataURL(this.files[0])},n.prototype.animateIn=function(){this.loading&&e.prototype.animateIn.call(this)},n.prototype.onClick=function(t){},n.prototype.triggerFileSelect=function(){this.referenceTag.domElement.click()},n.prototype.dealloc=function(){clearTimeout(this.submitTimer),this.progressBar=null,this.onDomElementChangeCallback&&(this.referenceTag.domElement.removeEventListener("change",this.onDomElementChangeCallback,!1),this.onDomElementChangeCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){"1"==this.referenceTag.value||this.referenceTag.domElement.hasAttribute("checked");return"\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t\t"},n}(t.Button);t.UploadFileUI=e}(cf||(cf={}));var cf;!function(t){t.MicrophoneBridgeEvent={ERROR:"cf-microphone-bridge-error",TERMNIAL_ERROR:"cf-microphone-bridge-terminal-error"};var e=function(){function e(e){this.currentTextResponse="",this._hasUserMedia=!1,this.inputErrorCount=0,this.inputCurrentError="",this.el=e.el,this.button=e.button,this.eventTarget=e.eventTarget,this.microphoneObj=e.microphoneObj,this.flowUpdateCallback=this.onFlowUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1)}return Object.defineProperty(e.prototype,"hasUserMedia",{set:function(t){this._hasUserMedia=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{set:function(t){this.equalizer&&(this.equalizer.disabled=!t)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this.button.loading=!1,this.microphoneObj.cancelInput&&this.microphoneObj.cancelInput()},e.prototype.onFlowUpdate=function(){var t=this;if(this.currentTextResponse=null,this._hasUserMedia)this.microphoneObj.awaitingCallback||this.callInput();else{var e=!1;window.navigator.mediaDevices&&window.navigator.mediaDevices.enumerateDevices().then(function(n){n.forEach(function(t){e||""===t.label||(e=!0)}),e&&t.getUserMedia()})}},e.prototype.getUserMedia=function(){var e=this;try{void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(t){var e=navigator.getUserMedia||window.navigator.webkitGetUserMedia||window.navigator.mozGetUserMedia;return e?new Promise(function(n,i){e.call(navigator,t,n,i)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({audio:!0}).then(function(t){e.currentStream=t,t.getAudioTracks().length>0?(e.hasUserMedia=!0,e.setupEqualizer(),e.microphoneObj.awaitingCallback||e.callInput()):e.hasUserMedia=!1}).catch(function(n){e.hasUserMedia=!1,e.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))})}catch(e){this.hasUserMedia=!1,this.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))}},e.prototype.dealloc=function(){this.cancel(),this.promise=null,this.currentStream=null,this.equalizer&&this.equalizer.dealloc(),this.equalizer=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null},e.prototype.callInput=function(e){var n=this;void 0===e&&(e=0),this.button.loading=!0,this.equalizer&&(this.equalizer.disabled=!1),this.promise=new Promise(function(t,e){return n.microphoneObj.input(t,e,n.currentStream)}).then(function(e){if(n.promise=null,n.currentTextResponse=e.toString(),!n.currentTextResponse||""==n.currentTextResponse)return n.showError(t.Dictionary.get("user-audio-reponse-invalid")),void n.callInput();n.inputErrorCount=0,n.inputCurrentError="",n.button.loading=!1;var i={text:n.currentTextResponse};t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.SUBMIT,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:i}))}).catch(function(e){n.isErrorTerminal(e)?(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)):(n.inputCurrentError!=e&&(n.inputErrorCount=0,n.inputCurrentError=e),n.inputErrorCount++,n.inputErrorCount>2?n.showError(e):(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)))})},e.prototype.isErrorTerminal=function(t){return-1!==["network"].indexOf(t)},e.prototype.showError=function(e){var n={errorText:e};t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.USER_INPUT_INVALID,n),this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:n})),this.callInput()},e.prototype.setupEqualizer=function(){var t=this.el.getElementsByTagName("cf-icon-audio-eq")[0];n.supported&&t&&(this.equalizer=new n({stream:this.currentStream,elementToScale:t}))},e}();t.MicrophoneBridge=e;var n=function(){function t(t){var e=this;this.maxBorderWidth=0,this._disabled=!1,this.elementToScale=t.elementToScale,this.context=new AudioContext,this.analyser=this.context.createAnalyser(),this.mic=this.context.createMediaStreamSource(t.stream),this.javascriptNode=this.context.createScriptProcessor(2048,1,1),this.analyser.smoothingTimeConstant=.3,this.analyser.fftSize=1024,this.mic.connect(this.analyser),this.analyser.connect(this.javascriptNode),this.javascriptNode.connect(this.context.destination),this.javascriptNode.onaudioprocess=function(){e.onAudioProcess()}}return Object.defineProperty(t.prototype,"disabled",{set:function(t){this._disabled=t,this.elementToScale.style.borderWidth="0px"},enumerable:!0,configurable:!0}),t.prototype.onAudioProcess=function(){if(!this._disabled){var t=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(t);for(var e=0,n=t.length,i=0;i\n\t\t\t\t
\n\t\t\t\t \n\t\t\t';var i=n.firstChild||n.content.firstChild;this.mic=new t.MicrophoneBridge({el:i,button:this,eventTarget:this.eventTarget,microphoneObj:e}),this.el.appendChild(i)},e.prototype.reset=function(){this.mic&&!this.typing&&this.mic.callInput()},e.prototype.getTemplate=function(){return'\n\t\t\t\t\t\t\n\t\t\t\t\t '},e.prototype.onMicrophoneTerminalError=function(e){this.mic&&(this.mic.dealloc(),this.mic=null,this.el.removeChild(this.el.getElementsByClassName("cf-microphone")[0]),this.el.classList.remove("microphone-interface"),this.loading=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:{errorText:e.detail}})))},e.prototype.onClick=function(e){this.mic&&!this.typing?this.mic.callInput():this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputSubmitButtonEvents.CHANGE))},e.prototype.click=function(){this.el.click()},e.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,this.onMicrophoneTerminalErrorCallback,!1),this.onMicrophoneTerminalErrorCallback=null,this.mic&&this.mic.dealloc(),this.mic=null,this.el.removeEventListener("click",this.onClickCallback,!1),this.onClickCallback=null,this.el=null,this.eventTarget=null},e}();t.UserInputSubmitButton=e}(cf||(cf={}));var cf;!function(t){t.UserInputTypes={VOICE:"voice",VR_GESTURE:"vr-gesture",TEXT:"text"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i._disabled=!1,i._visible=!1,i.onChatReponsesUpdatedCallback=i.onChatReponsesUpdated.bind(i),i.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,i.onChatReponsesUpdatedCallback,!1),i.windowFocusCallback=i.windowFocus.bind(i),window.addEventListener("focus",i.windowFocusCallback,!1),i.inputInvalidCallback=i.inputInvalid.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_INVALID,i.inputInvalidCallback,!1),i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"currentTag",{get:function(){return this._currentTag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this._visible=t,!this.el.classList.contains("animate-in")&&t?setTimeout(function(){e.el.classList.add("animate-in")},0):this.el.classList.contains("animate-in")&&!t&&this.el.classList.remove("animate-in")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled!=t&&(this._disabled=t,t?this.el.setAttribute("disabled","disabled"):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var e=0,n=0,i=this.el;return t.Helpers.isInternetExlorer()?(e=i.offsetHeight,n=parseInt(i.currentStyle.marginTop,10)+parseInt(i.currentStyle.marginBottom,10),n*=2):(e=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("height"),10),n=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-bottom"))),e+n},enumerable:!0,configurable:!0}),n.prototype.onEnterOrSubmitButtonSubmit=function(t){void 0===t&&(t=null)},n.prototype.inputInvalid=function(t){},n.prototype.deactivate=function(){this.disabled=!0},n.prototype.reactivate=function(){this.disabled=!1},n.prototype.getFlowDTO=function(){},n.prototype.setFocusOnInput=function(){},n.prototype.onFlowStopped=function(){},n.prototype.reset=function(){},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onChatReponsesUpdatedCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_INVALID,this.inputInvalidCallback,!1),this.inputInvalidCallback=null,window.removeEventListener("focus",this.windowFocusCallback,!1),this.windowFocusCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,e.prototype.dealloc.call(this)},n.prototype.onFlowUpdate=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this._currentTag=e.detail.tag},n.prototype.windowFocus=function(t){},n.prototype.onChatReponsesUpdated=function(t){t.detail.currentResponse.isRobotResponse||(this.visible=!0,this.disabled=!1,this.setFocusOnInput())},n.ERROR_TIME=2e3,n.preventAutoFocus=!1,n.hideUserInputOnNoneTextInput=!1,n}(t.BasicElement);t.UserInputElement=e,t.UserInputEvents={SUBMIT:"cf-input-user-input-submit",KEY_CHANGE:"cf-input-key-change",CONTROL_ELEMENTS_ADDED:"cf-input-control-elements-added",HEIGHT_CHANGE:"cf-input-height-change",FOCUS:"cf-input-focus",BLUR:"cf-input-blur"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.errorTimer=0,i.initialInputHeight=0,i.shiftIsDown=!1,i._active=!1,i.cfReference=n.cfReference,i.eventTarget=n.eventTarget,i.inputElement=i.el.getElementsByTagName("textarea")[0],i.onInputFocusCallback=i.onInputFocus.bind(i),i.onInputBlurCallback=i.onInputBlur.bind(i),i.inputElement.addEventListener("focus",i.onInputFocusCallback,!1),i.inputElement.addEventListener("blur",i.onInputBlurCallback,!1),i.controlElements=new t.ControlElements({el:i.el.getElementsByTagName("cf-input-control-elements")[0],cfReference:i.cfReference,infoEl:i.el.getElementsByTagName("cf-info")[0],eventTarget:i.eventTarget}),i.keyUpCallback=i.onKeyUp.bind(i),document.addEventListener("keyup",i.keyUpCallback,!1),i.keyDownCallback=i.onKeyDown.bind(i),document.addEventListener("keydown",i.keyDownCallback,!1),i.onOriginalTagChangedCallback=i.onOriginalTagChanged.bind(i),i.eventTarget.addEventListener(t.TagEvents.ORIGINAL_ELEMENT_CHANGED,i.onOriginalTagChangedCallback,!1),i.onControlElementSubmitCallback=i.onControlElementSubmit.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.SUBMIT_VALUE,i.onControlElementSubmitCallback,!1),i.onControlElementProgressChangeCallback=i.onControlElementProgressChange.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.PROGRESS_CHANGE,i.onControlElementProgressChangeCallback,!1),i.onSubmitButtonChangeStateCallback=i.onSubmitButtonChangeState.bind(i),i.eventTarget.addEventListener(t.UserInputSubmitButtonEvents.CHANGE,i.onSubmitButtonChangeStateCallback,!1),i.submitButton=new t.UserInputSubmitButton({eventTarget:i.eventTarget}),i.el.appendChild(i.submitButton.el),n.microphoneInputObj&&(i.microphoneObj=n.microphoneInputObj,i.microphoneObj&&i.microphoneObj.init&&i.microphoneObj.init(),i.submitButton.addMicrophone(i.microphoneObj)),i}return __extends(n,e),Object.defineProperty(n.prototype,"active",{get:function(){return this.inputElement===document.activeElement||this._active},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{set:function(e){var n=this._disabled!=e;t.ConversationalForm.suppressLog||console.log("option hasChanged",e),n&&(this._disabled=e,e?(this.el.setAttribute("disabled","disabled"),this.inputElement.blur()):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),n.prototype.getInputValue=function(){var t=this.inputElement.value,e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML},n.prototype.getFlowDTO=function(){var t;return t=this.controlElements&&this.controlElements.active?this.controlElements.getDTO():{text:this.getInputValue()},t.tag||(t.tag=this.currentTag),t.input=this,t.tag=this.currentTag,t},n.prototype.reset=function(){this.controlElements&&this.controlElements.clearTagsAndReset()},n.prototype.deactivate=function(){e.prototype.deactivate.call(this),this.microphoneObj&&(this.submitButton.active=!1)},n.prototype.reactivate=function(){e.prototype.reactivate.call(this),this.microphoneObj&&!this.submitButton.typing&&(this.submitButton.loading=!0,this.submitButton.typing=!1,this.submitButton.active=!0)},n.prototype.onFlowStopped=function(){this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.controlElements&&this.controlElements.clearTagsAndReset(),this.disabled=!0},n.prototype.onOriginalTagChanged=function(t){this.currentTag==t.detail.tag&&this.onInputChange(),this.controlElements&&this.controlElements.active&&this.controlElements.updateStateOnElementsFromTag(t.detail.tag)},n.prototype.onInputChange=function(){if(this.active||this.controlElements.active){var e=Math.max(this.initialInputHeight,parseInt(this.inputElement.style.height,10));this.inputElement.style.height="0px",this.inputElement.style.height=(0===this.inputElement.scrollHeight?e:this.inputElement.scrollHeight)+"px",t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.HEIGHT_CHANGE),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.HEIGHT_CHANGE,{detail:this.inputElement.scrollHeight}))}},n.prototype.inputInvalid=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;this.inputElement.setAttribute("data-value",this.inputElement.value),this.inputElement.value="",this.el.setAttribute("error",""),this.disabled=!0,this.inputElement.setAttribute("placeholder",i.errorText||(this._currentTag?this._currentTag.errorMessage:"")),clearTimeout(this.errorTimer),this.submitButton.loading=!1,this.errorTimer=setTimeout(function(){n.disabled=!1,t.ConversationalForm.suppressLog||console.log("option, disabled 1"),n.el.removeAttribute("error"),n.inputElement.value=n.inputElement.getAttribute("data-value"),n.inputElement.setAttribute("data-value",""),n.setPlaceholder(),n.setFocusOnInput(),n.submitButton.reset(),n.controlElements&&n.controlElements.resetAfterErrorMessage()},t.UserInputElement.ERROR_TIME)},n.prototype.setPlaceholder=function(){this._currentTag?this._currentTag.inputPlaceholder?this.inputElement.setAttribute("placeholder",this._currentTag.inputPlaceholder):this.inputElement.setAttribute("placeholder","group"==this._currentTag.type?t.Dictionary.get("group-placeholder"):t.Dictionary.get("input-placeholder")):this.inputElement.setAttribute("placeholder",t.Dictionary.get("group-placeholder"))},n.prototype.checkForCorrectInputTag=function(){var t=this.inputElement.getAttribute("type"),e="password"==this._currentTag.type&&"password"!=t,n="password"!=this._currentTag.type&&"password"==t,i="email"==this._currentTag.type&&"email"!=t||"number"==this._currentTag.type&&"number"!=t;if(this.inputElement&&(e||n)&&(this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1)),e||i){var o=document.createElement("input");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){o.setAttribute(t.name,t.value)}),o.setAttribute("autocomplete","new-password"),this.inputElement.parentNode.replaceChild(o,this.inputElement),this.inputElement=o,"number"!==this._currentTag.type&&"email"!==this._currentTag.type||(this.inputElement.type=this._currentTag.type,o.setAttribute("type",this._currentTag.type))}else if(n){var s=document.createElement("textarea");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){s.setAttribute(t.name,t.value)}),this.inputElement.parentNode.replaceChild(s,this.inputElement),this.inputElement=s}this.inputElement&&(e||n)&&(this.inputElement.addEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.addEventListener("blur",this.onInputBlurCallback,!1)),0==this.initialInputHeight&&(this.initialInputHeight=this.inputElement.offsetHeight),this.setFocusOnInput()},n.prototype.onFlowUpdate=function(n){var i=this;e.prototype.onFlowUpdate.call(this,n),this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.el.setAttribute("tag-type",this._currentTag.type),this.checkForCorrectInputTag();var o=-1!==["password","number","email"].indexOf(this._currentTag.type);this.inputElement.setAttribute("type",o?this._currentTag.type:"input"),clearTimeout(this.errorTimer),this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),this.inputElement.value="",this.submitButton.loading=!1,this.setPlaceholder(),this.resetValue(),this.setFocusOnInput(),this.controlElements.reset(),"group"==this._currentTag.type?this.buildControlElements(this._currentTag.elements):this.buildControlElements([this._currentTag]),"text"!=this._currentTag.type&&"email"!=this._currentTag.type||(this.inputElement.value=this._currentTag.defaultValue.toString()),!0===this._currentTag.skipUserInput&&this.el.classList.add("hide-input"),t.UserInputElement.hideUserInputOnNoneTextInput&&(this.controlElements.active?(this.el.classList.add("hide-input"),this.controlElements.focusFrom("bottom")):this.el.classList.remove("hide-input")),setTimeout(function(){i.onInputChange()},150)},n.prototype.onControlElementProgressChange=function(e){var n=e.detail;this.disabled=n==t.ControlElementProgressStates.BUSY,t.ConversationalForm.suppressLog||console.log("option, disabled 2")},n.prototype.buildControlElements=function(t){this.controlElements.buildTags(t)},n.prototype.onControlElementSubmit=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var n=e.detail;this.controlElements.updateStateOnElements(n),this.doSubmit()},n.prototype.onSubmitButtonChangeState=function(t){this.onEnterOrSubmitButtonSubmit(t)},n.prototype.isMetaKeyPressed=function(t){t.metaKey||[91,93].indexOf(t.keyCode)},n.prototype.onKeyDown=function(e){(this.active||this.controlElements.focus)&&(this.isControlElementsActiveAndUserInputHidden()||this.isMetaKeyPressed(e)||(e.keyCode==t.Dictionary.keyCodes.shift&&(this.shiftIsDown=!0),e.keyCode!=t.Dictionary.keyCodes.enter||e.shiftKey||e.preventDefault()))},n.prototype.isControlElementsActiveAndUserInputHidden=function(){return this.controlElements&&this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput},n.prototype.onKeyUp=function(e){if((this.active||this.isControlElementsActiveAndUserInputHidden()||this.controlElements.focus)&&!this.isMetaKeyPressed(e)){if(e.keyCode==t.Dictionary.keyCodes.shift)this.shiftIsDown=!1;else if(e.keyCode==t.Dictionary.keyCodes.up)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("bottom");else if(e.keyCode==t.Dictionary.keyCodes.down)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("top");else if(e.keyCode==t.Dictionary.keyCodes.tab){for(var n=!1,i=e.target.parentNode;null!=i;){if(i===this.cfReference.el){n=!0;break}i=i.parentNode}n||(e.preventDefault(),this.controlElements.active||this.setFocusOnInput())}if(!this.el.hasAttribute("disabled")){var o=this.getFlowDTO();if(e.keyCode==t.Dictionary.keyCodes.enter&&!e.shiftKey||e.keyCode==t.Dictionary.keyCodes.space)if(e.keyCode==t.Dictionary.keyCodes.enter&&this.active)e.preventDefault(),this.onEnterOrSubmitButtonSubmit();else if(e.keyCode==t.Dictionary.keyCodes.enter||e.keyCode==t.Dictionary.keyCodes.space){e.preventDefault();var s="group"==this._currentTag.type?this._currentTag.getGroupTagType():this._currentTag.type;if("select"==s||"checkbox"==s){var r=this._currentTag;"checkbox"==s||r.multipleChoice?(this.active||this.isControlElementsActiveAndUserInputHidden())&&e.keyCode==t.Dictionary.keyCodes.enter?this.submitButton.click():(this.active||this.controlElements.active||this.isControlElementsActiveAndUserInputHidden()||(this.resetValue(),this.setFocusOnInput()),this.dispatchKeyChange(o,e.keyCode)):this.dispatchKeyChange(o,e.keyCode)}else"group"==this._currentTag.type&&this.dispatchKeyChange(o,e.keyCode)}else e.keyCode==t.Dictionary.keyCodes.space&&document.activeElement&&this.dispatchKeyChange(o,e.keyCode);else e.keyCode!=t.Dictionary.keyCodes.shift&&e.keyCode!=t.Dictionary.keyCodes.tab&&this.dispatchKeyChange(o,e.keyCode);this.onInputChange()}}},n.prototype.dispatchKeyChange=function(e,n){this.submitButton.typing=e.text&&e.text.length>0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.KEY_CHANGE,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.KEY_CHANGE,{detail:{dto:e,keyCode:n,inputFieldActive:this.active}}))},n.prototype.windowFocus=function(t){e.prototype.windowFocus.call(this,t),this.setFocusOnInput()},n.prototype.onInputBlur=function(e){this._active=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.BLUR))},n.prototype.onInputFocus=function(e){this._active=!0,this.onInputChange(),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.FOCUS))},n.prototype.setFocusOnInput=function(){t.UserInputElement.preventAutoFocus||this.el.classList.contains("hide-input")||this.inputElement.focus()},n.prototype.onEnterOrSubmitButtonSubmit=function(e){void 0===e&&(e=null);var n=this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput;(this.active||n)&&this.controlElements.highlighted?this.controlElements.clickOnHighlighted():this._currentTag?"file"==this._currentTag.type&&e?this.controlElements.getElement(0).triggerFileSelect():this.doSubmit():this.eventTarget.cf.addUserChatResponse(this.inputElement.value)},n.prototype.doSubmit=function(){var e=this.getFlowDTO();this.submitButton.loading=!0,this.disabled=!0,this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.SUBMIT,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:e}))},n.prototype.resetValue=function(){this.inputElement.value="",this.onInputChange()},n.prototype.dealloc=function(){this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1),this.onInputBlurCallback=null,this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.onInputFocusCallback=null,document.removeEventListener("keydown",this.keyDownCallback,!1),this.keyDownCallback=null,document.removeEventListener("keyup",this.keyUpCallback,!1),this.keyUpCallback=null,this.eventTarget.removeEventListener(t.ControlElementEvents.SUBMIT_VALUE,this.onControlElementSubmitCallback,!1),this.onControlElementSubmitCallback=null,this.submitButton.el.removeEventListener(t.UserInputSubmitButtonEvents.CHANGE,this.onSubmitButtonChangeStateCallback,!1),this.onSubmitButtonChangeStateCallback=null,this.submitButton.dealloc(),this.submitButton=null,e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return this.customTemplate||'\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\n\t\t\t\t\n\n\t\t\t \n\t\t\t'},n}(t.UserInputElement);t.UserTextInput=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatResponseEvents={USER_ANSWER_CLICKED:"cf-on-user-answer-clicked"};var e=function(e){function n(t){var n=e.call(this,t)||this;return n.readyTimer=0,n.container=t.container,n.uiOptions=t.cfReference.uiOptions,n._tag=t.tag,n}return __extends(n,e),Object.defineProperty(n.prototype,"tag",{get:function(){return this._tag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"added",{get:function(){return!!this.el.parentNode.parentNode},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.el.classList.contains("disabled")},set:function(t){t?this.el.classList.add("disabled"):this.el.classList.remove("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this.el.offsetWidth,setTimeout(function(){return t?e.el.classList.add("show"):e.el.classList.remove("show")},100)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strippedSesponse",{get:function(){var t=this.response,e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},enumerable:!0,configurable:!0}),n.prototype.whenReady=function(t){this.onReadyCallback=t},n.prototype.setValue=function(e){void 0===e&&(e=null),this.visible||(this.visible=!0);this.el.hasAttribute("thinking");if(e){if(this.response=this.originalResponse=e.text,this.processResponseAndSetText(),this.responseLink&&!this.isRobotResponse&&this.responseLink.processResponseAndSetText(),e&&e.controlElements&&e.controlElements[0])switch(e.controlElements[0].type){case"UploadFileUI":this.textEl.classList.add("file-icon")}this.isRobotResponse||this.onClickCallback||(this.onClickCallback=this.onClick.bind(this),this.el.addEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1))}else this.setToThinking()},n.prototype.show=function(){this.visible=!0,this.disabled=!1,this.response?this.checkForEditMode():this.setToThinking()},n.prototype.updateThumbnail=function(t){var e=this.el.getElementsByTagName("thumb")[0];if(0===t.indexOf("text:")){var n=e.getElementsByTagName("span")[0];n.innerHTML=t.split("text:")[1],n.setAttribute("length",t.length.toString())}else this.image=t,e.style.backgroundImage='url("'+this.image+'")'},n.prototype.setLinkToOtherReponse=function(t){this.responseLink=t},n.prototype.processResponseAndSetText=function(){var t=this;if(this.originalResponse){var e=this.originalResponse;if(this._tag&&"password"==this._tag.type&&!this.isRobotResponse){for(var i="",o=0;o"+n+"";var e=t.textEl.getElementsByTagName("p");e[e.length-1].offsetWidth,e[e.length-1].classList.add("show"),t.scrollTo()},l+(e+1)*u.uiOptions.robot.chainedResponseTime)}(h);this.readyTimer=setTimeout(function(){
-t.onReadyCallback&&t.onReadyCallback(),t.onReadyCallback=null,!0===t._tag.skipUserInput&&setTimeout(function(){t._tag.flowManager.nextStep()},t.uiOptions.robot.chainedResponseTime)},l+c.length*this.uiOptions.robot.chainedResponseTime)}else{this.tryClearThinking(),this.textEl.innerHTML=""+e+"
";var p=this.textEl.getElementsByTagName("p");p[p.length-1].offsetWidth,p[p.length-1].classList.add("show"),this.scrollTo()}this.parsedResponse=e,this.addSelf(),this.textEl.removeAttribute("value-added"),setTimeout(function(){t.textEl.setAttribute("value-added",""),t.el.classList.add("peak-thumb")},0),this.checkForEditMode(),this.response=e.split("&&").join(" ")}},n.prototype.scrollTo=function(){var t=this.el.offsetTop,e=this.el.offsetHeight;this.container.scrollTop=t+e+this.container.scrollTop},n.prototype.checkForEditMode=function(){this.isRobotResponse||this.el.hasAttribute("thinking")||(this.el.classList.add("can-edit"),this.disabled=!1)},n.prototype.tryClearThinking=function(){this.el.hasAttribute("thinking")&&(this.textEl.innerHTML="",this.el.removeAttribute("thinking"))},n.prototype.setToThinking=function(){(this.isRobotResponse&&0!==this.uiOptions.robot.robotResponseTime||!this.isRobotResponse&&this.cfReference.uiOptions.user.showThinking)&&(this.textEl.innerHTML=n.THINKING_MARKUP,this.el.classList.remove("can-edit"),this.el.setAttribute("thinking","")),(this.cfReference.uiOptions.user.showThinking||this.cfReference.uiOptions.user.showThumb)&&this.addSelf()},n.prototype.addSelf=function(){this.el.parentNode!=this.container&&this.container.appendChild(this.el)},n.prototype.onClick=function(e){this.setToThinking(),t.ConversationalForm.illustrateFlow(this,"dispatch",t.ChatResponseEvents.USER_ANSWER_CLICKED,e),this.eventTarget.dispatchEvent(new CustomEvent(t.ChatResponseEvents.USER_ANSWER_CLICKED,{detail:this._tag}))},n.prototype.setData=function(t){this.image=t.image,this.response=this.originalResponse=t.response,this.isRobotResponse=t.isRobotResponse,e.prototype.setData.call(this,t)},n.prototype.onElementCreated=function(){var t=this;this.textEl=this.el.getElementsByTagName("text")[0],this.updateThumbnail(this.image),this.isRobotResponse||null!=this.response?setTimeout(function(){t.setValue({text:t.response})},0):this.cfReference.uiOptions.user.showThumb&&this.el.classList.add("peak-thumb")},n.prototype.dealloc=function(){clearTimeout(this.readyTimer),this.container=null,this.uiOptions=null,this.onReadyCallback=null,this.onClickCallback&&(this.el.removeEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1),this.onClickCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return'\n\t\t\t\t \n\t\t\t\t \n\t\t\t '},n.THINKING_MARKUP=". . .
",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t \n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.71",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t\n\t\t\t"},n}(t.Button);t.UploadFileUI=e}(cf||(cf={}));var cf;!function(t){t.MicrophoneBridgeEvent={ERROR:"cf-microphone-bridge-error",TERMNIAL_ERROR:"cf-microphone-bridge-terminal-error"};var e=function(){function e(e){this.currentTextResponse="",this._hasUserMedia=!1,this.inputErrorCount=0,this.inputCurrentError="",this.el=e.el,this.button=e.button,this.eventTarget=e.eventTarget,this.microphoneObj=e.microphoneObj,this.flowUpdateCallback=this.onFlowUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1)}return Object.defineProperty(e.prototype,"hasUserMedia",{set:function(t){this._hasUserMedia=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{set:function(t){this.equalizer&&(this.equalizer.disabled=!t)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this.button.loading=!1,this.microphoneObj.cancelInput&&this.microphoneObj.cancelInput()},e.prototype.onFlowUpdate=function(){var t=this;if(this.currentTextResponse=null,this._hasUserMedia)this.microphoneObj.awaitingCallback||this.callInput();else{var e=!1;window.navigator.mediaDevices&&window.navigator.mediaDevices.enumerateDevices().then(function(n){n.forEach(function(t){e||""===t.label||(e=!0)}),e&&t.getUserMedia()})}},e.prototype.getUserMedia=function(){var e=this;try{void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(t){var e=navigator.getUserMedia||window.navigator.webkitGetUserMedia||window.navigator.mozGetUserMedia;return e?new Promise(function(n,i){e.call(navigator,t,n,i)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({audio:!0}).then(function(t){e.currentStream=t,t.getAudioTracks().length>0?(e.hasUserMedia=!0,e.setupEqualizer(),e.microphoneObj.awaitingCallback||e.callInput()):e.hasUserMedia=!1}).catch(function(n){e.hasUserMedia=!1,e.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))})}catch(e){this.hasUserMedia=!1,this.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))}},e.prototype.dealloc=function(){this.cancel(),this.promise=null,this.currentStream=null,this.equalizer&&this.equalizer.dealloc(),this.equalizer=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null},e.prototype.callInput=function(e){var n=this;void 0===e&&(e=0),this.button.loading=!0,this.equalizer&&(this.equalizer.disabled=!1),this.promise=new Promise(function(t,e){return n.microphoneObj.input(t,e,n.currentStream)}).then(function(e){if(n.promise=null,n.currentTextResponse=e.toString(),!n.currentTextResponse||""==n.currentTextResponse)return n.showError(t.Dictionary.get("user-audio-reponse-invalid")),void n.callInput();n.inputErrorCount=0,n.inputCurrentError="",n.button.loading=!1;var i={text:n.currentTextResponse};t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.SUBMIT,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:i}))}).catch(function(e){n.isErrorTerminal(e)?(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)):(n.inputCurrentError!=e&&(n.inputErrorCount=0,n.inputCurrentError=e),n.inputErrorCount++,n.inputErrorCount>2?n.showError(e):(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)))})},e.prototype.isErrorTerminal=function(t){return-1!==["network"].indexOf(t)},e.prototype.showError=function(e){var n={errorText:e};t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.USER_INPUT_INVALID,n),this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:n})),this.callInput()},e.prototype.setupEqualizer=function(){var t=this.el.getElementsByTagName("cf-icon-audio-eq")[0];n.supported&&t&&(this.equalizer=new n({stream:this.currentStream,elementToScale:t}))},e}();t.MicrophoneBridge=e;var n=function(){function t(t){var e=this;this.maxBorderWidth=0,this._disabled=!1,this.elementToScale=t.elementToScale,this.context=new AudioContext,this.analyser=this.context.createAnalyser(),this.mic=this.context.createMediaStreamSource(t.stream),this.javascriptNode=this.context.createScriptProcessor(2048,1,1),this.analyser.smoothingTimeConstant=.3,this.analyser.fftSize=1024,this.mic.connect(this.analyser),this.analyser.connect(this.javascriptNode),this.javascriptNode.connect(this.context.destination),this.javascriptNode.onaudioprocess=function(){e.onAudioProcess()}}return Object.defineProperty(t.prototype,"disabled",{set:function(t){this._disabled=t,this.elementToScale.style.borderWidth="0px"},enumerable:!0,configurable:!0}),t.prototype.onAudioProcess=function(){if(!this._disabled){var t=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(t);for(var e=0,n=t.length,i=0;i\n\t\t\t\t
\n\t\t\t\t \n\t\t\t';var i=n.firstChild||n.content.firstChild;this.mic=new t.MicrophoneBridge({el:i,button:this,eventTarget:this.eventTarget,microphoneObj:e}),this.el.appendChild(i)},e.prototype.reset=function(){this.mic&&!this.typing&&this.mic.callInput()},e.prototype.getTemplate=function(){return'\n\t\t\t\t\t\t\n\t\t\t\t\t '},e.prototype.onMicrophoneTerminalError=function(e){this.mic&&(this.mic.dealloc(),this.mic=null,this.el.removeChild(this.el.getElementsByClassName("cf-microphone")[0]),this.el.classList.remove("microphone-interface"),this.loading=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:{errorText:e.detail}})))},e.prototype.onClick=function(e){this.mic&&!this.typing?this.mic.callInput():this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputSubmitButtonEvents.CHANGE))},e.prototype.click=function(){this.el.click()},e.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,this.onMicrophoneTerminalErrorCallback,!1),this.onMicrophoneTerminalErrorCallback=null,this.mic&&this.mic.dealloc(),this.mic=null,this.el.removeEventListener("click",this.onClickCallback,!1),this.onClickCallback=null,this.el=null,this.eventTarget=null},e}();t.UserInputSubmitButton=e}(cf||(cf={}));var cf;!function(t){t.UserInputTypes={VOICE:"voice",VR_GESTURE:"vr-gesture",TEXT:"text"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i._disabled=!1,i._visible=!1,i.onChatReponsesUpdatedCallback=i.onChatReponsesUpdated.bind(i),i.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,i.onChatReponsesUpdatedCallback,!1),i.windowFocusCallback=i.windowFocus.bind(i),window.addEventListener("focus",i.windowFocusCallback,!1),i.inputInvalidCallback=i.inputInvalid.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_INVALID,i.inputInvalidCallback,!1),i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"currentTag",{get:function(){return this._currentTag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this._visible=t,!this.el.classList.contains("animate-in")&&t?setTimeout(function(){e.el.classList.add("animate-in")},0):this.el.classList.contains("animate-in")&&!t&&this.el.classList.remove("animate-in")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled!=t&&(this._disabled=t,t?this.el.setAttribute("disabled","disabled"):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var e=0,n=0,i=this.el;return t.Helpers.isInternetExlorer()?(e=i.offsetHeight,n=parseInt(i.currentStyle.marginTop,10)+parseInt(i.currentStyle.marginBottom,10),n*=2):(e=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("height"),10),n=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-bottom"))),e+n},enumerable:!0,configurable:!0}),n.prototype.onEnterOrSubmitButtonSubmit=function(t){void 0===t&&(t=null)},n.prototype.inputInvalid=function(t){},n.prototype.deactivate=function(){this.disabled=!0},n.prototype.reactivate=function(){this.disabled=!1},n.prototype.getFlowDTO=function(){},n.prototype.setFocusOnInput=function(){},n.prototype.onFlowStopped=function(){},n.prototype.reset=function(){},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onChatReponsesUpdatedCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_INVALID,this.inputInvalidCallback,!1),this.inputInvalidCallback=null,window.removeEventListener("focus",this.windowFocusCallback,!1),this.windowFocusCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,e.prototype.dealloc.call(this)},n.prototype.onFlowUpdate=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this._currentTag=e.detail.tag},n.prototype.windowFocus=function(t){},n.prototype.onChatReponsesUpdated=function(t){t.detail.currentResponse.isRobotResponse||(this.visible=!0,this.disabled=!1,this.setFocusOnInput())},n.ERROR_TIME=2e3,n.preventAutoFocus=!1,n.hideUserInputOnNoneTextInput=!1,n}(t.BasicElement);t.UserInputElement=e,t.UserInputEvents={SUBMIT:"cf-input-user-input-submit",KEY_CHANGE:"cf-input-key-change",CONTROL_ELEMENTS_ADDED:"cf-input-control-elements-added",HEIGHT_CHANGE:"cf-input-height-change",FOCUS:"cf-input-focus",BLUR:"cf-input-blur"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.errorTimer=0,i.initialInputHeight=0,i.shiftIsDown=!1,i._active=!1,i.cfReference=n.cfReference,i.eventTarget=n.eventTarget,i.inputElement=i.el.getElementsByTagName("textarea")[0],i.onInputFocusCallback=i.onInputFocus.bind(i),i.onInputBlurCallback=i.onInputBlur.bind(i),i.inputElement.addEventListener("focus",i.onInputFocusCallback,!1),i.inputElement.addEventListener("blur",i.onInputBlurCallback,!1),i.controlElements=new t.ControlElements({el:i.el.getElementsByTagName("cf-input-control-elements")[0],cfReference:i.cfReference,infoEl:i.el.getElementsByTagName("cf-info")[0],eventTarget:i.eventTarget}),i.keyUpCallback=i.onKeyUp.bind(i),document.addEventListener("keyup",i.keyUpCallback,!1),i.keyDownCallback=i.onKeyDown.bind(i),document.addEventListener("keydown",i.keyDownCallback,!1),i.onOriginalTagChangedCallback=i.onOriginalTagChanged.bind(i),i.eventTarget.addEventListener(t.TagEvents.ORIGINAL_ELEMENT_CHANGED,i.onOriginalTagChangedCallback,!1),i.onControlElementSubmitCallback=i.onControlElementSubmit.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.SUBMIT_VALUE,i.onControlElementSubmitCallback,!1),i.onControlElementProgressChangeCallback=i.onControlElementProgressChange.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.PROGRESS_CHANGE,i.onControlElementProgressChangeCallback,!1),i.onSubmitButtonChangeStateCallback=i.onSubmitButtonChangeState.bind(i),i.eventTarget.addEventListener(t.UserInputSubmitButtonEvents.CHANGE,i.onSubmitButtonChangeStateCallback,!1),i.submitButton=new t.UserInputSubmitButton({eventTarget:i.eventTarget}),i.el.appendChild(i.submitButton.el),n.microphoneInputObj&&(i.microphoneObj=n.microphoneInputObj,i.microphoneObj&&i.microphoneObj.init&&i.microphoneObj.init(),i.submitButton.addMicrophone(i.microphoneObj)),i}return __extends(n,e),Object.defineProperty(n.prototype,"active",{get:function(){return this.inputElement===document.activeElement||this._active},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{set:function(e){var n=this._disabled!=e;t.ConversationalForm.suppressLog||console.log("option hasChanged",e),n&&(this._disabled=e,e?(this.el.setAttribute("disabled","disabled"),this.inputElement.blur()):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),n.prototype.getInputValue=function(){var t=this.inputElement.value,e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML},n.prototype.getFlowDTO=function(){var t;return t=this.controlElements&&this.controlElements.active?this.controlElements.getDTO():{text:this.getInputValue()},t.tag||(t.tag=this.currentTag),t.input=this,t.tag=this.currentTag,t},n.prototype.reset=function(){this.controlElements&&this.controlElements.clearTagsAndReset()},n.prototype.deactivate=function(){e.prototype.deactivate.call(this),this.microphoneObj&&(this.submitButton.active=!1)},n.prototype.reactivate=function(){e.prototype.reactivate.call(this),this.microphoneObj&&!this.submitButton.typing&&(this.submitButton.loading=!0,this.submitButton.typing=!1,this.submitButton.active=!0)},n.prototype.onFlowStopped=function(){this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.controlElements&&this.controlElements.clearTagsAndReset(),this.disabled=!0},n.prototype.onOriginalTagChanged=function(t){this.currentTag==t.detail.tag&&this.onInputChange(),this.controlElements&&this.controlElements.active&&this.controlElements.updateStateOnElementsFromTag(t.detail.tag)},n.prototype.onInputChange=function(){if(this.active||this.controlElements.active){var e=Math.max(this.initialInputHeight,parseInt(this.inputElement.style.height,10));this.inputElement.style.height="0px",this.inputElement.style.height=(0===this.inputElement.scrollHeight?e:this.inputElement.scrollHeight)+"px",t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.HEIGHT_CHANGE),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.HEIGHT_CHANGE,{detail:this.inputElement.scrollHeight}))}},n.prototype.inputInvalid=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;this.inputElement.setAttribute("data-value",this.inputElement.value),this.inputElement.value="",this.el.setAttribute("error",""),this.disabled=!0,this.inputElement.setAttribute("placeholder",i.errorText||(this._currentTag?this._currentTag.errorMessage:"")),clearTimeout(this.errorTimer),this.submitButton.loading=!1,this.errorTimer=setTimeout(function(){n.disabled=!1,t.ConversationalForm.suppressLog||console.log("option, disabled 1"),n.el.removeAttribute("error"),n.inputElement.value=n.inputElement.getAttribute("data-value"),n.inputElement.setAttribute("data-value",""),n.setPlaceholder(),n.setFocusOnInput(),n.submitButton.reset(),n.controlElements&&n.controlElements.resetAfterErrorMessage()},t.UserInputElement.ERROR_TIME)},n.prototype.setPlaceholder=function(){this._currentTag?this._currentTag.inputPlaceholder?this.inputElement.setAttribute("placeholder",this._currentTag.inputPlaceholder):this.inputElement.setAttribute("placeholder","group"==this._currentTag.type?t.Dictionary.get("group-placeholder"):t.Dictionary.get("input-placeholder")):this.inputElement.setAttribute("placeholder",t.Dictionary.get("group-placeholder"))},n.prototype.checkForCorrectInputTag=function(){var t=this.inputElement.getAttribute("type"),e="password"==this._currentTag.type&&"password"!=t,n="password"!=this._currentTag.type&&"password"==t,i="email"==this._currentTag.type&&"email"!=t||"number"==this._currentTag.type&&"number"!=t;if(this.inputElement&&(e||n)&&(this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1)),e||i){var o=document.createElement("input");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){o.setAttribute(t.name,t.value)}),o.setAttribute("autocomplete","new-password"),this.inputElement.parentNode.replaceChild(o,this.inputElement),this.inputElement=o,"number"!==this._currentTag.type&&"email"!==this._currentTag.type||(this.inputElement.type=this._currentTag.type,o.setAttribute("type",this._currentTag.type))}else if(n){var s=document.createElement("textarea");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){s.setAttribute(t.name,t.value)}),this.inputElement.parentNode.replaceChild(s,this.inputElement),this.inputElement=s}this.inputElement&&(e||n)&&(this.inputElement.addEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.addEventListener("blur",this.onInputBlurCallback,!1)),0==this.initialInputHeight&&(this.initialInputHeight=this.inputElement.offsetHeight),this.setFocusOnInput()},n.prototype.onFlowUpdate=function(n){var i=this;e.prototype.onFlowUpdate.call(this,n),this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.el.setAttribute("tag-type",this._currentTag.type),this.checkForCorrectInputTag();var o=-1!==["password","number","email"].indexOf(this._currentTag.type);this.inputElement.setAttribute("type",o?this._currentTag.type:"input"),clearTimeout(this.errorTimer),this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),this.inputElement.value="",this.submitButton.loading=!1,this.setPlaceholder(),this.resetValue(),this.setFocusOnInput(),this.controlElements.reset(),"group"==this._currentTag.type?this.buildControlElements(this._currentTag.elements):this.buildControlElements([this._currentTag]),"text"!=this._currentTag.type&&"email"!=this._currentTag.type||(this.inputElement.value=this._currentTag.defaultValue.toString()),!0===this._currentTag.skipUserInput?this.el.classList.add("hide-input"):this.el.classList.remove("hide-input"),t.UserInputElement.hideUserInputOnNoneTextInput&&(this.controlElements.active?(this.el.classList.add("hide-input"),this.controlElements.focusFrom("bottom")):this.el.classList.remove("hide-input")),setTimeout(function(){i.onInputChange()},150)},n.prototype.onControlElementProgressChange=function(e){var n=e.detail;this.disabled=n==t.ControlElementProgressStates.BUSY,t.ConversationalForm.suppressLog||console.log("option, disabled 2")},n.prototype.buildControlElements=function(t){this.controlElements.buildTags(t)},n.prototype.onControlElementSubmit=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var n=e.detail;this.controlElements.updateStateOnElements(n),this.doSubmit()},n.prototype.onSubmitButtonChangeState=function(t){this.onEnterOrSubmitButtonSubmit(t)},n.prototype.isMetaKeyPressed=function(t){t.metaKey||[91,93].indexOf(t.keyCode)},n.prototype.onKeyDown=function(e){(this.active||this.controlElements.focus)&&(this.isControlElementsActiveAndUserInputHidden()||this.isMetaKeyPressed(e)||(e.keyCode==t.Dictionary.keyCodes.shift&&(this.shiftIsDown=!0),e.keyCode!=t.Dictionary.keyCodes.enter||e.shiftKey||e.preventDefault()))},n.prototype.isControlElementsActiveAndUserInputHidden=function(){return this.controlElements&&this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput},n.prototype.onKeyUp=function(e){if((this.active||this.isControlElementsActiveAndUserInputHidden()||this.controlElements.focus)&&!this.isMetaKeyPressed(e)){if(e.keyCode==t.Dictionary.keyCodes.shift)this.shiftIsDown=!1;else if(e.keyCode==t.Dictionary.keyCodes.up)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("bottom");else if(e.keyCode==t.Dictionary.keyCodes.down)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("top");else if(e.keyCode==t.Dictionary.keyCodes.tab){for(var n=!1,i=e.target.parentNode;null!=i;){if(i===this.cfReference.el){n=!0;break}i=i.parentNode}n||(e.preventDefault(),this.controlElements.active||this.setFocusOnInput())}if(!this.el.hasAttribute("disabled")){var o=this.getFlowDTO();if(e.keyCode==t.Dictionary.keyCodes.enter&&!e.shiftKey||e.keyCode==t.Dictionary.keyCodes.space)if(e.keyCode==t.Dictionary.keyCodes.enter&&this.active)e.preventDefault(),this.onEnterOrSubmitButtonSubmit();else if(e.keyCode==t.Dictionary.keyCodes.enter||e.keyCode==t.Dictionary.keyCodes.space){e.preventDefault();var s="group"==this._currentTag.type?this._currentTag.getGroupTagType():this._currentTag.type;if("select"==s||"checkbox"==s){var r=this._currentTag;"checkbox"==s||r.multipleChoice?(this.active||this.isControlElementsActiveAndUserInputHidden())&&e.keyCode==t.Dictionary.keyCodes.enter?this.submitButton.click():(this.active||this.controlElements.active||this.isControlElementsActiveAndUserInputHidden()||(this.resetValue(),this.setFocusOnInput()),this.dispatchKeyChange(o,e.keyCode)):this.dispatchKeyChange(o,e.keyCode)}else"group"==this._currentTag.type&&this.dispatchKeyChange(o,e.keyCode)}else e.keyCode==t.Dictionary.keyCodes.space&&document.activeElement&&this.dispatchKeyChange(o,e.keyCode);else e.keyCode!=t.Dictionary.keyCodes.shift&&e.keyCode!=t.Dictionary.keyCodes.tab&&this.dispatchKeyChange(o,e.keyCode);this.onInputChange()}}},n.prototype.dispatchKeyChange=function(e,n){this.submitButton.typing=e.text&&e.text.length>0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.KEY_CHANGE,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.KEY_CHANGE,{detail:{dto:e,keyCode:n,inputFieldActive:this.active}}))},n.prototype.windowFocus=function(t){e.prototype.windowFocus.call(this,t),this.setFocusOnInput()},n.prototype.onInputBlur=function(e){this._active=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.BLUR))},n.prototype.onInputFocus=function(e){this._active=!0,this.onInputChange(),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.FOCUS))},n.prototype.setFocusOnInput=function(){t.UserInputElement.preventAutoFocus||this.el.classList.contains("hide-input")||this.inputElement.focus()},n.prototype.onEnterOrSubmitButtonSubmit=function(e){void 0===e&&(e=null);var n=this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput;(this.active||n)&&this.controlElements.highlighted?this.controlElements.clickOnHighlighted():this._currentTag?"file"==this._currentTag.type&&e?this.controlElements.getElement(0).triggerFileSelect():this.doSubmit():this.eventTarget.cf.addUserChatResponse(this.inputElement.value)},n.prototype.doSubmit=function(){var e=this.getFlowDTO();this.submitButton.loading=!0,this.disabled=!0,this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.SUBMIT,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:e}))},n.prototype.resetValue=function(){this.inputElement.value="",this.onInputChange()},n.prototype.dealloc=function(){this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1),this.onInputBlurCallback=null,this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.onInputFocusCallback=null,document.removeEventListener("keydown",this.keyDownCallback,!1),this.keyDownCallback=null,document.removeEventListener("keyup",this.keyUpCallback,!1),this.keyUpCallback=null,this.eventTarget.removeEventListener(t.ControlElementEvents.SUBMIT_VALUE,this.onControlElementSubmitCallback,!1),this.onControlElementSubmitCallback=null,this.submitButton.el.removeEventListener(t.UserInputSubmitButtonEvents.CHANGE,this.onSubmitButtonChangeStateCallback,!1),this.onSubmitButtonChangeStateCallback=null,this.submitButton.dealloc(),this.submitButton=null,e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return this.customTemplate||'\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\n\t\t\t\t\n\n\t\t\t \n\t\t\t'},n}(t.UserInputElement);t.UserTextInput=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatResponseEvents={USER_ANSWER_CLICKED:"cf-on-user-answer-clicked"};var e=function(e){function n(t){var n=e.call(this,t)||this;return n.readyTimer=0,n.container=t.container,n.uiOptions=t.cfReference.uiOptions,n._tag=t.tag,n}return __extends(n,e),Object.defineProperty(n.prototype,"tag",{get:function(){return this._tag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"added",{get:function(){return!!this.el.parentNode.parentNode},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.el.classList.contains("disabled")},set:function(t){t?this.el.classList.add("disabled"):this.el.classList.remove("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this.el.offsetWidth,setTimeout(function(){return t?e.el.classList.add("show"):e.el.classList.remove("show")},100)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strippedSesponse",{get:function(){var t=this.response,e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},enumerable:!0,configurable:!0}),n.prototype.whenReady=function(t){this.onReadyCallback=t},n.prototype.setValue=function(e){void 0===e&&(e=null),this.visible||(this.visible=!0);this.el.hasAttribute("thinking");if(e){if(this.response=this.originalResponse=e.text,this.processResponseAndSetText(),this.responseLink&&!this.isRobotResponse&&this.responseLink.processResponseAndSetText(),e&&e.controlElements&&e.controlElements[0])switch(e.controlElements[0].type){case"UploadFileUI":this.textEl.classList.add("file-icon")}this.isRobotResponse||this.onClickCallback||(this.onClickCallback=this.onClick.bind(this),this.el.addEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1))}else this.setToThinking()},n.prototype.show=function(){this.visible=!0,this.disabled=!1,this.response?this.checkForEditMode():this.setToThinking()},n.prototype.updateThumbnail=function(t){var e=this.el.getElementsByTagName("thumb")[0];if(0===t.indexOf("text:")){var n=e.getElementsByTagName("span")[0];n.innerHTML=t.split("text:")[1],n.setAttribute("length",t.length.toString())}else this.image=t,e.style.backgroundImage='url("'+this.image+'")'},n.prototype.setLinkToOtherReponse=function(t){this.responseLink=t},n.prototype.processResponseAndSetText=function(){var t=this;if(this.originalResponse){var e=this.originalResponse;if(this._tag&&"password"==this._tag.type&&!this.isRobotResponse){for(var i="",o=0;o"+n+"";var e=t.textEl.getElementsByTagName("p");e[e.length-1].offsetWidth,e[e.length-1].classList.add("show"),t.scrollTo()},l+(e+1)*u.uiOptions.robot.chainedResponseTime)}(h)
+;this.readyTimer=setTimeout(function(){t.onReadyCallback&&t.onReadyCallback(),t.onReadyCallback=null,!0===t._tag.skipUserInput&&setTimeout(function(){t._tag.flowManager.nextStep()},t.uiOptions.robot.chainedResponseTime)},l+c.length*this.uiOptions.robot.chainedResponseTime)}else{this.tryClearThinking(),this.textEl.innerHTML=""+e+"
";var p=this.textEl.getElementsByTagName("p");p[p.length-1].offsetWidth,p[p.length-1].classList.add("show"),this.scrollTo()}this.parsedResponse=e,this.addSelf(),this.textEl.removeAttribute("value-added"),setTimeout(function(){t.textEl.setAttribute("value-added",""),t.el.classList.add("peak-thumb")},0),this.checkForEditMode(),this.response=e.split("&&").join(" ")}},n.prototype.scrollTo=function(){var t=this.el.offsetTop,e=this.el.offsetHeight;this.container.scrollTop=t+e+this.container.scrollTop},n.prototype.checkForEditMode=function(){this.isRobotResponse||this.el.hasAttribute("thinking")||(this.el.classList.add("can-edit"),this.disabled=!1)},n.prototype.tryClearThinking=function(){this.el.hasAttribute("thinking")&&(this.textEl.innerHTML="",this.el.removeAttribute("thinking"))},n.prototype.setToThinking=function(){(this.isRobotResponse&&0!==this.uiOptions.robot.robotResponseTime||!this.isRobotResponse&&this.cfReference.uiOptions.user.showThinking&&!this._tag.skipUserInput)&&(this.textEl.innerHTML=n.THINKING_MARKUP,this.el.classList.remove("can-edit"),this.el.setAttribute("thinking","")),(this.cfReference.uiOptions.user.showThinking||this.cfReference.uiOptions.user.showThumb)&&this.addSelf()},n.prototype.addSelf=function(){this.el.parentNode!=this.container&&this.container.appendChild(this.el)},n.prototype.onClick=function(e){this.setToThinking(),t.ConversationalForm.illustrateFlow(this,"dispatch",t.ChatResponseEvents.USER_ANSWER_CLICKED,e),this.eventTarget.dispatchEvent(new CustomEvent(t.ChatResponseEvents.USER_ANSWER_CLICKED,{detail:this._tag}))},n.prototype.setData=function(t){this.image=t.image,this.response=this.originalResponse=t.response,this.isRobotResponse=t.isRobotResponse,e.prototype.setData.call(this,t)},n.prototype.onElementCreated=function(){var t=this;this.textEl=this.el.getElementsByTagName("text")[0],this.updateThumbnail(this.image),this.isRobotResponse||null!=this.response?setTimeout(function(){t.setValue({text:t.response})},0):this.cfReference.uiOptions.user.showThumb&&this.el.classList.add("peak-thumb")},n.prototype.dealloc=function(){clearTimeout(this.readyTimer),this.container=null,this.uiOptions=null,this.onReadyCallback=null,this.onClickCallback&&(this.el.removeEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1),this.onClickCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return'\n\t\t\t\t \n\t\t\t\t \n\t\t\t '},n.THINKING_MARKUP=". . .
",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t \n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.71",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/development-cf-robot-message.html b/src/development-cf-robot-message.html
index 47e978726..2637ee8fe 100644
--- a/src/development-cf-robot-message.html
+++ b/src/development-cf-robot-message.html
@@ -181,18 +181,7 @@
src="../build/cf/logic/FlowManager.js"
>
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/styles/_cf-variables.scss b/src/styles/_cf-variables.scss
index 3e75180ac..cd84ad591 100644
--- a/src/styles/_cf-variables.scss
+++ b/src/styles/_cf-variables.scss
@@ -40,6 +40,7 @@ $cf-color-input-text: $cf-color-secondary !default;
$cf-input-field-height: relativeValue(45px) !default;
$cf-input-field-border-radius: relativeValue(0) !default;
$cf-input-submit-background: none !default;
+$cf-input-icon-color: $cf-color-primary !default;
$cf-input-font-size: $cf-base-font-size !default;
$cf-input-color-error-text: $cf-color-error !default;
diff --git a/src/styles/mixins/_cf-mixins.scss b/src/styles/mixins/_cf-mixins.scss
index ddde0514b..903ef2fcf 100644
--- a/src/styles/mixins/_cf-mixins.scss
+++ b/src/styles/mixins/_cf-mixins.scss
@@ -5,5 +5,5 @@
$pixels: $pixels * 1px;
}
- @return $pixels * ($cf-base-font-size/$base-size);
+ @return round( $pixels * ($cf-base-font-size/$base-size) );
}
\ No newline at end of file
diff --git a/src/styles/ui/_cf-input.scss b/src/styles/ui/_cf-input.scss
index 36d77da6a..387a1aa8e 100644
--- a/src/styles/ui/_cf-input.scss
+++ b/src/styles/ui/_cf-input.scss
@@ -32,7 +32,7 @@ cf-input {
input, textarea {
resize: none;
overflow: hidden;
- padding: calc((#{$cf-input-field-height} - 2px - #{$cf-input-font-size})/2) calc(#{$cf-input-field-height} - 6px) calc((#{$cf-input-field-height} - 2px - #{$cf-input-font-size})/2) 15px;
+ padding: calc((#{$cf-input-field-height} - 2px - #{$cf-input-font-size})/2) calc(#{$cf-input-field-height} - 6px) calc((#{$cf-input-field-height} - 2px - #{$cf-input-font-size})/2) calc((#{$cf-input-field-height} - 2px - #{$cf-input-font-size})/2);
}
input, textarea {
@@ -301,21 +301,21 @@ cf-input-button.cf-input-button {
div.cf-icon-attachment {
transform: rotateX(90deg);
opacity: 0;
- background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='"+ $cf-color-primary + "'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
+ background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='12px' height='16px' viewBox='0 0 12 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg transform='translate(-573.000000, -605.000000)' stroke='"+ $cf-input-icon-color + "'%3e%3cg transform='translate(84.000000, 136.000000)'%3e%3cg transform='translate(1.000000, 456.000000)'%3e%3cpath d='M499,23.1092437 L499,18.907563 C499,16.2016807 496.756849,14 494,14 C491.243151,14 489,16.2016807 489,18.907563 L489,24.5042017 C489,26.4369748 490.592466,28 492.561644,28 C494.530822,28 496.123288,26.4369748 496.123288,24.5042017 L496.123288,18.907563 C496.140411,17.7478992 495.181507,16.8067227 494,16.8067227 C492.818493,16.8067227 491.859589,17.7478992 491.859589,18.907563 L491.859589,23.1092437'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
background-size: relativeValue(12px) relativeValue(16px);
}
div.cf-icon-progress {
transform: rotateX(0deg);
opacity: 1;
- background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='"+ $cf-color-primary + "'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
+ background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='30px' height='30px' viewBox='0 0 30 30' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3e%3cg fill='"+ $cf-input-icon-color + "'%3e%3cpolygon transform='translate(15.500000, 15.500000) rotate(90.000000) translate(-15.500000, -15.500000) ' points='22 14.6875 12.111875 14.6875 16.6496875 10.1496875 15.5 9 9 15.5 15.5 22 16.6496875 20.8503125 12.111875 16.3125 22 16.3125'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
background-size: relativeValue(30px) relativeValue(30px);
}
div.cf-icon-audio {
transform: rotateX(0deg);
opacity: 1;
- background-image: url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='" + $cf-color-primary + "' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e ");
+ background-image: url("data:image/svg+xml;charset=UTF-8,%3c?xml version='1.0' encoding='utf-8'?%3e%3c!-- Generator: Adobe Illustrator 16.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e%3c!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='512px' height='512px' fill='" + $cf-input-icon-color + "' viewBox='0 0 512 512' enable-background='new 0 0 512 512' xml:space='preserve'%3e%3cg%3e%3cpath d='M256,320c37.712,0,68.571-30.924,68.571-68.714V100.714C324.571,62.924,293.712,32,256,32s-68.571,30.924-68.571,68.714 v150.572C187.429,289.076,218.288,320,256,320z M377.139,244.548c0,68.714-58.282,116.815-121.139,116.815 s-121.139-48.102-121.139-116.815H96c0,77.873,61.719,143.153,137.144,153.465V480h45.713v-81.987 C354.281,386.561,416,322.421,416,244.548H377.139z'/%3e%3c/g%3e%3c/svg%3e ");
background-size: relativeValue(26px) relativeValue(26px);
}
From 0a9506e2db13cc321a4dddaa0e5a669df30a2d76 Mon Sep 17 00:00:00 2001
From: Jens Sogaard
Date: Wed, 28 Feb 2018 13:17:05 -0500
Subject: [PATCH 6/6] Prepped docs and dist files for 0.9.80 release
---
README.md | 6 +-
bower.json | 2 +-
dist/conversational-form.js | 2 +-
dist/conversational-form.min.js | 2 +-
docs/0.9.80/DOM-element-attributes/index.html | 224 +
docs/0.9.80/appearance/index.html | 151 +
docs/0.9.80/assets/favicon.ico | Bin 0 -> 15086 bytes
docs/0.9.80/assets/formless.json | 107 +
docs/0.9.80/assets/logo.svg | 1 +
docs/0.9.80/assets/prism.css | 244 +
docs/0.9.80/assets/prism.js | 13 +
docs/0.9.80/assets/readme-cf.gif | Bin 0 -> 1750172 bytes
docs/0.9.80/assets/share_img.jpg | Bin 0 -> 32378 bytes
docs/0.9.80/assets/space10.svg | 1 +
docs/0.9.80/build-the-source/index.html | 170 +
docs/0.9.80/credits/index.html | 144 +
docs/0.9.80/css/style.css | 6603 +++++++++++++++++
docs/0.9.80/events/index.html | 263 +
.../functionality/cf-robot-message/index.html | 189 +
.../index.html | 232 +
.../conditionals-and-branching/index.html | 235 +
.../custom-error-message/index.html | 192 +
.../custom-placeholder/index.html | 188 +
.../functionality/custom-questions/index.html | 212 +
.../functionality/flowStepCallback/index.html | 189 +
docs/0.9.80/functionality/formless/index.html | 224 +
.../functionality/image-answers/index.html | 196 +
docs/0.9.80/functionality/index.html | 221 +
.../labels-on-radio-checkbox/index.html | 190 +
.../functionality/submit-callback/index.html | 188 +
.../functionality/validation/index.html | 232 +
.../functionality/value-piping/index.html | 197 +
docs/0.9.80/functionality/voice/index.html | 269 +
docs/0.9.80/getting-started/index.html | 268 +
.../previous-versions/index.html | 174 +
docs/0.9.80/index.html | 12 +
docs/0.9.80/integrations/index.html | 166 +
docs/0.9.80/js/documentation.js | 19 +
docs/0.9.80/localization/index.html | 146 +
docs/0.9.80/options/index.html | 282 +
docs/0.9.80/public-api/index.html | 219 +
docs/0.9.80/src/layout.twig | 204 +
docs/0.9.80/src/navbar.twig | 41 +
.../pages/DOM-element-attributes/index.twig | 94 +
docs/0.9.80/src/pages/appearance/index.twig | 18 +
.../src/pages/build-the-source/index.twig | 38 +
docs/0.9.80/src/pages/credits/index.twig | 11 +
docs/0.9.80/src/pages/events/index.twig | 159 +
.../functionality/cf-robot-message/index.twig | 17 +
.../conditionals-and-branching/index.twig | 63 +
.../custom-error-message/index.twig | 18 +
.../custom-placeholder/index.twig | 13 +
.../functionality/custom-questions/index.twig | 38 +
.../functionality/flowStepCallback/index.twig | 15 +
.../pages/functionality/formless/index.twig | 49 +
.../functionality/image-answers/index.twig | 21 +
.../0.9.80/src/pages/functionality/index.twig | 44 +
.../labels-on-radio-checkbox/index.twig | 16 +
.../functionality/submit-callback/index.twig | 13 +
.../pages/functionality/validation/index.twig | 57 +
.../functionality/value-piping/index.twig | 22 +
.../src/pages/functionality/voice/index.twig | 97 +
.../src/pages/getting-started/index.twig | 138 +
.../previous-versions/index.twig | 45 +
docs/0.9.80/src/pages/integrations/index.twig | 40 +
docs/0.9.80/src/pages/localization/index.twig | 14 +
docs/0.9.80/src/pages/options/index.twig | 150 +
docs/0.9.80/src/pages/public-api/index.twig | 89 +
docs/0.9.80/src/scss/_anchor.scss | 20 +
docs/0.9.80/src/scss/_cf-context.scss | 31 +
docs/0.9.80/src/scss/_clipboard.scss | 25 +
docs/0.9.80/src/scss/_codepen.scss | 6 +
docs/0.9.80/src/scss/_highlight.scss | 5 +
docs/0.9.80/src/scss/_inbox.scss | 187 +
docs/0.9.80/src/scss/_options-table.scss | 19 +
docs/0.9.80/src/scss/_variables.scss | 3 +
docs/0.9.80/src/scss/style.scss | 128 +
docs/index.html | 2 +-
gulp-tasks/documentation.js | 6 +-
package.json | 2 +-
src/scripts/cf/ConversationalForm.ts | 2 +-
...evelopment-cf-robot-message--formless.html | 526 --
82 files changed, 14323 insertions(+), 536 deletions(-)
create mode 100644 docs/0.9.80/DOM-element-attributes/index.html
create mode 100644 docs/0.9.80/appearance/index.html
create mode 100644 docs/0.9.80/assets/favicon.ico
create mode 100644 docs/0.9.80/assets/formless.json
create mode 100644 docs/0.9.80/assets/logo.svg
create mode 100644 docs/0.9.80/assets/prism.css
create mode 100644 docs/0.9.80/assets/prism.js
create mode 100644 docs/0.9.80/assets/readme-cf.gif
create mode 100644 docs/0.9.80/assets/share_img.jpg
create mode 100644 docs/0.9.80/assets/space10.svg
create mode 100644 docs/0.9.80/build-the-source/index.html
create mode 100644 docs/0.9.80/credits/index.html
create mode 100644 docs/0.9.80/css/style.css
create mode 100644 docs/0.9.80/events/index.html
create mode 100644 docs/0.9.80/functionality/cf-robot-message/index.html
create mode 100644 docs/0.9.80/functionality/conditionals-and-branching copy/index.html
create mode 100644 docs/0.9.80/functionality/conditionals-and-branching/index.html
create mode 100644 docs/0.9.80/functionality/custom-error-message/index.html
create mode 100644 docs/0.9.80/functionality/custom-placeholder/index.html
create mode 100644 docs/0.9.80/functionality/custom-questions/index.html
create mode 100644 docs/0.9.80/functionality/flowStepCallback/index.html
create mode 100644 docs/0.9.80/functionality/formless/index.html
create mode 100644 docs/0.9.80/functionality/image-answers/index.html
create mode 100644 docs/0.9.80/functionality/index.html
create mode 100644 docs/0.9.80/functionality/labels-on-radio-checkbox/index.html
create mode 100644 docs/0.9.80/functionality/submit-callback/index.html
create mode 100644 docs/0.9.80/functionality/validation/index.html
create mode 100644 docs/0.9.80/functionality/value-piping/index.html
create mode 100644 docs/0.9.80/functionality/voice/index.html
create mode 100644 docs/0.9.80/getting-started/index.html
create mode 100644 docs/0.9.80/getting-started/previous-versions/index.html
create mode 100644 docs/0.9.80/index.html
create mode 100644 docs/0.9.80/integrations/index.html
create mode 100644 docs/0.9.80/js/documentation.js
create mode 100644 docs/0.9.80/localization/index.html
create mode 100644 docs/0.9.80/options/index.html
create mode 100644 docs/0.9.80/public-api/index.html
create mode 100644 docs/0.9.80/src/layout.twig
create mode 100644 docs/0.9.80/src/navbar.twig
create mode 100644 docs/0.9.80/src/pages/DOM-element-attributes/index.twig
create mode 100644 docs/0.9.80/src/pages/appearance/index.twig
create mode 100644 docs/0.9.80/src/pages/build-the-source/index.twig
create mode 100644 docs/0.9.80/src/pages/credits/index.twig
create mode 100644 docs/0.9.80/src/pages/events/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/cf-robot-message/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/conditionals-and-branching/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/custom-error-message/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/custom-placeholder/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/custom-questions/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/flowStepCallback/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/formless/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/image-answers/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/labels-on-radio-checkbox/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/submit-callback/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/validation/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/value-piping/index.twig
create mode 100644 docs/0.9.80/src/pages/functionality/voice/index.twig
create mode 100644 docs/0.9.80/src/pages/getting-started/index.twig
create mode 100644 docs/0.9.80/src/pages/getting-started/previous-versions/index.twig
create mode 100644 docs/0.9.80/src/pages/integrations/index.twig
create mode 100644 docs/0.9.80/src/pages/localization/index.twig
create mode 100644 docs/0.9.80/src/pages/options/index.twig
create mode 100644 docs/0.9.80/src/pages/public-api/index.twig
create mode 100644 docs/0.9.80/src/scss/_anchor.scss
create mode 100644 docs/0.9.80/src/scss/_cf-context.scss
create mode 100644 docs/0.9.80/src/scss/_clipboard.scss
create mode 100644 docs/0.9.80/src/scss/_codepen.scss
create mode 100644 docs/0.9.80/src/scss/_highlight.scss
create mode 100644 docs/0.9.80/src/scss/_inbox.scss
create mode 100644 docs/0.9.80/src/scss/_options-table.scss
create mode 100644 docs/0.9.80/src/scss/_variables.scss
create mode 100644 docs/0.9.80/src/scss/style.scss
delete mode 100644 src/scripts/development-cf-robot-message--formless.html
diff --git a/README.md b/README.md
index 55d264ee1..a7d5480db 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
Learn why we did it
- Explore Conversational Form docs »
+ Explore Conversational Form docs »
@@ -17,7 +17,7 @@
Include ConversationalForm in your page:
```html
-
+
```
Or download the latest release:
- Clone the repo: ````git clone https://github.com/space10-community/conversational-form.git````
@@ -33,7 +33,7 @@ ConversationalForm will automatically look through the DOM for a form element wi
[jsbin](https://jsbin.com/vopuxukaze/edit?html,js,output)
-Read the [Getting started](https://space10-community.github.io/conversational-form/docs/0.9.71/getting-started/) page for information on the framework contents, options, templates and examples and more.
+Read the [Getting started](https://space10-community.github.io/conversational-form/docs/0.9.80/getting-started/) page for information on the framework contents, options, templates and examples and more.
## Status
[![npm version](https://img.shields.io/npm/v/conversational-form.svg)](https://www.npmjs.com/package/conversational-form)
diff --git a/bower.json b/bower.json
index 5147dce6a..27bb46456 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "conversational-form",
- "version": "0.9.6",
+ "version": "0.9.80",
"authors": [
{
"name" : "Daniel Friis",
diff --git a/dist/conversational-form.js b/dist/conversational-form.js
index 137c13a6e..205ea011b 100644
--- a/dist/conversational-form.js
+++ b/dist/conversational-form.js
@@ -5432,7 +5432,7 @@ var cf;
(function (cf_1) {
var ConversationalForm = /** @class */ (function () {
function ConversationalForm(options) {
- this.version = "0.9.71";
+ this.version = "0.9.80";
this.cdnPath = "https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/";
this.isDevelopment = false;
this.loadExternalStyleSheet = true;
diff --git a/dist/conversational-form.min.js b/dist/conversational-form.min.js
index 9970b6908..20a23825b 100644
--- a/dist/conversational-form.min.js
+++ b/dist/conversational-form.min.js
@@ -1,4 +1,4 @@
!function(t){function e(){}function n(t,e){return function(){t.apply(e,arguments)}}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(t,this)}function o(t,e){for(;3===t._state;)t=t._value;if(0===t._state)return void t._deferreds.push(e);t._handled=!0,i._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null===n)return void(1===t._state?s:r)(e.promise,t._value);var i;try{i=n(t._value)}catch(t){return void r(e.promise,t)}s(e.promise,i)})}function s(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if(e instanceof i)return t._state=3,t._value=e,void a(t);if("function"==typeof o)return void c(n(o,e),t)}t._state=1,t._value=e,a(t)}catch(e){r(t,e)}}function r(t,e){t._state=2,t._value=e,a(t)}function a(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e0||!!navigator.userAgent.match(/Trident.*rv\:11\./)},t.getValuesOfBars=function(t){var e=t.split("||");return e.length<=1&&(e=t.split("|")),e},t.setTransform=function(t,e){t.style["-webkit-transform"]=e,t.style["-moz-transform"]=e,t.style["-ms-transform"]=e,t.style.transform=e},t.extendObject=function(t,e){for(var n in e)e[n]&&e[n].constructor&&e[n].constructor===Object?(t[n]=t[n]||{},arguments.callee(t[n],e[n])):t[n]=e[n];return t},t.caniuse={fileReader:function(){return!!(window.File&&window.FileReader&&window.FileList&&window.Blob)}},t}();t.Helpers=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(t){void 0===t&&(t=null),this._cf=t,this.target=document.createDocumentFragment()}return Object.defineProperty(t.prototype,"cf",{get:function(){return this._cf},set:function(t){this._cf=t},enumerable:!0,configurable:!0}),t.prototype.addEventListener=function(t,e,n){return this.target.addEventListener(t,e,n)},t.prototype.dispatchEvent=function(t){return this.target.dispatchEvent(t)},t.prototype.removeEventListener=function(t,e,n){this.target.removeEventListener(t,e,n)},t}();t.EventDispatcher=e}(cf||(cf={}));var cf;!function(t){var e=function(){function t(){}return t.parseTag=function(t){var e=document.createElement(t.tag);e.setAttribute("cf-formless","");for(var n in t)"tag"!==n&&"children"!==n&&e.setAttribute(n,t[n]);return e},t.parseGroupTag=function(e){for(var n=t.parseTag(e),i=e.children,o=0;o0)for(var r=0;r ':"")+t.Helpers.getInnerTextOfElement(this.el)}else e=t.Helpers.getInnerTextOfElement(this.el);return e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"positionVector",{get:function(){return this._positionVector},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tabIndex",{set:function(t){this.el.tabIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"highlight",{get:function(){return this.el.classList.contains("highlight")},set:function(t){t?this.el.classList.add("highlight"):this.el.classList.remove("highlight")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"focus",{get:function(){return this._focus},set:function(t){this._focus=t,this._focus?this.el.focus():this.el.blur()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return!this.el.classList.contains("hide")},set:function(t){t?this.el.classList.remove("hide"):(this.el.classList.add("hide"),this.tabIndex=-1,this.highlight=!1)},enumerable:!0,configurable:!0}),n.prototype.onBlur=function(t){this._focus=!1},n.prototype.onFocus=function(e){this._focus=!0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.ON_FOCUS,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.ON_FOCUS,{detail:this.positionVector}))},n.prototype.hasImage=function(){return!1},n.prototype.calcPosition=function(){var t=parseInt(window.getComputedStyle(this.el).getPropertyValue("margin-right"),10);this._positionVector={height:this.el.offsetHeight,width:this.el.offsetWidth+t,x:this.el.offsetLeft,y:this.el.offsetTop,el:this},this._positionVector.centerX=this._positionVector.x+.5*this._positionVector.width,this._positionVector.centerY=this._positionVector.y+.5*this._positionVector.height},n.prototype.setData=function(t){this.referenceTag=t.referenceTag,e.prototype.setData.call(this,t)},n.prototype.animateIn=function(){clearTimeout(this.animateInTimer),this.el.classList.add("animate-in")},n.prototype.animateOut=function(){this.el.classList.add("animate-out")},n.prototype.onChoose=function(){t.ConversationalForm.illustrateFlow(this,"dispatch",t.ControlElementEvents.SUBMIT_VALUE,this.referenceTag),this.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.SUBMIT_VALUE,{detail:this}))},n.prototype.dealloc=function(){this.el.removeEventListener("blur",this.onBlurCallback,!1),this.onBlurCallback=null,this.el.removeEventListener("focus",this.onFocusCallback,!1),this.onFocusCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ControlElement=e}(cf||(cf={}));var cf;!function(t){t.ControlElementsEvents={ON_RESIZE:"cf-on-control-elements-resize",CHANGED:"cf-on-control-elements-changed"};var e=function(){function e(e){this.animateInFromReponseTimer=0,this.ignoreKeyboardInput=!1,this.rowIndex=-1,this.columnIndex=0,this.elementWidth=0,this.filterListNumberOfVisible=0,this.listWidth=0,this.el=e.el,this.eventTarget=e.eventTarget,this.cfReference=e.cfReference,this.list=this.el.getElementsByTagName("cf-list")[0],this.infoElement=e.infoEl,this.onScrollCallback=this.onScroll.bind(this),this.el.addEventListener("scroll",this.onScrollCallback,!1),this.onResizeCallback=this.onResize.bind(this),window.addEventListener("resize",this.onResizeCallback,!1),this.onElementFocusCallback=this.onElementFocus.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_FOCUS,this.onElementFocusCallback,!1),this.onElementLoadedCallback=this.onElementLoaded.bind(this),this.eventTarget.addEventListener(t.ControlElementEvents.ON_LOADED,this.onElementLoadedCallback,!1),this.onChatReponsesUpdatedCallback=this.onChatReponsesUpdated.bind(this),this.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onUserInputKeyChangeCallback=this.onUserInputKeyChange.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,this.onUserInputKeyChangeCallback,!1),this.userInputUpdateCallback=this.onUserInputUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.listScrollController=new t.ScrollController({interactionListener:this.el,listToScroll:this.list,eventTarget:this.eventTarget,listNavButtons:this.el.getElementsByTagName("cf-list-button")})}return Object.defineProperty(e.prototype,"active",{get:function(){return this.elements&&this.elements.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focus",{get:function(){if(!this.elements)return!1;for(var t=this.getElements(),e=0;ethis.tableableRows[this.rowIndex].length-1&&(this.columnIndex=0),!0):(this.resetTabList(),!1)},e.prototype.updateRowIndex=function(t){var e=this.rowIndex;if(this.rowIndex+=t,this.tableableRows[this.rowIndex])for(var n=this.tableableRows[e]?this.tableableRows[e][this.columnIndex].positionVector.centerX:0,i=this.tableableRows[this.rowIndex],o=1e13,s=0;sMath.abs(n-r.positionVector.centerX)&&(o=Math.abs(n-r.positionVector.centerX),this.columnIndex=s)}},e.prototype.resetTabList=function(){this.rowIndex=-1,this.columnIndex=-1},e.prototype.onUserInputUpdate=function(t){if(this.el.classList.remove("animate-in"),this.infoElement.classList.remove("show"),this.elements)for(var e=this.getElements(),n=0;n1){for(var o=[],s=0;s0&&(o[0].highlight=!0)}},e.prototype.clickOnHighlighted=function(){for(var t=this.getElements(),e=0;e0){this.el.classList.contains("animate-in")||this.el.classList.add("animate-in");for(var e=0;e0&&"OptionsList"==this.elements[0].type?this.elements[0].elements:this.elements},e.prototype.buildTabableRows=function(){this.tableableRows=[],this.resetTabList();var t=this.getElements();if(this.el.classList.contains("two-row")){this.tableableRows[0]=[],this.tableableRows[1]=[];for(var e=0;e0)switch(this.elements[0].type){case"CheckboxButton":for(var n=0,i=[],o=0;o1)break}for(var o=0;o1&&(s.partOfSeveralChoices=!0),i.push(s.value)),e.controlElements.push(s)}e.text=t.Dictionary.parseAndGetMultiValueString(i);break;case"RadioButton":for(var o=0;o0;)this.elements.pop().dealloc();this.list.innerHTML="",this.onListChanged()},e.prototype.buildTags=function(e){var n=this;this.disabled=!1;this.el.parentNode.getElementsByTagName("ul")[0],this.el.parentNode.getElementsByTagName("ul")[1];this.clearTagsAndReset(),this.elements=[];for(var i=0;i0){var s=this.elements[this.elements.length-1];this.list.appendChild(s.el)}}var r=this.elements[0]&&"OptionsList"==this.elements[0].type;this.filterListNumberOfVisible=r?this.elements[0].elements.length:e.length,new Promise(function(t,e){return n.resize(t,e)}).then(function(){var e=n.list.offsetHeight,i={height:e};n.onListChanged(),t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.CONTROL_ELEMENTS_ADDED,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.CONTROL_ELEMENTS_ADDED,{detail:i}))})},e.prototype.onResize=function(t){this.resize()},e.prototype.resize=function(e,n){this.list.style.width="100%",this.el.classList.remove("resized"),this.el.classList.remove("one-row"),this.el.classList.remove("two-row"),this.elementWidth=0,this.listWidth=0;var i=this.getElements();if(i&&i.length>0){for(var o=[],s=[],r=!1,a=0;ac;u&&!r?(this.el.classList.add("two-row"),this.listWidth=Math.max(c,Math.round(o[Math.floor(o.length/2)]+50)),this.list.style.width=this.listWidth+"px"):this.el.classList.add("one-row");for(var a=0;ac;for(var h=i.slice(),p=h.sort(function(t,e){var n=t.positionVector.y>e.positionVector.y;return t.positionVector.x==e.positionVector.x?n?1:-1:t.positionVector.x0&&(this.xTarget+=(0-this.xTarget)*t.Helpers.lerp(e.accerlation,.3,.8)),this.xTargetthis.max&&(this.nextButton.classList.contains("active")||this.nextButton.classList.add("active"),this.nextButton.classList.contains("cf-gradient")||this.nextButton.classList.add("cf-gradient")),i<=this.max&&(this.nextButton.classList.contains("active")&&this.nextButton.classList.remove("active"),this.nextButton.classList.contains("cf-gradient")&&this.nextButton.classList.remove("cf-gradient"));var o=this.x;t.Helpers.setTransform(this.listToScroll,"translateX("+o+"px)"),(this.interacting||Math.abs(this.x-this.xTarget)>.02&&!this.interacting)&&(this.rAF=window.requestAnimationFrame(function(){return n.render()}))},e.prototype.setScroll=function(t,e){this.xTarget=this.visibleAreaWidth==this.listWidth?0:t,this.render()},e.prototype.pushDirection=function(t){this.inputAccerlationTarget+=5e3*t,this.render()},e.prototype.dealloc=function(){this.prevButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.nextButton.removeEventListener("click",this.onListNavButtonsClickCallback,!1),this.onListNavButtonsClickCallback=null,this.prevButton=null,this.nextButton=null,document.removeEventListener("mouseleave",this.documentLeaveCallback,!1),document.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.documentLeaveCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousedown"),this.onInteractStartCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mouseup"),this.onInteractEndCallback,!1),this.interactionListener.removeEventListener(t.Helpers.getMouseEvent("mousemove"),this.onInteractMoveCallback,!1),this.documentLeaveCallback=null,this.onInteractStartCallback=null,this.onInteractEndCallback=null,this.onInteractMoveCallback=null},e.prototype.reset=function(){this.interacting=!1,this.startX=0,this.startXTarget=this.startX,this.inputAccerlation=0,this.x=0,this.xTarget=0,t.Helpers.setTransform(this.listToScroll,"translateX(0px)"),this.render(),this.prevButton.classList.remove("active"),this.nextButton.classList.remove("active")},e.prototype.resize=function(t,e){this.reset(),this.visibleAreaWidth=e,this.listWidth=Math.max(e,t),this.max=-1*(this.listWidth-this.visibleAreaWidth),this.render()},e.accerlation=.1,e}();t.ScrollController=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(t){this.data={"user-image":"https://cf-4053.kxcdn.com/conversational-form/human.png","entry-not-found":"Dictionary item not found.","awaiting-mic-permission":"Awaiting mic permission","user-audio-reponse-invalid":"I didn't get that, try again.","microphone-terminal-error":"Audio input not supported","input-placeholder":"Type your answer here ...","group-placeholder":"Type to filter list ...","input-placeholder-error":"Your input is not correct ...","input-placeholder-required":"Input is required ...","input-placeholder-file-error":"File upload failed ...","input-placeholder-file-size-error":"File size too big ...","input-no-filter":"No results found for {input-value} ","user-reponse-and":" and ","user-reponse-missing":"Missing input ...","user-reponse-missing-group":"Nothing selected ...",general:"General type1||General type2","icon-type-file":" "},this.robotData={"robot-image":"https://cf-4053.kxcdn.com/conversational-form/robot.png",input:"Please write some text.",text:"Please write some text.",checkbox:"Select as many as you want.",name:"What's your name?",
email:"Need your e-mail.",password:"Please provide password",tel:"What's your phone number?",radio:"I need you to select one of these.",select:"Choose any of these options.",file:"Select a file to upload.",general:"General1||General2||General3.."},e.instance=this,t&&t.data&&(this.data=this.validateAndSetNewData(t.data,this.data)),t.userImage&&(this.data["user-image"]=t.userImage),t.robotImage&&(this.robotData["robot-image"]=t.robotImage),t&&t.robotData&&(this.robotData=this.validateAndSetNewData(t.robotData,this.robotData))}return e.get=function(n){var i=e.instance,o=i.data[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else o=i.data["entry-not-found"];return o},e.set=function(t,n,i){var o=e.instance,s="robot"==n?o.robotData:o.data;return s[t]=i,s[t]},e.getRobotResponse=function(n){var i=e.instance,o=i.robotData[n];if(o){var s=t.Helpers.getValuesOfBars(o);o=s[Math.floor(Math.random()*s.length)]}else{var r=t.Helpers.getValuesOfBars(i.robotData.general);o=r[Math.floor(Math.random()*r.length)]}return o},e.parseAndGetMultiValueString=function(t){for(var n="",i=0;i1&&i==t.length-2?e.get("user-reponse-and"):", ";n+=o+(i Tag registered:",this.type,this)),this.refresh()}return Object.defineProperty(Tag.prototype,"type",{get:function(){return this.domElement.getAttribute("type")||this.domElement.tagName.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"name",{get:function(){return this.domElement.getAttribute("name")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"id",{get:function(){return this.domElement.getAttribute("id")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"inputPlaceholder",{get:function(){return this._inputPlaceholder},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"formless",{get:function(){return cf.TagsParser.isElementFormless(this.domElement)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"label",{get:function(){return this.getLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"value",{get:function(){return this.domElement.value||this.initialDefaultValue},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"hasImage",{get:function(){return this.domElement.hasAttribute("cf-image")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"disabled",{get:function(){return!this.checkConditionalAndIsValid()||void 0!=this.domElement.getAttribute("disabled")&&null!=this.domElement.getAttribute("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"required",{get:function(){return!!this.domElement.getAttribute("required")||""==this.domElement.getAttribute("required")},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"question",{get:function(){return this.questions&&0!=this.questions.length?this.questions[Math.floor(Math.random()*this.questions.length)]:cf.Dictionary.getRobotResponse(this.type)},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"eventTarget",{set:function(t){this._eventTarget=t},enumerable:!0,configurable:!0}),Object.defineProperty(Tag.prototype,"errorMessage",{get:function(){return this.errorMessages||(this.domElement.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.getAttribute("cf-error")):this.domElement.parentNode&&this.domElement.parentNode.getAttribute("cf-error")?this.errorMessages=cf.Helpers.getValuesOfBars(this.domElement.parentNode.getAttribute("cf-error")):this.required?this.errorMessages=[cf.Dictionary.get("input-placeholder-required")]:"file"==this.type?this.errorMessages=[cf.Dictionary.get("input-placeholder-file-error")]:this.errorMessages=[cf.Dictionary.get("input-placeholder-error")]),this.errorMessages[Math.floor(Math.random()*this.errorMessages.length)]},enumerable:!0,configurable:!0}),Tag.prototype.dealloc=function(){this.domElement.removeEventListener("change",this.changeCallback,!1),this.changeCallback=null,this.domElement=null,this.defaultValue=null,this.errorMessages=null,this.pattern=null,this._label=null,this.validationCallback=null,this.questions=null},Tag.testConditions=function(t,e){var n=function(e,n){return"object"==typeof n?n.test(e):t===n};if("string"==typeof t){for(var i=t,o=!1,s=0;s0},Tag.prototype.checkConditionalAndIsValid=function(){return!this.hasConditions()||this.flowManager.areConditionsInFlowFullfilled(this,this.conditionalTags)},Tag.prototype.setTagValueAndIsValid=function(t){var e=!0,n=t.text;this.pattern&&(e=this.pattern.test(n)),""==n&&this.required&&(e=!1);var i=parseInt(this.domElement.getAttribute("minlength"),10)||-1,o=parseInt(this.domElement.getAttribute("maxlength"),10)||-1;return-1!=i&&n.lengtho&&(e=!1),e&&"file"!=this.type&&(this.domElement.value=n),e},Tag.prototype.getLabel=function(){return this._label||this.findAndSetLabel(),this._label?this._label:cf.Dictionary.getRobotResponse(this.type)},Tag.prototype.findConditionalAttributes=function(){var t=this.domElement.attributes;if(t.length>0){this.conditionalTags=[];for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(n&&n.name&&-1!==n.name.indexOf("cf-conditional")){for(var i=[],o=-1!==n.value.indexOf("||")?n.value.split("||"):n.value.split("&&"),s=0;s0&&(e=[t])}else if(e.length>0)for(var i=0;i TagGroup registered:",this.elements[0].type,this)),this.skipUserInput=!1}return Object.defineProperty(e.prototype,"required",{get:function(){for(var t=0;t0)return this.questions[Math.floor(Math.random()*this.questions.length)];if(this.elements[0]&&this.elements[0].question){return this.elements[0].question}return t.Dictionary.getRobotResponse(this.getGroupTagType())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeElements",{get:function(){return this._activeElements},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._values?this._values:[""]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){for(var t=0,e=0;e\n\t\t\t\t'+this.referenceTag.label+"\n\t\t\t\n\t\t\t"},n}(t.ControlElement);t.Button=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"RadioButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.el.hasAttribute("checked")&&"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){this.checked=!0,t.prototype.onClick.call(this,e)},e.prototype.getTemplate=function(){return'\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t"+this.referenceTag.label+" \n\t\t\t\t
\n\t\t\t \n\t\t\t"},e}(t.Button);t.RadioButton=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return"CheckboxButton"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return"checked"==this.el.getAttribute("checked")},set:function(t){t?(this.el.setAttribute("checked","checked"),this.referenceTag.domElement.setAttribute("checked","checked"),this.referenceTag.domElement.checked=!0):(this.el.removeAttribute("checked"),this.referenceTag.domElement.removeAttribute("checked"),this.referenceTag.domElement.checked=!1)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(t){this.checked=!this.checked},e.prototype.getTemplate=function(){var t=this.referenceTag.domElement.checked&&this.referenceTag.domElement.hasAttribute("checked");return'";return t+="",this.isMultiChoice&&(t+=" "),t+=this.referenceTag.label,t+="
",t+=" "},n}(t.Button);t.OptionButton=e}(cf||(cf={}));var cf;!function(t){var e=function(){function e(e){this.context=e.context,this.eventTarget=e.eventTarget,this.referenceTag=e.referenceTag,this.multiChoice=this.referenceTag.domElement.hasAttribute("multiple"),this.onOptionButtonClickCallback=this.onOptionButtonClick.bind(this),this.eventTarget.addEventListener(t.OptionButtonEvents.CLICK,this.onOptionButtonClickCallback,!1),this.createElements()}return Object.defineProperty(e.prototype,"type",{get:function(){return"OptionsList"},enumerable:!0,configurable:!0}),e.prototype.getValue=function(){for(var t=[],e=0;e0;)this.elements.pop().dealloc();this.elements=null},e}();t.OptionsList=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;if(i.maxFileSize=1e11,i.loading=!1,i.submitTimer=0,i._fileName="",i._readerResult="",!t.Helpers.caniuse.fileReader())throw new Error("Conversational Form Error: No FileReader available for client.");var o=i.referenceTag.domElement.getAttribute("cf-max-size")||i.referenceTag.domElement.getAttribute("max-size");if(o){var s=parseInt(o,10);i.maxFileSize=s}return i.progressBar=i.el.getElementsByTagName("cf-upload-file-progress-bar")[0],i.onDomElementChangeCallback=i.onDomElementChange.bind(i),i.referenceTag.domElement.addEventListener("change",i.onDomElementChangeCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.referenceTag.domElement.value},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"readerResult",{get:function(){return this._readerResult},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"files",{get:function(){return this._files},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"fileName",{get:function(){return this._fileName},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return"UploadFileUI"},enumerable:!0,configurable:!0}),n.prototype.getFilesAsString=function(){var e=document.createElement("span");return e.innerHTML=t.Dictionary.get("icon-type-file")+this.fileName,e.outerHTML},n.prototype.onDomElementChange=function(e){var n=this;t.ConversationalForm.suppressLog||console.log("...onDomElementChange");var i=new FileReader;this._files=this.referenceTag.domElement.files,i.onerror=function(e){t.ConversationalForm.suppressLog||console.log("onerror",e)},i.onprogress=function(e){t.ConversationalForm.suppressLog||console.log("onprogress",e),n.progressBar.style.width=e.loaded/e.total*100+"%"},i.onabort=function(e){t.ConversationalForm.suppressLog||console.log("onabort",e)},i.onloadstart=function(e){var o=n.files[0],s=o?o.size:n.maxFileSize+1;if(s>n.maxFileSize){i.abort();var r={errorText:t.Dictionary.get("input-placeholder-file-size-error")};t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,r),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:r}))}else{n._fileName=o.name,n.loading=!0,n.animateIn();var a=Math.floor(Math.log(s)/Math.log(1024)),l=["b","kb","mb","gb"];a=Math.min(l.length-1,a);var c=1*Number((s/Math.pow(1024,a)).toFixed(2))+" "+l[a],u=o.name+" ("+c+")";n.el.getElementsByTagName("cf-upload-file-text")[0].innerHTML=u,n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.BUSY}))}},i.onload=function(e){n._readerResult=e.target.result,n.progressBar.classList.add("loaded"),n.submitTimer=setTimeout(function(){n.el.classList.remove("animate-in"),n.onChoose(),
n.eventTarget.dispatchEvent(new CustomEvent(t.ControlElementEvents.PROGRESS_CHANGE,{detail:t.ControlElementProgressStates.READY}))},0)},i.readAsDataURL(this.files[0])},n.prototype.animateIn=function(){this.loading&&e.prototype.animateIn.call(this)},n.prototype.onClick=function(t){},n.prototype.triggerFileSelect=function(){this.referenceTag.domElement.click()},n.prototype.dealloc=function(){clearTimeout(this.submitTimer),this.progressBar=null,this.onDomElementChangeCallback&&(this.referenceTag.domElement.removeEventListener("change",this.onDomElementChangeCallback,!1),this.onDomElementChangeCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){"1"==this.referenceTag.value||this.referenceTag.domElement.hasAttribute("checked");return"\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t\t"},n}(t.Button);t.UploadFileUI=e}(cf||(cf={}));var cf;!function(t){t.MicrophoneBridgeEvent={ERROR:"cf-microphone-bridge-error",TERMNIAL_ERROR:"cf-microphone-bridge-terminal-error"};var e=function(){function e(e){this.currentTextResponse="",this._hasUserMedia=!1,this.inputErrorCount=0,this.inputCurrentError="",this.el=e.el,this.button=e.button,this.eventTarget=e.eventTarget,this.microphoneObj=e.microphoneObj,this.flowUpdateCallback=this.onFlowUpdate.bind(this),this.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1)}return Object.defineProperty(e.prototype,"hasUserMedia",{set:function(t){this._hasUserMedia=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{set:function(t){this.equalizer&&(this.equalizer.disabled=!t)},enumerable:!0,configurable:!0}),e.prototype.cancel=function(){this.button.loading=!1,this.microphoneObj.cancelInput&&this.microphoneObj.cancelInput()},e.prototype.onFlowUpdate=function(){var t=this;if(this.currentTextResponse=null,this._hasUserMedia)this.microphoneObj.awaitingCallback||this.callInput();else{var e=!1;window.navigator.mediaDevices&&window.navigator.mediaDevices.enumerateDevices().then(function(n){n.forEach(function(t){e||""===t.label||(e=!0)}),e&&t.getUserMedia()})}},e.prototype.getUserMedia=function(){var e=this;try{void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(t){var e=navigator.getUserMedia||window.navigator.webkitGetUserMedia||window.navigator.mozGetUserMedia;return e?new Promise(function(n,i){e.call(navigator,t,n,i)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({audio:!0}).then(function(t){e.currentStream=t,t.getAudioTracks().length>0?(e.hasUserMedia=!0,e.setupEqualizer(),e.microphoneObj.awaitingCallback||e.callInput()):e.hasUserMedia=!1}).catch(function(n){e.hasUserMedia=!1,e.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))})}catch(e){this.hasUserMedia=!1,this.eventTarget.dispatchEvent(new Event(t.MicrophoneBridgeEvent.TERMNIAL_ERROR))}},e.prototype.dealloc=function(){this.cancel(),this.promise=null,this.currentStream=null,this.equalizer&&this.equalizer.dealloc(),this.equalizer=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null},e.prototype.callInput=function(e){var n=this;void 0===e&&(e=0),this.button.loading=!0,this.equalizer&&(this.equalizer.disabled=!1),this.promise=new Promise(function(t,e){return n.microphoneObj.input(t,e,n.currentStream)}).then(function(e){if(n.promise=null,n.currentTextResponse=e.toString(),!n.currentTextResponse||""==n.currentTextResponse)return n.showError(t.Dictionary.get("user-audio-reponse-invalid")),void n.callInput();n.inputErrorCount=0,n.inputCurrentError="",n.button.loading=!1;var i={text:n.currentTextResponse};t.ConversationalForm.illustrateFlow(n,"dispatch",t.UserInputEvents.SUBMIT,i),n.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:i}))}).catch(function(e){n.isErrorTerminal(e)?(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)):(n.inputCurrentError!=e&&(n.inputErrorCount=0,n.inputCurrentError=e),n.inputErrorCount++,n.inputErrorCount>2?n.showError(e):(n.eventTarget.dispatchEvent(new CustomEvent(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,{detail:t.Dictionary.get("microphone-terminal-error")})),t.ConversationalForm.suppressLog||console.log("Conversational Form: Terminal error: ",e)))})},e.prototype.isErrorTerminal=function(t){return-1!==["network"].indexOf(t)},e.prototype.showError=function(e){var n={errorText:e};t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.USER_INPUT_INVALID,n),this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:n})),this.callInput()},e.prototype.setupEqualizer=function(){var t=this.el.getElementsByTagName("cf-icon-audio-eq")[0];n.supported&&t&&(this.equalizer=new n({stream:this.currentStream,elementToScale:t}))},e}();t.MicrophoneBridge=e;var n=function(){function t(t){var e=this;this.maxBorderWidth=0,this._disabled=!1,this.elementToScale=t.elementToScale,this.context=new AudioContext,this.analyser=this.context.createAnalyser(),this.mic=this.context.createMediaStreamSource(t.stream),this.javascriptNode=this.context.createScriptProcessor(2048,1,1),this.analyser.smoothingTimeConstant=.3,this.analyser.fftSize=1024,this.mic.connect(this.analyser),this.analyser.connect(this.javascriptNode),this.javascriptNode.connect(this.context.destination),this.javascriptNode.onaudioprocess=function(){e.onAudioProcess()}}return Object.defineProperty(t.prototype,"disabled",{set:function(t){this._disabled=t,this.elementToScale.style.borderWidth="0px"},enumerable:!0,configurable:!0}),t.prototype.onAudioProcess=function(){if(!this._disabled){var t=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(t);for(var e=0,n=t.length,i=0;i\n\t\t\t\t
\n\t\t\t\t \n\t\t\t';var i=n.firstChild||n.content.firstChild;this.mic=new t.MicrophoneBridge({el:i,button:this,eventTarget:this.eventTarget,microphoneObj:e}),this.el.appendChild(i)},e.prototype.reset=function(){this.mic&&!this.typing&&this.mic.callInput()},e.prototype.getTemplate=function(){return'\n\t\t\t\t\t\t\n\t\t\t\t\t '},e.prototype.onMicrophoneTerminalError=function(e){this.mic&&(this.mic.dealloc(),this.mic=null,this.el.removeChild(this.el.getElementsByClassName("cf-microphone")[0]),this.el.classList.remove("microphone-interface"),this.loading=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:{errorText:e.detail}})))},e.prototype.onClick=function(e){this.mic&&!this.typing?this.mic.callInput():this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputSubmitButtonEvents.CHANGE))},e.prototype.click=function(){this.el.click()},e.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.MicrophoneBridgeEvent.TERMNIAL_ERROR,this.onMicrophoneTerminalErrorCallback,!1),this.onMicrophoneTerminalErrorCallback=null,this.mic&&this.mic.dealloc(),this.mic=null,this.el.removeEventListener("click",this.onClickCallback,!1),this.onClickCallback=null,this.el=null,this.eventTarget=null},e}();t.UserInputSubmitButton=e}(cf||(cf={}));var cf;!function(t){t.UserInputTypes={VOICE:"voice",VR_GESTURE:"vr-gesture",TEXT:"text"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i._disabled=!1,i._visible=!1,i.onChatReponsesUpdatedCallback=i.onChatReponsesUpdated.bind(i),i.eventTarget.addEventListener(t.ChatListEvents.CHATLIST_UPDATED,i.onChatReponsesUpdatedCallback,!1),i.windowFocusCallback=i.windowFocus.bind(i),window.addEventListener("focus",i.windowFocusCallback,!1),i.inputInvalidCallback=i.inputInvalid.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_INVALID,i.inputInvalidCallback,!1),i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i}return __extends(n,e),Object.defineProperty(n.prototype,"currentTag",{get:function(){return this._currentTag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this._visible=t,!this.el.classList.contains("animate-in")&&t?setTimeout(function(){e.el.classList.add("animate-in")},0):this.el.classList.contains("animate-in")&&!t&&this.el.classList.remove("animate-in")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled!=t&&(this._disabled=t,t?this.el.setAttribute("disabled","disabled"):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var e=0,n=0,i=this.el;return t.Helpers.isInternetExlorer()?(e=i.offsetHeight,n=parseInt(i.currentStyle.marginTop,10)+parseInt(i.currentStyle.marginBottom,10),n*=2):(e=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("height"),10),n=parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(i,"").getPropertyValue("margin-bottom"))),e+n},enumerable:!0,configurable:!0}),n.prototype.onEnterOrSubmitButtonSubmit=function(t){void 0===t&&(t=null)},n.prototype.inputInvalid=function(t){},n.prototype.deactivate=function(){this.disabled=!0},n.prototype.reactivate=function(){this.disabled=!1},n.prototype.getFlowDTO=function(){},n.prototype.setFocusOnInput=function(){},n.prototype.onFlowStopped=function(){},n.prototype.reset=function(){},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.ChatListEvents.CHATLIST_UPDATED,this.onChatReponsesUpdatedCallback,!1),this.onChatReponsesUpdatedCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_INVALID,this.inputInvalidCallback,!1),this.inputInvalidCallback=null,window.removeEventListener("focus",this.windowFocusCallback,!1),this.windowFocusCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,e.prototype.dealloc.call(this)},n.prototype.onFlowUpdate=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this._currentTag=e.detail.tag},n.prototype.windowFocus=function(t){},n.prototype.onChatReponsesUpdated=function(t){t.detail.currentResponse.isRobotResponse||(this.visible=!0,this.disabled=!1,this.setFocusOnInput())},n.ERROR_TIME=2e3,n.preventAutoFocus=!1,n.hideUserInputOnNoneTextInput=!1,n}(t.BasicElement);t.UserInputElement=e,t.UserInputEvents={SUBMIT:"cf-input-user-input-submit",KEY_CHANGE:"cf-input-key-change",CONTROL_ELEMENTS_ADDED:"cf-input-control-elements-added",HEIGHT_CHANGE:"cf-input-height-change",FOCUS:"cf-input-focus",BLUR:"cf-input-blur"}}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.errorTimer=0,i.initialInputHeight=0,i.shiftIsDown=!1,i._active=!1,i.cfReference=n.cfReference,i.eventTarget=n.eventTarget,i.inputElement=i.el.getElementsByTagName("textarea")[0],i.onInputFocusCallback=i.onInputFocus.bind(i),i.onInputBlurCallback=i.onInputBlur.bind(i),i.inputElement.addEventListener("focus",i.onInputFocusCallback,!1),i.inputElement.addEventListener("blur",i.onInputBlurCallback,!1),i.controlElements=new t.ControlElements({el:i.el.getElementsByTagName("cf-input-control-elements")[0],cfReference:i.cfReference,infoEl:i.el.getElementsByTagName("cf-info")[0],eventTarget:i.eventTarget}),i.keyUpCallback=i.onKeyUp.bind(i),document.addEventListener("keyup",i.keyUpCallback,!1),i.keyDownCallback=i.onKeyDown.bind(i),document.addEventListener("keydown",i.keyDownCallback,!1),i.onOriginalTagChangedCallback=i.onOriginalTagChanged.bind(i),i.eventTarget.addEventListener(t.TagEvents.ORIGINAL_ELEMENT_CHANGED,i.onOriginalTagChangedCallback,!1),i.onControlElementSubmitCallback=i.onControlElementSubmit.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.SUBMIT_VALUE,i.onControlElementSubmitCallback,!1),i.onControlElementProgressChangeCallback=i.onControlElementProgressChange.bind(i),i.eventTarget.addEventListener(t.ControlElementEvents.PROGRESS_CHANGE,i.onControlElementProgressChangeCallback,!1),i.onSubmitButtonChangeStateCallback=i.onSubmitButtonChangeState.bind(i),i.eventTarget.addEventListener(t.UserInputSubmitButtonEvents.CHANGE,i.onSubmitButtonChangeStateCallback,!1),i.submitButton=new t.UserInputSubmitButton({eventTarget:i.eventTarget}),i.el.appendChild(i.submitButton.el),n.microphoneInputObj&&(i.microphoneObj=n.microphoneInputObj,i.microphoneObj&&i.microphoneObj.init&&i.microphoneObj.init(),i.submitButton.addMicrophone(i.microphoneObj)),i}return __extends(n,e),Object.defineProperty(n.prototype,"active",{get:function(){return this.inputElement===document.activeElement||this._active},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{set:function(e){var n=this._disabled!=e;t.ConversationalForm.suppressLog||console.log("option hasChanged",e),n&&(this._disabled=e,e?(this.el.setAttribute("disabled","disabled"),this.inputElement.blur()):(this.setFocusOnInput(),this.el.removeAttribute("disabled")))},enumerable:!0,configurable:!0}),n.prototype.getInputValue=function(){var t=this.inputElement.value,e=document.createElement("div");return e.appendChild(document.createTextNode(t)),e.innerHTML},n.prototype.getFlowDTO=function(){var t;return t=this.controlElements&&this.controlElements.active?this.controlElements.getDTO():{text:this.getInputValue()},t.tag||(t.tag=this.currentTag),t.input=this,t.tag=this.currentTag,t},n.prototype.reset=function(){this.controlElements&&this.controlElements.clearTagsAndReset()},n.prototype.deactivate=function(){e.prototype.deactivate.call(this),this.microphoneObj&&(this.submitButton.active=!1)},n.prototype.reactivate=function(){e.prototype.reactivate.call(this),this.microphoneObj&&!this.submitButton.typing&&(this.submitButton.loading=!0,this.submitButton.typing=!1,this.submitButton.active=!0)},n.prototype.onFlowStopped=function(){this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.controlElements&&this.controlElements.clearTagsAndReset(),this.disabled=!0},n.prototype.onOriginalTagChanged=function(t){this.currentTag==t.detail.tag&&this.onInputChange(),this.controlElements&&this.controlElements.active&&this.controlElements.updateStateOnElementsFromTag(t.detail.tag)},n.prototype.onInputChange=function(){if(this.active||this.controlElements.active){var e=Math.max(this.initialInputHeight,parseInt(this.inputElement.style.height,10));this.inputElement.style.height="0px",this.inputElement.style.height=(0===this.inputElement.scrollHeight?e:this.inputElement.scrollHeight)+"px",t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.HEIGHT_CHANGE),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.HEIGHT_CHANGE,{detail:this.inputElement.scrollHeight}))}},n.prototype.inputInvalid=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;this.inputElement.setAttribute("data-value",this.inputElement.value),this.inputElement.value="",this.el.setAttribute("error",""),this.disabled=!0,this.inputElement.setAttribute("placeholder",i.errorText||(this._currentTag?this._currentTag.errorMessage:"")),clearTimeout(this.errorTimer),this.submitButton.loading=!1,this.errorTimer=setTimeout(function(){n.disabled=!1,t.ConversationalForm.suppressLog||console.log("option, disabled 1"),n.el.removeAttribute("error"),n.inputElement.value=n.inputElement.getAttribute("data-value"),n.inputElement.setAttribute("data-value",""),n.setPlaceholder(),n.setFocusOnInput(),n.submitButton.reset(),n.controlElements&&n.controlElements.resetAfterErrorMessage()},t.UserInputElement.ERROR_TIME)},n.prototype.setPlaceholder=function(){this._currentTag?this._currentTag.inputPlaceholder?this.inputElement.setAttribute("placeholder",this._currentTag.inputPlaceholder):this.inputElement.setAttribute("placeholder","group"==this._currentTag.type?t.Dictionary.get("group-placeholder"):t.Dictionary.get("input-placeholder")):this.inputElement.setAttribute("placeholder",t.Dictionary.get("group-placeholder"))},n.prototype.checkForCorrectInputTag=function(){var t=this.inputElement.getAttribute("type"),e="password"==this._currentTag.type&&"password"!=t,n="password"!=this._currentTag.type&&"password"==t,i="email"==this._currentTag.type&&"email"!=t||"number"==this._currentTag.type&&"number"!=t;if(this.inputElement&&(e||n)&&(this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1)),e||i){var o=document.createElement("input");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){o.setAttribute(t.name,t.value)}),o.setAttribute("autocomplete","new-password"),this.inputElement.parentNode.replaceChild(o,this.inputElement),this.inputElement=o,"number"!==this._currentTag.type&&"email"!==this._currentTag.type||(this.inputElement.type=this._currentTag.type,o.setAttribute("type",this._currentTag.type))}else if(n){var s=document.createElement("textarea");Array.prototype.slice.call(this.inputElement.attributes).forEach(function(t){s.setAttribute(t.name,t.value)}),this.inputElement.parentNode.replaceChild(s,this.inputElement),this.inputElement=s}this.inputElement&&(e||n)&&(this.inputElement.addEventListener("focus",this.onInputFocusCallback,!1),this.inputElement.addEventListener("blur",this.onInputBlurCallback,!1)),0==this.initialInputHeight&&(this.initialInputHeight=this.inputElement.offsetHeight),this.setFocusOnInput()},n.prototype.onFlowUpdate=function(n){var i=this;e.prototype.onFlowUpdate.call(this,n),this.submitButton.loading=!1,this.submitButton.typing&&(this.submitButton.typing=!1),this.el.setAttribute("tag-type",this._currentTag.type),this.checkForCorrectInputTag();var o=-1!==["password","number","email"].indexOf(this._currentTag.type);this.inputElement.setAttribute("type",o?this._currentTag.type:"input"),clearTimeout(this.errorTimer),this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),this.inputElement.value="",this.submitButton.loading=!1,this.setPlaceholder(),this.resetValue(),this.setFocusOnInput(),this.controlElements.reset(),"group"==this._currentTag.type?this.buildControlElements(this._currentTag.elements):this.buildControlElements([this._currentTag]),"text"!=this._currentTag.type&&"email"!=this._currentTag.type||(this.inputElement.value=this._currentTag.defaultValue.toString()),!0===this._currentTag.skipUserInput?this.el.classList.add("hide-input"):this.el.classList.remove("hide-input"),t.UserInputElement.hideUserInputOnNoneTextInput&&(this.controlElements.active?(this.el.classList.add("hide-input"),this.controlElements.focusFrom("bottom")):this.el.classList.remove("hide-input")),setTimeout(function(){i.onInputChange()},150)},n.prototype.onControlElementProgressChange=function(e){var n=e.detail;this.disabled=n==t.ControlElementProgressStates.BUSY,t.ConversationalForm.suppressLog||console.log("option, disabled 2")},n.prototype.buildControlElements=function(t){this.controlElements.buildTags(t)},n.prototype.onControlElementSubmit=function(e){t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var n=e.detail;this.controlElements.updateStateOnElements(n),this.doSubmit()},n.prototype.onSubmitButtonChangeState=function(t){this.onEnterOrSubmitButtonSubmit(t)},n.prototype.isMetaKeyPressed=function(t){t.metaKey||[91,93].indexOf(t.keyCode)},n.prototype.onKeyDown=function(e){(this.active||this.controlElements.focus)&&(this.isControlElementsActiveAndUserInputHidden()||this.isMetaKeyPressed(e)||(e.keyCode==t.Dictionary.keyCodes.shift&&(this.shiftIsDown=!0),e.keyCode!=t.Dictionary.keyCodes.enter||e.shiftKey||e.preventDefault()))},n.prototype.isControlElementsActiveAndUserInputHidden=function(){return this.controlElements&&this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput},n.prototype.onKeyUp=function(e){if((this.active||this.isControlElementsActiveAndUserInputHidden()||this.controlElements.focus)&&!this.isMetaKeyPressed(e)){if(e.keyCode==t.Dictionary.keyCodes.shift)this.shiftIsDown=!1;else if(e.keyCode==t.Dictionary.keyCodes.up)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("bottom");else if(e.keyCode==t.Dictionary.keyCodes.down)e.preventDefault(),this.active&&!this.controlElements.focus&&this.controlElements.focusFrom("top");else if(e.keyCode==t.Dictionary.keyCodes.tab){for(var n=!1,i=e.target.parentNode;null!=i;){if(i===this.cfReference.el){n=!0;break}i=i.parentNode}n||(e.preventDefault(),this.controlElements.active||this.setFocusOnInput())}if(!this.el.hasAttribute("disabled")){var o=this.getFlowDTO();if(e.keyCode==t.Dictionary.keyCodes.enter&&!e.shiftKey||e.keyCode==t.Dictionary.keyCodes.space)if(e.keyCode==t.Dictionary.keyCodes.enter&&this.active)e.preventDefault(),this.onEnterOrSubmitButtonSubmit();else if(e.keyCode==t.Dictionary.keyCodes.enter||e.keyCode==t.Dictionary.keyCodes.space){e.preventDefault();var s="group"==this._currentTag.type?this._currentTag.getGroupTagType():this._currentTag.type;if("select"==s||"checkbox"==s){var r=this._currentTag;"checkbox"==s||r.multipleChoice?(this.active||this.isControlElementsActiveAndUserInputHidden())&&e.keyCode==t.Dictionary.keyCodes.enter?this.submitButton.click():(this.active||this.controlElements.active||this.isControlElementsActiveAndUserInputHidden()||(this.resetValue(),this.setFocusOnInput()),this.dispatchKeyChange(o,e.keyCode)):this.dispatchKeyChange(o,e.keyCode)}else"group"==this._currentTag.type&&this.dispatchKeyChange(o,e.keyCode)}else e.keyCode==t.Dictionary.keyCodes.space&&document.activeElement&&this.dispatchKeyChange(o,e.keyCode);else e.keyCode!=t.Dictionary.keyCodes.shift&&e.keyCode!=t.Dictionary.keyCodes.tab&&this.dispatchKeyChange(o,e.keyCode);this.onInputChange()}}},n.prototype.dispatchKeyChange=function(e,n){this.submitButton.typing=e.text&&e.text.length>0,t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.KEY_CHANGE,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.KEY_CHANGE,{detail:{dto:e,keyCode:n,inputFieldActive:this.active}}))},n.prototype.windowFocus=function(t){e.prototype.windowFocus.call(this,t),this.setFocusOnInput()},n.prototype.onInputBlur=function(e){this._active=!1,this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.BLUR))},n.prototype.onInputFocus=function(e){this._active=!0,this.onInputChange(),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.FOCUS))},n.prototype.setFocusOnInput=function(){t.UserInputElement.preventAutoFocus||this.el.classList.contains("hide-input")||this.inputElement.focus()},n.prototype.onEnterOrSubmitButtonSubmit=function(e){void 0===e&&(e=null);var n=this.controlElements.active&&t.UserInputElement.hideUserInputOnNoneTextInput;(this.active||n)&&this.controlElements.highlighted?this.controlElements.clickOnHighlighted():this._currentTag?"file"==this._currentTag.type&&e?this.controlElements.getElement(0).triggerFileSelect():this.doSubmit():this.eventTarget.cf.addUserChatResponse(this.inputElement.value)},n.prototype.doSubmit=function(){var e=this.getFlowDTO();this.submitButton.loading=!0,this.disabled=!0,this.el.removeAttribute("error"),this.inputElement.setAttribute("data-value",""),t.ConversationalForm.illustrateFlow(this,"dispatch",t.UserInputEvents.SUBMIT,e),this.eventTarget.dispatchEvent(new CustomEvent(t.UserInputEvents.SUBMIT,{detail:e}))},n.prototype.resetValue=function(){this.inputElement.value="",this.onInputChange()},n.prototype.dealloc=function(){this.inputElement.removeEventListener("blur",this.onInputBlurCallback,!1),this.onInputBlurCallback=null,this.inputElement.removeEventListener("focus",this.onInputFocusCallback,!1),this.onInputFocusCallback=null,document.removeEventListener("keydown",this.keyDownCallback,!1),this.keyDownCallback=null,document.removeEventListener("keyup",this.keyUpCallback,!1),this.keyUpCallback=null,this.eventTarget.removeEventListener(t.ControlElementEvents.SUBMIT_VALUE,this.onControlElementSubmitCallback,!1),this.onControlElementSubmitCallback=null,this.submitButton.el.removeEventListener(t.UserInputSubmitButtonEvents.CHANGE,this.onSubmitButtonChangeStateCallback,!1),this.onSubmitButtonChangeStateCallback=null,this.submitButton.dealloc(),this.submitButton=null,e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return this.customTemplate||'\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\n\t\t\t\t\n\n\t\t\t \n\t\t\t'},n}(t.UserInputElement);t.UserTextInput=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatResponseEvents={USER_ANSWER_CLICKED:"cf-on-user-answer-clicked"};var e=function(e){function n(t){var n=e.call(this,t)||this;return n.readyTimer=0,n.container=t.container,n.uiOptions=t.cfReference.uiOptions,n._tag=t.tag,n}return __extends(n,e),Object.defineProperty(n.prototype,"tag",{get:function(){return this._tag},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"added",{get:function(){return!!this.el.parentNode.parentNode},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.el.classList.contains("disabled")},set:function(t){t?this.el.classList.add("disabled"):this.el.classList.remove("disabled")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"visible",{set:function(t){var e=this;this.el.offsetWidth,setTimeout(function(){return t?e.el.classList.add("show"):e.el.classList.remove("show")},100)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"strippedSesponse",{get:function(){var t=this.response,e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""},enumerable:!0,configurable:!0}),n.prototype.whenReady=function(t){this.onReadyCallback=t},n.prototype.setValue=function(e){void 0===e&&(e=null),this.visible||(this.visible=!0);this.el.hasAttribute("thinking");if(e){if(this.response=this.originalResponse=e.text,this.processResponseAndSetText(),this.responseLink&&!this.isRobotResponse&&this.responseLink.processResponseAndSetText(),e&&e.controlElements&&e.controlElements[0])switch(e.controlElements[0].type){case"UploadFileUI":this.textEl.classList.add("file-icon")}this.isRobotResponse||this.onClickCallback||(this.onClickCallback=this.onClick.bind(this),this.el.addEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1))}else this.setToThinking()},n.prototype.show=function(){this.visible=!0,this.disabled=!1,this.response?this.checkForEditMode():this.setToThinking()},n.prototype.updateThumbnail=function(t){var e=this.el.getElementsByTagName("thumb")[0];if(0===t.indexOf("text:")){var n=e.getElementsByTagName("span")[0];n.innerHTML=t.split("text:")[1],n.setAttribute("length",t.length.toString())}else this.image=t,e.style.backgroundImage='url("'+this.image+'")'},n.prototype.setLinkToOtherReponse=function(t){this.responseLink=t},n.prototype.processResponseAndSetText=function(){var t=this;if(this.originalResponse){var e=this.originalResponse;if(this._tag&&"password"==this._tag.type&&!this.isRobotResponse){for(var i="",o=0;o"+n+"
";var e=t.textEl.getElementsByTagName("p");e[e.length-1].offsetWidth,e[e.length-1].classList.add("show"),t.scrollTo()},l+(e+1)*u.uiOptions.robot.chainedResponseTime)}(h)
-;this.readyTimer=setTimeout(function(){t.onReadyCallback&&t.onReadyCallback(),t.onReadyCallback=null,!0===t._tag.skipUserInput&&setTimeout(function(){t._tag.flowManager.nextStep()},t.uiOptions.robot.chainedResponseTime)},l+c.length*this.uiOptions.robot.chainedResponseTime)}else{this.tryClearThinking(),this.textEl.innerHTML=""+e+"
";var p=this.textEl.getElementsByTagName("p");p[p.length-1].offsetWidth,p[p.length-1].classList.add("show"),this.scrollTo()}this.parsedResponse=e,this.addSelf(),this.textEl.removeAttribute("value-added"),setTimeout(function(){t.textEl.setAttribute("value-added",""),t.el.classList.add("peak-thumb")},0),this.checkForEditMode(),this.response=e.split("&&").join(" ")}},n.prototype.scrollTo=function(){var t=this.el.offsetTop,e=this.el.offsetHeight;this.container.scrollTop=t+e+this.container.scrollTop},n.prototype.checkForEditMode=function(){this.isRobotResponse||this.el.hasAttribute("thinking")||(this.el.classList.add("can-edit"),this.disabled=!1)},n.prototype.tryClearThinking=function(){this.el.hasAttribute("thinking")&&(this.textEl.innerHTML="",this.el.removeAttribute("thinking"))},n.prototype.setToThinking=function(){(this.isRobotResponse&&0!==this.uiOptions.robot.robotResponseTime||!this.isRobotResponse&&this.cfReference.uiOptions.user.showThinking&&!this._tag.skipUserInput)&&(this.textEl.innerHTML=n.THINKING_MARKUP,this.el.classList.remove("can-edit"),this.el.setAttribute("thinking","")),(this.cfReference.uiOptions.user.showThinking||this.cfReference.uiOptions.user.showThumb)&&this.addSelf()},n.prototype.addSelf=function(){this.el.parentNode!=this.container&&this.container.appendChild(this.el)},n.prototype.onClick=function(e){this.setToThinking(),t.ConversationalForm.illustrateFlow(this,"dispatch",t.ChatResponseEvents.USER_ANSWER_CLICKED,e),this.eventTarget.dispatchEvent(new CustomEvent(t.ChatResponseEvents.USER_ANSWER_CLICKED,{detail:this._tag}))},n.prototype.setData=function(t){this.image=t.image,this.response=this.originalResponse=t.response,this.isRobotResponse=t.isRobotResponse,e.prototype.setData.call(this,t)},n.prototype.onElementCreated=function(){var t=this;this.textEl=this.el.getElementsByTagName("text")[0],this.updateThumbnail(this.image),this.isRobotResponse||null!=this.response?setTimeout(function(){t.setValue({text:t.response})},0):this.cfReference.uiOptions.user.showThumb&&this.el.classList.add("peak-thumb")},n.prototype.dealloc=function(){clearTimeout(this.readyTimer),this.container=null,this.uiOptions=null,this.onReadyCallback=null,this.onClickCallback&&(this.el.removeEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1),this.onClickCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return'\n\t\t\t\t \n\t\t\t\t \n\t\t\t '},n.THINKING_MARKUP=". . .
",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t \n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.71",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n"+e+"";var p=this.textEl.getElementsByTagName("p");p[p.length-1].offsetWidth,p[p.length-1].classList.add("show"),this.scrollTo()}this.parsedResponse=e,this.addSelf(),this.textEl.removeAttribute("value-added"),setTimeout(function(){t.textEl.setAttribute("value-added",""),t.el.classList.add("peak-thumb")},0),this.checkForEditMode(),this.response=e.split("&&").join(" ")}},n.prototype.scrollTo=function(){var t=this.el.offsetTop,e=this.el.offsetHeight;this.container.scrollTop=t+e+this.container.scrollTop},n.prototype.checkForEditMode=function(){this.isRobotResponse||this.el.hasAttribute("thinking")||(this.el.classList.add("can-edit"),this.disabled=!1)},n.prototype.tryClearThinking=function(){this.el.hasAttribute("thinking")&&(this.textEl.innerHTML="",this.el.removeAttribute("thinking"))},n.prototype.setToThinking=function(){(this.isRobotResponse&&0!==this.uiOptions.robot.robotResponseTime||!this.isRobotResponse&&this.cfReference.uiOptions.user.showThinking&&!this._tag.skipUserInput)&&(this.textEl.innerHTML=n.THINKING_MARKUP,this.el.classList.remove("can-edit"),this.el.setAttribute("thinking","")),(this.cfReference.uiOptions.user.showThinking||this.cfReference.uiOptions.user.showThumb)&&this.addSelf()},n.prototype.addSelf=function(){this.el.parentNode!=this.container&&this.container.appendChild(this.el)},n.prototype.onClick=function(e){this.setToThinking(),t.ConversationalForm.illustrateFlow(this,"dispatch",t.ChatResponseEvents.USER_ANSWER_CLICKED,e),this.eventTarget.dispatchEvent(new CustomEvent(t.ChatResponseEvents.USER_ANSWER_CLICKED,{detail:this._tag}))},n.prototype.setData=function(t){this.image=t.image,this.response=this.originalResponse=t.response,this.isRobotResponse=t.isRobotResponse,e.prototype.setData.call(this,t)},n.prototype.onElementCreated=function(){var t=this;this.textEl=this.el.getElementsByTagName("text")[0],this.updateThumbnail(this.image),this.isRobotResponse||null!=this.response?setTimeout(function(){t.setValue({text:t.response})},0):this.cfReference.uiOptions.user.showThumb&&this.el.classList.add("peak-thumb")},n.prototype.dealloc=function(){clearTimeout(this.readyTimer),this.container=null,this.uiOptions=null,this.onReadyCallback=null,this.onClickCallback&&(this.el.removeEventListener(t.Helpers.getMouseEvent("click"),this.onClickCallback,!1),this.onClickCallback=null),e.prototype.dealloc.call(this)},n.prototype.getTemplate=function(){return'\n\t\t\t\t \n\t\t\t\t \n\t\t\t '},n.THINKING_MARKUP=". . .
",n}(t.BasicElement);t.ChatResponse=e}(cf||(cf={}));var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),cf;!function(t){t.ChatListEvents={CHATLIST_UPDATED:"cf-chatlist-updated"};var e=function(e){function n(n){var i=e.call(this,n)||this;return i.updateTimer=0,t.ChatResponse.list=i,i.responses=[],i.flowUpdateCallback=i.onFlowUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.FLOW_UPDATE,i.flowUpdateCallback,!1),i.userInputUpdateCallback=i.onUserInputUpdate.bind(i),i.eventTarget.addEventListener(t.FlowEvents.USER_INPUT_UPDATE,i.userInputUpdateCallback,!1),i.onInputKeyChangeCallback=i.onInputKeyChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.KEY_CHANGE,i.onInputKeyChangeCallback,!1),i.onInputHeightChangeCallback=i.onInputHeightChange.bind(i),i.eventTarget.addEventListener(t.UserInputEvents.HEIGHT_CHANGE,i.onInputHeightChangeCallback,!1),i.onControlElementsResizedCallback=i.onControlElementsResized.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.ON_RESIZE,i.onControlElementsResizedCallback,!1),i.onControlElementsChangedCallback=i.onControlElementsChanged.bind(i),i.eventTarget.addEventListener(t.ControlElementsEvents.CHANGED,i.onControlElementsChangedCallback,!1),i}return __extends(n,e),n.prototype.onInputHeightChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n),this.onInputElementChanged()},n.prototype.onInputKeyChange=function(e){var n=e.detail.dto;t.ConversationalForm.illustrateFlow(this,"receive",e.type,n)},n.prototype.onUserInputUpdate=function(e){if(t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail),this.currentUserResponse){var n=e.detail;this.setCurrentUserResponse(n)}},n.prototype.addInput=function(t){this.input=t},n.prototype.onControlElementsChanged=function(t){this.onInputElementChanged()},n.prototype.onControlElementsResized=function(e){t.ConversationalForm.illustrateFlow(this,"receive",t.ControlElementsEvents.ON_RESIZE);var n=this.currentResponse;if(n){if(!n.added)for(var i=this.responses.indexOf(n);i>=0;i--){var o=this.responses[i];if(o.added){n=o;break}}n.scrollTo()}this.onInputElementChanged()},n.prototype.onInputElementChanged=function(){var t=this.cfReference.el.offsetHeight,e=this.input.height,n=t-e;this.el.style.height=n+"px"},n.prototype.onFlowUpdate=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail.tag;this.currentResponse&&(this.currentResponse.disabled=!1),this.containsTagResponse(i)&&!e.detail.ignoreExistingTag?this.onUserWantsToEditTag(i):setTimeout(function(){var t=n.createResponse(!0,i,i.question);t.whenReady(function(){n.currentUserResponse=n.createResponse(!1,i),t.scrollTo()}),n.currentUserResponse&&(n.currentUserResponse.setLinkToOtherReponse(t),t.setLinkToOtherReponse(n.currentUserResponse))},0===this.responses.length?500:0)},n.prototype.containsTagResponse=function(t){for(var e=0;e2&&(this.responses[this.responses.length-1].isRobotResponse||this.responses.pop().dealloc(),this.responses.pop().dealloc()),this.currentUserResponse=e,this.currentResponse=this.responses[this.responses.length-1],this.onListUpdate(this.currentUserResponse))},n.prototype.onListUpdate=function(e){var n=this;clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){n.eventTarget.dispatchEvent(new CustomEvent(t.ChatListEvents.CHATLIST_UPDATED,{detail:n})),e.show()},0)},n.prototype.clearFrom=function(t){for(t*=2,t+=t%2;this.responses.length>t;)this.responses.pop().dealloc()},n.prototype.setCurrentUserResponse=function(e){this.flowDTOFromUserInputUpdate=e,!this.flowDTOFromUserInputUpdate.text&&e.tag&&("group"==e.tag.type?this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing-group"):"password"!=e.tag.type&&(this.flowDTOFromUserInputUpdate.text=t.Dictionary.get("user-reponse-missing"))),this.currentUserResponse.setValue(this.flowDTOFromUserInputUpdate)},n.prototype.getResponses=function(){return this.responses},n.prototype.updateThumbnail=function(e,n){t.Dictionary.set(e?"robot-image":"user-image",e?"robot":"human",n);for(var i=e?t.Dictionary.getRobotResponse("robot-image"):t.Dictionary.get("user-image"),o=0;o\n\t\t\t\t\t\t \n\t\t\t\t\t"},n.prototype.dealloc=function(){this.eventTarget.removeEventListener(t.FlowEvents.FLOW_UPDATE,this.flowUpdateCallback,!1),this.flowUpdateCallback=null,this.eventTarget.removeEventListener(t.FlowEvents.USER_INPUT_UPDATE,this.userInputUpdateCallback,!1),this.userInputUpdateCallback=null,this.eventTarget.removeEventListener(t.UserInputEvents.KEY_CHANGE,this.onInputKeyChangeCallback,!1),this.onInputKeyChangeCallback=null,e.prototype.dealloc.call(this)},n}(t.BasicElement);t.ChatList=e}(cf||(cf={}));var cf;!function(t){t.FlowEvents={USER_INPUT_UPDATE:"cf-flow-user-input-update",USER_INPUT_INVALID:"cf-flow-user-input-invalid",FLOW_UPDATE:"cf-flow-update"};var e=function(){function e(e){this.stopped=!1,this.maxSteps=0,this.step=0,this.savedStep=-1,this.stepTimer=0,this.ignoreExistingTags=!1,this.cfReference=e.cfReference,this.eventTarget=e.eventTarget,this.flowStepCallback=e.flowStepCallback,this.setTags(e.tags),this.userInputSubmitCallback=this.userInputSubmit.bind(this),this.eventTarget.addEventListener(t.UserInputEvents.SUBMIT,this.userInputSubmitCallback,!1)}return Object.defineProperty(e.prototype,"currentTag",{get:function(){return this.tags[this.step]},enumerable:!0,configurable:!0}),e.prototype.userInputSubmit=function(e){var n=this;t.ConversationalForm.illustrateFlow(this,"receive",e.type,e.detail);var i=e.detail;i.tag||(i.tag=this.currentTag);var o=this.currentTag.setTagValueAndIsValid(i),s=!1,r=!1,a=function(){return n.currentTag.validationCallback&&"function"==typeof n.currentTag.validationCallback&&!s&&o?(s=!0,void n.currentTag.validationCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):n.flowStepCallback&&"function"==typeof n.flowStepCallback&&!r&&o?(r=!0,void n.flowStepCallback(i,function(){o=!0,a()},function(t){o=!1,t&&(i.errorText=t),a()})):void(o?(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_UPDATE,i),i.input&&(i=i.input.getFlowDTO()),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_UPDATE,{detail:i})),setTimeout(function(){return n.nextStep()},t.ConversationalForm.animationsEnabled?250:0)):(t.ConversationalForm.illustrateFlow(n,"dispatch",t.FlowEvents.USER_INPUT_INVALID,i),n.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.USER_INPUT_INVALID,{detail:i}))))};a()},e.prototype.startFrom=function(t,e){void 0===e&&(e=!1),this.step="number"==typeof t?t:this.tags.indexOf(t),this.ignoreExistingTags=e,this.ignoreExistingTags?this.showStep():this.editTag(this.tags[this.step])},e.prototype.areConditionsInFlowFullfilled=function(e,n){this.activeConditions||(this.activeConditions=[]);for(var i=0,o=0;o0){this.savedStep=-1,this.cfReference.chatList.clearFrom(this.step+1);for(var e=this.tags.indexOf(t),n=e+1;n0&&(this.step==this.maxSteps?this.cfReference.doSubmitForm():(this.step%=this.maxSteps,this.currentTag.disabled?this.skipStep():this.showStep()))},e.prototype.showStep=function(){var e=this;this.stopped||(t.ConversationalForm.illustrateFlow(this,"dispatch",t.FlowEvents.FLOW_UPDATE,this.currentTag),this.currentTag.refresh(),setTimeout(function(){e.eventTarget.dispatchEvent(new CustomEvent(t.FlowEvents.FLOW_UPDATE,{detail:{tag:e.currentTag,ignoreExistingTag:e.ignoreExistingTags}}))},0))},e.STEP_TIME=1e3,e}();t.FlowManager=e}(cf||(cf={}));var cf;!function(cf_1){var ConversationalForm=function(){function ConversationalForm(options){if(this.version="0.9.80",this.cdnPath="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/",this.isDevelopment=!1,this.loadExternalStyleSheet=!0,this.preventAutoAppend=!1,this.preventAutoStart=!1,window.ConversationalForm=this,this.cdnPath=this.cdnPath.split("{version}").join(this.version),"boolean"==typeof options.suppressLog&&(ConversationalForm.suppressLog=options.suppressLog),ConversationalForm.suppressLog||console.log("Conversational Form > version:",this.version),ConversationalForm.suppressLog||console.log("Conversational Form > options:",options),window.ConversationalForm[this.createId]=this,options.eventDispatcher&&(this._eventTarget=options.eventDispatcher),this.eventTarget.cf||(this.eventTarget.cf=this),options.flowStepCallback&&(this.flowStepCallback=options.flowStepCallback),this.isDevelopment=ConversationalForm.illustrateAppFlow=!!document.getElementById("conversational-form-development"),(this.isDevelopment||0==options.loadExternalStyleSheet)&&(this.loadExternalStyleSheet=!1),isNaN(options.scrollAccerlation)||(cf_1.ScrollController.accerlation=options.scrollAccerlation),this.preventAutoStart=options.preventAutoStart,this.preventAutoAppend=options.preventAutoAppend,!options.formEl)throw new Error("Conversational Form error, the formEl needs to be defined.");this.formEl=options.formEl,this.formEl.setAttribute("cf-create-id",this.createId),!0===options.hideUserInputOnNoneTextInput&&(cf_1.UserInputElement.hideUserInputOnNoneTextInput=!0),this.submitCallback=options.submitCallback,this.submitCallback&&"string"==typeof this.submitCallback&&(this.submitCallback=eval(this.submitCallback)),""==this.formEl.getAttribute("cf-no-animation")&&(ConversationalForm.animationsEnabled=!1),(options.preventAutoFocus||""==this.formEl.getAttribute("cf-prevent-autofocus"))&&(cf_1.UserInputElement.preventAutoFocus=!0),this.dictionary=new cf_1.Dictionary({data:options.dictionaryData,robotData:options.dictionaryRobot,userImage:options.userImage,robotImage:options.robotImage}),this.context=options.context?options.context:document.body,this.tags=options.tags,options.microphoneInput&&(options.microphoneInput.init&&options.microphoneInput.input||(console.warn("Conversational Form: microphoneInput is not correctly setup",options.microphoneInput),options.microphoneInput=null)),this.microphoneInputObj=options.microphoneInput,this.uiOptions=cf_1.Helpers.extendObject(cf_1.UserInterfaceDefaultOptions,options.userInterfaceOptions||{}),this.init()}return Object.defineProperty(ConversationalForm.prototype,"createId",{get:function(){return this._createId||(this._createId=(new Date).getTime().toString()),this._createId},enumerable:!0,configurable:!0}),Object.defineProperty(ConversationalForm.prototype,"eventTarget",{get:function(){return this._eventTarget||(this._eventTarget=new cf_1.EventDispatcher(this)),this._eventTarget},enumerable:!0,configurable:!0}),ConversationalForm.prototype.init=function(){if(this.loadExternalStyleSheet){var t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("link"),n=this.cdnPath+"conversational-form.min.css";e.type="text/css",e.media="all",e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),t.appendChild(e)}else this.isDevelopment=!0;if(-1==["fixed","absolute","relative"].indexOf(window.getComputedStyle(this.context).getPropertyValue("position").toLowerCase())&&(this.context.style.position="relative"),!this.tags||0==this.tags.length){this.tags=[];for(var i=[].slice.call(this.formEl.querySelectorAll("input, select, button, textarea, cf-robot-message"),0),o=0;o0)for(var o in e)if(e[o].length>0){var s=e[o][0].domElement.parentNode;s&&"fieldset"!==s.tagName.toLowerCase()&&(s=s.parentNode,function(t){return t&&"fieldset"!==t.tagName.toLowerCase()&&!t.hasAttribute("cf-questions")}(s)&&(s=null));for(var r=new cf_1.TagGroup({fieldset:s,elements:e[o]}),n=0;n0){for(var n=0;n
+
+
+ DOM element attributes | Conversational Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DOM element attributes
+
+
+ cf-context
+ If you want to have the ConversationalForm appended to a certain element (when auto-instantiating) then add attribute cf-context to an element, otherwise the ConversationalForm will be appended to the body element.
+ <div cf-context>
+
+ cf-prevent-autofocus
+ If you don't want to have the UserTextInput to auto focus.
+ <form id="my-form-element" cf-form cf-prevent-autofocus>
+
+ cf-no-animation
+ Disables animations completly.
+ <form id="my-form-element" cf-form cf-no-animation>
+
+
+ cf-questions
+ Map questions directly to a tag. You can seperate with || to allow for more questions, app will shuffle questions.
+ <input type="text" cf-questions="What is your name?||Please tell me your name." />
+ seperate with && to allow for chained questions.
+ <input type="text" cf-questions="Hello?&&Please tell me your name." />
+
+
+ Tag specific, set the placeholder text on the UserTextInput field.
+ <input type="text" cf-input-placeholder="Should include http" />
+
+ {One way value-binding} with cf-questions
+ For cui-questions, add {previous-answer} to insert the value from the previous user-answer, you are also able to reference the input ID.
+ Using the {previous-answer} mapping:
+ <input type="text" cf-questions="What is your firstname?" />
+<input type="text" cf-questions="Hello {previous-answer}, what is your lastname?">
+
+ Using the ID attribute, this will loop through all submitted tags and map:
+ <input type="text" cf-questions="What is your first name?" id="firstname" />
+<input type="text" cf-questions="What is your last name?" id="lastname" />
+<input type="text" cf-questions="Hi {firstname} {lastname}, please tell me your email?" />
+
+ previous input could be a select:option list with countries.
+ <input type="text" cf-questions="So you want to travel to {previous-answer}" />
+
+ cf-label
+ Add a label to the field. Field must be of type "radio" or "checkbox".
+ <input type="radio" cf-label="Subscribe to newsletter" />
+
+ cf-validation
+ Validate a submitted value before continuing the form flow using javascript.
+
+ OBS. eval is used.
+ Asyncronous, so a value can be validated through a server
+ three parameters is passed to the method
+
+ dto: FlowDTO
+ success: () => void //callback
+ error: (optionalErrorMessage?: string) => void //callback
+
+
+
+ <input type="text" cf-validation="window.validateFunction" ..
+
+ cf-error
+ Map error messages directly to a tag. The messages can be seperated by | to allow for more error messages. The app will shuffle between given messages.
+ <input type="text" cf-error="Text is wrong wrong|Input is not right" />
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/0.9.80/appearance/index.html b/docs/0.9.80/appearance/index.html
new file mode 100644
index 000000000..02f38ae4c
--- /dev/null
+++ b/docs/0.9.80/appearance/index.html
@@ -0,0 +1,151 @@
+
+
+
+
Appearance | Conversational Form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Appearance
+ When altering the apperance of Conversational Form you have two options:
+
+ Overriding styles
+ Compile (SCSS) your own theme and disable CSS load using the option loadExternalStyleSheet
to false when instantiating your Conversational Form.
+
+
+ Example - Overriding styles
+ See the Pen Conversational Forms - CSS override theming by SPACE10 (@space10 ) on CodePen .
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/0.9.80/assets/favicon.ico b/docs/0.9.80/assets/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..457072e6c1f50bd63fb82ef791ed42baf6c9857c
GIT binary patch
literal 15086
zcmeI3TWnOv8OO&sU;>eBl0enic-NRj1|kAQAY=kggd$8(Q6CIa+Ypkzl#3!YZ+QVj
zAw~))AxKFKilRh9m^>swk
rZnNwLMyqOa4W`Oa-%4vOn?95JGvCbj&1L8EonvDvOr@DM%MixR{)dg3XN-x*lkpm3dP%DxRQ{TKjOjq2
z2^or*=RoPsXX;?^{V2B?9`a%nxbRKP@Ng)Q(2oPmGC
zm+%dI4cFld=z+cP0{jf_9f`J}cN9#A&G1+F57->IgKR(i0iJ~iOVti^#b6tphg@t9
zlKqZ)j>4~De6iX=-J@XzdjAbavn*BI`H>4k0sbyma6@D=21U(|AcN5{`$R3X|y
zJ^FpV3%4Pv4a1e|L)UL$SZfvK?+2|H#h5SI+Bkq-wV@)PaiH8-*aiQCY`Th-uW?wO
zr~PXwo9nt*jCTADJ7(n42IS|!=iqBke}BIf*REYF2&yYcS2A7eQlzyNxqG22S*h`l#`RYpAp?UC3lrcbV8EDV-NBb19suUg?7P$1qEU8
z;>GsJkt5Dn2I(dJPcSj84dhqB2jFYF(q(^FSC^eKWr~f*;{{>bv}yLxp+ipHA-exd
z-m_WkpNEXjC0XsCI(4ek2DM{2G&D5W88c=?v0pand>DA>zX$uc?Pq>S`)!!r
zZeAJKuX|iWruD{cfq?9OSd`9fK03>pUR8H%}#V|4>f;2>G)|q77O@
z+f2a{Tubng`-f4ageW2e((FUTNYh{`eLBpbl|!~
z-f-KeHC}%2Kp$0fi-$_8UeI$k?c;@fE}%PA7w8NeX^kIhUGx-m{1miL_dw`*iTtoJ
zxkkSHt;?V&eIC{-bn3jMGhZj@?5+Dl*d0i1m5)q*z73%DZETp1QsiO7DA4^uDL!jmCi4!K2?uJ##xKG$EInuphBAFf<
zrs;F_I`(0Y8@hHoVSBP&gjV(QN9|U7)elbl6Uly|f|%0jfOds;Q>D{?_ICSVsGe5(
zU?@jQ9G-yGds;O_zULp-h|w@Hxn9g7d<+_40u1Z9eo)s??>+D+X#M&KPJ{eaT9>s~
zT!6p8d$1bnVc7ef>VTP`ec%$@fv|l`dDxEd>ml%YHF;sS$krZM
z3PYZYgy~1V23`m4YhgN~8_>oTj-onKD-2a_bE!-a*?6R
zt50X?_ZDQXcy;&n_1S#z)VJ~04oT@9W-VFizpF$?%{Q&9j?d`QomMpP#b#=DBzCIGQwY9dbt<7GzaKTT%
z?rim58%Wcf%aC{VFI~FSd7dBjdAR&fD_5?x7cXASs4rQ+=Jo1y{lst(yi}B)UUOAg4+jtUk-YYp;Y?yj$~t+{?%UHiWjl{+OuY+>3^=o
z`ZdAh6)S?)U)_@*b@jR-X<7p_{F>6A
zNF?m4Rjcg$`SWdab8{plt34=S{e25PzUNfZe+3zSq$^jh*t2KP+LI?w+Eb@aMMARY
z&Yg4iZ0buN(**Iy+%|hd@^t2V+fyd5cM{cio_chaTkqBBjU!VB2R&uIb>$k@o~QF<
zBwr4455pnIRga&%=CtPgQj_w$H_Uv(F
zBnz)HG=@-XVz1IcY6_wMxaJ(SV7w7?C>wY;8vXl$Q^FY_p`ah;ar
z^E}FHerS$qE&SLmzjNnKt8<3;S-S|*h&^U!I?{hS~G5H><=G4>^x^rf7Y(=
zBJG{=e&iRa|MlVfSkU@*M{~eCcieb#{%F0{Jk2<35PtwvN7%lie*Qi9{%-*3>I=0+
z{h{%ZyvFul@IEYo)cJDI`k{Z3(Vbsoqp{We&>X}2I`kvo=B*h1TzstE^3T$$P5d(a
MP@ZHGpfW1^e}QKkE&u=k
literal 0
HcmV?d00001
diff --git a/docs/0.9.80/assets/formless.json b/docs/0.9.80/assets/formless.json
new file mode 100644
index 000000000..9142e7fa7
--- /dev/null
+++ b/docs/0.9.80/assets/formless.json
@@ -0,0 +1,107 @@
+{
+ "options": {
+ "preventAutoAppend": true,
+ "preventAutoFocus": true,
+ "submitCallback": "window.onFormlessSubmited"
+ },
+ "tags": [
+ {
+ "tag": "input",
+ "type": "text",
+ "id": "first-tag",
+ "value": "Prefilled value here",
+ "cf-questions": "Prefilled1&&with follow-up1&&with follow-up11||Prefilled2&&with follow-up2&&with follow-up22"
+ },
+ {
+ "tag": "select",
+ "cf-input-placeholder": "Choose one of the above",
+ "multiple": "multiple",
+ "cf-questions": "Choose multiple of the elements from the list",
+ "children":[
+ {
+ "tag": "option",
+ "name": "option-dropdown-1",
+ "cf-label": "option-1",
+ "value": "-1"
+ },
+ {
+ "tag": "option",
+ "name": "option-dropdown-1",
+ "cf-label": "option-2",
+ "value": "-2"
+ }
+ ]
+ },
+ {
+ "tag": "fieldset",
+ "type": "Radio buttons",
+ "cf-input-placeholder": "Choose one of the above",
+ "cf-questions": "Choose one of the radioss",
+ "children":[
+ {
+ "tag": "input",
+ "type": "radio",
+ "name": "radio-buttons-1",
+ "cf-label": "radio-1",
+ "checked": "checked"
+ },
+ {
+ "tag": "input",
+ "type": "radio",
+ "name": "radio-buttons-1",
+ "cf-label": "radio-2"
+ }
+ ]
+ },
+ {
+ "tag": "fieldset",
+ "type": "Checkboxes",
+ "cf-input-placeholder": "Choose above",
+ "cf-questions": "Choose some checkboxes",
+ "children":[
+ {
+ "tag": "input",
+ "type": "checkbox",
+ "name": "checkboxes-buttons-1",
+ "cf-label": "checkbox-1",
+ "checked": "checked"
+ },
+ {
+ "tag": "input",
+ "type": "checkbox",
+ "name": "checkboxes-buttons-1",
+ "cf-label": "checkbox-2"
+ }
+ ]
+ },
+ {
+ "tag": "input",
+ "type": "password",
+ "cf-input-placeholder": "Password field",
+ "cf-questions": "Write a password"
+ },
+ {
+ "tag": "input",
+ "type": "text",
+ "pattern": ".{5,10}",
+ "cf-input-placeholder": "Input w. pattern attribute",
+ "cf-error": "No less than 5 and no more than 10 characters",
+ "cf-questions": "Keep between 5-10 characters"
+ },
+ {
+ "tag": "input",
+ "type": "text",
+ "required": "required",
+ "cf-questions": "This field is required (attribute)",
+ "cf-error": "Please write something"
+ },
+ {
+ "tag": "input",
+ "type": "text",
+ "required": "required",
+ "cf-questions": "This field uses window.testValidation",
+ "cf-validation": "window.testValidation",
+ "cf-error": "Check the window.testValidation method"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/docs/0.9.80/assets/logo.svg b/docs/0.9.80/assets/logo.svg
new file mode 100644
index 000000000..73926836d
--- /dev/null
+++ b/docs/0.9.80/assets/logo.svg
@@ -0,0 +1 @@
+logo
\ No newline at end of file
diff --git a/docs/0.9.80/assets/prism.css b/docs/0.9.80/assets/prism.css
new file mode 100644
index 000000000..7f499d1b2
--- /dev/null
+++ b/docs/0.9.80/assets/prism.css
@@ -0,0 +1,244 @@
+/* PrismJS 1.9.0
+http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+sass+scss&plugins=toolbar+unescaped-markup+command-line+copy-to-clipboard */
+/**
+ * prism.js default theme for JavaScript, CSS and HTML
+ * Based on dabblet (http://dabblet.com)
+ * @author Lea Verou
+ */
+
+code[class*="language-"],
+pre[class*="language-"] {
+ color: black;
+ background: none;
+ text-shadow: 0 1px white;
+ font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+ word-break: normal;
+ word-wrap: normal;
+ line-height: 1.5;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+}
+
+pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
+ text-shadow: none;
+ background: #b3d4fc;
+}
+
+pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
+code[class*="language-"]::selection, code[class*="language-"] ::selection {
+ text-shadow: none;
+ background: #b3d4fc;
+}
+
+@media print {
+ code[class*="language-"],
+ pre[class*="language-"] {
+ text-shadow: none;
+ }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+ padding: 1em;
+ margin: .5em 0;
+ overflow: auto;
+}
+
+:not(pre) > code[class*="language-"],
+pre[class*="language-"] {
+ background: #f5f2f0;
+}
+
+/* Inline code */
+:not(pre) > code[class*="language-"] {
+ padding: .1em;
+ border-radius: .3em;
+ white-space: normal;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+ color: slategray;
+}
+
+.token.punctuation {
+ color: #999;
+}
+
+.namespace {
+ opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number,
+.token.constant,
+.token.symbol,
+.token.deleted {
+ color: #905;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+ color: #690;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+ color: #a67f59;
+ background: hsla(0, 0%, 100%, .5);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+ color: #07a;
+}
+
+.token.function {
+ color: #DD4A68;
+}
+
+.token.regex,
+.token.important,
+.token.variable {
+ color: #e90;
+}
+
+.token.important,
+.token.bold {
+ font-weight: bold;
+}
+.token.italic {
+ font-style: italic;
+}
+
+.token.entity {
+ cursor: help;
+}
+
+pre.code-toolbar {
+ position: relative;
+}
+
+pre.code-toolbar > .toolbar {
+ position: absolute;
+ top: .3em;
+ right: .2em;
+ transition: opacity 0.3s ease-in-out;
+ opacity: 0;
+}
+
+pre.code-toolbar:hover > .toolbar {
+ opacity: 1;
+}
+
+pre.code-toolbar > .toolbar .toolbar-item {
+ display: inline-block;
+}
+
+pre.code-toolbar > .toolbar a {
+ cursor: pointer;
+}
+
+pre.code-toolbar > .toolbar button {
+ background: none;
+ border: 0;
+ color: inherit;
+ font: inherit;
+ line-height: normal;
+ overflow: visible;
+ padding: 0;
+ -webkit-user-select: none; /* for button */
+ -moz-user-select: none;
+ -ms-user-select: none;
+}
+
+pre.code-toolbar > .toolbar a,
+pre.code-toolbar > .toolbar button,
+pre.code-toolbar > .toolbar span {
+ color: #bbb;
+ font-size: .8em;
+ padding: 0 .5em;
+ background: #f5f2f0;
+ background: rgba(224, 224, 224, 0.2);
+ box-shadow: 0 2px 0 0 rgba(0,0,0,0.2);
+ border-radius: .5em;
+}
+
+pre.code-toolbar > .toolbar a:hover,
+pre.code-toolbar > .toolbar a:focus,
+pre.code-toolbar > .toolbar button:hover,
+pre.code-toolbar > .toolbar button:focus,
+pre.code-toolbar > .toolbar span:hover,
+pre.code-toolbar > .toolbar span:focus {
+ color: inherit;
+ text-decoration: none;
+}
+
+/* Fallback, in case JS does not run, to ensure the code is at least visible */
+.lang-markup script[type='text/plain'],
+.language-markup script[type='text/plain'],
+script[type='text/plain'].lang-markup,
+script[type='text/plain'].language-markup {
+ display: block;
+ font: 100% Consolas, Monaco, monospace;
+ white-space: pre;
+ overflow: auto;
+}
+
+.command-line-prompt {
+ border-right: 1px solid #999;
+ display: block;
+ float: left;
+ font-size: 100%;
+ letter-spacing: -1px;
+ margin-right: 1em;
+ pointer-events: none;
+
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.command-line-prompt > span:before {
+ color: #999;
+ content: ' ';
+ display: block;
+ padding-right: 0.8em;
+}
+
+.command-line-prompt > span[data-user]:before {
+ content: "[" attr(data-user) "@" attr(data-host) "] $";
+}
+
+.command-line-prompt > span[data-user="root"]:before {
+ content: "[" attr(data-user) "@" attr(data-host) "] #";
+}
+
+.command-line-prompt > span[data-prompt]:before {
+ content: attr(data-prompt);
+}
+
diff --git a/docs/0.9.80/assets/prism.js b/docs/0.9.80/assets/prism.js
new file mode 100644
index 000000000..8be365786
--- /dev/null
+++ b/docs/0.9.80/assets/prism.js
@@ -0,0 +1,13 @@
+/* PrismJS 1.9.0
+http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+sass+scss&plugins=toolbar+unescaped-markup+command-line+copy-to-clipboard */
+var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/ e.length)return;if(!(w instanceof s)){h.lastIndex=0;var _=h.exec(w),P=1;if(!_&&m&&b!=t.length-1){if(h.lastIndex=k,_=h.exec(e),!_)break;for(var A=_.index+(d?_[1].length:0),j=_.index+_[0].length,x=b,O=k,N=t.length;N>x&&(j>O||!t[x].type&&!t[x-1].greedy);++x)O+=t[x].length,A>=O&&(++b,k=O);if(t[b]instanceof s||t[x-1].greedy)continue;P=x-b,w=e.slice(k,O),_.index-=k}if(_){d&&(p=_[1].length);var A=_.index+p,_=_[0].slice(p),j=A+_.length,S=w.slice(0,A),C=w.slice(j),M=[b,P];S&&(++b,k+=S.length,M.push(S));var E=new s(g,f?n.tokenize(_,f):_,y,_,m);if(M.push(E),C&&M.push(C),Array.prototype.splice.apply(t,M),1!=P&&n.matchGrammar(e,t,r,b,k,!0,g),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
+Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
+Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-