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AAQ,SAElB,GAAE,KAAK","file":"/npm/ccnq-ko-rule-target@4.1.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ccnq-ko-rule-target@4.1.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Generated by CoffeeScript 1.9.0\n(function() {\n  var assert, teacup,\n    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\n  module.exports = (require('ccnq-ko'))('rule-target', function(ko) {\n    var RuleTarget;\n    RuleTarget = (function() {\n      function RuleTarget(data) {\n        assert(data != null, 'data is required');\n        this.source_registrant = ko.observable(data.source_registrant);\n        this.gwid = ko.observable(data.gwid);\n        this.carrierid = ko.observable(data.carrierid);\n        this._validated = ko.observable(false);\n        return;\n      }\n\n      return RuleTarget;\n\n    })();\n    this.view(function(_arg) {\n      var $root, carrier_valid, carriers, chosen, gateway_valid, gateways, value;\n      value = _arg.value, $root = _arg.$root;\n      assert(value instanceof RuleTarget, 'value should be an instance of RuleTarget');\n      gateways = $root.gateways, carriers = $root.carriers;\n      assert(gateways != null, 'gateways is required');\n      assert(carriers != null, 'carriers is required');\n      chosen = value.source_registrant() === true ? 'registrant' : value.carrierid() != null ? 'carrier' : value.gwid() != null ? 'gateway' : void 0;\n      this.chosen = ko.observable(chosen);\n      this.name = \"rule-entry-chosen-\" + (Math.random());\n      this.gwid = value.gwid;\n      this.carrierid = value.carrierid;\n      gateway_valid = function(id) {\n        return (id != null) && __indexOf.call(gateways, id) >= 0;\n      };\n      carrier_valid = function(id) {\n        return (id != null) && __indexOf.call(carriers, id) >= 0;\n      };\n      this.valid = ko.computed((function(_this) {\n        return function() {\n          switch (_this.chosen()) {\n            case 'registrant':\n              _this.gwid(null);\n              _this.carrierid(null);\n              return true;\n            case 'gateway':\n              _this.carrierid(null);\n              return gateway_valid(_this.gwid());\n            case 'carrier':\n              _this.gwid(null);\n              return carrier_valid(_this.carrierid());\n            default:\n              _this.gwid(null);\n              _this.carrierid(null);\n              return false;\n          }\n        };\n      })(this));\n      this.chosen.subscribe((function(_this) {\n        return function() {\n          return value.source_registrant(_this.chosen() === 'registrant');\n        };\n      })(this));\n      this.valid.subscribe((function(_this) {\n        return function(is_valid) {\n          return value._validated(is_valid);\n        };\n      })(this));\n    });\n    return this.html(function(_arg) {\n      var a, input, label, li, text, ul;\n      a = _arg.a, ul = _arg.ul, li = _arg.li, label = _arg.label, input = _arg.input, text = _arg.text;\n      return ul('.target', function() {\n        li('.choice', function() {\n          return label(function() {\n            input({\n              type: 'radio',\n              value: 'registrant',\n              required: true,\n              bind: {\n                checked: 'chosen',\n                attr: '{name:name}'\n              }\n            });\n            return text('Use Registrant');\n          });\n        });\n        li('.choice', function() {\n          label(function() {\n            input({\n              type: 'radio',\n              value: 'carrier',\n              bind: {\n                checked: 'chosen',\n                attr: '{name:name}'\n              },\n              required: true\n            });\n            return text('Use Carrier ');\n          });\n          return input({\n            list: 'carrier',\n            name: 'carrierid',\n            bind: {\n              value: 'carrierid',\n              enable: 'chosen() === \"carrier\"'\n            },\n            required: true\n          });\n        });\n        return li('.choice', function() {\n          label(function() {\n            input({\n              type: 'radio',\n              value: 'gateway',\n              bind: {\n                checked: 'chosen',\n                attr: '{name:name}'\n              },\n              required: true\n            });\n            return text('Use Gateway ');\n          });\n          return input({\n            list: 'gateway',\n            name: 'gwid',\n            bind: {\n              value: 'gwid',\n              enable: 'chosen() === \"gateway\"'\n            },\n            required: true\n          });\n        });\n      });\n    });\n  });\n\n  teacup = require('teacup');\n\n  teacup.use((require('teacup-databind'))());\n\n  assert = require('assert');\n\n}).call(this);\n"]}