"use strict";var ApplicationConfiguration=function(){var a="TellForm-Form",b=["duScroll","ui.select","ngSanitize","vButton","ngResource","TellForm-Form.form_templates","ui.router","ui.bootstrap","pascalprecht.translate"],c=function(b,c){angular.module(b,c||[]),angular.module(a).requires.push(b)};return{applicationModuleName:a,applicationModuleVendorDependencies:b,registerModule:c}}();angular.module(ApplicationConfiguration.applicationModuleName,ApplicationConfiguration.applicationModuleVendorDependencies),angular.module(ApplicationConfiguration.applicationModuleName).config(["$locationProvider",function(a){a.hashPrefix("!")}]),angular.module(ApplicationConfiguration.applicationModuleName).constant("APP_PERMISSIONS",{viewAdminSettings:"viewAdminSettings",editAdminSettings:"editAdminSettings",editForm:"editForm",viewPrivateForm:"viewPrivateForm"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("USER_ROLES",{admin:"admin",normal:"user",superuser:"superuser"}),angular.module(ApplicationConfiguration.applicationModuleName).constant("FORM_URL","/forms/:formId"),angular.element(document).ready(function(){"#_=_"===window.location.hash&&(window.location.hash="#!"),angular.bootstrap(document,[ApplicationConfiguration.applicationModuleName])}),angular.module("TellForm-Form.form_templates",[]).run(["$templateCache",function(a){a.put("form_modules/forms/base/views/form-not-found.client.view.html",'

404 - Form Does not Exist

The form you are trying to access does not exist. Sorry about that!
'),a.put("form_modules/forms/base/views/form-unauthorized.client.view.html",'

Not Authorized to Access Form

The form you are trying to access is currently private and not accesible publically.
If you are the owner of the form, you can set it to "Public" in the "Configuration" panel in the form admin.
'),a.put("form_modules/forms/base/views/submit-form.client.view.html","
"),a.put("form_modules/forms/base/views/directiveViews/entryPage/startPage.html",'

{{pageData.introTitle}}

{{pageData.introParagraph}}

'),a.put("form_modules/forms/base/views/directiveViews/field/date.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/dropdown.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/hidden.html",""),a.put("form_modules/forms/base/views/directiveViews/field/legal.html",'
'),a.put("form_modules/forms/base/views/directiveViews/field/radio.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/rating.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}

'),a.put("form_modules/forms/base/views/directiveViews/field/statement.html",'

{{field.title}}

{{field.description}}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/field/textarea.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{ \'NEWLINE\' | translate }}

{{field.description}}

Press SHIFT+ENTER to add a newline
{{ \'ENTER\' | translate }}
'),a.put("form_modules/forms/base/views/directiveViews/field/textfield.html",'

{{index+1}} {{field.title}} ({{ \'OPTIONAL\' | translate }})

{{field.description}}

{{ \'ENTER\' | translate }}
'),a.put("form_modules/forms/base/views/directiveViews/field/yes_no.html",'

{{index+1}} {{field.title}} {{ \'OPTIONAL\' | translate }}

{{field.description}}


'),a.put("form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",'

{{myform.startPage.introTitle}}

{{myform.startPage.introParagraph}}

{{ \'COMPLETING_NEEDED\' | translate:translateAdvancementData }}
{{ \'FORM_SUCCESS\' | translate }}

{{myform.endPage.title}}

{{myform.endPage.paragraph}}

')}]),ApplicationConfiguration.registerModule("view-form",["ngFileUpload","ui.date","angular-input-stars"]),angular.module("view-form").config(["$stateProvider",function(a){a.state("submitForm",{url:"/forms/:formId",templateUrl:"/static/form_modules/forms/base/views/submit-form.client.view.html",resolve:{Forms:"Forms",myForm:["Forms","$q","$state","$stateParams",function(a,b,c,d){var e=b.defer();return a.get({formId:d.formId}).$promise.then(function(a){e.resolve(a)},function(a){c.go("unauthorizedFormAccess"),e.reject({redirectTo:"unauthorizedFormAccess"})}),e.promise}]},controller:"SubmitFormController",controllerAs:"ctrl"}).state("unauthorizedFormAccess",{url:"/forms/unauthorized",templateUrl:"/static/form_modules/forms/base/views/form-unauthorized.client.view.html"}).state("formNotFound",{url:"*path",templateUrl:"/static/form_modules/forms/base/views/form-not-found.client.view.html"})}]),function(){function a(a,b){function c(b,c,d){var e=window.navigator.userLanguage||window.navigator.language;e=e.slice(0,2);var f=navigator.userAgent,g=new MobileDetect(f),h="other";g.tablet()?h="tablet":g.mobile()?h="mobile":g.is("bot")||(h="desktop");var i={referrer:document.referrer,isSubmitted:b.submitted,formId:b._id,lastActiveField:b.form_fields[c]._id,timeElapsed:d,language:e,deviceType:h,ipAddr:null,geoLocation:null};a.emit("form-visitor-data",i)}function d(){a.socket||a.connect(),a.on("disconnect",function(){a.connect()})}var e={send:c};return d(),e}angular.module("view-form").factory("SendVisitorData",a),a.$inject=["Socket","$state"]}(),angular.module("view-form").directive("keyToOption",function(){return{restrict:"A",scope:{field:"="},link:function(a,b,c,d){b.bind("keydown keypress",function(b){var c=b.which||b.keyCode,d=parseInt(String.fromCharCode(c))-1;d',restrict:"E",scope:{typeName:"@"},controller:["$scope",function(a){var b={textfield:"fa fa-pencil-square-o",dropdown:"fa fa-th-list",date:"fa fa-calendar",checkbox:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",email:"fa fa-envelope-o",textarea:"fa fa-pencil-square",legal:"fa fa-legal",file:"fa fa-cloud-upload",rating:"fa fa-star-half-o",link:"fa fa-link",scale:"fa fa-sliders",stripe:"fa fa-credit-card",statement:"fa fa-quote-left",yes_no:"fa fa-toggle-on",number:"fa fa-slack"};a.typeIcon=b[a.typeName]}]}});var __indexOf=[].indexOf||function(a){for(var b=0,c=this.length;b=0&&(c=c+b+".html"),d.get(c)};return{template:"
{{field.title}}
",restrict:"E",scope:{field:"=",required:"&",design:"=",index:"=",forms:"="},link:function(a,d){c.chooseDefaultOption=a.chooseDefaultOption=function(b){"yes_no"===b?a.field.fieldValue="true":"rating"===b?a.field.fieldValue=0:"radio"===a.field.fieldType?a.field.fieldValue=a.field.fieldOptions[0].option_value:"legal"===b&&(a.field.fieldValue="true",c.nextField())},a.nextField=c.nextField,a.setActiveField=c.setActiveField,"date"===a.field.fieldType&&(a.dateOptions={changeYear:!0,changeMonth:!0,altFormat:"mm/dd/yyyy",yearRange:"1900:-0",defaultDate:0});var e=a.field.fieldType;if("number"===a.field.fieldType||"textfield"===a.field.fieldType||"email"===a.field.fieldType||"link"===a.field.fieldType){switch(a.field.fieldType){case"textfield":a.input_type="text";break;case"email":a.input_type="email",a.placeholder="joesmith@example.com";break;case"number":a.input_type="text",a.validateRegex=/^-?\d+$/;break;default:a.input_type="url",a.placeholder="http://example.com"}e="textfield"}var g=f(e);d.html(g).show();b(d.contents())(a)}}}]),angular.module("view-form").directive("onEnterKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode,e=!1;null!==d.onEnterKeyDisabled&&(e=d.onEnterKeyDisabled),13!==c||b.shiftKey||e||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterKey)}))})}}}]).directive("onTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keyup keypress",function(b){var c=b.which||b.keyCode;9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onTabKey)}))})}}}]).directive("onEnterOrTabKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;13!==c&&9!==c||b.shiftKey||(b.preventDefault(),a.$apply(function(){a.$eval(d.onEnterOrTabKey)}))})}}}]).directive("onTabAndShiftKey",["$rootScope",function(a){return{restrict:"A",link:function(b,c,d){c.bind("keydown keypress",function(b){var c=b.which||b.keyCode;9===c&&b.shiftKey&&(console.log("onTabAndShiftKey"),b.preventDefault(),a.$apply(function(){a.$eval(d.onTabAndShiftKey)}))})}}}]),angular.module("view-form").directive("onFinishRender",["$rootScope","$timeout",function(a,b){return{restrict:"A",link:function(b,c,d){if(c.attr("ng-repeat")||c.attr("data-ng-repeat")){var e=d.onFinishRender||"ngRepeat";b.$first&&!b.$last?b.$evalAsync(function(){a.$broadcast(e+" Started")}):b.$last&&b.$evalAsync(function(){a.$broadcast(e+" Finished")})}}}}]),jsep.addBinaryOp("contains",10),jsep.addBinaryOp("!contains",10),jsep.addBinaryOp("begins",10),jsep.addBinaryOp("!begins",10),jsep.addBinaryOp("ends",10),jsep.addBinaryOp("!ends",10),angular.module("view-form").directive("submitFormDirective",["$http","TimeCounter","$filter","$rootScope","SendVisitorData","$translate","$timeout",function(a,b,c,d,e,f,g){return{templateUrl:"form_modules/forms/base/views/directiveViews/form/submit-form.client.view.html",restrict:"E",scope:{myform:"=",ispreview:"="},controller:["$document","$window","$scope",function(f,g,h){var i=!1,j="submit_field";h.forms={},h.ispreview&&b.restartClock();var k=h.myform.visible_form_fields.filter(function(a){return"statement"!==a.fieldType}).length,l=c("formValidity")(h.myform);h.translateAdvancementData={done:l,total:k,answers_not_completed:k-l},h.reloadForm=function(){h.myform.submitted=!1,h.myform.form_fields=_.chain(h.myform.visible_form_fields).map(function(a){return a.fieldValue="",a}).value(),h.loading=!1,h.error="",h.selected={_id:"",index:0},h.setActiveField(h.myform.visible_form_fields[0]._id,0,!1),b.restartClock()};var m=function(a){var b=a.logicJump;if(b.enabled&&b.expressionString&&b.valueB&&a.fieldValue){var c,d,e=jsep(b.expressionString); if("field"===e.left.name?(c=a.fieldValue,d=b.valueB):(c=b.valueB,d=a.fieldValue),"number"===a.fieldType||"scale"===a.fieldType||"rating"===a.fieldType)switch(e.operator){case"==":return parseInt(c)===parseInt(d);case"!==":return parseInt(c)!==parseInt(d);case">":return parseInt(c)>parseInt(d);case">=":return parseInt(c)>parseInt(d);case"<":return parseInt(c)-1;case"!contains":return!(c.indexOf(d)>-1);case"begins":return c.startsWith(d);case"!begins":return!c.startsWith(d);case"ends":return c.endsWith(d);case"!ends":return c.endsWith(d);default:return!1}}},n=function(){if(null===h.selected)throw console.error("current active field is null"),new Error("current active field is null");return h.selected._id===j?h.myform.form_fields.length-1:h.selected.index};h.isActiveField=function(a){return h.selected._id===a._id},h.setActiveField=d.setActiveField=function(a,b,d){if(null!==h.selected&&(a||null!==b)){if(a){if(null===b){b=h.myform.visible_form_fields.length;for(var e=0;e .field-directive:nth-of-type("+String(h.myform.visible_form_fields.length-1)+")"),m=$(l).height(),n=k-g-1.2*m,o=.9;h.selected.index===h.myform.visible_form_fields.length?bn?(a=h.selected.index+1,h.setActiveField(j,a,!1)):ef*o&&(a=h.selected.index-1,h.setActiveField(null,a,!1))}h.$apply()},d.nextField=h.nextField=function(){if(h.selected&&h.selected.index>-1)if(h.selected._id!==j){var a=h.myform.visible_form_fields[h.selected.index];a.logicJump&&a.logicJump.jumpTo&&m(a)?h.setActiveField(a.logicJump.jumpTo,null,!0):h.selected.index0&&h.setActiveField(null,a,!0)},d.goToInvalid=h.goToInvalid=function(){var a=$(".row.field-directive .ng-invalid.focusOn, .row.field-directive .ng-untouched.focusOn:not(.ng-valid)").first().parents(".row.field-directive").first().attr("data-id");h.setActiveField(a,null,!0)},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)};var o=function(){var a=new MobileDetect(window.navigator.userAgent),b="other";return a.tablet()?b="tablet":a.mobile()?b="mobile":a.is("bot")||(b="desktop"),{type:b,name:window.navigator.platform}},p=function(){$.ajaxSetup({async:!1});var a=$.getJSON("https://freegeoip.net/json/").responseJSON;return $.ajaxSetup({async:!0}),a&&a.ip||(a={ip:"Adblocker"}),{ipAddr:a.ip,geoLocation:{City:a.city,Country:a.country_name}}};d.submitForm=h.submitForm=function(){if(h.forms.myForm.$invalid)return void h.goToInvalid();var d=b.stopClock();h.loading=!0;var f=_.cloneDeep(h.myform),g=o();f.device=g;var i=p();f.ipAddr=i.ipAddr,f.geoLocation=i.geoLocation,f.timeElapsed=d,f.percentageComplete=c("formValidity")(h.myform)/h.myform.visible_form_fields.length*100,delete f.endPage,delete f.isLive,delete f.provider,delete f.startPage,delete f.visible_form_fields,delete f.analytics,delete f.design,delete f.submissions,delete f.submitted;for(var j=0;j