// Generated by CoffeeScript 2.3.2
(function() {
  var ConfigNode, Switch, call;

  ({ConfigNode} = require("@l.degener/irma-config"));

  call = require("../call");

  module.exports = Switch = class Switch extends ConfigNode {
    transform(request, settings) {
      var choice, ref, ref1, v;
      v = call(this._options.expression, ['apply'])(request, settings);
      choice = (ref = (ref1 = this._options.cases) != null ? ref1[v != null ? v : 'default'] : void 0) != null ? ref : function() {
        return function(x) {
          return x;
        };
      };
      return call(choice)(request, settings);
    }

  };

}).call(this);
