(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{523:function(t,e,s){"use strict";s.r(e);var l=s(219),a=s(12),i=s(536),n=s.n(i),c=s(609),o=s(3).a.extend({components:{factorBtnDashboard:l.d,factorIcon:l.g,factorInputWrap:l.s},props:{value:{type:[Array,Object],default:()=>[]},inputs:{type:Array,default:()=>[]}},data:()=>({selected:0}),computed:{localValue:{get(){return this.ensure(this.value)},set(t){this.$emit("input",t)}}},mounted(){this.sortItems()},methods:{ensure:t=>t.map(t=>(t.__key||(t.__key=Object(a.d)()),t)),sortItems(){c.a.create(this.$refs.organizer,{filter:".ignore-sortable",ghostClass:"sortable-ghost",onUpdate:t=>{const e=this.localValue.slice();if(e[t.oldIndex]){const s=e.splice(t.oldIndex,1);e.splice(t.newIndex,0,s[0]),this.localValue=e,this.selected=t.newIndex}},onMove:t=>{if(n()(t.related).hasClass("ignore-sortable"))return!1}})},addItem(){const t=this.localValue.slice();t.push({__title:"",__key:Object(a.d)()}),this.localValue=t},removeItem(t){const e=this.localValue.slice();e.splice(t),this.localValue=e,t==this.selected&&(this.selected=0)},getValue(t){return this.localValue[this.selected]?this.localValue[this.selected][t]:null},setValue(t,e){const s=this.localValue.slice();s[this.selected]=Object.assign({},s[this.selected],{[t]:e}),this.localValue=s}}}),r=(s(685),s(531)),u=Object(r.a)(o,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"sortable-input"},[s("div",{staticClass:"sortable-items"},[s("div",{ref:"organizer",staticClass:"controls"},[t._l(t.localValue,(function(e,l){return s("div",{key:e.__key,staticClass:"sortable-item",class:l==t.selected?"active":"inactive",on:{click:function(e){t.selected=l}}},[s("div",{staticClass:"handle"},[e.__title?s("span",[t._v(t._s(e.__title))]):t._e(),t._v(" "),s("factor-icon",{attrs:{icon:"arrow-right"}})],1)])})),t._v(" "),s("factor-btn-dashboard",{attrs:{btn:"primary"},on:{click:function(e){return t.addItem()}}},[t._v("+")])],2),t._v(" "),s("div",{staticClass:"inputs"},[s("div",{staticClass:"title"},[s("input",{staticClass:"title-input",attrs:{type:"text",placeholder:"Edit Title",size:t.getValue("__title")?t.getValue("__title").length+2:8},domProps:{value:t.getValue("__title")},on:{input:function(e){return t.setValue("__title",e.target.value)}}}),t._v(" "),s("span",{staticClass:"edit-me"},[s("factor-icon",{attrs:{icon:"pencil"}})],1)]),t._v(" "),t._l(t.inputs,(function(e,l){return s("factor-input-wrap",{key:l,class:["engine-input",e.input],attrs:{value:t.getValue(e._id),input:"factor-input-"+e.input,label:e.label,description:e.description,inputs:e.inputs||[],"data-test":"input-"+e._id+"-"+(t.selected+1)},on:{input:function(s){return t.setValue(e._id,s)}}})})),t._v(" "),s("div",[s("factor-btn-dashboard",{attrs:{size:"tiny"},on:{click:function(e){return t.removeItem(t.selected)}}},[t._v("Remove Item")])],1)],2)])])}),[],!1,null,null,null);e.default=u.exports},563:function(t,e,s){},685:function(t,e,s){"use strict";var l=s(563);s.n(l).a}}]);