{"version":3,"sources":["../../../config-wrap-start-default.js","../lib/almond.js","models/whenModel.js","models/whenCollection.js","models/conditionModel.js","models/conditionCollection.js","controllers/initCollection.js","controllers/showHide.js","controllers/changeRequired.js","controllers/showHideOption.js","controllers/changeValue.js","controllers/selectDeselect.js","controllers/actions.js","main.js"],"names":["requirejs","require","define","undef","hasProp","obj","prop","hasOwn","call","normalize","name","baseName","nameParts","nameSegment","mapValue","foundMap","lastIndex","foundI","foundStarMap","starI","i","j","part","baseParts","split","map","config","starMap","charAt","length","nodeIdCompat","jsSuffixRegExp","test","replace","slice","concat","splice","join","indexOf","substring","makeRequire","relName","forceSync","args","aps","arguments","push","req","apply","makeNormalize","makeLoad","depName","value","defined","callDep","waiting","defining","main","Error","splitPrefix","prefix","index","makeConfig","makeMap","handlers","Object","prototype","hasOwnProperty","plugin","parts","f","n","pr","p","exports","e","module","id","uri","deps","callback","cjsModule","ret","usingExports","callbackType","load","undefined","alt","setTimeout","cfg","_defined","amd","jQuery","Backbone","Model","extend","initialize","models","options","this","get","calcModel","nfRadio","channel","collection","condition","formModel","request","listenTo","updateCalcCompare","fieldModel","on","updateFieldCompare","maybeupdateFieldCompare","updateCompare","el","keyCode","fieldValue","attr","val","this_val","Number","status","compareValues","set","_","isEmpty","equal","a","b","notequal","contains","isArray","RegExp","toLowerCase","notcontains","greater","isNumeric","parseFloat","less","greaterequal","lessequal","WhenModel","Collection","model","WhenCollection","checkWhen","statusResults","pluck","connectors","every","values","v","some","each","then","trigger","elseData","ConditionModel","ConditionCollection","Marionette","resetCollection","fieldsCollection","reply","hideField","showField","conditionModel","targetFieldModel","key","renderRecaptcha","viewEl","data","fieldID","window","response","opts","theme","sitekey","grecaptcha","render","setRequired","unsetRequired","showOption","hideOption","getOption","visible","updateFieldModel","getFieldModel","find","option","changeValue","changed","selectOption","deselectOption","selected","currentValue","without","actions","activateAction","deactivateAction","getStatus","thenObject","console","log","$id","Radio","InitCollection","ShowHide","ChangeRequired","ShowHideOption","ChangeValue","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EAAAX,QAAA,WAAAW,QC7EArK,EAAA,yBAAA,WAgCA,MA/BA8J,YAAA/F,OAAA8B,QACAsG,WAEArG,WAAA,WAIAM,EAAAC,QAAA,qBAAA4D,MAAA,kBAAAhE,KAAAmG,eAAAnG,MACAG,EAAAC,QAAA,qBAAA4D,MAAA,oBAAAhE,KAAAoG,iBAAApG,MAKAG,EAAAC,QAAA,WAAA4D,MAAA,aAAAhE,KAAAqG,UAAArG,OAGAmG,eAAA,SAAAhC,EAAAmC,GACAtG,KAAAkG,QAAAI,EAAAjC,MAAA,EACAkC,QAAAC,IAAA,oBAGAJ,iBAAA,SAAAjC,EAAAmC,GACAC,QAAAC,IAAA,qBACAxG,KAAAkG,QAAAI,EAAAjC,MAAA,GAGAgC,UAAA,SAAAI,GACA,MAAAzG,MAAAkG,QAAAO,OAMA,IAAAtG,GAAAT,SAAAgH,KCvCA5M,IAAA,6BAAA,uBAAA,6BAAA,6BAAA,0BAAA,6BAAA,uBAAA,SAAA6M,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,IAuBA,IArBApD,WAAAqD,YAAAtH,QAEAC,WAAA,SAAAE,GACAC,KAAAS,SAAAN,EAAAC,QAAA,QAAA,eAAAJ,KAAAmH,kBAGAA,gBAAA,SAAA5G,GACA,GAAAqG,GACA,GAAAC,GACA,GAAAC,GACA,GAAAC,GACA,GAAAC,GACA,GAAAC,GACA,GAAAN,GAAApG,IAGA6G,QAAA,iBAMAC,UAEAtN,EAAA,OAAA","file":"front-end.js","sourcesContent":["(function () {\n","/**\n * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/almond for details\n */\n//Going sloppy to avoid 'use strict' string cost, but strict practices should\n//be followed.\n/*jslint sloppy: true */\n/*global setTimeout: false */\n\nvar requirejs, require, define;\n(function (undef) {\n    var main, req, makeMap, handlers,\n        defined = {},\n        waiting = {},\n        config = {},\n        defining = {},\n        hasOwn = Object.prototype.hasOwnProperty,\n        aps = [].slice,\n        jsSuffixRegExp = /\\.js$/;\n\n    function hasProp(obj, prop) {\n        return hasOwn.call(obj, prop);\n    }\n\n    /**\n     * Given a relative module name, like ./something, normalize it to\n     * a real name that can be mapped to a path.\n     * @param {String} name the relative name\n     * @param {String} baseName a real name that the name arg is relative\n     * to.\n     * @returns {String} normalized name\n     */\n    function normalize(name, baseName) {\n        var nameParts, nameSegment, mapValue, foundMap, lastIndex,\n            foundI, foundStarMap, starI, i, j, part,\n            baseParts = baseName && baseName.split(\"/\"),\n            map = config.map,\n            starMap = (map && map['*']) || {};\n\n        //Adjust any relative paths.\n        if (name && name.charAt(0) === \".\") {\n            //If have a base name, try to normalize against it,\n            //otherwise, assume it is a top-level require that will\n            //be relative to baseUrl in the end.\n            if (baseName) {\n                name = name.split('/');\n                lastIndex = name.length - 1;\n\n                // Node .js allowance:\n                if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {\n                    name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');\n                }\n\n                //Lop off the last part of baseParts, so that . matches the\n                //\"directory\" and not name of the baseName's module. For instance,\n                //baseName of \"one/two/three\", maps to \"one/two/three.js\", but we\n                //want the directory, \"one/two\" for this normalization.\n                name = baseParts.slice(0, baseParts.length - 1).concat(name);\n\n                //start trimDots\n                for (i = 0; i < name.length; i += 1) {\n                    part = name[i];\n                    if (part === \".\") {\n                        name.splice(i, 1);\n                        i -= 1;\n                    } else if (part === \"..\") {\n                        if (i === 1 && (name[2] === '..' || name[0] === '..')) {\n                            //End of the line. Keep at least one non-dot\n                            //path segment at the front so it can be mapped\n                            //correctly to disk. Otherwise, there is likely\n                            //no path mapping for a path starting with '..'.\n                            //This can still fail, but catches the most reasonable\n                            //uses of ..\n                            break;\n                        } else if (i > 0) {\n                            name.splice(i - 1, 2);\n                            i -= 2;\n                        }\n                    }\n                }\n                //end trimDots\n\n                name = name.join(\"/\");\n            } else if (name.indexOf('./') === 0) {\n                // No baseName, so this is ID is resolved relative\n                // to baseUrl, pull off the leading dot.\n                name = name.substring(2);\n            }\n        }\n\n        //Apply map config if available.\n        if ((baseParts || starMap) && map) {\n            nameParts = name.split('/');\n\n            for (i = nameParts.length; i > 0; i -= 1) {\n                nameSegment = nameParts.slice(0, i).join(\"/\");\n\n                if (baseParts) {\n                    //Find the longest baseName segment match in the config.\n                    //So, do joins on the biggest to smallest lengths of baseParts.\n                    for (j = baseParts.length; j > 0; j -= 1) {\n                        mapValue = map[baseParts.slice(0, j).join('/')];\n\n                        //baseName segment has  config, find if it has one for\n                        //this name.\n                        if (mapValue) {\n                            mapValue = mapValue[nameSegment];\n                            if (mapValue) {\n                                //Match, update name to the new value.\n                                foundMap = mapValue;\n                                foundI = i;\n                                break;\n                            }\n                        }\n                    }\n                }\n\n                if (foundMap) {\n                    break;\n                }\n\n                //Check for a star map match, but just hold on to it,\n                //if there is a shorter segment match later in a matching\n                //config, then favor over this star map.\n                if (!foundStarMap && starMap && starMap[nameSegment]) {\n                    foundStarMap = starMap[nameSegment];\n                    starI = i;\n                }\n            }\n\n            if (!foundMap && foundStarMap) {\n                foundMap = foundStarMap;\n                foundI = starI;\n            }\n\n            if (foundMap) {\n                nameParts.splice(0, foundI, foundMap);\n                name = nameParts.join('/');\n            }\n        }\n\n        return name;\n    }\n\n    function makeRequire(relName, forceSync) {\n        return function () {\n            //A version of a require function that passes a moduleName\n            //value for items that may need to\n            //look up paths relative to the moduleName\n            var args = aps.call(arguments, 0);\n\n            //If first arg is not require('string'), and there is only\n            //one arg, it is the array form without a callback. Insert\n            //a null so that the following concat is correct.\n            if (typeof args[0] !== 'string' && args.length === 1) {\n                args.push(null);\n            }\n            return req.apply(undef, args.concat([relName, forceSync]));\n        };\n    }\n\n    function makeNormalize(relName) {\n        return function (name) {\n            return normalize(name, relName);\n        };\n    }\n\n    function makeLoad(depName) {\n        return function (value) {\n            defined[depName] = value;\n        };\n    }\n\n    function callDep(name) {\n        if (hasProp(waiting, name)) {\n            var args = waiting[name];\n            delete waiting[name];\n            defining[name] = true;\n            main.apply(undef, args);\n        }\n\n        if (!hasProp(defined, name) && !hasProp(defining, name)) {\n            throw new Error('No ' + name);\n        }\n        return defined[name];\n    }\n\n    //Turns a plugin!resource to [plugin, resource]\n    //with the plugin being undefined if the name\n    //did not have a plugin prefix.\n    function splitPrefix(name) {\n        var prefix,\n            index = name ? name.indexOf('!') : -1;\n        if (index > -1) {\n            prefix = name.substring(0, index);\n            name = name.substring(index + 1, name.length);\n        }\n        return [prefix, name];\n    }\n\n    /**\n     * Makes a name map, normalizing the name, and using a plugin\n     * for normalization if necessary. Grabs a ref to plugin\n     * too, as an optimization.\n     */\n    makeMap = function (name, relName) {\n        var plugin,\n            parts = splitPrefix(name),\n            prefix = parts[0];\n\n        name = parts[1];\n\n        if (prefix) {\n            prefix = normalize(prefix, relName);\n            plugin = callDep(prefix);\n        }\n\n        //Normalize according\n        if (prefix) {\n            if (plugin && plugin.normalize) {\n                name = plugin.normalize(name, makeNormalize(relName));\n            } else {\n                name = normalize(name, relName);\n            }\n        } else {\n            name = normalize(name, relName);\n            parts = splitPrefix(name);\n            prefix = parts[0];\n            name = parts[1];\n            if (prefix) {\n                plugin = callDep(prefix);\n            }\n        }\n\n        //Using ridiculous property names for space reasons\n        return {\n            f: prefix ? prefix + '!' + name : name, //fullName\n            n: name,\n            pr: prefix,\n            p: plugin\n        };\n    };\n\n    function makeConfig(name) {\n        return function () {\n            return (config && config.config && config.config[name]) || {};\n        };\n    }\n\n    handlers = {\n        require: function (name) {\n            return makeRequire(name);\n        },\n        exports: function (name) {\n            var e = defined[name];\n            if (typeof e !== 'undefined') {\n                return e;\n            } else {\n                return (defined[name] = {});\n            }\n        },\n        module: function (name) {\n            return {\n                id: name,\n                uri: '',\n                exports: defined[name],\n                config: makeConfig(name)\n            };\n        }\n    };\n\n    main = function (name, deps, callback, relName) {\n        var cjsModule, depName, ret, map, i,\n            args = [],\n            callbackType = typeof callback,\n            usingExports;\n\n        //Use name if no relName\n        relName = relName || name;\n\n        //Call the callback to define the module, if necessary.\n        if (callbackType === 'undefined' || callbackType === 'function') {\n            //Pull out the defined dependencies and pass the ordered\n            //values to the callback.\n            //Default to [require, exports, module] if no deps\n            deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;\n            for (i = 0; i < deps.length; i += 1) {\n                map = makeMap(deps[i], relName);\n                depName = map.f;\n\n                //Fast path CommonJS standard dependencies.\n                if (depName === \"require\") {\n                    args[i] = handlers.require(name);\n                } else if (depName === \"exports\") {\n                    //CommonJS module spec 1.1\n                    args[i] = handlers.exports(name);\n                    usingExports = true;\n                } else if (depName === \"module\") {\n                    //CommonJS module spec 1.1\n                    cjsModule = args[i] = handlers.module(name);\n                } else if (hasProp(defined, depName) ||\n                           hasProp(waiting, depName) ||\n                           hasProp(defining, depName)) {\n                    args[i] = callDep(depName);\n                } else if (map.p) {\n                    map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});\n                    args[i] = defined[depName];\n                } else {\n                    throw new Error(name + ' missing ' + depName);\n                }\n            }\n\n            ret = callback ? callback.apply(defined[name], args) : undefined;\n\n            if (name) {\n                //If setting exports via \"module\" is in play,\n                //favor that over return value and exports. After that,\n                //favor a non-undefined return value over exports use.\n                if (cjsModule && cjsModule.exports !== undef &&\n                        cjsModule.exports !== defined[name]) {\n                    defined[name] = cjsModule.exports;\n                } else if (ret !== undef || !usingExports) {\n                    //Use the return value from the function.\n                    defined[name] = ret;\n                }\n            }\n        } else if (name) {\n            //May just be an object definition for the module. Only\n            //worry about defining if have a module name.\n            defined[name] = callback;\n        }\n    };\n\n    requirejs = require = req = function (deps, callback, relName, forceSync, alt) {\n        if (typeof deps === \"string\") {\n            if (handlers[deps]) {\n                //callback in this case is really relName\n                return handlers[deps](callback);\n            }\n            //Just return the module wanted. In this scenario, the\n            //deps arg is the module name, and second arg (if passed)\n            //is just the relName.\n            //Normalize module name, if it contains . or ..\n            return callDep(makeMap(deps, callback).f);\n        } else if (!deps.splice) {\n            //deps is a config object, not an array.\n            config = deps;\n            if (config.deps) {\n                req(config.deps, config.callback);\n            }\n            if (!callback) {\n                return;\n            }\n\n            if (callback.splice) {\n                //callback is an array, which means it is a dependency list.\n                //Adjust args if there are dependencies\n                deps = callback;\n                callback = relName;\n                relName = null;\n            } else {\n                deps = undef;\n            }\n        }\n\n        //Support require(['a'])\n        callback = callback || function () {};\n\n        //If relName is a function, it is an errback handler,\n        //so remove it.\n        if (typeof relName === 'function') {\n            relName = forceSync;\n            forceSync = alt;\n        }\n\n        //Simulate async callback;\n        if (forceSync) {\n            main(undef, deps, callback, relName);\n        } else {\n            //Using a non-zero value because of concern for what old browsers\n            //do, and latest browsers \"upgrade\" to 4 if lower value is used:\n            //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:\n            //If want a value immediately, use require('id') instead -- something\n            //that works in almond on the global level, but not guaranteed and\n            //unlikely to work in other AMD implementations.\n            setTimeout(function () {\n                main(undef, deps, callback, relName);\n            }, 4);\n        }\n\n        return req;\n    };\n\n    /**\n     * Just drops the config on the floor, but returns req in case\n     * the config return value is used.\n     */\n    req.config = function (cfg) {\n        return req(cfg);\n    };\n\n    /**\n     * Expose module registry for debugging and tooling\n     */\n    requirejs._defined = defined;\n\n    define = function (name, deps, callback) {\n        if (typeof name !== 'string') {\n            throw new Error('See almond README: incorrect module build, no module name');\n        }\n\n        //This module may not have dependencies\n        if (!deps.splice) {\n            //deps is not an array, so probably means\n            //an object literal or factory function for\n            //the value. Adjust args.\n            callback = deps;\n            deps = [];\n        }\n\n        if (!hasProp(defined, name) && !hasProp(waiting, name)) {\n            waiting[name] = [name, deps, callback];\n        }\n    };\n\n    define.amd = {\n        jQuery: true\n    };\n}());\n\ndefine(\"../lib/almond\", function(){});\n\n","define( 'models/whenModel',[], function() {\n\tvar model = Backbone.Model.extend( {\n\t\tinitialize: function( models, options ) {\n\t\t\t/*\n\t\t\t * If our key or comparator is empty, don't do anything else.\n\t\t\t */\n\t\t\tif ( ! this.get( 'key' ) || ! this.get( 'comparator' ) ) return;\n\n\t\t\t/*\n\t\t\t * Our key could be a field or a calc.\n\t\t\t * We need to setup a listener on either the field or calc model for changes.\n\t\t\t */\n\t\t\tif ( 'calc' == this.get( 'type' ) ) { // We have a calculation key\n\t\t\t\t/*\n\t\t\t\t * Get our calc model\n\t\t\t\t */\n\t\t\t\tvar calcModel = nfRadio.channel( 'form-' + this.collection.options.condition.collection.formModel.get( 'id' ) ).request( 'get:calc', this.get( 'key' ) );\n\t\t\t\t/*\n\t\t\t\t * When we update our calculation, update our compare\n\t\t\t\t */\n\t\t\t\tthis.listenTo( calcModel, 'change:value', this.updateCalcCompare );\n\t\t\t\t/*\n\t\t\t\t * Update our compare status.\n\t\t\t\t */\n\t\t\t\tthis.updateCalcCompare( calcModel );\n\t\t\t} else { // We have a field key\n\t\t\t\t// Get our field model\n\t\t\t\tvar fieldModel = nfRadio.channel( 'form-' + options.condition.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', this.get( 'key' ) );\n\n\t\t\t\tif( 'undefined' == typeof fieldModel ) return;\n\n\t\t\t\t// When we change the value of our field, update our compare status.\n\t\t\t\tfieldModel.on( 'change:value', this.updateFieldCompare, this );\n\t\t\t\t// When we keyup in our field, maybe update our compare status.\n\t\t\t\tthis.listenTo( nfRadio.channel( 'field-' + fieldModel.get( 'id' ) ), 'keyup:field', this.maybeupdateFieldCompare );\n\t\t\t\t// Update our compare status.\n\t\t\t\tthis.updateFieldCompare( fieldModel );\n\n\t\t\t\t/*\n\t\t\t\t * TODO: This should be moved to the show_field/hide_field file because it is specific to showing and hiding.\n\t\t\t\t * Create a radio message here so that the specific JS file can hook into whenModel init.\n\t\t\t\t */\n\t\t\t\tfieldModel.on( 'change:visible', this.updateFieldCompare, this );\n\t\t\t}\n\t\t},\n\n\t\tupdateCalcCompare: function( calcModel ) {\n\t\t\tthis.updateCompare( calcModel.get( 'value' ) );\n\t\t},\n\n\t\tmaybeupdateFieldCompare: function( el, fieldModel, keyCode ) {\n\t\t\tif( 'checkbox' == fieldModel.get( 'type' ) ){\n                var fieldValue = ( 'checked' == jQuery( el ).attr( 'checked' ) ) ? 1 : 0;\n            } else if( 'listcheckbox' == fieldModel.get( 'type' ) ) {\n\t\t\t\t// This field isn't a single element, so we need to reference the fieldModel, instead of the DOM.\n                var fieldValue = fieldModel.get( 'value' ).join();\n            } else {\n\t\t\t\tvar fieldValue = jQuery( el ).val();\n\t\t\t}\n\n\n\t\t\tthis.updateFieldCompare( fieldModel, null, fieldValue );\n\t\t},\n\n\t\tupdateCompare: function( value ) {\n\t\t\tvar this_val = this.get( 'value' );\n\n\t\t\t// if this is a calcModel then let's convert to number for comparison\n\t\t\tif ( 'calc' === this.get( 'type' ) ) {\n\t\t\t\tthis_val = Number( this_val );\n\t\t\t\tvalue = Number( value );\n\t\t\t}\n\t\t\t// Check to see if the value of the field model value COMPARATOR the value of our when condition is true.\n\t\t\tvar status = this.compareValues[ this.get( 'comparator' ) ]( value, this_val );\n\t\t\tthis.set( 'status', status );\n\t\t},\n\n\t\tupdateFieldCompare: function( fieldModel, val, fieldValue ) {\n\t\t\tif ( _.isEmpty( fieldValue ) ) {\n\t\t\t\tfieldValue = fieldModel.get( 'value' );\n\t\t\t}\n\n\t\t\t// Change the value of checkboxes to match the new convention.\n\t\t\tif( 'checkbox' == fieldModel.get( 'type' ) ) {\n\t\t\t\tif( 0 == fieldValue ) {\n\t\t\t\t\tfieldValue = 'unchecked';\n\t\t\t\t} else {\n\t\t\t\t\tfieldValue = 'checked';\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.updateCompare( fieldValue );\n\n\t\t\t/*\n\t\t\t * TODO: This should be moved to the show_field/hide_field file because it is specific to showing and hiding.\n\t\t\t */\n\t\t\tif ( ! fieldModel.get( 'visible' ) ) {\n\t\t\t\tthis.set( 'status', false );\n\t\t\t}\t\t\t\n\t\t},\n\n\t\tcompareValues: {\n\t\t\t'equal': function( a, b ) {\n\t\t\t\treturn a == b;\n\t\t\t},\n\t\t\t'notequal': function( a, b ) {\n\t\t\t\treturn a != b;\n\t\t\t},\n\t\t\t'contains': function( a, b ) {\n\t\t\t\tif ( jQuery.isArray( a ) ) {\n\t\t\t\t\t/*\n\t\t\t\t\t * If a is an array, then we're searching for an index.\n\t\t\t\t\t */\n\t\t\t\t\treturn a.indexOf( b ) >= 0;\n\t\t\t\t} else {\n\t\t\t\t\t/*\n\t\t\t\t\t * If a is a string, then we're searching for a string position.\n\t\t\t\t\t *\n\t\t\t\t\t * If our b value has quotes in it, we want to find that exact word or phrase.\n\t\t\t\t\t */\n\t\t\t\t\tif ( b.indexOf( '\"' ) >= 0 ) {\n\t\t\t\t\t\tb = b.replace( /['\"]+/g, '' );\n\t\t\t\t\t\treturn new RegExp(\"\\\\b\" + b + \"\\\\b\").test( a );\n\t\t\t\t\t}\n\t\t\t\t\treturn a.toLowerCase().indexOf( b.toLowerCase() ) >= 0; \t\t\t\t\n\t\t\t\t}\n\t\t\t},\n\t\t\t'notcontains': function( a, b ) {\n\t\t\t\treturn ! this.contains( a, b );\n\t\t\t},\n\t\t\t'greater': function( a, b ) {\n\t\t\t\t/*\n\t\t\t\t * In 2.9.x, you could use the greater and less like string count.\n\t\t\t\t * i.e. if textbox > (empty string) do something.\n\t\t\t\t * This recreates that ability.\n\t\t\t\t */\n\t\t\t\tif ( jQuery.isNumeric( b ) ) {\n\t\t\t\t\treturn parseFloat( a ) > parseFloat( b );\n\t\t\t\t} else if ( 'string' == typeof a ) {\n\t\t\t\t\treturn 0 < a.length;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t},\n\t\t\t'less': function( a, b ) {\n\t\t\t\t/*\n\t\t\t\t * In 2.9.x, you could use the greater and less like string count.\n\t\t\t\t * i.e. if textbox > (empty string) do something.\n\t\t\t\t * This recreates that ability.\n\t\t\t\t */\n\t\t\t\tif ( jQuery.isNumeric( b ) ) {\n\t\t\t\t\treturn parseFloat( a ) < parseFloat( b );\n\t\t\t\t} else if ( 'string' == typeof a ) {\n\t\t\t\t\treturn 0 >= a.length;\n\t\t\t\t}\n\t\t\n\t\t\t},\n\t\t\t'greaterequal': function( a, b ) {\n\t\t\t\treturn parseFloat( a ) > parseFloat( b ) || parseFloat( a ) == parseFloat( b );\n\t\t\t},\n\t\t\t'lessequal': function( a, b ) {\n\t\t\t\treturn parseFloat( a ) < parseFloat( b ) || parseFloat( a ) == parseFloat( b );\n\t\t\t}\n\t\t} \n\t} );\n\t\n\treturn model;\n} );\n","define( 'models/whenCollection',['models/whenModel'], function( WhenModel ) {\n\tvar collection = Backbone.Collection.extend( {\n\t\tmodel: WhenModel,\n\n\t\tinitialize: function( models, options ) {\n\t\t\tthis.options = options;\n\t\t}\n\t} );\n\treturn collection;\n} );\n","define( 'models/conditionModel',[ 'models/whenCollection' ], function( WhenCollection ) {\n\tvar model = Backbone.Model.extend( {\n\t\tinitialize: function( options ) {\n\t\t\t/*\n\t\t\t * Our \"when\" statement will be like:\n\t\t\t * When field1 == value\n\t\t\t * AND field2 == value\n\t\t\t *\n\t\t\t * We need to create a collection out of this when statement, with each row as a model.\n\t\t\t */\n\t\t\tthis.set( 'when', new WhenCollection( this.get( 'when' ), { condition: this } ) );\n\t\t\t/*\n\t\t\t * When we update any of our \"when\" models' status, check to see if we should send a message.\n\t\t\t */\n\t\t\tthis.get( 'when' ).on( 'change:status', this.checkWhen, this );\n\t\t\t/*\n\t\t\t * Check our initial status;\n\t\t\t */\n\t\t\tthis.checkWhen();\n\t\t},\n\n\t\tcheckWhen: function() {\n\t\t\t/*\n\t\t\t * If we have any OR connectors, then any status being true should trigger pass.\n\t\t\t * Otherwise, we need every status to be true.\n\t\t\t */\n\t\t\tvar statusResults = this.get( 'when' ).pluck( 'status' );\n\n\t\t\tvar connectors = this.get( 'when' ).pluck( 'connector' );\n\t\t\tvar allAND = _.every( _.values( connectors ), function( v ) { return v == 'AND' }, this );\n\t\t\tif ( allAND ) {\n\t\t\t\tvar status = _.every( _.values( statusResults ), function(v) { return v; }, this );\n\t\t\t} else {\n\t\t\t\tvar status = _.some( _.values( statusResults ), function(v) { return v; }, this );\n\t\t\t}\n\n\t\t\tif ( status ) {\n\t\t\t   \t/*\n\t\t\t \t * Send out a request for each of our \"then\" statements.\n\t\t\t \t */\n\t\t\t\t_.each( this.get( 'then' ), function( then, index ) {\n\t\t\t\t\tnfRadio.channel( 'condition:trigger' ).request( then.trigger, this, then );\n\t\t\t\t}, this );\t\t\t \n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * Send out a request for each of our \"else\" statements.\n\t\t\t\t */\n\t\t\t\t_.each( this.get( 'else' ), function( elseData, index ) {\n\t\t\t\t\tnfRadio.channel( 'condition:trigger' ).request( elseData.trigger, this, elseData );\n\t\t\t\t}, this );\n\t\t\t}\n\t\t}\n\t} );\n\t\n\treturn model;\n} );\n","define( 'models/conditionCollection',['models/conditionModel'], function( ConditionModel ) {\n\tvar collection = Backbone.Collection.extend( {\n\t\tmodel: ConditionModel,\n\n\t\tinitialize: function( models, options ) {\n\t\t\tthis.formModel = options.formModel;\n\t\t}\n\t} );\n\treturn collection;\n} );\n","/**\n * Initialise condition collection\n * \n * @package Ninja Forms Conditional Logic\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'controllers/initCollection',[ 'models/conditionCollection' ], function( ConditionCollection ) {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function( formModel ) {\n\t\t\tthis.collection = new ConditionCollection( formModel.get( 'conditions' ), { formModel: formModel } );\n            this.listenTo(nfRadio.channel('fields'), 'reset:collection', this.resetCollection);\n\t\t},\n        resetCollection: function( fieldsCollection ) {\n            var formModel = fieldsCollection.options.formModel;\n            this.collection = new ConditionCollection( formModel.get( 'conditions' ), { formModel: formModel } );\n        }\n\t});\n\n\treturn controller;\n} );\n","/**\n * Handle showing/hiding fields\n * \n * @package Ninja Forms Conditional Logic\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'controllers/showHide',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'hide_field', this.hideField, this );\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'show_field', this.showField, this );\n\t\t},\n\n\t\thideField: function( conditionModel, then ) {\n\t\t\tvar targetFieldModel = nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\n\t\t\tif( 'undefined' == typeof targetFieldModel ) return;\n\t\t\ttargetFieldModel.set( 'visible', false );\n            if ( ! targetFieldModel.get( 'clean' ) ) {\n\t\t\t\ttargetFieldModel.trigger( 'change:value', targetFieldModel );\n\t\t\t}\n\t\t\t\n\t\t\tnfRadio.channel( 'fields' ).request( 'remove:error', targetFieldModel.get( 'id' ), 'required-error' );\n\t\t},\n\n\t\tshowField: function( conditionModel, then ) {\n\t\t\tvar targetFieldModel = nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\t\t\t//TODO: Add an error to let the user know the show/hide field is empty.\n\t\t\tif( 'undefined' == typeof targetFieldModel ) return;\n\t\t\ttargetFieldModel.set( 'visible', true );\n            if ( ! targetFieldModel.get( 'clean' ) ) {\n                targetFieldModel.trigger( 'change:value', targetFieldModel );\n\t\t\t}\n\t\t\tif ( 'recaptcha' === targetFieldModel.get( 'type' ) ) {\n\t\t\t\tthis.renderRecaptcha();\n\t\t\t}\n\t\t\tvar viewEl = { el: nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:el' ) };\n            nfRadio.channel( 'form' ).request( 'init:help', viewEl );\n\t\t},\n\n\t\trenderRecaptcha: function() {\n\t\t\tjQuery( '.g-recaptcha' ).each( function() {\n                var callback = jQuery( this ).data( 'callback' );\n                var fieldID = jQuery( this ).data( 'fieldid' );\n                if ( typeof window[ callback ] !== 'function' ){\n                    window[ callback ] = function( response ) {\n                        nfRadio.channel( 'recaptcha' ).request( 'update:response', response, fieldID );\n                    };\n                }\n\t\t\t\tvar opts = {\n\t\t\t\t\ttheme: jQuery( this ).data( 'theme' ),\n\t\t\t\t\tsitekey: jQuery( this ).data( 'sitekey' ),\n\t\t\t\t\tcallback: callback\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tgrecaptcha.render( jQuery( this )[0], opts );\n\t\t\t} );\n\t\t}\n\t});\n\n\treturn controller;\n} );\n","/**\n * Setting/unsetting required.\n * \n * @package Ninja Forms Conditional Logic\n * @copyright (c) 2019 WP Ninjas\n * @since 3.0\n */\ndefine( 'controllers/changeRequired',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'set_required', this.setRequired, this );\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'unset_required', this.unsetRequired, this );\n\t\t},\n\n\t\tsetRequired: function( conditionModel, then ) {\n\t\t\tvar targetFieldModel = nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\n\t\t\tif( 'undefined' == typeof targetFieldModel ) return;\n            targetFieldModel.set( 'required', 1 );\n\t\t\ttargetFieldModel.trigger( 'reRender', targetFieldModel );\n\t\t},\n\n\t\tunsetRequired: function( conditionModel, then ) {\n\t\t\tvar targetFieldModel = nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\n\t\t\tif( 'undefined' == typeof targetFieldModel ) return;\n            targetFieldModel.set( 'required', 0 );\n            targetFieldModel.trigger( 'reRender', targetFieldModel );\n            // Ensure we resolve any errors when the field is no longer required.\n\t\t\tnfRadio.channel( 'fields' ).request( 'remove:error', targetFieldModel.get( 'id' ), 'required-error' );\n        }\n        \n\t});\n\n\treturn controller;\n} );\n","/**\n * Handle adding or removing an option from our list\n * \n * @package Ninja Forms Conditional Logic\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'controllers/showHideOption',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'show_option', this.showOption, this );\n\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'hide_option', this.hideOption, this );\n\t\t},\n\n\t\tshowOption: function( conditionModel, then ) {\n\t\t\tvar option = this.getOption( conditionModel, then );\n\t\t\toption.visible = true;\n\t\t\tthis.updateFieldModel( conditionModel, then );\n\t\t},\n\n\t\thideOption: function( conditionModel, then ) {\n\t\t\tvar option = this.getOption( conditionModel, then );\n\t\t\toption.visible = false;\n\t\t\tthis.updateFieldModel( conditionModel, then );\n\t\t},\n\n\t\tgetFieldModel: function( conditionModel, then ) {\n\t\t\treturn nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\t\t},\n\n\t\tgetOption: function( conditionModel, then ) {\n\t\t\tvar targetFieldModel = this.getFieldModel( conditionModel, then );\n\t\t\tvar options = targetFieldModel.get( 'options' );\n\t\t\treturn _.find( options, function( option ) { return option.value == then.value } );\n\t\t},\n\n\t\tupdateFieldModel: function( conditionModel, then ) {\n\t\t\tvar targetFieldModel = this.getFieldModel( conditionModel, then );\n\t\t\tvar options = targetFieldModel.get( 'options' );\n\t\t\ttargetFieldModel.set( 'options', options );\n\t\t\ttargetFieldModel.trigger( 'reRender' );\n\t\t}\n\t});\n\n\treturn controller;\n} );\n","/**\n * Handle changing a field's value\n * \n * @package Ninja Forms Conditional Logic\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'controllers/changeValue',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'change_value', this.changeValue, this );\n\t\t},\n\n\t\tchangeValue: function( conditionModel, then ) {\n\t\t\tvar targetFieldModel = nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\t\t\t/*\n\t\t\t * If we have a checkbox then we need to change the value that is set\n\t\t\t * of the then variable to a 1 or 0 to re-render on the front end when\n\t\t\t * the condition is met.\n\t\t\t */\n\t\t\tif( 'checkbox' == targetFieldModel.get( 'type' ) ) {\n\t\t\t\t// We also need to do the opposite of the value that is in the changed model.\n\t\t\t\tif( 'unchecked' == targetFieldModel.changed.value ) {\n\t\t\t\t\tthen.value = 1;\n                } else if( 'checked' == targetFieldModel ) {\n\t\t\t\t\tthen.value = 0;\n\t\t\t\t}\n\t\t\t}\n            /*\n             * Change the value of our field model, and then trigger a re-render of its view.\n             */\n\t\t\ttargetFieldModel.set( 'value', then.value );\n\t\t\ttargetFieldModel.trigger( 'reRender', targetFieldModel );\n\t\t},\n\n\t});\n\treturn controller;\n} );\n","/**\n * Handle selecting/deselecting list options\n * \n * @package Ninja Forms Conditional Logic\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'controllers/selectDeselect',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tinitialize: function() {\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'select_option', this.selectOption, this );\n\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'deselect_option', this.deselectOption, this );\n\t\t},\n\n\t\tselectOption: function( conditionModel, then ) {\n\t\t\t/*\n\t\t\t * Get our field model and set this option's \"selected\" property to 1\n\t\t\t */\n\t\t\tvar targetFieldModel = nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\n\n\t\t\tif( _.contains( [ 'listselect', 'listcountry', 'liststate' ], targetFieldModel.get( 'type' ) ) ) { // TODO: Make this more dynamic.\n\t\t\t\ttargetFieldModel.set('clean', false); // Allows for changes to default values.\n\t\t\t}\n\n\t\t\tvar options = targetFieldModel.get( 'options' );\n\n\t\t\tvar option = _.find( options, { value: then.value } );\n\t\t\toption.selected = 1;\n\n\t\t\ttargetFieldModel.set( 'options', options );\n\n\t\t\tif( _.contains( [ 'listselect', 'listcountry', 'liststate' ], targetFieldModel.get( 'type' ) ) ) { // TODO: Make this more dynamic.\n\t\t\t\ttargetFieldModel.set( 'value', option.value ); // Propagate the selected option to the model's value.\n\t\t\t} else {\n\t\t\t\tvar value = targetFieldModel.get( 'value' );\n\t\t\t\tif ( _.isArray( value ) ) {\n                    if ( 0 > value.indexOf( option.value ) ) {\n                        value.push( option.value );\n                        // Set the value to nothing so it knows that something has changed.\n                        targetFieldModel.set( 'value', '' );\n                    }\n\t\t\t\t} else {\n\t\t\t\t\tvalue = option.value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttargetFieldModel.set( 'value', value ); // Propagate the selected option to the model's value.\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Re render our field\n\t\t\t */\n\t\t\ttargetFieldModel.trigger( 'reRender', targetFieldModel );\n\t\t},\n\n\t\tdeselectOption: function( conditionModel, then ) {\n\t\t\t/*\n\t\t\t * When we are trying to deselect our option, we need to change it's \"selected\" property to 0 AND change its value.\n\t\t\t */\n\t\t\tvar targetFieldModel = nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:fieldByKey', then.key );\n\n\t\t\t/*\n\t\t\t * Set \"selected\" to 0.\n\t\t\t */\n\t\t\tvar options = targetFieldModel.get( 'options' );\n\t\t\tvar option = _.find( options, { value: then.value } );\n\t\t\toption.selected = 0;\n\t\t\ttargetFieldModel.set( 'options', options );\n\n\t\t\t/*\n\t\t\t * Update our value\n\t\t\t */\n\t\t\tvar currentValue = targetFieldModel.get( 'value' );\n\t\t\tif ( _.isArray( currentValue ) ) {\n\t\t\t\tcurrentValue = _.without( currentValue, then.value );\n\t\t\t} else {\n\t\t\t\tcurrentValue = '';\n\t\t\t}\n\t\t\ttargetFieldModel.set( 'value', currentValue );\n\n\t\t\t/*\n\t\t\t * Re render our field\n\t\t\t */\n\t\t\ttargetFieldModel.trigger( 'reRender', targetFieldModel );\n\t\t},\n\n\t});\n\n\treturn controller;\n} );\n","/**\n * Keep an internal record for which actions are active and deactive.\n * \n * @package Ninja Forms Conditional Logic\n * @copyright (c) 2016 WP Ninjas\n * @since 3.0\n */\ndefine( 'controllers/actions',[], function() {\n\tvar controller = Marionette.Object.extend( {\n\t\tactions: {},\n\t\t\n\t\tinitialize: function() {\n\t\t\t/*\n\t\t\t * Listen for activate/deactivate action messages.\n\t\t\t */\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'activate_action', this.activateAction, this );\n\t\t\tnfRadio.channel( 'condition:trigger' ).reply( 'deactivate_action', this.deactivateAction, this );\n\t\t\n\t\t\t/*\n\t\t\t * Reply to requests for action status.\n\t\t\t */\n\t\t\tnfRadio.channel( 'actions' ).reply( 'get:status', this.getStatus, this );\n\t\t},\n\n\t\tactivateAction: function( conditionModel, thenObject ) {\n\t\t\tthis.actions[ thenObject.key ] = true;\n\t\t\tconsole.log( 'activate action' );\n\t\t},\n\n\t\tdeactivateAction: function( conditionModel, thenObject ) {\n\t\t\tconsole.log( 'deactivate action' );\n\t\t\tthis.actions[ thenObject.key ] = false;\n\t\t},\n\n\t\tgetStatus: function( $id ) {\n\t\t\treturn this.actions[ $id ];\n\t\t}\n\t});\n\n\treturn controller;\n} );\n","var nfRadio = Backbone.Radio;\n\nrequire( [ 'controllers/initCollection', 'controllers/showHide', 'controllers/changeRequired', 'controllers/showHideOption', 'controllers/changeValue', 'controllers/selectDeselect', 'controllers/actions' ], function( InitCollection, ShowHide, ChangeRequired, ShowHideOption, ChangeValue, SelectDeselect, Actions ) {\n\n\tvar NFConditionalLogic = Marionette.Application.extend( {\n\n\t\tinitialize: function( options ) {\n\t\t\tthis.listenTo( nfRadio.channel( 'form' ), 'after:loaded', this.loadControllers );\n\t\t},\n\n\t\tloadControllers: function( formModel ) {\n\t\t\tnew ShowHide();\n\t\t\tnew ChangeRequired();\n\t\t\tnew ShowHideOption();\n\t\t\tnew ChangeValue();\n\t\t\tnew SelectDeselect();\n\t\t\tnew Actions();\n\t\t\tnew InitCollection( formModel );\n\t\t},\n\n\t\tonStart: function() {\n\t\t\t\n\t\t}\n\t} );\n\n\tvar nfConditionalLogic = new NFConditionalLogic();\n\tnfConditionalLogic.start();\n} );\ndefine(\"main\", function(){});\n\n"]}