text: (function(){rivets.binders.append={routine:function(a,b){return a.checked=void 0!==_.find(b,function(b){return String(b)===String(a.value)})},bind:function(a){var b=this;return this.callback=function(){var c,d;return c=_.clone(b.model.get(b.keypath))||[],_.contains(c,a.value)?(d=_.without(c,a.value),b.model.set(b.keypath,d)):(c.push(a.value),b.model.set(b.keypath,c))},$(a).on("change",this.callback)},unbind:function(a){return $(a).off("change",this.callback)}},rivets.formatters.length=function(a){return a?a.length:0},rivets.binders.input={publishes:!0,routine:rivets.binders.value.routine,bind:function(a){return $(a).bind("input.rivets",this.publish)},unbind:function(a){return $(a).unbind("input.rivets")}},rivets.configure({prefix:"rv",adapter:{subscribe:function(a,b,c){return c.wrapped=function(a,b){return c(b)},a.on("change:"+b,c.wrapped)},unsubscribe:function(a,b,c){return a.off("change:"+b,c.wrapped)},read:function(a,b){return"cid"===b?a.cid:a.get(b)},publish:function(a,b,c){return a.cid?a.set(b,c):a[b]=c}}})}).call(this),function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p={}.hasOwnProperty,q=function(a,b){function c(){this.constructor=a}for(var d in b)p.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},r=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};e=function(a){function b(){return i=b.__super__.constructor.apply(this,arguments)}var d;return q(b,a),d={},b.prototype.sync=function(){},b.prototype.indexInDOM=function(){return void 0===d[this.cid]&&$(".fb-field-wrapper").each(function(a,b){return d[$(b).data("cid")]=$(b),!0}),(d[this.cid]||{index:function(){return-1}}).index(".fb-field-wrapper")},b.prototype.is_input=function(){return null!=c.inputFields[this.get(c.options.mappings.TYPE)]},b.prototype.initialize=function(){return null==this.attributes.uuid&&(this.attributes.uuid=uuid.v4()),void 0===!this.attributes.parent_uuid&&(this.attributes.parent_uuid=null),this.attachMethods()},b.prototype.parentModel=function(){var a;return a=this.collection,a?this.collection.findWhereUuid(this.get("parent_uuid")):void 0},b.prototype.hasParent=function(){return void 0!==this.parentModel()},b.prototype.inTable=function(){var a;return a=this.parentModel(),a&&"table"===a.get("type")},b.prototype.inGrid=function(){var a;return a=this.parentModel(),a&&"grid"===a.get("type")},b.prototype.canBeConditionallyDisplayed=function(){return!this.inTable()&&!this.inGrid()&&c.conditionalFunctionality},b.prototype.canShowReferenceID=function(){return c.showReferenceIDFunctionality},b.prototype.conditionalParent=function(){var a;return a=this.get(c.options.mappings.CONDITIONAL_PARENT),a?this.collection.findWhereUuid(a):null},b.prototype.conditionalChildren=function(){var a;return a=this.attributes.uuid,this.collection.filter(function(b){return a===b.get(c.options.mappings.CONDITIONAL_PARENT)})},b.prototype.answers=function(){return this.get("answers")||[]},b.prototype.conditionalTriggerOptions=function(a){var b,d,e;return d=this.conditionalParent(),b=[],d&&("approval"===d.get("type")?b="Is Approved":(b=_.clone(d.answers()),b.unshift({uuid:"",label:"[No Selection]"}),a&&(e=this.get(c.options.mappings.CONDITIONAL_VALUES)||[],b=_.filter(b,function(a){var b;return b=a.uuid,r.call(e,b)>=0})))),b},b.prototype.isValid=function(){var a,b,d,e,f,g;return(b=this.canBeConditionallyDisplayed())?(f=this.attributes.options,a=f.conditional,a&&(d=a.parent,e=a.values,g=this.conditionalParent(),g&&"approval"===g.get("type")&&(this.get(c.options.mappings.CONDITIONAL_VALUES)||this.set(c.options.mappings.CONDITIONAL_VALUES,1),e=1)),d&&e&&0!==e.length||"undefined"==typeof e&&"undefined"==typeof d?!0:!1):!0},b.prototype.attachMethods=function(){return"function"==typeof this.attributes.initialize&&(this.attributes.initialize.call(this),delete this.attributes.initialize),"function"==typeof this.attributes.insertion&&(this.insertion=this.attributes.insertion,delete this.attributes.insertion),_.each(this.attributes,function(a,b){return"function"==typeof a&&void 0===this[b]?(this[b]=a,delete this.attributes[b]):void 0},this)},b}(Backbone.DeepModel),d=function(a){function b(){return j=b.__super__.constructor.apply(this,arguments)}return q(b,a),b.prototype.model=e,b.prototype.comparator=function(a){return a.indexInDOM()},b.prototype.add=function(a){var c;return c=a=b.__super__.add.call(this,a),_.isArray(a)||(c=[a]),_.each(c,function(a){return"function"==typeof a.insertion?a.insertion.call(a):void 0}),a},b.prototype.findWhereUuid=function(a){return this.findWhere({uuid:a})},b.prototype.findDataSourceFields=function(){return this.where({type:"datasource"})},b.prototype.findConditionalTriggers=function(a){var b;return b=this.filter(function(b){var c,d,e,f;return c="dropdown"===(f=b.get("type"))||"checkbox"===f||"radio"===f||"approval"===f,d=b!==a,e=!b.hasParent(),c&&d&&e})},b.prototype.clearConditionEle=function(a){return a.unset(c.options.mappings.CONDITIONAL)},b}(Backbone.Collection),h=function(a){function b(){return k=b.__super__.constructor.apply(this,arguments)}return q(b,a),b.insert=function(a,b,c,d,e){var f,g,h,i,j;return i=c.parentModel(),void 0===i||"grid"===i.get("type")||"table"===i.get("type")?(h=e.$appendEl||null,j=e.$replaceEl||null,f=a.$responseFields.find("a.dragdrop-placeholder"),null!=h?h.html(b.render().el):null!=j?j.replaceWith(b.render().el):f[0]?(f.after(b.render().el),f.remove()):null==e.position||-1===e.position?a.$responseFields.append(b.render().el):0===e.position?a.$responseFields.prepend(b.render().el):(g=a.$responseFields.find(".fb-field-wrapper").eq(e.position))[0]?g.before(b.render().el):a.$responseFields.append(b.render().el)):void 0},b.prototype.className="fb-field-wrapper",b.prototype.events={"click .subtemplate-wrapper":"focusEditView","click .js-duplicate":"duplicate","click .js-clear":"clear"},b.prototype.initialize=function(a){return this.parentView=a.parentView,this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"destroy",this.remove)},b.prototype.render=function(){return this.$el.addClass("response-field-"+this.model.get(c.options.mappings.TYPE)).data("cid",this.model.cid).data("uuid",this.model.get("uuid")).html(c.templates["view/base"+(this.model.is_input()?"":"_non_input")]({rf:this.model})),this},b.prototype.focusEditView=function(){return this.parentView.createAndShowEditView(this.model)},b.prototype.clear=function(a){var b,d,e=this;switch(a.preventDefault(),a.stopPropagation(),_.each(this.model.conditionalChildren(),function(a){return a.unset(c.options.mappings.CONDITIONAL_PARENT),a.unset(c.options.mappings.CONDITIONAL_VALUES)}),b=function(){return e.parentView.handleFormUpdate(),e.model.destroy()},d=c.options.CLEAR_FIELD_CONFIRM,typeof d){case"string":if(confirm(d))return b();break;case"function":return d(b);default:return b()}},b.prototype.duplicate=function(a){var b,d,e;a.preventDefault(),a.stopPropagation(),d=c.helpers.clone(this.model.attributes),b=c.helpers.defaultFieldAttrs(d.type,{});for(e in d)b[e]=d[e];return delete b.id,delete b.cid,delete b.uuid,b.label+=" Copy",b.options.grid&&(b.options.grid.row=b.options.grid.row+1),this.parentView.createField(b,{position:this.model.indexInDOM()+1}),this.model.trigger("duplicate:viewfield")},b}(Backbone.View),g=function(a){function b(){return l=b.__super__.constructor.apply(this,arguments)}return q(b,a),b.prototype.className="fb-field-wrapper",b.prototype.initialize=function(a){return this.parentView=a.parentView,this.listenTo(this.model,"change",this.update),this.listenTo(this.model,"destroy",this.remove),_.each(this.model.get("options.elements"),function(a){var b;return b=this.model.collection.findWhereUuid(a.uuid),b?this.listenTo(b,"change",this.update):console.log(a.uuid)},this)},b.prototype.events={mouseenter:"showSelectors",mouseleave:"removeSelectors","click .drop-area li":"inlineAdd","click .subtemplate-wrapper":"focusEditView","click .response-field-table td.header":"focusSubelement","click .response-field-table td.element":"focusSubelement","click .js-clear":"clear","click .js-duplicate":"duplicate"},b.prototype.showSelectors=function(a){return this.$el.find(".drop-area").html(c.templates["view/element_selector"]())},b.prototype.removeSelectors=function(a){return this.$el.find(".drop-area").html("")},b.prototype.inlineAdd=function(a){var b,d,f;return a.preventDefault(),a.stopPropagation(),b=new e(c.helpers.defaultFieldAttrs($(a.currentTarget).data("type"))),b.set("parent_uuid",this.model.get("uuid")),b.set("options.in_sequence",!0),this.listenTo(b,"change",this.update),d=this.model.attributes.options.elements||[],f={uuid:b.get("uuid")},d.push(f),this.model.attributes.options.elements=d,this.parentView.collection.add(b),this.update(b)},b.prototype.update=function(a){return a?(this.render(),this.parentView.createAndShowEditView(a)):void 0},b.prototype.render=function(){return b.__super__.render.call(this),this.renderElements(),this},b.prototype.focusEditView=function(a){return $(a.target).parents(".dropdown-toggle").length||$(a.target).hasClass("dropdown-toggle")?void 0:this.parentView.createAndShowEditView(this.model)},b.prototype.focusSubelement=function(a){var b;return a.preventDefault(),a.stopPropagation(),b=$(a.currentTarget).data("uuid"),b?this.parentView.createAndShowEditView(this.parentView.modelByUuid(b)):void 0},b.prototype.renderElements=function(){return _.each(this.model.get("options.elements"),function(a){var b;return b=this.parentView.modelByUuid(a.uuid),this.$el.find(".header-"+a.uuid).html(c.templates["view/table_header"]({rf:b,element:a})).css("background-color",b.get(c.options.mappings.LABEL_BACKGROUND_COLOR)).data("cid",b.cid),this.$el.find(".element-"+a.uuid).html(c.templates["view/table_element"]({rf:b,element:a})).data("cid",b.cid),this.$el.find(".total-"+a.uuid).html(c.templates["view/table_total"]({rf:b,element:a})).data("cid",b.cid)},this)},b.prototype.clear=function(a){var b,c;return a.preventDefault(),a.stopPropagation(),c=$(a.currentTarget).parents(".element").data("uuid"),void 0===c?(b=_.each(this.model.get("options.elements"),function(a){return this.parentView.modelByUuid(a.uuid).destroy(),!0},this),this.model.destroy(),this.$el.remove()):(this.parentView.modelByUuid(c).destroy(),this.model.set("options.elements",_.filter(this.model.get("options.elements"),function(a){return a.uuid!==c})),this.render())},b.prototype.duplicate=function(){var a,b,d,f,g=this;return a=c.helpers.clone(this.model.attributes),delete a.id,delete a.cid,a.uuid=uuid.v4(),a.label+=" Copy",f=a.options.elements,a.options.elements=[],a=_.extend({},c.helpers.defaultFieldAttrs("table"),a),this.parentView.createField(a,{position:-1}),d=this.parentView.viewByUuid(a.uuid),b=this.parentView.modelByUuid(a.uuid),_.each(f,function(f){var h,i,j,k;return h=g.parentView.modelByUuid(f.uuid),i=c.helpers.clone(h),delete i.id,delete i.cid,f.uuid=i.uuid=uuid.v4(),i.parent_uuid=a.uuid,i=_.extend({},c.helpers.defaultFieldAttrs(i.type),i),j=new e(i),f.totalColumn&&(k=b.createTotalColumnModel(i.uuid),f.totalColumnUuid=k.get("uuid")),g.parentView.collection.add(j),void 0!==j.expression&&j.get("options.calculation_type")&&j.expression(),d.listenTo(j,"change",d.update),a.options.elements.push(f)}),d.render()},b.insert=function(a,b,c,d,e){var f;return f=a.viewByUuid(c.get("parent_uuid")),null!=f?!0:!1},b}(h),f=function(a){function b(){return m=b.__super__.constructor.apply(this,arguments)}return q(b,a),b.prototype.className="fb-field-wrapper",b.prototype.events={"click .response-field-grid-cell li":"inlineAdd","click .response-field-grid-cell .js-clear":"subelementClear","click .js-duplicate":"duplicate","click .js-clear":"clear","click .subtemplate-wrapper":"focusEditView"},b.prototype.initialize=function(a){return this.parentView=a.parentView,this.listenTo(this.model,"change",this.redraw),this.listenTo(this.model,"destroy",this.remove),this.parentView.collection.bind("add",this.addSubelement,this),this.parentView.collection.bind("destroy",this.removeSubelement,this),this.render},b.prototype.render=function(){return b.__super__.render.call(this),this.redraw(),this.renderChildren(),this},b.prototype.redraw=function(){var a;return a=this.$el.find(".response-field-grid-table").detach(),this.$el.addClass("response-field-"+this.model.get(c.options.mappings.TYPE)).data("cid",this.model.cid).data("uuid",this.model.get("uuid")).html(c.templates["view/base"+(this.model.is_input()?"":"_non_input")]({rf:this.model})),1===a.length&&this.$el.find(".response-field-grid-table").replaceWith(a),this.renderTable()},b.prototype.renderTable=function(){var a,b,d,e,f,g,h,i,j,k=this;return e=this.model.get("options.num_rows")||1,d=this.model.get("options.num_cols")||1,h=this.$el.find("table"),b=h.find("tr").length,a=h.find("tr:nth-child(1) td").length,f=$.makeArray(h.find("tr")),e>b&&(f=f.concat(function(){j=[];for(var a=i=f.length;e>=i?e>a:a>e;e>=i?a++:a--)j.push(a);return j}.apply(this))),f=_.map(f,function(a){var b,e,f;return _.isNumber(a)&&(a=$('<tr class="response-field-grid-row"></tr>').appendTo(h)),b=$.makeArray($(a).find("td")),b.length<d&&(b=b.concat(function(){f=[];for(var a=e=b.length;d>=e?d>a:a>d;d>=e?a++:a--)f.push(a);return f}.apply(this))),b=_.map(b,function(b){return _.isNumber(b)?b=$('<td class="response-field-grid-cell"></td>').appendTo(a).html(c.templates["view/element_selector"]()):void 0}),a}),b>e&&(g=this.subelements(),_.each(g,function(a){var b;return b=k.parentView.gridAttr(a),b.row>e-1?a.destroy():void 0}),h.find("tr").slice(e-b).remove()),a>d?(g=this.subelements(),_.each(g,function(a){var b;return b=k.parentView.gridAttr(a),b.col>d-1?a.destroy():void 0}),h.find("tr").find("td:gt("+(d-1)+")").remove()):void 0},b.prototype.renderChildren=function(){var a,b=this;return a=this.model.get("children")||[],_.each(a,function(a){var c;return c=a.options.grid,b.createField(a,b.getSubelement(c.row,c.col))})},b.prototype.focusEditView=function(a){return 0===$(a.target).parents("table").length?this.parentView.createAndShowEditView(this.model):void 0},b.prototype.clear=function(a){var b,d,e=this;switch(a.preventDefault(),a.stopPropagation(),b=function(){var a;return e.parentView.handleFormUpdate(),a=e.subelements(),_.each(e.subelements(),function(a){return a.destroy(),!0}),e.model.destroy()},d=c.options.CLEAR_FIELD_CONFIRM,typeof d){case"string":if(confirm(d))return b();break;case"function":return d(b);default:return b()}},b.prototype.duplicate=function(){var a,b,d=this;return a=c.helpers.clone(this.model.attributes),delete a.id,delete a.cid,a.uuid=uuid.v4(),a.label+=" Copy",b=this.subelements(),delete a.children,this.parentView.createField(a,{position:-1}),a.children=_.map(b,function(b){var e;return e=c.helpers.clone(b.attributes),delete e.id,delete e.cid,delete e.uuid,e.parent_uuid=a.uuid,d.parentView.createField(e,{position:-1})})},b.prototype.addSubelement=function(a){var b,c;return this.belongsToMe(a)&&a.get("label").match(/Copy/)?(b=this.parentView.gridAttr(a),c=a.get("label").match(/(.+) Copy/),null!==c?a.attributes.label=c[1]+" "+(b.row+1):a.attributes.label="Row: "+(b.row+1)+", Col: "+(b.col+1)):void 0},b.prototype.removeSubelement=function(a){var b,d;return d=this.parentView.gridAttr(a),b=this.belongsToMe(a),b&&""===this.getSubelement(d.row,d.col).html()?this.getSubelement(d.row,d.col).html(c.templates["view/element_selector"]({rf:this.model})):void 0},b.prototype.subelements=function(){var a=this;return this.parentView.collection.filter(function(b){return a.belongsToMe(b)})},b.prototype.belongsToMe=function(a){return this.parentView.inGrid(a)&&a.get("parent_uuid")===this.model.get("uuid")},b.prototype.inlineAdd=function(a){var b,c;return a.preventDefault(),a.stopPropagation(),c=$(a.currentTarget).data("type"),b=$(a.currentTarget).parents(".response-field-grid-cell"),this.createField(c,b)},b.prototype.getSubelement=function(a,b){return a++,b++,this.$el.find("tr:nth-child("+a+") td:nth-child("+b+")")},b.prototype.createField=function(a,b){return _.isString(a)&&(a=c.helpers.defaultFieldAttrs(a)),a.options.disallow_duplication=!0,a.options.grid={col:b.prop("cellIndex"),row:b.parents("tr").prop("rowIndex")},a.parent_uuid=this.model.get("uuid"),this.parentView.createField(a,{$appendEl:b})},b.insert=function(a,b,c,d,e){var f,g,i;return e.$appendEl||(i=c.get("options.grid.row"),g=c.get("options.grid.col"),c.attributes.options.disallow_duplication=!0,f=a.wrapperByUuid(c.get("parent_uuid")),f=f.find("tr:nth-child("+(i+1)+") td:nth-child("+(g+1)+")"),1===f.length&&(e.$appendEl=f)),h.insert(a,b,c,d,e)},b}(Backbone.View),b=function(a){function b(){return n=b.__super__.constructor.apply(this,arguments)}return q(b,a),b.prototype.className="edit-response-field",b.prototype.events={"click .js-add-option":"addOption","click .js-remove-option":"removeOption","click .js-default-updated":"defaultUpdated","input .option-label-input":"forceRender"},b.prototype.initialize=function(a){var b=this;return this.parentView=a.parentView,this.listenTo(this.model,"destroy",this.remove),_.each(c.options.change,function(a,d){var e;return e="change:"+_.nested(c.options.mappings,d),b.listenTo(b.model,e,a)})},b.prototype.render=function(){return this.$el.html(c.templates["edit/base"+(this.model.is_input()?"":"_non_input")]({rf:this.model})),rivets.bind(this.$el,{model:this.model}),this},b.prototype.reset=function(){return this.stopListening(),this.parentView.editView=void 0,this.parentView.createAndShowEditView(this.model)},b.prototype.resetConditional=function(){return this.model.unset(c.options.mappings.CONDITIONAL_VALUES)},b.prototype.resetInlineImages=function(){return this.model.unset(c.options.mappings.INLINE_IMAGES_REQUIRED)},b.prototype.resetInlineActions=function(){return this.model.unset(c.options.mappings.INLINE_ACTIONS_REQUIRED)},b.prototype.deselectReadOnly=function(){return this.model.set(c.options.mappings.READ_ONLY,!1)},b.prototype.remove=function(){return this.parentView.editView=void 0,this.parentView.$el.find('[data-target="#addField"]').click(),this.stopListening(),b.__super__.remove.apply(this,arguments)},b.prototype.addOption=function(a){var b,d,e,f;return b=$(a.currentTarget),d=this.$el.find(".option").index(b.closest(".option")),f=this.model.get(c.options.mappings.OPTIONS)||[],e={uuid:uuid.v4(),label:"",checked:!1},d>-1?f.splice(d+1,0,e):f.push(e),this.model.set(c.options.mappings.OPTIONS,f),this.model.trigger("change:"+c.options.mappings.OPTIONS),this.forceRender()},b.prototype.removeOption=function(a){var b,d,e;return b=$(a.currentTarget),d=this.$el.find(".js-remove-option").index(b),e=this.model.get(c.options.mappings.OPTIONS),e.splice(d,1),this.model.set(c.options.mappings.OPTIONS,e),this.model.trigger("change:"+c.options.mappings.OPTIONS),this.forceRender()},b.prototype.defaultUpdated=function(a){var b;return b=$(a.currentTarget),"checkboxes"!==this.model.get(c.options.mappings.TYPE)&&this.$el.find(".js-default-updated").not(b).attr("checked",!1).trigger("change"),this.forceRender()},b.prototype.forceRender=function(){return this.model.trigger("change",this.model)},b}(Backbone.View),a=function(a){function e(){return o=e.__super__.constructor.apply(this,arguments)}return q(e,a),e.prototype.SUBVIEWS=[],e.prototype.saveFormButton=$(),e.prototype.events={"click .fb-tabs a":"showTab","click .fb-add-types a":"addField","mouseover .fb-add-types":"lockLeftWrapper","mouseout .fb-add-types":"unlockLeftWrapper"},e.prototype.initialize=function(a){var b;return b=a.selector,this.formBuilder=a.formBuilder,this.bootstrapData=a.bootstrapData,null!=b&&this.setElement($(b)),this.collection=new d,this.collection.bind("add",this.addOne,this),this.collection.bind("reset",this.reset,this),this.collection.bind("change",this.handleFormUpdate,this),this.collection.bind("destroy add reset",this.hideShowNoResponseFields,this),this.collection.bind("destroy",this.ensureEditViewScrolled,this),this.render(),this.collection.reset(this.bootstrapData),this.bindSaveEvent()},e.prototype.bindSaveEvent=function(){var a=this;return this.formSaved=!0,this.saveFormButton.attr("disabled",!0).text(c.options.dict.ALL_CHANGES_SAVED),c.options.AUTOSAVE&&setInterval(function(){return a.saveForm.call(a)},5e3),$(window).bind("beforeunload",function(){return a.formSaved?void 0:c.options.dict.UNSAVED_CHANGES})},e.prototype.reset=function(){return this.$responseFields.html(""),this.addAll()},e.prototype.render=function(){var a,b,d,e;for(this.$el.html(c.templates.page()),this.$fbLeft=this.$el.find(".fb-left"),this.$responseFields=this.$el.find(".fb-response-fields"),this.bindWindowScrollEvent(),this.hideShowNoResponseFields(),e=this.SUBVIEWS,b=0,d=e.length;d>b;b++)a=e[b],new a({parentView:this}).render();return this},e.prototype.bindWindowScrollEvent=function(){var a=this;return $(window).on("scroll",function(){var b,c;if(a.$fbLeft.data("locked")!==!0)return c=Math.max(0,$(window).scrollTop()-a.$el.offset().top),b=a.$responseFields.height(),a.$fbLeft.css({"margin-top":Math.min(b,c)})})},e.prototype.showTab=function(a){var b,c,d,e;return b=$(a.currentTarget),d=!0,e=b.data("target"),this.editView&&!this.editView.model.isValid()&&(d=!1),(d||!d&&"#editField"===e)&&(b.closest("li").addClass("active").siblings("li").removeClass("active"),$(e).addClass("active").siblings(".fb-tab-pane").removeClass("active")),"#editField"!==e&&this.unlockLeftWrapper(),"#editField"===e&&!this.editView&&(c=this.collection.models[0])?this.createAndShowEditView(c):void 0},e.prototype.createView=function(a){var b;return b="grid"===a.attributes.type?new f({model:a,parentView:this}):"table"===a.attributes.type?new g({model:a,parentView:this}):new h({model:a,parentView:this})},e.prototype.insert=function(a,b,c,d){var e,i,j,k;return e=!1,i=b.parentModel(),j=i?i.get("type"):void 0,k=j||b.get("type"),"grid"===k?e=f.insert(this,a,b,c,d):"table"===k&&(e=g.insert(this,a,b,c,d)),e||(e=h.insert(this,a,b,c,d)),e},e.prototype.addOne=function(a,b,c){var d;return d=this.createView(a),this.$responseFields.find("> .ui-draggable").remove(),a.get("model_only")!==!0&&this.insert(d,a,b,c),this.views[a.get("uuid")]=d},e.prototype.setSortable=function(){var a=this;return this.$responseFields.hasClass("ui-sortable")&&this.$responseFields.sortable("destroy"),this.$responseFields.sortable({forcePlaceholderSize:!0,placeholder:"sortable-placeholder",stop:function(b,d){var e;return d.item.data("type")&&(d.item.after('<a class="dragdrop-placeholder">'),e=a.collection.create(c.helpers.defaultFieldAttrs(d.item.data("type")),{$replaceEl:d.item}),a.createAndShowEditView(e)),a.handleFormUpdate(),!0},update:function(b,c){return c.item.data("type")?void 0:a.ensureEditViewScrolled()}}),this.setDraggable()},e.prototype.setDraggable=function(){var a,b=this;return a=this.$el.find("[data-type]"),a.draggable({connectToSortable:this.$responseFields,helper:function(){var a;return a=$("<div class='response-field-draggable-helper' />"),a.css({width:b.$responseFields.width(),height:"80px"}),a}})},e.prototype.addAll=function(){return this.collection.each(function(a,b,c){return this.addOne.call(this,a,b,{})},this),this.setSortable()},e.prototype.hideShowNoResponseFields=function(){return this.$el.find(".fb-no-response-fields")[this.collection.length>0?"hide":"show"]()},e.prototype.addField=function(a){var b;return b=$(a.currentTarget).data("type"),this.createField(c.helpers.defaultFieldAttrs(b,{}))},e.prototype.createField=function(a,b){var c;return c=this.collection.create(a,b),this.createAndShowEditView(c),this.handleFormUpdate()},e.prototype.createAndShowEditView=function(a){var d,e,f,g,h,i,j,k;if(f=this.$el.find(".fb-field-wrapper").filter(function(){return $(this).data("cid")===a.cid}),i=!0,this.editView){if(this.editView.model.cid===a.cid)return this.$el.find('.fb-tabs a[data-target="#editField"]').click(),void this.scrollLeftWrapper(f);i=this.editView.model.isValid(),i?this.editView.remove():$(".fb-edit-section-conditional-wrapper #warning-message").show()}return i&&($(".fb-field-wrapper").removeClass("parent"),$(".fb-option").removeClass("trigger-option"),$(".fb-field-wrapper").removeClass("editing"),f.addClass("editing")),j=a.conditionalParent(),j&&(k=a.get(c.options.mappings.CONDITIONAL_VALUES)||[],e=this.$el.find(".fb-field-wrapper").filter(function(){return $(this).data("cid")===j.cid}),e.addClass("parent"),e.find(".fb-option").filter(function(){var a,b;return a=$(this).data("uuid"),b=$(this).data("uuid"),r.call(k,b)>=0}).each(function(){return $(this).addClass("trigger-option")})),i&&(this.editView=new b({model:a,parentView:this}),d=this.editView.render().$el,h=this.$el.find(".fb-edit-field-wrapper"),h.html(d),this.inGrid(a)?h.addClass("fb-edit-field-grid"):h.removeClass("fb-edit-field-grid"),a.inTable()&&$(".spectrum-colorpicker",".fb-edit-field-wrapper").spectrum({allowEmpty:!0,preferredFormat:"hex",showPalette:!0,showPaletteOnly:!0,palette:["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF","#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF","#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE","#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD","#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5","#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B","#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842","#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]}),this.$el.find('.fb-tabs a[data-target="#editField"]').click(),this.scrollLeftWrapper(f),g=c.helpers.defaultFieldAttrs(a.get("type")),void 0!==g.definition.onEdit&&g.definition.onEdit(a),this.$el.find("input, textarea, [contenteditable=true]").filter(":visible").first().focus()),this},e.prototype.inGrid=function(a){return this.hasParent(a)&&a.get("options.grid")},e.prototype.inTable=function(a){return this.hasParent(a)&&a.get("options.table")},e.prototype.hasParent=function(a){return a.get("parent_uuid")},e.prototype.modelByUuid=function(a){return this.collection.findWhere({uuid:a})},e.prototype.wrapperByUuid=function(a){return $(".fb-field-wrapper").filter(function(){return $(this).data("uuid")===a})},e.prototype.viewByUuid=function(a){return this.views[a]},e.prototype.views={},e.prototype.gridAttr=function(a){return this.inGrid(a)?a.get("options.grid"):null},e.prototype.ensureEditViewScrolled=function(){return this.editView?this.scrollLeftWrapper($(".fb-field-wrapper.editing")):void 0},e.prototype.scrollLeftWrapper=function(a){var b=this;return this.unlockLeftWrapper(),a[0]?$.scrollWindowTo(this.$el.offset().top+a.offset().top-this.$responseFields.offset().top,200,function(){return b.lockLeftWrapper()}):void 0},e.prototype.lockLeftWrapper=function(){return this.$fbLeft.data("locked",!0)},e.prototype.unlockLeftWrapper=function(){return this.$fbLeft.data("locked",!1)},e.prototype.handleFormUpdate=function(){return this.collection.sort(),this.updatingBatch?void 0:(this.formSaved=!1,this.saveFormButton.removeAttr("disabled").text(c.options.dict.SAVE_FORM))},e.prototype.getPayload=function(){return JSON.stringify({fields:this.collection.toJSON()})},e.prototype.saveForm=function(a){var b;if(!this.formSaved)return this.formSaved=!0,this.saveFormButton.attr("disabled",!0).text(c.options.dict.ALL_CHANGES_SAVED),this.collection.sort(),b=this.getPayload(),c.options.HTTP_ENDPOINT&&this.doAjaxSave(b),this.formBuilder.trigger("save",b)},e.prototype.doAjaxSave=function(a){var b=this;return $.ajax({url:c.options.HTTP_ENDPOINT,type:c.options.HTTP_METHOD,data:a,contentType:"application/json",success:function(a){var c,d,e,f;for(b.updatingBatch=!0,d=0,e=a.length;e>d;d++)c=a[d],null!=(f=b.collection.get(c.cid))&&f.set({id:c.id}),b.collection.trigger("sync");return b.updatingBatch=void 0}})},e}(Backbone.View),c=function(){function b(c){var d,e;null==c&&(c={}),_.extend(this,Backbone.Events),d=_.extend(c,{formBuilder:this}),this.attrs={},e=_(d.bootstrapData||[]).groupBy(function(a){return void 0===a.parent_uuid?0:1}).toArray().value(),e=_.reduce(e,function(a,b){return a.concat(b)}),d.bootstrapData=_.map(e,function(a){return _.extend({},b.helpers.defaultFieldAttrs(a.type),a)}),this.mainView=new a(d),this.mainView.collection,b.instances.push(this)}return b.attrs={},b.instances=[],b.attr=function(a,c){return void 0!==c&&(b.attrs[a]=c,_.each(this.instances,function(a){return a.mainView.reset()})),void 0!==b.attrs[a]?b.attrs[a]:void 0},b.conditionalFunctionality=!0,b.showReferenceIDFunctionality=!1,b.geolocationFunctionality=!0,b.linkAssetFunctionality=!1,b.linkAssetDisplayFields={},b.disableField=function(a){return this.fields[a].enabled=!1},b.helpers={defaultFieldAttrs:function(a){var c,d;return c={},c[b.options.mappings.LABEL]="Untitled",c[b.options.mappings.TYPE]=a,c[b.options.mappings.REQUIRED]=!1,c[b.options.mappings.INLINE_IMAGES_ENABLED]=!1,c[b.options.mappings.INLINE_IMAGES_REQUIRED]=!1,c[b.options.mappings.INLINE_ACTIONS_ENABLED]=!1,c[b.options.mappings.INLINE_ACTIONS_REQUIRED]=!1,c.definition=b.fields[a],c.options={},("function"==typeof(d=b.fields[a]).defaultAttributes?d.defaultAttributes(c,b):void 0)||c},simple_format:function(a){var b;return null!=(b=this.escape_html(a))?b.replace(/\n/g,"<br />"):void 0},clone:function(a){return JSON.parse(JSON.stringify(a))},escape_html:function(a){var b;return b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"},null!=a?a.replace(/[&<>"']/g,function(a){return b[a]}):void 0}},b.options={BUTTON_CLASS_SELECTOR:"fb-button btn btn-default",BUTTON_CLASS_ADD:"fb-button btn btn-xs btn-primary",BUTTON_CLASS_REMOVE:"fb-button btn btn-xs btn-danger",HTTP_ENDPOINT:"",HTTP_METHOD:"POST",AUTOSAVE:!1,CLEAR_FIELD_CONFIRM:!1,ENABLED_FIELDS:["text","checkbox","dropdown","textarea","radio","date","section","signature","info","grid","number","table","datasource","time","geolocation","approval"],INLINE_IMAGE_FIELDS:["text","info"],mappings:{SIZE:"options.size",UNITS:"options.units",LABEL:"label",NAME:"definition.name",TYPE:"type",REQUIRED:"required",ADMIN_ONLY:"admin_only",POPULATE_FROM:"options.populate_from",POPULATE_UUID:"options.populate_uuid",CONDITIONAL_PARENT:"options.conditional.parent",CONDITIONAL_VALUES:"options.conditional.values",CONDITIONAL:"options.conditional",OPTIONS:"answers",DESCRIPTION:"description",INCLUDE_OTHER:"options.include_other_option",INCLUDE_BLANK:"options.include_blank_option",INCLUDE_SCORING:"is_scored",INTEGER_ONLY:"options.integer_only",LABEL_COLOR:"options.label_color",LABEL_BACKGROUND_COLOR:"options.label_background_color",READ_ONLY:"options.read_only",COLUMN_WIDTH:"options.column_width",DEFAULT_TIME:"options.default_time",DEFAULT_DATE:"options.default_date",REFERENCE_ID:"reference_id",INLINE_IMAGES_ENABLED:"options.inline_images_enabled",INLINE_IMAGES_REQUIRED:"options.inline_images_required",INLINE_ACTIONS_ENABLED:"options.inline_actions_enabled",INLINE_ACTIONS_REQUIRED:"options.inline_actions_required",NUMERIC:{CALCULATION_TYPE:"options.calculation_type",CALCULATION_EXPRESSION:"options.calculation_expression",CALCULATION_DISPLAY:"options.calculation_display",TOTAL_SEQUENCE:"options.total_sequence"},GRID:{COLS:"options.cols",NUMCOLS:"options.num_cols",ROWS:"options.rows",NUMROWS:"options.num_rows",FULL_WIDTH:"options.full_width",FIRST_ROW_HEADINGS:"options.first_row_headings"},TABLE:{COLS:"options.cols",NUMCOLS:"options.num_cols",ROWS:"options.rows",INITIALROWS:"options.initial_rows",MAXROWS:"options.max_rows",FULL_WIDTH:"options.full_width",COLUMNTOTALS:"options.display_column_totals",ROWTOTALS:"options.display_row_totals"},DATA_SOURCE:{MULTIPLE:"options.multiple_selections",DATA_SOURCE:"options.data_source",VALUE_TEMPLATE:"options.value_template",REQUIRED_PROPERTIES:"options.required_properties",FILTER:"options.filter",FILTER_VALUES:"options.filter_values",IS_FILTERED:"options.is_filtered"},MIN:"options.min",MAX:"options.max",OPTIONS_PER_ROW:"options.options_per_row",MINLENGTH:"options.minlength",MAXLENGTH:"options.maxlength",LENGTH_UNITS:"options.min_max_length_units",
  APPROVAL:{APPROVER_TYPE:"options.approver_type",APPROVER_ID:"options.approver_id"},DISALLOW_DUPLICATION:"options.disallow_duplication"},change:{REQUIRED:function(){return this.reset(),this.resetInlineImages(),this.resetInlineActions()},INLINE_IMAGES_ENABLED:function(){return this.reset(),this.resetInlineImages()},INLINE_IMAGES_REQUIRED:function(){return this.reset()},INLINE_ACTIONS_ENABLED:function(){return this.reset(),this.resetInlineActions()},INLINE_ACTIONS_REQUIRED:function(){return this.reset()},INCLUDE_SCORING:function(){return this.reset()},POPULATE_UUID:function(){return this.model.get(b.options.mappings.POPULATE_UUID)||this.deselectReadOnly(),this.reset()},CONDITIONAL_PARENT:function(){return this.reset(),this.resetConditional()},CONDITIONAL_VALUES:function(){return this.reset()},"DATA_SOURCE.DATA_SOURCE":function(){return this.reset()},"DATA_SOURCE.IS_FILTERED":function(){return this.reset()},"DATA_SOURCE.FILTER":function(){return this.reset()},"APPROVAL.APPROVER_TYPE":function(){return this.reset()}},dict:{ALL_CHANGES_SAVED:"All changes saved",SAVE_FORM:"Save form",UNSAVED_CHANGES:"You have unsaved changes. If you leave this page, you will lose those changes!"}},b.fields={},b.inputFields={},b.nonInputFields={},b.prototype.markSaved=function(){return this.mainView.formSaved=!0},b.prototype.isValid=function(){var a;return a=!0,this.mainView.editView&&!this.mainView.editView.model.isValid()&&(a=!1),a},b.prototype.getPayload=function(){return this.mainView.getPayload()},b.registerField=function(a,c){var d,e,f,g,h,i;for(d=!0,e=b.options.ENABLED_FIELDS,_.contains(e,a)||(d=!1),i=["view","edit"],g=0,h=i.length;h>g;g++)f=i[g],c[f]=d?_.template(c[f]):function(a){return""};return c.type=a,c.enabled=d,b.fields[a]=c,"non_input"===c.element_type?b.nonInputFields[a]=c:b.inputFields[a]=c},b}(),void 0===_.nested&&_.mixin({nested:function(a,b){return a&&b?a[b]||_.reduce(b.split("."),function(a,b){return a?a[b]:void 0},a):void 0}}),window.Formbuilder=c,window.FormbuilderModel=e,"undefined"!=typeof module&&null!==module?module.exports=c:window.Formbuilder=c}.call(this),function(){Formbuilder.registerField("address",{name:"Address",order:50,view:"<div class='input-line'>\n  <span class='street'>\n    <input type='text' />\n    <label>Address</label>\n  </span>\n</div>\n\n<div class='input-line'>\n  <span class='city'>\n    <input type='text' />\n    <label>City</label>\n  </span>\n\n  <span class='state'>\n    <input type='text' />\n    <label>State / Province / Region</label>\n  </span>\n</div>\n\n<div class='input-line'>\n  <span class='zip'>\n    <input type='text' />\n    <label>Zipcode</label>\n  </span>\n\n  <span class='country'>\n    <select><option>United States</option></select>\n    <label>Country</label>\n  </span>\n</div>",edit:"<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-address"></span> Address'})}.call(this),function(){Formbuilder.registerField("approval",{name:"Approval",order:75,view:'<div class=\'fb-approval-user\'>\n    <select>\n       <option>\n           <% if (rf.get(Formbuilder.options.mappings.APPROVAL.APPROVER_TYPE) == 1) { %>\n              Any User\n           <% } else { %>\n            (<%- rf.getSelectedUser(rf.get(Formbuilder.options.mappings.APPROVAL.APPROVER_ID)) %>)\n          <% }%>\n      </option>\n    </select>\n</div>\n<div class="fb-signature form-control">\n    <div class="fb-signature-placeholder">Sign Here</div>\n    <div class="fb-signature-pad"></div>\n</div>\n<button class="btn btn-default btn-xs">Clear</button>',edit:"<%= Formbuilder.templates['edit/approval_options']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-approval"></span> Approval',onEdit:function(a){return $(".fb-approval-user-select").select2()},defaultAttributes:function(a,b){return a.initialize=function(){return this.on("change",function(a){var b,c;return b=this.conditionalParent(),b&&"approval"===b.get("type")&&a.set(Formbuilder.options.mappings.CONDITIONAL_VALUES,1),1===parseInt(this.get(Formbuilder.options.mappings.APPROVAL.APPROVER_TYPE))?a.set(Formbuilder.options.mappings.APPROVAL.APPROVER_ID,void 0):(c=this.get("options.approver"),void 0!==c?a.set(Formbuilder.options.mappings.APPROVAL.APPROVER_ID,parseInt(c)):void 0)})},a.getApprovers=function(){return b.attr("approvers")},a.getSelectedUserName=function(a){return a?a.full_name+" ("+a.username+")":void 0},a.getSelectedUser=function(){var a,b,c;return c=this.options?options.approver_id:this.get(Formbuilder.options.mappings.APPROVAL.APPROVER_ID),a=this.getApprovers()||[],b=a.filter(function(a){return parseInt(a.id)===c}),this.getSelectedUserName(b[0])},a.showApprovers=function(){return 2===parseInt(this.get(Formbuilder.options.mappings.APPROVAL.APPROVER_TYPE))},a.options.approver_type=1,a}})}.call(this),function(){Formbuilder.registerField("checkbox",{name:"Checkboxes",order:10,view:"<div class=\"fb-options-per-row-<%- rf.get(Formbuilder.options.mappings.OPTIONS_PER_ROW) %>\">\n    <% for (i in (rf.get(Formbuilder.options.mappings.OPTIONS) || [])) { %>\n      <div class=\"fb-option-wrapper\">\n        <label class='fb-option' data-uuid=\"<%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].uuid %>\">\n          <input type='checkbox' <%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].checked && 'checked' %> onclick=\"javascript: return false;\" />\n          <%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].label %>\n        </label>\n      </div>\n    <% } %>\n\n    <% if (rf.get(Formbuilder.options.mappings.INCLUDE_OTHER)) { %>\n      <div class='other-option'>\n        <label class='fb-option'>\n          <input type='checkbox' />\n          Other\n        </label>\n\n        <input type='text' />\n      </div>\n    <% } %>\n</div>",edit:"<%= Formbuilder.templates['edit/options']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/options_per_row']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-checkbox"></span> Checkboxes',defaultAttributes:function(a){return a.answers=[{uuid:uuid.v4(),label:"",checked:!1,score:!1},{uuid:uuid.v4(),label:"",checked:!1,score:!1}],a.options.options_per_row=1,a}})}.call(this),function(){Formbuilder.registerField("datasource",{name:"List",order:70,view:"<select>\n  <option>\n     <%- rf.source().title %>\n     (<%- rf.sourceProperty(rf.get(Formbuilder.options.mappings.DATA_SOURCE.VALUE_TEMPLATE)) %>)\n  </option>\n</select>",edit:"<%= Formbuilder.templates['edit/data_source_options']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-data-source"></span> Data Source',defaultAttributes:function(a,b){var c;return a.initialize=function(){return this.on("change",function(a){var b,c,d;return b=a.filters(),void 0!==_.nested(a,"changed.options.data_source")&&(c=_.keys(a.sourceProperties()),a.set("options.required_properties",c),d=_.first(c),a.set("options.value_template",d)),b?a.set("options.filter",_.first(_.keys(b))):void 0}),this.on("destroy",function(a){return this.collection.each(function(b){return b.get("options.populate_uuid")===a.get("uuid")?(b.set("options.populate_uuid",null),b.set("options.populate_from",null)):void 0})})},a.source=function(){var a,c;return a=this.options?this.options.data_source:this.get(Formbuilder.options.mappings.DATA_SOURCE.DATA_SOURCE),c=b.attr("sources"),_.nested(c,a)||{}},a.sourceProperties=function(){var a;return a=this.source(),_.nested(a,"properties")||[]},a.filters=function(){var a;return a=this.source(),_.nested(a,"filters")||null},a.currentFilter=function(){var a;return a=this.source(),_.nested(a,"filters."+this.get("options.filter"))||{}},a.filterValues=function(){return this.currentFilter().values||{}},a.sourceProperty=function(a){return this.sourceProperties()[a]||null},a.options.multiple_selections=!1,a.options.is_filtered=!1,c=b.attr("sources")||{},a.options.data_source=_.keys(c)[0],a.options.required_properties=_.keys(a.sourceProperties(a.options.data_source)),a.options.filter=null,a.options.filter_values=[],a.options.value_template=_.first(a.options.required_properties),a}})}.call(this),function(){Formbuilder.registerField("date",{name:"Date",order:20,view:'<div class=\'input-line\'>\n  <input type="text" placeholder=" DD/MM/YYYY " />\n</div>',edit:"<%= Formbuilder.templates['edit/date']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-date"></span> Date',defaultAttributes:function(a){return a.options.default_date=!1,a}})}.call(this),function(){Formbuilder.registerField("dropdown",{name:"Dropdown",order:24,view:"<select>\n  <% if (rf.get(Formbuilder.options.mappings.INCLUDE_BLANK)) { %>\n    <option value=''></option>\n  <% } %>\n\n  <% for (i in (rf.get(Formbuilder.options.mappings.OPTIONS) || [])) { %>\n    <option <%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].checked && 'selected' %>>\n      <%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].label %>\n    </option>\n  <% } %>\n</select>",edit:"<%= Formbuilder.templates['edit/scoring']() %>\n<%= Formbuilder.templates['edit/options']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-dropdown"></span> Dropdown',defaultAttributes:function(a){return a.answers=[{uuid:uuid.v4(),label:"",checked:!1,score:""},{uuid:uuid.v4(),label:"",checked:!1,score:""}],a.is_scored=!1,a.options.include_blank_option=!1,a}})}.call(this),function(){Formbuilder.registerField("email",{name:"Email",order:40,view:"<input type='text' class='rf-size-<%- rf.get(Formbuilder.options.mappings.SIZE) %>' />",edit:"<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="icon-email"></span> Email'})}.call(this),function(){Formbuilder.registerField("file",{name:"File",order:55,view:"<canvas />",edit:"<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-file"></span> File'})}.call(this),function(){Formbuilder.registerField("geolocation",{name:"Geolocation",order:60,view:"<div class=\"form-group\">\n <button class='fb-button'>Get GeoLocation</button>\n</div>\n<span><%=rf.geolocationFunctionality%></span>",edit:"<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-geolocation"></span> GeoLocation'})}.call(this),function(){Formbuilder.registerField("grid",{name:"Layout Grid",order:99,element_type:"non_input",view:"<label class='section-name'><%- rf.get(Formbuilder.options.mappings.LABEL) %></label>\n<table class=\"response-field-grid-table\">\n</table>\n<p><%- rf.get(Formbuilder.options.mappings.DESCRIPTION) %></p>",edit:'<div class="fb-edit-section-header">Details</div>\n<div class="fb-common-wrapper">\n    <div class="fb-label-description">\n      <input type="text" data-rv-input="model.<%= Formbuilder.options.mappings.LABEL %>">\n      <textarea data-rv-input="model.<%= Formbuilder.options.mappings.DESCRIPTION %>" placeholder="Add a longer description to this field">\n      </textarea>\n    </div>\n    <label class="checkbox">\n       <input type=\'checkbox\' data-rv-checked=\'model.<%= Formbuilder.options.mappings.GRID.FULL_WIDTH %>\' /> Display full width?\n    </label>\n    <label class="checkbox">\n       <input type=\'checkbox\' data-rv-checked=\'model.<%= Formbuilder.options.mappings.GRID.FIRST_ROW_HEADINGS%>\' /> First row headings?\n    </label>\n    <div class=\'fb-edit-section-header\'>Number of Columns</div>\n      <select data-rv-value="model.<%= Formbuilder.options.mappings.GRID.NUMCOLS %>">\n          <option value="1">1</option>\n          <option value="2">2</option>\n          <option value="3">3</option>\n          <option value="4">4</option>\n          <option value="5">5</option>\n          <option value="6">6</option>\n          <option value="7">7</option>\n          <option value="8">8</option>\n          <option value="9">9</option>\n          <option value="10">10</option>\n      </select>\n    <div class=\'fb-edit-section-header\'>Number of Rows</div>\n      <select data-rv-value="model.<%= Formbuilder.options.mappings.GRID.NUMROWS %>">\n          <option value="1">1</option>\n          <option value="2">2</option>\n          <option value="3">3</option>\n          <option value="4">4</option>\n          <option value="5">5</option>\n          <option value="6">6</option>\n          <option value="7">7</option>\n          <option value="8">8</option>\n          <option value="9">9</option>\n          <option value="10">10</option>\n          <option value="11">11</option>\n          <option value="12">12</option>\n          <option value="13">13</option>\n          <option value="14">14</option>\n          <option value="15">15</option>\n          <option value="16">16</option>\n          <option value="17">17</option>\n          <option value="18">18</option>\n          <option value="19">19</option>\n          <option value="20">20</option>\n      </select>\n    </div>\n</div>',addButton:'<span id="fb-grid-add-button" class="fb-icon-grid"></span> Grid',hideAddButton:!0,defaultAttributes:function(a){return a.options.num_cols=1,a.options.num_rows=1,a.options.full_width=!1,a.options.first_row_headings=!1,a.children=[],a.childModels=function(){return this.collection.filter(function(a){return-1!==_.indexOf(this.get("options.elements"),a.get("uuid"))},this)},a}})}.call(this),function(){Formbuilder.registerField("info",{name:"Info",order:20,element_type:"non_input",view:"<label class='section-name'><%- rf.get(Formbuilder.options.mappings.LABEL) %></label>\n<p><%= rf.get(Formbuilder.options.mappings.DESCRIPTION) %></p>",edit:'<div class="fb-edit-section-header">Details</div>\n<div class="fb-common-wrapper">\n  <div class="fb-label-description">\n    <input type="text" data-rv-input="model.<%= Formbuilder.options.mappings.LABEL %>">\n  </div>\n  <textarea class="fb-info-editor" style="display:none;" data-rv-input="model.<%= Formbuilder.options.mappings.DESCRIPTION %>">\n  </textarea>\n</div>\n<%= Formbuilder.templates[\'edit/inline_image_option\']({ rf: rf }) %>\n<%= Formbuilder.templates[\'edit/conditional_options\']({ rf: rf }) %>',addButton:'<span class="fb-icon-info"></span> Info',onEdit:function(a){var b;return b=function(){return a.set(Formbuilder.options.mappings.DESCRIPTION,$(this).code()),a.trigger("change:"+Formbuilder.options.mappings.DESCRIPTION)},$(".fb-info-editor").summernote({onChange:function(){return b.call(this)},onKeyup:function(){return b.call(this)},disableDragAndDrop:!0,toolbar:[["style",["bold","italic","underline"]],["fontsize",["fontsize"]],["color",["color"]],["insert",["link"]],["table",["table"]],["misc",["codeview"]]]})}})}.call(this),function(){Formbuilder.registerField("number",{name:"Number",order:30,view:"<input type='text' class=\"calculated\" value=\"<%- rf.get(Formbuilder.options.mappings.NUMERIC.CALCULATION_DISPLAY) %>\" <%- rf.get(Formbuilder.options.mappings.NUMERIC.CALCULATION_DISPLAY) ? 'readonly=\"readonly\"' : ''  %> />\n<% if (units = rf.get(Formbuilder.options.mappings.UNITS)) { %>\n  <%= units %>\n<% } %>",edit:"<%= Formbuilder.templates['edit/integer_only']({rf:rf}) %>\n<%= Formbuilder.templates['edit/total']({rf:rf}) %>\n<%= Formbuilder.templates['edit/min_max']({rf:rf}) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-number"></span> Number',defaultAttributes:function(a,b){return a.options.calculation_type="",a.options.calculation_expression="",a.options.calculation_display="",a.options.total_sequence=!1,a.insertion=function(){var a,b;return a=this.parentModel(),a&&"table"===a.get("type")?(b=a.totalColumn(this.get("uuid")),this.attributes.options.total_sequence=b):void 0},a.initialize=function(){return this.on("change",function(a){var b;return void 0!==_.nested(a,"changed.options.calculation_type")&&a.expression(),void 0!==_.nested(a,"changed.options.total_sequence")&&(b=_.nested(a,"changed.options.total_sequence"),this.parentModel().totalColumn(a.get("uuid"),b)),a})},a.numericSiblings=function(){var a;return a=this.parentModel(),a?_.filter(a.childModels(),function(a){return"number"===a.get("type")&&a.get("uuid")!==this.get("uuid")},this):[]},a.expression=function(){var a,b,c;return a=this.get("options.calculation_type"),""!==a?(c="SUM"===a?"+":"*",b=this.numericSiblings(),this.set("options.calculation_expression",_.map(b,function(a){return"uuid_"+a.get("uuid").replace(/-/g,"_")}).join(c)),this.set("options.calculation_display","= "+_.map(b,function(a){return a.get("label")}).join(c)),console.log(this.get("options.calculation_expression"))):(this.set("options.calculation_expression",""),this.set("options.calculation_display",""))},a.canTotalColumn=function(){var a;return a=this.parentModel(),a&&"table"===a.get("type")},a.canAcceptCalculatedTotal=function(){return this.numericSiblings().length>1},a}})}.call(this),function(){Formbuilder.registerField("price",{name:"Price",order:45,view:"<div class='input-line'>\n  <span class='above-line'>$</span>\n  <span class='dolars'>\n    <input type='text' />\n    <label>Dollars</label>\n  </span>\n  <span class='above-line'>.</span>\n  <span class='cents'>\n    <input type='text' />\n    <label>Cents</label>\n  </span>\n</div>",edit:"<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-price"></span> Price'})}.call(this),function(){Formbuilder.registerField("radio",{name:"Radio Button",order:15,view:"<div class=\"fb-options-per-row-<%- rf.get(Formbuilder.options.mappings.OPTIONS_PER_ROW) %>\">\n    <% for (i in (rf.get(Formbuilder.options.mappings.OPTIONS) || [])) { %>\n      <div class=\"fb-option-wrapper <%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].label %>\">\n        <label class='fb-option' data-uuid=\"<%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].uuid %>\">\n          <input type='radio' <%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].checked && 'checked' %> onclick=\"javascript: return false;\" />\n          <%- rf.get(Formbuilder.options.mappings.OPTIONS)[i].label %>\n        </label>\n      </div>\n    <% } %>\n\n    <% if (rf.get(Formbuilder.options.mappings.INCLUDE_OTHER)) { %>\n      <div class='fb-option-wrapper other-option'>\n        <label class='fb-option'>\n          <input type='radio' />\n          Other\n        </label>\n\n        <input type='text' />\n      </div>\n    <% } %>\n</div>",edit:"<%= Formbuilder.templates['edit/scoring']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/options']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/options_per_row']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-radio"></span> Radio Button',defaultAttributes:function(a){return a.answers=[{uuid:uuid.v4(),label:"",checked:!1,score:""},{uuid:uuid.v4(),label:"",checked:!1,score:""}],a.is_scored=!1,a.options.options_per_row=1,a}})}.call(this),function(){Formbuilder.registerField("section",{name:"Section",order:10,element_type:"non_input",view:"<label class='section-name'><%- rf.get(Formbuilder.options.mappings.LABEL) %></label>\n<p><%- rf.get(Formbuilder.options.mappings.DESCRIPTION) %></p>",edit:'<div class="fb-edit-section-header">Details</div>\n<div class="fb-common-wrapper">\n<div class="fb-label-description">\n  <input type="text" data-rv-input="model.<%= Formbuilder.options.mappings.LABEL %>">\n  <textarea data-rv-input="model.<%= Formbuilder.options.mappings.DESCRIPTION %>" placeholder="Add a longer description to this field">\n  </textarea>\n</div>\n</div>\n<%= Formbuilder.templates[\'edit/conditional_options\']({ rf: rf }) %>',addButton:'<span class="fb-icon-section"></span> Section Break'})}.call(this),function(){Formbuilder.registerField("signature",{name:"Signature",order:65,view:'<div class="fb-signature form-control">\n    <div class="fb-signature-placeholder">Sign Here</div>\n    <div class="fb-signature-pad"></div>\n</div>\n<button class="btn btn-default btn-xs">Clear</button>',edit:"<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-signature"></span> Signature'})}.call(this),function(){Formbuilder.registerField("table",{name:"Table",order:0,element_type:"non_input",view:"<label class='section-name'><%- rf.get(Formbuilder.options.mappings.LABEL) %></label>\n<%= Formbuilder.templates[\"view/table_field\"]({rf: rf}) %>\n<p><%- rf.get(Formbuilder.options.mappings.DESCRIPTION) %></p>",edit:"<div class='fb-edit-section-header'>Details</div>\n<div class='fb-common-wrapper'>\n  <div class='fb-label-description'>\n    <%= Formbuilder.templates['edit/label_description']({rf: rf}) %>\n  </div>\n  <div class='fb-clear'></div>\n</div>\n<label class=\"checkbox\">\n  <input type='checkbox' data-rv-checked='model.<%= Formbuilder.options.mappings.GRID.FULL_WIDTH %>' /> Display full width ?\n</label>",addButton:'<span class="fb-icon-table"></span> Table',defaultAttributes:function(a){return a.options.full_width=!1,a.initialize=function(){var a;return a=this,_.each(this.childModels,function(b){return b.on("change",function(b){return void 0!==_.nested(b,"changed.options.column_width")&&a.columnWidth(b.get("uuid"),b.get("options.column_width")),b})})},a.childModels=function(){var a;return a=_.pluck(this.get("options.elements"),"uuid"),this.collection.filter(function(b){return-1!==_.indexOf(a,b.get("uuid"))},this)},a.elementOptions=function(a){return _.findWhere(this.get("options.elements"),{uuid:a})},a.createTotalColumnModel=function(a){var b;return b=new FormbuilderModel(Formbuilder.helpers.defaultFieldAttrs("number")),b.set("options.calculation_expression","sum(column_uuid_"+a.replace(/-/g,"_")+")"),b.set("model_only",!0),b.set("parent_uuid",a),this.collection.add(b),b},a.columnWidth=function(a,b){var c;return c=this.get("options.elements"),_.each(c,function(d,e){return d.uuid===a?c[e].columnWidth=b:void 0},this)},a.totalColumn=function(a,b){var c;return c=this.get("options.elements"),void 0!==b?(_.each(c,function(d,e){var f;return d.uuid===a?(void 0===d.totalColumnUuid&&(f=this.createTotalColumnModel(d.uuid),c[e].totalColumnUuid=f.get("uuid")),c[e].totalColumn=b):void 0},this),this.set("options.elements",c)):this.elementOptions(a)?this.elementOptions(a).totalColumn||!1:!1},a}})}.call(this),function(){Formbuilder.registerField("text",{name:"Text",order:0,view:"<input type='text' class='rf-size-<%- rf.get(Formbuilder.options.mappings.SIZE) %>'\n  <% if (rf.get(Formbuilder.options.mappings.READ_ONLY)) { %>\n    readonly=\"readonly\"\n  <% } %>\n/>",edit:"<%= Formbuilder.templates['edit/inline_image_option']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/inline_action_option']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/populate_from']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-text"></span> Text',defaultAttributes:function(a){return a.options.size="small",a.options.read_only=!1,a}})}.call(this),function(){Formbuilder.registerField("textarea",{name:"Paragraph",order:5,view:"<textarea class='rf-size-<%- rf.get(Formbuilder.options.mappings.SIZE) %>'\n  <% if (rf.get(Formbuilder.options.mappings.READ_ONLY)) { %>\n    readonly=\"readonly\"\n  <% } %>\n></textarea>",edit:"<%= Formbuilder.templates['edit/inline_image_option']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/populate_from']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-textarea"></span> Paragraph',defaultAttributes:function(a){return a.options.size="small",a.options.read_only=!1,a}})}.call(this),function(){Formbuilder.registerField("time",{name:"Time",order:25,view:'<div class="form-group">\n  <div class="input-group">\n    <input type="text" class="form-control" placeholder="12:00 PM">\n    <div class="input-group-addon glyphicon glyphicon-time"></div>\n  </div>\n</div>',edit:"<%= Formbuilder.templates['edit/time']({ rf: rf }) %>\n<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-time"></span> Time',defaultAttributes:function(a){return a.options.default_time=!1,a}})}.call(this),function(){Formbuilder.registerField("website",{name:"Website",order:35,view:"<input type='text' placeholder='http://' />",edit:"<%= Formbuilder.templates['edit/conditional_options']({ rf: rf }) %>",addButton:'<span class="fb-icon-website"></span> Website'})}.call(this),this.Formbuilder=this.Formbuilder||{},this.Formbuilder.templates=this.Formbuilder.templates||{},this.Formbuilder.templates["edit/approval_options"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj){if(__p+='<div class=\'fb-edit-section-header\'>Approver</div>\n<div>\n    <div>\n        <label>\n            <input type="radio" id="any_user" name="approver_type" value="1" data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.APPROVAL.APPROVER_TYPE)?"":__t)+'\'>\n            Any user can approve\n        </label>\n    </div>\n    <div>\n        <label>\n            <input type="radio" id="select_user" name="approver_type" value="2" data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.APPROVAL.APPROVER_TYPE)?"":__t)+"'>\n            Specify Approver\n        </label>\n    </div>\n    ",rf.showApprovers()){__p+='\n    <div>\n        <select class="fb-approval-user-select" data-rv-value="model.options.approver">\n            ',users=rf.getApprovers();for(i in users||[])user=users[i],__p+="\n            <option value='"+(null==(__t=user.id)?"":__t)+"'>\n                "+(null==(__t=user.full_name+" ("+user.username+")")?"":__t)+"\n            </option>\n            ";__p+="\n        </select>\n    </div>\n    "}__p+="\n</div>\n\n"}return __p},this.Formbuilder.templates["edit/base"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+=(null==(__t=Formbuilder.templates["edit/base_header"]({rf:rf}))?"":__t)+"\n"+(null==(__t=Formbuilder.templates["edit/common"]({rf:rf}))?"":__t)+"\n"+(null==(__t=Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].edit({rf:rf}))?"":__t)+"\n"+(null==(__t=Formbuilder.templates["edit/columnwidth"]({rf:rf}))?"":__t)+"\n"+(null==(__t=Formbuilder.templates["edit/table_color"]({rf:rf}))?"":__t)+"\n";return __p},this.Formbuilder.templates["edit/base_header"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='fb-field-label'>\n  <span data-rv-text=\"model."+(null==(__t=Formbuilder.options.mappings.LABEL)?"":__t)+"\"></span>\n  <code class='type' data-rv-text='model."+(null==(__t=Formbuilder.options.mappings.NAME)?"":__t)+"'></code>\n  <span class='fa fa-arrow-right pull-right'></span>\n</div>\n";return __p},this.Formbuilder.templates["edit/base_non_input"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+=(null==(__t=Formbuilder.templates["edit/base_header"]({rf:rf}))?"":__t)+"\n"+(null==(__t=Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].edit({rf:rf}))?"":__t)+"\n";return __p},this.Formbuilder.templates["edit/checkboxes"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<label class=\"checkbox\">\n  <input type='checkbox' data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.REQUIRED)?"":__t)+"' />\n  Required\n</label>\n";return __p},this.Formbuilder.templates["edit/columnwidth"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<!-- <div class=\'fb-edit-section-header\'>Column width</div>\n\nWidth in px\n<input class="form-control" type="number" data-rv-input="model.'+(null==(__t=Formbuilder.options.mappings.COLUMN_WIDTH)?"":__t)+'" style="width: 50px" />\n\n -->';return __p},this.Formbuilder.templates["edit/common"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)rf.canShowReferenceID()&&(__p+="\n<div class=\"fb-edit-reference-wrap\">\n    <div class='fb-edit-section-header'>Reference ID</div>\n    "+(null==(__t=Formbuilder.templates["edit/reference_id"]({rf:rf}))?"":__t)+"\n</div>\n"),__p+="\n<div class='fb-edit-section-header'>Details</div>\n\n<div class='fb-common-wrapper'>\n    <div class='fb-label-description'>\n        "+(null==(__t=Formbuilder.templates["edit/label_description"]({rf:rf}))?"":__t)+"\n    </div>\n    <div class='fb-common-checkboxes'>\n        "+(null==(__t=Formbuilder.templates["edit/checkboxes"]())?"":__t)+"\n    </div>\n    <div class='fb-clear'></div>\n</div>";return __p},this.Formbuilder.templates["edit/conditional_options"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj){if(rf.canBeConditionallyDisplayed()){__p+='\n    <div class="fb-edit-section-conditional-wrapper">\n        <div class=\'fb-edit-section-header\'>Conditionally Display\n            <span type="button" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="Checkbox, Radio and Dropdown elements can be used to conditionally trigger the display of elements">\n                <span class="glyphicon glyphicon-question-sign"></span>\n            </span>\n            <script>\n              $(\'[data-toggle="tooltip"]\').tooltip()\n            </script>\n\n        </div>\n    ';var list=rf.collection.findConditionalTriggers(rf);if(list.length){__p+='\n            <select data-rv-value="model.'+(null==(__t=Formbuilder.options.mappings.CONDITIONAL_PARENT)?"":__t)+'">\n                <option></option>\n                ';for(i in list||[])__p+='\n                    <option value="'+(null==(__t=list[i].get("uuid"))?"":__t)+'">\n                        '+__e(list[i].get("label"))+"\n                        ",rf.canShowReferenceID()&&list[i].get("reference_id")&&(__p+="\n                        ["+(null==(__t=list[i].get("reference_id"))?"":__t)+"]\n                        "),__p+="\n                    </option>\n                 ";__p+="\n            </select>\n             ";var selectedList=rf.conditionalTriggerOptions();if(Array.isArray(selectedList)){0==selectedList.length&&rf.collection.clearConditionEle(rf);for(i in selectedList)__p+="\n                    <label class=\"checkbox\">\n                        <input type='checkbox' data-rv-append='model."+(null==(__t=Formbuilder.options.mappings.CONDITIONAL_VALUES)?"":__t)+"' value=\""+(null==(__t=selectedList[i].uuid)?"":__t)+'" />\n                        '+(null==(__t=selectedList[i].label)?"":__t)+"\n                    </label>\n                "}else __p+="\n                <div>\n                    <label class=\"checkbox\">\n                        <input type='checkbox' checked disabled />\n                        "+(null==(__t=selectedList)?"":__t)+"\n                    </label>\n                </div>\n           ";__p+="\n    "}else __p+="\n        No trigger elements\n        ";__p+="\n    "}__p+='\n    <div id="warning-message" class="alert alert-danger" style="display:none">Please ensure that conditional values are selected</div>\n    </div>\n</div>\n'}return __p},this.Formbuilder.templates["edit/data_source_options"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj){__p+="<div class='fb-edit-section-header'>Data Source</div>\n<select data-rv-value=\"model."+(null==(__t=Formbuilder.options.mappings.DATA_SOURCE.DATA_SOURCE)?"":__t)+'">\n';for(i in Formbuilder.attr("sources")||[])__p+='\n    <option value="'+(null==(__t=i)?"":__t)+'">\n    '+__e(Formbuilder.attr("sources")[i].title)+"\n    </option>\n";__p+="\n</select>\n<div class='fb-edit-section-header'>Display</div>\n<select data-rv-value=\"model."+(null==(__t=Formbuilder.options.mappings.DATA_SOURCE.VALUE_TEMPLATE)?"":__t)+'">\n';for(i in rf.sourceProperties()||[])__p+='\n    <option value="'+(null==(__t=i)?"":__t)+'">\n    '+__e(rf.sourceProperties()[i])+"\n    </option>\n";if(__p+="\n</select>\n",rf.filters()){if(__p+="\n    <div class='fb-edit-section-header'> Filter </div>\n    <label class=\"checkbox\">\n      <input type='checkbox' class=\"js-scoring\"  data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.DATA_SOURCE.IS_FILTERED)?"":__t)+"' />\n      Apply a filter?\n    </label>\n    ",
  rf.get(Formbuilder.options.mappings.DATA_SOURCE.IS_FILTERED)){__p+='\n    <select data-rv-value="model.'+(null==(__t=Formbuilder.options.mappings.DATA_SOURCE.FILTER)?"":__t)+'">\n    ';for(i in rf.filters()||[])__p+='\n        <option value="'+(null==(__t=i)?"":__t)+'">\n        '+__e(rf.filters()[i].name)+"\n        </option>\n    ";__p+="\n    </select>\n    ";for(i in rf.filterValues())__p+="\n        <label class=\"checkbox\">\n          <input type='checkbox' data-rv-append='model."+(null==(__t=Formbuilder.options.mappings.DATA_SOURCE.FILTER_VALUES)?"":__t)+"' value=\""+(null==(__t=i)?"":__t)+'" />\n            '+__e(rf.filterValues()[i])+"\n        </label>\n    ";__p+="\n"}__p+="\n"}}return __p},this.Formbuilder.templates["edit/date"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<div class="fb-default-date-wrapper">\n    <label class="checkbox">\n        <input class="default-date" type=\'checkbox\' data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.DEFAULT_DATE)?"":__t)+"' />\n        Default to current date\n    </label>\n</div>\n";return __p},this.Formbuilder.templates["edit/inline_action_option"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)rf.hasParent()||(__p+='\n<div class="fb-edit-section-inlineimage-wrapper">\n    <div class=\'fb-edit-section-header\'>Add action\n        <span type="button" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="Actions can be added against this element. \'Required\' means at least one must be added for record to be completed.">\n                <span class="glyphicon glyphicon-question-sign"></span>\n        </span>\n        <script>\n            $(\'[data-toggle="tooltip"]\').tooltip()\n        </script>\n\n    </div>\n    <label class="checkbox">\n        <input type="checkbox" data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.INLINE_ACTIONS_ENABLED)?"":__t)+"'/> Enable\n    </label>\n    ",rf.get(Formbuilder.options.mappings.INLINE_ACTIONS_ENABLED)&&(rf.get(Formbuilder.options.mappings.REQUIRED)||"info"===rf.get("type"))&&(__p+="\n    <label class=\"checkbox\">\n        <input type='checkbox' data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.INLINE_ACTIONS_REQUIRED)?"":__t)+"'/> Required\n    </label>\n    "),__p+="\n\n</div>\n");return __p},this.Formbuilder.templates["edit/inline_image_option"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)rf.hasParent()||(__p+='\n<div class="fb-edit-section-inlineimage-wrapper">\n    <div class=\'fb-edit-section-header\'>Add photo\n        <span type="button" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="Photos and other images can be uploaded next to this element">\n                <span class="glyphicon glyphicon-question-sign"></span>\n        </span>\n        <script>\n            $(\'[data-toggle="tooltip"]\').tooltip()\n        </script>\n\n    </div>\n    <label class="checkbox">\n        <input type="checkbox" data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.INLINE_IMAGES_ENABLED)?"":__t)+"'/> Enable\n    </label>\n    ",rf.get(Formbuilder.options.mappings.INLINE_IMAGES_ENABLED)&&(rf.get(Formbuilder.options.mappings.REQUIRED)||"info"===rf.get("type"))&&(__p+="\n    <label class=\"checkbox\">\n        <input type='checkbox' data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.INLINE_IMAGES_REQUIRED)?"":__t)+"'/> Required\n    </label>\n    "),__p+="\n\n</div>\n");return __p},this.Formbuilder.templates["edit/integer_only"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<label class=\"checkbox\">\n  <input type='checkbox' data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.INTEGER_ONLY)?"":__t)+"' />\n  Whole numbers only?\n</label>\n";return __p},this.Formbuilder.templates["edit/label_description"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<input type='text' class=\"form-control\" data-rv-input='model."+(null==(__t=Formbuilder.options.mappings.LABEL)?"":__t)+"' />\n<textarea class=\"form-control\" data-rv-input='model."+(null==(__t=Formbuilder.options.mappings.DESCRIPTION)?"":__t)+"'\n  placeholder='Add a longer description to this field'></textarea>";return __p},this.Formbuilder.templates["edit/min_max"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<div class=\'fb-edit-section-header\'>Minimum / Maximum</div>\n\nMin\n<input class="form-control" type="text" data-rv-input="model.'+(null==(__t=Formbuilder.options.mappings.MIN)?"":__t)+'" style="width: 30px" />\n\n&nbsp;&nbsp;\n\nMax\n<input class="form-control" type="text" data-rv-input="model.'+(null==(__t=Formbuilder.options.mappings.MAX)?"":__t)+'" style="width: 30px" />\n';return __p},this.Formbuilder.templates["edit/min_max_length"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<div class=\'fb-edit-section-header\'>Length Limit</div>\n\nMin\n<input class="form-control" type="text" data-rv-input="model.'+(null==(__t=Formbuilder.options.mappings.MINLENGTH)?"":__t)+'" style="width: 30px" />\n\n&nbsp;&nbsp;\n\nMax\n<input class="form-control" type="text" data-rv-input="model.'+(null==(__t=Formbuilder.options.mappings.MAXLENGTH)?"":__t)+'" style="width: 30px" />\n\n&nbsp;&nbsp;\n\n<select class="form-control" data-rv-value="model.'+(null==(__t=Formbuilder.options.mappings.LENGTH_UNITS)?"":__t)+'" style="width: auto;">\n  <option value="characters">characters</option>\n  <option value="words">words</option>\n</select>\n';return __p},this.Formbuilder.templates["edit/options"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)__p+="<div class='fb-edit-section-header'>Options</div>\n\n","undefined"!=typeof includeBlank&&(__p+="\n  <label class=\"checkbox\">\n    <input type='checkbox' data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.INCLUDE_BLANK)?"":__t)+"' />\n    Include blank\n  </label>\n"),__p+="\n\n<div class='option' data-rv-each-option='model."+(null==(__t=Formbuilder.options.mappings.OPTIONS)?"":__t)+'\'>\n<!--   <input type="checkbox" class=\'js-default-updated\' data-rv-checked="option:checked" /> -->\n  <input type="text" data-rv-input="option:label" placeholder="Label" class=\'option-label-input\' />\n  ',rf.get(Formbuilder.options.mappings.INCLUDE_SCORING)&&(__p+='\n  <input type="text" data-rv-input="option:score" placeholder="Score" class=\'option-score-input\' />\n  '),__p+='\n\n  <button class="js-remove-option '+(null==(__t=Formbuilder.options.BUTTON_CLASS_REMOVE)?"":__t)+'" title="Remove Option"><span class=\'glyphicon glyphicon-minus\'></span></button>\n</div>\n\n',"undefined"!=typeof includeOther&&(__p+="\n  <label class=\"checkbox\">\n    <input type='checkbox' data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.INCLUDE_OTHER)?"":__t)+'\' />\n    Include "other"\n  </label>\n'),__p+="\n\n<div class='fb-bottom-add'>\n  <button class=\"js-add-option "+(null==(__t=Formbuilder.options.BUTTON_CLASS_ADD)?"":__t)+'">Add option</button>\n</div>\n';return __p},this.Formbuilder.templates["edit/options_per_row"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='fb-edit-section-header'>Number of options per row</div>\n    <select data-rv-value=\"model."+(null==(__t=Formbuilder.options.mappings.OPTIONS_PER_ROW)?"":__t)+'">\n        <option value="1">1</option>\n        <option value="2">2</option>\n        <option value="3">3</option>\n        <option value="4">4</option>\n        <option value="5">5</option>\n        <option value="6">6</option>\n        <option value="7">7</option>\n        <option value="8">8</option>\n        <option value="9">9</option>\n        <option value="10">10</option>\n        <option value="11">11</option>\n        <option value="12">12</option>\n        <option value="13">13</option>\n        <option value="14">14</option>\n        <option value="15">15</option>\n    </select>\n</div>';return __p},this.Formbuilder.templates["edit/populate_from"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj){var list=rf.collection.findDataSourceFields();if(list.length){__p+="\n    <div class='fb-edit-section-header'>Populate From</div>\n    <select data-rv-value=\"model."+(null==(__t=Formbuilder.options.mappings.POPULATE_UUID)?"":__t)+'">\n    <option>\n    ';for(i in list||[])__p+='\n        <option value="'+(null==(__t=list[i].get("uuid"))?"":__t)+'">\n        '+__e(list[i].get("label"))+"\n        </option>\n    ";__p+='\n    </select>\n    <select data-rv-value="model.'+(null==(__t=Formbuilder.options.mappings.POPULATE_FROM)?"":__t)+'">\n    <option>\n    ';var populationUuid=rf.get("options.populate_uuid"),populationModel=rf.collection.findWhereUuid(populationUuid)||{};if(populationUuid&&populationModel){var dataSource=populationModel.get("options.data_source"),listProperties=Formbuilder.attr("sources")[dataSource].properties;for(i in listProperties)__p+='\n            <option value="'+(null==(__t=i)?"":__t)+'">\n            '+__e(listProperties[i])+"\n            </option>\n    "}__p+="\n    </select>\n    ",rf.get(Formbuilder.options.mappings.POPULATE_UUID)&&(__p+='\n    <div>\n        <label class="checkbox">\n            Read only\n            <input type="checkbox" data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.READ_ONLY)?"":__t)+"' />\n        </label>\n    </div>\n    "),__p+="\n"}__p+="\n"}return __p},this.Formbuilder.templates["edit/reference_id"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<input type=\'text\' class="form-control" maxlength="10" placeholder="Add a reference ID to this field " data-rv-input=\'model.'+(null==(__t=Formbuilder.options.mappings.REFERENCE_ID)?"":__t)+"' />";return __p},this.Formbuilder.templates["edit/scoring"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<div class="fb-scoring-wrapper">\n    <label class="checkbox">\n      <input class="js-scoring" type=\'checkbox\' data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.INCLUDE_SCORING)?"":__t)+"' />\n      Include Scoring\n    </label>\n</div>\n\n";return __p},this.Formbuilder.templates["edit/size"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='fb-edit-section-header'>Size</div>\n<select data-rv-value=\"model."+(null==(__t=Formbuilder.options.mappings.SIZE)?"":__t)+'">\n  <option value="small">Small</option>\n  <option value="medium">Medium</option>\n  <option value="large">Large</option>\n</select>\n';return __p},this.Formbuilder.templates["edit/table_color"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)rf.inTable()&&(__p+='\n<div class="fb-label-color">\n    <div class=\'fb-edit-section-header\'>Header Label Colour</div>\n    <div>\n        <input type=\'hidden\' class="form-control spectrum-colorpicker" id="fb-label-color"\n               data-rv-value=\'model.'+(null==(__t=Formbuilder.options.mappings.LABEL_COLOR)?"":__t)+"'/>\n    </div>\n    <div class='fb-edit-section-header'>Header Background Colour</div>\n    <div>\n        <input type='hidden' class=\"form-control spectrum-colorpicker\" id=\"fb-label-background-color\"\n               data-rv-value='model."+(null==(__t=Formbuilder.options.mappings.LABEL_BACKGROUND_COLOR)?"":__t)+"'/>\n    </div>\n</div>\n");return __p},this.Formbuilder.templates["edit/table_layout"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='fb-edit-section-header'>Layout</div>\n    <label>\n        Columns\n        <select data-rv-value=\"model."+(null==(__t=Formbuilder.options.mappings.TABLE.NUMCOLS)?"":__t)+'">\n            <option value="1">1</option>\n            <option value="2">2</option>\n            <option value="3">3</option>\n            <option value="4">4</option>\n            <option value="5">5</option>\n            <option value="6">6</option>\n            <option value="7">7</option>\n            <option value="8">8</option>\n            <option value="9">9</option>\n            <option value="10">10</option>\n        </select>\n    </label>\n\n    <label>\n        Max rows\n        <input type="text" data-rv-input="model.'+(null==(__t=Formbuilder.options.mappings.TABLE.MAXROWS)?"":__t)+'" style="width: 40px" />\n    </label>\n</div>';return __p},this.Formbuilder.templates["edit/table_totals"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='fb-edit-section-header'>Totals</div>\n    <label>\n      <input type='checkbox' data-rv-checked='model."+(null==(__t=Formbuilder.options.mappings.TABLE.COLUMNTOTALS)?"":__t)+"' />\n      Display column totals?\n    </label>\n</div>";return __p},this.Formbuilder.templates["edit/time"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<div class="fb-default-time-wrapper">\n    <label class="checkbox">\n        <input class="default-time" type=\'checkbox\' data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.DEFAULT_TIME)?"":__t)+"' />\n        Default to current time\n    </label>\n</div>\n";return __p},this.Formbuilder.templates["edit/total"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)rf.canTotalColumn()&&(__p+='\n<label class="checkbox">\n    Display column total?\n    <input type="checkbox" class=\'js-default-updated\' data-rv-checked=\'model.'+(null==(__t=Formbuilder.options.mappings.NUMERIC.TOTAL_SEQUENCE)?"":__t)+"' />\n</label>\n"),__p+="\n",rf.canAcceptCalculatedTotal()&&(__p+="\n<div class='fb-edit-section-header'>Total</div>\n<label>\n    Calculated Value\n    <select data-rv-value=\"model."+(null==(__t=Formbuilder.options.mappings.NUMERIC.CALCULATION_TYPE)?"":__t)+'">\n        <option value="">No Calculation</option>\n        <option value="SUM">Sum</option>\n        <option value="PRODUCT">Product</option>\n    </select>\n</label>\n'),__p+="\n\n";return __p},this.Formbuilder.templates["edit/units"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+='<div class=\'fb-edit-section-header\'>Units</div>\n<input type="text" data-rv-input="model.'+(null==(__t=Formbuilder.options.mappings.UNITS)?"":__t)+'" />\n';return __p},this.Formbuilder.templates.page=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+=(null==(__t=Formbuilder.templates["partials/left_side"]())?"":__t)+"\n"+(null==(__t=Formbuilder.templates["partials/right_side"]())?"":__t)+"\n<div class='fb-clear'></div>";return __p},this.Formbuilder.templates["partials/add_field"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)__p+="<div class='fb-tab-pane active' id='addField'>\n  <div class='fb-add-types'>\n    <div class='section'>\n      ",_.chain(Formbuilder.inputFields).sortBy("order").filter(function(a){return a.enabled}).each(function(a){__p+='\n        <a data-type="'+(null==(__t=a.type)?"":__t)+'" id="fb-'+(null==(__t=a.type)?"":__t)+'-add-button"\n           class="'+(null==(__t=Formbuilder.options.BUTTON_CLASS_SELECTOR)?"":__t)+" "+(null==(__t=a.hideAddButton?"hidden":"")?"":__t)+'"\n        >\n          '+(null==(__t=a.addButton)?"":__t)+"\n        </a>\n      "}),__p+="\n    </div>\n\n    <div class='section'>\n      ",_.chain(Formbuilder.nonInputFields).sortBy("order").filter(function(a){return a.enabled}).each(function(a){__p+='\n        <a data-type="'+(null==(__t=a.type)?"":__t)+'" id="fb-'+(null==(__t=a.type)?"":__t)+'-add-button"\n           class="'+(null==(__t=Formbuilder.options.BUTTON_CLASS_SELECTOR)?"":__t)+" "+(null==(__t=a.hideAddButton?"hidden":"")?"":__t)+'"\n        >\n          '+(null==(__t=a.addButton)?"":__t)+"\n        </a>\n      "}),__p+="\n    </div>\n  </div>\n</div>";return __p},this.Formbuilder.templates["partials/edit_field"]=function(obj){obj||(obj={});var __p="";_.escape;with(obj)__p+="<div class='fb-tab-pane' id='editField'>\n  <div class='fb-edit-field-wrapper'></div>\n</div>\n";return __p},this.Formbuilder.templates["partials/left_side"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='fb-left'>\n  <ul class='fb-tabs'>\n    <li class='active'><a data-target='#addField'>Add new field</a></li>\n    <li><a data-target='#editField'>Edit field</a></li>\n  </ul>\n\n  <div class='fb-tab-content'>\n    "+(null==(__t=Formbuilder.templates["partials/add_field"]())?"":__t)+"\n    "+(null==(__t=Formbuilder.templates["partials/edit_field"]())?"":__t)+"\n  </div>\n</div>";return __p},this.Formbuilder.templates["partials/right_side"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)__p+="<div class='fb-right panel'>\n    <div class='fb-no-response-fields'>No response fields</div>\n    ",Formbuilder.linkAssetFunctionality&&(__p+="\n    "+(null==(__t=Formbuilder.templates["view/link_object"]({object:Formbuilder.linkAssetDisplayFields}))?"":__t)+'\n    <hr class="section-separator"/>\n    '),__p+="\n    <div class='fb-response-fields panel-body'></div>\n</div>\n";return __p},this.Formbuilder.templates["view/afterelementlabel"]=function(obj){obj||(obj={});var __p="";_.escape,Array.prototype.join;with(obj)__p+="<div class='afterelementlabel-wrapper'>\n      ",rf.get(Formbuilder.options.mappings.INLINE_IMAGES_ENABLED)&&(__p+='\n    <span class="glyphicon glyphicon-picture"></span>\n    Inline Photo\n    ',rf.get(Formbuilder.options.mappings.INLINE_IMAGES_REQUIRED)&&(__p+="\n    <abbr title='required'>*</abbr>\n    "),__p+="\n    "),__p+="\n</div>\n";return __p},this.Formbuilder.templates["view/base"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)__p+="<div class='subtemplate-wrapper'>\n  <div class='cover'></div>\n  "+(null==(__t=Formbuilder.templates["view/conditional"]({rf:rf}))?"":__t)+"\n  "+(null==(__t=Formbuilder.templates["view/label"]({rf:rf}))?"":__t)+"\n\n  "+(null==(__t=Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].view({rf:rf}))?"":__t)+"\n\n  "+(null==(__t=Formbuilder.templates["view/description"]({rf:rf}))?"":__t)+"\n  \n  ",__p+=rf.get(Formbuilder.options.mappings.DISALLOW_DUPLICATION)?"\n    "+(null==(__t=Formbuilder.templates["view/remove"]({rf:rf}))?"":__t)+"\n  ":"\n    "+(null==(__t=Formbuilder.templates["view/duplicate_remove"]({rf:rf}))?"":__t)+"\n  ",__p+="\n\n  "+(null==(__t=Formbuilder.templates["view/afterelementlabel"]({rf:rf}))?"":__t)+"\n  \n</div>\n";return __p},this.Formbuilder.templates["view/base_non_input"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)__p+="<div class='subtemplate-wrapper'>\n  <div class='cover'></div>\n  "+(null==(__t=Formbuilder.templates["view/conditional"]({rf:rf}))?"":__t)+"\n  "+(null==(__t=Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].view({rf:rf}))?"":__t)+"\n\n  ",__p+=rf.get(Formbuilder.options.mappings.DISALLOW_DUPLICATION)?"\n    "+(null==(__t=Formbuilder.templates["view/remove"]({rf:rf}))?"":__t)+"\n  ":"\n    "+(null==(__t=Formbuilder.templates["view/duplicate_remove"]({rf:rf}))?"":__t)+"\n  ",__p+="\n\n  "+(null==(__t=Formbuilder.templates["view/afterelementlabel"]({rf:rf}))?"":__t)+"\n</div>\n";return __p},this.Formbuilder.templates["view/conditional"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj){var parent=rf.conditionalParent();if(parent){if(__p+='\n<div class="fb-conditional-question">\n    <i class="fb-icon-conditional"></i>\n    ',"approval"==parent.get("type"))__p+='\n    <span class="fb-conditional-question-trigger">\n                display when <span>'+(null==(__t=parent.get("label"))?"":__t)+'</span>\n                <span class="trigger-option">'+(null==(__t=rf.conditionalTriggerOptions(!0))?"":__t)+"</span>\n            </span>\n     ";else{var triggerValues=_.pluck(rf.conditionalTriggerOptions(!0),"label");__p+='\n            <span class="fb-conditional-question-trigger">\n                display when <span>'+(null==(__t=parent.get("label"))?"":__t)+'</span> is\n                <span class="trigger-option">'+(null==(__t=triggerValues.join('</span>or<span class="trigger-option">'))?"":__t)+"</span>\n            </span>\n     "}__p+="\n</div>\n\n"}__p+="\n\n"}return __p},this.Formbuilder.templates["view/description"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj)__p+="<span class='help-block'>\n  ",__p+="info"==rf.get("type")?"\n    "+(null==(__t=rf.get(Formbuilder.options.mappings.DESCRIPTION))?"":__t)+"\n  ":"\n    "+(null==(__t=Formbuilder.helpers.simple_format(rf.get(Formbuilder.options.mappings.DESCRIPTION)))?"":__t)+"\n  ",__p+="\n</span>";return __p},this.Formbuilder.templates["view/duplicate_remove"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='actions-wrapper'>\n  <button class=\"js-duplicate "+(null==(__t=Formbuilder.options.BUTTON_CLASS_ADD)?"":__t)+'" title="Duplicate Field"><span class="glyphicon glyphicon-plus"></span></button>\n  <button class="js-clear '+(null==(__t=Formbuilder.options.BUTTON_CLASS_REMOVE)?"":__t)+'" title="Remove Field"><span class="glyphicon glyphicon-minus"></span></button>\n</div>';return __p},this.Formbuilder.templates["view/element_selector"]=function(obj){obj||(obj={});var __p="";_.escape;with(obj)__p+='<div class="element-selector btn-group">\n<button type="button" class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown">\n    <span class="glyphicon glyphicon-plus"></span>\n</button>\n<ul class="dropdown-menu pull-right" role="menu">\n    <li data-type="text"><span class="fb-icon-text"></span> Text</li>\n    <li data-type="number"><span class="fb-icon-number"></span> Number</li>\n    <li data-type="textarea"><span class="fb-icon-textarea"></span> Paragraph</li>\n    <li data-type="info"><span class="fb-icon-info"></span> Info</li>\n    <li role="presentation" class="divider"></li>\n    <li data-type="dropdown"><span class="fb-icon-dropdown"></span> Dropdown</li>\n    <li data-type="radio"><span class="fb-icon-radio"></span> Radio Button</li>\n    <li data-type="checkbox"><span class="fb-icon-checkbox"></span> Checkboxes</li>\n    <li data-type="datasource"><span class="fb-icon-data-source"></span> Data Source</li>\n    <li role="presentation" class="divider"></li>\n    <li data-type="date"><span class="fb-icon-date"></span> Date</li>\n    <li data-type="time"><span class="fb-icon-time"></span> Time</li>\n    <li data-type="signature"><span class="fb-icon-signature"></span> Signature</li>\n    <li data-type="geolocation"><span class="fb-icon-geolocation"></span> GeoLocation</li>\n</ul>\n</div>\n';return __p},this.Formbuilder.templates["view/label"]=function(obj){obj||(obj={});var __t,__p="",__e=_.escape;Array.prototype.join;with(obj)__p+='<label>\n  <span style="color: '+__e(rf.get(Formbuilder.options.mappings.LABEL_COLOR)||"#000")+'">'+(null==(__t=Formbuilder.helpers.simple_format(rf.get(Formbuilder.options.mappings.LABEL)))?"":__t)+"\n  ",rf.get(Formbuilder.options.mappings.REQUIRED)&&(__p+="\n    <abbr title='required'>*</abbr>\n  "),__p+="\n</label>\n";return __p},this.Formbuilder.templates["view/link_object"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj){__p+='<div class="fb-link-object-fields">\n    <div class="object-name">\n        <label>'+(null==(__t=object.name)?"":__t)+"</label>\n    </div>\n    <div>\n        <span>Display Fields</span>\n    </div>\n    <ul>\n        ";for(field in object.fields)__p+="\n        <li>"+(null==(__t=object.fields[field])?"":__t)+"</li>\n        ";__p+="\n    </ul>\n</div>\n\n\n"}return __p},this.Formbuilder.templates["view/remove"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+="<div class='actions-wrapper'>\n  <button class=\"js-clear "+(null==(__t=Formbuilder.options.BUTTON_CLASS_REMOVE)?"":__t)+'" title="Remove Field"><span class="glyphicon glyphicon-minus"></span></button>\n</div>';return __p},this.Formbuilder.templates["view/table_element"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+=(null==(__t=Formbuilder.fields[rf.get(Formbuilder.options.mappings.TYPE)].view({rf:rf}))?"":__t)+"\n"+(null==(__t=Formbuilder.templates["view/remove"]({rf:rf}))?"":__t);return __p},this.Formbuilder.templates["view/table_field"]=function(obj){obj||(obj={});var __t,__p="";_.escape,Array.prototype.join;with(obj){__p+='<span class="drop-area">\n'+(null==(__t=Formbuilder.templates["view/element_selector"]())?"":__t)+'\n</span>\n<table class="response-field-table">\n\n     <tbody>\n        <tr>\n            ';for(i in rf.get("options.elements")||[])__p+='\n            <td width="'+(null==(__t=rf.get("options.elements")[i].width)?"":__t)+'" data-uuid="'+(null==(__t=rf.get("options.elements")[i].uuid)?"":__t)+'" class="fb-field-wrapper subtemplate-wrapper header header-'+(null==(__t=rf.get("options.elements")[i].uuid)?"":__t)+'"></td>\n            ';__p+="\n        </tr>\n        <tr>\n            ";for(i in rf.get("options.elements")||[])__p+='\n            <td width="'+(null==(__t=rf.get("options.elements")[i].width)?"":__t)+'" data-uuid="'+(null==(__t=rf.get("options.elements")[i].uuid)?"":__t)+'" class="fb-field-wrapper subtemplate-wrapper element element-'+(null==(__t=rf.get("options.elements")[i].uuid)?"":__t)+'"></td>\n            ';__p+="\n        </tr>\n    </tbody>\n    <tfoot>\n        <tr>\n            ";for(i in rf.get("options.elements")||[])__p+='\n            <td width="'+(null==(__t=rf.get("options.elements")[i].width)?"":__t)+'" data-uuid="'+(null==(__t=rf.get("options.elements")[i].uuid)?"":__t)+'" class="fb-field-wrapper subtemplate-wrapper total total-'+(null==(__t=rf.get("options.elements")[i].uuid)?"":__t)+'"></td>\n            ';__p+="\n        </tr>\n    </tfoot>\n</table>"}return __p},this.Formbuilder.templates["view/table_header"]=function(obj){obj||(obj={});var __t,__p="";_.escape;with(obj)__p+=(null==(__t=Formbuilder.templates["view/label"]({rf:rf}))?"":__t)+"\n"+(null==(__t=Formbuilder.templates["view/description"]({rf:rf}))?"":__t);return __p},this.Formbuilder.templates["view/table_total"]=function(obj){obj||(obj={});var __p="";_.escape,Array.prototype.join;with(obj)rf.get("options.total_sequence")&&(__p+='\n<span class="calculated">(Column Total)</span>\n');return __p};