{"version":3,"sources":["../lib/almond.js","models/whenModel.js","models/whenCollection.js","models/conditionModel.js","models/conditionCollection.js","controllers/initCollection.js","controllers/showHide.js","controllers/showHideOption.js","controllers/changeValue.js","controllers/selectDeselect.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","model","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","status","compareValues","set","_","isEmpty","equal","a","b","notequal","contains","isArray","RegExp","toLowerCase","notcontains","greater","isNumeric","parseFloat","less","greaterequal","lessequal","WhenModel","Collection","WhenCollection","checkWhen","statusResults","pluck","connectors","allAND","every","values","v","some","each","then","trigger","elseData","ConditionModel","ConditionCollection","controller","Marionette","reply","hideField","showField","conditionModel","targetFieldModel","key","viewEl","showOption","hideOption","option","getOption","visible","updateFieldModel","getFieldModel","find","changeValue","selectOption","deselectOption","selected","currentValue","without","Radio","InitCollection","ShowHide","ShowHideOption","ChangeValue","SelectDeselect","NFConditionalLogic","Application","loadControllers","onStart","nfConditionalLogic","start"],"mappings":"AAAA,CAAA,WAUA,GAAAA,GAAAC,EAAAC,GACA,SAAAC,GAUA,QAAAC,GAAAC,EAAAC,GACA,MAAAC,GAAAC,KAAAH,EAAAC,G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J,EACAI,GAAAC,UAEA/L,EAAA,OAAA;AVzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AChJA,ADiJA;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA,ADUA;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACvDA,ADwDA;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACTA,ADUA;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC9CA,AD+CA;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"front-end.js","sourcesContent":["/**\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\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} 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\n\t\t\tif( 'checkbox' == fieldModel.get( 'type' ) ){\n\t\t\t\tvar fieldValue = ( 'checked' == jQuery( el ).attr( 'checked' ) ) ? 1 : 0;\n\t\t\t} else {\n\t\t\t\tvar fieldValue = jQuery( el ).val();\n\t\t\t}\n\n\t\t\tthis.updateFieldCompare( fieldModel, null, fieldValue );\n\t\t},\n\n\t\tupdateCompare: function( value ) {\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.get( 'value' ) );\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\tthis.updateCompare( fieldValue );\n\t\t\t\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\tvar collection = new ConditionCollection( formModel.get( 'conditions' ), { formModel: formModel } );\n\t\t}\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\n\t\t\ttargetFieldModel.set( 'visible', false );\n\t\t\tif ( ! 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\ttargetFieldModel.set( 'visible', true );\n\t\t\tif ( ! targetFieldModel.get( 'clean' ) ) {\n\t\t\t\ttargetFieldModel.trigger( 'change:value', targetFieldModel );\n\t\t\t}\n\t\t\tvar viewEl = { el: nfRadio.channel( 'form-' + conditionModel.collection.formModel.get( 'id' ) ).request( 'get:el' ) };\n\t\t\tnfRadio.channel( 'form' ).request( 'init:help', viewEl );\n\t\t}\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 * Change the value of our field model, and then trigger a re-render of its view.\n\t\t\t */\n\t\t\ttargetFieldModel.set( 'value', then.value );\n\t\t\ttargetFieldModel.trigger( 'reRender', targetFieldModel );\n\t\t},\n\n\t});\n\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\t\t\t\t\tvalue.push( option.value );\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","var nfRadio = Backbone.Radio;\n\nrequire( [ 'controllers/initCollection', 'controllers/showHide', 'controllers/showHideOption', 'controllers/changeValue', 'controllers/selectDeselect' ], function( InitCollection, ShowHide, ShowHideOption, ChangeValue, SelectDeselect ) {\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 ShowHideOption();\n\t\t\tnew ChangeValue();\n\t\t\tnew SelectDeselect();\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"],"sourceRoot":"/source/"}