!function(e,t){var n=!0;e&&void 0!==e.umd&&(n=e.umd),n&&"object"==typeof exports?module.exports=t(require("jquery"),require("handlebars"),require("bootstrap")):n&&"function"==typeof define&&define.amd?define("alpaca",["jquery","handlebars","bootstrap"],t):e.Alpaca=t(e.jQuery,e.Handlebars,e.Bootstrap)}(this,function($,Handlebars,Bootstrap){return this.HandlebarsPrecompiled=this.HandlebarsPrecompiled||{},this.HandlebarsPrecompiled["web-display"]=this.HandlebarsPrecompiled["web-display"]||{},this.HandlebarsPrecompiled["web-display"]["container-array-item"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s='\n"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["container-array"]=Handlebars.template({1:function(e,t,n,i,a){var r,o,l,s="\n ";return o=null!=(o=n.item||(null!=t?t.item:t))?o:n.helperMissing,l={name:"item",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.item||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n\n"},2:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["container-object-item"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s='\n"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["container-object"]=Handlebars.template({1:function(e,t,n,i,a){var r,o,l,s="\n ";return o=null!=(o=n.item||(null!=t?t.item:t))?o:n.helperMissing,l={name:"item",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.item||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n\n"},2:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["container-table-item"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["container-table"]=Handlebars.template({1:function(e,t,n,i,a){return""},3:function(e,t,n,i,a){var r;return" "+e.escapeExpression(e.lambda(null!=(r=null!=t?t.value:t)?r.title:r,t))+"\n"},5:function(e,t,n,i,a){var r;return"\n "+(null!=(r=(n.item||t&&t.item||n.helperMissing).call(null!=t?t:{},"tr",{name:"item",hash:{},fn:e.program(1,a,0),inverse:e.noop,data:a}))?r:"")+"\n\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u=n.helperMissing,c='"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["container-tablerow-item"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s='\n"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["container-tablerow"]=Handlebars.template({1:function(e,t,n,i,a){var r,o,l,s=" ";return o=null!=(o=n.item||(null!=t?t.item:t))?o:n.helperMissing,l={name:"item",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.item||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n"},2:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"].container=Handlebars.template({1:function(e,t,n,i,a){var r;return' '+(null!=(r=e.lambda(null!=(r=null!=t?t.options:t)?r.label:r,t))?r:"")+"\n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))},4:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},5:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:""},6:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

\n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+"\n

\n"},7:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},9:function(e,t,n,i,a){return""},11:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-any"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-checkbox"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-hidden"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){return''},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-image"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o=null!=t?t:{},l=n.helperMissing,s=e.escapeExpression;return''},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-password"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-radio"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-select"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-text"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-textarea"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o;return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"]["control-url"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'target="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.anchorTarget:r,t))+'"'},3:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.anchorTitle:r,t))},5:function(e,t,n,i,a){var r;return e.escapeExpression((r=null!=(r=n.data||(null!=t?t.data:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"data",hash:{},data:a}):r))},7:function(e,t,n,i,a){var r;return" "+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.anchorTitle:r,t))+"\n"},9:function(e,t,n,i,a){var r;return" "+e.escapeExpression((r=null!=(r=n.data||(null!=t?t.data:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"data",hash:{},data:a}):r))+"\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-display"].control=Handlebars.template({1:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return' \n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))},4:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},5:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:""},6:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

\n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+"\n

\n"},7:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},9:function(e,t,n,i,a){return""},11:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='\n"},useData:!0}),this.HandlebarsPrecompiled["web-display"].form=Handlebars.template({1:function(e,t,n,i,a){return""},3:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.buttons:r,{name:"each",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a}))?r:""},4:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return' \n"},5:function(e,t,n,i,a){return'type="submit"'},7:function(e,t,n,i,a){return'type="reset"'},9:function(e,t,n,i,a){var r,o=e.escapeExpression;return o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},11:function(e,t,n,i,a){var r,o=e.escapeExpression;return" "+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]=this.HandlebarsPrecompiled["web-edit"]||{},this.HandlebarsPrecompiled["web-edit"]["container-array-actionbar"]=Handlebars.template({1:function(e,t,n,i,a,r,o){var l,s,u=e.escapeExpression,c=null!=t?t:{};return' \n"},2:function(e,t,n,i,a){return' \n'},4:function(e,t,n,i,a){var r,o;return null!=(o=null!=(o=n.label||(null!=t?t.label:t))?o:n.helperMissing,r="function"==typeof o?o.call(null!=t?t:{},{name:"label",hash:{},data:a}):o)?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l,s,u=null!=t?t:{},c=n.helperMissing,d=e.escapeExpression;return'"},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["web-edit"]["container-array-item"]=Handlebars.template({1:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u=n.helperMissing,c=n.blockHelperMissing,d='
\n ';return o=null!=(o=n.arrayActionbar||(null!=t?t.arrayActionbar:t))?o:u,l={name:"arrayActionbar",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(s,l):o,n.arrayActionbar||(r=c.call(t,r,l)),null!=r&&(d+=r),d+='\n
\n
\n ',o=null!=(o=n.itemField||(null!=t?t.itemField:t))?o:u,l={name:"itemField",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(s,l):o,n.itemField||(r=c.call(t,r,l)),null!=r&&(d+=r),d+'\n
\n
\n'},2:function(e,t,n,i,a){return""},4:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=t?t.actionbarStyle:t,"right",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.program(7,a,0),data:a}))?r:""},5:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u=n.helperMissing,c=n.blockHelperMissing,d='
\n ';return o=null!=(o=n.itemField||(null!=t?t.itemField:t))?o:u,l={name:"itemField",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(s,l):o,n.itemField||(r=c.call(t,r,l)),null!=r&&(d+=r),d+='\n
\n
\n ',o=null!=(o=n.arrayActionbar||(null!=t?t.arrayActionbar:t))?o:u,l={name:"arrayActionbar",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(s,l):o,n.arrayActionbar||(r=c.call(t,r,l)),null!=r&&(d+=r),d+'\n
\n
\n'},7:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u=n.helperMissing,c="
\n\n"+(null!=(r=(n.compare||t&&t.compare||u).call(s,null!=t?t.actionbarStyle:t,"top",{name:"compare",hash:{},fn:e.program(8,a,0),inverse:e.noop,data:a}))?r:"")+"\n ";return o=null!=(o=n.itemField||(null!=t?t.itemField:t))?o:u,l={name:"itemField",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(s,l):o,n.itemField||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(c+=r),c+"\n\n"+(null!=(r=(n.compare||t&&t.compare||u).call(s,null!=t?t.actionbarStyle:t,"bottom",{name:"compare",hash:{},fn:e.program(8,a,0),inverse:e.noop,data:a}))?r:"")+"\n
\n"},8:function(e,t,n,i,a){var r,o,l,s=" ";return o=null!=(o=n.arrayActionbar||(null!=t?t.arrayActionbar:t))?o:n.helperMissing,l={name:"arrayActionbar",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.arrayActionbar||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["container-array-toolbar"]=Handlebars.template({1:function(e,t,n,i,a){return" btn-group"},3:function(e,t,n,i,a,r,o){var l,s=null!=t?t:{},u=n.helperMissing;return"\n"+(null!=(l=(n.compare||t&&t.compare||u).call(s,null!=o[1]?o[1].toolbarStyle:o[1],"link",{name:"compare",hash:{},fn:e.program(4,a,0,r,o),inverse:e.noop,data:a}))?l:"")+"\n"+(null!=(l=(n.compare||t&&t.compare||u).call(s,null!=o[1]?o[1].toolbarStyle:o[1],"button",{name:"compare",hash:{},fn:e.program(6,a,0,r,o),inverse:e.noop,data:a}))?l:"")+"\n"},4:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return' '+(null!=(o=null!=(o=n.label||(null!=t?t.label:t))?o:s,r="function"==typeof o?o.call(l,{name:"label",hash:{},data:a}):o)?r:"")+"\n"},6:function(e,t,n,i,a,r,o){var l,s,u=e.escapeExpression,c=null!=t?t:{};return' \n"},7:function(e,t,n,i,a){var r;return' \n'},9:function(e,t,n,i,a){var r,o;return null!=(o=null!=(o=n.label||(null!=t?t.label:t))?o:n.helperMissing,r="function"==typeof o?o.call(null!=t?t:{},{name:"label",hash:{},data:a}):o)?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l,s,u=null!=t?t:{},c=n.helperMissing,d=e.escapeExpression;return'"},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["web-edit"]["container-array"]=Handlebars.template({1:function(e,t,n,i,a){var r,o,l,s=" ";return o=null!=(o=n.arrayToolbar||(null!=t?t.arrayToolbar:t))?o:n.helperMissing,l={name:"arrayToolbar",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.arrayToolbar||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n"},2:function(e,t,n,i,a){return""},4:function(e,t,n,i,a){var r,o,l,s=" ";return o=null!=(o=n.item||(null!=t?t.item:t))?o:n.helperMissing,l={name:"item",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.item||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o=null!=t?t:{},l=n.helperMissing;return'\n"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["container-object-item"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s='\n"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["container-object"]=Handlebars.template({1:function(e,t,n,i,a){var r,o,l,s="\n ";return o=null!=(o=n.item||(null!=t?t.item:t))?o:n.helperMissing,l={name:"item",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.item||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n\n"},2:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["container-table-item"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["container-table"]=Handlebars.template({1:function(e,t,n,i,a){return""},3:function(e,t,n,i,a){return' \n \n \n \n'},5:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return' "+(null!=(o=null!=(o=n.title||(null!=t?t.title:t))?o:s, r="function"==typeof o?o.call(l,{name:"title",hash:{},data:a}):o)?r:"")+"\n"},6:function(e,t,n,i,a){return'class="alpaca-table-column-hidden"'},8:function(e,t,n,i,a){return" Actions\n"},10:function(e,t,n,i,a){var r;return"\n "+(null!=(r=(n.item||t&&t.item||n.helperMissing).call(null!=t?t:{},"tr",{name:"item",hash:{},fn:e.program(1,a,0),inverse:e.noop,data:a}))?r:"")+"\n\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["container-tablerow-item"]=Handlebars.template({1:function(e,t,n,i,a){return""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s='\n"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["container-tablerow"]=Handlebars.template({1:function(e,t,n,i,a){return'\n \n
\n\n \n
\n \n
\n'},3:function(e,t,n,i,a){var r;return null!=(r=n.if.call(null!=t?t:{},null!=t?t.hidden:t,{name:"if",hash:{},fn:e.program(4,a,0),inverse:e.program(6,a,0),data:a}))?r:""},4:function(e,t,n,i,a){return""},6:function(e,t,n,i,a){var r,o,l,s=" ";return o=null!=(o=n.item||(null!=t?t.item:t))?o:n.helperMissing,l={name:"item",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(null!=t?t:{},l):o,n.item||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(s+=r),s+"\n"},8:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u=n.helperMissing,c='
\n ';return o=null!=(o=n.arrayActionbar||(null!=t?t.arrayActionbar:t))?o:u,l={name:"arrayActionbar",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a},r="function"==typeof o?o.call(s,l):o,n.arrayActionbar||(r=n.blockHelperMissing.call(t,r,l)),null!=r&&(c+=r),c+"\n
\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"].container=Handlebars.template({1:function(e,t,n,i,a){var r;return' '+(null!=(r=e.lambda(null!=(r=null!=t?t.options:t)?r.label:r,t))?r:"")+"\n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))},4:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},5:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:""},6:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

\n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+"\n

\n"},7:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},9:function(e,t,n,i,a){return""},11:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-any"]=Handlebars.template({1:function(e,t,n,i,a){return'readonly="readonly"'},3:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},5:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-checkbox"]=Handlebars.template({1:function(e,t,n,i,a,r,o){var l;return"\n"+(null!=(l=n.each.call(null!=t?t:{},null!=t?t.selectOptions:t,{name:"each",hash:{},fn:e.program(2,a,0,r,o),inverse:e.noop,data:a}))?l:"")+"\n"},2:function(e,t,n,i,a,r,o){var l,s,u=null!=t?t:{},c=n.helperMissing,d=e.escapeExpression;return'\n
\n\n \n
\n\n"},3:function(e,t,n,i,a){return"checked"},5:function(e,t,n,i,a){return'readonly="readonly"'},7:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},9:function(e,t,n,i,a){var r,o=null!=t?t:{},l=n.helperMissing,s=e.escapeExpression;return"data-"+s((r=null!=(r=n.key||a&&a.key)?r:l,"function"==typeof r?r.call(o,{name:"key",hash:{},data:a}):r))+'="'+s((r=null!=(r=n.value||(null!=t?t.value:t))?r:l,"function"==typeof r?r.call(o,{name:"value",hash:{},data:a}):r))+'"'},11:function(e,t,n,i,a){var r,o=null!=t?t:{};return'\n
\n\n \n\n
\n\n"},12:function(e,t,n,i,a){var r;return" "+(null!=(r=e.lambda(null!=(r=null!=t?t.options:t)?r.rightLabel:r,t))?r:"")+"\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l;return'\n"},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["web-edit"]["control-ckeditor"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return''},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-editor"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return''},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-file"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},3:function(e,t,n,i,a){return'readonly="readonly"'},5:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},7:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-hidden"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},3:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-image"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'placeholder="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.placeholder:r,t))+'"'},3:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},5:function(e,t,n,i,a){return'readonly="readonly"'},7:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},9:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return''},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-optiontree"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'placeholder="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.placeholder:r,t))+'"'},3:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},5:function(e,t,n,i,a){return'readonly="readonly"'},7:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},9:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},11:function(e,t,n,i,a){var r,o=e.escapeExpression;return o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-password"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'placeholder="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.placeholder:r,t))+'"'},3:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},5:function(e,t,n,i,a){return'readonly="readonly"'},7:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},9:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-radio"]=Handlebars.template({1:function(e,t,n,i,a){return""},3:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'
\n \n
\n"},4:function(e,t,n,i,a){return'readonly="readonly"'},6:function(e,t,n,i,a){return'checked="checked"'},8:function(e,t,n,i,a,r,o){var l,s,u=null!=t?t:{},c=e.escapeExpression,d=n.helperMissing;return'
\n \n
\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l,s=null!=t?t:{};return'"},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["web-edit"]["control-select"]=Handlebars.template({1:function(e,t,n,i,a){return'readonly="readonly"'},3:function(e,t,n,i,a){return'multiple="multiple"'},5:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},7:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},9:function(e,t,n,i,a){var r,o=null!=t?t:{};return"\n"+(null!=(r=n.if.call(o,null!=(r=null!=t?t.options:t)?r.hideNone:r,{name:"if",hash:{},fn:e.program(10,a,0),inverse:e.program(12,a,0),data:a}))?r:"")+"\n"+(null!=(r=n.each.call(o,null!=t?t.selectOptions:t,{name:"each",hash:{},fn:e.program(14,a,0),inverse:e.noop,data:a}))?r:"")+"\n"},10:function(e,t,n,i,a){return""},12:function(e,t,n,i,a){var r;return' \n"},14:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return' \n"},15:function(e,t,n,i,a){return'selected="selected"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-text"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'placeholder="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.placeholder:r,t))+'"'},3:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},5:function(e,t,n,i,a){return'readonly="readonly"'},7:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},9:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},11:function(e,t,n,i,a){var r,o=e.escapeExpression;return o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-textarea"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'placeholder="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.placeholder:r,t))+'"'},3:function(e,t,n,i,a){var r;return'rows="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.rows:r,t))+'"'},5:function(e,t,n,i,a){var r;return'cols="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.cols:r,t))+'"'},7:function(e,t,n,i,a){return'readonly="readonly"'},9:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},11:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return"data-"+e.escapeExpression((o=null!=(o=n.fieldId||(null!=t?t.fieldId:t))?o:s,"function"==typeof o?o.call(l,{name:"fieldId",hash:{},data:a}):o))+'="'+(null!=(o=null!=(o=n.value||(null!=t?t.value:t))?o:s,r="function"==typeof o?o.call(l,{name:"value",hash:{},data:a}):o)?r:"")+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"]["control-url"]=Handlebars.template({1:function(e,t,n,i,a){var r;return'placeholder="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.placeholder:r,t))+'"'},3:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},5:function(e,t,n,i,a){return'readonly="readonly"'},7:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},9:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"].control=Handlebars.template({1:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return' \n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))},4:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},5:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:""},6:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

\n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+"\n

\n"},7:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},9:function(e,t,n,i,a){return""},11:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},13:function(e,t,n,i,a){var r;return null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.buttons:r,{name:"if",hash:{},fn:e.program(14,a,0),inverse:e.noop,data:a}))?r:""},14:function(e,t,n,i,a){var r;return'
\n'+(null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.buttons:r,{name:"each",hash:{},fn:e.program(15,a,0),inverse:e.noop,data:a}))?r:"")+"
\n"},15:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u="function",c=e.escapeExpression;return' \n"},16:function(e,t,n,i,a){var r,o=null!=t?t:{},l=n.helperMissing,s=e.escapeExpression;return s((r=null!=(r=n.key||a&&a.key)?r:l,"function"==typeof r?r.call(o,{name:"key",hash:{},data:a}):r))+'="'+s((r=null!=(r=n.value||(null!=t?t.value:t))?r:l,"function"==typeof r?r.call(o,{name:"value",hash:{},data:a}):r))+'" '},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["web-edit"].form=Handlebars.template({1:function(e,t,n,i,a){return""},3:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.buttons:r,{name:"each",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a}))?r:""},4:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u="function",c=e.escapeExpression;return' \n"},5:function(e,t,n,i,a){var r;return'id="'+e.escapeExpression((r=null!=(r=n.id||(null!=t?t.id:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"id",hash:{},data:a}):r))+'"'},7:function(e,t,n,i,a){var r,o=e.escapeExpression;return o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},9:function(e,t,n,i,a){var r,o=e.escapeExpression;return" "+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["web-edit"].message=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return'"},useData:!0}),this.HandlebarsPrecompiled["web-edit"].wizard=Handlebars.template({1:function(e,t,n,i,a){var r;return'
\n \n
\n"},2:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return'
  • \n
    \n
    '+(null!=(o=null!=(o=n.title||(null!=t?t.title:t))?o:s,r="function"==typeof o?o.call(l,{name:"title",hash:{},data:a}):o)?r:"")+'
    \n
    '+(null!=(o=null!=(o=n.description||(null!=t?t.description:t))?o:s,r="function"==typeof o?o.call(l,{name:"description",hash:{},data:a}):o)?r:"")+'
    \n
    \n
    \n
  • \n'},4:function(e,t,n,i,a){return'
    \n
    \n
    \n
    \n
    \n
    \n'},6:function(e,t,n,i,a){var r,o;return"

    "+(null!=(o=null!=(o=n.wizardTitle||(null!=t?t.wizardTitle:t))?o:n.helperMissing,r="function"==typeof o?o.call(null!=t?t:{},{name:"wizardTitle",hash:{},data:a}):o)?r:"")+"

    \n"},8:function(e,t,n,i,a){var r,o;return"

    "+(null!=(o=null!=(o=n.wizardDescription||(null!=t?t.wizardDescription:t))?o:n.helperMissing,r="function"==typeof o?o.call(null!=t?t:{},{name:"wizardDescription",hash:{},data:a}):o)?r:"")+"

    \n"},10:function(e,t,n,i,a,r,o){var l;return null!=(l=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=t?t.align:t,"left",{name:"compare",hash:{},fn:e.program(11,a,0,r,o),inverse:e.noop,data:a}))?l:""},11:function(e,t,n,i,a,r,o){var l,s,u=null!=t?t:{},c=n.helperMissing,d=e.escapeExpression;return' \n"},12:function(e,t,n,i,a){var r;return'id="'+e.escapeExpression((r=null!=(r=n.id||(null!=t?t.id:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"id",hash:{},data:a}):r))+'"'},14:function(e,t,n,i,a){var r,o=e.escapeExpression;return" "+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},16:function(e,t,n,i,a,r,o){var l;return null!=(l=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=t?t.align:t,"right",{name:"compare",hash:{},fn:e.program(11,a,0,r,o),inverse:e.noop,data:a}))?l:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l,s=null!=t?t:{};return''},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["bootstrap-display"]=this.HandlebarsPrecompiled["bootstrap-display"]||{},this.HandlebarsPrecompiled["bootstrap-display"].container=Handlebars.template({1:function(e,t,n,i,a){var r,o=null!=t?t:{};return' \n\n'+(null!=(r=n.if.call(o,null!=(r=null!=t?t.options:t)?r.collapsible:r,{name:"if",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a}))?r:"")+"\n "+(null!=(r=e.lambda(null!=(r=null!=t?t.options:t)?r.label:r,t))?r:"")+"\n\n"+(null!=(r=n.if.call(o,null!=(r=null!=t?t.options:t)?r.collapsible:r,{name:"if",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:"")+"\n \n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))+" "},4:function(e,t,n,i,a){return' \n'},6:function(e,t,n,i,a){return" \n"},8:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:""},9:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(10,a,0),inverse:e.noop,data:a}))?r:""},10:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

    \n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(13,a,0),inverse:e.noop,data:a}))?r:"")+"\n

    \n"},11:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},13:function(e,t,n,i,a){return""},15:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='\n"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-display"]["control-chooser"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-display"]["control-radio"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-display"]["control-select"]=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r;return'\n"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-display"]["control-upload-partial-download"]=Handlebars.template({1:function(e,t,n,i,a){var r,o=e.lambda,l=e.escapeExpression;return' \n \n '+l(o(null!=(r=null!=t?t.file:t)?r.name:r,t))+'\n \n \n '+l(o(null!=(r=null!=t?t.file:t)?r.size:r,t))+'\n \n \n Error:\n '+l(o(null!=(r=null!=t?t.file:t)?r.error:r,t))+"\n \n"},3:function(e,t,n,i,a){var r,o=e.lambda,l=e.escapeExpression;return' \n'+(null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.file:t)?r.thumbnailUrl:r,{name:"if",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a}))?r:"")+' \n \n '+l(o(null!=(r=null!=t?t.file:t)?r.name:r,t))+'\n \n '+l(o(null!=(r=null!=t?t.file:t)?r.size:r,t))+'\n \n'},4:function(e,t,n,i,a){var r,o=e.lambda,l=e.escapeExpression;return' \n \n \n'},6:function(e,t,n,i,a,r,o){var l;return null!=(l=n.each.call(null!=t?t:{},null!=t?t.buttons:t,{name:"each",hash:{},fn:e.program(7,a,0,r,o),inverse:e.noop,data:a}))?l:""},7:function(e,t,n,i,a,r,o){var l;return null!=(l=n.if.call(null!=t?t:{},null!=t?t.isDelete:t,{name:"if",hash:{},fn:e.program(8,a,0,r,o),inverse:e.program(10,a,0,r,o),data:a}))?l:""},8:function(e,t,n,i,a,r,o){var l,s=e.escapeExpression;return' \n'},10:function(e,t,n,i,a,r,o){var l,s,u=null!=t?t:{},c=n.helperMissing,d=e.escapeExpression;return' \n"},11:function(e,t,n,i,a){var r;return' \n'},13:function(e,t,n,i,a){var r;return" "+e.escapeExpression((r=null!=(r=n.label||(null!=t?t.label:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"label",hash:{},data:a}):r))+"\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l,s=null!=t?t:{};return'"},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["bootstrap-display"]["control-upload-partial-upload"]=Handlebars.template({1:function(e,t,n,i,a){return' \n \n \n'},3:function(e,t,n,i,a){return" \n"},5:function(e,t,n,i,a){var r;return' Error '+e.escapeExpression(e.lambda(null!=(r=null!=t?t.file:t)?r.error:r,t))+"\n"},7:function(e,t,n,i,a){var r;return null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.file:t)?r.valid:r,{name:"if",hash:{},fn:e.program(8,a,0),inverse:e.program(15,a,0),data:a}))?r:""},8:function(e,t,n,i,a){var r,o=null!=t?t:{};return(null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(o,a&&a.index,0,{name:"compare",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+' \n'+(null!=(r=n.if.call(o,null!=(r=null!=t?t.options:t)?r.autoUpload:r,{name:"if",hash:{},fn:e.program(11,a,0),inverse:e.program(13,a,0),data:a}))?r:"")+" \n"},9:function(e,t,n,i,a){return' \n
    \n
    \n
    \n \n'},11:function(e,t,n,i,a){return""},13:function(e,t,n,i,a){return' \n'},15:function(e,t,n,i,a){var r;return' \n \n'+(null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},a&&a.index,0,{name:"compare",hash:{},fn:e.program(16,a,0),inverse:e.noop,data:a}))?r:"")+" \n"},16:function(e,t,n,i,a){return' \n'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o=null!=t?t:{},l=e.lambda,s=e.escapeExpression;return'"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-display"]["control-upload"]=Handlebars.template({1:function(e,t,n,i,a){var r;return e.escapeExpression((r=null!=(r=n.cssClasses||(null!=t?t.cssClasses:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"cssClasses",hash:{},data:a}):r))},3:function(e,t,n,i,a){var r;return" \n \n"+(null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.showUploadPreview:r,{name:"if",hash:{},fn:e.program(4,a,0),inverse:e.program(6,a,0),data:a}))?r:"")+' Name\n Size\n \n Actions\n \n \n'},4:function(e,t,n,i,a){return" Thumbnail\n"},6:function(e,t,n,i,a){return" \n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=e.escapeExpression,u=n.helperMissing;return''},useData:!0}),this.HandlebarsPrecompiled["bootstrap-display"].control=Handlebars.template({1:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return' \n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))},4:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},5:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:""},6:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

    \n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+"\n

    \n"},7:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},9:function(e,t,n,i,a){return""},11:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-display"].message=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o;return'"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"]=this.HandlebarsPrecompiled["bootstrap-edit"]||{},this.HandlebarsPrecompiled["bootstrap-edit"]["container-grid"]=Handlebars.template({1:function(e,t,n,i,a){return" btn-group"},3:function(e,t,n,i,a,r,o){var l,s=null!=t?t:{},u=n.helperMissing;return"\n"+(null!=(l=(n.compare||t&&t.compare||u).call(s,null!=(l=null!=o[1]?o[1].options:o[1])?l.toolbarStyle:l,"link",{name:"compare",hash:{},fn:e.program(4,a,0,r,o),inverse:e.noop,data:a}))?l:"")+"\n"+(null!=(l=(n.compare||t&&t.compare||u).call(s,null!=(l=null!=o[1]?o[1].options:o[1])?l.toolbarStyle:l,"button",{name:"compare",hash:{},fn:e.program(6,a,0,r,o),inverse:e.noop,data:a}))?l:"")+"\n"},4:function(e,t,n,i,a){var r=e.lambda,o=e.escapeExpression;return' '+o(r(null!=t?t.label:t,t))+"\n"},6:function(e,t,n,i,a,r,o){var l,s,u=e.escapeExpression,c=null!=t?t:{};return' \n"},7:function(e,t,n,i,a){var r;return' \n'},9:function(e,t,n,i,a){var r,o;return null!=(o=null!=(o=n.label||(null!=t?t.label:t))?o:n.helperMissing,r="function"==typeof o?o.call(null!=t?t:{},{name:"label",hash:{},data:a}):o)?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l,s=null!=t?t:{};return''},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["bootstrap-edit"]["container-table"]=Handlebars.template({1:function(e,t,n,i,a){return""},3:function(e,t,n,i,a){return' \n \n \n \n'},5:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return' "+(null!=(o=null!=(o=n.title||(null!=t?t.title:t))?o:s,r="function"==typeof o?o.call(l,{name:"title",hash:{},data:a}):o)?r:"")+"\n"},6:function(e,t,n,i,a){return'class="alpaca-table-column-hidden"'},8:function(e,t,n,i,a){return" Actions\n"},10:function(e,t,n,i,a){var r;return"\n "+(null!=(r=(n.item||t&&t.item||n.helperMissing).call(null!=t?t:{},"tr",{name:"item",hash:{},fn:e.program(1,a,0),inverse:e.noop,data:a}))?r:"")+"\n\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"].container=Handlebars.template({1:function(e,t,n,i,a){var r,o=null!=t?t:{};return' \n\n'+(null!=(r=n.if.call(o,null!=(r=null!=t?t.options:t)?r.collapsible:r,{name:"if",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a}))?r:"")+"\n "+(null!=(r=e.lambda(null!=(r=null!=t?t.options:t)?r.label:r,t))?r:"")+"\n\n"+(null!=(r=n.if.call(o,null!=(r=null!=t?t.options:t)?r.collapsible:r,{name:"if",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:"")+"\n \n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))+" "},4:function(e,t,n,i,a){return' \n'},6:function(e,t,n,i,a){return" \n"},8:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:""},9:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(10,a,0),inverse:e.noop,data:a}))?r:""},10:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

    \n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(13,a,0),inverse:e.noop,data:a}))?r:"")+"\n

    \n"},11:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},13:function(e,t,n,i,a){return""},15:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:""},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='\n"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"]["control-chooser"]=Handlebars.template({1:function(e,t,n,i,a){var r;return"\n"+(null!=(r=n.each.call(null!=t?t:{},null!=t?t.selectOptions:t,{name:"each",hash:{},fn:e.program(2,a,0),inverse:e.noop,data:a}))?r:"")+"\n"},2:function(e,t,n,i,a){var r;return null!=(r=n.if.call(null!=t?t:{},null!=t?t.filtered:t,{name:"if",hash:{},fn:e.program(3,a,0),inverse:e.program(5,a,0),data:a}))?r:""},3:function(e,t,n,i,a){return""},5:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return'
    \n
    '+u((o=null!=(o=n.text||(null!=t?t.text:t))?o:s,"function"==typeof o?o.call(l,{name:"text",hash:{},data:a}):o))+'
    \n
    \n'+(null!=(r=n.if.call(l,null!=t?t.selected:t,{name:"if",hash:{},fn:e.program(3,a,0),inverse:e.program(8,a,0),data:a}))?r:"")+'
    \n
    \n
    \n'},6:function(e,t,n,i,a){return"disabled"},8:function(e,t,n,i,a){return' \n'},10:function(e,t,n,i,a){var r;return"\n"+(null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.unselected:t)?r.length:r,{name:"if",hash:{},fn:e.program(11,a,0),inverse:e.program(15,a,0),data:a}))?r:"")+"\n"},11:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=t?t.unselected:t,{name:"each",hash:{},fn:e.program(12,a,0),inverse:e.noop,data:a}))?r:""},12:function(e,t,n,i,a){var r;return null!=(r=n.if.call(null!=t?t:{},null!=t?t.filtered:t,{name:"if",hash:{},fn:e.program(3,a,0),inverse:e.program(13,a,0),data:a}))?r:""},13:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return'
    \n
    '+u((o=null!=(o=n.text||(null!=t?t.text:t))?o:s,"function"==typeof o?o.call(l,{name:"text",hash:{},data:a}):o))+'
    \n
    \n \n
    \n
    \n
    \n'},15:function(e,t,n,i,a){return'
    All options have been selected
    \n'},17:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=t?t.selected:t,{name:"each",hash:{},fn:e.program(18,a,0),inverse:e.noop,data:a}))?r:""},18:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return'
    \n
    '+u((o=null!=(o=n.text||(null!=t?t.text:t))?o:s,"function"==typeof o?o.call(l,{name:"text",hash:{},data:a}):o))+'
    \n
    \n \n \n \n
    \n
    \n
    \n'},20:function(e,t,n,i,a){return'
    No options have been selected
    \n'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return'"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"]["control-colorpicker"]=Handlebars.template({1:function(e,t,n,i,a){return'
    \n'},3:function(e,t,n,i,a){var r;return'placeholder="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.placeholder:r,t))+'"'},5:function(e,t,n,i,a){var r;return'size="'+e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.size:r,t))+'"'},7:function(e,t,n,i,a){return'readonly="readonly"'},9:function(e,t,n,i,a){var r;return'name="'+e.escapeExpression((r=null!=(r=n.name||(null!=t?t.name:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"name",hash:{},data:a}):r))+'"'},11:function(e,t,n,i,a){var r,o=e.escapeExpression;return"data-"+o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},13:function(e,t,n,i,a){var r,o=e.escapeExpression;return o((r=null!=(r=n.key||a&&a.key)?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"key",hash:{},data:a}):r))+'="'+o(e.lambda(t,t))+'"'},15:function(e,t,n,i,a){return' \n
    \n'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u=e.escapeExpression;return'"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"]["control-upload-partial-download"]=Handlebars.template({1:function(e,t,n,i,a){var r,o=e.lambda,l=e.escapeExpression;return' \n \n '+l(o(null!=(r=null!=t?t.file:t)?r.name:r,t))+'\n \n \n '+l(o(null!=(r=null!=t?t.file:t)?r.size:r,t))+'\n \n \n Error:\n '+l(o(null!=(r=null!=t?t.file:t)?r.error:r,t))+"\n \n"},3:function(e,t,n,i,a){var r,o=e.lambda,l=e.escapeExpression;return' \n'+(null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.file:t)?r.thumbnailUrl:r,{name:"if",hash:{},fn:e.program(4,a,0),inverse:e.noop,data:a}))?r:"")+' \n \n '+l(o(null!=(r=null!=t?t.file:t)?r.name:r,t))+'\n \n '+l(o(null!=(r=null!=t?t.file:t)?r.size:r,t))+'\n \n'},4:function(e,t,n,i,a){var r,o=e.lambda,l=e.escapeExpression;return' \n \n \n'},6:function(e,t,n,i,a,r,o){var l;return null!=(l=n.each.call(null!=t?t:{},null!=t?t.buttons:t,{name:"each",hash:{},fn:e.program(7,a,0,r,o),inverse:e.noop,data:a}))?l:""},7:function(e,t,n,i,a,r,o){var l;return null!=(l=n.if.call(null!=t?t:{},null!=t?t.isDelete:t,{name:"if",hash:{},fn:e.program(8,a,0,r,o),inverse:e.program(10,a,0,r,o),data:a}))?l:""},8:function(e,t,n,i,a,r,o){var l,s=e.escapeExpression;return' \n'},10:function(e,t,n,i,a,r,o){var l,s,u=null!=t?t:{},c=n.helperMissing,d=e.escapeExpression;return' \n"},11:function(e,t,n,i,a){var r;return' \n'},13:function(e,t,n,i,a){var r;return" "+e.escapeExpression((r=null!=(r=n.label||(null!=t?t.label:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"label",hash:{},data:a}):r))+"\n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a,r,o){var l,s=null!=t?t:{};return'"},useData:!0,useDepths:!0}),this.HandlebarsPrecompiled["bootstrap-edit"]["control-upload-partial-upload"]=Handlebars.template({1:function(e,t,n,i,a){return' \n \n \n'},3:function(e,t,n,i,a){return" \n"},5:function(e,t,n,i,a){var r;return' Error '+e.escapeExpression(e.lambda(null!=(r=null!=t?t.file:t)?r.error:r,t))+"\n"},7:function(e,t,n,i,a){var r;return null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.file:t)?r.valid:r,{name:"if",hash:{},fn:e.program(8,a,0),inverse:e.program(15,a,0),data:a}))?r:""},8:function(e,t,n,i,a){var r,o=null!=t?t:{};return(null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(o,a&&a.index,0,{name:"compare",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+' \n'+(null!=(r=n.if.call(o,null!=(r=null!=t?t.options:t)?r.autoUpload:r,{name:"if",hash:{},fn:e.program(11,a,0),inverse:e.program(13,a,0),data:a}))?r:"")+" \n"},9:function(e,t,n,i,a){return' \n
    \n
    \n
    \n \n'},11:function(e,t,n,i,a){return""},13:function(e,t,n,i,a){return' \n'},15:function(e,t,n,i,a){var r;return' \n \n'+(null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},a&&a.index,0,{name:"compare",hash:{},fn:e.program(16,a,0),inverse:e.noop,data:a}))?r:"")+" \n"},16:function(e,t,n,i,a){return' \n'},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o=null!=t?t:{},l=e.lambda,s=e.escapeExpression;return'"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"]["control-upload"]=Handlebars.template({1:function(e,t,n,i,a){var r;return e.escapeExpression((r=null!=(r=n.cssClasses||(null!=t?t.cssClasses:t))?r:n.helperMissing,"function"==typeof r?r.call(null!=t?t:{},{name:"cssClasses",hash:{},data:a}):r))},3:function(e,t,n,i,a){var r;return" \n \n"+(null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.showUploadPreview:r,{name:"if",hash:{},fn:e.program(4,a,0),inverse:e.program(6,a,0),data:a}))?r:"")+' Name\n Size\n \n Actions\n \n \n'},4:function(e,t,n,i,a){return" Thumbnail\n"},6:function(e,t,n,i,a){return" \n"},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=e.escapeExpression,u=n.helperMissing;return''},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"].control=Handlebars.template({1:function(e,t,n,i,a){var r,o,l=null!=t?t:{};return' \n"},2:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.labelClass:r,t))},4:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"above",{name:"compare",hash:{},fn:e.program(5,a,0),inverse:e.noop,data:a}))?r:""},5:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(6,a,0),inverse:e.noop,data:a}))?r:""},6:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

    \n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+"\n

    \n"},7:function(e,t,n,i,a){var r;return e.escapeExpression(e.lambda(null!=(r=null!=t?t.options:t)?r.helperClass:r,t))},9:function(e,t,n,i,a){return""},11:function(e,t,n,i,a){var r;return null!=(r=(n.compare||t&&t.compare||n.helperMissing).call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpersPosition:r,"below",{name:"compare",hash:{},fn:e.program(12,a,0),inverse:e.noop,data:a}))?r:""},12:function(e,t,n,i,a){var r;return null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.helpers:r,{name:"each",hash:{},fn:e.program(13,a,0),inverse:e.noop,data:a}))?r:""},13:function(e,t,n,i,a){var r,o=null!=t?t:{};return'

    \n \n '+(null!=(r=(n.showMessage||t&&t.showMessage||n.helperMissing).call(o,t,{name:"showMessage",hash:{},fn:e.program(9,a,0),inverse:e.noop,data:a}))?r:"")+"\n

    \n"},15:function(e,t,n,i,a){var r ;return null!=(r=n.if.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.buttons:r,{name:"if",hash:{},fn:e.program(16,a,0),inverse:e.noop,data:a}))?r:""},16:function(e,t,n,i,a){var r;return'
    \n'+(null!=(r=n.each.call(null!=t?t:{},null!=(r=null!=t?t.options:t)?r.buttons:r,{name:"each",hash:{},fn:e.program(17,a,0),inverse:e.noop,data:a}))?r:"")+"
    \n"},17:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing,u="function",c=e.escapeExpression;return' \n"},18:function(e,t,n,i,a){var r,o=null!=t?t:{},l=n.helperMissing,s=e.escapeExpression;return s((r=null!=(r=n.key||a&&a.key)?r:l,"function"==typeof r?r.call(o,{name:"key",hash:{},data:a}):r))+'="'+s((r=null!=(r=n.value||(null!=t?t.value:t))?r:l,"function"==typeof r?r.call(o,{name:"value",hash:{},data:a}):r))+'" '},compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l,s=null!=t?t:{},u='"},useData:!0}),this.HandlebarsPrecompiled["bootstrap-edit"].message=Handlebars.template({compiler:[7,">= 4.0.0"],main:function(e,t,n,i,a){var r,o,l=null!=t?t:{},s=n.helperMissing;return'"},useData:!0}),function(e,t){e.Base=function(){var e=!1,t=["constructor","toString","valueOf"],n=t.length,i=/\bbase\b/,a=function(){},r={toSource:null,base:a},o=function(){};return o.extend=function(t,n){var i=o.prototype.extend;e=!0;var a=new this;i.call(a,t),a.base=r.base,e=!1;var l=a.constructor,s=a.constructor=function(){e||(this&&(this._constructing||this.constructor===s)?(this._constructing=!0,l.apply(this,arguments),this._constructing=!1):arguments.length&&o.cast.apply(s,arguments))};return i.call(s,this),s.ancestor=this,s.prototype=a,s.valueOf=function(e){return"object"===e?s:l.valueOf()},i.call(s,n),"function"==typeof s.init&&s.init(),s},o.prototype.extend=function(a,l){if("string"==typeof a&&arguments.length>1){var s=this[a];if(s&&"function"==typeof l&&(!s.valueOf||s.valueOf()!==l.valueOf())&&i.test(l)){var u=l.valueOf();l=function(){var e,t=this.base||r.base;return this.base=s,e=0===arguments.length?u.call(this):u.apply(this,arguments),this.base=t,e},l.valueOf=function(e){return"object"===e?l:u},l.toString=o.toString}this[a]=l}else if(a){var c=o.prototype.extend;e||"function"==typeof this||(c=this.extend||c);for(var d,p=e?0:1;p0){var u=e(s[0]).attr("data-alpaca-field-id");if(u){var c=t.fieldInstances[u];c&&(r=c)}}}}if(!r&&!a){var d=e(i).find(":first");if(d.length>0){var p=b(d[0],!0);p&&(r=p)}}if(!r&&!a){var h=e(i).parent();if(h){var f=b(h,!0);f&&(r=f)}}return r},y=["get","exists","destroy"],w=n.length>1&&t.isString(n[1])&&y.indexOf(n[1])>-1,x=b(i);if(x||w){if(w){var E=n[1];return"get"===E?x:"exists"===E?!!x:"destroy"===E?void(x&&x.destroy()):t.throwDefaultError("Unknown special function: "+E)}return x}var F=null;if(1===n.length){var C=e(i).text();F=JSON.parse(C),e(i).html("")}else F=t.isObject(n[1])?n[1]:t.isFunction(n[1])?n[1]():{data:n[1]};if(!F)return t.throwDefaultError("Unable to determine Alpaca configuration");if(a=F.data,r=F.schema,o=F.options,l=F.view,s=F.render,F.callback&&(s=F.callback),u=F.postRender,c=F.error,d=F.connector,f=F.dataSource,m=F.schemaSource,g=F.optionsSource,v=F.viewSource,F.ui&&(h.ui=F.ui),F.type&&(h.type=F.type),t.isEmpty(F.notTopLevel)||(p=F.notTopLevel),t.isEmpty(c)&&(c=t.defaultErrorCallback),!d||!d.connect){var T="default",S={};t.isString(d)?T=d:t.isObject(d)&&d.id&&(T=d.id,d.config&&(S=d.config));var k=t.getConnectorClass(T);k||(k=t.getConnectorClass("default")),d=new k(T,S)}var A=d;if(p){A=new(t.getConnectorClass("default"))("default")}o||(o={});var O=function(e){e.parent||(e.hideInitValidationError||e.refreshValidationState(!0),"view"!==e.view.type&&t.fieldApplyFieldAndChildren(e,function(e){e.hideInitValidationError=!1}))},M=function(e){e.parent||(e.observableScope=t.generateId()),e.parent||t.fireReady(e),t.isUndefined(o.focus)&&!e.parent&&(o.focus=t.defaultFocus),o&&o.focus?window.setTimeout(function(){var t=function(e){e.suspendBlurFocus=!0,e.focus(),e.suspendBlurFocus=!1};if(o.focus){if(e.isControlField&&e.isAutoFocusable())t(e);else if(e.isContainerField)if(o.focus===!0)e.children&&e.children.length>0&&t(e);else if("string"==typeof o.focus){var n=e.getControlByPath(o.focus);n&&n.isControlField&&n.isAutoFocusable()&&t(n)}O(e)}},500):O(e),u&&u(e)};A.loadAll({data:a,schema:r,options:o,view:l,dataSource:f,schemaSource:m,optionsSource:g,viewSource:v},function(e,n,u,p){return e=e||a,u=u||r,n=n||o,p=p||l,t.isEmpty(e)&&t.isEmpty(u)&&(t.isEmpty(n)||t.isEmpty(n.type))&&(e="",t.isEmpty(n)?n="text":o&&t.isObject(o)&&(n.type="text")),n.view&&!l&&(p=n.view),t.init(i,e,n,u,p,h,s,M,d,c)},function(e){return c(e),null})};t.Fields={},t.Connectors={},t.Extend=e.extend,t.Create=function(){var t=Array.prototype.slice.call(arguments);return t.unshift({}),e.extend.apply(this,t)},t.Extend(t,{makeArray:function(e){return Array.prototype.slice.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isString:function(e){return"string"==typeof e},isObject:function(e){return!t.isUndefined(e)&&"[object Object]"===Object.prototype.toString.call(e)},isPlainObject:function(t){return e.isPlainObject(t)},isNumber:function(e){return"number"==typeof e},isArray:function(e){return e instanceof Array},isBoolean:function(e){return"boolean"==typeof e},isUndefined:function(e){return void 0===e},trim:function(e){var n=e;return n&&t.isString(n)&&(n=n.replace(/^\s+|\s+$/g,"")),n},safeDomParse:function(n){if(n&&t.isString(n)){n=t.trim(n);var i=null;try{i=e(n)}catch(t){n="
    "+n+"
    ",i=e(n).children()}return i}return n},isEmpty:function(e,n){var i=this;if(t.isUndefined(e))return!0;if(null===e)return!0;if(e&&t.isObject(e)){if(0===i.countProperties(e,n))return!0}return!1},countProperties:function(e,n){var i=0;if(e&&t.isObject(e))for(var a in e)e.hasOwnProperty(a)&&(n?i++:"function"!=typeof e[a]&&i++);return i},copyOf:function(n){var i=n;if(t.isArray(n)){i=[];for(var a=0;at.text?1:e.text3?"select":"radio":t.defaultSchemaFieldMapping[e.type],e.format&&t.defaultFormatFieldMapping[e.format]&&(n=t.defaultFormatFieldMapping[e.format]),n},views:{},generateViewId:function(){return"view-"+this.generateId()},registerView:function(e){var n=e.id;if(!n)return t.throwDefaultError("Cannot register view with missing view id: "+n);var i=this.views[n];if(i)t.mergeObject(i,e);else{this.views[n]=e,e.templates||(e.templates={});for(var a=t.TemplateEngineRegistry.ids(),r=0;r0&&(t.normalizedViews={})},registerTemplates:function(e,t){for(var n in e)this.registerTemplate(n,e[n],t)},registerMessage:function(e,t,n){n||(n="base"),this.views[n]||(this.views[n]={},this.views[n].id=n),this.views[n].messages||(this.views[n].messages={}),this.views[n].messages[e]=t},registerMessages:function(e,t){for(var n in e)e.hasOwnProperty(n)&&this.registerMessage(n,e[n],t)},defaultDateFormat:"MM/DD/YYYY",defaultTimeFormat:"HH:mm:ss",regexps:{email:/^[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+(?:\.[a-z0-9!\#\$%&'\*\-\/=\?\+\-\^_`\{\|\}~]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,6}$/i,url:/^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\:[0-9]{1,5})?(\/.*)?$/i,"intranet-url":/^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\:[0-9]{1,5})?(\/.*)?$/i,password:/^[0-9a-zA-Z\x20-\x7E]*$/,date:/^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.]\d\d$/,integer:/^([\+\-]?([1-9]\d*)|0)$/,number:/^([\+\-]?((([0-9]+(\.)?)|([0-9]*\.[0-9]+))([eE][+-]?[0-9]+)?))$/,phone:/^(\D?(\d{3})\D?\D?(\d{3})\D?(\d{4}))?$/,ipv4:/^(?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)(?:\.(?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)){3}$/,"zipcode-five":/^(\d{5})?$/,"zipcode-nine":/^(\d{5}(-\d{4})?)?$/,whitespace:/^\s+$/},fieldInstances:{},fieldClassRegistry:{},registerFieldClass:function(e,t){this.fieldClassRegistry[e]=t},getFieldClass:function(e){return this.fieldClassRegistry[e]},getFieldClassType:function(e){for(var t in this.fieldClassRegistry)if(this.fieldClassRegistry.hasOwnProperty(t)&&this.fieldClassRegistry[t]===e)return t;return null},connectorClassRegistry:{},registerConnectorClass:function(e,t){this.connectorClassRegistry[e]=t},getConnectorClass:function(e){return this.connectorClassRegistry[e]},replaceAll:function(e,t,n){return e.replace(new RegExp(t,"g"),n)},element:function(t,n,i,a){var r=e("<"+t+"/>");if(n&&r.attr(n),i&&r.css(i),a)for(var o in a)r.addClass(o)},elementFromTemplate:function(n,i){var a=n;if(i)for(var r in i)a=t.replaceAll(a,"${"+r+"}",i[r]);return e(a)},generateId:function(){return"alpaca"+ ++t.uniqueIdCounter},later:function(t,n,i,a,r){t=t||0,n=n||{};var o,l,s=i,u=e.makeArray(a);if("string"==typeof i&&(s=n[i]),!s)throw{name:"TypeError",message:"The function is undefined."};return o=function(){s.apply(n,u)},l=r?setInterval(o,t):setTimeout(o,t),{id:l,interval:r,cancel:function(){this.interval?clearInterval(l):clearTimeout(l)}}},endsWith:function(e,t){return e.indexOf(t,e.length-t.length)!==-1},startsWith:function(e,t){return e.substr(0,t.length)===t},isUri:function(e){return t.isString(e)&&(t.startsWith(e,"http://")||t.startsWith(e,"https://")||t.startsWith(e,"/")||t.startsWith(e,"./")||t.startsWith(e,"../"))},traverseObject:function(e,n,i){t.isString(n)&&(n=n.split("."));var a=null,r=e,o=null;do{o=n.shift(),i&&o===i&&(o=n.shift()),t.isEmpty(r[o])?n=[]:(r=r[o],0===n.length&&(a=r))}while(n.length>0);return a},each:function(e,n){if(t.isArray(e))for(var i=0;i-1){var o=e.substring(0,r)+n[i]+e.substring(r+3);e=o}}return e},compareObject:function(e,t){return equiv(e,t)},compareArrayContent:function(t,n){var i=t&&n&&t.length===n.length;if(i)for(var a=t.length-1;a>=0;a--){var r=t[a];if(e.inArray(r,n)<0)return!1}return i},testRegex:function(e,t){return new RegExp(e).test(t)},isValEmpty:function(n,i){var a=!1;return t.isEmpty(n,i)?a=!0:(t.isString(n)&&""===n&&(a=!0),t.isObject(n)&&e.isEmptyObject(n)&&(a=!0),t.isArray(n)&&0===n.length&&(a=!0)),a},init:function(e,n,i,a,r,o,l,s,u,c){var d=this;if(t.isObject(r)){r.id||(r.id=this.generateViewId());r.parent||(r.parent="bootstrap-edit"),this.registerView(r),r=r.id}this.compile(u,function(p){if(p.errors&&p.errors.length>0){for(var h=[],f=0;f0?c(e):l(e)}()},getTemplateDescriptor:function(e,n,i){var a=null,r=null,o=null;if(e.templates&&e.templates[n]){o=t.makeCacheKey(e.id,"view",e.id,n);var l=e.templates[n];t.isObject(l)&&l.cacheKey&&(o=l.cacheKey)}if(i&&i.path){var s=i.path;if(e&&e.fields&&s&&s.length>1){var u=function(i,a,r){if(a!=i.length){var o=i.slice(),l=!1,s=i[a],c=s.indexOf("[");c>-1&&(s=s.substring(0,c),l=!0),o[a]=s;var d=o.join("/");if(e.fields[d]&&e.fields[d].templates&&e.fields[d].templates[n]){var p=t.makeCacheKey(e.id,"field",d,n);p&&r.push({path:d,cacheKey:p})}u(i,a+1,r),l&&u(o,a+1,r)}},c=s.split("/"),d=[];u(c,0,d),d.length>0&&(o=d[0].cacheKey)}}if("globalTemplate"!==n&&"global"!==n||(o=t.makeCacheKey(e.id,"global","global","globalTemplate")),"layoutTemplate"!==n&&"layout"!==n||(o=t.makeCacheKey(e.id,"layout","layout","layoutTemplate")),o){for(var p=t.TemplateEngineRegistry.ids(),h=0;h
    ").append(this).html():e("
    ").append(this.clone()).html()},e.fn.swapWith=function(t){return this.each(function(){var n=e(t).clone(),i=e(this).clone();e(t).replaceWith(i),e(this).replaceWith(n)})},e.fn.attrProp=function(n,i){return t.attrProp(e(this),n,i)},e.event.special.destroyed={remove:function(e){e.handler&&e.handler()}},t.pathParts=function(e){if("string"!=typeof e)return e;var n=e,i=null,a=n.indexOf("#");a>-1&&(i=n.substring(a+1),n=n.substring(0,a)),t.endsWith(n,"/")&&(n=n.substring(0,n.length-1));var r={};return r.path=n,i&&(r.id=i),r},t.resolveField=function(e,n){var i=null;if("string"==typeof n)if(0===n.indexOf("#/")&&propertyId.length>2);else if("#"===n||"#/"===n)i=e;else if(0===n.indexOf("#")){for(var a=e;a.parent;)a=a.parent;var r=n.substring(1);i=t.resolveFieldByReference(a,r)}else i=e.childrenByPropertyId[n];return i},t.resolveFieldByReference=function(e,n){if(e.schema&&e.schema.id==n)return e;if(e.children&&e.children.length>0)for(var i=0;i1){var s=e.slice(0);s.shift(),r(s,t,function(){l(i,a,function(){n()})})}else l(i,a,function(){n()})};r(n,a,function(){t(a)})},t.updateValidationStateForContext=function(e,n){for(var i=0;i0)for(var i=0;i=t.length&&i(null)}))})},r.forEach=r.each,r.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var i=0,a=function(){t(e[i],function(t){t?(n(t),n=function(){}):(i+=1,i>=e.length?n(null):a())})};a()},r.forEachSeries=r.eachSeries,r.eachLimit=function(e,t,n,i){c(t).apply(null,[e,n,i])},r.forEachLimit=r.eachLimit;var c=function(e){return function(t,n,i){if(i=i||function(){},!t.length||e<=0)return i();var a=0,r=0,o=0;!function l(){if(a>=t.length)return i();for(;o=t.length?i():l())})}()}},d=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.each].concat(t))}},p=function(e,t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[c(e)].concat(n))} },h=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[r.eachSeries].concat(t))}},f=function(e,t,n,i){var a=[];t=l(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){n(e.value,function(n,i){a[e.index]=i,t(n)})},function(e){i(e,a)})};r.map=d(f),r.mapSeries=h(f),r.mapLimit=function(e,t,n,i){return m(t)(e,n,i)};var m=function(e){return p(e,f)};r.reduce=function(e,t,n,i){r.eachSeries(e,function(e,i){n(t,e,function(e,n){t=n,i(e)})},function(e){i(e,t)})},r.inject=r.reduce,r.foldl=r.reduce,r.reduceRight=function(e,t,n,i){var a=l(e,function(e){return e}).reverse();r.reduce(a,t,n,i)},r.foldr=r.reduceRight;var g=function(e,t,n,i){var a=[];t=l(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){n(e.value,function(n){n&&a.push(e),t()})},function(e){i(l(a.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};r.filter=d(g),r.filterSeries=h(g),r.select=r.filter,r.selectSeries=r.filterSeries;var v=function(e,t,n,i){var a=[];t=l(t,function(e,t){return{index:t,value:e}}),e(t,function(e,t){n(e.value,function(n){n||a.push(e),t()})},function(e){i(l(a.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};r.reject=d(v),r.rejectSeries=h(v);var b=function(e,t,n,i){e(t,function(e,t){n(e,function(n){n?(i(e),i=function(){}):t()})},function(e){i()})};r.detect=d(b),r.detectSeries=h(b),r.some=function(e,t,n){r.each(e,function(e,i){t(e,function(e){e&&(n(!0),n=function(){}),i()})},function(e){n(!1)})},r.any=r.some,r.every=function(e,t,n){r.each(e,function(e,i){t(e,function(e){e||(n(!1),n=function(){}),i()})},function(e){n(!0)})},r.all=r.every,r.sortBy=function(e,t,n){r.map(e,function(e,n){t(e,function(t,i){t?n(t):n(null,{value:e,criteria:i})})},function(e,t){if(e)return n(e);var i=function(e,t){var n=e.criteria,i=t.criteria;return ni?1:0};n(null,l(t.sort(i),function(e){return e.value}))})},r.auto=function(e,t){t=t||function(){};var n=u(e);if(!n.length)return t(null);var i={},a=[],l=function(e){a.unshift(e)},c=function(e){for(var t=0;t2){var i=Array.prototype.slice.call(arguments,2);return n.apply(this,i)}return n};r.applyEach=d(E),r.applyEachSeries=h(E),r.forever=function(e,t){function n(i){if(i){if(t)return t(i);throw i}e(n)}n()},i.async=r;i.equiv=function(){var e,i=[],a=function(){function n(e,t){return e instanceof t.constructor||t instanceof e.constructor?t==e:t===e}return{string:n,boolean:n,number:n,null:n,undefined:n,nan:function(e){return isNaN(e)},date:function(e,n){return"date"===t(e)&&n.valueOf()===e.valueOf()},regexp:function(e,n){return"regexp"===t(e)&&n.source===e.source&&n.global===e.global&&n.ignoreCase===e.ignoreCase&&n.multiline===e.multiline},function:function(){var e=i[i.length-1];return e!==Object&&void 0!==e},array:function(n,i){var a,r;if("array"!==t(n))return!1;if((r=i.length)!==n.length)return!1;for(a=0;a0)for(var n=0;n-1},t.indexOf=function(t,n){return e.inArray(n,t)},t.moment=function(){if(t._moment||window.moment&&(t._moment=window.moment),!t._moment)throw new Error("The moment.js library has not been included, cannot produce moment object");return t._moment.call(this,arguments)},t.CSRF_TOKEN=null,t.CSRF_COOKIE_NAMES=["CSRF-TOKEN","XSRF-TOKEN"],t.CSRF_HEADER_NAME="X-CSRF-TOKEN",t.defaultToolbarSticky=void 0,t.showReadOnlyInvalidState=!1,t.defaultHelpersPosition="below",t.caches={},t.registerCache=function(e,n){t.caches[e]=n},t.getCache=function(e){return t.caches[e]},t.externalMessage=function(e){}}(jQuery),function(e){var t=e.alpaca;t.listenerId=function(){var e=0;return function(){return"listener-"+e++}}(),t.subscribe=function(){var e=t.makeArray(arguments),n=null,i=null,a=null;if(2==e.length?(n="global",i=e.shift(),a=e.shift()):(n=e.shift(),i=e.shift(),a=e.shift()),i&&t.isObject(i)&&(i=i.path),!i)return t.logError("Missing observable subscribe id: "+i),null;var r=a._lfid;r||(r=t.listenerId(),a._lfid=r);var o=function(e){return function(){return a.apply(e,arguments)}}(this);return o._lfid=a._lfid,t.ScopedObservables.get(n).observable(i).subscribe(r,o),{scope:n,id:i,listenerId:r}},t.unsubscribe=function(){var e=t.makeArray(arguments),n=null,i=null,a=null;2==e.length?(n="global",i=e.shift(),a=e.shift()):3==e.length&&(n=e.shift(),i=e.shift(),a=e.shift());var r=a;return t.isFunction(r)&&(r=r._lfid),i&&t.isObject(i)&&(i=i.path),i?(t.ScopedObservables.get(n).observable(i).unsubscribe(r),{scope:n,id:i,listenerId:r}):(t.logError("Missing observable id: "+i),null)},t.observable=function(){var e,n,i=t.makeArray(arguments);if(1==i.length?(e="global",n=i.shift()):2==i.length&&(e=i.shift(),n=i.shift()),n&&t.isObject(n)&&(n=n.path),n){var a=t.ScopedObservables.get(e);observable=a.observable(n)}else t.logError("Missing observable id: "+JSON.stringify(i));return observable},t.clearObservable=function(){var e,n,i=t.makeArray(arguments);1==i.length?(e="global",n=i.shift()):2==i.length&&(e=i.shift(),n=i.shift()),n&&t.isObject(n)&&(n=n.path),n||t.logError("Missing observable id: "+JSON.stringify(i)),t.ScopedObservables.get(e).observable(n).clear()},t.dependentObservable=function(){var e=null,n=null,i=null,a=t.makeArray(arguments);if(2==a.length)e="global",n=a.shift(),i=a.shift();else{if(3!=a.length)return void t.error("Wrong number of arguments");e=a.shift(),n=a.shift(),i=a.shift()}return n&&t.isObject(n)&&(n=n.path),n||t.logError("Missing observable id: "+JSON.stringify(a)),t.ScopedObservables.get(e).dependentObservable(n,i)}}(jQuery),function(e){var t=e.alpaca;t.Observables=Base.extend({constructor:function(e){this.base(),this.scope=e,this.observables={}},observable:function(e,n){if(!this.observables[e]){var i=new t.Observable(this.scope,e);n&&i.set(n),this.observables[e]=i}return this.observables[e]},dependentObservable:function(e,n){var i=this;if(!this.observables[e]){var a=this.observable(e),r=new t.Observables(this.scope);r.observable=function(e,t){var n=i.observable(e,t);return n.markDependentOnUs(a),n};var o=function(){return n.call(r)};a.setValueFunction(o)}return this.observables[e]},observables:function(){return this.observables}})}(jQuery),function(e){e.alpaca.Observable=Base.extend({constructor:function(t,n){this.base(),this.id=t+"-"+n,this.value=null,this.subscribers={},this.dependentOnUs={},this.notifySubscribers=function(t){var n=this;e.each(this.subscribers,function(e,i){i(n.value,t)})},this.notifyDependents=function(t){e.each(this.dependentOnUs,function(e,t){t.onDependencyChange()})},this.valueFunction=null},setValueFunction:function(e){this.valueFunction=e,this.onDependencyChange()},subscribe:function(e,t){this.isSubscribed(e)||(this.subscribers[e]=t)},unsubscribe:function(e){delete this.subscribers[e]},isSubscribed:function(e){return!!this.subscribers[e]},markDependentOnUs:function(e){this.dependentOnUs[e.id]=e},onDependencyChange:function(){var e=this.get();if(this.valueFunction){var t=this.valueFunction();e!=t&&this.set(t)}},set:function(e){var t=this.value;this.value=e,this.notifyDependents(t),this.notifySubscribers(t)},get:function(e){var t=this.value;return t||(t=e),t},clear:function(){var e=this.value;delete this.value,this.notifyDependents(e),this.notifySubscribers(e)}})}(jQuery),function(e){var t=e.alpaca;t.ScopedObservables={},t.ScopedObservables.map={},t.ScopedObservables.get=function(e){return t.ScopedObservables.map[e]||(t.ScopedObservables.map[e]=new t.Observables(e)),t.ScopedObservables.map[e]}}(jQuery),function(){Alpaca.TemplateEngineRegistry=function(){var e={};return{register:function(t,n){e[t]=n,n.init()},find:function(t){var n=null;if(e[t])n=e[t];else for(var i in e)for(var a=e[i].supportedMimetypes(),r=0;r"+t+""),Alpaca.logDebug("Compiling template: "+this.id+", cacheKey: "+e+", template: "+t),this.doCompile(e,t,n)},doCompile:function(e,t,n){},execute:function(e,t,n){Alpaca.logDebug("Executing template for cache key: "+e);var i=this.doExecute(e,t,n);return i=this.cleanup(i)},doExecute:function(e,t,n){return null},fileExtension:function(){return"html"},supportedMimetypes:function(){return[]},isCached:function(e){return!1},findCacheKeys:function(e){return[]}})}(jQuery),function($,Handlebars,HandlebarsPrecompiled){var COMPILED_TEMPLATES={},helpers={};helpers.compare=function(e,t,n){if(arguments.length<3)throw new Error("Handlerbars Helper 'compare' needs 2 parameters");var i=n.hash.operator||"==",a={"==":function(e,t){return e==t},"===":function(e,t){return e===t},"!=":function(e,t){return e!=t},"!==":function(e,t){return e!==t},"<":function(e,t){return e":function(e,t){return e>t},"<=":function(e,t){return e<=t},">=":function(e,t){return e>=t},typeof:function(e,t){return typeof e==t}};if(!a[i])throw new Error("Handlerbars Helper 'compare' doesn't know the operator "+i);return a[i](e,t)?n.fn(this):n.inverse(this)},helpers.ifnot=function(e,t){return e?t.inverse(this):t.fn(this)},helpers.times=function(e,t){for(var n="",i=0;i
    "},helpers.container=function(e){return"
    "},helpers.item=function(e,t){return Alpaca.isObject(e)&&(e,e="div"),"<"+e+" class='"+Alpaca.MARKER_CLASS_CONTAINER_FIELD_ITEM+"' "+Alpaca.MARKER_DATA_CONTAINER_FIELD_ITEM_KEY+"='"+this.name+"'>"},helpers.itemField=function(e,t){return Alpaca.isObject(e)&&(e,e="div"),"<"+e+" class='"+Alpaca.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD+"'>"},helpers.formItems=function(e){return"
    "},helpers.insert=function(e){return"
    "},helpers.str=function(e){return e===!1?"false":e===!0?"true":0===e?"0":void 0===e?"":null===e?"":Alpaca.isString(e)?e:Alpaca.isNumber(e)?e:Alpaca.isObject(e)?JSON.stringify(e,null," "):Alpaca.isArray(e)?JSON.stringify(e,null," "):e},helpers.arrayToolbar=function(e){return"
    "},helpers.arrayActionbar=function(e){var t="
    0)for(var i=0;i0)for(var i=0;i
    ");i._processRender(r,function(){a.formFieldsContainer.before(i.field),a.formFieldsContainer.remove(),a.topControl=i,i.view.type&&"view"!==i.view.type&&a.initEvents(),i.form=a;i.postRender(function(){i.initializing=!1,i.form.afterInitialize(),e(i.field).bind("destroyed",function(e){i.form.destroy()}),n&&t.isFunction(n)&&n(i)})})})}else this._processRender(i.domEl,function(){i.postRender(function(){i.initializing=!1,n&&t.isFunction(n)&&n(i)})})},_processRender:function(e,t){var n=this;n.renderField(e,function(){n.fireCallback("field"),n.renderFieldElements(function(){t()})})},renderFieldDomElement:function(e){var n=this.getTemplateDescriptor();return t.tmpl(n,{id:this.getId(),options:this.options,schema:this.schema,data:e,view:this.view,path:this.path,name:this.name})},renderField:function(t,n){var i=this,a=this.data;this.isDisplayOnly()&&"object"==typeof a&&(a=JSON.stringify(a));var r=i.renderFieldDomElement(a);if(e(r).length>0){for(var o=null,l=0;l-1)for(a=n.split(","),i=0;i-1)for(a=n.split(" "),i=0;i
    ");e(r).before(o),i.domEl=e("
    "),i.field=void 0,i.control=void 0,i.container=void 0,i.form=void 0,e(r).find("button").prop("disabled",!0),this.initializing=!0,i.setup(),i.setupField(function(){i._render(function(){e(o).before(i.field),i.domEl=a;var l=e(r).attr("class");l&&e.each(l.split(" "),function(t,n){n&&0===!n.indexOf("alpaca-")&&e(i.field).addClass(n)}),e(r).hide(),e(o).remove(),i.refreshed=!0,t.fireReady(i),n&&n.call(i),e(r).remove(void 0,{nodestroy:!0})})})},applyStyle:function(e,t){this.view.applyStyle(e,t)},fireCallback:function(e,t,n,i,a,r){this.view.fireCallback(this,e,t,n,i,a,r)},getFieldEl:function(){return this.field},getId:function(){return this.id},getParent:function(){return this.parent},getPath:function(){return this.path},getName:function(){return this.name},isTopLevel:function(){return t.isEmpty(this.parent)},top:function(){for(var e=this;e.parent;)e=e.parent;return e},getValue:function(){return this.ensureProperType(this.data)},setValue:function(e){this.data=e,this.updateObservable(),this.triggerUpdate(),this.isDisplayOnly()&&!this.initializing&&(this.top&&this.top()&&this.top().initializing||this.refresh())},setDefault:function(){},getTemplateDescriptor:function(){return this.templateDescriptor},setTemplateDescriptor:function(e){this.templateDescriptor=e},displayMessage:function(n,i){var a=this;n&&t.isObject(n)&&(n=[n]),n&&t.isString(n)&&(n=[{id:"custom",message:n}]),e(this.getFieldEl()).children(".alpaca-message").remove(),n&&n.length>0&&this.options.maxMessages&&t.isNumber(this.options.maxMessages)&&this.options.maxMessages>-1&&(n=n.slice(0,this.options.maxMessages)),a.fireCallback("removeMessages"),n&&n.length>0&&e.each(n,function(n,i){var r=!1;a.hideInitValidationError&&(r=!0);var o=a.view.getTemplateDescriptor("message");if(o){var l=t.tmpl(o,{id:i.id,message:i.message,view:a.view});l.addClass("alpaca-message"),r&&l.addClass("alpaca-message-hidden"),e(a.getFieldEl()).append(l)}a.fireCallback("addMessage",n,i.id,i.message,r)})},refreshValidationState:function(e,n){var i=this,a=[],r=[],o=function(e,n){return function(i){t.nextTick(function(){t.compileValidationContext(e,function(e){n.push(e),i()})})}};if(e){var l=function(e,t){if(e.isValidationParticipant()){if(e.children&&e.children.length>0)for(var n=0;n=0){var c=o.indexOf("]",u+1);c>=0&&(s=parseInt(o.substring(u+1,c)),l=o.substring(0,u))}l&&(i=i.childrenByPropertyId[l],s>-1&&(i=i.children[s]))}n=i}return n},getControlsByFieldType:function(e){var t=[];if(e){var n=function(e,t,i){for(var a=0;adisplayReadonly attribute set to false, the read-only field will not appear.",type:"boolean",default:!1},required:{title:"Required",description:"Indicates whether the field's value is required. If set to true, the field must take on a valid value and cannnot be left empty or unassigned.",type:"boolean",default:!1},default:{title:"Default",description:"The default value to be assigned for this property. If the data for the field is empty or not provided, this default value will be plugged in for you. Specify a default value when you want to pre-populate the field's value ahead of time.",type:"any"},type:{title:"Type",description:"Data type of the property.",type:"string",readonly:!0},format:{title:"Format",description:"Data format of the property.",type:"string"},disallow:{title:"Disallowed Values",description:"List of disallowed values for the property.",type:"array"},dependencies:{title:"Dependencies",description:"List of property dependencies.",type:"array"}}};return this.getType&&!t.isValEmpty(this.getType())&&(e.properties.type.default=this.getType(),e.properties.type.enum=[this.getType()]),e},getOptionsForSchema:function(){return{fields:{title:{helper:"Field short description",type:"text"},description:{helper:"Field detailed description",type:"textarea"},readonly:{helper:"Field will be read only if checked",rightLabel:"This field is read-only",type:"checkbox"},required:{helper:"Field value must be set if checked",rightLabel:"This field is required",type:"checkbox"},default:{helper:"Field default value",type:"textarea"},type:{helper:"Field data type",type:"text"},format:{type:"select",dataSource:function(e){for(var n in t.defaultFormatFieldMapping)this.selectOptions.push({value:n,text:n});e()}},disallow:{helper:"Disallowed values for the field",itemLabel:"Value",type:"array"},dependencies:{helper:"Field Dependencies",multiple:!0,size:3,type:"select",dataSource:function(e,t){if(e.parent&&e.parent.schemaParent&&e.parent.schemaParent.parent)for(var n in e.parent.schemaParent.parent.childrenByPropertyId)n!=e.parent.schemaParent.propertyId&&e.selectOptions.push({value:n,text:n});t&&t()}}}}},getSchemaOfOptions:function(){var e={title:"Options for "+this.getTitle(),description:this.getDescription()+" (Options)",type:"object",properties:{form:{},id:{title:"Field Id",description:"Unique field id. Auto-generated if not provided.",type:"string"},type:{title:"Field Type",description:"Field type.",type:"string",default:this.getFieldType(),readonly:!0},validate:{title:"Validation",description:"Field validation is required if true.",type:"boolean",default:!0},showMessages:{title:"Show Messages",description:"Display validation messages if true.",type:"boolean",default:!0},disabled:{title:"Disabled",description:"Field will be disabled if true.",type:"boolean",default:!1},readonly:{title:"Readonly",description:"Field will be readonly if true.",type:"boolean",default:!1},hidden:{title:"Hidden",description:"Field will be hidden if true.",type:"boolean",default:!1},label:{title:"Label",description:"Field label.",type:"string"},helper:{title:"Helper",description:"Field help message.",type:"string"},helpers:{title:"Helpers",description:"An array of field help messages. Each message will be displayed on it's own line.",type:"array",items:{type:"string"}},helpersPosition:{title:"Helpers Position",description:"Defines the placement location of the helper text relative to the control (either 'above' or 'below')",type:"string",enum:["above","below"],default:"below"},fieldClass:{title:"CSS class",description:"Specifies one or more CSS classes that should be applied to the dom element for this field once it is rendered. Supports a single value, comma-delimited values, space-delimited values or values passed in as an array.",type:"string"},hideInitValidationError:{title:"Hide Initial Validation Errors",description:"Hide initial validation errors if true.",type:"boolean",default:!1},focus:{title:"Focus",description:"If true, the initial focus for the form will be set to the first child element (usually the first field in the form). If a field name or path is provided, then the specified child field will receive focus. For example, you might set focus to 'name' (selecting the 'name' field) or you might set it to 'client/name' which picks the 'name' field on the 'client' object.",type:"checkbox",default:!0},optionLabels:{title:"Enumerated Value Labels",description:"An array of string labels for items in the enum array",type:"array"},view:{title:"Override of the view for this field",description:"Allows for this field to be rendered with a different view (such as 'display' or 'create')",type:"string"}}};return this.isTopLevel()?e.properties.form={title:"Form",description:"Options for rendering the FORM tag.",type:"object",properties:{attributes:{title:"Form Attributes",description:"List of attributes for the FORM tag.",type:"object",properties:{id:{title:"Id",description:"Unique form id. Auto-generated if not provided.",type:"string"},action:{title:"Action",description:"Form submission endpoint",type:"string"},method:{title:"Method",description:"Form submission method",enum:["post","get"],type:"string"},rubyrails:{title:"Ruby On Rails",description:"Ruby on Rails Name Standard",enum:["true","false"],type:"string"},name:{title:"Name",description:"Form name",type:"string"},focus:{title:"Focus",description:"Focus Setting",type:"any"}}},buttons:{title:"Form Buttons",description:"Configuration for form-bound buttons",type:"object",properties:{submit:{type:"object",title:"Submit Button",required:!1},reset:{type:"object",title:"Reset button",required:!1}}},toggleSubmitValidState:{title:"Toggle Submit Valid State",description:"Toggle the validity state of the Submit button",type:"boolean",default:!0}}}:delete e.properties.form,e},getOptionsForOptions:function(){var e={type:"object",fields:{id:{type:"text",readonly:!0},type:{type:"text"},validate:{rightLabel:"Enforce validation",type:"checkbox"},showMessages:{rightLabel:"Show validation messages",type:"checkbox"},disabled:{rightLabel:"Disable this field",type:"checkbox"},hidden:{type:"checkbox",rightLabel:"Hide this field"},label:{type:"text"},helper:{type:"textarea"},helpers:{type:"array",items:{type:"textarea"}},helpersPosition:{type:"text",optionLabels:["Above","Below"]},fieldClass:{type:"text"},hideInitValidationError:{rightLabel:"Hide initial validation errors",type:"checkbox"},focus:{type:"checkbox",rightLabel:"Auto-focus first child field"},optionLabels:{type:"array",items:{type:"text"}},view:{type:"text"}}};return this.isTopLevel()&&(e.fields.form={type:"object",fields:{attributes:{type:"object",fields:{id:{type:"text",readonly:!0},action:{type:"text"},method:{type:"select"},name:{type:"text"}}}}}),e}}),t.registerMessages({disallowValue:"{0} are disallowed values.",notOptional:"This field is not optional."})}(jQuery),function(e){var t=e.alpaca;t.ControlField=t.Field.extend({onConstruct:function(){var t=this;this.isControlField=!0,this._getControlVal=function(n){var i=null;return this.control&&(i=e(this.control).val(),n&&(i=t.ensureProperType(i))),i}},setup:function(){var e=this;this.base();var n=e.resolveControlTemplateType();if(!n)return t.throwErrorWithCallback("Unable to find template descriptor for control: "+e.getFieldType());if(this.controlDescriptor=this.view.getTemplateDescriptor("control-"+n,e),void 0===this.options.renderButtons&&(this.options.renderButtons=!0),this.options.buttons)for(var i in this.options.buttons)this.options.buttons[i].label&&(this.options.buttons[i].value=this.options.buttons[i].label),this.options.buttons[i].title&&(this.options.buttons[i].value=this.options.buttons[i].title),this.options.buttons[i].type||(this.options.buttons[i].type="button"),this.options.buttons[i].styles||(this.options.buttons[i].styles=this.view.styles.button)},getControlEl:function(){return this.control},resolveControlTemplateType:function(){var e=this,t=!1,n=null,i=this;do{if(i.getFieldType){var a=this.view.getTemplateDescriptor("control-"+i.getFieldType(),e);a?(n=i.getFieldType(),t=!0):i=i.constructor.ancestor.prototype}else t=!0}while(!t);return n},onSetup:function(){},isAutoFocusable:function(){return!0},getTemplateDescriptorId:function(){return"control"},renderFieldElements:function(n){var i=this;this.control=e(this.field).find("."+t.MARKER_CLASS_CONTROL_FIELD),this.control.removeClass(t.MARKER_CLASS_CONTROL_FIELD),i.prepareControlModel(function(e){i.beforeRenderControl(e,function(){i.renderControl(e,function(a){a&&(i.control.replaceWith(a),i.control=a,i.control.addClass(t.CLASS_CONTROL)),i.fireCallback("control"),i.afterRenderControl(e,function(){n()})})})})},prepareControlModel:function(e){var t={};t.id=this.getId(),t.name=this.name,t.options=this.options,t.schema=this.schema,t.data=this.data,t.required=this.isRequired(),t.view=this.view,e(t)},beforeRenderControl:function(e,t){t()},afterRenderControl:function(n,i){var a=this;a.firstUpdateObservableFire||t.isEmpty(a.data)||(a.firstUpdateObservableFire=!0,a.updateObservable()),e(this.getFieldEl()).find(".alpaca-control-button").each(function(){e(this).click(function(t){e(this).attr("button-pushed",!0)});var t=e(this).attr("data-key");if(t){var n=a.options.buttons[t];n&&n.click&&e(this).click(function(e,t){return function(n){n.preventDefault(),t.call(e,n)}}(a,n.click))}}),i()},renderControl:function(e,n){var i=null;this.controlDescriptor&&(i=t.tmpl(this.controlDescriptor,e)),n(i)},postRender:function(e){this.base(function(){e()})},updateDOMElement:function(){this.base(),this.control.attr("name",this.getName())},setDefault:function(){var e=t.isEmpty(this.schema.default)?"":this.schema.default;this.setValue(e)},getValue:function(){var e=this,t=this.base();return this.isDisplayOnly()||(t=e.getControlValue()),t=e.ensureProperType(t)},getControlValue:function(){return this._getControlVal(!0)},_validateEnum:function(){if(!this.getEnum())return!0;var e=this.getValue();return!(this.isRequired()||!t.isValEmpty(e))||t.inArray(this.getEnum(),e)},handleValidate:function(){var e=this.base(),n=this.validation,i=this._validateEnum(),a=this.getEnum(),r=this.getOptionLabels();return r&&r.length>0&&(a=r),n.invalidValueOfEnum={message:i?"":t.substituteTokens(this.getMessage("invalidValueOfEnum"),[a.join(", "),this.getValue()]),status:i},e&&n.invalidValueOfEnum.status},initEvents:function(){this.base(),this.control&&this.control.length>0&&this.initControlEvents()},initControlEvents:function(){var e=this,t=this.control;t.click(function(t){e.onClick.call(e,t),e.trigger("click",t)}),t.change(function(t){setTimeout(function(){e.onChange.call(e,t),e.triggerWithPropagation("change",t)},200)}),t.focus(function(t){if(e.wasFocused=!0,!e.suspendBlurFocus){var n=e.onFocus.call(e,t);return n!==!1&&(n=e.trigger("focus",t)),n}}),t.blur(function(t){if(e.wasBlurred=!0,!e.suspendBlurFocus){var n=e.onBlur.call(e,t);return n!==!1&&(n=e.trigger("blur",t)),n}}),t.keypress(function(t){var n=e.onKeyPress.call(e,t);return n!==!1&&(n=e.trigger("keypress",t)),n}),t.keyup(function(t){var n=e.onKeyUp.call(e,t);return n!==!1&&(n=e.trigger("keyup",t)),e.triggerWithPropagation("after_nested_change",t),n}),t.keydown(function(t){var n=e.onKeyDown.call(e,t);return n!==!1&&(n=e.trigger("keydown",t),e.triggerWithPropagation("before_nested_change",t)),n})},onKeyPress:function(e){var t=this,n=!1;if(t.view.type&&"edit"===t.view.type){var i=this.isValid();i||(n=!0)}else if(t.view.type&&"create"===t.view.type){var i=this.isValid();!i&&t.wasBlurred&&(n=!0)}n&&window.setTimeout(function(){t.refreshValidationState()},50)},onKeyDown:function(e){},onKeyUp:function(e){},onClick:function(e){},disable:function(){this.options.readonly||(this.base(),this.control&&this.control.length>0&&(e(this.control).addClass("disabled"),e(this.control).prop("disabled",!0)))},enable:function(){this.options.readonly||(this.base(),this.control&&this.control.length>0&&(e(this.control).removeClass("disabled"),e(this.control).prop("disabled",!1)))},isDisabled:function(){return e(this.control).prop("disabled")},getEnum:function(){var e=null;return this.schema.enum?e=this.schema.enum:"array"===this.schema.type&&this.schema.items&&this.schema.items.enum&&(e=this.schema.items.enum),e},setEnum:function(e){t.safeSetObjectArray(this.schema,"enum",e)},getOptionLabels:function(){var e=null;return this.options&&this.options.optionLabels&&(e=this.options.optionLabels),e},setOptionLabels:function(e){t.safeSetObjectArray(this.options,"optionLabels",e)},sortEnum:function(){var e=this.getEnum();if(e&&e.length>0){for(var n=this.getOptionLabels(),i=[],a=0;a=a+1&&(o=n[a]),i.push({value:r,text:o})}this.sortSelectableOptions(i);for(var l=[],s=[],a=0;a0){r={};for(var o=0;o0?(e(a.container).addClass("alpaca-container-has-items"),e(a.container).attr("data-alpaca-container-item-count",n.items.length)):(e(a.container).removeClass("alpaca-container-has-items"),e(a.container).removeAttr("data-alpaca-container-item-count"));for(var o=0;o0&&(s.domEl=e("
    "),e(s.domEl).addClass("alpaca-layout-binding-holder"),e(s.domEl).attr("alpaca-layout-binding-field-name",s.name),d.append(s.domEl),s.domEl.append(s.containerItemEl))}e(u).remove()}else{var d=e(u).parent();e(u).replaceWith(s.containerItemEl),s.domEl=d}e(s.containerItemEl).addClass("alpaca-container-item"),0===o&&e(s.containerItemEl).addClass("alpaca-container-item-first"),o+1===n.items.length&&e(s.containerItemEl).addClass("alpaca-container-item-last"),e(s.containerItemEl).attr("data-alpaca-container-item-index",o),e(s.containerItemEl).attr("data-alpaca-container-item-name",s.name),e(s.containerItemEl).attr("data-alpaca-container-item-parent-field-id",a.getId()),a.registerChild(s,o)}a.options.collapsible&&a.fireCallback("collapsible"),a.triggerUpdate(),i()},afterApplyCreatedItems:function(e,t){t()},registerChild:function(e,n){t.isEmpty(n)?this.children.push(e):this.children.splice(n,0,e),this.childrenById[e.getId()]=e,e.propertyId&&(this.childrenByPropertyId[e.propertyId]=e),e.parent=this},unregisterChild:function(e){var n=this.children[e];n&&(t.isEmpty(e)||this.children.splice(e,1),delete this.childrenById[n.getId()],n.propertyId&&delete this.childrenByPropertyId[n.propertyId],n.parent=null)},updateDOMElement:function(){var t=this;this.base(),t.children.length>0?(e(t.getContainerEl()).addClass("alpaca-container-has-items"),e(t.getContainerEl()).attr("data-alpaca-container-item-count",t.children.length)):(e(t.getContainerEl()).removeClass("alpaca-container-has-items"),e(t.getContainerEl()).removeAttr("data-alpaca-container-item-count"));for(var n=0;n0&&(i=0),i>-1&&(a[i].focus(),t&&t(a[i]))},disable:function(){if(!this.options.readonly){this.base();for(var e=0;e0&&(e=this.children[0]),e},lastChild:function(){var e=null;return this.children.length>0&&(e=this.children[this.children.length-1]),e},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{lazyLoading:{title:"Lazy Loading",description:"Child fields will only be rendered when the fieldset is expanded if this option is set true.",type:"boolean",default:!1},collapsible:{title:"Collapsible",description:"Field set is collapsible if true.",type:"boolean",default:!1},collapsed:{title:"Collapsed",description:"Field set is initially collapsed if true.",type:"boolean",default:!1},legendStyle:{title:"Legend Style",description:"Field set legend style.",type:"string",enum:["button","link"],default:"button"},animate:{title:"Animate movements and transitions",description:"Up and down transitions will be animated",type:"boolean",default:!0}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{lazyLoading:{rightLabel:"Lazy loading child fields ?",helper:"Lazy loading will be enabled if checked.",type:"checkbox"},collapsible:{rightLabel:"Field set collapsible ?",helper:"Field set is collapsible if checked.",type:"checkbox"},collapsed:{rightLabel:"Field set initially collapsed ?",description:"Field set is initially collapsed if checked.",type:"checkbox"},legendStyle:{type:"select"},animate:{rightLabel:"Animate movements and transitions",type:"checkbox"}}})}})}(jQuery),function(e){var t=e.alpaca;t.Form=Base.extend({constructor:function(e,n,i,a,r){if(this.domEl=e,this.parent=null,this.connector=a,this.errorCallback=r,this.options=n,this.options.attributes?this.attributes=this.options.attributes:this.attributes={},this.options.buttons){this.options.buttons.submit&&(this.options.buttons.submit.type||(this.options.buttons.submit.type="submit"),this.options.buttons.submit.name||(this.options.buttons.submit.name="submit"),this.options.buttons.submit.value||(this.options.buttons.submit.value="Submit")),this.options.buttons.reset&&(this.options.buttons.reset.type||(this.options.buttons.reset.type="reset"),this.options.buttons.reset.name||(this.options.buttons.reset.name="reset"),this.options.buttons.reset.value||(this.options.buttons.reset.value="Reset"));for(var o in this.options.buttons)this.options.buttons[o].label&&(this.options.buttons[o].value=this.options.buttons[o].label),this.options.buttons[o].title&&(this.options.buttons[o].value=this.options.buttons[o].title),this.options.buttons[o].type||(this.options.buttons[o].type="button")}this.attributes.id?this.id=this.attributes.id:(this.id=t.generateId(),this.attributes.id=this.id),this.options.buttons&&this.options.buttons.submit&&t.isUndefined(this.options.toggleSubmitValidState)&&(this.options.toggleSubmitValidState=!0),this.viewType=n.viewType,this.view=new t.RuntimeView(i,this);for(var o in this.options.buttons)this.options.buttons[o].styles||(this.options.buttons[o].styles=this.view.styles.button)},render:function(e){var t=this;this.processRender(this.domEl,function(){t.form.appendTo(t.domEl),t.form.addClass("alpaca-form"),t.fireCallback("form"),e(t)})},afterInitialize:function(){var e=this;e.options.toggleSubmitValidState&&e.adjustSubmitButtonState()},isFormValid:function(){return this.topControl.validate(!0),this.topControl.isValid(!0)},isValid:function(){return this.isFormValid()},validate:function(e){return this.topControl.validate(e)},enableSubmitButton:function(){if(e(".alpaca-form-button-submit").attrProp("disabled",!1),e.mobile)try{e(".alpaca-form-button-submit").button("refresh")}catch(e){}},disableSubmitButton:function(){if(e(".alpaca-form-button-submit").attrProp("disabled",!0),e.mobile)try{e(".alpaca-form-button-submit").button("refresh")}catch(e){}},adjustSubmitButtonState:function(){this.disableSubmitButton(),this.isFormValid()&&this.enableSubmitButton()},processRender:function(n,i){var a=this;if(this.formDescriptor=this.view.getTemplateDescriptor("form"),!this.formDescriptor)return t.throwErrorWithCallback("Could not find template descriptor: form");var r=t.tmpl(this.formDescriptor,{id:this.getId(),options:this.options,view:this.view});r.appendTo(n),this.form=r,this.formFieldsContainer=e(this.form).find("."+t.MARKER_CLASS_FORM_ITEMS_FIELD),this.formFieldsContainer.removeClass(t.MARKER_CLASS_FORM_ITEMS_FIELD),t.isEmpty(this.form.attr("id"))&&this.form.attr("id",this.getId()+"-form-outer"),t.isEmpty(this.form.attr("data-alpaca-form-id"))&&this.form.attr("data-alpaca-form-id",this.getId()),e(n).find("form").attr(this.attributes),this.buttons={},e(n).find(".alpaca-form-button").each(function(){e(this).click(function(t){e(this).attr("button-pushed",!0)});var t=e(this).attr("data-key");if(t){var n=a.options.buttons[t];n&&n.click&&e(this).click(function(e,t){return function(n){n.preventDefault(),t.call(e,n)}}(a,n.click))}}),i()},getId:function(){return this.id},getType:function(){return this.type},getParent:function(){return this.parent},getValue:function(){return this.topControl.getValue()},setValue:function(e){this.topControl.setValue(e)},initEvents:function(){var t=this,n=e(this.domEl).find("form"),i=this.getValue();e(n).submit(i,function(e){return t.onSubmit(e,t)}),this.options.toggleSubmitValidState&&(e(t.topControl.getFieldEl()).bind("fieldupdate",function(){t.adjustSubmitButtonState()}),e(t.topControl.getFieldEl()).bind("fieldkeyup",function(){t.adjustSubmitButtonState()}),e(t.topControl.getFieldEl()).bind("fieldblur",function(){t.adjustSubmitButtonState()}))},getButtonEl:function(t){return e(this.domEl).find(".alpaca-form-button-"+t)},onSubmit:function(e,n){if(!this.isFormValid())return e.stopPropagation(),this.refreshValidationState(!0),!1;if(this.submitHandler){e.stopPropagation();var i=this.submitHandler(e,n);return t.isUndefined(i)&&(i=!1),i}},registerSubmitHandler:function(e){t.isFunction(e)&&(this.submitHandler=e)},refreshValidationState:function(e,t){this.topControl.refreshValidationState(e,t)},disable:function(){this.topControl.disable()},enable:function(){this.topControl.enable()},focus:function(e){this.topControl.focus(function(t){e&&e(t)})},destroy:function(e){this.getFormEl().remove(),!e&&this.parent&&this.parent.destroy()},show:function(){this.getFormEl().css({display:""})},hide:function(){this.getFormEl().css({display:"none"})},clear:function(e){this.topControl.clear(e)},isEmpty:function(){return this.topControl.isEmpty()},fireCallback:function(e,t,n,i,a,r){this.view.fireCallback(this,e,t,n,i,a,r)},getFormEl:function(){return this.form},submit:function(){this.form.submit()},ajaxSubmit:function(n){var i=this;n||(n={}),n.url=i.options.attributes.action,n.type=i.options.attributes.method,n.data||(n.data=this.getValue()),n.dataType||(n.dataType="json"),n.headers||(n.headers={});var a=i.determineCsrfToken();return a&&(n.headers[t.CSRF_HEADER_NAME]=a),e.ajax(n)},determineCsrfToken:function(){var e=t.CSRF_TOKEN;if(!e)for(var n=0;n-1&&(n.dataType="html")),n},loadUri:function(n,i,a,r){var o=this,l=o.buildAjaxConfig(n,i);l.success=function(e){o.cache(n,e),a&&t.isFunction(a)&&a(e)},l.error=function(e,i,a){r&&t.isFunction(r)&&r({message:"Unable to load data from uri : "+n,stage:"DATA_LOADING_ERROR",details:{jqXHR:e,textStatus:i,errorThrown:a}})};var s=o.cache(n);s&&a&&t.isFunction(a)?a(s):e.ajax(l)},loadReferenceSchema:function(e,t,n){return this._handleLoadJsonResource(e,t,n)},loadReferenceOptions:function(e,t,n){return this._handleLoadJsonResource(e,t,n)},_handleLoadJsonResource:function(e,t,n){this.isUri(e)?this.loadJson(e,function(e){t(e)},n):t(e)},loadDataSource:function(e,t,n){return this._handleLoadDataSource(e,t,n)},_handleLoadDataSource:function(e,n,i){var a=e;return t.isObject(a)&&(a=e.url),this._handleLoadJsonResource(a,n,i)}}),t.registerConnectorClass("default",t.Connector)}(jQuery),function(e){var t=e.alpaca;t.CloudCmsConnector=t.Connector.extend({constructor:function(e,t){t||(t={}),t.cache||(t.cache={type:"memory",config:{ttl:3e5}}),this.base(e,t)},connect:function(e,n){var i=this,a=function(t,a){if(t)return void n(t);a&&(i.branch=Chain(a),i.bindHelperFunctions(i.branch)),e()};t.globalContext&&t.globalContext.branch?a(null,t.globalContext.branch):(i.branch=null,i.doConnect(function(e,t){a(e,t)}))},doConnect:function(e){this.config.key||(this.config.key="default"),Gitana.connect(this.config,function(t){if(t)return void e(t);this.getDriver().getOriginalConfiguration().loadAppHelper?this.datastore("content").readBranch("master").then(function(){e(null,this)}):e()})},bindHelperFunctions:function(e){var n=this;e.loadAlpacaSchema||(e.loadAlpacaSchema=function(t,i,a){var r=n.cache(t);if(r)return a.call(this,null,r);var o=function(){return e.getUri()+"/alpaca/schema"},l={};return l.id=t,this.chainGetResponse(this,o,l).then(function(e){n.cache(t,e),a.call(this,null,e)})}),e.loadAlpacaOptions||(e.loadAlpacaOptions=function(t,i,a){var r=n.cache(t);if(r)return a.call(this,null,r);var o=function(){return e.getUri()+"/alpaca/options"},l={};return l.schemaId=i.schemaSource,l.id=t,this.chainGetResponse(this,o,l).then(function(e){n.cache(t,e),a.call(this,null,e)})}),e.loadAlpacaData||(e.loadAlpacaData=function(t,n,i){var a=function(){return e.getUri()+"/alpaca/data"},r={};return r.id=t,this.chainGetResponse(this,a,r).then(function(e){i.call(this,null,e)})}),e.loadAlpacaDataSource||(e.loadAlpacaDataSource=function(n,i,a){var r={};i&&t.copyInto(r,i);var o=function(){return e.getUri()+"/alpaca/datasource"};return this.chainPostResponse(this,o,r,n).then(function(e){a.call(this,null,e.datasource)})})},loadData:function(e,t,n,i){var a=this;if(!a.branch)return this.base(e,t,n,i);a.branch.loadAlpacaData(e,t,function(e,t){if(e)return void i(e);var a=null;t&&(a=JSON.parse(JSON.stringify(t))),n(a)})},loadSchema:function(e,t,n,i){var a=this;if(!a.branch)return this.base(e,t,n,i);a.branch.loadAlpacaSchema(e,t,function(e,t){if(e)return i(e);n(t)})},loadOptions:function(e,n,i,a){var r=this;if(!r.branch)return this.base(e,n,i,a);r.branch.loadAlpacaOptions(e,n,function(e,n){if(e)return a(e);n||(n={}),n.form.buttons={submit:{title:"Submit",click:function(e){var t=this,n=this.getValue();n||(n={});var i=this.ajaxSubmit({xhrFields:{withCredentials:!0},crossDomain:!0,processData:!1,data:JSON.stringify(n),contentType:"application/json; charset=utf-8"});i.done(function(){t.topControl.trigger("formSubmitSuccess")}),i.fail(function(){t.topControl.trigger("formSubmitFail")})}}},void 0===n.focus&&(n.focus=t.defaultFocus),n.form.attributes.action=r.config.baseURL+n.form.attributes.action,i(n)})},loadReferenceSchema:function(e,t,n){var i=this;if(0===e.indexOf("qname://")){var a=e.substring(8).split("/");e=a[0]+":"+a[1]}if(0===e.toLowerCase().indexOf("http://")||0===e.toLowerCase().indexOf("https://"))return this._handleLoadJsonResource(e,t,n);return i.loadSchema(e,null,t,n)},loadReferenceOptions:function(e,t,n){var i=this;if(0===e.toLowerCase().indexOf("http://")||0===e.toLowerCase().indexOf("https://"))return this._handleLoadJsonResource(e,t,n);var a=null;if(0===e.indexOf("qname://")){var r=e.substring(8).split("/");if(r.length>2)return a={},a.schemaSource=r[0]+":"+r[1],e=r[2],i.loadOptions(e,a,t,n)}t(null)},loadDataSource:function(e,t,n){var i=this;if(!i.branch)return this.base(e,t,n);var a=e.pagination;return delete e.pagination,i.branch.loadAlpacaDataSource(e,a,function(e,i){if(e)return void n(e);t(i)})}}),t.registerConnectorClass("cloudcms",t.CloudCmsConnector)}(jQuery),function(e){var t=e.alpaca;t.Fields.TextField=t.ControlField.extend({getFieldType:function(){return"text"},setup:function(){this.base(),this.inputType||(this.inputType="text"),this.options.inputType&&(this.inputType=this.options.inputType),this.options.data||(this.options.data={}),this.options.attributes||(this.options.attributes={}),void 0===this.options.allowOptionalEmpty&&(this.options.allowOptionalEmpty=!0),this.options.autocomplete&&"string"==typeof this.options.autocomplete&&("on"===this.options.autocomplete.toLowerCase()?this.options.autocomplete=!0:"true"===this.options.autocomplete.toLowerCase()?this.options.autocomplete=!0:"yes"===this.options.autocomplete.toLowerCase()?this.options.autocomplete=!0:this.options.autocomplete=!1),void 0===this.options.autocomplete&&(this.options.autocomplete=!1),void 0===this.options.disallowEmptySpaces&&(this.options.disallowEmptySpaces=!1),void 0===this.options.disallowOnlyEmptySpaces&&(this.options.disallowOnlyEmptySpaces=!1)},destroy:function(){this.base(),this.control&&this.control.typeahead&&this.options.typeahead&&e(this.control).typeahead("destroy")},postRender:function(e){var t=this;this.base(function(){t.control&&(t.applyAutocomplete(),t.applyMask(),t.applyTypeAhead(),t.updateMaxLengthIndicator()),e()})},applyAutocomplete:function(){var t=this;void 0!==t.options.autocomplete&&(e(t.field).addClass("alpaca-autocomplete"),e(t.control).attr("autocomplete",t.options.autocomplete?"on":"off"),t.fireCallback("autocomplete"))},applyMask:function(){var e=this;e.control.mask&&e.options.maskString&&e.control.mask(e.options.maskString)},applyTypeAhead:function(){var n=this;if(n.control.typeahead&&n.options.typeahead&&!t.isEmpty(n.options.typeahead)){var i=n.options.typeahead.config;i||(i={});var a=n.options.typeahead.datasets;a||(a={}),a.name||(a.name=n.getId());var r=n.options.typeahead.events;if(r||(r={}),!a.init&&("local"===a.type||"remote"===a.type||"prefetch"===a.type)){var o={datumTokenizer:function(e){var t="";for(var n in e)(e.hasOwnProperty(n)||e[n])&&(t+=" "+e[n]);return Bloodhound.tokenizers.whitespace(t)},queryTokenizer:Bloodhound.tokenizers.whitespace};if("local"===a.type){var l=[];if("function"==typeof a.source)o.local=a.source;else{for(var s=0;s=0?a="You have "+o+" characters remaining":(a="Your message is too long by "+o*-1+" characters",i=!0);var l=e(n.field).find(".alpaca-field-text-max-length-indicator");0===l.length&&(l=e("

    "),e(n.control).after(l)),e(l).html(a),e(l).removeClass("err"),i&&e(l).addClass("err")}},getControlValue:function(){var t=this,n=this._getControlVal(!0);if(t.control.mask&&t.options.maskString){var i=e(this.control).data(e.mask.dataName);i&&(n=i(),n=t.ensureProperType(n))}return n},setValue:function(e){this.control&&this.control.length>0&&(t.isEmpty(e)?this.control.val(""):this.control.val(e)),this.base(e),this.updateMaxLengthIndicator()},handleValidate:function(){var e=this.base(),n=this.validation,i=this._validatePattern();return n.invalidPattern={message:i?"":t.substituteTokens(this.getMessage("invalidPattern"),[this.schema.pattern]),status:i},i=this._validateMaxLength(),n.stringTooLong={message:i?"":t.substituteTokens(this.getMessage("stringTooLong"),[this.schema.maxLength]),status:i},i=this._validateMinLength(),n.stringTooShort={message:i?"":t.substituteTokens(this.getMessage("stringTooShort"),[this.schema.minLength]),status:i},e&&n.invalidPattern.status&&n.stringTooLong.status&&n.stringTooShort.status},_validatePattern:function(){if(this.schema.pattern){var e=this.getValue();if(""===e&&this.options.allowOptionalEmpty&&!this.isRequired())return!0;if(t.isEmpty(e)&&(e=""),"string"==typeof e&&!e.match(this.schema.pattern))return!1}return!0},_validateMinLength:function(){if(!t.isEmpty(this.schema.minLength)){var e=this.getValue();if(e!==e&&(e=""),""===e&&this.options.allowOptionalEmpty&&!this.isRequired())return!0;if(t.isEmpty(e)&&(e=""),(""+e).lengththis.schema.maxLength)return!1}return!0},focus:function(t){if(this.control&&this.control.length>0){var n=e(this.control).get(0);try{var i=n.value?n.value.length:0;n.selectionStart=i,n.selectionEnd=i}catch(e){}n.focus(),t&&t(this)}},getType:function(){return"string"},onKeyPress:function(e){var n=this;if(9!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode){if(8===e.keyCode){if(!t.isEmpty(n.schema.minLength)&&(n.options.constrainLengths||n.options.constrainMinLength)){var i=n.getValue()||"";i.length<=n.schema.minLength&&(e.preventDefault(),e.stopImmediatePropagation())}}else if(!t.isEmpty(n.schema.maxLength)&&(n.options.constrainLengths||n.options.constrainMaxLength)){var i=n.getValue()||"";i.length>=n.schema.maxLength&&(e.preventDefault(),e.stopImmediatePropagation())}32===e.keyCode&&n.options.disallowEmptySpaces&&(e.preventDefault(),e.stopImmediatePropagation())}},onKeyUp:function(t){this.updateMaxLengthIndicator(),e(this.field).trigger("fieldkeyup")},getTitle:function(){return"Single-Line Text"},getDescription:function(){return"Text field for single-line text."},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{minLength:{title:"Minimal Length",description:"Minimal length of the property value.",type:"number"},maxLength:{title:"Maximum Length",description:"Maximum length of the property value.",type:"number"},pattern:{title:"Pattern",description:"Regular expression for the property value.",type:"string"}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{default:{helper:"Field default value",type:"text"},minLength:{type:"integer"},maxLength:{type:"integer"},pattern:{type:"text"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{size:{title:"Field Size",description:"Field size.",type:"number",default:40},maskString:{title:"Mask Expression",description:"Expression for the field mask. Field masking will be enabled if not empty.",type:"string"},placeholder:{title:"Field Placeholder",description:"Field placeholder.",type:"string"},typeahead:{title:"Type Ahead",description:"Provides configuration for the $.typeahead plugin if it is available. For full configuration options, see: https://github.com/twitter/typeahead.js"},allowOptionalEmpty:{title:"Allow Optional Empty",description:"Allows this non-required field to validate when the value is empty"},inputType:{title:"HTML5 Input Type",description:"Allows for the override of the underlying HTML5 input type. If not specified, an assumed value is provided based on the kind of input control (i.e. 'text', 'date', 'email' and so forth)",type:"string"},data:{title:"Data attributes for the underlying DOM input control",description:"Allows you to specify a key/value map of data attributes that will be added as DOM attribuets for the underlying input control. The data attributes will be added as data-{name}='{value}'.",type:"object"},autocomplete:{title:"HTML autocomplete attribute for the underlying DOM input control",description:"Allows you to specify the autocomplete attribute for the underlying input control whether or not field should have autocomplete enabled.",type:"string"},disallowEmptySpaces:{title:"Disallow Empty Spaces",description:"Whether to disallow the entry of empty spaces in the text",type:"boolean",default:!1},disallowOnlyEmptySpaces:{title:"Disallow Only Empty Spaces",description:"Whether to disallow the entry of only empty spaces in the text",type:"boolean",default:!1}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{size:{type:"integer"},maskString:{helper:"a - an alpha character;9 - a numeric character;* - an alphanumeric character",type:"text"},typeahead:{type:"object"},allowOptionalEmpty:{type:"checkbox"},inputType:{type:"text"},data:{type:"object"}}})}}),t.registerMessages({invalidPattern:"This field should have pattern {0}",stringTooShort:"This field should contain at least {0} numbers or characters",stringTooLong:"This field should contain at most {0} numbers or characters"}),t.registerFieldClass("text",t.Fields.TextField),t.registerDefaultSchemaFieldMapping("string","text")}(jQuery),function(e){var t=e.alpaca;t.Fields.TextAreaField=t.Fields.TextField.extend({getFieldType:function(){return"textarea"},setup:function(){this.base(),this.options.rows||(this.options.rows=5),this.options.cols||(this.options.cols=40)},handleValidate:function(){var e=this.base(),n=this.validation,i=this._validateWordCount();return n.wordLimitExceeded={message:i?"":t.substituteTokens(this.getMessage("wordLimitExceeded"),[this.options.wordlimit]),status:i},e&&n.wordLimitExceeded.status},_validateWordCount:function(){if(this.options.wordlimit&&this.options.wordlimit>-1){var e=this.data;if(e){if(e.split(" ").length>this.options.wordlimit)return!1}}return!0},getTitle:function(){return"Multi-Line Text"},getDescription:function(){return"Textarea field for multiple line text."},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{rows:{title:"Rows",description:"Number of rows",type:"number",default:5},cols:{title:"Columns",description:"Number of columns",type:"number",default:40},wordlimit:{title:"Word Limit",description:"Limits the number of words allowed in the text area.",type:"number",default:-1}}})},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{rows:{type:"integer"},cols:{type:"integer"},wordlimit:{type:"integer"}}})}}),t.registerMessages({wordLimitExceeded:"The maximum word limit of {0} has been exceeded."}),t.registerFieldClass("textarea",t.Fields.TextAreaField)}(jQuery),function(e){var t=e.alpaca;t.Fields.FileField=t.Fields.TextField.extend({getFieldType:function(){return"file"},setValue:function(e){this.data=e,this.updateObservable(),this.triggerUpdate()},getControlValue:function(){return this.data}, onChange:function(e){this.base(e),this.options.selectionHandler&&this.processSelectionHandler(e.target.files)},processSelectionHandler:function(e){if(e&&e.length>0&&"undefined"!=typeof FileReader){var t=[],n=0,i=new FileReader;i.onload=function(){var i=this;return function(a){var r=a.target.result;t.push(r),++n===e.length&&i.options.selectionHandler.call(i,e,t)}}.call(this);for(var a=0;a=48&&n<=57),i||(e.preventDefault(),e.stopImmediatePropagation()),i}),e()})},getControlValue:function(){var e=this._getControlVal(!0);return void 0===e||""==e?e:parseFloat(e)},handleValidate:function(){var e=this.base(),n=this.validation,i=this._validateNumber();return n.stringNotANumber={message:i?"":this.getMessage("stringNotANumber"),status:i},i=this._validateDivisibleBy(),n.stringDivisibleBy={message:i?"":t.substituteTokens(this.getMessage("stringDivisibleBy"),[this.schema.divisibleBy]),status:i},i=this._validateMaximum(),n.stringValueTooLarge={message:"",status:i},i||(this.schema.exclusiveMaximum?n.stringValueTooLarge.message=t.substituteTokens(this.getMessage("stringValueTooLargeExclusive"),[this.schema.maximum]):n.stringValueTooLarge.message=t.substituteTokens(this.getMessage("stringValueTooLarge"),[this.schema.maximum])),i=this._validateMinimum(),n.stringValueTooSmall={message:"",status:i},i||(this.schema.exclusiveMinimum?n.stringValueTooSmall.message=t.substituteTokens(this.getMessage("stringValueTooSmallExclusive"),[this.schema.minimum]):n.stringValueTooSmall.message=t.substituteTokens(this.getMessage("stringValueTooSmall"),[this.schema.minimum])),i=this._validateMultipleOf(),n.stringValueNotMultipleOf={message:"",status:i},i||(n.stringValueNotMultipleOf.message=t.substituteTokens(this.getMessage("stringValueNotMultipleOf"),[this.schema.multipleOf])),e&&n.stringNotANumber.status&&n.stringDivisibleBy.status&&n.stringValueTooLarge.status&&n.stringValueTooSmall.status&&n.stringValueNotMultipleOf.status&&n.invalidPattern.status&&n.stringTooLong.status&&n.stringTooShort.status},_validateOptional:function(){return!(!this.isDisplayOnly()&&this.isRequired()&&t.isValEmpty(e(this.control).val()))},_validateNumber:function(){var e=this._getControlVal();if("number"==typeof e&&(e=""+e),t.isValEmpty(e))return!0;if(!t.testRegex(t.regexps.number,e))return!1;var n=this.getValue();return!isNaN(n)},_validateDivisibleBy:function(){var e=this.getValue();return!(!t.isEmpty(this.schema.divisibleBy)&&e%this.schema.divisibleBy!=0)},_validateMaximum:function(){var e=this.getValue();if(!t.isEmpty(this.schema.maximum)){if(e>this.schema.maximum)return!1;if(!t.isEmpty(this.schema.exclusiveMaximum)&&e==this.schema.maximum&&this.schema.exclusiveMaximum)return!1}return!0},_validateMinimum:function(){var e=this.getValue();if(!t.isEmpty(this.schema.minimum)){if(e0)||e%this.schema.multipleOf==0},getType:function(){return"number"},onKeyPress:function(e){var n=this;if(9!==e.keyCode&&37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode){if(8===e.keyCode){if(!t.isEmpty(n.schema.minLength)&&(n.options.constrainLengths||n.options.constrainMinLength)){var i=n.getValue()||"";t.isNumber(i)&&(i=i.toString()),i.length<=n.schema.minLength&&(e.preventDefault(),e.stopImmediatePropagation())}}else if(!t.isEmpty(n.schema.maxLength)&&(n.options.constrainLengths||n.options.constrainMaxLength)){var i=n.getValue()||"";t.isNumber(i)&&(i=i.toString()),i.length>=n.schema.maxLength&&(e.preventDefault(),e.stopImmediatePropagation())}32===e.keyCode&&n.options.disallowEmptySpaces&&(e.preventDefault(),e.stopImmediatePropagation())}},onKeyUp:function(t){this.updateMaxLengthIndicator(),e(this.field).trigger("fieldkeyup")},getSchemaOfSchema:function(){return t.merge(this.base(),{properties:{multipleOf:{title:"Multiple Of",description:"Property value must be a multiple of the multipleOf schema property such that division by this value yields an interger (mod zero).",type:"number"},minimum:{title:"Minimum",description:"Minimum value of the property.",type:"number"},maximum:{title:"Maximum",description:"Maximum value of the property.",type:"number"},exclusiveMinimum:{title:"Exclusive Minimum",description:"Property value can not equal the number defined by the minimum schema property.",type:"boolean",default:!1},exclusiveMaximum:{title:"Exclusive Maximum",description:"Property value can not equal the number defined by the maximum schema property.",type:"boolean",default:!1}}})},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{multipleOf:{title:"Multiple Of",description:"The value must be a integral multiple of the property",type:"number"},minimum:{title:"Minimum",description:"Minimum value of the property",type:"number"},maximum:{title:"Maximum",description:"Maximum value of the property",type:"number"},exclusiveMinimum:{rightLabel:"Exclusive minimum ?",helper:"Field value must be greater than but not equal to this number if checked",type:"checkbox"},exclusiveMaximum:{rightLabel:"Exclusive Maximum ?",helper:"Field value must be less than but not equal to this number if checked",type:"checkbox"}}})},getSchemaOfOptions:function(){return t.merge(this.base(),{properties:{numericEntry:{title:"Numeric Entry",description:"Whether to constrain data entry key presses to numeric values (0-9)",type:"boolean",default:!1}}})},getTitle:function(){return"Number Field"},getDescription:function(){return"Field for float numbers."}}),t.registerMessages({stringValueTooSmall:"The minimum value for this field is {0}",stringValueTooLarge:"The maximum value for this field is {0}",stringValueTooSmallExclusive:"Value of this field must be greater than {0}",stringValueTooLargeExclusive:"Value of this field must be less than {0}",stringDivisibleBy:"The value must be divisible by {0}",stringNotANumber:"This value is not a number.",stringValueNotMultipleOf:"This value is not a multiple of {0}"}),t.registerFieldClass("number",t.Fields.NumberField),t.registerDefaultSchemaFieldMapping("number","number")}(jQuery),function(e){var t=e.alpaca;t.Fields.ArrayField=t.ContainerField.extend({getFieldType:function(){return"array"},setup:function(){var n=this;this.base();var i=n.resolveContainerItemTemplateType();if(!i)return t.throwErrorWithCallback("Unable to find template descriptor for container item: "+n.getFieldType());this.containerItemTemplateDescriptor=n.view.getTemplateDescriptor("container-"+i+"-item",n),this.options.toolbarStyle||(this.options.toolbarStyle=t.isEmpty(this.view.toolbarStyle)?"button":this.view.toolbarStyle),this.options.toolbarStyle||(this.options.toolbarStyle="button"),this.options.actionbarStyle||(this.options.actionbarStyle=t.isEmpty(this.view.actionbarStyle)?"top":this.view.actionbarStyle),this.options.actionbarStyle||(this.options.actionbarStyle="top"),this.options.toolbarPosition||(this.options.toolbarPosition=t.isEmpty(this.view.toolbarPosition)?"top":this.view.toolbarPosition),this.options.toolbarPosition||(this.options.toolbarPosition="top"),this.schema.items||(this.schema.items={}),this.options.items||(this.options.items={}),this.schema.items&&this.schema.items.maxItems&&void 0===this.schema.maxItems&&(this.schema.maxItems=this.schema.items.maxItems,delete this.schema.items.maxItems),this.schema.items&&this.schema.items.minItems&&void 0===this.schema.minItems&&(this.schema.minItems=this.schema.items.minItems,delete this.schema.items.minItems),this.schema.items&&this.schema.items.uniqueItems&&void 0===this.schema.uniqueItems&&(this.schema.uniqueItems=this.schema.items.uniqueItems,delete this.schema.items.uniqueItems),this.options.rubyrails=!1,this.parent&&this.parent.options&&this.parent.options.form&&this.parent.options.form.attributes&&(t.isEmpty(this.parent.options.form.attributes.rubyrails)||(this.options.rubyrails=!0));var a=t.defaultToolbarSticky;if(t.isEmpty(this.view.toolbarSticky)||(a=this.view.toolbarSticky),t.isEmpty(this.options.toolbarSticky)||(a=this.options.toolbarSticky),this.options.toolbarSticky=a,void 0===n.options.hideToolbarWithChildren&&(n.options.hideToolbarWithChildren=!0),this.schema.items&&this.schema.uniqueItems&&t.mergeObject(this.options,{forceRevalidation:!0}),(t.isEmpty(this.data)||""===this.data)&&(this.data=[]),t.isString(this.data))try{var r=t.parseJSON(this.data);if(!t.isArray(r)&&!t.isObject(r))return void t.logWarn("ArrayField parsed string data but it was not an array: "+this.data);this.data=r}catch(e){this.data=[this.data]}if(!t.isArray(this.data)&&!t.isObject(this.data))return t.logWarn("ArrayField data is not an array: "+JSON.stringify(this.data,null," "));var o=function(e,t,i){var a=n.findAction(e,t);a||(a={core:!0},e.push(a));for(var r in i)a[r]||(a[r]=i[r])},l=function(e,t){var n=0;do{void 0===e[n].enabled&&(e[n].enabled=!0),t||delete e[n].label,e[n].enabled?n++:e.splice(n,1)}while(ni?(a.setValue(e[i]),i++):n.removeItem(i)}}while(i0){var a=n.data.length,r={};n.resolveItemSchemaOptions(function(o,l,s){if(s)return t.throwErrorWithCallback("Circular reference detected for schema: "+JSON.stringify(o),n.errorCallback);for(var u=[],c=0;c").alpaca({data:r,options:a,schema:i,view:this.view.id?this.view.id:this.view,connector:this.connector,error:function(e){l.destroy(),l.errorCallback.call(l,e)},notTopLevel:!0,render:function(e,t){e.parent=l,e.path=l.path+"["+n+"]",e.render(null,function(){t&&t()})},postRender:function(n){var i=t.tmpl(l.containerItemTemplateDescriptor,{id:l.getId(),name:n.name,parentFieldId:l.getId(),actionbarStyle:l.options.actionbarStyle,toolbarLocation:l.options.toolbarLocation,view:l.view,data:r}),a=e(i).find("."+t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD);if(0===a.length&&e(i).hasClass(t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD)&&(a=e(i)),0===a.length)return void l.errorCallback.call(l,{message:"Cannot find insertion point for field: "+l.getId()});e(a).before(n.getFieldEl()),e(a).remove(),n.containerItemEl=i,t.fieldApplyFieldAndChildren(n,function(e){e.hideInitValidationError=!1}),t.isFunction(l.options.items.postRender)&&l.options.items.postRender.call(n,a),o&&o(n)}})}},resolveItemSchemaOptions:function(e){var n,i=this,a=function(t,n,a){i.options.readonly&&(n.readonly=!0),e(t,n,a)};!n&&i.options&&i.options.fields&&i.options.fields.item&&(n=i.options.fields.item),!n&&i.options&&i.options.items&&(n=i.options.items);var r;if(i.schema&&i.schema.items&&(r=i.schema.items),r&&r.$ref){var o=r.$ref,l=r.$ref;n.$ref&&(l=n.$ref);for(var s=this,u=[s];s.parent;)s=s.parent,u.push(s);var c=r,d=n;t.loadRefSchemaOptions(s,o,l,function(e,n){for(var i=0,r=0;r10,s={};c&&t.mergeObject(s,c),e&&t.mergeObject(s,e),delete s.id;var p={};d&&t.mergeObject(p,d),n&&t.mergeObject(p,n),t.nextTick(function(){a(s,p,l)})})}else t.nextTick(function(){a(r,n)})},handleValidate:function(){var e=this.base(),n=this.validation,i=this._validateUniqueItems();return n.valueNotUnique={message:i?"":this.getMessage("valueNotUnique"),status:i},i=this._validateMaxItems(),n.tooManyItems={message:i?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.maxItems]),status:i},i=this._validateMinItems(),n.notEnoughItems={message:i?"":t.substituteTokens(this.getMessage("notEnoughItems"),[this.schema.minItems]),status:i},e&&n.valueNotUnique.status&&n.tooManyItems.status&&n.notEnoughItems.status},_validateEqualMaxItems:function(){return!(this.schema.maxItems&&this.schema.maxItems>=0&&this.getSize()>=this.schema.maxItems)},_validateEqualMinItems:function(){return!(this.schema.minItems&&this.schema.minItems>=0&&this.getSize()<=this.schema.minItems)},_validateMinItems:function(){return!(this.schema.minItems&&this.schema.minItems>=0&&this.getSize()=0&&this.getSize()>this.schema.maxItems)},_validateUniqueItems:function(){if(this.schema.items&&this.schema.uniqueItems)for(var e={},t=0;t0&&e.each(this.children,function(t,i){var a=i.path.lastIndexOf("/"),r=i.path.substring(a+1),o=-1;r.indexOf("[")>0&&r.indexOf("]")>0&&(o=parseInt(r.substring(r.indexOf("[")+1,r.indexOf("]")))),o!==t&&(i.prePath=i.path,i.path=i.path.substring(0,a)+"/"+r.substring(0,r.indexOf("["))+"["+t+"]"),i.nameCalculated&&(i.preName=i.name,i.parent&&i.parent.name&&i.path?i.name=i.parent.name+"_"+t:i.path&&(i.name=i.path.replace(/\//g,"").replace(/\[/g,"_").replace(/\]/g,"")),this.parent.options.rubyrails?e(i.field).attr("name",i.parent.name):e(i.field).attr("name",i.name)),i.prePath||(i.prePath=i.path),n(i)})},updateToolbars:function(){var t=this;if("display"!==this.view.type&&!this.schema.readonly){t.toolbar&&(t.fireCallback("arrayToolbar",!0),t.fireCallback("arrayToolbar")),t.actionbar&&(t.fireCallback("arrayActionbars",!0),t.fireCallback("arrayActionbars"));var n=e(this.getFieldEl()).find(".alpaca-array-toolbar[data-alpaca-array-toolbar-field-id='"+t.getId()+"']");if(this.children.length>0&&t.options.hideToolbarWithChildren?e(n).hide():(e(n).show(),e(n).find("[data-alpaca-array-toolbar-action]").each(function(){var n=e(this).attr("data-alpaca-array-toolbar-action"),i=t.findAction(t.toolbar.actions,n);i&&e(this).off().click(function(e){e.preventDefault(),i.click.call(t,n,i)})})),void 0===this.options.toolbarSticky||null===this.options.toolbarSticky){var i=this.getFieldEl().find(".alpaca-container-item[data-alpaca-container-item-parent-field-id='"+t.getId()+"']");e(i).each(function(n){var i=e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='"+t.getId()+"'][data-alpaca-array-actionbar-item-index='"+n+"']");i&&i.length>0&&(e(this).hover(function(){e(i).show()},function(){e(i).hide()}),e(i).hide())})}else this.options.toolbarSticky?e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='"+t.getId()+"']").css("display","inline-block"):this.options.toolbarSticky||e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='"+t.getId()+"']").hide();var a=e(t.getFieldEl()).find(".alpaca-array-actionbar[data-alpaca-array-actionbar-parent-field-id='"+t.getId()+"']");e(a).each(function(){var n=e(this).attr("data-alpaca-array-actionbar-item-index");"string"==typeof n&&(n=parseInt(n,10)),e(this).children("[data-alpaca-array-actionbar-action]").each(function(){var i=e(this).attr("data-alpaca-array-actionbar-action"),a=t.findAction(t.actionbar.actions,i);a&&e(this).off().click(function(e){e.preventDefault(),a.click.call(t,i,a,n)})}),t._validateEqualMaxItems()?(e(this).children("[data-alpaca-array-toolbar-action='add']").each(function(n){e(this).removeClass("alpaca-button-disabled"),t.fireCallback("enableButton",this)}),e(this).children("[data-alpaca-array-actionbar-action='add']").each(function(n){e(this).removeClass("alpaca-button-disabled"),t.fireCallback("enableButton",this)})):(e(this).children("[data-alpaca-array-toolbar-action='add']").each(function(n){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)}),e(this).children("[data-alpaca-array-actionbar-action='add']").each(function(n){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)})),t._validateEqualMinItems()?e(this).children("[data-alpaca-array-actionbar-action='remove']").each(function(n){e(this).removeClass("alpaca-button-disabled"),t.fireCallback("enableButton",this)}):e(this).children("[data-alpaca-array-actionbar-action='remove']").each(function(n){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)})}),e(a).first().children("[data-alpaca-array-actionbar-action='up']").each(function(){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)}),e(a).last().children("[data-alpaca-array-actionbar-action='down']").each(function(){e(this).addClass("alpaca-button-disabled"),t.fireCallback("disableButton",this)})}},doResolveItemContainer:function(){return e(this.container)},handleToolBarAddItemClick:function(e){var n=this;n.resolveItemSchemaOptions(function(i,a,r){if(r)return t.throwErrorWithCallback("Circular reference detected for schema: "+JSON.stringify(i),n.errorCallback);var o=n.children.length,l=t.createEmptyDataInstance(i);n.addItem(o,i,a,l,function(t){e&&e(t)})})},handleActionBarAddItemClick:function(e,n){var i=this;i.resolveItemSchemaOptions(function(a,r,o){if(o)return t.throwErrorWithCallback("Circular reference detected for schema: "+JSON.stringify(a),i.errorCallback);var l=i.getValue(),s=t.createEmptyDataInstance(a);i.addItem(e+1,a,r,s,function(t){l.splice(e+1,0,t.getValue()),i.setValue(l),n&&n(t)})})},handleActionBarRemoveItemClick:function(e,t){this.removeItem(e,function(){t&&t()})},handleActionBarMoveItemUpClick:function(e,t){var n=this;n.swapItem(e,e-1,n.options.animate,function(){t&&t()})},handleActionBarMoveItemDownClick:function(e,t){var n=this;n.swapItem(e,e+1,n.options.animate,function(){t&&t()})},doAddItem:function(n,i,a){var r=this,o=r.doResolveItemContainer();if(0===n)e(o).append(i.containerItemEl);else{var l=o.children("[data-alpaca-container-item-index='"+(n-1)+"']");l&&l.length>0&&l.after(i.containerItemEl)}r.doAfterAddItem(i,function(e){t.fireReady(i),a(e)})},doAfterAddItem:function(e,t){t()},addItem:function(e,t,n,i,a){var r=this;r._validateEqualMaxItems()&&r.createItem(e,t,n,i,function(t){r.registerChild(t,e),r.doAddItem(e,t,function(){r.handleRepositionDOMRefresh(),r.updateToolbars(),r.refreshValidationState(),r.trigger("add",t),r.triggerUpdate(),a&&a(t)})})},doRemoveItem:function(e,t){var n=this;n.doResolveItemContainer().children(".alpaca-container-item[data-alpaca-container-item-index='"+e+"']").remove(),n.doAfterRemoveItem(e,function(e){t(e)})},doAfterRemoveItem:function(e,t){t()},removeItem:function(e,t){var n=this;this._validateEqualMinItems()&&(n.unregisterChild(e),n.doRemoveItem(e,function(){n.handleRepositionDOMRefresh(),n.updateToolbars(),n.refreshValidationState(),n.trigger("remove",e),n.triggerUpdate(),t&&t()}))},moveItem:function(n,i,a,r){var o=this;if("function"==typeof a&&(r=a,a=o.options.animate),void 0===a&&(a=!o.options.animate||o.options.animate),"string"==typeof n&&(n=parseInt(n,10)),"string"==typeof i&&(i=parseInt(i,10)),i<0&&(i=0),i>=o.children.length&&(i=o.children.length-1),i!==-1&&n!==i){if(o.children[i]){var l=function(){var e=i;n0){var u=o.getId(),c=o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='"+n+"'][data-alpaca-container-item-parent-field-id='"+u+"']"),d=o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='"+i+"'][data-alpaca-container-item-parent-field-id='"+u+"']"),p=e("
    ");c.before(p);var h=e("
    ");d.before(h),t.animatedMove(c,d,s,function(){l()})}else l()}}},swapItem:function(n,i,a,r){var o=this;if("function"==typeof a&&(r=a,a=o.options.animate),void 0===a&&(a=!o.options.animate||o.options.animate),"string"==typeof n&&(n=parseInt(n,10)),"string"==typeof i&&(i=parseInt(i,10)),i<0&&(i=0),i>=o.children.length&&(i=o.children.length-1),i!==-1&&n!==i){if(o.children[i]){var l=function(){var e=o.children[n],t=o.children[i];o.children[n]=t,o.children[i]=e,o.data=o.getValue(),o.refresh(function(){o.refreshValidationState(),o.triggerUpdate(),o.trigger("move"),r&&r()})},s=0;if(a&&(s=500),s>0){var u=o.getId(),c=o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='"+n+"'][data-alpaca-container-item-parent-field-id='"+u+"']"),d=o.getContainerEl().find(".alpaca-container-item[data-alpaca-container-item-index='"+i+"'][data-alpaca-container-item-parent-field-id='"+u+"']"),p=e("
    ");c.before(p);var h=e("
    ");d.before(h),t.animatedSwap(c,d,s,function(){l()})}else l()}}},getType:function(){return"array"},getTitle:function(){return"Array Field"},getDescription:function(){return"Field for list of items with same data type or structure."},getSchemaOfSchema:function(){var e={properties:{items:{title:"Array Items",description:"Schema for array items.",type:"object"},minItems:{title:"Minimum Items",description:"Minimum number of items.",type:"number"},maxItems:{title:"Maximum Items",description:"Maximum number of items.",type:"number"},uniqueItems:{title:"Items Unique",description:"Item values should be unique if true.",type:"boolean",default:!1}}};return this.children&&this.children[0]&&t.merge(e.properties.items.properties,this.children[0].getSchemaOfSchema()),t.merge(this.base(),e)},getOptionsForSchema:function(){return t.merge(this.base(),{fields:{items:{type:"object"},minItems:{type:"integer"},maxItems:{type:"integer"},uniqueItems:{type:"checkbox"}}})},getSchemaOfOptions:function(){var e={properties:{toolbarSticky:{title:"Sticky Toolbar",description:"If true, the array item toolbar will always be enabled. If false, the toolbar is always disabled. If undefined or null, the toolbar will appear when hovered over.",type:"boolean",default:void 0},toolbarStyle:{title:"Toolbar Style",description:"The kind of top-level toolbar to render for the array field. Either 'button' or 'link'.",type:"string",default:"button"},toolbarPosition:{title:"Toolbar Position",description:"Location of the top-level toolbar to render for the array field. Either 'top' or 'bottom'.",type:"string",default:"top"},actionbarStyle:{title:"Actionbar Style",description:"The kind of actionbar to render for each item in the array. Either 'top', 'bottom', 'left', or 'right'.",type:"string",default:"top"},toolbar:{type:"object",title:"Toolbar Configuration",properties:{showLabels:{type:"boolean",default:!0,title:"Whether to show labels next to actions"},actions:{type:"array",title:"Toolbar Actions Configuration",items:{action:{type:"string",title:"Action Key"},label:{type:"string",title:"Action Label"},iconClass:{type:"string",title:"Action CSS Classes for Icon"},click:{type:"function",title:"Action Click Handler"},enabled:{type:"boolean",title:"Whether to enable the action",default:!0}}}}},actionbar:{type:"object",properties:{showLabels:{type:"boolean",default:!1,title:"Whether to show labels next to actions"},actions:{type:"array",title:"Actions Bar Actions Configuration",items:{action:{type:"string",title:"Action Key"},label:{type:"string",title:"Action Label"},iconClass:{type:"string",title:"Action CSS Classes for Icon"},click:{type:"function",title:"Action Click Handler"},enabled:{type:"boolean",title:"Whether to enable the action",default:!0}}}}},hideToolbarWithChildren:{type:"boolean",title:"Hide Toolbar with Children",description:"Indicates whether to hide the top toolbar when child elements are available.",default:!0}}};return this.children&&this.children[0]&&t.merge(e.properties.items.properties,this.children[0].getSchemaOfSchema()),t.merge(this.base(),e)},getOptionsForOptions:function(){return t.merge(this.base(),{fields:{toolbarSticky:{type:"checkbox"},items:{type:"object",fields:{}}}})}}),t.registerMessages({notEnoughItems:"The minimum number of items is {0}",tooManyItems:"The maximum number of items is {0}",valueNotUnique:"Values are not unique",notAnArray:"This value is not an Array"}),t.registerFieldClass("array",t.Fields.ArrayField),t.registerDefaultSchemaFieldMapping("array","array"),t.registerMessages({addItemButtonLabel:"Add New Item",addButtonLabel:"Add",removeButtonLabel:"Remove",upButtonLabel:"Up",downButtonLabel:"Down"})}(jQuery),function(e){var t=e.alpaca;t.Fields.ObjectField=t.ContainerField.extend({getFieldType:function(){return"object"},setup:function(){var e=this;this.base();var n=e.resolveContainerItemTemplateType();if(!n){e.resolveContainerItemTemplateType();return t.throwErrorWithCallback("Unable to find template descriptor for container item: "+e.getFieldType())}if(this.containerItemTemplateDescriptor=e.view.getTemplateDescriptor("container-"+n+"-item",e),!t.isEmpty(this.data)&&""!==this.data&&!t.isObject(this.data)){if(!t.isString(this.data))return;try{if(this.data=t.parseJSON(this.data),!t.isObject(this.data))return void t.logWarn("ObjectField parsed data but it was not an object: "+JSON.stringify(this.data))}catch(e){return}}},setValue:function(e){if(e||(e={}),t.isObject(e)){var n={};for(var i in this.childrenById){var a=this.childrenById[i].propertyId;n[a]=this.childrenById[i]}var r={};for(var o in e)e.hasOwnProperty(o)&&(r[o]=e[o]);for(var a in r){var l=n[a];l&&(l.setValue(r[a]),delete n[a],delete r[a])}for(var a in n){var l=n[a];l.setValue(null)}}},getContainerValue:function(){if(0===this.children.length&&!this.isRequired())return{};for(var e={},n=0;n0&&t.logDebug("There were "+n.length+" extra data keys that were not part of the schema "+JSON.stringify(n)),e(i)},s={},u=[];for(var c in o){var d=null;n.data&&n.data.hasOwnProperty(c)&&(d=n.data[c]);var p=function(e,i,a){return function(r){n.resolvePropertySchemaOptions(e,function(o,l,u){if(u)return t.throwErrorWithCallback("Circular reference detected for schema: "+JSON.stringify(o),n.errorCallback);o||t.logDebug("Unable to resolve schema for property: "+e),n.createItem(e,o,l,i,null,function(t){s[e]=t,delete a[e],r()})})}}(c,d,a);u.push(p)}t.parallel(u,function(e){for(var t in o){var n=s[t];n&&i.push(n)}for(var a=!1,r=0;r").alpaca({data:r,options:a,schema:i,view:this.view.id?this.view.id:this.view,connector:this.connector,error:function(e){s.destroy(),s.errorCallback.call(s,e)},notTopLevel:!0,render:function(e,t){e.parent=s,e.propertyId=n,"/"!==s.path?e.path=s.path+"/"+n:e.path=s.path+n,e.render(null,function(){t&&t()})},postRender:function(n){var i=t.tmpl(s.containerItemTemplateDescriptor,{id:s.getId(),name:n.name,parentFieldId:s.getId(),actionbarStyle:s.options.actionbarStyle,view:s.view,data:r}),a=e(i).find("."+t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD);if(0===a.length&&e(i).hasClass(t.MARKER_CLASS_CONTAINER_FIELD_ITEM_FIELD)&&(a=e(i)),0===a.length)return void s.errorCallback.call(s,{message:"Cannot find insertion point for field: "+s.getId()});e(a).before(n.getFieldEl()),e(a).remove(),n.containerItemEl=i,t.fieldApplyFieldAndChildren(n,function(e){e.hideInitValidationError=!1}),l&&l(n)}})}, resolvePropertySchemaOptions:function(e,n){var i=this,a=function(e,t,a){i.options.readonly&&(t.readonly=!0),n(e,t,a)},r=null;i.schema&&i.schema.properties&&i.schema.properties[e]&&(r=i.schema.properties[e]);var o={};if(i.options&&i.options.fields&&i.options.fields[e]&&(o=i.options.fields[e]),r&&r.$ref){var l=r.$ref,s=r.$ref;o.$ref&&(s=o.$ref);for(var u=this,c=[u];u.parent;)u=u.parent,c.push(u);var d=r,p=o;t.loadRefSchemaOptions(u,l,s,function(e,n){for(var i=0,r=0;r1,s={};d&&t.mergeObject(s,d),e&&t.mergeObject(s,e),d&&d.id&&(s.id=d.id);var u={};p&&t.mergeObject(u,p),n&&t.mergeObject(u,n),t.nextTick(function(){a(s,u,o)})})}else t.nextTick(function(){a(r,o)})},applyCreatedItems:function(e,t){var n=this;this.base(e,function(){var i=function(a){if(a===e.items.length)return void t();var r=e.items[a],o=r.propertyId;n.showOrHidePropertyBasedOnDependencies(o),n.bindDependencyFieldUpdateEvent(o),n.refreshDependentFieldStates(o),i(a+1)};i(0)})},handleValidate:function(){var e=this.base(),n=this.validation,i=this._validateMaxProperties();return n.tooManyProperties={message:i?"":t.substituteTokens(this.getMessage("tooManyProperties"),[this.schema.maxProperties]),status:i},i=this._validateMinProperties(),n.tooFewProperties={message:i?"":t.substituteTokens(this.getMessage("tooManyItems"),[this.schema.minProperties]),status:i},e&&n.tooManyProperties.status&&n.tooFewProperties.status},_validateMaxProperties:function(){if(void 0===this.schema.maxProperties)return!0;var e=this.schema.maxProperties,t=0;for(var n in this.data)t++;return t<=e},_validateMinProperties:function(){if(void 0===this.schema.minProperties)return!0;var e=this.schema.minProperties,t=0;for(var n in this.data)t++;return t>=e},showOrHidePropertyBasedOnDependencies:function(e){var n=this,i=this.childrenByPropertyId[e];if(!i)return t.throwErrorWithCallback("Missing property: "+e,n.errorCallback);this.determineAllDependenciesValid(e)?(i.show(),i.onDependentReveal()):(i.hide(),i.onDependentConceal()),i.getFieldEl().trigger("fieldupdate")},getChildDependencies:function(e){var t=null;if(this.schema.dependencies&&(t=this.schema.dependencies[e]),!t){var n=this.childrenByPropertyId[e];n&&(t=n.schema.dependencies)}return t},getChildConditionalDependencies:function(e){var t=null,n=this.childrenByPropertyId[e];return n&&(t=n.options.dependencies),t},determineAllDependenciesValid:function(n){var i=this;if(!this.childrenByPropertyId[n])return t.throwErrorWithCallback("Missing property: "+n,i.errorCallback);var a=i.getChildDependencies(n);if(!a)return!0;var r=!0;return t.isString(a)?r=i.determineSingleDependencyValid(n,a):t.isArray(a)&&e.each(a,function(e,t){r=r&&i.determineSingleDependencyValid(n,t)}),r},bindDependencyFieldUpdateEvent:function(n){var i=this,a=this.childrenByPropertyId[n];if(!a)return t.throwErrorWithCallback("Missing property: "+n,i.errorCallback);var r=i.getChildDependencies(n);if(!r)return!0;var o=function(e,n){var r=t.resolveField(i,n);r&&(r.getFieldEl().bind("fieldupdate",function(e,t,n,a){return function(t){i.showOrHidePropertyBasedOnDependencies(n),e.getFieldEl().trigger("fieldupdate")}}(a,0,e)),r.getFieldEl().trigger("fieldupdate"))};t.isString(r)?o(n,r):t.isArray(r)&&e.each(r,function(e,t){o(n,t)})},refreshDependentFieldStates:function(n){var i=this;if(!this.childrenByPropertyId[n])return t.throwErrorWithCallback("Missing property: "+n,i.errorCallback);var a=i.getChildDependencies(n);if(!a)return!0;var r=function(e){var n=t.resolveField(i,e);n&&n.getFieldEl().trigger("fieldupdate")};t.isString(a)?r(a):t.isArray(a)&&e.each(a,function(e,t){r(t)})},determineSingleDependencyValid:function(e,n){var i=this,a=t.resolveField(i,n);if(!a)return!1;var r=a.getValue(),o=!1,l=this.getChildConditionalDependencies(e);if(l&&0!==l.length){"boolean"!==a.getType()||r||(r=!1);var s=l[n];!t.isEmpty(s)&&t.isFunction(s)?o=s.call(this,r):(o=!0,t.isArray(s)?t.anyEquality(r,s)||(o=!1):t.isEmpty(s)||t.anyEquality(s,r)||(o=!1))}else o=!("boolean"===a.getType()&&!this.childrenByPropertyId[e].options.dependencies&&!r)&&!t.isValEmpty(r);return a&&a.isHidden()&&(o=!1),o},getIndex:function(e){if(t.isEmpty(e))return-1;for(var n=0;n0&&r.after(i.containerItemEl)}else e(a.container).prepend(i.containerItemEl);a.doAfterAddItem(i,function(){t.fireReady(i)})},doAfterAddItem:function(e,t){t()},doResolveItemContainer:function(){return e(this.container)},removeItem:function(t,n){var i=this,a=this.childrenByPropertyId[t];a?(this.children=e.grep(this.children,function(e,n){return e.propertyId!==t}),delete this.childrenByPropertyId[t],delete this.childrenById[a.getId()],i.doRemoveItem(a),this.refreshValidationState(!0,function(){i.handleRepositionDOMRefresh(),i.trigger("remove",a),i.triggerUpdate(),n&&n()})):n()},doRemoveItem:function(e){this.doResolveItemContainer().children(".alpaca-container-item[data-alpaca-container-item-name='"+e.name+"']").remove(),e.destroy()},wizard:function(){var n=this,i=this.wizardConfigs.steps;i||(i=[]);var a=this.wizardConfigs.title,r=this.wizardConfigs.description,o=this.wizardConfigs.buttons;o||(o={}),o.previous||(o.previous={}),o.previous.title||(o.previous.title="Previous"),o.previous.align||(o.previous.align="left"),o.previous.type||(o.previous.type="button"),o.next||(o.next={}),o.next.title||(o.next.title="Next"),o.next.align||(o.next.align="right"),o.next.type||(o.next.type="button"),this.wizardConfigs.hideSubmitButton||(o.submit||(o.submit={}),o.submit.title||(o.submit.title="Submit"),o.submit.align||(o.submit.align="right"),o.submit.type||(o.submit.type="button"));for(var l in o)o[l].type||(o[l].type="button");var s=this.wizardConfigs.showSteps;void 0===s&&(s=!0);var u=this.wizardConfigs.showProgressBar,c=this.wizardConfigs.validation;void 0===c&&(c=!0);var a=e(this.field).attr("data-alpaca-wizard-title"),r=e(this.field).attr("data-alpaca-wizard-description"),d=e(this.field).attr("data-alpaca-wizard-validation");void 0!==d&&(c=!!d);var p=e(this.field).attr("data-alpaca-wizard-show-steps");void 0!==p&&(s=!!p);var h=e(this.field).attr("data-alpaca-wizard-show-progress-bar");void 0!==h&&(u=!!h);var f=e(this.field).find("[data-alpaca-wizard-role='step']");0==i.length&&f.each(function(t){var n={},a=e(this).attr("data-alpaca-wizard-step-title");void 0!==a&&(n.title=a),n.title||(n.title="Step "+t);var r=e(this).attr("data-alpaca-wizard-step-description");void 0!==r&&(n.description=r),n.description||(n.description="Step "+t),i.push(n)}),void 0===u&&i.length>1&&(u=!0);var m={};m.wizardTitle=a,m.wizardDescription=r,m.showSteps=s,m.performValidation=c,m.steps=i,m.buttons=o,m.schema=n.schema,m.options=n.options,m.data=n.data,m.showProgressBar=u,m.markAllStepsVisited=this.wizardConfigs.markAllStepsVisited,m.view=n.view;var g=n.view.getTemplateDescriptor("wizard",n);if(g){var v=t.tmpl(g,m);e(n.field).append(v);var b=e(v).find(".alpaca-wizard-nav"),y=e(v).find(".alpaca-wizard-steps"),w=e(v).find(".alpaca-wizard-buttons"),x=e(v).find(".alpaca-wizard-progress-bar");e(y).append(f),function(i,a,r,o){var l=0,s=e(r).find("[data-alpaca-wizard-button-key='previous']"),u=e(r).find("[data-alpaca-wizard-button-key='next']"),c=e(r).find("[data-alpaca-wizard-button-key='submit']"),d=function(){if(o.showSteps){if(o.visits||(o.visits={}),o.markAllStepsVisited)for(var t=e(i).find("[data-alpaca-wizard-step-index]"),n=0;n1&&(l>0&&s.show(),u.show(),0==l?u.show():l==o.steps.length-1&&(u.hide(),c.show())),e(a).find("[data-alpaca-wizard-role='step']").hide(),e(e(a).find("[data-alpaca-wizard-role='step']")[l]).show()},p=function(i,r){if(!o.performValidation)return void r(!0);var s=[],u=e(e(a).find("[data-alpaca-wizard-role='step']")[l]);e(u).find(".alpaca-field").each(function(){var t=e(this).attr("data-alpaca-field-id");if(t){var i=n.childrenById[t];i&&s.push(i)}});for(var c=[],d=0;d=1){var t=o.buttons.previous;t&&t.click&&t.click.call(n,e),l--,d()}}),e(u).click(function(e){e.preventDefault(),l+1<=o.steps.length-1&&p("next",function(t){if(t){var i=o.buttons.next;i&&i.click&&i.click.call(n,e),l++,d()}else window.setTimeout(function(){n.focus(function(e){})},250)})}),e(c).click(function(e){e.preventDefault(),l===o.steps.length-1&&p("submit",function(t){if(t){var i=o.buttons.submit;i&&(i.click?i.click.call(n,e):n.form&&n.form.submit())}else window.setTimeout(function(){n.focus(function(e){})},250)})}),e(r).find("[data-alpaca-wizard-button-key]").each(function(){var t=e(this).attr("data-alpaca-wizard-button-key");if("submit"!=t&&"next"!=t&&"previous"!=t){var i=o.buttons[t];i&&i.click&&e(this).click(function(e){return function(t){e.click.call(n,t)}}(i))}}),e(i).find("[data-alpaca-wizard-step-index]").click(function(t){t.preventDefault();var n=e(this).attr("data-alpaca-wizard-step-index");n&&((n=parseInt(n,10))==l||o.visits&&o.visits[n])&&(nl&&p(null,function(e){e&&(l=n,d())}))}),n.on("moveToStep",function(e){var t=e.index,n=e.skipValidation;void 0!==t&&t<=o.steps.length-1&&(n?(l=t,d()):p(null,function(e){e&&(l=t,d())}))}),n.on("advanceOrSubmit",function(t){p(null,function(t){t&&(l===o.steps.length-1?e(c).click():e(u).click())})}),d()}(b,y,w,m)}},autoWizard:function(){var t=this.wizardConfigs.bindings;t||(t={});for(var n in this.childrenByPropertyId)t.hasOwnProperty(n)||(t[n]=1);var i=!0;e(this.field).find("[data-alpaca-wizard-role='step']").length>0&&(i=!1);var a=1,r=[];do{r=[];for(var n in t)t[n]===a&&this.childrenByPropertyId&&this.childrenByPropertyId[n]&&r.push(this.childrenByPropertyId[n]);if(r.length>0){var o=null;i?(o=e('
    '),e(this.field).append(o)):o=e(e(this.field).find("[data-alpaca-wizard-role='step']")[a-1]);for(var l=!1,s=0;s0);this.wizard(),0===e(this.container).children().length&&e(this.container).css("display","none")},getType:function(){return"object"},moveItem:function(n,i,a,r){var o=this;if("function"==typeof a&&(r=a,a=o.options.animate),void 0===a&&(a=!o.options.animate||o.options.animate),"string"==typeof n&&(n=parseInt(n,10)),"string"==typeof i&&(i=parseInt(i,10)),i<0&&(i=0),i>=o.children.length&&(i=o.children.length-1),i!==-1){if(o.children[i]){var l=o.getContainerEl().children("[data-alpaca-container-item-index='"+n+"']"),s=o.getContainerEl().children("[data-alpaca-container-item-index='"+i+"']"),u=e("
    ");l.before(u);var c=e("
    ");s.before(c);var d=function(){for(var t=[],a=0;a