Caldera Forms – More Than Contact Forms - Version 1.2.0

Version Description

( April, 2015) =

Download this release

Release Info

Developer Desertsnowman
Plugin Icon 128x128 Caldera Forms – More Than Contact Forms
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.9.10 to 1.2.0

assets/css/admin.css CHANGED
@@ -872,7 +872,7 @@ input.disabled-input {
872
}
873
.tab-detail-panel > h4 {
874
font-weight: bold;
875
- margin: 0.6em 0;
876
}
877
.tab-detail-panel > h4 small {
878
color: #A9A9A9;
@@ -908,6 +908,7 @@ input.disabled-input {
908
}
909
#form-entries-viewer.spinner {
910
display: block;
911
float: left;
912
height: 22px;
913
padding: 0;
@@ -1614,4 +1615,17 @@ tr.form_entry_row.loading {
1614
position: absolute;
1615
top: -75px;
1616
box-shadow: 0 3px 5px rgba(0,0,0,0.2);
1617
- }
872
}
873
.tab-detail-panel > h4 {
874
font-weight: bold;
875
+ margin: 0 0 12px;
876
}
877
.tab-detail-panel > h4 small {
878
color: #A9A9A9;
908
}
909
#form-entries-viewer.spinner {
910
display: block;
911
+ visibility: visible;
912
float: left;
913
height: 22px;
914
padding: 0;
1615
position: absolute;
1616
top: -75px;
1617
box-shadow: 0 3px 5px rgba(0,0,0,0.2);
1618
+ z-index: 99999;
1619
+ }
1620
+ .tablenav.caldera-table-nav {
1621
+ clear: none;
1622
+ float: right;
1623
+ margin: -42px 18px 0 0;
1624
+ }
1625
+ .caldera-table-nav .tablenav-pages{
1626
+ float: left;
1627
+ }
1628
+ .caldera-table-nav .tablenav-pages .current-page{
1629
+ width: 45px;
1630
+ }
1631
+
assets/css/modals.css CHANGED
@@ -73,7 +73,8 @@
73
padding: 12px 12px 8.9px;
74
position: absolute;
75
right: 0;
76
- top: 43px;
77
}
78
#extend_cf_baldrickModalBody{
79
overflow: auto;
@@ -119,164 +120,176 @@
119
width: 45px;
120
}
121
122
-
123
-
124
-
125
-
126
- .profile-features > li,
127
- .modal-side-tabs > li {
128
display: inline-block;
129
- float: left;
130
- margin: 0;
131
}
132
- .profile-features > li .profile-feature,
133
- .modal-side-tabs > li .modal-side-tab {
134
- background: none repeat scroll 0 0 #F7F7F7;
135
display: block;
136
- margin: 0;
137
- padding: 6px 10px;
138
- text-decoration: none;
139
- color: #8F8F8F;
140
- }
141
- .profile-features > li .profile-feature:hover,
142
- .modal-side-tabs > li .modal-side-tab:hover{
143
- background-color: #efefef;
144
- }
145
- .caldera-manage-groups-tip {
146
- padding: 10px 0;
147
- text-align: center;
148
}
149
150
-
151
-
152
-
153
-
154
- /** DETAIL PROFILE MODAL */
155
- .modal-inside {
156
- height: 100%;
157
- margin-left: 158px;
158
- padding-right: 10px;
159
- overflow: auto;
160
}
161
- .modal-body {
162
- height: 100%;
163
- overflow: auto;
164
}
165
- .modal-body .modal-list-item {
166
border-bottom: 1px solid #EFEFEF;
167
- padding: 5px;
168
}
169
- .modal-list-item:hover {
170
- background: none repeat scroll 0 0 #EFEFEF;
171
}
172
- .modal-list-item .description {
173
- color: #919191;
174
}
175
176
- .modal-side-bar {
177
- background-color: #DFDFDF;
178
bottom: 0;
179
left: 0;
180
overflow: auto;
181
position: absolute;
182
- top: 0;
183
- width: 150px;
184
}
185
- .modal-side-bar .user-avatar,
186
- .modal-side-bar .user-avatar img {
187
- float: left;
188
}
189
- .modal-side-bar .modal-side-tabs {
190
- background-color: #DFDFDF;
191
bottom: 0;
192
margin: 0;
193
overflow: auto;
194
position: absolute;
195
top: 0;
196
- width: 100%;
197
- min-height: 100px;
198
- }
199
- .modal-side-bar.has-avatar .modal-side-tabs{
200
- top: 150px;
201
- }
202
- .modal-side-tabs > li .modal-side-tab {
203
- background-color: #989898;
204
- color: #FFFFFF;
205
- }
206
- .modal-side-tabs > li .modal-side-tab:hover{
207
- background-color: #efefef;
208
- color: #585858;
209
- }
210
- .modal-side-tabs > li .modal-side-tab.active {
211
- background-color: #FFF;
212
- color: #585858;
213
- }
214
- .modal-side-bar .modal-side-tabs > li {
215
- width: 100%;
216
}
217
- .tab-detail-panel {
218
- float: right;
219
- width: 100%;
220
}
221
- .user-field-lable {
222
- display: inline-block;
223
- width: 80px;
224
- color: #898989;
225
}
226
- input.disabled-input {
227
- background-color: #EFEFEF;
228
- box-shadow: none;
229
}
230
- .tab-detail-panel > h4 {
231
- font-weight: bold;
232
- margin: 0.6em 0;
233
}
234
- .tab-detail-panel > h4 small {
235
- color: #A9A9A9;
236
- font-style: italic;
237
- font-weight: normal;
238
}
239
- .tab-detail-panel .button.caldera-add-group {
240
- margin-bottom: 10px !important;
241
}
242
- .tab-detail-panel .caldera-repeater-group {
243
- margin-bottom: 12px;
244
}
245
- .caldera-repeater-group-control {
246
- background: none repeat scroll 0 0 #F7F7F7;
247
- border: 1px solid #F4F4F4;
248
- clear: both;
249
- padding: 6px;
250
- text-align: right;
251
}
252
- .caldera-repeater-group:hover .caldera-repeater-group-control.row-actions{
253
- visibility: visible;
254
}
255
-
256
- .tab-detail-panel .caldera-repeater-group hr{ clear: both;}
257
- .caldera-modal-body.spinner {
258
- background-position: 12px 12px;
259
- min-height: 44px;
260
- display: block;
261
- float: none;
262
- text-align: center;
263
- width: 100%;
264
}
265
-
266
- .modal-tab-panel {
267
- margin-left: 150px;
268
}
269
-
270
- @media (max-width: 600px) {
271
- /* Small Screens */
272
- .caldera-modal-wrap.caldera-front-modal-wrap{
273
- bottom: 0;
274
- display: block;
275
- left: 0;
276
- margin: 0 !important;
277
- overflow: auto;
278
- padding: 0 !important;
279
- top: 0;
280
- width: 100% !important;
281
- }
282
- }
73
padding: 12px 12px 8.9px;
74
position: absolute;
75
right: 0;
76
+ top: 43px;
77
+ overflow: auto;
78
}
79
#extend_cf_baldrickModalBody{
80
overflow: auto;
120
width: 45px;
121
}
122
123
+ .baldrick-modal-body.spinner,
124
+ .baldrick-modal-wrap .spinner.loading {
125
+ background-position: center center;
126
display: inline-block;
127
+ float: none;
128
+ height: auto;
129
+ position: absolute;
130
+ width: auto;
131
+ visibility: visible;
132
}
133
+
134
+ /* MODALS */
135
+ .baldrick-backdrop {
136
+ background: none repeat scroll 0 0 #000000;
137
+ bottom: 0;
138
display: block;
139
+ left: 0;
140
+ min-height: 360px;
141
+ opacity: 0.7;
142
+ position: fixed;
143
+ right: 0;
144
+ top: 0;
145
+ z-index: 100100;
146
}
147
148
+ .baldrick-modal-wrap {
149
+ background-color: #FFFFFF;
150
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
151
+ display: block;
152
+ position: fixed;
153
+ transition: height 0.2s ease 0s, margin-top 0.2s ease 0s;
154
+ width: 500px;
155
+ z-index: 100105;
156
}
157
+ .baldrick-modal-wrap.baldrick-front-modal-wrap{
158
+ position: absolute;
159
+ bottom: auto;
160
+ width: 600px;
161
+ margin-left: -300px;
162
+ margin-top: 0;
163
}
164
+ .baldrick-modal-title {
165
border-bottom: 1px solid #EFEFEF;
166
}
167
+
168
+ .baldrick-modal-closer {
169
+ color: #808080;
170
+ float: right;
171
+ font-size: 24px;
172
+ padding: 12px;
173
+ text-decoration: none;
174
}
175
+
176
+ .baldrick-modal-closer.baldrick-front-modal-closer:hover,
177
+ .baldrick-modal-closer.baldrick-front-modal-closer:active{
178
+ text-decoration: none;
179
+ color: inherit;
180
+ }
181
+ .baldrick-modal-title > h3 {
182
+ font-weight: 400;
183
+ margin: 0;
184
+ padding: 12px 40px 12px 12px;
185
}
186
187
+ .baldrick-modal-body {
188
+ -moz-box-sizing: border-box; /* Firefox 1, probably can drop this */
189
+ -webkit-box-sizing: border-box; /* Safari 3-4, also probably droppable */
190
+ box-sizing: border-box; /* Everything else */
191
bottom: 0;
192
left: 0;
193
+ margin-left: 0;
194
+ margin-right: 0;
195
+ margin-top: 0;
196
+ padding: 12px;
197
+ position: absolute;
198
+ right: 0;
199
+ top: 43px;
200
overflow: auto;
201
+ }
202
+ .baldrick-modal-body.has-buttons{
203
+ bottom: 53px;
204
+ }
205
+ .baldrick-modal-footer {
206
+ background: none repeat scroll 0 0 #EFEFEF;
207
+ border-top: 1px solid #E0E0E0;
208
+ bottom: 0;
209
+ left: 0;
210
+ padding: 12px;
211
position: absolute;
212
+ right: 0;
213
+ text-align: right;
214
}
215
+
216
+
217
+ @media (max-width: 600px) {
218
+ /* Small Screens */
219
+ .baldrick-modal-wrap.baldrick-front-modal-wrap{
220
+ bottom: 0;
221
+ display: block;
222
+ left: 0;
223
+ margin: 0 !important;
224
+ overflow: auto;
225
+ padding: 0 !important;
226
+ top: 0;
227
+ width: 100% !important;
228
+ }
229
}
230
+
231
+
232
+ /* EXPERIMENTAL TABS */
233
+ .baldrick-modal-wrap .navtabs {
234
+ background-color: #f1f1f1;
235
+ border-right: 1px solid #dfdfdf;
236
bottom: 0;
237
+ box-sizing: padding-box;
238
+ float: left;
239
+ left: 0;
240
margin: 0;
241
+ padding: 12px 0 0;
242
overflow: auto;
243
+ overflow-x: hidden;
244
+ white-space: nowrap;
245
position: absolute;
246
top: 0;
247
+ width: 150px;
248
}
249
+ .baldrick-modal-wrap .navtabs > li{
250
+ margin: 0;
251
}
252
+ .baldrick-modal-wrap .navtabs > li:hover{
253
+ background-color: #dfdfdf;
254
}
255
+ .baldrick-modal-wrap .navtabs > li a {
256
+ color: #738e2f;
257
+ display: block;
258
+ padding: 8px 12px;
259
+ text-decoration: none;
260
+ text-overflow: ellipsis;
261
+ overflow: hidden;
262
}
263
+ .baldrick-modal-body.has-tabs {
264
+ margin-left: 150px;
265
}
266
+ .baldrick-modal-wrap .navtabs > li.selected > a {
267
+ background: none repeat scroll 0 0 #a3be5f;
268
+ color: #fff !important;
269
}
270
+
271
+ .caldera-modal-title .modal-label,
272
+ .caldera-modal-title .caldera-modal-closer,
273
+ .baldrick-modal-title .modal-label,
274
+ .baldrick-modal-title .baldrick-modal-closer{
275
+ color: #fff;
276
+ text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
277
}
278
+ .caldera-modal-title .caldera-modal-closer:hover,
279
+ .baldrick-modal-title .baldrick-modal-closer:hover {
280
+ background: none repeat scroll 0 0 rgba(0, 0, 0, 0.2);
281
}
282
+ .caldera-modal-title .modal-label,
283
+ .baldrick-modal-title .modal-label{
284
+ background-color: #a3be5f;
285
}
286
+ .modal-body .modal-list-item {
287
+ border-bottom: 1px solid #EFEFEF;
288
+ padding: 5px;
289
}
290
+ .modal-list-item:hover {
291
+ background: none repeat scroll 0 0 #EFEFEF;
292
}
293
+ .modal-list-item .description {
294
+ color: #919191;
295
}
assets/css/processors-edit.css CHANGED
@@ -38,9 +38,6 @@ h3.caldera-editor-processor-title {
38
padding: 6px 134px 6px 72px;
39
}
40
41
- .form-modal-add-line:hover {
42
- background-color: #f7f7f7;
43
- }
44
button.button.info-button {
45
float: right;
46
margin-right: -120px;
38
padding: 6px 134px 6px 72px;
39
}
40
41
button.button.info-button {
42
float: right;
43
margin-right: -120px;
assets/js/admin.min.js CHANGED
@@ -1,3 +1,75 @@
1
- var baldrickTriggers,loop_loader;jQuery(document).ready(function(a){baldrickTriggers=function(){a(".ajax-trigger").baldrick({request:ajaxurl,method:"POST",complete:function(){a(".init_field_type[data-type]").each(function(b,c){var d=a(c);"function"==typeof window[d.data("type")+"_init"]&&window[d.data("type")+"_init"](d.prop("id"),d[0])})}})},loop_loader=function(){var c=Math.round(1e7*Math.random());return{__id__:c}},baldrickTriggers(),a("body").on("click",".modal-side-tab",function(b){b.preventDefault();var c=a(this),d=c.closest(".caldera-modal-body"),e=d.find(".tab-detail-panel"),f=a(c.attr("href"));d.find(".modal-side-tab.active").removeClass("active"),c.addClass("active"),e.hide(),f.show()}),a("body").on("click",".caldera-group-remover",function(b){b.preventDefault();var c=a(this),d=c.closest(".caldera-repeater-group");d.slideUp(200,function(){d.remove()})}),a("body").on("click",".form-delete a.form-control",function(b){var c=a(this);confirm(c.data("confirm"))||b.preventDefault()})}),function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function b(a){this.string=a}var a;return b.prototype.toString=function(){return""+this.string},a=b}(),b=function(a){"use strict";function g(a){return d[a]}function h(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function l(a){return a instanceof c?a.toString():null==a?"":a?(a=""+a,f.test(a)?a.replace(e,g):a):a+""}function m(a){return a||0===a?k(a)&&0===a.length?!0:!1:!0}function n(a,b){return(a?a+".":"")+b}var b={},c=a,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},e=/[&<>"'`]/g,f=/[&<>"'`]/;b.extend=h;var i=Object.prototype.toString;b.toString=i;var j=function(a){return"function"==typeof a};j(/x/)&&(j=function(a){return"function"==typeof a&&"[object Function]"===i.call(a)});var j;b.isFunction=j;var k=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===i.call(a):!1};return b.isArray=k,b.escapeExpression=l,b.isEmpty=m,b.appendContextPath=n,b}(a),c=function(){"use strict";function c(a,c){var d;c&&c.firstLine&&(d=c.firstLine,a+=" - "+d+":"+c.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<b.length;f++)this[b[f]]=e[b[f]];d&&(this.lineNumber=d,this.column=c.firstColumn)}var a,b=["description","fileName","lineNumber","message","name","number","stack"];return c.prototype=new Error,a=c}(),d=function(a,b){"use strict";function m(a,b){this.helpers=a||{},this.partials=b||{},n(this)}function n(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new e("Missing helper: '"+arguments[arguments.length-1].name+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(i(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new e("Must pass iterator to #each");var k,l,c=b.fn,f=b.inverse,g=0,h="";if(b.data&&b.ids&&(l=d.appendContextPath(b.data.contextPath,b.ids[0])+"."),j(a)&&(a=a.call(this)),b.data&&(k=q(b.data)),a&&"object"==typeof a)if(i(a))for(var m=a.length;m>g;g++)k&&(k.index=g,k.first=0===g,k.last=g===a.length-1,l&&(k.contextPath=l+g)),h+=c(a[g],{data:k});else for(var n in a)a.hasOwnProperty(n)&&(k&&(k.key=n,k.index=g,k.first=0===g,l&&(k.contextPath=l+n)),h+=c(a[n],{data:k}),g++);return 0===g&&(h=f(this)),h}),a.registerHelper("if",function(a,b){return j(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){j(a)&&(a=a.call(this));var c=b.fn;if(d.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var e=q(b.data);e.contextPath=d.appendContextPath(b.data.contextPath,b.ids[0]),b={data:e}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var c={},d=a,e=b,f="2.0.0";c.VERSION=f;var g=6;c.COMPILER_REVISION=g;var h={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};c.REVISION_CHANGES=h;var i=d.isArray,j=d.isFunction,k=d.toString,l="[object Object]";c.HandlebarsEnvironment=m,m.prototype={constructor:m,logger:o,log:p,registerHelper:function(a,b){if(k.call(a)===l){if(b)throw new e("Arg not supported with multiple helpers");d.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){k.call(a)===l?d.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};c.logger=o;var p=o.log;c.log=p;var q=function(a){var b=d.extend({},a);return b._parent=a,b};return c.createFrame=q,c}(b,c),e=function(a,b,c){"use strict";function j(a){var b=a&&a[0]||1,c=g;if(b!==c){if(c>b){var d=h[c],e=h[b];throw new f("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new f("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function k(a,b){if(!b)throw new f("No environment passed to template");if(!a||!a.main)throw new f("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,g,h,i,j,k,l,m){i&&(h=e.extend({},h,i));var n=b.VM.invokePartial.call(this,c,g,h,j,k,l,m);if(null==n&&b.compile){var o={helpers:j,partials:k,data:l,depths:m};k[g]=b.compile(c,{data:void 0!==l,compat:a.compat},b),n=k[g](h,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new f("The partial "+g+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:e.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=l(this,a,e,b,c):d||(d=this.programs[a]=l(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=e.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},g=function(b,c){c=c||{};var e=c.data;g._setup(c),!c.partial&&a.useData&&(e=o(b,e));var f;return a.useDepths&&(f=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,e,f)};return g.isTop=!0,g._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},g._child=function(b,c,e){if(a.useDepths&&!e)throw new f("must pass parent depths");return l(d,b,a[b],c,e)},g}function l(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function m(a,b,c,d,e,g,h){var i={partial:!0,helpers:d,partials:e,data:g,depths:h};if(void 0===a)throw new f("The partial "+b+" could not be found");return a instanceof Function?a(c,i):void 0}function n(){return""}function o(a,b){return b&&"root"in b||(b=b?i(b):{},b.root=a),b}var d={},e=a,f=b,g=c.COMPILER_REVISION,h=c.REVISION_CHANGES,i=c.createFrame;return d.checkRevision=j,d.template=k,d.program=l,d.invokePartial=m,d.noop=n,d}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e),g=function(a){"use strict";function d(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var b,c=a,e={ProgramNode:function(a,b,c){d.call(this,c),this.type="program",this.statements=a,this.strip=b},MustacheNode:function(a,b,c,f,g){if(d.call(this,g),this.type="mustache",this.strip=f,null!=c&&c.charAt){var h=c.charAt(3)||c.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!c;this.sexpr=a instanceof e.SexprNode?a:new e.SexprNode(a,b),this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,b,c){d.call(this,c),this.type="sexpr",this.hash=b;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!b),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,b,c,e,f){d.call(this,f),this.type="partial",this.partialName=a,this.context=b,this.hash=c,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,b,c,e,f){d.call(this,f),this.type="block",this.mustache=a,this.program=b,this.inverse=c,this.strip=e,c&&!b&&(this.isInverse=!0)},RawBlockNode:function(a,b,f,g){if(d.call(this,g),a.sexpr.id.original!==f)throw new c(a.sexpr.id.original+" doesn't match "+f,this);b=new e.ContentNode(b,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([b],{},g)},ContentNode:function(a,b){d.call(this,b),this.type="content",this.original=this.string=a},HashNode:function(a,b){d.call(this,b),this.type="hash",this.pairs=a},IdNode:function(a,b){d.call(this,b),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new c("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,b){d.call(this,b),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,b){d.call(this,b),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,b){d.call(this,b),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,b){d.call(this,b),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,b){d.call(this,b),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,b){d.call(this,b),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};return b=e}(c),h=function(){"use strict";var a,b=function(){function c(){this.yy={}}var a={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f){var h=f.length-1;switch(e){case 1:return d.prepareProgram(f[h-1].statements,!0),f[h-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[h]),{},this._$);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=new d.ContentNode(f[h],this._$);break;case 8:this.$=new d.CommentNode(f[h],this._$);break;case 9:this.$=new d.RawBlockNode(f[h-2],f[h-1],f[h],this._$);break;case 10:this.$=new d.MustacheNode(f[h-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 12:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 14:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 15:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 16:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 17:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 18:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 19:this.$=new d.PartialNode(f[h-3],f[h-2],f[h-1],d.stripFlags(f[h-4],f[h]),this._$);break;case 20:this.$=new d.PartialNode(f[h-2],void 0,f[h-1],d.stripFlags(f[h-3],f[h]),this._$);break;case 21:this.$=new d.SexprNode([f[h-2]].concat(f[h-1]),f[h],this._$);break;case 22:this.$=new d.SexprNode([f[h]],null,this._$);break;case 23:this.$=f[h];break;case 24:this.$=new d.StringNode(f[h],this._$);break;case 25:this.$=new d.NumberNode(f[h],this._$);break;case 26:this.$=new d.BooleanNode(f[h],this._$);break;case 27:this.$=f[h];break;case 28:f[h-1].isHelper=!0,this.$=f[h-1];break;case 29:this.$=new d.HashNode(f[h],this._$);break;case 30:this.$=[f[h-2],f[h]];break;case 31:this.$=new d.PartialNameNode(f[h],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[h],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[h],this._$));break;case 34:this.$=new d.DataNode(f[h],this._$);break;case 35:this.$=new d.IdNode(f[h],this._$);break;case 36:f[h-2].push({part:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 37:this.$=[{part:f[h]}];break;case 38:this.$=[];break;case 39:f[h-1].push(f[h]);break;case 48:this.$=[];break;case 49:f[h-1].push(f[h]);break;case 52:this.$=[f[h]];break;case 53:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a){throw new Error(a)},parse:function(a){function p(){var a;return a=b.lexer.lex()||1,"number"!=typeof a&&(a=b.symbols_[a]||a),a}var b=this,c=[0],d=[null],e=[],f=this.table,g="",h=0,i=0,j=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var m=this.lexer.yylloc;e.push(m);var n=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var q,r,s,t,v,x,y,z,A,w={};;){if(s=c[c.length-1],this.defaultActions[s]?t=this.defaultActions[s]:((null===q||"undefined"==typeof q)&&(q=p()),t=f[s]&&f[s][q]),"undefined"==typeof t||!t.length||!t[0]){var B="";if(!j){A=[];for(x in f[s])this.terminals_[x]&&x>2&&A.push("'"+this.terminals_[x]+"'");B=this.lexer.showPosition?"Parse error on line "+(h+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==q?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(B,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:m,expected:A})}}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:c.push(q),d.push(this.lexer.yytext),e.push(this.lexer.yylloc),c.push(t[1]),q=null,r?(q=r,r=null):(i=this.lexer.yyleng,g=this.lexer.yytext,h=this.lexer.yylineno,m=this.lexer.yylloc,j>0&&j--);break;case 2:if(y=this.productions_[t[1]][1],w.$=d[d.length-y],w._$={first_line:e[e.length-(y||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(y||1)].first_column,last_column:e[e.length-1].last_column},n&&(w._$.range=[e[e.length-(y||1)].range[0],e[e.length-1].range[1]]),v=this.performAction.call(w,g,i,h,this.yy,t[1],d,e),"undefined"!=typeof v)return v;y&&(c=c.slice(0,2*-1*y),d=d.slice(0,-1*y),e=e.slice(0,-1*y)),c.push(this.productions_[t[1]][0]),d.push(w.$),e.push(w._$),z=f[c[c.length-2]][c[c.length-1]],c.push(z);break;case 3:return!0}}return!0}},b=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,f;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),h=0;h<g.length&&(c=this._input.match(this.rules[g[h]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=h,this.options.flex));h++);return b?(f=b[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,g[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return a.lexer=b,c.prototype=a,a.Parser=c,new c}();return a=b}(),i=function(a){"use strict";function d(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(b.length-3)}}function e(a,b,d,e,f,k){if(a.sexpr.id.original!==e.path.original)throw new c(a.sexpr.id.original+" doesn't match "+e.path.original,a);var l=d&&d.program,m={left:a.strip.left,right:e.strip.right,openStandalone:h(b.statements),closeStandalone:g((l||b).statements)};if(a.strip.right&&i(b.statements,null,!0),l){var n=d.strip;n.left&&j(b.statements,null,!0),n.right&&i(l.statements,null,!0),e.strip.left&&j(l.statements,null,!0),g(b.statements)&&h(l.statements)&&(j(b.statements),i(l.statements))}else e.strip.left&&j(b.statements,null,!0);return f?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function f(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c],f=e.strip;if(f){var k=g(a,c,b,"partial"===e.type),l=h(a,c,b),m=f.openStandalone&&k,n=f.closeStandalone&&l,o=f.inlineStandalone&&k&&l;f.right&&i(a,c,!0),f.left&&j(a,c,!0),o&&(i(a,c),j(a,c)&&"partial"===e.type&&(e.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(i((e.program||e.inverse).statements),j(a,c)),n&&(i(a,c),j((e.inverse||e.program).statements))}}return a}function g(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?#x2F;:/(^|\r?\n)\s*?#x2F;).test(d.original):void 0:c}function h(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function i(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function j(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+#x2F;:/[ \t]+#x2F;,""),d.leftStripped=d.string!==e,d.leftStripped}}var b={},c=a;return b.stripFlags=d,b.prepareBlock=e,b.prepareProgram=f,b}(c),j=function(a,b,c,d){"use strict";function k(a){return a.constructor===g.ProgramNode?a:(f.yy=j,f.parse(a))}var e={},f=a,g=b,h=c,i=d.extend;e.parser=f;var j={};return i(j,h,g),e.parse=k,e}(h,g,i,b),k=function(a,b){"use strict";function g(){}function h(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new d("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e=c.parse(a),f=(new c.Compiler).compile(e,b);return(new c.JavaScriptCompiler).compile(f,b)}function i(a,b,c){function f(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new d("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,g=function(a,b){return e||(e=f()),e.call(this,a,b)};return g._setup=function(a){return e||(e=f()),e._setup(a)},g._child=function(a,b,c){return e||(e=f()),e._child(a,b,c)},g}function j(a,b){if(a===b)return!0;if(e(a)&&e(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!j(a[c],b[c]))return!1;
2
- return!0}}var c={},d=a,e=b.isArray,f=[].slice;return c.Compiler=g,g.prototype={compiler:g,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!j(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}),this},compileProgram:function(a){var d,b=(new this.compiler).compile(a,this.options),c=this.guid++;this.usePartial=this.usePartial||b.usePartial,this.children[c]=b;for(var e=0,f=b.depths.list.length;f>e;e++)d=b.depths.list[e],2>d||this.addDepth(d-1);return c},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var c,d,b=a.pairs;for(this.opcode("pushHash"),c=0,d=b.length;d>c;c++)this.pushParam(b[c][1]);for(;c--;)this.opcode("assignToHash",b[c][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.accept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var e=this.setupFullMustacheParams(a,b,c),f=a.id,g=f.parts[0];if(this.options.knownHelpers[g])this.opcode("invokeKnownHelper",e.length,g);else{if(this.options.knownHelpersOnly)throw new d("You specified knownHelpersOnly, but used the unknown helper "+g,a);f.falsy=!0,this.ID(f),this.opcode("invokeHelper",e.length,f.original,f.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:f.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},c.precompile=h,c.compile=i,c}(c,b),l=function(a,b){"use strict";function g(a){this.value=a}function h(){}var c,d=a.COMPILER_REVISION,e=a.REVISION_CHANGES,f=b;h.prototype={nameLookup:function(a,b){return h.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, "'+a+'")'},compilerInfo:function(){var a=d,b=e[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var g,h,i,e=a.opcodes;for(h=0,i=e.length;i>h;h++)g=e[h],this[g.opcode].apply(this,g.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new f("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(h=0,i=l.length;i>h;h++)l[h]&&(k[h]=l[h]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n "+f+"}"},mergeSource:function(a){for(var c,e,b="",d=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h=this.source[f];h.appendToBuffer?c=c?c+"\n + "+h.content:h.content:(c&&(b?b+="buffer += "+c+";\n ":(e=!0,b=c+";\n "),c=void 0),b+=h+"\n ",this.environment.isSimple||(d=!1))}return d?(c||!b)&&(b+="return "+(c||'""')+";\n"):(a+=", buffer = "+(e?"":this.initializeBuffer()),b+=c?"return buffer + "+c+";\n":"return buffer;\n"),a&&(b="var "+a.substring(2)+(e?"":";\n ")+b),b},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendingContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")})},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),"+"(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var c,d,e,b=this.popStack();this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&f.contexts.push("'"+a+"': "+c),d&&f.types.push("'"+a+"': "+d),e&&f.ids.push("'"+a+"': "+e),f.values.push("'"+a+"': ("+b+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:h,compileChildren:function(a,b){for(var d,e,c=a.children,f=0,g=c.length;g>f;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);null==h?(this.context.programs.push(""),h=this.context.programs.length,d.index=h,d.name="program"+h,this.context.programs[h]=e.compile(d,b,this.context,!this.precompile),this.context.environments[h]=d,this.useDepths=this.useDepths||e.useDepths):(d.index=h,d.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],d=(b.depths.list,this.useDepths),f=[b.index,"data"];return d&&f.push("depths"),"this.program("+f.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new g(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){var d,e,h,b="";if(this.isInline(),!this.isInline())throw new f("replaceStack on non-inline");var i=this.popStack(!0);if(i instanceof g)b=d=i.value,h=!0;else{e=!this.stackSlot;var j=e?this.incrStack():this.topStackName();b="("+this.push(j)+" = "+i+")",d=this.topStack()}var k=a.call(this,d);h||this.popStack(),e&&this.stackSlot--,this.push("("+b+k+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,c=a.length;c>b;b++){var d=a[b];d instanceof g?this.compileStack.push(d):this.pushStack(d)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof g)return c.value;if(!b){if(!this.stackSlot)throw new f("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof g?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var h,i,j,d={},e=[],f=[],g=[];d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack()),i=this.popStack(),j=this.popStack(),(j||i)&&(j||(j="this.noop"),i||(i="this.noop"),d.fn=j,d.inverse=i);for(var k=b;k--;)h=this.popStack(),c[k]=h,this.trackIds&&(g[k]=this.popStack()),this.stringParams&&(f[k]=this.popStack(),e[k]=this.popStack());return this.trackIds&&(d.ids="["+g.join(",")+"]"),this.stringParams&&(d.types="["+f.join(",")+"]",d.contexts="["+e.join(",")+"]"),this.options.data&&(d.data="data"),d},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=h.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;return h.isValidJavaScriptVariableName=function(a){return!h.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*#x2F;.test(a)},c=h}(d,c),m=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,g["default"]=g,f=g}(f,g,j,k,l);return m}),Handlebars.registerHelper("is_single",function(a,b){return 1!==Object.keys(a).length?!1:b.fn(this)}),Handlebars.registerHelper("script",function(a){return a.hash.src?'<script type="text/javascript" src="'+a.fn(this)+'"></script>':'<script type="text/javascript">'+a.fn(this)+"</script>"}),Handlebars.registerHelper("is",function(a,b){return"@key"===b.hash.value&&(b.hash.value=b.data.key),b.hash.value===a?b.fn(this):this[b.hash.value]&&this[b.hash.value]===a?b.fn(this):b.inverse(this)}),function(a){var b={},c={},d={_plugins:{},load:{},bind:{},event:function(a){return a},pre_filter:function(a){return a.data},filter:function(a){return a},target:function(a){if("string"==typeof a.params.success?"function"==typeof window[a.params.success]&&window[a.params.success](a):"function"==typeof a.params.success&&a.params.success(a),a.params.target)if(a.params.target.is("textarea,input")&&"object"==typeof a.data?a.params.target.val(JSON.stringify(a.data)).trigger("change"):a.params.target[a.params.targetInsert](a.data),"string"==typeof a.params.callback){if("function"==typeof window[a.params.callback])return window[a.params.callback](a)}else if("function"==typeof a.params.callback)return a.params.callback(a)},request_data:function(a){return a.data},request:function(d){if((d.params.trigger.data("cacheLocal")||d.params.trigger.data("cacheSession"))&&!d.params.trigger.data("cachePurge")){var e;if(d.params.trigger.data("cacheLocal")?e=d.params.trigger.data("cacheLocal"):d.params.trigger.data("cacheSession")&&(e=d.params.trigger.data("cacheSession")),"undefined"!=typeof b[e])return{data:b[e]};if("undefined"!=typeof Storage){var f;if(d.params.trigger.data("cacheLocal")?f=localStorage.getItem(e):d.params.trigger.data("cacheSession")&&(f=sessionStorage.getItem(e)),f){try{f=JSON.parse(f)}catch(g){f=f}return{data:f}}}}return c[d.params.trigger.prop("id")]&&c[d.params.trigger.prop("id")].abort(),c[d.params.trigger.prop("id")]=a.ajax(d.request),c[d.params.trigger.prop("id")]},request_complete:function(a){a.params.complete(a),a.params.loadElement.removeClass(a.params.loadClass),c[a.params.trigger.prop("id")]&&delete c[a.params.trigger.prop("id")]},request_error:function(a){a.params.error(a),a.params.complete(a.jqxhr,a.textStatus)},refresh:function(b,c){a(c.triggerClass).baldrick(c)}};a.fn.baldrick=function(b){var c=function(a,b,c){var d;for(var e in h.helpers._plugins)if("function"==typeof h.helpers._plugins[e][a]&&(d=h.helpers._plugins[e][a](b,h,c),"undefined"!=typeof d&&(b=d),b===!1))return!1;if("function"==typeof h.helpers[a]&&(d=h.helpers[a](b,h,c),"undefined"!=typeof d&&(b=d),!b))return!1;for(var f in h.helpers._plugins)if("function"==typeof h.helpers._plugins[f]["after_"+a]&&(d=h.helpers._plugins[f]["after_"+a](b,h,c),"undefined"!=typeof d&&(b=d),b===!1))return!1;return b},e=function(b){var c={},d=b.find("input,radio,checkbox,select,textarea,file"),f={};if(d.length){for(var g=0;g<d.length;g++)if(null!==d[g].getAttribute("name")){for(var h=a(d[g]),i=h.prop("name").replace(/\[/gi,":").replace(/\]/gi,""),j=i.split(":"),k=h.is(":checkbox,:radio")?h.filter(":checked").val():h.val(),l={},m=j.length-1;m>=0;m--){var n=j[m];if(0===n.length&&("undefined"==typeof f[j[m-1]]?f[j[m-1]]=0:f[j[m-1]]+=1,n=f[j[m-1]]),m===j.length-1)l[n]=k;else{var o=l;l={},l[n]=o}}a.extend(!0,c,l)}return c}},f=this.selector,g=this.not("._tisBound");g.addClass("_tisBound"),"undefined"!=typeof b&&"object"==typeof b.helper&&(d._plugins._params_helpers_=b.helper);var h=a.extend(!0,b,{helpers:d},{triggerClass:f}),i=function(){return!0},j={before:i,callback:!1,success:!1,complete:i,error:i};for(var l in j)"string"==typeof h[l]?j[l]="function"==typeof window[h[l]]?window[h[l]]:i:"function"==typeof h[l]&&(j[l]=h[l]);return g=c("bind",g),g===!1?this:c("ready",g.each(function(b){this.id||(this.id="baldrick_trigger_"+((new Date).getTime()+b));var d=a(this),f=d.data("event")?d.data("event"):h.event?h.event:d.is("form")?"submit":"click";return d.on(f,function(b){var d=a(c("event",this,b));if(d.data("for")){var i=a(d.data("for")),k=a.extend({},i.data(),d.data());return delete k["for"],i.data(k),i.is("form")?(i.submit(),this):i.trigger(i.data("event")?i.data("event"):f)}if(d.is("form")&&!d.data("request")&&d.attr("action")&&d.data("request",d.attr("action")),d.is("a")&&!d.data("request")&&d.attr("href")&&(d.attr("href").indexOf("#")<0?d.data("request",d.attr("href")):d.data("href",d.attr("href"))),(d.data("before")?"function"==typeof window[d.data("before")]?window[d.data("before")](this,b):j.before(this,b):j.before(this,b))!==!1){var l={trigger:d,callback:d.data("callback")?"function"==typeof window[d.data("callback")]?window[d.data("callback")]:d.data("callback"):j.callback,success:d.data("success")?"function"==typeof window[d.data("success")]?window[d.data("success")]:d.data("success"):j.success,method:d.data("method")?d.data("method"):d.attr("method")?d.attr("method"):h.method?h.method:"GET",dataType:d.data("type")?d.data("type"):h.dataType?h.dataType:!1,timeout:d.data("timeout")?d.data("timeout"):12e4,target:d.data("target")?"_parent"===d.data("target")?d.parent():"_self"===d.data("target")?a(d):a(d.data("target")):h.target?a(h.target):a("<html>"),targetInsert:d.data("targetInsert")?"replace"===d.data("targetInsert")?"replaceWith":d.data("targetInsert"):h.targetInsert?"replace"===h.targetInsert?"replaceWith":h.targetInsert:"html",loadClass:d.data("loadClass")?d.data("loadClass"):h.loadClass?h.loadClass:"loading",activeClass:d.data("activeClass")?d.data("activeClass"):h.activeClass?h.activeClass:"active",activeElement:d.data("activeElement")?"_parent"===d.data("activeElement")?d.parent():a(d.data("activeElement")):h.activeElement?"_parent"===h.activeElement?d.parent():a(h.activeElement):d,cache:d.data("cache")?d.data("cache"):h.cache?h.cache:!1,complete:d.data("complete")?"function"==typeof window[d.data("complete")]?window[d.data("complete")]:j.complete:j.complete,error:d.data("error")?"function"==typeof window[d.data("error")]?window[d.data("error")]:j.error:j.error,resultSelector:!1,event:f};if(l.url=d.data("request")?d.data("request"):h.request?h.request:l.callback,l.loadElement=d.data("loadElement")?"_parent"===d.data("loadElement")?d.parent():a(d.data("loadElement")):h.loadElement?a(h.loadElement)?a(h.loadElement):l.target:l.target,l=c("params",l),l===!1)return!1;if(b.preventDefault(),"function"==typeof window[l.url]){var m=window[l.url](l,f);return m=c("pre_filter",{data:m,params:l}),m=c("filter",{data:m,rawData:m,params:l}),c("target",m),c("refresh",{params:l}),c("request_complete",{jqxhr:null,textStatus:"complete",request:w,params:l}),this}try{if(a(l.url).length)var m=a(l.url).is("input,select,radio,checkbox,file,textarea")?a(l.url).val():a(l.url).is("form")?e(a(l.url)):a(l.url).html()}catch(b){}if("undefined"!=typeof m){if("json"===l.dataType)try{m=JSON.parse(m)}catch(b){}return m=c("pre_filter",{data:m,params:l}),m=c("filter",{data:m,rawData:m,params:l}),c("target",m),c("refresh",{params:l}),c("request_complete",{jqxhr:null,textStatus:"complete",request:w,params:l}),this}switch(typeof l.url){case"function":return l.url(this,b);case"boolean":case"object":return;case"string":if(l.url.indexOf(" ")>-1){var o=l.url.split(" ");l.url=o[0],l.resultSelector=o[1]}}d.data("group")?a('._tisBound[data-group="'+d.data("group")+'"]').each(function(){var b=a(this),c=b.data("activeElement")?"_parent"===b.data("activeElement")?b.parent():a(b.data("activeElement")):h.activeElement?"_parent"===h.activeElement?d.parent():a(h.activeElement):b;c.removeClass(b.data("activeClass")?b.data("activeClass"):h.activeClass?h.activeClass:l.activeClass)}):a("._tisBound:not([data-group])").each(function(){var b=a(this),c=b.data("activeElement")?"_parent"===b.data("activeElement")?b.parent():a(b.data("activeElement")):h.activeElement?"_parent"===h.activeElement?d.parent():a(h.activeElement):b;c.removeClass(b.data("activeClass")?b.data("activeClass"):h.activeClass?h.activeClass:l.activeClass)}),l.activeElement.addClass(l.activeClass),l.loadElement.addClass(l.loadClass);var q;if(FormData&&(d.is("input:file")||"POST"===l.method)){l.method="POST",l.contentType=!1,l.processData=!1,l.cache=!1,l.xhrFields={onprogress:function(a){a.lengthComputable}},q=d.is("form")?new FormData(d[0]):new FormData,d.is("input,select,textarea")&&d.data("_value",d.val());for(var r in l.trigger.data())q.append(r,l.trigger.data(r));if(l.data&&q.append("data",JSON.stringify(l.data)),d.is("input,select,textarea"))if(d.is("input:file"))if(d[0].files.length>1)for(var s=0;s<d[0].files.length;s++)q.append(d.prop("name"),d[0].files[s]);else q.append(d.prop("name"),d[0].files[0]);else d.is("input:checkbox")||d.is("input:radio")?d.prop("checked")&&q.append(d.prop("name"),d.val()):q.append(d.prop("name"),d.val())}else{var t=d.serializeArray(),u=l.trigger.data(),v=[];h.data&&(u=a.extend(h.data,u)),t.length&&(a.each(t,function(a,b){v.push(b)}),l.requestData=e(d)),l.data&&(u=a.extend(u,l.data)),q=u,l.requestData=a.extend(d.data(),l.requestData)}var w={url:l.url,data:c("request_data",{data:q,params:l}),cache:l.cache,timeout:l.timeout,type:l.method,success:function(b,d,e){if(l.resultSelector)if("object"==typeof b){for(var f=l.resultSelector.replace(/\[/g,".").replace(/\]/g,"").split("."),g=b,h=0;h<f.length;h++)g=g[f[h]];b=g}else if("string"==typeof b){var i=a(l.resultSelector,a("<html>").html(b));1===i.length?b=a("<html>").html(i).html():(b=a("<html>"),i.each(function(){b.append(this)}),b=b.html())}var j=b;if(l.trigger.data("cacheLocal")||l.trigger.data("cacheSession")){var k;if(l.trigger.data("cacheLocal")?k=l.trigger.data("cacheLocal"):l.trigger.data("cacheSession")&&(k=l.trigger.data("cacheSession")),"undefined"!=typeof Storage)if(l.trigger.data("cacheLocal"))try{localStorage.setItem(k,e.responseText)}catch(m){console.log(m)}else if(l.trigger.data("cacheSession"))try{sessionStorage.setItem(k,e.responseText)}catch(m){console.log(m)}a(window).trigger("baldrick.cache",k)}b=c("pre_filter",{data:b,request:w,params:l,xhr:e}),b=c("filter",{data:b,rawData:j,request:w,params:l,xhr:e}),c("target",b)},complete:function(a,b){c("request_complete",{jqxhr:a,textStatus:b,request:w,params:l}),c("refresh",{jqxhr:a,textStatus:b,request:w,params:l}),d.data("once")&&d.off(f).removeClass("_tisBound")},error:function(a,b,d){c("request_error",{jqxhr:a,textStatus:b,error:d,request:w,params:l})}};if(l.dataType&&(w.dataType=l.dataType),"undefined"!=typeof l.contentType&&(w.contentType=l.contentType),"undefined"!=typeof l.processData&&(w.processData=l.processData),"undefined"!=typeof l.xhrFields&&(w.xhrFields=l.xhrFields),w=c("request_params",w,l),w===!1)return g;var x=c("request",{request:w,params:l});if(x.data){var m=x.data;c("target",c("filter",c("pre_filter",{data:m,request:w,params:l}))),c("request_complete",{jqxhr:!1,textStatus:!0,request:w,params:l}),c("refresh",{jqxhr:!1,textStatus:!0,request:w,params:l})}}}),(d.data("autoload")||d.data("poll"))&&(d.data("delay")?setTimeout(function(a,b){return a.trigger(b)},d.data("delay"),d,f):d.trigger(f)),d.data("poll")&&(d.data("delay")?setTimeout(function(a,b){return setInterval(function(a,b){return a.trigger(b)},a.data("poll"),a,b)},d.data("delay")):setInterval(function(a,b){return a.trigger(b)},d.data("poll"),d,f)),this}))},a.fn.baldrick.cacheObject=function(a,c){b[a]=c},a.fn.baldrick.registerhelper=function(b,c,e){var f={};"object"==typeof c?(f[b]=c,d._plugins=a.extend(!0,f,d._plugins)):"string"==typeof c&&"string"==typeof b&&"function"==typeof e&&(f[c]={},f[c][b]=e,d._plugins=a.extend(!0,f,d._plugins))}}(jQuery),Handlebars.registerHelper("even",function(a){var b=a.data.index/2;return b===Math.ceil(b)?a.fn(this):!1}),Handlebars.registerHelper("odd",function(a){var b=a.data.index/2;return b===Math.ceil(b)?!1:a.fn(this)}),Handlebars.registerHelper("json",function(a){return JSON.stringify(a)}),function(a){var b={};a.fn.baldrick.registerhelper("handlebars",{bind:function(c){var e=c.filter("[data-template-url]");e.length&&e.each(function(){var c=a(this);if("undefined"==typeof b[c.data("templateUrl")]){if(b[c.data("templateUrl")]=!0,"undefined"!=typeof Storage){var d,e;c.data("cacheLocal")?(e=c.data("cacheLocal"),d=localStorage.getItem("handlebars_"+e)):c.data("cacheSession")&&(e=c.data("cacheSession"),d=sessionStorage.getItem("handlebars_"+e))}d?b[c.data("templateUrl")]=Handlebars.compile(d):a.get(c.data("templateUrl"),function(a,d,e){if("undefined"!=typeof Storage){var f;c.data("cacheLocal")?(f=c.data("cacheLocal"),localStorage.setItem("handlebars_"+f,e.responseText)):c.data("cacheSession")&&(f=c.data("cacheSession"),sessionStorage.setItem("handlebars_"+f,e.responseText))}b[c.data("templateUrl")]=Handlebars.compile(e.responseText)})}})},request_params:function(a,b,c){return(c.trigger.data("templateUrl")||c.trigger.data("template"))&&"object"==typeof Handlebars?(a.dataType="json",a):void 0},filter:function(c){return c.params.trigger.data("templateUrl")?"function"==typeof b[c.params.trigger.data("templateUrl")]&&(c.data=b[c.params.trigger.data("templateUrl")](c.data)):c.params.trigger.data("template")&&("function"==typeof b[c.params.trigger.data("template")]?c.data=b[c.params.trigger.data("template")](c.data):a(c.params.trigger.data("template"))&&(b[c.params.trigger.data("template")]=Handlebars.compile(a(c.params.trigger.data("template")).html()),c.data=b[c.params.trigger.data("template")](c.data))),c}})}(jQuery),function(a){var c=!1;a.fn.baldrick.registerhelper("wordpress_modal",{refresh:function(b){b.params.trigger.data("modalAutoclose")&&a("#"+b.params.trigger.data("modalAutoclose")+"_baldrickModalCloser").trigger("click")},event:function(b){var d=a(b),e="wm";if(d.data("modal")&&c===!1&&("true"!==d.data("modal")&&(e=d.data("modal")),!a("#"+e+"_baldrickModal").length)){var f=a("<div>",{id:e+"_baldrickModal",tabIndex:-1,"ariaLabelled-by":e+"_baldrickModalLable","class":"caldera-modal-wrap"}),g=a("<div>",{"class":"caldera-backdrop"});modalContent=a("<div>",{"class":"caldera-modal-body",id:e+"_baldrickModalBody"}),modalFooter=a("<div>",{"class":"caldera-modal-footer",id:e+"_baldrickModalFooter"}),modalHeader=a("<div>",{"class":"caldera-modal-title",id:e+"_baldrickModalTitle"}),modalCloser=a("<a>",{href:"#close","class":"caldera-modal-closer","data-dismiss":"modal","aria-hidden":"true",id:e+"_baldrickModalCloser"}).html("&times;"),modalTitle=a("<h3>",{"class":"modal-label",id:e+"_baldrickModalLable"}),modalHeader.append(modalCloser).append(modalTitle).appendTo(f),g.on("dismiss",function(b){b.preventDefault(),g.fadeOut(200),f.fadeOut(200,function(){a(this).remove(),g.remove()})}),modalCloser.on("click",function(b){b.preventDefault(),g.fadeOut(200),f.fadeOut(200,function(){a(this).remove(),g.remove()})}),modalContent.appendTo(f),modalFooter.appendTo(f),f.appendTo(a("body")).hide().fadeIn(200),g.insertBefore(f).hide().fadeIn(200)}},request_complete:function(b){if(b.params.trigger.data("modal")){var f,g,d="wm",e="loading";if("true"!==b.params.trigger.data("modal")&&(d=b.params.trigger.data("modal")),f=a("#"+d+"_baldrickModal"),g=a("#"+d+"_baldrickModalBody"),modalTitle=a("#"+d+"_baldrickModalTitle"),b.params.trigger.data("loadClass")&&(e=b.params.trigger.data("loadClass")),b.params.trigger.data("modalLife")){var h=parseFloat(b.params.trigger.data("modalLife"));h>0?setTimeout(function(){a("#"+d+"_baldrickModalCloser").trigger("click")},h):a("#"+d+"_baldrickModalCloser").trigger("click")}g.removeClass(e).show()}},after_filter:function(b){if(b.params.trigger.data("modal")&&b.params.trigger.data("targetInsert")){var c="wm";"true"!==b.params.trigger.data("modal")&&(c=b.params.trigger.data("modal"));var d=a(b.data).prop("id",c+"_baldrickModalBody");
3
- b.data=d}return b},params:function(c,d){var e=c.trigger,f="wm",g="loading";if("true"!==c.trigger.data("modal")&&(f=c.trigger.data("modal")),c.trigger.data("loadClass")&&(g=c.trigger.data("loadClass")),e.data("modal")&&(c.url||e.data("modalContent"))){var h;c.url&&(c.target=a("#"+f+"_baldrickModalBody"),c.loadElement=a("#"+f+"_baldrickModalLoader"),c.target.empty()),h=e.data("modalTemplate")?a(e.data("modalTemplate")):a("#"+f+"_baldrickModal"),a(".modal-backdrop").length;var i=a("#"+f+"_baldrickModalLable"),k=(a("#"+f+"_baldrickModalTitle"),a("#"+f+"_baldrickModalBody")),l=a("#"+f+"_baldrickModalFooter");if(i.empty().parent().hide(),k.addClass(g),l.empty().hide(),e.data("modalTitle")&&i.html(e.data("modalTitle")).parent().show(),e.data("modalButtons")){var m=a.trim(e.data("modalButtons")).split(";");if(m.length){for(b=0;b<m.length;b++){var o=m[b].split("|"),p=o[0],q=o[1].trim(),r=a.extend({},{"class":"button "+d.triggerClass.substr(1)},"{"===q.substr(0,1)?jQuery.parseJSON(q):{"data-callback":q}),s=a("<button>",r);o[2]&&s.addClass(o[2]),"dismiss"===q&&s.on("click",function(){a("#"+f+"_baldrickModalCloser").trigger("click")}),l.append(s.html(p)),b<m.length&&l.append("&nbsp;")}l.show()}}var t={};c.trigger.data("modalWidth")&&(t.width=parseInt(c.trigger.data("modalWidth"))),c.trigger.data("modalHeight")&&(t.maxHeight=c.trigger.data("modalHeight")),(t.width||t.maxHeight)&&(t.width&&(t.marginLeft=t.width/2-t.width),h.css(t)),e.data("modalContent")&&(k.html(a(e.data("modalContent")).html()),loader.hide(),k.show(),a(d.triggerClass).baldrick(d))}}})}(jQuery);
1
+ var baldrickTriggers, loop_loader;
2
+
3
+ jQuery(document).ready(function($){
4
+
5
+ // admin stuff!
6
+ // Baldrick Bindings
7
+ baldrickTriggers = function(){
8
+ $('.ajax-trigger').baldrick({
9
+ request : ajaxurl,
10
+ method : 'POST',
11
+ complete : function(){
12
+ // check for init function
13
+ $('.init_field_type[data-type]').each(function(k,v){
14
+ var ftype = $(v);
15
+ if( typeof window[ftype.data('type') + '_init'] === 'function' ){
16
+ window[ftype.data('type') + '_init'](ftype.prop('id'), ftype[0]);
17
+ }
18
+ });
19
+ }
20
+ });
21
+ };
22
+
23
+ // loop loader
24
+ loop_loader = function(params, ev){
25
+ var id = Math.round( ( Math.random() * 10000000 ) );
26
+ return { "__id__" : id };
27
+ };
28
+
29
+ baldrickTriggers();
30
+
31
+
32
+ // Profile TABS
33
+ $('body').on('click', '.modal-side-tab', function(e){
34
+ e.preventDefault();
35
+ var clicked = $(this),
36
+ parent = clicked.closest('.caldera-modal-body'),
37
+ panels = parent.find('.tab-detail-panel'),
38
+ panel = $(clicked.attr('href'));
39
+
40
+ parent.find('.modal-side-tab.active').removeClass('active');
41
+ clicked.addClass('active');
42
+
43
+ panels.hide();
44
+ panel.show();
45
+ });
46
+
47
+ // Profile Repeatable Group Remove
48
+ $('body').on('click', '.caldera-group-remover', function(e){
49
+
50
+ e.preventDefault();
51
+
52
+ var clicked = $(this),
53
+ parent = clicked.closest('.caldera-repeater-group');
54
+
55
+ parent.slideUp(200, function(){
56
+ parent.remove();
57
+ });
58
+
59
+
60
+ });
61
+
62
+ $('body').on('click', '.form-delete a.form-control', function(e){
63
+ var clicked = $(this);
64
+ if(confirm(clicked.data('confirm'))){
65
+ return;
66
+ }else{
67
+ e.preventDefault();
68
+ }
69
+
70
+ });
71
+
72
+
73
+
74
+
75
+ });
assets/js/conditionals.js CHANGED
@@ -65,7 +65,7 @@
65
switch(lines[lid].compare) {
66
case 'is':
67
if(comparefield.length){
68
- if(comparefield.indexOf(comparevalue) >= 0){
69
truelines[lid] = true;
70
}
71
}
65
switch(lines[lid].compare) {
66
case 'is':
67
if(comparefield.length){
68
+ if(comparefield.indexOf(comparevalue.toString()) >= 0){
69
truelines[lid] = true;
70
}
71
}
assets/js/conditionals.min.js CHANGED
@@ -1 +1 @@
1
- !function(){function b(){for(var a in caldera_conditionals){var b=jQuery("#conditional_"+a);if(b.length){var c=caldera_conditionals[a].type,d=caldera_conditionals[a].group,e=[];for(var f in d){var g={},h=d[f];for(var i in h){var j=jQuery('[data-field="'+h[i].field+"_"+h[i].instance+'"]'),k=[],l="function"==typeof h[i].value?h[i].value():h[i].value;if(g[i]=!1,j.is(":radio,:checkbox")?j=j.filter(":checked"):j.is("div")&&(j=jQuery("<input>").val(j.html())),j.length)for(var m=0;m<j.length;m++)k.push(j[m].value);else k.push(h[i].field);switch(h[i].compare){case"is":k.length&&k.indexOf(l)>=0&&(g[i]=!0);break;case"isnot":k.length&&k.indexOf(l)<0&&(g[i]=!0);break;case">":parseFloat(k.reduce(function(a,b){return a+b}))>parseFloat(l)&&(g[i]=!0);break;case"<":parseFloat(k.reduce(function(a,b){return a+b}))<parseFloat(l)&&(g[i]=!0);break;case"startswith":for(var m=0;m<k.length;m++)k[m].toLowerCase().substr(0,l.toLowerCase().length)===l.toLowerCase()&&(g[i]=!0);break;case"endswith":for(var m=0;m<k.length;m++)k[m].toLowerCase().substr(k[m].toLowerCase().length-l.toLowerCase().length)===l.toLowerCase()&&(g[i]=!0);break;case"contains":for(var m=0;m<k.length;m++)k[m].toLowerCase().indexOf(l)>=0&&(g[i]=!0)}}istrue=!0;for(var n in g)if(g[n]===!1){istrue=!1;break}e.push(istrue)}var r,o=jQuery("#conditional-"+a+"-tmpl").html(),p=jQuery("#conditional_"+a),q=jQuery('[data-field="'+a+'"]');e.length&&e.indexOf(!0)>=0?"show"===c?r="show":"hide"===c?r="hide":"disable"===c&&(r="disable"):r="show"===c?"hide":"disable"===c?"enable":"show","show"===r?p.html().length||(p.html(o).trigger("cf.add"),jQuery(document).trigger("cf.add")):"hide"===r?p.html().length&&(q.val("").empty().prop("checked",!1),p.empty().trigger("cf.remove"),jQuery(document).trigger("cf.remove")):"enable"===r?p.html().length?q.prop("disabled",!1):(p.html(o).trigger("cf.add"),jQuery(document).trigger("cf.add")):"disable"===r&&(p.html().length?(q.prop("disabled","disabled"),jQuery(document).trigger("cf.disable")):(p.html(o).trigger("cf.add"),jQuery(document).trigger("cf.add"),jQuery('[data-field="'+a+'"]').prop("disabled","disabled")))}}}Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=this.length>>>0,c=Number(arguments[1])||0;for(c=0>c?Math.ceil(c):Math.floor(c),0>c&&(c+=b);b>c;c++)if(c in this&&this[c]===a)return c;return-1}),"undefined"!=typeof caldera_conditionals&&(jQuery(".caldera_forms_form").on("change keyup","[data-field]",function(){b()}),b())}(jQuery);
1
+ !function(){function b(){for(var a in caldera_conditionals){var b=jQuery("#conditional_"+a);if(b.length){var c=caldera_conditionals[a].type,d=caldera_conditionals[a].group,e=[];for(var f in d){var g={},h=d[f];for(var i in h){var j=jQuery('[data-field="'+h[i].field+"_"+h[i].instance+'"]'),k=[],l="function"==typeof h[i].value?h[i].value():h[i].value;if(g[i]=!1,j.is(":radio,:checkbox")?j=j.filter(":checked"):j.is("div")&&(j=jQuery("<input>").val(j.html())),j.length)for(var m=0;m<j.length;m++)k.push(j[m].value);else k.push(h[i].field);switch(h[i].compare){case"is":k.length&&k.indexOf(l.toString())>=0&&(g[i]=!0);break;case"isnot":k.length&&k.indexOf(l)<0&&(g[i]=!0);break;case">":parseFloat(k.reduce(function(a,b){return a+b}))>parseFloat(l)&&(g[i]=!0);break;case"<":parseFloat(k.reduce(function(a,b){return a+b}))<parseFloat(l)&&(g[i]=!0);break;case"startswith":for(var m=0;m<k.length;m++)k[m].toLowerCase().substr(0,l.toLowerCase().length)===l.toLowerCase()&&(g[i]=!0);break;case"endswith":for(var m=0;m<k.length;m++)k[m].toLowerCase().substr(k[m].toLowerCase().length-l.toLowerCase().length)===l.toLowerCase()&&(g[i]=!0);break;case"contains":for(var m=0;m<k.length;m++)k[m].toLowerCase().indexOf(l)>=0&&(g[i]=!0)}}istrue=!0;for(var n in g)if(g[n]===!1){istrue=!1;break}e.push(istrue)}var r,o=jQuery("#conditional-"+a+"-tmpl").html(),p=jQuery("#conditional_"+a),q=jQuery('[data-field="'+a+'"]');e.length&&e.indexOf(!0)>=0?"show"===c?r="show":"hide"===c?r="hide":"disable"===c&&(r="disable"):r="show"===c?"hide":"disable"===c?"enable":"show","show"===r?p.html().length||(p.html(o).trigger("cf.add"),jQuery(document).trigger("cf.add")):"hide"===r?p.html().length&&(q.val("").empty().prop("checked",!1),p.empty().trigger("cf.remove"),jQuery(document).trigger("cf.remove")):"enable"===r?p.html().length?q.prop("disabled",!1):(p.html(o).trigger("cf.add"),jQuery(document).trigger("cf.add")):"disable"===r&&(p.html().length?(q.prop("disabled","disabled"),jQuery(document).trigger("cf.disable")):(p.html(o).trigger("cf.add"),jQuery(document).trigger("cf.add"),jQuery('[data-field="'+a+'"]').prop("disabled","disabled")))}}}Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=this.length>>>0,c=Number(arguments[1])||0;for(c=0>c?Math.ceil(c):Math.floor(c),0>c&&(c+=b);b>c;c++)if(c in this&&this[c]===a)return c;return-1}),"undefined"!=typeof caldera_conditionals&&(jQuery(".caldera_forms_form").on("change keyup","[data-field]",function(){b()}),b())}(jQuery);
assets/js/edit.js CHANGED
@@ -63,50 +63,15 @@ jQuery(document).ready(function($){
63
tinyMCE.triggerSave();
64
}
65
66
- var config = {},
67
- data_fields = $('.caldera-forms-options-form').find('input,radio,checkbox,select,textarea'),
68
- objects = [],
69
- arraynames = {};
70
-
71
- //data_fields.each(function(k,v){
72
- for( var v = 0; v < data_fields.length; v++){
73
- if( data_fields[v].getAttribute('name') === null){
74
- continue;
75
- }
76
- var field = $(data_fields[v]),
77
- basename = field.prop('name').replace(/\[/gi,':').replace(/\]/gi,''),//.split('[' + id + ']')[1].substr(1),
78
- name = basename.split(':'),
79
- value = ( field.is(':checkbox,:radio') ? field.filter(':checked').val() : field.val() ),
80
- lineconf = {};
81
-
82
- for(var i = name.length-1; i >= 0; i--){
83
- var nestname = name[i];
84
- if(nestname.length === 0){
85
- if( typeof arraynames[name[i-1]] === 'undefined'){
86
- arraynames[name[i-1]] = 0;
87
- }else{
88
- arraynames[name[i-1]] += 1;
89
- }
90
- nestname = arraynames[name[i-1]];
91
- }
92
- if(i === name.length-1){
93
- lineconf[nestname] = value;
94
- }else{
95
- var newobj = lineconf;
96
- lineconf = {};
97
- lineconf[nestname] = newobj;
98
- }
99
- }
100
-
101
- $.extend(true, config, lineconf);
102
- };
103
-
104
- $(el).data('cf_edit_nonce', config.cf_edit_nonce);
105
- $(el).data('_wp_http_referer', config._wp_http_referer);
106
- $(el).data('sender', 'ajax');
107
- $(el).data('config', JSON.stringify(config.config));
108
109
return true;
110
},
111
callback: function( obj ){
112
@@ -800,7 +765,7 @@ jQuery(document).ready(function($){
800
$('.caldera-editor-body').on('focus', '.caldera-field-bind', function(e){
801
var field = $(this),
802
value = this.value;
803
-
804
if(e.type && e.type === 'focusin'){
805
field.removeClass('bound_field').addClass('reload-binding');
806
rebind_field_bindings();
@@ -1297,7 +1262,7 @@ rebuild_field_binding = function(){
1297
};
1298
1299
// bind names
1300
- jQuery('option.bound-field').trigger('change').each(function(k,v){
1301
var bind = jQuery(v);
1302
if(bind.prop('value').indexOf('{') !== 0){
1303
bind.text( jQuery('#' + bind.prop('value') + '_lable').val() + ' ['+jQuery('#' + bind.prop('value') + '_lable').val() +']');
@@ -1315,8 +1280,6 @@ rebuild_field_binding = function(){
1315
1316
rebind_field_bindings = function(){
1317
1318
- //check_required_bindings();
1319
- //console.log('- rebuild_field_binding');
1320
//return;
1321
var bindings = jQuery('.caldera-field-bind').not('.bound_field'),
1322
type_instances,
@@ -1325,8 +1288,8 @@ rebind_field_bindings = function(){
1325
1326
1327
if(!bindings.length){
1328
- var bound = jQuery('.caldera-field-bind.bound_field');
1329
- bound.trigger('change');
1330
return;
1331
}
1332
63
tinyMCE.triggerSave();
64
}
65
66
+ var data_fields = $('.caldera-forms-options-form').formJSON();
67
68
+ $(el).data('cf_edit_nonce', data_fields.cf_edit_nonce);
69
+ $(el).data('_wp_http_referer', data_fields._wp_http_referer);
70
+ $(el).data('sender', 'ajax');
71
+ $(el).data('config', JSON.stringify(data_fields.config));
72
+
73
return true;
74
+
75
},
76
callback: function( obj ){
77
765
$('.caldera-editor-body').on('focus', '.caldera-field-bind', function(e){
766
var field = $(this),
767
value = this.value;
768
+ console.log( e.type );
769
if(e.type && e.type === 'focusin'){
770
field.removeClass('bound_field').addClass('reload-binding');
771
rebind_field_bindings();
1262
};
1263
1264
// bind names
1265
+ jQuery('option.bound-field').trigger('change').each(function(k,v){
1266
var bind = jQuery(v);
1267
if(bind.prop('value').indexOf('{') !== 0){
1268
bind.text( jQuery('#' + bind.prop('value') + '_lable').val() + ' ['+jQuery('#' + bind.prop('value') + '_lable').val() +']');
1280
1281
rebind_field_bindings = function(){
1282
1283
//return;
1284
var bindings = jQuery('.caldera-field-bind').not('.bound_field'),
1285
type_instances,
1288
1289
1290
if(!bindings.length){
1291
+ //var bound = jQuery('.caldera-field-bind.bound_field');
1292
+ //bound.trigger('change');
1293
return;
1294
}
1295
assets/js/edit.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function new_conditional_group(a){var b=a.trigger.data("id"),c="cl"+Math.round(18746582734*Math.random()),d="rw"+Math.round(98347598345*Math.random()),e=[{id:d,type:a.trigger.data("type"),lines:[{id:c}]}];return{group:e,id:b}}function new_conditional_line(a){var b=a.trigger.data("id"),c=a.trigger.data("group"),d=a.trigger.data("type"),e="cl"+Math.round(18746582734*Math.random()),f={id:b,type:d,lineid:e,rowid:c,name:"config["+d+"]["+b+"][conditions][group]["+c+"]["+e+"]"};return f}function build_conditions_config(a){var b=JSON.parse(a.trigger.val());return b.id=a.trigger.data("id"),b}function setup_field_type(a){return{id:a.trigger.prop("id")}}function check_required_bindings(a){var b,d=(jQuery(".caldera-header-save-button"),jQuery(".layout-form-field")),e=jQuery(".caldera-processor-nav"),f=!0;b=a?jQuery(a):jQuery(".caldera-config-field .required"),b.removeClass("has-error"),d.removeClass("has-error"),e.removeClass("has-error"),jQuery(".error-tag").remove(),required_errors={},b.each(function(a,b){var c=jQuery(b),d=c.closest(".caldera-config-editor-panel");if(b.value.length){if(c.hasClass("field-slug"))for(var h=jQuery(".field-slug").not(c),i=0;i<h.length;i++)if(h[i].value===b.value){var c=jQuery(h[i]);required_errors[d.prop("id")]||(required_errors[d.prop("id")]=0);var e=c.closest(".caldera-editor-field-config-wrapper"),g=c.closest(".caldera-editor-processor-config-wrapper");e.length&&jQuery('.layout-form-field[data-config="'+e.prop("id")+'"]').addClass("has-error"),g.length&&jQuery("."+g.prop("id")).addClass("has-error"),required_errors[d.prop("id")]+=1,c.addClass("has-error");break}}else{required_errors[d.prop("id")]||(required_errors[d.prop("id")]=0);var e=c.closest(".caldera-editor-field-config-wrapper"),g=c.closest(".caldera-editor-processor-config-wrapper");e.length&&jQuery('.layout-form-field[data-config="'+e.prop("id")+'"]').addClass("has-error"),g.length&&jQuery("."+g.prop("id")).addClass("has-error"),required_errors[d.prop("id")]+=1,c.addClass("has-error"),f=!1}});for(var g in required_errors)jQuery(".caldera-forms-options-form").find('a[href="#'+g+'"]').append('<span class="error-tag">'+required_errors[g]+"</span>");return jQuery(".preview-caldera-config-group button:submit").length?(jQuery(".mailer-errors").hide(),jQuery(".mailer-control-panel").show()):(jQuery(".mailer-errors").show(),jQuery(".mailer-control-panel").hide()),jQuery(".caldera-conditional-field-set").trigger("change"),f}jQuery(document).ready(function(a){function b(b){var d=a(b),e=d.closest(".caldera-editor-field-config-wrapper"),f=e.find(".caldera-config-field-setup"),g=compiled_templates[d.val()+"_tmpl"]?compiled_templates[d.val()+"_tmpl"]:compiled_templates.noconfig_field_templ,h=e.find(".field_config_string").val(),i=d.data("type");if(e.find(".caldera-config-group").show(),d.addClass("field-initialized"),h=h.length&&i===d.val()?JSON.parse(h):fieldtype_defaults[d.val()+"_cfg"],h||(h={}),h._id=d.data("field"),h._name="config[fields]["+d.data("field")+"][config]",g=a("<div>").html(g(h)),f.html(g.html()),"function"==typeof window[d.val()+"_init"]&&window[d.val()+"_init"](d.data("field"),f),fieldtype_defaults[d.val()+"_nosupport"]&&(fieldtype_defaults[d.val()+"_nosupport"].indexOf("hide_label")>=0&&e.find(".hide-label-field").hide().find(".field-config").prop("checked",!1),fieldtype_defaults[d.val()+"_nosupport"].indexOf("caption")>=0&&e.find(".caption-field").hide().find(".field-config").val(""),fieldtype_defaults[d.val()+"_nosupport"].indexOf("caption")>=0&&e.find(".caption-field").hide().find(".field-config").val(""),fieldtype_defaults[d.val()+"_nosupport"].indexOf("custom_class")>=0&&e.find(".customclass-field").hide().find(".field-config").val(""),fieldtype_defaults[d.val()+"_nosupport"].indexOf("entry_list")>=0&&e.find(".entrylist-field").hide().find(".field-config").prop("checked",!1)),e.find(".toggle_show_values").trigger("change"),!a(".caldera-select-field-type").not(".field-initialized").length){if(core_form.hasClass("builder-loaded"))c(d.data("field"));else{for(var j=a(".caldera-select-field-type.field-initialized"),k=0;k<j.length;k++)c(a(j[k]).data("field"));core_form.addClass("builder-loaded")}rebuild_field_binding(),baldrickTriggers()}}function c(b){var c=a("#"+b),d=c.find(".caldera-select-field-type"),e=a('.layout-form-field[data-config="'+b+'"]'),f=e.find(".field_preview"),h=(a("#preview-"+d.val()+"_tmpl").html(),compiled_templates["preview-"+d.val()+"_tmpl"]),i={id:b},j=c.find(".field-config");j.each(function(c,d){for(var e=a(d),f=e.prop("name").split("["+b+"]")[1].substr(1),g=f.substr(0,f.length-1).split("]["),h=e.is(":checkbox,:radio")?e.filter(":checked").val():e.val(),j={},k=g.length-1;k>=0;k--)if(k===g.length-1)j[g[k]]=h;else{var l=j;j={},j[g[k]]=l}a.extend(!0,i,j)}),f.html(h(i)),e.removeClass("button"),a(".preview-field-config").prop("disabled",!0)}function d(b){var t,c=a(".caldera-editor-fields-panel"),e=(a(".caldera-editor-groups-panel"),a(".caldera-group-nav")),f=a('[data-group="'+b+'"]'),g=f.find(".caldera-config-group-name"),h=f.find(".caldera-config-group-slug"),i=f.find(".caldera-config-group-desc"),j=f.find(".caldera-config-group-admin"),k=a(".active-group-name"),l=a(".active-group-slug"),m=a(".active-group-desc"),n=a(".active-group-admin"),o=a(".caldera-editor-fields-list ul"),p=f.find(".caldera-config-group-repeat"),q=a(".repeat-config-button"),s=(a(".caldera-editor-group-settings"),a(".caldera-config-group-remove"));a(".new-group-input").remove(),a(".new-field-input").remove(),e.removeClass("active"),c.show(),o.hide(),o.removeClass("active").find("li.active").removeClass("active"),o.hide(),f.addClass("active"),t=a(".caldera-editor-fields-list ul.active li"),t.length?s.hide():s.show(),a(".caldera-editor-field-config-wrapper").hide(),f.show(),k.val(g.val()),l.val(h.val()),m.val(i.val()),"1"===j.val()?n.prop("checked",!0):n.prop("checked",!1),"1"===p.val()?q.addClass("field-edit-open"):q.removeClass("field-edit-open")}a(".caldera-header-save-button").baldrick({method:"POST",request:"admin.php?page=caldera-forms",before:function(b,c){if(c.preventDefault(),!check_required_bindings())return!1;a("#save_indicator").addClass("loading"),tinyMCE&&tinyMCE.triggerSave();for(var d={},e=a(".caldera-forms-options-form").find("input,radio,checkbox,select,textarea"),g={},h=0;h<e.length;h++)if(null!==e[h].getAttribute("name")){for(var i=a(e[h]),j=i.prop("name").replace(/\[/gi,":").replace(/\]/gi,""),k=j.split(":"),l=i.is(":checkbox,:radio")?i.filter(":checked").val():i.val(),m={},n=k.length-1;n>=0;n--){var o=k[n];if(0===o.length&&("undefined"==typeof g[k[n-1]]?g[k[n-1]]=0:g[k[n-1]]+=1,o=g[k[n-1]]),n===k.length-1)m[o]=l;else{var p=m;m={},m[o]=p}}a.extend(!0,d,m)}return a(b).data("cf_edit_nonce",d.cf_edit_nonce),a(b).data("_wp_http_referer",d._wp_http_referer),a(b).data("sender","ajax"),a(b).data("config",JSON.stringify(d.config)),!0},callback:function(b){if(!1===b.data){var c=a(".updated_notice_box");c.stop().animate({top:0},200,function(){setTimeout(function(){c.stop().animate({top:-75},200)},2e3)})}},complete:function(){a(".wrapper-instance-pane .field-config").prop("disabled",!1)}}),a("body").on("click",".toggle_option_tab > a",function(b){b.preventDefault();var c=a(this),d=a(c.attr("href")),e=c.parent().find("a"),f=c.closest(".caldera-editor-config-wrapper").find(".wrapper-instance-pane");e.removeClass("button-primary"),f.hide(),d.show(),c.addClass("button-primary"),a(".caldera-conditionals-usetype").trigger("change")}),a(".caldera-editor-body").on("change",".caldera-select-field-type",function(){b(this)}),a(".caldera-editor-body").on("click",".caldera-group-nav a",function(b){b.preventDefault(),d(a(this).attr("href").substr(1))}),a(".caldera-editor-body").on("click",".caldera-editor-fields-list a",function(b){b.preventDefault();var c=a(this),d=a(c.attr("href"));a(".new-group-input").remove(),a(".new-field-input").remove(),a(".caldera-editor-fields-list li.active").removeClass("active"),c.parent().addClass("active"),a(".caldera-editor-field-config-wrapper").hide(),d.show()}),a(".caldera-editor-body").on("click",".group-config-button",function(){var c=a(this),d=a(".caldera-editor-group-settings"),e=c.closest(".caldera-editor-fields-panel"),f=a(".caldera-config-group-remove");e.find(".caldera-field-line").length?f.hide():f.show(),c.hasClass("field-edit-open")?(d.slideUp(100),c.removeClass("field-edit-open")):(d.slideDown(100),c.addClass("field-edit-open"))}),a(".caldera-editor-body").on("keydown",".field-config",function(b){a(this).is("textarea")||13===b.which&&b.preventDefault()}),a(".caldera-editor-body").on("change",".field-label",function(b){var c=a(this).closest(".caldera-editor-field-config-wrapper").prop("id");field_line=a('[data-field="'+c+'"]'),field_title=a("#"+c+" .caldera-editor-field-title, .layout-form-field.field-edit-open .layout_field_name"),slug=a("#"+c+" .field-slug"),field_line.find("a").html('<i class="icn-field"></i> '+this.value),field_title.text(this.value),"change"===b.type&&slug.trigger("change"),rebuild_field_binding()}),a(".caldera-editor-body").on("change",".active-group-name",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find(".caldera-config-group-name")),f=c.find("span");"focusout"!==b.type||this.value.length||(this.value="Group "+(parseInt(c.index())+1)),e.val(this.value),f.text(this.value)}),a(".caldera-editor-body").on("change",".active-group-slug",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find(".caldera-config-group-name").val()),f=c.find(".caldera-config-group-slug"),h=(c.find("span"),this.value.replace(/[^a-z0-9]/gi,"_").toLowerCase());"focusout"!==b.type||this.value.length||(h=e.replace(/[^a-z0-9]/gi,"_").toLowerCase()),f.val(h),this.value=h}),a(".caldera-editor-body").on("change",".active-group-desc",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find(".caldera-config-group-desc"));e.val(this.value)}),a(".caldera-editor-body").on("change",".active-group-admin",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),f=(c.data("group"),c.find(".caldera-config-group-name").val(),c.find(".caldera-config-group-admin"));c.find("span"),this.value.replace(/[^a-z0-9]/gi,"_").toLowerCase(),a(this).prop("checked")?(f.val(1),c.addClass("is-admin")):(f.val(0),c.removeClass("is-admin"))}),a(".caldera-editor-body").on("click",".repeat-config-button",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find("a .group-type")),f=c.find(".caldera-config-group-repeat"),g=a(this);g.hasClass("field-edit-open")?(f.val("0"),e.removeClass("icn-repeat").addClass("icn-folder"),g.removeClass("field-edit-open")):(f.val("1"),e.addClass("icn-repeat").removeClass("icn-folder"),g.addClass("field-edit-open"))}),a(".caldera-editor-body").on("click",".delete-field",function(){var b=a(this),c=b.closest(".caldera-editor-field-config-wrapper").prop("id");confirm(b.data("confirm"))&&(a("#"+c).remove(),a('option[value="'+c+'"]').remove(),a('[data-bind="'+c+'"]').remove(),delete current_form_fields[c],a('[data-config="'+c+'"]').slideUp(200,function(){var b=a(this);b.remove(),rebuild_field_binding(),a(document).trigger("field.removed")}))}),a(".caldera-editor-body").on("click",".add-new-group,.add-field",function(){var b=a(this);if(a(".new-group-input").remove(),a(".new-field-input").remove(),b.hasClass("add-field")){var c=a('<input type="text" class="new-field-input block-input">');c.appendTo(a(".caldera-editor-fields-list ul.active")).focus()}else{var d=a('<input type="text" class="new-group-input block-input">');d.appendTo(a(".caldera-editor-groups-panel")).focus()}}),a(".caldera-editor-body").on("change keypress",".new-group-input",function(b){if("keypress"===b.type){if(13!==b.which)return;b.preventDefault()}var h,i,c=this.value,e=a(this),f=a(".caldera-editor-groups-panel ul"),g=a(".caldera-editor-fields-list");if(c.length){h=Handlebars.compile(a("#caldera_group_line_templ").html()),i={id:c.replace(/[^a-z0-9]/gi,"_").toLowerCase(),name:c},f.append(h(i));var j=a('<ul data-group="'+i.id+'">').hide();j.appendTo(g),e.remove(),d(i.id)}else e.remove()}),a(".caldera-editor-body").on("change keypress",".new-field-input",function(b){if("keypress"===b.type){if(13!==b.which)return;b.preventDefault()}var g,h,i,c=this.value,d=a(this),e=d.parent(),f=a(".caldera-editor-field-config"),j=a(".caldera-config-group-remove");if(c.length){j.hide(),g=Handlebars.compile(a("#caldera_field_line_templ").html()),h=Handlebars.compile(a("#caldera_field_config_wrapper_templ").html()),i={id:c.replace(/[^a-z0-9]/gi,"_").toLowerCase(),label:c,slug:c.replace(/[^a-z0-9]/gi,"_").toLowerCase(),group:a(".caldera-group-nav.active").data("group")};var k=a(g(i));k.appendTo(e),f.append(h(i)),k.find("a").trigger("click"),d.remove()}else d.remove()}),a(".caldera-editor-body").on("change",".field-slug",function(b){this.value.length?this.value=this.value.replace(/[^a-z0-9]/gi,"_").toLowerCase():"change"===b.type&&(this.value=a(this).closest(".caldera-editor-field-config-wrapper").find(".field-label").val().replace(/[^a-z0-9]/gi,"_").toLowerCase())}),a(".caldera-editor-body").on("click",".caldera-add-group",function(){var c=a(this),d=c.data("group"),e=a("#"+d+"_panel_tmpl").html();c.parent().parent().append(e)}),a(".caldera-editor-body").on("click",".caldera-config-group-remove",function(){var c=a(".active-group-slug").val();a('[data-group="'+c+'"]').hide(0,function(){a(this).remove();var b=a(".caldera-group-nav");b.length?b.first().find("a").trigger("click"):a(".caldera-editor-fields-panel").hide()})}),a("body").on("click",".set-current-field",function(b){b.preventDefault();var c=a(this);a("#"+c.data("field")+"_type").val(c.data("type")).trigger("change"),a("#"+c.data("field")+"_lable").focus(),a("#field_setup_baldrickModalCloser").trigger("click")}),a(".caldera-editor-body").on("change",".field-config",function(){var d=a(this),e=d.closest(".caldera-editor-field-config-wrapper");current_form_fields&&(d.prop("id")===e.prop("id")+"_lable"&&(current_form_fields[e.prop("id")].label=this.value),d.prop("id")===e.prop("id")+"_slug"&&(current_form_fields[e.prop("id")].slug=this.value),d.prop("id")===e.prop("id")+"_type"&&(current_form_fields[e.prop("id")].type=this.value),e.length&&c(e.prop("id")))}),a(".caldera-editor-body").on("focus",".caldera-field-bind",function(b){var c=a(this),d=this.value;return b.type&&"focusin"===b.type?(c.removeClass("bound_field").addClass("reload-binding"),rebind_field_bindings(),this.value=d,void 0):void 0}),a(".caldera-editor-body").on("change",".caldera-conditional-field-set",function(){var k,l,c=a(this),d=c.parent().find(".compare-type"),e=c.data("condition"),f=c.data("id"),g="config["+e+"]["+f+"][conditions][group]["+c.data("row")+"]["+c.data("line")+"]",h=c.data("line"),i=a("#"+h+"_value"),j=i.find(".caldera-conditional-value-field").first(),m=[],n=this.value;if("{"!==n.substr(0,1)&&(k=a("#"+n),l=k.find(".field-button-type"),m=k.find(".caldera-config-group-toggle-options")),c.hasClass(".bind_init")&&c.addClass("bound_triggered"),j.length&&j.val().length&&i.data("value",j.val()),d.show(),m.length){var o=m.find(".toggle_option_row"),p='<select name="'+g+'[value]" class="caldera-processor-value-bind caldera-conditional-value-field" data-field="'+n+'" style="max-width: 220px; width: 220px;">';p+='<option value=""></option>',o.each(function(b,c){var d=a(c).find(".toggle_label_field"),e=d.data("option"),f="";i.data("value")&&(i.data("value").toString()===e||i.data("value").toString()===a(c).find(".toggle_value_field").val())&&(f=' selected="selected"'),p+='<option value="'+e+'"'+f+">"+d.val()+"</option>"}),p+="</select>"}else l&&"button"==l.val()?(d.val("is").hide(),p='<select name="'+g+'[value]" class="caldera-processor-value-bind caldera-conditional-value-field" data-field="'+n+'" style="max-width: 220px; width: 220px;">',p+='<option value="click" '+("click"===i.data("value")?'selected="selected"':"")+">Click</option>",p+='<option value="dblclick" '+("dblclick"===i.data("value")?'selected="selected"':"")+">Double Click</option>",p+="</select>"):p='<input name="'+g+'[value]" type="text" class="caldera-conditional-value-field magic-tag-enabled" value="'+(i.data("value")?i.data("value"):"")+'" style="max-width: 205px;">';i.html(p),init_magic_tags()}),a(".caldera-editor-body").on("change",".caldera-conditionals-usetype",function(){var c=a(this);""!==this.value?(a("#"+c.data("id")+"_condition_group_add").show(),a("#"+c.data("id")+"_conditional_wrap").show()):(a("#"+c.data("id")+"_condition_group_add").hide(),a("#"+c.data("id")+"_conditional_wrap").hide())}),a(".caldera-editor-body").on("click",".remove-conditional-line",function(b){b.preventDefault();var c=a(this),d=c.closest(".caldera-condition-line"),e=c.closest(".caldera-condition-group");d.remove(),e.find(".caldera-condition-line").length||e.remove()}),a(".caldera-group-nav").first().find("a").trigger("click"),a(".caldera-editor-body").on("change",".toggle_show_values",function(){var c=a(this),d=c.closest(".caldera-config-group-toggle-options");values=d.find(".toggle_value_field"),lables=d.find(".toggle_label_field"),field_lables=d.find(".caldera-config-group-option-labels"),c.prop("checked")?(values.show().parent().show(),values.show().parent().parent().show(),lables.css("width",""),field_lables.show()):(values.hide().parent().hide(),lables.css("width",245),field_lables.hide()),lables.trigger("toggle.values"),init_magic_tags()}),a(".caldera-editor-body").on("change",".auto-populate-type",function(){a(this).closest(".wrapper-instance-pane").find(".auto-populate-options").trigger("change")}),a(".caldera-editor-body").on("change",".auto-populate-options",function(){var b=a(this),c=b.closest(".wrapper-instance-pane"),d=c.find(".caldera-config-group-toggle-options"),e=c.find(".caldera-config-group-auto-options"),f=e.find(".auto-populate-type");e.find(".auto-populate-type-panel").hide(),b.prop("checked")?(d.hide(),e.show()):(d.show(),e.hide()),e.find(".caldera-config-group-auto-"+f.val()).show()}),a("body").on("change",".pin-toggle-roles",function(){var b=a(this),c=a("#caldera-pin-rules");"1"===b.val()?c.show():c.hide()}),a("body").on("click",".magic-tag-init",function(){var c=a(this),d=c.prev();d.focus().trigger("init.magic")}),a("body").on("keyup blur focus select click init.magic",".magic-tag-enabled",function(b){init_magic_tags();var c=a(this),d=c.parent(),e=d.closest(".wrapper-instance-pane").find(".caldera-select-field-type").val()?d.closest(".wrapper-instance-pane").find(".caldera-select-field-type").val():"hidden",f=d.find(".magic-tags-autocomplete"),g=f.find("ul"),h=this.value,j=[],k="",l=this.selectionStart,m=this.selectionEnd;if(f.length&&f.data("focus"))return b.preventDefault(),void 0;if(c.data("tag",""),this.selectionEnd>this.selectionStart)k=this.value.substr(this.selectionStart,this.selectionEnd-this.selectionStart);else if(("select"===b.type||"keyup"===b.type)&&40!==b.which&&38!==b.which&&39!==b.which&&37!==b.which){for(l=this.selectionStart;l>0;l--){var n=h.substr(l-1,1);if(" "===n||"\n"===n||("%"===n||"}"===n)&&this.selectionStart===l)break}for(m=this.selectionStart;m<h.length;m++){var n=h.substr(m,1);if(" "===n||"\n"===n||("%"===n||"{"===n)&&this.selectionStart===m)break}k=h.substr(l,m-l)}if("focusout"!==b.type){if("init"!==b.type&&k.length<3)return f.length&&f.remove(),void 0;f.length||(f=a('<div class="magic-tags-autocomplete"></div>'),g=a("<ul></ul>"),g.appendTo(f),f.insertAfter(c),f.on("mouseenter",function(){a(this).data("focus",!0)}),f.on("mouseleave",function(){a(this).data("focus",!1),c.is(":focus")||c.trigger("focusout")})),g.empty();var o="system",p=!1;"hidden"===e||"dropdown"===e||"radio"===e||"toggle_switch"===e||"checkbox"===e?(p=!0,e="text",o="all"):("paragraph"===e||"html"===e)&&(e="text"),c.data("type")&&(e=c.data("type")),e=e.split(","),e.push("vars");for(var q=0;q<e.length;q++)for(var r in system_values)if("undefined"!=typeof system_values[r].tags[e[q]]){if(j=[r],"system"!==r&&"variable"!==r&&"field"!==r){var s=jQuery(".processor-"+r),t=c.closest(".caldera-editor-processor-config-wrapper"),u=t.prop("id");j=[];for(var v=0;v<s.length;v++)if(t.length||p!==!0){if(u===s[v].id)continue;jQuery("li."+s[v].id).index()<jQuery("li."+u).index()&&j.push(s[v].id)}else j.push(s[v].id)}for(var w=0;w<j.length;w++)if("all"===o||o===r||"variable"===r){var x=a('<li class="header">'+system_values[r].type+(w>0?" ["+(w+1)+"]":"")+"</li>"),y=0;x.appendTo(g);for(var z=0;z<system_values[r].tags[e[q]].length;z++)if(!c.data("parent")||"variable:"+c.data("parent")!==system_values[r].tags[e[q]][z]){var A=system_values[r].wrap[0]+system_values[r].tags[e[q]][z]+system_values[r].wrap[1];if(j[w]!==r&&j.length>1&&(A=system_values[r].wrap[0]+system_values[r].tags[e[q]][z]+":"+j[w]+system_values[r].wrap[1]),A.indexOf(k)>=0||"init"===b.type){y+=1;var B=A.replace(k,"<strong>"+k+"</strong>"),C=a('<li class="tag" data-tag="'+A+'">'+B+"</li>");C.on("click",function(){var b=a(this).data("tag");c.val(h.substr(0,l)+b+h.substr(m)).trigger("change").focus(),c[0].selectionStart=l+b.length-(b.indexOf("*")>0?2:0),c[0].selectionEnd=l+b.length-(b.indexOf("*")>0?1:0)}),C.appendTo(g)}}0===y&&x.remove()}}}g.children().length||f.remove(),"focusout"===b.type&&setTimeout(function(){f.remove()},200)});for(var e=a(".cf-editor-template"),f=0;f<e.length;f++)compiled_templates[e[f].id]=Handlebars.compile(e[f].innerHTML);a(".caldera-select-field-type").not(".field-initialized").each(function(a,c){b(c)})});var rebuild_field_binding,rebind_field_bindings,current_form_fields={},required_errors={},add_new_grid_page,add_page_grid,init_magic_tags,core_form,compiled_templates={};init_magic_tags=function(){var a=jQuery(".magic-tag-enabled");a.each(function(a,b){var c=jQuery(b);if(c.hasClass("magic-tag-init-bound")){var d=c.parent().find(".magic-tag-init");return c.is(":visible")?d.show():d.hide(),void 0}var e=jQuery('<span class="icn-code magic-tag-init"></span>'),f=jQuery('<span style="position:relative;display:inline-block; width:100%;"></span>');c.is("input")&&e.css("borderBottom","none"),c.hasClass("caldera-conditional-value-field")&&f.width("auto"),c.wrap(f),e.insertAfter(c),c.addClass("magic-tag-init-bound"),c.is(":visible")?e.show():e.hide()})},rebuild_field_binding=function(){if(core_form||(core_form=jQuery(".caldera-forms-options-form")),core_form.hasClass("builder-loaded")){var a=jQuery(".caldera-editor-field-config-wrapper");system_values.field={tags:{text:[]},type:"Fields",wrap:["%","%"]};for(var b=0;b<a.length;b++){var c=a[b].id,d=jQuery("#"+c+"_lable").val(),e=jQuery("#"+c+"_slug").val(),f=jQuery("#"+c+"_type").val();"undefined"==typeof system_values.field.tags[f]&&(system_values.field.tags[f]=[]),system_values.field.tags[f].push(e),"text"!==f&&system_values.field.tags.text.push(e),current_form_fields[c]={label:d,slug:e,type:f},jQuery("option.bound-field").trigger("change").each(function(a,b){var c=jQuery(b);0!==c.prop("value").indexOf("{")?c.text(jQuery("#"+c.prop("value")+"_lable").val()+" ["+jQuery("#"+c.prop("value")+"_lable").val()+"]"):c.text(c.prop("value").replace("{","").replace("}",""))}).removeClass("bound-field")}}},rebind_field_bindings=function(){var b,c,a=jQuery(".caldera-field-bind").not(".bound_field");if(!a.length){var d=jQuery(".caldera-field-bind.bound_field");return d.trigger("change"),void 0}a.addClass("bound_field");for(var e=0;e<a.length;e++){var f=jQuery(a[e]),g=f.val(),h=f.data("default"),i=f.data("exclude"),j=0,k=f.closest(".caldera-editor-processor-config-wrapper"),l=k.prop("id"),m="";if(h&&!f.hasClass("reload-binding")&&(g=h),f.is("select")){f.empty();var n=jQuery('<optgroup label="Fields">');for(var o in current_form_fields)f.data("type")&&f.data("type").split(",").indexOf(current_form_fields[o].type)<0||(f.data("id")!==o&&n.append('<option value="'+o+'"'+(g===o?'selected="selected"':"")+">"+current_form_fields[o].label+" ["+current_form_fields[o].slug+"]</option>"),j+=1);n.appendTo(f),0===j&&f.empty();for(var p in system_values)if(b=[],!(i&&i.split(",").indexOf(p)>=0)){if("system"!==p&&"variable"!==p)for(var q=jQuery(".processor-"+p),r=0;r<q.length;r++)l!==q[r].id&&(b.push(q[r].id),q.length>1&&(c=jQuery("li."+q[r].id+" .processor-line-number"))&&c.html("["+(r+1)+"]"));else b.push("__system__");var s=[];f.data("type")?(s=f.data("type").split(","),s.push("vars")):s=["text","vars"];for(var t=0;t<s.length;t++)if(system_values[p].tags[s[t]])for(var u=0;u<b.length;u++){jQuery("li."+b[u]).index()>jQuery("li."+l).index()&&"__system__"!==b[u]?f.closest(".caldera-editor-processors-panel-wrap").length&&(m=' disabled="disabled"'):m="";for(var n=jQuery('<optgroup label="'+system_values[p].type+("__system__"!==b[u]?" "+jQuery("li."+b[u]).find(".processor-line-number").html():"")+'"'+m+">"),v=0;v<system_values[p].tags[s[t]].length;v++){var w=system_values[p].tags[s[t]][v];"__system__"!==b[u]&&(w=w.replace(p,b[u])),n.append('<option value="{'+w+'}"'+(g==="{"+w+"}"?'selected="selected"':"")+m+">"+system_values[p].tags[s[t]][v]+"</option>"),j+=1}n.children().length&&n.appendTo(f)}}if(0===j){if(f.empty(),f.data("type")){f.append('<option value="">No '+f.data("type").split(",").join(" or ")+" in form</option>");var x=!0}}else f.prop("disabled",!1);f.hasClass("required")||"undefined"!=typeof x||f.prepend('<option value=""></option>'),f.val(g)}}init_magic_tags(),jQuery(document).trigger("bound.fields"),jQuery(".caldera-header-save-button").prop("disabled",!1)},jQuery(document).ready(function(a){function b(){var b=a(".layout-grid-panel"),c=0;b.each(function(b,d){var e=a(d),f=e.find(".layout-structure"),g=e.find(".row"),h=[];g.each(function(b,d){var e=a(d),f=e.children().not(".column-merge"),g=[];c+=1,f.each(function(b,d){span=a(d).attr("class").split("-"),g.push(span[2]);var e=a(d).find(".field-location");e.length&&e.each(function(d,e){var f=a(e);f.val(c+":"+(b+1)).removeAttr("disabled")})}),h.push(g.join(":"))}),f.val(h.join("|"))})}function c(b,c,e){var i,j,f="fld_"+Math.round(1e7*Math.random()),g=f,h=a("#field_config_panels");if(e){var k=a("#"+e).clone().wrap("<div>").parent().html().replace(new RegExp(e,"g"),"{{id}}");i=Handlebars.compile(k)}else i=Handlebars.compile(a("#caldera_field_config_wrapper_templ").html());j={id:g,label:"",slug:""},h.append(i(j)),b.removeClass("button-small").removeClass("button").removeClass("button-primary").removeClass("ui-draggable").removeClass("layout-new-form-field").addClass("layout-form-field").attr("data-config",f),b.find(".layout_field_name").remove(),b.find(".field-location").prop("name","config[layout_grid][fields]["+f+"]"),b.find(".settings-panel").show(),b.appendTo(c),d(),b.find(".icon-edit").trigger("click"),a("#"+f+"_lable").focus().select(),e&&(h.find(".field_config_string").val(""),h.find(".field-label").trigger("change")),rebuild_field_binding(),baldrickTriggers(),a("#"+f).trigger("field.drop"),a(document).trigger("field.added")}function d(){a(".toggle-options").sortable({handle:".dashicons-sort"}),a("#grid-pages-panel").sortable({placeholder:"row-drop-helper",handle:".sort-handle",items:".first-row-level",axis:"y",stop:function(){b()}}),a(".layout-column").sortable({connectWith:".layout-column",appendTo:"#grid-pages-panel",helper:"clone",items:".layout-form-field",handle:".drag-handle",cursor:"move",opacity:.7,cursorAt:{left:100,top:15},start:function(a,b){b.helper.css({width:"200px",height:"35px",paddingTop:"20px"})},stop:function(a,c){c.item.removeAttr("style"),b()}}),a("h3 .layout-new-form-field").draggable({helper:"clone",appendTo:"body"}),a(".page-toggle.button").droppable({accept:".layout-form-field",over:function(){a(this).trigger("click"),a(".layout-column").sortable("refresh")}}),a(".layout-column").droppable({greedy:!0,activeClass:"ui-state-dropper",hoverClass:"ui-state-hoverable",accept:".layout-new-form-field",drop:function(b,d){var e=d.draggable.clone(),f=a(this);c(e,f)}}),b()}add_new_grid_page=function(){return{page_no:"pg_"+Math.round(1e7*Math.random())}},add_page_grid=function(b){var c=a(".page-toggle").length+1,e=a('<button type="button" data-name="Page '+c+'" data-page="'+b.rawData.page_no+'" class="page-toggle button">'+b.params.trigger.data("addtitle")+" "+c+"</button> "),f=a("#page-toggles");e.appendTo(f),f.show(),d(),e.trigger("click"),1===c&&f.hide(),a(document).trigger("add.page")},a(document).on("remove.page add.page load.page",function(){var c=a(".page-toggle").length,d=a("#tab_pages");1>=c?d.hide():d.show()}),d(),a("#grid-pages-panel").on("click",".column-fieldinsert .dashicons-plus-alt",function(){var d=a(this).closest(".column-container"),e=a("#newfield-tool").clone();c(e,d)}),a("#grid-pages-panel").on("click",".column-fieldinsert .dashicons-admin-generic",function(){}),a("#grid-pages-panel").on("click",".column-split",function(){var c=a(this).parent().parent(),e=c.attr("class").split("-"),f=a("<div>").insertAfter(c),g=Math.ceil(e[2]/2),h=Math.floor(e[2]/2);e[2]=g,c.attr("class",e.join("-")),e[2]=h,f.addClass(e.join("-")).append('<div class="layout-column column-container">'),a(this).remove(),d(),jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a("#grid-pages-panel").on("click",".column-remove",function(){var d=a(this).closest(".row"),e=d.find(".layout-form-field"),f=d.closest(".layout-grid-panel");if(e.length){if(!confirm(a("#row-remove-fields-message").text()))return;e.each(function(b,c){var d=a(c).data("config");a("#"+d).remove(),a('option[value="'+d+'"]').remove(),a('[data-bind="'+d+'"]').remove(),delete current_form_fields[d]})}d.slideUp(200,function(){if(a(this).remove(),b(),rebuild_field_binding(),!f.find(".row").length){f.remove();var c=a("#page-toggles .button-primary"),d=c.prev(),e=c.next();c.remove(),d.length?d.trigger("click"):e.trigger("click")}a(document).trigger("remove.page")}),jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a(".caldera-config-editor-main-panel").on("click",".caldera-add-row",function(c){c.preventDefault();var e=a(".page-active");return e.length?(a(".page-active").append('<div class="first-row-level row"><div class="col-xs-12"><div class="layout-column column-container"></div></div></div>'),d(),b(),void 0):(a(".caldera-add-page").trigger("click"),void 0)}),a("#grid-pages-panel").on("click",".column-join",function(){var d=a(this).parent().parent().parent(),e=d.prev(),f=e.attr("class").split("-"),g=d.attr("class").split("-");f[2]=parseFloat(f[2])+parseFloat(g[2]),d.find(".layout-column").contents().appendTo(e.find(".layout-column")),e.attr("class",f.join("-")),d.remove(),b(),jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a("#grid-pages-panel").on("mouseenter",".row",function(){var d=jQuery(this);jQuery(".column-tools,.column-merge").remove(),d.children().children().first().append('<div class="column-remove column-tools"><i class="icon-remove"></i></div>'),d.children().children().last().append('<div class="column-sort column-tools" style="text-align:right;"><i class="dashicons dashicons-menu drag-handle sort-handle"></i></div>'),d.children().children().not(":first").prepend('<div class="column-merge"><div class="column-join column-tools"><i class="icon-join"></i></div></div>');var e=d.parent().parent().parent().width()/12-1;d.children().children().each(function(b,c){var d=a(c),e=d.width()/2-5;d.prepend('<div class="column-fieldinsert column-tools"><i class="dashicons dashicons-plus-alt"></i></div>'),d.parent().hasClass("col-xs-1")||(d.prepend('<div class="column-split column-tools"><i class="dashicons dashicons-leftright"></i></div>'),d.find(".column-split").css("left",e))}),jQuery(".column-merge").draggable({axis:"x",helper:"clone",appendTo:d,grid:[e,0],drag:function(c,d){a(this).addClass("dragging"),a(".column-tools").remove(),a(".column-split").remove();var e=a(this).parent().parent(),f=d.helper,g=d.originalPosition.left>f.position().left?"left":"right",i=e.prev(),j=Math.round(e.parent().width()/12-10),k=Math.abs(d.originalPosition.left-f.position().left);if(e.parent().addClass("sizing"),k>=j){var l=i.attr("class").split("-"),m=e.attr("class").split("-");
2
- l[2]=parseFloat(l[2]),m[2]=parseFloat(m[2]),"left"===g?(l[2]--,m[2]++,l[2]>0&&l[2]<l[2]+m[2]?(i.attr("class",l.join("-")),e.attr("class",m.join("-")),d.originalPosition.left=f.position().left):a(this).draggable("option","disabled",!0)):(l[2]++,m[2]--,m[2]>0&&m[2]<m[2]+m[2]?(i.attr("class",l.join("-")),e.attr("class",m.join("-")),d.originalPosition.left=f.position().left):a(this).draggable("option","disabled",!0)),b()}},stop:function(){a(this).removeClass("dragging").parent().parent().parent().removeClass("sizing")}})}),a("#grid-pages-panel").on("mouseleave",".row",function(){jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a("#grid-pages-panel").on("click",".layout-form-field .icon-remove",function(){var b=a(this),c=b.parent(),d=a("#"+c.data("config"));c.slideUp(100,function(){a(this).remove()}),d.slideUp(100,function(){a(this).remove()})}),a("#grid-pages-panel").on("click",".layout-form-field .icon-edit",function(){var b=a(this),c=b.parent(),d=a("#"+c.data("config")+"_type").val();a(".caldera-editor-field-config-wrapper").hide(),c.hasClass("field-edit-open")?c.removeClass("field-edit-open"):(a(".layout-form-field").removeClass("field-edit-open"),c.addClass("field-edit-open"),a("#"+c.data("config")).show()),a(document).trigger("show."+c.data("config")),("radio"===d||"checkbox"===d||"dropdown"===d||"toggle_switch"===d)&&a("#"+c.data("config")+"_auto").trigger("change")}),a("body").on("click",".layout-modal-edit-closer,.layout-modal-save-action",function(b){b.preventDefault();var c=a(this),d=a(".layout-form-field.edit-open"),e=c.closest(".layout-modal-container");settings=e.find(".settings-panel").first(),a(".edit-open").removeClass("edit-open"),settings.appendTo(d.find(".settings-wrapper")).hide(),e.hide()}),a(".layout-editor-body").on("change",".layout-core-pod-query",function(){a(this).parent().find(".settings-panel-row").remove(),a(".edit-open").find(".drag-handle .set-pod").html(" - "+a(this).val())}),a(".layout-editor-body").on("click",".remove-where",function(){a(this).closest(".settings-panel-row").remove()}),a(".layout-editor-body").on("click",".use-pod-container",function(){var b=a(this),c=b.prev(),d=c.val();if(d.length){a(".edit-open").find(".drag-handle .set-pod").html(" - "+c.val()),b.parent().parent().find(".spinner").css("display","inline-block");var f={action:"pq_loadpod",pod_reference:{pod:d}};a.post(ajaxurl,f,function(c){b.parent().find(".spinner").css("display","none");var d=a("#where-line-tmpl").html(),e="",f=b.closest(".settings-panel").data("container");for(var g in c)e+='<option value="'+c[g]+'">'+c[g]+"</option>";d=d.replace(/{{fields}}/g,e).replace(/{{container_id}}/g,f),b.parent().append(d)})}}),a(".caldera-editor-header").on("click",".column-sort .icon-edit",function(){}),a(".layout-editor-body").on("tray_loaded",".layout-template-tray",function(){d()}),a(".caldera-editor-header").on("click",".caldera-editor-header-nav a",function(b){b.preventDefault();var c=a(this);a(".caldera-editor-header-nav li").removeClass("active"),a(".caldera-editor-body").hide(),a(c.attr("href")).show(),c.parent().addClass("active"),rebind_field_bindings()}),a("body").on("change",".required",function(){check_required_bindings(this)}),a("body").on("submit",".caldera-forms-options-form",function(b){var c=a(".required.has-error");c.length&&b.preventDefault()}),a(".caldera-editor-body").on("click",".add-toggle-option",function(){var c=a(this);if(c.data("bulk"))return a(c.data("bulk")).toggle(),a(c.data("bulk")).find("textarea").focus(),void 0;var d=c.closest(".caldera-editor-field-config-wrapper"),e=d.find(".toggle-options"),f=a("#field-option-row-tmpl").html(),g=Handlebars.compile(f),h="opt"+parseInt(1048576*(Math.random()+1)),i={_name:"config[fields]["+d.prop("id")+"][config]",option:{}};if(c.data("options")){for(var j=a(c.data("options")),k=j.val().split("\n"),l=0;l<k.length;l++)i.option["opt"+parseInt(1048576*(Math.random()+l))]={value:k[l],label:k[l],"default":!1};a(c.data("options")).parent().hide(),j.val(""),e.empty()}else i.option[h]={value:"",label:"","default":!1};e.append(g(i)),d.find(".toggle_show_values").trigger("change"),a(".toggle-options").sortable({handle:".dashicons-sort"}),k||e.find(".toggle_label_field").last().focus()}),a(".caldera-editor-body").on("click",".toggle-remove-option",function(){var c=a(this).closest(".caldera-editor-field-config-wrapper").find(".field-config").first();a(this).parent().remove(),c.trigger("change")}),a(".caldera-editor-body").on("click",".page-toggle",function(){var c=a(this),d=c.parent(),e=d.find(".button");e.removeClass("button-primary"),a(".layout-grid-panel").hide().removeClass("page-active"),a("#"+c.data("page")).show().addClass("page-active"),c.addClass("button-primary"),e.each(function(b,c){a(c).html(d.data("title")+" "+(b+1))}),1===e.length&&d.hide()}),a(".caldera-editor-body").on("blur toggle.values",".toggle_label_field",function(){var c=a(this),d=c.prev();d.val().length||d.val(c.val())}),rebuild_field_binding(),a(document).trigger("load.page")}),Handlebars.registerHelper("_options_config",function(){}),jQuery(document).ready(function(a){function b(){a(".caldera-editor-processors-panel ul").sortable({update:function(){rebuild_field_binding()}})}function c(b){var c=a(b),d=a("#"+c.val()+"-tmpl").length?a("#"+c.val()+"-tmpl").html():"",e=c.closest(".caldera-editor-processor-config-wrapper"),f=e.find(".caldera-config-processor-setup"),g=Handlebars.compile(d),h=e.find(".processor_config_string").val(),i=c.data("type");h=h.length&&i===c.val()?JSON.parse(h):processor_defaults[c.val()+"_cfg"],h||(h={}),h._id=e.prop("id"),h._name="config[processors]["+e.prop("id")+"][config]",g=a("<div>").html(g(h)),f.html(g.html()),"function"==typeof window[c.val()+"_init"]&&window[c.val()+"_init"](e.prop("id"),f),e.find(".no-conditions").length&&e.find(".toggle_option_tab").remove(),rebuild_field_binding(),baldrickTriggers()}a("body").on("click",".caldera-processor-nav a",function(b){b.preventDefault();var c=a(this);a(".caldera-processor-nav").removeClass("active"),a(".caldera-editor-processor-config-wrapper").hide(),a(c.attr("href")).show(),c.parent().addClass("active")}),a("body").on("click",".add-new-processor",function(){var d=a(this),e=Handlebars.compile(a("#processor-wrapper-tmpl").html());wrap=a(".active-processors-list"),process_conf=a(".caldera-editor-processor-config"),processid=Math.round(1e8*Math.random()),new_templ=Handlebars.compile(a("#processor-line-tmpl").html()),new_proc={id:"fp_"+processid,type:d.data("type")},wrap.append(new_templ(new_proc)),process_conf.append(e(new_proc)),a("#form_processor_baldrickModalCloser").trigger("click"),a(".caldera-processor-nav a").last().trigger("click"),a("#fp_"+processid+"_type").val(d.data("type")).trigger("change"),b(),baldrickTriggers()}),a("body").on("click",".delete-processor",function(){var c=a(this),d=c.closest(".caldera-editor-processor-config-wrapper");d.data("type"),confirm(c.data("confirm"))&&(a("."+d.prop("id")).remove(),d.remove(),a(".caldera-processor-nav a").first().trigger("click"),rebuild_field_binding())}),a("body").on("change",".caldera-select-processor-type",function(){var d=a(this),e=d.closest(".caldera-editor-processor-config-wrapper"),f=d.find('option[value="'+d.val()+'"]').text(),g=e.find(".caldera-editor-processor-title"),h=a(".caldera-processor-nav.active a");""===f&&(f=g.data("title")),g.html(f),h.html(f+' <span class="processor-line-number"></span>').parent().addClass("processor_type_"+d.val()),c(this),rebuild_field_binding()}),rebuild_field_binding(),a(".caldera-select-processor-type").each(function(a,b){c(b)}),b()}),Handlebars.registerHelper("_field",function(a){var b=this,c="",d="",e="",f=this[a.hash.slug]?' data-default="'+this[a.hash.slug]+'"':"";a.hash.required&&(c=" required"),a.hash.exclude&&(e='data-exclude="'+a.hash.exclude+'"'),a.hash.array&&(d="[]","true"!==a.hash.array&&(f='value="'+a.hash.array+'"')),out="<select "+(a.hash.type?'data-type="'+a.hash.type+'"':"")+f+" "+e+' name="'+this._name+"["+a.hash.slug+"]"+d+'" id="'+this._id+"_"+a.hash.slug+'" class="block-input field-config caldera-field-bind'+c+'">',this[a.hash.slug]?out+='<option class="bound-field" value="'+this[a.hash.slug]+'" class="bound-field"></option>':a.hash.required||(out+='<option value=""></option>');for(var g in current_form_fields){var h="";a.hash.type&&current_form_fields[g].type!==a.hash.type||(b[a.hash.slug]&&b[a.hash.slug]===g&&(h=' selected="selected"'),out+='<option value="'+g+'"'+h+">"+current_form_fields[g].label+" ["+current_form_fields[g].slug+"]</option>")}return out+="</select>",a.hash.required&&(out+='<input class="field-config" name="'+this._name+'[_required_bounds][]" type="hidden" value="'+a.hash.slug+'">'),out}),Handlebars.registerHelper("console",function(){console.log(this)});
1
+ function new_conditional_group(a){var b=a.trigger.data("id"),c="cl"+Math.round(18746582734*Math.random()),d="rw"+Math.round(98347598345*Math.random()),e=[{id:d,type:a.trigger.data("type"),lines:[{id:c}]}];return{group:e,id:b}}function new_conditional_line(a){var b=a.trigger.data("id"),c=a.trigger.data("group"),d=a.trigger.data("type"),e="cl"+Math.round(18746582734*Math.random()),f={id:b,type:d,lineid:e,rowid:c,name:"config["+d+"]["+b+"][conditions][group]["+c+"]["+e+"]"};return f}function build_conditions_config(a){var b=JSON.parse(a.trigger.val());return b.id=a.trigger.data("id"),b}function setup_field_type(a){return{id:a.trigger.prop("id")}}function check_required_bindings(a){var b,d=(jQuery(".caldera-header-save-button"),jQuery(".layout-form-field")),e=jQuery(".caldera-processor-nav"),f=!0;b=a?jQuery(a):jQuery(".caldera-config-field .required"),b.removeClass("has-error"),d.removeClass("has-error"),e.removeClass("has-error"),jQuery(".error-tag").remove(),required_errors={},b.each(function(a,b){var c=jQuery(b),d=c.closest(".caldera-config-editor-panel");if(b.value.length){if(c.hasClass("field-slug"))for(var h=jQuery(".field-slug").not(c),i=0;i<h.length;i++)if(h[i].value===b.value){var c=jQuery(h[i]);required_errors[d.prop("id")]||(required_errors[d.prop("id")]=0);var e=c.closest(".caldera-editor-field-config-wrapper"),g=c.closest(".caldera-editor-processor-config-wrapper");e.length&&jQuery('.layout-form-field[data-config="'+e.prop("id")+'"]').addClass("has-error"),g.length&&jQuery("."+g.prop("id")).addClass("has-error"),required_errors[d.prop("id")]+=1,c.addClass("has-error");break}}else{required_errors[d.prop("id")]||(required_errors[d.prop("id")]=0);var e=c.closest(".caldera-editor-field-config-wrapper"),g=c.closest(".caldera-editor-processor-config-wrapper");e.length&&jQuery('.layout-form-field[data-config="'+e.prop("id")+'"]').addClass("has-error"),g.length&&jQuery("."+g.prop("id")).addClass("has-error"),required_errors[d.prop("id")]+=1,c.addClass("has-error"),f=!1}});for(var g in required_errors)jQuery(".caldera-forms-options-form").find('a[href="#'+g+'"]').append('<span class="error-tag">'+required_errors[g]+"</span>");return jQuery(".preview-caldera-config-group button:submit").length?(jQuery(".mailer-errors").hide(),jQuery(".mailer-control-panel").show()):(jQuery(".mailer-errors").show(),jQuery(".mailer-control-panel").hide()),jQuery(".caldera-conditional-field-set").trigger("change"),f}jQuery(document).ready(function(a){function b(b){var d=a(b),e=d.closest(".caldera-editor-field-config-wrapper"),f=e.find(".caldera-config-field-setup"),g=compiled_templates[d.val()+"_tmpl"]?compiled_templates[d.val()+"_tmpl"]:compiled_templates.noconfig_field_templ,h=e.find(".field_config_string").val(),i=d.data("type");if(e.find(".caldera-config-group").show(),d.addClass("field-initialized"),h=h.length&&i===d.val()?JSON.parse(h):fieldtype_defaults[d.val()+"_cfg"],h||(h={}),h._id=d.data("field"),h._name="config[fields]["+d.data("field")+"][config]",g=a("<div>").html(g(h)),f.html(g.html()),"function"==typeof window[d.val()+"_init"]&&window[d.val()+"_init"](d.data("field"),f),fieldtype_defaults[d.val()+"_nosupport"]&&(fieldtype_defaults[d.val()+"_nosupport"].indexOf("hide_label")>=0&&e.find(".hide-label-field").hide().find(".field-config").prop("checked",!1),fieldtype_defaults[d.val()+"_nosupport"].indexOf("caption")>=0&&e.find(".caption-field").hide().find(".field-config").val(""),fieldtype_defaults[d.val()+"_nosupport"].indexOf("caption")>=0&&e.find(".caption-field").hide().find(".field-config").val(""),fieldtype_defaults[d.val()+"_nosupport"].indexOf("custom_class")>=0&&e.find(".customclass-field").hide().find(".field-config").val(""),fieldtype_defaults[d.val()+"_nosupport"].indexOf("entry_list")>=0&&e.find(".entrylist-field").hide().find(".field-config").prop("checked",!1)),e.find(".toggle_show_values").trigger("change"),!a(".caldera-select-field-type").not(".field-initialized").length){if(core_form.hasClass("builder-loaded"))c(d.data("field"));else{for(var j=a(".caldera-select-field-type.field-initialized"),k=0;k<j.length;k++)c(a(j[k]).data("field"));core_form.addClass("builder-loaded")}rebuild_field_binding(),baldrickTriggers()}}function c(b){var c=a("#"+b),d=c.find(".caldera-select-field-type"),e=a('.layout-form-field[data-config="'+b+'"]'),f=e.find(".field_preview"),h=(a("#preview-"+d.val()+"_tmpl").html(),compiled_templates["preview-"+d.val()+"_tmpl"]),i={id:b},j=c.find(".field-config");j.each(function(c,d){for(var e=a(d),f=e.prop("name").split("["+b+"]")[1].substr(1),g=f.substr(0,f.length-1).split("]["),h=e.is(":checkbox,:radio")?e.filter(":checked").val():e.val(),j={},k=g.length-1;k>=0;k--)if(k===g.length-1)j[g[k]]=h;else{var l=j;j={},j[g[k]]=l}a.extend(!0,i,j)}),f.html(h(i)),e.removeClass("button"),a(".preview-field-config").prop("disabled",!0)}function d(b){var t,c=a(".caldera-editor-fields-panel"),e=(a(".caldera-editor-groups-panel"),a(".caldera-group-nav")),f=a('[data-group="'+b+'"]'),g=f.find(".caldera-config-group-name"),h=f.find(".caldera-config-group-slug"),i=f.find(".caldera-config-group-desc"),j=f.find(".caldera-config-group-admin"),k=a(".active-group-name"),l=a(".active-group-slug"),m=a(".active-group-desc"),n=a(".active-group-admin"),o=a(".caldera-editor-fields-list ul"),p=f.find(".caldera-config-group-repeat"),q=a(".repeat-config-button"),s=(a(".caldera-editor-group-settings"),a(".caldera-config-group-remove"));a(".new-group-input").remove(),a(".new-field-input").remove(),e.removeClass("active"),c.show(),o.hide(),o.removeClass("active").find("li.active").removeClass("active"),o.hide(),f.addClass("active"),t=a(".caldera-editor-fields-list ul.active li"),t.length?s.hide():s.show(),a(".caldera-editor-field-config-wrapper").hide(),f.show(),k.val(g.val()),l.val(h.val()),m.val(i.val()),"1"===j.val()?n.prop("checked",!0):n.prop("checked",!1),"1"===p.val()?q.addClass("field-edit-open"):q.removeClass("field-edit-open")}a(".caldera-header-save-button").baldrick({method:"POST",request:"admin.php?page=caldera-forms",before:function(b,c){if(c.preventDefault(),!check_required_bindings())return!1;a("#save_indicator").addClass("loading"),tinyMCE&&tinyMCE.triggerSave();var d=a(".caldera-forms-options-form").formJSON();return a(b).data("cf_edit_nonce",d.cf_edit_nonce),a(b).data("_wp_http_referer",d._wp_http_referer),a(b).data("sender","ajax"),a(b).data("config",JSON.stringify(d.config)),!0},callback:function(b){if(!1===b.data){var c=a(".updated_notice_box");c.stop().animate({top:0},200,function(){setTimeout(function(){c.stop().animate({top:-75},200)},2e3)})}},complete:function(){a(".wrapper-instance-pane .field-config").prop("disabled",!1)}}),a("body").on("click",".toggle_option_tab > a",function(b){b.preventDefault();var c=a(this),d=a(c.attr("href")),e=c.parent().find("a"),f=c.closest(".caldera-editor-config-wrapper").find(".wrapper-instance-pane");e.removeClass("button-primary"),f.hide(),d.show(),c.addClass("button-primary"),a(".caldera-conditionals-usetype").trigger("change")}),a(".caldera-editor-body").on("change",".caldera-select-field-type",function(){b(this)}),a(".caldera-editor-body").on("click",".caldera-group-nav a",function(b){b.preventDefault(),d(a(this).attr("href").substr(1))}),a(".caldera-editor-body").on("click",".caldera-editor-fields-list a",function(b){b.preventDefault();var c=a(this),d=a(c.attr("href"));a(".new-group-input").remove(),a(".new-field-input").remove(),a(".caldera-editor-fields-list li.active").removeClass("active"),c.parent().addClass("active"),a(".caldera-editor-field-config-wrapper").hide(),d.show()}),a(".caldera-editor-body").on("click",".group-config-button",function(){var c=a(this),d=a(".caldera-editor-group-settings"),e=c.closest(".caldera-editor-fields-panel"),f=a(".caldera-config-group-remove");e.find(".caldera-field-line").length?f.hide():f.show(),c.hasClass("field-edit-open")?(d.slideUp(100),c.removeClass("field-edit-open")):(d.slideDown(100),c.addClass("field-edit-open"))}),a(".caldera-editor-body").on("keydown",".field-config",function(b){a(this).is("textarea")||13===b.which&&b.preventDefault()}),a(".caldera-editor-body").on("change",".field-label",function(b){var c=a(this).closest(".caldera-editor-field-config-wrapper").prop("id");field_line=a('[data-field="'+c+'"]'),field_title=a("#"+c+" .caldera-editor-field-title, .layout-form-field.field-edit-open .layout_field_name"),slug=a("#"+c+" .field-slug"),field_line.find("a").html('<i class="icn-field"></i> '+this.value),field_title.text(this.value),"change"===b.type&&slug.trigger("change"),rebuild_field_binding()}),a(".caldera-editor-body").on("change",".active-group-name",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find(".caldera-config-group-name")),f=c.find("span");"focusout"!==b.type||this.value.length||(this.value="Group "+(parseInt(c.index())+1)),e.val(this.value),f.text(this.value)}),a(".caldera-editor-body").on("change",".active-group-slug",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find(".caldera-config-group-name").val()),f=c.find(".caldera-config-group-slug"),h=(c.find("span"),this.value.replace(/[^a-z0-9]/gi,"_").toLowerCase());"focusout"!==b.type||this.value.length||(h=e.replace(/[^a-z0-9]/gi,"_").toLowerCase()),f.val(h),this.value=h}),a(".caldera-editor-body").on("change",".active-group-desc",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find(".caldera-config-group-desc"));e.val(this.value)}),a(".caldera-editor-body").on("change",".active-group-admin",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),f=(c.data("group"),c.find(".caldera-config-group-name").val(),c.find(".caldera-config-group-admin"));c.find("span"),this.value.replace(/[^a-z0-9]/gi,"_").toLowerCase(),a(this).prop("checked")?(f.val(1),c.addClass("is-admin")):(f.val(0),c.removeClass("is-admin"))}),a(".caldera-editor-body").on("click",".repeat-config-button",function(b){b.preventDefault();var c=a(".caldera-group-nav.active"),e=(c.data("group"),c.find("a .group-type")),f=c.find(".caldera-config-group-repeat"),g=a(this);g.hasClass("field-edit-open")?(f.val("0"),e.removeClass("icn-repeat").addClass("icn-folder"),g.removeClass("field-edit-open")):(f.val("1"),e.addClass("icn-repeat").removeClass("icn-folder"),g.addClass("field-edit-open"))}),a(".caldera-editor-body").on("click",".delete-field",function(){var b=a(this),c=b.closest(".caldera-editor-field-config-wrapper").prop("id");confirm(b.data("confirm"))&&(a("#"+c).remove(),a('option[value="'+c+'"]').remove(),a('[data-bind="'+c+'"]').remove(),delete current_form_fields[c],a('[data-config="'+c+'"]').slideUp(200,function(){var b=a(this);b.remove(),rebuild_field_binding(),a(document).trigger("field.removed")}))}),a(".caldera-editor-body").on("click",".add-new-group,.add-field",function(){var b=a(this);if(a(".new-group-input").remove(),a(".new-field-input").remove(),b.hasClass("add-field")){var c=a('<input type="text" class="new-field-input block-input">');c.appendTo(a(".caldera-editor-fields-list ul.active")).focus()}else{var d=a('<input type="text" class="new-group-input block-input">');d.appendTo(a(".caldera-editor-groups-panel")).focus()}}),a(".caldera-editor-body").on("change keypress",".new-group-input",function(b){if("keypress"===b.type){if(13!==b.which)return;b.preventDefault()}var h,i,c=this.value,e=a(this),f=a(".caldera-editor-groups-panel ul"),g=a(".caldera-editor-fields-list");if(c.length){h=Handlebars.compile(a("#caldera_group_line_templ").html()),i={id:c.replace(/[^a-z0-9]/gi,"_").toLowerCase(),name:c},f.append(h(i));var j=a('<ul data-group="'+i.id+'">').hide();j.appendTo(g),e.remove(),d(i.id)}else e.remove()}),a(".caldera-editor-body").on("change keypress",".new-field-input",function(b){if("keypress"===b.type){if(13!==b.which)return;b.preventDefault()}var g,h,i,c=this.value,d=a(this),e=d.parent(),f=a(".caldera-editor-field-config"),j=a(".caldera-config-group-remove");if(c.length){j.hide(),g=Handlebars.compile(a("#caldera_field_line_templ").html()),h=Handlebars.compile(a("#caldera_field_config_wrapper_templ").html()),i={id:c.replace(/[^a-z0-9]/gi,"_").toLowerCase(),label:c,slug:c.replace(/[^a-z0-9]/gi,"_").toLowerCase(),group:a(".caldera-group-nav.active").data("group")};var k=a(g(i));k.appendTo(e),f.append(h(i)),k.find("a").trigger("click"),d.remove()}else d.remove()}),a(".caldera-editor-body").on("change",".field-slug",function(b){this.value.length?this.value=this.value.replace(/[^a-z0-9]/gi,"_").toLowerCase():"change"===b.type&&(this.value=a(this).closest(".caldera-editor-field-config-wrapper").find(".field-label").val().replace(/[^a-z0-9]/gi,"_").toLowerCase())}),a(".caldera-editor-body").on("click",".caldera-add-group",function(){var c=a(this),d=c.data("group"),e=a("#"+d+"_panel_tmpl").html();c.parent().parent().append(e)}),a(".caldera-editor-body").on("click",".caldera-config-group-remove",function(){var c=a(".active-group-slug").val();a('[data-group="'+c+'"]').hide(0,function(){a(this).remove();var b=a(".caldera-group-nav");b.length?b.first().find("a").trigger("click"):a(".caldera-editor-fields-panel").hide()})}),a("body").on("click",".set-current-field",function(b){b.preventDefault();var c=a(this);a("#"+c.data("field")+"_type").val(c.data("type")).trigger("change"),a("#"+c.data("field")+"_lable").focus(),a("#field_setup_baldrickModalCloser").trigger("click")}),a(".caldera-editor-body").on("change",".field-config",function(){var d=a(this),e=d.closest(".caldera-editor-field-config-wrapper");current_form_fields&&(d.prop("id")===e.prop("id")+"_lable"&&(current_form_fields[e.prop("id")].label=this.value),d.prop("id")===e.prop("id")+"_slug"&&(current_form_fields[e.prop("id")].slug=this.value),d.prop("id")===e.prop("id")+"_type"&&(current_form_fields[e.prop("id")].type=this.value),e.length&&c(e.prop("id")))}),a(".caldera-editor-body").on("focus",".caldera-field-bind",function(b){var c=a(this),d=this.value;return console.log(b.type),b.type&&"focusin"===b.type?(c.removeClass("bound_field").addClass("reload-binding"),rebind_field_bindings(),this.value=d,void 0):void 0}),a(".caldera-editor-body").on("change",".caldera-conditional-field-set",function(){var k,l,c=a(this),d=c.parent().find(".compare-type"),e=c.data("condition"),f=c.data("id"),g="config["+e+"]["+f+"][conditions][group]["+c.data("row")+"]["+c.data("line")+"]",h=c.data("line"),i=a("#"+h+"_value"),j=i.find(".caldera-conditional-value-field").first(),m=[],n=this.value;if("{"!==n.substr(0,1)&&(k=a("#"+n),l=k.find(".field-button-type"),m=k.find(".caldera-config-group-toggle-options")),c.hasClass(".bind_init")&&c.addClass("bound_triggered"),j.length&&j.val().length&&i.data("value",j.val()),d.show(),m.length){var o=m.find(".toggle_option_row"),p='<select name="'+g+'[value]" class="caldera-processor-value-bind caldera-conditional-value-field" data-field="'+n+'" style="max-width: 220px; width: 220px;">';p+='<option value=""></option>',o.each(function(b,c){var d=a(c).find(".toggle_label_field"),e=d.data("option"),f="";i.data("value")&&(i.data("value").toString()===e||i.data("value").toString()===a(c).find(".toggle_value_field").val())&&(f=' selected="selected"'),p+='<option value="'+e+'"'+f+">"+d.val()+"</option>"}),p+="</select>"}else l&&"button"==l.val()?(d.val("is").hide(),p='<select name="'+g+'[value]" class="caldera-processor-value-bind caldera-conditional-value-field" data-field="'+n+'" style="max-width: 220px; width: 220px;">',p+='<option value="click" '+("click"===i.data("value")?'selected="selected"':"")+">Click</option>",p+='<option value="dblclick" '+("dblclick"===i.data("value")?'selected="selected"':"")+">Double Click</option>",p+="</select>"):p='<input name="'+g+'[value]" type="text" class="caldera-conditional-value-field magic-tag-enabled" value="'+(i.data("value")?i.data("value"):"")+'" style="max-width: 205px;">';i.html(p),init_magic_tags()}),a(".caldera-editor-body").on("change",".caldera-conditionals-usetype",function(){var c=a(this);""!==this.value?(a("#"+c.data("id")+"_condition_group_add").show(),a("#"+c.data("id")+"_conditional_wrap").show()):(a("#"+c.data("id")+"_condition_group_add").hide(),a("#"+c.data("id")+"_conditional_wrap").hide())}),a(".caldera-editor-body").on("click",".remove-conditional-line",function(b){b.preventDefault();var c=a(this),d=c.closest(".caldera-condition-line"),e=c.closest(".caldera-condition-group");d.remove(),e.find(".caldera-condition-line").length||e.remove()}),a(".caldera-group-nav").first().find("a").trigger("click"),a(".caldera-editor-body").on("change",".toggle_show_values",function(){var c=a(this),d=c.closest(".caldera-config-group-toggle-options");values=d.find(".toggle_value_field"),lables=d.find(".toggle_label_field"),field_lables=d.find(".caldera-config-group-option-labels"),c.prop("checked")?(values.show().parent().show(),values.show().parent().parent().show(),lables.css("width",""),field_lables.show()):(values.hide().parent().hide(),lables.css("width",245),field_lables.hide()),lables.trigger("toggle.values"),init_magic_tags()}),a(".caldera-editor-body").on("change",".auto-populate-type",function(){a(this).closest(".wrapper-instance-pane").find(".auto-populate-options").trigger("change")}),a(".caldera-editor-body").on("change",".auto-populate-options",function(){var b=a(this),c=b.closest(".wrapper-instance-pane"),d=c.find(".caldera-config-group-toggle-options"),e=c.find(".caldera-config-group-auto-options"),f=e.find(".auto-populate-type");e.find(".auto-populate-type-panel").hide(),b.prop("checked")?(d.hide(),e.show()):(d.show(),e.hide()),e.find(".caldera-config-group-auto-"+f.val()).show()}),a("body").on("change",".pin-toggle-roles",function(){var b=a(this),c=a("#caldera-pin-rules");"1"===b.val()?c.show():c.hide()}),a("body").on("click",".magic-tag-init",function(){var c=a(this),d=c.prev();d.focus().trigger("init.magic")}),a("body").on("keyup blur focus select click init.magic",".magic-tag-enabled",function(b){init_magic_tags();var c=a(this),d=c.parent(),e=d.closest(".wrapper-instance-pane").find(".caldera-select-field-type").val()?d.closest(".wrapper-instance-pane").find(".caldera-select-field-type").val():"hidden",f=d.find(".magic-tags-autocomplete"),g=f.find("ul"),h=this.value,j=[],k="",l=this.selectionStart,m=this.selectionEnd;if(f.length&&f.data("focus"))return b.preventDefault(),void 0;if(c.data("tag",""),this.selectionEnd>this.selectionStart)k=this.value.substr(this.selectionStart,this.selectionEnd-this.selectionStart);else if(("select"===b.type||"keyup"===b.type)&&40!==b.which&&38!==b.which&&39!==b.which&&37!==b.which){for(l=this.selectionStart;l>0;l--){var n=h.substr(l-1,1);if(" "===n||"\n"===n||("%"===n||"}"===n)&&this.selectionStart===l)break}for(m=this.selectionStart;m<h.length;m++){var n=h.substr(m,1);if(" "===n||"\n"===n||("%"===n||"{"===n)&&this.selectionStart===m)break}k=h.substr(l,m-l)}if("focusout"!==b.type){if("init"!==b.type&&k.length<3)return f.length&&f.remove(),void 0;f.length||(f=a('<div class="magic-tags-autocomplete"></div>'),g=a("<ul></ul>"),g.appendTo(f),f.insertAfter(c),f.on("mouseenter",function(){a(this).data("focus",!0)}),f.on("mouseleave",function(){a(this).data("focus",!1),c.is(":focus")||c.trigger("focusout")})),g.empty();var o="system",p=!1;"hidden"===e||"dropdown"===e||"radio"===e||"toggle_switch"===e||"checkbox"===e?(p=!0,e="text",o="all"):("paragraph"===e||"html"===e)&&(e="text"),c.data("type")&&(e=c.data("type")),e=e.split(","),e.push("vars");for(var q=0;q<e.length;q++)for(var r in system_values)if("undefined"!=typeof system_values[r].tags[e[q]]){if(j=[r],"system"!==r&&"variable"!==r&&"field"!==r){var s=jQuery(".processor-"+r),t=c.closest(".caldera-editor-processor-config-wrapper"),u=t.prop("id");j=[];for(var v=0;v<s.length;v++)if(t.length||p!==!0){if(u===s[v].id)continue;jQuery("li."+s[v].id).index()<jQuery("li."+u).index()&&j.push(s[v].id)}else j.push(s[v].id)}for(var w=0;w<j.length;w++)if("all"===o||o===r||"variable"===r){var x=a('<li class="header">'+system_values[r].type+(w>0?" ["+(w+1)+"]":"")+"</li>"),y=0;x.appendTo(g);for(var z=0;z<system_values[r].tags[e[q]].length;z++)if(!c.data("parent")||"variable:"+c.data("parent")!==system_values[r].tags[e[q]][z]){var A=system_values[r].wrap[0]+system_values[r].tags[e[q]][z]+system_values[r].wrap[1];if(j[w]!==r&&j.length>1&&(A=system_values[r].wrap[0]+system_values[r].tags[e[q]][z]+":"+j[w]+system_values[r].wrap[1]),A.indexOf(k)>=0||"init"===b.type){y+=1;var B=A.replace(k,"<strong>"+k+"</strong>"),C=a('<li class="tag" data-tag="'+A+'">'+B+"</li>");C.on("click",function(){var b=a(this).data("tag");c.val(h.substr(0,l)+b+h.substr(m)).trigger("change").focus(),c[0].selectionStart=l+b.length-(b.indexOf("*")>0?2:0),c[0].selectionEnd=l+b.length-(b.indexOf("*")>0?1:0)}),C.appendTo(g)}}0===y&&x.remove()}}}g.children().length||f.remove(),"focusout"===b.type&&setTimeout(function(){f.remove()},200)});for(var e=a(".cf-editor-template"),f=0;f<e.length;f++)compiled_templates[e[f].id]=Handlebars.compile(e[f].innerHTML);a(".caldera-select-field-type").not(".field-initialized").each(function(a,c){b(c)})});var rebuild_field_binding,rebind_field_bindings,current_form_fields={},required_errors={},add_new_grid_page,add_page_grid,init_magic_tags,core_form,compiled_templates={};init_magic_tags=function(){var a=jQuery(".magic-tag-enabled");a.each(function(a,b){var c=jQuery(b);if(c.hasClass("magic-tag-init-bound")){var d=c.parent().find(".magic-tag-init");return c.is(":visible")?d.show():d.hide(),void 0}var e=jQuery('<span class="icn-code magic-tag-init"></span>'),f=jQuery('<span style="position:relative;display:inline-block; width:100%;"></span>');c.is("input")&&e.css("borderBottom","none"),c.hasClass("caldera-conditional-value-field")&&f.width("auto"),c.wrap(f),e.insertAfter(c),c.addClass("magic-tag-init-bound"),c.is(":visible")?e.show():e.hide()})},rebuild_field_binding=function(){if(core_form||(core_form=jQuery(".caldera-forms-options-form")),core_form.hasClass("builder-loaded")){var a=jQuery(".caldera-editor-field-config-wrapper");system_values.field={tags:{text:[]},type:"Fields",wrap:["%","%"]};for(var b=0;b<a.length;b++){var c=a[b].id,d=jQuery("#"+c+"_lable").val(),e=jQuery("#"+c+"_slug").val(),f=jQuery("#"+c+"_type").val();"undefined"==typeof system_values.field.tags[f]&&(system_values.field.tags[f]=[]),system_values.field.tags[f].push(e),"text"!==f&&system_values.field.tags.text.push(e),current_form_fields[c]={label:d,slug:e,type:f},jQuery("option.bound-field").trigger("change").each(function(a,b){var c=jQuery(b);0!==c.prop("value").indexOf("{")?c.text(jQuery("#"+c.prop("value")+"_lable").val()+" ["+jQuery("#"+c.prop("value")+"_lable").val()+"]"):c.text(c.prop("value").replace("{","").replace("}",""))}).removeClass("bound-field")}}},rebind_field_bindings=function(){var b,c,a=jQuery(".caldera-field-bind").not(".bound_field");if(a.length){a.addClass("bound_field");for(var d=0;d<a.length;d++){var e=jQuery(a[d]),f=e.val(),g=e.data("default"),h=e.data("exclude"),i=0,j=e.closest(".caldera-editor-processor-config-wrapper"),k=j.prop("id"),l="";if(g&&!e.hasClass("reload-binding")&&(f=g),e.is("select")){e.empty();var m=jQuery('<optgroup label="Fields">');for(var n in current_form_fields)e.data("type")&&e.data("type").split(",").indexOf(current_form_fields[n].type)<0||(e.data("id")!==n&&m.append('<option value="'+n+'"'+(f===n?'selected="selected"':"")+">"+current_form_fields[n].label+" ["+current_form_fields[n].slug+"]</option>"),i+=1);m.appendTo(e),0===i&&e.empty();for(var o in system_values)if(b=[],!(h&&h.split(",").indexOf(o)>=0)){if("system"!==o&&"variable"!==o)for(var p=jQuery(".processor-"+o),q=0;q<p.length;q++)k!==p[q].id&&(b.push(p[q].id),p.length>1&&(c=jQuery("li."+p[q].id+" .processor-line-number"))&&c.html("["+(q+1)+"]"));else b.push("__system__");var r=[];e.data("type")?(r=e.data("type").split(","),r.push("vars")):r=["text","vars"];for(var s=0;s<r.length;s++)if(system_values[o].tags[r[s]])for(var t=0;t<b.length;t++){jQuery("li."+b[t]).index()>jQuery("li."+k).index()&&"__system__"!==b[t]?e.closest(".caldera-editor-processors-panel-wrap").length&&(l=' disabled="disabled"'):l="";for(var m=jQuery('<optgroup label="'+system_values[o].type+("__system__"!==b[t]?" "+jQuery("li."+b[t]).find(".processor-line-number").html():"")+'"'+l+">"),u=0;u<system_values[o].tags[r[s]].length;u++){var v=system_values[o].tags[r[s]][u];"__system__"!==b[t]&&(v=v.replace(o,b[t])),m.append('<option value="{'+v+'}"'+(f==="{"+v+"}"?'selected="selected"':"")+l+">"+system_values[o].tags[r[s]][u]+"</option>"),i+=1}m.children().length&&m.appendTo(e)}}if(0===i){if(e.empty(),e.data("type")){e.append('<option value="">No '+e.data("type").split(",").join(" or ")+" in form</option>");var w=!0}}else e.prop("disabled",!1);e.hasClass("required")||"undefined"!=typeof w||e.prepend('<option value=""></option>'),e.val(f)}}init_magic_tags(),jQuery(document).trigger("bound.fields"),jQuery(".caldera-header-save-button").prop("disabled",!1)}},jQuery(document).ready(function(a){function b(){var b=a(".layout-grid-panel"),c=0;b.each(function(b,d){var e=a(d),f=e.find(".layout-structure"),g=e.find(".row"),h=[];g.each(function(b,d){var e=a(d),f=e.children().not(".column-merge"),g=[];c+=1,f.each(function(b,d){span=a(d).attr("class").split("-"),g.push(span[2]);var e=a(d).find(".field-location");e.length&&e.each(function(d,e){var f=a(e);f.val(c+":"+(b+1)).removeAttr("disabled")})}),h.push(g.join(":"))}),f.val(h.join("|"))})}function c(b,c,e){var i,j,f="fld_"+Math.round(1e7*Math.random()),g=f,h=a("#field_config_panels");if(e){var k=a("#"+e).clone().wrap("<div>").parent().html().replace(new RegExp(e,"g"),"{{id}}");i=Handlebars.compile(k)}else i=Handlebars.compile(a("#caldera_field_config_wrapper_templ").html());j={id:g,label:"",slug:""},h.append(i(j)),b.removeClass("button-small").removeClass("button").removeClass("button-primary").removeClass("ui-draggable").removeClass("layout-new-form-field").addClass("layout-form-field").attr("data-config",f),b.find(".layout_field_name").remove(),b.find(".field-location").prop("name","config[layout_grid][fields]["+f+"]"),b.find(".settings-panel").show(),b.appendTo(c),d(),b.find(".icon-edit").trigger("click"),a("#"+f+"_lable").focus().select(),e&&(h.find(".field_config_string").val(""),h.find(".field-label").trigger("change")),rebuild_field_binding(),baldrickTriggers(),a("#"+f).trigger("field.drop"),a(document).trigger("field.added")}function d(){a(".toggle-options").sortable({handle:".dashicons-sort"}),a("#grid-pages-panel").sortable({placeholder:"row-drop-helper",handle:".sort-handle",items:".first-row-level",axis:"y",stop:function(){b()}}),a(".layout-column").sortable({connectWith:".layout-column",appendTo:"#grid-pages-panel",helper:"clone",items:".layout-form-field",handle:".drag-handle",cursor:"move",opacity:.7,cursorAt:{left:100,top:15},start:function(a,b){b.helper.css({width:"200px",height:"35px",paddingTop:"20px"})},stop:function(a,c){c.item.removeAttr("style"),b()}}),a("h3 .layout-new-form-field").draggable({helper:"clone",appendTo:"body"}),a(".page-toggle.button").droppable({accept:".layout-form-field",over:function(){a(this).trigger("click"),a(".layout-column").sortable("refresh")}}),a(".layout-column").droppable({greedy:!0,activeClass:"ui-state-dropper",hoverClass:"ui-state-hoverable",accept:".layout-new-form-field",drop:function(b,d){var e=d.draggable.clone(),f=a(this);c(e,f)}}),b()}add_new_grid_page=function(){return{page_no:"pg_"+Math.round(1e7*Math.random())}},add_page_grid=function(b){var c=a(".page-toggle").length+1,e=a('<button type="button" data-name="Page '+c+'" data-page="'+b.rawData.page_no+'" class="page-toggle button">'+b.params.trigger.data("addtitle")+" "+c+"</button> "),f=a("#page-toggles");e.appendTo(f),f.show(),d(),e.trigger("click"),1===c&&f.hide(),a(document).trigger("add.page")},a(document).on("remove.page add.page load.page",function(){var c=a(".page-toggle").length,d=a("#tab_pages");1>=c?d.hide():d.show()}),d(),a("#grid-pages-panel").on("click",".column-fieldinsert .dashicons-plus-alt",function(){var d=a(this).closest(".column-container"),e=a("#newfield-tool").clone();c(e,d)}),a("#grid-pages-panel").on("click",".column-fieldinsert .dashicons-admin-generic",function(){}),a("#grid-pages-panel").on("click",".column-split",function(){var c=a(this).parent().parent(),e=c.attr("class").split("-"),f=a("<div>").insertAfter(c),g=Math.ceil(e[2]/2),h=Math.floor(e[2]/2);e[2]=g,c.attr("class",e.join("-")),e[2]=h,f.addClass(e.join("-")).append('<div class="layout-column column-container">'),a(this).remove(),d(),jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a("#grid-pages-panel").on("click",".column-remove",function(){var d=a(this).closest(".row"),e=d.find(".layout-form-field"),f=d.closest(".layout-grid-panel");if(e.length){if(!confirm(a("#row-remove-fields-message").text()))return;e.each(function(b,c){var d=a(c).data("config");a("#"+d).remove(),a('option[value="'+d+'"]').remove(),a('[data-bind="'+d+'"]').remove(),delete current_form_fields[d]})}d.slideUp(200,function(){if(a(this).remove(),b(),rebuild_field_binding(),!f.find(".row").length){f.remove();var c=a("#page-toggles .button-primary"),d=c.prev(),e=c.next();c.remove(),d.length?d.trigger("click"):e.trigger("click")}a(document).trigger("remove.page")}),jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a(".caldera-config-editor-main-panel").on("click",".caldera-add-row",function(c){c.preventDefault();var e=a(".page-active");return e.length?(a(".page-active").append('<div class="first-row-level row"><div class="col-xs-12"><div class="layout-column column-container"></div></div></div>'),d(),b(),void 0):(a(".caldera-add-page").trigger("click"),void 0)}),a("#grid-pages-panel").on("click",".column-join",function(){var d=a(this).parent().parent().parent(),e=d.prev(),f=e.attr("class").split("-"),g=d.attr("class").split("-");f[2]=parseFloat(f[2])+parseFloat(g[2]),d.find(".layout-column").contents().appendTo(e.find(".layout-column")),e.attr("class",f.join("-")),d.remove(),b(),jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a("#grid-pages-panel").on("mouseenter",".row",function(){var d=jQuery(this);jQuery(".column-tools,.column-merge").remove(),d.children().children().first().append('<div class="column-remove column-tools"><i class="icon-remove"></i></div>'),d.children().children().last().append('<div class="column-sort column-tools" style="text-align:right;"><i class="dashicons dashicons-menu drag-handle sort-handle"></i></div>'),d.children().children().not(":first").prepend('<div class="column-merge"><div class="column-join column-tools"><i class="icon-join"></i></div></div>');var e=d.parent().parent().parent().width()/12-1;d.children().children().each(function(b,c){var d=a(c),e=d.width()/2-5;d.prepend('<div class="column-fieldinsert column-tools"><i class="dashicons dashicons-plus-alt"></i></div>'),d.parent().hasClass("col-xs-1")||(d.prepend('<div class="column-split column-tools"><i class="dashicons dashicons-leftright"></i></div>'),d.find(".column-split").css("left",e))}),jQuery(".column-merge").draggable({axis:"x",helper:"clone",appendTo:d,grid:[e,0],drag:function(c,d){a(this).addClass("dragging"),a(".column-tools").remove(),a(".column-split").remove();var e=a(this).parent().parent(),f=d.helper,g=d.originalPosition.left>f.position().left?"left":"right",i=e.prev(),j=Math.round(e.parent().width()/12-10),k=Math.abs(d.originalPosition.left-f.position().left);if(e.parent().addClass("sizing"),k>=j){var l=i.attr("class").split("-"),m=e.attr("class").split("-");l[2]=parseFloat(l[2]),m[2]=parseFloat(m[2]),"left"===g?(l[2]--,m[2]++,l[2]>0&&l[2]<l[2]+m[2]?(i.attr("class",l.join("-")),e.attr("class",m.join("-")),d.originalPosition.left=f.position().left):a(this).draggable("option","disabled",!0)):(l[2]++,m[2]--,m[2]>0&&m[2]<m[2]+m[2]?(i.attr("class",l.join("-")),e.attr("class",m.join("-")),d.originalPosition.left=f.position().left):a(this).draggable("option","disabled",!0)),b()}},stop:function(){a(this).removeClass("dragging").parent().parent().parent().removeClass("sizing")
2
+ }})}),a("#grid-pages-panel").on("mouseleave",".row",function(){jQuery(".column-tools").remove(),jQuery(".column-merge").remove()}),a("#grid-pages-panel").on("click",".layout-form-field .icon-remove",function(){var b=a(this),c=b.parent(),d=a("#"+c.data("config"));c.slideUp(100,function(){a(this).remove()}),d.slideUp(100,function(){a(this).remove()})}),a("#grid-pages-panel").on("click",".layout-form-field .icon-edit",function(){var b=a(this),c=b.parent(),d=a("#"+c.data("config")+"_type").val();a(".caldera-editor-field-config-wrapper").hide(),c.hasClass("field-edit-open")?c.removeClass("field-edit-open"):(a(".layout-form-field").removeClass("field-edit-open"),c.addClass("field-edit-open"),a("#"+c.data("config")).show()),a(document).trigger("show."+c.data("config")),("radio"===d||"checkbox"===d||"dropdown"===d||"toggle_switch"===d)&&a("#"+c.data("config")+"_auto").trigger("change")}),a("body").on("click",".layout-modal-edit-closer,.layout-modal-save-action",function(b){b.preventDefault();var c=a(this),d=a(".layout-form-field.edit-open"),e=c.closest(".layout-modal-container");settings=e.find(".settings-panel").first(),a(".edit-open").removeClass("edit-open"),settings.appendTo(d.find(".settings-wrapper")).hide(),e.hide()}),a(".layout-editor-body").on("change",".layout-core-pod-query",function(){a(this).parent().find(".settings-panel-row").remove(),a(".edit-open").find(".drag-handle .set-pod").html(" - "+a(this).val())}),a(".layout-editor-body").on("click",".remove-where",function(){a(this).closest(".settings-panel-row").remove()}),a(".layout-editor-body").on("click",".use-pod-container",function(){var b=a(this),c=b.prev(),d=c.val();if(d.length){a(".edit-open").find(".drag-handle .set-pod").html(" - "+c.val()),b.parent().parent().find(".spinner").css("display","inline-block");var f={action:"pq_loadpod",pod_reference:{pod:d}};a.post(ajaxurl,f,function(c){b.parent().find(".spinner").css("display","none");var d=a("#where-line-tmpl").html(),e="",f=b.closest(".settings-panel").data("container");for(var g in c)e+='<option value="'+c[g]+'">'+c[g]+"</option>";d=d.replace(/{{fields}}/g,e).replace(/{{container_id}}/g,f),b.parent().append(d)})}}),a(".caldera-editor-header").on("click",".column-sort .icon-edit",function(){}),a(".layout-editor-body").on("tray_loaded",".layout-template-tray",function(){d()}),a(".caldera-editor-header").on("click",".caldera-editor-header-nav a",function(b){b.preventDefault();var c=a(this);a(".caldera-editor-header-nav li").removeClass("active"),a(".caldera-editor-body").hide(),a(c.attr("href")).show(),c.parent().addClass("active"),rebind_field_bindings()}),a("body").on("change",".required",function(){check_required_bindings(this)}),a("body").on("submit",".caldera-forms-options-form",function(b){var c=a(".required.has-error");c.length&&b.preventDefault()}),a(".caldera-editor-body").on("click",".add-toggle-option",function(){var c=a(this);if(c.data("bulk"))return a(c.data("bulk")).toggle(),a(c.data("bulk")).find("textarea").focus(),void 0;var d=c.closest(".caldera-editor-field-config-wrapper"),e=d.find(".toggle-options"),f=a("#field-option-row-tmpl").html(),g=Handlebars.compile(f),h="opt"+parseInt(1048576*(Math.random()+1)),i={_name:"config[fields]["+d.prop("id")+"][config]",option:{}};if(c.data("options")){for(var j=a(c.data("options")),k=j.val().split("\n"),l=0;l<k.length;l++)i.option["opt"+parseInt(1048576*(Math.random()+l))]={value:k[l],label:k[l],"default":!1};a(c.data("options")).parent().hide(),j.val(""),e.empty()}else i.option[h]={value:"",label:"","default":!1};e.append(g(i)),d.find(".toggle_show_values").trigger("change"),a(".toggle-options").sortable({handle:".dashicons-sort"}),k||e.find(".toggle_label_field").last().focus()}),a(".caldera-editor-body").on("click",".toggle-remove-option",function(){var c=a(this).closest(".caldera-editor-field-config-wrapper").find(".field-config").first();a(this).parent().remove(),c.trigger("change")}),a(".caldera-editor-body").on("click",".page-toggle",function(){var c=a(this),d=c.parent(),e=d.find(".button");e.removeClass("button-primary"),a(".layout-grid-panel").hide().removeClass("page-active"),a("#"+c.data("page")).show().addClass("page-active"),c.addClass("button-primary"),e.each(function(b,c){a(c).html(d.data("title")+" "+(b+1))}),1===e.length&&d.hide()}),a(".caldera-editor-body").on("blur toggle.values",".toggle_label_field",function(){var c=a(this),d=c.prev();d.val().length||d.val(c.val())}),rebuild_field_binding(),a(document).trigger("load.page")}),Handlebars.registerHelper("_options_config",function(){}),jQuery(document).ready(function(a){function b(){a(".caldera-editor-processors-panel ul").sortable({update:function(){rebuild_field_binding()}})}function c(b){var c=a(b),d=a("#"+c.val()+"-tmpl").length?a("#"+c.val()+"-tmpl").html():"",e=c.closest(".caldera-editor-processor-config-wrapper"),f=e.find(".caldera-config-processor-setup"),g=Handlebars.compile(d),h=e.find(".processor_config_string").val(),i=c.data("type");h=h.length&&i===c.val()?JSON.parse(h):processor_defaults[c.val()+"_cfg"],h||(h={}),h._id=e.prop("id"),h._name="config[processors]["+e.prop("id")+"][config]",g=a("<div>").html(g(h)),f.html(g.html()),"function"==typeof window[c.val()+"_init"]&&window[c.val()+"_init"](e.prop("id"),f),e.find(".no-conditions").length&&e.find(".toggle_option_tab").remove(),rebuild_field_binding(),baldrickTriggers()}a("body").on("click",".caldera-processor-nav a",function(b){b.preventDefault();var c=a(this);a(".caldera-processor-nav").removeClass("active"),a(".caldera-editor-processor-config-wrapper").hide(),a(c.attr("href")).show(),c.parent().addClass("active")}),a("body").on("click",".add-new-processor",function(){var d=a(this),e=Handlebars.compile(a("#processor-wrapper-tmpl").html());wrap=a(".active-processors-list"),process_conf=a(".caldera-editor-processor-config"),processid=Math.round(1e8*Math.random()),new_templ=Handlebars.compile(a("#processor-line-tmpl").html()),new_proc={id:"fp_"+processid,type:d.data("type")},wrap.append(new_templ(new_proc)),process_conf.append(e(new_proc)),a("#form_processor_baldrickModalCloser").trigger("click"),a(".caldera-processor-nav a").last().trigger("click"),a("#fp_"+processid+"_type").val(d.data("type")).trigger("change"),b(),baldrickTriggers()}),a("body").on("click",".delete-processor",function(){var c=a(this),d=c.closest(".caldera-editor-processor-config-wrapper");d.data("type"),confirm(c.data("confirm"))&&(a("."+d.prop("id")).remove(),d.remove(),a(".caldera-processor-nav a").first().trigger("click"),rebuild_field_binding())}),a("body").on("change",".caldera-select-processor-type",function(){var d=a(this),e=d.closest(".caldera-editor-processor-config-wrapper"),f=d.find('option[value="'+d.val()+'"]').text(),g=e.find(".caldera-editor-processor-title"),h=a(".caldera-processor-nav.active a");""===f&&(f=g.data("title")),g.html(f),h.html(f+' <span class="processor-line-number"></span>').parent().addClass("processor_type_"+d.val()),c(this),rebuild_field_binding()}),rebuild_field_binding(),a(".caldera-select-processor-type").each(function(a,b){c(b)}),b()}),Handlebars.registerHelper("_field",function(a){var b=this,c="",d="",e="",f=this[a.hash.slug]?' data-default="'+this[a.hash.slug]+'"':"";a.hash.required&&(c=" required"),a.hash.exclude&&(e='data-exclude="'+a.hash.exclude+'"'),a.hash.array&&(d="[]","true"!==a.hash.array&&(f='value="'+a.hash.array+'"')),out="<select "+(a.hash.type?'data-type="'+a.hash.type+'"':"")+f+" "+e+' name="'+this._name+"["+a.hash.slug+"]"+d+'" id="'+this._id+"_"+a.hash.slug+'" class="block-input field-config caldera-field-bind'+c+'">',this[a.hash.slug]?out+='<option class="bound-field" value="'+this[a.hash.slug]+'" class="bound-field"></option>':a.hash.required||(out+='<option value=""></option>');for(var g in current_form_fields){var h="";a.hash.type&&current_form_fields[g].type!==a.hash.type||(b[a.hash.slug]&&b[a.hash.slug]===g&&(h=' selected="selected"'),out+='<option value="'+g+'"'+h+">"+current_form_fields[g].label+" ["+current_form_fields[g].slug+"]</option>")}return out+="</select>",a.hash.required&&(out+='<input class="field-config" name="'+this._name+'[_required_bounds][]" type="hidden" value="'+a.hash.slug+'">'),out}),Handlebars.registerHelper("console",function(){console.log(this)});
assets/js/shortcode-insert.js CHANGED
@@ -32,7 +32,7 @@ jQuery(function($){
32
$('.caldera-modal-closer').trigger('click');
33
34
});
35
-
36
if( typeof wp !== 'undefined' && typeof wp.media !== 'undefined' ){
37
38
var media = wp.media;
@@ -90,6 +90,6 @@ jQuery(function($){
90
}
91
} );
92
}
93
- }
94
95
});//
32
$('.caldera-modal-closer').trigger('click');
33
34
});
35
+ /*
36
if( typeof wp !== 'undefined' && typeof wp.media !== 'undefined' ){
37
38
var media = wp.media;
90
}
91
} );
92
}
93
+ }*/
94
95
});//
assets/js/shortcode-insert.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){if(a("body").on("click","#caldera-forms-form-insert,#wp_fs_caldera-forms",function(b){b.preventDefault();var c=a(".caldera-forms-insert-modal");c.fadeIn(100)}),a("body").on("click",".caldera-modal-closer",function(b){b.preventDefault();var c=a(".caldera-forms-insert-modal");c.fadeOut(100)}),a("body").on("click",".caldera-form-shortcode-insert",function(b){b.preventDefault();var d,c=a(".selected-form-shortcode:checked");c.length&&(d='[caldera_form id="'+c.val()+'"]',c.prop("checked",!1),window.send_to_editor(d),a(".caldera-modal-closer").trigger("click"))}),"undefined"!=typeof wp&&"undefined"!=typeof wp.media){var b=wp.media;"function"==typeof wp.mce.views.register&&wp.mce.views.register("caldera_form",{View:{template:b.template("editor-caldera-forms"),initialize:function(a){this.shortcode=a.shortcode,this.fetch()},loadingPlaceholder:function(){return'<div class="loading-placeholder"><div class="dashicons dashicons-cf-logo"></div><div class="wpview-loading"><ins></ins></div></div>'},fetch:function(){var c=this;options={},options.context=this,options.data={action:"cf_get_form_preview",post_id:a("#post_ID").val(),atts:this.shortcode.attrs},this.form=b.ajax(options),this.dfd=this.form.done(function(a){this.form.data=a,c.render(!0)})},getHtml:function(){return this.shortcode.attrs.named,this.dfd&&"pending"===this.dfd.state()&&!this.form.length?"":this.template(this.form.data)}},edit:function(){jQuery("#caldera-forms-form-insert").trigger("click")}})}});
1
+ jQuery(function(a){a("body").on("click","#caldera-forms-form-insert,#wp_fs_caldera-forms",function(b){b.preventDefault();var c=a(".caldera-forms-insert-modal");c.fadeIn(100)}),a("body").on("click",".caldera-modal-closer",function(b){b.preventDefault();var c=a(".caldera-forms-insert-modal");c.fadeOut(100)}),a("body").on("click",".caldera-form-shortcode-insert",function(b){b.preventDefault();var d,c=a(".selected-form-shortcode:checked");c.length&&(d='[caldera_form id="'+c.val()+'"]',c.prop("checked",!1),window.send_to_editor(d),a(".caldera-modal-closer").trigger("click"))})});
assets/js/wp-baldrick-full.js ADDED
@@ -0,0 +1,4961 @@